Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

update tinymce

ammarahm-ed236e7c73f6f4
diff --git a/apps/mobile/babel.config.js b/apps/mobile/babel.config.js
index 05226461e..7c6341171 100644
--- a/apps/mobile/babel.config.js
+++ b/apps/mobile/babel.config.js
@@ -1,6 +1,6 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
- //"transform-remove-console"
+ "transform-remove-console"
]
};
diff --git a/apps/mobile/html/Web.bundle/site/dist/main.js b/apps/mobile/html/Web.bundle/site/dist/main.js
index b2a1f2428..18a6c2b97 100644
--- a/apps/mobile/html/Web.bundle/site/dist/main.js
+++ b/apps/mobile/html/Web.bundle/site/dist/main.js
@@ -1 +1 @@
-(()=>{var t={7499:(t,e,n)=>{const{addPluginToPluginManager:r}=n(3994);function o(t){!function(t){t.ui.registry.addIcon("download",'<svg height="24" width="24"><path d="M13,5V11H14.17L12,13.17L9.83,11H11V5H13M15,3H9V9H5L12,16L19,9H15V3M19,18H5V20H19V18Z" /></svg>'),t.ui.registry.addButton("download",{icon:"download",tooltip:"Download attachment",onAction:()=>{const e=t.selection.getNode();if(!e||!t.settings.attachmenthandler_download_attachment)return;const n=e.getAttribute("data-hash");t.settings.attachmenthandler_download_attachment(n)}}),t.ui.registry.addButton("delete",{icon:"close",tooltip:"Remove attachment",onAction:()=>{t.undoManager.transact((()=>{t.execCommand("Delete")}))}}),t.ui.registry.addContextToolbar("attachment-selection",{predicate:function(t){return"IMG"!==t.nodeName&&t.classList.contains("attachment")},items:"download delete",position:"node"})}(t),t.addCommand("mceAttachImage",(function(e){!async function(t,e){var n=`\n <img class="attachment"\n alt="${e.filename||e.hash}"\n data-mime="${e.type}"\n data-hash="${e.hash}"\n data-filename="${e.filename}"\n src="${e.dataurl}"\n data-size="${e.size}"\n style="float: left;"/>\n `;t.undoManager.transact((()=>{t.insertContent(n),t.execCommand("mceInsertNewLine")}))}(t,e)})),t.addCommand("mceAttachFile",(function(e){!async function(t,e){var n=`\n <span\n class="attachment"\n contenteditable="false"\n title="${e.filename}"\n data-mime="${e.type}"\n data-filename="${e.filename}"\n data-hash="${e.hash}"\n data-size="${function(t,e=2){if(0===t)return"0B";const n=1024,r=e<0?0:e,o=["B","K","M","G","T","P","E","Z","Y"],i=Math.floor(Math.log(t)/Math.log(n));return parseFloat((t/Math.pow(n,i)).toFixed(r))+o[i]}(e.size,1)}">\n <em>&nbsp;</em>\n <span class="filename">${e.filename}</span>\n </span>`;t.undoManager.transact((()=>{t.insertContent(n)}))}(t,e)})),t._replaceImage=async function(e){const{hash:n,src:r}=e,o=t.dom.doc.querySelectorAll(`img[data-hash="${n}"]`);if(o&&o.length&&r)for(let t of o){const e=i(r);e?t.src=URL.createObjectURL(e):console.error("Could not convert data uri to blob.")}},t._updateAttachmentProgress=function(e){const{hash:n,total:r,loaded:o}=e,i=t.dom.doc.querySelectorAll(`span.attachment[data-hash="${n}"]`);if(i&&i.length&&r&&o)for(let t of i){const e=Math.round(o/r*100);e>=100?(t.removeAttribute("data-progress"),t.style.removeProperty("--progress")):(t.setAttribute("data-progress",`${e}%`),t.style.setProperty("--progress",`${e}%`))}}}function i(t){const e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return null;const r=n[1],o=e[1],i=1024,a=atob(o),u=a.length,c=Math.ceil(u/i),s=new Array(c);for(let t=0;t<c;++t){const e=t*i,n=Math.min(e+i,u),r=new Array(n-e);for(let t=e,o=0;t<n;++o,++t)r[o]=a[t].charCodeAt(0);s[t]=new Uint8Array(r)}return new Blob(s,{type:r})}r("attachmentshandler",o)},2680:(t,e,n)=>{const{addPluginToPluginManager:r}=n(3994);function o(t){t.on("NewBlock",(e=>{const n=e.newBlock;n&&"BLOCKQUOTE"===n.parentElement.tagName&&t.execCommand("mceToggleFormat",!1,"blockquote")}))}r("blockescape",o)},9722:(t,e,n)=>{const{addPluginToPluginManager:r}=n(3994),o="tox-checklist",i="tox-checklist--checked";function a(t){t.addCommand("insertChecklist",(function(){u(t)})),t.ui.registry.addToggleButton("checklist",{icon:"checklist",active:!1,tooltip:"Checklist",onAction:()=>u(t),onSetup:function(e){return function(t,e){var n=function(t){var n=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return[i];if(n(i,r))break}return}(t.parents,c,s);n&&(n=n.filter((function(t){return t.className===o})).length>0),e(n)},r=t.dom.getParents(t.selection.getNode());return n({parents:r}),t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}(t,e.setActive)}}),t.on("mousedown",(function(e){var n=e.target,r=n.parentElement;e.offsetX>0||r.className!==o||"LI"!==n.nodeName||(e.preventDefault(),f(t,n))}),{capture:!0,passive:!1}),t.on("touchstart",(function(e){var n=e.target,r=n.parentElement;e.targetTouches.length>0||e.targetTouches[0].clientX>45||r.className!==o||"LI"!==n.nodeName||(e.preventDefault(),f(t,n))}),{capture:!0,passive:!1})}function u(t){t.selection.getNode().classList.contains(o)?t.undoManager.transact((function(){t.execCommand("RemoveList")})):t.execCommand("InsertUnorderedList",!1,{"list-style-type":"none","list-attributes":{class:o}})}var c=l(/^(OL|UL|DL)$/),s=l(/^(TH|TD)$/);function l(t){return function(e){return e&&t.test(e.nodeName)}}function f(t,e){t.undoManager.transact((function(){e.className=e.className===i?"":i}))}r("checklist",a)},9325:(t,e,n)=>{const{addPluginToPluginManager:r,getCharacterRange:o,moveCaretTo:i,getCurrentLine:a}=n(3994),{createCodeBlock:u,isCodeBlock:c,TAGNAME:s,state:l}=n(4250),{addCodeBlockToolbar:f,refreshHighlighting:d}=n(2362),m="&nbsp;&nbsp;";function g(t){f(t),t.addCommand("mceInsertCodeBlock",(function(e,n){h(t,e,n)})),t.ui.registry.addToggleButton("codeblock",{icon:"code-sample",tooltip:"Codeblock",onAction:function(e){return h(t,e)},onSetup:e=>v(e,t)})}var h=function(t,e,n){if(e&&e.isActive&&e.isActive()){const e=t.selection.getNode();let n=e.textContent;n?t.selection.setContent(`<p>${n}</p>`):function(t,e){t.undoManager.transact((function(){const n=document.createElement("p");n.innerHTML="<br>",t.focus(),t.dom.insertAfter(n,e),setTimeout((()=>{t.selection.select(n,!0),t.selection.collapse(!0),t.nodeChanged({selectionChange:!0})}),0)}))}(t,e)}else{var r=t.selection.getContent({format:"text"});"shortcut"===n&&(r="<br>"),r||(r="<br>"),function(t,e){t.undoManager.transact((function(){const n=u(e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.insertContent(`${n.outerHTML}<p><br></p>`),setTimeout((()=>{const e=t.dom.select('*[data-mce-id="__mcenew"]')[0];t.dom.setAttrib(e,"data-mce-id",null),t.selection.select(e,!0),t.selection.collapse(!0),t.nodeChanged({selectionChange:!0})}),0)}))}(t,r)}};var p=!1,v=function(t,e){function n(e){t.setActive(e.element.tagName===s)}function r(t){"<pre></pre>"===t.content&&(t.preventDefault(),p=!0,h(e,void 0,"shortcut"))}function u(t){const n=e.selection.getNode();c(n)&&"mceInsertContent"===t.command&&t.value&&t.value.paste&&(t.value.content=t.value.content.replace(/<p>/gm,"").replace(/<\/p>|<br \/>/gm,"\n")),p&&"mceInsertNewLine"===t.command&&(t.preventDefault(),p=!1)}function f(t){const n=l.activeBlock;n&&("Tab"===t.code?(t.preventDefault(),function(t,n){const r=o(n);if(!r)return;const a=t.shiftKey,u=n.innerText;if(r.start!==r.end){let[t,e,o]=[u.substring(0,r.start),u.substring(r.start,r.end),u.substring(r.end)],s=t;const l=e.split("\n");for(var c=0;c<l.length;++c){const t=l[c];l[c]=a?t.replace(m,""):`${m}${t}`}s+=l.join("\n"),s+=o,n.innerHTML=s;const f=a?r.end-2*l.length:r.end+2*l.length;i(n,r.start,f)}else e.selection.setContent(m)}(t,n)):t.ctrlKey&&"KeyA"===t.code?(t.preventDefault(),function(t){e.selection.select(t,!0)}(n)):"Enter"===t.code&&function(t){const n=a(t),r=(n.length-n.trimStart().length)/2;e.insertContent(m.repeat(r))}(n))}function g(t){"Enter"!==t.code&&"Space"!==t.code&&"Backspace"!==t.code&&"Tab"!==t.code||d(e)}return e.on("BeforeExecCommand",u),e.on("BeforeSetContent",r),e.on("NodeChange",n),e.on("keydown",f),e.on("keyup",g),function(){e.off("BeforeExecCommand",u),e.off("BeforeSetContent",r),e.off("keydown",f),e.off("keyup",g),e.off("NodeChange",n)}};r("codeblock",g),t.exports={processPastedContent:function(t){if(t&&t.childNodes)for(let e of t.childNodes)if("PRE"===e.tagName){e.className="hljs";const t=e.textContent||e.innerText;e.innerHTML=t}}}},1027:t=>{t.exports=[{name:"Plain text",shortname:"plaintext"},{name:"HTML, XML",shortname:"xml"},{name:"Bash",shortname:"bash"},{name:"C",shortname:"c"},{name:"C++",shortname:"cpp"},{name:"C#",shortname:"csharp"},{name:"CSS",shortname:"css"},{name:"Markdown",shortname:"markdown"},{name:"Diff",shortname:"diff"},{name:"Ruby",shortname:"ruby"},{name:"Go",shortname:"go"},{name:"TOML, also INI",shortname:"ini"},{name:"Java",shortname:"java"},{name:"Javascript",shortname:"javascript"},{name:"JSON",shortname:"json"},{name:"Kotlin",shortname:"kotlin"},{name:"Less",shortname:"less"},{name:"Lua",shortname:"lua"},{name:"Makefile",shortname:"makefile"},{name:"Perl",shortname:"perl"},{name:"Objective-C",shortname:"objectivec"},{name:"php",shortname:"php"},{name:"PHP template",shortname:"php-template"},{name:"Python",shortname:"python"},{name:"python-repl",shortname:"python-repl"},{name:"R",shortname:"r"},{name:"Rust",shortname:"rust"},{name:"SCSS",shortname:"scss"},{name:"Shell Session",shortname:"shell"},{name:"SQL",shortname:"sql"},{name:"Swift",shortname:"swift"},{name:"YAML",shortname:"yaml"},{name:"TypeScript",shortname:"typescript"},{name:"Visual Basic .NET",shortname:"vbnet"},{name:"1C:Enterprise",shortname:"1c"},{name:"Augmented Backus-Naur Form",shortname:"abnf"},{name:"Apache Access Log",shortname:"accesslog"},{name:"ActionScript",shortname:"actionscript"},{name:"Ada",shortname:"ada"},{name:"AngelScript",shortname:"angelscript"},{name:"Apache config",shortname:"apache"},{name:"AppleScript",shortname:"applescript"},{name:"ArcGIS Arcade",shortname:"arcade"},{name:"Arduino",shortname:"arduino"},{name:"ARM Assembly",shortname:"armasm"},{name:"AsciiDoc",shortname:"asciidoc"},{name:"AspectJ",shortname:"aspectj"},{name:"AutoHotkey",shortname:"autohotkey"},{name:"AutoIt",shortname:"autoit"},{name:"AVR Assembly",shortname:"avrasm"},{name:"Awk",shortname:"awk"},{name:"X++",shortname:"axapta"},{name:"BASIC",shortname:"basic"},{name:"Backus–Naur Form",shortname:"bnf"},{name:"Brainfuck",shortname:"brainfuck"},{name:"C/AL",shortname:"cal"},{name:"Cap’n Proto",shortname:"capnproto"},{name:"Ceylon",shortname:"ceylon"},{name:"Clean",shortname:"clean"},{name:"Clojure",shortname:"clojure"},{name:"Clojure REPL",shortname:"clojure-repl"},{name:"CMake",shortname:"cmake"},{name:"CoffeeScript",shortname:"coffeescript"},{name:"Coq",shortname:"coq"},{name:"Caché Object Script",shortname:"cos"},{name:"crmsh",shortname:"crmsh"},{name:"Crystal",shortname:"crystal"},{name:"CSP",shortname:"csp"},{name:"D",shortname:"d"},{name:"Dart",shortname:"dart"},{name:"Delphi",shortname:"delphi"},{name:"Django",shortname:"django"},{name:"DNS Zone",shortname:"dns"},{name:"Dockerfile",shortname:"dockerfile"},{name:"Batch file (DOS)",shortname:"dos"},{name:"dsconfig",shortname:"dsconfig"},{name:"Device Tree",shortname:"dts"},{name:"Dust",shortname:"dust"},{name:"Extended Backus-Naur Form",shortname:"ebnf"},{name:"Elixir",shortname:"elixir"},{name:"Elm",shortname:"elm"},{name:"ERB",shortname:"erb"},{name:"Erlang REPL",shortname:"erlang-repl"},{name:"Erlang",shortname:"erlang"},{name:"Excel formulae",shortname:"excel"},{name:"FIX",shortname:"fix"},{name:"Flix",shortname:"flix"},{name:"Fortran",shortname:"fortran"},{name:"F#",shortname:"fsharp"},{name:"GAMS",shortname:"gams"},{name:"GAUSS",shortname:"gauss"},{name:"G-code (ISO 6983)",shortname:"gcode"},{name:"Gherkin",shortname:"gherkin"},{name:"GLSL",shortname:"glsl"},{name:"GML",shortname:"gml"},{name:"Golo",shortname:"golo"},{name:"Gradle",shortname:"gradle"},{name:"Groovy",shortname:"groovy"},{name:"HAML",shortname:"haml"},{name:"Handlebars",shortname:"handlebars"},{name:"Haskell",shortname:"haskell"},{name:"Haxe",shortname:"haxe"},{name:"HSP",shortname:"hsp"},{name:"HTTP",shortname:"http"},{name:"Hy",shortname:"hy"},{name:"Inform 7",shortname:"inform7"},{name:"IRPF90",shortname:"irpf90"},{name:"ISBL",shortname:"isbl"},{name:"JBoss CLI",shortname:"jboss-cli"},{name:"Julia",shortname:"julia"},{name:"Julia REPL",shortname:"julia-repl"},{name:"Lasso",shortname:"lasso"},{name:"LaTeX",shortname:"latex"},{name:"LDIF",shortname:"ldif"},{name:"Leaf",shortname:"leaf"},{name:"Lisp",shortname:"lisp"},{name:"LiveCode",shortname:"livecodeserver"},{name:"LiveScript",shortname:"livescript"},{name:"LLVM IR",shortname:"llvm"},{name:"LSL (Linden Scripting Language)",shortname:"lsl"},{name:"Mathematica",shortname:"mathematica"},{name:"Matlab",shortname:"matlab"},{name:"Maxima",shortname:"maxima"},{name:"MEL",shortname:"mel"},{name:"Mercury",shortname:"mercury"},{name:"MIPS Assembly",shortname:"mipsasm"},{name:"Mizar",shortname:"mizar"},{name:"Mojolicious",shortname:"mojolicious"},{name:"Monkey",shortname:"monkey"},{name:"MoonScript",shortname:"moonscript"},{name:"N1QL",shortname:"n1ql"},{name:"Nested Text",shortname:"nestedtext"},{name:"Nginx config",shortname:"nginx"},{name:"Nim",shortname:"nim"},{name:"Nix",shortname:"nix"},{name:"Node REPL",shortname:"node-repl"},{name:"NSIS",shortname:"nsis"},{name:"OCaml",shortname:"ocaml"},{name:"OpenSCAD",shortname:"openscad"},{name:"Oxygene",shortname:"oxygene"},{name:"Parser3",shortname:"parser3"},{name:"Packet Filter config",shortname:"pf"},{name:"PostgreSQL",shortname:"pgsql"},{name:"Pony",shortname:"pony"},{name:"PowerShell",shortname:"powershell"},{name:"Processing",shortname:"processing"},{name:"Python profiler",shortname:"profile"},{name:"Prolog",shortname:"prolog"},{name:".properties",shortname:"properties"},{name:"Protocol Buffers",shortname:"protobuf"},{name:"Puppet",shortname:"puppet"},{name:"PureBASIC",shortname:"purebasic"},{name:"Q",shortname:"q"},{name:"QML",shortname:"qml"},{name:"ReasonML",shortname:"reasonml"},{name:"RenderMan RIB",shortname:"rib"},{name:"Roboconf",shortname:"roboconf"},{name:"Microtik RouterOS script",shortname:"routeros"},{name:"RenderMan RSL",shortname:"rsl"},{name:"Oracle Rules Language",shortname:"ruleslanguage"},{name:"SAS",shortname:"sas"},{name:"Scala",shortname:"scala"},{name:"Scheme",shortname:"scheme"},{name:"Scilab",shortname:"scilab"},{name:"Smali",shortname:"smali"},{name:"Smalltalk",shortname:"smalltalk"},{name:"SML (Standard ML)",shortname:"sml"},{name:"SQF",shortname:"sqf"},{name:"Stan",shortname:"stan"},{name:"Stata",shortname:"stata"},{name:"STEP Part 21",shortname:"step21"},{name:"Stylus",shortname:"stylus"},{name:"SubUnit",shortname:"subunit"},{name:"Tagger Script",shortname:"taggerscript"},{name:"Test Anything Protocol",shortname:"tap"},{name:"Tcl",shortname:"tcl"},{name:"Thrift",shortname:"thrift"},{name:"TP",shortname:"tp"},{name:"Twig",shortname:"twig"},{name:"Vala",shortname:"vala"},{name:"Visual Basic .NET",shortname:"vbnet"},{name:"VBScript",shortname:"vbscript"},{name:"VBScript in HTML",shortname:"vbscript-html"},{name:"Verilog",shortname:"verilog"},{name:"VHDL",shortname:"vhdl"},{name:"Vim Script",shortname:"vim"},{name:"WebAssembly",shortname:"wasm"},{name:"Wren",shortname:"wren"},{name:"Intel x86 Assembly",shortname:"x86asm"},{name:"XL",shortname:"xl"},{name:"XQuery",shortname:"xquery"},{name:"Zephir",shortname:"zephir"}]},2362:(t,e,n)=>{const{persistSelection:r}=n(3994),{TAGNAME:o,state:i}=n(4250),a=n(1027),u=".tox-pop__dialog span.tox-tbtn__select-label";function c(t,e="Plain text"){!function(t){const e=document.querySelector(u);if(!e||e.textContent===t)return;e.textContent=t}(e),t.ui.registry.addSplitButton("languages",{text:e,onAction:async()=>{if(!("Plain text"===e))return;const n=l(i.activeBlock);s(t,n)},onItemAction:async(e,n)=>{await s(t,n)},select:t=>t&&t.name===e,fetch:t=>t(i.languages)})}async function s(t,e){c(t,"Loading"),await f(t,e.shortname),c(t,e.name)}function l(t){if(!t||t.tagName!==o)return;const e=d(t).split("-");return e.length<=1?void 0:e[1]}async function f(t,e){if(!e)return;let n=await g(t);n.getLanguage(e)||await async function(t,e){let n=await g(t);if(!n)return;if(m[e])return n.getLanguage(e);const r=`https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/languages/${e}.min.js`;await h(t,r);const o=n.getLanguage(e);m[e]=o}(t,e);const o=i.activeBlock;r(o,(()=>{const t=n.highlight(o.innerText,{language:e});o.innerHTML=t.value.replace(/\n/gm,"<br>")})),function(t,e){const n=d(t);if(n===e)return;n?t.classList.replace(n,e):t.classList.add(e)}(o,`language-${e}`),t.save(),t.setDirty(!1)}function d(t){for(let e of t.classList.values())if(e.startsWith("language")||e.startsWith("lang"))return e;return""}const m={};async function g(t){if(n.g.hljs)return n.g.hljs;return await h(t,"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/highlight.min.js"),n.g.hljs}function h(t,e){return new Promise((n=>{const r=t.dom.doc,o=r.createElement("script");o.src=e,r.head.appendChild(o),o.addEventListener("load",(()=>{n()}))}))}t.exports={addCodeBlockToolbar:function(t){i.languages.length!==a.length&&a.forEach((t=>{i.languages.push({type:"choiceitem",text:t.name,value:t})})),c(t),t.ui.registry.addContextToolbar("codeblock-selection",{predicate:e=>{if(e.nodeName===o){i.activeBlock=e;const n=l(e),r=a.find((t=>t.shortname===n));return c(t,r&&r.name),!0}return i.activeBlock=null,!1},items:"copy languages",position:"node"})},refreshHighlighting:async function(t){const e=l(i.activeBlock);await f(t,e)}}},4250:t=>{const e="PRE";t.exports={createCodeBlock:function(t){const n=document.createElement(e);return n.spellcheck=!1,n.classList.add("hljs"),n.innerHTML=t,n},isCodeBlock:function(t){return t.nodeName===e},TAGNAME:e,state:{activeBlock:null,languages:[]}}},4048:(t,e,n)=>{const{addPluginToPluginManager:r}=n(3994),o="CODE";function i(t){t.ui.registry.addToggleButton("inlinecode",{icon:"sourcecode",tooltip:"Inline code",onAction:function(){return a(t)},onSetup:function(e){var n=function(t){t.element.tagName!==o||t.element.innerHTML.trim().length||t.element.remove(),e.setActive(t.element.tagName===o)};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}}),t.addCommand("mceInsertInlineCode",(function(){a(t)}))}function a(t){t.undoManager.transact((()=>{t.focus();const e=t.selection.getRng();if(t.selection.getNode().tagName!==o&&e.startOffset===e.endOffset)t.selection.setContent('<code spellcheck="false">&#xFEFF;</code>');else{const e=t.selection.getContent();t.selection.setContent(`<code spellcheck="false">${e}</code>`)}}))}r("inlinecode",i)},7804:(t,e,n)=>{const{addPluginToPluginManager:r}=n(3994);function o(t){!function(t){if(!n.g.tinymce.Env.os.isAndroid())return;const e={previousSelection:{},selection:{},forcePreserveSelection:!1};t.on("beforeinput",(n=>{if("deleteContentBackward"===n.inputType){if(0!==e.previousSelection.offset)return;const n=t.selection.getRng();e.selection={container:n.startContainer,offset:n.startOffset},n.startContainer.textContent.endsWith(" ")&&(e.selection.offset-=1),e.forcePreserveSelection=!0}else e.selection={},e.forcePreserveSelection=!1})),t.on("keydown",(n=>{const r=t.selection.getRng();e.previousSelection={offset:r.startOffset,container:r.startContainer}})),t.on("keyup",(n=>{if(e.forcePreserveSelection){e.forcePreserveSelection=!1,n.preventDefault();const r=t.selection.getRng();r.setStart(e.selection.container,e.selection.offset),r.setEnd(e.selection.container,e.selection.offset)}}))}(t),function(t){if(!n.g.tinymce.Env.os.isAndroid())return;const e={};t.on("beforeinput",(t=>{"insertCompositionText"===t.inputType?t.data&&t.data.endsWith("\n")&&e.isKeyUnidentified&&(e.isKeyUnidentified=null,e.forceMoveSelectionToNextNode=!0):(e.isKeyUnidentified=null,e.forceMoveSelectionToNextNode=!1)})),t.on("keydown",(t=>{e.isKeyUnidentified="Unidentified"===t.key})),t.on("keyup",(n=>{if(e.forceMoveSelectionToNextNode){e.forceMoveSelectionToNextNode=!1,n.preventDefault();let r,o=t.selection.getRng().startContainer.parentElement;for(;o.parentElement&&!o.parentElement.classList.contains("mce-content-body");)o=o.parentElement;if(r=o.nextElementSibling,!r)return;r.innerHTML="<br>",t.selection.setCursorLocation(r,0)}}))}(t),function(t){if(!n.g.tinymce.Env.os.isAndroid())return;t.on("SelectionChange",(()=>{const e=t.selection.getNode();if(e.textContent.length>1&&65279===e.textContent.charCodeAt(0)){const n=t.selection.getRng();e.textContent=e.textContent.substring(1),n.setStart(e,n.startOffset+1),t.selection.setRng(n)}}))}(t)}r("keyboardquirks",o)},1014:()=>{var t,e,n,r,o,i,a,u,c,s,l,f,d,m,g,h,p,v,b,y,w,x,C,S,k,T,O,E,_,R,N,A,D,M,B,z,P,L,I,H,F,V,j,U,W,q,$,G,K,X,Y,J,Q,Z,tt,et,nt,rt,ot,it,at,ut,ct,st,lt,ft,dt,mt,gt,ht,pt,vt,bt,yt,wt,xt,Ct,St,kt,Tt,Ot,Et,_t,Rt,Nt,At,Dt,Mt,Bt,zt,Pt,Lt,It,Ht,Ft,Vt,jt,Ut,Wt,qt,$t;a=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},u=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(t){return!function(t){return null==t}(t)},t="function",s=function(e){return typeof e===t},l=function(){},d=(f=function(t){return function(){return t}})(!1),m=f(!0),g=function(){return h},e=function(t){return t.isNone()},h={fold:function(t,e){return t()},is:d,isSome:d,isNone:m,getOr:r=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:f(null),getOrUndefined:f(void 0),or:r,orThunk:n,map:g,each:l,bind:g,exists:d,forall:m,filter:g,equals:e,equals_:e,toArray:function(){return[]},toString:f("none()")},v={some:p=function(t){var e=f(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:m,isNone:d,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return p(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:h},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(d,(function(e){return n(t,e)}))}};return o},none:g,from:function(t){return null==t?h:p(t)}},b=Array.prototype.slice,y=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},w=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},x=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},C=s(Array.from)?Array.from:function(t){return b.call(t)},S=function(){var t=a(v.none());return{clear:function(){return t.set(v.none())},set:function(e){return t.set(v.some(e))},isSet:function(){return t.get().isSome()},on:function(e){return t.get().each(e)}}},k=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},T=tinymce.util.Tools.resolve("tinymce.Env"),O=tinymce.util.Tools.resolve("tinymce.util.Delay"),E=tinymce.util.Tools.resolve("tinymce.util.Promise"),_=tinymce.util.Tools.resolve("tinymce.util.VK"),R=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},N=tinymce.util.Tools.resolve("tinymce.util.Tools"),A=function(t){return t.getParam("paste_data_images",!1)},D=function(t){return t.getParam("paste_merge_formats",!0)},M=function(t){return t.getParam("paste_retain_style_properties")},B=function(t){return t.getParam("validate")},z=function(t){return t.getParam("allow_html_data_urls",!1,"boolean")},P=function(t){return t.getParam("paste_data_images",!1,"boolean")},L=function(t){return N.explode(t.getParam("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"))},I="x-tinymce/html",H="\x3c!-- x-tinymce/html --\x3e",F=function(t){return-1!==t.indexOf(H)},V=function(){return I},j=tinymce.util.Tools.resolve("tinymce.html.Entities"),U=function(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+j.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",a=N.map(r,(function(t){return t.split(/\n/).join("<br />")}));return 1===a.length?a[0]:N.map(a,(function(t){return o+t+i})).join("")},W=tinymce.util.Tools.resolve("tinymce.html.DomParser"),q=tinymce.util.Tools.resolve("tinymce.html.Serializer"),$=" ",G=tinymce.util.Tools.resolve("tinymce.html.Node"),K=tinymce.util.Tools.resolve("tinymce.html.Schema"),X=function(t,e){return N.each(e,(function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])})),t},Y=function(t){return t=X(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(t,e,n){return e||n?$:" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},J=function(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs-internal-guid-/.test(t)},Q=function(t){var e;return t=t.replace(/^[\u00a0 ]+/,""),N.each([/^[IVXLMCD]+\.[ \u00a0]/,/^[ivxlmcd]+\.[ \u00a0]/,/^[a-z]{1,2}[.)][ \u00a0]/,/^[A-Z]{1,2}[.)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],(function(n){if(n.test(t))return e=!0,!1})),e},Z=function(t,e,n,r){var o,i={},a=t.dom.parseStyle(r);return N.each(a,(function(a,u){switch(u){case"mso-list":(o=/\w+ \w+([0-9]+)/i.exec(r))&&(n._listLevel=parseInt(o[1],10)),/Ignore/i.test(a)&&n.firstChild&&(n._listIgnore=!0,n.firstChild._listIgnore=!0);break;case"horiz-align":u="text-align";break;case"vert-align":u="vertical-align";break;case"font-color":case"mso-foreground":u="color";break;case"mso-background":case"mso-highlight":u="background";break;case"font-weight":case"font-style":return void("normal"!==a&&(i[u]=a));case"mso-element":if(/^(comment|comment-list)$/i.test(a))return void n.remove()}0!==u.indexOf("mso-comment")?0!==u.indexOf("mso-")&&("all"===M(t)||e&&e[u])&&(i[u]=a):n.remove()})),/(bold)/i.test(i["font-weight"])&&(delete i["font-weight"],n.wrap(new G("b",1))),/(italic)/i.test(i["font-style"])&&(delete i["font-style"],n.wrap(new G("i",1))),(i=t.dom.serializeStyle(i,n.name))||null},tt=function(t,e){var n,r=M(t);r&&(n=N.makeMap(r.split(/[, ]/))),e=X(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,$],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return e.length>0?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join($):""}]]);var o=function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")}(t),i=K({valid_elements:o,valid_children:"-li[p]"});N.each(i.elements,(function(t){t.attributes.class||(t.attributes.class={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))}));var a=W({},i);a.addAttributeFilter("style",(function(e){for(var r,o=e.length;o--;)(r=e[o]).attr("style",Z(t,n,r,r.attr("style"))),"span"===r.name&&r.parent&&!r.attributes.length&&r.unwrap()})),a.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)})),a.addNodeFilter("del",(function(t){for(var e=t.length;e--;)t[e].remove()})),a.addNodeFilter("a",(function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()}));var u=a.parse(e);return function(t){return t.getParam("paste_convert_word_fake_lists",!0)}(t)&&function(t){for(var e,n,r=1,o=function(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)do{e+=o(t)}while(t=t.next);return e},i=function(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!i(t,e))return!1}while(t=t.next);return!0},a=function(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)do{a(t)}while(t=t.next)},u=function(t,o,u){var c=t._listLevel||r;c!==r&&(c<r?e&&(e=e.parent.parent):(n=e,e=null)),e&&e.name===o?e.append(t):(n=n||e,e=new G(o,1),u>1&&e.attr("start",""+u),t.wrap(e)),t.name="li",c>r&&n&&n.lastChild.append(e),r=c,a(t),i(t,/^\u00a0+/),i(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),i(t,/^\u00a0+/)},c=[],s=t.firstChild;null!=s;)if(c.push(s),null!==(s=s.walk()))for(;void 0!==s&&s.parent!==t;)s=s.walk();for(var l=0;l<c.length;l++)if("p"===(t=c[l]).name&&t.firstChild){var f=o(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(f)){u(t,"ul");continue}if(Q(f)){var d=/([0-9]+)\./.exec(f),m=1;d&&(m=parseInt(d[1],10)),u(t,"ol",m);continue}if(t._listLevel){u(t,"ul",1);continue}e=null}else n=e,e=null}(u),e=q({validate:B(t)},i).serialize(u)},et=function(t,e){return{content:t,cancelled:e}},nt=function(t,e,n,r){var o=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})}(t,e,n,r),i=function(t,e){var n=W({},t.schema);n.addNodeFilter("meta",(function(t){N.each(t,(function(t){t.remove()}))}));var r=n.parse(e,{forced_root_block:!1,isRootContent:!0});return q({validate:B(t)},t.schema).serialize(r)}(t,o.content);return t.hasEventListeners("PastePostProcess")&&!o.isDefaultPrevented()?function(t,e,n,r){var o=t.dom.create("div",{style:"display:none"},e),i=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})}(t,o,n,r);return et(i.node.innerHTML,i.isDefaultPrevented())}(t,i,n,r):et(i,o.isDefaultPrevented())},rt=function(t,e,n){var r=J(e),o=r?function(t,e){return function(t){return t.getParam("paste_enable_default_filters",!0)}(t)?tt(t,e):e}(t,e):e;return nt(t,o,n,r)},ot=function(t,e){return t.insertContent(e,{merge:D(t),paste:!0}),!0},it=function(t){return/^https?:\/\/[\w?\-/+=.&%@~#]+$/i.test(t)},at=function(t,e){return it(e)&&y(L(t),(function(t){return n=e.toLowerCase(),r="."+t.toLowerCase(),k(n,r,n.length-r.length);var n,r}))},ut=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!it(e))&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.execCommand("mceInsertLink",!1,e)})),!0}(t,e,n)},ct=function(t,e,n){return!!at(t,e)&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.insertContent('<img src="'+e+'">')})),!0}(t,e,n)},st=function(t,e,n){n||!1===function(t){return t.getParam("smart_paste",!0)}(t)?ot(t,e):function(t,e){N.each([ut,ct,ot],(function(n){return!0!==n(t,e,ot)}))}(t,e)},lt=function(t){return"\n"===t||"\r"===t},ft=function(t,e){var n,r,o,i,a=(n=" ",(r=function(t){return t.getParam("paste_tab_spaces",4,"number")}(t))<=0?"":new Array(r+1).join(n)),u=e.replace(/\t/g,a);return(o=function(t,e){return function(t){return-1!==" \f\t\v".indexOf(t)}(e)||e===$?t.pcIsSpace||""===t.str||t.str.length===u.length-1||function(t,e){return e<t.length&&e>=0&&lt(t[e])}(u,t.str.length+1)?{pcIsSpace:!1,str:t.str+$}:{pcIsSpace:!0,str:t.str+" "}:{pcIsSpace:lt(e),str:t.str+e}},i={pcIsSpace:!1,str:""},x(u,(function(t){i=o(i,t)})),i).str},dt=function(t,e,n,r){var o=rt(t,e,n);!1===o.cancelled&&st(t,o.content,r)},mt=function(t,e,n){var r=n||F(e);dt(t,function(t){return t.replace(H,"")}(e),r,!1)},gt=function(t,e){var n=t.dom.encode(e).replace(/\r\n/g,"\n"),r=function(t,e,n){return e?U(t,!0===e?"p":e,n):function(t){return t.replace(/\r?\n/g,"<br>")}(t)}(ft(t,n),function(t){return t.getParam("forced_root_block")}(t),function(t){return t.getParam("forced_root_block_attrs")}(t));dt(t,r,!1,!0)},ht=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&n.length>0&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(t){e[o]=""}}}return e},pt=function(t,e){return e in t&&t[e].length>0},vt=function(t){return pt(t,"text/html")||pt(t,"text/plain")},o="mceclip",i=0,bt=function(){return o+i++},yt=function(t,e){var n,r,o=(n=e.uri,(r=/data:([^;]+);base64,([a-z0-9+/=]+)/i.exec(n))?{type:r[1],data:decodeURIComponent(r[2])}:{type:null,data:null}),i=o.data,a=o.type,u=bt(),s=e.blob,l=new Image;if(l.src=e.uri,function(t,e){var n=function(t){return t.getParam("images_dataimg_filter")}(t);return!n||n(e)}(t,l)){var f=t.editorUpload.blobCache,d=void 0,m=f.getByData(i,a);if(m)d=m;else{var g=function(t){return t.getParam("images_reuse_filename")}(t)&&c(s.name),h=g?function(t,e){var n=e.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return c(n)?t.dom.encode(n[1]):null}(t,s.name):u,p=g?s.name:void 0;d=f.create(u,s,i,h,p),f.add(d)}mt(t,'<img src="'+d.blobUri()+'">',!1)}else mt(t,'<img src="'+e.uri+'">',!1)},wt=function(t){return E.all(w(t,(function(t){return new E((function(e){var n=function(t){return c(t.getAsFile)}(t)?t.getAsFile():t,r=new window.FileReader;r.onload=function(){e({blob:n,uri:r.result})},r.readAsDataURL(n)}))})))},xt=function(t){var e=L(t);return function(t){return function(t,e){return k(t,e,0)}(t.type,"image/")&&y(e,(function(e){return n=e.toLowerCase(),r={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"},(N.hasOwn(r,n)?"image/"+r[n]:"image/"+n)===t.type;var n,r}))}},Ct=function(t,e,n){var r="paste"===e.type?e.clipboardData:e.dataTransfer;if(P(t)&&r){var o=function(t,e){var n=e.items?w(C(e.items),(function(t){return t.getAsFile()})):[],r=e.files?C(e.files):[];return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(n.length>0?n:r,xt(t))}(t,r);if(o.length>0)return e.preventDefault(),wt(o).then((function(e){n&&t.selection.setRng(n),x(e,(function(e){yt(t,e)}))})),!0}return!1},St=function(t){return _.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},kt=function(t,e,n){var r,o=S(),i=S();t.on("keyup",i.clear),t.on("keydown",(function(n){var a=function(t){St(t)&&!t.isDefaultPrevented()&&e.remove()};if(St(n)&&!n.isDefaultPrevented()){if((r=n.shiftKey&&86===n.keyCode)&&T.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(n.stopImmediatePropagation(),o.set(n),i.set(!0),T.ie&&r)return n.preventDefault(),void function(t,e){t.fire("paste",{ieFake:e})}(t,!0);e.remove(),e.create(),t.once("keyup",a),t.once("paste",(function(){t.off("keyup",a)}))}}));var a=function(t,n,r,o,i){var a;pt(n,"text/html")?a=n["text/html"]:(a=e.getHtml(),i=i||F(a),e.isDefaultContent(a)&&(o=!0)),a=Y(a),e.remove();const u=t.selection.getNode();u&&"PRE"===u.tagName&&(o=!0);var c=!1===i&&!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(a),s=it(a);(!a.length||c&&!s)&&(o=!0),(o||s)&&(a=pt(n,"text/plain")&&c?n["text/plain"]:function(t){var e=K(),n=W({},e),r="",o=e.getShortEndedElements(),i=N.makeMap("script noscript style textarea video audio iframe object"," "),a=e.getBlockElements(),u=function(t){var e=t.name,n=t;if("br"!==e){if("wbr"!==e)if(o[e]&&(r+=" "),i[e])r+=" ";else{if(3===t.type&&(r+=t.value),!t.shortEnded&&(t=t.firstChild))do{u(t)}while(t=t.next);a[e]&&n.next&&(r+="\n","p"===e&&(r+="\n"))}}else r+="\n"};return t=X(t,[/<!\[[^\]]+\]>/g]),u(n.parse(t)),r}(a)),e.isDefaultContent(a)?r||t.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):o?gt(t,a):mt(t,a,i)};t.on("paste",(function(u){var c=o.isSet()||i.isSet();c&&o.clear();var s=function(t,e){return ht(e.clipboardData||t.getDoc().dataTransfer)}(t,u),l="text"===n.get()||r,f=pt(s,V());r=!1,u.isDefaultPrevented()||function(t){var e=t.clipboardData;return-1!==navigator.userAgent.indexOf("Android")&&e&&e.items&&0===e.items.length}(u)?e.remove():vt(s)||!Ct(t,u,e.getLastRng()||t.selection.getRng())?(c||u.preventDefault(),!T.ie||c&&!u.ieFake||pt(s,"text/html")||(e.create(),t.dom.bind(e.getEl(),"paste",(function(t){t.stopPropagation()})),t.getDoc().execCommand("Paste",!1,null),s["text/html"]=e.getHtml()),pt(s,"text/html")?(u.preventDefault(),f||(f=F(s["text/html"])),a(t,s,c,l,f)):O.setEditorTimeout(t,(function(){a(t,s,c,l,f)}),0)):e.remove()}))},Tt=function(t){return T.ie&&t.inline?document.body:t.getBody()},Ot=function(t,e,n){(function(t){return Tt(t)!==t.getBody()})(t)&&t.dom.bind(e,"paste keyup",(function(e){Rt(t,n)||t.fire("paste")}))},Et=function(t){return t.dom.get("mcepastebin")},_t=function(t,e){return e===t},Rt=function(t,e){var n,r=Et(t);return(n=r)&&"mcepastebin"===n.id&&_t(e,r.innerHTML)},Nt=function(t){var e=a(null),n="%MCEPASTEBIN%";return{create:function(){return function(t,e,n){var r=t.dom,o=t.getBody();e.set(t.selection.getRng());var i=t.dom.add(Tt(t),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n);(T.ie||T.gecko)&&r.setStyle(i,"left","rtl"===r.getStyle(o,"direction",!0)?65535:-65535),r.bind(i,"beforedeactivate focusin focusout",(function(t){t.stopPropagation()})),Ot(t,i,n),i.focus(),t.selection.select(i,!0)}(t,e,n)},remove:function(){return function(t,e){if(Et(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return Et(t)},getHtml:function(){return function(t){var e=function(e,n){e.appendChild(n),t.dom.remove(n,!0)},n=N.grep(Tt(t).childNodes,(function(t){return"mcepastebin"===t.id})),r=n.shift();N.each(n,(function(t){e(r,t)}));for(var o=t.dom.select("div[id=mcepastebin]",r),i=o.length-1;i>=0;i--){var a=t.dom.create("div");r.insertBefore(a,o[i]),e(a,o[i])}return r?r.innerHTML:""}(t)},getLastRng:function(){return function(t){return t.get()}(e)},isDefault:function(){return Rt(t,n)},isDefaultContent:function(t){return _t(n,t)}}},At=function(t,e){var n=Nt(t);return t.on("PreInit",(function(){return function(t,e,n){var r;kt(t,e,n),t.parser.addNodeFilter("img",(function(e,n,o){var i=function(t){t.attr("data-mce-object")||r===T.transparentSrc||t.remove()},a=function(t){return 0===t.indexOf("webkit-fake-url")},u=function(t){return 0===t.indexOf("data:")};if(!P(t)&&function(t){return t.data&&!0===t.data.paste}(o))for(var c=e.length;c--;)(r=e[c].attr("src"))&&(a(r)||!z(t)&&u(r))&&i(e[c])}))}(t,n,e)})),{pasteFormat:e,pasteHtml:function(e,n){return mt(t,e,n)},pasteText:function(e){return gt(t,e)},pasteImageData:function(e,n){return Ct(t,e,n)},getDataTransferItems:ht,hasHtmlOrText:vt,hasContentType:pt}},Dt=function(t,e){t.addCommand("mceTogglePlainTextPaste",(function(){!function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),R(t,!1)):(e.pasteFormat.set("text"),R(t,!0)),t.focus()}(t,e)})),t.addCommand("mceInsertClipboardContent",(function(t,n){n.content&&e.pasteHtml(n.content,n.internal),n.text&&e.pasteText(n.text)}))},Mt=function(t,e,n){if(!function(t){return!1===T.iOS&&"function"==typeof(null==t?void 0:t.setData)}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(V(),e),!0}catch(t){return!1}},Bt=function(t,e,n,r){Mt(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)},zt=function(t){return function(e,n){var r=function(t){return H+t}(e),o=t.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),i=t.dom.create("div",{contenteditable:"true"},r);t.dom.setStyles(o,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),o.appendChild(i),t.dom.add(t.getBody(),o);var a=t.selection.getRng();i.focus();var u=t.dom.createRng();u.selectNodeContents(i),t.selection.setRng(u),O.setTimeout((function(){t.selection.setRng(a),o.parentNode.removeChild(o),n()}),0)}},Pt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},Lt=function(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)},It=function(t){t.on("cut",function(t){return function(e){Lt(t)&&Bt(e,Pt(t),zt(t),(function(){if(T.browser.isChrome()||T.browser.isFirefox()){var e=t.selection.getRng();O.setEditorTimeout(t,(function(){t.selection.setRng(e),t.execCommand("Delete")}),0)}else t.execCommand("Delete")}))}}(t)),t.on("copy",function(t){return function(e){Lt(t)&&Bt(e,Pt(t),zt(t),l)}}(t))},Ht=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Ft=function(t,e){return Ht.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},Vt=function(t,e){t.focus(),t.selection.setRng(e)},jt=function(t,e){t.on("PastePreProcess",(function(n){n.content=e(t,n.content,n.internal,n.wordContent)}))},Ut=function(t,e){if(!J(e))return e;var n=[];N.each(t.schema.getBlockElements(),(function(t,e){n.push(e)}));var r=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return e=X(e,[[r,"$1"]]),e=X(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])},Wt=function(t,e,n,r){if(r||n)return e;var o,i=function(t){return t.getParam("paste_webkit_styles")}(t);if(!1===function(t){return t.getParam("paste_remove_styles_if_webkit",!0)}(t)||"all"===i)return e;if(i&&(o=i.split(/[, ]/)),o){var a=t.dom,u=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(function(t,e,n,r){var i=a.parseStyle(a.decode(n)),c={};if("none"===o)return e+r;for(var s=0;s<o.length;s++){var l=i[o[s]],f=a.getStyle(u,o[s],!0);/color/.test(o[s])&&(l=a.toHex(l),f=a.toHex(f)),f!==l&&(c[o[s]]=l)}return(c=a.serializeStyle(c,"span"))?e+' style="'+c+'"'+r:e+r}))}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(function(t,e,n,r){return e+' style="'+n+'"'+r}))},qt=function(t,e){t.$("a",e).find("font,u").each((function(e,n){t.dom.remove(n,!0)}))},$t=function(t,e){return function(n){n.setActive("text"===e.pasteFormat.get());var r=function(t){return n.setActive(t.state)};return t.on("PastePlainTextToggle",r),function(){return t.off("PastePlainTextToggle",r)}}},u.add("paste",(function(t){if(!1===function(t){return!!t.hasPlugin("powerpaste",!0)&&(void 0!==window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0)}(t)){var e=a(!1),n=a(function(t){return t.getParam("paste_as_text",!1)}(t)?"text":"html"),r=At(t,n),o=function(t){T.webkit&&jt(t,Wt),T.ie&&(jt(t,Ut),function(t,e){t.on("PastePostProcess",(function(n){e(t,n.node)}))}(t,qt))}(t);return function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:$t(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:$t(t,e)})}(t,r),Dt(t,r),function(t){var e=t.plugins.paste,n=function(t){return t.getParam("paste_preprocess")}(t);n&&t.on("PastePreProcess",(function(t){n.call(e,e,t)}));var r=function(t){return t.getParam("paste_postprocess")}(t);r&&t.on("PastePostProcess",(function(t){r.call(e,e,t)}))}(t),It(t),function(t,e,n){(function(t){return t.getParam("paste_block_drop",!1)})(t)&&t.on("dragend dragover draggesture dragdrop drop drag",(function(t){t.preventDefault(),t.stopPropagation()})),A(t)||t.on("drop",(function(t){var e=t.dataTransfer;e&&e.files&&e.files.length>0&&t.preventDefault()})),t.on("drop",(function(r){var o=Ft(t,r);if(!r.isDefaultPrevented()&&!n.get()){var i,a=e.getDataTransferItems(r.dataTransfer),u=e.hasContentType(a,V());if((e.hasHtmlOrText(a)&&(!(i=a["text/plain"])||0!==i.indexOf("file://"))||!e.pasteImageData(r,o))&&o&&function(t){return t.getParam("paste_filter_drop",!0)}(t)){var c=a["mce-internal"]||a["text/html"]||a["text/plain"];c&&(r.preventDefault(),O.setEditorTimeout(t,(function(){t.undoManager.transact((function(){a["mce-internal"]&&t.execCommand("Delete"),Vt(t,o),c=Y(c),a["text/html"]?e.pasteHtml(c,u):e.pasteText(c)}))})))}}})),t.on("dragstart",(function(t){n.set(!0)})),t.on("dragover dragend",(function(e){A(t)&&!1===n.get()&&(e.preventDefault(),Vt(t,Ft(t,e))),"dragend"===e.type&&n.set(!1)}))}(t,r,e),function(t,e){return{clipboard:t,quirks:e}}(r,o)}}))},3994:(t,e,n)=>{const r=n(3554);function o(t){if(!t)return;const e=r.getSelection().saveCharacterRanges(t);if(!e||!e.length)return;const{characterRange:n}=e[0];return n}t.exports={getCurrentLine:function(t){const e=o(t),n=t.innerText.split("\n");let r="",i=0;for(let t of n){let n=i+t.length+1;if(e.start===n){r=t;break}i+=t.length+1}return r},getCharacterRange:o,moveCaretTo:function(t,e,n){const o={characterRange:{start:e,end:n||e}};r.getSelection().restoreCharacterRanges(t,[o])},persistSelection:function(t,e){let n=r.getSelection().saveCharacterRanges(t);e(),r.getSelection().restoreCharacterRanges(t,n)},getNextCharacter:function(t,e){return e?(t.textContent||t.innerText).substring(e.end,e.end+1):""},getPreviousCharacter:function(t,e){return e?(t.textContent||t.innerText).substring(e.start,e.start-1):""},addPluginToPluginManager:function(t,e){if(!n.g.tinymce)throw new Error(`Please import tinymce before importing the ${t} plugin.`);n.g.tinymce.PluginManager.add(t,e)}}},2968:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/dark/content.css"},6202:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/dark/content.min.css"},7286:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/default/content.css"},7362:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/default/content.min.css"},287:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/document/content.css"},2271:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/document/content.min.css"},5417:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/writer/content.css"},874:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/writer/content.min.css"},3341:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.css"},8786:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.inline.css"},4243:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.inline.min.css"},9702:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.min.css"},1389:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.mobile.css"},3513:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.mobile.min.css"},1064:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/fonts/tinymce-mobile.woff"},8057:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.css"},6332:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.min.css"},4429:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.mobile.css"},18:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.mobile.min.css"},7899:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.shadowdom.css"},7548:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.shadowdom.min.css"},9506:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.css"},8273:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.inline.css"},7251:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.inline.min.css"},6122:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.min.css"},993:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.mobile.css"},8215:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.mobile.min.css"},9916:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/fonts/tinymce-mobile.woff"},8382:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.css"},4522:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.min.css"},108:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.mobile.css"},8537:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.mobile.min.css"},818:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.shadowdom.css"},6913:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.shadowdom.min.css"},9008:function(t,e,n){var r,o;void 0===(o="function"==typeof(r=function(){var t="object",e="function",n="undefined",r=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],o=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],i=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],a=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function u(n,r){var o=typeof n[r];return o==e||!(o!=t||!n[r])||"unknown"==o}function c(e,n){return!(typeof e[n]!=t||!e[n])}function s(t,e){return typeof t[e]!=n}function l(t){return function(e,n){for(var r=n.length;r--;)if(!t(e,n[r]))return!1;return!0}}var f=l(u),d=l(c),m=l(s);function g(t){return t&&f(t,a)&&m(t,i)}function h(t){return c(t,"body")?t.body:t.getElementsByTagName("body")[0]}var p,v,b={},y=typeof window!=n&&typeof document!=n,w={isHostMethod:u,isHostObject:c,isHostProperty:s,areHostMethods:f,areHostObjects:d,areHostProperties:m,isTextRange:g,getBody:h,forEach:[].forEach?function(t,e){t.forEach(e)}:function(t,e){for(var n=0,r=t.length;n<r;++n)e(t[n],n)}},x={version:"1.3.0",initialized:!1,isBrowser:y,supported:!0,util:w,features:{},modules:b,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==n||rangyAutoInitialize}};function C(t){typeof console!=n&&u(console,"log")&&console.log(t)}function S(t,e){y&&e?alert(t):C(t)}function k(t){x.initialized=!0,x.supported=!1,S("Rangy is not supported in this environment. Reason: "+t,x.config.alertOnFail)}function T(t){S("Rangy warning: "+t,x.config.alertOnWarn)}x.fail=k,x.warn=T,{}.hasOwnProperty?(w.extend=p=function(t,e,n){var r,o;for(var i in e)e.hasOwnProperty(i)&&(r=t[i],o=e[i],n&&null!==r&&"object"==typeof r&&null!==o&&"object"==typeof o&&p(r,o,!0),t[i]=o);return e.hasOwnProperty("toString")&&(t.toString=e.toString),t},w.createOptions=function(t,e){var n={};return p(n,e),t&&p(n,t),n}):k("hasOwnProperty not supported"),y||k("Rangy can only run in a browser"),function(){var t;if(y){var e=document.createElement("div");e.appendChild(document.createElement("span"));var n=[].slice;try{1==n.call(e.childNodes,0)[0].nodeType&&(t=function(t){return n.call(t,0)})}catch(t){}}t||(t=function(t){for(var e=[],n=0,r=t.length;n<r;++n)e[n]=t[n];return e}),w.toArray=t}(),y&&(u(document,"addEventListener")?v=function(t,e,n){t.addEventListener(e,n,!1)}:u(document,"attachEvent")?v=function(t,e,n){t.attachEvent("on"+e,n)}:k("Document does not have required addEventListener or attachEvent method"),w.addListener=v);var O=[];function E(t){return t.message||t.description||String(t)}function _(){if(y&&!x.initialized){var t,e=!1,n=!1;u(document,"createRange")&&(t=document.createRange(),f(t,o)&&m(t,r)&&(e=!0));var i=h(document);if(i&&"body"==i.nodeName.toLowerCase())if(i&&u(i,"createTextRange")&&g(t=i.createTextRange())&&(n=!0),e||n){var a;for(var c in x.initialized=!0,x.features={implementsDomRange:e,implementsTextRange:n},b)(a=b[c])instanceof M&&a.init(a,x);for(var s=0,l=O.length;s<l;++s)try{O[s](x)}catch(t){C("Rangy init listener threw an exception. Continuing. Detail: "+E(t))}}else k("Neither Range nor TextRange are available");else k("No body element found")}}function R(t,e,n){n&&(t+=" in module "+n.name),x.warn("DEPRECATED: "+t+" is deprecated. Please use "+e+" instead.")}function N(t,e,n,r){t[e]=function(){return R(e,n,r),t[n].apply(t,w.toArray(arguments))}}w.deprecationNotice=R,w.createAliasForDeprecatedMethod=N,x.init=_,x.addInitListener=function(t){x.initialized?t(x):O.push(t)};var A=[];function D(t){t=t||window,_();for(var e=0,n=A.length;e<n;++e)A[e](t)}function M(t,e,n){this.name=t,this.dependencies=e,this.initialized=!1,this.supported=!1,this.initializer=n}function B(t,e,n){var r=new M(t,e,(function(e){if(!e.initialized){e.initialized=!0;try{n(x,e),e.supported=!0}catch(e){C("Module '"+t+"' failed to load: "+E(e)),e.stack&&C(e.stack)}}}));return b[t]=r,r}function z(){}function P(){}x.addShimListener=function(t){A.push(t)},y&&(x.shim=x.createMissingNativeApi=D,N(x,"createMissingNativeApi","shim")),M.prototype={init:function(){for(var t,e,n=this.dependencies||[],r=0,o=n.length;r<o;++r){if(e=n[r],!((t=b[e])&&t instanceof M))throw new Error("required module '"+e+"' not found");if(t.init(),!t.supported)throw new Error("required module '"+e+"' not supported")}this.initializer(this)},fail:function(t){throw this.initialized=!0,this.supported=!1,new Error(t)},warn:function(t){x.warn("Module "+this.name+": "+t)},deprecationNotice:function(t,e){x.warn("DEPRECATED: "+t+" in module "+this.name+" is deprecated. Please use "+e+" instead")},createError:function(t){return new Error("Error in Rangy "+this.name+" module: "+t)}},x.createModule=function(t){var e,n;2==arguments.length?(e=arguments[1],n=[]):(e=arguments[2],n=arguments[1]);var r=B(t,n,e);x.initialized&&x.supported&&r.init()},x.createCoreModule=function(t,e,n){B(t,e,n)},x.RangePrototype=z,x.rangePrototype=new z,x.selectionPrototype=new P,x.createCoreModule("DomUtil",[],(function(t,e){var n="undefined",r=t.util,o=r.getBody;r.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||e.fail("document missing a Node creation method"),r.isHostMethod(document,"getElementsByTagName")||e.fail("document missing getElementsByTagName method");var i=document.createElement("div");r.areHostMethods(i,["insertBefore","appendChild","cloneNode"]||0)||e.fail("Incomplete Element implementation"),r.isHostProperty(i,"innerHTML")||e.fail("Element is missing innerHTML property");var a=document.createTextNode("test");r.areHostMethods(a,["splitText","deleteData","insertData","appendData","cloneNode"]||0)||e.fail("Incomplete Text Node implementation");var u=function(t,e){for(var n=t.length;n--;)if(t[n]===e)return!0;return!1};function c(t){var e;return typeof t.namespaceURI==n||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function s(t){var e=t.parentNode;return 1==e.nodeType?e:null}function l(t){for(var e=0;t=t.previousSibling;)++e;return e}function f(t){switch(t.nodeType){case 7:case 10:return 0;case 3:case 8:return t.length;default:return t.childNodes.length}}function d(t,e){var n,r=[];for(n=t;n;n=n.parentNode)r.push(n);for(n=e;n;n=n.parentNode)if(u(r,n))return n;return null}function m(t,e,n){for(var r=n?e:e.parentNode;r;){if(r===t)return!0;r=r.parentNode}return!1}function g(t,e){return m(t,e,!0)}function h(t,e,n){for(var r,o=n?t:t.parentNode;o;){if((r=o.parentNode)===e)return o;o=r}return null}function p(t){var e=t.nodeType;return 3==e||4==e||8==e}function v(t){if(!t)return!1;var e=t.nodeType;return 3==e||8==e}function b(t,e){var n=e.nextSibling,r=e.parentNode;return n?r.insertBefore(t,n):r.appendChild(t),t}function y(t,e,n){var r=t.cloneNode(!1);if(r.deleteData(0,e),t.deleteData(e,t.length-e),b(r,t),n)for(var o,i=0;o=n[i++];)o.node==t&&o.offset>e?(o.node=r,o.offset-=e):o.node==t.parentNode&&o.offset>l(t)&&++o.offset;return r}function w(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=n)return t.ownerDocument;if(typeof t.document!=n)return t.document;if(t.parentNode)return w(t.parentNode);throw e.createError("getDocument: no document found for node")}function x(t){var r=w(t);if(typeof r.defaultView!=n)return r.defaultView;if(typeof r.parentWindow!=n)return r.parentWindow;throw e.createError("Cannot get a window object for node")}function C(t){if(typeof t.contentDocument!=n)return t.contentDocument;if(typeof t.contentWindow!=n)return t.contentWindow.document;throw e.createError("getIframeDocument: No Document object found for iframe element")}function S(t){if(typeof t.contentWindow!=n)return t.contentWindow;if(typeof t.contentDocument!=n)return t.contentDocument.defaultView;throw e.createError("getIframeWindow: No Window object found for iframe element")}function k(t){return t&&r.isHostMethod(t,"setTimeout")&&r.isHostObject(t,"document")}function T(t,e,n){var o;if(t?r.isHostProperty(t,"nodeType")?o=1==t.nodeType&&"iframe"==t.tagName.toLowerCase()?C(t):w(t):k(t)&&(o=t.document):o=document,!o)throw e.createError(n+"(): Parameter must be a Window object or DOM node");return o}function O(t){for(var e;e=t.parentNode;)t=e;return t}function E(t,n,r,o){var i,a,u,c,s;if(t==r)return n===o?0:n<o?-1:1;if(i=h(r,t,!0))return n<=l(i)?-1:1;if(i=h(t,r,!0))return l(i)<o?-1:1;if(!(a=d(t,r)))throw new Error("comparePoints error: nodes have no common ancestor");if((u=t===a?a:h(t,a,!0))===(c=r===a?a:h(r,a,!0)))throw e.createError("comparePoints got to case 4 and childA and childB are the same!");for(s=a.firstChild;s;){if(s===u)return-1;if(s===c)return 1;s=s.nextSibling}}var _,R=!1;function N(t){try{return t.parentNode,!1}catch(t){return!0}}function A(t){if(!t)return"[No node]";if(R&&N(t))return"[Broken node]";if(p(t))return'"'+t.data+'"';if(1==t.nodeType){var e=t.id?' id="'+t.id+'"':"";return"<"+t.nodeName+e+">[index:"+l(t)+",length:"+t.childNodes.length+"]["+(t.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return t.nodeName}function D(t){for(var e,n=w(t).createDocumentFragment();e=t.firstChild;)n.appendChild(e);return n}function M(t,e,n){var r=o(t),i=t.createElement("div");i.contentEditable=""+!!n,e&&(i.innerHTML=e);var a=r.firstChild;return a?r.insertBefore(i,a):r.appendChild(i),i}function B(t){return t.parentNode.removeChild(t)}function z(t){this.root=t,this._next=t}function P(t){return new z(t)}function L(t,e){this.node=t,this.offset=e}function I(t){this.code=this[t],this.codeName=t,this.message="DOMException: "+this.codeName}!function(){var e=document.createElement("b");e.innerHTML="1";var n=e.firstChild;e.innerHTML="<br />",R=N(n),t.features.crashyTextNodes=R}(),typeof window.getComputedStyle!=n?_=function(t,e){return x(t).getComputedStyle(t,null)[e]}:typeof document.documentElement.currentStyle!=n?_=function(t,e){return t.currentStyle?t.currentStyle[e]:""}:e.fail("No means of obtaining computed style properties found"),z.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var t,e,n=this._current=this._next;if(this._current)if(t=n.firstChild)this._next=t;else{for(e=null;n!==this.root&&!(e=n.nextSibling);)n=n.parentNode;this._next=e}return this._current},detach:function(){this._current=this._next=this.root=null}},L.prototype={equals:function(t){return!!t&&this.node===t.node&&this.offset==t.offset},inspect:function(){return"[DomPosition("+A(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}},I.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},I.prototype.toString=function(){return this.message},t.dom={arrayContains:u,isHtmlNamespace:c,parentElement:s,getNodeIndex:l,getNodeLength:f,getCommonAncestor:d,isAncestorOf:m,isOrIsAncestorOf:g,getClosestAncestorIn:h,isCharacterDataNode:p,isTextOrCommentNode:v,insertAfter:b,splitDataNode:y,getDocument:w,getWindow:x,getIframeWindow:S,getIframeDocument:C,getBody:o,isWindow:k,getContentDocument:T,getRootContainer:O,comparePoints:E,isBrokenNode:N,inspectNode:A,getComputedStyleProperty:_,createTestElement:M,removeNode:B,fragmentFromNodeChildren:D,createIterator:P,DomPosition:L},t.DOMException=I})),x.createCoreModule("DomRange",["DomUtil"],(function(t,e){var n=t.dom,r=t.util,o=n.DomPosition,i=t.DOMException,a=n.isCharacterDataNode,u=n.getNodeIndex,c=n.isOrIsAncestorOf,s=n.getDocument,l=n.comparePoints,f=n.splitDataNode,d=n.getClosestAncestorIn,m=n.getNodeLength,g=n.arrayContains,h=n.getRootContainer,p=t.features.crashyTextNodes,v=n.removeNode;function b(t,e){return 3!=t.nodeType&&(c(t,e.startContainer)||c(t,e.endContainer))}function y(t){return t.document||s(t.startContainer)}function w(t){return h(t.startContainer)}function x(t){return new o(t.parentNode,u(t))}function C(t){return new o(t.parentNode,u(t)+1)}function S(t,e,r){var o=11==t.nodeType?t.firstChild:t;return a(e)?r==e.length?n.insertAfter(t,e):e.parentNode.insertBefore(t,0==r?e:f(e,r)):r>=e.childNodes.length?e.appendChild(t):e.insertBefore(t,e.childNodes[r]),o}function k(t,e,n){if(X(t),X(e),y(e)!=y(t))throw new i("WRONG_DOCUMENT_ERR");var r=l(t.startContainer,t.startOffset,e.endContainer,e.endOffset),o=l(t.endContainer,t.endOffset,e.startContainer,e.startOffset);return n?r<=0&&o>=0:r<0&&o>0}function T(t){for(var e,n,r,o=y(t.range).createDocumentFragment();n=t.next();){if(e=t.isPartiallySelectedSubtree(),n=n.cloneNode(!e),e&&(r=t.getSubtreeIterator(),n.appendChild(T(r)),r.detach()),10==n.nodeType)throw new i("HIERARCHY_REQUEST_ERR");o.appendChild(n)}return o}function O(t,e,r){var o,i,a,u;for(r=r||{stop:!1};a=t.next();)if(t.isPartiallySelectedSubtree()){if(!1===e(a))return void(r.stop=!0);if(O(u=t.getSubtreeIterator(),e,r),u.detach(),r.stop)return}else for(o=n.createIterator(a);i=o.next();)if(!1===e(i))return void(r.stop=!0)}function E(t){for(var e;t.next();)t.isPartiallySelectedSubtree()?(E(e=t.getSubtreeIterator()),e.detach()):t.remove()}function _(t){for(var e,n,r=y(t.range).createDocumentFragment();e=t.next();){if(t.isPartiallySelectedSubtree()?(e=e.cloneNode(!1),n=t.getSubtreeIterator(),e.appendChild(_(n)),n.detach()):t.remove(),10==e.nodeType)throw new i("HIERARCHY_REQUEST_ERR");r.appendChild(e)}return r}function R(t,e,n){var r,o=!(!e||!e.length),i=!!n;o&&(r=new RegExp("^("+e.join("|")+")$"));var u=[];return O(new A(t,!1),(function(e){if((!o||r.test(e.nodeType))&&(!i||n(e))){var c=t.startContainer;if(e!=c||!a(c)||t.startOffset!=c.length){var s=t.endContainer;e==s&&a(s)&&0==t.endOffset||u.push(e)}}})),u}function N(t){return"["+(void 0===t.getName?"Range":t.getName())+"("+n.inspectNode(t.startContainer)+":"+t.startOffset+", "+n.inspectNode(t.endContainer)+":"+t.endOffset+")]"}function A(t,e){if(this.range=t,this.clonePartiallySelectedTextNodes=e,!t.collapsed){this.sc=t.startContainer,this.so=t.startOffset,this.ec=t.endContainer,this.eo=t.endOffset;var n=t.commonAncestorContainer;this.sc===this.ec&&a(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==n||a(this.sc)?d(this.sc,n,!0):this.sc.childNodes[this.so],this._last=this.ec!==n||a(this.ec)?d(this.ec,n,!0):this.ec.childNodes[this.eo-1])}}A.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var t=this._current=this._next;return t&&(this._next=t!==this._last?t.nextSibling:null,a(t)&&this.clonePartiallySelectedTextNodes&&(t===this.ec&&(t=t.cloneNode(!0)).deleteData(this.eo,t.length-this.eo),this._current===this.sc&&(t=t.cloneNode(!0)).deleteData(0,this.so))),t},remove:function(){var t,e,n=this._current;!a(n)||n!==this.sc&&n!==this.ec?n.parentNode&&v(n):(t=n===this.sc?this.so:0)!=(e=n===this.ec?this.eo:n.length)&&n.deleteData(t,e-t)},isPartiallySelectedSubtree:function(){return b(this._current,this.range)},getSubtreeIterator:function(){var t;if(this.isSingleCharacterDataNode)(t=this.range.cloneRange()).collapse(!1);else{t=new pt(y(this.range));var e=this._current,n=e,r=0,o=e,i=m(e);c(e,this.sc)&&(n=this.sc,r=this.so),c(e,this.ec)&&(o=this.ec,i=this.eo),ht(t,n,r,o,i)}return new A(t,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var D=[1,3,4,5,7,8,10],M=[2,9,11],B=[5,6,10,12],z=[1,3,4,5,7,8,10,11],P=[1,3,4,5,7,8];function L(t){return function(e,n){for(var r,o=n?e:e.parentNode;o;){if(r=o.nodeType,g(t,r))return o;o=o.parentNode}return null}}var I=L([9,11]),H=L(B),F=L([6,10,12]);function V(t,e){if(F(t,e))throw new i("INVALID_NODE_TYPE_ERR")}function j(t,e){if(!g(e,t.nodeType))throw new i("INVALID_NODE_TYPE_ERR")}function U(t,e){if(e<0||e>(a(t)?t.length:t.childNodes.length))throw new i("INDEX_SIZE_ERR")}function W(t,e){if(I(t,!0)!==I(e,!0))throw new i("WRONG_DOCUMENT_ERR")}function q(t){if(H(t,!0))throw new i("NO_MODIFICATION_ALLOWED_ERR")}function $(t,e){if(!t)throw new i(e)}function G(t,e){return e<=(a(t)?t.length:t.childNodes.length)}function K(t){return!!t.startContainer&&!!t.endContainer&&!(p&&(n.isBrokenNode(t.startContainer)||n.isBrokenNode(t.endContainer)))&&h(t.startContainer)==h(t.endContainer)&&G(t.startContainer,t.startOffset)&&G(t.endContainer,t.endOffset)}function X(t){if(!K(t))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+t.inspect()+")")}var Y=document.createElement("style"),J=!1;try{Y.innerHTML="<b>x</b>",J=3==Y.firstChild.nodeType}catch(t){}t.features.htmlParsingConforms=J;var Q=J?function(t){var e=this.startContainer,r=s(e);if(!e)throw new i("INVALID_STATE_ERR");var o=null;return 1==e.nodeType?o=e:a(e)&&(o=n.parentElement(e)),(o=null===o||"HTML"==o.nodeName&&n.isHtmlNamespace(s(o).documentElement)&&n.isHtmlNamespace(o)?r.createElement("body"):o.cloneNode(!1)).innerHTML=t,n.fragmentFromNodeChildren(o)}:function(t){var e=y(this).createElement("body");return e.innerHTML=t,n.fragmentFromNodeChildren(e)};function Z(t,e){X(t);var n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=n===o;a(o)&&i>0&&i<o.length&&f(o,i,e),a(n)&&r>0&&r<n.length&&(n=f(n,r,e),c?(i-=r,o=n):o==n.parentNode&&i>=u(n)&&i++,r=0),t.setStartAndEnd(n,r,o,i)}function tt(t){X(t);var e=t.commonAncestorContainer.parentNode.cloneNode(!1);return e.appendChild(t.cloneContents()),e.innerHTML}var et=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],nt=0,rt=1,ot=2,it=3,at=0,ut=1,ct=2,st=3;function lt(t){t.START_TO_START=nt,t.START_TO_END=rt,t.END_TO_END=ot,t.END_TO_START=it,t.NODE_BEFORE=at,t.NODE_AFTER=ut,t.NODE_BEFORE_AND_AFTER=ct,t.NODE_INSIDE=st}function ft(t){lt(t),lt(t.prototype)}function dt(t,e){return function(){X(this);var n,r=this.startContainer,o=this.startOffset,i=this.commonAncestorContainer,a=new A(this,!0);r!==i&&(r=(n=C(d(r,i,!0))).node,o=n.offset),O(a,q),a.reset();var u=t(a);return a.detach(),e(this,r,o,r,o),u}}function mt(e,n){function o(t,e){return function(n){j(n,D),j(h(n),M);var r=(t?x:C)(n);(e?i:c)(this,r.node,r.offset)}}function i(t,e,r){var o=t.endContainer,i=t.endOffset;e===t.startContainer&&r===t.startOffset||(h(e)==h(o)&&1!=l(e,r,o,i)||(o=e,i=r),n(t,e,r,o,i))}function c(t,e,r){var o=t.startContainer,i=t.startOffset;e===t.endContainer&&r===t.endOffset||(h(e)==h(o)&&-1!=l(e,r,o,i)||(o=e,i=r),n(t,o,i,e,r))}var s=function(){};s.prototype=t.rangePrototype,e.prototype=new s,r.extend(e.prototype,{setStart:function(t,e){V(t,!0),U(t,e),i(this,t,e)},setEnd:function(t,e){V(t,!0),U(t,e),c(this,t,e)},setStartAndEnd:function(){var t=arguments,e=t[0],r=t[1],o=e,i=r;switch(t.length){case 3:i=t[2];break;case 4:o=t[2],i=t[3]}n(this,e,r,o,i)},setBoundary:function(t,e,n){this["set"+(n?"Start":"End")](t,e)},setStartBefore:o(!0,!0),setStartAfter:o(!1,!0),setEndBefore:o(!0,!1),setEndAfter:o(!1,!1),collapse:function(t){X(this),t?n(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):n(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(t){V(t,!0),n(this,t,0,t,m(t))},selectNode:function(t){V(t,!1),j(t,D);var e=x(t),r=C(t);n(this,e.node,e.offset,r.node,r.offset)},extractContents:dt(_,n),deleteContents:dt(E,n),canSurroundContents:function(){X(this),q(this.startContainer),q(this.endContainer);var t=new A(this,!0),e=t._first&&b(t._first,this)||t._last&&b(t._last,this);return t.detach(),!e},splitBoundaries:function(){Z(this)},splitBoundariesPreservingPositions:function(t){Z(this,t)},normalizeBoundaries:function(){X(this);var t,e=this.startContainer,r=this.startOffset,o=this.endContainer,i=this.endOffset,c=function(t){var e=t.nextSibling;e&&e.nodeType==t.nodeType&&(o=t,i=t.length,t.appendData(e.data),v(e))},s=function(t){var n=t.previousSibling;if(n&&n.nodeType==t.nodeType){e=t;var a=t.length;if(r=n.length,t.insertData(0,n.data),v(n),e==o)i+=r,o=e;else if(o==t.parentNode){var c=u(t);i==c?(o=t,i=a):i>c&&i--}}},l=!0;if(a(o))i==o.length?c(o):0==i&&(t=o.previousSibling)&&t.nodeType==o.nodeType&&(i=t.length,e==o&&(l=!1),t.appendData(o.data),v(o),o=t);else{if(i>0){var f=o.childNodes[i-1];f&&a(f)&&c(f)}l=!this.collapsed}if(l){if(a(e))0==r?s(e):r==e.length&&(t=e.nextSibling)&&t.nodeType==e.nodeType&&(o==t&&(o=e,i+=e.length),e.appendData(t.data),v(t));else if(r<e.childNodes.length){var d=e.childNodes[r];d&&a(d)&&s(d)}}else e=o,r=i;n(this,e,r,o,i)},collapseToPoint:function(t,e){V(t,!0),U(t,e),this.setStartAndEnd(t,e)}}),ft(e)}function gt(t){t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset,t.commonAncestorContainer=t.collapsed?t.startContainer:n.getCommonAncestor(t.startContainer,t.endContainer)}function ht(t,e,r,o,i){t.startContainer=e,t.startOffset=r,t.endContainer=o,t.endOffset=i,t.document=n.getDocument(e),gt(t)}function pt(t){this.startContainer=t,this.startOffset=0,this.endContainer=t,this.endOffset=0,this.document=t,gt(this)}r.extend(t.rangePrototype,{compareBoundaryPoints:function(t,e){var n,r,o,i;X(this),W(this.startContainer,e.startContainer);var a=t==it||t==nt?"start":"end",u=t==rt||t==nt?"start":"end";return n=this[a+"Container"],r=this[a+"Offset"],o=e[u+"Container"],i=e[u+"Offset"],l(n,r,o,i)},insertNode:function(t){if(X(this),j(t,z),q(this.startContainer),c(t,this.startContainer))throw new i("HIERARCHY_REQUEST_ERR");var e=S(t,this.startContainer,this.startOffset);this.setStartBefore(e)},cloneContents:function(){var t,e;if(X(this),this.collapsed)return y(this).createDocumentFragment();if(this.startContainer===this.endContainer&&a(this.startContainer))return(t=this.startContainer.cloneNode(!0)).data=t.data.slice(this.startOffset,this.endOffset),(e=y(this).createDocumentFragment()).appendChild(t),e;var n=new A(this,!0);return t=T(n),n.detach(),t},canSurroundContents:function(){X(this),q(this.startContainer),q(this.endContainer);var t=new A(this,!0),e=t._first&&b(t._first,this)||t._last&&b(t._last,this);return t.detach(),!e},surroundContents:function(t){if(j(t,P),!this.canSurroundContents())throw new i("INVALID_STATE_ERR");var e=this.extractContents();if(t.hasChildNodes())for(;t.lastChild;)t.removeChild(t.lastChild);S(t,this.startContainer,this.startOffset),t.appendChild(e),this.selectNode(t)},cloneRange:function(){X(this);for(var t,e=new pt(y(this)),n=et.length;n--;)e[t=et[n]]=this[t];return e},toString:function(){X(this);var t=this.startContainer;if(t===this.endContainer&&a(t))return 3==t.nodeType||4==t.nodeType?t.data.slice(this.startOffset,this.endOffset):"";var e=[],n=new A(this,!0);return O(n,(function(t){3!=t.nodeType&&4!=t.nodeType||e.push(t.data)})),n.detach(),e.join("")},compareNode:function(t){X(this);var e=t.parentNode,n=u(t);if(!e)throw new i("NOT_FOUND_ERR");var r=this.comparePoint(e,n),o=this.comparePoint(e,n+1);return r<0?o>0?ct:at:o>0?ut:st},comparePoint:function(t,e){return X(this),$(t,"HIERARCHY_REQUEST_ERR"),W(t,this.startContainer),l(t,e,this.startContainer,this.startOffset)<0?-1:l(t,e,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:Q,toHtml:function(){return tt(this)},intersectsNode:function(t,e){if(X(this),h(t)!=w(this))return!1;var n=t.parentNode,r=u(t);if(!n)return!0;var o=l(n,r,this.endContainer,this.endOffset),i=l(n,r+1,this.startContainer,this.startOffset);return e?o<=0&&i>=0:o<0&&i>0},isPointInRange:function(t,e){return X(this),$(t,"HIERARCHY_REQUEST_ERR"),W(t,this.startContainer),l(t,e,this.startContainer,this.startOffset)>=0&&l(t,e,this.endContainer,this.endOffset)<=0},intersectsRange:function(t){return k(this,t,!1)},intersectsOrTouchesRange:function(t){return k(this,t,!0)},intersection:function(t){if(this.intersectsRange(t)){var e=l(this.startContainer,this.startOffset,t.startContainer,t.startOffset),n=l(this.endContainer,this.endOffset,t.endContainer,t.endOffset),r=this.cloneRange();return-1==e&&r.setStart(t.startContainer,t.startOffset),1==n&&r.setEnd(t.endContainer,t.endOffset),r}return null},union:function(t){if(this.intersectsOrTouchesRange(t)){var e=this.cloneRange();return-1==l(t.startContainer,t.startOffset,this.startContainer,this.startOffset)&&e.setStart(t.startContainer,t.startOffset),1==l(t.endContainer,t.endOffset,this.endContainer,this.endOffset)&&e.setEnd(t.endContainer,t.endOffset),e}throw new i("Ranges do not intersect")},containsNode:function(t,e){return e?this.intersectsNode(t,!1):this.compareNode(t)==st},containsNodeContents:function(t){return this.comparePoint(t,0)>=0&&this.comparePoint(t,m(t))<=0},containsRange:function(t){var e=this.intersection(t);return null!==e&&t.equals(e)},containsNodeText:function(t){var e=this.cloneRange();e.selectNode(t);var n=e.getNodes([3]);if(n.length>0){e.setStart(n[0],0);var r=n.pop();return e.setEnd(r,r.length),this.containsRange(e)}return this.containsNodeContents(t)},getNodes:function(t,e){return X(this),R(this,t,e)},getDocument:function(){return y(this)},collapseBefore:function(t){this.setEndBefore(t),this.collapse(!1)},collapseAfter:function(t){this.setStartAfter(t),this.collapse(!0)},getBookmark:function(e){var r=y(this),o=t.createRange(r);e=e||n.getBody(r),o.selectNodeContents(e);var i=this.intersection(o),a=0,u=0;return i&&(o.setEnd(i.startContainer,i.startOffset),u=(a=o.toString().length)+i.toString().length),{start:a,end:u,containerNode:e}},moveToBookmark:function(t){var e=t.containerNode,n=0;this.setStart(e,0),this.collapse(!0);for(var r,o,i,a,u=[e],c=!1,s=!1;!s&&(r=u.pop());)if(3==r.nodeType)o=n+r.length,!c&&t.start>=n&&t.start<=o&&(this.setStart(r,t.start-n),c=!0),c&&t.end>=n&&t.end<=o&&(this.setEnd(r,t.end-n),s=!0),n=o;else for(i=(a=r.childNodes).length;i--;)u.push(a[i])},getName:function(){return"DomRange"},equals:function(t){return pt.rangesEqual(this,t)},isValid:function(){return K(this)},inspect:function(){return N(this)},detach:function(){}}),mt(pt,ht),r.extend(pt,{rangeProperties:et,RangeIterator:A,copyComparisonConstants:ft,createPrototypeRange:mt,inspect:N,toHtml:tt,getRangeDocument:y,rangesEqual:function(t,e){return t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset}}),t.DomRange=pt})),x.createCoreModule("WrappedRange",["DomRange"],(function(t,e){var n,r,o=t.dom,i=t.util,a=o.DomPosition,u=t.DomRange,c=o.getBody,s=o.getContentDocument,l=o.isCharacterDataNode;if(t.features.implementsDomRange&&function(){var r,a,l=u.rangeProperties;function f(t){for(var e,n=l.length;n--;)t[e=l[n]]=t.nativeRange[e];t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset}function d(t,e,n,r,o){var i=t.startContainer!==e||t.startOffset!=n,a=t.endContainer!==r||t.endOffset!=o,u=!t.equals(t.nativeRange);(i||a||u)&&(t.setEnd(r,o),t.setStart(e,n))}n=function(t){if(!t)throw e.createError("WrappedRange: Range must be specified");this.nativeRange=t,f(this)},u.createPrototypeRange(n,d),(r=n.prototype).selectNode=function(t){this.nativeRange.selectNode(t),f(this)},r.cloneContents=function(){return this.nativeRange.cloneContents()},r.surroundContents=function(t){this.nativeRange.surroundContents(t),f(this)},r.collapse=function(t){this.nativeRange.collapse(t),f(this)},r.cloneRange=function(){return new n(this.nativeRange.cloneRange())},r.refresh=function(){f(this)},r.toString=function(){return this.nativeRange.toString()};var m=document.createTextNode("test");c(document).appendChild(m);var g=document.createRange();g.setStart(m,0),g.setEnd(m,0);try{g.setStart(m,1),r.setStart=function(t,e){this.nativeRange.setStart(t,e),f(this)},r.setEnd=function(t,e){this.nativeRange.setEnd(t,e),f(this)},a=function(t){return function(e){this.nativeRange[t](e),f(this)}}}catch(t){r.setStart=function(t,e){try{this.nativeRange.setStart(t,e)}catch(n){this.nativeRange.setEnd(t,e),this.nativeRange.setStart(t,e)}f(this)},r.setEnd=function(t,e){try{this.nativeRange.setEnd(t,e)}catch(n){this.nativeRange.setStart(t,e),this.nativeRange.setEnd(t,e)}f(this)},a=function(t,e){return function(n){try{this.nativeRange[t](n)}catch(r){this.nativeRange[e](n),this.nativeRange[t](n)}f(this)}}}r.setStartBefore=a("setStartBefore","setEndBefore"),r.setStartAfter=a("setStartAfter","setEndAfter"),r.setEndBefore=a("setEndBefore","setStartBefore"),r.setEndAfter=a("setEndAfter","setStartAfter"),r.selectNodeContents=function(t){this.setStartAndEnd(t,0,o.getNodeLength(t))},g.selectNodeContents(m),g.setEnd(m,3);var h=document.createRange();h.selectNodeContents(m),h.setEnd(m,4),h.setStart(m,2),-1==g.compareBoundaryPoints(g.START_TO_END,h)&&1==g.compareBoundaryPoints(g.END_TO_START,h)?r.compareBoundaryPoints=function(t,e){return t==(e=e.nativeRange||e).START_TO_END?t=e.END_TO_START:t==e.END_TO_START&&(t=e.START_TO_END),this.nativeRange.compareBoundaryPoints(t,e)}:r.compareBoundaryPoints=function(t,e){return this.nativeRange.compareBoundaryPoints(t,e.nativeRange||e)};var p=document.createElement("div");p.innerHTML="123";var v=p.firstChild,b=c(document);b.appendChild(p),g.setStart(v,1),g.setEnd(v,2),g.deleteContents(),"13"==v.data&&(r.deleteContents=function(){this.nativeRange.deleteContents(),f(this)},r.extractContents=function(){var t=this.nativeRange.extractContents();return f(this),t}),b.removeChild(p),b=null,i.isHostMethod(g,"createContextualFragment")&&(r.createContextualFragment=function(t){return this.nativeRange.createContextualFragment(t)}),c(document).removeChild(m),r.getName=function(){return"WrappedRange"},t.WrappedRange=n,t.createNativeRange=function(t){return(t=s(t,e,"createNativeRange")).createRange()}}(),t.features.implementsTextRange){var f=function(t){var e=t.parentElement(),n=t.duplicate();n.collapse(!0);var r=n.parentElement();(n=t.duplicate()).collapse(!1);var i=n.parentElement(),a=r==i?r:o.getCommonAncestor(r,i);return a==e?a:o.getCommonAncestor(e,a)},d=function(t){return 0==t.compareEndPoints("StartToEnd",t)},m=function(t,e,n,r,i){var u=t.duplicate();u.collapse(n);var c=u.parentElement();if(o.isOrIsAncestorOf(e,c)||(c=e),!c.canHaveHTML){var s=new a(c.parentNode,o.getNodeIndex(c));return{boundaryPosition:s,nodeInfo:{nodeIndex:s.offset,containerElement:s.node}}}var f=o.getDocument(c).createElement("span");f.parentNode&&o.removeNode(f);for(var d,m,g,h,p,v=n?"StartToStart":"StartToEnd",b=i&&i.containerElement==c?i.nodeIndex:0,y=c.childNodes.length,w=y,x=w;x==y?c.appendChild(f):c.insertBefore(f,c.childNodes[x]),u.moveToElementText(f),0!=(d=u.compareEndPoints(v,t))&&b!=w;){if(-1==d){if(w==b+1)break;b=x}else w=w==b+1?b:x;x=Math.floor((b+w)/2),c.removeChild(f)}if(p=f.nextSibling,-1==d&&p&&l(p)){var C;if(u.setEndPoint(n?"EndToStart":"EndToEnd",t),/[\r\n]/.test(p.data)){var S=u.duplicate(),k=S.text.replace(/\r\n/g,"\r").length;for(C=S.moveStart("character",k);-1==(d=S.compareEndPoints("StartToEnd",S));)C++,S.moveStart("character",1)}else C=u.text.length;h=new a(p,C)}else m=(r||!n)&&f.previousSibling,h=(g=(r||n)&&f.nextSibling)&&l(g)?new a(g,0):m&&l(m)?new a(m,m.data.length):new a(c,o.getNodeIndex(f));return o.removeNode(f),{boundaryPosition:h,nodeInfo:{nodeIndex:x,containerElement:c}}},g=function(t,e){var n,r,i,a,u=t.offset,s=o.getDocument(t.node),f=c(s).createTextRange(),d=l(t.node);return d?r=(n=t.node).parentNode:(n=u<(a=t.node.childNodes).length?a[u]:null,r=t.node),(i=s.createElement("span")).innerHTML="&#feff;",n?r.insertBefore(i,n):r.appendChild(i),f.moveToElementText(i),f.collapse(!e),r.removeChild(i),d&&f[e?"moveStart":"moveEnd"]("character",u),f};(r=function(t){this.textRange=t,this.refresh()}).prototype=new u(document),r.prototype.refresh=function(){var t,e,n,r=f(this.textRange);d(this.textRange)?e=t=m(this.textRange,r,!0,!0).boundaryPosition:(t=(n=m(this.textRange,r,!0,!1)).boundaryPosition,e=m(this.textRange,r,!1,!1,n.nodeInfo).boundaryPosition),this.setStart(t.node,t.offset),this.setEnd(e.node,e.offset)},r.prototype.getName=function(){return"WrappedTextRange"},u.copyComparisonConstants(r);var h=function(t){if(t.collapsed)return g(new a(t.startContainer,t.startOffset),!0);var e=g(new a(t.startContainer,t.startOffset),!0),n=g(new a(t.endContainer,t.endOffset),!1),r=c(u.getRangeDocument(t)).createTextRange();return r.setEndPoint("StartToStart",e),r.setEndPoint("EndToEnd",n),r};if(r.rangeToTextRange=h,r.prototype.toTextRange=function(){return h(this)},t.WrappedTextRange=r,!t.features.implementsDomRange||t.config.preferTextRange){var p=Function("return this;")();void 0===p.Range&&(p.Range=r),t.createNativeRange=function(t){return t=s(t,e,"createNativeRange"),c(t).createTextRange()},t.WrappedRange=r}}t.createRange=function(n){return n=s(n,e,"createRange"),new t.WrappedRange(t.createNativeRange(n))},t.createRangyRange=function(t){return t=s(t,e,"createRangyRange"),new u(t)},i.createAliasForDeprecatedMethod(t,"createIframeRange","createRange"),i.createAliasForDeprecatedMethod(t,"createIframeRangyRange","createRangyRange"),t.addShimListener((function(e){var n=e.document;void 0===n.createRange&&(n.createRange=function(){return t.createRange(n)}),n=e=null}))})),x.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],(function(t,e){t.config.checkSelectionRanges=!0;var n,r,o="boolean",i="number",a=t.dom,u=t.util,c=u.isHostMethod,s=t.DomRange,l=t.WrappedRange,f=t.DOMException,d=a.DomPosition,m=t.features,g="Control",h=a.getDocument,p=a.getBody,v=s.rangesEqual;function b(t){return"string"==typeof t?/^backward(s)?$/i.test(t):!!t}function y(t,n){if(t){if(a.isWindow(t))return t;if(t instanceof K)return t.win;var r=a.getContentDocument(t,e,n);return a.getWindow(r)}return window}function w(t){return y(t,"getWinSelection").getSelection()}function x(t){return y(t,"getDocSelection").document.selection}function C(t){var e=!1;return t.anchorNode&&(e=1==a.comparePoints(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)),e}var S=c(window,"getSelection"),k=u.isHostObject(document,"selection");m.implementsWinGetSelection=S,m.implementsDocSelection=k;var T=k&&(!S||t.config.preferTextRange);if(T)n=x,t.isSelectionValid=function(t){var e=y(t,"isSelectionValid").document,n=e.selection;return"None"!=n.type||h(n.createRange().parentElement())==e};else{if(!S)return e.fail("Neither document.selection or window.getSelection() detected."),!1;n=w,t.isSelectionValid=function(){return!0}}t.getNativeSelection=n;var O=n();if(!O)return e.fail("Native selection was null (possibly issue 138?)"),!1;var E=t.createNativeRange(document),_=p(document),R=u.areHostProperties(O,["anchorNode","focusNode","anchorOffset","focusOffset"]);m.selectionHasAnchorAndFocus=R;var N=c(O,"extend");m.selectionHasExtend=N;var A=typeof O.rangeCount==i;m.selectionHasRangeCount=A;var D=!1,M=!0,B=N?function(e,n){var r=s.getRangeDocument(n),o=t.createRange(r);o.collapseToPoint(n.endContainer,n.endOffset),e.addRange(V(o)),e.extend(n.startContainer,n.startOffset)}:null;u.areHostMethods(O,["addRange","getRangeAt","removeAllRanges"])&&typeof O.rangeCount==i&&m.implementsDomRange&&function(){var e=window.getSelection();if(e){for(var n=e.rangeCount,r=n>1,o=[],i=C(e),u=0;u<n;++u)o[u]=e.getRangeAt(u);var c=a.createTestElement(document,"",!1),s=c.appendChild(document.createTextNode("   ")),l=document.createRange();if(l.setStart(s,1),l.collapse(!0),e.removeAllRanges(),e.addRange(l),M=1==e.rangeCount,e.removeAllRanges(),!r){var f=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(f&&parseInt(f[1])>=36)D=!1;else{var d=l.cloneRange();l.setStart(s,0),d.setEnd(s,3),d.setStart(s,2),e.addRange(l),e.addRange(d),D=2==e.rangeCount}}for(a.removeNode(c),e.removeAllRanges(),u=0;u<n;++u)0==u&&i?B?B(e,o[u]):(t.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),e.addRange(o[u])):e.addRange(o[u])}}(),m.selectionSupportsMultipleRanges=D,m.collapsedNonEditableSelectionsSupported=M;var z,P,L=!1;function I(t,e,n){var r=n?"end":"start",o=n?"start":"end";t.anchorNode=e[r+"Container"],t.anchorOffset=e[r+"Offset"],t.focusNode=e[o+"Container"],t.focusOffset=e[o+"Offset"]}function H(t){var e=t.nativeSelection;t.anchorNode=e.anchorNode,t.anchorOffset=e.anchorOffset,t.focusNode=e.focusNode,t.focusOffset=e.focusOffset}function F(t){t.anchorNode=t.focusNode=null,t.anchorOffset=t.focusOffset=0,t.rangeCount=0,t.isCollapsed=!0,t._ranges.length=0}function V(e){var n;return e instanceof s?((n=t.createNativeRange(e.getDocument())).setEnd(e.endContainer,e.endOffset),n.setStart(e.startContainer,e.startOffset)):e instanceof l?n=e.nativeRange:m.implementsDomRange&&e instanceof a.getWindow(e.startContainer).Range&&(n=e),n}function j(t){if(!t.length||1!=t[0].nodeType)return!1;for(var e=1,n=t.length;e<n;++e)if(!a.isAncestorOf(t[0],t[e]))return!1;return!0}function U(t){var n=t.getNodes();if(!j(n))throw e.createError("getSingleElementFromRange: range "+t.inspect()+" did not consist of a single element");return n[0]}function W(t){return!!t&&void 0!==t.text}function q(t,e){var n=new l(e);t._ranges=[n],I(t,n,!1),t.rangeCount=1,t.isCollapsed=n.collapsed}function $(e){if(e._ranges.length=0,"None"==e.docSelection.type)F(e);else{var n=e.docSelection.createRange();if(W(n))q(e,n);else{e.rangeCount=n.length;for(var r,o=h(n.item(0)),i=0;i<e.rangeCount;++i)(r=t.createRange(o)).selectNode(n.item(i)),e._ranges.push(r);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,I(e,e._ranges[e.rangeCount-1],!1)}}}function G(t,n){for(var r=t.docSelection.createRange(),o=U(n),i=h(r.item(0)),a=p(i).createControlRange(),u=0,c=r.length;u<c;++u)a.add(r.item(u));try{a.add(o)}catch(t){throw e.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),$(t)}function K(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function X(t){t.win=t.anchorNode=t.focusNode=t._ranges=null,t.rangeCount=t.anchorOffset=t.focusOffset=0,t.detached=!0}_&&c(_,"createControlRange")&&(z=_.createControlRange(),u.areHostProperties(z,["item","add"])&&(L=!0)),m.implementsControlRange=L,r=R?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return!!t.rangeCount&&t.getRangeAt(t.rangeCount-1).collapsed},c(O,"getRangeAt")?P=function(t,e){try{return t.getRangeAt(e)}catch(t){return null}}:R&&(P=function(e){var n=h(e.anchorNode),r=t.createRange(n);return r.setStartAndEnd(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset),r.collapsed!==this.isCollapsed&&r.setStartAndEnd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset),r}),K.prototype=t.selectionPrototype;var Y=[];function J(t,e){for(var n,r,o=Y.length;o--;)if(r=(n=Y[o]).selection,"deleteAll"==e)X(r);else if(n.win==t)return"delete"==e?(Y.splice(o,1),!0):r;return"deleteAll"==e&&(Y.length=0),null}var Q=function(t){if(t&&t instanceof K)return t.refresh(),t;var e=J(t=y(t,"getNativeSelection")),r=n(t),o=k?x(t):null;return e?(e.nativeSelection=r,e.docSelection=o,e.refresh()):(e=new K(r,o,t),Y.push({win:t,selection:e})),e};t.getSelection=Q,u.createAliasForDeprecatedMethod(t,"getIframeSelection","getSelection");var Z,tt=K.prototype;function et(t,n){for(var r,o=h(n[0].startContainer),i=p(o).createControlRange(),a=0,u=n.length;a<u;++a){r=U(n[a]);try{i.add(r)}catch(t){throw e.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}i.select(),$(t)}if(!T&&R&&u.areHostMethods(O,["removeAllRanges","addRange"])){tt.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),F(this)};var nt=function(t,e){B(t.nativeSelection,e),t.refresh()};tt.addRange=A?function(e,n){if(L&&k&&this.docSelection.type==g)G(this,e);else if(b(n)&&N)nt(this,e);else{var o;D?o=this.rangeCount:(this.removeAllRanges(),o=0);var i=V(e).cloneRange();try{this.nativeSelection.addRange(i)}catch(t){}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==o+1){if(t.config.checkSelectionRanges){var a=P(this.nativeSelection,this.rangeCount-1);a&&!v(a,e)&&(e=new l(a))}this._ranges[this.rangeCount-1]=e,I(this,e,rt(this.nativeSelection)),this.isCollapsed=r(this)}else this.refresh()}}:function(t,e){b(e)&&N?nt(this,t):(this.nativeSelection.addRange(V(t)),this.refresh())},tt.setRanges=function(t){if(L&&k&&t.length>1)et(this,t);else{this.removeAllRanges();for(var e=0,n=t.length;e<n;++e)this.addRange(t[e])}}}else{if(!(c(O,"empty")&&c(E,"select")&&L&&T))return e.fail("No means of selecting a Range or TextRange was found"),!1;tt.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var t;if(this.anchorNode)t=h(this.anchorNode);else if(this.docSelection.type==g){var e=this.docSelection.createRange();e.length&&(t=h(e.item(0)))}t&&(p(t).createTextRange().select(),this.docSelection.empty())}}catch(t){}F(this)},tt.addRange=function(e){this.docSelection.type==g?G(this,e):(t.WrappedTextRange.rangeToTextRange(e).select(),this._ranges[0]=e,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,I(this,e,!1))},tt.setRanges=function(t){this.removeAllRanges();var e=t.length;e>1?et(this,t):e&&this.addRange(t[0])}}if(tt.getRangeAt=function(t){if(t<0||t>=this.rangeCount)throw new f("INDEX_SIZE_ERR");return this._ranges[t].cloneRange()},T)Z=function(e){var n;t.isSelectionValid(e.win)?n=e.docSelection.createRange():(n=p(e.win.document).createTextRange()).collapse(!0),e.docSelection.type==g?$(e):W(n)?q(e,n):F(e)};else if(c(O,"getRangeAt")&&typeof O.rangeCount==i)Z=function(e){if(L&&k&&e.docSelection.type==g)$(e);else if(e._ranges.length=e.rangeCount=e.nativeSelection.rangeCount,e.rangeCount){for(var n=0,o=e.rangeCount;n<o;++n)e._ranges[n]=new t.WrappedRange(e.nativeSelection.getRangeAt(n));I(e,e._ranges[e.rangeCount-1],rt(e.nativeSelection)),e.isCollapsed=r(e)}else F(e)};else{if(!R||typeof O.isCollapsed!=o||typeof E.collapsed!=o||!m.implementsDomRange)return e.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;Z=function(t){var e,n=t.nativeSelection;n.anchorNode?(e=P(n,0),t._ranges=[e],t.rangeCount=1,H(t),t.isCollapsed=r(t)):F(t)}}tt.refresh=function(t){var e=t?this._ranges.slice(0):null,n=this.anchorNode,r=this.anchorOffset;if(Z(this),t){var o=e.length;if(o!=this._ranges.length)return!0;if(this.anchorNode!=n||this.anchorOffset!=r)return!0;for(;o--;)if(!v(e[o],this._ranges[o]))return!0;return!1}};var rt,ot=function(t,e){var n=t.getAllRanges();t.removeAllRanges();for(var r=0,o=n.length;r<o;++r)v(e,n[r])||t.addRange(n[r]);t.rangeCount||F(t)};function it(t,e){if(t.win.document!=h(e))throw new f("WRONG_DOCUMENT_ERR")}function at(e){return function(n,r){var o;this.rangeCount?(o=this.getRangeAt(0))["set"+(e?"Start":"End")](n,r):(o=t.createRange(this.win.document)).setStartAndEnd(n,r),this.setSingleRange(o,this.isBackward())}}function ut(t){var e=[],n=new d(t.anchorNode,t.anchorOffset),r=new d(t.focusNode,t.focusOffset),o="function"==typeof t.getName?t.getName():"Selection";if(void 0!==t.rangeCount)for(var i=0,a=t.rangeCount;i<a;++i)e[i]=s.inspect(t.getRangeAt(i));return"["+o+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+r.inspect()+"]"}tt.removeRange=L&&k?function(t){if(this.docSelection.type==g){for(var e=this.docSelection.createRange(),n=U(t),r=h(e.item(0)),o=p(r).createControlRange(),i=!1,a=0,u=e.length;a<u;++a)e.item(a)!==n||i?o.add(e.item(a)):i=!0;o.select(),$(this)}else ot(this,t)}:function(t){ot(this,t)},!T&&R&&m.implementsDomRange?(rt=C,tt.isBackward=function(){return rt(this)}):rt=tt.isBackward=function(){return!1},tt.isBackwards=tt.isBackward,tt.toString=function(){for(var t=[],e=0,n=this.rangeCount;e<n;++e)t[e]=""+this._ranges[e];return t.join("")},tt.collapse=function(e,n){it(this,e);var r=t.createRange(e);r.collapseToPoint(e,n),this.setSingleRange(r),this.isCollapsed=!0},tt.collapseToStart=function(){if(!this.rangeCount)throw new f("INVALID_STATE_ERR");var t=this._ranges[0];this.collapse(t.startContainer,t.startOffset)},tt.collapseToEnd=function(){if(!this.rangeCount)throw new f("INVALID_STATE_ERR");var t=this._ranges[this.rangeCount-1];this.collapse(t.endContainer,t.endOffset)},tt.selectAllChildren=function(e){it(this,e);var n=t.createRange(e);n.selectNodeContents(e),this.setSingleRange(n)},tt.deleteFromDocument=function(){if(L&&k&&this.docSelection.type==g){for(var t,e=this.docSelection.createRange();e.length;)t=e.item(0),e.remove(t),a.removeNode(t);this.refresh()}else if(this.rangeCount){var n=this.getAllRanges();if(n.length){this.removeAllRanges();for(var r=0,o=n.length;r<o;++r)n[r].deleteContents();this.addRange(n[o-1])}}},tt.eachRange=function(t,e){for(var n=0,r=this._ranges.length;n<r;++n)if(t(this.getRangeAt(n)))return e},tt.getAllRanges=function(){var t=[];return this.eachRange((function(e){t.push(e)})),t},tt.setSingleRange=function(t,e){this.removeAllRanges(),this.addRange(t,e)},tt.callMethodOnEachRange=function(t,e){var n=[];return this.eachRange((function(r){n.push(r[t].apply(r,e||[]))})),n},tt.setStart=at(!0),tt.setEnd=at(!1),t.rangePrototype.select=function(t){Q(this.getDocument()).setSingleRange(this,t)},tt.changeEachRange=function(t){var e=[],n=this.isBackward();this.eachRange((function(n){t(n),e.push(n)})),this.removeAllRanges(),n&&1==e.length?this.addRange(e[0],"backward"):this.setRanges(e)},tt.containsNode=function(t,e){return this.eachRange((function(n){return n.containsNode(t,e)}),!0)||!1},tt.getBookmark=function(t){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[t])}},tt.moveToBookmark=function(e){for(var n,r,o=[],i=0;n=e.rangeBookmarks[i++];)(r=t.createRange(this.win)).moveToBookmark(n),o.push(r);e.backward?this.setSingleRange(o[0],"backward"):this.setRanges(o)},tt.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},tt.restoreRanges=function(t){this.removeAllRanges();for(var e,n=0;e=t.ranges[n];++n)this.addRange(e,t.backward&&0==n)},tt.toHtml=function(){var t=[];return this.eachRange((function(e){t.push(s.toHtml(e))})),t.join("")},m.implementsTextRange&&(tt.getNativeTextRange=function(){var n;if(n=this.docSelection){var r=n.createRange();if(W(r))return r;throw e.createError("getNativeTextRange: selection is a control selection")}if(this.rangeCount>0)return t.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw e.createError("getNativeTextRange: selection contains no range")}),tt.getName=function(){return"WrappedSelection"},tt.inspect=function(){return ut(this)},tt.detach=function(){J(this.win,"delete"),X(this)},K.detachAll=function(){J(null,"deleteAll")},K.inspect=ut,K.isDirectionBackward=b,t.Selection=K,t.selectionPrototype=tt,t.addShimListener((function(t){void 0===t.getSelection&&(t.getSelection=function(){return Q(t)}),t=null}))}));var L=!1,I=function(t){L||(L=!0,!x.initialized&&x.config.autoInitialize&&_())};return y&&("complete"==document.readyState?I():(u(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",I,!1),v(window,"load",I))),x})?r.call(e,n,e,t):r)||(t.exports=o)},3554:function(t,e,n){var r,o,i;o=[n(9008)],void 0===(i="function"==typeof(r=function(t){return t.createModule("TextRange",["WrappedSelection"],(function(t,e){var n,r,o,i="undefined",a="character",u="word",c=t.dom,s=t.util,l=s.extend,f=s.createOptions,d=c.getBody,m=/^[ \t\f\r\n]+$/,g=/^[ \t\f\r]+$/,h=/^[\t-\r \u0085\u00A0\u1680\u180E\u2000-\u200B\u2028\u2029\u202F\u205F\u3000]+$/,p=/^[\t \u00A0\u1680\u180E\u2000-\u200B\u202F\u205F\u3000]+$/,v="en",b=t.Selection.isDirectionBackward,y=!1,w=!1,x=!0;function C(t,e){var n,r=t.join(""),o=[];function i(t,e,n){o.push({start:t,end:e,isWord:n})}for(var a,u,c=0;n=e.wordRegex.exec(r);){if(u=(a=n.index)+n[0].length,a>c&&i(c,a,!1),e.includeTrailingSpace)for(;p.test(t[u]);)++u;i(a,u,!0),c=u}return c<t.length&&i(c,t.length,!1),o}function S(t,e){for(var n=t.slice(e.start,e.end),r={isWord:e.isWord,chars:n,toString:function(){return n.join("")}},o=0,i=n.length;o<i;++o)n[o].token=r;return r}function k(t,e,n){for(var r,o=n(t,e),i=[],a=0;r=o[a++];)i.push(S(t,r));return i}n=c.createTestElement(document,"<p>1 </p><p></p>",!0),r=n.firstChild,(o=t.getSelection()).collapse(r.lastChild,2),o.setStart(r.firstChild,0),n.innerHTML="1 <br />",o.collapse(n,2),o.setStart(n.firstChild,0),y=1==(""+o).length,n.innerHTML="1 <p>1</p>",o.collapse(n,2),o.setStart(n.firstChild,0),w=1==(""+o).length,c.removeNode(n),o.removeAllRanges();var T={includeBlockContentTrailingSpace:!0,includeSpaceBeforeBr:!0,includeSpaceBeforeBlock:!0,includePreLineTrailingSpace:!0,ignoreCharacters:""};function O(t){var e=t||"",n="string"==typeof e?e.split(""):e;return n.sort((function(t,e){return t.charCodeAt(0)-e.charCodeAt(0)})),n.join("").replace(/(.)\1+/g,"$1")}var E={includeBlockContentTrailingSpace:!x,includeSpaceBeforeBr:!y,includeSpaceBeforeBlock:!w,includePreLineTrailingSpace:!0},_={en:{wordRegex:/[a-z0-9]+('[a-z0-9]+)*/gi,includeTrailingSpace:!1,tokenizer:C}},R={caseSensitive:!1,withinRange:null,wholeWordsOnly:!1,wrap:!1,direction:"forward",wordOptions:null,characterOptions:null},N={wordOptions:null,characterOptions:null},A={wordOptions:null,characterOptions:null,trim:!1,trimStart:!0,trimEnd:!0},D={wordOptions:null,characterOptions:null,direction:"forward"};function M(t){var e,n;return t?(e=t.language||v,l(n={},_[e]||_[v]),l(n,t),n):_[v]}function B(t,e){var n=f(t,e);return e.hasOwnProperty("wordOptions")&&(n.wordOptions=M(n.wordOptions)),e.hasOwnProperty("characterOptions")&&(n.characterOptions=f(n.characterOptions,T)),n}var z,P,L,I=c.getComputedStyleProperty;P=document.createElement("table"),(L=d(document)).appendChild(P),z="block"==I(P,"display"),L.removeChild(P);var H={table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell"};function F(t,e){var n=I(t,"display",e),r=t.tagName.toLowerCase();return"block"==n&&z&&H.hasOwnProperty(r)?H[r]:n}function V(t){for(var e=$(t),n=0,r=e.length;n<r;++n)if(1==e[n].nodeType&&"none"==F(e[n]))return!0;return!1}function j(t){var e;return 3==t.nodeType&&(e=t.parentNode)&&"hidden"==I(e,"visibility")}function U(t){return t&&(1==t.nodeType&&!/^(inline(-block|-table)?|none)$/.test(F(t))||9==t.nodeType||11==t.nodeType)}function W(t){return c.isCharacterDataNode(t)||!/^(area|base|basefont|br|col|frame|hr|img|input|isindex|link|meta|param)$/i.test(t.nodeName)}function q(t){for(var e=[];t.parentNode;)e.unshift(t.parentNode),t=t.parentNode;return e}function $(t){return q(t).concat([t])}function G(t){for(;t&&!t.nextSibling;)t=t.parentNode;return t?t.nextSibling:null}function K(t,e){return!e&&t.hasChildNodes()?t.firstChild:G(t)}function X(t){var e=t.previousSibling;if(e){for(t=e;t.hasChildNodes();)t=t.lastChild;return t}var n=t.parentNode;return n&&1==n.nodeType?n:null}function Y(t){if(!t||3!=t.nodeType)return!1;var e=t.data;if(""===e)return!0;var n=t.parentNode;if(!n||1!=n.nodeType)return!1;var r=I(t.parentNode,"whiteSpace");return/^[\t\n\r ]+$/.test(e)&&/^(normal|nowrap)$/.test(r)||/^[\t\r ]+$/.test(e)&&"pre-line"==r}function J(t){return""===t.data||!!Y(t)&&(!t.parentNode||!!V(t))}function Q(t){var e=t.nodeType;return 7==e||8==e||V(t)||/^(script|style)$/i.test(t.nodeName)||j(t)||J(t)}function Z(t,e){var n=t.nodeType;return 7==n||8==n||1==n&&"none"==F(t,e)}function tt(){this.store={}}function et(t,e,n){return function(r){var o=this.cache;if(o.hasOwnProperty(t))return o[t];var i=e.call(this,n?this[n]:this,r);return o[t]=i,i}}function nt(t,e){this.node=t,this.session=e,this.cache=new tt,this.positions=new tt}tt.prototype={get:function(t){return this.store.hasOwnProperty(t)?this.store[t]:null},set:function(t,e){return this.store[t]=e}};var rt={getPosition:function(t){var e=this.positions;return e.get(t)||e.set(t,new gt(this,t))},toString:function(){return"[NodeWrapper("+c.inspectNode(this.node)+")]"}};nt.prototype=rt;var ot="EMPTY",it="NON_SPACE",at="UNCOLLAPSIBLE_SPACE",ut="COLLAPSIBLE_SPACE",ct="TRAILING_SPACE_BEFORE_BLOCK",st="TRAILING_SPACE_IN_BLOCK",lt="TRAILING_SPACE_BEFORE_BR",ft="PRE_LINE_TRAILING_SPACE_BEFORE_LINE_BREAK",dt="TRAILING_LINE_BREAK_AFTER_BR",mt="INCLUDED_TRAILING_LINE_BREAK_AFTER_BR";function gt(t,e){this.offset=e,this.nodeWrapper=t,this.node=t.node,this.session=t.session,this.cache=new tt}function ht(){return"[Position("+c.inspectNode(this.node)+":"+this.offset+")]"}l(rt,{isCharacterDataNode:et("isCharacterDataNode",c.isCharacterDataNode,"node"),getNodeIndex:et("nodeIndex",c.getNodeIndex,"node"),getLength:et("nodeLength",c.getNodeLength,"node"),containsPositions:et("containsPositions",W,"node"),isWhitespace:et("isWhitespace",Y,"node"),isCollapsedWhitespace:et("isCollapsedWhitespace",J,"node"),getComputedDisplay:et("computedDisplay",F,"node"),isCollapsed:et("collapsed",Q,"node"),isIgnored:et("ignored",Z,"node"),next:et("nextPos",K,"node"),previous:et("previous",X,"node"),getTextNodeInfo:et("textNodeInfo",(function(t){var e=null,n=!1,r=I(t.parentNode,"whiteSpace"),o="pre-line"==r;return o?(e=g,n=!0):"normal"!=r&&"nowrap"!=r||(e=m,n=!0),{node:t,text:t.data,spaceRegex:e,collapseSpaces:n,preLine:o}}),"node"),hasInnerText:et("hasInnerText",(function(t,e){for(var n=this.session,r=n.getPosition(t.parentNode,this.getNodeIndex()+1),o=n.getPosition(t,0),i=e?r:o,a=e?o:r;i!==a;){if(i.prepopulateChar(),i.isDefinitelyNonEmpty())return!0;i=e?i.previousVisible():i.nextVisible()}return!1}),"node"),isRenderedBlock:et("isRenderedBlock",(function(t){for(var e=t.getElementsByTagName("br"),n=0,r=e.length;n<r;++n)if(!Q(e[n]))return!0;return this.hasInnerText()}),"node"),getTrailingSpace:et("trailingSpace",(function(t){if("br"==t.tagName.toLowerCase())return"";switch(this.getComputedDisplay()){case"inline":for(var e=t.lastChild;e;){if(!Z(e))return 1==e.nodeType?this.session.getNodeWrapper(e).getTrailingSpace():"";e=e.previousSibling}break;case"inline-block":case"inline-table":case"none":case"table-column":case"table-column-group":break;case"table-cell":return"\t";default:return this.isRenderedBlock(!0)?"\n":""}return""}),"node"),getLeadingSpace:et("leadingSpace",(function(t){switch(this.getComputedDisplay()){case"inline":case"inline-block":case"inline-table":case"none":case"table-column":case"table-column-group":case"table-cell":break;default:return this.isRenderedBlock(!1)?"\n":""}return""}),"node")});var pt={character:"",characterType:ot,isBr:!1,prepopulateChar:function(){var t=this;if(!t.prepopulatedChar){var e=t.node,n=t.offset,r="",o=ot,i=!1;if(n>0)if(3==e.nodeType){var a=e.data,u=a.charAt(n-1),c=t.nodeWrapper.getTextNodeInfo(),s=c.spaceRegex;c.collapseSpaces?s.test(u)?n>1&&s.test(a.charAt(n-2))||(c.preLine&&"\n"===a.charAt(n)?(r=" ",o=ft):(r=" ",o=ut)):(r=u,o=it,i=!0):(r=u,o=at,i=!0)}else{var l=e.childNodes[n-1];if(l&&1==l.nodeType&&!Q(l)&&("br"==l.tagName.toLowerCase()?(r="\n",t.isBr=!0,o=ut,i=!1):t.checkForTrailingSpace=!0),!r){var f=e.childNodes[n];f&&1==f.nodeType&&!Q(f)&&(t.checkForLeadingSpace=!0)}}t.prepopulatedChar=!0,t.character=r,t.characterType=o,t.isCharInvariant=i}},isDefinitelyNonEmpty:function(){var t=this.characterType;return t==it||t==at},resolveLeadingAndTrailingSpaces:function(){if(this.prepopulatedChar||this.prepopulateChar(),this.checkForTrailingSpace){var t=this.session.getNodeWrapper(this.node.childNodes[this.offset-1]).getTrailingSpace();t&&(this.isTrailingSpace=!0,this.character=t,this.characterType=ut),this.checkForTrailingSpace=!1}if(this.checkForLeadingSpace){var e=this.session.getNodeWrapper(this.node.childNodes[this.offset]).getLeadingSpace();e&&(this.isLeadingSpace=!0,this.character=e,this.characterType=ut),this.checkForLeadingSpace=!1}},getPrecedingUncollapsedPosition:function(t){for(var e=this;e=e.previousVisible();)if(""!==e.getCharacter(t))return e;return null},getCharacter:function(t){this.resolveLeadingAndTrailingSpaces();var e=this.character,n=O(t.ignoreCharacters),r=""!==e&&n.indexOf(e)>-1;if(this.isCharInvariant)return r?"":e;var o=["character",t.includeSpaceBeforeBr,t.includeBlockContentTrailingSpace,t.includePreLineTrailingSpace,n].join("_"),i=this.cache.get(o);if(null!==i)return i;var a,u,c="",s=this.characterType==ut,l=!1,f=this;function d(){return l||(u=f.getPrecedingUncollapsedPosition(t),l=!0),u}return s&&(this.type==mt?c="\n":" "==e&&(!d()||u.isTrailingSpace||"\n"==u.character||" "==u.character&&u.characterType==ut)||("\n"==e&&this.isLeadingSpace?d()&&"\n"!=u.character&&(c="\n"):(a=this.nextUncollapsed())&&(a.isBr?this.type=lt:a.isTrailingSpace&&"\n"==a.character?this.type=st:a.isLeadingSpace&&"\n"==a.character&&(this.type=ct),"\n"==a.character?(this.type!=lt||t.includeSpaceBeforeBr)&&(this.type!=ct||t.includeSpaceBeforeBlock)&&(this.type==st&&a.isTrailingSpace&&!t.includeBlockContentTrailingSpace||(this.type!=ft||a.type!=it||t.includePreLineTrailingSpace)&&("\n"==e?a.isTrailingSpace?this.isTrailingSpace||this.isBr&&(a.type=dt,d()&&u.isLeadingSpace&&!u.isTrailingSpace&&"\n"==u.character?a.character="":a.type=mt):c="\n":" "==e&&(c=" "))):c=e))),n.indexOf(c)>-1&&(c=""),this.cache.set(o,c),c},equals:function(t){return!!t&&this.node===t.node&&this.offset===t.offset},inspect:ht,toString:function(){return this.character}};gt.prototype=pt,l(pt,{next:et("nextPos",(function(t){var e,n,r,o=t.nodeWrapper,i=t.node,a=t.offset,u=o.session;return i?(a==o.getLength()?n=(e=i.parentNode)?o.getNodeIndex()+1:0:o.isCharacterDataNode()?(e=i,n=a+1):(r=i.childNodes[a],u.getNodeWrapper(r).containsPositions()?(e=r,n=0):(e=i,n=a+1)),e?u.getPosition(e,n):null):null})),previous:et("previous",(function(t){var e,n,r,o=t.nodeWrapper,i=t.node,a=t.offset,u=o.session;return 0==a?n=(e=i.parentNode)?o.getNodeIndex():0:o.isCharacterDataNode()?(e=i,n=a-1):(r=i.childNodes[a-1],u.getNodeWrapper(r).containsPositions()?(e=r,n=c.getNodeLength(r)):(e=i,n=a-1)),e?u.getPosition(e,n):null})),nextVisible:et("nextVisible",(function(t){var e=t.next();if(!e)return null;var n=e.nodeWrapper,r=e.node,o=e;return n.isCollapsed()&&(o=n.session.getPosition(r.parentNode,n.getNodeIndex()+1)),o})),nextUncollapsed:et("nextUncollapsed",(function(t){for(var e=t;e=e.nextVisible();)if(e.resolveLeadingAndTrailingSpaces(),""!==e.character)return e;return null})),previousVisible:et("previousVisible",(function(t){var e=t.previous();if(!e)return null;var n=e.nodeWrapper,r=e.node,o=e;return n.isCollapsed()&&(o=n.session.getPosition(r.parentNode,n.getNodeIndex())),o}))});var vt=null,bt=function(){function t(t){var e=new tt;return{get:function(n){var r=e.get(n[t]);if(r)for(var o,i=0;o=r[i++];)if(o.node===n)return o;return null},set:function(n){var r=n.node[t];(e.get(r)||e.set(r,[])).push(n)}}}var e=s.isHostProperty(document.documentElement,"uniqueID");function n(){this.initCaches()}return n.prototype={initCaches:function(){var n;this.elementCache=e?(n=new tt,{get:function(t){return n.get(t.uniqueID)},set:function(t){n.set(t.node.uniqueID,t)}}):t("tagName"),this.textNodeCache=t("data"),this.otherNodeCache=t("nodeName")},getNodeWrapper:function(t){var e;switch(t.nodeType){case 1:e=this.elementCache;break;case 3:e=this.textNodeCache;break;default:e=this.otherNodeCache}var n=e.get(t);return n||(n=new nt(t,this),e.set(n)),n},getPosition:function(t,e){return this.getNodeWrapper(t).getPosition(e)},getRangeBoundaryPosition:function(t,e){var n=e?"start":"end";return this.getPosition(t[n+"Container"],t[n+"Offset"])},detach:function(){this.elementCache=this.textNodeCache=this.otherNodeCache=null}},n}();function yt(){return xt(),vt=new bt}function wt(){return vt||yt()}function xt(){vt&&vt.detach(),vt=null}function Ct(t,n,r,o){r&&(n?Q(r.node)&&(r=t.previousVisible()):Q(r.node)&&(r=r.nextVisible()));var i=t,a=!1;function u(){var t=null;return n?(t=i,a||(i=i.previousVisible(),a=!i||r&&i.equals(r))):a||(t=i=i.nextVisible(),a=!i||r&&i.equals(r)),a&&(i=null),t}var c,s=!1;return{next:function(){if(s)return s=!1,c;for(var t;t=u();)if(t.getCharacter(o))return c=t,t;return null},rewind:function(){if(!c)throw e.createError("createCharacterIterator: cannot rewind. Only one position can be rewound.");s=!0},dispose:function(){t=r=null}}}l(c,{nextNode:K,previousNode:X});var St=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var n=0,r=t.length;n<r;++n)if(t[n]===e)return n;return-1};function kt(t,e,n){var r=Ct(t,!1,null,e),o=Ct(t,!0,null,e),i=n.tokenizer;function a(t){for(var e,n,i=[],a=t?r:o,u=!1,c=!1;e=a.next();){if(n=e.character,h.test(n))c&&(c=!1,u=!0);else{if(u){a.rewind();break}c=!0}i.push(e)}return i}var u=a(!0),c=a(!1).reverse(),s=k(c.concat(u),n,i),l=u.length?s.slice(St(s,u[0].token)):[],f=c.length?s.slice(0,St(s,c.pop().token)+1):[];return{nextEndToken:function(){for(var t,e;1==l.length&&!(t=l[0]).isWord&&(e=a(!0)).length>0;)l=k(t.chars.concat(e),n,i);return l.shift()},previousStartToken:function(){for(var t,e;1==f.length&&!(t=f[0]).isWord&&(e=a(!1)).length>0;)f=k(e.reverse().concat(t.chars),n,i);return f.pop()},dispose:function(){r.dispose(),o.dispose(),l=f=null}}}function Tt(t,e,n,r,o){var i,c,s,l,f=0,d=t,m=Math.abs(n);if(0!==n){var g=n<0;switch(e){case a:for(c=Ct(t,g,null,r);(i=c.next())&&f<m;)++f,d=i;s=i,c.dispose();break;case u:for(var h=kt(t,r,o),p=g?h.previousStartToken:h.nextEndToken;(l=p())&&f<m;)l.isWord&&(++f,d=g?l.chars[0]:l.chars[l.chars.length-1]);break;default:throw new Error("movePositionBy: unit '"+e+"' not implemented")}g?(d=d.previousVisible(),f=-f):d&&d.isLeadingSpace&&!d.isTrailingSpace&&(e==u&&(s=(c=Ct(t,!1,null,r)).next(),c.dispose()),s&&(d=s.previousVisible()))}return{position:d,unitsMoved:f}}function Ot(t,e,n,r){var o=t.getRangeBoundaryPosition(e,!0),i=t.getRangeBoundaryPosition(e,!1);return Ct(r?i:o,!!r,r?o:i,n)}function Et(t,e,n){for(var r,o=[],i=Ot(t,e,n);r=i.next();)o.push(r);return i.dispose(),o}function _t(e,n,r){var o=t.createRange(e.node);return o.setStartAndEnd(e.node,e.offset,n.node,n.offset),!o.expand("word",{wordOptions:r})}function Rt(t,e,n,r,o){var i,a,u,c,s,l,f=b(o.direction),d=Ct(t,f,t.session.getRangeBoundaryPosition(r,f),o.characterOptions),m="",g=[],h=null;function p(t,e){var n=g[t].previousVisible(),r=g[e-1];return{startPos:n,endPos:r,valid:!o.wholeWordsOnly||_t(n,r,o.wordOptions)}}for(;i=d.next();)if(a=i.character,n||o.caseSensitive||(a=a.toLowerCase()),f?(g.unshift(i),m=a+m):(g.push(i),m+=a),n){if(s=e.exec(m))if(c=(u=s.index)+s[0].length,l){if(!f&&c<m.length||f&&u>0){h=p(u,c);break}}else l=!0}else if(-1!=(u=m.indexOf(e))){h=p(u,u+e.length);break}return l&&(h=p(u,c)),d.dispose(),h}function Nt(t){return function(){var e=!!vt,n=[wt()].concat(s.toArray(arguments)),r=t.apply(this,n);return e||xt(),r}}function At(t,e){return Nt((function(n,r,o,u){typeof o==i&&(o=r,r=a),u=B(u,N);var c=t;e&&(c=o>=0,this.collapse(!c));var s=Tt(n.getRangeBoundaryPosition(this,c),r,o,u.characterOptions,u.wordOptions),l=s.position;return this[c?"setStart":"setEnd"](l.node,l.offset),s.unitsMoved}))}function Dt(t){return Nt((function(e,n){for(var r,o=Ot(e,this,n=f(n,T),!t),i=0;(r=o.next())&&h.test(r.character);)++i;o.dispose();var a=i>0;return a&&this[t?"moveStart":"moveEnd"]("character",t?i:-i,{characterOptions:n}),a}))}function Mt(t){return Nt((function(e,n){var r=!1;return this.changeEachRange((function(e){r=e[t](n)||r})),r}))}l(t.rangePrototype,{moveStart:At(!0,!1),moveEnd:At(!1,!1),move:At(!0,!0),trimStart:Dt(!0),trimEnd:Dt(!1),trim:Nt((function(t,e){var n=this.trimStart(e),r=this.trimEnd(e);return n||r})),expand:Nt((function(t,e,n){var r=!1,o=(n=B(n,A)).characterOptions;if(e||(e=a),e==u){var i,c,s=n.wordOptions,l=t.getRangeBoundaryPosition(this,!0),f=t.getRangeBoundaryPosition(this,!1),d=kt(l,o,s).nextEndToken(),m=d.chars[0].previousVisible();return i=this.collapsed?d:kt(f,o,s).previousStartToken(),c=i.chars[i.chars.length-1],m.equals(l)||(this.setStart(m.node,m.offset),r=!0),c&&!c.equals(f)&&(this.setEnd(c.node,c.offset),r=!0),n.trim&&(n.trimStart&&(r=this.trimStart(o)||r),n.trimEnd&&(r=this.trimEnd(o)||r)),r}return this.moveEnd(a,1,n)})),text:Nt((function(t,e){return this.collapsed?"":Et(t,this,f(e,T)).join("")})),selectCharacters:Nt((function(t,e,n,r,o){var i={characterOptions:o};e||(e=d(this.getDocument())),this.selectNodeContents(e),this.collapse(!0),this.moveStart("character",n,i),this.collapse(!0),this.moveEnd("character",r-n,i)})),toCharacterRange:Nt((function(t,e,n){e||(e=d(this.getDocument()));var r,o=e.parentNode,i=c.getNodeIndex(e),a=-1==c.comparePoints(this.startContainer,this.endContainer,o,i),u=this.cloneRange();return a?(u.setStartAndEnd(this.startContainer,this.startOffset,o,i),r=-u.text(n).length):(u.setStartAndEnd(o,i,this.startContainer,this.startOffset),r=u.text(n).length),{start:r,end:r+this.text(n).length}})),findText:Nt((function(e,n,r){(r=B(r,R)).wholeWordsOnly&&(r.wordOptions.includeTrailingSpace=!1);var o=b(r.direction),i=r.withinRange;i||(i=t.createRange()).selectNodeContents(this.getDocument());var a=n,u=!1;"string"==typeof a?r.caseSensitive||(a=a.toLowerCase()):u=!0;var c=e.getRangeBoundaryPosition(this,!o),s=i.comparePoint(c.node,c.offset);-1===s?c=e.getRangeBoundaryPosition(i,!0):1===s&&(c=e.getRangeBoundaryPosition(i,!1));for(var l,f=c,d=!1;;)if(l=Rt(f,a,u,i,r)){if(l.valid)return this.setStartAndEnd(l.startPos.node,l.startPos.offset,l.endPos.node,l.endPos.offset),!0;f=o?l.startPos:l.endPos}else{if(!r.wrap||d)return!1;i=i.cloneRange(),f=e.getRangeBoundaryPosition(i,!o),i.setBoundary(c.node,c.offset,o),d=!0}})),pasteHtml:function(t){if(this.deleteContents(),t){var e=this.createContextualFragment(t),n=e.lastChild;this.insertNode(e),this.collapseAfter(n)}}}),l(t.selectionPrototype,{expand:Nt((function(t,e,n){this.changeEachRange((function(t){t.expand(e,n)}))})),move:Nt((function(t,e,n,r){var o=0;if(this.focusNode){this.collapse(this.focusNode,this.focusOffset);var i=this.getRangeAt(0);r||(r={}),r.characterOptions=f(r.characterOptions,E),o=i.move(e,n,r),this.setSingleRange(i)}return o})),trimStart:Mt("trimStart"),trimEnd:Mt("trimEnd"),trim:Mt("trim"),selectCharacters:Nt((function(e,n,r,o,i,a){var u=t.createRange(n);u.selectCharacters(n,r,o,a),this.setSingleRange(u,i)})),saveCharacterRanges:Nt((function(t,e,n){for(var r=this.getAllRanges(),o=[],i=1==r.length&&this.isBackward(),a=0,u=r.length;a<u;++a)o[a]={characterRange:r[a].toCharacterRange(e,n),backward:i,characterOptions:n};return o})),restoreCharacterRanges:Nt((function(e,n,r){this.removeAllRanges();for(var o,i,a,u=0,c=r.length;u<c;++u)a=(i=r[u]).characterRange,(o=t.createRange(n)).selectCharacters(n,a.start,a.end,i.characterOptions),this.addRange(o,i.backward)})),text:Nt((function(t,e){for(var n=[],r=0,o=this.rangeCount;r<o;++r)n[r]=this.getRangeAt(r).text(e);return n.join("")}))}),t.innerText=function(e,n){var r=t.createRange(e);return r.selectNodeContents(e),r.text(n)},t.createWordIterator=function(t,e,n){var r=wt();n=B(n,D);var o=kt(r.getPosition(t,e),n.characterOptions,n.wordOptions),i=b(n.direction);return{next:function(){return i?o.previousStartToken():o.nextEndToken()},dispose:function(){o.dispose(),this.next=function(){}}}},t.noMutation=function(t){t(wt()),xt()},t.noMutation.createEntryPointFunction=Nt,t.textRange={isBlockNode:U,isCollapsedWhitespaceNode:J,createPosition:Nt((function(t,e,n){return t.getPosition(e,n)}))}})),t})?r.apply(e,o):r)||(t.exports=i)},8785:()=>{tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 01-1-1v-5c0-.6-.4-1-1-1a1 1 0 00-1 1v5c0 .6-.4 1-1 1a1 1 0 01-1-1V9H4a1 1 0 110-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" fill-rule="nonzero"/></svg>',"action-next":'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 00-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 10-1.4-1.4L12 13.6 5.7 7.3z"/></svg>',"action-prev":'<svg width="24" height="24"><path fill-rule="nonzero" d="M18.3 15.7a1 1 0 001.4-1.4L12 6.6l-7.7 7.7a1 1 0 001.4 1.4L12 9.4l6.3 6.3z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 110-2h9.2zm4 0h.8a1 1 0 010 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h6.8zm4 0H19a1 1 0 010 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h4.4zm4 0H19a1 1 0 010 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 010-2h2zm4 0h8a1 1 0 010 2H9.8l1.2-2zm5.2-13.5l1.3.7-9.7 16.3-1.3-.7 9.7-16.3z" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 001.4-1V6a1 1 0 00-1.4-.9l-12 6a1 1 0 000 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 015 18V6a1 1 0 011.4-.9l12 6a1 1 0 010 1.8z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 01-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4z" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 00-1 1z" fill-rule="nonzero"/></svg>',"border-style":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="2" x="3" y="6" rx="1"/><rect width="2.8" height="2" x="3" y="16" rx="1"/><rect width="2.8" height="2" x="6.8" y="16" rx="1"/><rect width="2.8" height="2" x="10.6" y="16" rx="1"/><rect width="2.8" height="2" x="14.4" y="16" rx="1"/><rect width="2.8" height="2" x="18.2" y="16" rx="1"/><rect width="8" height="2" x="3" y="11" rx="1"/><rect width="8" height="2" x="13" y="11" rx="1"/></g></svg>',"border-width":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="5" x="3" y="5" rx="1"/><rect width="18" height="3.5" x="3" y="11.5" rx="1"/><rect width="18" height="2" x="3" y="17" rx="1"/></g></svg>',brightness:'<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 01-.7-.3A1 1 0 0111 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3h-1a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 01-.7.3H5a1 1 0 01-.7-.3A1 1 0 014 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7zm10 3.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 01-.8.3 1 1 0 01-.6-.3l-.8-.7a1 1 0 01-.3-.8c0-.2.1-.5.3-.7a1 1 0 011.4 0zm-10-7l-.7-.8a1 1 0 01-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.8-.3zm10 0a1 1 0 01-.8.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 010 1.4l-.8.8a1 1 0 01-.6.3 1 1 0 01-.8-.3 1 1 0 01-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 013.7 2.4 4 4 0 010 3.2A4 4 0 0112 16a4 4 0 01-3.7-2.4 4 4 0 010-3.2A4 4 0 0112 8zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7z" fill-rule="evenodd"/></svg>',browse:'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 11-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L13 13.4V20a1 1 0 01-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 110 14.8 7.4 7.4 0 010-14.8zM12 3a9 9 0 100 18 9 9 0 000-18zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7z" fill-rule="nonzero"/></svg>',"cell-background-color":'<svg width="24" height="24"><path d="M15.7 2l1.6 1.6-2.7 2.6 5.9 5.8c.7.7.7 1.7 0 2.4l-6.3 6.1a1.7 1.7 0 01-2.4 0l-6.3-6.1c-.7-.7-.7-1.7 0-2.4L15.7 2zM18 12l-4.5-4L9 12h9zM4 16s2 2.4 2 3.8C6 21 5.1 22 4 22s-2-1-2-2.2C2 18.4 4 16 4 16z"/></svg>',"cell-border-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M5 13v5h2v2H5a2 2 0 01-2-2v-5h2zm8-7V4h6a2 2 0 012 2h-8z" opacity=".2"/><path fill-rule="nonzero" d="M13 4v2H5v7H3V6c0-1.1.9-2 2-2h8zm-2.6 14.1l.1-.1.1.1.2.3.2.2.2.2c.4.6.8 1.2.8 1.7 0 .8-.7 1.5-1.5 1.5S9 21.3 9 20.5c0-.5.4-1.1.8-1.7l.2-.2.2-.2.2-.3z"/><path d="M13 11l-2 2H5v-2h6V6h2z"/><path fill-rule="nonzero" d="M18.4 8l1 1-1.8 1.9 4 4c.5.4.5 1.1 0 1.6l-4.3 4.2a1.2 1.2 0 01-1.6 0l-4.4-4.2c-.4-.5-.4-1.2 0-1.7l7-6.8zm1.6 7l-3-3-3 3h6z"/></g></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 01-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 01-1 .7h-.2a.7.7 0 01-.7-1l4-12a1 1 0 012 0l4 12a.7.7 0 01-.8 1h-.2a1 1 0 01-1-.7l-.8-2.6zm-.3-1.5l-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1zm4.8-6.8V10H7.7V5.8h-1v-1h2zM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1zM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 01-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 00-.5-.1 1 1 0 00-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 00-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 001.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 00-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 00-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 01-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 01-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1z" fill-rule="evenodd"/></svg>',"checklist-rtl":'<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8a1 1 0 010 2h-8a1 1 0 010-2zM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 011.6 1.2l-8 12a1 1 0 01-1.5.1l-5-5a1 1 0 111.4-1.4l4.1 4.1 7.4-11z" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 010-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8z" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><path d="M7.8 1.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 010-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1z" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 010-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 010-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 010-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0z" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><path d="M17.3 8.2L13.4 12l3.9 3.8a1 1 0 01-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 01-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 011.5-1.5l3.8 3.9 3.8-3.9a1 1 0 011.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 01-.8 2 2.8 2.8 0 01.8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 01-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 01.8-2 2.8 2.8 0 01-.8-2zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2zM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 01-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 01-.5-.5V17a3 3 0 001-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5z" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0118 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 01-3.7 3 5.7 5.7 0 01-3.2 0A5.9 5.9 0 017.6 18a6.2 6.2 0 01-1.4-2.6 6.7 6.7 0 010-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 012.3-4A20 20 0 0112 4a26.4 26.4 0 013.2 3.4 18.2 18.2 0 012.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 00-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 01-1.3 3 5.3 5.3 0 01-2.3 1.5 4.9 4.9 0 01-2 .1 4.3 4.3 0 002.4.8 4 4 0 002-.6 4 4 0 001.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 000 18 1.5 1.5 0 001.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 005-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3-4a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm5 0a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3 4a1.5 1.5 0 110-3 1.5 1.5 0 010 3z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',"comment-add":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/><path d="M13 10h2a1 1 0 010 2h-2v2a1 1 0 01-2 0v-2H9a1 1 0 010-2h2V8a1 1 0 012 0v2z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-6 8a6 6 0 006 6V6a6 6 0 00-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 00-2 2v11h2V5h10V3zm1 4a2 2 0 012 2v10a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7zm0 12V9h-7v10h7z" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 01-1-1v-2H7V9H5a1 1 0 110-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3zM9 9v5l5-5H9zm1 6h5v-5l-5 5z" fill-rule="evenodd"/></svg>',"cut-column":'<svg width="24" height="24"><path fill-rule="evenodd" d="M7.2 4.5c.9 0 1.6.4 2.2 1A3.7 3.7 0 0110.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 012 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 017 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7zm12.3 5h-3v10h3v-10zM8 13.8h-.3l-.4.2a2.8 2.8 0 00-.7.4v.1a2.8 2.8 0 00-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 00.8-.3 2.4 2.4 0 00.7-.7 2.5 2.5 0 00.3-.8 1.5 1.5 0 000-.8 1 1 0 00-.2-.4 1 1 0 00-.5-.2H8zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zM7 5.8h-.4a1 1 0 00-.5.3 1 1 0 00-.2.5v.7a2.5 2.5 0 00.3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 000-.8 2.6 2.6 0 00-.3-.8A2.5 2.5 0 007.7 6l-.4-.1H7z"/></svg>',"cut-row":'<svg width="24" height="24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 00-.8.4 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3L9 18V18l.4-.4.2-.4.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2h-.5zm7 0H15a1 1 0 00-.4.3 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4a2.8 2.8 0 00.5.7h.1a2.8 2.8 0 00.8.6l.4.1h.7l.5-.2.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3h-.3zM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zm8.5-7.1h-11v2h11v-2z"/></svg>',cut:'<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 010 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8zm-8.5 2.2l.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2 1.6 1.6 0 00-.8 0 2.6 2.6 0 00-.8.3 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3 2.8 2.8 0 001-1zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4zm5.4 4l.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3 1.5 1.5 0 00-.8 0 1 1 0 00-.4.2 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4l.3.4.3.4a2.8 2.8 0 00.8.5l.4.1h.7l.5-.2z" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5zm0 4h2v2h-2V9zM9 9h2v2H9V9zm4 4h2v2h-2v-2zm-4 0h2v2H9v-2zm0 4h2v2H9v-2zm4 0h2v2h-2v-2zM9 5h2v2H9V5z" fill-rule="evenodd"/></svg>',"duplicate-column":'<svg width="24" height="24"><path d="M17 6v16h-7V6h7zm-2 2h-3v12h3V8zm-2-6v2H8v15H6V2h7z"/></svg>',"duplicate-row":'<svg width="24" height="24"><path d="M22 11v7H6v-7h16zm-2 2H8v3h12v-3zm-1-6v2H4v5H2V7h17z"/></svg>',duplicate:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10zm3 8h-2V9h-7v10h9a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7a2 2 0 012 2v2z"/><path d="M17 14h1a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1h-1a1 1 0 010-2h1v-1a1 1 0 012 0v1z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5zm-2-.2l1-.9v-.3l-2.2-2.2a.3.3 0 00-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5z"/></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 00-2-2H7v2h11v9zM6 17h15a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1H6a2 2 0 01-2-2V7H3a1 1 0 110-2h1V4a1 1 0 112 0v13zm3-5.3l1.3 2 3-4.7 3.7 6H7l2-3.3z" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0119 6zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 008 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 00-4 4.5h2.2zm-3.4 0a12 12 0 012.8-4 12 12 0 00-5 4h2.2z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 010 .8l-5.6 4A.5.5 0 019 16V8a.5.5 0 01.8-.4z" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5zM12 4a8 8 0 100 16 8 8 0 000-16zm0 14.5a6.5 6.5 0 110-13 6.5 6.5 0 010 13z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3L18 7v1h-5V5H7v14h9a1 1 0 012 0c0 1-.8 2-1.9 2H7c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h7.5z"/><path d="M18.1 12c.5 0 .9.4.9 1 0 .5-.3 1-.8 1h-7.3c-.5 0-.9-.4-.9-1 0-.5.3-1 .8-1h7.3z"/><path d="M16.4 9.2a1 1 0 011.4.2l2.4 3.6-2.4 3.6a1 1 0 01-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 01.2-1.4z"/></g></svg>',fill:'<svg width="24" height="26"><path d="M16.6 12l-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 002.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 002-2c0-1.3-2-3.5-2-3.5z" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 00-2 2zm14-2v2h2a2 2 0 00-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 002-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 00-2 2v3h2V6h10v3h2V6a2 2 0 00-2-2zm2 14h-2v2a2 2 0 002-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 00-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3z" fill-rule="nonzero"/></svg>',format:'<svg width="24" height="24"><path fill-rule="evenodd" d="M17 5a1 1 0 010 2h-4v11a1 1 0 01-2 0V7H7a1 1 0 110-2h10z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 110-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 11-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 111.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 110-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 110 1.7H5a.9.9 0 01-.9-.9v-4.4a.9.9 0 111.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 01-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 010 1.8H7l3 2.9-1.3 1.2z" fill-rule="nonzero"/></svg>',gallery:'<svg width="24" height="24"><path fill-rule="nonzero" d="M5 15.7l2.3-2.2c.3-.3.7-.3 1 0L11 16l5.1-5c.3-.4.8-.4 1 0l2 1.9V8H5v7.7zM5 18V19h3l1.8-1.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 01-1-1V7c0-.6.4-1 1-1zm6 7a2 2 0 110-4 2 2 0 010 4zM4.5 4h15a.5.5 0 110 1h-15a.5.5 0 010-1zm2-2h11a.5.5 0 110 1h-11a.5.5 0 010-1z"/></svg>',gamma:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 00-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 01.6.5l.1.3a8.5 8.5 0 01.3.6l1.9 4.6 2-5.2a1 1 0 011-.6.5.5 0 01.5.6L13 14v2.8a.7.7 0 01-1.4 0z" fill-rule="nonzero"/></svg>',help:'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 00-6 9 6.3 6.3 0 001.4 2l1 1a6.3 6.3 0 003.6 1 6.5 6.5 0 006-9 6.3 6.3 0 00-1.4-2l-1-1a6.3 6.3 0 00-3.6-1zM12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4z"/><path d="M9.6 9.7a.7.7 0 01-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 00-.8.8.8.8 0 01-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 012.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="M5 15.7l3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7zM5 18V19h3l2.8-2.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 100-4 2 2 0 000 4z" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-1 3v2h2V7h-2zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4z" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 001.8-2.9 6.3 6.3 0 00-.1-4.1 5.8 5.8 0 00-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 00-3.9 1.8 6.3 6.3 0 00-1.3 6 6.2 6.2 0 001.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 014 11c0-1 .2-1.9.6-2.7A7 7 0 016.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 015.7 2 7 7 0 011.7 2.3 6 6 0 01.2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 01-3.6 2.5v.5z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 100-14 7 7 0 000 14zm0 2a9 9 0 110-18 9 9 0 010 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 00-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 01-3.1 1.9 6.1 6.1 0 01-5.5-1.6A5.8 5.8 0 016 14v-.3l.1-1.2A13.9 13.9 0 017.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 00.2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 00-3-4.2L12 6a26.1 26.1 0 00-2.2 2.5l-1-1a20.9 20.9 0 012.9-3.3L12 4l1 .8a22.2 22.2 0 014 5.4c.6 1.2 1 2.4 1 3.6z" fill-rule="evenodd"/></svg>',italic:'<svg width="24" height="24"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8z" fill-rule="evenodd"/></svg>',language:'<svg width="24" height="24"><path d="M12 3a9 9 0 110 18 9 9 0 010-18zm4.3 13.3c-.5 1-1.2 2-2 2.9a7.5 7.5 0 003.2-2.1l-.2-.2a6 6 0 00-1-.6zm-8.6 0c-.5.2-.9.5-1.2.8.9 1 2 1.7 3.2 2a10 10 0 01-2-2.8zm3.6-.8c-.8 0-1.6.1-2.2.3.5 1 1.2 1.9 2.1 2.7zm1.5 0v3c.9-.8 1.6-1.7 2.1-2.7-.6-.2-1.4-.3-2.1-.3zm-6-2.7H4.5c.2 1 .5 2.1 1 3h.3l1.3-1a10 10 0 01-.3-2zm12.7 0h-2.3c0 .7-.1 1.4-.3 2l1.6 1.1c.5-1 .9-2 1-3.1zm-3.8 0h-3V14c1 0 2 .1 2.7.4.2-.5.3-1 .3-1.6zm-4.4 0h-3l.3 1.6c.8-.3 1.7-.4 2.7-.4v-1.3zm-5.5-5c-.7 1-1.1 2.2-1.3 3.5h2.3c0-1 .2-1.8.5-2.6l-1.5-1zm2.9 1.4v.1c-.2.6-.4 1.3-.4 2h3V9.4c-1 0-1.8-.1-2.6-.3zm6.6 0h-.1l-2.4.3v1.8h3l-.5-2.1zm3-1.4l-.3.1-1.3.8c.3.8.5 1.6.5 2.6h2.3a7.5 7.5 0 00-1.3-3.5zm-9 0l2 .2V5.5a9 9 0 00-2 2.2zm3.5-2.3V8c.6 0 1.3 0 1.9-.2a9 9 0 00-2-2.3zm-3-.7h-.1c-1.1.4-2.1 1-3 1.8l1.2.7a10 10 0 011.9-2.5zm4.4 0l.1.1a10 10 0 011.8 2.4l1.1-.7a7.5 7.5 0 00-3-1.8z"/></svg>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zM7 3.6l3.7 3.7a1 1 0 01-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 011.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 011.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 01-1.3 0h-.1a1 1 0 010-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1zM4 18h16v2H4v-2z" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2.1 2a2 2 0 102.7 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2-2a2 2 0 10-2.6-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 26a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 36a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-num-default-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 17v-4.8l-1.6 1v-1.1l1.6-1h1.2V17zM33.3 17.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm1.7 5.7c0-1.2 1-2 2.2-2 1.3 0 2.1.8 2.1 1.8 0 .7-.3 1.2-1.3 2.2l-1.2 1v.2h2.6v1h-4.3v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H35zm-1.7 4.3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm3.2 7.3v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H35c0-1.1 1-1.8 2.2-1.8 1.2 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.7.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .6 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm-3.3 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-lower-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M36.5 16c-.9 0-1.5-.5-1.5-1.3s.6-1.3 1.8-1.4h1v-.4c0-.4-.2-.6-.7-.6-.4 0-.7.1-.8.4h-1.1c0-.8.8-1.4 2-1.4S39 12 39 13V16h-1.2v-.6c-.3.4-.8.7-1.4.7zm.4-.8c.6 0 1-.4 1-.9V14h-1c-.5.1-.7.3-.7.6 0 .4.3.6.7.6zM33.1 16.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zM37.7 26c-.7 0-1.2-.2-1.5-.7v.7H35v-6.3h1.2v2.5c.3-.5.8-.9 1.5-.9 1.1 0 1.8 1 1.8 2.4 0 1.5-.7 2.4-1.8 2.4zm-.5-3.6c-.6 0-1 .5-1 1.3s.4 1.4 1 1.4c.7 0 1-.6 1-1.4 0-.8-.3-1.3-1-1.3zM33.2 26.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm6 7h-1c-.1-.5-.4-.8-1-.8s-1 .5-1 1.4c0 1 .4 1.4 1 1.4.5 0 .9-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm-6.1 3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 16c-1.2 0-2-.8-2-2.3 0-1.5.8-2.4 2-2.4.6 0 1 .4 1.3 1v-.9H40v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1-.7h-.2c-.2.4-.7.8-1.3.8zm.3-1c.6 0 1-.5 1-1.3s-.4-1.3-1-1.3-1 .5-1 1.3.4 1.4 1 1.4zM33.3 16.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM36 21.9c0-1.5.8-2.3 2.1-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.9 1.3.9.3 1.3.8 1.3 1.7 0 1.2-.7 1.9-1.8 1.9-.6 0-1.1-.3-1.4-.8v2.2H36V22zm1.8 1.2v-1h.3c.5 0 .9-.2.9-.7 0-.5-.3-.8-.9-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1 1.3s1-.4 1-1-.4-1-1.2-1h-.3zM33.3 26.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM37.1 34.6L34.8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.2.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zM33.3 36.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3zM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M32.9 16v-1.2h-1.3V16H33zm0 10v-1.2h-1.3V26H33zm0 10v-1.2h-1.3V36H33z"/><path fill-rule="nonzero" d="M36 21h-1.5v5H36zM36 31h-1.5v5H36zM39 21h-1.5v5H39zM39 31h-1.5v5H39zM42 31h-1.5v5H42zM36 11h-1.5v5H36zM36 19h-1.5v1H36zM36 29h-1.5v1H36zM39 19h-1.5v1H39zM39 29h-1.5v1H39zM42 29h-1.5v1H42zM36 9h-1.5v1H36z"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15zm0 10v-1.2h1.3V26H15zm0 10v-1.2h1.3V36H15z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M39.3 17l-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3zm-1.6-4.7l-.7 2.3h1.6l-.8-2.3zM33.4 17c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm4.7 9.9h-2.7v-6H38c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zm-1.4-5v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4h1.1c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9h-1.1V26zM33 27.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm4.9 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm-4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M12.6 17l-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3zM11 12.3l-.7 2.3h1.6l-.8-2.3zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M31.6 17v-1.2H33V17h-1.3zm0 10v-1.2H33V27h-1.3zm0 10v-1.2H33V37h-1.3z"/><path fill-rule="nonzero" d="M34.5 20H36v7h-1.5zM34.5 30H36v7h-1.5zM37.5 20H39v7h-1.5zM37.5 30H39v7h-1.5zM40.5 30H42v7h-1.5zM34.5 10H36v7h-1.5z"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15zm0 10v-1.2h1.3V27H15zm0 10v-1.2h1.3V37H15z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3zM10 8v3h4V8a1 1 0 00-.3-.7A1 1 0 0013 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 017.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-2v8H5V7h8l-2 2H7v8h8v-4zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><path d="M11 11H8a1 1 0 110-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 01-1-1v-3zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1z" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><path d="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 110-2zm13-1v3.5a.5.5 0 11-1 0V5h-.5a.5.5 0 110-1H19zm-1 8.8l.2.2h1.3a.5.5 0 110 1h-1.6a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2h-1.3a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zm2 4.2v2c0 .6-.4 1-1 1h-1.5a.5.5 0 010-1h1.2a.3.3 0 100-.6h-1.3a.4.4 0 110-.8h1.3a.3.3 0 000-.6h-1.2a.5.5 0 110-1H19c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 110-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 01-.5-.5V5h-.5a.5.5 0 010-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2H4.5a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 010-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 110-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 110-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4L1 13l6.4 6.5 6.5-6.5-6.5-6.5zM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7zM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 010-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 11-4.3 16.9l1.5-1.5A7 7 0 1013 6h-1z" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.2 1.6L6.8 12l1.8 1.2z" fill-rule="evenodd"/></svg>',"page-break":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 01-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 01-1-1v-5H7v5c0 .6-.4 1-1 1z"/></g></svg>',paragraph:'<svg width="24" height="24"><path fill-rule="evenodd" d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2z" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1z" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5L8 20H3v-3l3.5-3.5a2 2 0 010-3L14 3l1 1-7.3 7.3a1 1 0 000 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 01-2.8 0l-.1-.1z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><path d="M12 4c.5 0 1 .4 1 .9V11h6a1 1 0 01.1 2H13v6a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H11V5c0-.6.4-1 1-1z"/></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 01-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 01-1.4 0l-1.5-1.2a6.2 6.2 0 01-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 01-1-.9l-.2-1.9a5.8 5.8 0 01-1.5-.6l-1.5 1.2a1 1 0 01-1.4 0l-.7-.7a1 1 0 010-1.4l1.2-1.5a6.2 6.2 0 01-.6-1.5l-1.9-.2a1 1 0 01-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 01.6-1.5L5.2 7.3a1 1 0 010-1.4l.7-.7a1 1 0 011.4 0l1.5 1.2a6.2 6.2 0 011.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 011.5.6l1.5-1.2a1 1 0 011.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 01.6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 100-6 3 3 0 000 6z" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 002.1-2.8 15.7 15.7 0 00-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 00-6.7 3.2A16.2 16.2 0 003.2 12c0 .2.2.3.3.5zm-2.4-1l.7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 012.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 01-2.8-3.7 1 1 0 010-1zm12-3.3a2 2 0 102.7 2.6 4 4 0 11-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 00-3 3v6h2v3h14v-3h2v-6a3 3 0 00-3-3zm-1 10H7v-4h10v4zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5zm.5-8H6v2h12V5z" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3z" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 11-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 111.4-1.4l5 5a1 1 0 010 1.4l-5 5a1 1 0 01-1.4-1.4l3.3-3.3z" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5 22.1l-1.2-4.7v-.2a1 1 0 011-1l5 .4a1 1 0 11-.2 2l-2.2-.2a7.8 7.8 0 008.4.2 7.5 7.5 0 003.5-6.4 1 1 0 112 0 9.5 9.5 0 01-4.5 8 9.9 9.9 0 01-10.2 0l.4 1.4a1 1 0 11-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 00-9.5-1 7.5 7.5 0 00-3.6 7 1 1 0 01-2 0 9.5 9.5 0 014.5-8.6 10 10 0 0110.9.3l-.3-1a1 1 0 012-.5l1.1 4.8a1 1 0 01-1 1.2l-5-.4a1 1 0 01-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 010 .2l-2.6 10a1 1 0 01-1 .8h-.2a.8.8 0 01-.8-1l2.6-10H8a1 1 0 110-2h9a1 1 0 010 2h-3.8zM5 18h7a1 1 0 010 2H5a1 1 0 010-2zm13 1.5L16.5 18 15 19.5a.7.7 0 01-1-1l1.5-1.5-1.5-1.5a.7.7 0 011-1l1.5 1.5 1.5-1.5a.7.7 0 011 1L17.5 17l1.5 1.5a.7.7 0 01-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 010 2h-1v9a3 3 0 01-3 3H9a3 3 0 01-3-3V9H5a1 1 0 110-2h3V6a3 3 0 013-3h2a3 3 0 013 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 00-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 012 0v4a1 1 0 01-2 0v-4zm4 0a1 1 0 012 0v4a1 1 0 01-2 0v-4z" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 119 2l-7 7A.5.5 0 111 8l7-7zM8.1 5.1A.5.5 0 119 6l-3 3A.5.5 0 115 8l3-3z"/></g></svg>',resize:'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-6a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3A1 1 0 014 11V5z" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1z"/><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 012 0v6c0 .6-.4 1-1 1h-6a1 1 0 010-2h4.3L16 7A7.2 7.2 0 007.7 6a7 7 0 003 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 011.4 1.5A9.2 9.2 0 012.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8z" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 014.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L8 5zm12 11.2a1 1 0 11-1 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 111 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 10-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 10-1.4-1.4L13 11.6V4a1 1 0 00-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 00-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 00-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 002-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2zM7 17h10V7H7v10zm2-8h6v6H9V9z" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 00-1 1L9.6 17 18 8.6a.7.7 0 000-1 .7.7 0 00-1 0l-7.4 7.3z"/></svg>',settings:'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V8H5a1 1 0 110-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6zM8 8h2V6H8v2zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V13H5a1 1 0 010-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6zM14 13h2v-2h-2v2zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V18H5a1 1 0 010-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6zM8 18h2v-2H8v2z" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><path d="M16 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2z" fill-rule="evenodd"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 010-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7zM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 00-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7z"/></g></svg>',"spell-check":'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6zm0-3v2h2V5H6zm13 0h-3v5h3v1h-3a1 1 0 01-.7-.3 1 1 0 01-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12z" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 017 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1z"/><path d="M5 11h14a1 1 0 010 2H5a1 1 0 010-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="M10.4 10l4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10zM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 00-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 01-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4L10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11z" fill-rule="nonzero"/></svg>',"table-caption":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="12" height="2" x="3" y="4" rx="1"/><path d="M19 8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2v-8c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></g></svg>',"table-cell-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M13 4v9H3V6c0-1.1.9-2 2-2h8zm-2 2H5v5h6V6z"/><path fill-rule="nonzero" d="M13 4h6a2 2 0 012 2v7h-8v-2h6V6h-6V4z" opacity=".2"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/><path fill-rule="nonzero" d="M3 13v5c0 1.1.9 2 2 2h8v-7h-2v5H5v-5H3z" opacity=".2"/></g></svg>',"table-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8 0h-6v5h6v-5zm-8-7H5v5h6V6z"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z" opacity=".2"/></g></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z"/></g></svg>',"table-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v7h-8v7H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8-7h-6v5h6V6zm-8 0H5v5h6V6z"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5l1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5z"/></svg>',"table-delete-row":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8l1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3z"/></svg>',"table-delete-table":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="M14.4 8.6l1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-1-1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></g></svg>',"table-insert-column-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M20 4c.6 0 1 .4 1 1v2a1 1 0 01-2 0V6h-8v12h8v-1a1 1 0 012 0v2c0 .5-.4 1-.9 1H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H17v2a1 1 0 01-2 .1V13h-2a1 1 0 01-.1-2H15V9c0-.6.4-1 1-1zM9 6H5v5h4V6z"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H4a1 1 0 01-1-1v-2a1 1 0 012 0v1h8V6H5v1a1 1 0 11-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H9v2a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H7V9c0-.6.4-1 1-1zm11-2h-4v5h4V6z"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4a1 1 0 110 2H5v6h14V6h-1a1 1 0 010-2h2c.6 0 1 .4 1 1v13a2 2 0 01-2 2H5a2 2 0 01-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 010 2h-2v2a1 1 0 01-2 .1V8H9a1 1 0 010-2h2V4c0-.6.4-1 1-1z"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 01.1 2H13v2a1 1 0 01-2 .1V18H9a1 1 0 01-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 010-2h1v-6H5v6h1a1 1 0 010 2H4a1 1 0 01-1-1V6c0-1.1.9-2 2-2h14a2 2 0 012 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 9h-4v5h4v-5zm-6 0H9v5h4v-5zm0-7H9v5h4V6zm6 0h-4v5h4V6z"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15.5V18h3v-2.5H5zm14-5h-9V18h9v-7.5zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6zm-8 7.5h3v-3H5v3z"/></svg>',"table-row-numbering-rtl":'<svg width="24" height="24"><path d="M6 4a2 2 0 00-2 2v13c0 1.1.9 2 2 2h12a2 2 0 002-2V6a2 2 0 00-2-2H6zm0 12h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 11h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 6h8v3H6V6zm11 0c.6 0 1 .4 1 1v1a1 1 0 11-2 0V7c0-.6.4-1 1-1z"/></svg>',"table-row-numbering":'<svg width="24" height="24"><path d="M18 4a2 2 0 012 2v13a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2h12zm0 12h-8v3h8v-3zM7 16a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8v-3zM7 11a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8V6zM7 6a1 1 0 00-1 1v1a1 1 0 102 0V7c0-.6-.4-1-1-1z"/></svg>',"table-row-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-9h-6v3h6V6zM5 9h6V6H5v3z"/></svg>',"table-split-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1l1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2zm-8.5-1H5v3h3v-3zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6z"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 11H5v3h6v-3zm8 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></svg>',table:'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 14v4h6v-4H5zm14 0h-6v4h6v-4zm0-6h-6v4h6V8zM5 12h6V8H5v4z"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14zM9 16v-4a5 5 0 116 0v4h4a2 2 0 012 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 10-3.6 0l.8.6v5h2z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 111 0V6H15v1.6a8 8 0 11-6 0zm-2.6 5.3a.5.5 0 00.3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 013.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 00-4.1 3.7z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"/></g></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 010-1l3.1-3A12.4 12.4 0 016.7 9H8a10.1 10.1 0 001.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 110-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 01-1 2.4 13.5 13.5 0 01-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 01-.4.7 1 1 0 01-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 01-1 .7.5.5 0 01-.4-.7l2.7-7.4a1 1 0 012 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 01-.4 1.8l-1 1.4a5.3 5.3 0 01-5.5 1 5 5 0 01-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 01-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 002.2.8 3.4 3.4 0 002.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1zM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 01-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 11-1.4 1.4l-5-5a1 1 0 010-1.4l5-5a1 1 0 011.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2 2a2 2 0 102.6 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2.1-2a2 2 0 10-2.7-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2zM7.6 6.3a.8.8 0 01-1 1.1L3.3 4.2a.7.7 0 111-1l3.2 3.1zM5.1 8.6a.8.8 0 010 1.5H3a.8.8 0 010-1.5H5zm5-3.5a.8.8 0 01-1.5 0V3a.8.8 0 011.5 0V5zm6 11.8a.8.8 0 011-1l3.2 3.2a.8.8 0 01-1 1L16 17zm-2.2 2a.8.8 0 011.5 0V21a.8.8 0 01-1.5 0V19zm5-3.5a.7.7 0 110-1.5H21a.8.8 0 010 1.5H19z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 00-.3-.7A1 1 0 0016 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6z"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 012 0v3c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-3a1 1 0 012 0v2h12zM11 6.4L8.7 8.7a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L13 6.4V16a1 1 0 01-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 110-24 12 12 0 010 24zm-8.7-5.3a11 11 0 0017.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7zM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13z" fill-rule="nonzero"/></svg>',"vertical-align":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="18" height="2" x="3" y="11" rx="1"/><path d="M12 2c.6 0 1 .4 1 1v4l2-1.3a1 1 0 011.2 1.5l-.1.1-4.1 3-4-3a1 1 0 011-1.7l2 1.5V3c0-.6.4-1 1-1zm0 11.8l4 2.9a1 1 0 01-1 1.7l-2-1.5V21c0 .5-.4 1-.9 1H12a1 1 0 01-1-1v-4l-2 1.3a1 1 0 01-1.2-.1l-.1-.1a1 1 0 01.1-1.3l.1-.1 4.1-3z"/></g></svg>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2zm-4 0v2a2 2 0 01-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 01-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 010 2v7a1 1 0 01-2 0V9h-1v7a1 1 0 01-2 0v-4a2.5 2.5 0 01-.2-5H15zM5 15v2H3v-2h2zm16 0v2h-2v-2h2zM5 11v2H3v-2h2zm16 0v2h-2v-2h2zM5 7v2H3V7h2zm16 0v2h-2V7h2zM5 3v2H3c0-1.1.9-2 2-2zm8 0v2h-2V3h2zm6 0a2 2 0 012 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z" fill-rule="evenodd"/></svg>',warning:'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6zM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-1-9a1 1 0 012 0v6a1 1 0 01-2 0V8zm-2 4a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-3-5a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>'}})},6890:(t,e,n)=>{n(8785)},4400:(t,e,n)=>{n(2242)},2242:()=>{!function(){"use strict";var t,e,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t,e,n){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===n?null:{"list-style-type":n})},o=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(){},a=function(t){return function(){return t}},u=function(t){return t},c=a(!1),s=a(!0),l=function(){return f},f={fold:function(t,e){return t()},isSome:c,isNone:s,getOr:e=u,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(void 0),or:e,orThunk:t,map:l,each:i,bind:l,exists:c,forall:s,filter:function(){return l()},toArray:function(){return[]},toString:a("none()")},d=function(t){var e=a(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:s,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return d(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:f},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},m=function(t){return null==t?f:d(t)},g=function(t){return t&&/^(TH|TD)$/.test(t.nodeName)},h=function(t,e){return function(n){var r=function(r){n.setActive(function(t,e,n){var r=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}(e.parents,g),i=-1!==r?e.parents.slice(0,r):e.parents,a=o.grep(i,function(t){return function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)&&function(t,e){return t.$.contains(t.getBody(),e)}(t,e)}}(t));return a.length>0&&a[0].nodeName===n}(t,r,e))};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}},p=function(t,e,n,i,a,u){t.ui.registry.addSplitButton(e,{tooltip:n,icon:"OL"===a?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(t){t(o.map(u,(function(t){return{type:"choiceitem",value:"default"===t?"":t,icon:"list-"+("OL"===a?"num":"bull")+"-"+("disc"===t||"decimal"===t?"default":t),text:function(t){return t.replace(/\-/g," ").replace(/\b\w/g,(function(t){return t.toUpperCase()}))}(t)}})))},onAction:function(){return t.execCommand(i)},onItemAction:function(e,n){r(t,a,n)},select:function(e){return function(t){var e=t.dom.getParent(t.selection.getNode(),"ol,ul"),n=t.dom.getStyle(e,"listStyleType");return m(n)}(t).map((function(t){return e===t})).getOr(!1)},onSetup:h(t,a)})},v=function(t,e,n,r,o,i){i.length>1?p(t,e,n,r,o,i):function(t,e,n,r,o,i){t.ui.registry.addToggleButton(e,{active:!1,tooltip:n,icon:"OL"===o?"ordered-list":"unordered-list",onSetup:h(t,o),onAction:function(){return t.execCommand(r)}})}(t,e,n,r,o)};n.add("advlist",(function(t){t.hasPlugin("lists")?(function(t){v(t,"numlist","Numbered list","InsertOrderedList","OL",function(t){var e=t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return e?e.split(/[ ,]/):[]}(t)),v(t,"bullist","Bullet list","InsertUnorderedList","UL",function(t){var e=t.getParam("advlist_bullet_styles","default,circle,square");return e?e.split(/[ ,]/):[]}(t))}(t),function(t){t.addCommand("ApplyUnorderedListStyle",(function(e,n){r(t,"UL",n["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",(function(e,n){r(t,"OL",n["list-style-type"])}))}(t)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))}()},6884:(t,e,n)=>{n(7652)},7652:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-+~=.,%()\/\w]*[-+~=%()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i"),r=function(t,e){if(e<0&&(e=0),3===t.nodeType){var n=t.data.length;e>n&&(e=n)}return e},o=function(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setStart(e,r(e,n)):t.setStartBefore(e)},i=function(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setEnd(e,r(e,n)):t.setEndAfter(e)},a=function(t,e,r){var a,u,c,s,l,f,d,m=function(t){return t.getParam("autolink_pattern",n)}(t),g=function(t){return t.getParam("default_link_target",!1)}(t);if("A"!==t.selection.getNode().tagName){var h=t.selection.getRng().cloneRange();if(h.startOffset<5){if(!(l=h.endContainer.previousSibling)){if(!h.endContainer.firstChild||!h.endContainer.firstChild.nextSibling)return;l=h.endContainer.firstChild.nextSibling}if(f=l.length,o(h,l,f),i(h,l,f),h.endOffset<5)return;a=h.endOffset,u=l}else{if(3!==(u=h.endContainer).nodeType&&u.firstChild){for(;3!==u.nodeType&&u.firstChild;)u=u.firstChild;3===u.nodeType&&(o(h,u,0),i(h,u,u.nodeValue.length))}a=1===h.endOffset?2:h.endOffset-1-e}var p,v=a;do{o(h,u,a>=2?a-2:0),i(h,u,a>=1?a-1:0),a-=1,d=h.toString()}while(" "!==d&&""!==d&&160!==d.charCodeAt(0)&&a-2>=0&&d!==r);!function(t,e){return t===e||" "===t||160===t.charCodeAt(0)}(h.toString(),r)?0===h.startOffset?(o(h,u,0),i(h,u,v)):(o(h,u,a),i(h,u,v)):(o(h,u,a),i(h,u,v),a+=1),s=h.toString(),p=s.charAt(s.length-1),/[?!,.;:]/.test(p)&&i(h,u,v-1);var b=(s=h.toString().trim()).match(m),y=function(t){return t.getParam("link_default_protocol","http","string")}(t);if(b){var w=b[0];(function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e})(w,"www.",0)?w=y+"://"+w:function(t,e){return-1!==t.indexOf(e)}(w,"@")&&!function(t){return/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(t)}(w)&&(w="mailto:"+w),c=t.selection.getBookmark(),t.selection.setRng(h),t.execCommand("createlink",!1,w),!1!==g&&t.dom.setAttrib(t.selection.getNode(),"target",g),t.selection.moveToBookmark(c),t.nodeChanged()}}},u=function(t){var n;t.on("keydown",(function(e){if(13===e.keyCode)return function(t){a(t,-1,"")}(t)})),e.browser.isIE()?t.on("focus",(function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}})):(t.on("keypress",(function(e){if(41===e.keyCode)return function(t){a(t,-1,"(")}(t)})),t.on("keyup",(function(e){if(32===e.keyCode)return function(t){a(t,0,"")}(t)})))};t.add("autolink",(function(t){u(t)}))}()},5209:(t,e,n)=>{n(8578)},8578:()=>{!function(){"use strict";var t=Object.hasOwnProperty,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),o=function(t){return t.getParam("min_height",t.getElement().offsetHeight,"number")},i=function(t,e,n,o,a){r.setEditorTimeout(t,(function(){c(t,e),n--?i(t,e,n,o,a):a&&a()}),o)},a=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},u=function(t,e,n,r){var o=parseInt(t.getStyle(e,n,r),10);return isNaN(o)?0:o},c=function(t,e,r){var i=t.dom,s=t.getDoc();if(s)if(function(t){return t.plugins.fullscreen&&t.plugins.fullscreen.isFullscreen()}(t))a(t,!0);else{var l=s.documentElement,f=function(t){return t.getParam("autoresize_bottom_margin",50,"number")}(t),d=o(t),m=u(i,l,"margin-top",!0),g=u(i,l,"margin-bottom",!0),h=l.offsetHeight+m+g+f;h<0&&(h=0);var p=t.getContainer().offsetHeight-t.getContentAreaContainer().offsetHeight;h+p>o(t)&&(d=h+p);var v=function(t){return t.getParam("max_height",0,"number")}(t);if(v&&d>v?(d=v,a(t,!0)):a(t,!1),d!==e.get()){var b=d-e.get();if(i.setStyle(t.getContainer(),"height",d+"px"),e.set(d),function(t){t.fire("ResizeEditor")}(t),n.browser.isSafari()&&n.mac){var y=t.getWin();y.scrollTo(y.pageXOffset,y.pageYOffset)}t.hasFocus()&&function(t){if("setcontent"===(null==t?void 0:t.type.toLowerCase())){var e=t;return!0===e.selection||!0===e.paste}return!1}(r)&&t.selection.scrollIntoView(),n.webkit&&b<0&&c(t,e,r)}}};e.add("autoresize",(function(e){var n,r,o;if(n=e.settings,r="resize",t.call(n,r)||(e.settings.resize=!1),!e.inline){var a=(o=0,{get:function(){return o},set:function(t){o=t}});!function(t,e){t.addCommand("mceAutoResize",(function(){c(t,e)}))}(e,a),function(t,e){t.on("init",(function(){var e=function(t){return t.getParam("autoresize_overflow_padding",1,"number")}(t),n=t.dom;n.setStyles(t.getDoc().documentElement,{height:"auto"}),n.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})})),t.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(function(n){c(t,e,n)})),function(t){return t.getParam("autoresize_on_init",!0,"boolean")}(t)&&t.on("init",(function(){i(t,e,20,100,(function(){i(t,e,5,1e3)}))}))}(e,a)}}))}()},7259:(t,e,n)=>{n(8492)},8492:()=>{!function(){"use strict";var t,e,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return function(e){return typeof e===t}},o=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}}("string"),i=r("boolean"),a=r("function"),u=r("number"),c=function(){},s=function(t){return function(){return t}},l=function(t){return t},f=s(!1),d=s(!0),m=function(){return g},g={fold:function(t,e){return t()},isSome:f,isNone:d,getOr:e=l,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:s(null),getOrUndefined:s(void 0),or:e,orThunk:t,map:m,each:c,bind:m,exists:f,forall:d,filter:function(){return m()},toArray:function(){return[]},toString:s("none()")},h=function(t){var e=s(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:d,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return h(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:g},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},p={some:h,none:m,from:function(t){return null==t?g:h(t)}},v=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},b=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},y={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return b(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return b(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return b(n)},fromDom:b,fromPoint:function(t,e,n){return p.from(t.dom.elementFromPoint(e,n)).map(b)}},w=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")};"undefined"!=typeof window?window:Function("return this;")();var x,C=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},S=C(1),k=C(3),T=C(9),O=C(11),E=function(t){return function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t.dom.childNodes,y.fromDom)},_=function(t,e,n){!function(t,e,n){if(!(o(n)||i(n)||u(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},R=function(t,e){t.dom.removeAttribute(e)},N=a(Element.prototype.attachShadow)&&a(Node.prototype.getRootNode)?function(t){return y.fromDom(t.dom.getRootNode())}:function(t){return T(t)?t:(e=t,y.fromDom(e.dom.ownerDocument));var e},A=function(t){var e,n=N(t);return O(e=n)&&null!=e.dom.host?p.some(n):p.none()},D=function(t){return y.fromDom(t.dom.host)},M=function(t){var e=k(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return A(y.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=M,r=D,function(t){return n(r(t))}))},B=function(t,e,n){return function(t,e,n){for(var r=t.dom,o=a(n)?n:f;r.parentNode;){r=r.parentNode;var i=y.fromDom(r);if(e(i))return p.some(i);if(o(i))break}return p.none()}(t,(function(t){return w(t,e)}),n)},z=function(t,e){return function(t){return void 0!==t.style&&a(t.style.getPropertyValue)}(t)?t.style.getPropertyValue(e):""},P=function(t){return"rtl"===function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||M(t)?r:z(n,e)}(t,"direction")?"rtl":"ltr"},L=function(t,e){return function(t,e){return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(E(t),e)}(t,(function(t){return w(t,e)}))},I=function(t){return function(t){return p.from(t.dom.parentNode).map(y.fromDom)}(t).filter(S)},H=(x="li",function(t){return S(t)&&t.dom.nodeName.toLowerCase()===x}),F=function(t,e){var n=t.selection.getSelectedBlocks();n.length>0&&(v(n,(function(t){var n=y.fromDom(t),r=H(n),o=function(t,e){return(e?B(t,"ol,ul"):p.some(t)).getOr(t)}(n,r);I(o).each((function(t){if(P(t)!==e?_(o,"dir",e):P(o)!==e&&R(o,"dir"),r){var n=L(o,"li[dir]");v(n,(function(t){return R(t,"dir")}))}}))})),t.nodeChanged())},V=function(t,e){return function(n){var r=function(t){var r=y.fromDom(t.element);n.setActive(P(r)===e)};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}};n.add("directionality",(function(t){!function(t){t.addCommand("mceDirectionLTR",(function(){F(t,"ltr")})),t.addCommand("mceDirectionRTL",(function(){F(t,"rtl")}))}(t),function(t){t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return t.execCommand("mceDirectionLTR")},onSetup:V(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return t.execCommand("mceDirectionRTL")},onSetup:V(t,"rtl")})}(t)}))}()},4926:(t,e,n)=>{n(755)},755:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");t.add("hr",(function(t){!function(t){t.addCommand("InsertHorizontalRule",(function(){t.execCommand("mceInsertContent",!1,"<hr />")}))}(t),function(t){var e=function(){return t.execCommand("InsertHorizontalRule")};t.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:e}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:e})}(t)}))}()},2170:(t,e,n)=>{n(3302)},3302:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},a=function(t){return function(e){return typeof e===t}},u=i("string"),c=i("object"),s=i("array"),l=(t=null,function(e){return t===e}),f=a("boolean"),d=function(t){return!function(t){return null==t}(t)},m=a("function"),g=a("number"),h=function(){},p=function(t){return function(){return t}},v=function(t){return t},b=p(!1),y=p(!0),w=function(){return x},x={fold:function(t,e){return t()},isSome:b,isNone:y,getOr:n=v,getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:p(null),getOrUndefined:p(void 0),or:n,orThunk:e,map:w,each:h,bind:w,exists:b,forall:y,filter:function(){return w()},toArray:function(){return[]},toString:p("none()")},C=function(t){var e=p(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:y,isNone:b,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return C(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:x},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},S={some:C,none:w,from:function(t){return null==t?x:C(t)}},k=Object.keys,T=Object.hasOwnProperty,O=function(t,e,n,r){return function(t,e){for(var n=k(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},E=function(t,e){return T.call(t,e)},_=Array.prototype.push,R=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!s(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);_.apply(e,t[n])}return e},N=function(t){return function(t,e){return e>=0&&e<t.length?S.some(t[e]):S.none()}(t,0)};"undefined"!=typeof window?window:Function("return this;")();var A,D=function(t,e,n){!function(t,e,n){if(!(u(n)||f(n)||g(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},M=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},B={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return M(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return M(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return M(n)},fromDom:M,fromPoint:function(t,e,n){return S.from(t.dom.elementFromPoint(e,n)).map(M)}},z=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),P=tinymce.util.Tools.resolve("tinymce.util.Promise"),L=tinymce.util.Tools.resolve("tinymce.util.URI"),I=tinymce.util.Tools.resolve("tinymce.util.XHR"),H=function(t){return t.getParam("image_dimensions",!0,"boolean")},F=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},V=function(t){return t&&(t=t.replace(/px$/,"")),t},j=function(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t},U=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},W=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},q=function(t,e){return L.isDomSafe(e,"img",t.settings)},$=z.DOM,G=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?V(t.style.marginLeft):""},K=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?V(t.style.marginTop):""},X=function(t){return t.style.borderWidth?V(t.style.borderWidth):""},Y=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},J=function(t,e){return t.style[e]?t.style[e]:""},Q=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},Z=function(t,e,n){""===n?t.removeAttribute(e):t.setAttribute(e,n)},tt=function(t){Q(t)?function(t){var e=t.parentNode;$.insertAfter(t,e),$.remove(e)}(t):function(t){var e=$.create("figure",{class:"image"});$.insertAfter(e,t),e.appendChild(t),e.appendChild($.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"}(t)},et=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");r.length>0?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},nt=function(t,e){return function(t,n,r){t.style[n]?(t.style[n]=j(r),et(t,e)):Z(t,n,r)}},rt=function(t,e){return t.style[e]?V(t.style[e]):Y(t,e)},ot=function(t,e){var n=j(e);t.style.marginLeft=n,t.style.marginRight=n},it=function(t,e){var n=j(e);t.style.marginTop=n,t.style.marginBottom=n},at=function(t,e){var n=j(e);t.style.borderWidth=n},ut=function(t,e){t.style.borderStyle=e},ct=function(t){return"FIGURE"===t.nodeName},st=function(t){return 0===$.getAttrib(t,"alt").length&&"presentation"===$.getAttrib(t,"role")},lt=function(t){return st(t)?"":Y(t,"alt")},ft=function(t,e){var n=document.createElement("img");return Z(n,"style",e.style),(G(n)||""!==e.hspace)&&ot(n,e.hspace),(K(n)||""!==e.vspace)&&it(n,e.vspace),(X(n)||""!==e.border)&&at(n,e.border),(function(t){return J(t,"borderStyle")}(n)||""!==e.borderStyle)&&ut(n,e.borderStyle),t(n.getAttribute("style"))},dt=function(t,e){return{src:Y(e,"src"),alt:lt(e),title:Y(e,"title"),width:rt(e,"width"),height:rt(e,"height"),class:Y(e,"class"),style:t(Y(e,"style")),caption:Q(e),hspace:G(e),vspace:K(e),border:X(e),borderStyle:J(e,"borderStyle"),isDecorative:st(e)}},mt=function(t,e,n,r,o){n[r]!==e[r]&&o(t,r,n[r])},gt=function(t,e,n){if(n){$.setAttrib(t,"role","presentation");var r=B.fromDom(t);D(r,"alt","")}else{if(l(e)){r=B.fromDom(t);o="alt",r.dom.removeAttribute(o)}else{r=B.fromDom(t);D(r,"alt",e)}"presentation"===$.getAttrib(t,"role")&&$.setAttrib(t,"role","")}var o},ht=function(t,e){return function(n,r,o){t(n,o),et(n,e)}},pt=function(t,e,n){var r=dt(t,n);mt(n,r,e,"caption",(function(t,e,n){return tt(t)})),mt(n,r,e,"src",Z),mt(n,r,e,"title",Z),mt(n,r,e,"width",nt(0,t)),mt(n,r,e,"height",nt(0,t)),mt(n,r,e,"class",Z),mt(n,r,e,"style",ht((function(t,e){return Z(t,"style",e)}),t)),mt(n,r,e,"hspace",ht(ot,t)),mt(n,r,e,"vspace",ht(it,t)),mt(n,r,e,"border",ht(at,t)),mt(n,r,e,"borderStyle",ht(ut,t)),function(t,e,n){n.alt===e.alt&&n.isDecorative===e.isDecorative||gt(t,n.alt,n.isDecorative)}(n,r,e)},vt=function(t,e){var n=t.dom.styles.parse(e),r=U(n),o=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(o)},bt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||W(e))?null:e},yt=function(t,e){var n=t.dom,r=function(t,e){var n,r={};return O(t,e,(n=r,function(t,e){n[e]=t}),h),r}(t.schema.getTextBlockElements(),(function(e,n){return!t.schema.isValidChild(n,"figure")})),o=n.getParent(e.parentNode,(function(t){return e=r,n=t.nodeName,E(e,n)&&void 0!==e[n]&&null!==e[n];var e,n}),t.getBody());return o?n.split(o,e):e},wt=function(t,e){var n=function(t,e){var n=document.createElement("img");if(pt(t,o(o({},e),{caption:!1}),n),gt(n,e.alt,e.isDecorative),e.caption){var r=$.create("figure",{class:"image"});return r.appendChild(n),r.appendChild($.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}((function(e){return vt(t,e)}),e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),ct(r)){var i=yt(t,r);t.selection.select(i)}else t.selection.select(r)},xt=function(t,e){var n=bt(t);if(pt((function(e){return vt(t,e)}),e,n),function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))}(t,n),ct(n.parentNode)){var r=n.parentNode;yt(t,r),t.selection.select(n.parentNode)}else t.selection.select(n),function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!H(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r}(t,e,n)},Ct=function(t,e){var n=bt(t);if(n){var r=dt((function(e){return vt(t,e)}),n),i=o(o({},r),e),a=function(t,e){var n=e.src;return o(o({},e),{src:q(t,n)?n:""})}(t,i);i.src?xt(t,a):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,n)}else e.src&&wt(t,o(o({},{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),e))},St=(A=function(t,e){return c(t)&&c(e)?St(t,e):e},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)E(o,i)&&(n[i]=A(n[i],o[i]))}return n}),kt=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),Tt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ot=function(t){return u(t.value)?t.value:""},Et=function(t,e){var n=[];return Tt.each(t,(function(t){var r=function(t){return u(t.text)?t.text:u(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=Et(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},_t=function(t){return void 0===t&&(t=Ot),function(e){return e?S.from(e).map((function(e){return Et(e,t)})):S.none()}},Rt=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return S.none()}(t,(function(t){return function(t){return E(t,"items")}(t)?Rt(t.items,e):t.value===e?S.some(t):S.none()}))},Nt=_t,At=function(t){return _t(Ot)(t)},Dt=function(t,e){return t.bind((function(t){return Rt(t,e)}))},Mt=function(t){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},Bt=function(t){var e=Nt((function(e){return t.convertURL(e.value||e.url,"src")})),n=new P((function(n){!function(t,e){var n=function(t){return t.getParam("image_list",!1)}(t);u(n)?I.send({url:n,success:function(t){e(JSON.parse(t))}}):m(n)?n(e):e(n)}(t,(function(t){n(e(t).map((function(t){return R([[{text:"None",value:""}],t])})))}))})),r=At(function(t){return t.getParam("image_class_list")}(t)),o=function(t){return t.getParam("image_advtab",!1,"boolean")}(t),i=function(t){return t.getParam("image_uploadtab",!0,"boolean")}(t),a=function(t){return d(t.getParam("images_upload_url"))}(t),c=function(t){return d(t.getParam("images_upload_handler"))}(t),s=function(t){var e=bt(t);return e?dt((function(e){return vt(t,e)}),e):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}(t),l=function(t){return t.getParam("image_description",!0,"boolean")}(t),f=function(t){return t.getParam("image_title",!1,"boolean")}(t),g=H(t),h=function(t){return t.getParam("image_caption",!1,"boolean")}(t),p=function(t){return t.getParam("a11y_advanced_options",!1,"boolean")}(t),v=function(t){return t.getParam("automatic_uploads",!0,"boolean")}(t),b=S.some(function(t){return t.getParam("image_prepend_url","","string")}(t)).filter((function(t){return u(t)&&t.length>0}));return n.then((function(t){return{image:s,imageList:t,classList:r,hasAdvTab:o,hasUploadTab:i,hasUploadUrl:a,hasUploadHandler:c,hasDescription:l,hasImageTitle:f,hasDimensions:g,hasImageCaption:h,prependURL:b,hasAccessibilityOptions:p,automaticUploads:v}}))},zt=function(t){var e,n=t.imageList.map((function(t){return{name:"images",type:"listbox",label:"Image list",items:t}})),r={name:"alt",type:"input",label:"Alternative description",disabled:t.hasAccessibilityOptions&&t.image.isDecorative},i=t.classList.map((function(t){return{name:"classes",type:"listbox",label:"Class",items:t}}));return R([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],n.toArray(),t.hasAccessibilityOptions&&t.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],t.hasDescription?[r]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[o(o({},(e=t.classList.isSome()&&t.hasImageCaption,e?{type:"grid",columns:2}:{type:"panel"})),{items:R([i.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])})]])},Pt=function(t){return{title:"General",name:"general",items:zt(t)}},Lt=zt,It=function(t){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}},Ht=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t.class,caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[],isDecorative:t.isDecorative}},Ft=function(t,e){return{src:t.src.value,alt:0===t.alt.length&&e?null:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,class:t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle,isDecorative:t.isDecorative}},Vt=function(t,e){var n=e.getData();(function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?S.none():t.prependURL.bind((function(t){return e.substring(0,t.length)!==t?S.some(t+e):S.none()}))})(t,n.src.value).each((function(t){e.setData({src:{value:t,meta:n.src.meta}})}))},jt=function(t,e){var n=e.getData(),r=n.src.meta;if(void 0!==r){var o=St({},n);!function(t,e,n){t.hasDescription&&u(n.alt)&&(e.alt=n.alt),t.hasAccessibilityOptions&&(e.isDecorative=n.isDecorative||e.isDecorative||!1),t.hasImageTitle&&u(n.title)&&(e.title=n.title),t.hasDimensions&&(u(n.width)&&(e.dimensions.width=n.width),u(n.height)&&(e.dimensions.height=n.height)),u(n.class)&&Dt(t.classList,n.class).each((function(t){e.classes=t.value})),t.hasImageCaption&&f(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(u(n.style)&&(e.style=n.style),u(n.vspace)&&(e.vspace=n.vspace),u(n.border)&&(e.border=n.border),u(n.hspace)&&(e.hspace=n.hspace),u(n.borderstyle)&&(e.borderstyle=n.borderstyle))}(t,o,r),e.setData(o)}},Ut=function(t,e,n,r){Vt(e,r),jt(e,r),function(t,e,n,r){var o=r.getData(),i=o.src.value,a=o.src.meta||{};a.width||a.height||!e.hasDimensions||(i.length>0?t.imageSize(i).then((function(t){n.open&&r.setData({dimensions:t})})).catch((function(t){return console.error(t)})):r.setData({dimensions:{width:"",height:""}}))}(t,e,n,r),function(t,e,n){var r=n.getData(),o=Dt(t.imageList,r.src.value);e.prevImage=o,n.setData({images:o.map((function(t){return t.value})).getOr("")})}(e,n,r)},Wt=function(t,e,n){var r=U(t(n.style)),o=St({},n);return o.vspace=function(t){return t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"]?V(String(t["margin-top"])):""}(r),o.hspace=function(t){return t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"]?V(String(t["margin-right"])):""}(r),o.border=function(t){return t["border-width"]?V(String(t["border-width"])):""}(r),o.borderstyle=function(t){return t["border-style"]?String(t["border-style"]):""}(r),o.style=function(t,e,n){return e(t(e(n)))}(t,e,r),o},qt=function(t,e,n,r){var o=r.getData();r.block("Uploading image"),N(o.fileinput).fold((function(){r.unblock()}),(function(o){var i,a=URL.createObjectURL(o),u=function(){r.unblock(),URL.revokeObjectURL(a)},c=function(o){r.setData({src:{value:o,meta:{}}}),r.showTab("general"),Ut(t,e,n,r)};(i=o,new P((function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(i)}))).then((function(n){var i=t.createBlobCache(o,a,n);e.automaticUploads?t.uploadImage(i).then((function(t){c(t.url),u()})).catch((function(e){u(),t.alertErr(e)})):(t.addToBlobCache(i),c(i.blobUri()),r.unblock())}))}))},$t=function(t,e,n){return function(r,o){"src"===o.name?Ut(t,e,n,r):"images"===o.name?function(t,e,n,r){var o=r.getData(),i=Dt(e.imageList,o.images);i.each((function(t){""===o.alt||n.prevImage.map((function(t){return t.text===o.alt})).getOr(!1)?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})})),n.prevImage=i,Ut(t,e,n,r)}(t,e,n,r):"alt"===o.name?n.prevAlt=r.getData().alt:"style"===o.name?function(t,e){var n=e.getData(),r=Wt(t.parseStyle,t.serializeStyle,n);e.setData(r)}(t,r):"vspace"===o.name||"hspace"===o.name||"border"===o.name||"borderstyle"===o.name?function(t,e,n){var r=St(Ht(e.image),n.getData()),o=ft(t.normalizeCss,Ft(r,!1));n.setData({style:o})}(t,e,r):"fileinput"===o.name?qt(t,e,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},Gt=function(t){return function(){t.open=!1}},Kt=function(t){return t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler?{type:"tabpanel",tabs:R([[Pt(t)],t.hasAdvTab?[Mt(t)]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[It(t)]:[]])}:{type:"panel",items:Lt(t)}},Xt=function(t){return function(e){var n=function(t){return{prevImage:Dt(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}}(e);return{title:"Insert/Edit Image",size:"normal",body:Kt(e),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Ht(e.image),onSubmit:t.onSubmit(e),onChange:$t(t,e,n),onClose:Gt(n)}}},Yt=function(t){return function(e){return function(n){var r=St(Ht(e.image),n.getData());t.execCommand("mceUpdateImage",!1,Ft(r,e.hasAccessibilityOptions)),t.editorUpload.uploadImagesAuto(),n.close()}}},Jt=function(t){return function(e){return q(t,e)?function(t){return new P((function(e){var n=document.createElement("img"),r=function(t){n.onload=n.onerror=null,n.parentNode&&n.parentNode.removeChild(n),e(t)};n.onload=function(){var t={width:F(n.width,n.clientWidth),height:F(n.height,n.clientHeight)};r(P.resolve(t))},n.onerror=function(){r(P.reject("Failed to get image dimensions for: "+t))};var o=n.style;o.visibility="hidden",o.position="fixed",o.bottom=o.left="0px",o.width=o.height="auto",document.body.appendChild(n),n.src=t}))}(t.documentBaseURI.toAbsolute(e)).then((function(t){return{width:String(t.width),height:String(t.height)}})):P.resolve({width:"",height:""})}},Qt=function(t){return function(e,n,r){return t.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:r.split(",")[1]})}},Zt=function(t){return function(e){t.editorUpload.blobCache.add(e)}},te=function(t){return function(e){t.windowManager.alert(e)}},ee=function(t){return function(e){return vt(t,e)}},ne=function(t){return function(e){return t.dom.parseStyle(e)}},re=function(t){return function(e,n){return t.dom.serializeStyle(e,n)}},oe=function(t){return function(e){return kt(t).upload([e],!1).then((function(t){return 0===t.length?P.reject("Failed to upload image"):!1===t[0].status?P.reject(t[0].error.message):t[0]}))}},ie=function(t){var e={onSubmit:Yt(t),imageSize:Jt(t),addToBlobCache:Zt(t),createBlobCache:Qt(t),alertErr:te(t),normalizeCss:ee(t),parseStyle:ne(t),serializeStyle:re(t),uploadImage:oe(t)};return{open:function(){Bt(t).then(Xt(e)).then(t.windowManager.open)}}},ae=function(t){var e=t.attr("class");return e&&/\bimage\b/.test(e)},ue=function(t){return function(e){for(var n=e.length,r=function(e){e.attr("contenteditable",t?"true":null)};n--;){var o=e[n];ae(o)&&(o.attr("contenteditable",t?"false":null),Tt.each(o.getAll("figcaption"),r))}}};r.add("image",(function(t){!function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("figure",ue(!0)),t.serializer.addNodeFilter("figure",ue(!1))}))}(t),function(t){t.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ie(t).open,onSetup:function(e){return e.setActive(d(bt(t))),t.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),t.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:ie(t).open}),t.ui.registry.addContextMenu("image",{update:function(t){return ct(t)||"IMG"===t.nodeName&&!W(t)?["image"]:[]}})}(t),function(t){t.addCommand("mceImage",ie(t).open),t.addCommand("mceUpdateImage",(function(e,n){t.undoManager.transact((function(){return Ct(t,n)}))}))}(t)}))}()},5053:(t,e,n)=>{n(3253)},3253:(t,e,n)=>{!function(){"use strict";var t,e,r,o=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=(t="array",function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}),c=function(t){return!function(t){return null==t}(t)},s=function(t){return function(e){return typeof e===t}}("function"),l=function(){},f=function(t){return function(){return t}},d=function(t){return t},m=f(!1),g=f(!0),h=function(){return p},p={fold:function(t,e){return t()},isSome:m,isNone:g,getOr:r=d,getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:f(null),getOrUndefined:f(void 0),or:r,orThunk:e,map:h,each:l,bind:h,exists:m,forall:g,filter:function(){return h()},toArray:function(){return[]},toString:f("none()")},v=function(t){var e=f(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:g,isNone:m,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return v(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:p},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},b={some:v,none:h,from:function(t){return null==t?p:v(t)}},y={},w={exports:y};!function(t,e,r,o){var i,a;i=this,a=function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},e={exports:{}};!function(e){!function(t){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void u(e.promise,t)}a(e.promise,r)}else(1===t._state?a:u)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){u(t,e)}var r,i}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(t){o(i,t)}),n)}e[i]=a,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(t)}(e);var r=e.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||r}},"object"==typeof e&&void 0!==r?r.exports=a():"function"==typeof t&&t.amd?t(a):(i="undefined"!=typeof globalThis?globalThis:i||self).EphoxContactWrapper=a()}(void 0,y,w);var x=w.exports.boltExport,C=function(t,e){return T(document.createElement("canvas"),t,e)},S=function(t){var e=C(t.width,t.height);return k(e).drawImage(t,0,0),e},k=function(t){return t.getContext("2d")},T=function(t,e,n){return t.width=e,t.height=n,t},O=function(t){return new x((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",a),o.removeEventListener("error",u)},a=function(){i(),e(o)},u=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",a),o.addEventListener("error",u),o.src=r,o.complete&&setTimeout(a,0)}))},E=function(t){return new x((function(e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="blob",r.onload=function(){200===this.status&&e(this.response)},r.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},r.send()}))},_=function(t){return new x((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return b.none();for(var r=n[1],o=e[1],i=1024,a=atob(o),u=a.length,c=Math.ceil(u/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,d=Math.min(f+i,u),m=new Array(d-f),g=f,h=0;g<d;++h,++g)m[h]=a[g].charCodeAt(0);s[l]=new Uint8Array(m)}return b.some(new Blob(s,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))},R=function(t,e,n){return e=e||"image/png",s(HTMLCanvasElement.prototype.toBlob)?new x((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):_(t.toDataURL(e,n))},N=function(t){URL.revokeObjectURL(t.src)},A=function(t){return function(t){var e=t.src;return 0===e.indexOf("data:")?_(e):E(e)}(t)},D=Array.prototype.indexOf,M=function(t,e){return n=t,r=e,D.call(n,r)>-1;var n,r},B=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},z=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return b.some(i);if(n(i,r))break}return b.none()}(t,e,m)},P=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},L=Object.keys;(function(t){if(!u(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};B(t,(function(r,o){var i=L(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!u(c))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+i);var u=function(t){var r=L(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!P(e,(function(t){return M(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:u,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}}))})([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var I=function(t,e,n){var r=e.type,o=f(r),i=f(n),a=function(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))};return{getType:o,toBlob:function(){return x.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return R(t,e,n)}))},toAdjustedDataURL:a,toAdjustedBase64:function(t,e){return a(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(S)}}},H=function(t){return function(t){return new x((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return I(function(t){return O(t).then((function(t){N(t);var e=C(function(t){return t.naturalWidth||t.width}(t),function(t){return t.naturalHeight||t.height}(t));return k(e).drawImage(t,0,0),e}))}(t),t,e)}))},F=function(t,e){return R(t,e).then((function(e){return I(x.resolve(t),e,t.toDataURL())}))},V=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},j=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,a=Math.sin(r),u=Math.cos(r),c=V(Math.abs(o*u)+Math.abs(i*a)),s=V(Math.abs(o*a)+Math.abs(i*u)),l=C(c,s),f=k(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),F(l,e)},U=function(t,e,n){var r=C(t.width,t.height),o=k(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),F(r,e)},W=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return U(n,t.getType(),e)}))}(t,e)},q=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return j(n,t.getType(),e)}))}(t,e)},$=function(t,e,n){return void 0===n&&(n=!1),new x((function(r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&r({status:o.status,blob:o.response})},o.open("GET",t,!0),o.withCredentials=n,function(t,e){for(var n=L(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(e,(function(t,e){o.setRequestHeader(e,t)})),o.responseType="blob",o.send()}))},G=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],K=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],X=function(t,e){var n,r,o=(n=function(t,e){return c(t)?t[e]:void 0},r=t,B(e,(function(t,e){r=n(r,t,e)})),r);return b.from(o)},Y=function(t){var e=function(t){return"ImageProxy HTTP error: "+z(G,(function(e){return t===e.code})).fold(f("Unknown ImageProxy error"),(function(t){return t.message}))}(t);return x.reject(e)},J=function(t){return z(K,(function(e){return e.type===t})).fold(f("Unknown service error"),(function(t){return t.message}))},Q=function(t){return"ImageProxy Service error: "+function(t){try{return b.some(JSON.parse(t))}catch(t){return b.none()}}(t).bind((function(t){return X(t,["error","type"]).map(J)})).getOr("Invalid JSON in service error message")},Z=function(t){return function(t){return new x((function(e,n){var r=new FileReader;r.onload=function(){e(r.result)},r.onerror=function(t){n(t)},r.readAsText(t)}))}(t).then((function(t){var e=Q(t);return x.reject(e)}))},tt=function(t){return t<200||t>=300},et=function(t,e){var n={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return $(function(t,e){var n=-1===t.indexOf("?")?"?":"&";return/[?&]apiKey=/.test(t)?t:t+n+"apiKey="+encodeURIComponent(e)}(t,e),n).then((function(t){return tt(t.status)?(e=t.status,n=t.blob,function(t,e){return"application/json"===(null==e?void 0:e.type)&&(400===t||403===t||404===t||500===t)}(e,n)?Z(n):Y(e)):x.resolve(t.blob);var e,n}))},nt=function(t,e,n){return void 0===n&&(n=!1),e?et(t,e):function(t,e){return $(t,{},e).then((function(t){return tt(t.status)?Y(t.status):x.resolve(t.blob)}))}(t,n)},rt=function(t){return H(t)},ot=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},it={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return ot(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return ot(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return ot(n)},fromDom:ot,fromPoint:function(t,e,n){return b.from(t.dom.elementFromPoint(e,n)).map(ot)}};"undefined"!=typeof window?window:Function("return this;")();var at=function(t,e){return function(t,e){return z(t.dom.childNodes,(function(t){return e(it.fromDom(t))})).map(it.fromDom)}(t,(function(t){return function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(t,e)}))},ut=tinymce.util.Tools.resolve("tinymce.util.Delay"),ct=tinymce.util.Tools.resolve("tinymce.util.Promise"),st=tinymce.util.Tools.resolve("tinymce.util.URI"),lt=function(t){return t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")},ft=function(t){return t.getParam("imagetools_proxy")},dt=function(t){var e,n,r=function(t){return/^[0-9\.]+px$/.test(t)};return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)},mt=function(t){return{w:t.naturalWidth,h:t.naturalHeight}},gt=0,ht=function(t){return at(it.fromDom(t),"img")},pt=function(t,e){return t.dom.is(e,"figure")},vt=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")},bt=function(t,e){var n=function(e){return vt(t,e)&&(Ct(t,e)||St(t,e)||c(ft(t)))};return pt(t,e)?ht(e).bind((function(t){return n(t.dom)?b.some(t.dom):b.none()})):n(e)?b.some(e):b.none()},yt=function(t,e){t.notificationManager.open({text:e,type:"error"})},wt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&&pt(t,n)?ht(n):vt(t,e)?b.some(it.fromDom(e)):b.none()},xt=function(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return c(r)?t.dom.encode(r[n]):null},Ct=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new st(n).host===t.documentBaseURI.host},St=function(t,e){return-1!==a.inArray(function(t){return t.getParam("imagetools_cors_hosts",[],"string[]")}(t),new st(e.src).host)},kt=function(t,e){if(St(t,e))return nt(e.src,null,function(t,e){return-1!==a.inArray(function(t){return t.getParam("imagetools_credentials_hosts",[],"string[]")}(t),new st(e.src).host)}(t,e));if(!Ct(t,e)){var n=ft(t),r=n+(-1===n.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),o=function(t){return t.getParam("api_key",t.getParam("imagetools_api_key","","string"),"string")}(t);return nt(r,o,!1)}return A(e)},Tt=function(t,e){return function(t){return b.from(t.getParam("imagetools_fetch_image",null,"function"))}(t).fold((function(){return kt(t,e)}),(function(t){return t(e)}))},Ot=function(t,e){var n=t.editorUpload.blobCache.getByUri(e.src);return n?ct.resolve(n.blob()):Tt(t,e)},Et=function(t){ut.clearTimeout(t.get())},_t=function(t,e,n,r,o,i,a){return n.toBlob().then((function(u){var s,l,f,d,m=t.editorUpload.blobCache;s=i.src;var g=e.type===u.type;return function(t){return t.getParam("images_reuse_filename",!1,"boolean")}(t)&&(d=m.getByUri(s),c(d)?(s=d.uri(),l=d.name(),f=d.filename()):(l=xt(t,s,2),f=xt(t,s,1))),d=m.create({id:"imagetools"+gt++,blob:u,base64:n.toBase64(),uri:s,name:l,filename:g?f:void 0}),m.add(d),t.undoManager.transact((function(){var e=function(){t.$(i).off("load",e),t.nodeChanged(),r?t.editorUpload.uploadImagesAuto():(Et(o),function(t,e){var n=ut.setEditorTimeout(t,(function(){t.editorUpload.uploadImagesAuto()}),function(t){return t.getParam("images_upload_timeout",3e4,"number")}(t));e.set(n)}(t,o))};t.$(i).on("load",e),a&&t.$(i).attr({width:a.w,height:a.h}),t.$(i).attr({src:d.blobUri()}).removeAttr("data-mce-src")})),d}))},Rt=function(t,e,n,r){return function(){return wt(t).fold((function(){yt(t,"Could not find selected image")}),(function(o){return t._scanForImages().then((function(){return Ot(t,o.dom)})).then((function(i){return rt(i).then(n).then((function(n){return _t(t,i,n,!1,e,o.dom,r)}))})).catch((function(e){yt(t,e)}))}))}},Nt=function(t,e,n){return function(){var r=wt(t).map((function(t){var e=dt(t.dom);return e?{w:e.h,h:e.w}:null})).getOrNull();return Rt(t,e,(function(t){return q(t,n)}),r)()}},At=function(t,e,n){return function(){return Rt(t,e,(function(t){return W(t,n)}))()}},Dt=function(t,e,n,r,o){return function(t){return O(t)}(o).then((function(t){var e=mt(t);return r.w===e.w&&r.h===e.h||dt(n)&&function(t,e){var n,r;e&&(n=t.style.width,r=t.style.height,(n||r)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,r=t.height,(n||r)&&(t.setAttribute("width",String(e.w)),t.setAttribute("height",String(e.h))))}(n,e),URL.revokeObjectURL(t.src),o})).then(rt).then((function(r){return _t(t,o,r,!0,e,n)}))},Mt=function(t,e){return function(){var n=wt(t),r=n.map((function(t){return mt(t.dom)}));n.each((function(o){bt(t,o.dom).each((function(i){Ot(t,o.dom).then((function(o){var i=function(t){return{blob:t,url:URL.createObjectURL(t)}}(o);t.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:i}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(o){var i=o.getData().imagetools.blob;n.each((function(n){r.each((function(r){Dt(t,e,n.dom,r,i)}))})),o.close()},onCancel:l,onAction:function(t,e){switch(e.name){case"save-state":e.value?t.enable("save"):t.disable("save");break;case"disable":t.disable("save"),t.disable("cancel");break;case"enable":t.enable("cancel")}}})}))}))}))}};i.add("imagetools",(function(t){var e=o(0),n=o(null);!function(t,e){a.each({mceImageRotateLeft:Nt(t,e,-90),mceImageRotateRight:Nt(t,e,90),mceImageFlipVertical:At(t,e,"v"),mceImageFlipHorizontal:At(t,e,"h"),mceEditImage:Mt(t,e)},(function(e,n){t.addCommand(n,e)}))}(t,e),function(t){var e=[],n=function(e){return function(){return t.execCommand(e)}},r=function(){return wt(t).exists((function(e){return bt(t,e.dom).isSome()}))},o=function(t){var n=function(e){return t.setDisabled(!e)};return n(r()),e=e.concat([n]),function(){e=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(e,(function(t){return t!==n}))}};t.on("NodeChange",(function(){var t=r();B(e,(function(e){return e(t)}))})),t.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft"),onSetup:o}),t.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight"),onSetup:o}),t.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical"),onSetup:o}),t.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal"),onSetup:o}),t.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:o}),t.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:n("mceImage")}),t.ui.registry.addContextMenu("imagetools",{update:function(e){return bt(t,e).map((function(t){return{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}})).toArray()}})}(t),function(t){t.ui.registry.addContextToolbar("imagetools",{items:lt(t),predicate:function(e){return bt(t,e).isSome()},position:"node",scope:"node"})}(t),function(t,e,n){t.on("NodeChange",(function(r){var o=n.get(),i=bt(t,r.element);o&&!i.exists((function(t){return o.src===t.src}))&&(Et(e),t.editorUpload.uploadImagesAuto(),n.set(null)),i.each(n.set)}))}(t,e,n)}))}()},2682:(t,e,n)=>{n(7384)},7384:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},a=function(t){return function(e){return typeof e===t}},u=i("string"),c=i("array"),s=(t=null,function(e){return t===e}),l=a("boolean"),f=a("function"),d=function(){},m=function(t){return function(){return t}},g=function(t){return t},h=function(t,e){return t===e},p=m(!1),v=m(!0),b=function(){return y},y={fold:function(t,e){return t()},isSome:p,isNone:v,getOr:n=g,getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(void 0),or:n,orThunk:e,map:b,each:d,bind:b,exists:p,forall:v,filter:function(){return b()},toArray:function(){return[]},toString:m("none()")},w=function(t){var e=m(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=Array.prototype.indexOf,S=Array.prototype.push,k=function(t,e){return function(t,e){return C.call(t,e)}(t,e)>-1},T=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e},O=function(t,e){return T(function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t,e))},E=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()},_=function(t,e,n){return void 0===n&&(n=h),t.exists((function(t){return n(t,e)}))},R=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},N=function(t,e){return t?x.some(e):x.none()},A=function(t){var e=t.getParam("link_assume_external_targets",!1);return l(e)&&e?1:!u(e)||"http"!==e&&"https"!==e?0:e},D=function(t){return t.getParam("default_link_target")},M=function(t){return t.getParam("target_list",!0)},B=function(t){return t.getParam("rel_list",[],"array")},z=function(t){return t.getParam("link_title",!0,"boolean")},P=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},L=function(t){return t.getParam("link_default_protocol","http","string")},I=tinymce.util.Tools.resolve("tinymce.util.Tools"),H=function(t){return u(t.value)?t.value:""},F=function(t,e){var n=[];return I.each(t,(function(t){var r=function(t){return u(t.text)?t.text:u(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=F(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},V=function(t){return void 0===t&&(t=H),function(e){return x.from(e).map((function(e){return F(e,t)}))}},j={sanitize:function(t){return V(H)(t)},sanitizeWith:V,createUi:function(t,e){return function(n){return{name:t,type:"listbox",label:e,items:n}}},getValue:H},U=function(){return(U=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},W=Object.keys,q=Object.hasOwnProperty,$=function(t,e,n,r){return function(t,e){for(var n=W(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},G=function(t,e){return q.call(t,e)},K=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),X=tinymce.util.Tools.resolve("tinymce.util.URI"),Y=function(t){return t&&"a"===t.nodeName.toLowerCase()},J=function(t){return Y(t)&&!!tt(t)},Q=function(t,e){if(t.collapsed)return[];var n=t.cloneContents(),r=new K(n.firstChild,n),o=[],i=n.firstChild;do{e(i)&&o.push(i)}while(i=r.next());return o},Z=function(t){return/^\w+:/i.test(t)},tt=function(t){var e=t.getAttribute("data-mce-href");return e||t.getAttribute("href")},et=function(t,e){var n=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter((function(t){return-1===I.inArray(n,t)}))},i=e?function(t){return(t=o(t)).length>0?t.concat(n):n}(r):o(r);return i.length>0?function(t){return I.trim(t.sort().join(" "))}(i):""},nt=function(t,e){return e=e||t.selection.getNode(),at(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},rt=function(t,e){return function(t){return t.replace(/\uFEFF/g,"")}(e?e.innerText||e.textContent:t.getContent({format:"text"}))},ot=function(t){return I.grep(t,J).length>0},it=function(t){var e=t.schema.getTextInlineElements();return 0===Q(t.selection.getRng(),(function(t){return 1===t.nodeType&&!Y(t)&&!G(e,t.nodeName.toLowerCase())})).length},at=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},ut=function(t,e){var n=U({},e);if(!(B(t).length>0)&&!1===P(t)){var r=et(n.rel,"_blank"===n.target);n.rel=r||null}return x.from(n.target).isNone()&&!1===M(t)&&(n.target=D(t)),n.href=function(t,e){return"http"!==e&&"https"!==e||Z(t)?t:e+"://"+t}(n.href,A(t)),n},ct=function(t,e,n){var r=t.selection.getNode(),o=nt(t,r),i=ut(t,function(t){var e,n,r;return e=["title","rel","class","target"],n=function(e,n){return t[n].each((function(t){e[n]=t.length>0?t:null})),e},r={href:t.href},function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)}(e,(function(t,e){r=n(r,t,e)})),r}(n));t.undoManager.transact((function(){n.href===e.href&&e.attach(),o?(t.focus(),function(t,e,n,r){n.each((function(t){G(e,"innerText")?e.innerText=t:e.textContent=t})),t.dom.setAttribs(e,r),t.selection.select(e)}(t,o,n.text,i)):function(t,e,n,r){at(e)?mt(t,e,r):n.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))}))}(t,r,n.text,i)}))},st=function(t){var e=t.class,n=t.href,r=t.rel,o=t.target,i=t.text,a=t.title;return function(t,e){var n,r={};return $(t,e,(n=r,function(t,e){n[e]=t}),d),r}({class:e.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:a.getOrNull()},(function(t,e){return!1===s(t)}))},lt=function(t,e,n){var r=function(t,e){var n=e.href;return U(U({},e),{href:X.isDomSafe(n,"a",t.settings)?n:""})}(t,n);t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,st(r)):ct(t,e,r)},ft=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var e=t.selection.getNode();at(e)?dt(t,e):function(t){var e=t.dom,n=t.selection,r=n.getBookmark(),o=n.getRng().cloneRange(),i=e.getParent(o.startContainer,"a[href]",t.getBody()),a=e.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),a&&o.setEndAfter(a),n.setRng(o),t.execCommand("unlink"),n.moveToBookmark(r)}(t),t.focus()}))}(t)},dt=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},mt=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},gt=function(t){return G(e=t,n="items")&&void 0!==e[n]&&null!==e[n];var e,n},ht=function(t,e){return E(e,(function(e){return gt(e)?ht(t,e.items):N(e.value===t,e)}))},pt=function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?ht(o,n).map((function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:d}},text:i?t:e.text}})):x.none()},vt=function(t,e){var n={text:t.text,title:t.title},r=function(t){var e,r=(e=t.url,N(n.text.length<=0,x.from(e.meta.text).getOr(e.value))),o=function(t){return N(n.title.length<=0,x.from(t.meta.title).getOr(""))}(t.url);return r.isSome()||o.isSome()?x.some(U(U({},r.map((function(t){return{text:t}})).getOr({})),o.map((function(t){return{title:t}})).getOr({}))):x.none()},o=function(t,r){var o,i,a=(o=e,i=r.name,"link"===i?o.link:"anchor"===i?o.anchor:x.none()).getOr([]);return pt(n.text,r.name,a,t)};return{onChange:function(t,e){var i=e.name;return"url"===i?r(t()):k(["anchor","link"],i)?o(t(),e):"text"===i||"title"===i?(n[i]=t()[i],x.none()):x.none()}}},bt=tinymce.util.Tools.resolve("tinymce.util.Delay"),yt=tinymce.util.Tools.resolve("tinymce.util.Promise"),wt=function(t){var e=t.href;return e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:")?x.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return U(U({},t),{href:"mailto:"+e})}}):x.none()},xt=function(t,e){return function(n){var r=n.href;return 1===t&&!Z(r)||0===t&&/^\s*www(\.|\d\.)/i.test(r)?x.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+e+":// prefix?",preprocess:function(t){return U(U({},t),{href:e+"://"+r})}}):x.none()}},Ct=function(t,e){return E([wt,xt(A(t),L(t))],(function(t){return t(e)})).fold((function(){return yt.resolve(e)}),(function(n){return new yt((function(r){!function(t,e,n){var r=t.selection.getRng();bt.setEditorTimeout(t,(function(){t.windowManager.confirm(e,(function(e){t.selection.setRng(r),n(e)}))}))}(t,n.message,(function(t){r(t?n.preprocess(e):e)}))}))}))},St=function(t){var e=t.dom.select("a:not([href])"),n=O(e,(function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]}));return n.length>0?x.some([{text:"None",value:""}].concat(n)):x.none()},kt=function(t){var e=function(t){return t.getParam("link_class_list",[],"array")}(t);return e.length>0?j.sanitize(e):x.none()},Tt=tinymce.util.Tools.resolve("tinymce.util.XHR"),Ot=function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=function(t){return t.getParam("link_list")}(t);return new yt((function(t){u(n)?Tt.send({url:n,success:function(e){return t(function(t){try{return x.some(JSON.parse(t))}catch(t){return x.none()}}(e))},error:function(e){return t(x.none())}}):f(n)?n((function(e){return t(x.some(e))})):t(x.from(n))})).then((function(t){return t.bind(j.sanitizeWith(e)).map((function(t){if(t.length>0){return[{text:"None",value:""}].concat(t)}return t}))}))},Et=function(t,e){var n=B(t);if(n.length>0){var r=_(e,"_blank");return(!1===P(t)?j.sanitizeWith((function(t){return et(j.getValue(t),r)})):j.sanitize)(n)}return x.none()},_t=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Rt=function(t){var e=M(t);return c(e)?j.sanitize(e).orThunk((function(){return x.some(_t)})):!1===e?x.none():x.some(_t)},Nt=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?x.some(r):x.none()},At=function(t,e){return Ot(t).then((function(n){var r=function(t,e){var n=t.dom,r=it(t)?x.some(rt(t.selection,e)):x.none(),o=e?x.some(n.getAttrib(e,"href")):x.none(),i=e?x.from(n.getAttrib(e,"target")):x.none(),a=Nt(n,e,"rel"),u=Nt(n,e,"class");return{url:o,text:r,title:Nt(n,e,"title"),target:i,rel:a,linkClass:u}}(t,e);return{anchor:r,catalogs:{targets:Rt(t),rels:Et(t,r.target),classes:kt(t),anchor:St(t),link:n},optNode:x.from(e),flags:{titleEnabled:z(t)}}}))},Dt=function(t){(function(t){var e=nt(t);return At(t,e)})(t).then((function(e){return function(t,e,n){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,e){var n=t.anchor,r=n.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:r,link:r,rel:n.rel.getOr(""),target:n.target.or(e).getOr(""),linkClass:n.linkClass.getOr("")}}(t,x.from(D(n))),a=t.catalogs,u=vt(i,a);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:T([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,R([a.anchor.map(j.createUi("anchor","Anchors")),a.rels.map(j.createUi("rel","Rel")),a.targets.map(j.createUi("target","Open link in...")),a.link.map(j.createUi("link","Link list")),a.classes.map(j.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,e){var n=e.name;u.onChange(t.getData,{name:n}).each((function(e){t.setData(e)}))},onSubmit:e}}(e,function(t,e){return function(n){var r=n.getData();if(!r.url.value)return ft(t),void n.close();var o=function(t){return x.from(r[t]).filter((function(n){return!_(e.anchor[t],n)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},a={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:d};Ct(t,i).then((function(e){lt(t,a,e)})),n.close()}}(t,e),t)})).then((function(e){t.windowManager.open(e)}))},Mt=function(t){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,e){document.body.appendChild(t),t.dispatchEvent(e),document.body.removeChild(t)}(e,n)},Bt=function(t,e){return t.dom.getParent(e,"a[href]")},zt=function(t){return Bt(t,t.selection.getStart())},Pt=function(t,e){if(e){var n=tt(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else Mt(e.href)}},Lt=function(t){return function(){Dt(t)}},It=function(t){return function(){Pt(t,zt(t))}},Ht=function(t,e){return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}},Ft=function(t){return function(e){var n=function(){return e.setActive(!t.mode.isReadOnly()&&null!==nt(t,t.selection.getNode()))};return n(),Ht(t,n)}},Vt=function(t){return function(e){var n=function(){return e.setDisabled(null===nt(t,t.selection.getNode()))};return n(),Ht(t,n)}},jt=function(t){return function(e){var n=function(e){return ot(e)||(n=t.selection.getRng(),Q(n,J).length>0);var n},r=t.dom.getParents(t.selection.getStart());return e.setDisabled(!n(r)),Ht(t,(function(t){return e.setDisabled(!n(t.parents))}))}},Ut=function(t){var e=function(e){var n=t.selection.getNode();return e.setDisabled(!nt(t,n)),d};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Ft(t)},label:"Link",predicate:function(e){return!!nt(t,e)&&function(t){return t.getParam("link_context_toolbar",!1,"boolean")}(t)},initValue:function(){var e=nt(t);return e?tt(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!nt(t,n)),Ft(t)(e)},onAction:function(e){var n=e.getValue(),r=function(e){var n=nt(t),r=it(t);if(!n&&r){var o=rt(t.selection,n);return x.some(o.length>0?o:e)}return x.none()}(n);lt(t,{href:n,attach:d},{href:n,text:r,title:x.none(),rel:x.none(),target:x.none(),class:x.none()}),function(t){t.selection.collapse(!1)}(t),e.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:e,onAction:function(e){ft(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:e,onAction:function(e){It(t)(),e.hide()}}]})};r.add("link",(function(t){!function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Lt(t),onSetup:Ft(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:It(t),onSetup:Vt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return ft(t)},onSetup:jt(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:It(t),onSetup:Vt(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Lt(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return ft(t)},onSetup:jt(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(e){return ot(t.dom.getParents(e,"a"))?"link unlink openlink":"link"}})}(t),Ut(t),function(t){t.on("click",(function(e){var n=Bt(t,e.target);n&&o.metaKeyPressed(e)&&(e.preventDefault(),Pt(t,n))})),t.on("keydown",(function(e){var n=zt(t);n&&13===e.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(e)&&(e.preventDefault(),Pt(t,n))}))}(t),function(t){t.addCommand("mceLink",(function(){!function(t){return t.getParam("link_quicklink",!1,"boolean")}(t)?Lt(t)():t.fire("contexttoolbar-show",{toolbarKey:"quicklink"})}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}()},1236:(t,e,n)=>{n(7585)},7585:()=>{!function(){"use strict";var t,e,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},o=function(t){return function(e){return typeof e===t}},i=r("string"),a=r("object"),u=r("array"),c=o("boolean"),s=o("function"),l=o("number"),f=function(){},d=function(t){return function(){return t}},m=function(t){return t},g=function(t,e){return t===e},h=function(t){return function(e){return!t(e)}},p=d(!1),v=d(!0),b=function(){return y},y={fold:function(t,e){return t()},isSome:p,isNone:v,getOr:e=m,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:e,orThunk:t,map:b,each:f,bind:b,exists:p,forall:v,filter:function(){return b()},toArray:function(){return[]},toString:d("none()")},w=function(t){var e=d(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=Array.prototype.slice,S=Array.prototype.push,k=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},T=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},O=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},E=function(t,e,n){return T(t,(function(t,r){n=e(n,t,r)})),n},_=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()},R=function(t,e){return _(t,e,p)},N=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!u(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e}(k(t,e))},A=function(t){var e=C.call(t,0);return e.reverse(),e},D=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},M=function(t){return D(t,0)},B=function(t){return D(t,t.length-1)},z=function(){return(z=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};var P,L=function(){return I(0,0)},I=function(t,e){return{major:t,minor:e}},H={nu:I,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?L():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return I(r(1),r(2))}(t,n)},unknown:L},F=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()}(e.brands,(function(e){var n=e.brand.toLowerCase();return R(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:H.nu(parseInt(e.version,10),0)}}))}))},V=function(t,e){var n=String(e).toLowerCase();return R(t,(function(t){return t.search(n)}))},j=function(t,e){return-1!==t.indexOf(e)},U=(P=/^\s+|\s+$/g,function(t){return t.replace(P,"")}),W=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,q=function(t){return function(e){return j(e,t)}},$=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return j(t,"edge/")&&j(t,"chrome")&&j(t,"safari")&&j(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,W],search:function(t){return j(t,"chrome")&&!j(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return j(t,"msie")||j(t,"trident")}},{name:"Opera",versionRegexes:[W,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:q("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:q("firefox")},{name:"Safari",versionRegexes:[W,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(j(t,"safari")||j(t,"mobile/"))&&j(t,"applewebkit")}}],G=[{name:"Windows",search:q("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return j(t,"iphone")||j(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:q("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:q("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:q("linux"),versionRegexes:[]},{name:"Solaris",search:q("sunos"),versionRegexes:[]},{name:"FreeBSD",search:q("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:q("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],K={browsers:d($),oses:d(G)},X="Edge",Y="Chrome",J="Opera",Q="Firefox",Z="Safari",tt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(X),isChrome:r(Y),isIE:r("IE"),isOpera:r(J),isFirefox:r(Q),isSafari:r(Z)}},et={unknown:function(){return tt({current:void 0,version:H.unknown()})},nu:tt,edge:d(X),chrome:d(Y),ie:d("IE"),opera:d(J),firefox:d(Q),safari:d(Z)},nt="Windows",rt="Android",ot="Linux",it="Solaris",at="FreeBSD",ut="ChromeOS",ct=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(nt),isiOS:r("iOS"),isAndroid:r(rt),isOSX:r("OSX"),isLinux:r(ot),isSolaris:r(it),isFreeBSD:r(at),isChromeOS:r(ut)}},st={unknown:function(){return ct({current:void 0,version:H.unknown()})},nu:ct,windows:d(nt),ios:d("iOS"),android:d(rt),linux:d(ot),osx:d("OSX"),solaris:d(it),freebsd:d(at),chromeos:d(ut)},lt=function(t,e,n){var r=K.browsers(),o=K.oses(),i=e.bind((function(t){return F(r,t)})).orThunk((function(){return function(t,e){return V(t,e).map((function(t){var n=H.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(et.unknown,et.nu),a=function(t,e){return V(t,e).map((function(t){var n=H.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(st.unknown,st.nu),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:d(o),isiPhone:d(i),isTablet:d(c),isPhone:d(s),isTouch:d(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:d(l),isDesktop:d(f)}}(a,i,t,n);return{browser:i,os:a,deviceType:u}},ft=function(t){return window.matchMedia(t).matches},dt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}}((function(){return lt(navigator.userAgent,x.from(navigator.userAgentData),ft)})),mt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},gt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return mt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return mt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return mt(n)},fromDom:mt,fromPoint:function(t,e,n){return x.from(t.dom.elementFromPoint(e,n)).map(mt)}},ht=function(t,e){return t.dom===e.dom},pt=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},vt=function(t,e){return dt().browser.isIE()?pt(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},bt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},yt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),wt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),xt=tinymce.util.Tools.resolve("tinymce.util.VK"),Ct=Object.keys,St=function(t,e){for(var n=Ct(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},kt=function(t,e){var n={};return function(t,e,n,r){St(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),f),n};"undefined"!=typeof window?window:Function("return this;")();var Tt,Ot=function(t){return t.dom.nodeName.toLowerCase()},Et=(Tt=1,function(t){return function(t){return t.dom.nodeType}(t)===Tt}),_t=function(t){return function(e){return Et(e)&&Ot(e)===t}},Rt=function(t,e){var n=t.dom;St(e,(function(t,e){!function(t,e,n){if(!(i(n)||c(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(n,e,t)}))},Nt=function(t){return E(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},At=function(t){return x.from(t.dom.parentNode).map(gt.fromDom)},Dt=function(t){return k(t.dom.childNodes,gt.fromDom)},Mt=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(gt.fromDom)},Bt=function(t){return Mt(t,0)},zt=function(t){return Mt(t,t.dom.childNodes.length-1)},Pt=function(t,e){At(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Lt=function(t,e){t.dom.appendChild(e.dom)},It=function(t,e){T(e,(function(e){Lt(t,e)}))},Ht=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ft=function(t){return function(t,e){return gt.fromDom(t.dom.cloneNode(e))}(t,!0)},Vt=function(t,e){var n=function(t,e){var n=gt.fromTag(e),r=Nt(t);return Rt(n,r),n}(t,e);Pt(t,n);var r=Dt(t);return It(n,r),Ht(t),n},jt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Ut=tinymce.util.Tools.resolve("tinymce.util.Tools"),Wt=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},qt=function(t){return function(e){return e&&t.test(e.nodeName)}},$t=function(t){return t&&3===t.nodeType},Gt=qt(/^(OL|UL|DL)$/),Kt=qt(/^(OL|UL)$/),Xt=Wt("ol"),Yt=qt(/^(LI|DT|DD)$/),Jt=qt(/^(DT|DD)$/),Qt=qt(/^(TH|TD)$/),Zt=Wt("br"),te=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},ee=function(t,e){return t&&t.nodeName in e},ne=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},re=function(t,e){return t.isChildOf(e,t.getRoot())},oe=function(t,e){var n,r,o,i=t.dom,a=t.schema.getBlockElements(),u=i.createFragment(),c=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e}(t);if(c&&((r=i.create(c)).tagName===c.toUpperCase()&&i.setAttribs(r,function(t){return t.getParam("forced_root_block_attrs",{})}(t)),ee(e.firstChild,a)||u.appendChild(r)),e)for(;n=e.firstChild;){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),ee(n,a)?(u.appendChild(n),r=null):c?(r||(r=i.create(c),u.appendChild(r)),r.appendChild(n)):u.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):u.appendChild(i.create("br")),u},ie=jt.DOM,ae=_t("dd"),ue=_t("dt"),ce=function(t,e){ae(e)?Vt(e,"dt"):ue(e)&&At(e).each((function(n){return function(t,e,n){var r=ie.select('span[data-mce-type="bookmark"]',e),o=oe(t,n),i=ie.createRng();i.setStartAfter(n),i.setEndAfter(e);for(var a,u=i.extractContents(),c=u.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){ie.remove(c);break}t.dom.isEmpty(u)||ie.insertAfter(u,e),ie.insertAfter(o,e),ne(t.dom,n.parentNode)&&(a=n.parentNode,Ut.each(r,(function(t){a.parentNode.insertBefore(t,n.parentNode)})),ie.remove(a)),ie.remove(n),ne(t.dom,e)&&ie.remove(e)}(t,n.dom,e.dom)}))},se=function(t){ue(t)&&Vt(t,"dd")},le=function(t,e){if($t(t))return{container:t,offset:e};var n=yt.getNode(t,e);return $t(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&$t(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&$t(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},fe=function(t){var e=t.cloneRange(),n=le(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=le(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},de=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),me=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",pe(t,n))},ge=function(t){var e=me(t),n=t.selection.getSelectedBlocks();return function(t,e){return t&&1===e.length&&e[0]===t}(e,n)?function(t){return O(t.querySelectorAll("ol,ul,dl"),Gt)}(e):O(n,(function(t){return Gt(t)&&e!==t}))},he=function(t){var e=t.selection.getSelectedBlocks();return O(function(t,e){var n=Ut.map(e,(function(e){return t.dom.getParent(e,"li,dd,dt",pe(t,e))||e}));return de.unique(n)}(t,e),Yt)},pe=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},ve=function(t,e){var n=t.dom.getParents(e,"ol,ul",pe(t,e));return B(n)},be=function(t){var e=function(t){var e=ve(t,t.selection.getStart()),n=O(t.selection.getSelectedBlocks(),Kt);return e.toArray().concat(n)}(t);return ye(t,e)},ye=function(t,e){var n=k(e,(function(e){return ve(t,e).getOr(e)}));return de.unique(n)},we=function(t,e,n){return void 0===n&&(n=g),t.exists((function(t){return n(t,e)}))},xe=function(t,e,n){return t.isSome()&&e.isSome()?x.some(n(t.getOrDie(),e.getOrDie())):x.none()},Ce=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},Se=function(t,e,n){if(!i(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);(function(t){return void 0!==t.style&&s(t.style.getPropertyValue)})(t)&&t.style.setProperty(e,n)},ke=function(t,e){Lt(t.item,e.list)},Te=function(t,e){var n={list:gt.fromTag(e,t),item:gt.fromTag("li",t)};return Lt(n.list,n.item),n},Oe=function(t,e,n){var r=e.slice(0,n.depth);return B(r).each((function(e){!function(t,e){Lt(t.list,e),t.item=e}(e,function(t,e,n){var r=gt.fromTag("li",t);return Rt(r,e),It(r,n),r}(t,n.itemAttributes,n.content)),function(t,e){Ot(t.list)!==e.listType&&(t.list=Vt(t.list,e.listType)),Rt(t.list,e.listAttributes)}(e,n)})),r},Ee=function(t,e,n){var r,o=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(Te(t,e.listType));return r}(t,n,n.depth-e.length);return function(t){for(var e=1;e<t.length;e++)ke(t[e-1],t[e])}(o),function(t,e){for(var n=0;n<t.length-1;n++)r=t[n].item,o="list-style-type",i="none",a=void 0,a=r.dom,Se(a,o,i);var r,o,i,a;B(t).each((function(t){Rt(t.list,e.listAttributes),Rt(t.item,e.itemAttributes),It(t.item,e.content)}))}(o,n),r=o,xe(B(e),M(r),ke),e.concat(o)},_e=function(t){return bt(t,"OL,UL")},Re=function(t){return Bt(t).exists(_e)},Ne=function(t){return t.depth>0},Ae=function(t){return t.isSelected},De=function(t){var e=Dt(t),n=zt(t).exists(_e)?e.slice(0,-1):e;return k(n,Ft)},Me=function(t){return T(t,(function(e,n){(function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return _(A(t.slice(0,e)),r,o).orThunk((function(){return _(t.slice(e+1),r,o)}))})(t,n).fold((function(){e.dirty&&function(t){t.listAttributes=kt(t.listAttributes,(function(t,e){return"start"!==e}))}(e)}),(function(t){return r=t,(n=e).listType=r.listType,void(n.listAttributes=z({},r.listAttributes));var n,r}))})),t},Be=function(t,e,n,r){return Bt(r).filter(_e).fold((function(){e.each((function(t){ht(t.start,r)&&n.set(!0)}));var o=function(t,e,n){return At(t).filter(Et).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:De(t),itemAttributes:Nt(t),listAttributes:Nt(r),listType:Ot(r)}}))}(r,t,n.get());e.each((function(t){ht(t.end,r)&&n.set(!1)}));var i=zt(r).filter(_e).map((function(r){return ze(t,e,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return ze(t,e,n,r)}))},ze=function(t,e,n,r){return N(Dt(r),(function(r){return(_e(r)?ze:Be)(t+1,e,n,r)}))},Pe=function(t,e){var n=Me(e);return k(n,(function(e){var n,r,o,i=(n=e.content,o=(r||document).createDocumentFragment(),T(n,(function(t){o.appendChild(t.dom)})),gt.fromDom(o));return gt.fromDom(oe(t,i.dom))}))},Le=function(t,e){var n=Me(e);return function(t,e){var n=E(e,(function(e,n){return n.depth>e.length?Ee(t,e,n):Oe(t,e,n)}),[]);return M(n).map((function(t){return t.list}))}(t.contentDocument,n).toArray()},Ie=function(t,e,n){var r=function(t,e){var n,r=(n=!1,{get:function(){return n},set:function(t){n=t}});return k(t,(function(t){return{sourceList:t,entries:ze(0,e,r,t)}}))}(e,function(t){var e=k(he(t),gt.fromDom);return xe(R(e,h(Re)),R(A(e),h(Re)),(function(t,e){return{start:t,end:e}}))}(t));T(r,(function(e){!function(t,e){T(O(t,Ae),(function(t){return function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0}(e,t)}))}(e.entries,n);var r,o=function(t,e){return N(function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,a=t.length;i<a;i++){var u=t[i],c=e(u);c!==n&&(r.push(o),o=[]),n=c,o.push(u)}return 0!==o.length&&r.push(o),r}(e,Ne),(function(e){return M(e).exists(Ne)?Le(t,e):Pe(t,e)}))}(t,e.entries);T(o,(function(e){Ce(t,"Indent"===n?"IndentList":"OutdentList",e.dom)})),r=e.sourceList,T(o,(function(t){Pt(r,t)})),Ht(e.sourceList)}))},He=function(t,e){var n=k(be(t),gt.fromDom),r=k(function(t){return O(he(t),Jt)}(t),gt.fromDom),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();Ie(t,n,e),function(t,e,n){T(n,"Indent"===e?se:function(e){return ce(t,e)})}(t,e,r),t.selection.moveToBookmark(i),t.selection.setRng(fe(t.selection.getRng())),t.nodeChanged(),o=!0}return o},Fe=function(t){return He(t,"Indent")},Ve=function(t){return He(t,"Outdent")},je=function(t){return He(t,"Flatten")},Ue=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),We=jt.DOM,qe=function(t){var e={},n=function(n){var r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"];if(1===r.nodeType){var i=We.create("span",{"data-mce-type":"bookmark"});r.hasChildNodes()?(o=Math.min(o,r.childNodes.length-1),n?r.insertBefore(i,r.childNodes[o]):We.insertAfter(i,r.childNodes[o])):r.appendChild(i),r=i,o=0}e[n?"startContainer":"endContainer"]=r,e[n?"startOffset":"endOffset"]=o};return n(!0),t.collapsed||n(),e},$e=function(t){var e=function(e){var n,r=n=t[e?"startContainer":"endContainer"],o=t[e?"startOffset":"endOffset"];r&&(1===r.nodeType&&(o=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(r),r=r.parentNode,We.remove(n),!r.hasChildNodes()&&We.isBlock(r)&&r.appendChild(We.create("br"))),t[e?"startContainer":"endContainer"]=r,t[e?"startOffset":"endOffset"]=o)};e(!0),e();var n=We.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),fe(n)},Ge=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Ke=function(t){return/\btox\-/.test(t.className)},Xe=function(t,e,n){var r=function(t){var r=_(t.parents,Gt,Qt).filter((function(t){return t.nodeName===e&&!Ke(t)})).isSome();n(r)},o=t.dom.getParents(t.selection.getNode());return r({parents:o}),t.on("NodeChange",r),function(){return t.off("NodeChange",r)}},Ye=function(t,e){Ut.each(e,(function(e,n){t.setAttribute(n,e)}))},Je=function(t,e,n){!function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)}(t,e,n),function(t,e,n){Ye(e,n["list-attributes"]),Ut.each(t.select("li",e),(function(t){Ye(t,n["list-item-attributes"])}))}(t,e,n)},Qe=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&Zt(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(te(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},Ze=function(t,e,n){var r=t.selection.getRng(),o="LI",i=pe(t,t.selection.getStart(!0)),a=t.dom;if("false"!==a.getContentEditable(t.selection.getNode())){"DL"===(e=e.toUpperCase())&&(o="DT");var u=qe(r),c=function(t,e,n){for(var r,o=[],i=t.dom,a=Qe(t,e,!0,n),u=Qe(t,e,!1,n),c=[],s=a;s&&(c.push(s),s!==u);s=s.nextSibling);return Ut.each(c,(function(e){if(te(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||Zt(e))return Zt(e)&&i.remove(e),void(r=null);var a=e.nextSibling;Ue.isBookmarkNode(e)&&(Gt(a)||te(t,a)||!a&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))})),o}(t,r,i);Ut.each(c,(function(r){var i,u=r.previousSibling,c=r.parentNode;Yt(c)||(u&&Gt(u)&&u.nodeName===e&&function(t,e,n){var r=t.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return r===(null===o?"":o)}(a,u,n)?(i=u,r=a.rename(r,o),u.appendChild(r)):(i=a.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=a.rename(r,o)),function(t,e,n){Ut.each(n,(function(n){var r;return t.setStyle(e,((r={})[n]="",r))}))}(a,r,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),Je(a,i,n),en(t.dom,i))})),t.selection.setRng($e(u))}},tn=function(t,e,n){return function(t,e){return t&&e&&Gt(t)&&t.nodeName===e.nodeName}(e,n)&&function(t,e,n){return t.getStyle(e,"list-style-type",!0)===t.getStyle(n,"list-style-type",!0)}(t,e,n)&&(r=n,e.className===r.className);var r},en=function(t,e){var n,r;if(n=e.nextSibling,tn(t,e,n)){for(;r=n.firstChild;)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,tn(t,e,n)){for(;r=n.lastChild;)e.insertBefore(r,e.firstChild);t.remove(n)}},nn=function(t,e,n,r,o){var i=Gt(e);if(i&&e.nodeName===r&&!rn(o))je(t);else{Ze(t,r,o);var a=qe(t.selection.getRng()),u=i?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([e],n,!0):n;Ut.each(u,(function(e){!function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);Je(t.dom,o,r),Ce(t,Ge(n),o)}else Je(t.dom,e,r),Ce(t,Ge(n),e)}(t,e,r,o)})),t.selection.setRng($e(a))}},rn=function(t){return"list-style-type"in t},on=function(t,e,n){var r=me(t),o=ge(t),i=a(n)?n:{};o.length>0?nn(t,r,o,e,i):function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||rn(r)||Ke(e)){var o=qe(t.selection.getRng());Je(t.dom,e,r);var i=t.dom.rename(e,n);en(t.dom,i),t.selection.setRng($e(o)),Ze(t,n,r),Ce(t,Ge(n),i)}else je(t);else Ze(t,n,r),Ce(t,Ge(n),e)}(t,r,e,i)},an=jt.DOM,un=function(t,e){var n=Ut.grep(t.select("ol,ul",e));Ut.each(n,(function(e){!function(t,e){var n,r=e.parentNode;"LI"===r.nodeName&&r.firstChild===e&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(e),ne(t,r)&&an.remove(r)):an.setStyle(r,"listStyleType","none")),Gt(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(e)}(t,e)}))},cn=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if($t(o)&&(n?i<o.data.length:i>0))return o;var a=t.schema.getNonEmptyElements();1===o.nodeType&&(o=yt.getNode(o,i));var u=new wt(o,r);for(n&&function(t,e){return!!Zt(e)&&t.isBlock(e.nextSibling)&&!Zt(e.previousSibling)}(t.dom,o)&&u.next();o=u[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(a[o.nodeName])return o;if($t(o)&&o.data.length>0)return o}},sn=function(t,e){var n=e.childNodes;return 1===n.length&&!Gt(n[0])&&t.isBlock(n[0])},ln=function(t,e,n){var r,o=sn(t,n)?n.firstChild:n;if(function(t,e){sn(t,e)&&t.remove(e.firstChild,!0)}(t,e),!ne(t,e,!0))for(;r=e.firstChild;)o.appendChild(r)},fn=function(t,e,n){var r,o=e.parentNode;if(re(t,e)&&re(t,n)){Gt(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Zt(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&Zt(i)&&e.hasChildNodes()&&t.remove(i),ne(t,n,!0)&&t.$(n).empty(),ln(t,e,n),r&&n.appendChild(r);var a=vt(gt.fromDom(n),gt.fromDom(e))?t.getParents(e,Gt,n):[];t.remove(e),T(a,(function(e){ne(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},dn=function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))!function(t,e,n){t.dom.$(n).empty(),fn(t.dom,e,n),t.selection.setCursorLocation(n,0)}(t,n,r);else{var i=qe(e);fn(o,n,r),t.selection.setRng($e(i))}},mn=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=pe(t,o),a=n.getParent(r.getStart(),"LI",i);if(a){var u=a.parentNode;if(u===t.getBody()&&ne(n,u))return!0;var c=fe(r.getRng()),s=n.getParent(cn(t,c,e,i),"LI",i);if(s&&s!==a)return t.undoManager.transact((function(){var n;e?dn(t,c,s,a):(n=a).parentNode.firstChild===n?Ve(t):function(t,e,n,r){var o=qe(e);fn(t.dom,n,r);var i=$e(o);t.selection.setRng(i)}(t,c,a,s)})),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){je(t)})),!0}return!1},gn=function(t,e){return mn(t,e)||function(t,e){var n=t.dom,r=t.selection.getStart(),o=pe(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var a=fe(t.selection.getRng()),u=n.getParent(cn(t,a,e,o),"LI",o);if(u)return t.undoManager.transact((function(){!function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)}(n,i,o),en(n,u.parentNode),t.selection.select(u,!0),t.selection.collapse(e)})),!0}return!1}(t,e)},hn=function(t,e){return t.selection.isCollapsed()?gn(t,e):function(t){var e=t.selection.getStart(),n=pe(t,e);return!!(t.dom.getParent(e,"LI,DT,DD",n)||he(t).length>0)&&(t.undoManager.transact((function(){t.execCommand("Delete"),un(t.dom,t.getBody())})),!0)}(t)},pn=function(t){var e=A(U(t).split("")),n=k(e,(function(t,e){var n=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,e)*n}));return E(n,(function(t,e){return t+e}),0)},vn=function(t){if(--t<0)return"";var e=t%26,n=Math.floor(t/26);return vn(n)+String.fromCharCode("A".charCodeAt(0)+e)},bn=function(t){var e,n,r=me(t);Xt(r)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:(e={start:t.dom.getAttrib(r,"start","1"),listStyleType:x.some(t.dom.getStyle(r,"list-style-type"))},n=parseInt(e.start,10),we(e.listStyleType,"upper-alpha")?vn(n):we(e.listStyleType,"lower-alpha")?vn(n).toLowerCase():e.start)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){(function(t){switch(function(t){return/^[0-9]+$/.test(t)?2:/^[A-Z]+$/.test(t)?0:function(t){return/^[a-z]+$/.test(t)}(t)?1:t.length>0?4:3}(t)){case 2:return x.some({listStyleType:x.none(),start:t});case 0:return x.some({listStyleType:x.some("upper-alpha"),start:pn(t).toString()});case 1:return x.some({listStyleType:x.some("lower-alpha"),start:pn(t).toString()});case 3:return x.some({listStyleType:x.none(),start:""});case 4:return x.none()}})(e.getData().start).each((function(e){t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===e.start?"":e.start},styles:{"list-style-type":e.listStyleType.getOr("")}})})),e.close()}})},yn=function(t,e){return function(){var n=me(t);return n&&n.nodeName===e}},wn=function(t){t.addCommand("mceListProps",(function(){bn(t)}))},xn=function(t){t.on("BeforeExecCommand",(function(e){var n=e.command.toLowerCase();"indent"===n?Fe(t):"outdent"===n&&Ve(t)})),t.addCommand("InsertUnorderedList",(function(e,n){on(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){on(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){on(t,"DL",n)})),t.addCommand("RemoveList",(function(){je(t)})),wn(t),t.addCommand("mceListUpdate",(function(e,n){a(n)&&function(t,e){var n=me(t);t.undoManager.transact((function(){a(e.styles)&&t.dom.setStyles(n,e.styles),a(e.attrs)&&St(e.attrs,(function(e,r){return t.dom.setAttrib(n,r,e)}))}))}(t,n)})),t.addQueryStateHandler("InsertUnorderedList",yn(t,"UL")),t.addQueryStateHandler("InsertOrderedList",yn(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",yn(t,"DL"))},Cn=function(t){(function(t){return t.getParam("lists_indent_on_tab",!0)})(t)&&function(t){t.on("keydown",(function(e){e.keyCode!==xt.TAB||xt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?Ve(t):Fe(t))&&e.preventDefault()}))}))}(t),function(t){t.on("keydown",(function(e){e.keyCode===xt.BACKSPACE?hn(t,!1)&&e.preventDefault():e.keyCode===xt.DELETE&&hn(t,!0)&&e.preventDefault()}))}(t)};n.add("lists",(function(t){return!1===t.hasPlugin("rtc",!0)?(Cn(t),xn(t)):wn(t),function(t){var e=function(e){return function(){return t.execCommand(e)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return Xe(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return Xe(t,"UL",e.setActive)}}))}(t),function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return t.execCommand("mceListProps")},onSetup:function(e){return Xe(t,"OL",(function(t){return e.setDisabled(!t)}))}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=me(t,e);return Xt(n)?["listprops"]:[]}})}(t),function(t){return{backspaceDelete:function(e){hn(t,e)}}}(t)}))}()},2540:(t,e,n)=>{n(3167)},3167:()=>{!function(){"use strict";var t,e,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},i=o("string"),a=o("object"),u=o("array"),c=function(t){return!function(t){return null==t}(t)},s=function(){},l=function(t){return function(){return t}},f=function(t){return t},d=l(!1),m=l(!0),g=function(){return h},h={fold:function(t,e){return t()},isSome:d,isNone:m,getOr:e=f,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:e,orThunk:t,map:g,each:s,bind:g,exists:d,forall:m,filter:function(){return g()},toArray:function(){return[]},toString:l("none()")},p=function(t){var e=l(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:m,isNone:d,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return p(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:h},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},v={some:p,none:g,from:function(t){return null==t?h:p(t)}},b=Array.prototype.push,y=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},w=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!u(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);b.apply(e,t[n])}return e},x=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},C=Object.keys,S=Object.hasOwnProperty,k=function(t,e){return T(t,e)?v.from(t[e]):v.none()},T=function(t,e){return S.call(t,e)},O=function(t){return t.getParam("media_scripts")},E=function(t){return t.getParam("media_live_embeds",!0)},_=tinymce.util.Tools.resolve("tinymce.util.Tools"),R=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),N=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),A=function(t,e){if(t)for(var n=0;n<t.length;n++)if(-1!==e.indexOf(t[n].filter))return t[n]},D=R.DOM,M=function(t){return t.replace(/px$/,"")},B=function(t,e){var n=x(!1),r={};return N({validate:!1,allow_conditional_comments:!0,start:function(e,o){if(n.get());else if(T(o.map,"data-ephox-embed-iri"))n.set(!0),r=function(t){var e=t.map.style,n=e?D.parseStyle(e):{};return{type:"ephox-embed-iri",source:t.map["data-ephox-embed-iri"],altsource:"",poster:"",width:k(n,"max-width").map(M).getOr(""),height:k(n,"max-height").map(M).getOr("")}}(o);else{if(r.source||"param"!==e||(r.source=o.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=_.extend(o.map,r)),"script"===e){var i=A(t,o.map.src);if(!i)return;r={type:"script",source:o.map.src,width:String(i.width),height:String(i.height)}}"source"===e&&(r.source?r.altsource||(r.altsource=o.map.src):r.source=o.map.src),"img"!==e||r.poster||(r.poster=o.map.src)}}}).parse(e),r.source=r.source||r.src||r.data,r.altsource=r.altsource||"",r.poster=r.poster||"",r},z=function(t){var e={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[t.toLowerCase().split(".").pop()];return e||""},P=tinymce.util.Tools.resolve("tinymce.html.Schema"),L=tinymce.util.Tools.resolve("tinymce.html.Writer"),I=R.DOM,H=function(t){return/^[0-9.]+$/.test(t)?t+"px":t},F=function(t,e){!function(t,e){for(var n=C(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(e,(function(e,n){var r=""+e;if(t.map[n])for(var o=t.length;o--;){var i=t[o];i.name===n&&(r?(t.map[n]=r,i.value=r):(delete t.map[n],t.splice(o,1)))}else r&&(t.push({name:n,value:r}),t.map[n]=r)}))},V=["source","altsource"],j=function(t,e,n){var r,o=L(),i=x(!1),a=0;return N({validate:!1,allow_conditional_comments:!0,comment:function(t){o.comment(t)},cdata:function(t){o.cdata(t)},text:function(t,e){o.text(t,e)},start:function(t,u,c){if(i.get());else if(T(u.map,"data-ephox-embed-iri"))i.set(!0),function(t,e){var n=e.map.style,r=n?I.parseStyle(n):{};r["max-width"]=H(t.width),r["max-height"]=H(t.height),F(e,{style:I.serializeStyle(r)})}(e,u);else{switch(t){case"video":case"object":case"embed":case"img":case"iframe":void 0!==e.height&&void 0!==e.width&&F(u,{width:e.width,height:e.height})}if(n)switch(t){case"video":F(u,{poster:e.poster,src:""}),e.altsource&&F(u,{src:""});break;case"iframe":F(u,{src:e.source});break;case"source":if(a<2&&(F(u,{src:e[V[a]],type:e[V[a]+"mime"]}),!e[V[a]]))return;a++;break;case"img":if(!e.poster)return;r=!0}}o.start(t,u,c)},end:function(t){if(!i.get()){if("video"===t&&n)for(var u=0;u<2;u++)if(e[V[u]]){var c=[];c.map={},a<=u&&(F(c,{src:e[V[u]],type:e[V[u]+"mime"]}),o.start("source",c,!0))}if(e.poster&&"object"===t&&n&&!r){var s=[];s.map={},F(s,{src:e.poster,width:e.width,height:e.height}),o.start("img",s,!0)}}o.end(t)}},P({})).parse(t),o.getContent()},U=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&amp;byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],W=function(t,e){for(var n=function(t){var e=t.match(/^(https?:\/\/|www\.)(.+)$/i);return e&&e.length>1?"www."===e[1]?"https://":e[1]:"https://"}(e),r=t.regex.exec(e),o=n+t.url,i=function(t){o=o.replace("$"+t,(function(){return r[t]?r[t]:""}))},a=0;a<r.length;a++)i(a);return o.replace(/\?$/,"")},q=function(t,e){var n=_.extend({},e);if(!n.source&&(_.extend(n,B(O(t),n.embed)),!n.source))return"";n.altsource||(n.altsource=""),n.poster||(n.poster=""),n.source=t.convertURL(n.source,"source"),n.altsource=t.convertURL(n.altsource,"source"),n.sourcemime=z(n.source),n.altsourcemime=z(n.altsource),n.poster=t.convertURL(n.poster,"poster");var r,o,i=(r=n.source,(o=U.filter((function(t){return t.regex.test(r)}))).length>0?_.extend({},o[0],{url:W(o[0],r)}):null);if(i&&(n.source=i.url,n.type=i.type,n.allowfullscreen=i.allowFullscreen,n.width=n.width||String(i.w),n.height=n.height||String(i.h)),n.embed)return j(n.embed,n,!0);var a=A(O(t),n.source);a&&(n.type="script",n.width=String(a.width),n.height=String(a.height));var u=function(t){return t.getParam("audio_template_callback")}(t),c=function(t){return t.getParam("video_template_callback")}(t);return n.width=n.width||"300",n.height=n.height||"150",_.each(n,(function(e,r){n[r]=t.dom.encode(""+e)})),"iframe"===n.type?function(t){var e=t.allowfullscreen?' allowFullscreen="1"':"";return'<iframe src="'+t.source+'" width="'+t.width+'" height="'+t.height+'"'+e+"></iframe>"}(n):"application/x-shockwave-flash"===n.sourcemime?function(t){var e='<object data="'+t.source+'" width="'+t.width+'" height="'+t.height+'" type="application/x-shockwave-flash">';return t.poster&&(e+='<img src="'+t.poster+'" width="'+t.width+'" height="'+t.height+'" />'),e+"</object>"}(n):-1!==n.sourcemime.indexOf("audio")?function(t,e){return e?e(t):'<audio controls="controls" src="'+t.source+'">'+(t.altsource?'\n<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</audio>"}(n,u):"script"===n.type?function(t){return'<script src="'+t.source+'"><\/script>'}(n):function(t,e){return e?e(t):'<video width="'+t.width+'" height="'+t.height+'"'+(t.poster?' poster="'+t.poster+'"':"")+' controls="controls">\n<source src="'+t.source+'"'+(t.sourcemime?' type="'+t.sourcemime+'"':"")+" />\n"+(t.altsource?'<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</video>"}(n,c)},$=function(t){return t.hasAttribute("data-mce-object")||t.hasAttribute("data-ephox-embed-iri")},G=tinymce.util.Tools.resolve("tinymce.util.Promise"),K={},X=function(t){return function(e){return q(t,e)}},Y=function(t,e){var n=function(t){return t.getParam("media_url_resolver")}(t);return n?function(t,e,n){return new G((function(r,o){var i=function(n){return n.html&&(K[t.source]=n),r({url:t.source,html:n.html?n.html:e(t)})};K[t.source]?i(K[t.source]):n({url:t.source},i,o)}))}(e,X(t),n):function(t,e){return G.resolve({html:e(t),url:t.source})}(e,X(t))},J=function(t,e){var n=e?function(t,e){return k(e,t).bind((function(t){return k(t,"meta")}))}(e,t).getOr({}):{},o=function(t,e,n){return function(r){var o,i=function(){return k(t,r)},u=function(){return k(e,r)},c=function(t){return k(t,"value").bind((function(t){return t.length>0?v.some(t):v.none()}))};return(o={})[r]=(r===n?i().bind((function(t){return a(t)?c(t).orThunk(u):u().orThunk((function(){return v.from(t)}))})):u().orThunk((function(){return i().bind((function(t){return a(t)?c(t):v.from(t)}))}))).getOr(""),o}}(t,n,e);return r(r(r(r(r({},o("source")),o("altsource")),o("poster")),o("embed")),function(t,e){var n={};return k(t,"dimensions").each((function(t){y(["width","height"],(function(r){k(e,r).orThunk((function(){return k(t,r)})).each((function(t){return n[r]=t}))}))})),n}(t,n))},Q=function(t){var e=r(r({},t),{source:{value:k(t,"source").getOr("")},altsource:{value:k(t,"altsource").getOr("")},poster:{value:k(t,"poster").getOr("")}});return y(["width","height"],(function(n){k(t,n).each((function(t){var r=e.dimensions||{};r[n]=t,e.dimensions=r}))})),e},Z=function(t){return function(e){var n=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";t.notificationManager.open({type:"error",text:n})}},tt=function(t,e){return B(O(t),e)},et=function(t,e){return function(n){if(i(n.url)&&n.url.trim().length>0){var o=n.html,a=tt(e,o),u=r(r({},a),{source:n.url,embed:o});t.setData(Q(u))}}},nt=function(t,e){var n=t.dom.select("*[data-mce-object]");t.insertContent(e),function(t,e){for(var n=t.dom.select("*[data-mce-object]"),r=0;r<e.length;r++)for(var o=n.length-1;o>=0;o--)e[r]===n[o]&&n.splice(o,1);t.selection.select(n[0])}(t,n),t.nodeChanged()},rt=function(t,e,n){var r;e.embed=j(e.embed,e),e.embed&&(t.source===e.source||(r=e.source,T(K,r)))?nt(n,e.embed):Y(n,e).then((function(t){nt(n,t.html)})).catch(Z(n))},ot=function(t){var e=function(t){var e=t.selection.getNode(),n=$(e)?t.serializer.serialize(e,{selection:!0}):"";return r({embed:n},B(O(t),n))}(t),n=x(e),o=Q(e),i=function(t){return t.getParam("media_dimensions",!0)}(t)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],a={title:"General",name:"general",items:w([[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],i])},u={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},c=[];(function(t){return t.getParam("media_alt_source",!0)})(t)&&c.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),function(t){return t.getParam("media_poster",!0)}(t)&&c.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var s={title:"Advanced",name:"advanced",items:c},l=[a,u];c.length>0&&l.push(s);var f={type:"tabpanel",tabs:l},d=t.windowManager.open({title:"Insert/Edit Media",size:"normal",body:f,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var r=J(e.getData());rt(n.get(),r,t),e.close()},onChange:function(e,o){switch(o.name){case"source":!function(e,n){var r=J(n.getData(),"source");e.source!==r.source&&(et(d,t)({url:r.source,html:""}),Y(t,r).then(et(d,t)).catch(Z(t)))}(n.get(),e);break;case"embed":!function(e){var n=J(e.getData()),r=tt(t,n.embed);e.setData(Q(r))}(e);break;case"dimensions":case"altsource":case"poster":!function(e,n){var o=J(e.getData(),n),i=q(t,o);e.setData(Q(r(r({},o),{embed:i})))}(e,o.name)}n.set(J(e.getData()))},initialData:o})},it=tinymce.util.Tools.resolve("tinymce.html.Node"),at=tinymce.util.Tools.resolve("tinymce.Env"),ut=tinymce.util.Tools.resolve("tinymce.html.DomParser"),ct=function(t,e){if(!1===function(t){return t.getParam("media_filter_html",!0)}(t))return e;var n,r=L();return N({validate:!1,allow_conditional_comments:!1,comment:function(t){n||r.comment(t)},cdata:function(t){n||r.cdata(t)},text:function(t,e){n||r.text(t,e)},start:function(e,o,i){if(n=!0,"script"!==e&&"noscript"!==e&&"svg"!==e){for(var a=o.length-1;a>=0;a--){var u=o[a].name;0===u.indexOf("on")&&(delete o.map[u],o.splice(a,1)),"style"===u&&(o[a].value=t.dom.serializeStyle(t.dom.parseStyle(o[a].value),e))}r.start(e,o,i),n=!1}},end:function(t){n||r.end(t)}},P({})).parse(e),r.getContent()},st=function(t){var e=t.name;return"iframe"===e||"video"===e||"audio"===e},lt=function(t,e,n,r){void 0===r&&(r=null);var o=t.attr(n);return c(o)?o:T(e,n)?null:r},ft=function(t,e,n){var r="img"===e.name||"video"===t.name,o=r?"300":null,i="audio"===t.name?"30":"150",a=r?i:null;e.attr({width:lt(t,n,"width",o),height:lt(t,n,"height",a)})},dt=function(t,e){var n=e.name,r=new it("img",1);return r.shortEnded=!0,gt(t,e,r),ft(e,r,{}),r.attr({style:e.attr("style"),src:at.transparentSrc,"data-mce-object":n,class:"mce-object mce-object-"+n}),r},mt=function(t,e){var n=e.name,r=new it("span",1);r.attr({contentEditable:"false",style:e.attr("style"),"data-mce-object":n,class:"mce-preview-object mce-object-"+n}),gt(t,e,r);var o=t.dom.parseStyle(e.attr("style")),i=new it(n,1);if(ft(e,i,o),i.attr({src:e.attr("src"),style:e.attr("style"),class:e.attr("class")}),"iframe"===n)i.attr({allowfullscreen:e.attr("allowfullscreen"),frameborder:"0"});else{y(["controls","crossorigin","currentTime","loop","muted","poster","preload"],(function(t){i.attr(t,e.attr(t))}));var a=r.attr("data-mce-html");c(a)&&function(t,e,n,r){for(var o=ut({forced_root_block:!1,validate:!1},t.schema).parse(r,{context:e});o.firstChild;)n.append(o.firstChild)}(t,n,i,unescape(a))}var u=new it("span",1);return u.attr("class","mce-shim"),r.append(i),r.append(u),r},gt=function(t,e,n){for(var r=e.attributes,o=r.length;o--;){var i=r[o].name,a=r[o].value;"width"!==i&&"height"!==i&&"style"!==i&&("data"!==i&&"src"!==i||(a=t.convertURL(a,i)),n.attr("data-mce-p-"+i,a))}var u=e.firstChild&&e.firstChild.value;u&&(n.attr("data-mce-html",escape(ct(t,u))),n.firstChild=null)},ht=function(t){var e=t.attr("class");return e&&/\btiny-pageembed\b/.test(e)},pt=function(t){for(;t=t.parent;)if(t.attr("data-ephox-embed-iri")||ht(t))return!0;return!1},vt=function(t){t.on("preInit",(function(){var e=t.schema.getSpecialElements();_.each("video audio iframe object".split(" "),(function(t){e[t]=new RegExp("</"+t+"[^>]*>","gi")}));var n=t.schema.getBoolAttrs();_.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),(function(t){n[t]={}})),t.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t){return function(e){for(var n,r,o=e.length;o--;)(n=e[o]).parent&&(n.parent.attr("data-mce-object")||("script"!==n.name||(r=A(O(t),n.attr("src"))))&&(r&&(r.width&&n.attr("width",r.width.toString()),r.height&&n.attr("height",r.height.toString())),st(n)&&E(t)&&at.ceFalse?pt(n)||n.replace(mt(t,n)):pt(n)||n.replace(dt(t,n))))}}(t)),t.serializer.addAttributeFilter("data-mce-object",(function(e,n){for(var r,o,i,a,u,c,s,l,f=e.length;f--;)if((r=e[f]).parent){for(s=r.attr(n),o=new it(s,1),"audio"!==s&&"script"!==s&&((l=r.attr("class"))&&-1!==l.indexOf("mce-preview-object")?o.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):o.attr({width:r.attr("width"),height:r.attr("height")})),o.attr({style:r.attr("style")}),i=(a=r.attributes).length;i--;){var d=a[i].name;0===d.indexOf("data-mce-p-")&&o.attr(d.substr(11),a[i].value)}"script"===s&&o.attr("type","text/javascript"),(u=r.attr("data-mce-html"))&&((c=new it("#text",3)).raw=!0,c.value=ct(t,unescape(u)),o.append(c)),r.replace(o)}}))})),t.on("SetContent",(function(){t.$("span.mce-preview-object").each((function(e,n){var r=t.$(n);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')}))}))};n.add("media",(function(t){return function(t){t.addCommand("mceMedia",(function(){ot(t)}))}(t),function(t){var e=function(){return t.execCommand("mceMedia")};t.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:e,onSetup:function(e){var n=t.selection;return e.setActive($(n.getNode())),n.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",e.setActive).unbind}}),t.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:e})}(t),function(t){t.on("ResolveName",(function(t){var e;1===t.target.nodeType&&(e=t.target.getAttribute("data-mce-object"))&&(t.name=e)}))}(t),vt(t),function(t){t.on("click keyup touchend",(function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")})),t.on("ObjectSelected",(function(t){"script"===t.target.getAttribute("data-mce-object")&&t.preventDefault()})),t.on("ObjectResized",(function(t){var e=t.target;if(e.getAttribute("data-mce-object")){var n=e.getAttribute("data-mce-html");n&&(n=unescape(n),e.setAttribute("data-mce-html",escape(j(n,{width:String(t.width),height:String(t.height)}))))}}))}(t),function(t){return{showDialog:function(){ot(t)}}}(t)}))}()},5031:(t,e,n)=>{n(7814)},7814:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},r=function(t){return function(e){return-1!==(" "+e.attr("class")+" ").indexOf(t)}},o=function(t,e,n){return function(r){var o=arguments,i=o[o.length-2],a=i>0?e.charAt(i-1):"";if('"'===a)return r;if(">"===a){var u=e.lastIndexOf("<",i);if(-1!==u){var c=e.substring(u,i);if(-1!==c.indexOf('contenteditable="false"'))return r}}return'<span class="'+n+'" data-mce-content="'+t.dom.encode(o[0])+'">'+t.dom.encode("string"==typeof o[1]?o[1]:o[0])+"</span>"}},i=function(t){var i="contenteditable",a=" "+e.trim(function(t){return t.getParam("noneditable_editable_class","mceEditable")}(t))+" ",u=" "+e.trim(n(t))+" ",c=r(a),s=r(u),l=function(t){var e=t.getParam("noneditable_regexp",[]);return e&&e.constructor===RegExp?[e]:e}(t);t.on("PreInit",(function(){l.length>0&&t.on("BeforeSetContent",(function(e){!function(t,e,r){var i=e.length,a=r.content;if("raw"!==r.format){for(;i--;)a=a.replace(e[i],o(t,a,n(t)));r.content=a}}(t,l,e)})),t.parser.addAttributeFilter("class",(function(t){for(var e,n=t.length;n--;)e=t[n],c(e)?e.attr(i,"true"):s(e)&&e.attr(i,"false")})),t.serializer.addAttributeFilter(i,(function(t){for(var e,n=t.length;n--;)e=t[n],(c(e)||s(e))&&(l.length>0&&e.attr("data-mce-content")?(e.name="#text",e.type=3,e.raw=!0,e.value=e.attr("data-mce-content")):e.attr(i,null))}))}))};t.add("noneditable",(function(t){i(t)}))}()},1295:(t,e,n)=>{n(6834)},6834:()=>{!function(){"use strict";var t,e,n=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},a=function(t){return function(e){return typeof e===t}},u=i("string"),c=i("array"),s=a("boolean"),l=a("number"),f=function(){},d=function(t){return function(){return t}},m=function(t){return t},g=d(!1),h=d(!0),p=d("[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]"),v=function(){return b},b={fold:function(t,e){return t()},isSome:g,isNone:h,getOr:e=m,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:e,orThunk:t,map:v,each:f,bind:v,exists:g,forall:h,filter:function(){return v()},toArray:function(){return[]},toString:d("none()")},y=function(t){var e=d(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:h,isNone:g,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return y(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:b},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},w={some:y,none:v,from:function(t){return null==t?b:y(t)}},x=p,C=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=Array.prototype.slice,k=Array.prototype.push,T=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},O=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},E=function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}},_=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);k.apply(e,t[n])}return e}(T(t,e))},R=Object.hasOwnProperty,N=function(t,e){return R.call(t,e)};"undefined"!=typeof window?window:Function("return this;")();var A,D,M,B,z=(A=3,function(t){return function(t){return t.dom.nodeType}(t)===A}),P=function(t,e,n){!function(t,e,n){if(!(u(n)||s(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},L=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},I={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return L(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return L(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return L(n)},fromDom:L,fromPoint:function(t,e,n){return w.from(t.dom.elementFromPoint(e,n)).map(L)}},H=function(t,e){return{element:t,offset:e}},F=function(t,e){var n=function(t){return T(t.dom.childNodes,I.fromDom)}(t);return n.length>0&&e<n.length?H(n[e],0):H(t,e)},V=function(t,e){(function(t){return w.from(t.dom.parentNode).map(I.fromDom)})(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},j=function(t,e){V(t,e),function(t,e){t.dom.appendChild(e.dom)}(e,t)},U=(D=z,M="text",{get:function(t){if(!D(t))throw new Error("Can only get "+M+" value of a "+M+" node");return B(t).getOr("")},getOption:B=function(t){return D(t)?w.from(t.dom.nodeValue):w.none()},set:function(t,e){if(!D(t))throw new Error("Can only set raw "+M+" value of a "+M+" node");t.dom.nodeValue=e}}),W=function(t){return U.get(t)},q=function(t,e){return function(t,e){var n,r=void 0===e?document:e.dom;return 1!==(n=r).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:T(r.querySelectorAll(t),I.fromDom)}(e,t)},$=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),G=function(t,e){return t.isBlock(e)||N(t.schema.getShortEndedElements(),e.nodeName)},K=function(t,e){return"false"===t.getContentEditable(e)},X=function(t,e){return!t.isBlock(e)&&N(t.schema.getWhiteSpaceElements(),e.nodeName)},Y=function(t,e){return F(I.fromDom(t),e)},J=function(t,e,n,r,o,i){void 0===i&&(i=!0);for(var a=i?e(!1):n;a;){var u=K(t,a);if(u||X(t,a)){if(u?r.cef(a):r.boundary(a))break;a=e(!0)}else{if(G(t,a)){if(r.boundary(a))break}else 3===a.nodeType&&r.text(a);if(a===o)break;a=e(!1)}}},Q=function(t,e,n,r,o){if(!function(t,e){return G(t,e)||K(t,e)||X(t,e)||function(t,e){return"true"===t.getContentEditable(e)&&"false"===t.getContentEditableParent(e.parentNode)}(t,e)}(t,n)){var i=t.getParent(r,t.isBlock),a=new $(n,i),u=o?a.next.bind(a):a.prev.bind(a);J(t,u,n,{boundary:h,cef:h,text:function(t){o?e.fOffset+=t.length:e.sOffset+=t.length,e.elements.push(I.fromDom(t))}})}},Z=function(t,e,n,r,o,i){void 0===i&&(i=!0);var a=new $(n,e),u=[],c={sOffset:0,fOffset:0,elements:[]};Q(t,c,n,e,!1);var s=function(){return c.elements.length>0&&(u.push(c),c={sOffset:0,fOffset:0,elements:[]}),!1};return J(t,a.next.bind(a),n,{boundary:s,cef:function(t){return s(),o&&u.push.apply(u,o.cef(t)),!1},text:function(t){c.elements.push(I.fromDom(t)),o&&o.text(t,c)}},r,i),r&&Q(t,c,r,e,!0),s(),u},tt=function(t,e){var n=Y(e.startContainer,e.startOffset),r=n.element.dom,o=Y(e.endContainer,e.endOffset),i=o.element.dom;return Z(t,e.commonAncestorContainer,r,i,{text:function(t,e){t===i?e.fOffset+=t.length-o.offset:t===r&&(e.sOffset+=n.offset)},cef:function(e){var n,r,o,i=_(q(I.fromDom(e),"*[contenteditable=true]"),(function(e){var n=e.dom;return Z(t,n,n)}));return n=i,r=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_PRECEDING)}(t.elements[0].dom,e.elements[0].dom)?1:-1},(o=S.call(n,0)).sort(r),o}},!1)},et=function(t,e){return e.collapsed?[]:tt(t,e)},nt=function(t,e){var n=t.createRng();return n.selectNode(e),et(t,n)},rt=function(t,e){var n,r,o;return function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,a=t.length;i<a;i++){var u=t[i],c=e(u);c!==n&&(r.push(o),o=[]),n=c,o.push(u)}return 0!==o.length&&r.push(o),r}((n=t,r=function(t,n){var r=W(n),o=t.last,i=o+r.length,a=_(e,(function(t,e){return t.start<i&&t.finish>o?[{element:n,start:Math.max(o,t.start)-o,finish:Math.min(i,t.finish)-o,matchId:e}]:[]}));return{results:t.results.concat(a),last:i}},o={results:[],last:0},O(n,(function(t,e){o=r(o,t,e)})),o).results,(function(t){return t.matchId}))},ot=function(t,e){return _(e,(function(e){var n=e.elements,r=T(n,W).join(""),o=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=e.regex;o.lastIndex=n;for(var i,a=[];i=o.exec(t);){var u=i[e.matchIndex],c=i.index+i[0].indexOf(u),s=c+u.length;if(s>r)break;a.push({start:c,finish:s}),o.lastIndex=s}return a}(r,t,e.sOffset,r.length-e.fOffset);return rt(n,o)}))},it=function(t,e){E(t,(function(t,n){E(t,(function(t){var r=I.fromDom(e.cloneNode(!1));P(r,"data-mce-index",n);var o=t.element.dom;if(o.length===t.finish&&0===t.start)j(t.element,r);else{o.length!==t.finish&&o.splitText(t.finish);var i=o.splitText(t.start);j(I.fromDom(i),r)}}))}))},at=function(t,e,n,r){var o=n.getBookmark(),i=t.select("td[data-mce-selected],th[data-mce-selected]"),a=i.length>0?function(t,e){return _(e,(function(e){return nt(t,e)}))}(t,i):et(t,n.getRng()),u=ot(e,a);return it(u,r),n.moveToBookmark(o),u.length},ut=function(t){var e=t.getAttribute("data-mce-index");return"number"==typeof e?""+e:e},ct=function(t,e,n,r){var o=t.dom.create("span",{"data-mce-bogus":1});o.className="mce-match-marker";var i=t.getBody();return bt(t,e,!1),r?at(t.dom,n,t.selection,o):function(t,e,n,r){var o=nt(t,n),i=ot(e,o);return it(i,r),i.length}(t.dom,n,i,o)},st=function(t){var e=t.parentNode;t.firstChild&&e.insertBefore(t.firstChild,t),t.parentNode.removeChild(t)},lt=function(t,e){var n=[],r=C.toArray(t.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var i=ut(r[o]);null!==i&&i.length&&(i===e.toString()&&n.push(r[o]))}return n},ft=function(t,e,n){var r=e.get(),o=r.index,i=t.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,i.removeClass(lt(t,r.index),"mce-match-marker-selected");var a=lt(t,o);return a.length?(i.addClass(lt(t,o),"mce-match-marker-selected"),t.selection.scrollIntoView(a[0]),o):-1},dt=function(t,e){var n=e.parentNode;t.remove(e),t.isEmpty(n)&&t.remove(n)},mt=function(t,e,n,r,o,i){var a=function(t,e){var n="("+t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return e?"(?:^|\\s|"+x()+")"+n+"(?=$|\\s|"+x()+")":n}(n,o),u={regex:new RegExp(a,r?"g":"gi"),matchIndex:1},c=ct(t,e,u,i);if(c){var s=ft(t,e,!0);e.set({index:s,count:c,text:n,matchCase:r,wholeWord:o,inSelection:i})}return c},gt=function(t,e){var n=ft(t,e,!0);e.set(o(o({},e.get()),{index:n}))},ht=function(t,e){var n=ft(t,e,!1);e.set(o(o({},e.get()),{index:n}))},pt=function(t){var e=ut(t);return null!==e&&e.length>0},vt=function(t,e,n,r,i){var a,u=e.get(),c=u.index,s=c;r=!1!==r;for(var l=t.getBody(),f=C.grep(C.toArray(l.getElementsByTagName("span")),pt),d=0;d<f.length;d++){var m=ut(f[d]),g=a=parseInt(m,10);if(i||g===u.index){for(n.length?(f[d].firstChild.nodeValue=n,st(f[d])):dt(t.dom,f[d]);f[++d];){if((g=parseInt(ut(f[d]),10))!==a){d--;break}dt(t.dom,f[d])}r&&s--}else a>c&&f[d].setAttribute("data-mce-index",String(a-1))}return e.set(o(o({},u),{count:i?0:u.count-1,index:s})),r?gt(t,e):ht(t,e),!i&&e.get().count>0},bt=function(t,e,n){for(var r,i,a=e.get(),u=C.toArray(t.getBody().getElementsByTagName("span")),c=0;c<u.length;c++){var s=ut(u[c]);null!==s&&s.length&&(s===a.index.toString()&&(r||(r=u[c].firstChild),i=u[c].firstChild),st(u[c]))}if(e.set(o(o({},a),{index:-1,count:0,text:""})),r&&i){var l=t.dom.createRng();return l.setStart(r,0),l.setEnd(i,i.data.length),!1!==n&&t.selection.setRng(l),l}},yt=function(){var t=function(t){var e=n(w.none()),r=function(){return e.get().each(t)};return{clear:function(){r(),e.set(w.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){r(),e.set(w.some(t))}}}(f);return o(o({},t),{on:function(e){return t.get().each(e)}})},wt=tinymce.util.Tools.resolve("tinymce.Env"),xt=function(t,e){var n=yt();t.undoManager.add();var r=C.trim(t.selection.getContent({format:"text"})),i=function(t){(function(t,e){return e.get().count>1}(0,e)?t.enable:t.disable)("next"),(function(t,e){return e.get().count>1}(0,e)?t.enable:t.disable)("prev")},a=function(t,e){var n=e?t.disable:t.enable;O(["replace","replaceall","prev","next"],n)},u=function(t,e){wt.browser.isSafari()&&wt.deviceType.isTouch()&&("find"===e||"replace"===e||"replaceall"===e)&&t.focus(e)},c=function(n){bt(t,e,!1),a(n,!0),i(n)},s=function(n){var r=n.getData(),o=e.get();if(r.findtext.length){if(o.text===r.findtext&&o.matchCase===r.matchcase&&o.wholeWord===r.wholewords)gt(t,e);else{var u=mt(t,e,r.findtext,r.matchcase,r.wholewords,r.inselection);u<=0&&function(e){t.windowManager.alert("Could not find the specified string.",(function(){e.focus("findtext")}))}(n),a(n,0===u)}i(n)}else c(n)},l=e.get(),f={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace all",disabled:!0}],initialData:{findtext:r,replacetext:"",wholewords:l.wholeWord,matchcase:l.matchCase,inselection:l.inSelection},onChange:function(t,n){"findtext"===n.name&&e.get().count>0&&c(t)},onAction:function(n,r){var a=n.getData();switch(r.name){case"find":s(n);break;case"replace":vt(t,e,a.replacetext)?i(n):c(n);break;case"replaceall":vt(t,e,a.replacetext,!0,!0),c(n);break;case"prev":ht(t,e),i(n);break;case"next":gt(t,e),i(n);break;case"matchcase":case"wholewords":case"inselection":!function(t){var n=t.getData(),r=e.get();e.set(o(o({},r),{matchCase:n.matchcase,wholeWord:n.wholewords,inSelection:n.inselection}))}(n),c(n)}u(n,r.name)},onSubmit:function(t){s(t),u(t,"find")},onClose:function(){t.focus(),bt(t,e),t.undoManager.add()}};n.set(t.windowManager.open(f,{inline:"toolbar"}))},Ct=function(t,e){return function(){xt(t,e)}};r.add("searchreplace",(function(t){var e=n({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return function(t,e){t.addCommand("SearchReplace",(function(){xt(t,e)}))}(t,e),function(t,e){t.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:Ct(t,e),icon:"search"}),t.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:Ct(t,e),icon:"search"}),t.shortcuts.add("Meta+F","",Ct(t,e))}(t,e),function(t,e){return{done:function(n){return bt(t,e,n)},find:function(n,r,o,i){return void 0===i&&(i=!1),mt(t,e,n,r,o,i)},next:function(){return gt(t,e)},prev:function(){return ht(t,e)},replace:function(n,r,o){return vt(t,e,n,r,o)}}}(t,e)}))}()},8619:(t,e,n)=>{n(2590)},2590:()=>{!function(){"use strict";var t=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},e=function(t){return function(e){return typeof e===t}},n=function(t){return function(e){return t===e}},r=t("string"),o=t("object"),i=t("array"),a=n(null),u=e("boolean"),c=n(void 0),s=function(t){return!function(t){return null==t}(t)},l=e("function"),f=e("number"),d=function(){},m=function(t){return function(){return t}},g=function(t){return t},h=function(t,e){return t===e};function p(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var v,b,y=function(t){return function(e){return!t(e)}},w=m(!1),x=m(!0),C=function(){return S},S={fold:function(t,e){return t()},isSome:w,isNone:x,getOr:b=g,getOrThunk:v=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(void 0),or:b,orThunk:v,map:C,each:d,bind:C,exists:w,forall:x,filter:function(){return C()},toArray:function(){return[]},toString:m("none()")},k=function(t){var e=m(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:x,isNone:w,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return k(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:S},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},T={some:k,none:C,from:function(t){return null==t?S:k(t)}},O=Array.prototype.slice,E=Array.prototype.indexOf,_=Array.prototype.push,R=function(t,e){return n=t,r=e,E.call(n,r)>-1;var n,r},N=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},A=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},D=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},M=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},B=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var a=t[o];(e(a,o)?n:r).push(a)}return{pass:n,fail:r}},z=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},P=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,(function(t,r){n=e(n,t,r)})),n},L=function(t,e,n){return M(t,(function(t,r){n=e(n,t,r)})),n},I=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return T.some(i);if(n(i,r))break}return T.none()}(t,e,w)},H=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return T.some(n)}return T.none()},F=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!i(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);_.apply(e,t[n])}return e},V=function(t,e){return F(D(t,e))},j=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},U=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},W=function(t){return[t]},q=function(t,e){return e>=0&&e<t.length?T.some(t[e]):T.none()},$=function(t){return q(t,0)},G=function(t){return q(t,t.length-1)},K=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return T.none()},X=function(){return(X=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Y(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var J=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Q=function(){return Z(0,0)},Z=function(t,e){return{major:t,minor:e}},tt={nu:Z,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Q():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Z(r(1),r(2))}(t,n)},unknown:Q},et=function(t,e){var n=String(e).toLowerCase();return I(t,(function(t){return t.search(n)}))},nt=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},rt=function(t,e){return-1!==t.indexOf(e)},ot=function(t,e){return nt(t,e,0)},it=function(t,e){return nt(t,e,t.length-e.length)},at=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),ut=function(t){return t.length>0},ct=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,st=function(t){return function(e){return rt(e,t)}},lt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return rt(t,"edge/")&&rt(t,"chrome")&&rt(t,"safari")&&rt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ct],search:function(t){return rt(t,"chrome")&&!rt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return rt(t,"msie")||rt(t,"trident")}},{name:"Opera",versionRegexes:[ct,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:st("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:st("firefox")},{name:"Safari",versionRegexes:[ct,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(rt(t,"safari")||rt(t,"mobile/"))&&rt(t,"applewebkit")}}],ft=[{name:"Windows",search:st("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return rt(t,"iphone")||rt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:st("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:st("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:st("linux"),versionRegexes:[]},{name:"Solaris",search:st("sunos"),versionRegexes:[]},{name:"FreeBSD",search:st("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:st("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],dt={browsers:m(lt),oses:m(ft)},mt="Edge",gt="Chrome",ht="Opera",pt="Firefox",vt="Safari",bt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(mt),isChrome:r(gt),isIE:r("IE"),isOpera:r(ht),isFirefox:r(pt),isSafari:r(vt)}},yt={unknown:function(){return bt({current:void 0,version:tt.unknown()})},nu:bt,edge:m(mt),chrome:m(gt),ie:m("IE"),opera:m(ht),firefox:m(pt),safari:m(vt)},wt="Windows",xt="Android",Ct="Linux",St="Solaris",kt="FreeBSD",Tt="ChromeOS",Ot=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(wt),isiOS:r("iOS"),isAndroid:r(xt),isOSX:r("OSX"),isLinux:r(Ct),isSolaris:r(St),isFreeBSD:r(kt),isChromeOS:r(Tt)}},Et={unknown:function(){return Ot({current:void 0,version:tt.unknown()})},nu:Ot,windows:m(wt),ios:m("iOS"),android:m(xt),linux:m(Ct),osx:m("OSX"),solaris:m(St),freebsd:m(kt),chromeos:m(Tt)},_t=function(t,e,n){var r=dt.browsers(),o=dt.oses(),i=e.bind((function(t){return function(t,e){return K(e.brands,(function(e){var n=e.brand.toLowerCase();return I(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:tt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return et(t,e).map((function(t){var n=tt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(yt.unknown,yt.nu),a=function(t,e){return et(t,e).map((function(t){var n=tt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(Et.unknown,Et.nu),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:m(o),isiPhone:m(i),isTablet:m(c),isPhone:m(s),isTouch:m(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:m(l),isDesktop:m(f)}}(a,i,t,n);return{browser:i,os:a,deviceType:u}},Rt=function(t){return window.matchMedia(t).matches},Nt=J((function(){return _t(navigator.userAgent,T.from(navigator.userAgentData),Rt)})),At=function(){return Nt()},Dt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Mt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Dt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Dt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Dt(n)},fromDom:Dt,fromPoint:function(t,e,n){return T.from(t.dom.elementFromPoint(e,n)).map(Dt)}},Bt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},zt=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Pt=function(t,e){var n=void 0===e?document:e.dom;return zt(n)?T.none():T.from(n.querySelector(t)).map(Mt.fromDom)},Lt=function(t,e){return t.dom===e.dom},It=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},Ht=function(t,e){return At().browser.isIE()?It(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Ft=Bt,Vt=Object.keys,jt=Object.hasOwnProperty,Ut=function(t,e){for(var n=Vt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Wt=function(t,e){return qt(t,(function(t,n){return{k:n,v:e(t,n)}}))},qt=function(t,e){var n={};return Ut(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},$t=function(t,e){var n={};return function(t,e,n,r){Ut(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),d),n},Gt=function(t,e){var n=[];return Ut(t,(function(t,r){n.push(e(t,r))})),n},Kt=function(t){return Gt(t,g)},Xt=function(t){return Vt(t).length},Yt=function(t,e){return Jt(t,e)?T.from(t[e]):T.none()},Jt=function(t,e){return jt.call(t,e)},Qt=function(t,e){return Jt(t,e)&&void 0!==t[e]&&null!==t[e]},Zt=["tfoot","thead","tbody","colgroup"],te=function(t,e,n){return{element:t,rowspan:e,colspan:n}},ee=function(t,e,n){return{element:t,cells:e,section:n}},ne=function(t,e,n){return{element:t,isNew:e,isLocked:n}},re=function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}};"undefined"!=typeof window?window:Function("return this;")();var oe=function(t){return t.dom.nodeName.toLowerCase()},ie=function(t){return t.dom.nodeType},ae=function(t){return function(e){return ie(e)===t}},ue=function(t){return 8===ie(t)||"#comment"===oe(t)},ce=ae(1),se=ae(3),le=ae(9),fe=ae(11),de=function(t){return function(e){return ce(e)&&oe(e)===t}},me=function(t){return Mt.fromDom(t.dom.ownerDocument)},ge=function(t){return le(t)?t:me(t)},he=function(t){return T.from(t.dom.parentNode).map(Mt.fromDom)},pe=function(t,e){for(var n=l(e)?e:w,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=Mt.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o},ve=function(t){return T.from(t.dom.previousSibling).map(Mt.fromDom)},be=function(t){return T.from(t.dom.nextSibling).map(Mt.fromDom)},ye=function(t){return D(t.dom.childNodes,Mt.fromDom)},we=function(t,e){var n=t.dom.childNodes;return T.from(n[e]).map(Mt.fromDom)},xe=l(Element.prototype.attachShadow)&&l(Node.prototype.getRootNode),Ce=m(xe),Se=xe?function(t){return Mt.fromDom(t.dom.getRootNode())}:ge,ke=function(t){var e,n=Se(t);return fe(e=n)&&s(e.dom.host)?T.some(n):T.none()},Te=function(t){return Mt.fromDom(t.dom.host)},Oe=function(t){return s(t.dom.shadowRoot)},Ee=function(t){var e=se(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return ke(Mt.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=Ee,r=Te,function(t){return n(r(t))}))},_e=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return Mt.fromDom(e)},Re=function(t,e){var n=[];return M(ye(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(Re(t,e))})),n},Ne=function(t,e,n){return function(t,e,n){return z(pe(t,n),e)}(t,(function(t){return Bt(t,e)}),n)},Ae=function(t,e){return function(t,e){return z(ye(t),e)}(t,(function(t){return Bt(t,e)}))},De=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return zt(n)?[]:D(n.querySelectorAll(t),Mt.fromDom)}(e,t)};function Me(t,e,n,r,o){return t(n,r)?T.some(n):l(o)&&o(n)?T.none():e(n,r,o)}var Be=function(t,e,n){for(var r=t.dom,o=l(n)?n:w;r.parentNode;){r=r.parentNode;var i=Mt.fromDom(r);if(e(i))return T.some(i);if(o(i))break}return T.none()},ze=function(t,e,n){return Be(t,(function(t){return Bt(t,e)}),n)},Pe=function(t,e){return function(t,e){return I(t.dom.childNodes,(function(t){return e(Mt.fromDom(t))})).map(Mt.fromDom)}(t,(function(t){return Bt(t,e)}))},Le=function(t,e){return Pt(e,t)},Ie=function(t,e,n){return Me((function(t,e){return Bt(t,e)}),ze,t,e,n)},He=function(t,e,n){if(!(r(n)||u(n)||f(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Fe=function(t,e,n){He(t.dom,e,n)},Ve=function(t,e){var n=t.dom;Ut(e,(function(t,e){He(n,e,t)}))},je=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Ue=function(t,e){return T.from(je(t,e))},We=function(t,e){t.dom.removeAttribute(e)},qe=function(t){return L(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},$e=function(t,e,n){return void 0===n&&(n=h),t.exists((function(t){return n(t,e)}))},Ge=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},Ke=function(t,e,n){return t.isSome()&&e.isSome()?T.some(n(t.getOrDie(),e.getOrDie())):T.none()},Xe=function(t,e){return t?T.some(e):T.none()},Ye=function(t){return void 0!==t.style&&l(t.style.getPropertyValue)},Je=function(t,e,n){if(!r(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Ye(t)&&t.style.setProperty(e,n)},Qe=function(t,e,n){var r=t.dom;Je(r,e,n)},Ze=function(t,e){var n=t.dom;Ut(e,(function(t,e){Je(n,e,t)}))},tn=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Ee(t)?r:en(n,e)},en=function(t,e){return Ye(t)?t.style.getPropertyValue(e):""},nn=function(t,e){var n=t.dom,r=en(n,e);return T.from(r).filter((function(t){return t.length>0}))},rn=function(t,e){!function(t,e){Ye(t)&&t.style.removeProperty(e)}(t.dom,e),$e(Ue(t,"style").map(at),"")&&We(t,"style")},on=function(t,e,n){return void 0===n&&(n=0),Ue(t,e).map((function(t){return parseInt(t,10)})).getOr(n)},an=function(t,e){return on(t,e,1)},un=function(t){return de("col")(t)?on(t,"span",1)>1:an(t,"colspan")>1},cn=function(t){return an(t,"rowspan")>1},sn=function(t,e){return parseInt(tn(t,e),10)},ln=m(10),fn=m(10),dn=function(t,e){return mn(t,e,x)},mn=function(t,e,n){return V(ye(t),(function(t){return Bt(t,e)?n(t)?[t]:[]:mn(t,e,n)}))},gn=function(t,e){return function(t,e,n){return void 0===n&&(n=w),n(e)?T.none():R(t,oe(e))?T.some(e):ze(e,t.join(","),(function(t){return Bt(t,"table")||n(t)}))}(["td","th"],t,e)},hn=function(t){return dn(t,"th,td")},pn=function(t){return Bt(t,"colgroup")?Ae(t,"col"):V(yn(t),(function(t){return Ae(t,"col")}))},vn=function(t,e){return Ie(t,"table",e)},bn=function(t){return dn(t,"tr")},yn=function(t){return vn(t).fold(m([]),(function(t){return Ae(t,"colgroup")}))},wn=function(t,e){return D(t,(function(t){if("colgroup"===oe(t)){var n=D(pn(t),(function(t){var e=on(t,"span",1);return te(t,1,e)}));return ee(t,n,"colgroup")}n=D(hn(t),(function(t){var e=on(t,"rowspan",1),n=on(t,"colspan",1);return te(t,e,n)}));return ee(t,n,e(t))}))},xn=function(t){return he(t).map((function(t){var e=oe(t);return function(t){return R(Zt,t)}(e)?e:"tbody"})).getOr("tbody")},Cn=function(t){var e=bn(t),n=Y(Y([],yn(t),!0),e,!0);return wn(n,xn)},Sn=function(t,e,n){var r=t.cells,o=r.slice(0,e),i=r.slice(e),a=o.concat(n).concat(i);return On(t,a)},kn=function(t,e,n){return Sn(t,e,[n])},Tn=function(t,e,n){t.cells[e]=n},On=function(t,e){return re(t.element,e,t.section,t.isNew)},En=function(t,e){return t.cells[e]},_n=function(t,e){return En(t,e).element},Rn=function(t){return t.cells.length},Nn=function(t){var e=B(t,(function(t){return"colgroup"===t.section}));return{rows:e.fail,cols:e.pass}},An=function(t,e,n){var r=D(t.cells,n);return re(e(t.element),r,t.section,!0)},Dn="data-snooker-locked-cols",Mn=function(t){return Ue(t,Dn).bind((function(t){return T.from(t.match(/\d+/g))})).map((function(t){return U(t,x)}))},Bn=function(t){var e=L(Nn(t).rows,(function(t,e){return M(e.cells,(function(e,n){e.isLocked&&(t[n]=!0)})),t}),{});return function(t,e){var n=O.call(t,0);return n.sort(e),n}(Gt(e,(function(t,e){return parseInt(e,10)})))},zn=function(t,e){return t+","+e},Pn=function(t,e){var n=V(t.all,(function(t){return t.cells}));return z(n,e)},Ln=function(t){var e={},n=[],r=$(t).map((function(t){return t.element})).bind(vn).bind(Mn).getOr({}),o=0,i=0,a=0,u=B(t,(function(t){return"colgroup"===t.section})),c=u.pass,s=u.fail;M(s,(function(t){var u=[];M(t.cells,(function(t){for(var n=0;void 0!==e[zn(a,n)];)n++;for(var o=Qt(r,n.toString()),c=function(t,e,n,r,o,i){return{element:t,rowspan:e,colspan:n,row:r,column:o,isLocked:i}}(t.element,t.rowspan,t.colspan,a,n,o),s=0;s<t.colspan;s++)for(var l=0;l<t.rowspan;l++){var f=n+s,d=zn(a+l,f);e[d]=c,i=Math.max(i,f+1)}u.push(c)})),o++,n.push(ee(t.element,u,t.section)),a++}));var l=G(c).map((function(t){var e=function(t){var e={},n=0;return M(t.cells,(function(t){var r=t.colspan;A(r,(function(o){var i=n+o;e[i]=function(t,e,n){return{element:t,colspan:e,column:n}}(t.element,r,i)})),n+=r})),e}(t);return{colgroups:[function(t,e){return{element:t,columns:e}}(t.element,Kt(e))],columns:e}})).getOrThunk((function(){return{colgroups:[],columns:{}}})),f=l.columns,d=l.colgroups;return{grid:function(t,e){return{rows:t,columns:e}}(o,i),access:e,all:n,columns:f,colgroups:d}},In={fromTable:function(t){var e=Cn(t);return Ln(e)},generate:Ln,getAt:function(t,e,n){return T.from(t.access[zn(e,n)])},findItem:function(t,e,n){var r=Pn(t,(function(t){return n(e,t.element)}));return r.length>0?T.some(r[0]):T.none()},filterItems:Pn,justCells:function(t){return V(t.all,(function(t){return t.cells}))},justColumns:function(t){return Kt(t.columns)},hasColumns:function(t){return Vt(t.columns).length>0},getColumnAt:function(t,e){return T.from(t.columns[e])}},Hn=function(t,e){var n=e.column,r=e.column+e.colspan-1,o=e.row,i=e.row+e.rowspan-1;return n<=t.finishCol&&r>=t.startCol&&o<=t.finishRow&&i>=t.startRow},Fn=function(t,e){return e.column>=t.startCol&&e.column+e.colspan-1<=t.finishCol&&e.row>=t.startRow&&e.row+e.rowspan-1<=t.finishRow},Vn=function(t,e,n){var r=In.findItem(t,e,Lt),o=In.findItem(t,n,Lt);return r.bind((function(t){return o.map((function(e){return n=t,r=e,o=Math.min(n.row,r.row),i=Math.min(n.column,r.column),a=Math.max(n.row+n.rowspan-1,r.row+r.rowspan-1),u=Math.max(n.column+n.colspan-1,r.column+r.colspan-1),{startRow:o,startCol:i,finishRow:a,finishCol:u};var n,r,o,i,a,u}))}))},jn=function(t,e,n){return Vn(t,e,n).bind((function(e){return function(t,e){for(var n=!0,r=p(Fn,e),o=e.startRow;o<=e.finishRow;o++)for(var i=e.startCol;i<=e.finishCol;i++)n=n&&In.getAt(t,o,i).exists(r);return n?T.some(e):T.none()}(t,e)}))},Un=function(t,e,n){return Vn(t,e,n).map((function(e){var n=In.filterItems(t,p(Hn,e));return D(n,(function(t){return t.element}))}))},Wn=function(t,e){return In.findItem(t,e,(function(t,e){return Ht(e,t)})).map((function(t){return t.element}))},qn=function(t,e,n){return vn(t).bind((function(r){return function(t,e,n,r){return In.findItem(t,e,Lt).bind((function(e){var o=n>0?e.row+e.rowspan-1:e.row,i=r>0?e.column+e.colspan-1:e.column;return In.getAt(t,o+n,i+r).map((function(t){return t.element}))}))}(Kn(r),t,e,n)}))},$n=function(t,e,n){var r=Kn(t);return Un(r,e,n)},Gn=function(t,e,n,r,o){var i=Kn(t),a=Lt(t,n)?T.some(e):Wn(i,e),u=Lt(t,o)?T.some(r):Wn(i,r);return a.bind((function(t){return u.bind((function(e){return Un(i,t,e)}))}))},Kn=In.fromTable,Xn=function(t,e){he(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Yn=function(t,e){be(t).fold((function(){he(t).each((function(t){Qn(t,e)}))}),(function(t){Xn(t,e)}))},Jn=function(t,e){(function(t){return we(t,0)})(t).fold((function(){Qn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Qn=function(t,e){t.dom.appendChild(e.dom)},Zn=function(t,e){Xn(t,e),Qn(e,t)},tr=function(t,e){M(e,(function(n,r){var o=0===r?t:e[r-1];Yn(o,n)}))},er=function(t,e){M(e,(function(e){Qn(t,e)}))},nr=function(t){t.dom.textContent="",M(ye(t),(function(t){rr(t)}))},rr=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},or=function(t){var e,n=ye(t);n.length>0&&(e=t,M(n,(function(t){Xn(e,t)}))),rr(t)},ir=function(t,e){var n=function(e){return t(e)?T.from(e.dom.nodeValue):T.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(se,"text"),ar=function(t){return ir.get(t)},ur=function(t){return ir.getOption(t)},cr=function(t,e){return ir.set(t,e)},sr=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function lr(){return{up:m({selector:ze,closest:Ie,predicate:Be,all:pe}),down:m({selector:De,predicate:Re}),styles:m({get:tn,getRaw:nn,set:Qe,remove:rn}),attrs:m({get:je,set:Fe,remove:We,copyTo:function(t,e){var n=qe(t);Ve(e,n)}}),insert:m({before:Xn,after:Yn,afterAll:tr,append:Qn,appendAll:er,prepend:Jn,wrap:Zn}),remove:m({unwrap:or,remove:rr}),create:m({nu:Mt.fromTag,clone:function(t){return Mt.fromDom(t.dom.cloneNode(!1))},text:Mt.fromText}),query:m({comparePosition:function(t,e){return t.dom.compareDocumentPosition(e.dom)},prevSibling:ve,nextSibling:be}),property:m({children:ye,name:oe,parent:he,document:function(t){return ge(t).dom},isText:se,isComment:ue,isElement:ce,isSpecial:function(t){var e=oe(t);return R(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],e)},getLanguage:function(t){return ce(t)?Ue(t,"lang"):T.none()},getText:ar,setText:cr,isBoundary:function(t){return!!ce(t)&&("body"===oe(t)||R(sr,oe(t)))},isEmptyTag:function(t){return!!ce(t)&&R(["br","img","hr","input"],oe(t))},isNonEditable:function(t){return ce(t)&&"false"===je(t,"contenteditable")}}),eq:Lt,is:Ft}}var fr,dr,mr,gr,hr=function(t,e,n,r){var o=e(t,n);return P(r,(function(n,r){var o=e(t,r);return pr(t,n,o)}),o)},pr=function(t,e,n){return e.bind((function(e){return n.filter(p(t.eq,e))}))},vr=function(t,e,n){return n.length>0?function(t,e,n,r){return r(t,e,n[0],n.slice(1))}(t,e,n,hr):T.none()},br=function(t,e,n,r){void 0===r&&(r=w);var o=[e].concat(t.up().all(e)),i=[n].concat(t.up().all(n)),a=function(t){return H(t,r).fold((function(){return t}),(function(e){return t.slice(0,e+1)}))},u=a(o),c=a(i),s=I(u,(function(e){return N(c,function(t,e){return p(t.eq,e)}(t,e))}));return{firstpath:u,secondpath:c,shared:s}},yr=lr(),wr=function(t,e){return vr(yr,(function(e,n){return t(n)}),e)},xr=function(t){return ze(t,"table")},Cr=function(t,e,n){var r=function(t){return function(e){return void 0!==n&&n(e)||Lt(e,t)}};return Lt(t,e)?T.some({boxes:T.some([t]),start:t,finish:e}):xr(t).bind((function(o){return xr(e).bind((function(i){if(Lt(o,i))return T.some({boxes:$n(o,t,e),start:t,finish:e});if(Ht(o,i)){var a=(u=Ne(e,"td,th",r(o))).length>0?u[u.length-1]:e;return T.some({boxes:Gn(o,t,o,e,i),start:t,finish:a})}if(Ht(i,o)){var u,c=(u=Ne(t,"td,th",r(i))).length>0?u[u.length-1]:t;return T.some({boxes:Gn(i,t,o,e,i),start:t,finish:c})}return function(t,e,n){return br(yr,t,e,n)}(t,e).shared.bind((function(a){return Ie(a,"table",n).bind((function(n){var a=Ne(e,"td,th",r(n)),u=a.length>0?a[a.length-1]:e,c=Ne(t,"td,th",r(n)),s=c.length>0?c[c.length-1]:t;return T.some({boxes:Gn(n,t,o,e,i),start:s,finish:u})}))}))}))}))},Sr=function(t,e){var n=De(t,e);return n.length>0?T.some(n):T.none()},kr=function(t,e,n){return Le(t,e).bind((function(e){return Le(t,n).bind((function(t){return wr(xr,[e,t]).map((function(n){return{first:e,last:t,table:n}}))}))}))},Tr=function(t,e,n,r,o){return function(t,e){return I(t,(function(t){return Bt(t,e)}))}(t,o).bind((function(t){return qn(t,e,n).bind((function(t){return function(t,e){return ze(t,"table").bind((function(n){return Le(n,e).bind((function(e){return Cr(e,t).bind((function(t){return t.boxes.map((function(e){return{boxes:e,start:t.start,finish:t.finish}}))}))}))}))}(t,r)}))}))},Or=function(t,e){return Sr(t,e)},Er=function(t,e,n){return kr(t,e,n).bind((function(e){var n=function(e){return Lt(t,e)},r="thead,tfoot,tbody,table",o=ze(e.first,r,n),i=ze(e.last,r,n);return o.bind((function(t){return i.bind((function(n){return Lt(t,n)?function(t,e,n){var r=Kn(t);return jn(r,e,n)}(e.table,e.first,e.last):T.none()}))}))}))},_r=function(t){if(!i(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return M(t,(function(r,o){var a=Vt(r);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],c=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!i(c))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+c.length+" ("+c+"), got "+i);var a=function(t){var r=Vt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!j(e,(function(t){return R(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:a,log:function(t){console.log(t,{constructors:e,constructor:u,params:n})}}}})),n},Rr=_r([{none:[]},{multiple:["elements"]},{single:["element"]}]),Nr=function(t,e,n,r){return t.fold(e,n,r)},Ar=Rr.none,Dr=Rr.multiple,Mr=Rr.single,Br=tinymce.util.Tools.resolve("tinymce.PluginManager"),zr=function(t,e){return Mt.fromDom(t.dom.cloneNode(e))},Pr=function(t){return zr(t,!1)},Lr=function(t){return zr(t,!0)},Ir=function(t,e){var n=Mt.fromTag(e),r=qe(t);return Ve(n,r),n},Hr=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=tn(n,t);return parseFloat(o)||0}return r},r=function(t,e){return L(e,(function(e,n){var r=tn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!f(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Ye(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},Fr=function(){var t=At().browser;return t.isIE()||t.isEdge()},Vr=function(t,e){return function(t){var e=parseFloat(t);return isNaN(e)?T.none():T.some(e)}(t).getOr(e)},jr=function(t,e,n){return Vr(tn(t,e),n)},Ur=function(t){return tn(t,"box-sizing")},Wr=function(t,e,n,r){return e-jr(t,"padding-"+n,0)-jr(t,"padding-"+r,0)-jr(t,"border-"+n+"-width",0)-jr(t,"border-"+r+"-width",0)},qr=function(t,e){var n=t.dom,r=n.getBoundingClientRect().width||n.offsetWidth;return"border-box"===e?r:Wr(t,r,"left","right")},$r=Hr("width",(function(t){return t.dom.offsetWidth})),Gr=function(t){return $r.get(t)},Kr=function(t){return $r.getOuter(t)},Xr=function(t){return qr(t,"content-box")},Yr=function(t){return Fr()?qr(t,Ur(t)):jr(t,"width",t.dom.offsetWidth)},Jr=function(t,e){void 0===e&&(e=x);var n=t.grid,r=A(n.columns,g),o=A(n.rows,g);return D(r,(function(n){return Qr((function(){return V(o,(function(e){return In.getAt(t,e,n).filter((function(t){return t.column===n})).toArray()}))}),(function(t){return 1===t.colspan&&e(t.element)}),(function(){return In.getAt(t,0,n)}))}))},Qr=function(t,e,n){var r=t();return I(r,e).orThunk((function(){return T.from(r[0]).orThunk(n)})).map((function(t){return t.element}))},Zr=function(t){var e=t.grid,n=A(e.rows,g),r=A(e.columns,g);return D(n,(function(e){return Qr((function(){return V(r,(function(n){return In.getAt(t,e,n).filter((function(t){return t.row===e})).fold(m([]),(function(t){return[t]}))}))}),(function(t){return 1===t.rowspan}),(function(){return In.getAt(t,e,0)}))}))},to=function(t,e){if(e<0||e>=t.length-1)return T.none();var n=t[e].fold((function(){var n=function(t){var e=O.call(t,0);return e.reverse(),e}(t.slice(0,e));return K(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return T.some({value:t,delta:0})})),r=t[e+1].fold((function(){var n=t.slice(e+1);return K(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return T.some({value:t,delta:1})}));return n.bind((function(t){return r.map((function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n}))}))},eo=function(t,e){return function(n){return"rtl"===no(n)?e:t}},no=function(t){return"rtl"===tn(t,"direction")?"rtl":"ltr"},ro=Hr("height",(function(t){var e=t.dom;return Ee(t)?e.getBoundingClientRect().height:e.offsetHeight})),oo=function(t){return ro.get(t)},io=function(t){return ro.getOuter(t)},ao=function(t){return Fr()?function(t,e){var n=t.dom,r=n.getBoundingClientRect().height||n.offsetHeight;return"border-box"===e?r:Wr(t,r,"top","bottom")}(t,Ur(t)):jr(t,"height",t.dom.offsetHeight)},uo=function(t,e){return{left:t,top:e,translate:function(n,r){return uo(t+n,e+r)}}},co=uo,so=function(t,e){return void 0!==t?t:void 0!==e?e:0},lo=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return co(n.offsetLeft,n.offsetTop);var i=so(null==r?void 0:r.pageYOffset,o.scrollTop),a=so(null==r?void 0:r.pageXOffset,o.scrollLeft),u=so(o.clientTop,n.clientTop),c=so(o.clientLeft,n.clientLeft);return fo(t).translate(a-c,i-u)},fo=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?co(n.offsetLeft,n.offsetTop):Ee(t)?function(t){var e=t.getBoundingClientRect();return co(e.left,e.top)}(e):co(0,0)},mo=function(t,e){return{row:t,y:e}},go=function(t,e){return{col:t,x:e}},ho=function(t){return lo(t).left+Kr(t)},po=function(t){return lo(t).left},vo=function(t,e){return go(t,po(e))},bo=function(t,e){return go(t,ho(e))},yo=function(t){return lo(t).top},wo=function(t,e){return mo(t,yo(e))},xo=function(t,e){return mo(t,yo(e)+io(e))},Co=function(t,e,n){if(0===n.length)return[];var r=D(n.slice(1),(function(e,n){return e.map((function(e){return t(n,e)}))})),o=n[n.length-1].map((function(t){return e(n.length-1,t)}));return r.concat([o])},So={delta:g,positions:function(t){return Co(wo,xo,t)},edge:yo},ko={delta:g,edge:po,positions:function(t){return Co(vo,bo,t)}},To={delta:function(t){return-t},edge:ho,positions:function(t){return Co(bo,vo,t)}},Oo=eo(ko,To),Eo={delta:function(t,e){return Oo(e).delta(t,e)},positions:function(t,e){return Oo(e).positions(t,e)},edge:function(t){return Oo(t).edge(t)}},_o={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Ro=(fr="[0-9]+",dr="[eE][+-]?[0-9]+",mr=function(t){return"(?:"+t+")?"},gr=["Infinity","[0-9]+\\."+mr(fr)+mr(dr),"\\.[0-9]+"+mr(dr),fr+mr(dr)].join("|"),new RegExp("^([+-]?(?:"+gr+"))(.*)$")),No=function(t,e){return T.from(Ro.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return N(e,(function(e){return N(_o[e],(function(e){return t===e}))}))}(r,e)?T.some({value:n,unit:r}):T.none()}))},Ao=/(\d+(\.\d+)?)%/,Do=/(\d+(\.\d+)?)px|em/,Mo=de("col"),Bo=function(t,e,n){var r,o=(r=t,T.from(r.dom.parentElement).map(Mt.fromDom)).getOrThunk((function(){return _e(me(t))}));return e(t)/n(o)*100},zo=function(t,e){Qe(t,"width",e+"px")},Po=function(t,e){Qe(t,"width",e+"%")},Lo=function(t,e){Qe(t,"height",e+"px")},Io=function(t,e,n,r){var o=parseFloat(t);return it(t,"%")&&"table"!==oe(e)?function(t,e,n,r){var o=vn(t).map((function(t){var r=n(t);return Math.floor(e/100*r)})).getOr(e);return r(t,o),o}(e,o,n,r):o},Ho=function(t){var e=function(t){return ao(t)+"px"}(t);return e?Io(e,t,oo,Lo):oo(t)},Fo=function(t,e){return nn(t,e).orThunk((function(){return Ue(t,e).map((function(t){return t+"px"}))}))},Vo=function(t){return Fo(t,"width")},jo=function(t){return Bo(t,Gr,Xr)},Uo=function(t){return Mo(t)?Gr(t):Yr(t)},Wo=function(t){return function(t,e,n){return n(t)/an(t,e)}(t,"rowspan",Ho)},qo=function(t,e,n){Qe(t,"width",e+n)},$o=function(t){return Bo(t,Gr,Xr)+"%"},Go=m(Ao),Ko=de("col"),Xo=function(t){return Vo(t).getOrThunk((function(){return Uo(t)+"px"}))},Yo=function(t){return(e=t,Fo(e,"height")).getOrThunk((function(){return Wo(t)+"px"}));var e},Jo=function(t,e,n,r,o,i){return t.filter(r).fold((function(){return i(to(n,e))}),(function(t){return o(t)}))},Qo=function(t,e,n,r){var o=Jr(t),i=In.hasColumns(t)?function(t){return D(In.justColumns(t),(function(t){return T.from(t.element)}))}(t):o,a=[T.some(Eo.edge(e))].concat(D(Eo.positions(o,e),(function(t){return t.map((function(t){return t.x}))}))),u=y(un);return D(i,(function(t,e){return Jo(t,e,a,u,(function(t){if(function(t){var e=At().browser,n=e.isChrome()||e.isFirefox();return!Ko(t)||n}(t))return n(t);var i,c,s=(i=o[e],c=g,null!=i?c(i):T.none());return Jo(s,e,a,u,(function(t){return r(T.some(Gr(t)))}),r)}),r)}))},Zo=function(t){return t.map((function(t){return t+"px"})).getOr("")},ti=function(t,e,n){return Qo(t,e,Uo,(function(t){return t.getOrThunk(n.minCellWidth)}))},ei=function(t,e,n,r,o){var i=Zr(t),a=[T.some(n.edge(e))].concat(D(n.positions(i,e),(function(t){return t.map((function(t){return t.y}))})));return D(i,(function(t,e){return Jo(t,e,a,y(cn),r,o)}))},ni=function(t,e){return function(){return Ee(t)?e(t):parseFloat(nn(t,"width").getOr("0"))}},ri=function(t){var e=ni(t,Gr),n=m(0);return{width:e,pixelWidth:e,getWidths:function(e,n){return ti(e,t,n)},getCellDelta:n,singleColumnWidth:m([0]),minCellWidth:n,setElementWidth:d,adjustTableWidth:d,isRelative:!0,label:"none"}},oi=function(t){var e=ni(t,(function(t){return parseFloat($o(t))})),n=ni(t,Gr);return{width:e,pixelWidth:n,getWidths:function(e,n){return function(t,e,n){return Qo(t,e,jo,(function(t){return t.fold((function(){return n.minCellWidth()}),(function(t){return t/n.pixelWidth()*100}))}))}(e,t,n)},getCellDelta:function(t){return t/n()*100},singleColumnWidth:function(t,e){return[100-t]},minCellWidth:function(){return ln()/n()*100},setElementWidth:Po,adjustTableWidth:function(n){var r=e();Po(t,r+n/100*r)},isRelative:!0,label:"percent"}},ii=function(t){var e=ni(t,Gr);return{width:e,pixelWidth:e,getWidths:function(e,n){return ti(e,t,n)},getCellDelta:g,singleColumnWidth:function(t,e){return[Math.max(ln(),t+e)-t]},minCellWidth:ln,setElementWidth:zo,adjustTableWidth:function(n){var r=e()+n;zo(t,r)},isRelative:!1,label:"pixel"}},ai=function(t){return Vo(t).fold((function(){return ri(t)}),(function(e){return function(t,e){return null!==Go().exec(e)?oi(t):ii(t)}(t,e)}))},ui=ii,ci=oi,si=function(t,e,n){var r=t[n].element,o=Mt.fromTag("td");Qn(o,Mt.fromTag("br")),(e?Qn:Jn)(r,o)},li=function(t,e){var n=function(t){return Bt(t.element,e)},r=Lr(t),o=Cn(r),i=ai(t),a=In.generate(o),u=function(t,e){var n=t.grid.columns,r=t.grid.rows,o=n,i=0,a=0,u=[],c=[];return Ut(t.access,(function(t){if(u.push(t),e(t)){c.push(t);var n=t.row,s=n+t.rowspan-1,l=t.column,f=l+t.colspan-1;n<r?r=n:s>i&&(i=s),l<o?o=l:f>a&&(a=f)}})),function(t,e,n,r,o,i){return{minRow:t,minCol:e,maxRow:n,maxCol:r,allCells:o,selectedCells:i}}(r,o,i,a,u,c)}(a,n),c="th:not("+e+"),td:not("+e+")",s=mn(r,"th,td",(function(t){return Bt(t,c)}));return M(s,rr),function(t,e,n,r){for(var o=e.grid.columns,i=e.grid.rows,a=0;a<i;a++)for(var u=!1,c=0;c<o;c++)a<n.minRow||a>n.maxRow||c<n.minCol||c>n.maxCol||(In.getAt(e,a,c).filter(r).isNone()?si(t,u,a):u=!0)}(o,a,u,n),function(t,e,n,r){Ut(n.columns,(function(t){(t.column<e.minCol||t.column>e.maxCol)&&rr(t.element)}));var o=z(dn(t,"tr"),(function(t){return 0===t.dom.childElementCount}));M(o,rr),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||M(dn(t,"th,td"),(function(t){We(t,"rowspan"),We(t,"colspan")})),We(t,Dn),We(t,"data-snooker-col-series"),ai(t).adjustTableWidth(r)}(r,u,a,function(t,e,n,r){if(0===r.minCol&&e.grid.columns===r.maxCol+1)return 0;var o=ti(e,t,n),i=L(o,(function(t,e){return t+e}),0),a=L(o.slice(r.minCol,r.maxCol+1),(function(t,e){return t+e}),0)/i*n.pixelWidth()-n.pixelWidth();return n.getCellDelta(a)}(t,In.fromTable(t),i,u)),r},fi=function(t){return"img"===oe(t)?1:ur(t).fold((function(){return ye(t).length}),(function(t){return t.length}))},di=["img","br"],mi=function(t){return ur(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||R(di,oe(t))},gi=function(t){return e=mi,(n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=Mt.fromDom(t.childNodes[r]);if(e(o))return T.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return T.none()})(t.dom);var e,n},hi=function(t){return pi(t,mi)},pi=function(t,e){var n=function(t){for(var r=ye(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return T.some(i);var a=n(i);if(a.isSome())return a}return T.none()};return n(t)},vi={scope:["row","col"]},bi=function(t){return function(){var e=Mt.fromTag("td",t.dom);return Qn(e,Mt.fromTag("br",t.dom)),e}},yi=function(t){return function(){return Mt.fromTag("col",t.dom)}},wi=function(t){return function(){return Mt.fromTag("colgroup",t.dom)}},xi=function(t){return function(){return Mt.fromTag("tr",t.dom)}},Ci=function(t,e,n){var r=function(t,e){var n=Ir(t,e),r=ye(Lr(t));return er(n,r),n}(t,e);return Ut(n,(function(t,e){null===t?We(r,e):Fe(r,e,t)})),r},Si=function(t){return t},ki=function(t,e,n){var r=function(t,e){var n,r,o,i;n=t.element,r=e,o=n.dom,i=r.dom,Ye(o)&&Ye(i)&&(i.style.cssText=o.style.cssText),rn(e,"height"),1!==t.colspan&&rn(e,"width")};return{col:function(n){var o=Mt.fromTag(oe(n.element),e.dom);return r(n,o),t(n.element,o),o},colgroup:wi(e),row:xi(e),cell:function(o){var i=Mt.fromTag(oe(o.element),e.dom),a=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),u=a.length>0?function(t,e,n){return gi(t).map((function(r){var o=n.join(","),i=Ne(r,o,(function(e){return Lt(e,t)}));return P(i,(function(t,e){var n=Pr(e);return We(n,"contenteditable"),Qn(t,n),n}),e)})).getOr(e)}(o.element,i,a):i;return Qn(u,Mt.fromTag("br")),r(o,i),function(t,e){Ut(vi,(function(n,r){return Ue(t,r).filter((function(t){return R(n,t)})).each((function(t){return Fe(e,r,t)}))}))}(o.element,i),t(o.element,i),i},replace:Ci,colGap:yi(e),gap:bi(e)}},Ti=function(t){return{col:yi(t),colgroup:wi(t),row:xi(t),cell:bi(t),replace:Si,colGap:yi(t),gap:bi(t)}},Oi=function(t){return D(t,Mt.fromDom)},Ei=function(t){return Mt.fromDom(t.getBody())},_i=function(t){return t.getBoundingClientRect().width},Ri=function(t){return t.getBoundingClientRect().height},Ni=function(t){return function(e){return Lt(e,Ei(t))}},Ai=function(t){return/^\d+(\.\d+)?$/.test(t)?t+"px":t},Di=function(t){We(t,"data-mce-style");var e=function(t){return We(t,"data-mce-style")};M(hn(t),e),M(pn(t),e)},Mi=function(t){return Mt.fromDom(t.selection.getStart())},Bi=function(t){return Nr(t.get(),m([]),g,W)},zi=function(t){var e=function(t,e){return Ue(t,e).exists((function(t){return parseInt(t,10)>1}))},n=Bi(t);return n.length>0&&j(n,(function(t){return e(t,"rowspan")||e(t,"colspan")}))?T.some(n):T.none()},Pi=function(t,e,n){return Nr(e.get(),T.none,(function(e){return e.length<=1?T.none():Er(t,n.firstSelectedSelector,n.lastSelectedSelector).map((function(t){return{bounds:t,cells:e}}))}),T.none)},Li="data-mce-selected",Ii="data-mce-first-selected",Hi="data-mce-last-selected",Fi={selected:Li,selectedSelector:"td[data-mce-selected],th[data-mce-selected]",firstSelected:Ii,firstSelectedSelector:"td[data-mce-first-selected],th[data-mce-first-selected]",lastSelected:Hi,lastSelectedSelector:"td[data-mce-last-selected],th[data-mce-last-selected]"},Vi=function(t,e,n){return{element:n,mergable:Pi(e,t,Fi),unmergable:zi(t),selection:Bi(t)}},ji=function(t){return function(e,n){var r,o=oe(e),i="col"===o||"colgroup"===o?vn(r=e).bind((function(t){return Or(t,Fi.firstSelectedSelector)})).fold(m(r),(function(t){return t[0]})):e;return Ie(i,t,n)}},Ui=ji("th,td,caption"),Wi=ji("th,td"),qi=function(t){return Bi(t)},$i=function(t,e,n){t.on("BeforeGetContent",(function(n){!0===n.selection&&Nr(e.get(),d,(function(e){n.preventDefault(),function(t){return vn(t[0]).map((function(t){var e=li(t,"[data-mce-selected]");return Di(e),[e]}))}(e).each((function(e){n.content="text"===n.format?function(t){return D(t,(function(t){return t.dom.innerText})).join("")}(e):function(t,e){return D(e,(function(e){return t.selection.serializer.serialize(e.dom,{})})).join("")}(t,e)}))}),d)})),t.on("BeforeSetContent",(function(r){if(!0===r.selection&&!0===r.paste){var o=qi(e);$(o).each((function(e){vn(e).each((function(o){var i,a,u,c=z((i=r.content,(u=(a||document).createElement("div")).innerHTML=i,ye(Mt.fromDom(u))),(function(t){return"meta"!==oe(t)})),s=de("table");if(1===c.length&&s(c[0])){r.preventDefault();var l=Mt.fromDom(t.getDoc()),f=Ti(l),d=function(t,e,n){return{element:t,clipboard:e,generators:n}}(e,c[0],f);n.pasteCells(o,d).each((function(){t.focus()}))}}))}))}}))},Gi=_r([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Ki=X({},Gi),Xi=function(t,e,n,r,o){var i=t.slice(0),a=function(t,e){return 0===t.length?Ki.none():1===t.length?Ki.only(0):0===e?Ki.left(0,1):e===t.length-1?Ki.right(e-1,e):e>0&&e<t.length-1?Ki.middle(e-1,e,e+1):Ki.none()}(t,e),u=m(D(i,m(0)));return a.fold(u,(function(t){return r.singleColumnWidth(i[t],n)}),(function(t,e){return o.calcLeftEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)}),(function(t,e,a){return o.calcMiddleDeltas(i,t,e,a,n,r.minCellWidth(),r.isRelative)}),(function(t,e){return o.calcRightEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)}))},Yi=function(t,e,n){for(var r=0,o=t;o<e;o++)r+=void 0!==n[o]?n[o]:0;return r},Ji=function(t,e){var n=In.justCells(t);return D(n,(function(t){var n=Yi(t.row,t.row+t.rowspan,e);return{element:t.element,height:n,rowspan:t.rowspan}}))},Qi=function(t,e){return In.hasColumns(t)?function(t,e){var n=In.justColumns(t);return D(n,(function(t,n){return{element:t.element,width:e[n],colspan:t.colspan}}))}(t,e):function(t,e){var n=In.justCells(t);return D(n,(function(t){var n=Yi(t.column,t.column+t.colspan,e);return{element:t.element,width:n,colspan:t.colspan}}))}(t,e)},Zi=function(t,e,n){var r=Qi(t,e);M(r,(function(t){n.setElementWidth(t.element,t.width)}))},ta=function(t,e,n,r,o){var i=In.fromTable(t),a=o.getCellDelta(e),u=o.getWidths(i,o),c=n===i.grid.columns-1,s=r.clampTableDelta(u,n,a,o.minCellWidth(),c),l=Xi(u,n,s,o,r),f=D(l,(function(t,e){return t+u[e]}));Zi(i,f,o),r.resizeTable(o.adjustTableWidth,s,c)},ea=function(t,e,n,r){var o=In.fromTable(t),i=function(t,e,n){return ei(t,e,n,Wo,(function(t){return t.getOrThunk(fn)}))}(o,t,r),a=D(i,(function(t,r){return n===r?Math.max(e+t,fn()):t})),u=Ji(o,a),c=function(t,e){return D(t.all,(function(t,n){return{element:t.element,height:e[n]}}))}(o,a);M(c,(function(t){Lo(t.element,t.height)})),M(u,(function(t){Lo(t.element,t.height)}));var s=P(a,(function(t,e){return t+e}),0);Lo(t,s)},na=function(t){return D(t,m(0))},ra=function(t,e,n,r,o){return o(t.slice(0,e)).concat(r).concat(o(t.slice(n)))},oa=function(t){return function(e,n,r,o){if(t(r)){var i=Math.max(o,e[n]-Math.abs(r)),a=Math.abs(i-e[n]);return r>=0?a:-a}return r}},ia=oa((function(t){return t<0})),aa=oa(x),ua=function(){var t=function(t,e,n,r){var o=(100+n)/100,i=Math.max(r,(t[e]+n)/o);return D(t,(function(t,n){return(n===e?i:t/o)-t}))},e=function(e,n,r,o,i,a){return a?t(e,n,o,i):function(t,e,n,r,o){var i=ia(t,e,r,o);return ra(t,e,n+1,[i,0],na)}(e,n,r,o,i)};return{resizeTable:function(t,e){return t(e)},clampTableDelta:ia,calcLeftEdgeDeltas:e,calcMiddleDeltas:function(t,n,r,o,i,a,u){return e(t,r,o,i,a,u)},calcRightEdgeDeltas:function(e,n,r,o,i,a){if(a)return t(e,r,o,i);var u=ia(e,r,o,i);return na(e.slice(0,r)).concat([u])},calcRedestributedWidths:function(t,e,n,r){if(r){var o=(e+n)/e,i=D(t,(function(t){return t/o}));return{delta:100*o-100,newSizes:i}}return{delta:n,newSizes:t}}}},ca=function(){var t=function(t,e,n,r,o){var i=aa(t,r>=0?n:e,r,o);return ra(t,e,n+1,[i,-i],na)};return{resizeTable:function(t,e,n){n&&t(e)},clampTableDelta:function(t,e,n,r,o){if(o){if(n>=0)return n;var i=L(t,(function(t,e){return t+e-r}),0);return Math.max(-i,n)}return ia(t,e,n,r)},calcLeftEdgeDeltas:t,calcMiddleDeltas:function(e,n,r,o,i,a){return t(e,r,o,i,a)},calcRightEdgeDeltas:function(t,e,n,r,o,i){if(i)return na(t);var a=r/t.length;return D(t,m(a))},calcRedestributedWidths:function(t,e,n,r){return{delta:0,newSizes:t}}}},sa=function(t,e){var n=T.from(t.dom.documentElement).map(Mt.fromDom).getOr(t);return{parent:m(n),view:m(t),origin:m(co(0,0)),isResizable:e}},la=function(t,e,n){return{parent:m(e),view:m(t),origin:m(co(0,0)),isResizable:n}},fa=_r([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),da=function(t,e,n){var r=n.substring(0,n.length-t.length),o=parseFloat(r);return r===o.toString()?e(o):fa.invalid(n)},ma=X(X({},fa),{from:function(t){return it(t,"%")?da("%",fa.percent,t):it(t,"px")?da("px",fa.pixels,t):fa.invalid(t)}}),ga=function(t,e,n){return t.fold((function(){return e}),(function(t){return function(t,e,n){var r=n/e;return D(t,(function(t){return ma.from(t).fold((function(){return t}),(function(t){return t*r+"px"}),(function(t){return t/100*n+"px"}))}))}(e,n,t)}),(function(t){return function(t,e){return D(t,(function(t){return ma.from(t).fold((function(){return t}),(function(t){return t/e*100+"%"}),(function(t){return t+"%"}))}))}(e,n)}))},ha=function(t,e,n){var r=ma.from(n),o=j(t,(function(t){return"0px"===t}))?function(t,e){var n=t.fold((function(){return m("")}),(function(t){return m(t/e+"px")}),(function(){return m(100/e+"%")}));return A(e,n)}(r,t.length):ga(r,t,e);return ba(o)},pa=function(t,e){return 0===t.length?e:P(t,(function(t,e){return ma.from(e).fold(m(0),g,g)+t}),0)},va=function(t,e){return ma.from(t).fold(m(t),(function(t){return t+e+"px"}),(function(t){return t+e+"%"}))},ba=function(t){if(0===t.length)return t;var e=P(t,(function(t,e){var n=ma.from(e).fold((function(){return{value:e,remainder:0}}),(function(t){return function(t,e){var n=Math.floor(t);return{value:n+e,remainder:t-n}}(t,"px")}),(function(t){return{value:t+"%",remainder:0}}));return{output:[n.value].concat(t.output),remainder:t.remainder+n.remainder}}),{output:[],remainder:0}),n=e.output;return n.slice(0,n.length-1).concat([va(n[n.length-1],Math.round(e.remainder))])},ya=ma.from,wa=function(t){return ya(t).fold(m("px"),m("px"),m("%"))},xa=function(t,e,n){var r=In.fromTable(t),o=r.all,i=In.justCells(r),a=In.justColumns(r);e.each((function(e){var n=wa(e),o=Gr(t),u=function(t,e){return Qo(t,e,Xo,Zo)}(r,t),c=ha(u,o,e);In.hasColumns(r)?function(t,e,n){M(e,(function(e,r){var o=pa([t[r]],ln());Qe(e.element,"width",o+n)}))}(c,a,n):function(t,e,n){M(e,(function(e){var r=t.slice(e.column,e.colspan+e.column),o=pa(r,ln());Qe(e.element,"width",o+n)}))}(c,i,n),Qe(t,"width",e)})),n.each((function(e){var n=wa(e),a=oo(t),u=function(t,e,n){return ei(t,e,n,Yo,Zo)}(r,t,So);!function(t,e,n,r){M(n,(function(e){var n=t.slice(e.row,e.rowspan+e.row),o=pa(n,fn());Qe(e.element,"height",o+r)})),M(e,(function(e,n){Qe(e.element,"height",t[n])}))}(ha(u,a,e),o,i,n),Qe(t,"height",e)}))},Ca=function(t){return Vo(t).exists((function(t){return Ao.test(t)}))},Sa=function(t){return Vo(t).exists((function(t){return Do.test(t)}))},ka=function(t){return Vo(t).isNone()},Ta=function(t){return In.fromTable(t).grid},Oa=function(t){var e=[];return{bind:function(t){if(void 0===t)throw new Error("Event bind error: undefined handler");e.push(t)},unbind:function(t){e=z(e,(function(e){return e!==t}))},trigger:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={};M(t,(function(t,e){o[t]=n[e]})),M(e,(function(t){t(o)}))}}},Ea=function(t){return{registry:Wt(t,(function(t){return{bind:t.bind,unbind:t.unbind}})),trigger:Wt(t,(function(t){return t.trigger}))}},_a=function(t){return t.slice(0).sort()},Ra=function(t,e,n){if(0===e.length)throw new Error("You must specify at least one required field.");var o;return function(t,e){if(!i(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");M(e,(function(e){if(!r(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")}))}("required",e),o=_a(e),I(o,(function(t,e){return e<o.length-1&&t===o[e+1]})).each((function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+o.join(", ")+"].")})),function(r){var o=Vt(r);j(e,(function(t){return R(o,t)}))||function(t,e){throw new Error("All required keys ("+_a(t).join(", ")+") were not specified. Specified keys were: "+_a(e).join(", ")+".")}(e,o),t(e,o);var i=z(e,(function(t){return!n.validate(r[t],t)}));return i.length>0&&function(t,e){throw new Error("All values need to be of type: "+e+". Keys ("+_a(t).join(", ")+") were not.")}(i,n.label),r}},Na=function(t,e){var n=z(e,(function(e){return!R(t,e)}));n.length>0&&function(t){throw new Error("Unsupported keys for object: "+_a(t).join(", "))}(n)},Aa=function(t){return function(t,e){return Ra(t,e,{validate:l,label:"function"})}(Na,t)},Da=Aa(["compare","extract","mutate","sink"]),Ma=Aa(["element","start","stop","destroy"]),Ba=Aa(["forceDrop","drop","move","delayDrop"]),za=function(){var t=T.none(),e=Ea({move:Oa(["info"])});return{onEvent:function(n,r){r.extract(n).each((function(n){(function(e,n){var r=t.map((function(t){return e.compare(t,n)}));return t=T.some(n),r})(r,n).each((function(t){e.trigger.move(t)}))}))},reset:function(){t=T.none()},events:e.registry}},Pa=function(){var t,e=(t=Ea({move:Oa(["info"])}),{onEvent:d,reset:d,events:t.registry}),n=za(),r=e;return{on:function(){r.reset(),r=n},off:function(){r.reset(),r=e},isOn:function(){return r===n},onEvent:function(t,e){r.onEvent(t,e)},events:n.events}},La=function(t,e,n){var r,o,i,u,c=!1,s=Ea({start:Oa([]),stop:Oa([])}),l=Pa(),f=function(){g.stop(),l.isOn()&&(l.off(),s.trigger.stop())},d=(r=f,o=200,i=null,{cancel:u=function(){a(i)||(clearTimeout(i),i=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];u(),i=setTimeout((function(){i=null,r.apply(null,t)}),o)}});l.events.move.bind((function(n){e.mutate(t,n.info)}));var m=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];c&&t.apply(null,e)}},g=e.sink(Ba({forceDrop:f,drop:m(f),move:m((function(t){d.cancel(),l.onEvent(t,e)})),delayDrop:m(d.throttle)}),n);return{element:g.element,go:function(t){g.start(t),l.on(),s.trigger.start()},on:function(){c=!0},off:function(){c=!1},destroy:function(){g.destroy()},events:s.registry}},Ia=function(t){var e,n,r=Mt.fromDom(function(t){if(Ce()&&s(t.target)){var e=Mt.fromDom(t.target);if(ce(e)&&Oe(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return $(n)}}return T.from(t.target)}(t).getOr(t.target)),o=function(){return t.stopPropagation()},i=function(){return t.preventDefault()},a=(e=i,n=o,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e(n.apply(null,t))});return function(t,e,n,r,o,i,a){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:a}}(r,t.clientX,t.clientY,o,i,a,t)},Ha=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(Ia(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:p(Fa,t,e,i,o)}},Fa=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Va=x,ja=function(t,e,n){return function(t,e,n,r){return Ha(t,e,n,r,!1)}(t,e,Va,n)},Ua=Ia,Wa=function(t,e){var n=je(t,e);return void 0===n||""===n?[]:n.split(" ")},qa=function(t){return void 0!==t.dom.classList},$a=function(t,e){return function(t,e,n){var r=Wa(t,e).concat([n]);return Fe(t,e,r.join(" ")),!0}(t,"class",e)},Ga=function(t,e){qa(t)?t.dom.classList.add(e):$a(t,e)},Ka=function(t,e){return qa(t)&&t.dom.classList.contains(e)},Xa=function(t){var e=t.replace(/\./g,"-");return{resolve:function(t){return e+"-"+t}}},Ya=Xa("ephox-dragster"),Ja=Ya.resolve,Qa=Da({compare:function(t,e){return co(e.left-t.left,e.top-t.top)},extract:function(t){return T.some(co(t.x,t.y))},sink:function(t,e){var n=function(t){var e=X({layerClass:Ja("blocker")},t),n=Mt.fromTag("div");return Fe(n,"role","presentation"),Ze(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Ga(n,Ja("blocker")),Ga(n,e.layerClass),{element:m(n),destroy:function(){rr(n)}}}(e),r=ja(n.element(),"mousedown",t.forceDrop),o=ja(n.element(),"mouseup",t.drop),i=ja(n.element(),"mousemove",t.move),a=ja(n.element(),"mouseout",t.delayDrop);return Ma({element:n.element,start:function(t){Qn(t,n.element())},stop:function(){rr(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),a.unbind(),r.unbind()}})},mutate:function(t,e){t.mutate(e.left,e.top)}}),Za=function(t){return Ie(t,"[contenteditable]")},tu=function(t,e){return void 0===e&&(e=!1),!At().browser.isIE()&&Ee(t)?t.dom.isContentEditable:Za(t).fold(m(e),(function(t){return"true"===eu(t)}))},eu=function(t){return t.dom.contentEditable},nu=Xa("ephox-snooker"),ru=nu.resolve,ou=function(){var t=Ea({drag:Oa(["xDelta","yDelta","target"])}),e=T.none(),n=function(){var t=Ea({drag:Oa(["xDelta","yDelta"])});return{mutate:function(e,n){t.trigger.drag(e,n)},events:t.registry}}();n.events.drag.bind((function(n){e.each((function(e){t.trigger.drag(n.xDelta,n.yDelta,e)}))}));return{assign:function(t){e=T.some(t)},get:function(){return e},mutate:n.mutate,events:t.registry}},iu=ru("resizer-bar"),au=ru("resizer-rows"),uu=ru("resizer-cols"),cu=function(t){var e=De(t.parent(),"."+iu);M(e,rr)},su=function(t,e,n){var r=t.origin();M(e,(function(e){e.each((function(e){var o=n(r,e);Ga(o,iu),Qn(t.parent(),o)}))}))},lu=function(t,e,n,r){su(t,e,(function(t,e){var o,i,a,u,c,s,l=(o=e.col,i=e.x-t.left,a=n.top-t.top,u=7,c=r,s=Mt.fromTag("div"),Ze(s,{position:"absolute",left:i-u/2+"px",top:a+"px",height:c+"px",width:u+"px"}),Ve(s,{"data-column":o,role:"presentation"}),s);return Ga(l,uu),l}))},fu=function(t,e,n,r){su(t,e,(function(t,e){var o=function(t,e,n,r,o){var i=Mt.fromTag("div");return Ze(i,{position:"absolute",left:e+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),Ve(i,{"data-row":t,role:"presentation"}),i}(e.row,n.left-t.left,e.y-t.top,r,7);return Ga(o,au),o}))},du=function(t,e,n,r,o){var i=lo(n),a=e.isResizable,u=r.length>0?So.positions(r,n):[],c=u.length>0?function(t,e){return V(t.all,(function(t,n){return e(t.element)?[n]:[]}))}(t,a):[],s=z(u,(function(t,e){return N(c,(function(t){return e===t}))}));fu(e,s,i,Kr(n));var l=o.length>0?Eo.positions(o,n):[],f=l.length>0?function(t,e){var n=[];return A(t.grid.columns,(function(r){In.getColumnAt(t,r).map((function(t){return t.element})).forall(e)&&n.push(r)})),z(n,(function(n){var r=In.filterItems(t,(function(t){return t.column===n}));return j(r,(function(t){return e(t.element)}))}))}(t,a):[],d=z(l,(function(t,e){return N(f,(function(t){return e===t}))}));lu(e,d,i,io(n))},mu=function(t,e){if(cu(t),t.isResizable(e)){var n=In.fromTable(e),r=Zr(n),o=Jr(n);du(n,t,e,r,o)}},gu=function(t,e){var n=De(t.parent(),"."+iu);M(n,e)},hu=function(t){gu(t,(function(t){Qe(t,"display","none")}))},pu=function(t){gu(t,(function(t){Qe(t,"display","block")}))},vu=ru("resizer-bar-dragging"),bu=function(t){var e=ou(),n=function(t,e){void 0===e&&(e={});var n=void 0!==e.mode?e.mode:Qa;return La(t,n,e)}(e,{}),r=T.none(),o=function(t,e){return T.from(je(t,e))};e.events.drag.bind((function(t){o(t.target,"data-row").each((function(e){var n=sn(t.target,"top");Qe(t.target,"top",n+t.yDelta+"px")})),o(t.target,"data-column").each((function(e){var n=sn(t.target,"left");Qe(t.target,"left",n+t.xDelta+"px")}))}));var i=function(t,e){return sn(t,e)-on(t,"data-initial-"+e,0)};n.events.stop.bind((function(){e.get().each((function(e){r.each((function(n){o(e,"data-row").each((function(t){var r=i(e,"top");We(e,"data-initial-top"),l.trigger.adjustHeight(n,r,parseInt(t,10))})),o(e,"data-column").each((function(t){var r=i(e,"left");We(e,"data-initial-left"),l.trigger.adjustWidth(n,r,parseInt(t,10))})),mu(t,n)}))}))}));var a=function(r,o){l.trigger.startAdjust(),e.assign(r),Fe(r,"data-initial-"+o,sn(r,o)),Ga(r,vu),Qe(r,"opacity","0.2"),n.go(t.parent())},u=ja(t.parent(),"mousedown",(function(t){var e;e=t.target,Ka(e,au)&&a(t.target,"top"),function(t){return Ka(t,uu)}(t.target)&&a(t.target,"left")})),c=function(e){return Lt(e,t.view())},s=ja(t.view(),"mouseover",(function(e){var n;(n=e.target,Ie(n,"table",c).filter(tu)).fold((function(){Ee(e.target)&&cu(t)}),(function(e){r=T.some(e),mu(t,e)}))})),l=Ea({adjustHeight:Oa(["table","delta","row"]),adjustWidth:Oa(["table","delta","column"]),startAdjust:Oa([])});return{destroy:function(){u.unbind(),s.unbind(),n.destroy(),cu(t)},refresh:function(e){mu(t,e)},on:n.on,off:n.off,hideBars:p(hu,t),showBars:p(pu,t),events:l.registry}},yu=function(t,e,n){var r=So,o=Eo,i=bu(t),a=Ea({beforeResize:Oa(["table","type"]),afterResize:Oa(["table","type"]),startDrag:Oa([])});return i.events.adjustHeight.bind((function(t){var e=t.table;a.trigger.beforeResize(e,"row");var n=r.delta(t.delta,e);ea(e,n,t.row,r),a.trigger.afterResize(e,"row")})),i.events.startAdjust.bind((function(t){a.trigger.startDrag()})),i.events.adjustWidth.bind((function(t){var r=t.table;a.trigger.beforeResize(r,"col");var i=o.delta(t.delta,r),u=n(r);ta(r,i,t.column,e,u),a.trigger.afterResize(r,"col")})),{on:i.on,off:i.off,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:a.registry}},wu=function(t,e){return t.fire("newrow",{node:e})},xu=function(t,e){return t.fire("newcell",{node:e})},Cu=function(t,e,n){t.fire("TableModified",X(X({},n),{table:e}))},Su={structure:!1,style:!0},ku={structure:!0,style:!1},Tu={structure:!0,style:!0},Ou={"border-collapse":"collapse",width:"100%"},Eu=A(5,(function(t){var e=t+1+"px";return{title:e,value:e}})),_u=D(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(function(t){return{title:t,value:t.toLowerCase()}})),Ru={border:"1"},Nu="preservetable",Au=function(t){return t.getParam("table_sizing_mode","auto")},Du=function(t){return t.getParam("table_responsive_width")},Mu=function(t){return t.getParam("table_border_widths",Eu,"array")},Bu=function(t){return t.getParam("table_border_styles",_u,"array")},zu=function(t){return t.getParam("table_default_attributes",Ru,"object")},Pu=function(t){return t.getParam("table_default_styles",function(t){var e;if(Wu(t)){var n=t.dom,r=null!==(e=n.getParent(t.selection.getStart(),n.isBlock))&&void 0!==e?e:t.getBody(),o=Xr(Mt.fromDom(r));return X(X({},Ou),{width:o+"px"})}return qu(t)?$t(Ou,(function(t,e){return"width"!==e})):Ou}(t),"object")},Lu=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},Iu=function(t){return t.getParam("table_row_advtab",!0,"boolean")},Hu=function(t){return t.getParam("table_advtab",!0,"boolean")},Fu=function(t){return t.getParam("table_style_by_css",!1,"boolean")},Vu=function(t){return t.getParam("table_cell_class_list",[],"array")},ju=function(t){return t.getParam("table_class_list",[],"array")},Uu=function(t){return"relative"===Au(t)||!0===Du(t)},Wu=function(t){return"fixed"===Au(t)||!1===Du(t)},qu=function(t){return"responsive"===Au(t)},$u=function(t){return t.getParam("table_use_colgroups",!1,"boolean")},Gu=function(t){var e="section",n=t.getParam("table_header_type",e,"string");return R(["section","cells","sectionCells","auto"],n)?n:e},Ku=function(t){var e=t.getParam("table_column_resizing",Nu,"string");return I(["preservetable","resizetable"],(function(t){return t===e})).getOr(Nu)},Xu=function(t){return"preservetable"===Ku(t)},Yu=function(t){return"resizetable"===Ku(t)},Ju=function(t){var e=t.getParam("table_clone_elements");return r(e)?T.some(e.split(/[ ,]/)):Array.isArray(e)?T.some(e):T.none()},Qu=function(t){return t.getParam("table_background_color_map",[],"array")},Zu=function(t){return t.getParam("table_border_color_map",[],"array")},tc=function(t,e){return Uu(t)?ci(e):Wu(t)?ui(e):ai(e)},ec=function(t){We(t,"width")},nc=function(t){var e=$o(t);xa(t,T.some(e),T.none()),ec(t)},rc=function(t){var e=function(t){return Gr(t)+"px"}(t);xa(t,T.some(e),T.none()),ec(t)},oc=function(t){rn(t,"width");var e=pn(t),n=e.length>0?e:hn(t);M(n,(function(t){rn(t,"width"),ec(t)})),ec(t)},ic=function(){var t=Mt.fromTag("div");return Ze(t,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Qn(_e(Mt.fromDom(document)),t),t},ac="bar-",uc=function(t){return"false"!==je(t,"data-mce-resize")},cc=function(t){var e,n,o=T.none(),i=T.none(),a=T.none(),u=function(t){return"TABLE"===t.nodeName},c=function(){return i},s=function(e){return tc(t,e)},l=function(){return Xu(t)?ca():ua()},f=function(r,o,i){var a=it(o,"e");if(""===n&&nc(r),i!==e&&""!==n){Qe(r,"width",n);var u=l(),c=s(r),f=Xu(t)||a?function(t){return Ta(t).columns}(r)-1:0;ta(r,i-e,f,u,c)}else if(function(t){return/^(\d+(\.\d+)?)%$/.test(t)}(n)){var d=parseFloat(n.replace("%",""));Qe(r,"width",i*d/e+"%")}(function(t){return/^(\d+(\.\d+)?)px$/.test(t)})(n)&&function(t){var e=In.fromTable(t);In.hasColumns(e)||M(hn(t),(function(t){var e=tn(t,"width");Qe(t,"width",e),We(t,"width")}))}(r)};return t.on("init",(function(){var e=function(t,e){return t.inline?la(Ei(t),ic(),e):sa(Mt.fromDom(t.getDoc()),e)}(t,uc);if(a=T.some(e),function(t){var e=t.getParam("object_resizing",!0);return r(e)?"table"===e:e}(t)&&function(t){return t.getParam("table_resize_bars",!0,"boolean")}(t)){var n=l(),u=yu(e,n,s);u.on(),u.events.startDrag.bind((function(e){o=T.some(t.selection.getRng())})),u.events.beforeResize.bind((function(e){var n=e.table.dom;!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(t,n,_i(n),Ri(n),ac+e.type)})),u.events.afterResize.bind((function(e){var n=e.table,r=n.dom;Di(n),o.each((function(e){t.selection.setRng(e),t.focus()})),function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(t,r,_i(r),Ri(r),ac+e.type),t.undoManager.add()})),i=T.some(u)}})),t.on("ObjectResizeStart",(function(r){var o=r.target;if(u(o)){var i=Mt.fromDom(o);M(t.dom.select(".mce-clonedresizable"),(function(e){t.dom.addClass(e,"mce-"+Ku(t)+"-columns")})),!Sa(i)&&Wu(t)?rc(i):!Ca(i)&&Uu(t)&&nc(i),ka(i)&&ot(r.origin,ac)&&nc(i),e=r.width,n=qu(t)?"":function(t,e){var n=t.dom.getStyle(e,"width")||t.dom.getAttrib(e,"width");return T.from(n).filter(ut)}(t,o).getOr("")}})),t.on("ObjectResized",(function(e){var n=e.target;if(u(n)){var r=Mt.fromDom(n),o=e.origin;ot(o,"corner-")&&f(r,o,e.width),Di(r),Cu(t,r.dom,Su)}})),t.on("SwitchMode",(function(){c().each((function(e){t.mode.isReadOnly()?e.hideBars():e.showBars()}))})),{lazyResize:c,lazyWire:function(){return a.getOr(sa(Mt.fromDom(t.getBody()),uc))},destroy:function(){i.each((function(t){t.destroy()})),a.each((function(e){!function(t,e){t.inline&&rr(e.parent())}(t,e)}))}}},sc=function(t,e){return{element:t,offset:e}},lc=function(t,e,n){return t.property().isText(e)&&0===t.property().getText(e).trim().length||t.property().isComment(e)?n(e).bind((function(e){return lc(t,e,n).orThunk((function(){return T.some(e)}))})):T.none()},fc=function(t,e){return t.property().isText(e)?t.property().getText(e).length:t.property().children(e).length},dc=function(t,e){var n=lc(t,e,t.query().prevSibling).getOr(e);if(t.property().isText(n))return sc(n,fc(t,n));var r=t.property().children(n);return r.length>0?dc(t,r[r.length-1]):sc(n,fc(t,n))},mc=dc,gc=lr(),hc=function(t,e){1===an(t,"colspan")&&function(t){return Vo(t).bind((function(t){return No(t,["fixed","relative","empty"])}))}(t).each((function(n){var r=n.value/2;qo(t,r,n.unit),qo(e,r,n.unit)}))},pc=de("th"),vc=function(t){return j(t,(function(t){return pc(t.element)}))},bc=function(t,e){return t&&e?"sectionCells":t?"section":"cells"},yc=function(t){var e="thead"===t.section,n=$e(wc(t.cells),"th");return e||n?{type:"header",subType:bc(e,n)}:"tfoot"===t.section?{type:"footer"}:{type:"body"}},wc=function(t){var e=z(t,(function(t){return pc(t.element)}));return 0===e.length?T.some("td"):e.length===t.length?T.some("th"):T.none()},xc=function(t,e,n){return ne(n(t.element,e),!0,t.isLocked)},Cc=function(t,e){return t.section!==e?re(t.element,t.cells,e,t.isNew):t},Sc=function(){return{transformRow:Cc,transformCell:function(t,e,n){var r=n(t.element,e),o="td"!==oe(r)?function(t,e){var n=Ir(t,e);Xn(t,n);var r=ye(t);return er(n,r),rr(t),n}(r,"td"):r;return ne(o,t.isNew,t.isLocked)}}},kc=function(){return{transformRow:Cc,transformCell:xc}},Tc=function(){return{transformRow:function(t,e){return Cc(t,"thead"===e?"tbody":e)},transformCell:xc}},Oc=function(t,e){switch(function(t){return K(t.all,(function(t){var e=yc(t);return"header"===e.type?T.from(e.subType):T.none()}))}(In.fromTable(t)).getOr(e)){case"section":return Sc();case"sectionCells":return kc();case"cells":return Tc()}},Ec=Sc,_c=kc,Rc=Tc,Nc=function(){return{transformRow:g,transformCell:xc}},Ac=function(t,e,n,r){n===r?We(t,e):Fe(t,e,n)},Dc=function(t,e,n){G(Ae(t,e)).fold((function(){return Jn(t,n)}),(function(t){return Yn(t,n)}))},Mc=function(t,e){var n=[],r=[],o=function(t){return D(t,(function(t){t.isNew&&n.push(t.element);var e=t.element;return nr(e),M(t.cells,(function(t){t.isNew&&r.push(t.element),Ac(t.element,"colspan",t.colspan,1),Ac(t.element,"rowspan",t.rowspan,1),Qn(e,t.element)})),e}))},i=function(t){return V(t,(function(t){return D(t.cells,(function(t){return Ac(t.element,"span",t.colspan,1),t.element}))}))},a=function(e,n){var r=function(t,e){var n=Pe(t,e).getOrThunk((function(){var n=Mt.fromTag(e,me(t).dom);return"thead"===e?Dc(t,"caption,colgroup",n):"colgroup"===e?Dc(t,"caption",n):Qn(t,n),n}));return nr(n),n}(t,n),a=("colgroup"===n?i:o)(e);er(r,a)},u=function(e,n){e.length>0?a(e,n):function(e){Pe(t,e).each(rr)}(n)},c=[],s=[],l=[],f=[];return M(e,(function(t){switch(t.section){case"thead":c.push(t);break;case"tbody":s.push(t);break;case"tfoot":l.push(t);break;case"colgroup":f.push(t)}})),u(f,"colgroup"),u(c,"thead"),u(s,"tbody"),u(l,"tfoot"),{newRows:n,newCells:r}},Bc=function(t,e){if(0===t.length)return 0;var n=t[0];return H(t,(function(t){return!e(n.element,t.element)})).getOr(t.length)},zc=function(t,e,n,r){var o=function(t,e){return t[e]}(t,e),i="colgroup"===o.section;return{colspan:Bc(o.cells.slice(n),r),rowspan:i?1:Bc(function(t,e){return D(t,(function(t){return En(t,e)}))}(t.slice(e),n),r)}},Pc=function(t,e){var n=D(t,(function(t){return D(t.cells,w)}));return D(t,(function(r,o){var i=V(r.cells,(function(r,i){if(!1===n[o][i]){var a=zc(t,o,i,e);return function(t,e,r,o){for(var i=t;i<t+r;i++)for(var a=e;a<e+o;a++)n[i][a]=!0}(o,i,a.rowspan,a.colspan),[(u=r.element,c=a.rowspan,s=a.colspan,l=r.isNew,{element:u,rowspan:c,colspan:s,isNew:l})]}return[];var u,c,s,l}));return function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}}(r.element,i,r.section,r.isNew)}))},Lc=function(t,e,n){var r=[];M(t.colgroups,(function(o){for(var i=[],a=0;a<t.grid.columns;a++){var u=In.getColumnAt(t,a).map((function(t){return ne(t.element,n,!1)})).getOrThunk((function(){return ne(e.colGap(),!0,!1)}));i.push(u)}r.push(re(o.element,i,"colgroup",n))}));for(var o=0;o<t.grid.rows;o++){for(var i=[],a=0;a<t.grid.columns;a++){var u=In.getAt(t,o,a).map((function(t){return ne(t.element,n,t.isLocked)})).getOrThunk((function(){return ne(e.gap(),!0,!1)}));i.push(u)}var c=t.all[o],s=re(c.element,i,c.section,n);r.push(s)}return r},Ic=function(t){return Pc(t,Lt)},Hc=function(t,e){return K(t.all,(function(t){return I(t.cells,(function(t){return Lt(e,t.element)}))}))},Fc=function(t,e,n){var r=D(e.selection,(function(e){return gn(e).bind((function(e){return Hc(t,e)})).filter(n)})),o=Ge(r);return Xe(o.length>0,o)},Vc=function(t,e,n,r,o){return function(i,a,u,c,s){var l=In.fromTable(a),f=T.from(null==s?void 0:s.section).getOrThunk(Nc);return e(l,u).map((function(e){var n=function(t,e){return Lc(t,e,!1)}(l,c),r=t(n,e,Lt,o(c),f),i=Bn(r.grid);return{info:e,grid:Ic(r.grid),cursor:r.cursor,lockedColumns:i}})).bind((function(t){var e=Mc(a,t.grid),o=T.from(null==s?void 0:s.sizing).getOrThunk((function(){return ai(a)})),u=T.from(null==s?void 0:s.resize).getOrThunk(ca);return n(a,t.grid,t.info,{sizing:o,resize:u,section:f}),r(a),mu(i,a),We(a,Dn),t.lockedColumns.length>0&&Fe(a,Dn,t.lockedColumns.join(",")),T.some({cursor:t.cursor,newRows:e.newRows,newCells:e.newCells})}))}},jc=function(t,e){return Fc(t,e,x).map((function(t){return{cells:t,generators:e.generators,clipboard:e.clipboard}}))},Uc=function(t,e){return Fc(t,e,x)},Wc=function(t,e){return Fc(t,e,(function(t){return!t.isLocked}))},qc=function(t,e){return j(e,(function(e){return function(t,e){return Hc(t,e).exists((function(t){return!t.isLocked}))}(t,e)}))},$c=function(t,e){return function(t,e){return e.mergable}(0,e).filter((function(e){return qc(t,e.cells)}))},Gc=function(t,e){return function(t,e){return e.unmergable}(0,e).filter((function(e){return qc(t,e)}))},Kc=function(t,e,n,r){for(var o=Nn(t).rows,i=!0,a=0;a<o.length;a++)for(var u=0;u<Rn(o[0]);u++){var c=o[a],s=En(c,u),l=n(s.element,e);!0===l&&!1===i?Tn(c,u,ne(r(),!0,s.isLocked)):!0===l&&(i=!1)}return t},Xc=function(t,e,n,r){var o=Nn(t).rows;if(e>0&&e<o.length){var i=function(t,e){return L(t,(function(t,n){return N(t,(function(t){return e(t.element,n.element)}))?t:t.concat([n])}),[])}(o[e-1].cells,n);M(i,(function(t){for(var i=T.none(),a=e;a<o.length;a++)for(var u=function(e){var u=o[a],c=En(u,e);n(c.element,t.element)&&(i.isNone()&&(i=T.some(r())),i.each((function(t){Tn(u,e,ne(t,!0,c.isLocked))})))},c=0;c<Rn(o[0]);c++)u(c)}))}return t},Yc=function(t){return{isValue:x,isError:w,getOr:m(t),getOrThunk:m(t),getOrDie:m(t),or:function(e){return Yc(t)},orThunk:function(e){return Yc(t)},fold:function(e,n){return n(t)},map:function(e){return Yc(e(t))},mapError:function(e){return Yc(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return T.some(t)}}},Jc=function(t){return{isValue:w,isError:x,getOr:g,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:g,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Jc(t)},mapError:function(e){return Jc(e(t))},each:d,bind:function(e){return Jc(t)},exists:w,forall:x,toOptional:T.none}},Qc={value:Yc,error:Jc,fromOption:function(t,e){return t.fold((function(){return Jc(e)}),Yc)}},Zc=function(t,e){return{rowDelta:0,colDelta:Rn(t[0])-Rn(e[0])}},ts=function(t,e){return{rowDelta:t.length-e.length,colDelta:0}},es=function(t,e,n,r){var o="colgroup"===e.section?n.col:n.cell;return A(t,(function(t){return ne(o(),!0,r(t))}))},ns=function(t,e,n,r){var o=t[t.length-1];return t.concat(A(e,(function(){var t="colgroup"===o.section?n.colgroup:n.row,e=An(o,t,g),i=es(e.cells.length,e,n,(function(t){return Jt(r,t.toString())}));return On(e,i)})))},rs=function(t,e,n,r){return D(t,(function(t){var o=es(e,t,n,w);return Sn(t,r,o)}))},os=function(t,e,n){var r=e.colDelta<0?rs:g,o=e.rowDelta<0?ns:g,i=Bn(t),a=Rn(t[0]),u=N(i,(function(t){return t===a-1})),c=r(t,Math.abs(e.colDelta),n,u?a-1:a),s=Bn(c);return o(c,Math.abs(e.rowDelta),n,U(s,x))},is=function(t,e,n,r){var o=p(r,En(t[e],n).element),i=t[e];return t.length>1&&Rn(i)>1&&(n>0&&o(_n(i,n-1))||n<i.cells.length-1&&o(_n(i,n+1))||e>0&&o(_n(t[e-1],n))||e<t.length-1&&o(_n(t[e+1],n)))},as=function(t,e,n){return z(n,(function(n){return n>=t.column&&n<=Rn(e[0])+t.column}))},us=function(t,e,n,r,o){var i=Bn(e),a=function(t,e,n){var r=Rn(e[0]),o=Nn(e).cols.length+t.row,i=A(r-t.column,(function(e){return e+t.column}));return{row:o,column:I(i,(function(t){return j(n,(function(e){return e!==t}))})).getOr(r-1)}}(t,e,i),u=Nn(n).rows,c=as(a,u,i);return function(t,e,n){if(t.row>=e.length||t.column>Rn(e[0]))return Qc.error("invalid start address out of table bounds, row: "+t.row+", column: "+t.column);var r=e.slice(t.row),o=r[0].cells.slice(t.column),i=Rn(n[0]),a=n.length;return Qc.value({rowDelta:r.length-a,colDelta:o.length-i})}(a,e,u).map((function(t){var n=X(X({},t),{colDelta:t.colDelta-c.length}),i=os(e,n,r),s=Bn(i),l=as(a,u,s);return function(t,e,n,r,o,i){for(var a=t.row,u=t.column,c=a+n.length,s=u+Rn(n[0])+i.length,l=U(i,x),f=a;f<c;f++)for(var d=0,m=u;m<s;m++)if(l[m])d++;else{is(e,f,m,o)&&Kc(e,_n(e[f],m),o,r.cell);var g=m-u-d,h=En(n[f-a],g),p=h.element,v=r.replace(p);Tn(e[f],m,ne(v,!0,h.isLocked))}return e}(a,i,u,r,o,l)}))},cs=function(t,e,n,r,o){!function(t,e,n,r){e>0&&e<t[0].cells.length&&M(t,(function(t){var o=t.cells[e-1],i=t.cells[e];n(i.element,o.element)&&Tn(t,e,ne(r(),!0,i.isLocked))}))}(e,t,o,r.cell);var i=ts(n,e),a=os(n,i,r),u=ts(e,a),c=os(e,u,r);return D(c,(function(e,n){return Sn(e,t,a[n].cells)}))},ss=function(t,e,n,r,o){Xc(e,t,o,r.cell);var i=Bn(e),a=Zc(e,n),u=X(X({},a),{colDelta:a.colDelta-i.length}),c=os(e,u,r),s=Nn(c),l=s.cols,f=s.rows,d=Bn(c),m=Zc(n,e),g=X(X({},m),{colDelta:m.colDelta+d.length}),h=function(t,e,n){return D(t,(function(t){return L(n,(function(n,r){var o=es(1,t,e,x)[0];return kn(n,r,o)}),t)}))}(n,r,d),p=os(h,g,r);return l.concat(f.slice(0,t)).concat(p).concat(f.slice(t,f.length))},ls=function(t,e,n,r,o){var i=Nn(t),a=i.rows,u=i.cols,c=a.slice(0,e),s=a.slice(e),l=function(t,e,n,r){return An(t,(function(t){return r(t,n)}),e)}(a[n],(function(t,n){return e>0&&e<a.length&&r(_n(a[e-1],n),_n(a[e],n))?En(a[e],n):ne(o(t.element,r),!0,t.isLocked)}),r,o);return u.concat(c).concat([l]).concat(s)},fs=function(t,e,n,r,o){return D(t,(function(t){var i=e>0&&e<Rn(t)&&r(_n(t,e-1),_n(t,e)),a=function(t,e,n,r,o,i,a){if("colgroup"!==n&&r)return En(t,e);var u=En(t,o);return ne(a(u.element,i),!0,!1)}(t,e,t.section,i,n,r,o);return kn(t,e,a)}))},ds=function(t,e,n,r){return function(t,e,n,r){return void 0!==_n(t[e],n)&&e>0&&r(_n(t[e-1],n),_n(t[e],n))}(t,e,n,r)||function(t,e,n){return e>0&&n(_n(t,e-1),_n(t,e))}(t[e],n,r)},ms=function(t,e,n,r){var o=function(t){return function(t){return"row"===t?cn(e):un(e)}(t)?t+"group":t};return t?pc(e)?o(n):null:r&&pc(e)?o("row"===n?"col":"row"):null},gs=function(t,e,n){return ne(n(t.element,e),!0,t.isLocked)},hs=function(t,e,n,r,o,i,a){return D(t,(function(t,u){return function(t,e){var n=t.cells,r=D(n,e);return re(t.element,r,t.section,t.isNew)}(t,(function(t,c){if(function(t){return N(e,(function(e){return n(t.element,e.element)}))}(t)){var s=a(t,u,c)?o(t,n,r):t;return i(s,u,c).each((function(t){var e,n;e=s.element,n={scope:T.from(t)},Ut(n,(function(t,n){t.fold((function(){We(e,n)}),(function(t){He(e.dom,n,t)}))}))})),s}return t}))}))},ps=function(t,e,n){return V(t,(function(r,o){return ds(t,o,e,n)?[]:[En(r,e)]}))},vs=function(t,e,n,r,o){var i=Nn(t).rows,a=V(e,(function(t){return ps(i,t,r)})),u=D(t,(function(t){return vc(t.cells)})),c=function(t,e){return j(e,g)&&vc(t)?x:function(t,n,r){return!("th"===oe(t.element)&&e[n])}}(a,u),s=function(t,e){return function(n,r){return T.some(ms(t,n.element,"row",e[r]))}}(n,u);return hs(t,a,r,o,gs,s,c)},bs=function(t,e,n,r,o,i,a){var u=Nn(t),c=u.cols,s=u.rows,l=s[e[0]],f=V(e,(function(t){return function(t,e,n){var r=t[e];return V(r.cells,(function(r,o){return ds(t,e,o,n)?[]:[r]}))}(s,t,o)})),d=D(l.cells,(function(t,e){return vc(ps(s,e,o))})),m=Y([],s,!0);M(e,(function(t){m[t]=a.transformRow(s[t],n)}));var h=c.concat(m),p=function(t,e){return j(e,g)&&vc(t.cells)?x:function(t,n,r){return!("th"===oe(t.element)&&e[r])}}(l,d),v=function(t,e){return function(n,r,o){return T.some(ms(t,n.element,"col",e[o]))}}(r,d);return hs(h,f,o,i,a.transformCell,v,p)},ys=function(t,e,n,r){var o=Nn(t).rows,i=D(e,(function(t){return En(o[t.row],t.column)}));return hs(t,i,n,r,gs,T.none,x)},ws=function(t){return L(t,(function(t,e){return N(t,(function(t){return t.column===e.column}))?t:t.concat([e])}),[]).sort((function(t,e){return t.column-e.column}))},xs=de("col"),Cs=de("colgroup"),Ss=function(t){return"tr"===oe(t)||Cs(t)},ks=function(t){return{element:t,colspan:on(t,"colspan",1),rowspan:on(t,"rowspan",1)}},Ts=function(t){return Ue(t,"scope").map((function(t){return t.substr(0,3)}))},Os=function(t,e){void 0===e&&(e=ks);var n=function(n){if(Ss(n))return Cs((o={element:n}).element)?t.colgroup(o):t.row(o);var o,i=function(e){return xs(e.element)?t.col(e):t.cell(e)}(e(n));return r=T.some({item:n,replacement:i}),i},r=T.none();return{getOrInit:function(t,e){return r.fold((function(){return n(t)}),(function(r){return e(t,r.item)?r.replacement:n(t)}))}}},Es=function(t){return function(e){var n=[],r=function(r){var o="td"===t?{scope:null}:{},i=e.replace(r,t,o);return n.push({item:r,sub:i}),i};return{replaceOrInit:function(t,e){return Ss(t)||xs(t)?t:function(t,e){return I(n,(function(n){return e(n.item,t)}))}(t,e).fold((function(){return r(t)}),(function(n){return e(t,n.item)?n.sub:r(t)}))}}}},_s=function(t){return{unmerge:function(e){var n=Ts(e);return n.each((function(t){return Fe(e,"scope",t)})),function(){var r=t.cell({element:e,colspan:1,rowspan:1});return rn(r,"width"),rn(e,"width"),n.each((function(t){return Fe(r,"scope",t)})),r}},merge:function(t){return rn(t[0],"width"),function(){var e=Ge(D(t,Ts));if(0===e.length)return T.none();var n=e[0],r=["row","col"];return N(e,(function(t){return t!==n&&R(r,t)}))?T.none():T.from(n)}().fold((function(){return We(t[0],"scope")}),(function(e){return Fe(t[0],"scope",e+"group")})),m(t[0])}}},Rs=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Ns=lr(),As=function(t){return function(t,e){var n=t.property().name(e);return R(Rs,n)}(Ns,t)},Ds=function(t){return function(t,e){var n=t.property().name(e);return R(["ol","ul"],n)}(Ns,t)},Ms=function(t){return function(t,e){return R(["br","img","hr","input"],t.property().name(e))}(Ns,t)},Bs=function(t){var e,n=function(t){return"br"===oe(t)},r=function(t){return hi(t).bind((function(e){var r=be(e).map((function(t){return!!As(t)||!!Ms(t)&&"img"!==oe(t)})).getOr(!1);return he(e).map((function(o){return!0===r||function(t){return"li"===oe(t)||Be(t,Ds).isSome()}(o)||n(e)||As(o)&&!Lt(t,o)?[]:[Mt.fromTag("br")]}))})).getOr([])},o=0===(e=V(t,(function(t){var e=ye(t);return function(t){return j(t,(function(t){return n(t)||se(t)&&0===ar(t).trim().length}))}(e)?[]:e.concat(r(t))}))).length?[Mt.fromTag("br")]:e;nr(t[0]),er(t[0],o)},zs=function(t){return tu(t,!0)},Ps=function(t){0===hn(t).length&&rr(t)},Ls=function(t,e){return{grid:t,cursor:e}},Is=function(t,e,n){var r,o,i=Nn(t).rows;return T.from(null===(o=null===(r=i[e])||void 0===r?void 0:r.cells[n])||void 0===o?void 0:o.element).filter(zs).orThunk((function(){return function(t){return K(t,(function(t){return K(t.cells,(function(t){var e=t.element;return Xe(zs(e),e)}))}))}(i)}))},Hs=function(t,e,n){var r=Is(t,e,n);return Ls(t,r)},Fs=function(t){return L(t,(function(t,e){return N(t,(function(t){return t.row===e.row}))?t:t.concat([e])}),[]).sort((function(t,e){return t.row-e.row}))},Vs=function(t,e){return function(n,r,o,i,a){var u=Fs(r),c=D(u,(function(t){return t.row})),s=bs(n,c,t,e,o,i.replaceOrInit,a);return Hs(s,r[0].row,r[0].column)}},js=Vs("thead",!0),Us=Vs("tbody",!1),Ws=Vs("tfoot",!1),qs=function(t,e,n){var r=function(t,e){return wn(t,(function(){return e}))}(t,n.section),o=In.generate(r);return Lc(o,e,!0)},$s=function(t,e,n,r){return function(t,e,n,r){var o=In.generate(e),i=r.getWidths(o,r);Zi(o,i,r)}(0,e,0,r.sizing)},Gs=function(t,e,n,r){return function(t,e,n,r,o){var i=In.generate(e),a=r.getWidths(i,r),u=r.pixelWidth(),c=o.calcRedestributedWidths(a,u,n.pixelDelta,r.isRelative),s=c.newSizes,l=c.delta;Zi(i,s,r),r.adjustTableWidth(l)}(0,e,n,r.sizing,r.resize)},Ks=function(t,e){return N(e,(function(t){return 0===t.column&&t.isLocked}))},Xs=function(t,e){return N(e,(function(e){return e.column+e.colspan>=t.grid.columns&&e.isLocked}))},Ys=function(t,e){var n=Jr(t),r=ws(e);return L(r,(function(t,e){return t+n[e.column].map(Kr).getOr(0)}),0)},Js=function(t){return function(e,n){return Uc(e,n).filter((function(n){return!(t?Ks:Xs)(e,n)})).map((function(t){return{details:t,pixelDelta:Ys(e,t)}}))}},Qs=function(t){return function(e,n){return jc(e,n).filter((function(n){return!(t?Ks:Xs)(e,n.cells)}))}},Zs=Es("th"),tl=Es("td"),el=Vc((function(t,e,n,r){var o=e[0].row,i=Fs(e),a=P(i,(function(t,e){return{grid:ls(t.grid,o,e.row+t.delta,n,r.getOrInit),delta:t.delta+1}}),{grid:t,delta:0}).grid;return Hs(a,o,e[0].column)}),Uc,d,d,Os),nl=Vc((function(t,e,n,r){var o=Fs(e),i=o[o.length-1],a=i.row+i.rowspan,u=P(o,(function(t,e){return ls(t,a,e.row,n,r.getOrInit)}),t);return Hs(u,a,e[0].column)}),Uc,d,d,Os),rl=Vc((function(t,e,n,r){var o=e.details,i=ws(o),a=i[0].column,u=P(i,(function(t,e){return{grid:fs(t.grid,a,e.column+t.delta,n,r.getOrInit),delta:t.delta+1}}),{grid:t,delta:0}).grid;return Hs(u,o[0].row,a)}),Js(!0),Gs,d,Os),ol=Vc((function(t,e,n,r){var o=e.details,i=o[o.length-1],a=i.column+i.colspan,u=ws(o),c=P(u,(function(t,e){return fs(t,a,e.column,n,r.getOrInit)}),t);return Hs(c,o[0].row,a)}),Js(!1),Gs,d,Os),il=Vc((function(t,e,n,r){var o=ws(e.details),i=function(t,e){return V(t,(function(t){var n=t.cells,r=P(e,(function(t,e){return e>=0&&e<t.length?t.slice(0,e).concat(t.slice(e+1)):t}),n);return r.length>0?[re(t.element,r,t.section,t.isNew)]:[]}))}(t,D(o,(function(t){return t.column}))),a=i.length>0?i[0].cells.length-1:0;return Hs(i,o[0].row,Math.min(o[0].column,a))}),(function(t,e){return Wc(t,e).map((function(e){return{details:e,pixelDelta:-Ys(t,e)}}))}),Gs,Ps,Os),al=Vc((function(t,e,n,r){var o=Fs(e),i=function(t,e,n){var r=Nn(t),o=r.rows;return r.cols.concat(o.slice(0,e)).concat(o.slice(n+1))}(t,o[0].row,o[o.length-1].row),a=i.length>0?i.length-1:0;return Hs(i,Math.min(e[0].row,a),e[0].column)}),Uc,d,Ps,Os),ul=Vc((function(t,e,n,r){var o=ws(e),i=D(o,(function(t){return t.column})),a=vs(t,i,!0,n,r.replaceOrInit);return Hs(a,e[0].row,e[0].column)}),Wc,d,d,Zs),cl=Vc((function(t,e,n,r){var o=ws(e),i=D(o,(function(t){return t.column})),a=vs(t,i,!1,n,r.replaceOrInit);return Hs(a,e[0].row,e[0].column)}),Wc,d,d,tl),sl=Vc(js,Wc,d,d,Zs),ll=Vc(Us,Wc,d,d,tl),fl=Vc(Ws,Wc,d,d,tl),dl=Vc((function(t,e,n,r){var o=ys(t,e,n,r.replaceOrInit);return Hs(o,e[0].row,e[0].column)}),Wc,d,d,Zs),ml=Vc((function(t,e,n,r){var o=ys(t,e,n,r.replaceOrInit);return Hs(o,e[0].row,e[0].column)}),Wc,d,d,tl),gl=Vc((function(t,e,n,r){var o=e.cells;Bs(o);var i=function(t,e,n,r){var o=Nn(t).rows;if(0===o.length)return t;for(var i=e.startRow;i<=e.finishRow;i++)for(var a=e.startCol;a<=e.finishCol;a++){var u=o[i],c=En(u,a).isLocked;Tn(u,a,ne(r(),!1,c))}return t}(t,e.bounds,0,r.merge(o));return Ls(i,T.from(o[0]))}),$c,$s,d,_s),hl=Vc((function(t,e,n,r){var o=P(e,(function(t,e){return Kc(t,e,n,r.unmerge(e))}),t);return Ls(o,T.from(e[0]))}),Gc,$s,d,_s),pl=Vc((function(t,e,n,r){var o=function(t,e){var n=In.fromTable(t);return Lc(n,e,!0)}(e.clipboard,e.generators),i=function(t,e){return{row:t,column:e}}(e.row,e.column);return us(i,t,o,e.generators,n).fold((function(){return Ls(t,T.some(e.element))}),(function(t){return Hs(t,e.row,e.column)}))}),(function(t,e){return gn(e.element).bind((function(n){return Hc(t,n).map((function(t){return X(X({},t),{generators:e.generators,clipboard:e.clipboard})}))}))}),$s,d,Os),vl=Vc((function(t,e,n,r){var o=Nn(t).rows,i=e.cells[0].column,a=o[e.cells[0].row],u=qs(e.clipboard,e.generators,a),c=cs(i,t,u,e.generators,n);return Hs(c,e.cells[0].row,e.cells[0].column)}),Qs(!0),d,d,Os),bl=Vc((function(t,e,n,r){var o=Nn(t).rows,i=e.cells[e.cells.length-1].column+e.cells[e.cells.length-1].colspan,a=o[e.cells[0].row],u=qs(e.clipboard,e.generators,a),c=cs(i,t,u,e.generators,n);return Hs(c,e.cells[0].row,e.cells[0].column)}),Qs(!1),d,d,Os),yl=Vc((function(t,e,n,r){var o=Nn(t).rows,i=e.cells[0].row,a=o[i],u=qs(e.clipboard,e.generators,a),c=ss(i,t,u,e.generators,n);return Hs(c,e.cells[0].row,e.cells[0].column)}),jc,d,d,Os),wl=Vc((function(t,e,n,r){var o=Nn(t).rows,i=e.cells[e.cells.length-1].row+e.cells[e.cells.length-1].rowspan,a=o[e.cells[0].row],u=qs(e.clipboard,e.generators,a),c=ss(i,t,u,e.generators,n);return Hs(c,e.cells[0].row,e.cells[0].column)}),jc,d,d,Os),xl=function(t,e){var n=In.fromTable(t);return Uc(n,e).bind((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=F(D(n.all,(function(t){return z(t.cells,(function(t){return t.column>=r&&t.column<o}))})));return wc(i)})).getOr("")},Cl=function(t,e){var n=In.fromTable(t);return Uc(n,e).bind(wc).getOr("")},Sl=function(t,e){var n=In.fromTable(t);return Uc(n,e).bind((function(t){var e=t[t.length-1],r=t[0].row,o=e.row+e.rowspan;return function(t){var e=D(t,(function(t){return yc(t).type})),n=R(e,"header"),r=R(e,"footer");if(n||r){var o=R(e,"body");return!n||o||r?n||o||!r?T.none():T.some("footer"):T.some("header")}return T.some("body")}(n.all.slice(r,o))})).getOr("")},kl=function(t,e,n){var r=function(t){return"table"===oe(Ei(t))},o=Ju(t),i=Yu(t)?d:hc,a=function(e){switch(Gu(t)){case"section":return Ec();case"sectionCells":return _c();case"cells":return Rc();default:return Oc(e,"section")}},u=function(n,r){return r.cursor.fold((function(){var r=hn(n);return $(r).filter(Ee).map((function(r){e.clear(n);var o=t.dom.createRng();return o.selectNode(r.dom),t.selection.setRng(o),Fe(r,"data-mce-selected","1"),o}))}),(function(r){var o=mc(gc,r),i=t.dom.createRng();return i.setStart(o.element.dom,o.offset),i.setEnd(o.element.dom,o.offset),t.selection.setRng(i),e.clear(n),T.some(i)}))},c=function(e,n,r,i,c){return function(s,l,f){void 0===f&&(f=!1),Di(s);var d=i(),m=Mt.fromDom(t.getDoc()),g=ki(r,m,o),h={sizing:tc(t,s),resize:Yu(t)?ua():ca(),section:a(s)};return n(s)?e(d,s,l,g,h).bind((function(e){M(e.newRows,(function(e){wu(t,e.dom)})),M(e.newCells,(function(e){xu(t,e.dom)}));var n=u(s,e);return Ee(s)&&(Di(s),f||Cu(t,s.dom,c)),n.map((function(t){return{rng:t,effect:c}}))})):T.none()}};return{deleteRow:c(al,(function(e){return!1===r(t)||Ta(e).rows>1}),d,n,ku),deleteColumn:c(il,(function(e){return!1===r(t)||Ta(e).columns>1}),d,n,ku),insertRowsBefore:c(el,x,d,n,ku),insertRowsAfter:c(nl,x,d,n,ku),insertColumnsBefore:c(rl,x,i,n,ku),insertColumnsAfter:c(ol,x,i,n,ku),mergeCells:c(gl,x,d,n,ku),unmergeCells:c(hl,x,d,n,ku),pasteColsBefore:c(vl,x,d,n,ku),pasteColsAfter:c(bl,x,d,n,ku),pasteRowsBefore:c(yl,x,d,n,ku),pasteRowsAfter:c(wl,x,d,n,ku),pasteCells:c(pl,x,d,n,Tu),makeCellsHeader:c(dl,x,d,n,ku),unmakeCellsHeader:c(ml,x,d,n,ku),makeColumnsHeader:c(ul,x,d,n,ku),unmakeColumnsHeader:c(cl,x,d,n,ku),makeRowsHeader:c(sl,x,d,n,ku),makeRowsBody:c(ll,x,d,n,ku),makeRowsFooter:c(fl,x,d,n,ku),getTableRowType:Sl,getTableCellType:Cl,getTableColType:xl}},Tl={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},Ol=function(t){var e=Mt.fromTag("colgroup");return A(t,(function(){return Qn(e,Mt.fromTag("col"))})),e},El=function(t,e,n,r){return A(t,(function(t){return function(t,e,n,r){for(var o=Mt.fromTag("tr"),i=0;i<t;i++){var a=r<e||i<n?Mt.fromTag("th"):Mt.fromTag("td");i<n&&Fe(a,"scope","row"),r<e&&Fe(a,"scope","col"),Qn(a,Mt.fromTag("br")),Qn(o,a)}return o}(e,n,r,t)}))},_l=function(t,e){t.selection.select(e.dom,!0),t.selection.collapse(!0)},Rl=function(t,e,n,o,i){var a=Pu(t),u={styles:a,attributes:zu(t),colGroups:$u(t)};return t.undoManager.ignore((function(){var r=function(t,e,n,r,o,i){void 0===i&&(i=Tl);var a=Mt.fromTag("table"),u="cells"!==o;Ze(a,i.styles),Ve(a,i.attributes),i.colGroups&&Qn(a,Ol(e));var c=Math.min(t,n);if(u&&n>0){var s=Mt.fromTag("thead");Qn(a,s);var l=El(n,e,"sectionCells"===o?c:0,r);er(s,l)}var f=Mt.fromTag("tbody");Qn(a,f);var d=El(u?t-c:t,e,u?0:n,r);return er(f,d),a}(n,e,i,o,Gu(t),u);Fe(r,"data-mce-id","__mce");var a=function(t){var e=Mt.fromTag("div"),n=Mt.fromDom(t.dom.cloneNode(!0));return Qn(e,n),function(t){return t.dom.innerHTML}(e)}(r);t.insertContent(a),t.addVisual()})),Le(Ei(t),'table[data-mce-id="__mce"]').map((function(e){return Wu(t)?rc(e):qu(t)?oc(e):(Uu(t)||function(t){return r(t)&&-1!==t.indexOf("%")}(a.width))&&nc(e),Di(e),We(e,"data-mce-id"),function(t,e){M(De(e,"tr"),(function(e){wu(t,e.dom),M(De(e,"th,td"),(function(e){xu(t,e.dom)}))}))}(t,e),function(t,e){Le(e,"td,th").each(p(_l,t))}(t,e),e.dom})).getOr(null)},Nl=function(t,e,n,r,o){void 0===r&&(r={});var i=function(t){return f(t)&&t>0};if(i(e)&&i(n)){var a=r.headerRows||0,u=r.headerColumns||0;return Rl(t,n,e,u,a)}return console.error(o),null},Al=function(t){return function(){return t().fold((function(){return[]}),(function(t){return D(t,(function(t){return t.dom}))}))}},Dl=function(t){return function(e){var n=e.length>0?T.some(Oi(e)):T.none();t(n)}},Ml=function(t){return function(e,n,r){void 0===r&&(r={});var o=Nl(t,n,e,r,"Invalid values for insertTable - rows and columns values are required to insert a table.");return t.undoManager.add(),o}},Bl=function(t,e,n){var r=on(t,e,1);1===n||r<=1?We(t,e):Fe(t,e,Math.min(n,r))},zl=function(t,e){var n=In.fromTable(t);return Wc(n,e).map((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=function(t,e,n){if(In.hasColumns(t)){var r=z(In.justColumns(t),(function(t){return t.column>=e&&t.column<n})),o=D(r,(function(t){var r=Lr(t.element);return Bl(r,"span",n-e),r})),i=Mt.fromTag("colgroup");return er(i,o),[i]}return[]}(n,r,o),a=function(t,e,n){return D(t.all,(function(t){var r=z(t.cells,(function(t){return t.column>=e&&t.column<n})),o=D(r,(function(t){var r=Lr(t.element);return Bl(r,"colspan",n-e),r})),i=Mt.fromTag("tr");return er(i,o),i}))}(n,r,o);return Y(Y([],i,!0),a,!0)}))},Pl=function(t,e,n){var r=In.fromTable(t);return Uc(r,e).bind((function(t){var e=Lc(r,n,!1),o=Nn(e).rows.slice(t[0].row,t[t.length-1].row+t[t.length-1].rowspan),i=V(o,(function(t){var e=z(t.cells,(function(t){return!t.isLocked}));return e.length>0?[X(X({},t),{cells:e})]:[]})),a=Ic(i);return Xe(a.length>0,a)})).map((function(t){return function(t){return D(t,(function(t){var e=Pr(t.element);return M(t.cells,(function(t){var n=Lr(t.element);Ac(n,"colspan",t.colspan,1),Ac(n,"rowspan",t.rowspan,1),Qn(e,n)})),e}))}(t)}))},Ll=tinymce.util.Tools.resolve("tinymce.util.Tools"),Il=function(t,e,n){return function(e,r){for(var o=0;o<r.length;o++){var i=t.getStyle(r[o],n);if(void 0===e&&(e=i),e!==i)return""}return e}(undefined,t.select("td,th",e))},Hl=function(t,e,n){n&&t.formatter.apply("align"+n,{},e)},Fl=function(t,e){Ll.each("left center right".split(" "),(function(n){t.formatter.remove("align"+n,{},e)}))},Vl=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],jl=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Ul=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Wl=function(t){return(e=t,n="#",ot(e,n)?function(t,e){return t.substring(e)}(e,n.length):e).toUpperCase();var e,n},ql=function(t){return function(t){return jl.test(t)||Ul.test(t)}(t)?T.some({value:Wl(t)}):T.none()},$l=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Gl=function(t){return function(t){return{value:t}}($l(t.red)+$l(t.green)+$l(t.blue))},Kl=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Xl=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Yl=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},Jl=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),a=parseInt(n,10),u=parseFloat(r);return Yl(o,i,a,u)},Ql=function(t){return ql(t).orThunk((function(){return function(t){if("transparent"===t)return T.some(Yl(0,0,0,0));var e=Kl.exec(t);if(null!==e)return T.some(Jl(e[1],e[2],e[3],"1"));var n=Xl.exec(t);return null!==n?T.some(Jl(n[1],n[2],n[3],n[4])):T.none()}(t).map(Gl)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],a=r[2],u=r[3];return Gl(Yl(o,i,a,u))}))},Zl=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},tf=function(t){var e=Zl(T.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(T.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(T.some(t))}}},ef=function(){var t=tf(d);return X(X({},t),{on:function(e){return t.get().each(e)}})},nf=function(t,e,n,r){return function(o){var i=tf((function(t){return t.unbind()})),a=!ut(r),u=function(){var u=qi(e),c=function(e){return t.formatter.match(n,{value:r},e.dom,a)};a?(o.setActive(!N(u,c)),i.set(t.formatter.formatChanged(n,(function(t){return o.setActive(!t)}),!0))):(o.setActive(j(u,c)),i.set(t.formatter.formatChanged(n,o.setActive,!1,{value:r})))};return t.initialized?u():t.on("init",u),i.clear}},rf=function(t){return Qt(t,"menu")},of=function(t){return D(t,(function(t){var e=t.text||t.title;return rf(t)?{text:e,items:of(t.menu)}:{text:e,value:t.value}}))},af=function(t,e,n,r,o){return D(n,(function(n){var i=n.text||n.title;return rf(n)?{type:"nestedmenuitem",text:i,getSubmenuItems:function(){return af(t,e,n.menu,r,o)}}:{text:i,type:"togglemenuitem",onAction:function(){return o(n.value)},onSetup:nf(t,e,r,n.value)}}))},uf=function(t,e){return function(n){var r;t.execCommand("mceTableApplyCellStyle",!1,((r={})[e]=n,r))}},cf=function(t){return V(t,(function(t){return rf(t)?[X(X({},t),{menu:cf(t.menu)})]:ut(t.value)?[t]:[]}))},sf=function(t,e,n,r,o){return function(i){return i(af(t,e,n,r,o))}},lf=function(t,e,n){var r=D(e,(function(t){return{text:t.title,value:"#"+Ql(t.value).value,type:"choiceitem"}}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:r.length>0?r:void 0,allowCustomColors:!1},onAction:function(e){var r,o="remove"===e.value?"":e.value;t.execCommand("mceTableApplyCellStyle",!1,((r={})[n]=o,r))}}]},ff=function(t){return function(){var e="header"===t.queryCommandValue("mceTableRowType")?"body":"header";t.execCommand("mceTableRowType",!1,{type:e})}},df=function(t){return function(){var e="th"===t.queryCommandValue("mceTableColType")?"td":"th";t.execCommand("mceTableColType",!1,{type:e})}},mf=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:Vl}],gf=function(t){return mf.concat(function(t){var e=of(Vu(t));return e.length>0?T.some({name:"class",type:"listbox",label:"Class",items:e}):T.none()}(t).toArray())},hf=function(t,e){var n=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(of(Bu(t)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===e?[{name:"borderwidth",type:"input",label:"Border width"}].concat(n):n}},pf=function(t){return function(e,n){var r=e.dom;return{setAttrib:function(e,o){t&&!o||r.setAttrib(n,e,o)},setStyle:function(e,o){t&&!o||r.setStyle(n,e,o)},setFormat:function(r,o){t&&!o||(""===o?e.formatter.remove(r,{value:null},n,!0):e.formatter.apply(r,{value:o},n))}}}},vf={normal:pf(!1),ifTruthy:pf(!0)},bf=function(t){return function(e){return ot(e,"rgb")?t.toHex(e):e}},yf=function(t,e){var n=Mt.fromDom(e);return{borderwidth:nn(n,"border-width").getOr(""),borderstyle:nn(n,"border-style").getOr(""),bordercolor:nn(n,"border-color").map(bf(t)).getOr(""),backgroundcolor:nn(n,"background-color").map(bf(t)).getOr("")}},wf=function(t){var e=t[0],n=t.slice(1);return M(n,(function(t){M(Vt(e),(function(n){Ut(t,(function(t,r){var o=e[n];""!==o&&n===r&&o!==t&&(e[n]="")}))}))})),e},xf=function(t,e,n,r){return I(t,(function(t){return!c(n.formatter.matchNode(r,e+t))})).getOr("")},Cf=p(xf,["left","center","right"],"align"),Sf=p(xf,["top","middle","bottom"],"valign"),kf=function(t){return vn(Mt.fromDom(t)).map((function(e){var n={selection:Oi(t.cells)};return Sl(e,n)})).getOr("")},Tf=function(t,e){var n=In.fromTable(t),r=In.justCells(n),o=z(r,(function(t){return N(e,(function(e){return Lt(t.element,e)}))}));return D(o,(function(t){return{element:t.element.dom,column:In.getColumnAt(n,t.column).map((function(t){return t.element.dom}))}}))},Of=function(t,e,n){var r=1===e.length;M(e,(function(e){var o=e.element,i=r?vf.normal(t,o):vf.ifTruthy(t,o);!function(t,e,n){t.setAttrib("scope",n.scope),t.setAttrib("class",n.class),t.setStyle("height",Ai(n.height)),e.setStyle("width",Ai(n.width))}(i,e.column.map((function(e){return r?vf.normal(t,e):vf.ifTruthy(t,e)})).getOr(i),n),Lu(t)&&function(t,e){t.setFormat("tablecellbackgroundcolor",e.backgroundcolor),t.setFormat("tablecellbordercolor",e.bordercolor),t.setFormat("tablecellborderstyle",e.borderstyle),t.setFormat("tablecellborderwidth",Ai(e.borderwidth))}(i,n),r&&(Fl(t,o),function(t,e){Ll.each("top middle bottom".split(" "),(function(n){t.formatter.remove("valign"+n,{},e)}))}(t,o)),n.halign&&Hl(t,o,n.halign),n.valign&&function(t,e,n){n&&t.formatter.apply("valign"+n,{},e)}(t,o,n.valign)}))},Ef=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){!function(t,e,n,r){var o=$t(r,(function(t,e){return n[e]!==t}));Xt(o)>0&&e.length>=1&&vn(e[0]).each((function(n){var i=Tf(n,e),a=Xt($t(o,(function(t,e){return"scope"!==e&&"celltype"!==e})))>0,u=Jt(o,"celltype");(a||Jt(o,"scope"))&&Of(t,i,r),u&&function(t,e){t.execCommand("mceTableCellType",!1,{type:e.celltype,no_events:!0})}(t,r),Cu(t,n.dom,{structure:u,style:a})}))}(t,e,n,o),t.focus()}))},_f=function(t,e){var n=vn(e[0]).map((function(n){return D(Tf(n,e),(function(e){return function(t,e,n,r){var o,i=t.dom,a=r.getOr(e),u=function(t,e){return i.getStyle(t,e)||i.getAttrib(t,e)};return X({width:u(a,"width"),height:u(e,"height"),scope:i.getAttrib(e,"scope"),celltype:(o=e,o.nodeName.toLowerCase()),class:i.getAttrib(e,"class",""),halign:Cf(t,e),valign:Sf(t,e)},n?yf(i,e):{})}(t,e.element,Lu(t),e.column)}))}));return wf(n.getOrDie())},Rf=function(t,e){var n=qi(e);if(0!==n.length){var r=_f(t,n),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:gf(t)},hf(t,"cell")]},i={type:"panel",items:[{type:"grid",columns:2,items:gf(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:Lu(t)?o:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:p(Ef,t,n,r)})}},Nf=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Af=function(t){return Nf.concat(function(t){var e=of(function(t){return t.getParam("table_row_class_list",[],"array")}(t));return e.length>0?T.some({name:"class",type:"listbox",label:"Class",items:e}):T.none()}(t).toArray())},Df=function(t,e,n,r){var o=1===e.length;M(e,(function(e){var i=o?vf.normal(t,e):vf.ifTruthy(t,e);!function(t,e){t.setAttrib("class",e.class),t.setStyle("height",Ai(e.height))}(i,n),Iu(t)&&function(t,e){t.setStyle("background-color",e.backgroundcolor),t.setStyle("border-color",e.bordercolor),t.setStyle("border-style",e.borderstyle)}(i,n),n.align!==r.align&&(Fl(t,e),Hl(t,e,n.align))}))},Mf=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){!function(t,e,n,r){var o=$t(r,(function(t,e){return n[e]!==t}));if(Xt(o)>0){var i=Jt(o,"type"),a=!i||Xt(o)>1;a&&Df(t,e,r,n),i&&function(t,e){t.execCommand("mceTableRowType",!1,{type:e.type,no_events:!0})}(t,r),vn(Mt.fromDom(e[0])).each((function(e){return Cu(t,e.dom,{structure:i,style:a})}))}}(t,e,n,o),t.focus()}))},Bf=function(t){var e,n,r,o,i=(e=Mi(t),n=Fi.selected,r=Wi(e),o=r.bind((function(t){return vn(t)})).map((function(t){return bn(t)})),Ke(r,o,(function(t,e){return z(e,(function(e){return N(Oi(e.dom.cells),(function(e){return"1"===je(e,n)||Lt(e,t)}))}))})).getOr([]));if(0!==i.length){var a=D(i,(function(e){return function(t,e,n){var r=t.dom;return X({height:r.getStyle(e,"height")||r.getAttrib(e,"height"),class:r.getAttrib(e,"class",""),type:kf(e),align:Cf(t,e)},n?yf(r,e):{})}(t,e.dom,Iu(t))})),u=wf(a),c={type:"tabpanel",tabs:[{title:"General",name:"general",items:Af(t)},hf(t,"row")]},s={type:"panel",items:[{type:"grid",columns:2,items:Af(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:Iu(t)?c:s,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:u,onSubmit:p(Mf,t,D(i,(function(t){return t.dom})),u)})}},zf=function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=function(t){return t.getParam("table_appearance_options",!0,"boolean")}(t)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],i=e.length>0?[{type:"listbox",name:"class",label:"Class",items:e}]:[];return r.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(o).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(i)},Pf=function(t,e,n,o){if("TD"===e.tagName||"TH"===e.tagName)r(n)?t.setStyle(e,n,o):t.setStyle(e,n);else if(e.children)for(var i=0;i<e.children.length;i++)Pf(t,e.children[i],n,o)},Lf=function(t,e,n,r){var o=t.dom,i=r.getData(),a=$t(i,(function(t,e){return n[e]!==t}));r.close(),""===i.class&&delete i.class,t.undoManager.transact((function(){if(!e){var n=parseInt(i.cols,10)||1,r=parseInt(i.rows,10)||1;e=Rl(t,n,r,0,0)}if(Xt(a)>0){!function(t,e,n){var r=t.dom,o={},i={};if(o.class=n.class,i.height=Ai(n.height),r.getAttrib(e,"width")&&!Fu(t)?o.width=function(t){return t?t.replace(/px$/,""):""}(n.width):i.width=Ai(n.width),Fu(t)?(i["border-width"]=Ai(n.border),i["border-spacing"]=Ai(n.cellspacing)):(o.border=n.border,o.cellpadding=n.cellpadding,o.cellspacing=n.cellspacing),Fu(t)&&e.children)for(var a=0;a<e.children.length;a++)Pf(r,e.children[a],{"border-width":Ai(n.border),padding:Ai(n.cellpadding)}),Hu(t)&&Pf(r,e.children[a],{"border-color":n.bordercolor});Hu(t)&&(i["background-color"]=n.backgroundcolor,i["border-color"]=n.bordercolor,i["border-style"]=n.borderstyle),o.style=r.serializeStyle(X(X({},Pu(t)),i)),r.setAttribs(e,X(X({},zu(t)),o))}(t,e,i);var u=o.select("caption",e)[0];(u&&!i.caption||!u&&i.caption)&&t.execCommand("mceTableToggleCaption"),""===i.align?Fl(t,e):Hl(t,e,i.align)}if(t.focus(),t.addVisual(),Xt(a)>0){var c=Jt(a,"caption"),s=!c||Xt(a)>1;Cu(t,e,{structure:c,style:s})}}))},If=function(t,e){var n,r=t.dom,o=function(t,e){var n,r,o,i,a=Pu(t),u=zu(t),c=e?(n=t.dom,{borderstyle:Yt(a,"border-style").getOr(""),bordercolor:bf(n)(Yt(a,"border-color").getOr("")),backgroundcolor:bf(n)(Yt(a,"background-color").getOr(""))}):{};return X(X(X(X(X(X({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),a),u),c),(i=a["border-width"],Fu(t)&&i?{border:i}:Yt(u,"border").fold((function(){return{}}),(function(t){return{border:t}})))),(r=Yt(a,"border-spacing").or(Yt(u,"cellspacing")).fold((function(){return{}}),(function(t){return{cellspacing:t}})),o=Yt(a,"border-padding").or(Yt(u,"cellpadding")).fold((function(){return{}}),(function(t){return{cellpadding:t}})),X(X({},r),o)))}(t,Hu(t));!1===e?(n=r.getParent(t.selection.getStart(),"table",t.getBody()))?o=function(t,e,n){var r=t.dom,o=Fu(t)?r.getStyle(e,"border-spacing")||r.getAttrib(e,"cellspacing"):r.getAttrib(e,"cellspacing")||r.getStyle(e,"border-spacing"),i=Fu(t)?Il(r,e,"padding")||r.getAttrib(e,"cellpadding"):r.getAttrib(e,"cellpadding")||Il(r,e,"padding");return X({width:r.getStyle(e,"width")||r.getAttrib(e,"width"),height:r.getStyle(e,"height")||r.getAttrib(e,"height"),cellspacing:o,cellpadding:i,border:function(e,n){var r=nn(Mt.fromDom(n),"border-width");return Fu(t)&&r.isSome()?r.getOr(""):e.getAttrib(n,"border")||Il(t.dom,n,"border-width")||Il(t.dom,n,"border")}(r,e),caption:!!r.select("caption",e)[0],class:r.getAttrib(e,"class",""),align:Cf(t,e)},n?yf(r,e):{})}(t,n,Hu(t)):Hu(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""):(o.cols="1",o.rows="1",Hu(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=of(ju(t));i.length>0&&o.class&&(o.class=o.class.replace(/\s*mce\-item\-table\s*/g,""));var a={type:"grid",columns:2,items:zf(t,i,e)},u=Hu(t)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},hf(t,"table")]}:{type:"panel",items:[a]};t.windowManager.open({title:"Table Properties",size:"normal",body:u,onSubmit:p(Lf,t,n,o),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},Hf=function(t){return Ui(Mi(t),Ni(t))},Ff=function(t,e,n,i,a){var u=Ni(t),c=function(t){return vn(t,u)},s=function(e){return function(t){return Wi(Mi(t),Ni(t))}(t).bind((function(t){return c(t).map((function(n){return e(n,t)}))}))},l=function(e){t.focus()},f=function(t,e){return void 0===e&&(e=!1),s((function(n,r){var o=Vi(i,n,r);t(n,o,e).each(l)}))},m=function(){return s((function(e,n){var r=Vi(i,e,n),o=ki(d,Mt.fromDom(t.getDoc()),T.none());return Pl(e,r,o)}))},g=function(){return s((function(t,e){var n=Vi(i,t,e);return zl(t,n)}))},h=function(e,n){return n().each((function(n){var r=D(n,(function(t){return Lr(t)}));s((function(n,o){var a=Ti(Mt.fromDom(t.getDoc())),u=function(t,e,n,r){return{selection:Bi(t),clipboard:n,generators:r}}(i,0,r,a);e(n,u).each(l)}))}))},v=function(t){return function(e,n){return Yt(n,"type").each((function(e){f(t(e),n.no_events)}))}};Ut({mceTableSplitCells:function(){return f(e.unmergeCells)},mceTableMergeCells:function(){return f(e.mergeCells)},mceTableInsertRowBefore:function(){return f(e.insertRowsBefore)},mceTableInsertRowAfter:function(){return f(e.insertRowsAfter)},mceTableInsertColBefore:function(){return f(e.insertColumnsBefore)},mceTableInsertColAfter:function(){return f(e.insertColumnsAfter)},mceTableDeleteCol:function(){return f(e.deleteColumn)},mceTableDeleteRow:function(){return f(e.deleteRow)},mceTableCutCol:function(){return g().each((function(t){a.setColumns(t),f(e.deleteColumn)}))},mceTableCutRow:function(){return m().each((function(t){a.setRows(t),f(e.deleteRow)}))},mceTableCopyCol:function(){return g().each((function(t){return a.setColumns(t)}))},mceTableCopyRow:function(){return m().each((function(t){return a.setRows(t)}))},mceTablePasteColBefore:function(){return h(e.pasteColsBefore,a.getColumns)},mceTablePasteColAfter:function(){return h(e.pasteColsAfter,a.getColumns)},mceTablePasteRowBefore:function(){return h(e.pasteRowsBefore,a.getRows)},mceTablePasteRowAfter:function(){return h(e.pasteRowsAfter,a.getRows)},mceTableDelete:function(){return Hf(t).each((function(e){vn(e,u).filter(y(u)).each((function(e){var n=Mt.fromText("");if(Yn(e,n),rr(e),t.dom.isEmpty(t.getBody()))t.setContent(""),t.selection.setCursorLocation();else{var r=t.dom.createRng();r.setStart(n.dom,0),r.setEnd(n.dom,0),t.selection.setRng(r),t.nodeChanged()}}))}))},mceTableCellToggleClass:function(e,n){s((function(e){var r=qi(i),o=j(r,(function(e){return t.formatter.match("tablecellclass",{value:n},e.dom)}))?t.formatter.remove:t.formatter.apply;M(r,(function(t){return o("tablecellclass",{value:n},t.dom)})),Cu(t,e.dom,Su)}))},mceTableToggleClass:function(e,n){s((function(e){t.formatter.toggle("tableclass",{value:n},e.dom),Cu(t,e.dom,Su)}))},mceTableToggleCaption:function(){Hf(t).each((function(e){vn(e,u).each((function(n){Pe(n,"caption").fold((function(){var e=Mt.fromTag("caption");Qn(e,Mt.fromText("Caption")),function(t,e,n){we(t,n).fold((function(){Qn(t,e)}),(function(t){Xn(t,e)}))}(n,e,0),t.selection.setCursorLocation(e.dom,0)}),(function(r){de("caption")(e)&&Pt("td",n).each((function(e){return t.selection.setCursorLocation(e.dom,0)})),rr(r)})),Cu(t,n.dom,ku)}))}))},mceTableSizingMode:function(e,n){return function(e){return Hf(t).each((function(n){qu(t)||Wu(t)||Uu(t)||vn(n,u).each((function(n){"relative"!==e||Ca(n)?"fixed"!==e||Sa(n)?"responsive"!==e||ka(n)||oc(n):rc(n):nc(n),Di(n),Cu(t,n.dom,ku)}))}))}(n)},mceTableCellType:v((function(t){return"th"===t?e.makeCellsHeader:e.unmakeCellsHeader})),mceTableColType:v((function(t){return"th"===t?e.makeColumnsHeader:e.unmakeColumnsHeader})),mceTableRowType:v((function(t){switch(t){case"header":return e.makeRowsHeader;case"footer":return e.makeRowsFooter;default:return e.makeRowsBody}}))},(function(e,n){return t.addCommand(n,e)})),Ut({mceTableProps:p(If,t,!1),mceTableRowProps:p(Bf,t),mceTableCellProps:p(Rf,t,i)},(function(e,n){return t.addCommand(n,(function(){return e()}))})),t.addCommand("mceInsertTable",(function(e,n){o(n)&&Vt(n).length>0?Nl(t,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):If(t,!0)})),t.addCommand("mceTableApplyCellStyle",(function(e,n){var a=function(t){return"tablecell"+t.toLowerCase().replace("-","")};if(o(n)){var u=qi(i);if(0!==u.length){var s=$t(n,(function(e,n){return t.formatter.has(a(n))&&r(e)}));(function(t){for(var e in t)if(jt.call(t,e))return!1;return!0})(s)||(Ut(s,(function(e,n){M(u,(function(r){vf.normal(t,r.dom).setFormat(a(n),e)}))})),c(u[0]).each((function(e){return Cu(t,e.dom,Su)})))}}}))},Vf={remove_similar:!0,inherit:!1},jf=X({selector:"td,th"},Vf),Uf={tablecellbackgroundcolor:X({styles:{backgroundColor:"%value"}},jf),tablecellverticalalign:X({styles:{"vertical-align":"%value"}},jf),tablecellbordercolor:X({styles:{borderColor:"%value"}},jf),tablecellclass:X({classes:["%value"]},jf),tableclass:X({selector:"table",classes:["%value"]},Vf),tablecellborderstyle:X({styles:{borderStyle:"%value"}},jf),tablecellborderwidth:X({styles:{borderWidth:"%value"}},jf)},Wf=_r([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),qf=X(X({},Wf),{none:function(t){return void 0===t&&(t=void 0),Wf.none(t)}}),$f=function(t,e,n,r,o){void 0===o&&(o=x);var i=1===r;if(!i&&n<=0)return qf.first(t[0]);if(i&&n>=t.length-1)return qf.last(t[t.length-1]);var a=n+r,u=t[a];return o(u)?qf.middle(e,u):$f(t,e,a,r,o)},Gf=function(t,e){return vn(t,e).bind((function(e){var n=hn(e);return H(n,(function(e){return Lt(t,e)})).map((function(t){return{index:t,all:n}}))}))},Kf=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Xf=_r([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Yf={before:Xf.before,on:Xf.on,after:Xf.after,cata:function(t,e,n,r){return t.fold(e,n,r)},getStart:function(t){return t.fold(g,g,g)}},Jf=_r([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Qf={domRange:Jf.domRange,relative:Jf.relative,exact:Jf.exact,exactFromRange:function(t){return Jf.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e,n=function(t){return t.match({domRange:function(t){return Mt.fromDom(t.startContainer)},relative:function(t,e){return Yf.getStart(t)},exact:function(t,e,n,r){return t}})}(t);return e=n,Mt.fromDom(ge(e).dom.defaultView)},range:Kf},Zf=function(t,e){var n=t.document.createRange();return n.selectNode(e.dom),n},td=function(t,e){var n=t.document.createRange();return ed(n,e),n},ed=function(t,e){return t.selectNodeContents(e.dom)},nd=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},rd=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},od=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},id=_r([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),ad=function(t,e,n){return e(Mt.fromDom(n.startContainer),n.startOffset,Mt.fromDom(n.endContainer),n.endOffset)},ud=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return id.rtl(Mt.fromDom(t.endContainer),t.endOffset,Mt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return ad(0,id.ltr,n)})):ad(0,id.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:m(t),rtl:T.none}},relative:function(e,n){return{ltr:J((function(){return nd(t,e,n)})),rtl:J((function(){return T.some(nd(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:J((function(){return rd(t,e,n,r,o)})),rtl:J((function(){return T.some(rd(t,r,o,e,n))}))}}})}(t,e))},cd=function(t,e){return ud(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};id.ltr,id.rtl;var sd=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},ld=function(t,e,n,r,o){var i=function(n){var r=t.dom.createRange();return r.setStart(e.dom,n),r.collapse(!0),r},a=ar(e).length,u=function(t,e,n,r,o){if(0===o)return 0;if(e===r)return o-1;for(var i=r,a=1;a<o;a++){var u=t(a),c=Math.abs(e-u.left);if(n<=u.bottom){if(n<u.top||c>i)return a-1;i=c}}return 0}((function(t){return i(t).getBoundingClientRect()}),n,r,o.right,a);return i(u)},fd=function(t,e,n,r){return se(e)?function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getClientRects();return K(i,(function(t){return sd(t,n,r)?T.some(t):T.none()})).map((function(o){return ld(t,e,n,r,o)}))}(t,e,n,r):function(t,e,n,r){var o=t.dom.createRange(),i=ye(e);return K(i,(function(e){return o.selectNode(e.dom),sd(o.getBoundingClientRect(),n,r)?fd(t,e,n,r):T.none()}))}(t,e,n,r)},dd=function(t,e){return e-t.left<t.right-e},md=function(t,e,n){var r=t.dom.createRange();return r.selectNode(e.dom),r.collapse(n),r},gd=function(t,e,n){var r=t.dom.createRange();r.selectNode(e.dom);var o=r.getBoundingClientRect(),i=dd(o,n);return(true===i?gi:hi)(e).map((function(e){return md(t,e,i)}))},hd=function(t,e,n){var r=e.dom.getBoundingClientRect(),o=dd(r,n);return T.some(md(t,e,o))},pd=function(t,e,n){var r,o;return T.from(null===(o=(r=t.dom).caretPositionFromPoint)||void 0===o?void 0:o.call(r,e,n)).bind((function(e){if(null===e.offsetNode)return T.none();var n=t.dom.createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),T.some(n)}))},vd=function(t,e,n){var r,o;return T.from(null===(o=(r=t.dom).caretRangeFromPoint)||void 0===o?void 0:o.call(r,e,n))},bd=function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect();return function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect(),a=Math.max(i.left,Math.min(i.right,n)),u=Math.max(i.top,Math.min(i.bottom,r));return fd(t,e,a,u)}(t,e,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},yd=function(t,e,n){return Mt.fromPoint(t,e,n).bind((function(r){var o=function(){return function(t,e,n){return(0===ye(e).length?hd:gd)(t,e,n)}(t,r,e)};return 0===ye(r).length?o():bd(t,r,e,n).orThunk(o)}))},wd=document.caretPositionFromPoint?pd:document.caretRangeFromPoint?vd:yd,xd=function(t,e){var n=oe(t);return"input"===n?Yf.after(t):R(["br","img"],n)?0===e?Yf.before(t):Yf.after(t):Yf.on(t,e)},Cd=function(t,e){var n=t.fold(Yf.before,xd,Yf.after),r=e.fold(Yf.before,xd,Yf.after);return Qf.relative(n,r)},Sd=function(t,e,n,r){var o=xd(t,e),i=xd(n,r);return Qf.relative(o,i)},kd=function(t,e,n,r){var o=function(t,e,n,r){var o=me(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Lt(t,n)&&e===r;return o.collapsed&&!i},Td=function(t){return T.from(t.getSelection())},Od=function(t,e){Td(t).each((function(t){t.removeAllRanges(),t.addRange(e)}))},Ed=function(t,e,n,r,o){var i=rd(t,e,n,r,o);Od(t,i)},_d=function(t,e){return ud(t,e).match({ltr:function(e,n,r,o){Ed(t,e,n,r,o)},rtl:function(e,n,r,o){Td(t).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom,n,r.dom,o);else if(i.extend)try{!function(t,e,n,r,o,i){e.collapse(n.dom,r),e.extend(o.dom,i)}(0,i,e,n,r,o)}catch(i){Ed(t,r,o,e,n)}else Ed(t,r,o,e,n)}))}})},Rd=function(t,e,n,r,o){var i=Sd(e,n,r,o);_d(t,i)},Nd=function(t,e,n){var r=Cd(e,n);_d(t,r)},Ad=function(t){var e=Qf.getWin(t).dom,n=function(t,n,r,o){return rd(e,t,n,r,o)},r=function(t){return t.match({domRange:function(t){var e=Mt.fromDom(t.startContainer),n=Mt.fromDom(t.endContainer);return Sd(e,t.startOffset,n,t.endOffset)},relative:Cd,exact:Sd})}(t);return ud(e,r).match({ltr:n,rtl:n})},Dd=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return T.some(Kf(Mt.fromDom(e.startContainer),e.startOffset,Mt.fromDom(n.endContainer),n.endOffset))}return T.none()},Md=function(t){if(null===t.anchorNode||null===t.focusNode)return Dd(t);var e=Mt.fromDom(t.anchorNode),n=Mt.fromDom(t.focusNode);return kd(e,t.anchorOffset,n,t.focusOffset)?T.some(Kf(e,t.anchorOffset,n,t.focusOffset)):Dd(t)},Bd=function(t,e,n){void 0===n&&(n=!0);var r=(n?td:Zf)(t,e);Od(t,r)},zd=function(t){return function(t){return Td(t).filter((function(t){return t.rangeCount>0})).bind(Md)}(t).map((function(t){return Qf.exact(t.start,t.soffset,t.finish,t.foffset)}))},Pd=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?T.some(n).map(od):T.none()}(cd(t,e))},Ld=function(t,e,n){return function(t,e,n){var r=Mt.fromDom(t.document);return wd(r,e,n).map((function(t){return Kf(Mt.fromDom(t.startContainer),t.startOffset,Mt.fromDom(t.endContainer),t.endOffset)}))}(t,e,n)},Id=tinymce.util.Tools.resolve("tinymce.util.VK"),Hd=function(t,e,n){return Vd(t,e,function(t,e,n){return Gf(t,n).fold((function(){return qf.none(t)}),(function(n){return $f(n.all,t,n.index,1,e)}))}(n,tu))},Fd=function(t,e,n){return Vd(t,e,function(t,e,n){return Gf(t,n).fold((function(){return qf.none()}),(function(n){return $f(n.all,t,n.index,-1,e)}))}(n,tu))},Vd=function(t,e,n){return n.fold(T.none,T.none,(function(t,e){return gi(e).map((function(t){return function(t,e){var n=Qf.exact(e,0,e,0);return Ad(n)}(0,t)}))}),(function(n){return t.execCommand("mceTableInsertRowAfter"),Hd(t,e,n)}))},jd=["table","li","dl"],Ud=function(t,e){return{selection:t,kill:e}},Wd=function(t,e,n,r){return{start:Yf.on(t,e),finish:Yf.on(n,r)}},qd=function(t,e){var n=cd(t,e);return Kf(Mt.fromDom(n.startContainer),n.startOffset,Mt.fromDom(n.endContainer),n.endOffset)},$d=Wd,Gd=function(t,e,n,r,o){return Lt(n,r)?T.none():Cr(n,r,e).bind((function(e){var r=e.boxes.getOr([]);return r.length>1?(o(t,r,e.start,e.finish),T.some(Ud(T.some($d(n,0,n,fi(n))),!0))):T.none()}))},Kd=function(t,e){return{item:t,mode:e}},Xd=function(t,e,n,r){return void 0===r&&(r=Yd),t.property().parent(e).map((function(t){return Kd(t,r)}))},Yd=function(t,e,n,r){return void 0===r&&(r=Jd),n.sibling(t,e).map((function(t){return Kd(t,r)}))},Jd=function(t,e,n,r){void 0===r&&(r=Jd);var o=t.property().children(e);return n.first(o).map((function(t){return Kd(t,r)}))},Qd=[{current:Xd,next:Yd,fallback:T.none()},{current:Yd,next:Jd,fallback:T.some(Xd)},{current:Jd,next:Jd,fallback:T.some(Yd)}],Zd=function(t,e,n,r,o){return void 0===o&&(o=Qd),I(o,(function(t){return t.current===n})).bind((function(n){return n.current(t,e,r,n.next).orThunk((function(){return n.fallback.bind((function(n){return Zd(t,e,n,r)}))}))}))},tm=function(){return{sibling:function(t,e){return t.query().prevSibling(e)},first:function(t){return t.length>0?T.some(t[t.length-1]):T.none()}}},em=function(){return{sibling:function(t,e){return t.query().nextSibling(e)},first:function(t){return t.length>0?T.some(t[0]):T.none()}}},nm=function(t,e,n,r,o,i){return Zd(t,e,r,o).bind((function(e){return i(e.item)?T.none():n(e.item)?T.some(e.item):nm(t,e.item,n,e.mode,o,i)}))},rm=function(t){return function(e){return 0===t.property().children(e).length}},om=function(t,e,n,r){return nm(t,e,n,Yd,tm(),r)},im=function(t,e,n,r){return nm(t,e,n,Yd,em(),r)},am=lr(),um=function(t,e){return function(t,e,n){return om(t,e,rm(t),n)}(am,t,e)},cm=function(t,e){return function(t,e,n){return im(t,e,rm(t),n)}(am,t,e)},sm=_r([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),lm=function(t){return Ie(t,"tr")},fm=X(X({},sm),{verify:function(t,e,n,r,o,i,a){return Ie(r,"td,th",a).bind((function(n){return Ie(e,"td,th",a).map((function(e){return Lt(n,e)?Lt(r,n)&&fi(n)===o?i(e):sm.none("in same cell"):wr(lm,[n,e]).fold((function(){return function(t,e,n){var r=t.getRect(e),o=t.getRect(n);return o.right>r.left&&o.left<r.right}(t,e,n)?sm.success():i(e)}),(function(t){return i(e)}))}))})).getOr(sm.none("default"))},cata:function(t,e,n,r,o){return t.fold(e,n,r,o)}}),dm=function(t,e){return H(t,p(Lt,e))},mm=function(t){return"br"===oe(t)},gm=function(t,e,n){return e(t,n).bind((function(t){return se(t)&&0===ar(t).trim().length?gm(t,e,n):T.some(t)}))},hm=function(t,e,n,r){return function(t,e){return we(t,e).filter(mm).orThunk((function(){return we(t,e-1).filter(mm)}))}(e,n).bind((function(e){return r.traverse(e).fold((function(){return gm(e,r.gather,t).map(r.relative)}),(function(t){return function(t){return he(t).bind((function(e){var n=ye(e);return dm(n,t).map((function(r){return function(t,e,n,r){return{parent:t,children:e,element:n,index:r}}(e,n,t,r)}))}))}(t).map((function(t){return Yf.on(t.parent,t.index)}))}))}))},pm=function(t,e,n,r){return(mm(e)?function(t,e,n){return n.traverse(e).orThunk((function(){return gm(e,n.gather,t)})).map(n.relative)}(t,e,r):hm(t,e,n,r)).map((function(t){return{start:t,finish:t}}))},vm=function(t,e){return{left:t.left,top:t.top+e,right:t.right,bottom:t.bottom+e}},bm=function(t,e){return{left:t.left,top:t.top-e,right:t.right,bottom:t.bottom-e}},ym=function(t,e,n){return{left:t.left+e,top:t.top+n,right:t.right+e,bottom:t.bottom+n}},wm=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}},xm=function(t,e){return T.some(t.getRect(e))},Cm=function(t,e,n){return ce(e)?xm(t,e).map(wm):se(e)?function(t,e,n){return n>=0&&n<fi(e)?t.getRangedRect(e,n,e,n+1):n>0?t.getRangedRect(e,n-1,e,n):T.none()}(t,e,n).map(wm):T.none()},Sm=function(t,e){return ce(e)?xm(t,e).map(wm):se(e)?t.getRangedRect(e,0,e,fi(e)).map(wm):T.none()},km=_r([{none:[]},{retry:["caret"]}]),Tm=function(t,e,n){return(r=e,o=As,Me((function(t,e){return e(t)}),Be,r,o,i)).fold(w,(function(e){return Sm(t,e).exists((function(t){return function(t,e){return t.left<e.left||Math.abs(e.right-t.left)<1||t.left>e.right}(n,t)}))}));var r,o,i},Om={point:function(t){return t.bottom},adjuster:function(t,e,n,r,o){var i=vm(o,5);return Math.abs(n.bottom-r.bottom)<1||n.top>o.bottom?km.retry(i):n.top===o.bottom?km.retry(vm(o,1)):Tm(t,e,o)?km.retry(ym(i,5,0)):km.none()},move:vm,gather:cm},Em=function(t,e,n,r,o){return 0===o?T.some(r):function(t,e,n){return t.elementFromPoint(e,n).filter((function(t){return"table"===oe(t)})).isSome()}(t,r.left,e.point(r))?function(t,e,n,r,o){return Em(t,e,n,e.move(r,5),o)}(t,e,n,r,o-1):t.situsFromPoint(r.left,e.point(r)).bind((function(i){return i.start.fold(T.none,(function(i){return Sm(t,i).bind((function(a){return e.adjuster(t,i,a,n,r).fold(T.none,(function(r){return Em(t,e,n,r,o-1)}))})).orThunk((function(){return T.some(r)}))}),T.none)}))},_m=function(t,e,n){var r=t.move(n,5),o=Em(e,t,n,r,100).getOr(r);return function(t,e,n){return t.point(e)>n.getInnerHeight()?T.some(t.point(e)-n.getInnerHeight()):t.point(e)<0?T.some(-t.point(e)):T.none()}(t,o,e).fold((function(){return e.situsFromPoint(o.left,t.point(o))}),(function(n){return e.scrollBy(0,n),e.situsFromPoint(o.left,t.point(o)-n)}))},Rm={tryUp:p(_m,{point:function(t){return t.top},adjuster:function(t,e,n,r,o){var i=bm(o,5);return Math.abs(n.top-r.top)<1||n.bottom<o.top?km.retry(i):n.bottom===o.top?km.retry(bm(o,1)):Tm(t,e,o)?km.retry(ym(i,5,0)):km.none()},move:bm,gather:um}),tryDown:p(_m,Om),ieTryUp:function(t,e){return t.situsFromPoint(e.left,e.top-5)},ieTryDown:function(t,e){return t.situsFromPoint(e.left,e.bottom+5)},getJumpSize:m(5)},Nm=function(t,e,n){return t.getSelection().bind((function(r){return pm(e,r.finish,r.foffset,n).fold((function(){return T.some(sc(r.finish,r.foffset))}),(function(o){var i=t.fromSitus(o);return function(t){return fm.cata(t,(function(t){return T.none()}),(function(){return T.none()}),(function(t){return T.some(sc(t,0))}),(function(t){return T.some(sc(t,fi(t)))}))}(fm.verify(t,r.finish,r.foffset,i.finish,i.foffset,n.failure,e))}))}))},Am=function(t,e,n,r,o,i){return 0===i?T.none():Bm(t,e,n,r,o).bind((function(a){var u=t.fromSitus(a),c=fm.verify(t,n,r,u.finish,u.foffset,o.failure,e);return fm.cata(c,(function(){return T.none()}),(function(){return T.some(a)}),(function(a){return Lt(n,a)&&0===r?Dm(t,n,r,bm,o):Am(t,e,a,0,o,i-1)}),(function(a){return Lt(n,a)&&r===fi(a)?Dm(t,n,r,vm,o):Am(t,e,a,fi(a),o,i-1)}))}))},Dm=function(t,e,n,r,o){return Cm(t,e,n).bind((function(e){return Mm(t,o,r(e,Rm.getJumpSize()))}))},Mm=function(t,e,n){var r=At().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(t,n):r.isIE()?e.ieRetry(t,n):T.none()},Bm=function(t,e,n,r,o){return Cm(t,n,r).bind((function(e){return Mm(t,o,e)}))},zm=function(t,e){return Be(t,(function(t){return he(t).exists((function(t){return Lt(t,e)}))}),n).isSome();var n},Pm=function(t,e,n,r,o){return Ie(r,"td,th",e).bind((function(r){return Ie(r,"table",e).bind((function(i){return zm(o,i)?function(t,e,n){return Nm(t,e,n).bind((function(r){return Am(t,e,r.element,r.offset,n,20).map(t.fromSitus)}))}(t,e,n).bind((function(t){return Ie(t.finish,"td,th",e).map((function(e){return{start:r,finish:e,range:t}}))})):T.none()}))}))},Lm=function(t,e,n,r,o,i){return At().browser.isIE()?T.none():i(r,e).orThunk((function(){return Pm(t,e,n,r,o).map((function(t){var e=t.range;return Ud(T.some($d(e.start,e.soffset,e.finish,e.foffset)),!0)}))}))},Im=function(t,e){return Ie(t,"tr",e).bind((function(t){return Ie(t,"table",e).bind((function(n){var r=De(n,"tr");return Lt(t,r[0])?function(t,e,n){return om(am,t,e,n)}(n,(function(t){return hi(t).isSome()}),e).map((function(t){var e=fi(t);return Ud(T.some($d(t,e,t,e)),!0)})):T.none()}))}))},Hm=function(t,e){return Ie(t,"tr",e).bind((function(t){return Ie(t,"table",e).bind((function(n){var r=De(n,"tr");return Lt(t,r[r.length-1])?function(t,e,n){return im(am,t,e,n)}(n,(function(t){return gi(t).isSome()}),e).map((function(t){return Ud(T.some($d(t,0,t,0)),!0)})):T.none()}))}))},Fm=function(t,e,n,r,o,i,a){return Pm(t,n,r,o,i).bind((function(t){return Gd(e,n,t.start,t.finish,a)}))},Vm=function(t,e){return Ie(t,"td,th",e)},jm={traverse:be,gather:cm,relative:Yf.before,otherRetry:Rm.tryDown,ieRetry:Rm.ieTryDown,failure:fm.failedDown},Um={traverse:ve,gather:um,relative:Yf.before,otherRetry:Rm.tryUp,ieRetry:Rm.ieTryUp,failure:fm.failedUp},Wm=function(t){return function(e){return e===t}},qm=Wm(38),$m=Wm(40),Gm=function(t){return t>=37&&t<=40},Km={isBackward:Wm(37),isForward:Wm(39)},Xm={isBackward:Wm(39),isForward:Wm(37)},Ym=function(t){return{elementFromPoint:function(e,n){return Mt.fromPoint(Mt.fromDom(t.document),e,n)},getRect:function(t){return t.dom.getBoundingClientRect()},getRangedRect:function(e,n,r,o){var i=Qf.exact(e,n,r,o);return Pd(t,i)},getSelection:function(){return zd(t).map((function(e){return qd(t,e)}))},fromSitus:function(e){var n=Qf.relative(e.start,e.finish);return qd(t,n)},situsFromPoint:function(e,n){return Ld(t,e,n).map((function(t){return Wd(t.start,t.soffset,t.finish,t.foffset)}))},clearSelection:function(){!function(t){Td(t).each((function(t){return t.removeAllRanges()}))}(t)},collapseSelection:function(e){void 0===e&&(e=!1),zd(t).each((function(n){return n.fold((function(t){return t.collapse(e)}),(function(n,r){var o=e?n:r;Nd(t,o,o)}),(function(n,r,o,i){var a=e?n:o,u=e?r:i;Rd(t,a,u,a,u)}))}))},setSelection:function(e){Rd(t,e.start,e.soffset,e.finish,e.foffset)},setRelativeSelection:function(e,n){Nd(t,e,n)},selectNode:function(e){Bd(t,e,!1)},selectContents:function(e){Bd(t,e)},getInnerHeight:function(){return t.innerHeight},getScrollY:function(){var e,n,r,o;return(e=Mt.fromDom(t.document),n=void 0!==e?e.dom:document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop,co(r,o)).top},scrollBy:function(e,n){!function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollBy(t,e)}(e,n,Mt.fromDom(t.document))}}},Jm=function(t,e){return{rows:t,cols:e}},Qm=function(t,e,n,r){var o=function(t,e,n,r){var o=ef(),i=o.clear,a=function(i){o.on((function(o){r.clearBeforeUpdate(e),Vm(i.target,n).each((function(a){Cr(o,a,n).each((function(n){var o=n.boxes.getOr([]);if(1===o.length){var u=o[0],c="false"===eu(u),s=$e(Za(i.target),u,Lt);c&&s&&(r.selectRange(e,o,u,u),t.selectContents(u))}else o.length>1&&(r.selectRange(e,o,n.start,n.finish),t.selectContents(a))}))}))}))};return{clearstate:i,mousedown:function(t){r.clear(e),Vm(t.target,n).each(o.set)},mouseover:function(t){a(t)},mouseup:function(t){a(t),i()}}}(Ym(t),e,n,r);return{clearstate:o.clearstate,mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},Zm=function(t,e,n,r){var o=Ym(t),i=function(){return r.clear(e),T.none()};return{keydown:function(t,a,u,c,s,l){var f=t.raw,d=f.which,m=!0===f.shiftKey;return Sr(e,r.selectedSelector).fold((function(){return Gm(d)&&!m&&r.clearBeforeUpdate(e),$m(d)&&m?p(Fm,o,e,n,jm,c,a,r.selectRange):qm(d)&&m?p(Fm,o,e,n,Um,c,a,r.selectRange):$m(d)?p(Lm,o,n,jm,c,a,Hm):qm(d)?p(Lm,o,n,Um,c,a,Im):T.none}),(function(t){var n=function(n){return function(){return K(n,(function(n){return function(t,e,n,r,o){return Tr(r,t,e,o.firstSelectedSelector,o.lastSelectedSelector).map((function(t){return o.clearBeforeUpdate(n),o.selectRange(n,t.boxes,t.start,t.finish),t.boxes}))}(n.rows,n.cols,e,t,r)})).fold((function(){return kr(e,r.firstSelectedSelector,r.lastSelectedSelector).map((function(t){var n=$m(d)||l.isForward(d)?Yf.after:Yf.before;return o.setRelativeSelection(Yf.on(t.first,0),n(t.table)),r.clear(e),Ud(T.none(),!0)}))}),(function(t){return T.some(Ud(T.none(),!0))}))}};return $m(d)&&m?n([Jm(1,0)]):qm(d)&&m?n([Jm(-1,0)]):l.isBackward(d)&&m?n([Jm(0,-1),Jm(-1,0)]):l.isForward(d)&&m?n([Jm(0,1),Jm(1,0)]):Gm(d)&&!m?i:T.none}))()},keyup:function(t,o,i,a,u){return Sr(e,r.selectedSelector).fold((function(){var c=t.raw,s=c.which;return!0===c.shiftKey&&Gm(s)?function(t,e,n,r,o,i,a){return Lt(n,o)&&r===i?T.none():Ie(n,"td,th",e).bind((function(n){return Ie(o,"td,th",e).bind((function(r){return Gd(t,e,n,r,a)}))}))}(e,n,o,i,a,u,r.selectRange):T.none()}),T.none)}}},tg=function(t,e,n){var r=function(e){We(e,t.selected),We(e,t.firstSelected),We(e,t.lastSelected)},o=function(e){Fe(e,t.selected,"1")},i=function(t){a(t),n()},a=function(e){var n=De(e,t.selectedSelector+","+t.firstSelectedSelector+","+t.lastSelectedSelector);M(n,r)};return{clearBeforeUpdate:a,clear:i,selectRange:function(n,r,a,u){i(n),M(r,o),Fe(a,t.firstSelected,"1"),Fe(u,t.lastSelected,"1"),e(r,a,u)},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}},eg=function(t,e,n){var r=In.fromTable(t);return Uc(r,e).map((function(t){var e=Lc(r,n,!1);return{upOrLeftCells:function(t,e){var n=t.slice(0,e[e.length-1].row+1),r=Ic(n);return V(r,(function(t){var n=t.cells.slice(0,e[e.length-1].column+1);return D(n,(function(t){return t.element}))}))}(e,t),downOrRightCells:function(t,e){var n=t.slice(e[0].row+e[0].rowspan-1,t.length),r=Ic(n);return V(r,(function(t){var n=t.cells.slice(e[0].column+e[0].colspan-1,t.cells.length);return D(n,(function(t){return t.element}))}))}(e,t)}}))},ng=tinymce.util.Tools.resolve("tinymce.Env"),rg=function(t){return!1===Ka(Mt.fromDom(t.target),"ephox-snooker-resizer-bar")};function og(t,e,n){var r=tg(Fi,(function(e,r,o){n.targets().each((function(n){vn(r).each((function(i){var a=Ju(t),u=ki(d,Mt.fromDom(t.getDoc()),a),c=eg(i,n,u);!function(t,e,n,r,o){t.fire("TableSelectionChange",{cells:e,start:n,finish:r,otherCells:o})}(t,e,r,o,c)}))}))}),(function(){return function(t){t.fire("TableSelectionClear")}(t)}));return t.on("init",(function(n){var o=t.getWin(),i=Ei(t),a=Ni(t),u=Qm(o,i,a,r),c=Zm(o,i,a,r),s=function(t,e,n,r){var o=Ym(t);return function(t,i){r.clearBeforeUpdate(e),Cr(t,i,n).each((function(t){var n=t.boxes.getOr([]);r.selectRange(e,n,t.start,t.finish),o.selectContents(i),o.collapseSelection()}))}}(o,i,a,r);t.on("TableSelectorChange",(function(t){return s(t.start,t.finish)}));var l,f,m=function(e,n){(function(t){return!0===t.raw.shiftKey})(e)&&(n.kill&&e.kill(),n.selection.each((function(e){var n=Qf.relative(e.start,e.finish),r=cd(o,n);t.selection.setRng(r)})))},g=function(t){return 0===t.button},h=(l=Zl(Mt.fromDom(i)),f=Zl(0),{touchEnd:function(t){var e=Mt.fromDom(t.target);if("td"===oe(e)||"th"===oe(e)){var n=l.get(),r=f.get();Lt(n,e)&&t.timeStamp-r<300&&(t.preventDefault(),s(e,e))}l.set(e),f.set(t.timeStamp)}});t.on("dragstart",(function(t){u.clearstate()})),t.on("mousedown",(function(t){g(t)&&rg(t)&&u.mousedown(Ua(t))})),t.on("mouseover",(function(t){var e;(void 0===(e=t).buttons||ng.browser.isEdge()&&0===e.buttons||0!=(1&e.buttons))&&rg(t)&&u.mouseover(Ua(t))})),t.on("mouseup",(function(t){g(t)&&rg(t)&&u.mouseup(Ua(t))})),t.on("touchend",h.touchEnd),t.on("keyup",(function(e){var n=Ua(e);if(n.raw.shiftKey&&Gm(n.raw.which)){var r=t.selection.getRng(),o=Mt.fromDom(r.startContainer),i=Mt.fromDom(r.endContainer);c.keyup(n,o,r.startOffset,i,r.endOffset).each((function(t){m(n,t)}))}})),t.on("keydown",(function(n){var r=Ua(n);e().each((function(t){return t.hideBars()}));var o=t.selection.getRng(),i=Mt.fromDom(o.startContainer),a=Mt.fromDom(o.endContainer),u=eo(Km,Xm)(Mt.fromDom(t.selection.getStart()));c.keydown(r,i,o.startOffset,a,o.endOffset,u).each((function(t){m(r,t)})),e().each((function(t){return t.showBars()}))})),t.on("NodeChange",(function(){var e=t.selection,n=Mt.fromDom(e.getStart()),o=Mt.fromDom(e.getEnd());wr(vn,[n,o]).fold((function(){return r.clear(i)}),d)}))})),{clear:r.clear}}var ig=function(t,e){var n=Zl(T.none()),r=Zl([]),o=T.none(),i=de("caption"),a=function(t){return o.forall((function(e){return!e[t]}))},u=function(){return Ui(function(t){return Mt.fromDom(t.selection.getEnd())}(t),Ni(t))},c=function(){return Ui(Mi(t),Ni(t)).bind((function(t){return Ke(vn(t),u().bind(vn),(function(n,r){return Lt(n,r)?i(t)?T.some(function(t){return{element:t,mergable:T.none(),unmergable:T.none(),selection:[t]}}(t)):T.some(Vi(e,n,t)):T.none()})).bind(g)}))},s=function(t){return vn(t.element).map((function(e){var n=In.fromTable(e),r=Uc(n,t).getOr([]),o=L(r,(function(t,e){return e.isLocked&&(t.onAny=!0,0===e.column?t.onFirst=!0:e.column+e.colspan>=n.grid.columns&&(t.onLast=!0)),t}),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:$c(n,t).isSome(),unmergeable:Gc(n,t).isSome(),locked:o}}))},l=function(){n.set(J(c)()),o=n.get().bind(s),M(r.get(),(function(t){return t()}))},f=function(t){return t(),r.set(r.get().concat([t])),function(){r.set(z(r.get(),(function(e){return e!==t})))}},d=function(t,e){return f((function(){return n.get().fold((function(){t.setDisabled(!0)}),(function(n){t.setDisabled(e(n))}))}))},m=function(t,e,r){return f((function(){return n.get().fold((function(){t.setDisabled(!0),t.setActive(!1)}),(function(n){t.setDisabled(e(n)),t.setActive(r(n))}))}))},h=function(t){return o.exists((function(e){return e.locked[t]}))},p=function(e,n){return function(r){return m(r,(function(t){return i(t.element)}),(function(){return t.queryCommandValue(e)===n}))}},v=p("mceTableRowType","header"),b=p("mceTableColType","th");return t.on("NodeChange ExecCommand TableSelectorChange",l),{onSetupTable:function(t){return d(t,(function(t){return!1}))},onSetupCellOrRow:function(t){return d(t,(function(t){return i(t.element)}))},onSetupColumn:function(t){return function(e){return d(e,(function(e){return i(e.element)||h(t)}))}},onSetupPasteable:function(t){return function(e){return d(e,(function(e){return i(e.element)||t().isNone()}))}},onSetupPasteableColumn:function(t,e){return function(n){return d(n,(function(n){return i(n.element)||t().isNone()||h(e)}))}},onSetupMergeable:function(t){return d(t,(function(t){return a("mergeable")}))},onSetupUnmergeable:function(t){return d(t,(function(t){return a("unmergeable")}))},resetTargets:l,onSetupTableWithCaption:function(e){return m(e,w,(function(e){return vn(e.element,Ni(t)).exists((function(t){return Pe(t,"caption").isSome()}))}))},onSetupTableRowHeaders:v,onSetupTableColumnHeaders:b,targets:n.get}},ag=function(t){var e=function(t,e,n){return{get:function(){return Or(t(),n).fold((function(){return e().fold(Ar,Mr)}),(function(t){return Dr(t)}))}}}((function(){return Ei(t)}),(function(){return Wi(Mi(t),Ni(t))}),Fi.selectedSelector),n=ig(t,e),r=cc(t),o=og(t,r.lazyResize,n),i=kl(t,o,r.lazyWire),a=function(){var t=ef(),e=ef();return{getRows:t.get,setRows:function(n){n.fold(t.clear,t.set),e.clear()},clearRows:t.clear,getColumns:e.get,setColumns:function(n){n.fold(e.clear,e.set),t.clear()},clearColumns:e.clear}}();return Ff(t,i,0,e,a),function(t,e,n){var r=Ni(t),o=function(e){return Wi(Mi(t)).bind((function(t){return vn(t,r).map((function(r){var o=Vi(n,r,t);return e(r,o)}))})).getOr("")};Ut({mceTableRowType:function(){return o(e.getTableRowType)},mceTableCellType:function(){return o(e.getTableCellType)},mceTableColType:function(){return o(e.getTableColType)}},(function(e,n){return t.addQueryValueHandler(n,e)}))}(t,i,e),$i(t,e,i),function(t,e,n,r){var o=function(e){return function(){return t.execCommand(e)}},i=function(e){t.execCommand("mceInsertTable",!1,{rows:e.numRows,columns:e.numColumns})},a={text:"Table properties",onSetup:n.onSetupTable,onAction:o("mceTableProps")},u={text:"Delete table",icon:"table-delete-table",onSetup:n.onSetupTable,onAction:o("mceTableDelete")};t.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:o("mceTableInsertRowBefore"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:o("mceTableInsertRowAfter"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:o("mceTableDeleteRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:o("mceTableRowProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)});var c={type:"nestedmenuitem",text:"Row",getSubmenuItems:m("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")};t.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:o("mceTableInsertColBefore"),onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:o("mceTableInsertColAfter"),onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:o("mceTableDeleteCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")});var s={type:"nestedmenuitem",text:"Column",getSubmenuItems:m("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")};t.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:o("mceTableCellProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:o("mceTableMergeCells"),onSetup:n.onSetupMergeable}),t.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:o("mceTableSplitCells"),onSetup:n.onSetupUnmergeable});var l={type:"nestedmenuitem",text:"Cell",getSubmenuItems:m("tablecellprops tablemergecells tablesplitcells")};!1===function(t){return t.getParam("table_grid",!0,"boolean")}(t)?t.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTable")}):t.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:i}]}}),t.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTable")}),t.ui.registry.addMenuItem("tableprops",a),t.ui.registry.addMenuItem("deletetable",u),t.ui.registry.addNestedMenuItem("row",c),t.ui.registry.addNestedMenuItem("column",s),t.ui.registry.addNestedMenuItem("cell",l),t.ui.registry.addContextMenu("table",{update:function(){return n.resetTargets(),n.targets().fold(m(""),(function(t){return"caption"===oe(t.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}});var f=cf(ju(t));0!==f.length&&t.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return af(t,e,f,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)}))},onSetup:n.onSetupTable});var d=cf(Vu(t));0!==d.length&&t.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return af(t,e,d,"tablecellclass",(function(e){return t.execCommand("mceTableCellToggleClass",!1,e)}))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:function(){return af(t,e,Vl,"tablecellverticalalign",uf(t,"vertical-align"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return af(t,e,Mu(t),"tablecellborderwidth",uf(t,"border-width"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return af(t,e,Bu(t),"tablecellborderstyle",uf(t,"border-style"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablecaption",{icon:"table-caption",text:"Table caption",onAction:o("mceTableToggleCaption"),onSetup:n.onSetupTableWithCaption}),t.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:function(){return lf(t,Qu(t),"background-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return lf(t,Zu(t),"border-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablerowheader",{text:"Row header",icon:"table-top-header",onAction:ff(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleMenuItem("tablecolheader",{text:"Column header",icon:"table-left-header",onAction:df(t),onSetup:n.onSetupTableColumnHeaders})}(t,e,n,a),function(t,e,n,r){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(t){return t("inserttable | cell row column | advtablesort | tableprops deletetable")}});var o=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:o("mceTableProps"),icon:"table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:o("mceTableDelete"),icon:"table-delete-table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:o("mceTableCellProps"),icon:"table-cell-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:o("mceTableMergeCells"),icon:"table-merge-cells",onSetup:n.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:o("mceTableSplitCells"),icon:"table-split-cells",onSetup:n.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:o("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:o("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:o("mceTableDeleteRow"),icon:"table-delete-row",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:o("mceTableRowProps"),icon:"table-row-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:o("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:o("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:o("mceTableDeleteCol"),icon:"table-delete-column",onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:o("mceInsertTable"),icon:"table"});var i=cf(ju(t));0!==i.length&&t.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:sf(t,e,i,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)})),onSetup:n.onSetupTable});var a=cf(Vu(t));0!==a.length&&t.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:sf(t,e,a,"tablecellclass",(function(e){return t.execCommand("mceTableCellToggleClass",!1,e)})),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:sf(t,e,Vl,"tablecellverticalalign",uf(t,"vertical-align")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:sf(t,e,Mu(t),"tablecellborderwidth",uf(t,"border-width")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:sf(t,e,Bu(t),"tablecellborderstyle",uf(t,"border-style")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablecaption",{tooltip:"Table caption",onAction:o("mceTableToggleCaption"),icon:"table-caption",onSetup:n.onSetupTableWithCaption}),t.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:function(e){return e(lf(t,Qu(t),"background-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(e){return e(lf(t,Zu(t),"border-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablerowheader",{tooltip:"Row header",icon:"table-top-header",onAction:ff(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleButton("tablecolheader",{tooltip:"Column header",icon:"table-left-header",onAction:df(t),onSetup:n.onSetupTableColumnHeaders})}(t,e,n,a),function(t){var e=function(t){return t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")}(t);e.length>0&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})}(t),t.on("PreInit",(function(){t.serializer.addTempAttr(Fi.firstSelected),t.serializer.addTempAttr(Fi.lastSelected),function(t){t.formatter.register(Uf)}(t)})),function(t){return t.getParam("table_tab_navigation",!0,"boolean")}(t)&&t.on("keydown",(function(e){!function(t,e,n){if(t.keyCode===Id.TAB){var r=Ei(e),o=function(t){var e=oe(t);return Lt(t,r)||R(jd,e)},i=e.selection.getRng(),a=Mt.fromDom(t.shiftKey?i.startContainer:i.endContainer);gn(a,o).each((function(r){t.preventDefault(),vn(r,o).each(n.clear),e.selection.collapse(t.shiftKey),(t.shiftKey?Fd:Hd)(e,o,r).each((function(t){e.selection.setRng(t)}))}))}}(e,t,o)})),t.on("remove",(function(){r.destroy()})),function(t,e,n,r){return{insertTable:Ml(t),setClipboardRows:Dl(e.setRows),getClipboardRows:Al(e.getRows),setClipboardCols:Dl(e.setColumns),getClipboardCols:Al(e.getColumns),resizeHandler:n,selectionTargets:r}}(t,a,r,n)};Br.add("table",ag)}()},397:(t,e,n)=>{n(2738)},2738:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(){return(e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function n(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var r,o,i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},a=i("string"),u=i("object"),c=i("array"),s=function(){},l=function(t){return function(){return t}},f=function(t){return t},d=l(!1),m=l(!0),g=function(){return h},h={fold:function(t,e){return t()},isSome:d,isNone:m,getOr:o=f,getOrThunk:r=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:o,orThunk:r,map:g,each:s,bind:g,exists:d,forall:m,filter:function(){return g()},toArray:function(){return[]},toString:l("none()")},p=function(t){var e=l(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:m,isNone:d,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return p(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:h},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},v={some:p,none:g,from:function(t){return null==t?h:p(t)}},b=Array.prototype.slice,y=Array.prototype.indexOf,w=function(t,e){return n=t,r=e,y.call(n,r)>-1;var n,r},x=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},C=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},S=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},k=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,(function(t,r){n=e(n,t,r)})),n},T=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return v.some(i);if(n(i,r))break}return v.none()}(t,e,d)},O=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},E=function(t){return function(t,e){return e>=0&&e<t.length?v.some(t[e]):v.none()}(t,0)},_=Object.keys,R=Object.hasOwnProperty;(function(t){if(!c(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};C(t,(function(r,o){var i=_(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!c(u))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==u.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+u.length+" ("+u+"), got "+i);var c=function(t){var r=_(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!O(e,(function(t){return w(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:c,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}}))})([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var N=function(t){var e=[],n=[];return C(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}},A=function(t){return{isValue:m,isError:d,getOr:l(t),getOrThunk:l(t),getOrDie:l(t),or:function(e){return A(t)},orThunk:function(e){return A(t)},fold:function(e,n){return n(t)},map:function(e){return A(e(t))},mapError:function(e){return A(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return v.some(t)}}},D=function(t){return{isValue:d,isError:m,getOr:f,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:f,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return D(t)},mapError:function(e){return D(e(t))},each:s,bind:function(e){return D(t)},exists:d,forall:m,toOptional:v.none}},M={value:A,error:D,fromOption:function(t,e){return t.fold((function(){return D(e)}),A)}},B=function(t){return"inline-command"===t.type||"inline-format"===t.type},z=function(t){return"block-command"===t.type||"block-format"===t.type},P=function(t){return e=t,n=function(t,e){return t.start.length===e.start.length?0:t.start.length>e.start.length?-1:1},(r=b.call(e,0)).sort(n),r;var e,n,r},L=function(t){var e=function(e){return M.error({message:e,pattern:t})},n=function(n,r,o){if(void 0!==t.format){var i=void 0;if(c(t.format)){if(!O(t.format,a))return e(n+" pattern has non-string items in the `format` array");i=t.format}else{if(!a(t.format))return e(n+" pattern has non-string `format` parameter");i=[t.format]}return M.value(r(i))}return void 0!==t.cmd?a(t.cmd)?M.value(o(t.cmd,t.value)):e(n+" pattern has non-string `cmd` parameter"):e(n+" pattern is missing both `format` and `cmd` parameters")};if(!u(t))return e("Raw pattern is not an object");if(!a(t.start))return e("Raw pattern is missing `start` parameter");if(void 0!==t.end){if(!a(t.end))return e("Inline pattern has non-string `end` parameter");if(0===t.start.length&&0===t.end.length)return e("Inline pattern has empty `start` and `end` parameters");var r=t.start,o=t.end;return 0===o.length&&(o=r,r=""),n("Inline",(function(t){return{type:"inline-format",start:r,end:o,format:t}}),(function(t,e){return{type:"inline-command",start:r,end:o,cmd:t,value:e}}))}return void 0!==t.replacement?a(t.replacement)?0===t.start.length?e("Replacement pattern has empty `start` parameter"):M.value({type:"inline-command",start:"",end:t.start,cmd:"mceInsertContent",value:t.replacement}):e("Replacement pattern has non-string `replacement` parameter"):0===t.start.length?e("Block pattern has empty `start` parameter"):n("Block",(function(e){return{type:"block-format",start:t.start,format:e[0]}}),(function(e,n){return{type:"block-command",start:t.start,cmd:e,value:n}}))},I=function(t){return"block-command"===t.type?{start:t.start,cmd:t.cmd,value:t.value}:"block-format"===t.type?{start:t.start,format:t.format}:"inline-command"===t.type?"mceInsertContent"===t.cmd&&""===t.start?{start:t.end,replacement:t.value}:{start:t.start,end:t.end,cmd:t.cmd,value:t.value}:"inline-format"===t.type?{start:t.start,end:t.end,format:1===t.format.length?t.format[0]:t.format}:void 0},H=function(t){return{inlinePatterns:S(t,B),blockPatterns:P(S(t,z))}},F="undefined"!=typeof window?window:Function("return this;")(),V=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=F.console;n&&(n.error?n.error.apply(n,t):n.log.apply(n,t))},j=[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],U=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},W=tinymce.util.Tools.resolve("tinymce.util.Delay"),q=tinymce.util.Tools.resolve("tinymce.util.VK"),$=tinymce.util.Tools.resolve("tinymce.util.Tools"),G=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),K=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),X=function(t,e){return{container:t,offset:e}},Y=function(t){return t.nodeType===Node.TEXT_NODE},J=function(t,e,n){if(e&&t.isEmpty(e)&&!n(e)){var r=e.parentNode;t.remove(e),J(t,r,n)}},Q=function(t,e,n,r){void 0===r&&(r=!0);var o=e.startContainer.parentNode,i=e.endContainer.parentNode;e.deleteContents(),r&&!n(e.startContainer)&&(Y(e.startContainer)&&0===e.startContainer.data.length&&t.remove(e.startContainer),Y(e.endContainer)&&0===e.endContainer.data.length&&t.remove(e.endContainer),J(t,o,n),o!==i&&J(t,i,n))},Z=function(t,e){var n=e.get(t);return c(n)&&E(n).exists((function(t){return e=t,n="block",R.call(e,n);var e,n}))},tt=function(t){return 0===t.start.length},et=function(t,e){var n=v.from(t.dom.getParent(e.startContainer,t.dom.isBlock));return""===U(t)?n.orThunk((function(){return v.some(t.getBody())})):n},nt=G.DOM,rt=function(t){return function(e){return t===e?-1:0}},ot=function(t,e,n){if(Y(t)&&e>=0)return v.some(X(t,e));var r=K(nt);return v.from(r.backwards(t,e,rt(t),n)).map((function(t){return X(t.container,t.container.data.length)}))},it=function(t,e,n){if(!Y(t))return v.none();var r=t.textContent;if(e>=0&&e<=r.length)return v.some(X(t,e));var o=K(nt);return v.from(o.backwards(t,e,rt(t),n)).bind((function(t){var r=t.container.data;return it(t.container,e+r.length,n)}))},at=function(t,e,n){if(!Y(t))return v.none();var r=t.textContent;if(e<=r.length)return v.some(X(t,e));var o=K(nt);return v.from(o.forwards(t,e,rt(t),n)).bind((function(t){return at(t.container,e-r.length,n)}))},ut=function(t,e,n,r,o){var i=K(t,function(t){return function(e){return t.isBlock(e)||w(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}}(t));return v.from(i.backwards(e,n,r,o))},ct=function(t,e,n){if(Y(e)&&(n<0||n>e.data.length))return[];for(var r=[n],o=e;o!==t&&o.parentNode;){for(var i=o.parentNode,a=0;a<i.childNodes.length;a++)if(i.childNodes[a]===o){r.push(a);break}o=i}return o===t?r.reverse():[]},st=function(t,e,n,r,o){return{start:ct(t,e,n),end:ct(t,r,o)}},lt=function(t,e){var n,r,o,i=e.slice(),a=i.pop();return(n=i,r=function(t,e){return t.bind((function(t){return v.from(t.childNodes[e])}))},o=v.some(t),C(n,(function(t,e){o=r(o,t,e)})),o).bind((function(t){return Y(t)&&(a<0||a>t.data.length)?v.none():v.some({node:t,offset:a})}))},ft=function(t,e){return lt(t,e.start).bind((function(n){var r=n.node,o=n.offset;return lt(t,e.end).map((function(t){var e=t.node,n=t.offset,i=document.createRange();return i.setStart(r,o),i.setEnd(e,n),i}))}))},dt=function(t,e,n){(function(t,e,n){if(Y(t)&&e>=t.length)return v.some(X(t,e));var r=K(nt);return v.from(r.forwards(t,e,rt(t),n)).map((function(t){return X(t.container,0)}))})(e,0,e).each((function(r){var o=r.container;at(o,n.start.length,e).each((function(n){var r=t.createRng();r.setStart(o,0),r.setEnd(n.container,n.offset),Q(t,r,(function(t){return t===e}))}))}))},mt=function(t,e){var n=t.dom,r=t.selection.getRng();return et(t,r).filter((function(e){var r=U(t),o=""===r&&n.is(e,"body")||n.is(e,r);return null!==e&&o})).bind((function(t){var r=t.textContent;return function(t,e){var n=e.replace(" "," ");return T(t,(function(t){return 0===e.indexOf(t.start)||0===n.indexOf(t.start)}))}(e,r).map((function(e){return $.trim(r).length===e.start.length?[]:[{pattern:e,range:st(n.getRoot(),t,0,t,0)}]}))})).getOr([])},gt=function(t,e){if(0!==e.length){var n=t.selection.getBookmark();C(e,(function(e){return function(t,e){var n=t.dom,r=e.pattern,o=ft(n.getRoot(),e.range).getOrDie("Unable to resolve path range");return et(t,o).each((function(e){"block-format"===r.type?Z(r.format,t.formatter)&&t.undoManager.transact((function(){dt(t.dom,e,r),t.formatter.apply(r.format)})):"block-command"===r.type&&t.undoManager.transact((function(){dt(t.dom,e,r),t.execCommand(r.cmd,!1,r.value)}))})),!0}(t,e)})),t.selection.moveToBookmark(n)}},ht=0,pt=function(t,e){return t.create("span",{"data-mce-type":"bookmark",id:e})},vt=function(t,e){var n=t.createRng();return n.setStartAfter(e.start),n.setEndBefore(e.end),n},bt=function(t,e,n){var r=ft(t.getRoot(),n).getOrDie("Unable to resolve path range"),o=r.startContainer,i=r.endContainer,a=0===r.endOffset?i:i.splitText(r.endOffset),u=0===r.startOffset?o:o.splitText(r.startOffset);return{prefix:e,end:a.parentNode.insertBefore(pt(t,e+"-end"),a),start:u.parentNode.insertBefore(pt(t,e+"-start"),u)}},yt=function(t,e,n){J(t,t.get(e.prefix+"-end"),n),J(t,t.get(e.prefix+"-start"),n)},wt=function(t,e,n,r){var o,i=e.start;return ut(t,r.container,r.offset,(o=i,function(t,e){var n=t.data.substring(0,e),r=n.lastIndexOf(o.charAt(o.length-1)),i=n.lastIndexOf(o);return-1!==i?i+o.length:-1!==r?r+1:-1}),n).bind((function(r){if(r.offset>=i.length){var o=t.createRng();return o.setStart(r.container,r.offset-i.length),o.setEnd(r.container,r.offset),v.some(o)}var a=r.offset-i.length;return it(r.container,a,n).map((function(e){var n=t.createRng();return n.setStart(e.container,e.offset),n.setEnd(r.container,r.offset),n})).filter((function(t){return t.toString()===i})).orThunk((function(){return wt(t,e,n,X(r.container,0))}))}))},xt=function(t,e,n){var r=t.dom,o=r.getRoot(),i=n.pattern,a=n.position.container,u=n.position.offset;return it(a,u-n.pattern.end.length,e).bind((function(c){var s=st(o,c.container,c.offset,a,u);if(tt(i))return v.some({matches:[{pattern:i,startRng:s,endRng:s}],position:c});var l=Ct(t,n.remainingPatterns,c.container,c.offset,e),f=l.getOr({matches:[],position:c}),d=f.position;return function(t,e,n,r,o,i){if(void 0===i&&(i=!1),0===e.start.length&&!i){var a=t.createRng();return a.setStart(n,r),a.setEnd(n,r),v.some(a)}return ot(n,r,o).bind((function(n){return wt(t,e,o,n).bind((function(t){if(i){if(t.endContainer===n.container&&t.endOffset===n.offset)return v.none();if(0===n.offset&&t.endContainer.textContent.length===t.endOffset)return v.none()}return v.some(t)}))}))}(r,i,d.container,d.offset,e,l.isNone()).map((function(t){var e=function(t,e){return st(t,e.startContainer,e.startOffset,e.endContainer,e.endOffset)}(o,t);return{matches:f.matches.concat([{pattern:i,startRng:e,endRng:s}]),position:X(t.startContainer,t.startOffset)}}))}))},Ct=function(t,e,n,r,o){var i=t.dom;return ot(n,r,i.getRoot()).bind((function(a){var u=i.createRng();u.setStart(o,0),u.setEnd(n,r);for(var c,s,l=u.toString(),f=0;f<e.length;f++){var d=e[f];if(c=l,s=d.end,function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(c,s,c.length-s.length)){var m=e.slice();m.splice(f,1);var g=xt(t,o,{pattern:d,remainingPatterns:m,position:a});if(g.isSome())return g}}return v.none()}))},St=function(t,e,n){t.selection.setRng(n),"inline-format"===e.type?C(e.format,(function(e){t.formatter.apply(e)})):t.execCommand(e.cmd,!1,e.value)},kt=function(t,n){var r,o,i=(r="mce_textpattern",o=(new Date).getTime(),r+"_"+Math.floor(1e9*Math.random())+ ++ht+String(o)),a=k(n,(function(n,r){var o=bt(t,i+"_end"+n.length,r.endRng);return n.concat([e(e({},r),{endMarker:o})])}),[]);return k(a,(function(n,r){var o=a.length-n.length-1,u=tt(r.pattern)?r.endMarker:bt(t,i+"_start"+o,r.startRng);return n.concat([e(e({},r),{startMarker:u})])}),[])},Tt=function(t,e,n){var r=t.selection.getRng();return!1===r.collapsed?[]:et(t,r).bind((function(o){var i=r.startOffset-(n?1:0);return Ct(t,e,r.startContainer,i,o)})).fold((function(){return[]}),(function(t){return t.matches}))},Ot=function(t,e){if(0!==e.length){var n=t.dom,r=t.selection.getBookmark(),o=kt(n,e);C(o,(function(e){var r=n.getParent(e.startMarker.start,n.isBlock),o=function(t){return t===r};tt(e.pattern)?function(t,e,n,r){var o=vt(t.dom,n);Q(t.dom,o,r),St(t,e,o)}(t,e.pattern,e.endMarker,o):function(t,e,n,r,o){var i=t.dom,a=vt(i,r),u=vt(i,n);Q(i,u,o),Q(i,a,o);var c={prefix:n.prefix,start:n.end,end:r.start},s=vt(i,c);St(t,e,s)}(t,e.pattern,e.startMarker,e.endMarker,o),yt(n,e.endMarker,o),yt(n,e.startMarker,o)})),t.selection.moveToBookmark(r)}},Et=function(t,e){var n=Tt(t,e.inlinePatterns,!0);n.length>0&&t.undoManager.transact((function(){Ot(t,n)}))},_t=function(t,e,n){for(var r=0;r<t.length;r++)if(n(t[r],e))return!0;return!1},Rt=function(t,e){var n=[",",".",";",":","!","?"],r=[32];t.on("keydown",(function(n){13!==n.keyCode||q.modifierPressed(n)||function(t,e){if(!t.selection.isCollapsed())return!1;var n=Tt(t,e.inlinePatterns,!1),r=mt(t,e.blockPatterns);return(r.length>0||n.length>0)&&(t.undoManager.add(),t.undoManager.extra((function(){t.execCommand("mceInsertNewLine")}),(function(){t.insertContent("\ufeff"),Ot(t,n),gt(t,r);var e=t.selection.getRng(),o=ot(e.startContainer,e.startOffset,t.dom.getRoot());t.execCommand("mceInsertNewLine"),o.each((function(e){var n=e.container;"\ufeff"===n.data.charAt(e.offset-1)&&(n.deleteData(e.offset-1,1),J(t.dom,n.parentNode,(function(e){return e===t.dom.getRoot()})))}))})),!0)}(t,e.get())&&n.preventDefault()}),!0),t.on("keyup",(function(n){_t(r,n,(function(t,e){return t===e.keyCode&&!1===q.modifierPressed(e)}))&&Et(t,e.get())})),t.on("keypress",(function(r){_t(n,r,(function(t,e){return t.charCodeAt(0)===e.charCode}))&&W.setEditorTimeout(t,(function(){Et(t,e.get())}))}))};t.add("textpattern",(function(t){var e=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}}(function(t){var e=t.getParam("textpattern_patterns",j,"array");if(!c(e))return V("The setting textpattern_patterns should be an array"),{inlinePatterns:[],blockPatterns:[]};var n=N(x(e,L));return C(n.errors,(function(t){return V(t.message,t.pattern)})),H(n.values)}(t));return Rt(t,e),function(t){return{setPatterns:function(e){var n=N(x(e,L));if(n.errors.length>0){var r=n.errors[0];throw new Error(r.message+":\n"+JSON.stringify(r.pattern,null,2))}t.set(H(n.values))},getPatterns:function(){return n(n([],x(t.get().inlinePatterns,I),!0),x(t.get().blockPatterns,I),!0)}}}(e)}))}()},3356:(t,e,n)=>{n(3562)},3562:()=>{!function(){"use strict";var t,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return t},r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o="[-'\\.‘’․﹒'.]",i="[:··״‧︓﹕:]",a="[±+*/,;;։،؍٬߸⁄︐︔﹐﹔,;]",u="[0-9٠-٩٫۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹]",c="\\r",s="\\n",l="[\v\f…\u2028\u2029]",f="[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᯦᮪-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-ᷦ᷼-᷿‌‍⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-゙゚︦]",d="[­؀-؃۝܏឴឵‎‏‪-‮⁠-⁤-\ufeff-]",m="[〱-〵゛゜゠-ヺー-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ン]",g="[=_‿⁀⁔︳︴﹍-﹏_∀-⋿<>]",h="[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]",p=0,v=1,b=2,y=3,w=4,x=5,C=6,S=7,k=8,T=9,O=10,E=11,_=12,R=13,N=[new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-׳ؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆༀཀ-ཇཉ-ཬྈ-ྌႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᯀ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〻〼ㄅ-ㄭㄱ-ㆎㆠ-ㆺꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐꞑꞠ-ꞩꟺ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),new RegExp(o),new RegExp(i),new RegExp(a),new RegExp(u),new RegExp(c),new RegExp(s),new RegExp(l),new RegExp(f),new RegExp(d),new RegExp(m),new RegExp(g),new RegExp("@")],A=new RegExp("^"+h+"$"),D=N,M=R,B=function(t){for(var e=M,n=D.length,r=0;r<n;++r){var o=D[r];if(o&&o.test(t)){e=r;break}}return e},z=function(t){var e,n;return function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t,(e=B,n={},function(t){if(n[t])return n[t];var r=e(t);return n[t]=r,r}))},P=function(t,e){var n=t[e],r=t[e+1];if(e<0||e>t.length-1&&0!==e)return!1;if(n===p&&r===p)return!1;var o=t[e+2];if(n===p&&(r===b||r===v||r===_)&&o===p)return!1;var i=t[e-1];return(n!==b&&n!==v&&r!==_||r!==p||i!==p)&&((n!==w&&n!==p||r!==w&&r!==p)&&((n!==y&&n!==v||r!==w||i!==w)&&((n!==w||r!==y&&r!==v||o!==w)&&(n!==k&&n!==T&&i!==k&&i!==T&&r!==k&&r!==T&&((n!==x||r!==C)&&(n===S||n===x||n===C||(r===S||r===x||r===C||(n!==O||r!==O)&&((r!==E||n!==p&&n!==w&&n!==O&&n!==E)&&((n!==E||r!==p&&r!==w&&r!==O)&&n!==_)))))))))},L=/^\s+$/,I=A,H=function(t){return"http"===t||"https"===t},F=function(t,e){var n=function(t,e){var n;for(n=e;n<t.length&&!L.test(t[n]);n++);return n}(t,e+1);return"://"===t.slice(e+1,n).join("").substr(0,3)?n:e},V=function(t,e,n){n=r(r({},{includeWhitespace:!1,includePunctuation:!1}),n);for(var o=[],i=[],a=0;a<t.length;a++){var u=e(t[a]);"\ufeff"!==u&&(o.push(t[a]),i.push(u))}return function(t,e,n,r){for(var o=[],i=[],a=0;a<n.length;++a)if(i.push(t[a]),P(n,a)){var u=e[a];if((r.includeWhitespace||!L.test(u))&&(r.includePunctuation||!I.test(u))){var c=a-i.length+1,s=a+1,l=e.slice(c,s).join("");if(H(l)){var f=F(e,a),d=t.slice(s,f);Array.prototype.push.apply(i,d),a=f}o.push(i)}i=[]}return o}(o,i,z(i),n)},j=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),U=function(t,e){for(var n=e.getBlockElements(),r=e.getShortEndedElements(),o=function(t){return n[t.nodeName]||r[t.nodeName]},i=[],a="",u=new j(t,t);t=u.next();)3===t.nodeType?a+=t.data.replace(/\uFEFF/g,""):o(t)&&a.length&&(i.push(a),a="");return a.length&&i.push(a),i},W=function(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},q=function(t,e){var r=U(t,e).join("\n");return V(r.split(""),n).length},$=function(t,e){var n=U(t,e).join("");return W(n)},G=function(t,e){var n=U(t,e).join("").replace(/\s/g,"");return W(n)},K=function(t,e){return function(){return e(t.getBody(),t.schema)}},X=function(t,e){return function(){return e(t.selection.getRng().cloneContents(),t.schema)}},Y=function(t){return K(t,q)},J=function(t,e){t.addCommand("mceWordCount",(function(){return function(t,e){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(e.body.getWordCount()),String(e.selection.getWordCount())],["Characters (no spaces)",String(e.body.getCharacterCountWithoutSpaces()),String(e.selection.getCharacterCountWithoutSpaces())],["Characters",String(e.body.getCharacterCount()),String(e.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})}(t,e)}))},Q=tinymce.util.Tools.resolve("tinymce.util.Delay"),Z=function(t,e){!function(t,e){t.fire("wordCountUpdate",{wordCount:{words:e.body.getWordCount(),characters:e.body.getCharacterCount(),charactersWithoutSpaces:e.body.getCharacterCountWithoutSpaces()}})}(t,e)};void 0===t&&(t=300),e.add("wordcount",(function(e){var n=function(t){return{body:{getWordCount:Y(t),getCharacterCount:K(t,$),getCharacterCountWithoutSpaces:K(t,G)},selection:{getWordCount:X(t,q),getCharacterCount:X(t,$),getCharacterCountWithoutSpaces:X(t,G)},getCount:Y(t)}}(e);return J(e,n),function(t){var e=function(){return t.execCommand("mceWordCount")};t.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:e}),t.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:e})}(e),function(t,e,n){var r=Q.debounce((function(){return Z(t,e)}),n);t.on("init",(function(){Z(t,e),Q.setEditorTimeout(t,(function(){t.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",r)}),0)}))}(e,n,t),n}))}()},5187:(t,e,n)=>{var r={"./content/dark/content.css":2968,"./content/dark/content.min.css":6202,"./content/default/content.css":7286,"./content/default/content.min.css":7362,"./content/document/content.css":287,"./content/document/content.min.css":2271,"./content/writer/content.css":5417,"./content/writer/content.min.css":874,"./ui/oxide-dark/content.css":3341,"./ui/oxide-dark/content.inline.css":8786,"./ui/oxide-dark/content.inline.min.css":4243,"./ui/oxide-dark/content.min.css":9702,"./ui/oxide-dark/content.mobile.css":1389,"./ui/oxide-dark/content.mobile.min.css":3513,"./ui/oxide-dark/fonts/tinymce-mobile.woff":1064,"./ui/oxide-dark/skin.css":8057,"./ui/oxide-dark/skin.min.css":6332,"./ui/oxide-dark/skin.mobile.css":4429,"./ui/oxide-dark/skin.mobile.min.css":18,"./ui/oxide-dark/skin.shadowdom.css":7899,"./ui/oxide-dark/skin.shadowdom.min.css":7548,"./ui/oxide/content.css":9506,"./ui/oxide/content.inline.css":8273,"./ui/oxide/content.inline.min.css":7251,"./ui/oxide/content.min.css":6122,"./ui/oxide/content.mobile.css":993,"./ui/oxide/content.mobile.min.css":8215,"./ui/oxide/fonts/tinymce-mobile.woff":9916,"./ui/oxide/skin.css":8382,"./ui/oxide/skin.min.css":4522,"./ui/oxide/skin.mobile.css":108,"./ui/oxide/skin.mobile.min.css":8537,"./ui/oxide/skin.shadowdom.css":818,"./ui/oxide/skin.shadowdom.min.css":6913};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=5187},8860:(t,e,n)=>{n(1768)},1768:(t,e,n)=>{!function(){"use strict";var t=function(t){return function(e){return function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(e)===t}},e=function(t){return function(e){return typeof e===t}},r=function(t){return function(e){return t===e}},o=t("string"),i=t("object"),a=t("array"),u=r(null),c=e("boolean"),s=r(void 0),l=function(t){return null==t},f=function(t){return!l(t)},d=e("function"),m=e("number"),g=function(t,e){if(a(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},h=function(){},p=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},v=function(t){return function(){return t}},b=function(t){return t},y=function(t,e){return t===e};function w(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var x=function(t){return function(e){return!t(e)}},C=function(t){return function(){throw new Error(t)}},S=v(!1),k=v(!0),T=tinymce.util.Tools.resolve("tinymce.ThemeManager"),O=function(){return(O=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function E(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function _(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var R,N,A=function(){return D},D={fold:function(t,e){return t()},isSome:S,isNone:k,getOr:N=b,getOrThunk:R=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:v(null),getOrUndefined:v(void 0),or:N,orThunk:R,map:A,each:h,bind:A,exists:S,forall:k,filter:function(){return A()},toArray:function(){return[]},toString:v("none()")},M=function(t){var e=v(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:k,isNone:S,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return M(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:D},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},B={some:M,none:A,from:function(t){return null==t?D:M(t)}},z=Array.prototype.slice,P=Array.prototype.indexOf,L=Array.prototype.push,I=function(t,e){return P.call(t,e)},H=function(t,e){return I(t,e)>-1},F=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},V=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},j=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=z.call(t,r,r+e);n.push(o)}return n},U=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},W=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},q=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var a=t[o];(e(a,o)?n:r).push(a)}return{pass:n,fail:r}},$=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},G=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,(function(t,r){n=e(n,t,r)})),n},K=function(t,e,n){return W(t,(function(t,r){n=e(n,t,r)})),n},X=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return B.some(i);if(n(i,r))break}return B.none()}(t,e,S)},Y=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return B.some(n)}return B.none()},J=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!a(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);L.apply(e,t[n])}return e},Q=function(t,e){return J(U(t,e))},Z=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},tt=function(t){var e=z.call(t,0);return e.reverse(),e},et=function(t,e){return $(t,(function(t){return!H(e,t)}))},nt=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},rt=function(t){return[t]},ot=function(t,e){var n=z.call(t,0);return n.sort(e),n},it=function(t,e){return e>=0&&e<t.length?B.some(t[e]):B.none()},at=function(t){return it(t,0)},ut=function(t){return it(t,t.length-1)},ct=d(Array.from)?Array.from:function(t){return z.call(t)},st=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return B.none()},lt=Object.keys,ft=Object.hasOwnProperty,dt=function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},mt=function(t,e){return gt(t,(function(t,n){return{k:n,v:e(t,n)}}))},gt=function(t,e){var n={};return dt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},ht=function(t,e){var n={};return function(t,e,n,r){dt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),h),n},pt=function(t,e){var n=[];return dt(t,(function(t,r){n.push(e(t,r))})),n},vt=function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r],a=t[i];if(e(a,i,t))return B.some(a)}return B.none()},bt=function(t){return pt(t,b)},yt=function(t,e){return wt(t,e)?B.from(t[e]):B.none()},wt=function(t,e){return ft.call(t,e)},xt=function(t,e){return wt(t,e)&&void 0!==t[e]&&null!==t[e]},Ct=function(t,e,n){return void 0===n&&(n=y),t.exists((function(t){return n(t,e)}))},St=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},kt=function(t,e,n){return t.isSome()&&e.isSome()?B.some(n(t.getOrDie(),e.getOrDie())):B.none()},Tt=function(t,e){return t?B.some(e):B.none()},Ot=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},Et=function(t,e){return-1!==t.indexOf(e)},_t=function(t,e){return Ot(t,e,0)},Rt=function(t,e){return Ot(t,e,t.length-e.length)},Nt=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),At=function(t){return t.length>0},Dt=function(t){return void 0!==t.style&&d(t.style.getPropertyValue)},Mt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Bt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Mt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Mt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Mt(n)},fromDom:Mt,fromPoint:function(t,e,n){return B.from(t.dom.elementFromPoint(e,n)).map(Mt)}};"undefined"!=typeof window?window:Function("return this;")();var zt,Pt=function(t){return t.dom.nodeName.toLowerCase()},Lt=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},It=Lt(1),Ht=Lt(3),Ft=Lt(9),Vt=Lt(11),jt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Ut=function(){return Wt(0,0)},Wt=function(t,e){return{major:t,minor:e}},qt={nu:Wt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Ut():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Wt(r(1),r(2))}(t,n)},unknown:Ut},$t=function(t,e){var n=String(e).toLowerCase();return X(t,(function(t){return t.search(n)}))},Gt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Kt=function(t){return function(e){return Et(e,t)}},Xt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Et(t,"edge/")&&Et(t,"chrome")&&Et(t,"safari")&&Et(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Gt],search:function(t){return Et(t,"chrome")&&!Et(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Et(t,"msie")||Et(t,"trident")}},{name:"Opera",versionRegexes:[Gt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Kt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Kt("firefox")},{name:"Safari",versionRegexes:[Gt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Et(t,"safari")||Et(t,"mobile/"))&&Et(t,"applewebkit")}}],Yt=[{name:"Windows",search:Kt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Et(t,"iphone")||Et(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Kt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Kt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Kt("linux"),versionRegexes:[]},{name:"Solaris",search:Kt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Kt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Kt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Jt={browsers:v(Xt),oses:v(Yt)},Qt="Edge",Zt="Chrome",te="Opera",ee="Firefox",ne="Safari",re=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Qt),isChrome:r(Zt),isIE:r("IE"),isOpera:r(te),isFirefox:r(ee),isSafari:r(ne)}},oe={unknown:function(){return re({current:void 0,version:qt.unknown()})},nu:re,edge:v(Qt),chrome:v(Zt),ie:v("IE"),opera:v(te),firefox:v(ee),safari:v(ne)},ie="Windows",ae="Android",ue="Linux",ce="Solaris",se="FreeBSD",le="ChromeOS",fe=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(ie),isiOS:r("iOS"),isAndroid:r(ae),isOSX:r("OSX"),isLinux:r(ue),isSolaris:r(ce),isFreeBSD:r(se),isChromeOS:r(le)}},de={unknown:function(){return fe({current:void 0,version:qt.unknown()})},nu:fe,windows:v(ie),ios:v("iOS"),android:v(ae),linux:v(ue),osx:v("OSX"),solaris:v(ce),freebsd:v(se),chromeos:v(le)},me=function(t,e,n){var r=Jt.browsers(),o=Jt.oses(),i=e.bind((function(t){return function(t,e){return st(e.brands,(function(e){var n=e.brand.toLowerCase();return X(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:qt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return $t(t,e).map((function(t){var n=qt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(oe.unknown,oe.nu),a=function(t,e){return $t(t,e).map((function(t){var n=qt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(de.unknown,de.nu),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:v(o),isiPhone:v(i),isTablet:v(c),isPhone:v(s),isTouch:v(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:v(l),isDesktop:v(f)}}(a,i,t,n);return{browser:i,os:a,deviceType:u}},ge=function(t){return window.matchMedia(t).matches},he=jt((function(){return me(navigator.userAgent,B.from(navigator.userAgentData),ge)})),pe=function(){return he()},ve=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},be=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},ye=function(t,e){return t.dom===e.dom},we=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)}(t.dom,e.dom)},xe=function(t,e){return pe().browser.isIE()?we(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Ce=function(t){return Bt.fromDom(t.dom.ownerDocument)},Se=function(t){return Ft(t)?t:Ce(t)},ke=function(t){return Bt.fromDom(Se(t).dom.documentElement)},Te=function(t){return Bt.fromDom(Se(t).dom.defaultView)},Oe=function(t){return B.from(t.dom.parentNode).map(Bt.fromDom)},Ee=function(t){return B.from(t.dom.offsetParent).map(Bt.fromDom)},_e=function(t){return U(t.dom.childNodes,Bt.fromDom)},Re=function(t,e){var n=t.dom.childNodes;return B.from(n[e]).map(Bt.fromDom)},Ne=function(t,e){return{element:t,offset:e}},Ae=function(t,e){var n=_e(t);return n.length>0&&e<n.length?Ne(n[e],0):Ne(t,e)},De=function(t){return Vt(t)&&f(t.dom.host)},Me=d(Element.prototype.attachShadow)&&d(Node.prototype.getRootNode),Be=v(Me),ze=Me?function(t){return Bt.fromDom(t.dom.getRootNode())}:Se,Pe=function(t){return De(t)?t:Bt.fromDom(Se(t).dom.body)},Le=function(t){var e=ze(t);return De(e)?B.some(e):B.none()},Ie=function(t){return Bt.fromDom(t.dom.host)},He=function(t){return f(t.dom.shadowRoot)},Fe=function(t){var e=Ht(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return Le(Bt.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=Fe,r=Ie,function(t){return n(r(t))}))},Ve=function(){return je(Bt.fromDom(document))},je=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return Bt.fromDom(e)},Ue=function(t,e,n){if(!(o(n)||c(n)||m(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},We=function(t,e,n){Ue(t.dom,e,n)},qe=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},$e=function(t,e){return B.from(qe(t,e))},Ge=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Ke=function(t,e){t.dom.removeAttribute(e)},Xe=function(t,e,n){if(!o(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Dt(t)&&t.style.setProperty(e,n)},Ye=function(t,e){Dt(t)&&t.style.removeProperty(e)},Je=function(t,e,n){var r=t.dom;Xe(r,e,n)},Qe=function(t,e){var n=t.dom;dt(e,(function(t,e){Xe(n,e,t)}))},Ze=function(t,e){var n=t.dom;dt(e,(function(t,e){t.fold((function(){Ye(n,e)}),(function(t){Xe(n,e,t)}))}))},tn=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Fe(t)?r:en(n,e)},en=function(t,e){return Dt(t)?t.style.getPropertyValue(e):""},nn=function(t,e){var n=t.dom,r=en(n,e);return B.from(r).filter((function(t){return t.length>0}))},rn=function(t){var e={},n=t.dom;if(Dt(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},on=function(t,e,n){var r=Bt.fromTag(t);return Je(r,e,n),nn(r,e).isSome()},an=function(t,e){var n=t.dom;Ye(n,e),Ct($e(t,"style").map(Nt),"")&&Ke(t,"style")},un=function(t){return t.dom.offsetWidth},cn=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=tn(n,t);return parseFloat(o)||0}return r},r=function(t,e){return K(e,(function(e,n){var r=tn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!m(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Dt(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},sn=cn("height",(function(t){var e=t.dom;return Fe(t)?e.getBoundingClientRect().height:e.offsetHeight})),ln=function(t){return sn.get(t)},fn=function(t){return sn.getOuter(t)},dn=function(t,e){return{left:t,top:e,translate:function(n,r){return dn(t+n,e+r)}}},mn=dn,gn=function(t,e){return void 0!==t?t:void 0!==e?e:0},hn=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return mn(n.offsetLeft,n.offsetTop);var i=gn(null==r?void 0:r.pageYOffset,o.scrollTop),a=gn(null==r?void 0:r.pageXOffset,o.scrollLeft),u=gn(o.clientTop,n.clientTop),c=gn(o.clientLeft,n.clientLeft);return pn(t).translate(a-c,i-u)},pn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?mn(n.offsetLeft,n.offsetTop):Fe(t)?function(t){var e=t.getBoundingClientRect();return mn(e.left,e.top)}(e):mn(0,0)},vn=cn("width",(function(t){return t.dom.offsetWidth})),bn=function(t){return vn.get(t)},yn=function(t){return vn.getOuter(t)},wn=function(t){var e=Bt.fromDom(function(t){if(Be()&&f(t.target)){var e=Bt.fromDom(t.target);if(It(e)&&He(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return at(n)}}return B.from(t.target)}(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=p(r,n);return function(t,e,n,r,o,i,a){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:a}}(e,t.clientX,t.clientY,n,r,o,t)},xn=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(wn(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:w(Cn,t,e,i,o)}},Cn=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Sn=function(t,e){Oe(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},kn=function(t,e){(function(t){return B.from(t.dom.nextSibling).map(Bt.fromDom)})(t).fold((function(){Oe(t).each((function(t){On(t,e)}))}),(function(t){Sn(t,e)}))},Tn=function(t,e){(function(t){return Re(t,0)})(t).fold((function(){On(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},On=function(t,e){t.dom.appendChild(e.dom)},En=function(t,e){W(e,(function(e){On(t,e)}))},_n=function(t){t.dom.textContent="",W(_e(t),(function(t){Rn(t)}))},Rn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Nn=function(t){var e,n=_e(t);n.length>0&&(e=t,W(n,(function(t){Sn(e,t)}))),Rn(t)},An=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return mn(n,r)},Dn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},Mn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Bn=function(t){var e=void 0===t?window:t,n=e.document,r=An(Bt.fromDom(n));return function(t){var e=void 0===t?window:t;return pe().browser.isFirefox()?B.none():B.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Mn(r.left,r.top,n,o)}),(function(t){return Mn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},zn=function(t,e){return t.view(e).fold(v([]),(function(e){var n=t.owner(e),r=zn(t,n);return[e].concat(r)}))},Pn=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?B.none():B.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Bt.fromDom)},owner:function(t){return Ce(t)}}),Ln=function(t){var e=Bt.fromDom(document),n=An(e);return function(t,e){var n=e.owner(t),r=zn(e,n);return B.some(r)}(t,Pn).fold(w(hn,t),(function(e){var r=pn(t),o=G(e,(function(t,e){var n=pn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return mn(o.left+r.left+n.left,o.top+r.top+n.top)}))},In=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Hn=function(t){var e=hn(t),n=yn(t),r=fn(t);return In(e.left,e.top,n,r)},Fn=function(t){var e=Ln(t),n=yn(t),r=fn(t);return In(e.left,e.top,n,r)},Vn=function(){return Bn(window)},jn=function(t){return{isValue:k,isError:S,getOr:v(t),getOrThunk:v(t),getOrDie:v(t),or:function(e){return jn(t)},orThunk:function(e){return jn(t)},fold:function(e,n){return n(t)},map:function(e){return jn(e(t))},mapError:function(e){return jn(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return B.some(t)}}},Un=function(t){return{isValue:S,isError:k,getOr:b,getOrThunk:function(t){return t()},getOrDie:function(){return C(String(t))()},or:b,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Un(t)},mapError:function(e){return Un(e(t))},each:h,bind:function(e){return Un(t)},exists:S,forall:k,toOptional:B.none}},Wn={value:jn,error:Un,fromOption:function(t,e){return t.fold((function(){return Un(e)}),jn)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(zt||(zt={}));var qn=function(t,e,n){return t.stype===zt.Error?e(t.serror):n(t.svalue)},$n=function(t){return{stype:zt.Value,svalue:t}},Gn=function(t){return{stype:zt.Error,serror:t}},Kn=function(t){return t.fold(Gn,$n)},Xn=function(t){return qn(t,Wn.error,Wn.value)},Yn=$n,Jn=function(t){var e=[],n=[];return W(t,(function(t){qn(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},Qn=Gn,Zn=function(t,e){return t.stype===zt.Value?e(t.svalue):t},tr=function(t,e){return t.stype===zt.Error?e(t.serror):t},er=function(t,e){return t.stype===zt.Value?{stype:zt.Value,svalue:e(t.svalue)}:t},nr=function(t,e){return t.stype===zt.Error?{stype:zt.Error,serror:e(t.serror)}:t},rr=qn,or=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},ir=function(t,e,n){switch(t.tag){case"field":return e(t.key,t.newKey,t.presence,t.prop);case"custom":return n(t.newKey,t.instantiator)}},ar=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var a in i)wt(i,a)&&(r[a]=t(r[a],i[a]))}return r}},ur=ar((function(t,e){return i(t)&&i(e)?ur(t,e):e})),cr=ar((function(t,e){return e})),sr=function(t){return{tag:"defaultedThunk",process:t}},lr=function(t){return sr(v(t))},fr=function(t){return{tag:"mergeWithThunk",process:t}},dr=function(t){return p(Qn,J)(t)},mr=function(t){var e=Jn(t);return e.errors.length>0?dr(e.errors):Yn(e.values)},gr=function(t){return i(t)&&lt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},hr=function(t,e){return Qn([{path:t,getErrorInfo:e}])},pr=function(t){return{extract:function(e,n){return tr(t(n),(function(t){return function(t,e){return hr(t,v(e))}(e,t)}))},toString:v("val")}},vr=pr(Yn),br=function(t,e,n,r){return yt(e,n).fold((function(){return function(t,e,n){return hr(t,(function(){return'Could not find valid *required* value for "'+e+'" in '+gr(n)}))}(t,n,e)}),r)},yr=function(t,e,n,r){return r(yt(t,e).getOrThunk((function(){return n(t)})))},wr=function(t,e,n,r,o){var i=function(t){return o.extract(e.concat([r]),t)},a=function(t){return t.fold((function(){return Yn(B.none())}),(function(t){var n=o.extract(e.concat([r]),t);return er(n,B.some)}))};switch(t.tag){case"required":return br(e,n,r,i);case"defaultedThunk":return yr(n,r,t.process,i);case"option":return function(t,e,n){return n(yt(t,e))}(n,r,a);case"defaultedOptionThunk":return function(t,e,n,r){return r(yt(t,e).map((function(e){return!0===e?n(t):e})))}(n,r,t.process,a);case"mergeWithThunk":return yr(n,r,v({}),(function(e){var r=ur(t.process(n),e);return i(r)}))}},xr=function(t){return{extract:function(e,n){return t().extract(e,n)},toString:function(){return t().toString()}}},Cr=function(t){return lt(ht(t,f))},Sr=function(t){var e=kr(t),n=G(t,(function(t,e){return ir(e,(function(e){var n;return ur(t,((n={})[e]=!0,n))}),v(t))}),{});return{extract:function(t,r){var o=c(r)?[]:Cr(r),i=$(o,(function(t){return!xt(n,t)}));return 0===i.length?e.extract(t,r):function(t,e){return hr(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,i)},toString:e.toString}},kr=function(t){return{extract:function(e,n){return function(t,e,n){for(var r={},o=[],i=0,a=n;i<a.length;i++){var u=a[i];ir(u,(function(n,i,a,u){var c=wr(a,t,e,n,u);rr(c,(function(t){o.push.apply(o,t)}),(function(t){r[i]=t}))}),(function(t,n){r[t]=n(e)}))}return o.length>0?Qn(o):Yn(r)}(e,n,t)},toString:function(){return"obj{\n"+U(t,(function(t){return ir(t,(function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},Tr=function(t){return{extract:function(e,n){var r=U(n,(function(n,r){return t.extract(e.concat(["["+r+"]"]),n)}));return mr(r)},toString:function(){return"array("+t.toString()+")"}}},Or=function(t){return{extract:function(e,n){for(var r=[],o=0,i=t;o<i.length;o++){var a=i[o].extract(e,n);if(a.stype===zt.Value)return a;r.push(a)}return mr(r)},toString:function(){return"oneOf("+U(t,(function(t){return t.toString()})).join(", ")+")"}}},Er=function(t,e){return{extract:function(n,r){var o=lt(r),i=function(e,n){return Tr(pr(t)).extract(e,n)}(n,o);return Zn(i,(function(t){var o=U(t,(function(t){return or(t,t,{tag:"required",process:{}},e)}));return kr(o).extract(n,r)}))},toString:function(){return"setOf("+e.toString()+")"}}},_r=p(Tr,kr),Rr=v(vr),Nr=function(t,e){return pr((function(n){var r=typeof n;return t(n)?Yn(n):Qn("Expected type: "+e+" but got: "+r)}))},Ar=Nr(m,"number"),Dr=Nr(o,"string"),Mr=Nr(c,"boolean"),Br=Nr(d,"function"),zr=function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every((function(e){return zr(t[e])}));default:return!1}},Pr=pr((function(t){return zr(t)?Yn(t):Qn("Expected value to be acceptable for sending via postMessage")})),Lr=function(t,e,n,r){return yt(n,r).fold((function(){return function(t,e,n){return hr(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+gr(e)}))}(t,n,r)}),(function(n){return n.extract(t.concat(["branch: "+r]),e)}))},Ir=function(t,e){return{extract:function(n,r){return yt(r,t).fold((function(){return function(t,e){return hr(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return Lr(n,r,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+lt(e)}}},Hr=function(t){return pr((function(e){return t(e).fold(Qn,Yn)}))},Fr=function(t,e){return Er((function(e){return Kn(t(e))}),e)},Vr=function(t,e,n){return Xn(function(t,e,n){var r=e.extract([t],n);return nr(r,(function(t){return{input:n,errors:t}}))}(t,e,n))},jr=function(t){return t.fold((function(t){throw new Error(Wr(t))}),b)},Ur=function(t,e,n){return jr(Vr(t,e,n))},Wr=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:v("... (only showing first ten failures)")}]):e,U(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+gr(t.input);var e,n},qr=function(t,e){return Ir(t,mt(e,kr))},$r=or,Gr=function(t,e){return{tag:"custom",newKey:t,instantiator:e}},Kr=function(t){return Hr((function(e){return H(t,e)?Wn.value(e):Wn.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},Xr=function(t){return $r(t,t,{tag:"required",process:{}},Rr())},Yr=function(t,e){return $r(t,t,{tag:"required",process:{}},e)},Jr=function(t){return Yr(t,Ar)},Qr=function(t){return Yr(t,Dr)},Zr=function(t,e){return $r(t,t,{tag:"required",process:{}},Kr(e))},to=function(t){return Yr(t,Br)},eo=function(t,e){return $r(t,t,{tag:"required",process:{}},kr(e))},no=function(t,e){return $r(t,t,{tag:"required",process:{}},_r(e))},ro=function(t,e){return $r(t,t,{tag:"required",process:{}},Tr(e))},oo=function(t){return $r(t,t,{tag:"option",process:{}},Rr())},io=function(t,e){return $r(t,t,{tag:"option",process:{}},e)},ao=function(t){return io(t,Ar)},uo=function(t){return io(t,Dr)},co=function(t){return io(t,Br)},so=function(t,e){return io(t,Tr(e))},lo=function(t,e){return io(t,kr(e))},fo=function(t,e){return $r(t,t,lr(e),Rr())},mo=function(t,e,n){return $r(t,t,lr(e),n)},go=function(t,e){return mo(t,e,Ar)},ho=function(t,e){return mo(t,e,Dr)},po=function(t,e,n){return mo(t,e,Kr(n))},vo=function(t,e){return mo(t,e,Mr)},bo=function(t,e){return mo(t,e,Br)},yo=function(t,e,n){return mo(t,e,Tr(n))},wo=function(t,e,n){return mo(t,e,kr(n))},xo=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Co=function(t){if(!a(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return W(t,(function(r,o){var i=lt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],c=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!a(c))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+c.length+" ("+c+"), got "+i);var a=function(t){var r=lt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!Z(e,(function(t){return H(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:a,log:function(t){console.log(t,{constructors:e,constructor:u,params:n})}}}})),n};Co([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var So,ko=function(t,e){return function(t,e){var n={};return dt(t,(function(t,r){H(e,r)||(n[r]=t)})),n}(t,e)},To=function(t,e){return function(t,e){var n;return(n={})[t]=e,n}(t,e)},Oo=function(t){return function(t){var e={};return W(t,(function(t){e[t.key]=t.value})),e}(t)},Eo=function(t,e){var n,r=function(t){var e=[],n=[];return W(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}(t);return r.errors.length>0?(n=r.errors,Wn.error(J(n))):function(t,e){return 0===t.length?Wn.value(e):Wn.value(ur(e,cr.apply(void 0,t)))}(r.values,e)},_o=function(t){return d(t)?t:S},Ro=function(t,e,n){for(var r=t.dom,o=_o(n);r.parentNode;){r=r.parentNode;var i=Bt.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return B.none()},No=function(t,e,n){var r=e(t),o=_o(n);return r.orThunk((function(){return o(t)?B.none():Ro(t,e,o)}))},Ao=function(t,e){return ye(t.element,e.event.target)},Do={can:k,abort:S,run:h},Mo=function(t){if(!xt(t,"can")&&!xt(t,"abort")&&!xt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return O(O({},Do),t)},Bo=function(t){return{can:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return K(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),abort:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return K(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort})),run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];W(t,(function(t){t.run.apply(void 0,e)}))}}},zo=v,Po=zo("touchstart"),Lo=zo("touchmove"),Io=zo("touchend"),Ho=zo("touchcancel"),Fo=zo("mousedown"),Vo=zo("mousemove"),jo=zo("mouseout"),Uo=zo("mouseup"),Wo=zo("mouseover"),qo=zo("focusin"),$o=zo("focusout"),Go=zo("keydown"),Ko=zo("keyup"),Xo=zo("input"),Yo=zo("change"),Jo=zo("click"),Qo=zo("transitioncancel"),Zo=zo("transitionend"),ti=zo("transitionstart"),ei=zo("selectstart"),ni=function(t){return v("alloy."+t)},ri={tap:ni("tap")},oi=ni("focus"),ii=ni("blur.post"),ai=ni("paste.post"),ui=ni("receive"),ci=ni("execute"),si=ni("focus.item"),li=ri.tap,fi=ni("longpress"),di=ni("sandbox.close"),mi=ni("typeahead.cancel"),gi=ni("system.init"),hi=ni("system.touchmove"),pi=ni("system.touchend"),vi=ni("system.scroll"),bi=ni("system.resize"),yi=ni("system.attached"),wi=ni("system.detached"),xi=ni("system.dismissRequested"),Ci=ni("system.repositionRequested"),Si=ni("focusmanager.shifted"),ki=ni("slotcontainer.visibility"),Ti=ni("change.tab"),Oi=ni("dismiss.tab"),Ei=ni("highlight"),_i=ni("dehighlight"),Ri=function(t,e){Mi(t,t.element,e,{})},Ni=function(t,e,n){Mi(t,t.element,e,n)},Ai=function(t){Ri(t,ci())},Di=function(t,e,n){Mi(t,e,n,{})},Mi=function(t,e,n,r){var o=O({target:e},r);t.getSystem().triggerEvent(n,e,o)},Bi=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},zi=function(t){return Oo(t)},Pi=function(t,e){return{key:t,value:Mo({abort:e})}},Li=function(t){return{key:t,value:Mo({run:function(t,e){e.event.prevent()}})}},Ii=function(t,e){return{key:t,value:Mo({run:e})}},Hi=function(t,e,n){return{key:t,value:Mo({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Fi=function(t){return function(e){return{key:t,value:Mo({run:function(t,n){Ao(t,n)&&e(t,n)}})}}},Vi=function(t,e,n){return function(t,e){return Ii(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){Bi(e,e.element,t,r)}))}))}(t,e.partUids[n])},ji=function(t,e){return Ii(t,(function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).getOrThunk((function(){return No(r.target,(function(e){return t.getSystem().getByDom(e).toOptional()}),S).getOr(t)}));e(t,o,n)}))},Ui=function(t){return Ii(t,(function(t,e){e.cut()}))},Wi=function(t){return Ii(t,(function(t,e){e.stop()}))},qi=function(t,e){return Fi(t)(e)},$i=Fi(yi()),Gi=Fi(wi()),Ki=Fi(gi()),Xi=function(t){return function(e){return Ii(t,e)}}(ci()),Yi=function(t){return t.dom.innerHTML},Ji=function(t,e){var n,r,o=Ce(t).dom,i=Bt.fromDom(o.createDocumentFragment()),a=(n=e,(r=(o||document).createElement("div")).innerHTML=n,_e(Bt.fromDom(r)));En(i,a),_n(t),On(t,i)},Qi=function(t){return function(t,e){return Bt.fromDom(t.dom.cloneNode(e))}(t,!1)},Zi=function(t){return De(t)?"#shadow-root":function(t){var e=Bt.fromTag("div"),n=Bt.fromDom(t.dom.cloneNode(!0));return On(e,n),Yi(e)}(Qi(t))},ta=function(t){return Zi(t)},ea=zi([function(t,e){return{key:t,value:Mo({can:e})}}(oi(),(function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return ye(e,t.element)&&!ye(e,n)}(t,r,o)||(console.warn(oi()+" did not get interpreted by the desired target. \nOriginator: "+ta(r)+"\nTarget: "+ta(o)+"\nCheck the "+oi()+" event handlers"),!1)}))]),na=Object.freeze({__proto__:null,events:ea}),ra=0,oa=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++ra+String(e)},ia=v("alloy-id-"),aa=v("data-alloy-id"),ua=ia(),ca=aa(),sa=function(t,e){Object.defineProperty(t.dom,ca,{value:e,writable:!0})},la=function(t){var e=It(t)?t.dom[ca]:null;return B.from(e)},fa=function(t){return oa(t)},da=b,ma=function(t){var e=function(e){return"The component must be in a context to execute: "+e+(t?"\n"+ta(t().element)+" is not in context.":"")},n=function(t){return function(){throw new Error(e(t))}},r=function(t){return function(){console.warn(e(t))}};return{debugInfo:v("fake"),triggerEvent:r("triggerEvent"),triggerFocus:r("triggerFocus"),triggerEscape:r("triggerEscape"),broadcast:r("broadcast"),broadcastOn:r("broadcastOn"),broadcastEvent:r("broadcastEvent"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),isConnected:S}},ga=ma(),ha=function(t){return U(t,(function(t){return Rt(t,"/*")?t.substring(0,t.length-"/*".length):t}))},pa=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ha(i)}},t},va=oa("alloy-premade"),ba=function(t){return To(va,t)},ya=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ha(i.slice(1))}},t}((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,_([e.getApis(),e],n,!1))}),t)},wa={init:function(){return xa({readState:v("No State required")})}},xa=function(t){return t},Ca=function(t,e){var n={};return dt(t,(function(t,r){dt(t,(function(t,o){var i=yt(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},Sa=function(t){return{classes:s(t.classes)?[]:t.classes,attributes:s(t.attributes)?{}:t.attributes,styles:s(t.styles)?{}:t.styles}},ka=function(t){return t.cHandler},Ta=function(t,e){return{name:t,handler:e}},Oa=function(t,e,n){var r=O(O({},n),function(t,e){var n={};return W(t,(function(t){n[t.name()]=t.handlers(e)})),n}(e,t));return Ca(r,Ta)},Ea=function(t){var e=function(t){return d(t)?{can:k,abort:S,run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}},_a=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=ot(n,(function(n,o){var i=n[e],a=o[e],u=r.indexOf(i),c=r.indexOf(a);if(-1===u)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(r,null,2));return u<c?-1:c<u?1:0}));return Wn.value(o)}catch(t){return Wn.error([t])}}("Event: "+n,"name",t,r).map((function(t){var e=U(t,(function(t){return t.handler}));return Bo(e)})):function(t,e){return Wn.error(["The event ("+t+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(U(e,(function(t){return t.name})),null,2)])}(n,t)},Ra=function(t,e){var n=pt(t,(function(t,n){return(1===t.length?Wn.value(t[0].handler):_a(t,e,n)).map((function(r){var o=Ea(r),i=t.length>1?$(e[n],(function(e){return F(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return To(n,function(t,e){return{handler:t,purpose:e}}(o,i))}))}));return Eo(n,{})},Na="alloy.base.behaviour",Aa=kr([$r("dom","dom",{tag:"required",process:{}},kr([Xr("tag"),fo("styles",{}),fo("classes",[]),fo("attributes",{}),oo("value"),oo("innerHtml")])),Xr("components"),Xr("uid"),fo("events",{}),fo("apis",{}),$r("eventOrder","eventOrder",function(t){return fr(v(t))}((So={},So[ci()]=["disabling",Na,"toggling","typeaheadevents"],So[oi()]=[Na,"focusing","keying"],So[gi()]=[Na,"disabling","toggling","representing"],So[Xo()]=[Na,"representing","streaming","invalidating"],So[wi()]=[Na,"representing","item-events","tooltipping"],So[Fo()]=["focusing",Na,"item-type-events"],So[Po()]=["focusing",Na,"item-type-events"],So[Wo()]=["item-type-events","tooltipping"],So[ui()]=["receiving","reflecting","tooltipping"],So)),Rr()),oo("domModification")]),Da=function(t){return t.events},Ma=function(t,e){var n=qe(t,e);return void 0===n||""===n?[]:n.split(" ")},Ba=function(t){return void 0!==t.dom.classList},za=function(t,e){return function(t,e,n){var r=Ma(t,e).concat([n]);return We(t,e,r.join(" ")),!0}(t,"class",e)},Pa=function(t,e){return function(t,e,n){var r=$(Ma(t,e),(function(t){return t!==n}));return r.length>0?We(t,e,r.join(" ")):Ke(t,e),!1}(t,"class",e)},La=function(t,e){Ba(t)?t.dom.classList.add(e):za(t,e)},Ia=function(t){0===(Ba(t)?t.dom.classList:function(t){return Ma(t,"class")}(t)).length&&Ke(t,"class")},Ha=function(t,e){Ba(t)?t.dom.classList.remove(e):Pa(t,e);Ia(t)},Fa=function(t,e){return Ba(t)&&t.dom.classList.contains(e)},Va=function(t,e){W(e,(function(e){La(t,e)}))},ja=function(t,e){W(e,(function(e){Ha(t,e)}))},Ua=function(t){return t.dom.value},Wa=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},qa=function(t){var e=Bt.fromTag(t.tag);!function(t,e){var n=t.dom;dt(e,(function(t,e){Ue(n,e,t)}))}(e,t.attributes),Va(e,t.classes),Qe(e,t.styles),t.innerHtml.each((function(t){return Ji(e,t)}));var n=t.domChildren;return En(e,n),t.value.each((function(t){Wa(e,t)})),t.uid,sa(e,t.uid),e},$a=function(t,e){return function(t,e){var n=U(e,(function(t){return lo(t.name(),[Xr("config"),fo("state",wa)])})),r=Vr("component.behaviours",kr(n),t.behaviours).fold((function(e){throw new Error(Wr(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),b);return{list:e,data:mt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return v(e)}))}}(t,e)},Ga=function(t){var e=function(t){var e=yt(t,"behaviours").getOr({});return Q(lt(e),(function(t){var n=e[t];return f(n)?[n.me]:[]}))}(t);return $a(t,e)},Ka=function(t,e,n){var r,o,i,a=O(O({},(r=t).dom),{uid:r.uid,domChildren:U(r.components,(function(t){return t.element}))}),u=function(t){return t.domModification.fold((function(){return Sa({})}),Sa)}(t),c={"alloy.base.modification":u},s=e.length>0?function(t,e,n,r){var o=O({},e);W(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=Ca(o,(function(t,e){return{name:t,modification:e}})),a=function(t){return G(t,(function(t,e){return O(O({},e.modification),t)}),{})},u=G(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=a(i.attributes),s=a(i.styles);return Sa({classes:u,attributes:c,styles:s})}(n,c,e,a):u;return i=s,O(O({},o=a),{attributes:O(O({},o.attributes),i.attributes),styles:O(O({},o.styles),i.styles),classes:o.classes.concat(i.classes)})},Xa=function(t,e,n){var r={"alloy.base.behaviour":Da(t)};return function(t,e,n,r){var o=Oa(t,n,r);return Ra(o,e)}(n,t.eventOrder,e,r).getOrDie()},Ya=function(t){var e=function(){return f},n=xo(ga),r=jr(function(t){return Vr("custom.definition",Aa,t)}(t)),o=Ga(t),i=function(t){return t.list}(o),a=function(t){return t.data}(o),u=Ka(r,i,a),c=qa(u),s=Xa(r,i,a),l=xo(r.components),f={uid:t.uid,getSystem:n.get,config:function(e){var n=a;return(d(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return d(a[t.name()])},spec:t,readState:function(t){return a[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(ma(e))},element:c,syncComponents:function(){var t=_e(c),e=Q(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),rt)}));l.set(e)},components:l.get,events:s};return f},Ja=function(t){var e=da(t),n=e.events,r=E(e,["events"]),o=function(t){var e=yt(t,"components").getOr([]);return U(e,eu)}(r),i=O(O({},r),{events:O(O({},na),n),components:o});return Wn.value(Ya(i))},Qa=function(t){var e=Bt.fromText(t);return Za({element:e})},Za=function(t){var e=Ur("external.component",Sr([Xr("element"),oo("uid")]),t),n=xo(ma()),r=e.uid.getOrThunk((function(){return fa("external")}));sa(e.element,r);var o={uid:r,getSystem:n.get,config:B.none,hasConfigured:S,connect:function(t){n.set(t)},disconnect:function(){n.set(ma((function(){return o})))},getApis:function(){return{}},element:e.element,spec:t,readState:v("No state"),syncComponents:h,components:v([]),events:{}};return ba(o)},tu=fa,eu=function(t){return function(t){return yt(t,va)}(t).getOrThunk((function(){var e=function(t){return wt(t,"uid")}(t)?t:O({uid:tu("")},t);return Ja(e).getOrDie()}))},nu=ba;function ru(t,e,n,r,o){return t(n,r)?B.some(n):d(o)&&o(n)?B.none():e(n,r,o)}var ou,iu=function(t,e,n){for(var r=t.dom,o=d(n)?n:S;r.parentNode;){r=r.parentNode;var i=Bt.fromDom(r);if(e(i))return B.some(i);if(o(i))break}return B.none()},au=function(t,e,n){return ru((function(t,e){return e(t)}),iu,t,e,n)},uu=function(t,e,n){return au(t,e,n).isSome()},cu=function(t,e,n){return iu(t,(function(t){return ve(t,e)}),n)},su=function(t,e){return function(t,e){return X(t.dom.childNodes,(function(t){return e(Bt.fromDom(t))})).map(Bt.fromDom)}(t,(function(t){return ve(t,e)}))},lu=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return be(n)?B.none():B.from(n.querySelector(t)).map(Bt.fromDom)}(e,t)},fu=function(t,e,n){return ru((function(t,e){return ve(t,e)}),cu,t,e,n)},du=function(){var t=oa("aria-owns");return{id:t,link:function(e){We(e,"aria-owns",t)},unlink:function(t){Ke(t,"aria-owns")}}},mu=function(t,e){return function(t){return au(t,(function(t){if(!It(t))return!1;var e=qe(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1})).bind((function(t){var e=qe(t,"id"),n=ze(t);return lu(n,'[aria-owns="'+e+'"]')}))}(e).exists((function(e){return gu(t,e)}))},gu=function(t,e){return uu(e,(function(e){return ye(e,t.element)}),S)||mu(t,e)},hu="unknown";!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(ou||(ou={}));var pu=xo({}),vu=function(t,e,n){switch(yt(pu.get(),t).orThunk((function(){var e=lt(pu.get());return st(e,(function(e){return t.indexOf(e)>-1?B.some(pu.get()[e]):B.none()}))})).getOr(ou.NORMAL)){case ou.NORMAL:return n(wu());case ou.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();H(["mousemove","mouseover","mouseout",gi()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:U(n,(function(t){return H(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+ta(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case ou.STOP:return!0}},bu=["alloy/data/Fields","alloy/debugging/Debugging"],yu=function(t,e,n){return vu(t,e,n)},wu=v({logEventCut:h,logEventStopped:h,logNoParent:h,logEventNoHandlers:h,logEventResponse:h,write:h}),xu=v([Xr("menu"),Xr("selectedMenu")]),Cu=v([Xr("item"),Xr("selectedItem")]);v(kr(Cu().concat(xu())));var Su=v(kr(Cu())),ku=eo("initSize",[Xr("numColumns"),Xr("numRows")]),Tu=function(){return eo("markers",[Xr("backgroundMenu")].concat(xu()).concat(Cu()))},Ou=function(t){return eo("markers",U(t,Xr))},Eu=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return X(e,(function(t){return t.indexOf("alloy")>0&&!F(bu,(function(e){return t.indexOf(e)>-1}))})).getOr(hu)}}(),$r(e,e,n,Hr((function(t){return Wn.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},_u=function(t){return Eu(0,t,lr(h))},Ru=function(t){return Eu(0,t,lr(B.none))},Nu=function(t){return Eu(0,t,{tag:"required",process:{}})},Au=function(t){return Eu(0,t,{tag:"required",process:{}})},Du=function(t,e){return Gr(t,v(e))},Mu=function(t){return Gr(t,b)},Bu=v(ku),zu=function(t,e,n,r,o,i,a,u){return void 0===u&&(u=!1),{x:t,y:e,bubble:n,direction:r,placement:o,restriction:i,label:a+"-"+o,alwaysFit:u}},Pu=Co([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Lu=Pu.southeast,Iu=Pu.southwest,Hu=Pu.northeast,Fu=Pu.northwest,Vu=Pu.south,ju=Pu.north,Uu=Pu.east,Wu=Pu.west,qu=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},$u=function(t,e,n){return Math.min(Math.max(t,e),n)},Gu=function(t,e){return nt(["left","right","top","bottom"],(function(n){return yt(e,n).map((function(e){return function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(t,e)}))}))},Ku="layout",Xu=function(t){return t.x},Yu=function(t,e){return t.x+t.width/2-e.width/2},Ju=function(t,e){return t.x+t.width-e.width},Qu=function(t,e){return t.y-e.height},Zu=function(t){return t.y+t.height},tc=function(t,e){return t.y+t.height/2-e.height/2},ec=function(t,e,n){return zu(Xu(t),Zu(t),n.southeast(),Lu(),"southeast",Gu(t,{left:1,top:3}),Ku)},nc=function(t,e,n){return zu(Ju(t,e),Zu(t),n.southwest(),Iu(),"southwest",Gu(t,{right:0,top:3}),Ku)},rc=function(t,e,n){return zu(Xu(t),Qu(t,e),n.northeast(),Hu(),"northeast",Gu(t,{left:1,bottom:2}),Ku)},oc=function(t,e,n){return zu(Ju(t,e),Qu(t,e),n.northwest(),Fu(),"northwest",Gu(t,{right:0,bottom:2}),Ku)},ic=function(t,e,n){return zu(Yu(t,e),Qu(t,e),n.north(),ju(),"north",Gu(t,{bottom:2}),Ku)},ac=function(t,e,n){return zu(Yu(t,e),Zu(t),n.south(),Vu(),"south",Gu(t,{top:3}),Ku)},uc=function(t,e,n){return zu(function(t){return t.x+t.width}(t),tc(t,e),n.east(),Uu(),"east",Gu(t,{left:0}),Ku)},cc=function(t,e,n){return zu(function(t,e){return t.x-e.width}(t,e),tc(t,e),n.west(),Wu(),"west",Gu(t,{right:1}),Ku)},sc=function(){return[ec,nc,rc,oc,ac,ic,uc,cc]},lc=function(){return[nc,ec,oc,rc,ac,ic,uc,cc]},fc=function(){return[rc,oc,ec,nc,ic,ac]},dc=function(){return[oc,rc,nc,ec,ic,ac]},mc=function(){return[ec,nc,rc,oc,ac,ic]},gc=function(){return[nc,ec,oc,rc,ac,ic]},hc=Object.freeze({__proto__:null,events:function(t){return zi([Ii(ui(),(function(e,n){var r=t.channels,o=lt(r),i=n,a=function(t,e){return e.universal?t:$(t,(function(t){return H(e.channels,t)}))}(o,i);W(a,(function(t){var n=r[t],o=n.schema,a=Ur("channel["+t+"] data\nReceiver: "+ta(e.element),o,i.data);n.onReceive(e,a)}))}))])}}),pc=[Yr("channels",Fr(Wn.value,Sr([Nu("onReceive"),fo("schema",Rr())])))],vc=function(t,e,n){return Ki((function(r,o){n(r,t,e)}))},bc=function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),a=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ha(a.slice(0,1).concat(a.slice(3)))}},t}((function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var a=[r].concat(o);return r.config({name:v(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(a,1);return e.apply(void 0,[r,t.config,t.state].concat(n))}))}),n,e)},yc=function(t){return{key:t,value:void 0}},wc=function(t,e,n,r,o,i,a){var u=function(t){return xt(t,n)?t[n]():B.none()},c=mt(o,(function(t,e){return bc(n,t,e)})),s=mt(i,(function(t,e){return pa(t,e)})),l=O(O(O({},s),c),{revoke:w(yc,n),config:function(e){var r=Ur(n+"-config",t,e);return{key:n,value:{config:r,me:l,configAsRaw:jt((function(){return Ur(n+"-config",t,e)})),initialConfig:e,state:a}}},schema:v(e),exhibit:function(t,e){return kt(u(t),yt(r,"exhibit"),(function(t,n){return n(e,t.config,t.state)})).getOrThunk((function(){return Sa({})}))},name:v(n),handlers:function(t){return u(t).map((function(t){return yt(r,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return l},xc=function(t){return Oo(t)},Cc=Sr([Xr("fields"),Xr("name"),fo("active",{}),fo("apis",{}),fo("state",wa),fo("extra",{})]),Sc=function(t){var e=Ur("Creating behaviour: "+t.name,Cc,t);return function(t,e,n,r,o,i){var a,u,c=Sr(t),s=lo(e,[(a="config",u=t,io(a,Sr(u)))]);return wc(c,s,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},kc=Sr([Xr("branchKey"),Xr("branches"),Xr("name"),fo("active",{}),fo("apis",{}),fo("state",wa),fo("extra",{})]),Tc=function(t){var e=Ur("Creating behaviour: "+t.name,kc,t);return function(t,e,n,r,o,i){var a=t,u=lo(e,[io("config",t)]);return wc(a,u,e,n,r,o,i)}(qr(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},Oc=v(void 0),Ec=Sc({fields:pc,name:"receiving",active:hc}),_c=Object.freeze({__proto__:null,exhibit:function(t,e){return Sa({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),Rc=function(){return Bt.fromDom(document)},Nc=function(t){return t.dom.focus()},Ac=function(t){var e=ze(t).dom;return t.dom===e.activeElement},Dc=function(t){return void 0===t&&(t=Rc()),B.from(t.dom.activeElement).map(Bt.fromDom)},Mc=function(t){return Dc(ze(t)).filter((function(e){return t.dom.contains(e.dom)}))},Bc=function(t,e){var n=ze(e),r=Dc(n).bind((function(t){var n,r,o=function(e){return ye(t,e)};return o(e)?B.some(e):(n=o,(r=function(t){for(var e=0;e<t.childNodes.length;e++){var o=Bt.fromDom(t.childNodes[e]);if(n(o))return B.some(o);var i=r(t.childNodes[e]);if(i.isSome())return i}return B.none()})(e.dom))})),o=t(e);return r.each((function(t){Dc(n).filter((function(e){return ye(e,t)})).fold((function(){Nc(t)}),h)})),o},zc=function(t,e,n,r,o){var i=function(t){return t+"px"};return{position:t,left:e.map(i),top:n.map(i),right:r.map(i),bottom:o.map(i)}},Pc=function(t,e){Ze(t,function(t){return O(O({},t),{position:B.some(t.position)})}(e))},Lc=Co([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Ic=function(t,e,n,r,o,i){var a=e.rect,u=a.x-n,c=a.y-r,s=o-(u+a.width),l=i-(c+a.height),f=B.some(u),d=B.some(c),m=B.some(s),g=B.some(l),h=B.none();return function(t,e,n,r,o,i,a,u,c){return t.fold(e,n,r,o,i,a,u,c)}(e.direction,(function(){return zc(t,f,d,h,h)}),(function(){return zc(t,h,d,m,h)}),(function(){return zc(t,f,h,h,g)}),(function(){return zc(t,h,h,m,g)}),(function(){return zc(t,f,d,h,h)}),(function(){return zc(t,f,h,h,g)}),(function(){return zc(t,f,d,h,h)}),(function(){return zc(t,h,d,m,h)}))},Hc=function(t,e){return t.fold((function(){var t=e.rect;return zc("absolute",B.some(t.x),B.some(t.y),B.none(),B.none())}),(function(t,n,r,o){return Ic("absolute",e,t,n,r,o)}),(function(t,n,r,o){return Ic("fixed",e,t,n,r,o)}))},Fc=function(t,e){var n=w(Ln,e),r=t.fold(n,n,(function(){var t=An();return Ln(e).translate(-t.left,-t.top)})),o=yn(e),i=fn(e);return In(r.left,r.top,o,i)},Vc=function(t,e){return e.fold((function(){return t.fold(Vn,Vn,In)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=jc(t,n.x,n.y);return In(r.left,r.top,n.width,n.height)}))}))},jc=function(t,e,n){var r=mn(e,n);return t.fold(v(r),v(r),(function(){var t=An();return r.translate(-t.left,-t.top)}))};Lc.none;var Uc,Wc=Lc.relative,qc=Lc.fixed,$c=function(t,e){return function(t,e){return{anchorBox:t,origin:e}}(t,e)},Gc="data-alloy-placement",Kc=function(t){return $e(t,Gc)},Xc=Co([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Yc=function(t,e,n,r){var o=t.bubble,i=o.offset,a=function(t,e,n){var r=function(r,o){return e[r].map((function(e){var i="top"===r||"bottom"===r,a=i?n.top:n.left,u=("left"===r||"top"===r?Math.max:Math.min)(e,o)+a;return i?$u(u,t.y,t.bottom):$u(u,t.x,t.right)})).getOr(o)},o=r("left",t.x),i=r("top",t.y),a=r("right",t.right),u=r("bottom",t.bottom);return In(o,i,a-o,u-i)}(r,t.restriction,i),u=t.x+i.left,c=t.y+i.top,s=In(u,c,e,n),l=function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,a=t.x,u=t.y,c=t.right,s=t.bottom,l=t.width,f=t.height;return{originInBounds:a>=n&&a<=o&&u>=r&&u<=i,sizeInBounds:c<=o&&c>=n&&s<=i&&s>=r,visibleW:Math.min(l,a>=n?o-a:c-n),visibleH:Math.min(f,u>=r?i-u:s-r)}}(s,a),f=l.originInBounds,d=l.sizeInBounds,m=l.visibleW,g=l.visibleH,h=f&&d,p=h?s:function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,a=t.x,u=t.y,c=t.width,s=t.height,l=Math.max(n,o-c),f=Math.max(r,i-s),d=$u(a,n,l),m=$u(u,r,f),g=Math.min(d+c,o)-d,h=Math.min(m+s,i)-m;return In(d,m,g,h)}(s,a),b=p.width>0&&p.height>0,y=function(t,e,n){var r=v(e.bottom-n.y),o=v(n.bottom-e.y),i=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)}(t,o,o,r),a=v(e.right-n.x),u=v(n.right-e.x);return{maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t,u,u,a),maxHeight:i}}(t.direction,p,r),w=y.maxWidth,x={rect:p,maxHeight:y.maxHeight,maxWidth:w,direction:t.direction,placement:t.placement,classes:{on:o.classesOn,off:o.classesOff},layout:t.label,testY:c};return h||t.alwaysFit?Xc.fit(x):Xc.nofit(x,m,g,b)},Jc=function(t){var e=xo(B.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(B.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(B.some(t))}}},Qc=function(){return Jc((function(t){return t.unbind()}))},Zc=function(){var t=Jc(h);return O(O({},t),{on:function(e){return t.get().each(e)}})},ts=k,es=function(t,e,n){return function(t,e,n,r){return xn(t,e,n,r,!1)}(t,e,ts,n)},ns=function(t,e,n){return function(t,e,n,r){return xn(t,e,n,r,!0)}(t,e,ts,n)},rs=wn,os=["top","bottom","right","left"],is="data-alloy-transition-timer",as=function(t,e){return function(t,e){return Z(e,(function(e){return Fa(t,e)}))}(t,e.classes)},us=function(t,e){var n=function(t){return parseFloat(t).toFixed(3)};return vt(e,(function(e,r){var o,i,a,u=t[r].map(n),c=e.map(n);return void 0===a&&(a=y),!kt(o=u,i=c,a).getOr(o.isNone()&&i.isNone())})).isSome()},cs=function(t,e){var n,r=Qc(),i=Qc(),a=function(e){var n,r=null!==(n=e.raw.pseudoElement)&&void 0!==n?n:"";return ye(e.target,t)&&!At(r)&&H(os,e.raw.propertyName)},u=function(o){if(l(o)||a(o)){r.clear(),i.clear();var u=null==o?void 0:o.raw.type;(l(u)||u===Zo())&&(clearTimeout(n),Ke(t,is),ja(t,e.classes))}},c=function(){r.set(es(t,Zo(),u)),i.set(es(t,Qo(),u))};if("ontransitionstart"in t.dom)var s=es(t,ti(),(function(t){a(t)&&(s.unbind(),c())}));else c();var f=function(t){var e=function(e){var n=tn(t,e),r=o(n)?n.split(/\s*,\s*/):[];return $(r,At)},n=function(t){if(o(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return Rt(t,"ms")?e:1e3*e}return 0},r=e("transition-delay"),i=e("transition-duration");return K(i,(function(t,e,o){var i=n(r[o])+n(e);return Math.max(t,i)}),0)}(t);requestAnimationFrame((function(){n=setTimeout(u,f+17),We(t,is,n)}))},ss=function(t,e,n,r,o,i){var a=function(t,e,n){return n.exists((function(n){var r=t.mode;return"all"===r||n[r]!==e[r]}))}(r,o,i);if(a||as(t,r)){Je(t,"position",n.position);var u=Fc(e,t),c=Hc(e,O(O({},o),{rect:u})),s=nt(os,(function(t){return c[t]}));us(n,s)&&(Ze(t,s),a&&function(t,e){Va(t,e.classes),$e(t,is).each((function(e){clearTimeout(parseInt(e,10)),Ke(t,is)})),cs(t,e)}(t,r),un(t))}else ja(t,r.classes)},ls=function(t,e,n,r){an(e,"max-height"),an(e,"max-width");var o,i={width:yn(o=e),height:fn(o)};return function(t,e,n,r,o,i){var a=r.width,u=r.height,c=function(e,c,s,l,f){var d=e(n,r,o,t,i),m=Yc(d,a,u,i);return m.fold(v(m),(function(t,e,n,r){return(f===r?n>l||e>s:!f&&r)?m:Xc.nofit(c,s,l,f)}))};return K(e,(function(t,e){var n=w(c,e);return t.fold(v(t),n)}),Xc.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:Lu(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1)).fold(b,b)}(e,r.preference,t,i,n,r.bounds)},fs=function(t,e){!function(t,e){We(t,Gc,e)}(t,e.placement)},ds=function(t,e){!function(t,e){var n=sn.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Je(t,"max-height",n+"px")}(t,Math.floor(e))},ms=v((function(t,e){ds(t,e),Qe(t,{"overflow-x":"hidden","overflow-y":"auto"})})),gs=v((function(t,e){ds(t,e)})),hs=function(t,e,n){return void 0===t[e]?n:t[e]},ps=function(t,e,n,r){var o=ls(t,e,n,r);return function(t,e,n){var r=Hc(n.origin,e);n.transition.each((function(o){ss(t,n.origin,r,o,e,n.lastPlacement)})),Pc(t,r)}(e,o,r),fs(e,o),function(t,e){var n=e.classes;ja(t,n.off),Va(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r),{layout:o.layout,placement:o.placement}},vs=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],bs=function(t,e,n,r){void 0===r&&(r=1);var o=t*r,i=e*r,a=function(t){return yt(n,t).getOr([])},u=function(t,e,n){var r=et(vs,n);return{offset:mn(t,e),classesOn:Q(n,a),classesOff:Q(r,a)}};return{southeast:function(){return u(-t,e,["top","alignLeft"])},southwest:function(){return u(t,e,["top","alignRight"])},south:function(){return u(-t/2,e,["top","alignCentre"])},northeast:function(){return u(-t,-e,["bottom","alignLeft"])},northwest:function(){return u(t,-e,["bottom","alignRight"])},north:function(){return u(-t/2,-e,["bottom","alignCentre"])},east:function(){return u(t,-e/2,["valignCentre","left"])},west:function(){return u(-t,-e/2,["valignCentre","right"])},insetNortheast:function(){return u(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return u(-o,i,["top","alignRight","inset"])},insetNorth:function(){return u(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return u(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return u(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return u(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return u(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return u(o,-i/2,["valignCentre","left","inset"])}}},ys=function(){return bs(0,0,{})},ws=b,xs=function(t,e){return function(n){return"rtl"===Cs(n)?e:t}},Cs=function(t){return"rtl"===tn(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(Uc||(Uc={}));var Ss="data-alloy-vertical-dir",ks=function(t){return uu(t,(function(t){return It(t)&&qe(t,"data-alloy-vertical-dir")===Uc.BottomToTop}))},Ts=function(){return lo("layouts",[Xr("onLtr"),Xr("onRtl"),oo("onBottomLtr"),oo("onBottomRtl")])},Os=function(t,e,n,r,o,i,a){var u=a.map(ks).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=u?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=u?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r);return xs(l,f)(t)},Es=[Xr("hotspot"),oo("bubble"),fo("overrides",{}),Ts(),Du("placement",(function(t,e,n){var r=e.hotspot,o=Fc(n,r.element),i=Os(t.element,e,mc(),gc(),fc(),dc(),B.some(e.hotspot.element));return B.some(ws({anchorBox:o,bubble:e.bubble.getOr(ys()),overrides:e.overrides,layouts:i,placer:B.none()}))}))],_s=[Xr("x"),Xr("y"),fo("height",0),fo("width",0),fo("bubble",ys()),fo("overrides",{}),Ts(),Du("placement",(function(t,e,n){var r=jc(n,e.x,e.y),o=In(r.left,r.top,e.width,e.height),i=Os(t.element,e,sc(),lc(),sc(),lc(),B.none());return B.some(ws({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:B.none()}))}))],Rs=Co([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Ns=function(t){return t.fold(b,(function(t,e,n){return t.translate(-e,-n)}))},As=function(t){return t.fold(b,b)},Ds=function(t){return K(t,(function(t,e){return t.translate(e.left,e.top)}),mn(0,0))},Ms=function(t){var e=U(t,As);return Ds(e)},Bs=Rs.screen,zs=Rs.absolute,Ps=function(t,e,n){var r=Ce(t.element),o=An(r),i=function(t,e,n){var r=Te(n.root).dom;return B.from(r.frameElement).map(Bt.fromDom).filter((function(e){var n=Ce(e),r=Ce(t.element);return ye(n,r)})).map(hn)}(t,0,n).getOr(o);return zs(i,o.left,o.top)},Ls=function(t,e,n,r){var o=Bs(mn(t,e));return B.some(function(t,e,n){return{point:t,width:e,height:n}}(o,n,r))},Is=function(t,e,n,r,o){return t.map((function(t){var i,a,u,c=[e,t.point],s=(i=function(){return Ms(c)},a=function(){return Ms(c)},u=function(){return function(t){var e=U(t,Ns);return Ds(e)}(c)},r.fold(i,a,u)),l=function(t,e,n,r){return{x:t,y:e,width:n,height:r}}(s.left,s.top,t.width,t.height),f=n.showAbove?fc():mc(),d=n.showAbove?dc():gc(),m=Os(o,n,f,d,f,d,B.none());return ws({anchorBox:l,bubble:n.bubble.getOr(ys()),overrides:n.overrides,layouts:m,placer:B.none()})}))},Hs=[Xr("node"),Xr("root"),oo("bubble"),Ts(),fo("overrides",{}),fo("showAbove",!1),Du("placement",(function(t,e,n){var r=Ps(t,0,e);return e.node.filter(Fe).bind((function(o){var i=o.dom.getBoundingClientRect(),a=Ls(i.left,i.top,i.width,i.height),u=e.node.getOr(t.element);return Is(a,r,e,n,u)}))}))],Fs=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Vs=Co([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),js=(Vs.before,Vs.on,Vs.after,function(t){return t.fold(b,b,b)}),Us=Co([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ws={domRange:Us.domRange,relative:Us.relative,exact:Us.exact,exactFromRange:function(t){return Us.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return Bt.fromDom(t.startContainer)},relative:function(t,e){return js(t)},exact:function(t,e,n,r){return t}})}(t);return Te(e)},range:Fs},qs=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},$s=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Gs=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Ks=Co([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Xs=function(t,e,n){return e(Bt.fromDom(n.startContainer),n.startOffset,Bt.fromDom(n.endContainer),n.endOffset)},Ys=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return Ks.rtl(Bt.fromDom(t.endContainer),t.endOffset,Bt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Xs(0,Ks.ltr,n)})):Xs(0,Ks.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:v(t),rtl:B.none}},relative:function(e,n){return{ltr:jt((function(){return qs(t,e,n)})),rtl:jt((function(){return B.some(qs(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:jt((function(){return $s(t,e,n,r,o)})),rtl:jt((function(){return B.some($s(t,r,o,e,n))}))}}})}(t,e))},Js=function(t,e){return Ys(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};Ks.ltr,Ks.rtl;var Qs,Zs=function(t,e){var n=function(e){return t(e)?B.from(e.dom.nodeValue):B.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Ht,"text"),tl=function(t){return Zs.getOption(t)},el=["img","br"],nl=function(t){return tl(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||H(el,Pt(t))},rl=function(t,e){var n=function(t){for(var r=_e(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return B.some(i);var a=n(i);if(a.isSome())return a}return B.none()};return n(t)},ol=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return be(n)?[]:U(n.querySelectorAll(t),Bt.fromDom)}(e,t)},il=function(t,e,n,r){var o=function(t,e,n,r){var o=Ce(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=ye(t,n)&&e===r;return o.collapsed&&!i},al=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return B.some(Fs(Bt.fromDom(e.startContainer),e.startOffset,Bt.fromDom(n.endContainer),n.endOffset))}return B.none()},ul=function(t){if(null===t.anchorNode||null===t.focusNode)return al(t);var e=Bt.fromDom(t.anchorNode),n=Bt.fromDom(t.focusNode);return il(e,t.anchorOffset,n,t.focusOffset)?B.some(Fs(e,t.anchorOffset,n,t.focusOffset)):al(t)},cl=function(t){return function(t){return B.from(t.getSelection())}(t).filter((function(t){return t.rangeCount>0})).bind(ul)},sl=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?B.some(n).map(Gs):B.none()}(Js(t,e))},ll=function(t,e){return function(t){var e=t.getBoundingClientRect();return e.width>0||e.height>0?B.some(e).map(Gs):B.none()}(Js(t,e))},fl=function(t,e){return{element:t,offset:e}},dl=function(t,e){var n=_e(t);if(0===n.length)return fl(t,e);if(e<n.length)return fl(n[e],0);var r=n[n.length-1],o=Ht(r)?function(t){return Zs.get(t)}(r).length:_e(r).length;return fl(r,o)},ml=function(t,e){return Ht(t)?fl(t,e):dl(t,e)},gl=function(t,e){return e.getSelection.getOrThunk((function(){return function(){return cl(t)}}))().map((function(t){var e=ml(t.start,t.soffset),n=ml(t.finish,t.foffset);return Ws.range(e.element,e.offset,n.element,n.offset)}))},hl=[oo("getSelection"),Xr("root"),oo("bubble"),Ts(),fo("overrides",{}),fo("showAbove",!1),Du("placement",(function(t,e,n){var r=Te(e.root).dom,o=Ps(t,0,e),i=gl(r,e).bind((function(t){return ll(r,Ws.exactFromRange(t)).orThunk((function(){var e=Bt.fromText("\ufeff");Sn(t.start,e);var n=sl(r,Ws.exact(e,0,e,1));return Rn(e),n})).bind((function(t){return Ls(t.left,t.top,t.width,t.height)}))})),a=gl(r,e).bind((function(t){return It(t.start)?B.some(t.start):function(t){return Oe(t)}(t.start)})).getOr(t.element);return Is(i,o,e,n,a)}))],pl="link-layout",vl=function(t){return t.x+t.width},bl=function(t,e){return t.x-e.width},yl=function(t,e){return t.y-e.height+t.height},wl=function(t){return t.y},xl=function(t,e,n){return zu(vl(t),wl(t),n.southeast(),Lu(),"southeast",Gu(t,{left:0,top:2}),pl)},Cl=function(t,e,n){return zu(bl(t,e),wl(t),n.southwest(),Iu(),"southwest",Gu(t,{right:1,top:2}),pl)},Sl=function(t,e,n){return zu(vl(t),yl(t,e),n.northeast(),Hu(),"northeast",Gu(t,{left:0,bottom:3}),pl)},kl=function(t,e,n){return zu(bl(t,e),yl(t,e),n.northwest(),Fu(),"northwest",Gu(t,{right:1,bottom:3}),pl)},Tl=function(){return[xl,Cl,Sl,kl]},Ol=function(){return[Cl,xl,kl,Sl]},El=[Xr("item"),Ts(),fo("overrides",{}),Du("placement",(function(t,e,n){var r=Fc(n,e.item.element),o=Os(t.element,e,Tl(),Ol(),Tl(),Ol(),B.none());return B.some(ws({anchorBox:r,bubble:ys(),overrides:e.overrides,layouts:o,placer:B.none()}))}))],_l=qr("type",{selection:hl,node:Hs,hotspot:Es,submenu:El,makeshift:_s}),Rl=[ro("classes",Dr),po("mode","all",["all","layout","placement"])],Nl=[fo("useFixed",S),oo("getBounds")],Al=[Yr("anchor",_l),lo("transition",Rl)],Dl=function(t,e,n,r,o,i,a){return function(t,e,n,r,o,i,a,u){var c=hs(a,"maxHeightFunction",ms()),s=hs(a,"maxWidthFunction",h),l=t.anchorBox,f=t.origin,d={bounds:Vc(f,i),origin:f,preference:r,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:o,transition:u};return ps(l,e,n,d)}($c(n.anchorBox,e),o.element,n.bubble,n.layouts,i,r,n.overrides,a)},Ml=function(t,e,n,r,o,i){var a=i.map(Hn);return Bl(t,e,n,r,o,a)},Bl=function(t,e,n,r,o,i){var a=Ur("placement.info",kr(Al),o),u=a.anchor,c=r.element,s=n.get(r.uid);Bc((function(){Je(c,"position","fixed");var o=nn(c,"visibility");Je(c,"visibility","hidden");var l,f=e.useFixed()?(l=document.documentElement,qc(0,0,l.clientWidth,l.clientHeight)):function(t){var e=hn(t.element),n=t.element.dom.getBoundingClientRect();return Wc(e.left,e.top,n.width,n.height)}(t),d=u.placement,m=i.map(v).or(e.getBounds);d(t,u,f).each((function(e){var o=e.placer.getOr(Dl)(t,f,e,m,r,s,a.transition);n.set(r.uid,o)})),o.fold((function(){an(c,"visibility")}),(function(t){Je(c,"visibility",t)})),nn(c,"left").isNone()&&nn(c,"top").isNone()&&nn(c,"right").isNone()&&nn(c,"bottom").isNone()&&Ct(nn(c,"position"),"fixed")&&an(c,"position")}),c)},zl=Object.freeze({__proto__:null,position:function(t,e,n,r,o){Ml(t,e,n,r,o,B.none())},positionWithin:Ml,positionWithinBounds:Bl,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"},reset:function(t,e,n,r){var o=r.element;W(["position","left","right","top","bottom"],(function(t){return an(o,t)})),function(t){Ke(t,Gc)}(o),n.clear(r.uid)}}),Pl=Object.freeze({__proto__:null,init:function(){var t={};return xa({readState:function(){return t},clear:function(e){f(e)?delete t[e]:t={}},set:function(e,n){t[e]=n},get:function(e){return yt(t,e)}})}}),Ll=Sc({fields:Nl,name:"positioning",active:_c,apis:zl,state:Pl}),Il=function(t){Ri(t,wi());var e=t.components();W(e,Il)},Hl=function(t){var e=t.components();W(e,Hl),Ri(t,yi())},Fl=function(t,e){On(t.element,e.element)},Vl=function(t,e){var n=t.components();!function(t){W(t.components(),(function(t){return Rn(t.element)})),_n(t.element),t.syncComponents()}(t);var r=et(n,e);W(r,(function(e){Il(e),t.getSystem().removeFromWorld(e)})),W(e,(function(e){e.getSystem().isConnected()?Fl(t,e):(t.getSystem().addToWorld(e),Fl(t,e),Fe(t.element)&&Hl(e)),t.syncComponents()}))},jl=function(t,e){Ul(t,e,On)},Ul=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),Fe(t.element)&&Hl(e),t.syncComponents()},Wl=function(t){Il(t),Rn(t.element),t.getSystem().removeFromWorld(t)},ql=function(t){var e=Oe(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));Wl(t),e.each((function(t){t.syncComponents()}))},$l=function(t){var e=t.components();W(e,Wl),_n(t.element),t.syncComponents()},Gl=function(t,e){Kl(t,e,On)},Kl=function(t,e,n){n(t,e.element);var r=_e(e.element);W(r,(function(t){e.getByDom(t).each(Hl)}))},Xl=function(t){var e=_e(t.element);W(e,(function(e){t.getByDom(e).each(Il)})),Rn(t.element)},Yl=function(t,e,n,r){n.get().each((function(e){$l(t)}));var o=e.getAttachPoint(t);jl(o,t);var i=t.getSystem().build(r);return jl(t,i),n.set(i),i},Jl=function(t,e,n,r){var o=Yl(t,e,n,r);return e.onOpen(t,o),o},Ql=function(t,e,n){n.get().each((function(r){$l(t),ql(t),e.onClose(t,r),n.clear()}))},Zl=function(t,e,n){return n.isOpen()},tf=function(t,e,n){var r=e.getAttachPoint(t);Je(t.element,"position",Ll.getMode(r)),function(t,e,n,r){nn(t.element,e).fold((function(){Ke(t.element,n)}),(function(e){We(t.element,n,e)})),Je(t.element,e,r)}(t,"visibility",e.cloakVisibilityAttr,"hidden")},ef=function(t,e,n){(function(t){return F(["top","left","right","bottom"],(function(e){return nn(t,e).isSome()}))})(t.element)||an(t.element,"position"),function(t,e,n){$e(t.element,n).fold((function(){return an(t.element,e)}),(function(n){return Je(t.element,e,n)}))}(t,"visibility",e.cloakVisibilityAttr)},nf=Object.freeze({__proto__:null,cloak:tf,decloak:ef,open:Jl,openWhileCloaked:function(t,e,n,r,o){tf(t,e),Jl(t,e,n,r),o(),ef(t,e)},close:Ql,isOpen:Zl,isPartOf:function(t,e,n,r){return Zl(0,0,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map((function(){return Yl(t,e,n,r)}))}}),rf=Object.freeze({__proto__:null,events:function(t,e){return zi([Ii(di(),(function(n,r){Ql(n,t,e)}))])}}),of=[_u("onOpen"),_u("onClose"),Xr("isPartOf"),Xr("getAttachPoint"),fo("cloakVisibilityAttr","data-precloak-visibility")],af=Sc({fields:of,name:"sandboxing",active:rf,apis:nf,state:Object.freeze({__proto__:null,init:function(){var t=Zc(),e=v("not-implemented");return xa({readState:e,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}})}),uf=v("dismiss.popups"),cf=v("reposition.popups"),sf=v("mouse.released"),lf=Sr([fo("isExtraPart",S),lo("fireEventInstead",[fo("event",xi())])]),ff=function(t){var e,n=Ur("Dismissal",lf,t);return(e={})[uf()]={schema:Sr([Xr("target")]),onReceive:function(t,e){af.isOpen(t)&&(af.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold((function(){return af.close(t)}),(function(e){return Ri(t,e.event)})))}},e},df=Sr([lo("fireEventInstead",[fo("event",Ci())]),to("doReposition")]),mf=function(t){var e,n=Ur("Reposition",df,t);return(e={})[cf()]={onReceive:function(t){af.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return Ri(t,e.event)}))}},e},gf=function(t,e,n){e.store.manager.onLoad(t,e,n)},hf=function(t,e,n){e.store.manager.onUnload(t,e,n)},pf=Object.freeze({__proto__:null,onLoad:gf,onUnload:hf,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),vf=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[$i((function(n,r){gf(n,t,e)})),Gi((function(n,r){hf(n,t,e)}))]:[vc(t,e,gf)];return zi(n)}}),bf=function(){var t=xo(null);return xa({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},yf=function(){var t=xo({}),e=xo({});return xa({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return yt(t.get(),n).orThunk((function(){return yt(e.get(),n)}))},update:function(n){var r=t.get(),o=e.get(),i={},a={};W(n,(function(t){i[t.value]=t,yt(t,"meta").each((function(e){yt(e,"text").each((function(e){a[e]=t}))}))})),t.set(O(O({},r),i)),e.set(O(O({},o),a))},clear:function(){t.set({}),e.set({})}})},wf=Object.freeze({__proto__:null,memory:bf,dataset:yf,manual:function(){return xa({readState:h})},init:function(t){return t.store.manager.state(t)}}),xf=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},Cf=[oo("initialValue"),Xr("getFallbackEntry"),Xr("getDataKey"),Xr("setValue"),Du("manager",{setValue:xf,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).getOrThunk((function(){return r.getFallbackEntry(o)}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){xf(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:yf})],Sf=[Xr("getValue"),fo("setValue",h),oo("initialValue"),Du("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:h,state:wa.init})],kf=[oo("initialValue"),Du("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:bf})],Tf=[mo("store",{mode:"memory"},qr("mode",{memory:kf,manual:Sf,dataset:Cf})),_u("onSetValue"),fo("resetOnDom",!1)],Of=Sc({fields:Tf,name:"representing",active:vf,apis:pf,extra:{setValueFrom:function(t,e){var n=Of.getValue(e);Of.setValue(t,n)}},state:wf}),Ef=function(t,e){return wo(t,{},U(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,$r(n,n,{tag:"option",process:{}},pr((function(t){return Qn("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([Gr("dump",b)]))},_f=function(t){return t.dump},Rf=function(t,e){return O(O({},xc(e)),t.dump)},Nf=Ef,Af=Rf,Df="placeholder",Mf=Co([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Bf=function(t){return wt(t,"uiType")},zf=function(t,e,n,r){return Bf(n)&&n.uiType===Df?function(t,e,n,r){return t.exists((function(t){return t!==n.owner}))?Mf.single(!0,v(n)):yt(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+lt(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,r):Mf.single(!1,v(n))},Pf=function(t,e,n,r){return zf(t,0,n,r).fold((function(o,i){var a=Bf(n)?i(e,n.config,n.validated):i(e),u=yt(a,"components").getOr([]),c=Q(u,(function(n){return Pf(t,e,n,r)}));return[O(O({},a),{components:c})]}),(function(t,r){if(Bf(n)){var o=r(e,n.config,n.validated);return n.validated.preprocess.getOr(b)(o)}return r(e)}))},Lf=function(t,e,n,r){var o=mt(r,(function(t,e){return r=t,o=!1,{name:v(n=e),required:function(){return r.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return o},replace:function(){if(o)throw new Error("Trying to use the same placeholder more than once: "+n);return o=!0,r}};var n,r,o})),i=function(t,e,n,r){return Q(n,(function(n){return Pf(t,e,n,r)}))}(t,e,n,o);return dt(o,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),i},If=Mf.single,Hf=Mf.multiple,Ff=v(Df),Vf=Co([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),jf=fo("factory",{sketch:b}),Uf=fo("schema",[]),Wf=Xr("name"),qf=$r("pname","pname",sr((function(t){return"<alloy."+oa(t.name)+">"})),Rr()),$f=Gr("schema",(function(){return[oo("preprocess")]})),Gf=fo("defaults",v({})),Kf=fo("overrides",v({})),Xf=kr([jf,Uf,Wf,qf,Gf,Kf]),Yf=kr([jf,Uf,Wf,Gf,Kf]),Jf=kr([jf,Uf,Wf,qf,Gf,Kf]),Qf=kr([jf,$f,Wf,Xr("unit"),qf,Gf,Kf]),Zf=function(t){return t.fold(B.some,B.none,B.some,B.some)},td=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},ed=function(t,e){return function(n){var r=Ur("Converting part type",e,n);return t(r)}},nd=ed(Vf.required,Xf),rd=ed(Vf.external,Yf),od=ed(Vf.optional,Jf),id=ed(Vf.group,Qf),ad=v("entirety"),ud=Object.freeze({__proto__:null,required:nd,external:rd,optional:od,group:id,asNamedPart:Zf,name:td,asCommon:function(t){return t.fold(b,b,b,b)},original:ad}),cd=function(t,e,n,r){return ur(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},sd=function(t,e){var n={};return W(e,(function(e){Zf(e).each((function(e){var r=ld(t,e.pname);n[e.name]=function(n){var o=Ur("Part: "+e.name+" in "+t,kr(e.schema),n);return O(O({},r),{config:n,validated:o})}}))})),n},ld=function(t,e){return{uiType:Ff(),owner:t,name:e}},fd=function(t,e,n){return{uiType:Ff(),owner:t,name:e,config:n,validated:{}}},dd=function(t){return Q(t,(function(t){return t.fold(B.none,B.some,B.none,B.none).map((function(t){return eo(t.name,t.schema.concat([Mu(ad())]))})).toArray()}))},md=function(t){return U(t,td)},gd=function(t,e,n){return function(t,e,n){var r={},o={};return W(n,(function(t){t.fold((function(t){r[t.pname]=If(!0,(function(e,n,r){return t.factory.sketch(cd(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=v(t.factory.sketch(cd(e,t,n[ad()]),n))}),(function(t){r[t.pname]=If(!1,(function(e,n,r){return t.factory.sketch(cd(e,t,n,r))}))}),(function(t){r[t.pname]=Hf(!0,(function(e,n,r){var o=e[t.name];return U(o,(function(n){return t.factory.sketch(ur(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:v(r),externals:v(o)}}(0,e,n)},hd=function(t,e,n){return Lf(B.some(t),e,e.components,n)},pd=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},vd=function(t,e,n){return pd(t,e,n).getOrDie("Could not find part: "+n)},bd=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return W(n,(function(t){r[t]=v(i.getByUid(o[t]))})),r},yd=function(t,e){var n=t.getSystem();return mt(e.partUids,(function(t,e){return v(n.getByUid(t))}))},wd=function(t){return lt(t.partUids)},xd=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return W(n,(function(t){r[t]=v(i.getByUid(o[t]).getOrDie())})),r},Cd=function(t,e){var n=md(e);return Oo(U(n,(function(e){return{key:e,value:t+"-"+e}})))},Sd=function(t){return $r("partUids","partUids",fr((function(e){return Cd(e.uid,t)})),Rr())},kd=Object.freeze({__proto__:null,generate:sd,generateOne:fd,schemas:dd,names:md,substitutes:gd,components:hd,defaultUids:Cd,defaultUidsSchema:Sd,getAllParts:yd,getAllPartNames:wd,getPart:pd,getPartOrDie:vd,getParts:bd,getPartsOrDie:xd}),Td=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[eo("parts",t)]:[]).concat([Xr("uid"),fo("dom",{}),fo("components",[]),Mu("originalSpec"),fo("debug.sketcher",{})]).concat(e)}(r,o);return Ur(t+" [SpecSchema]",Sr(i.concat(e)),n)},Od=function(t,e,n,r,o){var i=Ed(o),a=dd(n),u=Sd(n),c=Td(t,e,i,a,[u]),s=gd(0,c,n);return r(c,hd(t,c,s.internals()),i,s.externals())},Ed=function(t){return function(t){return wt(t,"uid")}(t)?t:O(O({},t),{uid:fa("uid")})},_d=Sr([Xr("name"),Xr("factory"),Xr("configFields"),fo("apis",{}),fo("extraApis",{})]),Rd=Sr([Xr("name"),Xr("factory"),Xr("configFields"),Xr("partFields"),fo("apis",{}),fo("extraApis",{})]),Nd=function(t){var e=Ur("Sketcher for "+t.name,_d,t),n=mt(e.apis,ya),r=mt(e.extraApis,(function(t,e){return pa(t,e)}));return O(O({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=Ed(r);return n(Td(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},Ad=function(t){var e=Ur("Sketcher for "+t.name,Rd,t),n=sd(e.name,e.partFields),r=mt(e.apis,ya),o=mt(e.extraApis,(function(t,e){return pa(t,e)}));return O(O({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return Od(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},Dd=function(t){return"input"===Pt(t)&&"radio"!==qe(t,"type")||"textarea"===Pt(t)},Md=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),Bd=[Xr("find")],zd=Sc({fields:Bd,name:"composing",apis:Md}),Pd=["input","button","textarea","select"],Ld=function(t,e,n){(e.disabled()?Ud:Wd)(t,e)},Id=function(t,e){return!0===e.useNative&&H(Pd,Pt(t.element))},Hd=function(t){We(t.element,"disabled","disabled")},Fd=function(t){Ke(t.element,"disabled")},Vd=function(t){We(t.element,"aria-disabled","true")},jd=function(t){We(t.element,"aria-disabled","false")},Ud=function(t,e,n){e.disableClass.each((function(e){La(t.element,e)})),(Id(t,e)?Hd:Vd)(t),e.onDisabled(t)},Wd=function(t,e,n){e.disableClass.each((function(e){Ha(t.element,e)})),(Id(t,e)?Fd:jd)(t),e.onEnabled(t)},qd=function(t,e){return Id(t,e)?function(t){return Ge(t.element,"disabled")}(t):function(t){return"true"===qe(t.element,"aria-disabled")}(t)},$d=Object.freeze({__proto__:null,enable:Wd,disable:Ud,isDisabled:qd,onLoad:Ld,set:function(t,e,n,r){(r?Ud:Wd)(t,e)}}),Gd=Object.freeze({__proto__:null,exhibit:function(t,e){return Sa({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return zi([Pi(ci(),(function(e,n){return qd(e,t)})),vc(t,e,Ld)])}}),Kd=[bo("disabled",S),fo("useNative",!0),oo("disableClass"),_u("onDisabled"),_u("onEnabled")],Xd=Sc({fields:Kd,name:"disabling",active:Gd,apis:$d}),Yd=function(t,e,n,r){var o=ol(t.element,"."+e.highlightClass);W(o,(function(n){F(r,(function(t){return t.element===n}))||(Ha(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Ri(n,_i())})))}))},Jd=function(t,e,n,r){Yd(t,e,0,[r]),Qd(t,e,n,r)||(La(r.element,e.highlightClass),e.onHighlight(t,r),Ri(r,Ei()))},Qd=function(t,e,n,r){return Fa(r.element,e.highlightClass)},Zd=function(t,e,n,r){var o=ol(t.element,"."+e.itemClass);return B.from(o[r]).fold((function(){return Wn.error(new Error("No element found with index "+r))}),t.getSystem().getByDom)},tm=function(t,e,n){return lu(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},em=function(t,e,n){var r=ol(t.element,"."+e.itemClass);return(r.length>0?B.some(r[r.length-1]):B.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},nm=function(t,e,n,r){var o=ol(t.element,"."+e.itemClass);return Y(o,(function(t){return Fa(t,e.highlightClass)})).bind((function(e){var n=qu(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},rm=function(t,e,n){var r=ol(t.element,"."+e.itemClass);return St(U(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},om=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return Yd(t,e,0,[])},dehighlight:function(t,e,n,r){Qd(t,e,n,r)&&(Ha(r.element,e.highlightClass),e.onDehighlight(t,r),Ri(r,_i()))},highlight:Jd,highlightFirst:function(t,e,n){tm(t,e).each((function(r){Jd(t,e,n,r)}))},highlightLast:function(t,e,n){em(t,e).each((function(r){Jd(t,e,n,r)}))},highlightAt:function(t,e,n,r){Zd(t,e,n,r).fold((function(t){throw t}),(function(r){Jd(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=rm(t,e);X(o,r).each((function(r){Jd(t,e,n,r)}))},isHighlighted:Qd,getHighlighted:function(t,e,n){return lu(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:tm,getLast:em,getPrevious:function(t,e,n){return nm(t,e,0,-1)},getNext:function(t,e,n){return nm(t,e,0,1)},getCandidates:rm}),im=[Xr("highlightClass"),Xr("itemClass"),_u("onHighlight"),_u("onDehighlight")],am=Sc({fields:im,name:"highlighting",apis:om}),um=[8],cm=[9],sm=[13],lm=[27],fm=[32],dm=[37],mm=[38],gm=[39],hm=[40],pm=function(t,e,n){var r=tt(t.slice(0,e)),o=tt(t.slice(e+1));return X(r.concat(o),n)},vm=function(t,e,n){var r=tt(t.slice(0,e));return X(r,n)},bm=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return X(o.concat(r),n)},ym=function(t,e,n){var r=t.slice(e+1);return X(r,n)},wm=function(t){return function(e){var n=e.raw;return H(t,n.which)}},xm=function(t){return function(e){return Z(t,(function(t){return t(e)}))}},Cm=function(t){return!0===t.raw.shiftKey},Sm=function(t){return!0===t.raw.ctrlKey},km=x(Cm),Tm=function(t,e){return{matches:t,classification:e}},Om=function(t,e,n){e.exists((function(t){return n.exists((function(e){return ye(e,t)}))}))||Ni(t,Si(),{prevFocus:e,newFocus:n})},Em=function(){var t=function(t){return Mc(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);Om(e,r,o)}}},_m=function(){var t=function(t){return am.getHighlighted(t).map((function(t){return t.element}))};return{get:t,set:function(e,n){var r=t(e);e.getSystem().getByDom(n).fold(h,(function(t){am.highlight(e,t)}));var o=t(e);Om(e,r,o)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Qs||(Qs={}));var Rm,Nm=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,a,u=n(t,e,r,o);return(i=u,a=e.event,X(i,(function(t){return t.matches(a)})).map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},a={schema:function(){return t.concat([fo("focusManager",Em()),mo("focusInside","onFocus",Hr((function(t){return H(["onFocus","onEnterOrSpace","onApi"],t)?Wn.value(t):Wn.error("Invalid value for focusInside")}))),Du("handler",a),Du("state",e),Du("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var a=t.focusInside!==Qs.OnFocusMode?B.none():o(t).map((function(n){return Ii(oi(),(function(r,o){n(r,t,e),o.stop()}))})),u=[Ii(Go(),(function(r,a){i(r,a,n,t,e).fold((function(){!function(n,r){var i=wm(fm.concat(sm))(r.event);t.focusInside===Qs.OnEnterOrSpaceMode&&i&&Ao(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,a)}),(function(t){a.stop()}))})),Ii(Ko(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return zi(a.toArray().concat(u))}};return a},Am=function(t){var e=[oo("onEscape"),oo("onEnter"),fo("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),fo("firstTabstop",0),fo("useTabstopAt",k),oo("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return fu(e,t)})).getOr(e);return ln(n)>0},r=function(t,e,r){(function(t,e){var r=ol(t.element,e.selector),o=$(r,(function(t){return n(e,t)}));return B.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},o=function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?B.some(!0):B.none()}),(function(e){return o.focusManager.set(t,e),B.some(!0)}))},i=function(t,e,n,r){var i=ol(t.element,n.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return fu(t,e.selector)}))}(t,n).bind((function(e){return Y(i,w(ye,e)).bind((function(e){return o(t,i,e,n,r)}))}))},a=v([Tm(xm([Cm,wm(cm)]),(function(t,e,n){var r=n.cyclic?pm:vm;return i(t,0,n,r)})),Tm(wm(cm),(function(t,e,n){var r=n.cyclic?bm:ym;return i(t,0,n,r)})),Tm(wm(lm),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),Tm(xm([km,wm(sm)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),u=v([]);return Nm(e,wa.init,a,u,(function(){return B.some(r)}))},Dm=Am(Gr("cyclic",S)),Mm=Am(Gr("cyclic",k)),Bm=function(t,e,n){return Dd(n)&&wm(fm)(e.event)?B.none():function(t,e,n){return Di(t,n,ci()),B.some(!0)}(t,0,n)},zm=function(t,e){return B.some(!0)},Pm=[fo("execute",Bm),fo("useSpace",!1),fo("useEnter",!0),fo("useControlEnter",!1),fo("useDown",!1)],Lm=function(t,e,n){return n.execute(t,e,t.element)},Im=Nm(Pm,wa.init,(function(t,e,n,r){var o=n.useSpace&&!Dd(t.element)?fm:[],i=n.useEnter?sm:[],a=n.useDown?hm:[],u=o.concat(i).concat(a);return[Tm(wm(u),Lm)].concat(n.useControlEnter?[Tm(xm([Sm,wm(sm)]),Lm)]:[])}),(function(t,e,n,r){return n.useSpace&&!Dd(t.element)?[Tm(wm(fm),zm)]:[]}),(function(){return B.none()})),Hm=function(){var t=Zc();return xa({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set({numRows:e,numColumns:n})},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},Fm=Object.freeze({__proto__:null,flatgrid:Hm,init:function(t){return t.state(t)}}),Vm=function(t){return function(e,n,r,o){var i=t(e.element);return qm(i,e,n,r,o)}},jm=function(t,e){var n=xs(t,e);return Vm(n)},Um=function(t,e){var n=xs(e,t);return Vm(n)},Wm=function(t){return function(e,n,r,o){return qm(t,e,n,r,o)}},qm=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},$m=Wm,Gm=Wm,Km=Wm,Xm=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},Ym=function(t,e,n){var r=ol(t,n);return function(t,e){return Y(t,e).map((function(e){return{index:e,candidates:t}}))}($(r,Xm),(function(t){return ye(t,e)}))},Jm=function(t,e){return Y(t,(function(t){return ye(e,t)}))},Qm=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?B.some(t[r]):B.none()}))},Zm=function(t,e,n,r,o){return Qm(t,e,r,(function(e,i){var a=e===n-1?t.length-e*r:r,u=qu(i,o,0,a-1);return B.some({row:e,column:u})}))},tg=function(t,e,n,r,o){return Qm(t,e,r,(function(e,i){var a=qu(e,o,0,n-1),u=a===n-1?t.length-a*r:r,c=$u(i,0,u-1);return B.some({row:a,column:c})}))},eg=[Xr("selector"),fo("execute",Bm),Ru("onEscape"),fo("captureTab",!1),Bu()],ng=function(t,e,n){lu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},rg=function(t){return function(e,n,r,o){return Ym(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},og=function(t,e,n){return n.captureTab?B.some(!0):B.none()},ig=rg((function(t,e,n,r){return Zm(t,e,n,r,-1)})),ag=rg((function(t,e,n,r){return Zm(t,e,n,r,1)})),ug=rg((function(t,e,n,r){return tg(t,e,n,r,-1)})),cg=rg((function(t,e,n,r){return tg(t,e,n,r,1)})),sg=v([Tm(wm(dm),jm(ig,ag)),Tm(wm(gm),Um(ig,ag)),Tm(wm(mm),$m(ug)),Tm(wm(hm),Gm(cg)),Tm(xm([Cm,wm(cm)]),og),Tm(xm([km,wm(cm)]),og),Tm(wm(lm),(function(t,e,n){return n.onEscape(t,e)})),Tm(wm(fm.concat(sm)),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return fu(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),lg=v([Tm(wm(fm),zm)]),fg=Nm(eg,Hm,sg,lg,(function(){return B.some(ng)})),dg=function(t,e,n,r){var o=function(t,e,n){var i,a=qu(e,r,0,n.length-1);return a===t?B.none():(i=n[a],"button"===Pt(i)&&"disabled"===qe(i,"disabled")?o(t,a,n):B.from(n[a]))};return Ym(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},mg=[Xr("selector"),fo("getInitial",B.none),fo("execute",Bm),Ru("onEscape"),fo("executeOnMove",!1),fo("allowVertical",!0)],gg=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return fu(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},hg=function(t,e,n){e.getInitial(t).orThunk((function(){return lu(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},pg=function(t,e,n){return dg(t,n.selector,e,-1)},vg=function(t,e,n){return dg(t,n.selector,e,1)},bg=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?gg(e,n,r):B.some(!0)}))}},yg=function(t,e,n){return n.onEscape(t,e)},wg=v([Tm(wm(fm),zm)]),xg=Nm(mg,wa.init,(function(t,e,n,r){var o=dm.concat(n.allowVertical?mm:[]),i=gm.concat(n.allowVertical?hm:[]);return[Tm(wm(o),bg(jm(pg,vg))),Tm(wm(i),bg(Um(pg,vg))),Tm(wm(sm),gg),Tm(wm(fm),gg),Tm(wm(lm),yg)]}),wg,(function(){return B.some(hg)})),Cg=function(t,e,n){return B.from(t[e]).bind((function(t){return B.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},Sg=function(t,e,n,r){var o=t[e].length,i=qu(n,r,0,o-1);return Cg(t,e,i)},kg=function(t,e,n,r){var o=qu(n,r,0,t.length-1),i=t[o].length,a=$u(e,0,i-1);return Cg(t,o,a)},Tg=function(t,e,n,r){var o=t[e].length,i=$u(n+r,0,o-1);return Cg(t,e,i)},Og=function(t,e,n,r){var o=$u(n+r,0,t.length-1),i=t[o].length,a=$u(e,0,i-1);return Cg(t,o,a)},Eg=[eo("selectors",[Xr("row"),Xr("cell")]),fo("cycles",!0),fo("previousSelector",B.none),fo("execute",Bm)],_g=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return lu(t.element,n.cell)})).each((function(n){e.focusManager.set(t,n)}))},Rg=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return fu(r,o.selectors.row).bind((function(t){var e=ol(t,o.selectors.cell);return Jm(e,r).bind((function(e){var r=ol(n,o.selectors.row);return Jm(r,t).bind((function(t){var n=function(t,e){return U(t,(function(t){return ol(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},Ng=Rg((function(t,e,n){return Sg(t,e,n,-1)}),(function(t,e,n){return Tg(t,e,n,-1)})),Ag=Rg((function(t,e,n){return Sg(t,e,n,1)}),(function(t,e,n){return Tg(t,e,n,1)})),Dg=Rg((function(t,e,n){return kg(t,n,e,-1)}),(function(t,e,n){return Og(t,n,e,-1)})),Mg=Rg((function(t,e,n){return kg(t,n,e,1)}),(function(t,e,n){return Og(t,n,e,1)})),Bg=v([Tm(wm(dm),jm(Ng,Ag)),Tm(wm(gm),Um(Ng,Ag)),Tm(wm(mm),$m(Dg)),Tm(wm(hm),Gm(Mg)),Tm(wm(fm.concat(sm)),(function(t,e,n){return Mc(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),zg=v([Tm(wm(fm),zm)]),Pg=Nm(Eg,wa.init,Bg,zg,(function(){return B.some(_g)})),Lg=[Xr("selector"),fo("execute",Bm),fo("moveOnTab",!1)],Ig=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},Hg=function(t,e,n){lu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Fg=function(t,e,n){return dg(t,n.selector,e,-1)},Vg=function(t,e,n){return dg(t,n.selector,e,1)},jg=v([Tm(wm(mm),Km(Fg)),Tm(wm(hm),Km(Vg)),Tm(xm([Cm,wm(cm)]),(function(t,e,n,r){return n.moveOnTab?Km(Fg)(t,e,n,r):B.none()})),Tm(xm([km,wm(cm)]),(function(t,e,n,r){return n.moveOnTab?Km(Vg)(t,e,n,r):B.none()})),Tm(wm(sm),Ig),Tm(wm(fm),Ig)]),Ug=v([Tm(wm(fm),zm)]),Wg=Nm(Lg,wa.init,jg,Ug,(function(){return B.some(Hg)})),qg=[Ru("onSpace"),Ru("onEnter"),Ru("onShiftEnter"),Ru("onLeft"),Ru("onRight"),Ru("onTab"),Ru("onShiftTab"),Ru("onUp"),Ru("onDown"),Ru("onEscape"),fo("stopSpaceKeyup",!1),oo("focusIn")],$g=Nm(qg,wa.init,(function(t,e,n){return[Tm(wm(fm),n.onSpace),Tm(xm([km,wm(sm)]),n.onEnter),Tm(xm([Cm,wm(sm)]),n.onShiftEnter),Tm(xm([Cm,wm(cm)]),n.onShiftTab),Tm(xm([km,wm(cm)]),n.onTab),Tm(wm(mm),n.onUp),Tm(wm(hm),n.onDown),Tm(wm(dm),n.onLeft),Tm(wm(gm),n.onRight),Tm(wm(fm),n.onSpace),Tm(wm(lm),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[Tm(wm(fm),zm)]:[]}),(function(t){return t.focusIn})),Gg=Dm.schema(),Kg=Mm.schema(),Xg=xg.schema(),Yg=fg.schema(),Jg=Pg.schema(),Qg=Im.schema(),Zg=Wg.schema(),th=$g.schema(),eh=Tc({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Gg,cyclic:Kg,flow:Xg,flatgrid:Yg,matrix:Jg,execution:Qg,menu:Zg,special:th}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){!function(t){return xt(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:Fm}),nh=function(t,e,n,r){var o=t.getSystem().build(r);Ul(t,o,n)},rh=function(t,e,n,r){var o=oh(t);X(o,(function(t){return ye(r.element,t.element)})).each(ql)},oh=function(t,e){return t.components()},ih=function(t,e,n,r,o){var i=oh(t);return B.from(i[r]).map((function(e){return rh(t,0,0,e),o.each((function(e){nh(t,0,(function(t,e){!function(t,e,n){Re(t,n).fold((function(){On(t,e)}),(function(t){Sn(t,e)}))}(t,e,r)}),e)})),e}))},ah=Sc({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){nh(t,0,On,r)},prepend:function(t,e,n,r){nh(t,0,Tn,r)},remove:rh,replaceAt:ih,replaceBy:function(t,e,n,r,o){var i=oh(t);return Y(i,r).bind((function(e){return ih(t,0,0,e,o)}))},set:function(t,e,n,r){Bc((function(){var e=U(r,t.getSystem().build);Vl(t,e)}),t.element)},contents:oh})}),uh=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=zi(e);return Sc({fields:[Xr("enabled")],name:t,active:{events:v(n)}})}(t,e),configAsRaw:v({}),initialConfig:{},state:wa}}},ch=function(t,e){e.ignore||(Nc(t.element),e.onFocus(t))},sh=Object.freeze({__proto__:null,focus:ch,blur:function(t,e){e.ignore||function(t){t.dom.blur()}(t.element)},isFocused:function(t){return Ac(t.element)}}),lh=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return Sa(n)},events:function(t){return zi([Ii(oi(),(function(e,n){ch(e,t),n.stop()}))].concat(t.stopMousedown?[Ii(Fo(),(function(t,e){e.event.prevent()}))]:[]))}}),fh=[_u("onFocus"),fo("stopMousedown",!1),fo("ignore",!1)],dh=Sc({fields:fh,name:"focusing",active:lh,apis:sh}),mh=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},gh=function(t,e,n){e.toggleClass.each((function(e){n.get()?La(t.element,e):Ha(t.element,e)}))},hh=function(t,e,n){bh(t,e,n,!n.get())},ph=function(t,e,n){n.set(!0),gh(t,e,n),mh(t,e,n)},vh=function(t,e,n){n.set(!1),gh(t,e,n),mh(t,e,n)},bh=function(t,e,n,r){(r?ph:vh)(t,e,n)},yh=function(t,e,n){bh(t,e,n,e.selected)},wh=Object.freeze({__proto__:null,onLoad:yh,toggle:hh,isOn:function(t,e,n){return n.get()},on:ph,off:vh,set:bh}),xh=Object.freeze({__proto__:null,exhibit:function(){return Sa({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=hh,Xi((function(t){o(t,n,r)}))),a=vc(t,e,yh);return zi(J([t.toggleOnExecute?[i]:[],[a]]))}}),Ch=function(t,e,n){We(t.element,"aria-expanded",n)},Sh=[fo("selected",!1),oo("toggleClass"),fo("toggleOnExecute",!0),mo("aria",{mode:"none"},qr("mode",{pressed:[fo("syncWithExpanded",!1),Du("update",(function(t,e,n){We(t.element,"aria-pressed",n),e.syncWithExpanded&&Ch(t,e,n)}))],checked:[Du("update",(function(t,e,n){We(t.element,"aria-checked",n)}))],expanded:[Du("update",Ch)],selected:[Du("update",(function(t,e,n){We(t.element,"aria-selected",n)}))],none:[Du("update",h)]}))],kh=Sc({fields:Sh,name:"toggling",active:xh,apis:wh,state:(Rm=!1,{init:function(){var t=xo(Rm);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(Rm)},readState:function(){return t.get()}}}})}),Th=function(){var t=function(t,e){e.stop(),Ai(t)};return[Ii(Jo(),t),Ii(li(),t),Ui(Po()),Ui(Fo())]},Oh=function(t){return zi(J([t.map((function(t){return Xi((function(e,n){t(e),n.stop()}))})).toArray(),Th()]))},Eh="alloy.item-hover",_h="alloy.item-focus",Rh=function(t){(Mc(t.element).isNone()||dh.isFocused(t))&&(dh.isFocused(t)||dh.focus(t),Ni(t,Eh,{item:t}))},Nh=function(t){Ni(t,_h,{item:t})},Ah=v(Eh),Dh=v(_h),Mh=[Xr("data"),Xr("components"),Xr("dom"),fo("hasSubmenu",!1),oo("toggling"),Nf("itemBehaviours",[kh,dh,eh,Of]),fo("ignoreFocus",!1),fo("domModification",{}),Du("builder",(function(t){return{dom:t.dom,domModification:O(O({},t.domModification),{attributes:O(O(O({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Af(t.itemBehaviours,[t.toggling.fold(kh.revoke,(function(t){return kh.config(O({aria:{mode:"checked"}},t))})),dh.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Nh(t)}}),eh.config({mode:"execution"}),Of.config({store:{mode:"memory",initialValue:t.data}}),uh("item-type-events",_(_([],Th(),!0),[Ii(Wo(),Rh),Ii(si(),dh.focus)],!1))]),components:t.components,eventOrder:t.eventOrder}})),fo("eventOrder",{})],Bh=[Xr("dom"),Xr("components"),Du("builder",(function(t){return{dom:t.dom,components:t.components,events:zi([Wi(si())])}}))],zh=v("item-widget"),Ph=v([nd({name:"widget",overrides:function(t){return{behaviours:xc([Of.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:h}})])}}})]),Lh=[Xr("uid"),Xr("data"),Xr("components"),Xr("dom"),fo("autofocus",!1),fo("ignoreFocus",!1),Nf("widgetBehaviours",[Of,dh,eh]),fo("domModification",{}),Sd(Ph()),Du("builder",(function(t){var e=gd(zh(),t,Ph()),n=hd(zh(),t,e.internals()),r=function(e){return pd(e,t,"widget").map((function(t){return eh.focusIn(t),t}))},o=function(e,n){return Dd(n.event.target)?B.none():t.autofocus?(n.setSource(e.element),B.none()):B.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:zi([Xi((function(t,e){r(t).each((function(t){e.stop()}))})),Ii(Wo(),Rh),Ii(si(),(function(e,n){t.autofocus?r(e):dh.focus(e)}))]),behaviours:Af(t.widgetBehaviours,[Of.config({store:{mode:"memory",initialValue:t.data}}),dh.config({ignore:t.ignoreFocus,onFocus:function(t){Nh(t)}}),eh.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:Oc(),onLeft:o,onRight:o,onEscape:function(e,n){return dh.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),B.none()):B.none():(dh.focus(e),B.some(!0))}})])}}))],Ih=qr("type",{widget:Lh,item:Mh,separator:Bh}),Hh=v([id({factory:{sketch:function(t){var e=Ur("menu.spec item",Ih,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return wt(e,"uid")?e:O(O({},e),{uid:fa("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Fh=v([Xr("value"),Xr("items"),Xr("dom"),Xr("components"),fo("eventOrder",{}),Ef("menuBehaviours",[am,Of,zd,eh]),mo("movement",{mode:"menu",moveOnTab:!0},qr("mode",{grid:[Bu(),Du("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[Du("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),Xr("rowSelector")],menu:[fo("moveOnTab",!0),Du("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Yr("markers",Su()),fo("fakeFocus",!1),fo("focusManager",Em()),_u("onHighlight")]),Vh=v("alloy.menu-focus"),jh=Ad({name:"Menu",configFields:Fh(),partFields:Hh(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Rf(t.menuBehaviours,[am.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),Of.config({store:{mode:"memory",initialValue:t.value}}),zd.config({find:B.some}),eh.config(t.movement.config(t,t.movement))]),events:zi([Ii(Dh(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){am.highlight(t,n),e.stop(),Ni(t,Vh(),{menu:t,item:n})}))})),Ii(Ah(),(function(t,e){var n=e.event.item;am.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Uh=function(t,e,n,r){return yt(n,r).bind((function(r){return yt(t,r).bind((function(r){var o=Uh(t,e,n,r);return B.some([r].concat(o))}))})).getOr([])},Wh=function(t,e){var n={};dt(t,(function(t,e){W(t,(function(t){n[t]=e}))}));var r=e,o=gt(e,(function(t,e){return{k:t,v:e}})),i=mt(o,(function(t,e){return[e].concat(Uh(n,r,o,e))}));return mt(n,(function(t){return yt(i,t).getOr([t])}))},qh=function(t){return"prepared"===t.type?B.some(t.menu):B.none()},$h={init:function(){var t=xo({}),e=xo({}),n=xo({}),r=Zc(),o=xo({}),i=function(e,n,r){return a(e).bind((function(o){return function(e){return vt(t.get(),(function(t,n){return t===e}))}(e).bind((function(t){return n(t).map((function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}}))}))}))},a=function(t){return u(t).bind(qh)},u=function(t){return yt(e.get(),t)},c=function(e){return yt(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(O(O({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,a,u,c){r.set(i),t.set(u),e.set(a),o.set(c);var s=Wh(c,u);n.set(s)},expand:function(e){return yt(t.get(),e).map((function(t){var r=yt(n.get(),e).getOr([]);return[t].concat(r)}))},refresh:function(t){return yt(n.get(),t)},collapse:function(t){return yt(n.get(),t).bind((function(t){return t.length>1?B.some(t.slice(1)):B.none()}))},lookupMenu:u,lookupItem:c,otherMenus:function(t){var e=o.get();return et(lt(e),t)},getPrimary:function(){return r.get().bind(a)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.clear()},isClear:function(){return r.get().isNone()},getTriggeringPath:function(t,e){var o=$(c(t).toArray(),(function(t){return a(t).isSome()}));return yt(n.get(),t).bind((function(t){var n=tt(o.concat(t));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return B.none();e.push(r.getOrDie())}return B.some(e)}(Q(n,(function(t,o){return i(t,e,n.slice(0,o+1)).fold((function(){return Ct(r.get(),t)?[]:[B.none()]}),(function(t){return[B.some(t)]}))})))}))}}},extractPreparedMenu:qh},Gh=v("collapse-item"),Kh=Nd({name:"TieredMenu",configFields:[Au("onExecute"),Au("onEscape"),Nu("onOpenMenu"),Nu("onOpenSubmenu"),_u("onRepositionMenu"),_u("onCollapseMenu"),fo("highlightImmediately",!0),eo("data",[Xr("primary"),Xr("menus"),Xr("expansions")]),fo("fakeFocus",!1),_u("onHighlight"),_u("onHover"),Tu(),Xr("dom"),fo("navigateOnHover",!0),fo("stayInDom",!1),Ef("tmenuBehaviours",[eh,am,zd,ah]),fo("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r=Zc(),o=$h.init(),i=function(e){var n=function(e,n,r){return mt(r,(function(r,o){var i=function(){return jh.sketch(O(O({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?_m():Em()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))}(e,t.data.primary,t.data.menus),r=u();return o.setContents(t.data.primary,n,t.data.expansions,r),o.getPrimary()},a=function(t){return Of.getValue(t).value},u=function(e){return mt(t.data.menus,(function(t,e){return Q(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},c=function(t,e){am.highlight(t,e),am.getHighlighted(e).orThunk((function(){return am.getFirst(e)})).each((function(e){Di(t,e.element,si())}))},s=function(t,e){return St(U(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?B.some(t.menu):B.none()}))})))},l=function(e,n,r){var o=s(n,n.otherMenus(r));W(o,(function(n){ja(n.element,[t.markers.backgroundMenu]),t.stayInDom||ah.remove(e,n)}))},f=function(e,n){var o=function(e){return r.get().getOrThunk((function(){var n={},o=ol(e.element,"."+t.markers.item),i=$(o,(function(t){return"true"===qe(t,"aria-haspopup")}));return W(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=a(t);n[e]=t}))})),r.set(n),n}))}(e);dt(o,(function(t,e){var r=H(n,e);We(t.element,"aria-expanded",r)}))},d=function(e,n,r){return B.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return B.none();var i=o.menu,a=s(n,r.slice(1));return W(a,(function(e){La(e.element,t.markers.backgroundMenu)})),Fe(i.element)||ah.append(e,nu(i)),ja(i.element,[t.markers.backgroundMenu]),c(e,i),l(e,n,r),B.some(i)}))}))};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(n||(n={}));var m=function(e,r,i){if(void 0===i&&(i=n.HighlightSubmenu),r.hasConfigured(Xd)&&Xd.isDisabled(r))return B.some(r);var u=a(r);return o.expand(u).bind((function(a){return f(e,a),B.from(a[0]).bind((function(u){return o.lookupMenu(u).bind((function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return o.setMenuBuilt(e,r),r}return n.menu}(e,u,c);return Fe(s.element)||ah.append(e,nu(s)),t.onOpenSubmenu(e,r,s,tt(a)),i===n.HighlightSubmenu?(am.highlightFirst(s),d(e,o,a)):(am.dehighlightAll(s),B.some(r))}))}))}))},g=function(e,n){var r=a(n);return o.collapse(r).bind((function(r){return f(e,r),d(e,o,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},p=function(e){return function(n,r){return fu(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map(k)}))}))}},v=zi([Ii(Vh(),(function(t,e){var n=e.event.item;o.lookupItem(a(n)).each((function(){var n=e.event.menu;am.highlight(t,n);var r=a(e.event.item);o.refresh(r).each((function(e){return l(t,o,e)}))}))})),Xi((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){0===a(r).indexOf("collapse-item")&&g(e,r),m(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),h)}))})),$i((function(e,n){i(e).each((function(n){ah.append(e,nu(n)),t.onOpenMenu(e,n),t.highlightImmediately&&c(e,n)}))}))].concat(t.navigateOnHover?[Ii(Ah(),(function(e,r){var i=r.event.item;!function(t,e){var n=a(e);o.refresh(n).bind((function(e){return f(t,e),d(t,o,e)}))}(e,i),m(e,i,n.HighlightParent),t.onHover(e,i)}))]:[])),b=function(t){return am.getHighlighted(t).bind(am.getHighlighted)},y={collapseMenu:function(t){b(t).each((function(e){g(t,e)}))},highlightPrimary:function(t){o.getPrimary().each((function(e){c(t,e)}))},repositionMenus:function(e){o.getPrimary().bind((function(t){return b(e).bind((function(t){var e=a(t),n=bt(o.getMenus()),r=St(U(n,$h.extractPreparedMenu));return o.getTriggeringPath(e,(function(t){return function(t,e,n){return st(e,(function(t){if(!t.getSystem().isConnected())return B.none();var e=am.getCandidates(t);return X(e,(function(t){return a(t)===n}))}))}(0,r,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))})).fold((function(){(function(t){return B.from(t.components()[0]).filter((function(t){return"menu"===qe(t.element,"role")}))})(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Rf(t.tmenuBehaviours,[eh.config({mode:"special",onRight:p((function(t,e){return Dd(e.element)?B.none():m(t,e,n.HighlightSubmenu)})),onLeft:p((function(t,e){return Dd(e.element)?B.none():g(t,e)})),onEscape:p((function(e,n){return g(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))})),focusIn:function(t,e){o.getPrimary().each((function(e){Di(t,e.element,si())}))}}),am.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),zd.config({find:function(t){return am.getHighlighted(t)}}),ah.config({})]),eventOrder:t.eventOrder,apis:y,events:v}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:To(t,e),expansions:{}}},collapseItem:function(t){return{value:oa(Gh()),meta:{text:t}}}}}),Xh=Nd({name:"InlineView",configFields:[Xr("lazySink"),_u("onShow"),_u("onHide"),co("onEscape"),Ef("inlineBehaviours",[af,Of,Ec]),lo("fireDismissalEventInstead",[fo("event",xi())]),lo("fireRepositionEventInstead",[fo("event",Ci())]),fo("getRelated",B.none),fo("isExtraPart",S),fo("eventOrder",B.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,(function(){return o.map((function(t){return Hn(t)}))}))},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();af.openWhileCloaked(e,n,(function(){return Ll.positionWithinBounds(i,e,r,o())})),Of.setValue(e,B.some({mode:"position",config:r,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},a="horizontal"===r.type?{layouts:{onLtr:function(){return mc()},onRtl:function(){return gc()}}}:{},u=function(t){return function(t){return 2===t.length}(t)?a:{}};return Kh.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return af.close(e),t.onEscape.map((function(t){return t(e)})),B.some(!0)},onExecute:function(){return B.some(!0)},onOpenMenu:function(t,e){Ll.positionWithinBounds(i().getOrDie(),e,n,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Ll.position(o,n,{anchor:O({type:"submenu",item:e},u(r))})},onRepositionMenu:function(t,e,r){var a=i().getOrDie();Ll.positionWithinBounds(a,e,n,o()),W(r,(function(t){var e=u(t.triggeringPath);Ll.position(a,t.triggeredMenu,{anchor:O({type:"submenu",item:t.triggeringItem},e)})}))}})}(t,e,n,r,o);af.open(e,i),Of.setValue(e,B.some({mode:"menu",menu:i}))},i=function(e){af.isOpen(e)&&Of.getValue(e).each((function(n){switch(n.mode){case"menu":af.getState(e).each(Kh.repositionMenus);break;case"position":var r=t.lazySink(e).getOrDie();Ll.positionWithinBounds(r,e,n.config,n.getBounds())}}))},a={setContent:function(t,e){af.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,B.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,B.none)},showMenuWithinBounds:o,hide:function(t){af.isOpen(t)&&(Of.setValue(t,B.none()),af.close(t))},getContent:function(t){return af.getState(t)},reposition:i,isOpen:af.isOpen};return{uid:t.uid,dom:t.dom,behaviours:Rf(t.inlineBehaviours,[af.config({isPartOf:function(e,n,r){return gu(n,r)||function(e,n){return t.getRelated(e).exists((function(t){return gu(t,n)}))}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),Of.config({store:{mode:"memory",initialValue:B.none()}}),Ec.config({channels:O(O({},ff(O({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),mf(O(O({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:a}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),Yh="layout-inset",Jh=function(t){return t.x},Qh=function(t,e){return t.x+t.width/2-e.width/2},Zh=function(t,e){return t.x+t.width-e.width},tp=function(t){return t.y},ep=function(t,e){return t.y+t.height-e.height},np=function(t,e){return t.y+t.height/2-e.height/2},rp=function(t,e,n){return zu(Zh(t,e),ep(t,e),n.insetSouthwest(),Fu(),"southwest",Gu(t,{right:0,bottom:3}),Yh)},op=function(t,e,n){return zu(Jh(t),ep(t,e),n.insetSoutheast(),Hu(),"southeast",Gu(t,{left:1,bottom:3}),Yh)},ip=function(t,e,n){return zu(Zh(t,e),tp(t),n.insetNorthwest(),Iu(),"northwest",Gu(t,{right:0,top:2}),Yh)},ap=function(t,e,n){return zu(Jh(t),tp(t),n.insetNortheast(),Lu(),"northeast",Gu(t,{left:1,top:2}),Yh)},up=function(t,e,n){return zu(Qh(t,e),tp(t),n.insetNorth(),Vu(),"north",Gu(t,{top:2}),Yh)},cp=function(t,e,n){return zu(Qh(t,e),ep(t,e),n.insetSouth(),ju(),"south",Gu(t,{bottom:3}),Yh)},sp=function(t,e,n){return zu(Zh(t,e),np(t,e),n.insetEast(),Wu(),"east",Gu(t,{right:0}),Yh)},lp=function(t,e,n){return zu(Jh(t),np(t,e),n.insetWest(),Uu(),"west",Gu(t,{left:1}),Yh)},fp=function(t){switch(t){case"north":return up;case"northeast":return ap;case"northwest":return ip;case"south":return cp;case"southeast":return op;case"southwest":return rp;case"east":return sp;case"west":return lp}},dp=function(t,e,n,r,o){return Kc(r).map(fp).getOr(up)(t,e,n,r,o)},mp=function(t){switch(t){case"north":return cp;case"northeast":return op;case"northwest":return rp;case"south":return up;case"southeast":return ap;case"southwest":return ip;case"east":return lp;case"west":return sp}},gp=function(t,e,n,r,o){return Kc(r).map(mp).getOr(up)(t,e,n,r,o)},hp=tinymce.util.Tools.resolve("tinymce.util.Delay"),pp=Nd({name:"Button",factory:function(t){var e=Oh(t.action),n=t.dom.tag,r=function(e){return yt(t.dom,"attributes").bind((function(t){return yt(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:Af(t.buttonBehaviours,[dh.config({}),eh.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return O({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[fo("uid",void 0),Xr("dom"),fo("components",[]),Nf("buttonBehaviours",[dh,eh]),oo("action"),oo("role"),fo("eventOrder",{})]}),vp=function(t){var e=function(t){return void 0!==t.uid}(t)&&xt(t,"uid")?t.uid:fa("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return O(O({},t),{uid:e})}}},bp=tinymce.util.Tools.resolve("tinymce.util.I18n"),yp={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},wp="temporary-placeholder",xp=function(t){return function(){return yt(t,wp).getOr("!not found!")}},Cp=function(t,e){var n=t.toLowerCase();if(bp.isRtl()){var r=function(t,e){return Rt(t,e)?t:function(t,e){return t+e}(t,e)}(n,"-rtl");return wt(e,r)?r:n}return n},Sp=function(t,e){return yt(e,Cp(t,e))},kp=function(t,e){var n=e();return Sp(t,n).getOrThunk(xp(n))},Tp=function(){return uh("add-focusable",[$i((function(t){su(t.element,"svg").each((function(t){return We(t,"focusable","false")}))}))])},Op=function(t,e,n,r){var o,i,a=function(t){return!!bp.isRtl()&&wt(yp,t)}(e)?["tox-icon--flip"]:[],u=yt(n,Cp(e,n)).or(r).getOrThunk(xp(n));return{dom:{tag:t.tag,attributes:null!==(o=t.attributes)&&void 0!==o?o:{},classes:t.classes.concat(a),innerHtml:u},behaviours:xc(_(_([],null!==(i=t.behaviours)&&void 0!==i?i:[],!0),[Tp()],!1))}},Ep=function(t,e,n,r){return void 0===r&&(r=B.none()),Op(e,t,n(),r)},_p={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Rp=Nd({name:"Notification",factory:function(t){var e,n,r,o,i,a=vp({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:xc([ah.config({})])}),u=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},c=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},s=vp({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[u(0)]},c(0)],behaviours:xc([ah.config({})])}),l={updateProgress:function(t,e){t.getSystem().isConnected()&&s.getOpt(t).each((function(t){ah.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[u(e)]},c(e)])}))},updateText:function(t,e){if(t.getSystem().isConnected()){var n=a.get(t);ah.set(n,[Qa(e)])}}},f=J([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return B.from(_p[t])})).toArray()]),d=vp(pp.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[Ep("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":t.translationProvider("Close")}},t.iconProvider)],action:function(e){t.onAction(e)}})),m=[(e=f,n={tag:"div",classes:["tox-notification__icon"]},r=t.iconProvider,o=r(),i=X(e,(function(t){return wt(o,Cp(t,o))})),Op(n,i.getOr(wp),o,B.none())),{dom:{tag:"div",classes:["tox-notification__body"]},components:[a.asSpec()],behaviours:xc([ah.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:xc([dh.config({}),uh("notification-events",[Ii(qo(),(function(t){d.getOpt(t).each(dh.focus)}))])]),components:m.concat(t.progress?[s.asSpec()]:[]).concat(t.closeButton?[d.asSpec()]:[]),apis:l}},configFields:[oo("level"),Xr("progress"),Xr("icon"),Xr("onAction"),Xr("text"),Xr("iconProvider"),Xr("translationProvider"),vo("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function Np(t,e,n){var r=e.backstage.shared;return{open:function(e,o){var i=!e.closeButton&&e.timeout&&(e.timeout>0||e.timeout<0),a=function(){o(),Xh.hide(c)},u=eu(Rp.sketch({text:e.text,level:H(["success","error","warning","warn","info"],e.type)?e.type:void 0,progress:!0===e.progressBar,icon:B.from(e.icon),closeButton:!i,onAction:a,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),c=eu(Xh.sketch(O({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));n.add(c),e.timeout>0&&hp.setTimeout((function(){a()}),e.timeout);var s=function(){var e=Hn(Bt.fromDom(t.getContentAreaContainer())),n=Vn(),r=$u(n.x,e.x,e.right),o=$u(n.y,e.y,e.bottom),i=Math.max(e.right,n.right),a=Math.max(e.bottom,n.bottom);return B.some(In(r,o,i-r,a-o))};return{close:a,moveTo:function(t,e){Xh.showAt(c,nu(u),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){var n=nu(u),o={maxHeightFunction:gs()};if("banner"!==e&&f(t)){var i=function(t){switch(t){case"bc-bc":return cp;case"tc-tc":return up;case"tc-bc":return ic;case"bc-tc":default:return ac}}(e),a={type:"node",root:Ve(),node:B.some(Bt.fromDom(t)),overrides:o,layouts:{onRtl:function(){return[i]},onLtr:function(){return[i]}}};Xh.showWithinBounds(c,n,{anchor:a},s)}else{var l=O(O({},r.anchors.banner()),{overrides:o});Xh.showWithinBounds(c,n,{anchor:l},s)}},text:function(t){Rp.updateText(u,t)},settings:e,getEl:function(){return u.element.dom},progressBar:{value:function(t){Rp.updateProgress(u,t)}}}},close:function(t){t.close()},reposition:function(t){t.length>0&&W(t,(function(e,n){0===n?e.moveRel(null,"banner"):e.moveRel(t[n-1].getEl(),"bc-tc")}))},getArgs:function(t){return t.settings}}}var Ap,Dp=function(t,e){var n=null,r=function(){u(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)}}},Mp=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Bp=function(t,e,n,r,o){var i=Mp(t,(function(e){return function(t,e){return t.isBlock(e)||H(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)}));return B.from(i.backwards(e,n,r,o))},zp=function(t,e){return Pp(Bt.fromDom(t.selection.getNode())).getOrThunk((function(){var n=Bt.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return On(n,Bt.fromDom(e.extractContents())),e.insertNode(n.dom),Oe(n).each((function(t){return t.dom.normalize()})),function(t){return rl(t,nl)}(n).map((function(e){t.selection.setCursorLocation(e.dom,function(t){return"img"===Pt(t)?1:tl(t).fold((function(){return _e(t).length}),(function(t){return t.length}))}(e))})),n}))},Pp=function(t){return fu(t,"[data-mce-autocompleter]")},Lp=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Ip=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},Hp=function(t,e){return t.substring(e.length)},Fp=function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return B.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return Bp(t,e.startContainer,e.startOffset,(function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(Ip(o))return B.none();if(o===n)break}return B.some(r)}(r,e,n).getOr(e)}),i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return B.none();var i=Lp(o);return 0!==i.lastIndexOf(n)||Hp(i,n).length<r?B.none():B.some({text:Hp(i,n),range:o,triggerChar:n})}))},Vp=function(t,e,n,r){return void 0===r&&(r=0),Pp(Bt.fromDom(e.startContainer)).fold((function(){return Fp(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom);var o=Lp(r);return B.some({range:r,text:Hp(o,n),triggerChar:n})}))},jp=function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){Ni(t,Go(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(am.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(Ai),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(am.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&Pp(Bt.fromDom(e.element)).isNone()&&t.cancelIfNecessary()}))},Up=tinymce.util.Tools.resolve("tinymce.util.Promise"),Wp=function(t,e){return{container:t,offset:e}},qp=function(t){if(function(t){return 3===t.nodeType}(t))return Wp(t,t.data.length);var e=t.childNodes;return e.length>0?qp(e[e.length-1]):Wp(t,e.length)},$p=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?$p(n[e],0):n.length>0&&function(t){return 1===t.nodeType}(t)&&n.length===e?qp(n[n.length-1]):Wp(t,e)},Gp=function(t){return function(e){var n=$p(e.startContainer,e.startOffset);return!function(t,e){return Bp(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!Ip(e)})).isSome()}(t,n)}},Kp=function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return st(n.triggerChars,(function(n){return Vp(t,e,n)}))}(t.dom,r,n).bind((function(n){return Xp(t,e,n)}))},Xp=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,a=$(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return Gp(t.dom)}))(n.range,i,n.text)}));if(0===a.length)return B.none();var u=Up.all(U(a,(function(t){return t.fetch(n.text,t.maxResults,r).then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return B.some({lookupData:u,context:n})},Yp=kr([Qr("type"),uo("text")]),Jp=kr([fo("type","autocompleteitem"),fo("active",!1),fo("disabled",!1),fo("meta",{}),Qr("value"),uo("text"),uo("icon")]),Qp=kr([Qr("type"),Qr("ch"),go("minChars",1),fo("columns",1),go("maxResults",10),co("matches"),to("fetch"),to("onAction"),yo("highlightOn",[],Dr)]),Zp=[vo("disabled",!1),uo("tooltip"),uo("icon"),uo("text"),bo("onSetup",(function(){return h}))],tv=kr([Qr("type"),to("onAction")].concat(Zp)),ev=function(t){return Vr("toolbarbutton",tv,t)},nv=[vo("active",!1)].concat(Zp),rv=kr(nv.concat([Qr("type"),to("onAction")])),ov=function(t){return Vr("ToggleButton",rv,t)},iv=[bo("predicate",S),po("scope","node",["node","editor"]),po("position","selection",["node","selection","line"])],av=Zp.concat([fo("type","contextformbutton"),fo("primary",!1),to("onAction"),Gr("original",b)]),uv=nv.concat([fo("type","contextformbutton"),fo("primary",!1),to("onAction"),Gr("original",b)]),cv=Zp.concat([fo("type","contextformbutton")]),sv=nv.concat([fo("type","contextformtogglebutton")]),lv=qr("type",{contextformbutton:av,contextformtogglebutton:uv}),fv=kr([fo("type","contextform"),bo("initValue",v("")),uo("label"),ro("commands",lv),io("launch",qr("type",{contextformbutton:cv,contextformtogglebutton:sv}))].concat(iv)),dv=kr([fo("type","contexttoolbar"),Qr("items")].concat(iv)),mv=function(t){var e=t.ui.registry.getAll().popups,n=mt(e,(function(t){return(e=t,Vr("Autocompleter",Qp,e)).fold((function(t){throw new Error(Wr(t))}),b);var e})),r=function(t){var e={};return W(t,(function(t){e[t]={}})),lt(e)}(pt(n,(function(t){return t.ch}))),o=bt(n);return{dataset:n,triggerChars:r,lookupByChar:function(t){return $(o,(function(e){return e.ch===t}))}}};!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Ap||(Ap={}));var gv,hv=Ap,pv="tox-menu-nav__js",vv="tox-collection__item",bv="tox-swatch",yv={normal:pv,color:bv},wv="tox-collection__item--enabled",xv="tox-collection__item-icon",Cv="tox-collection__item-label",Sv="tox-collection__item-caret",kv="tox-collection__item--active",Tv="tox-collection__item-container",Ov="tox-collection__item-container--row",Ev=function(t){return yt(yv,t).getOr(pv)},_v=function(t){return"color"===t?"tox-swatches":"tox-menu"},Rv=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:_v(t),tieredMenu:"tox-tiered-menu"}},Nv=function(t){var e=Rv(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:Ev(t)}},Av=function(t,e,n){var r=Rv(n);return{tag:"div",classes:J([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},Dv=[jh.parts.items({})],Mv=function(t,e,n){var r=Rv(n);return{dom:{tag:"div",classes:J([[r.tieredMenu]])},markers:Nv(n)}},Bv=function(t,e){return function(n){var r=j(n,e);return U(r,(function(e){return{dom:t,components:e}}))}},zv=function(t,e){var n=[],r=[];return W(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],wt(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),U(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},Pv=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[jh.parts.items({preprocess:function(n){return"auto"!==t&&t>1?Bv({tag:"div",classes:["tox-collection__group"]},t)(n):zv(n,(function(t,n){return"separator"===e[n].type}))}})]}},Lv=function(t){return F(t,(function(t){return"icon"in t&&void 0!==t.icon}))},Iv=function(t){return console.error(Wr(t)),console.log(t),B.none()},Hv=function(t,e,n,r,o){var i,a=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[jh.parts.items({preprocess:function(t){return zv(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:a.dom,components:a.components,items:n}},Fv=function(t,e,n,r,o){var i;return"color"===o?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[jh.parts.items({preprocess:"auto"!==t?Bv({tag:"div",classes:["tox-swatches__row"]},t):b})]}]}}(r)).dom,components:i.components,items:n}:"normal"===o&&"auto"===r?{value:t,dom:(i=Pv(r,n)).dom,components:i.components,items:n}:"normal"===o&&1===r?{value:t,dom:(i=Pv(1,n)).dom,components:i.components,items:n}:"normal"===o?{value:t,dom:(i=Pv(r,n)).dom,components:i.components,items:n}:"listpreview"===o&&"auto"!==r?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[jh.parts.items({preprocess:Bv({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:i.components,items:n}:{value:t,dom:Av(e,r,o),components:Dv,items:n}},Vv=[Qr("type"),Qr("src"),uo("alt"),yo("classes",[],Dr)],jv=kr(Vv),Uv=[Qr("type"),Qr("text"),uo("name"),yo("classes",["tox-collection__item-label"],Dr)],Wv=kr(Uv),qv=xr((function(){return Ir("type",{cardimage:jv,cardtext:Wv,cardcontainer:$v})})),$v=kr([Qr("type"),ho("direction","horizontal"),ho("align","left"),ho("valign","middle"),ro("items",qv)]),Gv=[vo("disabled",!1),uo("text"),uo("shortcut"),$r("value","value",sr((function(){return oa("menuitem-value")})),Rr()),fo("meta",{})],Kv=kr([Qr("type"),uo("label"),ro("items",qv),bo("onSetup",(function(){return h})),bo("onAction",h)].concat(Gv)),Xv=kr([Qr("type"),vo("active",!1),uo("icon")].concat(Gv)),Yv=[Qr("type"),Qr("fancytype"),bo("onAction",h)],Jv=[fo("initData",{})].concat(Yv),Qv=[wo("initData",{},[vo("allowCustomColors",!0),so("colors",Rr())])].concat(Yv),Zv=qr("fancytype",{inserttable:Jv,colorswatch:Qv}),tb=kr([Qr("type"),bo("onSetup",(function(){return h})),bo("onAction",h),uo("icon")].concat(Gv)),eb=kr([Qr("type"),to("getSubmenuItems"),bo("onSetup",(function(){return h})),uo("icon")].concat(Gv)),nb=kr([Qr("type"),uo("icon"),vo("active",!1),bo("onSetup",(function(){return h})),to("onAction")].concat(Gv)),rb=function(t,e,n){var r=ol(t.element,"."+n);if(r.length>0){var o=Y(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return B.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return B.none()},ob=function(t,e){return xc([uh(t,e)])},ib=function(t){return ob(oa("unnamed-events"),t)},ab=oa("tooltip.exclusive"),ub=oa("tooltip.show"),cb=oa("tooltip.hide"),sb=function(t,e,n){t.getSystem().broadcastOn([ab],{})},lb=Object.freeze({__proto__:null,hideAllExclusive:sb,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&ah.set(t,r)}))}}),fb=Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){ql(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return zi(J([[Ii(ub,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){sb(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:zi("normal"===t.mode?[Ii(Wo(),(function(t){Ri(n,ub)})),Ii(jo(),(function(t){Ri(n,cb)}))]:[]),behaviours:xc([ah.config({})])});e.setTooltip(o),jl(r,o),t.onShow(n,o),Ll.position(r,o,{anchor:t.anchor(n)})}}(n)}),t.delay)})),Ii(cb,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Ii(ui(),(function(t,e){var r=e;r.universal||H(r.channels,ab)&&n(t)})),Gi((function(t){n(t)}))],"normal"===t.mode?[Ii(qo(),(function(t){Ri(t,ub)})),Ii(ii(),(function(t){Ri(t,cb)})),Ii(Wo(),(function(t){Ri(t,ub)})),Ii(jo(),(function(t){Ri(t,cb)}))]:[Ii(Ei(),(function(t,e){Ri(t,ub)})),Ii(_i(),(function(t){Ri(t,cb)}))]]))}}),db=[Xr("lazySink"),Xr("tooltipDom"),fo("exclusive",!0),fo("tooltipComponents",[]),fo("delay",300),po("mode","normal",["normal","follow-highlight"]),fo("anchor",(function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:v([ac,ic,ec,rc,nc,oc]),onRtl:v([ac,ic,ec,rc,nc,oc])}}})),_u("onHide"),_u("onShow")],mb=Sc({fields:db,name:"tooltipping",active:fb,state:Object.freeze({__proto__:null,init:function(){var t=Zc(),e=Zc(),n=function(){t.on(clearTimeout)},r=v("not-implemented");return xa({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:n,resetTimer:function(e,r){n(),t.set(setTimeout(e,r))},readState:r})}}),apis:lb}),gb=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),hb=tinymce.util.Tools.resolve("tinymce.EditorManager"),pb=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},vb=function(t){return t.getParam("width",gb.DOM.getStyle(t.getElement(),"width"))},bb=function(t){return B.from(t.getParam("min_width")).filter(m)},yb=function(t){return B.from(t.getParam("min_height")).filter(m)},wb=function(t){return B.from(t.getParam("max_width")).filter(m)},xb=function(t){return B.from(t.getParam("max_height")).filter(m)},Cb=function(t){return!1!==t.getParam("menubar",!0,"boolean")},Sb=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=o(e),i=a(e)&&e.length>0;return!Tb(t)&&(i||r||n)},kb=function(t){var e=V(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=$(e,(function(t){return"string"==typeof t}));return n.length>0?B.some(n):B.none()},Tb=function(t){return kb(t).fold((function(){return t.getParam("toolbar",[],"string[]").length>0}),k)};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(gv||(gv={}));var Ob,Eb=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(Ob||(Ob={}));var _b,Rb,Nb=function(t){return t.getParam("toolbar_location",Ob.auto,"string")},Ab=function(t){return Nb(t)===Ob.bottom},Db=function(t){if(!t.inline)return B.none();var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);if(e.length>0)return lu(Ve(),e);var n=function(t){return t.getParam("fixed_toolbar_container_target")}(t);return f(n)?B.some(Bt.fromDom(n)):B.none()},Mb=function(t){return t.inline&&Db(t).isSome()},Bb=function(t){return Db(t).getOrThunk((function(){return Pe(ze(Bt.fromDom(t.getElement())))}))},zb=function(t){return t.inline&&!Cb(t)&&!Sb(t)&&!Tb(t)},Pb=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!Mb(t)&&!zb(t)},Lb=function(t){var e=t.getParam("menu");return e?mt(e,(function(t){return O(O({},t),{items:t.items})})):{}},Ib=function(t){return t.getParam("menubar")},Hb=function(t){return t.getParam("anchor_top","#top")},Fb=function(t){return t.getParam("anchor_bottom","#bottom")},Vb="silver.readonly",jb=kr([(_b="readonly",Yr(_b,Mr))]),Ub=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([uf()],{target:n}),t.uiMothership.broadcastOn([uf()],{target:n})),t.mothership.broadcastOn([Vb],{readonly:e}),t.uiMothership.broadcastOn([Vb],{readonly:e})},Wb=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&Ub(e,!0)})),t.on("SwitchMode",(function(){return Ub(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},qb=function(){var t;return Ec.config({channels:(t={},t[Vb]={schema:jb,onReceive:function(t,e){Xd.set(t,e.readonly)}},t)})},$b=function(t){return Xd.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},Gb=function(t){return Xd.config({disabled:t})},Kb=function(t){return Xd.config({disabled:t,disableClass:"tox-tbtn--disabled"})},Xb=function(t){return Xd.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Yb=function(t,e){var n=t.getApi(e);return function(t){t(n)}},Jb=function(t,e){return $i((function(n){Yb(t,n)((function(n){var r=t.onSetup(n);d(r)&&e.set(r)}))}))},Qb=function(t,e){return Gi((function(n){return Yb(t,n)(e.get())}))},Zb=function(t,e){return Xi((function(n,r){Yb(t,n)(t.onAction),t.triggersSubmenu||e!==hv.CLOSE_ON_EXECUTE||(Ri(n,di()),r.stop())}))},ty=((Rb={})[ci()]=["disabling","alloy.base.behaviour","toggling","item-events"],Rb),ey=St,ny=function(t,e,n,r){var o=xo(h);return{type:"item",dom:e.dom,components:ey(e.optComponents),data:t.data,eventOrder:ty,hasSubmenu:t.triggersSubmenu,itemBehaviours:xc([uh("item-events",[Zb(t,n),Jb(t,o),Qb(t,o)]),$b((function(){return t.disabled||r.isDisabled()})),qb(),ah.config({})].concat(t.itemBehaviours))}},ry=function(t){return{value:t.value,meta:O({text:t.text.getOr("")},t.meta)}},oy=tinymce.util.Tools.resolve("tinymce.Env"),iy=function(t){var e=oy.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=U(n,(function(t){var n=t.toLowerCase().trim();return wt(e,n)?e[n]:t}));return oy.mac?r.join(""):r.join("+")},ay=function(t,e,n){return void 0===n&&(n=[xv]),Ep(t,{tag:"div",classes:n},e)},uy=function(t){return{dom:{tag:"div",classes:[Cv]},components:[Qa(bp.translate(t))]}},cy=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},sy=function(t,e){return{dom:{tag:"div",classes:[Cv]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Qa(bp.translate(e))]}]}},ly=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:iy(t)}}},fy=function(t){return ay("checkmark",t,["tox-collection__item-checkmark"])},dy=function(t,e,n){var r,o,i=t.ariaLabel,a=t.value,u=t.iconContent.map((function(t){return function(t,e,n){var r=e();return Sp(t,r).or(n).getOrThunk(xp(r))}(t,e.icons,n)}));return{dom:(r=u.getOr(""),o={tag:"div",attributes:i.map((function(t){return{title:e.translate(t)}})).getOr({}),classes:["tox-swatch"]},O(O({},o),"custom"===a?{tag:"button",classes:_(_([],o.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:r}:"remove"===a?{classes:_(_([],o.classes,!0),["tox-swatch--remove"],!1),innerHtml:r}:{attributes:O(O({},o.attributes),{"data-mce-color":a}),styles:{"background-color":a}})),optComponents:[]}},my=function(t){var e=t.map((function(t){return{attributes:{title:bp.translate(t)}}})).getOr({});return O({tag:"div",classes:[pv,vv]},e)},gy=function(t,e,n,r){return void 0===r&&(r=B.none()),"color"===t.presets?dy(t,e,r):function(t,e,n,r){var o={tag:"div",classes:[xv]},i=n?t.iconContent.map((function(t){return Ep(t,o,e.icons,r)})).orThunk((function(){return B.some({dom:o})})):B.none(),a=t.checkMark,u=B.from(t.meta).fold((function(){return uy}),(function(t){return wt(t,"style")?w(sy,t.style):uy})),c=t.htmlContent.fold((function(){return t.textContent.map(u)}),(function(t){return B.some(cy(t,[Cv]))}));return{dom:my(t.ariaLabel),optComponents:[i,c,t.shortcutContent.map(ly),a,t.caret]}}(t,e,n,r)},hy=function(t,e){return yt(t,"tooltipWorker").map((function(t){return[mb.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:gs}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){mb.setComponents(e,[Za({element:Bt.fromDom(t)})])}))}})]})).getOr([])},py=function(t,e){var n=function(t){return gb.DOM.encode(t)}(bp.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return n},vy=function(t,e){return U(t,(function(t){switch(t.type){case"cardcontainer":return function(t,e){var n="vertical"===t.direction?"tox-collection__item-container--column":Ov,r="left"===t.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[Tv,n,r,function(){switch(t.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:e}}(t,vy(t.items,e));case"cardimage":return function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}}(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return H(e.cardText.highlightOn,t)}))?B.from(e.cardText.matchText).getOr(""):"";return cy(py(t.text,n),t.classes)}}))},by=sd(zh(),Ph()),yy=function(t){return{value:t}},wy=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,xy=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Cy=function(t){return wy.test(t)||xy.test(t)},Sy=function(t){return function(t,e){return _t(t,e)?function(t,e){return t.substring(e)}(t,e.length):t}(t,"#").toUpperCase()},ky=function(t){var e=function(t){return{value:t.value.replace(wy,(function(t,e,n,r){return e+e+n+n+r+r}))}}(t),n=xy.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},Ty=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Oy=function(t){var e=Ty(t.red)+Ty(t.green)+Ty(t.blue);return yy(e)},Ey=Math.min,_y=Math.max,Ry=Math.round,Ny=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Ay=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Dy=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},My=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},By=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,a=t.value/100;if(i=_y(0,Ey(i,1)),a=_y(0,Ey(a,1)),0===i)return e=n=r=Ry(255*a),Dy(e,n,r,1);var u=o/60,c=a*i,s=c*(1-Math.abs(u%2-1)),l=a-c;switch(Math.floor(u)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=Ry(255*(e+l)),n=Ry(255*(n+l)),r=Ry(255*(r+l)),Dy(e,n,r,1)},zy=function(t){var e=ky(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return Dy(n,r,o,1)},Py=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),a=parseInt(n,10),u=parseFloat(r);return Dy(o,i,a,u)},Ly=function(t){if("transparent"===t)return B.some(Dy(0,0,0,0));var e=Ny.exec(t);if(null!==e)return B.some(Py(e[1],e[2],e[3],"1"));var n=Ay.exec(t);return null!==n?B.some(Py(n[1],n[2],n[3],n[4])):B.none()},Iy=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},Hy=Dy(255,0,0,1),Fy=function(t,e){return t.fire("ResizeContent",e)},Vy=function(t,e,n){return{hue:t,saturation:e,value:n}},jy=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,a=t.blue/255,u=Math.min(o,Math.min(i,a)),c=Math.max(o,Math.max(i,a));return u===c?Vy(0,0,100*(r=u)):(n=60*((n=o===u?3:a===u?1:5)-(o===u?i-a:a===u?o-i:a-o)/(c-u)),e=(c-u)/c,r=c,Vy(Math.round(n),Math.round(100*e),Math.round(100*r)))},Uy=function(t){return Oy(By(t))},Wy=function(t){return(e=t,Cy(e)?B.some({value:Sy(e)}):B.none()).orThunk((function(){return Ly(t).map(Oy)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],a=r[2],u=r[3];return Oy(Dy(o,i,a,u))}));var e},qy=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),$y="tinymce-custom-colors";var Gy,Ky="choiceitem",Xy=[{type:Ky,text:"Light Green",value:"#BFEDD2"},{type:Ky,text:"Light Yellow",value:"#FBEEB8"},{type:Ky,text:"Light Red",value:"#F8CAC6"},{type:Ky,text:"Light Purple",value:"#ECCAFA"},{type:Ky,text:"Light Blue",value:"#C2E0F4"},{type:Ky,text:"Green",value:"#2DC26B"},{type:Ky,text:"Yellow",value:"#F1C40F"},{type:Ky,text:"Red",value:"#E03E2D"},{type:Ky,text:"Purple",value:"#B96AD9"},{type:Ky,text:"Blue",value:"#3598DB"},{type:Ky,text:"Dark Turquoise",value:"#169179"},{type:Ky,text:"Orange",value:"#E67E23"},{type:Ky,text:"Dark Red",value:"#BA372A"},{type:Ky,text:"Dark Purple",value:"#843FA1"},{type:Ky,text:"Dark Blue",value:"#236FA1"},{type:Ky,text:"Light Gray",value:"#ECF0F1"},{type:Ky,text:"Medium Gray",value:"#CED4D9"},{type:Ky,text:"Gray",value:"#95A5A6"},{type:Ky,text:"Dark Gray",value:"#7E8C8D"},{type:Ky,text:"Navy Blue",value:"#34495E"},{type:Ky,text:"Black",value:"#000000"},{type:Ky,text:"White",value:"#ffffff"}],Yy=function(t){void 0===t&&(t=10);var e,n=qy.getItem($y),r=o(n)?JSON.parse(n):[],i=t-(e=r).length<0?e.slice(0,t):e,a=function(t){i.splice(t,1)};return{add:function(e){(function(t,e){var n=I(t,e);return-1===n?B.none():B.some(n)})(i,e).each(a),i.unshift(e),i.length>t&&i.pop(),qy.setItem($y,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Jy=function(t){return!1!==t.getParam("custom_colors")},Qy=function(t){var e=function(t){return t.getParam("color_map")}(t);return void 0!==e?function(t){for(var e=[],n=0;n<t.length;n+=2)e.push({text:t[n+1],value:"#"+Wy(t[n]).value,type:"choiceitem"});return e}(e):Xy},Zy=function(t){Yy.add(t)},tw=function(t){return function(t,e){return t.getParam("color_cols",e,"number")}(t,function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))}(Qy(t).length))},ew=function(t){var e="choiceitem",n={type:e,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[n,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[n]},nw=function(t,e,n,r){"custom"===n?cw(t)((function(n){n.each((function(n){Zy(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},rw=function(t,e){return t.concat(U(Yy.state(),(function(t){return{type:Ky,text:t,value:t}})).concat(ew(e)))},ow=function(t,e){return function(n){n(rw(t,e))}},iw=function(t,e,n){var r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";t.setIconFill(r,n)},aw=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return B.from(function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),n}(t,n)).bind((function(t){return Ly(t).map((function(t){var n=Oy(t).value;return Et(e.toLowerCase(),n)}))})).getOr(!1)},columns:tw(t),fetch:ow(Qy(t),Jy(t)),onAction:function(e){null!==o.get()&&nw(t,n,o.get(),h)},onItemAction:function(r,i){nw(t,n,i,(function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})}))},onSetup:function(n){null!==o.get()&&iw(n,e,o.get());var r=function(t){t.name===e&&iw(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},uw=function(t,e,n,r){t.ui.registry.addNestedMenuItem(e,{text:r,icon:"forecolor"===e?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(e){nw(t,n,e.value,h)}}]}})},cw=function(t){return function(e,n){var r=!1,o={colorpicker:n};t.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(t,e){"hex-valid"===e.name&&(r=e.value)},onSubmit:function(n){var o=n.getData().colorpicker;r?(e(B.from(o)),n.close()):t.windowManager.alert(t.translate(["Invalid hex color code: {0}",o]))},onClose:h,onCancel:function(){e(B.none())}})}},sw=function(t,e,n,r,o,i,a,u){var c=Lv(e),s=lw(e,n,r,"color"!==o?"normal":"color",i,a,u);return Fv(t,c,s,r,o)},lw=function(t,e,n,r,o,i,a){return St(U(t,(function(u){return"choiceitem"===u.type?(c=u,Vr("choicemenuitem",Xv,c)).fold(Iv,(function(c){return B.some(function(t,e,n,r,o,i,a,u){void 0===u&&(u=!0);var c=gy({presets:n,textContent:e?t.text:B.none(),htmlContent:B.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:B.none(),checkMark:e?B.some(fy(a.icons)):B.none(),caret:B.none(),value:t.value},a,u);return ur(ny({data:ry(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){kh.set(t,e)},isActive:function(){return kh.isOn(t)},isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),h},triggersSubmenu:!1,itemBehaviours:[]},c,i,a),{toggling:{toggleClass:wv,toggleOnExecute:!1,selected:t.active}})}(c,1===n,r,e,i(u.value),o,a,Lv(t)))})):B.none();var c})))},fw=function(t,e){var n=Nv(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}},dw=function(t,e){var n=t.initData.allowCustomColors&&e.colorinput.hasCustomColors();return t.initData.colors.fold((function(){return rw(e.colorinput.getColors(),n)}),(function(t){return t.concat(ew(n))}))},mw=oa("cell-over"),gw=oa("cell-execute"),hw=function(t,e,n){var r,o=function(n){return Ni(n,gw,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return eu({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:xc([uh("insert-table-picker-cell",[Ii(Wo(),dh.focus),Ii(ci(),o),Ii(Jo(),i),Ii(li(),i)]),kh.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),dh.config({onFocus:function(n){return Ni(n,mw,{row:t,col:e})}})])})},pw=function(t){return Q(t,(function(t){return U(t,nu)}))},vw=function(t,e){return Qa(e+1+"x"+(t+1))},bw={inserttable:function(t){var e=oa("size-label"),n=function(t,e,n){for(var r=[],o=0;o<e;o++){for(var i=[],a=0;a<n;a++)i.push(hw(o,a,t));r.push(i)}return r}(e,10,10),r=vp({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[Qa("0x0")],behaviours:xc([ah.config({})])});return{type:"widget",data:{value:oa("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[by.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:pw(n).concat(r.asSpec()),behaviours:xc([uh("insert-table-picker",[ji(mw,(function(t,e,o){var i=o.event.row,a=o.event.col;!function(t,e,n,r,o){for(var i=0;i<r;i++)for(var a=0;a<o;a++)kh.set(t[i][a],i<=e&&a<=n)}(n,i,a,10,10),ah.set(r.get(t),[vw(i,a)])})),ji(gw,(function(e,n,r){t.onAction({numRows:r.event.row+1,numColumns:r.event.col+1}),Ri(e,di())}))]),eh.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=dw(t,e),r=e.colorinput.getColorCols(),o="color",i=sw(oa("menu-value"),n,(function(e){t.onAction({value:e})}),r,o,hv.CLOSE_ON_EXECUTE,S,e.shared.providers),a=O(O({},i),{markers:Nv(o),movement:fw(r,o)});return{type:"widget",data:{value:oa("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[by.widget(jh.sketch(a))]}}},yw=function(t,e,n,r,o,i,a,u){void 0===u&&(u=!0);var c=gy({presets:r,textContent:B.none(),htmlContent:n?t.text.map((function(t){return py(t,e)})):B.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:B.none(),checkMark:B.none(),caret:B.none(),value:t.value},a.providers,u,t.icon);return ny({data:ry(t),disabled:t.disabled,getApi:v({}),onAction:function(e){return o(t.value,t.meta)},onSetup:v(h),triggersSubmenu:!1,itemBehaviours:hy(t.meta,a)},c,i,a.providers)},ww=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:O({tag:"div",classes:[vv,"tox-collection__group-heading"]},e),components:[]}},xw=function(t,e,n,r){void 0===r&&(r=!0);var o=gy({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:B.none(),ariaLabel:t.text,caret:B.none(),checkMark:B.none(),shortcutContent:t.shortcut},n,r);return ny({data:ry(t),getApi:function(t){return{isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)},Cw=function(t,e,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var i,a=o?(i=n.icons,ay("chevron-down",i,[Sv])):function(t){return ay("chevron-right",t,[Sv])}(n.icons),u=gy({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:B.none(),ariaLabel:t.text,caret:B.some(a),checkMark:B.none(),shortcutContent:t.shortcut},n,r);return ny({data:ry(t),getApi:function(t){return{isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)}}},disabled:t.disabled,onAction:h,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,e,n)},Sw=function(t,e,n,r){void 0===r&&(r=!0);var o=gy({iconContent:t.icon,textContent:t.text,htmlContent:B.none(),ariaLabel:t.text,checkMark:B.some(fy(n.icons)),caret:B.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return ur(ny({data:ry(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){kh.set(t,e)},isActive:function(){return kh.isOn(t)},isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:wv,toggleOnExecute:!1,selected:t.active}})},kw=function(t,e){return yt(bw,t.fancytype).map((function(n){return n(t,e)}))},Tw=function(t,e,n,r){var o={dom:my(t.label),optComponents:[B.some({dom:{tag:"div",classes:[Tv,Ov]},components:vy(t.items,r)})]};return ny({data:ry(O({text:B.none()},t)),disabled:t.disabled,getApi:function(t){return{isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){Xd.set(t,e),W(ol(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(Xd)&&Xd.set(t,e)}))}))}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:B.from(r.itemBehaviours).getOr([])},o,e,n.providers)};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(Gy||(Gy={}));var Ow=function(t,e,n,r,o){var i,a=n.shared.providers,u=function(t){return o?O(O({},t),{shortcut:B.none(),icon:t.text.isSome()?B.none():t.icon}):t};switch(t.type){case"menuitem":return(i=t,Vr("menuitem",tb,i)).fold(Iv,(function(t){return B.some(xw(u(t),e,a,r))}));case"nestedmenuitem":return function(t){return Vr("nestedmenuitem",eb,t)}(t).fold(Iv,(function(t){return B.some(Cw(u(t),e,a,r,o))}));case"togglemenuitem":return function(t){return Vr("togglemenuitem",nb,t)}(t).fold(Iv,(function(t){return B.some(Sw(u(t),e,a,r))}));case"separator":return function(t){return Vr("separatormenuitem",Yp,t)}(t).fold(Iv,(function(t){return B.some(ww(t))}));case"fancymenuitem":return function(t){return Vr("fancymenuitem",Zv,t)}(t).fold(Iv,(function(t){return kw(u(t),n)}));default:return console.error("Unknown item in general menu",t),B.none()}},Ew=function(t,e,n,r,o,i,a){var u=1===r,c=!u||Lv(t);return St(U(t,(function(t){switch(t.type){case"separator":return(r=t,Vr("Autocompleter.Separator",Yp,r)).fold(Iv,(function(t){return B.some(ww(t))}));case"cardmenuitem":return function(t){return Vr("cardmenuitem",Kv,t)}(t).fold(Iv,(function(t){return B.some(Tw(O(O({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:hy(t.meta,i),cardText:{matchText:e,highlightOn:a}}))}));case"autocompleteitem":default:return function(t){return Vr("Autocompleter.Item",Jp,t)}(t).fold(Iv,(function(t){return B.some(yw(t,e,u,"normal",n,o,i,c))}))}var r})))},_w=function(t,e,n,r,o){var i=Lv(e),a=St(U(e,(function(t){var e=function(t){return Ow(t,n,r,function(t){return o?!wt(t,"text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(O(O({},t),{disabled:!0})):e(t)})));return(o?Hv:Fv)(t,i,a,1,"normal")},Rw=function(t){return Kh.singleData(t.value,t)},Nw=function(t,e){var n=Zc(),r=xo(!1),o=eu(Xh.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:xc([uh("dismissAutocompleter",[Ii(xi(),(function(){return u()}))])]),lazySink:e.getSink})),i=function(){return n.get().isSome()},a=function(){i()&&Xh.hide(o)},u=function(){if(i()){var e=n.get().map((function(t){return t.element}));Pp(e.getOr(Bt.fromDom(t.selection.getNode()))).each(Nn),a(),n.clear(),r.set(!1)}},c=jt((function(){return mv(t)})),s=function(e,n,r,i){e.matchLength=n.text.length;var a=st(r,(function(t){return B.from(t.columns)})).getOr(1);Xh.showAt(o,jh.sketch(function(t,e,n,r){var o=n===Gy.ContentFocus?_m():Em(),i=fw(e,r),a=Nv(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:a.selectedItem,item:a.item},movement:i,fakeFocus:n===Gy.ContentFocus,focusManager:o,menuBehaviours:ib("auto"!==e?[]:[$i((function(t,e){rb(t,4,a.item).each((function(e){var n=e.numColumns,r=e.numRows;eh.setGridSize(t,r,n)}))}))])}}(Fv("autocompleter-value",!0,i,a,"normal"),a,Gy.ContentFocus,"normal")),{anchor:{type:"node",root:Bt.fromDom(t.getBody()),node:B.from(e.element)}}),Xh.getContent(o).each(am.highlightFirst)},l=function(o){(function(e){return n.get().map((function(n){return Vp(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return Xp(t,c,n,e)}))})).getOrThunk((function(){return Kp(t,c)}))})(o).fold(u,(function(o){!function(e){if(!i()){var o=zp(t,e.range);n.set({triggerChar:e.triggerChar,element:o,matchLength:e.text.length}),r.set(!1)}}(o.context),o.lookupData.then((function(i){n.get().map((function(n){var c,f,d,m=o.context;if(n.triggerChar===m.triggerChar){var g=(c=m.triggerChar,d=st(f=i,(function(t){return B.from(t.columns)})).getOr(1),Q(f,(function(n){var o=n.items;return Ew(o,n.matchText,(function(e,o){var i=t.selection.getRng();Vp(t.dom,i,c).fold((function(){return console.error("Lost context. Cursor probably moved")}),(function(t){var i=t.range,c={hide:function(){u()},reload:function(t){a(),l(t)}};r.set(!0),n.onAction(c,i,e,o),r.set(!1)}))}),d,hv.BUBBLE_TO_SANDBOX,e,n.highlightOn)})));g.length>0?s(n,m,i,g):m.text.length-n.matchLength>=10?u():a()}}))}))}))},f={onKeypress:Dp((function(t){27!==t.which&&l()}),50),cancelIfNecessary:u,isMenuOpen:function(){return Xh.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return Xh.getContent(o)}};!1===t.hasPlugin("rtc")&&jp(f,t)},Aw=function(t,e,n){return fu(t,e,n).isSome()},Dw=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},schedule:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},Mw=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?B.none():B.some(e.touches[0])},Bw=function(t){var e=Zc(),n=xo(!1),r=Dw((function(e){t.triggerEvent(fi(),e),n.set(!0)}),400),o=Oo([{key:Po(),value:function(t){return Mw(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(i)})),B.none()}},{key:Lo(),value:function(t){return r.cancel(),Mw(t).each((function(t){e.on((function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.clear()}))})),B.none()}},{key:Io(),value:function(o){r.cancel();return e.get().filter((function(t){return ye(t.target,o.target)})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(li(),o)}))}}]);return{fireIfReady:function(t,e){return yt(o,e).bind((function(e){return e(t)}))}}},zw=function(){return pe().browser.isFirefox()},Pw=function(t,e){var n=O({stopBackspace:!0},e),r=Bw(n),o=U(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return es(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=Zc(),a=es(t,"paste",(function(t){r.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),n.triggerEvent("paste",t)&&t.kill(),i.set(setTimeout((function(){n.triggerEvent(ai(),t)}),0))})),u=es(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():n.stopBackspace&&function(t){return t.raw.which===um[0]&&!H(["input","textarea"],Pt(t.target))&&!Aw(t.target,'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return zw()?ns(t,"focus",e):es(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=Zc(),l=function(t,e){return zw()?ns(t,"blur",e):es(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(setTimeout((function(){n.triggerEvent(ii(),t)}),0))}));return{unbind:function(){W(o,(function(t){t.unbind()})),u.unbind(),c.unbind(),l.unbind(),a.unbind(),i.on(clearTimeout),s.on(clearTimeout)}}},Lw=function(t,e){var n=yt(t,"target").getOr(e);return xo(n)},Iw=Co([{stopped:[]},{resume:["element"]},{complete:[]}]),Hw=function(t,e,n,r,o,i){var a=t(e,r),u=function(t,e){var n=xo(!1),r=xo(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return a.fold((function(){return i.logEventNoHandlers(e,r),Iw.complete()}),(function(t){var n=t.descHandler;return ka(n)(u),u.isStopped()?(i.logEventStopped(e,t.element,n.purpose),Iw.stopped()):u.isCut()?(i.logEventCut(e,t.element,n.purpose),Iw.complete()):Oe(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),Iw.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),Iw.resume(r)}))}))},Fw=function(t,e,n,r,o,i){return Hw(t,e,n,r,o,i).fold(k,(function(r){return Fw(t,e,n,r,o,i)}),S)},Vw=function(t,e,n){var r=function(t){var e=xo(!1);return{stop:function(){e.set(!0)},cut:h,isStopped:e.get,isCut:S,event:t,setSource:C("Cannot set source of a broadcasted event"),getSource:C("Cannot get source of a broadcasted event")}}(e);return W(t,(function(t){var e=t.descHandler;ka(e)(r)})),r.isStopped()},jw=function(t,e,n,r,o){var i=Lw(n,r);return Fw(t,e,n,r,i,o)},Uw=function(){var t={};return{registerId:function(e,n,r){dt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=function(t,e){return n=w.apply(void 0,[t.handler].concat(e)),r=t.purpose,{cHandler:n,purpose:r};var n,r}(r,e),t[o]=i}))},unregisterId:function(e){dt(t,(function(t,n){wt(t,e)&&delete t[e]}))},filterByType:function(e){return yt(t,e).map((function(t){return pt(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){return yt(t,n).bind((function(t){return No(r,(function(e){return function(t,e){return la(e).bind((function(e){return yt(t,e)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}(t,e)}),e)}))}}},Ww=function(){var t=Uw(),e={},n=function(t){var e=t.element;return la(e).getOrThunk((function(){return function(t,e){var n=oa(ua+t);return sa(e,n),n}("uid-",t.element)}))},r=function(n){la(n.element).each((function(n){delete e[n],t.unregisterId(n)}))};return{find:function(e,n,r){return t.find(e,n,r)},filter:function(e){return t.filterByType(e)},register:function(o){var i=n(o);xt(e,i)&&function(t,n){var o=e[n];if(o!==t)throw new Error('The tagId "'+n+'" is already used by: '+ta(o.element)+"\nCannot use it for: "+ta(t.element)+"\nThe conflicting element is"+(Fe(o.element)?" ":" not ")+"already in the DOM");r(t)}(o,i);var a=[o];t.registerId(a,i,o.events),e[i]=o},unregister:r,getById:function(t){return yt(e,t)}}},qw=Nd({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=E(e,["attributes"]);return{uid:t.uid,dom:O({tag:"div",attributes:O({role:"presentation"},n)},r),components:t.components,behaviours:_f(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[fo("components",[]),Ef("containerBehaviours",[]),fo("events",{}),fo("domModification",{}),fo("eventOrder",{})]}),$w=function(t){var e=function(e){return Oe(t.element).fold(k,(function(t){return ye(e,t)}))},n=Ww(),r=function(t,r){return n.find(e,t,r)},o=Pw(t.element,{triggerEvent:function(t,e){return yu(t,e.target,(function(n){return function(t,e,n,r){return jw(t,e,n,n.target,r)}(r,t,e,n)}))}}),i={debugInfo:v("real"),triggerEvent:function(t,e,n){yu(t,e,(function(o){return jw(r,t,n,e,o)}))},triggerFocus:function(t,e){la(t).fold((function(){Nc(t)}),(function(n){yu(oi(),t,(function(n){return function(t,e,n,r,o){var i=Lw(n,r);Hw(t,e,n,r,i,o)}(r,oi(),{originator:e,kill:h,prevent:h,target:t},t,n),!1}))}))},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:eu,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){a(t)},removeFromWorld:function(t){u(t)},broadcast:function(t){f(t)},broadcastOn:function(t,e){d(t,e)},broadcastEvent:function(t,e){m(t,e)},isConnected:k},a=function(t){t.connect(i),Ht(t.element)||(n.register(t),W(t.components(),a),i.triggerEvent(gi(),t.element,{target:t.element}))},u=function(t){Ht(t.element)||(W(t.components(),u),n.unregister(t)),t.disconnect()},c=function(e){jl(t,e)},s=function(t){ql(t)},l=function(t){var e=n.filter(ui());W(e,(function(e){var n=e.descHandler;ka(n)(t)}))},f=function(t){l({universal:!0,data:t})},d=function(t,e){l({universal:!1,channels:t,data:e})},m=function(t,e){var r=n.filter(t);return Vw(r,e)},g=function(t){return n.getById(t).fold((function(){return Wn.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),Wn.value)},p=function(t){var e=la(t).getOr("not found");return g(e)};return a(t),{root:t,element:t.element,destroy:function(){o.unbind(),Rn(t.element)},add:c,remove:s,getByUid:g,getByDom:p,addToWorld:a,removeFromWorld:u,broadcast:f,broadcastOn:d,broadcastEvent:m}},Gw=v([fo("prefix","form-field"),Ef("fieldBehaviours",[zd,Of])]),Kw=v([od({schema:[Xr("dom")],name:"label"}),od({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Xr("text")],name:"aria-descriptor"}),nd({factory:{sketch:function(t){var e=ko(t,["factory"]);return t.factory.sketch(e)}},schema:[Xr("factory")],name:"field"})]),Xw=Ad({name:"FormField",configFields:Gw(),partFields:Kw(),factory:function(t,e,n,r){var o=Rf(t.fieldBehaviours,[zd.config({find:function(e){return pd(e,t,"field")}}),Of.config({store:{mode:"manual",getValue:function(t){return zd.getCurrent(t).bind(Of.getValue)},setValue:function(t,e){zd.getCurrent(t).each((function(t){Of.setValue(t,e)}))}}})]),i=zi([$i((function(e,n){var r=bd(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=oa(t.prefix);r.label().each((function(t){We(t.element,"for",n),We(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=oa(t.prefix);We(n.element,"id",r),We(e.element,"aria-describedby",r)}))}))}))]),a={getField:function(e){return pd(e,t,"field")},getLabel:function(e){return pd(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:a}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),Yw=Object.freeze({__proto__:null,exhibit:function(t,e){return Sa({attributes:Oo([{key:e.tabAttr,value:"true"}])})}}),Jw=[fo("tabAttr","data-alloy-tabstop")],Qw=Sc({fields:Jw,name:"tabstopping",active:Yw}),Zw=tinymce.util.Tools.resolve("tinymce.html.Entities"),tx=function(t,e,n,r){var o=ex(t,e,n,r);return Xw.sketch(o)},ex=function(t,e,n,r){return{dom:nx(n),components:t.toArray().concat([e]),fieldBehaviours:xc(r)}},nx=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},rx=function(t,e){return Xw.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},ox=oa("form-component-change"),ix=oa("form-close"),ax=oa("form-cancel"),ux=oa("form-action"),cx=oa("form-submit"),sx=oa("form-block"),lx=oa("form-unblock"),fx=oa("form-tabchange"),dx=oa("form-resize"),mx=function(t,e){var n,r,o,i=t.label.map((function(t){return rx(t,e)})),a=function(t){return function(e,n){fu(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,qe(r,"data-collection-item-value"))}))}},u=a((function(n,r,o,i){r.stop(),e.isDisabled()||Ni(n,ux,{name:t.name,value:i})})),c=[Ii(Wo(),a((function(t,e,n){Nc(n)}))),Ii(Jo(),u),Ii(li(),u),Ii(qo(),a((function(t,e,n){lu(t.element,"."+kv).each((function(t){Ha(t,kv)})),La(n,kv)}))),Ii($o(),a((function(t){lu(t.element,"."+kv).each((function(t){Ha(t,kv)}))}))),Xi(a((function(e,n,r,o){Ni(e,ux,{name:t.name,value:o})})))],s=function(t,e){return U(ol(t.element,".tox-collection__item"),e)},l=Xw.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:b},behaviours:xc([Xd.config({disabled:e.isDisabled,onDisabled:function(t){s(t,(function(t){La(t,"tox-collection__item--state-disabled"),We(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){Ha(t,"tox-collection__item--state-disabled"),Ke(t,"aria-disabled")}))}}),qb(),ah.config({}),Of.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=U(r,(function(n){var r=bp.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",a={_:" "," - ":" ","-":" "},u=r.replace(/\_| \- |\-/g,(function(t){return a[t]}));return'<div class="tox-collection__item'+(e.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+Zw.encodeAllRaw(n.value)+'" title="'+u+'" aria-label="'+u+'">'+i+o+"</div>"})),i="auto"!==t.columns&&t.columns>1?j(o,t.columns):[o],a=U(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));Ji(n.element,a.join(""))}(n,r),"auto"===t.columns&&rb(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;eh.setGridSize(n,e,r)})),Ri(n,dx)}}),Qw.config({}),eh.config((r=t.columns,o="normal",1===r?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===r?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===o?".tox-swatches__row":".tox-collection__group",cell:"color"===o?".tox-swatch":"."+vv}})),uh("collection-events",c)]),eventOrder:(n={},n[ci()]=["disabling","alloy.base.behaviour","collection-events"],n)});return tx(i,l,["tox-form__group--collection"],[])},gx=v([oo("data"),fo("inputAttributes",{}),fo("inputStyles",{}),fo("tag","input"),fo("inputClasses",[]),_u("onSetValue"),fo("styles",{}),fo("eventOrder",{}),Ef("inputBehaviours",[Of,dh]),fo("selectOnFocus",!0)]),hx=function(t){return xc([dh.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=Ua(e);e.dom.setSelectionRange(0,n.length)}:h})])},px=function(t){return O(O({},hx(t)),Rf(t.inputBehaviours,[Of.config({store:O(O({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return Ua(t.element)},setValue:function(t,e){Ua(t.element)!==e&&Wa(t.element,e)}}),onSetValue:t.onSetValue})]))},vx=function(t){return{tag:t.tag,attributes:O({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},bx=Nd({name:"Input",configFields:gx(),factory:function(t,e){return{uid:t.uid,dom:vx(t),components:[],behaviours:px(t),eventOrder:t.eventOrder}}}),yx={},wx={exports:yx};!function(t,e,r,o){!function(n,o){"object"==typeof e&&void 0!==r?r.exports=o():"function"==typeof t&&t.amd?t(o):(n="undefined"!=typeof globalThis?globalThis:n||self).EphoxContactWrapper=o()}(this,(function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},e={exports:{}};!function(e){!function(t){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void u(e.promise,t)}a(e.promise,r)}else(1===t._state?a:u)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){u(t,e)}var r,i}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(t){o(i,t)}),n)}e[i]=a,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(t)}(e);var r=e.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||r}}))}(void 0,yx,wx);var xx,Cx=wx.exports.boltExport,Sx=function(t){var e=B.none(),n=[],r=function(t){o()?a(t):n.push(t)},o=function(){return e.isSome()},i=function(t){W(t,a)},a=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=B.some(t),i(n),n=[])})),{get:r,map:function(t){return Sx((function(e){r((function(n){e(t(n))}))}))},isReady:o}},kx={nu:Sx,pure:function(t){return Sx((function(e){e(t)}))}},Tx=function(t){setTimeout((function(){throw t}),0)},Ox=function(t){var e=function(e){t().then(e,Tx)};return{map:function(e){return Ox((function(){return t().then(e)}))},bind:function(e){return Ox((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return Ox((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return kx.nu(e)},toCached:function(){var e=null;return Ox((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Ex=function(t){return Ox((function(){return new Cx(t)}))},_x=function(t){return Ox((function(){return Cx.resolve(t)}))},Rx=["input","textarea"],Nx=function(t){var e=Pt(t);return H(Rx,e)},Ax=function(t,e){var n=e.getRoot(t).getOr(t.element);Ha(n,e.invalidClass),e.notify.each((function(e){Nx(t.element)&&We(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){Ji(t,e.validHtml)})),e.onValid(t)}))},Dx=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);La(o,e.invalidClass),e.notify.each((function(e){Nx(t.element)&&We(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){Ji(t,r)})),e.onInvalid(t,r)}))},Mx=function(t,e,n){return e.validator.fold((function(){return _x(Wn.value(!0))}),(function(e){return e.validate(t)}))},Bx=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),Mx(t,e).map((function(n){return t.getSystem().isConnected()?n.fold((function(n){return Dx(t,e,0,n),Wn.error(n)}),(function(n){return Ax(t,e),Wn.value(n)})):Wn.error("No longer in system")}))},zx=Object.freeze({__proto__:null,markValid:Ax,markInvalid:Dx,query:Mx,run:Bx,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element);return Fa(n,e.invalidClass)}}),Px=Object.freeze({__proto__:null,events:function(t,e){return t.validator.map((function(e){return zi([Ii(e.onEvent,(function(e){Bx(e,t).get(b)}))].concat(e.validateOnLoad?[$i((function(e){Bx(e,t).get(h)}))]:[]))})).getOr({})}}),Lx=[Xr("invalidClass"),fo("getRoot",B.none),lo("notify",[fo("aria","alert"),fo("getContainer",B.none),fo("validHtml",""),_u("onValid"),_u("onInvalid"),_u("onValidate")]),lo("validator",[Xr("validate"),fo("onEvent","input"),fo("validateOnLoad",!0)])],Ix=Sc({fields:Lx,name:"invalidating",active:Px,apis:zx,extra:{validation:function(t){return function(e){var n=Of.getValue(e);return _x(t(n))}}}}),Hx=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),Fx=[Yr("others",Fr(Wn.value,Rr()))],Vx=Sc({fields:Fx,name:"coupling",apis:Hx,state:Object.freeze({__proto__:null,init:function(){var t={},e=v({});return xa({readState:e,getOrCreate:function(e,n,r){var o=lt(n.others);if(o)return yt(t,r).getOrThunk((function(){var o=yt(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})}),jx=v("sink"),Ux=v(od({name:jx(),overrides:v({dom:{tag:"div"},behaviours:xc([Ll.config({useFixed:k})]),events:zi([Ui(Go()),Ui(Fo()),Ui(Jo())])})}));!function(t){t[t.HighlightFirst=0]="HighlightFirst",t[t.HighlightNone=1]="HighlightNone"}(xx||(xx={}));var Wx,qx,$x,Gx=function(t,e){var n=t.getHotspot(e).getOr(e),r="hotspot",o=t.getAnchorOverrides();return t.layouts.fold((function(){return{type:r,hotspot:n,overrides:o}}),(function(t){return{type:r,hotspot:n,overrides:o,layouts:t}}))},Kx=function(t,e,n,r,o,i,a){return function(t,e,n,r,o,i,a){var u=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),c=Qx(r,t);return u.map((function(t){return t.bind((function(t){return B.from(Kh.sketch(O(O({},i.menu()),{uid:fa(""),data:t,highlightImmediately:a===xx.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Ll.position(r,e,{anchor:n}),af.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Ll.position(r,n,{anchor:{type:"submenu",item:e}}),af.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Ll.position(o,e,{anchor:n}),W(r,(function(t){Ll.position(o,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})}))},onEscape:function(){return dh.focus(r),af.close(o),B.some(!0)}})))}))}))}(t,e,Gx(t,n),n,r,o,a).map((function(t){return t.fold((function(){af.isOpen(r)&&af.close(r)}),(function(t){af.cloak(r),af.open(r,t),i(r)})),r}))},Xx=function(t,e,n,r,o,i,a){return af.close(r),_x(r)},Yx=function(t,e,n,r,o,i){var a=Vx.getCoupled(n,"sandbox");return(af.isOpen(a)?Xx:Kx)(t,e,n,a,r,o,i)},Jx=function(t,e,n){var r=zd.getCurrent(e).getOr(e),o=bn(t.element);n?Je(r.element,"min-width",o+"px"):function(t,e){vn.set(t,e)}(r.element,o)},Qx=function(t,e){return t.getSystem().getByUid(e.uid+"-"+jx()).map((function(t){return function(){return Wn.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return Wn.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},Zx=function(t){af.getState(t).each((function(t){Kh.repositionMenus(t)}))},tC=function(t,e,n){var r=du(),o=Qx(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:Af(t.sandboxBehaviours,[Of.config({store:{mode:"memory",initialValue:e}}),af.config({onOpen:function(o,i){var a=Gx(t,e);r.link(e.element),t.matchWidth&&Jx(a.hotspot,i,t.useMinWidth),t.onOpen(a,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return gu(n,r)||gu(e,r)},getAttachPoint:function(){return o().getOrDie()}}),zd.config({find:function(t){return af.getState(t).bind((function(t){return zd.getCurrent(t)}))}}),Ec.config({channels:O(O({},ff({isExtraPart:S})),mf({doReposition:Zx}))})])}},eC=function(t){var e=Vx.getCoupled(t,"sandbox");Zx(e)},nC=function(){return[fo("sandboxClasses",[]),Nf("sandboxBehaviours",[zd,Ec,af,Of])]},rC=v([Xr("dom"),Xr("fetch"),_u("onOpen"),Ru("onExecute"),fo("getHotspot",B.some),fo("getAnchorOverrides",v({})),Ts(),Ef("dropdownBehaviours",[kh,Vx,eh,dh]),Xr("toggleClass"),fo("eventOrder",{}),oo("lazySink"),fo("matchWidth",!1),fo("useMinWidth",!1),oo("role")].concat(nC())),oC=v([rd({schema:[Tu()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Ux()]),iC=Ad({name:"Dropdown",configFields:rC(),partFields:oC(),factory:function(t,e,n,r){var o,i,a=function(t){af.getState(t).each((function(t){Kh.highlightPrimary(t)}))},u={expand:function(e){kh.isOn(e)||Yx(t,b,e,r,h,xx.HighlightNone).get(h)},open:function(e){kh.isOn(e)||Yx(t,b,e,r,h,xx.HighlightFirst).get(h)},isOpen:kh.isOn,close:function(e){kh.isOn(e)&&Yx(t,b,e,r,h,xx.HighlightFirst).get(h)},repositionMenus:function(t){kh.isOn(t)&&eC(t)}},c=function(t,e){return Ai(t),B.some(!0)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.dropdownBehaviours,[kh.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),Vx.config({others:{sandbox:function(e){return tC(t,e,{onOpen:function(){return kh.on(e)},onClose:function(){return kh.off(e)}})}}}),eh.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,e){if(iC.isOpen(t)){var n=Vx.getCoupled(t,"sandbox");a(n)}else iC.open(t);return B.some(!0)},onEscape:function(t,e){return iC.isOpen(t)?(iC.close(t),B.some(!0)):B.none()}}),dh.config({})]),events:Oh(B.some((function(e){Yx(t,b,e,r,a,xx.HighlightFirst).get(h)}))),eventOrder:O(O({},t.eventOrder),(o={},o[ci()]=["disabling","toggling","alloy.base.behaviour"],o)),apis:u,domModification:{attributes:O(O({"aria-haspopup":"true"},t.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===t.dom.tag?{type:(i="type",yt(t.dom,"attributes").bind((function(t){return yt(t,i)}))).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),aC=Object.freeze({__proto__:null,events:function(){return zi([Pi(ei(),k)])},exhibit:function(){return Sa({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),uC=Sc({fields:[],name:"unselecting",active:aC}),cC=oa("color-input-change"),sC=oa("color-swatch-change"),lC=oa("color-picker-cancel"),fC=function(t,e,n){var r=Xw.parts.field({factory:bx,inputClasses:["tox-textfield"],onSetValue:function(t){return Ix.run(t).get(h)},inputBehaviours:xc([Xd.config({disabled:e.providers.isDisabled}),qb(),Qw.config({}),Ix.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return Oe(t.element)},notify:{onValid:function(t){var e=Of.getValue(t);Ni(t,cC,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=Of.getValue(t);if(0===e.length)return _x(Wn.value(!0));var n=Bt.fromTag("span");Je(n,"background-color",e);var r=nn(n,"background-color").fold((function(){return Wn.error("blah")}),(function(t){return Wn.value(e)}));return _x(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return rx(t,e.providers)})),i=function(t,e){Ni(t,sC,{value:e})},a=vp(function(t,e){return iC.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:xc([Gb(e.providers.isDisabled),qb(),uC.config({}),Qw.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return Ex((function(e){return t.fetch(e)})).map((function(r){return B.from(Rw(ur(sw(oa("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,hv.CLOSE_ON_EXECUTE,S,e.providers),{movement:fw(t.columns,t.presets)})))}))},parts:{menu:Mv(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[nc,ec,ac]},onLtr:function(){return[ec,nc,ac]}},components:[],fetch:ow(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){a.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return Ri(t,lC)}),(function(e){i(t,e),Zy(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))}},e));return Xw.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,a.asSpec()]}]),fieldBehaviours:xc([uh("form-field-events",[Ii(cC,(function(e,n){a.getOpt(e).each((function(t){Je(t.element,"background-color",n.event.color)})),Ni(e,ox,{name:t.name})})),Ii(sC,(function(t,e){Xw.getField(t).each((function(n){Of.setValue(n,e.event.value),zd.getCurrent(t).each(dh.focus)}))})),Ii(lC,(function(t,e){Xw.getField(t).each((function(e){zd.getCurrent(t).each(dh.focus)}))}))])])})},dC=od({schema:[Xr("dom")],name:"label"}),mC=function(t){return od({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:zi([Hi(Po(),(function(e,n,r){return t(e,r)}),[e]),Hi(Fo(),(function(e,n,r){return t(e,r)}),[e]),Hi(Vo(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},gC=mC("top-left"),hC=mC("top"),pC=mC("top-right"),vC=mC("right"),bC=mC("bottom-right"),yC=mC("bottom"),wC=mC("bottom-left"),xC=mC("left"),CC=nd({name:"thumb",defaults:v({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:zi([Vi(Po(),t,"spectrum"),Vi(Lo(),t,"spectrum"),Vi(Io(),t,"spectrum"),Vi(Fo(),t,"spectrum"),Vi(Vo(),t,"spectrum"),Vi(Uo(),t,"spectrum")])}}}),SC=nd({schema:[Gr("mouseIsDown",(function(){return xo(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:xc([eh.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),dh.config({})]),events:zi([Ii(Po(),n),Ii(Lo(),n),Ii(Fo(),n),Ii(Vo(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}}),kC=[dC,xC,vC,hC,yC,gC,pC,wC,bC,CC,SC],TC=v("slider.change.value"),OC=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?B.some(n.touches[0]).map((function(t){return mn(t.clientX,t.clientY)})):B.none()}var r=e;return void 0!==r.clientX?B.some(r).map((function(t){return mn(t.clientX,t.clientY)})):B.none()},EC=function(t){return t.model.minX},_C=function(t){return t.model.minY},RC=function(t){return t.model.minX-1},NC=function(t){return t.model.minY-1},AC=function(t){return t.model.maxX},DC=function(t){return t.model.maxY},MC=function(t){return t.model.maxX+1},BC=function(t){return t.model.maxY+1},zC=function(t,e,n){return e(t)-n(t)},PC=function(t){return zC(t,AC,EC)},LC=function(t){return zC(t,DC,_C)},IC=function(t){return PC(t)/2},HC=function(t){return LC(t)/2},FC=function(t){return t.stepSize},VC=function(t){return t.snapToGrid},jC=function(t){return t.snapStart},UC=function(t){return t.rounded},WC=function(t,e){return void 0!==t[e+"-edge"]},qC=function(t){return WC(t,"left")},$C=function(t){return WC(t,"right")},GC=function(t){return WC(t,"top")},KC=function(t){return WC(t,"bottom")},XC=function(t){return t.model.value.get()},YC=function(t){return{x:t}},JC=function(t){return{y:t}},QC=function(t,e){return{x:t,y:e}},ZC=function(t,e){Ni(t,TC(),{value:e})},tS=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},eS=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},nS=function(t,e,n){return Math.max(e,Math.min(n,t))},rS=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,a=t.snap,u=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,h=l?n+1:n;if(o<f)return g;if(o>d)return h;var p=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=nS(p/m*r+e,g,h);return a&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return nS(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),a=Math.floor((t-e)/r),u=Math.floor((n-e)/r),c=e+Math.min(u,a+i)*r;return Math.max(e,c)}))}(v,e,n,i,u):c?Math.round(v):v},oS=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,a=t.hasMaxEdge,u=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:s:o>n?a?u:l:(o-e)/r*c},iS="top",aS="right",uS="bottom",cS="left",sS=function(t){return t.element.dom.getBoundingClientRect()},lS=function(t,e){return t[e]},fS=function(t){var e=sS(t);return lS(e,cS)},dS=function(t){var e=sS(t);return lS(e,aS)},mS=function(t){var e=sS(t);return lS(e,iS)},gS=function(t){var e=sS(t);return lS(e,uS)},hS=function(t){var e=sS(t);return lS(e,"width")},pS=function(t){var e=sS(t);return lS(e,"height")},vS=function(t,e,n){return(t+e)/2-n},bS=function(t,e){var n=sS(t),r=sS(e),o=lS(n,cS),i=lS(n,aS),a=lS(r,cS);return vS(o,i,a)},yS=function(t,e){var n=sS(t),r=sS(e),o=lS(n,iS),i=lS(n,uS),a=lS(r,iS);return vS(o,i,a)},wS=function(t,e){Ni(t,TC(),{value:e})},xS=function(t){return{x:t}},CS=function(t,e,n){var r={min:EC(e),max:AC(e),range:PC(e),value:n,step:FC(e),snap:VC(e),snapStart:jC(e),rounded:UC(e),hasMinEdge:qC(e),hasMaxEdge:$C(e),minBound:fS(t),maxBound:dS(t),screenRange:hS(t)};return rS(r)},SS=function(t){return function(e,n){return function(t,e,n){var r=(t>0?eS:tS)(XC(n).x,EC(n),AC(n),FC(n));return wS(e,xS(r)),B.some(r)}(t,e,n).map(k)}},kS=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=hS(t),a=r.bind((function(e){return B.some(bS(e,t))})).getOr(0),u=o.bind((function(e){return B.some(bS(e,t))})).getOr(i),c={min:EC(e),max:AC(e),range:PC(e),value:n,hasMinEdge:qC(e),hasMaxEdge:$C(e),minBound:fS(t),minOffset:0,maxBound:dS(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return oS(c)}(e,i,n,r,o);return fS(e)-fS(t)+a},TS=SS(-1),OS=SS(1),ES=B.none,_S=B.none,RS={"top-left":B.none(),top:B.none(),"top-right":B.none(),right:B.some((function(t,e){ZC(t,YC(MC(e)))})),"bottom-right":B.none(),bottom:B.none(),"bottom-left":B.none(),left:B.some((function(t,e){ZC(t,YC(RC(e)))}))},NS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=CS(t,e,n),o=xS(r);return wS(t,o),r},setToMin:function(t,e){var n=EC(e);wS(t,xS(n))},setToMax:function(t,e){var n=AC(e);wS(t,xS(n))},findValueOfOffset:CS,getValueFromEvent:function(t){return OC(t).map((function(t){return t.left}))},findPositionOfValue:kS,setPositionFromValue:function(t,e,n,r){var o=XC(n),i=kS(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),a=bn(e.element)/2;Je(e.element,"left",i-a+"px")},onLeft:TS,onRight:OS,onUp:ES,onDown:_S,edgeActions:RS}),AS=function(t,e){Ni(t,TC(),{value:e})},DS=function(t){return{y:t}},MS=function(t,e,n){var r={min:_C(e),max:DC(e),range:LC(e),value:n,step:FC(e),snap:VC(e),snapStart:jC(e),rounded:UC(e),hasMinEdge:GC(e),hasMaxEdge:KC(e),minBound:mS(t),maxBound:gS(t),screenRange:pS(t)};return rS(r)},BS=function(t){return function(e,n){return function(t,e,n){var r=(t>0?eS:tS)(XC(n).y,_C(n),DC(n),FC(n));return AS(e,DS(r)),B.some(r)}(t,e,n).map(k)}},zS=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=pS(t),a=r.bind((function(e){return B.some(yS(e,t))})).getOr(0),u=o.bind((function(e){return B.some(yS(e,t))})).getOr(i),c={min:_C(e),max:DC(e),range:LC(e),value:n,hasMinEdge:GC(e),hasMaxEdge:KC(e),minBound:mS(t),minOffset:0,maxBound:gS(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return oS(c)}(e,i,n,r,o);return mS(e)-mS(t)+a},PS=B.none,LS=B.none,IS=BS(-1),HS=BS(1),FS={"top-left":B.none(),top:B.some((function(t,e){ZC(t,JC(NC(e)))})),"top-right":B.none(),right:B.none(),"bottom-right":B.none(),bottom:B.some((function(t,e){ZC(t,JC(BC(e)))})),"bottom-left":B.none(),left:B.none()},VS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=MS(t,e,n),o=DS(r);return AS(t,o),r},setToMin:function(t,e){var n=_C(e);AS(t,DS(n))},setToMax:function(t,e){var n=DC(e);AS(t,DS(n))},findValueOfOffset:MS,getValueFromEvent:function(t){return OC(t).map((function(t){return t.top}))},findPositionOfValue:zS,setPositionFromValue:function(t,e,n,r){var o=XC(n),i=zS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=ln(e.element)/2;Je(e.element,"top",i-a+"px")},onLeft:PS,onRight:LS,onUp:IS,onDown:HS,edgeActions:FS}),jS=function(t,e){Ni(t,TC(),{value:e})},US=function(t,e){return{x:t,y:e}},WS=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?eS:tS,i=e?XC(r).x:o(XC(r).x,EC(r),AC(r),FC(r)),a=e?o(XC(r).y,_C(r),DC(r),FC(r)):XC(r).y;return jS(n,US(i,a)),B.some(i)}(t,e,n,r).map(k)}},qS=WS(-1,!1),$S=WS(1,!1),GS=WS(-1,!0),KS=WS(1,!0),XS={"top-left":B.some((function(t,e){ZC(t,QC(RC(e),NC(e)))})),top:B.some((function(t,e){ZC(t,QC(IC(e),NC(e)))})),"top-right":B.some((function(t,e){ZC(t,QC(MC(e),NC(e)))})),right:B.some((function(t,e){ZC(t,QC(MC(e),HC(e)))})),"bottom-right":B.some((function(t,e){ZC(t,QC(MC(e),BC(e)))})),bottom:B.some((function(t,e){ZC(t,QC(IC(e),BC(e)))})),"bottom-left":B.some((function(t,e){ZC(t,QC(RC(e),BC(e)))})),left:B.some((function(t,e){ZC(t,QC(RC(e),HC(e)))}))},YS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=CS(t,e,n.left),o=MS(t,e,n.top),i=US(r,o);return jS(t,i),i},setToMin:function(t,e){var n=EC(e),r=_C(e);jS(t,US(n,r))},setToMax:function(t,e){var n=AC(e),r=DC(e);jS(t,US(n,r))},getValueFromEvent:function(t){return OC(t)},setPositionFromValue:function(t,e,n,r){var o=XC(n),i=kS(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),a=zS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=bn(e.element)/2,c=ln(e.element)/2;Je(e.element,"left",i-u+"px"),Je(e.element,"top",a-c+"px")},onLeft:qS,onRight:$S,onUp:GS,onDown:KS,edgeActions:XS}),JS=Ad({name:"Slider",configFields:[fo("stepSize",1),fo("onChange",h),fo("onChoose",h),fo("onInit",h),fo("onDragStart",h),fo("onDragEnd",h),fo("snapToGrid",!1),fo("rounded",!0),oo("snapStart"),Yr("model",qr("mode",{x:[fo("minX",0),fo("maxX",100),Gr("value",(function(t){return xo(t.mode.minX)})),Xr("getInitialValue"),Du("manager",NS)],y:[fo("minY",0),fo("maxY",100),Gr("value",(function(t){return xo(t.mode.minY)})),Xr("getInitialValue"),Du("manager",VS)],xy:[fo("minX",0),fo("maxX",100),fo("minY",0),fo("maxY",100),Gr("value",(function(t){return xo({x:t.mode.minX,y:t.mode.minY})})),Xr("getInitialValue"),Du("manager",YS)]})),Ef("sliderBehaviours",[eh,Of]),Gr("mouseIsDown",(function(){return xo(!1)}))],partFields:kC,factory:function(t,e,n,r){var o,i=function(e){return vd(e,t,"thumb")},a=function(e){return vd(e,t,"spectrum")},u=function(e){return pd(e,t,"left-edge")},c=function(e){return pd(e,t,"right-edge")},s=function(e){return pd(e,t,"top-edge")},l=function(e){return pd(e,t,"bottom-edge")},f=t.model,d=f.manager,m=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:u,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:a})},g=function(t,e){f.value.set(e);var n=i(t);m(t,n)},h=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&pd(e,t,"thumb").each((function(n){var r=f.value.get();t.onChoose(e,n,r)}))},p=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},v=function(e,n){n.stop(),t.onDragEnd(e,i(e)),h(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.sliderBehaviours,[eh.config({mode:"special",focusIn:function(e){return pd(e,t,"spectrum").map(eh.focusIn).map(k)}}),Of.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),Ec.config({channels:(o={},o[sf()]={onReceive:h},o)})]),events:zi([Ii(TC(),(function(e,n){!function(e,n){g(e,n);var r=i(e);t.onChange(e,r,n),B.some(!0)}(e,n.event.value)})),$i((function(e,n){var r=f.getInitialValue();f.value.set(r);var o=i(e);m(e,o);var u=a(e);t.onInit(e,o,u,f.value.get())})),Ii(Po(),p),Ii(Io(),v),Ii(Fo(),p),Ii(Uo(),v)]),apis:{resetToMin:function(e){d.setToMin(e,t)},resetToMax:function(e){d.setToMax(e,t)},setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(t,e,n){t.setValue(e,n)},resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),QS=oa("rgb-hex-update"),ZS=oa("slider-update"),tk=oa("palette-update"),ek="form",nk=[Ef("formBehaviours",[Of])],rk=function(t){return"<alloy.field."+t+">"},ok=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.formBehaviours,[Of.config({store:{mode:"manual",getValue:function(e){var n=yd(e,t);return mt(n,(function(t,e){return t().bind((function(t){var n,r,o=zd.getCurrent(t);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+ta(t.element)),n.fold((function(){return Wn.error(r)}),Wn.value)})).map(Of.getValue)}))},setValue:function(e,n){dt(n,(function(n,r){pd(e,t,r).each((function(t){zd.getCurrent(t).each((function(t){Of.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return pd(e,t,n).bind(zd.getCurrent)}}}},ik={getField:ya((function(t,e,n){return t.getField(e,n)})),sketch:function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),fd(ek,rk(e),n)},record:v(t)}}(),n=t(e),r=e.record(),o=U(r,(function(t){return nd({name:t,pname:rk(t)})}));return Od(ek,nk,o,ok,n)}},ak=oa("valid-input"),uk=oa("invalid-input"),ck=oa("validating-input"),sk="colorcustom.rgb.",lk=function(t,e,n,r){var o=function(n,r){return Ix.config({invalidClass:e("invalid"),notify:{onValidate:function(t){Ni(t,ck,{type:n})},onValid:function(t){Ni(t,ak,{type:n,value:Of.getValue(t)})},onInvalid:function(t){Ni(t,uk,{type:n,value:Of.getValue(t)})}},validator:{validate:function(e){var n=Of.getValue(e),o=r(n)?Wn.value(!0):Wn.error(t("aria.input.invalid"));return _x(o)},validateOnLoad:!1}})},i=function(n,r,i,a,u){var c=t("colorcustom.rgb.range"),s=[Xw.parts.label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":a}}}),Xw.parts.field({data:u,factory:bx,inputAttributes:O({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:xc([o(r,n),Qw.config({})]),onSetValue:function(t){Ix.isInvalid(t)&&Ix.run(t).get(h)}})],l="hex"!==r?[Xw.parts["aria-descriptor"]({text:c})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:s.concat(l)}},a=function(t,e){var n=e.red,r=e.green,o=e.blue;Of.setValue(t,{red:n,green:r,blue:o})},u=vp({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),c=function(t,e){u.getOpt(t).each((function(t){Je(t.element,"background-color","#"+e.value)}))};return Nd({factory:function(){var o={red:xo(B.some(255)),green:xo(B.some(255)),blue:xo(B.some(255)),hex:xo(B.some("ffffff"))},s=function(t){return o[t].get()},l=function(t,e){o[t].set(e)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",B.some(e)),l("green",B.some(n)),l("blue",B.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?l(n.type,B.none()):r(t)},m=function(t,e,n){var r=parseInt(n,10);l(e,B.some(r)),s("red").bind((function(t){return s("green").bind((function(e){return s("blue").map((function(n){return Dy(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=Oy(e);return ik.getField(t,"hex").each((function(e){dh.isFocused(e)||Of.setValue(t,{hex:n.value})})),n}(t,e);Ni(t,QS,{hex:n}),c(t,n)}))},g=function(t,e){var r=e.event;!function(t){return"hex"===t.type}(r)?m(t,r.type,r.value):function(t,e){n(t);var r=yy(e);l("hex",B.some(e));var o=zy(r);a(t,o),f(o),Ni(t,QS,{hex:r}),c(t,r)}(t,r.value)},h=function(e){return{label:t(sk+e+".label"),description:t(sk+e+".description")}},p=h("red"),v=h("green"),b=h("blue"),y=h("hex");return ur(ik.sketch((function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",Xw.sketch(i(My,"red",p.label,p.description,255))),n.field("green",Xw.sketch(i(My,"green",v.label,v.description,255))),n.field("blue",Xw.sketch(i(My,"blue",b.label,b.description,255))),n.field("hex",Xw.sketch(i(Cy,"hex",y.label,y.description,"ffffff"))),u.asSpec()],formBehaviours:xc([Ix.config({invalidClass:e("form-invalid")}),uh("rgb-form-events",[Ii(ak,g),Ii(uk,d),Ii(ck,d)])])}})),{apis:{updateHex:function(t,e){Of.setValue(t,{hex:e.value}),function(t,e){var n=zy(e);a(t,n),f(n)}(t,e),c(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},fk=function(t,e){var n=JS.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=JS.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),o=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var a=o.createLinearGradient(0,0,0,r);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=a,o.fillRect(0,0,n,r)}};return Nd({factory:function(t){var i=v({x:0,y:0}),a=xc([zd.config({find:B.some}),dh.config({})]);return JS.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:function(t,e,n){Ni(t,tk,{value:n})},onInit:function(t,e,n,r){o(n.element.dom,Iy(Hy))},sliderBehaviours:a})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom,r=Vy(e,100,100),i=By(r);o(n,Iy(i))}(e,n)},setThumb:function(t,e,n){!function(t,e){var n=jy(zy(e));JS.setValue(t,{x:n.saturation,y:100-n.value})}(e,n)}},extraApis:{}})},dk=function(t,e){return Nd({name:"ColourPicker",configFields:[Xr("dom"),fo("onValidHex",h),fo("onInvalidHex",h)],factory:function(n){var r,o=lk(t,e,n.onValidHex,n.onInvalidHex),i=fk(0,e),a=function(t){return 100-t/360*100},u={paletteRgba:xo(Hy),paletteHue:xo(0)},c=vp(function(t,e){var n=JS.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=JS.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return JS.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:v({y:0})},components:[n,r],sliderBehaviours:xc([dh.config({})]),onChange:function(t,e,n){Ni(t,ZS,{value:n})}})}(0,e)),s=vp(i.sketch({})),l=vp(o.sketch({})),f=function(t,e,n){s.getOpt(t).each((function(t){i.setHue(t,n)}))},d=function(t,e){l.getOpt(t).each((function(t){o.updateHex(t,e)}))},m=function(t,e,n){c.getOpt(t).each((function(t){JS.setValue(t,{y:a(n)})}))},g=function(t,e){s.getOpt(t).each((function(t){i.setThumb(t,e)}))},h=function(t,e,n,r){!function(t,e){var n=zy(t);u.paletteRgba.set(n),u.paletteHue.set(e)}(e,n),W(r,(function(r){r(t,e,n)}))};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),c.asSpec(),l.asSpec()],behaviours:xc([uh("colour-picker-events",[Ii(QS,(r=[f,m,g],function(t,e){var n=e.event.hex,o=function(t){return jy(zy(t))}(n);h(t,n,o.hue,r)})),Ii(tk,function(){var t=[d];return function(e,n){var r=n.event.value,o=u.paletteHue.get(),i=Vy(o,r.x,100-r.y),a=Uy(i);h(e,a,o,t)}}()),Ii(ZS,function(){var t=[f,d];return function(e,n){var r=function(t){return(100-t)/100*360}(n.event.value.y),o=u.paletteRgba.get(),i=jy(o),a=Vy(r,i.saturation,i.value),c=Uy(a);h(e,c,r,t)}}())]),zd.config({find:function(t){return l.getOpt(t)}}),eh.config({mode:"acyclic"})])}}})},mk=function(){return zd.config({find:B.some})},gk=function(t){return zd.config({find:t.getOpt})},hk=function(t){return zd.config({find:function(e){return Re(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},pk={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},vk=function(t){return function(t){return pk[t]}(t)},bk=tinymce.util.Tools.resolve("tinymce.Resource"),yk=tinymce.util.Tools.resolve("tinymce.util.Tools"),wk=kr([fo("preprocess",b),fo("postprocess",b)]),xk=function(t,e,n){return Of.config(ur({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},Ck=function(t,e,n){return xk(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},Sk=function(t,e){var n=Ur("RepresentingConfigs.memento processors",wk,e);return Of.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=Of.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);Of.setValue(i,o)}}})},kk=xk,Tk=function(t){return Ck(t,Yi,Ji)},Ok=function(t){return Of.config({store:{mode:"memory",initialValue:t}})},Ek=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){W(t,(function(t){t(e,n)}))}},o=function(t,e){if(!Xd.isDisabled(t)){var n=e.event.raw;a(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;a(t,n.files)},a=function(n,r){Of.setValue(n,function(t,e){var n=yk.explode(e.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return $(ct(t),(function(t){return F(n,(function(e){return Rt(t.name.toLowerCase(),"."+e.toLowerCase())}))}))}(r,e)),Ni(n,ox,{name:t.name})},u=vp({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:xc([uh("input-file-events",[Ui(Jo()),Ui(li())])])}),c=t.label.map((function(t){return rx(t,e)})),s=Xw.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:xc([Ok([]),mk(),Xd.config({}),kh.config({toggleClass:"dragenter",toggleOnExecute:!1}),uh("dropzone-events",[Ii("dragenter",r([n,kh.toggle])),Ii("dragleave",r([n,kh.toggle])),Ii("dragover",n),Ii("drop",r([n,o])),Ii(Yo(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},pp.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[u.asSpec()],action:function(t){u.get(t).element.dom.click()},buttonBehaviours:xc([Qw.config({}),Gb(e.isDisabled),qb()])})]}]}}}});return tx(c,s,["tox-form__group--stretched"],[])},_k=oa("alloy-fake-before-tabstop"),Rk=oa("alloy-fake-after-tabstop"),Nk=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:xc([dh.config({ignore:!0}),Qw.config({})])}},Ak=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[Nk([_k]),t,Nk([Rk])],behaviours:xc([hk(1)])}},Dk=function(t,e){Ni(t,Go(),{raw:{which:9,shiftKey:e}})},Mk=function(t,e){var n=e.element;Fa(n,_k)?Dk(t,!0):Fa(n,Rk)&&Dk(t,!1)},Bk=function(t){return Aw(t,["."+_k,"."+Rk].join(","),S)},zk=!(pe().browser.isIE()||pe().browser.isEdge()),Pk=function(t,e){var n=zk&&t.sandboxed,r=O(O({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=xo("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)We(n.element,"srcdoc",r);else{We(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map((function(t){return rx(t,e)})),a=Xw.parts.field({factory:{sketch:function(t){return Ak({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:xc([Qw.config({}),dh.config({}),kk(B.none(),o.getValue,o.setValue)])})}}});return tx(i,a,["tox-form__group--stretched"],[])},Lk=function(t,e){return Fk(document.createElement("canvas"),t,e)},Ik=function(t){var e=Lk(t.width,t.height);return Hk(e).drawImage(t,0,0),e},Hk=function(t){return t.getContext("2d")},Fk=function(t,e,n){return t.width=e,t.height=n,t},Vk=function(t){return t.naturalWidth||t.width},jk=function(t){return t.naturalHeight||t.height},Uk=function(t){return new Cx((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return B.none();for(var r=n[1],o=e[1],i=1024,a=atob(o),u=a.length,c=Math.ceil(u/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,d=Math.min(f+i,u),m=new Array(d-f),g=f,h=0;g<d;++h,++g)m[h]=a[g].charCodeAt(0);s[l]=new Uint8Array(m)}return B.some(new Blob(s,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))},Wk=function(t,e,n){return e=e||"image/png",d(HTMLCanvasElement.prototype.toBlob)?new Cx((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):Uk(t.toDataURL(e,n))},qk=function(t){return function(t){return new Cx((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",a),o.removeEventListener("error",u)},a=function(){i(),e(o)},u=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",a),o.addEventListener("error",u),o.src=r,o.complete&&setTimeout(a,0)}))}(t).then((function(t){$k(t);var e=Lk(Vk(t),jk(t));return Hk(e).drawImage(t,0,0),e}))},$k=function(t){URL.revokeObjectURL(t.src)},Gk=function(t,e,n){var r=e.type,o=v(r),i=v(n),a=function(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))};return{getType:o,toBlob:function(){return Cx.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return Wk(t,e,n)}))},toAdjustedDataURL:a,toAdjustedBase64:function(t,e){return a(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(Ik)}}},Kk=function(t){return function(t){return new Cx((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return Gk(qk(t),t,e)}))},Xk=function(t,e){return Wk(t,e).then((function(e){return Gk(Cx.resolve(t),e,t.toDataURL())}))},Yk=function(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r},Jk=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10],Qk=function(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var a=0;a<5;a++)r[a]=e[a+5*i];for(a=0;a<5;a++){n=0;for(var u=0;u<5;u++)n+=t[a+5*u]*r[u];o[a+5*i]=n}}return o},Zk=function(t,e){return t.toCanvas().then((function(n){return tT(n,t.getType(),e)}))},tT=function(t,e,n){var r=Hk(t),o=function(t,e){for(var n,r,o,i,a=t.data,u=e[0],c=e[1],s=e[2],l=e[3],f=e[4],d=e[5],m=e[6],g=e[7],h=e[8],p=e[9],v=e[10],b=e[11],y=e[12],w=e[13],x=e[14],C=e[15],S=e[16],k=e[17],T=e[18],O=e[19],E=0;E<a.length;E+=4)n=a[E],r=a[E+1],o=a[E+2],i=a[E+3],a[E]=n*u+r*c+o*s+i*l+f,a[E+1]=n*d+r*m+o*g+i*h+p,a[E+2]=n*v+r*b+o*y+i*w+x,a[E+3]=n*C+r*S+o*k+i*T+O;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),Xk(t,e)},eT=function(t,e,n){var r=Hk(t),o=r.getImageData(0,0,t.width,t.height),i=r.getImageData(0,0,t.width,t.height);return i=function(t,e,n){for(var r=function(t,e,n){return t>n?t=n:t<e&&(t=e),t},o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),a=t.data,u=e.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,h=0;h<o;h++)for(var p=0;p<o;p++){var v=r(f+p-i,0,c-1),b=4*(r(l+h-i,0,s-1)*c+v),y=n[h*o+p];d+=a[b]*y,m+=a[b+1]*y,g+=a[b+2]*y}var w=4*(l*c+f);u[w]=r(d,0,255),u[w+1]=r(m,0,255),u[w+2]=r(g,0,255)}return e}(o,i,n),r.putImageData(i,0,0),Xk(t,e)},nT=function(t){return function(e,n){return Zk(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}},rT=function(t){return function(e){return Zk(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),oT=nT((function(t,e){return e=Yk(255*e,-255,255),Qk(t,[1,0,0,0,e,0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])})),iT=nT((function(t,e){var n;return e=Yk(e,-1,1),n=(e*=100)<0?127+e/100*127:127*(n=0===(n=e%1)?Jk[e]:Jk[Math.floor(e)]*(1-n)+Jk[Math.floor(e)+1]*n)+127,Qk(t,[n/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),aT=function(t,e,n,r){return Zk(t,function(t,e,n,r){return e=Yk(e,0,2),n=Yk(n,0,2),r=Yk(r,0,2),Qk(t,[e,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0,0,0,0,0,1])}([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],e,n,r))},uT=(Wx=[0,-1,0,-1,5,-1,0,-1,0],function(t){return function(t,e){return t.toCanvas().then((function(n){return eT(n,t.getType(),e)}))}(t,Wx)}),cT=(qx=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){for(var r=Hk(t),o=new Array(256),i=0;i<o.length;i++)o[i]=qx(i,n);var a=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(a,0,0),Xk(t,e)}(n,t.getType(),e)}))}),sT=function(t,e,n){var r=Vk(t),o=jk(t),i=e/r,a=n/o,u=!1;(i<.5||i>2)&&(i=i<.5?.5:2,u=!0),(a<.5||a>2)&&(a=a<.5?.5:2,u=!0);var c=lT(t,i,a);return u?c.then((function(t){return sT(t,e,n)})):c},lT=function(t,e,n){return new Cx((function(r){var o=Vk(t),i=jk(t),a=Math.floor(o*e),u=Math.floor(i*n),c=Lk(a,u);Hk(c).drawImage(t,0,0,o,i,0,0,a,u),r(c)}))},fT=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},dT=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,a=Math.sin(r),u=Math.cos(r),c=fT(Math.abs(o*u)+Math.abs(i*a)),s=fT(Math.abs(o*a)+Math.abs(i*u)),l=Lk(c,s),f=Hk(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),Xk(l,e)},mT=function(t,e,n){var r=Lk(t.width,t.height),o=Hk(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),Xk(r,e)},gT=function(t,e,n,r,o,i){var a=Lk(o,i);return Hk(a).drawImage(t,-n,-r),Xk(a,e)},hT=function(t){return rT(t)},pT=function(t){return uT(t)},vT=function(t,e){return cT(t,e)},bT=function(t,e){return oT(t,e)},yT=function(t,e){return iT(t,e)},wT=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return mT(n,t.getType(),e)}))}(t,e)},xT=function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then((function(i){return gT(i,t.getType(),e,n,r,o)}))}(t,e,n,r,o)},CT=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return sT(r,e,n).then((function(e){return Xk(e,t.getType())}))}))}(t,e,n)},ST=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return dT(n,t.getType(),e)}))}(t,e)},kT=function(t,e,n){return Ep(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)},TT=function(t,e){return kT(t,e,[])},OT=function(t,e){return kT(t,e,[ah.config({})])},ET=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:xc([ah.config({})])}},_T=oa("toolbar.button.execute"),RT=(($x={})[ci()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],$x),NT=oa("update-menu-text"),AT=oa("update-menu-icon"),DT=function(t,e,n){var r=xo(h),o=t.text.map((function(t){return vp(ET(t,e,n.providers))})),i=t.icon.map((function(t){return vp(OT(t,n.providers.icons))})),a=function(t,e){var n=Of.getValue(t);return dh.focus(n),Ni(n,"keydown",{raw:e.event.raw}),iC.close(n),B.some(!0)},u=t.role.fold((function(){return{}}),(function(t){return{role:t}})),c=t.tooltip.fold((function(){return{}}),(function(t){var e=n.providers.translate(t);return{title:e,"aria-label":e}})),s=Ep("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},n.providers.icons);return vp(iC.sketch(O(O(O({},t.uid?{uid:t.uid}:{}),u),{dom:{tag:"button",classes:[e,e+"--select"].concat(U(t.classes,(function(t){return e+"--"+t}))),attributes:O({},c)},components:ey([i.map((function(t){return t.asSpec()})),o.map((function(t){return t.asSpec()})),B.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:xc(_(_([],t.dropdownBehaviours,!0),[Gb((function(){return t.disabled||n.providers.isDisabled()})),qb(),uC.config({}),ah.config({}),uh("dropdown-events",[Jb(t,r),Qb(t,r)]),uh("menubutton-update-display-text",[Ii(NT,(function(t,e){o.bind((function(e){return e.getOpt(t)})).each((function(t){ah.set(t,[Qa(n.providers.translate(e.event.text))])}))})),Ii(AT,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){ah.set(t,[OT(e.event.icon,n.providers.icons)])}))}))])],!1)),eventOrder:ur(RT,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:xc([eh.config({mode:"special",onLeft:a,onRight:a})]),lazySink:n.getSink,toggleClass:e+"--active",parts:{menu:Mv(0,t.columns,t.presets)},fetch:function(e){return Ex(w(t.fetch,e))}}))).asSpec()},MT=function(t){return"separator"===t.type},BT={type:"separator"},zT=function(t,e){var n=K(t,(function(t,n){return function(t){return o(t)}(n)?""===n?t:"|"===n?t.length>0&&!MT(t[t.length-1])?t.concat([BT]):t:wt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&MT(n[n.length-1])&&n.pop(),n},PT=function(t,e){return function(t){return wt(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=LT(n,e);return{item:t,menus:ur(r.menus,To(t.value,r.items)),expansions:ur(r.expansions,To(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}},LT=function(t,e){var n=zT(o(t)?t.split(" "):t,e);return G(n,(function(t,n){var r=function(t){if(MT(t))return t;var e=yt(t,"value").getOrThunk((function(){return oa("generated-menu-item")}));return ur({value:e},t)}(n),o=PT(r,e);return{menus:ur(t.menus,o.menus),items:[o.item].concat(t.items),expansions:ur(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},IT=function(t,e,n,r){var o=oa("primary-menu"),i=LT(t,n.shared.providers.menuItems());if(0===i.items.length)return B.none();var a=_w(o,i.items,e,n,r),u=mt(i.menus,(function(t,r){return _w(r,t,e,n,!1)})),c=ur(u,To(o,a));return B.from(Kh.tieredData(o,c,i.expansions))},HT=function(t){return{isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)},setActive:function(e){var n=t.element;e?(La(n,"tox-tbtn--enabled"),We(n,"aria-pressed",!0)):(Ha(n,"tox-tbtn--enabled"),Ke(n,"aria-pressed"))},isActive:function(){return Fa(t.element,"tox-tbtn--enabled")}}},FT=function(t,e,n,r){return DT({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(IT(t,hv.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:HT,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Qw.config({})]},e,n.shared)},VT=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){Nc(e.element),Ni(e,ux,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(U(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return O(O({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},jT=function(t,e,n,r,o,i){void 0===n&&(n=[]);var a=e.fold((function(){return{}}),(function(t){return{action:t}})),u=O({buttonBehaviours:xc([Gb((function(){return t.disabled||i.isDisabled()})),qb(),Qw.config({}),uh("button press",[Li("click"),Li("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},a),c=ur(u,{dom:r});return ur(c,{components:o})},UT=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({})},i=t.icon.map((function(t){return TT(t,n.icons)})),a=ey([i]);return jT(t,e,r,o,a,n)},WT=function(t,e,n,r){void 0===r&&(r=[]);var o=UT(t,B.some(e),n,r);return pp.sketch(o)},qT=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),a=t.icon?t.icon.map((function(t){return TT(t,n.icons)})):B.none(),u=a.isSome()?ey([a]):[],c=a.isSome()?{}:{innerHtml:i},s=_(_(_(_([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),a.isSome()?["tox-button--icon"]:[],!0),t.borderless?["tox-button--naked"]:[],!0),o,!0),l=O(O({tag:"button",classes:s},c),{attributes:{title:i}});return jT(t,e,r,l,u,n)},$T=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=qT(t,B.some(e),n,r,o);return pp.sketch(i)},GT=function(t,e){return function(n){"custom"===e?Ni(n,ux,{name:t,value:{}}):"submit"===e?Ri(n,cx):"cancel"===e?Ri(n,ax):console.error("Unknown button type: ",e)}},KT=function(t,e,n){if(function(t,e){return"menu"===e}(0,e)){var r=t,o=O(O({},t),{onSetup:function(e){return e.setDisabled(t.disabled),h},fetch:VT(r.items,(function(){return i}),n)}),i=vp(FT(o,"tox-tbtn",n,B.none()));return i.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,e)){var a=GT(t.name,e),u=O(O({},t),{borderless:!1});return $T(u,a,n.shared.providers,[])}console.error("Unknown footer button type: ",e)},XT=function(t,e){var n,r,o=GT(t.name,"custom");return n=B.none(),r=Xw.parts.field(O({factory:pp},qT(t,B.some(o),e,[Ok(""),mk()]))),tx(n,r,[],[])},YT=v([fo("field1Name","field1"),fo("field2Name","field2"),Nu("onLockedChange"),Ou(["lockClass"]),fo("locked",!1),Nf("coupledFieldBehaviours",[zd,Of])]),JT=function(t,e){return nd({factory:Xw,name:t,overrides:function(t){return{fieldBehaviours:xc([uh("coupled-input-behaviour",[Ii(Xo(),(function(n){(function(t,e,n){return pd(t,e,n).bind(zd.getCurrent)})(n,t,e).each((function(e){pd(n,t,"lock").each((function(r){kh.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},QT=v([JT("field1","field2"),JT("field2","field1"),nd({factory:pp,schema:[Xr("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:xc([kh.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),ZT=Ad({name:"FormCoupledInputs",configFields:YT(),partFields:QT(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Af(t.coupledFieldBehaviours,[zd.config({find:B.some}),Of.config({store:{mode:"manual",getValue:function(e){var n,r=xd(e,t,["field1","field2"]);return(n={})[t.field1Name]=Of.getValue(r.field1()),n[t.field2Name]=Of.getValue(r.field2()),n},setValue:function(e,n){var r=xd(e,t,["field1","field2"]);xt(n,t.field1Name)&&Of.setValue(r.field1(),n[t.field1Name]),xt(n,t.field2Name)&&Of.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return pd(e,t,"field1")},getField2:function(e){return pd(e,t,"field2")},getLock:function(e){return pd(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),tO=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return Wn.value({value:n,unit:r})}return Wn.error(t)},eO=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return wt(n,t)};return t.unit===e?B.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?B.some(t.value):B.some(t.value/n[t.unit]*n[e]):B.none()},nO=function(t){return B.none()},rO=function(t,e){var n=tO(t).toOptional(),r=tO(e).toOptional();return kt(n,r,(function(t,e){return eO(t,e.unit).map((function(t){return e.value/t})).map((function(t){return function(t,e){return function(n){return eO(n,e).map((function(n){return{value:n*t,unit:e}}))}}(t,e.unit)})).getOr(nO)})).getOr(nO)},oO=function(t,e){var n=nO,r=oa("ratio-event"),o=function(t){return Ep(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)},i=ZT.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[o("lock"),o("unlock")],buttonBehaviours:xc([Xd.config({disabled:function(){return t.disabled||e.isDisabled()}}),qb(),Qw.config({})])}),a=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},u=function(n){return Xw.parts.field({factory:bx,inputClasses:["tox-textfield"],inputBehaviours:xc([Xd.config({disabled:function(){return t.disabled||e.isDisabled()}}),qb(),Qw.config({}),uh("size-input-events",[Ii(qo(),(function(t,e){Ni(t,r,{isField1:n})})),Ii(Yo(),(function(e,n){Ni(e,ox,{name:t.name})}))])]),selectOnFocus:!1})},c=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=ZT.parts.field1(a([Xw.parts.label(c("Width")),u(!0)])),l=ZT.parts.field2(a([Xw.parts.label(c("Height")),u(!1)]));return ZT.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,l,a([c("&nbsp;"),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){tO(Of.getValue(t)).each((function(t){n(t).each((function(t){Of.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))}))}))},coupledFieldBehaviours:xc([Xd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){ZT.getField1(t).bind(Xw.getField).each(Xd.disable),ZT.getField2(t).bind(Xw.getField).each(Xd.disable),ZT.getLock(t).each(Xd.disable)},onEnabled:function(t){ZT.getField1(t).bind(Xw.getField).each(Xd.enable),ZT.getField2(t).bind(Xw.getField).each(Xd.enable),ZT.getLock(t).each(Xd.enable)}}),qb(),uh("size-input-events2",[Ii(r,(function(t,e){var r=e.event.isField1,o=r?ZT.getField1(t):ZT.getField2(t),i=r?ZT.getField2(t):ZT.getField1(t),a=o.map(Of.getValue).getOr(""),u=i.map(Of.getValue).getOr("");n=rO(a,u)}))])])})},iO={undo:v(oa("undo")),redo:v(oa("redo")),zoom:v(oa("zoom")),back:v(oa("back")),apply:v(oa("apply")),swap:v(oa("swap")),transform:v(oa("transform")),tempTransform:v(oa("temp-transform")),transformApply:v(oa("transform-apply"))},aO=v("save-state"),uO=v("disable"),cO=v("enable"),sO={formActionEvent:ux,saveState:aO,disable:uO,enable:cO},lO=function(t,e){var n=function(t,n,r,o){return vp($T({name:t,text:t,disabled:r,primary:o,icon:B.none(),borderless:!1},n,e))},r=function(t,n,r,o){return vp(WT({name:t,icon:B.some(t),tooltip:B.some(n),disabled:o,primary:!1,borderless:!1},r,e))},o=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Xd)&&Xd.disable(n)}))},i=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Xd)&&Xd.enable(n)}))},a={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},u=h,c=function(t,e,n){Ni(t,e,n)},s=function(t){return Ri(t,sO.disable())},l=function(t){return Ri(t,sO.enable())},f=function(t,e){s(t),c(t,iO.transform(),{transform:e}),l(t)},d=function(t){return function(){tt.getOpt(t).each((function(t){ah.set(t,[Q])}))}},m=function(t,e){s(t),c(t,iO.transformApply(),{transform:e,swap:d(t)}),l(t)},g=function(){return n("Back",(function(t){return c(t,iO.back(),{swap:d(t)})}),!1,!1)},p=function(){return vp({dom:{tag:"div",classes:["tox-spacer"]},behaviours:xc([Xd.config({})])})},b=function(){return n("Apply",(function(t){return c(t,iO.apply(),{swap:d(t)})}),!0,!0)},y=[g(),p(),n("Apply",(function(e){m(e,(function(e){var n=t.getRect();return xT(e,n.x,n.y,n.w,n.h)})),t.hideCrop()}),!1,!0)],w=qw.sketch({dom:a,components:y.map((function(t){return t.asSpec()})),containerBehaviours:xc([uh("image-tools-crop-buttons-events",[Ii(sO.disable(),(function(t,e){o(y,t)})),Ii(sO.enable(),(function(t,e){i(y,t)}))])])}),x=vp(oO({name:"size",label:B.none(),constrain:!0,disabled:!1},e)),C=[g(),p(),x,p(),n("Apply",(function(t){x.getOpt(t).each((function(e){var n=Of.getValue(e),r=function(t,e){return function(n){return CT(n,t,e)}}(parseInt(n.width,10),parseInt(n.height,10));m(t,r)}))}),!1,!0)],S=qw.sketch({dom:a,components:C.map((function(t){return t.asSpec()})),containerBehaviours:xc([uh("image-tools-resize-buttons-events",[Ii(sO.disable(),(function(t,e){o(C,t)})),Ii(sO.enable(),(function(t,e){i(C,t)}))])])}),k=function(t,e){return function(n){return t(n,e)}},T=k(wT,"h"),O=k(wT,"v"),E=k(ST,-90),_=k(ST,90),R=function(t,e){!function(t,e){s(t),c(t,iO.tempTransform(),{transform:e}),l(t)}(t,e)},N=[g(),p(),r("flip-horizontally","Flip horizontally",(function(t){R(t,T)}),!1),r("flip-vertically","Flip vertically",(function(t){R(t,O)}),!1),r("rotate-left","Rotate counterclockwise",(function(t){R(t,E)}),!1),r("rotate-right","Rotate clockwise",(function(t){R(t,_)}),!1),p(),b()],A=qw.sketch({dom:a,components:N.map((function(t){return t.asSpec()})),containerBehaviours:xc([uh("image-tools-fliprotate-buttons-events",[Ii(sO.disable(),(function(t,e){o(N,t)})),Ii(sO.enable(),(function(t,e){i(N,t)}))])])}),D=function(t,n,r,o,i){var a=JS.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),u=JS.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=JS.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return vp(JS.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:v({x:o})},components:[a,u,c],sliderBehaviours:xc([dh.config({})]),onChoose:n}))},M=function(t,e,n,r,o){return D(t,(function(t,n,r){var o=k(e,r.x/100);f(t,o)}),n,r,o)},z=function(t,e,n,r,u){var c=function(t,e,n,r,o){return[g(),M(t,e,n,r,o),b()]}(t,e,n,r,u);return qw.sketch({dom:a,components:c.map((function(t){return t.asSpec()})),containerBehaviours:xc([uh("image-tools-filter-panel-buttons-events",[Ii(sO.disable(),(function(t,e){o(c,t)})),Ii(sO.enable(),(function(t,e){i(c,t)}))])])})},P=[g(),p(),b()],L=qw.sketch({dom:a,components:P.map((function(t){return t.asSpec()}))}),I=z("Brightness",bT,-100,0,100),H=z("Contrast",yT,-100,0,100),F=z("Gamma",vT,-100,0,100),V=function(t,e,n){return function(r){return function(t,e,n,r){return aT(t,e,n,r)}(r,t,e,n)}},j=function(t){return D(t,(function(t,e,n){var r=U.getOpt(t),o=q.getOpt(t),i=W.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=Of.getValue(e).x/100,i=Of.getValue(r).x/100,a=Of.getValue(n).x/100,u=V(o,i,a);f(t,u)}))}))}))}),0,100,200)},U=j("R"),W=j("G"),q=j("B"),$=[g(),U,W,q,b()],G=qw.sketch({dom:a,components:$.map((function(t){return t.asSpec()}))}),K=function(t,e,n){return function(r){c(r,iO.swap(),{transform:e,swap:function(){tt.getOpt(r).each((function(e){ah.set(e,[t]),n(e)}))}})}},X=B.some(pT),Y=B.some(hT),J=[r("crop","Crop",K(w,B.none(),(function(e){t.showCrop()})),!1),r("resize","Resize",K(S,B.none(),(function(e){x.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;Of.setValue(e,{width:r,height:o})}))})),!1),r("orientation","Orientation",K(A,B.none(),u),!1),r("brightness","Brightness",K(I,B.none(),u),!1),r("sharpen","Sharpen",K(L,X,u),!1),r("contrast","Contrast",K(H,B.none(),u),!1),r("color-levels","Color levels",K(G,B.none(),u),!1),r("gamma","Gamma",K(F,B.none(),u),!1),r("invert","Invert",K(L,Y,u),!1)],Q=qw.sketch({dom:a,components:J.map((function(t){return t.asSpec()}))}),Z=qw.sketch({dom:{tag:"div"},components:[Q],containerBehaviours:xc([ah.config({})])}),tt=vp(Z);return{memContainer:tt,getApplyButton:function(t){return tt.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))}}},fO=tinymce.util.Tools.resolve("tinymce.geom.Rect"),dO=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),mO=tinymce.util.Tools.resolve("tinymce.util.Observable"),gO=tinymce.util.Tools.resolve("tinymce.util.VK"),hO=function(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]};function pO(t,e){var n,r,o,i,a=e.document||document,u=a.getElementById(e.handle||t),c=function(t){if(hO(t),t.button!==r)return s(t);t.deltaX=t.screenX-o,t.deltaY=t.screenY-i,t.preventDefault(),e.drag(t)},s=function(t){hO(t),dO(a).off("mousemove touchmove",c).off("mouseup touchend",s),n.remove(),e.stop&&e.stop(t)};return dO(u).on("mousedown touchstart",(function(t){var l,f=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),a=e(n.offsetWidth,r.offsetWidth),u=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight);return{width:o<a?i:o,height:u<e(n.offsetHeight,r.offsetHeight)?c:u}}(a);hO(t),t.preventDefault(),r=t.button;var d=u;o=t.screenX,i=t.screenY,l=window.getComputedStyle?window.getComputedStyle(d,null).getPropertyValue("cursor"):d.runtimeStyle.cursor,n=dO("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(a.body),dO(a).on("mousemove touchmove",c).on("mouseup touchend",s),e.start(t)})),{destroy:function(){dO(u).off()}}}var vO=0,bO=function(t,e,n,r,o){var i,a="tox-crid-"+vO++,u=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],c=["top","right","bottom","left"],s=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}},l=function(e,r,o,i){var a,u,c,l,f;a=r.x,u=r.y,c=r.w,l=r.h,a+=o*e.deltaX,u+=i*e.deltaY,(c+=o*e.deltaW)<20&&(c=20),(l+=i*e.deltaH)<20&&(l=20),f=t=fO.clamp({x:a,y:u,w:c,h:l},n,"move"===e.name),f=s(n,f),g.fire("updateRect",{rect:f}),m(f)},f=function(t){var n=function(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),dO("#"+a+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})};yk.each(u,(function(e){dO("#"+a+"-"+e.name,r).css({left:t.w*e.xMul+t.x,top:t.h*e.yMul+t.y})})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)},d=function(e){f(t=e)},m=function(t){var e,r;d((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))};dO('<div id="'+a+'" class="tox-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),yk.each(c,(function(t){dO("#"+a,r).append('<div id="'+a+"-"+t+'"class="tox-croprect-block" style="display: none" data-mce-bogus="all">')})),yk.each(u,(function(t){dO("#"+a,r).append('<div id="'+a+"-"+t.name+'" class="tox-croprect-handle tox-croprect-handle-'+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')})),i=yk.map(u,(function(e){var n;return pO(a,{document:r.ownerDocument,handle:a+"-"+e.name,start:function(){n=t},drag:function(t){l(e,n,t.deltaX,t.deltaY)}})})),f(t),dO(r).on("focusin focusout",(function(t){dO(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")})),dO(r).on("keydown",(function(e){var n;yk.each(u,(function(t){if(e.target.id===a+"-"+t.name)return n=t,!1}));var r=function(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),l(n,r,o,i)};switch(e.keyCode){case gO.LEFT:r(e,0,t,-10,0);break;case gO.RIGHT:r(e,0,t,10,0);break;case gO.UP:r(e,0,t,0,-10);break;case gO.DOWN:r(e,0,t,0,10);break;case gO.ENTER:case gO.SPACEBAR:e.preventDefault(),o()}}));var g=yk.extend({toggleVisibility:function(t){var e=yk.map(u,(function(t){return"#"+a+"-"+t.name})).concat(yk.map(c,(function(t){return"#"+a+"-"+t}))).join(",");t?dO(e,r).show():dO(e,r).hide()},setClampRect:function(e){n=e,f(t)},setRect:d,getInnerRect:function(){return s(n,t)},setInnerRect:m,setViewPortRect:function(n){e=n,f(t)},destroy:function(){yk.each(i,(function(t){t.destroy()})),i=[]}},mO);return g},yO=function(t){var e=vp({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=xo(1),r=Zc(),o=xo({x:0,y:0,w:1,h:1}),i=xo({x:0,y:0,w:1,h:1}),a=function(t,i){s.getOpt(t).each((function(t){var a=n.get(),u=bn(t.element),c=ln(t.element),s=i.dom.naturalWidth*a,l=i.dom.naturalHeight*a,f=Math.max(0,u/2-s/2),d=Math.max(0,c/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:l.toString()+"px",position:"absolute"};Qe(i,m),e.getOpt(t).each((function(t){Qe(t.element,m)})),r.on((function(t){var e=o.get();t.setRect({x:e.x*a+f,y:e.y*a+d,w:e.w*a,h:e.h*a}),t.setClampRect({x:f,y:d,w:s,h:l}),t.setViewPortRect({x:0,y:0,w:u,h:c})}))}))},u=function(t,e){var r,u=Bt.fromTag("img");return We(u,"src",e),(r=u.dom,new Up((function(t){var e=function(){r.removeEventListener("load",e),t(r)};r.complete?t(r):r.addEventListener("load",e)}))).then((function(){t.getSystem().isConnected()&&s.getOpt(t).map((function(t){var e=Za({element:u});ah.replaceAt(t,1,B.some(e));var r=i.get(),c={x:0,y:0,w:u.dom.naturalWidth,h:u.dom.naturalHeight};i.set(c);var l=fO.inflate(c,-20,-20);o.set(l),r.w===c.w&&r.h===c.h||function(t,e){s.getOpt(t).each((function(t){var r=bn(t.element),o=ln(t.element),i=e.dom.naturalWidth,a=e.dom.naturalHeight,u=Math.min(r/i,o/a);u>=1?n.set(1):n.set(u)}))}(t,u),a(t,u)}))}))},c=qw.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:xc([uh("image-panel-crop-events",[$i((function(t){s.getOpt(t).each((function(t){var e=t.element.dom,i=bO({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,h);i.toggleVisibility(!1),i.on("updateRect",(function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)})),r.set(i)}))}))])])}],containerBehaviours:xc([ah.config({}),uh("image-panel-events",[$i((function(e){u(e,t)}))])])}),s=vp(c);return{memContainer:s,updateSrc:u,zoom:function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),s.getOpt(t).each((function(t){var e=t.components()[1].element;a(t,e)}))},showCrop:function(){r.on((function(t){t.toggleVisibility(!0)}))},hideCrop:function(){r.on((function(t){t.toggleVisibility(!1)}))},getRect:function(){return o.get()},getMeasurements:function(){var t=i.get();return{width:t.w,height:t.h}}}},wO=function(t,e,n,r,o){return WT({name:t,icon:B.some(e),disabled:n,tooltip:B.some(t),primary:!1,borderless:!1},r,o)},xO=function(t,e){e?Xd.enable(t):Xd.disable(t)};var CO,SO=function(t){var e,n,r,o,i=xo(t),a=Zc(),u=(n=-1,{data:e=[],add:function(t){var r=e.splice(++n);return e.push(t),{state:t,removed:r}},undo:function(){if(r())return e[--n]},redo:function(){if(o())return e[++n]},canUndo:r=function(){return n>0},canRedo:o=function(){return-1!==n&&n<e.length-1}});u.add(t);var c=function(t){i.set(t)},s=function(t){return{blob:t,url:URL.createObjectURL(t)}},l=function(t){URL.revokeObjectURL(t.url)},f=function(){a.on(l),a.clear()},d=function(t){var e=s(t);c(e);var n,r=u.add(e).removed;return n=r,yk.each(n,l),e.url};return{getBlobState:function(){return i.get()},setBlobState:c,addBlobState:d,getTempState:function(){return a.get().getOrThunk(i.get)},updateTempState:function(t){var e=s(t);return f(),a.set(e),e.url},addTempState:function(t){var e=s(t);return a.set(e),e.url},applyTempState:function(t){return a.get().fold(h,(function(e){d(e.blob),t()}))},destroyTempState:f,undo:function(){var t=u.undo();return c(t),t.url},redo:function(){var t=u.redo();return c(t),t.url},getHistoryStates:function(){return{undoEnabled:u.canUndo(),redoEnabled:u.canRedo()}}}},kO=function(t,e){var n=SO(t.currentState),r=function(t){var e=n.getHistoryStates();d.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),Ni(t,sO.formActionEvent,{name:sO.saveState(),value:e.undoEnabled})},o=function(t){return t.toBlob()},i=function(t){Ni(t,sO.formActionEvent,{name:sO.disable(),value:{}})},a=function(t){m.getApplyButton(t).each((function(t){Xd.enable(t)})),Ni(t,sO.formActionEvent,{name:sO.enable(),value:{}})},u=function(t,e){return i(t),f.updateSrc(t,e)},c=function(t,e,n,c,s){i(t),function(t){return Kk(t)}(e).then(n).then(o).then(c).then((function(e){return u(t,e)})).then((function(){r(t),s(),a(t)})).catch((function(e){console.log(e),t.getSystem().isConnected()&&a(t)}))},s=function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,(function(t){return n.updateTempState(t)}),r)},l=function(t){var e=n.getBlobState().url;return n.destroyTempState(),r(t),e},f=yO(t.currentState.url),d=function(t){var e=vp(wO("Undo","undo",!0,(function(t){Ni(t,iO.undo(),{direction:1})}),t)),n=vp(wO("Redo","redo",!0,(function(t){Ni(t,iO.redo(),{direction:1})}),t));return{container:qw.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),wO("Zoom in","zoom-in",!1,(function(t){Ni(t,iO.zoom(),{direction:1})}),t),wO("Zoom out","zoom-out",!1,(function(t){Ni(t,iO.zoom(),{direction:-1})}),t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each((function(t){xO(t,r)})),n.getOpt(t).each((function(t){xO(t,o)}))}}}(e),m=lO(f,e);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[m.memContainer.asSpec(),f.memContainer.asSpec(),d.container],behaviours:xc([Of.config({store:{mode:"manual",getValue:function(){return n.getBlobState()}}}),uh("image-tools-events",[Ii(iO.undo(),(function(t,e){var o=n.undo();u(t,o).then((function(e){a(t),r(t)}))})),Ii(iO.redo(),(function(t,e){var o=n.redo();u(t,o).then((function(e){a(t),r(t)}))})),Ii(iO.zoom(),(function(t,e){var n=e.event.direction;f.zoom(t,n)})),Ii(iO.back(),(function(t,e){!function(t){var e=l(t);u(t,e).then((function(e){a(t)}))}(t),(0,e.event.swap)(),f.hideCrop()})),Ii(iO.apply(),(function(t,e){n.applyTempState((function(){l(t),(0,e.event.swap)()}))})),Ii(iO.transform(),(function(t,e){return s(t,e.event.transform,h)})),Ii(iO.tempTransform(),(function(t,e){return function(t,e){var r=n.getTempState().blob;c(t,r,e,(function(t){return n.addTempState(t)}),h)}(t,e.event.transform)})),Ii(iO.transformApply(),(function(t,e){return function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,(function(e){var r=n.addBlobState(e);return l(t),r}),r)}(t,e.event.transform,e.event.swap)})),Ii(iO.swap(),(function(t,e){!function(t){d.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event.transform,r=e.event.swap;n.fold((function(){r()}),(function(e){s(t,e,r)}))}))]),mk()])}},TO=function(t){return!wt(t,"items")},OO="data-value",EO=function(t,e,n,r){return U(n,(function(n){return TO(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){Of.setValue(t,n.value),Ni(t,ox,{name:e}),dh.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return EO(t,e,n.items,r)}}}))},_O=function(t,e){return st(t,(function(t){return TO(t)?Tt(t.value===e,t):_O(t.items,e)}))},RO=Nd({name:"HtmlSelect",configFields:[Xr("options"),Ef("selectBehaviours",[dh,Of]),fo("selectClasses",[]),fo("selectAttributes",{}),oo("data")],factory:function(t,e){var n=U(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return To("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:Rf(t.selectBehaviours,[dh.config({}),Of.config({store:O({mode:"manual",getValue:function(t){return Ua(t.element)},setValue:function(e,n){X(t.options,(function(t){return t.value===n})).isSome()&&Wa(e.element,n)}},r)})])}}}),NO=function(t,e){var n=t.label.map((function(t){return rx(t,e)})),r=[Xd.config({disabled:function(){return t.disabled||e.isDisabled()}}),qb(),eh.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Ri(t,cx),B.some(!0)}}),uh("textfield-change",[Ii(Xo(),(function(e,n){Ni(e,ox,{name:t.name})})),Ii(ai(),(function(e,n){Ni(e,ox,{name:t.name})}))]),Qw.config({})],o=t.validation.map((function(t){return Ix.config({getRoot:function(t){return Oe(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=Of.getValue(e),r=t.validator(n);return _x(!0===r?Wn.value(n):Wn.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),i=t.placeholder.fold(v({}),(function(t){return{placeholder:e.translate(t)}})),a=t.inputMode.fold(v({}),(function(t){return{inputmode:t}})),u=O(O({},i),a),c=Xw.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:u,inputClasses:[t.classname],inputBehaviours:xc(J([r,o])),selectOnFocus:!1,factory:bx}),s=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),l=[Xd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){Xw.getField(t).each(Xd.disable)},onEnabled:function(t){Xw.getField(t).each(Xd.enable)}}),qb()];return tx(n,c,s,l)},AO=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return zi([Ii(t.event,n),Gi((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Ii(t,(function(){return e.cancel()}))]})).getOr([])))}}),DO=function(t){var e=xo(null);return xa({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},MO=Object.freeze({__proto__:null,throttle:DO,init:function(t){return t.stream.streams.state(t)}}),BO=[Yr("stream",qr("mode",{throttle:[Xr("delay"),fo("stopEvent",!0),Du("streams",{setup:function(t,e){var n=t.stream,r=Dp(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:DO})]})),fo("event","input"),oo("cancelEvent"),Nu("onStream")],zO=Sc({fields:BO,name:"streaming",active:AO,state:MO}),PO=function(t,e,n){var r=Of.getValue(n);Of.setValue(e,r),IO(e)},LO=function(t,e){var n=t.element,r=Ua(n),o=n.dom;"number"!==qe(n,"type")&&e(o,r)},IO=function(t){LO(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},HO=function(t,e,n){if(t.selectsOver){var r=Of.getValue(e),o=t.getDisplayText(r),i=Of.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?B.some((function(){PO(0,e,n),function(t,e){LO(t,(function(t,n){return t.setSelectionRange(e,n.length)}))}(e,o.length)})):B.none()}return B.none()},FO=v("alloy.typeahead.itemexecute"),VO=v([oo("lazySink"),Xr("fetch"),fo("minChars",5),fo("responseTime",1e3),_u("onOpen"),fo("getHotspot",B.some),fo("getAnchorOverrides",v({})),fo("layouts",B.none()),fo("eventOrder",{}),wo("model",{},[fo("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),fo("selectsOver",!0),fo("populateFromBrowse",!0)]),_u("onSetValue"),Ru("onExecute"),_u("onItemExecute"),fo("inputClasses",[]),fo("inputAttributes",{}),fo("inputStyles",{}),fo("matchWidth",!0),fo("useMinWidth",!1),fo("dismissOnBlur",!0),Ou(["openClass"]),oo("initialData"),Ef("typeaheadBehaviours",[dh,Of,zO,eh,kh,Vx]),Gr("previewing",(function(){return xo(!0)}))].concat(gx()).concat(nC())),jO=v([rd({schema:[Tu()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){HO(t.model,r,n).fold((function(){return am.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&PO(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return Ni(t,FO(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&PO(t.model,e,n)}))}}}})]),UO=Ad({name:"Typeahead",configFields:VO(),partFields:jO(),factory:function(t,e,n,r){var o=function(e,n,o){t.previewing.set(!1);var i=Vx.getCoupled(e,"sandbox");if(af.isOpen(i))zd.getCurrent(i).each((function(t){am.getHighlighted(t).fold((function(){o(t)}),(function(){Bi(i,t.element,"keydown",n)}))}));else{Kx(t,a(e),e,i,r,(function(t){zd.getCurrent(t).each(o)}),xx.HighlightFirst).get(h)}},i=hx(t),a=function(t){return function(e){return e.map((function(e){var n=bt(e.menus),r=Q(n,(function(t){return $(t.items,(function(t){return"item"===t.type}))}));return Of.getState(t).update(U(r,(function(t){return t.data}))),e}))}},u=[dh.config({}),Of.config({onSetValue:t.onSetValue,store:O({mode:"dataset",getDataKey:function(t){return Ua(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){Wa(e.element,t.model.getDisplayText(n))}},t.initialData.map((function(t){return To("initialValue",t)})).getOr({}))}),zO.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,n){var o=Vx.getCoupled(e,"sandbox");if(dh.isFocused(e)&&Ua(e.element).length>=t.minChars){var i=zd.getCurrent(o).bind((function(t){return am.getHighlighted(t).map(Of.getValue)}));t.previewing.set(!0);Kx(t,a(e),e,o,r,(function(e){zd.getCurrent(o).each((function(e){i.fold((function(){t.model.selectsOver&&am.highlightFirst(e)}),(function(t){am.highlightBy(e,(function(e){return Of.getValue(e).value===t.value})),am.getHighlighted(e).orThunk((function(){return am.highlightFirst(e),B.none()}))}))}))}),xx.HighlightFirst).get(h)}},cancelEvent:mi()}),eh.config({mode:"special",onDown:function(t,e){return o(t,e,am.highlightFirst),B.some(!0)},onEscape:function(t){var e=Vx.getCoupled(t,"sandbox");return af.isOpen(e)?(af.close(e),B.some(!0)):B.none()},onUp:function(t,e){return o(t,e,am.highlightLast),B.some(!0)},onEnter:function(e){var n=Vx.getCoupled(e,"sandbox"),r=af.isOpen(n);if(r&&!t.previewing.get())return zd.getCurrent(n).bind((function(t){return am.getHighlighted(t)})).map((function(t){return Ni(e,FO(),{item:t}),!0}));var o=Of.getValue(e);return Ri(e,mi()),t.onExecute(n,e,o),r&&af.close(n),B.some(!0)}}),kh.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),Vx.config({others:{sandbox:function(e){return tC(t,e,{onOpen:function(){return kh.on(e)},onClose:function(){return kh.off(e)}})}}}),uh("typeaheadevents",[Xi((function(e){var n=h;Yx(t,a(e),e,r,n,xx.HighlightFirst).get(h)})),Ii(FO(),(function(e,n){var r=Vx.getCoupled(e,"sandbox");PO(t.model,e,n.event.item),Ri(e,mi()),t.onItemExecute(e,r,n.event.item,Of.getValue(e)),af.close(r),IO(e)}))].concat(t.dismissOnBlur?[Ii(ii(),(function(t){var e=Vx.getCoupled(t,"sandbox");Mc(e.element).isNone()&&af.close(e)}))]:[]))];return{uid:t.uid,dom:vx(ur(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:O(O({},i),Rf(t.typeaheadBehaviours,u)),eventOrder:t.eventOrder}}}),WO=function(t){return O(O({},t),{toCached:function(){return WO(t.toCached())},bindFuture:function(e){return WO(t.bind((function(t){return t.fold((function(t){return _x(Wn.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return WO(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return WO(t.map((function(t){return t.map(e)})))},mapError:function(e){return WO(t.map((function(t){return t.mapError(e)})))},foldResult:function(e,n){return t.map((function(t){return t.fold(e,n)}))},withTimeout:function(e,n){return WO(Ex((function(r){var o=!1,i=setTimeout((function(){o=!0,r(Wn.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))}})},qO=function(t){return WO(Ex(t))},$O=qO,GO={type:"separator"},KO=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:h}},XO=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:h}},YO=function(t,e){return function(t){return U(t,KO)}(function(t,e){return $(e,(function(e){return e.type===t}))}(t,e))},JO=function(t){return YO("header",t.targets)},QO=function(t){return YO("anchor",t.targets)},ZO=function(t){return B.from(t.anchorTop).map((function(t){return XO("<top>",t)})).toArray()},tE=function(t){return B.from(t.anchorBottom).map((function(t){return XO("<bottom>",t)})).toArray()},eE=function(t,e){var n=t.toLowerCase();return $(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return Et(e.toLowerCase(),n)||Et(t.value.toLowerCase(),n)}))},nE=function(t,e,n){var r=Of.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=eE(o,function(t){return U(t,(function(t){return XO(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,eE(o,JO(e)),eE(o,J([ZO(e),QO(e),tE(e)]))],K(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(GO,e)}),[])):i}))},rE=oa("aria-invalid"),oE=function(t){return function(e,n,r){return yt(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},iE={bar:oE((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:U(t.items,e.interpreter)}}(t,e.shared)})),collection:oE((function(t,e){return mx(t,e.shared.providers)})),alertbanner:oE((function(t,e){return function(t,e){return qw.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[pp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:kp(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Ni(e,ux,{name:"alert-banner",value:t.url})},buttonBehaviours:xc([Tp()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:oE((function(t,e){return function(t,e){return NO({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:B.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:oE((function(t,e){return function(t,e){return NO({name:t.name,multiline:!0,label:t.label,inputMode:B.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:B.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:oE((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=U(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:xc([mk(),ah.config({}),Tk(B.none()),eh.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:function(t){return function(e,n,r){var o=ur(n,{source:"dynamic"});return oE(t)(e,o,r)}}((function(t,e){return Pk(t,e.shared.providers)})),button:oE((function(t,e){return XT(t,e.shared.providers)})),checkbox:oE((function(t,e){return function(t,e){var n=Of.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),r=function(t){return t.element.dom.click(),B.some(!0)},o=Xw.parts.field({factory:{sketch:b},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:xc([mk(),Xd.config({disabled:function(){return t.disabled||e.isDisabled()}}),Qw.config({}),dh.config({}),n,eh.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),uh("checkbox-events",[Ii(Yo(),(function(e,n){Ni(e,ox,{name:t.name})}))])])}),i=Xw.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:xc([uC.config({})])}),a=function(t){return Ep("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},e.icons)},u=vp({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return Xw.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,u.asSpec(),i],fieldBehaviours:xc([Xd.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){Xw.getField(t).each(Xd.disable)},onEnabled:function(t){Xw.getField(t).each(Xd.enable)}}),qb()])})}(t,e.shared.providers)})),colorinput:oE((function(t,e){return fC(t,e.shared,e.colorinput)})),colorpicker:oE((function(t){var e=function(t){return"tox-"+t},n=dk(vk,e),r=vp(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Ni(t,ux,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Ni(t,ux,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:xc([Of.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return zd.getCurrent(e).bind((function(t){return Of.getValue(t).hex})).map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);zd.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(t){Of.setValue(t,{hex:B.from(n[1]).getOr("")}),ik.getField(t,"hex").each((function(t){Ri(t,Xo())}))}))}}}),mk()])}})),dropzone:oE((function(t,e){return Ek(t,e.shared.providers)})),grid:oE((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:U(t.items,e.interpreter)}}(t,e.shared)})),listbox:oE((function(t,e){return function(t,e){var n=e.shared.providers,r=at(t.items).filter(TO),o=t.label.map((function(t){return rx(t,n)})),i={dom:{tag:"div",classes:["tox-listboxfield"]},components:[Xw.parts.field({dom:{},factory:{sketch:function(n){return DT({uid:n.uid,text:r.map((function(t){return t.text})),icon:B.none(),tooltip:t.label,role:B.none(),fetch:function(n,r){var o=EO(n,t.name,t.items,Of.getValue(n));r(IT(o,hv.CLOSE_ON_EXECUTE,e,!1))},onSetup:v(h),getApi:v({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Qw.config({}),Of.config({store:{mode:"manual",initialValue:r.map((function(t){return t.value})).getOr(""),getValue:function(t){return qe(t.element,OO)},setValue:function(e,n){_O(t.items,n).each((function(t){We(e.element,OO,t.value),Ni(e,NT,{text:t.text})}))}}})]},"tox-listbox",e.shared)}}})]};return Xw.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:J([o.toArray(),[i]]),fieldBehaviours:xc([Xd.config({disabled:v(t.disabled),onDisabled:function(t){Xw.getField(t).each(Xd.disable)},onEnabled:function(t){Xw.getField(t).each(Xd.enable)}})])})}(t,e)})),selectbox:oE((function(t,e){return function(t,e){var n=U(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return rx(t,e)})),o=Xw.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:RO,selectBehaviours:xc([Xd.config({disabled:function(){return t.disabled||e.isDisabled()}}),Qw.config({}),uh("selectbox-change",[Ii(Yo(),(function(e,n){Ni(e,ox,{name:t.name})}))])])}),i=t.size>1?B.none():B.some(Ep("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),a={dom:{tag:"div",classes:["tox-selectfield"]},components:J([[o],i.toArray()])};return Xw.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:J([r.toArray(),[a]]),fieldBehaviours:xc([Xd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){Xw.getField(t).each(Xd.disable)},onEnabled:function(t){Xw.getField(t).each(Xd.enable)}}),qb()])})}(t,e.shared.providers)})),sizeinput:oE((function(t,e){return oO(t,e.shared.providers)})),urlinput:oE((function(t,e){return function(t,e,n){var r,o=e.shared.providers,i=function(e){var r=Of.getValue(e);n.addToHistory(r.value,t.filetype)},a=Xw.parts.field({factory:UO,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":rE,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=nE(t.filetype,r,n),i=IT(o,hv.BUBBLE_TO_SANDBOX,e,!1);return _x(i)},getHotspot:function(t){return d.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(Ix)&&Ix.run(t).get(h)},typeaheadBehaviours:xc(J([n.getValidationHandler().map((function(e){return Ix.config({getRoot:function(t){return Oe(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){c.getOpt(t).each((function(t){We(t.element,"title",o.translate(e))}))}},validator:{validate:function(n){var r=Of.getValue(n);return $O((function(n){e({type:t.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=Wn.error(t.message);n(e)}else{var r=Wn.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[Xd.config({disabled:function(){return t.disabled||o.isDisabled()}}),Qw.config({}),uh("urlinput-events",J(["file"===t.filetype?[Ii(Xo(),(function(e){Ni(e,ox,{name:t.name})}))]:[],[Ii(Yo(),(function(e){Ni(e,ox,{name:t.name}),i(e)})),Ii(ai(),(function(e){Ni(e,ox,{name:t.name}),i(e)}))]]))]])),eventOrder:(r={},r[Xo()]=["streaming","urlinput-events","invalidating"],r),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:Mv(0,0,"normal")},onExecute:function(t,e,n){Ni(e,cx,{})},onItemExecute:function(e,n,r,o){i(e),Ni(e,ox,{name:t.name})}}),u=t.label.map((function(t){return rx(t,o)})),c=vp(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),Ep(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:O({title:o.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))},o.icons)}("invalid",B.some(rE),"warning")),s=vp({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),l=n.getUrlPicker(t.filetype),f=oa("browser.url.event"),d=vp({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,s.asSpec()],behaviours:xc([Xd.config({disabled:function(){return t.disabled||o.isDisabled()}})])}),m=vp($T({name:t.name,icon:B.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return Ri(t,f)}),o,[],["tox-browse-url"]));return Xw.sketch({dom:nx([]),components:u.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:J([[d.asSpec()],l.map((function(){return m.asSpec()})).toArray()])}]),fieldBehaviours:xc([Xd.config({disabled:function(){return t.disabled||o.isDisabled()},onDisabled:function(t){Xw.getField(t).each(Xd.disable),m.getOpt(t).each(Xd.disable)},onEnabled:function(t){Xw.getField(t).each(Xd.enable),m.getOpt(t).each(Xd.enable)}}),qb(),uh("url-input-events",[Ii(f,(function(e){zd.getCurrent(e).each((function(n){var r=Of.getValue(n),o=O({fieldname:t.name},r);l.each((function(r){r(o).get((function(r){Of.setValue(n,r),Ni(e,ox,{name:t.name})}))}))}))}))])])})}(t,e,e.urlinput)})),customeditor:oE((function(t){var e=Zc(),n=vp({dom:{tag:t.tag}}),r=Zc();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:xc([uh("custom-editor-events",[$i((function(o){n.getOpt(o).each((function(n){(!function(t){return wt(t,"init")}(t)?bk.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)})):t.init(n.element.dom)).then((function(t){r.on((function(e){t.setValue(e)})),r.clear(),e.set(t)}))}))}))]),Of.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(n)}),(function(t){return t.setValue(n)}))}}}),mk()]),components:[n.asSpec()]}})),htmlpanel:oE((function(t){return"presentation"===t.presets?qw.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):qw.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:xc([Qw.config({}),dh.config({})])})})),imagetools:oE((function(t,e){return kO(t,e.shared.providers)})),table:oE((function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},a=function(t){return{dom:{tag:"tr"},components:U(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:U(r,o)}]}),(n=t.cells,{dom:{tag:"tbody"},components:U(n,a)})],behaviours:xc([Qw.config({}),dh.config({})])}}(t,e.shared.providers)})),panel:oE((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:U(t.items,e.shared.interpreter)}}(t,e)}))},aE={field:function(t,e){return e}},uE=function(t,e,n){var r=ur(n,{shared:{interpreter:function(e){return cE(t,e,r)}}});return cE(t,e,r)},cE=function(t,e,n){return yt(iE,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},sE={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},lE=function(t,e,n){var r={maxHeightFunction:gs()};return function(){return n()?{type:"node",root:Pe(t()),node:B.from(t()),bubble:bs(12,12,sE),layouts:{onRtl:function(){return[ap]},onLtr:function(){return[ip]}},overrides:r}:{type:"hotspot",hotspot:e(),bubble:bs(-12,12,sE),layouts:{onRtl:function(){return[ec]},onLtr:function(){return[nc]}},overrides:r}}},fE=function(t,e,n){return function(){return n()?{type:"node",root:Pe(t()),node:B.from(t()),layouts:{onRtl:function(){return[up]},onLtr:function(){return[up]}}}:{type:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[ac]},onLtr:function(){return[ac]}}}}},dE=function(t,e){return function(){return{type:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return B.some(Ws.range(Bt.fromDom(e.startContainer),e.startOffset,Bt.fromDom(e.endContainer),e.endOffset))}}}},mE=function(t){return function(e){return{type:"node",root:t(),node:e}}},gE=function(t,e,n){var r=Mb(t),o=function(){return Bt.fromDom(t.getBody())},i=function(){return Bt.fromDom(t.getContentAreaContainer())},a=function(){return r||!n()};return{inlineDialog:lE(i,e,a),banner:fE(i,e,a),cursor:dE(t,o),node:mE(o)}},hE=function(t){return function(e,n){cw(t)(e,n)}},pE=function(t){return function(){return Jy(t)}},vE=function(t){return function(){return Qy(t)}},bE=function(t){return function(){return tw(t)}},yE=function(t){return{colorPicker:hE(t),hasCustomColors:pE(t),getColors:vE(t),getColorCols:bE(t)}},wE=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},xE=function(t){return{isDraggableModal:wE(t)}},CE=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],SE=function(t){return K(t,(function(t,e){if(wt(e,"items")){var n=SE(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(function(t){return wt(t,"inline")}(e)||function(t){return wt(t,"block")}(e)||function(t){return wt(t,"selector")}(e)){var r="custom-"+(o(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:r,format:e}]),formats:t.formats.concat([{title:e.title,format:r,icon:e.icon}])}}return O(O({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},kE=function(t){return function(t){return B.from(t.getParam("style_formats")).filter(a)}(t).map((function(e){var n=function(t,e){var n=SE(e),r=function(e){W(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?CE.concat(n):n})).getOr(CE)},TE=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return ur(t,r)},OE=function(t,e,n,r){var i=function(e){return U(e,(function(e){var a=lt(e);if(xt(e,"items")){var u=i(e.items);return ur(function(t){return ur(t,{type:"submenu"})}(e),{getStyleItems:v(u)})}return xt(e,"format")?function(t){return TE(t,n,r)}(e):1===a.length&&H(a,"title")?ur(e,{type:"separator"}):function(e){var i=o(e.name)?e.name:oa(e.title),a="custom-"+i,u={type:"formatter",format:a,isSelected:n(a),getStylePreview:r(a)},c=ur(e,u);return t.formatter.register(i,c),c}(e)}))};return i(e)},EE=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?B.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):B.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?Q(e,r):[t.format]},o=xo([]),i=xo([]),a=xo([]),u=xo([]),c=xo(!1);t.on("PreInit",(function(a){var u=kE(t),c=OE(t,u,e,n);o.set(c),i.set(Q(c,r))})),t.on("addStyleModifications",(function(o){var i=OE(t,o.items,e,n);a.set(i),c.set(o.replace),u.set(Q(i,r))}));return{getData:function(){var t=c.get()?[]:o.get(),e=a.get();return t.concat(e)},getFlattenedKeys:function(){var t=c.get()?[]:i.get(),e=u.get();return t.concat(e)}}},_E=yk.trim,RE=function(t){return function(e){if(function(t){return f(t)&&1===t.nodeType}(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},NE=RE("true"),AE=RE("false"),DE=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},ME=function(t){return t.innerText||t.textContent},BE=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&PE(t)},zE=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},PE=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return NE(t)}return!1}(t)&&!AE(t)},LE=function(t){return zE(t)&&PE(t)},IE=function(t){var e=function(t){return t.id?t.id:oa("h")}(t);return DE("header",ME(t),"#"+e,function(t){return zE(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},HE=function(t){var e=t.id||t.name,n=ME(t);return DE("anchor",n||"#"+e,"#"+e,0,h)},FE=function(t){var e,n;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,U(ol(Bt.fromDom(n),e),(function(t){return t.dom}))},VE=function(t){return _E(t.title).length>0},jE=function(t){var e=FE(t);return $(function(t){return U($(t,LE),IE)}(e).concat(function(t){return U($(t,BE),HE)}(e)),VE)},UE="tinymce-url-history",WE=function(t){return o(t)&&/^https?/.test(t)},qE=function(t){return i(t)&&vt(t,(function(t){return!(a(e=t)&&e.length<=5&&Z(e,WE));var e})).isNone()},$E=function(){var t,e=qy.getItem(UE);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+UE+" was not valid JSON",t),{};throw t}return qE(t)?t:(console.log("Local storage "+UE+" was not valid format",t),{})},GE=function(t){var e=$E();return yt(e,t).getOr([])},KE=function(t,e){if(WE(t)){var n=$E(),r=yt(n,e).getOr([]),o=$(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!qE(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));qy.setItem(UE,JSON.stringify(t))}(n)}},XE=function(t){return!!t},YE=function(t){return mt(yk.makeMap(t,/[, ]/),XE)},JE=function(t){return B.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(d)},QE=function(t,e){var n=function(t){var e=B.some(function(t){return t.getParam("file_picker_types")}(t)).filter(XE),n=B.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(XE),r=e.or(n).map(YE);return JE(t).fold(S,(function(t){return r.fold(k,(function(t){return lt(t).length>0&&t}))}))}(t);return c(n)?n?JE(t):B.none():n[e]?JE(t):B.none()},ZE=function(t){return B.from(t).filter(o).getOrUndefined()},t_=function(t){return{getHistory:GE,addToHistory:KE,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?B.none():B.some({targets:jE(t.getBody()),anchorTop:ZE(Hb(t)),anchorBottom:ZE(Fb(t))})}(t)},getValidationHandler:function(){return function(t){return B.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return QE(t,e).map((function(n){return function(r){return Ex((function(a){var u=O({filetype:e,fieldname:r.fieldname},B.from(r.meta).getOr({}));n.call(t,(function(t,e){if(!o(t))throw new Error("Expected value to be string");if(void 0!==e&&!i(e))throw new Error("Expected meta to be a object");a({value:t,meta:e})}),r.value,u)}))}}))}(t,e)}}},e_=function(t,e,n){var r=xo(!1),o=function(t){var e=xo(Ab(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:bp.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return cE(aE,t,e)}(t,i)},anchors:gE(e,n,o.isPositionedAtTop),header:o,getSink:function(){return Wn.value(t)}},urlinput:t_(e),styleselect:EE(e),colorinput:yE(e),dialog:xE(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},n_=kd,r_=ud,o_=v([fo("shell",!1),Xr("makeItem"),fo("setupItem",h),Nf("listBehaviours",[ah])]),i_=od({name:"items",overrides:function(){return{behaviours:xc([ah.config({})])}}}),a_=v([i_]),u_=v("CustomList"),c_=Ad({name:u_(),configFields:o_(),partFields:a_(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[ah.config({})],components:[]}:{behaviours:[],components:e},i=function(e){return t.shell?B.some(e):pd(e,t,"items")};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:Rf(t.listBehaviours,o.behaviours),apis:{setItems:function(e,n){i(e).fold((function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(function(r){var o=ah.contents(r),i=n.length,a=i-o.length,u=a>0?V(a,(function(){return t.makeItem()})):[],c=o.slice(i);W(c,(function(t){return ah.remove(r,t)})),W(u,(function(t){return ah.append(r,t)}));var s=ah.contents(r);W(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),s_=v([Xr("dom"),fo("shell",!0),Ef("toolbarBehaviours",[ah])]),l_=v([od({name:"groups",overrides:function(){return{behaviours:xc([ah.config({})])}}})]),f_=Ad({name:"Toolbar",configFields:s_(),partFields:l_(),factory:function(t,e,n,r){var o=function(e){return t.shell?B.some(e):pd(e,t,"groups")},i=t.shell?{behaviours:[ah.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:Rf(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,e){o(t).fold((function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(function(t){ah.set(t,e)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),d_=h,m_=S,g_=v([]),h_=Object.freeze({__proto__:null,setup:d_,isDocked:m_,getBehaviours:g_}),p_=function(t){return(Ct(nn(t,"position"),"fixed")?B.none():Ee(t)).orThunk((function(){var e=Bt.fromTag("span");return Oe(t).bind((function(t){On(t,e);var n=Ee(e);return Rn(e),n}))}))},v_=function(t){return p_(t).map(hn).getOrThunk((function(){return mn(0,0)}))},b_=Co([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),y_=function(t,e){var n=t.element;La(n,e.transitionClass),Ha(n,e.fadeOutClass),La(n,e.fadeInClass),e.onShow(t)},w_=function(t,e){var n=t.element;La(n,e.transitionClass),Ha(n,e.fadeInClass),La(n,e.fadeOutClass),e.onHide(t)},x_=function(t,e,n){return Z(t,(function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}}))},C_=function(t,e){return e.getInitialPos().map((function(e){return In(e.bounds.x,e.bounds.y,bn(t),ln(t))}))},S_=function(t,e,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return B.some(b_.static());case"absolute":var o=p_(t).map(Hn).getOrThunk((function(){return Hn(Ve())}));return B.some(b_.absolute(zc("absolute",yt(r.style,"left").map((function(t){return e.x-o.x})),yt(r.style,"top").map((function(t){return e.y-o.y})),yt(r.style,"right").map((function(t){return o.right-e.right})),yt(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return B.none()}}))},k_=function(t,e,n){var r=Hn(t);if(x_(n.getModes(),r,e))return B.none();!function(t,e,n){n.setInitialPos({style:rn(t),position:tn(t,"position")||"static",bounds:e})}(t,r,n);var o=Vn(),i=r.x-o.x,a=e.y-o.y,u=o.bottom-e.bottom,c=r.y<=e.y;return B.some(b_.fixed(zc("fixed",B.some(i),c?B.some(a):B.none(),B.none(),c?B.none():B.some(u))))},T_=function(t,e,n){var r=t.element;return Ct(nn(r,"position"),"fixed")?function(t,e,n){return C_(t,n).filter((function(t){return x_(n.getModes(),t,e)})).bind((function(e){return S_(t,e,n)}))}(r,e,n):k_(r,e,n)},O_=function(t,e,n){n.setDocked(!1),W(["left","right","top","bottom","position"],(function(e){return an(t.element,e)})),e.onUndocked(t)},E_=function(t,e,n,r){var o="fixed"===r.position;n.setDocked(o),Pc(t.element,r),(o?e.onDocked:e.onUndocked)(t)},__=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var a=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);a!==n.isVisible()&&(n.setVisible(a),o&&!a?(Va(t.element,[e.fadeOutClass]),e.onHide(t)):(a?y_:w_)(t,e))}))}))},R_=function(t,e,n){var r=t.element;n.setDocked(!1),function(t,e){var n=t.element;return C_(n,e).bind((function(t){return S_(n,t,e)}))}(t,n).each((function(r){r.fold((function(){return O_(t,e,n)}),(function(r){return E_(t,e,n,r)}),h)})),n.setVisible(!0),e.contextual.each((function(e){ja(r,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),N_(t,e,n)},N_=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t);n.isDocked()&&__(t,e,n,r),T_(t,r,n).each((function(o){o.fold((function(){return O_(t,e,n)}),(function(r){return E_(t,e,n,r)}),(function(o){__(t,e,n,r,!0),E_(t,e,n,o)}))}))}(t,e,n)},A_=function(t,e,n){n.isDocked()&&R_(t,e,n)},D_=Object.freeze({__proto__:null,refresh:N_,reset:A_,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),M_=Object.freeze({__proto__:null,events:function(t,e){return zi([qi(Zo(),(function(n,r){t.contextual.each((function(t){Fa(n.element,t.transitionClass)&&(ja(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n));r.stop()}))})),Ii(vi(),(function(n,r){N_(n,t,e)})),Ii(bi(),(function(n,r){A_(n,t,e)}))])}}),B_=[lo("contextual",[Qr("fadeInClass"),Qr("fadeOutClass"),Qr("transitionClass"),to("lazyContext"),_u("onShow"),_u("onShown"),_u("onHide"),_u("onHidden")]),bo("lazyViewport",Vn),yo("modes",["top","bottom"],Dr),_u("onDocked"),_u("onUndocked")],z_=Sc({fields:B_,name:"docking",active:M_,apis:D_,state:Object.freeze({__proto__:null,init:function(t){var e=xo(!1),n=xo(!0),r=Zc(),o=xo(t.modes);return xa({isDocked:e.get,setDocked:e.set,getInitialPos:r.get,setInitialPos:r.set,clearInitialPos:r.clear,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}})}),P_=v(oa("toolbar-height-change")),L_={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},I_="tox-tinymce--toolbar-sticky-on",H_="tox-tinymce--toolbar-sticky-off",F_=function(t,e){return H(z_.getModes(t),e)},V_=function(t){var e=t.element;Oe(e).each((function(n){var r="padding-"+z_.getModes(t)[0];if(z_.isDocked(t)){var o=bn(n);Je(e,"width",o+"px"),Je(n,r,function(t){return fn(t)+(parseInt(tn(t,"margin-top"),10)||0)+(parseInt(tn(t,"margin-bottom"),10)||0)}(e)+"px")}else an(e,"width"),an(n,r)}))},j_=function(t,e){e?(Ha(t,L_.fadeOutClass),Va(t,[L_.transitionClass,L_.fadeInClass])):(Ha(t,L_.fadeInClass),Va(t,[L_.fadeOutClass,L_.transitionClass]))},U_=function(t,e){var n=Bt.fromDom(t.getContainer());e?(La(n,I_),Ha(n,H_)):(La(n,H_),Ha(n,I_))},W_=function(t,e){var n=Zc(),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||V_(e),U_(t,z_.isDocked(e)),e.getSystem().broadcastOn([cf()],{}),r().each((function(t){return t.getSystem().broadcastOn([cf()],{})}))},a=t.inline?[]:function(){var t;return[Ec.config({channels:(t={},t[P_()]={onReceive:V_},t)})]}();return _([dh.config({}),z_.config({contextual:O({lazyContext:function(e){var n=fn(e.element),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=Hn(Bt.fromDom(r)),i=o.height-n,a=o.y+(F_(e,"top")?0:n);return B.some(In(o.x,a,o.width,i))},onShow:function(){o((function(t){return j_(t,!0)}))},onShown:function(t){o((function(t){return ja(t,[L_.transitionClass,L_.fadeInClass])})),n.get().each((function(e){var r,o,i;r=t.element,i=Ce(o=e),Dc(i).filter((function(t){return!ye(o,t)})).filter((function(t){return ye(t,Bt.fromDom(i.dom.body))||xe(r,t)})).each((function(){return Nc(o)})),n.clear()}))},onHide:function(t){(function(t,e){return Mc(t).orThunk((function(){return e().toOptional().bind((function(t){return Mc(t.element)}))}))})(t.element,r).fold(n.clear,n.set),o((function(t){return j_(t,!1)}))},onHidden:function(){o((function(t){return ja(t,[L_.transitionClass])}))}},L_),lazyViewport:function(e){var n=Vn(),r=function(t){return t.getParam("toolbar_sticky_offset",0,"number")}(t),o=n.y+(F_(e,"top")?r:0),i=n.height-(F_(e,"bottom")?r:0);return In(n.x,o,n.width,i)},modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],a,!0)},q_=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(z_.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(V_)})),t.on("SkinLoaded",(function(){n().each((function(t){z_.isDocked(t)?z_.reset(t):z_.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(z_.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){z_.refresh(e);var n=e.element;Xm(n)&&function(t,e){var n=Ce(e),r=n.dom.defaultView.innerHeight,o=An(n),i=Bt.fromDom(t.elm),a=Fn(i),u=ln(i),c=a.y,s=c+u,l=hn(e),f=ln(e),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,h=Math.abs(m-(o.top+r))<2;if(g&&c<m)Dn(o.left,c-f,n);else if(h&&s>d){var p=c-r+u+f;Dn(o.left,p,n)}}(t,n)}))})),t.on("PostRender",(function(){U_(t,!1)}))},isDocked:function(t){return t().map(z_.isDocked).getOr(!1)},getBehaviours:W_}),$_=kr([Qr("type"),Yr("items",Or([_r([Qr("name"),ro("items",Dr)]),Dr]))].concat(Zp)),G_=[uo("text"),uo("tooltip"),uo("icon"),to("fetch"),bo("onSetup",(function(){return h}))],K_=kr(_([Qr("type")],G_,!0)),X_=function(t){return Vr("menubutton",K_,t)},Y_=kr([Qr("type"),uo("tooltip"),uo("icon"),uo("text"),co("select"),to("fetch"),bo("onSetup",(function(){return h})),po("presets","normal",["normal","color","listpreview"]),fo("columns",1),to("onAction"),to("onItemAction")]),J_=Nd({factory:function(t,e){var n={focus:eh.focusIn,setMenus:function(t,n){var r=U(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=X_(n).mapError((function(t){return Wr(t)})).getOrDie();return FT(r,"tox-mbtn",e.backstage,B.some("menuitem"))}));ah.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:xc([ah.config({}),uh("menubar-events",[$i((function(e){t.onSetup(e)})),Ii(Wo(),(function(t,e){lu(t.element,".tox-mbtn--active").each((function(n){fu(e.event.target,".tox-mbtn").each((function(e){ye(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){iC.expand(t),iC.close(n),dh.focus(t)}))}))}))}))})),Ii(Si(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){iC.isOpen(n)&&(iC.expand(t),iC.close(n))}))}))}))]),eh.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),B.some(!0)}}),Qw.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Xr("dom"),Xr("uid"),Xr("onEscape"),Xr("backstage"),fo("onSetup",h)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),Q_=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},Z_=function(t){return t.dimension.property},tR=function(t,e){return t.dimension.getDimension(e)},eR=function(t,e){var n=Q_(t,e);ja(n,[e.shrinkingClass,e.growingClass])},nR=function(t,e){Ha(t.element,e.openClass),La(t.element,e.closedClass),Je(t.element,Z_(e),"0px"),un(t.element)},rR=function(t,e){Ha(t.element,e.closedClass),La(t.element,e.openClass),an(t.element,Z_(e))},oR=function(t,e,n,r){n.setCollapsed(),Je(t.element,Z_(e),tR(e,t.element)),un(t.element),eR(t,e),nR(t,e),e.onStartShrink(t),e.onShrunk(t)},iR=function(t,e,n,r){var o=r.getOrThunk((function(){return tR(e,t.element)}));n.setCollapsed(),Je(t.element,Z_(e),o),un(t.element);var i=Q_(t,e);Ha(i,e.growingClass),La(i,e.shrinkingClass),nR(t,e),e.onStartShrink(t)},aR=function(t,e,n){var r=tR(e,t.element);("0px"===r?oR:iR)(t,e,n,B.some(r))},uR=function(t,e,n){var r=Q_(t,e),o=Fa(r,e.shrinkingClass),i=tR(e,t.element);rR(t,e);var a=tR(e,t.element);(o?function(){Je(t.element,Z_(e),i),un(t.element)}:function(){nR(t,e)})(),Ha(r,e.shrinkingClass),La(r,e.growingClass),rR(t,e),Je(t.element,Z_(e),a),n.setExpanded(),e.onStartGrow(t)},cR=function(t,e,n){var r=Q_(t,e);return!0===Fa(r,e.growingClass)},sR=function(t,e,n){var r=Q_(t,e);return!0===Fa(r,e.shrinkingClass)},lR=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){an(t.element,Z_(e));var r=tR(e,t.element);Je(t.element,Z_(e),r)}},grow:function(t,e,n){n.isExpanded()||uR(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&aR(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&oR(t,e,n)},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:cR,isShrinking:sR,isTransitioning:function(t,e,n){return cR(t,e)||sR(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?aR:uR)(t,e,n)},disableTransitions:eR}),fR=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return Sa(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:To(e.dimension.property,"0px")})},events:function(t,e){return zi([qi(Zo(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(eR(n,t),e.isExpanded()&&an(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),dR=[Xr("closedClass"),Xr("openClass"),Xr("shrinkingClass"),Xr("growingClass"),oo("getAnimationRoot"),_u("onShrunk"),_u("onStartShrink"),_u("onGrown"),_u("onStartGrow"),fo("expanded",!1),Yr("dimension",qr("property",{width:[Du("property","width"),Du("getDimension",(function(t){return bn(t)+"px"}))],height:[Du("property","height"),Du("getDimension",(function(t){return ln(t)+"px"}))]}))],mR=Sc({fields:dR,name:"sliding",active:fR,apis:lR,state:Object.freeze({__proto__:null,init:function(t){var e=xo(t.expanded);return xa({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:w(e.set,!1),setExpanded:w(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),gR="container",hR=[Ef("slotBehaviours",[])],pR=function(t){return"<alloy.field."+t+">"},vR=function(t,e){var n,r=function(e){return wd(t)},o=function(e,n){return function(r,o){return pd(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==qe(t.element,"aria-hidden")},a=o(i,!1),u=o((function(t,e){if(i(t)){var n=t.element;Je(n,"display","none"),We(n,"aria-hidden","true"),Ni(t,ki(),{name:e,visible:!1})}})),c=(n=u,function(t,e){W(e,(function(e){return n(t,e)}))}),s=o((function(t,e){if(!i(t)){var n=t.element;an(n,"display"),Ke(n,"aria-hidden"),Ni(t,ki(),{name:e,visible:!0})}})),l={getSlotNames:r,getSlot:function(e,n){return pd(e,t,n)},isShowing:a,hideSlot:u,hideAllSlots:function(t){return c(t,r())},showSlot:s};return{uid:t.uid,dom:t.dom,components:e,behaviours:_f(t.slotBehaviours),apis:l}},bR=mt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return ya(t)})),yR=O(O({},bR),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),fd(gR,pR(e),n)},record:v(t)}}(),n=t(e),r=e.record(),o=U(r,(function(t){return nd({name:t,pname:pR(t)})}));return Od(gR,hR,o,vR,n)}}),wR=kr([uo("icon"),uo("tooltip"),bo("onShow",h),bo("onHide",h),bo("onSetup",(function(){return h}))]),xR=function(t){return{element:function(){return t.element.dom}}},CR=function(t,e){var n=U(lt(e),(function(t){var n=e[t],r=jr(function(t){return Vr("sidebar",wR,t)}(n));return{name:t,getApi:xR,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return U(n,(function(e){var r=xo(h);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:ib([Jb(e,r),Qb(e,r),Ii(ki(),(function(t,e){var r=e.event;X(n,(function(t){return t.name===r.name})).each((function(e){(r.visible?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},SR=function(t){return yR.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:CR(e,t),slotBehaviours:ib([$i((function(t){return yR.hideAllSlots(t)}))])}}))},kR=function(t){return zd.getCurrent(t).bind((function(t){return mR.isGrowing(t)||mR.hasGrown(t)?zd.getCurrent(t).bind((function(t){return X(yR.getSlotNames(t),(function(e){return yR.isShowing(t,e)}))})):B.none()}))},TR=oa("FixSizeEvent"),OR=oa("AutoSizeEvent"),ER=Object.freeze({__proto__:null,block:function(t,e,n,r){We(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=xc([eh.config({mode:"special",onTab:function(){return B.some(!0)},onShiftTab:function(){return B.some(!0)}}),dh.config({})]),a=r(o,i),u=o.getSystem().build(a);ah.append(o,nu(u)),u.hasConfigured(eh)&&e.focus&&eh.focusIn(u),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return ah.remove(o,u)}))},unblock:function(t,e,n){Ke(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),_R=[bo("getRoot",B.none),vo("focus",!0),_u("onBlock"),_u("onUnblock")],RR=Sc({fields:_R,name:"blocking",apis:ER,state:Object.freeze({__proto__:null,init:function(){var t=Jc((function(t){return t.destroy()}));return xa({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),NR=function(t){var e=Bt.fromHtml(t),n=_e(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return K(e,(function(t,e){var n;return"class"===e.name?t:O(O({},t),((n={})[e.name]=e.value,n))}),{})}(e),o=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(e),i=0===n.length?{}:{innerHtml:Yi(e)};return O({tag:Pt(e),classes:o,attributes:r},i)},AR=function(t){return zd.getCurrent(t).each((function(t){return Nc(t.element)}))},DR=function(t,e,n,r){var o=e.element;if(function(t,e){var n="tabindex",r="data-mce-tabindex";B.from(t.iframeElement).map(Bt.fromDom).each((function(t){e?($e(t,n).each((function(e){return We(t,r,e)})),We(t,n,-1)):(Ke(t,n),$e(t,r).each((function(e){We(t,n,e),Ke(t,r)})))}))}(t,n),n)RR.block(e,function(t){return function(e,n){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:NR('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}}(r)),an(o,"display"),Ke(o,"aria-hidden"),t.hasFocus()&&AR(e);else{var i=zd.getCurrent(e).exists((function(t){return Ac(t.element)}));RR.unblock(e),Je(o,"display","none"),We(o,"aria-hidden","true"),i&&t.focus()}},MR=function(t,e,n){var r=xo(!1),o=Zc(),i=function(n){var o;!r.get()||function(t){return"focusin"===t.type}(o=n)&&(o.composed?at(o.composedPath()):B.from(o.target)).map(Bt.fromDom).filter(It).exists((function(t){return Fa(t,"mce-pastebin")}))||(n.preventDefault(),AR(e()),t.editorManager.setActive(t))};t.inline||t.on("PreInit",(function(){t.dom.bind(t.getWin(),"focusin",i),t.on("BeforeExecCommand",(function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&i(t)}))}));var a=function(o){o!==r.get()&&(r.set(o),DR(t,e(),o,n.providers),t.fire("AfterProgressState",{state:o}))};t.on("ProgressState",(function(e){if(o.on(hp.clearTimeout),m(e.time)){var n=hp.setEditorTimeout(t,(function(){return a(e.state)}),e.time);o.set(n)}else a(e.state),o.clear()}))},BR=function(t,e,n){return{within:t,extra:e,withinWidth:n}},zR=function(t,e,n){var r,o=(r=function(t,e){var r=n(t);return B.some({element:t,start:e,finish:e+r,width:r})},K(t,(function(t,e){return r(e,t.len).fold(v(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),{len:0,list:[]}).list),i=$(o,(function(t){return t.finish<=e})),a=G(i,(function(t,e){return t+e.width}),0);return{within:i,extra:o.slice(i.length),withinWidth:a}},PR=function(t){return U(t,(function(t){return t.element}))},LR=function(t,e,n,r){var o=function(t,e,n){var r=zR(e,t,n);return 0===r.extra.length?B.some(r):B.none()}(t,e,n).getOrThunk((function(){return zR(e,t-n(r),n)})),i=o.within,a=o.extra,u=o.withinWidth;return 1===a.length&&a[0].width<=n(r)?function(t,e,n){var r=PR(t.concat(e));return BR(r,[],n)}(i,a,u):a.length>=1?function(t,e,n,r){var o=PR(t).concat([n]);return BR(o,PR(e),r)}(i,a,r,u):function(t,e,n){return BR(PR(t),[],n)}(i,0,u)},IR=function(t,e){var n=U(e,(function(t){return nu(t)}));f_.setGroups(t,n)},HR=function(t,e,n){var r=e.builtGroups.get();if(0!==r.length){var o=vd(t,e,"primary"),i=Vx.getCoupled(t,"overflowGroup");Je(o.element,"visibility","hidden");var a=r.concat([i]),u=st(a,(function(t){return Mc(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}));n([]),IR(o,a);var c=bn(o.element),s=LR(c,e.builtGroups.get(),(function(t){return bn(t.element)}),i);0===s.extra.length?(ah.remove(o,i),n([])):(IR(o,s.within),n(s.extra)),an(o.element,"visibility"),un(o.element),u.each(dh.focus)}},FR=v([Ef("splitToolbarBehaviours",[Vx]),Gr("builtGroups",(function(){return xo([])}))]),VR=v([Ou(["overflowToggledClass"]),co("getOverflowBounds"),Xr("lazySink"),Gr("overflowGroups",(function(){return xo([])}))].concat(FR())),jR=v([nd({factory:f_,schema:s_(),name:"primary"}),rd({schema:s_(),name:"overflow"}),rd({name:"overflow-button"}),rd({name:"overflow-group"})]),UR=v((function(t,e){!function(t,e){var n=vn.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Je(t,"max-width",n+"px")}(t,Math.floor(e))})),WR=v([Ou(["toggledClass"]),Xr("lazySink"),to("fetch"),co("getBounds"),lo("fireDismissalEventInstead",[fo("event",xi())]),Ts()]),qR=v([rd({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:xc([kh.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),rd({factory:f_,schema:s_(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:xc([eh.config({mode:"cyclic",onEscape:function(e){return pd(e,t,"button").each(dh.focus),B.none()}})])}}})]),$R=function(t,e){var n=Vx.getCoupled(t,"toolbarSandbox");af.isOpen(n)?af.close(n):af.open(n,e.toolbar())},GR=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Ll.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:UR()}}},o)},KR=function(t,e,n,r,o){f_.setGroups(e,o),GR(t,e,n,r),kh.on(t)},XR=Ad({name:"FloatingToolbarButton",factory:function(t,e,n,r){return O(O({},pp.sketch(O(O({},r.button()),{action:function(t){$R(t,r)},buttonBehaviours:Af({dump:r.button().buttonBehaviours},[Vx.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=du();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:xc([eh.config({mode:"special",onEscape:function(t){return af.close(t),B.some(!0)}}),af.config({onOpen:function(o,i){n.fetch().get((function(o){KR(t,i,n,e.layouts,o),r.link(t.element),eh.focusIn(i)}))},onClose:function(){kh.off(t),dh.focus(t),r.unlink(t.element)},isPartOf:function(e,n,r){return gu(n,r)||gu(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),Ec.config({channels:O(O({},ff(O({isExtraPart:S},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),mf({doReposition:function(){af.getState(Vx.getCoupled(t,"toolbarSandbox")).each((function(r){GR(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){af.getState(Vx.getCoupled(e,"toolbarSandbox")).each((function(o){KR(e,o,t,n.layouts,r)}))},reposition:function(e){af.getState(Vx.getCoupled(e,"toolbarSandbox")).each((function(r){GR(e,r,t,n.layouts)}))},toggle:function(t){$R(t,r)},getToolbar:function(t){return af.getState(Vx.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return af.isOpen(Vx.getCoupled(t,"toolbarSandbox"))}}})},configFields:WR(),partFields:qR(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),YR=v([Xr("items"),Ou(["itemSelector"]),Ef("tgroupBehaviours",[eh])]),JR=v([id({name:"items",unit:"item"})]),QR=Ad({name:"ToolbarGroup",configFields:YR(),partFields:JR(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.tgroupBehaviours,[eh.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),ZR=function(t){return U(t,(function(t){return nu(t)}))},tN=function(t,e,n){HR(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){XR.setGroups(t,ZR(r))}))}))},eN=Ad({name:"SplitFloatingToolbar",configFields:VR(),partFields:jR(),factory:function(t,e,n,r){var o=vp(XR.sketch({fetch:function(){return Ex((function(e){e(ZR(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[nc,ec]},onRtl:function(){return[ec,nc]},onBottomLtr:function(){return[oc,rc]},onBottomRtl:function(){return[rc,oc]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.splitToolbarBehaviours,[Vx.config({others:{overflowGroup:function(){return QR.sketch(O(O({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(U(n,e.getSystem().build)),tN(e,o,t)},refresh:function(e){return tN(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){XR.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(XR.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){XR.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(XR.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),nN=v([Ou(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),_u("onOpened"),_u("onClosed")].concat(FR())),rN=v([nd({factory:f_,schema:s_(),name:"primary"}),nd({factory:f_,schema:s_(),name:"overflow",overrides:function(t){return{toolbarBehaviours:xc([mR.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){pd(e,t,"overflow-button").each((function(t){kh.off(t),dh.focus(t)})),t.onClosed(e)},onGrown:function(e){eh.focusIn(e),t.onOpened(e)},onStartGrow:function(e){pd(e,t,"overflow-button").each(kh.on)}}),eh.config({mode:"acyclic",onEscape:function(e){return pd(e,t,"overflow-button").each(dh.focus),B.some(!0)}})])}}}),rd({name:"overflow-button",overrides:function(t){return{buttonBehaviours:xc([kh.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),rd({name:"overflow-group"})]),oN=function(t,e){pd(t,e,"overflow-button").bind((function(){return pd(t,e,"overflow")})).each((function(n){iN(t,e),mR.toggleGrow(n)}))},iN=function(t,e){pd(t,e,"overflow").each((function(n){HR(t,e,(function(t){var e=U(t,(function(t){return nu(t)}));f_.setGroups(n,e)})),pd(t,e,"overflow-button").each((function(t){mR.hasGrown(n)&&kh.on(t)})),mR.refresh(n)}))},aN=Ad({name:"SplitSlidingToolbar",configFields:nN(),partFields:rN(),factory:function(t,e,n,r){var o="alloy.toolbar.toggle";return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.splitToolbarBehaviours,[Vx.config({others:{overflowGroup:function(t){return QR.sketch(O(O({},r["overflow-group"]()),{items:[pp.sketch(O(O({},r["overflow-button"]()),{action:function(e){Ri(t,o)}}))]}))}}}),uh("toolbar-toggle-events",[Ii(o,(function(e){oN(e,t)}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=U(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),iN(e,t)},refresh:function(e){return iN(e,t)},toggle:function(e){return oN(e,t)},isOpen:function(e){return function(t,e){return pd(t,e,"overflow").map(mR.hasGrown).getOr(!1)}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),uN=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:O({tag:"div",classes:["tox-toolbar__group"]},e),components:[QR.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:xc([Qw.config({}),dh.config({})])}},cN=function(t){return QR.sketch(uN(t))},sN=function(t,e){var n=$i((function(e){var n=U(t.initGroups,cN);f_.setGroups(e,n)}));return xc([Xb(t.providers.isDisabled),qb(),eh.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),uh("toolbar-events",[n])])},lN=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":uN({title:B.none(),items:[]}),"overflow-button":UT({name:"more",icon:B.some("more-drawer"),disabled:!1,tooltip:B.some("More..."),primary:!1,borderless:!1},B.none(),t.providers)},splitToolbarBehaviours:sN(t,e)}},fN=function(t){var e=lN(t),n=eN.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return eN.sketch(O(O({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=Fn(e),r=ke(e),o=Fn(r),i=Math.max(r.dom.scrollHeight,o.height);return In(n.x+4,o.y,n.width-8,i)},parts:O(O({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},dN=function(t){var e=aN.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=aN.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=lN(t);return aN.sketch(O(O({},r),{components:[e,n],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([P_()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([P_()],{type:"closed"})}}))},mN=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return f_.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===gv.scrolling?["tox-toolbar--scrolling"]:[])},components:[f_.parts.groups({})],toolbarBehaviours:sN(t,e)})},gN=r_.optional({factory:J_,name:"menubar",schema:[Xr("backstage")]}),hN=r_.optional({factory:{sketch:function(t){return c_.sketch({uid:t.uid,dom:t.dom,listBehaviours:xc([eh.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return mN({type:t.type,uid:oa("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),B.some(!0)}})},setupItem:function(t,e,n,r){f_.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Xr("dom"),Xr("onEscape")]}),pN=r_.optional({factory:{sketch:function(t){return function(t){return t.type===gv.sliding?dN:t.type===gv.floating?fN:mN}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),B.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[Xr("dom"),Xr("onEscape"),Xr("getSink")]}),vN=r_.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?W_:g_;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:xc(n(e,t.sharedBackstage))}}},name:"header",schema:[Xr("dom")]}),bN=r_.optional({name:"socket",schema:[Xr("dom")]}),yN=r_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:xc([Qw.config({}),dh.config({}),mR.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){zd.getCurrent(t).each(yR.hideAllSlots),Ri(t,OR)},onGrown:function(t){Ri(t,OR)},onStartGrow:function(t){Ni(t,TR,{width:nn(t.element,"width").getOr("")})},onStartShrink:function(t){Ni(t,TR,{width:bn(t.element)+"px"})}}),ah.config({}),zd.config({find:function(t){var e=ah.contents(t);return at(e)}})])}],behaviours:xc([hk(0),uh("sidebar-sliding-events",[Ii(TR,(function(t,e){Je(t.element,"width",e.event.width)})),Ii(OR,(function(t,e){an(t.element,"width")}))])])}}},name:"sidebar",schema:[Xr("dom")]}),wN=r_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:xc([ah.config({}),RR.config({focus:!1}),zd.config({find:function(t){return at(t.components())}})]),components:[]}}},name:"throbber",schema:[Xr("dom")]}),xN=Ad({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return n_.getPart(e,t,"socket")},setSidebar:function(e,n){n_.getPart(e,t,"sidebar").each((function(t){return function(t,e){zd.getCurrent(t).each((function(t){return ah.set(t,[SR(e)])}))}(t,n)}))},toggleSidebar:function(e,n){n_.getPart(e,t,"sidebar").each((function(t){return function(t,e){zd.getCurrent(t).each((function(t){zd.getCurrent(t).each((function(n){mR.hasGrown(t)?yR.isShowing(n,e)?mR.shrink(t):(yR.hideAllSlots(n),yR.showSlot(n,e)):(yR.hideAllSlots(n),yR.showSlot(n,e),mR.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return n_.getPart(e,t,"sidebar").bind(kR).getOrNull()},getHeader:function(e){return n_.getPart(e,t,"header")},getToolbar:function(e){return n_.getPart(e,t,"toolbar")},setToolbar:function(e,n){n_.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){n_.getPart(e,t,"multiple-toolbar").each((function(t){c_.setItems(t,n)}))},refreshToolbar:function(e){n_.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){n_.getPart(e,t,"toolbar").each((function(t){var e,n;e=t.getApis().toggle,n=function(e){return e(t)},null!=e?B.some(n(e)):B.none()}))},isToolbarDrawerToggled:function(e){return n_.getPart(e,t,"toolbar").bind((function(t){return B.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return n_.getPart(e,t,"throbber")},focusToolbar:function(e){n_.getPart(e,t,"toolbar").orThunk((function(){return n_.getPart(e,t,"multiple-toolbar")})).each((function(t){eh.focusIn(t)}))},setMenubar:function(e,n){n_.getPart(e,t,"menubar").each((function(t){J_.setMenus(t,n)}))},focusMenubar:function(e){n_.getPart(e,t,"menubar").each((function(t){J_.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[Xr("dom"),Xr("behaviours")],partFields:[vN,gN,pN,hN,bN,yN,wN],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=U(n,(function(t){return cN(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=U(n,(function(t){return U(t,cN)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),CN={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},SN=function(t){return"string"==typeof t?t.split(" "):t},kN=function(t,e){var n=O(O({},CN),e.menus),r=lt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?SN("file edit view insert format tools table help"):SN(!1===e.menubar?"":e.menubar),i=$(o,(function(t){var n=wt(CN,t);return r?n||yt(e.menus,t).exists((function(t){return wt(t,"items")})):n})),a=U(i,(function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return Q(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||F(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:SN(o.items)},e,t)}));return $(a,(function(t){return t.getItems().length>0&&F(t.getItems(),(function(t){return"separator"!==t.type}))}))},TN=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},ON=function(t,e,n){return new Up((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},EN=function(t,e){return ON(t,e+"/skin.min.css",t.ui.styleSheetLoader)},_N=function(t,e){var n;return(n=Bt.fromDom(t.getElement()),Le(n).isSome())?ON(t,e+"/skin.shadowdom.min.css",gb.DOM.styleSheetLoader):Up.resolve()},RN=function(t,e){var n=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):hb.baseURL+"/skins/ui/"+r}return n}(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===function(t){return!1===t.getParam("skin")}(e)&&o(n)?Up.all([EN(e,n),_N(e,n)]).then(TN(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:e})}}(e,"Skin could not be loaded")):TN(e)()},NN=w(RN,!1),AN=w(RN,!0),DN=function(t,e){return function(n){var r=Qc(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.once("init",o),function(){t.off("init",o),r.clear()}}},MN=function(t,e,n){return function(r){var o=function(){return n(r)},i=function(){n(r),t.on(e,o)};return t.initialized?i():t.once("init",i),function(){t.off("init",i),t.off(e,o)}}},BN=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},zN=function(t,e){return function(){return t.execCommand(e)}},PN=function(t,e,n){var r=function(t,r,i,a){var u=e.shared.providers.translate(t.title);if("separator"===t.type)return B.some({type:"separator",text:u});if("submenu"===t.type){var c=Q(t.getStyleItems(),(function(t){return o(t,r,a)}));return 0===r&&c.length<=0?B.none():B.some({type:"nestedmenuitem",text:u,disabled:c.length<=0,getSubmenuItems:function(){return Q(t.getStyleItems(),(function(t){return o(t,r,a)}))}})}return B.some(O({type:"togglemenuitem",text:u,icon:t.icon,active:t.isSelected(a),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return Q(t,(function(t){return o(t,r,e)}))};return{validateItems:i,getFetch:function(t,e){return function(n,r){var o=e(),a=i(o);r(IT(a,hv.CLOSE_ON_EXECUTE,t,!1))}}}},LN=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return U(r.data,(function(t){return TE(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:PN(0,e,n),getStyleItems:o}},IN=function(t,e,n){var r=LN(0,e,n),o=r.items,i=r.getStyleItems,a=MN(t,"NodeChange",(function(t){var e=t.getComponent();n.updateText(e)}));return DT({text:n.icon.isSome()?B.none():n.text,icon:n.icon,tooltip:B.from(n.tooltip),role:B.none(),fetch:o.getFetch(e,i),onSetup:a,getApi:function(t){return{getComponent:v(t)}},columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(CO||(CO={}));var HN,FN,VN,jN,UN,WN=function(t,e,n,r){return{type:"basic",data:function(t){return U(t,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}}))}(function(t,e){return e===CO.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r))}},qN=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],$N=function(t){var e={type:"basic",data:qN};return{tooltip:"Align",text:B.none(),icon:B.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:B.none,getPreviewFor:function(t){return B.none},onAction:function(e){return function(){return X(qN,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},updateText:function(e){var n=X(qN,(function(e){return t.formatter.match(e.format)})).fold(v("left"),(function(t){return t.title.toLowerCase()}));Ni(e,AT,{icon:"align-"+n})},dataset:e,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},GN=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],KN=function(t){var e=t.split(/\s*,\s*/);return U(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},XN=function(t){var e="System Font",n=function(){var n=function(t){return t?KN(t)[0]:""},o=t.queryCommandValue("FontName"),i=r.data,a=o?o.toLowerCase():"";return{matchOpt:X(i,(function(t){var e=t.format;return e.toLowerCase()===a||n(e).toLowerCase()===n(a).toLowerCase()})).orThunk((function(){return Tt(function(t){var e;return 0===t.indexOf("-apple-system")&&(e=KN(t.toLowerCase()),Z(GN,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(a),{title:e,format:a})})),font:o}},r=WN(t,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",CO.SemiColon);return{tooltip:"Fonts",text:B.some(e),icon:B.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getCurrentValue:function(){return n().matchOpt},getPreviewFor:function(t){return function(){return B.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},updateText:function(t){var e=n(),r=e.matchOpt,o=e.font,i=r.fold(v(o),(function(t){return t.title}));Ni(t,NT,{text:i})},dataset:r,shouldHide:!1,isInvalid:S}},YN={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},JN={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},QN=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":yt(JN,t).getOr(t)},ZN=function(t){var e=function(){var e=B.none(),n=r.data,o=t.queryCommandValue("FontSize");if(o)for(var i=function(t){var r=QN(o,t),i=function(t){return yt(YN,t).getOr("")}(r);e=X(n,(function(t){return t.format===o||t.format===r||t.format===i}))},a=3;e.isNone()&&a>=0;a--)i(a);return{matchOpt:e,size:o}},n=v(B.none),r=WN(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",CO.Space);return{tooltip:"Font sizes",text:B.some("12pt"),icon:B.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},updateText:function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold(v(o),(function(t){return t.title}));Ni(t,NT,{text:i})},dataset:r,shouldHide:!1,isInvalid:S}},tA=function(t,e){var n=e(),r=U(n,(function(t){return t.format}));return B.from(t.formatter.closest(r)).bind((function(t){return X(n,(function(e){return e.format===t}))})).orThunk((function(){return Tt(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},eA=function(t){var e="Paragraph",n=WN(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",CO.SemiColon);return{tooltip:"Blocks",text:B.some(e),icon:B.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:B.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return B.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:BN(t),updateText:function(r){var o=tA(t,(function(){return n.data})).fold(v(e),(function(t){return t.title}));Ni(r,NT,{text:o})},dataset:n,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},nA=function(t,e){var n="Paragraph";return{tooltip:"Formats",text:B.some(n),icon:B.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:B.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?B.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):B.none()}},onAction:BN(t),updateText:function(e){var r=function(t){var e=t.items;return void 0!==e&&e.length>0?Q(e,r):[{title:t.title,format:t.format}]},o=Q(kE(t),r),i=tA(t,v(o)).fold(v(n),(function(t){return t.title}));Ni(e,NT,{text:i})},shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},rA=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=U(o,n.getSystem().build);Vl(n,i)}))};return zi([Ii(ui(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;H(o.channels,i)&&n(e,o.data)}})),$i((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),oA=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),iA=[Xr("channel"),oo("renderComponents"),oo("updateState"),oo("initialData")],aA=Object.freeze({__proto__:null,init:function(){var t=xo(B.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(B.none())}}}}),uA=Sc({fields:iA,name:"reflecting",active:rA,apis:oA,state:aA}),cA=v([Xr("toggleClass"),Xr("fetch"),Nu("onExecute"),fo("getHotspot",B.some),fo("getAnchorOverrides",v({})),Ts(),Nu("onItemExecute"),oo("lazySink"),Xr("dom"),_u("onOpen"),Ef("splitDropdownBehaviours",[Vx,eh,dh]),fo("matchWidth",!1),fo("useMinWidth",!1),fo("eventOrder",{}),oo("role")].concat(nC())),sA=nd({factory:pp,schema:[Xr("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:xc([dh.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(Ai)},buttonBehaviours:xc([kh.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),lA=nd({factory:pp,schema:[Xr("dom")],name:"button",defaults:function(){return{buttonBehaviours:xc([dh.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),fA=v([sA,lA,od({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Xr("text")],name:"aria-descriptor"}),rd({schema:[Tu()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),Ux()]),dA=Ad({name:"SplitDropdown",configFields:cA(),partFields:fA(),factory:function(t,e,n,r){var o,i=function(t){zd.getCurrent(t).each((function(t){am.highlightFirst(t),eh.focusIn(t)}))},a=function(e){Yx(t,b,e,r,i,xx.HighlightFirst).get(h)},u=function(e){var n=vd(e,t,"button");return Ai(n),B.some(!0)},c=O(O({},zi([$i((function(e,n){pd(e,t,"aria-descriptor").each((function(t){var n=oa("aria");We(t.element,"id",n),We(e.element,"aria-describedby",n)}))}))])),Oh(B.some(a))),s={repositionMenus:function(t){kh.isOn(t)&&eC(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:s,eventOrder:O(O({},t.eventOrder),(o={},o[ci()]=["disabling","toggling","alloy.base.behaviour"],o)),events:c,behaviours:Rf(t.splitDropdownBehaviours,[Vx.config({others:{sandbox:function(e){var n=vd(e,t,"arrow");return tC(t,e,{onOpen:function(){kh.on(n),kh.on(e)},onClose:function(){kh.off(n),kh.off(e)}})}}}),eh.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return a(t),B.some(!0)}}),dh.config({}),kh.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),mA=function(t){return{isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)}}},gA=function(t){return{setActive:function(e){kh.set(t,e)},isActive:function(){return kh.isOn(t)},isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)}}},hA=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},pA=oa("focus-button"),vA=function(t,e,n,r,o,i){var a;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:hA(n,i)},components:ey([t.map((function(t){return TT(t,i.icons)})),e.map((function(t){return ET(t,"tox-tbtn",i)}))]),eventOrder:(a={},a[Fo()]=["focusing","alloy.base.behaviour","common-button-display-events"],a),buttonBehaviours:xc([Xb(i.isDisabled),qb(),uh("common-button-display-events",[Ii(Fo(),(function(t,e){e.event.prevent(),Ri(t,pA)}))])].concat(r.map((function(n){return uA.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return ey([t.icon.map((function(t){return TT(t,i.icons)})),t.text.map((function(t){return ET(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},bA=function(t,e,n){var r,o=xo(h),i=vA(t.icon,t.text,t.tooltip,B.none(),B.none(),n);return pp.sketch({dom:i.dom,components:i.components,eventOrder:RT,buttonBehaviours:xc([uh("toolbar-button-events",[(r={onAction:t.onAction,getApi:e.getApi},Xi((function(t,e){Yb(r,t)((function(e){Ni(t,_T,{buttonApi:e}),r.onAction(e)}))}))),Jb(e,o),Qb(e,o)]),Xb((function(){return t.disabled||n.isDisabled()})),qb()].concat(e.toolbarButtonBehaviours))})},yA=function(t,e,n){return bA(t,{toolbarButtonBehaviours:[].concat(n.length>0?[uh("toolbarButtonWith",n)]:[]),getApi:mA,onSetup:t.onSetup},e)},wA=function(t,e,n){return ur(bA(t,{toolbarButtonBehaviours:[ah.config({}),kh.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[uh("toolbarToggleButtonWith",n)]:[]),getApi:gA,onSetup:t.onSetup},e))},xA=function(t,e,n){return function(r){return Ex((function(t){return e.fetch(t)})).map((function(o){return B.from(Rw(ur(sw(oa("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,hv.CLOSE_ON_EXECUTE,e.select.getOr(S),n),{movement:fw(e.columns,e.presets),menuBehaviours:ib("auto"!==e.columns?[]:[$i((function(t,n){rb(t,4,Ev(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;eh.setGridSize(t,n,r)}))}))])})))}))}},CA=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],SA=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return Wr(t)})).getOrDie();return e(i,r,o)}},kA={button:SA(ev,(function(t,e){return n=t,r=e.backstage.shared.providers,yA(n,r,[]);var n,r})),togglebutton:SA(ov,(function(t,e){return n=t,r=e.backstage.shared.providers,wA(n,r,[]);var n,r})),menubutton:SA(X_,(function(t,e){return FT(t,"tox-tbtn",e.backstage,B.none())})),splitbutton:SA((function(t){return Vr("SplitButton",Y_,t)}),(function(t,e){return function(t,e){var n,r=oa("channel-update-split-dropdown-display"),o=function(t){return{isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)},setIconFill:function(e,n){lu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){We(t,"fill",n)}))},setIconStroke:function(e,n){lu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){We(t,"stroke",n)}))},setActive:function(e){We(t.element,"aria-pressed",e),lu(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return kh.set(t,e)}))}))},isActive:function(){return lu(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(kh.isOn)}))}}},i=xo(h),a={getApi:o,onSetup:t.onSetup};return dA.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:O({"aria-pressed":!1},hA(t.tooltip,e.providers))},onExecute:function(e){t.onAction(o(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:xc([Kb(e.providers.isDisabled),qb(),uh("split-dropdown-events",[Ii(pA,dh.focus),Jb(a,i),Qb(a,i)]),uC.config({})]),eventOrder:(n={},n[yi()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:xA(o,t,e.providers),parts:{menu:Mv(0,t.columns,t.presets)},components:[dA.parts.button(vA(t.icon,t.text,B.none(),B.some(r),B.some([kh.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),dA.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:kp("chevron-down",e.providers.icons)},buttonBehaviours:xc([Kb(e.providers.isDisabled),qb(),Tp()])}),dA.parts["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})}(t,e.backstage.shared)})),grouptoolbarbutton:SA((function(t){return Vr("GroupToolbarButton",$_,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[Ss]=e.backstage.shared.header.isPositionedAtTop()?Uc.TopToBottom:Uc.BottomToTop,r);switch(Eb(n)){case gv.floating:return function(t,e,n,r){var o=e.shared;return XR.sketch({lazySink:o.getSink,fetch:function(){return Ex((function(e){e(U(n(t.items),cN))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:vA(t.icon,t.text,t.tooltip,B.none(),B.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return _A(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,B.none())}),i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return function(t,e){var n=O({type:"advanced"},e.styleselect);return IN(t,e,nA(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return IN(t,e,ZN(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return IN(t,e,XN(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return IN(t,e,eA(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return IN(t,e,$N(t))}(t,e.backstage)}},TA={styleselect:kA.styleSelectButton,fontsizeselect:kA.fontsizeSelectButton,fontselect:kA.fontSelectButton,formatselect:kA.formatButton,align:kA.alignMenuButton},OA=function(t){var e,n=t.toolbar,r=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=U(CA,(function(e){var n=$(e.items,(function(e){return wt(t,e)||wt(TA,e)}));return{name:e.name,items:n}}));return $(e,(function(t){return t.items.length>0}))}(r):o(n)?(e=n.split("|"),U(e,(function(t){return{items:t.trim().split(" ")}}))):function(t){return g(t,(function(t){return wt(t,"name")&&wt(t,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},EA=function(t,e,n,r,o,i){return yt(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return st(t,(function(t){return yt(e,t+n.toLowerCase())}))}))})).fold((function(){return yt(TA,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return B.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return yt(kA,t.type).fold((function(){return console.error("skipping button defined by",t),B.none()}),(function(r){return B.some(r(t,e,n))}))}(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),B.none())}))},_A=function(t,e,n,r){var o=OA(e),i=U(o,(function(o){var i=Q(o.items,(function(o){return 0===o.trim().length?[]:EA(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:B.from(t.translate(o.name)),items:i}}));return $(i,(function(t){return t.items.length>0}))},RA=function(t,e,n,r){var i=e.outerContainer,a=n.toolbar,u=n.buttons;if(g(a,o)){var c=a.map((function(e){var o={toolbar:e,buttons:u,allowToolbarGroups:n.allowToolbarGroups};return _A(t,o,{backstage:r},B.none())}));xN.setToolbars(i,c)}else xN.setToolbar(i,_A(t,n,{backstage:r},B.none()))},NA=pe(),AA=NA.os.isiOS()&&NA.os.version.major<=12,DA=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=xo(0),a=e.outerContainer;NN(t);var c=Bt.fromDom(o.targetNode),s=Pe(ze(c));!function(t,e){Kl(t,e,kn)}(c,e.mothership),Gl(s,e.uiMothership),t.on("PostRender",(function(){RA(t,e,n,r),i.set(t.getWin().innerWidth),xN.setMenubar(a,kN(t,n)),xN.setSidebar(a,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=xo(mn(r.innerWidth,r.innerHeight)),a=xo(mn(o.offsetWidth,o.offsetHeight)),u=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(mn(r.innerWidth,r.innerHeight)),Fy(t))},c=function(){var e=t.getDoc().documentElement,n=a.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(a.set(mn(e.offsetWidth,e.offsetHeight)),Fy(t))},s=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};n.bind(r,"resize",u),n.bind(r,"scroll",s);var l=ns(Bt.fromDom(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){Je(f,"display","none")})),t.on("show",(function(){an(f,"display")})),t.on("NodeChange",c),t.on("remove",(function(){l.unbind(),n.unbind(r,"resize",u),n.unbind(r,"scroll",s),r=null}))}(t,e)}));var l,f,d,m=xN.getSocket(a).getOrDie("Could not find expected socket element");if(AA){Qe(m.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var g=(l=function(){t.fire("ScrollContent")},f=20,d=null,{cancel:function(){u(d)||(clearTimeout(d),d=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];u(d)&&(d=setTimeout((function(){d=null,l.apply(null,t)}),f))}}),h=es(m.element,"scroll",g.throttle);t.on("remove",h.unbind)}Wb(t,e),t.addCommand("ToggleSidebar",(function(e,n){xN.toggleSidebar(a,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return xN.whichSidebar(a)}));var p=Eb(t);p!==gv.sliding&&p!==gv.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var n=t.getWin().innerWidth;n!==i.get()&&(xN.refreshToolbar(e.outerContainer),i.set(n))}));var v={enable:function(){Ub(e,!1)},disable:function(){Ub(e,!0)},isDisabled:function(){return Xd.isDisabled(a)}};return{iframeContainer:m.element.dom,editorContainer:a.element.dom,api:v}}}),MA=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?B.some(parseInt(""+t,10)):B.none()},BA=function(t){return m(t)?t+"px":t},zA=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},PA=function(t){return function(t){var e=pb(t),n=yb(t),r=xb(t);return MA(e).map((function(t){return zA(t,n,r)}))}(t).getOr(pb(t))},LA=function(t){var e=vb(t),n=bb(t),r=wb(t);return MA(e).map((function(t){return zA(t,n,r)}))},IA=function(t,e,n,r,o){var i=n.uiMothership,a=n.outerContainer,u=gb.DOM,c=Mb(t),s=Pb(t),l=wb(t).or(LA(t)),f=r.shared.header,d=f.isPositionedAtTop,m=Eb(t),g=m===gv.sliding||m===gv.floating,h=xo(!1),p=function(){return h.get()&&!t.removed},b=function(t){return g?t.fold(v(0),(function(t){return t.components().length>1?ln(t.components()[1].element):0})):0},y=function(){i.broadcastOn([cf()],{})},w=function(t){if(void 0===t&&(t=!1),p()){var n;if(c||(n=l.getOrThunk((function(){var t=MA(tn(Ve(),"margin-left")).getOr(0);return bn(Ve())-hn(e).left+t})),Je(o.get().element,"max-width",n+"px")),g&&xN.refreshToolbar(a),c||function(){var t=xN.getToolbar(a),n=b(t),r=Hn(e),i=d()?Math.max(r.y-ln(o.get().element)+n,0):r.bottom;Qe(a.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),s){var r=o.get();t?z_.reset(r):z_.refresh(r)}y()}},x=function(n){if(void 0===n&&(n=!0),!c&&s&&p()){var r=f.getDockingMode(),i=function(n){switch(Nb(t)){case Ob.auto:var r=xN.getToolbar(a),o=b(r),i=ln(n.element)-o,u=Hn(e);if(u.y>i)return"top";var c=ke(e),s=Math.max(c.dom.scrollHeight,ln(c));return u.bottom<s-i||Vn().bottom<u.bottom-i?"bottom":"top";case Ob.bottom:return"bottom";case Ob.top:default:return"top"}}(o.get());i!==r&&(!function(t){var e=o.get();z_.setModes(e,[t]),f.setDockingMode(t);var n=d()?Uc.TopToBottom:Uc.BottomToTop;We(e.element,Ss,n)}(i),n&&w(!0))}};return{isVisible:p,isPositionedAtTop:d,show:function(){h.set(!0),Je(a.element,"display","flex"),u.addClass(t.getBody(),"mce-edit-focus"),an(i.element,"display"),x(!1),w()},hide:function(){h.set(!1),n.outerContainer&&(Je(a.element,"display","none"),u.removeClass(t.getBody(),"mce-edit-focus")),Je(i.element,"display","none")},update:w,updateMode:x,repositionPopups:y}},HA=function(t,e){var n=Hn(t);return{pos:e?n.y:n.bottom,bounds:n}},FA=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,a=e.uiMothership,u=e.outerContainer,c=xo(null),s=Bt.fromDom(o.targetNode),l=IA(t,s,e,r,c),f=function(t){return t.getParam("toolbar_persist",!1,"boolean")}(t);AN(t);var d=function(){if(c.get())l.show();else{c.set(xN.getHeader(u).getOrDie());var o=Bb(t);Gl(o,i),Gl(o,a),RA(t,e,n,r),xN.setMenubar(u,kN(t,n)),l.show(),function(t,e,n,r){var o=xo(HA(e,n.isPositionedAtTop())),i=function(r){var i=HA(e,n.isPositionedAtTop()),a=i.pos,u=i.bounds,c=o.get(),s=c.pos,l=c.bounds,f=u.height!==l.height||u.width!==l.width;o.set({pos:a,bounds:u}),f&&Fy(t,r),n.isVisible()&&(s!==a?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};r||(t.on("activate",n.show),t.on("deactivate",n.hide)),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){hp.requestAnimationFrame((function(){return i(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var a=Qc();a.set(ns(Bt.fromDom(t.getBody()),"load",i)),t.on("remove",(function(){a.clear()}))}(t,s,l,f),t.nodeChanged()}},m=function(){return hp.setEditorTimeout(t,d,0)};t.on("show",d),t.on("hide",l.hide),f||(t.on("focus",m),t.on("blur",l.hide)),t.on("init",(function(){(t.hasFocus()||f)&&m()})),Wb(t,e);var g={show:function(){l.show()},hide:function(){l.hide()},enable:function(){Ub(e,!1)},disable:function(){Ub(e,!0)},isDisabled:function(){return Xd.isDisabled(u)}};return{editorContainer:u.element.dom,api:g}}}),VA="contexttoolbar-hide",jA=function(t,e){return Ii(_T,(function(n,r){var o=function(t){return{hide:function(){return Ri(t,di())},getValue:function(){return Of.getValue(t)}}}(t.get(n));e.onAction(o,r.event.buttonApi)}))},UA=function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original;r.primary;var o=E(r,["primary"]),i=jr(ov(O(O({},o),{type:"togglebutton",onAction:h})));return wA(i,n.backstage.shared.providers,[jA(t,e)])}(t,e,r):function(t,e,n){var r=e.original;r.primary;var o=E(r,["primary"]),i=jr(ev(O(O({},o),{type:"button",onAction:h})));return yA(i,n.backstage.shared.providers,[jA(t,e)])}(t,e,r)},WA=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=vp(bx.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:xc([eh.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return Ai(t),!0}))},onLeft:function(t,e){return e.cut(),B.none()},onRight:function(t,e){return e.cut(),B.none()}})])})),o=function(t,e,n){var r=U(e,(function(e){return vp(UA(t,e,n))}));return{asSpecs:function(){return U(r,(function(t){return t.asSpec()}))},findPrimary:function(t){return st(e,(function(e,n){return e.primary?B.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(x(Xd.isDisabled)):B.none()}))}}}(r,t.commands,e);return[{title:B.none(),items:[r.asSpec()]},{title:B.none(),items:o.asSpecs()}]},qA=WA,$A=function(t,e,n){return void 0===n&&(n=.01),e.bottom-t.y>=n&&t.bottom-e.y>=n},GA=function(t){var e=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=Ae(Bt.fromDom(t.startContainer),t.startOffset).element;return(Ht(n)?Oe(n):B.some(n)).filter(It).map((function(t){return t.dom.getBoundingClientRect()})).getOr(e)}return e}(t.selection.getRng());if(t.inline){var n=An();return In(n.left+e.left,n.top+e.top,e.width,e.height)}var r=Fn(Bt.fromDom(t.getBody()));return In(r.x+e.left,r.y+e.top,e.width,e.height)},KA=function(t,e,n,r){void 0===r&&(r=0);var o=Bn(window),i=Hn(Bt.fromDom(t.getContentAreaContainer())),a=Cb(t)||Sb(t)||Tb(t),u=function(t,e,n){var r=Math.max(t.x+n,e.x);return{x:r,width:Math.min(t.right-n,e.right)-r}}(i,o,r),c=u.x,s=u.width;if(t.inline&&!a)return In(c,o.y,s,o.height);var l=function(t,e,n,r,o,i){var a=Bt.fromDom(t.getContainer()),u=lu(a,".tox-editor-header").getOr(a),c=Hn(u),s=c.y>=e.bottom,l=r&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(t.inline&&!l)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var f="line"===o?Hn(a):e;return l?{y:Math.max(c.bottom+i,n.y),bottom:Math.min(f.bottom-i,n.bottom)}:{y:Math.max(f.y+i,n.y),bottom:Math.min(c.y-i,n.bottom)}}(t,i,o,e.header.isPositionedAtTop(),n,r),f=l.y,d=l.bottom;return In(c,f,s,d-f)},XA={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},YA={maxHeightFunction:gs(),maxWidthFunction:UR()},JA=function(t){return"node"===t},QA=function(t,e,n,r,o){var i=GA(t),a=r.lastElement().exists((function(t){return ye(n,t)}));return function(t,e){var n=t.selection.getRng(),r=Ae(Bt.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&ye(r.element,e)}(t,n)?a?dp:up:a?function(t,e,n){var r=nn(t,"position");Je(t,"position",e);var o=n(t);return r.each((function(e){return Je(t,"position",e)})),o}(e,r.getMode(),(function(){return $A(i,Hn(e))&&!r.isReposition()?gp:dp})):("fixed"===r.getMode()?o.y+An().top:o.y)+(ln(e)+12)<=i.y?up:cp},ZA=function(t,e,n,r){var o=function(e){return function(r,o,i,a,u){var c=QA(t,a,e,n,u),s=O(O({},r),{y:u.y,height:u.height});return O(O({},c(s,o,i,a,u)),{alwaysFit:!0})}},i=function(t){return JA(r)?[o(t)]:[]};return e?{onLtr:function(t){return[ac,ec,nc,rc,oc,ic].concat(i(t))},onRtl:function(t){return[ac,nc,ec,oc,rc,ic].concat(i(t))}}:{onLtr:function(t){return[ic,ac,rc,ec,oc,nc].concat(i(t))},onRtl:function(t){return[ic,ac,oc,nc,rc,ec].concat(i(t))}}},tD=function(t,e){var n=$(e,(function(e){return e.predicate(t.dom)})),r=q(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},eD=function(t,e,n){var r=tD(t,e);if(r.contextForms.length>0)return B.some({elem:t,toolbars:[r.contextForms[0]]});var o=tD(t,n);if(o.contextForms.length>0)return B.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return F(t,(function(t){return t.position===e}))},n=function(e){return $(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),a=U(n("selection"),(function(t){return O(O({},t),{position:"node"})}));return i.concat(a)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return B.some({elem:t,toolbars:i})}return B.none()},nD=function(t,e,n){return t(e)?B.none():Ro(e,(function(t){if(It(t)){var e=tD(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return X(t,(function(t){return t.position===e}))};return e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position})).fold((function(){return[]}),(function(e){return $(t,(function(t){return t.position===e}))}))}(r);return i.length>0?B.some({elem:t,toolbars:i}):B.none()}return B.none()}),t)},rD=function(t,e){var n={},r=[],o=[],i={},a={},u=function(t,u){var c=jr(Vr("ContextForm",fv,u));n[t]=c,c.launch.map((function(n){i["form:"+t]=O(O({},u.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),a[t]=c},c=function(t,e){var n;(n=e,Vr("ContextToolbar",dv,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),a[t]=n}))},s=lt(t);return W(s,(function(e){var n=t[e];"contextform"===n.type?u(e,n):"contexttoolbar"===n.type&&c(e,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:a,formNavigators:i}},oD=oa("forward-slide"),iD=oa("backward-slide"),aD=oa("change-slide-event"),uD="tox-pop--resizing",cD="tox-pop--transition",sD=function(t,e,n,r){var o,i,a=r.backstage,u=a.shared,c=pe().deviceType.isTouch,s=Zc(),l=Zc(),f=Zc(),d=eu((o={sink:n,onEscape:function(){return t.focus(),B.some(!0)}},i=xo([]),Xh.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),Xh.getContent(t).each((function(t){an(t.element,"visibility")})),Ha(t.element,uD),an(t.element,"width")},inlineBehaviours:xc([uh("context-toolbar-events",[qi(Zo(),(function(t,e){"width"===e.event.raw.propertyName&&(Ha(t.element,uD),an(t.element,"width"))})),Ii(aD,(function(t,e){var n=t.element;an(n,"width");var r=bn(n);Xh.setContent(t,e.event.contents),La(n,uD);var o=bn(n);Je(n,"width",r+"px"),Xh.getContent(t).each((function(t){e.event.focus.bind((function(t){return Nc(t),Mc(n)})).orThunk((function(){return eh.focusIn(t),Dc(ze(n))}))})),hp.setTimeout((function(){Je(t.element,"width",o+"px")}),0)})),Ii(oD,(function(t,e){Xh.getContent(t).each((function(e){i.set(i.get().concat([{bar:e,focus:Dc(ze(t.element))}]))})),Ni(t,aD,{contents:e.event.forwardContents,focus:B.none()})})),Ii(iD,(function(t,e){ut(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),Ni(t,aD,{contents:nu(e.bar),focus:e.focus})}))}))]),eh.config({mode:"special",onEscape:function(t){return ut(i.get()).fold((function(){return o.onEscape()}),(function(e){return Ri(t,iD),B.some(!0)}))}})]),lazySink:function(){return Wn.value(o.sink)}}))),m=function(){var e=f.get().getOr("node"),n=JA(e)?1:0;return KA(t,u,e,n)},g=function(){return!(t.removed||c()&&a.isContextMenuOpen())},p=function(){if(g()){var e=m(),n=Ct(f.get(),"node")?function(t,e){return e.filter(Fe).map(Fn).getOrThunk((function(){return GA(t)}))}(t,s.get()):GA(t);return e.height<=0||!$A(n,e)}return!0},v=function(){s.clear(),l.clear(),f.clear(),Xh.hide(d)},b=function(){if(Xh.isOpen(d)){var t=d.element;an(t,"display"),p()?Je(t,"display","none"):(l.set(0),Xh.reposition(d))}},y=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:xc([eh.config({mode:"acyclic"}),uh("pop-dialog-wrap-events",[$i((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return eh.focusIn(e)}))})),Gi((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},w=jt((function(){return rD(e,(function(t){var e=x([t]);Ni(d,oD,{forwardContents:y(e)})}))})),x=function(e){var n=t.ui.registry.getAll().buttons,o=w(),i=O(O({},n),o.formNavigators),a=Eb(t)===gv.scrolling?gv.scrolling:gv.default,c=J(U(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return _A(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,B.some(["form:"]))}(i,e):function(t,e){return qA(t,e)}(e,u.providers)})));return mN({type:a,uid:oa("context-toolbar"),initGroups:c,onEscape:B.none,cyclicKeying:!0,providers:u.providers})},C=function(e,r){var o="node"===e?u.anchors.node(r):u.anchors.cursor(),i=function(t,e,n,r){return"line"===e?{bubble:bs(12,0,XA),layouts:{onLtr:function(){return[uc]},onRtl:function(){return[cc]}},overrides:YA}:{bubble:bs(0,12,XA,1/12),layouts:ZA(t,n,r,e),overrides:YA}}(t,e,c(),{lastElement:s.get,isReposition:function(){return Ct(l.get(),0)},getMode:function(){return Ll.getMode(n)}});return ur(o,i)},S=function(t,e){if(k.cancel(),g()){var r=x(t),o=t[0].position,i=C(o,e);f.set(o),l.set(1);var a=d.element;an(a,"display"),function(t){return Ct(kt(t,s.get(),ye),!0)}(e)||(Ha(a,cD),Ll.reset(n,d)),Xh.showWithinBounds(d,y(r),{anchor:i,transition:{classes:[cD],mode:"placement"}},(function(){return B.some(m())})),e.fold(s.clear,s.set),p()&&Je(a,"display","none")}},k=Dp((function(){t.hasFocus()&&!t.removed&&(Fa(d.element,cD)?k.throttle():function(t,e){var n=Bt.fromDom(e.getBody()),r=function(t){return ye(t,n)},o=Bt.fromDom(e.selection.getNode());return function(t){return!r(t)&&!xe(n,t)}(o)?B.none():eD(o,t.inNodeScope,t.inEditorScope).orThunk((function(){return nD(r,o,t)}))}(w(),t).fold(v,(function(t){S(t.toolbars,B.some(t.elem))})))}),17);t.on("init",(function(){t.on("remove",v),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",b),t.on("click keyup focus SetContent",k.throttle),t.on(VA,v),t.on("contexttoolbar-show",(function(e){var n=w();yt(n.lookupTable,e.toolbarKey).each((function(n){S([n],Tt(e.target!==t,e.target)),Xh.getContent(d).each(eh.focusIn)}))})),t.on("focusout",(function(e){hp.setEditorTimeout(t,(function(){Mc(n.element).isNone()&&Mc(d.element).isNone()&&v()}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&v()})),t.on("AfterProgressState",(function(e){e.state?v():t.hasFocus()&&k.throttle()})),t.on("NodeChange",(function(t){Mc(d.element).fold(k.throttle,h)}))}))},lD={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},fD=(FN="[eE][+-]?[0-9]+",jN=["Infinity","[0-9]+\\."+(VN=function(t){return"(?:"+t+")?"})(HN="[0-9]+")+VN(FN),"\\.[0-9]+"+VN(FN),HN+VN(FN)].join("|"),new RegExp("^([+-]?(?:"+jN+"))(.*)$")),dD=function(t,e){return B.from(fD.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return F(e,(function(e){return F(lD[e],(function(e){return t===e}))}))}(r,e)?B.some({value:n,unit:r}):B.none()}))},mD=function(t,e){var n=function(){var n=e.getOptions(t),r=e.getCurrent(t).map(e.hash),o=Zc();return U(n,(function(n){return{type:"togglemenuitem",text:e.display(n),onSetup:function(i){var a=function(t){t&&(o.on((function(t){return t.setActive(!1)})),o.set(i)),i.setActive(t)};a(Ct(r,e.hash(n)));var u=e.watcher(t,n,a);return function(){o.clear(),u()}},onAction:function(){return e.setCurrent(t,n)}}}))};t.ui.registry.addMenuButton(e.name,{tooltip:e.text,icon:e.icon,fetch:function(t){return t(n())},onSetup:e.onToolbarSetup}),t.ui.registry.addNestedMenuItem(e.name,{type:"nestedmenuitem",text:e.text,getSubmenuItems:n,onSetup:e.onMenuSetup})},gD={name:"lineheight",text:"Line height",icon:"line-height",getOptions:function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},hash:function(t){return function(t,e){return dD(t,e).map((function(t){return t.value+t.unit}))}(t,["fixed","relative","empty"]).getOr(t)},display:b,watcher:function(t,e,n){return t.formatter.formatChanged("lineheight",n,!1,{value:e}).unbind},getCurrent:function(t){return B.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},hD=function(t){mD(t,gD),function(t){return B.from(function(t){return t.getParam("content_langs",void 0,"array")}(t)).map((function(e){return{name:"language",text:"Language",icon:"language",getOptions:v(e),hash:function(t){return s(t.customCode)?t.code:t.code+"/"+t.customCode},display:function(t){return t.title},watcher:function(t,e,n){return t.formatter.formatChanged("lang",n,!1,{value:e.code,customValue:e.customCode}).unbind},getCurrent:function(t){var e=Bt.fromDom(t.selection.getNode());return No(e,(function(t){return B.some(t).filter(It).bind((function(t){return $e(t,"lang").map((function(e){return{code:e,customCode:$e(t,"data-mce-lang").getOrUndefined(),title:""}}))}))}))},setCurrent:function(t,e){return t.execCommand("Lang",!1,e)},onToolbarSetup:function(e){var n=Qc();return e.setActive(t.formatter.match("lang",{},void 0,!0)),n.set(t.formatter.formatChanged("lang",e.setActive,!0)),n.clear}}}))}(t).each((function(e){return mD(t,e)}))},pD=function(t,e){!function(t,e){var n=LN(0,e,$N(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=LN(0,e,XN(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=O({type:"advanced"},e.styleselect),r=LN(0,e,nA(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=LN(0,e,eA(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=LN(0,e,ZN(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)},vD=function(t){return MN(t,"NodeChange",(function(e){e.setDisabled(!t.queryCommandState("outdent"))}))},bD=function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:vD(t),onAction:zN(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:zN(t,"indent")})}(t)},yD=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},wD=function(t){!function(t){yk.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:DN(t,e.name),onAction:yD(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:DN(t,n),onAction:yD(t,n)})}}(t),function(t){yk.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:zN(t,e.action)})}))}(t),function(t){yk.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:zN(t,e.action),onSetup:DN(t,e.name)})}))}(t)},xD=function(t){wD(t),function(t){yk.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:zN(t,e.action)})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:yD(t,"code")})}(t)},CD=function(t,e){return MN(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(t.mode.isReadOnly()||!t.undoManager[e]())}))},SD=function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:CD(t,"hasUndo"),onAction:zN(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:CD(t,"hasRedo"),onAction:zN(t,"redo")})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:CD(t,"hasUndo"),onAction:zN(t,"undo")}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:CD(t,"hasRedo"),onAction:zN(t,"redo")})}(t)},kD=function(t){return MN(t,"VisualAid",(function(e){e.setActive(t.hasVisual)}))},TD=function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:zN(t,"mceToggleVisualAid")})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:kD(t),onAction:zN(t,"mceToggleVisualAid")})}(t)},OD=function(t,e){!function(t){W([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:zN(t,e.cmd),onSetup:DN(t,e.name)})})),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:zN(t,"JustifyNone")})}(t),xD(t),pD(t,e),SD(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",(function(e,n){!function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))}(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){!function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))}(t,e)}))}(t);var e=xo(null),n=xo(null);aw(t,"forecolor","forecolor","Text color",e),aw(t,"backcolor","hilitecolor","Background color",n),uw(t,"forecolor","forecolor","Text color"),uw(t,"backcolor","hilitecolor","Background color")}(t),TD(t),bD(t),hD(t)},ED=function(t,e){return{type:"makeshift",x:t,y:e}},_D=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},RD=function(t,e){var n=gb.DOM.getPos(t);return function(t,e,n){return ED(t.x+e,t.y+n)}(e,n.x,n.y)},ND=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(_D(t)){var e=t.touches[0];return ED(e.pageX,e.pageY)}return ED(t.pageX,t.pageY)}(e):RD(t.getContentAreaContainer(),function(t){if(_D(t)){var e=t.touches[0];return ED(e.clientX,e.clientY)}return ED(t.clientX,t.clientY)}(e)):AD(t)},AD=function(t){return{type:"selection",root:Bt.fromDom(t.selection.getNode())}},DD=function(t,e,n){switch(n){case"node":return function(t){return{type:"node",node:B.some(Bt.fromDom(t.selection.getNode())),root:Bt.fromDom(t.getBody())}}(t);case"point":return ND(t,e);case"selection":return AD(t)}},MD=function(t,e,n,r,o,i){var a=n(),u=DD(t,e,i);IT(a,hv.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),Xh.showMenuAt(o,{anchor:u},{menu:{markers:Nv("normal")},data:t})}))},BD={onLtr:function(){return[ac,ec,nc,rc,oc,ic,up,cp,ap,op,ip,rp]},onRtl:function(){return[ac,nc,ec,oc,rc,ic,up,cp,ip,rp,ap,op]}},zD={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},PD=function(t,e,n,r,o,i,a){var u=function(t,e,n){var r=DD(t,e,n);return O({bubble:bs(0,"point"===n?12:0,zD),layouts:BD,overrides:{maxWidthFunction:UR(),maxHeightFunction:gs()}},r)}(t,e,i);IT(n,hv.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),Xh.showMenuWithinBounds(o,{anchor:u},{menu:{markers:Nv("normal"),highlightImmediately:a},data:n,type:"horizontal"},(function(){return B.some(KA(t,r.shared,"node"===i?"node":"selection"))})),t.fire(VA)}))},LD=function(t,e,n,r,o,i){var a=pe(),u=a.os.isiOS(),c=a.os.isOSX(),s=a.os.isAndroid(),l=a.deviceType.isTouch(),f=function(){var a=n();PD(t,e,a,r,o,i,!(s||u||c&&l))};if((c||u)&&"node"!==i){var d=function(){!function(t){var e=t.selection.getRng(),n=function(){hp.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),f()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return sl(t.getWin(),Ws.domRange(o)).exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))}(t,e)?(t.once("selectionchange",d),t.once("touchend",(function(){return t.off("selectionchange",d)}))):d()}else f()},ID=function(t){return"string"==typeof t?t.split(/[ ,]/):t},HD=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},FD=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return B.from(t.getParam(e)).map(ID).getOrThunk((function(){return $(ID(n),(function(t){return wt(r,t)}))}))}(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},VD=function(t){return o(t)?"|"===t:"separator"===t.type},jD={type:"separator"},UD=function(t){var e,n=function(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}};if(o(t))return t;switch(t.type){case"separator":return jD;case"submenu":return O(O({type:"nestedmenuitem"},n(t)),{getSubmenuItems:function(){var e=t.getSubmenuItems();return o(e)?e:U(e,UD)}});default:return O(O({type:"menuitem"},n(t)),{onAction:(e=t.onAction,function(){return e()})})}},WD=function(t,e){if(0===e.length)return t;var n=ut(t).filter((function(t){return!VD(t)})).fold((function(){return[]}),(function(t){return[jD]}));return t.concat(n).concat(e).concat([jD])},qD=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},$D=function(t,e){return qD(t,e)?t.selection.getStart(!0):e.target},GD=function(t,e,n){var r=pe().deviceType.isTouch,i=eu(Xh.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:xc([uh("dismissContextMenu",[Ii(xi(),(function(e,n){af.close(e),t.focus()}))])])})),a=function(t){return Xh.hide(i)},u=function(e){if(HD(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!HD(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var a=function(t,e){var n=function(t){return t.getParam("contextmenu_avoid_overlap","","string")}(t),r=qD(t,e)?"selection":"point";if(At(n)){var o=$D(t,e);return Aw(Bt.fromDom(o),n)?"node":r}return r}(t,e);(r()?LD:MD)(t,e,(function(){var n=$D(t,e),r=t.ui.registry.getAll(),i=FD(t);return function(t,e,n){var r=K(e,(function(e,r){return yt(t,r.toLowerCase()).map((function(t){var r=t.update(n);if(o(r))return WD(e,r.split(" "));if(r.length>0){var i=U(r,UD);return WD(e,i)}return e})).getOrThunk((function(){return e.concat([r])}))}),[]);return r.length>0&&VD(r[r.length-1])&&r.pop(),r}(r.contextMenus,i,n)}),n,i,a)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");t.on(e,a),t.on("longpress contextmenu",u)}))},KD=Co([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),XD=function(t){return function(e){return e.translate(-t.left,-t.top)}},YD=function(t){return function(e){return e.translate(t.left,t.top)}},JD=function(t){return function(e,n){return K(t,(function(t,e){return e(t)}),mn(e,n))}},QD=function(t,e,n){return t.fold(JD([YD(n),XD(e)]),JD([XD(e)]),JD([]))},ZD=function(t,e,n){return t.fold(JD([YD(n)]),JD([]),JD([YD(e)]))},tM=function(t,e,n){return t.fold(JD([]),JD([XD(n)]),JD([YD(e),XD(n)]))},eM=function(t,e,n){var r=t.fold((function(t,e){return{position:B.some("absolute"),left:B.some(t+"px"),top:B.some(e+"px")}}),(function(t,e){return{position:B.some("absolute"),left:B.some(t-n.left+"px"),top:B.some(e-n.top+"px")}}),(function(t,e){return{position:B.some("fixed"),left:B.some(t+"px"),top:B.some(e+"px")}}));return O({right:B.none(),bottom:B.none()},r)},nM=function(t,e,n,r){var o=function(t,o){return function(i,a){var u=t(e,n,r);return o(i.getOr(u.left),a.getOr(u.top))}};return t.fold(o(tM,rM),o(ZD,oM),o(QD,iM))},rM=KD.offset,oM=KD.absolute,iM=KD.fixed,aM=function(t,e){var n=qe(t,e);return s(n)?NaN:parseInt(n,10)},uM=function(t,e,n,r){return function(t,e){var n=t.element,r=aM(n,e.leftAttr),o=aM(n,e.topAttr);return isNaN(r)||isNaN(o)?B.none():B.some(mn(r,o))}(t,e).fold((function(){return n}),(function(t){return iM(t.left+r.left,t.top+r.top)}))},cM=function(t,e,n,r,o,i){var a=uM(t,e,n,r),u=e.mustSnap?fM(t,e,a,o,i):dM(t,e,a,o,i),c=QD(a,o,i);return function(t,e,n){var r=t.element;We(r,e.leftAttr,n.left+"px"),We(r,e.topAttr,n.top+"px")}(t,e,c),u.fold((function(){return{coord:iM(c.left,c.top),extra:B.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},sM=function(t,e){!function(t,e){var n=t.element;Ke(n,e.leftAttr),Ke(n,e.topAttr)}(t,e)},lM=function(t,e,n,r){return st(t,(function(t){var o=t.sensor;return function(t,e,n,r,o,i){var a=ZD(t,o,i),u=ZD(e,o,i);return Math.abs(a.left-u.left)<=n&&Math.abs(a.top-u.top)<=r}(e,o,t.range.left,t.range.top,n,r)?B.some({output:nM(t.output,e,n,r),extra:t.extra}):B.none()}))},fM=function(t,e,n,r,o){var i=e.getSnapPoints(t);return lM(i,n,r,o).orThunk((function(){return K(i,(function(t,e){var i=e.sensor,a=function(t,e,n,r,o,i){var a=ZD(t,o,i),u=ZD(e,o,i),c=Math.abs(a.left-u.left),s=Math.abs(a.top-u.top);return mn(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:B.some(a),snap:B.some(e)}}),(function(n){return(a.left+a.top)/2<=(n.left+n.top)/2?{deltas:B.some(a),snap:B.some(e)}:t}))}),{deltas:B.none(),snap:B.none()}).snap.map((function(t){return{output:nM(t.output,n,r,o),extra:t.extra}}))}))},dM=function(t,e,n,r,o){var i=e.getSnapPoints(t);return lM(i,n,r,o)},mM=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=Ce(t.element),a=An(i),u=v_(o),c=function(t,e,n){return{coord:nM(t.output,t.output,e,n),extra:t.extra}}(r,a,u),s=eM(c.coord,0,u);Ze(o,s)}}}),gM="data-initial-z-index",hM=function(t,e){t.getSystem().addToGui(e),function(t){Oe(t.element).filter(It).each((function(e){nn(e,"z-index").each((function(t){We(e,gM,t)})),Je(e,"z-index",tn(t.element,"z-index"))}))}(e)},pM=function(t){!function(t){Oe(t.element).filter(It).each((function(t){$e(t,gM).fold((function(){return an(t,"z-index")}),(function(e){return Je(t,"z-index",e)})),Ke(t,gM)}))}(t),t.getSystem().removeFromGui(t)},vM=function(t,e,n){return t.getSystem().build(qw.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},bM=lo("snaps",[Xr("getSnapPoints"),_u("onSensor"),Xr("leftAttr"),Xr("topAttr"),fo("lazyViewport",Vn),fo("mustSnap",!1)]),yM=[fo("useFixed",S),Xr("blockerClass"),fo("getTarget",b),fo("onDrag",h),fo("repositionTarget",!0),fo("onDrop",h),bo("getBounds",Vn),bM],wM=function(t){return(e=nn(t,"left"),n=nn(t,"top"),r=nn(t,"position"),o=function(t,e,n){return("fixed"===n?iM:rM)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?B.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):B.none()).getOrThunk((function(){var e=hn(t);return oM(e.left,e.top)}));var e,n,r,o},xM=function(t,e,n,r,o,i,a){return function(t,e,n,r,o){var i=o.bounds,a=ZD(e,n,r),u=$u(a.left,i.x,i.x+i.width-o.width),c=$u(a.top,i.y,i.y+i.height-o.height),s=oM(u,c);return e.fold((function(){var t=tM(s,n,r);return rM(t.left,t.top)}),v(s),(function(){var t=QD(s,n,r);return iM(t.left,t.top)}))}(0,e.fold((function(){var t,e,a,u=(t=n,e=i.left,a=i.top,t.fold((function(t,n){return rM(t+e,n+a)}),(function(t,n){return oM(t+e,n+a)}),(function(t,n){return iM(t+e,n+a)}))),c=QD(u,r,o);return iM(c.left,c.top)}),(function(e){var a=cM(t,e,n,i,r,o);return a.extra.each((function(n){e.onSensor(t,n)})),a.coord})),r,o,a)},CM=function(t,e){return{bounds:t.getBounds(),height:fn(e.element),width:yn(e.element)}},SM=function(t,e,n,r,o){var i=n.update(r,o),a=n.getStartData().getOrThunk((function(){return CM(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=Ce(t.element),a=An(i),u=v_(o),c=wM(o),s=xM(t,e.snaps,c,a,u,r,n),l=eM(s,0,u);Ze(o,l)}e.onDrag(t,o,r)}(t,e,a,n)}))},kM=function(t,e,n,r){e.each(pM),n.snaps.each((function(e){sM(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},TM=function(t){return function(e,n){var r=function(t){n.setStartData(CM(e,t))};return zi(_([Ii(vi(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r),!0))}},OM=Object.freeze({__proto__:null,getData:function(t){return B.from(mn(t.x,t.y))},getDelta:function(t,e){return mn(e.left-t.left,e.top-t.top)}}),EM=function(t,e,n){return[Ii(Fo(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return kM(r,B.some(c),t,e)},a=Dw(i,200),u={drop:i,delayDrop:a.schedule,forceDrop:i,move:function(n){a.cancel(),SM(r,t,e,OM,n)}},c=vM(r,t.blockerClass,function(t){return zi([Ii(Fo(),t.forceDrop),Ii(Uo(),t.drop),Ii(Vo(),(function(e,n){t.move(n.event)})),Ii(jo(),t.delayDrop)])}(u));n(r),hM(r,c)}}))]},_M=_(_([],yM,!0),[Du("dragger",{handlers:TM(EM)})],!1),RM=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return B.some(mn(e.clientX,e.clientY))}(e):B.none()},getDelta:function(t,e){return mn(e.left-t.left,e.top-t.top)}}),NM=function(t,e,n){var r=Zc(),o=function(n){kM(n,r.get(),t,e),r.clear()};return[Ii(Po(),(function(i,a){a.stop();var u=function(){return o(i)},c={drop:u,delayDrop:h,forceDrop:u,move:function(n){SM(i,t,e,RM,n)}},s=vM(i,t.blockerClass,function(t){return zi([Ii(Po(),t.forceDrop),Ii(Io(),t.drop),Ii(Ho(),t.drop),Ii(Lo(),(function(e,n){t.move(n.event)}))])}(c));r.set(s);n(i),hM(i,s)})),Ii(Lo(),(function(n,r){r.stop(),SM(n,t,e,RM,r.event)})),Ii(Io(),(function(t,e){e.stop(),o(t)})),Ii(Ho(),o)]},AM=_M,DM=_(_([],yM,!0),[Du("dragger",{handlers:TM(NM)})],!1),MM=_(_([],yM,!0),[Du("dragger",{handlers:TM((function(t,e,n){return _(_([],EM(t,e,n),!0),NM(t,e,n),!0)}))})],!1),BM=Tc({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:AM,touch:DM,mouseOrTouch:MM}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:B.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=B.none(),e=B.none(),n=v({});return xa({readState:n,reset:function(){t=B.none(),e=B.none()},update:function(e,n){return e.getData(n).bind((function(n){return function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=B.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=B.some(t)}})}}),apis:mM}),zM=function(t,e,n,r,o,i){return t.fold((function(){return BM.snap({sensor:oM(n-20,r-20),range:mn(o,i),output:oM(B.some(n),B.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,a=t.element.dom.getBoundingClientRect();return BM.snap({sensor:oM(o,i),range:mn(40,40),output:oM(B.some(n-a.width/2),B.some(r-a.height/2)),extra:{td:e}})}))},PM=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists((function(t){return ye(t,e)}))})(e.get(),o)||(e.set(o),n(o))},mustSnap:!0}},LM=function(t){return vp(pp.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:xc([BM.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),uC.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},IM=function(t,e){var n=xo([]),r=xo([]),o=xo(!1),i=Zc(),a=Zc(),u=function(t){var n=Fn(t);return zM(f.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=Fn(t);return zM(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=PM((function(){return U(n.get(),(function(t){return u(t)}))}),i,(function(e){a.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),l=PM((function(){return U(r.get(),(function(t){return c(t)}))}),a,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),f=LM(s),d=LM(l),m=eu(f.asSpec()),g=eu(d.asSpec()),h=function(e,n,r,o){var i=r(n);BM.snapTo(e,i);!function(e,n,r,o){var i=n.dom.getBoundingClientRect();an(e.element,"display");var a=Te(Bt.fromDom(t.getBody())).dom.innerHeight,u=r(i),c=o(i,a);(u||c)&&Je(e.element,"display","none")}(e,n,(function(t){return t[o]<0}),(function(t,e){return t[o]>e}))},p=function(t){return h(m,t,u,"top")},v=function(t){return h(g,t,c,"bottom")};pe().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(jl(e,m),jl(e,g),o.set(!0)),i.set(t.start),a.set(t.finish),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),p(t.start),v(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(p),a.get().each(v)})),t.on("TableSelectionClear",(function(){o.get()&&(ql(m),ql(g),o.set(!1)),i.clear(),a.clear()})))},HM=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},FM=function(t,e,n){e.delimiter||(e.delimiter="»");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:xc([eh.config({mode:"flow",selector:"div[role=button]"}),Xd.config({disabled:n.isDisabled}),qb(),Qw.config({}),ah.config({}),uh("elementPathEvents",[$i((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return eh.focusIn(r)})),t.on("NodeChange",(function(o){var i,a,u=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!HM(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);u.length>0?ah.set(r,(i=U(u||[],(function(e,r){return pp.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:xc([Gb(n.isDisabled),qb()])})})),a={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},K(i.slice(1),(function(t,e){var n=t;return n.push(a),n.push(e),n}),[i[0]]))):ah.set(r,[])}))}))])]),components:[]}};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(UN||(UN={}));var VM=function(t,e,n){var r=Bt.fromDom(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=zA(r+e.top,yb(t),xb(t)),n===UN.Both&&(i.width=zA(o+e.left,bb(t),wb(t))),i}(t,e,n,ln(r),bn(r));dt(o,(function(t,e){return Je(r,e,BA(t))})),function(t){t.fire("ResizeEditor")}(t)},jM=function(t,e,n,r){var o=mn(20*n,20*r);return VM(t,o,e),B.some(!0)},UM=function(t,e){var n=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?UN.None:"both"===n?UN.Both:UN.Vertical}(t);return n===UN.None?B.none():B.some(Ep("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize")},behaviours:[BM.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){return VM(t,o,n)},blockerClass:"tox-blocker"}),eh.config({mode:"special",onLeft:function(){return jM(t,n,-1,0)},onRight:function(){return jM(t,n,1,0)},onUp:function(){return jM(t,n,0,-1)},onDown:function(){return jM(t,n,0,1)}}),Qw.config({}),dh.config({})]},e.icons))},WM=function(t,e){var n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(FM(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return ah.set(t,[Qa(e.translate(["{0} "+r,n[r]]))])};return pp.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:xc([Gb(e.isDisabled),qb(),Qw.config({}),ah.config({}),Of.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),uh("wordcount-events",[Xi((function(t){var e=Of.getValue(t),n="words"===e.mode?"characters":"words";Of.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),$i((function(e){t.on("wordCountUpdate",(function(t){var n=Of.getValue(e).mode;Of.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[ci()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce&amp;utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=bp.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var r=n(),o=UM(t,e);return r.concat(o.toArray())}()}},qM=function(t){var e,n,r,o,i=t.inline,a=i?FA:DA,u=Pb(t)?q_:h_,c=B.none(),s=pe(),l=s.browser.isIE()?["tox-platform-ie"]:[],f=s.deviceType.isTouch()?["tox-platform-touch"]:[],d=Ab(t),m=Bb(t),g=bp.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[Ss]=d?Uc.BottomToTop:Uc.TopToBottom,e)},v=function(){return c.bind(xN.getHeader)},b=function(){Je($.element,"width",document.body.clientWidth+"px")},y=eu((n=ye(Ve(),m)&&"grid"===tn(m,"display"),r={dom:O({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(f)},g),behaviours:xc([Ll.config({useFixed:function(){return u.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:zi([Ii(bi(),b)])},ur(r,n?o:{}))),w=function(){return Wn.value(y)},x=vp({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind((function(t){return xN.getThrobber(t)})).getOrDie("Could not find throbber element")},S=e_(y,t,(function(){return c.bind((function(t){return x.getOpt(t)})).getOrDie("Could not find a anchor bar element")})),k=xN.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){t.focus()}}),T=Eb(t),E=xN.parts.toolbar(O({dom:{tag:"div",classes:["tox-toolbar"]},getSink:w,providers:S.shared.providers,onEscape:function(){t.focus()},type:T,lazyToolbar:function(){return c.bind((function(t){return xN.getToolbar(t)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),_=xN.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.shared.providers,onEscape:function(){t.focus()},type:T}),R=xN.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),N=xN.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),A=xN.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),D=t.getParam("statusbar",!0,"boolean")&&!i?B.some(WM(t,S.shared.providers)):B.none(),M={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[R,N]},z=Tb(t),P=Sb(t),L=Cb(t),I=xN.parts.header({dom:O({tag:"div",classes:["tox-editor-header"]},p),components:J([L?[k]:[],z?[_]:P?[E]:[],Mb(t)?[]:[x.asSpec()]]),sticky:Pb(t),editor:t,sharedBackstage:S.shared}),H=J([d?[]:[I],i?[]:[M],d?[I]:[]]),F=J([[{dom:{tag:"div",classes:["tox-editor-container"]},components:H}],i?[]:D.toArray(),[A]]),V=zb(t),j=O(O({role:"application"},bp.isRtl()?{dir:"rtl"}:{}),V?{"aria-hidden":"true"}:{}),U=eu(xN.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(f).concat(l),styles:O({visibility:"hidden"},V?{opacity:"0",border:"0"}:{}),attributes:j},components:F,behaviours:xc([qb(),Xd.config({disableClass:"tox-tinymce--disabled"}),eh.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])}));c=B.some(U),t.shortcuts.add("alt+F9","focus menubar",(function(){xN.focusMenubar(U)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){xN.focusToolbar(U)})),t.addCommand("ToggleToolbarDrawer",(function(){xN.toggleToolbarDrawer(U)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return xN.isToolbarDrawerToggled(U)}));var q=$w(U),$=$w(y);!function(t,e,n){var r=function(t,r){W([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){W([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(uf(),{target:t.target})},a=Rc(),u=es(a,"touchstart",i),c=es(a,"touchmove",(function(t){return r(hi(),t)})),s=es(a,"touchend",(function(t){return r(pi(),t)})),l=es(a,"mousedown",i),f=es(a,"mouseup",(function(t){0===t.raw.button&&o(sf(),{target:t.target})})),d=function(t){return o(uf(),{target:Bt.fromDom(t.target)})},m=function(t){0===t.button&&o(sf(),{target:Bt.fromDom(t.target)})},g=function(){W(t.editorManager.get(),(function(e){t!==e&&e.fire("DismissPopups",{relatedTarget:t})}))},h=function(t){return r(vi(),rs(t))},p=function(t){o(cf(),{}),r(bi(),rs(t))},v=function(){return o(cf(),{})},b=function(e){e.state&&o(uf(),{target:Bt.fromDom(t.getContainer())})},y=function(t){o(uf(),{target:Bt.fromDom(t.relatedTarget.getContainer())})};t.on("PostRender",(function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("mousedown",g),t.on("ScrollWindow",h),t.on("ResizeWindow",p),t.on("ResizeEditor",v),t.on("AfterProgressState",b),t.on("DismissPopups",y)})),t.on("remove",(function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("mousedown",g),t.off("ScrollWindow",h),t.off("ResizeWindow",p),t.off("ResizeEditor",v),t.off("AfterProgressState",b),t.off("DismissPopups",y),l.unbind(),u.unbind(),c.unbind(),s.unbind(),f.unbind()})),t.on("detach",(function(){Xl(e),Xl(n),e.destroy(),n.destroy()}))}(t,q,$);var G=function(){var e=BA(PA(t)),n=BA(function(t){return LA(t).getOr(vb(t))}(t));return t.inline||(on("div","width",n)&&Je(U.element,"width",n),on("div","height",e)?Je(U.element,"height",e):Je(U.element,"height","200px")),e};return{mothership:q,uiMothership:$,backstage:S,renderUI:function(){u.setup(t,S.shared,v),OD(t,S),GD(t,w,S),function(t){var e=t.ui.registry.getAll().sidebars;W(lt(e),(function(n){var r=e[n],o=function(){return Ct(B.from(t.queryCommandValue("ToggleSidebar")),n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))}(t),MR(t,C,S.shared),mt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,o=e.contextToolbars,i=e.sidebars,c=kb(t),s={menuItems:r,menus:Lb(t),menubar:Ib(t),toolbar:c.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:T===gv.floating,buttons:n,sidebar:i};sD(t,o,y,{backstage:S}),IM(t,y);var l=t.getElement(),f=G(),d={mothership:q,uiMothership:$,outerContainer:U},m={targetNode:l,height:f};return a.render(t,d,s,S,m)},getUi:function(){return{channels:{broadcastAll:$.broadcast,broadcastOn:$.broadcastOn,register:h}}}}},$M=v([Xr("lazySink"),oo("dragBlockClass"),bo("getBounds",Vn),fo("useTabstopAt",k),fo("eventOrder",{}),Ef("modalBehaviours",[eh]),Ru("onExecute"),Au("onEscape")]),GM={sketch:b},KM=v([od({name:"draghandle",overrides:function(t,e){return{behaviours:xc([BM.config({mode:"mouse",getTarget:function(t){return cu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),nd({schema:[Xr("dom")],name:"title"}),nd({factory:GM,schema:[Xr("dom")],name:"close"}),nd({factory:GM,schema:[Xr("dom")],name:"body"}),od({factory:GM,schema:[Xr("dom")],name:"footer"}),rd({factory:{sketch:function(t,e){return O(O({},t),{dom:e.dom,components:e.components})}},schema:[fo("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),fo("components",[])],name:"blocker"})]),XM=Ad({name:"ModalDialog",configFields:$M(),partFields:KM(),factory:function(t,e,n,r){var o,i=Zc(),a=oa("modal-events"),u=O(O({},t.eventOrder),((o={})[yi()]=[a].concat(t.eventOrder["alloy.system.attached"]||[]),o));return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){i.set(e);var n=t.lazySink(e).getOrDie(),o=r.blocker(),a=n.getSystem().build(O(O({},o),{components:o.components.concat([nu(e)]),behaviours:xc([dh.config({}),uh("dialog-blocker-events",[qi(qo(),(function(){eh.focusIn(e)}))])])}));jl(n,a),eh.focusIn(e)},hide:function(t){i.clear(),Oe(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){ql(t)}))}))},getBody:function(e){return vd(e,t,"body")},getFooter:function(e){return vd(e,t,"footer")},setIdle:function(t){RR.unblock(t)},setBusy:function(t,e){RR.block(t,e)}},eventOrder:u,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Rf(t.modalBehaviours,[ah.config({}),eh.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),RR.config({getRoot:i.get}),uh(a,[$i((function(e){var n,r,o,i,a,u;n=e.element,r=vd(e,t,"title").element,o=$e(n,"id").fold((function(){var t=oa("dialog-label");return We(r,"id",t),t}),b),We(n,"aria-labelledby",o),i=e.element,a=vd(e,t,"body").element,u=B.from(qe(i,"id")).fold((function(){var t=oa("dialog-describe");return We(a,"id",t),t}),b),We(i,"aria-describedby",u)}))])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),YM=kr([Qr("type"),Qr("name")].concat(Gv)),JM=Mr,QM=[$r("name","name",sr((function(){return oa("button-name")})),Dr),uo("icon"),po("align","end",["start","end"]),vo("primary",!1),vo("disabled",!1)],ZM=_(_([],QM,!0),[Qr("text")],!1),tB=_([Zr("type",["submit","cancel","custom"])],ZM,!0),eB=_([Zr("type",["menu"]),uo("text"),uo("tooltip"),uo("icon"),ro("items",YM)],QM,!0),nB=qr("type",{submit:tB,cancel:tB,custom:tB,menu:eB}),rB=[Qr("type"),Qr("text"),Zr("level",["info","warn","error","success"]),Qr("icon"),fo("url","")],oB=kr(rB),iB=[Qr("type"),Qr("text"),vo("disabled",!1),vo("primary",!1),$r("name","name",sr((function(){return oa("button-name")})),Dr),uo("icon"),vo("borderless",!1)],aB=kr(iB),uB=[Qr("type"),Qr("name"),Qr("label"),vo("disabled",!1)],cB=kr(uB),sB=Mr,lB=[Qr("type"),Qr("name")],fB=lB.concat([uo("label")]),dB=fB.concat([fo("columns","auto")]),mB=kr(dB),gB=_r([Qr("value"),Qr("text"),Qr("icon")]),hB=kr(fB),pB=Dr,vB=kr(fB),bB=Dr,yB=lB.concat([ho("tag","textarea"),Qr("scriptId"),Qr("scriptUrl"),function(t,e){return mo(t,e,Pr)}("settings",void 0)]),wB=lB.concat([ho("tag","textarea"),to("init")]),xB=Hr((function(t){return Vr("customeditor.old",Sr(wB),t).orThunk((function(){return Vr("customeditor.new",Sr(yB),t)}))})),CB=Dr,SB=kr(fB),kB=Tr(vr),TB=function(t){return[Qr("type"),Jr("columns"),t]},OB=[Qr("type"),Qr("html"),po("presets","presentation",["presentation","document"])],EB=kr(OB),_B=fB.concat([vo("sandboxed",!0)]),RB=kr(_B),NB=Dr,AB=fB.concat([Yr("currentState",kr([Xr("blob"),Qr("url")]))]),DB=kr(AB),MB=fB.concat([uo("inputMode"),uo("placeholder"),vo("maximized",!1),vo("disabled",!1)]),BB=kr(MB),zB=Dr,PB=function(t){return[Qr("type"),Qr("label"),t]},LB=[Qr("text"),Qr("value")],IB=[Qr("text"),ro("items",function(t,e){return n=jt(e),{extract:function(t,e){return n().extract(t,e)},toString:function(){return n().toString()}};var n}(0,(function(){return HB})))],HB=Or([kr(LB),kr(IB)]),FB=fB.concat([ro("items",HB),vo("disabled",!1)]),VB=kr(FB),jB=Dr,UB=fB.concat([no("items",[Qr("text"),Qr("value")]),go("size",1),vo("disabled",!1)]),WB=kr(UB),qB=Dr,$B=fB.concat([vo("constrain",!0),vo("disabled",!1)]),GB=kr($B),KB=kr([Qr("width"),Qr("height")]),XB=[Qr("type"),ro("header",Dr),ro("cells",Tr(Dr))],YB=kr(XB),JB=fB.concat([uo("placeholder"),vo("maximized",!1),vo("disabled",!1)]),QB=kr(JB),ZB=Dr,tz=fB.concat([po("filetype","file",["image","media","file"]),fo("disabled",!1)]),ez=kr(tz),nz=kr([Qr("value"),fo("meta",{})]),rz=function(t){return $r("items","items",{tag:"required",process:{}},Tr(Hr((function(e){return Vr("Checking item of "+t,oz,e).fold((function(t){return Wn.error(Wr(t))}),(function(t){return Wn.value(t)}))}))))},oz=xr((function(){return Ir("type",{alertbanner:oB,bar:kr((t=rz("bar"),[Qr("type"),t])),button:aB,checkbox:cB,colorinput:hB,colorpicker:vB,dropzone:SB,grid:kr(TB(rz("grid"))),iframe:RB,input:BB,listbox:VB,selectbox:WB,sizeinput:GB,textarea:QB,urlinput:ez,customeditor:xB,htmlpanel:EB,imagetools:DB,collection:mB,label:kr(PB(rz("label"))),table:YB,panel:az});var t})),iz=[Qr("type"),fo("classes",[]),ro("items",oz)],az=kr(iz),uz=[$r("name","name",sr((function(){return oa("tab-name")})),Dr),Qr("title"),ro("items",oz)],cz=[Qr("type"),no("tabs",uz)],sz=kr(cz),lz=ZM,fz=nB,dz=kr([Qr("title"),Yr("body",Ir("type",{panel:az,tabpanel:sz})),ho("size","normal"),ro("buttons",fz),fo("initialData",{}),bo("onAction",h),bo("onChange",h),bo("onSubmit",h),bo("onClose",h),bo("onCancel",h),fo("onTabChange",h)]),mz=kr(_([Zr("type",["cancel","custom"])],lz,!0)),gz=kr([Qr("title"),Qr("url"),ao("height"),ao("width"),so("buttons",mz),bo("onAction",h),bo("onCancel",h),bo("onClose",h),bo("onMessage",h)]),hz=function(t){return i(t)?[t].concat(Q(bt(t),hz)):a(t)?Q(t,hz):[]},pz=function(t){return o(t.type)&&o(t.name)},vz={checkbox:sB,colorinput:pB,colorpicker:bB,dropzone:kB,input:zB,iframe:NB,sizeinput:KB,selectbox:qB,listbox:jB,size:KB,textarea:ZB,urlinput:nz,customeditor:CB,collection:gB,togglemenuitem:JM},bz=function(t){var e=function(t){return $(hz(t),pz)}(t),n=Q(e,(function(t){return function(t){return B.from(vz[t.type])}(t).fold((function(){return[]}),(function(e){return[Yr(t.name,e)]}))}));return kr(n)},yz=function(t){return{internalDialog:jr(Vr("dialog",dz,t)),dataValidator:bz(t),initialData:t.initialData}},wz={open:function(t,e){var n=yz(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(jr(Vr("dialog",gz,e)))},redial:function(t){return yz(t)}},xz=function(t){var e=[],n={};return dt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?Wn.error(e):Wn.value(n)},Cz=function(t,e){var n=vp(ik.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:U(t.items,(function(t){return uE(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:xc([eh.config({mode:"acyclic",useTabstopAt:x(Bk)}),gk(n),Sk(n,{postprocess:function(t){return xz(t).fold((function(t){return console.error(t),{}}),b)}})])}},Sz=Nd({name:"TabButton",configFields:[fo("uid",void 0),Xr("value"),$r("dom","dom",fr((function(){return{attributes:{role:"tab",id:oa("aria"),"aria-selected":"false"}}})),Rr()),oo("action"),fo("domModification",{}),Ef("tabButtonBehaviours",[dh,eh,Of]),Xr("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Oh(t.action),behaviours:Rf(t.tabButtonBehaviours,[dh.config({}),eh.config({mode:"execution",useSpace:!0,useEnter:!0}),Of.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),kz=v([Xr("tabs"),Xr("dom"),fo("clickToDismiss",!1),Ef("tabbarBehaviours",[am,eh]),Ou(["tabClass","selectedClass"])]),Tz=id({factory:Sz,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){am.dehighlight(t,e),Ni(t,Oi(),{tabbar:t,button:e})},n=function(t,e){am.highlight(t,e),Ni(t,Ti(),{tabbar:t,button:e})};return{action:function(r){var o=r.getSystem().getByUid(t.uid).getOrDie(),i=am.isHighlighted(o,r);(i&&t.clickToDismiss?e:i?h:n)(o,r)},domModification:{classes:[t.markers.tabClass]}}}}),Oz=v([Tz]),Ez=Ad({name:"Tabbar",configFields:kz(),partFields:Oz(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Rf(t.tabbarBehaviours,[am.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){We(e.element,"aria-selected","true")},onDehighlight:function(t,e){We(e.element,"aria-selected","false")}}),eh.config({mode:"flow",getInitial:function(t){return am.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),_z=Nd({name:"Tabview",configFields:[Ef("tabviewBehaviours",[ah])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:Rf(t.tabviewBehaviours,[ah.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),Rz=v([fo("selectFirst",!0),_u("onChangeTab"),_u("onDismissTab"),fo("tabs",[]),Ef("tabSectionBehaviours",[])]),Nz=nd({factory:Ez,schema:[Xr("dom"),eo("markers",[Xr("tabClass"),Xr("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),Az=nd({factory:_z,name:"tabview"}),Dz=v([Nz,Az]),Mz=Ad({name:"TabSection",configFields:Rz(),partFields:Dz(),factory:function(t,e,n,r){var o=function(e,n){pd(e,t,"tabbar").each((function(t){n(t).each(Ai)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:_f(t.tabSectionBehaviours),events:zi(J([t.selectFirst?[$i((function(t,e){o(t,am.getFirst)}))]:[],[Ii(Ti(),(function(e,n){!function(e){var n=Of.getValue(e);pd(e,t,"tabview").each((function(r){X(t.tabs,(function(t){return t.value===n})).each((function(n){var o=n.view();$e(e.element,"id").each((function(t){We(r.element,"aria-labelledby",t)})),ah.set(r,o),t.onChangeTab(r,e,o)}))}))}(n.event.button)})),Ii(Oi(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return pd(e,t,"tabview").map((function(t){return ah.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=am.getCandidates(t);return X(n,(function(t){return Of.getValue(t)===e})).filter((function(e){return!am.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),Bz=function(t,e){Je(t,"height",e+"px"),pe().browser.isIE()?an(t,"flex-basis"):Je(t,"flex-basis",e+"px")},zz=function(t,e,n){cu(t,'[role="dialog"]').each((function(t){lu(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Je(e,"height","0"),Je(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=ke(t).dom,i=cu(t,".tox-dialog-wrap").getOr(t);r="fixed"===tn(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var a=ln(e),u=e.dom.offsetLeft>=n.dom.offsetLeft+bn(n)?Math.max(ln(n),a):a,c=parseInt(tn(t,"margin-top"),10)||0,s=parseInt(tn(t,"margin-bottom"),10)||0;return r-(ln(t)+c+s-u)}(t,e,r))})).each((function(t){Bz(e,t)}))}))}))},Pz=function(t){return lu(t,'[role="tabpanel"]')},Lz=function(t){var e;return{smartTabHeight:(e=Zc(),{extraEvents:[$i((function(n){var r=n.element;Pz(r).each((function(o){Je(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){(function(t){return at(ot(t,(function(t,e){return t>e?-1:t<e?1:0})))})(function(t,e,n){return U(t,(function(r,o){ah.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return ah.set(n,[]),i.height}))}(t,o,n)).fold(e.clear,e.set)})),zz(r,o,e),an(o,"visibility"),function(t,e){at(t).each((function(t){return Mz.showTab(e,t.value)}))}(t,n),hp.requestAnimationFrame((function(){zz(r,o,e)}))}))})),Ii(bi(),(function(t){var n=t.element;Pz(n).each((function(t){zz(n,t,e)}))})),Ii(dx,(function(t,n){var r=t.element;Pz(r).each((function(t){var n=Dc(ze(t));Je(t,"visibility","hidden");var o=nn(t,"height").map((function(t){return parseInt(t,10)}));an(t,"height"),an(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;o.forall((function(t){return i>t}))?(e.set(i),zz(r,t,e)):o.each((function(e){Bz(t,e)})),an(t,"visibility"),n.each(Nc)}))}))],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},Iz="send-data-to-section",Hz="send-data-to-view",Fz=function(t,e){var n=xo({}),r=function(t){var e=Of.getValue(t),r=xz(e).getOr({}),o=n.get(),i=ur(o,r);n.set(i)},o=function(t){var e=n.get();Of.setValue(t,e)},i=xo(null),a=U(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[ik.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:U(t.items,(function(t){return uE(n,t,e)})),formBehaviours:xc([eh.config({mode:"acyclic",useTabstopAt:x(Bk)}),uh("TabView.form.events",[$i(o),Gi(r)]),Ec.config({channels:Oo([{key:Iz,value:{onReceive:r}},{key:Hz,value:{onReceive:o}}])})])}}))]}}})),u=Lz(a).smartTabHeight;return Mz.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=Of.getValue(e);Ni(t,fx,{name:r,oldName:i.get()}),i.set(r)},tabs:a,components:[Mz.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[Ez.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:xc([Qw.config({})])}),Mz.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:u.selectFirst,tabSectionBehaviours:xc([uh("tabpanel",u.extraEvents),eh.config({mode:"acyclic"}),zd.config({find:function(t){return at(Mz.getViewItems(t))}}),Of.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([Iz],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([Hz],{})}}})])})},Vz=oa("update-dialog"),jz=oa("update-title"),Uz=oa("update-body"),Wz=oa("update-footer"),qz=oa("body-send-message"),$z=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:O(O({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:xc([hk(0),uA.config({channel:Uz,updateState:function(t,e){return B.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[Fz(t.body,n)];default:return[Cz(t.body,n)]}},initialData:t})])}},Gz=oy.deviceType.isTouch(),Kz=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},Xz=function(t,e){return XM.parts.close(pp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:xc([Qw.config({})])}))},Yz=function(){return XM.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},Jz=function(t,e){return XM.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:NR("<p>"+e.translate(t)+"</p>")}]}]})},Qz=function(t){return XM.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},Zz=function(t,e){return[qw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),qw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},tP=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return XM.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),B.some(!0)},useTabstopAt:function(t){return!Bk(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:O({position:"relative"},t.extraStyles)},components:_([t.header,t.body],t.footer.toArray(),!0),parts:{blocker:{dom:NR('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:Gz?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:xc(_([dh.config({}),uh("dialog-events",t.dialogEvents.concat([qi(qo(),(function(t,e){eh.focusIn(t)}))])),uh("scroll-lock",[$i((function(){La(Ve(),i)})),Gi((function(){Ha(Ve(),i)}))])],t.extraBehaviours,!0)),eventOrder:O((e={},e[ci()]=["dialog-events"],e[yi()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[wi()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},eP=function(t){return pp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[Ep("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){Ri(t,ax)}})},nP=function(t,e,n){var r=function(t){return[Qa(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:O({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:xc([uA.config({channel:jz,renderComponents:r})])}},rP=function(){return{dom:NR('<div class="tox-dialog__draghandle"></div>')}},oP=function(t,e){return function(t,e){var n=XM.parts.title(nP(t,B.none(),e)),r=XM.parts.draghandle(rP()),o=XM.parts.close(eP(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return qw.sketch({dom:NR('<div class="tox-dialog__header"></div>'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},iP=function(t,e,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:NR('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},aP=function(t,e,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){XM.setBusy(t(),(function(t,r){return iP(n.message,r,e)}))},onUnblock:function(){XM.setIdle(t())}}},uP=function(t,e,n,r){var o;return eu(tP(O(O({},t),{lazySink:r.shared.getSink,extraBehaviours:_([uA.config({channel:Vz,updateState:function(t,e){return B.some(e)},initialData:e}),Ok({})],t.extraBehaviours,!0),onEscape:function(t){Ri(t,ax)},dialogEvents:n,eventOrder:(o={},o[ui()]=[uA.name(),Ec.name()],o[yi()]=["scroll-lock",uA.name(),"messages","dialog-events","alloy.base.behaviour"],o[wi()]=["alloy.base.behaviour","dialog-events","messages",uA.name(),"scroll-lock"],o)})))},cP=function(t){return U(t,(function(t){return"menu"===t.type?function(t){var e=U(t.items,(function(t){var e=xo(!1);return O(O({},t),{storage:e})}));return O(O({},t),{items:e})}(t):t}))},sP=function(t){return K(t,(function(t,e){return"menu"===e.type?K(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},lP=function(t,e){return[ji(qo(),Mk),t(ix,(function(t,n){e.onClose(),n.onClose()})),t(ax,(function(t,e,n,r){e.onCancel(t),Ri(r,ix)})),Ii(lx,(function(t,n){return e.onUnblock()})),Ii(sx,(function(t,n){return e.onBlock(n.event)}))]},fP=function(t,e){var n=function(e,n){return Ii(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event,e)}))}))},r=function(t,e){uA.getState(t).get().each((function(n){e(n,t)}))};return _(_([],lP(n,e),!0),[n(ux,(function(t,e,n){e.onAction(t,{name:n.name})}))],!1)},dP=function(t,e,n){var r=function(e,n){return Ii(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){uA.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return _(_([],lP(r,e),!0),[r(cx,(function(t,e){return e.onSubmit(t)})),r(ox,(function(t,e,n){e.onChange(t,{name:n.name})})),r(ux,(function(t,e,r,o){var i=function(){return eh.focusIn(o)},a=function(t){return Ge(t,"disabled")||$e(t,"aria-disabled").exists((function(t){return"true"===t}))},u=ze(o.element),c=Dc(u);e.onAction(t,{name:r.name,value:r.value}),Dc(u).fold(i,(function(t){a(t)||c.exists((function(e){return xe(t,e)&&a(e)}))?i():n().toOptional().filter((function(e){return!xe(e.element,t)})).each(i)}))})),r(fx,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),Gi((function(e){var n=t();Of.setValue(e,n.getData())}))],!1)},mP=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=q(n,(function(t){return"start"===t.align})),o=function(t,e){return qw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:U(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},gP=function(t,e){return{dom:NR('<div class="tox-dialog__footer"></div>'),components:[],behaviours:xc([uA.config({channel:Wz,initialData:t,updateState:function(t,n){var r=U(n.buttons,(function(t){var n=vp(function(t,e){return KT(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return B.some({lookupByName:function(t,e){return function(t,e,n){return X(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:mP})])}},hP=function(t,e){return XM.parts.footer(gP(t,e))},pP=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=zd.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return ik.getField(n,e).fold((function(){var r=t.getFooter();return uA.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return B.some(t)}))}return B.none()},vP=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},i={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=Of.getValue(r),i=mt(n,(function(t){return t.get()}));return O(O({},o),i)},setData:function(e){r((function(r){var o=i.getData(),a=O(O({},o),e),u=function(t,e){var n=t.getRoot();return uA.getState(n).get().map((function(t){return jr(Vr("data",t.dataValidator,e))})).getOr(e)}(t,a),c=t.getFormWrapper();Of.setValue(c,u),dt(n,(function(t,e){wt(a,e)&&t.set(a[e])}))}))},disable:function(e){pP(t,e).each(Xd.disable)},enable:function(e){pP(t,e).each(Xd.enable)},focus:function(e){pP(t,e).each(dh.focus)},block:function(t){if(!o(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){Ni(e,sx,{message:t})}))},unblock:function(){r((function(t){Ri(t,lx)}))},showTab:function(e){r((function(n){var r=t.getBody();uA.getState(r).get().exists((function(t){return t.isTabPanel()}))&&zd.getCurrent(r).each((function(t){Mz.showTab(t,e)}))}))},redial:function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([Vz],r),n.getSystem().broadcastOn([jz],r.internalDialog),n.getSystem().broadcastOn([Uz],r.internalDialog),n.getSystem().broadcastOn([Wz],r.internalDialog),i.setData(r.initialData)}))},close:function(){r((function(t){Ri(t,ix)}))}};return i},bP=function(t,e,n){var r=oP(t.internalDialog.title,n),o=function(t,e){var n=$z(t,B.none(),e,!1);return XM.parts.body(n)}({body:t.internalDialog.body},n),i=cP(t.internalDialog.buttons),a=sP(i),u=hP({buttons:i},n),c=dP((function(){return m}),aP((function(){return f}),n.shared.providers,e),n.shared.getSink),s=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),l={header:r,body:o,footer:B.some(u),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=uP(l,t,c,n),d={getRoot:v(f),getBody:function(){return XM.getBody(f)},getFooter:function(){return XM.getFooter(f)},getFormWrapper:function(){var t=XM.getBody(f);return zd.getCurrent(t).getOr(t)}},m=vP(d,e.redial,a);return{dialog:f,instanceApi:m}},yP=function(t,e,n,r){var o,i,a,u,c,s=oa("dialog-label"),l=oa("dialog-content"),f=vp((a={title:t.internalDialog.title,draggable:!0},u=s,c=n.shared.providers,qw.sketch({dom:NR('<div class="tox-dialog__header"></div>'),components:[nP(a,B.some(u),c),rP(),eP(c)],containerBehaviours:xc([BM.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return fu(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=vp(function(t,e,n,r){return $z(t,B.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=cP(t.internalDialog.buttons),g=sP(m),h=vp(function(t,e){return gP(t,e)}({buttons:m},n)),p=dP((function(){return y}),{onBlock:function(t){RR.block(b,(function(e,r){return iP(t.message,r,n.shared.providers)}))},onUnblock:function(){RR.unblock(b)},onClose:function(){return e.closeWindow()}},n.shared.getSink),b=eu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=s,o["aria-describedby"]=l,o)},eventOrder:(i={},i[ui()]=[uA.name(),Ec.name()],i[ci()]=["execute-on-form"],i[yi()]=["reflecting","execute-on-form"],i),behaviours:xc([eh.config({mode:"cyclic",onEscape:function(t){return Ri(t,ix),B.some(!0)},useTabstopAt:function(t){return!Bk(t)&&("button"!==Pt(t)||"disabled"!==qe(t,"disabled"))}}),uA.config({channel:Vz,updateState:function(t,e){return B.some(e)},initialData:t}),dh.config({}),uh("execute-on-form",p.concat([qi(qo(),(function(t,e){eh.focusIn(t)}))])),RR.config({getRoot:function(){return B.some(b)}}),ah.config({}),Ok({})]),components:[f.asSpec(),d.asSpec(),h.asSpec()]}),y=vP({getRoot:v(b),getFooter:function(){return h.get(b)},getBody:function(){return d.get(b)},getFormWrapper:function(){var t=d.get(b);return zd.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:b,instanceApi:y}},wP=tinymce.util.Tools.resolve("tinymce.util.URI"),xP=["insertContent","setContent","execCommand","close","block","unblock"],CP=function(t){return i(t)&&-1!==xP.indexOf(t.mceAction)},SP=function(t,e,n,r){var a,u,s,l=oP(t.title,r),f=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[Ak({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:xc([Qw.config({}),dh.config({})])})]}],behaviours:xc([eh.config({mode:"acyclic",useTabstopAt:x(Bk)})])};return XM.parts.body(e)}(t),d=t.buttons.bind((function(t){return 0===t.length?B.none():B.some(hP({buttons:t},r))})),m=fP((function(){return C}),aP((function(){return w}),r.shared.providers,e)),g=O(O({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),h=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],p=new wP(t.url,{base_uri:new wP(window.location.href)}),v=p.protocol+"://"+p.host+(p.port?":"+p.port:""),b=Qc(),y=[uh("messages",[$i((function(){var e=es(Bt.fromDom(window),"message",(function(e){if(p.isSameOrigin(new wP(e.raw.origin))){var r=e.raw.data;CP(r)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!c(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(n,C,r):function(t){return!CP(t)&&i(t)&&wt(t,"mceAction")}(r)&&t.onMessage(C,r)}}));b.set(e)})),Gi(b.clear)]),Ec.config({channels:(a={},a[qz]={onReceive:function(t,e){lu(t.element,"iframe").each((function(t){t.dom.contentWindow.postMessage(e,v)}))}},a)})],w=uP({header:l,body:f,footer:d,extraClasses:h,extraBehaviours:y,extraStyles:g},t,m,r),C=(u=w,s=function(t){u.getSystem().isConnected()&&t(u)},{block:function(t){if(!o(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");s((function(e){Ni(e,sx,{message:t})}))},unblock:function(){s((function(t){Ri(t,lx)}))},close:function(){s((function(t){Ri(t,ix)}))},sendMessage:function(t){s((function(e){e.getSystem().broadcastOn([qz],t)}))}});return{dialog:w,instanceApi:C}},kP=function(t,e,n){return e&&n?[]:[z_.config({contextual:{lazyContext:function(){return B.some(Hn(Bt.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},TP=function(t){var e=t.backstage,n=t.editor,r=Pb(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){XM.hide(c),r()},i=vp(KT({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:B.none()},"cancel",t.backstage)),a=Yz(),u=Xz(o,e.providers),c=eu(tP({lazySink:function(){return e.getSink()},header:Kz(a,u),body:Jz(n,e.providers),footer:B.some(Qz(Zz([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ii(ax,o)],eventOrder:{}}));XM.show(c);var s=i.get(c);dh.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){XM.hide(s),r(t)},i=vp(KT({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:B.none()},"submit",t.backstage)),a=KT({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:B.none()},"cancel",t.backstage),u=Yz(),c=Xz((function(){return o(!1)}),e.providers),s=eu(tP({lazySink:function(){return e.getSink()},header:Kz(u,c),body:Jz(n,e.providers),footer:B.some(Qz(Zz([],[a,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ii(ax,(function(){return o(!1)})),Ii(cx,(function(){return o(!0)}))],eventOrder:{}}));XM.show(s);var l=i.get(s);dh.focus(l)}}}(t),a=function(t,r){return wz.openUrl((function(t){var o=SP(t,{closeWindow:function(){XM.hide(o.dialog),r(o.instanceApi)}},n,e);return XM.show(o.dialog),o.instanceApi}),t)},u=function(t,n){return wz.open((function(t,r,o){var i=r,a=bP({dataValidator:o,initialData:i,internalDialog:t},{redial:wz.redial,closeWindow:function(){XM.hide(a.dialog),n(a.instanceApi)}},e);return XM.show(a.dialog),a.instanceApi.setData(i),a.instanceApi}),t)},c=function(t,o,i,a){return wz.open((function(t,u,c){var s=jr(Vr("data",c,u)),l=Zc(),f=e.shared.header.isPositionedAtTop(),d=function(){return l.on((function(t){Xh.reposition(t),z_.refresh(t)}))},m=yP({dataValidator:c,initialData:s,internalDialog:t},{redial:wz.redial,closeWindow:function(){l.on(Xh.hide),n.off("ResizeEditor",d),l.clear(),i(m.instanceApi)}},e,a),g=eu(Xh.sketch(O(O({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},f?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:xc(_([uh("window-manager-inline-events",[Ii(xi(),(function(t,e){Ri(m.dialog,ax)}))])],kP(n,r,f),!0)),isExtraPart:function(t,e){return function(t){return Aw(t,".tox-alert-dialog")||Aw(t,".tox-confirm-dialog")}(e)}})));return l.set(g),Xh.showWithin(g,nu(m.dialog),{anchor:o},B.some(Ve())),r&&f||(z_.refresh(g),n.on("ResizeEditor",d)),m.instanceApi.setData(s),eh.focusIn(m.dialog),m.instanceApi}),t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?c(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?c(t,e.shared.anchors.cursor(),r,n.ariaAttrs):u(t,r)},openUrl:function(t,e){return a(t,e)},alert:function(t,e){o.open(t,(function(){e()}))},close:function(t){t.close()},confirm:function(t,e){i.open(t,(function(t){e(t)}))}}};T.add("silver",(function(t){var e=qM(t),n=e.uiMothership,r=e.backstage,o=e.renderUI,i=e.getUi;Nw(t,r.shared);var a=TP({editor:t,backstage:r});return{renderUI:o,getWindowManagerImpl:v(a),getNotificationManagerImpl:function(){return Np(t,{backstage:r},n)},ui:i()}}))}()},7575:(t,e,n)=>{!function(){"use strict";var e=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return{eq:t}},o=r((function(t,e){return t===e})),i=function(t){return r((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))},a=function(t,e){return function(t,e){return r((function(n,r){return t.eq(e(n),e(r))}))}(i(t),(function(t){return function(t,e){return Array.prototype.slice.call(t).sort(e)}(t,e)}))},u=function(t){return r((function(e,n){var r=Object.keys(e),i=Object.keys(n);if(!a(o).eq(r,i))return!1;for(var u=r.length,c=0;c<u;c++){var s=r[c];if(!t.eq(e[s],n[s]))return!1}return!0}))},c=r((function(t,n){if(t===n)return!0;var r=e(t);return r===e(n)&&(function(t){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(t)}(r)?t===n:"array"===r?i(c).eq(t,n):"object"===r&&u(c).eq(t,n))})),s=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},l=function(t){return function(e){return typeof e===t}},f=function(t){return function(e){return t===e}},d=s("string"),m=s("object"),g=s("array"),h=f(null),p=l("boolean"),v=f(void 0),b=function(t){return null==t},y=function(t){return!b(t)},w=l("function"),x=l("number"),C=function(){},S=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},k=function(t,e){return function(n){return t(e(n))}},T=function(t){return function(){return t}},O=function(t){return t},E=function(t,e){return t===e};function _(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var R=function(t){return function(e){return!t(e)}},N=function(t){return t()},A=function(t){t()},D=T(!1),M=T(!0),B=function(){return z},z=function(){var t=function(t){return t()},e=O;return{fold:function(t,e){return t()},isSome:D,isNone:M,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:T(null),getOrUndefined:T(void 0),or:e,orThunk:t,map:B,each:C,bind:B,exists:D,forall:M,filter:function(){return B()},toArray:function(){return[]},toString:T("none()")}}(),P=function(t){var e=T(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:M,isNone:D,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return P(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:z},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},L={some:P,none:B,from:function(t){return null==t?z:P(t)}},I=Array.prototype.slice,H=Array.prototype.indexOf,F=Array.prototype.push,V=function(t,e){return H.call(t,e)},j=function(t,e){return V(t,e)>-1},U=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},W=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},q=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},$=function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}},G=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var a=t[o];(e(a,o)?n:r).push(a)}return{pass:n,fail:r}},K=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},X=function(t,e,n){return $(t,(function(t,r){n=e(n,t,r)})),n},Y=function(t,e,n){return q(t,(function(t,r){n=e(n,t,r)})),n},J=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return L.some(i);if(n(i,r))break}return L.none()},Q=function(t,e){return J(t,e,D)},Z=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return L.some(n)}return L.none()},tt=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!g(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);F.apply(e,t[n])}return e}(W(t,e))},et=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},nt=function(t){var e=I.call(t,0);return e.reverse(),e},rt=function(t,e){return K(t,(function(t){return!j(e,t)}))},ot=function(t,e){var n=I.call(t,0);return n.sort(e),n},it=function(t,e){return e>=0&&e<t.length?L.some(t[e]):L.none()},at=function(t){return it(t,0)},ut=function(t){return it(t,t.length-1)},ct=w(Array.from)?Array.from:function(t){return I.call(t)},st=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return L.none()},lt=Object.keys,ft=Object.hasOwnProperty,dt=function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},mt=function(t,e){return gt(t,(function(t,n){return{k:n,v:e(t,n)}}))},gt=function(t,e){var n={};return dt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},ht=function(t){return function(e,n){t[n]=e}},pt=function(t,e,n,r){return dt(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},vt=function(t,e){var n={};return pt(t,e,ht(n),C),n},bt=function(t){return function(t,e){var n=[];return dt(t,(function(t,r){n.push(e(t,r))})),n}(t,O)},yt=function(t,e){return wt(t,e)?L.from(t[e]):L.none()},wt=function(t,e){return ft.call(t,e)},xt=function(t,e){return wt(t,e)&&void 0!==t[e]&&null!==t[e]},Ct=Array.isArray,St=function(t,e,n){var r,o;if(!t)return!1;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return!1}else for(r in t)if(wt(t,r)&&!1===e.call(n,t[r],r,t))return!1;return!0},kt=function(t,e){var n=[];return St(t,(function(r,o){n.push(e(r,o,t))})),n},Tt=function(t,e){var n=[];return St(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},Ot=function(t,e){if(t)for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},Et=function(t,e,n,r){for(var o=v(n)?t[0]:n,i=0;i<t.length;i++)o=e.call(r,o,t[i],i);return o},_t=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},Rt=function(t){return t[t.length-1]},Nt=function(){return(Nt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function At(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var Dt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Mt=function(){return Bt(0,0)},Bt=function(t,e){return{major:t,minor:e}},zt={nu:Bt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Mt():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Bt(r(1),r(2))}(t,n)},unknown:Mt},Pt=function(t,e){var n=String(e).toLowerCase();return Q(t,(function(t){return t.search(n)}))},Lt=function(t,e){return-1!==t.indexOf(e)},It=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,0)},Ht=function(t){return function(e){return e.replace(t,"")}},Ft=Ht(/^\s+|\s+$/g),Vt=Ht(/^\s+/g),jt=Ht(/\s+$/g),Ut=function(t){return t.length>0},Wt=function(t){return!Ut(t)},qt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$t=function(t){return function(e){return Lt(e,t)}},Gt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Lt(t,"edge/")&&Lt(t,"chrome")&&Lt(t,"safari")&&Lt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,qt],search:function(t){return Lt(t,"chrome")&&!Lt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Lt(t,"msie")||Lt(t,"trident")}},{name:"Opera",versionRegexes:[qt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$t("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$t("firefox")},{name:"Safari",versionRegexes:[qt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Lt(t,"safari")||Lt(t,"mobile/"))&&Lt(t,"applewebkit")}}],Kt=[{name:"Windows",search:$t("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Lt(t,"iphone")||Lt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$t("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$t("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$t("linux"),versionRegexes:[]},{name:"Solaris",search:$t("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$t("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:$t("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Xt={browsers:T(Gt),oses:T(Kt)},Yt="Edge",Jt="Chrome",Qt="Opera",Zt="Firefox",te="Safari",ee=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Yt),isChrome:r(Jt),isIE:r("IE"),isOpera:r(Qt),isFirefox:r(Zt),isSafari:r(te)}},ne={unknown:function(){return ee({current:void 0,version:zt.unknown()})},nu:ee,edge:T(Yt),chrome:T(Jt),ie:T("IE"),opera:T(Qt),firefox:T(Zt),safari:T(te)},re="Windows",oe="Android",ie="Linux",ae="Solaris",ue="FreeBSD",ce="ChromeOS",se=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(re),isiOS:r("iOS"),isAndroid:r(oe),isOSX:r("OSX"),isLinux:r(ie),isSolaris:r(ae),isFreeBSD:r(ue),isChromeOS:r(ce)}},le={unknown:function(){return se({current:void 0,version:zt.unknown()})},nu:se,windows:T(re),ios:T("iOS"),android:T(oe),linux:T(ie),osx:T("OSX"),solaris:T(ae),freebsd:T(ue),chromeos:T(ce)},fe=function(t,e,n){var r=Xt.browsers(),o=Xt.oses(),i=e.bind((function(t){return function(t,e){return st(e.brands,(function(e){var n=e.brand.toLowerCase();return Q(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:zt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return Pt(t,e).map((function(t){var n=zt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(ne.unknown,ne.nu),a=function(t,e){return Pt(t,e).map((function(t){var n=zt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(le.unknown,le.nu),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:T(o),isiPhone:T(i),isTablet:T(c),isPhone:T(s),isTouch:T(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:T(l),isDesktop:T(f)}}(a,i,t,n);return{browser:i,os:a,deviceType:u}},de=function(t){return window.matchMedia(t).matches},me=Dt((function(){return fe(navigator.userAgent,L.from(navigator.userAgentData),de)})),ge=function(){return me()},he=navigator.userAgent,pe=ge(),ve=pe.browser,be=pe.os,ye=pe.deviceType,we=/WebKit/.test(he)&&!ve.isEdge(),xe="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,Ce=-1!==he.indexOf("Windows Phone"),Se={opera:ve.isOpera(),webkit:we,ie:!(!ve.isIE()&&!ve.isEdge())&&ve.version.major,gecko:ve.isFirefox(),mac:be.isOSX()||be.isiOS(),iOS:ye.isiPad()||ye.isiPhone(),android:be.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:ve.isIE()?document.documentMode||7:10,fileApi:xe,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!ve.isIE(),desktop:ye.isDesktop(),windowsPhone:Ce,browser:{current:ve.current,version:ve.version,isChrome:ve.isChrome,isEdge:ve.isEdge,isFirefox:ve.isFirefox,isIE:ve.isIE,isOpera:ve.isOpera,isSafari:ve.isSafari},os:{current:be.current,version:be.version,isAndroid:be.isAndroid,isChromeOS:be.isChromeOS,isFreeBSD:be.isFreeBSD,isiOS:be.isiOS,isLinux:be.isLinux,isOSX:be.isOSX,isSolaris:be.isSolaris,isWindows:be.isWindows},deviceType:{isDesktop:ye.isDesktop,isiPad:ye.isiPad,isiPhone:ye.isiPhone,isPhone:ye.isPhone,isTablet:ye.isTablet,isTouch:ye.isTouch,isWebView:ye.isWebView}},ke=/^\s*|\s*$/g,Te=function(t){return null==t?"":(""+t).replace(ke,"")},Oe=function(t,e){return e?!("array"!==e||!Ct(t))||typeof t===e:void 0!==t},Ee=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),St(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;Ee(t,e,n,r)})))},_e={trim:Te,isArray:Ct,is:Oe,toArray:function(t){if(Ct(t))return t;for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e},makeMap:function(t,e,n){var r;for(e=e||",","string"==typeof(t=t||[])&&(t=t.split(e)),n=n||{},r=t.length;r--;)n[t[r]]={};return n},each:St,map:kt,grep:Tt,inArray:Ot,hasOwn:wt,extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(wt(o,i)){var a=o[i];void 0!==a&&(t[i]=a)}}return t},create:function(t,e,n){var r,o,i,a=this,u=0,c=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],s=a.createNS(t[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===t[2])return s[c]=e,void(this.onCreate&&this.onCreate(t[2],t[3],s[c]));e[c]||(e[c]=function(){},u=1),s[c]=e[c],a.extend(s[c].prototype,e),t[5]&&(r=a.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=u?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],a.each(r,(function(t,e){s[c].prototype[e]=r[e]})),a.each(e,(function(t,e){r[e]?s[c].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==c&&(s[c].prototype[e]=t)}))),a.each(e.static,(function(t,e){s[c][e]=t}))}},walk:Ee,createNS:function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0;n<t.length;n++)e[r=t[n]]||(e[r]={}),e=e[r];return e},resolve:function(t,e){var n,r;for(e=e||window,n=0,r=(t=t.split(".")).length;n<r&&(e=e[t[n]]);n++);return e},explode:function(t,e){return!t||Oe(t,"array")?t:kt(t.split(e||","),Te)},_addCacheSuffix:function(t){var e=Se.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},Re=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Ne={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Re(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Re(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Re(n)},fromDom:Re,fromPoint:function(t,e,n){return L.from(t.dom.elementFromPoint(e,n)).map(Re)}},Ae=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},De=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Me=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Be=function(t,e){return t.dom===e.dom},ze=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},Pe=function(t,e){return ge().browser.isIE()?ze(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)};"undefined"!=typeof window?window:Function("return this;")();var Le=function(t){return t.dom.nodeName.toLowerCase()},Ie=function(t){return t.dom.nodeType},He=function(t){return function(e){return Ie(e)===t}},Fe=He(1),Ve=He(3),je=He(9),Ue=He(11),We=function(t){return Ne.fromDom(t.dom.ownerDocument)},qe=function(t){return je(t)?t:We(t)},$e=function(t){return Ne.fromDom(qe(t).dom.defaultView)},Ge=function(t){return L.from(t.dom.parentNode).map(Ne.fromDom)},Ke=function(t){return L.from(t.dom.previousSibling).map(Ne.fromDom)},Xe=function(t){return L.from(t.dom.nextSibling).map(Ne.fromDom)},Ye=function(t){return nt(Ae(t,Ke))},Je=function(t){return Ae(t,Xe)},Qe=function(t){return W(t.dom.childNodes,Ne.fromDom)},Ze=function(t,e){var n=t.dom.childNodes;return L.from(n[e]).map(Ne.fromDom)},tn=function(t){return Ze(t,0)},en=function(t){return Ze(t,t.dom.childNodes.length-1)},nn=function(t){return t.dom.childNodes.length},rn=function(t){return Ue(t)&&y(t.dom.host)},on=w(Element.prototype.attachShadow)&&w(Node.prototype.getRootNode),an=T(on),un=on?function(t){return Ne.fromDom(t.dom.getRootNode())}:qe,cn=function(t){return rn(t)?t:function(t){var e=t.dom.head;if(null==e)throw new Error("Head is not available yet");return Ne.fromDom(e)}(qe(t))},sn=function(t){return Ne.fromDom(t.dom.host)},ln=function(t){return y(t.dom.shadowRoot)},fn=function(t,e){Ge(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},dn=function(t,e){Xe(t).fold((function(){Ge(t).each((function(t){gn(t,e)}))}),(function(t){fn(t,e)}))},mn=function(t,e){tn(t).fold((function(){gn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},gn=function(t,e){t.dom.appendChild(e.dom)},hn=function(t,e){q(e,(function(e){gn(t,e)}))},pn=function(t){t.dom.textContent="",q(Qe(t),(function(t){vn(t)}))},vn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},bn=function(t){var e,n=Qe(t);n.length>0&&(e=t,q(n,(function(t){fn(e,t)}))),vn(t)},yn=function(t){var e=Ve(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n=e.ownerDocument;return function(t){var e=un(t);return rn(e)?L.some(e):L.none()}(Ne.fromDom(e)).fold((function(){return n.body.contains(e)}),k(yn,sn))},wn=function(t,e){return{left:t,top:e,translate:function(n,r){return wn(t+n,e+r)}}},xn=wn,Cn=function(t,e){return void 0!==t?t:void 0!==e?e:0},Sn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?xn(n.offsetLeft,n.offsetTop):yn(t)?function(t){var e=t.getBoundingClientRect();return xn(e.left,e.top)}(e):xn(0,0)},kn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return xn(n,r)},Tn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},On=function(t,e){ge().browser.isSafari()&&w(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},En=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},_n=function(t){var e=void 0===t?window:t,n=e.document,r=kn(Ne.fromDom(n));return function(t){var e=void 0===t?window:t;return ge().browser.isFirefox()?L.none():L.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return En(r.left,r.top,n,o)}),(function(t){return En(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Rn=function(t){return function(e){return!!e&&e.nodeType===t}},Nn=function(t){return!!t&&!Object.getPrototypeOf(t)},An=Rn(1),Dn=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return j(e,n)}return!1}},Mn=function(t,e){var n=e.toLowerCase().split(" ");return function(e){if(An(e))for(var r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}},Bn=function(t){return function(e){return An(e)&&e.hasAttribute(t)}},zn=function(t){return An(t)&&t.hasAttribute("data-mce-bogus")},Pn=function(t){return An(t)&&"TABLE"===t.tagName},Ln=function(t){return function(e){if(An(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},In=Dn(["textarea","input"]),Hn=Rn(3),Fn=Rn(8),Vn=Rn(9),jn=Rn(11),Un=Dn(["br"]),Wn=Dn(["img"]),qn=Ln("true"),$n=Ln("false"),Gn=Dn(["td","th"]),Kn=Dn(["video","audio","object","embed"]),Xn=function(t,e,n){return void 0===n&&(n=E),t.exists((function(t){return n(t,e)}))},Yn=function(t,e,n){return t.isSome()&&e.isSome()?L.some(n(t.getOrDie(),e.getOrDie())):L.none()},Jn=function(t){return void 0!==t.style&&w(t.style.getPropertyValue)},Qn=function(t,e,n){if(!(d(n)||p(n)||x(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Zn=function(t,e,n){Qn(t.dom,e,n)},tr=function(t,e){var n=t.dom;dt(e,(function(t,e){Qn(n,e,t)}))},er=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},nr=function(t,e){return L.from(er(t,e))},rr=function(t,e){t.dom.removeAttribute(e)},or=function(t,e){var n=t.dom;dt(e,(function(t,e){!function(t,e,n){if(!d(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Jn(t)&&t.style.setProperty(e,n)}(n,e,t)}))},ir=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||yn(t)?r:ar(n,e)},ar=function(t,e){return Jn(t)?t.style.getPropertyValue(e):""},ur=function(t,e){var n=t.dom,r=ar(n,e);return L.from(r).filter((function(t){return t.length>0}))},cr=function(t){var e={},n=t.dom;if(Jn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},sr=ge().browser,lr=function(t){return Q(t,Fe)},fr=function(t,e){return t.children&&j(t.children,e)},dr=function(t,e,n){var r=0,o=0,i=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===ir(Ne.fromDom(t),"position")){var a=e.getBoundingClientRect();return{x:r=a.left+(i.documentElement.scrollLeft||t.scrollLeft)-i.documentElement.clientLeft,y:o=a.top+(i.documentElement.scrollTop||t.scrollTop)-i.documentElement.clientTop}}for(var u=e;u&&u!==n&&u.nodeType&&!fr(u,n);){var c=u;r+=c.offsetLeft||0,o+=c.offsetTop||0,u=c.offsetParent}for(u=e.parentNode;u&&u!==n&&u.nodeType&&!fr(u,n);)r-=u.scrollLeft||0,o-=u.scrollTop||0,u=u.parentNode;o+=function(t){return sr.isFirefox()&&"table"===Le(t)?lr(Qe(t)).filter((function(t){return"caption"===Le(t)})).bind((function(t){return lr(Je(t)).map((function(e){var n=e.dom.offsetTop,r=t.dom.offsetTop,o=t.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(Ne.fromDom(e))}return{x:r,y:o}},mr={},gr={exports:mr};!function(t,e,r,o){var i,a;i=this,a=function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},e={exports:{}};!function(e){!function(t){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void u(e.promise,t)}a(e.promise,r)}else(1===t._state?a:u)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){u(t,e)}var r,i}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(t){o(i,t)}),n)}e[i]=a,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(t)}(e);var r=e.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||r}},"object"==typeof e&&void 0!==r?r.exports=a():"function"==typeof t&&t.amd?t(a):(i="undefined"!=typeof globalThis?globalThis:i||self).EphoxContactWrapper=a()}(void 0,mr,gr);var hr=gr.exports.boltExport,pr=function(t){var e=L.none(),n=[],r=function(t){o()?a(t):n.push(t)},o=function(){return e.isSome()},i=function(t){q(t,a)},a=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=L.some(t),i(n),n=[])})),{get:r,map:function(t){return pr((function(e){r((function(n){e(t(n))}))}))},isReady:o}},vr={nu:pr,pure:function(t){return pr((function(e){e(t)}))}},br=function(t){setTimeout((function(){throw t}),0)},yr=function(t){var e=function(e){t().then(e,br)};return{map:function(e){return yr((function(){return t().then(e)}))},bind:function(e){return yr((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return yr((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return vr.nu(e)},toCached:function(){var e=null;return yr((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},wr=function(t){return yr((function(){return new hr(t)}))},xr=function(t,e){return e((function(e){var n=[],r=0;0===t.length?e([]):q(t,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))}))}))},Cr=function(t){return{isValue:M,isError:D,getOr:T(t),getOrThunk:T(t),getOrDie:T(t),or:function(e){return Cr(t)},orThunk:function(e){return Cr(t)},fold:function(e,n){return n(t)},map:function(e){return Cr(e(t))},mapError:function(e){return Cr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return L.some(t)}}},Sr=function(t){return{isValue:D,isError:M,getOr:O,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:O,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Sr(t)},mapError:function(e){return Sr(e(t))},each:C,bind:function(e){return Sr(t)},exists:D,forall:M,toOptional:L.none}},kr={value:Cr,error:Sr,fromOption:function(t,e){return t.fold((function(){return Sr(e)}),Cr)}},Tr=function(t){if(!g(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return q(t,(function(r,o){var i=lt(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!g(u))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==u.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+u.length+" ("+u+"), got "+i);var c=function(t){var r=lt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!et(e,(function(t){return j(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:c,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}})),n};Tr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Or=function(t){return t.fold(O,O)};function Er(t,e,n,r,o){return t(n,r)?L.some(n):w(o)&&o(n)?L.none():e(n,r,o)}var _r,Rr,Nr,Ar,Dr,Mr,Br,zr,Pr,Lr,Ir,Hr,Fr,Vr,jr,Ur,Wr,qr,$r,Gr,Kr=function(t,e,n){for(var r=t.dom,o=w(n)?n:D;r.parentNode;){r=r.parentNode;var i=Ne.fromDom(r);if(e(i))return L.some(i);if(o(i))break}return L.none()},Xr=function(t,e,n){return Er((function(t,e){return e(t)}),Kr,t,e,n)},Yr=function(t,e){return Q(t.dom.childNodes,(function(t){return e(Ne.fromDom(t))})).map(Ne.fromDom)},Jr=function(t,e,n){return Kr(t,(function(t){return De(t,e)}),n)},Qr=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Me(n)?L.none():L.from(n.querySelector(t)).map(Ne.fromDom)}(e,t)},Zr=function(t,e,n){return Er((function(t,e){return De(t,e)}),Jr,t,e,n)},to=window.Promise?window.Promise:hr,eo=function(t,e){return"number"!=typeof e&&(e=0),setTimeout(t,e)},no=function(t,e){return"number"!=typeof e&&(e=1),setInterval(t,e)},ro=function(t,e){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=eo((function(){t.apply(this,r)}),e)};return r.stop=function(){clearTimeout(n)},r},oo={requestAnimationFrame:function(t,e){_r?_r.then(t):_r=new to((function(t){e||(e=document.body),function(t,e){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];n||(n=function(t){window.setTimeout(t,0)}),n(t,e)}(t,e)})).then(t)},setTimeout:eo,setInterval:no,setEditorTimeout:function(t,e,n){return eo((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,n){var r=no((function(){t.removed?clearInterval(r):e()}),n);return r},debounce:ro,throttle:ro,clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)}},io=function(t,e){void 0===e&&(e={});var n=0,r={},o=Ne.fromDom(t),i=qe(o),a=e.maxLoadTime||5e3,u=function(u,c,s){var l,f=_e._addCacheSuffix(u),d=function(t){return yt(r,t).getOrThunk((function(){return{id:"mce-u"+n++,passed:[],failed:[],count:0}}))}(f);r[f]=d,d.count++;var m=function(t,e){for(var n=t.length;n--;)t[n]();d.status=e,d.passed=[],d.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},g=function(){return m(d.passed,2)},h=function(){return m(d.failed,3)},p=function(){var e;e=p,function(){for(var e=t.styleSheets,n=e.length;n--;){var r=e[n].ownerNode;if(r&&r.id===l.id)return g(),!0}return!1}()||(Date.now()-y<a?oo.setTimeout(e):h())};if(c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var v=Ne.fromTag("link",i.dom);tr(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();e.contentCssCors&&Zn(v,"crossOrigin","anonymous"),e.referrerPolicy&&Zn(v,"referrerpolicy",e.referrerPolicy),(l=v.dom).onload=p,l.onerror=h,b=v,gn(cn(o),b),Zn(v,"href",f)}else h();else g()},c=function(t){return wr((function(e){u(t,S(e,T(kr.value(t))),S(e,T(kr.error(t))))}))},s=function(t){var e=_e._addCacheSuffix(t);yt(r,e).each((function(t){var n,i;0===--t.count&&(delete r[e],n=t.id,i=cn(o),Qr(i,"#"+n).each(vn))}))};return{load:u,loadAll:function(t,e,n){var r;(r=W(t,c),xr(r,wr)).get((function(t){var r=G(t,(function(t){return t.isValue()}));r.fail.length>0?n(r.fail.map(Or)):e(r.pass.map(Or))}))},unload:s,unloadAll:function(t){q(t,(function(t){s(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}},ao=function(){var t=new WeakMap;return{forElement:function(e,n){var r=un(e).dom;return L.from(t.get(r)).getOrThunk((function(){var e=io(r,n);return t.set(r,e),e}))}}}(),uo=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,a;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(a=o[e];a;a=a[e])if(!a[e])return a;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),co=function(t){var e;return function(n){return e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,M),wt(e,Le(n))}},so=co(["h1","h2","h3","h4","h5","h6"]),lo=co(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),fo=function(t){return Fe(t)&&!lo(t)},mo=function(t){return Fe(t)&&"br"===Le(t)},go=co(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),ho=co(["ul","ol","dl"]),po=co(["li","dd","dt"]),vo=co(["thead","tbody","tfoot"]),bo=co(["td","th"]),yo=co(["pre","script","textarea","style"]),wo=" ",xo="\ufeff",Co=function(t){return"\ufeff"===t},So=function(t){return t.replace(/\uFEFF/g,"")},ko=An,To=Hn,Oo=function(t){return To(t)&&(t=t.parentNode),ko(t)&&t.hasAttribute("data-mce-caret")},Eo=function(t){return To(t)&&Co(t.data)},_o=function(t){return Oo(t)||Eo(t)},Ro=function(t){return t.firstChild!==t.lastChild||!Un(t.firstChild)},No=function(t){var e=t.container();return!!Hn(e)&&(e.data.charAt(t.offset())===xo||t.isAtStart()&&Eo(e.previousSibling))},Ao=function(t){var e=t.container();return!!Hn(e)&&(e.data.charAt(t.offset()-1)===xo||t.isAtEnd()&&Eo(e.nextSibling))},Do=function(t,e,n){var r,o=e.ownerDocument.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o},Mo=function(t){return To(t)&&t.data[0]===xo},Bo=function(t){return To(t)&&t.data[t.data.length-1]===xo},zo=function(t){return t&&t.hasAttribute("data-mce-caret")?(e=t.getElementsByTagName("br"),n=e[e.length-1],zn(n)&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n},Po=function(t){return Oo(t.startContainer)},Lo=qn,Io=$n,Ho=Un,Fo=Hn,Vo=Dn(["script","style","textarea"]),jo=Dn(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Uo=Dn(["table"]),Wo=_o,qo=function(t){return!Wo(t)&&(Fo(t)?!Vo(t.parentNode):jo(t)||Ho(t)||Uo(t)||$o(t))},$o=function(t){return!1===function(t){return An(t)&&"true"===t.getAttribute("unselectable")}(t)&&Io(t)},Go=function(t,e){return qo(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if($o(t))return!1;if(Lo(t))return!0}return!0}(t,e)},Ko=/^[ \t\r\n]*$/,Xo=function(t){return Ko.test(t)},Yo=function(t,e){var n,r,o,i=Ne.fromDom(e),a=Ne.fromDom(t);return n=a,r="pre,code",o=_(Be,i),Jr(n,r,o).isSome()},Jo=function(t,e){return qo(t)&&!1===function(t,e){return Hn(t)&&Xo(t.data)&&!1===Yo(t,e)}(t,e)||function(t){return An(t)&&"A"===t.nodeName&&!t.hasAttribute("href")&&(t.hasAttribute("name")||t.hasAttribute("id"))}(t)||Qo(t)},Qo=Bn("data-mce-bookmark"),Zo=Bn("data-mce-bogus"),ti=(Rr="data-mce-bogus",Nr="all",function(t){return An(t)&&t.getAttribute(Rr)===Nr}),ei=function(t,e){return void 0===e&&(e=!0),function(t,e){var n=0;if(Jo(t,t))return!1;var r=t.firstChild;if(!r)return!0;var o=new uo(r,t);do{if(e){if(ti(r)){r=o.next(!0);continue}if(Zo(r)){r=o.next();continue}}if(Un(r))n++,r=o.next();else{if(Jo(r,t))return!1;r=o.next()}}while(r);return n<=1}(t.dom,e)},ni=function(t,e){return y(t)&&(Jo(t,e)||fo(Ne.fromDom(t)))},ri=function(t){return function(t){return"span"===t.nodeName.toLowerCase()}(t)&&"bookmark"===t.getAttribute("data-mce-type")},oi=function(t,e){return Hn(t)&&t.data.length>0&&function(t,e){var n=new uo(t,e).prev(!1),r=new uo(t,e).next(!1),o=v(n)||ni(n,e),i=v(r)||ni(r,e);return o&&i}(t,e)},ii=function(t,e,n){var r=n||e;if(An(e)&&ri(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)ii(t,o[i],r);if(An(e)){var a=e.childNodes;1===a.length&&ri(a[0])&&e.parentNode.insertBefore(a[0],e)}return function(t){return jn(t)||Vn(t)}(e)||Jo(e,r)||function(t){return!!An(t)&&t.childNodes.length>0}(e)||oi(e,r)||t.remove(e),e},ai=_e.makeMap,ui=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ci=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,si=/[<>&\"\']/g,li=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,fi={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},di={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},mi={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},gi=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),di[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},hi=gi("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),pi=function(t,e){return t.replace(e?ui:ci,(function(t){return di[t]||t}))},vi=function(t,e){return t.replace(e?ui:ci,(function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":di[t]||"&#"+t.charCodeAt(0)+";"}))},bi=function(t,e,n){return n=n||hi,t.replace(e?ui:ci,(function(t){return di[t]||n[t]||t}))},yi={encodeRaw:pi,encodeAllRaw:function(t){return(""+t).replace(si,(function(t){return di[t]||t}))},encodeNumeric:vi,encodeNamed:bi,getEncodeFunc:function(t,e){var n=gi(e)||hi,r=ai(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?ui:ci,(function(t){return void 0!==di[t]?di[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return bi(t,e,n)}:bi:r.numeric?vi:pi},decode:function(t){return t.replace(li,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):fi[e]||String.fromCharCode(e):mi[t]||hi[t]||function(t){var e=Ne.fromTag("div").dom;return e.innerHTML=t,e.textContent||e.innerText||t}(t)}))}},wi={},xi={},Ci=_e.makeMap,Si=_e.each,ki=_e.extend,Ti=_e.explode,Oi=_e.inArray,Ei=function(t,e){return(t=_e.trim(t))?t.split(e||" "):[]},_i=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),Si(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?Ci(t,/[, ]/):Ti(t,/[, ]/)}))),n},Ri=function(t){var e={},n={},r=[],o={},i={},a=function(e,n,r){var o=t[e];return o?o=Ci(o,/[, ]/,Ci(o.toUpperCase(),/[, ]/)):(o=wi[e])||(o=Ci(n," ",Ci(n.toUpperCase()," ")),o=ki(o,r),wi[e]=o),o},u=function(t){var e,n,r,o,i,a,u={},c=function(t,n,r){var o,i,a,c=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};n=n||"","string"==typeof(r=r||[])&&(r=Ei(r));var s=Ei(t);for(o=s.length;o--;)a={attributes:c(i=Ei([e,n].join(" "))),attributesOrder:i,children:c(r,xi)},u[s[o]]=a},s=function(t,e){var n,r,o,i,a=Ei(t);n=a.length;for(var c=Ei(e);n--;)for(r=u[a[n]],o=0,i=c.length;o<i;o++)r.attributes[c[o]]={},r.attributesOrder.push(c[o])};return wi[t]?wi[t]:(e="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==t&&(e+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(e+=" xml:lang",r=[r,a="acronym applet basefont big font strike tt"].join(" "),Si(Ei(a),(function(t){c(t,"",r)})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),Si(Ei(i),(function(t){c(t,"",o)}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",r),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==t&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==t&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),Si(Ei("a form meter progress dfn"),(function(t){u[t]&&delete u[t].children[t]})),delete u.caption.children.table,delete u.script,wi[t]=u,u)}((t=t||{}).schema);!1===t.verify_html&&(t.valid_elements="*[*]");var c=_i(t.valid_styles),s=_i(t.invalid_styles,"map"),l=_i(t.valid_classes,"map"),f=a("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=a("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=a("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=a("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),h="td th iframe video audio object script code",p=a("non_empty_elements",h+" pre",m),v=a("move_caret_before_on_enter_elements",h+" table",m),b=a("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),y=a("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",b),w=a("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");Si((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){i[t]=new RegExp("</"+t+"[^>]*>","gi")}));var x=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},C=function(t){var n,o,i,a,u,c,s,l,f,d,m,g,h,p,v,b,y,w,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(t){var T=Ei(t,",");for(e["@"]&&(b=e["@"].attributes,y=e["@"].attributesOrder),n=0,o=T.length;n<o;n++)if(u=C.exec(T[n])){if(p=u[1],f=u[2],v=u[3],l=u[5],c={attributes:g={},attributesOrder:h=[]},"#"===p&&(c.paddEmpty=!0),"-"===p&&(c.removeEmpty=!0),"!"===u[4]&&(c.removeEmptyAttrs=!0),b&&(dt(b,(function(t,e){g[e]=t})),h.push.apply(h,y)),l)for(i=0,a=(l=Ei(l,"|")).length;i<a;i++)if(u=S.exec(l[i])){if(s={},m=u[1],d=u[2].replace(/[\\:]:/g,":"),p=u[3],w=u[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],h.splice(Oi(h,d),1);continue}p&&("="===p&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:w}),s.defaultValue=w),":"===p&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:w}),s.forcedValue=w),"<"===p&&(s.validValues=Ci(w,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=x(d),c.attributePatterns.push(s)):(g[d]||h.push(d),g[d]=s)}b||"@"!==f||(b=g,y=h),v&&(c.outputName=f,e[v]=c),k.test(f)?(c.pattern=x(f),r.push(c)):e[f]=c}}},S=function(t){e={},r=[],C(t),Si(u,(function(t,e){n[e]=t.children}))},k=function(t){var r=/^(~)?(.+)$/;t&&(wi.text_block_elements=wi.block_elements=null,Si(Ei(t,","),(function(t){var i=r.exec(t),a="~"===i[1],u=a?"span":"div",c=i[2];if(n[c]=n[u],o[c]=u,a||(y[c.toUpperCase()]={},y[c]={}),!e[c]){var s=e[u];delete(s=ki({},s)).removeEmptyAttrs,delete s.removeEmpty,e[c]=s}Si(n,(function(t,e){t[u]&&(n[e]=t=ki({},n[e]),t[c]=t[u])}))})))},O=function(e){var r=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;wi[t.schema]=null,e&&Si(Ei(e,","),(function(t){var e,o,i=r.exec(t);i&&(o=i[1],e=o?n[i[2]]:n[i[2]]={"#comment":{}},e=n[i[2]],Si(Ei(i[3],"|"),(function(t){"-"===o?delete e[t]:e[t]={}})))}))},E=function(t){var n,o=e[t];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(t))return o};t.valid_elements?S(t.valid_elements):(Si(u,(function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children})),"html5"!==t.schema&&Si(Ei("strong/b em/i"),(function(t){var n=Ei(t,"/");e[n[1]].outputName=n[0]})),Si(Ei("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(t){e[t]&&(e[t].removeEmpty=!0)})),Si(Ei("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){e[t].paddEmpty=!0})),Si(Ei("span"),(function(t){e[t].removeEmptyAttrs=!0}))),k(t.custom_elements),O(t.valid_children),C(t.extended_valid_elements),O("+ol[ul|ol],+ul[ul|ol]"),Si({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(function(t,n){e[n]&&(e[n].parentsRequired=Ei(t))})),t.invalid_elements&&Si(Ti(t.invalid_elements),(function(t){e[t]&&delete e[t]})),E("span")||C("span[!data-mce-type|*]");var _=T(c),R=T(s),N=T(l),A=T(g),D=T(y),M=T(b),B=T(w),z=T(m),P=T(d),L=T(p),I=T(v),H=T(f),F=T(i),V=T(o);return{children:n,elements:e,getValidStyles:_,getValidClasses:N,getBlockElements:D,getInvalidStyles:R,getShortEndedElements:z,getTextBlockElements:M,getTextInlineElements:B,getBoolAttrs:A,getElementRule:E,getSelfClosingElements:P,getNonEmptyElements:L,getMoveCaretBeforeOnEnterElements:I,getWhiteSpaceElements:H,getSpecialElements:F,isValidChild:function(t,e){var r=n[t.toLowerCase()];return!(!r||!r[e.toLowerCase()])},isValid:function(t,e){var n,r,o=E(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:V,addValidElements:C,setValidElements:S,addCustomElements:k,addValidChildren:O}},Ni=function(t,e,n,r){var o=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},Ai=function(t,e){var n,r,o,i=this,a=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,u=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,c=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,l={},f="\ufeff";t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var d="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<d.length;n++)l[d[n]]=f+n,l[f+n]=d[n];return{toHex:function(t){return t.replace(a,Ni)},parse:function(e){var r,o,d,m,g,h,p,v,b={},y=t.url_converter,w=t.url_converter_scope||i,x=function(t,e,r){var o=b[t+"-top"+e];if(o){var i=b[t+"-right"+e];if(i){var a=b[t+"-bottom"+e];if(a){var u=b[t+"-left"+e];if(u){var c=[o,i,a,u];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(b[t+e]=-1===n?c[0]:c.join(" "),delete b[t+"-top"+e],delete b[t+"-right"+e],delete b[t+"-bottom"+e],delete b[t+"-left"+e])}}}}},C=function(t){var e,n=b[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return b[t]=n[0],!0}},S=function(t){return m=!0,l[t]},k=function(t,e){return m&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return l[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},T=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},O=function(t){return t.replace(/\\[0-9a-f]+/gi,T)},E=function(e,n,r,o,i,a){if(i=i||a)return"'"+(i=k(i)).replace(/\'/g,"\\'")+"'";if(n=k(n||r||o),!t.allow_script_urls){var u=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(u))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(u))return""}return y&&(n=y.call(w,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,S).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,S)}));r=c.exec(e);)if(c.lastIndex=r.index+r[0].length,o=r[1].replace(s,"").toLowerCase(),d=r[2].replace(s,""),o&&d){if(o=O(o),d=O(d),-1!==o.indexOf(f)||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(d)))continue;"font-weight"===o&&"700"===d?d="bold":"color"!==o&&"background-color"!==o||(d=d.toLowerCase()),d=(d=d.replace(a,Ni)).replace(u,E),b[o]=m?k(d,!0):d}x("border","",!0),x("border","-width"),x("border","-color"),x("border","-style"),x("padding",""),x("margin",""),g="border",p="border-style",v="border-color",C(h="border-width")&&C(p)&&C(v)&&(b[g]=b[h]+" "+b[p]+" "+b[v],delete b[h],delete b[p],delete b[v]),"medium none"===b.border&&delete b.border,"none"===b["border-image"]&&delete b["border-image"]}return b},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var a=0,u=i.length;a<u;a++)e=i[a],(o=t[e])&&(n+=(n.length>0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):dt(t,(function(t,r){!t||o&&!function(t,e){var n=o["*"];return!(n&&n[t]||(n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},Di={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Mi=function(t){return t instanceof Event||w(t.initEvent)},Bi=function(t,e,n,r){var o,i=function(t,e){var n=null!=e?e:{};for(var r in t)wt(Di,r)||(n[r]=t[r]);return y(n.composedPath)&&(n.composedPath=function(){return t.composedPath()}),n}(e,r);return i.type=t,b(i.target)&&(i.target=null!==(o=i.srcElement)&&void 0!==o?o:n),function(t){return b(t.preventDefault)||Mi(t)}(e)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=M,w(e.preventDefault)?e.preventDefault():Mi(e)&&(e.returnValue=!1)},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=M,w(e.stopPropagation)?e.stopPropagation():Mi(e)&&(e.cancelBubble=!0)},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=M,i.stopPropagation()},function(t){return t.isDefaultPrevented===M||t.isDefaultPrevented===D}(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?M:D,i.isPropagationStopped=!0===i.cancelBubble?M:D,i.isImmediatePropagationStopped=D)),i},zi=/^(?:mouse|contextmenu)|click/,Pi=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},Li=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},Ii=function(t,e){var n=Bi(t.type,t,document,e);if(function(t){return y(t)&&zi.test(t.type)}(t)&&v(t.pageX)&&!v(t.clientX)){var r=n.target.ownerDocument||document,o=r.documentElement,i=r.body,a=n;a.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),a.pageY=t.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)}return v(n.metaKey)&&(n.metaKey=!1),n},Hi=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){Li(t,"DOMContentLoaded",i),Li(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():Pi(t,"DOMContentLoaded",i),n.domLoaded||Pi(t,"load",i)}},Fi=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}return t.prototype.bind=function(t,e,n,r){var o,i,a,u,c,s,l,f=this,d=window,m=function(t){f.executeHandlers(Ii(t||d.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?o=t[f.expando]:(o=f.count++,t[f.expando]=o,f.events[o]={}),r=r||t;var g=e.split(" ");for(a=g.length;a--;)s=m,c=l=!1,"DOMContentLoaded"===(u=g[a])&&(u="ready"),f.domLoaded&&"ready"===u&&"complete"===t.readyState?n.call(r,Ii({type:u})):(f.hasMouseEnterLeave||(c=f.mouseEnterLeave[u])&&(s=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=Ii(t||d.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,o))}),f.hasFocusIn||"focusin"!==u&&"focusout"!==u||(l=!0,c="focusin"===u?"focus":"blur",s=function(t){(t=Ii(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][u])?"ready"===u&&f.domLoaded?n(Ii({type:u})):i.push({func:n,scope:r}):(f.events[o][u]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=l,i.nativeHandler=s,"ready"===u?Hi(t,s,f):Pi(t,c||u,s,l)));return t=i=null,n}},t.prototype.unbind=function(t,e,n){var r,o,i,a,u;if(!t||3===t.nodeType||8===t.nodeType)return this;var c=t[this.expando];if(c){if(u=this.events[c],e){var s=e.split(" ");for(o=s.length;o--;)if(r=u[a=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var l=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=l,r.fakeName=f,r.capture=d,u[a]=r}n&&0!==r.length||(delete u[a],Li(t,r.fakeName||a,r.nativeHandler,r.capture))}}else dt(u,(function(e,n){Li(t,e.fakeName||n,e.nativeHandler,e.capture)})),u={};for(a in u)if(wt(u,a))return this;delete this.events[c];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=Ii({type:e,target:t},n);do{(r=t[this.expando])&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var a=r[o];if(a&&!1===a.func.call(a.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),Vi="sizzle"+-new Date,ji=window.document,Ui=0,Wi=0,qi=ka(),$i=ka(),Gi=ka(),Ki=function(t,e){return t===e&&(Fr=!0),0},Xi="undefined",Yi=1<<31,Ji={}.hasOwnProperty,Qi=[],Zi=Qi.pop,ta=Qi.push,ea=Qi.push,na=Qi.slice,ra=Qi.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},oa="[\\x20\\t\\r\\n\\f]",ia="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",aa="\\[[\\x20\\t\\r\\n\\f]*("+ia+")(?:"+oa+"*([*^$|!~]?=)"+oa+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ia+"))|)"+oa+"*\\]",ua=":("+ia+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+aa+")*)|.*)\\)|)",ca=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),sa=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),la=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),fa=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),da=new RegExp(ua),ma=new RegExp("^"+ia+"$"),ga={ID:new RegExp("^#("+ia+")"),CLASS:new RegExp("^\\.("+ia+")"),TAG:new RegExp("^("+ia+"|[*])"),ATTR:new RegExp("^"+aa),PSEUDO:new RegExp("^"+ua),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},ha=/^(?:input|select|textarea|button)$/i,pa=/^h\d$/i,va=/^[^{]+\{\s*\[native \w/,ba=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ya=/[+~]/,wa=/'|\\/g,xa=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),Ca=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{ea.apply(Qi=na.call(ji.childNodes),ji.childNodes),Qi[ji.childNodes.length].nodeType}catch(t){ea={apply:Qi.length?function(t,e){ta.apply(t,na.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var Sa=function(t,e,n,r){var o,i,a,u,c,s,l,f,d,m;if((e?e.ownerDocument||e:ji)!==jr&&Vr(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(u=(e=e||jr).nodeType)&&9!==u)return[];if(Wr&&!r){if(o=ba.exec(t))if(a=o[1]){if(9===u){if(!(i=e.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(a))&&Gr(e,i)&&i.id===a)return n.push(i),n}else{if(o[2])return ea.apply(n,e.getElementsByTagName(t)),n;if((a=o[3])&&Ar.getElementsByClassName)return ea.apply(n,e.getElementsByClassName(a)),n}if(Ar.qsa&&(!qr||!qr.test(t))){if(f=l=Vi,d=e,m=9===u&&t,1===u&&"object"!==e.nodeName.toLowerCase()){for(s=zr(t),(l=e.getAttribute("id"))?f=l.replace(wa,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+Na(s[c]);d=ya.test(t)&&_a(e.parentNode)||e,m=s.join(",")}if(m)try{return ea.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{l||e.removeAttribute("id")}}}return Lr(t.replace(ca,"$1"),e,n,r)};function ka(){var t=[];return function e(n,r){return t.push(n+" ")>Dr.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function Ta(t){return t[Vi]=!0,t}function Oa(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||Yi)-(~t.sourceIndex||Yi);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function Ea(t){return Ta((function(e){return e=+e,Ta((function(n,r){for(var o,i=t([],n.length,e),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))}))}))}function _a(t){return t&&typeof t.getElementsByTagName!==Xi&&t}function Ra(){}function Na(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function Aa(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Wi++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,a){var u,c,s=[Ui,i];if(a){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,a))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((u=(c=e[Vi]||(e[Vi]={}))[r])&&u[0]===Ui&&u[1]===i)return s[2]=u[2];if(c[r]=s,s[2]=t(e,n,a))return!0}}}function Da(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function Ma(t,e,n,r,o){for(var i,a=[],u=0,c=t.length,s=null!=e;u<c;u++)(i=t[u])&&(n&&!n(i,r,o)||(a.push(i),s&&e.push(u)));return a}function Ba(t,e,n,r,o,i){return r&&!r[Vi]&&(r=Ba(r)),o&&!o[Vi]&&(o=Ba(o,i)),Ta((function(i,a,u,c){var s,l,f,d=[],m=[],g=a.length,h=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)Sa(t,e[r],n);return n}(e||"*",u.nodeType?[u]:u,[]),p=!t||!i&&e?h:Ma(h,d,t,u,c),v=n?o||(i?t:g||r)?[]:a:p;if(n&&n(p,v,u,c),r)for(s=Ma(v,m),r(s,[],u,c),l=s.length;l--;)(f=s[l])&&(v[m[l]]=!(p[m[l]]=f));if(i){if(o||t){if(o){for(s=[],l=v.length;l--;)(f=v[l])&&s.push(p[l]=f);o(null,v=[],s,c)}for(l=v.length;l--;)(f=v[l])&&(s=o?ra.call(i,f):d[l])>-1&&(i[s]=!(a[s]=f))}}else v=Ma(v===a?v.splice(g,v.length):v),o?o(null,a,v,c):ea.apply(a,v)}))}function za(t){for(var e,n,r,o=t.length,i=Dr.relative[t[0].type],a=i||Dr.relative[" "],u=i?1:0,c=Aa((function(t){return t===e}),a,!0),s=Aa((function(t){return ra.call(e,t)>-1}),a,!0),l=[function(t,n,r){var o=!i&&(r||n!==Ir)||((e=n).nodeType?c(t,n,r):s(t,n,r));return e=null,o}];u<o;u++)if(n=Dr.relative[t[u].type])l=[Aa(Da(l),n)];else{if((n=Dr.filter[t[u].type].apply(null,t[u].matches))[Vi]){for(r=++u;r<o&&!Dr.relative[t[r].type];r++);return Ba(u>1&&Da(l),u>1&&Na(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(ca,"$1"),n,u<r&&za(t.slice(u,r)),r<o&&za(t=t.slice(r)),r<o&&Na(t))}l.push(n)}return Da(l)}Ar=Sa.support={},Br=Sa.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},Vr=Sa.setDocument=function(t){var e,n=t?t.ownerDocument||t:ji,r=n.defaultView;return n!==jr&&9===n.nodeType&&n.documentElement?(jr=n,Ur=n.documentElement,Wr=!Br(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){Vr()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){Vr()}))),Ar.attributes=!0,Ar.getElementsByTagName=!0,Ar.getElementsByClassName=va.test(n.getElementsByClassName),Ar.getById=!0,Dr.find.ID=function(t,e){if(typeof e.getElementById!==Xi&&Wr){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},Dr.filter.ID=function(t){var e=t.replace(xa,Ca);return function(t){return t.getAttribute("id")===e}},Dr.find.TAG=Ar.getElementsByTagName?function(t,e){if(typeof e.getElementsByTagName!==Xi)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Dr.find.CLASS=Ar.getElementsByClassName&&function(t,e){if(Wr)return e.getElementsByClassName(t)},$r=[],qr=[],Ar.disconnectedMatch=!0,qr=qr.length&&new RegExp(qr.join("|")),$r=$r.length&&new RegExp($r.join("|")),e=va.test(Ur.compareDocumentPosition),Gr=e||va.test(Ur.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Ki=e?function(t,e){if(t===e)return Fr=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!Ar.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===ji&&Gr(ji,t)?-1:e===n||e.ownerDocument===ji&&Gr(ji,e)?1:Hr?ra.call(Hr,t)-ra.call(Hr,e):0:4&r?-1:1)}:function(t,e){if(t===e)return Fr=!0,0;var r,o=0,i=t.parentNode,a=e.parentNode,u=[t],c=[e];if(!i||!a)return t===n?-1:e===n?1:i?-1:a?1:Hr?ra.call(Hr,t)-ra.call(Hr,e):0;if(i===a)return Oa(t,e);for(r=t;r=r.parentNode;)u.unshift(r);for(r=e;r=r.parentNode;)c.unshift(r);for(;u[o]===c[o];)o++;return o?Oa(u[o],c[o]):u[o]===ji?-1:c[o]===ji?1:0},n):jr},Sa.matches=function(t,e){return Sa(t,null,null,e)},Sa.matchesSelector=function(t,e){if((t.ownerDocument||t)!==jr&&Vr(t),e=e.replace(fa,"='$1']"),Ar.matchesSelector&&Wr&&(!$r||!$r.test(e))&&(!qr||!qr.test(e)))try{var n=undefined.call(t,e);if(n||Ar.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return Sa(e,jr,null,[t]).length>0},Sa.contains=function(t,e){return(t.ownerDocument||t)!==jr&&Vr(t),Gr(t,e)},Sa.attr=function(t,e){(t.ownerDocument||t)!==jr&&Vr(t);var n=Dr.attrHandle[e.toLowerCase()],r=n&&Ji.call(Dr.attrHandle,e.toLowerCase())?n(t,e,!Wr):void 0;return void 0!==r?r:Ar.attributes||!Wr?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},Sa.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},Sa.uniqueSort=function(t){var e,n=[],r=0,o=0;if(Fr=!Ar.detectDuplicates,Hr=!Ar.sortStable&&t.slice(0),t.sort(Ki),Fr){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return Hr=null,t},Mr=Sa.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=Mr(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=Mr(e);return n},(Dr=Sa.selectors={cacheLength:50,createPseudo:Ta,match:ga,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(xa,Ca),t[3]=(t[3]||t[4]||t[5]||"").replace(xa,Ca),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||Sa.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&Sa.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return ga.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&da.test(n)&&(e=zr(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(xa,Ca).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=qi[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+oa+"|$)"))&&qi(t,(function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!==Xi&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=Sa.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),a="last"!==t.slice(-4),u="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,l,f,d,m,g,h=i!==a?"nextSibling":"previousSibling",p=e.parentNode,v=u&&e.nodeName.toLowerCase(),b=!c&&!u;if(p){if(i){for(;h;){for(f=e;f=f[h];)if(u?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;g=h="only"===t&&!g&&"nextSibling"}return!0}if(g=[a?p.firstChild:p.lastChild],a&&b){for(m=(s=(l=p[Vi]||(p[Vi]={}))[t]||[])[0]===Ui&&s[1],d=s[0]===Ui&&s[2],f=m&&p.childNodes[m];f=++m&&f&&f[h]||(d=m=0)||g.pop();)if(1===f.nodeType&&++d&&f===e){l[t]=[Ui,m,d];break}}else if(b&&(s=(e[Vi]||(e[Vi]={}))[t])&&s[0]===Ui)d=s[1];else for(;(f=++m&&f&&f[h]||(d=m=0)||g.pop())&&((u?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[Vi]||(f[Vi]={}))[t]=[Ui,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=Dr.pseudos[t]||Dr.setFilters[t.toLowerCase()]||Sa.error("unsupported pseudo: "+t);return r[Vi]?r(e):r.length>1?(n=[t,t,"",e],Dr.setFilters.hasOwnProperty(t.toLowerCase())?Ta((function(t,n){for(var o,i=r(t,e),a=i.length;a--;)t[o=ra.call(t,i[a])]=!(n[o]=i[a])})):function(t){return r(t,0,n)}):r}},pseudos:{not:Ta((function(t){var e=[],n=[],r=Pr(t.replace(ca,"$1"));return r[Vi]?Ta((function(t,e,n,o){for(var i,a=r(t,null,o,[]),u=t.length;u--;)(i=a[u])&&(t[u]=!(e[u]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}})),has:Ta((function(t){return function(e){return Sa(t,e).length>0}})),contains:Ta((function(t){return t=t.replace(xa,Ca),function(e){return(e.textContent||e.innerText||Mr(e)).indexOf(t)>-1}})),lang:Ta((function(t){return ma.test(t||"")||Sa.error("unsupported lang: "+t),t=t.replace(xa,Ca).toLowerCase(),function(e){var n;do{if(n=Wr?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===Ur},focus:function(t){return t===jr.activeElement&&(!jr.hasFocus||jr.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!Dr.pseudos.empty(t)},header:function(t){return pa.test(t.nodeName)},input:function(t){return ha.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:Ea((function(){return[0]})),last:Ea((function(t,e){return[e-1]})),eq:Ea((function(t,e,n){return[n<0?n+e:n]})),even:Ea((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:Ea((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:Ea((function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t})),gt:Ea((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=Dr.pseudos.eq,q(["radio","checkbox","file","password","image"],(function(t){Dr.pseudos[t]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(t)})),q(["submit","reset"],(function(t){Dr.pseudos[t]=function(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}(t)})),Ra.prototype=Dr.filters=Dr.pseudos,Dr.setFilters=new Ra,zr=Sa.tokenize=function(t,e){var n,r,o,i,a,u,c,s=$i[t+" "];if(s)return e?0:s.slice(0);for(a=t,u=[],c=Dr.preFilter;a;){for(i in n&&!(r=sa.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=la.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(ca," ")}),a=a.slice(n.length)),Dr.filter)Dr.filter.hasOwnProperty(i)&&(!(r=ga[i].exec(a))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length)));if(!n)break}return e?a.length:a?Sa.error(t):$i(t,u).slice(0)},Pr=Sa.compile=function(t,e){var n,r=[],o=[],i=Gi[t+" "];if(!i){for(e||(e=zr(t)),n=e.length;n--;)(i=za(e[n]))[Vi]?r.push(i):o.push(i);(i=Gi(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,a,u,c){var s,l,f,d=0,m="0",g=o&&[],h=[],p=Ir,v=o||r&&Dr.find.TAG("*",c),b=Ui+=null==p?1:Math.random()||.1,y=v.length;for(c&&(Ir=i!==jr&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){for(l=0;f=t[l++];)if(f(s,i,a)){u.push(s);break}c&&(Ui=b)}n&&((s=!f&&s)&&d--,o&&g.push(s))}if(d+=m,n&&m!==d){for(l=0;f=e[l++];)f(g,h,i,a);if(o){if(d>0)for(;m--;)g[m]||h[m]||(h[m]=Zi.call(u));h=Ma(h)}ea.apply(u,h),c&&!o&&h.length>0&&d+e.length>1&&Sa.uniqueSort(u)}return c&&(Ui=b,Ir=p),g};return n?Ta(o):o}(o,r))).selector=t}return i},Lr=Sa.select=function(t,e,n,r){var o,i,a,u,c,s="function"==typeof t&&t,l=!r&&zr(t=s.selector||t);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(a=i[0]).type&&Ar.getById&&9===e.nodeType&&Wr&&Dr.relative[i[1].type]){if(!(e=(Dr.find.ID(a.matches[0].replace(xa,Ca),e)||[])[0]))return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=ga.needsContext.test(t)?0:i.length;o--&&(a=i[o],!Dr.relative[u=a.type]);)if((c=Dr.find[u])&&(r=c(a.matches[0].replace(xa,Ca),ya.test(i[0].type)&&_a(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&Na(i)))return ea.apply(n,r),n;break}}return(s||Pr(t,l))(r,e,!Wr,n,ya.test(t)&&_a(e.parentNode)||e),n},Ar.sortStable=Vi.split("").sort(Ki).join("")===Vi,Ar.detectDuplicates=!!Fr,Vr(),Ar.sortDetached=!0;var Pa=document,La=Array.prototype.push,Ia=Array.prototype.slice,Ha=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Fa=Fi.Event,Va=_e.makeMap("children,contents,next,prev"),ja=function(t){return void 0!==t},Ua=function(t){return"string"==typeof t},Wa=function(t,e){var n,r=(e=e||Pa).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},qa=function(t,e,n,r){var o;if(Ua(e))e=Wa(e,iu(t[0]));else if(e.length&&!e.nodeType){if(e=su.makeArray(e),r)for(o=e.length-1;o>=0;o--)qa(t,e[o],n,r);else for(o=0;o<e.length;o++)qa(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},$a=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},Ga=function(t,e,n){var r,o;return e=su(e)[0],t.each((function(){var t=this;n&&r===t.parentNode||(r=t.parentNode,o=e.cloneNode(!1),t.parentNode.insertBefore(o,t)),o.appendChild(t)})),t},Ka=_e.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Xa=_e.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Ya={for:"htmlFor",class:"className",readonly:"readOnly"},Ja={float:"cssFloat"},Qa={},Za={},tu=function(t,e){return new su.fn.init(t,e)},eu=/^\s*|\s*$/g,nu=function(t){return null==t?"":(""+t).replace(eu,"")},ru=function(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t},ou=function(t,e){var n=[];return ru(t,(function(t,r){e(r,t)&&n.push(r)})),n},iu=function(t){return t?9===t.nodeType?t:t.ownerDocument:Pa};tu.fn=tu.prototype={constructor:tu,selector:"",context:null,length:0,init:function(t,e){var n,r,o=this;if(!t)return o;if(t.nodeType)return o.context=o[0]=t,o.length=1,o;if(e&&e.nodeType)o.context=e;else{if(e)return su(t).attr(e);o.context=e=document}if(Ua(t)){if(o.selector=t,!(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:Ha.exec(t)))return su(e).find(t);if(n[1])for(r=Wa(t,iu(e)).firstChild;r;)La.call(o,r),r=r.nextSibling;else{if(!(r=iu(e).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(t);o.length=1,o[0]=r}}else this.add(t,!1);return o},toArray:function(){return _e.toArray(this)},add:function(t,e){var n,r,o=this;if(Ua(t))return o.add(su(t));if(!1!==e)for(n=su.unique(o.toArray().concat(su.makeArray(t))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else La.apply(o,su.makeArray(t));return o},attr:function(t,e){var n,r=this;if("object"==typeof t)ru(t,(function(t,e){r.attr(t,e)}));else{if(!ja(e)){if(r[0]&&1===r[0].nodeType){if((n=Qa[t])&&n.get)return n.get(r[0],t);if(Xa[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each((function(){var n;if(1===this.nodeType){if((n=Qa[t])&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==typeof(t=Ya[t]||t))ru(t,(function(t,e){n.prop(t,e)}));else{if(!ja(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))},a=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))};if("object"==typeof t)ru(t,(function(t,e){o.css(t,e)}));else if(ja(e))t=i(t),"number"!=typeof e||Ka[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if((r=Za[t])&&r.set)r.set(this,e);else{try{this.style[Ja[t]||t]=e}catch(t){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(a(t)):n.removeAttribute(t))}}));else{if(n=o[0],(r=Za[t])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(a(t))}catch(t){return}}return o},remove:function(){for(var t,e=this.length;e--;)t=this[e],Fa.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e,n=this;if(ja(t)){e=n.length;try{for(;e--;)n[e].innerHTML=t}catch(r){su(n[e]).empty().append(t)}return n}return n[0]?n[0].innerHTML:""},text:function(t){var e,n=this;if(ja(t)){for(e=n.length;e--;)"innerText"in n[e]?n[e].innerText=t:n[0].textContent=t;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return qa(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return qa(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){var t=this;return t[0]&&t[0].parentNode?qa(t,arguments,(function(t){this.parentNode.insertBefore(t,this)})):t},after:function(){var t=this;return t[0]&&t[0].parentNode?qa(t,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):t},appendTo:function(t){return su(t).append(this),this},prependTo:function(t){return su(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return Ga(this,t)},wrapAll:function(t){return Ga(this,t,!0)},wrapInner:function(t){return this.each((function(){su(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){su(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),su(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t||(-1!==t.indexOf(" ")?ru(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o=$a(r,t);if(o!==e){var i=r.className;o?r.className=nu((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}}))),n},hasClass:function(t){return $a(this[0],t)},each:function(t){return ru(this,t)},on:function(t,e){return this.each((function(){Fa.bind(this,t,e)}))},off:function(t,e){return this.each((function(){Fa.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"==typeof t?Fa.fire(this,t.type,t):Fa.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return su(Ia.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)su.find(t,this[e],r);return su(r)},filter:function(t){return su("function"==typeof t?ou(this.toArray(),(function(e,n){return t(n,e)})):su.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof su&&(t=t[0]),this.each((function(n,r){for(;r;){if("string"==typeof t&&su(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),su(e)},offset:function(t){var e,n,r,o,i=0,a=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:La,sort:Array.prototype.sort,splice:Array.prototype.splice},_e.extend(tu,{extend:_e.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:_e.toArray(t);var e},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:_e.isArray,each:ru,trim:nu,grep:ou,find:Sa,expr:Sa.selectors,unique:Sa.uniqueSort,text:Sa.getText,contains:Sa.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return e=1===e.length?su.find.matchesSelector(e[0],t)?[e[0]]:[]:su.find.matches(t,e)}});var au=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof su&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&su(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},uu=function(t,e,n,r){var o=[];for(r instanceof su&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&su(t).is(r))break}o.push(t)}return o},cu=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};ru({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return au(t,"parentNode")},next:function(t){return cu(t,"nextSibling",1)},prev:function(t){return cu(t,"previousSibling",1)},children:function(t){return uu(t.firstChild,"nextSibling",1)},contents:function(t){return _e.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){tu.fn[t]=function(n){var r=[];this.each((function(){var t=e.call(r,this,n,r);t&&(su.isArray(t)?r.push.apply(r,t):r.push(t))})),this.length>1&&(Va[t]||(r=su.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=su(r);return n?o.filter(n):o}})),ru({parentsUntil:function(t,e){return au(t,"parentNode",e)},nextUntil:function(t,e){return uu(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return uu(t,"previousSibling",1,e).slice(1)}},(function(t,e){tu.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(su.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(o=su.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=su(o);return r?i.filter(r):i}})),tu.fn.is=function(t){return!!t&&this.filter(t).length>0},tu.fn.init.prototype=tu.fn,tu.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return su.extend(n,this),n},tu.attrHooks=Qa,tu.cssHooks=Za;var su=tu,lu=_e.each,fu=_e.grep,du=Se.ie,mu=/^([a-z0-9],?)+$/i,gu=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},hu=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o},pu=function(t,e){void 0===e&&(e={});var n={},r=window,o={},i=0,a=ao.forElement(Ne.fromDom(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),u=[],c=e.schema?e.schema:Ri({}),s=Ai({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),l=e.ownEvents?new Fi:Fi.Event,f=c.getBlockElements(),m=su.overrideDefaults((function(){return{context:t,element:U.getRoot()}})),g=function(e){return e&&t&&d(e)?t.getElementById(e):e},h=function(t){return m("string"==typeof t?g(t):t)},p=function(t,e,n){var r,o,i=h(t);return i.length&&(o=(r=W[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},v=function(t){var e=g(t);return e?e.attributes:[]},y=function(t,n,r){""===r&&(r=null);var o=h(t),i=o.attr(n);if(o.length){var a=W[n];a&&a.set?a.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},w=function(){return e.root_element||t.body},x=function(e,n){return dr(t.body,g(e),n)},S=function(t,e,n){var r=h(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})))&&(e=Se.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},k=function(t){var e,n;return t=g(t),e=S(t,"width"),n=S(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},O=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(mu.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return Sa(e,i[0].ownerDocument||i[0],null,i).length>0},E=function(t,e,n,r){var o,i=[],a=g(t);for(r=void 0===r,n=n||("BODY"!==w().nodeName?w().parentNode:null),_e.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return O(t,o)});a&&!(a===n||b(a.nodeType)||Vn(a)||jn(a));){if(!e||"function"==typeof e&&e(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},_=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return O(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},R=function(t,e,n){var r,o="string"==typeof t?g(t):t;if(!o)return!1;if(_e.isArray(o)&&(o.length||0===o.length))return r=[],lu(o,(function(t,o){t&&r.push(e.call(n,"string"==typeof t?g(t):t,o))})),r;var i=n||this;return e.call(i,o)},N=function(t,e){h(t).each((function(t,n){lu(e,(function(t,e){y(n,e,t)}))}))},A=function(t,e){var n=h(t);du?n.each((function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(t){su("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},D=function(e,n,r,o,i){return R(e,(function(e){var a="string"==typeof n?t.createElement(n):n;return N(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&A(a,o)),i?a:e.appendChild(a)}))},M=function(e,n,r){return D(t.createElement(e),e,n,r,!0)},B=yi.encodeAllRaw,z=function(t,e){var n=h(t);return e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},P=function(t,e,n){h(t).toggleClass(e,n).each((function(){""===this.className&&su(this).attr("class",null)}))},L=function(t,e,n){return R(e,(function(e){return _e.is(e,"array")&&(t=t.cloneNode(!0)),n&&lu(fu(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},I=function(t){if(An(t)){var e="a"===t.nodeName.toLowerCase()&&!p(t,"href")&&p(t,"id");if(p(t,"name")||p(t,"data-mce-bookmark")||e)return!0}return!1},H=function(){return t.createRange()},F=function(n,o,i,a){if(_e.isArray(n)){for(var c=n.length,s=[];c--;)s[c]=F(n[c],o,i,a);return s}return!e.collect||n!==t&&n!==r||u.push([n,o,i,a]),l.bind(n,o,i,a||U)},V=function(e,n,o){if(_e.isArray(e)){for(var i=e.length,a=[];i--;)a[i]=V(e[i],n,o);return a}if(u.length>0&&(e===t||e===r))for(i=u.length;i--;){var c=u[i];e!==c[0]||n&&n!==c[1]||o&&o!==c[2]||l.unbind(c[0],c[1],c[2])}return l.unbind(e,n,o)},j=function(t){if(t&&An(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},U={doc:t,settings:e,win:r,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:u,styles:s,schema:c,events:l,isBlock:function(t){if("string"==typeof t)return!!f[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!f[t.nodeName])}return!1},$:m,$$:h,root:null,clone:function(e,n){if(!du||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return lu(v(e),(function(t){y(r,t.nodeName,p(e,t.nodeName))})),r},getRoot:w,getViewPort:function(t){var e=_n(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=g(t);var e=x(t),n=k(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:k,getParent:function(t,e,n){var r=E(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:E,get:g,getNext:function(t,e){return _(t,e,"nextSibling")},getPrev:function(t,e){return _(t,e,"previousSibling")},select:function(n,r){return Sa(n,g(r)||e.root_element||t,[])},is:O,add:D,create:M,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)xt(e,r)&&(o+=" "+r+'="'+B(e[r])+'"');return void 0!==n?o+">"+n+"</"+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:z,setStyle:function(t,n,r){var o=d(n)?h(t).css(n,r):h(t).css(n);e.update_styles&&gu(s,o)},getStyle:S,setStyles:function(t,n){var r=h(t).css(n);e.update_styles&&gu(s,r)},removeAllAttribs:function(t){return R(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},setAttrib:y,setAttribs:N,getAttrib:p,getPos:x,parseStyle:function(t){return s.parse(t)},serializeStyle:function(t,e){return s.serialize(t,e)},addStyle:function(e){var r,o;if(U!==pu.DOM&&t===document){if(n[e])return;n[e]=!0}(o=t.getElementById("mceDefaultStyles"))||((o=t.createElement("style")).id="mceDefaultStyles",o.type="text/css",(r=t.getElementsByTagName("head")[0]).firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(t.createTextNode(e))},loadCSS:function(t){t||(t=""),q(t.split(","),(function(t){o[t]=!0,a.load(t,C)}))},addClass:function(t,e){h(t).addClass(e)},removeClass:function(t,e){P(t,e,!1)},hasClass:function(t,e){return h(t).hasClass(e)},toggleClass:P,show:function(t){h(t).show()},hide:function(t){h(t).hide()},isHidden:function(t){return"none"===h(t).css("display")},uniqueId:function(t){return(t||"mce_")+i++},setHTML:A,getOuterHTML:function(t){var e="string"==typeof t?g(t):t;return An(e)?e.outerHTML:su("<div></div>").append(su(e).clone()).html()},setOuterHTML:function(t,e){h(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}z(su(this).html(e),!0)}))},decode:yi.decode,encode:B,insertAfter:function(t,e){var n=g(e);return R(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:L,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=M(e),lu(v(t),(function(e){y(n,e.nodeName,p(t,e.nodeName))})),L(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return s.toHex(_e.trim(t))},run:R,getAttribs:v,isEmpty:function(t,e){var n,r,o=0;if(I(t))return!1;if(t=t.firstChild){var i=new uo(t,t.parentNode),a=c?c.getWhiteSpaceElements():{};e=e||(c?c.getNonEmptyElements():null);do{if(n=t.nodeType,An(t)){var u=t.getAttribute("data-mce-bogus");if(u){t=i.next("all"===u);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(I(t))return!1}if(8===n)return!1;if(3===n&&!Xo(t.nodeValue))return!1;if(3===n&&t.parentNode&&a[t.parentNode.nodeName]&&Xo(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:H,nodeIndex:hu,split:function(t,e,n){var r,o,i,a=H();if(t&&e)return a.setStart(t.parentNode,hu(t)),a.setEnd(e.parentNode,hu(e)),r=a.extractContents(),(a=H()).setStart(e.parentNode,hu(e)+1),a.setEnd(t.parentNode,hu(t)+1),o=a.extractContents(),(i=t.parentNode).insertBefore(ii(U,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(ii(U,o),t),z(t),n||e},bind:F,unbind:V,fire:function(t,e,n){return l.fire(t,e,n)},getContentEditable:j,getContentEditableParent:function(t){for(var e=w(),n=null;t&&t!==e&&null===(n=j(t));t=t.parentNode);return n},destroy:function(){if(u.length>0)for(var t=u.length;t--;){var e=u[t];l.unbind(e[0],e[1],e[2])}dt(o,(function(t,e){a.unload(e),delete o[e]})),Sa.setDocument&&Sa.setDocument()},isChildOf:function(t,e){if(du){for(;t;){if(e===t)return!0;t=t.parentNode}return!1}return t===e||e.contains(t)},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},W=function(t,e,n){var r=e.keep_values,o={set:function(t,r,o){e.url_converter&&null!==r&&(r=e.url_converter.call(e.url_converter_scope||n(),r,o,t[0])),t.attr("data-mce-"+o,r).attr(o,r)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(s,e,T(U));return U};pu.DOM=pu(document),pu.nodeIndex=hu;var vu=pu.DOM,bu=_e.each,yu=_e.grep,wu=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,n){var r,o=vu,i=function(){o.remove(a),r&&(r.onerror=r.onload=r=null)},a=o.uniqueId();(r=document.createElement("script")).id=a,r.type="text/javascript",r.src=_e._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),e()},r.onerror=function(){i(),w(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)},t.prototype.isDone=function(t){return 2===this.states[t]},t.prototype.markDone=function(t){this.states[t]=2},t.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],a=function(t,e){bu(o.scriptLoadedCallbacks[e],(function(e){w(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var u=function(){var e=yu(t);if(t.length=0,bu(e,(function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,(function(){o.states[t]=2,o.loading--,a("success",t),u()}),(function(){o.states[t]=3,o.loading--,i.push(t),a("failure",t),u()}))):a("failure",t):a("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,bu(n,(function(t){0===i.length?w(t.success)&&t.success.call(t.scope):w(t.failure)&&t.failure.call(t.scope,i)}))}};u()},t.ScriptLoader=new t,t}(),xu=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Cu={},Su=xu("en"),ku=function(){return yt(Cu,Su.get())},Tu={getData:function(){return mt(Cu,(function(t){return Nt({},t)}))},setCode:function(t){t&&Su.set(t)},getCode:function(){return Su.get()},add:function(t,e){var n=Cu[t];n||(Cu[t]=n={}),dt(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=ku().getOr({}),r=function(t){return w(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null==t},i=function(t){var e=r(t);return yt(n,e.toLowerCase()).map(r).getOr(e)},a=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(m(e=t)&&wt(e,"raw"))return r(t.raw);if(function(t){return g(t)&&t.length>1}(t)){var u=t.slice(1);return a(i(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return wt(u,e)?r(u[e]):t})))}return a(i(t))},isRtl:function(){return ku().bind((function(t){return yt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return wt(Cu,t)}},Ou=function(){var t=[],e={},n={},r=[],o=function(t,e){var n=K(r,(function(n){return n.name===t&&n.state===e}));q(n,(function(t){return t.callback()}))},i=function(t){var e;return n[t]&&(e=n[t].dependencies),e||[]},a=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},u=function(t,r,c,s,l){if(!e[t]){var f="string"==typeof r?r:r.prefix+r.resource+r.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=Ou.baseURL+"/"+f),e[t]=f.substring(0,f.lastIndexOf("/"));var d=function(){o(t,"loaded"),function(t,e,n,r){var o=i(t);q(o,(function(t){var n=a(e,t);u(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(wu))}(t,r,c,s)};n[t]?d():wu.ScriptLoader.add(f,d,s,l)}},c=function(t,o,i){void 0===i&&(i="added"),wt(n,t)&&"added"===i||wt(e,t)&&"loaded"===i?o():r.push({name:t,state:i,callback:o})};return{items:t,urls:e,lookup:n,_listeners:r,get:function(t){if(n[t])return n[t].instance},dependencies:i,requireLangPack:function(t,n){!1!==Ou.languageLoad&&c(t,(function(){var r=Tu.getCode();!r||n&&-1===(","+(n||"")+",").indexOf(","+r+",")||wu.ScriptLoader.add(e[t]+"/langs/"+r+".js")}),"loaded")},add:function(e,r,i){var a=r;return t.push(a),n[e]={instance:a,dependencies:i},o(e,"added"),a},remove:function(t){delete e[t],delete n[t]},createUrl:a,addComponents:function(t,n){var r=e[t];q(n,(function(t){wu.ScriptLoader.add(r+"/"+t)}))},load:u,waitFor:c}};Ou.languageLoad=!0,Ou.baseURL="",Ou.PluginManager=Ou(),Ou.ThemeManager=Ou();var Eu=function(){var t=function(t){var e=xu(L.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(L.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(L.some(t))}}}(C);return Nt(Nt({},t),{on:function(e){return t.get().each(e)}})},_u=function(t,e){var n=null;return{cancel:function(){h(n)||(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];h(n)&&(n=setTimeout((function(){n=null,t.apply(null,r)}),e))}}},Ru=function(t,e){var n=null,r=function(){h(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)}}},Nu=function(t,e){var n=er(t,e);return void 0===n||""===n?[]:n.split(" ")},Au=function(t){return void 0!==t.dom.classList},Du=function(t,e){return function(t,e,n){var r=Nu(t,e).concat([n]);return Zn(t,e,r.join(" ")),!0}(t,"class",e)},Mu=function(t,e){return function(t,e,n){var r=K(Nu(t,e),(function(t){return t!==n}));return r.length>0?Zn(t,e,r.join(" ")):rr(t,e),!1}(t,"class",e)},Bu=function(t,e){Au(t)?t.dom.classList.add(e):Du(t,e)},zu=function(t){0===(Au(t)?t.dom.classList:function(t){return Nu(t,"class")}(t)).length&&rr(t,"class")},Pu=function(t,e){return Au(t)&&t.dom.classList.contains(e)},Lu=function(t,e){var n=[];return q(Qe(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(Lu(t,e))})),n},Iu=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Me(n)?[]:W(n.querySelectorAll(t),Ne.fromDom)}(e,t)},Hu=T("mce-annotation"),Fu=T("data-mce-annotation"),Vu=T("data-mce-annotation-uid"),ju=function(t,e){var n=t.selection.getRng(),r=Ne.fromDom(n.startContainer),o=Ne.fromDom(t.getBody()),i=e.fold((function(){return"."+Hu()}),(function(t){return"["+Fu()+'="'+t+'"]'})),a=Ze(r,n.startOffset).getOr(r),u=Zr(a,i,(function(t){return Be(t,o)})),c=function(t,e){return function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)}(t,e)?L.some(er(t,e)):L.none()};return u.bind((function(e){return c(e,""+Vu()).bind((function(n){return c(e,""+Fu()).map((function(e){var r=Uu(t,n);return{uid:n,name:e,elements:r}}))}))}))},Uu=function(t,e){var n=Ne.fromDom(t.getBody());return Iu(n,"["+Vu()+'="'+e+'"]')},Wu=function(t,e){var n=xu({}),r=function(){return{listeners:[],previous:Eu()}},o=function(t,e){i(t,(function(t){return e(t),t}))},i=function(t,e){var o=n.get(),i=e(yt(o,t).getOrThunk(r));o[t]=i,n.set(o)},a=Ru((function(){var e=n.get(),r=ot(lt(e));q(r,(function(e){i(e,(function(n){var r=n.previous.get();return ju(t,L.some(e)).fold((function(){r.isSome()&&(!function(t){o(t,(function(e){q(e.listeners,(function(e){return e(!1,t)}))}))}(e),n.previous.clear())}),(function(t){var e=t.uid,i=t.name,a=t.elements;Xn(r,e)||(!function(t,e,n){o(t,(function(r){q(r.listeners,(function(r){return r(!0,t,{uid:e,nodes:W(n,(function(t){return t.dom}))})}))}))}(i,e,a),n.previous.set(e))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);t.on("remove",(function(){a.cancel()})),t.on("NodeChange",(function(){a.throttle()}));return{addListener:function(t,e){i(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))}}},qu=function(t,e){t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){q(t,(function(t){(function(t){return L.from(t.attr(Fu())).bind(e.lookup)})(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))},$u=0,Gu=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++$u+String(e)},Ku=function(t,e){var n,r,o=We(t).dom,i=Ne.fromDom(o.createDocumentFragment()),a=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Qe(Ne.fromDom(r)));hn(i,a),pn(t),gn(t,i)},Xu=function(t,e){return Ne.fromDom(t.dom.cloneNode(e))},Yu=function(t){return Xu(t,!1)},Ju=function(t){return Xu(t,!0)},Qu=function(t,e,n){void 0===n&&(n=D);var r=new uo(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!Hn(e)&&!n(e));return L.from(e).filter(Hn)};return{current:function(){return L.from(r.current()).filter(Hn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Zu=function(t,e){var n=e||function(e){return t.isBlock(e)||Un(e)||$n(e)},r=function(t,e,n,o){if(Hn(t)){var i=o(t,e,t.data);if(-1!==i)return L.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))};return{backwards:function(t,e,o,i){var a=Qu(t,i,n);return r(t,e,(function(){return a.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},forwards:function(t,e,o,i){var a=Qu(t,i,n);return r(t,e,(function(){return a.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}},tc=Math.round,ec=function(t){return t?{left:tc(t.left),top:tc(t.top),bottom:tc(t.bottom),right:tc(t.right),width:tc(t.width),height:tc(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},nc=function(t,e){return t=ec(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t},rc=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},oc=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&rc(e.top-t.bottom,t,e)},ic=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&rc(e.bottom-t.top,t,e)},ac=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},uc=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},cc=function(t,e){if(An(t)&&t.hasChildNodes()){var n=t.childNodes;return n[function(t,e,n){return Math.min(Math.max(t,e),n)}(e,0,n.length-1)]}return t},sc=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),lc=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&sc.test(t)},fc=An,dc=qo,mc=Mn("display","block table"),gc=Mn("float","left right"),hc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(fc,dc,R(gc)),pc=R(Mn("white-space","pre pre-line pre-wrap")),vc=Hn,bc=Un,yc=pu.nodeIndex,wc=function(t,e){return e<0&&An(t)&&t.hasChildNodes()?void 0:cc(t,e)},xc=function(t){return"createRange"in t?t.createRange():pu.DOM.createRng()},Cc=function(t){return t&&/[\r\n\t ]/.test(t)},Sc=function(t){return!!t.setStart&&!!t.setEnd},kc=function(t){var e=t.startContainer,n=t.startOffset;if(Cc(t.toString())&&pc(e.parentNode)&&Hn(e)){var r=e.data;if(Cc(r[n-1])||Cc(r[n+1]))return!0}return!1},Tc=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},Oc=function(t){var e,n=t.getClientRects();return e=n.length>0?ec(n[0]):ec(t.getBoundingClientRect()),!Sc(t)&&bc(t)&&Tc(e)?function(t){var e=t.ownerDocument,n=xc(e),r=e.createTextNode(wo),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=ec(n.getBoundingClientRect());return o.removeChild(r),i}(t):Tc(e)&&Sc(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&Hn(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),Oc(i)}return null}(t):e},Ec=function(t,e){var n=nc(t,e);return n.width=1,n.right=n.left+1,n},_c=function(t){var e=[],n=function(t){var n,r;0!==t.height&&(e.length>0&&(n=t,r=e[e.length-1],n.left===r.left&&n.top===r.top&&n.bottom===r.bottom&&n.right===r.right)||e.push(t))},r=function(t,r){var o=xc(t.ownerDocument);if(r<t.data.length){if(lc(t.data[r]))return e;if(lc(t.data[r-1])&&(o.setStart(t,r),o.setEnd(t,r+1),!kc(o)))return n(Ec(Oc(o),!1)),e}r>0&&(o.setStart(t,r-1),o.setEnd(t,r),kc(o)||n(Ec(Oc(o),!1))),r<t.data.length&&(o.setStart(t,r),o.setEnd(t,r+1),kc(o)||n(Ec(Oc(o),!0)))},o=t.container(),i=t.offset();if(vc(o))return r(o,i),e;if(fc(o))if(t.isAtEnd()){var a=wc(o,i);vc(a)&&r(a,a.data.length),hc(a)&&!bc(a)&&n(Ec(Oc(a),!1))}else{a=wc(o,i);if(vc(a)&&r(a,0),hc(a)&&t.isAtEnd())return n(Ec(Oc(a),!1)),e;var u=wc(t.container(),t.offset()-1);hc(u)&&!bc(u)&&(mc(u)||mc(a)||!hc(a))&&n(Ec(Oc(u),!1)),hc(a)&&n(Ec(Oc(a),!0))}return e},Rc=function(t,e,n){var r=function(){return n||(n=_c(Rc(t,e))),n};return{container:T(t),offset:T(e),toRange:function(){var n=xc(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return vc(t),0===e},isAtEnd:function(){return vc(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return wc(t,n?e-1:e)}}};Rc.fromRangeStart=function(t){return Rc(t.startContainer,t.startOffset)},Rc.fromRangeEnd=function(t){return Rc(t.endContainer,t.endOffset)},Rc.after=function(t){return Rc(t.parentNode,yc(t)+1)},Rc.before=function(t){return Rc(t.parentNode,yc(t))},Rc.isAbove=function(t,e){return Yn(at(e.getClientRects()),ut(t.getClientRects()),oc).getOr(!1)},Rc.isBelow=function(t,e){return Yn(ut(e.getClientRects()),at(t.getClientRects()),ic).getOr(!1)},Rc.isAtStart=function(t){return!!t&&t.isAtStart()},Rc.isAtEnd=function(t){return!!t&&t.isAtEnd()},Rc.isTextPosition=function(t){return!!t&&Hn(t.container())},Rc.isElementPosition=function(t){return!1===Rc.isTextPosition(t)};var Nc,Ac=function(t,e){Hn(e)&&0===e.data.length&&t.remove(e)},Dc=function(t,e,n){jn(n)?function(t,e,n){var r=L.from(n.firstChild),o=L.from(n.lastChild);e.insertNode(n),r.each((function(e){return Ac(t,e.previousSibling)})),o.each((function(e){return Ac(t,e.nextSibling)}))}(t,e,n):function(t,e,n){e.insertNode(n),Ac(t,n.previousSibling),Ac(t,n.nextSibling)}(t,e,n)},Mc=Hn,Bc=zn,zc=pu.nodeIndex,Pc=function(t){var e=t.parentNode;return Bc(e)?Pc(e):e},Lc=function(t){return t?Et(t.childNodes,(function(t,e){return Bc(e)&&"BR"!==e.nodeName?t=t.concat(Lc(e)):t.push(e),t}),[]):[]},Ic=function(t){return function(e){return t===e}},Hc=function(t){return(Mc(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=Lc(Pc(t)),n=_t(e,Ic(t),t),e=e.slice(0,n+1);var r=Et(e,(function(t,n,r){return Mc(n)&&Mc(e[r-1])&&t++,t}),0);return e=Tt(e,Dn([t.nodeName])),(n=_t(e,Ic(t),t))-r}(t)+"]"},Fc=function(t,e){var n,r,o,i,a,u=[];return n=e.container(),r=e.offset(),Mc(n)?o=function(t,e){for(;(t=t.previousSibling)&&Mc(t);)e+=t.data.length;return e}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Hc(n)),a=function(t,e,n){var r=[];for(e=e.parentNode;!(e===t||n&&n(e));e=e.parentNode)r.push(e);return r}(t,n),a=Tt(a,R(zn)),(u=u.concat(kt(a,(function(t){return Hc(t)})))).reverse().join("/")+","+o},Vc=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=Et(o,(function(t,e){var n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return n?("text()"===n[1]&&(n[1]="#text"),function(t,e,n){var r=Lc(t);return r=Tt(r,(function(t,e){return!Mc(t)||!Mc(r[e-1])})),(r=Tt(r,Dn([e])))[n]}(t,n[1],parseInt(n[2],10))):null}),t);return i?Mc(i)?function(t,e){for(var n,r=t,o=0;Mc(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!Mc(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return Mc(t)&&e>t.data.length&&(e=t.data.length),Rc(t,e)}(i,parseInt(n,10)):(n="after"===n?zc(i)+1:zc(i),Rc(i.parentNode,n)):null},jc=$n,Uc=function(t,e,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],c=[],s=0,l=t.getRoot();for(Hn(a)?c.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&Hn(r);r=r.previousSibling)o+=t(r.data).length;return o}(e,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(s=1,u=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[u],n)+s));a&&a!==l;a=a.parentNode)c.push(t.nodeIndex(a,n));return c},Wc=function(t,e,n){var r=0;return _e.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},qc=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],An(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(e?r:r-1,o.length-1)])&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r))},$c=function(t){return qc(t,!0),qc(t,!1),t},Gc=function(t,e){var n;if(An(t)&&(t=cc(t,e),jc(t)))return t;if(_o(t)){if(Hn(t)&&Oo(t)&&(t=t.parentNode),n=t.previousSibling,jc(n))return n;if(n=t.nextSibling,jc(n))return n}},Kc=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(jc(r)||"IMG"===o)return{name:o,index:Wc(n.dom,o,r)};var a=function(t){return Gc(t.startContainer,t.startOffset)||Gc(t.endContainer,t.endOffset)}(i);return a?{name:o=a.tagName,index:Wc(n.dom,o,a)}:function(t,e,n,r){var o=e.dom,i={};return i.start=Uc(o,t,n,r,!0),e.isCollapsed()||(i.end=Uc(o,t,n,r,!1)),Po(r)&&(i.isFakeCaret=!0),i}(t,n,e,i)},Xc=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,"&#xFEFF;"):t.create("span",r)},Yc=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),a=t.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:Wc(n,u,a)};var c=$c(r.cloneRange());if(!i){c.collapse(!1);var s=Xc(n,o+"_end",e);Dc(n,c,s)}(r=$c(r)).collapse(!0);var l=Xc(n,o+"_start",e);return Dc(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},Jc=function(t,e,n){return 2===e?Kc(So,n,t):3===e?function(t){var e=t.getRng();return{start:Fc(t.dom.getRoot(),Rc.fromRangeStart(e)),end:Fc(t.dom.getRoot(),Rc.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):Yc(t,!1)},Qc=_(Kc,O,!0),Zc=pu.DOM,ts=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return yt(o,t.id).getOr(n)}return r},es=function(t){return t.getParam("content_security_policy","")},ns=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},rs=function(t){return t.getParam("forced_root_block_attrs",{})},os=function(t){return t.getParam("automatic_uploads",!0,"boolean")},is=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},as=function(t){return t.getParam("icons","","string")},us=function(t){return t.getParam("images_upload_url","","string")},cs=function(t){return t.getParam("images_upload_base_path","","string")},ss=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},ls=function(t){return t.getParam("images_upload_handler",null,"function")},fs=function(t){return t.getParam("content_css_cors",!1,"boolean")},ds=function(t){return t.getParam("referrer_policy","","string")},ms=function(t){return t.getParam("language","en","string")},gs=function(t){return t.getParam("indent_use_margin",!1)},hs=function(t){var e=t.getParam("font_css",[]);return g(e)?e:W(e.split(","),Ft)},ps=function(t){var e=t.getParam("object_resizing");return!1!==e&&!Se.iOS&&(d(e)?e:"table,img,figure.image,div,video,iframe")},vs=function(t){return t.getParam("event_root")},bs=function(t){return t.getParam("theme")},ys=function(t){return t.getParam("validate")},ws=function(t){return!1!==t.getParam("inline_boundaries")},xs=function(t){return t.getParam("content_css_cors")},Cs=function(t){return t.getParam("plugins","","string")},Ss=An,ks=Hn,Ts=function(t){var e=t.parentNode;e&&e.removeChild(t)},Os=function(t){var e=So(t);return{count:t.length-e.length,text:e}},Es=function(t){for(var e;-1!==(e=t.data.lastIndexOf(xo));)t.deleteData(e,1)},_s=function(t,e){return Ds(t),e},Rs=function(t,e){var n=e.container(),r=function(t,e){var n=V(t,e);return-1===n?L.none():L.some(n)}(ct(n.childNodes),t).map((function(t){return t<e.offset()?Rc(n,e.offset()-1):e})).getOr(e);return Ds(t),r},Ns=function(t,e){return ks(t)&&e.container()===t?function(t,e){var n=Os(t.data.substr(0,e.offset())),r=Os(t.data.substr(e.offset()));return(n.text+r.text).length>0?(Es(t),Rc(t,e.offset()-n.count)):e}(t,e):_s(t,e)},As=function(t,e){return Rc.isTextPosition(e)?Ns(t,e):function(t,e){return e.container()===t.parentNode?Rs(t,e):_s(t,e)}(t,e)},Ds=function(t){Ss(t)&&_o(t)&&(Ro(t)?t.removeAttribute("data-mce-caret"):Ts(t)),ks(t)&&(Es(t),0===t.data.length&&Ts(t))},Ms=ge().browser,Bs=$n,zs=Kn,Ps=Gn,Ls=function(t,e,n){var r,o,i=nc(e.getBoundingClientRect(),n);if("BODY"===t.tagName){var a=t.ownerDocument.documentElement;r=t.scrollLeft||a.scrollLeft,o=t.scrollTop||a.scrollTop}else{var u=t.getBoundingClientRect();r=t.scrollLeft-u.left,o=t.scrollTop-u.top}i.left+=r,i.right+=r,i.top+=o,i.bottom+=o,i.width=1;var c=e.offsetWidth-e.clientWidth;return c>0&&(n&&(c*=-1),i.left+=c,i.right+=c),i},Is=function(t,e,n,r){var o,i,a=Eu(),u=ns(t),c=u.length>0?u:"p",s=function(){!function(t){for(var e=Iu(Ne.fromDom(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n<e.length;n++){var r,o=e[n].dom,i=o.previousSibling;Bo(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,Mo(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1))}}(e),i&&(Ds(i),i=null),a.on((function(t){su(t.caret).remove(),a.clear()})),o&&(oo.clearInterval(o),o=void 0)},l=function(){o=oo.setInterval((function(){r()?su("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):su("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500)};return{show:function(t,r){var o;if(s(),Ps(r))return null;if(!n(r))return i=function(t,e){var n=t.ownerDocument.createTextNode(xo),r=t.parentNode;if(e){if(o=t.previousSibling,To(o)){if(_o(o))return o;if(Bo(o))return o.splitText(o.data.length-1)}r.insertBefore(n,t)}else{var o=t.nextSibling;if(To(o)){if(_o(o))return o;if(Mo(o))return o.splitText(1),o}t.nextSibling?r.insertBefore(n,t.nextSibling):r.appendChild(n)}return n}(r,t),o=r.ownerDocument.createRange(),Fs(i.nextSibling)?(o.setStart(i,0),o.setEnd(i,0)):(o.setStart(i,1),o.setEnd(i,1)),o;i=Do(c,r,t);var u=Ls(e,r,t);su(i).css("top",u.top);var f=su('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(Nt({},u)).appendTo(e)[0];return a.set({caret:f,element:r,before:t}),t&&su(f).addClass("mce-visual-caret-before"),l(),(o=r.ownerDocument.createRange()).setStart(i,0),o.setEnd(i,0),o},hide:s,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){a.on((function(t){var n=Ls(e,t.element,t.before);su(t.caret).css(Nt({},n))}))},destroy:function(){return oo.clearInterval(o)}}},Hs=function(){return Ms.isIE()||Ms.isEdge()||Ms.isFirefox()},Fs=function(t){return Bs(t)||zs(t)},Vs=function(t){return Fs(t)||Pn(t)&&Hs()},js=$n,Us=Kn,Ws=Mn("display","block table table-cell table-caption list-item"),qs=_o,$s=Oo,Gs=An,Ks=qo,Xs=function(t){return t>0},Ys=function(t){return t<0},Js=function(t,e){for(var n;n=t(e);)if(!$s(n))return n;return null},Qs=function(t,e,n,r,o){var i=new uo(t,r),a=js(t)||$s(t);if(Ys(e)){if(a&&n(t=Js(i.prev.bind(i),!0)))return t;for(;t=Js(i.prev.bind(i),o);)if(n(t))return t}if(Xs(e)){if(a&&n(t=Js(i.next.bind(i),!0)))return t;for(;t=Js(i.next.bind(i),o);)if(n(t))return t}return null},Zs=function(t,e){for(;t&&t!==e;){if(Ws(t))return t;t=t.parentNode}return null},tl=function(t,e,n){return Zs(t.container(),n)===Zs(e.container(),n)},el=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return Gs(n)?n.childNodes[r+t]:null},nl=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},rl=function(t,e,n){return Zs(e,t)===Zs(n,t)},ol=function(t,e,n){for(var r=t?"previousSibling":"nextSibling";n&&n!==e;){var o=n[r];if(qs(o)&&(o=o[r]),js(o)||Us(o)){if(rl(e,o,n))return o;break}if(Ks(o))break;n=n.parentNode}return null},il=_(nl,!0),al=_(nl,!1),ul=function(t,e,n){var r,o=_(ol,!0,e),i=_(ol,!1,e),a=n.startContainer,u=n.startOffset;if(Oo(a)){Gs(a)||(a=a.parentNode);var c=a.getAttribute("data-mce-caret");if("before"===c&&(r=a.nextSibling,Vs(r)))return il(r);if("after"===c&&(r=a.previousSibling,Vs(r)))return al(r)}if(!n.collapsed)return n;if(Hn(a)){if(qs(a)){if(1===t){if(r=i(a))return il(r);if(r=o(a))return al(r)}if(-1===t){if(r=o(a))return al(r);if(r=i(a))return il(r)}return n}if(Bo(a)&&u>=a.data.length-1)return 1===t&&(r=i(a))?il(r):n;if(Mo(a)&&u<=1)return-1===t&&(r=o(a))?al(r):n;if(u===a.data.length)return(r=i(a))?il(r):n;if(0===u)return(r=o(a))?al(r):n}return n},cl=function(t,e){return L.from(el(t?0:-1,e)).filter(js)},sl=function(t,e,n){var r=ul(t,e,n);return-1===t?Rc.fromRangeStart(r):Rc.fromRangeEnd(r)},ll=function(t){return L.from(t.getNode()).map(Ne.fromDom)},fl=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},dl=function(t,e){var n=tl(t,e);return!(n||!Un(t.getNode()))||n};!function(t){t[t.Backwards=-1]="Backwards",t[t.Forwards=1]="Forwards"}(Nc||(Nc={}));var ml,gl=$n,hl=Hn,pl=An,vl=Un,bl=qo,yl=function(t){return jo(t)||function(t){return!!$o(t)&&!0!==Y(ct(t.getElementsByTagName("*")),(function(t,e){return t||Lo(e)}),!1)}(t)},wl=Go,xl=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},Cl=function(t,e){if(Xs(t)){if(bl(e.previousSibling)&&!hl(e.previousSibling))return Rc.before(e);if(hl(e))return Rc(e,0)}if(Ys(t)){if(bl(e.nextSibling)&&!hl(e.nextSibling))return Rc.after(e);if(hl(e))return Rc(e,e.data.length)}return Ys(t)?vl(e)?Rc.before(e):Rc.after(e):Rc.before(e)},Sl=function(t,e,n){var r,o,i,a;if(!pl(n)||!e)return null;if(e.isEqual(Rc.after(n))&&n.lastChild){if(a=Rc.after(n.lastChild),Ys(t)&&bl(n.lastChild)&&pl(n.lastChild))return vl(n.lastChild)?Rc.before(n.lastChild):a}else a=e;var u=a.container(),c=a.offset();if(hl(u)){if(Ys(t)&&c>0)return Rc(u,--c);if(Xs(t)&&c<u.length)return Rc(u,++c);r=u}else{if(Ys(t)&&c>0&&(o=xl(u,c-1),bl(o)))return!yl(o)&&(i=Qs(o,t,wl,o))?hl(i)?Rc(i,i.data.length):Rc.after(i):hl(o)?Rc(o,o.data.length):Rc.before(o);if(Xs(t)&&c<u.childNodes.length&&(o=xl(u,c),bl(o)))return vl(o)?function(t,e){var n=e.nextSibling;return n&&bl(n)?hl(n)?Rc(n,0):Rc.before(n):Sl(Nc.Forwards,Rc.after(e),t)}(n,o):!yl(o)&&(i=Qs(o,t,wl,o))?hl(i)?Rc(i,0):Rc.before(i):hl(o)?Rc(o,0):Rc.after(o);r=o||a.getNode()}if((Xs(t)&&a.isAtEnd()||Ys(t)&&a.isAtStart())&&(r=Qs(r,t,M,n,!0),wl(r,n)))return Cl(t,r);o=Qs(r,t,wl,n);var s=Rt(K(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(u,n),gl));return!s||o&&s.contains(o)?o?Cl(t,o):null:a=Xs(t)?Rc.after(s):Rc.before(s)},kl=function(t){return{next:function(e){return Sl(Nc.Forwards,e,t)},prev:function(e){return Sl(Nc.Backwards,e,t)}}},Tl=function(t){return Rc.isTextPosition(t)?0===t.offset():qo(t.getNode())},Ol=function(t){if(Rc.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return qo(t.getNode(!0))},El=function(t,e){return!Rc.isTextPosition(t)&&!Rc.isTextPosition(e)&&t.getNode()===e.getNode(!0)},_l=function(t,e,n){return t?!El(e,n)&&(r=e,!(!Rc.isTextPosition(r)&&Un(r.getNode())))&&Ol(e)&&Tl(n):!El(n,e)&&Tl(e)&&Ol(n);var r},Rl=function(t,e,n){var r=kl(e);return L.from(t?r.next(n):r.prev(n))},Nl=function(t,e,n){return Rl(t,e,n).bind((function(r){return tl(n,r,e)&&_l(t,n,r)?Rl(t,e,r):L.some(r)}))},Al=function(t,e,n,r){return Nl(t,e,n).bind((function(n){return r(n)?Al(t,e,n,r):L.some(n)}))},Dl=function(t,e){var n,r=t?e.firstChild:e.lastChild;return Hn(r)?L.some(Rc(r,t?0:r.data.length)):r?qo(r)?L.some(t?Rc.before(r):Un(n=r)?Rc.before(n):Rc.after(n)):function(t,e,n){var r=t?Rc.before(n):Rc.after(n);return Rl(t,e,r)}(t,e,r):L.none()},Ml=_(Rl,!0),Bl=_(Rl,!1),zl=_(Dl,!0),Pl=_(Dl,!1),Ll="_mce_caret",Il=function(t){return An(t)&&t.id===Ll},Hl=function(t,e){for(;e&&e!==t;){if(e.id===Ll)return e;e=e.parentNode}return null},Fl=function(t){return _e.isArray(t.start)},Vl=function(t,e){return An(e)&&t.isBlock(e)&&!e.innerHTML&&!Se.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},jl=function(t,e){return Pl(t).fold(D,(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},Ul=function(t,e,n){return!(!function(t){return!1===t.hasChildNodes()}(e)||!Hl(t,e))&&(function(t,e){var n=t.ownerDocument.createTextNode(xo);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),!0)},Wl=function(t,e,n,r){var o,i,a,u,c=n[e?"start":"end"],s=t.getRoot();if(c){for(a=c[0],i=s,o=c.length-1;o>=1;o--){if(u=i.childNodes,Ul(s,i,r))return!0;if(c[o]>u.length-1)return!!Ul(s,i,r)||jl(i,r);i=u[c[o]]}3===i.nodeType&&(a=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,a):r.setEnd(i,a)}return!0},ql=function(t){return Hn(t)&&t.data.length>0},$l=function(t,e,n){var r,o,i,a,u,c,s=t.get(n.id+"_"+e),l=n.keep;if(s){if(r=s.parentNode,"start"===e?(l?s.hasChildNodes()?(r=s.firstChild,o=1):ql(s.nextSibling)?(r=s.nextSibling,o=0):ql(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)+1):o=t.nodeIndex(s),u=r,c=o):(l?s.hasChildNodes()?(r=s.firstChild,o=1):ql(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)):o=t.nodeIndex(s),u=r,c=o),!l){for(a=s.previousSibling,i=s.nextSibling,_e.each(_e.grep(s.childNodes),(function(t){Hn(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));s=t.get(n.id+"_"+e);)t.remove(s,!0);a&&i&&a.nodeType===i.nodeType&&Hn(a)&&!Se.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),t.remove(i),u=a,c=o)}return L.some(Rc(u,c))}return L.none()},Gl=function(t,e){var n=t.dom;if(e){if(Fl(e))return function(t,e){var n=t.createRng();return Wl(t,!0,e,n)&&Wl(t,!1,e,n)?L.some(n):L.none()}(n,e);if(function(t){return d(t.start)}(e))return L.some(function(t,e){var n,r=t.createRng();return n=Vc(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=Vc(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r}(n,e));if(function(t){return wt(t,"id")}(e))return function(t,e){var n=$l(t,"start",e),r=$l(t,"end",e);return Yn(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(Vl(t,e.container()),e.offset()),r.setEnd(Vl(t,n.container()),n.offset()),r}))}(n,e);if(function(t){return wt(t,"name")}(e))return function(t,e){return L.from(t.select(e.name)[e.index]).map((function(e){var n=t.createRng();return n.selectNode(e),n}))}(n,e);if(function(t){return wt(t,"rng")}(e))return L.some(e.rng)}return L.none()},Kl=function(t,e,n){return Jc(t,e,n)},Xl=function(t,e){Gl(t,e).each((function(e){t.setRng(e)}))},Yl=function(t){return An(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Jl=(ml=wo,function(t){return ml===t}),Ql=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Zl=function(t){return!Ql(t)&&!Jl(t)},tf=function(t){return!!t.nodeType},ef=function(t,e,n){var r=n.startOffset,o=n.startContainer;if((o!==n.endContainer||!function(t){return t&&/^(IMG)$/.test(t.nodeName)}(o.childNodes[r]))&&An(o)){var i=o.childNodes,a=void 0;r<i.length?(o=i[r],a=new uo(o,t.getParent(o,t.isBlock))):(o=i[i.length-1],(a=new uo(o,t.getParent(o,t.isBlock))).next(!0));for(var u=a.current();u;u=a.next())if(Hn(u)&&!af(u))return n.setStart(u,0),void e.setRng(n)}},nf=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(An(t)||!af(t))return t}},rf=function(t,e){return tf(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},of=function(t,e,n){return t.schema.isValidChild(e,n)},af=function(t,e){if(void 0===e&&(e=!1),y(t)&&Hn(t)){var n=e?t.data.replace(/ /g," "):t.data;return Xo(n)}return!1},uf=function(t,e){return w(t)?t=t(e):y(e)&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},cf=function(t,e){return e=e||"",t=""+((t=t||"").nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},sf=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},lf=function(t,e,n){return sf(t,t.getStyle(e,n),n)},ff=function(t,e){var n;return t.getParent(e,(function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n})),n},df=function(t,e,n){return t.getParents(e,n,t.getRoot())},mf=function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return vt(t,(function(t,e){return U(r,(function(t){return t===e}))}))};return U(t.formatter.get(e),(function(e){var r=o(e);return U(t.formatter.get(n),(function(t){var e=o(t);return function(t,e,n){return void 0===n&&(n=c),u(n).eq(t,e)}(r,e)}))}))},gf=function(t){return xt(t,"block")},hf=function(t){return xt(t,"selector")},pf=function(t){return xt(t,"inline")},vf=function(t){return hf(t)&&!1!==t.expand&&!pf(t)},bf=Yl,yf=df,wf=af,xf=rf,Cf=function(t,e){for(var n=e;n;){if(An(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},Sf=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},kf=function(t,e,n){return Sf(t,e,n,(function(t){return Jl(t)||Ql(t)}))},Tf=function(t,e,n){return Sf(t,e,n,Zl)},Of=function(t,e,n,r,o,i){var a,u=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=Zu(t),c=o?i.backwards:i.forwards;return L.from(c(e,n,(function(t,e){return bf(t.parentNode)?-1:(a=t,r(o,t,e))}),u))};return c(n,r,kf).bind((function(t){return i?c(t.container,t.offset+(o?-1:0),Tf):L.some(t)})).orThunk((function(){return a?L.some({container:a,offset:o?0:a.length}):L.none()}))},Ef=function(t,e,n,r,o){Hn(r)&&Wt(r.data)&&r[o]&&(r=r[o]);for(var i=yf(t,r),a=0;a<i.length;a++)for(var u=0;u<e.length;u++){var c=e[u];if((!y(c.collapsed)||c.collapsed===n.collapsed)&&(hf(c)&&t.is(i[a],c.selector)))return i[a]}return r},_f=function(t,e,n,r){var o=n,i=t.dom,a=i.getRoot(),u=e[0];if(gf(u)&&(o=u.wrapper?null:i.getParent(n,u.block,a)),!o){var c=i.getParent(n,"LI,TD,TH");o=i.getParent(Hn(n)?n.parentNode:n,(function(e){return e!==a&&xf(t,e)}),c)}if(o&&gf(u)&&u.wrapper&&(o=yf(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!cf(o,"br")););return o||n},Rf=function(t,e,n,r){var o=n.parentNode;return!y(n[r])&&(!(o!==e&&!b(o)&&!t.isBlock(o))||Rf(t,e,o,r))},Nf=function(t,e,n,r,o){var i,a=n,u=o?"previousSibling":"nextSibling",c=t.getRoot();if(Hn(n)&&!wf(n)&&(o?r>0:r<n.data.length))return n;for(;;){if(!e[0].block_expand&&t.isBlock(a))return a;for(var s=a[u];s;s=s[u]){var l=Hn(s)&&!Rf(t,c,s,u);if(!bf(s)&&(!Un(i=s)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!wf(s,l))return a}if(a===c||a.parentNode===c){n=a;break}a=a.parentNode}return n},Af=function(t){return bf(t.parentNode)||bf(t)},Df=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,a=e.endContainer,u=e.endOffset,c=t.dom,s=n[0];(An(o)&&o.hasChildNodes()&&(o=cc(o,i),Hn(o)&&(i=0)),An(a)&&a.hasChildNodes()&&(a=cc(a,e.collapsed?u:u-1),Hn(a)&&(u=a.nodeValue.length)),o=Cf(c,o),a=Cf(c,a),Af(o)&&(o=bf(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,Hn(o)&&(i=e.collapsed?o.length:0)),Af(a)&&(a=bf(a)?a:a.parentNode,a=e.collapsed?a.nextSibling||a:a.previousSibling||a,Hn(a)&&(u=e.collapsed?0:a.length)),e.collapsed)&&(Of(c,t.getBody(),o,i,!0,r).each((function(t){var e=t.container,n=t.offset;o=e,i=n})),Of(c,t.getBody(),a,u,!1,r).each((function(t){var e=t.container,n=t.offset;a=e,u=n})));return(pf(s)||s.block_expand)&&(pf(s)&&Hn(o)&&0!==i||(o=Nf(c,n,o,i,!0)),pf(s)&&Hn(a)&&u!==a.nodeValue.length||(a=Nf(c,n,a,u,!1))),vf(s)&&(o=Ef(c,n,e,o,"previousSibling"),a=Ef(c,n,e,a,"nextSibling")),(gf(s)||hf(s))&&(o=_f(t,n,o,"previousSibling"),a=_f(t,n,a,"nextSibling"),gf(s)&&(c.isBlock(o)||(o=Nf(c,n,o,i,!0)),c.isBlock(a)||(a=Nf(c,n,a,u,!1)))),An(o)&&(i=c.nodeIndex(o),o=o.parentNode),An(a)&&(u=c.nodeIndex(a)+1,a=a.parentNode),{startContainer:o,startOffset:i,endContainer:a,endOffset:u}},Mf=function(t,e,n){var r=e.startOffset,o=cc(e.startContainer,r),i=e.endOffset,a=cc(e.endContainer,i-1),u=function(t){var e=t[0];Hn(e)&&e===o&&r>=e.data.length&&t.splice(0,1);var n=t[t.length-1];return 0===i&&t.length>0&&n===a&&Hn(n)&&t.splice(t.length-1,1),t},c=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},s=function(e,n){return t.getParent(e,(function(t){return t.parentNode===n}),n)},l=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,a=i.parentNode;i&&i!==e;i=a){a=i.parentNode;var s=c(i===t?i:i[o],o);s.length&&(r||s.reverse(),n(u(s)))}};if(o===a)return n(u([o]));var f=t.findCommonAncestor(o,a);if(t.isChildOf(o,a))return l(o,f,!0);if(t.isChildOf(a,o))return l(a,f);var d=s(o,f)||o,m=s(a,f)||a;l(o,d,!0);var g=c(d===o?d:d.nextSibling,"nextSibling",m===a?m.nextSibling:m);g.length&&n(u(g)),l(a,m)},Bf=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},zf=function(t){return K(function(t){return tt(t,(function(t){var e=uc(t);return e?[Ne.fromDom(e)]:[]}))}(t),bo)},Pf=function(t,e){var n=Iu(e,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:zf(t)},Lf=function(t){return Pf(Bf(t.selection.getSel()),Ne.fromDom(t.getBody()))},If=function(t,e){return Jr(t,"table",e)},Hf=function(t){return tn(t).fold(T([t]),(function(e){return[t].concat(Hf(e))}))},Ff=function(t){return en(t).fold(T([t]),(function(e){return"br"===Le(e)?Ke(e).map((function(e){return[t].concat(Ff(e))})).getOr([]):[t].concat(Ff(e))}))},Vf=function(t,e){return Yn(function(t){var e=t.startContainer,n=t.startOffset;return Hn(e)?0===n?L.some(Ne.fromDom(e)):L.none():L.from(e.childNodes[n]).map(Ne.fromDom)}(e),function(t){var e=t.endContainer,n=t.endOffset;return Hn(e)?n===e.data.length?L.some(Ne.fromDom(e)):L.none():L.from(e.childNodes[n-1]).map(Ne.fromDom)}(e),(function(e,n){var r=Q(Hf(t),_(Be,e)),o=Q(Ff(t),_(Be,n));return r.isSome()&&o.isSome()})).getOr(!1)},jf=function(t,e,n,r){var o=n,i=new uo(n,o),a=vt(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!j(["td","th","table"],e.toLowerCase())}));do{if(Hn(n)&&0!==_e.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(a[n.nodeName])return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},Uf=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},Wf=function(t,e){var n=Lf(t);n.length>0?q(n,(function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},qf=function(t,e,n){var r=Yc(t,e);n(r),t.moveToBookmark(r)},$f=function(t,e){var n=function(e){return t(e)?L.from(e.dom.nodeValue):L.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Ve,"text"),Gf=function(t){return $f.get(t)},Kf=function(t,e,n,r){return Ge(e).fold((function(){return"skipping"}),(function(o){return"br"===r||function(t){return Ve(t)&&Gf(t)===xo}(e)?"valid":function(t){return Fe(t)&&Pu(t,Hu())}(e)?"existing":Il(e.dom)?"caret":of(t,n,r)&&of(t,Le(o),n)?"valid":"invalid-child"}))},Xf=function(t,e,n,r){var o=e.uid,i=void 0===o?Gu("mce-annotation"):o,a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["uid"]),u=Ne.fromTag("span",t);Bu(u,Hu()),Zn(u,""+Vu(),i),Zn(u,""+Fu(),n);var c=r(i,a),s=c.attributes,l=void 0===s?{}:s,f=c.classes,d=void 0===f?[]:f;return tr(u,l),function(t,e){q(e,(function(e){Bu(t,e)}))}(u,d),u},Yf=function(t,e,n,r,o){var i=[],a=Xf(t.getDoc(),o,n,r),u=Eu(),c=function(){u.clear()},s=function(t){q(t,l)},l=function(e){switch(Kf(t,e,"span",Le(e))){case"invalid-child":c();var n=Qe(e);s(n),c();break;case"valid":!function(t,e){fn(t,e),gn(e,t)}(e,u.get().getOrThunk((function(){var t=Yu(a);return i.push(t),u.set(t),t})))}};return Mf(t.dom,e,(function(t){c(),function(t){var e=W(t,Ne.fromDom);s(e)}(t)})),i},Jf=function(t,e,n,r){t.undoManager.transact((function(){var o=t.selection,i=o.getRng(),a=Lf(t).length>0;if(i.collapsed&&!a&&function(t,e){var n=Df(t,e,[{inline:"span"}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)}(t,i),o.getRng().collapsed&&!a){var u=Xf(t.getDoc(),r,e,n.decorate);Ku(u,wo),o.getRng().insertNode(u.dom),o.select(u.dom)}else qf(o,!1,(function(){Wf(t,(function(o){Yf(t,o,e,n.decorate,r)}))}))}))},Qf=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return yt(e,t).map((function(t){return t.settings}))}});qu(t,n);var r=Wu(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each((function(n){Jf(t,e,n,r)}))},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){ju(t,L.some(e)).each((function(t){var e=t.elements;q(e,bn)}))},getAll:function(e){var n=function(t,e){var n=Ne.fromDom(t.getBody()),r=Iu(n,"["+Fu()+'="'+e+'"]'),o={};return q(r,(function(t){var e=er(t,Vu()),n=yt(o,e).getOr([]);o[e]=n.concat([t])})),o}(t,e);return mt(n,(function(t){return W(t,(function(t){return t.dom}))}))}}},Zf=function(t){return{getBookmark:_(Kl,t),moveToBookmark:_(Xl,t)}};Zf.isBookmarkNode=Yl;var td=function(t,e){for(;e&&e!==t;){if(qn(e)||$n(e))return e;e=e.parentNode}return null},ed=function(t,e,n){if(n.collapsed)return!1;if(Se.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(An(r))return U(r.getClientRects(),(function(n){return ac(n,t,e)}))}return U(n.getClientRects(),(function(n){return ac(n,t,e)}))},nd=function(t,e,n){return t.fire(e,n)},rd=function(t,e,n,r){return t.fire("FormatApply",{format:e,node:n,vars:r})},od=function(t,e,n,r){return t.fire("FormatRemove",{format:e,node:n,vars:r})},id={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||id.metaKeyPressed(t)},metaKeyPressed:function(t){return Se.mac?t.metaKey:t.ctrlKey&&!t.altKey}},ad=$n,ud=function(t,e){var n,r,o,i,a,u,c,s,l,f,d,m,g,h,p,v="data-mce-selected",b=e.dom,w=_e.each,x=e.getDoc(),C=document,S=Math.abs,k=Math.round,T=e.getBody(),O={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},E=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},_=function(t){return Kn(t)||b.hasClass(t,"mce-preview-object")},R=function(t){var n=t.target;(function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return E(t.target)&&!ed(n.clientX,n.clientY,e)}return E(t.target)&&!ed(t.clientX,t.clientY,e)})(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},N=function(t){return b.is(t,"figure.image")?[t.querySelector("img")]:b.hasClass(t,"mce-preview-object")&&y(t.firstElementChild)?[t,t.firstElementChild]:[t]},A=function(t){var n=ps(e);return!!n&&("false"!==t.getAttribute("data-mce-resize")&&(t!==e.getBody()&&(b.hasClass(t,"mce-preview-object")?De(Ne.fromDom(t.firstElementChild),n):De(Ne.fromDom(t),n))))},D=function(t,n,r){if(y(r)){var o=N(t);q(o,(function(t){t.style[n]||!e.schema.isValid(t.nodeName.toLowerCase(),n)?b.setStyle(t,n,r):b.setAttrib(t,n,""+r)}))}},M=function(t,e,n){D(t,"width",e),D(t,"height",n)},B=function(t){var a,v,y,w;a=t.screenX-u,v=t.screenY-c,m=a*i[2]+s,g=v*i[3]+l,m=m<5?5:m,g=g<5?5:g,((E(n)||_(n))&&!1!==function(t){return t.getParam("resize_img_proportional",!0,"boolean")}(e)?!id.modifierPressed(t):id.modifierPressed(t))&&(S(a)>S(v)?(g=k(m*f),m=k(g/f)):(m=k(g/f),g=k(m*f))),M(r,m,g),y=(y=i.startPos.x+a)>0?y:0,w=(w=i.startPos.y+v)>0?w:0,b.setStyles(o,{left:y,top:w,display:"block"}),o.innerHTML=m+" &times; "+g,i[2]<0&&r.clientWidth<=m&&b.setStyle(r,"left",undefined+(s-m)),i[3]<0&&r.clientHeight<=g&&b.setStyle(r,"top",undefined+(l-g)),(a=T.scrollWidth-h)+(v=T.scrollHeight-p)!==0&&b.setStyles(o,{left:y-a,top:w-v}),d||(!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(e,n,s,l,"corner-"+i.name),d=!0)},z=function(){var t=d;d=!1,t&&(D(n,"width",m),D(n,"height",g)),b.unbind(x,"mousemove",B),b.unbind(x,"mouseup",z),C!==x&&(b.unbind(C,"mousemove",B),b.unbind(C,"mouseup",z)),b.remove(r),b.remove(o),b.remove(a),P(n),t&&(!function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(e,n,m,g,"corner-"+i.name),b.setAttrib(n,"style",b.getAttrib(n,"style"))),e.nodeChanged()},P=function(t){F();var d=b.getPos(t,T),y=d.x,S=d.y,k=t.getBoundingClientRect(),E=k.width||k.right-k.left,R=k.height||k.bottom-k.top;n!==t&&(L(),n=t,m=g=0);var D=e.fire("ObjectSelected",{target:t}),P=b.getAttrib(n,v,"1");A(t)&&!D.isDefaultPrevented()?w(O,(function(t,e){var d,m=function(d){var m,g=N(n)[0];u=d.screenX,c=d.screenY,s=g.clientWidth,l=g.clientHeight,f=l/s,(i=t).name=e,i.startPos={x:E*t[0]+y,y:R*t[1]+S},h=T.scrollWidth,p=T.scrollHeight,a=b.add(T,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),b.setStyles(a,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),r=_(m=n)?b.create("img",{src:Se.transparentSrc}):m.cloneNode(!0),b.addClass(r,"mce-clonedresizable"),b.setAttrib(r,"data-mce-bogus","all"),r.contentEditable="false",b.setStyles(r,{left:y,top:S,margin:0}),M(r,E,R),r.removeAttribute(v),T.appendChild(r),b.bind(x,"mousemove",B),b.bind(x,"mouseup",z),C!==x&&(b.bind(C,"mousemove",B),b.bind(C,"mouseup",z)),o=b.add(T,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},s+" &times; "+l)};(d=b.get("mceResizeHandle"+e))&&b.remove(d),d=b.add(T,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===Se.ie&&(d.contentEditable=!1),b.bind(d,"mousedown",(function(t){t.stopImmediatePropagation(),t.preventDefault(),m(t)})),t.elm=d,b.setStyles(d,{left:E*t[0]+y-d.offsetWidth/2,top:R*t[1]+S-d.offsetHeight/2})})):L(),b.getAttrib(n,v)||n.setAttribute(v,P)},L=function(){F(),n&&n.removeAttribute(v),dt(O,(function(t,e){var n=b.get("mceResizeHandle"+e);n&&(b.unbind(n),b.remove(n))}))},I=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};d||e.removed||(w(b.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute(v)})),r="mousedown"===n.type?n.target:t.getNode(),o(r=b.$(r).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],T)&&(V(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?P(r):L())},H=function(t){return ad(td(e.getBody(),t))},F=function(){dt(O,(function(t){t.elm&&(b.unbind(t.elm),delete t.elm)}))},V=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}};e.on("init",(function(){if(V(),Se.browser.isIE()||Se.browser.isEdge()){e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;d||!/^(TABLE|IMG|HR)$/.test(r)||H(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())}));var t=function(t){var n=function(t){oo.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(H(t.target)||Kn(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};b.bind(T,"mscontrolselect",t),e.on("remove",(function(){return b.unbind(T,"mscontrolselect",t)}))}var r=oo.throttle((function(t){e.composing||I(t)}));e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),e.on("keyup compositionend",(function(t){n&&"TABLE"===n.nodeName&&r(t)})),e.on("hide blur",L),e.on("contextmenu longpress",R,!0)})),e.on("remove",F);return{isResizable:A,showResizeRect:P,hideResizeRect:L,updateResizeRect:I,destroy:function(){n=r=a=null}}},cd=function(t){return qn(t)||$n(t)},sd=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(i.caretRangeFromPoint)r=i.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=_e.toArray(i.getClientRects())).sort((function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-Math.abs(Math.max(n.top-e,n.bottom-e))}))).length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return function(t,e){var n=t&&t.parentElement?t.parentElement():null;return $n(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,cd))?null:t}(r,n.body)}return r},ld=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},fd=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},dd=function(t,e,n){return fd(t,e,(function(t){return t.nodeName===n}))},md=function(t){return t&&"TABLE"===t.nodeName},gd=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},hd=function(t,e){return _o(t)&&!1===fd(t,e,Il)},pd=function(t,e,n){for(var r=new uo(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(Un(e))return!0},vd=function(t,e,n,r,o){var i,a,u=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||u;if(r&&Un(o)&&e&&t.isEmpty(s))return L.some(Rc(o.parentNode,t.nodeIndex(o)));for(var l=new uo(o,s);a=l[r?"prev":"next"]();){if("false"===t.getContentEditableParent(a)||hd(a,u))return L.none();if(Hn(a)&&a.nodeValue.length>0)return!1===dd(a,u,"A")?L.some(Rc(a,r?a.nodeValue.length:0)):L.none();if(t.isBlock(a)||c[a.nodeName.toLowerCase()])return L.none();i=a}return n&&i?L.some(Rc(i,0)):L.none()},bd=function(t,e,n,r){var o,i,a,u,c=t.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var l=An(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(u=n,_o(o))return L.none();if(An(o)&&i>o.childNodes.length-1&&(u=!1),Vn(o)&&(o=c,i=0),o===c){if(u&&(a=o.childNodes[i>0?i-1:0])){if(_o(a))return L.none();if(f[a.nodeName]||md(a))return L.none()}if(o.hasChildNodes()){if(i=Math.min(!u&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Hn(o)&&l?o.data.length:0,!e&&o===c.lastChild&&md(o))return L.none();if(function(t,e){for(;e&&e!==t;){if($n(e))return!0;e=e.parentNode}return!1}(c,o)||_o(o))return L.none();if(o.hasChildNodes()&&!1===md(o)){a=o;var d=new uo(o,c);do{if($n(a)||_o(a)){s=!1;break}if(Hn(a)&&a.nodeValue.length>0){i=u?0:a.nodeValue.length,o=a,s=!0;break}if(f[a.nodeName.toLowerCase()]&&!gd(a)){i=t.nodeIndex(a),o=a.parentNode,u||i++,s=!0;break}}while(a=u?d.next():d.prev())}}}return e&&(Hn(o)&&0===i&&vd(t,l,e,!0,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),An(o)&&((a=o.childNodes[i])||(a=o.childNodes[i-1]),!a||!Un(a)||function(t,e){return t.previousSibling&&t.previousSibling.nodeName===e}(a,"A")||pd(t,a,!1)||pd(t,a,!0)||vd(t,l,e,!0,a).each((function(t){o=t.container(),i=t.offset(),s=!0})))),u&&!e&&Hn(o)&&i===o.nodeValue.length&&vd(t,l,e,!1,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),s?L.some(Rc(o,i)):L.none()},yd=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=Rc.fromRangeStart(e);return bd(t,n,!0,r).each((function(t){n&&Rc.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||bd(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),ld(e,r)?L.none():L.some(r)},wd=function(t,e){return t.splitText(e)},xd=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&Hn(e)?n>0&&n<e.nodeValue.length&&(e=(r=wd(e,n)).previousSibling,o>n?(e=r=wd(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Hn(e)&&n>0&&n<e.nodeValue.length&&(e=wd(e,n),n=0),Hn(r)&&o>0&&o<r.nodeValue.length&&(o=(r=wd(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}},Cd=function(t){return{walk:function(e,n){return Mf(t,e,n)},split:xd,normalize:function(e){return yd(t,e).fold(D,(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))}}};Cd.compareRanges=ld,Cd.getCaretRangeFromPoint=sd,Cd.getSelectedNode=uc,Cd.getNode=cc;var Sd,kd=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=ir(n,t);return parseFloat(o)||0}return r},r=function(t,e){return Y(e,(function(e,n){var r=ir(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!x(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Jn(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}("height",(function(t){var e=t.dom;return yn(t)?e.getBoundingClientRect().height:e.offsetHeight})),Td=function(t,e){return t.view(e).fold(T([]),(function(e){var n=t.owner(e),r=Td(t,n);return[e].concat(r)}))},Od=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?L.none():L.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Ne.fromDom)},owner:function(t){return qe(t)}}),Ed=function(t){var e=Ne.fromDom(document),n=kn(e),r=function(t,e){var n=e.owner(t);return Td(e,n)}(t,Od),o=Sn(t),i=X(r,(function(t,e){var n=Sn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return xn(i.left+o.left+n.left,i.top+o.top+n.top)},_d=function(t){return"textarea"===Le(t)},Rd=function(t,e){var n=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return xn(n.offsetLeft,n.offsetTop);var i=Cn(null==r?void 0:r.pageYOffset,o.scrollTop),a=Cn(null==r?void 0:r.pageXOffset,o.scrollLeft),u=Cn(o.clientTop,n.clientTop),c=Cn(o.clientLeft,n.clientLeft);return Sn(t).translate(a-c,i-u)}(t),r=function(t){return kd.get(t)}(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}},Nd=function(t,e){var n=function(t,e){var n=Qe(t);if(0===n.length||_d(t))return{element:t,offset:e};if(e<n.length&&!_d(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return _d(r)?{element:t,offset:e}:"img"===Le(r)?{element:r,offset:1}:Ve(r)?{element:r,offset:Gf(r).length}:{element:r,offset:Qe(r).length}}(t,e),r=Ne.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>');return fn(n.element,r),Rd(r,(function(){return vn(r)}))},Ad=function(t,e,n,r){zd(t,(function(o,i){return Md(t,e,n,r)}),n)},Dd=function(t,e,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(t,e){return t.fire("ScrollIntoView",e).isDefaultPrevented()})(t,i)||(n(e,kn(e).top,r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},Md=function(t,e,n,r){var o=Ne.fromDom(t.getBody()),i=Ne.fromDom(t.getDoc());o.dom.offsetWidth;var a=Nd(Ne.fromDom(n.startContainer),n.startOffset);Dd(t,i,e,a,r),a.cleanup()},Bd=function(t,e,n,r){var o=Ne.fromDom(t.getDoc());Dd(t,o,n,function(t){return Rd(Ne.fromDom(t),C)}(e),r)},zd=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;e(Ne.fromDom(r),Ne.fromDom(i));var u=t.dom.createRng();u.setStart(r,o),u.setEnd(i,a),t.selection.setRng(n)},Pd=function(t,e,n,r){var o=t.pos;if(n)Tn(o.left,o.top,r);else{var i=o.top-e+t.height;Tn(o.left,i,r)}},Ld=function(t,e,n,r,o){var i=n+e,a=r.pos.top,u=r.bottom,c=u-a>=n;if(a<e)Pd(r,n,!1!==o,t);else if(a>i){Pd(r,n,c?!1!==o:!0===o,t)}else u>i&&!c&&Pd(r,n,!0===o,t)},Id=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Ld(t,e,o,n,r)},Hd=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Ld(t,e,o,n,r);var i=Ed(n.element),a=_n(window);i.top<a.y?On(n.element,!1!==r):i.top>a.bottom&&On(n.element,!0===r)},Fd=function(t,e,n){return Ad(t,Id,e,n)},Vd=function(t,e,n){return Bd(t,e,Id,n)},jd=function(t,e,n){return Ad(t,Hd,e,n)},Ud=function(t,e,n){return Bd(t,e,Hd,n)},Wd=function(t,e,n){(t.inline?Fd:jd)(t,e,n)},qd=function(t){var e=un(t).dom;return t.dom===e.activeElement},$d=function(t){return void 0===t&&(t=Ne.fromDom(document)),L.from(t.dom.activeElement).map(Ne.fromDom)},Gd=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Kd=Tr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Xd=(Kd.before,Kd.on,Kd.after,function(t){return t.fold(O,O,O)}),Yd=Tr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Jd={domRange:Yd.domRange,relative:Yd.relative,exact:Yd.exact,exactFromRange:function(t){return Yd.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return Ne.fromDom(t.startContainer)},relative:function(t,e){return Xd(t)},exact:function(t,e,n,r){return t}})}(t);return $e(e)},range:Gd},Qd=ge().browser,Zd=function(t,e){var n=Ve(e)?Gf(e).length:Qe(e).length+1;return t>n?n:t<0?0:t},tm=function(t){return Jd.range(t.start,Zd(t.soffset,t.start),t.finish,Zd(t.foffset,t.finish))},em=function(t,e){return!Nn(e.dom)&&(Pe(t,e)||Be(t,e))},nm=function(t){return function(e){return em(t,e.start)&&em(t,e.finish)}},rm=function(t){return!0===t.inline||Qd.isIE()},om=function(t){return Jd.range(Ne.fromDom(t.startContainer),t.startOffset,Ne.fromDom(t.endContainer),t.endOffset)},im=function(t){return function(t){var e=t.getSelection();return(e&&0!==e.rangeCount?L.from(e.getRangeAt(0)):L.none()).map(om)}($e(t).dom).filter(nm(t))},am=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),L.some(e)}catch(t){return L.none()}},um=function(t){var e=rm(t)?im(Ne.fromDom(t.getBody())):L.none();t.bookmark=e.isSome()?e:t.bookmark},cm=function(t){return(t.bookmark?t.bookmark:L.none()).bind((function(e){return function(t,e){return L.from(e).filter(nm(t)).map(tm)}(Ne.fromDom(t.getBody()),e)})).bind(am)},sm={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},lm=function(t,e){ge().browser.isIE()?function(t){t.on("focusout",(function(){um(t)}))}(t):function(t,e){t.on("mouseup touchend",(function(t){e.throttle()}))}(t,e),t.on("keyup NodeChange",(function(e){(function(t){return"nodechange"===t.type&&t.selectionChange})(e)||um(t)}))},fm=function(t){var e=_u((function(){um(t)}),0);t.on("init",(function(){t.inline&&function(t,e){var n=function(){e.throttle()};pu.DOM.bind(document,"mouseup",n),t.on("remove",(function(){pu.DOM.unbind(document,"mouseup",n)}))}(t,e),lm(t,e)})),t.on("remove",(function(){e.cancel()}))},dm=pu.DOM,mm=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t);return null!==dm.getParent(e,(function(e){return function(t){return sm.isEditorUIElement(t)}(e)||!!n&&t.dom.is(e,n)}))},gm=function(t,e){var n=e.editor;fm(n),n.on("focusin",(function(){var e=t.focusedEditor;e!==n&&(e&&e.fire("blur",{focusedEditor:n}),t.setActive(n),t.focusedEditor=n,n.fire("focus",{blurredEditor:e}),n.focus(!0))})),n.on("focusout",(function(){oo.setEditorTimeout(n,(function(){var e=t.focusedEditor;mm(n,function(t){try{var e=un(Ne.fromDom(t.getElement()));return $d(e).fold((function(){return document.body}),(function(t){return t.dom}))}catch(t){return document.body}}(n))||e!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),Sd||(Sd=function(e){var n=t.activeEditor;n&&function(t){if(an()&&y(t.target)){var e=Ne.fromDom(t.target);if(Fe(e)&&ln(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return at(n)}}return L.from(t.target)}(e).each((function(e){e.ownerDocument===document&&(e===document.body||mm(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},dm.bind(document,"focusin",Sd))},hm=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(dm.unbind(document,"focusin",Sd),Sd=null)},pm=function(t,e){return function(t){return t.collapsed?L.from(cc(t.startContainer,t.startOffset)).map(Ne.fromDom):L.none()}(e).bind((function(e){return vo(e)?L.some(e):!1===Pe(t,e)?L.some(t):L.none()}))},vm=function(t,e){pm(Ne.fromDom(t.getBody()),e).bind((function(t){return zl(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},bm=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},ym=function(t){return qd(t)||(e=t,$d(un(e)).filter((function(t){return e.dom.contains(t.dom)}))).isSome();var e},wm=function(t){return t.inline?function(t){var e=t.getBody();return e&&ym(Ne.fromDom(e))}(t):function(t){return t.iframeElement&&qd(Ne.fromDom(t.iframeElement))}(t)},xm=function(t){return wm(t)||function(t){var e=un(Ne.fromDom(t.getElement()));return $d(e).filter((function(e){return!(void 0!==(n=e.dom.classList)&&(n.contains("tox-edit-area")||n.contains("tox-edit-area__iframe")||n.contains("mce-content-body")))&&mm(t,e.dom);var n})).isSome()}(t)},Cm=function(t){return t.editorManager.setActive(t)},Sm=function(t,e){t.removed||(e?Cm(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===wm(t)&&cm(t).each((function(e){t.selection.setRng(e),r=e}));var o=function(t,e){return t.dom.getParent(e,(function(e){return"true"===t.dom.getContentEditable(e)}))}(t,e.getNode());if(t.$.contains(n,o))return bm(o),vm(t,r),void Cm(t);t.inline||(Se.opera||bm(n),t.getWin().focus()),(Se.gecko||t.inline)&&(bm(n),vm(t,r)),Cm(t)}(t))},km=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,a=n?e.startOffset:e.endOffset;return L.from(i).map(Ne.fromDom).map((function(t){return r&&e.collapsed?t:Ze(t,o(t,a)).getOr(t)})).bind((function(t){return Fe(t)?L.some(t):Ge(t).filter(Fe)})).map((function(t){return t.dom})).getOr(t)},Tm=function(t,e,n){return km(t,e,!0,n,(function(t,e){return Math.min(nn(t),e)}))},Om=function(t,e,n){return km(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},Em=function(t,e){for(var n=t;t&&Hn(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},_m=function(t,e){return W(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},Rm={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Nm=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var a=t.parent;a&&a!==e;a=a.parent)if(i=a[o])return i}},Am=function(t){if(!Xo(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},Dm=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},Mm=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,Rm[e]||1);return n&&dt(n,(function(t,e){r.attr(e,t)})),r},t.prototype.replace=function(t){var e=this;return t.parent&&t.remove(),e.insert(t,e),e.remove(),e},t.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&dt(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=this,r=new t(n.name,n.type);if(e=n.attributes){var o=[];o.map={};for(var i=0,a=e.length;i<a;i++){var u=e[i];"id"!==u.name&&(o[o.length]={name:u.name,value:u.value},o.map[u.name]=u.value)}r.attributes=o}return r.value=n.value,r.shortEnded=n.shortEnded,r},t.prototype.wrap=function(t){var e=this;return e.parent.insert(t,e),t.append(e),e},t.prototype.unwrap=function(){for(var t=this,e=t.firstChild;e;){var n=e.next;t.insert(e,t,!0),e=n}t.remove()},t.prototype.remove=function(){var t=this,e=t.parent,n=t.next,r=t.prev;return e&&(e.firstChild===t?(e.firstChild=n,n&&(n.prev=null)):r.next=n,e.lastChild===t?(e.lastChild=r,r&&(r.next=null)):n.prev=r,t.parent=t.next=t.prev=null),t},t.prototype.append=function(t){var e=this;t.parent&&t.remove();var n=e.lastChild;return n?(n.next=t,t.prev=n,e.lastChild=t):e.lastChild=e.firstChild=t,t.parent=e,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=Nm(n,this))n.name===t&&e.push(n);return e},t.prototype.children=function(){for(var t=[],e=this.firstChild;e;e=e.next)t.push(e);return t},t.prototype.empty=function(){var t=this;if(t.firstChild){for(var e=[],n=t.firstChild;n;n=Nm(n,t))e.push(n);for(var r=e.length;r--;){(n=e[r]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}}return t.firstChild=t.lastChild=null,t},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this,o=r.firstChild;if(Dm(r))return!1;if(o)do{if(1===o.type){if(o.attr("data-mce-bogus"))continue;if(t[o.name])return!1;if(Dm(o))return!1}if(8===o.type)return!1;if(3===o.type&&!Am(o))return!1;if(3===o.type&&o.parent&&e[o.parent.name]&&Xo(o.value))return!1;if(n&&n(o))return!1}while(o=Nm(o,r));return!0},t.prototype.walk=function(t){return Nm(this,null,t)},t}(),Bm=function(t,e){return t.replace(e.re,(function(t){return yt(e.uris,t).getOr(t)}))},zm=_e.each,Pm=_e.trim,Lm="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Im={ftp:21,http:80,https:443,mailto:25},Hm=["img","video"],Fm=function(t,e,n){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?function(t,e){return y(t)?!t:!y(e)||!j(Hm,e)}(t.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))},Vm=function(){function t(e,n){e=Pm(e),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))o.source=e;else{var i=0===e.indexOf("//");if(0!==e.indexOf("/")||i||(e=(r&&r.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var a=this.settings.base_uri?this.settings.base_uri.path:new t(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+o.toAbsPath(a,e);else{var u=/([^#?]*)([#?]?.*)/.exec(e);e=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(a,u[1])+u[2]}}e=e.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);zm(Lm,(function(t,e){var n=c[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[t]=n})),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="")}}return t.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.isDomSafe=function(t,e,n){if(void 0===n&&(n={}),n.allow_script_urls)return!0;var r=yi.decode(t).replace(/[\s\u0000-\u001F]+/g,"");try{r=decodeURIComponent(r)}catch(t){r=unescape(r)}return!/((java|vb)script|mhtml):/i.test(r)&&!Fm(n,r,e)},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=Im[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",a=t.substring(0,t.lastIndexOf("/")).split("/"),u=e.split("/");if(a.length>=u.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||a[n]!==u[n]){o=n+1;break}if(a.length<u.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return e;for(n=0,r=a.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=u.length;n<r;n++)i+=n!==o-1?"/"+u[n]:u[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],a=/\/$/.test(e)?"/":"",u=t.split("/"),c=e.split("/");for(zm(u,(function(t){t&&i.push(t)})),u=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=u.length-o)<=0?nt(i).join("/"):u.slice(0,n).join("/")+"/"+nt(i).join("/")).indexOf("/")&&(r="/"+r),a&&r.lastIndexOf("/")!==r.length-1&&(r+=a),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),jm=_e.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),Um=function(t,e,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=t.getShortEndedElements(),a=1,u=n;0!==a;)for(r.lastIndex=u;;){var c=r.exec(e);if(null===c)return u;if("!"===c[1]){u=It(c[2],"--")?Wm(e,!1,c.index+"!--".length):Wm(e,!0,c.index+1);break}o.lastIndex=r.lastIndex;var s=o.exec(e);if(!h(s)&&s.index===r.lastIndex){"/"===c[1]?a-=1:wt(i,c[2])||(a+=1),u=r.lastIndex+s[0].length;break}}return u},Wm=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(t.substr(e))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/g;a.lastIndex=n;var u=a.exec(t);return u?u.index+u[0].length:r.length},qm=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null},$m=function(t,e){var n;void 0===e&&(e=Ri());var r=null!==(n=(t=t||{}).document)&&void 0!==n?n:document,o=r.createElement("form");!1!==t.fix_self_closing&&(t.fix_self_closing=!0);var i=t.comment?t.comment:C,a=t.cdata?t.cdata:C,u=t.text?t.text:C,c=t.start?t.start:C,s=t.end?t.end:C,l=t.pi?t.pi:C,f=t.doctype?t.doctype:C,d=function(n,d){void 0===d&&(d="html");for(var m,g,h,p,v,b,y,w,x,C,S,k,T,O,E,_,R,N,A,D=n.html,M=0,B=[],z=0,P=yi.decode,L=_e.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),I="html"===d?0:1,H=function(t){var e,n;for(e=B.length;e--&&B[e].name!==t;);if(e>=0){for(n=B.length-1;n>=e;n--)(t=B[n]).valid&&s(t.name);B.length=e}},F=function(t,e){return u(Bm(t,n),e)},V=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),i(Bm(e,n)))},j=function(t,e){var n=t||"",r=!It(n,"--"),o=Wm(D,r,e);return t=D.substr(e,o-e),V(r?n+t:t),o+1},U=function(e,i,a,u,c){if(a=function(t){return Bm(t,n)}((i=i.toLowerCase())in K?i:P(a||u||c||"")),X&&!w&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(i)){var s=O[i];if(!s&&E){for(var l=E.length;l--&&!(s=E[l]).pattern.test(i););-1===l&&(s=null)}if(!s)return;if(s.validValues&&!(a in s.validValues))return}("name"===i||"id"===i)&&e in jm&&(a in r||a in o)||L[i]&&!Vm.isDomSafe(a,e,t)||w&&(i in L||0===i.indexOf("on"))||(p.map[i]=a,p.push({name:i,value:a}))},W=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),q=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,$=e.getShortEndedElements(),G=t.self_closing_elements||e.getSelfClosingElements(),K=e.getBoolAttrs(),X=t.validate,Y=t.remove_internals,J=t.fix_self_closing,Q=e.getSpecialElements(),Z=D+">";m=W.exec(Z);){var tt=m[0];if(M<m.index&&F(P(D.substr(M,m.index-M))),g=m[7])":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),H(g);else if(g=m[8]){if(m.index+tt.length>D.length){F(P(D.substr(m.index))),M=m.index+tt.length;continue}":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),x=g in $,J&&G[g]&&B.length>0&&B[B.length-1].name===g&&H(g);var et=qm(q,m[9]);if(null!==et){if("all"===et){M=Um(e,D,W.lastIndex),W.lastIndex=M;continue}S=!1}if(!X||(C=e.getElementRule(g))){if(S=!0,X&&(O=C.attributes,E=C.attributePatterns),(T=m[9])?((w=-1!==T.indexOf("data-mce-type"))&&Y&&(S=!1),(p=[]).map={},T.replace(q,(function(t,e,n,r,o){return U(g,e,n,r,o),""}))):(p=[]).map={},X&&!w){if(_=C.attributesRequired,R=C.attributesDefault,N=C.attributesForced,C.removeEmptyAttrs&&!p.length&&(S=!1),N)for(v=N.length;v--;)y=(k=N[v]).name,"{$uid}"===(A=k.value)&&(A="mce_"+z++),p.map[y]=A,p.push({name:y,value:A});if(R)for(v=R.length;v--;)(y=(k=R[v]).name)in p.map||("{$uid}"===(A=k.value)&&(A="mce_"+z++),p.map[y]=A,p.push({name:y,value:A}));if(_){for(v=_.length;v--&&!(_[v]in p.map););-1===v&&(S=!1)}if(k=p.map["data-mce-bogus"]){if("all"===k){M=Um(e,D,W.lastIndex),W.lastIndex=M;continue}S=!1}}S&&c(g,p,x)}else S=!1;if(h=Q[g]){h.lastIndex=M=m.index+tt.length,(m=h.exec(D))?(S&&(b=D.substr(M,m.index-M)),M=m.index+m[0].length):(b=D.substr(M),M=D.length),S&&(b.length>0&&F(b,!0),s(g)),W.lastIndex=M;continue}x||(T&&T.indexOf("/")===T.length-1?S&&s(g):B.push({name:g,valid:S}))}else if(g=m[1])V(g);else if(g=m[2]){if(!(1===I||t.preserve_cdata||B.length>0&&e.isValidChild(B[B.length-1].name,"#cdata"))){M=j("",m.index+2),W.lastIndex=M;continue}a(g)}else if(g=m[3])f(g);else{if((g=m[4])||"<!"===tt){M=j(g,m.index+tt.length),W.lastIndex=M;continue}if(g=m[5]){if(1!==I){M=j("?",m.index+2),W.lastIndex=M;continue}l(g,m[6])}}M=m.index+tt.length}for(M<D.length&&F(P(D.substr(M))),v=B.length-1;v>=0;v--)(g=B[v]).valid&&s(g.name)};return{parse:function(t,e){void 0===e&&(e="html"),d(function(t){for(var e,n=/data:[^;]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=Gu("img"),a=0,u=0;e=n.exec(t);){var c=e[0],s=i+"_"+u++;o[s]=c,a<e.index&&r.push(t.substr(a,e.index-a)),r.push(s),a=e.index+c.length}var l=new RegExp(i+"_[0-9]+","g");return 0===a?{prefix:i,uris:o,html:t,re:l}:(a<t.length&&r.push(t.substr(a)),{prefix:i,uris:o,html:r.join(""),re:l})}(t),e)}}};$m.findEndTag=Um;var Gm=function(t,e){for(var n,r=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,o=t.schema,i=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")}(t.getTempAttrs(),e),a=o.getShortEndedElements();n=r.exec(i);){var u=r.lastIndex,c=n[0].length,s=void 0;s=a[n[1]]?u:$m.findEndTag(o,i,u),i=i.substring(0,u-c)+i.substring(s),r.lastIndex=u-c}return So(i)},Km=Gm,Xm=function(t,e,n,r){var o,i=function(t,e){return Nt(Nt({},t),{format:e,get:!0,getInner:!0})}(e,n),a=e.no_events?i:t.fire("BeforeGetContent",i);return o="raw"===a.format?_e.trim(Km(t.serializer,r.innerHTML)):"text"===a.format?t.dom.isEmpty(r)?"":So(r.innerText||r.textContent):"tree"===a.format?t.serializer.serialize(r,a):function(t,e){var n=ns(t),r=new RegExp("^(<"+n+"[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,a)),j(["text","tree"],a.format)||yo(Ne.fromDom(r))?a.content=o:a.content=_e.trim(o),a.no_events?a.content:t.fire("GetContent",a).content},Ym=_e.each,Jm=function(t){return{compare:function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return Ym(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(wt(t,r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(wt(e,r))return!1;return!0};return!!o(r(e),r(n))&&(!!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))&&(!Yl(e)&&!Yl(n)))}}},Qm=_e.makeMap,Zm=function(t){var e=[],n=(t=t||{}).indent,r=Qm(t.indent_before||""),o=Qm(t.indent_after||""),i=yi.getEncodeFunc(t.entity_encoding||"raw",t.entities),a="html"===t.element_format;return{start:function(t,u,c){var s,l,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),u)for(s=0,l=u.length;s<l;s++)f=u[s],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!c||a?">":" />",c&&n&&o[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1]).length>0&&"\n"!==r&&e.push("\n")},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},tg=function(t,e){void 0===e&&(e=Ri());var n=Zm(t);(t=t||{}).validate=!("validate"in t)||t.validate;return{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{a(t)}while(t=t.next)}};n.reset();var a=function(t){var r=i[t.type];if(r)r(t);else{var u=t.name,c=t.shortEnded,s=t.attributes;if(o&&s&&s.length>1){var l=[];l.map={};var f=e.getElementRule(t.name);if(f){for(var d=0,m=f.attributesOrder.length;d<m;d++){if((h=f.attributesOrder[d])in s.map){var g=s.map[h];l.map[h]=g,l.push({name:h,value:g})}}for(d=0,m=s.length;d<m;d++){var h;if(!((h=s[d].name)in l.map)){g=s.map[h];l.map[h]=g,l.push({name:h,value:g})}}s=l}}if(n.start(t.name,s,c),!c){if(t=t.firstChild)do{a(t)}while(t=t.next);n.end(u)}}};return 1!==r.type||t.inner?i[11](r):a(r),n.getContent()}}},eg=new Set;q(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],(function(t){eg.add(t)}));var ng=["font","text-decoration","text-emphasis"],rg=function(t,e){return lt(t.parseStyle(t.getAttrib(e,"style")))},og=function(t,e){return et(rg(t,e),(function(t){return!function(t){return eg.has(t)}(t)}))},ig=function(t,e,n){var r=rg(t,e),o=rg(t,n),i=function(r){var o=t.getStyle(e,r),i=t.getStyle(n,r);return Ut(o)&&Ut(i)&&o!==i};return U(r,(function(t){var e=function(e){return U(e,(function(e){return e===t}))};if(!e(o)&&e(ng)){var n=K(o,(function(t){return U(ng,(function(e){return It(t,e)}))}));return U(n,i)}return i(t)}))},ag=function(t,e,n){return L.from(n.container()).filter(Hn).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},ug=_(ag,!0,Ql),cg=_(ag,!1,Ql),sg=function(t){var e=t.container();return Hn(e)&&(0===e.data.length||Co(e.data)&&Zf.isBookmarkNode(e.parentNode))},lg=function(t,e){return function(n){return L.from(el(t?0:-1,n)).filter(e).isSome()}},fg=function(t){return Wn(t)&&"block"===ir(Ne.fromDom(t),"display")},dg=function(t){return $n(t)&&!function(t){return An(t)&&"all"===t.getAttribute("data-mce-bogus")}(t)},mg=lg(!0,fg),gg=lg(!1,fg),hg=lg(!0,Kn),pg=lg(!1,Kn),vg=lg(!0,Pn),bg=lg(!1,Pn),yg=lg(!0,dg),wg=lg(!1,dg),xg=function(t){var e=Iu(t,"br"),n=K(function(t){for(var e=[],n=t.dom;n;)e.push(Ne.fromDom(n)),n=n.lastChild;return e}(t).slice(-1),mo);e.length===n.length&&q(n,vn)},Cg=function(t){pn(t),gn(t,Ne.fromHtml('<br data-mce-bogus="1">'))},Sg=function(t){en(t).each((function(e){Ke(e).each((function(n){lo(t)&&mo(e)&&lo(n)&&vn(e)}))}))},kg=function(t,e,n){return Pe(e,t)?function(t,e){for(var n=w(e)?e:D,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=Ne.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(t,(function(t){return n(t)||Be(t,e)})).slice(0,-1):[]},Tg=function(t,e){return kg(t,e,D)},Og=function(t,e){return[t].concat(Tg(t,e))},Eg=function(t,e,n){return Al(t,e,n,sg)},_g=function(t,e){return Q(Og(Ne.fromDom(e.container()),t),lo)},Rg=function(t,e,n){return Eg(t,e.dom,n).forall((function(t){return _g(e,n).fold((function(){return!1===tl(t,n,e.dom)}),(function(r){return!1===tl(t,n,e.dom)&&Pe(r,Ne.fromDom(t.container()))}))}))},Ng=function(t,e,n){return _g(e,n).fold((function(){return Eg(t,e.dom,n).forall((function(t){return!1===tl(t,n,e.dom)}))}),(function(e){return Eg(t,e.dom,n).isNone()}))},Ag=_(Ng,!1),Dg=_(Ng,!0),Mg=_(Rg,!1),Bg=_(Rg,!0),zg=function(t){return ll(t).exists(mo)},Pg=function(t,e,n){var r=K(Og(Ne.fromDom(n.container()),e),lo),o=at(r).getOr(e);return Rl(t,o.dom,n).filter(zg)},Lg=function(t,e){return ll(e).exists(mo)||Pg(!0,t,e).isSome()},Ig=function(t,e){return function(t){return L.from(t.getNode(!0)).map(Ne.fromDom)}(e).exists(mo)||Pg(!1,t,e).isSome()},Hg=_(Pg,!1),Fg=_(Pg,!0),Vg=function(t){return Rc.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},jg=function(t,e){var n=K(Og(Ne.fromDom(e.container()),t),lo);return at(n).getOr(t)},Ug=function(t,e){return Vg(e)?cg(e):cg(e)||Bl(jg(t,e).dom,e).exists(cg)},Wg=function(t,e){return Vg(e)?ug(e):ug(e)||Ml(jg(t,e).dom,e).exists(ug)},qg=function(t){return ll(t).bind((function(t){return Xr(t,Fe)})).exists((function(t){return function(t){return j(["pre","pre-wrap"],t)}(ir(t,"white-space"))}))},$g=function(t,e){return function(t,e){return Bl(t.dom,e).isNone()}(t,e)||function(t,e){return Ml(t.dom,e).isNone()}(t,e)||Ag(t,e)||Dg(t,e)||Ig(t,e)||Lg(t,e)},Gg=function(t,e){return!qg(e)&&(Ag(t,e)||Mg(t,e)||Ig(t,e)||Ug(t,e))},Kg=function(t,e){return!qg(e)&&(Dg(t,e)||Bg(t,e)||Lg(t,e)||Wg(t,e))},Xg=function(t,e){return Gg(t,e)||Kg(t,function(t){var e=t.container(),n=t.offset();return Hn(e)&&n<e.data.length?Rc(e,n+1):t}(e))},Yg=function(t,e){return Jl(t.charAt(e))},Jg=function(t){var e=t.container();return Hn(e)&&Lt(e.data,wo)},Qg=function(t){var e=t.data,n=function(t){var e=t.split("");return W(e,(function(t,n){return Jl(t)&&n>0&&n<e.length-1&&Zl(e[n-1])&&Zl(e[n+1])?" ":t})).join("")}(e);return n!==e&&(t.data=n,!0)},Zg=function(t,e){return L.some(e).filter(Jg).bind((function(e){var n=e.container();return function(t,e){var n=e.data,r=Rc(e,0);return!(!Yg(n,0)||Xg(t,r)||(e.data=" "+n.slice(1),0))}(t,n)||Qg(n)||function(t,e){var n=e.data,r=Rc(e,n.length-1);return!(!Yg(n,n.length-1)||Xg(t,r)||(e.data=n.slice(0,-1)+" ",0))}(t,n)?L.some(e):L.none()}))},th=function(t){var e=Ne.fromDom(t.getBody());t.selection.isCollapsed()&&Zg(e,Rc.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},eh=function(t,e,n){if(0!==n){var r=Ne.fromDom(t),o=Kr(r,lo).getOr(r),i=t.data.slice(e,e+n),a=e+n>=t.data.length&&Kg(o,Rc(t,t.data.length)),u=0===e&&Gg(o,Rc(t,0));t.replaceData(e,n,function(t,e,n){return Y(t,(function(r,o){return Ql(o)||Jl(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+wo}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(i,u,a))}},nh=function(t,e){var n=t.data.slice(e),r=n.length-Vt(n).length;eh(t,e,r)},rh=function(t,e){var n=t.data.slice(0,e),r=n.length-jt(n).length;eh(t,e-r,r)},oh=function(t,e,n,r){void 0===r&&(r=!0);var o=jt(t.data).length,i=r?t:e,a=r?e:t;return r?i.appendData(a.data):i.insertData(0,a.data),vn(Ne.fromDom(a)),n&&nh(i,o),i},ih=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===Rc.isTextPosition(t)&&n===e.parentNode&&r>Rc.before(e).offset()}(e,t)?Rc(e.container(),e.offset()-1):e},ah=function(t){return qo(t.previousSibling)?L.some((e=t.previousSibling,Hn(e)?Rc(e,e.data.length):Rc.after(e))):t.previousSibling?Pl(t.previousSibling):L.none();var e},uh=function(t){return qo(t.nextSibling)?L.some((e=t.nextSibling,Hn(e)?Rc(e,0):Rc.before(e))):t.nextSibling?zl(t.nextSibling):L.none();var e},ch=function(t,e){return ah(e).orThunk((function(){return uh(e)})).orThunk((function(){return function(t,e){var n=Rc.before(e.previousSibling?e.previousSibling:e.parentNode);return Bl(t,n).fold((function(){return Ml(t,Rc.after(e))}),L.some)}(t,e)}))},sh=function(t,e){return uh(e).orThunk((function(){return ah(e)})).orThunk((function(){return function(t,e){return Ml(t,Rc.after(e)).fold((function(){return Bl(t,Rc.before(e))}),L.some)}(t,e)}))},lh=function(t,e,n){return function(t,e,n){return t?sh(e,n):ch(e,n)}(t,e,n).map(_(ih,n))},fh=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},dh=function(t,e){return e&&wt(t.schema.getBlockElements(),Le(e))},mh=function(t){if(ei(t)){var e=Ne.fromHtml('<br data-mce-bogus="1">');return pn(t),gn(t,e),L.some(Rc.before(e.dom))}return L.none()},gh=function(t,e,n){var r,o,i,a,u=Ke(t).filter(Ve),c=Xe(t).filter(Ve);return vn(t),(r=u,o=c,i=e,a=function(t,e,r){var o=t.dom,i=e.dom,a=o.data.length;return oh(o,i,n),r.container()===i?Rc(o,a):r},r.isSome()&&o.isSome()&&i.isSome()?L.some(a(r.getOrDie(),o.getOrDie(),i.getOrDie())):L.none()).orThunk((function(){return n&&(u.each((function(t){return rh(t.dom,t.dom.length)})),c.each((function(t){return nh(t.dom,0)}))),e}))},hh=function(t,e,n,r){void 0===r&&(r=!0);var o,i=lh(e,t.getBody(),n.dom),a=Kr(n,_(dh,t),(o=t.getBody(),function(t){return t.dom===o})),u=gh(n,i,function(t,e){return wt(t.schema.getTextInlineElements(),Le(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):a.bind(mh).fold((function(){r&&fh(t,e,u)}),(function(n){r&&fh(t,e,L.some(n))}))},ph=function(t){return Iu(t,"td,th")},vh=function(t,e){return{start:t,end:e}},bh=Tr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),yh=function(t,e){return Zr(Ne.fromDom(t),"td,th",e)},wh=function(t){return!Be(t.start,t.end)},xh=function(t,e){return If(t.start,e).bind((function(n){return If(t.end,e).bind((function(t){return e=Be(n,t),r=n,e?L.some(r):L.none();var e,r}))}))},Ch=function(t){return function(e){return xh(e,t).map((function(t){return function(t,e,n){return{rng:t,table:e,cells:n}}(e,t,ph(t))}))}},Sh=function(t,e,n,r){if(n.collapsed||!t.forall(wh))return L.none();if(e.isSameTable){var o=t.bind(Ch(r));return L.some({start:o,end:o})}var i=yh(n.startContainer,r),a=yh(n.endContainer,r),u=i.bind(function(t){return function(e){return If(e,t).bind((function(t){return ut(ph(t)).map((function(t){return vh(e,t)}))}))}}(r)).bind(Ch(r)),c=a.bind(function(t){return function(e){return If(e,t).bind((function(t){return at(ph(t)).map((function(t){return vh(t,e)}))}))}}(r)).bind(Ch(r));return L.some({start:u,end:c})},kh=function(t,e){return Z(t,(function(t){return Be(t,e)}))},Th=function(t){return Yn(kh(t.cells,t.rng.start),kh(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))},Oh=function(t,e,n){return t.exists((function(t){return function(t,e){return!wh(t)&&xh(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&Vf(t.start,e)}))},Eh=function(t,e){var n=e.startTable,r=e.endTable,o=t.cloneRange();return n.each((function(t){return o.setStartAfter(t.dom)})),r.each((function(t){return o.setEndBefore(t.dom)})),o},_h=function(t,e){var n=function(t){return function(e){return Be(t,e)}}(t),r=function(t,e){var n=yh(t.startContainer,e),r=yh(t.endContainer,e);return Yn(n,r,vh)}(e,n),o=function(t,e){var n=function(t){return If(Ne.fromDom(t),e)},r=n(t.startContainer),o=n(t.endContainer),i=r.isSome(),a=o.isSome(),u=Yn(r,o,Be).getOr(!1);return{startTable:r,endTable:o,isStartInTable:i,isEndInTable:a,isSameTable:u,isMultiTable:!u&&i&&a}}(e,n);return Oh(r,e,n)?r.map((function(t){return bh.singleCellTable(e,t.start)})):o.isMultiTable?function(t,e,n,r){return Sh(t,e,n,r).bind((function(t){var r=t.start,o=t.end,i=r.bind(Th).getOr([]),a=o.bind(Th).getOr([]);if(i.length>0&&a.length>0){var u=Eh(n,e);return L.some(bh.multiTable(i,a,u))}return L.none()}))}(r,o,e,n):function(t,e,n,r){return Sh(t,e,n,r).bind((function(t){var e=t.start,n=t.end;return e.or(n)})).bind((function(t){var r=e.isSameTable,o=Th(t).getOr([]);if(r&&t.cells.length===o.length)return L.some(bh.fullTable(t.table));if(o.length>0){if(r)return L.some(bh.partialTable(o,L.none()));var i=Eh(n,e);return L.some(bh.partialTable(o,L.some(Nt(Nt({},e),{rng:i}))))}return L.none()}))}(r,o,e,n)},Rh=function(t){var e;return(8===Ie(e=t)||"#comment"===Le(e)?Ke(t):en(t)).bind(Rh).orThunk((function(){return L.some(t)}))},Nh=function(t){return q(t,(function(t){rr(t,"contenteditable"),Cg(t)}))},Ah=function(t,e,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(e.dom.lastChild)):(o.setStartBefore(e.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),zh(t,o,e,!1)},Dh=function(t){var e=Lf(t),n=Ne.fromDom(t.selection.getNode());Gn(n.dom)&&ei(n)?t.selection.setCursorLocation(n.dom,0):t.selection.collapse(!0),e.length>1&&U(e,(function(t){return Be(t,n)}))&&Zn(n,"data-mce-selected","1")},Mh=function(t,e,n){var r=t.selection.getRng(),o=n.bind((function(n){var o=n.rng,i=n.isStartInTable,a=function(t,e){return L.from(t.dom.getParent(e,t.dom.isBlock)).map(Ne.fromDom)}(t,i?o.endContainer:o.startContainer);o.deleteContents(),function(t,e,n){n.each((function(n){e?vn(n):(Cg(n),t.selection.setCursorLocation(n.dom,0))}))}(t,i,a.filter(ei));var u=i?e[0]:e[e.length-1];return Ah(t,u,r,i),ei(u)?L.none():L.some(i?e.slice(1):e.slice(0,-1))})).getOr(e);return Nh(o),Dh(t),!0},Bh=function(t,e,n,r){var o=t.selection.getRng(),i=e[0],a=n[n.length-1];Ah(t,i,o,!0),Ah(t,a,o,!1);var u=ei(i)?e:e.slice(1),c=ei(a)?n:n.slice(0,-1);return Nh(u.concat(c)),r.deleteContents(),Dh(t),!0},zh=function(t,e,n,r){void 0===r&&(r=!0),e.deleteContents();var o,i=Rh(n).getOr(n),a=Ne.fromDom(t.dom.getParent(i.dom,t.dom.isBlock));if(ei(a)&&(Cg(a),r&&t.selection.setCursorLocation(a.dom,0)),!Be(n,a)){var u=Xn(Ge(a),n)?[]:Ge(o=a).map(Qe).map((function(t){return K(t,(function(t){return!Be(o,t)}))})).getOr([]);q(u.concat(Qe(n)),(function(t){Be(t,a)||Pe(t,a)||!ei(t)||vn(t)}))}return!0},Ph=function(t,e){return hh(t,!1,e),!0},Lh=function(t,e,n,r){return Hh(e,r).fold((function(){return function(t,e,n){return _h(e,n).map((function(e){return e.fold(_(zh,t),_(Ph,t),_(Mh,t),_(Bh,t))}))}(t,e,n)}),(function(e){return function(t,e){return Fh(t,e)}(t,e)})).getOr(!1)},Ih=function(t,e){return Q(Og(e,t),bo)},Hh=function(t,e){return Q(Og(e,t),(n="caption",function(t){return Fe(t)&&Le(t)===n}));var n},Fh=function(t,e){return Cg(e),t.selection.setCursorLocation(e.dom,0),L.some(!0)},Vh=function(t,e,n,r,o){return Nl(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return zl(t.dom).bind((function(o){return Pl(t.dom).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(t,e){return Fh(t,e)}(t,r):function(t,e,n){return Hh(t,Ne.fromDom(n.getNode())).map((function(t){return!1===Be(t,e)}))}(e,r,i)})).or(L.some(!0))},jh=function(t,e,n,r){var o=Rc.fromRangeStart(t.selection.getRng());return Ih(n,r).bind((function(r){return ei(r)?Fh(t,r):function(t,e,n,r,o){return Nl(n,t.getBody(),o).bind((function(t){return Ih(e,Ne.fromDom(t.getNode())).map((function(t){return!1===Be(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)},Uh=function(t,e){return t?vg(e):bg(e)},Wh=function(t,e,n){var r=Ne.fromDom(t.getBody());return Hh(r,n).fold((function(){return jh(t,e,r,n)||function(t,e){var n=Rc.fromRangeStart(t.selection.getRng());return Uh(e,n)||Rl(e,t.getBody(),n).exists((function(t){return Uh(e,t)}))}(t,e)}),(function(n){return function(t,e,n,r){var o=Rc.fromRangeStart(t.selection.getRng());return ei(r)?Fh(t,r):Vh(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},qh=function(t,e){var n=Ne.fromDom(t.selection.getStart(!0)),r=Lf(t);return t.selection.isCollapsed()&&0===r.length?Wh(t,e,n):function(t,e,n){var r=Ne.fromDom(t.getBody()),o=t.selection.getRng();return 0!==n.length?Mh(t,n,L.none()):Lh(t,r,o,e)}(t,n,r)},$h=function(t){var e=Rc.fromRangeStart(t),n=Rc.fromRangeEnd(t),r=t.commonAncestorContainer;return Rl(!1,r,n).map((function(o){return!tl(e,n,r)&&tl(e,o,r)?function(t,e,n,r){var o=document.createRange();return o.setStart(t,e),o.setEnd(n,r),o}(e.container(),e.offset(),o.container(),o.offset()):t})).getOr(t)},Gh=function(t){return t.collapsed?t:$h(t)},Kh=function(t,e){return t.getBlockElements()[e.name]&&function(t){return t.firstChild&&t.firstChild===t.lastChild}(e)&&function(t){return"br"===t.name||t.value===wo}(e.firstChild)},Xh=function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||Kh(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r)&&("ul"===n.name||"ol"===n.name)},Yh=function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&function(t){return t.data===wo||Un(t)}(t.firstChild)},Jh=function(t){return t.length>0&&(!(e=t[t.length-1]).firstChild||Yh(e))?t.slice(0,-1):t;var e},Qh=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},Zh=function(t,e){var n=Rc.after(t),r=kl(e).prev(n);return r?r.toRange():null},tp=function(t,e,n){var r=t.parentNode;return _e.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=Rc.before(t),r=kl(e).next(n);return r?r.toRange():null}(t,n)},ep=function(t,e,n,r){var o,i=function(t,e,n){var r=e.serialize(n);return function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t}(t.createFragment(r))}(e,t,r),a=Qh(e,n.startContainer),u=Jh((o=i.firstChild,K(o.childNodes,(function(t){return"LI"===t.nodeName})))),c=e.getRoot(),s=function(t){var r=Rc.fromRangeStart(n),o=kl(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Qh(e,i.getNode())!==a};return s(1)?tp(a,u,c):s(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),Zh(e[0],n)}(a,u,c,e):function(t,e,n,r){var o=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]}(t,r),i=t.parentNode;return i.insertBefore(o[0],t),_e.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),Zh(e[e.length-1],n)}(a,u,c,n)},np=Gn,rp=function(t){var e=t.dom,n=Gh(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,np);!function(t,e,n){return null!==n&&n===t.getParent(e.endContainer,np)&&Vf(Ne.fromDom(n),e)}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):zh(t,n,Ne.fromDom(r))},op=function(t,e,n){var r,o,i,a=t.selection,u=t.dom;/^ | $/.test(e)&&(e=function(t,e,n){var r=Ne.fromDom(t.getRoot());return n=Gg(r,Rc.fromRangeStart(e))?n.replace(/^ /,"&nbsp;"):n.replace(/^&nbsp;/," "),Kg(r,Rc.fromRangeEnd(e))?n.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):n.replace(/&nbsp;(<br( \/)?>)?$/," ")}(u,a.getRng(),e));var c=t.parser,s=n.merge,l=tg({validate:ys(t)},t.schema),f='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>',d=t.fire("BeforeSetContent",{content:e,format:"html",selection:!0,paste:n.paste});if(d.isDefaultPrevented())t.fire("SetContent",{content:d.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=d.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,f);var m=(o=a.getRng()).startContainer||(o.parentElement?o.parentElement():null),g=t.getBody();m===g&&a.isCollapsed()&&u.isBlock(g.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,g.firstChild)&&u.isEmpty(g.firstChild)&&((o=u.createRng()).setStart(g.firstChild,0),o.setEnd(g.firstChild,0),a.setRng(o)),a.isCollapsed()||rp(t);var h,p={context:(r=a.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},v=c.parse(e,p);if(!0===n.paste&&Xh(t.schema,v)&&function(t,e){return!!Qh(t,e)}(u,r))return o=ep(l,u,a.getRng(),v),a.setRng(o),void t.fire("SetContent",d);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(v),"mce_marker"===(i=v.lastChild).attr("id")){var b=i;for(i=i.prev;i;i=i.walk(!0))if(3===i.type||!u.isBlock(i.name)){t.schema.isValidChild(i.parent.name,"span")&&i.parent.insert(b,i,"br"===i.name);break}}if(t._selectionOverrides.showBlockCaretContainer(r),p.invalid){t.selection.setContent(f),r=a.getNode();var w=t.getBody();for(9===r.nodeType?r=i=w:i=r;i!==w;)r=i,i=i.parentNode;e=r===w?w.innerHTML:u.getOuterHTML(r),e=l.serialize(c.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return l.serialize(v)})))),r===w?u.setHTML(w,e):u.setOuterHTML(r,e)}else!function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):t.selection.setContent(e)}}(t,e=l.serialize(v),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=Jm(r);_e.each(r.select("*[data-mce-fragment]"),(function(t){if(y(n[t.nodeName.toLowerCase()])&&og(r,t))for(var e=t.parentNode;y(e)&&e!==o&&!ig(r,t,e);e=e.parentNode)if(i.compare(e,t)){r.remove(t,!0);break}}))}}(t,s),function(t,e){var n,r=t.dom,o=t.selection;if(e){o.scrollIntoView(e);var i=td(t.getBody(),e);if("false"===r.getContentEditable(i))return r.remove(e),void o.select(i);var a=r.createRng(),u=e.previousSibling;if(Hn(u)){if(a.setStart(u,u.nodeValue.length),!Se.ie){var c=e.nextSibling;Hn(c)&&(u.appendData(c.data),c.parentNode.removeChild(c))}}else a.setStartBefore(e),a.setEndBefore(e);var s=r.getParent(e,r.isBlock);r.remove(e),s&&r.isEmpty(s)&&(t.$(s).empty(),a.setStart(s,0),a.setEnd(s,0),np(s)||function(t){return!!t.getAttribute("data-mce-fragment")}(s)||!(n=function(e){var n=Rc.fromRangeStart(e);if(n=kl(t.getBody()).next(n))return n.toRange()}(a))?r.add(s,r.create("br",{"data-mce-bogus":"1"})):(a=n,r.remove(s))),o.setRng(a)}}(t,u.get("mce_marker")),h=t.getBody(),_e.each(h.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){L.from(t.getParent(e,"td,th")).map(Ne.fromDom).each(Sg)}(u,a.getStart()),t.fire("SetContent",d),t.addVisual()}},ip=function(t,e){e(t),t.firstChild&&ip(t.firstChild,e),t.next&&ip(t.next,e)},ap=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var a in n.firstChild&&ip(n.firstChild,(function(n){q(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),q(e,(function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)wt(r,a)&&i.push(r[a]);for(var u in o)wt(o,u)&&i.push(o[u]);return i}(t,e,n);q(r,(function(t){q(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},up=function(t){return t instanceof Mm},cp=function(t,e,n){t.dom.setHTML(t.getBody(),e),!0!==n&&function(t){wm(t)&&zl(t.getBody()).each((function(e){var n=e.getNode(),r=Pn(n)?zl(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},sp=function(t,e,n){var r=function(t,e){return Nt(Nt({format:"html"},t),{set:!0,content:up(e)?"":e})}(n,e),o=n.no_events?r:t.fire("BeforeSetContent",r);return up(e)||(e=o.content),L.from(t.getBody()).fold(T(e),(function(n){return up(e)?function(t,e,n,r){ap(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=tg({validate:t.validate},t.schema).serialize(n);return r.content=yo(Ne.fromDom(e))?o:_e.trim(o),cp(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r),n}(t,n,e,o):function(t,e,n,r){if(0===n.length||/^\s+$/.test(n)){var o='<br data-mce-bogus="1">';"TABLE"===e.nodeName?n="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+o+"</li>");var i=ns(t);i&&t.schema.isValidChild(e.nodeName.toLowerCase(),i.toLowerCase())?(n=o,n=t.dom.createHTML(i,rs(t),n)):n||(n='<br data-mce-bogus="1">'),cp(t,n,r.no_selection),t.fire("SetContent",r)}else"raw"!==r.format&&(n=tg({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=yo(Ne.fromDom(e))?n:_e.trim(n),cp(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r);return r.content}(t,n,e,o)}))},lp=function(t,e){return function(t,e){var n=t.dom;return n.parentNode?Yr(Ne.fromDom(n.parentNode),(function(n){return!Be(t,n)&&e(n)})):L.none()}(t,e).isSome()},fp=function(t){return w(t)?t:D},dp=function(t,e,n){var r=e(t),o=fp(n);return r.orThunk((function(){return o(t)?L.none():function(t,e,n){for(var r=t.dom,o=fp(n);r.parentNode;){r=r.parentNode;var i=Ne.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return L.none()}(t,e,o)}))},mp=cf,gp=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(hf(i)&&!1===i.inherit&&t.dom.is(e,i.selector))return!0}return!1},hp=function(t,e,n,r,o){var i=t.dom.getRoot();return e!==i&&(e=t.dom.getParent(e,(function(e){return!!gp(t,e,n)||(e.parentNode===i||!!bp(t,e,n,r,!0))})),!!bp(t,e,n,r,o))},pp=function(t,e,n){return!!mp(e,n.inline)||(!!mp(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0))},vp=function(t,e,n,r,o,i){var a=n[r];if(w(n.onmatch))return n.onmatch(e,n,r);if(a)if(v(a.length)){for(var u in a)if(wt(a,u)){var c="attributes"===r?t.getAttrib(e,u):lf(t,e,u),s=uf(a[u],i),l=b(c)||Wt(c);if(l&&b(s))continue;if(o&&l&&!n.exact)return!1;if((!o||n.exact)&&!mp(c,sf(t,s,u)))return!1}}else for(var f=0;f<a.length;f++)if("attributes"===r?t.getAttrib(e,a[f]):lf(t,e,a[f]))return!0;return!0},bp=function(t,e,n,r,o){var i=t.formatter.get(n),a=t.dom;if(i&&e)for(var u=0;u<i.length;u++){var c=i[u];if(pp(t.dom,e,c)&&vp(a,e,c,"attributes",o,r)&&vp(a,e,c,"styles",o,r)){var s=c.classes;if(s)for(var l=0;l<s.length;l++)if(!t.dom.hasClass(e,uf(s[l],r)))return;return c}}},yp=function(t,e,n,r,o){if(r)return hp(t,r,e,n,o);if(r=t.selection.getNode(),hp(t,r,e,n,o))return!0;var i=t.selection.getStart();return!(i===r||!hp(t,i,e,n,o))},wp=function(t,e){var n=function(e){return Be(e,Ne.fromDom(t.getBody()))};return L.from(t.selection.getStart(!0)).bind((function(r){return dp(Ne.fromDom(r),(function(n){return st(e,(function(e){return function(e,n){return bp(t,e.dom,n)?L.some(n):L.none()}(n,e)}))}),n)})).getOrNull()},xp=function(t,e,n){return Y(n,(function(n,r){var o=function(t,e){return U(t.formatter.get(e),(function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return U(["styles","attributes"],(function(n){return yt(t,n).exists((function(t){var n=g(t)?t:bt(t);return U(n,e)}))}))}))}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},Cp=xo,Sp="_mce_caret",kp=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==Cp||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},Tp=function(t){if(t){var e=new uo(t,t);for(t=e.current();t;t=e.next())if(Hn(t))return t}return null},Op=function(t){var e=Ne.fromTag("span");return tr(e,{id:Sp,"data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&gn(e,Ne.fromText(Cp)),e},Ep=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(kp(e))hh(t,!1,Ne.fromDom(e),n);else{var i=o.getRng(),a=r.getParent(e,r.isBlock),u=i.startContainer,c=i.startOffset,s=i.endContainer,l=i.endOffset,f=function(t){var e=Tp(t);return e&&e.nodeValue.charAt(0)===Cp&&e.deleteData(0,1),e}(e);r.remove(e,!0),u===f&&c>0&&i.setStart(f,c-1),s===f&&l>0&&i.setEnd(f,l-1),a&&r.isEmpty(a)&&Cg(Ne.fromDom(a)),o.setRng(i)}},_p=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)Ep(t,e,n);else if(!(e=Hl(t.getBody(),o.getStart())))for(;e=r.get(Sp);)Ep(t,e,!1)},Rp=function(t,e){return t.appendChild(e),e},Np=function(t,e){var n=X(t,(function(t,e){return Rp(t,e.cloneNode(!1))}),e);return Rp(n,n.ownerDocument.createTextNode(Cp))},Ap=function(t,e,n,r){var o,i,a,u=t.dom,c=t.selection,s=[],l=c.getRng(),f=l.startContainer,d=l.startOffset;for(i=f,3===f.nodeType&&(d!==f.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(bp(t,i,e,n,r)){a=i;break}i.nextSibling&&(o=!0),s.push(i),i=i.parentNode}if(a)if(o){var m=c.getBookmark();l.collapse(!0);var g=Df(t,l,t.formatter.get(e),!0);g=xd(g),t.formatter.remove(e,n,g,r),c.moveToBookmark(m)}else{var h=Hl(t.getBody(),a),p=Op(!1).dom;!function(t,e,n){var r=t.dom,o=r.getParent(n,_(rf,t));o&&r.isEmpty(o)?n.parentNode.replaceChild(e,n):(xg(Ne.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(e,n):r.insertAfter(e,n))}(t,p,null!==h?h:a);var v=function(t,e,n,r,o,i){var a=t.formatter,u=t.dom,c=K(lt(a.get()),(function(t){return t!==r&&!Lt(t,"removeformat")})),s=xp(t,n,c);if(K(s,(function(e){return!mf(t,e,r)})).length>0){var l=n.cloneNode(!1);return u.add(e,l),a.remove(r,o,l,i),u.remove(l),L.some(l)}return L.none()}(t,p,a,e,n,r),b=Np(s.concat(v.toArray()),p);Ep(t,h,!1),c.setCursorLocation(b,1),u.isEmpty(a)&&u.remove(a)}},Dp=function(t){t.on("mouseup keydown",(function(e){!function(t,e){var n=t.selection,r=t.getBody();_p(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==Cp||_p(t,Hl(r,n.getStart())),37!==e&&39!==e||_p(t,Hl(r,n.getStart()))}(t,e.keyCode)}))},Mp=function(t,e){var n=t.schema.getTextInlineElements();return wt(n,Le(e))&&!Il(e.dom)&&!zn(e.dom)},Bp={},zp=Tt,Pp=St;!function(t,e){Bp[t]||(Bp[t]=[]),Bp[t].push(e)}("pre",(function(t){var e,n=t.selection.getRng(),r=Dn(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),Pp(zp(zp(e,r),(function(t){return r(t.previousSibling)&&-1!==Ot(e,t.previousSibling)})),(function(t){var e,n;e=t.previousSibling,su(n=t).remove(),su(e).append("<br><br>").append(n.childNodes)})))}));var Lp=_e.each,Ip=function(t){return An(t)&&!Yl(t)&&!Il(t)&&!zn(t)},Hp=function(t,e){for(var n=t;n;n=n[e]){if(Hn(n)&&Ut(n.data))return t;if(An(n)&&!Yl(n))return n}return t},Fp=function(t,e,n){var r=Jm(t);if(e&&n&&(e=Hp(e,"previousSibling"),n=Hp(n,"nextSibling"),r.compare(e,n))){for(var o=e.nextSibling;o&&o!==n;){var i=o;o=o.nextSibling,e.appendChild(i)}return t.remove(n),_e.each(_e.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},Vp=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=Fp(t,nf(r),r);Fp(t,o,nf(o,!0))}},jp=function(t,e,n){Lp(t.childNodes,(function(t){Ip(t)&&(e(t)&&n(t),t.hasChildNodes()&&jp(t,e,n))}))},Up=function(t,e){return function(n){return!(!n||!lf(t,n,e))}},Wp=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)}(t,r)}},qp=Tr([{keep:[]},{rename:["name"]},{removed:[]}]),$p=/^(src|href|style)$/,Gp=_e.each,Kp=cf,Xp=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Yp=function(t,e,n){var r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"];if(An(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return Hn(r)&&n&&o>=r.nodeValue.length&&(r=new uo(r,t.getBody()).next()||r),Hn(r)&&!n&&0===o&&(r=new uo(r,t.getBody()).prev()||r),r},Jp=function(t,e){var n=e?"firstChild":"lastChild";if(function(t){return/^(TR|TH|TD)$/.test(t.nodeName)}(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},Qp=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},Zp=function(t,e,n,r,o){var i=Ne.fromDom(e),a=Ne.fromDom(t.create(r,o)),u=n?Je(i):Ye(i);return hn(a,u),n?(fn(i,a),mn(a,i)):(dn(i,a),gn(a,i)),a.dom},tv=function(t,e,n,r){var o=nf(e,n,r);return b(o)||"BR"===o.nodeName||t.isBlock(o)},ev=function(t,e,n){var r,o=e.parentNode,i=t.dom,a=ns(t);gf(n)&&(a?o===i.getRoot()&&(n.list_block&&Kp(e,n.list_block)||q(ct(e.childNodes),(function(e){of(t,a,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=Qp(i,e,a),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=null}))):i.isBlock(e)&&!i.isBlock(o)&&(tv(i,e,!1)||tv(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),tv(i,e,!0)||tv(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),function(t){return hf(t)&&pf(t)&&Xn(yt(t,"mixed"),!0)}(n)&&!Kp(n.inline,e)||i.remove(e,!0)},nv=function(t,e,n,r,o){var i,a=t.dom;if(!function(t,e,n){return!(!pf(n)||!Kp(e,n.inline))||!(!gf(n)||!Kp(e,n.block))||(hf(n)?An(e)&&t.is(e,n.selector):void 0)}(a,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return qp.keep();var u=r;if(pf(e)&&"all"===e.remove&&g(e.preserve_attributes)){var c=K(a.getAttribs(u),(function(t){return j(e.preserve_attributes,t.name.toLowerCase())}));if(a.removeAllAttribs(u),q(c,(function(t){return a.setAttrib(u,t.name,t.value)})),c.length>0)return qp.rename("span")}if("all"!==e.remove){Gp(e.styles,(function(t,r){t=sf(a,uf(t,n),r+""),x(r)&&(r=t,o=null),(e.remove_similar||!o||Kp(lf(a,o,r),t))&&a.setStyle(u,r,""),i=!0})),i&&""===a.getAttrib(u,"style")&&(u.removeAttribute("style"),u.removeAttribute("data-mce-style")),Gp(e.attributes,(function(t,r){var i;if(t=uf(t,n),x(r)&&(r=t,o=null),e.remove_similar||!o||Kp(a.getAttrib(o,r),t)){if("class"===r&&(t=a.getAttrib(u,r))&&(i="",q(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))return void a.setAttrib(u,r,i);if($p.test(r)&&u.removeAttribute("data-mce-"+r),"style"===r&&Dn(["li"])(u)&&"none"===a.getStyle(u,"list-style-type"))return u.removeAttribute(r),void a.setStyle(u,"list-style-type","none");"class"===r&&u.removeAttribute("className"),u.removeAttribute(r)}})),Gp(e.classes,(function(t){t=uf(t,n),o&&!a.hasClass(o,t)||a.removeClass(u,t)}));for(var s=a.getAttribs(u),l=0;l<s.length;l++){var f=s[l].nodeName;if(0!==f.indexOf("_")&&0!==f.indexOf("data-"))return qp.keep()}}return"none"!==e.remove?(ev(t,u,e),qp.removed()):qp.keep()},rv=function(t,e,n,r,o){return nv(t,e,n,r,o).fold(D,(function(e){return t.dom.rename(r,e),!0}),M)},ov=function(t,e,n,r){return nv(t,e,n,r,r).fold(T(r),(function(e){return t.dom.createFragment().appendChild(r),t.dom.rename(r,e)}),T(null))},iv=function(t,e,n,r,o){var i=t.formatter.get(e),a=i[0],u=!0,c=t.dom,s=t.selection,l=function(r){var u=function(t,e,n,r,o){var i;return q(df(t.dom,e.parentNode).reverse(),(function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var a=bp(t,e,n,r,o);a&&!1!==a.split&&(i=e)}})),i}(t,r,e,n,o);return function(t,e,n,r,o,i,a,u){var c,s,l,f=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=f.clone(m,!1);for(var g=0;g<e.length&&null!==(c=ov(t,e[g],u,c));g++);c&&(s&&c.appendChild(s),l||(l=c),s=c)}!i||a.mixed&&f.isBlock(n)||(r=f.split(n,r)),s&&(o.parentNode.insertBefore(s,o),l.appendChild(o),pf(a)&&Vp(f,a,0,s))}return r}(t,i,u,r,r,!0,a,n)},f=function(e){return U(i,(function(r){return rv(t,r,n,e,e)}))},d=function(e){var n=!0,r=!1;An(e)&&c.getContentEditable(e)&&(n=u,u="true"===c.getContentEditable(e),r=!0);var o=ct(e.childNodes);if(u&&!r){var i=f(e),s=e.parentNode;!i&&y(s)&&vf(a)&&f(s)}if(a.deep&&o.length){for(var l=0;l<o.length;l++)d(o[l]);r&&(u=n)}q(["underline","line-through","overline"],(function(n){An(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&ff(c,e.parentNode)===n&&rv(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))},m=function(t){var e=c.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return function(t){return Yl(t)&&An(t)&&("_start"===t.id||"_end"===t.id)}(n)&&(n=n[t?"firstChild":"lastChild"]),Hn(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),c.remove(e,!0),n},g=function(e){var n,r,o=Df(t,e,i,e.collapsed);if(a.split){if(o=xd(o),(n=Yp(t,o,!0))!==(r=Yp(t,o))){if(n=Jp(n,!0),r=Jp(r,!1),Xp(c,n,r)){var u=L.from(n.firstChild).getOr(n);return l(Zp(c,u,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void m(!0)}if(Xp(c,r,n)){u=L.from(r.lastChild).getOr(r);return l(Zp(c,u,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void m(!1)}n=Qp(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=Qp(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),Mf(c,s,(function(t){q(t,(function(t){Yl(t)||Yl(t.parentNode)||l(t)}))})),l(n),l(r),n=m(!0),r=m()}else n=r=l(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1}Mf(c,o,(function(t){q(t,d)}))};if(r){if(tf(r)){var h=c.createRng();h.setStartBefore(r),h.setEndAfter(r),g(h)}else g(r);od(t,e,r,n)}else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&pf(a)&&!Lf(t).length?Ap(t,e,n,o):(qf(s,!0,(function(){Wf(t,g)})),pf(a)&&yp(t,e,n,s.getStart())&&ef(c,s,s.getRng()),t.nodeChanged()),od(t,e,r,n);else{r=s.getNode();for(var p=0;p<i.length&&(!i[p].ceFalseOverride||!rv(t,i[p],n,r,r));p++);od(t,e,r,n)}},av=_e.each,uv=function(t,e,n,r){av(e,(function(e){pf(e)&&av(t.dom.select(e.inline,r),(function(r){Ip(r)&&rv(t,e,n,r,e.exact?r:null)})),function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";Lp(t.select(r,n),(function(n){Ip(n)&&Lp(e.styles,(function(e,r){t.setStyle(n,r,"")}))}))}}(t.dom,e,r)}))},cv=_e.each,sv=function(t){return An(t)&&!Yl(t)&&!Il(t)&&!zn(t)},lv=function(t,e,n,r){var o=t.formatter.get(e),i=o[0],a=!r&&t.selection.isCollapsed(),u=t.dom,c=t.selection,s=function(t,e){if(void 0===e&&(e=i),w(e.onformat)&&e.onformat(t,e,n,r),cv(e.styles,(function(e,r){u.setStyle(t,r,uf(e,n))})),e.styles){var o=u.getAttrib(t,"style");o&&u.setAttrib(t,"data-mce-style",o)}cv(e.attributes,(function(e,r){u.setAttrib(t,r,uf(e,n))})),cv(e.classes,(function(e){e=uf(e,n),u.hasClass(t,e)||u.addClass(t,e)}))},l=function(t,e){var n=!1;return cv(t,(function(t){return!!hf(t)&&(y(t.collapsed)&&t.collapsed!==a?void 0:u.is(e,t.selector)&&!Il(e)?(s(e,t),n=!0,!1):void 0)})),n},f=function(t){if(d(t)){var e=u.create(t);return s(e),e}return null},m=function(r,a,u){var c=[],d=!0,m=i.inline||i.block,g=f(m);Mf(r,a,(function(a){var f,h=function(a){var p=!1,v=d,b=a.nodeName.toLowerCase(),w=a.parentNode,x=w.nodeName.toLowerCase();if(An(a)&&r.getContentEditable(a)&&(v=d,d="true"===r.getContentEditable(a),p=!0),Un(a)&&!function(t,e,n,r){if(function(t){return t.getParam("format_empty_lines",!1,"boolean")}(t)&&pf(e)){var o=Nt(Nt({},t.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=lp(Ne.fromDom(n),(function(t){return Il(t.dom)}));return xt(o,r)&&ei(Ne.fromDom(n.parentNode),!1)&&!i}return!1}(t,i,a,x))return f=null,void(gf(i)&&r.remove(a));if(gf(i)&&i.wrapper&&bp(t,a,e,n))f=null;else{if(d&&!p&&gf(i)&&!i.wrapper&&rf(t,b)&&of(t,x,m)){var C=r.rename(a,m);return s(C),c.push(C),void(f=null)}if(hf(i)){var S=l(o,a);if(!S&&y(w)&&vf(i)&&(S=l(o,w)),!pf(i)||S)return void(f=null)}!d||p||!of(t,m,b)||!of(t,x,m)||!u&&Hn(a)&&Co(a.data)||Il(a)||pf(i)&&r.isBlock(a)?(f=null,q(ct(a.childNodes),h),p&&(d=v),f=null):(f||(f=r.clone(g,!1),a.parentNode.insertBefore(f,a),c.push(f)),f.appendChild(a))}};q(a,h)})),!0===i.links&&q(c,(function(t){var e=function(t){"A"===t.nodeName&&s(t,i),q(ct(t.childNodes),e)};e(t)})),q(c,(function(a){var u=function(t){var e=0;return q(t.childNodes,(function(t){(function(t){return y(t)&&Hn(t)&&0===t.length})(t)||Yl(t)||e++})),e}(a);!(c.length>1)&&r.isBlock(a)||0!==u?(pf(i)||gf(i)&&i.wrapper)&&(i.exact||1!==u||(a=function(t){return Q(t.childNodes,sv).filter((function(t){return pp(r,t,i)})).map((function(e){var n=r.clone(e,!1);return s(n),r.replace(n,t,!0),r.remove(e,!0),n})).getOr(t)}(a)),uv(t,o,n,a),function(t,e,n,r,o){bp(t,o.parentNode,n,r)&&rv(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(bp(t,i,n,r))return rv(t,e,r,o),!0}))}(t,i,e,n,a),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&jp(r,Up(t,"fontSize"),Wp(t,"backgroundColor",uf(e.styles.backgroundColor,n)))}(r,i,n,a),function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=ff(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(_e.walk(r,o,"childNodes"),o(r))}(r,i,0,a),function(t,e,n,r){!pf(e)||"sub"!==e.inline&&"sup"!==e.inline||(jp(r,Up(t,"fontSize"),Wp(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(r,i,0,a),Vp(r,i,0,a)):r.remove(a,!0)}))};if("false"!==u.getContentEditable(c.getNode())){if(i){if(r)if(tf(r)){if(!l(o,r)){var g=u.createRng();g.setStartBefore(r),g.setEndAfter(r),m(u,Df(t,g,o),!0)}}else m(u,r,!0);else if(a&&pf(i)&&!Lf(t).length)!function(t,e,n){var r,o,i=t.selection,a=i.getRng(),u=a.startOffset,c=a.startContainer.nodeValue;(r=Hl(t.getBody(),i.getStart()))&&(o=Tp(r));var s,l,f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&u>0&&u<c.length&&f.test(c.charAt(u))&&f.test(c.charAt(u-1))){var d=i.getBookmark();a.collapse(!0);var m=Df(t,a,t.formatter.get(e));m=xd(m),t.formatter.apply(e,n,m),i.moveToBookmark(d)}else r&&o.nodeValue===Cp||(s=t.getDoc(),l=Op(!0).dom,o=(r=s.importNode(l,!0)).firstChild,a.insertNode(r),u=1),t.formatter.apply(e,n,r),i.setCursorLocation(o,u)}(t,e,n);else{var h=c.getNode(),p=o[0];t.settings.forced_root_block||!p.defaultBlock||u.getParent(h,u.isBlock)||lv(t,p.defaultBlock),c.setRng(Gh(c.getRng())),qf(c,!0,(function(){Wf(t,(function(e,n){var r=n?e:Df(t,e,o);m(u,r,!1)}))})),ef(u,c,c.getRng()),t.nodeChanged()}!function(t,e){Pp(Bp[t],(function(t){t(e)}))}(e,t)}rd(t,e,r,n)}else{r=c.getNode();for(var v=0,b=o.length;v<b;v++){var x=o[v];if(x.ceFalseOverride&&hf(x)&&u.is(r,x.selector)){s(r,x);break}}rd(t,e,r,n)}},fv=function(t){return wt(t,"vars")},dv=function(t){return t.selection.getStart()},mv=function(t,e,n,r,o){return J(e,(function(e){var i=t.formatter.matchNode(e,n,null!=o?o:{},r);return!v(i)}),(function(e){return!!gp(t,e,n)||!r&&y(t.formatter.matchNode(e,n,o,!0))}))},gv=function(t,e){var n=null!=e?e:dv(t);return K(df(t.dom,n),(function(t){return An(t)&&!zn(t)}))},hv=function(t,e,n){var r=gv(t,e);dt(n,(function(n,o){var i=function(n){var i=mv(t,r,o,n.similar,fv(n)?n.vars:void 0),a=i.isSome();if(n.state.get()!==a){n.state.set(a);var u=i.getOr(e);fv(n)?n.callback(a,{node:u,format:o,parents:r}):q(n.callbacks,(function(t){return t(a,{node:u,format:o,parents:r})}))}};q([n.withSimilar,n.withoutSimilar],i),q(n.withVars,i)}))},pv=function(t,e,n,r,o,i){return null===e.get()&&function(t,e){t.set({}),e.on("NodeChange",(function(n){hv(e,n.element,t.get())})),e.on("FormatApply FormatRemove",(function(n){var r=L.from(n.node).map((function(t){return tf(t)?t:t.startContainer})).bind((function(t){return An(t)?L.some(t):L.from(t.parentElement)})).getOrThunk((function(){return dv(e)}));hv(e,r,t.get())}))}(e,t),function(t,e,n,r,o,i){var a=e.get();q(n.split(","),(function(e){var n=yt(a,e).getOrThunk((function(){var t={withSimilar:{state:xu(!1),similar:!0,callbacks:[]},withoutSimilar:{state:xu(!1),similar:!1,callbacks:[]},withVars:[]};return a[e]=t,t})),u=function(){var n=gv(t);return mv(t,n,e,o,i).isSome()};if(v(i)){var c=o?n.withSimilar:n.withoutSimilar;c.callbacks.push(r),1===c.callbacks.length&&c.state.set(u())}else n.withVars.push({state:xu(u()),similar:o,vars:i,callback:r})})),e.set(a)}(t,e,n,r,o,i),{unbind:function(){return function(t,e,n){var r=t.get();q(e.split(","),(function(t){return yt(r,t).each((function(e){r[t]={withSimilar:Nt(Nt({},e.withSimilar),{callbacks:K(e.withSimilar.callbacks,(function(t){return t!==n}))}),withoutSimilar:Nt(Nt({},e.withoutSimilar),{callbacks:K(e.withoutSimilar.callbacks,(function(t){return t!==n}))}),withVars:K(e.withVars,(function(t){return t.callback!==n}))}}))})),t.set(r)}(e,n,r)}}},vv=function(t,e){var n=(e||document).createDocumentFragment();return q(t,(function(t){n.appendChild(t.dom)})),Ne.fromDom(n)},bv=function(t,e,n){return{element:t,width:e,rows:n}},yv=function(t,e){return{element:t,cells:e}},wv=function(t,e){return{x:t,y:e}},xv=function(t,e){var n=parseInt(er(t,e),10);return isNaN(n)?1:n},Cv=function(t,e,n){var r=t.rows;return!!(r[n]?r[n].cells:[])[e]},Sv=function(t){return Y(t,(function(t,e){return e.cells.length>t?e.cells.length:t}),0)},kv=function(t,e){for(var n=t.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Be(o[i],e))return L.some(wv(i,r));return L.none()},Tv=function(t,e,n,r,o){for(var i=[],a=t.rows,u=n;u<=o;u++){var c=a[u].cells,s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(yv(a[u].element,s))}return i},Ov=function(t){var e=bv(Yu(t),0,[]);return q(Iu(t,"tr"),(function(t,n){q(Iu(t,"td,th"),(function(r,o){!function(t,e,n,r,o){for(var i=xv(o,"rowspan"),a=xv(o,"colspan"),u=t.rows,c=n;c<n+i;c++){u[c]||(u[c]=yv(Ju(r),[]));for(var s=e;s<e+a;s++)u[c].cells[s]=c===n&&s===e?o:Yu(o)}}(e,function(t,e,n){for(;Cv(t,e,n);)e++;return e}(e,o,n),n,t,r)}))})),bv(e.element,Sv(e.rows),e.rows)},Ev=function(t){return function(t,e){var n=Yu(t.element),r=Ne.fromTag("tbody");return hn(r,e),gn(n,r),n}(t,function(t){return W(t.rows,(function(t){var e=W(t.cells,(function(t){var e=Ju(t);return rr(e,"colspan"),rr(e,"rowspan"),e})),n=Yu(t.element);return hn(n,e),n}))}(t))},_v=function(t,e,n){return kv(t,e).bind((function(e){return kv(t,n).map((function(n){return function(t,e,n){var r=e.x,o=e.y,i=n.x,a=n.y,u=o<a?Tv(t,r,o,i,a):Tv(t,r,a,i,o);return bv(t.element,Sv(u),u)}(t,e,n)}))}))},Rv=function(t,e){return Q(t,(function(t){return"li"===Le(t)&&Vf(t,e)})).fold(T([]),(function(e){return function(t){return Q(t,(function(t){return"ul"===Le(t)||"ol"===Le(t)}))}(t).map((function(t){var e=Ne.fromTag(Le(t)),n=vt(cr(t),(function(t,e){return It(e,"list-style")}));return or(e,n),[Ne.fromTag("li"),e]})).getOr([])}))},Nv=function(t,e){var n=Ne.fromDom(e.commonAncestorContainer),r=Og(n,t),o=K(r,(function(t){return fo(t)||so(t)})),i=Rv(r,e),a=o.concat(i.length?i:function(t){return po(t)?Ge(t).filter(ho).fold(T([]),(function(e){return[t,e]})):ho(t)?[t]:[]}(n));return W(a,Yu)},Av=function(){return vv([])},Dv=function(t,e){return n=Ne.fromDom(e.cloneContents()),r=Nv(t,e),o=Y(r,(function(t,e){return gn(e,t),e}),n),r.length>0?vv([o]):o;var n,r,o},Mv=function(t,e){return(n=t,r=e[0],Jr(r,"table",_(Be,n))).bind((function(t){var n=e[0],r=e[e.length-1],o=Ov(t);return _v(o,n,r).map((function(t){return vv([Ev(t)])}))})).getOrThunk(Av);var n,r},Bv=function(t,e){var n=Pf(e,t);return n.length>0?Mv(t,n):function(t,e){return e.length>0&&e[0].collapsed?Av():Dv(t,e[0])}(t,e)},zv=function(t,e){return e>=0&&e<t.length&&Ql(t.charAt(e))},Pv=function(t,e){var n=So(t.innerText);return e?function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},Lv=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return Nt(Nt({},t),{format:e,get:!0,selection:!0})}(n,e),o=t.fire("BeforeGetContent",r);if(o.isDefaultPrevented())return t.fire("GetContent",o),o.content;if("text"===o.format)return function(t){return L.from(t.selection.getRng()).map((function(e){var n=L.from(t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock)),r=t.getBody(),o=function(t){return t.map((function(t){return t.nodeName})).getOr("div").toLowerCase()}(n),i=Se.browser.isIE()&&"pre"!==o,a=t.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),u=Pv(a,i),c=So(a.textContent);if(t.dom.remove(a),zv(c,0)||zv(c,c.length-1)){var s=n.getOr(r),l=Pv(s,i),f=l.indexOf(u);return-1===f?u:(zv(l,f-1)?" ":"")+u+(zv(l,f+u.length)?" ":"")}return u})).getOr("")}(t);o.getInner=!0;var i=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=_m(t,Bf(o)),a=e.contextual?Bv(Ne.fromDom(t.getBody()),i).dom:n.cloneContents();return a&&r.appendChild(a),t.selection.serializer.serialize(r,e)}(t,o);return"tree"===o.format?i:(o.content=t.selection.isCollapsed()?"":i,t.fire("GetContent",o),o.content)},Iv=function(t){return An(t)?t.outerHTML:Hn(t)?yi.encodeRaw(t.data,!1):Fn(t)?"\x3c!--"+t.data+"--\x3e":""},Hv=function(t,e,n){var r=function(t){var e,n=document.createElement("div"),r=document.createDocumentFragment();for(t&&(n.innerHTML=t);e=n.firstChild;)r.appendChild(e);return r}(e);if(t.hasChildNodes()&&n<t.childNodes.length){var o=t.childNodes[n];o.parentNode.insertBefore(r,o)}else t.appendChild(r)},Fv=function(t,e){var n,r,o,i,a,u,c,s,l,f=W(ct(e.childNodes),Iv);return function(t,e){var n=0;q(t,(function(t){0===t[0]?n++:1===t[0]?(Hv(e,t[1],n),n++):2===t[0]&&function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}}(e,n)}))}((r=t,o=(n=f).length+r.length+2,i=new Array(o),a=new Array(o),u=function(t,e,o,i,a){var c=s(t,e,o,i);if(null===c||c.start===e&&c.diag===e-i||c.end===t&&c.diag===t-o)for(var l=t,f=o;l<e||f<i;)l<e&&f<i&&n[l]===r[f]?(a.push([0,n[l]]),++l,++f):e-t>i-o?(a.push([2,n[l]]),++l):(a.push([1,r[f]]),++f);else{u(t,c.start,o,c.start-c.diag,a);for(var d=c.start;d<c.end;++d)a.push([0,n[d]]);u(c.end,e,c.end-c.diag,i,a)}},c=function(t,e,o,i){for(var a=t;a-e<i&&a<o&&n[a]===r[a-e];)++a;return function(t,e,n){return{start:t,end:e,diag:n}}(t,a,e)},s=function(t,e,o,u){var s=e-t,l=u-o;if(0===s||0===l)return null;var f,d,m,g,h,p=s-l,v=l+s,b=(v%2==0?v:v+1)/2;for(i[1+b]=t,a[1+b]=e+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){for(m=d+b,d===-f||d!==f&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,h=(g=i[m])-t+o-d;g<e&&h<u&&n[g]===r[h];)i[m]=++g,++h;if(p%2!=0&&p-f<=d&&d<=p+f&&a[m-p]<=i[m])return c(a[m-p],d+t-o,e,u)}for(d=p-f;d<=p+f;d+=2){for(m=d+b-p,d===p-f||d!==p+f&&a[m+1]<=a[m-1]?a[m]=a[m+1]-1:a[m]=a[m-1],h=(g=a[m]-1)-t+o-d;g>=t&&h>=o&&n[g]===r[h];)a[m]=g--,h--;if(p%2==0&&-f<=d&&d<=f&&a[m]<=i[m+p])return c(a[m],d+t-o,e,u)}}},l=[],u(0,n.length,0,r.length,l),l),e),e},Vv=Dt((function(){return document.implementation.createHTMLDocument("undo")})),jv=function(t){var e,n=(e=t.getBody(),K(W(ct(e.childNodes),Iv),(function(t){return t.length>0}))),r=tt(n,(function(e){var n=Gm(t.serializer,e);return n.length>0?[n]:[]})),o=r.join("");return-1!==o.indexOf("</iframe>")?function(t){return{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}}(r):function(t){return{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}}(o)},Uv=function(t,e,n){var r=n?e.beforeBookmark:e.bookmark;"fragmented"===e.type?Fv(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw",no_selection:!y(r)||!Fl(r)||!r.isFakeCaret}),t.selection.moveToBookmark(r)},Wv=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},qv=function(t){var e=Ne.fromTag("body",Vv());return Ku(e,Wv(t)),q(Iu(e,"*[data-mce-bogus]"),bn),e.dom.innerHTML},$v=function(t,e){return!(!t||!e)&&(!!function(t,e){return Wv(t)===Wv(e)}(t,e)||function(t,e){return qv(t)===qv(e)}(t,e))},Gv=function(t){return 0===t.get()},Kv=function(t,e,n){Gv(n)&&(t.typing=e)},Xv=function(t,e){t.typing&&(Kv(t,!1,e),t.add())},Yv=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){Gv(e)&&n.set(Qc(t.selection))}(t,e,n)},add:function(e,n,r,o,i,a){return function(t,e,n,r,o,i,a){var u=jv(t);if(i=i||{},i=_e.extend(i,u),!1===Gv(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:a}).isDefaultPrevented())return null;if(c&&$v(c,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var s=function(t){return t.getParam("custom_undo_redo_levels",0,"number")}(t);if(s&&e.data.length>s){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=Qc(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:c,originalEvent:a};return n.get()>0?(t.setDirty(!0),t.fire("AddUndo",f),t.fire("change",f)):t.fire("AddUndo",f),i}(t,e,n,r,o,i,a)},undo:function(e,n,r){return function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,Kv(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],Uv(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o}(t,e,n,r)},redo:function(e,n){return function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],Uv(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r}(t,e,n)},clear:function(e,n){return function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")}(t,e,n)},reset:function(t){return function(t){t.clear(),t.add()}(t)},hasUndo:function(e,n){return function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!$v(jv(t),e.data[0])}(t,e,n)},hasRedo:function(t,e){return function(t,e){return e.get()<t.data.length-1&&!t.typing}(t,e)},transact:function(t,e,n){return function(t,e,n){return Xv(t,e),t.beforeChange(),t.ignore(n),t.add()}(t,e,n)},ignore:function(t,e){return function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}}(t,e)},extra:function(e,n,r,o){return function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,a=e.data[n.get()-1];Uv(t,a,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}}(t,e,n,r,o)}},formatter:{match:function(e,n,r,o){return yp(t,e,n,r,o)},matchAll:function(e,n){return function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,(function(i){for(var a=0;a<e.length;a++){var u=e[a];!o[u]&&bp(t,i,u,n)&&(o[u]=!0,r.push(u))}}),t.dom.getRoot()),r}(t,e,n)},matchNode:function(e,n,r,o){return bp(t,e,n,r,o)},canApply:function(e){return function(t,e){var n=t.formatter.get(e),r=t.dom;if(n)for(var o=t.selection.getStart(),i=df(r,o),a=n.length-1;a>=0;a--){var u=n[a];if(!hf(u)||y(u.defaultBlock))return!0;for(var c=i.length-1;c>=0;c--)if(r.is(i[c],u.selector))return!0}return!1}(t,e)},closest:function(e){return wp(t,e)},apply:function(e,n,r){return lv(t,e,n,r)},remove:function(e,n,r,o){return iv(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!yp(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?lv(t,e,n,r):iv(t,e,n,r)}(t,e,n,r)},formatChanged:function(e,n,r,o,i){return pv(t,e,n,r,o,i)}},editor:{getContent:function(e,n){return function(t,e,n){return L.from(t.getBody()).fold(T("tree"===e.format?new Mm("body",11):""),(function(r){return Xm(t,e,n,r)}))}(t,e,n)},setContent:function(e,n){return sp(t,e,n)},insertContent:function(e,n){return op(t,e,n)},addVisual:function(e){return function(t,e){var n=t.dom,r=y(e)?e:t.getBody();v(t.hasVisual)&&(t.hasVisual=function(t){return t.getParam("visual",!0,"boolean")}(t)),q(n.select("table,a",r),(function(e){switch(e.nodeName){case"TABLE":var r=function(t){return t.getParam("visual_table_class","mce-item-table","string")}(t),o=n.getAttrib(e,"border");o&&"0"!==o||!t.hasVisual?n.removeClass(e,r):n.addClass(e,r);break;case"A":if(!n.getAttrib(e,"href")){var i=n.getAttrib(e,"name")||e.id,a=function(t){return t.getParam("visual_anchor_class","mce-item-anchor","string")}(t);i&&t.hasVisual?n.addClass(e,a):n.removeClass(e,a)}}})),t.fire("VisualAid",{element:e,hasVisual:t.hasVisual})}(t,e)}},selection:{getContent:function(e,n){return Lv(t,e,n)}},raw:{getModel:function(){return L.none()}}}},Jv=function(t){return wt(t.plugins,"rtc")},Qv=function(t){var e=t;return function(t){return yt(t.plugins,"rtc").bind((function(t){return L.from(t.setup)}))}(t).fold((function(){return e.rtcInstance=Yv(t),L.none()}),(function(t){return e.rtcInstance=function(){var t=T(null),e=T("");return{undoManager:{beforeChange:C,add:t,undo:t,redo:t,clear:C,reset:C,hasUndo:D,hasRedo:D,transact:t,ignore:C,extra:C},formatter:{match:D,matchAll:T([]),matchNode:T(void 0),canApply:D,closest:e,apply:C,remove:C,toggle:C,formatChanged:T({unbind:C})},editor:{getContent:e,setContent:e,insertContent:C,addVisual:C},selection:{getContent:e},raw:{getModel:T(L.none())}}}(),L.some((function(){return t().then((function(t){return e.rtcInstance=function(t){var e=function(t){return m(t)?t:{}},n=t.undoManager,r=t.formatter,o=t.editor,i=t.selection,a=t.raw;return{undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:function(t,e,r){return n.transact(r)},ignore:function(t,e){return n.ignore(e)},extra:function(t,e,r,o){return n.extra(r,o)}},formatter:{match:function(t,n,o,i){return r.match(t,e(n),i)},matchAll:r.matchAll,matchNode:r.matchNode,canApply:function(t){return r.canApply(t)},closest:function(t){return r.closest(t)},apply:function(t,n,o){return r.apply(t,e(n))},remove:function(t,n,o,i){return r.remove(t,e(n))},toggle:function(t,n,o){return r.toggle(t,e(n))},formatChanged:function(t,e,n,o,i){return r.formatChanged(e,n,o,i)}},editor:{getContent:function(t,e){return o.getContent(t)},setContent:function(t,e){return o.setContent(t,e)},insertContent:function(t,e){return o.insertContent(t)},addVisual:o.addVisual},selection:{getContent:function(t,e){return i.getContent(e)}},raw:{getModel:function(){return L.some(a.getRawModel())}}}}(t),t.rtc.isRemote}))}))}))},Zv=function(t){return t.rtcInstance?t.rtcInstance:Yv(t)},tb=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},eb=function(t,e){return void 0===e&&(e={}),function(t,e,n){return tb(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)},nb=function(t){return 0===t.dom.length?(vn(t),L.none()):L.some(t)},rb=function(t,e,n,r){t.bind((function(t){return(r?rh:nh)(t.dom,r?t.dom.length:0),e.filter(Ve).map((function(e){return function(t,e,n,r){var o=t.dom,i=e.dom,a=r?o.length:i.length;r?(oh(o,i,!1,!r),n.setStart(i,a)):(oh(i,o,!1,!r),n.setEnd(i,a))}(t,e,n,r)}))})).orThunk((function(){return function(t,e){return t.filter((function(t){return Zf.isBookmarkNode(t.dom)})).bind(e?Xe:Ke)}(e,r).or(e).filter(Ve).map((function(t){return function(t,e){Ge(t).each((function(n){var r=t.dom;e&&Gg(n,Rc(r,0))?nh(r,0):!e&&Kg(n,Rc(r,r.length))&&rh(r,r.length)}))}(t,r)}))}))},ob=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return Nt(Nt({format:"html"},t),{set:!0,selection:!0,content:e})}(n,e),o=r;if(!r.no_events){var i=t.fire("BeforeSetContent",r);if(i.isDefaultPrevented())return void t.fire("SetContent",i);o=i}o.content=function(t,e){if("raw"!==e.format){var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,Nt(Nt({isRootContent:!0,forced_root_block:!1},o),e));return tg({validate:t.validate},t.schema).serialize(i)}return e.content}(t,o);var a=t.selection.getRng();!function(t,e){var n=L.from(e.firstChild).map(Ne.fromDom),r=L.from(e.lastChild).map(Ne.fromDom);t.deleteContents(),t.insertNode(e);var o=n.bind(Ke).filter(Ve).bind(nb),i=r.bind(Xe).filter(Ve).bind(nb);rb(o,n,t,!0),rb(i,r,t,!1),t.collapse(!1)}(a,a.createContextualFragment(o.content)),t.selection.setRng(a),Wd(t,a),o.no_events||t.fire("SetContent",o)},ib=function(t,e,n){if(t&&wt(t,e)){var r=K(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}};var ab,ub,cb=function(t){return!!t.select},sb=function(t){return!(!t||!t.ownerDocument)&&Pe(Ne.fromDom(t.ownerDocument),Ne.fromDom(t))},lb=function(t,e,n,r){var o,i,a=function(t,e){var n,r,o=function(e,n){return Q(n,(function(n){return t.is(n,e)}))},i=function(e){return t.getParents(e,null,t.getRoot())};return{selectorChangedWithUnbind:function(t,a){return n||(n={},r={},e.on("NodeChange",(function(t){var e=t.element,a=i(e),u={};_e.each(n,(function(t,e){o(e,a).each((function(n){r[e]||(q(t,(function(t){t(!0,{node:n,selector:e,parents:a})})),r[e]=t),u[e]=t}))})),_e.each(r,(function(t,n){u[n]||(delete r[n],_e.each(t,(function(t){t(!1,{node:e,selector:n,parents:a})})))}))}))),n[t]||(n[t]=[]),n[t].push(a),o(t,i(e.selection.getStart())).each((function(){r[t]=n[t]})),{unbind:function(){ib(n,t,a),ib(r,t,a)}}}}}(t,r).selectorChangedWithUnbind,u=function(t,e){return ob(r,t,e)},c=function(t){var e=l();e.collapse(!!t),f(e)},s=function(){return e.getSelection?e.getSelection():e.document.selection},l=function(){var n,a,u,c=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}},l=e.document;if(void 0!==r.bookmark&&!1===wm(r)){var f=cm(r);if(f.isSome())return f.map((function(t){return _m(r,[t])[0]})).getOr(l.createRange())}try{(n=s())&&!Nn(n.anchorNode)&&(a=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():l.createRange(),a=_m(r,[a])[0])}catch(t){}return a||(a=l.createRange?l.createRange():l.body.createTextRange()),a.setStart&&9===a.startContainer.nodeType&&a.collapsed&&(u=t.getRoot(),a.setStart(u,0),a.setEnd(u,0)),o&&i&&(0===c(a.START_TO_START,a,o)&&0===c(a.END_TO_END,a,o)?a=i:(o=null,i=null)),a},f=function(t,e){var n;if(function(t){return!!t&&(!!cb(t)||sb(t.startContainer)&&sb(t.endContainer))}(t)){var a=cb(t)?t:null;if(a){i=null;try{a.select()}catch(t){}}else{var u=s();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,u){i=t;try{u.removeAllRanges(),u.addRange(t)}catch(t){}!1===e&&u.extend&&(u.collapse(t.endContainer,t.endOffset),u.extend(t.startContainer,t.startOffset)),o=u.rangeCount>0?u.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!u.setBaseAndExtent||Se.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(u.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),u.anchorNode===t.startContainer&&u.focusNode===t.endContainer||u.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},d=function(){var e=s(),n=null==e?void 0:e.anchorNode,r=null==e?void 0:e.focusNode;if(!e||!n||!r||Nn(n)||Nn(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},m={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:c,setCursorLocation:function(e,n){var o=t.createRng();y(e)&&y(n)?(o.setStart(e,n),o.setEnd(e,n),f(o),c(!1)):(jf(t,o,r.getBody(),!0),f(o))},getContent:function(t){return eb(r,t)},setContent:u,getBookmark:function(t,e){return g.getBookmark(t,e)},moveToBookmark:function(t){return g.moveToBookmark(t)},select:function(e,n){return function(t,e,n){return L.from(e).map((function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(jf(t,o,e,!0),jf(t,o,e,!1)),o}))}(t,e,n).each(f),e},isCollapsed:function(){var t=l(),e=s();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:d,setNode:function(e){return u(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,a=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Em(r.nextSibling,!0):r.parentNode,o=0===a?Em(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),l())},getSel:s,setRng:f,getRng:l,getStart:function(t){return Tm(r.getBody(),l(),t)},getEnd:function(t){return Om(r.getBody(),l(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],a=t.getRoot();if(n=t.getParent(n||Tm(a,e,e.collapsed),t.isBlock),r=t.getParent(r||Om(a,e,e.collapsed),t.isBlock),n&&n!==a&&i.push(n),n&&r&&n!==r){o=n;for(var u=new uo(n,a);(o=u.next())&&o!==r;)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==a&&i.push(r),i}(t,l(),e,n)},normalize:function(){var e=l(),n=s();if(!(Bf(n).length>1)&&Uf(r)){var o=yd(t,e);return o.each((function(t){f(t,d())})),o.getOr(e)}return e},selectorChanged:function(t,e){return a(t,e),m},selectorChangedWithUnbind:a,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){y(t)?function(t,e,n){(t.inline?Vd:Ud)(t,e,n)}(r,t,e):Wd(r,l(),e)},placeCaretAt:function(t,e){return f(sd(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=l();return t.collapsed?Rc.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,h.destroy()}},g=Zf(m),h=ud(m,r);return m.bookmarkManager=g,m.controlSelection=h,m},fb=function(t,e,n){t.addNodeFilter("font",(function(t){q(t,(function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),a=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),a&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),function(t,e){q(e,(function(e){t.attr(e,null)}))}(t,["color","face","size"])}))}))},db=function(t,e){var n=Ai();e.convert_fonts_to_spans&&fb(t,n,_e.explode(e.font_size_legacy_values)),function(t,e){t.addNodeFilter("strike",(function(t){q(t,(function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))}))}))}(t,n)},mb=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},gb=function(t,e){var n;try{n=atob(e)}catch(t){return L.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return L.some(new Blob([r],{type:t}))},hb=function(t){return 0===t.indexOf("blob:")?function(t){return new to((function(e,n){var r=function(){n("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){200===o.status?e(o.response):r()},o.onerror=r,o.send()}catch(t){r()}}))}(t):0===t.indexOf("data:")?(e=t,new to((function(t){var n=mb(e),r=n.type,o=n.data;gb(r,o).fold((function(){return t(new Blob([]))}),t)}))):null;var e},pb=0,vb=function(t){return(t||"blobid")+pb++},bb=function(t,e,n,r){var o,i;if(0!==e.src.indexOf("blob:")){var a=mb(e.src),u=a.data,c=a.type;o=u,(i=t.getByData(o,c))?n({image:e,blobInfo:i}):hb(e.src).then((function(r){i=t.create(vb(),r,o),t.add(i),n({image:e,blobInfo:i})}),(function(t){r(t)}))}else(i=t.getByUri(e.src))?n({image:e,blobInfo:i}):hb(e.src).then((function(r){(function(t){return new to((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))})(r).then((function(a){o=mb(a).data,i=t.create(vb(),r,o),t.add(i),n({image:e,blobInfo:i})}))}),(function(t){r(t)}))},yb=function(t,e){var n={};return{findAll:function(r,o){o||(o=M);var i=K(function(t){return t?ct(t.getElementsByTagName("img")):[]}(r),(function(e){var n=e.src;return!!Se.fileApi&&(!e.hasAttribute("data-mce-bogus")&&(!e.hasAttribute("data-mce-placeholder")&&(!(!n||n===Se.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e)))))})),a=W(i,(function(t){if(void 0!==n[t.src])return new to((function(e){n[t.src].then((function(n){if("string"==typeof n)return n;e({image:t,blobInfo:n.blobInfo})}))}));var r=new to((function(n,r){bb(e,t,n,r)})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r,r}));return to.all(a)}}},wb=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new Mm("br",1)).shortEnded=!0:r.empty().append(new Mm("#text",3)).value=wo},xb=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},Cb=function(t,e,n,r){return r.isEmpty(e,n,(function(e){return function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty}(t,e)}))},Sb=function(t,e){var n=e.blob_cache,r=function(t){var r=t.attr("src");(function(t){return t.attr("src")===Se.transparentSrc||y(t.attr("data-mce-placeholder"))})(t)||function(t){return y(t.attr("data-mce-bogus"))}(t)||function(t){var e=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(t);return e?L.some({type:e[1],data:decodeURIComponent(e[2])}):L.none()}(r).filter((function(){return function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),dt(t.attributes.map,(function(t,e){n.setAttribute(e,t)})),e.images_dataimg_filter(n)}return!0}(t,e)})).bind((function(t){var e=t.type,r=t.data;return L.from(n.getByData(r,e)).orThunk((function(){return gb(e,r).map((function(t){var e=n.create(vb(),t,r);return n.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))};n&&t.addAttributeFilter("src",(function(t){return q(t,r)}))},kb=_e.makeMap,Tb=_e.each,Ob=_e.explode,Eb=_e.extend,_b=function(t,e){void 0===e&&(e=Ri());var n={},r=[],o={},i={};(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var a=function(t){var e=t.name;e in n&&((u=o[e])?u.push(t):o[e]=[t]);for(var a=r.length;a--;){var u,c=r[a].name;if(c in t.attributes.map)(u=i[c])?u.push(t):i[c]=[t]}return t},u={schema:e,addAttributeFilter:function(t,e){Tb(Ob(t),(function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){Tb(Ob(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},getNodeFilters:function(){var t=[];for(var e in n)wt(n,e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:a,parse:function(u,c){var s,l,f,d,m,g,h,p,v=[];c=c||{},o={},i={};var b=Eb(kb("script,style,head,html,body,title,meta,param"),e.getBlockElements()),y=e.getNonEmptyElements(),w=e.children,x=t.validate,C=function(t){return!1===t?"":!0===t?"p":t}("forced_root_block"in c?c.forced_root_block:t.forced_root_block),S=e.getWhiteSpaceElements(),k=/^[ \t\r\n]+/,T=/[ \t\r\n]+$/,O=/[ \t\r\n]+/g,E=/^[ \t\r\n]+$/,_=wt(S,c.context)||wt(S,t.root_name),R=function(t,e){var r,i=new Mm(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i},N=function(t){for(var n=e.getBlockElements(),r=t.prev;r&&3===r.type;){var o=r.value.replace(T,"");if(o.length>0)return void(r.value=o);var i=r.next;if(i){if(3===i.type&&i.value.length){r=r.prev;continue}if(!n[i.name]&&"script"!==i.name&&"style"!==i.name){r=r.prev;continue}}var a=r.prev;r.remove(),r=a}},A=$m({validate:x,document:t.document,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e={};for(var n in t)"li"!==n&&"p"!==n&&(e[n]=t[n]);return e}(e.getSelfClosingElements()),cdata:function(t){p.append(R("#cdata",4)).value=t},text:function(t,e){var n;_||(t=t.replace(O," "),function(t,e){return t&&(wt(e,t.name)||"br"===t.name)}(p.lastChild,b)&&(t=t.replace(k,""))),0!==t.length&&((n=R("#text",3)).raw=!!e,p.append(n).value=t)},comment:function(t){p.append(R("#comment",8)).value=t},pi:function(t,e){p.append(R(t,7)).value=e,N(p)},doctype:function(t){p.append(R("#doctype",10)).value=t,N(p)},start:function(t,n,o){var a=x?e.getElementRule(t):{};if(a){var u=R(a.outputName||t,1);u.attributes=n,u.shortEnded=o,p.append(u);var c=w[p.name];c&&w[u.name]&&!c[u.name]&&v.push(u);for(var s=r.length;s--;){var l=r[s].name;l in n.map&&((g=i[l])?g.push(u):i[l]=[u])}b[t]&&N(u),o||(p=u),!_&&S[t]&&(_=!0)}},end:function(n){var r,o,i,a,u=x?e.getElementRule(n):{};if(u){if(b[n]&&!_){if((r=p.firstChild)&&3===r.type)if((o=r.value.replace(k,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i;if((r=p.lastChild)&&3===r.type)if((o=r.value.replace(T,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i}if(_&&S[n]&&(_=!1),u.removeEmpty&&Cb(e,y,S,p))return a=p.parent,b[p.name]?p.empty().remove():p.unwrap(),void(p=a);u.paddEmpty&&(function(t){return xb(t,"#text")&&t.firstChild.value===wo}(p)||Cb(e,y,S,p))&&wb(t,c,b,p),p=p.parent}}},e),D=p=new Mm(c.context||t.root_name,11);if(A.parse(u,c.format),x&&v.length&&(c.context?c.invalid=!0:function(t){for(var n=kb("tr,td,th,tbody,thead,tfoot,table"),r=e.getNonEmptyElements(),o=e.getWhiteSpaceElements(),i=e.getTextBlockElements(),u=e.getSpecialElements(),c=function(t,n){if(void 0===n&&(n=t.parent),u[t.name])t.empty().remove();else{for(var r=0,o=t.children();r<o.length;r++){var i=o[r];e.isValidChild(n.name,i.name)||c(i,n)}t.unwrap()}},s=0;s<t.length;s++){var l=t[s],f=void 0,d=void 0,m=void 0;if(l.parent&&!l.fixed)if(i[l.name]&&"li"===l.parent.name){for(var g=l.next;g&&i[g.name];)g.name="li",g.fixed=!0,l.parent.insert(g,l.parent),g=g.next;l.unwrap()}else{var h=[l];for(f=l.parent;f&&!e.isValidChild(f.name,l.name)&&!n[f.name];f=f.parent)h.push(f);if(f&&h.length>1)if(e.isValidChild(f.name,l.name)){h.reverse();for(var p=d=a(h[0].clone()),v=0;v<h.length-1;v++){e.isValidChild(p.name,h[v].name)?(m=a(h[v].clone()),p.append(m)):m=p;for(var b=h[v].firstChild;b&&b!==h[v+1];){var y=b.next;m.append(b),b=y}p=m}Cb(e,r,o,d)?f.insert(l,h[0],!0):(f.insert(d,h[0],!0),f.insert(l,d)),f=h[0],(Cb(e,r,o,f)||xb(f,"br"))&&f.empty().remove()}else c(l);else if(l.parent){if("li"===l.name){if((g=l.prev)&&("ul"===g.name||"ol"===g.name)){g.append(l);continue}if((g=l.next)&&("ul"===g.name||"ol"===g.name)){g.insert(l,g.firstChild,!0);continue}l.wrap(a(new Mm("ul",1)));continue}e.isValidChild(l.parent.name,"div")&&e.isValidChild("div",l.name)?l.wrap(a(new Mm("div",1))):c(l)}}}}(v)),C&&("body"===D.name||c.isRootContent)&&function(){var n=D.firstChild,r=null,o=function(t){t&&((n=t.firstChild)&&3===n.type&&(n.value=n.value.replace(k,"")),(n=t.lastChild)&&3===n.type&&(n.value=n.value.replace(T,"")))};if(e.isValidChild(D.name,C.toLowerCase())){for(;n;){var i=n.next;3===n.type||1===n.type&&"p"!==n.name&&!b[n.name]&&!n.attr("data-mce-type")?(r||((r=R(C,1)).attr(t.forced_root_block_attrs),D.insert(r,n)),r.append(n)):(o(r),r=null),n=i}o(r)}}(),!c.invalid){for(h in o)if(wt(o,h)){for(g=n[h],d=(s=o[h]).length;d--;)s[d].parent||s.splice(d,1);for(l=0,f=g.length;l<f;l++)g[l](s,h,c)}for(l=0,f=r.length;l<f;l++)if((g=r[l]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c)}}return D}};return function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,r,o){var i,a,u,c,s,l,f,d,m=t.length,g=_e.extend({},n.getBlockElements()),h=n.getNonEmptyElements(),p=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(u=(a=t[i]).parent,g[a.parent.name]&&a===u.lastChild){for(s=a.prev;s;){if("span"!==(l=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===l&&(a=null);break}s=s.prev}a&&(a.remove(),Cb(n,h,p,u)&&(f=n.getElementRule(u.name))&&(f.removeEmpty?u.remove():f.paddEmpty&&wb(e,o,g,u)))}else{for(c=a;u&&u.firstChild===c&&u.lastChild===c&&(c=u,!g[u.name]);)u=u.parent;c===u&&!0!==e.padd_empty_with_br&&((d=new Mm("#text",3)).value=wo,a.replace(d))}})),t.addAttributeFilter("href",(function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(r=void 0,r=(n=i.attr("rel"))?_e.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(t){return t.split(" ").filter((function(t){return t.length>0})).concat(["noopener"]).sort().join(" ")}(r)))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){for(var e,n,r=t.length;r--;)if("ul"===(n=(e=t[r]).parent).name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new Mm("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){for(var e=n.getValidClasses(),r=t.length;r--;){for(var o=t[r],i=o.attr("class").split(" "),a="",u=0;u<i.length;u++){var c=i[u],s=!1,l=e["*"];l&&l[c]&&(s=!0),l=e[o.name],!s&&l&&l[c]&&(s=!0),s&&(a&&(a+=" "),a+=c)}a.length||(a=null),o.attr("class",a)}})),Sb(t,e)}(u,t),function(t,e){e.inline_styles&&db(t,e)}(u,t),u},Rb=function(t,e,n){return function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events}(t,n)?function(t,e,n){var r,o=t.dom,i=e.cloneNode(!0),a=document.implementation;if(a.createHTMLDocument){var u=a.createHTMLDocument("");_e.each("BODY"===i.nodeName?i.childNodes:[i],(function(t){u.body.appendChild(u.importNode(t,!0))})),i="BODY"!==i.nodeName?u.body.firstChild:u.body,r=o.doc,o.doc=u}return function(t,e){t.fire("PreProcess",e)}(t,Nt(Nt({},n),{node:i})),r&&(o.doc=r),i}(t,e,n):e},Nb=function(t,e,n){-1===_e.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),e.push(n))},Ab=function(t,e,n,r,o){return function(t,e,n){return!e.no_events&&t?function(t,e){return t.fire("PostProcess",e)}(t,Nt(Nt({},e),{content:n})).content:n}(t,o,function(t,e,n){return tg(t,e).serialize(n)}(e,n,r))},Db=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:pu.DOM,o=e&&e.schema?e.schema:Ri(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=_b(t,o);!function(t,e,n){t.addAttributeFilter("data-mce-tabindex",(function(t,e){for(var n=t.length;n--;){var r=t[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(e,null)}})),t.addAttributeFilter("src,href,style",(function(t,r){for(var o="data-mce-"+r,i=e.url_converter,a=e.url_converter_scope,u=t.length;u--;){var c=t[u],s=c.attr(o);void 0!==s?(c.attr(r,s.length>0?s:null),c.attr(o,null)):(s=c.attr(r),"style"===r?s=n.serializeStyle(n.parseStyle(s),c.name):i&&(s=i.call(a,s,r,c.name)),c.attr(r,s.length>0?s:null))}})),t.addAttributeFilter("class",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("class");r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}})),t.addAttributeFilter("data-mce-type",(function(t,e,n){for(var r=t.length;r--;){var o=t[r];"bookmark"!==o.attr("data-mce-type")||n.cleanup||(L.from(o.firstChild).exists((function(t){return!Co(t.value)}))?o.unwrap():o.remove())}})),t.addNodeFilter("noscript",(function(t){for(var e=t.length;e--;){var n=t[e].firstChild;n&&(n.value=yi.decode(n.value))}})),t.addNodeFilter("script,style",(function(t,n){for(var r=function(t){return t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")},o=t.length;o--;){var i=t[o],a=i.firstChild?i.firstChild.value:"";if("script"===n){var u=i.attr("type");u&&i.attr("type","mce-no/type"===u?null:u.replace(/^mce\-/,"")),"xhtml"===e.element_format&&a.length>0&&(i.firstChild.value="// <![CDATA[\n"+r(a)+"\n// ]]>")}else"xhtml"===e.element_format&&a.length>0&&(i.firstChild.value="\x3c!--\n"+r(a)+"\n--\x3e")}})),t.addNodeFilter("#comment",(function(t){for(var r=t.length;r--;){var o=t[r];e.preserve_cdata&&0===o.value.indexOf("[CDATA[")?(o.name="#cdata",o.type=4,o.value=n.decode(o.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===o.value.indexOf("mce:protected ")&&(o.name="#text",o.type=3,o.raw=!0,o.value=unescape(o.value).substr(14))}})),t.addNodeFilter("xml:namespace,input",(function(t,e){for(var n=t.length;n--;){var r=t[n];7===r.type?r.remove():1===r.type&&("input"!==e||r.attr("type")||r.attr("type","text"))}})),t.addAttributeFilter("data-mce-type",(function(e){q(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)}))}(i,t,r);return{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,a){void 0===a&&(a={});var u=Nt({format:"html"},a),c=Rb(e,n,u),s=function(t,e,n){var r=So(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||yo(Ne.fromDom(e))?r:_e.trim(r)}(r,c,u),l=function(t,e,n){var r=n.selection?Nt({forced_root_block:!1},n):n,o=t.parse(e,r);return function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}}(o),o}(i,s,u);return"tree"===u.format?l:Ab(e,t,o,l,u)},addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:_(Nb,i,n),getTempAttrs:T(n),getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},Mb=function(t,e){var n=Db(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},Bb=function(t,e){return void 0===e&&(e={}),function(t,e,n){return Zv(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")},zb=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return Zv(t).editor.setContent(e,n)}(t,e,n)},Pb=pu.DOM,Lb=function(t){return L.from(t).each((function(t){return t.destroy()}))},Ib=function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&Pb.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){Pb.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),Pb.remove(t.getContainer()),Lb(e),Lb(n),t.destroy()}},Hb=function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),Lb(n),Lb(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),Pb.unbind(e,"submit reset",t.formEventDelegate))}(t),function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)}(t),t.destroyed=!0):t.remove())},Fb=(ab=function(t,e){return m(t)&&m(e)?Fb(t,e):e},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)wt(o,i)&&(n[i]=ab(n[i],o[i]))}return n}),Vb="autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),jb="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),Ub="imagetools,toc".split(","),Wb=function(t){var e=K(Vb,(function(e){return wt(t,e)})),n=t.forced_root_block;return!1!==n&&""!==n||e.push("forced_root_block (false only)"),ot(e)},qb=function(t){var e=_e.makeMap(t.plugins," "),n=function(t){return wt(e,t)},r=At(At([],K(jb,n),!0),tt(Ub,(function(t){return n(t)?[t+" (moving to premium)"]:[]})),!0);return ot(r)},$b=ge().deviceType,Gb=$b.isTouch(),Kb=$b.isPhone(),Xb=$b.isTablet(),Yb=["lists","autolink","autosave"],Jb={table_grid:!1,object_resizing:!1,resize:!1},Qb=function(t){var e=g(t)?t.join(" "):t,n=W(d(e)?e.split(" "):[],Ft);return K(n,(function(t){return t.length>0}))},Zb=function(t,e){var n,r,o=(r={},pt(e,(function(e,n){return j(t,n)}),ht(n={}),ht(r)),{t:n,f:r});return function(t,e){return{sections:T(t),settings:T(e)}}(o.t,o.f)},ty=function(t,e){return wt(t.sections(),e)},ey=function(t,e){return yt(t,"toolbar_mode").orThunk((function(){return yt(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},ny=function(t,e){var n={resize:!1,toolbar_mode:ey(t,"scrolling"),toolbar_sticky:!1};return Nt(Nt(Nt({},Jb),n),e?{menubar:!1}:{})},ry=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?_e.extend({},t.external_plugins,n):n},oy=function(t,e,n,r){return t&&function(t,e,n){var r=t.sections();return ty(t,e)&&r[e].theme===n}(e,"mobile","mobile")?K(r,_(j,Yb)):t&&ty(e,"mobile")?r:n},iy=function(t,e,n,r){var o=Qb(n.forced_plugins),i=Qb(r.plugins),a=function(t,e){return ty(t,e)?t.sections()[e]:{}}(e,"mobile"),u=a.plugins?Qb(a.plugins):i,c=function(t,e){return[].concat(Qb(t)).concat(Qb(e))}(o,oy(t,e,i,u));if(Se.browser.isIE()&&j(c,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return _e.extend(r,{plugins:c.join(" ")})},ay=function(t,e,n,r,o){var i=t?{mobile:ny(o.mobile||{},e)}:{},a=Zb(["mobile"],Fb(i,o)),u=_e.extend(n,r,a.settings(),function(t,e){return t&&ty(e,"mobile")}(t,a)?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=yt(r,e).getOr({});return _e.extend({},n,o)}(a,"mobile"):{},{validate:!0,external_plugins:ry(r,a.settings())});return iy(t,a,r,u)},uy=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:ey(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return Nt(Nt({},i),r?Jb:{})}(o,e,n,Gb,t),a=ay(Kb||Xb,Kb,i,r,o);return!1!==a.deprecation_warnings&&function(t,e){var n=Wb(t),r=qb(e),o=r.length>0,i=n.length>0,a="mobile"===e.theme;if(o||i||a){var u="\n- ",c=a?"\n\nThemes:\n- mobile":"",s=o?"\n\nPlugins:\n- "+r.join(u):"",l=i?"\n\nSettings:\n- "+n.join(u):"";console.warn("The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information."+c+s+l)}}(o,a),a},cy=function(t,e,n){return L.from(e.settings[n]).filter(t)},sy=function(t,e,n,r){var o,i=e in t.settings?t.settings[e]:n;return"hash"===r?function(t){var e={};return"string"==typeof t?q(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),(function(t){var n=t.split("=");n.length>1?e[_e.trim(n[0])]=_e.trim(n[1]):e[_e.trim(n[0])]=_e.trim(n[0])})):e=t,e}(i):"string"===r?cy(d,t,e).getOr(n):"number"===r?cy(x,t,e).getOr(n):"boolean"===r?cy(p,t,e).getOr(n):"object"===r?cy(m,t,e).getOr(n):"array"===r?cy(g,t,e).getOr(n):"string[]"===r?cy((o=d,function(t){return g(t)&&et(t,o)}),t,e).getOr(n):"function"===r?cy(w,t,e).getOr(n):i},ly=(ub={},{add:function(t,e){ub[t]=e},get:function(t){return ub[t]?ub[t]:{icons:{}}},has:function(t){return wt(ub,t)}}),fy=function(t,e){return e.dom[t]},dy=function(t,e){return parseInt(ir(e,t),10)},my=_(fy,"clientWidth"),gy=_(fy,"clientHeight"),hy=_(dy,"margin-top"),py=_(dy,"margin-left"),vy=function(t,e,n){var r,o=Ne.fromDom(t.getBody()),i=t.inline?o:(r=o,Ne.fromDom(qe(r).dom.documentElement)),a=function(t,e,n,r){var o=function(t){return t.dom.getBoundingClientRect()}(e);return{x:n-(t?o.left+e.dom.clientLeft+py(e):0),y:r-(t?o.top+e.dom.clientTop+hy(e):0)}}(t.inline,i,e,n);return function(t,e,n){var r=my(t),o=gy(t);return e>=0&&n>=0&&e<=r&&n<=o}(i,a.x,a.y)},by=function(t){var e,n=t.inline?t.getBody():t.getContentAreaContainer();return(e=n,L.from(e).map(Ne.fromDom)).map(yn).getOr(!1)},yy=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},r=function(){return L.from(e[0])},o=function(){e.length>0&&n().reposition(e)},i=function(t){Z(e,(function(e){return e===t})).each((function(t){e.splice(t,1)}))},a=function(a,u){if(void 0===u&&(u=!0),!t.removed&&by(t))return u&&t.fire("BeforeOpenNotification",{notification:a}),Q(e,(function(t){return e=n().getArgs(t),r=a,!(e.type!==r.type||e.text!==r.text||e.progressBar||e.timeout||r.progressBar||r.timeout);var e,r})).getOrThunk((function(){t.editorManager.setActive(t);var u=n().open(a,(function(){i(u),o(),r().fold((function(){return t.focus()}),(function(t){return Ne.fromDom(t.getEl()).dom.focus()}))}));return function(t){e.push(t)}(u),o(),t.fire("OpenNotification",{notification:Nt({},u)}),u}))},u=T(e);return function(t){t.on("SkinLoaded",(function(){var e=function(t){return t.getParam("service_message")}(t);e&&a({text:e,type:"warning",timeout:0},!1),o()})),t.on("show ResizeEditor ResizeWindow NodeChange",(function(){oo.requestAnimationFrame(o)})),t.on("remove",(function(){q(e.slice(),(function(t){n().close(t)}))}))}(t),{open:a,close:function(){r().each((function(t){n().close(t),i(t),o()}))},getNotifications:u}},wy=Ou.PluginManager,xy=Ou.ThemeManager;var Cy=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e?e.apply(t,n):void 0}},o=function(n){e.push(n),function(e){t.fire("OpenWindow",{dialog:e})}(n)},i=function(n){!function(e){t.fire("CloseWindow",{dialog:e})}(n),0===(e=K(e,(function(t){return t!==n}))).length&&t.focus()},a=function(e){t.editorManager.setActive(t),um(t);var n=e();return o(n),n};return t.on("remove",(function(){q(e,(function(t){n().close(t)}))})),{open:function(t,e){return a((function(){return n().open(t,e,i)}))},openUrl:function(t){return a((function(){return n().openUrl(t,i)}))},alert:function(t,e,o){var i=n();i.alert(t,r(o||i,e))},confirm:function(t,e,o){var i=n();i.confirm(t,r(o||i,e))},close:function(){L.from(e[e.length-1]).each((function(t){n().close(t),i(t)}))}}},Sy=function(t,e){t.notificationManager.open({type:"error",text:e})},ky=function(t,e){t._skinLoaded?Sy(t,e):t.on("SkinLoaded",(function(){Sy(t,e)}))},Ty=function(t,e,n){nd(t,e,{message:n}),console.error(n)},Oy=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},Ey=function(t,e,n){Ty(t,"PluginLoadError",Oy("plugin",e,n))},_y=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,At([t],e,!1)):r.log.apply(r,At([t],e,!1)))},Ry=function(t){return Ny(t,function(t){var e=t.getParam("content_css");return d(e)?W(e.split(","),Ft):g(e)?e:!1===e||t.inline?[]:["default"]}(t))},Ny=function(t,e){var n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return W(e,(function(e){return function(t){return/^[a-z0-9\-]+$/i.test(t)}(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)}))},Ay=function(t){t.contentCSS=t.contentCSS.concat(Ry(t),function(t){return Ny(t,hs(t))}(t))},Dy=function(){var t={},e=function(t,e){return{status:t,resultUri:e}},n=function(e){return e in t};return{hasBlobUri:n,getResultUri:function(e){var n=t[e];return n?n.resultUri:null},isPending:function(e){return!!n(e)&&1===t[e].status},isUploaded:function(e){return!!n(e)&&2===t[e].status},markPending:function(n){t[n]=e(1,null)},markUploaded:function(n,r){t[n]=e(2,r)},removeFailed:function(e){delete t[e]},destroy:function(){t={}}}},My=0,By=function(t){return t+My+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e},zy=function(t,e){var n={},r=function(t,n,r,o){var i=new XMLHttpRequest;i.open("POST",e.url),i.withCredentials=e.credentials,i.upload.onprogress=function(t){o(t.loaded/t.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){if(i.status<200||i.status>=300)r("HTTP Error: "+i.status);else{var t,o,a=JSON.parse(i.responseText);if(a&&"string"==typeof a.location)n((t=e.basePath,o=a.location,t?t.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o));else r("Invalid JSON: "+i.responseText)}};var a=new FormData;a.append("file",t.blob(),t.filename()),i.send(a)},o=function(t,e){return{url:e,blobInfo:t,status:!0}},i=function(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}},a=function(t,e){_e.each(n[t],(function(t){t(e)})),delete n[t]},u=function(r,u){return r=_e.grep(r,(function(e){return!t.isUploaded(e.blobUri())})),to.all(_e.map(r,(function(r){return t.isPending(r.blobUri())?function(t){var e=t.blobUri();return new to((function(t){n[e]=n[e]||[],n[e].push(t)}))}(r):function(e,n,r){return t.markPending(e.blobUri()),new to((function(u){var c;try{var s=function(){c&&c.close()};n(e,(function(n){s(),t.markUploaded(e.blobUri(),n),a(e.blobUri(),o(e,n)),u(o(e,n))}),(function(n,r){var o=r||{};s(),t.removeFailed(e.blobUri()),a(e.blobUri(),i(e,n,o)),u(i(e,n,o))}),(function(t){t<0||t>100||L.from(c).orThunk((function(){return L.from(r).map(N)})).each((function(e){c=e,e.progressBar.value(t)}))}))}catch(t){u(i(e,t.message,{}))}}))}(r,e.handler,u)})))};return!1===w(e.handler)&&(e.handler=r),{upload:function(t,n){return e.url||e.handler!==r?u(t,n):new to((function(t){t([])}))}}},Py=function(t){return function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}},Ly=function(t,e){return zy(e,{url:us(t),basePath:cs(t),credentials:ss(t),handler:ls(t)})},Iy=function(t){var e,n,r=function(){var t=[],e=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e,n=t.id||By("blobid"),r=t.name||n,o=t.blob;return{id:T(n),name:T(r),filename:T(t.filename||r+"."+(e=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[e.toLowerCase()]||"dat")),blob:T(o),base64:T(t.base64),blobUri:T(t.blobUri||URL.createObjectURL(o)),uri:T(t.uri)}},n=function(e){return Q(t,e).getOrUndefined()},r=function(t){return n((function(e){return e.id()===t}))};return{create:function(t,n,r,o,i){if(d(t))return e({id:t,name:o,filename:i,blob:n,base64:r});if(m(t))return e(t);throw new Error("Unknown input type")},add:function(e){r(e.id())||t.push(e)},get:r,getByUri:function(t){return n((function(e){return e.blobUri()===t}))},getByData:function(t,e){return n((function(n){return n.base64()===t&&n.blob().type===e}))},findFirst:n,removeByUri:function(e){t=K(t,(function(t){return t.blobUri()!==e||(URL.revokeObjectURL(t.blobUri()),!1)}))},destroy:function(){q(t,(function(t){URL.revokeObjectURL(t.blobUri())})),t=[]}}}(),o=Dy(),i=[],a=function(t){var e=xu(null);return t.on("change AddUndo",(function(t){e.set(Nt({},t.level))})),{fireIfChanged:function(){var n=t.undoManager.data;ut(n).filter((function(t){return!$v(e.get(),t)})).each((function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:it(n,n.length-2).getOrNull()})}))}}}(t),u=function(e){return function(n){return t.selection?e(n):[]}},c=function(t,e,n){var r=0;do{-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},s=function(t,e,n){var r='src="'+n+'"'+(n===Se.transparentSrc?' data-mce-placeholder="1"':"");return t=c(t,'src="'+e+'"',r),t=c(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},l=function(e,n){q(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=W(t.fragments,(function(t){return s(t,e,n)})):t.content=s(t.content,e,n)}))},f=function(n){return e||(e=Ly(t,o)),p().then(u((function(o){var i=W(o,(function(t){return t.blobInfo}));return e.upload(i,Py(t)).then(u((function(e){var i=[],u=W(e,(function(e,n){var a=o[n].blobInfo,u=o[n].image;return e.status&&function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(r.removeByUri(u.src),Jv(t)||function(e,n){var r,o=t.convertURL(n,"src");l(e.src,n),t.$(e).attr({src:is(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})}(u,e.url)):e.error&&(e.error.options.remove&&(l(u.getAttribute("src"),Se.transparentSrc),i.push(u)),function(t,e){ky(t,Tu.translate(["Failed to upload image: {0}",e]))}(t,e.error.message)),{element:u,status:e.status,uploadUri:e.url,blobInfo:a}}));return u.length>0&&a.fireIfChanged(),i.length>0&&(Jv(t)?console.error("Removing images on failed uploads is currently unsupported for RTC"):t.undoManager.transact((function(){q(i,(function(e){t.dom.remove(e),r.removeByUri(e.src)}))}))),n&&n(u),u})))})))},g=function(e){if(os(t))return f(e)},h=function(e){return!1!==et(i,(function(t){return t(e)}))&&(0!==e.getAttribute("src").indexOf("data:")||function(t){return t.getParam("images_dataimg_filter",M,"function")}(t)(e))},p=function(){return n||(n=yb(o,r)),n.findAll(t.getBody(),h).then(u((function(e){return e=K(e,(function(e){return"string"!=typeof e||(ky(t,e),!1)})),Jv(t)||q(e,(function(t){l(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},v=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var i=o.getResultUri(n);if(i)return'src="'+i+'"';var a=r.getByUri(n);return a||(a=Y(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null)),a?'src="data:'+a.blob().type+";base64,"+a.base64()+'"':e}))};return t.on("SetContent",(function(){os(t)?g():p()})),t.on("RawSaveContent",(function(t){t.content=v(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=v(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){q(t,(function(t){var e=t.attr("src");if(!r.getByUri(e)){var n=o.getResultUri(e);n&&t.attr("src",n)}}))}))})),{blobCache:r,addFilter:function(t){i.push(t)},uploadImages:f,uploadImagesAuto:g,scanForImages:p,destroy:function(){r.destroy(),o.destroy(),n=e=null}}},Hy=function(t){var e={},n=function(t,r){t&&(d(t)?(g(r)||(r=[r]),q(r,(function(t){v(t.deep)&&(t.deep=!hf(t)),v(t.split)&&(t.split=!hf(t)||pf(t)),v(t.remove)&&hf(t)&&!pf(t)&&(t.remove="none"),hf(t)&&pf(t)&&(t.mixed=!0,t.block_expand=!0),d(t.classes)&&(t.classes=t.classes.split(/\s+/))})),e[t]=r):dt(t,(function(t,e){n(e,t)})))};return n(function(t){var e={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(t,e,n){return An(t)&&t.hasAttribute("href")},onformat:function(e,n,r){_e.each(r,(function(n,r){t.setAttrib(e,r,n)}))}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(t){var e;return null!==(e=null==t?void 0:t.customValue)&&void 0!==e?e:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return _e.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(function(t){e[t]={block:t,remove:"all"}})),e}(t.dom)),n(function(t){return t.getParam("formats")}(t)),{get:function(t){return y(t)?e[t]:e},has:function(t){return wt(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}},Fy=_e.each,Vy=pu.DOM,jy=function(t,e){var n,r,o,i=e&&e.schema||Ri({}),a=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=Vy.create(r.name);return function(t,e){e.classes.length&&Vy.addClass(t,e.classes.join(" ")),Vy.setAttribs(t,e.attrs)}(e,r),e},u=function(t,e,n){var r,o,c=e.length>0&&e[0],s=c&&c.name,l=function(t,e){var n="string"!=typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==_e.inArray(o,e)?e:o[0])}(t,s);if(l)s===l?(o=e[0],e=e.slice(1)):o=l;else if(c)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=a(o)).appendChild(t),n&&(r||(r=Vy.create("div")).appendChild(t),_e.each(n,(function(e){var n=a(e);r.insertBefore(n,t)}))),u(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=a(r),(o=Vy.create("div")).appendChild(u(n,t.slice(1),r.siblings)),o):""},Uy=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=_e.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==_e.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var a=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);a&&(n.attrs[a[1]]=a[2])}return""}))),n.name=e||"div",n},Wy=function(t,e){var n,r,o,i="",a=function(t){var e=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return d(e)?e:""}(t);if(""===a)return"";var u=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var c=yt(e,"preview");if(Xn(c,!1))return"";a=c.getOr(a)}n=e.block||e.inline||"span";var s,l=(s=e.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),_e.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=_e.map(t.split(/(?:~\+|~|\+)/),Uy),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[];l.length?(l[0].name||(l[0].name=n),n=e.selector,r=jy(l,t)):r=jy([n],t);var f=Vy.select(n,r)[0]||r.firstChild;return Fy(e.styles,(function(t,e){var n=u(t);n&&Vy.setStyle(f,e,n)})),Fy(e.attributes,(function(t,e){var n=u(t);n&&Vy.setAttrib(f,e,n)})),Fy(e.classes,(function(t){var e=u(t);Vy.hasClass(f,e)||Vy.addClass(f,e)})),t.fire("PreviewFormats"),Vy.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=Vy.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Fy(a.split(" "),(function(e){var n=Vy.getStyle(f,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Vy.getStyle(t.getBody(),e,!0),"#ffffff"===Vy.toHex(n).toLowerCase())||"color"===e&&"#000000"===Vy.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),Vy.remove(r),i},qy=function(t){var e=Hy(t),n=xu(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),Dp(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){tb(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){tb(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){tb(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:function(e,n,r,o){return function(t,e,n,r,o){return tb(t).formatter.match(e,n,r,o)}(t,e,n,r,o)},closest:function(e){return function(t,e){return tb(t).formatter.closest(e)}(t,e)},matchAll:function(e,n){return function(t,e,n){return tb(t).formatter.matchAll(e,n)}(t,e,n)},matchNode:function(e,n,r,o){return function(t,e,n,r,o){return tb(t).formatter.matchNode(e,n,r,o)}(t,e,n,r,o)},canApply:function(e){return function(t,e){return tb(t).formatter.canApply(e)}(t,e)},formatChanged:function(e,r,o,i){return function(t,e,n,r,o,i){return tb(t).formatter.formatChanged(e,n,r,o,i)}(t,n,e,r,o,i)},getCssText:_(Wy,t)}},$y=function(t){switch(t.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return!0;default:return!1}},Gy=function(t){var e=Eu(),n=xu(0),r=xu(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){tb(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,a){return function(t,e,n,r,o,i,a){return tb(t).undoManager.add(e,n,r,o,i,a)}(t,o,r,n,e,i,a)},undo:function(){return function(t,e,n,r){return tb(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return tb(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){tb(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){tb(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return tb(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return tb(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return tb(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){tb(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){tb(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return Jv(t)||function(t,e,n){var r=xu(!1),o=function(t){Kv(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command;$y(r)||(Xv(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command;$y(e)||o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===$v(jv(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var a=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||a||(e.beforeChange(),Kv(e,!0,n),e.add({},t),r.set(!0))}})),t.on("mousedown",(function(t){e.typing&&o(t)})),t.on("input",(function(t){var e;t.inputType&&("insertReplacementText"===t.inputType||"insertText"===(e=t).inputType&&null===e.data||function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType}(t))&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))}(t,o,n),function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")}(t),o},Ky=[9,27,id.HOME,id.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,id.DOWN,id.UP,id.LEFT,id.RIGHT].concat(Se.browser.isFirefox()?[224]:[]),Xy="data-mce-placeholder",Yy=function(t){return"keydown"===t.type||"keyup"===t.type},Jy=function(t){var e=t.keyCode;return e===id.BACKSPACE||e===id.DELETE},Qy=function(t){var e=t.dom,n=ns(t),r=function(t){return t.getParam("placeholder",Zc.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function(i,a){if(!function(t){if(Yy(t)){var e=t.keyCode;return!Jy(t)&&(id.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||j(Ky,e))}return!1}(i)){var u=t.getBody(),c=!function(t){return Yy(t)&&!(Jy(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(ei(Ne.fromDom(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(e,u,n);(""!==e.getAttrib(u,Xy)!==c||a)&&(e.setAttrib(u,Xy,c?r:null),e.setAttrib(u,"aria-placeholder",c?r:null),function(t,e){t.fire("PlaceholderToggle",{state:e})}(t,c),t.on(c?"keydown":"keyup",o),t.off(c?"keyup":"keydown",o))}};r&&t.on("init",(function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",(function(e){return oo.setEditorTimeout(t,(function(){return o(e)}))}))}))},Zy=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,tw=function(t,e){return De(Ne.fromDom(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},ew=function(t){return"rtl"===pu.DOM.getStyle(t,"direction",!0)||(e=t.textContent,Zy.test(e));var e},nw=function(t,e,n){var r=function(t,e,n){return K(pu.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return L.from(r[r.length-1])},rw=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?Eo(n)?Hn(n.nextSibling)?Rc(n.nextSibling,0):Rc.after(n):No(e)?Rc(n,r+1):e:Eo(n)?Hn(n.previousSibling)?Rc(n.previousSibling,n.previousSibling.data.length):Rc.before(n):Ao(e)?Rc(n,r-1):e},ow=_(rw,!0),iw=_(rw,!1),aw=function(t){return go(t)||po(t)},uw=function(t,e){return Pe(t,e)?Xr(e,aw,function(t){return function(e){return Be(t,Ne.fromDom(e.dom.parentNode))}}(t)):L.none()},cw=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)}(t))},sw=function(t,e){return{from:t,to:e}},lw=function(t,e){var n=Ne.fromDom(t),r=Ne.fromDom(e.container());return uw(n,r).map((function(t){return function(t,e){return{block:t,position:e}}(t,e)}))},fw=function(t,e,n){var r=lw(t,Rc.fromRangeStart(n)),o=r.bind((function(n){return Rl(e,t,n.position).bind((function(n){return lw(t,n).map((function(n){return function(t,e,n){return Un(n.position.getNode())&&!1===ei(n.block)?Dl(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?Rl(e,t,r).bind((function(e){return lw(t,e)})):L.some(n)})).getOr(n):n}(t,e,n)}))}))}));return Yn(r,o,sw).filter((function(t){return function(t){return!1===Be(t.from.block,t.to.block)}(t)&&function(t){return Ge(t.from.block).bind((function(e){return Ge(t.to.block).filter((function(t){return Be(e,t)}))})).isSome()}(t)&&function(t){return!1===$n(t.from.block.dom)&&!1===$n(t.to.block.dom)}(t)}))},dw=function(t){var e=Qe(t);return Z(e,lo).fold(T(e),(function(t){return e.slice(0,t)}))},mw=function(t){var e=dw(t);return q(e,vn),e},gw=function(t,e){var n=Og(e,t);return Q(n.reverse(),(function(t){return ei(t)})).each(vn)},hw=function(t,e,n,r){if(ei(n))return Cg(n),zl(n.dom);0===K(Ye(r),(function(t){return!ei(t)})).length&&ei(e)&&fn(r,Ne.fromTag("br"));var o=Bl(n.dom,Rc.before(r.dom));return q(mw(e),(function(t){fn(r,t)})),gw(t,e),o},pw=function(t,e,n){if(ei(n))return vn(n),ei(e)&&Cg(e),zl(e.dom);var r=Pl(n.dom);return q(mw(e),(function(t){gn(n,t)})),gw(t,e),r},vw=function(t,e){return Pe(e,t)?function(t,e){var n=Og(e,t);return L.from(n[n.length-1])}(e,t):L.none()},bw=function(t,e){Dl(t,e.dom).map((function(t){return t.getNode()})).map(Ne.fromDom).filter(mo).each(vn)},yw=function(t,e,n){return bw(!0,e),bw(!1,n),vw(e,n).fold(_(pw,t,e,n),_(hw,t,e,n))},ww=function(t,e,n,r){return e?yw(t,r,n):yw(t,n,r)},xw=function(t,e){var n=Ne.fromDom(t.getBody()),r=function(t,e,n){return n.collapsed?fw(t,e,n):L.none()}(n.dom,e,t.selection.getRng()).bind((function(t){return ww(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},Cw=function(t,e){var n=Ne.fromDom(e),r=_(Be,t);return Kr(n,bo,r).isSome()},Sw=function(t,e){var n=Bl(t.dom,Rc.fromRangeStart(e)).isNone(),r=Ml(t.dom,Rc.fromRangeEnd(e)).isNone();return!function(t,e){return Cw(t,e.startContainer)||Cw(t,e.endContainer)}(t,e)&&n&&r},kw=function(t){var e=Ne.fromDom(t.getBody()),n=t.selection.getRng();return Sw(e,n)?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return Yn(uw(t,Ne.fromDom(n.startContainer)),uw(t,Ne.fromDom(n.endContainer)),(function(r,o){return!1===Be(r,o)&&(n.deleteContents(),ww(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)}(e,t.selection)},Tw=function(t,e){return!t.selection.isCollapsed()&&kw(t)},Ow=qn,Ew=$n,_w=function(t,e,n,r,o){return L.from(e._selectionOverrides.showCaret(t,n,r,o))},Rw=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?L.none():L.some(function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e))},Nw=function(t,e,n){var r=ul(1,t.getBody(),e),o=Rc.fromRangeStart(r),i=o.getNode();if(Fs(i))return _w(1,t,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(Fs(a))return _w(1,t,a,!1,!1);var u=t.dom.getParent(o.getNode(),(function(t){return Ew(t)||Ow(t)}));return Fs(u)?_w(1,t,u,!1,n):L.none()},Aw=function(t,e,n){return e.collapsed?Nw(t,e,n).getOr(e):e},Dw=function(t){return yg(t)||hg(t)},Mw=function(t){return wg(t)||pg(t)},Bw=function(t,e,n,r,o,i){return _w(r,t,i.getNode(!o),o,!0).each((function(n){if(e.collapsed){var r=e.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()}else e.deleteContents();t.selection.setRng(n)})),function(t,e){Hn(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},zw=function(t,e){return function(t,e){var n=t.selection.getRng();if(!Hn(n.commonAncestorContainer))return!1;var r=e?Nc.Forwards:Nc.Backwards,o=kl(t.getBody()),i=_(fl,e?o.next:o.prev),a=e?Dw:Mw,u=sl(r,t.getBody(),n),c=rw(e,i(u));if(!c||!dl(u,c))return!1;if(a(c))return Bw(t,n,u.getNode(),r,e,c);var s=i(c);return!!(s&&a(s)&&dl(c,s))&&Bw(t,n,u.getNode(),r,e,s)}(t,e)},Pw=Tr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Lw=function(t,e,n,r){var o=r.getNode(!1===e);return uw(Ne.fromDom(t),Ne.fromDom(n.getNode())).map((function(t){return ei(t)?Pw.remove(t.dom):Pw.moveToElement(o)})).orThunk((function(){return L.some(Pw.moveToElement(o))}))},Iw=function(t,e,n){return Rl(e,t,n).bind((function(r){return o=r.getNode(),bo(Ne.fromDom(o))||po(Ne.fromDom(o))||function(t,e,n,r){var o=function(e){return fo(Ne.fromDom(e))&&!tl(n,r,t)};return cl(!e,n).fold((function(){return cl(e,r).fold(D,o)}),o)}(t,e,n,r)?L.none():e&&$n(r.getNode())||!1===e&&$n(r.getNode(!0))?Lw(t,e,n,r):e&&wg(n)||!1===e&&yg(n)?L.some(Pw.moveToPosition(r)):L.none();var o}))},Hw=function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return An(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&$n(e.nextSibling)?L.some(Pw.moveToElement(e.nextSibling)):!1===t&&$n(e.previousSibling)?L.some(Pw.moveToElement(e.previousSibling)):L.none()}(e,n.getNode(!1===e)).fold((function(){return Iw(t,e,n)}),L.some):Iw(t,e,n).bind((function(e){return function(t,e,n){return n.fold((function(t){return L.some(Pw.remove(t))}),(function(t){return L.some(Pw.moveToElement(t))}),(function(n){return tl(e,n,t)?L.none():L.some(Pw.moveToPosition(n))}))}(t,n,e)}))},Fw=function(t,e){return L.from(td(t.getBody(),e))},Vw=function(t,e){var n=t.selection.getNode();return Fw(t,n).filter($n).fold((function(){return function(t,e,n){var r=ul(e?1:-1,t,n),o=Rc.fromRangeStart(r),i=Ne.fromDom(t);return!1===e&&wg(o)?L.some(Pw.remove(o.getNode(!0))):e&&yg(o)?L.some(Pw.remove(o.getNode())):!1===e&&yg(o)&&Ig(i,o)?Hg(i,o).map((function(t){return Pw.remove(t.getNode())})):e&&wg(o)&&Lg(i,o)?Fg(i,o).map((function(t){return Pw.remove(t.getNode())})):Hw(t,e,o)}(t.getBody(),e,t.selection.getRng()).exists((function(n){return n.fold(function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),hh(t,e,Ne.fromDom(n)),!0}}(t,e),function(t,e){return function(n){var r=e?Rc.before(n):Rc.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))}))}),M)},jw=function(t,e){var n=t.selection.getNode();return!(!$n(n)||Gn(n))&&Fw(t,n.parentNode).filter($n).fold((function(){var n;return n=Ne.fromDom(t.getBody()),q(Iu(n,".mce-offscreen-selection"),vn),hh(t,e,Ne.fromDom(t.selection.getNode())),cw(t),!0}),M)},Uw=function(t){var e=t.dom,n=t.selection,r=td(t.getBody(),n.getNode());if(qn(r)&&e.isBlock(r)&&e.isEmpty(r)){var o=e.create("br",{"data-mce-bogus":"1"});e.setHTML(r,""),r.appendChild(o),n.setRng(Rc.before(o).toRange())}return!0},Ww=function(t,e){return t.selection.isCollapsed()?Vw(t,e):jw(t,e)},qw=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=Rc.fromRangeStart(t.selection.getRng());return Rl(e,t.getBody(),n).filter((function(t){return e?mg(t):gg(t)})).bind((function(t){return L.from(el(e?0:-1,t))})).exists((function(e){return t.selection.select(e),!0}))}(t,e)},$w=Hn,Gw=function(t){return $w(t)&&t.data[0]===xo},Kw=function(t){return $w(t)&&t.data[t.data.length-1]===xo},Xw=function(t){return t.ownerDocument.createTextNode(xo)},Yw=function(t,e){return t?function(t){if($w(t.previousSibling))return Kw(t.previousSibling)||t.previousSibling.appendData(xo),t.previousSibling;if($w(t))return Gw(t)||t.insertData(0,xo),t;var e=Xw(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if($w(t.nextSibling))return Gw(t.nextSibling)||t.nextSibling.insertData(0,xo),t.nextSibling;if($w(t))return Kw(t)||t.appendData(xo),t;var e=Xw(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},Jw=_(Yw,!0),Qw=_(Yw,!1),Zw=function(t,e){return Hn(t.container())?Yw(e,t.container()):Yw(e,t.getNode())},tx=function(t,e){var n=e.get();return n&&t.container()===n&&Eo(n)},ex=function(t,e){return e.fold((function(e){Ds(t.get());var n=Jw(e);return t.set(n),L.some(Rc(n,n.length-1))}),(function(e){return zl(e).map((function(e){if(tx(e,t))return Rc(t.get(),1);Ds(t.get());var n=Zw(e,!0);return t.set(n),Rc(n,1)}))}),(function(e){return Pl(e).map((function(e){if(tx(e,t))return Rc(t.get(),t.get().length-1);Ds(t.get());var n=Zw(e,!1);return t.set(n),Rc(n,n.length-1)}))}),(function(e){Ds(t.get());var n=Qw(e);return t.set(n),L.some(Rc(n,1))}))},nx=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return L.none()},rx=Tr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),ox=function(t,e){var n=Zs(e,t);return n||t},ix=function(t,e,n){var r=ow(n),o=ox(e,r.container());return nw(t,o,r).fold((function(){return Ml(o,r).bind(_(nw,t,o)).map((function(t){return rx.before(t)}))}),L.none)},ax=function(t,e){return null===Hl(t,e)},ux=function(t,e,n){return nw(t,e,n).filter(_(ax,e))},cx=function(t,e,n){var r=iw(n);return ux(t,e,r).bind((function(t){return Bl(t,r).isNone()?L.some(rx.start(t)):L.none()}))},sx=function(t,e,n){var r=ow(n);return ux(t,e,r).bind((function(t){return Ml(t,r).isNone()?L.some(rx.end(t)):L.none()}))},lx=function(t,e,n){var r=iw(n),o=ox(e,r.container());return nw(t,o,r).fold((function(){return Bl(o,r).bind(_(nw,t,o)).map((function(t){return rx.after(t)}))}),L.none)},fx=function(t){return!1===ew(mx(t))},dx=function(t,e,n){return nx([ix,cx,sx,lx],[t,e,n]).filter(fx)},mx=function(t){return t.fold(O,O,O,O)},gx=function(t){return t.fold(T("before"),T("start"),T("end"),T("after"))},hx=function(t){return t.fold(rx.before,rx.before,rx.after,rx.after)},px=function(t){return t.fold(rx.start,rx.start,rx.end,rx.end)},vx=function(t,e,n,r,o,i){return Yn(nw(e,n,r),nw(e,n,o),(function(e,r){return e!==r&&function(t,e,n){var r=Zs(e,t),o=Zs(n,t);return r&&r===o}(n,e,r)?rx.after(t?e:r):i})).getOr(i)},bx=function(t,e){return t.fold(M,(function(t){return r=e,!(gx(n=t)===gx(r)&&mx(n)===mx(r));var n,r}))},yx=function(t,e){return t?e.fold(S(L.some,rx.start),L.none,S(L.some,rx.after),L.none):e.fold(L.none,S(L.some,rx.before),L.none,S(L.some,rx.end))},wx=function(t,e,n,r){var o=rw(t,r),i=dx(e,n,o);return dx(e,n,o).bind(_(yx,t)).orThunk((function(){return function(t,e,n,r,o){var i=rw(t,o);return Rl(t,n,i).map(_(rw,t)).fold((function(){return r.map(hx)}),(function(o){return dx(e,n,o).map(_(vx,t,e,n,i,o)).filter(_(bx,r))})).filter(fx)}(t,e,n,i,r)}))};_(wx,!1),_(wx,!0);var xx,Cx=function(t,e,n){var r=t?1:-1;return e.setRng(Rc(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0},Sx=function(t,e){var n=e.selection.getRng(),r=t?Rc.fromRangeEnd(n):Rc.fromRangeStart(n);return!!function(t){return w(t.selection.getSel().modify)}(e)&&(t&&No(r)?Cx(!0,e.selection,r):!(t||!Ao(r))&&Cx(!1,e.selection,r))};!function(t){t[t.Br=0]="Br",t[t.Block=1]="Block",t[t.Wrap=2]="Wrap",t[t.Eol=3]="Eol"}(xx||(xx={}));var kx,Tx=function(t,e){return t===Nc.Backwards?nt(e):e},Ox=function(t,e,n){return t===Nc.Forwards?e.next(n):e.prev(n)},Ex=function(t,e,n,r){return Un(r.getNode(e===Nc.Forwards))?xx.Br:!1===tl(n,r)?xx.Block:xx.Wrap},_x=function(t,e,n,r){for(var o=kl(n),i=r,a=[];i;){var u=Ox(e,o,i);if(!u)break;if(Un(u.getNode(!1)))return e===Nc.Forwards?{positions:Tx(e,a).concat([u]),breakType:xx.Br,breakAt:L.some(u)}:{positions:Tx(e,a),breakType:xx.Br,breakAt:L.some(u)};if(u.isVisible()){if(t(i,u)){var c=Ex(0,e,i,u);return{positions:Tx(e,a),breakType:c,breakAt:L.some(u)}}a.push(u),i=u}else i=u}return{positions:Tx(e,a),breakType:xx.Eol,breakAt:L.none()}},Rx=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===Nc.Backwards?o.concat(r):[r].concat(o)})).getOr([])},Nx=function(t,e){return Y(t,(function(t,n){return t.fold((function(){return L.some(n)}),(function(r){return Yn(at(r.getClientRects()),at(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r})).or(t)}))}),L.none())},Ax=function(t,e){return at(e.getClientRects()).bind((function(e){return Nx(t,e.left)}))},Dx=_(_x,Rc.isAbove,-1),Mx=_(_x,Rc.isBelow,1),Bx=_(Rx,-1,Dx),zx=_(Rx,1,Mx),Px=function(t){var e=function(e){return W(e,(function(e){var n=ec(e);return n.node=t,n}))};if(An(t))return e(t.getClientRects());if(Hn(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},Lx=function(t){return tt(t,Px)};!function(t){t[t.Up=-1]="Up",t[t.Down=1]="Down"}(kx||(kx={}));var Ix,Hx,Fx=function(t,e,n,r,o,i){var a=0,u=[],c=function(r){var i=Lx([r]);-1===t&&(i=i.reverse());for(var c=0;c<i.length;c++){var l=i[c];if(!n(l,s)){if(u.length>0&&e(l,Rt(u))&&a++,l.line=a,o(l))return!0;u.push(l)}}},s=Rt(i.getClientRects());if(!s)return u;var l=i.getNode();return c(l),function(t,e,n,r){for(;r=Qs(r,t,Go,e);)if(n(r))return}(t,r,c,l),u},Vx=_(Fx,kx.Up,oc,ic),jx=_(Fx,kx.Down,ic,oc),Ux=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},Wx=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},qx=$n,$x=Qs,Gx=function(t,e){return Math.abs(t.left-e)},Kx=function(t,e){return Math.abs(t.right-e)},Xx=function(t,e){return t>=e.left&&t<=e.right},Yx=function(t,e){return t>=e.top&&t<=e.bottom},Jx=function(t,e,n){return void 0===n&&(n=M),Et(t,(function(t,r){if(Xx(e,r))return n(r)?r:t;if(Xx(e,t))return n(t)?t:r;var o=Math.min(Gx(t,e),Kx(t,e)),i=Math.min(Gx(r,e),Kx(r,e));return i===o&&xt(r,"node")&&qx(r.node)||i<o?r:t}))},Qx=function(t,e,n,r,o){var i=$x(r,t,Go,e,!o);do{if(!i||n(i))return}while(i=$x(i,t,Go,e))},Zx=function(t,e,n){var r=Lx(function(t){return K(ct(t.getElementsByTagName("*")),Vs)}(t)),o=K(r,_(Yx,n)),i=function(t){return!Pn(t.node)&&!Kn(t.node)},a=Jx(o,e,i);if(a){var u=i(a);if((a=Jx(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=K(Lx([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),Qx(kx.Up,t,_(o,oc),e.node,n),Qx(kx.Down,t,_(o,ic),e.node,n),r}(t,a,u),e,i))&&Vs(a.node))return function(t,e){return{node:t.node,before:Gx(t,e)<Kx(t,e)}}(a,e)}return null},tC=function(t,e){t.selection.setRng(e),Wd(t,t.selection.getRng())},eC=function(t,e,n){return L.some(Aw(t,e,n))},nC=function(t,e,n,r,o,i){var a=e===Nc.Forwards,u=kl(t.getBody()),c=_(fl,a?u.next:u.prev),s=a?r:o;if(!n.collapsed){var l=uc(n);if(i(l))return _w(e,t,l,e===Nc.Backwards,!1)}var f=sl(e,t.getBody(),n);if(s(f))return Rw(t,f.getNode(!a));var d=rw(a,c(f)),m=Po(n);if(!d)return m?L.some(n):L.none();if(s(d))return _w(e,t,d.getNode(!a),a,!1);var g=c(d);return g&&s(g)&&dl(d,g)?_w(e,t,g.getNode(!a),a,!1):m?eC(t,d.toRange(),!1):L.none()},rC=function(t,e,n,r,o,i){var a=sl(e,t.getBody(),n),u=Rt(a.getClientRects()),c=e===kx.Down;if(!u)return L.none();var s,l=(c?jx:Vx)(t.getBody(),Ux(1),a),f=K(l,Wx(1)),d=u.left,m=Jx(f,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),h=Math.abs(d-m.right);return _w(e,t,m.node,g<h,!1)}if(s=r(a)?a.getNode():o(a)?a.getNode(!0):uc(n)){var p=function(t,e,n,r){var o,i,a,u,c=kl(e),s=[],l=0,f=function(t){return Rt(t.getClientRects())};1===t?(o=c.next,i=ic,a=oc,u=Rc.after(r)):(o=c.prev,i=oc,a=ic,u=Rc.before(r));var d=f(u);do{if(u.isVisible()){var m=f(u);if(!a(m,d)){s.length>0&&i(m,Rt(s))&&l++;var g=ec(m);if(g.position=u,g.line=l,n(g))return s;s.push(g)}}}while(u=o(u));return s}(e,t.getBody(),Ux(1),s),v=Jx(K(p,Wx(1)),d);if(v)return eC(t,v.position.toRange(),!1);if(v=Rt(K(p,Wx(0))))return eC(t,v.position.toRange(),!1)}return 0===f.length?oC(t,c).filter(c?o:r).map((function(e){return Aw(t,e.toRange(),!1)})):L.none()},oC=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=Rc.fromRangeEnd(n),i=Mx(r,o);return ut(i.positions)}o=Rc.fromRangeStart(n),i=Dx(r,o);return at(i.positions)},iC=function(t,e,n){return oC(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))},aC=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},uC=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},cC=function(t,e,n){return ex(e,n).map((function(e){return aC(t,e),n}))},sC=function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=Rc.fromRangeStart(t.selection.getRng());Rc.isTextPosition(n)&&!1===function(t){return No(t)||Ao(t)}(n)&&(aC(t,As(e.get(),n)),e.set(null))}},lC=function(t,e,n){return!!ws(t)&&function(t,e,n){var r=t.getBody(),o=Rc.fromRangeStart(t.selection.getRng()),i=_(tw,t);return wx(n,i,r,o).bind((function(n){return cC(t,e,n)}))}(t,e,n).isSome()},fC=function(t,e,n){return!!ws(e)&&Sx(t,e)},dC=function(t){var e=xu(null),n=_(tw,t);return t.on("NodeChange",(function(r){!ws(t)||Se.browser.isIE()&&r.initial||(function(t,e,n){var r=W(Iu(Ne.fromDom(e.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom})),o=K(r,t),i=K(n,t);q(rt(o,i),_(uC,!1)),q(rt(i,o),_(uC,!0))}(n,t.dom,r.parents),sC(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=K(r,t);q(o,(function(r){var o=Rc.fromRangeStart(e.selection.getRng());dx(t,e.getBody(),o).bind((function(t){return cC(e,n,t)}))}))}}(n,t,e,r.parents))})),e},mC=_(fC,!0),gC=_(fC,!1),hC=function(t,e,n){if(ws(t)){var r=oC(t,e).getOrThunk((function(){var n=t.selection.getRng();return e?Rc.fromRangeEnd(n):Rc.fromRangeStart(n)}));return dx(_(tw,t),t.getBody(),r).exists((function(e){var r=hx(e);return ex(n,r).exists((function(e){return aC(t,e),!0}))}))}return!1},pC=function(t,e){return function(n){return ex(e,n).exists((function(e){return aC(t,e),!0}))}},vC=function(t,e,n,r){var o=t.getBody(),i=_(tw,t);t.undoManager.ignore((function(){t.selection.setRng(function(t,e){var n=document.createRange();return n.setStart(t.container(),t.offset()),n.setEnd(e.container(),e.offset()),n}(n,r)),t.execCommand("Delete"),dx(i,o,Rc.fromRangeStart(t.selection.getRng())).map(px).map(pC(t,e))})),t.nodeChanged()},bC=function(t,e,n,r){var o=function(t,e){return Zs(e,t)||t}(t.getBody(),r.container()),i=_(tw,t),a=dx(i,o,r);return a.bind((function(t){return n?t.fold(T(L.some(px(t))),L.none,T(L.some(hx(t))),L.none):t.fold(L.none,T(L.some(hx(t))),L.none,T(L.some(px(t))))})).map(pC(t,e)).getOrThunk((function(){var u=Nl(n,o,r),c=u.bind((function(t){return dx(i,o,t)}));return Yn(a,c,(function(){return nw(i,o,r).exists((function(e){return!!function(t){return Yn(zl(t),Pl(t),(function(e,n){var r=rw(!0,e),o=rw(!1,n);return Ml(t,r).forall((function(t){return t.isEqual(o)}))})).getOr(!0)}(e)&&(hh(t,n,Ne.fromDom(e)),!0)}))})).orThunk((function(){return c.bind((function(o){return u.map((function(o){return n?vC(t,e,r,o):vC(t,e,o,r),!0}))}))})).getOr(!1)}))},yC=function(t,e,n){if(t.selection.isCollapsed()&&ws(t)){var r=Rc.fromRangeStart(t.selection.getRng());return bC(t,e,n,r)}return!1},wC=function(t){return 1===nn(t)},xC=function(t,e,n,r){var o=_(Mp,e),i=W(K(r,o),(function(t){return t.dom}));if(0===i.length)hh(e,t,n);else{var a=function(t,e){var n=Op(!1),r=Np(e,n.dom);return fn(Ne.fromDom(t),n),vn(Ne.fromDom(t)),Rc(r,0)}(n.dom,i);e.selection.setRng(a.toRange())}},CC=function(t,e){var n=Ne.fromDom(t.getBody()),r=Ne.fromDom(t.selection.getStart()),o=K(function(t,e){var n=Og(e,t);return Z(n,lo).fold(T(n),(function(t){return n.slice(0,t)}))}(n,r),wC);return ut(o).exists((function(n){var r,i=Rc.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return Yn(zl(n),Pl(n),(function(r,o){var i=rw(!0,r),a=rw(!1,o),u=rw(!1,e);return t?Ml(n,u).exists((function(t){return t.isEqual(a)&&e.isEqual(i)})):Bl(n,u).exists((function(t){return t.isEqual(i)&&e.isEqual(a)}))})).getOr(!0)}(e,i,n.dom)||(r=n,Il(r.dom)&&kp(r.dom)))&&(xC(e,t,n,o),!0)}))},SC=function(t,e){return!!t.selection.isCollapsed()&&CC(t,e)},kC=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),hh(t,e,Ne.fromDom(n)),!0},TC=function(t,e){return t.selection.isCollapsed()?function(t,e){var n=e?hg:pg,r=e?Nc.Forwards:Nc.Backwards,o=sl(r,t.getBody(),t.selection.getRng());return n(o)?kC(t,e,o.getNode(!e)):L.from(rw(e,o)).filter((function(t){return n(t)&&dl(o,t)})).exists((function(n){return kC(t,e,n.getNode(!e))}))}(t,e):function(t,e){var n=t.selection.getNode();return!!Kn(n)&&kC(t,e,n)}(t,e)},OC=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},EC=function(t,e){return(t||"table"===Le(e)?"margin":"padding")+("rtl"===ir(e,"direction")?"-right":"-left")},_C=function(t){var e=NC(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return et(e,(function(e){var n=EC(gs(t),e),r=ur(e,n).map(OC).getOr(0);return"false"!==t.dom.getContentEditable(e.dom)&&r>0}))}(t,e))},RC=function(t){return ho(t)||po(t)},NC=function(t){return K((e=t.selection.getSelectedBlocks(),W(e,Ne.fromDom)),(function(t){return!RC(t)&&!function(t){return Ge(t).exists(RC)}(t)&&Xr(t,(function(t){return qn(t.dom)||$n(t.dom)})).exists((function(t){return qn(t.dom)}))}));var e},AC=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=function(t){return t.getParam("indentation","40px","string")}(t),a=/[a-z%]+$/i.exec(i)[0],u=parseInt(i,10),c=gs(t),s=ns(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),q(NC(t),(function(t){!function(t,e,n,r,o,i){var a=EC(n,Ne.fromDom(i));if("outdent"===e){var u=Math.max(0,OC(i.style[a])-r);t.setStyle(i,a,u?u+o:"")}else u=OC(i.style[a])+r+o,t.setStyle(i,a,u)}(n,e,c,u,a,t.dom)}))},DC=function(t,e){if(t.selection.isCollapsed()&&_C(t)){var n=t.dom,r=t.selection.getRng(),o=Rc.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Ag(Ne.fromDom(i),o))return AC(t,"outdent"),!0}return!1},MC=function(t,e){t.getDoc().execCommand(e,!1,null)},BC=function(t,e){t.addCommand("delete",(function(){!function(t,e){DC(t)||Ww(t,!1)||zw(t,!1)||yC(t,e,!1)||xw(t,!1)||qh(t)||qw(t,!1)||TC(t,!1)||Tw(t)||SC(t,!1)||(MC(t,"Delete"),cw(t))}(t,e)})),t.addCommand("forwardDelete",(function(){!function(t,e){Ww(t,!0)||zw(t,!0)||yC(t,e,!0)||xw(t,!0)||qh(t)||qw(t,!0)||TC(t,!0)||Tw(t)||SC(t,!0)||MC(t,"ForwardDelete")}(t,e)}))},zC=function(t){return void 0===t.touches||1!==t.touches.length?L.none():L.some(t.touches[0])},PC=function(t){var e=Eu(),n=xu(!1),r=Ru((function(e){t.fire("longpress",Nt(Nt({},e),{type:"longpress"})),n.set(!0)}),400);t.on("touchstart",(function(t){zC(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.throttle(t),n.set(!1),e.set(i)}))}),!0),t.on("touchmove",(function(o){r.cancel(),zC(o).each((function(r){e.on((function(o){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(r,o)&&(e.clear(),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",Nt(Nt({},o),{type:"tap"}))}))}),!0)},LC=function(t,e){return wt(t,e.nodeName)},IC=function(t,e){return!!Hn(e)||!!An(e)&&(!LC(t,e)&&!Yl(e))},HC=function(t,e){if(Hn(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||LC(t,e.nextSibling)))return!0}return!1},FC=function(t){var e,n,r,o=t.dom,i=t.selection,a=t.schema,u=a.getBlockElements(),c=i.getStart(),s=t.getBody(),l=ns(t);if(c&&An(c)&&l){var f=s.nodeName.toLowerCase();if(a.isValidChild(f,l.toLowerCase())&&!function(t,e,n){return U(Tg(Ne.fromDom(n),Ne.fromDom(e)),(function(e){return LC(t,e.dom)}))}(u,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,h=d.endContainer,p=d.endOffset,v=wm(t);for(c=s.firstChild;c;)if(IC(u,c)){if(HC(u,c)){n=c,c=c.nextSibling,o.remove(n);continue}e||(e=o.create(l,rs(t)),c.parentNode.insertBefore(e,c),r=!0),n=c,c=c.nextSibling,e.appendChild(n)}else e=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(h,p),i.setRng(d),t.nodeChanged())}}},VC=function(t,e){e.hasAttribute("data-mce-caret")&&(zo(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},jC=function(t,e){var n=function(t){return Qr(Ne.fromDom(t.getBody()),"*[data-mce-caret]").map((function(t){return t.dom})).getOrNull()}(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void VC(t,n)):void(Ro(n)&&(VC(t,n),t.undoManager.add()))},UC=$n,WC=function(t,e,n){var r=kl(t.getBody()),o=_(fl,1===e?r.next:r.prev);if(n.collapsed&&function(t){return""!==ns(t)}(t)){var i=t.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(Rc.fromRangeStart(n))){var a=function(t){var e=t.dom.create(ns(t));return(!Se.ie||Se.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e}(t);1===e?t.$(i).after(a):t.$(i).before(a),t.selection.select(a,!0),t.selection.collapse()}}},qC=function(t,e){var n=e?Nc.Forwards:Nc.Backwards,r=t.selection.getRng();return function(t,e,n){return nC(e,t,n,yg,wg,UC)}(n,t,r).orThunk((function(){return WC(t,n,r),L.none()}))},$C=function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return rC(e,t,n,(function(t){return yg(t)||vg(t)}),(function(t){return wg(t)||bg(t)}),UC)}(n,t,r).orThunk((function(){return WC(t,n,r),L.none()}))},GC=function(t,e){return qC(t,e).exists((function(e){return tC(t,e),!0}))},KC=function(t,e){return $C(t,e).exists((function(e){return tC(t,e),!0}))},XC=function(t,e){return iC(t,e,e?wg:yg)},YC=function(t){return j(["figcaption"],Le(t))},JC=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},QC=function(t,e,n){n?gn(t,e):mn(t,e)},ZC=function(t,e,n,r){return""===e?function(t,e){var n=Ne.fromTag("br");return QC(t,n,e),JC(n)}(t,r):function(t,e,n,r){var o=Ne.fromTag(n),i=Ne.fromTag("br");return tr(o,r),gn(o,i),QC(t,o,e),JC(i)}(t,r,e,n)},tS=function(t,e,n){return e?function(t,e){return Mx(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return Dx(t,e).breakAt.isNone()}(t.dom,n)},eS=function(t,e){var n=Ne.fromDom(t.getBody()),r=Rc.fromRangeStart(t.selection.getRng()),o=ns(t),i=rs(t);return function(t,e){var n=_(Be,e);return Xr(Ne.fromDom(t.container()),lo,n).filter(YC)}(r,n).exists((function(){if(tS(n,e,r)){var a=ZC(n,o,i,e);return t.selection.setRng(a),!0}return!1}))},nS=function(t,e){return!!t.selection.isCollapsed()&&eS(t,e)},rS=function(t,e){return tt(function(t){return W(t,(function(t){return Nt({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:C},t)}))}(t),(function(t){return function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey}(t,e)?[t]:[]}))},oS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},iS=function(t,e){return Q(rS(t,e),(function(t){return t.action()}))},aS=function(t,e){var n=e?Nc.Forwards:Nc.Backwards,r=t.selection.getRng();return nC(t,n,r,hg,pg,Kn).exists((function(e){return tC(t,e),!0}))},uS=function(t,e){var n=e?1:-1,r=t.selection.getRng();return rC(t,n,r,hg,pg,Kn).exists((function(e){return tC(t,e),!0}))},cS=function(t,e){return iC(t,e,e?pg:hg)},sS=function(t,e,n,r,o){var i=Iu(Ne.fromDom(n),"td,th,caption").map((function(t){return t.dom}));return function(t,e,n){return Y(t,(function(t,r){return t.fold((function(){return L.some(r)}),(function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return L.some(i<o?r:t)}))}),L.none())}(K(function(t,e){return tt(e,(function(e){var n=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+2*e,bottom:t.bottom+2*e,width:t.width+e,height:t.height+e}}(ec(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]}))}(t,i),(function(t){return e(t,o)})),r,o).map((function(t){return t.cell}))},lS=_(sS,(function(t){return t.bottom}),(function(t,e){return t.y<e})),fS=_(sS,(function(t){return t.top}),(function(t,e){return t.y>e})),dS=function(t,e){return at(e.getClientRects()).bind((function(e){return lS(t,e.left,e.top)})).bind((function(t){return Ax(Pl(n=t).map((function(t){return Dx(n,t).positions.concat(t)})).getOr([]),e);var n}))},mS=function(t,e){return ut(e.getClientRects()).bind((function(e){return fS(t,e.left,e.top)})).bind((function(t){return Ax(zl(n=t).map((function(t){return[t].concat(Mx(n,t).positions)})).getOr([]),e);var n}))},gS=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===xx.Wrap&&0===t.positions.length}(r)||!Un(n.getNode())&&function(t){return t.breakType===xx.Br&&1===t.positions.length}(r)?!function(t,e,n){return n.breakAt.exists((function(n){return t(e,n).breakAt.isSome()}))}(t,e,r):r.breakAt.isNone()},hS=_(gS,Dx),pS=_(gS,Mx),vS=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;return!(!Hs()||!function(t,e,n){var r=Rc.fromRangeStart(e);return Dl(!t,n).exists((function(t){return t.isEqual(r)}))}(e,o,n))&&(_w(i,t,n,!e,!1).each((function(e){tC(t,e)})),!0)},bS=function(t,e){var n=e.getNode(t);return An(n)&&"TABLE"===n.nodeName?L.some(n):L.none()},yS=function(t,e,n){var r=bS(!!e,n),o=!1===e;r.fold((function(){return tC(t,n.toRange())}),(function(r){return Dl(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return tC(t,n.toRange())}),(function(o){return function(t,e,n,r){var o=ns(e);o?e.undoManager.transact((function(){var r=Ne.fromTag(o);tr(r,rs(e)),gn(r,Ne.fromTag("br")),t?dn(Ne.fromDom(n),r):fn(Ne.fromDom(n),r);var i=e.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),tC(e,i)})):tC(e,r.toRange())}(e,t,r,n)}))}))},wS=function(t,e,n,r){var o=t.selection.getRng(),i=Rc.fromRangeStart(o),a=t.getBody();if(!e&&hS(r,i)){var u=function(t,e,n){return dS(e,n).orThunk((function(){return at(n.getClientRects()).bind((function(n){return Nx(Bx(t,Rc.before(e)),n.left)}))})).getOr(Rc.before(e))}(a,n,i);return yS(t,e,u),!0}if(e&&pS(r,i)){u=function(t,e,n){return mS(e,n).orThunk((function(){return at(n.getClientRects()).bind((function(n){return Nx(zx(t,Rc.after(e)),n.left)}))})).getOr(Rc.after(e))}(a,n,i);return yS(t,e,u),!0}return!1},xS=function(t,e,n){return L.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return L.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)},CS=function(t,e){return xS(t,e,vS)},SS=function(t,e){return xS(t,e,wS)},kS=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=ge().os;iS([{keyCode:id.RIGHT,action:oS(GC,t,!0)},{keyCode:id.LEFT,action:oS(GC,t,!1)},{keyCode:id.UP,action:oS(KC,t,!1)},{keyCode:id.DOWN,action:oS(KC,t,!0)},{keyCode:id.RIGHT,action:oS(CS,t,!0)},{keyCode:id.LEFT,action:oS(CS,t,!1)},{keyCode:id.UP,action:oS(SS,t,!1)},{keyCode:id.DOWN,action:oS(SS,t,!0)},{keyCode:id.RIGHT,action:oS(aS,t,!0)},{keyCode:id.LEFT,action:oS(aS,t,!1)},{keyCode:id.UP,action:oS(uS,t,!1)},{keyCode:id.DOWN,action:oS(uS,t,!0)},{keyCode:id.RIGHT,action:oS(lC,t,e,!0)},{keyCode:id.LEFT,action:oS(lC,t,e,!1)},{keyCode:id.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:oS(mC,t,e)},{keyCode:id.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:oS(gC,t,e)},{keyCode:id.UP,action:oS(nS,t,!1)},{keyCode:id.DOWN,action:oS(nS,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},TS=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){iS([{keyCode:id.BACKSPACE,action:oS(DC,t,!1)},{keyCode:id.BACKSPACE,action:oS(Ww,t,!1)},{keyCode:id.DELETE,action:oS(Ww,t,!0)},{keyCode:id.BACKSPACE,action:oS(zw,t,!1)},{keyCode:id.DELETE,action:oS(zw,t,!0)},{keyCode:id.BACKSPACE,action:oS(yC,t,e,!1)},{keyCode:id.DELETE,action:oS(yC,t,e,!0)},{keyCode:id.BACKSPACE,action:oS(qh,t,!1)},{keyCode:id.DELETE,action:oS(qh,t,!0)},{keyCode:id.BACKSPACE,action:oS(qw,t,!1)},{keyCode:id.DELETE,action:oS(qw,t,!0)},{keyCode:id.BACKSPACE,action:oS(TC,t,!1)},{keyCode:id.DELETE,action:oS(TC,t,!0)},{keyCode:id.BACKSPACE,action:oS(Tw,t,!1)},{keyCode:id.DELETE,action:oS(Tw,t,!0)},{keyCode:id.BACKSPACE,action:oS(xw,t,!1)},{keyCode:id.DELETE,action:oS(xw,t,!0)},{keyCode:id.BACKSPACE,action:oS(SC,t,!1)},{keyCode:id.DELETE,action:oS(SC,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&function(t,e){iS([{keyCode:id.BACKSPACE,action:oS(Uw,t)},{keyCode:id.DELETE,action:oS(Uw,t)}],e)}(t,e)}))},OS=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var a=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild);a&&/^(UL|OL|DL)$/.test(a.nodeName)&&e.insertBefore(o.doc.createTextNode(wo),e.firstChild)}var u=o.createRng();if(e.normalize(),e.hasChildNodes()){for(var c=new uo(e,e);n=c.current();){if(Hn(n)){u.setStart(n,0),u.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}r=n,n=c.next()}n||(u.setStart(r,0),u.setEnd(r,0))}else Un(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(u.setStartBefore(e),u.setEndBefore(e)):(u.setStartAfter(e),u.setEndAfter(e)):(u.setStart(e,0),u.setEnd(e,0));t.selection.setRng(u),Wd(t,u)}},ES=function(t){return L.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},_S=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},RS=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},NS=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},AS=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!An(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},DS=function(t,e,n,r,o){var i=t.dom,a=t.selection.getRng();if(n!==t.getBody()){var u;RS(u=n)&&RS(u.parentNode)&&(o="LI");var c=o?e(o):i.create("BR");if(AS(n,r,!0)&&AS(n,r,!1))if(_S(n,"LI")){var s=NS(n);i.insertAfter(c,s),!function(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.firstChild)===t}(n)?i.remove(n):i.remove(s)}else i.replace(c,n);else if(AS(n,r,!0))_S(n,"LI")?(i.insertAfter(c,NS(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n),i.remove(r);else if(AS(n,r,!1))i.insertAfter(c,NS(n)),i.remove(r);else{n=NS(n);var l=a.cloneRange();l.setStartAfter(r),l.setEndAfter(n);var f=l.extractContents();"LI"===o&&function(t,e){return t.firstChild&&t.firstChild.nodeName===e}(f,"LI")?(c=f.firstChild,i.insertAfter(f,n)):(i.insertAfter(f,n),i.insertAfter(c,n)),i.remove(r)}OS(t,c)}},MS=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},BS=function(t){t.innerHTML='<br data-mce-bogus="1">'},zS=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},PS=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},LS=function(t,e,n){return!1===Hn(e)?n:t?1===n&&e.data.charAt(n-1)===xo?0:n:n===e.data.length-1&&e.data.charAt(n)===xo?e.data.length:n},IS=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},HS=function(t,e){var n=ns(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;L.from(n.style).map(r.parseStyle).each((function(t){var n=cr(Ne.fromDom(e)),o=Nt(Nt({},n),t);r.setStyles(e,o)}));var o=L.from(n.class).map((function(t){return t.split(/\s+/)})),i=L.from(e.className).map((function(t){return K(t.split(/\s+/),(function(t){return""!==t}))}));Yn(o,i,(function(t,n){var o=K(n,(function(e){return!j(t,e)})),i=At(At([],t,!0),o,!0);r.setAttrib(e,"class",i.join(" "))}));var a=["style","class"],u=vt(n,(function(t,e){return!j(a,e)}));r.setAttribs(e,u)}(t,e,rs(t))},FS=function(t,e){var n,r,o,i,a,u,c,s,l,f,d=t.dom,m=t.schema,g=m.getNonEmptyElements(),h=t.selection.getRng(),p=function(e){var n,o,a,u=r,c=m.getTextInlineElements();if(a=n=e||"TABLE"===s||"HR"===s?d.create(e||l):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[u.nodeName]){if(Il(u)||Yl(u))continue;o=u.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(a=o,n.appendChild(o))}}while((u=u.parentNode)&&u!==x);return HS(t,n),BS(a),n},v=function(t){var e,n,a=LS(t,r,o);if(Hn(r)&&(t?a>0:a<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&An(r)&&r===i.firstChild)return!0;if(zS(r,"TABLE")||zS(r,"HR"))return f&&!t||!f&&t;var u=new uo(r,i);for(Hn(r)&&(t&&0===a?u.prev():t||a!==r.nodeValue.length||u.next());e=u.current();){if(An(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),g[n]&&"br"!==n))return!1}else if(Hn(e)&&!Xo(e.nodeValue))return!1;t?u.prev():u.next()}return!0},b=function(){a=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==C?p(l):p(),function(t){return t.getParam("end_container_on_empty_block",!1)}(t)&&PS(d,c)&&d.isEmpty(i)?a=d.split(c,i):d.insertAfter(a,i),OS(t,a)};yd(d,h).each((function(t){h.setStart(t.startContainer,t.startOffset),h.setEnd(t.endContainer,t.endOffset)})),r=h.startContainer,o=h.startOffset,l=ns(t);var y=!(!e||!e.shiftKey),w=!(!e||!e.ctrlKey);An(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&Hn(r)?r.nodeValue.length:0);var x=IS(d,r);if(x){(l&&!y||!l&&y)&&(r=function(t,e,n,r,o){var i,a,u,c,s,l,f=e||"P",d=t.dom,m=IS(d,r);if(!(a=d.getParent(r,d.isBlock))||!PS(d,a)){if(l=(a=a||m)===t.getBody()||function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)}(a)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=d.create(f),HS(t,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==a;)c=c.parentNode;for(;c&&!d.isBlock(c);)u=c,c=c.previousSibling;if(u&&t.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),HS(t,i),u.parentNode.insertBefore(i,u),c=u;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(t,l,h,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var C=c?c.nodeName.toUpperCase():"";"LI"!==C||w||(i=c,c=c.parentNode,s=C),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?DS(t,p,c,i,l):l&&i===t.getBody()||(l=l||"P",Oo(i)?(a=zo(i),d.isEmpty(i)&&BS(i),HS(t,a),OS(t,a)):v()?b():v(!0)?(a=i.parentNode.insertBefore(p(),i),OS(t,zS(i,"HR")?a:i)):((n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,LS(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,LS(!1,t.endContainer,t.endOffset)),e}(h).cloneRange()).setEndAfter(i),function(t){q(Lu(Ne.fromDom(t),Ve),(function(t){var e=t.dom;e.nodeValue=So(e.nodeValue)}))}(u=n.extractContents()),function(t){do{Hn(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)}(u),a=u.firstChild,d.insertAfter(u,i),function(t,e,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;An(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)(!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||MS(t,o))&&t.remove(o)}}(d,g,a),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(d,i),d.isEmpty(i)&&BS(i),a.normalize(),d.isEmpty(a)?(d.remove(a),b()):(HS(t,a),OS(t,a))),d.setAttrib(a,"id",""),t.fire("NewBlock",{newBlock:a}))}},VS=function(t,e,n){var r=t.dom.createRng();n?(r.setStartBefore(e),r.setEndBefore(e)):(r.setStartAfter(e),r.setEndAfter(e)),t.selection.setRng(r),Wd(t,r)},jS=function(t,e){var n,r,o=t.selection,i=t.dom,a=o.getRng();yd(i,a).each((function(t){a.setStart(t.startContainer,t.startOffset),a.setEnd(t.endContainer,t.endOffset)}));var u=a.startOffset,c=a.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=u>c.childNodes.length-1;c=c.childNodes[Math.min(u,c.childNodes.length-1)]||c,u=s&&3===c.nodeType?c.nodeValue.length:0}var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&u>=c.nodeValue.length&&(function(t,e,n){for(var r,o=new uo(e,n),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(t.schema,c,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),Dc(i,a,n),VS(t,n,r),t.undoManager.add()},US=function(t,e){var n=Ne.fromTag("br");fn(Ne.fromDom(e),n),t.undoManager.add()},WS=function(t,e){qS(t.getBody(),e)||dn(Ne.fromDom(e),Ne.fromTag("br"));var n=Ne.fromTag("br");dn(Ne.fromDom(e),n),VS(t,n.dom,!1),t.undoManager.add()},qS=function(t,e){return n=Rc.after(e),!!Un(n.getNode())||Ml(t,Rc.after(e)).map((function(t){return Un(t.getNode())})).getOr(!1);var n},$S=function(t){return t&&"A"===t.nodeName&&"href"in t},GS=function(t){return t.fold(D,$S,$S,D)},KS=function(t,e){e.fold(C,_(US,t),_(WS,t),C)},XS=function(t,e){var n=function(t){var e=_(tw,t),n=Rc.fromRangeStart(t.selection.getRng());return dx(e,t.getBody(),n).filter(GS)}(t);n.isSome()?n.each(_(KS,t)):jS(t,e)},YS=function(t,e){return ES(t).filter((function(t){return e.length>0&&De(Ne.fromDom(t),e)})).isSome()},JS=Tr([{br:[]},{block:[]},{none:[]}]),QS=function(t,e){return function(t){return YS(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},ZS=function(t){return function(e,n){return""===ns(e)===t}},tk=function(t){return function(e,n){return function(t){return ES(t).filter((function(t){return po(Ne.fromDom(t))})).isSome()}(e)===t}},ek=function(t,e){return function(n,r){return function(t){return ES(t).fold(T(""),(function(t){return t.nodeName.toUpperCase()}))}(n)===t.toUpperCase()===e}},nk=function(t){return ek("pre",t)},rk=function(t){return function(e,n){return function(t){return t.getParam("br_in_pre",!0)}(e)===t}},ok=function(t,e){return function(t){return YS(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},ik=function(t,e){return e},ak=function(t){var e=ns(t),n=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},uk=function(t,e){return function(n,r){return Y(t,(function(t,e){return t&&e(n,r)}),!0)?L.some(e):L.none()}},ck=function(t,e){(function(t,e){return nx([uk([QS],JS.none()),uk([ek("summary",!0)],JS.br()),uk([nk(!0),rk(!1),ik],JS.br()),uk([nk(!0),rk(!1)],JS.block()),uk([nk(!0),rk(!0),ik],JS.block()),uk([nk(!0),rk(!0)],JS.br()),uk([tk(!0),ik],JS.br()),uk([tk(!0)],JS.block()),uk([ZS(!0),ik,ak],JS.block()),uk([ZS(!0)],JS.br()),uk([ok],JS.br()),uk([ZS(!1),ik],JS.br()),uk([ak],JS.block())],[t,!(!e||!e.shiftKey)]).getOr(JS.none())})(t,e).fold((function(){XS(t,e)}),(function(){FS(t,e)}),C)},sk=function(t){t.on("keydown",(function(e){e.keyCode===id.ENTER&&function(t,e){var n;e.isDefaultPrevented()||(e.preventDefault(),(n=t.undoManager).typing&&(n.typing=!1,n.add()),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),ck(t,e)})))}(t,e)}))},lk=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){iS([{keyCode:id.END,action:oS(XC,t,!0)},{keyCode:id.HOME,action:oS(XC,t,!1)},{keyCode:id.END,action:oS(cS,t,!0)},{keyCode:id.HOME,action:oS(cS,t,!1)},{keyCode:id.END,action:oS(hC,t,!0,e)},{keyCode:id.HOME,action:oS(hC,t,!1,e)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},fk=ge().browser,dk=function(t){!function(t){var e=_u((function(){t.composing||th(t)}),0);fk.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))}(t),t.on("input",(function(e){!1===e.isComposing&&th(t)}))},mk=ge(),gk=function(t){return t.stopImmediatePropagation()},hk=function(t){return t.keyCode===id.PAGE_UP||t.keyCode===id.PAGE_DOWN},pk=function(t,e,n){n&&!t.get()?e.on("NodeChange",gk,!0):!n&&t.get()&&e.off("NodeChange",gk),t.set(n)},vk=function(t,e){if(!mk.os.isOSX()){var n=xu(!1);t.on("keydown",(function(e){hk(e)&&pk(n,t,!0)})),t.on("keyup",(function(r){!1===r.isDefaultPrevented()&&function(t,e,n){iS([{keyCode:id.PAGE_UP,action:oS(hC,t,!1,e)},{keyCode:id.PAGE_DOWN,action:oS(hC,t,!0,e)}],n)}(t,e,r),hk(r)&&n.get()&&(pk(n,t,!1),t.nodeChanged())}))}},bk=function(t,e){var n=e.container(),r=e.offset();return Hn(n)?(n.insertData(r,t),L.some(Rc(n,r+t.length))):ll(e).map((function(n){var r=Ne.fromText(t);return e.isAtEnd()?dn(n,r):fn(n,r),Rc(r.dom,t.length)}))},yk=_(bk,wo),wk=_(bk," "),xk=function(t,e){return function(n){return function(t,e){return!qg(e)&&($g(t,e)||Ug(t,e)||Wg(t,e))}(t,n)?yk(e):wk(e)}},Ck=function(t){var e=Rc.fromRangeStart(t.selection.getRng()),n=Ne.fromDom(t.getBody());if(t.selection.isCollapsed()){var r=_(tw,t),o=Rc.fromRangeStart(t.selection.getRng());return dx(r,t.getBody(),o).bind(function(t){return function(e){return e.fold((function(e){return Bl(t.dom,Rc.before(e))}),(function(t){return zl(t)}),(function(t){return Pl(t)}),(function(e){return Ml(t.dom,Rc.after(e))}))}}(n)).bind(xk(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},Sk=function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){iS([{keyCode:id.SPACEBAR,action:oS(Ck,t)}],e).each((function(t){e.preventDefault()}))}(t,e)}))},kk=function(t){var e=dC(t);return function(t){t.on("keyup compositionstart",_(jC,t))}(t),kS(t,e),TS(t,e),sk(t),Sk(t),dk(t),lk(t,e),vk(t,e),e},Tk=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&ld(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!Se.range&&t.selection.isCollapsed()||Uf(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&Uf(t)&&("IMG"===t.selection.getNode().nodeName?oo.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){if(t===r)return!0;n.push(t)})),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),Ok=function(t){!function(t){t.on("click",(function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}))}(t),function(t){t.parser.addNodeFilter("details",(function(t){q(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),t.serializer.addNodeFilter("details",(function(t){q(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",d(e)?e:null),t.attr("data-mce-open",null)}))}))}(t)},Ek=function(t){return An(t)&&go(Ne.fromDom(t))},_k=function(t){t.on("click",(function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=Rc.fromRangeStart(e),r=Rc.fromRangeEnd(e);if(Rc.isElementPosition(n)){var o=n.container();Ek(o)&&zl(o).each((function(t){return e.setStart(t.container(),t.offset())}))}Rc.isElementPosition(r)&&(o=n.container(),Ek(o)&&Pl(o).each((function(t){return e.setEnd(t.container(),t.offset())})));t.selection.setRng(Gh(e))}(t)}))},Rk=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},Nk=function(t,e){return n=function(t){return t.inline?Rk(t.getBody()):{left:0,top:0}}(t),r=function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}}(t),{pageX:(o=function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=Rk(t.getContentAreaContainer()),r=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o}(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}}(t,e)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o},Ak=$n,Dk=qn,Mk=function(t,e,n,r){var o=t.dom,i=e.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var a=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(a,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),a.appendChild(i),a},Bk=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},zk=function(t,e){return function(n){if(function(t){return 0===t.button}(n)){var r=Q(e.dom.getParents(n.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(Ak,Dk)).getOr(null);if(u=e.getBody(),Ak(c=r)&&c!==u){var o=e.dom.getPos(r),i=e.getBody(),a=e.getDoc().documentElement;t.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(e.inline?i.scrollWidth:a.offsetWidth)-2,maxY:(e.inline?i.scrollHeight:a.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:Mk(e,r,r.offsetWidth,r.offsetHeight)})}}var u,c}},Pk=function(t,e){return function(n){t.on((function(t){if(t.dragging){if(function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!Ak(e)}(e,(a=e.selection,3===(u=a.getSel().getRangeAt(0).startContainer).nodeType?u.parentNode:u),t.element)){var r=(o=t.element,(i=o.cloneNode(!0)).removeAttribute("data-mce-selected"),i);e.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||e.undoManager.transact((function(){Bk(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()}))}e.fire("dragend")}var o,i,a,u})),Lk(t)}},Lk=function(t){t.on((function(t){Bk(t.ghost)})),t.clear()},Ik=function(t){var e=Eu(),n=pu.DOM,r=document,o=zk(e,t),i=function(t,e){var n=oo.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return e.on("remove",n.stop),function(r){return t.on((function(t){var o,i,a=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(!t.dragging&&a>10){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var u=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}}(t,Nk(e,r));o=t.ghost,i=e.getBody(),o.parentNode!==i&&i.appendChild(o),function(t,e,n,r,o,i){var a=0,u=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(a=e.pageX+n-o),e.pageY+r>i&&(u=e.pageY+r-i),t.style.width=n-a+"px",t.style.height=r-u+"px"}(t.ghost,u,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}))}}(e,t),a=Pk(e,t),u=function(t,e){return function(){t.on((function(t){t.dragging&&e.fire("dragend")})),Lk(t)}}(e,t);t.on("mousedown",o),t.on("mousemove",i),t.on("mouseup",a),n.bind(r,"mousemove",i),n.bind(r,"mouseup",u),t.on("remove",(function(){n.unbind(r,"mousemove",i),n.unbind(r,"mouseup",u)})),t.on("keydown",(function(t){t.keyCode===id.ESC&&u()}))},Hk=function(t){Ik(t),function(t){t.on("drop",(function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(Ak(n)||"false"===t.dom.getContentEditableParent(n))&&e.preventDefault()}))}(t),function(t){return t.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var e=function(e){if(!e.isDefaultPrevented()){var n=e.dataTransfer;n&&(j(n.types,"Files")||n.files.length>0)&&(e.preventDefault(),"drop"===e.type&&ky(t,"Dropped file type is not supported"))}},n=function(n){mm(t,n.target)&&e(n)},r=function(){var r=pu.DOM,o=t.dom,i=document,a=t.inline?t.getBody():t.getDoc(),u=["drop","dragover"];q(u,(function(t){r.bind(i,t,n),o.bind(a,t,e)})),t.on("remove",(function(){q(u,(function(t){r.unbind(i,t,n),o.unbind(a,t,e)}))}))};t.on("init",(function(){oo.setEditorTimeout(t,r,0)}))}(t)},Fk=qn,Vk=$n,jk=function(t,e){return td(t.getBody(),e)},Uk=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),a=Is(t,i,o,(function(){return wm(t)})),u="sel-"+r.uniqueId(),c="data-mce-selected",s=function(t){return t!==i&&(Vk(t)||Kn(t))&&r.isChildOf(t,i)},l=function(t){return yg(t)||wg(t)||hg(t)||pg(t)},f=function(t){t&&n.setRng(t)},d=n.getRng,m=function(e,r,o,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:r,direction:e,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===e),a.show(o,r))},g=function(t){return _o(t)||Mo(t)||Bo(t)},h=function(t){return g(t.startContainer)||g(t.endContainer)},p=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,a=e.startOffset,u=e.endContainer,c=e.endOffset;return wt(n,i.nodeName.toLowerCase())?0===a?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,a),wt(n,u.nodeName.toLowerCase())?0===c?o.setEndBefore(u):o.setEndAfter(u):o.setEnd(u,c),o},v=function(o){var i=o.cloneNode(!0),a=t.fire("ObjectSelected",{target:o,targetClone:i});if(a.isDefaultPrevented())return null;var s=function(e,o,i){var a=t.$,c=Qr(Ne.fromDom(t.getBody()),"#"+u).fold((function(){return a([])}),(function(t){return a([t.dom])}));0===c.length&&(c=a('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",u)).appendTo(t.getBody());var s=r.createRng();o===i&&Se.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(wo).append(o).append(wo),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(e,t.getBody()).y}),c[0].focus();var l=n.getSel();return l.removeAllRanges(),l.addRange(s),s}(o,a.targetClone,i),l=Ne.fromDom(o);return q(Iu(Ne.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){Be(l,t)||rr(t,c)})),r.getAttrib(o,c)||o.setAttribute(c,"1"),e=o,x(),s},y=function(t,e){if(!t)return null;if(t.collapsed){if(!h(t)){var n=e?1:-1,o=sl(n,i,t),a=o.getNode(!e);if(Vs(a))return m(n,a,!!e&&!o.isAtEnd(),!1);var u=o.getNode(e);if(Vs(u))return m(n,u,!e&&!o.isAtEnd(),!1)}return null}var c=t.startContainer,l=t.startOffset,f=t.endOffset;if(3===c.nodeType&&0===l&&Vk(c.parentNode)&&(c=c.parentNode,l=r.nodeIndex(c),c=c.parentNode),1!==c.nodeType)return null;if(f===l+1&&c===t.endContainer){var d=c.childNodes[l];if(s(d))return v(d)}return null},w=function(){e&&e.removeAttribute(c),Qr(Ne.fromDom(t.getBody()),"#"+u).each(vn),e=null},x=function(){a.hide()};return Se.ceFalse&&!Jv(t)&&function(){t.on("mouseup",(function(e){var n=d();n.collapsed&&vy(t,e.clientX,e.clientY)&&Nw(t,n,!1).each(f)})),t.on("click",(function(e){var o=jk(t,e.target);o&&(Vk(o)&&(e.preventDefault(),t.focus()),Fk(o)&&r.isChildOf(o,n.getNode())&&w())})),t.on("blur NewBlock",w),t.on("ResizeWindow FullscreenStateChanged",a.reposition);var c=function(e,n){var i,a,u=r.getParent(e,o),c=r.getParent(n,o);return!b(u)&&(!(e===c||!r.isChildOf(u,c)||!1!==Vk(jk(t,u)))||!r.isChildOf(c,u)&&(i=u,a=c,!(r.getParent(i,o)===r.getParent(a,o)))&&function(t){var e=t.firstChild;if(b(e))return!1;var n=Rc.before(e);if(Un(n.getNode())&&1===t.childNodes.length)return!l(n);var r=kl(t).next(n);return r&&!l(r)}(u))};t.on("tap",(function(e){var n=e.target,r=jk(t,n);Vk(r)?(e.preventDefault(),Rw(t,r).each(y)):s(n)&&Rw(t,n).each(y)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==vy(t,e.clientX,e.clientY)){var a=jk(t,o);if(a)Vk(a)?(e.preventDefault(),Rw(t,a).each(y)):(w(),Fk(a)&&e.shiftKey||ed(e.clientX,e.clientY,n.getRng())||(x(),n.placeCaretAt(e.clientX,e.clientY)));else if(s(o))Rw(t,o).each(y);else if(!1===Vs(o)){w(),x();var u=Zx(i,e.clientX,e.clientY);if(u&&!c(o,u.node)){e.preventDefault();var l=m(1,u.node,u.before,!1);f(l),t.getBody().focus()}}}})),t.on("keypress",(function(t){id.modifierPressed(t)||Vk(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=p(t.range);var e=y(t.range,t.forward);e&&(t.range=e)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;h(n)||"mcepastebin"===o.id||x(),e=o,r.hasClass(e,"mce-offscreen-selection")||w()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!Se.ie){var o=(e=r.get(u))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),Hk(t),function(t){var e=_u((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=Aw(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(Kn(n)){var r=td(t.getBody(),n),o=$n(r)?r:n;t.selection.getNode()!==o&&Rw(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:m,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(zo(t),f(d()),n.scrollIntoView(t))},hideFakeCaret:x,destroy:function(){a.destroy(),e=null}}},Wk=function(t){var e,n,r=_e.each,o=id.BACKSPACE,i=id.DELETE,a=t.dom,u=t.selection,c=t.parser,s=Se.gecko,l=Se.ie,f=Se.webkit,d="data:text/mce-internal,",m=l?"Text":"URL",g=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},h=function(t){return t.isDefaultPrevented()},p=function(){var e=function(t){var e=a.create("body"),n=t.cloneContents();return e.appendChild(n),u.serializer.serialize(e,{format:"html"})};t.on("keydown",(function(n){var r,u,c=n.keyCode;if(!h(n)&&(c===i||c===o)){if(r=t.selection.isCollapsed(),u=t.getBody(),r&&!a.isEmpty(u))return;if(!r&&!function(n){var r=e(n),o=a.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),u.firstChild&&a.isBlock(u.firstChild)?t.selection.setCursorLocation(u.firstChild,0):t.selection.setCursorLocation(u,0),t.nodeChanged()}}))},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},b=function(){t.inline||a.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=u.getRng(),t.getBody().focus(),"mousedown"===e.type){if(_o(n.startContainer))return;u.placeCaretAt(e.clientX,e.clientY)}else u.setRng(n)}))},y=function(){Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!h(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),oo.setEditorTimeout(t,(function(){n.focus()}))}}))},w=function(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),u.select(n))}))},x=function(){t.on("keydown",(function(t){if(!h(t)&&t.keyCode===o&&u.isCollapsed()&&0===u.getRng().startOffset){var e=u.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},S=function(){(function(t){return t.getParam("readonly")})(t)||t.on("BeforeExecCommand mousedown",(function(){g("StyleWithCSS",!1),g("enableInlineTableEditing",!1),ps(t)||g("enableObjectResizing",!1)}))},k=function(){t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||r(a.select("a"),(function(t){var e=t.parentNode,n=a.getRoot();if(e.lastChild===t){for(;e&&!a.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}a.add(e,"br",{"data-mce-bogus":1})}}))}))},T=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},O=function(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))},E=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(Se.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},_=function(){Se.mac&&t.on("keydown",(function(e){!id.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}))},R=function(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},N=function(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))},A=function(){t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&u.select(e.target),(n=t.selection.getContent()).length>0&&(r=d+escape(t.id)+","+escape(n),e.dataTransfer.setData(m,r)))}(e)})),t.on("drop",(function(e){if(!h(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(m))&&e.indexOf(d)>=0?(e=e.substr(d.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=sd(e.x,e.y,t.getDoc());u.setRng(r),o=n.html,i=!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):t.execCommand("mceInsertContent",!1,o)}}var o,i}))},D=C;return Jv(t)?(f&&(b(),w(),N(),v(),Se.iOS&&(O(),E(),R())),s&&(y(),S(),T(),_())):(t.on("keydown",(function(e){var n,r;if(!h(e)&&e.keyCode===id.BACKSPACE){var o=(n=u.getRng()).startContainer,i=n.startOffset,c=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==c;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),u.setRng(n))}}})),p(),Se.windowsPhone||t.on("keyup focusin mouseup",(function(t){id.modifierPressed(t)||u.normalize()}),!0),f&&(b(),w(),ns(t)&&t.on("init",(function(){g("DefaultParagraphSeparator",ns(t))})),N(),x(),c.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),Se.iOS?(O(),E(),R()):v()),Se.ie>=11&&(E(),x()),Se.ie&&(v(),g("AutoUrlDetect",!1),A()),s&&(t.on("keydown",(function(e){if(!h(e)&&e.keyCode===o){if(!t.getBody().getElementsByTagName("hr").length)return;if(u.isCollapsed()&&0===u.getRng().startOffset){var n=u.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),e.preventDefault())}}})),y(),e=function(){var e=a.getAttribs(u.getStart().cloneNode(!1));return function(){var n=u.getStart();n!==t.getBody()&&(a.setAttrib(n,"style",null),r(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},n=function(){return!u.isCollapsed()&&a.getParent(u.getStart(),a.isBlock)!==a.getParent(u.getEnd(),a.isBlock)},t.on("keypress",(function(r){var o;if(!h(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=e(),t.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),a.bind(t.getDoc(),"cut",(function(r){var o;!h(r)&&n()&&(o=e(),oo.setEditorTimeout(t,(function(){o()})))})),S(),k(),T(),_(),x())),{refreshContentEditable:D,isHidden:function(){if(!s||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},qk=pu.DOM,$k=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},Gk=function(t){return vt(t,(function(t){return!1===v(t)}))},Kk=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Gk({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:$k(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},Xk=function(t){var e=t.dom.getRoot();t.inline||Uf(t)&&t.selection.getStart(!0)!==e||zl(e).each((function(e){var n=e.getNode(),r=Pn(n)?zl(n).getOr(e):e;Se.browser.isIE()?function(t,e){var n=Ne.fromDom(t.getBody()),r=(rm(t)?L.from(e):L.none()).map(om).filter(nm(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},Yk=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),Xk(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&oo.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},Jk=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},Qk=function(t){var e=Jk(t),n=hs(t),r=t.contentCSS,o=function(){e.unloadAll(r),t.inline||t.ui.styleSheetLoader.unloadAll(n)},i=function(){t.removed?o():t.on("remove",o)};if(t.contentStyles.length>0){var a="";_e.each(t.contentStyles,(function(t){a+=t+"\r\n"})),t.dom.addStyle(a)}var u=to.all(function(t,e,n){var r=[new to((function(n,r){return Jk(t).loadAll(e,n,r)}))];return t.inline?r:r.concat([new to((function(e,r){return t.ui.styleSheetLoader.loadAll(n,e,r)}))])}(t,r,n)).then(i).catch(i);return t.settings.content_style&&function(t,e){var n=Ne.fromDom(t.getBody()),r=cn(un(n)),o=Ne.fromTag("style");Zn(o,"type","text/css"),gn(o,Ne.fromText(e)),gn(r,o),t.on("remove",(function(){vn(o)}))}(t,t.settings.content_style),u},Zk=function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();!function(t){t.fire("PreInit")}(t),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,qk.setAttrib(r,"spellcheck","false")),t.quirks=Wk(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",Tu.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){_e.each(e.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type}))},tT=function(t){!0!==t.removed&&(!function(t){Jv(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),Yk(t))},eT=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(qk.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===qk.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=Iy(t),t.schema=Ri(n),t.dom=pu(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:fs(t),referrerPolicy:ds(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=_b(Kk(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,a=t.dom,u="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(u)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(u,o),r.attr(n,o)):"tabindex"===n?(r.attr(u,o),r.attr(n,null)):r.attr(u,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Mm("br",1)).shortEnded=!0)}})),e}(t),t.serializer=Mb(function(t){var e=t.settings;return Nt(Nt({},Kk(t)),Gk({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before,block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements}))}(t),t),t.selection=lb(t.dom,t.getWin(),t.serializer,t),t.annotator=Qf(t),t.formatter=qy(t),t.undoManager=Gy(t),t._nodeChangeDispatcher=new Tk(t),t._selectionOverrides=Uk(t),PC(t),Ok(t),Jv(t)||_k(t);var a=function(t){return Jv(t)?xu(null):kk(t)}(t);BC(t,a),function(t){ns(t)&&t.on("NodeChange",_(FC,t))}(t),Qy(t);var u=Qv(t);Zk(t),u.fold((function(){Qk(t).then((function(){return tT(t)}))}),(function(e){t.setProgressState(!0),Qk(t).then((function(){e().then((function(e){t.setProgressState(!1),tT(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),tT(t)}))}))}))},nT=pu.DOM,rT=function(t){var e=function(t){return t.getParam("doctype","<!DOCTYPE html>")}(t)+"<html><head>";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(t){return ts(t,"body_id","tinymce")}(t),r=function(t){return ts(t,"body_class","")}(t);return es(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+es(t)+'" />'),e+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'"><br></body></html>'},oT=function(t,e){var n,r,o,i,a=t.translate(function(t){return t.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string")}(t)),u=(n=t.id,r=a,e.height,o=function(t){return t.getParam("iframe_attrs",{})}(t),i=Ne.fromTag("iframe"),tr(i,o),tr(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Bu(i,"tox-edit-area__iframe"),i).dom;u.onload=function(){u.onload=null,t.fire("load")};var c=function(t,e){if(document.domain!==window.location.hostname&&Se.browser.isIE()){var n=By("mce");t[n]=function(){eT(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return nT.setAttrib(e,"src",r),!0}return!1}(t,u);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=u,t.iframeHTML=rT(t),nT.add(e.iframeContainer,u),c},iT=pu.DOM,aT=function(t,e,n){var r=wy.get(n),o=wy.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=_e.trim(n),r&&-1===_e.inArray(e,n)){if(_e.each(wy.dependencies(n),(function(n){aT(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(e){!function(t,e,n){var r=Tu.translate(["Failed to initialize plugin: {0}",e]);nd(t,"PluginLoadError",{message:r}),_y(r,n),ky(t,r)}(t,n,e)}}},uT=function(t){return t.replace(/^\-/,"")},cT=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},sT=function(t){var e=t.getElement();return t.inline?cT(null):function(t){var e=iT.create("div");return iT.insertAfter(e,t),cT(e)}(e)},lT=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,d(bs(t))?function(t){return t.theme.renderUI()}(t):w(bs(t))?function(t){var e=t.getElement(),n=bs(t)(t,e);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:e.offsetHeight,n}(t):sT(t)},fT=function(t){t.fire("ScriptsLoaded"),function(t){var e=_e.trim(as(t)),n=t.ui.registry.getAll().icons,r=Nt(Nt({},ly.get("default").icons),ly.get(e).icons);dt(r,(function(e,r){wt(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=bs(t);if(d(e)){t.settings.theme=uT(e);var n=xy.get(e);t.theme=new n(t,xy.urls[e]),t.theme.init&&t.theme.init(t,xy.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];_e.each(Cs(t).split(/[ ,]/),(function(n){aT(t,e,uT(n))}))}(t);var e=lT(t);!function(t,e){var n={show:L.from(e.show).getOr(C),hide:L.from(e.hide).getOr(C),disable:L.from(e.disable).getOr(C),isDisabled:L.from(e.isDisabled).getOr(D),enable:function(){t.mode.isReadOnly()||L.from(e.enable).map(A)}};t.ui=Nt(Nt({},t.ui),n)}(t,L.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,Ay(t),t.inline?eT(t):function(t,e){var n=oT(t,e);e.editorContainer&&(nT.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=nT.isHidden(e.editorContainer)),t.getElement().style.display="none",nT.setAttrib(t.id,"aria-hidden","true"),n||eT(t)}(t,n)},dT=pu.DOM,mT=function(t){return"-"===t.charAt(0)},gT=function(t,e){var n=ms(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===Tu.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,C,void 0,(function(){!function(t,e,n){Ty(t,"LanguageLoadError",Oy("language",e,n))}(e,o,n)}))}},hT=function(t,e,n){return L.from(e).filter((function(t){return t.length>0&&!ly.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:L.some(e)}}))},pT=function(t,e,n){var r=hT(e,"default",n),o=function(t){return L.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:L.none()}}))}(e).orThunk((function(){return hT(e,as(e),"")}));q(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([r,o]),(function(n){t.add(n.url,C,void 0,(function(){!function(t,e,n){Ty(t,"IconsLoadError",Oy("icons",e,n))}(e,n.url,n.name.getOrUndefined())}))}))},vT=function(t,e){var n=wu.ScriptLoader;!function(t,e,n,r){var o=bs(e);if(d(o)){if(!mT(o)&&!wt(xy.urls,o)){var i=function(t){return t.getParam("theme_url")}(e);i?xy.load(o,e.documentBaseURI.toAbsolute(i)):xy.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue((function(){xy.waitFor(o,r)}))}else r()}(n,t,e,(function(){gT(n,t),pT(n,t,e),function(t,e){_e.each(function(t){return t.getParam("external_plugins")}(t),(function(e,n){wy.load(n,e,C,void 0,(function(){Ey(t,e,n)})),t.settings.plugins+=" "+n})),_e.each(Cs(t).split(/[ ,]/),(function(n){if((n=_e.trim(n))&&!wy.urls[n])if(mT(n)){n=n.substr(1,n.length);var r=wy.dependencies(n);_e.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=wy.createUrl(r,n);wy.load(o.resource,o,C,void 0,(function(){Ey(t,o.prefix+o.resource+o.suffix,o.resource)}))}))}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};wy.load(n,o,C,void 0,(function(){Ey(t,o.prefix+o.resource+o.suffix,n)}))}}))}(t,e),n.loadQueue((function(){t.removed||fT(t)}),t,(function(){t.removed||fT(t)}))}))},bT=function(t){var e=t.id;Tu.setCode(ms(t));var n=function(){dT.unbind(window,"ready",n),t.render()};if(Fi.Event.domLoaded){if(t.getElement()&&Se.contentEditable){var r=Ne.fromDom(t.getElement()),o=function(t){return Y(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})}(r);t.on("remove",(function(){$(r.dom.attributes,(function(t){return rr(r,t.name)})),tr(r,o)})),t.ui.styleSheetLoader=function(t,e){return ao.forElement(t,{contentCssCors:xs(e),referrerPolicy:ds(e)})}(r,t),!function(t){return t.getParam("inline")}(t)?(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden"):t.inline=!0;var i=t.getElement().form||dT.getParent(e,"form");i&&(t.formElement=i,function(t){return t.getParam("hidden_input")}(t)&&!In(t.getElement())&&(dT.insertAfter(dT.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},dT.bind(i,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!function(t){return t.getParam("submit_patch")}(t)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=Cy(t),t.notificationManager=yy(t),function(t){return"xml"===t.getParam("encoding")}(t)&&t.on("GetContent",(function(t){t.save&&(t.content=dT.encode(t.content))})),function(t){return t.getParam("add_form_submit_trigger")}(t)&&t.on("submit",(function(){t.initialized&&t.save()})),function(t){return t.getParam("add_unload_trigger")}(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),vT(t,t.suffix)}}else dT.bind(window,"ready",n)},yT=function(t,e){return function(t,e){return tb(t).editor.addVisual(e)}(t,e)},wT={"font-size":"size","font-family":"face"},xT=function(t,e,n){return dp(Ne.fromDom(n),(function(e){return function(e){return ur(e,t).orThunk((function(){return"font"===Le(e)?yt(wT,t).bind((function(t){return nr(e,t)})):L.none()}))}(e)}),(function(t){return Be(Ne.fromDom(e),t)}))},CT=function(t){return function(e,n){return L.from(n).map(Ne.fromDom).filter(Fe).bind((function(n){return xT(t,e,n.dom).or(function(t,e){return L.from(pu.DOM.getStyle(e,t,!0))}(t,n.dom))})).getOr("")}},ST=CT("font-size"),kT=S((function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),CT("font-family")),TT=function(t){return zl(t.getBody()).map((function(t){var e=t.container();return Hn(e)?e.parentNode:e}))},OT=function(t,e){return function(t){return L.from(t.selection.getRng()).bind((function(e){var n=t.getBody();return e.startContainer===n&&0===e.startOffset?L.none():L.from(t.selection.getStart(!0))}))}(t).orThunk(_(TT,t)).map(Ne.fromDom).filter(Fe).bind(e)},ET=function(t,e){return OT(t,k(L.some,e))},_T=function(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=function(t){return _e.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return _e.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},RT=function(t){var e=t.split(/\s*,\s*/);return W(e,(function(t){return-1===t.indexOf(" ")||It(t,'"')||It(t,"'")?t:"'"+t+"'"})).join(",")},NT=function(t,e){var n=function(t){if("string"!=typeof t){var e=_e.extend({paste:t.paste,data:{paste:t.paste}},t);return{content:t.content,details:e}}return{content:t,details:{}}}(e);!function(t,e,n){Zv(t).editor.insertContent(e,n)}(t,n.content,n.details)},AT=_e.each,DT=_e.map,MT=_e.inArray,BT=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,a=this;if(!a.editor.removed){var u;if("mcefocus"!==t.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(u=a.editor,cm(u).each((function(t){return u.selection.setRng(t)}))):a.editor.focus()),(r=a.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var c=t.toLowerCase();if(o=a.commands.exec[c])return o(c,e,n),a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(AT(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1})),i)return i;if(a.editor.theme&&a.editor.theme.execCommand&&a.editor.theme.execCommand(t,e,n))return a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=a.editor.getDoc().execCommand(t,e,n)}catch(t){}return!!i&&(a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},t.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;AT(t,(function(t,r){AT(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,a){return e.call(n||r.editor,o,i,a)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":C,"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},mceFocus:function(e,n,r){Sm(t,r)},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(t){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");Se.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),AT("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,{value:r})},FontName:function(e,n,r){!function(t,e){var n=_T(t,e);t.formatter.toggle("fontname",{value:RT(n)}),t.nodeChanged()}(t,r)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:_T(t,e)}),t.nodeChanged()}(t,r)},LineHeight:function(e,n,r){!function(t,e){t.formatter.toggle("lineheight",{value:String(e)}),t.nodeChanged()}(t,r)},Lang:function(t,n,r){e.toggleFormat(t,{value:r.code,customValue:r.customCode})},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){NT(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){ck(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){AC(t,e)},mceRepaint:C,InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),qn);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return XS(t,r),!0}});var n=function(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=DT(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==MT(o,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return _C(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return function(t){return ET(t,(function(e){return kT(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return ET(t,(function(e){return ST(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return function(t){return ET(t,(function(e){var n=Ne.fromDom(t.getBody());return dp(e,(function(t){return ur(t,"line-height")}),_(Be,n)).getOrThunk((function(){var t=parseFloat(ir(e,"line-height")),n=parseFloat(ir(e,"font-size"));return String(t/n)}))})).getOr("")}(t)}),this)},t}(),zT="data-mce-contenteditable",PT=function(t,e,n){var r,o;Pu(t,e)&&!1===n?(o=e,Au(r=t)?r.dom.classList.remove(o):Mu(r,o),zu(r)):n&&Bu(t,e)},LT=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},IT=function(t,e){t.dom.contentEditable=e?"true":"false"},HT=function(t,e){var n=Ne.fromDom(t.getBody());PT(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){L.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,IT(n,!1),q(Iu(n,'*[contenteditable="true"]'),(function(t){Zn(t,zT,"true"),IT(t,!1)}))):(t.readonly=!1,IT(n,!0),function(t){q(Iu(t,'*[data-mce-contenteditable="true"]'),(function(t){rr(t,zT),IT(t,!0)}))}(n),LT(t,"StyleWithCSS",!1),LT(t,"enableInlineTableEditing",!1),LT(t,"enableObjectResizing",!1),xm(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},FT=function(t){return t.readonly},VT=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){FT(t)&&q(e,(function(t){t.attr(zT,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter(zT,(function(e){FT(t)&&q(e,(function(t){t.attr("contenteditable",t.attr(zT))}))})),t.serializer.addTempAttr(zT)},jT=function(t,e){if(function(t){return"click"===t.type}(e)&&!id.metaKeyPressed(e)){var n=Ne.fromDom(e.target);(function(t,e){return Zr(e,"a",(function(e){return Be(e,Ne.fromDom(t.getBody()))})).bind((function(t){return nr(t,"href")}))})(t,n).each((function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+((It(o=n,i="#")?function(t,e){return t.substring(e)}(o,i.length):o)+'"]'));r.length&&t.selection.scrollIntoView(r[0],!0)}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o,i}))}},UT=_e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),WT=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||D}return t.isNative=function(t){return!!UT[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=Bi(n,e||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i<a;i++){var u=o[i];if(!u.removed){if(u.once&&this.off(n,u.func),r.isImmediatePropagationStopped())return r;if(!1===u.func.call(this.scope,r))return r.preventDefault(),r}}return r},t.prototype.on=function(t,e,n,r){if(!1===e&&(e=D),e){var o={func:e,removed:!1};r&&_e.extend(o,r);for(var i=t.toLowerCase().split(" "),a=i.length;a--;){var u=i[a],c=this.bindings[u];c||(c=[],this.toggleEvent(u,!0)),c=n?At([o],c,!0):At(At([],c,!0),[o],!1),this.bindings[u]=c}}return this},t.prototype.off=function(t,e){var n=this;if(t)for(var r=t.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],a=this.bindings[i];if(!i)return dt(this.bindings,(function(t,e){n.toggleEvent(e,!1),delete n.bindings[e]})),this;if(a){if(e){var u=G(a,(function(t){return t.func===e}));a=u.fail,this.bindings[i]=a,q(u.pass,(function(t){t.removed=!0}))}else a.length=0;a.length||(this.toggleEvent(t,!1),delete this.bindings[i])}}else dt(this.bindings,(function(t,e){n.toggleEvent(e,!1)})),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),qT=function(t){return t._eventDispatcher||(t._eventDispatcher=new WT({scope:t,toggleEvent:function(e,n){WT.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},$T={fire:function(t,e,n){var r=this;if(r.removed&&"remove"!==t&&"detach"!==t)return e;var o=qT(r).fire(t,e);if(!1!==n&&r.parent)for(var i=r.parent();i&&!o.isPropagationStopped();)i.fire(t,o,!1),i=i.parent();return o},on:function(t,e,n){return qT(this).on(t,e,n)},off:function(t,e){return qT(this).off(t,e)},once:function(t,e){return qT(this).once(t,e)},hasEventListeners:function(t){return qT(this).has(t)}},GT=pu.DOM,KT=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=vs(t);return n?(t.eventRoot||(t.eventRoot=GT.select(n)[0]),t.eventRoot):t.getBody()},XT=function(t,e,n){!function(t){return!t.hidden&&!FT(t)}(t)?FT(t)&&jT(t,n):t.fire(e,n)},YT=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=KT(t,e);if(vs(t)){if(Ix||(Ix={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||Ix&&(dt(Ix,(function(e,n){t.dom.unbind(KT(t,n))})),Ix=null)}))),Ix[e])return;n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var a=o[i].getBody();(a===r||GT.isChildOf(r,a))&&XT(o[i],e,n)}},Ix[e]=n,GT.bind(r,e,n)}else n=function(n){XT(t,e,n)},GT.bind(r,e,n),t.delegates[e]=n}},JT=Nt(Nt({},$T),{bindPendingEventDelegates:function(){var t=this;_e.each(t._pendingNativeEvents,(function(e){YT(t,e)}))},toggleNativeEvent:function(t,e){var n=this;"focus"!==t&&"blur"!==t&&(n.removed||(e?n.initialized?YT(n,t):n._pendingNativeEvents?n._pendingNativeEvents.push(t):n._pendingNativeEvents=[t]:n.initialized&&(n.dom.unbind(KT(n,t),t,n.delegates[t]),delete n.delegates[t])))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(dt(t.delegates,(function(e,n){t.dom.unbind(KT(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),QT=["design","readonly"],ZT=function(t,e,n,r){var o=n[e.get()],i=n[r];try{i.activate()}catch(t){return void console.error("problem while activating editor mode "+r+":",t)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&HT(t,i.editorReadOnly),e.set(r),function(t,e){t.fire("SwitchMode",{mode:e})}(t,r)},tO=function(t){var e=xu("design"),n=xu({design:{activate:C,deactivate:C,editorReadOnly:!1},readonly:{activate:C,deactivate:C,editorReadOnly:!0}});return function(t){t.serializer?VT(t):t.on("PreInit",(function(){VT(t)}))}(t),function(t){t.on("ShowCaret",(function(e){FT(t)&&e.preventDefault()})),t.on("ObjectSelected",(function(e){FT(t)&&e.preventDefault()}))}(t),{isReadOnly:function(){return FT(t)},set:function(r){return function(t,e,n,r){if(r!==n.get()){if(!wt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?ZT(t,n,e,r):t.on("init",(function(){return ZT(t,n,e,r)}))}}(t,n.get(),e,r)},get:function(){return e.get()},register:function(t,e){n.set(function(t,e,n){var r;if(j(QT,e))throw new Error("Cannot override default mode "+e);return Nt(Nt({},t),((r={})[e]=Nt(Nt({},n),{deactivate:function(){try{n.deactivate()}catch(t){console.error("problem while deactivating editor mode "+e+":",t)}}}),r))}(n.get(),t,e))}}},eO=_e.each,nO=_e.explode,rO={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},oO=_e.makeMap("alt,ctrl,shift,meta,access"),iO=function(t){var e,n={};eO(nO(t.toLowerCase(),"+"),(function(t){t in oO?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=rO[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in oO)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,Se.mac?n.ctrl=!0:n.shift=!0),n.meta&&(Se.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},aO=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(eO(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}return t.prototype.add=function(t,e,n,r){var o=this,i=o.normalizeCommandFunc(n);return eO(nO(_e.trim(t)),(function(t){var n=o.createShortcut(t,e,i,r);o.shortcuts[n.id]=n})),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.normalizeCommandFunc=function(t){var e=this,n=t;return"string"==typeof n?function(){e.editor.execCommand(n,!1,null)}:_e.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},t.prototype.createShortcut=function(t,e,n,r){var o=_e.map(nO(t,">"),iO);return o[o.length-1]=_e.extend(o[o.length-1],{func:n,scope:r||this.editor}),_e.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&(e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&(e.alt===t.altKey&&e.shift===t.shiftKey&&(!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0))))},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),uO=function(){var t=function(){var t={},e={},n={},r={},o={},i={},a={},u=function(t,e){return function(n,r){return t[n.toLowerCase()]=Nt(Nt({},r),{type:e})}};return{addButton:u(t,"button"),addGroupToolbarButton:u(t,"grouptoolbarbutton"),addToggleButton:u(t,"togglebutton"),addMenuButton:u(t,"menubutton"),addSplitButton:u(t,"splitbutton"),addMenuItem:u(e,"menuitem"),addNestedMenuItem:u(e,"nestedmenuitem"),addToggleMenuItem:u(e,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:function(t,e){return r[t.toLowerCase()]=e},getAll:function(){return{buttons:t,menuItems:e,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}}}();return{addAutocompleter:t.addAutocompleter,addButton:t.addButton,addContextForm:t.addContextForm,addContextMenu:t.addContextMenu,addContextToolbar:t.addContextToolbar,addIcon:t.addIcon,addMenuButton:t.addMenuButton,addMenuItem:t.addMenuItem,addNestedMenuItem:t.addNestedMenuItem,addSidebar:t.addSidebar,addSplitButton:t.addSplitButton,addToggleButton:t.addToggleButton,addGroupToolbarButton:t.addGroupToolbarButton,addToggleMenuItem:t.addToggleMenuItem,getAll:t.getAll}},cO=pu.DOM,sO=_e.extend,lO=_e.each,fO=_e.resolve,dO=Se.ie,mO=function(){function t(t,e,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,sO(this,JT),this.settings=uy(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(wu.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),pu.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),Ou.languageLoad=this.settings.language_load,Ou.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new Vm(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new aO(this),this.editorCommands=new BT(this),this.settings.cache_suffix&&(Se.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:uO(),styleSheetLoader:void 0,show:C,hide:C,enable:C,disable:C,isDisabled:D};var o=tO(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=su.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))}return t.prototype.render=function(){bT(this)},t.prototype.focus=function(t){this.execCommand("mceFocus",!1,t)},t.prototype.hasFocus=function(){return wm(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this,i=o.settings[t];if(i)return o.callbackLookup&&(r=o.callbackLookup[t])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?fO(r):0,i=fO(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return Tu.translate(t)},t.prototype.getParam=function(t,e,n){return sy(this,t,e,n)},t.prototype.hasPlugin=function(t,e){return!!j(Cs(this).split(/[ ,]/),t)&&(!e||void 0!==wy.get(t))},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){var t=this;t.hidden&&(t.hidden=!1,t.inline?t.getBody().contentEditable="true":(cO.show(t.getContainer()),cO.hide(t.id)),t.load(),t.fire("show"))},t.prototype.hide=function(){var t=this,e=t.getDoc();t.hidden||(dO&&e&&!t.inline&&e.execCommand("SelectAll"),t.save(),t.inline?(t.getBody().contentEditable="false",t===t.editorManager.focusedEditor&&(t.editorManager.focusedEditor=null)):(cO.hide(t.getContainer()),cO.setStyle(t.id,"display",t.orgDisplay)),t.hidden=!0,t.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this,r=n.getElement();if(n.removed)return"";if(r){(t=t||{}).load=!0;var o=In(r)?r.value:r.innerHTML;return e=n.setContent(o,t),t.element=r,t.no_events||n.fire("LoadContent",t),t.element=r=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,In(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=cO.getParent(r.id,"form"))&&lO(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return zb(this,t,e)},t.prototype.getContent=function(t){return Bb(this,t)},t.prototype.insertContent=function(t,e){e&&(t=sO({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?zb(this,this.startContent,{format:"raw"}):zb(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){var t=this;return t.container||(t.container=cO.get(t.editorContainer||t.id+"_parent")),t.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=cO.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t,e=this;return e.contentWindow||(t=e.iframeElement)&&(e.contentWindow=t.contentWindow),e.contentWindow},t.prototype.getDoc=function(){var t,e=this;return e.contentDocument||(t=e.getWin())&&(e.contentDocument=t.document),e.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this,o=r.settings;return o.urlconverter_callback?r.execCallback("urlconverter_callback",t,n,!0,e):!o.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:o.relative_urls?r.documentBaseURI.toRelative(t):t=r.documentBaseURI.toAbsolute(t,o.remove_script_host)},t.prototype.addVisual=function(t){yT(this,t)},t.prototype.remove=function(){Ib(this)},t.prototype.destroy=function(t){Hb(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),gO=pu.DOM,hO=_e.explode,pO=_e.each,vO=_e.extend,bO=0,yO=!1,wO=[],xO=[],CO=function(t){var e=t.type;pO(OO.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}}))},SO=function(t){t!==yO&&(t?su(window).on("resize scroll",CO):su(window).off("resize scroll",CO),yO=t)},kO=function(t){var e=xO;delete wO[t.id];for(var n=0;n<wO.length;n++)if(wO[n]===t){wO.splice(n,1);break}return xO=K(xO,(function(e){return t!==e})),OO.activeEditor===t&&(OO.activeEditor=xO.length>0?xO[0]:null),OO.focusedEditor===t&&(OO.focusedEditor=null),e.length!==xO.length},TO="CSS1Compat"!==document.compatMode,OO=Nt(Nt({},$T),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:su,majorVersion:"5",minorVersion:"10.0",releaseDate:"2021-10-11",editors:wO,i18n:Tu,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,n=this,r="";e=Vm.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)t=i.base||i.baseURL,r=i.suffix;else{for(var a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c;if(""!==(c=a[u].src||"")){var s=c.substring(c.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(c)){-1!==s.indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/"));break}}}if(!t&&document.currentScript)-1!==(c=document.currentScript.src).indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/"))}n.baseURL=new Vm(e).toAbsolute(t),n.documentBaseURL=e,n.baseURI=new Vm(n.baseURL),n.suffix=r,(o=n).on("AddEditor",_(gm,o)),o.on("RemoveEditor",_(hm,o))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&dt(r,(function(t,e){Ou.PluginManager.urls[e]=t}))},init:function(t){var e,n=this,r=_e.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),o=function(t){var e=t.id;return e||(e=yt(t,"name").filter((function(t){return!gO.get(t)})).getOrThunk(gO.uniqueId),t.setAttribute("id",e)),e},i=function(t,e){return e.constructor===RegExp?e.test(t.className):gO.hasClass(t,e)},a=function(t){e=t},u=function(){var e,c=0,s=[],l=function(t,r,o){var i=new mO(t,r,n);s.push(i),i.on("init",(function(){++c===e.length&&a(s)})),i.targetElm=i.targetElm||o,i.render()};gO.unbind(window,"ready",u),function(e){var r=t[e];if(r)r.apply(n,[])}("onpageload"),e=su.unique(function(t){var e=[];if(Se.browser.isIE()&&Se.browser.version.major<11)return _y("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(TO)return _y("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return pO(t.types,(function(t){e=e.concat(gO.select(t.selector))})),e;if(t.selector)return gO.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var n=t.elements||"";n.length>0&&pO(hO(n),(function(t){var n=gO.get(t);n?e.push(n):pO(document.forms,(function(n){pO(n.elements,(function(n){n.name===t&&(t="mce_editor_"+bO++,gO.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":pO(gO.select("textarea"),(function(n){t.editor_deselector&&i(n,t.editor_deselector)||t.editor_selector&&!i(n,t.editor_selector)||e.push(n)}))}return e}(t)),t.types?pO(t.types,(function(n){_e.each(e,(function(e){return!gO.is(e,n.selector)||(l(o(e),vO({},t,n),e),!1)}))})):(_e.each(e,(function(t){var e;(e=n.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(kO(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)})),0===(e=_e.grep(e,(function(t){return!n.get(t.id)}))).length?a([]):pO(e,(function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in r}(t,e)?l(o(e),t,e):_y("Could not initialize inline editor on invalid inline target element",e)})))};return n.settings=t,gO.bind(window,"ready",u),new to((function(t){e?t(e):a=function(e){t(e)}}))},get:function(t){return 0===arguments.length?xO.slice(0):d(t)?Q(xO,(function(e){return e.id===t})).getOr(null):x(t)&&xO[t]?xO[t]:null},add:function(t){var e=this;return wO[t.id]===t||(null===e.get(t.id)&&("length"!==t.id&&(wO[t.id]=t),wO.push(t),xO.push(t)),SO(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),Hx||(Hx=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Hx))),t},createEditor:function(t,e){return this.add(new mO(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!d(t))return n=t,h(r.get(n.id))?null:(kO(n)&&r.fire("RemoveEditor",{editor:n}),0===xO.length&&window.removeEventListener("beforeunload",Hx),n.remove(),SO(xO.length>0),n);pO(gO.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=xO.length-1;e>=0;e--)r.remove(xO[e])},execCommand:function(t,e,n){var r=this,o=r.get(n);switch(t){case"mceAddEditor":return r.get(n)||new mO(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",!1,n),!0)}return!!r.activeEditor&&r.activeEditor.execCommand(t,e,n)},triggerSave:function(){pO(xO,(function(t){t.save()}))},addI18n:function(t,e){Tu.add(t,e)},translate:function(t){return Tu.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new Vm(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new Vm(this.baseURL)}});OO.setup();var EO,_O,RO,NO,AO=Math.min,DO=Math.max,MO=Math.round,BO=function(t,e,n){var r=e.x,o=e.y,i=t.w,a=t.h,u=e.w,c=e.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=u),"c"===s[0]&&(o+=MO(c/2)),"c"===s[1]&&(r+=MO(u/2)),"b"===s[3]&&(o-=a),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=MO(a/2)),"c"===s[4]&&(r-=MO(i/2)),zO(r,o,i,a)},zO=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},PO={inflate:function(t,e,n){return zO(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:BO,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if((o=BO(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=DO(t.x,e.x),r=DO(t.y,e.y),o=AO(t.x+t.w,e.x+e.w),i=AO(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:zO(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,a=t.y+t.h,u=e.x+e.w,c=e.y+e.h,s=DO(0,e.x-r),l=DO(0,e.y-o),f=DO(0,i-u),d=DO(0,a-c);return r+=s,o+=l,n&&(i+=s,a+=l,r-=f,o-=d),zO(r,o,(i-=f)-r,(a-=d)-o)},create:zO,fromClientRect:function(t){return zO(t.left,t.top,t.width,t.height)}},LO=(EO={},_O={},{load:function(t,e){var n='Script at URL "'+e+'" failed to load',r='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==EO[t])return EO[t];var o=new to((function(o,i){var a=function(t,e,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),t.apply(null,e))}},a=i(t),u=i(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r||null!==o||(o=setTimeout((function(){return u.apply(null,t)}),n))},resolve:a,reject:u}}(o,i);_O[t]=a.resolve,wu.ScriptLoader.loadScript(e,(function(){return a.start(r)}),(function(){return a.reject(n)}))}));return EO[t]=o,o},add:function(t,e){void 0!==_O[t]&&(_O[t](e),delete _O[t]),EO[t]=to.resolve(e)}}),IO=_e.each,HO=_e.extend,FO=function(){};FO.extend=RO=function(t){var e=this.prototype,n=function(){var t,e,n,r=this;if(!NO&&(r.init&&r.init.apply(r,arguments),e=r.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(r,arguments)},r=function(){return this};NO=!0;var o=new this;return NO=!1,t.Mixins&&(IO(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),e.Mixins&&(t.Mixins=e.Mixins.concat(t.Mixins))),t.Methods&&IO(t.Methods.split(","),(function(e){t[e]=r})),t.Properties&&IO(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){var e=this;return void 0!==t?(e[n]=t,e):e[n]}})),t.Statics&&IO(t.Statics,(function(t,e){n[e]=t})),t.Defaults&&e.Defaults&&(t.Defaults=HO({},e.Defaults,t.Defaults)),dt(t,(function(t,n){"function"==typeof t&&e[n]?o[n]=function(t,n){return function(){var r=this,o=r._super;r._super=e[t];var i=n.apply(r,arguments);return r._super=o,i}}(n,t):o[n]=t})),n.prototype=o,n.constructor=n,n.extend=RO,n};var VO,jO=Math.min,UO=Math.max,WO=Math.round,qO={serialize:function(t){var e=JSON.stringify(t);return d(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},parse:function(t){try{return JSON.parse(t)}catch(t){}}},$O={callbacks:{},count:0,send:function(t){var e=this,n=pu.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},GO=Nt(Nt({},$T),{send:function(t){var e,n=0,r=function(){!t.async||4===e.readyState||n++>1e4?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,n>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):oo.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",GO.fire("beforeInitialize",{settings:t}),(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&_e.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=GO.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();oo.setTimeout(r,10)}}),KO=_e.extend,XO=function(){function t(t){this.settings=KO({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=KO(this.settings,t);r.success=function(t,o){void 0===(t=qO.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=qO.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",GO.send(r)},t}();try{var YO="__storage_test__";(VO=window.localStorage).setItem(YO,YO),VO.removeItem(YO)}catch(t){VO=function(){var t={},e=[],n={getItem:function(e){return t[e]||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter((function(t){return t===n})),delete t[n]},clear:function(){e=[],t={}},length:0};return Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n}()}var JO={geom:{Rect:PO},util:{Promise:to,Delay:oo,Tools:_e,VK:id,URI:Vm,Class:FO,EventDispatcher:WT,Observable:$T,I18n:Tu,XHR:GO,JSON:qO,JSONRequest:XO,JSONP:$O,LocalStorage:VO,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=UO(0,jO(e,1)),i=UO(0,jO(i,1)),0!==e){var a=t/60,u=i*e,c=u*(1-Math.abs(a%2-1)),s=i-u;switch(Math.floor(a)){case 0:n=u,r=c,o=0;break;case 1:n=c,r=u,o=0;break;case 2:n=0,r=u,o=c;break;case 3:n=0,r=c,o=u;break;case 4:n=c,r=0,o=u;break;case 5:n=u,r=0,o=c;break;default:n=r=o=0}n=WO(255*(n+s)),r=WO(255*(r+s)),o=WO(255*(o+s))}else n=r=o=WO(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return function(t,e,n){var r,o;o=0;var i=jO(t/=255,jO(e/=255,n/=255)),a=UO(t,UO(e,n));return i===a?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,o=a,{h:WO(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(a-i))),s:WO(100*r),v:WO(100*o)})}(n,r,o)},e.toHex=function(){var t=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e},ImageUploader:function(t){var e=Dy(),n=Ly(t,e);return{upload:function(e,r){return void 0===r&&(r=!0),n.upload(e,r?Py(t):void 0)}}}},dom:{EventUtils:Fi,Sizzle:Sa,DomQuery:su,TreeWalker:uo,TextSeeker:Zu,DOMUtils:pu,ScriptLoader:wu,RangeUtils:Cd,Serializer:Mb,StyleSheetLoader:io,ControlSelection:ud,BookmarkManager:Zf,Selection:lb,Event:Fi.Event},html:{Styles:Ai,Entities:yi,Node:Mm,Schema:Ri,SaxParser:$m,DomParser:_b,Writer:Zm,Serializer:tg},Env:Se,AddOnManager:Ou,Annotator:Qf,Formatter:qy,UndoManager:Gy,EditorCommands:BT,WindowManager:Cy,NotificationManager:yy,EditorObservable:JT,Shortcuts:aO,Editor:mO,FocusManager:sm,EditorManager:OO,DOM:pu.DOM,ScriptLoader:wu.ScriptLoader,PluginManager:wy,ThemeManager:xy,IconManager:ly,Resource:LO,trim:_e.trim,isArray:_e.isArray,is:_e.is,toArray:_e.toArray,makeMap:_e.makeMap,each:_e.each,map:_e.map,grep:_e.grep,inArray:_e.inArray,extend:_e.extend,create:_e.create,walk:_e.walk,createNS:_e.createNS,resolve:_e.resolve,explode:_e.explode,_addCacheSuffix:_e._addCacheSuffix,isOpera:Se.opera,isWebKit:Se.webkit,isIE:Se.ie,isGecko:Se.gecko,isMac:Se.mac},QO=_e.extend(OO,JO);!function(t){window.tinymce=t,window.tinyMCE=t}(QO),function(e){try{t.exports=e}catch(t){}}(QO)}()}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})(),(()=>{"use strict";n(7575),n(6890),n(8860),n(5209),n(3356),n(8619),n(2540),n(1295),n(2170),n(2682),n(1236),n(6884),n(4400),n(5053),n(7259),n(4926),n(5031),n(397);var t=n(9325);n(9722),n(1014),n(4048),n(7804),n(7499),n(2680);n(5187),n.g.processPastedContent=t.processPastedContent,n.g.current_selection_range=null,n.g.editor=null})()})();
\ No newline at end of file
+(()=>{var t={7499:(t,e,n)=>{const{addPluginToPluginManager:r}=n(3994);function o(t){!function(t){t.ui.registry.addIcon("download",'<svg height="24" width="24"><path d="M13,5V11H14.17L12,13.17L9.83,11H11V5H13M15,3H9V9H5L12,16L19,9H15V3M19,18H5V20H19V18Z" /></svg>'),t.ui.registry.addButton("download",{icon:"download",tooltip:"Download attachment",onAction:()=>{const e=t.selection.getNode();if(!e||!t.settings.attachmenthandler_download_attachment)return;const n=e.getAttribute("data-hash");t.settings.attachmenthandler_download_attachment(n)}}),t.ui.registry.addButton("delete",{icon:"close",tooltip:"Remove attachment",onAction:()=>{t.undoManager.transact((()=>{t.execCommand("Delete")}))}}),t.ui.registry.addContextToolbar("attachment-selection",{predicate:function(t){return"IMG"!==t.nodeName&&t.classList.contains("attachment")},items:"download delete",position:"node"})}(t),t.addCommand("mceAttachImage",(function(e){!async function(t,e){var n=`\n <img class="attachment"\n alt="${e.filename||e.hash}"\n data-mime="${e.type}"\n data-hash="${e.hash}"\n data-filename="${e.filename}"\n src="${e.dataurl}"\n data-size="${e.size}"\n style="float: left;"/>\n `;t.undoManager.transact((()=>{t.insertContent(n),t.execCommand("mceInsertNewLine")}))}(t,e)})),t.addCommand("mceAttachFile",(function(e){!async function(t,e){var n=`\n <span\n class="attachment"\n contenteditable="false"\n title="${e.filename}"\n data-mime="${e.type}"\n data-filename="${e.filename}"\n data-hash="${e.hash}"\n data-size="${function(t,e=2){if(0===t)return"0B";const n=1024,r=e<0?0:e,o=["B","K","M","G","T","P","E","Z","Y"],i=Math.floor(Math.log(t)/Math.log(n));return parseFloat((t/Math.pow(n,i)).toFixed(r))+o[i]}(e.size,1)}">\n <em>&nbsp;</em>\n <span class="filename">${e.filename}</span>\n </span>`;t.undoManager.transact((()=>{t.insertContent(n)}))}(t,e)})),t._replaceImage=async function(e){const{hash:n,src:r}=e,o=t.dom.doc.querySelectorAll(`img[data-hash="${n}"]`);if(o&&o.length&&r)for(let t of o){const e=i(r);e?t.src=URL.createObjectURL(e):console.error("Could not convert data uri to blob.")}},t._updateAttachmentProgress=function(e){const{hash:n,total:r,loaded:o}=e,i=t.dom.doc.querySelectorAll(`span.attachment[data-hash="${n}"]`);if(i&&i.length&&r&&o)for(let t of i){const e=Math.round(o/r*100);e>=100?(t.removeAttribute("data-progress"),t.style.removeProperty("--progress")):(t.setAttribute("data-progress",`${e}%`),t.style.setProperty("--progress",`${e}%`))}}}function i(t){const e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return null;const r=n[1],o=e[1],i=1024,a=atob(o),u=a.length,c=Math.ceil(u/i),s=new Array(c);for(let t=0;t<c;++t){const e=t*i,n=Math.min(e+i,u),r=new Array(n-e);for(let t=e,o=0;t<n;++o,++t)r[o]=a[t].charCodeAt(0);s[t]=new Uint8Array(r)}return new Blob(s,{type:r})}r("attachmentshandler",o)},2680:(t,e,n)=>{const{addPluginToPluginManager:r}=n(3994);function o(t){t.on("NewBlock",(e=>{const n=e.newBlock;n&&"BLOCKQUOTE"===n.parentElement.tagName&&t.execCommand("mceToggleFormat",!1,"blockquote")}))}r("blockescape",o)},9722:(t,e,n)=>{const{addPluginToPluginManager:r}=n(3994),o="tox-checklist",i="tox-checklist--checked";function a(t){t.addCommand("insertChecklist",(function(){u(t)})),t.ui.registry.addToggleButton("checklist",{icon:"checklist",active:!1,tooltip:"Checklist",onAction:()=>u(t),onSetup:function(e){return function(t,e){var n=function(t){var n=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return[i];if(n(i,r))break}return}(t.parents,c,s);n&&(n=n.filter((function(t){return t.className===o})).length>0),e(n)},r=t.dom.getParents(t.selection.getNode());return n({parents:r}),t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}(t,e.setActive)}}),t.on("mousedown",(function(e){var n=e.target,r=n.parentElement;e.offsetX>0||r.className!==o||"LI"!==n.nodeName||(e.preventDefault(),f(t,n))}),{capture:!0,passive:!1}),t.on("touchstart",(function(e){var n=e.target,r=n.parentElement;e.targetTouches.length>0||e.targetTouches[0].clientX>45||r.className!==o||"LI"!==n.nodeName||(e.preventDefault(),f(t,n))}),{capture:!0,passive:!1})}function u(t){t.selection.getNode().classList.contains(o)?t.undoManager.transact((function(){t.execCommand("RemoveList")})):t.execCommand("InsertUnorderedList",!1,{"list-style-type":"none","list-attributes":{class:o}})}var c=l(/^(OL|UL|DL)$/),s=l(/^(TH|TD)$/);function l(t){return function(e){return e&&t.test(e.nodeName)}}function f(t,e){t.undoManager.transact((function(){e.className=e.className===i?"":i}))}r("checklist",a)},9325:(t,e,n)=>{const{addPluginToPluginManager:r,getCharacterRange:o,moveCaretTo:i,getCurrentLine:a}=n(3994),{createCodeBlock:u,isCodeBlock:c,TAGNAME:s,state:l}=n(4250),{addCodeBlockToolbar:f,refreshHighlighting:d}=n(2362),m="  ",g=[" "," "];function h(t){f(t),t.addCommand("mceInsertCodeBlock",(function(e,n){p(t,e,n)})),t.ui.registry.addToggleButton("codeblock",{icon:"code-sample",tooltip:"Codeblock",onAction:function(e){return p(t,e)},onSetup:e=>b(e,t)})}var p=function(t,e,n){if(e&&e.isActive&&e.isActive()){const e=t.selection.getNode();let n=e.textContent;n?t.selection.setContent(`<p>${n}</p>`):function(t,e){t.undoManager.transact((function(){const n=document.createElement("p");n.innerHTML="<br>",t.focus(),t.dom.insertAfter(n,e),setTimeout((()=>{t.selection.select(n,!0),t.selection.collapse(!0),t.nodeChanged({selectionChange:!0})}),0)}))}(t,e)}else{var r=t.selection.getContent({format:"text"});"shortcut"===n&&(r="<br>"),r||(r="<br>"),function(t,e){t.undoManager.transact((function(){const n=u(e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.insertContent(`${n.outerHTML}<p><br></p>`),setTimeout((()=>{const e=t.dom.select('*[data-mce-id="__mcenew"]')[0];t.dom.setAttrib(e,"data-mce-id",null),t.selection.select(e,!0),t.selection.collapse(!0),t.nodeChanged({selectionChange:!0})}),0)}))}(t,r)}};var v=!1,b=function(t,e){function n(e){t.setActive(e.element.tagName===s)}function r(t){"<pre></pre>"===t.content&&(t.preventDefault(),v=!0,p(e,void 0,"shortcut"))}function u(t){const n=e.selection.getNode();c(n)&&"mceInsertContent"===t.command&&t.value&&t.value.paste&&(t.value.content=t.value.content.replace(/<p>/gm,"").replace(/<\/p>|<br \/>/gm,"\n")),v&&"mceInsertNewLine"===t.command&&(t.preventDefault(),v=!1)}function f(t){const n=l.activeBlock;n&&("Tab"===t.code?(t.preventDefault(),function(t,n){const r=o(n);if(!r)return;const u=t.shiftKey,c=n.innerText;if(r.start!==r.end){let[t,e,o]=[c.substring(0,r.start),c.substring(r.start,r.end),c.substring(r.end)],a=t;const l=e.split("\n");for(var s=0;s<l.length;++s){const t=l[s];l[s]=u?y(t,2):`${m}${t}`}a+=l.join("\n"),a+=o,n.innerHTML=a;const f=u?r.end-2*l.length:r.end+2*l.length;i(n,r.start,f)}else if(u){const t=a(n);n.innerHTML=n.innerText.replace(t,y(t,2)),i(n,r.start-2)}else e.selection.setContent(m)}(t,n)):t.ctrlKey&&"KeyA"===t.code?(t.preventDefault(),function(t){e.selection.select(t,!0)}(n)):"Enter"===t.code&&function(t){const n=a(t),r=(n.length-n.trimStart().length)/2;e.insertContent(m.repeat(r))}(n))}function g(t){"Enter"!==t.code&&"Space"!==t.code&&"Backspace"!==t.code&&"Tab"!==t.code||d(e)}return e.on("BeforeExecCommand",u),e.on("BeforeSetContent",r),e.on("keydown",f),e.on("keyup",g),e.on("NodeChange",n),function(){e.off("BeforeExecCommand",u),e.off("BeforeSetContent",r),e.off("keydown",f),e.off("keyup",g),e.off("NodeChange",n)}};function y(t,e){for(let n=0;n<e;++n){const e=t[n];if(!g.some((t=>t===e)))return t}return t.substring(2)}r("codeblock",h),t.exports={processPastedContent:function(t){if(t&&t.childNodes)for(let e of t.childNodes)if("PRE"===e.tagName){e.className="hljs";const t=e.textContent||e.innerText;e.innerHTML=t}}}},1027:t=>{t.exports=[{name:"Plain text",shortname:"plaintext"},{name:"HTML, XML",shortname:"xml"},{name:"Bash",shortname:"bash"},{name:"C",shortname:"c"},{name:"C++",shortname:"cpp"},{name:"C#",shortname:"csharp"},{name:"CSS",shortname:"css"},{name:"Markdown",shortname:"markdown"},{name:"Diff",shortname:"diff"},{name:"Ruby",shortname:"ruby"},{name:"Go",shortname:"go"},{name:"TOML, also INI",shortname:"ini"},{name:"Java",shortname:"java"},{name:"Javascript",shortname:"javascript"},{name:"JSON",shortname:"json"},{name:"Kotlin",shortname:"kotlin"},{name:"Less",shortname:"less"},{name:"Lua",shortname:"lua"},{name:"Makefile",shortname:"makefile"},{name:"Perl",shortname:"perl"},{name:"Objective-C",shortname:"objectivec"},{name:"php",shortname:"php"},{name:"PHP template",shortname:"php-template"},{name:"Python",shortname:"python"},{name:"python-repl",shortname:"python-repl"},{name:"R",shortname:"r"},{name:"Rust",shortname:"rust"},{name:"SCSS",shortname:"scss"},{name:"Shell Session",shortname:"shell"},{name:"SQL",shortname:"sql"},{name:"Swift",shortname:"swift"},{name:"YAML",shortname:"yaml"},{name:"TypeScript",shortname:"typescript"},{name:"Visual Basic .NET",shortname:"vbnet"},{name:"1C:Enterprise",shortname:"1c"},{name:"Augmented Backus-Naur Form",shortname:"abnf"},{name:"Apache Access Log",shortname:"accesslog"},{name:"ActionScript",shortname:"actionscript"},{name:"Ada",shortname:"ada"},{name:"AngelScript",shortname:"angelscript"},{name:"Apache config",shortname:"apache"},{name:"AppleScript",shortname:"applescript"},{name:"ArcGIS Arcade",shortname:"arcade"},{name:"Arduino",shortname:"arduino"},{name:"ARM Assembly",shortname:"armasm"},{name:"AsciiDoc",shortname:"asciidoc"},{name:"AspectJ",shortname:"aspectj"},{name:"AutoHotkey",shortname:"autohotkey"},{name:"AutoIt",shortname:"autoit"},{name:"AVR Assembly",shortname:"avrasm"},{name:"Awk",shortname:"awk"},{name:"X++",shortname:"axapta"},{name:"BASIC",shortname:"basic"},{name:"Backus–Naur Form",shortname:"bnf"},{name:"Brainfuck",shortname:"brainfuck"},{name:"C/AL",shortname:"cal"},{name:"Cap’n Proto",shortname:"capnproto"},{name:"Ceylon",shortname:"ceylon"},{name:"Clean",shortname:"clean"},{name:"Clojure",shortname:"clojure"},{name:"Clojure REPL",shortname:"clojure-repl"},{name:"CMake",shortname:"cmake"},{name:"CoffeeScript",shortname:"coffeescript"},{name:"Coq",shortname:"coq"},{name:"Caché Object Script",shortname:"cos"},{name:"crmsh",shortname:"crmsh"},{name:"Crystal",shortname:"crystal"},{name:"CSP",shortname:"csp"},{name:"D",shortname:"d"},{name:"Dart",shortname:"dart"},{name:"Delphi",shortname:"delphi"},{name:"Django",shortname:"django"},{name:"DNS Zone",shortname:"dns"},{name:"Dockerfile",shortname:"dockerfile"},{name:"Batch file (DOS)",shortname:"dos"},{name:"dsconfig",shortname:"dsconfig"},{name:"Device Tree",shortname:"dts"},{name:"Dust",shortname:"dust"},{name:"Extended Backus-Naur Form",shortname:"ebnf"},{name:"Elixir",shortname:"elixir"},{name:"Elm",shortname:"elm"},{name:"ERB",shortname:"erb"},{name:"Erlang REPL",shortname:"erlang-repl"},{name:"Erlang",shortname:"erlang"},{name:"Excel formulae",shortname:"excel"},{name:"FIX",shortname:"fix"},{name:"Flix",shortname:"flix"},{name:"Fortran",shortname:"fortran"},{name:"F#",shortname:"fsharp"},{name:"GAMS",shortname:"gams"},{name:"GAUSS",shortname:"gauss"},{name:"G-code (ISO 6983)",shortname:"gcode"},{name:"Gherkin",shortname:"gherkin"},{name:"GLSL",shortname:"glsl"},{name:"GML",shortname:"gml"},{name:"Golo",shortname:"golo"},{name:"Gradle",shortname:"gradle"},{name:"Groovy",shortname:"groovy"},{name:"HAML",shortname:"haml"},{name:"Handlebars",shortname:"handlebars"},{name:"Haskell",shortname:"haskell"},{name:"Haxe",shortname:"haxe"},{name:"HSP",shortname:"hsp"},{name:"HTTP",shortname:"http"},{name:"Hy",shortname:"hy"},{name:"Inform 7",shortname:"inform7"},{name:"IRPF90",shortname:"irpf90"},{name:"ISBL",shortname:"isbl"},{name:"JBoss CLI",shortname:"jboss-cli"},{name:"Julia",shortname:"julia"},{name:"Julia REPL",shortname:"julia-repl"},{name:"Lasso",shortname:"lasso"},{name:"LaTeX",shortname:"latex"},{name:"LDIF",shortname:"ldif"},{name:"Leaf",shortname:"leaf"},{name:"Lisp",shortname:"lisp"},{name:"LiveCode",shortname:"livecodeserver"},{name:"LiveScript",shortname:"livescript"},{name:"LLVM IR",shortname:"llvm"},{name:"LSL (Linden Scripting Language)",shortname:"lsl"},{name:"Mathematica",shortname:"mathematica"},{name:"Matlab",shortname:"matlab"},{name:"Maxima",shortname:"maxima"},{name:"MEL",shortname:"mel"},{name:"Mercury",shortname:"mercury"},{name:"MIPS Assembly",shortname:"mipsasm"},{name:"Mizar",shortname:"mizar"},{name:"Mojolicious",shortname:"mojolicious"},{name:"Monkey",shortname:"monkey"},{name:"MoonScript",shortname:"moonscript"},{name:"N1QL",shortname:"n1ql"},{name:"Nested Text",shortname:"nestedtext"},{name:"Nginx config",shortname:"nginx"},{name:"Nim",shortname:"nim"},{name:"Nix",shortname:"nix"},{name:"Node REPL",shortname:"node-repl"},{name:"NSIS",shortname:"nsis"},{name:"OCaml",shortname:"ocaml"},{name:"OpenSCAD",shortname:"openscad"},{name:"Oxygene",shortname:"oxygene"},{name:"Parser3",shortname:"parser3"},{name:"Packet Filter config",shortname:"pf"},{name:"PostgreSQL",shortname:"pgsql"},{name:"Pony",shortname:"pony"},{name:"PowerShell",shortname:"powershell"},{name:"Processing",shortname:"processing"},{name:"Python profiler",shortname:"profile"},{name:"Prolog",shortname:"prolog"},{name:".properties",shortname:"properties"},{name:"Protocol Buffers",shortname:"protobuf"},{name:"Puppet",shortname:"puppet"},{name:"PureBASIC",shortname:"purebasic"},{name:"Q",shortname:"q"},{name:"QML",shortname:"qml"},{name:"ReasonML",shortname:"reasonml"},{name:"RenderMan RIB",shortname:"rib"},{name:"Roboconf",shortname:"roboconf"},{name:"Microtik RouterOS script",shortname:"routeros"},{name:"RenderMan RSL",shortname:"rsl"},{name:"Oracle Rules Language",shortname:"ruleslanguage"},{name:"SAS",shortname:"sas"},{name:"Scala",shortname:"scala"},{name:"Scheme",shortname:"scheme"},{name:"Scilab",shortname:"scilab"},{name:"Smali",shortname:"smali"},{name:"Smalltalk",shortname:"smalltalk"},{name:"SML (Standard ML)",shortname:"sml"},{name:"SQF",shortname:"sqf"},{name:"Stan",shortname:"stan"},{name:"Stata",shortname:"stata"},{name:"STEP Part 21",shortname:"step21"},{name:"Stylus",shortname:"stylus"},{name:"SubUnit",shortname:"subunit"},{name:"Tagger Script",shortname:"taggerscript"},{name:"Test Anything Protocol",shortname:"tap"},{name:"Tcl",shortname:"tcl"},{name:"Thrift",shortname:"thrift"},{name:"TP",shortname:"tp"},{name:"Twig",shortname:"twig"},{name:"Vala",shortname:"vala"},{name:"Visual Basic .NET",shortname:"vbnet"},{name:"VBScript",shortname:"vbscript"},{name:"VBScript in HTML",shortname:"vbscript-html"},{name:"Verilog",shortname:"verilog"},{name:"VHDL",shortname:"vhdl"},{name:"Vim Script",shortname:"vim"},{name:"WebAssembly",shortname:"wasm"},{name:"Wren",shortname:"wren"},{name:"Intel x86 Assembly",shortname:"x86asm"},{name:"XL",shortname:"xl"},{name:"XQuery",shortname:"xquery"},{name:"Zephir",shortname:"zephir"}]},2362:(t,e,n)=>{const{persistSelection:r}=n(3994),{TAGNAME:o,state:i}=n(4250),a=n(1027),u=".tox-pop__dialog span.tox-tbtn__select-label";function c(t,e="Plain text"){!function(t){const e=document.querySelector(u);if(!e||e.textContent===t)return;e.textContent=t}(e),t.ui.registry.addSplitButton("languages",{text:e,onAction:async()=>{if(!("Plain text"===e))return;const n=l(i.activeBlock);s(t,n)},onItemAction:async(e,n)=>{await s(t,n)},select:t=>t&&t.name===e,fetch:t=>t(i.languages)})}async function s(t,e){c(t,"Loading"),await f(t,e.shortname),c(t,e.name)}function l(t){if(!t||t.tagName!==o)return;const e=d(t).split("-");return e.length<=1?void 0:e[1]}async function f(t,e){if(!e)return;let n=await g(t);n.getLanguage(e)||await async function(t,e){let n=await g(t);if(!n)return;if(m[e])return n.getLanguage(e);const r=`https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/languages/${e}.min.js`;await h(t,r);const o=n.getLanguage(e);m[e]=o}(t,e);const o=i.activeBlock;r(o,(()=>{const t=n.highlight(o.innerText,{language:e});o.innerHTML=t.value.replace(/\n/gm,"<br>")})),function(t,e){const n=d(t);if(n===e)return;n?t.classList.replace(n,e):t.classList.add(e)}(o,`language-${e}`),t.setDirty(!1)}function d(t){for(let e of t.classList.values())if(e.startsWith("language")||e.startsWith("lang"))return e;return""}const m={};async function g(t){if(n.g.hljs)return n.g.hljs;return await h(t,"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/highlight.min.js"),n.g.hljs}function h(t,e){return new Promise((n=>{const r=t.dom.doc,o=r.createElement("script");o.src=e,r.head.appendChild(o),o.addEventListener("load",(()=>{n()}))}))}t.exports={addCodeBlockToolbar:function(t){i.languages.length!==a.length&&a.forEach((t=>{i.languages.push({type:"choiceitem",text:t.name,value:t})})),c(t),t.ui.registry.addContextToolbar("codeblock-selection",{predicate:e=>{if(e.nodeName===o){i.activeBlock=e;const n=l(e),r=a.find((t=>t.shortname===n));return c(t,r&&r.name),!0}return i.activeBlock=null,!1},items:"copy languages",position:"node"})},refreshHighlighting:async function(t){const e=l(i.activeBlock);await f(t,e)}}},4250:t=>{const e="PRE";t.exports={createCodeBlock:function(t){const n=document.createElement(e);return n.spellcheck=!1,n.classList.add("hljs"),n.innerHTML=t,n},isCodeBlock:function(t){return t.nodeName===e},TAGNAME:e,state:{activeBlock:null,languages:[]}}},4048:(t,e,n)=>{const{addPluginToPluginManager:r}=n(3994),o="CODE";function i(t){t.ui.registry.addToggleButton("inlinecode",{icon:"sourcecode",tooltip:"Inline code",onAction:function(){return a(t)},onSetup:function(e){var n=function(t){t.element.tagName!==o||t.element.innerHTML.trim().length||t.element.remove(),e.setActive(t.element.tagName===o)};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}}),t.addCommand("mceInsertInlineCode",(function(){a(t)}))}function a(t){t.undoManager.transact((()=>{t.focus();const e=t.selection.getRng();if(t.selection.getNode().tagName!==o&&e.startOffset===e.endOffset)t.selection.setContent('<code spellcheck="false">&#xFEFF;</code>');else{const e=t.selection.getContent();t.selection.setContent(`<code spellcheck="false">${e}</code>`)}}))}r("inlinecode",i)},7804:(t,e,n)=>{const{addPluginToPluginManager:r}=n(3994);function o(t){!function(t){if(!n.g.tinymce.Env.os.isAndroid())return;const e={previousSelection:{},selection:{},forcePreserveSelection:!1};t.on("beforeinput",(n=>{if("deleteContentBackward"===n.inputType){if(0!==e.previousSelection.offset)return;const n=t.selection.getRng();e.selection={container:n.startContainer,offset:n.startOffset},n.startContainer.textContent.endsWith(" ")&&(e.selection.offset-=1),e.forcePreserveSelection=!0}else e.selection={},e.forcePreserveSelection=!1})),t.on("keydown",(n=>{const r=t.selection.getRng();e.previousSelection={offset:r.startOffset,container:r.startContainer}})),t.on("keyup",(n=>{if(e.forcePreserveSelection){e.forcePreserveSelection=!1,n.preventDefault();const r=t.selection.getRng();r.setStart(e.selection.container,e.selection.offset),r.setEnd(e.selection.container,e.selection.offset)}}))}(t),function(t){if(!n.g.tinymce.Env.os.isAndroid())return;const e={};t.on("beforeinput",(t=>{"insertCompositionText"===t.inputType?t.data&&t.data.endsWith("\n")&&e.isKeyUnidentified&&(e.isKeyUnidentified=null,e.forceMoveSelectionToNextNode=!0):(e.isKeyUnidentified=null,e.forceMoveSelectionToNextNode=!1)})),t.on("keydown",(t=>{e.isKeyUnidentified="Unidentified"===t.key})),t.on("keyup",(n=>{if(e.forceMoveSelectionToNextNode){e.forceMoveSelectionToNextNode=!1,n.preventDefault();let r,o=t.selection.getRng().startContainer.parentElement;for(;o.parentElement&&!o.parentElement.classList.contains("mce-content-body");)o=o.parentElement;if(r=o.nextElementSibling,!r)return;r.innerHTML="<br>",t.selection.setCursorLocation(r,0)}}))}(t),function(t){if(!n.g.tinymce.Env.os.isAndroid())return;t.on("SelectionChange",(()=>{const e=t.selection.getNode();if(e.textContent.length>1&&65279===e.textContent.charCodeAt(0)){const n=t.selection.getRng();e.textContent=e.textContent.substring(1),n.setStart(e,n.startOffset+1),t.selection.setRng(n)}}))}(t)}r("keyboardquirks",o)},1014:()=>{var t,e,n,r,o,i,a,u,c,s,l,f,d,m,g,h,p,v,b,y,w,x,C,S,k,T,O,E,_,R,N,A,D,M,B,z,P,L,I,H,F,V,j,U,W,q,$,G,K,X,Y,J,Q,Z,tt,et,nt,rt,ot,it,at,ut,ct,st,lt,ft,dt,mt,gt,ht,pt,vt,bt,yt,wt,xt,Ct,St,kt,Tt,Ot,Et,_t,Rt,Nt,At,Dt,Mt,Bt,zt,Pt,Lt,It,Ht,Ft,Vt,jt,Ut,Wt,qt,$t;a=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},u=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(t){return!function(t){return null==t}(t)},t="function",s=function(e){return typeof e===t},l=function(){},d=(f=function(t){return function(){return t}})(!1),m=f(!0),g=function(){return h},e=function(t){return t.isNone()},h={fold:function(t,e){return t()},is:d,isSome:d,isNone:m,getOr:r=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:f(null),getOrUndefined:f(void 0),or:r,orThunk:n,map:g,each:l,bind:g,exists:d,forall:m,filter:g,equals:e,equals_:e,toArray:function(){return[]},toString:f("none()")},v={some:p=function(t){var e=f(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:m,isNone:d,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return p(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:h},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(d,(function(e){return n(t,e)}))}};return o},none:g,from:function(t){return null==t?h:p(t)}},b=Array.prototype.slice,y=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},w=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},x=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},C=s(Array.from)?Array.from:function(t){return b.call(t)},S=function(){var t=a(v.none());return{clear:function(){return t.set(v.none())},set:function(e){return t.set(v.some(e))},isSet:function(){return t.get().isSome()},on:function(e){return t.get().each(e)}}},k=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},T=tinymce.util.Tools.resolve("tinymce.Env"),O=tinymce.util.Tools.resolve("tinymce.util.Delay"),E=tinymce.util.Tools.resolve("tinymce.util.Promise"),_=tinymce.util.Tools.resolve("tinymce.util.VK"),R=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},N=tinymce.util.Tools.resolve("tinymce.util.Tools"),A=function(t){return t.getParam("paste_data_images",!1)},D=function(t){return t.getParam("paste_merge_formats",!0)},M=function(t){return t.getParam("paste_retain_style_properties")},B=function(t){return t.getParam("validate")},z=function(t){return t.getParam("allow_html_data_urls",!1,"boolean")},P=function(t){return t.getParam("paste_data_images",!1,"boolean")},L=function(t){return N.explode(t.getParam("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"))},I="x-tinymce/html",H="\x3c!-- x-tinymce/html --\x3e",F=function(t){return-1!==t.indexOf(H)},V=function(){return I},j=tinymce.util.Tools.resolve("tinymce.html.Entities"),U=function(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+j.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",a=N.map(r,(function(t){return t.split(/\n/).join("<br />")}));return 1===a.length?a[0]:N.map(a,(function(t){return o+t+i})).join("")},W=tinymce.util.Tools.resolve("tinymce.html.DomParser"),q=tinymce.util.Tools.resolve("tinymce.html.Serializer"),$=" ",G=tinymce.util.Tools.resolve("tinymce.html.Node"),K=tinymce.util.Tools.resolve("tinymce.html.Schema"),X=function(t,e){return N.each(e,(function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])})),t},Y=function(t){return t=X(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(t,e,n){return e||n?$:" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},J=function(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs-internal-guid-/.test(t)},Q=function(t){var e;return t=t.replace(/^[\u00a0 ]+/,""),N.each([/^[IVXLMCD]+\.[ \u00a0]/,/^[ivxlmcd]+\.[ \u00a0]/,/^[a-z]{1,2}[.)][ \u00a0]/,/^[A-Z]{1,2}[.)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],(function(n){if(n.test(t))return e=!0,!1})),e},Z=function(t,e,n,r){var o,i={},a=t.dom.parseStyle(r);return N.each(a,(function(a,u){switch(u){case"mso-list":(o=/\w+ \w+([0-9]+)/i.exec(r))&&(n._listLevel=parseInt(o[1],10)),/Ignore/i.test(a)&&n.firstChild&&(n._listIgnore=!0,n.firstChild._listIgnore=!0);break;case"horiz-align":u="text-align";break;case"vert-align":u="vertical-align";break;case"font-color":case"mso-foreground":u="color";break;case"mso-background":case"mso-highlight":u="background";break;case"font-weight":case"font-style":return void("normal"!==a&&(i[u]=a));case"mso-element":if(/^(comment|comment-list)$/i.test(a))return void n.remove()}0!==u.indexOf("mso-comment")?0!==u.indexOf("mso-")&&("all"===M(t)||e&&e[u])&&(i[u]=a):n.remove()})),/(bold)/i.test(i["font-weight"])&&(delete i["font-weight"],n.wrap(new G("b",1))),/(italic)/i.test(i["font-style"])&&(delete i["font-style"],n.wrap(new G("i",1))),(i=t.dom.serializeStyle(i,n.name))||null},tt=function(t,e){var n,r=M(t);r&&(n=N.makeMap(r.split(/[, ]/))),e=X(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,$],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return e.length>0?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join($):""}]]);var o=function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")}(t),i=K({valid_elements:o,valid_children:"-li[p]"});N.each(i.elements,(function(t){t.attributes.class||(t.attributes.class={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))}));var a=W({},i);a.addAttributeFilter("style",(function(e){for(var r,o=e.length;o--;)(r=e[o]).attr("style",Z(t,n,r,r.attr("style"))),"span"===r.name&&r.parent&&!r.attributes.length&&r.unwrap()})),a.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)})),a.addNodeFilter("del",(function(t){for(var e=t.length;e--;)t[e].remove()})),a.addNodeFilter("a",(function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()}));var u=a.parse(e);return function(t){return t.getParam("paste_convert_word_fake_lists",!0)}(t)&&function(t){for(var e,n,r=1,o=function(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)do{e+=o(t)}while(t=t.next);return e},i=function(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!i(t,e))return!1}while(t=t.next);return!0},a=function(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)do{a(t)}while(t=t.next)},u=function(t,o,u){var c=t._listLevel||r;c!==r&&(c<r?e&&(e=e.parent.parent):(n=e,e=null)),e&&e.name===o?e.append(t):(n=n||e,e=new G(o,1),u>1&&e.attr("start",""+u),t.wrap(e)),t.name="li",c>r&&n&&n.lastChild.append(e),r=c,a(t),i(t,/^\u00a0+/),i(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),i(t,/^\u00a0+/)},c=[],s=t.firstChild;null!=s;)if(c.push(s),null!==(s=s.walk()))for(;void 0!==s&&s.parent!==t;)s=s.walk();for(var l=0;l<c.length;l++)if("p"===(t=c[l]).name&&t.firstChild){var f=o(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(f)){u(t,"ul");continue}if(Q(f)){var d=/([0-9]+)\./.exec(f),m=1;d&&(m=parseInt(d[1],10)),u(t,"ol",m);continue}if(t._listLevel){u(t,"ul",1);continue}e=null}else n=e,e=null}(u),e=q({validate:B(t)},i).serialize(u)},et=function(t,e){return{content:t,cancelled:e}},nt=function(t,e,n,r){var o=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})}(t,e,n,r),i=function(t,e){var n=W({},t.schema);n.addNodeFilter("meta",(function(t){N.each(t,(function(t){t.remove()}))}));var r=n.parse(e,{forced_root_block:!1,isRootContent:!0});return q({validate:B(t)},t.schema).serialize(r)}(t,o.content);return t.hasEventListeners("PastePostProcess")&&!o.isDefaultPrevented()?function(t,e,n,r){var o=t.dom.create("div",{style:"display:none"},e),i=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})}(t,o,n,r);return et(i.node.innerHTML,i.isDefaultPrevented())}(t,i,n,r):et(i,o.isDefaultPrevented())},rt=function(t,e,n){var r=J(e),o=r?function(t,e){return function(t){return t.getParam("paste_enable_default_filters",!0)}(t)?tt(t,e):e}(t,e):e;return nt(t,o,n,r)},ot=function(t,e){return t.insertContent(e,{merge:D(t),paste:!0}),!0},it=function(t){return/^https?:\/\/[\w?\-/+=.&%@~#]+$/i.test(t)},at=function(t,e){return it(e)&&y(L(t),(function(t){return n=e.toLowerCase(),r="."+t.toLowerCase(),k(n,r,n.length-r.length);var n,r}))},ut=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!it(e))&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.execCommand("mceInsertLink",!1,e)})),!0}(t,e,n)},ct=function(t,e,n){return!!at(t,e)&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.insertContent('<img src="'+e+'">')})),!0}(t,e,n)},st=function(t,e,n){n||!1===function(t){return t.getParam("smart_paste",!0)}(t)?ot(t,e):function(t,e){N.each([ut,ct,ot],(function(n){return!0!==n(t,e,ot)}))}(t,e)},lt=function(t){return"\n"===t||"\r"===t},ft=function(t,e){var n,r,o,i,a=(n=" ",(r=function(t){return t.getParam("paste_tab_spaces",4,"number")}(t))<=0?"":new Array(r+1).join(n)),u=e.replace(/\t/g,a);return(o=function(t,e){return function(t){return-1!==" \f\t\v".indexOf(t)}(e)||e===$?t.pcIsSpace||""===t.str||t.str.length===u.length-1||function(t,e){return e<t.length&&e>=0&&lt(t[e])}(u,t.str.length+1)?{pcIsSpace:!1,str:t.str+$}:{pcIsSpace:!0,str:t.str+" "}:{pcIsSpace:lt(e),str:t.str+e}},i={pcIsSpace:!1,str:""},x(u,(function(t){i=o(i,t)})),i).str},dt=function(t,e,n,r){var o=rt(t,e,n);!1===o.cancelled&&st(t,o.content,r)},mt=function(t,e,n){var r=n||F(e);dt(t,function(t){return t.replace(H,"")}(e),r,!1)},gt=function(t,e){var n=t.dom.encode(e).replace(/\r\n/g,"\n"),r=function(t,e,n){return e?U(t,!0===e?"p":e,n):function(t){return t.replace(/\r?\n/g,"<br>")}(t)}(ft(t,n),function(t){return t.getParam("forced_root_block")}(t),function(t){return t.getParam("forced_root_block_attrs")}(t));dt(t,r,!1,!0)},ht=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&n.length>0&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(t){e[o]=""}}}return e},pt=function(t,e){return e in t&&t[e].length>0},vt=function(t){return pt(t,"text/html")||pt(t,"text/plain")},o="mceclip",i=0,bt=function(){return o+i++},yt=function(t,e){var n,r,o=(n=e.uri,(r=/data:([^;]+);base64,([a-z0-9+/=]+)/i.exec(n))?{type:r[1],data:decodeURIComponent(r[2])}:{type:null,data:null}),i=o.data,a=o.type,u=bt(),s=e.blob,l=new Image;if(l.src=e.uri,function(t,e){var n=function(t){return t.getParam("images_dataimg_filter")}(t);return!n||n(e)}(t,l)){var f=t.editorUpload.blobCache,d=void 0,m=f.getByData(i,a);if(m)d=m;else{var g=function(t){return t.getParam("images_reuse_filename")}(t)&&c(s.name),h=g?function(t,e){var n=e.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return c(n)?t.dom.encode(n[1]):null}(t,s.name):u,p=g?s.name:void 0;d=f.create(u,s,i,h,p),f.add(d)}mt(t,'<img src="'+d.blobUri()+'">',!1)}else mt(t,'<img src="'+e.uri+'">',!1)},wt=function(t){return E.all(w(t,(function(t){return new E((function(e){var n=function(t){return c(t.getAsFile)}(t)?t.getAsFile():t,r=new window.FileReader;r.onload=function(){e({blob:n,uri:r.result})},r.readAsDataURL(n)}))})))},xt=function(t){var e=L(t);return function(t){return function(t,e){return k(t,e,0)}(t.type,"image/")&&y(e,(function(e){return n=e.toLowerCase(),r={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"},(N.hasOwn(r,n)?"image/"+r[n]:"image/"+n)===t.type;var n,r}))}},Ct=function(t,e,n){var r="paste"===e.type?e.clipboardData:e.dataTransfer;if(P(t)&&r){var o=function(t,e){var n=e.items?w(C(e.items),(function(t){return t.getAsFile()})):[],r=e.files?C(e.files):[];return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(n.length>0?n:r,xt(t))}(t,r);if(o.length>0)return e.preventDefault(),wt(o).then((function(e){n&&t.selection.setRng(n),x(e,(function(e){yt(t,e)}))})),!0}return!1},St=function(t){return _.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},kt=function(t,e,n){var r,o=S(),i=S();t.on("keyup",i.clear),t.on("keydown",(function(n){var a=function(t){St(t)&&!t.isDefaultPrevented()&&e.remove()};if(St(n)&&!n.isDefaultPrevented()){if((r=n.shiftKey&&86===n.keyCode)&&T.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(n.stopImmediatePropagation(),o.set(n),i.set(!0),T.ie&&r)return n.preventDefault(),void function(t,e){t.fire("paste",{ieFake:e})}(t,!0);e.remove(),e.create(),t.once("keyup",a),t.once("paste",(function(){t.off("keyup",a)}))}}));var a=function(t,n,r,o,i){var a;pt(n,"text/html")?a=n["text/html"]:(a=e.getHtml(),i=i||F(a),e.isDefaultContent(a)&&(o=!0)),a=Y(a),e.remove();const u=t.selection.getNode();u&&"PRE"===u.tagName&&(o=!0);var c=!1===i&&!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(a),s=it(a);(!a.length||c&&!s)&&(o=!0),(o||s)&&(a=pt(n,"text/plain")&&c?n["text/plain"]:function(t){var e=K(),n=W({},e),r="",o=e.getShortEndedElements(),i=N.makeMap("script noscript style textarea video audio iframe object"," "),a=e.getBlockElements(),u=function(t){var e=t.name,n=t;if("br"!==e){if("wbr"!==e)if(o[e]&&(r+=" "),i[e])r+=" ";else{if(3===t.type&&(r+=t.value),!t.shortEnded&&(t=t.firstChild))do{u(t)}while(t=t.next);a[e]&&n.next&&(r+="\n","p"===e&&(r+="\n"))}}else r+="\n"};return t=X(t,[/<!\[[^\]]+\]>/g]),u(n.parse(t)),r}(a)),e.isDefaultContent(a)?r||t.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):o?gt(t,a):mt(t,a,i)};t.on("paste",(function(u){var c=o.isSet()||i.isSet();c&&o.clear();var s=function(t,e){return ht(e.clipboardData||t.getDoc().dataTransfer)}(t,u),l="text"===n.get()||r,f=pt(s,V());r=!1,u.isDefaultPrevented()||function(t){var e=t.clipboardData;return-1!==navigator.userAgent.indexOf("Android")&&e&&e.items&&0===e.items.length}(u)?e.remove():vt(s)||!Ct(t,u,e.getLastRng()||t.selection.getRng())?(c||u.preventDefault(),!T.ie||c&&!u.ieFake||pt(s,"text/html")||(e.create(),t.dom.bind(e.getEl(),"paste",(function(t){t.stopPropagation()})),t.getDoc().execCommand("Paste",!1,null),s["text/html"]=e.getHtml()),pt(s,"text/html")?(u.preventDefault(),f||(f=F(s["text/html"])),a(t,s,c,l,f)):O.setEditorTimeout(t,(function(){a(t,s,c,l,f)}),0)):e.remove()}))},Tt=function(t){return T.ie&&t.inline?document.body:t.getBody()},Ot=function(t,e,n){(function(t){return Tt(t)!==t.getBody()})(t)&&t.dom.bind(e,"paste keyup",(function(e){Rt(t,n)||t.fire("paste")}))},Et=function(t){return t.dom.get("mcepastebin")},_t=function(t,e){return e===t},Rt=function(t,e){var n,r=Et(t);return(n=r)&&"mcepastebin"===n.id&&_t(e,r.innerHTML)},Nt=function(t){var e=a(null),n="%MCEPASTEBIN%";return{create:function(){return function(t,e,n){var r=t.dom,o=t.getBody();e.set(t.selection.getRng());var i=t.dom.add(Tt(t),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n);(T.ie||T.gecko)&&r.setStyle(i,"left","rtl"===r.getStyle(o,"direction",!0)?65535:-65535),r.bind(i,"beforedeactivate focusin focusout",(function(t){t.stopPropagation()})),Ot(t,i,n),i.focus(),t.selection.select(i,!0)}(t,e,n)},remove:function(){return function(t,e){if(Et(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return Et(t)},getHtml:function(){return function(t){var e=function(e,n){e.appendChild(n),t.dom.remove(n,!0)},n=N.grep(Tt(t).childNodes,(function(t){return"mcepastebin"===t.id})),r=n.shift();N.each(n,(function(t){e(r,t)}));for(var o=t.dom.select("div[id=mcepastebin]",r),i=o.length-1;i>=0;i--){var a=t.dom.create("div");r.insertBefore(a,o[i]),e(a,o[i])}return r?r.innerHTML:""}(t)},getLastRng:function(){return function(t){return t.get()}(e)},isDefault:function(){return Rt(t,n)},isDefaultContent:function(t){return _t(n,t)}}},At=function(t,e){var n=Nt(t);return t.on("PreInit",(function(){return function(t,e,n){var r;kt(t,e,n),t.parser.addNodeFilter("img",(function(e,n,o){var i=function(t){t.attr("data-mce-object")||r===T.transparentSrc||t.remove()},a=function(t){return 0===t.indexOf("webkit-fake-url")},u=function(t){return 0===t.indexOf("data:")};if(!P(t)&&function(t){return t.data&&!0===t.data.paste}(o))for(var c=e.length;c--;)(r=e[c].attr("src"))&&(a(r)||!z(t)&&u(r))&&i(e[c])}))}(t,n,e)})),{pasteFormat:e,pasteHtml:function(e,n){return mt(t,e,n)},pasteText:function(e){return gt(t,e)},pasteImageData:function(e,n){return Ct(t,e,n)},getDataTransferItems:ht,hasHtmlOrText:vt,hasContentType:pt}},Dt=function(t,e){t.addCommand("mceTogglePlainTextPaste",(function(){!function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),R(t,!1)):(e.pasteFormat.set("text"),R(t,!0)),t.focus()}(t,e)})),t.addCommand("mceInsertClipboardContent",(function(t,n){n.content&&e.pasteHtml(n.content,n.internal),n.text&&e.pasteText(n.text)}))},Mt=function(t,e,n){if(!function(t){return!1===T.iOS&&"function"==typeof(null==t?void 0:t.setData)}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(V(),e),!0}catch(t){return!1}},Bt=function(t,e,n,r){Mt(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)},zt=function(t){return function(e,n){var r=function(t){return H+t}(e),o=t.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),i=t.dom.create("div",{contenteditable:"true"},r);t.dom.setStyles(o,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),o.appendChild(i),t.dom.add(t.getBody(),o);var a=t.selection.getRng();i.focus();var u=t.dom.createRng();u.selectNodeContents(i),t.selection.setRng(u),O.setTimeout((function(){t.selection.setRng(a),o.parentNode.removeChild(o),n()}),0)}},Pt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},Lt=function(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)},It=function(t){t.on("cut",function(t){return function(e){Lt(t)&&Bt(e,Pt(t),zt(t),(function(){if(T.browser.isChrome()||T.browser.isFirefox()){var e=t.selection.getRng();O.setEditorTimeout(t,(function(){t.selection.setRng(e),t.execCommand("Delete")}),0)}else t.execCommand("Delete")}))}}(t)),t.on("copy",function(t){return function(e){Lt(t)&&Bt(e,Pt(t),zt(t),l)}}(t))},Ht=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Ft=function(t,e){return Ht.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},Vt=function(t,e){t.focus(),t.selection.setRng(e)},jt=function(t,e){t.on("PastePreProcess",(function(n){n.content=e(t,n.content,n.internal,n.wordContent)}))},Ut=function(t,e){if(!J(e))return e;var n=[];N.each(t.schema.getBlockElements(),(function(t,e){n.push(e)}));var r=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return e=X(e,[[r,"$1"]]),e=X(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])},Wt=function(t,e,n,r){if(r||n)return e;var o,i=function(t){return t.getParam("paste_webkit_styles")}(t);if(!1===function(t){return t.getParam("paste_remove_styles_if_webkit",!0)}(t)||"all"===i)return e;if(i&&(o=i.split(/[, ]/)),o){var a=t.dom,u=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(function(t,e,n,r){var i=a.parseStyle(a.decode(n)),c={};if("none"===o)return e+r;for(var s=0;s<o.length;s++){var l=i[o[s]],f=a.getStyle(u,o[s],!0);/color/.test(o[s])&&(l=a.toHex(l),f=a.toHex(f)),f!==l&&(c[o[s]]=l)}return(c=a.serializeStyle(c,"span"))?e+' style="'+c+'"'+r:e+r}))}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(function(t,e,n,r){return e+' style="'+n+'"'+r}))},qt=function(t,e){t.$("a",e).find("font,u").each((function(e,n){t.dom.remove(n,!0)}))},$t=function(t,e){return function(n){n.setActive("text"===e.pasteFormat.get());var r=function(t){return n.setActive(t.state)};return t.on("PastePlainTextToggle",r),function(){return t.off("PastePlainTextToggle",r)}}},u.add("paste",(function(t){if(!1===function(t){return!!t.hasPlugin("powerpaste",!0)&&(void 0!==window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0)}(t)){var e=a(!1),n=a(function(t){return t.getParam("paste_as_text",!1)}(t)?"text":"html"),r=At(t,n),o=function(t){T.webkit&&jt(t,Wt),T.ie&&(jt(t,Ut),function(t,e){t.on("PastePostProcess",(function(n){e(t,n.node)}))}(t,qt))}(t);return function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:$t(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:$t(t,e)})}(t,r),Dt(t,r),function(t){var e=t.plugins.paste,n=function(t){return t.getParam("paste_preprocess")}(t);n&&t.on("PastePreProcess",(function(t){n.call(e,e,t)}));var r=function(t){return t.getParam("paste_postprocess")}(t);r&&t.on("PastePostProcess",(function(t){r.call(e,e,t)}))}(t),It(t),function(t,e,n){(function(t){return t.getParam("paste_block_drop",!1)})(t)&&t.on("dragend dragover draggesture dragdrop drop drag",(function(t){t.preventDefault(),t.stopPropagation()})),A(t)||t.on("drop",(function(t){var e=t.dataTransfer;e&&e.files&&e.files.length>0&&t.preventDefault()})),t.on("drop",(function(r){var o=Ft(t,r);if(!r.isDefaultPrevented()&&!n.get()){var i,a=e.getDataTransferItems(r.dataTransfer),u=e.hasContentType(a,V());if((e.hasHtmlOrText(a)&&(!(i=a["text/plain"])||0!==i.indexOf("file://"))||!e.pasteImageData(r,o))&&o&&function(t){return t.getParam("paste_filter_drop",!0)}(t)){var c=a["mce-internal"]||a["text/html"]||a["text/plain"];c&&(r.preventDefault(),O.setEditorTimeout(t,(function(){t.undoManager.transact((function(){a["mce-internal"]&&t.execCommand("Delete"),Vt(t,o),c=Y(c),a["text/html"]?e.pasteHtml(c,u):e.pasteText(c)}))})))}}})),t.on("dragstart",(function(t){n.set(!0)})),t.on("dragover dragend",(function(e){A(t)&&!1===n.get()&&(e.preventDefault(),Vt(t,Ft(t,e))),"dragend"===e.type&&n.set(!1)}))}(t,r,e),function(t,e){return{clipboard:t,quirks:e}}(r,o)}}))},3994:(t,e,n)=>{const r=n(3554);function o(t){if(!t)return;const e=r.getSelection().saveCharacterRanges(t);if(!e||!e.length)return;const{characterRange:n}=e[0];return n}t.exports={getCurrentLine:function(t){const e=o(t),n=t.innerText.split("\n");let r="",i=0;for(let t of n){let n=i+t.length+1;if(e.start>=i&&e.end<=n){r=t;break}i+=t.length+1}return r},getCharacterRange:o,moveCaretTo:function(t,e,n){const o={characterRange:{start:e,end:n||e}};r.getSelection().restoreCharacterRanges(t,[o])},persistSelection:function(t,e){let n=r.getSelection().saveCharacterRanges(t);e(),r.getSelection().restoreCharacterRanges(t,n)},getNextCharacter:function(t,e){return e?(t.textContent||t.innerText).substring(e.end,e.end+1):""},getPreviousCharacter:function(t,e){return e?(t.textContent||t.innerText).substring(e.start,e.start-1):""},addPluginToPluginManager:function(t,e){if(!n.g.tinymce)throw new Error(`Please import tinymce before importing the ${t} plugin.`);n.g.tinymce.PluginManager.add(t,e)}}},2968:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/dark/content.css"},6202:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/dark/content.min.css"},7286:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/default/content.css"},7362:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/default/content.min.css"},287:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/document/content.css"},2271:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/document/content.min.css"},5417:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/writer/content.css"},874:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/content/writer/content.min.css"},3341:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.css"},8786:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.inline.css"},4243:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.inline.min.css"},9702:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.min.css"},1389:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.mobile.css"},3513:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/content.mobile.min.css"},1064:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/fonts/tinymce-mobile.woff"},8057:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.css"},6332:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.min.css"},4429:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.mobile.css"},18:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.mobile.min.css"},7899:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.shadowdom.css"},7548:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide-dark/skin.shadowdom.min.css"},9506:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.css"},8273:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.inline.css"},7251:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.inline.min.css"},6122:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.min.css"},993:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.mobile.css"},8215:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/content.mobile.min.css"},9916:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/fonts/tinymce-mobile.woff"},8382:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.css"},4522:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.min.css"},108:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.mobile.css"},8537:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.mobile.min.css"},818:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.shadowdom.css"},6913:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=n.p+"skins/ui/oxide/skin.shadowdom.min.css"},9008:function(t,e,n){var r,o;void 0===(o="function"==typeof(r=function(){var t="object",e="function",n="undefined",r=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],o=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],i=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],a=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function u(n,r){var o=typeof n[r];return o==e||!(o!=t||!n[r])||"unknown"==o}function c(e,n){return!(typeof e[n]!=t||!e[n])}function s(t,e){return typeof t[e]!=n}function l(t){return function(e,n){for(var r=n.length;r--;)if(!t(e,n[r]))return!1;return!0}}var f=l(u),d=l(c),m=l(s);function g(t){return t&&f(t,a)&&m(t,i)}function h(t){return c(t,"body")?t.body:t.getElementsByTagName("body")[0]}var p,v,b={},y=typeof window!=n&&typeof document!=n,w={isHostMethod:u,isHostObject:c,isHostProperty:s,areHostMethods:f,areHostObjects:d,areHostProperties:m,isTextRange:g,getBody:h,forEach:[].forEach?function(t,e){t.forEach(e)}:function(t,e){for(var n=0,r=t.length;n<r;++n)e(t[n],n)}},x={version:"1.3.0",initialized:!1,isBrowser:y,supported:!0,util:w,features:{},modules:b,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==n||rangyAutoInitialize}};function C(t){typeof console!=n&&u(console,"log")&&console.log(t)}function S(t,e){y&&e?alert(t):C(t)}function k(t){x.initialized=!0,x.supported=!1,S("Rangy is not supported in this environment. Reason: "+t,x.config.alertOnFail)}function T(t){S("Rangy warning: "+t,x.config.alertOnWarn)}x.fail=k,x.warn=T,{}.hasOwnProperty?(w.extend=p=function(t,e,n){var r,o;for(var i in e)e.hasOwnProperty(i)&&(r=t[i],o=e[i],n&&null!==r&&"object"==typeof r&&null!==o&&"object"==typeof o&&p(r,o,!0),t[i]=o);return e.hasOwnProperty("toString")&&(t.toString=e.toString),t},w.createOptions=function(t,e){var n={};return p(n,e),t&&p(n,t),n}):k("hasOwnProperty not supported"),y||k("Rangy can only run in a browser"),function(){var t;if(y){var e=document.createElement("div");e.appendChild(document.createElement("span"));var n=[].slice;try{1==n.call(e.childNodes,0)[0].nodeType&&(t=function(t){return n.call(t,0)})}catch(t){}}t||(t=function(t){for(var e=[],n=0,r=t.length;n<r;++n)e[n]=t[n];return e}),w.toArray=t}(),y&&(u(document,"addEventListener")?v=function(t,e,n){t.addEventListener(e,n,!1)}:u(document,"attachEvent")?v=function(t,e,n){t.attachEvent("on"+e,n)}:k("Document does not have required addEventListener or attachEvent method"),w.addListener=v);var O=[];function E(t){return t.message||t.description||String(t)}function _(){if(y&&!x.initialized){var t,e=!1,n=!1;u(document,"createRange")&&(t=document.createRange(),f(t,o)&&m(t,r)&&(e=!0));var i=h(document);if(i&&"body"==i.nodeName.toLowerCase())if(i&&u(i,"createTextRange")&&g(t=i.createTextRange())&&(n=!0),e||n){var a;for(var c in x.initialized=!0,x.features={implementsDomRange:e,implementsTextRange:n},b)(a=b[c])instanceof M&&a.init(a,x);for(var s=0,l=O.length;s<l;++s)try{O[s](x)}catch(t){C("Rangy init listener threw an exception. Continuing. Detail: "+E(t))}}else k("Neither Range nor TextRange are available");else k("No body element found")}}function R(t,e,n){n&&(t+=" in module "+n.name),x.warn("DEPRECATED: "+t+" is deprecated. Please use "+e+" instead.")}function N(t,e,n,r){t[e]=function(){return R(e,n,r),t[n].apply(t,w.toArray(arguments))}}w.deprecationNotice=R,w.createAliasForDeprecatedMethod=N,x.init=_,x.addInitListener=function(t){x.initialized?t(x):O.push(t)};var A=[];function D(t){t=t||window,_();for(var e=0,n=A.length;e<n;++e)A[e](t)}function M(t,e,n){this.name=t,this.dependencies=e,this.initialized=!1,this.supported=!1,this.initializer=n}function B(t,e,n){var r=new M(t,e,(function(e){if(!e.initialized){e.initialized=!0;try{n(x,e),e.supported=!0}catch(e){C("Module '"+t+"' failed to load: "+E(e)),e.stack&&C(e.stack)}}}));return b[t]=r,r}function z(){}function P(){}x.addShimListener=function(t){A.push(t)},y&&(x.shim=x.createMissingNativeApi=D,N(x,"createMissingNativeApi","shim")),M.prototype={init:function(){for(var t,e,n=this.dependencies||[],r=0,o=n.length;r<o;++r){if(e=n[r],!((t=b[e])&&t instanceof M))throw new Error("required module '"+e+"' not found");if(t.init(),!t.supported)throw new Error("required module '"+e+"' not supported")}this.initializer(this)},fail:function(t){throw this.initialized=!0,this.supported=!1,new Error(t)},warn:function(t){x.warn("Module "+this.name+": "+t)},deprecationNotice:function(t,e){x.warn("DEPRECATED: "+t+" in module "+this.name+" is deprecated. Please use "+e+" instead")},createError:function(t){return new Error("Error in Rangy "+this.name+" module: "+t)}},x.createModule=function(t){var e,n;2==arguments.length?(e=arguments[1],n=[]):(e=arguments[2],n=arguments[1]);var r=B(t,n,e);x.initialized&&x.supported&&r.init()},x.createCoreModule=function(t,e,n){B(t,e,n)},x.RangePrototype=z,x.rangePrototype=new z,x.selectionPrototype=new P,x.createCoreModule("DomUtil",[],(function(t,e){var n="undefined",r=t.util,o=r.getBody;r.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||e.fail("document missing a Node creation method"),r.isHostMethod(document,"getElementsByTagName")||e.fail("document missing getElementsByTagName method");var i=document.createElement("div");r.areHostMethods(i,["insertBefore","appendChild","cloneNode"]||0)||e.fail("Incomplete Element implementation"),r.isHostProperty(i,"innerHTML")||e.fail("Element is missing innerHTML property");var a=document.createTextNode("test");r.areHostMethods(a,["splitText","deleteData","insertData","appendData","cloneNode"]||0)||e.fail("Incomplete Text Node implementation");var u=function(t,e){for(var n=t.length;n--;)if(t[n]===e)return!0;return!1};function c(t){var e;return typeof t.namespaceURI==n||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function s(t){var e=t.parentNode;return 1==e.nodeType?e:null}function l(t){for(var e=0;t=t.previousSibling;)++e;return e}function f(t){switch(t.nodeType){case 7:case 10:return 0;case 3:case 8:return t.length;default:return t.childNodes.length}}function d(t,e){var n,r=[];for(n=t;n;n=n.parentNode)r.push(n);for(n=e;n;n=n.parentNode)if(u(r,n))return n;return null}function m(t,e,n){for(var r=n?e:e.parentNode;r;){if(r===t)return!0;r=r.parentNode}return!1}function g(t,e){return m(t,e,!0)}function h(t,e,n){for(var r,o=n?t:t.parentNode;o;){if((r=o.parentNode)===e)return o;o=r}return null}function p(t){var e=t.nodeType;return 3==e||4==e||8==e}function v(t){if(!t)return!1;var e=t.nodeType;return 3==e||8==e}function b(t,e){var n=e.nextSibling,r=e.parentNode;return n?r.insertBefore(t,n):r.appendChild(t),t}function y(t,e,n){var r=t.cloneNode(!1);if(r.deleteData(0,e),t.deleteData(e,t.length-e),b(r,t),n)for(var o,i=0;o=n[i++];)o.node==t&&o.offset>e?(o.node=r,o.offset-=e):o.node==t.parentNode&&o.offset>l(t)&&++o.offset;return r}function w(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=n)return t.ownerDocument;if(typeof t.document!=n)return t.document;if(t.parentNode)return w(t.parentNode);throw e.createError("getDocument: no document found for node")}function x(t){var r=w(t);if(typeof r.defaultView!=n)return r.defaultView;if(typeof r.parentWindow!=n)return r.parentWindow;throw e.createError("Cannot get a window object for node")}function C(t){if(typeof t.contentDocument!=n)return t.contentDocument;if(typeof t.contentWindow!=n)return t.contentWindow.document;throw e.createError("getIframeDocument: No Document object found for iframe element")}function S(t){if(typeof t.contentWindow!=n)return t.contentWindow;if(typeof t.contentDocument!=n)return t.contentDocument.defaultView;throw e.createError("getIframeWindow: No Window object found for iframe element")}function k(t){return t&&r.isHostMethod(t,"setTimeout")&&r.isHostObject(t,"document")}function T(t,e,n){var o;if(t?r.isHostProperty(t,"nodeType")?o=1==t.nodeType&&"iframe"==t.tagName.toLowerCase()?C(t):w(t):k(t)&&(o=t.document):o=document,!o)throw e.createError(n+"(): Parameter must be a Window object or DOM node");return o}function O(t){for(var e;e=t.parentNode;)t=e;return t}function E(t,n,r,o){var i,a,u,c,s;if(t==r)return n===o?0:n<o?-1:1;if(i=h(r,t,!0))return n<=l(i)?-1:1;if(i=h(t,r,!0))return l(i)<o?-1:1;if(!(a=d(t,r)))throw new Error("comparePoints error: nodes have no common ancestor");if((u=t===a?a:h(t,a,!0))===(c=r===a?a:h(r,a,!0)))throw e.createError("comparePoints got to case 4 and childA and childB are the same!");for(s=a.firstChild;s;){if(s===u)return-1;if(s===c)return 1;s=s.nextSibling}}var _,R=!1;function N(t){try{return t.parentNode,!1}catch(t){return!0}}function A(t){if(!t)return"[No node]";if(R&&N(t))return"[Broken node]";if(p(t))return'"'+t.data+'"';if(1==t.nodeType){var e=t.id?' id="'+t.id+'"':"";return"<"+t.nodeName+e+">[index:"+l(t)+",length:"+t.childNodes.length+"]["+(t.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return t.nodeName}function D(t){for(var e,n=w(t).createDocumentFragment();e=t.firstChild;)n.appendChild(e);return n}function M(t,e,n){var r=o(t),i=t.createElement("div");i.contentEditable=""+!!n,e&&(i.innerHTML=e);var a=r.firstChild;return a?r.insertBefore(i,a):r.appendChild(i),i}function B(t){return t.parentNode.removeChild(t)}function z(t){this.root=t,this._next=t}function P(t){return new z(t)}function L(t,e){this.node=t,this.offset=e}function I(t){this.code=this[t],this.codeName=t,this.message="DOMException: "+this.codeName}!function(){var e=document.createElement("b");e.innerHTML="1";var n=e.firstChild;e.innerHTML="<br />",R=N(n),t.features.crashyTextNodes=R}(),typeof window.getComputedStyle!=n?_=function(t,e){return x(t).getComputedStyle(t,null)[e]}:typeof document.documentElement.currentStyle!=n?_=function(t,e){return t.currentStyle?t.currentStyle[e]:""}:e.fail("No means of obtaining computed style properties found"),z.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var t,e,n=this._current=this._next;if(this._current)if(t=n.firstChild)this._next=t;else{for(e=null;n!==this.root&&!(e=n.nextSibling);)n=n.parentNode;this._next=e}return this._current},detach:function(){this._current=this._next=this.root=null}},L.prototype={equals:function(t){return!!t&&this.node===t.node&&this.offset==t.offset},inspect:function(){return"[DomPosition("+A(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}},I.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},I.prototype.toString=function(){return this.message},t.dom={arrayContains:u,isHtmlNamespace:c,parentElement:s,getNodeIndex:l,getNodeLength:f,getCommonAncestor:d,isAncestorOf:m,isOrIsAncestorOf:g,getClosestAncestorIn:h,isCharacterDataNode:p,isTextOrCommentNode:v,insertAfter:b,splitDataNode:y,getDocument:w,getWindow:x,getIframeWindow:S,getIframeDocument:C,getBody:o,isWindow:k,getContentDocument:T,getRootContainer:O,comparePoints:E,isBrokenNode:N,inspectNode:A,getComputedStyleProperty:_,createTestElement:M,removeNode:B,fragmentFromNodeChildren:D,createIterator:P,DomPosition:L},t.DOMException=I})),x.createCoreModule("DomRange",["DomUtil"],(function(t,e){var n=t.dom,r=t.util,o=n.DomPosition,i=t.DOMException,a=n.isCharacterDataNode,u=n.getNodeIndex,c=n.isOrIsAncestorOf,s=n.getDocument,l=n.comparePoints,f=n.splitDataNode,d=n.getClosestAncestorIn,m=n.getNodeLength,g=n.arrayContains,h=n.getRootContainer,p=t.features.crashyTextNodes,v=n.removeNode;function b(t,e){return 3!=t.nodeType&&(c(t,e.startContainer)||c(t,e.endContainer))}function y(t){return t.document||s(t.startContainer)}function w(t){return h(t.startContainer)}function x(t){return new o(t.parentNode,u(t))}function C(t){return new o(t.parentNode,u(t)+1)}function S(t,e,r){var o=11==t.nodeType?t.firstChild:t;return a(e)?r==e.length?n.insertAfter(t,e):e.parentNode.insertBefore(t,0==r?e:f(e,r)):r>=e.childNodes.length?e.appendChild(t):e.insertBefore(t,e.childNodes[r]),o}function k(t,e,n){if(X(t),X(e),y(e)!=y(t))throw new i("WRONG_DOCUMENT_ERR");var r=l(t.startContainer,t.startOffset,e.endContainer,e.endOffset),o=l(t.endContainer,t.endOffset,e.startContainer,e.startOffset);return n?r<=0&&o>=0:r<0&&o>0}function T(t){for(var e,n,r,o=y(t.range).createDocumentFragment();n=t.next();){if(e=t.isPartiallySelectedSubtree(),n=n.cloneNode(!e),e&&(r=t.getSubtreeIterator(),n.appendChild(T(r)),r.detach()),10==n.nodeType)throw new i("HIERARCHY_REQUEST_ERR");o.appendChild(n)}return o}function O(t,e,r){var o,i,a,u;for(r=r||{stop:!1};a=t.next();)if(t.isPartiallySelectedSubtree()){if(!1===e(a))return void(r.stop=!0);if(O(u=t.getSubtreeIterator(),e,r),u.detach(),r.stop)return}else for(o=n.createIterator(a);i=o.next();)if(!1===e(i))return void(r.stop=!0)}function E(t){for(var e;t.next();)t.isPartiallySelectedSubtree()?(E(e=t.getSubtreeIterator()),e.detach()):t.remove()}function _(t){for(var e,n,r=y(t.range).createDocumentFragment();e=t.next();){if(t.isPartiallySelectedSubtree()?(e=e.cloneNode(!1),n=t.getSubtreeIterator(),e.appendChild(_(n)),n.detach()):t.remove(),10==e.nodeType)throw new i("HIERARCHY_REQUEST_ERR");r.appendChild(e)}return r}function R(t,e,n){var r,o=!(!e||!e.length),i=!!n;o&&(r=new RegExp("^("+e.join("|")+")$"));var u=[];return O(new A(t,!1),(function(e){if((!o||r.test(e.nodeType))&&(!i||n(e))){var c=t.startContainer;if(e!=c||!a(c)||t.startOffset!=c.length){var s=t.endContainer;e==s&&a(s)&&0==t.endOffset||u.push(e)}}})),u}function N(t){return"["+(void 0===t.getName?"Range":t.getName())+"("+n.inspectNode(t.startContainer)+":"+t.startOffset+", "+n.inspectNode(t.endContainer)+":"+t.endOffset+")]"}function A(t,e){if(this.range=t,this.clonePartiallySelectedTextNodes=e,!t.collapsed){this.sc=t.startContainer,this.so=t.startOffset,this.ec=t.endContainer,this.eo=t.endOffset;var n=t.commonAncestorContainer;this.sc===this.ec&&a(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==n||a(this.sc)?d(this.sc,n,!0):this.sc.childNodes[this.so],this._last=this.ec!==n||a(this.ec)?d(this.ec,n,!0):this.ec.childNodes[this.eo-1])}}A.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var t=this._current=this._next;return t&&(this._next=t!==this._last?t.nextSibling:null,a(t)&&this.clonePartiallySelectedTextNodes&&(t===this.ec&&(t=t.cloneNode(!0)).deleteData(this.eo,t.length-this.eo),this._current===this.sc&&(t=t.cloneNode(!0)).deleteData(0,this.so))),t},remove:function(){var t,e,n=this._current;!a(n)||n!==this.sc&&n!==this.ec?n.parentNode&&v(n):(t=n===this.sc?this.so:0)!=(e=n===this.ec?this.eo:n.length)&&n.deleteData(t,e-t)},isPartiallySelectedSubtree:function(){return b(this._current,this.range)},getSubtreeIterator:function(){var t;if(this.isSingleCharacterDataNode)(t=this.range.cloneRange()).collapse(!1);else{t=new pt(y(this.range));var e=this._current,n=e,r=0,o=e,i=m(e);c(e,this.sc)&&(n=this.sc,r=this.so),c(e,this.ec)&&(o=this.ec,i=this.eo),ht(t,n,r,o,i)}return new A(t,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var D=[1,3,4,5,7,8,10],M=[2,9,11],B=[5,6,10,12],z=[1,3,4,5,7,8,10,11],P=[1,3,4,5,7,8];function L(t){return function(e,n){for(var r,o=n?e:e.parentNode;o;){if(r=o.nodeType,g(t,r))return o;o=o.parentNode}return null}}var I=L([9,11]),H=L(B),F=L([6,10,12]);function V(t,e){if(F(t,e))throw new i("INVALID_NODE_TYPE_ERR")}function j(t,e){if(!g(e,t.nodeType))throw new i("INVALID_NODE_TYPE_ERR")}function U(t,e){if(e<0||e>(a(t)?t.length:t.childNodes.length))throw new i("INDEX_SIZE_ERR")}function W(t,e){if(I(t,!0)!==I(e,!0))throw new i("WRONG_DOCUMENT_ERR")}function q(t){if(H(t,!0))throw new i("NO_MODIFICATION_ALLOWED_ERR")}function $(t,e){if(!t)throw new i(e)}function G(t,e){return e<=(a(t)?t.length:t.childNodes.length)}function K(t){return!!t.startContainer&&!!t.endContainer&&!(p&&(n.isBrokenNode(t.startContainer)||n.isBrokenNode(t.endContainer)))&&h(t.startContainer)==h(t.endContainer)&&G(t.startContainer,t.startOffset)&&G(t.endContainer,t.endOffset)}function X(t){if(!K(t))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+t.inspect()+")")}var Y=document.createElement("style"),J=!1;try{Y.innerHTML="<b>x</b>",J=3==Y.firstChild.nodeType}catch(t){}t.features.htmlParsingConforms=J;var Q=J?function(t){var e=this.startContainer,r=s(e);if(!e)throw new i("INVALID_STATE_ERR");var o=null;return 1==e.nodeType?o=e:a(e)&&(o=n.parentElement(e)),(o=null===o||"HTML"==o.nodeName&&n.isHtmlNamespace(s(o).documentElement)&&n.isHtmlNamespace(o)?r.createElement("body"):o.cloneNode(!1)).innerHTML=t,n.fragmentFromNodeChildren(o)}:function(t){var e=y(this).createElement("body");return e.innerHTML=t,n.fragmentFromNodeChildren(e)};function Z(t,e){X(t);var n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=n===o;a(o)&&i>0&&i<o.length&&f(o,i,e),a(n)&&r>0&&r<n.length&&(n=f(n,r,e),c?(i-=r,o=n):o==n.parentNode&&i>=u(n)&&i++,r=0),t.setStartAndEnd(n,r,o,i)}function tt(t){X(t);var e=t.commonAncestorContainer.parentNode.cloneNode(!1);return e.appendChild(t.cloneContents()),e.innerHTML}var et=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],nt=0,rt=1,ot=2,it=3,at=0,ut=1,ct=2,st=3;function lt(t){t.START_TO_START=nt,t.START_TO_END=rt,t.END_TO_END=ot,t.END_TO_START=it,t.NODE_BEFORE=at,t.NODE_AFTER=ut,t.NODE_BEFORE_AND_AFTER=ct,t.NODE_INSIDE=st}function ft(t){lt(t),lt(t.prototype)}function dt(t,e){return function(){X(this);var n,r=this.startContainer,o=this.startOffset,i=this.commonAncestorContainer,a=new A(this,!0);r!==i&&(r=(n=C(d(r,i,!0))).node,o=n.offset),O(a,q),a.reset();var u=t(a);return a.detach(),e(this,r,o,r,o),u}}function mt(e,n){function o(t,e){return function(n){j(n,D),j(h(n),M);var r=(t?x:C)(n);(e?i:c)(this,r.node,r.offset)}}function i(t,e,r){var o=t.endContainer,i=t.endOffset;e===t.startContainer&&r===t.startOffset||(h(e)==h(o)&&1!=l(e,r,o,i)||(o=e,i=r),n(t,e,r,o,i))}function c(t,e,r){var o=t.startContainer,i=t.startOffset;e===t.endContainer&&r===t.endOffset||(h(e)==h(o)&&-1!=l(e,r,o,i)||(o=e,i=r),n(t,o,i,e,r))}var s=function(){};s.prototype=t.rangePrototype,e.prototype=new s,r.extend(e.prototype,{setStart:function(t,e){V(t,!0),U(t,e),i(this,t,e)},setEnd:function(t,e){V(t,!0),U(t,e),c(this,t,e)},setStartAndEnd:function(){var t=arguments,e=t[0],r=t[1],o=e,i=r;switch(t.length){case 3:i=t[2];break;case 4:o=t[2],i=t[3]}n(this,e,r,o,i)},setBoundary:function(t,e,n){this["set"+(n?"Start":"End")](t,e)},setStartBefore:o(!0,!0),setStartAfter:o(!1,!0),setEndBefore:o(!0,!1),setEndAfter:o(!1,!1),collapse:function(t){X(this),t?n(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):n(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(t){V(t,!0),n(this,t,0,t,m(t))},selectNode:function(t){V(t,!1),j(t,D);var e=x(t),r=C(t);n(this,e.node,e.offset,r.node,r.offset)},extractContents:dt(_,n),deleteContents:dt(E,n),canSurroundContents:function(){X(this),q(this.startContainer),q(this.endContainer);var t=new A(this,!0),e=t._first&&b(t._first,this)||t._last&&b(t._last,this);return t.detach(),!e},splitBoundaries:function(){Z(this)},splitBoundariesPreservingPositions:function(t){Z(this,t)},normalizeBoundaries:function(){X(this);var t,e=this.startContainer,r=this.startOffset,o=this.endContainer,i=this.endOffset,c=function(t){var e=t.nextSibling;e&&e.nodeType==t.nodeType&&(o=t,i=t.length,t.appendData(e.data),v(e))},s=function(t){var n=t.previousSibling;if(n&&n.nodeType==t.nodeType){e=t;var a=t.length;if(r=n.length,t.insertData(0,n.data),v(n),e==o)i+=r,o=e;else if(o==t.parentNode){var c=u(t);i==c?(o=t,i=a):i>c&&i--}}},l=!0;if(a(o))i==o.length?c(o):0==i&&(t=o.previousSibling)&&t.nodeType==o.nodeType&&(i=t.length,e==o&&(l=!1),t.appendData(o.data),v(o),o=t);else{if(i>0){var f=o.childNodes[i-1];f&&a(f)&&c(f)}l=!this.collapsed}if(l){if(a(e))0==r?s(e):r==e.length&&(t=e.nextSibling)&&t.nodeType==e.nodeType&&(o==t&&(o=e,i+=e.length),e.appendData(t.data),v(t));else if(r<e.childNodes.length){var d=e.childNodes[r];d&&a(d)&&s(d)}}else e=o,r=i;n(this,e,r,o,i)},collapseToPoint:function(t,e){V(t,!0),U(t,e),this.setStartAndEnd(t,e)}}),ft(e)}function gt(t){t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset,t.commonAncestorContainer=t.collapsed?t.startContainer:n.getCommonAncestor(t.startContainer,t.endContainer)}function ht(t,e,r,o,i){t.startContainer=e,t.startOffset=r,t.endContainer=o,t.endOffset=i,t.document=n.getDocument(e),gt(t)}function pt(t){this.startContainer=t,this.startOffset=0,this.endContainer=t,this.endOffset=0,this.document=t,gt(this)}r.extend(t.rangePrototype,{compareBoundaryPoints:function(t,e){var n,r,o,i;X(this),W(this.startContainer,e.startContainer);var a=t==it||t==nt?"start":"end",u=t==rt||t==nt?"start":"end";return n=this[a+"Container"],r=this[a+"Offset"],o=e[u+"Container"],i=e[u+"Offset"],l(n,r,o,i)},insertNode:function(t){if(X(this),j(t,z),q(this.startContainer),c(t,this.startContainer))throw new i("HIERARCHY_REQUEST_ERR");var e=S(t,this.startContainer,this.startOffset);this.setStartBefore(e)},cloneContents:function(){var t,e;if(X(this),this.collapsed)return y(this).createDocumentFragment();if(this.startContainer===this.endContainer&&a(this.startContainer))return(t=this.startContainer.cloneNode(!0)).data=t.data.slice(this.startOffset,this.endOffset),(e=y(this).createDocumentFragment()).appendChild(t),e;var n=new A(this,!0);return t=T(n),n.detach(),t},canSurroundContents:function(){X(this),q(this.startContainer),q(this.endContainer);var t=new A(this,!0),e=t._first&&b(t._first,this)||t._last&&b(t._last,this);return t.detach(),!e},surroundContents:function(t){if(j(t,P),!this.canSurroundContents())throw new i("INVALID_STATE_ERR");var e=this.extractContents();if(t.hasChildNodes())for(;t.lastChild;)t.removeChild(t.lastChild);S(t,this.startContainer,this.startOffset),t.appendChild(e),this.selectNode(t)},cloneRange:function(){X(this);for(var t,e=new pt(y(this)),n=et.length;n--;)e[t=et[n]]=this[t];return e},toString:function(){X(this);var t=this.startContainer;if(t===this.endContainer&&a(t))return 3==t.nodeType||4==t.nodeType?t.data.slice(this.startOffset,this.endOffset):"";var e=[],n=new A(this,!0);return O(n,(function(t){3!=t.nodeType&&4!=t.nodeType||e.push(t.data)})),n.detach(),e.join("")},compareNode:function(t){X(this);var e=t.parentNode,n=u(t);if(!e)throw new i("NOT_FOUND_ERR");var r=this.comparePoint(e,n),o=this.comparePoint(e,n+1);return r<0?o>0?ct:at:o>0?ut:st},comparePoint:function(t,e){return X(this),$(t,"HIERARCHY_REQUEST_ERR"),W(t,this.startContainer),l(t,e,this.startContainer,this.startOffset)<0?-1:l(t,e,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:Q,toHtml:function(){return tt(this)},intersectsNode:function(t,e){if(X(this),h(t)!=w(this))return!1;var n=t.parentNode,r=u(t);if(!n)return!0;var o=l(n,r,this.endContainer,this.endOffset),i=l(n,r+1,this.startContainer,this.startOffset);return e?o<=0&&i>=0:o<0&&i>0},isPointInRange:function(t,e){return X(this),$(t,"HIERARCHY_REQUEST_ERR"),W(t,this.startContainer),l(t,e,this.startContainer,this.startOffset)>=0&&l(t,e,this.endContainer,this.endOffset)<=0},intersectsRange:function(t){return k(this,t,!1)},intersectsOrTouchesRange:function(t){return k(this,t,!0)},intersection:function(t){if(this.intersectsRange(t)){var e=l(this.startContainer,this.startOffset,t.startContainer,t.startOffset),n=l(this.endContainer,this.endOffset,t.endContainer,t.endOffset),r=this.cloneRange();return-1==e&&r.setStart(t.startContainer,t.startOffset),1==n&&r.setEnd(t.endContainer,t.endOffset),r}return null},union:function(t){if(this.intersectsOrTouchesRange(t)){var e=this.cloneRange();return-1==l(t.startContainer,t.startOffset,this.startContainer,this.startOffset)&&e.setStart(t.startContainer,t.startOffset),1==l(t.endContainer,t.endOffset,this.endContainer,this.endOffset)&&e.setEnd(t.endContainer,t.endOffset),e}throw new i("Ranges do not intersect")},containsNode:function(t,e){return e?this.intersectsNode(t,!1):this.compareNode(t)==st},containsNodeContents:function(t){return this.comparePoint(t,0)>=0&&this.comparePoint(t,m(t))<=0},containsRange:function(t){var e=this.intersection(t);return null!==e&&t.equals(e)},containsNodeText:function(t){var e=this.cloneRange();e.selectNode(t);var n=e.getNodes([3]);if(n.length>0){e.setStart(n[0],0);var r=n.pop();return e.setEnd(r,r.length),this.containsRange(e)}return this.containsNodeContents(t)},getNodes:function(t,e){return X(this),R(this,t,e)},getDocument:function(){return y(this)},collapseBefore:function(t){this.setEndBefore(t),this.collapse(!1)},collapseAfter:function(t){this.setStartAfter(t),this.collapse(!0)},getBookmark:function(e){var r=y(this),o=t.createRange(r);e=e||n.getBody(r),o.selectNodeContents(e);var i=this.intersection(o),a=0,u=0;return i&&(o.setEnd(i.startContainer,i.startOffset),u=(a=o.toString().length)+i.toString().length),{start:a,end:u,containerNode:e}},moveToBookmark:function(t){var e=t.containerNode,n=0;this.setStart(e,0),this.collapse(!0);for(var r,o,i,a,u=[e],c=!1,s=!1;!s&&(r=u.pop());)if(3==r.nodeType)o=n+r.length,!c&&t.start>=n&&t.start<=o&&(this.setStart(r,t.start-n),c=!0),c&&t.end>=n&&t.end<=o&&(this.setEnd(r,t.end-n),s=!0),n=o;else for(i=(a=r.childNodes).length;i--;)u.push(a[i])},getName:function(){return"DomRange"},equals:function(t){return pt.rangesEqual(this,t)},isValid:function(){return K(this)},inspect:function(){return N(this)},detach:function(){}}),mt(pt,ht),r.extend(pt,{rangeProperties:et,RangeIterator:A,copyComparisonConstants:ft,createPrototypeRange:mt,inspect:N,toHtml:tt,getRangeDocument:y,rangesEqual:function(t,e){return t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset}}),t.DomRange=pt})),x.createCoreModule("WrappedRange",["DomRange"],(function(t,e){var n,r,o=t.dom,i=t.util,a=o.DomPosition,u=t.DomRange,c=o.getBody,s=o.getContentDocument,l=o.isCharacterDataNode;if(t.features.implementsDomRange&&function(){var r,a,l=u.rangeProperties;function f(t){for(var e,n=l.length;n--;)t[e=l[n]]=t.nativeRange[e];t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset}function d(t,e,n,r,o){var i=t.startContainer!==e||t.startOffset!=n,a=t.endContainer!==r||t.endOffset!=o,u=!t.equals(t.nativeRange);(i||a||u)&&(t.setEnd(r,o),t.setStart(e,n))}n=function(t){if(!t)throw e.createError("WrappedRange: Range must be specified");this.nativeRange=t,f(this)},u.createPrototypeRange(n,d),(r=n.prototype).selectNode=function(t){this.nativeRange.selectNode(t),f(this)},r.cloneContents=function(){return this.nativeRange.cloneContents()},r.surroundContents=function(t){this.nativeRange.surroundContents(t),f(this)},r.collapse=function(t){this.nativeRange.collapse(t),f(this)},r.cloneRange=function(){return new n(this.nativeRange.cloneRange())},r.refresh=function(){f(this)},r.toString=function(){return this.nativeRange.toString()};var m=document.createTextNode("test");c(document).appendChild(m);var g=document.createRange();g.setStart(m,0),g.setEnd(m,0);try{g.setStart(m,1),r.setStart=function(t,e){this.nativeRange.setStart(t,e),f(this)},r.setEnd=function(t,e){this.nativeRange.setEnd(t,e),f(this)},a=function(t){return function(e){this.nativeRange[t](e),f(this)}}}catch(t){r.setStart=function(t,e){try{this.nativeRange.setStart(t,e)}catch(n){this.nativeRange.setEnd(t,e),this.nativeRange.setStart(t,e)}f(this)},r.setEnd=function(t,e){try{this.nativeRange.setEnd(t,e)}catch(n){this.nativeRange.setStart(t,e),this.nativeRange.setEnd(t,e)}f(this)},a=function(t,e){return function(n){try{this.nativeRange[t](n)}catch(r){this.nativeRange[e](n),this.nativeRange[t](n)}f(this)}}}r.setStartBefore=a("setStartBefore","setEndBefore"),r.setStartAfter=a("setStartAfter","setEndAfter"),r.setEndBefore=a("setEndBefore","setStartBefore"),r.setEndAfter=a("setEndAfter","setStartAfter"),r.selectNodeContents=function(t){this.setStartAndEnd(t,0,o.getNodeLength(t))},g.selectNodeContents(m),g.setEnd(m,3);var h=document.createRange();h.selectNodeContents(m),h.setEnd(m,4),h.setStart(m,2),-1==g.compareBoundaryPoints(g.START_TO_END,h)&&1==g.compareBoundaryPoints(g.END_TO_START,h)?r.compareBoundaryPoints=function(t,e){return t==(e=e.nativeRange||e).START_TO_END?t=e.END_TO_START:t==e.END_TO_START&&(t=e.START_TO_END),this.nativeRange.compareBoundaryPoints(t,e)}:r.compareBoundaryPoints=function(t,e){return this.nativeRange.compareBoundaryPoints(t,e.nativeRange||e)};var p=document.createElement("div");p.innerHTML="123";var v=p.firstChild,b=c(document);b.appendChild(p),g.setStart(v,1),g.setEnd(v,2),g.deleteContents(),"13"==v.data&&(r.deleteContents=function(){this.nativeRange.deleteContents(),f(this)},r.extractContents=function(){var t=this.nativeRange.extractContents();return f(this),t}),b.removeChild(p),b=null,i.isHostMethod(g,"createContextualFragment")&&(r.createContextualFragment=function(t){return this.nativeRange.createContextualFragment(t)}),c(document).removeChild(m),r.getName=function(){return"WrappedRange"},t.WrappedRange=n,t.createNativeRange=function(t){return(t=s(t,e,"createNativeRange")).createRange()}}(),t.features.implementsTextRange){var f=function(t){var e=t.parentElement(),n=t.duplicate();n.collapse(!0);var r=n.parentElement();(n=t.duplicate()).collapse(!1);var i=n.parentElement(),a=r==i?r:o.getCommonAncestor(r,i);return a==e?a:o.getCommonAncestor(e,a)},d=function(t){return 0==t.compareEndPoints("StartToEnd",t)},m=function(t,e,n,r,i){var u=t.duplicate();u.collapse(n);var c=u.parentElement();if(o.isOrIsAncestorOf(e,c)||(c=e),!c.canHaveHTML){var s=new a(c.parentNode,o.getNodeIndex(c));return{boundaryPosition:s,nodeInfo:{nodeIndex:s.offset,containerElement:s.node}}}var f=o.getDocument(c).createElement("span");f.parentNode&&o.removeNode(f);for(var d,m,g,h,p,v=n?"StartToStart":"StartToEnd",b=i&&i.containerElement==c?i.nodeIndex:0,y=c.childNodes.length,w=y,x=w;x==y?c.appendChild(f):c.insertBefore(f,c.childNodes[x]),u.moveToElementText(f),0!=(d=u.compareEndPoints(v,t))&&b!=w;){if(-1==d){if(w==b+1)break;b=x}else w=w==b+1?b:x;x=Math.floor((b+w)/2),c.removeChild(f)}if(p=f.nextSibling,-1==d&&p&&l(p)){var C;if(u.setEndPoint(n?"EndToStart":"EndToEnd",t),/[\r\n]/.test(p.data)){var S=u.duplicate(),k=S.text.replace(/\r\n/g,"\r").length;for(C=S.moveStart("character",k);-1==(d=S.compareEndPoints("StartToEnd",S));)C++,S.moveStart("character",1)}else C=u.text.length;h=new a(p,C)}else m=(r||!n)&&f.previousSibling,h=(g=(r||n)&&f.nextSibling)&&l(g)?new a(g,0):m&&l(m)?new a(m,m.data.length):new a(c,o.getNodeIndex(f));return o.removeNode(f),{boundaryPosition:h,nodeInfo:{nodeIndex:x,containerElement:c}}},g=function(t,e){var n,r,i,a,u=t.offset,s=o.getDocument(t.node),f=c(s).createTextRange(),d=l(t.node);return d?r=(n=t.node).parentNode:(n=u<(a=t.node.childNodes).length?a[u]:null,r=t.node),(i=s.createElement("span")).innerHTML="&#feff;",n?r.insertBefore(i,n):r.appendChild(i),f.moveToElementText(i),f.collapse(!e),r.removeChild(i),d&&f[e?"moveStart":"moveEnd"]("character",u),f};(r=function(t){this.textRange=t,this.refresh()}).prototype=new u(document),r.prototype.refresh=function(){var t,e,n,r=f(this.textRange);d(this.textRange)?e=t=m(this.textRange,r,!0,!0).boundaryPosition:(t=(n=m(this.textRange,r,!0,!1)).boundaryPosition,e=m(this.textRange,r,!1,!1,n.nodeInfo).boundaryPosition),this.setStart(t.node,t.offset),this.setEnd(e.node,e.offset)},r.prototype.getName=function(){return"WrappedTextRange"},u.copyComparisonConstants(r);var h=function(t){if(t.collapsed)return g(new a(t.startContainer,t.startOffset),!0);var e=g(new a(t.startContainer,t.startOffset),!0),n=g(new a(t.endContainer,t.endOffset),!1),r=c(u.getRangeDocument(t)).createTextRange();return r.setEndPoint("StartToStart",e),r.setEndPoint("EndToEnd",n),r};if(r.rangeToTextRange=h,r.prototype.toTextRange=function(){return h(this)},t.WrappedTextRange=r,!t.features.implementsDomRange||t.config.preferTextRange){var p=Function("return this;")();void 0===p.Range&&(p.Range=r),t.createNativeRange=function(t){return t=s(t,e,"createNativeRange"),c(t).createTextRange()},t.WrappedRange=r}}t.createRange=function(n){return n=s(n,e,"createRange"),new t.WrappedRange(t.createNativeRange(n))},t.createRangyRange=function(t){return t=s(t,e,"createRangyRange"),new u(t)},i.createAliasForDeprecatedMethod(t,"createIframeRange","createRange"),i.createAliasForDeprecatedMethod(t,"createIframeRangyRange","createRangyRange"),t.addShimListener((function(e){var n=e.document;void 0===n.createRange&&(n.createRange=function(){return t.createRange(n)}),n=e=null}))})),x.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],(function(t,e){t.config.checkSelectionRanges=!0;var n,r,o="boolean",i="number",a=t.dom,u=t.util,c=u.isHostMethod,s=t.DomRange,l=t.WrappedRange,f=t.DOMException,d=a.DomPosition,m=t.features,g="Control",h=a.getDocument,p=a.getBody,v=s.rangesEqual;function b(t){return"string"==typeof t?/^backward(s)?$/i.test(t):!!t}function y(t,n){if(t){if(a.isWindow(t))return t;if(t instanceof K)return t.win;var r=a.getContentDocument(t,e,n);return a.getWindow(r)}return window}function w(t){return y(t,"getWinSelection").getSelection()}function x(t){return y(t,"getDocSelection").document.selection}function C(t){var e=!1;return t.anchorNode&&(e=1==a.comparePoints(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)),e}var S=c(window,"getSelection"),k=u.isHostObject(document,"selection");m.implementsWinGetSelection=S,m.implementsDocSelection=k;var T=k&&(!S||t.config.preferTextRange);if(T)n=x,t.isSelectionValid=function(t){var e=y(t,"isSelectionValid").document,n=e.selection;return"None"!=n.type||h(n.createRange().parentElement())==e};else{if(!S)return e.fail("Neither document.selection or window.getSelection() detected."),!1;n=w,t.isSelectionValid=function(){return!0}}t.getNativeSelection=n;var O=n();if(!O)return e.fail("Native selection was null (possibly issue 138?)"),!1;var E=t.createNativeRange(document),_=p(document),R=u.areHostProperties(O,["anchorNode","focusNode","anchorOffset","focusOffset"]);m.selectionHasAnchorAndFocus=R;var N=c(O,"extend");m.selectionHasExtend=N;var A=typeof O.rangeCount==i;m.selectionHasRangeCount=A;var D=!1,M=!0,B=N?function(e,n){var r=s.getRangeDocument(n),o=t.createRange(r);o.collapseToPoint(n.endContainer,n.endOffset),e.addRange(V(o)),e.extend(n.startContainer,n.startOffset)}:null;u.areHostMethods(O,["addRange","getRangeAt","removeAllRanges"])&&typeof O.rangeCount==i&&m.implementsDomRange&&function(){var e=window.getSelection();if(e){for(var n=e.rangeCount,r=n>1,o=[],i=C(e),u=0;u<n;++u)o[u]=e.getRangeAt(u);var c=a.createTestElement(document,"",!1),s=c.appendChild(document.createTextNode("   ")),l=document.createRange();if(l.setStart(s,1),l.collapse(!0),e.removeAllRanges(),e.addRange(l),M=1==e.rangeCount,e.removeAllRanges(),!r){var f=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(f&&parseInt(f[1])>=36)D=!1;else{var d=l.cloneRange();l.setStart(s,0),d.setEnd(s,3),d.setStart(s,2),e.addRange(l),e.addRange(d),D=2==e.rangeCount}}for(a.removeNode(c),e.removeAllRanges(),u=0;u<n;++u)0==u&&i?B?B(e,o[u]):(t.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),e.addRange(o[u])):e.addRange(o[u])}}(),m.selectionSupportsMultipleRanges=D,m.collapsedNonEditableSelectionsSupported=M;var z,P,L=!1;function I(t,e,n){var r=n?"end":"start",o=n?"start":"end";t.anchorNode=e[r+"Container"],t.anchorOffset=e[r+"Offset"],t.focusNode=e[o+"Container"],t.focusOffset=e[o+"Offset"]}function H(t){var e=t.nativeSelection;t.anchorNode=e.anchorNode,t.anchorOffset=e.anchorOffset,t.focusNode=e.focusNode,t.focusOffset=e.focusOffset}function F(t){t.anchorNode=t.focusNode=null,t.anchorOffset=t.focusOffset=0,t.rangeCount=0,t.isCollapsed=!0,t._ranges.length=0}function V(e){var n;return e instanceof s?((n=t.createNativeRange(e.getDocument())).setEnd(e.endContainer,e.endOffset),n.setStart(e.startContainer,e.startOffset)):e instanceof l?n=e.nativeRange:m.implementsDomRange&&e instanceof a.getWindow(e.startContainer).Range&&(n=e),n}function j(t){if(!t.length||1!=t[0].nodeType)return!1;for(var e=1,n=t.length;e<n;++e)if(!a.isAncestorOf(t[0],t[e]))return!1;return!0}function U(t){var n=t.getNodes();if(!j(n))throw e.createError("getSingleElementFromRange: range "+t.inspect()+" did not consist of a single element");return n[0]}function W(t){return!!t&&void 0!==t.text}function q(t,e){var n=new l(e);t._ranges=[n],I(t,n,!1),t.rangeCount=1,t.isCollapsed=n.collapsed}function $(e){if(e._ranges.length=0,"None"==e.docSelection.type)F(e);else{var n=e.docSelection.createRange();if(W(n))q(e,n);else{e.rangeCount=n.length;for(var r,o=h(n.item(0)),i=0;i<e.rangeCount;++i)(r=t.createRange(o)).selectNode(n.item(i)),e._ranges.push(r);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,I(e,e._ranges[e.rangeCount-1],!1)}}}function G(t,n){for(var r=t.docSelection.createRange(),o=U(n),i=h(r.item(0)),a=p(i).createControlRange(),u=0,c=r.length;u<c;++u)a.add(r.item(u));try{a.add(o)}catch(t){throw e.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),$(t)}function K(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function X(t){t.win=t.anchorNode=t.focusNode=t._ranges=null,t.rangeCount=t.anchorOffset=t.focusOffset=0,t.detached=!0}_&&c(_,"createControlRange")&&(z=_.createControlRange(),u.areHostProperties(z,["item","add"])&&(L=!0)),m.implementsControlRange=L,r=R?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return!!t.rangeCount&&t.getRangeAt(t.rangeCount-1).collapsed},c(O,"getRangeAt")?P=function(t,e){try{return t.getRangeAt(e)}catch(t){return null}}:R&&(P=function(e){var n=h(e.anchorNode),r=t.createRange(n);return r.setStartAndEnd(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset),r.collapsed!==this.isCollapsed&&r.setStartAndEnd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset),r}),K.prototype=t.selectionPrototype;var Y=[];function J(t,e){for(var n,r,o=Y.length;o--;)if(r=(n=Y[o]).selection,"deleteAll"==e)X(r);else if(n.win==t)return"delete"==e?(Y.splice(o,1),!0):r;return"deleteAll"==e&&(Y.length=0),null}var Q=function(t){if(t&&t instanceof K)return t.refresh(),t;var e=J(t=y(t,"getNativeSelection")),r=n(t),o=k?x(t):null;return e?(e.nativeSelection=r,e.docSelection=o,e.refresh()):(e=new K(r,o,t),Y.push({win:t,selection:e})),e};t.getSelection=Q,u.createAliasForDeprecatedMethod(t,"getIframeSelection","getSelection");var Z,tt=K.prototype;function et(t,n){for(var r,o=h(n[0].startContainer),i=p(o).createControlRange(),a=0,u=n.length;a<u;++a){r=U(n[a]);try{i.add(r)}catch(t){throw e.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}i.select(),$(t)}if(!T&&R&&u.areHostMethods(O,["removeAllRanges","addRange"])){tt.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),F(this)};var nt=function(t,e){B(t.nativeSelection,e),t.refresh()};tt.addRange=A?function(e,n){if(L&&k&&this.docSelection.type==g)G(this,e);else if(b(n)&&N)nt(this,e);else{var o;D?o=this.rangeCount:(this.removeAllRanges(),o=0);var i=V(e).cloneRange();try{this.nativeSelection.addRange(i)}catch(t){}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==o+1){if(t.config.checkSelectionRanges){var a=P(this.nativeSelection,this.rangeCount-1);a&&!v(a,e)&&(e=new l(a))}this._ranges[this.rangeCount-1]=e,I(this,e,rt(this.nativeSelection)),this.isCollapsed=r(this)}else this.refresh()}}:function(t,e){b(e)&&N?nt(this,t):(this.nativeSelection.addRange(V(t)),this.refresh())},tt.setRanges=function(t){if(L&&k&&t.length>1)et(this,t);else{this.removeAllRanges();for(var e=0,n=t.length;e<n;++e)this.addRange(t[e])}}}else{if(!(c(O,"empty")&&c(E,"select")&&L&&T))return e.fail("No means of selecting a Range or TextRange was found"),!1;tt.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var t;if(this.anchorNode)t=h(this.anchorNode);else if(this.docSelection.type==g){var e=this.docSelection.createRange();e.length&&(t=h(e.item(0)))}t&&(p(t).createTextRange().select(),this.docSelection.empty())}}catch(t){}F(this)},tt.addRange=function(e){this.docSelection.type==g?G(this,e):(t.WrappedTextRange.rangeToTextRange(e).select(),this._ranges[0]=e,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,I(this,e,!1))},tt.setRanges=function(t){this.removeAllRanges();var e=t.length;e>1?et(this,t):e&&this.addRange(t[0])}}if(tt.getRangeAt=function(t){if(t<0||t>=this.rangeCount)throw new f("INDEX_SIZE_ERR");return this._ranges[t].cloneRange()},T)Z=function(e){var n;t.isSelectionValid(e.win)?n=e.docSelection.createRange():(n=p(e.win.document).createTextRange()).collapse(!0),e.docSelection.type==g?$(e):W(n)?q(e,n):F(e)};else if(c(O,"getRangeAt")&&typeof O.rangeCount==i)Z=function(e){if(L&&k&&e.docSelection.type==g)$(e);else if(e._ranges.length=e.rangeCount=e.nativeSelection.rangeCount,e.rangeCount){for(var n=0,o=e.rangeCount;n<o;++n)e._ranges[n]=new t.WrappedRange(e.nativeSelection.getRangeAt(n));I(e,e._ranges[e.rangeCount-1],rt(e.nativeSelection)),e.isCollapsed=r(e)}else F(e)};else{if(!R||typeof O.isCollapsed!=o||typeof E.collapsed!=o||!m.implementsDomRange)return e.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;Z=function(t){var e,n=t.nativeSelection;n.anchorNode?(e=P(n,0),t._ranges=[e],t.rangeCount=1,H(t),t.isCollapsed=r(t)):F(t)}}tt.refresh=function(t){var e=t?this._ranges.slice(0):null,n=this.anchorNode,r=this.anchorOffset;if(Z(this),t){var o=e.length;if(o!=this._ranges.length)return!0;if(this.anchorNode!=n||this.anchorOffset!=r)return!0;for(;o--;)if(!v(e[o],this._ranges[o]))return!0;return!1}};var rt,ot=function(t,e){var n=t.getAllRanges();t.removeAllRanges();for(var r=0,o=n.length;r<o;++r)v(e,n[r])||t.addRange(n[r]);t.rangeCount||F(t)};function it(t,e){if(t.win.document!=h(e))throw new f("WRONG_DOCUMENT_ERR")}function at(e){return function(n,r){var o;this.rangeCount?(o=this.getRangeAt(0))["set"+(e?"Start":"End")](n,r):(o=t.createRange(this.win.document)).setStartAndEnd(n,r),this.setSingleRange(o,this.isBackward())}}function ut(t){var e=[],n=new d(t.anchorNode,t.anchorOffset),r=new d(t.focusNode,t.focusOffset),o="function"==typeof t.getName?t.getName():"Selection";if(void 0!==t.rangeCount)for(var i=0,a=t.rangeCount;i<a;++i)e[i]=s.inspect(t.getRangeAt(i));return"["+o+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+r.inspect()+"]"}tt.removeRange=L&&k?function(t){if(this.docSelection.type==g){for(var e=this.docSelection.createRange(),n=U(t),r=h(e.item(0)),o=p(r).createControlRange(),i=!1,a=0,u=e.length;a<u;++a)e.item(a)!==n||i?o.add(e.item(a)):i=!0;o.select(),$(this)}else ot(this,t)}:function(t){ot(this,t)},!T&&R&&m.implementsDomRange?(rt=C,tt.isBackward=function(){return rt(this)}):rt=tt.isBackward=function(){return!1},tt.isBackwards=tt.isBackward,tt.toString=function(){for(var t=[],e=0,n=this.rangeCount;e<n;++e)t[e]=""+this._ranges[e];return t.join("")},tt.collapse=function(e,n){it(this,e);var r=t.createRange(e);r.collapseToPoint(e,n),this.setSingleRange(r),this.isCollapsed=!0},tt.collapseToStart=function(){if(!this.rangeCount)throw new f("INVALID_STATE_ERR");var t=this._ranges[0];this.collapse(t.startContainer,t.startOffset)},tt.collapseToEnd=function(){if(!this.rangeCount)throw new f("INVALID_STATE_ERR");var t=this._ranges[this.rangeCount-1];this.collapse(t.endContainer,t.endOffset)},tt.selectAllChildren=function(e){it(this,e);var n=t.createRange(e);n.selectNodeContents(e),this.setSingleRange(n)},tt.deleteFromDocument=function(){if(L&&k&&this.docSelection.type==g){for(var t,e=this.docSelection.createRange();e.length;)t=e.item(0),e.remove(t),a.removeNode(t);this.refresh()}else if(this.rangeCount){var n=this.getAllRanges();if(n.length){this.removeAllRanges();for(var r=0,o=n.length;r<o;++r)n[r].deleteContents();this.addRange(n[o-1])}}},tt.eachRange=function(t,e){for(var n=0,r=this._ranges.length;n<r;++n)if(t(this.getRangeAt(n)))return e},tt.getAllRanges=function(){var t=[];return this.eachRange((function(e){t.push(e)})),t},tt.setSingleRange=function(t,e){this.removeAllRanges(),this.addRange(t,e)},tt.callMethodOnEachRange=function(t,e){var n=[];return this.eachRange((function(r){n.push(r[t].apply(r,e||[]))})),n},tt.setStart=at(!0),tt.setEnd=at(!1),t.rangePrototype.select=function(t){Q(this.getDocument()).setSingleRange(this,t)},tt.changeEachRange=function(t){var e=[],n=this.isBackward();this.eachRange((function(n){t(n),e.push(n)})),this.removeAllRanges(),n&&1==e.length?this.addRange(e[0],"backward"):this.setRanges(e)},tt.containsNode=function(t,e){return this.eachRange((function(n){return n.containsNode(t,e)}),!0)||!1},tt.getBookmark=function(t){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[t])}},tt.moveToBookmark=function(e){for(var n,r,o=[],i=0;n=e.rangeBookmarks[i++];)(r=t.createRange(this.win)).moveToBookmark(n),o.push(r);e.backward?this.setSingleRange(o[0],"backward"):this.setRanges(o)},tt.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},tt.restoreRanges=function(t){this.removeAllRanges();for(var e,n=0;e=t.ranges[n];++n)this.addRange(e,t.backward&&0==n)},tt.toHtml=function(){var t=[];return this.eachRange((function(e){t.push(s.toHtml(e))})),t.join("")},m.implementsTextRange&&(tt.getNativeTextRange=function(){var n;if(n=this.docSelection){var r=n.createRange();if(W(r))return r;throw e.createError("getNativeTextRange: selection is a control selection")}if(this.rangeCount>0)return t.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw e.createError("getNativeTextRange: selection contains no range")}),tt.getName=function(){return"WrappedSelection"},tt.inspect=function(){return ut(this)},tt.detach=function(){J(this.win,"delete"),X(this)},K.detachAll=function(){J(null,"deleteAll")},K.inspect=ut,K.isDirectionBackward=b,t.Selection=K,t.selectionPrototype=tt,t.addShimListener((function(t){void 0===t.getSelection&&(t.getSelection=function(){return Q(t)}),t=null}))}));var L=!1,I=function(t){L||(L=!0,!x.initialized&&x.config.autoInitialize&&_())};return y&&("complete"==document.readyState?I():(u(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",I,!1),v(window,"load",I))),x})?r.call(e,n,e,t):r)||(t.exports=o)},3554:function(t,e,n){var r,o,i;o=[n(9008)],void 0===(i="function"==typeof(r=function(t){return t.createModule("TextRange",["WrappedSelection"],(function(t,e){var n,r,o,i="undefined",a="character",u="word",c=t.dom,s=t.util,l=s.extend,f=s.createOptions,d=c.getBody,m=/^[ \t\f\r\n]+$/,g=/^[ \t\f\r]+$/,h=/^[\t-\r \u0085\u00A0\u1680\u180E\u2000-\u200B\u2028\u2029\u202F\u205F\u3000]+$/,p=/^[\t \u00A0\u1680\u180E\u2000-\u200B\u202F\u205F\u3000]+$/,v="en",b=t.Selection.isDirectionBackward,y=!1,w=!1,x=!0;function C(t,e){var n,r=t.join(""),o=[];function i(t,e,n){o.push({start:t,end:e,isWord:n})}for(var a,u,c=0;n=e.wordRegex.exec(r);){if(u=(a=n.index)+n[0].length,a>c&&i(c,a,!1),e.includeTrailingSpace)for(;p.test(t[u]);)++u;i(a,u,!0),c=u}return c<t.length&&i(c,t.length,!1),o}function S(t,e){for(var n=t.slice(e.start,e.end),r={isWord:e.isWord,chars:n,toString:function(){return n.join("")}},o=0,i=n.length;o<i;++o)n[o].token=r;return r}function k(t,e,n){for(var r,o=n(t,e),i=[],a=0;r=o[a++];)i.push(S(t,r));return i}n=c.createTestElement(document,"<p>1 </p><p></p>",!0),r=n.firstChild,(o=t.getSelection()).collapse(r.lastChild,2),o.setStart(r.firstChild,0),n.innerHTML="1 <br />",o.collapse(n,2),o.setStart(n.firstChild,0),y=1==(""+o).length,n.innerHTML="1 <p>1</p>",o.collapse(n,2),o.setStart(n.firstChild,0),w=1==(""+o).length,c.removeNode(n),o.removeAllRanges();var T={includeBlockContentTrailingSpace:!0,includeSpaceBeforeBr:!0,includeSpaceBeforeBlock:!0,includePreLineTrailingSpace:!0,ignoreCharacters:""};function O(t){var e=t||"",n="string"==typeof e?e.split(""):e;return n.sort((function(t,e){return t.charCodeAt(0)-e.charCodeAt(0)})),n.join("").replace(/(.)\1+/g,"$1")}var E={includeBlockContentTrailingSpace:!x,includeSpaceBeforeBr:!y,includeSpaceBeforeBlock:!w,includePreLineTrailingSpace:!0},_={en:{wordRegex:/[a-z0-9]+('[a-z0-9]+)*/gi,includeTrailingSpace:!1,tokenizer:C}},R={caseSensitive:!1,withinRange:null,wholeWordsOnly:!1,wrap:!1,direction:"forward",wordOptions:null,characterOptions:null},N={wordOptions:null,characterOptions:null},A={wordOptions:null,characterOptions:null,trim:!1,trimStart:!0,trimEnd:!0},D={wordOptions:null,characterOptions:null,direction:"forward"};function M(t){var e,n;return t?(e=t.language||v,l(n={},_[e]||_[v]),l(n,t),n):_[v]}function B(t,e){var n=f(t,e);return e.hasOwnProperty("wordOptions")&&(n.wordOptions=M(n.wordOptions)),e.hasOwnProperty("characterOptions")&&(n.characterOptions=f(n.characterOptions,T)),n}var z,P,L,I=c.getComputedStyleProperty;P=document.createElement("table"),(L=d(document)).appendChild(P),z="block"==I(P,"display"),L.removeChild(P);var H={table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell"};function F(t,e){var n=I(t,"display",e),r=t.tagName.toLowerCase();return"block"==n&&z&&H.hasOwnProperty(r)?H[r]:n}function V(t){for(var e=$(t),n=0,r=e.length;n<r;++n)if(1==e[n].nodeType&&"none"==F(e[n]))return!0;return!1}function j(t){var e;return 3==t.nodeType&&(e=t.parentNode)&&"hidden"==I(e,"visibility")}function U(t){return t&&(1==t.nodeType&&!/^(inline(-block|-table)?|none)$/.test(F(t))||9==t.nodeType||11==t.nodeType)}function W(t){return c.isCharacterDataNode(t)||!/^(area|base|basefont|br|col|frame|hr|img|input|isindex|link|meta|param)$/i.test(t.nodeName)}function q(t){for(var e=[];t.parentNode;)e.unshift(t.parentNode),t=t.parentNode;return e}function $(t){return q(t).concat([t])}function G(t){for(;t&&!t.nextSibling;)t=t.parentNode;return t?t.nextSibling:null}function K(t,e){return!e&&t.hasChildNodes()?t.firstChild:G(t)}function X(t){var e=t.previousSibling;if(e){for(t=e;t.hasChildNodes();)t=t.lastChild;return t}var n=t.parentNode;return n&&1==n.nodeType?n:null}function Y(t){if(!t||3!=t.nodeType)return!1;var e=t.data;if(""===e)return!0;var n=t.parentNode;if(!n||1!=n.nodeType)return!1;var r=I(t.parentNode,"whiteSpace");return/^[\t\n\r ]+$/.test(e)&&/^(normal|nowrap)$/.test(r)||/^[\t\r ]+$/.test(e)&&"pre-line"==r}function J(t){return""===t.data||!!Y(t)&&(!t.parentNode||!!V(t))}function Q(t){var e=t.nodeType;return 7==e||8==e||V(t)||/^(script|style)$/i.test(t.nodeName)||j(t)||J(t)}function Z(t,e){var n=t.nodeType;return 7==n||8==n||1==n&&"none"==F(t,e)}function tt(){this.store={}}function et(t,e,n){return function(r){var o=this.cache;if(o.hasOwnProperty(t))return o[t];var i=e.call(this,n?this[n]:this,r);return o[t]=i,i}}function nt(t,e){this.node=t,this.session=e,this.cache=new tt,this.positions=new tt}tt.prototype={get:function(t){return this.store.hasOwnProperty(t)?this.store[t]:null},set:function(t,e){return this.store[t]=e}};var rt={getPosition:function(t){var e=this.positions;return e.get(t)||e.set(t,new gt(this,t))},toString:function(){return"[NodeWrapper("+c.inspectNode(this.node)+")]"}};nt.prototype=rt;var ot="EMPTY",it="NON_SPACE",at="UNCOLLAPSIBLE_SPACE",ut="COLLAPSIBLE_SPACE",ct="TRAILING_SPACE_BEFORE_BLOCK",st="TRAILING_SPACE_IN_BLOCK",lt="TRAILING_SPACE_BEFORE_BR",ft="PRE_LINE_TRAILING_SPACE_BEFORE_LINE_BREAK",dt="TRAILING_LINE_BREAK_AFTER_BR",mt="INCLUDED_TRAILING_LINE_BREAK_AFTER_BR";function gt(t,e){this.offset=e,this.nodeWrapper=t,this.node=t.node,this.session=t.session,this.cache=new tt}function ht(){return"[Position("+c.inspectNode(this.node)+":"+this.offset+")]"}l(rt,{isCharacterDataNode:et("isCharacterDataNode",c.isCharacterDataNode,"node"),getNodeIndex:et("nodeIndex",c.getNodeIndex,"node"),getLength:et("nodeLength",c.getNodeLength,"node"),containsPositions:et("containsPositions",W,"node"),isWhitespace:et("isWhitespace",Y,"node"),isCollapsedWhitespace:et("isCollapsedWhitespace",J,"node"),getComputedDisplay:et("computedDisplay",F,"node"),isCollapsed:et("collapsed",Q,"node"),isIgnored:et("ignored",Z,"node"),next:et("nextPos",K,"node"),previous:et("previous",X,"node"),getTextNodeInfo:et("textNodeInfo",(function(t){var e=null,n=!1,r=I(t.parentNode,"whiteSpace"),o="pre-line"==r;return o?(e=g,n=!0):"normal"!=r&&"nowrap"!=r||(e=m,n=!0),{node:t,text:t.data,spaceRegex:e,collapseSpaces:n,preLine:o}}),"node"),hasInnerText:et("hasInnerText",(function(t,e){for(var n=this.session,r=n.getPosition(t.parentNode,this.getNodeIndex()+1),o=n.getPosition(t,0),i=e?r:o,a=e?o:r;i!==a;){if(i.prepopulateChar(),i.isDefinitelyNonEmpty())return!0;i=e?i.previousVisible():i.nextVisible()}return!1}),"node"),isRenderedBlock:et("isRenderedBlock",(function(t){for(var e=t.getElementsByTagName("br"),n=0,r=e.length;n<r;++n)if(!Q(e[n]))return!0;return this.hasInnerText()}),"node"),getTrailingSpace:et("trailingSpace",(function(t){if("br"==t.tagName.toLowerCase())return"";switch(this.getComputedDisplay()){case"inline":for(var e=t.lastChild;e;){if(!Z(e))return 1==e.nodeType?this.session.getNodeWrapper(e).getTrailingSpace():"";e=e.previousSibling}break;case"inline-block":case"inline-table":case"none":case"table-column":case"table-column-group":break;case"table-cell":return"\t";default:return this.isRenderedBlock(!0)?"\n":""}return""}),"node"),getLeadingSpace:et("leadingSpace",(function(t){switch(this.getComputedDisplay()){case"inline":case"inline-block":case"inline-table":case"none":case"table-column":case"table-column-group":case"table-cell":break;default:return this.isRenderedBlock(!1)?"\n":""}return""}),"node")});var pt={character:"",characterType:ot,isBr:!1,prepopulateChar:function(){var t=this;if(!t.prepopulatedChar){var e=t.node,n=t.offset,r="",o=ot,i=!1;if(n>0)if(3==e.nodeType){var a=e.data,u=a.charAt(n-1),c=t.nodeWrapper.getTextNodeInfo(),s=c.spaceRegex;c.collapseSpaces?s.test(u)?n>1&&s.test(a.charAt(n-2))||(c.preLine&&"\n"===a.charAt(n)?(r=" ",o=ft):(r=" ",o=ut)):(r=u,o=it,i=!0):(r=u,o=at,i=!0)}else{var l=e.childNodes[n-1];if(l&&1==l.nodeType&&!Q(l)&&("br"==l.tagName.toLowerCase()?(r="\n",t.isBr=!0,o=ut,i=!1):t.checkForTrailingSpace=!0),!r){var f=e.childNodes[n];f&&1==f.nodeType&&!Q(f)&&(t.checkForLeadingSpace=!0)}}t.prepopulatedChar=!0,t.character=r,t.characterType=o,t.isCharInvariant=i}},isDefinitelyNonEmpty:function(){var t=this.characterType;return t==it||t==at},resolveLeadingAndTrailingSpaces:function(){if(this.prepopulatedChar||this.prepopulateChar(),this.checkForTrailingSpace){var t=this.session.getNodeWrapper(this.node.childNodes[this.offset-1]).getTrailingSpace();t&&(this.isTrailingSpace=!0,this.character=t,this.characterType=ut),this.checkForTrailingSpace=!1}if(this.checkForLeadingSpace){var e=this.session.getNodeWrapper(this.node.childNodes[this.offset]).getLeadingSpace();e&&(this.isLeadingSpace=!0,this.character=e,this.characterType=ut),this.checkForLeadingSpace=!1}},getPrecedingUncollapsedPosition:function(t){for(var e=this;e=e.previousVisible();)if(""!==e.getCharacter(t))return e;return null},getCharacter:function(t){this.resolveLeadingAndTrailingSpaces();var e=this.character,n=O(t.ignoreCharacters),r=""!==e&&n.indexOf(e)>-1;if(this.isCharInvariant)return r?"":e;var o=["character",t.includeSpaceBeforeBr,t.includeBlockContentTrailingSpace,t.includePreLineTrailingSpace,n].join("_"),i=this.cache.get(o);if(null!==i)return i;var a,u,c="",s=this.characterType==ut,l=!1,f=this;function d(){return l||(u=f.getPrecedingUncollapsedPosition(t),l=!0),u}return s&&(this.type==mt?c="\n":" "==e&&(!d()||u.isTrailingSpace||"\n"==u.character||" "==u.character&&u.characterType==ut)||("\n"==e&&this.isLeadingSpace?d()&&"\n"!=u.character&&(c="\n"):(a=this.nextUncollapsed())&&(a.isBr?this.type=lt:a.isTrailingSpace&&"\n"==a.character?this.type=st:a.isLeadingSpace&&"\n"==a.character&&(this.type=ct),"\n"==a.character?(this.type!=lt||t.includeSpaceBeforeBr)&&(this.type!=ct||t.includeSpaceBeforeBlock)&&(this.type==st&&a.isTrailingSpace&&!t.includeBlockContentTrailingSpace||(this.type!=ft||a.type!=it||t.includePreLineTrailingSpace)&&("\n"==e?a.isTrailingSpace?this.isTrailingSpace||this.isBr&&(a.type=dt,d()&&u.isLeadingSpace&&!u.isTrailingSpace&&"\n"==u.character?a.character="":a.type=mt):c="\n":" "==e&&(c=" "))):c=e))),n.indexOf(c)>-1&&(c=""),this.cache.set(o,c),c},equals:function(t){return!!t&&this.node===t.node&&this.offset===t.offset},inspect:ht,toString:function(){return this.character}};gt.prototype=pt,l(pt,{next:et("nextPos",(function(t){var e,n,r,o=t.nodeWrapper,i=t.node,a=t.offset,u=o.session;return i?(a==o.getLength()?n=(e=i.parentNode)?o.getNodeIndex()+1:0:o.isCharacterDataNode()?(e=i,n=a+1):(r=i.childNodes[a],u.getNodeWrapper(r).containsPositions()?(e=r,n=0):(e=i,n=a+1)),e?u.getPosition(e,n):null):null})),previous:et("previous",(function(t){var e,n,r,o=t.nodeWrapper,i=t.node,a=t.offset,u=o.session;return 0==a?n=(e=i.parentNode)?o.getNodeIndex():0:o.isCharacterDataNode()?(e=i,n=a-1):(r=i.childNodes[a-1],u.getNodeWrapper(r).containsPositions()?(e=r,n=c.getNodeLength(r)):(e=i,n=a-1)),e?u.getPosition(e,n):null})),nextVisible:et("nextVisible",(function(t){var e=t.next();if(!e)return null;var n=e.nodeWrapper,r=e.node,o=e;return n.isCollapsed()&&(o=n.session.getPosition(r.parentNode,n.getNodeIndex()+1)),o})),nextUncollapsed:et("nextUncollapsed",(function(t){for(var e=t;e=e.nextVisible();)if(e.resolveLeadingAndTrailingSpaces(),""!==e.character)return e;return null})),previousVisible:et("previousVisible",(function(t){var e=t.previous();if(!e)return null;var n=e.nodeWrapper,r=e.node,o=e;return n.isCollapsed()&&(o=n.session.getPosition(r.parentNode,n.getNodeIndex())),o}))});var vt=null,bt=function(){function t(t){var e=new tt;return{get:function(n){var r=e.get(n[t]);if(r)for(var o,i=0;o=r[i++];)if(o.node===n)return o;return null},set:function(n){var r=n.node[t];(e.get(r)||e.set(r,[])).push(n)}}}var e=s.isHostProperty(document.documentElement,"uniqueID");function n(){this.initCaches()}return n.prototype={initCaches:function(){var n;this.elementCache=e?(n=new tt,{get:function(t){return n.get(t.uniqueID)},set:function(t){n.set(t.node.uniqueID,t)}}):t("tagName"),this.textNodeCache=t("data"),this.otherNodeCache=t("nodeName")},getNodeWrapper:function(t){var e;switch(t.nodeType){case 1:e=this.elementCache;break;case 3:e=this.textNodeCache;break;default:e=this.otherNodeCache}var n=e.get(t);return n||(n=new nt(t,this),e.set(n)),n},getPosition:function(t,e){return this.getNodeWrapper(t).getPosition(e)},getRangeBoundaryPosition:function(t,e){var n=e?"start":"end";return this.getPosition(t[n+"Container"],t[n+"Offset"])},detach:function(){this.elementCache=this.textNodeCache=this.otherNodeCache=null}},n}();function yt(){return xt(),vt=new bt}function wt(){return vt||yt()}function xt(){vt&&vt.detach(),vt=null}function Ct(t,n,r,o){r&&(n?Q(r.node)&&(r=t.previousVisible()):Q(r.node)&&(r=r.nextVisible()));var i=t,a=!1;function u(){var t=null;return n?(t=i,a||(i=i.previousVisible(),a=!i||r&&i.equals(r))):a||(t=i=i.nextVisible(),a=!i||r&&i.equals(r)),a&&(i=null),t}var c,s=!1;return{next:function(){if(s)return s=!1,c;for(var t;t=u();)if(t.getCharacter(o))return c=t,t;return null},rewind:function(){if(!c)throw e.createError("createCharacterIterator: cannot rewind. Only one position can be rewound.");s=!0},dispose:function(){t=r=null}}}l(c,{nextNode:K,previousNode:X});var St=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var n=0,r=t.length;n<r;++n)if(t[n]===e)return n;return-1};function kt(t,e,n){var r=Ct(t,!1,null,e),o=Ct(t,!0,null,e),i=n.tokenizer;function a(t){for(var e,n,i=[],a=t?r:o,u=!1,c=!1;e=a.next();){if(n=e.character,h.test(n))c&&(c=!1,u=!0);else{if(u){a.rewind();break}c=!0}i.push(e)}return i}var u=a(!0),c=a(!1).reverse(),s=k(c.concat(u),n,i),l=u.length?s.slice(St(s,u[0].token)):[],f=c.length?s.slice(0,St(s,c.pop().token)+1):[];return{nextEndToken:function(){for(var t,e;1==l.length&&!(t=l[0]).isWord&&(e=a(!0)).length>0;)l=k(t.chars.concat(e),n,i);return l.shift()},previousStartToken:function(){for(var t,e;1==f.length&&!(t=f[0]).isWord&&(e=a(!1)).length>0;)f=k(e.reverse().concat(t.chars),n,i);return f.pop()},dispose:function(){r.dispose(),o.dispose(),l=f=null}}}function Tt(t,e,n,r,o){var i,c,s,l,f=0,d=t,m=Math.abs(n);if(0!==n){var g=n<0;switch(e){case a:for(c=Ct(t,g,null,r);(i=c.next())&&f<m;)++f,d=i;s=i,c.dispose();break;case u:for(var h=kt(t,r,o),p=g?h.previousStartToken:h.nextEndToken;(l=p())&&f<m;)l.isWord&&(++f,d=g?l.chars[0]:l.chars[l.chars.length-1]);break;default:throw new Error("movePositionBy: unit '"+e+"' not implemented")}g?(d=d.previousVisible(),f=-f):d&&d.isLeadingSpace&&!d.isTrailingSpace&&(e==u&&(s=(c=Ct(t,!1,null,r)).next(),c.dispose()),s&&(d=s.previousVisible()))}return{position:d,unitsMoved:f}}function Ot(t,e,n,r){var o=t.getRangeBoundaryPosition(e,!0),i=t.getRangeBoundaryPosition(e,!1);return Ct(r?i:o,!!r,r?o:i,n)}function Et(t,e,n){for(var r,o=[],i=Ot(t,e,n);r=i.next();)o.push(r);return i.dispose(),o}function _t(e,n,r){var o=t.createRange(e.node);return o.setStartAndEnd(e.node,e.offset,n.node,n.offset),!o.expand("word",{wordOptions:r})}function Rt(t,e,n,r,o){var i,a,u,c,s,l,f=b(o.direction),d=Ct(t,f,t.session.getRangeBoundaryPosition(r,f),o.characterOptions),m="",g=[],h=null;function p(t,e){var n=g[t].previousVisible(),r=g[e-1];return{startPos:n,endPos:r,valid:!o.wholeWordsOnly||_t(n,r,o.wordOptions)}}for(;i=d.next();)if(a=i.character,n||o.caseSensitive||(a=a.toLowerCase()),f?(g.unshift(i),m=a+m):(g.push(i),m+=a),n){if(s=e.exec(m))if(c=(u=s.index)+s[0].length,l){if(!f&&c<m.length||f&&u>0){h=p(u,c);break}}else l=!0}else if(-1!=(u=m.indexOf(e))){h=p(u,u+e.length);break}return l&&(h=p(u,c)),d.dispose(),h}function Nt(t){return function(){var e=!!vt,n=[wt()].concat(s.toArray(arguments)),r=t.apply(this,n);return e||xt(),r}}function At(t,e){return Nt((function(n,r,o,u){typeof o==i&&(o=r,r=a),u=B(u,N);var c=t;e&&(c=o>=0,this.collapse(!c));var s=Tt(n.getRangeBoundaryPosition(this,c),r,o,u.characterOptions,u.wordOptions),l=s.position;return this[c?"setStart":"setEnd"](l.node,l.offset),s.unitsMoved}))}function Dt(t){return Nt((function(e,n){for(var r,o=Ot(e,this,n=f(n,T),!t),i=0;(r=o.next())&&h.test(r.character);)++i;o.dispose();var a=i>0;return a&&this[t?"moveStart":"moveEnd"]("character",t?i:-i,{characterOptions:n}),a}))}function Mt(t){return Nt((function(e,n){var r=!1;return this.changeEachRange((function(e){r=e[t](n)||r})),r}))}l(t.rangePrototype,{moveStart:At(!0,!1),moveEnd:At(!1,!1),move:At(!0,!0),trimStart:Dt(!0),trimEnd:Dt(!1),trim:Nt((function(t,e){var n=this.trimStart(e),r=this.trimEnd(e);return n||r})),expand:Nt((function(t,e,n){var r=!1,o=(n=B(n,A)).characterOptions;if(e||(e=a),e==u){var i,c,s=n.wordOptions,l=t.getRangeBoundaryPosition(this,!0),f=t.getRangeBoundaryPosition(this,!1),d=kt(l,o,s).nextEndToken(),m=d.chars[0].previousVisible();return i=this.collapsed?d:kt(f,o,s).previousStartToken(),c=i.chars[i.chars.length-1],m.equals(l)||(this.setStart(m.node,m.offset),r=!0),c&&!c.equals(f)&&(this.setEnd(c.node,c.offset),r=!0),n.trim&&(n.trimStart&&(r=this.trimStart(o)||r),n.trimEnd&&(r=this.trimEnd(o)||r)),r}return this.moveEnd(a,1,n)})),text:Nt((function(t,e){return this.collapsed?"":Et(t,this,f(e,T)).join("")})),selectCharacters:Nt((function(t,e,n,r,o){var i={characterOptions:o};e||(e=d(this.getDocument())),this.selectNodeContents(e),this.collapse(!0),this.moveStart("character",n,i),this.collapse(!0),this.moveEnd("character",r-n,i)})),toCharacterRange:Nt((function(t,e,n){e||(e=d(this.getDocument()));var r,o=e.parentNode,i=c.getNodeIndex(e),a=-1==c.comparePoints(this.startContainer,this.endContainer,o,i),u=this.cloneRange();return a?(u.setStartAndEnd(this.startContainer,this.startOffset,o,i),r=-u.text(n).length):(u.setStartAndEnd(o,i,this.startContainer,this.startOffset),r=u.text(n).length),{start:r,end:r+this.text(n).length}})),findText:Nt((function(e,n,r){(r=B(r,R)).wholeWordsOnly&&(r.wordOptions.includeTrailingSpace=!1);var o=b(r.direction),i=r.withinRange;i||(i=t.createRange()).selectNodeContents(this.getDocument());var a=n,u=!1;"string"==typeof a?r.caseSensitive||(a=a.toLowerCase()):u=!0;var c=e.getRangeBoundaryPosition(this,!o),s=i.comparePoint(c.node,c.offset);-1===s?c=e.getRangeBoundaryPosition(i,!0):1===s&&(c=e.getRangeBoundaryPosition(i,!1));for(var l,f=c,d=!1;;)if(l=Rt(f,a,u,i,r)){if(l.valid)return this.setStartAndEnd(l.startPos.node,l.startPos.offset,l.endPos.node,l.endPos.offset),!0;f=o?l.startPos:l.endPos}else{if(!r.wrap||d)return!1;i=i.cloneRange(),f=e.getRangeBoundaryPosition(i,!o),i.setBoundary(c.node,c.offset,o),d=!0}})),pasteHtml:function(t){if(this.deleteContents(),t){var e=this.createContextualFragment(t),n=e.lastChild;this.insertNode(e),this.collapseAfter(n)}}}),l(t.selectionPrototype,{expand:Nt((function(t,e,n){this.changeEachRange((function(t){t.expand(e,n)}))})),move:Nt((function(t,e,n,r){var o=0;if(this.focusNode){this.collapse(this.focusNode,this.focusOffset);var i=this.getRangeAt(0);r||(r={}),r.characterOptions=f(r.characterOptions,E),o=i.move(e,n,r),this.setSingleRange(i)}return o})),trimStart:Mt("trimStart"),trimEnd:Mt("trimEnd"),trim:Mt("trim"),selectCharacters:Nt((function(e,n,r,o,i,a){var u=t.createRange(n);u.selectCharacters(n,r,o,a),this.setSingleRange(u,i)})),saveCharacterRanges:Nt((function(t,e,n){for(var r=this.getAllRanges(),o=[],i=1==r.length&&this.isBackward(),a=0,u=r.length;a<u;++a)o[a]={characterRange:r[a].toCharacterRange(e,n),backward:i,characterOptions:n};return o})),restoreCharacterRanges:Nt((function(e,n,r){this.removeAllRanges();for(var o,i,a,u=0,c=r.length;u<c;++u)a=(i=r[u]).characterRange,(o=t.createRange(n)).selectCharacters(n,a.start,a.end,i.characterOptions),this.addRange(o,i.backward)})),text:Nt((function(t,e){for(var n=[],r=0,o=this.rangeCount;r<o;++r)n[r]=this.getRangeAt(r).text(e);return n.join("")}))}),t.innerText=function(e,n){var r=t.createRange(e);return r.selectNodeContents(e),r.text(n)},t.createWordIterator=function(t,e,n){var r=wt();n=B(n,D);var o=kt(r.getPosition(t,e),n.characterOptions,n.wordOptions),i=b(n.direction);return{next:function(){return i?o.previousStartToken():o.nextEndToken()},dispose:function(){o.dispose(),this.next=function(){}}}},t.noMutation=function(t){t(wt()),xt()},t.noMutation.createEntryPointFunction=Nt,t.textRange={isBlockNode:U,isCollapsedWhitespaceNode:J,createPosition:Nt((function(t,e,n){return t.getPosition(e,n)}))}})),t})?r.apply(e,o):r)||(t.exports=i)},8785:()=>{tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 01-1-1v-5c0-.6-.4-1-1-1a1 1 0 00-1 1v5c0 .6-.4 1-1 1a1 1 0 01-1-1V9H4a1 1 0 110-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" fill-rule="nonzero"/></svg>',"action-next":'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 00-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 10-1.4-1.4L12 13.6 5.7 7.3z"/></svg>',"action-prev":'<svg width="24" height="24"><path fill-rule="nonzero" d="M18.3 15.7a1 1 0 001.4-1.4L12 6.6l-7.7 7.7a1 1 0 001.4 1.4L12 9.4l6.3 6.3z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 110-2h9.2zm4 0h.8a1 1 0 010 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h6.8zm4 0H19a1 1 0 010 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h4.4zm4 0H19a1 1 0 010 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 010-2h2zm4 0h8a1 1 0 010 2H9.8l1.2-2zm5.2-13.5l1.3.7-9.7 16.3-1.3-.7 9.7-16.3z" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 001.4-1V6a1 1 0 00-1.4-.9l-12 6a1 1 0 000 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 015 18V6a1 1 0 011.4-.9l12 6a1 1 0 010 1.8z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 01-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4z" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 00-1 1z" fill-rule="nonzero"/></svg>',"border-style":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="2" x="3" y="6" rx="1"/><rect width="2.8" height="2" x="3" y="16" rx="1"/><rect width="2.8" height="2" x="6.8" y="16" rx="1"/><rect width="2.8" height="2" x="10.6" y="16" rx="1"/><rect width="2.8" height="2" x="14.4" y="16" rx="1"/><rect width="2.8" height="2" x="18.2" y="16" rx="1"/><rect width="8" height="2" x="3" y="11" rx="1"/><rect width="8" height="2" x="13" y="11" rx="1"/></g></svg>',"border-width":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="5" x="3" y="5" rx="1"/><rect width="18" height="3.5" x="3" y="11.5" rx="1"/><rect width="18" height="2" x="3" y="17" rx="1"/></g></svg>',brightness:'<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 01-.7-.3A1 1 0 0111 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3h-1a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 01-.7.3H5a1 1 0 01-.7-.3A1 1 0 014 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7zm10 3.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 01-.8.3 1 1 0 01-.6-.3l-.8-.7a1 1 0 01-.3-.8c0-.2.1-.5.3-.7a1 1 0 011.4 0zm-10-7l-.7-.8a1 1 0 01-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.8-.3zm10 0a1 1 0 01-.8.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 010 1.4l-.8.8a1 1 0 01-.6.3 1 1 0 01-.8-.3 1 1 0 01-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 013.7 2.4 4 4 0 010 3.2A4 4 0 0112 16a4 4 0 01-3.7-2.4 4 4 0 010-3.2A4 4 0 0112 8zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7z" fill-rule="evenodd"/></svg>',browse:'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 11-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L13 13.4V20a1 1 0 01-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 110 14.8 7.4 7.4 0 010-14.8zM12 3a9 9 0 100 18 9 9 0 000-18zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7z" fill-rule="nonzero"/></svg>',"cell-background-color":'<svg width="24" height="24"><path d="M15.7 2l1.6 1.6-2.7 2.6 5.9 5.8c.7.7.7 1.7 0 2.4l-6.3 6.1a1.7 1.7 0 01-2.4 0l-6.3-6.1c-.7-.7-.7-1.7 0-2.4L15.7 2zM18 12l-4.5-4L9 12h9zM4 16s2 2.4 2 3.8C6 21 5.1 22 4 22s-2-1-2-2.2C2 18.4 4 16 4 16z"/></svg>',"cell-border-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M5 13v5h2v2H5a2 2 0 01-2-2v-5h2zm8-7V4h6a2 2 0 012 2h-8z" opacity=".2"/><path fill-rule="nonzero" d="M13 4v2H5v7H3V6c0-1.1.9-2 2-2h8zm-2.6 14.1l.1-.1.1.1.2.3.2.2.2.2c.4.6.8 1.2.8 1.7 0 .8-.7 1.5-1.5 1.5S9 21.3 9 20.5c0-.5.4-1.1.8-1.7l.2-.2.2-.2.2-.3z"/><path d="M13 11l-2 2H5v-2h6V6h2z"/><path fill-rule="nonzero" d="M18.4 8l1 1-1.8 1.9 4 4c.5.4.5 1.1 0 1.6l-4.3 4.2a1.2 1.2 0 01-1.6 0l-4.4-4.2c-.4-.5-.4-1.2 0-1.7l7-6.8zm1.6 7l-3-3-3 3h6z"/></g></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 01-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 01-1 .7h-.2a.7.7 0 01-.7-1l4-12a1 1 0 012 0l4 12a.7.7 0 01-.8 1h-.2a1 1 0 01-1-.7l-.8-2.6zm-.3-1.5l-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1zm4.8-6.8V10H7.7V5.8h-1v-1h2zM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1zM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 01-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 00-.5-.1 1 1 0 00-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 00-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 001.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 00-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 00-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 01-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 01-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1z" fill-rule="evenodd"/></svg>',"checklist-rtl":'<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8a1 1 0 010 2h-8a1 1 0 010-2zM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 011.6 1.2l-8 12a1 1 0 01-1.5.1l-5-5a1 1 0 111.4-1.4l4.1 4.1 7.4-11z" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 010-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8z" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><path d="M7.8 1.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 010-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1z" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 010-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 010-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 010-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0z" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><path d="M17.3 8.2L13.4 12l3.9 3.8a1 1 0 01-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 01-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 011.5-1.5l3.8 3.9 3.8-3.9a1 1 0 011.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 01-.8 2 2.8 2.8 0 01.8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 01-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 01.8-2 2.8 2.8 0 01-.8-2zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2zM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 01-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 01-.5-.5V17a3 3 0 001-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5z" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0118 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 01-3.7 3 5.7 5.7 0 01-3.2 0A5.9 5.9 0 017.6 18a6.2 6.2 0 01-1.4-2.6 6.7 6.7 0 010-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 012.3-4A20 20 0 0112 4a26.4 26.4 0 013.2 3.4 18.2 18.2 0 012.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 00-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 01-1.3 3 5.3 5.3 0 01-2.3 1.5 4.9 4.9 0 01-2 .1 4.3 4.3 0 002.4.8 4 4 0 002-.6 4 4 0 001.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 000 18 1.5 1.5 0 001.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 005-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3-4a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm5 0a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3 4a1.5 1.5 0 110-3 1.5 1.5 0 010 3z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',"comment-add":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/><path d="M13 10h2a1 1 0 010 2h-2v2a1 1 0 01-2 0v-2H9a1 1 0 010-2h2V8a1 1 0 012 0v2z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-6 8a6 6 0 006 6V6a6 6 0 00-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 00-2 2v11h2V5h10V3zm1 4a2 2 0 012 2v10a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7zm0 12V9h-7v10h7z" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 01-1-1v-2H7V9H5a1 1 0 110-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3zM9 9v5l5-5H9zm1 6h5v-5l-5 5z" fill-rule="evenodd"/></svg>',"cut-column":'<svg width="24" height="24"><path fill-rule="evenodd" d="M7.2 4.5c.9 0 1.6.4 2.2 1A3.7 3.7 0 0110.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 012 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 017 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7zm12.3 5h-3v10h3v-10zM8 13.8h-.3l-.4.2a2.8 2.8 0 00-.7.4v.1a2.8 2.8 0 00-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 00.8-.3 2.4 2.4 0 00.7-.7 2.5 2.5 0 00.3-.8 1.5 1.5 0 000-.8 1 1 0 00-.2-.4 1 1 0 00-.5-.2H8zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zM7 5.8h-.4a1 1 0 00-.5.3 1 1 0 00-.2.5v.7a2.5 2.5 0 00.3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 000-.8 2.6 2.6 0 00-.3-.8A2.5 2.5 0 007.7 6l-.4-.1H7z"/></svg>',"cut-row":'<svg width="24" height="24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 00-.8.4 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3L9 18V18l.4-.4.2-.4.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2h-.5zm7 0H15a1 1 0 00-.4.3 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4a2.8 2.8 0 00.5.7h.1a2.8 2.8 0 00.8.6l.4.1h.7l.5-.2.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3h-.3zM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zm8.5-7.1h-11v2h11v-2z"/></svg>',cut:'<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 010 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8zm-8.5 2.2l.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2 1.6 1.6 0 00-.8 0 2.6 2.6 0 00-.8.3 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3 2.8 2.8 0 001-1zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4zm5.4 4l.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3 1.5 1.5 0 00-.8 0 1 1 0 00-.4.2 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4l.3.4.3.4a2.8 2.8 0 00.8.5l.4.1h.7l.5-.2z" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5zm0 4h2v2h-2V9zM9 9h2v2H9V9zm4 4h2v2h-2v-2zm-4 0h2v2H9v-2zm0 4h2v2H9v-2zm4 0h2v2h-2v-2zM9 5h2v2H9V5z" fill-rule="evenodd"/></svg>',"duplicate-column":'<svg width="24" height="24"><path d="M17 6v16h-7V6h7zm-2 2h-3v12h3V8zm-2-6v2H8v15H6V2h7z"/></svg>',"duplicate-row":'<svg width="24" height="24"><path d="M22 11v7H6v-7h16zm-2 2H8v3h12v-3zm-1-6v2H4v5H2V7h17z"/></svg>',duplicate:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10zm3 8h-2V9h-7v10h9a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7a2 2 0 012 2v2z"/><path d="M17 14h1a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1h-1a1 1 0 010-2h1v-1a1 1 0 012 0v1z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5zm-2-.2l1-.9v-.3l-2.2-2.2a.3.3 0 00-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5z"/></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 00-2-2H7v2h11v9zM6 17h15a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1H6a2 2 0 01-2-2V7H3a1 1 0 110-2h1V4a1 1 0 112 0v13zm3-5.3l1.3 2 3-4.7 3.7 6H7l2-3.3z" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0119 6zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 008 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 00-4 4.5h2.2zm-3.4 0a12 12 0 012.8-4 12 12 0 00-5 4h2.2z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 010 .8l-5.6 4A.5.5 0 019 16V8a.5.5 0 01.8-.4z" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5zM12 4a8 8 0 100 16 8 8 0 000-16zm0 14.5a6.5 6.5 0 110-13 6.5 6.5 0 010 13z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3L18 7v1h-5V5H7v14h9a1 1 0 012 0c0 1-.8 2-1.9 2H7c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h7.5z"/><path d="M18.1 12c.5 0 .9.4.9 1 0 .5-.3 1-.8 1h-7.3c-.5 0-.9-.4-.9-1 0-.5.3-1 .8-1h7.3z"/><path d="M16.4 9.2a1 1 0 011.4.2l2.4 3.6-2.4 3.6a1 1 0 01-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 01.2-1.4z"/></g></svg>',fill:'<svg width="24" height="26"><path d="M16.6 12l-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 002.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 002-2c0-1.3-2-3.5-2-3.5z" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 00-2 2zm14-2v2h2a2 2 0 00-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 002-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 00-2 2v3h2V6h10v3h2V6a2 2 0 00-2-2zm2 14h-2v2a2 2 0 002-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 00-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3z" fill-rule="nonzero"/></svg>',format:'<svg width="24" height="24"><path fill-rule="evenodd" d="M17 5a1 1 0 010 2h-4v11a1 1 0 01-2 0V7H7a1 1 0 110-2h10z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 110-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 11-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 111.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 110-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 110 1.7H5a.9.9 0 01-.9-.9v-4.4a.9.9 0 111.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 01-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 010 1.8H7l3 2.9-1.3 1.2z" fill-rule="nonzero"/></svg>',gallery:'<svg width="24" height="24"><path fill-rule="nonzero" d="M5 15.7l2.3-2.2c.3-.3.7-.3 1 0L11 16l5.1-5c.3-.4.8-.4 1 0l2 1.9V8H5v7.7zM5 18V19h3l1.8-1.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 01-1-1V7c0-.6.4-1 1-1zm6 7a2 2 0 110-4 2 2 0 010 4zM4.5 4h15a.5.5 0 110 1h-15a.5.5 0 010-1zm2-2h11a.5.5 0 110 1h-11a.5.5 0 010-1z"/></svg>',gamma:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 00-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 01.6.5l.1.3a8.5 8.5 0 01.3.6l1.9 4.6 2-5.2a1 1 0 011-.6.5.5 0 01.5.6L13 14v2.8a.7.7 0 01-1.4 0z" fill-rule="nonzero"/></svg>',help:'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 00-6 9 6.3 6.3 0 001.4 2l1 1a6.3 6.3 0 003.6 1 6.5 6.5 0 006-9 6.3 6.3 0 00-1.4-2l-1-1a6.3 6.3 0 00-3.6-1zM12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4z"/><path d="M9.6 9.7a.7.7 0 01-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 00-.8.8.8.8 0 01-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 012.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="M5 15.7l3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7zM5 18V19h3l2.8-2.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 100-4 2 2 0 000 4z" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-1 3v2h2V7h-2zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4z" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 001.8-2.9 6.3 6.3 0 00-.1-4.1 5.8 5.8 0 00-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 00-3.9 1.8 6.3 6.3 0 00-1.3 6 6.2 6.2 0 001.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 014 11c0-1 .2-1.9.6-2.7A7 7 0 016.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 015.7 2 7 7 0 011.7 2.3 6 6 0 01.2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 01-3.6 2.5v.5z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 100-14 7 7 0 000 14zm0 2a9 9 0 110-18 9 9 0 010 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 00-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 01-3.1 1.9 6.1 6.1 0 01-5.5-1.6A5.8 5.8 0 016 14v-.3l.1-1.2A13.9 13.9 0 017.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 00.2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 00-3-4.2L12 6a26.1 26.1 0 00-2.2 2.5l-1-1a20.9 20.9 0 012.9-3.3L12 4l1 .8a22.2 22.2 0 014 5.4c.6 1.2 1 2.4 1 3.6z" fill-rule="evenodd"/></svg>',italic:'<svg width="24" height="24"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8z" fill-rule="evenodd"/></svg>',language:'<svg width="24" height="24"><path d="M12 3a9 9 0 110 18 9 9 0 010-18zm4.3 13.3c-.5 1-1.2 2-2 2.9a7.5 7.5 0 003.2-2.1l-.2-.2a6 6 0 00-1-.6zm-8.6 0c-.5.2-.9.5-1.2.8.9 1 2 1.7 3.2 2a10 10 0 01-2-2.8zm3.6-.8c-.8 0-1.6.1-2.2.3.5 1 1.2 1.9 2.1 2.7zm1.5 0v3c.9-.8 1.6-1.7 2.1-2.7-.6-.2-1.4-.3-2.1-.3zm-6-2.7H4.5c.2 1 .5 2.1 1 3h.3l1.3-1a10 10 0 01-.3-2zm12.7 0h-2.3c0 .7-.1 1.4-.3 2l1.6 1.1c.5-1 .9-2 1-3.1zm-3.8 0h-3V14c1 0 2 .1 2.7.4.2-.5.3-1 .3-1.6zm-4.4 0h-3l.3 1.6c.8-.3 1.7-.4 2.7-.4v-1.3zm-5.5-5c-.7 1-1.1 2.2-1.3 3.5h2.3c0-1 .2-1.8.5-2.6l-1.5-1zm2.9 1.4v.1c-.2.6-.4 1.3-.4 2h3V9.4c-1 0-1.8-.1-2.6-.3zm6.6 0h-.1l-2.4.3v1.8h3l-.5-2.1zm3-1.4l-.3.1-1.3.8c.3.8.5 1.6.5 2.6h2.3a7.5 7.5 0 00-1.3-3.5zm-9 0l2 .2V5.5a9 9 0 00-2 2.2zm3.5-2.3V8c.6 0 1.3 0 1.9-.2a9 9 0 00-2-2.3zm-3-.7h-.1c-1.1.4-2.1 1-3 1.8l1.2.7a10 10 0 011.9-2.5zm4.4 0l.1.1a10 10 0 011.8 2.4l1.1-.7a7.5 7.5 0 00-3-1.8z"/></svg>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zM7 3.6l3.7 3.7a1 1 0 01-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 011.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 011.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 01-1.3 0h-.1a1 1 0 010-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1zM4 18h16v2H4v-2z" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2.1 2a2 2 0 102.7 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2-2a2 2 0 10-2.6-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 26a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 36a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-num-default-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 17v-4.8l-1.6 1v-1.1l1.6-1h1.2V17zM33.3 17.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm1.7 5.7c0-1.2 1-2 2.2-2 1.3 0 2.1.8 2.1 1.8 0 .7-.3 1.2-1.3 2.2l-1.2 1v.2h2.6v1h-4.3v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H35zm-1.7 4.3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm3.2 7.3v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H35c0-1.1 1-1.8 2.2-1.8 1.2 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.7.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .6 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm-3.3 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-lower-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M36.5 16c-.9 0-1.5-.5-1.5-1.3s.6-1.3 1.8-1.4h1v-.4c0-.4-.2-.6-.7-.6-.4 0-.7.1-.8.4h-1.1c0-.8.8-1.4 2-1.4S39 12 39 13V16h-1.2v-.6c-.3.4-.8.7-1.4.7zm.4-.8c.6 0 1-.4 1-.9V14h-1c-.5.1-.7.3-.7.6 0 .4.3.6.7.6zM33.1 16.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zM37.7 26c-.7 0-1.2-.2-1.5-.7v.7H35v-6.3h1.2v2.5c.3-.5.8-.9 1.5-.9 1.1 0 1.8 1 1.8 2.4 0 1.5-.7 2.4-1.8 2.4zm-.5-3.6c-.6 0-1 .5-1 1.3s.4 1.4 1 1.4c.7 0 1-.6 1-1.4 0-.8-.3-1.3-1-1.3zM33.2 26.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm6 7h-1c-.1-.5-.4-.8-1-.8s-1 .5-1 1.4c0 1 .4 1.4 1 1.4.5 0 .9-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm-6.1 3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 16c-1.2 0-2-.8-2-2.3 0-1.5.8-2.4 2-2.4.6 0 1 .4 1.3 1v-.9H40v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1-.7h-.2c-.2.4-.7.8-1.3.8zm.3-1c.6 0 1-.5 1-1.3s-.4-1.3-1-1.3-1 .5-1 1.3.4 1.4 1 1.4zM33.3 16.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM36 21.9c0-1.5.8-2.3 2.1-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.9 1.3.9.3 1.3.8 1.3 1.7 0 1.2-.7 1.9-1.8 1.9-.6 0-1.1-.3-1.4-.8v2.2H36V22zm1.8 1.2v-1h.3c.5 0 .9-.2.9-.7 0-.5-.3-.8-.9-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1 1.3s1-.4 1-1-.4-1-1.2-1h-.3zM33.3 26.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM37.1 34.6L34.8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.2.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zM33.3 36.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3zM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M32.9 16v-1.2h-1.3V16H33zm0 10v-1.2h-1.3V26H33zm0 10v-1.2h-1.3V36H33z"/><path fill-rule="nonzero" d="M36 21h-1.5v5H36zM36 31h-1.5v5H36zM39 21h-1.5v5H39zM39 31h-1.5v5H39zM42 31h-1.5v5H42zM36 11h-1.5v5H36zM36 19h-1.5v1H36zM36 29h-1.5v1H36zM39 19h-1.5v1H39zM39 29h-1.5v1H39zM42 29h-1.5v1H42zM36 9h-1.5v1H36z"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15zm0 10v-1.2h1.3V26H15zm0 10v-1.2h1.3V36H15z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M39.3 17l-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3zm-1.6-4.7l-.7 2.3h1.6l-.8-2.3zM33.4 17c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm4.7 9.9h-2.7v-6H38c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zm-1.4-5v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4h1.1c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9h-1.1V26zM33 27.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm4.9 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm-4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M12.6 17l-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3zM11 12.3l-.7 2.3h1.6l-.8-2.3zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M31.6 17v-1.2H33V17h-1.3zm0 10v-1.2H33V27h-1.3zm0 10v-1.2H33V37h-1.3z"/><path fill-rule="nonzero" d="M34.5 20H36v7h-1.5zM34.5 30H36v7h-1.5zM37.5 20H39v7h-1.5zM37.5 30H39v7h-1.5zM40.5 30H42v7h-1.5zM34.5 10H36v7h-1.5z"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15zm0 10v-1.2h1.3V27H15zm0 10v-1.2h1.3V37H15z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3zM10 8v3h4V8a1 1 0 00-.3-.7A1 1 0 0013 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 017.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-2v8H5V7h8l-2 2H7v8h8v-4zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><path d="M11 11H8a1 1 0 110-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 01-1-1v-3zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1z" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><path d="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 110-2zm13-1v3.5a.5.5 0 11-1 0V5h-.5a.5.5 0 110-1H19zm-1 8.8l.2.2h1.3a.5.5 0 110 1h-1.6a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2h-1.3a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zm2 4.2v2c0 .6-.4 1-1 1h-1.5a.5.5 0 010-1h1.2a.3.3 0 100-.6h-1.3a.4.4 0 110-.8h1.3a.3.3 0 000-.6h-1.2a.5.5 0 110-1H19c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 110-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 01-.5-.5V5h-.5a.5.5 0 010-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2H4.5a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 010-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 110-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 110-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4L1 13l6.4 6.5 6.5-6.5-6.5-6.5zM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7zM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 010-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 11-4.3 16.9l1.5-1.5A7 7 0 1013 6h-1z" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.2 1.6L6.8 12l1.8 1.2z" fill-rule="evenodd"/></svg>',"page-break":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 01-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 01-1-1v-5H7v5c0 .6-.4 1-1 1z"/></g></svg>',paragraph:'<svg width="24" height="24"><path fill-rule="evenodd" d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2z" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1z" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5L8 20H3v-3l3.5-3.5a2 2 0 010-3L14 3l1 1-7.3 7.3a1 1 0 000 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 01-2.8 0l-.1-.1z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><path d="M12 4c.5 0 1 .4 1 .9V11h6a1 1 0 01.1 2H13v6a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H11V5c0-.6.4-1 1-1z"/></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 01-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 01-1.4 0l-1.5-1.2a6.2 6.2 0 01-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 01-1-.9l-.2-1.9a5.8 5.8 0 01-1.5-.6l-1.5 1.2a1 1 0 01-1.4 0l-.7-.7a1 1 0 010-1.4l1.2-1.5a6.2 6.2 0 01-.6-1.5l-1.9-.2a1 1 0 01-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 01.6-1.5L5.2 7.3a1 1 0 010-1.4l.7-.7a1 1 0 011.4 0l1.5 1.2a6.2 6.2 0 011.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 011.5.6l1.5-1.2a1 1 0 011.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 01.6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 100-6 3 3 0 000 6z" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 002.1-2.8 15.7 15.7 0 00-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 00-6.7 3.2A16.2 16.2 0 003.2 12c0 .2.2.3.3.5zm-2.4-1l.7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 012.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 01-2.8-3.7 1 1 0 010-1zm12-3.3a2 2 0 102.7 2.6 4 4 0 11-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 00-3 3v6h2v3h14v-3h2v-6a3 3 0 00-3-3zm-1 10H7v-4h10v4zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5zm.5-8H6v2h12V5z" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3z" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 11-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 111.4-1.4l5 5a1 1 0 010 1.4l-5 5a1 1 0 01-1.4-1.4l3.3-3.3z" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5 22.1l-1.2-4.7v-.2a1 1 0 011-1l5 .4a1 1 0 11-.2 2l-2.2-.2a7.8 7.8 0 008.4.2 7.5 7.5 0 003.5-6.4 1 1 0 112 0 9.5 9.5 0 01-4.5 8 9.9 9.9 0 01-10.2 0l.4 1.4a1 1 0 11-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 00-9.5-1 7.5 7.5 0 00-3.6 7 1 1 0 01-2 0 9.5 9.5 0 014.5-8.6 10 10 0 0110.9.3l-.3-1a1 1 0 012-.5l1.1 4.8a1 1 0 01-1 1.2l-5-.4a1 1 0 01-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 010 .2l-2.6 10a1 1 0 01-1 .8h-.2a.8.8 0 01-.8-1l2.6-10H8a1 1 0 110-2h9a1 1 0 010 2h-3.8zM5 18h7a1 1 0 010 2H5a1 1 0 010-2zm13 1.5L16.5 18 15 19.5a.7.7 0 01-1-1l1.5-1.5-1.5-1.5a.7.7 0 011-1l1.5 1.5 1.5-1.5a.7.7 0 011 1L17.5 17l1.5 1.5a.7.7 0 01-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 010 2h-1v9a3 3 0 01-3 3H9a3 3 0 01-3-3V9H5a1 1 0 110-2h3V6a3 3 0 013-3h2a3 3 0 013 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 00-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 012 0v4a1 1 0 01-2 0v-4zm4 0a1 1 0 012 0v4a1 1 0 01-2 0v-4z" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 119 2l-7 7A.5.5 0 111 8l7-7zM8.1 5.1A.5.5 0 119 6l-3 3A.5.5 0 115 8l3-3z"/></g></svg>',resize:'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-6a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3A1 1 0 014 11V5z" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1z"/><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 012 0v6c0 .6-.4 1-1 1h-6a1 1 0 010-2h4.3L16 7A7.2 7.2 0 007.7 6a7 7 0 003 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 011.4 1.5A9.2 9.2 0 012.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8z" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 014.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L8 5zm12 11.2a1 1 0 11-1 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 111 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 10-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 10-1.4-1.4L13 11.6V4a1 1 0 00-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 00-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 00-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 002-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2zM7 17h10V7H7v10zm2-8h6v6H9V9z" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 00-1 1L9.6 17 18 8.6a.7.7 0 000-1 .7.7 0 00-1 0l-7.4 7.3z"/></svg>',settings:'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V8H5a1 1 0 110-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6zM8 8h2V6H8v2zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V13H5a1 1 0 010-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6zM14 13h2v-2h-2v2zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V18H5a1 1 0 010-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6zM8 18h2v-2H8v2z" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><path d="M16 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2z" fill-rule="evenodd"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 010-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7zM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 00-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7z"/></g></svg>',"spell-check":'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6zm0-3v2h2V5H6zm13 0h-3v5h3v1h-3a1 1 0 01-.7-.3 1 1 0 01-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12z" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 017 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1z"/><path d="M5 11h14a1 1 0 010 2H5a1 1 0 010-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="M10.4 10l4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10zM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 00-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 01-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4L10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11z" fill-rule="nonzero"/></svg>',"table-caption":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="12" height="2" x="3" y="4" rx="1"/><path d="M19 8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2v-8c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></g></svg>',"table-cell-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M13 4v9H3V6c0-1.1.9-2 2-2h8zm-2 2H5v5h6V6z"/><path fill-rule="nonzero" d="M13 4h6a2 2 0 012 2v7h-8v-2h6V6h-6V4z" opacity=".2"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/><path fill-rule="nonzero" d="M3 13v5c0 1.1.9 2 2 2h8v-7h-2v5H5v-5H3z" opacity=".2"/></g></svg>',"table-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8 0h-6v5h6v-5zm-8-7H5v5h6V6z"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z" opacity=".2"/></g></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z"/></g></svg>',"table-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v7h-8v7H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8-7h-6v5h6V6zm-8 0H5v5h6V6z"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5l1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5z"/></svg>',"table-delete-row":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8l1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3z"/></svg>',"table-delete-table":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="M14.4 8.6l1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-1-1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></g></svg>',"table-insert-column-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M20 4c.6 0 1 .4 1 1v2a1 1 0 01-2 0V6h-8v12h8v-1a1 1 0 012 0v2c0 .5-.4 1-.9 1H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H17v2a1 1 0 01-2 .1V13h-2a1 1 0 01-.1-2H15V9c0-.6.4-1 1-1zM9 6H5v5h4V6z"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H4a1 1 0 01-1-1v-2a1 1 0 012 0v1h8V6H5v1a1 1 0 11-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H9v2a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H7V9c0-.6.4-1 1-1zm11-2h-4v5h4V6z"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4a1 1 0 110 2H5v6h14V6h-1a1 1 0 010-2h2c.6 0 1 .4 1 1v13a2 2 0 01-2 2H5a2 2 0 01-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 010 2h-2v2a1 1 0 01-2 .1V8H9a1 1 0 010-2h2V4c0-.6.4-1 1-1z"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 01.1 2H13v2a1 1 0 01-2 .1V18H9a1 1 0 01-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 010-2h1v-6H5v6h1a1 1 0 010 2H4a1 1 0 01-1-1V6c0-1.1.9-2 2-2h14a2 2 0 012 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 9h-4v5h4v-5zm-6 0H9v5h4v-5zm0-7H9v5h4V6zm6 0h-4v5h4V6z"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15.5V18h3v-2.5H5zm14-5h-9V18h9v-7.5zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6zm-8 7.5h3v-3H5v3z"/></svg>',"table-row-numbering-rtl":'<svg width="24" height="24"><path d="M6 4a2 2 0 00-2 2v13c0 1.1.9 2 2 2h12a2 2 0 002-2V6a2 2 0 00-2-2H6zm0 12h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 11h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 6h8v3H6V6zm11 0c.6 0 1 .4 1 1v1a1 1 0 11-2 0V7c0-.6.4-1 1-1z"/></svg>',"table-row-numbering":'<svg width="24" height="24"><path d="M18 4a2 2 0 012 2v13a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2h12zm0 12h-8v3h8v-3zM7 16a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8v-3zM7 11a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8V6zM7 6a1 1 0 00-1 1v1a1 1 0 102 0V7c0-.6-.4-1-1-1z"/></svg>',"table-row-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-9h-6v3h6V6zM5 9h6V6H5v3z"/></svg>',"table-split-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1l1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2zm-8.5-1H5v3h3v-3zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6z"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 11H5v3h6v-3zm8 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></svg>',table:'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 14v4h6v-4H5zm14 0h-6v4h6v-4zm0-6h-6v4h6V8zM5 12h6V8H5v4z"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14zM9 16v-4a5 5 0 116 0v4h4a2 2 0 012 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 10-3.6 0l.8.6v5h2z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 111 0V6H15v1.6a8 8 0 11-6 0zm-2.6 5.3a.5.5 0 00.3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 013.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 00-4.1 3.7z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"/></g></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 010-1l3.1-3A12.4 12.4 0 016.7 9H8a10.1 10.1 0 001.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 110-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 01-1 2.4 13.5 13.5 0 01-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 01-.4.7 1 1 0 01-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 01-1 .7.5.5 0 01-.4-.7l2.7-7.4a1 1 0 012 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 01-.4 1.8l-1 1.4a5.3 5.3 0 01-5.5 1 5 5 0 01-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 01-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 002.2.8 3.4 3.4 0 002.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1zM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 01-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 11-1.4 1.4l-5-5a1 1 0 010-1.4l5-5a1 1 0 011.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2 2a2 2 0 102.6 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2.1-2a2 2 0 10-2.7-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2zM7.6 6.3a.8.8 0 01-1 1.1L3.3 4.2a.7.7 0 111-1l3.2 3.1zM5.1 8.6a.8.8 0 010 1.5H3a.8.8 0 010-1.5H5zm5-3.5a.8.8 0 01-1.5 0V3a.8.8 0 011.5 0V5zm6 11.8a.8.8 0 011-1l3.2 3.2a.8.8 0 01-1 1L16 17zm-2.2 2a.8.8 0 011.5 0V21a.8.8 0 01-1.5 0V19zm5-3.5a.7.7 0 110-1.5H21a.8.8 0 010 1.5H19z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 00-.3-.7A1 1 0 0016 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6z"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 012 0v3c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-3a1 1 0 012 0v2h12zM11 6.4L8.7 8.7a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L13 6.4V16a1 1 0 01-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 110-24 12 12 0 010 24zm-8.7-5.3a11 11 0 0017.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7zM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13z" fill-rule="nonzero"/></svg>',"vertical-align":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="18" height="2" x="3" y="11" rx="1"/><path d="M12 2c.6 0 1 .4 1 1v4l2-1.3a1 1 0 011.2 1.5l-.1.1-4.1 3-4-3a1 1 0 011-1.7l2 1.5V3c0-.6.4-1 1-1zm0 11.8l4 2.9a1 1 0 01-1 1.7l-2-1.5V21c0 .5-.4 1-.9 1H12a1 1 0 01-1-1v-4l-2 1.3a1 1 0 01-1.2-.1l-.1-.1a1 1 0 01.1-1.3l.1-.1 4.1-3z"/></g></svg>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2zm-4 0v2a2 2 0 01-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 01-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 010 2v7a1 1 0 01-2 0V9h-1v7a1 1 0 01-2 0v-4a2.5 2.5 0 01-.2-5H15zM5 15v2H3v-2h2zm16 0v2h-2v-2h2zM5 11v2H3v-2h2zm16 0v2h-2v-2h2zM5 7v2H3V7h2zm16 0v2h-2V7h2zM5 3v2H3c0-1.1.9-2 2-2zm8 0v2h-2V3h2zm6 0a2 2 0 012 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z" fill-rule="evenodd"/></svg>',warning:'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6zM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-1-9a1 1 0 012 0v6a1 1 0 01-2 0V8zm-2 4a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-3-5a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>'}})},6890:(t,e,n)=>{n(8785)},4400:(t,e,n)=>{n(2242)},2242:()=>{!function(){"use strict";var t,e,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t,e,n){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===n?null:{"list-style-type":n})},o=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(){},a=function(t){return function(){return t}},u=function(t){return t},c=a(!1),s=a(!0),l=function(){return f},f={fold:function(t,e){return t()},isSome:c,isNone:s,getOr:e=u,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(void 0),or:e,orThunk:t,map:l,each:i,bind:l,exists:c,forall:s,filter:function(){return l()},toArray:function(){return[]},toString:a("none()")},d=function(t){var e=a(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:s,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return d(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:f},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},m=function(t){return null==t?f:d(t)},g=function(t){return t&&/^(TH|TD)$/.test(t.nodeName)},h=function(t,e){return function(n){var r=function(r){n.setActive(function(t,e,n){var r=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}(e.parents,g),i=-1!==r?e.parents.slice(0,r):e.parents,a=o.grep(i,function(t){return function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)&&function(t,e){return t.$.contains(t.getBody(),e)}(t,e)}}(t));return a.length>0&&a[0].nodeName===n}(t,r,e))};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}},p=function(t,e,n,i,a,u){t.ui.registry.addSplitButton(e,{tooltip:n,icon:"OL"===a?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(t){t(o.map(u,(function(t){return{type:"choiceitem",value:"default"===t?"":t,icon:"list-"+("OL"===a?"num":"bull")+"-"+("disc"===t||"decimal"===t?"default":t),text:function(t){return t.replace(/\-/g," ").replace(/\b\w/g,(function(t){return t.toUpperCase()}))}(t)}})))},onAction:function(){return t.execCommand(i)},onItemAction:function(e,n){r(t,a,n)},select:function(e){return function(t){var e=t.dom.getParent(t.selection.getNode(),"ol,ul"),n=t.dom.getStyle(e,"listStyleType");return m(n)}(t).map((function(t){return e===t})).getOr(!1)},onSetup:h(t,a)})},v=function(t,e,n,r,o,i){i.length>1?p(t,e,n,r,o,i):function(t,e,n,r,o,i){t.ui.registry.addToggleButton(e,{active:!1,tooltip:n,icon:"OL"===o?"ordered-list":"unordered-list",onSetup:h(t,o),onAction:function(){return t.execCommand(r)}})}(t,e,n,r,o)};n.add("advlist",(function(t){t.hasPlugin("lists")?(function(t){v(t,"numlist","Numbered list","InsertOrderedList","OL",function(t){var e=t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return e?e.split(/[ ,]/):[]}(t)),v(t,"bullist","Bullet list","InsertUnorderedList","UL",function(t){var e=t.getParam("advlist_bullet_styles","default,circle,square");return e?e.split(/[ ,]/):[]}(t))}(t),function(t){t.addCommand("ApplyUnorderedListStyle",(function(e,n){r(t,"UL",n["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",(function(e,n){r(t,"OL",n["list-style-type"])}))}(t)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))}()},6884:(t,e,n)=>{n(7652)},7652:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-+~=.,%()\/\w]*[-+~=%()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i"),r=function(t,e){if(e<0&&(e=0),3===t.nodeType){var n=t.data.length;e>n&&(e=n)}return e},o=function(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setStart(e,r(e,n)):t.setStartBefore(e)},i=function(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setEnd(e,r(e,n)):t.setEndAfter(e)},a=function(t,e,r){var a,u,c,s,l,f,d,m=function(t){return t.getParam("autolink_pattern",n)}(t),g=function(t){return t.getParam("default_link_target",!1)}(t);if("A"!==t.selection.getNode().tagName){var h=t.selection.getRng().cloneRange();if(h.startOffset<5){if(!(l=h.endContainer.previousSibling)){if(!h.endContainer.firstChild||!h.endContainer.firstChild.nextSibling)return;l=h.endContainer.firstChild.nextSibling}if(f=l.length,o(h,l,f),i(h,l,f),h.endOffset<5)return;a=h.endOffset,u=l}else{if(3!==(u=h.endContainer).nodeType&&u.firstChild){for(;3!==u.nodeType&&u.firstChild;)u=u.firstChild;3===u.nodeType&&(o(h,u,0),i(h,u,u.nodeValue.length))}a=1===h.endOffset?2:h.endOffset-1-e}var p,v=a;do{o(h,u,a>=2?a-2:0),i(h,u,a>=1?a-1:0),a-=1,d=h.toString()}while(" "!==d&&""!==d&&160!==d.charCodeAt(0)&&a-2>=0&&d!==r);!function(t,e){return t===e||" "===t||160===t.charCodeAt(0)}(h.toString(),r)?0===h.startOffset?(o(h,u,0),i(h,u,v)):(o(h,u,a),i(h,u,v)):(o(h,u,a),i(h,u,v),a+=1),s=h.toString(),p=s.charAt(s.length-1),/[?!,.;:]/.test(p)&&i(h,u,v-1);var b=(s=h.toString().trim()).match(m),y=function(t){return t.getParam("link_default_protocol","http","string")}(t);if(b){var w=b[0];(function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e})(w,"www.",0)?w=y+"://"+w:function(t,e){return-1!==t.indexOf(e)}(w,"@")&&!function(t){return/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(t)}(w)&&(w="mailto:"+w),c=t.selection.getBookmark(),t.selection.setRng(h),t.execCommand("createlink",!1,w),!1!==g&&t.dom.setAttrib(t.selection.getNode(),"target",g),t.selection.moveToBookmark(c),t.nodeChanged()}}},u=function(t){var n;t.on("keydown",(function(e){if(13===e.keyCode)return function(t){a(t,-1,"")}(t)})),e.browser.isIE()?t.on("focus",(function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}})):(t.on("keypress",(function(e){if(41===e.keyCode)return function(t){a(t,-1,"(")}(t)})),t.on("keyup",(function(e){if(32===e.keyCode)return function(t){a(t,0,"")}(t)})))};t.add("autolink",(function(t){u(t)}))}()},5209:(t,e,n)=>{n(8578)},8578:()=>{!function(){"use strict";var t=Object.hasOwnProperty,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),o=function(t){return t.getParam("min_height",t.getElement().offsetHeight,"number")},i=function(t,e,n,o,a){r.setEditorTimeout(t,(function(){c(t,e),n--?i(t,e,n,o,a):a&&a()}),o)},a=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},u=function(t,e,n,r){var o=parseInt(t.getStyle(e,n,r),10);return isNaN(o)?0:o},c=function(t,e,r){var i=t.dom,s=t.getDoc();if(s)if(function(t){return t.plugins.fullscreen&&t.plugins.fullscreen.isFullscreen()}(t))a(t,!0);else{var l=s.documentElement,f=function(t){return t.getParam("autoresize_bottom_margin",50,"number")}(t),d=o(t),m=u(i,l,"margin-top",!0),g=u(i,l,"margin-bottom",!0),h=l.offsetHeight+m+g+f;h<0&&(h=0);var p=t.getContainer().offsetHeight-t.getContentAreaContainer().offsetHeight;h+p>o(t)&&(d=h+p);var v=function(t){return t.getParam("max_height",0,"number")}(t);if(v&&d>v?(d=v,a(t,!0)):a(t,!1),d!==e.get()){var b=d-e.get();if(i.setStyle(t.getContainer(),"height",d+"px"),e.set(d),function(t){t.fire("ResizeEditor")}(t),n.browser.isSafari()&&n.mac){var y=t.getWin();y.scrollTo(y.pageXOffset,y.pageYOffset)}t.hasFocus()&&function(t){if("setcontent"===(null==t?void 0:t.type.toLowerCase())){var e=t;return!0===e.selection||!0===e.paste}return!1}(r)&&t.selection.scrollIntoView(),n.webkit&&b<0&&c(t,e,r)}}};e.add("autoresize",(function(e){var n,r,o;if(n=e.settings,r="resize",t.call(n,r)||(e.settings.resize=!1),!e.inline){var a=(o=0,{get:function(){return o},set:function(t){o=t}});!function(t,e){t.addCommand("mceAutoResize",(function(){c(t,e)}))}(e,a),function(t,e){t.on("init",(function(){var e=function(t){return t.getParam("autoresize_overflow_padding",1,"number")}(t),n=t.dom;n.setStyles(t.getDoc().documentElement,{height:"auto"}),n.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})})),t.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(function(n){c(t,e,n)})),function(t){return t.getParam("autoresize_on_init",!0,"boolean")}(t)&&t.on("init",(function(){i(t,e,20,100,(function(){i(t,e,5,1e3)}))}))}(e,a)}}))}()},7259:(t,e,n)=>{n(8492)},8492:()=>{!function(){"use strict";var t,e,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return function(e){return typeof e===t}},o=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}}("string"),i=r("boolean"),a=r("function"),u=r("number"),c=function(){},s=function(t){return function(){return t}},l=function(t){return t},f=s(!1),d=s(!0),m=function(){return g},g={fold:function(t,e){return t()},isSome:f,isNone:d,getOr:e=l,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:s(null),getOrUndefined:s(void 0),or:e,orThunk:t,map:m,each:c,bind:m,exists:f,forall:d,filter:function(){return m()},toArray:function(){return[]},toString:s("none()")},h=function(t){var e=s(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:d,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return h(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:g},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},p={some:h,none:m,from:function(t){return null==t?g:h(t)}},v=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},b=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},y={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return b(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return b(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return b(n)},fromDom:b,fromPoint:function(t,e,n){return p.from(t.dom.elementFromPoint(e,n)).map(b)}},w=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")};"undefined"!=typeof window?window:Function("return this;")();var x,C=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},S=C(1),k=C(3),T=C(9),O=C(11),E=function(t){return function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t.dom.childNodes,y.fromDom)},_=function(t,e,n){!function(t,e,n){if(!(o(n)||i(n)||u(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},R=function(t,e){t.dom.removeAttribute(e)},N=a(Element.prototype.attachShadow)&&a(Node.prototype.getRootNode)?function(t){return y.fromDom(t.dom.getRootNode())}:function(t){return T(t)?t:(e=t,y.fromDom(e.dom.ownerDocument));var e},A=function(t){var e,n=N(t);return O(e=n)&&null!=e.dom.host?p.some(n):p.none()},D=function(t){return y.fromDom(t.dom.host)},M=function(t){var e=k(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return A(y.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=M,r=D,function(t){return n(r(t))}))},B=function(t,e,n){return function(t,e,n){for(var r=t.dom,o=a(n)?n:f;r.parentNode;){r=r.parentNode;var i=y.fromDom(r);if(e(i))return p.some(i);if(o(i))break}return p.none()}(t,(function(t){return w(t,e)}),n)},z=function(t,e){return function(t){return void 0!==t.style&&a(t.style.getPropertyValue)}(t)?t.style.getPropertyValue(e):""},P=function(t){return"rtl"===function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||M(t)?r:z(n,e)}(t,"direction")?"rtl":"ltr"},L=function(t,e){return function(t,e){return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(E(t),e)}(t,(function(t){return w(t,e)}))},I=function(t){return function(t){return p.from(t.dom.parentNode).map(y.fromDom)}(t).filter(S)},H=(x="li",function(t){return S(t)&&t.dom.nodeName.toLowerCase()===x}),F=function(t,e){var n=t.selection.getSelectedBlocks();n.length>0&&(v(n,(function(t){var n=y.fromDom(t),r=H(n),o=function(t,e){return(e?B(t,"ol,ul"):p.some(t)).getOr(t)}(n,r);I(o).each((function(t){if(P(t)!==e?_(o,"dir",e):P(o)!==e&&R(o,"dir"),r){var n=L(o,"li[dir]");v(n,(function(t){return R(t,"dir")}))}}))})),t.nodeChanged())},V=function(t,e){return function(n){var r=function(t){var r=y.fromDom(t.element);n.setActive(P(r)===e)};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}};n.add("directionality",(function(t){!function(t){t.addCommand("mceDirectionLTR",(function(){F(t,"ltr")})),t.addCommand("mceDirectionRTL",(function(){F(t,"rtl")}))}(t),function(t){t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return t.execCommand("mceDirectionLTR")},onSetup:V(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return t.execCommand("mceDirectionRTL")},onSetup:V(t,"rtl")})}(t)}))}()},4926:(t,e,n)=>{n(755)},755:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");t.add("hr",(function(t){!function(t){t.addCommand("InsertHorizontalRule",(function(){t.execCommand("mceInsertContent",!1,"<hr />")}))}(t),function(t){var e=function(){return t.execCommand("InsertHorizontalRule")};t.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:e}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:e})}(t)}))}()},2170:(t,e,n)=>{n(3302)},3302:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},a=function(t){return function(e){return typeof e===t}},u=i("string"),c=i("object"),s=i("array"),l=(t=null,function(e){return t===e}),f=a("boolean"),d=function(t){return!function(t){return null==t}(t)},m=a("function"),g=a("number"),h=function(){},p=function(t){return function(){return t}},v=function(t){return t},b=p(!1),y=p(!0),w=function(){return x},x={fold:function(t,e){return t()},isSome:b,isNone:y,getOr:n=v,getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:p(null),getOrUndefined:p(void 0),or:n,orThunk:e,map:w,each:h,bind:w,exists:b,forall:y,filter:function(){return w()},toArray:function(){return[]},toString:p("none()")},C=function(t){var e=p(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:y,isNone:b,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return C(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:x},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},S={some:C,none:w,from:function(t){return null==t?x:C(t)}},k=Object.keys,T=Object.hasOwnProperty,O=function(t,e,n,r){return function(t,e){for(var n=k(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},E=function(t,e){return T.call(t,e)},_=Array.prototype.push,R=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!s(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);_.apply(e,t[n])}return e},N=function(t){return function(t,e){return e>=0&&e<t.length?S.some(t[e]):S.none()}(t,0)};"undefined"!=typeof window?window:Function("return this;")();var A,D=function(t,e,n){!function(t,e,n){if(!(u(n)||f(n)||g(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},M=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},B={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return M(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return M(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return M(n)},fromDom:M,fromPoint:function(t,e,n){return S.from(t.dom.elementFromPoint(e,n)).map(M)}},z=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),P=tinymce.util.Tools.resolve("tinymce.util.Promise"),L=tinymce.util.Tools.resolve("tinymce.util.URI"),I=tinymce.util.Tools.resolve("tinymce.util.XHR"),H=function(t){return t.getParam("image_dimensions",!0,"boolean")},F=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},V=function(t){return t&&(t=t.replace(/px$/,"")),t},j=function(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t},U=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},W=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},q=function(t,e){return L.isDomSafe(e,"img",t.settings)},$=z.DOM,G=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?V(t.style.marginLeft):""},K=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?V(t.style.marginTop):""},X=function(t){return t.style.borderWidth?V(t.style.borderWidth):""},Y=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},J=function(t,e){return t.style[e]?t.style[e]:""},Q=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},Z=function(t,e,n){""===n?t.removeAttribute(e):t.setAttribute(e,n)},tt=function(t){Q(t)?function(t){var e=t.parentNode;$.insertAfter(t,e),$.remove(e)}(t):function(t){var e=$.create("figure",{class:"image"});$.insertAfter(e,t),e.appendChild(t),e.appendChild($.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"}(t)},et=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");r.length>0?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},nt=function(t,e){return function(t,n,r){t.style[n]?(t.style[n]=j(r),et(t,e)):Z(t,n,r)}},rt=function(t,e){return t.style[e]?V(t.style[e]):Y(t,e)},ot=function(t,e){var n=j(e);t.style.marginLeft=n,t.style.marginRight=n},it=function(t,e){var n=j(e);t.style.marginTop=n,t.style.marginBottom=n},at=function(t,e){var n=j(e);t.style.borderWidth=n},ut=function(t,e){t.style.borderStyle=e},ct=function(t){return"FIGURE"===t.nodeName},st=function(t){return 0===$.getAttrib(t,"alt").length&&"presentation"===$.getAttrib(t,"role")},lt=function(t){return st(t)?"":Y(t,"alt")},ft=function(t,e){var n=document.createElement("img");return Z(n,"style",e.style),(G(n)||""!==e.hspace)&&ot(n,e.hspace),(K(n)||""!==e.vspace)&&it(n,e.vspace),(X(n)||""!==e.border)&&at(n,e.border),(function(t){return J(t,"borderStyle")}(n)||""!==e.borderStyle)&&ut(n,e.borderStyle),t(n.getAttribute("style"))},dt=function(t,e){return{src:Y(e,"src"),alt:lt(e),title:Y(e,"title"),width:rt(e,"width"),height:rt(e,"height"),class:Y(e,"class"),style:t(Y(e,"style")),caption:Q(e),hspace:G(e),vspace:K(e),border:X(e),borderStyle:J(e,"borderStyle"),isDecorative:st(e)}},mt=function(t,e,n,r,o){n[r]!==e[r]&&o(t,r,n[r])},gt=function(t,e,n){if(n){$.setAttrib(t,"role","presentation");var r=B.fromDom(t);D(r,"alt","")}else{if(l(e)){r=B.fromDom(t);o="alt",r.dom.removeAttribute(o)}else{r=B.fromDom(t);D(r,"alt",e)}"presentation"===$.getAttrib(t,"role")&&$.setAttrib(t,"role","")}var o},ht=function(t,e){return function(n,r,o){t(n,o),et(n,e)}},pt=function(t,e,n){var r=dt(t,n);mt(n,r,e,"caption",(function(t,e,n){return tt(t)})),mt(n,r,e,"src",Z),mt(n,r,e,"title",Z),mt(n,r,e,"width",nt(0,t)),mt(n,r,e,"height",nt(0,t)),mt(n,r,e,"class",Z),mt(n,r,e,"style",ht((function(t,e){return Z(t,"style",e)}),t)),mt(n,r,e,"hspace",ht(ot,t)),mt(n,r,e,"vspace",ht(it,t)),mt(n,r,e,"border",ht(at,t)),mt(n,r,e,"borderStyle",ht(ut,t)),function(t,e,n){n.alt===e.alt&&n.isDecorative===e.isDecorative||gt(t,n.alt,n.isDecorative)}(n,r,e)},vt=function(t,e){var n=t.dom.styles.parse(e),r=U(n),o=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(o)},bt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||W(e))?null:e},yt=function(t,e){var n=t.dom,r=function(t,e){var n,r={};return O(t,e,(n=r,function(t,e){n[e]=t}),h),r}(t.schema.getTextBlockElements(),(function(e,n){return!t.schema.isValidChild(n,"figure")})),o=n.getParent(e.parentNode,(function(t){return e=r,n=t.nodeName,E(e,n)&&void 0!==e[n]&&null!==e[n];var e,n}),t.getBody());return o?n.split(o,e):e},wt=function(t,e){var n=function(t,e){var n=document.createElement("img");if(pt(t,o(o({},e),{caption:!1}),n),gt(n,e.alt,e.isDecorative),e.caption){var r=$.create("figure",{class:"image"});return r.appendChild(n),r.appendChild($.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}((function(e){return vt(t,e)}),e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),ct(r)){var i=yt(t,r);t.selection.select(i)}else t.selection.select(r)},xt=function(t,e){var n=bt(t);if(pt((function(e){return vt(t,e)}),e,n),function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))}(t,n),ct(n.parentNode)){var r=n.parentNode;yt(t,r),t.selection.select(n.parentNode)}else t.selection.select(n),function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!H(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r}(t,e,n)},Ct=function(t,e){var n=bt(t);if(n){var r=dt((function(e){return vt(t,e)}),n),i=o(o({},r),e),a=function(t,e){var n=e.src;return o(o({},e),{src:q(t,n)?n:""})}(t,i);i.src?xt(t,a):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,n)}else e.src&&wt(t,o(o({},{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),e))},St=(A=function(t,e){return c(t)&&c(e)?St(t,e):e},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)E(o,i)&&(n[i]=A(n[i],o[i]))}return n}),kt=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),Tt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ot=function(t){return u(t.value)?t.value:""},Et=function(t,e){var n=[];return Tt.each(t,(function(t){var r=function(t){return u(t.text)?t.text:u(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=Et(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},_t=function(t){return void 0===t&&(t=Ot),function(e){return e?S.from(e).map((function(e){return Et(e,t)})):S.none()}},Rt=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return S.none()}(t,(function(t){return function(t){return E(t,"items")}(t)?Rt(t.items,e):t.value===e?S.some(t):S.none()}))},Nt=_t,At=function(t){return _t(Ot)(t)},Dt=function(t,e){return t.bind((function(t){return Rt(t,e)}))},Mt=function(t){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},Bt=function(t){var e=Nt((function(e){return t.convertURL(e.value||e.url,"src")})),n=new P((function(n){!function(t,e){var n=function(t){return t.getParam("image_list",!1)}(t);u(n)?I.send({url:n,success:function(t){e(JSON.parse(t))}}):m(n)?n(e):e(n)}(t,(function(t){n(e(t).map((function(t){return R([[{text:"None",value:""}],t])})))}))})),r=At(function(t){return t.getParam("image_class_list")}(t)),o=function(t){return t.getParam("image_advtab",!1,"boolean")}(t),i=function(t){return t.getParam("image_uploadtab",!0,"boolean")}(t),a=function(t){return d(t.getParam("images_upload_url"))}(t),c=function(t){return d(t.getParam("images_upload_handler"))}(t),s=function(t){var e=bt(t);return e?dt((function(e){return vt(t,e)}),e):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}(t),l=function(t){return t.getParam("image_description",!0,"boolean")}(t),f=function(t){return t.getParam("image_title",!1,"boolean")}(t),g=H(t),h=function(t){return t.getParam("image_caption",!1,"boolean")}(t),p=function(t){return t.getParam("a11y_advanced_options",!1,"boolean")}(t),v=function(t){return t.getParam("automatic_uploads",!0,"boolean")}(t),b=S.some(function(t){return t.getParam("image_prepend_url","","string")}(t)).filter((function(t){return u(t)&&t.length>0}));return n.then((function(t){return{image:s,imageList:t,classList:r,hasAdvTab:o,hasUploadTab:i,hasUploadUrl:a,hasUploadHandler:c,hasDescription:l,hasImageTitle:f,hasDimensions:g,hasImageCaption:h,prependURL:b,hasAccessibilityOptions:p,automaticUploads:v}}))},zt=function(t){var e,n=t.imageList.map((function(t){return{name:"images",type:"listbox",label:"Image list",items:t}})),r={name:"alt",type:"input",label:"Alternative description",disabled:t.hasAccessibilityOptions&&t.image.isDecorative},i=t.classList.map((function(t){return{name:"classes",type:"listbox",label:"Class",items:t}}));return R([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],n.toArray(),t.hasAccessibilityOptions&&t.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],t.hasDescription?[r]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[o(o({},(e=t.classList.isSome()&&t.hasImageCaption,e?{type:"grid",columns:2}:{type:"panel"})),{items:R([i.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])})]])},Pt=function(t){return{title:"General",name:"general",items:zt(t)}},Lt=zt,It=function(t){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}},Ht=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t.class,caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[],isDecorative:t.isDecorative}},Ft=function(t,e){return{src:t.src.value,alt:0===t.alt.length&&e?null:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,class:t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle,isDecorative:t.isDecorative}},Vt=function(t,e){var n=e.getData();(function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?S.none():t.prependURL.bind((function(t){return e.substring(0,t.length)!==t?S.some(t+e):S.none()}))})(t,n.src.value).each((function(t){e.setData({src:{value:t,meta:n.src.meta}})}))},jt=function(t,e){var n=e.getData(),r=n.src.meta;if(void 0!==r){var o=St({},n);!function(t,e,n){t.hasDescription&&u(n.alt)&&(e.alt=n.alt),t.hasAccessibilityOptions&&(e.isDecorative=n.isDecorative||e.isDecorative||!1),t.hasImageTitle&&u(n.title)&&(e.title=n.title),t.hasDimensions&&(u(n.width)&&(e.dimensions.width=n.width),u(n.height)&&(e.dimensions.height=n.height)),u(n.class)&&Dt(t.classList,n.class).each((function(t){e.classes=t.value})),t.hasImageCaption&&f(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(u(n.style)&&(e.style=n.style),u(n.vspace)&&(e.vspace=n.vspace),u(n.border)&&(e.border=n.border),u(n.hspace)&&(e.hspace=n.hspace),u(n.borderstyle)&&(e.borderstyle=n.borderstyle))}(t,o,r),e.setData(o)}},Ut=function(t,e,n,r){Vt(e,r),jt(e,r),function(t,e,n,r){var o=r.getData(),i=o.src.value,a=o.src.meta||{};a.width||a.height||!e.hasDimensions||(i.length>0?t.imageSize(i).then((function(t){n.open&&r.setData({dimensions:t})})).catch((function(t){return console.error(t)})):r.setData({dimensions:{width:"",height:""}}))}(t,e,n,r),function(t,e,n){var r=n.getData(),o=Dt(t.imageList,r.src.value);e.prevImage=o,n.setData({images:o.map((function(t){return t.value})).getOr("")})}(e,n,r)},Wt=function(t,e,n){var r=U(t(n.style)),o=St({},n);return o.vspace=function(t){return t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"]?V(String(t["margin-top"])):""}(r),o.hspace=function(t){return t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"]?V(String(t["margin-right"])):""}(r),o.border=function(t){return t["border-width"]?V(String(t["border-width"])):""}(r),o.borderstyle=function(t){return t["border-style"]?String(t["border-style"]):""}(r),o.style=function(t,e,n){return e(t(e(n)))}(t,e,r),o},qt=function(t,e,n,r){var o=r.getData();r.block("Uploading image"),N(o.fileinput).fold((function(){r.unblock()}),(function(o){var i,a=URL.createObjectURL(o),u=function(){r.unblock(),URL.revokeObjectURL(a)},c=function(o){r.setData({src:{value:o,meta:{}}}),r.showTab("general"),Ut(t,e,n,r)};(i=o,new P((function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(i)}))).then((function(n){var i=t.createBlobCache(o,a,n);e.automaticUploads?t.uploadImage(i).then((function(t){c(t.url),u()})).catch((function(e){u(),t.alertErr(e)})):(t.addToBlobCache(i),c(i.blobUri()),r.unblock())}))}))},$t=function(t,e,n){return function(r,o){"src"===o.name?Ut(t,e,n,r):"images"===o.name?function(t,e,n,r){var o=r.getData(),i=Dt(e.imageList,o.images);i.each((function(t){""===o.alt||n.prevImage.map((function(t){return t.text===o.alt})).getOr(!1)?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})})),n.prevImage=i,Ut(t,e,n,r)}(t,e,n,r):"alt"===o.name?n.prevAlt=r.getData().alt:"style"===o.name?function(t,e){var n=e.getData(),r=Wt(t.parseStyle,t.serializeStyle,n);e.setData(r)}(t,r):"vspace"===o.name||"hspace"===o.name||"border"===o.name||"borderstyle"===o.name?function(t,e,n){var r=St(Ht(e.image),n.getData()),o=ft(t.normalizeCss,Ft(r,!1));n.setData({style:o})}(t,e,r):"fileinput"===o.name?qt(t,e,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},Gt=function(t){return function(){t.open=!1}},Kt=function(t){return t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler?{type:"tabpanel",tabs:R([[Pt(t)],t.hasAdvTab?[Mt(t)]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[It(t)]:[]])}:{type:"panel",items:Lt(t)}},Xt=function(t){return function(e){var n=function(t){return{prevImage:Dt(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}}(e);return{title:"Insert/Edit Image",size:"normal",body:Kt(e),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Ht(e.image),onSubmit:t.onSubmit(e),onChange:$t(t,e,n),onClose:Gt(n)}}},Yt=function(t){return function(e){return function(n){var r=St(Ht(e.image),n.getData());t.execCommand("mceUpdateImage",!1,Ft(r,e.hasAccessibilityOptions)),t.editorUpload.uploadImagesAuto(),n.close()}}},Jt=function(t){return function(e){return q(t,e)?function(t){return new P((function(e){var n=document.createElement("img"),r=function(t){n.onload=n.onerror=null,n.parentNode&&n.parentNode.removeChild(n),e(t)};n.onload=function(){var t={width:F(n.width,n.clientWidth),height:F(n.height,n.clientHeight)};r(P.resolve(t))},n.onerror=function(){r(P.reject("Failed to get image dimensions for: "+t))};var o=n.style;o.visibility="hidden",o.position="fixed",o.bottom=o.left="0px",o.width=o.height="auto",document.body.appendChild(n),n.src=t}))}(t.documentBaseURI.toAbsolute(e)).then((function(t){return{width:String(t.width),height:String(t.height)}})):P.resolve({width:"",height:""})}},Qt=function(t){return function(e,n,r){return t.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:r.split(",")[1]})}},Zt=function(t){return function(e){t.editorUpload.blobCache.add(e)}},te=function(t){return function(e){t.windowManager.alert(e)}},ee=function(t){return function(e){return vt(t,e)}},ne=function(t){return function(e){return t.dom.parseStyle(e)}},re=function(t){return function(e,n){return t.dom.serializeStyle(e,n)}},oe=function(t){return function(e){return kt(t).upload([e],!1).then((function(t){return 0===t.length?P.reject("Failed to upload image"):!1===t[0].status?P.reject(t[0].error.message):t[0]}))}},ie=function(t){var e={onSubmit:Yt(t),imageSize:Jt(t),addToBlobCache:Zt(t),createBlobCache:Qt(t),alertErr:te(t),normalizeCss:ee(t),parseStyle:ne(t),serializeStyle:re(t),uploadImage:oe(t)};return{open:function(){Bt(t).then(Xt(e)).then(t.windowManager.open)}}},ae=function(t){var e=t.attr("class");return e&&/\bimage\b/.test(e)},ue=function(t){return function(e){for(var n=e.length,r=function(e){e.attr("contenteditable",t?"true":null)};n--;){var o=e[n];ae(o)&&(o.attr("contenteditable",t?"false":null),Tt.each(o.getAll("figcaption"),r))}}};r.add("image",(function(t){!function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("figure",ue(!0)),t.serializer.addNodeFilter("figure",ue(!1))}))}(t),function(t){t.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ie(t).open,onSetup:function(e){return e.setActive(d(bt(t))),t.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),t.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:ie(t).open}),t.ui.registry.addContextMenu("image",{update:function(t){return ct(t)||"IMG"===t.nodeName&&!W(t)?["image"]:[]}})}(t),function(t){t.addCommand("mceImage",ie(t).open),t.addCommand("mceUpdateImage",(function(e,n){t.undoManager.transact((function(){return Ct(t,n)}))}))}(t)}))}()},5053:(t,e,n)=>{n(3253)},3253:(t,e,n)=>{!function(){"use strict";var t,e,r,o=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=(t="array",function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}),c=function(t){return!function(t){return null==t}(t)},s=function(t){return function(e){return typeof e===t}}("function"),l=function(){},f=function(t){return function(){return t}},d=function(t){return t},m=f(!1),g=f(!0),h=function(){return p},p={fold:function(t,e){return t()},isSome:m,isNone:g,getOr:r=d,getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:f(null),getOrUndefined:f(void 0),or:r,orThunk:e,map:h,each:l,bind:h,exists:m,forall:g,filter:function(){return h()},toArray:function(){return[]},toString:f("none()")},v=function(t){var e=f(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:g,isNone:m,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return v(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:p},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},b={some:v,none:h,from:function(t){return null==t?p:v(t)}},y={},w={exports:y};!function(t,e,r,o){var i,a;i=this,a=function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},e={exports:{}};!function(e){!function(t){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void u(e.promise,t)}a(e.promise,r)}else(1===t._state?a:u)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){u(t,e)}var r,i}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(t){o(i,t)}),n)}e[i]=a,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(t)}(e);var r=e.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||r}},"object"==typeof e&&void 0!==r?r.exports=a():"function"==typeof t&&t.amd?t(a):(i="undefined"!=typeof globalThis?globalThis:i||self).EphoxContactWrapper=a()}(void 0,y,w);var x=w.exports.boltExport,C=function(t,e){return T(document.createElement("canvas"),t,e)},S=function(t){var e=C(t.width,t.height);return k(e).drawImage(t,0,0),e},k=function(t){return t.getContext("2d")},T=function(t,e,n){return t.width=e,t.height=n,t},O=function(t){return new x((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",a),o.removeEventListener("error",u)},a=function(){i(),e(o)},u=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",a),o.addEventListener("error",u),o.src=r,o.complete&&setTimeout(a,0)}))},E=function(t){return new x((function(e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="blob",r.onload=function(){200===this.status&&e(this.response)},r.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},r.send()}))},_=function(t){return new x((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return b.none();for(var r=n[1],o=e[1],i=1024,a=atob(o),u=a.length,c=Math.ceil(u/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,d=Math.min(f+i,u),m=new Array(d-f),g=f,h=0;g<d;++h,++g)m[h]=a[g].charCodeAt(0);s[l]=new Uint8Array(m)}return b.some(new Blob(s,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))},R=function(t,e,n){return e=e||"image/png",s(HTMLCanvasElement.prototype.toBlob)?new x((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):_(t.toDataURL(e,n))},N=function(t){URL.revokeObjectURL(t.src)},A=function(t){return function(t){var e=t.src;return 0===e.indexOf("data:")?_(e):E(e)}(t)},D=Array.prototype.indexOf,M=function(t,e){return n=t,r=e,D.call(n,r)>-1;var n,r},B=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},z=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return b.some(i);if(n(i,r))break}return b.none()}(t,e,m)},P=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},L=Object.keys;(function(t){if(!u(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};B(t,(function(r,o){var i=L(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!u(c))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+i);var u=function(t){var r=L(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!P(e,(function(t){return M(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:u,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}}))})([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var I=function(t,e,n){var r=e.type,o=f(r),i=f(n),a=function(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))};return{getType:o,toBlob:function(){return x.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return R(t,e,n)}))},toAdjustedDataURL:a,toAdjustedBase64:function(t,e){return a(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(S)}}},H=function(t){return function(t){return new x((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return I(function(t){return O(t).then((function(t){N(t);var e=C(function(t){return t.naturalWidth||t.width}(t),function(t){return t.naturalHeight||t.height}(t));return k(e).drawImage(t,0,0),e}))}(t),t,e)}))},F=function(t,e){return R(t,e).then((function(e){return I(x.resolve(t),e,t.toDataURL())}))},V=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},j=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,a=Math.sin(r),u=Math.cos(r),c=V(Math.abs(o*u)+Math.abs(i*a)),s=V(Math.abs(o*a)+Math.abs(i*u)),l=C(c,s),f=k(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),F(l,e)},U=function(t,e,n){var r=C(t.width,t.height),o=k(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),F(r,e)},W=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return U(n,t.getType(),e)}))}(t,e)},q=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return j(n,t.getType(),e)}))}(t,e)},$=function(t,e,n){return void 0===n&&(n=!1),new x((function(r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&r({status:o.status,blob:o.response})},o.open("GET",t,!0),o.withCredentials=n,function(t,e){for(var n=L(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(e,(function(t,e){o.setRequestHeader(e,t)})),o.responseType="blob",o.send()}))},G=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],K=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],X=function(t,e){var n,r,o=(n=function(t,e){return c(t)?t[e]:void 0},r=t,B(e,(function(t,e){r=n(r,t,e)})),r);return b.from(o)},Y=function(t){var e=function(t){return"ImageProxy HTTP error: "+z(G,(function(e){return t===e.code})).fold(f("Unknown ImageProxy error"),(function(t){return t.message}))}(t);return x.reject(e)},J=function(t){return z(K,(function(e){return e.type===t})).fold(f("Unknown service error"),(function(t){return t.message}))},Q=function(t){return"ImageProxy Service error: "+function(t){try{return b.some(JSON.parse(t))}catch(t){return b.none()}}(t).bind((function(t){return X(t,["error","type"]).map(J)})).getOr("Invalid JSON in service error message")},Z=function(t){return function(t){return new x((function(e,n){var r=new FileReader;r.onload=function(){e(r.result)},r.onerror=function(t){n(t)},r.readAsText(t)}))}(t).then((function(t){var e=Q(t);return x.reject(e)}))},tt=function(t){return t<200||t>=300},et=function(t,e){var n={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return $(function(t,e){var n=-1===t.indexOf("?")?"?":"&";return/[?&]apiKey=/.test(t)?t:t+n+"apiKey="+encodeURIComponent(e)}(t,e),n).then((function(t){return tt(t.status)?(e=t.status,n=t.blob,function(t,e){return"application/json"===(null==e?void 0:e.type)&&(400===t||403===t||404===t||500===t)}(e,n)?Z(n):Y(e)):x.resolve(t.blob);var e,n}))},nt=function(t,e,n){return void 0===n&&(n=!1),e?et(t,e):function(t,e){return $(t,{},e).then((function(t){return tt(t.status)?Y(t.status):x.resolve(t.blob)}))}(t,n)},rt=function(t){return H(t)},ot=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},it={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return ot(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return ot(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return ot(n)},fromDom:ot,fromPoint:function(t,e,n){return b.from(t.dom.elementFromPoint(e,n)).map(ot)}};"undefined"!=typeof window?window:Function("return this;")();var at=function(t,e){return function(t,e){return z(t.dom.childNodes,(function(t){return e(it.fromDom(t))})).map(it.fromDom)}(t,(function(t){return function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(t,e)}))},ut=tinymce.util.Tools.resolve("tinymce.util.Delay"),ct=tinymce.util.Tools.resolve("tinymce.util.Promise"),st=tinymce.util.Tools.resolve("tinymce.util.URI"),lt=function(t){return t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")},ft=function(t){return t.getParam("imagetools_proxy")},dt=function(t){var e,n,r=function(t){return/^[0-9\.]+px$/.test(t)};return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)},mt=function(t){return{w:t.naturalWidth,h:t.naturalHeight}},gt=0,ht=function(t){return at(it.fromDom(t),"img")},pt=function(t,e){return t.dom.is(e,"figure")},vt=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")},bt=function(t,e){var n=function(e){return vt(t,e)&&(Ct(t,e)||St(t,e)||c(ft(t)))};return pt(t,e)?ht(e).bind((function(t){return n(t.dom)?b.some(t.dom):b.none()})):n(e)?b.some(e):b.none()},yt=function(t,e){t.notificationManager.open({text:e,type:"error"})},wt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&&pt(t,n)?ht(n):vt(t,e)?b.some(it.fromDom(e)):b.none()},xt=function(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return c(r)?t.dom.encode(r[n]):null},Ct=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new st(n).host===t.documentBaseURI.host},St=function(t,e){return-1!==a.inArray(function(t){return t.getParam("imagetools_cors_hosts",[],"string[]")}(t),new st(e.src).host)},kt=function(t,e){if(St(t,e))return nt(e.src,null,function(t,e){return-1!==a.inArray(function(t){return t.getParam("imagetools_credentials_hosts",[],"string[]")}(t),new st(e.src).host)}(t,e));if(!Ct(t,e)){var n=ft(t),r=n+(-1===n.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),o=function(t){return t.getParam("api_key",t.getParam("imagetools_api_key","","string"),"string")}(t);return nt(r,o,!1)}return A(e)},Tt=function(t,e){return function(t){return b.from(t.getParam("imagetools_fetch_image",null,"function"))}(t).fold((function(){return kt(t,e)}),(function(t){return t(e)}))},Ot=function(t,e){var n=t.editorUpload.blobCache.getByUri(e.src);return n?ct.resolve(n.blob()):Tt(t,e)},Et=function(t){ut.clearTimeout(t.get())},_t=function(t,e,n,r,o,i,a){return n.toBlob().then((function(u){var s,l,f,d,m=t.editorUpload.blobCache;s=i.src;var g=e.type===u.type;return function(t){return t.getParam("images_reuse_filename",!1,"boolean")}(t)&&(d=m.getByUri(s),c(d)?(s=d.uri(),l=d.name(),f=d.filename()):(l=xt(t,s,2),f=xt(t,s,1))),d=m.create({id:"imagetools"+gt++,blob:u,base64:n.toBase64(),uri:s,name:l,filename:g?f:void 0}),m.add(d),t.undoManager.transact((function(){var e=function(){t.$(i).off("load",e),t.nodeChanged(),r?t.editorUpload.uploadImagesAuto():(Et(o),function(t,e){var n=ut.setEditorTimeout(t,(function(){t.editorUpload.uploadImagesAuto()}),function(t){return t.getParam("images_upload_timeout",3e4,"number")}(t));e.set(n)}(t,o))};t.$(i).on("load",e),a&&t.$(i).attr({width:a.w,height:a.h}),t.$(i).attr({src:d.blobUri()}).removeAttr("data-mce-src")})),d}))},Rt=function(t,e,n,r){return function(){return wt(t).fold((function(){yt(t,"Could not find selected image")}),(function(o){return t._scanForImages().then((function(){return Ot(t,o.dom)})).then((function(i){return rt(i).then(n).then((function(n){return _t(t,i,n,!1,e,o.dom,r)}))})).catch((function(e){yt(t,e)}))}))}},Nt=function(t,e,n){return function(){var r=wt(t).map((function(t){var e=dt(t.dom);return e?{w:e.h,h:e.w}:null})).getOrNull();return Rt(t,e,(function(t){return q(t,n)}),r)()}},At=function(t,e,n){return function(){return Rt(t,e,(function(t){return W(t,n)}))()}},Dt=function(t,e,n,r,o){return function(t){return O(t)}(o).then((function(t){var e=mt(t);return r.w===e.w&&r.h===e.h||dt(n)&&function(t,e){var n,r;e&&(n=t.style.width,r=t.style.height,(n||r)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,r=t.height,(n||r)&&(t.setAttribute("width",String(e.w)),t.setAttribute("height",String(e.h))))}(n,e),URL.revokeObjectURL(t.src),o})).then(rt).then((function(r){return _t(t,o,r,!0,e,n)}))},Mt=function(t,e){return function(){var n=wt(t),r=n.map((function(t){return mt(t.dom)}));n.each((function(o){bt(t,o.dom).each((function(i){Ot(t,o.dom).then((function(o){var i=function(t){return{blob:t,url:URL.createObjectURL(t)}}(o);t.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:i}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(o){var i=o.getData().imagetools.blob;n.each((function(n){r.each((function(r){Dt(t,e,n.dom,r,i)}))})),o.close()},onCancel:l,onAction:function(t,e){switch(e.name){case"save-state":e.value?t.enable("save"):t.disable("save");break;case"disable":t.disable("save"),t.disable("cancel");break;case"enable":t.enable("cancel")}}})}))}))}))}};i.add("imagetools",(function(t){var e=o(0),n=o(null);!function(t,e){a.each({mceImageRotateLeft:Nt(t,e,-90),mceImageRotateRight:Nt(t,e,90),mceImageFlipVertical:At(t,e,"v"),mceImageFlipHorizontal:At(t,e,"h"),mceEditImage:Mt(t,e)},(function(e,n){t.addCommand(n,e)}))}(t,e),function(t){var e=[],n=function(e){return function(){return t.execCommand(e)}},r=function(){return wt(t).exists((function(e){return bt(t,e.dom).isSome()}))},o=function(t){var n=function(e){return t.setDisabled(!e)};return n(r()),e=e.concat([n]),function(){e=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(e,(function(t){return t!==n}))}};t.on("NodeChange",(function(){var t=r();B(e,(function(e){return e(t)}))})),t.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft"),onSetup:o}),t.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight"),onSetup:o}),t.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical"),onSetup:o}),t.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal"),onSetup:o}),t.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:o}),t.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:n("mceImage")}),t.ui.registry.addContextMenu("imagetools",{update:function(e){return bt(t,e).map((function(t){return{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}})).toArray()}})}(t),function(t){t.ui.registry.addContextToolbar("imagetools",{items:lt(t),predicate:function(e){return bt(t,e).isSome()},position:"node",scope:"node"})}(t),function(t,e,n){t.on("NodeChange",(function(r){var o=n.get(),i=bt(t,r.element);o&&!i.exists((function(t){return o.src===t.src}))&&(Et(e),t.editorUpload.uploadImagesAuto(),n.set(null)),i.each(n.set)}))}(t,e,n)}))}()},2682:(t,e,n)=>{n(7384)},7384:()=>{!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},a=function(t){return function(e){return typeof e===t}},u=i("string"),c=i("array"),s=(t=null,function(e){return t===e}),l=a("boolean"),f=a("function"),d=function(){},m=function(t){return function(){return t}},g=function(t){return t},h=function(t,e){return t===e},p=m(!1),v=m(!0),b=function(){return y},y={fold:function(t,e){return t()},isSome:p,isNone:v,getOr:n=g,getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(void 0),or:n,orThunk:e,map:b,each:d,bind:b,exists:p,forall:v,filter:function(){return b()},toArray:function(){return[]},toString:m("none()")},w=function(t){var e=m(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=Array.prototype.indexOf,S=Array.prototype.push,k=function(t,e){return function(t,e){return C.call(t,e)}(t,e)>-1},T=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e},O=function(t,e){return T(function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t,e))},E=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()},_=function(t,e,n){return void 0===n&&(n=h),t.exists((function(t){return n(t,e)}))},R=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},N=function(t,e){return t?x.some(e):x.none()},A=function(t){var e=t.getParam("link_assume_external_targets",!1);return l(e)&&e?1:!u(e)||"http"!==e&&"https"!==e?0:e},D=function(t){return t.getParam("default_link_target")},M=function(t){return t.getParam("target_list",!0)},B=function(t){return t.getParam("rel_list",[],"array")},z=function(t){return t.getParam("link_title",!0,"boolean")},P=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},L=function(t){return t.getParam("link_default_protocol","http","string")},I=tinymce.util.Tools.resolve("tinymce.util.Tools"),H=function(t){return u(t.value)?t.value:""},F=function(t,e){var n=[];return I.each(t,(function(t){var r=function(t){return u(t.text)?t.text:u(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=F(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},V=function(t){return void 0===t&&(t=H),function(e){return x.from(e).map((function(e){return F(e,t)}))}},j={sanitize:function(t){return V(H)(t)},sanitizeWith:V,createUi:function(t,e){return function(n){return{name:t,type:"listbox",label:e,items:n}}},getValue:H},U=function(){return(U=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},W=Object.keys,q=Object.hasOwnProperty,$=function(t,e,n,r){return function(t,e){for(var n=W(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},G=function(t,e){return q.call(t,e)},K=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),X=tinymce.util.Tools.resolve("tinymce.util.URI"),Y=function(t){return t&&"a"===t.nodeName.toLowerCase()},J=function(t){return Y(t)&&!!tt(t)},Q=function(t,e){if(t.collapsed)return[];var n=t.cloneContents(),r=new K(n.firstChild,n),o=[],i=n.firstChild;do{e(i)&&o.push(i)}while(i=r.next());return o},Z=function(t){return/^\w+:/i.test(t)},tt=function(t){var e=t.getAttribute("data-mce-href");return e||t.getAttribute("href")},et=function(t,e){var n=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter((function(t){return-1===I.inArray(n,t)}))},i=e?function(t){return(t=o(t)).length>0?t.concat(n):n}(r):o(r);return i.length>0?function(t){return I.trim(t.sort().join(" "))}(i):""},nt=function(t,e){return e=e||t.selection.getNode(),at(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},rt=function(t,e){return function(t){return t.replace(/\uFEFF/g,"")}(e?e.innerText||e.textContent:t.getContent({format:"text"}))},ot=function(t){return I.grep(t,J).length>0},it=function(t){var e=t.schema.getTextInlineElements();return 0===Q(t.selection.getRng(),(function(t){return 1===t.nodeType&&!Y(t)&&!G(e,t.nodeName.toLowerCase())})).length},at=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},ut=function(t,e){var n=U({},e);if(!(B(t).length>0)&&!1===P(t)){var r=et(n.rel,"_blank"===n.target);n.rel=r||null}return x.from(n.target).isNone()&&!1===M(t)&&(n.target=D(t)),n.href=function(t,e){return"http"!==e&&"https"!==e||Z(t)?t:e+"://"+t}(n.href,A(t)),n},ct=function(t,e,n){var r=t.selection.getNode(),o=nt(t,r),i=ut(t,function(t){var e,n,r;return e=["title","rel","class","target"],n=function(e,n){return t[n].each((function(t){e[n]=t.length>0?t:null})),e},r={href:t.href},function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)}(e,(function(t,e){r=n(r,t,e)})),r}(n));t.undoManager.transact((function(){n.href===e.href&&e.attach(),o?(t.focus(),function(t,e,n,r){n.each((function(t){G(e,"innerText")?e.innerText=t:e.textContent=t})),t.dom.setAttribs(e,r),t.selection.select(e)}(t,o,n.text,i)):function(t,e,n,r){at(e)?mt(t,e,r):n.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))}))}(t,r,n.text,i)}))},st=function(t){var e=t.class,n=t.href,r=t.rel,o=t.target,i=t.text,a=t.title;return function(t,e){var n,r={};return $(t,e,(n=r,function(t,e){n[e]=t}),d),r}({class:e.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:a.getOrNull()},(function(t,e){return!1===s(t)}))},lt=function(t,e,n){var r=function(t,e){var n=e.href;return U(U({},e),{href:X.isDomSafe(n,"a",t.settings)?n:""})}(t,n);t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,st(r)):ct(t,e,r)},ft=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var e=t.selection.getNode();at(e)?dt(t,e):function(t){var e=t.dom,n=t.selection,r=n.getBookmark(),o=n.getRng().cloneRange(),i=e.getParent(o.startContainer,"a[href]",t.getBody()),a=e.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),a&&o.setEndAfter(a),n.setRng(o),t.execCommand("unlink"),n.moveToBookmark(r)}(t),t.focus()}))}(t)},dt=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},mt=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},gt=function(t){return G(e=t,n="items")&&void 0!==e[n]&&null!==e[n];var e,n},ht=function(t,e){return E(e,(function(e){return gt(e)?ht(t,e.items):N(e.value===t,e)}))},pt=function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?ht(o,n).map((function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:d}},text:i?t:e.text}})):x.none()},vt=function(t,e){var n={text:t.text,title:t.title},r=function(t){var e,r=(e=t.url,N(n.text.length<=0,x.from(e.meta.text).getOr(e.value))),o=function(t){return N(n.title.length<=0,x.from(t.meta.title).getOr(""))}(t.url);return r.isSome()||o.isSome()?x.some(U(U({},r.map((function(t){return{text:t}})).getOr({})),o.map((function(t){return{title:t}})).getOr({}))):x.none()},o=function(t,r){var o,i,a=(o=e,i=r.name,"link"===i?o.link:"anchor"===i?o.anchor:x.none()).getOr([]);return pt(n.text,r.name,a,t)};return{onChange:function(t,e){var i=e.name;return"url"===i?r(t()):k(["anchor","link"],i)?o(t(),e):"text"===i||"title"===i?(n[i]=t()[i],x.none()):x.none()}}},bt=tinymce.util.Tools.resolve("tinymce.util.Delay"),yt=tinymce.util.Tools.resolve("tinymce.util.Promise"),wt=function(t){var e=t.href;return e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:")?x.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return U(U({},t),{href:"mailto:"+e})}}):x.none()},xt=function(t,e){return function(n){var r=n.href;return 1===t&&!Z(r)||0===t&&/^\s*www(\.|\d\.)/i.test(r)?x.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+e+":// prefix?",preprocess:function(t){return U(U({},t),{href:e+"://"+r})}}):x.none()}},Ct=function(t,e){return E([wt,xt(A(t),L(t))],(function(t){return t(e)})).fold((function(){return yt.resolve(e)}),(function(n){return new yt((function(r){!function(t,e,n){var r=t.selection.getRng();bt.setEditorTimeout(t,(function(){t.windowManager.confirm(e,(function(e){t.selection.setRng(r),n(e)}))}))}(t,n.message,(function(t){r(t?n.preprocess(e):e)}))}))}))},St=function(t){var e=t.dom.select("a:not([href])"),n=O(e,(function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]}));return n.length>0?x.some([{text:"None",value:""}].concat(n)):x.none()},kt=function(t){var e=function(t){return t.getParam("link_class_list",[],"array")}(t);return e.length>0?j.sanitize(e):x.none()},Tt=tinymce.util.Tools.resolve("tinymce.util.XHR"),Ot=function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=function(t){return t.getParam("link_list")}(t);return new yt((function(t){u(n)?Tt.send({url:n,success:function(e){return t(function(t){try{return x.some(JSON.parse(t))}catch(t){return x.none()}}(e))},error:function(e){return t(x.none())}}):f(n)?n((function(e){return t(x.some(e))})):t(x.from(n))})).then((function(t){return t.bind(j.sanitizeWith(e)).map((function(t){if(t.length>0){return[{text:"None",value:""}].concat(t)}return t}))}))},Et=function(t,e){var n=B(t);if(n.length>0){var r=_(e,"_blank");return(!1===P(t)?j.sanitizeWith((function(t){return et(j.getValue(t),r)})):j.sanitize)(n)}return x.none()},_t=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Rt=function(t){var e=M(t);return c(e)?j.sanitize(e).orThunk((function(){return x.some(_t)})):!1===e?x.none():x.some(_t)},Nt=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?x.some(r):x.none()},At=function(t,e){return Ot(t).then((function(n){var r=function(t,e){var n=t.dom,r=it(t)?x.some(rt(t.selection,e)):x.none(),o=e?x.some(n.getAttrib(e,"href")):x.none(),i=e?x.from(n.getAttrib(e,"target")):x.none(),a=Nt(n,e,"rel"),u=Nt(n,e,"class");return{url:o,text:r,title:Nt(n,e,"title"),target:i,rel:a,linkClass:u}}(t,e);return{anchor:r,catalogs:{targets:Rt(t),rels:Et(t,r.target),classes:kt(t),anchor:St(t),link:n},optNode:x.from(e),flags:{titleEnabled:z(t)}}}))},Dt=function(t){(function(t){var e=nt(t);return At(t,e)})(t).then((function(e){return function(t,e,n){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,e){var n=t.anchor,r=n.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:r,link:r,rel:n.rel.getOr(""),target:n.target.or(e).getOr(""),linkClass:n.linkClass.getOr("")}}(t,x.from(D(n))),a=t.catalogs,u=vt(i,a);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:T([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,R([a.anchor.map(j.createUi("anchor","Anchors")),a.rels.map(j.createUi("rel","Rel")),a.targets.map(j.createUi("target","Open link in...")),a.link.map(j.createUi("link","Link list")),a.classes.map(j.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,e){var n=e.name;u.onChange(t.getData,{name:n}).each((function(e){t.setData(e)}))},onSubmit:e}}(e,function(t,e){return function(n){var r=n.getData();if(!r.url.value)return ft(t),void n.close();var o=function(t){return x.from(r[t]).filter((function(n){return!_(e.anchor[t],n)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},a={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:d};Ct(t,i).then((function(e){lt(t,a,e)})),n.close()}}(t,e),t)})).then((function(e){t.windowManager.open(e)}))},Mt=function(t){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,e){document.body.appendChild(t),t.dispatchEvent(e),document.body.removeChild(t)}(e,n)},Bt=function(t,e){return t.dom.getParent(e,"a[href]")},zt=function(t){return Bt(t,t.selection.getStart())},Pt=function(t,e){if(e){var n=tt(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else Mt(e.href)}},Lt=function(t){return function(){Dt(t)}},It=function(t){return function(){Pt(t,zt(t))}},Ht=function(t,e){return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}},Ft=function(t){return function(e){var n=function(){return e.setActive(!t.mode.isReadOnly()&&null!==nt(t,t.selection.getNode()))};return n(),Ht(t,n)}},Vt=function(t){return function(e){var n=function(){return e.setDisabled(null===nt(t,t.selection.getNode()))};return n(),Ht(t,n)}},jt=function(t){return function(e){var n=function(e){return ot(e)||(n=t.selection.getRng(),Q(n,J).length>0);var n},r=t.dom.getParents(t.selection.getStart());return e.setDisabled(!n(r)),Ht(t,(function(t){return e.setDisabled(!n(t.parents))}))}},Ut=function(t){var e=function(e){var n=t.selection.getNode();return e.setDisabled(!nt(t,n)),d};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Ft(t)},label:"Link",predicate:function(e){return!!nt(t,e)&&function(t){return t.getParam("link_context_toolbar",!1,"boolean")}(t)},initValue:function(){var e=nt(t);return e?tt(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!nt(t,n)),Ft(t)(e)},onAction:function(e){var n=e.getValue(),r=function(e){var n=nt(t),r=it(t);if(!n&&r){var o=rt(t.selection,n);return x.some(o.length>0?o:e)}return x.none()}(n);lt(t,{href:n,attach:d},{href:n,text:r,title:x.none(),rel:x.none(),target:x.none(),class:x.none()}),function(t){t.selection.collapse(!1)}(t),e.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:e,onAction:function(e){ft(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:e,onAction:function(e){It(t)(),e.hide()}}]})};r.add("link",(function(t){!function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Lt(t),onSetup:Ft(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:It(t),onSetup:Vt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return ft(t)},onSetup:jt(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:It(t),onSetup:Vt(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Lt(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return ft(t)},onSetup:jt(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(e){return ot(t.dom.getParents(e,"a"))?"link unlink openlink":"link"}})}(t),Ut(t),function(t){t.on("click",(function(e){var n=Bt(t,e.target);n&&o.metaKeyPressed(e)&&(e.preventDefault(),Pt(t,n))})),t.on("keydown",(function(e){var n=zt(t);n&&13===e.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(e)&&(e.preventDefault(),Pt(t,n))}))}(t),function(t){t.addCommand("mceLink",(function(){!function(t){return t.getParam("link_quicklink",!1,"boolean")}(t)?Lt(t)():t.fire("contexttoolbar-show",{toolbarKey:"quicklink"})}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}()},1236:(t,e,n)=>{n(7585)},7585:()=>{!function(){"use strict";var t,e,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},o=function(t){return function(e){return typeof e===t}},i=r("string"),a=r("object"),u=r("array"),c=o("boolean"),s=o("function"),l=o("number"),f=function(){},d=function(t){return function(){return t}},m=function(t){return t},g=function(t,e){return t===e},h=function(t){return function(e){return!t(e)}},p=d(!1),v=d(!0),b=function(){return y},y={fold:function(t,e){return t()},isSome:p,isNone:v,getOr:e=m,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:e,orThunk:t,map:b,each:f,bind:b,exists:p,forall:v,filter:function(){return b()},toArray:function(){return[]},toString:d("none()")},w=function(t){var e=d(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=Array.prototype.slice,S=Array.prototype.push,k=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},T=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},O=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},E=function(t,e,n){return T(t,(function(t,r){n=e(n,t,r)})),n},_=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()},R=function(t,e){return _(t,e,p)},N=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!u(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e}(k(t,e))},A=function(t){var e=C.call(t,0);return e.reverse(),e},D=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},M=function(t){return D(t,0)},B=function(t){return D(t,t.length-1)},z=function(){return(z=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};var P,L=function(){return I(0,0)},I=function(t,e){return{major:t,minor:e}},H={nu:I,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?L():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return I(r(1),r(2))}(t,n)},unknown:L},F=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()}(e.brands,(function(e){var n=e.brand.toLowerCase();return R(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:H.nu(parseInt(e.version,10),0)}}))}))},V=function(t,e){var n=String(e).toLowerCase();return R(t,(function(t){return t.search(n)}))},j=function(t,e){return-1!==t.indexOf(e)},U=(P=/^\s+|\s+$/g,function(t){return t.replace(P,"")}),W=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,q=function(t){return function(e){return j(e,t)}},$=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return j(t,"edge/")&&j(t,"chrome")&&j(t,"safari")&&j(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,W],search:function(t){return j(t,"chrome")&&!j(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return j(t,"msie")||j(t,"trident")}},{name:"Opera",versionRegexes:[W,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:q("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:q("firefox")},{name:"Safari",versionRegexes:[W,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(j(t,"safari")||j(t,"mobile/"))&&j(t,"applewebkit")}}],G=[{name:"Windows",search:q("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return j(t,"iphone")||j(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:q("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:q("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:q("linux"),versionRegexes:[]},{name:"Solaris",search:q("sunos"),versionRegexes:[]},{name:"FreeBSD",search:q("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:q("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],K={browsers:d($),oses:d(G)},X="Edge",Y="Chrome",J="Opera",Q="Firefox",Z="Safari",tt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(X),isChrome:r(Y),isIE:r("IE"),isOpera:r(J),isFirefox:r(Q),isSafari:r(Z)}},et={unknown:function(){return tt({current:void 0,version:H.unknown()})},nu:tt,edge:d(X),chrome:d(Y),ie:d("IE"),opera:d(J),firefox:d(Q),safari:d(Z)},nt="Windows",rt="Android",ot="Linux",it="Solaris",at="FreeBSD",ut="ChromeOS",ct=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(nt),isiOS:r("iOS"),isAndroid:r(rt),isOSX:r("OSX"),isLinux:r(ot),isSolaris:r(it),isFreeBSD:r(at),isChromeOS:r(ut)}},st={unknown:function(){return ct({current:void 0,version:H.unknown()})},nu:ct,windows:d(nt),ios:d("iOS"),android:d(rt),linux:d(ot),osx:d("OSX"),solaris:d(it),freebsd:d(at),chromeos:d(ut)},lt=function(t,e,n){var r=K.browsers(),o=K.oses(),i=e.bind((function(t){return F(r,t)})).orThunk((function(){return function(t,e){return V(t,e).map((function(t){var n=H.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(et.unknown,et.nu),a=function(t,e){return V(t,e).map((function(t){var n=H.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(st.unknown,st.nu),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:d(o),isiPhone:d(i),isTablet:d(c),isPhone:d(s),isTouch:d(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:d(l),isDesktop:d(f)}}(a,i,t,n);return{browser:i,os:a,deviceType:u}},ft=function(t){return window.matchMedia(t).matches},dt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}}((function(){return lt(navigator.userAgent,x.from(navigator.userAgentData),ft)})),mt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},gt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return mt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return mt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return mt(n)},fromDom:mt,fromPoint:function(t,e,n){return x.from(t.dom.elementFromPoint(e,n)).map(mt)}},ht=function(t,e){return t.dom===e.dom},pt=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},vt=function(t,e){return dt().browser.isIE()?pt(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},bt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},yt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),wt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),xt=tinymce.util.Tools.resolve("tinymce.util.VK"),Ct=Object.keys,St=function(t,e){for(var n=Ct(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},kt=function(t,e){var n={};return function(t,e,n,r){St(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),f),n};"undefined"!=typeof window?window:Function("return this;")();var Tt,Ot=function(t){return t.dom.nodeName.toLowerCase()},Et=(Tt=1,function(t){return function(t){return t.dom.nodeType}(t)===Tt}),_t=function(t){return function(e){return Et(e)&&Ot(e)===t}},Rt=function(t,e){var n=t.dom;St(e,(function(t,e){!function(t,e,n){if(!(i(n)||c(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(n,e,t)}))},Nt=function(t){return E(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},At=function(t){return x.from(t.dom.parentNode).map(gt.fromDom)},Dt=function(t){return k(t.dom.childNodes,gt.fromDom)},Mt=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(gt.fromDom)},Bt=function(t){return Mt(t,0)},zt=function(t){return Mt(t,t.dom.childNodes.length-1)},Pt=function(t,e){At(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Lt=function(t,e){t.dom.appendChild(e.dom)},It=function(t,e){T(e,(function(e){Lt(t,e)}))},Ht=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ft=function(t){return function(t,e){return gt.fromDom(t.dom.cloneNode(e))}(t,!0)},Vt=function(t,e){var n=function(t,e){var n=gt.fromTag(e),r=Nt(t);return Rt(n,r),n}(t,e);Pt(t,n);var r=Dt(t);return It(n,r),Ht(t),n},jt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Ut=tinymce.util.Tools.resolve("tinymce.util.Tools"),Wt=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},qt=function(t){return function(e){return e&&t.test(e.nodeName)}},$t=function(t){return t&&3===t.nodeType},Gt=qt(/^(OL|UL|DL)$/),Kt=qt(/^(OL|UL)$/),Xt=Wt("ol"),Yt=qt(/^(LI|DT|DD)$/),Jt=qt(/^(DT|DD)$/),Qt=qt(/^(TH|TD)$/),Zt=Wt("br"),te=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},ee=function(t,e){return t&&t.nodeName in e},ne=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},re=function(t,e){return t.isChildOf(e,t.getRoot())},oe=function(t,e){var n,r,o,i=t.dom,a=t.schema.getBlockElements(),u=i.createFragment(),c=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e}(t);if(c&&((r=i.create(c)).tagName===c.toUpperCase()&&i.setAttribs(r,function(t){return t.getParam("forced_root_block_attrs",{})}(t)),ee(e.firstChild,a)||u.appendChild(r)),e)for(;n=e.firstChild;){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),ee(n,a)?(u.appendChild(n),r=null):c?(r||(r=i.create(c),u.appendChild(r)),r.appendChild(n)):u.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):u.appendChild(i.create("br")),u},ie=jt.DOM,ae=_t("dd"),ue=_t("dt"),ce=function(t,e){ae(e)?Vt(e,"dt"):ue(e)&&At(e).each((function(n){return function(t,e,n){var r=ie.select('span[data-mce-type="bookmark"]',e),o=oe(t,n),i=ie.createRng();i.setStartAfter(n),i.setEndAfter(e);for(var a,u=i.extractContents(),c=u.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){ie.remove(c);break}t.dom.isEmpty(u)||ie.insertAfter(u,e),ie.insertAfter(o,e),ne(t.dom,n.parentNode)&&(a=n.parentNode,Ut.each(r,(function(t){a.parentNode.insertBefore(t,n.parentNode)})),ie.remove(a)),ie.remove(n),ne(t.dom,e)&&ie.remove(e)}(t,n.dom,e.dom)}))},se=function(t){ue(t)&&Vt(t,"dd")},le=function(t,e){if($t(t))return{container:t,offset:e};var n=yt.getNode(t,e);return $t(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&$t(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&$t(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},fe=function(t){var e=t.cloneRange(),n=le(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=le(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},de=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),me=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",pe(t,n))},ge=function(t){var e=me(t),n=t.selection.getSelectedBlocks();return function(t,e){return t&&1===e.length&&e[0]===t}(e,n)?function(t){return O(t.querySelectorAll("ol,ul,dl"),Gt)}(e):O(n,(function(t){return Gt(t)&&e!==t}))},he=function(t){var e=t.selection.getSelectedBlocks();return O(function(t,e){var n=Ut.map(e,(function(e){return t.dom.getParent(e,"li,dd,dt",pe(t,e))||e}));return de.unique(n)}(t,e),Yt)},pe=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},ve=function(t,e){var n=t.dom.getParents(e,"ol,ul",pe(t,e));return B(n)},be=function(t){var e=function(t){var e=ve(t,t.selection.getStart()),n=O(t.selection.getSelectedBlocks(),Kt);return e.toArray().concat(n)}(t);return ye(t,e)},ye=function(t,e){var n=k(e,(function(e){return ve(t,e).getOr(e)}));return de.unique(n)},we=function(t,e,n){return void 0===n&&(n=g),t.exists((function(t){return n(t,e)}))},xe=function(t,e,n){return t.isSome()&&e.isSome()?x.some(n(t.getOrDie(),e.getOrDie())):x.none()},Ce=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},Se=function(t,e,n){if(!i(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);(function(t){return void 0!==t.style&&s(t.style.getPropertyValue)})(t)&&t.style.setProperty(e,n)},ke=function(t,e){Lt(t.item,e.list)},Te=function(t,e){var n={list:gt.fromTag(e,t),item:gt.fromTag("li",t)};return Lt(n.list,n.item),n},Oe=function(t,e,n){var r=e.slice(0,n.depth);return B(r).each((function(e){!function(t,e){Lt(t.list,e),t.item=e}(e,function(t,e,n){var r=gt.fromTag("li",t);return Rt(r,e),It(r,n),r}(t,n.itemAttributes,n.content)),function(t,e){Ot(t.list)!==e.listType&&(t.list=Vt(t.list,e.listType)),Rt(t.list,e.listAttributes)}(e,n)})),r},Ee=function(t,e,n){var r,o=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(Te(t,e.listType));return r}(t,n,n.depth-e.length);return function(t){for(var e=1;e<t.length;e++)ke(t[e-1],t[e])}(o),function(t,e){for(var n=0;n<t.length-1;n++)r=t[n].item,o="list-style-type",i="none",a=void 0,a=r.dom,Se(a,o,i);var r,o,i,a;B(t).each((function(t){Rt(t.list,e.listAttributes),Rt(t.item,e.itemAttributes),It(t.item,e.content)}))}(o,n),r=o,xe(B(e),M(r),ke),e.concat(o)},_e=function(t){return bt(t,"OL,UL")},Re=function(t){return Bt(t).exists(_e)},Ne=function(t){return t.depth>0},Ae=function(t){return t.isSelected},De=function(t){var e=Dt(t),n=zt(t).exists(_e)?e.slice(0,-1):e;return k(n,Ft)},Me=function(t){return T(t,(function(e,n){(function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return _(A(t.slice(0,e)),r,o).orThunk((function(){return _(t.slice(e+1),r,o)}))})(t,n).fold((function(){e.dirty&&function(t){t.listAttributes=kt(t.listAttributes,(function(t,e){return"start"!==e}))}(e)}),(function(t){return r=t,(n=e).listType=r.listType,void(n.listAttributes=z({},r.listAttributes));var n,r}))})),t},Be=function(t,e,n,r){return Bt(r).filter(_e).fold((function(){e.each((function(t){ht(t.start,r)&&n.set(!0)}));var o=function(t,e,n){return At(t).filter(Et).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:De(t),itemAttributes:Nt(t),listAttributes:Nt(r),listType:Ot(r)}}))}(r,t,n.get());e.each((function(t){ht(t.end,r)&&n.set(!1)}));var i=zt(r).filter(_e).map((function(r){return ze(t,e,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return ze(t,e,n,r)}))},ze=function(t,e,n,r){return N(Dt(r),(function(r){return(_e(r)?ze:Be)(t+1,e,n,r)}))},Pe=function(t,e){var n=Me(e);return k(n,(function(e){var n,r,o,i=(n=e.content,o=(r||document).createDocumentFragment(),T(n,(function(t){o.appendChild(t.dom)})),gt.fromDom(o));return gt.fromDom(oe(t,i.dom))}))},Le=function(t,e){var n=Me(e);return function(t,e){var n=E(e,(function(e,n){return n.depth>e.length?Ee(t,e,n):Oe(t,e,n)}),[]);return M(n).map((function(t){return t.list}))}(t.contentDocument,n).toArray()},Ie=function(t,e,n){var r=function(t,e){var n,r=(n=!1,{get:function(){return n},set:function(t){n=t}});return k(t,(function(t){return{sourceList:t,entries:ze(0,e,r,t)}}))}(e,function(t){var e=k(he(t),gt.fromDom);return xe(R(e,h(Re)),R(A(e),h(Re)),(function(t,e){return{start:t,end:e}}))}(t));T(r,(function(e){!function(t,e){T(O(t,Ae),(function(t){return function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0}(e,t)}))}(e.entries,n);var r,o=function(t,e){return N(function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,a=t.length;i<a;i++){var u=t[i],c=e(u);c!==n&&(r.push(o),o=[]),n=c,o.push(u)}return 0!==o.length&&r.push(o),r}(e,Ne),(function(e){return M(e).exists(Ne)?Le(t,e):Pe(t,e)}))}(t,e.entries);T(o,(function(e){Ce(t,"Indent"===n?"IndentList":"OutdentList",e.dom)})),r=e.sourceList,T(o,(function(t){Pt(r,t)})),Ht(e.sourceList)}))},He=function(t,e){var n=k(be(t),gt.fromDom),r=k(function(t){return O(he(t),Jt)}(t),gt.fromDom),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();Ie(t,n,e),function(t,e,n){T(n,"Indent"===e?se:function(e){return ce(t,e)})}(t,e,r),t.selection.moveToBookmark(i),t.selection.setRng(fe(t.selection.getRng())),t.nodeChanged(),o=!0}return o},Fe=function(t){return He(t,"Indent")},Ve=function(t){return He(t,"Outdent")},je=function(t){return He(t,"Flatten")},Ue=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),We=jt.DOM,qe=function(t){var e={},n=function(n){var r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"];if(1===r.nodeType){var i=We.create("span",{"data-mce-type":"bookmark"});r.hasChildNodes()?(o=Math.min(o,r.childNodes.length-1),n?r.insertBefore(i,r.childNodes[o]):We.insertAfter(i,r.childNodes[o])):r.appendChild(i),r=i,o=0}e[n?"startContainer":"endContainer"]=r,e[n?"startOffset":"endOffset"]=o};return n(!0),t.collapsed||n(),e},$e=function(t){var e=function(e){var n,r=n=t[e?"startContainer":"endContainer"],o=t[e?"startOffset":"endOffset"];r&&(1===r.nodeType&&(o=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(r),r=r.parentNode,We.remove(n),!r.hasChildNodes()&&We.isBlock(r)&&r.appendChild(We.create("br"))),t[e?"startContainer":"endContainer"]=r,t[e?"startOffset":"endOffset"]=o)};e(!0),e();var n=We.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),fe(n)},Ge=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Ke=function(t){return/\btox\-/.test(t.className)},Xe=function(t,e,n){var r=function(t){var r=_(t.parents,Gt,Qt).filter((function(t){return t.nodeName===e&&!Ke(t)})).isSome();n(r)},o=t.dom.getParents(t.selection.getNode());return r({parents:o}),t.on("NodeChange",r),function(){return t.off("NodeChange",r)}},Ye=function(t,e){Ut.each(e,(function(e,n){t.setAttribute(n,e)}))},Je=function(t,e,n){!function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)}(t,e,n),function(t,e,n){Ye(e,n["list-attributes"]),Ut.each(t.select("li",e),(function(t){Ye(t,n["list-item-attributes"])}))}(t,e,n)},Qe=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&Zt(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(te(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},Ze=function(t,e,n){var r=t.selection.getRng(),o="LI",i=pe(t,t.selection.getStart(!0)),a=t.dom;if("false"!==a.getContentEditable(t.selection.getNode())){"DL"===(e=e.toUpperCase())&&(o="DT");var u=qe(r),c=function(t,e,n){for(var r,o=[],i=t.dom,a=Qe(t,e,!0,n),u=Qe(t,e,!1,n),c=[],s=a;s&&(c.push(s),s!==u);s=s.nextSibling);return Ut.each(c,(function(e){if(te(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||Zt(e))return Zt(e)&&i.remove(e),void(r=null);var a=e.nextSibling;Ue.isBookmarkNode(e)&&(Gt(a)||te(t,a)||!a&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))})),o}(t,r,i);Ut.each(c,(function(r){var i,u=r.previousSibling,c=r.parentNode;Yt(c)||(u&&Gt(u)&&u.nodeName===e&&function(t,e,n){var r=t.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return r===(null===o?"":o)}(a,u,n)?(i=u,r=a.rename(r,o),u.appendChild(r)):(i=a.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=a.rename(r,o)),function(t,e,n){Ut.each(n,(function(n){var r;return t.setStyle(e,((r={})[n]="",r))}))}(a,r,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),Je(a,i,n),en(t.dom,i))})),t.selection.setRng($e(u))}},tn=function(t,e,n){return function(t,e){return t&&e&&Gt(t)&&t.nodeName===e.nodeName}(e,n)&&function(t,e,n){return t.getStyle(e,"list-style-type",!0)===t.getStyle(n,"list-style-type",!0)}(t,e,n)&&(r=n,e.className===r.className);var r},en=function(t,e){var n,r;if(n=e.nextSibling,tn(t,e,n)){for(;r=n.firstChild;)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,tn(t,e,n)){for(;r=n.lastChild;)e.insertBefore(r,e.firstChild);t.remove(n)}},nn=function(t,e,n,r,o){var i=Gt(e);if(i&&e.nodeName===r&&!rn(o))je(t);else{Ze(t,r,o);var a=qe(t.selection.getRng()),u=i?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([e],n,!0):n;Ut.each(u,(function(e){!function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);Je(t.dom,o,r),Ce(t,Ge(n),o)}else Je(t.dom,e,r),Ce(t,Ge(n),e)}(t,e,r,o)})),t.selection.setRng($e(a))}},rn=function(t){return"list-style-type"in t},on=function(t,e,n){var r=me(t),o=ge(t),i=a(n)?n:{};o.length>0?nn(t,r,o,e,i):function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||rn(r)||Ke(e)){var o=qe(t.selection.getRng());Je(t.dom,e,r);var i=t.dom.rename(e,n);en(t.dom,i),t.selection.setRng($e(o)),Ze(t,n,r),Ce(t,Ge(n),i)}else je(t);else Ze(t,n,r),Ce(t,Ge(n),e)}(t,r,e,i)},an=jt.DOM,un=function(t,e){var n=Ut.grep(t.select("ol,ul",e));Ut.each(n,(function(e){!function(t,e){var n,r=e.parentNode;"LI"===r.nodeName&&r.firstChild===e&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(e),ne(t,r)&&an.remove(r)):an.setStyle(r,"listStyleType","none")),Gt(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(e)}(t,e)}))},cn=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if($t(o)&&(n?i<o.data.length:i>0))return o;var a=t.schema.getNonEmptyElements();1===o.nodeType&&(o=yt.getNode(o,i));var u=new wt(o,r);for(n&&function(t,e){return!!Zt(e)&&t.isBlock(e.nextSibling)&&!Zt(e.previousSibling)}(t.dom,o)&&u.next();o=u[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(a[o.nodeName])return o;if($t(o)&&o.data.length>0)return o}},sn=function(t,e){var n=e.childNodes;return 1===n.length&&!Gt(n[0])&&t.isBlock(n[0])},ln=function(t,e,n){var r,o=sn(t,n)?n.firstChild:n;if(function(t,e){sn(t,e)&&t.remove(e.firstChild,!0)}(t,e),!ne(t,e,!0))for(;r=e.firstChild;)o.appendChild(r)},fn=function(t,e,n){var r,o=e.parentNode;if(re(t,e)&&re(t,n)){Gt(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Zt(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&Zt(i)&&e.hasChildNodes()&&t.remove(i),ne(t,n,!0)&&t.$(n).empty(),ln(t,e,n),r&&n.appendChild(r);var a=vt(gt.fromDom(n),gt.fromDom(e))?t.getParents(e,Gt,n):[];t.remove(e),T(a,(function(e){ne(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},dn=function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))!function(t,e,n){t.dom.$(n).empty(),fn(t.dom,e,n),t.selection.setCursorLocation(n,0)}(t,n,r);else{var i=qe(e);fn(o,n,r),t.selection.setRng($e(i))}},mn=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=pe(t,o),a=n.getParent(r.getStart(),"LI",i);if(a){var u=a.parentNode;if(u===t.getBody()&&ne(n,u))return!0;var c=fe(r.getRng()),s=n.getParent(cn(t,c,e,i),"LI",i);if(s&&s!==a)return t.undoManager.transact((function(){var n;e?dn(t,c,s,a):(n=a).parentNode.firstChild===n?Ve(t):function(t,e,n,r){var o=qe(e);fn(t.dom,n,r);var i=$e(o);t.selection.setRng(i)}(t,c,a,s)})),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){je(t)})),!0}return!1},gn=function(t,e){return mn(t,e)||function(t,e){var n=t.dom,r=t.selection.getStart(),o=pe(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var a=fe(t.selection.getRng()),u=n.getParent(cn(t,a,e,o),"LI",o);if(u)return t.undoManager.transact((function(){!function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)}(n,i,o),en(n,u.parentNode),t.selection.select(u,!0),t.selection.collapse(e)})),!0}return!1}(t,e)},hn=function(t,e){return t.selection.isCollapsed()?gn(t,e):function(t){var e=t.selection.getStart(),n=pe(t,e);return!!(t.dom.getParent(e,"LI,DT,DD",n)||he(t).length>0)&&(t.undoManager.transact((function(){t.execCommand("Delete"),un(t.dom,t.getBody())})),!0)}(t)},pn=function(t){var e=A(U(t).split("")),n=k(e,(function(t,e){var n=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,e)*n}));return E(n,(function(t,e){return t+e}),0)},vn=function(t){if(--t<0)return"";var e=t%26,n=Math.floor(t/26);return vn(n)+String.fromCharCode("A".charCodeAt(0)+e)},bn=function(t){var e,n,r=me(t);Xt(r)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:(e={start:t.dom.getAttrib(r,"start","1"),listStyleType:x.some(t.dom.getStyle(r,"list-style-type"))},n=parseInt(e.start,10),we(e.listStyleType,"upper-alpha")?vn(n):we(e.listStyleType,"lower-alpha")?vn(n).toLowerCase():e.start)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){(function(t){switch(function(t){return/^[0-9]+$/.test(t)?2:/^[A-Z]+$/.test(t)?0:function(t){return/^[a-z]+$/.test(t)}(t)?1:t.length>0?4:3}(t)){case 2:return x.some({listStyleType:x.none(),start:t});case 0:return x.some({listStyleType:x.some("upper-alpha"),start:pn(t).toString()});case 1:return x.some({listStyleType:x.some("lower-alpha"),start:pn(t).toString()});case 3:return x.some({listStyleType:x.none(),start:""});case 4:return x.none()}})(e.getData().start).each((function(e){t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===e.start?"":e.start},styles:{"list-style-type":e.listStyleType.getOr("")}})})),e.close()}})},yn=function(t,e){return function(){var n=me(t);return n&&n.nodeName===e}},wn=function(t){t.addCommand("mceListProps",(function(){bn(t)}))},xn=function(t){t.on("BeforeExecCommand",(function(e){var n=e.command.toLowerCase();"indent"===n?Fe(t):"outdent"===n&&Ve(t)})),t.addCommand("InsertUnorderedList",(function(e,n){on(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){on(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){on(t,"DL",n)})),t.addCommand("RemoveList",(function(){je(t)})),wn(t),t.addCommand("mceListUpdate",(function(e,n){a(n)&&function(t,e){var n=me(t);t.undoManager.transact((function(){a(e.styles)&&t.dom.setStyles(n,e.styles),a(e.attrs)&&St(e.attrs,(function(e,r){return t.dom.setAttrib(n,r,e)}))}))}(t,n)})),t.addQueryStateHandler("InsertUnorderedList",yn(t,"UL")),t.addQueryStateHandler("InsertOrderedList",yn(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",yn(t,"DL"))},Cn=function(t){(function(t){return t.getParam("lists_indent_on_tab",!0)})(t)&&function(t){t.on("keydown",(function(e){e.keyCode!==xt.TAB||xt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?Ve(t):Fe(t))&&e.preventDefault()}))}))}(t),function(t){t.on("keydown",(function(e){e.keyCode===xt.BACKSPACE?hn(t,!1)&&e.preventDefault():e.keyCode===xt.DELETE&&hn(t,!0)&&e.preventDefault()}))}(t)};n.add("lists",(function(t){return!1===t.hasPlugin("rtc",!0)?(Cn(t),xn(t)):wn(t),function(t){var e=function(e){return function(){return t.execCommand(e)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return Xe(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return Xe(t,"UL",e.setActive)}}))}(t),function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return t.execCommand("mceListProps")},onSetup:function(e){return Xe(t,"OL",(function(t){return e.setDisabled(!t)}))}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=me(t,e);return Xt(n)?["listprops"]:[]}})}(t),function(t){return{backspaceDelete:function(e){hn(t,e)}}}(t)}))}()},2540:(t,e,n)=>{n(3167)},3167:()=>{!function(){"use strict";var t,e,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},i=o("string"),a=o("object"),u=o("array"),c=function(t){return!function(t){return null==t}(t)},s=function(){},l=function(t){return function(){return t}},f=function(t){return t},d=l(!1),m=l(!0),g=function(){return h},h={fold:function(t,e){return t()},isSome:d,isNone:m,getOr:e=f,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:e,orThunk:t,map:g,each:s,bind:g,exists:d,forall:m,filter:function(){return g()},toArray:function(){return[]},toString:l("none()")},p=function(t){var e=l(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:m,isNone:d,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return p(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:h},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},v={some:p,none:g,from:function(t){return null==t?h:p(t)}},b=Array.prototype.push,y=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},w=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!u(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);b.apply(e,t[n])}return e},x=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},C=Object.keys,S=Object.hasOwnProperty,k=function(t,e){return T(t,e)?v.from(t[e]):v.none()},T=function(t,e){return S.call(t,e)},O=function(t){return t.getParam("media_scripts")},E=function(t){return t.getParam("media_live_embeds",!0)},_=tinymce.util.Tools.resolve("tinymce.util.Tools"),R=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),N=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),A=function(t,e){if(t)for(var n=0;n<t.length;n++)if(-1!==e.indexOf(t[n].filter))return t[n]},D=R.DOM,M=function(t){return t.replace(/px$/,"")},B=function(t,e){var n=x(!1),r={};return N({validate:!1,allow_conditional_comments:!0,start:function(e,o){if(n.get());else if(T(o.map,"data-ephox-embed-iri"))n.set(!0),r=function(t){var e=t.map.style,n=e?D.parseStyle(e):{};return{type:"ephox-embed-iri",source:t.map["data-ephox-embed-iri"],altsource:"",poster:"",width:k(n,"max-width").map(M).getOr(""),height:k(n,"max-height").map(M).getOr("")}}(o);else{if(r.source||"param"!==e||(r.source=o.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=_.extend(o.map,r)),"script"===e){var i=A(t,o.map.src);if(!i)return;r={type:"script",source:o.map.src,width:String(i.width),height:String(i.height)}}"source"===e&&(r.source?r.altsource||(r.altsource=o.map.src):r.source=o.map.src),"img"!==e||r.poster||(r.poster=o.map.src)}}}).parse(e),r.source=r.source||r.src||r.data,r.altsource=r.altsource||"",r.poster=r.poster||"",r},z=function(t){var e={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[t.toLowerCase().split(".").pop()];return e||""},P=tinymce.util.Tools.resolve("tinymce.html.Schema"),L=tinymce.util.Tools.resolve("tinymce.html.Writer"),I=R.DOM,H=function(t){return/^[0-9.]+$/.test(t)?t+"px":t},F=function(t,e){!function(t,e){for(var n=C(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(e,(function(e,n){var r=""+e;if(t.map[n])for(var o=t.length;o--;){var i=t[o];i.name===n&&(r?(t.map[n]=r,i.value=r):(delete t.map[n],t.splice(o,1)))}else r&&(t.push({name:n,value:r}),t.map[n]=r)}))},V=["source","altsource"],j=function(t,e,n){var r,o=L(),i=x(!1),a=0;return N({validate:!1,allow_conditional_comments:!0,comment:function(t){o.comment(t)},cdata:function(t){o.cdata(t)},text:function(t,e){o.text(t,e)},start:function(t,u,c){if(i.get());else if(T(u.map,"data-ephox-embed-iri"))i.set(!0),function(t,e){var n=e.map.style,r=n?I.parseStyle(n):{};r["max-width"]=H(t.width),r["max-height"]=H(t.height),F(e,{style:I.serializeStyle(r)})}(e,u);else{switch(t){case"video":case"object":case"embed":case"img":case"iframe":void 0!==e.height&&void 0!==e.width&&F(u,{width:e.width,height:e.height})}if(n)switch(t){case"video":F(u,{poster:e.poster,src:""}),e.altsource&&F(u,{src:""});break;case"iframe":F(u,{src:e.source});break;case"source":if(a<2&&(F(u,{src:e[V[a]],type:e[V[a]+"mime"]}),!e[V[a]]))return;a++;break;case"img":if(!e.poster)return;r=!0}}o.start(t,u,c)},end:function(t){if(!i.get()){if("video"===t&&n)for(var u=0;u<2;u++)if(e[V[u]]){var c=[];c.map={},a<=u&&(F(c,{src:e[V[u]],type:e[V[u]+"mime"]}),o.start("source",c,!0))}if(e.poster&&"object"===t&&n&&!r){var s=[];s.map={},F(s,{src:e.poster,width:e.width,height:e.height}),o.start("img",s,!0)}}o.end(t)}},P({})).parse(t),o.getContent()},U=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&amp;byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],W=function(t,e){for(var n=function(t){var e=t.match(/^(https?:\/\/|www\.)(.+)$/i);return e&&e.length>1?"www."===e[1]?"https://":e[1]:"https://"}(e),r=t.regex.exec(e),o=n+t.url,i=function(t){o=o.replace("$"+t,(function(){return r[t]?r[t]:""}))},a=0;a<r.length;a++)i(a);return o.replace(/\?$/,"")},q=function(t,e){var n=_.extend({},e);if(!n.source&&(_.extend(n,B(O(t),n.embed)),!n.source))return"";n.altsource||(n.altsource=""),n.poster||(n.poster=""),n.source=t.convertURL(n.source,"source"),n.altsource=t.convertURL(n.altsource,"source"),n.sourcemime=z(n.source),n.altsourcemime=z(n.altsource),n.poster=t.convertURL(n.poster,"poster");var r,o,i=(r=n.source,(o=U.filter((function(t){return t.regex.test(r)}))).length>0?_.extend({},o[0],{url:W(o[0],r)}):null);if(i&&(n.source=i.url,n.type=i.type,n.allowfullscreen=i.allowFullscreen,n.width=n.width||String(i.w),n.height=n.height||String(i.h)),n.embed)return j(n.embed,n,!0);var a=A(O(t),n.source);a&&(n.type="script",n.width=String(a.width),n.height=String(a.height));var u=function(t){return t.getParam("audio_template_callback")}(t),c=function(t){return t.getParam("video_template_callback")}(t);return n.width=n.width||"300",n.height=n.height||"150",_.each(n,(function(e,r){n[r]=t.dom.encode(""+e)})),"iframe"===n.type?function(t){var e=t.allowfullscreen?' allowFullscreen="1"':"";return'<iframe src="'+t.source+'" width="'+t.width+'" height="'+t.height+'"'+e+"></iframe>"}(n):"application/x-shockwave-flash"===n.sourcemime?function(t){var e='<object data="'+t.source+'" width="'+t.width+'" height="'+t.height+'" type="application/x-shockwave-flash">';return t.poster&&(e+='<img src="'+t.poster+'" width="'+t.width+'" height="'+t.height+'" />'),e+"</object>"}(n):-1!==n.sourcemime.indexOf("audio")?function(t,e){return e?e(t):'<audio controls="controls" src="'+t.source+'">'+(t.altsource?'\n<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</audio>"}(n,u):"script"===n.type?function(t){return'<script src="'+t.source+'"><\/script>'}(n):function(t,e){return e?e(t):'<video width="'+t.width+'" height="'+t.height+'"'+(t.poster?' poster="'+t.poster+'"':"")+' controls="controls">\n<source src="'+t.source+'"'+(t.sourcemime?' type="'+t.sourcemime+'"':"")+" />\n"+(t.altsource?'<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</video>"}(n,c)},$=function(t){return t.hasAttribute("data-mce-object")||t.hasAttribute("data-ephox-embed-iri")},G=tinymce.util.Tools.resolve("tinymce.util.Promise"),K={},X=function(t){return function(e){return q(t,e)}},Y=function(t,e){var n=function(t){return t.getParam("media_url_resolver")}(t);return n?function(t,e,n){return new G((function(r,o){var i=function(n){return n.html&&(K[t.source]=n),r({url:t.source,html:n.html?n.html:e(t)})};K[t.source]?i(K[t.source]):n({url:t.source},i,o)}))}(e,X(t),n):function(t,e){return G.resolve({html:e(t),url:t.source})}(e,X(t))},J=function(t,e){var n=e?function(t,e){return k(e,t).bind((function(t){return k(t,"meta")}))}(e,t).getOr({}):{},o=function(t,e,n){return function(r){var o,i=function(){return k(t,r)},u=function(){return k(e,r)},c=function(t){return k(t,"value").bind((function(t){return t.length>0?v.some(t):v.none()}))};return(o={})[r]=(r===n?i().bind((function(t){return a(t)?c(t).orThunk(u):u().orThunk((function(){return v.from(t)}))})):u().orThunk((function(){return i().bind((function(t){return a(t)?c(t):v.from(t)}))}))).getOr(""),o}}(t,n,e);return r(r(r(r(r({},o("source")),o("altsource")),o("poster")),o("embed")),function(t,e){var n={};return k(t,"dimensions").each((function(t){y(["width","height"],(function(r){k(e,r).orThunk((function(){return k(t,r)})).each((function(t){return n[r]=t}))}))})),n}(t,n))},Q=function(t){var e=r(r({},t),{source:{value:k(t,"source").getOr("")},altsource:{value:k(t,"altsource").getOr("")},poster:{value:k(t,"poster").getOr("")}});return y(["width","height"],(function(n){k(t,n).each((function(t){var r=e.dimensions||{};r[n]=t,e.dimensions=r}))})),e},Z=function(t){return function(e){var n=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";t.notificationManager.open({type:"error",text:n})}},tt=function(t,e){return B(O(t),e)},et=function(t,e){return function(n){if(i(n.url)&&n.url.trim().length>0){var o=n.html,a=tt(e,o),u=r(r({},a),{source:n.url,embed:o});t.setData(Q(u))}}},nt=function(t,e){var n=t.dom.select("*[data-mce-object]");t.insertContent(e),function(t,e){for(var n=t.dom.select("*[data-mce-object]"),r=0;r<e.length;r++)for(var o=n.length-1;o>=0;o--)e[r]===n[o]&&n.splice(o,1);t.selection.select(n[0])}(t,n),t.nodeChanged()},rt=function(t,e,n){var r;e.embed=j(e.embed,e),e.embed&&(t.source===e.source||(r=e.source,T(K,r)))?nt(n,e.embed):Y(n,e).then((function(t){nt(n,t.html)})).catch(Z(n))},ot=function(t){var e=function(t){var e=t.selection.getNode(),n=$(e)?t.serializer.serialize(e,{selection:!0}):"";return r({embed:n},B(O(t),n))}(t),n=x(e),o=Q(e),i=function(t){return t.getParam("media_dimensions",!0)}(t)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],a={title:"General",name:"general",items:w([[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],i])},u={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},c=[];(function(t){return t.getParam("media_alt_source",!0)})(t)&&c.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),function(t){return t.getParam("media_poster",!0)}(t)&&c.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var s={title:"Advanced",name:"advanced",items:c},l=[a,u];c.length>0&&l.push(s);var f={type:"tabpanel",tabs:l},d=t.windowManager.open({title:"Insert/Edit Media",size:"normal",body:f,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var r=J(e.getData());rt(n.get(),r,t),e.close()},onChange:function(e,o){switch(o.name){case"source":!function(e,n){var r=J(n.getData(),"source");e.source!==r.source&&(et(d,t)({url:r.source,html:""}),Y(t,r).then(et(d,t)).catch(Z(t)))}(n.get(),e);break;case"embed":!function(e){var n=J(e.getData()),r=tt(t,n.embed);e.setData(Q(r))}(e);break;case"dimensions":case"altsource":case"poster":!function(e,n){var o=J(e.getData(),n),i=q(t,o);e.setData(Q(r(r({},o),{embed:i})))}(e,o.name)}n.set(J(e.getData()))},initialData:o})},it=tinymce.util.Tools.resolve("tinymce.html.Node"),at=tinymce.util.Tools.resolve("tinymce.Env"),ut=tinymce.util.Tools.resolve("tinymce.html.DomParser"),ct=function(t,e){if(!1===function(t){return t.getParam("media_filter_html",!0)}(t))return e;var n,r=L();return N({validate:!1,allow_conditional_comments:!1,comment:function(t){n||r.comment(t)},cdata:function(t){n||r.cdata(t)},text:function(t,e){n||r.text(t,e)},start:function(e,o,i){if(n=!0,"script"!==e&&"noscript"!==e&&"svg"!==e){for(var a=o.length-1;a>=0;a--){var u=o[a].name;0===u.indexOf("on")&&(delete o.map[u],o.splice(a,1)),"style"===u&&(o[a].value=t.dom.serializeStyle(t.dom.parseStyle(o[a].value),e))}r.start(e,o,i),n=!1}},end:function(t){n||r.end(t)}},P({})).parse(e),r.getContent()},st=function(t){var e=t.name;return"iframe"===e||"video"===e||"audio"===e},lt=function(t,e,n,r){void 0===r&&(r=null);var o=t.attr(n);return c(o)?o:T(e,n)?null:r},ft=function(t,e,n){var r="img"===e.name||"video"===t.name,o=r?"300":null,i="audio"===t.name?"30":"150",a=r?i:null;e.attr({width:lt(t,n,"width",o),height:lt(t,n,"height",a)})},dt=function(t,e){var n=e.name,r=new it("img",1);return r.shortEnded=!0,gt(t,e,r),ft(e,r,{}),r.attr({style:e.attr("style"),src:at.transparentSrc,"data-mce-object":n,class:"mce-object mce-object-"+n}),r},mt=function(t,e){var n=e.name,r=new it("span",1);r.attr({contentEditable:"false",style:e.attr("style"),"data-mce-object":n,class:"mce-preview-object mce-object-"+n}),gt(t,e,r);var o=t.dom.parseStyle(e.attr("style")),i=new it(n,1);if(ft(e,i,o),i.attr({src:e.attr("src"),style:e.attr("style"),class:e.attr("class")}),"iframe"===n)i.attr({allowfullscreen:e.attr("allowfullscreen"),frameborder:"0"});else{y(["controls","crossorigin","currentTime","loop","muted","poster","preload"],(function(t){i.attr(t,e.attr(t))}));var a=r.attr("data-mce-html");c(a)&&function(t,e,n,r){for(var o=ut({forced_root_block:!1,validate:!1},t.schema).parse(r,{context:e});o.firstChild;)n.append(o.firstChild)}(t,n,i,unescape(a))}var u=new it("span",1);return u.attr("class","mce-shim"),r.append(i),r.append(u),r},gt=function(t,e,n){for(var r=e.attributes,o=r.length;o--;){var i=r[o].name,a=r[o].value;"width"!==i&&"height"!==i&&"style"!==i&&("data"!==i&&"src"!==i||(a=t.convertURL(a,i)),n.attr("data-mce-p-"+i,a))}var u=e.firstChild&&e.firstChild.value;u&&(n.attr("data-mce-html",escape(ct(t,u))),n.firstChild=null)},ht=function(t){var e=t.attr("class");return e&&/\btiny-pageembed\b/.test(e)},pt=function(t){for(;t=t.parent;)if(t.attr("data-ephox-embed-iri")||ht(t))return!0;return!1},vt=function(t){t.on("preInit",(function(){var e=t.schema.getSpecialElements();_.each("video audio iframe object".split(" "),(function(t){e[t]=new RegExp("</"+t+"[^>]*>","gi")}));var n=t.schema.getBoolAttrs();_.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),(function(t){n[t]={}})),t.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t){return function(e){for(var n,r,o=e.length;o--;)(n=e[o]).parent&&(n.parent.attr("data-mce-object")||("script"!==n.name||(r=A(O(t),n.attr("src"))))&&(r&&(r.width&&n.attr("width",r.width.toString()),r.height&&n.attr("height",r.height.toString())),st(n)&&E(t)&&at.ceFalse?pt(n)||n.replace(mt(t,n)):pt(n)||n.replace(dt(t,n))))}}(t)),t.serializer.addAttributeFilter("data-mce-object",(function(e,n){for(var r,o,i,a,u,c,s,l,f=e.length;f--;)if((r=e[f]).parent){for(s=r.attr(n),o=new it(s,1),"audio"!==s&&"script"!==s&&((l=r.attr("class"))&&-1!==l.indexOf("mce-preview-object")?o.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):o.attr({width:r.attr("width"),height:r.attr("height")})),o.attr({style:r.attr("style")}),i=(a=r.attributes).length;i--;){var d=a[i].name;0===d.indexOf("data-mce-p-")&&o.attr(d.substr(11),a[i].value)}"script"===s&&o.attr("type","text/javascript"),(u=r.attr("data-mce-html"))&&((c=new it("#text",3)).raw=!0,c.value=ct(t,unescape(u)),o.append(c)),r.replace(o)}}))})),t.on("SetContent",(function(){t.$("span.mce-preview-object").each((function(e,n){var r=t.$(n);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')}))}))};n.add("media",(function(t){return function(t){t.addCommand("mceMedia",(function(){ot(t)}))}(t),function(t){var e=function(){return t.execCommand("mceMedia")};t.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:e,onSetup:function(e){var n=t.selection;return e.setActive($(n.getNode())),n.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",e.setActive).unbind}}),t.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:e})}(t),function(t){t.on("ResolveName",(function(t){var e;1===t.target.nodeType&&(e=t.target.getAttribute("data-mce-object"))&&(t.name=e)}))}(t),vt(t),function(t){t.on("click keyup touchend",(function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")})),t.on("ObjectSelected",(function(t){"script"===t.target.getAttribute("data-mce-object")&&t.preventDefault()})),t.on("ObjectResized",(function(t){var e=t.target;if(e.getAttribute("data-mce-object")){var n=e.getAttribute("data-mce-html");n&&(n=unescape(n),e.setAttribute("data-mce-html",escape(j(n,{width:String(t.width),height:String(t.height)}))))}}))}(t),function(t){return{showDialog:function(){ot(t)}}}(t)}))}()},5031:(t,e,n)=>{n(7814)},7814:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},r=function(t){return function(e){return-1!==(" "+e.attr("class")+" ").indexOf(t)}},o=function(t,e,n){return function(r){var o=arguments,i=o[o.length-2],a=i>0?e.charAt(i-1):"";if('"'===a)return r;if(">"===a){var u=e.lastIndexOf("<",i);if(-1!==u){var c=e.substring(u,i);if(-1!==c.indexOf('contenteditable="false"'))return r}}return'<span class="'+n+'" data-mce-content="'+t.dom.encode(o[0])+'">'+t.dom.encode("string"==typeof o[1]?o[1]:o[0])+"</span>"}},i=function(t){var i="contenteditable",a=" "+e.trim(function(t){return t.getParam("noneditable_editable_class","mceEditable")}(t))+" ",u=" "+e.trim(n(t))+" ",c=r(a),s=r(u),l=function(t){var e=t.getParam("noneditable_regexp",[]);return e&&e.constructor===RegExp?[e]:e}(t);t.on("PreInit",(function(){l.length>0&&t.on("BeforeSetContent",(function(e){!function(t,e,r){var i=e.length,a=r.content;if("raw"!==r.format){for(;i--;)a=a.replace(e[i],o(t,a,n(t)));r.content=a}}(t,l,e)})),t.parser.addAttributeFilter("class",(function(t){for(var e,n=t.length;n--;)e=t[n],c(e)?e.attr(i,"true"):s(e)&&e.attr(i,"false")})),t.serializer.addAttributeFilter(i,(function(t){for(var e,n=t.length;n--;)e=t[n],(c(e)||s(e))&&(l.length>0&&e.attr("data-mce-content")?(e.name="#text",e.type=3,e.raw=!0,e.value=e.attr("data-mce-content")):e.attr(i,null))}))}))};t.add("noneditable",(function(t){i(t)}))}()},1295:(t,e,n)=>{n(6834)},6834:()=>{!function(){"use strict";var t,e,n=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},a=function(t){return function(e){return typeof e===t}},u=i("string"),c=i("array"),s=a("boolean"),l=a("number"),f=function(){},d=function(t){return function(){return t}},m=function(t){return t},g=d(!1),h=d(!0),p=d("[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]"),v=function(){return b},b={fold:function(t,e){return t()},isSome:g,isNone:h,getOr:e=m,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:e,orThunk:t,map:v,each:f,bind:v,exists:g,forall:h,filter:function(){return v()},toArray:function(){return[]},toString:d("none()")},y=function(t){var e=d(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:h,isNone:g,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return y(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:b},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},w={some:y,none:v,from:function(t){return null==t?b:y(t)}},x=p,C=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=Array.prototype.slice,k=Array.prototype.push,T=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},O=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},E=function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}},_=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);k.apply(e,t[n])}return e}(T(t,e))},R=Object.hasOwnProperty,N=function(t,e){return R.call(t,e)};"undefined"!=typeof window?window:Function("return this;")();var A,D,M,B,z=(A=3,function(t){return function(t){return t.dom.nodeType}(t)===A}),P=function(t,e,n){!function(t,e,n){if(!(u(n)||s(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},L=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},I={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return L(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return L(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return L(n)},fromDom:L,fromPoint:function(t,e,n){return w.from(t.dom.elementFromPoint(e,n)).map(L)}},H=function(t,e){return{element:t,offset:e}},F=function(t,e){var n=function(t){return T(t.dom.childNodes,I.fromDom)}(t);return n.length>0&&e<n.length?H(n[e],0):H(t,e)},V=function(t,e){(function(t){return w.from(t.dom.parentNode).map(I.fromDom)})(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},j=function(t,e){V(t,e),function(t,e){t.dom.appendChild(e.dom)}(e,t)},U=(D=z,M="text",{get:function(t){if(!D(t))throw new Error("Can only get "+M+" value of a "+M+" node");return B(t).getOr("")},getOption:B=function(t){return D(t)?w.from(t.dom.nodeValue):w.none()},set:function(t,e){if(!D(t))throw new Error("Can only set raw "+M+" value of a "+M+" node");t.dom.nodeValue=e}}),W=function(t){return U.get(t)},q=function(t,e){return function(t,e){var n,r=void 0===e?document:e.dom;return 1!==(n=r).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:T(r.querySelectorAll(t),I.fromDom)}(e,t)},$=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),G=function(t,e){return t.isBlock(e)||N(t.schema.getShortEndedElements(),e.nodeName)},K=function(t,e){return"false"===t.getContentEditable(e)},X=function(t,e){return!t.isBlock(e)&&N(t.schema.getWhiteSpaceElements(),e.nodeName)},Y=function(t,e){return F(I.fromDom(t),e)},J=function(t,e,n,r,o,i){void 0===i&&(i=!0);for(var a=i?e(!1):n;a;){var u=K(t,a);if(u||X(t,a)){if(u?r.cef(a):r.boundary(a))break;a=e(!0)}else{if(G(t,a)){if(r.boundary(a))break}else 3===a.nodeType&&r.text(a);if(a===o)break;a=e(!1)}}},Q=function(t,e,n,r,o){if(!function(t,e){return G(t,e)||K(t,e)||X(t,e)||function(t,e){return"true"===t.getContentEditable(e)&&"false"===t.getContentEditableParent(e.parentNode)}(t,e)}(t,n)){var i=t.getParent(r,t.isBlock),a=new $(n,i),u=o?a.next.bind(a):a.prev.bind(a);J(t,u,n,{boundary:h,cef:h,text:function(t){o?e.fOffset+=t.length:e.sOffset+=t.length,e.elements.push(I.fromDom(t))}})}},Z=function(t,e,n,r,o,i){void 0===i&&(i=!0);var a=new $(n,e),u=[],c={sOffset:0,fOffset:0,elements:[]};Q(t,c,n,e,!1);var s=function(){return c.elements.length>0&&(u.push(c),c={sOffset:0,fOffset:0,elements:[]}),!1};return J(t,a.next.bind(a),n,{boundary:s,cef:function(t){return s(),o&&u.push.apply(u,o.cef(t)),!1},text:function(t){c.elements.push(I.fromDom(t)),o&&o.text(t,c)}},r,i),r&&Q(t,c,r,e,!0),s(),u},tt=function(t,e){var n=Y(e.startContainer,e.startOffset),r=n.element.dom,o=Y(e.endContainer,e.endOffset),i=o.element.dom;return Z(t,e.commonAncestorContainer,r,i,{text:function(t,e){t===i?e.fOffset+=t.length-o.offset:t===r&&(e.sOffset+=n.offset)},cef:function(e){var n,r,o,i=_(q(I.fromDom(e),"*[contenteditable=true]"),(function(e){var n=e.dom;return Z(t,n,n)}));return n=i,r=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_PRECEDING)}(t.elements[0].dom,e.elements[0].dom)?1:-1},(o=S.call(n,0)).sort(r),o}},!1)},et=function(t,e){return e.collapsed?[]:tt(t,e)},nt=function(t,e){var n=t.createRng();return n.selectNode(e),et(t,n)},rt=function(t,e){var n,r,o;return function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,a=t.length;i<a;i++){var u=t[i],c=e(u);c!==n&&(r.push(o),o=[]),n=c,o.push(u)}return 0!==o.length&&r.push(o),r}((n=t,r=function(t,n){var r=W(n),o=t.last,i=o+r.length,a=_(e,(function(t,e){return t.start<i&&t.finish>o?[{element:n,start:Math.max(o,t.start)-o,finish:Math.min(i,t.finish)-o,matchId:e}]:[]}));return{results:t.results.concat(a),last:i}},o={results:[],last:0},O(n,(function(t,e){o=r(o,t,e)})),o).results,(function(t){return t.matchId}))},ot=function(t,e){return _(e,(function(e){var n=e.elements,r=T(n,W).join(""),o=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=e.regex;o.lastIndex=n;for(var i,a=[];i=o.exec(t);){var u=i[e.matchIndex],c=i.index+i[0].indexOf(u),s=c+u.length;if(s>r)break;a.push({start:c,finish:s}),o.lastIndex=s}return a}(r,t,e.sOffset,r.length-e.fOffset);return rt(n,o)}))},it=function(t,e){E(t,(function(t,n){E(t,(function(t){var r=I.fromDom(e.cloneNode(!1));P(r,"data-mce-index",n);var o=t.element.dom;if(o.length===t.finish&&0===t.start)j(t.element,r);else{o.length!==t.finish&&o.splitText(t.finish);var i=o.splitText(t.start);j(I.fromDom(i),r)}}))}))},at=function(t,e,n,r){var o=n.getBookmark(),i=t.select("td[data-mce-selected],th[data-mce-selected]"),a=i.length>0?function(t,e){return _(e,(function(e){return nt(t,e)}))}(t,i):et(t,n.getRng()),u=ot(e,a);return it(u,r),n.moveToBookmark(o),u.length},ut=function(t){var e=t.getAttribute("data-mce-index");return"number"==typeof e?""+e:e},ct=function(t,e,n,r){var o=t.dom.create("span",{"data-mce-bogus":1});o.className="mce-match-marker";var i=t.getBody();return bt(t,e,!1),r?at(t.dom,n,t.selection,o):function(t,e,n,r){var o=nt(t,n),i=ot(e,o);return it(i,r),i.length}(t.dom,n,i,o)},st=function(t){var e=t.parentNode;t.firstChild&&e.insertBefore(t.firstChild,t),t.parentNode.removeChild(t)},lt=function(t,e){var n=[],r=C.toArray(t.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var i=ut(r[o]);null!==i&&i.length&&(i===e.toString()&&n.push(r[o]))}return n},ft=function(t,e,n){var r=e.get(),o=r.index,i=t.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,i.removeClass(lt(t,r.index),"mce-match-marker-selected");var a=lt(t,o);return a.length?(i.addClass(lt(t,o),"mce-match-marker-selected"),t.selection.scrollIntoView(a[0]),o):-1},dt=function(t,e){var n=e.parentNode;t.remove(e),t.isEmpty(n)&&t.remove(n)},mt=function(t,e,n,r,o,i){var a=function(t,e){var n="("+t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return e?"(?:^|\\s|"+x()+")"+n+"(?=$|\\s|"+x()+")":n}(n,o),u={regex:new RegExp(a,r?"g":"gi"),matchIndex:1},c=ct(t,e,u,i);if(c){var s=ft(t,e,!0);e.set({index:s,count:c,text:n,matchCase:r,wholeWord:o,inSelection:i})}return c},gt=function(t,e){var n=ft(t,e,!0);e.set(o(o({},e.get()),{index:n}))},ht=function(t,e){var n=ft(t,e,!1);e.set(o(o({},e.get()),{index:n}))},pt=function(t){var e=ut(t);return null!==e&&e.length>0},vt=function(t,e,n,r,i){var a,u=e.get(),c=u.index,s=c;r=!1!==r;for(var l=t.getBody(),f=C.grep(C.toArray(l.getElementsByTagName("span")),pt),d=0;d<f.length;d++){var m=ut(f[d]),g=a=parseInt(m,10);if(i||g===u.index){for(n.length?(f[d].firstChild.nodeValue=n,st(f[d])):dt(t.dom,f[d]);f[++d];){if((g=parseInt(ut(f[d]),10))!==a){d--;break}dt(t.dom,f[d])}r&&s--}else a>c&&f[d].setAttribute("data-mce-index",String(a-1))}return e.set(o(o({},u),{count:i?0:u.count-1,index:s})),r?gt(t,e):ht(t,e),!i&&e.get().count>0},bt=function(t,e,n){for(var r,i,a=e.get(),u=C.toArray(t.getBody().getElementsByTagName("span")),c=0;c<u.length;c++){var s=ut(u[c]);null!==s&&s.length&&(s===a.index.toString()&&(r||(r=u[c].firstChild),i=u[c].firstChild),st(u[c]))}if(e.set(o(o({},a),{index:-1,count:0,text:""})),r&&i){var l=t.dom.createRng();return l.setStart(r,0),l.setEnd(i,i.data.length),!1!==n&&t.selection.setRng(l),l}},yt=function(){var t=function(t){var e=n(w.none()),r=function(){return e.get().each(t)};return{clear:function(){r(),e.set(w.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){r(),e.set(w.some(t))}}}(f);return o(o({},t),{on:function(e){return t.get().each(e)}})},wt=tinymce.util.Tools.resolve("tinymce.Env"),xt=function(t,e){var n=yt();t.undoManager.add();var r=C.trim(t.selection.getContent({format:"text"})),i=function(t){(function(t,e){return e.get().count>1}(0,e)?t.enable:t.disable)("next"),(function(t,e){return e.get().count>1}(0,e)?t.enable:t.disable)("prev")},a=function(t,e){var n=e?t.disable:t.enable;O(["replace","replaceall","prev","next"],n)},u=function(t,e){wt.browser.isSafari()&&wt.deviceType.isTouch()&&("find"===e||"replace"===e||"replaceall"===e)&&t.focus(e)},c=function(n){bt(t,e,!1),a(n,!0),i(n)},s=function(n){var r=n.getData(),o=e.get();if(r.findtext.length){if(o.text===r.findtext&&o.matchCase===r.matchcase&&o.wholeWord===r.wholewords)gt(t,e);else{var u=mt(t,e,r.findtext,r.matchcase,r.wholewords,r.inselection);u<=0&&function(e){t.windowManager.alert("Could not find the specified string.",(function(){e.focus("findtext")}))}(n),a(n,0===u)}i(n)}else c(n)},l=e.get(),f={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace all",disabled:!0}],initialData:{findtext:r,replacetext:"",wholewords:l.wholeWord,matchcase:l.matchCase,inselection:l.inSelection},onChange:function(t,n){"findtext"===n.name&&e.get().count>0&&c(t)},onAction:function(n,r){var a=n.getData();switch(r.name){case"find":s(n);break;case"replace":vt(t,e,a.replacetext)?i(n):c(n);break;case"replaceall":vt(t,e,a.replacetext,!0,!0),c(n);break;case"prev":ht(t,e),i(n);break;case"next":gt(t,e),i(n);break;case"matchcase":case"wholewords":case"inselection":!function(t){var n=t.getData(),r=e.get();e.set(o(o({},r),{matchCase:n.matchcase,wholeWord:n.wholewords,inSelection:n.inselection}))}(n),c(n)}u(n,r.name)},onSubmit:function(t){s(t),u(t,"find")},onClose:function(){t.focus(),bt(t,e),t.undoManager.add()}};n.set(t.windowManager.open(f,{inline:"toolbar"}))},Ct=function(t,e){return function(){xt(t,e)}};r.add("searchreplace",(function(t){var e=n({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return function(t,e){t.addCommand("SearchReplace",(function(){xt(t,e)}))}(t,e),function(t,e){t.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:Ct(t,e),icon:"search"}),t.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:Ct(t,e),icon:"search"}),t.shortcuts.add("Meta+F","",Ct(t,e))}(t,e),function(t,e){return{done:function(n){return bt(t,e,n)},find:function(n,r,o,i){return void 0===i&&(i=!1),mt(t,e,n,r,o,i)},next:function(){return gt(t,e)},prev:function(){return ht(t,e)},replace:function(n,r,o){return vt(t,e,n,r,o)}}}(t,e)}))}()},8619:(t,e,n)=>{n(2590)},2590:()=>{!function(){"use strict";var t=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},e=function(t){return function(e){return typeof e===t}},n=function(t){return function(e){return t===e}},r=t("string"),o=t("object"),i=t("array"),a=n(null),u=e("boolean"),c=n(void 0),s=function(t){return!function(t){return null==t}(t)},l=e("function"),f=e("number"),d=function(){},m=function(t){return function(){return t}},g=function(t){return t},h=function(t,e){return t===e};function p(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var v,b,y=function(t){return function(e){return!t(e)}},w=m(!1),x=m(!0),C=function(){return S},S={fold:function(t,e){return t()},isSome:w,isNone:x,getOr:b=g,getOrThunk:v=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(void 0),or:b,orThunk:v,map:C,each:d,bind:C,exists:w,forall:x,filter:function(){return C()},toArray:function(){return[]},toString:m("none()")},k=function(t){var e=m(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:x,isNone:w,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return k(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:S},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},T={some:k,none:C,from:function(t){return null==t?S:k(t)}},O=Array.prototype.slice,E=Array.prototype.indexOf,_=Array.prototype.push,R=function(t,e){return n=t,r=e,E.call(n,r)>-1;var n,r},N=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},A=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},D=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},M=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},B=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var a=t[o];(e(a,o)?n:r).push(a)}return{pass:n,fail:r}},z=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},P=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,(function(t,r){n=e(n,t,r)})),n},L=function(t,e,n){return M(t,(function(t,r){n=e(n,t,r)})),n},I=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return T.some(i);if(n(i,r))break}return T.none()}(t,e,w)},H=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return T.some(n)}return T.none()},F=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!i(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);_.apply(e,t[n])}return e},V=function(t,e){return F(D(t,e))},j=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},U=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},W=function(t){return[t]},q=function(t,e){return e>=0&&e<t.length?T.some(t[e]):T.none()},$=function(t){return q(t,0)},G=function(t){return q(t,t.length-1)},K=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return T.none()},X=function(){return(X=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Y(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var J=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Q=function(){return Z(0,0)},Z=function(t,e){return{major:t,minor:e}},tt={nu:Z,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Q():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Z(r(1),r(2))}(t,n)},unknown:Q},et=function(t,e){var n=String(e).toLowerCase();return I(t,(function(t){return t.search(n)}))},nt=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},rt=function(t,e){return-1!==t.indexOf(e)},ot=function(t,e){return nt(t,e,0)},it=function(t,e){return nt(t,e,t.length-e.length)},at=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),ut=function(t){return t.length>0},ct=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,st=function(t){return function(e){return rt(e,t)}},lt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return rt(t,"edge/")&&rt(t,"chrome")&&rt(t,"safari")&&rt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ct],search:function(t){return rt(t,"chrome")&&!rt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return rt(t,"msie")||rt(t,"trident")}},{name:"Opera",versionRegexes:[ct,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:st("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:st("firefox")},{name:"Safari",versionRegexes:[ct,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(rt(t,"safari")||rt(t,"mobile/"))&&rt(t,"applewebkit")}}],ft=[{name:"Windows",search:st("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return rt(t,"iphone")||rt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:st("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:st("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:st("linux"),versionRegexes:[]},{name:"Solaris",search:st("sunos"),versionRegexes:[]},{name:"FreeBSD",search:st("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:st("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],dt={browsers:m(lt),oses:m(ft)},mt="Edge",gt="Chrome",ht="Opera",pt="Firefox",vt="Safari",bt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(mt),isChrome:r(gt),isIE:r("IE"),isOpera:r(ht),isFirefox:r(pt),isSafari:r(vt)}},yt={unknown:function(){return bt({current:void 0,version:tt.unknown()})},nu:bt,edge:m(mt),chrome:m(gt),ie:m("IE"),opera:m(ht),firefox:m(pt),safari:m(vt)},wt="Windows",xt="Android",Ct="Linux",St="Solaris",kt="FreeBSD",Tt="ChromeOS",Ot=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(wt),isiOS:r("iOS"),isAndroid:r(xt),isOSX:r("OSX"),isLinux:r(Ct),isSolaris:r(St),isFreeBSD:r(kt),isChromeOS:r(Tt)}},Et={unknown:function(){return Ot({current:void 0,version:tt.unknown()})},nu:Ot,windows:m(wt),ios:m("iOS"),android:m(xt),linux:m(Ct),osx:m("OSX"),solaris:m(St),freebsd:m(kt),chromeos:m(Tt)},_t=function(t,e,n){var r=dt.browsers(),o=dt.oses(),i=e.bind((function(t){return function(t,e){return K(e.brands,(function(e){var n=e.brand.toLowerCase();return I(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:tt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return et(t,e).map((function(t){var n=tt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(yt.unknown,yt.nu),a=function(t,e){return et(t,e).map((function(t){var n=tt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(Et.unknown,Et.nu),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:m(o),isiPhone:m(i),isTablet:m(c),isPhone:m(s),isTouch:m(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:m(l),isDesktop:m(f)}}(a,i,t,n);return{browser:i,os:a,deviceType:u}},Rt=function(t){return window.matchMedia(t).matches},Nt=J((function(){return _t(navigator.userAgent,T.from(navigator.userAgentData),Rt)})),At=function(){return Nt()},Dt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Mt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Dt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Dt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Dt(n)},fromDom:Dt,fromPoint:function(t,e,n){return T.from(t.dom.elementFromPoint(e,n)).map(Dt)}},Bt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},zt=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Pt=function(t,e){var n=void 0===e?document:e.dom;return zt(n)?T.none():T.from(n.querySelector(t)).map(Mt.fromDom)},Lt=function(t,e){return t.dom===e.dom},It=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},Ht=function(t,e){return At().browser.isIE()?It(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Ft=Bt,Vt=Object.keys,jt=Object.hasOwnProperty,Ut=function(t,e){for(var n=Vt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Wt=function(t,e){return qt(t,(function(t,n){return{k:n,v:e(t,n)}}))},qt=function(t,e){var n={};return Ut(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},$t=function(t,e){var n={};return function(t,e,n,r){Ut(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),d),n},Gt=function(t,e){var n=[];return Ut(t,(function(t,r){n.push(e(t,r))})),n},Kt=function(t){return Gt(t,g)},Xt=function(t){return Vt(t).length},Yt=function(t,e){return Jt(t,e)?T.from(t[e]):T.none()},Jt=function(t,e){return jt.call(t,e)},Qt=function(t,e){return Jt(t,e)&&void 0!==t[e]&&null!==t[e]},Zt=["tfoot","thead","tbody","colgroup"],te=function(t,e,n){return{element:t,rowspan:e,colspan:n}},ee=function(t,e,n){return{element:t,cells:e,section:n}},ne=function(t,e,n){return{element:t,isNew:e,isLocked:n}},re=function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}};"undefined"!=typeof window?window:Function("return this;")();var oe=function(t){return t.dom.nodeName.toLowerCase()},ie=function(t){return t.dom.nodeType},ae=function(t){return function(e){return ie(e)===t}},ue=function(t){return 8===ie(t)||"#comment"===oe(t)},ce=ae(1),se=ae(3),le=ae(9),fe=ae(11),de=function(t){return function(e){return ce(e)&&oe(e)===t}},me=function(t){return Mt.fromDom(t.dom.ownerDocument)},ge=function(t){return le(t)?t:me(t)},he=function(t){return T.from(t.dom.parentNode).map(Mt.fromDom)},pe=function(t,e){for(var n=l(e)?e:w,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=Mt.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o},ve=function(t){return T.from(t.dom.previousSibling).map(Mt.fromDom)},be=function(t){return T.from(t.dom.nextSibling).map(Mt.fromDom)},ye=function(t){return D(t.dom.childNodes,Mt.fromDom)},we=function(t,e){var n=t.dom.childNodes;return T.from(n[e]).map(Mt.fromDom)},xe=l(Element.prototype.attachShadow)&&l(Node.prototype.getRootNode),Ce=m(xe),Se=xe?function(t){return Mt.fromDom(t.dom.getRootNode())}:ge,ke=function(t){var e,n=Se(t);return fe(e=n)&&s(e.dom.host)?T.some(n):T.none()},Te=function(t){return Mt.fromDom(t.dom.host)},Oe=function(t){return s(t.dom.shadowRoot)},Ee=function(t){var e=se(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return ke(Mt.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=Ee,r=Te,function(t){return n(r(t))}))},_e=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return Mt.fromDom(e)},Re=function(t,e){var n=[];return M(ye(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(Re(t,e))})),n},Ne=function(t,e,n){return function(t,e,n){return z(pe(t,n),e)}(t,(function(t){return Bt(t,e)}),n)},Ae=function(t,e){return function(t,e){return z(ye(t),e)}(t,(function(t){return Bt(t,e)}))},De=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return zt(n)?[]:D(n.querySelectorAll(t),Mt.fromDom)}(e,t)};function Me(t,e,n,r,o){return t(n,r)?T.some(n):l(o)&&o(n)?T.none():e(n,r,o)}var Be=function(t,e,n){for(var r=t.dom,o=l(n)?n:w;r.parentNode;){r=r.parentNode;var i=Mt.fromDom(r);if(e(i))return T.some(i);if(o(i))break}return T.none()},ze=function(t,e,n){return Be(t,(function(t){return Bt(t,e)}),n)},Pe=function(t,e){return function(t,e){return I(t.dom.childNodes,(function(t){return e(Mt.fromDom(t))})).map(Mt.fromDom)}(t,(function(t){return Bt(t,e)}))},Le=function(t,e){return Pt(e,t)},Ie=function(t,e,n){return Me((function(t,e){return Bt(t,e)}),ze,t,e,n)},He=function(t,e,n){if(!(r(n)||u(n)||f(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Fe=function(t,e,n){He(t.dom,e,n)},Ve=function(t,e){var n=t.dom;Ut(e,(function(t,e){He(n,e,t)}))},je=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Ue=function(t,e){return T.from(je(t,e))},We=function(t,e){t.dom.removeAttribute(e)},qe=function(t){return L(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},$e=function(t,e,n){return void 0===n&&(n=h),t.exists((function(t){return n(t,e)}))},Ge=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},Ke=function(t,e,n){return t.isSome()&&e.isSome()?T.some(n(t.getOrDie(),e.getOrDie())):T.none()},Xe=function(t,e){return t?T.some(e):T.none()},Ye=function(t){return void 0!==t.style&&l(t.style.getPropertyValue)},Je=function(t,e,n){if(!r(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Ye(t)&&t.style.setProperty(e,n)},Qe=function(t,e,n){var r=t.dom;Je(r,e,n)},Ze=function(t,e){var n=t.dom;Ut(e,(function(t,e){Je(n,e,t)}))},tn=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Ee(t)?r:en(n,e)},en=function(t,e){return Ye(t)?t.style.getPropertyValue(e):""},nn=function(t,e){var n=t.dom,r=en(n,e);return T.from(r).filter((function(t){return t.length>0}))},rn=function(t,e){!function(t,e){Ye(t)&&t.style.removeProperty(e)}(t.dom,e),$e(Ue(t,"style").map(at),"")&&We(t,"style")},on=function(t,e,n){return void 0===n&&(n=0),Ue(t,e).map((function(t){return parseInt(t,10)})).getOr(n)},an=function(t,e){return on(t,e,1)},un=function(t){return de("col")(t)?on(t,"span",1)>1:an(t,"colspan")>1},cn=function(t){return an(t,"rowspan")>1},sn=function(t,e){return parseInt(tn(t,e),10)},ln=m(10),fn=m(10),dn=function(t,e){return mn(t,e,x)},mn=function(t,e,n){return V(ye(t),(function(t){return Bt(t,e)?n(t)?[t]:[]:mn(t,e,n)}))},gn=function(t,e){return function(t,e,n){return void 0===n&&(n=w),n(e)?T.none():R(t,oe(e))?T.some(e):ze(e,t.join(","),(function(t){return Bt(t,"table")||n(t)}))}(["td","th"],t,e)},hn=function(t){return dn(t,"th,td")},pn=function(t){return Bt(t,"colgroup")?Ae(t,"col"):V(yn(t),(function(t){return Ae(t,"col")}))},vn=function(t,e){return Ie(t,"table",e)},bn=function(t){return dn(t,"tr")},yn=function(t){return vn(t).fold(m([]),(function(t){return Ae(t,"colgroup")}))},wn=function(t,e){return D(t,(function(t){if("colgroup"===oe(t)){var n=D(pn(t),(function(t){var e=on(t,"span",1);return te(t,1,e)}));return ee(t,n,"colgroup")}n=D(hn(t),(function(t){var e=on(t,"rowspan",1),n=on(t,"colspan",1);return te(t,e,n)}));return ee(t,n,e(t))}))},xn=function(t){return he(t).map((function(t){var e=oe(t);return function(t){return R(Zt,t)}(e)?e:"tbody"})).getOr("tbody")},Cn=function(t){var e=bn(t),n=Y(Y([],yn(t),!0),e,!0);return wn(n,xn)},Sn=function(t,e,n){var r=t.cells,o=r.slice(0,e),i=r.slice(e),a=o.concat(n).concat(i);return On(t,a)},kn=function(t,e,n){return Sn(t,e,[n])},Tn=function(t,e,n){t.cells[e]=n},On=function(t,e){return re(t.element,e,t.section,t.isNew)},En=function(t,e){return t.cells[e]},_n=function(t,e){return En(t,e).element},Rn=function(t){return t.cells.length},Nn=function(t){var e=B(t,(function(t){return"colgroup"===t.section}));return{rows:e.fail,cols:e.pass}},An=function(t,e,n){var r=D(t.cells,n);return re(e(t.element),r,t.section,!0)},Dn="data-snooker-locked-cols",Mn=function(t){return Ue(t,Dn).bind((function(t){return T.from(t.match(/\d+/g))})).map((function(t){return U(t,x)}))},Bn=function(t){var e=L(Nn(t).rows,(function(t,e){return M(e.cells,(function(e,n){e.isLocked&&(t[n]=!0)})),t}),{});return function(t,e){var n=O.call(t,0);return n.sort(e),n}(Gt(e,(function(t,e){return parseInt(e,10)})))},zn=function(t,e){return t+","+e},Pn=function(t,e){var n=V(t.all,(function(t){return t.cells}));return z(n,e)},Ln=function(t){var e={},n=[],r=$(t).map((function(t){return t.element})).bind(vn).bind(Mn).getOr({}),o=0,i=0,a=0,u=B(t,(function(t){return"colgroup"===t.section})),c=u.pass,s=u.fail;M(s,(function(t){var u=[];M(t.cells,(function(t){for(var n=0;void 0!==e[zn(a,n)];)n++;for(var o=Qt(r,n.toString()),c=function(t,e,n,r,o,i){return{element:t,rowspan:e,colspan:n,row:r,column:o,isLocked:i}}(t.element,t.rowspan,t.colspan,a,n,o),s=0;s<t.colspan;s++)for(var l=0;l<t.rowspan;l++){var f=n+s,d=zn(a+l,f);e[d]=c,i=Math.max(i,f+1)}u.push(c)})),o++,n.push(ee(t.element,u,t.section)),a++}));var l=G(c).map((function(t){var e=function(t){var e={},n=0;return M(t.cells,(function(t){var r=t.colspan;A(r,(function(o){var i=n+o;e[i]=function(t,e,n){return{element:t,colspan:e,column:n}}(t.element,r,i)})),n+=r})),e}(t);return{colgroups:[function(t,e){return{element:t,columns:e}}(t.element,Kt(e))],columns:e}})).getOrThunk((function(){return{colgroups:[],columns:{}}})),f=l.columns,d=l.colgroups;return{grid:function(t,e){return{rows:t,columns:e}}(o,i),access:e,all:n,columns:f,colgroups:d}},In={fromTable:function(t){var e=Cn(t);return Ln(e)},generate:Ln,getAt:function(t,e,n){return T.from(t.access[zn(e,n)])},findItem:function(t,e,n){var r=Pn(t,(function(t){return n(e,t.element)}));return r.length>0?T.some(r[0]):T.none()},filterItems:Pn,justCells:function(t){return V(t.all,(function(t){return t.cells}))},justColumns:function(t){return Kt(t.columns)},hasColumns:function(t){return Vt(t.columns).length>0},getColumnAt:function(t,e){return T.from(t.columns[e])}},Hn=function(t,e){var n=e.column,r=e.column+e.colspan-1,o=e.row,i=e.row+e.rowspan-1;return n<=t.finishCol&&r>=t.startCol&&o<=t.finishRow&&i>=t.startRow},Fn=function(t,e){return e.column>=t.startCol&&e.column+e.colspan-1<=t.finishCol&&e.row>=t.startRow&&e.row+e.rowspan-1<=t.finishRow},Vn=function(t,e,n){var r=In.findItem(t,e,Lt),o=In.findItem(t,n,Lt);return r.bind((function(t){return o.map((function(e){return n=t,r=e,o=Math.min(n.row,r.row),i=Math.min(n.column,r.column),a=Math.max(n.row+n.rowspan-1,r.row+r.rowspan-1),u=Math.max(n.column+n.colspan-1,r.column+r.colspan-1),{startRow:o,startCol:i,finishRow:a,finishCol:u};var n,r,o,i,a,u}))}))},jn=function(t,e,n){return Vn(t,e,n).bind((function(e){return function(t,e){for(var n=!0,r=p(Fn,e),o=e.startRow;o<=e.finishRow;o++)for(var i=e.startCol;i<=e.finishCol;i++)n=n&&In.getAt(t,o,i).exists(r);return n?T.some(e):T.none()}(t,e)}))},Un=function(t,e,n){return Vn(t,e,n).map((function(e){var n=In.filterItems(t,p(Hn,e));return D(n,(function(t){return t.element}))}))},Wn=function(t,e){return In.findItem(t,e,(function(t,e){return Ht(e,t)})).map((function(t){return t.element}))},qn=function(t,e,n){return vn(t).bind((function(r){return function(t,e,n,r){return In.findItem(t,e,Lt).bind((function(e){var o=n>0?e.row+e.rowspan-1:e.row,i=r>0?e.column+e.colspan-1:e.column;return In.getAt(t,o+n,i+r).map((function(t){return t.element}))}))}(Kn(r),t,e,n)}))},$n=function(t,e,n){var r=Kn(t);return Un(r,e,n)},Gn=function(t,e,n,r,o){var i=Kn(t),a=Lt(t,n)?T.some(e):Wn(i,e),u=Lt(t,o)?T.some(r):Wn(i,r);return a.bind((function(t){return u.bind((function(e){return Un(i,t,e)}))}))},Kn=In.fromTable,Xn=function(t,e){he(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Yn=function(t,e){be(t).fold((function(){he(t).each((function(t){Qn(t,e)}))}),(function(t){Xn(t,e)}))},Jn=function(t,e){(function(t){return we(t,0)})(t).fold((function(){Qn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Qn=function(t,e){t.dom.appendChild(e.dom)},Zn=function(t,e){Xn(t,e),Qn(e,t)},tr=function(t,e){M(e,(function(n,r){var o=0===r?t:e[r-1];Yn(o,n)}))},er=function(t,e){M(e,(function(e){Qn(t,e)}))},nr=function(t){t.dom.textContent="",M(ye(t),(function(t){rr(t)}))},rr=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},or=function(t){var e,n=ye(t);n.length>0&&(e=t,M(n,(function(t){Xn(e,t)}))),rr(t)},ir=function(t,e){var n=function(e){return t(e)?T.from(e.dom.nodeValue):T.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(se,"text"),ar=function(t){return ir.get(t)},ur=function(t){return ir.getOption(t)},cr=function(t,e){return ir.set(t,e)},sr=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function lr(){return{up:m({selector:ze,closest:Ie,predicate:Be,all:pe}),down:m({selector:De,predicate:Re}),styles:m({get:tn,getRaw:nn,set:Qe,remove:rn}),attrs:m({get:je,set:Fe,remove:We,copyTo:function(t,e){var n=qe(t);Ve(e,n)}}),insert:m({before:Xn,after:Yn,afterAll:tr,append:Qn,appendAll:er,prepend:Jn,wrap:Zn}),remove:m({unwrap:or,remove:rr}),create:m({nu:Mt.fromTag,clone:function(t){return Mt.fromDom(t.dom.cloneNode(!1))},text:Mt.fromText}),query:m({comparePosition:function(t,e){return t.dom.compareDocumentPosition(e.dom)},prevSibling:ve,nextSibling:be}),property:m({children:ye,name:oe,parent:he,document:function(t){return ge(t).dom},isText:se,isComment:ue,isElement:ce,isSpecial:function(t){var e=oe(t);return R(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],e)},getLanguage:function(t){return ce(t)?Ue(t,"lang"):T.none()},getText:ar,setText:cr,isBoundary:function(t){return!!ce(t)&&("body"===oe(t)||R(sr,oe(t)))},isEmptyTag:function(t){return!!ce(t)&&R(["br","img","hr","input"],oe(t))},isNonEditable:function(t){return ce(t)&&"false"===je(t,"contenteditable")}}),eq:Lt,is:Ft}}var fr,dr,mr,gr,hr=function(t,e,n,r){var o=e(t,n);return P(r,(function(n,r){var o=e(t,r);return pr(t,n,o)}),o)},pr=function(t,e,n){return e.bind((function(e){return n.filter(p(t.eq,e))}))},vr=function(t,e,n){return n.length>0?function(t,e,n,r){return r(t,e,n[0],n.slice(1))}(t,e,n,hr):T.none()},br=function(t,e,n,r){void 0===r&&(r=w);var o=[e].concat(t.up().all(e)),i=[n].concat(t.up().all(n)),a=function(t){return H(t,r).fold((function(){return t}),(function(e){return t.slice(0,e+1)}))},u=a(o),c=a(i),s=I(u,(function(e){return N(c,function(t,e){return p(t.eq,e)}(t,e))}));return{firstpath:u,secondpath:c,shared:s}},yr=lr(),wr=function(t,e){return vr(yr,(function(e,n){return t(n)}),e)},xr=function(t){return ze(t,"table")},Cr=function(t,e,n){var r=function(t){return function(e){return void 0!==n&&n(e)||Lt(e,t)}};return Lt(t,e)?T.some({boxes:T.some([t]),start:t,finish:e}):xr(t).bind((function(o){return xr(e).bind((function(i){if(Lt(o,i))return T.some({boxes:$n(o,t,e),start:t,finish:e});if(Ht(o,i)){var a=(u=Ne(e,"td,th",r(o))).length>0?u[u.length-1]:e;return T.some({boxes:Gn(o,t,o,e,i),start:t,finish:a})}if(Ht(i,o)){var u,c=(u=Ne(t,"td,th",r(i))).length>0?u[u.length-1]:t;return T.some({boxes:Gn(i,t,o,e,i),start:t,finish:c})}return function(t,e,n){return br(yr,t,e,n)}(t,e).shared.bind((function(a){return Ie(a,"table",n).bind((function(n){var a=Ne(e,"td,th",r(n)),u=a.length>0?a[a.length-1]:e,c=Ne(t,"td,th",r(n)),s=c.length>0?c[c.length-1]:t;return T.some({boxes:Gn(n,t,o,e,i),start:s,finish:u})}))}))}))}))},Sr=function(t,e){var n=De(t,e);return n.length>0?T.some(n):T.none()},kr=function(t,e,n){return Le(t,e).bind((function(e){return Le(t,n).bind((function(t){return wr(xr,[e,t]).map((function(n){return{first:e,last:t,table:n}}))}))}))},Tr=function(t,e,n,r,o){return function(t,e){return I(t,(function(t){return Bt(t,e)}))}(t,o).bind((function(t){return qn(t,e,n).bind((function(t){return function(t,e){return ze(t,"table").bind((function(n){return Le(n,e).bind((function(e){return Cr(e,t).bind((function(t){return t.boxes.map((function(e){return{boxes:e,start:t.start,finish:t.finish}}))}))}))}))}(t,r)}))}))},Or=function(t,e){return Sr(t,e)},Er=function(t,e,n){return kr(t,e,n).bind((function(e){var n=function(e){return Lt(t,e)},r="thead,tfoot,tbody,table",o=ze(e.first,r,n),i=ze(e.last,r,n);return o.bind((function(t){return i.bind((function(n){return Lt(t,n)?function(t,e,n){var r=Kn(t);return jn(r,e,n)}(e.table,e.first,e.last):T.none()}))}))}))},_r=function(t){if(!i(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return M(t,(function(r,o){var a=Vt(r);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],c=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!i(c))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+c.length+" ("+c+"), got "+i);var a=function(t){var r=Vt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!j(e,(function(t){return R(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:a,log:function(t){console.log(t,{constructors:e,constructor:u,params:n})}}}})),n},Rr=_r([{none:[]},{multiple:["elements"]},{single:["element"]}]),Nr=function(t,e,n,r){return t.fold(e,n,r)},Ar=Rr.none,Dr=Rr.multiple,Mr=Rr.single,Br=tinymce.util.Tools.resolve("tinymce.PluginManager"),zr=function(t,e){return Mt.fromDom(t.dom.cloneNode(e))},Pr=function(t){return zr(t,!1)},Lr=function(t){return zr(t,!0)},Ir=function(t,e){var n=Mt.fromTag(e),r=qe(t);return Ve(n,r),n},Hr=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=tn(n,t);return parseFloat(o)||0}return r},r=function(t,e){return L(e,(function(e,n){var r=tn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!f(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Ye(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},Fr=function(){var t=At().browser;return t.isIE()||t.isEdge()},Vr=function(t,e){return function(t){var e=parseFloat(t);return isNaN(e)?T.none():T.some(e)}(t).getOr(e)},jr=function(t,e,n){return Vr(tn(t,e),n)},Ur=function(t){return tn(t,"box-sizing")},Wr=function(t,e,n,r){return e-jr(t,"padding-"+n,0)-jr(t,"padding-"+r,0)-jr(t,"border-"+n+"-width",0)-jr(t,"border-"+r+"-width",0)},qr=function(t,e){var n=t.dom,r=n.getBoundingClientRect().width||n.offsetWidth;return"border-box"===e?r:Wr(t,r,"left","right")},$r=Hr("width",(function(t){return t.dom.offsetWidth})),Gr=function(t){return $r.get(t)},Kr=function(t){return $r.getOuter(t)},Xr=function(t){return qr(t,"content-box")},Yr=function(t){return Fr()?qr(t,Ur(t)):jr(t,"width",t.dom.offsetWidth)},Jr=function(t,e){void 0===e&&(e=x);var n=t.grid,r=A(n.columns,g),o=A(n.rows,g);return D(r,(function(n){return Qr((function(){return V(o,(function(e){return In.getAt(t,e,n).filter((function(t){return t.column===n})).toArray()}))}),(function(t){return 1===t.colspan&&e(t.element)}),(function(){return In.getAt(t,0,n)}))}))},Qr=function(t,e,n){var r=t();return I(r,e).orThunk((function(){return T.from(r[0]).orThunk(n)})).map((function(t){return t.element}))},Zr=function(t){var e=t.grid,n=A(e.rows,g),r=A(e.columns,g);return D(n,(function(e){return Qr((function(){return V(r,(function(n){return In.getAt(t,e,n).filter((function(t){return t.row===e})).fold(m([]),(function(t){return[t]}))}))}),(function(t){return 1===t.rowspan}),(function(){return In.getAt(t,e,0)}))}))},to=function(t,e){if(e<0||e>=t.length-1)return T.none();var n=t[e].fold((function(){var n=function(t){var e=O.call(t,0);return e.reverse(),e}(t.slice(0,e));return K(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return T.some({value:t,delta:0})})),r=t[e+1].fold((function(){var n=t.slice(e+1);return K(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return T.some({value:t,delta:1})}));return n.bind((function(t){return r.map((function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n}))}))},eo=function(t,e){return function(n){return"rtl"===no(n)?e:t}},no=function(t){return"rtl"===tn(t,"direction")?"rtl":"ltr"},ro=Hr("height",(function(t){var e=t.dom;return Ee(t)?e.getBoundingClientRect().height:e.offsetHeight})),oo=function(t){return ro.get(t)},io=function(t){return ro.getOuter(t)},ao=function(t){return Fr()?function(t,e){var n=t.dom,r=n.getBoundingClientRect().height||n.offsetHeight;return"border-box"===e?r:Wr(t,r,"top","bottom")}(t,Ur(t)):jr(t,"height",t.dom.offsetHeight)},uo=function(t,e){return{left:t,top:e,translate:function(n,r){return uo(t+n,e+r)}}},co=uo,so=function(t,e){return void 0!==t?t:void 0!==e?e:0},lo=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return co(n.offsetLeft,n.offsetTop);var i=so(null==r?void 0:r.pageYOffset,o.scrollTop),a=so(null==r?void 0:r.pageXOffset,o.scrollLeft),u=so(o.clientTop,n.clientTop),c=so(o.clientLeft,n.clientLeft);return fo(t).translate(a-c,i-u)},fo=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?co(n.offsetLeft,n.offsetTop):Ee(t)?function(t){var e=t.getBoundingClientRect();return co(e.left,e.top)}(e):co(0,0)},mo=function(t,e){return{row:t,y:e}},go=function(t,e){return{col:t,x:e}},ho=function(t){return lo(t).left+Kr(t)},po=function(t){return lo(t).left},vo=function(t,e){return go(t,po(e))},bo=function(t,e){return go(t,ho(e))},yo=function(t){return lo(t).top},wo=function(t,e){return mo(t,yo(e))},xo=function(t,e){return mo(t,yo(e)+io(e))},Co=function(t,e,n){if(0===n.length)return[];var r=D(n.slice(1),(function(e,n){return e.map((function(e){return t(n,e)}))})),o=n[n.length-1].map((function(t){return e(n.length-1,t)}));return r.concat([o])},So={delta:g,positions:function(t){return Co(wo,xo,t)},edge:yo},ko={delta:g,edge:po,positions:function(t){return Co(vo,bo,t)}},To={delta:function(t){return-t},edge:ho,positions:function(t){return Co(bo,vo,t)}},Oo=eo(ko,To),Eo={delta:function(t,e){return Oo(e).delta(t,e)},positions:function(t,e){return Oo(e).positions(t,e)},edge:function(t){return Oo(t).edge(t)}},_o={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Ro=(fr="[0-9]+",dr="[eE][+-]?[0-9]+",mr=function(t){return"(?:"+t+")?"},gr=["Infinity","[0-9]+\\."+mr(fr)+mr(dr),"\\.[0-9]+"+mr(dr),fr+mr(dr)].join("|"),new RegExp("^([+-]?(?:"+gr+"))(.*)$")),No=function(t,e){return T.from(Ro.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return N(e,(function(e){return N(_o[e],(function(e){return t===e}))}))}(r,e)?T.some({value:n,unit:r}):T.none()}))},Ao=/(\d+(\.\d+)?)%/,Do=/(\d+(\.\d+)?)px|em/,Mo=de("col"),Bo=function(t,e,n){var r,o=(r=t,T.from(r.dom.parentElement).map(Mt.fromDom)).getOrThunk((function(){return _e(me(t))}));return e(t)/n(o)*100},zo=function(t,e){Qe(t,"width",e+"px")},Po=function(t,e){Qe(t,"width",e+"%")},Lo=function(t,e){Qe(t,"height",e+"px")},Io=function(t,e,n,r){var o=parseFloat(t);return it(t,"%")&&"table"!==oe(e)?function(t,e,n,r){var o=vn(t).map((function(t){var r=n(t);return Math.floor(e/100*r)})).getOr(e);return r(t,o),o}(e,o,n,r):o},Ho=function(t){var e=function(t){return ao(t)+"px"}(t);return e?Io(e,t,oo,Lo):oo(t)},Fo=function(t,e){return nn(t,e).orThunk((function(){return Ue(t,e).map((function(t){return t+"px"}))}))},Vo=function(t){return Fo(t,"width")},jo=function(t){return Bo(t,Gr,Xr)},Uo=function(t){return Mo(t)?Gr(t):Yr(t)},Wo=function(t){return function(t,e,n){return n(t)/an(t,e)}(t,"rowspan",Ho)},qo=function(t,e,n){Qe(t,"width",e+n)},$o=function(t){return Bo(t,Gr,Xr)+"%"},Go=m(Ao),Ko=de("col"),Xo=function(t){return Vo(t).getOrThunk((function(){return Uo(t)+"px"}))},Yo=function(t){return(e=t,Fo(e,"height")).getOrThunk((function(){return Wo(t)+"px"}));var e},Jo=function(t,e,n,r,o,i){return t.filter(r).fold((function(){return i(to(n,e))}),(function(t){return o(t)}))},Qo=function(t,e,n,r){var o=Jr(t),i=In.hasColumns(t)?function(t){return D(In.justColumns(t),(function(t){return T.from(t.element)}))}(t):o,a=[T.some(Eo.edge(e))].concat(D(Eo.positions(o,e),(function(t){return t.map((function(t){return t.x}))}))),u=y(un);return D(i,(function(t,e){return Jo(t,e,a,u,(function(t){if(function(t){var e=At().browser,n=e.isChrome()||e.isFirefox();return!Ko(t)||n}(t))return n(t);var i,c,s=(i=o[e],c=g,null!=i?c(i):T.none());return Jo(s,e,a,u,(function(t){return r(T.some(Gr(t)))}),r)}),r)}))},Zo=function(t){return t.map((function(t){return t+"px"})).getOr("")},ti=function(t,e,n){return Qo(t,e,Uo,(function(t){return t.getOrThunk(n.minCellWidth)}))},ei=function(t,e,n,r,o){var i=Zr(t),a=[T.some(n.edge(e))].concat(D(n.positions(i,e),(function(t){return t.map((function(t){return t.y}))})));return D(i,(function(t,e){return Jo(t,e,a,y(cn),r,o)}))},ni=function(t,e){return function(){return Ee(t)?e(t):parseFloat(nn(t,"width").getOr("0"))}},ri=function(t){var e=ni(t,Gr),n=m(0);return{width:e,pixelWidth:e,getWidths:function(e,n){return ti(e,t,n)},getCellDelta:n,singleColumnWidth:m([0]),minCellWidth:n,setElementWidth:d,adjustTableWidth:d,isRelative:!0,label:"none"}},oi=function(t){var e=ni(t,(function(t){return parseFloat($o(t))})),n=ni(t,Gr);return{width:e,pixelWidth:n,getWidths:function(e,n){return function(t,e,n){return Qo(t,e,jo,(function(t){return t.fold((function(){return n.minCellWidth()}),(function(t){return t/n.pixelWidth()*100}))}))}(e,t,n)},getCellDelta:function(t){return t/n()*100},singleColumnWidth:function(t,e){return[100-t]},minCellWidth:function(){return ln()/n()*100},setElementWidth:Po,adjustTableWidth:function(n){var r=e();Po(t,r+n/100*r)},isRelative:!0,label:"percent"}},ii=function(t){var e=ni(t,Gr);return{width:e,pixelWidth:e,getWidths:function(e,n){return ti(e,t,n)},getCellDelta:g,singleColumnWidth:function(t,e){return[Math.max(ln(),t+e)-t]},minCellWidth:ln,setElementWidth:zo,adjustTableWidth:function(n){var r=e()+n;zo(t,r)},isRelative:!1,label:"pixel"}},ai=function(t){return Vo(t).fold((function(){return ri(t)}),(function(e){return function(t,e){return null!==Go().exec(e)?oi(t):ii(t)}(t,e)}))},ui=ii,ci=oi,si=function(t,e,n){var r=t[n].element,o=Mt.fromTag("td");Qn(o,Mt.fromTag("br")),(e?Qn:Jn)(r,o)},li=function(t,e){var n=function(t){return Bt(t.element,e)},r=Lr(t),o=Cn(r),i=ai(t),a=In.generate(o),u=function(t,e){var n=t.grid.columns,r=t.grid.rows,o=n,i=0,a=0,u=[],c=[];return Ut(t.access,(function(t){if(u.push(t),e(t)){c.push(t);var n=t.row,s=n+t.rowspan-1,l=t.column,f=l+t.colspan-1;n<r?r=n:s>i&&(i=s),l<o?o=l:f>a&&(a=f)}})),function(t,e,n,r,o,i){return{minRow:t,minCol:e,maxRow:n,maxCol:r,allCells:o,selectedCells:i}}(r,o,i,a,u,c)}(a,n),c="th:not("+e+"),td:not("+e+")",s=mn(r,"th,td",(function(t){return Bt(t,c)}));return M(s,rr),function(t,e,n,r){for(var o=e.grid.columns,i=e.grid.rows,a=0;a<i;a++)for(var u=!1,c=0;c<o;c++)a<n.minRow||a>n.maxRow||c<n.minCol||c>n.maxCol||(In.getAt(e,a,c).filter(r).isNone()?si(t,u,a):u=!0)}(o,a,u,n),function(t,e,n,r){Ut(n.columns,(function(t){(t.column<e.minCol||t.column>e.maxCol)&&rr(t.element)}));var o=z(dn(t,"tr"),(function(t){return 0===t.dom.childElementCount}));M(o,rr),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||M(dn(t,"th,td"),(function(t){We(t,"rowspan"),We(t,"colspan")})),We(t,Dn),We(t,"data-snooker-col-series"),ai(t).adjustTableWidth(r)}(r,u,a,function(t,e,n,r){if(0===r.minCol&&e.grid.columns===r.maxCol+1)return 0;var o=ti(e,t,n),i=L(o,(function(t,e){return t+e}),0),a=L(o.slice(r.minCol,r.maxCol+1),(function(t,e){return t+e}),0)/i*n.pixelWidth()-n.pixelWidth();return n.getCellDelta(a)}(t,In.fromTable(t),i,u)),r},fi=function(t){return"img"===oe(t)?1:ur(t).fold((function(){return ye(t).length}),(function(t){return t.length}))},di=["img","br"],mi=function(t){return ur(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||R(di,oe(t))},gi=function(t){return e=mi,(n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=Mt.fromDom(t.childNodes[r]);if(e(o))return T.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return T.none()})(t.dom);var e,n},hi=function(t){return pi(t,mi)},pi=function(t,e){var n=function(t){for(var r=ye(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return T.some(i);var a=n(i);if(a.isSome())return a}return T.none()};return n(t)},vi={scope:["row","col"]},bi=function(t){return function(){var e=Mt.fromTag("td",t.dom);return Qn(e,Mt.fromTag("br",t.dom)),e}},yi=function(t){return function(){return Mt.fromTag("col",t.dom)}},wi=function(t){return function(){return Mt.fromTag("colgroup",t.dom)}},xi=function(t){return function(){return Mt.fromTag("tr",t.dom)}},Ci=function(t,e,n){var r=function(t,e){var n=Ir(t,e),r=ye(Lr(t));return er(n,r),n}(t,e);return Ut(n,(function(t,e){null===t?We(r,e):Fe(r,e,t)})),r},Si=function(t){return t},ki=function(t,e,n){var r=function(t,e){var n,r,o,i;n=t.element,r=e,o=n.dom,i=r.dom,Ye(o)&&Ye(i)&&(i.style.cssText=o.style.cssText),rn(e,"height"),1!==t.colspan&&rn(e,"width")};return{col:function(n){var o=Mt.fromTag(oe(n.element),e.dom);return r(n,o),t(n.element,o),o},colgroup:wi(e),row:xi(e),cell:function(o){var i=Mt.fromTag(oe(o.element),e.dom),a=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),u=a.length>0?function(t,e,n){return gi(t).map((function(r){var o=n.join(","),i=Ne(r,o,(function(e){return Lt(e,t)}));return P(i,(function(t,e){var n=Pr(e);return We(n,"contenteditable"),Qn(t,n),n}),e)})).getOr(e)}(o.element,i,a):i;return Qn(u,Mt.fromTag("br")),r(o,i),function(t,e){Ut(vi,(function(n,r){return Ue(t,r).filter((function(t){return R(n,t)})).each((function(t){return Fe(e,r,t)}))}))}(o.element,i),t(o.element,i),i},replace:Ci,colGap:yi(e),gap:bi(e)}},Ti=function(t){return{col:yi(t),colgroup:wi(t),row:xi(t),cell:bi(t),replace:Si,colGap:yi(t),gap:bi(t)}},Oi=function(t){return D(t,Mt.fromDom)},Ei=function(t){return Mt.fromDom(t.getBody())},_i=function(t){return t.getBoundingClientRect().width},Ri=function(t){return t.getBoundingClientRect().height},Ni=function(t){return function(e){return Lt(e,Ei(t))}},Ai=function(t){return/^\d+(\.\d+)?$/.test(t)?t+"px":t},Di=function(t){We(t,"data-mce-style");var e=function(t){return We(t,"data-mce-style")};M(hn(t),e),M(pn(t),e)},Mi=function(t){return Mt.fromDom(t.selection.getStart())},Bi=function(t){return Nr(t.get(),m([]),g,W)},zi=function(t){var e=function(t,e){return Ue(t,e).exists((function(t){return parseInt(t,10)>1}))},n=Bi(t);return n.length>0&&j(n,(function(t){return e(t,"rowspan")||e(t,"colspan")}))?T.some(n):T.none()},Pi=function(t,e,n){return Nr(e.get(),T.none,(function(e){return e.length<=1?T.none():Er(t,n.firstSelectedSelector,n.lastSelectedSelector).map((function(t){return{bounds:t,cells:e}}))}),T.none)},Li="data-mce-selected",Ii="data-mce-first-selected",Hi="data-mce-last-selected",Fi={selected:Li,selectedSelector:"td[data-mce-selected],th[data-mce-selected]",firstSelected:Ii,firstSelectedSelector:"td[data-mce-first-selected],th[data-mce-first-selected]",lastSelected:Hi,lastSelectedSelector:"td[data-mce-last-selected],th[data-mce-last-selected]"},Vi=function(t,e,n){return{element:n,mergable:Pi(e,t,Fi),unmergable:zi(t),selection:Bi(t)}},ji=function(t){return function(e,n){var r,o=oe(e),i="col"===o||"colgroup"===o?vn(r=e).bind((function(t){return Or(t,Fi.firstSelectedSelector)})).fold(m(r),(function(t){return t[0]})):e;return Ie(i,t,n)}},Ui=ji("th,td,caption"),Wi=ji("th,td"),qi=function(t){return Bi(t)},$i=function(t,e,n){t.on("BeforeGetContent",(function(n){!0===n.selection&&Nr(e.get(),d,(function(e){n.preventDefault(),function(t){return vn(t[0]).map((function(t){var e=li(t,"[data-mce-selected]");return Di(e),[e]}))}(e).each((function(e){n.content="text"===n.format?function(t){return D(t,(function(t){return t.dom.innerText})).join("")}(e):function(t,e){return D(e,(function(e){return t.selection.serializer.serialize(e.dom,{})})).join("")}(t,e)}))}),d)})),t.on("BeforeSetContent",(function(r){if(!0===r.selection&&!0===r.paste){var o=qi(e);$(o).each((function(e){vn(e).each((function(o){var i,a,u,c=z((i=r.content,(u=(a||document).createElement("div")).innerHTML=i,ye(Mt.fromDom(u))),(function(t){return"meta"!==oe(t)})),s=de("table");if(1===c.length&&s(c[0])){r.preventDefault();var l=Mt.fromDom(t.getDoc()),f=Ti(l),d=function(t,e,n){return{element:t,clipboard:e,generators:n}}(e,c[0],f);n.pasteCells(o,d).each((function(){t.focus()}))}}))}))}}))},Gi=_r([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Ki=X({},Gi),Xi=function(t,e,n,r,o){var i=t.slice(0),a=function(t,e){return 0===t.length?Ki.none():1===t.length?Ki.only(0):0===e?Ki.left(0,1):e===t.length-1?Ki.right(e-1,e):e>0&&e<t.length-1?Ki.middle(e-1,e,e+1):Ki.none()}(t,e),u=m(D(i,m(0)));return a.fold(u,(function(t){return r.singleColumnWidth(i[t],n)}),(function(t,e){return o.calcLeftEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)}),(function(t,e,a){return o.calcMiddleDeltas(i,t,e,a,n,r.minCellWidth(),r.isRelative)}),(function(t,e){return o.calcRightEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)}))},Yi=function(t,e,n){for(var r=0,o=t;o<e;o++)r+=void 0!==n[o]?n[o]:0;return r},Ji=function(t,e){var n=In.justCells(t);return D(n,(function(t){var n=Yi(t.row,t.row+t.rowspan,e);return{element:t.element,height:n,rowspan:t.rowspan}}))},Qi=function(t,e){return In.hasColumns(t)?function(t,e){var n=In.justColumns(t);return D(n,(function(t,n){return{element:t.element,width:e[n],colspan:t.colspan}}))}(t,e):function(t,e){var n=In.justCells(t);return D(n,(function(t){var n=Yi(t.column,t.column+t.colspan,e);return{element:t.element,width:n,colspan:t.colspan}}))}(t,e)},Zi=function(t,e,n){var r=Qi(t,e);M(r,(function(t){n.setElementWidth(t.element,t.width)}))},ta=function(t,e,n,r,o){var i=In.fromTable(t),a=o.getCellDelta(e),u=o.getWidths(i,o),c=n===i.grid.columns-1,s=r.clampTableDelta(u,n,a,o.minCellWidth(),c),l=Xi(u,n,s,o,r),f=D(l,(function(t,e){return t+u[e]}));Zi(i,f,o),r.resizeTable(o.adjustTableWidth,s,c)},ea=function(t,e,n,r){var o=In.fromTable(t),i=function(t,e,n){return ei(t,e,n,Wo,(function(t){return t.getOrThunk(fn)}))}(o,t,r),a=D(i,(function(t,r){return n===r?Math.max(e+t,fn()):t})),u=Ji(o,a),c=function(t,e){return D(t.all,(function(t,n){return{element:t.element,height:e[n]}}))}(o,a);M(c,(function(t){Lo(t.element,t.height)})),M(u,(function(t){Lo(t.element,t.height)}));var s=P(a,(function(t,e){return t+e}),0);Lo(t,s)},na=function(t){return D(t,m(0))},ra=function(t,e,n,r,o){return o(t.slice(0,e)).concat(r).concat(o(t.slice(n)))},oa=function(t){return function(e,n,r,o){if(t(r)){var i=Math.max(o,e[n]-Math.abs(r)),a=Math.abs(i-e[n]);return r>=0?a:-a}return r}},ia=oa((function(t){return t<0})),aa=oa(x),ua=function(){var t=function(t,e,n,r){var o=(100+n)/100,i=Math.max(r,(t[e]+n)/o);return D(t,(function(t,n){return(n===e?i:t/o)-t}))},e=function(e,n,r,o,i,a){return a?t(e,n,o,i):function(t,e,n,r,o){var i=ia(t,e,r,o);return ra(t,e,n+1,[i,0],na)}(e,n,r,o,i)};return{resizeTable:function(t,e){return t(e)},clampTableDelta:ia,calcLeftEdgeDeltas:e,calcMiddleDeltas:function(t,n,r,o,i,a,u){return e(t,r,o,i,a,u)},calcRightEdgeDeltas:function(e,n,r,o,i,a){if(a)return t(e,r,o,i);var u=ia(e,r,o,i);return na(e.slice(0,r)).concat([u])},calcRedestributedWidths:function(t,e,n,r){if(r){var o=(e+n)/e,i=D(t,(function(t){return t/o}));return{delta:100*o-100,newSizes:i}}return{delta:n,newSizes:t}}}},ca=function(){var t=function(t,e,n,r,o){var i=aa(t,r>=0?n:e,r,o);return ra(t,e,n+1,[i,-i],na)};return{resizeTable:function(t,e,n){n&&t(e)},clampTableDelta:function(t,e,n,r,o){if(o){if(n>=0)return n;var i=L(t,(function(t,e){return t+e-r}),0);return Math.max(-i,n)}return ia(t,e,n,r)},calcLeftEdgeDeltas:t,calcMiddleDeltas:function(e,n,r,o,i,a){return t(e,r,o,i,a)},calcRightEdgeDeltas:function(t,e,n,r,o,i){if(i)return na(t);var a=r/t.length;return D(t,m(a))},calcRedestributedWidths:function(t,e,n,r){return{delta:0,newSizes:t}}}},sa=function(t,e){var n=T.from(t.dom.documentElement).map(Mt.fromDom).getOr(t);return{parent:m(n),view:m(t),origin:m(co(0,0)),isResizable:e}},la=function(t,e,n){return{parent:m(e),view:m(t),origin:m(co(0,0)),isResizable:n}},fa=_r([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),da=function(t,e,n){var r=n.substring(0,n.length-t.length),o=parseFloat(r);return r===o.toString()?e(o):fa.invalid(n)},ma=X(X({},fa),{from:function(t){return it(t,"%")?da("%",fa.percent,t):it(t,"px")?da("px",fa.pixels,t):fa.invalid(t)}}),ga=function(t,e,n){return t.fold((function(){return e}),(function(t){return function(t,e,n){var r=n/e;return D(t,(function(t){return ma.from(t).fold((function(){return t}),(function(t){return t*r+"px"}),(function(t){return t/100*n+"px"}))}))}(e,n,t)}),(function(t){return function(t,e){return D(t,(function(t){return ma.from(t).fold((function(){return t}),(function(t){return t/e*100+"%"}),(function(t){return t+"%"}))}))}(e,n)}))},ha=function(t,e,n){var r=ma.from(n),o=j(t,(function(t){return"0px"===t}))?function(t,e){var n=t.fold((function(){return m("")}),(function(t){return m(t/e+"px")}),(function(){return m(100/e+"%")}));return A(e,n)}(r,t.length):ga(r,t,e);return ba(o)},pa=function(t,e){return 0===t.length?e:P(t,(function(t,e){return ma.from(e).fold(m(0),g,g)+t}),0)},va=function(t,e){return ma.from(t).fold(m(t),(function(t){return t+e+"px"}),(function(t){return t+e+"%"}))},ba=function(t){if(0===t.length)return t;var e=P(t,(function(t,e){var n=ma.from(e).fold((function(){return{value:e,remainder:0}}),(function(t){return function(t,e){var n=Math.floor(t);return{value:n+e,remainder:t-n}}(t,"px")}),(function(t){return{value:t+"%",remainder:0}}));return{output:[n.value].concat(t.output),remainder:t.remainder+n.remainder}}),{output:[],remainder:0}),n=e.output;return n.slice(0,n.length-1).concat([va(n[n.length-1],Math.round(e.remainder))])},ya=ma.from,wa=function(t){return ya(t).fold(m("px"),m("px"),m("%"))},xa=function(t,e,n){var r=In.fromTable(t),o=r.all,i=In.justCells(r),a=In.justColumns(r);e.each((function(e){var n=wa(e),o=Gr(t),u=function(t,e){return Qo(t,e,Xo,Zo)}(r,t),c=ha(u,o,e);In.hasColumns(r)?function(t,e,n){M(e,(function(e,r){var o=pa([t[r]],ln());Qe(e.element,"width",o+n)}))}(c,a,n):function(t,e,n){M(e,(function(e){var r=t.slice(e.column,e.colspan+e.column),o=pa(r,ln());Qe(e.element,"width",o+n)}))}(c,i,n),Qe(t,"width",e)})),n.each((function(e){var n=wa(e),a=oo(t),u=function(t,e,n){return ei(t,e,n,Yo,Zo)}(r,t,So);!function(t,e,n,r){M(n,(function(e){var n=t.slice(e.row,e.rowspan+e.row),o=pa(n,fn());Qe(e.element,"height",o+r)})),M(e,(function(e,n){Qe(e.element,"height",t[n])}))}(ha(u,a,e),o,i,n),Qe(t,"height",e)}))},Ca=function(t){return Vo(t).exists((function(t){return Ao.test(t)}))},Sa=function(t){return Vo(t).exists((function(t){return Do.test(t)}))},ka=function(t){return Vo(t).isNone()},Ta=function(t){return In.fromTable(t).grid},Oa=function(t){var e=[];return{bind:function(t){if(void 0===t)throw new Error("Event bind error: undefined handler");e.push(t)},unbind:function(t){e=z(e,(function(e){return e!==t}))},trigger:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={};M(t,(function(t,e){o[t]=n[e]})),M(e,(function(t){t(o)}))}}},Ea=function(t){return{registry:Wt(t,(function(t){return{bind:t.bind,unbind:t.unbind}})),trigger:Wt(t,(function(t){return t.trigger}))}},_a=function(t){return t.slice(0).sort()},Ra=function(t,e,n){if(0===e.length)throw new Error("You must specify at least one required field.");var o;return function(t,e){if(!i(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");M(e,(function(e){if(!r(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")}))}("required",e),o=_a(e),I(o,(function(t,e){return e<o.length-1&&t===o[e+1]})).each((function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+o.join(", ")+"].")})),function(r){var o=Vt(r);j(e,(function(t){return R(o,t)}))||function(t,e){throw new Error("All required keys ("+_a(t).join(", ")+") were not specified. Specified keys were: "+_a(e).join(", ")+".")}(e,o),t(e,o);var i=z(e,(function(t){return!n.validate(r[t],t)}));return i.length>0&&function(t,e){throw new Error("All values need to be of type: "+e+". Keys ("+_a(t).join(", ")+") were not.")}(i,n.label),r}},Na=function(t,e){var n=z(e,(function(e){return!R(t,e)}));n.length>0&&function(t){throw new Error("Unsupported keys for object: "+_a(t).join(", "))}(n)},Aa=function(t){return function(t,e){return Ra(t,e,{validate:l,label:"function"})}(Na,t)},Da=Aa(["compare","extract","mutate","sink"]),Ma=Aa(["element","start","stop","destroy"]),Ba=Aa(["forceDrop","drop","move","delayDrop"]),za=function(){var t=T.none(),e=Ea({move:Oa(["info"])});return{onEvent:function(n,r){r.extract(n).each((function(n){(function(e,n){var r=t.map((function(t){return e.compare(t,n)}));return t=T.some(n),r})(r,n).each((function(t){e.trigger.move(t)}))}))},reset:function(){t=T.none()},events:e.registry}},Pa=function(){var t,e=(t=Ea({move:Oa(["info"])}),{onEvent:d,reset:d,events:t.registry}),n=za(),r=e;return{on:function(){r.reset(),r=n},off:function(){r.reset(),r=e},isOn:function(){return r===n},onEvent:function(t,e){r.onEvent(t,e)},events:n.events}},La=function(t,e,n){var r,o,i,u,c=!1,s=Ea({start:Oa([]),stop:Oa([])}),l=Pa(),f=function(){g.stop(),l.isOn()&&(l.off(),s.trigger.stop())},d=(r=f,o=200,i=null,{cancel:u=function(){a(i)||(clearTimeout(i),i=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];u(),i=setTimeout((function(){i=null,r.apply(null,t)}),o)}});l.events.move.bind((function(n){e.mutate(t,n.info)}));var m=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];c&&t.apply(null,e)}},g=e.sink(Ba({forceDrop:f,drop:m(f),move:m((function(t){d.cancel(),l.onEvent(t,e)})),delayDrop:m(d.throttle)}),n);return{element:g.element,go:function(t){g.start(t),l.on(),s.trigger.start()},on:function(){c=!0},off:function(){c=!1},destroy:function(){g.destroy()},events:s.registry}},Ia=function(t){var e,n,r=Mt.fromDom(function(t){if(Ce()&&s(t.target)){var e=Mt.fromDom(t.target);if(ce(e)&&Oe(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return $(n)}}return T.from(t.target)}(t).getOr(t.target)),o=function(){return t.stopPropagation()},i=function(){return t.preventDefault()},a=(e=i,n=o,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e(n.apply(null,t))});return function(t,e,n,r,o,i,a){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:a}}(r,t.clientX,t.clientY,o,i,a,t)},Ha=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(Ia(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:p(Fa,t,e,i,o)}},Fa=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Va=x,ja=function(t,e,n){return function(t,e,n,r){return Ha(t,e,n,r,!1)}(t,e,Va,n)},Ua=Ia,Wa=function(t,e){var n=je(t,e);return void 0===n||""===n?[]:n.split(" ")},qa=function(t){return void 0!==t.dom.classList},$a=function(t,e){return function(t,e,n){var r=Wa(t,e).concat([n]);return Fe(t,e,r.join(" ")),!0}(t,"class",e)},Ga=function(t,e){qa(t)?t.dom.classList.add(e):$a(t,e)},Ka=function(t,e){return qa(t)&&t.dom.classList.contains(e)},Xa=function(t){var e=t.replace(/\./g,"-");return{resolve:function(t){return e+"-"+t}}},Ya=Xa("ephox-dragster"),Ja=Ya.resolve,Qa=Da({compare:function(t,e){return co(e.left-t.left,e.top-t.top)},extract:function(t){return T.some(co(t.x,t.y))},sink:function(t,e){var n=function(t){var e=X({layerClass:Ja("blocker")},t),n=Mt.fromTag("div");return Fe(n,"role","presentation"),Ze(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Ga(n,Ja("blocker")),Ga(n,e.layerClass),{element:m(n),destroy:function(){rr(n)}}}(e),r=ja(n.element(),"mousedown",t.forceDrop),o=ja(n.element(),"mouseup",t.drop),i=ja(n.element(),"mousemove",t.move),a=ja(n.element(),"mouseout",t.delayDrop);return Ma({element:n.element,start:function(t){Qn(t,n.element())},stop:function(){rr(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),a.unbind(),r.unbind()}})},mutate:function(t,e){t.mutate(e.left,e.top)}}),Za=function(t){return Ie(t,"[contenteditable]")},tu=function(t,e){return void 0===e&&(e=!1),!At().browser.isIE()&&Ee(t)?t.dom.isContentEditable:Za(t).fold(m(e),(function(t){return"true"===eu(t)}))},eu=function(t){return t.dom.contentEditable},nu=Xa("ephox-snooker"),ru=nu.resolve,ou=function(){var t=Ea({drag:Oa(["xDelta","yDelta","target"])}),e=T.none(),n=function(){var t=Ea({drag:Oa(["xDelta","yDelta"])});return{mutate:function(e,n){t.trigger.drag(e,n)},events:t.registry}}();n.events.drag.bind((function(n){e.each((function(e){t.trigger.drag(n.xDelta,n.yDelta,e)}))}));return{assign:function(t){e=T.some(t)},get:function(){return e},mutate:n.mutate,events:t.registry}},iu=ru("resizer-bar"),au=ru("resizer-rows"),uu=ru("resizer-cols"),cu=function(t){var e=De(t.parent(),"."+iu);M(e,rr)},su=function(t,e,n){var r=t.origin();M(e,(function(e){e.each((function(e){var o=n(r,e);Ga(o,iu),Qn(t.parent(),o)}))}))},lu=function(t,e,n,r){su(t,e,(function(t,e){var o,i,a,u,c,s,l=(o=e.col,i=e.x-t.left,a=n.top-t.top,u=7,c=r,s=Mt.fromTag("div"),Ze(s,{position:"absolute",left:i-u/2+"px",top:a+"px",height:c+"px",width:u+"px"}),Ve(s,{"data-column":o,role:"presentation"}),s);return Ga(l,uu),l}))},fu=function(t,e,n,r){su(t,e,(function(t,e){var o=function(t,e,n,r,o){var i=Mt.fromTag("div");return Ze(i,{position:"absolute",left:e+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),Ve(i,{"data-row":t,role:"presentation"}),i}(e.row,n.left-t.left,e.y-t.top,r,7);return Ga(o,au),o}))},du=function(t,e,n,r,o){var i=lo(n),a=e.isResizable,u=r.length>0?So.positions(r,n):[],c=u.length>0?function(t,e){return V(t.all,(function(t,n){return e(t.element)?[n]:[]}))}(t,a):[],s=z(u,(function(t,e){return N(c,(function(t){return e===t}))}));fu(e,s,i,Kr(n));var l=o.length>0?Eo.positions(o,n):[],f=l.length>0?function(t,e){var n=[];return A(t.grid.columns,(function(r){In.getColumnAt(t,r).map((function(t){return t.element})).forall(e)&&n.push(r)})),z(n,(function(n){var r=In.filterItems(t,(function(t){return t.column===n}));return j(r,(function(t){return e(t.element)}))}))}(t,a):[],d=z(l,(function(t,e){return N(f,(function(t){return e===t}))}));lu(e,d,i,io(n))},mu=function(t,e){if(cu(t),t.isResizable(e)){var n=In.fromTable(e),r=Zr(n),o=Jr(n);du(n,t,e,r,o)}},gu=function(t,e){var n=De(t.parent(),"."+iu);M(n,e)},hu=function(t){gu(t,(function(t){Qe(t,"display","none")}))},pu=function(t){gu(t,(function(t){Qe(t,"display","block")}))},vu=ru("resizer-bar-dragging"),bu=function(t){var e=ou(),n=function(t,e){void 0===e&&(e={});var n=void 0!==e.mode?e.mode:Qa;return La(t,n,e)}(e,{}),r=T.none(),o=function(t,e){return T.from(je(t,e))};e.events.drag.bind((function(t){o(t.target,"data-row").each((function(e){var n=sn(t.target,"top");Qe(t.target,"top",n+t.yDelta+"px")})),o(t.target,"data-column").each((function(e){var n=sn(t.target,"left");Qe(t.target,"left",n+t.xDelta+"px")}))}));var i=function(t,e){return sn(t,e)-on(t,"data-initial-"+e,0)};n.events.stop.bind((function(){e.get().each((function(e){r.each((function(n){o(e,"data-row").each((function(t){var r=i(e,"top");We(e,"data-initial-top"),l.trigger.adjustHeight(n,r,parseInt(t,10))})),o(e,"data-column").each((function(t){var r=i(e,"left");We(e,"data-initial-left"),l.trigger.adjustWidth(n,r,parseInt(t,10))})),mu(t,n)}))}))}));var a=function(r,o){l.trigger.startAdjust(),e.assign(r),Fe(r,"data-initial-"+o,sn(r,o)),Ga(r,vu),Qe(r,"opacity","0.2"),n.go(t.parent())},u=ja(t.parent(),"mousedown",(function(t){var e;e=t.target,Ka(e,au)&&a(t.target,"top"),function(t){return Ka(t,uu)}(t.target)&&a(t.target,"left")})),c=function(e){return Lt(e,t.view())},s=ja(t.view(),"mouseover",(function(e){var n;(n=e.target,Ie(n,"table",c).filter(tu)).fold((function(){Ee(e.target)&&cu(t)}),(function(e){r=T.some(e),mu(t,e)}))})),l=Ea({adjustHeight:Oa(["table","delta","row"]),adjustWidth:Oa(["table","delta","column"]),startAdjust:Oa([])});return{destroy:function(){u.unbind(),s.unbind(),n.destroy(),cu(t)},refresh:function(e){mu(t,e)},on:n.on,off:n.off,hideBars:p(hu,t),showBars:p(pu,t),events:l.registry}},yu=function(t,e,n){var r=So,o=Eo,i=bu(t),a=Ea({beforeResize:Oa(["table","type"]),afterResize:Oa(["table","type"]),startDrag:Oa([])});return i.events.adjustHeight.bind((function(t){var e=t.table;a.trigger.beforeResize(e,"row");var n=r.delta(t.delta,e);ea(e,n,t.row,r),a.trigger.afterResize(e,"row")})),i.events.startAdjust.bind((function(t){a.trigger.startDrag()})),i.events.adjustWidth.bind((function(t){var r=t.table;a.trigger.beforeResize(r,"col");var i=o.delta(t.delta,r),u=n(r);ta(r,i,t.column,e,u),a.trigger.afterResize(r,"col")})),{on:i.on,off:i.off,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:a.registry}},wu=function(t,e){return t.fire("newrow",{node:e})},xu=function(t,e){return t.fire("newcell",{node:e})},Cu=function(t,e,n){t.fire("TableModified",X(X({},n),{table:e}))},Su={structure:!1,style:!0},ku={structure:!0,style:!1},Tu={structure:!0,style:!0},Ou={"border-collapse":"collapse",width:"100%"},Eu=A(5,(function(t){var e=t+1+"px";return{title:e,value:e}})),_u=D(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(function(t){return{title:t,value:t.toLowerCase()}})),Ru={border:"1"},Nu="preservetable",Au=function(t){return t.getParam("table_sizing_mode","auto")},Du=function(t){return t.getParam("table_responsive_width")},Mu=function(t){return t.getParam("table_border_widths",Eu,"array")},Bu=function(t){return t.getParam("table_border_styles",_u,"array")},zu=function(t){return t.getParam("table_default_attributes",Ru,"object")},Pu=function(t){return t.getParam("table_default_styles",function(t){var e;if(Wu(t)){var n=t.dom,r=null!==(e=n.getParent(t.selection.getStart(),n.isBlock))&&void 0!==e?e:t.getBody(),o=Xr(Mt.fromDom(r));return X(X({},Ou),{width:o+"px"})}return qu(t)?$t(Ou,(function(t,e){return"width"!==e})):Ou}(t),"object")},Lu=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},Iu=function(t){return t.getParam("table_row_advtab",!0,"boolean")},Hu=function(t){return t.getParam("table_advtab",!0,"boolean")},Fu=function(t){return t.getParam("table_style_by_css",!1,"boolean")},Vu=function(t){return t.getParam("table_cell_class_list",[],"array")},ju=function(t){return t.getParam("table_class_list",[],"array")},Uu=function(t){return"relative"===Au(t)||!0===Du(t)},Wu=function(t){return"fixed"===Au(t)||!1===Du(t)},qu=function(t){return"responsive"===Au(t)},$u=function(t){return t.getParam("table_use_colgroups",!1,"boolean")},Gu=function(t){var e="section",n=t.getParam("table_header_type",e,"string");return R(["section","cells","sectionCells","auto"],n)?n:e},Ku=function(t){var e=t.getParam("table_column_resizing",Nu,"string");return I(["preservetable","resizetable"],(function(t){return t===e})).getOr(Nu)},Xu=function(t){return"preservetable"===Ku(t)},Yu=function(t){return"resizetable"===Ku(t)},Ju=function(t){var e=t.getParam("table_clone_elements");return r(e)?T.some(e.split(/[ ,]/)):Array.isArray(e)?T.some(e):T.none()},Qu=function(t){return t.getParam("table_background_color_map",[],"array")},Zu=function(t){return t.getParam("table_border_color_map",[],"array")},tc=function(t,e){return Uu(t)?ci(e):Wu(t)?ui(e):ai(e)},ec=function(t){We(t,"width")},nc=function(t){var e=$o(t);xa(t,T.some(e),T.none()),ec(t)},rc=function(t){var e=function(t){return Gr(t)+"px"}(t);xa(t,T.some(e),T.none()),ec(t)},oc=function(t){rn(t,"width");var e=pn(t),n=e.length>0?e:hn(t);M(n,(function(t){rn(t,"width"),ec(t)})),ec(t)},ic=function(){var t=Mt.fromTag("div");return Ze(t,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Qn(_e(Mt.fromDom(document)),t),t},ac="bar-",uc=function(t){return"false"!==je(t,"data-mce-resize")},cc=function(t){var e,n,o=T.none(),i=T.none(),a=T.none(),u=function(t){return"TABLE"===t.nodeName},c=function(){return i},s=function(e){return tc(t,e)},l=function(){return Xu(t)?ca():ua()},f=function(r,o,i){var a=it(o,"e");if(""===n&&nc(r),i!==e&&""!==n){Qe(r,"width",n);var u=l(),c=s(r),f=Xu(t)||a?function(t){return Ta(t).columns}(r)-1:0;ta(r,i-e,f,u,c)}else if(function(t){return/^(\d+(\.\d+)?)%$/.test(t)}(n)){var d=parseFloat(n.replace("%",""));Qe(r,"width",i*d/e+"%")}(function(t){return/^(\d+(\.\d+)?)px$/.test(t)})(n)&&function(t){var e=In.fromTable(t);In.hasColumns(e)||M(hn(t),(function(t){var e=tn(t,"width");Qe(t,"width",e),We(t,"width")}))}(r)};return t.on("init",(function(){var e=function(t,e){return t.inline?la(Ei(t),ic(),e):sa(Mt.fromDom(t.getDoc()),e)}(t,uc);if(a=T.some(e),function(t){var e=t.getParam("object_resizing",!0);return r(e)?"table"===e:e}(t)&&function(t){return t.getParam("table_resize_bars",!0,"boolean")}(t)){var n=l(),u=yu(e,n,s);u.on(),u.events.startDrag.bind((function(e){o=T.some(t.selection.getRng())})),u.events.beforeResize.bind((function(e){var n=e.table.dom;!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(t,n,_i(n),Ri(n),ac+e.type)})),u.events.afterResize.bind((function(e){var n=e.table,r=n.dom;Di(n),o.each((function(e){t.selection.setRng(e),t.focus()})),function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(t,r,_i(r),Ri(r),ac+e.type),t.undoManager.add()})),i=T.some(u)}})),t.on("ObjectResizeStart",(function(r){var o=r.target;if(u(o)){var i=Mt.fromDom(o);M(t.dom.select(".mce-clonedresizable"),(function(e){t.dom.addClass(e,"mce-"+Ku(t)+"-columns")})),!Sa(i)&&Wu(t)?rc(i):!Ca(i)&&Uu(t)&&nc(i),ka(i)&&ot(r.origin,ac)&&nc(i),e=r.width,n=qu(t)?"":function(t,e){var n=t.dom.getStyle(e,"width")||t.dom.getAttrib(e,"width");return T.from(n).filter(ut)}(t,o).getOr("")}})),t.on("ObjectResized",(function(e){var n=e.target;if(u(n)){var r=Mt.fromDom(n),o=e.origin;ot(o,"corner-")&&f(r,o,e.width),Di(r),Cu(t,r.dom,Su)}})),t.on("SwitchMode",(function(){c().each((function(e){t.mode.isReadOnly()?e.hideBars():e.showBars()}))})),{lazyResize:c,lazyWire:function(){return a.getOr(sa(Mt.fromDom(t.getBody()),uc))},destroy:function(){i.each((function(t){t.destroy()})),a.each((function(e){!function(t,e){t.inline&&rr(e.parent())}(t,e)}))}}},sc=function(t,e){return{element:t,offset:e}},lc=function(t,e,n){return t.property().isText(e)&&0===t.property().getText(e).trim().length||t.property().isComment(e)?n(e).bind((function(e){return lc(t,e,n).orThunk((function(){return T.some(e)}))})):T.none()},fc=function(t,e){return t.property().isText(e)?t.property().getText(e).length:t.property().children(e).length},dc=function(t,e){var n=lc(t,e,t.query().prevSibling).getOr(e);if(t.property().isText(n))return sc(n,fc(t,n));var r=t.property().children(n);return r.length>0?dc(t,r[r.length-1]):sc(n,fc(t,n))},mc=dc,gc=lr(),hc=function(t,e){1===an(t,"colspan")&&function(t){return Vo(t).bind((function(t){return No(t,["fixed","relative","empty"])}))}(t).each((function(n){var r=n.value/2;qo(t,r,n.unit),qo(e,r,n.unit)}))},pc=de("th"),vc=function(t){return j(t,(function(t){return pc(t.element)}))},bc=function(t,e){return t&&e?"sectionCells":t?"section":"cells"},yc=function(t){var e="thead"===t.section,n=$e(wc(t.cells),"th");return e||n?{type:"header",subType:bc(e,n)}:"tfoot"===t.section?{type:"footer"}:{type:"body"}},wc=function(t){var e=z(t,(function(t){return pc(t.element)}));return 0===e.length?T.some("td"):e.length===t.length?T.some("th"):T.none()},xc=function(t,e,n){return ne(n(t.element,e),!0,t.isLocked)},Cc=function(t,e){return t.section!==e?re(t.element,t.cells,e,t.isNew):t},Sc=function(){return{transformRow:Cc,transformCell:function(t,e,n){var r=n(t.element,e),o="td"!==oe(r)?function(t,e){var n=Ir(t,e);Xn(t,n);var r=ye(t);return er(n,r),rr(t),n}(r,"td"):r;return ne(o,t.isNew,t.isLocked)}}},kc=function(){return{transformRow:Cc,transformCell:xc}},Tc=function(){return{transformRow:function(t,e){return Cc(t,"thead"===e?"tbody":e)},transformCell:xc}},Oc=function(t,e){switch(function(t){return K(t.all,(function(t){var e=yc(t);return"header"===e.type?T.from(e.subType):T.none()}))}(In.fromTable(t)).getOr(e)){case"section":return Sc();case"sectionCells":return kc();case"cells":return Tc()}},Ec=Sc,_c=kc,Rc=Tc,Nc=function(){return{transformRow:g,transformCell:xc}},Ac=function(t,e,n,r){n===r?We(t,e):Fe(t,e,n)},Dc=function(t,e,n){G(Ae(t,e)).fold((function(){return Jn(t,n)}),(function(t){return Yn(t,n)}))},Mc=function(t,e){var n=[],r=[],o=function(t){return D(t,(function(t){t.isNew&&n.push(t.element);var e=t.element;return nr(e),M(t.cells,(function(t){t.isNew&&r.push(t.element),Ac(t.element,"colspan",t.colspan,1),Ac(t.element,"rowspan",t.rowspan,1),Qn(e,t.element)})),e}))},i=function(t){return V(t,(function(t){return D(t.cells,(function(t){return Ac(t.element,"span",t.colspan,1),t.element}))}))},a=function(e,n){var r=function(t,e){var n=Pe(t,e).getOrThunk((function(){var n=Mt.fromTag(e,me(t).dom);return"thead"===e?Dc(t,"caption,colgroup",n):"colgroup"===e?Dc(t,"caption",n):Qn(t,n),n}));return nr(n),n}(t,n),a=("colgroup"===n?i:o)(e);er(r,a)},u=function(e,n){e.length>0?a(e,n):function(e){Pe(t,e).each(rr)}(n)},c=[],s=[],l=[],f=[];return M(e,(function(t){switch(t.section){case"thead":c.push(t);break;case"tbody":s.push(t);break;case"tfoot":l.push(t);break;case"colgroup":f.push(t)}})),u(f,"colgroup"),u(c,"thead"),u(s,"tbody"),u(l,"tfoot"),{newRows:n,newCells:r}},Bc=function(t,e){if(0===t.length)return 0;var n=t[0];return H(t,(function(t){return!e(n.element,t.element)})).getOr(t.length)},zc=function(t,e,n,r){var o=function(t,e){return t[e]}(t,e),i="colgroup"===o.section;return{colspan:Bc(o.cells.slice(n),r),rowspan:i?1:Bc(function(t,e){return D(t,(function(t){return En(t,e)}))}(t.slice(e),n),r)}},Pc=function(t,e){var n=D(t,(function(t){return D(t.cells,w)}));return D(t,(function(r,o){var i=V(r.cells,(function(r,i){if(!1===n[o][i]){var a=zc(t,o,i,e);return function(t,e,r,o){for(var i=t;i<t+r;i++)for(var a=e;a<e+o;a++)n[i][a]=!0}(o,i,a.rowspan,a.colspan),[(u=r.element,c=a.rowspan,s=a.colspan,l=r.isNew,{element:u,rowspan:c,colspan:s,isNew:l})]}return[];var u,c,s,l}));return function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}}(r.element,i,r.section,r.isNew)}))},Lc=function(t,e,n){var r=[];M(t.colgroups,(function(o){for(var i=[],a=0;a<t.grid.columns;a++){var u=In.getColumnAt(t,a).map((function(t){return ne(t.element,n,!1)})).getOrThunk((function(){return ne(e.colGap(),!0,!1)}));i.push(u)}r.push(re(o.element,i,"colgroup",n))}));for(var o=0;o<t.grid.rows;o++){for(var i=[],a=0;a<t.grid.columns;a++){var u=In.getAt(t,o,a).map((function(t){return ne(t.element,n,t.isLocked)})).getOrThunk((function(){return ne(e.gap(),!0,!1)}));i.push(u)}var c=t.all[o],s=re(c.element,i,c.section,n);r.push(s)}return r},Ic=function(t){return Pc(t,Lt)},Hc=function(t,e){return K(t.all,(function(t){return I(t.cells,(function(t){return Lt(e,t.element)}))}))},Fc=function(t,e,n){var r=D(e.selection,(function(e){return gn(e).bind((function(e){return Hc(t,e)})).filter(n)})),o=Ge(r);return Xe(o.length>0,o)},Vc=function(t,e,n,r,o){return function(i,a,u,c,s){var l=In.fromTable(a),f=T.from(null==s?void 0:s.section).getOrThunk(Nc);return e(l,u).map((function(e){var n=function(t,e){return Lc(t,e,!1)}(l,c),r=t(n,e,Lt,o(c),f),i=Bn(r.grid);return{info:e,grid:Ic(r.grid),cursor:r.cursor,lockedColumns:i}})).bind((function(t){var e=Mc(a,t.grid),o=T.from(null==s?void 0:s.sizing).getOrThunk((function(){return ai(a)})),u=T.from(null==s?void 0:s.resize).getOrThunk(ca);return n(a,t.grid,t.info,{sizing:o,resize:u,section:f}),r(a),mu(i,a),We(a,Dn),t.lockedColumns.length>0&&Fe(a,Dn,t.lockedColumns.join(",")),T.some({cursor:t.cursor,newRows:e.newRows,newCells:e.newCells})}))}},jc=function(t,e){return Fc(t,e,x).map((function(t){return{cells:t,generators:e.generators,clipboard:e.clipboard}}))},Uc=function(t,e){return Fc(t,e,x)},Wc=function(t,e){return Fc(t,e,(function(t){return!t.isLocked}))},qc=function(t,e){return j(e,(function(e){return function(t,e){return Hc(t,e).exists((function(t){return!t.isLocked}))}(t,e)}))},$c=function(t,e){return function(t,e){return e.mergable}(0,e).filter((function(e){return qc(t,e.cells)}))},Gc=function(t,e){return function(t,e){return e.unmergable}(0,e).filter((function(e){return qc(t,e)}))},Kc=function(t,e,n,r){for(var o=Nn(t).rows,i=!0,a=0;a<o.length;a++)for(var u=0;u<Rn(o[0]);u++){var c=o[a],s=En(c,u),l=n(s.element,e);!0===l&&!1===i?Tn(c,u,ne(r(),!0,s.isLocked)):!0===l&&(i=!1)}return t},Xc=function(t,e,n,r){var o=Nn(t).rows;if(e>0&&e<o.length){var i=function(t,e){return L(t,(function(t,n){return N(t,(function(t){return e(t.element,n.element)}))?t:t.concat([n])}),[])}(o[e-1].cells,n);M(i,(function(t){for(var i=T.none(),a=e;a<o.length;a++)for(var u=function(e){var u=o[a],c=En(u,e);n(c.element,t.element)&&(i.isNone()&&(i=T.some(r())),i.each((function(t){Tn(u,e,ne(t,!0,c.isLocked))})))},c=0;c<Rn(o[0]);c++)u(c)}))}return t},Yc=function(t){return{isValue:x,isError:w,getOr:m(t),getOrThunk:m(t),getOrDie:m(t),or:function(e){return Yc(t)},orThunk:function(e){return Yc(t)},fold:function(e,n){return n(t)},map:function(e){return Yc(e(t))},mapError:function(e){return Yc(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return T.some(t)}}},Jc=function(t){return{isValue:w,isError:x,getOr:g,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:g,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Jc(t)},mapError:function(e){return Jc(e(t))},each:d,bind:function(e){return Jc(t)},exists:w,forall:x,toOptional:T.none}},Qc={value:Yc,error:Jc,fromOption:function(t,e){return t.fold((function(){return Jc(e)}),Yc)}},Zc=function(t,e){return{rowDelta:0,colDelta:Rn(t[0])-Rn(e[0])}},ts=function(t,e){return{rowDelta:t.length-e.length,colDelta:0}},es=function(t,e,n,r){var o="colgroup"===e.section?n.col:n.cell;return A(t,(function(t){return ne(o(),!0,r(t))}))},ns=function(t,e,n,r){var o=t[t.length-1];return t.concat(A(e,(function(){var t="colgroup"===o.section?n.colgroup:n.row,e=An(o,t,g),i=es(e.cells.length,e,n,(function(t){return Jt(r,t.toString())}));return On(e,i)})))},rs=function(t,e,n,r){return D(t,(function(t){var o=es(e,t,n,w);return Sn(t,r,o)}))},os=function(t,e,n){var r=e.colDelta<0?rs:g,o=e.rowDelta<0?ns:g,i=Bn(t),a=Rn(t[0]),u=N(i,(function(t){return t===a-1})),c=r(t,Math.abs(e.colDelta),n,u?a-1:a),s=Bn(c);return o(c,Math.abs(e.rowDelta),n,U(s,x))},is=function(t,e,n,r){var o=p(r,En(t[e],n).element),i=t[e];return t.length>1&&Rn(i)>1&&(n>0&&o(_n(i,n-1))||n<i.cells.length-1&&o(_n(i,n+1))||e>0&&o(_n(t[e-1],n))||e<t.length-1&&o(_n(t[e+1],n)))},as=function(t,e,n){return z(n,(function(n){return n>=t.column&&n<=Rn(e[0])+t.column}))},us=function(t,e,n,r,o){var i=Bn(e),a=function(t,e,n){var r=Rn(e[0]),o=Nn(e).cols.length+t.row,i=A(r-t.column,(function(e){return e+t.column}));return{row:o,column:I(i,(function(t){return j(n,(function(e){return e!==t}))})).getOr(r-1)}}(t,e,i),u=Nn(n).rows,c=as(a,u,i);return function(t,e,n){if(t.row>=e.length||t.column>Rn(e[0]))return Qc.error("invalid start address out of table bounds, row: "+t.row+", column: "+t.column);var r=e.slice(t.row),o=r[0].cells.slice(t.column),i=Rn(n[0]),a=n.length;return Qc.value({rowDelta:r.length-a,colDelta:o.length-i})}(a,e,u).map((function(t){var n=X(X({},t),{colDelta:t.colDelta-c.length}),i=os(e,n,r),s=Bn(i),l=as(a,u,s);return function(t,e,n,r,o,i){for(var a=t.row,u=t.column,c=a+n.length,s=u+Rn(n[0])+i.length,l=U(i,x),f=a;f<c;f++)for(var d=0,m=u;m<s;m++)if(l[m])d++;else{is(e,f,m,o)&&Kc(e,_n(e[f],m),o,r.cell);var g=m-u-d,h=En(n[f-a],g),p=h.element,v=r.replace(p);Tn(e[f],m,ne(v,!0,h.isLocked))}return e}(a,i,u,r,o,l)}))},cs=function(t,e,n,r,o){!function(t,e,n,r){e>0&&e<t[0].cells.length&&M(t,(function(t){var o=t.cells[e-1],i=t.cells[e];n(i.element,o.element)&&Tn(t,e,ne(r(),!0,i.isLocked))}))}(e,t,o,r.cell);var i=ts(n,e),a=os(n,i,r),u=ts(e,a),c=os(e,u,r);return D(c,(function(e,n){return Sn(e,t,a[n].cells)}))},ss=function(t,e,n,r,o){Xc(e,t,o,r.cell);var i=Bn(e),a=Zc(e,n),u=X(X({},a),{colDelta:a.colDelta-i.length}),c=os(e,u,r),s=Nn(c),l=s.cols,f=s.rows,d=Bn(c),m=Zc(n,e),g=X(X({},m),{colDelta:m.colDelta+d.length}),h=function(t,e,n){return D(t,(function(t){return L(n,(function(n,r){var o=es(1,t,e,x)[0];return kn(n,r,o)}),t)}))}(n,r,d),p=os(h,g,r);return l.concat(f.slice(0,t)).concat(p).concat(f.slice(t,f.length))},ls=function(t,e,n,r,o){var i=Nn(t),a=i.rows,u=i.cols,c=a.slice(0,e),s=a.slice(e),l=function(t,e,n,r){return An(t,(function(t){return r(t,n)}),e)}(a[n],(function(t,n){return e>0&&e<a.length&&r(_n(a[e-1],n),_n(a[e],n))?En(a[e],n):ne(o(t.element,r),!0,t.isLocked)}),r,o);return u.concat(c).concat([l]).concat(s)},fs=function(t,e,n,r,o){return D(t,(function(t){var i=e>0&&e<Rn(t)&&r(_n(t,e-1),_n(t,e)),a=function(t,e,n,r,o,i,a){if("colgroup"!==n&&r)return En(t,e);var u=En(t,o);return ne(a(u.element,i),!0,!1)}(t,e,t.section,i,n,r,o);return kn(t,e,a)}))},ds=function(t,e,n,r){return function(t,e,n,r){return void 0!==_n(t[e],n)&&e>0&&r(_n(t[e-1],n),_n(t[e],n))}(t,e,n,r)||function(t,e,n){return e>0&&n(_n(t,e-1),_n(t,e))}(t[e],n,r)},ms=function(t,e,n,r){var o=function(t){return function(t){return"row"===t?cn(e):un(e)}(t)?t+"group":t};return t?pc(e)?o(n):null:r&&pc(e)?o("row"===n?"col":"row"):null},gs=function(t,e,n){return ne(n(t.element,e),!0,t.isLocked)},hs=function(t,e,n,r,o,i,a){return D(t,(function(t,u){return function(t,e){var n=t.cells,r=D(n,e);return re(t.element,r,t.section,t.isNew)}(t,(function(t,c){if(function(t){return N(e,(function(e){return n(t.element,e.element)}))}(t)){var s=a(t,u,c)?o(t,n,r):t;return i(s,u,c).each((function(t){var e,n;e=s.element,n={scope:T.from(t)},Ut(n,(function(t,n){t.fold((function(){We(e,n)}),(function(t){He(e.dom,n,t)}))}))})),s}return t}))}))},ps=function(t,e,n){return V(t,(function(r,o){return ds(t,o,e,n)?[]:[En(r,e)]}))},vs=function(t,e,n,r,o){var i=Nn(t).rows,a=V(e,(function(t){return ps(i,t,r)})),u=D(t,(function(t){return vc(t.cells)})),c=function(t,e){return j(e,g)&&vc(t)?x:function(t,n,r){return!("th"===oe(t.element)&&e[n])}}(a,u),s=function(t,e){return function(n,r){return T.some(ms(t,n.element,"row",e[r]))}}(n,u);return hs(t,a,r,o,gs,s,c)},bs=function(t,e,n,r,o,i,a){var u=Nn(t),c=u.cols,s=u.rows,l=s[e[0]],f=V(e,(function(t){return function(t,e,n){var r=t[e];return V(r.cells,(function(r,o){return ds(t,e,o,n)?[]:[r]}))}(s,t,o)})),d=D(l.cells,(function(t,e){return vc(ps(s,e,o))})),m=Y([],s,!0);M(e,(function(t){m[t]=a.transformRow(s[t],n)}));var h=c.concat(m),p=function(t,e){return j(e,g)&&vc(t.cells)?x:function(t,n,r){return!("th"===oe(t.element)&&e[r])}}(l,d),v=function(t,e){return function(n,r,o){return T.some(ms(t,n.element,"col",e[o]))}}(r,d);return hs(h,f,o,i,a.transformCell,v,p)},ys=function(t,e,n,r){var o=Nn(t).rows,i=D(e,(function(t){return En(o[t.row],t.column)}));return hs(t,i,n,r,gs,T.none,x)},ws=function(t){return L(t,(function(t,e){return N(t,(function(t){return t.column===e.column}))?t:t.concat([e])}),[]).sort((function(t,e){return t.column-e.column}))},xs=de("col"),Cs=de("colgroup"),Ss=function(t){return"tr"===oe(t)||Cs(t)},ks=function(t){return{element:t,colspan:on(t,"colspan",1),rowspan:on(t,"rowspan",1)}},Ts=function(t){return Ue(t,"scope").map((function(t){return t.substr(0,3)}))},Os=function(t,e){void 0===e&&(e=ks);var n=function(n){if(Ss(n))return Cs((o={element:n}).element)?t.colgroup(o):t.row(o);var o,i=function(e){return xs(e.element)?t.col(e):t.cell(e)}(e(n));return r=T.some({item:n,replacement:i}),i},r=T.none();return{getOrInit:function(t,e){return r.fold((function(){return n(t)}),(function(r){return e(t,r.item)?r.replacement:n(t)}))}}},Es=function(t){return function(e){var n=[],r=function(r){var o="td"===t?{scope:null}:{},i=e.replace(r,t,o);return n.push({item:r,sub:i}),i};return{replaceOrInit:function(t,e){return Ss(t)||xs(t)?t:function(t,e){return I(n,(function(n){return e(n.item,t)}))}(t,e).fold((function(){return r(t)}),(function(n){return e(t,n.item)?n.sub:r(t)}))}}}},_s=function(t){return{unmerge:function(e){var n=Ts(e);return n.each((function(t){return Fe(e,"scope",t)})),function(){var r=t.cell({element:e,colspan:1,rowspan:1});return rn(r,"width"),rn(e,"width"),n.each((function(t){return Fe(r,"scope",t)})),r}},merge:function(t){return rn(t[0],"width"),function(){var e=Ge(D(t,Ts));if(0===e.length)return T.none();var n=e[0],r=["row","col"];return N(e,(function(t){return t!==n&&R(r,t)}))?T.none():T.from(n)}().fold((function(){return We(t[0],"scope")}),(function(e){return Fe(t[0],"scope",e+"group")})),m(t[0])}}},Rs=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Ns=lr(),As=function(t){return function(t,e){var n=t.property().name(e);return R(Rs,n)}(Ns,t)},Ds=function(t){return function(t,e){var n=t.property().name(e);return R(["ol","ul"],n)}(Ns,t)},Ms=function(t){return function(t,e){return R(["br","img","hr","input"],t.property().name(e))}(Ns,t)},Bs=function(t){var e,n=function(t){return"br"===oe(t)},r=function(t){return hi(t).bind((function(e){var r=be(e).map((function(t){return!!As(t)||!!Ms(t)&&"img"!==oe(t)})).getOr(!1);return he(e).map((function(o){return!0===r||function(t){return"li"===oe(t)||Be(t,Ds).isSome()}(o)||n(e)||As(o)&&!Lt(t,o)?[]:[Mt.fromTag("br")]}))})).getOr([])},o=0===(e=V(t,(function(t){var e=ye(t);return function(t){return j(t,(function(t){return n(t)||se(t)&&0===ar(t).trim().length}))}(e)?[]:e.concat(r(t))}))).length?[Mt.fromTag("br")]:e;nr(t[0]),er(t[0],o)},zs=function(t){return tu(t,!0)},Ps=function(t){0===hn(t).length&&rr(t)},Ls=function(t,e){return{grid:t,cursor:e}},Is=function(t,e,n){var r,o,i=Nn(t).rows;return T.from(null===(o=null===(r=i[e])||void 0===r?void 0:r.cells[n])||void 0===o?void 0:o.element).filter(zs).orThunk((function(){return function(t){return K(t,(function(t){return K(t.cells,(function(t){var e=t.element;return Xe(zs(e),e)}))}))}(i)}))},Hs=function(t,e,n){var r=Is(t,e,n);return Ls(t,r)},Fs=function(t){return L(t,(function(t,e){return N(t,(function(t){return t.row===e.row}))?t:t.concat([e])}),[]).sort((function(t,e){return t.row-e.row}))},Vs=function(t,e){return function(n,r,o,i,a){var u=Fs(r),c=D(u,(function(t){return t.row})),s=bs(n,c,t,e,o,i.replaceOrInit,a);return Hs(s,r[0].row,r[0].column)}},js=Vs("thead",!0),Us=Vs("tbody",!1),Ws=Vs("tfoot",!1),qs=function(t,e,n){var r=function(t,e){return wn(t,(function(){return e}))}(t,n.section),o=In.generate(r);return Lc(o,e,!0)},$s=function(t,e,n,r){return function(t,e,n,r){var o=In.generate(e),i=r.getWidths(o,r);Zi(o,i,r)}(0,e,0,r.sizing)},Gs=function(t,e,n,r){return function(t,e,n,r,o){var i=In.generate(e),a=r.getWidths(i,r),u=r.pixelWidth(),c=o.calcRedestributedWidths(a,u,n.pixelDelta,r.isRelative),s=c.newSizes,l=c.delta;Zi(i,s,r),r.adjustTableWidth(l)}(0,e,n,r.sizing,r.resize)},Ks=function(t,e){return N(e,(function(t){return 0===t.column&&t.isLocked}))},Xs=function(t,e){return N(e,(function(e){return e.column+e.colspan>=t.grid.columns&&e.isLocked}))},Ys=function(t,e){var n=Jr(t),r=ws(e);return L(r,(function(t,e){return t+n[e.column].map(Kr).getOr(0)}),0)},Js=function(t){return function(e,n){return Uc(e,n).filter((function(n){return!(t?Ks:Xs)(e,n)})).map((function(t){return{details:t,pixelDelta:Ys(e,t)}}))}},Qs=function(t){return function(e,n){return jc(e,n).filter((function(n){return!(t?Ks:Xs)(e,n.cells)}))}},Zs=Es("th"),tl=Es("td"),el=Vc((function(t,e,n,r){var o=e[0].row,i=Fs(e),a=P(i,(function(t,e){return{grid:ls(t.grid,o,e.row+t.delta,n,r.getOrInit),delta:t.delta+1}}),{grid:t,delta:0}).grid;return Hs(a,o,e[0].column)}),Uc,d,d,Os),nl=Vc((function(t,e,n,r){var o=Fs(e),i=o[o.length-1],a=i.row+i.rowspan,u=P(o,(function(t,e){return ls(t,a,e.row,n,r.getOrInit)}),t);return Hs(u,a,e[0].column)}),Uc,d,d,Os),rl=Vc((function(t,e,n,r){var o=e.details,i=ws(o),a=i[0].column,u=P(i,(function(t,e){return{grid:fs(t.grid,a,e.column+t.delta,n,r.getOrInit),delta:t.delta+1}}),{grid:t,delta:0}).grid;return Hs(u,o[0].row,a)}),Js(!0),Gs,d,Os),ol=Vc((function(t,e,n,r){var o=e.details,i=o[o.length-1],a=i.column+i.colspan,u=ws(o),c=P(u,(function(t,e){return fs(t,a,e.column,n,r.getOrInit)}),t);return Hs(c,o[0].row,a)}),Js(!1),Gs,d,Os),il=Vc((function(t,e,n,r){var o=ws(e.details),i=function(t,e){return V(t,(function(t){var n=t.cells,r=P(e,(function(t,e){return e>=0&&e<t.length?t.slice(0,e).concat(t.slice(e+1)):t}),n);return r.length>0?[re(t.element,r,t.section,t.isNew)]:[]}))}(t,D(o,(function(t){return t.column}))),a=i.length>0?i[0].cells.length-1:0;return Hs(i,o[0].row,Math.min(o[0].column,a))}),(function(t,e){return Wc(t,e).map((function(e){return{details:e,pixelDelta:-Ys(t,e)}}))}),Gs,Ps,Os),al=Vc((function(t,e,n,r){var o=Fs(e),i=function(t,e,n){var r=Nn(t),o=r.rows;return r.cols.concat(o.slice(0,e)).concat(o.slice(n+1))}(t,o[0].row,o[o.length-1].row),a=i.length>0?i.length-1:0;return Hs(i,Math.min(e[0].row,a),e[0].column)}),Uc,d,Ps,Os),ul=Vc((function(t,e,n,r){var o=ws(e),i=D(o,(function(t){return t.column})),a=vs(t,i,!0,n,r.replaceOrInit);return Hs(a,e[0].row,e[0].column)}),Wc,d,d,Zs),cl=Vc((function(t,e,n,r){var o=ws(e),i=D(o,(function(t){return t.column})),a=vs(t,i,!1,n,r.replaceOrInit);return Hs(a,e[0].row,e[0].column)}),Wc,d,d,tl),sl=Vc(js,Wc,d,d,Zs),ll=Vc(Us,Wc,d,d,tl),fl=Vc(Ws,Wc,d,d,tl),dl=Vc((function(t,e,n,r){var o=ys(t,e,n,r.replaceOrInit);return Hs(o,e[0].row,e[0].column)}),Wc,d,d,Zs),ml=Vc((function(t,e,n,r){var o=ys(t,e,n,r.replaceOrInit);return Hs(o,e[0].row,e[0].column)}),Wc,d,d,tl),gl=Vc((function(t,e,n,r){var o=e.cells;Bs(o);var i=function(t,e,n,r){var o=Nn(t).rows;if(0===o.length)return t;for(var i=e.startRow;i<=e.finishRow;i++)for(var a=e.startCol;a<=e.finishCol;a++){var u=o[i],c=En(u,a).isLocked;Tn(u,a,ne(r(),!1,c))}return t}(t,e.bounds,0,r.merge(o));return Ls(i,T.from(o[0]))}),$c,$s,d,_s),hl=Vc((function(t,e,n,r){var o=P(e,(function(t,e){return Kc(t,e,n,r.unmerge(e))}),t);return Ls(o,T.from(e[0]))}),Gc,$s,d,_s),pl=Vc((function(t,e,n,r){var o=function(t,e){var n=In.fromTable(t);return Lc(n,e,!0)}(e.clipboard,e.generators),i=function(t,e){return{row:t,column:e}}(e.row,e.column);return us(i,t,o,e.generators,n).fold((function(){return Ls(t,T.some(e.element))}),(function(t){return Hs(t,e.row,e.column)}))}),(function(t,e){return gn(e.element).bind((function(n){return Hc(t,n).map((function(t){return X(X({},t),{generators:e.generators,clipboard:e.clipboard})}))}))}),$s,d,Os),vl=Vc((function(t,e,n,r){var o=Nn(t).rows,i=e.cells[0].column,a=o[e.cells[0].row],u=qs(e.clipboard,e.generators,a),c=cs(i,t,u,e.generators,n);return Hs(c,e.cells[0].row,e.cells[0].column)}),Qs(!0),d,d,Os),bl=Vc((function(t,e,n,r){var o=Nn(t).rows,i=e.cells[e.cells.length-1].column+e.cells[e.cells.length-1].colspan,a=o[e.cells[0].row],u=qs(e.clipboard,e.generators,a),c=cs(i,t,u,e.generators,n);return Hs(c,e.cells[0].row,e.cells[0].column)}),Qs(!1),d,d,Os),yl=Vc((function(t,e,n,r){var o=Nn(t).rows,i=e.cells[0].row,a=o[i],u=qs(e.clipboard,e.generators,a),c=ss(i,t,u,e.generators,n);return Hs(c,e.cells[0].row,e.cells[0].column)}),jc,d,d,Os),wl=Vc((function(t,e,n,r){var o=Nn(t).rows,i=e.cells[e.cells.length-1].row+e.cells[e.cells.length-1].rowspan,a=o[e.cells[0].row],u=qs(e.clipboard,e.generators,a),c=ss(i,t,u,e.generators,n);return Hs(c,e.cells[0].row,e.cells[0].column)}),jc,d,d,Os),xl=function(t,e){var n=In.fromTable(t);return Uc(n,e).bind((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=F(D(n.all,(function(t){return z(t.cells,(function(t){return t.column>=r&&t.column<o}))})));return wc(i)})).getOr("")},Cl=function(t,e){var n=In.fromTable(t);return Uc(n,e).bind(wc).getOr("")},Sl=function(t,e){var n=In.fromTable(t);return Uc(n,e).bind((function(t){var e=t[t.length-1],r=t[0].row,o=e.row+e.rowspan;return function(t){var e=D(t,(function(t){return yc(t).type})),n=R(e,"header"),r=R(e,"footer");if(n||r){var o=R(e,"body");return!n||o||r?n||o||!r?T.none():T.some("footer"):T.some("header")}return T.some("body")}(n.all.slice(r,o))})).getOr("")},kl=function(t,e,n){var r=function(t){return"table"===oe(Ei(t))},o=Ju(t),i=Yu(t)?d:hc,a=function(e){switch(Gu(t)){case"section":return Ec();case"sectionCells":return _c();case"cells":return Rc();default:return Oc(e,"section")}},u=function(n,r){return r.cursor.fold((function(){var r=hn(n);return $(r).filter(Ee).map((function(r){e.clear(n);var o=t.dom.createRng();return o.selectNode(r.dom),t.selection.setRng(o),Fe(r,"data-mce-selected","1"),o}))}),(function(r){var o=mc(gc,r),i=t.dom.createRng();return i.setStart(o.element.dom,o.offset),i.setEnd(o.element.dom,o.offset),t.selection.setRng(i),e.clear(n),T.some(i)}))},c=function(e,n,r,i,c){return function(s,l,f){void 0===f&&(f=!1),Di(s);var d=i(),m=Mt.fromDom(t.getDoc()),g=ki(r,m,o),h={sizing:tc(t,s),resize:Yu(t)?ua():ca(),section:a(s)};return n(s)?e(d,s,l,g,h).bind((function(e){M(e.newRows,(function(e){wu(t,e.dom)})),M(e.newCells,(function(e){xu(t,e.dom)}));var n=u(s,e);return Ee(s)&&(Di(s),f||Cu(t,s.dom,c)),n.map((function(t){return{rng:t,effect:c}}))})):T.none()}};return{deleteRow:c(al,(function(e){return!1===r(t)||Ta(e).rows>1}),d,n,ku),deleteColumn:c(il,(function(e){return!1===r(t)||Ta(e).columns>1}),d,n,ku),insertRowsBefore:c(el,x,d,n,ku),insertRowsAfter:c(nl,x,d,n,ku),insertColumnsBefore:c(rl,x,i,n,ku),insertColumnsAfter:c(ol,x,i,n,ku),mergeCells:c(gl,x,d,n,ku),unmergeCells:c(hl,x,d,n,ku),pasteColsBefore:c(vl,x,d,n,ku),pasteColsAfter:c(bl,x,d,n,ku),pasteRowsBefore:c(yl,x,d,n,ku),pasteRowsAfter:c(wl,x,d,n,ku),pasteCells:c(pl,x,d,n,Tu),makeCellsHeader:c(dl,x,d,n,ku),unmakeCellsHeader:c(ml,x,d,n,ku),makeColumnsHeader:c(ul,x,d,n,ku),unmakeColumnsHeader:c(cl,x,d,n,ku),makeRowsHeader:c(sl,x,d,n,ku),makeRowsBody:c(ll,x,d,n,ku),makeRowsFooter:c(fl,x,d,n,ku),getTableRowType:Sl,getTableCellType:Cl,getTableColType:xl}},Tl={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},Ol=function(t){var e=Mt.fromTag("colgroup");return A(t,(function(){return Qn(e,Mt.fromTag("col"))})),e},El=function(t,e,n,r){return A(t,(function(t){return function(t,e,n,r){for(var o=Mt.fromTag("tr"),i=0;i<t;i++){var a=r<e||i<n?Mt.fromTag("th"):Mt.fromTag("td");i<n&&Fe(a,"scope","row"),r<e&&Fe(a,"scope","col"),Qn(a,Mt.fromTag("br")),Qn(o,a)}return o}(e,n,r,t)}))},_l=function(t,e){t.selection.select(e.dom,!0),t.selection.collapse(!0)},Rl=function(t,e,n,o,i){var a=Pu(t),u={styles:a,attributes:zu(t),colGroups:$u(t)};return t.undoManager.ignore((function(){var r=function(t,e,n,r,o,i){void 0===i&&(i=Tl);var a=Mt.fromTag("table"),u="cells"!==o;Ze(a,i.styles),Ve(a,i.attributes),i.colGroups&&Qn(a,Ol(e));var c=Math.min(t,n);if(u&&n>0){var s=Mt.fromTag("thead");Qn(a,s);var l=El(n,e,"sectionCells"===o?c:0,r);er(s,l)}var f=Mt.fromTag("tbody");Qn(a,f);var d=El(u?t-c:t,e,u?0:n,r);return er(f,d),a}(n,e,i,o,Gu(t),u);Fe(r,"data-mce-id","__mce");var a=function(t){var e=Mt.fromTag("div"),n=Mt.fromDom(t.dom.cloneNode(!0));return Qn(e,n),function(t){return t.dom.innerHTML}(e)}(r);t.insertContent(a),t.addVisual()})),Le(Ei(t),'table[data-mce-id="__mce"]').map((function(e){return Wu(t)?rc(e):qu(t)?oc(e):(Uu(t)||function(t){return r(t)&&-1!==t.indexOf("%")}(a.width))&&nc(e),Di(e),We(e,"data-mce-id"),function(t,e){M(De(e,"tr"),(function(e){wu(t,e.dom),M(De(e,"th,td"),(function(e){xu(t,e.dom)}))}))}(t,e),function(t,e){Le(e,"td,th").each(p(_l,t))}(t,e),e.dom})).getOr(null)},Nl=function(t,e,n,r,o){void 0===r&&(r={});var i=function(t){return f(t)&&t>0};if(i(e)&&i(n)){var a=r.headerRows||0,u=r.headerColumns||0;return Rl(t,n,e,u,a)}return console.error(o),null},Al=function(t){return function(){return t().fold((function(){return[]}),(function(t){return D(t,(function(t){return t.dom}))}))}},Dl=function(t){return function(e){var n=e.length>0?T.some(Oi(e)):T.none();t(n)}},Ml=function(t){return function(e,n,r){void 0===r&&(r={});var o=Nl(t,n,e,r,"Invalid values for insertTable - rows and columns values are required to insert a table.");return t.undoManager.add(),o}},Bl=function(t,e,n){var r=on(t,e,1);1===n||r<=1?We(t,e):Fe(t,e,Math.min(n,r))},zl=function(t,e){var n=In.fromTable(t);return Wc(n,e).map((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=function(t,e,n){if(In.hasColumns(t)){var r=z(In.justColumns(t),(function(t){return t.column>=e&&t.column<n})),o=D(r,(function(t){var r=Lr(t.element);return Bl(r,"span",n-e),r})),i=Mt.fromTag("colgroup");return er(i,o),[i]}return[]}(n,r,o),a=function(t,e,n){return D(t.all,(function(t){var r=z(t.cells,(function(t){return t.column>=e&&t.column<n})),o=D(r,(function(t){var r=Lr(t.element);return Bl(r,"colspan",n-e),r})),i=Mt.fromTag("tr");return er(i,o),i}))}(n,r,o);return Y(Y([],i,!0),a,!0)}))},Pl=function(t,e,n){var r=In.fromTable(t);return Uc(r,e).bind((function(t){var e=Lc(r,n,!1),o=Nn(e).rows.slice(t[0].row,t[t.length-1].row+t[t.length-1].rowspan),i=V(o,(function(t){var e=z(t.cells,(function(t){return!t.isLocked}));return e.length>0?[X(X({},t),{cells:e})]:[]})),a=Ic(i);return Xe(a.length>0,a)})).map((function(t){return function(t){return D(t,(function(t){var e=Pr(t.element);return M(t.cells,(function(t){var n=Lr(t.element);Ac(n,"colspan",t.colspan,1),Ac(n,"rowspan",t.rowspan,1),Qn(e,n)})),e}))}(t)}))},Ll=tinymce.util.Tools.resolve("tinymce.util.Tools"),Il=function(t,e,n){return function(e,r){for(var o=0;o<r.length;o++){var i=t.getStyle(r[o],n);if(void 0===e&&(e=i),e!==i)return""}return e}(undefined,t.select("td,th",e))},Hl=function(t,e,n){n&&t.formatter.apply("align"+n,{},e)},Fl=function(t,e){Ll.each("left center right".split(" "),(function(n){t.formatter.remove("align"+n,{},e)}))},Vl=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],jl=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Ul=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Wl=function(t){return(e=t,n="#",ot(e,n)?function(t,e){return t.substring(e)}(e,n.length):e).toUpperCase();var e,n},ql=function(t){return function(t){return jl.test(t)||Ul.test(t)}(t)?T.some({value:Wl(t)}):T.none()},$l=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Gl=function(t){return function(t){return{value:t}}($l(t.red)+$l(t.green)+$l(t.blue))},Kl=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Xl=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Yl=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},Jl=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),a=parseInt(n,10),u=parseFloat(r);return Yl(o,i,a,u)},Ql=function(t){return ql(t).orThunk((function(){return function(t){if("transparent"===t)return T.some(Yl(0,0,0,0));var e=Kl.exec(t);if(null!==e)return T.some(Jl(e[1],e[2],e[3],"1"));var n=Xl.exec(t);return null!==n?T.some(Jl(n[1],n[2],n[3],n[4])):T.none()}(t).map(Gl)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],a=r[2],u=r[3];return Gl(Yl(o,i,a,u))}))},Zl=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},tf=function(t){var e=Zl(T.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(T.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(T.some(t))}}},ef=function(){var t=tf(d);return X(X({},t),{on:function(e){return t.get().each(e)}})},nf=function(t,e,n,r){return function(o){var i=tf((function(t){return t.unbind()})),a=!ut(r),u=function(){var u=qi(e),c=function(e){return t.formatter.match(n,{value:r},e.dom,a)};a?(o.setActive(!N(u,c)),i.set(t.formatter.formatChanged(n,(function(t){return o.setActive(!t)}),!0))):(o.setActive(j(u,c)),i.set(t.formatter.formatChanged(n,o.setActive,!1,{value:r})))};return t.initialized?u():t.on("init",u),i.clear}},rf=function(t){return Qt(t,"menu")},of=function(t){return D(t,(function(t){var e=t.text||t.title;return rf(t)?{text:e,items:of(t.menu)}:{text:e,value:t.value}}))},af=function(t,e,n,r,o){return D(n,(function(n){var i=n.text||n.title;return rf(n)?{type:"nestedmenuitem",text:i,getSubmenuItems:function(){return af(t,e,n.menu,r,o)}}:{text:i,type:"togglemenuitem",onAction:function(){return o(n.value)},onSetup:nf(t,e,r,n.value)}}))},uf=function(t,e){return function(n){var r;t.execCommand("mceTableApplyCellStyle",!1,((r={})[e]=n,r))}},cf=function(t){return V(t,(function(t){return rf(t)?[X(X({},t),{menu:cf(t.menu)})]:ut(t.value)?[t]:[]}))},sf=function(t,e,n,r,o){return function(i){return i(af(t,e,n,r,o))}},lf=function(t,e,n){var r=D(e,(function(t){return{text:t.title,value:"#"+Ql(t.value).value,type:"choiceitem"}}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:r.length>0?r:void 0,allowCustomColors:!1},onAction:function(e){var r,o="remove"===e.value?"":e.value;t.execCommand("mceTableApplyCellStyle",!1,((r={})[n]=o,r))}}]},ff=function(t){return function(){var e="header"===t.queryCommandValue("mceTableRowType")?"body":"header";t.execCommand("mceTableRowType",!1,{type:e})}},df=function(t){return function(){var e="th"===t.queryCommandValue("mceTableColType")?"td":"th";t.execCommand("mceTableColType",!1,{type:e})}},mf=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:Vl}],gf=function(t){return mf.concat(function(t){var e=of(Vu(t));return e.length>0?T.some({name:"class",type:"listbox",label:"Class",items:e}):T.none()}(t).toArray())},hf=function(t,e){var n=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(of(Bu(t)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===e?[{name:"borderwidth",type:"input",label:"Border width"}].concat(n):n}},pf=function(t){return function(e,n){var r=e.dom;return{setAttrib:function(e,o){t&&!o||r.setAttrib(n,e,o)},setStyle:function(e,o){t&&!o||r.setStyle(n,e,o)},setFormat:function(r,o){t&&!o||(""===o?e.formatter.remove(r,{value:null},n,!0):e.formatter.apply(r,{value:o},n))}}}},vf={normal:pf(!1),ifTruthy:pf(!0)},bf=function(t){return function(e){return ot(e,"rgb")?t.toHex(e):e}},yf=function(t,e){var n=Mt.fromDom(e);return{borderwidth:nn(n,"border-width").getOr(""),borderstyle:nn(n,"border-style").getOr(""),bordercolor:nn(n,"border-color").map(bf(t)).getOr(""),backgroundcolor:nn(n,"background-color").map(bf(t)).getOr("")}},wf=function(t){var e=t[0],n=t.slice(1);return M(n,(function(t){M(Vt(e),(function(n){Ut(t,(function(t,r){var o=e[n];""!==o&&n===r&&o!==t&&(e[n]="")}))}))})),e},xf=function(t,e,n,r){return I(t,(function(t){return!c(n.formatter.matchNode(r,e+t))})).getOr("")},Cf=p(xf,["left","center","right"],"align"),Sf=p(xf,["top","middle","bottom"],"valign"),kf=function(t){return vn(Mt.fromDom(t)).map((function(e){var n={selection:Oi(t.cells)};return Sl(e,n)})).getOr("")},Tf=function(t,e){var n=In.fromTable(t),r=In.justCells(n),o=z(r,(function(t){return N(e,(function(e){return Lt(t.element,e)}))}));return D(o,(function(t){return{element:t.element.dom,column:In.getColumnAt(n,t.column).map((function(t){return t.element.dom}))}}))},Of=function(t,e,n){var r=1===e.length;M(e,(function(e){var o=e.element,i=r?vf.normal(t,o):vf.ifTruthy(t,o);!function(t,e,n){t.setAttrib("scope",n.scope),t.setAttrib("class",n.class),t.setStyle("height",Ai(n.height)),e.setStyle("width",Ai(n.width))}(i,e.column.map((function(e){return r?vf.normal(t,e):vf.ifTruthy(t,e)})).getOr(i),n),Lu(t)&&function(t,e){t.setFormat("tablecellbackgroundcolor",e.backgroundcolor),t.setFormat("tablecellbordercolor",e.bordercolor),t.setFormat("tablecellborderstyle",e.borderstyle),t.setFormat("tablecellborderwidth",Ai(e.borderwidth))}(i,n),r&&(Fl(t,o),function(t,e){Ll.each("top middle bottom".split(" "),(function(n){t.formatter.remove("valign"+n,{},e)}))}(t,o)),n.halign&&Hl(t,o,n.halign),n.valign&&function(t,e,n){n&&t.formatter.apply("valign"+n,{},e)}(t,o,n.valign)}))},Ef=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){!function(t,e,n,r){var o=$t(r,(function(t,e){return n[e]!==t}));Xt(o)>0&&e.length>=1&&vn(e[0]).each((function(n){var i=Tf(n,e),a=Xt($t(o,(function(t,e){return"scope"!==e&&"celltype"!==e})))>0,u=Jt(o,"celltype");(a||Jt(o,"scope"))&&Of(t,i,r),u&&function(t,e){t.execCommand("mceTableCellType",!1,{type:e.celltype,no_events:!0})}(t,r),Cu(t,n.dom,{structure:u,style:a})}))}(t,e,n,o),t.focus()}))},_f=function(t,e){var n=vn(e[0]).map((function(n){return D(Tf(n,e),(function(e){return function(t,e,n,r){var o,i=t.dom,a=r.getOr(e),u=function(t,e){return i.getStyle(t,e)||i.getAttrib(t,e)};return X({width:u(a,"width"),height:u(e,"height"),scope:i.getAttrib(e,"scope"),celltype:(o=e,o.nodeName.toLowerCase()),class:i.getAttrib(e,"class",""),halign:Cf(t,e),valign:Sf(t,e)},n?yf(i,e):{})}(t,e.element,Lu(t),e.column)}))}));return wf(n.getOrDie())},Rf=function(t,e){var n=qi(e);if(0!==n.length){var r=_f(t,n),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:gf(t)},hf(t,"cell")]},i={type:"panel",items:[{type:"grid",columns:2,items:gf(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:Lu(t)?o:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:p(Ef,t,n,r)})}},Nf=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Af=function(t){return Nf.concat(function(t){var e=of(function(t){return t.getParam("table_row_class_list",[],"array")}(t));return e.length>0?T.some({name:"class",type:"listbox",label:"Class",items:e}):T.none()}(t).toArray())},Df=function(t,e,n,r){var o=1===e.length;M(e,(function(e){var i=o?vf.normal(t,e):vf.ifTruthy(t,e);!function(t,e){t.setAttrib("class",e.class),t.setStyle("height",Ai(e.height))}(i,n),Iu(t)&&function(t,e){t.setStyle("background-color",e.backgroundcolor),t.setStyle("border-color",e.bordercolor),t.setStyle("border-style",e.borderstyle)}(i,n),n.align!==r.align&&(Fl(t,e),Hl(t,e,n.align))}))},Mf=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){!function(t,e,n,r){var o=$t(r,(function(t,e){return n[e]!==t}));if(Xt(o)>0){var i=Jt(o,"type"),a=!i||Xt(o)>1;a&&Df(t,e,r,n),i&&function(t,e){t.execCommand("mceTableRowType",!1,{type:e.type,no_events:!0})}(t,r),vn(Mt.fromDom(e[0])).each((function(e){return Cu(t,e.dom,{structure:i,style:a})}))}}(t,e,n,o),t.focus()}))},Bf=function(t){var e,n,r,o,i=(e=Mi(t),n=Fi.selected,r=Wi(e),o=r.bind((function(t){return vn(t)})).map((function(t){return bn(t)})),Ke(r,o,(function(t,e){return z(e,(function(e){return N(Oi(e.dom.cells),(function(e){return"1"===je(e,n)||Lt(e,t)}))}))})).getOr([]));if(0!==i.length){var a=D(i,(function(e){return function(t,e,n){var r=t.dom;return X({height:r.getStyle(e,"height")||r.getAttrib(e,"height"),class:r.getAttrib(e,"class",""),type:kf(e),align:Cf(t,e)},n?yf(r,e):{})}(t,e.dom,Iu(t))})),u=wf(a),c={type:"tabpanel",tabs:[{title:"General",name:"general",items:Af(t)},hf(t,"row")]},s={type:"panel",items:[{type:"grid",columns:2,items:Af(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:Iu(t)?c:s,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:u,onSubmit:p(Mf,t,D(i,(function(t){return t.dom})),u)})}},zf=function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=function(t){return t.getParam("table_appearance_options",!0,"boolean")}(t)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],i=e.length>0?[{type:"listbox",name:"class",label:"Class",items:e}]:[];return r.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(o).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(i)},Pf=function(t,e,n,o){if("TD"===e.tagName||"TH"===e.tagName)r(n)?t.setStyle(e,n,o):t.setStyle(e,n);else if(e.children)for(var i=0;i<e.children.length;i++)Pf(t,e.children[i],n,o)},Lf=function(t,e,n,r){var o=t.dom,i=r.getData(),a=$t(i,(function(t,e){return n[e]!==t}));r.close(),""===i.class&&delete i.class,t.undoManager.transact((function(){if(!e){var n=parseInt(i.cols,10)||1,r=parseInt(i.rows,10)||1;e=Rl(t,n,r,0,0)}if(Xt(a)>0){!function(t,e,n){var r=t.dom,o={},i={};if(o.class=n.class,i.height=Ai(n.height),r.getAttrib(e,"width")&&!Fu(t)?o.width=function(t){return t?t.replace(/px$/,""):""}(n.width):i.width=Ai(n.width),Fu(t)?(i["border-width"]=Ai(n.border),i["border-spacing"]=Ai(n.cellspacing)):(o.border=n.border,o.cellpadding=n.cellpadding,o.cellspacing=n.cellspacing),Fu(t)&&e.children)for(var a=0;a<e.children.length;a++)Pf(r,e.children[a],{"border-width":Ai(n.border),padding:Ai(n.cellpadding)}),Hu(t)&&Pf(r,e.children[a],{"border-color":n.bordercolor});Hu(t)&&(i["background-color"]=n.backgroundcolor,i["border-color"]=n.bordercolor,i["border-style"]=n.borderstyle),o.style=r.serializeStyle(X(X({},Pu(t)),i)),r.setAttribs(e,X(X({},zu(t)),o))}(t,e,i);var u=o.select("caption",e)[0];(u&&!i.caption||!u&&i.caption)&&t.execCommand("mceTableToggleCaption"),""===i.align?Fl(t,e):Hl(t,e,i.align)}if(t.focus(),t.addVisual(),Xt(a)>0){var c=Jt(a,"caption"),s=!c||Xt(a)>1;Cu(t,e,{structure:c,style:s})}}))},If=function(t,e){var n,r=t.dom,o=function(t,e){var n,r,o,i,a=Pu(t),u=zu(t),c=e?(n=t.dom,{borderstyle:Yt(a,"border-style").getOr(""),bordercolor:bf(n)(Yt(a,"border-color").getOr("")),backgroundcolor:bf(n)(Yt(a,"background-color").getOr(""))}):{};return X(X(X(X(X(X({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),a),u),c),(i=a["border-width"],Fu(t)&&i?{border:i}:Yt(u,"border").fold((function(){return{}}),(function(t){return{border:t}})))),(r=Yt(a,"border-spacing").or(Yt(u,"cellspacing")).fold((function(){return{}}),(function(t){return{cellspacing:t}})),o=Yt(a,"border-padding").or(Yt(u,"cellpadding")).fold((function(){return{}}),(function(t){return{cellpadding:t}})),X(X({},r),o)))}(t,Hu(t));!1===e?(n=r.getParent(t.selection.getStart(),"table",t.getBody()))?o=function(t,e,n){var r=t.dom,o=Fu(t)?r.getStyle(e,"border-spacing")||r.getAttrib(e,"cellspacing"):r.getAttrib(e,"cellspacing")||r.getStyle(e,"border-spacing"),i=Fu(t)?Il(r,e,"padding")||r.getAttrib(e,"cellpadding"):r.getAttrib(e,"cellpadding")||Il(r,e,"padding");return X({width:r.getStyle(e,"width")||r.getAttrib(e,"width"),height:r.getStyle(e,"height")||r.getAttrib(e,"height"),cellspacing:o,cellpadding:i,border:function(e,n){var r=nn(Mt.fromDom(n),"border-width");return Fu(t)&&r.isSome()?r.getOr(""):e.getAttrib(n,"border")||Il(t.dom,n,"border-width")||Il(t.dom,n,"border")}(r,e),caption:!!r.select("caption",e)[0],class:r.getAttrib(e,"class",""),align:Cf(t,e)},n?yf(r,e):{})}(t,n,Hu(t)):Hu(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""):(o.cols="1",o.rows="1",Hu(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=of(ju(t));i.length>0&&o.class&&(o.class=o.class.replace(/\s*mce\-item\-table\s*/g,""));var a={type:"grid",columns:2,items:zf(t,i,e)},u=Hu(t)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},hf(t,"table")]}:{type:"panel",items:[a]};t.windowManager.open({title:"Table Properties",size:"normal",body:u,onSubmit:p(Lf,t,n,o),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},Hf=function(t){return Ui(Mi(t),Ni(t))},Ff=function(t,e,n,i,a){var u=Ni(t),c=function(t){return vn(t,u)},s=function(e){return function(t){return Wi(Mi(t),Ni(t))}(t).bind((function(t){return c(t).map((function(n){return e(n,t)}))}))},l=function(e){t.focus()},f=function(t,e){return void 0===e&&(e=!1),s((function(n,r){var o=Vi(i,n,r);t(n,o,e).each(l)}))},m=function(){return s((function(e,n){var r=Vi(i,e,n),o=ki(d,Mt.fromDom(t.getDoc()),T.none());return Pl(e,r,o)}))},g=function(){return s((function(t,e){var n=Vi(i,t,e);return zl(t,n)}))},h=function(e,n){return n().each((function(n){var r=D(n,(function(t){return Lr(t)}));s((function(n,o){var a=Ti(Mt.fromDom(t.getDoc())),u=function(t,e,n,r){return{selection:Bi(t),clipboard:n,generators:r}}(i,0,r,a);e(n,u).each(l)}))}))},v=function(t){return function(e,n){return Yt(n,"type").each((function(e){f(t(e),n.no_events)}))}};Ut({mceTableSplitCells:function(){return f(e.unmergeCells)},mceTableMergeCells:function(){return f(e.mergeCells)},mceTableInsertRowBefore:function(){return f(e.insertRowsBefore)},mceTableInsertRowAfter:function(){return f(e.insertRowsAfter)},mceTableInsertColBefore:function(){return f(e.insertColumnsBefore)},mceTableInsertColAfter:function(){return f(e.insertColumnsAfter)},mceTableDeleteCol:function(){return f(e.deleteColumn)},mceTableDeleteRow:function(){return f(e.deleteRow)},mceTableCutCol:function(){return g().each((function(t){a.setColumns(t),f(e.deleteColumn)}))},mceTableCutRow:function(){return m().each((function(t){a.setRows(t),f(e.deleteRow)}))},mceTableCopyCol:function(){return g().each((function(t){return a.setColumns(t)}))},mceTableCopyRow:function(){return m().each((function(t){return a.setRows(t)}))},mceTablePasteColBefore:function(){return h(e.pasteColsBefore,a.getColumns)},mceTablePasteColAfter:function(){return h(e.pasteColsAfter,a.getColumns)},mceTablePasteRowBefore:function(){return h(e.pasteRowsBefore,a.getRows)},mceTablePasteRowAfter:function(){return h(e.pasteRowsAfter,a.getRows)},mceTableDelete:function(){return Hf(t).each((function(e){vn(e,u).filter(y(u)).each((function(e){var n=Mt.fromText("");if(Yn(e,n),rr(e),t.dom.isEmpty(t.getBody()))t.setContent(""),t.selection.setCursorLocation();else{var r=t.dom.createRng();r.setStart(n.dom,0),r.setEnd(n.dom,0),t.selection.setRng(r),t.nodeChanged()}}))}))},mceTableCellToggleClass:function(e,n){s((function(e){var r=qi(i),o=j(r,(function(e){return t.formatter.match("tablecellclass",{value:n},e.dom)}))?t.formatter.remove:t.formatter.apply;M(r,(function(t){return o("tablecellclass",{value:n},t.dom)})),Cu(t,e.dom,Su)}))},mceTableToggleClass:function(e,n){s((function(e){t.formatter.toggle("tableclass",{value:n},e.dom),Cu(t,e.dom,Su)}))},mceTableToggleCaption:function(){Hf(t).each((function(e){vn(e,u).each((function(n){Pe(n,"caption").fold((function(){var e=Mt.fromTag("caption");Qn(e,Mt.fromText("Caption")),function(t,e,n){we(t,n).fold((function(){Qn(t,e)}),(function(t){Xn(t,e)}))}(n,e,0),t.selection.setCursorLocation(e.dom,0)}),(function(r){de("caption")(e)&&Pt("td",n).each((function(e){return t.selection.setCursorLocation(e.dom,0)})),rr(r)})),Cu(t,n.dom,ku)}))}))},mceTableSizingMode:function(e,n){return function(e){return Hf(t).each((function(n){qu(t)||Wu(t)||Uu(t)||vn(n,u).each((function(n){"relative"!==e||Ca(n)?"fixed"!==e||Sa(n)?"responsive"!==e||ka(n)||oc(n):rc(n):nc(n),Di(n),Cu(t,n.dom,ku)}))}))}(n)},mceTableCellType:v((function(t){return"th"===t?e.makeCellsHeader:e.unmakeCellsHeader})),mceTableColType:v((function(t){return"th"===t?e.makeColumnsHeader:e.unmakeColumnsHeader})),mceTableRowType:v((function(t){switch(t){case"header":return e.makeRowsHeader;case"footer":return e.makeRowsFooter;default:return e.makeRowsBody}}))},(function(e,n){return t.addCommand(n,e)})),Ut({mceTableProps:p(If,t,!1),mceTableRowProps:p(Bf,t),mceTableCellProps:p(Rf,t,i)},(function(e,n){return t.addCommand(n,(function(){return e()}))})),t.addCommand("mceInsertTable",(function(e,n){o(n)&&Vt(n).length>0?Nl(t,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):If(t,!0)})),t.addCommand("mceTableApplyCellStyle",(function(e,n){var a=function(t){return"tablecell"+t.toLowerCase().replace("-","")};if(o(n)){var u=qi(i);if(0!==u.length){var s=$t(n,(function(e,n){return t.formatter.has(a(n))&&r(e)}));(function(t){for(var e in t)if(jt.call(t,e))return!1;return!0})(s)||(Ut(s,(function(e,n){M(u,(function(r){vf.normal(t,r.dom).setFormat(a(n),e)}))})),c(u[0]).each((function(e){return Cu(t,e.dom,Su)})))}}}))},Vf={remove_similar:!0,inherit:!1},jf=X({selector:"td,th"},Vf),Uf={tablecellbackgroundcolor:X({styles:{backgroundColor:"%value"}},jf),tablecellverticalalign:X({styles:{"vertical-align":"%value"}},jf),tablecellbordercolor:X({styles:{borderColor:"%value"}},jf),tablecellclass:X({classes:["%value"]},jf),tableclass:X({selector:"table",classes:["%value"]},Vf),tablecellborderstyle:X({styles:{borderStyle:"%value"}},jf),tablecellborderwidth:X({styles:{borderWidth:"%value"}},jf)},Wf=_r([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),qf=X(X({},Wf),{none:function(t){return void 0===t&&(t=void 0),Wf.none(t)}}),$f=function(t,e,n,r,o){void 0===o&&(o=x);var i=1===r;if(!i&&n<=0)return qf.first(t[0]);if(i&&n>=t.length-1)return qf.last(t[t.length-1]);var a=n+r,u=t[a];return o(u)?qf.middle(e,u):$f(t,e,a,r,o)},Gf=function(t,e){return vn(t,e).bind((function(e){var n=hn(e);return H(n,(function(e){return Lt(t,e)})).map((function(t){return{index:t,all:n}}))}))},Kf=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Xf=_r([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Yf={before:Xf.before,on:Xf.on,after:Xf.after,cata:function(t,e,n,r){return t.fold(e,n,r)},getStart:function(t){return t.fold(g,g,g)}},Jf=_r([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Qf={domRange:Jf.domRange,relative:Jf.relative,exact:Jf.exact,exactFromRange:function(t){return Jf.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e,n=function(t){return t.match({domRange:function(t){return Mt.fromDom(t.startContainer)},relative:function(t,e){return Yf.getStart(t)},exact:function(t,e,n,r){return t}})}(t);return e=n,Mt.fromDom(ge(e).dom.defaultView)},range:Kf},Zf=function(t,e){var n=t.document.createRange();return n.selectNode(e.dom),n},td=function(t,e){var n=t.document.createRange();return ed(n,e),n},ed=function(t,e){return t.selectNodeContents(e.dom)},nd=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},rd=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},od=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},id=_r([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),ad=function(t,e,n){return e(Mt.fromDom(n.startContainer),n.startOffset,Mt.fromDom(n.endContainer),n.endOffset)},ud=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return id.rtl(Mt.fromDom(t.endContainer),t.endOffset,Mt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return ad(0,id.ltr,n)})):ad(0,id.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:m(t),rtl:T.none}},relative:function(e,n){return{ltr:J((function(){return nd(t,e,n)})),rtl:J((function(){return T.some(nd(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:J((function(){return rd(t,e,n,r,o)})),rtl:J((function(){return T.some(rd(t,r,o,e,n))}))}}})}(t,e))},cd=function(t,e){return ud(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};id.ltr,id.rtl;var sd=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},ld=function(t,e,n,r,o){var i=function(n){var r=t.dom.createRange();return r.setStart(e.dom,n),r.collapse(!0),r},a=ar(e).length,u=function(t,e,n,r,o){if(0===o)return 0;if(e===r)return o-1;for(var i=r,a=1;a<o;a++){var u=t(a),c=Math.abs(e-u.left);if(n<=u.bottom){if(n<u.top||c>i)return a-1;i=c}}return 0}((function(t){return i(t).getBoundingClientRect()}),n,r,o.right,a);return i(u)},fd=function(t,e,n,r){return se(e)?function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getClientRects();return K(i,(function(t){return sd(t,n,r)?T.some(t):T.none()})).map((function(o){return ld(t,e,n,r,o)}))}(t,e,n,r):function(t,e,n,r){var o=t.dom.createRange(),i=ye(e);return K(i,(function(e){return o.selectNode(e.dom),sd(o.getBoundingClientRect(),n,r)?fd(t,e,n,r):T.none()}))}(t,e,n,r)},dd=function(t,e){return e-t.left<t.right-e},md=function(t,e,n){var r=t.dom.createRange();return r.selectNode(e.dom),r.collapse(n),r},gd=function(t,e,n){var r=t.dom.createRange();r.selectNode(e.dom);var o=r.getBoundingClientRect(),i=dd(o,n);return(true===i?gi:hi)(e).map((function(e){return md(t,e,i)}))},hd=function(t,e,n){var r=e.dom.getBoundingClientRect(),o=dd(r,n);return T.some(md(t,e,o))},pd=function(t,e,n){var r,o;return T.from(null===(o=(r=t.dom).caretPositionFromPoint)||void 0===o?void 0:o.call(r,e,n)).bind((function(e){if(null===e.offsetNode)return T.none();var n=t.dom.createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),T.some(n)}))},vd=function(t,e,n){var r,o;return T.from(null===(o=(r=t.dom).caretRangeFromPoint)||void 0===o?void 0:o.call(r,e,n))},bd=function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect();return function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect(),a=Math.max(i.left,Math.min(i.right,n)),u=Math.max(i.top,Math.min(i.bottom,r));return fd(t,e,a,u)}(t,e,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},yd=function(t,e,n){return Mt.fromPoint(t,e,n).bind((function(r){var o=function(){return function(t,e,n){return(0===ye(e).length?hd:gd)(t,e,n)}(t,r,e)};return 0===ye(r).length?o():bd(t,r,e,n).orThunk(o)}))},wd=document.caretPositionFromPoint?pd:document.caretRangeFromPoint?vd:yd,xd=function(t,e){var n=oe(t);return"input"===n?Yf.after(t):R(["br","img"],n)?0===e?Yf.before(t):Yf.after(t):Yf.on(t,e)},Cd=function(t,e){var n=t.fold(Yf.before,xd,Yf.after),r=e.fold(Yf.before,xd,Yf.after);return Qf.relative(n,r)},Sd=function(t,e,n,r){var o=xd(t,e),i=xd(n,r);return Qf.relative(o,i)},kd=function(t,e,n,r){var o=function(t,e,n,r){var o=me(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Lt(t,n)&&e===r;return o.collapsed&&!i},Td=function(t){return T.from(t.getSelection())},Od=function(t,e){Td(t).each((function(t){t.removeAllRanges(),t.addRange(e)}))},Ed=function(t,e,n,r,o){var i=rd(t,e,n,r,o);Od(t,i)},_d=function(t,e){return ud(t,e).match({ltr:function(e,n,r,o){Ed(t,e,n,r,o)},rtl:function(e,n,r,o){Td(t).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom,n,r.dom,o);else if(i.extend)try{!function(t,e,n,r,o,i){e.collapse(n.dom,r),e.extend(o.dom,i)}(0,i,e,n,r,o)}catch(i){Ed(t,r,o,e,n)}else Ed(t,r,o,e,n)}))}})},Rd=function(t,e,n,r,o){var i=Sd(e,n,r,o);_d(t,i)},Nd=function(t,e,n){var r=Cd(e,n);_d(t,r)},Ad=function(t){var e=Qf.getWin(t).dom,n=function(t,n,r,o){return rd(e,t,n,r,o)},r=function(t){return t.match({domRange:function(t){var e=Mt.fromDom(t.startContainer),n=Mt.fromDom(t.endContainer);return Sd(e,t.startOffset,n,t.endOffset)},relative:Cd,exact:Sd})}(t);return ud(e,r).match({ltr:n,rtl:n})},Dd=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return T.some(Kf(Mt.fromDom(e.startContainer),e.startOffset,Mt.fromDom(n.endContainer),n.endOffset))}return T.none()},Md=function(t){if(null===t.anchorNode||null===t.focusNode)return Dd(t);var e=Mt.fromDom(t.anchorNode),n=Mt.fromDom(t.focusNode);return kd(e,t.anchorOffset,n,t.focusOffset)?T.some(Kf(e,t.anchorOffset,n,t.focusOffset)):Dd(t)},Bd=function(t,e,n){void 0===n&&(n=!0);var r=(n?td:Zf)(t,e);Od(t,r)},zd=function(t){return function(t){return Td(t).filter((function(t){return t.rangeCount>0})).bind(Md)}(t).map((function(t){return Qf.exact(t.start,t.soffset,t.finish,t.foffset)}))},Pd=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?T.some(n).map(od):T.none()}(cd(t,e))},Ld=function(t,e,n){return function(t,e,n){var r=Mt.fromDom(t.document);return wd(r,e,n).map((function(t){return Kf(Mt.fromDom(t.startContainer),t.startOffset,Mt.fromDom(t.endContainer),t.endOffset)}))}(t,e,n)},Id=tinymce.util.Tools.resolve("tinymce.util.VK"),Hd=function(t,e,n){return Vd(t,e,function(t,e,n){return Gf(t,n).fold((function(){return qf.none(t)}),(function(n){return $f(n.all,t,n.index,1,e)}))}(n,tu))},Fd=function(t,e,n){return Vd(t,e,function(t,e,n){return Gf(t,n).fold((function(){return qf.none()}),(function(n){return $f(n.all,t,n.index,-1,e)}))}(n,tu))},Vd=function(t,e,n){return n.fold(T.none,T.none,(function(t,e){return gi(e).map((function(t){return function(t,e){var n=Qf.exact(e,0,e,0);return Ad(n)}(0,t)}))}),(function(n){return t.execCommand("mceTableInsertRowAfter"),Hd(t,e,n)}))},jd=["table","li","dl"],Ud=function(t,e){return{selection:t,kill:e}},Wd=function(t,e,n,r){return{start:Yf.on(t,e),finish:Yf.on(n,r)}},qd=function(t,e){var n=cd(t,e);return Kf(Mt.fromDom(n.startContainer),n.startOffset,Mt.fromDom(n.endContainer),n.endOffset)},$d=Wd,Gd=function(t,e,n,r,o){return Lt(n,r)?T.none():Cr(n,r,e).bind((function(e){var r=e.boxes.getOr([]);return r.length>1?(o(t,r,e.start,e.finish),T.some(Ud(T.some($d(n,0,n,fi(n))),!0))):T.none()}))},Kd=function(t,e){return{item:t,mode:e}},Xd=function(t,e,n,r){return void 0===r&&(r=Yd),t.property().parent(e).map((function(t){return Kd(t,r)}))},Yd=function(t,e,n,r){return void 0===r&&(r=Jd),n.sibling(t,e).map((function(t){return Kd(t,r)}))},Jd=function(t,e,n,r){void 0===r&&(r=Jd);var o=t.property().children(e);return n.first(o).map((function(t){return Kd(t,r)}))},Qd=[{current:Xd,next:Yd,fallback:T.none()},{current:Yd,next:Jd,fallback:T.some(Xd)},{current:Jd,next:Jd,fallback:T.some(Yd)}],Zd=function(t,e,n,r,o){return void 0===o&&(o=Qd),I(o,(function(t){return t.current===n})).bind((function(n){return n.current(t,e,r,n.next).orThunk((function(){return n.fallback.bind((function(n){return Zd(t,e,n,r)}))}))}))},tm=function(){return{sibling:function(t,e){return t.query().prevSibling(e)},first:function(t){return t.length>0?T.some(t[t.length-1]):T.none()}}},em=function(){return{sibling:function(t,e){return t.query().nextSibling(e)},first:function(t){return t.length>0?T.some(t[0]):T.none()}}},nm=function(t,e,n,r,o,i){return Zd(t,e,r,o).bind((function(e){return i(e.item)?T.none():n(e.item)?T.some(e.item):nm(t,e.item,n,e.mode,o,i)}))},rm=function(t){return function(e){return 0===t.property().children(e).length}},om=function(t,e,n,r){return nm(t,e,n,Yd,tm(),r)},im=function(t,e,n,r){return nm(t,e,n,Yd,em(),r)},am=lr(),um=function(t,e){return function(t,e,n){return om(t,e,rm(t),n)}(am,t,e)},cm=function(t,e){return function(t,e,n){return im(t,e,rm(t),n)}(am,t,e)},sm=_r([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),lm=function(t){return Ie(t,"tr")},fm=X(X({},sm),{verify:function(t,e,n,r,o,i,a){return Ie(r,"td,th",a).bind((function(n){return Ie(e,"td,th",a).map((function(e){return Lt(n,e)?Lt(r,n)&&fi(n)===o?i(e):sm.none("in same cell"):wr(lm,[n,e]).fold((function(){return function(t,e,n){var r=t.getRect(e),o=t.getRect(n);return o.right>r.left&&o.left<r.right}(t,e,n)?sm.success():i(e)}),(function(t){return i(e)}))}))})).getOr(sm.none("default"))},cata:function(t,e,n,r,o){return t.fold(e,n,r,o)}}),dm=function(t,e){return H(t,p(Lt,e))},mm=function(t){return"br"===oe(t)},gm=function(t,e,n){return e(t,n).bind((function(t){return se(t)&&0===ar(t).trim().length?gm(t,e,n):T.some(t)}))},hm=function(t,e,n,r){return function(t,e){return we(t,e).filter(mm).orThunk((function(){return we(t,e-1).filter(mm)}))}(e,n).bind((function(e){return r.traverse(e).fold((function(){return gm(e,r.gather,t).map(r.relative)}),(function(t){return function(t){return he(t).bind((function(e){var n=ye(e);return dm(n,t).map((function(r){return function(t,e,n,r){return{parent:t,children:e,element:n,index:r}}(e,n,t,r)}))}))}(t).map((function(t){return Yf.on(t.parent,t.index)}))}))}))},pm=function(t,e,n,r){return(mm(e)?function(t,e,n){return n.traverse(e).orThunk((function(){return gm(e,n.gather,t)})).map(n.relative)}(t,e,r):hm(t,e,n,r)).map((function(t){return{start:t,finish:t}}))},vm=function(t,e){return{left:t.left,top:t.top+e,right:t.right,bottom:t.bottom+e}},bm=function(t,e){return{left:t.left,top:t.top-e,right:t.right,bottom:t.bottom-e}},ym=function(t,e,n){return{left:t.left+e,top:t.top+n,right:t.right+e,bottom:t.bottom+n}},wm=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}},xm=function(t,e){return T.some(t.getRect(e))},Cm=function(t,e,n){return ce(e)?xm(t,e).map(wm):se(e)?function(t,e,n){return n>=0&&n<fi(e)?t.getRangedRect(e,n,e,n+1):n>0?t.getRangedRect(e,n-1,e,n):T.none()}(t,e,n).map(wm):T.none()},Sm=function(t,e){return ce(e)?xm(t,e).map(wm):se(e)?t.getRangedRect(e,0,e,fi(e)).map(wm):T.none()},km=_r([{none:[]},{retry:["caret"]}]),Tm=function(t,e,n){return(r=e,o=As,Me((function(t,e){return e(t)}),Be,r,o,i)).fold(w,(function(e){return Sm(t,e).exists((function(t){return function(t,e){return t.left<e.left||Math.abs(e.right-t.left)<1||t.left>e.right}(n,t)}))}));var r,o,i},Om={point:function(t){return t.bottom},adjuster:function(t,e,n,r,o){var i=vm(o,5);return Math.abs(n.bottom-r.bottom)<1||n.top>o.bottom?km.retry(i):n.top===o.bottom?km.retry(vm(o,1)):Tm(t,e,o)?km.retry(ym(i,5,0)):km.none()},move:vm,gather:cm},Em=function(t,e,n,r,o){return 0===o?T.some(r):function(t,e,n){return t.elementFromPoint(e,n).filter((function(t){return"table"===oe(t)})).isSome()}(t,r.left,e.point(r))?function(t,e,n,r,o){return Em(t,e,n,e.move(r,5),o)}(t,e,n,r,o-1):t.situsFromPoint(r.left,e.point(r)).bind((function(i){return i.start.fold(T.none,(function(i){return Sm(t,i).bind((function(a){return e.adjuster(t,i,a,n,r).fold(T.none,(function(r){return Em(t,e,n,r,o-1)}))})).orThunk((function(){return T.some(r)}))}),T.none)}))},_m=function(t,e,n){var r=t.move(n,5),o=Em(e,t,n,r,100).getOr(r);return function(t,e,n){return t.point(e)>n.getInnerHeight()?T.some(t.point(e)-n.getInnerHeight()):t.point(e)<0?T.some(-t.point(e)):T.none()}(t,o,e).fold((function(){return e.situsFromPoint(o.left,t.point(o))}),(function(n){return e.scrollBy(0,n),e.situsFromPoint(o.left,t.point(o)-n)}))},Rm={tryUp:p(_m,{point:function(t){return t.top},adjuster:function(t,e,n,r,o){var i=bm(o,5);return Math.abs(n.top-r.top)<1||n.bottom<o.top?km.retry(i):n.bottom===o.top?km.retry(bm(o,1)):Tm(t,e,o)?km.retry(ym(i,5,0)):km.none()},move:bm,gather:um}),tryDown:p(_m,Om),ieTryUp:function(t,e){return t.situsFromPoint(e.left,e.top-5)},ieTryDown:function(t,e){return t.situsFromPoint(e.left,e.bottom+5)},getJumpSize:m(5)},Nm=function(t,e,n){return t.getSelection().bind((function(r){return pm(e,r.finish,r.foffset,n).fold((function(){return T.some(sc(r.finish,r.foffset))}),(function(o){var i=t.fromSitus(o);return function(t){return fm.cata(t,(function(t){return T.none()}),(function(){return T.none()}),(function(t){return T.some(sc(t,0))}),(function(t){return T.some(sc(t,fi(t)))}))}(fm.verify(t,r.finish,r.foffset,i.finish,i.foffset,n.failure,e))}))}))},Am=function(t,e,n,r,o,i){return 0===i?T.none():Bm(t,e,n,r,o).bind((function(a){var u=t.fromSitus(a),c=fm.verify(t,n,r,u.finish,u.foffset,o.failure,e);return fm.cata(c,(function(){return T.none()}),(function(){return T.some(a)}),(function(a){return Lt(n,a)&&0===r?Dm(t,n,r,bm,o):Am(t,e,a,0,o,i-1)}),(function(a){return Lt(n,a)&&r===fi(a)?Dm(t,n,r,vm,o):Am(t,e,a,fi(a),o,i-1)}))}))},Dm=function(t,e,n,r,o){return Cm(t,e,n).bind((function(e){return Mm(t,o,r(e,Rm.getJumpSize()))}))},Mm=function(t,e,n){var r=At().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(t,n):r.isIE()?e.ieRetry(t,n):T.none()},Bm=function(t,e,n,r,o){return Cm(t,n,r).bind((function(e){return Mm(t,o,e)}))},zm=function(t,e){return Be(t,(function(t){return he(t).exists((function(t){return Lt(t,e)}))}),n).isSome();var n},Pm=function(t,e,n,r,o){return Ie(r,"td,th",e).bind((function(r){return Ie(r,"table",e).bind((function(i){return zm(o,i)?function(t,e,n){return Nm(t,e,n).bind((function(r){return Am(t,e,r.element,r.offset,n,20).map(t.fromSitus)}))}(t,e,n).bind((function(t){return Ie(t.finish,"td,th",e).map((function(e){return{start:r,finish:e,range:t}}))})):T.none()}))}))},Lm=function(t,e,n,r,o,i){return At().browser.isIE()?T.none():i(r,e).orThunk((function(){return Pm(t,e,n,r,o).map((function(t){var e=t.range;return Ud(T.some($d(e.start,e.soffset,e.finish,e.foffset)),!0)}))}))},Im=function(t,e){return Ie(t,"tr",e).bind((function(t){return Ie(t,"table",e).bind((function(n){var r=De(n,"tr");return Lt(t,r[0])?function(t,e,n){return om(am,t,e,n)}(n,(function(t){return hi(t).isSome()}),e).map((function(t){var e=fi(t);return Ud(T.some($d(t,e,t,e)),!0)})):T.none()}))}))},Hm=function(t,e){return Ie(t,"tr",e).bind((function(t){return Ie(t,"table",e).bind((function(n){var r=De(n,"tr");return Lt(t,r[r.length-1])?function(t,e,n){return im(am,t,e,n)}(n,(function(t){return gi(t).isSome()}),e).map((function(t){return Ud(T.some($d(t,0,t,0)),!0)})):T.none()}))}))},Fm=function(t,e,n,r,o,i,a){return Pm(t,n,r,o,i).bind((function(t){return Gd(e,n,t.start,t.finish,a)}))},Vm=function(t,e){return Ie(t,"td,th",e)},jm={traverse:be,gather:cm,relative:Yf.before,otherRetry:Rm.tryDown,ieRetry:Rm.ieTryDown,failure:fm.failedDown},Um={traverse:ve,gather:um,relative:Yf.before,otherRetry:Rm.tryUp,ieRetry:Rm.ieTryUp,failure:fm.failedUp},Wm=function(t){return function(e){return e===t}},qm=Wm(38),$m=Wm(40),Gm=function(t){return t>=37&&t<=40},Km={isBackward:Wm(37),isForward:Wm(39)},Xm={isBackward:Wm(39),isForward:Wm(37)},Ym=function(t){return{elementFromPoint:function(e,n){return Mt.fromPoint(Mt.fromDom(t.document),e,n)},getRect:function(t){return t.dom.getBoundingClientRect()},getRangedRect:function(e,n,r,o){var i=Qf.exact(e,n,r,o);return Pd(t,i)},getSelection:function(){return zd(t).map((function(e){return qd(t,e)}))},fromSitus:function(e){var n=Qf.relative(e.start,e.finish);return qd(t,n)},situsFromPoint:function(e,n){return Ld(t,e,n).map((function(t){return Wd(t.start,t.soffset,t.finish,t.foffset)}))},clearSelection:function(){!function(t){Td(t).each((function(t){return t.removeAllRanges()}))}(t)},collapseSelection:function(e){void 0===e&&(e=!1),zd(t).each((function(n){return n.fold((function(t){return t.collapse(e)}),(function(n,r){var o=e?n:r;Nd(t,o,o)}),(function(n,r,o,i){var a=e?n:o,u=e?r:i;Rd(t,a,u,a,u)}))}))},setSelection:function(e){Rd(t,e.start,e.soffset,e.finish,e.foffset)},setRelativeSelection:function(e,n){Nd(t,e,n)},selectNode:function(e){Bd(t,e,!1)},selectContents:function(e){Bd(t,e)},getInnerHeight:function(){return t.innerHeight},getScrollY:function(){var e,n,r,o;return(e=Mt.fromDom(t.document),n=void 0!==e?e.dom:document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop,co(r,o)).top},scrollBy:function(e,n){!function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollBy(t,e)}(e,n,Mt.fromDom(t.document))}}},Jm=function(t,e){return{rows:t,cols:e}},Qm=function(t,e,n,r){var o=function(t,e,n,r){var o=ef(),i=o.clear,a=function(i){o.on((function(o){r.clearBeforeUpdate(e),Vm(i.target,n).each((function(a){Cr(o,a,n).each((function(n){var o=n.boxes.getOr([]);if(1===o.length){var u=o[0],c="false"===eu(u),s=$e(Za(i.target),u,Lt);c&&s&&(r.selectRange(e,o,u,u),t.selectContents(u))}else o.length>1&&(r.selectRange(e,o,n.start,n.finish),t.selectContents(a))}))}))}))};return{clearstate:i,mousedown:function(t){r.clear(e),Vm(t.target,n).each(o.set)},mouseover:function(t){a(t)},mouseup:function(t){a(t),i()}}}(Ym(t),e,n,r);return{clearstate:o.clearstate,mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},Zm=function(t,e,n,r){var o=Ym(t),i=function(){return r.clear(e),T.none()};return{keydown:function(t,a,u,c,s,l){var f=t.raw,d=f.which,m=!0===f.shiftKey;return Sr(e,r.selectedSelector).fold((function(){return Gm(d)&&!m&&r.clearBeforeUpdate(e),$m(d)&&m?p(Fm,o,e,n,jm,c,a,r.selectRange):qm(d)&&m?p(Fm,o,e,n,Um,c,a,r.selectRange):$m(d)?p(Lm,o,n,jm,c,a,Hm):qm(d)?p(Lm,o,n,Um,c,a,Im):T.none}),(function(t){var n=function(n){return function(){return K(n,(function(n){return function(t,e,n,r,o){return Tr(r,t,e,o.firstSelectedSelector,o.lastSelectedSelector).map((function(t){return o.clearBeforeUpdate(n),o.selectRange(n,t.boxes,t.start,t.finish),t.boxes}))}(n.rows,n.cols,e,t,r)})).fold((function(){return kr(e,r.firstSelectedSelector,r.lastSelectedSelector).map((function(t){var n=$m(d)||l.isForward(d)?Yf.after:Yf.before;return o.setRelativeSelection(Yf.on(t.first,0),n(t.table)),r.clear(e),Ud(T.none(),!0)}))}),(function(t){return T.some(Ud(T.none(),!0))}))}};return $m(d)&&m?n([Jm(1,0)]):qm(d)&&m?n([Jm(-1,0)]):l.isBackward(d)&&m?n([Jm(0,-1),Jm(-1,0)]):l.isForward(d)&&m?n([Jm(0,1),Jm(1,0)]):Gm(d)&&!m?i:T.none}))()},keyup:function(t,o,i,a,u){return Sr(e,r.selectedSelector).fold((function(){var c=t.raw,s=c.which;return!0===c.shiftKey&&Gm(s)?function(t,e,n,r,o,i,a){return Lt(n,o)&&r===i?T.none():Ie(n,"td,th",e).bind((function(n){return Ie(o,"td,th",e).bind((function(r){return Gd(t,e,n,r,a)}))}))}(e,n,o,i,a,u,r.selectRange):T.none()}),T.none)}}},tg=function(t,e,n){var r=function(e){We(e,t.selected),We(e,t.firstSelected),We(e,t.lastSelected)},o=function(e){Fe(e,t.selected,"1")},i=function(t){a(t),n()},a=function(e){var n=De(e,t.selectedSelector+","+t.firstSelectedSelector+","+t.lastSelectedSelector);M(n,r)};return{clearBeforeUpdate:a,clear:i,selectRange:function(n,r,a,u){i(n),M(r,o),Fe(a,t.firstSelected,"1"),Fe(u,t.lastSelected,"1"),e(r,a,u)},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}},eg=function(t,e,n){var r=In.fromTable(t);return Uc(r,e).map((function(t){var e=Lc(r,n,!1);return{upOrLeftCells:function(t,e){var n=t.slice(0,e[e.length-1].row+1),r=Ic(n);return V(r,(function(t){var n=t.cells.slice(0,e[e.length-1].column+1);return D(n,(function(t){return t.element}))}))}(e,t),downOrRightCells:function(t,e){var n=t.slice(e[0].row+e[0].rowspan-1,t.length),r=Ic(n);return V(r,(function(t){var n=t.cells.slice(e[0].column+e[0].colspan-1,t.cells.length);return D(n,(function(t){return t.element}))}))}(e,t)}}))},ng=tinymce.util.Tools.resolve("tinymce.Env"),rg=function(t){return!1===Ka(Mt.fromDom(t.target),"ephox-snooker-resizer-bar")};function og(t,e,n){var r=tg(Fi,(function(e,r,o){n.targets().each((function(n){vn(r).each((function(i){var a=Ju(t),u=ki(d,Mt.fromDom(t.getDoc()),a),c=eg(i,n,u);!function(t,e,n,r,o){t.fire("TableSelectionChange",{cells:e,start:n,finish:r,otherCells:o})}(t,e,r,o,c)}))}))}),(function(){return function(t){t.fire("TableSelectionClear")}(t)}));return t.on("init",(function(n){var o=t.getWin(),i=Ei(t),a=Ni(t),u=Qm(o,i,a,r),c=Zm(o,i,a,r),s=function(t,e,n,r){var o=Ym(t);return function(t,i){r.clearBeforeUpdate(e),Cr(t,i,n).each((function(t){var n=t.boxes.getOr([]);r.selectRange(e,n,t.start,t.finish),o.selectContents(i),o.collapseSelection()}))}}(o,i,a,r);t.on("TableSelectorChange",(function(t){return s(t.start,t.finish)}));var l,f,m=function(e,n){(function(t){return!0===t.raw.shiftKey})(e)&&(n.kill&&e.kill(),n.selection.each((function(e){var n=Qf.relative(e.start,e.finish),r=cd(o,n);t.selection.setRng(r)})))},g=function(t){return 0===t.button},h=(l=Zl(Mt.fromDom(i)),f=Zl(0),{touchEnd:function(t){var e=Mt.fromDom(t.target);if("td"===oe(e)||"th"===oe(e)){var n=l.get(),r=f.get();Lt(n,e)&&t.timeStamp-r<300&&(t.preventDefault(),s(e,e))}l.set(e),f.set(t.timeStamp)}});t.on("dragstart",(function(t){u.clearstate()})),t.on("mousedown",(function(t){g(t)&&rg(t)&&u.mousedown(Ua(t))})),t.on("mouseover",(function(t){var e;(void 0===(e=t).buttons||ng.browser.isEdge()&&0===e.buttons||0!=(1&e.buttons))&&rg(t)&&u.mouseover(Ua(t))})),t.on("mouseup",(function(t){g(t)&&rg(t)&&u.mouseup(Ua(t))})),t.on("touchend",h.touchEnd),t.on("keyup",(function(e){var n=Ua(e);if(n.raw.shiftKey&&Gm(n.raw.which)){var r=t.selection.getRng(),o=Mt.fromDom(r.startContainer),i=Mt.fromDom(r.endContainer);c.keyup(n,o,r.startOffset,i,r.endOffset).each((function(t){m(n,t)}))}})),t.on("keydown",(function(n){var r=Ua(n);e().each((function(t){return t.hideBars()}));var o=t.selection.getRng(),i=Mt.fromDom(o.startContainer),a=Mt.fromDom(o.endContainer),u=eo(Km,Xm)(Mt.fromDom(t.selection.getStart()));c.keydown(r,i,o.startOffset,a,o.endOffset,u).each((function(t){m(r,t)})),e().each((function(t){return t.showBars()}))})),t.on("NodeChange",(function(){var e=t.selection,n=Mt.fromDom(e.getStart()),o=Mt.fromDom(e.getEnd());wr(vn,[n,o]).fold((function(){return r.clear(i)}),d)}))})),{clear:r.clear}}var ig=function(t,e){var n=Zl(T.none()),r=Zl([]),o=T.none(),i=de("caption"),a=function(t){return o.forall((function(e){return!e[t]}))},u=function(){return Ui(function(t){return Mt.fromDom(t.selection.getEnd())}(t),Ni(t))},c=function(){return Ui(Mi(t),Ni(t)).bind((function(t){return Ke(vn(t),u().bind(vn),(function(n,r){return Lt(n,r)?i(t)?T.some(function(t){return{element:t,mergable:T.none(),unmergable:T.none(),selection:[t]}}(t)):T.some(Vi(e,n,t)):T.none()})).bind(g)}))},s=function(t){return vn(t.element).map((function(e){var n=In.fromTable(e),r=Uc(n,t).getOr([]),o=L(r,(function(t,e){return e.isLocked&&(t.onAny=!0,0===e.column?t.onFirst=!0:e.column+e.colspan>=n.grid.columns&&(t.onLast=!0)),t}),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:$c(n,t).isSome(),unmergeable:Gc(n,t).isSome(),locked:o}}))},l=function(){n.set(J(c)()),o=n.get().bind(s),M(r.get(),(function(t){return t()}))},f=function(t){return t(),r.set(r.get().concat([t])),function(){r.set(z(r.get(),(function(e){return e!==t})))}},d=function(t,e){return f((function(){return n.get().fold((function(){t.setDisabled(!0)}),(function(n){t.setDisabled(e(n))}))}))},m=function(t,e,r){return f((function(){return n.get().fold((function(){t.setDisabled(!0),t.setActive(!1)}),(function(n){t.setDisabled(e(n)),t.setActive(r(n))}))}))},h=function(t){return o.exists((function(e){return e.locked[t]}))},p=function(e,n){return function(r){return m(r,(function(t){return i(t.element)}),(function(){return t.queryCommandValue(e)===n}))}},v=p("mceTableRowType","header"),b=p("mceTableColType","th");return t.on("NodeChange ExecCommand TableSelectorChange",l),{onSetupTable:function(t){return d(t,(function(t){return!1}))},onSetupCellOrRow:function(t){return d(t,(function(t){return i(t.element)}))},onSetupColumn:function(t){return function(e){return d(e,(function(e){return i(e.element)||h(t)}))}},onSetupPasteable:function(t){return function(e){return d(e,(function(e){return i(e.element)||t().isNone()}))}},onSetupPasteableColumn:function(t,e){return function(n){return d(n,(function(n){return i(n.element)||t().isNone()||h(e)}))}},onSetupMergeable:function(t){return d(t,(function(t){return a("mergeable")}))},onSetupUnmergeable:function(t){return d(t,(function(t){return a("unmergeable")}))},resetTargets:l,onSetupTableWithCaption:function(e){return m(e,w,(function(e){return vn(e.element,Ni(t)).exists((function(t){return Pe(t,"caption").isSome()}))}))},onSetupTableRowHeaders:v,onSetupTableColumnHeaders:b,targets:n.get}},ag=function(t){var e=function(t,e,n){return{get:function(){return Or(t(),n).fold((function(){return e().fold(Ar,Mr)}),(function(t){return Dr(t)}))}}}((function(){return Ei(t)}),(function(){return Wi(Mi(t),Ni(t))}),Fi.selectedSelector),n=ig(t,e),r=cc(t),o=og(t,r.lazyResize,n),i=kl(t,o,r.lazyWire),a=function(){var t=ef(),e=ef();return{getRows:t.get,setRows:function(n){n.fold(t.clear,t.set),e.clear()},clearRows:t.clear,getColumns:e.get,setColumns:function(n){n.fold(e.clear,e.set),t.clear()},clearColumns:e.clear}}();return Ff(t,i,0,e,a),function(t,e,n){var r=Ni(t),o=function(e){return Wi(Mi(t)).bind((function(t){return vn(t,r).map((function(r){var o=Vi(n,r,t);return e(r,o)}))})).getOr("")};Ut({mceTableRowType:function(){return o(e.getTableRowType)},mceTableCellType:function(){return o(e.getTableCellType)},mceTableColType:function(){return o(e.getTableColType)}},(function(e,n){return t.addQueryValueHandler(n,e)}))}(t,i,e),$i(t,e,i),function(t,e,n,r){var o=function(e){return function(){return t.execCommand(e)}},i=function(e){t.execCommand("mceInsertTable",!1,{rows:e.numRows,columns:e.numColumns})},a={text:"Table properties",onSetup:n.onSetupTable,onAction:o("mceTableProps")},u={text:"Delete table",icon:"table-delete-table",onSetup:n.onSetupTable,onAction:o("mceTableDelete")};t.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:o("mceTableInsertRowBefore"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:o("mceTableInsertRowAfter"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:o("mceTableDeleteRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:o("mceTableRowProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)});var c={type:"nestedmenuitem",text:"Row",getSubmenuItems:m("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")};t.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:o("mceTableInsertColBefore"),onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:o("mceTableInsertColAfter"),onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:o("mceTableDeleteCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")});var s={type:"nestedmenuitem",text:"Column",getSubmenuItems:m("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")};t.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:o("mceTableCellProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:o("mceTableMergeCells"),onSetup:n.onSetupMergeable}),t.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:o("mceTableSplitCells"),onSetup:n.onSetupUnmergeable});var l={type:"nestedmenuitem",text:"Cell",getSubmenuItems:m("tablecellprops tablemergecells tablesplitcells")};!1===function(t){return t.getParam("table_grid",!0,"boolean")}(t)?t.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTable")}):t.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:i}]}}),t.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTable")}),t.ui.registry.addMenuItem("tableprops",a),t.ui.registry.addMenuItem("deletetable",u),t.ui.registry.addNestedMenuItem("row",c),t.ui.registry.addNestedMenuItem("column",s),t.ui.registry.addNestedMenuItem("cell",l),t.ui.registry.addContextMenu("table",{update:function(){return n.resetTargets(),n.targets().fold(m(""),(function(t){return"caption"===oe(t.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}});var f=cf(ju(t));0!==f.length&&t.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return af(t,e,f,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)}))},onSetup:n.onSetupTable});var d=cf(Vu(t));0!==d.length&&t.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return af(t,e,d,"tablecellclass",(function(e){return t.execCommand("mceTableCellToggleClass",!1,e)}))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:function(){return af(t,e,Vl,"tablecellverticalalign",uf(t,"vertical-align"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return af(t,e,Mu(t),"tablecellborderwidth",uf(t,"border-width"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return af(t,e,Bu(t),"tablecellborderstyle",uf(t,"border-style"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablecaption",{icon:"table-caption",text:"Table caption",onAction:o("mceTableToggleCaption"),onSetup:n.onSetupTableWithCaption}),t.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:function(){return lf(t,Qu(t),"background-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return lf(t,Zu(t),"border-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablerowheader",{text:"Row header",icon:"table-top-header",onAction:ff(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleMenuItem("tablecolheader",{text:"Column header",icon:"table-left-header",onAction:df(t),onSetup:n.onSetupTableColumnHeaders})}(t,e,n,a),function(t,e,n,r){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(t){return t("inserttable | cell row column | advtablesort | tableprops deletetable")}});var o=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:o("mceTableProps"),icon:"table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:o("mceTableDelete"),icon:"table-delete-table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:o("mceTableCellProps"),icon:"table-cell-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:o("mceTableMergeCells"),icon:"table-merge-cells",onSetup:n.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:o("mceTableSplitCells"),icon:"table-split-cells",onSetup:n.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:o("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:o("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:o("mceTableDeleteRow"),icon:"table-delete-row",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:o("mceTableRowProps"),icon:"table-row-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:o("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:o("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:o("mceTableDeleteCol"),icon:"table-delete-column",onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:o("mceInsertTable"),icon:"table"});var i=cf(ju(t));0!==i.length&&t.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:sf(t,e,i,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)})),onSetup:n.onSetupTable});var a=cf(Vu(t));0!==a.length&&t.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:sf(t,e,a,"tablecellclass",(function(e){return t.execCommand("mceTableCellToggleClass",!1,e)})),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:sf(t,e,Vl,"tablecellverticalalign",uf(t,"vertical-align")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:sf(t,e,Mu(t),"tablecellborderwidth",uf(t,"border-width")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:sf(t,e,Bu(t),"tablecellborderstyle",uf(t,"border-style")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablecaption",{tooltip:"Table caption",onAction:o("mceTableToggleCaption"),icon:"table-caption",onSetup:n.onSetupTableWithCaption}),t.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:function(e){return e(lf(t,Qu(t),"background-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(e){return e(lf(t,Zu(t),"border-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablerowheader",{tooltip:"Row header",icon:"table-top-header",onAction:ff(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleButton("tablecolheader",{tooltip:"Column header",icon:"table-left-header",onAction:df(t),onSetup:n.onSetupTableColumnHeaders})}(t,e,n,a),function(t){var e=function(t){return t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")}(t);e.length>0&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})}(t),t.on("PreInit",(function(){t.serializer.addTempAttr(Fi.firstSelected),t.serializer.addTempAttr(Fi.lastSelected),function(t){t.formatter.register(Uf)}(t)})),function(t){return t.getParam("table_tab_navigation",!0,"boolean")}(t)&&t.on("keydown",(function(e){!function(t,e,n){if(t.keyCode===Id.TAB){var r=Ei(e),o=function(t){var e=oe(t);return Lt(t,r)||R(jd,e)},i=e.selection.getRng(),a=Mt.fromDom(t.shiftKey?i.startContainer:i.endContainer);gn(a,o).each((function(r){t.preventDefault(),vn(r,o).each(n.clear),e.selection.collapse(t.shiftKey),(t.shiftKey?Fd:Hd)(e,o,r).each((function(t){e.selection.setRng(t)}))}))}}(e,t,o)})),t.on("remove",(function(){r.destroy()})),function(t,e,n,r){return{insertTable:Ml(t),setClipboardRows:Dl(e.setRows),getClipboardRows:Al(e.getRows),setClipboardCols:Dl(e.setColumns),getClipboardCols:Al(e.getColumns),resizeHandler:n,selectionTargets:r}}(t,a,r,n)};Br.add("table",ag)}()},397:(t,e,n)=>{n(2738)},2738:()=>{!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(){return(e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function n(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var r,o,i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},a=i("string"),u=i("object"),c=i("array"),s=function(){},l=function(t){return function(){return t}},f=function(t){return t},d=l(!1),m=l(!0),g=function(){return h},h={fold:function(t,e){return t()},isSome:d,isNone:m,getOr:o=f,getOrThunk:r=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:o,orThunk:r,map:g,each:s,bind:g,exists:d,forall:m,filter:function(){return g()},toArray:function(){return[]},toString:l("none()")},p=function(t){var e=l(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:m,isNone:d,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return p(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:h},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},v={some:p,none:g,from:function(t){return null==t?h:p(t)}},b=Array.prototype.slice,y=Array.prototype.indexOf,w=function(t,e){return n=t,r=e,y.call(n,r)>-1;var n,r},x=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},C=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},S=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},k=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,(function(t,r){n=e(n,t,r)})),n},T=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return v.some(i);if(n(i,r))break}return v.none()}(t,e,d)},O=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},E=function(t){return function(t,e){return e>=0&&e<t.length?v.some(t[e]):v.none()}(t,0)},_=Object.keys,R=Object.hasOwnProperty;(function(t){if(!c(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};C(t,(function(r,o){var i=_(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!c(u))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==u.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+u.length+" ("+u+"), got "+i);var c=function(t){var r=_(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!O(e,(function(t){return w(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:c,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}}))})([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var N=function(t){var e=[],n=[];return C(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}},A=function(t){return{isValue:m,isError:d,getOr:l(t),getOrThunk:l(t),getOrDie:l(t),or:function(e){return A(t)},orThunk:function(e){return A(t)},fold:function(e,n){return n(t)},map:function(e){return A(e(t))},mapError:function(e){return A(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return v.some(t)}}},D=function(t){return{isValue:d,isError:m,getOr:f,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:f,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return D(t)},mapError:function(e){return D(e(t))},each:s,bind:function(e){return D(t)},exists:d,forall:m,toOptional:v.none}},M={value:A,error:D,fromOption:function(t,e){return t.fold((function(){return D(e)}),A)}},B=function(t){return"inline-command"===t.type||"inline-format"===t.type},z=function(t){return"block-command"===t.type||"block-format"===t.type},P=function(t){return e=t,n=function(t,e){return t.start.length===e.start.length?0:t.start.length>e.start.length?-1:1},(r=b.call(e,0)).sort(n),r;var e,n,r},L=function(t){var e=function(e){return M.error({message:e,pattern:t})},n=function(n,r,o){if(void 0!==t.format){var i=void 0;if(c(t.format)){if(!O(t.format,a))return e(n+" pattern has non-string items in the `format` array");i=t.format}else{if(!a(t.format))return e(n+" pattern has non-string `format` parameter");i=[t.format]}return M.value(r(i))}return void 0!==t.cmd?a(t.cmd)?M.value(o(t.cmd,t.value)):e(n+" pattern has non-string `cmd` parameter"):e(n+" pattern is missing both `format` and `cmd` parameters")};if(!u(t))return e("Raw pattern is not an object");if(!a(t.start))return e("Raw pattern is missing `start` parameter");if(void 0!==t.end){if(!a(t.end))return e("Inline pattern has non-string `end` parameter");if(0===t.start.length&&0===t.end.length)return e("Inline pattern has empty `start` and `end` parameters");var r=t.start,o=t.end;return 0===o.length&&(o=r,r=""),n("Inline",(function(t){return{type:"inline-format",start:r,end:o,format:t}}),(function(t,e){return{type:"inline-command",start:r,end:o,cmd:t,value:e}}))}return void 0!==t.replacement?a(t.replacement)?0===t.start.length?e("Replacement pattern has empty `start` parameter"):M.value({type:"inline-command",start:"",end:t.start,cmd:"mceInsertContent",value:t.replacement}):e("Replacement pattern has non-string `replacement` parameter"):0===t.start.length?e("Block pattern has empty `start` parameter"):n("Block",(function(e){return{type:"block-format",start:t.start,format:e[0]}}),(function(e,n){return{type:"block-command",start:t.start,cmd:e,value:n}}))},I=function(t){return"block-command"===t.type?{start:t.start,cmd:t.cmd,value:t.value}:"block-format"===t.type?{start:t.start,format:t.format}:"inline-command"===t.type?"mceInsertContent"===t.cmd&&""===t.start?{start:t.end,replacement:t.value}:{start:t.start,end:t.end,cmd:t.cmd,value:t.value}:"inline-format"===t.type?{start:t.start,end:t.end,format:1===t.format.length?t.format[0]:t.format}:void 0},H=function(t){return{inlinePatterns:S(t,B),blockPatterns:P(S(t,z))}},F="undefined"!=typeof window?window:Function("return this;")(),V=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=F.console;n&&(n.error?n.error.apply(n,t):n.log.apply(n,t))},j=[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],U=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},W=tinymce.util.Tools.resolve("tinymce.util.Delay"),q=tinymce.util.Tools.resolve("tinymce.util.VK"),$=tinymce.util.Tools.resolve("tinymce.util.Tools"),G=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),K=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),X=function(t,e){return{container:t,offset:e}},Y=function(t){return t.nodeType===Node.TEXT_NODE},J=function(t,e,n){if(e&&t.isEmpty(e)&&!n(e)){var r=e.parentNode;t.remove(e),J(t,r,n)}},Q=function(t,e,n,r){void 0===r&&(r=!0);var o=e.startContainer.parentNode,i=e.endContainer.parentNode;e.deleteContents(),r&&!n(e.startContainer)&&(Y(e.startContainer)&&0===e.startContainer.data.length&&t.remove(e.startContainer),Y(e.endContainer)&&0===e.endContainer.data.length&&t.remove(e.endContainer),J(t,o,n),o!==i&&J(t,i,n))},Z=function(t,e){var n=e.get(t);return c(n)&&E(n).exists((function(t){return e=t,n="block",R.call(e,n);var e,n}))},tt=function(t){return 0===t.start.length},et=function(t,e){var n=v.from(t.dom.getParent(e.startContainer,t.dom.isBlock));return""===U(t)?n.orThunk((function(){return v.some(t.getBody())})):n},nt=G.DOM,rt=function(t){return function(e){return t===e?-1:0}},ot=function(t,e,n){if(Y(t)&&e>=0)return v.some(X(t,e));var r=K(nt);return v.from(r.backwards(t,e,rt(t),n)).map((function(t){return X(t.container,t.container.data.length)}))},it=function(t,e,n){if(!Y(t))return v.none();var r=t.textContent;if(e>=0&&e<=r.length)return v.some(X(t,e));var o=K(nt);return v.from(o.backwards(t,e,rt(t),n)).bind((function(t){var r=t.container.data;return it(t.container,e+r.length,n)}))},at=function(t,e,n){if(!Y(t))return v.none();var r=t.textContent;if(e<=r.length)return v.some(X(t,e));var o=K(nt);return v.from(o.forwards(t,e,rt(t),n)).bind((function(t){return at(t.container,e-r.length,n)}))},ut=function(t,e,n,r,o){var i=K(t,function(t){return function(e){return t.isBlock(e)||w(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}}(t));return v.from(i.backwards(e,n,r,o))},ct=function(t,e,n){if(Y(e)&&(n<0||n>e.data.length))return[];for(var r=[n],o=e;o!==t&&o.parentNode;){for(var i=o.parentNode,a=0;a<i.childNodes.length;a++)if(i.childNodes[a]===o){r.push(a);break}o=i}return o===t?r.reverse():[]},st=function(t,e,n,r,o){return{start:ct(t,e,n),end:ct(t,r,o)}},lt=function(t,e){var n,r,o,i=e.slice(),a=i.pop();return(n=i,r=function(t,e){return t.bind((function(t){return v.from(t.childNodes[e])}))},o=v.some(t),C(n,(function(t,e){o=r(o,t,e)})),o).bind((function(t){return Y(t)&&(a<0||a>t.data.length)?v.none():v.some({node:t,offset:a})}))},ft=function(t,e){return lt(t,e.start).bind((function(n){var r=n.node,o=n.offset;return lt(t,e.end).map((function(t){var e=t.node,n=t.offset,i=document.createRange();return i.setStart(r,o),i.setEnd(e,n),i}))}))},dt=function(t,e,n){(function(t,e,n){if(Y(t)&&e>=t.length)return v.some(X(t,e));var r=K(nt);return v.from(r.forwards(t,e,rt(t),n)).map((function(t){return X(t.container,0)}))})(e,0,e).each((function(r){var o=r.container;at(o,n.start.length,e).each((function(n){var r=t.createRng();r.setStart(o,0),r.setEnd(n.container,n.offset),Q(t,r,(function(t){return t===e}))}))}))},mt=function(t,e){var n=t.dom,r=t.selection.getRng();return et(t,r).filter((function(e){var r=U(t),o=""===r&&n.is(e,"body")||n.is(e,r);return null!==e&&o})).bind((function(t){var r=t.textContent;return function(t,e){var n=e.replace(" "," ");return T(t,(function(t){return 0===e.indexOf(t.start)||0===n.indexOf(t.start)}))}(e,r).map((function(e){return $.trim(r).length===e.start.length?[]:[{pattern:e,range:st(n.getRoot(),t,0,t,0)}]}))})).getOr([])},gt=function(t,e){if(0!==e.length){var n=t.selection.getBookmark();C(e,(function(e){return function(t,e){var n=t.dom,r=e.pattern,o=ft(n.getRoot(),e.range).getOrDie("Unable to resolve path range");return et(t,o).each((function(e){"block-format"===r.type?Z(r.format,t.formatter)&&t.undoManager.transact((function(){dt(t.dom,e,r),t.formatter.apply(r.format)})):"block-command"===r.type&&t.undoManager.transact((function(){dt(t.dom,e,r),t.execCommand(r.cmd,!1,r.value)}))})),!0}(t,e)})),t.selection.moveToBookmark(n)}},ht=0,pt=function(t,e){return t.create("span",{"data-mce-type":"bookmark",id:e})},vt=function(t,e){var n=t.createRng();return n.setStartAfter(e.start),n.setEndBefore(e.end),n},bt=function(t,e,n){var r=ft(t.getRoot(),n).getOrDie("Unable to resolve path range"),o=r.startContainer,i=r.endContainer,a=0===r.endOffset?i:i.splitText(r.endOffset),u=0===r.startOffset?o:o.splitText(r.startOffset);return{prefix:e,end:a.parentNode.insertBefore(pt(t,e+"-end"),a),start:u.parentNode.insertBefore(pt(t,e+"-start"),u)}},yt=function(t,e,n){J(t,t.get(e.prefix+"-end"),n),J(t,t.get(e.prefix+"-start"),n)},wt=function(t,e,n,r){var o,i=e.start;return ut(t,r.container,r.offset,(o=i,function(t,e){var n=t.data.substring(0,e),r=n.lastIndexOf(o.charAt(o.length-1)),i=n.lastIndexOf(o);return-1!==i?i+o.length:-1!==r?r+1:-1}),n).bind((function(r){if(r.offset>=i.length){var o=t.createRng();return o.setStart(r.container,r.offset-i.length),o.setEnd(r.container,r.offset),v.some(o)}var a=r.offset-i.length;return it(r.container,a,n).map((function(e){var n=t.createRng();return n.setStart(e.container,e.offset),n.setEnd(r.container,r.offset),n})).filter((function(t){return t.toString()===i})).orThunk((function(){return wt(t,e,n,X(r.container,0))}))}))},xt=function(t,e,n){var r=t.dom,o=r.getRoot(),i=n.pattern,a=n.position.container,u=n.position.offset;return it(a,u-n.pattern.end.length,e).bind((function(c){var s=st(o,c.container,c.offset,a,u);if(tt(i))return v.some({matches:[{pattern:i,startRng:s,endRng:s}],position:c});var l=Ct(t,n.remainingPatterns,c.container,c.offset,e),f=l.getOr({matches:[],position:c}),d=f.position;return function(t,e,n,r,o,i){if(void 0===i&&(i=!1),0===e.start.length&&!i){var a=t.createRng();return a.setStart(n,r),a.setEnd(n,r),v.some(a)}return ot(n,r,o).bind((function(n){return wt(t,e,o,n).bind((function(t){if(i){if(t.endContainer===n.container&&t.endOffset===n.offset)return v.none();if(0===n.offset&&t.endContainer.textContent.length===t.endOffset)return v.none()}return v.some(t)}))}))}(r,i,d.container,d.offset,e,l.isNone()).map((function(t){var e=function(t,e){return st(t,e.startContainer,e.startOffset,e.endContainer,e.endOffset)}(o,t);return{matches:f.matches.concat([{pattern:i,startRng:e,endRng:s}]),position:X(t.startContainer,t.startOffset)}}))}))},Ct=function(t,e,n,r,o){var i=t.dom;return ot(n,r,i.getRoot()).bind((function(a){var u=i.createRng();u.setStart(o,0),u.setEnd(n,r);for(var c,s,l=u.toString(),f=0;f<e.length;f++){var d=e[f];if(c=l,s=d.end,function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(c,s,c.length-s.length)){var m=e.slice();m.splice(f,1);var g=xt(t,o,{pattern:d,remainingPatterns:m,position:a});if(g.isSome())return g}}return v.none()}))},St=function(t,e,n){t.selection.setRng(n),"inline-format"===e.type?C(e.format,(function(e){t.formatter.apply(e)})):t.execCommand(e.cmd,!1,e.value)},kt=function(t,n){var r,o,i=(r="mce_textpattern",o=(new Date).getTime(),r+"_"+Math.floor(1e9*Math.random())+ ++ht+String(o)),a=k(n,(function(n,r){var o=bt(t,i+"_end"+n.length,r.endRng);return n.concat([e(e({},r),{endMarker:o})])}),[]);return k(a,(function(n,r){var o=a.length-n.length-1,u=tt(r.pattern)?r.endMarker:bt(t,i+"_start"+o,r.startRng);return n.concat([e(e({},r),{startMarker:u})])}),[])},Tt=function(t,e,n){var r=t.selection.getRng();return!1===r.collapsed?[]:et(t,r).bind((function(o){var i=r.startOffset-(n?1:0);return Ct(t,e,r.startContainer,i,o)})).fold((function(){return[]}),(function(t){return t.matches}))},Ot=function(t,e){if(0!==e.length){var n=t.dom,r=t.selection.getBookmark(),o=kt(n,e);C(o,(function(e){var r=n.getParent(e.startMarker.start,n.isBlock),o=function(t){return t===r};tt(e.pattern)?function(t,e,n,r){var o=vt(t.dom,n);Q(t.dom,o,r),St(t,e,o)}(t,e.pattern,e.endMarker,o):function(t,e,n,r,o){var i=t.dom,a=vt(i,r),u=vt(i,n);Q(i,u,o),Q(i,a,o);var c={prefix:n.prefix,start:n.end,end:r.start},s=vt(i,c);St(t,e,s)}(t,e.pattern,e.startMarker,e.endMarker,o),yt(n,e.endMarker,o),yt(n,e.startMarker,o)})),t.selection.moveToBookmark(r)}},Et=function(t,e){var n=Tt(t,e.inlinePatterns,!0);n.length>0&&t.undoManager.transact((function(){Ot(t,n)}))},_t=function(t,e,n){for(var r=0;r<t.length;r++)if(n(t[r],e))return!0;return!1},Rt=function(t,e){var n=[",",".",";",":","!","?"],r=[32];t.on("keydown",(function(n){13!==n.keyCode||q.modifierPressed(n)||function(t,e){if(!t.selection.isCollapsed())return!1;var n=Tt(t,e.inlinePatterns,!1),r=mt(t,e.blockPatterns);return(r.length>0||n.length>0)&&(t.undoManager.add(),t.undoManager.extra((function(){t.execCommand("mceInsertNewLine")}),(function(){t.insertContent("\ufeff"),Ot(t,n),gt(t,r);var e=t.selection.getRng(),o=ot(e.startContainer,e.startOffset,t.dom.getRoot());t.execCommand("mceInsertNewLine"),o.each((function(e){var n=e.container;"\ufeff"===n.data.charAt(e.offset-1)&&(n.deleteData(e.offset-1,1),J(t.dom,n.parentNode,(function(e){return e===t.dom.getRoot()})))}))})),!0)}(t,e.get())&&n.preventDefault()}),!0),t.on("keyup",(function(n){_t(r,n,(function(t,e){return t===e.keyCode&&!1===q.modifierPressed(e)}))&&Et(t,e.get())})),t.on("keypress",(function(r){_t(n,r,(function(t,e){return t.charCodeAt(0)===e.charCode}))&&W.setEditorTimeout(t,(function(){Et(t,e.get())}))}))};t.add("textpattern",(function(t){var e=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}}(function(t){var e=t.getParam("textpattern_patterns",j,"array");if(!c(e))return V("The setting textpattern_patterns should be an array"),{inlinePatterns:[],blockPatterns:[]};var n=N(x(e,L));return C(n.errors,(function(t){return V(t.message,t.pattern)})),H(n.values)}(t));return Rt(t,e),function(t){return{setPatterns:function(e){var n=N(x(e,L));if(n.errors.length>0){var r=n.errors[0];throw new Error(r.message+":\n"+JSON.stringify(r.pattern,null,2))}t.set(H(n.values))},getPatterns:function(){return n(n([],x(t.get().inlinePatterns,I),!0),x(t.get().blockPatterns,I),!0)}}}(e)}))}()},3356:(t,e,n)=>{n(3562)},3562:()=>{!function(){"use strict";var t,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return t},r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o="[-'\\.‘’․﹒'.]",i="[:··״‧︓﹕:]",a="[±+*/,;;։،؍٬߸⁄︐︔﹐﹔,;]",u="[0-9٠-٩٫۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹]",c="\\r",s="\\n",l="[\v\f…\u2028\u2029]",f="[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᯦᮪-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-ᷦ᷼-᷿‌‍⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-゙゚︦]",d="[­؀-؃۝܏឴឵‎‏‪-‮⁠-⁤-\ufeff-]",m="[〱-〵゛゜゠-ヺー-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ン]",g="[=_‿⁀⁔︳︴﹍-﹏_∀-⋿<>]",h="[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]",p=0,v=1,b=2,y=3,w=4,x=5,C=6,S=7,k=8,T=9,O=10,E=11,_=12,R=13,N=[new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-׳ؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆༀཀ-ཇཉ-ཬྈ-ྌႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᯀ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〻〼ㄅ-ㄭㄱ-ㆎㆠ-ㆺꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐꞑꞠ-ꞩꟺ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),new RegExp(o),new RegExp(i),new RegExp(a),new RegExp(u),new RegExp(c),new RegExp(s),new RegExp(l),new RegExp(f),new RegExp(d),new RegExp(m),new RegExp(g),new RegExp("@")],A=new RegExp("^"+h+"$"),D=N,M=R,B=function(t){for(var e=M,n=D.length,r=0;r<n;++r){var o=D[r];if(o&&o.test(t)){e=r;break}}return e},z=function(t){var e,n;return function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t,(e=B,n={},function(t){if(n[t])return n[t];var r=e(t);return n[t]=r,r}))},P=function(t,e){var n=t[e],r=t[e+1];if(e<0||e>t.length-1&&0!==e)return!1;if(n===p&&r===p)return!1;var o=t[e+2];if(n===p&&(r===b||r===v||r===_)&&o===p)return!1;var i=t[e-1];return(n!==b&&n!==v&&r!==_||r!==p||i!==p)&&((n!==w&&n!==p||r!==w&&r!==p)&&((n!==y&&n!==v||r!==w||i!==w)&&((n!==w||r!==y&&r!==v||o!==w)&&(n!==k&&n!==T&&i!==k&&i!==T&&r!==k&&r!==T&&((n!==x||r!==C)&&(n===S||n===x||n===C||(r===S||r===x||r===C||(n!==O||r!==O)&&((r!==E||n!==p&&n!==w&&n!==O&&n!==E)&&((n!==E||r!==p&&r!==w&&r!==O)&&n!==_)))))))))},L=/^\s+$/,I=A,H=function(t){return"http"===t||"https"===t},F=function(t,e){var n=function(t,e){var n;for(n=e;n<t.length&&!L.test(t[n]);n++);return n}(t,e+1);return"://"===t.slice(e+1,n).join("").substr(0,3)?n:e},V=function(t,e,n){n=r(r({},{includeWhitespace:!1,includePunctuation:!1}),n);for(var o=[],i=[],a=0;a<t.length;a++){var u=e(t[a]);"\ufeff"!==u&&(o.push(t[a]),i.push(u))}return function(t,e,n,r){for(var o=[],i=[],a=0;a<n.length;++a)if(i.push(t[a]),P(n,a)){var u=e[a];if((r.includeWhitespace||!L.test(u))&&(r.includePunctuation||!I.test(u))){var c=a-i.length+1,s=a+1,l=e.slice(c,s).join("");if(H(l)){var f=F(e,a),d=t.slice(s,f);Array.prototype.push.apply(i,d),a=f}o.push(i)}i=[]}return o}(o,i,z(i),n)},j=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),U=function(t,e){for(var n=e.getBlockElements(),r=e.getShortEndedElements(),o=function(t){return n[t.nodeName]||r[t.nodeName]},i=[],a="",u=new j(t,t);t=u.next();)3===t.nodeType?a+=t.data.replace(/\uFEFF/g,""):o(t)&&a.length&&(i.push(a),a="");return a.length&&i.push(a),i},W=function(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},q=function(t,e){var r=U(t,e).join("\n");return V(r.split(""),n).length},$=function(t,e){var n=U(t,e).join("");return W(n)},G=function(t,e){var n=U(t,e).join("").replace(/\s/g,"");return W(n)},K=function(t,e){return function(){return e(t.getBody(),t.schema)}},X=function(t,e){return function(){return e(t.selection.getRng().cloneContents(),t.schema)}},Y=function(t){return K(t,q)},J=function(t,e){t.addCommand("mceWordCount",(function(){return function(t,e){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(e.body.getWordCount()),String(e.selection.getWordCount())],["Characters (no spaces)",String(e.body.getCharacterCountWithoutSpaces()),String(e.selection.getCharacterCountWithoutSpaces())],["Characters",String(e.body.getCharacterCount()),String(e.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})}(t,e)}))},Q=tinymce.util.Tools.resolve("tinymce.util.Delay"),Z=function(t,e){!function(t,e){t.fire("wordCountUpdate",{wordCount:{words:e.body.getWordCount(),characters:e.body.getCharacterCount(),charactersWithoutSpaces:e.body.getCharacterCountWithoutSpaces()}})}(t,e)};void 0===t&&(t=300),e.add("wordcount",(function(e){var n=function(t){return{body:{getWordCount:Y(t),getCharacterCount:K(t,$),getCharacterCountWithoutSpaces:K(t,G)},selection:{getWordCount:X(t,q),getCharacterCount:X(t,$),getCharacterCountWithoutSpaces:X(t,G)},getCount:Y(t)}}(e);return J(e,n),function(t){var e=function(){return t.execCommand("mceWordCount")};t.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:e}),t.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:e})}(e),function(t,e,n){var r=Q.debounce((function(){return Z(t,e)}),n);t.on("init",(function(){Z(t,e),Q.setEditorTimeout(t,(function(){t.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",r)}),0)}))}(e,n,t),n}))}()},5187:(t,e,n)=>{var r={"./content/dark/content.css":2968,"./content/dark/content.min.css":6202,"./content/default/content.css":7286,"./content/default/content.min.css":7362,"./content/document/content.css":287,"./content/document/content.min.css":2271,"./content/writer/content.css":5417,"./content/writer/content.min.css":874,"./ui/oxide-dark/content.css":3341,"./ui/oxide-dark/content.inline.css":8786,"./ui/oxide-dark/content.inline.min.css":4243,"./ui/oxide-dark/content.min.css":9702,"./ui/oxide-dark/content.mobile.css":1389,"./ui/oxide-dark/content.mobile.min.css":3513,"./ui/oxide-dark/fonts/tinymce-mobile.woff":1064,"./ui/oxide-dark/skin.css":8057,"./ui/oxide-dark/skin.min.css":6332,"./ui/oxide-dark/skin.mobile.css":4429,"./ui/oxide-dark/skin.mobile.min.css":18,"./ui/oxide-dark/skin.shadowdom.css":7899,"./ui/oxide-dark/skin.shadowdom.min.css":7548,"./ui/oxide/content.css":9506,"./ui/oxide/content.inline.css":8273,"./ui/oxide/content.inline.min.css":7251,"./ui/oxide/content.min.css":6122,"./ui/oxide/content.mobile.css":993,"./ui/oxide/content.mobile.min.css":8215,"./ui/oxide/fonts/tinymce-mobile.woff":9916,"./ui/oxide/skin.css":8382,"./ui/oxide/skin.min.css":4522,"./ui/oxide/skin.mobile.css":108,"./ui/oxide/skin.mobile.min.css":8537,"./ui/oxide/skin.shadowdom.css":818,"./ui/oxide/skin.shadowdom.min.css":6913};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=5187},8860:(t,e,n)=>{n(1768)},1768:(t,e,n)=>{!function(){"use strict";var t=function(t){return function(e){return function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(e)===t}},e=function(t){return function(e){return typeof e===t}},r=function(t){return function(e){return t===e}},o=t("string"),i=t("object"),a=t("array"),u=r(null),c=e("boolean"),s=r(void 0),l=function(t){return null==t},f=function(t){return!l(t)},d=e("function"),m=e("number"),g=function(t,e){if(a(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},h=function(){},p=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},v=function(t){return function(){return t}},b=function(t){return t},y=function(t,e){return t===e};function w(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var x=function(t){return function(e){return!t(e)}},C=function(t){return function(){throw new Error(t)}},S=v(!1),k=v(!0),T=tinymce.util.Tools.resolve("tinymce.ThemeManager"),O=function(){return(O=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function E(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function _(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var R,N,A=function(){return D},D={fold:function(t,e){return t()},isSome:S,isNone:k,getOr:N=b,getOrThunk:R=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:v(null),getOrUndefined:v(void 0),or:N,orThunk:R,map:A,each:h,bind:A,exists:S,forall:k,filter:function(){return A()},toArray:function(){return[]},toString:v("none()")},M=function(t){var e=v(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:k,isNone:S,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return M(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:D},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},B={some:M,none:A,from:function(t){return null==t?D:M(t)}},z=Array.prototype.slice,P=Array.prototype.indexOf,L=Array.prototype.push,I=function(t,e){return P.call(t,e)},H=function(t,e){return I(t,e)>-1},F=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},V=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},j=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=z.call(t,r,r+e);n.push(o)}return n},U=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},W=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},q=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var a=t[o];(e(a,o)?n:r).push(a)}return{pass:n,fail:r}},$=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},G=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,(function(t,r){n=e(n,t,r)})),n},K=function(t,e,n){return W(t,(function(t,r){n=e(n,t,r)})),n},X=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return B.some(i);if(n(i,r))break}return B.none()}(t,e,S)},Y=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return B.some(n)}return B.none()},J=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!a(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);L.apply(e,t[n])}return e},Q=function(t,e){return J(U(t,e))},Z=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},tt=function(t){var e=z.call(t,0);return e.reverse(),e},et=function(t,e){return $(t,(function(t){return!H(e,t)}))},nt=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},rt=function(t){return[t]},ot=function(t,e){var n=z.call(t,0);return n.sort(e),n},it=function(t,e){return e>=0&&e<t.length?B.some(t[e]):B.none()},at=function(t){return it(t,0)},ut=function(t){return it(t,t.length-1)},ct=d(Array.from)?Array.from:function(t){return z.call(t)},st=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return B.none()},lt=Object.keys,ft=Object.hasOwnProperty,dt=function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},mt=function(t,e){return gt(t,(function(t,n){return{k:n,v:e(t,n)}}))},gt=function(t,e){var n={};return dt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},ht=function(t,e){var n={};return function(t,e,n,r){dt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),h),n},pt=function(t,e){var n=[];return dt(t,(function(t,r){n.push(e(t,r))})),n},vt=function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r],a=t[i];if(e(a,i,t))return B.some(a)}return B.none()},bt=function(t){return pt(t,b)},yt=function(t,e){return wt(t,e)?B.from(t[e]):B.none()},wt=function(t,e){return ft.call(t,e)},xt=function(t,e){return wt(t,e)&&void 0!==t[e]&&null!==t[e]},Ct=function(t,e,n){return void 0===n&&(n=y),t.exists((function(t){return n(t,e)}))},St=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},kt=function(t,e,n){return t.isSome()&&e.isSome()?B.some(n(t.getOrDie(),e.getOrDie())):B.none()},Tt=function(t,e){return t?B.some(e):B.none()},Ot=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},Et=function(t,e){return-1!==t.indexOf(e)},_t=function(t,e){return Ot(t,e,0)},Rt=function(t,e){return Ot(t,e,t.length-e.length)},Nt=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),At=function(t){return t.length>0},Dt=function(t){return void 0!==t.style&&d(t.style.getPropertyValue)},Mt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Bt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Mt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Mt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Mt(n)},fromDom:Mt,fromPoint:function(t,e,n){return B.from(t.dom.elementFromPoint(e,n)).map(Mt)}};"undefined"!=typeof window?window:Function("return this;")();var zt,Pt=function(t){return t.dom.nodeName.toLowerCase()},Lt=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},It=Lt(1),Ht=Lt(3),Ft=Lt(9),Vt=Lt(11),jt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Ut=function(){return Wt(0,0)},Wt=function(t,e){return{major:t,minor:e}},qt={nu:Wt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Ut():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Wt(r(1),r(2))}(t,n)},unknown:Ut},$t=function(t,e){var n=String(e).toLowerCase();return X(t,(function(t){return t.search(n)}))},Gt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Kt=function(t){return function(e){return Et(e,t)}},Xt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Et(t,"edge/")&&Et(t,"chrome")&&Et(t,"safari")&&Et(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Gt],search:function(t){return Et(t,"chrome")&&!Et(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Et(t,"msie")||Et(t,"trident")}},{name:"Opera",versionRegexes:[Gt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Kt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Kt("firefox")},{name:"Safari",versionRegexes:[Gt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Et(t,"safari")||Et(t,"mobile/"))&&Et(t,"applewebkit")}}],Yt=[{name:"Windows",search:Kt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Et(t,"iphone")||Et(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Kt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Kt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Kt("linux"),versionRegexes:[]},{name:"Solaris",search:Kt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Kt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Kt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Jt={browsers:v(Xt),oses:v(Yt)},Qt="Edge",Zt="Chrome",te="Opera",ee="Firefox",ne="Safari",re=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Qt),isChrome:r(Zt),isIE:r("IE"),isOpera:r(te),isFirefox:r(ee),isSafari:r(ne)}},oe={unknown:function(){return re({current:void 0,version:qt.unknown()})},nu:re,edge:v(Qt),chrome:v(Zt),ie:v("IE"),opera:v(te),firefox:v(ee),safari:v(ne)},ie="Windows",ae="Android",ue="Linux",ce="Solaris",se="FreeBSD",le="ChromeOS",fe=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(ie),isiOS:r("iOS"),isAndroid:r(ae),isOSX:r("OSX"),isLinux:r(ue),isSolaris:r(ce),isFreeBSD:r(se),isChromeOS:r(le)}},de={unknown:function(){return fe({current:void 0,version:qt.unknown()})},nu:fe,windows:v(ie),ios:v("iOS"),android:v(ae),linux:v(ue),osx:v("OSX"),solaris:v(ce),freebsd:v(se),chromeos:v(le)},me=function(t,e,n){var r=Jt.browsers(),o=Jt.oses(),i=e.bind((function(t){return function(t,e){return st(e.brands,(function(e){var n=e.brand.toLowerCase();return X(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:qt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return $t(t,e).map((function(t){var n=qt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(oe.unknown,oe.nu),a=function(t,e){return $t(t,e).map((function(t){var n=qt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(de.unknown,de.nu),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:v(o),isiPhone:v(i),isTablet:v(c),isPhone:v(s),isTouch:v(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:v(l),isDesktop:v(f)}}(a,i,t,n);return{browser:i,os:a,deviceType:u}},ge=function(t){return window.matchMedia(t).matches},he=jt((function(){return me(navigator.userAgent,B.from(navigator.userAgentData),ge)})),pe=function(){return he()},ve=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},be=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},ye=function(t,e){return t.dom===e.dom},we=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)}(t.dom,e.dom)},xe=function(t,e){return pe().browser.isIE()?we(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Ce=function(t){return Bt.fromDom(t.dom.ownerDocument)},Se=function(t){return Ft(t)?t:Ce(t)},ke=function(t){return Bt.fromDom(Se(t).dom.documentElement)},Te=function(t){return Bt.fromDom(Se(t).dom.defaultView)},Oe=function(t){return B.from(t.dom.parentNode).map(Bt.fromDom)},Ee=function(t){return B.from(t.dom.offsetParent).map(Bt.fromDom)},_e=function(t){return U(t.dom.childNodes,Bt.fromDom)},Re=function(t,e){var n=t.dom.childNodes;return B.from(n[e]).map(Bt.fromDom)},Ne=function(t,e){return{element:t,offset:e}},Ae=function(t,e){var n=_e(t);return n.length>0&&e<n.length?Ne(n[e],0):Ne(t,e)},De=function(t){return Vt(t)&&f(t.dom.host)},Me=d(Element.prototype.attachShadow)&&d(Node.prototype.getRootNode),Be=v(Me),ze=Me?function(t){return Bt.fromDom(t.dom.getRootNode())}:Se,Pe=function(t){return De(t)?t:Bt.fromDom(Se(t).dom.body)},Le=function(t){var e=ze(t);return De(e)?B.some(e):B.none()},Ie=function(t){return Bt.fromDom(t.dom.host)},He=function(t){return f(t.dom.shadowRoot)},Fe=function(t){var e=Ht(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return Le(Bt.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=Fe,r=Ie,function(t){return n(r(t))}))},Ve=function(){return je(Bt.fromDom(document))},je=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return Bt.fromDom(e)},Ue=function(t,e,n){if(!(o(n)||c(n)||m(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},We=function(t,e,n){Ue(t.dom,e,n)},qe=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},$e=function(t,e){return B.from(qe(t,e))},Ge=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Ke=function(t,e){t.dom.removeAttribute(e)},Xe=function(t,e,n){if(!o(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Dt(t)&&t.style.setProperty(e,n)},Ye=function(t,e){Dt(t)&&t.style.removeProperty(e)},Je=function(t,e,n){var r=t.dom;Xe(r,e,n)},Qe=function(t,e){var n=t.dom;dt(e,(function(t,e){Xe(n,e,t)}))},Ze=function(t,e){var n=t.dom;dt(e,(function(t,e){t.fold((function(){Ye(n,e)}),(function(t){Xe(n,e,t)}))}))},tn=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Fe(t)?r:en(n,e)},en=function(t,e){return Dt(t)?t.style.getPropertyValue(e):""},nn=function(t,e){var n=t.dom,r=en(n,e);return B.from(r).filter((function(t){return t.length>0}))},rn=function(t){var e={},n=t.dom;if(Dt(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},on=function(t,e,n){var r=Bt.fromTag(t);return Je(r,e,n),nn(r,e).isSome()},an=function(t,e){var n=t.dom;Ye(n,e),Ct($e(t,"style").map(Nt),"")&&Ke(t,"style")},un=function(t){return t.dom.offsetWidth},cn=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=tn(n,t);return parseFloat(o)||0}return r},r=function(t,e){return K(e,(function(e,n){var r=tn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!m(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Dt(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},sn=cn("height",(function(t){var e=t.dom;return Fe(t)?e.getBoundingClientRect().height:e.offsetHeight})),ln=function(t){return sn.get(t)},fn=function(t){return sn.getOuter(t)},dn=function(t,e){return{left:t,top:e,translate:function(n,r){return dn(t+n,e+r)}}},mn=dn,gn=function(t,e){return void 0!==t?t:void 0!==e?e:0},hn=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return mn(n.offsetLeft,n.offsetTop);var i=gn(null==r?void 0:r.pageYOffset,o.scrollTop),a=gn(null==r?void 0:r.pageXOffset,o.scrollLeft),u=gn(o.clientTop,n.clientTop),c=gn(o.clientLeft,n.clientLeft);return pn(t).translate(a-c,i-u)},pn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?mn(n.offsetLeft,n.offsetTop):Fe(t)?function(t){var e=t.getBoundingClientRect();return mn(e.left,e.top)}(e):mn(0,0)},vn=cn("width",(function(t){return t.dom.offsetWidth})),bn=function(t){return vn.get(t)},yn=function(t){return vn.getOuter(t)},wn=function(t){var e=Bt.fromDom(function(t){if(Be()&&f(t.target)){var e=Bt.fromDom(t.target);if(It(e)&&He(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return at(n)}}return B.from(t.target)}(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=p(r,n);return function(t,e,n,r,o,i,a){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:a}}(e,t.clientX,t.clientY,n,r,o,t)},xn=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(wn(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:w(Cn,t,e,i,o)}},Cn=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Sn=function(t,e){Oe(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},kn=function(t,e){(function(t){return B.from(t.dom.nextSibling).map(Bt.fromDom)})(t).fold((function(){Oe(t).each((function(t){On(t,e)}))}),(function(t){Sn(t,e)}))},Tn=function(t,e){(function(t){return Re(t,0)})(t).fold((function(){On(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},On=function(t,e){t.dom.appendChild(e.dom)},En=function(t,e){W(e,(function(e){On(t,e)}))},_n=function(t){t.dom.textContent="",W(_e(t),(function(t){Rn(t)}))},Rn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Nn=function(t){var e,n=_e(t);n.length>0&&(e=t,W(n,(function(t){Sn(e,t)}))),Rn(t)},An=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return mn(n,r)},Dn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},Mn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Bn=function(t){var e=void 0===t?window:t,n=e.document,r=An(Bt.fromDom(n));return function(t){var e=void 0===t?window:t;return pe().browser.isFirefox()?B.none():B.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Mn(r.left,r.top,n,o)}),(function(t){return Mn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},zn=function(t,e){return t.view(e).fold(v([]),(function(e){var n=t.owner(e),r=zn(t,n);return[e].concat(r)}))},Pn=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?B.none():B.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Bt.fromDom)},owner:function(t){return Ce(t)}}),Ln=function(t){var e=Bt.fromDom(document),n=An(e);return function(t,e){var n=e.owner(t),r=zn(e,n);return B.some(r)}(t,Pn).fold(w(hn,t),(function(e){var r=pn(t),o=G(e,(function(t,e){var n=pn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return mn(o.left+r.left+n.left,o.top+r.top+n.top)}))},In=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Hn=function(t){var e=hn(t),n=yn(t),r=fn(t);return In(e.left,e.top,n,r)},Fn=function(t){var e=Ln(t),n=yn(t),r=fn(t);return In(e.left,e.top,n,r)},Vn=function(){return Bn(window)},jn=function(t){return{isValue:k,isError:S,getOr:v(t),getOrThunk:v(t),getOrDie:v(t),or:function(e){return jn(t)},orThunk:function(e){return jn(t)},fold:function(e,n){return n(t)},map:function(e){return jn(e(t))},mapError:function(e){return jn(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return B.some(t)}}},Un=function(t){return{isValue:S,isError:k,getOr:b,getOrThunk:function(t){return t()},getOrDie:function(){return C(String(t))()},or:b,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Un(t)},mapError:function(e){return Un(e(t))},each:h,bind:function(e){return Un(t)},exists:S,forall:k,toOptional:B.none}},Wn={value:jn,error:Un,fromOption:function(t,e){return t.fold((function(){return Un(e)}),jn)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(zt||(zt={}));var qn=function(t,e,n){return t.stype===zt.Error?e(t.serror):n(t.svalue)},$n=function(t){return{stype:zt.Value,svalue:t}},Gn=function(t){return{stype:zt.Error,serror:t}},Kn=function(t){return t.fold(Gn,$n)},Xn=function(t){return qn(t,Wn.error,Wn.value)},Yn=$n,Jn=function(t){var e=[],n=[];return W(t,(function(t){qn(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},Qn=Gn,Zn=function(t,e){return t.stype===zt.Value?e(t.svalue):t},tr=function(t,e){return t.stype===zt.Error?e(t.serror):t},er=function(t,e){return t.stype===zt.Value?{stype:zt.Value,svalue:e(t.svalue)}:t},nr=function(t,e){return t.stype===zt.Error?{stype:zt.Error,serror:e(t.serror)}:t},rr=qn,or=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},ir=function(t,e,n){switch(t.tag){case"field":return e(t.key,t.newKey,t.presence,t.prop);case"custom":return n(t.newKey,t.instantiator)}},ar=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var a in i)wt(i,a)&&(r[a]=t(r[a],i[a]))}return r}},ur=ar((function(t,e){return i(t)&&i(e)?ur(t,e):e})),cr=ar((function(t,e){return e})),sr=function(t){return{tag:"defaultedThunk",process:t}},lr=function(t){return sr(v(t))},fr=function(t){return{tag:"mergeWithThunk",process:t}},dr=function(t){return p(Qn,J)(t)},mr=function(t){var e=Jn(t);return e.errors.length>0?dr(e.errors):Yn(e.values)},gr=function(t){return i(t)&&lt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},hr=function(t,e){return Qn([{path:t,getErrorInfo:e}])},pr=function(t){return{extract:function(e,n){return tr(t(n),(function(t){return function(t,e){return hr(t,v(e))}(e,t)}))},toString:v("val")}},vr=pr(Yn),br=function(t,e,n,r){return yt(e,n).fold((function(){return function(t,e,n){return hr(t,(function(){return'Could not find valid *required* value for "'+e+'" in '+gr(n)}))}(t,n,e)}),r)},yr=function(t,e,n,r){return r(yt(t,e).getOrThunk((function(){return n(t)})))},wr=function(t,e,n,r,o){var i=function(t){return o.extract(e.concat([r]),t)},a=function(t){return t.fold((function(){return Yn(B.none())}),(function(t){var n=o.extract(e.concat([r]),t);return er(n,B.some)}))};switch(t.tag){case"required":return br(e,n,r,i);case"defaultedThunk":return yr(n,r,t.process,i);case"option":return function(t,e,n){return n(yt(t,e))}(n,r,a);case"defaultedOptionThunk":return function(t,e,n,r){return r(yt(t,e).map((function(e){return!0===e?n(t):e})))}(n,r,t.process,a);case"mergeWithThunk":return yr(n,r,v({}),(function(e){var r=ur(t.process(n),e);return i(r)}))}},xr=function(t){return{extract:function(e,n){return t().extract(e,n)},toString:function(){return t().toString()}}},Cr=function(t){return lt(ht(t,f))},Sr=function(t){var e=kr(t),n=G(t,(function(t,e){return ir(e,(function(e){var n;return ur(t,((n={})[e]=!0,n))}),v(t))}),{});return{extract:function(t,r){var o=c(r)?[]:Cr(r),i=$(o,(function(t){return!xt(n,t)}));return 0===i.length?e.extract(t,r):function(t,e){return hr(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,i)},toString:e.toString}},kr=function(t){return{extract:function(e,n){return function(t,e,n){for(var r={},o=[],i=0,a=n;i<a.length;i++){var u=a[i];ir(u,(function(n,i,a,u){var c=wr(a,t,e,n,u);rr(c,(function(t){o.push.apply(o,t)}),(function(t){r[i]=t}))}),(function(t,n){r[t]=n(e)}))}return o.length>0?Qn(o):Yn(r)}(e,n,t)},toString:function(){return"obj{\n"+U(t,(function(t){return ir(t,(function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},Tr=function(t){return{extract:function(e,n){var r=U(n,(function(n,r){return t.extract(e.concat(["["+r+"]"]),n)}));return mr(r)},toString:function(){return"array("+t.toString()+")"}}},Or=function(t){return{extract:function(e,n){for(var r=[],o=0,i=t;o<i.length;o++){var a=i[o].extract(e,n);if(a.stype===zt.Value)return a;r.push(a)}return mr(r)},toString:function(){return"oneOf("+U(t,(function(t){return t.toString()})).join(", ")+")"}}},Er=function(t,e){return{extract:function(n,r){var o=lt(r),i=function(e,n){return Tr(pr(t)).extract(e,n)}(n,o);return Zn(i,(function(t){var o=U(t,(function(t){return or(t,t,{tag:"required",process:{}},e)}));return kr(o).extract(n,r)}))},toString:function(){return"setOf("+e.toString()+")"}}},_r=p(Tr,kr),Rr=v(vr),Nr=function(t,e){return pr((function(n){var r=typeof n;return t(n)?Yn(n):Qn("Expected type: "+e+" but got: "+r)}))},Ar=Nr(m,"number"),Dr=Nr(o,"string"),Mr=Nr(c,"boolean"),Br=Nr(d,"function"),zr=function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every((function(e){return zr(t[e])}));default:return!1}},Pr=pr((function(t){return zr(t)?Yn(t):Qn("Expected value to be acceptable for sending via postMessage")})),Lr=function(t,e,n,r){return yt(n,r).fold((function(){return function(t,e,n){return hr(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+gr(e)}))}(t,n,r)}),(function(n){return n.extract(t.concat(["branch: "+r]),e)}))},Ir=function(t,e){return{extract:function(n,r){return yt(r,t).fold((function(){return function(t,e){return hr(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return Lr(n,r,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+lt(e)}}},Hr=function(t){return pr((function(e){return t(e).fold(Qn,Yn)}))},Fr=function(t,e){return Er((function(e){return Kn(t(e))}),e)},Vr=function(t,e,n){return Xn(function(t,e,n){var r=e.extract([t],n);return nr(r,(function(t){return{input:n,errors:t}}))}(t,e,n))},jr=function(t){return t.fold((function(t){throw new Error(Wr(t))}),b)},Ur=function(t,e,n){return jr(Vr(t,e,n))},Wr=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:v("... (only showing first ten failures)")}]):e,U(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+gr(t.input);var e,n},qr=function(t,e){return Ir(t,mt(e,kr))},$r=or,Gr=function(t,e){return{tag:"custom",newKey:t,instantiator:e}},Kr=function(t){return Hr((function(e){return H(t,e)?Wn.value(e):Wn.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},Xr=function(t){return $r(t,t,{tag:"required",process:{}},Rr())},Yr=function(t,e){return $r(t,t,{tag:"required",process:{}},e)},Jr=function(t){return Yr(t,Ar)},Qr=function(t){return Yr(t,Dr)},Zr=function(t,e){return $r(t,t,{tag:"required",process:{}},Kr(e))},to=function(t){return Yr(t,Br)},eo=function(t,e){return $r(t,t,{tag:"required",process:{}},kr(e))},no=function(t,e){return $r(t,t,{tag:"required",process:{}},_r(e))},ro=function(t,e){return $r(t,t,{tag:"required",process:{}},Tr(e))},oo=function(t){return $r(t,t,{tag:"option",process:{}},Rr())},io=function(t,e){return $r(t,t,{tag:"option",process:{}},e)},ao=function(t){return io(t,Ar)},uo=function(t){return io(t,Dr)},co=function(t){return io(t,Br)},so=function(t,e){return io(t,Tr(e))},lo=function(t,e){return io(t,kr(e))},fo=function(t,e){return $r(t,t,lr(e),Rr())},mo=function(t,e,n){return $r(t,t,lr(e),n)},go=function(t,e){return mo(t,e,Ar)},ho=function(t,e){return mo(t,e,Dr)},po=function(t,e,n){return mo(t,e,Kr(n))},vo=function(t,e){return mo(t,e,Mr)},bo=function(t,e){return mo(t,e,Br)},yo=function(t,e,n){return mo(t,e,Tr(n))},wo=function(t,e,n){return mo(t,e,kr(n))},xo=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Co=function(t){if(!a(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return W(t,(function(r,o){var i=lt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],c=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!a(c))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+c.length+" ("+c+"), got "+i);var a=function(t){var r=lt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!Z(e,(function(t){return H(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:a,log:function(t){console.log(t,{constructors:e,constructor:u,params:n})}}}})),n};Co([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var So,ko=function(t,e){return function(t,e){var n={};return dt(t,(function(t,r){H(e,r)||(n[r]=t)})),n}(t,e)},To=function(t,e){return function(t,e){var n;return(n={})[t]=e,n}(t,e)},Oo=function(t){return function(t){var e={};return W(t,(function(t){e[t.key]=t.value})),e}(t)},Eo=function(t,e){var n,r=function(t){var e=[],n=[];return W(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}(t);return r.errors.length>0?(n=r.errors,Wn.error(J(n))):function(t,e){return 0===t.length?Wn.value(e):Wn.value(ur(e,cr.apply(void 0,t)))}(r.values,e)},_o=function(t){return d(t)?t:S},Ro=function(t,e,n){for(var r=t.dom,o=_o(n);r.parentNode;){r=r.parentNode;var i=Bt.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return B.none()},No=function(t,e,n){var r=e(t),o=_o(n);return r.orThunk((function(){return o(t)?B.none():Ro(t,e,o)}))},Ao=function(t,e){return ye(t.element,e.event.target)},Do={can:k,abort:S,run:h},Mo=function(t){if(!xt(t,"can")&&!xt(t,"abort")&&!xt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return O(O({},Do),t)},Bo=function(t){return{can:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return K(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),abort:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return K(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort})),run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];W(t,(function(t){t.run.apply(void 0,e)}))}}},zo=v,Po=zo("touchstart"),Lo=zo("touchmove"),Io=zo("touchend"),Ho=zo("touchcancel"),Fo=zo("mousedown"),Vo=zo("mousemove"),jo=zo("mouseout"),Uo=zo("mouseup"),Wo=zo("mouseover"),qo=zo("focusin"),$o=zo("focusout"),Go=zo("keydown"),Ko=zo("keyup"),Xo=zo("input"),Yo=zo("change"),Jo=zo("click"),Qo=zo("transitioncancel"),Zo=zo("transitionend"),ti=zo("transitionstart"),ei=zo("selectstart"),ni=function(t){return v("alloy."+t)},ri={tap:ni("tap")},oi=ni("focus"),ii=ni("blur.post"),ai=ni("paste.post"),ui=ni("receive"),ci=ni("execute"),si=ni("focus.item"),li=ri.tap,fi=ni("longpress"),di=ni("sandbox.close"),mi=ni("typeahead.cancel"),gi=ni("system.init"),hi=ni("system.touchmove"),pi=ni("system.touchend"),vi=ni("system.scroll"),bi=ni("system.resize"),yi=ni("system.attached"),wi=ni("system.detached"),xi=ni("system.dismissRequested"),Ci=ni("system.repositionRequested"),Si=ni("focusmanager.shifted"),ki=ni("slotcontainer.visibility"),Ti=ni("change.tab"),Oi=ni("dismiss.tab"),Ei=ni("highlight"),_i=ni("dehighlight"),Ri=function(t,e){Mi(t,t.element,e,{})},Ni=function(t,e,n){Mi(t,t.element,e,n)},Ai=function(t){Ri(t,ci())},Di=function(t,e,n){Mi(t,e,n,{})},Mi=function(t,e,n,r){var o=O({target:e},r);t.getSystem().triggerEvent(n,e,o)},Bi=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},zi=function(t){return Oo(t)},Pi=function(t,e){return{key:t,value:Mo({abort:e})}},Li=function(t){return{key:t,value:Mo({run:function(t,e){e.event.prevent()}})}},Ii=function(t,e){return{key:t,value:Mo({run:e})}},Hi=function(t,e,n){return{key:t,value:Mo({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Fi=function(t){return function(e){return{key:t,value:Mo({run:function(t,n){Ao(t,n)&&e(t,n)}})}}},Vi=function(t,e,n){return function(t,e){return Ii(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){Bi(e,e.element,t,r)}))}))}(t,e.partUids[n])},ji=function(t,e){return Ii(t,(function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).getOrThunk((function(){return No(r.target,(function(e){return t.getSystem().getByDom(e).toOptional()}),S).getOr(t)}));e(t,o,n)}))},Ui=function(t){return Ii(t,(function(t,e){e.cut()}))},Wi=function(t){return Ii(t,(function(t,e){e.stop()}))},qi=function(t,e){return Fi(t)(e)},$i=Fi(yi()),Gi=Fi(wi()),Ki=Fi(gi()),Xi=function(t){return function(e){return Ii(t,e)}}(ci()),Yi=function(t){return t.dom.innerHTML},Ji=function(t,e){var n,r,o=Ce(t).dom,i=Bt.fromDom(o.createDocumentFragment()),a=(n=e,(r=(o||document).createElement("div")).innerHTML=n,_e(Bt.fromDom(r)));En(i,a),_n(t),On(t,i)},Qi=function(t){return function(t,e){return Bt.fromDom(t.dom.cloneNode(e))}(t,!1)},Zi=function(t){return De(t)?"#shadow-root":function(t){var e=Bt.fromTag("div"),n=Bt.fromDom(t.dom.cloneNode(!0));return On(e,n),Yi(e)}(Qi(t))},ta=function(t){return Zi(t)},ea=zi([function(t,e){return{key:t,value:Mo({can:e})}}(oi(),(function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return ye(e,t.element)&&!ye(e,n)}(t,r,o)||(console.warn(oi()+" did not get interpreted by the desired target. \nOriginator: "+ta(r)+"\nTarget: "+ta(o)+"\nCheck the "+oi()+" event handlers"),!1)}))]),na=Object.freeze({__proto__:null,events:ea}),ra=0,oa=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++ra+String(e)},ia=v("alloy-id-"),aa=v("data-alloy-id"),ua=ia(),ca=aa(),sa=function(t,e){Object.defineProperty(t.dom,ca,{value:e,writable:!0})},la=function(t){var e=It(t)?t.dom[ca]:null;return B.from(e)},fa=function(t){return oa(t)},da=b,ma=function(t){var e=function(e){return"The component must be in a context to execute: "+e+(t?"\n"+ta(t().element)+" is not in context.":"")},n=function(t){return function(){throw new Error(e(t))}},r=function(t){return function(){console.warn(e(t))}};return{debugInfo:v("fake"),triggerEvent:r("triggerEvent"),triggerFocus:r("triggerFocus"),triggerEscape:r("triggerEscape"),broadcast:r("broadcast"),broadcastOn:r("broadcastOn"),broadcastEvent:r("broadcastEvent"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),isConnected:S}},ga=ma(),ha=function(t){return U(t,(function(t){return Rt(t,"/*")?t.substring(0,t.length-"/*".length):t}))},pa=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ha(i)}},t},va=oa("alloy-premade"),ba=function(t){return To(va,t)},ya=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ha(i.slice(1))}},t}((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,_([e.getApis(),e],n,!1))}),t)},wa={init:function(){return xa({readState:v("No State required")})}},xa=function(t){return t},Ca=function(t,e){var n={};return dt(t,(function(t,r){dt(t,(function(t,o){var i=yt(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},Sa=function(t){return{classes:s(t.classes)?[]:t.classes,attributes:s(t.attributes)?{}:t.attributes,styles:s(t.styles)?{}:t.styles}},ka=function(t){return t.cHandler},Ta=function(t,e){return{name:t,handler:e}},Oa=function(t,e,n){var r=O(O({},n),function(t,e){var n={};return W(t,(function(t){n[t.name()]=t.handlers(e)})),n}(e,t));return Ca(r,Ta)},Ea=function(t){var e=function(t){return d(t)?{can:k,abort:S,run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}},_a=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=ot(n,(function(n,o){var i=n[e],a=o[e],u=r.indexOf(i),c=r.indexOf(a);if(-1===u)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(r,null,2));return u<c?-1:c<u?1:0}));return Wn.value(o)}catch(t){return Wn.error([t])}}("Event: "+n,"name",t,r).map((function(t){var e=U(t,(function(t){return t.handler}));return Bo(e)})):function(t,e){return Wn.error(["The event ("+t+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(U(e,(function(t){return t.name})),null,2)])}(n,t)},Ra=function(t,e){var n=pt(t,(function(t,n){return(1===t.length?Wn.value(t[0].handler):_a(t,e,n)).map((function(r){var o=Ea(r),i=t.length>1?$(e[n],(function(e){return F(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return To(n,function(t,e){return{handler:t,purpose:e}}(o,i))}))}));return Eo(n,{})},Na="alloy.base.behaviour",Aa=kr([$r("dom","dom",{tag:"required",process:{}},kr([Xr("tag"),fo("styles",{}),fo("classes",[]),fo("attributes",{}),oo("value"),oo("innerHtml")])),Xr("components"),Xr("uid"),fo("events",{}),fo("apis",{}),$r("eventOrder","eventOrder",function(t){return fr(v(t))}((So={},So[ci()]=["disabling",Na,"toggling","typeaheadevents"],So[oi()]=[Na,"focusing","keying"],So[gi()]=[Na,"disabling","toggling","representing"],So[Xo()]=[Na,"representing","streaming","invalidating"],So[wi()]=[Na,"representing","item-events","tooltipping"],So[Fo()]=["focusing",Na,"item-type-events"],So[Po()]=["focusing",Na,"item-type-events"],So[Wo()]=["item-type-events","tooltipping"],So[ui()]=["receiving","reflecting","tooltipping"],So)),Rr()),oo("domModification")]),Da=function(t){return t.events},Ma=function(t,e){var n=qe(t,e);return void 0===n||""===n?[]:n.split(" ")},Ba=function(t){return void 0!==t.dom.classList},za=function(t,e){return function(t,e,n){var r=Ma(t,e).concat([n]);return We(t,e,r.join(" ")),!0}(t,"class",e)},Pa=function(t,e){return function(t,e,n){var r=$(Ma(t,e),(function(t){return t!==n}));return r.length>0?We(t,e,r.join(" ")):Ke(t,e),!1}(t,"class",e)},La=function(t,e){Ba(t)?t.dom.classList.add(e):za(t,e)},Ia=function(t){0===(Ba(t)?t.dom.classList:function(t){return Ma(t,"class")}(t)).length&&Ke(t,"class")},Ha=function(t,e){Ba(t)?t.dom.classList.remove(e):Pa(t,e);Ia(t)},Fa=function(t,e){return Ba(t)&&t.dom.classList.contains(e)},Va=function(t,e){W(e,(function(e){La(t,e)}))},ja=function(t,e){W(e,(function(e){Ha(t,e)}))},Ua=function(t){return t.dom.value},Wa=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},qa=function(t){var e=Bt.fromTag(t.tag);!function(t,e){var n=t.dom;dt(e,(function(t,e){Ue(n,e,t)}))}(e,t.attributes),Va(e,t.classes),Qe(e,t.styles),t.innerHtml.each((function(t){return Ji(e,t)}));var n=t.domChildren;return En(e,n),t.value.each((function(t){Wa(e,t)})),t.uid,sa(e,t.uid),e},$a=function(t,e){return function(t,e){var n=U(e,(function(t){return lo(t.name(),[Xr("config"),fo("state",wa)])})),r=Vr("component.behaviours",kr(n),t.behaviours).fold((function(e){throw new Error(Wr(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),b);return{list:e,data:mt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return v(e)}))}}(t,e)},Ga=function(t){var e=function(t){var e=yt(t,"behaviours").getOr({});return Q(lt(e),(function(t){var n=e[t];return f(n)?[n.me]:[]}))}(t);return $a(t,e)},Ka=function(t,e,n){var r,o,i,a=O(O({},(r=t).dom),{uid:r.uid,domChildren:U(r.components,(function(t){return t.element}))}),u=function(t){return t.domModification.fold((function(){return Sa({})}),Sa)}(t),c={"alloy.base.modification":u},s=e.length>0?function(t,e,n,r){var o=O({},e);W(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=Ca(o,(function(t,e){return{name:t,modification:e}})),a=function(t){return G(t,(function(t,e){return O(O({},e.modification),t)}),{})},u=G(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=a(i.attributes),s=a(i.styles);return Sa({classes:u,attributes:c,styles:s})}(n,c,e,a):u;return i=s,O(O({},o=a),{attributes:O(O({},o.attributes),i.attributes),styles:O(O({},o.styles),i.styles),classes:o.classes.concat(i.classes)})},Xa=function(t,e,n){var r={"alloy.base.behaviour":Da(t)};return function(t,e,n,r){var o=Oa(t,n,r);return Ra(o,e)}(n,t.eventOrder,e,r).getOrDie()},Ya=function(t){var e=function(){return f},n=xo(ga),r=jr(function(t){return Vr("custom.definition",Aa,t)}(t)),o=Ga(t),i=function(t){return t.list}(o),a=function(t){return t.data}(o),u=Ka(r,i,a),c=qa(u),s=Xa(r,i,a),l=xo(r.components),f={uid:t.uid,getSystem:n.get,config:function(e){var n=a;return(d(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return d(a[t.name()])},spec:t,readState:function(t){return a[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(ma(e))},element:c,syncComponents:function(){var t=_e(c),e=Q(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),rt)}));l.set(e)},components:l.get,events:s};return f},Ja=function(t){var e=da(t),n=e.events,r=E(e,["events"]),o=function(t){var e=yt(t,"components").getOr([]);return U(e,eu)}(r),i=O(O({},r),{events:O(O({},na),n),components:o});return Wn.value(Ya(i))},Qa=function(t){var e=Bt.fromText(t);return Za({element:e})},Za=function(t){var e=Ur("external.component",Sr([Xr("element"),oo("uid")]),t),n=xo(ma()),r=e.uid.getOrThunk((function(){return fa("external")}));sa(e.element,r);var o={uid:r,getSystem:n.get,config:B.none,hasConfigured:S,connect:function(t){n.set(t)},disconnect:function(){n.set(ma((function(){return o})))},getApis:function(){return{}},element:e.element,spec:t,readState:v("No state"),syncComponents:h,components:v([]),events:{}};return ba(o)},tu=fa,eu=function(t){return function(t){return yt(t,va)}(t).getOrThunk((function(){var e=function(t){return wt(t,"uid")}(t)?t:O({uid:tu("")},t);return Ja(e).getOrDie()}))},nu=ba;function ru(t,e,n,r,o){return t(n,r)?B.some(n):d(o)&&o(n)?B.none():e(n,r,o)}var ou,iu=function(t,e,n){for(var r=t.dom,o=d(n)?n:S;r.parentNode;){r=r.parentNode;var i=Bt.fromDom(r);if(e(i))return B.some(i);if(o(i))break}return B.none()},au=function(t,e,n){return ru((function(t,e){return e(t)}),iu,t,e,n)},uu=function(t,e,n){return au(t,e,n).isSome()},cu=function(t,e,n){return iu(t,(function(t){return ve(t,e)}),n)},su=function(t,e){return function(t,e){return X(t.dom.childNodes,(function(t){return e(Bt.fromDom(t))})).map(Bt.fromDom)}(t,(function(t){return ve(t,e)}))},lu=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return be(n)?B.none():B.from(n.querySelector(t)).map(Bt.fromDom)}(e,t)},fu=function(t,e,n){return ru((function(t,e){return ve(t,e)}),cu,t,e,n)},du=function(){var t=oa("aria-owns");return{id:t,link:function(e){We(e,"aria-owns",t)},unlink:function(t){Ke(t,"aria-owns")}}},mu=function(t,e){return function(t){return au(t,(function(t){if(!It(t))return!1;var e=qe(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1})).bind((function(t){var e=qe(t,"id"),n=ze(t);return lu(n,'[aria-owns="'+e+'"]')}))}(e).exists((function(e){return gu(t,e)}))},gu=function(t,e){return uu(e,(function(e){return ye(e,t.element)}),S)||mu(t,e)},hu="unknown";!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(ou||(ou={}));var pu=xo({}),vu=function(t,e,n){switch(yt(pu.get(),t).orThunk((function(){var e=lt(pu.get());return st(e,(function(e){return t.indexOf(e)>-1?B.some(pu.get()[e]):B.none()}))})).getOr(ou.NORMAL)){case ou.NORMAL:return n(wu());case ou.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();H(["mousemove","mouseover","mouseout",gi()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:U(n,(function(t){return H(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+ta(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case ou.STOP:return!0}},bu=["alloy/data/Fields","alloy/debugging/Debugging"],yu=function(t,e,n){return vu(t,e,n)},wu=v({logEventCut:h,logEventStopped:h,logNoParent:h,logEventNoHandlers:h,logEventResponse:h,write:h}),xu=v([Xr("menu"),Xr("selectedMenu")]),Cu=v([Xr("item"),Xr("selectedItem")]);v(kr(Cu().concat(xu())));var Su=v(kr(Cu())),ku=eo("initSize",[Xr("numColumns"),Xr("numRows")]),Tu=function(){return eo("markers",[Xr("backgroundMenu")].concat(xu()).concat(Cu()))},Ou=function(t){return eo("markers",U(t,Xr))},Eu=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return X(e,(function(t){return t.indexOf("alloy")>0&&!F(bu,(function(e){return t.indexOf(e)>-1}))})).getOr(hu)}}(),$r(e,e,n,Hr((function(t){return Wn.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},_u=function(t){return Eu(0,t,lr(h))},Ru=function(t){return Eu(0,t,lr(B.none))},Nu=function(t){return Eu(0,t,{tag:"required",process:{}})},Au=function(t){return Eu(0,t,{tag:"required",process:{}})},Du=function(t,e){return Gr(t,v(e))},Mu=function(t){return Gr(t,b)},Bu=v(ku),zu=function(t,e,n,r,o,i,a,u){return void 0===u&&(u=!1),{x:t,y:e,bubble:n,direction:r,placement:o,restriction:i,label:a+"-"+o,alwaysFit:u}},Pu=Co([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Lu=Pu.southeast,Iu=Pu.southwest,Hu=Pu.northeast,Fu=Pu.northwest,Vu=Pu.south,ju=Pu.north,Uu=Pu.east,Wu=Pu.west,qu=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},$u=function(t,e,n){return Math.min(Math.max(t,e),n)},Gu=function(t,e){return nt(["left","right","top","bottom"],(function(n){return yt(e,n).map((function(e){return function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(t,e)}))}))},Ku="layout",Xu=function(t){return t.x},Yu=function(t,e){return t.x+t.width/2-e.width/2},Ju=function(t,e){return t.x+t.width-e.width},Qu=function(t,e){return t.y-e.height},Zu=function(t){return t.y+t.height},tc=function(t,e){return t.y+t.height/2-e.height/2},ec=function(t,e,n){return zu(Xu(t),Zu(t),n.southeast(),Lu(),"southeast",Gu(t,{left:1,top:3}),Ku)},nc=function(t,e,n){return zu(Ju(t,e),Zu(t),n.southwest(),Iu(),"southwest",Gu(t,{right:0,top:3}),Ku)},rc=function(t,e,n){return zu(Xu(t),Qu(t,e),n.northeast(),Hu(),"northeast",Gu(t,{left:1,bottom:2}),Ku)},oc=function(t,e,n){return zu(Ju(t,e),Qu(t,e),n.northwest(),Fu(),"northwest",Gu(t,{right:0,bottom:2}),Ku)},ic=function(t,e,n){return zu(Yu(t,e),Qu(t,e),n.north(),ju(),"north",Gu(t,{bottom:2}),Ku)},ac=function(t,e,n){return zu(Yu(t,e),Zu(t),n.south(),Vu(),"south",Gu(t,{top:3}),Ku)},uc=function(t,e,n){return zu(function(t){return t.x+t.width}(t),tc(t,e),n.east(),Uu(),"east",Gu(t,{left:0}),Ku)},cc=function(t,e,n){return zu(function(t,e){return t.x-e.width}(t,e),tc(t,e),n.west(),Wu(),"west",Gu(t,{right:1}),Ku)},sc=function(){return[ec,nc,rc,oc,ac,ic,uc,cc]},lc=function(){return[nc,ec,oc,rc,ac,ic,uc,cc]},fc=function(){return[rc,oc,ec,nc,ic,ac]},dc=function(){return[oc,rc,nc,ec,ic,ac]},mc=function(){return[ec,nc,rc,oc,ac,ic]},gc=function(){return[nc,ec,oc,rc,ac,ic]},hc=Object.freeze({__proto__:null,events:function(t){return zi([Ii(ui(),(function(e,n){var r=t.channels,o=lt(r),i=n,a=function(t,e){return e.universal?t:$(t,(function(t){return H(e.channels,t)}))}(o,i);W(a,(function(t){var n=r[t],o=n.schema,a=Ur("channel["+t+"] data\nReceiver: "+ta(e.element),o,i.data);n.onReceive(e,a)}))}))])}}),pc=[Yr("channels",Fr(Wn.value,Sr([Nu("onReceive"),fo("schema",Rr())])))],vc=function(t,e,n){return Ki((function(r,o){n(r,t,e)}))},bc=function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),a=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ha(a.slice(0,1).concat(a.slice(3)))}},t}((function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var a=[r].concat(o);return r.config({name:v(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(a,1);return e.apply(void 0,[r,t.config,t.state].concat(n))}))}),n,e)},yc=function(t){return{key:t,value:void 0}},wc=function(t,e,n,r,o,i,a){var u=function(t){return xt(t,n)?t[n]():B.none()},c=mt(o,(function(t,e){return bc(n,t,e)})),s=mt(i,(function(t,e){return pa(t,e)})),l=O(O(O({},s),c),{revoke:w(yc,n),config:function(e){var r=Ur(n+"-config",t,e);return{key:n,value:{config:r,me:l,configAsRaw:jt((function(){return Ur(n+"-config",t,e)})),initialConfig:e,state:a}}},schema:v(e),exhibit:function(t,e){return kt(u(t),yt(r,"exhibit"),(function(t,n){return n(e,t.config,t.state)})).getOrThunk((function(){return Sa({})}))},name:v(n),handlers:function(t){return u(t).map((function(t){return yt(r,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return l},xc=function(t){return Oo(t)},Cc=Sr([Xr("fields"),Xr("name"),fo("active",{}),fo("apis",{}),fo("state",wa),fo("extra",{})]),Sc=function(t){var e=Ur("Creating behaviour: "+t.name,Cc,t);return function(t,e,n,r,o,i){var a,u,c=Sr(t),s=lo(e,[(a="config",u=t,io(a,Sr(u)))]);return wc(c,s,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},kc=Sr([Xr("branchKey"),Xr("branches"),Xr("name"),fo("active",{}),fo("apis",{}),fo("state",wa),fo("extra",{})]),Tc=function(t){var e=Ur("Creating behaviour: "+t.name,kc,t);return function(t,e,n,r,o,i){var a=t,u=lo(e,[io("config",t)]);return wc(a,u,e,n,r,o,i)}(qr(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},Oc=v(void 0),Ec=Sc({fields:pc,name:"receiving",active:hc}),_c=Object.freeze({__proto__:null,exhibit:function(t,e){return Sa({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),Rc=function(){return Bt.fromDom(document)},Nc=function(t){return t.dom.focus()},Ac=function(t){var e=ze(t).dom;return t.dom===e.activeElement},Dc=function(t){return void 0===t&&(t=Rc()),B.from(t.dom.activeElement).map(Bt.fromDom)},Mc=function(t){return Dc(ze(t)).filter((function(e){return t.dom.contains(e.dom)}))},Bc=function(t,e){var n=ze(e),r=Dc(n).bind((function(t){var n,r,o=function(e){return ye(t,e)};return o(e)?B.some(e):(n=o,(r=function(t){for(var e=0;e<t.childNodes.length;e++){var o=Bt.fromDom(t.childNodes[e]);if(n(o))return B.some(o);var i=r(t.childNodes[e]);if(i.isSome())return i}return B.none()})(e.dom))})),o=t(e);return r.each((function(t){Dc(n).filter((function(e){return ye(e,t)})).fold((function(){Nc(t)}),h)})),o},zc=function(t,e,n,r,o){var i=function(t){return t+"px"};return{position:t,left:e.map(i),top:n.map(i),right:r.map(i),bottom:o.map(i)}},Pc=function(t,e){Ze(t,function(t){return O(O({},t),{position:B.some(t.position)})}(e))},Lc=Co([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Ic=function(t,e,n,r,o,i){var a=e.rect,u=a.x-n,c=a.y-r,s=o-(u+a.width),l=i-(c+a.height),f=B.some(u),d=B.some(c),m=B.some(s),g=B.some(l),h=B.none();return function(t,e,n,r,o,i,a,u,c){return t.fold(e,n,r,o,i,a,u,c)}(e.direction,(function(){return zc(t,f,d,h,h)}),(function(){return zc(t,h,d,m,h)}),(function(){return zc(t,f,h,h,g)}),(function(){return zc(t,h,h,m,g)}),(function(){return zc(t,f,d,h,h)}),(function(){return zc(t,f,h,h,g)}),(function(){return zc(t,f,d,h,h)}),(function(){return zc(t,h,d,m,h)}))},Hc=function(t,e){return t.fold((function(){var t=e.rect;return zc("absolute",B.some(t.x),B.some(t.y),B.none(),B.none())}),(function(t,n,r,o){return Ic("absolute",e,t,n,r,o)}),(function(t,n,r,o){return Ic("fixed",e,t,n,r,o)}))},Fc=function(t,e){var n=w(Ln,e),r=t.fold(n,n,(function(){var t=An();return Ln(e).translate(-t.left,-t.top)})),o=yn(e),i=fn(e);return In(r.left,r.top,o,i)},Vc=function(t,e){return e.fold((function(){return t.fold(Vn,Vn,In)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=jc(t,n.x,n.y);return In(r.left,r.top,n.width,n.height)}))}))},jc=function(t,e,n){var r=mn(e,n);return t.fold(v(r),v(r),(function(){var t=An();return r.translate(-t.left,-t.top)}))};Lc.none;var Uc,Wc=Lc.relative,qc=Lc.fixed,$c=function(t,e){return function(t,e){return{anchorBox:t,origin:e}}(t,e)},Gc="data-alloy-placement",Kc=function(t){return $e(t,Gc)},Xc=Co([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Yc=function(t,e,n,r){var o=t.bubble,i=o.offset,a=function(t,e,n){var r=function(r,o){return e[r].map((function(e){var i="top"===r||"bottom"===r,a=i?n.top:n.left,u=("left"===r||"top"===r?Math.max:Math.min)(e,o)+a;return i?$u(u,t.y,t.bottom):$u(u,t.x,t.right)})).getOr(o)},o=r("left",t.x),i=r("top",t.y),a=r("right",t.right),u=r("bottom",t.bottom);return In(o,i,a-o,u-i)}(r,t.restriction,i),u=t.x+i.left,c=t.y+i.top,s=In(u,c,e,n),l=function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,a=t.x,u=t.y,c=t.right,s=t.bottom,l=t.width,f=t.height;return{originInBounds:a>=n&&a<=o&&u>=r&&u<=i,sizeInBounds:c<=o&&c>=n&&s<=i&&s>=r,visibleW:Math.min(l,a>=n?o-a:c-n),visibleH:Math.min(f,u>=r?i-u:s-r)}}(s,a),f=l.originInBounds,d=l.sizeInBounds,m=l.visibleW,g=l.visibleH,h=f&&d,p=h?s:function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,a=t.x,u=t.y,c=t.width,s=t.height,l=Math.max(n,o-c),f=Math.max(r,i-s),d=$u(a,n,l),m=$u(u,r,f),g=Math.min(d+c,o)-d,h=Math.min(m+s,i)-m;return In(d,m,g,h)}(s,a),b=p.width>0&&p.height>0,y=function(t,e,n){var r=v(e.bottom-n.y),o=v(n.bottom-e.y),i=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)}(t,o,o,r),a=v(e.right-n.x),u=v(n.right-e.x);return{maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t,u,u,a),maxHeight:i}}(t.direction,p,r),w=y.maxWidth,x={rect:p,maxHeight:y.maxHeight,maxWidth:w,direction:t.direction,placement:t.placement,classes:{on:o.classesOn,off:o.classesOff},layout:t.label,testY:c};return h||t.alwaysFit?Xc.fit(x):Xc.nofit(x,m,g,b)},Jc=function(t){var e=xo(B.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(B.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(B.some(t))}}},Qc=function(){return Jc((function(t){return t.unbind()}))},Zc=function(){var t=Jc(h);return O(O({},t),{on:function(e){return t.get().each(e)}})},ts=k,es=function(t,e,n){return function(t,e,n,r){return xn(t,e,n,r,!1)}(t,e,ts,n)},ns=function(t,e,n){return function(t,e,n,r){return xn(t,e,n,r,!0)}(t,e,ts,n)},rs=wn,os=["top","bottom","right","left"],is="data-alloy-transition-timer",as=function(t,e){return function(t,e){return Z(e,(function(e){return Fa(t,e)}))}(t,e.classes)},us=function(t,e){var n=function(t){return parseFloat(t).toFixed(3)};return vt(e,(function(e,r){var o,i,a,u=t[r].map(n),c=e.map(n);return void 0===a&&(a=y),!kt(o=u,i=c,a).getOr(o.isNone()&&i.isNone())})).isSome()},cs=function(t,e){var n,r=Qc(),i=Qc(),a=function(e){var n,r=null!==(n=e.raw.pseudoElement)&&void 0!==n?n:"";return ye(e.target,t)&&!At(r)&&H(os,e.raw.propertyName)},u=function(o){if(l(o)||a(o)){r.clear(),i.clear();var u=null==o?void 0:o.raw.type;(l(u)||u===Zo())&&(clearTimeout(n),Ke(t,is),ja(t,e.classes))}},c=function(){r.set(es(t,Zo(),u)),i.set(es(t,Qo(),u))};if("ontransitionstart"in t.dom)var s=es(t,ti(),(function(t){a(t)&&(s.unbind(),c())}));else c();var f=function(t){var e=function(e){var n=tn(t,e),r=o(n)?n.split(/\s*,\s*/):[];return $(r,At)},n=function(t){if(o(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return Rt(t,"ms")?e:1e3*e}return 0},r=e("transition-delay"),i=e("transition-duration");return K(i,(function(t,e,o){var i=n(r[o])+n(e);return Math.max(t,i)}),0)}(t);requestAnimationFrame((function(){n=setTimeout(u,f+17),We(t,is,n)}))},ss=function(t,e,n,r,o,i){var a=function(t,e,n){return n.exists((function(n){var r=t.mode;return"all"===r||n[r]!==e[r]}))}(r,o,i);if(a||as(t,r)){Je(t,"position",n.position);var u=Fc(e,t),c=Hc(e,O(O({},o),{rect:u})),s=nt(os,(function(t){return c[t]}));us(n,s)&&(Ze(t,s),a&&function(t,e){Va(t,e.classes),$e(t,is).each((function(e){clearTimeout(parseInt(e,10)),Ke(t,is)})),cs(t,e)}(t,r),un(t))}else ja(t,r.classes)},ls=function(t,e,n,r){an(e,"max-height"),an(e,"max-width");var o,i={width:yn(o=e),height:fn(o)};return function(t,e,n,r,o,i){var a=r.width,u=r.height,c=function(e,c,s,l,f){var d=e(n,r,o,t,i),m=Yc(d,a,u,i);return m.fold(v(m),(function(t,e,n,r){return(f===r?n>l||e>s:!f&&r)?m:Xc.nofit(c,s,l,f)}))};return K(e,(function(t,e){var n=w(c,e);return t.fold(v(t),n)}),Xc.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:Lu(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1)).fold(b,b)}(e,r.preference,t,i,n,r.bounds)},fs=function(t,e){!function(t,e){We(t,Gc,e)}(t,e.placement)},ds=function(t,e){!function(t,e){var n=sn.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Je(t,"max-height",n+"px")}(t,Math.floor(e))},ms=v((function(t,e){ds(t,e),Qe(t,{"overflow-x":"hidden","overflow-y":"auto"})})),gs=v((function(t,e){ds(t,e)})),hs=function(t,e,n){return void 0===t[e]?n:t[e]},ps=function(t,e,n,r){var o=ls(t,e,n,r);return function(t,e,n){var r=Hc(n.origin,e);n.transition.each((function(o){ss(t,n.origin,r,o,e,n.lastPlacement)})),Pc(t,r)}(e,o,r),fs(e,o),function(t,e){var n=e.classes;ja(t,n.off),Va(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r),{layout:o.layout,placement:o.placement}},vs=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],bs=function(t,e,n,r){void 0===r&&(r=1);var o=t*r,i=e*r,a=function(t){return yt(n,t).getOr([])},u=function(t,e,n){var r=et(vs,n);return{offset:mn(t,e),classesOn:Q(n,a),classesOff:Q(r,a)}};return{southeast:function(){return u(-t,e,["top","alignLeft"])},southwest:function(){return u(t,e,["top","alignRight"])},south:function(){return u(-t/2,e,["top","alignCentre"])},northeast:function(){return u(-t,-e,["bottom","alignLeft"])},northwest:function(){return u(t,-e,["bottom","alignRight"])},north:function(){return u(-t/2,-e,["bottom","alignCentre"])},east:function(){return u(t,-e/2,["valignCentre","left"])},west:function(){return u(-t,-e/2,["valignCentre","right"])},insetNortheast:function(){return u(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return u(-o,i,["top","alignRight","inset"])},insetNorth:function(){return u(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return u(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return u(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return u(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return u(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return u(o,-i/2,["valignCentre","left","inset"])}}},ys=function(){return bs(0,0,{})},ws=b,xs=function(t,e){return function(n){return"rtl"===Cs(n)?e:t}},Cs=function(t){return"rtl"===tn(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(Uc||(Uc={}));var Ss="data-alloy-vertical-dir",ks=function(t){return uu(t,(function(t){return It(t)&&qe(t,"data-alloy-vertical-dir")===Uc.BottomToTop}))},Ts=function(){return lo("layouts",[Xr("onLtr"),Xr("onRtl"),oo("onBottomLtr"),oo("onBottomRtl")])},Os=function(t,e,n,r,o,i,a){var u=a.map(ks).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=u?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=u?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r);return xs(l,f)(t)},Es=[Xr("hotspot"),oo("bubble"),fo("overrides",{}),Ts(),Du("placement",(function(t,e,n){var r=e.hotspot,o=Fc(n,r.element),i=Os(t.element,e,mc(),gc(),fc(),dc(),B.some(e.hotspot.element));return B.some(ws({anchorBox:o,bubble:e.bubble.getOr(ys()),overrides:e.overrides,layouts:i,placer:B.none()}))}))],_s=[Xr("x"),Xr("y"),fo("height",0),fo("width",0),fo("bubble",ys()),fo("overrides",{}),Ts(),Du("placement",(function(t,e,n){var r=jc(n,e.x,e.y),o=In(r.left,r.top,e.width,e.height),i=Os(t.element,e,sc(),lc(),sc(),lc(),B.none());return B.some(ws({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:B.none()}))}))],Rs=Co([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Ns=function(t){return t.fold(b,(function(t,e,n){return t.translate(-e,-n)}))},As=function(t){return t.fold(b,b)},Ds=function(t){return K(t,(function(t,e){return t.translate(e.left,e.top)}),mn(0,0))},Ms=function(t){var e=U(t,As);return Ds(e)},Bs=Rs.screen,zs=Rs.absolute,Ps=function(t,e,n){var r=Ce(t.element),o=An(r),i=function(t,e,n){var r=Te(n.root).dom;return B.from(r.frameElement).map(Bt.fromDom).filter((function(e){var n=Ce(e),r=Ce(t.element);return ye(n,r)})).map(hn)}(t,0,n).getOr(o);return zs(i,o.left,o.top)},Ls=function(t,e,n,r){var o=Bs(mn(t,e));return B.some(function(t,e,n){return{point:t,width:e,height:n}}(o,n,r))},Is=function(t,e,n,r,o){return t.map((function(t){var i,a,u,c=[e,t.point],s=(i=function(){return Ms(c)},a=function(){return Ms(c)},u=function(){return function(t){var e=U(t,Ns);return Ds(e)}(c)},r.fold(i,a,u)),l=function(t,e,n,r){return{x:t,y:e,width:n,height:r}}(s.left,s.top,t.width,t.height),f=n.showAbove?fc():mc(),d=n.showAbove?dc():gc(),m=Os(o,n,f,d,f,d,B.none());return ws({anchorBox:l,bubble:n.bubble.getOr(ys()),overrides:n.overrides,layouts:m,placer:B.none()})}))},Hs=[Xr("node"),Xr("root"),oo("bubble"),Ts(),fo("overrides",{}),fo("showAbove",!1),Du("placement",(function(t,e,n){var r=Ps(t,0,e);return e.node.filter(Fe).bind((function(o){var i=o.dom.getBoundingClientRect(),a=Ls(i.left,i.top,i.width,i.height),u=e.node.getOr(t.element);return Is(a,r,e,n,u)}))}))],Fs=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Vs=Co([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),js=(Vs.before,Vs.on,Vs.after,function(t){return t.fold(b,b,b)}),Us=Co([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ws={domRange:Us.domRange,relative:Us.relative,exact:Us.exact,exactFromRange:function(t){return Us.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return Bt.fromDom(t.startContainer)},relative:function(t,e){return js(t)},exact:function(t,e,n,r){return t}})}(t);return Te(e)},range:Fs},qs=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},$s=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Gs=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Ks=Co([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Xs=function(t,e,n){return e(Bt.fromDom(n.startContainer),n.startOffset,Bt.fromDom(n.endContainer),n.endOffset)},Ys=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return Ks.rtl(Bt.fromDom(t.endContainer),t.endOffset,Bt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Xs(0,Ks.ltr,n)})):Xs(0,Ks.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:v(t),rtl:B.none}},relative:function(e,n){return{ltr:jt((function(){return qs(t,e,n)})),rtl:jt((function(){return B.some(qs(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:jt((function(){return $s(t,e,n,r,o)})),rtl:jt((function(){return B.some($s(t,r,o,e,n))}))}}})}(t,e))},Js=function(t,e){return Ys(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};Ks.ltr,Ks.rtl;var Qs,Zs=function(t,e){var n=function(e){return t(e)?B.from(e.dom.nodeValue):B.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Ht,"text"),tl=function(t){return Zs.getOption(t)},el=["img","br"],nl=function(t){return tl(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||H(el,Pt(t))},rl=function(t,e){var n=function(t){for(var r=_e(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return B.some(i);var a=n(i);if(a.isSome())return a}return B.none()};return n(t)},ol=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return be(n)?[]:U(n.querySelectorAll(t),Bt.fromDom)}(e,t)},il=function(t,e,n,r){var o=function(t,e,n,r){var o=Ce(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=ye(t,n)&&e===r;return o.collapsed&&!i},al=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return B.some(Fs(Bt.fromDom(e.startContainer),e.startOffset,Bt.fromDom(n.endContainer),n.endOffset))}return B.none()},ul=function(t){if(null===t.anchorNode||null===t.focusNode)return al(t);var e=Bt.fromDom(t.anchorNode),n=Bt.fromDom(t.focusNode);return il(e,t.anchorOffset,n,t.focusOffset)?B.some(Fs(e,t.anchorOffset,n,t.focusOffset)):al(t)},cl=function(t){return function(t){return B.from(t.getSelection())}(t).filter((function(t){return t.rangeCount>0})).bind(ul)},sl=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?B.some(n).map(Gs):B.none()}(Js(t,e))},ll=function(t,e){return function(t){var e=t.getBoundingClientRect();return e.width>0||e.height>0?B.some(e).map(Gs):B.none()}(Js(t,e))},fl=function(t,e){return{element:t,offset:e}},dl=function(t,e){var n=_e(t);if(0===n.length)return fl(t,e);if(e<n.length)return fl(n[e],0);var r=n[n.length-1],o=Ht(r)?function(t){return Zs.get(t)}(r).length:_e(r).length;return fl(r,o)},ml=function(t,e){return Ht(t)?fl(t,e):dl(t,e)},gl=function(t,e){return e.getSelection.getOrThunk((function(){return function(){return cl(t)}}))().map((function(t){var e=ml(t.start,t.soffset),n=ml(t.finish,t.foffset);return Ws.range(e.element,e.offset,n.element,n.offset)}))},hl=[oo("getSelection"),Xr("root"),oo("bubble"),Ts(),fo("overrides",{}),fo("showAbove",!1),Du("placement",(function(t,e,n){var r=Te(e.root).dom,o=Ps(t,0,e),i=gl(r,e).bind((function(t){return ll(r,Ws.exactFromRange(t)).orThunk((function(){var e=Bt.fromText("\ufeff");Sn(t.start,e);var n=sl(r,Ws.exact(e,0,e,1));return Rn(e),n})).bind((function(t){return Ls(t.left,t.top,t.width,t.height)}))})),a=gl(r,e).bind((function(t){return It(t.start)?B.some(t.start):function(t){return Oe(t)}(t.start)})).getOr(t.element);return Is(i,o,e,n,a)}))],pl="link-layout",vl=function(t){return t.x+t.width},bl=function(t,e){return t.x-e.width},yl=function(t,e){return t.y-e.height+t.height},wl=function(t){return t.y},xl=function(t,e,n){return zu(vl(t),wl(t),n.southeast(),Lu(),"southeast",Gu(t,{left:0,top:2}),pl)},Cl=function(t,e,n){return zu(bl(t,e),wl(t),n.southwest(),Iu(),"southwest",Gu(t,{right:1,top:2}),pl)},Sl=function(t,e,n){return zu(vl(t),yl(t,e),n.northeast(),Hu(),"northeast",Gu(t,{left:0,bottom:3}),pl)},kl=function(t,e,n){return zu(bl(t,e),yl(t,e),n.northwest(),Fu(),"northwest",Gu(t,{right:1,bottom:3}),pl)},Tl=function(){return[xl,Cl,Sl,kl]},Ol=function(){return[Cl,xl,kl,Sl]},El=[Xr("item"),Ts(),fo("overrides",{}),Du("placement",(function(t,e,n){var r=Fc(n,e.item.element),o=Os(t.element,e,Tl(),Ol(),Tl(),Ol(),B.none());return B.some(ws({anchorBox:r,bubble:ys(),overrides:e.overrides,layouts:o,placer:B.none()}))}))],_l=qr("type",{selection:hl,node:Hs,hotspot:Es,submenu:El,makeshift:_s}),Rl=[ro("classes",Dr),po("mode","all",["all","layout","placement"])],Nl=[fo("useFixed",S),oo("getBounds")],Al=[Yr("anchor",_l),lo("transition",Rl)],Dl=function(t,e,n,r,o,i,a){return function(t,e,n,r,o,i,a,u){var c=hs(a,"maxHeightFunction",ms()),s=hs(a,"maxWidthFunction",h),l=t.anchorBox,f=t.origin,d={bounds:Vc(f,i),origin:f,preference:r,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:o,transition:u};return ps(l,e,n,d)}($c(n.anchorBox,e),o.element,n.bubble,n.layouts,i,r,n.overrides,a)},Ml=function(t,e,n,r,o,i){var a=i.map(Hn);return Bl(t,e,n,r,o,a)},Bl=function(t,e,n,r,o,i){var a=Ur("placement.info",kr(Al),o),u=a.anchor,c=r.element,s=n.get(r.uid);Bc((function(){Je(c,"position","fixed");var o=nn(c,"visibility");Je(c,"visibility","hidden");var l,f=e.useFixed()?(l=document.documentElement,qc(0,0,l.clientWidth,l.clientHeight)):function(t){var e=hn(t.element),n=t.element.dom.getBoundingClientRect();return Wc(e.left,e.top,n.width,n.height)}(t),d=u.placement,m=i.map(v).or(e.getBounds);d(t,u,f).each((function(e){var o=e.placer.getOr(Dl)(t,f,e,m,r,s,a.transition);n.set(r.uid,o)})),o.fold((function(){an(c,"visibility")}),(function(t){Je(c,"visibility",t)})),nn(c,"left").isNone()&&nn(c,"top").isNone()&&nn(c,"right").isNone()&&nn(c,"bottom").isNone()&&Ct(nn(c,"position"),"fixed")&&an(c,"position")}),c)},zl=Object.freeze({__proto__:null,position:function(t,e,n,r,o){Ml(t,e,n,r,o,B.none())},positionWithin:Ml,positionWithinBounds:Bl,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"},reset:function(t,e,n,r){var o=r.element;W(["position","left","right","top","bottom"],(function(t){return an(o,t)})),function(t){Ke(t,Gc)}(o),n.clear(r.uid)}}),Pl=Object.freeze({__proto__:null,init:function(){var t={};return xa({readState:function(){return t},clear:function(e){f(e)?delete t[e]:t={}},set:function(e,n){t[e]=n},get:function(e){return yt(t,e)}})}}),Ll=Sc({fields:Nl,name:"positioning",active:_c,apis:zl,state:Pl}),Il=function(t){Ri(t,wi());var e=t.components();W(e,Il)},Hl=function(t){var e=t.components();W(e,Hl),Ri(t,yi())},Fl=function(t,e){On(t.element,e.element)},Vl=function(t,e){var n=t.components();!function(t){W(t.components(),(function(t){return Rn(t.element)})),_n(t.element),t.syncComponents()}(t);var r=et(n,e);W(r,(function(e){Il(e),t.getSystem().removeFromWorld(e)})),W(e,(function(e){e.getSystem().isConnected()?Fl(t,e):(t.getSystem().addToWorld(e),Fl(t,e),Fe(t.element)&&Hl(e)),t.syncComponents()}))},jl=function(t,e){Ul(t,e,On)},Ul=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),Fe(t.element)&&Hl(e),t.syncComponents()},Wl=function(t){Il(t),Rn(t.element),t.getSystem().removeFromWorld(t)},ql=function(t){var e=Oe(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));Wl(t),e.each((function(t){t.syncComponents()}))},$l=function(t){var e=t.components();W(e,Wl),_n(t.element),t.syncComponents()},Gl=function(t,e){Kl(t,e,On)},Kl=function(t,e,n){n(t,e.element);var r=_e(e.element);W(r,(function(t){e.getByDom(t).each(Hl)}))},Xl=function(t){var e=_e(t.element);W(e,(function(e){t.getByDom(e).each(Il)})),Rn(t.element)},Yl=function(t,e,n,r){n.get().each((function(e){$l(t)}));var o=e.getAttachPoint(t);jl(o,t);var i=t.getSystem().build(r);return jl(t,i),n.set(i),i},Jl=function(t,e,n,r){var o=Yl(t,e,n,r);return e.onOpen(t,o),o},Ql=function(t,e,n){n.get().each((function(r){$l(t),ql(t),e.onClose(t,r),n.clear()}))},Zl=function(t,e,n){return n.isOpen()},tf=function(t,e,n){var r=e.getAttachPoint(t);Je(t.element,"position",Ll.getMode(r)),function(t,e,n,r){nn(t.element,e).fold((function(){Ke(t.element,n)}),(function(e){We(t.element,n,e)})),Je(t.element,e,r)}(t,"visibility",e.cloakVisibilityAttr,"hidden")},ef=function(t,e,n){(function(t){return F(["top","left","right","bottom"],(function(e){return nn(t,e).isSome()}))})(t.element)||an(t.element,"position"),function(t,e,n){$e(t.element,n).fold((function(){return an(t.element,e)}),(function(n){return Je(t.element,e,n)}))}(t,"visibility",e.cloakVisibilityAttr)},nf=Object.freeze({__proto__:null,cloak:tf,decloak:ef,open:Jl,openWhileCloaked:function(t,e,n,r,o){tf(t,e),Jl(t,e,n,r),o(),ef(t,e)},close:Ql,isOpen:Zl,isPartOf:function(t,e,n,r){return Zl(0,0,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map((function(){return Yl(t,e,n,r)}))}}),rf=Object.freeze({__proto__:null,events:function(t,e){return zi([Ii(di(),(function(n,r){Ql(n,t,e)}))])}}),of=[_u("onOpen"),_u("onClose"),Xr("isPartOf"),Xr("getAttachPoint"),fo("cloakVisibilityAttr","data-precloak-visibility")],af=Sc({fields:of,name:"sandboxing",active:rf,apis:nf,state:Object.freeze({__proto__:null,init:function(){var t=Zc(),e=v("not-implemented");return xa({readState:e,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}})}),uf=v("dismiss.popups"),cf=v("reposition.popups"),sf=v("mouse.released"),lf=Sr([fo("isExtraPart",S),lo("fireEventInstead",[fo("event",xi())])]),ff=function(t){var e,n=Ur("Dismissal",lf,t);return(e={})[uf()]={schema:Sr([Xr("target")]),onReceive:function(t,e){af.isOpen(t)&&(af.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold((function(){return af.close(t)}),(function(e){return Ri(t,e.event)})))}},e},df=Sr([lo("fireEventInstead",[fo("event",Ci())]),to("doReposition")]),mf=function(t){var e,n=Ur("Reposition",df,t);return(e={})[cf()]={onReceive:function(t){af.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return Ri(t,e.event)}))}},e},gf=function(t,e,n){e.store.manager.onLoad(t,e,n)},hf=function(t,e,n){e.store.manager.onUnload(t,e,n)},pf=Object.freeze({__proto__:null,onLoad:gf,onUnload:hf,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),vf=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[$i((function(n,r){gf(n,t,e)})),Gi((function(n,r){hf(n,t,e)}))]:[vc(t,e,gf)];return zi(n)}}),bf=function(){var t=xo(null);return xa({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},yf=function(){var t=xo({}),e=xo({});return xa({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return yt(t.get(),n).orThunk((function(){return yt(e.get(),n)}))},update:function(n){var r=t.get(),o=e.get(),i={},a={};W(n,(function(t){i[t.value]=t,yt(t,"meta").each((function(e){yt(e,"text").each((function(e){a[e]=t}))}))})),t.set(O(O({},r),i)),e.set(O(O({},o),a))},clear:function(){t.set({}),e.set({})}})},wf=Object.freeze({__proto__:null,memory:bf,dataset:yf,manual:function(){return xa({readState:h})},init:function(t){return t.store.manager.state(t)}}),xf=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},Cf=[oo("initialValue"),Xr("getFallbackEntry"),Xr("getDataKey"),Xr("setValue"),Du("manager",{setValue:xf,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).getOrThunk((function(){return r.getFallbackEntry(o)}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){xf(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:yf})],Sf=[Xr("getValue"),fo("setValue",h),oo("initialValue"),Du("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:h,state:wa.init})],kf=[oo("initialValue"),Du("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:bf})],Tf=[mo("store",{mode:"memory"},qr("mode",{memory:kf,manual:Sf,dataset:Cf})),_u("onSetValue"),fo("resetOnDom",!1)],Of=Sc({fields:Tf,name:"representing",active:vf,apis:pf,extra:{setValueFrom:function(t,e){var n=Of.getValue(e);Of.setValue(t,n)}},state:wf}),Ef=function(t,e){return wo(t,{},U(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,$r(n,n,{tag:"option",process:{}},pr((function(t){return Qn("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([Gr("dump",b)]))},_f=function(t){return t.dump},Rf=function(t,e){return O(O({},xc(e)),t.dump)},Nf=Ef,Af=Rf,Df="placeholder",Mf=Co([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Bf=function(t){return wt(t,"uiType")},zf=function(t,e,n,r){return Bf(n)&&n.uiType===Df?function(t,e,n,r){return t.exists((function(t){return t!==n.owner}))?Mf.single(!0,v(n)):yt(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+lt(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,r):Mf.single(!1,v(n))},Pf=function(t,e,n,r){return zf(t,0,n,r).fold((function(o,i){var a=Bf(n)?i(e,n.config,n.validated):i(e),u=yt(a,"components").getOr([]),c=Q(u,(function(n){return Pf(t,e,n,r)}));return[O(O({},a),{components:c})]}),(function(t,r){if(Bf(n)){var o=r(e,n.config,n.validated);return n.validated.preprocess.getOr(b)(o)}return r(e)}))},Lf=function(t,e,n,r){var o=mt(r,(function(t,e){return r=t,o=!1,{name:v(n=e),required:function(){return r.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return o},replace:function(){if(o)throw new Error("Trying to use the same placeholder more than once: "+n);return o=!0,r}};var n,r,o})),i=function(t,e,n,r){return Q(n,(function(n){return Pf(t,e,n,r)}))}(t,e,n,o);return dt(o,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),i},If=Mf.single,Hf=Mf.multiple,Ff=v(Df),Vf=Co([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),jf=fo("factory",{sketch:b}),Uf=fo("schema",[]),Wf=Xr("name"),qf=$r("pname","pname",sr((function(t){return"<alloy."+oa(t.name)+">"})),Rr()),$f=Gr("schema",(function(){return[oo("preprocess")]})),Gf=fo("defaults",v({})),Kf=fo("overrides",v({})),Xf=kr([jf,Uf,Wf,qf,Gf,Kf]),Yf=kr([jf,Uf,Wf,Gf,Kf]),Jf=kr([jf,Uf,Wf,qf,Gf,Kf]),Qf=kr([jf,$f,Wf,Xr("unit"),qf,Gf,Kf]),Zf=function(t){return t.fold(B.some,B.none,B.some,B.some)},td=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},ed=function(t,e){return function(n){var r=Ur("Converting part type",e,n);return t(r)}},nd=ed(Vf.required,Xf),rd=ed(Vf.external,Yf),od=ed(Vf.optional,Jf),id=ed(Vf.group,Qf),ad=v("entirety"),ud=Object.freeze({__proto__:null,required:nd,external:rd,optional:od,group:id,asNamedPart:Zf,name:td,asCommon:function(t){return t.fold(b,b,b,b)},original:ad}),cd=function(t,e,n,r){return ur(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},sd=function(t,e){var n={};return W(e,(function(e){Zf(e).each((function(e){var r=ld(t,e.pname);n[e.name]=function(n){var o=Ur("Part: "+e.name+" in "+t,kr(e.schema),n);return O(O({},r),{config:n,validated:o})}}))})),n},ld=function(t,e){return{uiType:Ff(),owner:t,name:e}},fd=function(t,e,n){return{uiType:Ff(),owner:t,name:e,config:n,validated:{}}},dd=function(t){return Q(t,(function(t){return t.fold(B.none,B.some,B.none,B.none).map((function(t){return eo(t.name,t.schema.concat([Mu(ad())]))})).toArray()}))},md=function(t){return U(t,td)},gd=function(t,e,n){return function(t,e,n){var r={},o={};return W(n,(function(t){t.fold((function(t){r[t.pname]=If(!0,(function(e,n,r){return t.factory.sketch(cd(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=v(t.factory.sketch(cd(e,t,n[ad()]),n))}),(function(t){r[t.pname]=If(!1,(function(e,n,r){return t.factory.sketch(cd(e,t,n,r))}))}),(function(t){r[t.pname]=Hf(!0,(function(e,n,r){var o=e[t.name];return U(o,(function(n){return t.factory.sketch(ur(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:v(r),externals:v(o)}}(0,e,n)},hd=function(t,e,n){return Lf(B.some(t),e,e.components,n)},pd=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},vd=function(t,e,n){return pd(t,e,n).getOrDie("Could not find part: "+n)},bd=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return W(n,(function(t){r[t]=v(i.getByUid(o[t]))})),r},yd=function(t,e){var n=t.getSystem();return mt(e.partUids,(function(t,e){return v(n.getByUid(t))}))},wd=function(t){return lt(t.partUids)},xd=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return W(n,(function(t){r[t]=v(i.getByUid(o[t]).getOrDie())})),r},Cd=function(t,e){var n=md(e);return Oo(U(n,(function(e){return{key:e,value:t+"-"+e}})))},Sd=function(t){return $r("partUids","partUids",fr((function(e){return Cd(e.uid,t)})),Rr())},kd=Object.freeze({__proto__:null,generate:sd,generateOne:fd,schemas:dd,names:md,substitutes:gd,components:hd,defaultUids:Cd,defaultUidsSchema:Sd,getAllParts:yd,getAllPartNames:wd,getPart:pd,getPartOrDie:vd,getParts:bd,getPartsOrDie:xd}),Td=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[eo("parts",t)]:[]).concat([Xr("uid"),fo("dom",{}),fo("components",[]),Mu("originalSpec"),fo("debug.sketcher",{})]).concat(e)}(r,o);return Ur(t+" [SpecSchema]",Sr(i.concat(e)),n)},Od=function(t,e,n,r,o){var i=Ed(o),a=dd(n),u=Sd(n),c=Td(t,e,i,a,[u]),s=gd(0,c,n);return r(c,hd(t,c,s.internals()),i,s.externals())},Ed=function(t){return function(t){return wt(t,"uid")}(t)?t:O(O({},t),{uid:fa("uid")})},_d=Sr([Xr("name"),Xr("factory"),Xr("configFields"),fo("apis",{}),fo("extraApis",{})]),Rd=Sr([Xr("name"),Xr("factory"),Xr("configFields"),Xr("partFields"),fo("apis",{}),fo("extraApis",{})]),Nd=function(t){var e=Ur("Sketcher for "+t.name,_d,t),n=mt(e.apis,ya),r=mt(e.extraApis,(function(t,e){return pa(t,e)}));return O(O({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=Ed(r);return n(Td(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},Ad=function(t){var e=Ur("Sketcher for "+t.name,Rd,t),n=sd(e.name,e.partFields),r=mt(e.apis,ya),o=mt(e.extraApis,(function(t,e){return pa(t,e)}));return O(O({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return Od(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},Dd=function(t){return"input"===Pt(t)&&"radio"!==qe(t,"type")||"textarea"===Pt(t)},Md=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),Bd=[Xr("find")],zd=Sc({fields:Bd,name:"composing",apis:Md}),Pd=["input","button","textarea","select"],Ld=function(t,e,n){(e.disabled()?Ud:Wd)(t,e)},Id=function(t,e){return!0===e.useNative&&H(Pd,Pt(t.element))},Hd=function(t){We(t.element,"disabled","disabled")},Fd=function(t){Ke(t.element,"disabled")},Vd=function(t){We(t.element,"aria-disabled","true")},jd=function(t){We(t.element,"aria-disabled","false")},Ud=function(t,e,n){e.disableClass.each((function(e){La(t.element,e)})),(Id(t,e)?Hd:Vd)(t),e.onDisabled(t)},Wd=function(t,e,n){e.disableClass.each((function(e){Ha(t.element,e)})),(Id(t,e)?Fd:jd)(t),e.onEnabled(t)},qd=function(t,e){return Id(t,e)?function(t){return Ge(t.element,"disabled")}(t):function(t){return"true"===qe(t.element,"aria-disabled")}(t)},$d=Object.freeze({__proto__:null,enable:Wd,disable:Ud,isDisabled:qd,onLoad:Ld,set:function(t,e,n,r){(r?Ud:Wd)(t,e)}}),Gd=Object.freeze({__proto__:null,exhibit:function(t,e){return Sa({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return zi([Pi(ci(),(function(e,n){return qd(e,t)})),vc(t,e,Ld)])}}),Kd=[bo("disabled",S),fo("useNative",!0),oo("disableClass"),_u("onDisabled"),_u("onEnabled")],Xd=Sc({fields:Kd,name:"disabling",active:Gd,apis:$d}),Yd=function(t,e,n,r){var o=ol(t.element,"."+e.highlightClass);W(o,(function(n){F(r,(function(t){return t.element===n}))||(Ha(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Ri(n,_i())})))}))},Jd=function(t,e,n,r){Yd(t,e,0,[r]),Qd(t,e,n,r)||(La(r.element,e.highlightClass),e.onHighlight(t,r),Ri(r,Ei()))},Qd=function(t,e,n,r){return Fa(r.element,e.highlightClass)},Zd=function(t,e,n,r){var o=ol(t.element,"."+e.itemClass);return B.from(o[r]).fold((function(){return Wn.error(new Error("No element found with index "+r))}),t.getSystem().getByDom)},tm=function(t,e,n){return lu(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},em=function(t,e,n){var r=ol(t.element,"."+e.itemClass);return(r.length>0?B.some(r[r.length-1]):B.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},nm=function(t,e,n,r){var o=ol(t.element,"."+e.itemClass);return Y(o,(function(t){return Fa(t,e.highlightClass)})).bind((function(e){var n=qu(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},rm=function(t,e,n){var r=ol(t.element,"."+e.itemClass);return St(U(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},om=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return Yd(t,e,0,[])},dehighlight:function(t,e,n,r){Qd(t,e,n,r)&&(Ha(r.element,e.highlightClass),e.onDehighlight(t,r),Ri(r,_i()))},highlight:Jd,highlightFirst:function(t,e,n){tm(t,e).each((function(r){Jd(t,e,n,r)}))},highlightLast:function(t,e,n){em(t,e).each((function(r){Jd(t,e,n,r)}))},highlightAt:function(t,e,n,r){Zd(t,e,n,r).fold((function(t){throw t}),(function(r){Jd(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=rm(t,e);X(o,r).each((function(r){Jd(t,e,n,r)}))},isHighlighted:Qd,getHighlighted:function(t,e,n){return lu(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:tm,getLast:em,getPrevious:function(t,e,n){return nm(t,e,0,-1)},getNext:function(t,e,n){return nm(t,e,0,1)},getCandidates:rm}),im=[Xr("highlightClass"),Xr("itemClass"),_u("onHighlight"),_u("onDehighlight")],am=Sc({fields:im,name:"highlighting",apis:om}),um=[8],cm=[9],sm=[13],lm=[27],fm=[32],dm=[37],mm=[38],gm=[39],hm=[40],pm=function(t,e,n){var r=tt(t.slice(0,e)),o=tt(t.slice(e+1));return X(r.concat(o),n)},vm=function(t,e,n){var r=tt(t.slice(0,e));return X(r,n)},bm=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return X(o.concat(r),n)},ym=function(t,e,n){var r=t.slice(e+1);return X(r,n)},wm=function(t){return function(e){var n=e.raw;return H(t,n.which)}},xm=function(t){return function(e){return Z(t,(function(t){return t(e)}))}},Cm=function(t){return!0===t.raw.shiftKey},Sm=function(t){return!0===t.raw.ctrlKey},km=x(Cm),Tm=function(t,e){return{matches:t,classification:e}},Om=function(t,e,n){e.exists((function(t){return n.exists((function(e){return ye(e,t)}))}))||Ni(t,Si(),{prevFocus:e,newFocus:n})},Em=function(){var t=function(t){return Mc(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);Om(e,r,o)}}},_m=function(){var t=function(t){return am.getHighlighted(t).map((function(t){return t.element}))};return{get:t,set:function(e,n){var r=t(e);e.getSystem().getByDom(n).fold(h,(function(t){am.highlight(e,t)}));var o=t(e);Om(e,r,o)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Qs||(Qs={}));var Rm,Nm=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,a,u=n(t,e,r,o);return(i=u,a=e.event,X(i,(function(t){return t.matches(a)})).map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},a={schema:function(){return t.concat([fo("focusManager",Em()),mo("focusInside","onFocus",Hr((function(t){return H(["onFocus","onEnterOrSpace","onApi"],t)?Wn.value(t):Wn.error("Invalid value for focusInside")}))),Du("handler",a),Du("state",e),Du("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var a=t.focusInside!==Qs.OnFocusMode?B.none():o(t).map((function(n){return Ii(oi(),(function(r,o){n(r,t,e),o.stop()}))})),u=[Ii(Go(),(function(r,a){i(r,a,n,t,e).fold((function(){!function(n,r){var i=wm(fm.concat(sm))(r.event);t.focusInside===Qs.OnEnterOrSpaceMode&&i&&Ao(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,a)}),(function(t){a.stop()}))})),Ii(Ko(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return zi(a.toArray().concat(u))}};return a},Am=function(t){var e=[oo("onEscape"),oo("onEnter"),fo("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),fo("firstTabstop",0),fo("useTabstopAt",k),oo("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return fu(e,t)})).getOr(e);return ln(n)>0},r=function(t,e,r){(function(t,e){var r=ol(t.element,e.selector),o=$(r,(function(t){return n(e,t)}));return B.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},o=function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?B.some(!0):B.none()}),(function(e){return o.focusManager.set(t,e),B.some(!0)}))},i=function(t,e,n,r){var i=ol(t.element,n.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return fu(t,e.selector)}))}(t,n).bind((function(e){return Y(i,w(ye,e)).bind((function(e){return o(t,i,e,n,r)}))}))},a=v([Tm(xm([Cm,wm(cm)]),(function(t,e,n){var r=n.cyclic?pm:vm;return i(t,0,n,r)})),Tm(wm(cm),(function(t,e,n){var r=n.cyclic?bm:ym;return i(t,0,n,r)})),Tm(wm(lm),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),Tm(xm([km,wm(sm)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),u=v([]);return Nm(e,wa.init,a,u,(function(){return B.some(r)}))},Dm=Am(Gr("cyclic",S)),Mm=Am(Gr("cyclic",k)),Bm=function(t,e,n){return Dd(n)&&wm(fm)(e.event)?B.none():function(t,e,n){return Di(t,n,ci()),B.some(!0)}(t,0,n)},zm=function(t,e){return B.some(!0)},Pm=[fo("execute",Bm),fo("useSpace",!1),fo("useEnter",!0),fo("useControlEnter",!1),fo("useDown",!1)],Lm=function(t,e,n){return n.execute(t,e,t.element)},Im=Nm(Pm,wa.init,(function(t,e,n,r){var o=n.useSpace&&!Dd(t.element)?fm:[],i=n.useEnter?sm:[],a=n.useDown?hm:[],u=o.concat(i).concat(a);return[Tm(wm(u),Lm)].concat(n.useControlEnter?[Tm(xm([Sm,wm(sm)]),Lm)]:[])}),(function(t,e,n,r){return n.useSpace&&!Dd(t.element)?[Tm(wm(fm),zm)]:[]}),(function(){return B.none()})),Hm=function(){var t=Zc();return xa({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set({numRows:e,numColumns:n})},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},Fm=Object.freeze({__proto__:null,flatgrid:Hm,init:function(t){return t.state(t)}}),Vm=function(t){return function(e,n,r,o){var i=t(e.element);return qm(i,e,n,r,o)}},jm=function(t,e){var n=xs(t,e);return Vm(n)},Um=function(t,e){var n=xs(e,t);return Vm(n)},Wm=function(t){return function(e,n,r,o){return qm(t,e,n,r,o)}},qm=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},$m=Wm,Gm=Wm,Km=Wm,Xm=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},Ym=function(t,e,n){var r=ol(t,n);return function(t,e){return Y(t,e).map((function(e){return{index:e,candidates:t}}))}($(r,Xm),(function(t){return ye(t,e)}))},Jm=function(t,e){return Y(t,(function(t){return ye(e,t)}))},Qm=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?B.some(t[r]):B.none()}))},Zm=function(t,e,n,r,o){return Qm(t,e,r,(function(e,i){var a=e===n-1?t.length-e*r:r,u=qu(i,o,0,a-1);return B.some({row:e,column:u})}))},tg=function(t,e,n,r,o){return Qm(t,e,r,(function(e,i){var a=qu(e,o,0,n-1),u=a===n-1?t.length-a*r:r,c=$u(i,0,u-1);return B.some({row:a,column:c})}))},eg=[Xr("selector"),fo("execute",Bm),Ru("onEscape"),fo("captureTab",!1),Bu()],ng=function(t,e,n){lu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},rg=function(t){return function(e,n,r,o){return Ym(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},og=function(t,e,n){return n.captureTab?B.some(!0):B.none()},ig=rg((function(t,e,n,r){return Zm(t,e,n,r,-1)})),ag=rg((function(t,e,n,r){return Zm(t,e,n,r,1)})),ug=rg((function(t,e,n,r){return tg(t,e,n,r,-1)})),cg=rg((function(t,e,n,r){return tg(t,e,n,r,1)})),sg=v([Tm(wm(dm),jm(ig,ag)),Tm(wm(gm),Um(ig,ag)),Tm(wm(mm),$m(ug)),Tm(wm(hm),Gm(cg)),Tm(xm([Cm,wm(cm)]),og),Tm(xm([km,wm(cm)]),og),Tm(wm(lm),(function(t,e,n){return n.onEscape(t,e)})),Tm(wm(fm.concat(sm)),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return fu(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),lg=v([Tm(wm(fm),zm)]),fg=Nm(eg,Hm,sg,lg,(function(){return B.some(ng)})),dg=function(t,e,n,r){var o=function(t,e,n){var i,a=qu(e,r,0,n.length-1);return a===t?B.none():(i=n[a],"button"===Pt(i)&&"disabled"===qe(i,"disabled")?o(t,a,n):B.from(n[a]))};return Ym(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},mg=[Xr("selector"),fo("getInitial",B.none),fo("execute",Bm),Ru("onEscape"),fo("executeOnMove",!1),fo("allowVertical",!0)],gg=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return fu(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},hg=function(t,e,n){e.getInitial(t).orThunk((function(){return lu(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},pg=function(t,e,n){return dg(t,n.selector,e,-1)},vg=function(t,e,n){return dg(t,n.selector,e,1)},bg=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?gg(e,n,r):B.some(!0)}))}},yg=function(t,e,n){return n.onEscape(t,e)},wg=v([Tm(wm(fm),zm)]),xg=Nm(mg,wa.init,(function(t,e,n,r){var o=dm.concat(n.allowVertical?mm:[]),i=gm.concat(n.allowVertical?hm:[]);return[Tm(wm(o),bg(jm(pg,vg))),Tm(wm(i),bg(Um(pg,vg))),Tm(wm(sm),gg),Tm(wm(fm),gg),Tm(wm(lm),yg)]}),wg,(function(){return B.some(hg)})),Cg=function(t,e,n){return B.from(t[e]).bind((function(t){return B.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},Sg=function(t,e,n,r){var o=t[e].length,i=qu(n,r,0,o-1);return Cg(t,e,i)},kg=function(t,e,n,r){var o=qu(n,r,0,t.length-1),i=t[o].length,a=$u(e,0,i-1);return Cg(t,o,a)},Tg=function(t,e,n,r){var o=t[e].length,i=$u(n+r,0,o-1);return Cg(t,e,i)},Og=function(t,e,n,r){var o=$u(n+r,0,t.length-1),i=t[o].length,a=$u(e,0,i-1);return Cg(t,o,a)},Eg=[eo("selectors",[Xr("row"),Xr("cell")]),fo("cycles",!0),fo("previousSelector",B.none),fo("execute",Bm)],_g=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return lu(t.element,n.cell)})).each((function(n){e.focusManager.set(t,n)}))},Rg=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return fu(r,o.selectors.row).bind((function(t){var e=ol(t,o.selectors.cell);return Jm(e,r).bind((function(e){var r=ol(n,o.selectors.row);return Jm(r,t).bind((function(t){var n=function(t,e){return U(t,(function(t){return ol(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},Ng=Rg((function(t,e,n){return Sg(t,e,n,-1)}),(function(t,e,n){return Tg(t,e,n,-1)})),Ag=Rg((function(t,e,n){return Sg(t,e,n,1)}),(function(t,e,n){return Tg(t,e,n,1)})),Dg=Rg((function(t,e,n){return kg(t,n,e,-1)}),(function(t,e,n){return Og(t,n,e,-1)})),Mg=Rg((function(t,e,n){return kg(t,n,e,1)}),(function(t,e,n){return Og(t,n,e,1)})),Bg=v([Tm(wm(dm),jm(Ng,Ag)),Tm(wm(gm),Um(Ng,Ag)),Tm(wm(mm),$m(Dg)),Tm(wm(hm),Gm(Mg)),Tm(wm(fm.concat(sm)),(function(t,e,n){return Mc(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),zg=v([Tm(wm(fm),zm)]),Pg=Nm(Eg,wa.init,Bg,zg,(function(){return B.some(_g)})),Lg=[Xr("selector"),fo("execute",Bm),fo("moveOnTab",!1)],Ig=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},Hg=function(t,e,n){lu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Fg=function(t,e,n){return dg(t,n.selector,e,-1)},Vg=function(t,e,n){return dg(t,n.selector,e,1)},jg=v([Tm(wm(mm),Km(Fg)),Tm(wm(hm),Km(Vg)),Tm(xm([Cm,wm(cm)]),(function(t,e,n,r){return n.moveOnTab?Km(Fg)(t,e,n,r):B.none()})),Tm(xm([km,wm(cm)]),(function(t,e,n,r){return n.moveOnTab?Km(Vg)(t,e,n,r):B.none()})),Tm(wm(sm),Ig),Tm(wm(fm),Ig)]),Ug=v([Tm(wm(fm),zm)]),Wg=Nm(Lg,wa.init,jg,Ug,(function(){return B.some(Hg)})),qg=[Ru("onSpace"),Ru("onEnter"),Ru("onShiftEnter"),Ru("onLeft"),Ru("onRight"),Ru("onTab"),Ru("onShiftTab"),Ru("onUp"),Ru("onDown"),Ru("onEscape"),fo("stopSpaceKeyup",!1),oo("focusIn")],$g=Nm(qg,wa.init,(function(t,e,n){return[Tm(wm(fm),n.onSpace),Tm(xm([km,wm(sm)]),n.onEnter),Tm(xm([Cm,wm(sm)]),n.onShiftEnter),Tm(xm([Cm,wm(cm)]),n.onShiftTab),Tm(xm([km,wm(cm)]),n.onTab),Tm(wm(mm),n.onUp),Tm(wm(hm),n.onDown),Tm(wm(dm),n.onLeft),Tm(wm(gm),n.onRight),Tm(wm(fm),n.onSpace),Tm(wm(lm),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[Tm(wm(fm),zm)]:[]}),(function(t){return t.focusIn})),Gg=Dm.schema(),Kg=Mm.schema(),Xg=xg.schema(),Yg=fg.schema(),Jg=Pg.schema(),Qg=Im.schema(),Zg=Wg.schema(),th=$g.schema(),eh=Tc({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Gg,cyclic:Kg,flow:Xg,flatgrid:Yg,matrix:Jg,execution:Qg,menu:Zg,special:th}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){!function(t){return xt(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:Fm}),nh=function(t,e,n,r){var o=t.getSystem().build(r);Ul(t,o,n)},rh=function(t,e,n,r){var o=oh(t);X(o,(function(t){return ye(r.element,t.element)})).each(ql)},oh=function(t,e){return t.components()},ih=function(t,e,n,r,o){var i=oh(t);return B.from(i[r]).map((function(e){return rh(t,0,0,e),o.each((function(e){nh(t,0,(function(t,e){!function(t,e,n){Re(t,n).fold((function(){On(t,e)}),(function(t){Sn(t,e)}))}(t,e,r)}),e)})),e}))},ah=Sc({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){nh(t,0,On,r)},prepend:function(t,e,n,r){nh(t,0,Tn,r)},remove:rh,replaceAt:ih,replaceBy:function(t,e,n,r,o){var i=oh(t);return Y(i,r).bind((function(e){return ih(t,0,0,e,o)}))},set:function(t,e,n,r){Bc((function(){var e=U(r,t.getSystem().build);Vl(t,e)}),t.element)},contents:oh})}),uh=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=zi(e);return Sc({fields:[Xr("enabled")],name:t,active:{events:v(n)}})}(t,e),configAsRaw:v({}),initialConfig:{},state:wa}}},ch=function(t,e){e.ignore||(Nc(t.element),e.onFocus(t))},sh=Object.freeze({__proto__:null,focus:ch,blur:function(t,e){e.ignore||function(t){t.dom.blur()}(t.element)},isFocused:function(t){return Ac(t.element)}}),lh=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return Sa(n)},events:function(t){return zi([Ii(oi(),(function(e,n){ch(e,t),n.stop()}))].concat(t.stopMousedown?[Ii(Fo(),(function(t,e){e.event.prevent()}))]:[]))}}),fh=[_u("onFocus"),fo("stopMousedown",!1),fo("ignore",!1)],dh=Sc({fields:fh,name:"focusing",active:lh,apis:sh}),mh=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},gh=function(t,e,n){e.toggleClass.each((function(e){n.get()?La(t.element,e):Ha(t.element,e)}))},hh=function(t,e,n){bh(t,e,n,!n.get())},ph=function(t,e,n){n.set(!0),gh(t,e,n),mh(t,e,n)},vh=function(t,e,n){n.set(!1),gh(t,e,n),mh(t,e,n)},bh=function(t,e,n,r){(r?ph:vh)(t,e,n)},yh=function(t,e,n){bh(t,e,n,e.selected)},wh=Object.freeze({__proto__:null,onLoad:yh,toggle:hh,isOn:function(t,e,n){return n.get()},on:ph,off:vh,set:bh}),xh=Object.freeze({__proto__:null,exhibit:function(){return Sa({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=hh,Xi((function(t){o(t,n,r)}))),a=vc(t,e,yh);return zi(J([t.toggleOnExecute?[i]:[],[a]]))}}),Ch=function(t,e,n){We(t.element,"aria-expanded",n)},Sh=[fo("selected",!1),oo("toggleClass"),fo("toggleOnExecute",!0),mo("aria",{mode:"none"},qr("mode",{pressed:[fo("syncWithExpanded",!1),Du("update",(function(t,e,n){We(t.element,"aria-pressed",n),e.syncWithExpanded&&Ch(t,e,n)}))],checked:[Du("update",(function(t,e,n){We(t.element,"aria-checked",n)}))],expanded:[Du("update",Ch)],selected:[Du("update",(function(t,e,n){We(t.element,"aria-selected",n)}))],none:[Du("update",h)]}))],kh=Sc({fields:Sh,name:"toggling",active:xh,apis:wh,state:(Rm=!1,{init:function(){var t=xo(Rm);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(Rm)},readState:function(){return t.get()}}}})}),Th=function(){var t=function(t,e){e.stop(),Ai(t)};return[Ii(Jo(),t),Ii(li(),t),Ui(Po()),Ui(Fo())]},Oh=function(t){return zi(J([t.map((function(t){return Xi((function(e,n){t(e),n.stop()}))})).toArray(),Th()]))},Eh="alloy.item-hover",_h="alloy.item-focus",Rh=function(t){(Mc(t.element).isNone()||dh.isFocused(t))&&(dh.isFocused(t)||dh.focus(t),Ni(t,Eh,{item:t}))},Nh=function(t){Ni(t,_h,{item:t})},Ah=v(Eh),Dh=v(_h),Mh=[Xr("data"),Xr("components"),Xr("dom"),fo("hasSubmenu",!1),oo("toggling"),Nf("itemBehaviours",[kh,dh,eh,Of]),fo("ignoreFocus",!1),fo("domModification",{}),Du("builder",(function(t){return{dom:t.dom,domModification:O(O({},t.domModification),{attributes:O(O(O({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Af(t.itemBehaviours,[t.toggling.fold(kh.revoke,(function(t){return kh.config(O({aria:{mode:"checked"}},t))})),dh.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Nh(t)}}),eh.config({mode:"execution"}),Of.config({store:{mode:"memory",initialValue:t.data}}),uh("item-type-events",_(_([],Th(),!0),[Ii(Wo(),Rh),Ii(si(),dh.focus)],!1))]),components:t.components,eventOrder:t.eventOrder}})),fo("eventOrder",{})],Bh=[Xr("dom"),Xr("components"),Du("builder",(function(t){return{dom:t.dom,components:t.components,events:zi([Wi(si())])}}))],zh=v("item-widget"),Ph=v([nd({name:"widget",overrides:function(t){return{behaviours:xc([Of.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:h}})])}}})]),Lh=[Xr("uid"),Xr("data"),Xr("components"),Xr("dom"),fo("autofocus",!1),fo("ignoreFocus",!1),Nf("widgetBehaviours",[Of,dh,eh]),fo("domModification",{}),Sd(Ph()),Du("builder",(function(t){var e=gd(zh(),t,Ph()),n=hd(zh(),t,e.internals()),r=function(e){return pd(e,t,"widget").map((function(t){return eh.focusIn(t),t}))},o=function(e,n){return Dd(n.event.target)?B.none():t.autofocus?(n.setSource(e.element),B.none()):B.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:zi([Xi((function(t,e){r(t).each((function(t){e.stop()}))})),Ii(Wo(),Rh),Ii(si(),(function(e,n){t.autofocus?r(e):dh.focus(e)}))]),behaviours:Af(t.widgetBehaviours,[Of.config({store:{mode:"memory",initialValue:t.data}}),dh.config({ignore:t.ignoreFocus,onFocus:function(t){Nh(t)}}),eh.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:Oc(),onLeft:o,onRight:o,onEscape:function(e,n){return dh.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),B.none()):B.none():(dh.focus(e),B.some(!0))}})])}}))],Ih=qr("type",{widget:Lh,item:Mh,separator:Bh}),Hh=v([id({factory:{sketch:function(t){var e=Ur("menu.spec item",Ih,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return wt(e,"uid")?e:O(O({},e),{uid:fa("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Fh=v([Xr("value"),Xr("items"),Xr("dom"),Xr("components"),fo("eventOrder",{}),Ef("menuBehaviours",[am,Of,zd,eh]),mo("movement",{mode:"menu",moveOnTab:!0},qr("mode",{grid:[Bu(),Du("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[Du("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),Xr("rowSelector")],menu:[fo("moveOnTab",!0),Du("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Yr("markers",Su()),fo("fakeFocus",!1),fo("focusManager",Em()),_u("onHighlight")]),Vh=v("alloy.menu-focus"),jh=Ad({name:"Menu",configFields:Fh(),partFields:Hh(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Rf(t.menuBehaviours,[am.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),Of.config({store:{mode:"memory",initialValue:t.value}}),zd.config({find:B.some}),eh.config(t.movement.config(t,t.movement))]),events:zi([Ii(Dh(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){am.highlight(t,n),e.stop(),Ni(t,Vh(),{menu:t,item:n})}))})),Ii(Ah(),(function(t,e){var n=e.event.item;am.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Uh=function(t,e,n,r){return yt(n,r).bind((function(r){return yt(t,r).bind((function(r){var o=Uh(t,e,n,r);return B.some([r].concat(o))}))})).getOr([])},Wh=function(t,e){var n={};dt(t,(function(t,e){W(t,(function(t){n[t]=e}))}));var r=e,o=gt(e,(function(t,e){return{k:t,v:e}})),i=mt(o,(function(t,e){return[e].concat(Uh(n,r,o,e))}));return mt(n,(function(t){return yt(i,t).getOr([t])}))},qh=function(t){return"prepared"===t.type?B.some(t.menu):B.none()},$h={init:function(){var t=xo({}),e=xo({}),n=xo({}),r=Zc(),o=xo({}),i=function(e,n,r){return a(e).bind((function(o){return function(e){return vt(t.get(),(function(t,n){return t===e}))}(e).bind((function(t){return n(t).map((function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}}))}))}))},a=function(t){return u(t).bind(qh)},u=function(t){return yt(e.get(),t)},c=function(e){return yt(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(O(O({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,a,u,c){r.set(i),t.set(u),e.set(a),o.set(c);var s=Wh(c,u);n.set(s)},expand:function(e){return yt(t.get(),e).map((function(t){var r=yt(n.get(),e).getOr([]);return[t].concat(r)}))},refresh:function(t){return yt(n.get(),t)},collapse:function(t){return yt(n.get(),t).bind((function(t){return t.length>1?B.some(t.slice(1)):B.none()}))},lookupMenu:u,lookupItem:c,otherMenus:function(t){var e=o.get();return et(lt(e),t)},getPrimary:function(){return r.get().bind(a)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.clear()},isClear:function(){return r.get().isNone()},getTriggeringPath:function(t,e){var o=$(c(t).toArray(),(function(t){return a(t).isSome()}));return yt(n.get(),t).bind((function(t){var n=tt(o.concat(t));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return B.none();e.push(r.getOrDie())}return B.some(e)}(Q(n,(function(t,o){return i(t,e,n.slice(0,o+1)).fold((function(){return Ct(r.get(),t)?[]:[B.none()]}),(function(t){return[B.some(t)]}))})))}))}}},extractPreparedMenu:qh},Gh=v("collapse-item"),Kh=Nd({name:"TieredMenu",configFields:[Au("onExecute"),Au("onEscape"),Nu("onOpenMenu"),Nu("onOpenSubmenu"),_u("onRepositionMenu"),_u("onCollapseMenu"),fo("highlightImmediately",!0),eo("data",[Xr("primary"),Xr("menus"),Xr("expansions")]),fo("fakeFocus",!1),_u("onHighlight"),_u("onHover"),Tu(),Xr("dom"),fo("navigateOnHover",!0),fo("stayInDom",!1),Ef("tmenuBehaviours",[eh,am,zd,ah]),fo("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r=Zc(),o=$h.init(),i=function(e){var n=function(e,n,r){return mt(r,(function(r,o){var i=function(){return jh.sketch(O(O({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?_m():Em()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))}(e,t.data.primary,t.data.menus),r=u();return o.setContents(t.data.primary,n,t.data.expansions,r),o.getPrimary()},a=function(t){return Of.getValue(t).value},u=function(e){return mt(t.data.menus,(function(t,e){return Q(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},c=function(t,e){am.highlight(t,e),am.getHighlighted(e).orThunk((function(){return am.getFirst(e)})).each((function(e){Di(t,e.element,si())}))},s=function(t,e){return St(U(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?B.some(t.menu):B.none()}))})))},l=function(e,n,r){var o=s(n,n.otherMenus(r));W(o,(function(n){ja(n.element,[t.markers.backgroundMenu]),t.stayInDom||ah.remove(e,n)}))},f=function(e,n){var o=function(e){return r.get().getOrThunk((function(){var n={},o=ol(e.element,"."+t.markers.item),i=$(o,(function(t){return"true"===qe(t,"aria-haspopup")}));return W(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=a(t);n[e]=t}))})),r.set(n),n}))}(e);dt(o,(function(t,e){var r=H(n,e);We(t.element,"aria-expanded",r)}))},d=function(e,n,r){return B.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return B.none();var i=o.menu,a=s(n,r.slice(1));return W(a,(function(e){La(e.element,t.markers.backgroundMenu)})),Fe(i.element)||ah.append(e,nu(i)),ja(i.element,[t.markers.backgroundMenu]),c(e,i),l(e,n,r),B.some(i)}))}))};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(n||(n={}));var m=function(e,r,i){if(void 0===i&&(i=n.HighlightSubmenu),r.hasConfigured(Xd)&&Xd.isDisabled(r))return B.some(r);var u=a(r);return o.expand(u).bind((function(a){return f(e,a),B.from(a[0]).bind((function(u){return o.lookupMenu(u).bind((function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return o.setMenuBuilt(e,r),r}return n.menu}(e,u,c);return Fe(s.element)||ah.append(e,nu(s)),t.onOpenSubmenu(e,r,s,tt(a)),i===n.HighlightSubmenu?(am.highlightFirst(s),d(e,o,a)):(am.dehighlightAll(s),B.some(r))}))}))}))},g=function(e,n){var r=a(n);return o.collapse(r).bind((function(r){return f(e,r),d(e,o,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},p=function(e){return function(n,r){return fu(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map(k)}))}))}},v=zi([Ii(Vh(),(function(t,e){var n=e.event.item;o.lookupItem(a(n)).each((function(){var n=e.event.menu;am.highlight(t,n);var r=a(e.event.item);o.refresh(r).each((function(e){return l(t,o,e)}))}))})),Xi((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){0===a(r).indexOf("collapse-item")&&g(e,r),m(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),h)}))})),$i((function(e,n){i(e).each((function(n){ah.append(e,nu(n)),t.onOpenMenu(e,n),t.highlightImmediately&&c(e,n)}))}))].concat(t.navigateOnHover?[Ii(Ah(),(function(e,r){var i=r.event.item;!function(t,e){var n=a(e);o.refresh(n).bind((function(e){return f(t,e),d(t,o,e)}))}(e,i),m(e,i,n.HighlightParent),t.onHover(e,i)}))]:[])),b=function(t){return am.getHighlighted(t).bind(am.getHighlighted)},y={collapseMenu:function(t){b(t).each((function(e){g(t,e)}))},highlightPrimary:function(t){o.getPrimary().each((function(e){c(t,e)}))},repositionMenus:function(e){o.getPrimary().bind((function(t){return b(e).bind((function(t){var e=a(t),n=bt(o.getMenus()),r=St(U(n,$h.extractPreparedMenu));return o.getTriggeringPath(e,(function(t){return function(t,e,n){return st(e,(function(t){if(!t.getSystem().isConnected())return B.none();var e=am.getCandidates(t);return X(e,(function(t){return a(t)===n}))}))}(0,r,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))})).fold((function(){(function(t){return B.from(t.components()[0]).filter((function(t){return"menu"===qe(t.element,"role")}))})(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Rf(t.tmenuBehaviours,[eh.config({mode:"special",onRight:p((function(t,e){return Dd(e.element)?B.none():m(t,e,n.HighlightSubmenu)})),onLeft:p((function(t,e){return Dd(e.element)?B.none():g(t,e)})),onEscape:p((function(e,n){return g(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))})),focusIn:function(t,e){o.getPrimary().each((function(e){Di(t,e.element,si())}))}}),am.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),zd.config({find:function(t){return am.getHighlighted(t)}}),ah.config({})]),eventOrder:t.eventOrder,apis:y,events:v}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:To(t,e),expansions:{}}},collapseItem:function(t){return{value:oa(Gh()),meta:{text:t}}}}}),Xh=Nd({name:"InlineView",configFields:[Xr("lazySink"),_u("onShow"),_u("onHide"),co("onEscape"),Ef("inlineBehaviours",[af,Of,Ec]),lo("fireDismissalEventInstead",[fo("event",xi())]),lo("fireRepositionEventInstead",[fo("event",Ci())]),fo("getRelated",B.none),fo("isExtraPart",S),fo("eventOrder",B.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,(function(){return o.map((function(t){return Hn(t)}))}))},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();af.openWhileCloaked(e,n,(function(){return Ll.positionWithinBounds(i,e,r,o())})),Of.setValue(e,B.some({mode:"position",config:r,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},a="horizontal"===r.type?{layouts:{onLtr:function(){return mc()},onRtl:function(){return gc()}}}:{},u=function(t){return function(t){return 2===t.length}(t)?a:{}};return Kh.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return af.close(e),t.onEscape.map((function(t){return t(e)})),B.some(!0)},onExecute:function(){return B.some(!0)},onOpenMenu:function(t,e){Ll.positionWithinBounds(i().getOrDie(),e,n,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Ll.position(o,n,{anchor:O({type:"submenu",item:e},u(r))})},onRepositionMenu:function(t,e,r){var a=i().getOrDie();Ll.positionWithinBounds(a,e,n,o()),W(r,(function(t){var e=u(t.triggeringPath);Ll.position(a,t.triggeredMenu,{anchor:O({type:"submenu",item:t.triggeringItem},e)})}))}})}(t,e,n,r,o);af.open(e,i),Of.setValue(e,B.some({mode:"menu",menu:i}))},i=function(e){af.isOpen(e)&&Of.getValue(e).each((function(n){switch(n.mode){case"menu":af.getState(e).each(Kh.repositionMenus);break;case"position":var r=t.lazySink(e).getOrDie();Ll.positionWithinBounds(r,e,n.config,n.getBounds())}}))},a={setContent:function(t,e){af.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,B.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,B.none)},showMenuWithinBounds:o,hide:function(t){af.isOpen(t)&&(Of.setValue(t,B.none()),af.close(t))},getContent:function(t){return af.getState(t)},reposition:i,isOpen:af.isOpen};return{uid:t.uid,dom:t.dom,behaviours:Rf(t.inlineBehaviours,[af.config({isPartOf:function(e,n,r){return gu(n,r)||function(e,n){return t.getRelated(e).exists((function(t){return gu(t,n)}))}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),Of.config({store:{mode:"memory",initialValue:B.none()}}),Ec.config({channels:O(O({},ff(O({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),mf(O(O({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:a}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),Yh="layout-inset",Jh=function(t){return t.x},Qh=function(t,e){return t.x+t.width/2-e.width/2},Zh=function(t,e){return t.x+t.width-e.width},tp=function(t){return t.y},ep=function(t,e){return t.y+t.height-e.height},np=function(t,e){return t.y+t.height/2-e.height/2},rp=function(t,e,n){return zu(Zh(t,e),ep(t,e),n.insetSouthwest(),Fu(),"southwest",Gu(t,{right:0,bottom:3}),Yh)},op=function(t,e,n){return zu(Jh(t),ep(t,e),n.insetSoutheast(),Hu(),"southeast",Gu(t,{left:1,bottom:3}),Yh)},ip=function(t,e,n){return zu(Zh(t,e),tp(t),n.insetNorthwest(),Iu(),"northwest",Gu(t,{right:0,top:2}),Yh)},ap=function(t,e,n){return zu(Jh(t),tp(t),n.insetNortheast(),Lu(),"northeast",Gu(t,{left:1,top:2}),Yh)},up=function(t,e,n){return zu(Qh(t,e),tp(t),n.insetNorth(),Vu(),"north",Gu(t,{top:2}),Yh)},cp=function(t,e,n){return zu(Qh(t,e),ep(t,e),n.insetSouth(),ju(),"south",Gu(t,{bottom:3}),Yh)},sp=function(t,e,n){return zu(Zh(t,e),np(t,e),n.insetEast(),Wu(),"east",Gu(t,{right:0}),Yh)},lp=function(t,e,n){return zu(Jh(t),np(t,e),n.insetWest(),Uu(),"west",Gu(t,{left:1}),Yh)},fp=function(t){switch(t){case"north":return up;case"northeast":return ap;case"northwest":return ip;case"south":return cp;case"southeast":return op;case"southwest":return rp;case"east":return sp;case"west":return lp}},dp=function(t,e,n,r,o){return Kc(r).map(fp).getOr(up)(t,e,n,r,o)},mp=function(t){switch(t){case"north":return cp;case"northeast":return op;case"northwest":return rp;case"south":return up;case"southeast":return ap;case"southwest":return ip;case"east":return lp;case"west":return sp}},gp=function(t,e,n,r,o){return Kc(r).map(mp).getOr(up)(t,e,n,r,o)},hp=tinymce.util.Tools.resolve("tinymce.util.Delay"),pp=Nd({name:"Button",factory:function(t){var e=Oh(t.action),n=t.dom.tag,r=function(e){return yt(t.dom,"attributes").bind((function(t){return yt(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:Af(t.buttonBehaviours,[dh.config({}),eh.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return O({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[fo("uid",void 0),Xr("dom"),fo("components",[]),Nf("buttonBehaviours",[dh,eh]),oo("action"),oo("role"),fo("eventOrder",{})]}),vp=function(t){var e=function(t){return void 0!==t.uid}(t)&&xt(t,"uid")?t.uid:fa("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return O(O({},t),{uid:e})}}},bp=tinymce.util.Tools.resolve("tinymce.util.I18n"),yp={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},wp="temporary-placeholder",xp=function(t){return function(){return yt(t,wp).getOr("!not found!")}},Cp=function(t,e){var n=t.toLowerCase();if(bp.isRtl()){var r=function(t,e){return Rt(t,e)?t:function(t,e){return t+e}(t,e)}(n,"-rtl");return wt(e,r)?r:n}return n},Sp=function(t,e){return yt(e,Cp(t,e))},kp=function(t,e){var n=e();return Sp(t,n).getOrThunk(xp(n))},Tp=function(){return uh("add-focusable",[$i((function(t){su(t.element,"svg").each((function(t){return We(t,"focusable","false")}))}))])},Op=function(t,e,n,r){var o,i,a=function(t){return!!bp.isRtl()&&wt(yp,t)}(e)?["tox-icon--flip"]:[],u=yt(n,Cp(e,n)).or(r).getOrThunk(xp(n));return{dom:{tag:t.tag,attributes:null!==(o=t.attributes)&&void 0!==o?o:{},classes:t.classes.concat(a),innerHtml:u},behaviours:xc(_(_([],null!==(i=t.behaviours)&&void 0!==i?i:[],!0),[Tp()],!1))}},Ep=function(t,e,n,r){return void 0===r&&(r=B.none()),Op(e,t,n(),r)},_p={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Rp=Nd({name:"Notification",factory:function(t){var e,n,r,o,i,a=vp({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:xc([ah.config({})])}),u=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},c=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},s=vp({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[u(0)]},c(0)],behaviours:xc([ah.config({})])}),l={updateProgress:function(t,e){t.getSystem().isConnected()&&s.getOpt(t).each((function(t){ah.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[u(e)]},c(e)])}))},updateText:function(t,e){if(t.getSystem().isConnected()){var n=a.get(t);ah.set(n,[Qa(e)])}}},f=J([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return B.from(_p[t])})).toArray()]),d=vp(pp.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[Ep("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":t.translationProvider("Close")}},t.iconProvider)],action:function(e){t.onAction(e)}})),m=[(e=f,n={tag:"div",classes:["tox-notification__icon"]},r=t.iconProvider,o=r(),i=X(e,(function(t){return wt(o,Cp(t,o))})),Op(n,i.getOr(wp),o,B.none())),{dom:{tag:"div",classes:["tox-notification__body"]},components:[a.asSpec()],behaviours:xc([ah.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:xc([dh.config({}),uh("notification-events",[Ii(qo(),(function(t){d.getOpt(t).each(dh.focus)}))])]),components:m.concat(t.progress?[s.asSpec()]:[]).concat(t.closeButton?[d.asSpec()]:[]),apis:l}},configFields:[oo("level"),Xr("progress"),Xr("icon"),Xr("onAction"),Xr("text"),Xr("iconProvider"),Xr("translationProvider"),vo("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function Np(t,e,n){var r=e.backstage.shared;return{open:function(e,o){var i=!e.closeButton&&e.timeout&&(e.timeout>0||e.timeout<0),a=function(){o(),Xh.hide(c)},u=eu(Rp.sketch({text:e.text,level:H(["success","error","warning","warn","info"],e.type)?e.type:void 0,progress:!0===e.progressBar,icon:B.from(e.icon),closeButton:!i,onAction:a,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),c=eu(Xh.sketch(O({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));n.add(c),e.timeout>0&&hp.setTimeout((function(){a()}),e.timeout);var s=function(){var e=Hn(Bt.fromDom(t.getContentAreaContainer())),n=Vn(),r=$u(n.x,e.x,e.right),o=$u(n.y,e.y,e.bottom),i=Math.max(e.right,n.right),a=Math.max(e.bottom,n.bottom);return B.some(In(r,o,i-r,a-o))};return{close:a,moveTo:function(t,e){Xh.showAt(c,nu(u),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){var n=nu(u),o={maxHeightFunction:gs()};if("banner"!==e&&f(t)){var i=function(t){switch(t){case"bc-bc":return cp;case"tc-tc":return up;case"tc-bc":return ic;case"bc-tc":default:return ac}}(e),a={type:"node",root:Ve(),node:B.some(Bt.fromDom(t)),overrides:o,layouts:{onRtl:function(){return[i]},onLtr:function(){return[i]}}};Xh.showWithinBounds(c,n,{anchor:a},s)}else{var l=O(O({},r.anchors.banner()),{overrides:o});Xh.showWithinBounds(c,n,{anchor:l},s)}},text:function(t){Rp.updateText(u,t)},settings:e,getEl:function(){return u.element.dom},progressBar:{value:function(t){Rp.updateProgress(u,t)}}}},close:function(t){t.close()},reposition:function(t){t.length>0&&W(t,(function(e,n){0===n?e.moveRel(null,"banner"):e.moveRel(t[n-1].getEl(),"bc-tc")}))},getArgs:function(t){return t.settings}}}var Ap,Dp=function(t,e){var n=null,r=function(){u(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)}}},Mp=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Bp=function(t,e,n,r,o){var i=Mp(t,(function(e){return function(t,e){return t.isBlock(e)||H(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)}));return B.from(i.backwards(e,n,r,o))},zp=function(t,e){return Pp(Bt.fromDom(t.selection.getNode())).getOrThunk((function(){var n=Bt.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return On(n,Bt.fromDom(e.extractContents())),e.insertNode(n.dom),Oe(n).each((function(t){return t.dom.normalize()})),function(t){return rl(t,nl)}(n).map((function(e){t.selection.setCursorLocation(e.dom,function(t){return"img"===Pt(t)?1:tl(t).fold((function(){return _e(t).length}),(function(t){return t.length}))}(e))})),n}))},Pp=function(t){return fu(t,"[data-mce-autocompleter]")},Lp=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Ip=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},Hp=function(t,e){return t.substring(e.length)},Fp=function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return B.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return Bp(t,e.startContainer,e.startOffset,(function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(Ip(o))return B.none();if(o===n)break}return B.some(r)}(r,e,n).getOr(e)}),i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return B.none();var i=Lp(o);return 0!==i.lastIndexOf(n)||Hp(i,n).length<r?B.none():B.some({text:Hp(i,n),range:o,triggerChar:n})}))},Vp=function(t,e,n,r){return void 0===r&&(r=0),Pp(Bt.fromDom(e.startContainer)).fold((function(){return Fp(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom);var o=Lp(r);return B.some({range:r,text:Hp(o,n),triggerChar:n})}))},jp=function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){Ni(t,Go(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(am.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(Ai),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(am.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&Pp(Bt.fromDom(e.element)).isNone()&&t.cancelIfNecessary()}))},Up=tinymce.util.Tools.resolve("tinymce.util.Promise"),Wp=function(t,e){return{container:t,offset:e}},qp=function(t){if(function(t){return 3===t.nodeType}(t))return Wp(t,t.data.length);var e=t.childNodes;return e.length>0?qp(e[e.length-1]):Wp(t,e.length)},$p=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?$p(n[e],0):n.length>0&&function(t){return 1===t.nodeType}(t)&&n.length===e?qp(n[n.length-1]):Wp(t,e)},Gp=function(t){return function(e){var n=$p(e.startContainer,e.startOffset);return!function(t,e){return Bp(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!Ip(e)})).isSome()}(t,n)}},Kp=function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return st(n.triggerChars,(function(n){return Vp(t,e,n)}))}(t.dom,r,n).bind((function(n){return Xp(t,e,n)}))},Xp=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,a=$(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return Gp(t.dom)}))(n.range,i,n.text)}));if(0===a.length)return B.none();var u=Up.all(U(a,(function(t){return t.fetch(n.text,t.maxResults,r).then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return B.some({lookupData:u,context:n})},Yp=kr([Qr("type"),uo("text")]),Jp=kr([fo("type","autocompleteitem"),fo("active",!1),fo("disabled",!1),fo("meta",{}),Qr("value"),uo("text"),uo("icon")]),Qp=kr([Qr("type"),Qr("ch"),go("minChars",1),fo("columns",1),go("maxResults",10),co("matches"),to("fetch"),to("onAction"),yo("highlightOn",[],Dr)]),Zp=[vo("disabled",!1),uo("tooltip"),uo("icon"),uo("text"),bo("onSetup",(function(){return h}))],tv=kr([Qr("type"),to("onAction")].concat(Zp)),ev=function(t){return Vr("toolbarbutton",tv,t)},nv=[vo("active",!1)].concat(Zp),rv=kr(nv.concat([Qr("type"),to("onAction")])),ov=function(t){return Vr("ToggleButton",rv,t)},iv=[bo("predicate",S),po("scope","node",["node","editor"]),po("position","selection",["node","selection","line"])],av=Zp.concat([fo("type","contextformbutton"),fo("primary",!1),to("onAction"),Gr("original",b)]),uv=nv.concat([fo("type","contextformbutton"),fo("primary",!1),to("onAction"),Gr("original",b)]),cv=Zp.concat([fo("type","contextformbutton")]),sv=nv.concat([fo("type","contextformtogglebutton")]),lv=qr("type",{contextformbutton:av,contextformtogglebutton:uv}),fv=kr([fo("type","contextform"),bo("initValue",v("")),uo("label"),ro("commands",lv),io("launch",qr("type",{contextformbutton:cv,contextformtogglebutton:sv}))].concat(iv)),dv=kr([fo("type","contexttoolbar"),Qr("items")].concat(iv)),mv=function(t){var e=t.ui.registry.getAll().popups,n=mt(e,(function(t){return(e=t,Vr("Autocompleter",Qp,e)).fold((function(t){throw new Error(Wr(t))}),b);var e})),r=function(t){var e={};return W(t,(function(t){e[t]={}})),lt(e)}(pt(n,(function(t){return t.ch}))),o=bt(n);return{dataset:n,triggerChars:r,lookupByChar:function(t){return $(o,(function(e){return e.ch===t}))}}};!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Ap||(Ap={}));var gv,hv=Ap,pv="tox-menu-nav__js",vv="tox-collection__item",bv="tox-swatch",yv={normal:pv,color:bv},wv="tox-collection__item--enabled",xv="tox-collection__item-icon",Cv="tox-collection__item-label",Sv="tox-collection__item-caret",kv="tox-collection__item--active",Tv="tox-collection__item-container",Ov="tox-collection__item-container--row",Ev=function(t){return yt(yv,t).getOr(pv)},_v=function(t){return"color"===t?"tox-swatches":"tox-menu"},Rv=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:_v(t),tieredMenu:"tox-tiered-menu"}},Nv=function(t){var e=Rv(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:Ev(t)}},Av=function(t,e,n){var r=Rv(n);return{tag:"div",classes:J([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},Dv=[jh.parts.items({})],Mv=function(t,e,n){var r=Rv(n);return{dom:{tag:"div",classes:J([[r.tieredMenu]])},markers:Nv(n)}},Bv=function(t,e){return function(n){var r=j(n,e);return U(r,(function(e){return{dom:t,components:e}}))}},zv=function(t,e){var n=[],r=[];return W(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],wt(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),U(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},Pv=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[jh.parts.items({preprocess:function(n){return"auto"!==t&&t>1?Bv({tag:"div",classes:["tox-collection__group"]},t)(n):zv(n,(function(t,n){return"separator"===e[n].type}))}})]}},Lv=function(t){return F(t,(function(t){return"icon"in t&&void 0!==t.icon}))},Iv=function(t){return console.error(Wr(t)),console.log(t),B.none()},Hv=function(t,e,n,r,o){var i,a=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[jh.parts.items({preprocess:function(t){return zv(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:a.dom,components:a.components,items:n}},Fv=function(t,e,n,r,o){var i;return"color"===o?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[jh.parts.items({preprocess:"auto"!==t?Bv({tag:"div",classes:["tox-swatches__row"]},t):b})]}]}}(r)).dom,components:i.components,items:n}:"normal"===o&&"auto"===r?{value:t,dom:(i=Pv(r,n)).dom,components:i.components,items:n}:"normal"===o&&1===r?{value:t,dom:(i=Pv(1,n)).dom,components:i.components,items:n}:"normal"===o?{value:t,dom:(i=Pv(r,n)).dom,components:i.components,items:n}:"listpreview"===o&&"auto"!==r?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[jh.parts.items({preprocess:Bv({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:i.components,items:n}:{value:t,dom:Av(e,r,o),components:Dv,items:n}},Vv=[Qr("type"),Qr("src"),uo("alt"),yo("classes",[],Dr)],jv=kr(Vv),Uv=[Qr("type"),Qr("text"),uo("name"),yo("classes",["tox-collection__item-label"],Dr)],Wv=kr(Uv),qv=xr((function(){return Ir("type",{cardimage:jv,cardtext:Wv,cardcontainer:$v})})),$v=kr([Qr("type"),ho("direction","horizontal"),ho("align","left"),ho("valign","middle"),ro("items",qv)]),Gv=[vo("disabled",!1),uo("text"),uo("shortcut"),$r("value","value",sr((function(){return oa("menuitem-value")})),Rr()),fo("meta",{})],Kv=kr([Qr("type"),uo("label"),ro("items",qv),bo("onSetup",(function(){return h})),bo("onAction",h)].concat(Gv)),Xv=kr([Qr("type"),vo("active",!1),uo("icon")].concat(Gv)),Yv=[Qr("type"),Qr("fancytype"),bo("onAction",h)],Jv=[fo("initData",{})].concat(Yv),Qv=[wo("initData",{},[vo("allowCustomColors",!0),so("colors",Rr())])].concat(Yv),Zv=qr("fancytype",{inserttable:Jv,colorswatch:Qv}),tb=kr([Qr("type"),bo("onSetup",(function(){return h})),bo("onAction",h),uo("icon")].concat(Gv)),eb=kr([Qr("type"),to("getSubmenuItems"),bo("onSetup",(function(){return h})),uo("icon")].concat(Gv)),nb=kr([Qr("type"),uo("icon"),vo("active",!1),bo("onSetup",(function(){return h})),to("onAction")].concat(Gv)),rb=function(t,e,n){var r=ol(t.element,"."+n);if(r.length>0){var o=Y(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return B.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return B.none()},ob=function(t,e){return xc([uh(t,e)])},ib=function(t){return ob(oa("unnamed-events"),t)},ab=oa("tooltip.exclusive"),ub=oa("tooltip.show"),cb=oa("tooltip.hide"),sb=function(t,e,n){t.getSystem().broadcastOn([ab],{})},lb=Object.freeze({__proto__:null,hideAllExclusive:sb,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&ah.set(t,r)}))}}),fb=Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){ql(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return zi(J([[Ii(ub,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){sb(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:zi("normal"===t.mode?[Ii(Wo(),(function(t){Ri(n,ub)})),Ii(jo(),(function(t){Ri(n,cb)}))]:[]),behaviours:xc([ah.config({})])});e.setTooltip(o),jl(r,o),t.onShow(n,o),Ll.position(r,o,{anchor:t.anchor(n)})}}(n)}),t.delay)})),Ii(cb,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Ii(ui(),(function(t,e){var r=e;r.universal||H(r.channels,ab)&&n(t)})),Gi((function(t){n(t)}))],"normal"===t.mode?[Ii(qo(),(function(t){Ri(t,ub)})),Ii(ii(),(function(t){Ri(t,cb)})),Ii(Wo(),(function(t){Ri(t,ub)})),Ii(jo(),(function(t){Ri(t,cb)}))]:[Ii(Ei(),(function(t,e){Ri(t,ub)})),Ii(_i(),(function(t){Ri(t,cb)}))]]))}}),db=[Xr("lazySink"),Xr("tooltipDom"),fo("exclusive",!0),fo("tooltipComponents",[]),fo("delay",300),po("mode","normal",["normal","follow-highlight"]),fo("anchor",(function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:v([ac,ic,ec,rc,nc,oc]),onRtl:v([ac,ic,ec,rc,nc,oc])}}})),_u("onHide"),_u("onShow")],mb=Sc({fields:db,name:"tooltipping",active:fb,state:Object.freeze({__proto__:null,init:function(){var t=Zc(),e=Zc(),n=function(){t.on(clearTimeout)},r=v("not-implemented");return xa({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:n,resetTimer:function(e,r){n(),t.set(setTimeout(e,r))},readState:r})}}),apis:lb}),gb=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),hb=tinymce.util.Tools.resolve("tinymce.EditorManager"),pb=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},vb=function(t){return t.getParam("width",gb.DOM.getStyle(t.getElement(),"width"))},bb=function(t){return B.from(t.getParam("min_width")).filter(m)},yb=function(t){return B.from(t.getParam("min_height")).filter(m)},wb=function(t){return B.from(t.getParam("max_width")).filter(m)},xb=function(t){return B.from(t.getParam("max_height")).filter(m)},Cb=function(t){return!1!==t.getParam("menubar",!0,"boolean")},Sb=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=o(e),i=a(e)&&e.length>0;return!Tb(t)&&(i||r||n)},kb=function(t){var e=V(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=$(e,(function(t){return"string"==typeof t}));return n.length>0?B.some(n):B.none()},Tb=function(t){return kb(t).fold((function(){return t.getParam("toolbar",[],"string[]").length>0}),k)};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(gv||(gv={}));var Ob,Eb=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(Ob||(Ob={}));var _b,Rb,Nb=function(t){return t.getParam("toolbar_location",Ob.auto,"string")},Ab=function(t){return Nb(t)===Ob.bottom},Db=function(t){if(!t.inline)return B.none();var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);if(e.length>0)return lu(Ve(),e);var n=function(t){return t.getParam("fixed_toolbar_container_target")}(t);return f(n)?B.some(Bt.fromDom(n)):B.none()},Mb=function(t){return t.inline&&Db(t).isSome()},Bb=function(t){return Db(t).getOrThunk((function(){return Pe(ze(Bt.fromDom(t.getElement())))}))},zb=function(t){return t.inline&&!Cb(t)&&!Sb(t)&&!Tb(t)},Pb=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!Mb(t)&&!zb(t)},Lb=function(t){var e=t.getParam("menu");return e?mt(e,(function(t){return O(O({},t),{items:t.items})})):{}},Ib=function(t){return t.getParam("menubar")},Hb=function(t){return t.getParam("anchor_top","#top")},Fb=function(t){return t.getParam("anchor_bottom","#bottom")},Vb="silver.readonly",jb=kr([(_b="readonly",Yr(_b,Mr))]),Ub=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([uf()],{target:n}),t.uiMothership.broadcastOn([uf()],{target:n})),t.mothership.broadcastOn([Vb],{readonly:e}),t.uiMothership.broadcastOn([Vb],{readonly:e})},Wb=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&Ub(e,!0)})),t.on("SwitchMode",(function(){return Ub(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},qb=function(){var t;return Ec.config({channels:(t={},t[Vb]={schema:jb,onReceive:function(t,e){Xd.set(t,e.readonly)}},t)})},$b=function(t){return Xd.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},Gb=function(t){return Xd.config({disabled:t})},Kb=function(t){return Xd.config({disabled:t,disableClass:"tox-tbtn--disabled"})},Xb=function(t){return Xd.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Yb=function(t,e){var n=t.getApi(e);return function(t){t(n)}},Jb=function(t,e){return $i((function(n){Yb(t,n)((function(n){var r=t.onSetup(n);d(r)&&e.set(r)}))}))},Qb=function(t,e){return Gi((function(n){return Yb(t,n)(e.get())}))},Zb=function(t,e){return Xi((function(n,r){Yb(t,n)(t.onAction),t.triggersSubmenu||e!==hv.CLOSE_ON_EXECUTE||(Ri(n,di()),r.stop())}))},ty=((Rb={})[ci()]=["disabling","alloy.base.behaviour","toggling","item-events"],Rb),ey=St,ny=function(t,e,n,r){var o=xo(h);return{type:"item",dom:e.dom,components:ey(e.optComponents),data:t.data,eventOrder:ty,hasSubmenu:t.triggersSubmenu,itemBehaviours:xc([uh("item-events",[Zb(t,n),Jb(t,o),Qb(t,o)]),$b((function(){return t.disabled||r.isDisabled()})),qb(),ah.config({})].concat(t.itemBehaviours))}},ry=function(t){return{value:t.value,meta:O({text:t.text.getOr("")},t.meta)}},oy=tinymce.util.Tools.resolve("tinymce.Env"),iy=function(t){var e=oy.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=U(n,(function(t){var n=t.toLowerCase().trim();return wt(e,n)?e[n]:t}));return oy.mac?r.join(""):r.join("+")},ay=function(t,e,n){return void 0===n&&(n=[xv]),Ep(t,{tag:"div",classes:n},e)},uy=function(t){return{dom:{tag:"div",classes:[Cv]},components:[Qa(bp.translate(t))]}},cy=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},sy=function(t,e){return{dom:{tag:"div",classes:[Cv]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Qa(bp.translate(e))]}]}},ly=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:iy(t)}}},fy=function(t){return ay("checkmark",t,["tox-collection__item-checkmark"])},dy=function(t,e,n){var r,o,i=t.ariaLabel,a=t.value,u=t.iconContent.map((function(t){return function(t,e,n){var r=e();return Sp(t,r).or(n).getOrThunk(xp(r))}(t,e.icons,n)}));return{dom:(r=u.getOr(""),o={tag:"div",attributes:i.map((function(t){return{title:e.translate(t)}})).getOr({}),classes:["tox-swatch"]},O(O({},o),"custom"===a?{tag:"button",classes:_(_([],o.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:r}:"remove"===a?{classes:_(_([],o.classes,!0),["tox-swatch--remove"],!1),innerHtml:r}:{attributes:O(O({},o.attributes),{"data-mce-color":a}),styles:{"background-color":a}})),optComponents:[]}},my=function(t){var e=t.map((function(t){return{attributes:{title:bp.translate(t)}}})).getOr({});return O({tag:"div",classes:[pv,vv]},e)},gy=function(t,e,n,r){return void 0===r&&(r=B.none()),"color"===t.presets?dy(t,e,r):function(t,e,n,r){var o={tag:"div",classes:[xv]},i=n?t.iconContent.map((function(t){return Ep(t,o,e.icons,r)})).orThunk((function(){return B.some({dom:o})})):B.none(),a=t.checkMark,u=B.from(t.meta).fold((function(){return uy}),(function(t){return wt(t,"style")?w(sy,t.style):uy})),c=t.htmlContent.fold((function(){return t.textContent.map(u)}),(function(t){return B.some(cy(t,[Cv]))}));return{dom:my(t.ariaLabel),optComponents:[i,c,t.shortcutContent.map(ly),a,t.caret]}}(t,e,n,r)},hy=function(t,e){return yt(t,"tooltipWorker").map((function(t){return[mb.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:gs}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){mb.setComponents(e,[Za({element:Bt.fromDom(t)})])}))}})]})).getOr([])},py=function(t,e){var n=function(t){return gb.DOM.encode(t)}(bp.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return n},vy=function(t,e){return U(t,(function(t){switch(t.type){case"cardcontainer":return function(t,e){var n="vertical"===t.direction?"tox-collection__item-container--column":Ov,r="left"===t.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[Tv,n,r,function(){switch(t.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:e}}(t,vy(t.items,e));case"cardimage":return function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}}(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return H(e.cardText.highlightOn,t)}))?B.from(e.cardText.matchText).getOr(""):"";return cy(py(t.text,n),t.classes)}}))},by=sd(zh(),Ph()),yy=function(t){return{value:t}},wy=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,xy=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Cy=function(t){return wy.test(t)||xy.test(t)},Sy=function(t){return function(t,e){return _t(t,e)?function(t,e){return t.substring(e)}(t,e.length):t}(t,"#").toUpperCase()},ky=function(t){var e=function(t){return{value:t.value.replace(wy,(function(t,e,n,r){return e+e+n+n+r+r}))}}(t),n=xy.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},Ty=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Oy=function(t){var e=Ty(t.red)+Ty(t.green)+Ty(t.blue);return yy(e)},Ey=Math.min,_y=Math.max,Ry=Math.round,Ny=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Ay=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Dy=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},My=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},By=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,a=t.value/100;if(i=_y(0,Ey(i,1)),a=_y(0,Ey(a,1)),0===i)return e=n=r=Ry(255*a),Dy(e,n,r,1);var u=o/60,c=a*i,s=c*(1-Math.abs(u%2-1)),l=a-c;switch(Math.floor(u)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=Ry(255*(e+l)),n=Ry(255*(n+l)),r=Ry(255*(r+l)),Dy(e,n,r,1)},zy=function(t){var e=ky(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return Dy(n,r,o,1)},Py=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),a=parseInt(n,10),u=parseFloat(r);return Dy(o,i,a,u)},Ly=function(t){if("transparent"===t)return B.some(Dy(0,0,0,0));var e=Ny.exec(t);if(null!==e)return B.some(Py(e[1],e[2],e[3],"1"));var n=Ay.exec(t);return null!==n?B.some(Py(n[1],n[2],n[3],n[4])):B.none()},Iy=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},Hy=Dy(255,0,0,1),Fy=function(t,e){return t.fire("ResizeContent",e)},Vy=function(t,e,n){return{hue:t,saturation:e,value:n}},jy=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,a=t.blue/255,u=Math.min(o,Math.min(i,a)),c=Math.max(o,Math.max(i,a));return u===c?Vy(0,0,100*(r=u)):(n=60*((n=o===u?3:a===u?1:5)-(o===u?i-a:a===u?o-i:a-o)/(c-u)),e=(c-u)/c,r=c,Vy(Math.round(n),Math.round(100*e),Math.round(100*r)))},Uy=function(t){return Oy(By(t))},Wy=function(t){return(e=t,Cy(e)?B.some({value:Sy(e)}):B.none()).orThunk((function(){return Ly(t).map(Oy)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],a=r[2],u=r[3];return Oy(Dy(o,i,a,u))}));var e},qy=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),$y="tinymce-custom-colors";var Gy,Ky="choiceitem",Xy=[{type:Ky,text:"Light Green",value:"#BFEDD2"},{type:Ky,text:"Light Yellow",value:"#FBEEB8"},{type:Ky,text:"Light Red",value:"#F8CAC6"},{type:Ky,text:"Light Purple",value:"#ECCAFA"},{type:Ky,text:"Light Blue",value:"#C2E0F4"},{type:Ky,text:"Green",value:"#2DC26B"},{type:Ky,text:"Yellow",value:"#F1C40F"},{type:Ky,text:"Red",value:"#E03E2D"},{type:Ky,text:"Purple",value:"#B96AD9"},{type:Ky,text:"Blue",value:"#3598DB"},{type:Ky,text:"Dark Turquoise",value:"#169179"},{type:Ky,text:"Orange",value:"#E67E23"},{type:Ky,text:"Dark Red",value:"#BA372A"},{type:Ky,text:"Dark Purple",value:"#843FA1"},{type:Ky,text:"Dark Blue",value:"#236FA1"},{type:Ky,text:"Light Gray",value:"#ECF0F1"},{type:Ky,text:"Medium Gray",value:"#CED4D9"},{type:Ky,text:"Gray",value:"#95A5A6"},{type:Ky,text:"Dark Gray",value:"#7E8C8D"},{type:Ky,text:"Navy Blue",value:"#34495E"},{type:Ky,text:"Black",value:"#000000"},{type:Ky,text:"White",value:"#ffffff"}],Yy=function(t){void 0===t&&(t=10);var e,n=qy.getItem($y),r=o(n)?JSON.parse(n):[],i=t-(e=r).length<0?e.slice(0,t):e,a=function(t){i.splice(t,1)};return{add:function(e){(function(t,e){var n=I(t,e);return-1===n?B.none():B.some(n)})(i,e).each(a),i.unshift(e),i.length>t&&i.pop(),qy.setItem($y,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Jy=function(t){return!1!==t.getParam("custom_colors")},Qy=function(t){var e=function(t){return t.getParam("color_map")}(t);return void 0!==e?function(t){for(var e=[],n=0;n<t.length;n+=2)e.push({text:t[n+1],value:"#"+Wy(t[n]).value,type:"choiceitem"});return e}(e):Xy},Zy=function(t){Yy.add(t)},tw=function(t){return function(t,e){return t.getParam("color_cols",e,"number")}(t,function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))}(Qy(t).length))},ew=function(t){var e="choiceitem",n={type:e,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[n,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[n]},nw=function(t,e,n,r){"custom"===n?cw(t)((function(n){n.each((function(n){Zy(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},rw=function(t,e){return t.concat(U(Yy.state(),(function(t){return{type:Ky,text:t,value:t}})).concat(ew(e)))},ow=function(t,e){return function(n){n(rw(t,e))}},iw=function(t,e,n){var r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";t.setIconFill(r,n)},aw=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return B.from(function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),n}(t,n)).bind((function(t){return Ly(t).map((function(t){var n=Oy(t).value;return Et(e.toLowerCase(),n)}))})).getOr(!1)},columns:tw(t),fetch:ow(Qy(t),Jy(t)),onAction:function(e){null!==o.get()&&nw(t,n,o.get(),h)},onItemAction:function(r,i){nw(t,n,i,(function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})}))},onSetup:function(n){null!==o.get()&&iw(n,e,o.get());var r=function(t){t.name===e&&iw(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},uw=function(t,e,n,r){t.ui.registry.addNestedMenuItem(e,{text:r,icon:"forecolor"===e?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(e){nw(t,n,e.value,h)}}]}})},cw=function(t){return function(e,n){var r=!1,o={colorpicker:n};t.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(t,e){"hex-valid"===e.name&&(r=e.value)},onSubmit:function(n){var o=n.getData().colorpicker;r?(e(B.from(o)),n.close()):t.windowManager.alert(t.translate(["Invalid hex color code: {0}",o]))},onClose:h,onCancel:function(){e(B.none())}})}},sw=function(t,e,n,r,o,i,a,u){var c=Lv(e),s=lw(e,n,r,"color"!==o?"normal":"color",i,a,u);return Fv(t,c,s,r,o)},lw=function(t,e,n,r,o,i,a){return St(U(t,(function(u){return"choiceitem"===u.type?(c=u,Vr("choicemenuitem",Xv,c)).fold(Iv,(function(c){return B.some(function(t,e,n,r,o,i,a,u){void 0===u&&(u=!0);var c=gy({presets:n,textContent:e?t.text:B.none(),htmlContent:B.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:B.none(),checkMark:e?B.some(fy(a.icons)):B.none(),caret:B.none(),value:t.value},a,u);return ur(ny({data:ry(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){kh.set(t,e)},isActive:function(){return kh.isOn(t)},isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),h},triggersSubmenu:!1,itemBehaviours:[]},c,i,a),{toggling:{toggleClass:wv,toggleOnExecute:!1,selected:t.active}})}(c,1===n,r,e,i(u.value),o,a,Lv(t)))})):B.none();var c})))},fw=function(t,e){var n=Nv(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}},dw=function(t,e){var n=t.initData.allowCustomColors&&e.colorinput.hasCustomColors();return t.initData.colors.fold((function(){return rw(e.colorinput.getColors(),n)}),(function(t){return t.concat(ew(n))}))},mw=oa("cell-over"),gw=oa("cell-execute"),hw=function(t,e,n){var r,o=function(n){return Ni(n,gw,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return eu({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:xc([uh("insert-table-picker-cell",[Ii(Wo(),dh.focus),Ii(ci(),o),Ii(Jo(),i),Ii(li(),i)]),kh.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),dh.config({onFocus:function(n){return Ni(n,mw,{row:t,col:e})}})])})},pw=function(t){return Q(t,(function(t){return U(t,nu)}))},vw=function(t,e){return Qa(e+1+"x"+(t+1))},bw={inserttable:function(t){var e=oa("size-label"),n=function(t,e,n){for(var r=[],o=0;o<e;o++){for(var i=[],a=0;a<n;a++)i.push(hw(o,a,t));r.push(i)}return r}(e,10,10),r=vp({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[Qa("0x0")],behaviours:xc([ah.config({})])});return{type:"widget",data:{value:oa("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[by.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:pw(n).concat(r.asSpec()),behaviours:xc([uh("insert-table-picker",[ji(mw,(function(t,e,o){var i=o.event.row,a=o.event.col;!function(t,e,n,r,o){for(var i=0;i<r;i++)for(var a=0;a<o;a++)kh.set(t[i][a],i<=e&&a<=n)}(n,i,a,10,10),ah.set(r.get(t),[vw(i,a)])})),ji(gw,(function(e,n,r){t.onAction({numRows:r.event.row+1,numColumns:r.event.col+1}),Ri(e,di())}))]),eh.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=dw(t,e),r=e.colorinput.getColorCols(),o="color",i=sw(oa("menu-value"),n,(function(e){t.onAction({value:e})}),r,o,hv.CLOSE_ON_EXECUTE,S,e.shared.providers),a=O(O({},i),{markers:Nv(o),movement:fw(r,o)});return{type:"widget",data:{value:oa("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[by.widget(jh.sketch(a))]}}},yw=function(t,e,n,r,o,i,a,u){void 0===u&&(u=!0);var c=gy({presets:r,textContent:B.none(),htmlContent:n?t.text.map((function(t){return py(t,e)})):B.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:B.none(),checkMark:B.none(),caret:B.none(),value:t.value},a.providers,u,t.icon);return ny({data:ry(t),disabled:t.disabled,getApi:v({}),onAction:function(e){return o(t.value,t.meta)},onSetup:v(h),triggersSubmenu:!1,itemBehaviours:hy(t.meta,a)},c,i,a.providers)},ww=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:O({tag:"div",classes:[vv,"tox-collection__group-heading"]},e),components:[]}},xw=function(t,e,n,r){void 0===r&&(r=!0);var o=gy({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:B.none(),ariaLabel:t.text,caret:B.none(),checkMark:B.none(),shortcutContent:t.shortcut},n,r);return ny({data:ry(t),getApi:function(t){return{isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)},Cw=function(t,e,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var i,a=o?(i=n.icons,ay("chevron-down",i,[Sv])):function(t){return ay("chevron-right",t,[Sv])}(n.icons),u=gy({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:B.none(),ariaLabel:t.text,caret:B.some(a),checkMark:B.none(),shortcutContent:t.shortcut},n,r);return ny({data:ry(t),getApi:function(t){return{isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)}}},disabled:t.disabled,onAction:h,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,e,n)},Sw=function(t,e,n,r){void 0===r&&(r=!0);var o=gy({iconContent:t.icon,textContent:t.text,htmlContent:B.none(),ariaLabel:t.text,checkMark:B.some(fy(n.icons)),caret:B.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return ur(ny({data:ry(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){kh.set(t,e)},isActive:function(){return kh.isOn(t)},isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:wv,toggleOnExecute:!1,selected:t.active}})},kw=function(t,e){return yt(bw,t.fancytype).map((function(n){return n(t,e)}))},Tw=function(t,e,n,r){var o={dom:my(t.label),optComponents:[B.some({dom:{tag:"div",classes:[Tv,Ov]},components:vy(t.items,r)})]};return ny({data:ry(O({text:B.none()},t)),disabled:t.disabled,getApi:function(t){return{isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){Xd.set(t,e),W(ol(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(Xd)&&Xd.set(t,e)}))}))}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:B.from(r.itemBehaviours).getOr([])},o,e,n.providers)};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(Gy||(Gy={}));var Ow=function(t,e,n,r,o){var i,a=n.shared.providers,u=function(t){return o?O(O({},t),{shortcut:B.none(),icon:t.text.isSome()?B.none():t.icon}):t};switch(t.type){case"menuitem":return(i=t,Vr("menuitem",tb,i)).fold(Iv,(function(t){return B.some(xw(u(t),e,a,r))}));case"nestedmenuitem":return function(t){return Vr("nestedmenuitem",eb,t)}(t).fold(Iv,(function(t){return B.some(Cw(u(t),e,a,r,o))}));case"togglemenuitem":return function(t){return Vr("togglemenuitem",nb,t)}(t).fold(Iv,(function(t){return B.some(Sw(u(t),e,a,r))}));case"separator":return function(t){return Vr("separatormenuitem",Yp,t)}(t).fold(Iv,(function(t){return B.some(ww(t))}));case"fancymenuitem":return function(t){return Vr("fancymenuitem",Zv,t)}(t).fold(Iv,(function(t){return kw(u(t),n)}));default:return console.error("Unknown item in general menu",t),B.none()}},Ew=function(t,e,n,r,o,i,a){var u=1===r,c=!u||Lv(t);return St(U(t,(function(t){switch(t.type){case"separator":return(r=t,Vr("Autocompleter.Separator",Yp,r)).fold(Iv,(function(t){return B.some(ww(t))}));case"cardmenuitem":return function(t){return Vr("cardmenuitem",Kv,t)}(t).fold(Iv,(function(t){return B.some(Tw(O(O({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:hy(t.meta,i),cardText:{matchText:e,highlightOn:a}}))}));case"autocompleteitem":default:return function(t){return Vr("Autocompleter.Item",Jp,t)}(t).fold(Iv,(function(t){return B.some(yw(t,e,u,"normal",n,o,i,c))}))}var r})))},_w=function(t,e,n,r,o){var i=Lv(e),a=St(U(e,(function(t){var e=function(t){return Ow(t,n,r,function(t){return o?!wt(t,"text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(O(O({},t),{disabled:!0})):e(t)})));return(o?Hv:Fv)(t,i,a,1,"normal")},Rw=function(t){return Kh.singleData(t.value,t)},Nw=function(t,e){var n=Zc(),r=xo(!1),o=eu(Xh.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:xc([uh("dismissAutocompleter",[Ii(xi(),(function(){return u()}))])]),lazySink:e.getSink})),i=function(){return n.get().isSome()},a=function(){i()&&Xh.hide(o)},u=function(){if(i()){var e=n.get().map((function(t){return t.element}));Pp(e.getOr(Bt.fromDom(t.selection.getNode()))).each(Nn),a(),n.clear(),r.set(!1)}},c=jt((function(){return mv(t)})),s=function(e,n,r,i){e.matchLength=n.text.length;var a=st(r,(function(t){return B.from(t.columns)})).getOr(1);Xh.showAt(o,jh.sketch(function(t,e,n,r){var o=n===Gy.ContentFocus?_m():Em(),i=fw(e,r),a=Nv(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:a.selectedItem,item:a.item},movement:i,fakeFocus:n===Gy.ContentFocus,focusManager:o,menuBehaviours:ib("auto"!==e?[]:[$i((function(t,e){rb(t,4,a.item).each((function(e){var n=e.numColumns,r=e.numRows;eh.setGridSize(t,r,n)}))}))])}}(Fv("autocompleter-value",!0,i,a,"normal"),a,Gy.ContentFocus,"normal")),{anchor:{type:"node",root:Bt.fromDom(t.getBody()),node:B.from(e.element)}}),Xh.getContent(o).each(am.highlightFirst)},l=function(o){(function(e){return n.get().map((function(n){return Vp(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return Xp(t,c,n,e)}))})).getOrThunk((function(){return Kp(t,c)}))})(o).fold(u,(function(o){!function(e){if(!i()){var o=zp(t,e.range);n.set({triggerChar:e.triggerChar,element:o,matchLength:e.text.length}),r.set(!1)}}(o.context),o.lookupData.then((function(i){n.get().map((function(n){var c,f,d,m=o.context;if(n.triggerChar===m.triggerChar){var g=(c=m.triggerChar,d=st(f=i,(function(t){return B.from(t.columns)})).getOr(1),Q(f,(function(n){var o=n.items;return Ew(o,n.matchText,(function(e,o){var i=t.selection.getRng();Vp(t.dom,i,c).fold((function(){return console.error("Lost context. Cursor probably moved")}),(function(t){var i=t.range,c={hide:function(){u()},reload:function(t){a(),l(t)}};r.set(!0),n.onAction(c,i,e,o),r.set(!1)}))}),d,hv.BUBBLE_TO_SANDBOX,e,n.highlightOn)})));g.length>0?s(n,m,i,g):m.text.length-n.matchLength>=10?u():a()}}))}))}))},f={onKeypress:Dp((function(t){27!==t.which&&l()}),50),cancelIfNecessary:u,isMenuOpen:function(){return Xh.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return Xh.getContent(o)}};!1===t.hasPlugin("rtc")&&jp(f,t)},Aw=function(t,e,n){return fu(t,e,n).isSome()},Dw=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},schedule:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},Mw=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?B.none():B.some(e.touches[0])},Bw=function(t){var e=Zc(),n=xo(!1),r=Dw((function(e){t.triggerEvent(fi(),e),n.set(!0)}),400),o=Oo([{key:Po(),value:function(t){return Mw(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(i)})),B.none()}},{key:Lo(),value:function(t){return r.cancel(),Mw(t).each((function(t){e.on((function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.clear()}))})),B.none()}},{key:Io(),value:function(o){r.cancel();return e.get().filter((function(t){return ye(t.target,o.target)})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(li(),o)}))}}]);return{fireIfReady:function(t,e){return yt(o,e).bind((function(e){return e(t)}))}}},zw=function(){return pe().browser.isFirefox()},Pw=function(t,e){var n=O({stopBackspace:!0},e),r=Bw(n),o=U(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return es(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=Zc(),a=es(t,"paste",(function(t){r.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),n.triggerEvent("paste",t)&&t.kill(),i.set(setTimeout((function(){n.triggerEvent(ai(),t)}),0))})),u=es(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():n.stopBackspace&&function(t){return t.raw.which===um[0]&&!H(["input","textarea"],Pt(t.target))&&!Aw(t.target,'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return zw()?ns(t,"focus",e):es(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=Zc(),l=function(t,e){return zw()?ns(t,"blur",e):es(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(setTimeout((function(){n.triggerEvent(ii(),t)}),0))}));return{unbind:function(){W(o,(function(t){t.unbind()})),u.unbind(),c.unbind(),l.unbind(),a.unbind(),i.on(clearTimeout),s.on(clearTimeout)}}},Lw=function(t,e){var n=yt(t,"target").getOr(e);return xo(n)},Iw=Co([{stopped:[]},{resume:["element"]},{complete:[]}]),Hw=function(t,e,n,r,o,i){var a=t(e,r),u=function(t,e){var n=xo(!1),r=xo(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return a.fold((function(){return i.logEventNoHandlers(e,r),Iw.complete()}),(function(t){var n=t.descHandler;return ka(n)(u),u.isStopped()?(i.logEventStopped(e,t.element,n.purpose),Iw.stopped()):u.isCut()?(i.logEventCut(e,t.element,n.purpose),Iw.complete()):Oe(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),Iw.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),Iw.resume(r)}))}))},Fw=function(t,e,n,r,o,i){return Hw(t,e,n,r,o,i).fold(k,(function(r){return Fw(t,e,n,r,o,i)}),S)},Vw=function(t,e,n){var r=function(t){var e=xo(!1);return{stop:function(){e.set(!0)},cut:h,isStopped:e.get,isCut:S,event:t,setSource:C("Cannot set source of a broadcasted event"),getSource:C("Cannot get source of a broadcasted event")}}(e);return W(t,(function(t){var e=t.descHandler;ka(e)(r)})),r.isStopped()},jw=function(t,e,n,r,o){var i=Lw(n,r);return Fw(t,e,n,r,i,o)},Uw=function(){var t={};return{registerId:function(e,n,r){dt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=function(t,e){return n=w.apply(void 0,[t.handler].concat(e)),r=t.purpose,{cHandler:n,purpose:r};var n,r}(r,e),t[o]=i}))},unregisterId:function(e){dt(t,(function(t,n){wt(t,e)&&delete t[e]}))},filterByType:function(e){return yt(t,e).map((function(t){return pt(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){return yt(t,n).bind((function(t){return No(r,(function(e){return function(t,e){return la(e).bind((function(e){return yt(t,e)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}(t,e)}),e)}))}}},Ww=function(){var t=Uw(),e={},n=function(t){var e=t.element;return la(e).getOrThunk((function(){return function(t,e){var n=oa(ua+t);return sa(e,n),n}("uid-",t.element)}))},r=function(n){la(n.element).each((function(n){delete e[n],t.unregisterId(n)}))};return{find:function(e,n,r){return t.find(e,n,r)},filter:function(e){return t.filterByType(e)},register:function(o){var i=n(o);xt(e,i)&&function(t,n){var o=e[n];if(o!==t)throw new Error('The tagId "'+n+'" is already used by: '+ta(o.element)+"\nCannot use it for: "+ta(t.element)+"\nThe conflicting element is"+(Fe(o.element)?" ":" not ")+"already in the DOM");r(t)}(o,i);var a=[o];t.registerId(a,i,o.events),e[i]=o},unregister:r,getById:function(t){return yt(e,t)}}},qw=Nd({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=E(e,["attributes"]);return{uid:t.uid,dom:O({tag:"div",attributes:O({role:"presentation"},n)},r),components:t.components,behaviours:_f(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[fo("components",[]),Ef("containerBehaviours",[]),fo("events",{}),fo("domModification",{}),fo("eventOrder",{})]}),$w=function(t){var e=function(e){return Oe(t.element).fold(k,(function(t){return ye(e,t)}))},n=Ww(),r=function(t,r){return n.find(e,t,r)},o=Pw(t.element,{triggerEvent:function(t,e){return yu(t,e.target,(function(n){return function(t,e,n,r){return jw(t,e,n,n.target,r)}(r,t,e,n)}))}}),i={debugInfo:v("real"),triggerEvent:function(t,e,n){yu(t,e,(function(o){return jw(r,t,n,e,o)}))},triggerFocus:function(t,e){la(t).fold((function(){Nc(t)}),(function(n){yu(oi(),t,(function(n){return function(t,e,n,r,o){var i=Lw(n,r);Hw(t,e,n,r,i,o)}(r,oi(),{originator:e,kill:h,prevent:h,target:t},t,n),!1}))}))},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:eu,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){a(t)},removeFromWorld:function(t){u(t)},broadcast:function(t){f(t)},broadcastOn:function(t,e){d(t,e)},broadcastEvent:function(t,e){m(t,e)},isConnected:k},a=function(t){t.connect(i),Ht(t.element)||(n.register(t),W(t.components(),a),i.triggerEvent(gi(),t.element,{target:t.element}))},u=function(t){Ht(t.element)||(W(t.components(),u),n.unregister(t)),t.disconnect()},c=function(e){jl(t,e)},s=function(t){ql(t)},l=function(t){var e=n.filter(ui());W(e,(function(e){var n=e.descHandler;ka(n)(t)}))},f=function(t){l({universal:!0,data:t})},d=function(t,e){l({universal:!1,channels:t,data:e})},m=function(t,e){var r=n.filter(t);return Vw(r,e)},g=function(t){return n.getById(t).fold((function(){return Wn.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),Wn.value)},p=function(t){var e=la(t).getOr("not found");return g(e)};return a(t),{root:t,element:t.element,destroy:function(){o.unbind(),Rn(t.element)},add:c,remove:s,getByUid:g,getByDom:p,addToWorld:a,removeFromWorld:u,broadcast:f,broadcastOn:d,broadcastEvent:m}},Gw=v([fo("prefix","form-field"),Ef("fieldBehaviours",[zd,Of])]),Kw=v([od({schema:[Xr("dom")],name:"label"}),od({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Xr("text")],name:"aria-descriptor"}),nd({factory:{sketch:function(t){var e=ko(t,["factory"]);return t.factory.sketch(e)}},schema:[Xr("factory")],name:"field"})]),Xw=Ad({name:"FormField",configFields:Gw(),partFields:Kw(),factory:function(t,e,n,r){var o=Rf(t.fieldBehaviours,[zd.config({find:function(e){return pd(e,t,"field")}}),Of.config({store:{mode:"manual",getValue:function(t){return zd.getCurrent(t).bind(Of.getValue)},setValue:function(t,e){zd.getCurrent(t).each((function(t){Of.setValue(t,e)}))}}})]),i=zi([$i((function(e,n){var r=bd(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=oa(t.prefix);r.label().each((function(t){We(t.element,"for",n),We(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=oa(t.prefix);We(n.element,"id",r),We(e.element,"aria-describedby",r)}))}))}))]),a={getField:function(e){return pd(e,t,"field")},getLabel:function(e){return pd(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:a}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),Yw=Object.freeze({__proto__:null,exhibit:function(t,e){return Sa({attributes:Oo([{key:e.tabAttr,value:"true"}])})}}),Jw=[fo("tabAttr","data-alloy-tabstop")],Qw=Sc({fields:Jw,name:"tabstopping",active:Yw}),Zw=tinymce.util.Tools.resolve("tinymce.html.Entities"),tx=function(t,e,n,r){var o=ex(t,e,n,r);return Xw.sketch(o)},ex=function(t,e,n,r){return{dom:nx(n),components:t.toArray().concat([e]),fieldBehaviours:xc(r)}},nx=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},rx=function(t,e){return Xw.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},ox=oa("form-component-change"),ix=oa("form-close"),ax=oa("form-cancel"),ux=oa("form-action"),cx=oa("form-submit"),sx=oa("form-block"),lx=oa("form-unblock"),fx=oa("form-tabchange"),dx=oa("form-resize"),mx=function(t,e){var n,r,o,i=t.label.map((function(t){return rx(t,e)})),a=function(t){return function(e,n){fu(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,qe(r,"data-collection-item-value"))}))}},u=a((function(n,r,o,i){r.stop(),e.isDisabled()||Ni(n,ux,{name:t.name,value:i})})),c=[Ii(Wo(),a((function(t,e,n){Nc(n)}))),Ii(Jo(),u),Ii(li(),u),Ii(qo(),a((function(t,e,n){lu(t.element,"."+kv).each((function(t){Ha(t,kv)})),La(n,kv)}))),Ii($o(),a((function(t){lu(t.element,"."+kv).each((function(t){Ha(t,kv)}))}))),Xi(a((function(e,n,r,o){Ni(e,ux,{name:t.name,value:o})})))],s=function(t,e){return U(ol(t.element,".tox-collection__item"),e)},l=Xw.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:b},behaviours:xc([Xd.config({disabled:e.isDisabled,onDisabled:function(t){s(t,(function(t){La(t,"tox-collection__item--state-disabled"),We(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){Ha(t,"tox-collection__item--state-disabled"),Ke(t,"aria-disabled")}))}}),qb(),ah.config({}),Of.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=U(r,(function(n){var r=bp.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",a={_:" "," - ":" ","-":" "},u=r.replace(/\_| \- |\-/g,(function(t){return a[t]}));return'<div class="tox-collection__item'+(e.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+Zw.encodeAllRaw(n.value)+'" title="'+u+'" aria-label="'+u+'">'+i+o+"</div>"})),i="auto"!==t.columns&&t.columns>1?j(o,t.columns):[o],a=U(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));Ji(n.element,a.join(""))}(n,r),"auto"===t.columns&&rb(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;eh.setGridSize(n,e,r)})),Ri(n,dx)}}),Qw.config({}),eh.config((r=t.columns,o="normal",1===r?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===r?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===o?".tox-swatches__row":".tox-collection__group",cell:"color"===o?".tox-swatch":"."+vv}})),uh("collection-events",c)]),eventOrder:(n={},n[ci()]=["disabling","alloy.base.behaviour","collection-events"],n)});return tx(i,l,["tox-form__group--collection"],[])},gx=v([oo("data"),fo("inputAttributes",{}),fo("inputStyles",{}),fo("tag","input"),fo("inputClasses",[]),_u("onSetValue"),fo("styles",{}),fo("eventOrder",{}),Ef("inputBehaviours",[Of,dh]),fo("selectOnFocus",!0)]),hx=function(t){return xc([dh.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=Ua(e);e.dom.setSelectionRange(0,n.length)}:h})])},px=function(t){return O(O({},hx(t)),Rf(t.inputBehaviours,[Of.config({store:O(O({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return Ua(t.element)},setValue:function(t,e){Ua(t.element)!==e&&Wa(t.element,e)}}),onSetValue:t.onSetValue})]))},vx=function(t){return{tag:t.tag,attributes:O({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},bx=Nd({name:"Input",configFields:gx(),factory:function(t,e){return{uid:t.uid,dom:vx(t),components:[],behaviours:px(t),eventOrder:t.eventOrder}}}),yx={},wx={exports:yx};!function(t,e,r,o){!function(n,o){"object"==typeof e&&void 0!==r?r.exports=o():"function"==typeof t&&t.amd?t(o):(n="undefined"!=typeof globalThis?globalThis:n||self).EphoxContactWrapper=o()}(this,(function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},e={exports:{}};!function(e){!function(t){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void u(e.promise,t)}a(e.promise,r)}else(1===t._state?a:u)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){u(t,e)}var r,i}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(t){o(i,t)}),n)}e[i]=a,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(t)}(e);var r=e.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||r}}))}(void 0,yx,wx);var xx,Cx=wx.exports.boltExport,Sx=function(t){var e=B.none(),n=[],r=function(t){o()?a(t):n.push(t)},o=function(){return e.isSome()},i=function(t){W(t,a)},a=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=B.some(t),i(n),n=[])})),{get:r,map:function(t){return Sx((function(e){r((function(n){e(t(n))}))}))},isReady:o}},kx={nu:Sx,pure:function(t){return Sx((function(e){e(t)}))}},Tx=function(t){setTimeout((function(){throw t}),0)},Ox=function(t){var e=function(e){t().then(e,Tx)};return{map:function(e){return Ox((function(){return t().then(e)}))},bind:function(e){return Ox((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return Ox((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return kx.nu(e)},toCached:function(){var e=null;return Ox((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Ex=function(t){return Ox((function(){return new Cx(t)}))},_x=function(t){return Ox((function(){return Cx.resolve(t)}))},Rx=["input","textarea"],Nx=function(t){var e=Pt(t);return H(Rx,e)},Ax=function(t,e){var n=e.getRoot(t).getOr(t.element);Ha(n,e.invalidClass),e.notify.each((function(e){Nx(t.element)&&We(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){Ji(t,e.validHtml)})),e.onValid(t)}))},Dx=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);La(o,e.invalidClass),e.notify.each((function(e){Nx(t.element)&&We(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){Ji(t,r)})),e.onInvalid(t,r)}))},Mx=function(t,e,n){return e.validator.fold((function(){return _x(Wn.value(!0))}),(function(e){return e.validate(t)}))},Bx=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),Mx(t,e).map((function(n){return t.getSystem().isConnected()?n.fold((function(n){return Dx(t,e,0,n),Wn.error(n)}),(function(n){return Ax(t,e),Wn.value(n)})):Wn.error("No longer in system")}))},zx=Object.freeze({__proto__:null,markValid:Ax,markInvalid:Dx,query:Mx,run:Bx,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element);return Fa(n,e.invalidClass)}}),Px=Object.freeze({__proto__:null,events:function(t,e){return t.validator.map((function(e){return zi([Ii(e.onEvent,(function(e){Bx(e,t).get(b)}))].concat(e.validateOnLoad?[$i((function(e){Bx(e,t).get(h)}))]:[]))})).getOr({})}}),Lx=[Xr("invalidClass"),fo("getRoot",B.none),lo("notify",[fo("aria","alert"),fo("getContainer",B.none),fo("validHtml",""),_u("onValid"),_u("onInvalid"),_u("onValidate")]),lo("validator",[Xr("validate"),fo("onEvent","input"),fo("validateOnLoad",!0)])],Ix=Sc({fields:Lx,name:"invalidating",active:Px,apis:zx,extra:{validation:function(t){return function(e){var n=Of.getValue(e);return _x(t(n))}}}}),Hx=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),Fx=[Yr("others",Fr(Wn.value,Rr()))],Vx=Sc({fields:Fx,name:"coupling",apis:Hx,state:Object.freeze({__proto__:null,init:function(){var t={},e=v({});return xa({readState:e,getOrCreate:function(e,n,r){var o=lt(n.others);if(o)return yt(t,r).getOrThunk((function(){var o=yt(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})}),jx=v("sink"),Ux=v(od({name:jx(),overrides:v({dom:{tag:"div"},behaviours:xc([Ll.config({useFixed:k})]),events:zi([Ui(Go()),Ui(Fo()),Ui(Jo())])})}));!function(t){t[t.HighlightFirst=0]="HighlightFirst",t[t.HighlightNone=1]="HighlightNone"}(xx||(xx={}));var Wx,qx,$x,Gx=function(t,e){var n=t.getHotspot(e).getOr(e),r="hotspot",o=t.getAnchorOverrides();return t.layouts.fold((function(){return{type:r,hotspot:n,overrides:o}}),(function(t){return{type:r,hotspot:n,overrides:o,layouts:t}}))},Kx=function(t,e,n,r,o,i,a){return function(t,e,n,r,o,i,a){var u=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),c=Qx(r,t);return u.map((function(t){return t.bind((function(t){return B.from(Kh.sketch(O(O({},i.menu()),{uid:fa(""),data:t,highlightImmediately:a===xx.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Ll.position(r,e,{anchor:n}),af.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Ll.position(r,n,{anchor:{type:"submenu",item:e}}),af.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Ll.position(o,e,{anchor:n}),W(r,(function(t){Ll.position(o,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})}))},onEscape:function(){return dh.focus(r),af.close(o),B.some(!0)}})))}))}))}(t,e,Gx(t,n),n,r,o,a).map((function(t){return t.fold((function(){af.isOpen(r)&&af.close(r)}),(function(t){af.cloak(r),af.open(r,t),i(r)})),r}))},Xx=function(t,e,n,r,o,i,a){return af.close(r),_x(r)},Yx=function(t,e,n,r,o,i){var a=Vx.getCoupled(n,"sandbox");return(af.isOpen(a)?Xx:Kx)(t,e,n,a,r,o,i)},Jx=function(t,e,n){var r=zd.getCurrent(e).getOr(e),o=bn(t.element);n?Je(r.element,"min-width",o+"px"):function(t,e){vn.set(t,e)}(r.element,o)},Qx=function(t,e){return t.getSystem().getByUid(e.uid+"-"+jx()).map((function(t){return function(){return Wn.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return Wn.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},Zx=function(t){af.getState(t).each((function(t){Kh.repositionMenus(t)}))},tC=function(t,e,n){var r=du(),o=Qx(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:Af(t.sandboxBehaviours,[Of.config({store:{mode:"memory",initialValue:e}}),af.config({onOpen:function(o,i){var a=Gx(t,e);r.link(e.element),t.matchWidth&&Jx(a.hotspot,i,t.useMinWidth),t.onOpen(a,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return gu(n,r)||gu(e,r)},getAttachPoint:function(){return o().getOrDie()}}),zd.config({find:function(t){return af.getState(t).bind((function(t){return zd.getCurrent(t)}))}}),Ec.config({channels:O(O({},ff({isExtraPart:S})),mf({doReposition:Zx}))})])}},eC=function(t){var e=Vx.getCoupled(t,"sandbox");Zx(e)},nC=function(){return[fo("sandboxClasses",[]),Nf("sandboxBehaviours",[zd,Ec,af,Of])]},rC=v([Xr("dom"),Xr("fetch"),_u("onOpen"),Ru("onExecute"),fo("getHotspot",B.some),fo("getAnchorOverrides",v({})),Ts(),Ef("dropdownBehaviours",[kh,Vx,eh,dh]),Xr("toggleClass"),fo("eventOrder",{}),oo("lazySink"),fo("matchWidth",!1),fo("useMinWidth",!1),oo("role")].concat(nC())),oC=v([rd({schema:[Tu()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Ux()]),iC=Ad({name:"Dropdown",configFields:rC(),partFields:oC(),factory:function(t,e,n,r){var o,i,a=function(t){af.getState(t).each((function(t){Kh.highlightPrimary(t)}))},u={expand:function(e){kh.isOn(e)||Yx(t,b,e,r,h,xx.HighlightNone).get(h)},open:function(e){kh.isOn(e)||Yx(t,b,e,r,h,xx.HighlightFirst).get(h)},isOpen:kh.isOn,close:function(e){kh.isOn(e)&&Yx(t,b,e,r,h,xx.HighlightFirst).get(h)},repositionMenus:function(t){kh.isOn(t)&&eC(t)}},c=function(t,e){return Ai(t),B.some(!0)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.dropdownBehaviours,[kh.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),Vx.config({others:{sandbox:function(e){return tC(t,e,{onOpen:function(){return kh.on(e)},onClose:function(){return kh.off(e)}})}}}),eh.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,e){if(iC.isOpen(t)){var n=Vx.getCoupled(t,"sandbox");a(n)}else iC.open(t);return B.some(!0)},onEscape:function(t,e){return iC.isOpen(t)?(iC.close(t),B.some(!0)):B.none()}}),dh.config({})]),events:Oh(B.some((function(e){Yx(t,b,e,r,a,xx.HighlightFirst).get(h)}))),eventOrder:O(O({},t.eventOrder),(o={},o[ci()]=["disabling","toggling","alloy.base.behaviour"],o)),apis:u,domModification:{attributes:O(O({"aria-haspopup":"true"},t.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===t.dom.tag?{type:(i="type",yt(t.dom,"attributes").bind((function(t){return yt(t,i)}))).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),aC=Object.freeze({__proto__:null,events:function(){return zi([Pi(ei(),k)])},exhibit:function(){return Sa({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),uC=Sc({fields:[],name:"unselecting",active:aC}),cC=oa("color-input-change"),sC=oa("color-swatch-change"),lC=oa("color-picker-cancel"),fC=function(t,e,n){var r=Xw.parts.field({factory:bx,inputClasses:["tox-textfield"],onSetValue:function(t){return Ix.run(t).get(h)},inputBehaviours:xc([Xd.config({disabled:e.providers.isDisabled}),qb(),Qw.config({}),Ix.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return Oe(t.element)},notify:{onValid:function(t){var e=Of.getValue(t);Ni(t,cC,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=Of.getValue(t);if(0===e.length)return _x(Wn.value(!0));var n=Bt.fromTag("span");Je(n,"background-color",e);var r=nn(n,"background-color").fold((function(){return Wn.error("blah")}),(function(t){return Wn.value(e)}));return _x(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return rx(t,e.providers)})),i=function(t,e){Ni(t,sC,{value:e})},a=vp(function(t,e){return iC.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:xc([Gb(e.providers.isDisabled),qb(),uC.config({}),Qw.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return Ex((function(e){return t.fetch(e)})).map((function(r){return B.from(Rw(ur(sw(oa("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,hv.CLOSE_ON_EXECUTE,S,e.providers),{movement:fw(t.columns,t.presets)})))}))},parts:{menu:Mv(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[nc,ec,ac]},onLtr:function(){return[ec,nc,ac]}},components:[],fetch:ow(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){a.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return Ri(t,lC)}),(function(e){i(t,e),Zy(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))}},e));return Xw.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,a.asSpec()]}]),fieldBehaviours:xc([uh("form-field-events",[Ii(cC,(function(e,n){a.getOpt(e).each((function(t){Je(t.element,"background-color",n.event.color)})),Ni(e,ox,{name:t.name})})),Ii(sC,(function(t,e){Xw.getField(t).each((function(n){Of.setValue(n,e.event.value),zd.getCurrent(t).each(dh.focus)}))})),Ii(lC,(function(t,e){Xw.getField(t).each((function(e){zd.getCurrent(t).each(dh.focus)}))}))])])})},dC=od({schema:[Xr("dom")],name:"label"}),mC=function(t){return od({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:zi([Hi(Po(),(function(e,n,r){return t(e,r)}),[e]),Hi(Fo(),(function(e,n,r){return t(e,r)}),[e]),Hi(Vo(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},gC=mC("top-left"),hC=mC("top"),pC=mC("top-right"),vC=mC("right"),bC=mC("bottom-right"),yC=mC("bottom"),wC=mC("bottom-left"),xC=mC("left"),CC=nd({name:"thumb",defaults:v({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:zi([Vi(Po(),t,"spectrum"),Vi(Lo(),t,"spectrum"),Vi(Io(),t,"spectrum"),Vi(Fo(),t,"spectrum"),Vi(Vo(),t,"spectrum"),Vi(Uo(),t,"spectrum")])}}}),SC=nd({schema:[Gr("mouseIsDown",(function(){return xo(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:xc([eh.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),dh.config({})]),events:zi([Ii(Po(),n),Ii(Lo(),n),Ii(Fo(),n),Ii(Vo(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}}),kC=[dC,xC,vC,hC,yC,gC,pC,wC,bC,CC,SC],TC=v("slider.change.value"),OC=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?B.some(n.touches[0]).map((function(t){return mn(t.clientX,t.clientY)})):B.none()}var r=e;return void 0!==r.clientX?B.some(r).map((function(t){return mn(t.clientX,t.clientY)})):B.none()},EC=function(t){return t.model.minX},_C=function(t){return t.model.minY},RC=function(t){return t.model.minX-1},NC=function(t){return t.model.minY-1},AC=function(t){return t.model.maxX},DC=function(t){return t.model.maxY},MC=function(t){return t.model.maxX+1},BC=function(t){return t.model.maxY+1},zC=function(t,e,n){return e(t)-n(t)},PC=function(t){return zC(t,AC,EC)},LC=function(t){return zC(t,DC,_C)},IC=function(t){return PC(t)/2},HC=function(t){return LC(t)/2},FC=function(t){return t.stepSize},VC=function(t){return t.snapToGrid},jC=function(t){return t.snapStart},UC=function(t){return t.rounded},WC=function(t,e){return void 0!==t[e+"-edge"]},qC=function(t){return WC(t,"left")},$C=function(t){return WC(t,"right")},GC=function(t){return WC(t,"top")},KC=function(t){return WC(t,"bottom")},XC=function(t){return t.model.value.get()},YC=function(t){return{x:t}},JC=function(t){return{y:t}},QC=function(t,e){return{x:t,y:e}},ZC=function(t,e){Ni(t,TC(),{value:e})},tS=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},eS=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},nS=function(t,e,n){return Math.max(e,Math.min(n,t))},rS=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,a=t.snap,u=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,h=l?n+1:n;if(o<f)return g;if(o>d)return h;var p=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=nS(p/m*r+e,g,h);return a&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return nS(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),a=Math.floor((t-e)/r),u=Math.floor((n-e)/r),c=e+Math.min(u,a+i)*r;return Math.max(e,c)}))}(v,e,n,i,u):c?Math.round(v):v},oS=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,a=t.hasMaxEdge,u=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:s:o>n?a?u:l:(o-e)/r*c},iS="top",aS="right",uS="bottom",cS="left",sS=function(t){return t.element.dom.getBoundingClientRect()},lS=function(t,e){return t[e]},fS=function(t){var e=sS(t);return lS(e,cS)},dS=function(t){var e=sS(t);return lS(e,aS)},mS=function(t){var e=sS(t);return lS(e,iS)},gS=function(t){var e=sS(t);return lS(e,uS)},hS=function(t){var e=sS(t);return lS(e,"width")},pS=function(t){var e=sS(t);return lS(e,"height")},vS=function(t,e,n){return(t+e)/2-n},bS=function(t,e){var n=sS(t),r=sS(e),o=lS(n,cS),i=lS(n,aS),a=lS(r,cS);return vS(o,i,a)},yS=function(t,e){var n=sS(t),r=sS(e),o=lS(n,iS),i=lS(n,uS),a=lS(r,iS);return vS(o,i,a)},wS=function(t,e){Ni(t,TC(),{value:e})},xS=function(t){return{x:t}},CS=function(t,e,n){var r={min:EC(e),max:AC(e),range:PC(e),value:n,step:FC(e),snap:VC(e),snapStart:jC(e),rounded:UC(e),hasMinEdge:qC(e),hasMaxEdge:$C(e),minBound:fS(t),maxBound:dS(t),screenRange:hS(t)};return rS(r)},SS=function(t){return function(e,n){return function(t,e,n){var r=(t>0?eS:tS)(XC(n).x,EC(n),AC(n),FC(n));return wS(e,xS(r)),B.some(r)}(t,e,n).map(k)}},kS=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=hS(t),a=r.bind((function(e){return B.some(bS(e,t))})).getOr(0),u=o.bind((function(e){return B.some(bS(e,t))})).getOr(i),c={min:EC(e),max:AC(e),range:PC(e),value:n,hasMinEdge:qC(e),hasMaxEdge:$C(e),minBound:fS(t),minOffset:0,maxBound:dS(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return oS(c)}(e,i,n,r,o);return fS(e)-fS(t)+a},TS=SS(-1),OS=SS(1),ES=B.none,_S=B.none,RS={"top-left":B.none(),top:B.none(),"top-right":B.none(),right:B.some((function(t,e){ZC(t,YC(MC(e)))})),"bottom-right":B.none(),bottom:B.none(),"bottom-left":B.none(),left:B.some((function(t,e){ZC(t,YC(RC(e)))}))},NS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=CS(t,e,n),o=xS(r);return wS(t,o),r},setToMin:function(t,e){var n=EC(e);wS(t,xS(n))},setToMax:function(t,e){var n=AC(e);wS(t,xS(n))},findValueOfOffset:CS,getValueFromEvent:function(t){return OC(t).map((function(t){return t.left}))},findPositionOfValue:kS,setPositionFromValue:function(t,e,n,r){var o=XC(n),i=kS(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),a=bn(e.element)/2;Je(e.element,"left",i-a+"px")},onLeft:TS,onRight:OS,onUp:ES,onDown:_S,edgeActions:RS}),AS=function(t,e){Ni(t,TC(),{value:e})},DS=function(t){return{y:t}},MS=function(t,e,n){var r={min:_C(e),max:DC(e),range:LC(e),value:n,step:FC(e),snap:VC(e),snapStart:jC(e),rounded:UC(e),hasMinEdge:GC(e),hasMaxEdge:KC(e),minBound:mS(t),maxBound:gS(t),screenRange:pS(t)};return rS(r)},BS=function(t){return function(e,n){return function(t,e,n){var r=(t>0?eS:tS)(XC(n).y,_C(n),DC(n),FC(n));return AS(e,DS(r)),B.some(r)}(t,e,n).map(k)}},zS=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=pS(t),a=r.bind((function(e){return B.some(yS(e,t))})).getOr(0),u=o.bind((function(e){return B.some(yS(e,t))})).getOr(i),c={min:_C(e),max:DC(e),range:LC(e),value:n,hasMinEdge:GC(e),hasMaxEdge:KC(e),minBound:mS(t),minOffset:0,maxBound:gS(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return oS(c)}(e,i,n,r,o);return mS(e)-mS(t)+a},PS=B.none,LS=B.none,IS=BS(-1),HS=BS(1),FS={"top-left":B.none(),top:B.some((function(t,e){ZC(t,JC(NC(e)))})),"top-right":B.none(),right:B.none(),"bottom-right":B.none(),bottom:B.some((function(t,e){ZC(t,JC(BC(e)))})),"bottom-left":B.none(),left:B.none()},VS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=MS(t,e,n),o=DS(r);return AS(t,o),r},setToMin:function(t,e){var n=_C(e);AS(t,DS(n))},setToMax:function(t,e){var n=DC(e);AS(t,DS(n))},findValueOfOffset:MS,getValueFromEvent:function(t){return OC(t).map((function(t){return t.top}))},findPositionOfValue:zS,setPositionFromValue:function(t,e,n,r){var o=XC(n),i=zS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=ln(e.element)/2;Je(e.element,"top",i-a+"px")},onLeft:PS,onRight:LS,onUp:IS,onDown:HS,edgeActions:FS}),jS=function(t,e){Ni(t,TC(),{value:e})},US=function(t,e){return{x:t,y:e}},WS=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?eS:tS,i=e?XC(r).x:o(XC(r).x,EC(r),AC(r),FC(r)),a=e?o(XC(r).y,_C(r),DC(r),FC(r)):XC(r).y;return jS(n,US(i,a)),B.some(i)}(t,e,n,r).map(k)}},qS=WS(-1,!1),$S=WS(1,!1),GS=WS(-1,!0),KS=WS(1,!0),XS={"top-left":B.some((function(t,e){ZC(t,QC(RC(e),NC(e)))})),top:B.some((function(t,e){ZC(t,QC(IC(e),NC(e)))})),"top-right":B.some((function(t,e){ZC(t,QC(MC(e),NC(e)))})),right:B.some((function(t,e){ZC(t,QC(MC(e),HC(e)))})),"bottom-right":B.some((function(t,e){ZC(t,QC(MC(e),BC(e)))})),bottom:B.some((function(t,e){ZC(t,QC(IC(e),BC(e)))})),"bottom-left":B.some((function(t,e){ZC(t,QC(RC(e),BC(e)))})),left:B.some((function(t,e){ZC(t,QC(RC(e),HC(e)))}))},YS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=CS(t,e,n.left),o=MS(t,e,n.top),i=US(r,o);return jS(t,i),i},setToMin:function(t,e){var n=EC(e),r=_C(e);jS(t,US(n,r))},setToMax:function(t,e){var n=AC(e),r=DC(e);jS(t,US(n,r))},getValueFromEvent:function(t){return OC(t)},setPositionFromValue:function(t,e,n,r){var o=XC(n),i=kS(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),a=zS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=bn(e.element)/2,c=ln(e.element)/2;Je(e.element,"left",i-u+"px"),Je(e.element,"top",a-c+"px")},onLeft:qS,onRight:$S,onUp:GS,onDown:KS,edgeActions:XS}),JS=Ad({name:"Slider",configFields:[fo("stepSize",1),fo("onChange",h),fo("onChoose",h),fo("onInit",h),fo("onDragStart",h),fo("onDragEnd",h),fo("snapToGrid",!1),fo("rounded",!0),oo("snapStart"),Yr("model",qr("mode",{x:[fo("minX",0),fo("maxX",100),Gr("value",(function(t){return xo(t.mode.minX)})),Xr("getInitialValue"),Du("manager",NS)],y:[fo("minY",0),fo("maxY",100),Gr("value",(function(t){return xo(t.mode.minY)})),Xr("getInitialValue"),Du("manager",VS)],xy:[fo("minX",0),fo("maxX",100),fo("minY",0),fo("maxY",100),Gr("value",(function(t){return xo({x:t.mode.minX,y:t.mode.minY})})),Xr("getInitialValue"),Du("manager",YS)]})),Ef("sliderBehaviours",[eh,Of]),Gr("mouseIsDown",(function(){return xo(!1)}))],partFields:kC,factory:function(t,e,n,r){var o,i=function(e){return vd(e,t,"thumb")},a=function(e){return vd(e,t,"spectrum")},u=function(e){return pd(e,t,"left-edge")},c=function(e){return pd(e,t,"right-edge")},s=function(e){return pd(e,t,"top-edge")},l=function(e){return pd(e,t,"bottom-edge")},f=t.model,d=f.manager,m=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:u,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:a})},g=function(t,e){f.value.set(e);var n=i(t);m(t,n)},h=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&pd(e,t,"thumb").each((function(n){var r=f.value.get();t.onChoose(e,n,r)}))},p=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},v=function(e,n){n.stop(),t.onDragEnd(e,i(e)),h(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.sliderBehaviours,[eh.config({mode:"special",focusIn:function(e){return pd(e,t,"spectrum").map(eh.focusIn).map(k)}}),Of.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),Ec.config({channels:(o={},o[sf()]={onReceive:h},o)})]),events:zi([Ii(TC(),(function(e,n){!function(e,n){g(e,n);var r=i(e);t.onChange(e,r,n),B.some(!0)}(e,n.event.value)})),$i((function(e,n){var r=f.getInitialValue();f.value.set(r);var o=i(e);m(e,o);var u=a(e);t.onInit(e,o,u,f.value.get())})),Ii(Po(),p),Ii(Io(),v),Ii(Fo(),p),Ii(Uo(),v)]),apis:{resetToMin:function(e){d.setToMin(e,t)},resetToMax:function(e){d.setToMax(e,t)},setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(t,e,n){t.setValue(e,n)},resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),QS=oa("rgb-hex-update"),ZS=oa("slider-update"),tk=oa("palette-update"),ek="form",nk=[Ef("formBehaviours",[Of])],rk=function(t){return"<alloy.field."+t+">"},ok=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.formBehaviours,[Of.config({store:{mode:"manual",getValue:function(e){var n=yd(e,t);return mt(n,(function(t,e){return t().bind((function(t){var n,r,o=zd.getCurrent(t);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+ta(t.element)),n.fold((function(){return Wn.error(r)}),Wn.value)})).map(Of.getValue)}))},setValue:function(e,n){dt(n,(function(n,r){pd(e,t,r).each((function(t){zd.getCurrent(t).each((function(t){Of.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return pd(e,t,n).bind(zd.getCurrent)}}}},ik={getField:ya((function(t,e,n){return t.getField(e,n)})),sketch:function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),fd(ek,rk(e),n)},record:v(t)}}(),n=t(e),r=e.record(),o=U(r,(function(t){return nd({name:t,pname:rk(t)})}));return Od(ek,nk,o,ok,n)}},ak=oa("valid-input"),uk=oa("invalid-input"),ck=oa("validating-input"),sk="colorcustom.rgb.",lk=function(t,e,n,r){var o=function(n,r){return Ix.config({invalidClass:e("invalid"),notify:{onValidate:function(t){Ni(t,ck,{type:n})},onValid:function(t){Ni(t,ak,{type:n,value:Of.getValue(t)})},onInvalid:function(t){Ni(t,uk,{type:n,value:Of.getValue(t)})}},validator:{validate:function(e){var n=Of.getValue(e),o=r(n)?Wn.value(!0):Wn.error(t("aria.input.invalid"));return _x(o)},validateOnLoad:!1}})},i=function(n,r,i,a,u){var c=t("colorcustom.rgb.range"),s=[Xw.parts.label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":a}}}),Xw.parts.field({data:u,factory:bx,inputAttributes:O({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:xc([o(r,n),Qw.config({})]),onSetValue:function(t){Ix.isInvalid(t)&&Ix.run(t).get(h)}})],l="hex"!==r?[Xw.parts["aria-descriptor"]({text:c})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:s.concat(l)}},a=function(t,e){var n=e.red,r=e.green,o=e.blue;Of.setValue(t,{red:n,green:r,blue:o})},u=vp({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),c=function(t,e){u.getOpt(t).each((function(t){Je(t.element,"background-color","#"+e.value)}))};return Nd({factory:function(){var o={red:xo(B.some(255)),green:xo(B.some(255)),blue:xo(B.some(255)),hex:xo(B.some("ffffff"))},s=function(t){return o[t].get()},l=function(t,e){o[t].set(e)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",B.some(e)),l("green",B.some(n)),l("blue",B.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?l(n.type,B.none()):r(t)},m=function(t,e,n){var r=parseInt(n,10);l(e,B.some(r)),s("red").bind((function(t){return s("green").bind((function(e){return s("blue").map((function(n){return Dy(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=Oy(e);return ik.getField(t,"hex").each((function(e){dh.isFocused(e)||Of.setValue(t,{hex:n.value})})),n}(t,e);Ni(t,QS,{hex:n}),c(t,n)}))},g=function(t,e){var r=e.event;!function(t){return"hex"===t.type}(r)?m(t,r.type,r.value):function(t,e){n(t);var r=yy(e);l("hex",B.some(e));var o=zy(r);a(t,o),f(o),Ni(t,QS,{hex:r}),c(t,r)}(t,r.value)},h=function(e){return{label:t(sk+e+".label"),description:t(sk+e+".description")}},p=h("red"),v=h("green"),b=h("blue"),y=h("hex");return ur(ik.sketch((function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",Xw.sketch(i(My,"red",p.label,p.description,255))),n.field("green",Xw.sketch(i(My,"green",v.label,v.description,255))),n.field("blue",Xw.sketch(i(My,"blue",b.label,b.description,255))),n.field("hex",Xw.sketch(i(Cy,"hex",y.label,y.description,"ffffff"))),u.asSpec()],formBehaviours:xc([Ix.config({invalidClass:e("form-invalid")}),uh("rgb-form-events",[Ii(ak,g),Ii(uk,d),Ii(ck,d)])])}})),{apis:{updateHex:function(t,e){Of.setValue(t,{hex:e.value}),function(t,e){var n=zy(e);a(t,n),f(n)}(t,e),c(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},fk=function(t,e){var n=JS.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=JS.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),o=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var a=o.createLinearGradient(0,0,0,r);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=a,o.fillRect(0,0,n,r)}};return Nd({factory:function(t){var i=v({x:0,y:0}),a=xc([zd.config({find:B.some}),dh.config({})]);return JS.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:function(t,e,n){Ni(t,tk,{value:n})},onInit:function(t,e,n,r){o(n.element.dom,Iy(Hy))},sliderBehaviours:a})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom,r=Vy(e,100,100),i=By(r);o(n,Iy(i))}(e,n)},setThumb:function(t,e,n){!function(t,e){var n=jy(zy(e));JS.setValue(t,{x:n.saturation,y:100-n.value})}(e,n)}},extraApis:{}})},dk=function(t,e){return Nd({name:"ColourPicker",configFields:[Xr("dom"),fo("onValidHex",h),fo("onInvalidHex",h)],factory:function(n){var r,o=lk(t,e,n.onValidHex,n.onInvalidHex),i=fk(0,e),a=function(t){return 100-t/360*100},u={paletteRgba:xo(Hy),paletteHue:xo(0)},c=vp(function(t,e){var n=JS.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=JS.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return JS.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:v({y:0})},components:[n,r],sliderBehaviours:xc([dh.config({})]),onChange:function(t,e,n){Ni(t,ZS,{value:n})}})}(0,e)),s=vp(i.sketch({})),l=vp(o.sketch({})),f=function(t,e,n){s.getOpt(t).each((function(t){i.setHue(t,n)}))},d=function(t,e){l.getOpt(t).each((function(t){o.updateHex(t,e)}))},m=function(t,e,n){c.getOpt(t).each((function(t){JS.setValue(t,{y:a(n)})}))},g=function(t,e){s.getOpt(t).each((function(t){i.setThumb(t,e)}))},h=function(t,e,n,r){!function(t,e){var n=zy(t);u.paletteRgba.set(n),u.paletteHue.set(e)}(e,n),W(r,(function(r){r(t,e,n)}))};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),c.asSpec(),l.asSpec()],behaviours:xc([uh("colour-picker-events",[Ii(QS,(r=[f,m,g],function(t,e){var n=e.event.hex,o=function(t){return jy(zy(t))}(n);h(t,n,o.hue,r)})),Ii(tk,function(){var t=[d];return function(e,n){var r=n.event.value,o=u.paletteHue.get(),i=Vy(o,r.x,100-r.y),a=Uy(i);h(e,a,o,t)}}()),Ii(ZS,function(){var t=[f,d];return function(e,n){var r=function(t){return(100-t)/100*360}(n.event.value.y),o=u.paletteRgba.get(),i=jy(o),a=Vy(r,i.saturation,i.value),c=Uy(a);h(e,c,r,t)}}())]),zd.config({find:function(t){return l.getOpt(t)}}),eh.config({mode:"acyclic"})])}}})},mk=function(){return zd.config({find:B.some})},gk=function(t){return zd.config({find:t.getOpt})},hk=function(t){return zd.config({find:function(e){return Re(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},pk={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},vk=function(t){return function(t){return pk[t]}(t)},bk=tinymce.util.Tools.resolve("tinymce.Resource"),yk=tinymce.util.Tools.resolve("tinymce.util.Tools"),wk=kr([fo("preprocess",b),fo("postprocess",b)]),xk=function(t,e,n){return Of.config(ur({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},Ck=function(t,e,n){return xk(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},Sk=function(t,e){var n=Ur("RepresentingConfigs.memento processors",wk,e);return Of.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=Of.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);Of.setValue(i,o)}}})},kk=xk,Tk=function(t){return Ck(t,Yi,Ji)},Ok=function(t){return Of.config({store:{mode:"memory",initialValue:t}})},Ek=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){W(t,(function(t){t(e,n)}))}},o=function(t,e){if(!Xd.isDisabled(t)){var n=e.event.raw;a(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;a(t,n.files)},a=function(n,r){Of.setValue(n,function(t,e){var n=yk.explode(e.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return $(ct(t),(function(t){return F(n,(function(e){return Rt(t.name.toLowerCase(),"."+e.toLowerCase())}))}))}(r,e)),Ni(n,ox,{name:t.name})},u=vp({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:xc([uh("input-file-events",[Ui(Jo()),Ui(li())])])}),c=t.label.map((function(t){return rx(t,e)})),s=Xw.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:xc([Ok([]),mk(),Xd.config({}),kh.config({toggleClass:"dragenter",toggleOnExecute:!1}),uh("dropzone-events",[Ii("dragenter",r([n,kh.toggle])),Ii("dragleave",r([n,kh.toggle])),Ii("dragover",n),Ii("drop",r([n,o])),Ii(Yo(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},pp.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[u.asSpec()],action:function(t){u.get(t).element.dom.click()},buttonBehaviours:xc([Qw.config({}),Gb(e.isDisabled),qb()])})]}]}}}});return tx(c,s,["tox-form__group--stretched"],[])},_k=oa("alloy-fake-before-tabstop"),Rk=oa("alloy-fake-after-tabstop"),Nk=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:xc([dh.config({ignore:!0}),Qw.config({})])}},Ak=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[Nk([_k]),t,Nk([Rk])],behaviours:xc([hk(1)])}},Dk=function(t,e){Ni(t,Go(),{raw:{which:9,shiftKey:e}})},Mk=function(t,e){var n=e.element;Fa(n,_k)?Dk(t,!0):Fa(n,Rk)&&Dk(t,!1)},Bk=function(t){return Aw(t,["."+_k,"."+Rk].join(","),S)},zk=!(pe().browser.isIE()||pe().browser.isEdge()),Pk=function(t,e){var n=zk&&t.sandboxed,r=O(O({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=xo("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)We(n.element,"srcdoc",r);else{We(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map((function(t){return rx(t,e)})),a=Xw.parts.field({factory:{sketch:function(t){return Ak({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:xc([Qw.config({}),dh.config({}),kk(B.none(),o.getValue,o.setValue)])})}}});return tx(i,a,["tox-form__group--stretched"],[])},Lk=function(t,e){return Fk(document.createElement("canvas"),t,e)},Ik=function(t){var e=Lk(t.width,t.height);return Hk(e).drawImage(t,0,0),e},Hk=function(t){return t.getContext("2d")},Fk=function(t,e,n){return t.width=e,t.height=n,t},Vk=function(t){return t.naturalWidth||t.width},jk=function(t){return t.naturalHeight||t.height},Uk=function(t){return new Cx((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return B.none();for(var r=n[1],o=e[1],i=1024,a=atob(o),u=a.length,c=Math.ceil(u/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,d=Math.min(f+i,u),m=new Array(d-f),g=f,h=0;g<d;++h,++g)m[h]=a[g].charCodeAt(0);s[l]=new Uint8Array(m)}return B.some(new Blob(s,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))},Wk=function(t,e,n){return e=e||"image/png",d(HTMLCanvasElement.prototype.toBlob)?new Cx((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):Uk(t.toDataURL(e,n))},qk=function(t){return function(t){return new Cx((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",a),o.removeEventListener("error",u)},a=function(){i(),e(o)},u=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",a),o.addEventListener("error",u),o.src=r,o.complete&&setTimeout(a,0)}))}(t).then((function(t){$k(t);var e=Lk(Vk(t),jk(t));return Hk(e).drawImage(t,0,0),e}))},$k=function(t){URL.revokeObjectURL(t.src)},Gk=function(t,e,n){var r=e.type,o=v(r),i=v(n),a=function(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))};return{getType:o,toBlob:function(){return Cx.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return Wk(t,e,n)}))},toAdjustedDataURL:a,toAdjustedBase64:function(t,e){return a(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(Ik)}}},Kk=function(t){return function(t){return new Cx((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return Gk(qk(t),t,e)}))},Xk=function(t,e){return Wk(t,e).then((function(e){return Gk(Cx.resolve(t),e,t.toDataURL())}))},Yk=function(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r},Jk=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10],Qk=function(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var a=0;a<5;a++)r[a]=e[a+5*i];for(a=0;a<5;a++){n=0;for(var u=0;u<5;u++)n+=t[a+5*u]*r[u];o[a+5*i]=n}}return o},Zk=function(t,e){return t.toCanvas().then((function(n){return tT(n,t.getType(),e)}))},tT=function(t,e,n){var r=Hk(t),o=function(t,e){for(var n,r,o,i,a=t.data,u=e[0],c=e[1],s=e[2],l=e[3],f=e[4],d=e[5],m=e[6],g=e[7],h=e[8],p=e[9],v=e[10],b=e[11],y=e[12],w=e[13],x=e[14],C=e[15],S=e[16],k=e[17],T=e[18],O=e[19],E=0;E<a.length;E+=4)n=a[E],r=a[E+1],o=a[E+2],i=a[E+3],a[E]=n*u+r*c+o*s+i*l+f,a[E+1]=n*d+r*m+o*g+i*h+p,a[E+2]=n*v+r*b+o*y+i*w+x,a[E+3]=n*C+r*S+o*k+i*T+O;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),Xk(t,e)},eT=function(t,e,n){var r=Hk(t),o=r.getImageData(0,0,t.width,t.height),i=r.getImageData(0,0,t.width,t.height);return i=function(t,e,n){for(var r=function(t,e,n){return t>n?t=n:t<e&&(t=e),t},o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),a=t.data,u=e.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,h=0;h<o;h++)for(var p=0;p<o;p++){var v=r(f+p-i,0,c-1),b=4*(r(l+h-i,0,s-1)*c+v),y=n[h*o+p];d+=a[b]*y,m+=a[b+1]*y,g+=a[b+2]*y}var w=4*(l*c+f);u[w]=r(d,0,255),u[w+1]=r(m,0,255),u[w+2]=r(g,0,255)}return e}(o,i,n),r.putImageData(i,0,0),Xk(t,e)},nT=function(t){return function(e,n){return Zk(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}},rT=function(t){return function(e){return Zk(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),oT=nT((function(t,e){return e=Yk(255*e,-255,255),Qk(t,[1,0,0,0,e,0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])})),iT=nT((function(t,e){var n;return e=Yk(e,-1,1),n=(e*=100)<0?127+e/100*127:127*(n=0===(n=e%1)?Jk[e]:Jk[Math.floor(e)]*(1-n)+Jk[Math.floor(e)+1]*n)+127,Qk(t,[n/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),aT=function(t,e,n,r){return Zk(t,function(t,e,n,r){return e=Yk(e,0,2),n=Yk(n,0,2),r=Yk(r,0,2),Qk(t,[e,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0,0,0,0,0,1])}([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],e,n,r))},uT=(Wx=[0,-1,0,-1,5,-1,0,-1,0],function(t){return function(t,e){return t.toCanvas().then((function(n){return eT(n,t.getType(),e)}))}(t,Wx)}),cT=(qx=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){for(var r=Hk(t),o=new Array(256),i=0;i<o.length;i++)o[i]=qx(i,n);var a=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(a,0,0),Xk(t,e)}(n,t.getType(),e)}))}),sT=function(t,e,n){var r=Vk(t),o=jk(t),i=e/r,a=n/o,u=!1;(i<.5||i>2)&&(i=i<.5?.5:2,u=!0),(a<.5||a>2)&&(a=a<.5?.5:2,u=!0);var c=lT(t,i,a);return u?c.then((function(t){return sT(t,e,n)})):c},lT=function(t,e,n){return new Cx((function(r){var o=Vk(t),i=jk(t),a=Math.floor(o*e),u=Math.floor(i*n),c=Lk(a,u);Hk(c).drawImage(t,0,0,o,i,0,0,a,u),r(c)}))},fT=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},dT=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,a=Math.sin(r),u=Math.cos(r),c=fT(Math.abs(o*u)+Math.abs(i*a)),s=fT(Math.abs(o*a)+Math.abs(i*u)),l=Lk(c,s),f=Hk(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),Xk(l,e)},mT=function(t,e,n){var r=Lk(t.width,t.height),o=Hk(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),Xk(r,e)},gT=function(t,e,n,r,o,i){var a=Lk(o,i);return Hk(a).drawImage(t,-n,-r),Xk(a,e)},hT=function(t){return rT(t)},pT=function(t){return uT(t)},vT=function(t,e){return cT(t,e)},bT=function(t,e){return oT(t,e)},yT=function(t,e){return iT(t,e)},wT=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return mT(n,t.getType(),e)}))}(t,e)},xT=function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then((function(i){return gT(i,t.getType(),e,n,r,o)}))}(t,e,n,r,o)},CT=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return sT(r,e,n).then((function(e){return Xk(e,t.getType())}))}))}(t,e,n)},ST=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return dT(n,t.getType(),e)}))}(t,e)},kT=function(t,e,n){return Ep(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)},TT=function(t,e){return kT(t,e,[])},OT=function(t,e){return kT(t,e,[ah.config({})])},ET=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:xc([ah.config({})])}},_T=oa("toolbar.button.execute"),RT=(($x={})[ci()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],$x),NT=oa("update-menu-text"),AT=oa("update-menu-icon"),DT=function(t,e,n){var r=xo(h),o=t.text.map((function(t){return vp(ET(t,e,n.providers))})),i=t.icon.map((function(t){return vp(OT(t,n.providers.icons))})),a=function(t,e){var n=Of.getValue(t);return dh.focus(n),Ni(n,"keydown",{raw:e.event.raw}),iC.close(n),B.some(!0)},u=t.role.fold((function(){return{}}),(function(t){return{role:t}})),c=t.tooltip.fold((function(){return{}}),(function(t){var e=n.providers.translate(t);return{title:e,"aria-label":e}})),s=Ep("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},n.providers.icons);return vp(iC.sketch(O(O(O({},t.uid?{uid:t.uid}:{}),u),{dom:{tag:"button",classes:[e,e+"--select"].concat(U(t.classes,(function(t){return e+"--"+t}))),attributes:O({},c)},components:ey([i.map((function(t){return t.asSpec()})),o.map((function(t){return t.asSpec()})),B.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:xc(_(_([],t.dropdownBehaviours,!0),[Gb((function(){return t.disabled||n.providers.isDisabled()})),qb(),uC.config({}),ah.config({}),uh("dropdown-events",[Jb(t,r),Qb(t,r)]),uh("menubutton-update-display-text",[Ii(NT,(function(t,e){o.bind((function(e){return e.getOpt(t)})).each((function(t){ah.set(t,[Qa(n.providers.translate(e.event.text))])}))})),Ii(AT,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){ah.set(t,[OT(e.event.icon,n.providers.icons)])}))}))])],!1)),eventOrder:ur(RT,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:xc([eh.config({mode:"special",onLeft:a,onRight:a})]),lazySink:n.getSink,toggleClass:e+"--active",parts:{menu:Mv(0,t.columns,t.presets)},fetch:function(e){return Ex(w(t.fetch,e))}}))).asSpec()},MT=function(t){return"separator"===t.type},BT={type:"separator"},zT=function(t,e){var n=K(t,(function(t,n){return function(t){return o(t)}(n)?""===n?t:"|"===n?t.length>0&&!MT(t[t.length-1])?t.concat([BT]):t:wt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&MT(n[n.length-1])&&n.pop(),n},PT=function(t,e){return function(t){return wt(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=LT(n,e);return{item:t,menus:ur(r.menus,To(t.value,r.items)),expansions:ur(r.expansions,To(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}},LT=function(t,e){var n=zT(o(t)?t.split(" "):t,e);return G(n,(function(t,n){var r=function(t){if(MT(t))return t;var e=yt(t,"value").getOrThunk((function(){return oa("generated-menu-item")}));return ur({value:e},t)}(n),o=PT(r,e);return{menus:ur(t.menus,o.menus),items:[o.item].concat(t.items),expansions:ur(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},IT=function(t,e,n,r){var o=oa("primary-menu"),i=LT(t,n.shared.providers.menuItems());if(0===i.items.length)return B.none();var a=_w(o,i.items,e,n,r),u=mt(i.menus,(function(t,r){return _w(r,t,e,n,!1)})),c=ur(u,To(o,a));return B.from(Kh.tieredData(o,c,i.expansions))},HT=function(t){return{isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)},setActive:function(e){var n=t.element;e?(La(n,"tox-tbtn--enabled"),We(n,"aria-pressed",!0)):(Ha(n,"tox-tbtn--enabled"),Ke(n,"aria-pressed"))},isActive:function(){return Fa(t.element,"tox-tbtn--enabled")}}},FT=function(t,e,n,r){return DT({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(IT(t,hv.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:HT,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Qw.config({})]},e,n.shared)},VT=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){Nc(e.element),Ni(e,ux,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(U(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return O(O({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},jT=function(t,e,n,r,o,i){void 0===n&&(n=[]);var a=e.fold((function(){return{}}),(function(t){return{action:t}})),u=O({buttonBehaviours:xc([Gb((function(){return t.disabled||i.isDisabled()})),qb(),Qw.config({}),uh("button press",[Li("click"),Li("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},a),c=ur(u,{dom:r});return ur(c,{components:o})},UT=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({})},i=t.icon.map((function(t){return TT(t,n.icons)})),a=ey([i]);return jT(t,e,r,o,a,n)},WT=function(t,e,n,r){void 0===r&&(r=[]);var o=UT(t,B.some(e),n,r);return pp.sketch(o)},qT=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),a=t.icon?t.icon.map((function(t){return TT(t,n.icons)})):B.none(),u=a.isSome()?ey([a]):[],c=a.isSome()?{}:{innerHtml:i},s=_(_(_(_([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),a.isSome()?["tox-button--icon"]:[],!0),t.borderless?["tox-button--naked"]:[],!0),o,!0),l=O(O({tag:"button",classes:s},c),{attributes:{title:i}});return jT(t,e,r,l,u,n)},$T=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=qT(t,B.some(e),n,r,o);return pp.sketch(i)},GT=function(t,e){return function(n){"custom"===e?Ni(n,ux,{name:t,value:{}}):"submit"===e?Ri(n,cx):"cancel"===e?Ri(n,ax):console.error("Unknown button type: ",e)}},KT=function(t,e,n){if(function(t,e){return"menu"===e}(0,e)){var r=t,o=O(O({},t),{onSetup:function(e){return e.setDisabled(t.disabled),h},fetch:VT(r.items,(function(){return i}),n)}),i=vp(FT(o,"tox-tbtn",n,B.none()));return i.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,e)){var a=GT(t.name,e),u=O(O({},t),{borderless:!1});return $T(u,a,n.shared.providers,[])}console.error("Unknown footer button type: ",e)},XT=function(t,e){var n,r,o=GT(t.name,"custom");return n=B.none(),r=Xw.parts.field(O({factory:pp},qT(t,B.some(o),e,[Ok(""),mk()]))),tx(n,r,[],[])},YT=v([fo("field1Name","field1"),fo("field2Name","field2"),Nu("onLockedChange"),Ou(["lockClass"]),fo("locked",!1),Nf("coupledFieldBehaviours",[zd,Of])]),JT=function(t,e){return nd({factory:Xw,name:t,overrides:function(t){return{fieldBehaviours:xc([uh("coupled-input-behaviour",[Ii(Xo(),(function(n){(function(t,e,n){return pd(t,e,n).bind(zd.getCurrent)})(n,t,e).each((function(e){pd(n,t,"lock").each((function(r){kh.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},QT=v([JT("field1","field2"),JT("field2","field1"),nd({factory:pp,schema:[Xr("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:xc([kh.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),ZT=Ad({name:"FormCoupledInputs",configFields:YT(),partFields:QT(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Af(t.coupledFieldBehaviours,[zd.config({find:B.some}),Of.config({store:{mode:"manual",getValue:function(e){var n,r=xd(e,t,["field1","field2"]);return(n={})[t.field1Name]=Of.getValue(r.field1()),n[t.field2Name]=Of.getValue(r.field2()),n},setValue:function(e,n){var r=xd(e,t,["field1","field2"]);xt(n,t.field1Name)&&Of.setValue(r.field1(),n[t.field1Name]),xt(n,t.field2Name)&&Of.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return pd(e,t,"field1")},getField2:function(e){return pd(e,t,"field2")},getLock:function(e){return pd(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),tO=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return Wn.value({value:n,unit:r})}return Wn.error(t)},eO=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return wt(n,t)};return t.unit===e?B.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?B.some(t.value):B.some(t.value/n[t.unit]*n[e]):B.none()},nO=function(t){return B.none()},rO=function(t,e){var n=tO(t).toOptional(),r=tO(e).toOptional();return kt(n,r,(function(t,e){return eO(t,e.unit).map((function(t){return e.value/t})).map((function(t){return function(t,e){return function(n){return eO(n,e).map((function(n){return{value:n*t,unit:e}}))}}(t,e.unit)})).getOr(nO)})).getOr(nO)},oO=function(t,e){var n=nO,r=oa("ratio-event"),o=function(t){return Ep(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)},i=ZT.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[o("lock"),o("unlock")],buttonBehaviours:xc([Xd.config({disabled:function(){return t.disabled||e.isDisabled()}}),qb(),Qw.config({})])}),a=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},u=function(n){return Xw.parts.field({factory:bx,inputClasses:["tox-textfield"],inputBehaviours:xc([Xd.config({disabled:function(){return t.disabled||e.isDisabled()}}),qb(),Qw.config({}),uh("size-input-events",[Ii(qo(),(function(t,e){Ni(t,r,{isField1:n})})),Ii(Yo(),(function(e,n){Ni(e,ox,{name:t.name})}))])]),selectOnFocus:!1})},c=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=ZT.parts.field1(a([Xw.parts.label(c("Width")),u(!0)])),l=ZT.parts.field2(a([Xw.parts.label(c("Height")),u(!1)]));return ZT.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,l,a([c("&nbsp;"),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){tO(Of.getValue(t)).each((function(t){n(t).each((function(t){Of.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))}))}))},coupledFieldBehaviours:xc([Xd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){ZT.getField1(t).bind(Xw.getField).each(Xd.disable),ZT.getField2(t).bind(Xw.getField).each(Xd.disable),ZT.getLock(t).each(Xd.disable)},onEnabled:function(t){ZT.getField1(t).bind(Xw.getField).each(Xd.enable),ZT.getField2(t).bind(Xw.getField).each(Xd.enable),ZT.getLock(t).each(Xd.enable)}}),qb(),uh("size-input-events2",[Ii(r,(function(t,e){var r=e.event.isField1,o=r?ZT.getField1(t):ZT.getField2(t),i=r?ZT.getField2(t):ZT.getField1(t),a=o.map(Of.getValue).getOr(""),u=i.map(Of.getValue).getOr("");n=rO(a,u)}))])])})},iO={undo:v(oa("undo")),redo:v(oa("redo")),zoom:v(oa("zoom")),back:v(oa("back")),apply:v(oa("apply")),swap:v(oa("swap")),transform:v(oa("transform")),tempTransform:v(oa("temp-transform")),transformApply:v(oa("transform-apply"))},aO=v("save-state"),uO=v("disable"),cO=v("enable"),sO={formActionEvent:ux,saveState:aO,disable:uO,enable:cO},lO=function(t,e){var n=function(t,n,r,o){return vp($T({name:t,text:t,disabled:r,primary:o,icon:B.none(),borderless:!1},n,e))},r=function(t,n,r,o){return vp(WT({name:t,icon:B.some(t),tooltip:B.some(n),disabled:o,primary:!1,borderless:!1},r,e))},o=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Xd)&&Xd.disable(n)}))},i=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Xd)&&Xd.enable(n)}))},a={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},u=h,c=function(t,e,n){Ni(t,e,n)},s=function(t){return Ri(t,sO.disable())},l=function(t){return Ri(t,sO.enable())},f=function(t,e){s(t),c(t,iO.transform(),{transform:e}),l(t)},d=function(t){return function(){tt.getOpt(t).each((function(t){ah.set(t,[Q])}))}},m=function(t,e){s(t),c(t,iO.transformApply(),{transform:e,swap:d(t)}),l(t)},g=function(){return n("Back",(function(t){return c(t,iO.back(),{swap:d(t)})}),!1,!1)},p=function(){return vp({dom:{tag:"div",classes:["tox-spacer"]},behaviours:xc([Xd.config({})])})},b=function(){return n("Apply",(function(t){return c(t,iO.apply(),{swap:d(t)})}),!0,!0)},y=[g(),p(),n("Apply",(function(e){m(e,(function(e){var n=t.getRect();return xT(e,n.x,n.y,n.w,n.h)})),t.hideCrop()}),!1,!0)],w=qw.sketch({dom:a,components:y.map((function(t){return t.asSpec()})),containerBehaviours:xc([uh("image-tools-crop-buttons-events",[Ii(sO.disable(),(function(t,e){o(y,t)})),Ii(sO.enable(),(function(t,e){i(y,t)}))])])}),x=vp(oO({name:"size",label:B.none(),constrain:!0,disabled:!1},e)),C=[g(),p(),x,p(),n("Apply",(function(t){x.getOpt(t).each((function(e){var n=Of.getValue(e),r=function(t,e){return function(n){return CT(n,t,e)}}(parseInt(n.width,10),parseInt(n.height,10));m(t,r)}))}),!1,!0)],S=qw.sketch({dom:a,components:C.map((function(t){return t.asSpec()})),containerBehaviours:xc([uh("image-tools-resize-buttons-events",[Ii(sO.disable(),(function(t,e){o(C,t)})),Ii(sO.enable(),(function(t,e){i(C,t)}))])])}),k=function(t,e){return function(n){return t(n,e)}},T=k(wT,"h"),O=k(wT,"v"),E=k(ST,-90),_=k(ST,90),R=function(t,e){!function(t,e){s(t),c(t,iO.tempTransform(),{transform:e}),l(t)}(t,e)},N=[g(),p(),r("flip-horizontally","Flip horizontally",(function(t){R(t,T)}),!1),r("flip-vertically","Flip vertically",(function(t){R(t,O)}),!1),r("rotate-left","Rotate counterclockwise",(function(t){R(t,E)}),!1),r("rotate-right","Rotate clockwise",(function(t){R(t,_)}),!1),p(),b()],A=qw.sketch({dom:a,components:N.map((function(t){return t.asSpec()})),containerBehaviours:xc([uh("image-tools-fliprotate-buttons-events",[Ii(sO.disable(),(function(t,e){o(N,t)})),Ii(sO.enable(),(function(t,e){i(N,t)}))])])}),D=function(t,n,r,o,i){var a=JS.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),u=JS.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=JS.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return vp(JS.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:v({x:o})},components:[a,u,c],sliderBehaviours:xc([dh.config({})]),onChoose:n}))},M=function(t,e,n,r,o){return D(t,(function(t,n,r){var o=k(e,r.x/100);f(t,o)}),n,r,o)},z=function(t,e,n,r,u){var c=function(t,e,n,r,o){return[g(),M(t,e,n,r,o),b()]}(t,e,n,r,u);return qw.sketch({dom:a,components:c.map((function(t){return t.asSpec()})),containerBehaviours:xc([uh("image-tools-filter-panel-buttons-events",[Ii(sO.disable(),(function(t,e){o(c,t)})),Ii(sO.enable(),(function(t,e){i(c,t)}))])])})},P=[g(),p(),b()],L=qw.sketch({dom:a,components:P.map((function(t){return t.asSpec()}))}),I=z("Brightness",bT,-100,0,100),H=z("Contrast",yT,-100,0,100),F=z("Gamma",vT,-100,0,100),V=function(t,e,n){return function(r){return function(t,e,n,r){return aT(t,e,n,r)}(r,t,e,n)}},j=function(t){return D(t,(function(t,e,n){var r=U.getOpt(t),o=q.getOpt(t),i=W.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=Of.getValue(e).x/100,i=Of.getValue(r).x/100,a=Of.getValue(n).x/100,u=V(o,i,a);f(t,u)}))}))}))}),0,100,200)},U=j("R"),W=j("G"),q=j("B"),$=[g(),U,W,q,b()],G=qw.sketch({dom:a,components:$.map((function(t){return t.asSpec()}))}),K=function(t,e,n){return function(r){c(r,iO.swap(),{transform:e,swap:function(){tt.getOpt(r).each((function(e){ah.set(e,[t]),n(e)}))}})}},X=B.some(pT),Y=B.some(hT),J=[r("crop","Crop",K(w,B.none(),(function(e){t.showCrop()})),!1),r("resize","Resize",K(S,B.none(),(function(e){x.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;Of.setValue(e,{width:r,height:o})}))})),!1),r("orientation","Orientation",K(A,B.none(),u),!1),r("brightness","Brightness",K(I,B.none(),u),!1),r("sharpen","Sharpen",K(L,X,u),!1),r("contrast","Contrast",K(H,B.none(),u),!1),r("color-levels","Color levels",K(G,B.none(),u),!1),r("gamma","Gamma",K(F,B.none(),u),!1),r("invert","Invert",K(L,Y,u),!1)],Q=qw.sketch({dom:a,components:J.map((function(t){return t.asSpec()}))}),Z=qw.sketch({dom:{tag:"div"},components:[Q],containerBehaviours:xc([ah.config({})])}),tt=vp(Z);return{memContainer:tt,getApplyButton:function(t){return tt.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))}}},fO=tinymce.util.Tools.resolve("tinymce.geom.Rect"),dO=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),mO=tinymce.util.Tools.resolve("tinymce.util.Observable"),gO=tinymce.util.Tools.resolve("tinymce.util.VK"),hO=function(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]};function pO(t,e){var n,r,o,i,a=e.document||document,u=a.getElementById(e.handle||t),c=function(t){if(hO(t),t.button!==r)return s(t);t.deltaX=t.screenX-o,t.deltaY=t.screenY-i,t.preventDefault(),e.drag(t)},s=function(t){hO(t),dO(a).off("mousemove touchmove",c).off("mouseup touchend",s),n.remove(),e.stop&&e.stop(t)};return dO(u).on("mousedown touchstart",(function(t){var l,f=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),a=e(n.offsetWidth,r.offsetWidth),u=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight);return{width:o<a?i:o,height:u<e(n.offsetHeight,r.offsetHeight)?c:u}}(a);hO(t),t.preventDefault(),r=t.button;var d=u;o=t.screenX,i=t.screenY,l=window.getComputedStyle?window.getComputedStyle(d,null).getPropertyValue("cursor"):d.runtimeStyle.cursor,n=dO("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(a.body),dO(a).on("mousemove touchmove",c).on("mouseup touchend",s),e.start(t)})),{destroy:function(){dO(u).off()}}}var vO=0,bO=function(t,e,n,r,o){var i,a="tox-crid-"+vO++,u=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],c=["top","right","bottom","left"],s=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}},l=function(e,r,o,i){var a,u,c,l,f;a=r.x,u=r.y,c=r.w,l=r.h,a+=o*e.deltaX,u+=i*e.deltaY,(c+=o*e.deltaW)<20&&(c=20),(l+=i*e.deltaH)<20&&(l=20),f=t=fO.clamp({x:a,y:u,w:c,h:l},n,"move"===e.name),f=s(n,f),g.fire("updateRect",{rect:f}),m(f)},f=function(t){var n=function(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),dO("#"+a+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})};yk.each(u,(function(e){dO("#"+a+"-"+e.name,r).css({left:t.w*e.xMul+t.x,top:t.h*e.yMul+t.y})})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)},d=function(e){f(t=e)},m=function(t){var e,r;d((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))};dO('<div id="'+a+'" class="tox-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),yk.each(c,(function(t){dO("#"+a,r).append('<div id="'+a+"-"+t+'"class="tox-croprect-block" style="display: none" data-mce-bogus="all">')})),yk.each(u,(function(t){dO("#"+a,r).append('<div id="'+a+"-"+t.name+'" class="tox-croprect-handle tox-croprect-handle-'+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')})),i=yk.map(u,(function(e){var n;return pO(a,{document:r.ownerDocument,handle:a+"-"+e.name,start:function(){n=t},drag:function(t){l(e,n,t.deltaX,t.deltaY)}})})),f(t),dO(r).on("focusin focusout",(function(t){dO(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")})),dO(r).on("keydown",(function(e){var n;yk.each(u,(function(t){if(e.target.id===a+"-"+t.name)return n=t,!1}));var r=function(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),l(n,r,o,i)};switch(e.keyCode){case gO.LEFT:r(e,0,t,-10,0);break;case gO.RIGHT:r(e,0,t,10,0);break;case gO.UP:r(e,0,t,0,-10);break;case gO.DOWN:r(e,0,t,0,10);break;case gO.ENTER:case gO.SPACEBAR:e.preventDefault(),o()}}));var g=yk.extend({toggleVisibility:function(t){var e=yk.map(u,(function(t){return"#"+a+"-"+t.name})).concat(yk.map(c,(function(t){return"#"+a+"-"+t}))).join(",");t?dO(e,r).show():dO(e,r).hide()},setClampRect:function(e){n=e,f(t)},setRect:d,getInnerRect:function(){return s(n,t)},setInnerRect:m,setViewPortRect:function(n){e=n,f(t)},destroy:function(){yk.each(i,(function(t){t.destroy()})),i=[]}},mO);return g},yO=function(t){var e=vp({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=xo(1),r=Zc(),o=xo({x:0,y:0,w:1,h:1}),i=xo({x:0,y:0,w:1,h:1}),a=function(t,i){s.getOpt(t).each((function(t){var a=n.get(),u=bn(t.element),c=ln(t.element),s=i.dom.naturalWidth*a,l=i.dom.naturalHeight*a,f=Math.max(0,u/2-s/2),d=Math.max(0,c/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:l.toString()+"px",position:"absolute"};Qe(i,m),e.getOpt(t).each((function(t){Qe(t.element,m)})),r.on((function(t){var e=o.get();t.setRect({x:e.x*a+f,y:e.y*a+d,w:e.w*a,h:e.h*a}),t.setClampRect({x:f,y:d,w:s,h:l}),t.setViewPortRect({x:0,y:0,w:u,h:c})}))}))},u=function(t,e){var r,u=Bt.fromTag("img");return We(u,"src",e),(r=u.dom,new Up((function(t){var e=function(){r.removeEventListener("load",e),t(r)};r.complete?t(r):r.addEventListener("load",e)}))).then((function(){t.getSystem().isConnected()&&s.getOpt(t).map((function(t){var e=Za({element:u});ah.replaceAt(t,1,B.some(e));var r=i.get(),c={x:0,y:0,w:u.dom.naturalWidth,h:u.dom.naturalHeight};i.set(c);var l=fO.inflate(c,-20,-20);o.set(l),r.w===c.w&&r.h===c.h||function(t,e){s.getOpt(t).each((function(t){var r=bn(t.element),o=ln(t.element),i=e.dom.naturalWidth,a=e.dom.naturalHeight,u=Math.min(r/i,o/a);u>=1?n.set(1):n.set(u)}))}(t,u),a(t,u)}))}))},c=qw.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:xc([uh("image-panel-crop-events",[$i((function(t){s.getOpt(t).each((function(t){var e=t.element.dom,i=bO({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,h);i.toggleVisibility(!1),i.on("updateRect",(function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)})),r.set(i)}))}))])])}],containerBehaviours:xc([ah.config({}),uh("image-panel-events",[$i((function(e){u(e,t)}))])])}),s=vp(c);return{memContainer:s,updateSrc:u,zoom:function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),s.getOpt(t).each((function(t){var e=t.components()[1].element;a(t,e)}))},showCrop:function(){r.on((function(t){t.toggleVisibility(!0)}))},hideCrop:function(){r.on((function(t){t.toggleVisibility(!1)}))},getRect:function(){return o.get()},getMeasurements:function(){var t=i.get();return{width:t.w,height:t.h}}}},wO=function(t,e,n,r,o){return WT({name:t,icon:B.some(e),disabled:n,tooltip:B.some(t),primary:!1,borderless:!1},r,o)},xO=function(t,e){e?Xd.enable(t):Xd.disable(t)};var CO,SO=function(t){var e,n,r,o,i=xo(t),a=Zc(),u=(n=-1,{data:e=[],add:function(t){var r=e.splice(++n);return e.push(t),{state:t,removed:r}},undo:function(){if(r())return e[--n]},redo:function(){if(o())return e[++n]},canUndo:r=function(){return n>0},canRedo:o=function(){return-1!==n&&n<e.length-1}});u.add(t);var c=function(t){i.set(t)},s=function(t){return{blob:t,url:URL.createObjectURL(t)}},l=function(t){URL.revokeObjectURL(t.url)},f=function(){a.on(l),a.clear()},d=function(t){var e=s(t);c(e);var n,r=u.add(e).removed;return n=r,yk.each(n,l),e.url};return{getBlobState:function(){return i.get()},setBlobState:c,addBlobState:d,getTempState:function(){return a.get().getOrThunk(i.get)},updateTempState:function(t){var e=s(t);return f(),a.set(e),e.url},addTempState:function(t){var e=s(t);return a.set(e),e.url},applyTempState:function(t){return a.get().fold(h,(function(e){d(e.blob),t()}))},destroyTempState:f,undo:function(){var t=u.undo();return c(t),t.url},redo:function(){var t=u.redo();return c(t),t.url},getHistoryStates:function(){return{undoEnabled:u.canUndo(),redoEnabled:u.canRedo()}}}},kO=function(t,e){var n=SO(t.currentState),r=function(t){var e=n.getHistoryStates();d.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),Ni(t,sO.formActionEvent,{name:sO.saveState(),value:e.undoEnabled})},o=function(t){return t.toBlob()},i=function(t){Ni(t,sO.formActionEvent,{name:sO.disable(),value:{}})},a=function(t){m.getApplyButton(t).each((function(t){Xd.enable(t)})),Ni(t,sO.formActionEvent,{name:sO.enable(),value:{}})},u=function(t,e){return i(t),f.updateSrc(t,e)},c=function(t,e,n,c,s){i(t),function(t){return Kk(t)}(e).then(n).then(o).then(c).then((function(e){return u(t,e)})).then((function(){r(t),s(),a(t)})).catch((function(e){console.log(e),t.getSystem().isConnected()&&a(t)}))},s=function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,(function(t){return n.updateTempState(t)}),r)},l=function(t){var e=n.getBlobState().url;return n.destroyTempState(),r(t),e},f=yO(t.currentState.url),d=function(t){var e=vp(wO("Undo","undo",!0,(function(t){Ni(t,iO.undo(),{direction:1})}),t)),n=vp(wO("Redo","redo",!0,(function(t){Ni(t,iO.redo(),{direction:1})}),t));return{container:qw.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),wO("Zoom in","zoom-in",!1,(function(t){Ni(t,iO.zoom(),{direction:1})}),t),wO("Zoom out","zoom-out",!1,(function(t){Ni(t,iO.zoom(),{direction:-1})}),t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each((function(t){xO(t,r)})),n.getOpt(t).each((function(t){xO(t,o)}))}}}(e),m=lO(f,e);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[m.memContainer.asSpec(),f.memContainer.asSpec(),d.container],behaviours:xc([Of.config({store:{mode:"manual",getValue:function(){return n.getBlobState()}}}),uh("image-tools-events",[Ii(iO.undo(),(function(t,e){var o=n.undo();u(t,o).then((function(e){a(t),r(t)}))})),Ii(iO.redo(),(function(t,e){var o=n.redo();u(t,o).then((function(e){a(t),r(t)}))})),Ii(iO.zoom(),(function(t,e){var n=e.event.direction;f.zoom(t,n)})),Ii(iO.back(),(function(t,e){!function(t){var e=l(t);u(t,e).then((function(e){a(t)}))}(t),(0,e.event.swap)(),f.hideCrop()})),Ii(iO.apply(),(function(t,e){n.applyTempState((function(){l(t),(0,e.event.swap)()}))})),Ii(iO.transform(),(function(t,e){return s(t,e.event.transform,h)})),Ii(iO.tempTransform(),(function(t,e){return function(t,e){var r=n.getTempState().blob;c(t,r,e,(function(t){return n.addTempState(t)}),h)}(t,e.event.transform)})),Ii(iO.transformApply(),(function(t,e){return function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,(function(e){var r=n.addBlobState(e);return l(t),r}),r)}(t,e.event.transform,e.event.swap)})),Ii(iO.swap(),(function(t,e){!function(t){d.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event.transform,r=e.event.swap;n.fold((function(){r()}),(function(e){s(t,e,r)}))}))]),mk()])}},TO=function(t){return!wt(t,"items")},OO="data-value",EO=function(t,e,n,r){return U(n,(function(n){return TO(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){Of.setValue(t,n.value),Ni(t,ox,{name:e}),dh.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return EO(t,e,n.items,r)}}}))},_O=function(t,e){return st(t,(function(t){return TO(t)?Tt(t.value===e,t):_O(t.items,e)}))},RO=Nd({name:"HtmlSelect",configFields:[Xr("options"),Ef("selectBehaviours",[dh,Of]),fo("selectClasses",[]),fo("selectAttributes",{}),oo("data")],factory:function(t,e){var n=U(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return To("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:Rf(t.selectBehaviours,[dh.config({}),Of.config({store:O({mode:"manual",getValue:function(t){return Ua(t.element)},setValue:function(e,n){X(t.options,(function(t){return t.value===n})).isSome()&&Wa(e.element,n)}},r)})])}}}),NO=function(t,e){var n=t.label.map((function(t){return rx(t,e)})),r=[Xd.config({disabled:function(){return t.disabled||e.isDisabled()}}),qb(),eh.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Ri(t,cx),B.some(!0)}}),uh("textfield-change",[Ii(Xo(),(function(e,n){Ni(e,ox,{name:t.name})})),Ii(ai(),(function(e,n){Ni(e,ox,{name:t.name})}))]),Qw.config({})],o=t.validation.map((function(t){return Ix.config({getRoot:function(t){return Oe(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=Of.getValue(e),r=t.validator(n);return _x(!0===r?Wn.value(n):Wn.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),i=t.placeholder.fold(v({}),(function(t){return{placeholder:e.translate(t)}})),a=t.inputMode.fold(v({}),(function(t){return{inputmode:t}})),u=O(O({},i),a),c=Xw.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:u,inputClasses:[t.classname],inputBehaviours:xc(J([r,o])),selectOnFocus:!1,factory:bx}),s=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),l=[Xd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){Xw.getField(t).each(Xd.disable)},onEnabled:function(t){Xw.getField(t).each(Xd.enable)}}),qb()];return tx(n,c,s,l)},AO=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return zi([Ii(t.event,n),Gi((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Ii(t,(function(){return e.cancel()}))]})).getOr([])))}}),DO=function(t){var e=xo(null);return xa({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},MO=Object.freeze({__proto__:null,throttle:DO,init:function(t){return t.stream.streams.state(t)}}),BO=[Yr("stream",qr("mode",{throttle:[Xr("delay"),fo("stopEvent",!0),Du("streams",{setup:function(t,e){var n=t.stream,r=Dp(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:DO})]})),fo("event","input"),oo("cancelEvent"),Nu("onStream")],zO=Sc({fields:BO,name:"streaming",active:AO,state:MO}),PO=function(t,e,n){var r=Of.getValue(n);Of.setValue(e,r),IO(e)},LO=function(t,e){var n=t.element,r=Ua(n),o=n.dom;"number"!==qe(n,"type")&&e(o,r)},IO=function(t){LO(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},HO=function(t,e,n){if(t.selectsOver){var r=Of.getValue(e),o=t.getDisplayText(r),i=Of.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?B.some((function(){PO(0,e,n),function(t,e){LO(t,(function(t,n){return t.setSelectionRange(e,n.length)}))}(e,o.length)})):B.none()}return B.none()},FO=v("alloy.typeahead.itemexecute"),VO=v([oo("lazySink"),Xr("fetch"),fo("minChars",5),fo("responseTime",1e3),_u("onOpen"),fo("getHotspot",B.some),fo("getAnchorOverrides",v({})),fo("layouts",B.none()),fo("eventOrder",{}),wo("model",{},[fo("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),fo("selectsOver",!0),fo("populateFromBrowse",!0)]),_u("onSetValue"),Ru("onExecute"),_u("onItemExecute"),fo("inputClasses",[]),fo("inputAttributes",{}),fo("inputStyles",{}),fo("matchWidth",!0),fo("useMinWidth",!1),fo("dismissOnBlur",!0),Ou(["openClass"]),oo("initialData"),Ef("typeaheadBehaviours",[dh,Of,zO,eh,kh,Vx]),Gr("previewing",(function(){return xo(!0)}))].concat(gx()).concat(nC())),jO=v([rd({schema:[Tu()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){HO(t.model,r,n).fold((function(){return am.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&PO(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return Ni(t,FO(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&PO(t.model,e,n)}))}}}})]),UO=Ad({name:"Typeahead",configFields:VO(),partFields:jO(),factory:function(t,e,n,r){var o=function(e,n,o){t.previewing.set(!1);var i=Vx.getCoupled(e,"sandbox");if(af.isOpen(i))zd.getCurrent(i).each((function(t){am.getHighlighted(t).fold((function(){o(t)}),(function(){Bi(i,t.element,"keydown",n)}))}));else{Kx(t,a(e),e,i,r,(function(t){zd.getCurrent(t).each(o)}),xx.HighlightFirst).get(h)}},i=hx(t),a=function(t){return function(e){return e.map((function(e){var n=bt(e.menus),r=Q(n,(function(t){return $(t.items,(function(t){return"item"===t.type}))}));return Of.getState(t).update(U(r,(function(t){return t.data}))),e}))}},u=[dh.config({}),Of.config({onSetValue:t.onSetValue,store:O({mode:"dataset",getDataKey:function(t){return Ua(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){Wa(e.element,t.model.getDisplayText(n))}},t.initialData.map((function(t){return To("initialValue",t)})).getOr({}))}),zO.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,n){var o=Vx.getCoupled(e,"sandbox");if(dh.isFocused(e)&&Ua(e.element).length>=t.minChars){var i=zd.getCurrent(o).bind((function(t){return am.getHighlighted(t).map(Of.getValue)}));t.previewing.set(!0);Kx(t,a(e),e,o,r,(function(e){zd.getCurrent(o).each((function(e){i.fold((function(){t.model.selectsOver&&am.highlightFirst(e)}),(function(t){am.highlightBy(e,(function(e){return Of.getValue(e).value===t.value})),am.getHighlighted(e).orThunk((function(){return am.highlightFirst(e),B.none()}))}))}))}),xx.HighlightFirst).get(h)}},cancelEvent:mi()}),eh.config({mode:"special",onDown:function(t,e){return o(t,e,am.highlightFirst),B.some(!0)},onEscape:function(t){var e=Vx.getCoupled(t,"sandbox");return af.isOpen(e)?(af.close(e),B.some(!0)):B.none()},onUp:function(t,e){return o(t,e,am.highlightLast),B.some(!0)},onEnter:function(e){var n=Vx.getCoupled(e,"sandbox"),r=af.isOpen(n);if(r&&!t.previewing.get())return zd.getCurrent(n).bind((function(t){return am.getHighlighted(t)})).map((function(t){return Ni(e,FO(),{item:t}),!0}));var o=Of.getValue(e);return Ri(e,mi()),t.onExecute(n,e,o),r&&af.close(n),B.some(!0)}}),kh.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),Vx.config({others:{sandbox:function(e){return tC(t,e,{onOpen:function(){return kh.on(e)},onClose:function(){return kh.off(e)}})}}}),uh("typeaheadevents",[Xi((function(e){var n=h;Yx(t,a(e),e,r,n,xx.HighlightFirst).get(h)})),Ii(FO(),(function(e,n){var r=Vx.getCoupled(e,"sandbox");PO(t.model,e,n.event.item),Ri(e,mi()),t.onItemExecute(e,r,n.event.item,Of.getValue(e)),af.close(r),IO(e)}))].concat(t.dismissOnBlur?[Ii(ii(),(function(t){var e=Vx.getCoupled(t,"sandbox");Mc(e.element).isNone()&&af.close(e)}))]:[]))];return{uid:t.uid,dom:vx(ur(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:O(O({},i),Rf(t.typeaheadBehaviours,u)),eventOrder:t.eventOrder}}}),WO=function(t){return O(O({},t),{toCached:function(){return WO(t.toCached())},bindFuture:function(e){return WO(t.bind((function(t){return t.fold((function(t){return _x(Wn.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return WO(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return WO(t.map((function(t){return t.map(e)})))},mapError:function(e){return WO(t.map((function(t){return t.mapError(e)})))},foldResult:function(e,n){return t.map((function(t){return t.fold(e,n)}))},withTimeout:function(e,n){return WO(Ex((function(r){var o=!1,i=setTimeout((function(){o=!0,r(Wn.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))}})},qO=function(t){return WO(Ex(t))},$O=qO,GO={type:"separator"},KO=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:h}},XO=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:h}},YO=function(t,e){return function(t){return U(t,KO)}(function(t,e){return $(e,(function(e){return e.type===t}))}(t,e))},JO=function(t){return YO("header",t.targets)},QO=function(t){return YO("anchor",t.targets)},ZO=function(t){return B.from(t.anchorTop).map((function(t){return XO("<top>",t)})).toArray()},tE=function(t){return B.from(t.anchorBottom).map((function(t){return XO("<bottom>",t)})).toArray()},eE=function(t,e){var n=t.toLowerCase();return $(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return Et(e.toLowerCase(),n)||Et(t.value.toLowerCase(),n)}))},nE=function(t,e,n){var r=Of.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=eE(o,function(t){return U(t,(function(t){return XO(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,eE(o,JO(e)),eE(o,J([ZO(e),QO(e),tE(e)]))],K(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(GO,e)}),[])):i}))},rE=oa("aria-invalid"),oE=function(t){return function(e,n,r){return yt(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},iE={bar:oE((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:U(t.items,e.interpreter)}}(t,e.shared)})),collection:oE((function(t,e){return mx(t,e.shared.providers)})),alertbanner:oE((function(t,e){return function(t,e){return qw.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[pp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:kp(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Ni(e,ux,{name:"alert-banner",value:t.url})},buttonBehaviours:xc([Tp()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:oE((function(t,e){return function(t,e){return NO({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:B.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:oE((function(t,e){return function(t,e){return NO({name:t.name,multiline:!0,label:t.label,inputMode:B.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:B.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:oE((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=U(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:xc([mk(),ah.config({}),Tk(B.none()),eh.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:function(t){return function(e,n,r){var o=ur(n,{source:"dynamic"});return oE(t)(e,o,r)}}((function(t,e){return Pk(t,e.shared.providers)})),button:oE((function(t,e){return XT(t,e.shared.providers)})),checkbox:oE((function(t,e){return function(t,e){var n=Of.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),r=function(t){return t.element.dom.click(),B.some(!0)},o=Xw.parts.field({factory:{sketch:b},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:xc([mk(),Xd.config({disabled:function(){return t.disabled||e.isDisabled()}}),Qw.config({}),dh.config({}),n,eh.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),uh("checkbox-events",[Ii(Yo(),(function(e,n){Ni(e,ox,{name:t.name})}))])])}),i=Xw.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:xc([uC.config({})])}),a=function(t){return Ep("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},e.icons)},u=vp({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return Xw.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,u.asSpec(),i],fieldBehaviours:xc([Xd.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){Xw.getField(t).each(Xd.disable)},onEnabled:function(t){Xw.getField(t).each(Xd.enable)}}),qb()])})}(t,e.shared.providers)})),colorinput:oE((function(t,e){return fC(t,e.shared,e.colorinput)})),colorpicker:oE((function(t){var e=function(t){return"tox-"+t},n=dk(vk,e),r=vp(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Ni(t,ux,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Ni(t,ux,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:xc([Of.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return zd.getCurrent(e).bind((function(t){return Of.getValue(t).hex})).map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);zd.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(t){Of.setValue(t,{hex:B.from(n[1]).getOr("")}),ik.getField(t,"hex").each((function(t){Ri(t,Xo())}))}))}}}),mk()])}})),dropzone:oE((function(t,e){return Ek(t,e.shared.providers)})),grid:oE((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:U(t.items,e.interpreter)}}(t,e.shared)})),listbox:oE((function(t,e){return function(t,e){var n=e.shared.providers,r=at(t.items).filter(TO),o=t.label.map((function(t){return rx(t,n)})),i={dom:{tag:"div",classes:["tox-listboxfield"]},components:[Xw.parts.field({dom:{},factory:{sketch:function(n){return DT({uid:n.uid,text:r.map((function(t){return t.text})),icon:B.none(),tooltip:t.label,role:B.none(),fetch:function(n,r){var o=EO(n,t.name,t.items,Of.getValue(n));r(IT(o,hv.CLOSE_ON_EXECUTE,e,!1))},onSetup:v(h),getApi:v({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Qw.config({}),Of.config({store:{mode:"manual",initialValue:r.map((function(t){return t.value})).getOr(""),getValue:function(t){return qe(t.element,OO)},setValue:function(e,n){_O(t.items,n).each((function(t){We(e.element,OO,t.value),Ni(e,NT,{text:t.text})}))}}})]},"tox-listbox",e.shared)}}})]};return Xw.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:J([o.toArray(),[i]]),fieldBehaviours:xc([Xd.config({disabled:v(t.disabled),onDisabled:function(t){Xw.getField(t).each(Xd.disable)},onEnabled:function(t){Xw.getField(t).each(Xd.enable)}})])})}(t,e)})),selectbox:oE((function(t,e){return function(t,e){var n=U(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return rx(t,e)})),o=Xw.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:RO,selectBehaviours:xc([Xd.config({disabled:function(){return t.disabled||e.isDisabled()}}),Qw.config({}),uh("selectbox-change",[Ii(Yo(),(function(e,n){Ni(e,ox,{name:t.name})}))])])}),i=t.size>1?B.none():B.some(Ep("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),a={dom:{tag:"div",classes:["tox-selectfield"]},components:J([[o],i.toArray()])};return Xw.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:J([r.toArray(),[a]]),fieldBehaviours:xc([Xd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){Xw.getField(t).each(Xd.disable)},onEnabled:function(t){Xw.getField(t).each(Xd.enable)}}),qb()])})}(t,e.shared.providers)})),sizeinput:oE((function(t,e){return oO(t,e.shared.providers)})),urlinput:oE((function(t,e){return function(t,e,n){var r,o=e.shared.providers,i=function(e){var r=Of.getValue(e);n.addToHistory(r.value,t.filetype)},a=Xw.parts.field({factory:UO,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":rE,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=nE(t.filetype,r,n),i=IT(o,hv.BUBBLE_TO_SANDBOX,e,!1);return _x(i)},getHotspot:function(t){return d.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(Ix)&&Ix.run(t).get(h)},typeaheadBehaviours:xc(J([n.getValidationHandler().map((function(e){return Ix.config({getRoot:function(t){return Oe(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){c.getOpt(t).each((function(t){We(t.element,"title",o.translate(e))}))}},validator:{validate:function(n){var r=Of.getValue(n);return $O((function(n){e({type:t.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=Wn.error(t.message);n(e)}else{var r=Wn.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[Xd.config({disabled:function(){return t.disabled||o.isDisabled()}}),Qw.config({}),uh("urlinput-events",J(["file"===t.filetype?[Ii(Xo(),(function(e){Ni(e,ox,{name:t.name})}))]:[],[Ii(Yo(),(function(e){Ni(e,ox,{name:t.name}),i(e)})),Ii(ai(),(function(e){Ni(e,ox,{name:t.name}),i(e)}))]]))]])),eventOrder:(r={},r[Xo()]=["streaming","urlinput-events","invalidating"],r),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:Mv(0,0,"normal")},onExecute:function(t,e,n){Ni(e,cx,{})},onItemExecute:function(e,n,r,o){i(e),Ni(e,ox,{name:t.name})}}),u=t.label.map((function(t){return rx(t,o)})),c=vp(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),Ep(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:O({title:o.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))},o.icons)}("invalid",B.some(rE),"warning")),s=vp({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),l=n.getUrlPicker(t.filetype),f=oa("browser.url.event"),d=vp({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,s.asSpec()],behaviours:xc([Xd.config({disabled:function(){return t.disabled||o.isDisabled()}})])}),m=vp($T({name:t.name,icon:B.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return Ri(t,f)}),o,[],["tox-browse-url"]));return Xw.sketch({dom:nx([]),components:u.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:J([[d.asSpec()],l.map((function(){return m.asSpec()})).toArray()])}]),fieldBehaviours:xc([Xd.config({disabled:function(){return t.disabled||o.isDisabled()},onDisabled:function(t){Xw.getField(t).each(Xd.disable),m.getOpt(t).each(Xd.disable)},onEnabled:function(t){Xw.getField(t).each(Xd.enable),m.getOpt(t).each(Xd.enable)}}),qb(),uh("url-input-events",[Ii(f,(function(e){zd.getCurrent(e).each((function(n){var r=Of.getValue(n),o=O({fieldname:t.name},r);l.each((function(r){r(o).get((function(r){Of.setValue(n,r),Ni(e,ox,{name:t.name})}))}))}))}))])])})}(t,e,e.urlinput)})),customeditor:oE((function(t){var e=Zc(),n=vp({dom:{tag:t.tag}}),r=Zc();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:xc([uh("custom-editor-events",[$i((function(o){n.getOpt(o).each((function(n){(!function(t){return wt(t,"init")}(t)?bk.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)})):t.init(n.element.dom)).then((function(t){r.on((function(e){t.setValue(e)})),r.clear(),e.set(t)}))}))}))]),Of.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(n)}),(function(t){return t.setValue(n)}))}}}),mk()]),components:[n.asSpec()]}})),htmlpanel:oE((function(t){return"presentation"===t.presets?qw.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):qw.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:xc([Qw.config({}),dh.config({})])})})),imagetools:oE((function(t,e){return kO(t,e.shared.providers)})),table:oE((function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},a=function(t){return{dom:{tag:"tr"},components:U(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:U(r,o)}]}),(n=t.cells,{dom:{tag:"tbody"},components:U(n,a)})],behaviours:xc([Qw.config({}),dh.config({})])}}(t,e.shared.providers)})),panel:oE((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:U(t.items,e.shared.interpreter)}}(t,e)}))},aE={field:function(t,e){return e}},uE=function(t,e,n){var r=ur(n,{shared:{interpreter:function(e){return cE(t,e,r)}}});return cE(t,e,r)},cE=function(t,e,n){return yt(iE,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},sE={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},lE=function(t,e,n){var r={maxHeightFunction:gs()};return function(){return n()?{type:"node",root:Pe(t()),node:B.from(t()),bubble:bs(12,12,sE),layouts:{onRtl:function(){return[ap]},onLtr:function(){return[ip]}},overrides:r}:{type:"hotspot",hotspot:e(),bubble:bs(-12,12,sE),layouts:{onRtl:function(){return[ec]},onLtr:function(){return[nc]}},overrides:r}}},fE=function(t,e,n){return function(){return n()?{type:"node",root:Pe(t()),node:B.from(t()),layouts:{onRtl:function(){return[up]},onLtr:function(){return[up]}}}:{type:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[ac]},onLtr:function(){return[ac]}}}}},dE=function(t,e){return function(){return{type:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return B.some(Ws.range(Bt.fromDom(e.startContainer),e.startOffset,Bt.fromDom(e.endContainer),e.endOffset))}}}},mE=function(t){return function(e){return{type:"node",root:t(),node:e}}},gE=function(t,e,n){var r=Mb(t),o=function(){return Bt.fromDom(t.getBody())},i=function(){return Bt.fromDom(t.getContentAreaContainer())},a=function(){return r||!n()};return{inlineDialog:lE(i,e,a),banner:fE(i,e,a),cursor:dE(t,o),node:mE(o)}},hE=function(t){return function(e,n){cw(t)(e,n)}},pE=function(t){return function(){return Jy(t)}},vE=function(t){return function(){return Qy(t)}},bE=function(t){return function(){return tw(t)}},yE=function(t){return{colorPicker:hE(t),hasCustomColors:pE(t),getColors:vE(t),getColorCols:bE(t)}},wE=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},xE=function(t){return{isDraggableModal:wE(t)}},CE=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],SE=function(t){return K(t,(function(t,e){if(wt(e,"items")){var n=SE(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(function(t){return wt(t,"inline")}(e)||function(t){return wt(t,"block")}(e)||function(t){return wt(t,"selector")}(e)){var r="custom-"+(o(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:r,format:e}]),formats:t.formats.concat([{title:e.title,format:r,icon:e.icon}])}}return O(O({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},kE=function(t){return function(t){return B.from(t.getParam("style_formats")).filter(a)}(t).map((function(e){var n=function(t,e){var n=SE(e),r=function(e){W(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?CE.concat(n):n})).getOr(CE)},TE=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return ur(t,r)},OE=function(t,e,n,r){var i=function(e){return U(e,(function(e){var a=lt(e);if(xt(e,"items")){var u=i(e.items);return ur(function(t){return ur(t,{type:"submenu"})}(e),{getStyleItems:v(u)})}return xt(e,"format")?function(t){return TE(t,n,r)}(e):1===a.length&&H(a,"title")?ur(e,{type:"separator"}):function(e){var i=o(e.name)?e.name:oa(e.title),a="custom-"+i,u={type:"formatter",format:a,isSelected:n(a),getStylePreview:r(a)},c=ur(e,u);return t.formatter.register(i,c),c}(e)}))};return i(e)},EE=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?B.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):B.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?Q(e,r):[t.format]},o=xo([]),i=xo([]),a=xo([]),u=xo([]),c=xo(!1);t.on("PreInit",(function(a){var u=kE(t),c=OE(t,u,e,n);o.set(c),i.set(Q(c,r))})),t.on("addStyleModifications",(function(o){var i=OE(t,o.items,e,n);a.set(i),c.set(o.replace),u.set(Q(i,r))}));return{getData:function(){var t=c.get()?[]:o.get(),e=a.get();return t.concat(e)},getFlattenedKeys:function(){var t=c.get()?[]:i.get(),e=u.get();return t.concat(e)}}},_E=yk.trim,RE=function(t){return function(e){if(function(t){return f(t)&&1===t.nodeType}(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},NE=RE("true"),AE=RE("false"),DE=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},ME=function(t){return t.innerText||t.textContent},BE=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&PE(t)},zE=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},PE=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return NE(t)}return!1}(t)&&!AE(t)},LE=function(t){return zE(t)&&PE(t)},IE=function(t){var e=function(t){return t.id?t.id:oa("h")}(t);return DE("header",ME(t),"#"+e,function(t){return zE(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},HE=function(t){var e=t.id||t.name,n=ME(t);return DE("anchor",n||"#"+e,"#"+e,0,h)},FE=function(t){var e,n;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,U(ol(Bt.fromDom(n),e),(function(t){return t.dom}))},VE=function(t){return _E(t.title).length>0},jE=function(t){var e=FE(t);return $(function(t){return U($(t,LE),IE)}(e).concat(function(t){return U($(t,BE),HE)}(e)),VE)},UE="tinymce-url-history",WE=function(t){return o(t)&&/^https?/.test(t)},qE=function(t){return i(t)&&vt(t,(function(t){return!(a(e=t)&&e.length<=5&&Z(e,WE));var e})).isNone()},$E=function(){var t,e=qy.getItem(UE);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+UE+" was not valid JSON",t),{};throw t}return qE(t)?t:(console.log("Local storage "+UE+" was not valid format",t),{})},GE=function(t){var e=$E();return yt(e,t).getOr([])},KE=function(t,e){if(WE(t)){var n=$E(),r=yt(n,e).getOr([]),o=$(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!qE(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));qy.setItem(UE,JSON.stringify(t))}(n)}},XE=function(t){return!!t},YE=function(t){return mt(yk.makeMap(t,/[, ]/),XE)},JE=function(t){return B.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(d)},QE=function(t,e){var n=function(t){var e=B.some(function(t){return t.getParam("file_picker_types")}(t)).filter(XE),n=B.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(XE),r=e.or(n).map(YE);return JE(t).fold(S,(function(t){return r.fold(k,(function(t){return lt(t).length>0&&t}))}))}(t);return c(n)?n?JE(t):B.none():n[e]?JE(t):B.none()},ZE=function(t){return B.from(t).filter(o).getOrUndefined()},t_=function(t){return{getHistory:GE,addToHistory:KE,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?B.none():B.some({targets:jE(t.getBody()),anchorTop:ZE(Hb(t)),anchorBottom:ZE(Fb(t))})}(t)},getValidationHandler:function(){return function(t){return B.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return QE(t,e).map((function(n){return function(r){return Ex((function(a){var u=O({filetype:e,fieldname:r.fieldname},B.from(r.meta).getOr({}));n.call(t,(function(t,e){if(!o(t))throw new Error("Expected value to be string");if(void 0!==e&&!i(e))throw new Error("Expected meta to be a object");a({value:t,meta:e})}),r.value,u)}))}}))}(t,e)}}},e_=function(t,e,n){var r=xo(!1),o=function(t){var e=xo(Ab(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:bp.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return cE(aE,t,e)}(t,i)},anchors:gE(e,n,o.isPositionedAtTop),header:o,getSink:function(){return Wn.value(t)}},urlinput:t_(e),styleselect:EE(e),colorinput:yE(e),dialog:xE(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},n_=kd,r_=ud,o_=v([fo("shell",!1),Xr("makeItem"),fo("setupItem",h),Nf("listBehaviours",[ah])]),i_=od({name:"items",overrides:function(){return{behaviours:xc([ah.config({})])}}}),a_=v([i_]),u_=v("CustomList"),c_=Ad({name:u_(),configFields:o_(),partFields:a_(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[ah.config({})],components:[]}:{behaviours:[],components:e},i=function(e){return t.shell?B.some(e):pd(e,t,"items")};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:Rf(t.listBehaviours,o.behaviours),apis:{setItems:function(e,n){i(e).fold((function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(function(r){var o=ah.contents(r),i=n.length,a=i-o.length,u=a>0?V(a,(function(){return t.makeItem()})):[],c=o.slice(i);W(c,(function(t){return ah.remove(r,t)})),W(u,(function(t){return ah.append(r,t)}));var s=ah.contents(r);W(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),s_=v([Xr("dom"),fo("shell",!0),Ef("toolbarBehaviours",[ah])]),l_=v([od({name:"groups",overrides:function(){return{behaviours:xc([ah.config({})])}}})]),f_=Ad({name:"Toolbar",configFields:s_(),partFields:l_(),factory:function(t,e,n,r){var o=function(e){return t.shell?B.some(e):pd(e,t,"groups")},i=t.shell?{behaviours:[ah.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:Rf(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,e){o(t).fold((function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(function(t){ah.set(t,e)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),d_=h,m_=S,g_=v([]),h_=Object.freeze({__proto__:null,setup:d_,isDocked:m_,getBehaviours:g_}),p_=function(t){return(Ct(nn(t,"position"),"fixed")?B.none():Ee(t)).orThunk((function(){var e=Bt.fromTag("span");return Oe(t).bind((function(t){On(t,e);var n=Ee(e);return Rn(e),n}))}))},v_=function(t){return p_(t).map(hn).getOrThunk((function(){return mn(0,0)}))},b_=Co([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),y_=function(t,e){var n=t.element;La(n,e.transitionClass),Ha(n,e.fadeOutClass),La(n,e.fadeInClass),e.onShow(t)},w_=function(t,e){var n=t.element;La(n,e.transitionClass),Ha(n,e.fadeInClass),La(n,e.fadeOutClass),e.onHide(t)},x_=function(t,e,n){return Z(t,(function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}}))},C_=function(t,e){return e.getInitialPos().map((function(e){return In(e.bounds.x,e.bounds.y,bn(t),ln(t))}))},S_=function(t,e,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return B.some(b_.static());case"absolute":var o=p_(t).map(Hn).getOrThunk((function(){return Hn(Ve())}));return B.some(b_.absolute(zc("absolute",yt(r.style,"left").map((function(t){return e.x-o.x})),yt(r.style,"top").map((function(t){return e.y-o.y})),yt(r.style,"right").map((function(t){return o.right-e.right})),yt(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return B.none()}}))},k_=function(t,e,n){var r=Hn(t);if(x_(n.getModes(),r,e))return B.none();!function(t,e,n){n.setInitialPos({style:rn(t),position:tn(t,"position")||"static",bounds:e})}(t,r,n);var o=Vn(),i=r.x-o.x,a=e.y-o.y,u=o.bottom-e.bottom,c=r.y<=e.y;return B.some(b_.fixed(zc("fixed",B.some(i),c?B.some(a):B.none(),B.none(),c?B.none():B.some(u))))},T_=function(t,e,n){var r=t.element;return Ct(nn(r,"position"),"fixed")?function(t,e,n){return C_(t,n).filter((function(t){return x_(n.getModes(),t,e)})).bind((function(e){return S_(t,e,n)}))}(r,e,n):k_(r,e,n)},O_=function(t,e,n){n.setDocked(!1),W(["left","right","top","bottom","position"],(function(e){return an(t.element,e)})),e.onUndocked(t)},E_=function(t,e,n,r){var o="fixed"===r.position;n.setDocked(o),Pc(t.element,r),(o?e.onDocked:e.onUndocked)(t)},__=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var a=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);a!==n.isVisible()&&(n.setVisible(a),o&&!a?(Va(t.element,[e.fadeOutClass]),e.onHide(t)):(a?y_:w_)(t,e))}))}))},R_=function(t,e,n){var r=t.element;n.setDocked(!1),function(t,e){var n=t.element;return C_(n,e).bind((function(t){return S_(n,t,e)}))}(t,n).each((function(r){r.fold((function(){return O_(t,e,n)}),(function(r){return E_(t,e,n,r)}),h)})),n.setVisible(!0),e.contextual.each((function(e){ja(r,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),N_(t,e,n)},N_=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t);n.isDocked()&&__(t,e,n,r),T_(t,r,n).each((function(o){o.fold((function(){return O_(t,e,n)}),(function(r){return E_(t,e,n,r)}),(function(o){__(t,e,n,r,!0),E_(t,e,n,o)}))}))}(t,e,n)},A_=function(t,e,n){n.isDocked()&&R_(t,e,n)},D_=Object.freeze({__proto__:null,refresh:N_,reset:A_,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),M_=Object.freeze({__proto__:null,events:function(t,e){return zi([qi(Zo(),(function(n,r){t.contextual.each((function(t){Fa(n.element,t.transitionClass)&&(ja(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n));r.stop()}))})),Ii(vi(),(function(n,r){N_(n,t,e)})),Ii(bi(),(function(n,r){A_(n,t,e)}))])}}),B_=[lo("contextual",[Qr("fadeInClass"),Qr("fadeOutClass"),Qr("transitionClass"),to("lazyContext"),_u("onShow"),_u("onShown"),_u("onHide"),_u("onHidden")]),bo("lazyViewport",Vn),yo("modes",["top","bottom"],Dr),_u("onDocked"),_u("onUndocked")],z_=Sc({fields:B_,name:"docking",active:M_,apis:D_,state:Object.freeze({__proto__:null,init:function(t){var e=xo(!1),n=xo(!0),r=Zc(),o=xo(t.modes);return xa({isDocked:e.get,setDocked:e.set,getInitialPos:r.get,setInitialPos:r.set,clearInitialPos:r.clear,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}})}),P_=v(oa("toolbar-height-change")),L_={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},I_="tox-tinymce--toolbar-sticky-on",H_="tox-tinymce--toolbar-sticky-off",F_=function(t,e){return H(z_.getModes(t),e)},V_=function(t){var e=t.element;Oe(e).each((function(n){var r="padding-"+z_.getModes(t)[0];if(z_.isDocked(t)){var o=bn(n);Je(e,"width",o+"px"),Je(n,r,function(t){return fn(t)+(parseInt(tn(t,"margin-top"),10)||0)+(parseInt(tn(t,"margin-bottom"),10)||0)}(e)+"px")}else an(e,"width"),an(n,r)}))},j_=function(t,e){e?(Ha(t,L_.fadeOutClass),Va(t,[L_.transitionClass,L_.fadeInClass])):(Ha(t,L_.fadeInClass),Va(t,[L_.fadeOutClass,L_.transitionClass]))},U_=function(t,e){var n=Bt.fromDom(t.getContainer());e?(La(n,I_),Ha(n,H_)):(La(n,H_),Ha(n,I_))},W_=function(t,e){var n=Zc(),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||V_(e),U_(t,z_.isDocked(e)),e.getSystem().broadcastOn([cf()],{}),r().each((function(t){return t.getSystem().broadcastOn([cf()],{})}))},a=t.inline?[]:function(){var t;return[Ec.config({channels:(t={},t[P_()]={onReceive:V_},t)})]}();return _([dh.config({}),z_.config({contextual:O({lazyContext:function(e){var n=fn(e.element),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=Hn(Bt.fromDom(r)),i=o.height-n,a=o.y+(F_(e,"top")?0:n);return B.some(In(o.x,a,o.width,i))},onShow:function(){o((function(t){return j_(t,!0)}))},onShown:function(t){o((function(t){return ja(t,[L_.transitionClass,L_.fadeInClass])})),n.get().each((function(e){var r,o,i;r=t.element,i=Ce(o=e),Dc(i).filter((function(t){return!ye(o,t)})).filter((function(t){return ye(t,Bt.fromDom(i.dom.body))||xe(r,t)})).each((function(){return Nc(o)})),n.clear()}))},onHide:function(t){(function(t,e){return Mc(t).orThunk((function(){return e().toOptional().bind((function(t){return Mc(t.element)}))}))})(t.element,r).fold(n.clear,n.set),o((function(t){return j_(t,!1)}))},onHidden:function(){o((function(t){return ja(t,[L_.transitionClass])}))}},L_),lazyViewport:function(e){var n=Vn(),r=function(t){return t.getParam("toolbar_sticky_offset",0,"number")}(t),o=n.y+(F_(e,"top")?r:0),i=n.height-(F_(e,"bottom")?r:0);return In(n.x,o,n.width,i)},modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],a,!0)},q_=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(z_.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(V_)})),t.on("SkinLoaded",(function(){n().each((function(t){z_.isDocked(t)?z_.reset(t):z_.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(z_.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){z_.refresh(e);var n=e.element;Xm(n)&&function(t,e){var n=Ce(e),r=n.dom.defaultView.innerHeight,o=An(n),i=Bt.fromDom(t.elm),a=Fn(i),u=ln(i),c=a.y,s=c+u,l=hn(e),f=ln(e),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,h=Math.abs(m-(o.top+r))<2;if(g&&c<m)Dn(o.left,c-f,n);else if(h&&s>d){var p=c-r+u+f;Dn(o.left,p,n)}}(t,n)}))})),t.on("PostRender",(function(){U_(t,!1)}))},isDocked:function(t){return t().map(z_.isDocked).getOr(!1)},getBehaviours:W_}),$_=kr([Qr("type"),Yr("items",Or([_r([Qr("name"),ro("items",Dr)]),Dr]))].concat(Zp)),G_=[uo("text"),uo("tooltip"),uo("icon"),to("fetch"),bo("onSetup",(function(){return h}))],K_=kr(_([Qr("type")],G_,!0)),X_=function(t){return Vr("menubutton",K_,t)},Y_=kr([Qr("type"),uo("tooltip"),uo("icon"),uo("text"),co("select"),to("fetch"),bo("onSetup",(function(){return h})),po("presets","normal",["normal","color","listpreview"]),fo("columns",1),to("onAction"),to("onItemAction")]),J_=Nd({factory:function(t,e){var n={focus:eh.focusIn,setMenus:function(t,n){var r=U(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=X_(n).mapError((function(t){return Wr(t)})).getOrDie();return FT(r,"tox-mbtn",e.backstage,B.some("menuitem"))}));ah.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:xc([ah.config({}),uh("menubar-events",[$i((function(e){t.onSetup(e)})),Ii(Wo(),(function(t,e){lu(t.element,".tox-mbtn--active").each((function(n){fu(e.event.target,".tox-mbtn").each((function(e){ye(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){iC.expand(t),iC.close(n),dh.focus(t)}))}))}))}))})),Ii(Si(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){iC.isOpen(n)&&(iC.expand(t),iC.close(n))}))}))}))]),eh.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),B.some(!0)}}),Qw.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Xr("dom"),Xr("uid"),Xr("onEscape"),Xr("backstage"),fo("onSetup",h)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),Q_=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},Z_=function(t){return t.dimension.property},tR=function(t,e){return t.dimension.getDimension(e)},eR=function(t,e){var n=Q_(t,e);ja(n,[e.shrinkingClass,e.growingClass])},nR=function(t,e){Ha(t.element,e.openClass),La(t.element,e.closedClass),Je(t.element,Z_(e),"0px"),un(t.element)},rR=function(t,e){Ha(t.element,e.closedClass),La(t.element,e.openClass),an(t.element,Z_(e))},oR=function(t,e,n,r){n.setCollapsed(),Je(t.element,Z_(e),tR(e,t.element)),un(t.element),eR(t,e),nR(t,e),e.onStartShrink(t),e.onShrunk(t)},iR=function(t,e,n,r){var o=r.getOrThunk((function(){return tR(e,t.element)}));n.setCollapsed(),Je(t.element,Z_(e),o),un(t.element);var i=Q_(t,e);Ha(i,e.growingClass),La(i,e.shrinkingClass),nR(t,e),e.onStartShrink(t)},aR=function(t,e,n){var r=tR(e,t.element);("0px"===r?oR:iR)(t,e,n,B.some(r))},uR=function(t,e,n){var r=Q_(t,e),o=Fa(r,e.shrinkingClass),i=tR(e,t.element);rR(t,e);var a=tR(e,t.element);(o?function(){Je(t.element,Z_(e),i),un(t.element)}:function(){nR(t,e)})(),Ha(r,e.shrinkingClass),La(r,e.growingClass),rR(t,e),Je(t.element,Z_(e),a),n.setExpanded(),e.onStartGrow(t)},cR=function(t,e,n){var r=Q_(t,e);return!0===Fa(r,e.growingClass)},sR=function(t,e,n){var r=Q_(t,e);return!0===Fa(r,e.shrinkingClass)},lR=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){an(t.element,Z_(e));var r=tR(e,t.element);Je(t.element,Z_(e),r)}},grow:function(t,e,n){n.isExpanded()||uR(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&aR(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&oR(t,e,n)},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:cR,isShrinking:sR,isTransitioning:function(t,e,n){return cR(t,e)||sR(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?aR:uR)(t,e,n)},disableTransitions:eR}),fR=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return Sa(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:To(e.dimension.property,"0px")})},events:function(t,e){return zi([qi(Zo(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(eR(n,t),e.isExpanded()&&an(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),dR=[Xr("closedClass"),Xr("openClass"),Xr("shrinkingClass"),Xr("growingClass"),oo("getAnimationRoot"),_u("onShrunk"),_u("onStartShrink"),_u("onGrown"),_u("onStartGrow"),fo("expanded",!1),Yr("dimension",qr("property",{width:[Du("property","width"),Du("getDimension",(function(t){return bn(t)+"px"}))],height:[Du("property","height"),Du("getDimension",(function(t){return ln(t)+"px"}))]}))],mR=Sc({fields:dR,name:"sliding",active:fR,apis:lR,state:Object.freeze({__proto__:null,init:function(t){var e=xo(t.expanded);return xa({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:w(e.set,!1),setExpanded:w(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),gR="container",hR=[Ef("slotBehaviours",[])],pR=function(t){return"<alloy.field."+t+">"},vR=function(t,e){var n,r=function(e){return wd(t)},o=function(e,n){return function(r,o){return pd(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==qe(t.element,"aria-hidden")},a=o(i,!1),u=o((function(t,e){if(i(t)){var n=t.element;Je(n,"display","none"),We(n,"aria-hidden","true"),Ni(t,ki(),{name:e,visible:!1})}})),c=(n=u,function(t,e){W(e,(function(e){return n(t,e)}))}),s=o((function(t,e){if(!i(t)){var n=t.element;an(n,"display"),Ke(n,"aria-hidden"),Ni(t,ki(),{name:e,visible:!0})}})),l={getSlotNames:r,getSlot:function(e,n){return pd(e,t,n)},isShowing:a,hideSlot:u,hideAllSlots:function(t){return c(t,r())},showSlot:s};return{uid:t.uid,dom:t.dom,components:e,behaviours:_f(t.slotBehaviours),apis:l}},bR=mt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return ya(t)})),yR=O(O({},bR),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),fd(gR,pR(e),n)},record:v(t)}}(),n=t(e),r=e.record(),o=U(r,(function(t){return nd({name:t,pname:pR(t)})}));return Od(gR,hR,o,vR,n)}}),wR=kr([uo("icon"),uo("tooltip"),bo("onShow",h),bo("onHide",h),bo("onSetup",(function(){return h}))]),xR=function(t){return{element:function(){return t.element.dom}}},CR=function(t,e){var n=U(lt(e),(function(t){var n=e[t],r=jr(function(t){return Vr("sidebar",wR,t)}(n));return{name:t,getApi:xR,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return U(n,(function(e){var r=xo(h);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:ib([Jb(e,r),Qb(e,r),Ii(ki(),(function(t,e){var r=e.event;X(n,(function(t){return t.name===r.name})).each((function(e){(r.visible?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},SR=function(t){return yR.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:CR(e,t),slotBehaviours:ib([$i((function(t){return yR.hideAllSlots(t)}))])}}))},kR=function(t){return zd.getCurrent(t).bind((function(t){return mR.isGrowing(t)||mR.hasGrown(t)?zd.getCurrent(t).bind((function(t){return X(yR.getSlotNames(t),(function(e){return yR.isShowing(t,e)}))})):B.none()}))},TR=oa("FixSizeEvent"),OR=oa("AutoSizeEvent"),ER=Object.freeze({__proto__:null,block:function(t,e,n,r){We(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=xc([eh.config({mode:"special",onTab:function(){return B.some(!0)},onShiftTab:function(){return B.some(!0)}}),dh.config({})]),a=r(o,i),u=o.getSystem().build(a);ah.append(o,nu(u)),u.hasConfigured(eh)&&e.focus&&eh.focusIn(u),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return ah.remove(o,u)}))},unblock:function(t,e,n){Ke(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),_R=[bo("getRoot",B.none),vo("focus",!0),_u("onBlock"),_u("onUnblock")],RR=Sc({fields:_R,name:"blocking",apis:ER,state:Object.freeze({__proto__:null,init:function(){var t=Jc((function(t){return t.destroy()}));return xa({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),NR=function(t){var e=Bt.fromHtml(t),n=_e(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return K(e,(function(t,e){var n;return"class"===e.name?t:O(O({},t),((n={})[e.name]=e.value,n))}),{})}(e),o=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(e),i=0===n.length?{}:{innerHtml:Yi(e)};return O({tag:Pt(e),classes:o,attributes:r},i)},AR=function(t){return zd.getCurrent(t).each((function(t){return Nc(t.element)}))},DR=function(t,e,n,r){var o=e.element;if(function(t,e){var n="tabindex",r="data-mce-tabindex";B.from(t.iframeElement).map(Bt.fromDom).each((function(t){e?($e(t,n).each((function(e){return We(t,r,e)})),We(t,n,-1)):(Ke(t,n),$e(t,r).each((function(e){We(t,n,e),Ke(t,r)})))}))}(t,n),n)RR.block(e,function(t){return function(e,n){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:NR('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}}(r)),an(o,"display"),Ke(o,"aria-hidden"),t.hasFocus()&&AR(e);else{var i=zd.getCurrent(e).exists((function(t){return Ac(t.element)}));RR.unblock(e),Je(o,"display","none"),We(o,"aria-hidden","true"),i&&t.focus()}},MR=function(t,e,n){var r=xo(!1),o=Zc(),i=function(n){var o;!r.get()||function(t){return"focusin"===t.type}(o=n)&&(o.composed?at(o.composedPath()):B.from(o.target)).map(Bt.fromDom).filter(It).exists((function(t){return Fa(t,"mce-pastebin")}))||(n.preventDefault(),AR(e()),t.editorManager.setActive(t))};t.inline||t.on("PreInit",(function(){t.dom.bind(t.getWin(),"focusin",i),t.on("BeforeExecCommand",(function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&i(t)}))}));var a=function(o){o!==r.get()&&(r.set(o),DR(t,e(),o,n.providers),t.fire("AfterProgressState",{state:o}))};t.on("ProgressState",(function(e){if(o.on(hp.clearTimeout),m(e.time)){var n=hp.setEditorTimeout(t,(function(){return a(e.state)}),e.time);o.set(n)}else a(e.state),o.clear()}))},BR=function(t,e,n){return{within:t,extra:e,withinWidth:n}},zR=function(t,e,n){var r,o=(r=function(t,e){var r=n(t);return B.some({element:t,start:e,finish:e+r,width:r})},K(t,(function(t,e){return r(e,t.len).fold(v(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),{len:0,list:[]}).list),i=$(o,(function(t){return t.finish<=e})),a=G(i,(function(t,e){return t+e.width}),0);return{within:i,extra:o.slice(i.length),withinWidth:a}},PR=function(t){return U(t,(function(t){return t.element}))},LR=function(t,e,n,r){var o=function(t,e,n){var r=zR(e,t,n);return 0===r.extra.length?B.some(r):B.none()}(t,e,n).getOrThunk((function(){return zR(e,t-n(r),n)})),i=o.within,a=o.extra,u=o.withinWidth;return 1===a.length&&a[0].width<=n(r)?function(t,e,n){var r=PR(t.concat(e));return BR(r,[],n)}(i,a,u):a.length>=1?function(t,e,n,r){var o=PR(t).concat([n]);return BR(o,PR(e),r)}(i,a,r,u):function(t,e,n){return BR(PR(t),[],n)}(i,0,u)},IR=function(t,e){var n=U(e,(function(t){return nu(t)}));f_.setGroups(t,n)},HR=function(t,e,n){var r=e.builtGroups.get();if(0!==r.length){var o=vd(t,e,"primary"),i=Vx.getCoupled(t,"overflowGroup");Je(o.element,"visibility","hidden");var a=r.concat([i]),u=st(a,(function(t){return Mc(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}));n([]),IR(o,a);var c=bn(o.element),s=LR(c,e.builtGroups.get(),(function(t){return bn(t.element)}),i);0===s.extra.length?(ah.remove(o,i),n([])):(IR(o,s.within),n(s.extra)),an(o.element,"visibility"),un(o.element),u.each(dh.focus)}},FR=v([Ef("splitToolbarBehaviours",[Vx]),Gr("builtGroups",(function(){return xo([])}))]),VR=v([Ou(["overflowToggledClass"]),co("getOverflowBounds"),Xr("lazySink"),Gr("overflowGroups",(function(){return xo([])}))].concat(FR())),jR=v([nd({factory:f_,schema:s_(),name:"primary"}),rd({schema:s_(),name:"overflow"}),rd({name:"overflow-button"}),rd({name:"overflow-group"})]),UR=v((function(t,e){!function(t,e){var n=vn.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Je(t,"max-width",n+"px")}(t,Math.floor(e))})),WR=v([Ou(["toggledClass"]),Xr("lazySink"),to("fetch"),co("getBounds"),lo("fireDismissalEventInstead",[fo("event",xi())]),Ts()]),qR=v([rd({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:xc([kh.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),rd({factory:f_,schema:s_(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:xc([eh.config({mode:"cyclic",onEscape:function(e){return pd(e,t,"button").each(dh.focus),B.none()}})])}}})]),$R=function(t,e){var n=Vx.getCoupled(t,"toolbarSandbox");af.isOpen(n)?af.close(n):af.open(n,e.toolbar())},GR=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Ll.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:UR()}}},o)},KR=function(t,e,n,r,o){f_.setGroups(e,o),GR(t,e,n,r),kh.on(t)},XR=Ad({name:"FloatingToolbarButton",factory:function(t,e,n,r){return O(O({},pp.sketch(O(O({},r.button()),{action:function(t){$R(t,r)},buttonBehaviours:Af({dump:r.button().buttonBehaviours},[Vx.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=du();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:xc([eh.config({mode:"special",onEscape:function(t){return af.close(t),B.some(!0)}}),af.config({onOpen:function(o,i){n.fetch().get((function(o){KR(t,i,n,e.layouts,o),r.link(t.element),eh.focusIn(i)}))},onClose:function(){kh.off(t),dh.focus(t),r.unlink(t.element)},isPartOf:function(e,n,r){return gu(n,r)||gu(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),Ec.config({channels:O(O({},ff(O({isExtraPart:S},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),mf({doReposition:function(){af.getState(Vx.getCoupled(t,"toolbarSandbox")).each((function(r){GR(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){af.getState(Vx.getCoupled(e,"toolbarSandbox")).each((function(o){KR(e,o,t,n.layouts,r)}))},reposition:function(e){af.getState(Vx.getCoupled(e,"toolbarSandbox")).each((function(r){GR(e,r,t,n.layouts)}))},toggle:function(t){$R(t,r)},getToolbar:function(t){return af.getState(Vx.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return af.isOpen(Vx.getCoupled(t,"toolbarSandbox"))}}})},configFields:WR(),partFields:qR(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),YR=v([Xr("items"),Ou(["itemSelector"]),Ef("tgroupBehaviours",[eh])]),JR=v([id({name:"items",unit:"item"})]),QR=Ad({name:"ToolbarGroup",configFields:YR(),partFields:JR(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.tgroupBehaviours,[eh.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),ZR=function(t){return U(t,(function(t){return nu(t)}))},tN=function(t,e,n){HR(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){XR.setGroups(t,ZR(r))}))}))},eN=Ad({name:"SplitFloatingToolbar",configFields:VR(),partFields:jR(),factory:function(t,e,n,r){var o=vp(XR.sketch({fetch:function(){return Ex((function(e){e(ZR(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[nc,ec]},onRtl:function(){return[ec,nc]},onBottomLtr:function(){return[oc,rc]},onBottomRtl:function(){return[rc,oc]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.splitToolbarBehaviours,[Vx.config({others:{overflowGroup:function(){return QR.sketch(O(O({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(U(n,e.getSystem().build)),tN(e,o,t)},refresh:function(e){return tN(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){XR.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(XR.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){XR.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(XR.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),nN=v([Ou(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),_u("onOpened"),_u("onClosed")].concat(FR())),rN=v([nd({factory:f_,schema:s_(),name:"primary"}),nd({factory:f_,schema:s_(),name:"overflow",overrides:function(t){return{toolbarBehaviours:xc([mR.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){pd(e,t,"overflow-button").each((function(t){kh.off(t),dh.focus(t)})),t.onClosed(e)},onGrown:function(e){eh.focusIn(e),t.onOpened(e)},onStartGrow:function(e){pd(e,t,"overflow-button").each(kh.on)}}),eh.config({mode:"acyclic",onEscape:function(e){return pd(e,t,"overflow-button").each(dh.focus),B.some(!0)}})])}}}),rd({name:"overflow-button",overrides:function(t){return{buttonBehaviours:xc([kh.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),rd({name:"overflow-group"})]),oN=function(t,e){pd(t,e,"overflow-button").bind((function(){return pd(t,e,"overflow")})).each((function(n){iN(t,e),mR.toggleGrow(n)}))},iN=function(t,e){pd(t,e,"overflow").each((function(n){HR(t,e,(function(t){var e=U(t,(function(t){return nu(t)}));f_.setGroups(n,e)})),pd(t,e,"overflow-button").each((function(t){mR.hasGrown(n)&&kh.on(t)})),mR.refresh(n)}))},aN=Ad({name:"SplitSlidingToolbar",configFields:nN(),partFields:rN(),factory:function(t,e,n,r){var o="alloy.toolbar.toggle";return{uid:t.uid,dom:t.dom,components:e,behaviours:Rf(t.splitToolbarBehaviours,[Vx.config({others:{overflowGroup:function(t){return QR.sketch(O(O({},r["overflow-group"]()),{items:[pp.sketch(O(O({},r["overflow-button"]()),{action:function(e){Ri(t,o)}}))]}))}}}),uh("toolbar-toggle-events",[Ii(o,(function(e){oN(e,t)}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=U(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),iN(e,t)},refresh:function(e){return iN(e,t)},toggle:function(e){return oN(e,t)},isOpen:function(e){return function(t,e){return pd(t,e,"overflow").map(mR.hasGrown).getOr(!1)}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),uN=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:O({tag:"div",classes:["tox-toolbar__group"]},e),components:[QR.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:xc([Qw.config({}),dh.config({})])}},cN=function(t){return QR.sketch(uN(t))},sN=function(t,e){var n=$i((function(e){var n=U(t.initGroups,cN);f_.setGroups(e,n)}));return xc([Xb(t.providers.isDisabled),qb(),eh.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),uh("toolbar-events",[n])])},lN=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":uN({title:B.none(),items:[]}),"overflow-button":UT({name:"more",icon:B.some("more-drawer"),disabled:!1,tooltip:B.some("More..."),primary:!1,borderless:!1},B.none(),t.providers)},splitToolbarBehaviours:sN(t,e)}},fN=function(t){var e=lN(t),n=eN.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return eN.sketch(O(O({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=Fn(e),r=ke(e),o=Fn(r),i=Math.max(r.dom.scrollHeight,o.height);return In(n.x+4,o.y,n.width-8,i)},parts:O(O({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},dN=function(t){var e=aN.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=aN.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=lN(t);return aN.sketch(O(O({},r),{components:[e,n],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([P_()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([P_()],{type:"closed"})}}))},mN=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return f_.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===gv.scrolling?["tox-toolbar--scrolling"]:[])},components:[f_.parts.groups({})],toolbarBehaviours:sN(t,e)})},gN=r_.optional({factory:J_,name:"menubar",schema:[Xr("backstage")]}),hN=r_.optional({factory:{sketch:function(t){return c_.sketch({uid:t.uid,dom:t.dom,listBehaviours:xc([eh.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return mN({type:t.type,uid:oa("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),B.some(!0)}})},setupItem:function(t,e,n,r){f_.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Xr("dom"),Xr("onEscape")]}),pN=r_.optional({factory:{sketch:function(t){return function(t){return t.type===gv.sliding?dN:t.type===gv.floating?fN:mN}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),B.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[Xr("dom"),Xr("onEscape"),Xr("getSink")]}),vN=r_.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?W_:g_;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:xc(n(e,t.sharedBackstage))}}},name:"header",schema:[Xr("dom")]}),bN=r_.optional({name:"socket",schema:[Xr("dom")]}),yN=r_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:xc([Qw.config({}),dh.config({}),mR.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){zd.getCurrent(t).each(yR.hideAllSlots),Ri(t,OR)},onGrown:function(t){Ri(t,OR)},onStartGrow:function(t){Ni(t,TR,{width:nn(t.element,"width").getOr("")})},onStartShrink:function(t){Ni(t,TR,{width:bn(t.element)+"px"})}}),ah.config({}),zd.config({find:function(t){var e=ah.contents(t);return at(e)}})])}],behaviours:xc([hk(0),uh("sidebar-sliding-events",[Ii(TR,(function(t,e){Je(t.element,"width",e.event.width)})),Ii(OR,(function(t,e){an(t.element,"width")}))])])}}},name:"sidebar",schema:[Xr("dom")]}),wN=r_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:xc([ah.config({}),RR.config({focus:!1}),zd.config({find:function(t){return at(t.components())}})]),components:[]}}},name:"throbber",schema:[Xr("dom")]}),xN=Ad({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return n_.getPart(e,t,"socket")},setSidebar:function(e,n){n_.getPart(e,t,"sidebar").each((function(t){return function(t,e){zd.getCurrent(t).each((function(t){return ah.set(t,[SR(e)])}))}(t,n)}))},toggleSidebar:function(e,n){n_.getPart(e,t,"sidebar").each((function(t){return function(t,e){zd.getCurrent(t).each((function(t){zd.getCurrent(t).each((function(n){mR.hasGrown(t)?yR.isShowing(n,e)?mR.shrink(t):(yR.hideAllSlots(n),yR.showSlot(n,e)):(yR.hideAllSlots(n),yR.showSlot(n,e),mR.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return n_.getPart(e,t,"sidebar").bind(kR).getOrNull()},getHeader:function(e){return n_.getPart(e,t,"header")},getToolbar:function(e){return n_.getPart(e,t,"toolbar")},setToolbar:function(e,n){n_.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){n_.getPart(e,t,"multiple-toolbar").each((function(t){c_.setItems(t,n)}))},refreshToolbar:function(e){n_.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){n_.getPart(e,t,"toolbar").each((function(t){var e,n;e=t.getApis().toggle,n=function(e){return e(t)},null!=e?B.some(n(e)):B.none()}))},isToolbarDrawerToggled:function(e){return n_.getPart(e,t,"toolbar").bind((function(t){return B.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return n_.getPart(e,t,"throbber")},focusToolbar:function(e){n_.getPart(e,t,"toolbar").orThunk((function(){return n_.getPart(e,t,"multiple-toolbar")})).each((function(t){eh.focusIn(t)}))},setMenubar:function(e,n){n_.getPart(e,t,"menubar").each((function(t){J_.setMenus(t,n)}))},focusMenubar:function(e){n_.getPart(e,t,"menubar").each((function(t){J_.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[Xr("dom"),Xr("behaviours")],partFields:[vN,gN,pN,hN,bN,yN,wN],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=U(n,(function(t){return cN(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=U(n,(function(t){return U(t,cN)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),CN={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},SN=function(t){return"string"==typeof t?t.split(" "):t},kN=function(t,e){var n=O(O({},CN),e.menus),r=lt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?SN("file edit view insert format tools table help"):SN(!1===e.menubar?"":e.menubar),i=$(o,(function(t){var n=wt(CN,t);return r?n||yt(e.menus,t).exists((function(t){return wt(t,"items")})):n})),a=U(i,(function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return Q(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||F(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:SN(o.items)},e,t)}));return $(a,(function(t){return t.getItems().length>0&&F(t.getItems(),(function(t){return"separator"!==t.type}))}))},TN=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},ON=function(t,e,n){return new Up((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},EN=function(t,e){return ON(t,e+"/skin.min.css",t.ui.styleSheetLoader)},_N=function(t,e){var n;return(n=Bt.fromDom(t.getElement()),Le(n).isSome())?ON(t,e+"/skin.shadowdom.min.css",gb.DOM.styleSheetLoader):Up.resolve()},RN=function(t,e){var n=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):hb.baseURL+"/skins/ui/"+r}return n}(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===function(t){return!1===t.getParam("skin")}(e)&&o(n)?Up.all([EN(e,n),_N(e,n)]).then(TN(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:e})}}(e,"Skin could not be loaded")):TN(e)()},NN=w(RN,!1),AN=w(RN,!0),DN=function(t,e){return function(n){var r=Qc(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.once("init",o),function(){t.off("init",o),r.clear()}}},MN=function(t,e,n){return function(r){var o=function(){return n(r)},i=function(){n(r),t.on(e,o)};return t.initialized?i():t.once("init",i),function(){t.off("init",i),t.off(e,o)}}},BN=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},zN=function(t,e){return function(){return t.execCommand(e)}},PN=function(t,e,n){var r=function(t,r,i,a){var u=e.shared.providers.translate(t.title);if("separator"===t.type)return B.some({type:"separator",text:u});if("submenu"===t.type){var c=Q(t.getStyleItems(),(function(t){return o(t,r,a)}));return 0===r&&c.length<=0?B.none():B.some({type:"nestedmenuitem",text:u,disabled:c.length<=0,getSubmenuItems:function(){return Q(t.getStyleItems(),(function(t){return o(t,r,a)}))}})}return B.some(O({type:"togglemenuitem",text:u,icon:t.icon,active:t.isSelected(a),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return Q(t,(function(t){return o(t,r,e)}))};return{validateItems:i,getFetch:function(t,e){return function(n,r){var o=e(),a=i(o);r(IT(a,hv.CLOSE_ON_EXECUTE,t,!1))}}}},LN=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return U(r.data,(function(t){return TE(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:PN(0,e,n),getStyleItems:o}},IN=function(t,e,n){var r=LN(0,e,n),o=r.items,i=r.getStyleItems,a=MN(t,"NodeChange",(function(t){var e=t.getComponent();n.updateText(e)}));return DT({text:n.icon.isSome()?B.none():n.text,icon:n.icon,tooltip:B.from(n.tooltip),role:B.none(),fetch:o.getFetch(e,i),onSetup:a,getApi:function(t){return{getComponent:v(t)}},columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(CO||(CO={}));var HN,FN,VN,jN,UN,WN=function(t,e,n,r){return{type:"basic",data:function(t){return U(t,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}}))}(function(t,e){return e===CO.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r))}},qN=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],$N=function(t){var e={type:"basic",data:qN};return{tooltip:"Align",text:B.none(),icon:B.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:B.none,getPreviewFor:function(t){return B.none},onAction:function(e){return function(){return X(qN,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},updateText:function(e){var n=X(qN,(function(e){return t.formatter.match(e.format)})).fold(v("left"),(function(t){return t.title.toLowerCase()}));Ni(e,AT,{icon:"align-"+n})},dataset:e,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},GN=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],KN=function(t){var e=t.split(/\s*,\s*/);return U(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},XN=function(t){var e="System Font",n=function(){var n=function(t){return t?KN(t)[0]:""},o=t.queryCommandValue("FontName"),i=r.data,a=o?o.toLowerCase():"";return{matchOpt:X(i,(function(t){var e=t.format;return e.toLowerCase()===a||n(e).toLowerCase()===n(a).toLowerCase()})).orThunk((function(){return Tt(function(t){var e;return 0===t.indexOf("-apple-system")&&(e=KN(t.toLowerCase()),Z(GN,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(a),{title:e,format:a})})),font:o}},r=WN(t,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",CO.SemiColon);return{tooltip:"Fonts",text:B.some(e),icon:B.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getCurrentValue:function(){return n().matchOpt},getPreviewFor:function(t){return function(){return B.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},updateText:function(t){var e=n(),r=e.matchOpt,o=e.font,i=r.fold(v(o),(function(t){return t.title}));Ni(t,NT,{text:i})},dataset:r,shouldHide:!1,isInvalid:S}},YN={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},JN={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},QN=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":yt(JN,t).getOr(t)},ZN=function(t){var e=function(){var e=B.none(),n=r.data,o=t.queryCommandValue("FontSize");if(o)for(var i=function(t){var r=QN(o,t),i=function(t){return yt(YN,t).getOr("")}(r);e=X(n,(function(t){return t.format===o||t.format===r||t.format===i}))},a=3;e.isNone()&&a>=0;a--)i(a);return{matchOpt:e,size:o}},n=v(B.none),r=WN(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",CO.Space);return{tooltip:"Font sizes",text:B.some("12pt"),icon:B.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},updateText:function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold(v(o),(function(t){return t.title}));Ni(t,NT,{text:i})},dataset:r,shouldHide:!1,isInvalid:S}},tA=function(t,e){var n=e(),r=U(n,(function(t){return t.format}));return B.from(t.formatter.closest(r)).bind((function(t){return X(n,(function(e){return e.format===t}))})).orThunk((function(){return Tt(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},eA=function(t){var e="Paragraph",n=WN(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",CO.SemiColon);return{tooltip:"Blocks",text:B.some(e),icon:B.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:B.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return B.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:BN(t),updateText:function(r){var o=tA(t,(function(){return n.data})).fold(v(e),(function(t){return t.title}));Ni(r,NT,{text:o})},dataset:n,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},nA=function(t,e){var n="Paragraph";return{tooltip:"Formats",text:B.some(n),icon:B.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:B.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?B.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):B.none()}},onAction:BN(t),updateText:function(e){var r=function(t){var e=t.items;return void 0!==e&&e.length>0?Q(e,r):[{title:t.title,format:t.format}]},o=Q(kE(t),r),i=tA(t,v(o)).fold(v(n),(function(t){return t.title}));Ni(e,NT,{text:i})},shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},rA=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=U(o,n.getSystem().build);Vl(n,i)}))};return zi([Ii(ui(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;H(o.channels,i)&&n(e,o.data)}})),$i((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),oA=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),iA=[Xr("channel"),oo("renderComponents"),oo("updateState"),oo("initialData")],aA=Object.freeze({__proto__:null,init:function(){var t=xo(B.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(B.none())}}}}),uA=Sc({fields:iA,name:"reflecting",active:rA,apis:oA,state:aA}),cA=v([Xr("toggleClass"),Xr("fetch"),Nu("onExecute"),fo("getHotspot",B.some),fo("getAnchorOverrides",v({})),Ts(),Nu("onItemExecute"),oo("lazySink"),Xr("dom"),_u("onOpen"),Ef("splitDropdownBehaviours",[Vx,eh,dh]),fo("matchWidth",!1),fo("useMinWidth",!1),fo("eventOrder",{}),oo("role")].concat(nC())),sA=nd({factory:pp,schema:[Xr("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:xc([dh.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(Ai)},buttonBehaviours:xc([kh.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),lA=nd({factory:pp,schema:[Xr("dom")],name:"button",defaults:function(){return{buttonBehaviours:xc([dh.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),fA=v([sA,lA,od({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Xr("text")],name:"aria-descriptor"}),rd({schema:[Tu()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),Ux()]),dA=Ad({name:"SplitDropdown",configFields:cA(),partFields:fA(),factory:function(t,e,n,r){var o,i=function(t){zd.getCurrent(t).each((function(t){am.highlightFirst(t),eh.focusIn(t)}))},a=function(e){Yx(t,b,e,r,i,xx.HighlightFirst).get(h)},u=function(e){var n=vd(e,t,"button");return Ai(n),B.some(!0)},c=O(O({},zi([$i((function(e,n){pd(e,t,"aria-descriptor").each((function(t){var n=oa("aria");We(t.element,"id",n),We(e.element,"aria-describedby",n)}))}))])),Oh(B.some(a))),s={repositionMenus:function(t){kh.isOn(t)&&eC(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:s,eventOrder:O(O({},t.eventOrder),(o={},o[ci()]=["disabling","toggling","alloy.base.behaviour"],o)),events:c,behaviours:Rf(t.splitDropdownBehaviours,[Vx.config({others:{sandbox:function(e){var n=vd(e,t,"arrow");return tC(t,e,{onOpen:function(){kh.on(n),kh.on(e)},onClose:function(){kh.off(n),kh.off(e)}})}}}),eh.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return a(t),B.some(!0)}}),dh.config({}),kh.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),mA=function(t){return{isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)}}},gA=function(t){return{setActive:function(e){kh.set(t,e)},isActive:function(){return kh.isOn(t)},isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)}}},hA=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},pA=oa("focus-button"),vA=function(t,e,n,r,o,i){var a;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:hA(n,i)},components:ey([t.map((function(t){return TT(t,i.icons)})),e.map((function(t){return ET(t,"tox-tbtn",i)}))]),eventOrder:(a={},a[Fo()]=["focusing","alloy.base.behaviour","common-button-display-events"],a),buttonBehaviours:xc([Xb(i.isDisabled),qb(),uh("common-button-display-events",[Ii(Fo(),(function(t,e){e.event.prevent(),Ri(t,pA)}))])].concat(r.map((function(n){return uA.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return ey([t.icon.map((function(t){return TT(t,i.icons)})),t.text.map((function(t){return ET(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},bA=function(t,e,n){var r,o=xo(h),i=vA(t.icon,t.text,t.tooltip,B.none(),B.none(),n);return pp.sketch({dom:i.dom,components:i.components,eventOrder:RT,buttonBehaviours:xc([uh("toolbar-button-events",[(r={onAction:t.onAction,getApi:e.getApi},Xi((function(t,e){Yb(r,t)((function(e){Ni(t,_T,{buttonApi:e}),r.onAction(e)}))}))),Jb(e,o),Qb(e,o)]),Xb((function(){return t.disabled||n.isDisabled()})),qb()].concat(e.toolbarButtonBehaviours))})},yA=function(t,e,n){return bA(t,{toolbarButtonBehaviours:[].concat(n.length>0?[uh("toolbarButtonWith",n)]:[]),getApi:mA,onSetup:t.onSetup},e)},wA=function(t,e,n){return ur(bA(t,{toolbarButtonBehaviours:[ah.config({}),kh.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[uh("toolbarToggleButtonWith",n)]:[]),getApi:gA,onSetup:t.onSetup},e))},xA=function(t,e,n){return function(r){return Ex((function(t){return e.fetch(t)})).map((function(o){return B.from(Rw(ur(sw(oa("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,hv.CLOSE_ON_EXECUTE,e.select.getOr(S),n),{movement:fw(e.columns,e.presets),menuBehaviours:ib("auto"!==e.columns?[]:[$i((function(t,n){rb(t,4,Ev(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;eh.setGridSize(t,n,r)}))}))])})))}))}},CA=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],SA=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return Wr(t)})).getOrDie();return e(i,r,o)}},kA={button:SA(ev,(function(t,e){return n=t,r=e.backstage.shared.providers,yA(n,r,[]);var n,r})),togglebutton:SA(ov,(function(t,e){return n=t,r=e.backstage.shared.providers,wA(n,r,[]);var n,r})),menubutton:SA(X_,(function(t,e){return FT(t,"tox-tbtn",e.backstage,B.none())})),splitbutton:SA((function(t){return Vr("SplitButton",Y_,t)}),(function(t,e){return function(t,e){var n,r=oa("channel-update-split-dropdown-display"),o=function(t){return{isDisabled:function(){return Xd.isDisabled(t)},setDisabled:function(e){return Xd.set(t,e)},setIconFill:function(e,n){lu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){We(t,"fill",n)}))},setIconStroke:function(e,n){lu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){We(t,"stroke",n)}))},setActive:function(e){We(t.element,"aria-pressed",e),lu(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return kh.set(t,e)}))}))},isActive:function(){return lu(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(kh.isOn)}))}}},i=xo(h),a={getApi:o,onSetup:t.onSetup};return dA.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:O({"aria-pressed":!1},hA(t.tooltip,e.providers))},onExecute:function(e){t.onAction(o(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:xc([Kb(e.providers.isDisabled),qb(),uh("split-dropdown-events",[Ii(pA,dh.focus),Jb(a,i),Qb(a,i)]),uC.config({})]),eventOrder:(n={},n[yi()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:xA(o,t,e.providers),parts:{menu:Mv(0,t.columns,t.presets)},components:[dA.parts.button(vA(t.icon,t.text,B.none(),B.some(r),B.some([kh.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),dA.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:kp("chevron-down",e.providers.icons)},buttonBehaviours:xc([Kb(e.providers.isDisabled),qb(),Tp()])}),dA.parts["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})}(t,e.backstage.shared)})),grouptoolbarbutton:SA((function(t){return Vr("GroupToolbarButton",$_,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[Ss]=e.backstage.shared.header.isPositionedAtTop()?Uc.TopToBottom:Uc.BottomToTop,r);switch(Eb(n)){case gv.floating:return function(t,e,n,r){var o=e.shared;return XR.sketch({lazySink:o.getSink,fetch:function(){return Ex((function(e){e(U(n(t.items),cN))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:vA(t.icon,t.text,t.tooltip,B.none(),B.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return _A(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,B.none())}),i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return function(t,e){var n=O({type:"advanced"},e.styleselect);return IN(t,e,nA(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return IN(t,e,ZN(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return IN(t,e,XN(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return IN(t,e,eA(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return IN(t,e,$N(t))}(t,e.backstage)}},TA={styleselect:kA.styleSelectButton,fontsizeselect:kA.fontsizeSelectButton,fontselect:kA.fontSelectButton,formatselect:kA.formatButton,align:kA.alignMenuButton},OA=function(t){var e,n=t.toolbar,r=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=U(CA,(function(e){var n=$(e.items,(function(e){return wt(t,e)||wt(TA,e)}));return{name:e.name,items:n}}));return $(e,(function(t){return t.items.length>0}))}(r):o(n)?(e=n.split("|"),U(e,(function(t){return{items:t.trim().split(" ")}}))):function(t){return g(t,(function(t){return wt(t,"name")&&wt(t,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},EA=function(t,e,n,r,o,i){return yt(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return st(t,(function(t){return yt(e,t+n.toLowerCase())}))}))})).fold((function(){return yt(TA,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return B.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return yt(kA,t.type).fold((function(){return console.error("skipping button defined by",t),B.none()}),(function(r){return B.some(r(t,e,n))}))}(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),B.none())}))},_A=function(t,e,n,r){var o=OA(e),i=U(o,(function(o){var i=Q(o.items,(function(o){return 0===o.trim().length?[]:EA(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:B.from(t.translate(o.name)),items:i}}));return $(i,(function(t){return t.items.length>0}))},RA=function(t,e,n,r){var i=e.outerContainer,a=n.toolbar,u=n.buttons;if(g(a,o)){var c=a.map((function(e){var o={toolbar:e,buttons:u,allowToolbarGroups:n.allowToolbarGroups};return _A(t,o,{backstage:r},B.none())}));xN.setToolbars(i,c)}else xN.setToolbar(i,_A(t,n,{backstage:r},B.none()))},NA=pe(),AA=NA.os.isiOS()&&NA.os.version.major<=12,DA=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=xo(0),a=e.outerContainer;NN(t);var c=Bt.fromDom(o.targetNode),s=Pe(ze(c));!function(t,e){Kl(t,e,kn)}(c,e.mothership),Gl(s,e.uiMothership),t.on("PostRender",(function(){RA(t,e,n,r),i.set(t.getWin().innerWidth),xN.setMenubar(a,kN(t,n)),xN.setSidebar(a,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=xo(mn(r.innerWidth,r.innerHeight)),a=xo(mn(o.offsetWidth,o.offsetHeight)),u=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(mn(r.innerWidth,r.innerHeight)),Fy(t))},c=function(){var e=t.getDoc().documentElement,n=a.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(a.set(mn(e.offsetWidth,e.offsetHeight)),Fy(t))},s=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};n.bind(r,"resize",u),n.bind(r,"scroll",s);var l=ns(Bt.fromDom(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){Je(f,"display","none")})),t.on("show",(function(){an(f,"display")})),t.on("NodeChange",c),t.on("remove",(function(){l.unbind(),n.unbind(r,"resize",u),n.unbind(r,"scroll",s),r=null}))}(t,e)}));var l,f,d,m=xN.getSocket(a).getOrDie("Could not find expected socket element");if(AA){Qe(m.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var g=(l=function(){t.fire("ScrollContent")},f=20,d=null,{cancel:function(){u(d)||(clearTimeout(d),d=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];u(d)&&(d=setTimeout((function(){d=null,l.apply(null,t)}),f))}}),h=es(m.element,"scroll",g.throttle);t.on("remove",h.unbind)}Wb(t,e),t.addCommand("ToggleSidebar",(function(e,n){xN.toggleSidebar(a,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return xN.whichSidebar(a)}));var p=Eb(t);p!==gv.sliding&&p!==gv.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var n=t.getWin().innerWidth;n!==i.get()&&(xN.refreshToolbar(e.outerContainer),i.set(n))}));var v={enable:function(){Ub(e,!1)},disable:function(){Ub(e,!0)},isDisabled:function(){return Xd.isDisabled(a)}};return{iframeContainer:m.element.dom,editorContainer:a.element.dom,api:v}}}),MA=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?B.some(parseInt(""+t,10)):B.none()},BA=function(t){return m(t)?t+"px":t},zA=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},PA=function(t){return function(t){var e=pb(t),n=yb(t),r=xb(t);return MA(e).map((function(t){return zA(t,n,r)}))}(t).getOr(pb(t))},LA=function(t){var e=vb(t),n=bb(t),r=wb(t);return MA(e).map((function(t){return zA(t,n,r)}))},IA=function(t,e,n,r,o){var i=n.uiMothership,a=n.outerContainer,u=gb.DOM,c=Mb(t),s=Pb(t),l=wb(t).or(LA(t)),f=r.shared.header,d=f.isPositionedAtTop,m=Eb(t),g=m===gv.sliding||m===gv.floating,h=xo(!1),p=function(){return h.get()&&!t.removed},b=function(t){return g?t.fold(v(0),(function(t){return t.components().length>1?ln(t.components()[1].element):0})):0},y=function(){i.broadcastOn([cf()],{})},w=function(t){if(void 0===t&&(t=!1),p()){var n;if(c||(n=l.getOrThunk((function(){var t=MA(tn(Ve(),"margin-left")).getOr(0);return bn(Ve())-hn(e).left+t})),Je(o.get().element,"max-width",n+"px")),g&&xN.refreshToolbar(a),c||function(){var t=xN.getToolbar(a),n=b(t),r=Hn(e),i=d()?Math.max(r.y-ln(o.get().element)+n,0):r.bottom;Qe(a.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),s){var r=o.get();t?z_.reset(r):z_.refresh(r)}y()}},x=function(n){if(void 0===n&&(n=!0),!c&&s&&p()){var r=f.getDockingMode(),i=function(n){switch(Nb(t)){case Ob.auto:var r=xN.getToolbar(a),o=b(r),i=ln(n.element)-o,u=Hn(e);if(u.y>i)return"top";var c=ke(e),s=Math.max(c.dom.scrollHeight,ln(c));return u.bottom<s-i||Vn().bottom<u.bottom-i?"bottom":"top";case Ob.bottom:return"bottom";case Ob.top:default:return"top"}}(o.get());i!==r&&(!function(t){var e=o.get();z_.setModes(e,[t]),f.setDockingMode(t);var n=d()?Uc.TopToBottom:Uc.BottomToTop;We(e.element,Ss,n)}(i),n&&w(!0))}};return{isVisible:p,isPositionedAtTop:d,show:function(){h.set(!0),Je(a.element,"display","flex"),u.addClass(t.getBody(),"mce-edit-focus"),an(i.element,"display"),x(!1),w()},hide:function(){h.set(!1),n.outerContainer&&(Je(a.element,"display","none"),u.removeClass(t.getBody(),"mce-edit-focus")),Je(i.element,"display","none")},update:w,updateMode:x,repositionPopups:y}},HA=function(t,e){var n=Hn(t);return{pos:e?n.y:n.bottom,bounds:n}},FA=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,a=e.uiMothership,u=e.outerContainer,c=xo(null),s=Bt.fromDom(o.targetNode),l=IA(t,s,e,r,c),f=function(t){return t.getParam("toolbar_persist",!1,"boolean")}(t);AN(t);var d=function(){if(c.get())l.show();else{c.set(xN.getHeader(u).getOrDie());var o=Bb(t);Gl(o,i),Gl(o,a),RA(t,e,n,r),xN.setMenubar(u,kN(t,n)),l.show(),function(t,e,n,r){var o=xo(HA(e,n.isPositionedAtTop())),i=function(r){var i=HA(e,n.isPositionedAtTop()),a=i.pos,u=i.bounds,c=o.get(),s=c.pos,l=c.bounds,f=u.height!==l.height||u.width!==l.width;o.set({pos:a,bounds:u}),f&&Fy(t,r),n.isVisible()&&(s!==a?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};r||(t.on("activate",n.show),t.on("deactivate",n.hide)),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){hp.requestAnimationFrame((function(){return i(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var a=Qc();a.set(ns(Bt.fromDom(t.getBody()),"load",i)),t.on("remove",(function(){a.clear()}))}(t,s,l,f),t.nodeChanged()}},m=function(){return hp.setEditorTimeout(t,d,0)};t.on("show",d),t.on("hide",l.hide),f||(t.on("focus",m),t.on("blur",l.hide)),t.on("init",(function(){(t.hasFocus()||f)&&m()})),Wb(t,e);var g={show:function(){l.show()},hide:function(){l.hide()},enable:function(){Ub(e,!1)},disable:function(){Ub(e,!0)},isDisabled:function(){return Xd.isDisabled(u)}};return{editorContainer:u.element.dom,api:g}}}),VA="contexttoolbar-hide",jA=function(t,e){return Ii(_T,(function(n,r){var o=function(t){return{hide:function(){return Ri(t,di())},getValue:function(){return Of.getValue(t)}}}(t.get(n));e.onAction(o,r.event.buttonApi)}))},UA=function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original;r.primary;var o=E(r,["primary"]),i=jr(ov(O(O({},o),{type:"togglebutton",onAction:h})));return wA(i,n.backstage.shared.providers,[jA(t,e)])}(t,e,r):function(t,e,n){var r=e.original;r.primary;var o=E(r,["primary"]),i=jr(ev(O(O({},o),{type:"button",onAction:h})));return yA(i,n.backstage.shared.providers,[jA(t,e)])}(t,e,r)},WA=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=vp(bx.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:xc([eh.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return Ai(t),!0}))},onLeft:function(t,e){return e.cut(),B.none()},onRight:function(t,e){return e.cut(),B.none()}})])})),o=function(t,e,n){var r=U(e,(function(e){return vp(UA(t,e,n))}));return{asSpecs:function(){return U(r,(function(t){return t.asSpec()}))},findPrimary:function(t){return st(e,(function(e,n){return e.primary?B.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(x(Xd.isDisabled)):B.none()}))}}}(r,t.commands,e);return[{title:B.none(),items:[r.asSpec()]},{title:B.none(),items:o.asSpecs()}]},qA=WA,$A=function(t,e,n){return void 0===n&&(n=.01),e.bottom-t.y>=n&&t.bottom-e.y>=n},GA=function(t){var e=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=Ae(Bt.fromDom(t.startContainer),t.startOffset).element;return(Ht(n)?Oe(n):B.some(n)).filter(It).map((function(t){return t.dom.getBoundingClientRect()})).getOr(e)}return e}(t.selection.getRng());if(t.inline){var n=An();return In(n.left+e.left,n.top+e.top,e.width,e.height)}var r=Fn(Bt.fromDom(t.getBody()));return In(r.x+e.left,r.y+e.top,e.width,e.height)},KA=function(t,e,n,r){void 0===r&&(r=0);var o=Bn(window),i=Hn(Bt.fromDom(t.getContentAreaContainer())),a=Cb(t)||Sb(t)||Tb(t),u=function(t,e,n){var r=Math.max(t.x+n,e.x);return{x:r,width:Math.min(t.right-n,e.right)-r}}(i,o,r),c=u.x,s=u.width;if(t.inline&&!a)return In(c,o.y,s,o.height);var l=function(t,e,n,r,o,i){var a=Bt.fromDom(t.getContainer()),u=lu(a,".tox-editor-header").getOr(a),c=Hn(u),s=c.y>=e.bottom,l=r&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(t.inline&&!l)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var f="line"===o?Hn(a):e;return l?{y:Math.max(c.bottom+i,n.y),bottom:Math.min(f.bottom-i,n.bottom)}:{y:Math.max(f.y+i,n.y),bottom:Math.min(c.y-i,n.bottom)}}(t,i,o,e.header.isPositionedAtTop(),n,r),f=l.y,d=l.bottom;return In(c,f,s,d-f)},XA={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},YA={maxHeightFunction:gs(),maxWidthFunction:UR()},JA=function(t){return"node"===t},QA=function(t,e,n,r,o){var i=GA(t),a=r.lastElement().exists((function(t){return ye(n,t)}));return function(t,e){var n=t.selection.getRng(),r=Ae(Bt.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&ye(r.element,e)}(t,n)?a?dp:up:a?function(t,e,n){var r=nn(t,"position");Je(t,"position",e);var o=n(t);return r.each((function(e){return Je(t,"position",e)})),o}(e,r.getMode(),(function(){return $A(i,Hn(e))&&!r.isReposition()?gp:dp})):("fixed"===r.getMode()?o.y+An().top:o.y)+(ln(e)+12)<=i.y?up:cp},ZA=function(t,e,n,r){var o=function(e){return function(r,o,i,a,u){var c=QA(t,a,e,n,u),s=O(O({},r),{y:u.y,height:u.height});return O(O({},c(s,o,i,a,u)),{alwaysFit:!0})}},i=function(t){return JA(r)?[o(t)]:[]};return e?{onLtr:function(t){return[ac,ec,nc,rc,oc,ic].concat(i(t))},onRtl:function(t){return[ac,nc,ec,oc,rc,ic].concat(i(t))}}:{onLtr:function(t){return[ic,ac,rc,ec,oc,nc].concat(i(t))},onRtl:function(t){return[ic,ac,oc,nc,rc,ec].concat(i(t))}}},tD=function(t,e){var n=$(e,(function(e){return e.predicate(t.dom)})),r=q(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},eD=function(t,e,n){var r=tD(t,e);if(r.contextForms.length>0)return B.some({elem:t,toolbars:[r.contextForms[0]]});var o=tD(t,n);if(o.contextForms.length>0)return B.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return F(t,(function(t){return t.position===e}))},n=function(e){return $(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),a=U(n("selection"),(function(t){return O(O({},t),{position:"node"})}));return i.concat(a)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return B.some({elem:t,toolbars:i})}return B.none()},nD=function(t,e,n){return t(e)?B.none():Ro(e,(function(t){if(It(t)){var e=tD(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return X(t,(function(t){return t.position===e}))};return e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position})).fold((function(){return[]}),(function(e){return $(t,(function(t){return t.position===e}))}))}(r);return i.length>0?B.some({elem:t,toolbars:i}):B.none()}return B.none()}),t)},rD=function(t,e){var n={},r=[],o=[],i={},a={},u=function(t,u){var c=jr(Vr("ContextForm",fv,u));n[t]=c,c.launch.map((function(n){i["form:"+t]=O(O({},u.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),a[t]=c},c=function(t,e){var n;(n=e,Vr("ContextToolbar",dv,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),a[t]=n}))},s=lt(t);return W(s,(function(e){var n=t[e];"contextform"===n.type?u(e,n):"contexttoolbar"===n.type&&c(e,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:a,formNavigators:i}},oD=oa("forward-slide"),iD=oa("backward-slide"),aD=oa("change-slide-event"),uD="tox-pop--resizing",cD="tox-pop--transition",sD=function(t,e,n,r){var o,i,a=r.backstage,u=a.shared,c=pe().deviceType.isTouch,s=Zc(),l=Zc(),f=Zc(),d=eu((o={sink:n,onEscape:function(){return t.focus(),B.some(!0)}},i=xo([]),Xh.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),Xh.getContent(t).each((function(t){an(t.element,"visibility")})),Ha(t.element,uD),an(t.element,"width")},inlineBehaviours:xc([uh("context-toolbar-events",[qi(Zo(),(function(t,e){"width"===e.event.raw.propertyName&&(Ha(t.element,uD),an(t.element,"width"))})),Ii(aD,(function(t,e){var n=t.element;an(n,"width");var r=bn(n);Xh.setContent(t,e.event.contents),La(n,uD);var o=bn(n);Je(n,"width",r+"px"),Xh.getContent(t).each((function(t){e.event.focus.bind((function(t){return Nc(t),Mc(n)})).orThunk((function(){return eh.focusIn(t),Dc(ze(n))}))})),hp.setTimeout((function(){Je(t.element,"width",o+"px")}),0)})),Ii(oD,(function(t,e){Xh.getContent(t).each((function(e){i.set(i.get().concat([{bar:e,focus:Dc(ze(t.element))}]))})),Ni(t,aD,{contents:e.event.forwardContents,focus:B.none()})})),Ii(iD,(function(t,e){ut(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),Ni(t,aD,{contents:nu(e.bar),focus:e.focus})}))}))]),eh.config({mode:"special",onEscape:function(t){return ut(i.get()).fold((function(){return o.onEscape()}),(function(e){return Ri(t,iD),B.some(!0)}))}})]),lazySink:function(){return Wn.value(o.sink)}}))),m=function(){var e=f.get().getOr("node"),n=JA(e)?1:0;return KA(t,u,e,n)},g=function(){return!(t.removed||c()&&a.isContextMenuOpen())},p=function(){if(g()){var e=m(),n=Ct(f.get(),"node")?function(t,e){return e.filter(Fe).map(Fn).getOrThunk((function(){return GA(t)}))}(t,s.get()):GA(t);return e.height<=0||!$A(n,e)}return!0},v=function(){s.clear(),l.clear(),f.clear(),Xh.hide(d)},b=function(){if(Xh.isOpen(d)){var t=d.element;an(t,"display"),p()?Je(t,"display","none"):(l.set(0),Xh.reposition(d))}},y=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:xc([eh.config({mode:"acyclic"}),uh("pop-dialog-wrap-events",[$i((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return eh.focusIn(e)}))})),Gi((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},w=jt((function(){return rD(e,(function(t){var e=x([t]);Ni(d,oD,{forwardContents:y(e)})}))})),x=function(e){var n=t.ui.registry.getAll().buttons,o=w(),i=O(O({},n),o.formNavigators),a=Eb(t)===gv.scrolling?gv.scrolling:gv.default,c=J(U(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return _A(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,B.some(["form:"]))}(i,e):function(t,e){return qA(t,e)}(e,u.providers)})));return mN({type:a,uid:oa("context-toolbar"),initGroups:c,onEscape:B.none,cyclicKeying:!0,providers:u.providers})},C=function(e,r){var o="node"===e?u.anchors.node(r):u.anchors.cursor(),i=function(t,e,n,r){return"line"===e?{bubble:bs(12,0,XA),layouts:{onLtr:function(){return[uc]},onRtl:function(){return[cc]}},overrides:YA}:{bubble:bs(0,12,XA,1/12),layouts:ZA(t,n,r,e),overrides:YA}}(t,e,c(),{lastElement:s.get,isReposition:function(){return Ct(l.get(),0)},getMode:function(){return Ll.getMode(n)}});return ur(o,i)},S=function(t,e){if(k.cancel(),g()){var r=x(t),o=t[0].position,i=C(o,e);f.set(o),l.set(1);var a=d.element;an(a,"display"),function(t){return Ct(kt(t,s.get(),ye),!0)}(e)||(Ha(a,cD),Ll.reset(n,d)),Xh.showWithinBounds(d,y(r),{anchor:i,transition:{classes:[cD],mode:"placement"}},(function(){return B.some(m())})),e.fold(s.clear,s.set),p()&&Je(a,"display","none")}},k=Dp((function(){t.hasFocus()&&!t.removed&&(Fa(d.element,cD)?k.throttle():function(t,e){var n=Bt.fromDom(e.getBody()),r=function(t){return ye(t,n)},o=Bt.fromDom(e.selection.getNode());return function(t){return!r(t)&&!xe(n,t)}(o)?B.none():eD(o,t.inNodeScope,t.inEditorScope).orThunk((function(){return nD(r,o,t)}))}(w(),t).fold(v,(function(t){S(t.toolbars,B.some(t.elem))})))}),17);t.on("init",(function(){t.on("remove",v),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",b),t.on("click keyup focus SetContent",k.throttle),t.on(VA,v),t.on("contexttoolbar-show",(function(e){var n=w();yt(n.lookupTable,e.toolbarKey).each((function(n){S([n],Tt(e.target!==t,e.target)),Xh.getContent(d).each(eh.focusIn)}))})),t.on("focusout",(function(e){hp.setEditorTimeout(t,(function(){Mc(n.element).isNone()&&Mc(d.element).isNone()&&v()}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&v()})),t.on("AfterProgressState",(function(e){e.state?v():t.hasFocus()&&k.throttle()})),t.on("NodeChange",(function(t){Mc(d.element).fold(k.throttle,h)}))}))},lD={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},fD=(FN="[eE][+-]?[0-9]+",jN=["Infinity","[0-9]+\\."+(VN=function(t){return"(?:"+t+")?"})(HN="[0-9]+")+VN(FN),"\\.[0-9]+"+VN(FN),HN+VN(FN)].join("|"),new RegExp("^([+-]?(?:"+jN+"))(.*)$")),dD=function(t,e){return B.from(fD.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return F(e,(function(e){return F(lD[e],(function(e){return t===e}))}))}(r,e)?B.some({value:n,unit:r}):B.none()}))},mD=function(t,e){var n=function(){var n=e.getOptions(t),r=e.getCurrent(t).map(e.hash),o=Zc();return U(n,(function(n){return{type:"togglemenuitem",text:e.display(n),onSetup:function(i){var a=function(t){t&&(o.on((function(t){return t.setActive(!1)})),o.set(i)),i.setActive(t)};a(Ct(r,e.hash(n)));var u=e.watcher(t,n,a);return function(){o.clear(),u()}},onAction:function(){return e.setCurrent(t,n)}}}))};t.ui.registry.addMenuButton(e.name,{tooltip:e.text,icon:e.icon,fetch:function(t){return t(n())},onSetup:e.onToolbarSetup}),t.ui.registry.addNestedMenuItem(e.name,{type:"nestedmenuitem",text:e.text,getSubmenuItems:n,onSetup:e.onMenuSetup})},gD={name:"lineheight",text:"Line height",icon:"line-height",getOptions:function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},hash:function(t){return function(t,e){return dD(t,e).map((function(t){return t.value+t.unit}))}(t,["fixed","relative","empty"]).getOr(t)},display:b,watcher:function(t,e,n){return t.formatter.formatChanged("lineheight",n,!1,{value:e}).unbind},getCurrent:function(t){return B.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},hD=function(t){mD(t,gD),function(t){return B.from(function(t){return t.getParam("content_langs",void 0,"array")}(t)).map((function(e){return{name:"language",text:"Language",icon:"language",getOptions:v(e),hash:function(t){return s(t.customCode)?t.code:t.code+"/"+t.customCode},display:function(t){return t.title},watcher:function(t,e,n){return t.formatter.formatChanged("lang",n,!1,{value:e.code,customValue:e.customCode}).unbind},getCurrent:function(t){var e=Bt.fromDom(t.selection.getNode());return No(e,(function(t){return B.some(t).filter(It).bind((function(t){return $e(t,"lang").map((function(e){return{code:e,customCode:$e(t,"data-mce-lang").getOrUndefined(),title:""}}))}))}))},setCurrent:function(t,e){return t.execCommand("Lang",!1,e)},onToolbarSetup:function(e){var n=Qc();return e.setActive(t.formatter.match("lang",{},void 0,!0)),n.set(t.formatter.formatChanged("lang",e.setActive,!0)),n.clear}}}))}(t).each((function(e){return mD(t,e)}))},pD=function(t,e){!function(t,e){var n=LN(0,e,$N(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=LN(0,e,XN(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=O({type:"advanced"},e.styleselect),r=LN(0,e,nA(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=LN(0,e,eA(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=LN(0,e,ZN(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)},vD=function(t){return MN(t,"NodeChange",(function(e){e.setDisabled(!t.queryCommandState("outdent"))}))},bD=function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:vD(t),onAction:zN(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:zN(t,"indent")})}(t)},yD=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},wD=function(t){!function(t){yk.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:DN(t,e.name),onAction:yD(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:DN(t,n),onAction:yD(t,n)})}}(t),function(t){yk.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:zN(t,e.action)})}))}(t),function(t){yk.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:zN(t,e.action),onSetup:DN(t,e.name)})}))}(t)},xD=function(t){wD(t),function(t){yk.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:zN(t,e.action)})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:yD(t,"code")})}(t)},CD=function(t,e){return MN(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(t.mode.isReadOnly()||!t.undoManager[e]())}))},SD=function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:CD(t,"hasUndo"),onAction:zN(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:CD(t,"hasRedo"),onAction:zN(t,"redo")})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:CD(t,"hasUndo"),onAction:zN(t,"undo")}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:CD(t,"hasRedo"),onAction:zN(t,"redo")})}(t)},kD=function(t){return MN(t,"VisualAid",(function(e){e.setActive(t.hasVisual)}))},TD=function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:zN(t,"mceToggleVisualAid")})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:kD(t),onAction:zN(t,"mceToggleVisualAid")})}(t)},OD=function(t,e){!function(t){W([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:zN(t,e.cmd),onSetup:DN(t,e.name)})})),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:zN(t,"JustifyNone")})}(t),xD(t),pD(t,e),SD(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",(function(e,n){!function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))}(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){!function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))}(t,e)}))}(t);var e=xo(null),n=xo(null);aw(t,"forecolor","forecolor","Text color",e),aw(t,"backcolor","hilitecolor","Background color",n),uw(t,"forecolor","forecolor","Text color"),uw(t,"backcolor","hilitecolor","Background color")}(t),TD(t),bD(t),hD(t)},ED=function(t,e){return{type:"makeshift",x:t,y:e}},_D=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},RD=function(t,e){var n=gb.DOM.getPos(t);return function(t,e,n){return ED(t.x+e,t.y+n)}(e,n.x,n.y)},ND=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(_D(t)){var e=t.touches[0];return ED(e.pageX,e.pageY)}return ED(t.pageX,t.pageY)}(e):RD(t.getContentAreaContainer(),function(t){if(_D(t)){var e=t.touches[0];return ED(e.clientX,e.clientY)}return ED(t.clientX,t.clientY)}(e)):AD(t)},AD=function(t){return{type:"selection",root:Bt.fromDom(t.selection.getNode())}},DD=function(t,e,n){switch(n){case"node":return function(t){return{type:"node",node:B.some(Bt.fromDom(t.selection.getNode())),root:Bt.fromDom(t.getBody())}}(t);case"point":return ND(t,e);case"selection":return AD(t)}},MD=function(t,e,n,r,o,i){var a=n(),u=DD(t,e,i);IT(a,hv.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),Xh.showMenuAt(o,{anchor:u},{menu:{markers:Nv("normal")},data:t})}))},BD={onLtr:function(){return[ac,ec,nc,rc,oc,ic,up,cp,ap,op,ip,rp]},onRtl:function(){return[ac,nc,ec,oc,rc,ic,up,cp,ip,rp,ap,op]}},zD={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},PD=function(t,e,n,r,o,i,a){var u=function(t,e,n){var r=DD(t,e,n);return O({bubble:bs(0,"point"===n?12:0,zD),layouts:BD,overrides:{maxWidthFunction:UR(),maxHeightFunction:gs()}},r)}(t,e,i);IT(n,hv.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),Xh.showMenuWithinBounds(o,{anchor:u},{menu:{markers:Nv("normal"),highlightImmediately:a},data:n,type:"horizontal"},(function(){return B.some(KA(t,r.shared,"node"===i?"node":"selection"))})),t.fire(VA)}))},LD=function(t,e,n,r,o,i){var a=pe(),u=a.os.isiOS(),c=a.os.isOSX(),s=a.os.isAndroid(),l=a.deviceType.isTouch(),f=function(){var a=n();PD(t,e,a,r,o,i,!(s||u||c&&l))};if((c||u)&&"node"!==i){var d=function(){!function(t){var e=t.selection.getRng(),n=function(){hp.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),f()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return sl(t.getWin(),Ws.domRange(o)).exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))}(t,e)?(t.once("selectionchange",d),t.once("touchend",(function(){return t.off("selectionchange",d)}))):d()}else f()},ID=function(t){return"string"==typeof t?t.split(/[ ,]/):t},HD=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},FD=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return B.from(t.getParam(e)).map(ID).getOrThunk((function(){return $(ID(n),(function(t){return wt(r,t)}))}))}(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},VD=function(t){return o(t)?"|"===t:"separator"===t.type},jD={type:"separator"},UD=function(t){var e,n=function(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}};if(o(t))return t;switch(t.type){case"separator":return jD;case"submenu":return O(O({type:"nestedmenuitem"},n(t)),{getSubmenuItems:function(){var e=t.getSubmenuItems();return o(e)?e:U(e,UD)}});default:return O(O({type:"menuitem"},n(t)),{onAction:(e=t.onAction,function(){return e()})})}},WD=function(t,e){if(0===e.length)return t;var n=ut(t).filter((function(t){return!VD(t)})).fold((function(){return[]}),(function(t){return[jD]}));return t.concat(n).concat(e).concat([jD])},qD=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},$D=function(t,e){return qD(t,e)?t.selection.getStart(!0):e.target},GD=function(t,e,n){var r=pe().deviceType.isTouch,i=eu(Xh.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:xc([uh("dismissContextMenu",[Ii(xi(),(function(e,n){af.close(e),t.focus()}))])])})),a=function(t){return Xh.hide(i)},u=function(e){if(HD(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!HD(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var a=function(t,e){var n=function(t){return t.getParam("contextmenu_avoid_overlap","","string")}(t),r=qD(t,e)?"selection":"point";if(At(n)){var o=$D(t,e);return Aw(Bt.fromDom(o),n)?"node":r}return r}(t,e);(r()?LD:MD)(t,e,(function(){var n=$D(t,e),r=t.ui.registry.getAll(),i=FD(t);return function(t,e,n){var r=K(e,(function(e,r){return yt(t,r.toLowerCase()).map((function(t){var r=t.update(n);if(o(r))return WD(e,r.split(" "));if(r.length>0){var i=U(r,UD);return WD(e,i)}return e})).getOrThunk((function(){return e.concat([r])}))}),[]);return r.length>0&&VD(r[r.length-1])&&r.pop(),r}(r.contextMenus,i,n)}),n,i,a)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");t.on(e,a),t.on("longpress contextmenu",u)}))},KD=Co([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),XD=function(t){return function(e){return e.translate(-t.left,-t.top)}},YD=function(t){return function(e){return e.translate(t.left,t.top)}},JD=function(t){return function(e,n){return K(t,(function(t,e){return e(t)}),mn(e,n))}},QD=function(t,e,n){return t.fold(JD([YD(n),XD(e)]),JD([XD(e)]),JD([]))},ZD=function(t,e,n){return t.fold(JD([YD(n)]),JD([]),JD([YD(e)]))},tM=function(t,e,n){return t.fold(JD([]),JD([XD(n)]),JD([YD(e),XD(n)]))},eM=function(t,e,n){var r=t.fold((function(t,e){return{position:B.some("absolute"),left:B.some(t+"px"),top:B.some(e+"px")}}),(function(t,e){return{position:B.some("absolute"),left:B.some(t-n.left+"px"),top:B.some(e-n.top+"px")}}),(function(t,e){return{position:B.some("fixed"),left:B.some(t+"px"),top:B.some(e+"px")}}));return O({right:B.none(),bottom:B.none()},r)},nM=function(t,e,n,r){var o=function(t,o){return function(i,a){var u=t(e,n,r);return o(i.getOr(u.left),a.getOr(u.top))}};return t.fold(o(tM,rM),o(ZD,oM),o(QD,iM))},rM=KD.offset,oM=KD.absolute,iM=KD.fixed,aM=function(t,e){var n=qe(t,e);return s(n)?NaN:parseInt(n,10)},uM=function(t,e,n,r){return function(t,e){var n=t.element,r=aM(n,e.leftAttr),o=aM(n,e.topAttr);return isNaN(r)||isNaN(o)?B.none():B.some(mn(r,o))}(t,e).fold((function(){return n}),(function(t){return iM(t.left+r.left,t.top+r.top)}))},cM=function(t,e,n,r,o,i){var a=uM(t,e,n,r),u=e.mustSnap?fM(t,e,a,o,i):dM(t,e,a,o,i),c=QD(a,o,i);return function(t,e,n){var r=t.element;We(r,e.leftAttr,n.left+"px"),We(r,e.topAttr,n.top+"px")}(t,e,c),u.fold((function(){return{coord:iM(c.left,c.top),extra:B.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},sM=function(t,e){!function(t,e){var n=t.element;Ke(n,e.leftAttr),Ke(n,e.topAttr)}(t,e)},lM=function(t,e,n,r){return st(t,(function(t){var o=t.sensor;return function(t,e,n,r,o,i){var a=ZD(t,o,i),u=ZD(e,o,i);return Math.abs(a.left-u.left)<=n&&Math.abs(a.top-u.top)<=r}(e,o,t.range.left,t.range.top,n,r)?B.some({output:nM(t.output,e,n,r),extra:t.extra}):B.none()}))},fM=function(t,e,n,r,o){var i=e.getSnapPoints(t);return lM(i,n,r,o).orThunk((function(){return K(i,(function(t,e){var i=e.sensor,a=function(t,e,n,r,o,i){var a=ZD(t,o,i),u=ZD(e,o,i),c=Math.abs(a.left-u.left),s=Math.abs(a.top-u.top);return mn(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:B.some(a),snap:B.some(e)}}),(function(n){return(a.left+a.top)/2<=(n.left+n.top)/2?{deltas:B.some(a),snap:B.some(e)}:t}))}),{deltas:B.none(),snap:B.none()}).snap.map((function(t){return{output:nM(t.output,n,r,o),extra:t.extra}}))}))},dM=function(t,e,n,r,o){var i=e.getSnapPoints(t);return lM(i,n,r,o)},mM=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=Ce(t.element),a=An(i),u=v_(o),c=function(t,e,n){return{coord:nM(t.output,t.output,e,n),extra:t.extra}}(r,a,u),s=eM(c.coord,0,u);Ze(o,s)}}}),gM="data-initial-z-index",hM=function(t,e){t.getSystem().addToGui(e),function(t){Oe(t.element).filter(It).each((function(e){nn(e,"z-index").each((function(t){We(e,gM,t)})),Je(e,"z-index",tn(t.element,"z-index"))}))}(e)},pM=function(t){!function(t){Oe(t.element).filter(It).each((function(t){$e(t,gM).fold((function(){return an(t,"z-index")}),(function(e){return Je(t,"z-index",e)})),Ke(t,gM)}))}(t),t.getSystem().removeFromGui(t)},vM=function(t,e,n){return t.getSystem().build(qw.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},bM=lo("snaps",[Xr("getSnapPoints"),_u("onSensor"),Xr("leftAttr"),Xr("topAttr"),fo("lazyViewport",Vn),fo("mustSnap",!1)]),yM=[fo("useFixed",S),Xr("blockerClass"),fo("getTarget",b),fo("onDrag",h),fo("repositionTarget",!0),fo("onDrop",h),bo("getBounds",Vn),bM],wM=function(t){return(e=nn(t,"left"),n=nn(t,"top"),r=nn(t,"position"),o=function(t,e,n){return("fixed"===n?iM:rM)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?B.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):B.none()).getOrThunk((function(){var e=hn(t);return oM(e.left,e.top)}));var e,n,r,o},xM=function(t,e,n,r,o,i,a){return function(t,e,n,r,o){var i=o.bounds,a=ZD(e,n,r),u=$u(a.left,i.x,i.x+i.width-o.width),c=$u(a.top,i.y,i.y+i.height-o.height),s=oM(u,c);return e.fold((function(){var t=tM(s,n,r);return rM(t.left,t.top)}),v(s),(function(){var t=QD(s,n,r);return iM(t.left,t.top)}))}(0,e.fold((function(){var t,e,a,u=(t=n,e=i.left,a=i.top,t.fold((function(t,n){return rM(t+e,n+a)}),(function(t,n){return oM(t+e,n+a)}),(function(t,n){return iM(t+e,n+a)}))),c=QD(u,r,o);return iM(c.left,c.top)}),(function(e){var a=cM(t,e,n,i,r,o);return a.extra.each((function(n){e.onSensor(t,n)})),a.coord})),r,o,a)},CM=function(t,e){return{bounds:t.getBounds(),height:fn(e.element),width:yn(e.element)}},SM=function(t,e,n,r,o){var i=n.update(r,o),a=n.getStartData().getOrThunk((function(){return CM(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=Ce(t.element),a=An(i),u=v_(o),c=wM(o),s=xM(t,e.snaps,c,a,u,r,n),l=eM(s,0,u);Ze(o,l)}e.onDrag(t,o,r)}(t,e,a,n)}))},kM=function(t,e,n,r){e.each(pM),n.snaps.each((function(e){sM(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},TM=function(t){return function(e,n){var r=function(t){n.setStartData(CM(e,t))};return zi(_([Ii(vi(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r),!0))}},OM=Object.freeze({__proto__:null,getData:function(t){return B.from(mn(t.x,t.y))},getDelta:function(t,e){return mn(e.left-t.left,e.top-t.top)}}),EM=function(t,e,n){return[Ii(Fo(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return kM(r,B.some(c),t,e)},a=Dw(i,200),u={drop:i,delayDrop:a.schedule,forceDrop:i,move:function(n){a.cancel(),SM(r,t,e,OM,n)}},c=vM(r,t.blockerClass,function(t){return zi([Ii(Fo(),t.forceDrop),Ii(Uo(),t.drop),Ii(Vo(),(function(e,n){t.move(n.event)})),Ii(jo(),t.delayDrop)])}(u));n(r),hM(r,c)}}))]},_M=_(_([],yM,!0),[Du("dragger",{handlers:TM(EM)})],!1),RM=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return B.some(mn(e.clientX,e.clientY))}(e):B.none()},getDelta:function(t,e){return mn(e.left-t.left,e.top-t.top)}}),NM=function(t,e,n){var r=Zc(),o=function(n){kM(n,r.get(),t,e),r.clear()};return[Ii(Po(),(function(i,a){a.stop();var u=function(){return o(i)},c={drop:u,delayDrop:h,forceDrop:u,move:function(n){SM(i,t,e,RM,n)}},s=vM(i,t.blockerClass,function(t){return zi([Ii(Po(),t.forceDrop),Ii(Io(),t.drop),Ii(Ho(),t.drop),Ii(Lo(),(function(e,n){t.move(n.event)}))])}(c));r.set(s);n(i),hM(i,s)})),Ii(Lo(),(function(n,r){r.stop(),SM(n,t,e,RM,r.event)})),Ii(Io(),(function(t,e){e.stop(),o(t)})),Ii(Ho(),o)]},AM=_M,DM=_(_([],yM,!0),[Du("dragger",{handlers:TM(NM)})],!1),MM=_(_([],yM,!0),[Du("dragger",{handlers:TM((function(t,e,n){return _(_([],EM(t,e,n),!0),NM(t,e,n),!0)}))})],!1),BM=Tc({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:AM,touch:DM,mouseOrTouch:MM}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:B.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=B.none(),e=B.none(),n=v({});return xa({readState:n,reset:function(){t=B.none(),e=B.none()},update:function(e,n){return e.getData(n).bind((function(n){return function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=B.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=B.some(t)}})}}),apis:mM}),zM=function(t,e,n,r,o,i){return t.fold((function(){return BM.snap({sensor:oM(n-20,r-20),range:mn(o,i),output:oM(B.some(n),B.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,a=t.element.dom.getBoundingClientRect();return BM.snap({sensor:oM(o,i),range:mn(40,40),output:oM(B.some(n-a.width/2),B.some(r-a.height/2)),extra:{td:e}})}))},PM=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists((function(t){return ye(t,e)}))})(e.get(),o)||(e.set(o),n(o))},mustSnap:!0}},LM=function(t){return vp(pp.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:xc([BM.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),uC.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},IM=function(t,e){var n=xo([]),r=xo([]),o=xo(!1),i=Zc(),a=Zc(),u=function(t){var n=Fn(t);return zM(f.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=Fn(t);return zM(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=PM((function(){return U(n.get(),(function(t){return u(t)}))}),i,(function(e){a.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),l=PM((function(){return U(r.get(),(function(t){return c(t)}))}),a,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),f=LM(s),d=LM(l),m=eu(f.asSpec()),g=eu(d.asSpec()),h=function(e,n,r,o){var i=r(n);BM.snapTo(e,i);!function(e,n,r,o){var i=n.dom.getBoundingClientRect();an(e.element,"display");var a=Te(Bt.fromDom(t.getBody())).dom.innerHeight,u=r(i),c=o(i,a);(u||c)&&Je(e.element,"display","none")}(e,n,(function(t){return t[o]<0}),(function(t,e){return t[o]>e}))},p=function(t){return h(m,t,u,"top")},v=function(t){return h(g,t,c,"bottom")};pe().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(jl(e,m),jl(e,g),o.set(!0)),i.set(t.start),a.set(t.finish),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),p(t.start),v(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(p),a.get().each(v)})),t.on("TableSelectionClear",(function(){o.get()&&(ql(m),ql(g),o.set(!1)),i.clear(),a.clear()})))},HM=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},FM=function(t,e,n){e.delimiter||(e.delimiter="»");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:xc([eh.config({mode:"flow",selector:"div[role=button]"}),Xd.config({disabled:n.isDisabled}),qb(),Qw.config({}),ah.config({}),uh("elementPathEvents",[$i((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return eh.focusIn(r)})),t.on("NodeChange",(function(o){var i,a,u=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!HM(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);u.length>0?ah.set(r,(i=U(u||[],(function(e,r){return pp.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:xc([Gb(n.isDisabled),qb()])})})),a={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},K(i.slice(1),(function(t,e){var n=t;return n.push(a),n.push(e),n}),[i[0]]))):ah.set(r,[])}))}))])]),components:[]}};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(UN||(UN={}));var VM=function(t,e,n){var r=Bt.fromDom(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=zA(r+e.top,yb(t),xb(t)),n===UN.Both&&(i.width=zA(o+e.left,bb(t),wb(t))),i}(t,e,n,ln(r),bn(r));dt(o,(function(t,e){return Je(r,e,BA(t))})),function(t){t.fire("ResizeEditor")}(t)},jM=function(t,e,n,r){var o=mn(20*n,20*r);return VM(t,o,e),B.some(!0)},UM=function(t,e){var n=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?UN.None:"both"===n?UN.Both:UN.Vertical}(t);return n===UN.None?B.none():B.some(Ep("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize")},behaviours:[BM.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){return VM(t,o,n)},blockerClass:"tox-blocker"}),eh.config({mode:"special",onLeft:function(){return jM(t,n,-1,0)},onRight:function(){return jM(t,n,1,0)},onUp:function(){return jM(t,n,0,-1)},onDown:function(){return jM(t,n,0,1)}}),Qw.config({}),dh.config({})]},e.icons))},WM=function(t,e){var n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(FM(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return ah.set(t,[Qa(e.translate(["{0} "+r,n[r]]))])};return pp.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:xc([Gb(e.isDisabled),qb(),Qw.config({}),ah.config({}),Of.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),uh("wordcount-events",[Xi((function(t){var e=Of.getValue(t),n="words"===e.mode?"characters":"words";Of.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),$i((function(e){t.on("wordCountUpdate",(function(t){var n=Of.getValue(e).mode;Of.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[ci()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce&amp;utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=bp.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var r=n(),o=UM(t,e);return r.concat(o.toArray())}()}},qM=function(t){var e,n,r,o,i=t.inline,a=i?FA:DA,u=Pb(t)?q_:h_,c=B.none(),s=pe(),l=s.browser.isIE()?["tox-platform-ie"]:[],f=s.deviceType.isTouch()?["tox-platform-touch"]:[],d=Ab(t),m=Bb(t),g=bp.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[Ss]=d?Uc.BottomToTop:Uc.TopToBottom,e)},v=function(){return c.bind(xN.getHeader)},b=function(){Je($.element,"width",document.body.clientWidth+"px")},y=eu((n=ye(Ve(),m)&&"grid"===tn(m,"display"),r={dom:O({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(f)},g),behaviours:xc([Ll.config({useFixed:function(){return u.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:zi([Ii(bi(),b)])},ur(r,n?o:{}))),w=function(){return Wn.value(y)},x=vp({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind((function(t){return xN.getThrobber(t)})).getOrDie("Could not find throbber element")},S=e_(y,t,(function(){return c.bind((function(t){return x.getOpt(t)})).getOrDie("Could not find a anchor bar element")})),k=xN.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){t.focus()}}),T=Eb(t),E=xN.parts.toolbar(O({dom:{tag:"div",classes:["tox-toolbar"]},getSink:w,providers:S.shared.providers,onEscape:function(){t.focus()},type:T,lazyToolbar:function(){return c.bind((function(t){return xN.getToolbar(t)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),_=xN.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.shared.providers,onEscape:function(){t.focus()},type:T}),R=xN.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),N=xN.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),A=xN.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),D=t.getParam("statusbar",!0,"boolean")&&!i?B.some(WM(t,S.shared.providers)):B.none(),M={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[R,N]},z=Tb(t),P=Sb(t),L=Cb(t),I=xN.parts.header({dom:O({tag:"div",classes:["tox-editor-header"]},p),components:J([L?[k]:[],z?[_]:P?[E]:[],Mb(t)?[]:[x.asSpec()]]),sticky:Pb(t),editor:t,sharedBackstage:S.shared}),H=J([d?[]:[I],i?[]:[M],d?[I]:[]]),F=J([[{dom:{tag:"div",classes:["tox-editor-container"]},components:H}],i?[]:D.toArray(),[A]]),V=zb(t),j=O(O({role:"application"},bp.isRtl()?{dir:"rtl"}:{}),V?{"aria-hidden":"true"}:{}),U=eu(xN.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(f).concat(l),styles:O({visibility:"hidden"},V?{opacity:"0",border:"0"}:{}),attributes:j},components:F,behaviours:xc([qb(),Xd.config({disableClass:"tox-tinymce--disabled"}),eh.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])}));c=B.some(U),t.shortcuts.add("alt+F9","focus menubar",(function(){xN.focusMenubar(U)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){xN.focusToolbar(U)})),t.addCommand("ToggleToolbarDrawer",(function(){xN.toggleToolbarDrawer(U)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return xN.isToolbarDrawerToggled(U)}));var q=$w(U),$=$w(y);!function(t,e,n){var r=function(t,r){W([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){W([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(uf(),{target:t.target})},a=Rc(),u=es(a,"touchstart",i),c=es(a,"touchmove",(function(t){return r(hi(),t)})),s=es(a,"touchend",(function(t){return r(pi(),t)})),l=es(a,"mousedown",i),f=es(a,"mouseup",(function(t){0===t.raw.button&&o(sf(),{target:t.target})})),d=function(t){return o(uf(),{target:Bt.fromDom(t.target)})},m=function(t){0===t.button&&o(sf(),{target:Bt.fromDom(t.target)})},g=function(){W(t.editorManager.get(),(function(e){t!==e&&e.fire("DismissPopups",{relatedTarget:t})}))},h=function(t){return r(vi(),rs(t))},p=function(t){o(cf(),{}),r(bi(),rs(t))},v=function(){return o(cf(),{})},b=function(e){e.state&&o(uf(),{target:Bt.fromDom(t.getContainer())})},y=function(t){o(uf(),{target:Bt.fromDom(t.relatedTarget.getContainer())})};t.on("PostRender",(function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("mousedown",g),t.on("ScrollWindow",h),t.on("ResizeWindow",p),t.on("ResizeEditor",v),t.on("AfterProgressState",b),t.on("DismissPopups",y)})),t.on("remove",(function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("mousedown",g),t.off("ScrollWindow",h),t.off("ResizeWindow",p),t.off("ResizeEditor",v),t.off("AfterProgressState",b),t.off("DismissPopups",y),l.unbind(),u.unbind(),c.unbind(),s.unbind(),f.unbind()})),t.on("detach",(function(){Xl(e),Xl(n),e.destroy(),n.destroy()}))}(t,q,$);var G=function(){var e=BA(PA(t)),n=BA(function(t){return LA(t).getOr(vb(t))}(t));return t.inline||(on("div","width",n)&&Je(U.element,"width",n),on("div","height",e)?Je(U.element,"height",e):Je(U.element,"height","200px")),e};return{mothership:q,uiMothership:$,backstage:S,renderUI:function(){u.setup(t,S.shared,v),OD(t,S),GD(t,w,S),function(t){var e=t.ui.registry.getAll().sidebars;W(lt(e),(function(n){var r=e[n],o=function(){return Ct(B.from(t.queryCommandValue("ToggleSidebar")),n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))}(t),MR(t,C,S.shared),mt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,o=e.contextToolbars,i=e.sidebars,c=kb(t),s={menuItems:r,menus:Lb(t),menubar:Ib(t),toolbar:c.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:T===gv.floating,buttons:n,sidebar:i};sD(t,o,y,{backstage:S}),IM(t,y);var l=t.getElement(),f=G(),d={mothership:q,uiMothership:$,outerContainer:U},m={targetNode:l,height:f};return a.render(t,d,s,S,m)},getUi:function(){return{channels:{broadcastAll:$.broadcast,broadcastOn:$.broadcastOn,register:h}}}}},$M=v([Xr("lazySink"),oo("dragBlockClass"),bo("getBounds",Vn),fo("useTabstopAt",k),fo("eventOrder",{}),Ef("modalBehaviours",[eh]),Ru("onExecute"),Au("onEscape")]),GM={sketch:b},KM=v([od({name:"draghandle",overrides:function(t,e){return{behaviours:xc([BM.config({mode:"mouse",getTarget:function(t){return cu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),nd({schema:[Xr("dom")],name:"title"}),nd({factory:GM,schema:[Xr("dom")],name:"close"}),nd({factory:GM,schema:[Xr("dom")],name:"body"}),od({factory:GM,schema:[Xr("dom")],name:"footer"}),rd({factory:{sketch:function(t,e){return O(O({},t),{dom:e.dom,components:e.components})}},schema:[fo("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),fo("components",[])],name:"blocker"})]),XM=Ad({name:"ModalDialog",configFields:$M(),partFields:KM(),factory:function(t,e,n,r){var o,i=Zc(),a=oa("modal-events"),u=O(O({},t.eventOrder),((o={})[yi()]=[a].concat(t.eventOrder["alloy.system.attached"]||[]),o));return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){i.set(e);var n=t.lazySink(e).getOrDie(),o=r.blocker(),a=n.getSystem().build(O(O({},o),{components:o.components.concat([nu(e)]),behaviours:xc([dh.config({}),uh("dialog-blocker-events",[qi(qo(),(function(){eh.focusIn(e)}))])])}));jl(n,a),eh.focusIn(e)},hide:function(t){i.clear(),Oe(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){ql(t)}))}))},getBody:function(e){return vd(e,t,"body")},getFooter:function(e){return vd(e,t,"footer")},setIdle:function(t){RR.unblock(t)},setBusy:function(t,e){RR.block(t,e)}},eventOrder:u,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Rf(t.modalBehaviours,[ah.config({}),eh.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),RR.config({getRoot:i.get}),uh(a,[$i((function(e){var n,r,o,i,a,u;n=e.element,r=vd(e,t,"title").element,o=$e(n,"id").fold((function(){var t=oa("dialog-label");return We(r,"id",t),t}),b),We(n,"aria-labelledby",o),i=e.element,a=vd(e,t,"body").element,u=B.from(qe(i,"id")).fold((function(){var t=oa("dialog-describe");return We(a,"id",t),t}),b),We(i,"aria-describedby",u)}))])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),YM=kr([Qr("type"),Qr("name")].concat(Gv)),JM=Mr,QM=[$r("name","name",sr((function(){return oa("button-name")})),Dr),uo("icon"),po("align","end",["start","end"]),vo("primary",!1),vo("disabled",!1)],ZM=_(_([],QM,!0),[Qr("text")],!1),tB=_([Zr("type",["submit","cancel","custom"])],ZM,!0),eB=_([Zr("type",["menu"]),uo("text"),uo("tooltip"),uo("icon"),ro("items",YM)],QM,!0),nB=qr("type",{submit:tB,cancel:tB,custom:tB,menu:eB}),rB=[Qr("type"),Qr("text"),Zr("level",["info","warn","error","success"]),Qr("icon"),fo("url","")],oB=kr(rB),iB=[Qr("type"),Qr("text"),vo("disabled",!1),vo("primary",!1),$r("name","name",sr((function(){return oa("button-name")})),Dr),uo("icon"),vo("borderless",!1)],aB=kr(iB),uB=[Qr("type"),Qr("name"),Qr("label"),vo("disabled",!1)],cB=kr(uB),sB=Mr,lB=[Qr("type"),Qr("name")],fB=lB.concat([uo("label")]),dB=fB.concat([fo("columns","auto")]),mB=kr(dB),gB=_r([Qr("value"),Qr("text"),Qr("icon")]),hB=kr(fB),pB=Dr,vB=kr(fB),bB=Dr,yB=lB.concat([ho("tag","textarea"),Qr("scriptId"),Qr("scriptUrl"),function(t,e){return mo(t,e,Pr)}("settings",void 0)]),wB=lB.concat([ho("tag","textarea"),to("init")]),xB=Hr((function(t){return Vr("customeditor.old",Sr(wB),t).orThunk((function(){return Vr("customeditor.new",Sr(yB),t)}))})),CB=Dr,SB=kr(fB),kB=Tr(vr),TB=function(t){return[Qr("type"),Jr("columns"),t]},OB=[Qr("type"),Qr("html"),po("presets","presentation",["presentation","document"])],EB=kr(OB),_B=fB.concat([vo("sandboxed",!0)]),RB=kr(_B),NB=Dr,AB=fB.concat([Yr("currentState",kr([Xr("blob"),Qr("url")]))]),DB=kr(AB),MB=fB.concat([uo("inputMode"),uo("placeholder"),vo("maximized",!1),vo("disabled",!1)]),BB=kr(MB),zB=Dr,PB=function(t){return[Qr("type"),Qr("label"),t]},LB=[Qr("text"),Qr("value")],IB=[Qr("text"),ro("items",function(t,e){return n=jt(e),{extract:function(t,e){return n().extract(t,e)},toString:function(){return n().toString()}};var n}(0,(function(){return HB})))],HB=Or([kr(LB),kr(IB)]),FB=fB.concat([ro("items",HB),vo("disabled",!1)]),VB=kr(FB),jB=Dr,UB=fB.concat([no("items",[Qr("text"),Qr("value")]),go("size",1),vo("disabled",!1)]),WB=kr(UB),qB=Dr,$B=fB.concat([vo("constrain",!0),vo("disabled",!1)]),GB=kr($B),KB=kr([Qr("width"),Qr("height")]),XB=[Qr("type"),ro("header",Dr),ro("cells",Tr(Dr))],YB=kr(XB),JB=fB.concat([uo("placeholder"),vo("maximized",!1),vo("disabled",!1)]),QB=kr(JB),ZB=Dr,tz=fB.concat([po("filetype","file",["image","media","file"]),fo("disabled",!1)]),ez=kr(tz),nz=kr([Qr("value"),fo("meta",{})]),rz=function(t){return $r("items","items",{tag:"required",process:{}},Tr(Hr((function(e){return Vr("Checking item of "+t,oz,e).fold((function(t){return Wn.error(Wr(t))}),(function(t){return Wn.value(t)}))}))))},oz=xr((function(){return Ir("type",{alertbanner:oB,bar:kr((t=rz("bar"),[Qr("type"),t])),button:aB,checkbox:cB,colorinput:hB,colorpicker:vB,dropzone:SB,grid:kr(TB(rz("grid"))),iframe:RB,input:BB,listbox:VB,selectbox:WB,sizeinput:GB,textarea:QB,urlinput:ez,customeditor:xB,htmlpanel:EB,imagetools:DB,collection:mB,label:kr(PB(rz("label"))),table:YB,panel:az});var t})),iz=[Qr("type"),fo("classes",[]),ro("items",oz)],az=kr(iz),uz=[$r("name","name",sr((function(){return oa("tab-name")})),Dr),Qr("title"),ro("items",oz)],cz=[Qr("type"),no("tabs",uz)],sz=kr(cz),lz=ZM,fz=nB,dz=kr([Qr("title"),Yr("body",Ir("type",{panel:az,tabpanel:sz})),ho("size","normal"),ro("buttons",fz),fo("initialData",{}),bo("onAction",h),bo("onChange",h),bo("onSubmit",h),bo("onClose",h),bo("onCancel",h),fo("onTabChange",h)]),mz=kr(_([Zr("type",["cancel","custom"])],lz,!0)),gz=kr([Qr("title"),Qr("url"),ao("height"),ao("width"),so("buttons",mz),bo("onAction",h),bo("onCancel",h),bo("onClose",h),bo("onMessage",h)]),hz=function(t){return i(t)?[t].concat(Q(bt(t),hz)):a(t)?Q(t,hz):[]},pz=function(t){return o(t.type)&&o(t.name)},vz={checkbox:sB,colorinput:pB,colorpicker:bB,dropzone:kB,input:zB,iframe:NB,sizeinput:KB,selectbox:qB,listbox:jB,size:KB,textarea:ZB,urlinput:nz,customeditor:CB,collection:gB,togglemenuitem:JM},bz=function(t){var e=function(t){return $(hz(t),pz)}(t),n=Q(e,(function(t){return function(t){return B.from(vz[t.type])}(t).fold((function(){return[]}),(function(e){return[Yr(t.name,e)]}))}));return kr(n)},yz=function(t){return{internalDialog:jr(Vr("dialog",dz,t)),dataValidator:bz(t),initialData:t.initialData}},wz={open:function(t,e){var n=yz(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(jr(Vr("dialog",gz,e)))},redial:function(t){return yz(t)}},xz=function(t){var e=[],n={};return dt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?Wn.error(e):Wn.value(n)},Cz=function(t,e){var n=vp(ik.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:U(t.items,(function(t){return uE(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:xc([eh.config({mode:"acyclic",useTabstopAt:x(Bk)}),gk(n),Sk(n,{postprocess:function(t){return xz(t).fold((function(t){return console.error(t),{}}),b)}})])}},Sz=Nd({name:"TabButton",configFields:[fo("uid",void 0),Xr("value"),$r("dom","dom",fr((function(){return{attributes:{role:"tab",id:oa("aria"),"aria-selected":"false"}}})),Rr()),oo("action"),fo("domModification",{}),Ef("tabButtonBehaviours",[dh,eh,Of]),Xr("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Oh(t.action),behaviours:Rf(t.tabButtonBehaviours,[dh.config({}),eh.config({mode:"execution",useSpace:!0,useEnter:!0}),Of.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),kz=v([Xr("tabs"),Xr("dom"),fo("clickToDismiss",!1),Ef("tabbarBehaviours",[am,eh]),Ou(["tabClass","selectedClass"])]),Tz=id({factory:Sz,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){am.dehighlight(t,e),Ni(t,Oi(),{tabbar:t,button:e})},n=function(t,e){am.highlight(t,e),Ni(t,Ti(),{tabbar:t,button:e})};return{action:function(r){var o=r.getSystem().getByUid(t.uid).getOrDie(),i=am.isHighlighted(o,r);(i&&t.clickToDismiss?e:i?h:n)(o,r)},domModification:{classes:[t.markers.tabClass]}}}}),Oz=v([Tz]),Ez=Ad({name:"Tabbar",configFields:kz(),partFields:Oz(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Rf(t.tabbarBehaviours,[am.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){We(e.element,"aria-selected","true")},onDehighlight:function(t,e){We(e.element,"aria-selected","false")}}),eh.config({mode:"flow",getInitial:function(t){return am.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),_z=Nd({name:"Tabview",configFields:[Ef("tabviewBehaviours",[ah])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:Rf(t.tabviewBehaviours,[ah.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),Rz=v([fo("selectFirst",!0),_u("onChangeTab"),_u("onDismissTab"),fo("tabs",[]),Ef("tabSectionBehaviours",[])]),Nz=nd({factory:Ez,schema:[Xr("dom"),eo("markers",[Xr("tabClass"),Xr("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),Az=nd({factory:_z,name:"tabview"}),Dz=v([Nz,Az]),Mz=Ad({name:"TabSection",configFields:Rz(),partFields:Dz(),factory:function(t,e,n,r){var o=function(e,n){pd(e,t,"tabbar").each((function(t){n(t).each(Ai)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:_f(t.tabSectionBehaviours),events:zi(J([t.selectFirst?[$i((function(t,e){o(t,am.getFirst)}))]:[],[Ii(Ti(),(function(e,n){!function(e){var n=Of.getValue(e);pd(e,t,"tabview").each((function(r){X(t.tabs,(function(t){return t.value===n})).each((function(n){var o=n.view();$e(e.element,"id").each((function(t){We(r.element,"aria-labelledby",t)})),ah.set(r,o),t.onChangeTab(r,e,o)}))}))}(n.event.button)})),Ii(Oi(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return pd(e,t,"tabview").map((function(t){return ah.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=am.getCandidates(t);return X(n,(function(t){return Of.getValue(t)===e})).filter((function(e){return!am.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),Bz=function(t,e){Je(t,"height",e+"px"),pe().browser.isIE()?an(t,"flex-basis"):Je(t,"flex-basis",e+"px")},zz=function(t,e,n){cu(t,'[role="dialog"]').each((function(t){lu(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Je(e,"height","0"),Je(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=ke(t).dom,i=cu(t,".tox-dialog-wrap").getOr(t);r="fixed"===tn(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var a=ln(e),u=e.dom.offsetLeft>=n.dom.offsetLeft+bn(n)?Math.max(ln(n),a):a,c=parseInt(tn(t,"margin-top"),10)||0,s=parseInt(tn(t,"margin-bottom"),10)||0;return r-(ln(t)+c+s-u)}(t,e,r))})).each((function(t){Bz(e,t)}))}))}))},Pz=function(t){return lu(t,'[role="tabpanel"]')},Lz=function(t){var e;return{smartTabHeight:(e=Zc(),{extraEvents:[$i((function(n){var r=n.element;Pz(r).each((function(o){Je(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){(function(t){return at(ot(t,(function(t,e){return t>e?-1:t<e?1:0})))})(function(t,e,n){return U(t,(function(r,o){ah.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return ah.set(n,[]),i.height}))}(t,o,n)).fold(e.clear,e.set)})),zz(r,o,e),an(o,"visibility"),function(t,e){at(t).each((function(t){return Mz.showTab(e,t.value)}))}(t,n),hp.requestAnimationFrame((function(){zz(r,o,e)}))}))})),Ii(bi(),(function(t){var n=t.element;Pz(n).each((function(t){zz(n,t,e)}))})),Ii(dx,(function(t,n){var r=t.element;Pz(r).each((function(t){var n=Dc(ze(t));Je(t,"visibility","hidden");var o=nn(t,"height").map((function(t){return parseInt(t,10)}));an(t,"height"),an(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;o.forall((function(t){return i>t}))?(e.set(i),zz(r,t,e)):o.each((function(e){Bz(t,e)})),an(t,"visibility"),n.each(Nc)}))}))],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},Iz="send-data-to-section",Hz="send-data-to-view",Fz=function(t,e){var n=xo({}),r=function(t){var e=Of.getValue(t),r=xz(e).getOr({}),o=n.get(),i=ur(o,r);n.set(i)},o=function(t){var e=n.get();Of.setValue(t,e)},i=xo(null),a=U(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[ik.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:U(t.items,(function(t){return uE(n,t,e)})),formBehaviours:xc([eh.config({mode:"acyclic",useTabstopAt:x(Bk)}),uh("TabView.form.events",[$i(o),Gi(r)]),Ec.config({channels:Oo([{key:Iz,value:{onReceive:r}},{key:Hz,value:{onReceive:o}}])})])}}))]}}})),u=Lz(a).smartTabHeight;return Mz.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=Of.getValue(e);Ni(t,fx,{name:r,oldName:i.get()}),i.set(r)},tabs:a,components:[Mz.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[Ez.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:xc([Qw.config({})])}),Mz.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:u.selectFirst,tabSectionBehaviours:xc([uh("tabpanel",u.extraEvents),eh.config({mode:"acyclic"}),zd.config({find:function(t){return at(Mz.getViewItems(t))}}),Of.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([Iz],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([Hz],{})}}})])})},Vz=oa("update-dialog"),jz=oa("update-title"),Uz=oa("update-body"),Wz=oa("update-footer"),qz=oa("body-send-message"),$z=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:O(O({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:xc([hk(0),uA.config({channel:Uz,updateState:function(t,e){return B.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[Fz(t.body,n)];default:return[Cz(t.body,n)]}},initialData:t})])}},Gz=oy.deviceType.isTouch(),Kz=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},Xz=function(t,e){return XM.parts.close(pp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:xc([Qw.config({})])}))},Yz=function(){return XM.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},Jz=function(t,e){return XM.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:NR("<p>"+e.translate(t)+"</p>")}]}]})},Qz=function(t){return XM.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},Zz=function(t,e){return[qw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),qw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},tP=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return XM.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),B.some(!0)},useTabstopAt:function(t){return!Bk(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:O({position:"relative"},t.extraStyles)},components:_([t.header,t.body],t.footer.toArray(),!0),parts:{blocker:{dom:NR('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:Gz?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:xc(_([dh.config({}),uh("dialog-events",t.dialogEvents.concat([qi(qo(),(function(t,e){eh.focusIn(t)}))])),uh("scroll-lock",[$i((function(){La(Ve(),i)})),Gi((function(){Ha(Ve(),i)}))])],t.extraBehaviours,!0)),eventOrder:O((e={},e[ci()]=["dialog-events"],e[yi()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[wi()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},eP=function(t){return pp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[Ep("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){Ri(t,ax)}})},nP=function(t,e,n){var r=function(t){return[Qa(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:O({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:xc([uA.config({channel:jz,renderComponents:r})])}},rP=function(){return{dom:NR('<div class="tox-dialog__draghandle"></div>')}},oP=function(t,e){return function(t,e){var n=XM.parts.title(nP(t,B.none(),e)),r=XM.parts.draghandle(rP()),o=XM.parts.close(eP(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return qw.sketch({dom:NR('<div class="tox-dialog__header"></div>'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},iP=function(t,e,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:NR('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},aP=function(t,e,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){XM.setBusy(t(),(function(t,r){return iP(n.message,r,e)}))},onUnblock:function(){XM.setIdle(t())}}},uP=function(t,e,n,r){var o;return eu(tP(O(O({},t),{lazySink:r.shared.getSink,extraBehaviours:_([uA.config({channel:Vz,updateState:function(t,e){return B.some(e)},initialData:e}),Ok({})],t.extraBehaviours,!0),onEscape:function(t){Ri(t,ax)},dialogEvents:n,eventOrder:(o={},o[ui()]=[uA.name(),Ec.name()],o[yi()]=["scroll-lock",uA.name(),"messages","dialog-events","alloy.base.behaviour"],o[wi()]=["alloy.base.behaviour","dialog-events","messages",uA.name(),"scroll-lock"],o)})))},cP=function(t){return U(t,(function(t){return"menu"===t.type?function(t){var e=U(t.items,(function(t){var e=xo(!1);return O(O({},t),{storage:e})}));return O(O({},t),{items:e})}(t):t}))},sP=function(t){return K(t,(function(t,e){return"menu"===e.type?K(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},lP=function(t,e){return[ji(qo(),Mk),t(ix,(function(t,n){e.onClose(),n.onClose()})),t(ax,(function(t,e,n,r){e.onCancel(t),Ri(r,ix)})),Ii(lx,(function(t,n){return e.onUnblock()})),Ii(sx,(function(t,n){return e.onBlock(n.event)}))]},fP=function(t,e){var n=function(e,n){return Ii(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event,e)}))}))},r=function(t,e){uA.getState(t).get().each((function(n){e(n,t)}))};return _(_([],lP(n,e),!0),[n(ux,(function(t,e,n){e.onAction(t,{name:n.name})}))],!1)},dP=function(t,e,n){var r=function(e,n){return Ii(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){uA.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return _(_([],lP(r,e),!0),[r(cx,(function(t,e){return e.onSubmit(t)})),r(ox,(function(t,e,n){e.onChange(t,{name:n.name})})),r(ux,(function(t,e,r,o){var i=function(){return eh.focusIn(o)},a=function(t){return Ge(t,"disabled")||$e(t,"aria-disabled").exists((function(t){return"true"===t}))},u=ze(o.element),c=Dc(u);e.onAction(t,{name:r.name,value:r.value}),Dc(u).fold(i,(function(t){a(t)||c.exists((function(e){return xe(t,e)&&a(e)}))?i():n().toOptional().filter((function(e){return!xe(e.element,t)})).each(i)}))})),r(fx,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),Gi((function(e){var n=t();Of.setValue(e,n.getData())}))],!1)},mP=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=q(n,(function(t){return"start"===t.align})),o=function(t,e){return qw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:U(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},gP=function(t,e){return{dom:NR('<div class="tox-dialog__footer"></div>'),components:[],behaviours:xc([uA.config({channel:Wz,initialData:t,updateState:function(t,n){var r=U(n.buttons,(function(t){var n=vp(function(t,e){return KT(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return B.some({lookupByName:function(t,e){return function(t,e,n){return X(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:mP})])}},hP=function(t,e){return XM.parts.footer(gP(t,e))},pP=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=zd.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return ik.getField(n,e).fold((function(){var r=t.getFooter();return uA.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return B.some(t)}))}return B.none()},vP=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},i={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=Of.getValue(r),i=mt(n,(function(t){return t.get()}));return O(O({},o),i)},setData:function(e){r((function(r){var o=i.getData(),a=O(O({},o),e),u=function(t,e){var n=t.getRoot();return uA.getState(n).get().map((function(t){return jr(Vr("data",t.dataValidator,e))})).getOr(e)}(t,a),c=t.getFormWrapper();Of.setValue(c,u),dt(n,(function(t,e){wt(a,e)&&t.set(a[e])}))}))},disable:function(e){pP(t,e).each(Xd.disable)},enable:function(e){pP(t,e).each(Xd.enable)},focus:function(e){pP(t,e).each(dh.focus)},block:function(t){if(!o(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){Ni(e,sx,{message:t})}))},unblock:function(){r((function(t){Ri(t,lx)}))},showTab:function(e){r((function(n){var r=t.getBody();uA.getState(r).get().exists((function(t){return t.isTabPanel()}))&&zd.getCurrent(r).each((function(t){Mz.showTab(t,e)}))}))},redial:function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([Vz],r),n.getSystem().broadcastOn([jz],r.internalDialog),n.getSystem().broadcastOn([Uz],r.internalDialog),n.getSystem().broadcastOn([Wz],r.internalDialog),i.setData(r.initialData)}))},close:function(){r((function(t){Ri(t,ix)}))}};return i},bP=function(t,e,n){var r=oP(t.internalDialog.title,n),o=function(t,e){var n=$z(t,B.none(),e,!1);return XM.parts.body(n)}({body:t.internalDialog.body},n),i=cP(t.internalDialog.buttons),a=sP(i),u=hP({buttons:i},n),c=dP((function(){return m}),aP((function(){return f}),n.shared.providers,e),n.shared.getSink),s=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),l={header:r,body:o,footer:B.some(u),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=uP(l,t,c,n),d={getRoot:v(f),getBody:function(){return XM.getBody(f)},getFooter:function(){return XM.getFooter(f)},getFormWrapper:function(){var t=XM.getBody(f);return zd.getCurrent(t).getOr(t)}},m=vP(d,e.redial,a);return{dialog:f,instanceApi:m}},yP=function(t,e,n,r){var o,i,a,u,c,s=oa("dialog-label"),l=oa("dialog-content"),f=vp((a={title:t.internalDialog.title,draggable:!0},u=s,c=n.shared.providers,qw.sketch({dom:NR('<div class="tox-dialog__header"></div>'),components:[nP(a,B.some(u),c),rP(),eP(c)],containerBehaviours:xc([BM.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return fu(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=vp(function(t,e,n,r){return $z(t,B.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=cP(t.internalDialog.buttons),g=sP(m),h=vp(function(t,e){return gP(t,e)}({buttons:m},n)),p=dP((function(){return y}),{onBlock:function(t){RR.block(b,(function(e,r){return iP(t.message,r,n.shared.providers)}))},onUnblock:function(){RR.unblock(b)},onClose:function(){return e.closeWindow()}},n.shared.getSink),b=eu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=s,o["aria-describedby"]=l,o)},eventOrder:(i={},i[ui()]=[uA.name(),Ec.name()],i[ci()]=["execute-on-form"],i[yi()]=["reflecting","execute-on-form"],i),behaviours:xc([eh.config({mode:"cyclic",onEscape:function(t){return Ri(t,ix),B.some(!0)},useTabstopAt:function(t){return!Bk(t)&&("button"!==Pt(t)||"disabled"!==qe(t,"disabled"))}}),uA.config({channel:Vz,updateState:function(t,e){return B.some(e)},initialData:t}),dh.config({}),uh("execute-on-form",p.concat([qi(qo(),(function(t,e){eh.focusIn(t)}))])),RR.config({getRoot:function(){return B.some(b)}}),ah.config({}),Ok({})]),components:[f.asSpec(),d.asSpec(),h.asSpec()]}),y=vP({getRoot:v(b),getFooter:function(){return h.get(b)},getBody:function(){return d.get(b)},getFormWrapper:function(){var t=d.get(b);return zd.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:b,instanceApi:y}},wP=tinymce.util.Tools.resolve("tinymce.util.URI"),xP=["insertContent","setContent","execCommand","close","block","unblock"],CP=function(t){return i(t)&&-1!==xP.indexOf(t.mceAction)},SP=function(t,e,n,r){var a,u,s,l=oP(t.title,r),f=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[Ak({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:xc([Qw.config({}),dh.config({})])})]}],behaviours:xc([eh.config({mode:"acyclic",useTabstopAt:x(Bk)})])};return XM.parts.body(e)}(t),d=t.buttons.bind((function(t){return 0===t.length?B.none():B.some(hP({buttons:t},r))})),m=fP((function(){return C}),aP((function(){return w}),r.shared.providers,e)),g=O(O({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),h=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],p=new wP(t.url,{base_uri:new wP(window.location.href)}),v=p.protocol+"://"+p.host+(p.port?":"+p.port:""),b=Qc(),y=[uh("messages",[$i((function(){var e=es(Bt.fromDom(window),"message",(function(e){if(p.isSameOrigin(new wP(e.raw.origin))){var r=e.raw.data;CP(r)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!c(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(n,C,r):function(t){return!CP(t)&&i(t)&&wt(t,"mceAction")}(r)&&t.onMessage(C,r)}}));b.set(e)})),Gi(b.clear)]),Ec.config({channels:(a={},a[qz]={onReceive:function(t,e){lu(t.element,"iframe").each((function(t){t.dom.contentWindow.postMessage(e,v)}))}},a)})],w=uP({header:l,body:f,footer:d,extraClasses:h,extraBehaviours:y,extraStyles:g},t,m,r),C=(u=w,s=function(t){u.getSystem().isConnected()&&t(u)},{block:function(t){if(!o(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");s((function(e){Ni(e,sx,{message:t})}))},unblock:function(){s((function(t){Ri(t,lx)}))},close:function(){s((function(t){Ri(t,ix)}))},sendMessage:function(t){s((function(e){e.getSystem().broadcastOn([qz],t)}))}});return{dialog:w,instanceApi:C}},kP=function(t,e,n){return e&&n?[]:[z_.config({contextual:{lazyContext:function(){return B.some(Hn(Bt.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},TP=function(t){var e=t.backstage,n=t.editor,r=Pb(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){XM.hide(c),r()},i=vp(KT({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:B.none()},"cancel",t.backstage)),a=Yz(),u=Xz(o,e.providers),c=eu(tP({lazySink:function(){return e.getSink()},header:Kz(a,u),body:Jz(n,e.providers),footer:B.some(Qz(Zz([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ii(ax,o)],eventOrder:{}}));XM.show(c);var s=i.get(c);dh.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){XM.hide(s),r(t)},i=vp(KT({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:B.none()},"submit",t.backstage)),a=KT({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:B.none()},"cancel",t.backstage),u=Yz(),c=Xz((function(){return o(!1)}),e.providers),s=eu(tP({lazySink:function(){return e.getSink()},header:Kz(u,c),body:Jz(n,e.providers),footer:B.some(Qz(Zz([],[a,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ii(ax,(function(){return o(!1)})),Ii(cx,(function(){return o(!0)}))],eventOrder:{}}));XM.show(s);var l=i.get(s);dh.focus(l)}}}(t),a=function(t,r){return wz.openUrl((function(t){var o=SP(t,{closeWindow:function(){XM.hide(o.dialog),r(o.instanceApi)}},n,e);return XM.show(o.dialog),o.instanceApi}),t)},u=function(t,n){return wz.open((function(t,r,o){var i=r,a=bP({dataValidator:o,initialData:i,internalDialog:t},{redial:wz.redial,closeWindow:function(){XM.hide(a.dialog),n(a.instanceApi)}},e);return XM.show(a.dialog),a.instanceApi.setData(i),a.instanceApi}),t)},c=function(t,o,i,a){return wz.open((function(t,u,c){var s=jr(Vr("data",c,u)),l=Zc(),f=e.shared.header.isPositionedAtTop(),d=function(){return l.on((function(t){Xh.reposition(t),z_.refresh(t)}))},m=yP({dataValidator:c,initialData:s,internalDialog:t},{redial:wz.redial,closeWindow:function(){l.on(Xh.hide),n.off("ResizeEditor",d),l.clear(),i(m.instanceApi)}},e,a),g=eu(Xh.sketch(O(O({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},f?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:xc(_([uh("window-manager-inline-events",[Ii(xi(),(function(t,e){Ri(m.dialog,ax)}))])],kP(n,r,f),!0)),isExtraPart:function(t,e){return function(t){return Aw(t,".tox-alert-dialog")||Aw(t,".tox-confirm-dialog")}(e)}})));return l.set(g),Xh.showWithin(g,nu(m.dialog),{anchor:o},B.some(Ve())),r&&f||(z_.refresh(g),n.on("ResizeEditor",d)),m.instanceApi.setData(s),eh.focusIn(m.dialog),m.instanceApi}),t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?c(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?c(t,e.shared.anchors.cursor(),r,n.ariaAttrs):u(t,r)},openUrl:function(t,e){return a(t,e)},alert:function(t,e){o.open(t,(function(){e()}))},close:function(t){t.close()},confirm:function(t,e){i.open(t,(function(t){e(t)}))}}};T.add("silver",(function(t){var e=qM(t),n=e.uiMothership,r=e.backstage,o=e.renderUI,i=e.getUi;Nw(t,r.shared);var a=TP({editor:t,backstage:r});return{renderUI:o,getWindowManagerImpl:v(a),getNotificationManagerImpl:function(){return Np(t,{backstage:r},n)},ui:i()}}))}()},7575:(t,e,n)=>{!function(){"use strict";var e=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return{eq:t}},o=r((function(t,e){return t===e})),i=function(t){return r((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))},a=function(t,e){return function(t,e){return r((function(n,r){return t.eq(e(n),e(r))}))}(i(t),(function(t){return function(t,e){return Array.prototype.slice.call(t).sort(e)}(t,e)}))},u=function(t){return r((function(e,n){var r=Object.keys(e),i=Object.keys(n);if(!a(o).eq(r,i))return!1;for(var u=r.length,c=0;c<u;c++){var s=r[c];if(!t.eq(e[s],n[s]))return!1}return!0}))},c=r((function(t,n){if(t===n)return!0;var r=e(t);return r===e(n)&&(function(t){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(t)}(r)?t===n:"array"===r?i(c).eq(t,n):"object"===r&&u(c).eq(t,n))})),s=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},l=function(t){return function(e){return typeof e===t}},f=function(t){return function(e){return t===e}},d=s("string"),m=s("object"),g=s("array"),h=f(null),p=l("boolean"),v=f(void 0),b=function(t){return null==t},y=function(t){return!b(t)},w=l("function"),x=l("number"),C=function(){},S=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},k=function(t,e){return function(n){return t(e(n))}},T=function(t){return function(){return t}},O=function(t){return t},E=function(t,e){return t===e};function _(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var R=function(t){return function(e){return!t(e)}},N=function(t){return t()},A=function(t){t()},D=T(!1),M=T(!0),B=function(){return z},z=function(){var t=function(t){return t()},e=O;return{fold:function(t,e){return t()},isSome:D,isNone:M,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:T(null),getOrUndefined:T(void 0),or:e,orThunk:t,map:B,each:C,bind:B,exists:D,forall:M,filter:function(){return B()},toArray:function(){return[]},toString:T("none()")}}(),P=function(t){var e=T(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:M,isNone:D,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return P(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:z},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},L={some:P,none:B,from:function(t){return null==t?z:P(t)}},I=Array.prototype.slice,H=Array.prototype.indexOf,F=Array.prototype.push,V=function(t,e){return H.call(t,e)},j=function(t,e){return V(t,e)>-1},U=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},W=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},q=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},$=function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}},G=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var a=t[o];(e(a,o)?n:r).push(a)}return{pass:n,fail:r}},K=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},X=function(t,e,n){return $(t,(function(t,r){n=e(n,t,r)})),n},Y=function(t,e,n){return q(t,(function(t,r){n=e(n,t,r)})),n},J=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return L.some(i);if(n(i,r))break}return L.none()},Q=function(t,e){return J(t,e,D)},Z=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return L.some(n)}return L.none()},tt=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!g(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);F.apply(e,t[n])}return e}(W(t,e))},et=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},nt=function(t){var e=I.call(t,0);return e.reverse(),e},rt=function(t,e){return K(t,(function(t){return!j(e,t)}))},ot=function(t,e){var n=I.call(t,0);return n.sort(e),n},it=function(t,e){return e>=0&&e<t.length?L.some(t[e]):L.none()},at=function(t){return it(t,0)},ut=function(t){return it(t,t.length-1)},ct=w(Array.from)?Array.from:function(t){return I.call(t)},st=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return L.none()},lt=Object.keys,ft=Object.hasOwnProperty,dt=function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},mt=function(t,e){return gt(t,(function(t,n){return{k:n,v:e(t,n)}}))},gt=function(t,e){var n={};return dt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},ht=function(t){return function(e,n){t[n]=e}},pt=function(t,e,n,r){return dt(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},vt=function(t,e){var n={};return pt(t,e,ht(n),C),n},bt=function(t){return function(t,e){var n=[];return dt(t,(function(t,r){n.push(e(t,r))})),n}(t,O)},yt=function(t,e){return wt(t,e)?L.from(t[e]):L.none()},wt=function(t,e){return ft.call(t,e)},xt=function(t,e){return wt(t,e)&&void 0!==t[e]&&null!==t[e]},Ct=Array.isArray,St=function(t,e,n){var r,o;if(!t)return!1;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return!1}else for(r in t)if(wt(t,r)&&!1===e.call(n,t[r],r,t))return!1;return!0},kt=function(t,e){var n=[];return St(t,(function(r,o){n.push(e(r,o,t))})),n},Tt=function(t,e){var n=[];return St(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},Ot=function(t,e){if(t)for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},Et=function(t,e,n,r){for(var o=v(n)?t[0]:n,i=0;i<t.length;i++)o=e.call(r,o,t[i],i);return o},_t=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},Rt=function(t){return t[t.length-1]},Nt=function(){return(Nt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function At(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var Dt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Mt=function(){return Bt(0,0)},Bt=function(t,e){return{major:t,minor:e}},zt={nu:Bt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Mt():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Bt(r(1),r(2))}(t,n)},unknown:Mt},Pt=function(t,e){var n=String(e).toLowerCase();return Q(t,(function(t){return t.search(n)}))},Lt=function(t,e){return-1!==t.indexOf(e)},It=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,0)},Ht=function(t){return function(e){return e.replace(t,"")}},Ft=Ht(/^\s+|\s+$/g),Vt=Ht(/^\s+/g),jt=Ht(/\s+$/g),Ut=function(t){return t.length>0},Wt=function(t){return!Ut(t)},qt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$t=function(t){return function(e){return Lt(e,t)}},Gt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Lt(t,"edge/")&&Lt(t,"chrome")&&Lt(t,"safari")&&Lt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,qt],search:function(t){return Lt(t,"chrome")&&!Lt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Lt(t,"msie")||Lt(t,"trident")}},{name:"Opera",versionRegexes:[qt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$t("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$t("firefox")},{name:"Safari",versionRegexes:[qt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Lt(t,"safari")||Lt(t,"mobile/"))&&Lt(t,"applewebkit")}}],Kt=[{name:"Windows",search:$t("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Lt(t,"iphone")||Lt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$t("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$t("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$t("linux"),versionRegexes:[]},{name:"Solaris",search:$t("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$t("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:$t("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Xt={browsers:T(Gt),oses:T(Kt)},Yt="Edge",Jt="Chrome",Qt="Opera",Zt="Firefox",te="Safari",ee=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Yt),isChrome:r(Jt),isIE:r("IE"),isOpera:r(Qt),isFirefox:r(Zt),isSafari:r(te)}},ne={unknown:function(){return ee({current:void 0,version:zt.unknown()})},nu:ee,edge:T(Yt),chrome:T(Jt),ie:T("IE"),opera:T(Qt),firefox:T(Zt),safari:T(te)},re="Windows",oe="Android",ie="Linux",ae="Solaris",ue="FreeBSD",ce="ChromeOS",se=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(re),isiOS:r("iOS"),isAndroid:r(oe),isOSX:r("OSX"),isLinux:r(ie),isSolaris:r(ae),isFreeBSD:r(ue),isChromeOS:r(ce)}},le={unknown:function(){return se({current:void 0,version:zt.unknown()})},nu:se,windows:T(re),ios:T("iOS"),android:T(oe),linux:T(ie),osx:T("OSX"),solaris:T(ae),freebsd:T(ue),chromeos:T(ce)},fe=function(t,e,n){var r=Xt.browsers(),o=Xt.oses(),i=e.bind((function(t){return function(t,e){return st(e.brands,(function(e){var n=e.brand.toLowerCase();return Q(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:zt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return Pt(t,e).map((function(t){var n=zt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(ne.unknown,ne.nu),a=function(t,e){return Pt(t,e).map((function(t){var n=zt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(le.unknown,le.nu),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:T(o),isiPhone:T(i),isTablet:T(c),isPhone:T(s),isTouch:T(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:T(l),isDesktop:T(f)}}(a,i,t,n);return{browser:i,os:a,deviceType:u}},de=function(t){return window.matchMedia(t).matches},me=Dt((function(){return fe(navigator.userAgent,L.from(navigator.userAgentData),de)})),ge=function(){return me()},he=navigator.userAgent,pe=ge(),ve=pe.browser,be=pe.os,ye=pe.deviceType,we=/WebKit/.test(he)&&!ve.isEdge(),xe="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,Ce=-1!==he.indexOf("Windows Phone"),Se={opera:ve.isOpera(),webkit:we,ie:!(!ve.isIE()&&!ve.isEdge())&&ve.version.major,gecko:ve.isFirefox(),mac:be.isOSX()||be.isiOS(),iOS:ye.isiPad()||ye.isiPhone(),android:be.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:ve.isIE()?document.documentMode||7:10,fileApi:xe,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!ve.isIE(),desktop:ye.isDesktop(),windowsPhone:Ce,browser:{current:ve.current,version:ve.version,isChrome:ve.isChrome,isEdge:ve.isEdge,isFirefox:ve.isFirefox,isIE:ve.isIE,isOpera:ve.isOpera,isSafari:ve.isSafari},os:{current:be.current,version:be.version,isAndroid:be.isAndroid,isChromeOS:be.isChromeOS,isFreeBSD:be.isFreeBSD,isiOS:be.isiOS,isLinux:be.isLinux,isOSX:be.isOSX,isSolaris:be.isSolaris,isWindows:be.isWindows},deviceType:{isDesktop:ye.isDesktop,isiPad:ye.isiPad,isiPhone:ye.isiPhone,isPhone:ye.isPhone,isTablet:ye.isTablet,isTouch:ye.isTouch,isWebView:ye.isWebView}},ke=/^\s*|\s*$/g,Te=function(t){return null==t?"":(""+t).replace(ke,"")},Oe=function(t,e){return e?!("array"!==e||!Ct(t))||typeof t===e:void 0!==t},Ee=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),St(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;Ee(t,e,n,r)})))},_e={trim:Te,isArray:Ct,is:Oe,toArray:function(t){if(Ct(t))return t;for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e},makeMap:function(t,e,n){var r;for(e=e||",","string"==typeof(t=t||[])&&(t=t.split(e)),n=n||{},r=t.length;r--;)n[t[r]]={};return n},each:St,map:kt,grep:Tt,inArray:Ot,hasOwn:wt,extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(wt(o,i)){var a=o[i];void 0!==a&&(t[i]=a)}}return t},create:function(t,e,n){var r,o,i,a=this,u=0,c=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],s=a.createNS(t[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===t[2])return s[c]=e,void(this.onCreate&&this.onCreate(t[2],t[3],s[c]));e[c]||(e[c]=function(){},u=1),s[c]=e[c],a.extend(s[c].prototype,e),t[5]&&(r=a.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=u?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],a.each(r,(function(t,e){s[c].prototype[e]=r[e]})),a.each(e,(function(t,e){r[e]?s[c].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==c&&(s[c].prototype[e]=t)}))),a.each(e.static,(function(t,e){s[c][e]=t}))}},walk:Ee,createNS:function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0;n<t.length;n++)e[r=t[n]]||(e[r]={}),e=e[r];return e},resolve:function(t,e){var n,r;for(e=e||window,n=0,r=(t=t.split(".")).length;n<r&&(e=e[t[n]]);n++);return e},explode:function(t,e){return!t||Oe(t,"array")?t:kt(t.split(e||","),Te)},_addCacheSuffix:function(t){var e=Se.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},Re=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Ne={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Re(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Re(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Re(n)},fromDom:Re,fromPoint:function(t,e,n){return L.from(t.dom.elementFromPoint(e,n)).map(Re)}},Ae=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},De=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Me=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Be=function(t,e){return t.dom===e.dom},ze=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},Pe=function(t,e){return ge().browser.isIE()?ze(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)};"undefined"!=typeof window?window:Function("return this;")();var Le=function(t){return t.dom.nodeName.toLowerCase()},Ie=function(t){return t.dom.nodeType},He=function(t){return function(e){return Ie(e)===t}},Fe=He(1),Ve=He(3),je=He(9),Ue=He(11),We=function(t){return Ne.fromDom(t.dom.ownerDocument)},qe=function(t){return je(t)?t:We(t)},$e=function(t){return Ne.fromDom(qe(t).dom.defaultView)},Ge=function(t){return L.from(t.dom.parentNode).map(Ne.fromDom)},Ke=function(t){return L.from(t.dom.previousSibling).map(Ne.fromDom)},Xe=function(t){return L.from(t.dom.nextSibling).map(Ne.fromDom)},Ye=function(t){return nt(Ae(t,Ke))},Je=function(t){return Ae(t,Xe)},Qe=function(t){return W(t.dom.childNodes,Ne.fromDom)},Ze=function(t,e){var n=t.dom.childNodes;return L.from(n[e]).map(Ne.fromDom)},tn=function(t){return Ze(t,0)},en=function(t){return Ze(t,t.dom.childNodes.length-1)},nn=function(t){return t.dom.childNodes.length},rn=function(t){return Ue(t)&&y(t.dom.host)},on=w(Element.prototype.attachShadow)&&w(Node.prototype.getRootNode),an=T(on),un=on?function(t){return Ne.fromDom(t.dom.getRootNode())}:qe,cn=function(t){return rn(t)?t:function(t){var e=t.dom.head;if(null==e)throw new Error("Head is not available yet");return Ne.fromDom(e)}(qe(t))},sn=function(t){return Ne.fromDom(t.dom.host)},ln=function(t){return y(t.dom.shadowRoot)},fn=function(t,e){Ge(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},dn=function(t,e){Xe(t).fold((function(){Ge(t).each((function(t){gn(t,e)}))}),(function(t){fn(t,e)}))},mn=function(t,e){tn(t).fold((function(){gn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},gn=function(t,e){t.dom.appendChild(e.dom)},hn=function(t,e){q(e,(function(e){gn(t,e)}))},pn=function(t){t.dom.textContent="",q(Qe(t),(function(t){vn(t)}))},vn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},bn=function(t){var e,n=Qe(t);n.length>0&&(e=t,q(n,(function(t){fn(e,t)}))),vn(t)},yn=function(t){var e=Ve(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n=e.ownerDocument;return function(t){var e=un(t);return rn(e)?L.some(e):L.none()}(Ne.fromDom(e)).fold((function(){return n.body.contains(e)}),k(yn,sn))},wn=function(t,e){return{left:t,top:e,translate:function(n,r){return wn(t+n,e+r)}}},xn=wn,Cn=function(t,e){return void 0!==t?t:void 0!==e?e:0},Sn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?xn(n.offsetLeft,n.offsetTop):yn(t)?function(t){var e=t.getBoundingClientRect();return xn(e.left,e.top)}(e):xn(0,0)},kn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return xn(n,r)},Tn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},On=function(t,e){ge().browser.isSafari()&&w(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},En=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},_n=function(t){var e=void 0===t?window:t,n=e.document,r=kn(Ne.fromDom(n));return function(t){var e=void 0===t?window:t;return ge().browser.isFirefox()?L.none():L.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return En(r.left,r.top,n,o)}),(function(t){return En(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Rn=function(t){return function(e){return!!e&&e.nodeType===t}},Nn=function(t){return!!t&&!Object.getPrototypeOf(t)},An=Rn(1),Dn=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return j(e,n)}return!1}},Mn=function(t,e){var n=e.toLowerCase().split(" ");return function(e){if(An(e))for(var r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}},Bn=function(t){return function(e){return An(e)&&e.hasAttribute(t)}},zn=function(t){return An(t)&&t.hasAttribute("data-mce-bogus")},Pn=function(t){return An(t)&&"TABLE"===t.tagName},Ln=function(t){return function(e){if(An(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},In=Dn(["textarea","input"]),Hn=Rn(3),Fn=Rn(8),Vn=Rn(9),jn=Rn(11),Un=Dn(["br"]),Wn=Dn(["img"]),qn=Ln("true"),$n=Ln("false"),Gn=Dn(["td","th"]),Kn=Dn(["video","audio","object","embed"]),Xn=function(t,e,n){return void 0===n&&(n=E),t.exists((function(t){return n(t,e)}))},Yn=function(t,e,n){return t.isSome()&&e.isSome()?L.some(n(t.getOrDie(),e.getOrDie())):L.none()},Jn=function(t){return void 0!==t.style&&w(t.style.getPropertyValue)},Qn=function(t,e,n){if(!(d(n)||p(n)||x(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Zn=function(t,e,n){Qn(t.dom,e,n)},tr=function(t,e){var n=t.dom;dt(e,(function(t,e){Qn(n,e,t)}))},er=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},nr=function(t,e){return L.from(er(t,e))},rr=function(t,e){t.dom.removeAttribute(e)},or=function(t,e){var n=t.dom;dt(e,(function(t,e){!function(t,e,n){if(!d(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Jn(t)&&t.style.setProperty(e,n)}(n,e,t)}))},ir=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||yn(t)?r:ar(n,e)},ar=function(t,e){return Jn(t)?t.style.getPropertyValue(e):""},ur=function(t,e){var n=t.dom,r=ar(n,e);return L.from(r).filter((function(t){return t.length>0}))},cr=function(t){var e={},n=t.dom;if(Jn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},sr=ge().browser,lr=function(t){return Q(t,Fe)},fr=function(t,e){return t.children&&j(t.children,e)},dr=function(t,e,n){var r=0,o=0,i=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===ir(Ne.fromDom(t),"position")){var a=e.getBoundingClientRect();return{x:r=a.left+(i.documentElement.scrollLeft||t.scrollLeft)-i.documentElement.clientLeft,y:o=a.top+(i.documentElement.scrollTop||t.scrollTop)-i.documentElement.clientTop}}for(var u=e;u&&u!==n&&u.nodeType&&!fr(u,n);){var c=u;r+=c.offsetLeft||0,o+=c.offsetTop||0,u=c.offsetParent}for(u=e.parentNode;u&&u!==n&&u.nodeType&&!fr(u,n);)r-=u.scrollLeft||0,o-=u.scrollTop||0,u=u.parentNode;o+=function(t){return sr.isFirefox()&&"table"===Le(t)?lr(Qe(t)).filter((function(t){return"caption"===Le(t)})).bind((function(t){return lr(Je(t)).map((function(e){var n=e.dom.offsetTop,r=t.dom.offsetTop,o=t.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(Ne.fromDom(e))}return{x:r,y:o}},mr={},gr={exports:mr};!function(t,e,r,o){var i,a;i=this,a=function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},e={exports:{}};!function(e){!function(t){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void u(e.promise,t)}a(e.promise,r)}else(1===t._state?a:u)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){u(t,e)}var r,i}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(t){o(i,t)}),n)}e[i]=a,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(t)}(e);var r=e.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||r}},"object"==typeof e&&void 0!==r?r.exports=a():"function"==typeof t&&t.amd?t(a):(i="undefined"!=typeof globalThis?globalThis:i||self).EphoxContactWrapper=a()}(void 0,mr,gr);var hr=gr.exports.boltExport,pr=function(t){var e=L.none(),n=[],r=function(t){o()?a(t):n.push(t)},o=function(){return e.isSome()},i=function(t){q(t,a)},a=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=L.some(t),i(n),n=[])})),{get:r,map:function(t){return pr((function(e){r((function(n){e(t(n))}))}))},isReady:o}},vr={nu:pr,pure:function(t){return pr((function(e){e(t)}))}},br=function(t){setTimeout((function(){throw t}),0)},yr=function(t){var e=function(e){t().then(e,br)};return{map:function(e){return yr((function(){return t().then(e)}))},bind:function(e){return yr((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return yr((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return vr.nu(e)},toCached:function(){var e=null;return yr((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},wr=function(t){return yr((function(){return new hr(t)}))},xr=function(t,e){return e((function(e){var n=[],r=0;0===t.length?e([]):q(t,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))}))}))},Cr=function(t){return{isValue:M,isError:D,getOr:T(t),getOrThunk:T(t),getOrDie:T(t),or:function(e){return Cr(t)},orThunk:function(e){return Cr(t)},fold:function(e,n){return n(t)},map:function(e){return Cr(e(t))},mapError:function(e){return Cr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return L.some(t)}}},Sr=function(t){return{isValue:D,isError:M,getOr:O,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:O,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Sr(t)},mapError:function(e){return Sr(e(t))},each:C,bind:function(e){return Sr(t)},exists:D,forall:M,toOptional:L.none}},kr={value:Cr,error:Sr,fromOption:function(t,e){return t.fold((function(){return Sr(e)}),Cr)}},Tr=function(t){if(!g(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return q(t,(function(r,o){var i=lt(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!g(u))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==u.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+u.length+" ("+u+"), got "+i);var c=function(t){var r=lt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!et(e,(function(t){return j(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:c,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}})),n};Tr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Or=function(t){return t.fold(O,O)};function Er(t,e,n,r,o){return t(n,r)?L.some(n):w(o)&&o(n)?L.none():e(n,r,o)}var _r,Rr,Nr,Ar,Dr,Mr,Br,zr,Pr,Lr,Ir,Hr,Fr,Vr,jr,Ur,Wr,qr,$r,Gr,Kr=function(t,e,n){for(var r=t.dom,o=w(n)?n:D;r.parentNode;){r=r.parentNode;var i=Ne.fromDom(r);if(e(i))return L.some(i);if(o(i))break}return L.none()},Xr=function(t,e,n){return Er((function(t,e){return e(t)}),Kr,t,e,n)},Yr=function(t,e){return Q(t.dom.childNodes,(function(t){return e(Ne.fromDom(t))})).map(Ne.fromDom)},Jr=function(t,e,n){return Kr(t,(function(t){return De(t,e)}),n)},Qr=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Me(n)?L.none():L.from(n.querySelector(t)).map(Ne.fromDom)}(e,t)},Zr=function(t,e,n){return Er((function(t,e){return De(t,e)}),Jr,t,e,n)},to=window.Promise?window.Promise:hr,eo=function(t,e){return"number"!=typeof e&&(e=0),setTimeout(t,e)},no=function(t,e){return"number"!=typeof e&&(e=1),setInterval(t,e)},ro=function(t,e){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=eo((function(){t.apply(this,r)}),e)};return r.stop=function(){clearTimeout(n)},r},oo={requestAnimationFrame:function(t,e){_r?_r.then(t):_r=new to((function(t){e||(e=document.body),function(t,e){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];n||(n=function(t){window.setTimeout(t,0)}),n(t,e)}(t,e)})).then(t)},setTimeout:eo,setInterval:no,setEditorTimeout:function(t,e,n){return eo((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,n){var r=no((function(){t.removed?clearInterval(r):e()}),n);return r},debounce:ro,throttle:ro,clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)}},io=function(t,e){void 0===e&&(e={});var n=0,r={},o=Ne.fromDom(t),i=qe(o),a=e.maxLoadTime||5e3,u=function(u,c,s){var l,f=_e._addCacheSuffix(u),d=function(t){return yt(r,t).getOrThunk((function(){return{id:"mce-u"+n++,passed:[],failed:[],count:0}}))}(f);r[f]=d,d.count++;var m=function(t,e){for(var n=t.length;n--;)t[n]();d.status=e,d.passed=[],d.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},g=function(){return m(d.passed,2)},h=function(){return m(d.failed,3)},p=function(){var e;e=p,function(){for(var e=t.styleSheets,n=e.length;n--;){var r=e[n].ownerNode;if(r&&r.id===l.id)return g(),!0}return!1}()||(Date.now()-y<a?oo.setTimeout(e):h())};if(c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var v=Ne.fromTag("link",i.dom);tr(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();e.contentCssCors&&Zn(v,"crossOrigin","anonymous"),e.referrerPolicy&&Zn(v,"referrerpolicy",e.referrerPolicy),(l=v.dom).onload=p,l.onerror=h,b=v,gn(cn(o),b),Zn(v,"href",f)}else h();else g()},c=function(t){return wr((function(e){u(t,S(e,T(kr.value(t))),S(e,T(kr.error(t))))}))},s=function(t){var e=_e._addCacheSuffix(t);yt(r,e).each((function(t){var n,i;0===--t.count&&(delete r[e],n=t.id,i=cn(o),Qr(i,"#"+n).each(vn))}))};return{load:u,loadAll:function(t,e,n){var r;(r=W(t,c),xr(r,wr)).get((function(t){var r=G(t,(function(t){return t.isValue()}));r.fail.length>0?n(r.fail.map(Or)):e(r.pass.map(Or))}))},unload:s,unloadAll:function(t){q(t,(function(t){s(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}},ao=function(){var t=new WeakMap;return{forElement:function(e,n){var r=un(e).dom;return L.from(t.get(r)).getOrThunk((function(){var e=io(r,n);return t.set(r,e),e}))}}}(),uo=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,a;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(a=o[e];a;a=a[e])if(!a[e])return a;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),co=function(t){var e;return function(n){return e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,M),wt(e,Le(n))}},so=co(["h1","h2","h3","h4","h5","h6"]),lo=co(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),fo=function(t){return Fe(t)&&!lo(t)},mo=function(t){return Fe(t)&&"br"===Le(t)},go=co(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),ho=co(["ul","ol","dl"]),po=co(["li","dd","dt"]),vo=co(["thead","tbody","tfoot"]),bo=co(["td","th"]),yo=co(["pre","script","textarea","style"]),wo=" ",xo="\ufeff",Co=function(t){return"\ufeff"===t},So=function(t){return t.replace(/\uFEFF/g,"")},ko=An,To=Hn,Oo=function(t){return To(t)&&(t=t.parentNode),ko(t)&&t.hasAttribute("data-mce-caret")},Eo=function(t){return To(t)&&Co(t.data)},_o=function(t){return Oo(t)||Eo(t)},Ro=function(t){return t.firstChild!==t.lastChild||!Un(t.firstChild)},No=function(t){var e=t.container();return!!Hn(e)&&(e.data.charAt(t.offset())===xo||t.isAtStart()&&Eo(e.previousSibling))},Ao=function(t){var e=t.container();return!!Hn(e)&&(e.data.charAt(t.offset()-1)===xo||t.isAtEnd()&&Eo(e.nextSibling))},Do=function(t,e,n){var r,o=e.ownerDocument.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o},Mo=function(t){return To(t)&&t.data[0]===xo},Bo=function(t){return To(t)&&t.data[t.data.length-1]===xo},zo=function(t){return t&&t.hasAttribute("data-mce-caret")?(e=t.getElementsByTagName("br"),n=e[e.length-1],zn(n)&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n},Po=function(t){return Oo(t.startContainer)},Lo=qn,Io=$n,Ho=Un,Fo=Hn,Vo=Dn(["script","style","textarea"]),jo=Dn(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Uo=Dn(["table"]),Wo=_o,qo=function(t){return!Wo(t)&&(Fo(t)?!Vo(t.parentNode):jo(t)||Ho(t)||Uo(t)||$o(t))},$o=function(t){return!1===function(t){return An(t)&&"true"===t.getAttribute("unselectable")}(t)&&Io(t)},Go=function(t,e){return qo(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if($o(t))return!1;if(Lo(t))return!0}return!0}(t,e)},Ko=/^[ \t\r\n]*$/,Xo=function(t){return Ko.test(t)},Yo=function(t,e){var n,r,o,i=Ne.fromDom(e),a=Ne.fromDom(t);return n=a,r="pre,code",o=_(Be,i),Jr(n,r,o).isSome()},Jo=function(t,e){return qo(t)&&!1===function(t,e){return Hn(t)&&Xo(t.data)&&!1===Yo(t,e)}(t,e)||function(t){return An(t)&&"A"===t.nodeName&&!t.hasAttribute("href")&&(t.hasAttribute("name")||t.hasAttribute("id"))}(t)||Qo(t)},Qo=Bn("data-mce-bookmark"),Zo=Bn("data-mce-bogus"),ti=(Rr="data-mce-bogus",Nr="all",function(t){return An(t)&&t.getAttribute(Rr)===Nr}),ei=function(t,e){return void 0===e&&(e=!0),function(t,e){var n=0;if(Jo(t,t))return!1;var r=t.firstChild;if(!r)return!0;var o=new uo(r,t);do{if(e){if(ti(r)){r=o.next(!0);continue}if(Zo(r)){r=o.next();continue}}if(Un(r))n++,r=o.next();else{if(Jo(r,t))return!1;r=o.next()}}while(r);return n<=1}(t.dom,e)},ni=function(t,e){return y(t)&&(Jo(t,e)||fo(Ne.fromDom(t)))},ri=function(t){return function(t){return"span"===t.nodeName.toLowerCase()}(t)&&"bookmark"===t.getAttribute("data-mce-type")},oi=function(t,e){return Hn(t)&&t.data.length>0&&function(t,e){var n=new uo(t,e).prev(!1),r=new uo(t,e).next(!1),o=v(n)||ni(n,e),i=v(r)||ni(r,e);return o&&i}(t,e)},ii=function(t,e,n){var r=n||e;if(An(e)&&ri(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)ii(t,o[i],r);if(An(e)){var a=e.childNodes;1===a.length&&ri(a[0])&&e.parentNode.insertBefore(a[0],e)}return function(t){return jn(t)||Vn(t)}(e)||Jo(e,r)||function(t){return!!An(t)&&t.childNodes.length>0}(e)||oi(e,r)||t.remove(e),e},ai=_e.makeMap,ui=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ci=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,si=/[<>&\"\']/g,li=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,fi={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},di={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},mi={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},gi=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),di[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},hi=gi("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),pi=function(t,e){return t.replace(e?ui:ci,(function(t){return di[t]||t}))},vi=function(t,e){return t.replace(e?ui:ci,(function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":di[t]||"&#"+t.charCodeAt(0)+";"}))},bi=function(t,e,n){return n=n||hi,t.replace(e?ui:ci,(function(t){return di[t]||n[t]||t}))},yi={encodeRaw:pi,encodeAllRaw:function(t){return(""+t).replace(si,(function(t){return di[t]||t}))},encodeNumeric:vi,encodeNamed:bi,getEncodeFunc:function(t,e){var n=gi(e)||hi,r=ai(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?ui:ci,(function(t){return void 0!==di[t]?di[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return bi(t,e,n)}:bi:r.numeric?vi:pi},decode:function(t){return t.replace(li,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):fi[e]||String.fromCharCode(e):mi[t]||hi[t]||function(t){var e=Ne.fromTag("div").dom;return e.innerHTML=t,e.textContent||e.innerText||t}(t)}))}},wi={},xi={},Ci=_e.makeMap,Si=_e.each,ki=_e.extend,Ti=_e.explode,Oi=_e.inArray,Ei=function(t,e){return(t=_e.trim(t))?t.split(e||" "):[]},_i=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),Si(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?Ci(t,/[, ]/):Ti(t,/[, ]/)}))),n},Ri=function(t){var e={},n={},r=[],o={},i={},a=function(e,n,r){var o=t[e];return o?o=Ci(o,/[, ]/,Ci(o.toUpperCase(),/[, ]/)):(o=wi[e])||(o=Ci(n," ",Ci(n.toUpperCase()," ")),o=ki(o,r),wi[e]=o),o},u=function(t){var e,n,r,o,i,a,u={},c=function(t,n,r){var o,i,a,c=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};n=n||"","string"==typeof(r=r||[])&&(r=Ei(r));var s=Ei(t);for(o=s.length;o--;)a={attributes:c(i=Ei([e,n].join(" "))),attributesOrder:i,children:c(r,xi)},u[s[o]]=a},s=function(t,e){var n,r,o,i,a=Ei(t);n=a.length;for(var c=Ei(e);n--;)for(r=u[a[n]],o=0,i=c.length;o<i;o++)r.attributes[c[o]]={},r.attributesOrder.push(c[o])};return wi[t]?wi[t]:(e="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==t&&(e+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(e+=" xml:lang",r=[r,a="acronym applet basefont big font strike tt"].join(" "),Si(Ei(a),(function(t){c(t,"",r)})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),Si(Ei(i),(function(t){c(t,"",o)}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",r),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==t&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==t&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),Si(Ei("a form meter progress dfn"),(function(t){u[t]&&delete u[t].children[t]})),delete u.caption.children.table,delete u.script,wi[t]=u,u)}((t=t||{}).schema);!1===t.verify_html&&(t.valid_elements="*[*]");var c=_i(t.valid_styles),s=_i(t.invalid_styles,"map"),l=_i(t.valid_classes,"map"),f=a("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=a("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=a("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=a("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),h="td th iframe video audio object script code",p=a("non_empty_elements",h+" pre",m),v=a("move_caret_before_on_enter_elements",h+" table",m),b=a("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),y=a("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",b),w=a("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");Si((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){i[t]=new RegExp("</"+t+"[^>]*>","gi")}));var x=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},C=function(t){var n,o,i,a,u,c,s,l,f,d,m,g,h,p,v,b,y,w,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(t){var T=Ei(t,",");for(e["@"]&&(b=e["@"].attributes,y=e["@"].attributesOrder),n=0,o=T.length;n<o;n++)if(u=C.exec(T[n])){if(p=u[1],f=u[2],v=u[3],l=u[5],c={attributes:g={},attributesOrder:h=[]},"#"===p&&(c.paddEmpty=!0),"-"===p&&(c.removeEmpty=!0),"!"===u[4]&&(c.removeEmptyAttrs=!0),b&&(dt(b,(function(t,e){g[e]=t})),h.push.apply(h,y)),l)for(i=0,a=(l=Ei(l,"|")).length;i<a;i++)if(u=S.exec(l[i])){if(s={},m=u[1],d=u[2].replace(/[\\:]:/g,":"),p=u[3],w=u[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],h.splice(Oi(h,d),1);continue}p&&("="===p&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:w}),s.defaultValue=w),":"===p&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:w}),s.forcedValue=w),"<"===p&&(s.validValues=Ci(w,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=x(d),c.attributePatterns.push(s)):(g[d]||h.push(d),g[d]=s)}b||"@"!==f||(b=g,y=h),v&&(c.outputName=f,e[v]=c),k.test(f)?(c.pattern=x(f),r.push(c)):e[f]=c}}},S=function(t){e={},r=[],C(t),Si(u,(function(t,e){n[e]=t.children}))},k=function(t){var r=/^(~)?(.+)$/;t&&(wi.text_block_elements=wi.block_elements=null,Si(Ei(t,","),(function(t){var i=r.exec(t),a="~"===i[1],u=a?"span":"div",c=i[2];if(n[c]=n[u],o[c]=u,a||(y[c.toUpperCase()]={},y[c]={}),!e[c]){var s=e[u];delete(s=ki({},s)).removeEmptyAttrs,delete s.removeEmpty,e[c]=s}Si(n,(function(t,e){t[u]&&(n[e]=t=ki({},n[e]),t[c]=t[u])}))})))},O=function(e){var r=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;wi[t.schema]=null,e&&Si(Ei(e,","),(function(t){var e,o,i=r.exec(t);i&&(o=i[1],e=o?n[i[2]]:n[i[2]]={"#comment":{}},e=n[i[2]],Si(Ei(i[3],"|"),(function(t){"-"===o?delete e[t]:e[t]={}})))}))},E=function(t){var n,o=e[t];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(t))return o};t.valid_elements?S(t.valid_elements):(Si(u,(function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children})),"html5"!==t.schema&&Si(Ei("strong/b em/i"),(function(t){var n=Ei(t,"/");e[n[1]].outputName=n[0]})),Si(Ei("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(t){e[t]&&(e[t].removeEmpty=!0)})),Si(Ei("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){e[t].paddEmpty=!0})),Si(Ei("span"),(function(t){e[t].removeEmptyAttrs=!0}))),k(t.custom_elements),O(t.valid_children),C(t.extended_valid_elements),O("+ol[ul|ol],+ul[ul|ol]"),Si({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(function(t,n){e[n]&&(e[n].parentsRequired=Ei(t))})),t.invalid_elements&&Si(Ti(t.invalid_elements),(function(t){e[t]&&delete e[t]})),E("span")||C("span[!data-mce-type|*]");var _=T(c),R=T(s),N=T(l),A=T(g),D=T(y),M=T(b),B=T(w),z=T(m),P=T(d),L=T(p),I=T(v),H=T(f),F=T(i),V=T(o);return{children:n,elements:e,getValidStyles:_,getValidClasses:N,getBlockElements:D,getInvalidStyles:R,getShortEndedElements:z,getTextBlockElements:M,getTextInlineElements:B,getBoolAttrs:A,getElementRule:E,getSelfClosingElements:P,getNonEmptyElements:L,getMoveCaretBeforeOnEnterElements:I,getWhiteSpaceElements:H,getSpecialElements:F,isValidChild:function(t,e){var r=n[t.toLowerCase()];return!(!r||!r[e.toLowerCase()])},isValid:function(t,e){var n,r,o=E(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:V,addValidElements:C,setValidElements:S,addCustomElements:k,addValidChildren:O}},Ni=function(t,e,n,r){var o=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},Ai=function(t,e){var n,r,o,i=this,a=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,u=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,c=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,l={},f="\ufeff";t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var d="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<d.length;n++)l[d[n]]=f+n,l[f+n]=d[n];return{toHex:function(t){return t.replace(a,Ni)},parse:function(e){var r,o,d,m,g,h,p,v,b={},y=t.url_converter,w=t.url_converter_scope||i,x=function(t,e,r){var o=b[t+"-top"+e];if(o){var i=b[t+"-right"+e];if(i){var a=b[t+"-bottom"+e];if(a){var u=b[t+"-left"+e];if(u){var c=[o,i,a,u];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(b[t+e]=-1===n?c[0]:c.join(" "),delete b[t+"-top"+e],delete b[t+"-right"+e],delete b[t+"-bottom"+e],delete b[t+"-left"+e])}}}}},C=function(t){var e,n=b[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return b[t]=n[0],!0}},S=function(t){return m=!0,l[t]},k=function(t,e){return m&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return l[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},T=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},O=function(t){return t.replace(/\\[0-9a-f]+/gi,T)},E=function(e,n,r,o,i,a){if(i=i||a)return"'"+(i=k(i)).replace(/\'/g,"\\'")+"'";if(n=k(n||r||o),!t.allow_script_urls){var u=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(u))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(u))return""}return y&&(n=y.call(w,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,S).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,S)}));r=c.exec(e);)if(c.lastIndex=r.index+r[0].length,o=r[1].replace(s,"").toLowerCase(),d=r[2].replace(s,""),o&&d){if(o=O(o),d=O(d),-1!==o.indexOf(f)||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(d)))continue;"font-weight"===o&&"700"===d?d="bold":"color"!==o&&"background-color"!==o||(d=d.toLowerCase()),d=(d=d.replace(a,Ni)).replace(u,E),b[o]=m?k(d,!0):d}x("border","",!0),x("border","-width"),x("border","-color"),x("border","-style"),x("padding",""),x("margin",""),g="border",p="border-style",v="border-color",C(h="border-width")&&C(p)&&C(v)&&(b[g]=b[h]+" "+b[p]+" "+b[v],delete b[h],delete b[p],delete b[v]),"medium none"===b.border&&delete b.border,"none"===b["border-image"]&&delete b["border-image"]}return b},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var a=0,u=i.length;a<u;a++)e=i[a],(o=t[e])&&(n+=(n.length>0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):dt(t,(function(t,r){!t||o&&!function(t,e){var n=o["*"];return!(n&&n[t]||(n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},Di={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Mi=function(t){return t instanceof Event||w(t.initEvent)},Bi=function(t,e,n,r){var o,i=function(t,e){var n=null!=e?e:{};for(var r in t)wt(Di,r)||(n[r]=t[r]);return y(n.composedPath)&&(n.composedPath=function(){return t.composedPath()}),n}(e,r);return i.type=t,b(i.target)&&(i.target=null!==(o=i.srcElement)&&void 0!==o?o:n),function(t){return b(t.preventDefault)||Mi(t)}(e)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=M,w(e.preventDefault)?e.preventDefault():Mi(e)&&(e.returnValue=!1)},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=M,w(e.stopPropagation)?e.stopPropagation():Mi(e)&&(e.cancelBubble=!0)},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=M,i.stopPropagation()},function(t){return t.isDefaultPrevented===M||t.isDefaultPrevented===D}(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?M:D,i.isPropagationStopped=!0===i.cancelBubble?M:D,i.isImmediatePropagationStopped=D)),i},zi=/^(?:mouse|contextmenu)|click/,Pi=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},Li=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},Ii=function(t,e){var n=Bi(t.type,t,document,e);if(function(t){return y(t)&&zi.test(t.type)}(t)&&v(t.pageX)&&!v(t.clientX)){var r=n.target.ownerDocument||document,o=r.documentElement,i=r.body,a=n;a.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),a.pageY=t.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)}return v(n.metaKey)&&(n.metaKey=!1),n},Hi=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){Li(t,"DOMContentLoaded",i),Li(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():Pi(t,"DOMContentLoaded",i),n.domLoaded||Pi(t,"load",i)}},Fi=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}return t.prototype.bind=function(t,e,n,r){var o,i,a,u,c,s,l,f=this,d=window,m=function(t){f.executeHandlers(Ii(t||d.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?o=t[f.expando]:(o=f.count++,t[f.expando]=o,f.events[o]={}),r=r||t;var g=e.split(" ");for(a=g.length;a--;)s=m,c=l=!1,"DOMContentLoaded"===(u=g[a])&&(u="ready"),f.domLoaded&&"ready"===u&&"complete"===t.readyState?n.call(r,Ii({type:u})):(f.hasMouseEnterLeave||(c=f.mouseEnterLeave[u])&&(s=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=Ii(t||d.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,o))}),f.hasFocusIn||"focusin"!==u&&"focusout"!==u||(l=!0,c="focusin"===u?"focus":"blur",s=function(t){(t=Ii(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][u])?"ready"===u&&f.domLoaded?n(Ii({type:u})):i.push({func:n,scope:r}):(f.events[o][u]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=l,i.nativeHandler=s,"ready"===u?Hi(t,s,f):Pi(t,c||u,s,l)));return t=i=null,n}},t.prototype.unbind=function(t,e,n){var r,o,i,a,u;if(!t||3===t.nodeType||8===t.nodeType)return this;var c=t[this.expando];if(c){if(u=this.events[c],e){var s=e.split(" ");for(o=s.length;o--;)if(r=u[a=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var l=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=l,r.fakeName=f,r.capture=d,u[a]=r}n&&0!==r.length||(delete u[a],Li(t,r.fakeName||a,r.nativeHandler,r.capture))}}else dt(u,(function(e,n){Li(t,e.fakeName||n,e.nativeHandler,e.capture)})),u={};for(a in u)if(wt(u,a))return this;delete this.events[c];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=Ii({type:e,target:t},n);do{(r=t[this.expando])&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var a=r[o];if(a&&!1===a.func.call(a.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),Vi="sizzle"+-new Date,ji=window.document,Ui=0,Wi=0,qi=ka(),$i=ka(),Gi=ka(),Ki=function(t,e){return t===e&&(Fr=!0),0},Xi="undefined",Yi=1<<31,Ji={}.hasOwnProperty,Qi=[],Zi=Qi.pop,ta=Qi.push,ea=Qi.push,na=Qi.slice,ra=Qi.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},oa="[\\x20\\t\\r\\n\\f]",ia="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",aa="\\[[\\x20\\t\\r\\n\\f]*("+ia+")(?:"+oa+"*([*^$|!~]?=)"+oa+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ia+"))|)"+oa+"*\\]",ua=":("+ia+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+aa+")*)|.*)\\)|)",ca=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),sa=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),la=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),fa=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),da=new RegExp(ua),ma=new RegExp("^"+ia+"$"),ga={ID:new RegExp("^#("+ia+")"),CLASS:new RegExp("^\\.("+ia+")"),TAG:new RegExp("^("+ia+"|[*])"),ATTR:new RegExp("^"+aa),PSEUDO:new RegExp("^"+ua),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},ha=/^(?:input|select|textarea|button)$/i,pa=/^h\d$/i,va=/^[^{]+\{\s*\[native \w/,ba=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ya=/[+~]/,wa=/'|\\/g,xa=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),Ca=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{ea.apply(Qi=na.call(ji.childNodes),ji.childNodes),Qi[ji.childNodes.length].nodeType}catch(t){ea={apply:Qi.length?function(t,e){ta.apply(t,na.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var Sa=function(t,e,n,r){var o,i,a,u,c,s,l,f,d,m;if((e?e.ownerDocument||e:ji)!==jr&&Vr(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(u=(e=e||jr).nodeType)&&9!==u)return[];if(Wr&&!r){if(o=ba.exec(t))if(a=o[1]){if(9===u){if(!(i=e.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(a))&&Gr(e,i)&&i.id===a)return n.push(i),n}else{if(o[2])return ea.apply(n,e.getElementsByTagName(t)),n;if((a=o[3])&&Ar.getElementsByClassName)return ea.apply(n,e.getElementsByClassName(a)),n}if(Ar.qsa&&(!qr||!qr.test(t))){if(f=l=Vi,d=e,m=9===u&&t,1===u&&"object"!==e.nodeName.toLowerCase()){for(s=zr(t),(l=e.getAttribute("id"))?f=l.replace(wa,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+Na(s[c]);d=ya.test(t)&&_a(e.parentNode)||e,m=s.join(",")}if(m)try{return ea.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{l||e.removeAttribute("id")}}}return Lr(t.replace(ca,"$1"),e,n,r)};function ka(){var t=[];return function e(n,r){return t.push(n+" ")>Dr.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function Ta(t){return t[Vi]=!0,t}function Oa(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||Yi)-(~t.sourceIndex||Yi);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function Ea(t){return Ta((function(e){return e=+e,Ta((function(n,r){for(var o,i=t([],n.length,e),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))}))}))}function _a(t){return t&&typeof t.getElementsByTagName!==Xi&&t}function Ra(){}function Na(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function Aa(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Wi++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,a){var u,c,s=[Ui,i];if(a){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,a))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((u=(c=e[Vi]||(e[Vi]={}))[r])&&u[0]===Ui&&u[1]===i)return s[2]=u[2];if(c[r]=s,s[2]=t(e,n,a))return!0}}}function Da(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function Ma(t,e,n,r,o){for(var i,a=[],u=0,c=t.length,s=null!=e;u<c;u++)(i=t[u])&&(n&&!n(i,r,o)||(a.push(i),s&&e.push(u)));return a}function Ba(t,e,n,r,o,i){return r&&!r[Vi]&&(r=Ba(r)),o&&!o[Vi]&&(o=Ba(o,i)),Ta((function(i,a,u,c){var s,l,f,d=[],m=[],g=a.length,h=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)Sa(t,e[r],n);return n}(e||"*",u.nodeType?[u]:u,[]),p=!t||!i&&e?h:Ma(h,d,t,u,c),v=n?o||(i?t:g||r)?[]:a:p;if(n&&n(p,v,u,c),r)for(s=Ma(v,m),r(s,[],u,c),l=s.length;l--;)(f=s[l])&&(v[m[l]]=!(p[m[l]]=f));if(i){if(o||t){if(o){for(s=[],l=v.length;l--;)(f=v[l])&&s.push(p[l]=f);o(null,v=[],s,c)}for(l=v.length;l--;)(f=v[l])&&(s=o?ra.call(i,f):d[l])>-1&&(i[s]=!(a[s]=f))}}else v=Ma(v===a?v.splice(g,v.length):v),o?o(null,a,v,c):ea.apply(a,v)}))}function za(t){for(var e,n,r,o=t.length,i=Dr.relative[t[0].type],a=i||Dr.relative[" "],u=i?1:0,c=Aa((function(t){return t===e}),a,!0),s=Aa((function(t){return ra.call(e,t)>-1}),a,!0),l=[function(t,n,r){var o=!i&&(r||n!==Ir)||((e=n).nodeType?c(t,n,r):s(t,n,r));return e=null,o}];u<o;u++)if(n=Dr.relative[t[u].type])l=[Aa(Da(l),n)];else{if((n=Dr.filter[t[u].type].apply(null,t[u].matches))[Vi]){for(r=++u;r<o&&!Dr.relative[t[r].type];r++);return Ba(u>1&&Da(l),u>1&&Na(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(ca,"$1"),n,u<r&&za(t.slice(u,r)),r<o&&za(t=t.slice(r)),r<o&&Na(t))}l.push(n)}return Da(l)}Ar=Sa.support={},Br=Sa.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},Vr=Sa.setDocument=function(t){var e,n=t?t.ownerDocument||t:ji,r=n.defaultView;return n!==jr&&9===n.nodeType&&n.documentElement?(jr=n,Ur=n.documentElement,Wr=!Br(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){Vr()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){Vr()}))),Ar.attributes=!0,Ar.getElementsByTagName=!0,Ar.getElementsByClassName=va.test(n.getElementsByClassName),Ar.getById=!0,Dr.find.ID=function(t,e){if(typeof e.getElementById!==Xi&&Wr){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},Dr.filter.ID=function(t){var e=t.replace(xa,Ca);return function(t){return t.getAttribute("id")===e}},Dr.find.TAG=Ar.getElementsByTagName?function(t,e){if(typeof e.getElementsByTagName!==Xi)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Dr.find.CLASS=Ar.getElementsByClassName&&function(t,e){if(Wr)return e.getElementsByClassName(t)},$r=[],qr=[],Ar.disconnectedMatch=!0,qr=qr.length&&new RegExp(qr.join("|")),$r=$r.length&&new RegExp($r.join("|")),e=va.test(Ur.compareDocumentPosition),Gr=e||va.test(Ur.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Ki=e?function(t,e){if(t===e)return Fr=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!Ar.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===ji&&Gr(ji,t)?-1:e===n||e.ownerDocument===ji&&Gr(ji,e)?1:Hr?ra.call(Hr,t)-ra.call(Hr,e):0:4&r?-1:1)}:function(t,e){if(t===e)return Fr=!0,0;var r,o=0,i=t.parentNode,a=e.parentNode,u=[t],c=[e];if(!i||!a)return t===n?-1:e===n?1:i?-1:a?1:Hr?ra.call(Hr,t)-ra.call(Hr,e):0;if(i===a)return Oa(t,e);for(r=t;r=r.parentNode;)u.unshift(r);for(r=e;r=r.parentNode;)c.unshift(r);for(;u[o]===c[o];)o++;return o?Oa(u[o],c[o]):u[o]===ji?-1:c[o]===ji?1:0},n):jr},Sa.matches=function(t,e){return Sa(t,null,null,e)},Sa.matchesSelector=function(t,e){if((t.ownerDocument||t)!==jr&&Vr(t),e=e.replace(fa,"='$1']"),Ar.matchesSelector&&Wr&&(!$r||!$r.test(e))&&(!qr||!qr.test(e)))try{var n=undefined.call(t,e);if(n||Ar.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return Sa(e,jr,null,[t]).length>0},Sa.contains=function(t,e){return(t.ownerDocument||t)!==jr&&Vr(t),Gr(t,e)},Sa.attr=function(t,e){(t.ownerDocument||t)!==jr&&Vr(t);var n=Dr.attrHandle[e.toLowerCase()],r=n&&Ji.call(Dr.attrHandle,e.toLowerCase())?n(t,e,!Wr):void 0;return void 0!==r?r:Ar.attributes||!Wr?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},Sa.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},Sa.uniqueSort=function(t){var e,n=[],r=0,o=0;if(Fr=!Ar.detectDuplicates,Hr=!Ar.sortStable&&t.slice(0),t.sort(Ki),Fr){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return Hr=null,t},Mr=Sa.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=Mr(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=Mr(e);return n},(Dr=Sa.selectors={cacheLength:50,createPseudo:Ta,match:ga,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(xa,Ca),t[3]=(t[3]||t[4]||t[5]||"").replace(xa,Ca),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||Sa.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&Sa.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return ga.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&da.test(n)&&(e=zr(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(xa,Ca).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=qi[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+oa+"|$)"))&&qi(t,(function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!==Xi&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=Sa.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),a="last"!==t.slice(-4),u="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,l,f,d,m,g,h=i!==a?"nextSibling":"previousSibling",p=e.parentNode,v=u&&e.nodeName.toLowerCase(),b=!c&&!u;if(p){if(i){for(;h;){for(f=e;f=f[h];)if(u?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;g=h="only"===t&&!g&&"nextSibling"}return!0}if(g=[a?p.firstChild:p.lastChild],a&&b){for(m=(s=(l=p[Vi]||(p[Vi]={}))[t]||[])[0]===Ui&&s[1],d=s[0]===Ui&&s[2],f=m&&p.childNodes[m];f=++m&&f&&f[h]||(d=m=0)||g.pop();)if(1===f.nodeType&&++d&&f===e){l[t]=[Ui,m,d];break}}else if(b&&(s=(e[Vi]||(e[Vi]={}))[t])&&s[0]===Ui)d=s[1];else for(;(f=++m&&f&&f[h]||(d=m=0)||g.pop())&&((u?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[Vi]||(f[Vi]={}))[t]=[Ui,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=Dr.pseudos[t]||Dr.setFilters[t.toLowerCase()]||Sa.error("unsupported pseudo: "+t);return r[Vi]?r(e):r.length>1?(n=[t,t,"",e],Dr.setFilters.hasOwnProperty(t.toLowerCase())?Ta((function(t,n){for(var o,i=r(t,e),a=i.length;a--;)t[o=ra.call(t,i[a])]=!(n[o]=i[a])})):function(t){return r(t,0,n)}):r}},pseudos:{not:Ta((function(t){var e=[],n=[],r=Pr(t.replace(ca,"$1"));return r[Vi]?Ta((function(t,e,n,o){for(var i,a=r(t,null,o,[]),u=t.length;u--;)(i=a[u])&&(t[u]=!(e[u]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}})),has:Ta((function(t){return function(e){return Sa(t,e).length>0}})),contains:Ta((function(t){return t=t.replace(xa,Ca),function(e){return(e.textContent||e.innerText||Mr(e)).indexOf(t)>-1}})),lang:Ta((function(t){return ma.test(t||"")||Sa.error("unsupported lang: "+t),t=t.replace(xa,Ca).toLowerCase(),function(e){var n;do{if(n=Wr?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===Ur},focus:function(t){return t===jr.activeElement&&(!jr.hasFocus||jr.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!Dr.pseudos.empty(t)},header:function(t){return pa.test(t.nodeName)},input:function(t){return ha.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:Ea((function(){return[0]})),last:Ea((function(t,e){return[e-1]})),eq:Ea((function(t,e,n){return[n<0?n+e:n]})),even:Ea((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:Ea((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:Ea((function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t})),gt:Ea((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=Dr.pseudos.eq,q(["radio","checkbox","file","password","image"],(function(t){Dr.pseudos[t]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(t)})),q(["submit","reset"],(function(t){Dr.pseudos[t]=function(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}(t)})),Ra.prototype=Dr.filters=Dr.pseudos,Dr.setFilters=new Ra,zr=Sa.tokenize=function(t,e){var n,r,o,i,a,u,c,s=$i[t+" "];if(s)return e?0:s.slice(0);for(a=t,u=[],c=Dr.preFilter;a;){for(i in n&&!(r=sa.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=la.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(ca," ")}),a=a.slice(n.length)),Dr.filter)Dr.filter.hasOwnProperty(i)&&(!(r=ga[i].exec(a))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length)));if(!n)break}return e?a.length:a?Sa.error(t):$i(t,u).slice(0)},Pr=Sa.compile=function(t,e){var n,r=[],o=[],i=Gi[t+" "];if(!i){for(e||(e=zr(t)),n=e.length;n--;)(i=za(e[n]))[Vi]?r.push(i):o.push(i);(i=Gi(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,a,u,c){var s,l,f,d=0,m="0",g=o&&[],h=[],p=Ir,v=o||r&&Dr.find.TAG("*",c),b=Ui+=null==p?1:Math.random()||.1,y=v.length;for(c&&(Ir=i!==jr&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){for(l=0;f=t[l++];)if(f(s,i,a)){u.push(s);break}c&&(Ui=b)}n&&((s=!f&&s)&&d--,o&&g.push(s))}if(d+=m,n&&m!==d){for(l=0;f=e[l++];)f(g,h,i,a);if(o){if(d>0)for(;m--;)g[m]||h[m]||(h[m]=Zi.call(u));h=Ma(h)}ea.apply(u,h),c&&!o&&h.length>0&&d+e.length>1&&Sa.uniqueSort(u)}return c&&(Ui=b,Ir=p),g};return n?Ta(o):o}(o,r))).selector=t}return i},Lr=Sa.select=function(t,e,n,r){var o,i,a,u,c,s="function"==typeof t&&t,l=!r&&zr(t=s.selector||t);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(a=i[0]).type&&Ar.getById&&9===e.nodeType&&Wr&&Dr.relative[i[1].type]){if(!(e=(Dr.find.ID(a.matches[0].replace(xa,Ca),e)||[])[0]))return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=ga.needsContext.test(t)?0:i.length;o--&&(a=i[o],!Dr.relative[u=a.type]);)if((c=Dr.find[u])&&(r=c(a.matches[0].replace(xa,Ca),ya.test(i[0].type)&&_a(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&Na(i)))return ea.apply(n,r),n;break}}return(s||Pr(t,l))(r,e,!Wr,n,ya.test(t)&&_a(e.parentNode)||e),n},Ar.sortStable=Vi.split("").sort(Ki).join("")===Vi,Ar.detectDuplicates=!!Fr,Vr(),Ar.sortDetached=!0;var Pa=document,La=Array.prototype.push,Ia=Array.prototype.slice,Ha=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Fa=Fi.Event,Va=_e.makeMap("children,contents,next,prev"),ja=function(t){return void 0!==t},Ua=function(t){return"string"==typeof t},Wa=function(t,e){var n,r=(e=e||Pa).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},qa=function(t,e,n,r){var o;if(Ua(e))e=Wa(e,iu(t[0]));else if(e.length&&!e.nodeType){if(e=su.makeArray(e),r)for(o=e.length-1;o>=0;o--)qa(t,e[o],n,r);else for(o=0;o<e.length;o++)qa(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},$a=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},Ga=function(t,e,n){var r,o;return e=su(e)[0],t.each((function(){var t=this;n&&r===t.parentNode||(r=t.parentNode,o=e.cloneNode(!1),t.parentNode.insertBefore(o,t)),o.appendChild(t)})),t},Ka=_e.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Xa=_e.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Ya={for:"htmlFor",class:"className",readonly:"readOnly"},Ja={float:"cssFloat"},Qa={},Za={},tu=function(t,e){return new su.fn.init(t,e)},eu=/^\s*|\s*$/g,nu=function(t){return null==t?"":(""+t).replace(eu,"")},ru=function(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t},ou=function(t,e){var n=[];return ru(t,(function(t,r){e(r,t)&&n.push(r)})),n},iu=function(t){return t?9===t.nodeType?t:t.ownerDocument:Pa};tu.fn=tu.prototype={constructor:tu,selector:"",context:null,length:0,init:function(t,e){var n,r,o=this;if(!t)return o;if(t.nodeType)return o.context=o[0]=t,o.length=1,o;if(e&&e.nodeType)o.context=e;else{if(e)return su(t).attr(e);o.context=e=document}if(Ua(t)){if(o.selector=t,!(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:Ha.exec(t)))return su(e).find(t);if(n[1])for(r=Wa(t,iu(e)).firstChild;r;)La.call(o,r),r=r.nextSibling;else{if(!(r=iu(e).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(t);o.length=1,o[0]=r}}else this.add(t,!1);return o},toArray:function(){return _e.toArray(this)},add:function(t,e){var n,r,o=this;if(Ua(t))return o.add(su(t));if(!1!==e)for(n=su.unique(o.toArray().concat(su.makeArray(t))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else La.apply(o,su.makeArray(t));return o},attr:function(t,e){var n,r=this;if("object"==typeof t)ru(t,(function(t,e){r.attr(t,e)}));else{if(!ja(e)){if(r[0]&&1===r[0].nodeType){if((n=Qa[t])&&n.get)return n.get(r[0],t);if(Xa[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each((function(){var n;if(1===this.nodeType){if((n=Qa[t])&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==typeof(t=Ya[t]||t))ru(t,(function(t,e){n.prop(t,e)}));else{if(!ja(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))},a=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))};if("object"==typeof t)ru(t,(function(t,e){o.css(t,e)}));else if(ja(e))t=i(t),"number"!=typeof e||Ka[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if((r=Za[t])&&r.set)r.set(this,e);else{try{this.style[Ja[t]||t]=e}catch(t){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(a(t)):n.removeAttribute(t))}}));else{if(n=o[0],(r=Za[t])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(a(t))}catch(t){return}}return o},remove:function(){for(var t,e=this.length;e--;)t=this[e],Fa.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e,n=this;if(ja(t)){e=n.length;try{for(;e--;)n[e].innerHTML=t}catch(r){su(n[e]).empty().append(t)}return n}return n[0]?n[0].innerHTML:""},text:function(t){var e,n=this;if(ja(t)){for(e=n.length;e--;)"innerText"in n[e]?n[e].innerText=t:n[0].textContent=t;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return qa(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return qa(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){var t=this;return t[0]&&t[0].parentNode?qa(t,arguments,(function(t){this.parentNode.insertBefore(t,this)})):t},after:function(){var t=this;return t[0]&&t[0].parentNode?qa(t,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):t},appendTo:function(t){return su(t).append(this),this},prependTo:function(t){return su(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return Ga(this,t)},wrapAll:function(t){return Ga(this,t,!0)},wrapInner:function(t){return this.each((function(){su(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){su(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),su(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t||(-1!==t.indexOf(" ")?ru(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o=$a(r,t);if(o!==e){var i=r.className;o?r.className=nu((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}}))),n},hasClass:function(t){return $a(this[0],t)},each:function(t){return ru(this,t)},on:function(t,e){return this.each((function(){Fa.bind(this,t,e)}))},off:function(t,e){return this.each((function(){Fa.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"==typeof t?Fa.fire(this,t.type,t):Fa.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return su(Ia.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)su.find(t,this[e],r);return su(r)},filter:function(t){return su("function"==typeof t?ou(this.toArray(),(function(e,n){return t(n,e)})):su.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof su&&(t=t[0]),this.each((function(n,r){for(;r;){if("string"==typeof t&&su(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),su(e)},offset:function(t){var e,n,r,o,i=0,a=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:La,sort:Array.prototype.sort,splice:Array.prototype.splice},_e.extend(tu,{extend:_e.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:_e.toArray(t);var e},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:_e.isArray,each:ru,trim:nu,grep:ou,find:Sa,expr:Sa.selectors,unique:Sa.uniqueSort,text:Sa.getText,contains:Sa.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return e=1===e.length?su.find.matchesSelector(e[0],t)?[e[0]]:[]:su.find.matches(t,e)}});var au=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof su&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&su(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},uu=function(t,e,n,r){var o=[];for(r instanceof su&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&su(t).is(r))break}o.push(t)}return o},cu=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};ru({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return au(t,"parentNode")},next:function(t){return cu(t,"nextSibling",1)},prev:function(t){return cu(t,"previousSibling",1)},children:function(t){return uu(t.firstChild,"nextSibling",1)},contents:function(t){return _e.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){tu.fn[t]=function(n){var r=[];this.each((function(){var t=e.call(r,this,n,r);t&&(su.isArray(t)?r.push.apply(r,t):r.push(t))})),this.length>1&&(Va[t]||(r=su.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=su(r);return n?o.filter(n):o}})),ru({parentsUntil:function(t,e){return au(t,"parentNode",e)},nextUntil:function(t,e){return uu(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return uu(t,"previousSibling",1,e).slice(1)}},(function(t,e){tu.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(su.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(o=su.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=su(o);return r?i.filter(r):i}})),tu.fn.is=function(t){return!!t&&this.filter(t).length>0},tu.fn.init.prototype=tu.fn,tu.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return su.extend(n,this),n},tu.attrHooks=Qa,tu.cssHooks=Za;var su=tu,lu=_e.each,fu=_e.grep,du=Se.ie,mu=/^([a-z0-9],?)+$/i,gu=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},hu=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o},pu=function(t,e){void 0===e&&(e={});var n={},r=window,o={},i=0,a=ao.forElement(Ne.fromDom(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),u=[],c=e.schema?e.schema:Ri({}),s=Ai({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),l=e.ownEvents?new Fi:Fi.Event,f=c.getBlockElements(),m=su.overrideDefaults((function(){return{context:t,element:U.getRoot()}})),g=function(e){return e&&t&&d(e)?t.getElementById(e):e},h=function(t){return m("string"==typeof t?g(t):t)},p=function(t,e,n){var r,o,i=h(t);return i.length&&(o=(r=W[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},v=function(t){var e=g(t);return e?e.attributes:[]},y=function(t,n,r){""===r&&(r=null);var o=h(t),i=o.attr(n);if(o.length){var a=W[n];a&&a.set?a.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},w=function(){return e.root_element||t.body},x=function(e,n){return dr(t.body,g(e),n)},S=function(t,e,n){var r=h(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})))&&(e=Se.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},k=function(t){var e,n;return t=g(t),e=S(t,"width"),n=S(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},O=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(mu.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return Sa(e,i[0].ownerDocument||i[0],null,i).length>0},E=function(t,e,n,r){var o,i=[],a=g(t);for(r=void 0===r,n=n||("BODY"!==w().nodeName?w().parentNode:null),_e.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return O(t,o)});a&&!(a===n||b(a.nodeType)||Vn(a)||jn(a));){if(!e||"function"==typeof e&&e(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},_=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return O(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},R=function(t,e,n){var r,o="string"==typeof t?g(t):t;if(!o)return!1;if(_e.isArray(o)&&(o.length||0===o.length))return r=[],lu(o,(function(t,o){t&&r.push(e.call(n,"string"==typeof t?g(t):t,o))})),r;var i=n||this;return e.call(i,o)},N=function(t,e){h(t).each((function(t,n){lu(e,(function(t,e){y(n,e,t)}))}))},A=function(t,e){var n=h(t);du?n.each((function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(t){su("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},D=function(e,n,r,o,i){return R(e,(function(e){var a="string"==typeof n?t.createElement(n):n;return N(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&A(a,o)),i?a:e.appendChild(a)}))},M=function(e,n,r){return D(t.createElement(e),e,n,r,!0)},B=yi.encodeAllRaw,z=function(t,e){var n=h(t);return e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},P=function(t,e,n){h(t).toggleClass(e,n).each((function(){""===this.className&&su(this).attr("class",null)}))},L=function(t,e,n){return R(e,(function(e){return _e.is(e,"array")&&(t=t.cloneNode(!0)),n&&lu(fu(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},I=function(t){if(An(t)){var e="a"===t.nodeName.toLowerCase()&&!p(t,"href")&&p(t,"id");if(p(t,"name")||p(t,"data-mce-bookmark")||e)return!0}return!1},H=function(){return t.createRange()},F=function(n,o,i,a){if(_e.isArray(n)){for(var c=n.length,s=[];c--;)s[c]=F(n[c],o,i,a);return s}return!e.collect||n!==t&&n!==r||u.push([n,o,i,a]),l.bind(n,o,i,a||U)},V=function(e,n,o){if(_e.isArray(e)){for(var i=e.length,a=[];i--;)a[i]=V(e[i],n,o);return a}if(u.length>0&&(e===t||e===r))for(i=u.length;i--;){var c=u[i];e!==c[0]||n&&n!==c[1]||o&&o!==c[2]||l.unbind(c[0],c[1],c[2])}return l.unbind(e,n,o)},j=function(t){if(t&&An(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},U={doc:t,settings:e,win:r,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:u,styles:s,schema:c,events:l,isBlock:function(t){if("string"==typeof t)return!!f[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!f[t.nodeName])}return!1},$:m,$$:h,root:null,clone:function(e,n){if(!du||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return lu(v(e),(function(t){y(r,t.nodeName,p(e,t.nodeName))})),r},getRoot:w,getViewPort:function(t){var e=_n(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=g(t);var e=x(t),n=k(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:k,getParent:function(t,e,n){var r=E(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:E,get:g,getNext:function(t,e){return _(t,e,"nextSibling")},getPrev:function(t,e){return _(t,e,"previousSibling")},select:function(n,r){return Sa(n,g(r)||e.root_element||t,[])},is:O,add:D,create:M,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)xt(e,r)&&(o+=" "+r+'="'+B(e[r])+'"');return void 0!==n?o+">"+n+"</"+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:z,setStyle:function(t,n,r){var o=d(n)?h(t).css(n,r):h(t).css(n);e.update_styles&&gu(s,o)},getStyle:S,setStyles:function(t,n){var r=h(t).css(n);e.update_styles&&gu(s,r)},removeAllAttribs:function(t){return R(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},setAttrib:y,setAttribs:N,getAttrib:p,getPos:x,parseStyle:function(t){return s.parse(t)},serializeStyle:function(t,e){return s.serialize(t,e)},addStyle:function(e){var r,o;if(U!==pu.DOM&&t===document){if(n[e])return;n[e]=!0}(o=t.getElementById("mceDefaultStyles"))||((o=t.createElement("style")).id="mceDefaultStyles",o.type="text/css",(r=t.getElementsByTagName("head")[0]).firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(t.createTextNode(e))},loadCSS:function(t){t||(t=""),q(t.split(","),(function(t){o[t]=!0,a.load(t,C)}))},addClass:function(t,e){h(t).addClass(e)},removeClass:function(t,e){P(t,e,!1)},hasClass:function(t,e){return h(t).hasClass(e)},toggleClass:P,show:function(t){h(t).show()},hide:function(t){h(t).hide()},isHidden:function(t){return"none"===h(t).css("display")},uniqueId:function(t){return(t||"mce_")+i++},setHTML:A,getOuterHTML:function(t){var e="string"==typeof t?g(t):t;return An(e)?e.outerHTML:su("<div></div>").append(su(e).clone()).html()},setOuterHTML:function(t,e){h(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}z(su(this).html(e),!0)}))},decode:yi.decode,encode:B,insertAfter:function(t,e){var n=g(e);return R(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:L,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=M(e),lu(v(t),(function(e){y(n,e.nodeName,p(t,e.nodeName))})),L(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return s.toHex(_e.trim(t))},run:R,getAttribs:v,isEmpty:function(t,e){var n,r,o=0;if(I(t))return!1;if(t=t.firstChild){var i=new uo(t,t.parentNode),a=c?c.getWhiteSpaceElements():{};e=e||(c?c.getNonEmptyElements():null);do{if(n=t.nodeType,An(t)){var u=t.getAttribute("data-mce-bogus");if(u){t=i.next("all"===u);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(I(t))return!1}if(8===n)return!1;if(3===n&&!Xo(t.nodeValue))return!1;if(3===n&&t.parentNode&&a[t.parentNode.nodeName]&&Xo(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:H,nodeIndex:hu,split:function(t,e,n){var r,o,i,a=H();if(t&&e)return a.setStart(t.parentNode,hu(t)),a.setEnd(e.parentNode,hu(e)),r=a.extractContents(),(a=H()).setStart(e.parentNode,hu(e)+1),a.setEnd(t.parentNode,hu(t)+1),o=a.extractContents(),(i=t.parentNode).insertBefore(ii(U,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(ii(U,o),t),z(t),n||e},bind:F,unbind:V,fire:function(t,e,n){return l.fire(t,e,n)},getContentEditable:j,getContentEditableParent:function(t){for(var e=w(),n=null;t&&t!==e&&null===(n=j(t));t=t.parentNode);return n},destroy:function(){if(u.length>0)for(var t=u.length;t--;){var e=u[t];l.unbind(e[0],e[1],e[2])}dt(o,(function(t,e){a.unload(e),delete o[e]})),Sa.setDocument&&Sa.setDocument()},isChildOf:function(t,e){if(du){for(;t;){if(e===t)return!0;t=t.parentNode}return!1}return t===e||e.contains(t)},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},W=function(t,e,n){var r=e.keep_values,o={set:function(t,r,o){e.url_converter&&null!==r&&(r=e.url_converter.call(e.url_converter_scope||n(),r,o,t[0])),t.attr("data-mce-"+o,r).attr(o,r)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(s,e,T(U));return U};pu.DOM=pu(document),pu.nodeIndex=hu;var vu=pu.DOM,bu=_e.each,yu=_e.grep,wu=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,n){var r,o=vu,i=function(){o.remove(a),r&&(r.onerror=r.onload=r=null)},a=o.uniqueId();(r=document.createElement("script")).id=a,r.type="text/javascript",r.src=_e._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),e()},r.onerror=function(){i(),w(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)},t.prototype.isDone=function(t){return 2===this.states[t]},t.prototype.markDone=function(t){this.states[t]=2},t.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],a=function(t,e){bu(o.scriptLoadedCallbacks[e],(function(e){w(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var u=function(){var e=yu(t);if(t.length=0,bu(e,(function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,(function(){o.states[t]=2,o.loading--,a("success",t),u()}),(function(){o.states[t]=3,o.loading--,i.push(t),a("failure",t),u()}))):a("failure",t):a("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,bu(n,(function(t){0===i.length?w(t.success)&&t.success.call(t.scope):w(t.failure)&&t.failure.call(t.scope,i)}))}};u()},t.ScriptLoader=new t,t}(),xu=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Cu={},Su=xu("en"),ku=function(){return yt(Cu,Su.get())},Tu={getData:function(){return mt(Cu,(function(t){return Nt({},t)}))},setCode:function(t){t&&Su.set(t)},getCode:function(){return Su.get()},add:function(t,e){var n=Cu[t];n||(Cu[t]=n={}),dt(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=ku().getOr({}),r=function(t){return w(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null==t},i=function(t){var e=r(t);return yt(n,e.toLowerCase()).map(r).getOr(e)},a=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(m(e=t)&&wt(e,"raw"))return r(t.raw);if(function(t){return g(t)&&t.length>1}(t)){var u=t.slice(1);return a(i(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return wt(u,e)?r(u[e]):t})))}return a(i(t))},isRtl:function(){return ku().bind((function(t){return yt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return wt(Cu,t)}},Ou=function(){var t=[],e={},n={},r=[],o=function(t,e){var n=K(r,(function(n){return n.name===t&&n.state===e}));q(n,(function(t){return t.callback()}))},i=function(t){var e;return n[t]&&(e=n[t].dependencies),e||[]},a=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},u=function(t,r,c,s,l){if(!e[t]){var f="string"==typeof r?r:r.prefix+r.resource+r.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=Ou.baseURL+"/"+f),e[t]=f.substring(0,f.lastIndexOf("/"));var d=function(){o(t,"loaded"),function(t,e,n,r){var o=i(t);q(o,(function(t){var n=a(e,t);u(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(wu))}(t,r,c,s)};n[t]?d():wu.ScriptLoader.add(f,d,s,l)}},c=function(t,o,i){void 0===i&&(i="added"),wt(n,t)&&"added"===i||wt(e,t)&&"loaded"===i?o():r.push({name:t,state:i,callback:o})};return{items:t,urls:e,lookup:n,_listeners:r,get:function(t){if(n[t])return n[t].instance},dependencies:i,requireLangPack:function(t,n){!1!==Ou.languageLoad&&c(t,(function(){var r=Tu.getCode();!r||n&&-1===(","+(n||"")+",").indexOf(","+r+",")||wu.ScriptLoader.add(e[t]+"/langs/"+r+".js")}),"loaded")},add:function(e,r,i){var a=r;return t.push(a),n[e]={instance:a,dependencies:i},o(e,"added"),a},remove:function(t){delete e[t],delete n[t]},createUrl:a,addComponents:function(t,n){var r=e[t];q(n,(function(t){wu.ScriptLoader.add(r+"/"+t)}))},load:u,waitFor:c}};Ou.languageLoad=!0,Ou.baseURL="",Ou.PluginManager=Ou(),Ou.ThemeManager=Ou();var Eu=function(){var t=function(t){var e=xu(L.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(L.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(L.some(t))}}}(C);return Nt(Nt({},t),{on:function(e){return t.get().each(e)}})},_u=function(t,e){var n=null;return{cancel:function(){h(n)||(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];h(n)&&(n=setTimeout((function(){n=null,t.apply(null,r)}),e))}}},Ru=function(t,e){var n=null,r=function(){h(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)}}},Nu=function(t,e){var n=er(t,e);return void 0===n||""===n?[]:n.split(" ")},Au=function(t){return void 0!==t.dom.classList},Du=function(t,e){return function(t,e,n){var r=Nu(t,e).concat([n]);return Zn(t,e,r.join(" ")),!0}(t,"class",e)},Mu=function(t,e){return function(t,e,n){var r=K(Nu(t,e),(function(t){return t!==n}));return r.length>0?Zn(t,e,r.join(" ")):rr(t,e),!1}(t,"class",e)},Bu=function(t,e){Au(t)?t.dom.classList.add(e):Du(t,e)},zu=function(t){0===(Au(t)?t.dom.classList:function(t){return Nu(t,"class")}(t)).length&&rr(t,"class")},Pu=function(t,e){return Au(t)&&t.dom.classList.contains(e)},Lu=function(t,e){var n=[];return q(Qe(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(Lu(t,e))})),n},Iu=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Me(n)?[]:W(n.querySelectorAll(t),Ne.fromDom)}(e,t)},Hu=T("mce-annotation"),Fu=T("data-mce-annotation"),Vu=T("data-mce-annotation-uid"),ju=function(t,e){var n=t.selection.getRng(),r=Ne.fromDom(n.startContainer),o=Ne.fromDom(t.getBody()),i=e.fold((function(){return"."+Hu()}),(function(t){return"["+Fu()+'="'+t+'"]'})),a=Ze(r,n.startOffset).getOr(r),u=Zr(a,i,(function(t){return Be(t,o)})),c=function(t,e){return function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)}(t,e)?L.some(er(t,e)):L.none()};return u.bind((function(e){return c(e,""+Vu()).bind((function(n){return c(e,""+Fu()).map((function(e){var r=Uu(t,n);return{uid:n,name:e,elements:r}}))}))}))},Uu=function(t,e){var n=Ne.fromDom(t.getBody());return Iu(n,"["+Vu()+'="'+e+'"]')},Wu=function(t,e){var n=xu({}),r=function(){return{listeners:[],previous:Eu()}},o=function(t,e){i(t,(function(t){return e(t),t}))},i=function(t,e){var o=n.get(),i=e(yt(o,t).getOrThunk(r));o[t]=i,n.set(o)},a=Ru((function(){var e=n.get(),r=ot(lt(e));q(r,(function(e){i(e,(function(n){var r=n.previous.get();return ju(t,L.some(e)).fold((function(){r.isSome()&&(!function(t){o(t,(function(e){q(e.listeners,(function(e){return e(!1,t)}))}))}(e),n.previous.clear())}),(function(t){var e=t.uid,i=t.name,a=t.elements;Xn(r,e)||(!function(t,e,n){o(t,(function(r){q(r.listeners,(function(r){return r(!0,t,{uid:e,nodes:W(n,(function(t){return t.dom}))})}))}))}(i,e,a),n.previous.set(e))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);t.on("remove",(function(){a.cancel()})),t.on("NodeChange",(function(){a.throttle()}));return{addListener:function(t,e){i(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))}}},qu=function(t,e){t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){q(t,(function(t){(function(t){return L.from(t.attr(Fu())).bind(e.lookup)})(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))},$u=0,Gu=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++$u+String(e)},Ku=function(t,e){var n,r,o=We(t).dom,i=Ne.fromDom(o.createDocumentFragment()),a=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Qe(Ne.fromDom(r)));hn(i,a),pn(t),gn(t,i)},Xu=function(t,e){return Ne.fromDom(t.dom.cloneNode(e))},Yu=function(t){return Xu(t,!1)},Ju=function(t){return Xu(t,!0)},Qu=function(t,e,n){void 0===n&&(n=D);var r=new uo(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!Hn(e)&&!n(e));return L.from(e).filter(Hn)};return{current:function(){return L.from(r.current()).filter(Hn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Zu=function(t,e){var n=e||function(e){return t.isBlock(e)||Un(e)||$n(e)},r=function(t,e,n,o){if(Hn(t)){var i=o(t,e,t.data);if(-1!==i)return L.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))};return{backwards:function(t,e,o,i){var a=Qu(t,i,n);return r(t,e,(function(){return a.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},forwards:function(t,e,o,i){var a=Qu(t,i,n);return r(t,e,(function(){return a.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}},tc=Math.round,ec=function(t){return t?{left:tc(t.left),top:tc(t.top),bottom:tc(t.bottom),right:tc(t.right),width:tc(t.width),height:tc(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},nc=function(t,e){return t=ec(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t},rc=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},oc=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&rc(e.top-t.bottom,t,e)},ic=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&rc(e.bottom-t.top,t,e)},ac=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},uc=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},cc=function(t,e){if(An(t)&&t.hasChildNodes()){var n=t.childNodes;return n[function(t,e,n){return Math.min(Math.max(t,e),n)}(e,0,n.length-1)]}return t},sc=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),lc=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&sc.test(t)},fc=An,dc=qo,mc=Mn("display","block table"),gc=Mn("float","left right"),hc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(fc,dc,R(gc)),pc=R(Mn("white-space","pre pre-line pre-wrap")),vc=Hn,bc=Un,yc=pu.nodeIndex,wc=function(t,e){return e<0&&An(t)&&t.hasChildNodes()?void 0:cc(t,e)},xc=function(t){return"createRange"in t?t.createRange():pu.DOM.createRng()},Cc=function(t){return t&&/[\r\n\t ]/.test(t)},Sc=function(t){return!!t.setStart&&!!t.setEnd},kc=function(t){var e=t.startContainer,n=t.startOffset;if(Cc(t.toString())&&pc(e.parentNode)&&Hn(e)){var r=e.data;if(Cc(r[n-1])||Cc(r[n+1]))return!0}return!1},Tc=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},Oc=function(t){var e,n=t.getClientRects();return e=n.length>0?ec(n[0]):ec(t.getBoundingClientRect()),!Sc(t)&&bc(t)&&Tc(e)?function(t){var e=t.ownerDocument,n=xc(e),r=e.createTextNode(wo),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=ec(n.getBoundingClientRect());return o.removeChild(r),i}(t):Tc(e)&&Sc(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&Hn(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),Oc(i)}return null}(t):e},Ec=function(t,e){var n=nc(t,e);return n.width=1,n.right=n.left+1,n},_c=function(t){var e=[],n=function(t){var n,r;0!==t.height&&(e.length>0&&(n=t,r=e[e.length-1],n.left===r.left&&n.top===r.top&&n.bottom===r.bottom&&n.right===r.right)||e.push(t))},r=function(t,r){var o=xc(t.ownerDocument);if(r<t.data.length){if(lc(t.data[r]))return e;if(lc(t.data[r-1])&&(o.setStart(t,r),o.setEnd(t,r+1),!kc(o)))return n(Ec(Oc(o),!1)),e}r>0&&(o.setStart(t,r-1),o.setEnd(t,r),kc(o)||n(Ec(Oc(o),!1))),r<t.data.length&&(o.setStart(t,r),o.setEnd(t,r+1),kc(o)||n(Ec(Oc(o),!0)))},o=t.container(),i=t.offset();if(vc(o))return r(o,i),e;if(fc(o))if(t.isAtEnd()){var a=wc(o,i);vc(a)&&r(a,a.data.length),hc(a)&&!bc(a)&&n(Ec(Oc(a),!1))}else{a=wc(o,i);if(vc(a)&&r(a,0),hc(a)&&t.isAtEnd())return n(Ec(Oc(a),!1)),e;var u=wc(t.container(),t.offset()-1);hc(u)&&!bc(u)&&(mc(u)||mc(a)||!hc(a))&&n(Ec(Oc(u),!1)),hc(a)&&n(Ec(Oc(a),!0))}return e},Rc=function(t,e,n){var r=function(){return n||(n=_c(Rc(t,e))),n};return{container:T(t),offset:T(e),toRange:function(){var n=xc(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return vc(t),0===e},isAtEnd:function(){return vc(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return wc(t,n?e-1:e)}}};Rc.fromRangeStart=function(t){return Rc(t.startContainer,t.startOffset)},Rc.fromRangeEnd=function(t){return Rc(t.endContainer,t.endOffset)},Rc.after=function(t){return Rc(t.parentNode,yc(t)+1)},Rc.before=function(t){return Rc(t.parentNode,yc(t))},Rc.isAbove=function(t,e){return Yn(at(e.getClientRects()),ut(t.getClientRects()),oc).getOr(!1)},Rc.isBelow=function(t,e){return Yn(ut(e.getClientRects()),at(t.getClientRects()),ic).getOr(!1)},Rc.isAtStart=function(t){return!!t&&t.isAtStart()},Rc.isAtEnd=function(t){return!!t&&t.isAtEnd()},Rc.isTextPosition=function(t){return!!t&&Hn(t.container())},Rc.isElementPosition=function(t){return!1===Rc.isTextPosition(t)};var Nc,Ac=function(t,e){Hn(e)&&0===e.data.length&&t.remove(e)},Dc=function(t,e,n){jn(n)?function(t,e,n){var r=L.from(n.firstChild),o=L.from(n.lastChild);e.insertNode(n),r.each((function(e){return Ac(t,e.previousSibling)})),o.each((function(e){return Ac(t,e.nextSibling)}))}(t,e,n):function(t,e,n){e.insertNode(n),Ac(t,n.previousSibling),Ac(t,n.nextSibling)}(t,e,n)},Mc=Hn,Bc=zn,zc=pu.nodeIndex,Pc=function(t){var e=t.parentNode;return Bc(e)?Pc(e):e},Lc=function(t){return t?Et(t.childNodes,(function(t,e){return Bc(e)&&"BR"!==e.nodeName?t=t.concat(Lc(e)):t.push(e),t}),[]):[]},Ic=function(t){return function(e){return t===e}},Hc=function(t){return(Mc(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=Lc(Pc(t)),n=_t(e,Ic(t),t),e=e.slice(0,n+1);var r=Et(e,(function(t,n,r){return Mc(n)&&Mc(e[r-1])&&t++,t}),0);return e=Tt(e,Dn([t.nodeName])),(n=_t(e,Ic(t),t))-r}(t)+"]"},Fc=function(t,e){var n,r,o,i,a,u=[];return n=e.container(),r=e.offset(),Mc(n)?o=function(t,e){for(;(t=t.previousSibling)&&Mc(t);)e+=t.data.length;return e}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Hc(n)),a=function(t,e,n){var r=[];for(e=e.parentNode;!(e===t||n&&n(e));e=e.parentNode)r.push(e);return r}(t,n),a=Tt(a,R(zn)),(u=u.concat(kt(a,(function(t){return Hc(t)})))).reverse().join("/")+","+o},Vc=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=Et(o,(function(t,e){var n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return n?("text()"===n[1]&&(n[1]="#text"),function(t,e,n){var r=Lc(t);return r=Tt(r,(function(t,e){return!Mc(t)||!Mc(r[e-1])})),(r=Tt(r,Dn([e])))[n]}(t,n[1],parseInt(n[2],10))):null}),t);return i?Mc(i)?function(t,e){for(var n,r=t,o=0;Mc(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!Mc(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return Mc(t)&&e>t.data.length&&(e=t.data.length),Rc(t,e)}(i,parseInt(n,10)):(n="after"===n?zc(i)+1:zc(i),Rc(i.parentNode,n)):null},jc=$n,Uc=function(t,e,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],c=[],s=0,l=t.getRoot();for(Hn(a)?c.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&Hn(r);r=r.previousSibling)o+=t(r.data).length;return o}(e,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(s=1,u=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[u],n)+s));a&&a!==l;a=a.parentNode)c.push(t.nodeIndex(a,n));return c},Wc=function(t,e,n){var r=0;return _e.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},qc=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],An(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(e?r:r-1,o.length-1)])&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r))},$c=function(t){return qc(t,!0),qc(t,!1),t},Gc=function(t,e){var n;if(An(t)&&(t=cc(t,e),jc(t)))return t;if(_o(t)){if(Hn(t)&&Oo(t)&&(t=t.parentNode),n=t.previousSibling,jc(n))return n;if(n=t.nextSibling,jc(n))return n}},Kc=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(jc(r)||"IMG"===o)return{name:o,index:Wc(n.dom,o,r)};var a=function(t){return Gc(t.startContainer,t.startOffset)||Gc(t.endContainer,t.endOffset)}(i);return a?{name:o=a.tagName,index:Wc(n.dom,o,a)}:function(t,e,n,r){var o=e.dom,i={};return i.start=Uc(o,t,n,r,!0),e.isCollapsed()||(i.end=Uc(o,t,n,r,!1)),Po(r)&&(i.isFakeCaret=!0),i}(t,n,e,i)},Xc=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,"&#xFEFF;"):t.create("span",r)},Yc=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),a=t.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:Wc(n,u,a)};var c=$c(r.cloneRange());if(!i){c.collapse(!1);var s=Xc(n,o+"_end",e);Dc(n,c,s)}(r=$c(r)).collapse(!0);var l=Xc(n,o+"_start",e);return Dc(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},Jc=function(t,e,n){return 2===e?Kc(So,n,t):3===e?function(t){var e=t.getRng();return{start:Fc(t.dom.getRoot(),Rc.fromRangeStart(e)),end:Fc(t.dom.getRoot(),Rc.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):Yc(t,!1)},Qc=_(Kc,O,!0),Zc=pu.DOM,ts=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return yt(o,t.id).getOr(n)}return r},es=function(t){return t.getParam("content_security_policy","")},ns=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},rs=function(t){return t.getParam("forced_root_block_attrs",{})},os=function(t){return t.getParam("automatic_uploads",!0,"boolean")},is=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},as=function(t){return t.getParam("icons","","string")},us=function(t){return t.getParam("images_upload_url","","string")},cs=function(t){return t.getParam("images_upload_base_path","","string")},ss=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},ls=function(t){return t.getParam("images_upload_handler",null,"function")},fs=function(t){return t.getParam("content_css_cors",!1,"boolean")},ds=function(t){return t.getParam("referrer_policy","","string")},ms=function(t){return t.getParam("language","en","string")},gs=function(t){return t.getParam("indent_use_margin",!1)},hs=function(t){var e=t.getParam("font_css",[]);return g(e)?e:W(e.split(","),Ft)},ps=function(t){var e=t.getParam("object_resizing");return!1!==e&&!Se.iOS&&(d(e)?e:"table,img,figure.image,div,video,iframe")},vs=function(t){return t.getParam("event_root")},bs=function(t){return t.getParam("theme")},ys=function(t){return t.getParam("validate")},ws=function(t){return!1!==t.getParam("inline_boundaries")},xs=function(t){return t.getParam("content_css_cors")},Cs=function(t){return t.getParam("plugins","","string")},Ss=An,ks=Hn,Ts=function(t){var e=t.parentNode;e&&e.removeChild(t)},Os=function(t){var e=So(t);return{count:t.length-e.length,text:e}},Es=function(t){for(var e;-1!==(e=t.data.lastIndexOf(xo));)t.deleteData(e,1)},_s=function(t,e){return Ds(t),e},Rs=function(t,e){var n=e.container(),r=function(t,e){var n=V(t,e);return-1===n?L.none():L.some(n)}(ct(n.childNodes),t).map((function(t){return t<e.offset()?Rc(n,e.offset()-1):e})).getOr(e);return Ds(t),r},Ns=function(t,e){return ks(t)&&e.container()===t?function(t,e){var n=Os(t.data.substr(0,e.offset())),r=Os(t.data.substr(e.offset()));return(n.text+r.text).length>0?(Es(t),Rc(t,e.offset()-n.count)):e}(t,e):_s(t,e)},As=function(t,e){return Rc.isTextPosition(e)?Ns(t,e):function(t,e){return e.container()===t.parentNode?Rs(t,e):_s(t,e)}(t,e)},Ds=function(t){Ss(t)&&_o(t)&&(Ro(t)?t.removeAttribute("data-mce-caret"):Ts(t)),ks(t)&&(Es(t),0===t.data.length&&Ts(t))},Ms=ge().browser,Bs=$n,zs=Kn,Ps=Gn,Ls=function(t,e,n){var r,o,i=nc(e.getBoundingClientRect(),n);if("BODY"===t.tagName){var a=t.ownerDocument.documentElement;r=t.scrollLeft||a.scrollLeft,o=t.scrollTop||a.scrollTop}else{var u=t.getBoundingClientRect();r=t.scrollLeft-u.left,o=t.scrollTop-u.top}i.left+=r,i.right+=r,i.top+=o,i.bottom+=o,i.width=1;var c=e.offsetWidth-e.clientWidth;return c>0&&(n&&(c*=-1),i.left+=c,i.right+=c),i},Is=function(t,e,n,r){var o,i,a=Eu(),u=ns(t),c=u.length>0?u:"p",s=function(){!function(t){for(var e=Iu(Ne.fromDom(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n<e.length;n++){var r,o=e[n].dom,i=o.previousSibling;Bo(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,Mo(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1))}}(e),i&&(Ds(i),i=null),a.on((function(t){su(t.caret).remove(),a.clear()})),o&&(oo.clearInterval(o),o=void 0)},l=function(){o=oo.setInterval((function(){r()?su("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):su("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500)};return{show:function(t,r){var o;if(s(),Ps(r))return null;if(!n(r))return i=function(t,e){var n=t.ownerDocument.createTextNode(xo),r=t.parentNode;if(e){if(o=t.previousSibling,To(o)){if(_o(o))return o;if(Bo(o))return o.splitText(o.data.length-1)}r.insertBefore(n,t)}else{var o=t.nextSibling;if(To(o)){if(_o(o))return o;if(Mo(o))return o.splitText(1),o}t.nextSibling?r.insertBefore(n,t.nextSibling):r.appendChild(n)}return n}(r,t),o=r.ownerDocument.createRange(),Fs(i.nextSibling)?(o.setStart(i,0),o.setEnd(i,0)):(o.setStart(i,1),o.setEnd(i,1)),o;i=Do(c,r,t);var u=Ls(e,r,t);su(i).css("top",u.top);var f=su('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(Nt({},u)).appendTo(e)[0];return a.set({caret:f,element:r,before:t}),t&&su(f).addClass("mce-visual-caret-before"),l(),(o=r.ownerDocument.createRange()).setStart(i,0),o.setEnd(i,0),o},hide:s,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){a.on((function(t){var n=Ls(e,t.element,t.before);su(t.caret).css(Nt({},n))}))},destroy:function(){return oo.clearInterval(o)}}},Hs=function(){return Ms.isIE()||Ms.isEdge()||Ms.isFirefox()},Fs=function(t){return Bs(t)||zs(t)},Vs=function(t){return Fs(t)||Pn(t)&&Hs()},js=$n,Us=Kn,Ws=Mn("display","block table table-cell table-caption list-item"),qs=_o,$s=Oo,Gs=An,Ks=qo,Xs=function(t){return t>0},Ys=function(t){return t<0},Js=function(t,e){for(var n;n=t(e);)if(!$s(n))return n;return null},Qs=function(t,e,n,r,o){var i=new uo(t,r),a=js(t)||$s(t);if(Ys(e)){if(a&&n(t=Js(i.prev.bind(i),!0)))return t;for(;t=Js(i.prev.bind(i),o);)if(n(t))return t}if(Xs(e)){if(a&&n(t=Js(i.next.bind(i),!0)))return t;for(;t=Js(i.next.bind(i),o);)if(n(t))return t}return null},Zs=function(t,e){for(;t&&t!==e;){if(Ws(t))return t;t=t.parentNode}return null},tl=function(t,e,n){return Zs(t.container(),n)===Zs(e.container(),n)},el=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return Gs(n)?n.childNodes[r+t]:null},nl=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},rl=function(t,e,n){return Zs(e,t)===Zs(n,t)},ol=function(t,e,n){for(var r=t?"previousSibling":"nextSibling";n&&n!==e;){var o=n[r];if(qs(o)&&(o=o[r]),js(o)||Us(o)){if(rl(e,o,n))return o;break}if(Ks(o))break;n=n.parentNode}return null},il=_(nl,!0),al=_(nl,!1),ul=function(t,e,n){var r,o=_(ol,!0,e),i=_(ol,!1,e),a=n.startContainer,u=n.startOffset;if(Oo(a)){Gs(a)||(a=a.parentNode);var c=a.getAttribute("data-mce-caret");if("before"===c&&(r=a.nextSibling,Vs(r)))return il(r);if("after"===c&&(r=a.previousSibling,Vs(r)))return al(r)}if(!n.collapsed)return n;if(Hn(a)){if(qs(a)){if(1===t){if(r=i(a))return il(r);if(r=o(a))return al(r)}if(-1===t){if(r=o(a))return al(r);if(r=i(a))return il(r)}return n}if(Bo(a)&&u>=a.data.length-1)return 1===t&&(r=i(a))?il(r):n;if(Mo(a)&&u<=1)return-1===t&&(r=o(a))?al(r):n;if(u===a.data.length)return(r=i(a))?il(r):n;if(0===u)return(r=o(a))?al(r):n}return n},cl=function(t,e){return L.from(el(t?0:-1,e)).filter(js)},sl=function(t,e,n){var r=ul(t,e,n);return-1===t?Rc.fromRangeStart(r):Rc.fromRangeEnd(r)},ll=function(t){return L.from(t.getNode()).map(Ne.fromDom)},fl=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},dl=function(t,e){var n=tl(t,e);return!(n||!Un(t.getNode()))||n};!function(t){t[t.Backwards=-1]="Backwards",t[t.Forwards=1]="Forwards"}(Nc||(Nc={}));var ml,gl=$n,hl=Hn,pl=An,vl=Un,bl=qo,yl=function(t){return jo(t)||function(t){return!!$o(t)&&!0!==Y(ct(t.getElementsByTagName("*")),(function(t,e){return t||Lo(e)}),!1)}(t)},wl=Go,xl=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},Cl=function(t,e){if(Xs(t)){if(bl(e.previousSibling)&&!hl(e.previousSibling))return Rc.before(e);if(hl(e))return Rc(e,0)}if(Ys(t)){if(bl(e.nextSibling)&&!hl(e.nextSibling))return Rc.after(e);if(hl(e))return Rc(e,e.data.length)}return Ys(t)?vl(e)?Rc.before(e):Rc.after(e):Rc.before(e)},Sl=function(t,e,n){var r,o,i,a;if(!pl(n)||!e)return null;if(e.isEqual(Rc.after(n))&&n.lastChild){if(a=Rc.after(n.lastChild),Ys(t)&&bl(n.lastChild)&&pl(n.lastChild))return vl(n.lastChild)?Rc.before(n.lastChild):a}else a=e;var u=a.container(),c=a.offset();if(hl(u)){if(Ys(t)&&c>0)return Rc(u,--c);if(Xs(t)&&c<u.length)return Rc(u,++c);r=u}else{if(Ys(t)&&c>0&&(o=xl(u,c-1),bl(o)))return!yl(o)&&(i=Qs(o,t,wl,o))?hl(i)?Rc(i,i.data.length):Rc.after(i):hl(o)?Rc(o,o.data.length):Rc.before(o);if(Xs(t)&&c<u.childNodes.length&&(o=xl(u,c),bl(o)))return vl(o)?function(t,e){var n=e.nextSibling;return n&&bl(n)?hl(n)?Rc(n,0):Rc.before(n):Sl(Nc.Forwards,Rc.after(e),t)}(n,o):!yl(o)&&(i=Qs(o,t,wl,o))?hl(i)?Rc(i,0):Rc.before(i):hl(o)?Rc(o,0):Rc.after(o);r=o||a.getNode()}if((Xs(t)&&a.isAtEnd()||Ys(t)&&a.isAtStart())&&(r=Qs(r,t,M,n,!0),wl(r,n)))return Cl(t,r);o=Qs(r,t,wl,n);var s=Rt(K(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(u,n),gl));return!s||o&&s.contains(o)?o?Cl(t,o):null:a=Xs(t)?Rc.after(s):Rc.before(s)},kl=function(t){return{next:function(e){return Sl(Nc.Forwards,e,t)},prev:function(e){return Sl(Nc.Backwards,e,t)}}},Tl=function(t){return Rc.isTextPosition(t)?0===t.offset():qo(t.getNode())},Ol=function(t){if(Rc.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return qo(t.getNode(!0))},El=function(t,e){return!Rc.isTextPosition(t)&&!Rc.isTextPosition(e)&&t.getNode()===e.getNode(!0)},_l=function(t,e,n){return t?!El(e,n)&&(r=e,!(!Rc.isTextPosition(r)&&Un(r.getNode())))&&Ol(e)&&Tl(n):!El(n,e)&&Tl(e)&&Ol(n);var r},Rl=function(t,e,n){var r=kl(e);return L.from(t?r.next(n):r.prev(n))},Nl=function(t,e,n){return Rl(t,e,n).bind((function(r){return tl(n,r,e)&&_l(t,n,r)?Rl(t,e,r):L.some(r)}))},Al=function(t,e,n,r){return Nl(t,e,n).bind((function(n){return r(n)?Al(t,e,n,r):L.some(n)}))},Dl=function(t,e){var n,r=t?e.firstChild:e.lastChild;return Hn(r)?L.some(Rc(r,t?0:r.data.length)):r?qo(r)?L.some(t?Rc.before(r):Un(n=r)?Rc.before(n):Rc.after(n)):function(t,e,n){var r=t?Rc.before(n):Rc.after(n);return Rl(t,e,r)}(t,e,r):L.none()},Ml=_(Rl,!0),Bl=_(Rl,!1),zl=_(Dl,!0),Pl=_(Dl,!1),Ll="_mce_caret",Il=function(t){return An(t)&&t.id===Ll},Hl=function(t,e){for(;e&&e!==t;){if(e.id===Ll)return e;e=e.parentNode}return null},Fl=function(t){return _e.isArray(t.start)},Vl=function(t,e){return An(e)&&t.isBlock(e)&&!e.innerHTML&&!Se.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},jl=function(t,e){return Pl(t).fold(D,(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},Ul=function(t,e,n){return!(!function(t){return!1===t.hasChildNodes()}(e)||!Hl(t,e))&&(function(t,e){var n=t.ownerDocument.createTextNode(xo);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),!0)},Wl=function(t,e,n,r){var o,i,a,u,c=n[e?"start":"end"],s=t.getRoot();if(c){for(a=c[0],i=s,o=c.length-1;o>=1;o--){if(u=i.childNodes,Ul(s,i,r))return!0;if(c[o]>u.length-1)return!!Ul(s,i,r)||jl(i,r);i=u[c[o]]}3===i.nodeType&&(a=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,a):r.setEnd(i,a)}return!0},ql=function(t){return Hn(t)&&t.data.length>0},$l=function(t,e,n){var r,o,i,a,u,c,s=t.get(n.id+"_"+e),l=n.keep;if(s){if(r=s.parentNode,"start"===e?(l?s.hasChildNodes()?(r=s.firstChild,o=1):ql(s.nextSibling)?(r=s.nextSibling,o=0):ql(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)+1):o=t.nodeIndex(s),u=r,c=o):(l?s.hasChildNodes()?(r=s.firstChild,o=1):ql(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)):o=t.nodeIndex(s),u=r,c=o),!l){for(a=s.previousSibling,i=s.nextSibling,_e.each(_e.grep(s.childNodes),(function(t){Hn(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));s=t.get(n.id+"_"+e);)t.remove(s,!0);a&&i&&a.nodeType===i.nodeType&&Hn(a)&&!Se.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),t.remove(i),u=a,c=o)}return L.some(Rc(u,c))}return L.none()},Gl=function(t,e){var n=t.dom;if(e){if(Fl(e))return function(t,e){var n=t.createRng();return Wl(t,!0,e,n)&&Wl(t,!1,e,n)?L.some(n):L.none()}(n,e);if(function(t){return d(t.start)}(e))return L.some(function(t,e){var n,r=t.createRng();return n=Vc(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=Vc(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r}(n,e));if(function(t){return wt(t,"id")}(e))return function(t,e){var n=$l(t,"start",e),r=$l(t,"end",e);return Yn(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(Vl(t,e.container()),e.offset()),r.setEnd(Vl(t,n.container()),n.offset()),r}))}(n,e);if(function(t){return wt(t,"name")}(e))return function(t,e){return L.from(t.select(e.name)[e.index]).map((function(e){var n=t.createRng();return n.selectNode(e),n}))}(n,e);if(function(t){return wt(t,"rng")}(e))return L.some(e.rng)}return L.none()},Kl=function(t,e,n){return Jc(t,e,n)},Xl=function(t,e){Gl(t,e).each((function(e){t.setRng(e)}))},Yl=function(t){return An(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Jl=(ml=wo,function(t){return ml===t}),Ql=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Zl=function(t){return!Ql(t)&&!Jl(t)},tf=function(t){return!!t.nodeType},ef=function(t,e,n){var r=n.startOffset,o=n.startContainer;if((o!==n.endContainer||!function(t){return t&&/^(IMG)$/.test(t.nodeName)}(o.childNodes[r]))&&An(o)){var i=o.childNodes,a=void 0;r<i.length?(o=i[r],a=new uo(o,t.getParent(o,t.isBlock))):(o=i[i.length-1],(a=new uo(o,t.getParent(o,t.isBlock))).next(!0));for(var u=a.current();u;u=a.next())if(Hn(u)&&!af(u))return n.setStart(u,0),void e.setRng(n)}},nf=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(An(t)||!af(t))return t}},rf=function(t,e){return tf(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},of=function(t,e,n){return t.schema.isValidChild(e,n)},af=function(t,e){if(void 0===e&&(e=!1),y(t)&&Hn(t)){var n=e?t.data.replace(/ /g," "):t.data;return Xo(n)}return!1},uf=function(t,e){return w(t)?t=t(e):y(e)&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},cf=function(t,e){return e=e||"",t=""+((t=t||"").nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},sf=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},lf=function(t,e,n){return sf(t,t.getStyle(e,n),n)},ff=function(t,e){var n;return t.getParent(e,(function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n})),n},df=function(t,e,n){return t.getParents(e,n,t.getRoot())},mf=function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return vt(t,(function(t,e){return U(r,(function(t){return t===e}))}))};return U(t.formatter.get(e),(function(e){var r=o(e);return U(t.formatter.get(n),(function(t){var e=o(t);return function(t,e,n){return void 0===n&&(n=c),u(n).eq(t,e)}(r,e)}))}))},gf=function(t){return xt(t,"block")},hf=function(t){return xt(t,"selector")},pf=function(t){return xt(t,"inline")},vf=function(t){return hf(t)&&!1!==t.expand&&!pf(t)},bf=Yl,yf=df,wf=af,xf=rf,Cf=function(t,e){for(var n=e;n;){if(An(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},Sf=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},kf=function(t,e,n){return Sf(t,e,n,(function(t){return Jl(t)||Ql(t)}))},Tf=function(t,e,n){return Sf(t,e,n,Zl)},Of=function(t,e,n,r,o,i){var a,u=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=Zu(t),c=o?i.backwards:i.forwards;return L.from(c(e,n,(function(t,e){return bf(t.parentNode)?-1:(a=t,r(o,t,e))}),u))};return c(n,r,kf).bind((function(t){return i?c(t.container,t.offset+(o?-1:0),Tf):L.some(t)})).orThunk((function(){return a?L.some({container:a,offset:o?0:a.length}):L.none()}))},Ef=function(t,e,n,r,o){Hn(r)&&Wt(r.data)&&r[o]&&(r=r[o]);for(var i=yf(t,r),a=0;a<i.length;a++)for(var u=0;u<e.length;u++){var c=e[u];if((!y(c.collapsed)||c.collapsed===n.collapsed)&&(hf(c)&&t.is(i[a],c.selector)))return i[a]}return r},_f=function(t,e,n,r){var o=n,i=t.dom,a=i.getRoot(),u=e[0];if(gf(u)&&(o=u.wrapper?null:i.getParent(n,u.block,a)),!o){var c=i.getParent(n,"LI,TD,TH");o=i.getParent(Hn(n)?n.parentNode:n,(function(e){return e!==a&&xf(t,e)}),c)}if(o&&gf(u)&&u.wrapper&&(o=yf(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!cf(o,"br")););return o||n},Rf=function(t,e,n,r){var o=n.parentNode;return!y(n[r])&&(!(o!==e&&!b(o)&&!t.isBlock(o))||Rf(t,e,o,r))},Nf=function(t,e,n,r,o){var i,a=n,u=o?"previousSibling":"nextSibling",c=t.getRoot();if(Hn(n)&&!wf(n)&&(o?r>0:r<n.data.length))return n;for(;;){if(!e[0].block_expand&&t.isBlock(a))return a;for(var s=a[u];s;s=s[u]){var l=Hn(s)&&!Rf(t,c,s,u);if(!bf(s)&&(!Un(i=s)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!wf(s,l))return a}if(a===c||a.parentNode===c){n=a;break}a=a.parentNode}return n},Af=function(t){return bf(t.parentNode)||bf(t)},Df=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,a=e.endContainer,u=e.endOffset,c=t.dom,s=n[0];(An(o)&&o.hasChildNodes()&&(o=cc(o,i),Hn(o)&&(i=0)),An(a)&&a.hasChildNodes()&&(a=cc(a,e.collapsed?u:u-1),Hn(a)&&(u=a.nodeValue.length)),o=Cf(c,o),a=Cf(c,a),Af(o)&&(o=bf(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,Hn(o)&&(i=e.collapsed?o.length:0)),Af(a)&&(a=bf(a)?a:a.parentNode,a=e.collapsed?a.nextSibling||a:a.previousSibling||a,Hn(a)&&(u=e.collapsed?0:a.length)),e.collapsed)&&(Of(c,t.getBody(),o,i,!0,r).each((function(t){var e=t.container,n=t.offset;o=e,i=n})),Of(c,t.getBody(),a,u,!1,r).each((function(t){var e=t.container,n=t.offset;a=e,u=n})));return(pf(s)||s.block_expand)&&(pf(s)&&Hn(o)&&0!==i||(o=Nf(c,n,o,i,!0)),pf(s)&&Hn(a)&&u!==a.nodeValue.length||(a=Nf(c,n,a,u,!1))),vf(s)&&(o=Ef(c,n,e,o,"previousSibling"),a=Ef(c,n,e,a,"nextSibling")),(gf(s)||hf(s))&&(o=_f(t,n,o,"previousSibling"),a=_f(t,n,a,"nextSibling"),gf(s)&&(c.isBlock(o)||(o=Nf(c,n,o,i,!0)),c.isBlock(a)||(a=Nf(c,n,a,u,!1)))),An(o)&&(i=c.nodeIndex(o),o=o.parentNode),An(a)&&(u=c.nodeIndex(a)+1,a=a.parentNode),{startContainer:o,startOffset:i,endContainer:a,endOffset:u}},Mf=function(t,e,n){var r=e.startOffset,o=cc(e.startContainer,r),i=e.endOffset,a=cc(e.endContainer,i-1),u=function(t){var e=t[0];Hn(e)&&e===o&&r>=e.data.length&&t.splice(0,1);var n=t[t.length-1];return 0===i&&t.length>0&&n===a&&Hn(n)&&t.splice(t.length-1,1),t},c=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},s=function(e,n){return t.getParent(e,(function(t){return t.parentNode===n}),n)},l=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,a=i.parentNode;i&&i!==e;i=a){a=i.parentNode;var s=c(i===t?i:i[o],o);s.length&&(r||s.reverse(),n(u(s)))}};if(o===a)return n(u([o]));var f=t.findCommonAncestor(o,a);if(t.isChildOf(o,a))return l(o,f,!0);if(t.isChildOf(a,o))return l(a,f);var d=s(o,f)||o,m=s(a,f)||a;l(o,d,!0);var g=c(d===o?d:d.nextSibling,"nextSibling",m===a?m.nextSibling:m);g.length&&n(u(g)),l(a,m)},Bf=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},zf=function(t){return K(function(t){return tt(t,(function(t){var e=uc(t);return e?[Ne.fromDom(e)]:[]}))}(t),bo)},Pf=function(t,e){var n=Iu(e,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:zf(t)},Lf=function(t){return Pf(Bf(t.selection.getSel()),Ne.fromDom(t.getBody()))},If=function(t,e){return Jr(t,"table",e)},Hf=function(t){return tn(t).fold(T([t]),(function(e){return[t].concat(Hf(e))}))},Ff=function(t){return en(t).fold(T([t]),(function(e){return"br"===Le(e)?Ke(e).map((function(e){return[t].concat(Ff(e))})).getOr([]):[t].concat(Ff(e))}))},Vf=function(t,e){return Yn(function(t){var e=t.startContainer,n=t.startOffset;return Hn(e)?0===n?L.some(Ne.fromDom(e)):L.none():L.from(e.childNodes[n]).map(Ne.fromDom)}(e),function(t){var e=t.endContainer,n=t.endOffset;return Hn(e)?n===e.data.length?L.some(Ne.fromDom(e)):L.none():L.from(e.childNodes[n-1]).map(Ne.fromDom)}(e),(function(e,n){var r=Q(Hf(t),_(Be,e)),o=Q(Ff(t),_(Be,n));return r.isSome()&&o.isSome()})).getOr(!1)},jf=function(t,e,n,r){var o=n,i=new uo(n,o),a=vt(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!j(["td","th","table"],e.toLowerCase())}));do{if(Hn(n)&&0!==_e.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(a[n.nodeName])return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},Uf=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},Wf=function(t,e){var n=Lf(t);n.length>0?q(n,(function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},qf=function(t,e,n){var r=Yc(t,e);n(r),t.moveToBookmark(r)},$f=function(t,e){var n=function(e){return t(e)?L.from(e.dom.nodeValue):L.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Ve,"text"),Gf=function(t){return $f.get(t)},Kf=function(t,e,n,r){return Ge(e).fold((function(){return"skipping"}),(function(o){return"br"===r||function(t){return Ve(t)&&Gf(t)===xo}(e)?"valid":function(t){return Fe(t)&&Pu(t,Hu())}(e)?"existing":Il(e.dom)?"caret":of(t,n,r)&&of(t,Le(o),n)?"valid":"invalid-child"}))},Xf=function(t,e,n,r){var o=e.uid,i=void 0===o?Gu("mce-annotation"):o,a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["uid"]),u=Ne.fromTag("span",t);Bu(u,Hu()),Zn(u,""+Vu(),i),Zn(u,""+Fu(),n);var c=r(i,a),s=c.attributes,l=void 0===s?{}:s,f=c.classes,d=void 0===f?[]:f;return tr(u,l),function(t,e){q(e,(function(e){Bu(t,e)}))}(u,d),u},Yf=function(t,e,n,r,o){var i=[],a=Xf(t.getDoc(),o,n,r),u=Eu(),c=function(){u.clear()},s=function(t){q(t,l)},l=function(e){switch(Kf(t,e,"span",Le(e))){case"invalid-child":c();var n=Qe(e);s(n),c();break;case"valid":!function(t,e){fn(t,e),gn(e,t)}(e,u.get().getOrThunk((function(){var t=Yu(a);return i.push(t),u.set(t),t})))}};return Mf(t.dom,e,(function(t){c(),function(t){var e=W(t,Ne.fromDom);s(e)}(t)})),i},Jf=function(t,e,n,r){t.undoManager.transact((function(){var o=t.selection,i=o.getRng(),a=Lf(t).length>0;if(i.collapsed&&!a&&function(t,e){var n=Df(t,e,[{inline:"span"}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)}(t,i),o.getRng().collapsed&&!a){var u=Xf(t.getDoc(),r,e,n.decorate);Ku(u,wo),o.getRng().insertNode(u.dom),o.select(u.dom)}else qf(o,!1,(function(){Wf(t,(function(o){Yf(t,o,e,n.decorate,r)}))}))}))},Qf=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return yt(e,t).map((function(t){return t.settings}))}});qu(t,n);var r=Wu(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each((function(n){Jf(t,e,n,r)}))},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){ju(t,L.some(e)).each((function(t){var e=t.elements;q(e,bn)}))},getAll:function(e){var n=function(t,e){var n=Ne.fromDom(t.getBody()),r=Iu(n,"["+Fu()+'="'+e+'"]'),o={};return q(r,(function(t){var e=er(t,Vu()),n=yt(o,e).getOr([]);o[e]=n.concat([t])})),o}(t,e);return mt(n,(function(t){return W(t,(function(t){return t.dom}))}))}}},Zf=function(t){return{getBookmark:_(Kl,t),moveToBookmark:_(Xl,t)}};Zf.isBookmarkNode=Yl;var td=function(t,e){for(;e&&e!==t;){if(qn(e)||$n(e))return e;e=e.parentNode}return null},ed=function(t,e,n){if(n.collapsed)return!1;if(Se.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(An(r))return U(r.getClientRects(),(function(n){return ac(n,t,e)}))}return U(n.getClientRects(),(function(n){return ac(n,t,e)}))},nd=function(t,e,n){return t.fire(e,n)},rd=function(t,e,n,r){return t.fire("FormatApply",{format:e,node:n,vars:r})},od=function(t,e,n,r){return t.fire("FormatRemove",{format:e,node:n,vars:r})},id={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||id.metaKeyPressed(t)},metaKeyPressed:function(t){return Se.mac?t.metaKey:t.ctrlKey&&!t.altKey}},ad=$n,ud=function(t,e){var n,r,o,i,a,u,c,s,l,f,d,m,g,h,p,v="data-mce-selected",b=e.dom,w=_e.each,x=e.getDoc(),C=document,S=Math.abs,k=Math.round,T=e.getBody(),O={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},E=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},_=function(t){return Kn(t)||b.hasClass(t,"mce-preview-object")},R=function(t){var n=t.target;(function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return E(t.target)&&!ed(n.clientX,n.clientY,e)}return E(t.target)&&!ed(t.clientX,t.clientY,e)})(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},N=function(t){return b.is(t,"figure.image")?[t.querySelector("img")]:b.hasClass(t,"mce-preview-object")&&y(t.firstElementChild)?[t,t.firstElementChild]:[t]},A=function(t){var n=ps(e);return!!n&&("false"!==t.getAttribute("data-mce-resize")&&(t!==e.getBody()&&(b.hasClass(t,"mce-preview-object")?De(Ne.fromDom(t.firstElementChild),n):De(Ne.fromDom(t),n))))},D=function(t,n,r){if(y(r)){var o=N(t);q(o,(function(t){t.style[n]||!e.schema.isValid(t.nodeName.toLowerCase(),n)?b.setStyle(t,n,r):b.setAttrib(t,n,""+r)}))}},M=function(t,e,n){D(t,"width",e),D(t,"height",n)},B=function(t){var a,v,y,w;a=t.screenX-u,v=t.screenY-c,m=a*i[2]+s,g=v*i[3]+l,m=m<5?5:m,g=g<5?5:g,((E(n)||_(n))&&!1!==function(t){return t.getParam("resize_img_proportional",!0,"boolean")}(e)?!id.modifierPressed(t):id.modifierPressed(t))&&(S(a)>S(v)?(g=k(m*f),m=k(g/f)):(m=k(g/f),g=k(m*f))),M(r,m,g),y=(y=i.startPos.x+a)>0?y:0,w=(w=i.startPos.y+v)>0?w:0,b.setStyles(o,{left:y,top:w,display:"block"}),o.innerHTML=m+" &times; "+g,i[2]<0&&r.clientWidth<=m&&b.setStyle(r,"left",undefined+(s-m)),i[3]<0&&r.clientHeight<=g&&b.setStyle(r,"top",undefined+(l-g)),(a=T.scrollWidth-h)+(v=T.scrollHeight-p)!==0&&b.setStyles(o,{left:y-a,top:w-v}),d||(!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(e,n,s,l,"corner-"+i.name),d=!0)},z=function(){var t=d;d=!1,t&&(D(n,"width",m),D(n,"height",g)),b.unbind(x,"mousemove",B),b.unbind(x,"mouseup",z),C!==x&&(b.unbind(C,"mousemove",B),b.unbind(C,"mouseup",z)),b.remove(r),b.remove(o),b.remove(a),P(n),t&&(!function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(e,n,m,g,"corner-"+i.name),b.setAttrib(n,"style",b.getAttrib(n,"style"))),e.nodeChanged()},P=function(t){F();var d=b.getPos(t,T),y=d.x,S=d.y,k=t.getBoundingClientRect(),E=k.width||k.right-k.left,R=k.height||k.bottom-k.top;n!==t&&(L(),n=t,m=g=0);var D=e.fire("ObjectSelected",{target:t}),P=b.getAttrib(n,v,"1");A(t)&&!D.isDefaultPrevented()?w(O,(function(t,e){var d,m=function(d){var m,g=N(n)[0];u=d.screenX,c=d.screenY,s=g.clientWidth,l=g.clientHeight,f=l/s,(i=t).name=e,i.startPos={x:E*t[0]+y,y:R*t[1]+S},h=T.scrollWidth,p=T.scrollHeight,a=b.add(T,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),b.setStyles(a,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),r=_(m=n)?b.create("img",{src:Se.transparentSrc}):m.cloneNode(!0),b.addClass(r,"mce-clonedresizable"),b.setAttrib(r,"data-mce-bogus","all"),r.contentEditable="false",b.setStyles(r,{left:y,top:S,margin:0}),M(r,E,R),r.removeAttribute(v),T.appendChild(r),b.bind(x,"mousemove",B),b.bind(x,"mouseup",z),C!==x&&(b.bind(C,"mousemove",B),b.bind(C,"mouseup",z)),o=b.add(T,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},s+" &times; "+l)};(d=b.get("mceResizeHandle"+e))&&b.remove(d),d=b.add(T,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===Se.ie&&(d.contentEditable=!1),b.bind(d,"mousedown",(function(t){t.stopImmediatePropagation(),t.preventDefault(),m(t)})),t.elm=d,b.setStyles(d,{left:E*t[0]+y-d.offsetWidth/2,top:R*t[1]+S-d.offsetHeight/2})})):L(),b.getAttrib(n,v)||n.setAttribute(v,P)},L=function(){F(),n&&n.removeAttribute(v),dt(O,(function(t,e){var n=b.get("mceResizeHandle"+e);n&&(b.unbind(n),b.remove(n))}))},I=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};d||e.removed||(w(b.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute(v)})),r="mousedown"===n.type?n.target:t.getNode(),o(r=b.$(r).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],T)&&(V(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?P(r):L())},H=function(t){return ad(td(e.getBody(),t))},F=function(){dt(O,(function(t){t.elm&&(b.unbind(t.elm),delete t.elm)}))},V=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}};e.on("init",(function(){if(V(),Se.browser.isIE()||Se.browser.isEdge()){e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;d||!/^(TABLE|IMG|HR)$/.test(r)||H(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())}));var t=function(t){var n=function(t){oo.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(H(t.target)||Kn(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};b.bind(T,"mscontrolselect",t),e.on("remove",(function(){return b.unbind(T,"mscontrolselect",t)}))}var r=oo.throttle((function(t){e.composing||I(t)}));e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),e.on("keyup compositionend",(function(t){n&&"TABLE"===n.nodeName&&r(t)})),e.on("hide blur",L),e.on("contextmenu longpress",R,!0)})),e.on("remove",F);return{isResizable:A,showResizeRect:P,hideResizeRect:L,updateResizeRect:I,destroy:function(){n=r=a=null}}},cd=function(t){return qn(t)||$n(t)},sd=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(i.caretRangeFromPoint)r=i.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=_e.toArray(i.getClientRects())).sort((function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-Math.abs(Math.max(n.top-e,n.bottom-e))}))).length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return function(t,e){var n=t&&t.parentElement?t.parentElement():null;return $n(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,cd))?null:t}(r,n.body)}return r},ld=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},fd=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},dd=function(t,e,n){return fd(t,e,(function(t){return t.nodeName===n}))},md=function(t){return t&&"TABLE"===t.nodeName},gd=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},hd=function(t,e){return _o(t)&&!1===fd(t,e,Il)},pd=function(t,e,n){for(var r=new uo(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(Un(e))return!0},vd=function(t,e,n,r,o){var i,a,u=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||u;if(r&&Un(o)&&e&&t.isEmpty(s))return L.some(Rc(o.parentNode,t.nodeIndex(o)));for(var l=new uo(o,s);a=l[r?"prev":"next"]();){if("false"===t.getContentEditableParent(a)||hd(a,u))return L.none();if(Hn(a)&&a.nodeValue.length>0)return!1===dd(a,u,"A")?L.some(Rc(a,r?a.nodeValue.length:0)):L.none();if(t.isBlock(a)||c[a.nodeName.toLowerCase()])return L.none();i=a}return n&&i?L.some(Rc(i,0)):L.none()},bd=function(t,e,n,r){var o,i,a,u,c=t.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var l=An(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(u=n,_o(o))return L.none();if(An(o)&&i>o.childNodes.length-1&&(u=!1),Vn(o)&&(o=c,i=0),o===c){if(u&&(a=o.childNodes[i>0?i-1:0])){if(_o(a))return L.none();if(f[a.nodeName]||md(a))return L.none()}if(o.hasChildNodes()){if(i=Math.min(!u&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Hn(o)&&l?o.data.length:0,!e&&o===c.lastChild&&md(o))return L.none();if(function(t,e){for(;e&&e!==t;){if($n(e))return!0;e=e.parentNode}return!1}(c,o)||_o(o))return L.none();if(o.hasChildNodes()&&!1===md(o)){a=o;var d=new uo(o,c);do{if($n(a)||_o(a)){s=!1;break}if(Hn(a)&&a.nodeValue.length>0){i=u?0:a.nodeValue.length,o=a,s=!0;break}if(f[a.nodeName.toLowerCase()]&&!gd(a)){i=t.nodeIndex(a),o=a.parentNode,u||i++,s=!0;break}}while(a=u?d.next():d.prev())}}}return e&&(Hn(o)&&0===i&&vd(t,l,e,!0,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),An(o)&&((a=o.childNodes[i])||(a=o.childNodes[i-1]),!a||!Un(a)||function(t,e){return t.previousSibling&&t.previousSibling.nodeName===e}(a,"A")||pd(t,a,!1)||pd(t,a,!0)||vd(t,l,e,!0,a).each((function(t){o=t.container(),i=t.offset(),s=!0})))),u&&!e&&Hn(o)&&i===o.nodeValue.length&&vd(t,l,e,!1,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),s?L.some(Rc(o,i)):L.none()},yd=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=Rc.fromRangeStart(e);return bd(t,n,!0,r).each((function(t){n&&Rc.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||bd(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),ld(e,r)?L.none():L.some(r)},wd=function(t,e){return t.splitText(e)},xd=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&Hn(e)?n>0&&n<e.nodeValue.length&&(e=(r=wd(e,n)).previousSibling,o>n?(e=r=wd(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Hn(e)&&n>0&&n<e.nodeValue.length&&(e=wd(e,n),n=0),Hn(r)&&o>0&&o<r.nodeValue.length&&(o=(r=wd(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}},Cd=function(t){return{walk:function(e,n){return Mf(t,e,n)},split:xd,normalize:function(e){return yd(t,e).fold(D,(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))}}};Cd.compareRanges=ld,Cd.getCaretRangeFromPoint=sd,Cd.getSelectedNode=uc,Cd.getNode=cc;var Sd,kd=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=ir(n,t);return parseFloat(o)||0}return r},r=function(t,e){return Y(e,(function(e,n){var r=ir(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!x(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Jn(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}("height",(function(t){var e=t.dom;return yn(t)?e.getBoundingClientRect().height:e.offsetHeight})),Td=function(t,e){return t.view(e).fold(T([]),(function(e){var n=t.owner(e),r=Td(t,n);return[e].concat(r)}))},Od=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?L.none():L.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Ne.fromDom)},owner:function(t){return qe(t)}}),Ed=function(t){var e=Ne.fromDom(document),n=kn(e),r=function(t,e){var n=e.owner(t);return Td(e,n)}(t,Od),o=Sn(t),i=X(r,(function(t,e){var n=Sn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return xn(i.left+o.left+n.left,i.top+o.top+n.top)},_d=function(t){return"textarea"===Le(t)},Rd=function(t,e){var n=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return xn(n.offsetLeft,n.offsetTop);var i=Cn(null==r?void 0:r.pageYOffset,o.scrollTop),a=Cn(null==r?void 0:r.pageXOffset,o.scrollLeft),u=Cn(o.clientTop,n.clientTop),c=Cn(o.clientLeft,n.clientLeft);return Sn(t).translate(a-c,i-u)}(t),r=function(t){return kd.get(t)}(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}},Nd=function(t,e){var n=function(t,e){var n=Qe(t);if(0===n.length||_d(t))return{element:t,offset:e};if(e<n.length&&!_d(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return _d(r)?{element:t,offset:e}:"img"===Le(r)?{element:r,offset:1}:Ve(r)?{element:r,offset:Gf(r).length}:{element:r,offset:Qe(r).length}}(t,e),r=Ne.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>');return fn(n.element,r),Rd(r,(function(){return vn(r)}))},Ad=function(t,e,n,r){zd(t,(function(o,i){return Md(t,e,n,r)}),n)},Dd=function(t,e,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(t,e){return t.fire("ScrollIntoView",e).isDefaultPrevented()})(t,i)||(n(e,kn(e).top,r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},Md=function(t,e,n,r){var o=Ne.fromDom(t.getBody()),i=Ne.fromDom(t.getDoc());o.dom.offsetWidth;var a=Nd(Ne.fromDom(n.startContainer),n.startOffset);Dd(t,i,e,a,r),a.cleanup()},Bd=function(t,e,n,r){var o=Ne.fromDom(t.getDoc());Dd(t,o,n,function(t){return Rd(Ne.fromDom(t),C)}(e),r)},zd=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;e(Ne.fromDom(r),Ne.fromDom(i));var u=t.dom.createRng();u.setStart(r,o),u.setEnd(i,a),t.selection.setRng(n)},Pd=function(t,e,n,r){var o=t.pos;if(n)Tn(o.left,o.top,r);else{var i=o.top-e+t.height;Tn(o.left,i,r)}},Ld=function(t,e,n,r,o){var i=n+e,a=r.pos.top,u=r.bottom,c=u-a>=n;if(a<e)Pd(r,n,!1!==o,t);else if(a>i){Pd(r,n,c?!1!==o:!0===o,t)}else u>i&&!c&&Pd(r,n,!0===o,t)},Id=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Ld(t,e,o,n,r)},Hd=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Ld(t,e,o,n,r);var i=Ed(n.element),a=_n(window);i.top<a.y?On(n.element,!1!==r):i.top>a.bottom&&On(n.element,!0===r)},Fd=function(t,e,n){return Ad(t,Id,e,n)},Vd=function(t,e,n){return Bd(t,e,Id,n)},jd=function(t,e,n){return Ad(t,Hd,e,n)},Ud=function(t,e,n){return Bd(t,e,Hd,n)},Wd=function(t,e,n){(t.inline?Fd:jd)(t,e,n)},qd=function(t){var e=un(t).dom;return t.dom===e.activeElement},$d=function(t){return void 0===t&&(t=Ne.fromDom(document)),L.from(t.dom.activeElement).map(Ne.fromDom)},Gd=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Kd=Tr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Xd=(Kd.before,Kd.on,Kd.after,function(t){return t.fold(O,O,O)}),Yd=Tr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Jd={domRange:Yd.domRange,relative:Yd.relative,exact:Yd.exact,exactFromRange:function(t){return Yd.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return Ne.fromDom(t.startContainer)},relative:function(t,e){return Xd(t)},exact:function(t,e,n,r){return t}})}(t);return $e(e)},range:Gd},Qd=ge().browser,Zd=function(t,e){var n=Ve(e)?Gf(e).length:Qe(e).length+1;return t>n?n:t<0?0:t},tm=function(t){return Jd.range(t.start,Zd(t.soffset,t.start),t.finish,Zd(t.foffset,t.finish))},em=function(t,e){return!Nn(e.dom)&&(Pe(t,e)||Be(t,e))},nm=function(t){return function(e){return em(t,e.start)&&em(t,e.finish)}},rm=function(t){return!0===t.inline||Qd.isIE()},om=function(t){return Jd.range(Ne.fromDom(t.startContainer),t.startOffset,Ne.fromDom(t.endContainer),t.endOffset)},im=function(t){return function(t){var e=t.getSelection();return(e&&0!==e.rangeCount?L.from(e.getRangeAt(0)):L.none()).map(om)}($e(t).dom).filter(nm(t))},am=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),L.some(e)}catch(t){return L.none()}},um=function(t){var e=rm(t)?im(Ne.fromDom(t.getBody())):L.none();t.bookmark=e.isSome()?e:t.bookmark},cm=function(t){return(t.bookmark?t.bookmark:L.none()).bind((function(e){return function(t,e){return L.from(e).filter(nm(t)).map(tm)}(Ne.fromDom(t.getBody()),e)})).bind(am)},sm={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},lm=function(t,e){ge().browser.isIE()?function(t){t.on("focusout",(function(){um(t)}))}(t):function(t,e){t.on("mouseup touchend",(function(t){e.throttle()}))}(t,e),t.on("keyup NodeChange",(function(e){(function(t){return"nodechange"===t.type&&t.selectionChange})(e)||um(t)}))},fm=function(t){var e=_u((function(){um(t)}),0);t.on("init",(function(){t.inline&&function(t,e){var n=function(){e.throttle()};pu.DOM.bind(document,"mouseup",n),t.on("remove",(function(){pu.DOM.unbind(document,"mouseup",n)}))}(t,e),lm(t,e)})),t.on("remove",(function(){e.cancel()}))},dm=pu.DOM,mm=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t);return null!==dm.getParent(e,(function(e){return function(t){return sm.isEditorUIElement(t)}(e)||!!n&&t.dom.is(e,n)}))},gm=function(t,e){var n=e.editor;fm(n),n.on("focusin",(function(){var e=t.focusedEditor;e!==n&&(e&&e.fire("blur",{focusedEditor:n}),t.setActive(n),t.focusedEditor=n,n.fire("focus",{blurredEditor:e}),n.focus(!0))})),n.on("focusout",(function(){oo.setEditorTimeout(n,(function(){var e=t.focusedEditor;mm(n,function(t){try{var e=un(Ne.fromDom(t.getElement()));return $d(e).fold((function(){return document.body}),(function(t){return t.dom}))}catch(t){return document.body}}(n))||e!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),Sd||(Sd=function(e){var n=t.activeEditor;n&&function(t){if(an()&&y(t.target)){var e=Ne.fromDom(t.target);if(Fe(e)&&ln(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return at(n)}}return L.from(t.target)}(e).each((function(e){e.ownerDocument===document&&(e===document.body||mm(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},dm.bind(document,"focusin",Sd))},hm=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(dm.unbind(document,"focusin",Sd),Sd=null)},pm=function(t,e){return function(t){return t.collapsed?L.from(cc(t.startContainer,t.startOffset)).map(Ne.fromDom):L.none()}(e).bind((function(e){return vo(e)?L.some(e):!1===Pe(t,e)?L.some(t):L.none()}))},vm=function(t,e){pm(Ne.fromDom(t.getBody()),e).bind((function(t){return zl(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},bm=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},ym=function(t){return qd(t)||(e=t,$d(un(e)).filter((function(t){return e.dom.contains(t.dom)}))).isSome();var e},wm=function(t){return t.inline?function(t){var e=t.getBody();return e&&ym(Ne.fromDom(e))}(t):function(t){return t.iframeElement&&qd(Ne.fromDom(t.iframeElement))}(t)},xm=function(t){return wm(t)||function(t){var e=un(Ne.fromDom(t.getElement()));return $d(e).filter((function(e){return!(void 0!==(n=e.dom.classList)&&(n.contains("tox-edit-area")||n.contains("tox-edit-area__iframe")||n.contains("mce-content-body")))&&mm(t,e.dom);var n})).isSome()}(t)},Cm=function(t){return t.editorManager.setActive(t)},Sm=function(t,e){t.removed||(e?Cm(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===wm(t)&&cm(t).each((function(e){t.selection.setRng(e),r=e}));var o=function(t,e){return t.dom.getParent(e,(function(e){return"true"===t.dom.getContentEditable(e)}))}(t,e.getNode());if(t.$.contains(n,o))return bm(o),vm(t,r),void Cm(t);t.inline||(Se.opera||bm(n),t.getWin().focus()),(Se.gecko||t.inline)&&(bm(n),vm(t,r)),Cm(t)}(t))},km=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,a=n?e.startOffset:e.endOffset;return L.from(i).map(Ne.fromDom).map((function(t){return r&&e.collapsed?t:Ze(t,o(t,a)).getOr(t)})).bind((function(t){return Fe(t)?L.some(t):Ge(t).filter(Fe)})).map((function(t){return t.dom})).getOr(t)},Tm=function(t,e,n){return km(t,e,!0,n,(function(t,e){return Math.min(nn(t),e)}))},Om=function(t,e,n){return km(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},Em=function(t,e){for(var n=t;t&&Hn(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},_m=function(t,e){return W(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},Rm={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Nm=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var a=t.parent;a&&a!==e;a=a.parent)if(i=a[o])return i}},Am=function(t){if(!Xo(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},Dm=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},Mm=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,Rm[e]||1);return n&&dt(n,(function(t,e){r.attr(e,t)})),r},t.prototype.replace=function(t){var e=this;return t.parent&&t.remove(),e.insert(t,e),e.remove(),e},t.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&dt(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=this,r=new t(n.name,n.type);if(e=n.attributes){var o=[];o.map={};for(var i=0,a=e.length;i<a;i++){var u=e[i];"id"!==u.name&&(o[o.length]={name:u.name,value:u.value},o.map[u.name]=u.value)}r.attributes=o}return r.value=n.value,r.shortEnded=n.shortEnded,r},t.prototype.wrap=function(t){var e=this;return e.parent.insert(t,e),t.append(e),e},t.prototype.unwrap=function(){for(var t=this,e=t.firstChild;e;){var n=e.next;t.insert(e,t,!0),e=n}t.remove()},t.prototype.remove=function(){var t=this,e=t.parent,n=t.next,r=t.prev;return e&&(e.firstChild===t?(e.firstChild=n,n&&(n.prev=null)):r.next=n,e.lastChild===t?(e.lastChild=r,r&&(r.next=null)):n.prev=r,t.parent=t.next=t.prev=null),t},t.prototype.append=function(t){var e=this;t.parent&&t.remove();var n=e.lastChild;return n?(n.next=t,t.prev=n,e.lastChild=t):e.lastChild=e.firstChild=t,t.parent=e,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=Nm(n,this))n.name===t&&e.push(n);return e},t.prototype.children=function(){for(var t=[],e=this.firstChild;e;e=e.next)t.push(e);return t},t.prototype.empty=function(){var t=this;if(t.firstChild){for(var e=[],n=t.firstChild;n;n=Nm(n,t))e.push(n);for(var r=e.length;r--;){(n=e[r]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}}return t.firstChild=t.lastChild=null,t},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this,o=r.firstChild;if(Dm(r))return!1;if(o)do{if(1===o.type){if(o.attr("data-mce-bogus"))continue;if(t[o.name])return!1;if(Dm(o))return!1}if(8===o.type)return!1;if(3===o.type&&!Am(o))return!1;if(3===o.type&&o.parent&&e[o.parent.name]&&Xo(o.value))return!1;if(n&&n(o))return!1}while(o=Nm(o,r));return!0},t.prototype.walk=function(t){return Nm(this,null,t)},t}(),Bm=function(t,e){return t.replace(e.re,(function(t){return yt(e.uris,t).getOr(t)}))},zm=_e.each,Pm=_e.trim,Lm="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Im={ftp:21,http:80,https:443,mailto:25},Hm=["img","video"],Fm=function(t,e,n){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?function(t,e){return y(t)?!t:!y(e)||!j(Hm,e)}(t.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))},Vm=function(){function t(e,n){e=Pm(e),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))o.source=e;else{var i=0===e.indexOf("//");if(0!==e.indexOf("/")||i||(e=(r&&r.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var a=this.settings.base_uri?this.settings.base_uri.path:new t(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+o.toAbsPath(a,e);else{var u=/([^#?]*)([#?]?.*)/.exec(e);e=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(a,u[1])+u[2]}}e=e.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);zm(Lm,(function(t,e){var n=c[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[t]=n})),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="")}}return t.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.isDomSafe=function(t,e,n){if(void 0===n&&(n={}),n.allow_script_urls)return!0;var r=yi.decode(t).replace(/[\s\u0000-\u001F]+/g,"");try{r=decodeURIComponent(r)}catch(t){r=unescape(r)}return!/((java|vb)script|mhtml):/i.test(r)&&!Fm(n,r,e)},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=Im[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",a=t.substring(0,t.lastIndexOf("/")).split("/"),u=e.split("/");if(a.length>=u.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||a[n]!==u[n]){o=n+1;break}if(a.length<u.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return e;for(n=0,r=a.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=u.length;n<r;n++)i+=n!==o-1?"/"+u[n]:u[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],a=/\/$/.test(e)?"/":"",u=t.split("/"),c=e.split("/");for(zm(u,(function(t){t&&i.push(t)})),u=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=u.length-o)<=0?nt(i).join("/"):u.slice(0,n).join("/")+"/"+nt(i).join("/")).indexOf("/")&&(r="/"+r),a&&r.lastIndexOf("/")!==r.length-1&&(r+=a),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),jm=_e.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),Um=function(t,e,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=t.getShortEndedElements(),a=1,u=n;0!==a;)for(r.lastIndex=u;;){var c=r.exec(e);if(null===c)return u;if("!"===c[1]){u=It(c[2],"--")?Wm(e,!1,c.index+"!--".length):Wm(e,!0,c.index+1);break}o.lastIndex=r.lastIndex;var s=o.exec(e);if(!h(s)&&s.index===r.lastIndex){"/"===c[1]?a-=1:wt(i,c[2])||(a+=1),u=r.lastIndex+s[0].length;break}}return u},Wm=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(t.substr(e))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/g;a.lastIndex=n;var u=a.exec(t);return u?u.index+u[0].length:r.length},qm=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null},$m=function(t,e){var n;void 0===e&&(e=Ri());var r=null!==(n=(t=t||{}).document)&&void 0!==n?n:document,o=r.createElement("form");!1!==t.fix_self_closing&&(t.fix_self_closing=!0);var i=t.comment?t.comment:C,a=t.cdata?t.cdata:C,u=t.text?t.text:C,c=t.start?t.start:C,s=t.end?t.end:C,l=t.pi?t.pi:C,f=t.doctype?t.doctype:C,d=function(n,d){void 0===d&&(d="html");for(var m,g,h,p,v,b,y,w,x,C,S,k,T,O,E,_,R,N,A,D=n.html,M=0,B=[],z=0,P=yi.decode,L=_e.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),I="html"===d?0:1,H=function(t){var e,n;for(e=B.length;e--&&B[e].name!==t;);if(e>=0){for(n=B.length-1;n>=e;n--)(t=B[n]).valid&&s(t.name);B.length=e}},F=function(t,e){return u(Bm(t,n),e)},V=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),i(Bm(e,n)))},j=function(t,e){var n=t||"",r=!It(n,"--"),o=Wm(D,r,e);return t=D.substr(e,o-e),V(r?n+t:t),o+1},U=function(e,i,a,u,c){if(a=function(t){return Bm(t,n)}((i=i.toLowerCase())in K?i:P(a||u||c||"")),X&&!w&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(i)){var s=O[i];if(!s&&E){for(var l=E.length;l--&&!(s=E[l]).pattern.test(i););-1===l&&(s=null)}if(!s)return;if(s.validValues&&!(a in s.validValues))return}("name"===i||"id"===i)&&e in jm&&(a in r||a in o)||L[i]&&!Vm.isDomSafe(a,e,t)||w&&(i in L||0===i.indexOf("on"))||(p.map[i]=a,p.push({name:i,value:a}))},W=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),q=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,$=e.getShortEndedElements(),G=t.self_closing_elements||e.getSelfClosingElements(),K=e.getBoolAttrs(),X=t.validate,Y=t.remove_internals,J=t.fix_self_closing,Q=e.getSpecialElements(),Z=D+">";m=W.exec(Z);){var tt=m[0];if(M<m.index&&F(P(D.substr(M,m.index-M))),g=m[7])":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),H(g);else if(g=m[8]){if(m.index+tt.length>D.length){F(P(D.substr(m.index))),M=m.index+tt.length;continue}":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),x=g in $,J&&G[g]&&B.length>0&&B[B.length-1].name===g&&H(g);var et=qm(q,m[9]);if(null!==et){if("all"===et){M=Um(e,D,W.lastIndex),W.lastIndex=M;continue}S=!1}if(!X||(C=e.getElementRule(g))){if(S=!0,X&&(O=C.attributes,E=C.attributePatterns),(T=m[9])?((w=-1!==T.indexOf("data-mce-type"))&&Y&&(S=!1),(p=[]).map={},T.replace(q,(function(t,e,n,r,o){return U(g,e,n,r,o),""}))):(p=[]).map={},X&&!w){if(_=C.attributesRequired,R=C.attributesDefault,N=C.attributesForced,C.removeEmptyAttrs&&!p.length&&(S=!1),N)for(v=N.length;v--;)y=(k=N[v]).name,"{$uid}"===(A=k.value)&&(A="mce_"+z++),p.map[y]=A,p.push({name:y,value:A});if(R)for(v=R.length;v--;)(y=(k=R[v]).name)in p.map||("{$uid}"===(A=k.value)&&(A="mce_"+z++),p.map[y]=A,p.push({name:y,value:A}));if(_){for(v=_.length;v--&&!(_[v]in p.map););-1===v&&(S=!1)}if(k=p.map["data-mce-bogus"]){if("all"===k){M=Um(e,D,W.lastIndex),W.lastIndex=M;continue}S=!1}}S&&c(g,p,x)}else S=!1;if(h=Q[g]){h.lastIndex=M=m.index+tt.length,(m=h.exec(D))?(S&&(b=D.substr(M,m.index-M)),M=m.index+m[0].length):(b=D.substr(M),M=D.length),S&&(b.length>0&&F(b,!0),s(g)),W.lastIndex=M;continue}x||(T&&T.indexOf("/")===T.length-1?S&&s(g):B.push({name:g,valid:S}))}else if(g=m[1])V(g);else if(g=m[2]){if(!(1===I||t.preserve_cdata||B.length>0&&e.isValidChild(B[B.length-1].name,"#cdata"))){M=j("",m.index+2),W.lastIndex=M;continue}a(g)}else if(g=m[3])f(g);else{if((g=m[4])||"<!"===tt){M=j(g,m.index+tt.length),W.lastIndex=M;continue}if(g=m[5]){if(1!==I){M=j("?",m.index+2),W.lastIndex=M;continue}l(g,m[6])}}M=m.index+tt.length}for(M<D.length&&F(P(D.substr(M))),v=B.length-1;v>=0;v--)(g=B[v]).valid&&s(g.name)};return{parse:function(t,e){void 0===e&&(e="html"),d(function(t){for(var e,n=/data:[^;]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=Gu("img"),a=0,u=0;e=n.exec(t);){var c=e[0],s=i+"_"+u++;o[s]=c,a<e.index&&r.push(t.substr(a,e.index-a)),r.push(s),a=e.index+c.length}var l=new RegExp(i+"_[0-9]+","g");return 0===a?{prefix:i,uris:o,html:t,re:l}:(a<t.length&&r.push(t.substr(a)),{prefix:i,uris:o,html:r.join(""),re:l})}(t),e)}}};$m.findEndTag=Um;var Gm=function(t,e){for(var n,r=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,o=t.schema,i=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")}(t.getTempAttrs(),e),a=o.getShortEndedElements();n=r.exec(i);){var u=r.lastIndex,c=n[0].length,s=void 0;s=a[n[1]]?u:$m.findEndTag(o,i,u),i=i.substring(0,u-c)+i.substring(s),r.lastIndex=u-c}return So(i)},Km=Gm,Xm=function(t,e,n,r){var o,i=function(t,e){return Nt(Nt({},t),{format:e,get:!0,getInner:!0})}(e,n),a=e.no_events?i:t.fire("BeforeGetContent",i);return o="raw"===a.format?_e.trim(Km(t.serializer,r.innerHTML)):"text"===a.format?t.dom.isEmpty(r)?"":So(r.innerText||r.textContent):"tree"===a.format?t.serializer.serialize(r,a):function(t,e){var n=ns(t),r=new RegExp("^(<"+n+"[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,a)),j(["text","tree"],a.format)||yo(Ne.fromDom(r))?a.content=o:a.content=_e.trim(o),a.no_events?a.content:t.fire("GetContent",a).content},Ym=_e.each,Jm=function(t){return{compare:function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return Ym(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(wt(t,r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(wt(e,r))return!1;return!0};return!!o(r(e),r(n))&&(!!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))&&(!Yl(e)&&!Yl(n)))}}},Qm=_e.makeMap,Zm=function(t){var e=[],n=(t=t||{}).indent,r=Qm(t.indent_before||""),o=Qm(t.indent_after||""),i=yi.getEncodeFunc(t.entity_encoding||"raw",t.entities),a="html"===t.element_format;return{start:function(t,u,c){var s,l,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),u)for(s=0,l=u.length;s<l;s++)f=u[s],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!c||a?">":" />",c&&n&&o[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1]).length>0&&"\n"!==r&&e.push("\n")},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},tg=function(t,e){void 0===e&&(e=Ri());var n=Zm(t);(t=t||{}).validate=!("validate"in t)||t.validate;return{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{a(t)}while(t=t.next)}};n.reset();var a=function(t){var r=i[t.type];if(r)r(t);else{var u=t.name,c=t.shortEnded,s=t.attributes;if(o&&s&&s.length>1){var l=[];l.map={};var f=e.getElementRule(t.name);if(f){for(var d=0,m=f.attributesOrder.length;d<m;d++){if((h=f.attributesOrder[d])in s.map){var g=s.map[h];l.map[h]=g,l.push({name:h,value:g})}}for(d=0,m=s.length;d<m;d++){var h;if(!((h=s[d].name)in l.map)){g=s.map[h];l.map[h]=g,l.push({name:h,value:g})}}s=l}}if(n.start(t.name,s,c),!c){if(t=t.firstChild)do{a(t)}while(t=t.next);n.end(u)}}};return 1!==r.type||t.inner?i[11](r):a(r),n.getContent()}}},eg=new Set;q(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],(function(t){eg.add(t)}));var ng=["font","text-decoration","text-emphasis"],rg=function(t,e){return lt(t.parseStyle(t.getAttrib(e,"style")))},og=function(t,e){return et(rg(t,e),(function(t){return!function(t){return eg.has(t)}(t)}))},ig=function(t,e,n){var r=rg(t,e),o=rg(t,n),i=function(r){var o=t.getStyle(e,r),i=t.getStyle(n,r);return Ut(o)&&Ut(i)&&o!==i};return U(r,(function(t){var e=function(e){return U(e,(function(e){return e===t}))};if(!e(o)&&e(ng)){var n=K(o,(function(t){return U(ng,(function(e){return It(t,e)}))}));return U(n,i)}return i(t)}))},ag=function(t,e,n){return L.from(n.container()).filter(Hn).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},ug=_(ag,!0,Ql),cg=_(ag,!1,Ql),sg=function(t){var e=t.container();return Hn(e)&&(0===e.data.length||Co(e.data)&&Zf.isBookmarkNode(e.parentNode))},lg=function(t,e){return function(n){return L.from(el(t?0:-1,n)).filter(e).isSome()}},fg=function(t){return Wn(t)&&"block"===ir(Ne.fromDom(t),"display")},dg=function(t){return $n(t)&&!function(t){return An(t)&&"all"===t.getAttribute("data-mce-bogus")}(t)},mg=lg(!0,fg),gg=lg(!1,fg),hg=lg(!0,Kn),pg=lg(!1,Kn),vg=lg(!0,Pn),bg=lg(!1,Pn),yg=lg(!0,dg),wg=lg(!1,dg),xg=function(t){var e=Iu(t,"br"),n=K(function(t){for(var e=[],n=t.dom;n;)e.push(Ne.fromDom(n)),n=n.lastChild;return e}(t).slice(-1),mo);e.length===n.length&&q(n,vn)},Cg=function(t){pn(t),gn(t,Ne.fromHtml('<br data-mce-bogus="1">'))},Sg=function(t){en(t).each((function(e){Ke(e).each((function(n){lo(t)&&mo(e)&&lo(n)&&vn(e)}))}))},kg=function(t,e,n){return Pe(e,t)?function(t,e){for(var n=w(e)?e:D,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=Ne.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(t,(function(t){return n(t)||Be(t,e)})).slice(0,-1):[]},Tg=function(t,e){return kg(t,e,D)},Og=function(t,e){return[t].concat(Tg(t,e))},Eg=function(t,e,n){return Al(t,e,n,sg)},_g=function(t,e){return Q(Og(Ne.fromDom(e.container()),t),lo)},Rg=function(t,e,n){return Eg(t,e.dom,n).forall((function(t){return _g(e,n).fold((function(){return!1===tl(t,n,e.dom)}),(function(r){return!1===tl(t,n,e.dom)&&Pe(r,Ne.fromDom(t.container()))}))}))},Ng=function(t,e,n){return _g(e,n).fold((function(){return Eg(t,e.dom,n).forall((function(t){return!1===tl(t,n,e.dom)}))}),(function(e){return Eg(t,e.dom,n).isNone()}))},Ag=_(Ng,!1),Dg=_(Ng,!0),Mg=_(Rg,!1),Bg=_(Rg,!0),zg=function(t){return ll(t).exists(mo)},Pg=function(t,e,n){var r=K(Og(Ne.fromDom(n.container()),e),lo),o=at(r).getOr(e);return Rl(t,o.dom,n).filter(zg)},Lg=function(t,e){return ll(e).exists(mo)||Pg(!0,t,e).isSome()},Ig=function(t,e){return function(t){return L.from(t.getNode(!0)).map(Ne.fromDom)}(e).exists(mo)||Pg(!1,t,e).isSome()},Hg=_(Pg,!1),Fg=_(Pg,!0),Vg=function(t){return Rc.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},jg=function(t,e){var n=K(Og(Ne.fromDom(e.container()),t),lo);return at(n).getOr(t)},Ug=function(t,e){return Vg(e)?cg(e):cg(e)||Bl(jg(t,e).dom,e).exists(cg)},Wg=function(t,e){return Vg(e)?ug(e):ug(e)||Ml(jg(t,e).dom,e).exists(ug)},qg=function(t){return ll(t).bind((function(t){return Xr(t,Fe)})).exists((function(t){return function(t){return j(["pre","pre-wrap"],t)}(ir(t,"white-space"))}))},$g=function(t,e){return function(t,e){return Bl(t.dom,e).isNone()}(t,e)||function(t,e){return Ml(t.dom,e).isNone()}(t,e)||Ag(t,e)||Dg(t,e)||Ig(t,e)||Lg(t,e)},Gg=function(t,e){return!qg(e)&&(Ag(t,e)||Mg(t,e)||Ig(t,e)||Ug(t,e))},Kg=function(t,e){return!qg(e)&&(Dg(t,e)||Bg(t,e)||Lg(t,e)||Wg(t,e))},Xg=function(t,e){return Gg(t,e)||Kg(t,function(t){var e=t.container(),n=t.offset();return Hn(e)&&n<e.data.length?Rc(e,n+1):t}(e))},Yg=function(t,e){return Jl(t.charAt(e))},Jg=function(t){var e=t.container();return Hn(e)&&Lt(e.data,wo)},Qg=function(t){var e=t.data,n=function(t){var e=t.split("");return W(e,(function(t,n){return Jl(t)&&n>0&&n<e.length-1&&Zl(e[n-1])&&Zl(e[n+1])?" ":t})).join("")}(e);return n!==e&&(t.data=n,!0)},Zg=function(t,e){return L.some(e).filter(Jg).bind((function(e){var n=e.container();return function(t,e){var n=e.data,r=Rc(e,0);return!(!Yg(n,0)||Xg(t,r)||(e.data=" "+n.slice(1),0))}(t,n)||Qg(n)||function(t,e){var n=e.data,r=Rc(e,n.length-1);return!(!Yg(n,n.length-1)||Xg(t,r)||(e.data=n.slice(0,-1)+" ",0))}(t,n)?L.some(e):L.none()}))},th=function(t){var e=Ne.fromDom(t.getBody());t.selection.isCollapsed()&&Zg(e,Rc.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},eh=function(t,e,n){if(0!==n){var r=Ne.fromDom(t),o=Kr(r,lo).getOr(r),i=t.data.slice(e,e+n),a=e+n>=t.data.length&&Kg(o,Rc(t,t.data.length)),u=0===e&&Gg(o,Rc(t,0));t.replaceData(e,n,function(t,e,n){return Y(t,(function(r,o){return Ql(o)||Jl(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+wo}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(i,u,a))}},nh=function(t,e){var n=t.data.slice(e),r=n.length-Vt(n).length;eh(t,e,r)},rh=function(t,e){var n=t.data.slice(0,e),r=n.length-jt(n).length;eh(t,e-r,r)},oh=function(t,e,n,r){void 0===r&&(r=!0);var o=jt(t.data).length,i=r?t:e,a=r?e:t;return r?i.appendData(a.data):i.insertData(0,a.data),vn(Ne.fromDom(a)),n&&nh(i,o),i},ih=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===Rc.isTextPosition(t)&&n===e.parentNode&&r>Rc.before(e).offset()}(e,t)?Rc(e.container(),e.offset()-1):e},ah=function(t){return qo(t.previousSibling)?L.some((e=t.previousSibling,Hn(e)?Rc(e,e.data.length):Rc.after(e))):t.previousSibling?Pl(t.previousSibling):L.none();var e},uh=function(t){return qo(t.nextSibling)?L.some((e=t.nextSibling,Hn(e)?Rc(e,0):Rc.before(e))):t.nextSibling?zl(t.nextSibling):L.none();var e},ch=function(t,e){return ah(e).orThunk((function(){return uh(e)})).orThunk((function(){return function(t,e){var n=Rc.before(e.previousSibling?e.previousSibling:e.parentNode);return Bl(t,n).fold((function(){return Ml(t,Rc.after(e))}),L.some)}(t,e)}))},sh=function(t,e){return uh(e).orThunk((function(){return ah(e)})).orThunk((function(){return function(t,e){return Ml(t,Rc.after(e)).fold((function(){return Bl(t,Rc.before(e))}),L.some)}(t,e)}))},lh=function(t,e,n){return function(t,e,n){return t?sh(e,n):ch(e,n)}(t,e,n).map(_(ih,n))},fh=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},dh=function(t,e){return e&&wt(t.schema.getBlockElements(),Le(e))},mh=function(t){if(ei(t)){var e=Ne.fromHtml('<br data-mce-bogus="1">');return pn(t),gn(t,e),L.some(Rc.before(e.dom))}return L.none()},gh=function(t,e,n){var r,o,i,a,u=Ke(t).filter(Ve),c=Xe(t).filter(Ve);return vn(t),(r=u,o=c,i=e,a=function(t,e,r){var o=t.dom,i=e.dom,a=o.data.length;return oh(o,i,n),r.container()===i?Rc(o,a):r},r.isSome()&&o.isSome()&&i.isSome()?L.some(a(r.getOrDie(),o.getOrDie(),i.getOrDie())):L.none()).orThunk((function(){return n&&(u.each((function(t){return rh(t.dom,t.dom.length)})),c.each((function(t){return nh(t.dom,0)}))),e}))},hh=function(t,e,n,r){void 0===r&&(r=!0);var o,i=lh(e,t.getBody(),n.dom),a=Kr(n,_(dh,t),(o=t.getBody(),function(t){return t.dom===o})),u=gh(n,i,function(t,e){return wt(t.schema.getTextInlineElements(),Le(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):a.bind(mh).fold((function(){r&&fh(t,e,u)}),(function(n){r&&fh(t,e,L.some(n))}))},ph=function(t){return Iu(t,"td,th")},vh=function(t,e){return{start:t,end:e}},bh=Tr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),yh=function(t,e){return Zr(Ne.fromDom(t),"td,th",e)},wh=function(t){return!Be(t.start,t.end)},xh=function(t,e){return If(t.start,e).bind((function(n){return If(t.end,e).bind((function(t){return e=Be(n,t),r=n,e?L.some(r):L.none();var e,r}))}))},Ch=function(t){return function(e){return xh(e,t).map((function(t){return function(t,e,n){return{rng:t,table:e,cells:n}}(e,t,ph(t))}))}},Sh=function(t,e,n,r){if(n.collapsed||!t.forall(wh))return L.none();if(e.isSameTable){var o=t.bind(Ch(r));return L.some({start:o,end:o})}var i=yh(n.startContainer,r),a=yh(n.endContainer,r),u=i.bind(function(t){return function(e){return If(e,t).bind((function(t){return ut(ph(t)).map((function(t){return vh(e,t)}))}))}}(r)).bind(Ch(r)),c=a.bind(function(t){return function(e){return If(e,t).bind((function(t){return at(ph(t)).map((function(t){return vh(t,e)}))}))}}(r)).bind(Ch(r));return L.some({start:u,end:c})},kh=function(t,e){return Z(t,(function(t){return Be(t,e)}))},Th=function(t){return Yn(kh(t.cells,t.rng.start),kh(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))},Oh=function(t,e,n){return t.exists((function(t){return function(t,e){return!wh(t)&&xh(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&Vf(t.start,e)}))},Eh=function(t,e){var n=e.startTable,r=e.endTable,o=t.cloneRange();return n.each((function(t){return o.setStartAfter(t.dom)})),r.each((function(t){return o.setEndBefore(t.dom)})),o},_h=function(t,e){var n=function(t){return function(e){return Be(t,e)}}(t),r=function(t,e){var n=yh(t.startContainer,e),r=yh(t.endContainer,e);return Yn(n,r,vh)}(e,n),o=function(t,e){var n=function(t){return If(Ne.fromDom(t),e)},r=n(t.startContainer),o=n(t.endContainer),i=r.isSome(),a=o.isSome(),u=Yn(r,o,Be).getOr(!1);return{startTable:r,endTable:o,isStartInTable:i,isEndInTable:a,isSameTable:u,isMultiTable:!u&&i&&a}}(e,n);return Oh(r,e,n)?r.map((function(t){return bh.singleCellTable(e,t.start)})):o.isMultiTable?function(t,e,n,r){return Sh(t,e,n,r).bind((function(t){var r=t.start,o=t.end,i=r.bind(Th).getOr([]),a=o.bind(Th).getOr([]);if(i.length>0&&a.length>0){var u=Eh(n,e);return L.some(bh.multiTable(i,a,u))}return L.none()}))}(r,o,e,n):function(t,e,n,r){return Sh(t,e,n,r).bind((function(t){var e=t.start,n=t.end;return e.or(n)})).bind((function(t){var r=e.isSameTable,o=Th(t).getOr([]);if(r&&t.cells.length===o.length)return L.some(bh.fullTable(t.table));if(o.length>0){if(r)return L.some(bh.partialTable(o,L.none()));var i=Eh(n,e);return L.some(bh.partialTable(o,L.some(Nt(Nt({},e),{rng:i}))))}return L.none()}))}(r,o,e,n)},Rh=function(t){var e;return(8===Ie(e=t)||"#comment"===Le(e)?Ke(t):en(t)).bind(Rh).orThunk((function(){return L.some(t)}))},Nh=function(t){return q(t,(function(t){rr(t,"contenteditable"),Cg(t)}))},Ah=function(t,e,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(e.dom.lastChild)):(o.setStartBefore(e.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),zh(t,o,e,!1)},Dh=function(t){var e=Lf(t),n=Ne.fromDom(t.selection.getNode());Gn(n.dom)&&ei(n)?t.selection.setCursorLocation(n.dom,0):t.selection.collapse(!0),e.length>1&&U(e,(function(t){return Be(t,n)}))&&Zn(n,"data-mce-selected","1")},Mh=function(t,e,n){var r=t.selection.getRng(),o=n.bind((function(n){var o=n.rng,i=n.isStartInTable,a=function(t,e){return L.from(t.dom.getParent(e,t.dom.isBlock)).map(Ne.fromDom)}(t,i?o.endContainer:o.startContainer);o.deleteContents(),function(t,e,n){n.each((function(n){e?vn(n):(Cg(n),t.selection.setCursorLocation(n.dom,0))}))}(t,i,a.filter(ei));var u=i?e[0]:e[e.length-1];return Ah(t,u,r,i),ei(u)?L.none():L.some(i?e.slice(1):e.slice(0,-1))})).getOr(e);return Nh(o),Dh(t),!0},Bh=function(t,e,n,r){var o=t.selection.getRng(),i=e[0],a=n[n.length-1];Ah(t,i,o,!0),Ah(t,a,o,!1);var u=ei(i)?e:e.slice(1),c=ei(a)?n:n.slice(0,-1);return Nh(u.concat(c)),r.deleteContents(),Dh(t),!0},zh=function(t,e,n,r){void 0===r&&(r=!0),e.deleteContents();var o,i=Rh(n).getOr(n),a=Ne.fromDom(t.dom.getParent(i.dom,t.dom.isBlock));if(ei(a)&&(Cg(a),r&&t.selection.setCursorLocation(a.dom,0)),!Be(n,a)){var u=Xn(Ge(a),n)?[]:Ge(o=a).map(Qe).map((function(t){return K(t,(function(t){return!Be(o,t)}))})).getOr([]);q(u.concat(Qe(n)),(function(t){Be(t,a)||Pe(t,a)||!ei(t)||vn(t)}))}return!0},Ph=function(t,e){return hh(t,!1,e),!0},Lh=function(t,e,n,r){return Hh(e,r).fold((function(){return function(t,e,n){return _h(e,n).map((function(e){return e.fold(_(zh,t),_(Ph,t),_(Mh,t),_(Bh,t))}))}(t,e,n)}),(function(e){return function(t,e){return Fh(t,e)}(t,e)})).getOr(!1)},Ih=function(t,e){return Q(Og(e,t),bo)},Hh=function(t,e){return Q(Og(e,t),(n="caption",function(t){return Fe(t)&&Le(t)===n}));var n},Fh=function(t,e){return Cg(e),t.selection.setCursorLocation(e.dom,0),L.some(!0)},Vh=function(t,e,n,r,o){return Nl(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return zl(t.dom).bind((function(o){return Pl(t.dom).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(t,e){return Fh(t,e)}(t,r):function(t,e,n){return Hh(t,Ne.fromDom(n.getNode())).map((function(t){return!1===Be(t,e)}))}(e,r,i)})).or(L.some(!0))},jh=function(t,e,n,r){var o=Rc.fromRangeStart(t.selection.getRng());return Ih(n,r).bind((function(r){return ei(r)?Fh(t,r):function(t,e,n,r,o){return Nl(n,t.getBody(),o).bind((function(t){return Ih(e,Ne.fromDom(t.getNode())).map((function(t){return!1===Be(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)},Uh=function(t,e){return t?vg(e):bg(e)},Wh=function(t,e,n){var r=Ne.fromDom(t.getBody());return Hh(r,n).fold((function(){return jh(t,e,r,n)||function(t,e){var n=Rc.fromRangeStart(t.selection.getRng());return Uh(e,n)||Rl(e,t.getBody(),n).exists((function(t){return Uh(e,t)}))}(t,e)}),(function(n){return function(t,e,n,r){var o=Rc.fromRangeStart(t.selection.getRng());return ei(r)?Fh(t,r):Vh(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},qh=function(t,e){var n=Ne.fromDom(t.selection.getStart(!0)),r=Lf(t);return t.selection.isCollapsed()&&0===r.length?Wh(t,e,n):function(t,e,n){var r=Ne.fromDom(t.getBody()),o=t.selection.getRng();return 0!==n.length?Mh(t,n,L.none()):Lh(t,r,o,e)}(t,n,r)},$h=function(t){var e=Rc.fromRangeStart(t),n=Rc.fromRangeEnd(t),r=t.commonAncestorContainer;return Rl(!1,r,n).map((function(o){return!tl(e,n,r)&&tl(e,o,r)?function(t,e,n,r){var o=document.createRange();return o.setStart(t,e),o.setEnd(n,r),o}(e.container(),e.offset(),o.container(),o.offset()):t})).getOr(t)},Gh=function(t){return t.collapsed?t:$h(t)},Kh=function(t,e){return t.getBlockElements()[e.name]&&function(t){return t.firstChild&&t.firstChild===t.lastChild}(e)&&function(t){return"br"===t.name||t.value===wo}(e.firstChild)},Xh=function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||Kh(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r)&&("ul"===n.name||"ol"===n.name)},Yh=function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&function(t){return t.data===wo||Un(t)}(t.firstChild)},Jh=function(t){return t.length>0&&(!(e=t[t.length-1]).firstChild||Yh(e))?t.slice(0,-1):t;var e},Qh=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},Zh=function(t,e){var n=Rc.after(t),r=kl(e).prev(n);return r?r.toRange():null},tp=function(t,e,n){var r=t.parentNode;return _e.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=Rc.before(t),r=kl(e).next(n);return r?r.toRange():null}(t,n)},ep=function(t,e,n,r){var o,i=function(t,e,n){var r=e.serialize(n);return function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t}(t.createFragment(r))}(e,t,r),a=Qh(e,n.startContainer),u=Jh((o=i.firstChild,K(o.childNodes,(function(t){return"LI"===t.nodeName})))),c=e.getRoot(),s=function(t){var r=Rc.fromRangeStart(n),o=kl(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Qh(e,i.getNode())!==a};return s(1)?tp(a,u,c):s(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),Zh(e[0],n)}(a,u,c,e):function(t,e,n,r){var o=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]}(t,r),i=t.parentNode;return i.insertBefore(o[0],t),_e.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),Zh(e[e.length-1],n)}(a,u,c,n)},np=Gn,rp=function(t){var e=t.dom,n=Gh(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,np);!function(t,e,n){return null!==n&&n===t.getParent(e.endContainer,np)&&Vf(Ne.fromDom(n),e)}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):zh(t,n,Ne.fromDom(r))},op=function(t,e,n){var r,o,i,a=t.selection,u=t.dom;/^ | $/.test(e)&&(e=function(t,e,n){var r=Ne.fromDom(t.getRoot());return n=Gg(r,Rc.fromRangeStart(e))?n.replace(/^ /,"&nbsp;"):n.replace(/^&nbsp;/," "),Kg(r,Rc.fromRangeEnd(e))?n.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):n.replace(/&nbsp;(<br( \/)?>)?$/," ")}(u,a.getRng(),e));var c=t.parser,s=n.merge,l=tg({validate:ys(t)},t.schema),f='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>',d=t.fire("BeforeSetContent",{content:e,format:"html",selection:!0,paste:n.paste});if(d.isDefaultPrevented())t.fire("SetContent",{content:d.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=d.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,f);var m=(o=a.getRng()).startContainer||(o.parentElement?o.parentElement():null),g=t.getBody();m===g&&a.isCollapsed()&&u.isBlock(g.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,g.firstChild)&&u.isEmpty(g.firstChild)&&((o=u.createRng()).setStart(g.firstChild,0),o.setEnd(g.firstChild,0),a.setRng(o)),a.isCollapsed()||rp(t);var h,p={context:(r=a.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},v=c.parse(e,p);if(!0===n.paste&&Xh(t.schema,v)&&function(t,e){return!!Qh(t,e)}(u,r))return o=ep(l,u,a.getRng(),v),a.setRng(o),void t.fire("SetContent",d);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(v),"mce_marker"===(i=v.lastChild).attr("id")){var b=i;for(i=i.prev;i;i=i.walk(!0))if(3===i.type||!u.isBlock(i.name)){t.schema.isValidChild(i.parent.name,"span")&&i.parent.insert(b,i,"br"===i.name);break}}if(t._selectionOverrides.showBlockCaretContainer(r),p.invalid){t.selection.setContent(f),r=a.getNode();var w=t.getBody();for(9===r.nodeType?r=i=w:i=r;i!==w;)r=i,i=i.parentNode;e=r===w?w.innerHTML:u.getOuterHTML(r),e=l.serialize(c.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return l.serialize(v)})))),r===w?u.setHTML(w,e):u.setOuterHTML(r,e)}else!function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):t.selection.setContent(e)}}(t,e=l.serialize(v),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=Jm(r);_e.each(r.select("*[data-mce-fragment]"),(function(t){if(y(n[t.nodeName.toLowerCase()])&&og(r,t))for(var e=t.parentNode;y(e)&&e!==o&&!ig(r,t,e);e=e.parentNode)if(i.compare(e,t)){r.remove(t,!0);break}}))}}(t,s),function(t,e){var n,r=t.dom,o=t.selection;if(e){o.scrollIntoView(e);var i=td(t.getBody(),e);if("false"===r.getContentEditable(i))return r.remove(e),void o.select(i);var a=r.createRng(),u=e.previousSibling;if(Hn(u)){if(a.setStart(u,u.nodeValue.length),!Se.ie){var c=e.nextSibling;Hn(c)&&(u.appendData(c.data),c.parentNode.removeChild(c))}}else a.setStartBefore(e),a.setEndBefore(e);var s=r.getParent(e,r.isBlock);r.remove(e),s&&r.isEmpty(s)&&(t.$(s).empty(),a.setStart(s,0),a.setEnd(s,0),np(s)||function(t){return!!t.getAttribute("data-mce-fragment")}(s)||!(n=function(e){var n=Rc.fromRangeStart(e);if(n=kl(t.getBody()).next(n))return n.toRange()}(a))?r.add(s,r.create("br",{"data-mce-bogus":"1"})):(a=n,r.remove(s))),o.setRng(a)}}(t,u.get("mce_marker")),h=t.getBody(),_e.each(h.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){L.from(t.getParent(e,"td,th")).map(Ne.fromDom).each(Sg)}(u,a.getStart()),t.fire("SetContent",d),t.addVisual()}},ip=function(t,e){e(t),t.firstChild&&ip(t.firstChild,e),t.next&&ip(t.next,e)},ap=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var a in n.firstChild&&ip(n.firstChild,(function(n){q(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),q(e,(function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)wt(r,a)&&i.push(r[a]);for(var u in o)wt(o,u)&&i.push(o[u]);return i}(t,e,n);q(r,(function(t){q(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},up=function(t){return t instanceof Mm},cp=function(t,e,n){t.dom.setHTML(t.getBody(),e),!0!==n&&function(t){wm(t)&&zl(t.getBody()).each((function(e){var n=e.getNode(),r=Pn(n)?zl(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},sp=function(t,e,n){var r=function(t,e){return Nt(Nt({format:"html"},t),{set:!0,content:up(e)?"":e})}(n,e),o=n.no_events?r:t.fire("BeforeSetContent",r);return up(e)||(e=o.content),L.from(t.getBody()).fold(T(e),(function(n){return up(e)?function(t,e,n,r){ap(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=tg({validate:t.validate},t.schema).serialize(n);return r.content=yo(Ne.fromDom(e))?o:_e.trim(o),cp(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r),n}(t,n,e,o):function(t,e,n,r){if(0===n.length||/^\s+$/.test(n)){var o='<br data-mce-bogus="1">';"TABLE"===e.nodeName?n="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+o+"</li>");var i=ns(t);i&&t.schema.isValidChild(e.nodeName.toLowerCase(),i.toLowerCase())?(n=o,n=t.dom.createHTML(i,rs(t),n)):n||(n='<br data-mce-bogus="1">'),cp(t,n,r.no_selection),t.fire("SetContent",r)}else"raw"!==r.format&&(n=tg({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=yo(Ne.fromDom(e))?n:_e.trim(n),cp(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r);return r.content}(t,n,e,o)}))},lp=function(t,e){return function(t,e){var n=t.dom;return n.parentNode?Yr(Ne.fromDom(n.parentNode),(function(n){return!Be(t,n)&&e(n)})):L.none()}(t,e).isSome()},fp=function(t){return w(t)?t:D},dp=function(t,e,n){var r=e(t),o=fp(n);return r.orThunk((function(){return o(t)?L.none():function(t,e,n){for(var r=t.dom,o=fp(n);r.parentNode;){r=r.parentNode;var i=Ne.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return L.none()}(t,e,o)}))},mp=cf,gp=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(hf(i)&&!1===i.inherit&&t.dom.is(e,i.selector))return!0}return!1},hp=function(t,e,n,r,o){var i=t.dom.getRoot();return e!==i&&(e=t.dom.getParent(e,(function(e){return!!gp(t,e,n)||(e.parentNode===i||!!bp(t,e,n,r,!0))})),!!bp(t,e,n,r,o))},pp=function(t,e,n){return!!mp(e,n.inline)||(!!mp(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0))},vp=function(t,e,n,r,o,i){var a=n[r];if(w(n.onmatch))return n.onmatch(e,n,r);if(a)if(v(a.length)){for(var u in a)if(wt(a,u)){var c="attributes"===r?t.getAttrib(e,u):lf(t,e,u),s=uf(a[u],i),l=b(c)||Wt(c);if(l&&b(s))continue;if(o&&l&&!n.exact)return!1;if((!o||n.exact)&&!mp(c,sf(t,s,u)))return!1}}else for(var f=0;f<a.length;f++)if("attributes"===r?t.getAttrib(e,a[f]):lf(t,e,a[f]))return!0;return!0},bp=function(t,e,n,r,o){var i=t.formatter.get(n),a=t.dom;if(i&&e)for(var u=0;u<i.length;u++){var c=i[u];if(pp(t.dom,e,c)&&vp(a,e,c,"attributes",o,r)&&vp(a,e,c,"styles",o,r)){var s=c.classes;if(s)for(var l=0;l<s.length;l++)if(!t.dom.hasClass(e,uf(s[l],r)))return;return c}}},yp=function(t,e,n,r,o){if(r)return hp(t,r,e,n,o);if(r=t.selection.getNode(),hp(t,r,e,n,o))return!0;var i=t.selection.getStart();return!(i===r||!hp(t,i,e,n,o))},wp=function(t,e){var n=function(e){return Be(e,Ne.fromDom(t.getBody()))};return L.from(t.selection.getStart(!0)).bind((function(r){return dp(Ne.fromDom(r),(function(n){return st(e,(function(e){return function(e,n){return bp(t,e.dom,n)?L.some(n):L.none()}(n,e)}))}),n)})).getOrNull()},xp=function(t,e,n){return Y(n,(function(n,r){var o=function(t,e){return U(t.formatter.get(e),(function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return U(["styles","attributes"],(function(n){return yt(t,n).exists((function(t){var n=g(t)?t:bt(t);return U(n,e)}))}))}))}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},Cp=xo,Sp="_mce_caret",kp=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==Cp||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},Tp=function(t){if(t){var e=new uo(t,t);for(t=e.current();t;t=e.next())if(Hn(t))return t}return null},Op=function(t){var e=Ne.fromTag("span");return tr(e,{id:Sp,"data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&gn(e,Ne.fromText(Cp)),e},Ep=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(kp(e))hh(t,!1,Ne.fromDom(e),n);else{var i=o.getRng(),a=r.getParent(e,r.isBlock),u=i.startContainer,c=i.startOffset,s=i.endContainer,l=i.endOffset,f=function(t){var e=Tp(t);return e&&e.nodeValue.charAt(0)===Cp&&e.deleteData(0,1),e}(e);r.remove(e,!0),u===f&&c>0&&i.setStart(f,c-1),s===f&&l>0&&i.setEnd(f,l-1),a&&r.isEmpty(a)&&Cg(Ne.fromDom(a)),o.setRng(i)}},_p=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)Ep(t,e,n);else if(!(e=Hl(t.getBody(),o.getStart())))for(;e=r.get(Sp);)Ep(t,e,!1)},Rp=function(t,e){return t.appendChild(e),e},Np=function(t,e){var n=X(t,(function(t,e){return Rp(t,e.cloneNode(!1))}),e);return Rp(n,n.ownerDocument.createTextNode(Cp))},Ap=function(t,e,n,r){var o,i,a,u=t.dom,c=t.selection,s=[],l=c.getRng(),f=l.startContainer,d=l.startOffset;for(i=f,3===f.nodeType&&(d!==f.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(bp(t,i,e,n,r)){a=i;break}i.nextSibling&&(o=!0),s.push(i),i=i.parentNode}if(a)if(o){var m=c.getBookmark();l.collapse(!0);var g=Df(t,l,t.formatter.get(e),!0);g=xd(g),t.formatter.remove(e,n,g,r),c.moveToBookmark(m)}else{var h=Hl(t.getBody(),a),p=Op(!1).dom;!function(t,e,n){var r=t.dom,o=r.getParent(n,_(rf,t));o&&r.isEmpty(o)?n.parentNode.replaceChild(e,n):(xg(Ne.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(e,n):r.insertAfter(e,n))}(t,p,null!==h?h:a);var v=function(t,e,n,r,o,i){var a=t.formatter,u=t.dom,c=K(lt(a.get()),(function(t){return t!==r&&!Lt(t,"removeformat")})),s=xp(t,n,c);if(K(s,(function(e){return!mf(t,e,r)})).length>0){var l=n.cloneNode(!1);return u.add(e,l),a.remove(r,o,l,i),u.remove(l),L.some(l)}return L.none()}(t,p,a,e,n,r),b=Np(s.concat(v.toArray()),p);Ep(t,h,!1),c.setCursorLocation(b,1),u.isEmpty(a)&&u.remove(a)}},Dp=function(t){t.on("mouseup keydown",(function(e){!function(t,e){var n=t.selection,r=t.getBody();_p(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==Cp||_p(t,Hl(r,n.getStart())),37!==e&&39!==e||_p(t,Hl(r,n.getStart()))}(t,e.keyCode)}))},Mp=function(t,e){var n=t.schema.getTextInlineElements();return wt(n,Le(e))&&!Il(e.dom)&&!zn(e.dom)},Bp={},zp=Tt,Pp=St;!function(t,e){Bp[t]||(Bp[t]=[]),Bp[t].push(e)}("pre",(function(t){var e,n=t.selection.getRng(),r=Dn(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),Pp(zp(zp(e,r),(function(t){return r(t.previousSibling)&&-1!==Ot(e,t.previousSibling)})),(function(t){var e,n;e=t.previousSibling,su(n=t).remove(),su(e).append("<br><br>").append(n.childNodes)})))}));var Lp=_e.each,Ip=function(t){return An(t)&&!Yl(t)&&!Il(t)&&!zn(t)},Hp=function(t,e){for(var n=t;n;n=n[e]){if(Hn(n)&&Ut(n.data))return t;if(An(n)&&!Yl(n))return n}return t},Fp=function(t,e,n){var r=Jm(t);if(e&&n&&(e=Hp(e,"previousSibling"),n=Hp(n,"nextSibling"),r.compare(e,n))){for(var o=e.nextSibling;o&&o!==n;){var i=o;o=o.nextSibling,e.appendChild(i)}return t.remove(n),_e.each(_e.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},Vp=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=Fp(t,nf(r),r);Fp(t,o,nf(o,!0))}},jp=function(t,e,n){Lp(t.childNodes,(function(t){Ip(t)&&(e(t)&&n(t),t.hasChildNodes()&&jp(t,e,n))}))},Up=function(t,e){return function(n){return!(!n||!lf(t,n,e))}},Wp=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)}(t,r)}},qp=Tr([{keep:[]},{rename:["name"]},{removed:[]}]),$p=/^(src|href|style)$/,Gp=_e.each,Kp=cf,Xp=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Yp=function(t,e,n){var r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"];if(An(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return Hn(r)&&n&&o>=r.nodeValue.length&&(r=new uo(r,t.getBody()).next()||r),Hn(r)&&!n&&0===o&&(r=new uo(r,t.getBody()).prev()||r),r},Jp=function(t,e){var n=e?"firstChild":"lastChild";if(function(t){return/^(TR|TH|TD)$/.test(t.nodeName)}(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},Qp=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},Zp=function(t,e,n,r,o){var i=Ne.fromDom(e),a=Ne.fromDom(t.create(r,o)),u=n?Je(i):Ye(i);return hn(a,u),n?(fn(i,a),mn(a,i)):(dn(i,a),gn(a,i)),a.dom},tv=function(t,e,n,r){var o=nf(e,n,r);return b(o)||"BR"===o.nodeName||t.isBlock(o)},ev=function(t,e,n){var r,o=e.parentNode,i=t.dom,a=ns(t);gf(n)&&(a?o===i.getRoot()&&(n.list_block&&Kp(e,n.list_block)||q(ct(e.childNodes),(function(e){of(t,a,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=Qp(i,e,a),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=null}))):i.isBlock(e)&&!i.isBlock(o)&&(tv(i,e,!1)||tv(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),tv(i,e,!0)||tv(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),function(t){return hf(t)&&pf(t)&&Xn(yt(t,"mixed"),!0)}(n)&&!Kp(n.inline,e)||i.remove(e,!0)},nv=function(t,e,n,r,o){var i,a=t.dom;if(!function(t,e,n){return!(!pf(n)||!Kp(e,n.inline))||!(!gf(n)||!Kp(e,n.block))||(hf(n)?An(e)&&t.is(e,n.selector):void 0)}(a,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return qp.keep();var u=r;if(pf(e)&&"all"===e.remove&&g(e.preserve_attributes)){var c=K(a.getAttribs(u),(function(t){return j(e.preserve_attributes,t.name.toLowerCase())}));if(a.removeAllAttribs(u),q(c,(function(t){return a.setAttrib(u,t.name,t.value)})),c.length>0)return qp.rename("span")}if("all"!==e.remove){Gp(e.styles,(function(t,r){t=sf(a,uf(t,n),r+""),x(r)&&(r=t,o=null),(e.remove_similar||!o||Kp(lf(a,o,r),t))&&a.setStyle(u,r,""),i=!0})),i&&""===a.getAttrib(u,"style")&&(u.removeAttribute("style"),u.removeAttribute("data-mce-style")),Gp(e.attributes,(function(t,r){var i;if(t=uf(t,n),x(r)&&(r=t,o=null),e.remove_similar||!o||Kp(a.getAttrib(o,r),t)){if("class"===r&&(t=a.getAttrib(u,r))&&(i="",q(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))return void a.setAttrib(u,r,i);if($p.test(r)&&u.removeAttribute("data-mce-"+r),"style"===r&&Dn(["li"])(u)&&"none"===a.getStyle(u,"list-style-type"))return u.removeAttribute(r),void a.setStyle(u,"list-style-type","none");"class"===r&&u.removeAttribute("className"),u.removeAttribute(r)}})),Gp(e.classes,(function(t){t=uf(t,n),o&&!a.hasClass(o,t)||a.removeClass(u,t)}));for(var s=a.getAttribs(u),l=0;l<s.length;l++){var f=s[l].nodeName;if(0!==f.indexOf("_")&&0!==f.indexOf("data-"))return qp.keep()}}return"none"!==e.remove?(ev(t,u,e),qp.removed()):qp.keep()},rv=function(t,e,n,r,o){return nv(t,e,n,r,o).fold(D,(function(e){return t.dom.rename(r,e),!0}),M)},ov=function(t,e,n,r){return nv(t,e,n,r,r).fold(T(r),(function(e){return t.dom.createFragment().appendChild(r),t.dom.rename(r,e)}),T(null))},iv=function(t,e,n,r,o){var i=t.formatter.get(e),a=i[0],u=!0,c=t.dom,s=t.selection,l=function(r){var u=function(t,e,n,r,o){var i;return q(df(t.dom,e.parentNode).reverse(),(function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var a=bp(t,e,n,r,o);a&&!1!==a.split&&(i=e)}})),i}(t,r,e,n,o);return function(t,e,n,r,o,i,a,u){var c,s,l,f=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=f.clone(m,!1);for(var g=0;g<e.length&&null!==(c=ov(t,e[g],u,c));g++);c&&(s&&c.appendChild(s),l||(l=c),s=c)}!i||a.mixed&&f.isBlock(n)||(r=f.split(n,r)),s&&(o.parentNode.insertBefore(s,o),l.appendChild(o),pf(a)&&Vp(f,a,0,s))}return r}(t,i,u,r,r,!0,a,n)},f=function(e){return U(i,(function(r){return rv(t,r,n,e,e)}))},d=function(e){var n=!0,r=!1;An(e)&&c.getContentEditable(e)&&(n=u,u="true"===c.getContentEditable(e),r=!0);var o=ct(e.childNodes);if(u&&!r){var i=f(e),s=e.parentNode;!i&&y(s)&&vf(a)&&f(s)}if(a.deep&&o.length){for(var l=0;l<o.length;l++)d(o[l]);r&&(u=n)}q(["underline","line-through","overline"],(function(n){An(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&ff(c,e.parentNode)===n&&rv(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))},m=function(t){var e=c.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return function(t){return Yl(t)&&An(t)&&("_start"===t.id||"_end"===t.id)}(n)&&(n=n[t?"firstChild":"lastChild"]),Hn(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),c.remove(e,!0),n},g=function(e){var n,r,o=Df(t,e,i,e.collapsed);if(a.split){if(o=xd(o),(n=Yp(t,o,!0))!==(r=Yp(t,o))){if(n=Jp(n,!0),r=Jp(r,!1),Xp(c,n,r)){var u=L.from(n.firstChild).getOr(n);return l(Zp(c,u,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void m(!0)}if(Xp(c,r,n)){u=L.from(r.lastChild).getOr(r);return l(Zp(c,u,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void m(!1)}n=Qp(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=Qp(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),Mf(c,s,(function(t){q(t,(function(t){Yl(t)||Yl(t.parentNode)||l(t)}))})),l(n),l(r),n=m(!0),r=m()}else n=r=l(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1}Mf(c,o,(function(t){q(t,d)}))};if(r){if(tf(r)){var h=c.createRng();h.setStartBefore(r),h.setEndAfter(r),g(h)}else g(r);od(t,e,r,n)}else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&pf(a)&&!Lf(t).length?Ap(t,e,n,o):(qf(s,!0,(function(){Wf(t,g)})),pf(a)&&yp(t,e,n,s.getStart())&&ef(c,s,s.getRng()),t.nodeChanged()),od(t,e,r,n);else{r=s.getNode();for(var p=0;p<i.length&&(!i[p].ceFalseOverride||!rv(t,i[p],n,r,r));p++);od(t,e,r,n)}},av=_e.each,uv=function(t,e,n,r){av(e,(function(e){pf(e)&&av(t.dom.select(e.inline,r),(function(r){Ip(r)&&rv(t,e,n,r,e.exact?r:null)})),function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";Lp(t.select(r,n),(function(n){Ip(n)&&Lp(e.styles,(function(e,r){t.setStyle(n,r,"")}))}))}}(t.dom,e,r)}))},cv=_e.each,sv=function(t){return An(t)&&!Yl(t)&&!Il(t)&&!zn(t)},lv=function(t,e,n,r){var o=t.formatter.get(e),i=o[0],a=!r&&t.selection.isCollapsed(),u=t.dom,c=t.selection,s=function(t,e){if(void 0===e&&(e=i),w(e.onformat)&&e.onformat(t,e,n,r),cv(e.styles,(function(e,r){u.setStyle(t,r,uf(e,n))})),e.styles){var o=u.getAttrib(t,"style");o&&u.setAttrib(t,"data-mce-style",o)}cv(e.attributes,(function(e,r){u.setAttrib(t,r,uf(e,n))})),cv(e.classes,(function(e){e=uf(e,n),u.hasClass(t,e)||u.addClass(t,e)}))},l=function(t,e){var n=!1;return cv(t,(function(t){return!!hf(t)&&(y(t.collapsed)&&t.collapsed!==a?void 0:u.is(e,t.selector)&&!Il(e)?(s(e,t),n=!0,!1):void 0)})),n},f=function(t){if(d(t)){var e=u.create(t);return s(e),e}return null},m=function(r,a,u){var c=[],d=!0,m=i.inline||i.block,g=f(m);Mf(r,a,(function(a){var f,h=function(a){var p=!1,v=d,b=a.nodeName.toLowerCase(),w=a.parentNode,x=w.nodeName.toLowerCase();if(An(a)&&r.getContentEditable(a)&&(v=d,d="true"===r.getContentEditable(a),p=!0),Un(a)&&!function(t,e,n,r){if(function(t){return t.getParam("format_empty_lines",!1,"boolean")}(t)&&pf(e)){var o=Nt(Nt({},t.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=lp(Ne.fromDom(n),(function(t){return Il(t.dom)}));return xt(o,r)&&ei(Ne.fromDom(n.parentNode),!1)&&!i}return!1}(t,i,a,x))return f=null,void(gf(i)&&r.remove(a));if(gf(i)&&i.wrapper&&bp(t,a,e,n))f=null;else{if(d&&!p&&gf(i)&&!i.wrapper&&rf(t,b)&&of(t,x,m)){var C=r.rename(a,m);return s(C),c.push(C),void(f=null)}if(hf(i)){var S=l(o,a);if(!S&&y(w)&&vf(i)&&(S=l(o,w)),!pf(i)||S)return void(f=null)}!d||p||!of(t,m,b)||!of(t,x,m)||!u&&Hn(a)&&Co(a.data)||Il(a)||pf(i)&&r.isBlock(a)?(f=null,q(ct(a.childNodes),h),p&&(d=v),f=null):(f||(f=r.clone(g,!1),a.parentNode.insertBefore(f,a),c.push(f)),f.appendChild(a))}};q(a,h)})),!0===i.links&&q(c,(function(t){var e=function(t){"A"===t.nodeName&&s(t,i),q(ct(t.childNodes),e)};e(t)})),q(c,(function(a){var u=function(t){var e=0;return q(t.childNodes,(function(t){(function(t){return y(t)&&Hn(t)&&0===t.length})(t)||Yl(t)||e++})),e}(a);!(c.length>1)&&r.isBlock(a)||0!==u?(pf(i)||gf(i)&&i.wrapper)&&(i.exact||1!==u||(a=function(t){return Q(t.childNodes,sv).filter((function(t){return pp(r,t,i)})).map((function(e){var n=r.clone(e,!1);return s(n),r.replace(n,t,!0),r.remove(e,!0),n})).getOr(t)}(a)),uv(t,o,n,a),function(t,e,n,r,o){bp(t,o.parentNode,n,r)&&rv(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(bp(t,i,n,r))return rv(t,e,r,o),!0}))}(t,i,e,n,a),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&jp(r,Up(t,"fontSize"),Wp(t,"backgroundColor",uf(e.styles.backgroundColor,n)))}(r,i,n,a),function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=ff(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(_e.walk(r,o,"childNodes"),o(r))}(r,i,0,a),function(t,e,n,r){!pf(e)||"sub"!==e.inline&&"sup"!==e.inline||(jp(r,Up(t,"fontSize"),Wp(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(r,i,0,a),Vp(r,i,0,a)):r.remove(a,!0)}))};if("false"!==u.getContentEditable(c.getNode())){if(i){if(r)if(tf(r)){if(!l(o,r)){var g=u.createRng();g.setStartBefore(r),g.setEndAfter(r),m(u,Df(t,g,o),!0)}}else m(u,r,!0);else if(a&&pf(i)&&!Lf(t).length)!function(t,e,n){var r,o,i=t.selection,a=i.getRng(),u=a.startOffset,c=a.startContainer.nodeValue;(r=Hl(t.getBody(),i.getStart()))&&(o=Tp(r));var s,l,f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&u>0&&u<c.length&&f.test(c.charAt(u))&&f.test(c.charAt(u-1))){var d=i.getBookmark();a.collapse(!0);var m=Df(t,a,t.formatter.get(e));m=xd(m),t.formatter.apply(e,n,m),i.moveToBookmark(d)}else r&&o.nodeValue===Cp||(s=t.getDoc(),l=Op(!0).dom,o=(r=s.importNode(l,!0)).firstChild,a.insertNode(r),u=1),t.formatter.apply(e,n,r),i.setCursorLocation(o,u)}(t,e,n);else{var h=c.getNode(),p=o[0];t.settings.forced_root_block||!p.defaultBlock||u.getParent(h,u.isBlock)||lv(t,p.defaultBlock),c.setRng(Gh(c.getRng())),qf(c,!0,(function(){Wf(t,(function(e,n){var r=n?e:Df(t,e,o);m(u,r,!1)}))})),ef(u,c,c.getRng()),t.nodeChanged()}!function(t,e){Pp(Bp[t],(function(t){t(e)}))}(e,t)}rd(t,e,r,n)}else{r=c.getNode();for(var v=0,b=o.length;v<b;v++){var x=o[v];if(x.ceFalseOverride&&hf(x)&&u.is(r,x.selector)){s(r,x);break}}rd(t,e,r,n)}},fv=function(t){return wt(t,"vars")},dv=function(t){return t.selection.getStart()},mv=function(t,e,n,r,o){return J(e,(function(e){var i=t.formatter.matchNode(e,n,null!=o?o:{},r);return!v(i)}),(function(e){return!!gp(t,e,n)||!r&&y(t.formatter.matchNode(e,n,o,!0))}))},gv=function(t,e){var n=null!=e?e:dv(t);return K(df(t.dom,n),(function(t){return An(t)&&!zn(t)}))},hv=function(t,e,n){var r=gv(t,e);dt(n,(function(n,o){var i=function(n){var i=mv(t,r,o,n.similar,fv(n)?n.vars:void 0),a=i.isSome();if(n.state.get()!==a){n.state.set(a);var u=i.getOr(e);fv(n)?n.callback(a,{node:u,format:o,parents:r}):q(n.callbacks,(function(t){return t(a,{node:u,format:o,parents:r})}))}};q([n.withSimilar,n.withoutSimilar],i),q(n.withVars,i)}))},pv=function(t,e,n,r,o,i){return null===e.get()&&function(t,e){t.set({}),e.on("NodeChange",(function(n){hv(e,n.element,t.get())})),e.on("FormatApply FormatRemove",(function(n){var r=L.from(n.node).map((function(t){return tf(t)?t:t.startContainer})).bind((function(t){return An(t)?L.some(t):L.from(t.parentElement)})).getOrThunk((function(){return dv(e)}));hv(e,r,t.get())}))}(e,t),function(t,e,n,r,o,i){var a=e.get();q(n.split(","),(function(e){var n=yt(a,e).getOrThunk((function(){var t={withSimilar:{state:xu(!1),similar:!0,callbacks:[]},withoutSimilar:{state:xu(!1),similar:!1,callbacks:[]},withVars:[]};return a[e]=t,t})),u=function(){var n=gv(t);return mv(t,n,e,o,i).isSome()};if(v(i)){var c=o?n.withSimilar:n.withoutSimilar;c.callbacks.push(r),1===c.callbacks.length&&c.state.set(u())}else n.withVars.push({state:xu(u()),similar:o,vars:i,callback:r})})),e.set(a)}(t,e,n,r,o,i),{unbind:function(){return function(t,e,n){var r=t.get();q(e.split(","),(function(t){return yt(r,t).each((function(e){r[t]={withSimilar:Nt(Nt({},e.withSimilar),{callbacks:K(e.withSimilar.callbacks,(function(t){return t!==n}))}),withoutSimilar:Nt(Nt({},e.withoutSimilar),{callbacks:K(e.withoutSimilar.callbacks,(function(t){return t!==n}))}),withVars:K(e.withVars,(function(t){return t.callback!==n}))}}))})),t.set(r)}(e,n,r)}}},vv=function(t,e){var n=(e||document).createDocumentFragment();return q(t,(function(t){n.appendChild(t.dom)})),Ne.fromDom(n)},bv=function(t,e,n){return{element:t,width:e,rows:n}},yv=function(t,e){return{element:t,cells:e}},wv=function(t,e){return{x:t,y:e}},xv=function(t,e){var n=parseInt(er(t,e),10);return isNaN(n)?1:n},Cv=function(t,e,n){var r=t.rows;return!!(r[n]?r[n].cells:[])[e]},Sv=function(t){return Y(t,(function(t,e){return e.cells.length>t?e.cells.length:t}),0)},kv=function(t,e){for(var n=t.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Be(o[i],e))return L.some(wv(i,r));return L.none()},Tv=function(t,e,n,r,o){for(var i=[],a=t.rows,u=n;u<=o;u++){var c=a[u].cells,s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(yv(a[u].element,s))}return i},Ov=function(t){var e=bv(Yu(t),0,[]);return q(Iu(t,"tr"),(function(t,n){q(Iu(t,"td,th"),(function(r,o){!function(t,e,n,r,o){for(var i=xv(o,"rowspan"),a=xv(o,"colspan"),u=t.rows,c=n;c<n+i;c++){u[c]||(u[c]=yv(Ju(r),[]));for(var s=e;s<e+a;s++)u[c].cells[s]=c===n&&s===e?o:Yu(o)}}(e,function(t,e,n){for(;Cv(t,e,n);)e++;return e}(e,o,n),n,t,r)}))})),bv(e.element,Sv(e.rows),e.rows)},Ev=function(t){return function(t,e){var n=Yu(t.element),r=Ne.fromTag("tbody");return hn(r,e),gn(n,r),n}(t,function(t){return W(t.rows,(function(t){var e=W(t.cells,(function(t){var e=Ju(t);return rr(e,"colspan"),rr(e,"rowspan"),e})),n=Yu(t.element);return hn(n,e),n}))}(t))},_v=function(t,e,n){return kv(t,e).bind((function(e){return kv(t,n).map((function(n){return function(t,e,n){var r=e.x,o=e.y,i=n.x,a=n.y,u=o<a?Tv(t,r,o,i,a):Tv(t,r,a,i,o);return bv(t.element,Sv(u),u)}(t,e,n)}))}))},Rv=function(t,e){return Q(t,(function(t){return"li"===Le(t)&&Vf(t,e)})).fold(T([]),(function(e){return function(t){return Q(t,(function(t){return"ul"===Le(t)||"ol"===Le(t)}))}(t).map((function(t){var e=Ne.fromTag(Le(t)),n=vt(cr(t),(function(t,e){return It(e,"list-style")}));return or(e,n),[Ne.fromTag("li"),e]})).getOr([])}))},Nv=function(t,e){var n=Ne.fromDom(e.commonAncestorContainer),r=Og(n,t),o=K(r,(function(t){return fo(t)||so(t)})),i=Rv(r,e),a=o.concat(i.length?i:function(t){return po(t)?Ge(t).filter(ho).fold(T([]),(function(e){return[t,e]})):ho(t)?[t]:[]}(n));return W(a,Yu)},Av=function(){return vv([])},Dv=function(t,e){return n=Ne.fromDom(e.cloneContents()),r=Nv(t,e),o=Y(r,(function(t,e){return gn(e,t),e}),n),r.length>0?vv([o]):o;var n,r,o},Mv=function(t,e){return(n=t,r=e[0],Jr(r,"table",_(Be,n))).bind((function(t){var n=e[0],r=e[e.length-1],o=Ov(t);return _v(o,n,r).map((function(t){return vv([Ev(t)])}))})).getOrThunk(Av);var n,r},Bv=function(t,e){var n=Pf(e,t);return n.length>0?Mv(t,n):function(t,e){return e.length>0&&e[0].collapsed?Av():Dv(t,e[0])}(t,e)},zv=function(t,e){return e>=0&&e<t.length&&Ql(t.charAt(e))},Pv=function(t,e){var n=So(t.innerText);return e?function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},Lv=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return Nt(Nt({},t),{format:e,get:!0,selection:!0})}(n,e),o=t.fire("BeforeGetContent",r);if(o.isDefaultPrevented())return t.fire("GetContent",o),o.content;if("text"===o.format)return function(t){return L.from(t.selection.getRng()).map((function(e){var n=L.from(t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock)),r=t.getBody(),o=function(t){return t.map((function(t){return t.nodeName})).getOr("div").toLowerCase()}(n),i=Se.browser.isIE()&&"pre"!==o,a=t.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),u=Pv(a,i),c=So(a.textContent);if(t.dom.remove(a),zv(c,0)||zv(c,c.length-1)){var s=n.getOr(r),l=Pv(s,i),f=l.indexOf(u);return-1===f?u:(zv(l,f-1)?" ":"")+u+(zv(l,f+u.length)?" ":"")}return u})).getOr("")}(t);o.getInner=!0;var i=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=_m(t,Bf(o)),a=e.contextual?Bv(Ne.fromDom(t.getBody()),i).dom:n.cloneContents();return a&&r.appendChild(a),t.selection.serializer.serialize(r,e)}(t,o);return"tree"===o.format?i:(o.content=t.selection.isCollapsed()?"":i,t.fire("GetContent",o),o.content)},Iv=function(t){return An(t)?t.outerHTML:Hn(t)?yi.encodeRaw(t.data,!1):Fn(t)?"\x3c!--"+t.data+"--\x3e":""},Hv=function(t,e,n){var r=function(t){var e,n=document.createElement("div"),r=document.createDocumentFragment();for(t&&(n.innerHTML=t);e=n.firstChild;)r.appendChild(e);return r}(e);if(t.hasChildNodes()&&n<t.childNodes.length){var o=t.childNodes[n];o.parentNode.insertBefore(r,o)}else t.appendChild(r)},Fv=function(t,e){var n,r,o,i,a,u,c,s,l,f=W(ct(e.childNodes),Iv);return function(t,e){var n=0;q(t,(function(t){0===t[0]?n++:1===t[0]?(Hv(e,t[1],n),n++):2===t[0]&&function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}}(e,n)}))}((r=t,o=(n=f).length+r.length+2,i=new Array(o),a=new Array(o),u=function(t,e,o,i,a){var c=s(t,e,o,i);if(null===c||c.start===e&&c.diag===e-i||c.end===t&&c.diag===t-o)for(var l=t,f=o;l<e||f<i;)l<e&&f<i&&n[l]===r[f]?(a.push([0,n[l]]),++l,++f):e-t>i-o?(a.push([2,n[l]]),++l):(a.push([1,r[f]]),++f);else{u(t,c.start,o,c.start-c.diag,a);for(var d=c.start;d<c.end;++d)a.push([0,n[d]]);u(c.end,e,c.end-c.diag,i,a)}},c=function(t,e,o,i){for(var a=t;a-e<i&&a<o&&n[a]===r[a-e];)++a;return function(t,e,n){return{start:t,end:e,diag:n}}(t,a,e)},s=function(t,e,o,u){var s=e-t,l=u-o;if(0===s||0===l)return null;var f,d,m,g,h,p=s-l,v=l+s,b=(v%2==0?v:v+1)/2;for(i[1+b]=t,a[1+b]=e+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){for(m=d+b,d===-f||d!==f&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,h=(g=i[m])-t+o-d;g<e&&h<u&&n[g]===r[h];)i[m]=++g,++h;if(p%2!=0&&p-f<=d&&d<=p+f&&a[m-p]<=i[m])return c(a[m-p],d+t-o,e,u)}for(d=p-f;d<=p+f;d+=2){for(m=d+b-p,d===p-f||d!==p+f&&a[m+1]<=a[m-1]?a[m]=a[m+1]-1:a[m]=a[m-1],h=(g=a[m]-1)-t+o-d;g>=t&&h>=o&&n[g]===r[h];)a[m]=g--,h--;if(p%2==0&&-f<=d&&d<=f&&a[m]<=i[m+p])return c(a[m],d+t-o,e,u)}}},l=[],u(0,n.length,0,r.length,l),l),e),e},Vv=Dt((function(){return document.implementation.createHTMLDocument("undo")})),jv=function(t){var e,n=(e=t.getBody(),K(W(ct(e.childNodes),Iv),(function(t){return t.length>0}))),r=tt(n,(function(e){var n=Gm(t.serializer,e);return n.length>0?[n]:[]})),o=r.join("");return-1!==o.indexOf("</iframe>")?function(t){return{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}}(r):function(t){return{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}}(o)},Uv=function(t,e,n){var r=n?e.beforeBookmark:e.bookmark;"fragmented"===e.type?Fv(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw",no_selection:!y(r)||!Fl(r)||!r.isFakeCaret}),t.selection.moveToBookmark(r)},Wv=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},qv=function(t){var e=Ne.fromTag("body",Vv());return Ku(e,Wv(t)),q(Iu(e,"*[data-mce-bogus]"),bn),e.dom.innerHTML},$v=function(t,e){return!(!t||!e)&&(!!function(t,e){return Wv(t)===Wv(e)}(t,e)||function(t,e){return qv(t)===qv(e)}(t,e))},Gv=function(t){return 0===t.get()},Kv=function(t,e,n){Gv(n)&&(t.typing=e)},Xv=function(t,e){t.typing&&(Kv(t,!1,e),t.add())},Yv=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){Gv(e)&&n.set(Qc(t.selection))}(t,e,n)},add:function(e,n,r,o,i,a){return function(t,e,n,r,o,i,a){var u=jv(t);if(i=i||{},i=_e.extend(i,u),!1===Gv(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:a}).isDefaultPrevented())return null;if(c&&$v(c,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var s=function(t){return t.getParam("custom_undo_redo_levels",0,"number")}(t);if(s&&e.data.length>s){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=Qc(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:c,originalEvent:a};return n.get()>0?(t.setDirty(!0),t.fire("AddUndo",f),t.fire("change",f)):t.fire("AddUndo",f),i}(t,e,n,r,o,i,a)},undo:function(e,n,r){return function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,Kv(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],Uv(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o}(t,e,n,r)},redo:function(e,n){return function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],Uv(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r}(t,e,n)},clear:function(e,n){return function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")}(t,e,n)},reset:function(t){return function(t){t.clear(),t.add()}(t)},hasUndo:function(e,n){return function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!$v(jv(t),e.data[0])}(t,e,n)},hasRedo:function(t,e){return function(t,e){return e.get()<t.data.length-1&&!t.typing}(t,e)},transact:function(t,e,n){return function(t,e,n){return Xv(t,e),t.beforeChange(),t.ignore(n),t.add()}(t,e,n)},ignore:function(t,e){return function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}}(t,e)},extra:function(e,n,r,o){return function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,a=e.data[n.get()-1];Uv(t,a,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}}(t,e,n,r,o)}},formatter:{match:function(e,n,r,o){return yp(t,e,n,r,o)},matchAll:function(e,n){return function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,(function(i){for(var a=0;a<e.length;a++){var u=e[a];!o[u]&&bp(t,i,u,n)&&(o[u]=!0,r.push(u))}}),t.dom.getRoot()),r}(t,e,n)},matchNode:function(e,n,r,o){return bp(t,e,n,r,o)},canApply:function(e){return function(t,e){var n=t.formatter.get(e),r=t.dom;if(n)for(var o=t.selection.getStart(),i=df(r,o),a=n.length-1;a>=0;a--){var u=n[a];if(!hf(u)||y(u.defaultBlock))return!0;for(var c=i.length-1;c>=0;c--)if(r.is(i[c],u.selector))return!0}return!1}(t,e)},closest:function(e){return wp(t,e)},apply:function(e,n,r){return lv(t,e,n,r)},remove:function(e,n,r,o){return iv(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!yp(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?lv(t,e,n,r):iv(t,e,n,r)}(t,e,n,r)},formatChanged:function(e,n,r,o,i){return pv(t,e,n,r,o,i)}},editor:{getContent:function(e,n){return function(t,e,n){return L.from(t.getBody()).fold(T("tree"===e.format?new Mm("body",11):""),(function(r){return Xm(t,e,n,r)}))}(t,e,n)},setContent:function(e,n){return sp(t,e,n)},insertContent:function(e,n){return op(t,e,n)},addVisual:function(e){return function(t,e){var n=t.dom,r=y(e)?e:t.getBody();v(t.hasVisual)&&(t.hasVisual=function(t){return t.getParam("visual",!0,"boolean")}(t)),q(n.select("table,a",r),(function(e){switch(e.nodeName){case"TABLE":var r=function(t){return t.getParam("visual_table_class","mce-item-table","string")}(t),o=n.getAttrib(e,"border");o&&"0"!==o||!t.hasVisual?n.removeClass(e,r):n.addClass(e,r);break;case"A":if(!n.getAttrib(e,"href")){var i=n.getAttrib(e,"name")||e.id,a=function(t){return t.getParam("visual_anchor_class","mce-item-anchor","string")}(t);i&&t.hasVisual?n.addClass(e,a):n.removeClass(e,a)}}})),t.fire("VisualAid",{element:e,hasVisual:t.hasVisual})}(t,e)}},selection:{getContent:function(e,n){return Lv(t,e,n)}},raw:{getModel:function(){return L.none()}}}},Jv=function(t){return wt(t.plugins,"rtc")},Qv=function(t){var e=t;return function(t){return yt(t.plugins,"rtc").bind((function(t){return L.from(t.setup)}))}(t).fold((function(){return e.rtcInstance=Yv(t),L.none()}),(function(t){return e.rtcInstance=function(){var t=T(null),e=T("");return{undoManager:{beforeChange:C,add:t,undo:t,redo:t,clear:C,reset:C,hasUndo:D,hasRedo:D,transact:t,ignore:C,extra:C},formatter:{match:D,matchAll:T([]),matchNode:T(void 0),canApply:D,closest:e,apply:C,remove:C,toggle:C,formatChanged:T({unbind:C})},editor:{getContent:e,setContent:e,insertContent:C,addVisual:C},selection:{getContent:e},raw:{getModel:T(L.none())}}}(),L.some((function(){return t().then((function(t){return e.rtcInstance=function(t){var e=function(t){return m(t)?t:{}},n=t.undoManager,r=t.formatter,o=t.editor,i=t.selection,a=t.raw;return{undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:function(t,e,r){return n.transact(r)},ignore:function(t,e){return n.ignore(e)},extra:function(t,e,r,o){return n.extra(r,o)}},formatter:{match:function(t,n,o,i){return r.match(t,e(n),i)},matchAll:r.matchAll,matchNode:r.matchNode,canApply:function(t){return r.canApply(t)},closest:function(t){return r.closest(t)},apply:function(t,n,o){return r.apply(t,e(n))},remove:function(t,n,o,i){return r.remove(t,e(n))},toggle:function(t,n,o){return r.toggle(t,e(n))},formatChanged:function(t,e,n,o,i){return r.formatChanged(e,n,o,i)}},editor:{getContent:function(t,e){return o.getContent(t)},setContent:function(t,e){return o.setContent(t,e)},insertContent:function(t,e){return o.insertContent(t)},addVisual:o.addVisual},selection:{getContent:function(t,e){return i.getContent(e)}},raw:{getModel:function(){return L.some(a.getRawModel())}}}}(t),t.rtc.isRemote}))}))}))},Zv=function(t){return t.rtcInstance?t.rtcInstance:Yv(t)},tb=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},eb=function(t,e){return void 0===e&&(e={}),function(t,e,n){return tb(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)},nb=function(t){return 0===t.dom.length?(vn(t),L.none()):L.some(t)},rb=function(t,e,n,r){t.bind((function(t){return(r?rh:nh)(t.dom,r?t.dom.length:0),e.filter(Ve).map((function(e){return function(t,e,n,r){var o=t.dom,i=e.dom,a=r?o.length:i.length;r?(oh(o,i,!1,!r),n.setStart(i,a)):(oh(i,o,!1,!r),n.setEnd(i,a))}(t,e,n,r)}))})).orThunk((function(){return function(t,e){return t.filter((function(t){return Zf.isBookmarkNode(t.dom)})).bind(e?Xe:Ke)}(e,r).or(e).filter(Ve).map((function(t){return function(t,e){Ge(t).each((function(n){var r=t.dom;e&&Gg(n,Rc(r,0))?nh(r,0):!e&&Kg(n,Rc(r,r.length))&&rh(r,r.length)}))}(t,r)}))}))},ob=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return Nt(Nt({format:"html"},t),{set:!0,selection:!0,content:e})}(n,e),o=r;if(!r.no_events){var i=t.fire("BeforeSetContent",r);if(i.isDefaultPrevented())return void t.fire("SetContent",i);o=i}o.content=function(t,e){if("raw"!==e.format){var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,Nt(Nt({isRootContent:!0,forced_root_block:!1},o),e));return tg({validate:t.validate},t.schema).serialize(i)}return e.content}(t,o);var a=t.selection.getRng();!function(t,e){var n=L.from(e.firstChild).map(Ne.fromDom),r=L.from(e.lastChild).map(Ne.fromDom);t.deleteContents(),t.insertNode(e);var o=n.bind(Ke).filter(Ve).bind(nb),i=r.bind(Xe).filter(Ve).bind(nb);rb(o,n,t,!0),rb(i,r,t,!1),t.collapse(!1)}(a,a.createContextualFragment(o.content)),t.selection.setRng(a),Wd(t,a),o.no_events||t.fire("SetContent",o)},ib=function(t,e,n){if(t&&wt(t,e)){var r=K(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}};var ab,ub,cb=function(t){return!!t.select},sb=function(t){return!(!t||!t.ownerDocument)&&Pe(Ne.fromDom(t.ownerDocument),Ne.fromDom(t))},lb=function(t,e,n,r){var o,i,a=function(t,e){var n,r,o=function(e,n){return Q(n,(function(n){return t.is(n,e)}))},i=function(e){return t.getParents(e,null,t.getRoot())};return{selectorChangedWithUnbind:function(t,a){return n||(n={},r={},e.on("NodeChange",(function(t){var e=t.element,a=i(e),u={};_e.each(n,(function(t,e){o(e,a).each((function(n){r[e]||(q(t,(function(t){t(!0,{node:n,selector:e,parents:a})})),r[e]=t),u[e]=t}))})),_e.each(r,(function(t,n){u[n]||(delete r[n],_e.each(t,(function(t){t(!1,{node:e,selector:n,parents:a})})))}))}))),n[t]||(n[t]=[]),n[t].push(a),o(t,i(e.selection.getStart())).each((function(){r[t]=n[t]})),{unbind:function(){ib(n,t,a),ib(r,t,a)}}}}}(t,r).selectorChangedWithUnbind,u=function(t,e){return ob(r,t,e)},c=function(t){var e=l();e.collapse(!!t),f(e)},s=function(){return e.getSelection?e.getSelection():e.document.selection},l=function(){var n,a,u,c=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}},l=e.document;if(void 0!==r.bookmark&&!1===wm(r)){var f=cm(r);if(f.isSome())return f.map((function(t){return _m(r,[t])[0]})).getOr(l.createRange())}try{(n=s())&&!Nn(n.anchorNode)&&(a=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():l.createRange(),a=_m(r,[a])[0])}catch(t){}return a||(a=l.createRange?l.createRange():l.body.createTextRange()),a.setStart&&9===a.startContainer.nodeType&&a.collapsed&&(u=t.getRoot(),a.setStart(u,0),a.setEnd(u,0)),o&&i&&(0===c(a.START_TO_START,a,o)&&0===c(a.END_TO_END,a,o)?a=i:(o=null,i=null)),a},f=function(t,e){var n;if(function(t){return!!t&&(!!cb(t)||sb(t.startContainer)&&sb(t.endContainer))}(t)){var a=cb(t)?t:null;if(a){i=null;try{a.select()}catch(t){}}else{var u=s();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,u){i=t;try{u.removeAllRanges(),u.addRange(t)}catch(t){}!1===e&&u.extend&&(u.collapse(t.endContainer,t.endOffset),u.extend(t.startContainer,t.startOffset)),o=u.rangeCount>0?u.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!u.setBaseAndExtent||Se.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(u.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),u.anchorNode===t.startContainer&&u.focusNode===t.endContainer||u.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},d=function(){var e=s(),n=null==e?void 0:e.anchorNode,r=null==e?void 0:e.focusNode;if(!e||!n||!r||Nn(n)||Nn(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},m={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:c,setCursorLocation:function(e,n){var o=t.createRng();y(e)&&y(n)?(o.setStart(e,n),o.setEnd(e,n),f(o),c(!1)):(jf(t,o,r.getBody(),!0),f(o))},getContent:function(t){return eb(r,t)},setContent:u,getBookmark:function(t,e){return g.getBookmark(t,e)},moveToBookmark:function(t){return g.moveToBookmark(t)},select:function(e,n){return function(t,e,n){return L.from(e).map((function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(jf(t,o,e,!0),jf(t,o,e,!1)),o}))}(t,e,n).each(f),e},isCollapsed:function(){var t=l(),e=s();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:d,setNode:function(e){return u(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,a=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Em(r.nextSibling,!0):r.parentNode,o=0===a?Em(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),l())},getSel:s,setRng:f,getRng:l,getStart:function(t){return Tm(r.getBody(),l(),t)},getEnd:function(t){return Om(r.getBody(),l(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],a=t.getRoot();if(n=t.getParent(n||Tm(a,e,e.collapsed),t.isBlock),r=t.getParent(r||Om(a,e,e.collapsed),t.isBlock),n&&n!==a&&i.push(n),n&&r&&n!==r){o=n;for(var u=new uo(n,a);(o=u.next())&&o!==r;)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==a&&i.push(r),i}(t,l(),e,n)},normalize:function(){var e=l(),n=s();if(!(Bf(n).length>1)&&Uf(r)){var o=yd(t,e);return o.each((function(t){f(t,d())})),o.getOr(e)}return e},selectorChanged:function(t,e){return a(t,e),m},selectorChangedWithUnbind:a,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){y(t)?function(t,e,n){(t.inline?Vd:Ud)(t,e,n)}(r,t,e):Wd(r,l(),e)},placeCaretAt:function(t,e){return f(sd(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=l();return t.collapsed?Rc.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,h.destroy()}},g=Zf(m),h=ud(m,r);return m.bookmarkManager=g,m.controlSelection=h,m},fb=function(t,e,n){t.addNodeFilter("font",(function(t){q(t,(function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),a=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),a&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),function(t,e){q(e,(function(e){t.attr(e,null)}))}(t,["color","face","size"])}))}))},db=function(t,e){var n=Ai();e.convert_fonts_to_spans&&fb(t,n,_e.explode(e.font_size_legacy_values)),function(t,e){t.addNodeFilter("strike",(function(t){q(t,(function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))}))}))}(t,n)},mb=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},gb=function(t,e){var n;try{n=atob(e)}catch(t){return L.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return L.some(new Blob([r],{type:t}))},hb=function(t){return 0===t.indexOf("blob:")?function(t){return new to((function(e,n){var r=function(){n("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){200===o.status?e(o.response):r()},o.onerror=r,o.send()}catch(t){r()}}))}(t):0===t.indexOf("data:")?(e=t,new to((function(t){var n=mb(e),r=n.type,o=n.data;gb(r,o).fold((function(){return t(new Blob([]))}),t)}))):null;var e},pb=0,vb=function(t){return(t||"blobid")+pb++},bb=function(t,e,n,r){var o,i;if(0!==e.src.indexOf("blob:")){var a=mb(e.src),u=a.data,c=a.type;o=u,(i=t.getByData(o,c))?n({image:e,blobInfo:i}):hb(e.src).then((function(r){i=t.create(vb(),r,o),t.add(i),n({image:e,blobInfo:i})}),(function(t){r(t)}))}else(i=t.getByUri(e.src))?n({image:e,blobInfo:i}):hb(e.src).then((function(r){(function(t){return new to((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))})(r).then((function(a){o=mb(a).data,i=t.create(vb(),r,o),t.add(i),n({image:e,blobInfo:i})}))}),(function(t){r(t)}))},yb=function(t,e){var n={};return{findAll:function(r,o){o||(o=M);var i=K(function(t){return t?ct(t.getElementsByTagName("img")):[]}(r),(function(e){var n=e.src;return!!Se.fileApi&&(!e.hasAttribute("data-mce-bogus")&&(!e.hasAttribute("data-mce-placeholder")&&(!(!n||n===Se.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e)))))})),a=W(i,(function(t){if(void 0!==n[t.src])return new to((function(e){n[t.src].then((function(n){if("string"==typeof n)return n;e({image:t,blobInfo:n.blobInfo})}))}));var r=new to((function(n,r){bb(e,t,n,r)})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r,r}));return to.all(a)}}},wb=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new Mm("br",1)).shortEnded=!0:r.empty().append(new Mm("#text",3)).value=wo},xb=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},Cb=function(t,e,n,r){return r.isEmpty(e,n,(function(e){return function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty}(t,e)}))},Sb=function(t,e){var n=e.blob_cache,r=function(t){var r=t.attr("src");(function(t){return t.attr("src")===Se.transparentSrc||y(t.attr("data-mce-placeholder"))})(t)||function(t){return y(t.attr("data-mce-bogus"))}(t)||function(t){var e=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(t);return e?L.some({type:e[1],data:decodeURIComponent(e[2])}):L.none()}(r).filter((function(){return function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),dt(t.attributes.map,(function(t,e){n.setAttribute(e,t)})),e.images_dataimg_filter(n)}return!0}(t,e)})).bind((function(t){var e=t.type,r=t.data;return L.from(n.getByData(r,e)).orThunk((function(){return gb(e,r).map((function(t){var e=n.create(vb(),t,r);return n.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))};n&&t.addAttributeFilter("src",(function(t){return q(t,r)}))},kb=_e.makeMap,Tb=_e.each,Ob=_e.explode,Eb=_e.extend,_b=function(t,e){void 0===e&&(e=Ri());var n={},r=[],o={},i={};(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var a=function(t){var e=t.name;e in n&&((u=o[e])?u.push(t):o[e]=[t]);for(var a=r.length;a--;){var u,c=r[a].name;if(c in t.attributes.map)(u=i[c])?u.push(t):i[c]=[t]}return t},u={schema:e,addAttributeFilter:function(t,e){Tb(Ob(t),(function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){Tb(Ob(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},getNodeFilters:function(){var t=[];for(var e in n)wt(n,e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:a,parse:function(u,c){var s,l,f,d,m,g,h,p,v=[];c=c||{},o={},i={};var b=Eb(kb("script,style,head,html,body,title,meta,param"),e.getBlockElements()),y=e.getNonEmptyElements(),w=e.children,x=t.validate,C=function(t){return!1===t?"":!0===t?"p":t}("forced_root_block"in c?c.forced_root_block:t.forced_root_block),S=e.getWhiteSpaceElements(),k=/^[ \t\r\n]+/,T=/[ \t\r\n]+$/,O=/[ \t\r\n]+/g,E=/^[ \t\r\n]+$/,_=wt(S,c.context)||wt(S,t.root_name),R=function(t,e){var r,i=new Mm(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i},N=function(t){for(var n=e.getBlockElements(),r=t.prev;r&&3===r.type;){var o=r.value.replace(T,"");if(o.length>0)return void(r.value=o);var i=r.next;if(i){if(3===i.type&&i.value.length){r=r.prev;continue}if(!n[i.name]&&"script"!==i.name&&"style"!==i.name){r=r.prev;continue}}var a=r.prev;r.remove(),r=a}},A=$m({validate:x,document:t.document,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e={};for(var n in t)"li"!==n&&"p"!==n&&(e[n]=t[n]);return e}(e.getSelfClosingElements()),cdata:function(t){p.append(R("#cdata",4)).value=t},text:function(t,e){var n;_||(t=t.replace(O," "),function(t,e){return t&&(wt(e,t.name)||"br"===t.name)}(p.lastChild,b)&&(t=t.replace(k,""))),0!==t.length&&((n=R("#text",3)).raw=!!e,p.append(n).value=t)},comment:function(t){p.append(R("#comment",8)).value=t},pi:function(t,e){p.append(R(t,7)).value=e,N(p)},doctype:function(t){p.append(R("#doctype",10)).value=t,N(p)},start:function(t,n,o){var a=x?e.getElementRule(t):{};if(a){var u=R(a.outputName||t,1);u.attributes=n,u.shortEnded=o,p.append(u);var c=w[p.name];c&&w[u.name]&&!c[u.name]&&v.push(u);for(var s=r.length;s--;){var l=r[s].name;l in n.map&&((g=i[l])?g.push(u):i[l]=[u])}b[t]&&N(u),o||(p=u),!_&&S[t]&&(_=!0)}},end:function(n){var r,o,i,a,u=x?e.getElementRule(n):{};if(u){if(b[n]&&!_){if((r=p.firstChild)&&3===r.type)if((o=r.value.replace(k,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i;if((r=p.lastChild)&&3===r.type)if((o=r.value.replace(T,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||E.test(o))&&(r.remove(),r=i),r=i}if(_&&S[n]&&(_=!1),u.removeEmpty&&Cb(e,y,S,p))return a=p.parent,b[p.name]?p.empty().remove():p.unwrap(),void(p=a);u.paddEmpty&&(function(t){return xb(t,"#text")&&t.firstChild.value===wo}(p)||Cb(e,y,S,p))&&wb(t,c,b,p),p=p.parent}}},e),D=p=new Mm(c.context||t.root_name,11);if(A.parse(u,c.format),x&&v.length&&(c.context?c.invalid=!0:function(t){for(var n=kb("tr,td,th,tbody,thead,tfoot,table"),r=e.getNonEmptyElements(),o=e.getWhiteSpaceElements(),i=e.getTextBlockElements(),u=e.getSpecialElements(),c=function(t,n){if(void 0===n&&(n=t.parent),u[t.name])t.empty().remove();else{for(var r=0,o=t.children();r<o.length;r++){var i=o[r];e.isValidChild(n.name,i.name)||c(i,n)}t.unwrap()}},s=0;s<t.length;s++){var l=t[s],f=void 0,d=void 0,m=void 0;if(l.parent&&!l.fixed)if(i[l.name]&&"li"===l.parent.name){for(var g=l.next;g&&i[g.name];)g.name="li",g.fixed=!0,l.parent.insert(g,l.parent),g=g.next;l.unwrap()}else{var h=[l];for(f=l.parent;f&&!e.isValidChild(f.name,l.name)&&!n[f.name];f=f.parent)h.push(f);if(f&&h.length>1)if(e.isValidChild(f.name,l.name)){h.reverse();for(var p=d=a(h[0].clone()),v=0;v<h.length-1;v++){e.isValidChild(p.name,h[v].name)?(m=a(h[v].clone()),p.append(m)):m=p;for(var b=h[v].firstChild;b&&b!==h[v+1];){var y=b.next;m.append(b),b=y}p=m}Cb(e,r,o,d)?f.insert(l,h[0],!0):(f.insert(d,h[0],!0),f.insert(l,d)),f=h[0],(Cb(e,r,o,f)||xb(f,"br"))&&f.empty().remove()}else c(l);else if(l.parent){if("li"===l.name){if((g=l.prev)&&("ul"===g.name||"ol"===g.name)){g.append(l);continue}if((g=l.next)&&("ul"===g.name||"ol"===g.name)){g.insert(l,g.firstChild,!0);continue}l.wrap(a(new Mm("ul",1)));continue}e.isValidChild(l.parent.name,"div")&&e.isValidChild("div",l.name)?l.wrap(a(new Mm("div",1))):c(l)}}}}(v)),C&&("body"===D.name||c.isRootContent)&&function(){var n=D.firstChild,r=null,o=function(t){t&&((n=t.firstChild)&&3===n.type&&(n.value=n.value.replace(k,"")),(n=t.lastChild)&&3===n.type&&(n.value=n.value.replace(T,"")))};if(e.isValidChild(D.name,C.toLowerCase())){for(;n;){var i=n.next;3===n.type||1===n.type&&"p"!==n.name&&!b[n.name]&&!n.attr("data-mce-type")?(r||((r=R(C,1)).attr(t.forced_root_block_attrs),D.insert(r,n)),r.append(n)):(o(r),r=null),n=i}o(r)}}(),!c.invalid){for(h in o)if(wt(o,h)){for(g=n[h],d=(s=o[h]).length;d--;)s[d].parent||s.splice(d,1);for(l=0,f=g.length;l<f;l++)g[l](s,h,c)}for(l=0,f=r.length;l<f;l++)if((g=r[l]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c)}}return D}};return function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,r,o){var i,a,u,c,s,l,f,d,m=t.length,g=_e.extend({},n.getBlockElements()),h=n.getNonEmptyElements(),p=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(u=(a=t[i]).parent,g[a.parent.name]&&a===u.lastChild){for(s=a.prev;s;){if("span"!==(l=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===l&&(a=null);break}s=s.prev}a&&(a.remove(),Cb(n,h,p,u)&&(f=n.getElementRule(u.name))&&(f.removeEmpty?u.remove():f.paddEmpty&&wb(e,o,g,u)))}else{for(c=a;u&&u.firstChild===c&&u.lastChild===c&&(c=u,!g[u.name]);)u=u.parent;c===u&&!0!==e.padd_empty_with_br&&((d=new Mm("#text",3)).value=wo,a.replace(d))}})),t.addAttributeFilter("href",(function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(r=void 0,r=(n=i.attr("rel"))?_e.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(t){return t.split(" ").filter((function(t){return t.length>0})).concat(["noopener"]).sort().join(" ")}(r)))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){for(var e,n,r=t.length;r--;)if("ul"===(n=(e=t[r]).parent).name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new Mm("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){for(var e=n.getValidClasses(),r=t.length;r--;){for(var o=t[r],i=o.attr("class").split(" "),a="",u=0;u<i.length;u++){var c=i[u],s=!1,l=e["*"];l&&l[c]&&(s=!0),l=e[o.name],!s&&l&&l[c]&&(s=!0),s&&(a&&(a+=" "),a+=c)}a.length||(a=null),o.attr("class",a)}})),Sb(t,e)}(u,t),function(t,e){e.inline_styles&&db(t,e)}(u,t),u},Rb=function(t,e,n){return function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events}(t,n)?function(t,e,n){var r,o=t.dom,i=e.cloneNode(!0),a=document.implementation;if(a.createHTMLDocument){var u=a.createHTMLDocument("");_e.each("BODY"===i.nodeName?i.childNodes:[i],(function(t){u.body.appendChild(u.importNode(t,!0))})),i="BODY"!==i.nodeName?u.body.firstChild:u.body,r=o.doc,o.doc=u}return function(t,e){t.fire("PreProcess",e)}(t,Nt(Nt({},n),{node:i})),r&&(o.doc=r),i}(t,e,n):e},Nb=function(t,e,n){-1===_e.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),e.push(n))},Ab=function(t,e,n,r,o){return function(t,e,n){return!e.no_events&&t?function(t,e){return t.fire("PostProcess",e)}(t,Nt(Nt({},e),{content:n})).content:n}(t,o,function(t,e,n){return tg(t,e).serialize(n)}(e,n,r))},Db=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:pu.DOM,o=e&&e.schema?e.schema:Ri(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=_b(t,o);!function(t,e,n){t.addAttributeFilter("data-mce-tabindex",(function(t,e){for(var n=t.length;n--;){var r=t[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(e,null)}})),t.addAttributeFilter("src,href,style",(function(t,r){for(var o="data-mce-"+r,i=e.url_converter,a=e.url_converter_scope,u=t.length;u--;){var c=t[u],s=c.attr(o);void 0!==s?(c.attr(r,s.length>0?s:null),c.attr(o,null)):(s=c.attr(r),"style"===r?s=n.serializeStyle(n.parseStyle(s),c.name):i&&(s=i.call(a,s,r,c.name)),c.attr(r,s.length>0?s:null))}})),t.addAttributeFilter("class",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("class");r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}})),t.addAttributeFilter("data-mce-type",(function(t,e,n){for(var r=t.length;r--;){var o=t[r];"bookmark"!==o.attr("data-mce-type")||n.cleanup||(L.from(o.firstChild).exists((function(t){return!Co(t.value)}))?o.unwrap():o.remove())}})),t.addNodeFilter("noscript",(function(t){for(var e=t.length;e--;){var n=t[e].firstChild;n&&(n.value=yi.decode(n.value))}})),t.addNodeFilter("script,style",(function(t,n){for(var r=function(t){return t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")},o=t.length;o--;){var i=t[o],a=i.firstChild?i.firstChild.value:"";if("script"===n){var u=i.attr("type");u&&i.attr("type","mce-no/type"===u?null:u.replace(/^mce\-/,"")),"xhtml"===e.element_format&&a.length>0&&(i.firstChild.value="// <![CDATA[\n"+r(a)+"\n// ]]>")}else"xhtml"===e.element_format&&a.length>0&&(i.firstChild.value="\x3c!--\n"+r(a)+"\n--\x3e")}})),t.addNodeFilter("#comment",(function(t){for(var r=t.length;r--;){var o=t[r];e.preserve_cdata&&0===o.value.indexOf("[CDATA[")?(o.name="#cdata",o.type=4,o.value=n.decode(o.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===o.value.indexOf("mce:protected ")&&(o.name="#text",o.type=3,o.raw=!0,o.value=unescape(o.value).substr(14))}})),t.addNodeFilter("xml:namespace,input",(function(t,e){for(var n=t.length;n--;){var r=t[n];7===r.type?r.remove():1===r.type&&("input"!==e||r.attr("type")||r.attr("type","text"))}})),t.addAttributeFilter("data-mce-type",(function(e){q(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)}))}(i,t,r);return{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,a){void 0===a&&(a={});var u=Nt({format:"html"},a),c=Rb(e,n,u),s=function(t,e,n){var r=So(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||yo(Ne.fromDom(e))?r:_e.trim(r)}(r,c,u),l=function(t,e,n){var r=n.selection?Nt({forced_root_block:!1},n):n,o=t.parse(e,r);return function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}}(o),o}(i,s,u);return"tree"===u.format?l:Ab(e,t,o,l,u)},addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:_(Nb,i,n),getTempAttrs:T(n),getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},Mb=function(t,e){var n=Db(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},Bb=function(t,e){return void 0===e&&(e={}),function(t,e,n){return Zv(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")},zb=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return Zv(t).editor.setContent(e,n)}(t,e,n)},Pb=pu.DOM,Lb=function(t){return L.from(t).each((function(t){return t.destroy()}))},Ib=function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&Pb.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){Pb.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),Pb.remove(t.getContainer()),Lb(e),Lb(n),t.destroy()}},Hb=function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),Lb(n),Lb(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),Pb.unbind(e,"submit reset",t.formEventDelegate))}(t),function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)}(t),t.destroyed=!0):t.remove())},Fb=(ab=function(t,e){return m(t)&&m(e)?Fb(t,e):e},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)wt(o,i)&&(n[i]=ab(n[i],o[i]))}return n}),Vb="autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),jb="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),Ub="imagetools,toc".split(","),Wb=function(t){var e=K(Vb,(function(e){return wt(t,e)})),n=t.forced_root_block;return!1!==n&&""!==n||e.push("forced_root_block (false only)"),ot(e)},qb=function(t){var e=_e.makeMap(t.plugins," "),n=function(t){return wt(e,t)},r=At(At([],K(jb,n),!0),tt(Ub,(function(t){return n(t)?[t+" (moving to premium)"]:[]})),!0);return ot(r)},$b=ge().deviceType,Gb=$b.isTouch(),Kb=$b.isPhone(),Xb=$b.isTablet(),Yb=["lists","autolink","autosave"],Jb={table_grid:!1,object_resizing:!1,resize:!1},Qb=function(t){var e=g(t)?t.join(" "):t,n=W(d(e)?e.split(" "):[],Ft);return K(n,(function(t){return t.length>0}))},Zb=function(t,e){var n,r,o=(r={},pt(e,(function(e,n){return j(t,n)}),ht(n={}),ht(r)),{t:n,f:r});return function(t,e){return{sections:T(t),settings:T(e)}}(o.t,o.f)},ty=function(t,e){return wt(t.sections(),e)},ey=function(t,e){return yt(t,"toolbar_mode").orThunk((function(){return yt(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},ny=function(t,e){var n={resize:!1,toolbar_mode:ey(t,"scrolling"),toolbar_sticky:!1};return Nt(Nt(Nt({},Jb),n),e?{menubar:!1}:{})},ry=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?_e.extend({},t.external_plugins,n):n},oy=function(t,e,n,r){return t&&function(t,e,n){var r=t.sections();return ty(t,e)&&r[e].theme===n}(e,"mobile","mobile")?K(r,_(j,Yb)):t&&ty(e,"mobile")?r:n},iy=function(t,e,n,r){var o=Qb(n.forced_plugins),i=Qb(r.plugins),a=function(t,e){return ty(t,e)?t.sections()[e]:{}}(e,"mobile"),u=a.plugins?Qb(a.plugins):i,c=function(t,e){return[].concat(Qb(t)).concat(Qb(e))}(o,oy(t,e,i,u));if(Se.browser.isIE()&&j(c,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return _e.extend(r,{plugins:c.join(" ")})},ay=function(t,e,n,r,o){var i=t?{mobile:ny(o.mobile||{},e)}:{},a=Zb(["mobile"],Fb(i,o)),u=_e.extend(n,r,a.settings(),function(t,e){return t&&ty(e,"mobile")}(t,a)?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=yt(r,e).getOr({});return _e.extend({},n,o)}(a,"mobile"):{},{validate:!0,external_plugins:ry(r,a.settings())});return iy(t,a,r,u)},uy=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:ey(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return Nt(Nt({},i),r?Jb:{})}(o,e,n,Gb,t),a=ay(Kb||Xb,Kb,i,r,o);return!1!==a.deprecation_warnings&&function(t,e){var n=Wb(t),r=qb(e),o=r.length>0,i=n.length>0,a="mobile"===e.theme;if(o||i||a){var u="\n- ",c=a?"\n\nThemes:\n- mobile":"",s=o?"\n\nPlugins:\n- "+r.join(u):"",l=i?"\n\nSettings:\n- "+n.join(u):"";console.warn("The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information."+c+s+l)}}(o,a),a},cy=function(t,e,n){return L.from(e.settings[n]).filter(t)},sy=function(t,e,n,r){var o,i=e in t.settings?t.settings[e]:n;return"hash"===r?function(t){var e={};return"string"==typeof t?q(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),(function(t){var n=t.split("=");n.length>1?e[_e.trim(n[0])]=_e.trim(n[1]):e[_e.trim(n[0])]=_e.trim(n[0])})):e=t,e}(i):"string"===r?cy(d,t,e).getOr(n):"number"===r?cy(x,t,e).getOr(n):"boolean"===r?cy(p,t,e).getOr(n):"object"===r?cy(m,t,e).getOr(n):"array"===r?cy(g,t,e).getOr(n):"string[]"===r?cy((o=d,function(t){return g(t)&&et(t,o)}),t,e).getOr(n):"function"===r?cy(w,t,e).getOr(n):i},ly=(ub={},{add:function(t,e){ub[t]=e},get:function(t){return ub[t]?ub[t]:{icons:{}}},has:function(t){return wt(ub,t)}}),fy=function(t,e){return e.dom[t]},dy=function(t,e){return parseInt(ir(e,t),10)},my=_(fy,"clientWidth"),gy=_(fy,"clientHeight"),hy=_(dy,"margin-top"),py=_(dy,"margin-left"),vy=function(t,e,n){var r,o=Ne.fromDom(t.getBody()),i=t.inline?o:(r=o,Ne.fromDom(qe(r).dom.documentElement)),a=function(t,e,n,r){var o=function(t){return t.dom.getBoundingClientRect()}(e);return{x:n-(t?o.left+e.dom.clientLeft+py(e):0),y:r-(t?o.top+e.dom.clientTop+hy(e):0)}}(t.inline,i,e,n);return function(t,e,n){var r=my(t),o=gy(t);return e>=0&&n>=0&&e<=r&&n<=o}(i,a.x,a.y)},by=function(t){var e,n=t.inline?t.getBody():t.getContentAreaContainer();return(e=n,L.from(e).map(Ne.fromDom)).map(yn).getOr(!1)},yy=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},r=function(){return L.from(e[0])},o=function(){e.length>0&&n().reposition(e)},i=function(t){Z(e,(function(e){return e===t})).each((function(t){e.splice(t,1)}))},a=function(a,u){if(void 0===u&&(u=!0),!t.removed&&by(t))return u&&t.fire("BeforeOpenNotification",{notification:a}),Q(e,(function(t){return e=n().getArgs(t),r=a,!(e.type!==r.type||e.text!==r.text||e.progressBar||e.timeout||r.progressBar||r.timeout);var e,r})).getOrThunk((function(){t.editorManager.setActive(t);var u=n().open(a,(function(){i(u),o(),r().fold((function(){return t.focus()}),(function(t){return Ne.fromDom(t.getEl()).dom.focus()}))}));return function(t){e.push(t)}(u),o(),t.fire("OpenNotification",{notification:Nt({},u)}),u}))},u=T(e);return function(t){t.on("SkinLoaded",(function(){var e=function(t){return t.getParam("service_message")}(t);e&&a({text:e,type:"warning",timeout:0},!1),o()})),t.on("show ResizeEditor ResizeWindow NodeChange",(function(){oo.requestAnimationFrame(o)})),t.on("remove",(function(){q(e.slice(),(function(t){n().close(t)}))}))}(t),{open:a,close:function(){r().each((function(t){n().close(t),i(t),o()}))},getNotifications:u}},wy=Ou.PluginManager,xy=Ou.ThemeManager;var Cy=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e?e.apply(t,n):void 0}},o=function(n){e.push(n),function(e){t.fire("OpenWindow",{dialog:e})}(n)},i=function(n){!function(e){t.fire("CloseWindow",{dialog:e})}(n),0===(e=K(e,(function(t){return t!==n}))).length&&t.focus()},a=function(e){t.editorManager.setActive(t),um(t);var n=e();return o(n),n};return t.on("remove",(function(){q(e,(function(t){n().close(t)}))})),{open:function(t,e){return a((function(){return n().open(t,e,i)}))},openUrl:function(t){return a((function(){return n().openUrl(t,i)}))},alert:function(t,e,o){var i=n();i.alert(t,r(o||i,e))},confirm:function(t,e,o){var i=n();i.confirm(t,r(o||i,e))},close:function(){L.from(e[e.length-1]).each((function(t){n().close(t),i(t)}))}}},Sy=function(t,e){t.notificationManager.open({type:"error",text:e})},ky=function(t,e){t._skinLoaded?Sy(t,e):t.on("SkinLoaded",(function(){Sy(t,e)}))},Ty=function(t,e,n){nd(t,e,{message:n}),console.error(n)},Oy=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},Ey=function(t,e,n){Ty(t,"PluginLoadError",Oy("plugin",e,n))},_y=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,At([t],e,!1)):r.log.apply(r,At([t],e,!1)))},Ry=function(t){return Ny(t,function(t){var e=t.getParam("content_css");return d(e)?W(e.split(","),Ft):g(e)?e:!1===e||t.inline?[]:["default"]}(t))},Ny=function(t,e){var n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return W(e,(function(e){return function(t){return/^[a-z0-9\-]+$/i.test(t)}(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)}))},Ay=function(t){t.contentCSS=t.contentCSS.concat(Ry(t),function(t){return Ny(t,hs(t))}(t))},Dy=function(){var t={},e=function(t,e){return{status:t,resultUri:e}},n=function(e){return e in t};return{hasBlobUri:n,getResultUri:function(e){var n=t[e];return n?n.resultUri:null},isPending:function(e){return!!n(e)&&1===t[e].status},isUploaded:function(e){return!!n(e)&&2===t[e].status},markPending:function(n){t[n]=e(1,null)},markUploaded:function(n,r){t[n]=e(2,r)},removeFailed:function(e){delete t[e]},destroy:function(){t={}}}},My=0,By=function(t){return t+My+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e},zy=function(t,e){var n={},r=function(t,n,r,o){var i=new XMLHttpRequest;i.open("POST",e.url),i.withCredentials=e.credentials,i.upload.onprogress=function(t){o(t.loaded/t.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){if(i.status<200||i.status>=300)r("HTTP Error: "+i.status);else{var t,o,a=JSON.parse(i.responseText);if(a&&"string"==typeof a.location)n((t=e.basePath,o=a.location,t?t.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o));else r("Invalid JSON: "+i.responseText)}};var a=new FormData;a.append("file",t.blob(),t.filename()),i.send(a)},o=function(t,e){return{url:e,blobInfo:t,status:!0}},i=function(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}},a=function(t,e){_e.each(n[t],(function(t){t(e)})),delete n[t]},u=function(r,u){return r=_e.grep(r,(function(e){return!t.isUploaded(e.blobUri())})),to.all(_e.map(r,(function(r){return t.isPending(r.blobUri())?function(t){var e=t.blobUri();return new to((function(t){n[e]=n[e]||[],n[e].push(t)}))}(r):function(e,n,r){return t.markPending(e.blobUri()),new to((function(u){var c;try{var s=function(){c&&c.close()};n(e,(function(n){s(),t.markUploaded(e.blobUri(),n),a(e.blobUri(),o(e,n)),u(o(e,n))}),(function(n,r){var o=r||{};s(),t.removeFailed(e.blobUri()),a(e.blobUri(),i(e,n,o)),u(i(e,n,o))}),(function(t){t<0||t>100||L.from(c).orThunk((function(){return L.from(r).map(N)})).each((function(e){c=e,e.progressBar.value(t)}))}))}catch(t){u(i(e,t.message,{}))}}))}(r,e.handler,u)})))};return!1===w(e.handler)&&(e.handler=r),{upload:function(t,n){return e.url||e.handler!==r?u(t,n):new to((function(t){t([])}))}}},Py=function(t){return function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}},Ly=function(t,e){return zy(e,{url:us(t),basePath:cs(t),credentials:ss(t),handler:ls(t)})},Iy=function(t){var e,n,r=function(){var t=[],e=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e,n=t.id||By("blobid"),r=t.name||n,o=t.blob;return{id:T(n),name:T(r),filename:T(t.filename||r+"."+(e=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[e.toLowerCase()]||"dat")),blob:T(o),base64:T(t.base64),blobUri:T(t.blobUri||URL.createObjectURL(o)),uri:T(t.uri)}},n=function(e){return Q(t,e).getOrUndefined()},r=function(t){return n((function(e){return e.id()===t}))};return{create:function(t,n,r,o,i){if(d(t))return e({id:t,name:o,filename:i,blob:n,base64:r});if(m(t))return e(t);throw new Error("Unknown input type")},add:function(e){r(e.id())||t.push(e)},get:r,getByUri:function(t){return n((function(e){return e.blobUri()===t}))},getByData:function(t,e){return n((function(n){return n.base64()===t&&n.blob().type===e}))},findFirst:n,removeByUri:function(e){t=K(t,(function(t){return t.blobUri()!==e||(URL.revokeObjectURL(t.blobUri()),!1)}))},destroy:function(){q(t,(function(t){URL.revokeObjectURL(t.blobUri())})),t=[]}}}(),o=Dy(),i=[],a=function(t){var e=xu(null);return t.on("change AddUndo",(function(t){e.set(Nt({},t.level))})),{fireIfChanged:function(){var n=t.undoManager.data;ut(n).filter((function(t){return!$v(e.get(),t)})).each((function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:it(n,n.length-2).getOrNull()})}))}}}(t),u=function(e){return function(n){return t.selection?e(n):[]}},c=function(t,e,n){var r=0;do{-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},s=function(t,e,n){var r='src="'+n+'"'+(n===Se.transparentSrc?' data-mce-placeholder="1"':"");return t=c(t,'src="'+e+'"',r),t=c(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},l=function(e,n){q(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=W(t.fragments,(function(t){return s(t,e,n)})):t.content=s(t.content,e,n)}))},f=function(n){return e||(e=Ly(t,o)),p().then(u((function(o){var i=W(o,(function(t){return t.blobInfo}));return e.upload(i,Py(t)).then(u((function(e){var i=[],u=W(e,(function(e,n){var a=o[n].blobInfo,u=o[n].image;return e.status&&function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(r.removeByUri(u.src),Jv(t)||function(e,n){var r,o=t.convertURL(n,"src");l(e.src,n),t.$(e).attr({src:is(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})}(u,e.url)):e.error&&(e.error.options.remove&&(l(u.getAttribute("src"),Se.transparentSrc),i.push(u)),function(t,e){ky(t,Tu.translate(["Failed to upload image: {0}",e]))}(t,e.error.message)),{element:u,status:e.status,uploadUri:e.url,blobInfo:a}}));return u.length>0&&a.fireIfChanged(),i.length>0&&(Jv(t)?console.error("Removing images on failed uploads is currently unsupported for RTC"):t.undoManager.transact((function(){q(i,(function(e){t.dom.remove(e),r.removeByUri(e.src)}))}))),n&&n(u),u})))})))},g=function(e){if(os(t))return f(e)},h=function(e){return!1!==et(i,(function(t){return t(e)}))&&(0!==e.getAttribute("src").indexOf("data:")||function(t){return t.getParam("images_dataimg_filter",M,"function")}(t)(e))},p=function(){return n||(n=yb(o,r)),n.findAll(t.getBody(),h).then(u((function(e){return e=K(e,(function(e){return"string"!=typeof e||(ky(t,e),!1)})),Jv(t)||q(e,(function(t){l(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},v=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var i=o.getResultUri(n);if(i)return'src="'+i+'"';var a=r.getByUri(n);return a||(a=Y(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null)),a?'src="data:'+a.blob().type+";base64,"+a.base64()+'"':e}))};return t.on("SetContent",(function(){os(t)?g():p()})),t.on("RawSaveContent",(function(t){t.content=v(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=v(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){q(t,(function(t){var e=t.attr("src");if(!r.getByUri(e)){var n=o.getResultUri(e);n&&t.attr("src",n)}}))}))})),{blobCache:r,addFilter:function(t){i.push(t)},uploadImages:f,uploadImagesAuto:g,scanForImages:p,destroy:function(){r.destroy(),o.destroy(),n=e=null}}},Hy=function(t){var e={},n=function(t,r){t&&(d(t)?(g(r)||(r=[r]),q(r,(function(t){v(t.deep)&&(t.deep=!hf(t)),v(t.split)&&(t.split=!hf(t)||pf(t)),v(t.remove)&&hf(t)&&!pf(t)&&(t.remove="none"),hf(t)&&pf(t)&&(t.mixed=!0,t.block_expand=!0),d(t.classes)&&(t.classes=t.classes.split(/\s+/))})),e[t]=r):dt(t,(function(t,e){n(e,t)})))};return n(function(t){var e={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(t,e,n){return An(t)&&t.hasAttribute("href")},onformat:function(e,n,r){_e.each(r,(function(n,r){t.setAttrib(e,r,n)}))}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(t){var e;return null!==(e=null==t?void 0:t.customValue)&&void 0!==e?e:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return _e.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(function(t){e[t]={block:t,remove:"all"}})),e}(t.dom)),n(function(t){return t.getParam("formats")}(t)),{get:function(t){return y(t)?e[t]:e},has:function(t){return wt(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}},Fy=_e.each,Vy=pu.DOM,jy=function(t,e){var n,r,o,i=e&&e.schema||Ri({}),a=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=Vy.create(r.name);return function(t,e){e.classes.length&&Vy.addClass(t,e.classes.join(" ")),Vy.setAttribs(t,e.attrs)}(e,r),e},u=function(t,e,n){var r,o,c=e.length>0&&e[0],s=c&&c.name,l=function(t,e){var n="string"!=typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==_e.inArray(o,e)?e:o[0])}(t,s);if(l)s===l?(o=e[0],e=e.slice(1)):o=l;else if(c)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=a(o)).appendChild(t),n&&(r||(r=Vy.create("div")).appendChild(t),_e.each(n,(function(e){var n=a(e);r.insertBefore(n,t)}))),u(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=a(r),(o=Vy.create("div")).appendChild(u(n,t.slice(1),r.siblings)),o):""},Uy=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=_e.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==_e.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var a=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);a&&(n.attrs[a[1]]=a[2])}return""}))),n.name=e||"div",n},Wy=function(t,e){var n,r,o,i="",a=function(t){var e=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return d(e)?e:""}(t);if(""===a)return"";var u=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var c=yt(e,"preview");if(Xn(c,!1))return"";a=c.getOr(a)}n=e.block||e.inline||"span";var s,l=(s=e.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),_e.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=_e.map(t.split(/(?:~\+|~|\+)/),Uy),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[];l.length?(l[0].name||(l[0].name=n),n=e.selector,r=jy(l,t)):r=jy([n],t);var f=Vy.select(n,r)[0]||r.firstChild;return Fy(e.styles,(function(t,e){var n=u(t);n&&Vy.setStyle(f,e,n)})),Fy(e.attributes,(function(t,e){var n=u(t);n&&Vy.setAttrib(f,e,n)})),Fy(e.classes,(function(t){var e=u(t);Vy.hasClass(f,e)||Vy.addClass(f,e)})),t.fire("PreviewFormats"),Vy.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=Vy.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Fy(a.split(" "),(function(e){var n=Vy.getStyle(f,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Vy.getStyle(t.getBody(),e,!0),"#ffffff"===Vy.toHex(n).toLowerCase())||"color"===e&&"#000000"===Vy.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),Vy.remove(r),i},qy=function(t){var e=Hy(t),n=xu(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),Dp(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){tb(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){tb(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){tb(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:function(e,n,r,o){return function(t,e,n,r,o){return tb(t).formatter.match(e,n,r,o)}(t,e,n,r,o)},closest:function(e){return function(t,e){return tb(t).formatter.closest(e)}(t,e)},matchAll:function(e,n){return function(t,e,n){return tb(t).formatter.matchAll(e,n)}(t,e,n)},matchNode:function(e,n,r,o){return function(t,e,n,r,o){return tb(t).formatter.matchNode(e,n,r,o)}(t,e,n,r,o)},canApply:function(e){return function(t,e){return tb(t).formatter.canApply(e)}(t,e)},formatChanged:function(e,r,o,i){return function(t,e,n,r,o,i){return tb(t).formatter.formatChanged(e,n,r,o,i)}(t,n,e,r,o,i)},getCssText:_(Wy,t)}},$y=function(t){switch(t.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return!0;default:return!1}},Gy=function(t){var e=Eu(),n=xu(0),r=xu(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){tb(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,a){return function(t,e,n,r,o,i,a){return tb(t).undoManager.add(e,n,r,o,i,a)}(t,o,r,n,e,i,a)},undo:function(){return function(t,e,n,r){return tb(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return tb(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){tb(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){tb(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return tb(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return tb(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return tb(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){tb(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){tb(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return Jv(t)||function(t,e,n){var r=xu(!1),o=function(t){Kv(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command;$y(r)||(Xv(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command;$y(e)||o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===$v(jv(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var a=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||a||(e.beforeChange(),Kv(e,!0,n),e.add({},t),r.set(!0))}})),t.on("mousedown",(function(t){e.typing&&o(t)})),t.on("input",(function(t){var e;t.inputType&&("insertReplacementText"===t.inputType||"insertText"===(e=t).inputType&&null===e.data||function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType}(t))&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))}(t,o,n),function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")}(t),o},Ky=[9,27,id.HOME,id.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,id.DOWN,id.UP,id.LEFT,id.RIGHT].concat(Se.browser.isFirefox()?[224]:[]),Xy="data-mce-placeholder",Yy=function(t){return"keydown"===t.type||"keyup"===t.type},Jy=function(t){var e=t.keyCode;return e===id.BACKSPACE||e===id.DELETE},Qy=function(t){var e=t.dom,n=ns(t),r=function(t){return t.getParam("placeholder",Zc.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function(i,a){if(!function(t){if(Yy(t)){var e=t.keyCode;return!Jy(t)&&(id.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||j(Ky,e))}return!1}(i)){var u=t.getBody(),c=!function(t){return Yy(t)&&!(Jy(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(ei(Ne.fromDom(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(e,u,n);(""!==e.getAttrib(u,Xy)!==c||a)&&(e.setAttrib(u,Xy,c?r:null),e.setAttrib(u,"aria-placeholder",c?r:null),function(t,e){t.fire("PlaceholderToggle",{state:e})}(t,c),t.on(c?"keydown":"keyup",o),t.off(c?"keyup":"keydown",o))}};r&&t.on("init",(function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",(function(e){return oo.setEditorTimeout(t,(function(){return o(e)}))}))}))},Zy=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,tw=function(t,e){return De(Ne.fromDom(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},ew=function(t){return"rtl"===pu.DOM.getStyle(t,"direction",!0)||(e=t.textContent,Zy.test(e));var e},nw=function(t,e,n){var r=function(t,e,n){return K(pu.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return L.from(r[r.length-1])},rw=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?Eo(n)?Hn(n.nextSibling)?Rc(n.nextSibling,0):Rc.after(n):No(e)?Rc(n,r+1):e:Eo(n)?Hn(n.previousSibling)?Rc(n.previousSibling,n.previousSibling.data.length):Rc.before(n):Ao(e)?Rc(n,r-1):e},ow=_(rw,!0),iw=_(rw,!1),aw=function(t){return go(t)||po(t)},uw=function(t,e){return Pe(t,e)?Xr(e,aw,function(t){return function(e){return Be(t,Ne.fromDom(e.dom.parentNode))}}(t)):L.none()},cw=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)}(t))},sw=function(t,e){return{from:t,to:e}},lw=function(t,e){var n=Ne.fromDom(t),r=Ne.fromDom(e.container());return uw(n,r).map((function(t){return function(t,e){return{block:t,position:e}}(t,e)}))},fw=function(t,e,n){var r=lw(t,Rc.fromRangeStart(n)),o=r.bind((function(n){return Rl(e,t,n.position).bind((function(n){return lw(t,n).map((function(n){return function(t,e,n){return Un(n.position.getNode())&&!1===ei(n.block)?Dl(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?Rl(e,t,r).bind((function(e){return lw(t,e)})):L.some(n)})).getOr(n):n}(t,e,n)}))}))}));return Yn(r,o,sw).filter((function(t){return function(t){return!1===Be(t.from.block,t.to.block)}(t)&&function(t){return Ge(t.from.block).bind((function(e){return Ge(t.to.block).filter((function(t){return Be(e,t)}))})).isSome()}(t)&&function(t){return!1===$n(t.from.block.dom)&&!1===$n(t.to.block.dom)}(t)}))},dw=function(t){var e=Qe(t);return Z(e,lo).fold(T(e),(function(t){return e.slice(0,t)}))},mw=function(t){var e=dw(t);return q(e,vn),e},gw=function(t,e){var n=Og(e,t);return Q(n.reverse(),(function(t){return ei(t)})).each(vn)},hw=function(t,e,n,r){if(ei(n))return Cg(n),zl(n.dom);0===K(Ye(r),(function(t){return!ei(t)})).length&&ei(e)&&fn(r,Ne.fromTag("br"));var o=Bl(n.dom,Rc.before(r.dom));return q(mw(e),(function(t){fn(r,t)})),gw(t,e),o},pw=function(t,e,n){if(ei(n))return vn(n),ei(e)&&Cg(e),zl(e.dom);var r=Pl(n.dom);return q(mw(e),(function(t){gn(n,t)})),gw(t,e),r},vw=function(t,e){return Pe(e,t)?function(t,e){var n=Og(e,t);return L.from(n[n.length-1])}(e,t):L.none()},bw=function(t,e){Dl(t,e.dom).map((function(t){return t.getNode()})).map(Ne.fromDom).filter(mo).each(vn)},yw=function(t,e,n){return bw(!0,e),bw(!1,n),vw(e,n).fold(_(pw,t,e,n),_(hw,t,e,n))},ww=function(t,e,n,r){return e?yw(t,r,n):yw(t,n,r)},xw=function(t,e){var n=Ne.fromDom(t.getBody()),r=function(t,e,n){return n.collapsed?fw(t,e,n):L.none()}(n.dom,e,t.selection.getRng()).bind((function(t){return ww(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},Cw=function(t,e){var n=Ne.fromDom(e),r=_(Be,t);return Kr(n,bo,r).isSome()},Sw=function(t,e){var n=Bl(t.dom,Rc.fromRangeStart(e)).isNone(),r=Ml(t.dom,Rc.fromRangeEnd(e)).isNone();return!function(t,e){return Cw(t,e.startContainer)||Cw(t,e.endContainer)}(t,e)&&n&&r},kw=function(t){var e=Ne.fromDom(t.getBody()),n=t.selection.getRng();return Sw(e,n)?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return Yn(uw(t,Ne.fromDom(n.startContainer)),uw(t,Ne.fromDom(n.endContainer)),(function(r,o){return!1===Be(r,o)&&(n.deleteContents(),ww(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)}(e,t.selection)},Tw=function(t,e){return!t.selection.isCollapsed()&&kw(t)},Ow=qn,Ew=$n,_w=function(t,e,n,r,o){return L.from(e._selectionOverrides.showCaret(t,n,r,o))},Rw=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?L.none():L.some(function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e))},Nw=function(t,e,n){var r=ul(1,t.getBody(),e),o=Rc.fromRangeStart(r),i=o.getNode();if(Fs(i))return _w(1,t,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(Fs(a))return _w(1,t,a,!1,!1);var u=t.dom.getParent(o.getNode(),(function(t){return Ew(t)||Ow(t)}));return Fs(u)?_w(1,t,u,!1,n):L.none()},Aw=function(t,e,n){return e.collapsed?Nw(t,e,n).getOr(e):e},Dw=function(t){return yg(t)||hg(t)},Mw=function(t){return wg(t)||pg(t)},Bw=function(t,e,n,r,o,i){return _w(r,t,i.getNode(!o),o,!0).each((function(n){if(e.collapsed){var r=e.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()}else e.deleteContents();t.selection.setRng(n)})),function(t,e){Hn(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},zw=function(t,e){return function(t,e){var n=t.selection.getRng();if(!Hn(n.commonAncestorContainer))return!1;var r=e?Nc.Forwards:Nc.Backwards,o=kl(t.getBody()),i=_(fl,e?o.next:o.prev),a=e?Dw:Mw,u=sl(r,t.getBody(),n),c=rw(e,i(u));if(!c||!dl(u,c))return!1;if(a(c))return Bw(t,n,u.getNode(),r,e,c);var s=i(c);return!!(s&&a(s)&&dl(c,s))&&Bw(t,n,u.getNode(),r,e,s)}(t,e)},Pw=Tr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Lw=function(t,e,n,r){var o=r.getNode(!1===e);return uw(Ne.fromDom(t),Ne.fromDom(n.getNode())).map((function(t){return ei(t)?Pw.remove(t.dom):Pw.moveToElement(o)})).orThunk((function(){return L.some(Pw.moveToElement(o))}))},Iw=function(t,e,n){return Rl(e,t,n).bind((function(r){return o=r.getNode(),bo(Ne.fromDom(o))||po(Ne.fromDom(o))||function(t,e,n,r){var o=function(e){return fo(Ne.fromDom(e))&&!tl(n,r,t)};return cl(!e,n).fold((function(){return cl(e,r).fold(D,o)}),o)}(t,e,n,r)?L.none():e&&$n(r.getNode())||!1===e&&$n(r.getNode(!0))?Lw(t,e,n,r):e&&wg(n)||!1===e&&yg(n)?L.some(Pw.moveToPosition(r)):L.none();var o}))},Hw=function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return An(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&$n(e.nextSibling)?L.some(Pw.moveToElement(e.nextSibling)):!1===t&&$n(e.previousSibling)?L.some(Pw.moveToElement(e.previousSibling)):L.none()}(e,n.getNode(!1===e)).fold((function(){return Iw(t,e,n)}),L.some):Iw(t,e,n).bind((function(e){return function(t,e,n){return n.fold((function(t){return L.some(Pw.remove(t))}),(function(t){return L.some(Pw.moveToElement(t))}),(function(n){return tl(e,n,t)?L.none():L.some(Pw.moveToPosition(n))}))}(t,n,e)}))},Fw=function(t,e){return L.from(td(t.getBody(),e))},Vw=function(t,e){var n=t.selection.getNode();return Fw(t,n).filter($n).fold((function(){return function(t,e,n){var r=ul(e?1:-1,t,n),o=Rc.fromRangeStart(r),i=Ne.fromDom(t);return!1===e&&wg(o)?L.some(Pw.remove(o.getNode(!0))):e&&yg(o)?L.some(Pw.remove(o.getNode())):!1===e&&yg(o)&&Ig(i,o)?Hg(i,o).map((function(t){return Pw.remove(t.getNode())})):e&&wg(o)&&Lg(i,o)?Fg(i,o).map((function(t){return Pw.remove(t.getNode())})):Hw(t,e,o)}(t.getBody(),e,t.selection.getRng()).exists((function(n){return n.fold(function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),hh(t,e,Ne.fromDom(n)),!0}}(t,e),function(t,e){return function(n){var r=e?Rc.before(n):Rc.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))}))}),M)},jw=function(t,e){var n=t.selection.getNode();return!(!$n(n)||Gn(n))&&Fw(t,n.parentNode).filter($n).fold((function(){var n;return n=Ne.fromDom(t.getBody()),q(Iu(n,".mce-offscreen-selection"),vn),hh(t,e,Ne.fromDom(t.selection.getNode())),cw(t),!0}),M)},Uw=function(t){var e=t.dom,n=t.selection,r=td(t.getBody(),n.getNode());if(qn(r)&&e.isBlock(r)&&e.isEmpty(r)){var o=e.create("br",{"data-mce-bogus":"1"});e.setHTML(r,""),r.appendChild(o),n.setRng(Rc.before(o).toRange())}return!0},Ww=function(t,e){return t.selection.isCollapsed()?Vw(t,e):jw(t,e)},qw=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=Rc.fromRangeStart(t.selection.getRng());return Rl(e,t.getBody(),n).filter((function(t){return e?mg(t):gg(t)})).bind((function(t){return L.from(el(e?0:-1,t))})).exists((function(e){return t.selection.select(e),!0}))}(t,e)},$w=Hn,Gw=function(t){return $w(t)&&t.data[0]===xo},Kw=function(t){return $w(t)&&t.data[t.data.length-1]===xo},Xw=function(t){return t.ownerDocument.createTextNode(xo)},Yw=function(t,e){return t?function(t){if($w(t.previousSibling))return Kw(t.previousSibling)||t.previousSibling.appendData(xo),t.previousSibling;if($w(t))return Gw(t)||t.insertData(0,xo),t;var e=Xw(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if($w(t.nextSibling))return Gw(t.nextSibling)||t.nextSibling.insertData(0,xo),t.nextSibling;if($w(t))return Kw(t)||t.appendData(xo),t;var e=Xw(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},Jw=_(Yw,!0),Qw=_(Yw,!1),Zw=function(t,e){return Hn(t.container())?Yw(e,t.container()):Yw(e,t.getNode())},tx=function(t,e){var n=e.get();return n&&t.container()===n&&Eo(n)},ex=function(t,e){return e.fold((function(e){Ds(t.get());var n=Jw(e);return t.set(n),L.some(Rc(n,n.length-1))}),(function(e){return zl(e).map((function(e){if(tx(e,t))return Rc(t.get(),1);Ds(t.get());var n=Zw(e,!0);return t.set(n),Rc(n,1)}))}),(function(e){return Pl(e).map((function(e){if(tx(e,t))return Rc(t.get(),t.get().length-1);Ds(t.get());var n=Zw(e,!1);return t.set(n),Rc(n,n.length-1)}))}),(function(e){Ds(t.get());var n=Qw(e);return t.set(n),L.some(Rc(n,1))}))},nx=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return L.none()},rx=Tr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),ox=function(t,e){var n=Zs(e,t);return n||t},ix=function(t,e,n){var r=ow(n),o=ox(e,r.container());return nw(t,o,r).fold((function(){return Ml(o,r).bind(_(nw,t,o)).map((function(t){return rx.before(t)}))}),L.none)},ax=function(t,e){return null===Hl(t,e)},ux=function(t,e,n){return nw(t,e,n).filter(_(ax,e))},cx=function(t,e,n){var r=iw(n);return ux(t,e,r).bind((function(t){return Bl(t,r).isNone()?L.some(rx.start(t)):L.none()}))},sx=function(t,e,n){var r=ow(n);return ux(t,e,r).bind((function(t){return Ml(t,r).isNone()?L.some(rx.end(t)):L.none()}))},lx=function(t,e,n){var r=iw(n),o=ox(e,r.container());return nw(t,o,r).fold((function(){return Bl(o,r).bind(_(nw,t,o)).map((function(t){return rx.after(t)}))}),L.none)},fx=function(t){return!1===ew(mx(t))},dx=function(t,e,n){return nx([ix,cx,sx,lx],[t,e,n]).filter(fx)},mx=function(t){return t.fold(O,O,O,O)},gx=function(t){return t.fold(T("before"),T("start"),T("end"),T("after"))},hx=function(t){return t.fold(rx.before,rx.before,rx.after,rx.after)},px=function(t){return t.fold(rx.start,rx.start,rx.end,rx.end)},vx=function(t,e,n,r,o,i){return Yn(nw(e,n,r),nw(e,n,o),(function(e,r){return e!==r&&function(t,e,n){var r=Zs(e,t),o=Zs(n,t);return r&&r===o}(n,e,r)?rx.after(t?e:r):i})).getOr(i)},bx=function(t,e){return t.fold(M,(function(t){return r=e,!(gx(n=t)===gx(r)&&mx(n)===mx(r));var n,r}))},yx=function(t,e){return t?e.fold(S(L.some,rx.start),L.none,S(L.some,rx.after),L.none):e.fold(L.none,S(L.some,rx.before),L.none,S(L.some,rx.end))},wx=function(t,e,n,r){var o=rw(t,r),i=dx(e,n,o);return dx(e,n,o).bind(_(yx,t)).orThunk((function(){return function(t,e,n,r,o){var i=rw(t,o);return Rl(t,n,i).map(_(rw,t)).fold((function(){return r.map(hx)}),(function(o){return dx(e,n,o).map(_(vx,t,e,n,i,o)).filter(_(bx,r))})).filter(fx)}(t,e,n,i,r)}))};_(wx,!1),_(wx,!0);var xx,Cx=function(t,e,n){var r=t?1:-1;return e.setRng(Rc(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0},Sx=function(t,e){var n=e.selection.getRng(),r=t?Rc.fromRangeEnd(n):Rc.fromRangeStart(n);return!!function(t){return w(t.selection.getSel().modify)}(e)&&(t&&No(r)?Cx(!0,e.selection,r):!(t||!Ao(r))&&Cx(!1,e.selection,r))};!function(t){t[t.Br=0]="Br",t[t.Block=1]="Block",t[t.Wrap=2]="Wrap",t[t.Eol=3]="Eol"}(xx||(xx={}));var kx,Tx=function(t,e){return t===Nc.Backwards?nt(e):e},Ox=function(t,e,n){return t===Nc.Forwards?e.next(n):e.prev(n)},Ex=function(t,e,n,r){return Un(r.getNode(e===Nc.Forwards))?xx.Br:!1===tl(n,r)?xx.Block:xx.Wrap},_x=function(t,e,n,r){for(var o=kl(n),i=r,a=[];i;){var u=Ox(e,o,i);if(!u)break;if(Un(u.getNode(!1)))return e===Nc.Forwards?{positions:Tx(e,a).concat([u]),breakType:xx.Br,breakAt:L.some(u)}:{positions:Tx(e,a),breakType:xx.Br,breakAt:L.some(u)};if(u.isVisible()){if(t(i,u)){var c=Ex(0,e,i,u);return{positions:Tx(e,a),breakType:c,breakAt:L.some(u)}}a.push(u),i=u}else i=u}return{positions:Tx(e,a),breakType:xx.Eol,breakAt:L.none()}},Rx=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===Nc.Backwards?o.concat(r):[r].concat(o)})).getOr([])},Nx=function(t,e){return Y(t,(function(t,n){return t.fold((function(){return L.some(n)}),(function(r){return Yn(at(r.getClientRects()),at(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r})).or(t)}))}),L.none())},Ax=function(t,e){return at(e.getClientRects()).bind((function(e){return Nx(t,e.left)}))},Dx=_(_x,Rc.isAbove,-1),Mx=_(_x,Rc.isBelow,1),Bx=_(Rx,-1,Dx),zx=_(Rx,1,Mx),Px=function(t){var e=function(e){return W(e,(function(e){var n=ec(e);return n.node=t,n}))};if(An(t))return e(t.getClientRects());if(Hn(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},Lx=function(t){return tt(t,Px)};!function(t){t[t.Up=-1]="Up",t[t.Down=1]="Down"}(kx||(kx={}));var Ix,Hx,Fx=function(t,e,n,r,o,i){var a=0,u=[],c=function(r){var i=Lx([r]);-1===t&&(i=i.reverse());for(var c=0;c<i.length;c++){var l=i[c];if(!n(l,s)){if(u.length>0&&e(l,Rt(u))&&a++,l.line=a,o(l))return!0;u.push(l)}}},s=Rt(i.getClientRects());if(!s)return u;var l=i.getNode();return c(l),function(t,e,n,r){for(;r=Qs(r,t,Go,e);)if(n(r))return}(t,r,c,l),u},Vx=_(Fx,kx.Up,oc,ic),jx=_(Fx,kx.Down,ic,oc),Ux=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},Wx=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},qx=$n,$x=Qs,Gx=function(t,e){return Math.abs(t.left-e)},Kx=function(t,e){return Math.abs(t.right-e)},Xx=function(t,e){return t>=e.left&&t<=e.right},Yx=function(t,e){return t>=e.top&&t<=e.bottom},Jx=function(t,e,n){return void 0===n&&(n=M),Et(t,(function(t,r){if(Xx(e,r))return n(r)?r:t;if(Xx(e,t))return n(t)?t:r;var o=Math.min(Gx(t,e),Kx(t,e)),i=Math.min(Gx(r,e),Kx(r,e));return i===o&&xt(r,"node")&&qx(r.node)||i<o?r:t}))},Qx=function(t,e,n,r,o){var i=$x(r,t,Go,e,!o);do{if(!i||n(i))return}while(i=$x(i,t,Go,e))},Zx=function(t,e,n){var r=Lx(function(t){return K(ct(t.getElementsByTagName("*")),Vs)}(t)),o=K(r,_(Yx,n)),i=function(t){return!Pn(t.node)&&!Kn(t.node)},a=Jx(o,e,i);if(a){var u=i(a);if((a=Jx(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=K(Lx([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),Qx(kx.Up,t,_(o,oc),e.node,n),Qx(kx.Down,t,_(o,ic),e.node,n),r}(t,a,u),e,i))&&Vs(a.node))return function(t,e){return{node:t.node,before:Gx(t,e)<Kx(t,e)}}(a,e)}return null},tC=function(t,e){t.selection.setRng(e),Wd(t,t.selection.getRng())},eC=function(t,e,n){return L.some(Aw(t,e,n))},nC=function(t,e,n,r,o,i){var a=e===Nc.Forwards,u=kl(t.getBody()),c=_(fl,a?u.next:u.prev),s=a?r:o;if(!n.collapsed){var l=uc(n);if(i(l))return _w(e,t,l,e===Nc.Backwards,!1)}var f=sl(e,t.getBody(),n);if(s(f))return Rw(t,f.getNode(!a));var d=rw(a,c(f)),m=Po(n);if(!d)return m?L.some(n):L.none();if(s(d))return _w(e,t,d.getNode(!a),a,!1);var g=c(d);return g&&s(g)&&dl(d,g)?_w(e,t,g.getNode(!a),a,!1):m?eC(t,d.toRange(),!1):L.none()},rC=function(t,e,n,r,o,i){var a=sl(e,t.getBody(),n),u=Rt(a.getClientRects()),c=e===kx.Down;if(!u)return L.none();var s,l=(c?jx:Vx)(t.getBody(),Ux(1),a),f=K(l,Wx(1)),d=u.left,m=Jx(f,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),h=Math.abs(d-m.right);return _w(e,t,m.node,g<h,!1)}if(s=r(a)?a.getNode():o(a)?a.getNode(!0):uc(n)){var p=function(t,e,n,r){var o,i,a,u,c=kl(e),s=[],l=0,f=function(t){return Rt(t.getClientRects())};1===t?(o=c.next,i=ic,a=oc,u=Rc.after(r)):(o=c.prev,i=oc,a=ic,u=Rc.before(r));var d=f(u);do{if(u.isVisible()){var m=f(u);if(!a(m,d)){s.length>0&&i(m,Rt(s))&&l++;var g=ec(m);if(g.position=u,g.line=l,n(g))return s;s.push(g)}}}while(u=o(u));return s}(e,t.getBody(),Ux(1),s),v=Jx(K(p,Wx(1)),d);if(v)return eC(t,v.position.toRange(),!1);if(v=Rt(K(p,Wx(0))))return eC(t,v.position.toRange(),!1)}return 0===f.length?oC(t,c).filter(c?o:r).map((function(e){return Aw(t,e.toRange(),!1)})):L.none()},oC=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=Rc.fromRangeEnd(n),i=Mx(r,o);return ut(i.positions)}o=Rc.fromRangeStart(n),i=Dx(r,o);return at(i.positions)},iC=function(t,e,n){return oC(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))},aC=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},uC=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},cC=function(t,e,n){return ex(e,n).map((function(e){return aC(t,e),n}))},sC=function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=Rc.fromRangeStart(t.selection.getRng());Rc.isTextPosition(n)&&!1===function(t){return No(t)||Ao(t)}(n)&&(aC(t,As(e.get(),n)),e.set(null))}},lC=function(t,e,n){return!!ws(t)&&function(t,e,n){var r=t.getBody(),o=Rc.fromRangeStart(t.selection.getRng()),i=_(tw,t);return wx(n,i,r,o).bind((function(n){return cC(t,e,n)}))}(t,e,n).isSome()},fC=function(t,e,n){return!!ws(e)&&Sx(t,e)},dC=function(t){var e=xu(null),n=_(tw,t);return t.on("NodeChange",(function(r){!ws(t)||Se.browser.isIE()&&r.initial||(function(t,e,n){var r=W(Iu(Ne.fromDom(e.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom})),o=K(r,t),i=K(n,t);q(rt(o,i),_(uC,!1)),q(rt(i,o),_(uC,!0))}(n,t.dom,r.parents),sC(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=K(r,t);q(o,(function(r){var o=Rc.fromRangeStart(e.selection.getRng());dx(t,e.getBody(),o).bind((function(t){return cC(e,n,t)}))}))}}(n,t,e,r.parents))})),e},mC=_(fC,!0),gC=_(fC,!1),hC=function(t,e,n){if(ws(t)){var r=oC(t,e).getOrThunk((function(){var n=t.selection.getRng();return e?Rc.fromRangeEnd(n):Rc.fromRangeStart(n)}));return dx(_(tw,t),t.getBody(),r).exists((function(e){var r=hx(e);return ex(n,r).exists((function(e){return aC(t,e),!0}))}))}return!1},pC=function(t,e){return function(n){return ex(e,n).exists((function(e){return aC(t,e),!0}))}},vC=function(t,e,n,r){var o=t.getBody(),i=_(tw,t);t.undoManager.ignore((function(){t.selection.setRng(function(t,e){var n=document.createRange();return n.setStart(t.container(),t.offset()),n.setEnd(e.container(),e.offset()),n}(n,r)),t.execCommand("Delete"),dx(i,o,Rc.fromRangeStart(t.selection.getRng())).map(px).map(pC(t,e))})),t.nodeChanged()},bC=function(t,e,n,r){var o=function(t,e){return Zs(e,t)||t}(t.getBody(),r.container()),i=_(tw,t),a=dx(i,o,r);return a.bind((function(t){return n?t.fold(T(L.some(px(t))),L.none,T(L.some(hx(t))),L.none):t.fold(L.none,T(L.some(hx(t))),L.none,T(L.some(px(t))))})).map(pC(t,e)).getOrThunk((function(){var u=Nl(n,o,r),c=u.bind((function(t){return dx(i,o,t)}));return Yn(a,c,(function(){return nw(i,o,r).exists((function(e){return!!function(t){return Yn(zl(t),Pl(t),(function(e,n){var r=rw(!0,e),o=rw(!1,n);return Ml(t,r).forall((function(t){return t.isEqual(o)}))})).getOr(!0)}(e)&&(hh(t,n,Ne.fromDom(e)),!0)}))})).orThunk((function(){return c.bind((function(o){return u.map((function(o){return n?vC(t,e,r,o):vC(t,e,o,r),!0}))}))})).getOr(!1)}))},yC=function(t,e,n){if(t.selection.isCollapsed()&&ws(t)){var r=Rc.fromRangeStart(t.selection.getRng());return bC(t,e,n,r)}return!1},wC=function(t){return 1===nn(t)},xC=function(t,e,n,r){var o=_(Mp,e),i=W(K(r,o),(function(t){return t.dom}));if(0===i.length)hh(e,t,n);else{var a=function(t,e){var n=Op(!1),r=Np(e,n.dom);return fn(Ne.fromDom(t),n),vn(Ne.fromDom(t)),Rc(r,0)}(n.dom,i);e.selection.setRng(a.toRange())}},CC=function(t,e){var n=Ne.fromDom(t.getBody()),r=Ne.fromDom(t.selection.getStart()),o=K(function(t,e){var n=Og(e,t);return Z(n,lo).fold(T(n),(function(t){return n.slice(0,t)}))}(n,r),wC);return ut(o).exists((function(n){var r,i=Rc.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return Yn(zl(n),Pl(n),(function(r,o){var i=rw(!0,r),a=rw(!1,o),u=rw(!1,e);return t?Ml(n,u).exists((function(t){return t.isEqual(a)&&e.isEqual(i)})):Bl(n,u).exists((function(t){return t.isEqual(i)&&e.isEqual(a)}))})).getOr(!0)}(e,i,n.dom)||(r=n,Il(r.dom)&&kp(r.dom)))&&(xC(e,t,n,o),!0)}))},SC=function(t,e){return!!t.selection.isCollapsed()&&CC(t,e)},kC=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),hh(t,e,Ne.fromDom(n)),!0},TC=function(t,e){return t.selection.isCollapsed()?function(t,e){var n=e?hg:pg,r=e?Nc.Forwards:Nc.Backwards,o=sl(r,t.getBody(),t.selection.getRng());return n(o)?kC(t,e,o.getNode(!e)):L.from(rw(e,o)).filter((function(t){return n(t)&&dl(o,t)})).exists((function(n){return kC(t,e,n.getNode(!e))}))}(t,e):function(t,e){var n=t.selection.getNode();return!!Kn(n)&&kC(t,e,n)}(t,e)},OC=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},EC=function(t,e){return(t||"table"===Le(e)?"margin":"padding")+("rtl"===ir(e,"direction")?"-right":"-left")},_C=function(t){var e=NC(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return et(e,(function(e){var n=EC(gs(t),e),r=ur(e,n).map(OC).getOr(0);return"false"!==t.dom.getContentEditable(e.dom)&&r>0}))}(t,e))},RC=function(t){return ho(t)||po(t)},NC=function(t){return K((e=t.selection.getSelectedBlocks(),W(e,Ne.fromDom)),(function(t){return!RC(t)&&!function(t){return Ge(t).exists(RC)}(t)&&Xr(t,(function(t){return qn(t.dom)||$n(t.dom)})).exists((function(t){return qn(t.dom)}))}));var e},AC=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=function(t){return t.getParam("indentation","40px","string")}(t),a=/[a-z%]+$/i.exec(i)[0],u=parseInt(i,10),c=gs(t),s=ns(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),q(NC(t),(function(t){!function(t,e,n,r,o,i){var a=EC(n,Ne.fromDom(i));if("outdent"===e){var u=Math.max(0,OC(i.style[a])-r);t.setStyle(i,a,u?u+o:"")}else u=OC(i.style[a])+r+o,t.setStyle(i,a,u)}(n,e,c,u,a,t.dom)}))},DC=function(t,e){if(t.selection.isCollapsed()&&_C(t)){var n=t.dom,r=t.selection.getRng(),o=Rc.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Ag(Ne.fromDom(i),o))return AC(t,"outdent"),!0}return!1},MC=function(t,e){t.getDoc().execCommand(e,!1,null)},BC=function(t,e){t.addCommand("delete",(function(){!function(t,e){DC(t)||Ww(t,!1)||zw(t,!1)||yC(t,e,!1)||xw(t,!1)||qh(t)||qw(t,!1)||TC(t,!1)||Tw(t)||SC(t,!1)||(MC(t,"Delete"),cw(t))}(t,e)})),t.addCommand("forwardDelete",(function(){!function(t,e){Ww(t,!0)||zw(t,!0)||yC(t,e,!0)||xw(t,!0)||qh(t)||qw(t,!0)||TC(t,!0)||Tw(t)||SC(t,!0)||MC(t,"ForwardDelete")}(t,e)}))},zC=function(t){return void 0===t.touches||1!==t.touches.length?L.none():L.some(t.touches[0])},PC=function(t){var e=Eu(),n=xu(!1),r=Ru((function(e){t.fire("longpress",Nt(Nt({},e),{type:"longpress"})),n.set(!0)}),400);t.on("touchstart",(function(t){zC(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.throttle(t),n.set(!1),e.set(i)}))}),!0),t.on("touchmove",(function(o){r.cancel(),zC(o).each((function(r){e.on((function(o){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(r,o)&&(e.clear(),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",Nt(Nt({},o),{type:"tap"}))}))}),!0)},LC=function(t,e){return wt(t,e.nodeName)},IC=function(t,e){return!!Hn(e)||!!An(e)&&(!LC(t,e)&&!Yl(e))},HC=function(t,e){if(Hn(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||LC(t,e.nextSibling)))return!0}return!1},FC=function(t){var e,n,r,o=t.dom,i=t.selection,a=t.schema,u=a.getBlockElements(),c=i.getStart(),s=t.getBody(),l=ns(t);if(c&&An(c)&&l){var f=s.nodeName.toLowerCase();if(a.isValidChild(f,l.toLowerCase())&&!function(t,e,n){return U(Tg(Ne.fromDom(n),Ne.fromDom(e)),(function(e){return LC(t,e.dom)}))}(u,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,h=d.endContainer,p=d.endOffset,v=wm(t);for(c=s.firstChild;c;)if(IC(u,c)){if(HC(u,c)){n=c,c=c.nextSibling,o.remove(n);continue}e||(e=o.create(l,rs(t)),c.parentNode.insertBefore(e,c),r=!0),n=c,c=c.nextSibling,e.appendChild(n)}else e=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(h,p),i.setRng(d),t.nodeChanged())}}},VC=function(t,e){e.hasAttribute("data-mce-caret")&&(zo(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},jC=function(t,e){var n=function(t){return Qr(Ne.fromDom(t.getBody()),"*[data-mce-caret]").map((function(t){return t.dom})).getOrNull()}(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void VC(t,n)):void(Ro(n)&&(VC(t,n),t.undoManager.add()))},UC=$n,WC=function(t,e,n){var r=kl(t.getBody()),o=_(fl,1===e?r.next:r.prev);if(n.collapsed&&function(t){return""!==ns(t)}(t)){var i=t.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(Rc.fromRangeStart(n))){var a=function(t){var e=t.dom.create(ns(t));return(!Se.ie||Se.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e}(t);1===e?t.$(i).after(a):t.$(i).before(a),t.selection.select(a,!0),t.selection.collapse()}}},qC=function(t,e){var n=e?Nc.Forwards:Nc.Backwards,r=t.selection.getRng();return function(t,e,n){return nC(e,t,n,yg,wg,UC)}(n,t,r).orThunk((function(){return WC(t,n,r),L.none()}))},$C=function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return rC(e,t,n,(function(t){return yg(t)||vg(t)}),(function(t){return wg(t)||bg(t)}),UC)}(n,t,r).orThunk((function(){return WC(t,n,r),L.none()}))},GC=function(t,e){return qC(t,e).exists((function(e){return tC(t,e),!0}))},KC=function(t,e){return $C(t,e).exists((function(e){return tC(t,e),!0}))},XC=function(t,e){return iC(t,e,e?wg:yg)},YC=function(t){return j(["figcaption"],Le(t))},JC=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},QC=function(t,e,n){n?gn(t,e):mn(t,e)},ZC=function(t,e,n,r){return""===e?function(t,e){var n=Ne.fromTag("br");return QC(t,n,e),JC(n)}(t,r):function(t,e,n,r){var o=Ne.fromTag(n),i=Ne.fromTag("br");return tr(o,r),gn(o,i),QC(t,o,e),JC(i)}(t,r,e,n)},tS=function(t,e,n){return e?function(t,e){return Mx(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return Dx(t,e).breakAt.isNone()}(t.dom,n)},eS=function(t,e){var n=Ne.fromDom(t.getBody()),r=Rc.fromRangeStart(t.selection.getRng()),o=ns(t),i=rs(t);return function(t,e){var n=_(Be,e);return Xr(Ne.fromDom(t.container()),lo,n).filter(YC)}(r,n).exists((function(){if(tS(n,e,r)){var a=ZC(n,o,i,e);return t.selection.setRng(a),!0}return!1}))},nS=function(t,e){return!!t.selection.isCollapsed()&&eS(t,e)},rS=function(t,e){return tt(function(t){return W(t,(function(t){return Nt({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:C},t)}))}(t),(function(t){return function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey}(t,e)?[t]:[]}))},oS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},iS=function(t,e){return Q(rS(t,e),(function(t){return t.action()}))},aS=function(t,e){var n=e?Nc.Forwards:Nc.Backwards,r=t.selection.getRng();return nC(t,n,r,hg,pg,Kn).exists((function(e){return tC(t,e),!0}))},uS=function(t,e){var n=e?1:-1,r=t.selection.getRng();return rC(t,n,r,hg,pg,Kn).exists((function(e){return tC(t,e),!0}))},cS=function(t,e){return iC(t,e,e?pg:hg)},sS=function(t,e,n,r,o){var i=Iu(Ne.fromDom(n),"td,th,caption").map((function(t){return t.dom}));return function(t,e,n){return Y(t,(function(t,r){return t.fold((function(){return L.some(r)}),(function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return L.some(i<o?r:t)}))}),L.none())}(K(function(t,e){return tt(e,(function(e){var n=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+2*e,bottom:t.bottom+2*e,width:t.width+e,height:t.height+e}}(ec(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]}))}(t,i),(function(t){return e(t,o)})),r,o).map((function(t){return t.cell}))},lS=_(sS,(function(t){return t.bottom}),(function(t,e){return t.y<e})),fS=_(sS,(function(t){return t.top}),(function(t,e){return t.y>e})),dS=function(t,e){return at(e.getClientRects()).bind((function(e){return lS(t,e.left,e.top)})).bind((function(t){return Ax(Pl(n=t).map((function(t){return Dx(n,t).positions.concat(t)})).getOr([]),e);var n}))},mS=function(t,e){return ut(e.getClientRects()).bind((function(e){return fS(t,e.left,e.top)})).bind((function(t){return Ax(zl(n=t).map((function(t){return[t].concat(Mx(n,t).positions)})).getOr([]),e);var n}))},gS=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===xx.Wrap&&0===t.positions.length}(r)||!Un(n.getNode())&&function(t){return t.breakType===xx.Br&&1===t.positions.length}(r)?!function(t,e,n){return n.breakAt.exists((function(n){return t(e,n).breakAt.isSome()}))}(t,e,r):r.breakAt.isNone()},hS=_(gS,Dx),pS=_(gS,Mx),vS=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;return!(!Hs()||!function(t,e,n){var r=Rc.fromRangeStart(e);return Dl(!t,n).exists((function(t){return t.isEqual(r)}))}(e,o,n))&&(_w(i,t,n,!e,!1).each((function(e){tC(t,e)})),!0)},bS=function(t,e){var n=e.getNode(t);return An(n)&&"TABLE"===n.nodeName?L.some(n):L.none()},yS=function(t,e,n){var r=bS(!!e,n),o=!1===e;r.fold((function(){return tC(t,n.toRange())}),(function(r){return Dl(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return tC(t,n.toRange())}),(function(o){return function(t,e,n,r){var o=ns(e);o?e.undoManager.transact((function(){var r=Ne.fromTag(o);tr(r,rs(e)),gn(r,Ne.fromTag("br")),t?dn(Ne.fromDom(n),r):fn(Ne.fromDom(n),r);var i=e.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),tC(e,i)})):tC(e,r.toRange())}(e,t,r,n)}))}))},wS=function(t,e,n,r){var o=t.selection.getRng(),i=Rc.fromRangeStart(o),a=t.getBody();if(!e&&hS(r,i)){var u=function(t,e,n){return dS(e,n).orThunk((function(){return at(n.getClientRects()).bind((function(n){return Nx(Bx(t,Rc.before(e)),n.left)}))})).getOr(Rc.before(e))}(a,n,i);return yS(t,e,u),!0}if(e&&pS(r,i)){u=function(t,e,n){return mS(e,n).orThunk((function(){return at(n.getClientRects()).bind((function(n){return Nx(zx(t,Rc.after(e)),n.left)}))})).getOr(Rc.after(e))}(a,n,i);return yS(t,e,u),!0}return!1},xS=function(t,e,n){return L.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return L.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)},CS=function(t,e){return xS(t,e,vS)},SS=function(t,e){return xS(t,e,wS)},kS=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=ge().os;iS([{keyCode:id.RIGHT,action:oS(GC,t,!0)},{keyCode:id.LEFT,action:oS(GC,t,!1)},{keyCode:id.UP,action:oS(KC,t,!1)},{keyCode:id.DOWN,action:oS(KC,t,!0)},{keyCode:id.RIGHT,action:oS(CS,t,!0)},{keyCode:id.LEFT,action:oS(CS,t,!1)},{keyCode:id.UP,action:oS(SS,t,!1)},{keyCode:id.DOWN,action:oS(SS,t,!0)},{keyCode:id.RIGHT,action:oS(aS,t,!0)},{keyCode:id.LEFT,action:oS(aS,t,!1)},{keyCode:id.UP,action:oS(uS,t,!1)},{keyCode:id.DOWN,action:oS(uS,t,!0)},{keyCode:id.RIGHT,action:oS(lC,t,e,!0)},{keyCode:id.LEFT,action:oS(lC,t,e,!1)},{keyCode:id.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:oS(mC,t,e)},{keyCode:id.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:oS(gC,t,e)},{keyCode:id.UP,action:oS(nS,t,!1)},{keyCode:id.DOWN,action:oS(nS,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},TS=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){iS([{keyCode:id.BACKSPACE,action:oS(DC,t,!1)},{keyCode:id.BACKSPACE,action:oS(Ww,t,!1)},{keyCode:id.DELETE,action:oS(Ww,t,!0)},{keyCode:id.BACKSPACE,action:oS(zw,t,!1)},{keyCode:id.DELETE,action:oS(zw,t,!0)},{keyCode:id.BACKSPACE,action:oS(yC,t,e,!1)},{keyCode:id.DELETE,action:oS(yC,t,e,!0)},{keyCode:id.BACKSPACE,action:oS(qh,t,!1)},{keyCode:id.DELETE,action:oS(qh,t,!0)},{keyCode:id.BACKSPACE,action:oS(qw,t,!1)},{keyCode:id.DELETE,action:oS(qw,t,!0)},{keyCode:id.BACKSPACE,action:oS(TC,t,!1)},{keyCode:id.DELETE,action:oS(TC,t,!0)},{keyCode:id.BACKSPACE,action:oS(Tw,t,!1)},{keyCode:id.DELETE,action:oS(Tw,t,!0)},{keyCode:id.BACKSPACE,action:oS(xw,t,!1)},{keyCode:id.DELETE,action:oS(xw,t,!0)},{keyCode:id.BACKSPACE,action:oS(SC,t,!1)},{keyCode:id.DELETE,action:oS(SC,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&function(t,e){iS([{keyCode:id.BACKSPACE,action:oS(Uw,t)},{keyCode:id.DELETE,action:oS(Uw,t)}],e)}(t,e)}))},OS=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var a=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild);a&&/^(UL|OL|DL)$/.test(a.nodeName)&&e.insertBefore(o.doc.createTextNode(wo),e.firstChild)}var u=o.createRng();if(e.normalize(),e.hasChildNodes()){for(var c=new uo(e,e);n=c.current();){if(Hn(n)){u.setStart(n,0),u.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}r=n,n=c.next()}n||(u.setStart(r,0),u.setEnd(r,0))}else Un(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(u.setStartBefore(e),u.setEndBefore(e)):(u.setStartAfter(e),u.setEndAfter(e)):(u.setStart(e,0),u.setEnd(e,0));t.selection.setRng(u),Wd(t,u)}},ES=function(t){return L.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},_S=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},RS=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},NS=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},AS=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!An(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},DS=function(t,e,n,r,o){var i=t.dom,a=t.selection.getRng();if(n!==t.getBody()){var u;RS(u=n)&&RS(u.parentNode)&&(o="LI");var c=o?e(o):i.create("BR");if(AS(n,r,!0)&&AS(n,r,!1))if(_S(n,"LI")){var s=NS(n);i.insertAfter(c,s),!function(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.firstChild)===t}(n)?i.remove(n):i.remove(s)}else i.replace(c,n);else if(AS(n,r,!0))_S(n,"LI")?(i.insertAfter(c,NS(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n),i.remove(r);else if(AS(n,r,!1))i.insertAfter(c,NS(n)),i.remove(r);else{n=NS(n);var l=a.cloneRange();l.setStartAfter(r),l.setEndAfter(n);var f=l.extractContents();"LI"===o&&function(t,e){return t.firstChild&&t.firstChild.nodeName===e}(f,"LI")?(c=f.firstChild,i.insertAfter(f,n)):(i.insertAfter(f,n),i.insertAfter(c,n)),i.remove(r)}OS(t,c)}},MS=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},BS=function(t){t.innerHTML='<br data-mce-bogus="1">'},zS=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},PS=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},LS=function(t,e,n){return!1===Hn(e)?n:t?1===n&&e.data.charAt(n-1)===xo?0:n:n===e.data.length-1&&e.data.charAt(n)===xo?e.data.length:n},IS=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},HS=function(t,e){var n=ns(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;L.from(n.style).map(r.parseStyle).each((function(t){var n=cr(Ne.fromDom(e)),o=Nt(Nt({},n),t);r.setStyles(e,o)}));var o=L.from(n.class).map((function(t){return t.split(/\s+/)})),i=L.from(e.className).map((function(t){return K(t.split(/\s+/),(function(t){return""!==t}))}));Yn(o,i,(function(t,n){var o=K(n,(function(e){return!j(t,e)})),i=At(At([],t,!0),o,!0);r.setAttrib(e,"class",i.join(" "))}));var a=["style","class"],u=vt(n,(function(t,e){return!j(a,e)}));r.setAttribs(e,u)}(t,e,rs(t))},FS=function(t,e){var n,r,o,i,a,u,c,s,l,f,d=t.dom,m=t.schema,g=m.getNonEmptyElements(),h=t.selection.getRng(),p=function(e){var n,o,a,u=r,c=m.getTextInlineElements();if(a=n=e||"TABLE"===s||"HR"===s?d.create(e||l):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[u.nodeName]){if(Il(u)||Yl(u))continue;o=u.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(a=o,n.appendChild(o))}}while((u=u.parentNode)&&u!==x);return HS(t,n),BS(a),n},v=function(t){var e,n,a=LS(t,r,o);if(Hn(r)&&(t?a>0:a<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&An(r)&&r===i.firstChild)return!0;if(zS(r,"TABLE")||zS(r,"HR"))return f&&!t||!f&&t;var u=new uo(r,i);for(Hn(r)&&(t&&0===a?u.prev():t||a!==r.nodeValue.length||u.next());e=u.current();){if(An(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),g[n]&&"br"!==n))return!1}else if(Hn(e)&&!Xo(e.nodeValue))return!1;t?u.prev():u.next()}return!0},b=function(){a=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==C?p(l):p(),function(t){return t.getParam("end_container_on_empty_block",!1)}(t)&&PS(d,c)&&d.isEmpty(i)?a=d.split(c,i):d.insertAfter(a,i),OS(t,a)};yd(d,h).each((function(t){h.setStart(t.startContainer,t.startOffset),h.setEnd(t.endContainer,t.endOffset)})),r=h.startContainer,o=h.startOffset,l=ns(t);var y=!(!e||!e.shiftKey),w=!(!e||!e.ctrlKey);An(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&Hn(r)?r.nodeValue.length:0);var x=IS(d,r);if(x){(l&&!y||!l&&y)&&(r=function(t,e,n,r,o){var i,a,u,c,s,l,f=e||"P",d=t.dom,m=IS(d,r);if(!(a=d.getParent(r,d.isBlock))||!PS(d,a)){if(l=(a=a||m)===t.getBody()||function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)}(a)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=d.create(f),HS(t,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==a;)c=c.parentNode;for(;c&&!d.isBlock(c);)u=c,c=c.previousSibling;if(u&&t.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),HS(t,i),u.parentNode.insertBefore(i,u),c=u;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(t,l,h,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var C=c?c.nodeName.toUpperCase():"";"LI"!==C||w||(i=c,c=c.parentNode,s=C),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?DS(t,p,c,i,l):l&&i===t.getBody()||(l=l||"P",Oo(i)?(a=zo(i),d.isEmpty(i)&&BS(i),HS(t,a),OS(t,a)):v()?b():v(!0)?(a=i.parentNode.insertBefore(p(),i),OS(t,zS(i,"HR")?a:i)):((n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,LS(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,LS(!1,t.endContainer,t.endOffset)),e}(h).cloneRange()).setEndAfter(i),function(t){q(Lu(Ne.fromDom(t),Ve),(function(t){var e=t.dom;e.nodeValue=So(e.nodeValue)}))}(u=n.extractContents()),function(t){do{Hn(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)}(u),a=u.firstChild,d.insertAfter(u,i),function(t,e,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;An(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)(!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||MS(t,o))&&t.remove(o)}}(d,g,a),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(d,i),d.isEmpty(i)&&BS(i),a.normalize(),d.isEmpty(a)?(d.remove(a),b()):(HS(t,a),OS(t,a))),d.setAttrib(a,"id",""),t.fire("NewBlock",{newBlock:a}))}},VS=function(t,e,n){var r=t.dom.createRng();n?(r.setStartBefore(e),r.setEndBefore(e)):(r.setStartAfter(e),r.setEndAfter(e)),t.selection.setRng(r),Wd(t,r)},jS=function(t,e){var n,r,o=t.selection,i=t.dom,a=o.getRng();yd(i,a).each((function(t){a.setStart(t.startContainer,t.startOffset),a.setEnd(t.endContainer,t.endOffset)}));var u=a.startOffset,c=a.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=u>c.childNodes.length-1;c=c.childNodes[Math.min(u,c.childNodes.length-1)]||c,u=s&&3===c.nodeType?c.nodeValue.length:0}var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&u>=c.nodeValue.length&&(function(t,e,n){for(var r,o=new uo(e,n),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(t.schema,c,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),Dc(i,a,n),VS(t,n,r),t.undoManager.add()},US=function(t,e){var n=Ne.fromTag("br");fn(Ne.fromDom(e),n),t.undoManager.add()},WS=function(t,e){qS(t.getBody(),e)||dn(Ne.fromDom(e),Ne.fromTag("br"));var n=Ne.fromTag("br");dn(Ne.fromDom(e),n),VS(t,n.dom,!1),t.undoManager.add()},qS=function(t,e){return n=Rc.after(e),!!Un(n.getNode())||Ml(t,Rc.after(e)).map((function(t){return Un(t.getNode())})).getOr(!1);var n},$S=function(t){return t&&"A"===t.nodeName&&"href"in t},GS=function(t){return t.fold(D,$S,$S,D)},KS=function(t,e){e.fold(C,_(US,t),_(WS,t),C)},XS=function(t,e){var n=function(t){var e=_(tw,t),n=Rc.fromRangeStart(t.selection.getRng());return dx(e,t.getBody(),n).filter(GS)}(t);n.isSome()?n.each(_(KS,t)):jS(t,e)},YS=function(t,e){return ES(t).filter((function(t){return e.length>0&&De(Ne.fromDom(t),e)})).isSome()},JS=Tr([{br:[]},{block:[]},{none:[]}]),QS=function(t,e){return function(t){return YS(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},ZS=function(t){return function(e,n){return""===ns(e)===t}},tk=function(t){return function(e,n){return function(t){return ES(t).filter((function(t){return po(Ne.fromDom(t))})).isSome()}(e)===t}},ek=function(t,e){return function(n,r){return function(t){return ES(t).fold(T(""),(function(t){return t.nodeName.toUpperCase()}))}(n)===t.toUpperCase()===e}},nk=function(t){return ek("pre",t)},rk=function(t){return function(e,n){return function(t){return t.getParam("br_in_pre",!0)}(e)===t}},ok=function(t,e){return function(t){return YS(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},ik=function(t,e){return e},ak=function(t){var e=ns(t),n=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},uk=function(t,e){return function(n,r){return Y(t,(function(t,e){return t&&e(n,r)}),!0)?L.some(e):L.none()}},ck=function(t,e){(function(t,e){return nx([uk([QS],JS.none()),uk([ek("summary",!0)],JS.br()),uk([nk(!0),rk(!1),ik],JS.br()),uk([nk(!0),rk(!1)],JS.block()),uk([nk(!0),rk(!0),ik],JS.block()),uk([nk(!0),rk(!0)],JS.br()),uk([tk(!0),ik],JS.br()),uk([tk(!0)],JS.block()),uk([ZS(!0),ik,ak],JS.block()),uk([ZS(!0)],JS.br()),uk([ok],JS.br()),uk([ZS(!1),ik],JS.br()),uk([ak],JS.block())],[t,!(!e||!e.shiftKey)]).getOr(JS.none())})(t,e).fold((function(){XS(t,e)}),(function(){FS(t,e)}),C)},sk=function(t){t.on("keydown",(function(e){e.keyCode===id.ENTER&&function(t,e){var n;e.isDefaultPrevented()||(e.preventDefault(),(n=t.undoManager).typing&&(n.typing=!1,n.add()),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),ck(t,e)})))}(t,e)}))},lk=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){iS([{keyCode:id.END,action:oS(XC,t,!0)},{keyCode:id.HOME,action:oS(XC,t,!1)},{keyCode:id.END,action:oS(cS,t,!0)},{keyCode:id.HOME,action:oS(cS,t,!1)},{keyCode:id.END,action:oS(hC,t,!0,e)},{keyCode:id.HOME,action:oS(hC,t,!1,e)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},fk=ge().browser,dk=function(t){!function(t){var e=_u((function(){t.composing||th(t)}),0);fk.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))}(t),t.on("input",(function(e){!1===e.isComposing&&th(t)}))},mk=ge(),gk=function(t){return t.stopImmediatePropagation()},hk=function(t){return t.keyCode===id.PAGE_UP||t.keyCode===id.PAGE_DOWN},pk=function(t,e,n){n&&!t.get()?e.on("NodeChange",gk,!0):!n&&t.get()&&e.off("NodeChange",gk),t.set(n)},vk=function(t,e){if(!mk.os.isOSX()){var n=xu(!1);t.on("keydown",(function(e){hk(e)&&pk(n,t,!0)})),t.on("keyup",(function(r){!1===r.isDefaultPrevented()&&function(t,e,n){iS([{keyCode:id.PAGE_UP,action:oS(hC,t,!1,e)},{keyCode:id.PAGE_DOWN,action:oS(hC,t,!0,e)}],n)}(t,e,r),hk(r)&&n.get()&&(pk(n,t,!1),t.nodeChanged())}))}},bk=function(t,e){var n=e.container(),r=e.offset();return Hn(n)?(n.insertData(r,t),L.some(Rc(n,r+t.length))):ll(e).map((function(n){var r=Ne.fromText(t);return e.isAtEnd()?dn(n,r):fn(n,r),Rc(r.dom,t.length)}))},yk=_(bk,wo),wk=_(bk," "),xk=function(t,e){return function(n){return function(t,e){return!qg(e)&&($g(t,e)||Ug(t,e)||Wg(t,e))}(t,n)?yk(e):wk(e)}},Ck=function(t){var e=Rc.fromRangeStart(t.selection.getRng()),n=Ne.fromDom(t.getBody());if(t.selection.isCollapsed()){var r=_(tw,t),o=Rc.fromRangeStart(t.selection.getRng());return dx(r,t.getBody(),o).bind(function(t){return function(e){return e.fold((function(e){return Bl(t.dom,Rc.before(e))}),(function(t){return zl(t)}),(function(t){return Pl(t)}),(function(e){return Ml(t.dom,Rc.after(e))}))}}(n)).bind(xk(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},Sk=function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){iS([{keyCode:id.SPACEBAR,action:oS(Ck,t)}],e).each((function(t){e.preventDefault()}))}(t,e)}))},kk=function(t){var e=dC(t);return function(t){t.on("keyup compositionstart",_(jC,t))}(t),kS(t,e),TS(t,e),sk(t),Sk(t),dk(t),lk(t,e),vk(t,e),e},Tk=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&ld(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!Se.range&&t.selection.isCollapsed()||Uf(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&Uf(t)&&("IMG"===t.selection.getNode().nodeName?oo.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){if(t===r)return!0;n.push(t)})),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),Ok=function(t){!function(t){t.on("click",(function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}))}(t),function(t){t.parser.addNodeFilter("details",(function(t){q(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),t.serializer.addNodeFilter("details",(function(t){q(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",d(e)?e:null),t.attr("data-mce-open",null)}))}))}(t)},Ek=function(t){return An(t)&&go(Ne.fromDom(t))},_k=function(t){t.on("click",(function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=Rc.fromRangeStart(e),r=Rc.fromRangeEnd(e);if(Rc.isElementPosition(n)){var o=n.container();Ek(o)&&zl(o).each((function(t){return e.setStart(t.container(),t.offset())}))}Rc.isElementPosition(r)&&(o=n.container(),Ek(o)&&Pl(o).each((function(t){return e.setEnd(t.container(),t.offset())})));t.selection.setRng(Gh(e))}(t)}))},Rk=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},Nk=function(t,e){return n=function(t){return t.inline?Rk(t.getBody()):{left:0,top:0}}(t),r=function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}}(t),{pageX:(o=function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=Rk(t.getContentAreaContainer()),r=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o}(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}}(t,e)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o},Ak=$n,Dk=qn,Mk=function(t,e,n,r){var o=t.dom,i=e.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var a=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(a,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),a.appendChild(i),a},Bk=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},zk=function(t,e){return function(n){if(function(t){return 0===t.button}(n)){var r=Q(e.dom.getParents(n.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(Ak,Dk)).getOr(null);if(u=e.getBody(),Ak(c=r)&&c!==u){var o=e.dom.getPos(r),i=e.getBody(),a=e.getDoc().documentElement;t.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(e.inline?i.scrollWidth:a.offsetWidth)-2,maxY:(e.inline?i.scrollHeight:a.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:Mk(e,r,r.offsetWidth,r.offsetHeight)})}}var u,c}},Pk=function(t,e){return function(n){t.on((function(t){if(t.dragging){if(function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!Ak(e)}(e,(a=e.selection,3===(u=a.getSel().getRangeAt(0).startContainer).nodeType?u.parentNode:u),t.element)){var r=(o=t.element,(i=o.cloneNode(!0)).removeAttribute("data-mce-selected"),i);e.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||e.undoManager.transact((function(){Bk(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()}))}e.fire("dragend")}var o,i,a,u})),Lk(t)}},Lk=function(t){t.on((function(t){Bk(t.ghost)})),t.clear()},Ik=function(t){var e=Eu(),n=pu.DOM,r=document,o=zk(e,t),i=function(t,e){var n=oo.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return e.on("remove",n.stop),function(r){return t.on((function(t){var o,i,a=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(!t.dragging&&a>10){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var u=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}}(t,Nk(e,r));o=t.ghost,i=e.getBody(),o.parentNode!==i&&i.appendChild(o),function(t,e,n,r,o,i){var a=0,u=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(a=e.pageX+n-o),e.pageY+r>i&&(u=e.pageY+r-i),t.style.width=n-a+"px",t.style.height=r-u+"px"}(t.ghost,u,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}))}}(e,t),a=Pk(e,t),u=function(t,e){return function(){t.on((function(t){t.dragging&&e.fire("dragend")})),Lk(t)}}(e,t);t.on("mousedown",o),t.on("mousemove",i),t.on("mouseup",a),n.bind(r,"mousemove",i),n.bind(r,"mouseup",u),t.on("remove",(function(){n.unbind(r,"mousemove",i),n.unbind(r,"mouseup",u)})),t.on("keydown",(function(t){t.keyCode===id.ESC&&u()}))},Hk=function(t){Ik(t),function(t){t.on("drop",(function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(Ak(n)||"false"===t.dom.getContentEditableParent(n))&&e.preventDefault()}))}(t),function(t){return t.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var e=function(e){if(!e.isDefaultPrevented()){var n=e.dataTransfer;n&&(j(n.types,"Files")||n.files.length>0)&&(e.preventDefault(),"drop"===e.type&&ky(t,"Dropped file type is not supported"))}},n=function(n){mm(t,n.target)&&e(n)},r=function(){var r=pu.DOM,o=t.dom,i=document,a=t.inline?t.getBody():t.getDoc(),u=["drop","dragover"];q(u,(function(t){r.bind(i,t,n),o.bind(a,t,e)})),t.on("remove",(function(){q(u,(function(t){r.unbind(i,t,n),o.unbind(a,t,e)}))}))};t.on("init",(function(){oo.setEditorTimeout(t,r,0)}))}(t)},Fk=qn,Vk=$n,jk=function(t,e){return td(t.getBody(),e)},Uk=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),a=Is(t,i,o,(function(){return wm(t)})),u="sel-"+r.uniqueId(),c="data-mce-selected",s=function(t){return t!==i&&(Vk(t)||Kn(t))&&r.isChildOf(t,i)},l=function(t){return yg(t)||wg(t)||hg(t)||pg(t)},f=function(t){t&&n.setRng(t)},d=n.getRng,m=function(e,r,o,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:r,direction:e,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===e),a.show(o,r))},g=function(t){return _o(t)||Mo(t)||Bo(t)},h=function(t){return g(t.startContainer)||g(t.endContainer)},p=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,a=e.startOffset,u=e.endContainer,c=e.endOffset;return wt(n,i.nodeName.toLowerCase())?0===a?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,a),wt(n,u.nodeName.toLowerCase())?0===c?o.setEndBefore(u):o.setEndAfter(u):o.setEnd(u,c),o},v=function(o){var i=o.cloneNode(!0),a=t.fire("ObjectSelected",{target:o,targetClone:i});if(a.isDefaultPrevented())return null;var s=function(e,o,i){var a=t.$,c=Qr(Ne.fromDom(t.getBody()),"#"+u).fold((function(){return a([])}),(function(t){return a([t.dom])}));0===c.length&&(c=a('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",u)).appendTo(t.getBody());var s=r.createRng();o===i&&Se.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(wo).append(o).append(wo),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(e,t.getBody()).y}),c[0].focus();var l=n.getSel();return l.removeAllRanges(),l.addRange(s),s}(o,a.targetClone,i),l=Ne.fromDom(o);return q(Iu(Ne.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){Be(l,t)||rr(t,c)})),r.getAttrib(o,c)||o.setAttribute(c,"1"),e=o,x(),s},y=function(t,e){if(!t)return null;if(t.collapsed){if(!h(t)){var n=e?1:-1,o=sl(n,i,t),a=o.getNode(!e);if(Vs(a))return m(n,a,!!e&&!o.isAtEnd(),!1);var u=o.getNode(e);if(Vs(u))return m(n,u,!e&&!o.isAtEnd(),!1)}return null}var c=t.startContainer,l=t.startOffset,f=t.endOffset;if(3===c.nodeType&&0===l&&Vk(c.parentNode)&&(c=c.parentNode,l=r.nodeIndex(c),c=c.parentNode),1!==c.nodeType)return null;if(f===l+1&&c===t.endContainer){var d=c.childNodes[l];if(s(d))return v(d)}return null},w=function(){e&&e.removeAttribute(c),Qr(Ne.fromDom(t.getBody()),"#"+u).each(vn),e=null},x=function(){a.hide()};return Se.ceFalse&&!Jv(t)&&function(){t.on("mouseup",(function(e){var n=d();n.collapsed&&vy(t,e.clientX,e.clientY)&&Nw(t,n,!1).each(f)})),t.on("click",(function(e){var o=jk(t,e.target);o&&(Vk(o)&&(e.preventDefault(),t.focus()),Fk(o)&&r.isChildOf(o,n.getNode())&&w())})),t.on("blur NewBlock",w),t.on("ResizeWindow FullscreenStateChanged",a.reposition);var c=function(e,n){var i,a,u=r.getParent(e,o),c=r.getParent(n,o);return!b(u)&&(!(e===c||!r.isChildOf(u,c)||!1!==Vk(jk(t,u)))||!r.isChildOf(c,u)&&(i=u,a=c,!(r.getParent(i,o)===r.getParent(a,o)))&&function(t){var e=t.firstChild;if(b(e))return!1;var n=Rc.before(e);if(Un(n.getNode())&&1===t.childNodes.length)return!l(n);var r=kl(t).next(n);return r&&!l(r)}(u))};t.on("tap",(function(e){var n=e.target,r=jk(t,n);Vk(r)?(e.preventDefault(),Rw(t,r).each(y)):s(n)&&Rw(t,n).each(y)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==vy(t,e.clientX,e.clientY)){var a=jk(t,o);if(a)Vk(a)?(e.preventDefault(),Rw(t,a).each(y)):(w(),Fk(a)&&e.shiftKey||ed(e.clientX,e.clientY,n.getRng())||(x(),n.placeCaretAt(e.clientX,e.clientY)));else if(s(o))Rw(t,o).each(y);else if(!1===Vs(o)){w(),x();var u=Zx(i,e.clientX,e.clientY);if(u&&!c(o,u.node)){e.preventDefault();var l=m(1,u.node,u.before,!1);f(l),t.getBody().focus()}}}})),t.on("keypress",(function(t){id.modifierPressed(t)||Vk(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=p(t.range);var e=y(t.range,t.forward);e&&(t.range=e)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;h(n)||"mcepastebin"===o.id||x(),e=o,r.hasClass(e,"mce-offscreen-selection")||w()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!Se.ie){var o=(e=r.get(u))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),Hk(t),function(t){var e=_u((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=Aw(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(Kn(n)){var r=td(t.getBody(),n),o=$n(r)?r:n;t.selection.getNode()!==o&&Rw(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:m,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(zo(t),f(d()),n.scrollIntoView(t))},hideFakeCaret:x,destroy:function(){a.destroy(),e=null}}},Wk=function(t){var e,n,r=_e.each,o=id.BACKSPACE,i=id.DELETE,a=t.dom,u=t.selection,c=t.parser,s=Se.gecko,l=Se.ie,f=Se.webkit,d="data:text/mce-internal,",m=l?"Text":"URL",g=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},h=function(t){return t.isDefaultPrevented()},p=function(){var e=function(t){var e=a.create("body"),n=t.cloneContents();return e.appendChild(n),u.serializer.serialize(e,{format:"html"})};t.on("keydown",(function(n){var r,u,c=n.keyCode;if(!h(n)&&(c===i||c===o)){if(r=t.selection.isCollapsed(),u=t.getBody(),r&&!a.isEmpty(u))return;if(!r&&!function(n){var r=e(n),o=a.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),u.firstChild&&a.isBlock(u.firstChild)?t.selection.setCursorLocation(u.firstChild,0):t.selection.setCursorLocation(u,0),t.nodeChanged()}}))},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},b=function(){t.inline||a.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=u.getRng(),t.getBody().focus(),"mousedown"===e.type){if(_o(n.startContainer))return;u.placeCaretAt(e.clientX,e.clientY)}else u.setRng(n)}))},y=function(){Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!h(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),oo.setEditorTimeout(t,(function(){n.focus()}))}}))},w=function(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),u.select(n))}))},x=function(){t.on("keydown",(function(t){if(!h(t)&&t.keyCode===o&&u.isCollapsed()&&0===u.getRng().startOffset){var e=u.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},S=function(){(function(t){return t.getParam("readonly")})(t)||t.on("BeforeExecCommand mousedown",(function(){g("StyleWithCSS",!1),g("enableInlineTableEditing",!1),ps(t)||g("enableObjectResizing",!1)}))},k=function(){t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||r(a.select("a"),(function(t){var e=t.parentNode,n=a.getRoot();if(e.lastChild===t){for(;e&&!a.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}a.add(e,"br",{"data-mce-bogus":1})}}))}))},T=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},O=function(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))},E=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(Se.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},_=function(){Se.mac&&t.on("keydown",(function(e){!id.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}))},R=function(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},N=function(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))},A=function(){t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&u.select(e.target),(n=t.selection.getContent()).length>0&&(r=d+escape(t.id)+","+escape(n),e.dataTransfer.setData(m,r)))}(e)})),t.on("drop",(function(e){if(!h(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(m))&&e.indexOf(d)>=0?(e=e.substr(d.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=sd(e.x,e.y,t.getDoc());u.setRng(r),o=n.html,i=!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):t.execCommand("mceInsertContent",!1,o)}}var o,i}))},D=C;return Jv(t)?(f&&(b(),w(),N(),v(),Se.iOS&&(O(),E(),R())),s&&(y(),S(),T(),_())):(t.on("keydown",(function(e){var n,r;if(!h(e)&&e.keyCode===id.BACKSPACE){var o=(n=u.getRng()).startContainer,i=n.startOffset,c=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==c;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),u.setRng(n))}}})),p(),Se.windowsPhone||t.on("keyup focusin mouseup",(function(t){id.modifierPressed(t)||u.normalize()}),!0),f&&(b(),w(),ns(t)&&t.on("init",(function(){g("DefaultParagraphSeparator",ns(t))})),N(),x(),c.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),Se.iOS?(O(),E(),R()):v()),Se.ie>=11&&(E(),x()),Se.ie&&(v(),g("AutoUrlDetect",!1),A()),s&&(t.on("keydown",(function(e){if(!h(e)&&e.keyCode===o){if(!t.getBody().getElementsByTagName("hr").length)return;if(u.isCollapsed()&&0===u.getRng().startOffset){var n=u.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),e.preventDefault())}}})),y(),e=function(){var e=a.getAttribs(u.getStart().cloneNode(!1));return function(){var n=u.getStart();n!==t.getBody()&&(a.setAttrib(n,"style",null),r(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},n=function(){return!u.isCollapsed()&&a.getParent(u.getStart(),a.isBlock)!==a.getParent(u.getEnd(),a.isBlock)},t.on("keypress",(function(r){var o;if(!h(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=e(),t.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),a.bind(t.getDoc(),"cut",(function(r){var o;!h(r)&&n()&&(o=e(),oo.setEditorTimeout(t,(function(){o()})))})),S(),k(),T(),_(),x())),{refreshContentEditable:D,isHidden:function(){if(!s||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},qk=pu.DOM,$k=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},Gk=function(t){return vt(t,(function(t){return!1===v(t)}))},Kk=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Gk({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:$k(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},Xk=function(t){var e=t.dom.getRoot();t.inline||Uf(t)&&t.selection.getStart(!0)!==e||zl(e).each((function(e){var n=e.getNode(),r=Pn(n)?zl(n).getOr(e):e;Se.browser.isIE()?function(t,e){var n=Ne.fromDom(t.getBody()),r=(rm(t)?L.from(e):L.none()).map(om).filter(nm(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},Yk=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),Xk(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&oo.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},Jk=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},Qk=function(t){var e=Jk(t),n=hs(t),r=t.contentCSS,o=function(){e.unloadAll(r),t.inline||t.ui.styleSheetLoader.unloadAll(n)},i=function(){t.removed?o():t.on("remove",o)};if(t.contentStyles.length>0){var a="";_e.each(t.contentStyles,(function(t){a+=t+"\r\n"})),t.dom.addStyle(a)}var u=to.all(function(t,e,n){var r=[new to((function(n,r){return Jk(t).loadAll(e,n,r)}))];return t.inline?r:r.concat([new to((function(e,r){return t.ui.styleSheetLoader.loadAll(n,e,r)}))])}(t,r,n)).then(i).catch(i);return t.settings.content_style&&function(t,e){var n=Ne.fromDom(t.getBody()),r=cn(un(n)),o=Ne.fromTag("style");Zn(o,"type","text/css"),gn(o,Ne.fromText(e)),gn(r,o),t.on("remove",(function(){vn(o)}))}(t,t.settings.content_style),u},Zk=function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();!function(t){t.fire("PreInit")}(t),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,qk.setAttrib(r,"spellcheck","false")),t.quirks=Wk(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",Tu.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){_e.each(e.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type}))},tT=function(t){!0!==t.removed&&(!function(t){Jv(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),Yk(t))},eT=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(qk.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===qk.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=Iy(t),t.schema=Ri(n),t.dom=pu(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:fs(t),referrerPolicy:ds(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=_b(Kk(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,a=t.dom,u="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(u)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(u,o),r.attr(n,o)):"tabindex"===n?(r.attr(u,o),r.attr(n,null)):r.attr(u,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Mm("br",1)).shortEnded=!0)}})),e}(t),t.serializer=Mb(function(t){var e=t.settings;return Nt(Nt({},Kk(t)),Gk({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before,block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements}))}(t),t),t.selection=lb(t.dom,t.getWin(),t.serializer,t),t.annotator=Qf(t),t.formatter=qy(t),t.undoManager=Gy(t),t._nodeChangeDispatcher=new Tk(t),t._selectionOverrides=Uk(t),PC(t),Ok(t),Jv(t)||_k(t);var a=function(t){return Jv(t)?xu(null):kk(t)}(t);BC(t,a),function(t){ns(t)&&t.on("NodeChange",_(FC,t))}(t),Qy(t);var u=Qv(t);Zk(t),u.fold((function(){Qk(t).then((function(){return tT(t)}))}),(function(e){t.setProgressState(!0),Qk(t).then((function(){e().then((function(e){t.setProgressState(!1),tT(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),tT(t)}))}))}))},nT=pu.DOM,rT=function(t){var e=function(t){return t.getParam("doctype","<!DOCTYPE html>")}(t)+"<html><head>";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(t){return ts(t,"body_id","tinymce")}(t),r=function(t){return ts(t,"body_class","")}(t);return es(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+es(t)+'" />'),e+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'"><br></body></html>'},oT=function(t,e){var n,r,o,i,a=t.translate(function(t){return t.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string")}(t)),u=(n=t.id,r=a,e.height,o=function(t){return t.getParam("iframe_attrs",{})}(t),i=Ne.fromTag("iframe"),tr(i,o),tr(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Bu(i,"tox-edit-area__iframe"),i).dom;u.onload=function(){u.onload=null,t.fire("load")};var c=function(t,e){if(document.domain!==window.location.hostname&&Se.browser.isIE()){var n=By("mce");t[n]=function(){eT(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return nT.setAttrib(e,"src",r),!0}return!1}(t,u);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=u,t.iframeHTML=rT(t),nT.add(e.iframeContainer,u),c},iT=pu.DOM,aT=function(t,e,n){var r=wy.get(n),o=wy.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=_e.trim(n),r&&-1===_e.inArray(e,n)){if(_e.each(wy.dependencies(n),(function(n){aT(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(e){!function(t,e,n){var r=Tu.translate(["Failed to initialize plugin: {0}",e]);nd(t,"PluginLoadError",{message:r}),_y(r,n),ky(t,r)}(t,n,e)}}},uT=function(t){return t.replace(/^\-/,"")},cT=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},sT=function(t){var e=t.getElement();return t.inline?cT(null):function(t){var e=iT.create("div");return iT.insertAfter(e,t),cT(e)}(e)},lT=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,d(bs(t))?function(t){return t.theme.renderUI()}(t):w(bs(t))?function(t){var e=t.getElement(),n=bs(t)(t,e);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:e.offsetHeight,n}(t):sT(t)},fT=function(t){t.fire("ScriptsLoaded"),function(t){var e=_e.trim(as(t)),n=t.ui.registry.getAll().icons,r=Nt(Nt({},ly.get("default").icons),ly.get(e).icons);dt(r,(function(e,r){wt(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=bs(t);if(d(e)){t.settings.theme=uT(e);var n=xy.get(e);t.theme=new n(t,xy.urls[e]),t.theme.init&&t.theme.init(t,xy.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];_e.each(Cs(t).split(/[ ,]/),(function(n){aT(t,e,uT(n))}))}(t);var e=lT(t);!function(t,e){var n={show:L.from(e.show).getOr(C),hide:L.from(e.hide).getOr(C),disable:L.from(e.disable).getOr(C),isDisabled:L.from(e.isDisabled).getOr(D),enable:function(){t.mode.isReadOnly()||L.from(e.enable).map(A)}};t.ui=Nt(Nt({},t.ui),n)}(t,L.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,Ay(t),t.inline?eT(t):function(t,e){var n=oT(t,e);e.editorContainer&&(nT.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=nT.isHidden(e.editorContainer)),t.getElement().style.display="none",nT.setAttrib(t.id,"aria-hidden","true"),n||eT(t)}(t,n)},dT=pu.DOM,mT=function(t){return"-"===t.charAt(0)},gT=function(t,e){var n=ms(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===Tu.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,C,void 0,(function(){!function(t,e,n){Ty(t,"LanguageLoadError",Oy("language",e,n))}(e,o,n)}))}},hT=function(t,e,n){return L.from(e).filter((function(t){return t.length>0&&!ly.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:L.some(e)}}))},pT=function(t,e,n){var r=hT(e,"default",n),o=function(t){return L.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:L.none()}}))}(e).orThunk((function(){return hT(e,as(e),"")}));q(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([r,o]),(function(n){t.add(n.url,C,void 0,(function(){!function(t,e,n){Ty(t,"IconsLoadError",Oy("icons",e,n))}(e,n.url,n.name.getOrUndefined())}))}))},vT=function(t,e){var n=wu.ScriptLoader;!function(t,e,n,r){var o=bs(e);if(d(o)){if(!mT(o)&&!wt(xy.urls,o)){var i=function(t){return t.getParam("theme_url")}(e);i?xy.load(o,e.documentBaseURI.toAbsolute(i)):xy.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue((function(){xy.waitFor(o,r)}))}else r()}(n,t,e,(function(){gT(n,t),pT(n,t,e),function(t,e){_e.each(function(t){return t.getParam("external_plugins")}(t),(function(e,n){wy.load(n,e,C,void 0,(function(){Ey(t,e,n)})),t.settings.plugins+=" "+n})),_e.each(Cs(t).split(/[ ,]/),(function(n){if((n=_e.trim(n))&&!wy.urls[n])if(mT(n)){n=n.substr(1,n.length);var r=wy.dependencies(n);_e.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=wy.createUrl(r,n);wy.load(o.resource,o,C,void 0,(function(){Ey(t,o.prefix+o.resource+o.suffix,o.resource)}))}))}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};wy.load(n,o,C,void 0,(function(){Ey(t,o.prefix+o.resource+o.suffix,n)}))}}))}(t,e),n.loadQueue((function(){t.removed||fT(t)}),t,(function(){t.removed||fT(t)}))}))},bT=function(t){var e=t.id;Tu.setCode(ms(t));var n=function(){dT.unbind(window,"ready",n),t.render()};if(Fi.Event.domLoaded){if(t.getElement()&&Se.contentEditable){var r=Ne.fromDom(t.getElement()),o=function(t){return Y(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})}(r);t.on("remove",(function(){$(r.dom.attributes,(function(t){return rr(r,t.name)})),tr(r,o)})),t.ui.styleSheetLoader=function(t,e){return ao.forElement(t,{contentCssCors:xs(e),referrerPolicy:ds(e)})}(r,t),!function(t){return t.getParam("inline")}(t)?(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden"):t.inline=!0;var i=t.getElement().form||dT.getParent(e,"form");i&&(t.formElement=i,function(t){return t.getParam("hidden_input")}(t)&&!In(t.getElement())&&(dT.insertAfter(dT.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},dT.bind(i,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!function(t){return t.getParam("submit_patch")}(t)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=Cy(t),t.notificationManager=yy(t),function(t){return"xml"===t.getParam("encoding")}(t)&&t.on("GetContent",(function(t){t.save&&(t.content=dT.encode(t.content))})),function(t){return t.getParam("add_form_submit_trigger")}(t)&&t.on("submit",(function(){t.initialized&&t.save()})),function(t){return t.getParam("add_unload_trigger")}(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),vT(t,t.suffix)}}else dT.bind(window,"ready",n)},yT=function(t,e){return function(t,e){return tb(t).editor.addVisual(e)}(t,e)},wT={"font-size":"size","font-family":"face"},xT=function(t,e,n){return dp(Ne.fromDom(n),(function(e){return function(e){return ur(e,t).orThunk((function(){return"font"===Le(e)?yt(wT,t).bind((function(t){return nr(e,t)})):L.none()}))}(e)}),(function(t){return Be(Ne.fromDom(e),t)}))},CT=function(t){return function(e,n){return L.from(n).map(Ne.fromDom).filter(Fe).bind((function(n){return xT(t,e,n.dom).or(function(t,e){return L.from(pu.DOM.getStyle(e,t,!0))}(t,n.dom))})).getOr("")}},ST=CT("font-size"),kT=S((function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),CT("font-family")),TT=function(t){return zl(t.getBody()).map((function(t){var e=t.container();return Hn(e)?e.parentNode:e}))},OT=function(t,e){return function(t){return L.from(t.selection.getRng()).bind((function(e){var n=t.getBody();return e.startContainer===n&&0===e.startOffset?L.none():L.from(t.selection.getStart(!0))}))}(t).orThunk(_(TT,t)).map(Ne.fromDom).filter(Fe).bind(e)},ET=function(t,e){return OT(t,k(L.some,e))},_T=function(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=function(t){return _e.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return _e.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},RT=function(t){var e=t.split(/\s*,\s*/);return W(e,(function(t){return-1===t.indexOf(" ")||It(t,'"')||It(t,"'")?t:"'"+t+"'"})).join(",")},NT=function(t,e){var n=function(t){if("string"!=typeof t){var e=_e.extend({paste:t.paste,data:{paste:t.paste}},t);return{content:t.content,details:e}}return{content:t,details:{}}}(e);!function(t,e,n){Zv(t).editor.insertContent(e,n)}(t,n.content,n.details)},AT=_e.each,DT=_e.map,MT=_e.inArray,BT=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,a=this;if(!a.editor.removed){var u;if("mcefocus"!==t.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(u=a.editor,cm(u).each((function(t){return u.selection.setRng(t)}))):a.editor.focus()),(r=a.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var c=t.toLowerCase();if(o=a.commands.exec[c])return o(c,e,n),a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(AT(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1})),i)return i;if(a.editor.theme&&a.editor.theme.execCommand&&a.editor.theme.execCommand(t,e,n))return a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=a.editor.getDoc().execCommand(t,e,n)}catch(t){}return!!i&&(a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},t.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;AT(t,(function(t,r){AT(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,a){return e.call(n||r.editor,o,i,a)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":C,"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},mceFocus:function(e,n,r){Sm(t,r)},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(t){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");Se.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),AT("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,{value:r})},FontName:function(e,n,r){!function(t,e){var n=_T(t,e);t.formatter.toggle("fontname",{value:RT(n)}),t.nodeChanged()}(t,r)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:_T(t,e)}),t.nodeChanged()}(t,r)},LineHeight:function(e,n,r){!function(t,e){t.formatter.toggle("lineheight",{value:String(e)}),t.nodeChanged()}(t,r)},Lang:function(t,n,r){e.toggleFormat(t,{value:r.code,customValue:r.customCode})},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){NT(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){ck(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){AC(t,e)},mceRepaint:C,InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),qn);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return XS(t,r),!0}});var n=function(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=DT(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==MT(o,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return _C(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return function(t){return ET(t,(function(e){return kT(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return ET(t,(function(e){return ST(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return function(t){return ET(t,(function(e){var n=Ne.fromDom(t.getBody());return dp(e,(function(t){return ur(t,"line-height")}),_(Be,n)).getOrThunk((function(){var t=parseFloat(ir(e,"line-height")),n=parseFloat(ir(e,"font-size"));return String(t/n)}))})).getOr("")}(t)}),this)},t}(),zT="data-mce-contenteditable",PT=function(t,e,n){var r,o;Pu(t,e)&&!1===n?(o=e,Au(r=t)?r.dom.classList.remove(o):Mu(r,o),zu(r)):n&&Bu(t,e)},LT=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},IT=function(t,e){t.dom.contentEditable=e?"true":"false"},HT=function(t,e){var n=Ne.fromDom(t.getBody());PT(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){L.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,IT(n,!1),q(Iu(n,'*[contenteditable="true"]'),(function(t){Zn(t,zT,"true"),IT(t,!1)}))):(t.readonly=!1,IT(n,!0),function(t){q(Iu(t,'*[data-mce-contenteditable="true"]'),(function(t){rr(t,zT),IT(t,!0)}))}(n),LT(t,"StyleWithCSS",!1),LT(t,"enableInlineTableEditing",!1),LT(t,"enableObjectResizing",!1),xm(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},FT=function(t){return t.readonly},VT=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){FT(t)&&q(e,(function(t){t.attr(zT,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter(zT,(function(e){FT(t)&&q(e,(function(t){t.attr("contenteditable",t.attr(zT))}))})),t.serializer.addTempAttr(zT)},jT=function(t,e){if(function(t){return"click"===t.type}(e)&&!id.metaKeyPressed(e)){var n=Ne.fromDom(e.target);(function(t,e){return Zr(e,"a",(function(e){return Be(e,Ne.fromDom(t.getBody()))})).bind((function(t){return nr(t,"href")}))})(t,n).each((function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+((It(o=n,i="#")?function(t,e){return t.substring(e)}(o,i.length):o)+'"]'));r.length&&t.selection.scrollIntoView(r[0],!0)}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o,i}))}},UT=_e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),WT=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||D}return t.isNative=function(t){return!!UT[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=Bi(n,e||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i<a;i++){var u=o[i];if(!u.removed){if(u.once&&this.off(n,u.func),r.isImmediatePropagationStopped())return r;if(!1===u.func.call(this.scope,r))return r.preventDefault(),r}}return r},t.prototype.on=function(t,e,n,r){if(!1===e&&(e=D),e){var o={func:e,removed:!1};r&&_e.extend(o,r);for(var i=t.toLowerCase().split(" "),a=i.length;a--;){var u=i[a],c=this.bindings[u];c||(c=[],this.toggleEvent(u,!0)),c=n?At([o],c,!0):At(At([],c,!0),[o],!1),this.bindings[u]=c}}return this},t.prototype.off=function(t,e){var n=this;if(t)for(var r=t.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],a=this.bindings[i];if(!i)return dt(this.bindings,(function(t,e){n.toggleEvent(e,!1),delete n.bindings[e]})),this;if(a){if(e){var u=G(a,(function(t){return t.func===e}));a=u.fail,this.bindings[i]=a,q(u.pass,(function(t){t.removed=!0}))}else a.length=0;a.length||(this.toggleEvent(t,!1),delete this.bindings[i])}}else dt(this.bindings,(function(t,e){n.toggleEvent(e,!1)})),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),qT=function(t){return t._eventDispatcher||(t._eventDispatcher=new WT({scope:t,toggleEvent:function(e,n){WT.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},$T={fire:function(t,e,n){var r=this;if(r.removed&&"remove"!==t&&"detach"!==t)return e;var o=qT(r).fire(t,e);if(!1!==n&&r.parent)for(var i=r.parent();i&&!o.isPropagationStopped();)i.fire(t,o,!1),i=i.parent();return o},on:function(t,e,n){return qT(this).on(t,e,n)},off:function(t,e){return qT(this).off(t,e)},once:function(t,e){return qT(this).once(t,e)},hasEventListeners:function(t){return qT(this).has(t)}},GT=pu.DOM,KT=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=vs(t);return n?(t.eventRoot||(t.eventRoot=GT.select(n)[0]),t.eventRoot):t.getBody()},XT=function(t,e,n){!function(t){return!t.hidden&&!FT(t)}(t)?FT(t)&&jT(t,n):t.fire(e,n)},YT=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=KT(t,e);if(vs(t)){if(Ix||(Ix={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||Ix&&(dt(Ix,(function(e,n){t.dom.unbind(KT(t,n))})),Ix=null)}))),Ix[e])return;n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var a=o[i].getBody();(a===r||GT.isChildOf(r,a))&&XT(o[i],e,n)}},Ix[e]=n,GT.bind(r,e,n)}else n=function(n){XT(t,e,n)},GT.bind(r,e,n),t.delegates[e]=n}},JT=Nt(Nt({},$T),{bindPendingEventDelegates:function(){var t=this;_e.each(t._pendingNativeEvents,(function(e){YT(t,e)}))},toggleNativeEvent:function(t,e){var n=this;"focus"!==t&&"blur"!==t&&(n.removed||(e?n.initialized?YT(n,t):n._pendingNativeEvents?n._pendingNativeEvents.push(t):n._pendingNativeEvents=[t]:n.initialized&&(n.dom.unbind(KT(n,t),t,n.delegates[t]),delete n.delegates[t])))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(dt(t.delegates,(function(e,n){t.dom.unbind(KT(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),QT=["design","readonly"],ZT=function(t,e,n,r){var o=n[e.get()],i=n[r];try{i.activate()}catch(t){return void console.error("problem while activating editor mode "+r+":",t)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&HT(t,i.editorReadOnly),e.set(r),function(t,e){t.fire("SwitchMode",{mode:e})}(t,r)},tO=function(t){var e=xu("design"),n=xu({design:{activate:C,deactivate:C,editorReadOnly:!1},readonly:{activate:C,deactivate:C,editorReadOnly:!0}});return function(t){t.serializer?VT(t):t.on("PreInit",(function(){VT(t)}))}(t),function(t){t.on("ShowCaret",(function(e){FT(t)&&e.preventDefault()})),t.on("ObjectSelected",(function(e){FT(t)&&e.preventDefault()}))}(t),{isReadOnly:function(){return FT(t)},set:function(r){return function(t,e,n,r){if(r!==n.get()){if(!wt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?ZT(t,n,e,r):t.on("init",(function(){return ZT(t,n,e,r)}))}}(t,n.get(),e,r)},get:function(){return e.get()},register:function(t,e){n.set(function(t,e,n){var r;if(j(QT,e))throw new Error("Cannot override default mode "+e);return Nt(Nt({},t),((r={})[e]=Nt(Nt({},n),{deactivate:function(){try{n.deactivate()}catch(t){console.error("problem while deactivating editor mode "+e+":",t)}}}),r))}(n.get(),t,e))}}},eO=_e.each,nO=_e.explode,rO={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},oO=_e.makeMap("alt,ctrl,shift,meta,access"),iO=function(t){var e,n={};eO(nO(t.toLowerCase(),"+"),(function(t){t in oO?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=rO[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in oO)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,Se.mac?n.ctrl=!0:n.shift=!0),n.meta&&(Se.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},aO=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(eO(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}return t.prototype.add=function(t,e,n,r){var o=this,i=o.normalizeCommandFunc(n);return eO(nO(_e.trim(t)),(function(t){var n=o.createShortcut(t,e,i,r);o.shortcuts[n.id]=n})),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.normalizeCommandFunc=function(t){var e=this,n=t;return"string"==typeof n?function(){e.editor.execCommand(n,!1,null)}:_e.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},t.prototype.createShortcut=function(t,e,n,r){var o=_e.map(nO(t,">"),iO);return o[o.length-1]=_e.extend(o[o.length-1],{func:n,scope:r||this.editor}),_e.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&(e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&(e.alt===t.altKey&&e.shift===t.shiftKey&&(!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0))))},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),uO=function(){var t=function(){var t={},e={},n={},r={},o={},i={},a={},u=function(t,e){return function(n,r){return t[n.toLowerCase()]=Nt(Nt({},r),{type:e})}};return{addButton:u(t,"button"),addGroupToolbarButton:u(t,"grouptoolbarbutton"),addToggleButton:u(t,"togglebutton"),addMenuButton:u(t,"menubutton"),addSplitButton:u(t,"splitbutton"),addMenuItem:u(e,"menuitem"),addNestedMenuItem:u(e,"nestedmenuitem"),addToggleMenuItem:u(e,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:function(t,e){return r[t.toLowerCase()]=e},getAll:function(){return{buttons:t,menuItems:e,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}}}();return{addAutocompleter:t.addAutocompleter,addButton:t.addButton,addContextForm:t.addContextForm,addContextMenu:t.addContextMenu,addContextToolbar:t.addContextToolbar,addIcon:t.addIcon,addMenuButton:t.addMenuButton,addMenuItem:t.addMenuItem,addNestedMenuItem:t.addNestedMenuItem,addSidebar:t.addSidebar,addSplitButton:t.addSplitButton,addToggleButton:t.addToggleButton,addGroupToolbarButton:t.addGroupToolbarButton,addToggleMenuItem:t.addToggleMenuItem,getAll:t.getAll}},cO=pu.DOM,sO=_e.extend,lO=_e.each,fO=_e.resolve,dO=Se.ie,mO=function(){function t(t,e,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,sO(this,JT),this.settings=uy(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(wu.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),pu.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),Ou.languageLoad=this.settings.language_load,Ou.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new Vm(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new aO(this),this.editorCommands=new BT(this),this.settings.cache_suffix&&(Se.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:uO(),styleSheetLoader:void 0,show:C,hide:C,enable:C,disable:C,isDisabled:D};var o=tO(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=su.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))}return t.prototype.render=function(){bT(this)},t.prototype.focus=function(t){this.execCommand("mceFocus",!1,t)},t.prototype.hasFocus=function(){return wm(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this,i=o.settings[t];if(i)return o.callbackLookup&&(r=o.callbackLookup[t])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?fO(r):0,i=fO(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return Tu.translate(t)},t.prototype.getParam=function(t,e,n){return sy(this,t,e,n)},t.prototype.hasPlugin=function(t,e){return!!j(Cs(this).split(/[ ,]/),t)&&(!e||void 0!==wy.get(t))},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){var t=this;t.hidden&&(t.hidden=!1,t.inline?t.getBody().contentEditable="true":(cO.show(t.getContainer()),cO.hide(t.id)),t.load(),t.fire("show"))},t.prototype.hide=function(){var t=this,e=t.getDoc();t.hidden||(dO&&e&&!t.inline&&e.execCommand("SelectAll"),t.save(),t.inline?(t.getBody().contentEditable="false",t===t.editorManager.focusedEditor&&(t.editorManager.focusedEditor=null)):(cO.hide(t.getContainer()),cO.setStyle(t.id,"display",t.orgDisplay)),t.hidden=!0,t.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this,r=n.getElement();if(n.removed)return"";if(r){(t=t||{}).load=!0;var o=In(r)?r.value:r.innerHTML;return e=n.setContent(o,t),t.element=r,t.no_events||n.fire("LoadContent",t),t.element=r=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,In(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=cO.getParent(r.id,"form"))&&lO(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return zb(this,t,e)},t.prototype.getContent=function(t){return Bb(this,t)},t.prototype.insertContent=function(t,e){e&&(t=sO({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?zb(this,this.startContent,{format:"raw"}):zb(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){var t=this;return t.container||(t.container=cO.get(t.editorContainer||t.id+"_parent")),t.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=cO.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t,e=this;return e.contentWindow||(t=e.iframeElement)&&(e.contentWindow=t.contentWindow),e.contentWindow},t.prototype.getDoc=function(){var t,e=this;return e.contentDocument||(t=e.getWin())&&(e.contentDocument=t.document),e.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this,o=r.settings;return o.urlconverter_callback?r.execCallback("urlconverter_callback",t,n,!0,e):!o.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:o.relative_urls?r.documentBaseURI.toRelative(t):t=r.documentBaseURI.toAbsolute(t,o.remove_script_host)},t.prototype.addVisual=function(t){yT(this,t)},t.prototype.remove=function(){Ib(this)},t.prototype.destroy=function(t){Hb(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),gO=pu.DOM,hO=_e.explode,pO=_e.each,vO=_e.extend,bO=0,yO=!1,wO=[],xO=[],CO=function(t){var e=t.type;pO(OO.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}}))},SO=function(t){t!==yO&&(t?su(window).on("resize scroll",CO):su(window).off("resize scroll",CO),yO=t)},kO=function(t){var e=xO;delete wO[t.id];for(var n=0;n<wO.length;n++)if(wO[n]===t){wO.splice(n,1);break}return xO=K(xO,(function(e){return t!==e})),OO.activeEditor===t&&(OO.activeEditor=xO.length>0?xO[0]:null),OO.focusedEditor===t&&(OO.focusedEditor=null),e.length!==xO.length},TO="CSS1Compat"!==document.compatMode,OO=Nt(Nt({},$T),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:su,majorVersion:"5",minorVersion:"10.0",releaseDate:"2021-10-11",editors:wO,i18n:Tu,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,n=this,r="";e=Vm.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)t=i.base||i.baseURL,r=i.suffix;else{for(var a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c;if(""!==(c=a[u].src||"")){var s=c.substring(c.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(c)){-1!==s.indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/"));break}}}if(!t&&document.currentScript)-1!==(c=document.currentScript.src).indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/"))}n.baseURL=new Vm(e).toAbsolute(t),n.documentBaseURL=e,n.baseURI=new Vm(n.baseURL),n.suffix=r,(o=n).on("AddEditor",_(gm,o)),o.on("RemoveEditor",_(hm,o))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&dt(r,(function(t,e){Ou.PluginManager.urls[e]=t}))},init:function(t){var e,n=this,r=_e.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),o=function(t){var e=t.id;return e||(e=yt(t,"name").filter((function(t){return!gO.get(t)})).getOrThunk(gO.uniqueId),t.setAttribute("id",e)),e},i=function(t,e){return e.constructor===RegExp?e.test(t.className):gO.hasClass(t,e)},a=function(t){e=t},u=function(){var e,c=0,s=[],l=function(t,r,o){var i=new mO(t,r,n);s.push(i),i.on("init",(function(){++c===e.length&&a(s)})),i.targetElm=i.targetElm||o,i.render()};gO.unbind(window,"ready",u),function(e){var r=t[e];if(r)r.apply(n,[])}("onpageload"),e=su.unique(function(t){var e=[];if(Se.browser.isIE()&&Se.browser.version.major<11)return _y("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(TO)return _y("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return pO(t.types,(function(t){e=e.concat(gO.select(t.selector))})),e;if(t.selector)return gO.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var n=t.elements||"";n.length>0&&pO(hO(n),(function(t){var n=gO.get(t);n?e.push(n):pO(document.forms,(function(n){pO(n.elements,(function(n){n.name===t&&(t="mce_editor_"+bO++,gO.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":pO(gO.select("textarea"),(function(n){t.editor_deselector&&i(n,t.editor_deselector)||t.editor_selector&&!i(n,t.editor_selector)||e.push(n)}))}return e}(t)),t.types?pO(t.types,(function(n){_e.each(e,(function(e){return!gO.is(e,n.selector)||(l(o(e),vO({},t,n),e),!1)}))})):(_e.each(e,(function(t){var e;(e=n.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(kO(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)})),0===(e=_e.grep(e,(function(t){return!n.get(t.id)}))).length?a([]):pO(e,(function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in r}(t,e)?l(o(e),t,e):_y("Could not initialize inline editor on invalid inline target element",e)})))};return n.settings=t,gO.bind(window,"ready",u),new to((function(t){e?t(e):a=function(e){t(e)}}))},get:function(t){return 0===arguments.length?xO.slice(0):d(t)?Q(xO,(function(e){return e.id===t})).getOr(null):x(t)&&xO[t]?xO[t]:null},add:function(t){var e=this;return wO[t.id]===t||(null===e.get(t.id)&&("length"!==t.id&&(wO[t.id]=t),wO.push(t),xO.push(t)),SO(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),Hx||(Hx=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Hx))),t},createEditor:function(t,e){return this.add(new mO(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!d(t))return n=t,h(r.get(n.id))?null:(kO(n)&&r.fire("RemoveEditor",{editor:n}),0===xO.length&&window.removeEventListener("beforeunload",Hx),n.remove(),SO(xO.length>0),n);pO(gO.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=xO.length-1;e>=0;e--)r.remove(xO[e])},execCommand:function(t,e,n){var r=this,o=r.get(n);switch(t){case"mceAddEditor":return r.get(n)||new mO(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",!1,n),!0)}return!!r.activeEditor&&r.activeEditor.execCommand(t,e,n)},triggerSave:function(){pO(xO,(function(t){t.save()}))},addI18n:function(t,e){Tu.add(t,e)},translate:function(t){return Tu.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new Vm(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new Vm(this.baseURL)}});OO.setup();var EO,_O,RO,NO,AO=Math.min,DO=Math.max,MO=Math.round,BO=function(t,e,n){var r=e.x,o=e.y,i=t.w,a=t.h,u=e.w,c=e.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=u),"c"===s[0]&&(o+=MO(c/2)),"c"===s[1]&&(r+=MO(u/2)),"b"===s[3]&&(o-=a),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=MO(a/2)),"c"===s[4]&&(r-=MO(i/2)),zO(r,o,i,a)},zO=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},PO={inflate:function(t,e,n){return zO(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:BO,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if((o=BO(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=DO(t.x,e.x),r=DO(t.y,e.y),o=AO(t.x+t.w,e.x+e.w),i=AO(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:zO(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,a=t.y+t.h,u=e.x+e.w,c=e.y+e.h,s=DO(0,e.x-r),l=DO(0,e.y-o),f=DO(0,i-u),d=DO(0,a-c);return r+=s,o+=l,n&&(i+=s,a+=l,r-=f,o-=d),zO(r,o,(i-=f)-r,(a-=d)-o)},create:zO,fromClientRect:function(t){return zO(t.left,t.top,t.width,t.height)}},LO=(EO={},_O={},{load:function(t,e){var n='Script at URL "'+e+'" failed to load',r='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==EO[t])return EO[t];var o=new to((function(o,i){var a=function(t,e,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),t.apply(null,e))}},a=i(t),u=i(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r||null!==o||(o=setTimeout((function(){return u.apply(null,t)}),n))},resolve:a,reject:u}}(o,i);_O[t]=a.resolve,wu.ScriptLoader.loadScript(e,(function(){return a.start(r)}),(function(){return a.reject(n)}))}));return EO[t]=o,o},add:function(t,e){void 0!==_O[t]&&(_O[t](e),delete _O[t]),EO[t]=to.resolve(e)}}),IO=_e.each,HO=_e.extend,FO=function(){};FO.extend=RO=function(t){var e=this.prototype,n=function(){var t,e,n,r=this;if(!NO&&(r.init&&r.init.apply(r,arguments),e=r.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(r,arguments)},r=function(){return this};NO=!0;var o=new this;return NO=!1,t.Mixins&&(IO(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),e.Mixins&&(t.Mixins=e.Mixins.concat(t.Mixins))),t.Methods&&IO(t.Methods.split(","),(function(e){t[e]=r})),t.Properties&&IO(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){var e=this;return void 0!==t?(e[n]=t,e):e[n]}})),t.Statics&&IO(t.Statics,(function(t,e){n[e]=t})),t.Defaults&&e.Defaults&&(t.Defaults=HO({},e.Defaults,t.Defaults)),dt(t,(function(t,n){"function"==typeof t&&e[n]?o[n]=function(t,n){return function(){var r=this,o=r._super;r._super=e[t];var i=n.apply(r,arguments);return r._super=o,i}}(n,t):o[n]=t})),n.prototype=o,n.constructor=n,n.extend=RO,n};var VO,jO=Math.min,UO=Math.max,WO=Math.round,qO={serialize:function(t){var e=JSON.stringify(t);return d(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},parse:function(t){try{return JSON.parse(t)}catch(t){}}},$O={callbacks:{},count:0,send:function(t){var e=this,n=pu.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},GO=Nt(Nt({},$T),{send:function(t){var e,n=0,r=function(){!t.async||4===e.readyState||n++>1e4?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,n>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):oo.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",GO.fire("beforeInitialize",{settings:t}),(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&_e.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=GO.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();oo.setTimeout(r,10)}}),KO=_e.extend,XO=function(){function t(t){this.settings=KO({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=KO(this.settings,t);r.success=function(t,o){void 0===(t=qO.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=qO.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",GO.send(r)},t}();try{var YO="__storage_test__";(VO=window.localStorage).setItem(YO,YO),VO.removeItem(YO)}catch(t){VO=function(){var t={},e=[],n={getItem:function(e){return t[e]||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter((function(t){return t===n})),delete t[n]},clear:function(){e=[],t={}},length:0};return Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n}()}var JO={geom:{Rect:PO},util:{Promise:to,Delay:oo,Tools:_e,VK:id,URI:Vm,Class:FO,EventDispatcher:WT,Observable:$T,I18n:Tu,XHR:GO,JSON:qO,JSONRequest:XO,JSONP:$O,LocalStorage:VO,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=UO(0,jO(e,1)),i=UO(0,jO(i,1)),0!==e){var a=t/60,u=i*e,c=u*(1-Math.abs(a%2-1)),s=i-u;switch(Math.floor(a)){case 0:n=u,r=c,o=0;break;case 1:n=c,r=u,o=0;break;case 2:n=0,r=u,o=c;break;case 3:n=0,r=c,o=u;break;case 4:n=c,r=0,o=u;break;case 5:n=u,r=0,o=c;break;default:n=r=o=0}n=WO(255*(n+s)),r=WO(255*(r+s)),o=WO(255*(o+s))}else n=r=o=WO(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return function(t,e,n){var r,o;o=0;var i=jO(t/=255,jO(e/=255,n/=255)),a=UO(t,UO(e,n));return i===a?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,o=a,{h:WO(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(a-i))),s:WO(100*r),v:WO(100*o)})}(n,r,o)},e.toHex=function(){var t=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e},ImageUploader:function(t){var e=Dy(),n=Ly(t,e);return{upload:function(e,r){return void 0===r&&(r=!0),n.upload(e,r?Py(t):void 0)}}}},dom:{EventUtils:Fi,Sizzle:Sa,DomQuery:su,TreeWalker:uo,TextSeeker:Zu,DOMUtils:pu,ScriptLoader:wu,RangeUtils:Cd,Serializer:Mb,StyleSheetLoader:io,ControlSelection:ud,BookmarkManager:Zf,Selection:lb,Event:Fi.Event},html:{Styles:Ai,Entities:yi,Node:Mm,Schema:Ri,SaxParser:$m,DomParser:_b,Writer:Zm,Serializer:tg},Env:Se,AddOnManager:Ou,Annotator:Qf,Formatter:qy,UndoManager:Gy,EditorCommands:BT,WindowManager:Cy,NotificationManager:yy,EditorObservable:JT,Shortcuts:aO,Editor:mO,FocusManager:sm,EditorManager:OO,DOM:pu.DOM,ScriptLoader:wu.ScriptLoader,PluginManager:wy,ThemeManager:xy,IconManager:ly,Resource:LO,trim:_e.trim,isArray:_e.isArray,is:_e.is,toArray:_e.toArray,makeMap:_e.makeMap,each:_e.each,map:_e.map,grep:_e.grep,inArray:_e.inArray,extend:_e.extend,create:_e.create,walk:_e.walk,createNS:_e.createNS,resolve:_e.resolve,explode:_e.explode,_addCacheSuffix:_e._addCacheSuffix,isOpera:Se.opera,isWebKit:Se.webkit,isIE:Se.ie,isGecko:Se.gecko,isMac:Se.mac},QO=_e.extend(OO,JO);!function(t){window.tinymce=t,window.tinyMCE=t}(QO),function(e){try{t.exports=e}catch(t){}}(QO)}()}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})(),(()=>{"use strict";n(7575),n(6890),n(8860),n(5209),n(3356),n(8619),n(2540),n(1295),n(2170),n(2682),n(1236),n(6884),n(4400),n(5053),n(7259),n(4926),n(5031),n(397);var t=n(9325);n(9722),n(1014),n(4048),n(7804),n(7499),n(2680);n(5187),n.g.processPastedContent=t.processPastedContent,n.g.current_selection_range=null,n.g.editor=null})()})();
\ No newline at end of file