egroupware/api/js/tinymce/tinymce.min.js
2019-01-18 16:27:19 +01:00

2 lines
1.4 MiB

// 5.0.0-rc-1-build.17 (TBD)
!function(){"use strict";var o=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},H=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}},q=function(e){return function(){return e}},$=function(e){return e};function d(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var e,t,n,r,i,a,u,s,c,l,f,m,g,p,h,v,b,y=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}},C=q(!1),x=q(!0),w=C,N=x,E=function(){return S},S=(r={fold:function(e,t){return e()},is:w,isSome:w,isNone:N,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:E,ap:E,each:function(){},bind:E,flatten:E,exists:w,forall:N,filter:E,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:q("none()")},Object.freeze&&Object.freeze(r),r),k=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:N,isNone:w,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return k(e(n))},ap:function(e){return e.fold(E,function(e){return k(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:S},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(w,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},A={some:k,none:E,from:function(e){return null===e||e===undefined?S:k(e)}},T=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},R=T("string"),D=T("object"),B=T("array"),O=T("null"),_=T("boolean"),P=T("function"),I=T("number"),L=(i=Array.prototype.indexOf)===undefined?function(e,t){return X(e,t)}:function(e,t){return i.call(e,t)},M=function(e,t){return-1<L(e,t)},W=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},F=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},K=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o,e)?n:r).push(a)}return{pass:n,fail:r}},U=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},z=function(e,t,n){return F(e,function(e){n=t(n,e)}),n},V=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return A.some(o)}return A.none()},j=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return A.some(n);return A.none()},X=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},Y=Array.prototype.push,G=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);Y.apply(t,e[n])}return t}(W(e,t))},J=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},Q=Array.prototype.slice,Z=function(e,t){return U(e,function(e){return!M(t,e)})},ee=function(e){return 0===e.length?A.none():A.some(e[0])},te=function(e){return 0===e.length?A.none():A.some(e[e.length-1])},ne=P(Array.from)?Array.from:function(e){return Q.call(e)},re="undefined"!=typeof window?window:Function("return this;")(),oe=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:re,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},ie={getOrDie:function(e,t){var n=oe(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n}},ae=function(){return ie.getOrDie("URL")},ue={createObjectURL:function(e){return ae().createObjectURL(e)},revokeObjectURL:function(e){ae().revokeObjectURL(e)}},se=navigator,ce=se.userAgent,le=function(e){return"matchMedia"in window&&matchMedia(e).matches};g=/Android/.test(ce),u=(u=!(a=/WebKit/.test(ce))&&/MSIE/gi.test(ce)&&/Explorer/gi.test(se.appName))&&/MSIE (\w+)\./.exec(ce)[1],s=-1!==ce.indexOf("Trident/")&&(-1!==ce.indexOf("rv:")||-1!==se.appName.indexOf("Netscape"))&&11,c=-1!==ce.indexOf("Edge/")&&!u&&!s&&12,u=u||s||c,l=!a&&!s&&/Gecko/.test(ce),f=-1!==ce.indexOf("Mac"),m=/(iPad|iPhone)/.test(ce),p="FormData"in window&&"FileReader"in window&&"URL"in window&&!!ue.createObjectURL,h=le("only screen and (max-device-width: 480px)")&&(g||m),v=le("only screen and (min-width: 800px)")&&(g||m),b=-1!==ce.indexOf("Windows Phone"),c&&(a=!1);var fe,de={opera:!1,webkit:a,ie:u,gecko:l,mac:f,iOS:m,android:g,contentEditable:!m||p||534<=parseInt(ce.match(/AppleWebKit\/(\d*)/)[1],10),transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==u,range:window.getSelection&&"Range"in window,documentMode:u&&!c?document.documentMode||7:10,fileApi:p,ceFalse:!1===u||8<u,cacheSuffix:null,container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===u||11<u,desktop:!h&&!v,windowsPhone:b},me=window.Promise?window.Promise:function(){function r(e,t){return function(){e.apply(t,arguments)}}var e=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,r(o,this),r(u,this))},t=i.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)};function a(r){var o=this;null!==this._state?t(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(o._value)}catch(n){return void r.reject(n)}r.resolve(t)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void l(r(t,e),r(o,this),r(u,this))}this._state=!0,this._value=e,s.call(this)}catch(n){u.call(this,n)}}function u(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;e<t;e++)a.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function l(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}return i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(n,r){var o=this;return new i(function(e,t){a.call(o,new c(n,r,e,t))})},i.all=function(){var s=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e<s.length;e++)u(e,s[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i}(),ge=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},pe=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},he=function(t,n){var r,e;return(e=function(){var e=arguments;clearTimeout(r),r=ge(function(){t.apply(this,e)},n)}).stop=function(){clearTimeout(r)},e},ve={requestAnimationFrame:function(e,t){fe?fe.then(e):fe=new me(function(e){t||(t=document.body),function(e,t){var n,r=window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=window[o[n]+"RequestAnimationFrame"];r||(r=function(e){window.setTimeout(e,0)}),r(e,t)}(e,t)}).then(e)},setTimeout:ge,setInterval:pe,setEditorTimeout:function(e,t,n){return ge(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r;return r=pe(function(){e.removed?clearInterval(r):t()},n)},debounce:he,throttle:he,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},be=/^(?:mouse|contextmenu)|click/,ye={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},Ce=function(){return!1},xe=function(){return!0},we=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},Ne=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},Ee=function(e,t){var n,r,o=t||{};for(n in e)ye[n]||(o[n]=e[n]);if(o.target||(o.target=o.srcElement||document),de.experimentalShadowDom&&(o.target=function(e,t){if(e.composedPath){var n=e.composedPath();if(n&&0<n.length)return n[0]}return t}(e,o.target)),e&&be.test(e.type)&&e.pageX===undefined&&e.clientX!==undefined){var i=o.target.ownerDocument||document,a=i.documentElement,u=i.body;o.pageX=e.clientX+(a&&a.scrollLeft||u&&u.scrollLeft||0)-(a&&a.clientLeft||u&&u.clientLeft||0),o.pageY=e.clientY+(a&&a.scrollTop||u&&u.scrollTop||0)-(a&&a.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=xe,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=xe,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},!(o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=xe,o.stopPropagation()})==((r=o).isDefaultPrevented===xe||r.isDefaultPrevented===Ce)&&(o.isDefaultPrevented=Ce,o.isPropagationStopped=Ce,o.isImmediatePropagationStopped=Ce),"undefined"==typeof o.metaKey&&(o.metaKey=!1),o},Se=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},a=function(){Ne(e,"DOMContentLoaded",a),Ne(e,"load",a),n.domLoaded||(n.domLoaded=!0,t(o))},u=function(){i()&&(Ne(r,"readystatechange",u),a())},s=function(){try{r.documentElement.doScroll("left")}catch(e){return void ve.setTimeout(s)}a()};!r.addEventListener||de.ie&&de.ie<11?(we(r,"readystatechange",u),r.documentElement.doScroll&&e.self===e.top&&s()):i()?a():we(e,"DOMContentLoaded",a),we(e,"load",a)}},ke=function(){var m,g,p,h,v,b=this,y={};g="mce-data-"+(+new Date).toString(32),h="onmouseenter"in document.documentElement,p="onfocusin"in document.documentElement,v={mouseenter:"mouseover",mouseleave:"mouseout"},m=1,b.domLoaded=!1,b.events=y;var C=function(e,t){var n,r,o,i,a=y[t];if(n=a&&a[e.type])for(r=0,o=n.length;r<o;r++)if((i=n[r])&&!1===i.func.call(i.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return};b.bind=function(e,t,n,r){var o,i,a,u,s,c,l,f=window,d=function(e){C(Ee(e||f.event),o)};if(e&&3!==e.nodeType&&8!==e.nodeType){for(e[g]?o=e[g]:(o=m++,e[g]=o,y[o]={}),r=r||e,a=(t=t.split(" ")).length;a--;)c=d,s=l=!1,"DOMContentLoaded"===(u=t[a])&&(u="ready"),b.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,Ee({type:u})):(h||(s=v[u])&&(c=function(e){var t,n;if(t=e.currentTarget,(n=e.relatedTarget)&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=Ee(e||f.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,C(e,o))}),p||"focusin"!==u&&"focusout"!==u||(l=!0,s="focusin"===u?"focus":"blur",c=function(e){(e=Ee(e||f.event)).type="focus"===e.type?"focusin":"focusout",C(e,o)}),(i=y[o][u])?"ready"===u&&b.domLoaded?n({type:u}):i.push({func:n,scope:r}):(y[o][u]=i=[{func:n,scope:r}],i.fakeName=s,i.capture=l,i.nativeHandler=c,"ready"===u?Se(e,c,b):we(e,s||u,c,l)));return e=i=0,n}},b.unbind=function(e,t,n){var r,o,i,a,u,s;if(!e||3===e.nodeType||8===e.nodeType)return b;if(r=e[g]){if(s=y[r],t){for(i=(t=t.split(" ")).length;i--;)if(o=s[u=t[i]]){if(n)for(a=o.length;a--;)if(o[a].func===n){var c=o.nativeHandler,l=o.fakeName,f=o.capture;(o=o.slice(0,a).concat(o.slice(a+1))).nativeHandler=c,o.fakeName=l,o.capture=f,s[u]=o}n&&0!==o.length||(delete s[u],Ne(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in s)o=s[u],Ne(e,o.fakeName||u,o.nativeHandler,o.capture);s={}}for(u in s)return b;delete y[r];try{delete e[g]}catch(d){e[g]=null}}return b},b.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return b;for((n=Ee(null,n)).type=t,n.target=e;(r=e[g])&&C(n,r),(e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow)&&!n.isPropagationStopped(););return b},b.clean=function(e){var t,n,r=b.unbind;if(!e||3===e.nodeType||8===e.nodeType)return b;if(e[g]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[g]&&r(e);return b},b.destroy=function(){y={}},b.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}};ke.Event=new ke,ke.Event.bind(window,"ready",function(){});var Te,Ae,Re,De,Be,Oe,_e,Pe,Ie,Le,Me,Fe,Ue,ze,Ve,je,He,qe,$e="sizzle"+-new Date,We=window.document,Ke=0,Xe=0,Ye=Tt(),Ge=Tt(),Je=Tt(),Qe=function(e,t){return e===t&&(Me=!0),0},Ze=typeof undefined,et={}.hasOwnProperty,tt=[],nt=tt.pop,rt=tt.push,ot=tt.push,it=tt.slice,at=tt.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},ut="[\\x20\\t\\r\\n\\f]",st="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ct="\\["+ut+"*("+st+")(?:"+ut+"*([*^$|!~]?=)"+ut+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+st+"))|)"+ut+"*\\]",lt=":("+st+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ct+")*)|.*)\\)|)",ft=new RegExp("^"+ut+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ut+"+$","g"),dt=new RegExp("^"+ut+"*,"+ut+"*"),mt=new RegExp("^"+ut+"*([>+~]|"+ut+")"+ut+"*"),gt=new RegExp("="+ut+"*([^\\]'\"]*?)"+ut+"*\\]","g"),pt=new RegExp(lt),ht=new RegExp("^"+st+"$"),vt={ID:new RegExp("^#("+st+")"),CLASS:new RegExp("^\\.("+st+")"),TAG:new RegExp("^("+st+"|[*])"),ATTR:new RegExp("^"+ct),PSEUDO:new RegExp("^"+lt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ut+"*(even|odd|(([+-]|)(\\d*)n|)"+ut+"*(?:([+-]|)"+ut+"*(\\d+)|))"+ut+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+ut+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ut+"*((?:-\\d)?\\d*)"+ut+"*\\)|)(?=[^-]|$)","i")},bt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,Ct=/^[^{]+\{\s*\[native \w/,xt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,wt=/[+~]/,Nt=/'|\\/g,Et=new RegExp("\\\\([\\da-f]{1,6}"+ut+"?|("+ut+")|.)","ig"),St=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{ot.apply(tt=it.call(We.childNodes),We.childNodes),tt[We.childNodes.length].nodeType}catch(jN){ot={apply:tt.length?function(e,t){rt.apply(e,it.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var kt=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:We)!==Ue&&Fe(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Ue).nodeType)&&9!==u)return[];if(Ve&&!r){if(o=xt.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&qe(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return ot.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&Ae.getElementsByClassName)return ot.apply(n,t.getElementsByClassName(a)),n}if(Ae.qsa&&(!je||!je.test(e))){if(f=l=$e,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=Oe(e),(l=t.getAttribute("id"))?f=l.replace(Nt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+It(c[s]);d=wt.test(e)&&_t(t.parentNode)||t,m=c.join(",")}if(m)try{return ot.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{l||t.removeAttribute("id")}}}return Pe(e.replace(ft,"$1"),t,n,r)};function Tt(){var n=[];return function r(e,t){return n.push(e+" ")>Re.cacheLength&&delete r[n.shift()],r[e+" "]=t}}function At(e){return e[$e]=!0,e}function Rt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function Dt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Bt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function Ot(a){return At(function(i){return i=+i,At(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function _t(e){return e&&typeof e.getElementsByTagName!==Ze&&e}for(Te in Ae=kt.support={},Be=kt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Fe=kt.setDocument=function(e){var t,s=e?e.ownerDocument||e:We,n=s.defaultView;return s!==Ue&&9===s.nodeType&&s.documentElement?(ze=(Ue=s).documentElement,Ve=!Be(s),n&&n!==function r(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){Fe()},!1):n.attachEvent&&n.attachEvent("onunload",function(){Fe()})),Ae.attributes=!0,Ae.getElementsByTagName=!0,Ae.getElementsByClassName=Ct.test(s.getElementsByClassName),Ae.getById=!0,Re.find.ID=function(e,t){if(typeof t.getElementById!==Ze&&Ve){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},Re.filter.ID=function(e){var t=e.replace(Et,St);return function(e){return e.getAttribute("id")===t}},Re.find.TAG=Ae.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Ze)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"!==e)return i;for(;n=i[o++];)1===n.nodeType&&r.push(n);return r},Re.find.CLASS=Ae.getElementsByClassName&&function(e,t){if(Ve)return t.getElementsByClassName(e)},He=[],je=[],Ae.disconnectedMatch=!0,je=je.length&&new RegExp(je.join("|")),He=He.length&&new RegExp(He.join("|")),t=Ct.test(ze.compareDocumentPosition),qe=t||Ct.test(ze.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Qe=t?function(e,t){if(e===t)return Me=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!Ae.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===We&&qe(We,e)?-1:t===s||t.ownerDocument===We&&qe(We,t)?1:Le?at.call(Le,e)-at.call(Le,t):0:4&n?-1:1)}:function(e,t){if(e===t)return Me=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:Le?at.call(Le,e)-at.call(Le,t):0;if(o===i)return Rt(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?Rt(a[r],u[r]):a[r]===We?-1:u[r]===We?1:0},s):Ue},kt.matches=function(e,t){return kt(e,null,null,t)},kt.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Ue&&Fe(e),t=t.replace(gt,"='$1']"),Ae.matchesSelector&&Ve&&(!He||!He.test(t))&&(!je||!je.test(t)))try{var n=(void 0).call(e,t);if(n||Ae.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(jN){}return 0<kt(t,Ue,null,[e]).length},kt.contains=function(e,t){return(e.ownerDocument||e)!==Ue&&Fe(e),qe(e,t)},kt.attr=function(e,t){(e.ownerDocument||e)!==Ue&&Fe(e);var n=Re.attrHandle[t.toLowerCase()],r=n&&et.call(Re.attrHandle,t.toLowerCase())?n(e,t,!Ve):undefined;return r!==undefined?r:Ae.attributes||!Ve?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},kt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},kt.uniqueSort=function(e){var t,n=[],r=0,o=0;if(Me=!Ae.detectDuplicates,Le=!Ae.sortStable&&e.slice(0),e.sort(Qe),Me){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return Le=null,e},De=kt.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=De(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=De(t);return n},(Re=kt.selectors={cacheLength:50,createPseudo:At,match:vt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Et,St),e[3]=(e[3]||e[4]||e[5]||"").replace(Et,St),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||kt.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&kt.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return vt.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&pt.test(n)&&(t=Oe(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Et,St).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Ye[e+" "];return t||(t=new RegExp("(^|"+ut+")"+e+"("+ut+"|$)"))&&Ye(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Ze&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=kt.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1<t.indexOf(o):"$="===r?o&&t.slice(-o.length)===o:"~="===r?-1<(" "+t+" ").indexOf(o):"|="===r&&(t===o||t.slice(0,o.length+1)===o+"-"))}},CHILD:function(m,e,t,g,p){var h="nth"!==m.slice(0,3),v="last"!==m.slice(-4),b="of-type"===e;return 1===g&&0===p?function(e){return!!e.parentNode}:function(e,t,n){var r,o,i,a,u,s,c=h!==v?"nextSibling":"previousSibling",l=e.parentNode,f=b&&e.nodeName.toLowerCase(),d=!n&&!b;if(l){if(h){for(;c;){for(i=e;i=i[c];)if(b?i.nodeName.toLowerCase()===f:1===i.nodeType)return!1;s=c="only"===m&&!s&&"nextSibling"}return!0}if(s=[v?l.firstChild:l.lastChild],v&&d){for(u=(r=(o=l[$e]||(l[$e]={}))[m]||[])[0]===Ke&&r[1],a=r[0]===Ke&&r[2],i=u&&l.childNodes[u];i=++u&&i&&i[c]||(a=u=0)||s.pop();)if(1===i.nodeType&&++a&&i===e){o[m]=[Ke,u,a];break}}else if(d&&(r=(e[$e]||(e[$e]={}))[m])&&r[0]===Ke)a=r[1];else for(;(i=++u&&i&&i[c]||(a=u=0)||s.pop())&&((b?i.nodeName.toLowerCase()!==f:1!==i.nodeType)||!++a||(d&&((i[$e]||(i[$e]={}))[m]=[Ke,a]),i!==e)););return(a-=p)===g||a%g==0&&0<=a/g}}},PSEUDO:function(e,i){var t,a=Re.pseudos[e]||Re.setFilters[e.toLowerCase()]||kt.error("unsupported pseudo: "+e);return a[$e]?a(i):1<a.length?(t=[e,e,"",i],Re.setFilters.hasOwnProperty(e.toLowerCase())?At(function(e,t){for(var n,r=a(e,i),o=r.length;o--;)e[n=at.call(e,r[o])]=!(t[n]=r[o])}):function(e){return a(e,0,t)}):a}},pseudos:{not:At(function(e){var r=[],o=[],u=_e(e.replace(ft,"$1"));return u[$e]?At(function(e,t,n,r){for(var o,i=u(e,null,r,[]),a=e.length;a--;)(o=i[a])&&(e[a]=!(t[a]=o))}):function(e,t,n){return r[0]=e,u(r,null,n,o),!o.pop()}}),has:At(function(t){return function(e){return 0<kt(t,e).length}}),contains:At(function(t){return t=t.replace(Et,St),function(e){return-1<(e.textContent||e.innerText||De(e)).indexOf(t)}}),lang:At(function(n){return ht.test(n||"")||kt.error("unsupported lang: "+n),n=n.replace(Et,St).toLowerCase(),function(e){var t;do{if(t=Ve?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===ze},focus:function(e){return e===Ue.activeElement&&(!Ue.hasFocus||Ue.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!Re.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return bt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:Ot(function(){return[0]}),last:Ot(function(e,t){return[t-1]}),eq:Ot(function(e,t,n){return[n<0?n+t:n]}),even:Ot(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:Ot(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:Ot(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:Ot(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=Re.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})Re.pseudos[Te]=Dt(Te);for(Te in{submit:!0,reset:!0})Re.pseudos[Te]=Bt(Te);function Pt(){}function It(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Lt(a,e,t){var u=e.dir,s=t&&"parentNode"===u,c=Xe++;return e.first?function(e,t,n){for(;e=e[u];)if(1===e.nodeType||s)return a(e,t,n)}:function(e,t,n){var r,o,i=[Ke,c];if(n){for(;e=e[u];)if((1===e.nodeType||s)&&a(e,t,n))return!0}else for(;e=e[u];)if(1===e.nodeType||s){if((r=(o=e[$e]||(e[$e]={}))[u])&&r[0]===Ke&&r[1]===c)return i[2]=r[2];if((o[u]=i)[2]=a(e,t,n))return!0}}}function Mt(o){return 1<o.length?function(e,t,n){for(var r=o.length;r--;)if(!o[r](e,t,n))return!1;return!0}:o[0]}function Ft(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(u)));return a}function Ut(g,p,h,v,b,e){return v&&!v[$e]&&(v=Ut(v)),b&&!b[$e]&&(b=Ut(b,e)),At(function(e,t,n,r){var o,i,a,u=[],s=[],c=t.length,l=e||function m(e,t,n){for(var r=0,o=t.length;r<o;r++)kt(e,t[r],n);return n}(p||"*",n.nodeType?[n]:n,[]),f=!g||!e&&p?l:Ft(l,u,g,n,r),d=h?b||(e?g:c||v)?[]:t:f;if(h&&h(f,d,n,r),v)for(o=Ft(d,s),v(o,[],n,r),i=o.length;i--;)(a=o[i])&&(d[s[i]]=!(f[s[i]]=a));if(e){if(b||g){if(b){for(o=[],i=d.length;i--;)(a=d[i])&&o.push(f[i]=a);b(null,d=[],o,r)}for(i=d.length;i--;)(a=d[i])&&-1<(o=b?at.call(e,a):u[i])&&(e[o]=!(t[o]=a))}}else d=Ft(d===t?d.splice(c,d.length):d),b?b(null,t,d,r):ot.apply(t,d)})}function zt(e){for(var r,t,n,o=e.length,i=Re.relative[e[0].type],a=i||Re.relative[" "],u=i?1:0,s=Lt(function(e){return e===r},a,!0),c=Lt(function(e){return-1<at.call(r,e)},a,!0),l=[function(e,t,n){return!i&&(n||t!==Ie)||((r=t).nodeType?s(e,t,n):c(e,t,n))}];u<o;u++)if(t=Re.relative[e[u].type])l=[Lt(Mt(l),t)];else{if((t=Re.filter[e[u].type].apply(null,e[u].matches))[$e]){for(n=++u;n<o&&!Re.relative[e[n].type];n++);return Ut(1<u&&Mt(l),1<u&&It(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(ft,"$1"),t,u<n&&zt(e.slice(u,n)),n<o&&zt(e=e.slice(n)),n<o&&It(e))}l.push(t)}return Mt(l)}Pt.prototype=Re.filters=Re.pseudos,Re.setFilters=new Pt,Oe=kt.tokenize=function(e,t){var n,r,o,i,a,u,s,c=Ge[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=Re.preFilter;a;){for(i in n&&!(r=dt.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=mt.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(ft," ")}),a=a.slice(n.length)),Re.filter)!(r=vt[i].exec(a))||s[i]&&!(r=s[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?kt.error(e):Ge(e,u).slice(0)},_e=kt.compile=function(e,t){var n,r=[],o=[],i=Je[e+" "];if(!i){for(t||(t=Oe(e)),n=t.length;n--;)(i=zt(t[n]))[$e]?r.push(i):o.push(i);(i=Je(e,function a(h,v){var b=0<v.length,y=0<h.length,e=function(e,t,n,r,o){var i,a,u,s=0,c="0",l=e&&[],f=[],d=Ie,m=e||y&&Re.find.TAG("*",o),g=Ke+=null==d?1:Math.random()||.1,p=m.length;for(o&&(Ie=t!==Ue&&t);c!==p&&null!=(i=m[c]);c++){if(y&&i){for(a=0;u=h[a++];)if(u(i,t,n)){r.push(i);break}o&&(Ke=g)}b&&((i=!u&&i)&&s--,e&&l.push(i))}if(s+=c,b&&c!==s){for(a=0;u=v[a++];)u(l,f,t,n);if(e){if(0<s)for(;c--;)l[c]||f[c]||(f[c]=nt.call(r));f=Ft(f)}ot.apply(r,f),o&&!e&&0<f.length&&1<s+v.length&&kt.uniqueSort(r)}return o&&(Ke=g,Ie=d),l};return b?At(e):e}(o,r))).selector=e}return i},Pe=kt.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&Oe(e=c.selector||e);if(n=n||[],1===l.length){if(2<(i=l[0]=l[0].slice(0)).length&&"ID"===(a=i[0]).type&&Ae.getById&&9===t.nodeType&&Ve&&Re.relative[i[1].type]){if(!(t=(Re.find.ID(a.matches[0].replace(Et,St),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=vt.needsContext.test(e)?0:i.length;o--&&(a=i[o],!Re.relative[u=a.type]);)if((s=Re.find[u])&&(r=s(a.matches[0].replace(Et,St),wt.test(i[0].type)&&_t(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&It(i)))return ot.apply(n,r),n;break}}return(c||_e(e,l))(r,t,!Ve,n,wt.test(e)&&_t(t.parentNode)||t),n},Ae.sortStable=$e.split("").sort(Qe).join("")===$e,Ae.detectDuplicates=!!Me,Fe(),Ae.sortDetached=!0;var Vt=Array.isArray,jt=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,e.length!==undefined){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},Ht=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1},qt={isArray:Vt,toArray:function(e){var t,n,r=e;if(!Vt(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:jt,map:function(n,r){var o=[];return jt(n,function(e,t){o.push(r(e,t,n))}),o},filter:function(n,r){var o=[];return jt(n,function(e,t){r&&!r(e,t,n)||o.push(e)}),o},indexOf:function(e,t){var n,r;if(e)for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},reduce:function(e,t,n,r){var o=0;for(arguments.length<3&&(n=e[0]);o<e.length;o++)n=t.call(r,n,e[o],o);return n},findIndex:Ht,find:function(e,t,n){var r=Ht(e,t,n);return-1!==r?e[r]:undefined},last:function(e){return e[e.length-1]}},$t=/^\s*|\s*$/g,Wt=function(e){return null===e||e===undefined?"":(""+e).replace($t,"")},Kt=function(e,t){return t?!("array"!==t||!qt.isArray(e))||typeof e===t:e!==undefined},Xt=function(e,n,r,o){o=o||this,e&&(r&&(e=e[r]),qt.each(e,function(e,t){if(!1===n.call(o,e,t,r))return!1;Xt(e,n,r,o)}))},Yt={trim:Wt,isArray:qt.isArray,is:Kt,toArray:qt.toArray,makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:qt.each,map:qt.map,grep:qt.filter,inArray:qt.indexOf,hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e,t){for(var n,r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var u,s=arguments;for(n=1,r=s.length;n<r;n++)for(o in t=s[n])t.hasOwnProperty(o)&&(u=t[o])!==undefined&&(e[o]=u);return e},create:function(e,t,n){var r,o,i,a,u,s=this,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],!(o=s.createNS(e[3].replace(/\.\w+$/,""),n))[i]){if("static"===e[2])return o[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[i]));t[i]||(t[i]=function(){},c=1),o[i]=t[i],s.extend(o[i].prototype,t),e[5]&&(r=s.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],u=o[i],o[i]=c?function(){return r[a].apply(this,arguments)}:function(){return this.parent=r[a],u.apply(this,arguments)},o[i].prototype[i]=o[i],s.each(r,function(e,t){o[i].prototype[t]=r[t]}),s.each(t,function(e,t){r[t]?o[i].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==i&&(o[i].prototype[t]=e)})),s.each(t["static"],function(e,t){o[i][t]=e})}},walk:Xt,createNS:function(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Kt(e,"array")?e:qt.map(e.split(t||","),Wt)},_addCacheSuffix:function(e){var t=de.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Gt=document,Jt=Array.prototype.push,Qt=Array.prototype.slice,Zt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,en=ke.Event,tn=Yt.makeMap("children,contents,next,prev"),nn=function(e){return void 0!==e},rn=function(e){return"string"==typeof e},on=function(e,t){var n,r,o;for(o=(t=t||Gt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},an=function(e,t,n,r){var o;if(rn(t))t=on(t,Cn(e[0]));else if(t.length&&!t.nodeType){if(t=pn.makeArray(t),r)for(o=t.length-1;0<=o;o--)an(e,t[o],n,r);else for(o=0;o<t.length;o++)an(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},un=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},sn=function(e,t,n){var r,o;return t=pn(t)[0],e.each(function(){var e=this;n&&r===e.parentNode||(r=e.parentNode,o=t.cloneNode(!1),e.parentNode.insertBefore(o,e)),o.appendChild(e)}),e},cn=Yt.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),ln=Yt.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),fn={"for":"htmlFor","class":"className",readonly:"readOnly"},dn={"float":"cssFloat"},mn={},gn={},pn=function(e,t){return new pn.fn.init(e,t)},hn=/^\s*|\s*$/g,vn=function(e){return null===e||e===undefined?"":(""+e).replace(hn,"")},bn=function(e,t){var n,r,o,i;if(e)if((n=e.length)===undefined){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},yn=function(e,n){var r=[];return bn(e,function(e,t){n(t,e)&&r.push(t)}),r},Cn=function(e){return e?9===e.nodeType?e:e.ownerDocument:Gt};pn.fn=pn.prototype={constructor:pn,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return pn(e).attr(t);o.context=t=document}if(rn(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Zt.exec(e)))return pn(t).find(e);if(n[1])for(r=on(e,Cn(t)).firstChild;r;)Jt.call(o,r),r=r.nextSibling;else{if(!(r=Cn(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Yt.toArray(this)},add:function(e,t){var n,r,o=this;if(rn(e))return o.add(pn(e));if(!1!==t)for(n=pn.unique(o.toArray().concat(pn.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Jt.apply(o,pn.makeArray(e));return o},attr:function(t,n){var e,r=this;if("object"==typeof t)bn(t,function(e,t){r.attr(e,t)});else{if(!nn(n)){if(r[0]&&1===r[0].nodeType){if((e=mn[t])&&e.get)return e.get(r[0],t);if(ln[t])return r.prop(t)?t:undefined;null===(n=r[0].getAttribute(t,2))&&(n=undefined)}return n}this.each(function(){var e;if(1===this.nodeType){if((e=mn[t])&&e.set)return void e.set(this,n);null===n?this.removeAttribute(t,2):this.setAttribute(t,n,2)}})}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=fn[e]||e))bn(e,function(e,t){n.prop(e,t)});else{if(!nn(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(n,r){var e,o,i=this,t=function(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})},a=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})};if("object"==typeof n)bn(n,function(e,t){i.css(e,t)});else if(nn(r))n=t(n),"number"!=typeof r||cn[n]||(r=r.toString()+"px"),i.each(function(){var e=this.style;if((o=gn[n])&&o.set)o.set(this,r);else{try{this.style[dn[n]||n]=r}catch(t){}null!==r&&""!==r||(e.removeProperty?e.removeProperty(a(n)):e.removeAttribute(n))}});else{if(e=i[0],(o=gn[n])&&o.get)return o.get(e);if(!e.ownerDocument.defaultView)return e.currentStyle?e.currentStyle[t(n)]:"";try{return e.ownerDocument.defaultView.getComputedStyle(e,null).getPropertyValue(a(n))}catch(u){return undefined}}return i},remove:function(){for(var e,t=this.length;t--;)e=this[t],en.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(nn(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e}catch(r){pn(n[t]).empty().append(e)}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(nn(e)){for(t=n.length;t--;)"innerText"in n[t]?n[t].innerText=e:n[0].textContent=e;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return an(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return an(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?an(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?an(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return pn(e).append(this),this},prependTo:function(e){return pn(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return sn(this,e)},wrapAll:function(e){return sn(this,e,!0)},wrapInner:function(e){return this.each(function(){pn(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){pn(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),pn(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(o,i){var e=this;return"string"!=typeof o||(-1!==o.indexOf(" ")?bn(o.split(" "),function(){e.toggleClass(this,i)}):e.each(function(e,t){var n,r;(r=un(t,o))!==i&&(n=t.className,r?t.className=vn((" "+n+" ").replace(" "+o+" "," ")):t.className+=n?" "+o:o)})),e},hasClass:function(e){return un(this[0],e)},each:function(e){return bn(this,e)},on:function(e,t){return this.each(function(){en.bind(this,e,t)})},off:function(e,t){return this.each(function(){en.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?en.fire(this,e.type,e):en.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new pn(Qt.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)pn.find(e,this[t],r);return pn(r)},filter:function(n){return pn("function"==typeof n?yn(this.toArray(),function(e,t){return n(t,e)}):pn.filter(n,this.toArray()))},closest:function(n){var r=[];return n instanceof pn&&(n=n[0]),this.each(function(e,t){for(;t;){if("string"==typeof n&&pn(t).is(n)){r.push(t);break}if(t===n){r.push(t);break}t=t.parentNode}}),pn(r)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Jt,sort:[].sort,splice:[].splice},Yt.extend(pn,{extend:Yt.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:Yt.toArray(e);var t},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:Yt.isArray,each:bn,trim:vn,grep:yn,find:kt,expr:kt.selectors,unique:kt.uniqueSort,text:kt.getText,contains:kt.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?pn.find.matchesSelector(t[0],e)?[t[0]]:[]:pn.find.matches(e,t)}});var xn=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof pn&&(n=n[0]);o&&9!==o.nodeType;){if(n!==undefined){if(o===n)break;if("string"==typeof n&&pn(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},wn=function(e,t,n,r){var o=[];for(r instanceof pn&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(r!==undefined){if(e===r)break;if("string"==typeof r&&pn(e).is(r))break}o.push(e)}return o},Nn=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};bn({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xn(e,"parentNode")},next:function(e){return Nn(e,"nextSibling",1)},prev:function(e){return Nn(e,"previousSibling",1)},children:function(e){return wn(e.firstChild,"nextSibling",1)},contents:function(e){return Yt.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,r){pn.fn[e]=function(t){var n=[];return this.each(function(){var e=r.call(n,this,t,n);e&&(pn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(tn[e]||(n=pn.unique(n)),0===e.indexOf("parents")&&(n=n.reverse())),n=pn(n),t?n.filter(t):n}}),bn({parentsUntil:function(e,t){return xn(e,"parentNode",t)},nextUntil:function(e,t){return wn(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return wn(e,"previousSibling",1,t).slice(1)}},function(r,o){pn.fn[r]=function(t,e){var n=[];return this.each(function(){var e=o.call(n,this,t,n);e&&(pn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(n=pn.unique(n),0!==r.indexOf("parents")&&"prevUntil"!==r||(n=n.reverse())),n=pn(n),e?n.filter(e):n}}),pn.fn.is=function(e){return!!e&&0<this.filter(e).length},pn.fn.init.prototype=pn.fn,pn.overrideDefaults=function(n){var r,o=function(e,t){return r=r||n(),0===arguments.length&&(e=r.element),t||(t=r.context),new o.fn.init(e,t)};return pn.extend(o,this),o};var En=function(n,r,e){bn(e,function(e,t){n[e]=n[e]||{},n[e][r]=t})};de.ie&&de.ie<8&&(En(mn,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?undefined:t},size:function(e){var t=e.size;return 20===t?undefined:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?undefined:t}}),En(mn,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),de.ie&&de.ie<9&&(dn["float"]="styleFloat",En(gn,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),pn.attrHooks=mn,pn.cssHooks=gn;var Sn,kn,Tn,An=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Dn(r(1),r(2))},Rn=function(){return Dn(0,0)},Dn=function(e,t){return{major:e,minor:t}},Bn={nu:Dn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Rn():An(e,n)},unknown:Rn},On="Firefox",_n=function(e,t){return function(){return t===e}},Pn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:_n("Edge",t),isChrome:_n("Chrome",t),isIE:_n("IE",t),isOpera:_n("Opera",t),isFirefox:_n(On,t),isSafari:_n("Safari",t)}},In={unknown:function(){return Pn({current:undefined,version:Bn.unknown()})},nu:Pn,edge:q("Edge"),chrome:q("Chrome"),ie:q("IE"),opera:q("Opera"),firefox:q(On),safari:q("Safari")},Ln="Windows",Mn="Android",Fn="Solaris",Un="FreeBSD",zn=function(e,t){return function(){return t===e}},Vn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:zn(Ln,t),isiOS:zn("iOS",t),isAndroid:zn(Mn,t),isOSX:zn("OSX",t),isLinux:zn("Linux",t),isSolaris:zn(Fn,t),isFreeBSD:zn(Un,t)}},jn={unknown:function(){return Vn({current:undefined,version:Bn.unknown()})},nu:Vn,windows:q(Ln),ios:q("iOS"),android:q(Mn),linux:q("Linux"),osx:q("OSX"),solaris:q(Fn),freebsd:q(Un)},Hn=function(e,t){var n=String(t).toLowerCase();return V(e,function(e){return e.search(n)})},qn=function(e,n){return Hn(e,n).map(function(e){var t=Bn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},$n=function(e,n){return Hn(e,n).map(function(e){var t=Bn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Wn=function(e,t){return-1!==e.indexOf(t)},Kn=function(e){return e.replace(/^\s+|\s+$/g,"")},Xn=function(e){return e.replace(/\s+$/g,"")},Yn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Gn=function(t){return function(e){return Wn(e,t)}},Jn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Wn(e,"edge/")&&Wn(e,"chrome")&&Wn(e,"safari")&&Wn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Yn],search:function(e){return Wn(e,"chrome")&&!Wn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Wn(e,"msie")||Wn(e,"trident")}},{name:"Opera",versionRegexes:[Yn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Gn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Gn("firefox")},{name:"Safari",versionRegexes:[Yn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Wn(e,"safari")||Wn(e,"mobile/"))&&Wn(e,"applewebkit")}}],Qn=[{name:"Windows",search:Gn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Wn(e,"iphone")||Wn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Gn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Gn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Gn("linux"),versionRegexes:[]},{name:"Solaris",search:Gn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Gn("freebsd"),versionRegexes:[]}],Zn={browsers:q(Jn),oses:q(Qn)},er=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=Zn.browsers(),m=Zn.oses(),g=qn(d,e).fold(In.unknown,In.nu),p=$n(m,e).fold(jn.unknown,jn.nu);return{browser:g,os:p,deviceType:(n=g,r=e,o=(t=p).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,a=t.isAndroid()&&3===t.version.major,u=t.isAndroid()&&4===t.version.major,s=o||a||u&&!0===/mobile/i.test(r),c=t.isiOS()||t.isAndroid(),l=c&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:q(o),isiPhone:q(i),isTablet:q(s),isPhone:q(l),isTouch:q(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:q(f)})}},tr={detect:(Sn=function(){var e=navigator.userAgent;return er(e)},Tn=!1,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Tn||(Tn=!0,kn=Sn.apply(null,e)),kn})},nr=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:q(e)}},rr={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return nr(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return nr(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return nr(n)},fromDom:nr,fromPoint:function(e,t,n){var r=e.dom();return A.from(r.elementFromPoint(t,n)).map(nr)}},or=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE),ir=(Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),ar=Node.TEXT_NODE,ur=(Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,function(e){return e.dom().nodeName.toLowerCase()}),sr=function(t){return function(e){return e.dom().nodeType===t}},cr=sr(ir),lr=sr(ar),fr=Object.keys,dr=Object.hasOwnProperty,mr=function(e,t){for(var n=fr(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},gr=function(r,o){var i={};return mr(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},pr=function(e,t){return hr(e,t)?A.some(e[t]):A.none()},hr=function(e,t){return dr.call(e,t)},vr=function(e,t,n){if(!(R(n)||_(n)||I(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},br=function(e,t,n){vr(e.dom(),t,n)},yr=function(e,t){var n=e.dom();mr(t,function(e,t){vr(n,t,e)})},Cr=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},xr=function(e,t){e.dom().removeAttribute(t)},wr=function(e,t){var n,r,o=e.dom(),i=window.getComputedStyle(o).getPropertyValue(t),a=""!==i||(r=lr(n=e)?n.dom().parentNode:n.dom())!==undefined&&null!==r&&r.ownerDocument.body.contains(r)?i:Nr(o,t);return null===a?undefined:a},Nr=function(e,t){return e.style!==undefined?e.style.getPropertyValue(t):""},Er=function(e,t){var n=e.dom(),r=Nr(n,t);return A.from(r).filter(function(e){return 0<e.length})},Sr=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return F(t,function(e,t){r[e]=q(n[t])}),r}},kr=function(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n},Tr=function(){return ie.getOrDie("Node")},Ar=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},Rr=function(e,t){return Ar(e,t,Tr().DOCUMENT_POSITION_CONTAINED_BY)},Dr=ir,Br=or,Or=function(e,t){var n=e.dom();if(n.nodeType!==Dr)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},_r=function(e){return e.nodeType!==Dr&&e.nodeType!==Br||0===e.childElementCount},Pr=function(e,t){return e.dom()===t.dom()},Ir=tr.detect().browser.isIE()?function(e,t){return Rr(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Lr=function(e){return rr.fromDom(e.dom().ownerDocument)},Mr=function(e){var t=e.dom();return A.from(t.parentNode).map(rr.fromDom)},Fr=function(e){var t=e.dom();return A.from(t.previousSibling).map(rr.fromDom)},Ur=function(e){var t=e.dom();return A.from(t.nextSibling).map(rr.fromDom)},zr=function(e){return t=kr(e,Fr),(n=Q.call(t,0)).reverse(),n;var t,n},Vr=function(e){return kr(e,Ur)},jr=function(e){var t=e.dom();return W(t.childNodes,rr.fromDom)},Hr=function(e,t){var n=e.dom().childNodes;return A.from(n[t]).map(rr.fromDom)},qr=function(e){return Hr(e,0)},$r=function(e){return Hr(e,e.dom().childNodes.length-1)},Wr=(Sr("element","offset"),tr.detect().browser),Kr=function(e){return V(e,cr)},Xr={getPos:function(e,t,n){var r,o,i,a=0,u=0,s=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===wr(rr.fromDom(e),"position"))return{x:a=(o=t.getBoundingClientRect()).left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,y:u=o.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop};for(r=t;r&&r!==n&&r.nodeType;)a+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType;)a-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=(i=rr.fromDom(t),Wr.isFirefox()&&"table"===ur(i)?Kr(jr(i)).filter(function(e){return"caption"===ur(e)}).bind(function(o){return Kr(Vr(o)).map(function(e){var t=e.dom().offsetTop,n=o.dom().offsetTop,r=o.dom().offsetHeight;return t<=n?-r:0})}).getOr(0):0)}return{x:a,y:u}}},Yr=function(e){var n=A.none(),t=[],r=function(e){o()?a(e):t.push(e)},o=function(){return n.isSome()},i=function(e){F(e,a)},a=function(t){n.each(function(e){setTimeout(function(){t(e)},0)})};return e(function(e){n=A.some(e),i(t),t=[]}),{get:r,map:function(n){return Yr(function(t){r(function(e){t(n(e))})})},isReady:o}},Gr={nu:Yr,pure:function(t){return Yr(function(e){e(t)})}},Jr=function(t){var e=function(e){var r;t((r=e,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this;setTimeout(function(){r.apply(n,e)},0)}))},n=function(){return Gr.nu(e)};return{map:function(r){return Jr(function(n){e(function(e){var t=r(e);n(t)})})},bind:function(n){return Jr(function(t){e(function(e){n(e).get(t)})})},anonBind:function(n){return Jr(function(t){e(function(e){n.get(t)})})},toLazy:n,toCached:function(){var t=null;return Jr(function(e){null===t&&(t=n()),t.get(e)})},get:e}},Qr={nu:Jr,pure:function(t){return Jr(function(e){e(t)})}},Zr=function(a,e){return e(function(r){var o=[],i=0;0===a.length?r([]):F(a,function(e,t){var n;e.get((n=t,function(e){o[n]=e,++i>=a.length&&r(o)}))})})},eo=function(e){return Zr(e,Qr.nu)},to=function(n){return{is:function(e){return n===e},isValue:x,isError:C,getOr:q(n),getOrThunk:q(n),getOrDie:q(n),or:function(e){return to(n)},orThunk:function(e){return to(n)},fold:function(e,t){return t(n)},map:function(e){return to(e(n))},mapError:function(e){return to(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return A.some(n)}}},no=function(n){return{is:C,isValue:C,isError:x,getOr:$,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return no(n)},mapError:function(e){return no(e(n))},each:o,bind:function(e){return no(n)},exists:C,forall:x,toOption:A.none}},ro={value:to,error:no};function oo(e,u){var t=e,n=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==u){if(o=e[n])return o;for(i=e.parentNode;i&&i!==u;i=i.parentNode)if(o=i[n])return o}}};this.current=function(){return t},this.next=function(e){return t=n(t,"firstChild","nextSibling",e)},this.prev=function(e){return t=n(t,"lastChild","previousSibling",e)},this.prev2=function(e){return t=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],u&&o===u)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==u)return i}}(t,"lastChild","previousSibling",e)}}var io,ao,uo,so=function(t){var n;return function(e){return(n=n||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(t,q(!0))).hasOwnProperty(ur(e))}},co=so(["h1","h2","h3","h4","h5","h6"]),lo=so(["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(e){return cr(e)&&!lo(e)},mo=function(e){return cr(e)&&"br"===ur(e)},go=so(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),po=so(["ul","ol","dl"]),ho=so(["li","dd","dt"]),vo=so(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),bo=so(["thead","tbody","tfoot"]),yo=so(["td","th"]),Co=so(["pre","script","textarea","style"]),xo=function(t){return function(e){return!!e&&e.nodeType===t}},wo=xo(1),No=function(e){var r=e.toLowerCase().split(" ");return function(e){var t,n;if(e&&e.nodeType)for(n=e.nodeName.toLowerCase(),t=0;t<r.length;t++)if(n===r[t])return!0;return!1}},Eo=function(t){return function(e){if(wo(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},So=xo(3),ko=xo(8),To=xo(9),Ao=No("br"),Ro=Eo("true"),Do=Eo("false"),Bo={isText:So,isElement:wo,isComment:ko,isDocument:To,isBr:Ao,isContentEditableTrue:Ro,isContentEditableFalse:Do,matchNodeNames:No,hasPropValue:function(t,n){return function(e){return wo(e)&&e[t]===n}},hasAttribute:function(t,e){return function(e){return wo(e)&&e.hasAttribute(t)}},hasAttributeValue:function(t,n){return function(e){return wo(e)&&e.getAttribute(t)===n}},matchStyleValues:function(r,e){var o=e.toLowerCase().split(" ");return function(e){var t;if(wo(e))for(t=0;t<o.length;t++){var n=e.ownerDocument.defaultView.getComputedStyle(e,null);if((n?n.getPropertyValue(r):null)===o[t])return!0}return!1}},isBogus:function(e){return wo(e)&&e.hasAttribute("data-mce-bogus")},isBogusAll:function(e){return wo(e)&&"all"===e.getAttribute("data-mce-bogus")},isTable:function(e){return wo(e)&&"TABLE"===e.tagName}},Oo=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},_o=function(e,t){var n,r=t.childNodes;if(!Bo.isElement(t)||!Oo(t)){for(n=r.length-1;0<=n;n--)_o(e,r[n]);if(!1===Bo.isDocument(t)){if(Bo.isText(t)&&0<t.nodeValue.length){var o=Yt.trim(t.nodeValue).length;if(e.isBlock(t.parentNode)||0<o)return;if(0===o&&(a=(i=t).previousSibling&&"SPAN"===i.previousSibling.nodeName,u=i.nextSibling&&"SPAN"===i.nextSibling.nodeName,a&&u))return}else if(Bo.isElement(t)&&(1===(r=t.childNodes).length&&Oo(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||vo(rr.fromDom(t))))return;e.remove(t)}var i,a,u;return t}},Po={trimNode:_o},Io=Yt.makeMap,Lo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Mo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Fo=/[<>&\"\']/g,Uo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,zo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};ao={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},uo={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};var Vo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),ao[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};io=Vo("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);var jo=function(e,t){return e.replace(t?Lo:Mo,function(e){return ao[e]||e})},Ho=function(e,t){return e.replace(t?Lo:Mo,function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":ao[e]||"&#"+e.charCodeAt(0)+";"})},qo=function(e,t,n){return n=n||io,e.replace(t?Lo:Mo,function(e){return ao[e]||n[e]||e})},$o={encodeRaw:jo,encodeAllRaw:function(e){return(""+e).replace(Fo,function(e){return ao[e]||e})},encodeNumeric:Ho,encodeNamed:qo,getEncodeFunc:function(e,t){var n=Vo(t)||io,r=Io(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?Lo:Mo,function(e){return ao[e]!==undefined?ao[e]:n[e]!==undefined?n[e]:1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:r.named?t?function(e,t){return qo(e,t,n)}:qo:r.numeric?Ho:jo},decode:function(e){return e.replace(Uo,function(e,t){return t?65535<(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):zo[t]||String.fromCharCode(t):uo[e]||io[e]||(n=e,(r=rr.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},Wo={},Ko={},Xo=Yt.makeMap,Yo=Yt.each,Go=Yt.extend,Jo=Yt.explode,Qo=Yt.inArray,Zo=function(e,t){return(e=Yt.trim(e))?e.split(t||" "):[]},ei=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};for(t=t||"","string"==typeof(n=n||[])&&(n=Zo(n)),r=(e=Zo(e)).length;r--;)i={attributes:a(o=Zo([u,t].join(" "))),attributesOrder:o,children:a(n,Ko)},s[e[r]]=i},c=function(e,t){var n,r,o,i;for(n=(e=Zo(e)).length,t=Zo(t);n--;)for(r=s[e[n]],o=0,i=t.length;o<i;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o])};return Wo[e]?Wo[e]:(u="id accesskey class dir lang style tabindex title role",t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",n="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"!==e&&(u+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",t+=" article aside details dialog figure main header footer hgroup section nav",n+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(u+=" xml:lang",n=[n,i="acronym applet basefont big font strike tt"].join(" "),Yo(Zo(i),function(e){a(e,"",n)}),t=[t,o="center dir isindex noframes"].join(" "),r=[t,n].join(" "),Yo(Zo(o),function(e){a(e,"",r)})),r=r||[t,n].join(" "),a("html","manifest","head body"),a("head","","base command link meta noscript script style title"),a("title hr noscript br"),a("base","href target"),a("link","href rel media hreflang type sizes hreflang"),a("meta","name http-equiv content charset"),a("style","media type scoped"),a("script","src async defer type charset"),a("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",r),a("address dt dd div caption","",r),a("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","",n),a("blockquote","cite",r),a("ol","reversed start type","li"),a("ul","","li"),a("li","value",r),a("dl","","dt dd"),a("a","href target rel media hreflang type",n),a("q","cite",n),a("ins del","cite datetime",r),a("img","src sizes srcset alt usemap ismap width height"),a("iframe","src name width height",r),a("embed","src type width height"),a("object","data type typemustmatch name usemap form width height",[r,"param"].join(" ")),a("param","name value"),a("map","name",[r,"area"].join(" ")),a("area","alt coords shape href target rel media hreflang type"),a("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),a("colgroup","span","col"),a("col","span"),a("tbody thead tfoot","","tr"),a("tr","","td th"),a("td","colspan rowspan headers",r),a("th","colspan rowspan headers scope abbr",r),a("form","accept-charset action autocomplete enctype method name novalidate target",r),a("fieldset","disabled form name",[r,"legend"].join(" ")),a("label","form for",n),a("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"),a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?r:n),a("select","disabled form multiple name required size","option optgroup"),a("optgroup","disabled label","option"),a("option","disabled label selected value"),a("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),a("menu","type label",[r,"li"].join(" ")),a("noscript","",r),"html4"!==e&&(a("wbr"),a("ruby","",[n,"rt rp"].join(" ")),a("figcaption","",r),a("mark rt rp summary bdi","",n),a("canvas","width height",r),a("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[r,"track source"].join(" ")),a("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[r,"track source"].join(" ")),a("picture","","img source"),a("source","src srcset type media sizes"),a("track","kind src srclang label default"),a("datalist","",[n,"option"].join(" ")),a("article section nav aside main header footer","",r),a("hgroup","","h1 h2 h3 h4 h5 h6"),a("figure","",[r,"figcaption"].join(" ")),a("time","datetime",n),a("dialog","open",r),a("command","type label icon disabled checked radiogroup command"),a("output","for form name",n),a("progress","value max",n),a("meter","value min max low high optimum",n),a("details","open",[r,"summary"].join(" ")),a("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(c("script","language xml:space"),c("style","xml:space"),c("object","declare classid code codebase codetype archive standby align border hspace vspace"),c("embed","align name hspace vspace"),c("param","valuetype type"),c("a","charset name rev shape coords"),c("br","clear"),c("applet","codebase archive code object alt name width height align hspace vspace"),c("img","name longdesc align border hspace vspace"),c("iframe","longdesc frameborder marginwidth marginheight scrolling align"),c("font basefont","size color face"),c("input","usemap align"),c("select","onchange"),c("textarea"),c("h1 h2 h3 h4 h5 h6 div p legend caption","align"),c("ul","type compact"),c("li","type"),c("ol dl menu dir","compact"),c("pre","width xml:space"),c("hr","align noshade size width"),c("isindex","prompt"),c("table","summary width frame rules cellspacing cellpadding align bgcolor"),c("col","width align char charoff valign"),c("colgroup","width align char charoff valign"),c("thead","align char charoff valign"),c("tr","align char charoff valign bgcolor"),c("th","axis align char charoff valign nowrap bgcolor width height"),c("form","accept"),c("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),c("tfoot","align char charoff valign"),c("tbody","align char charoff valign"),c("area","nohref"),c("body","background bgcolor text link vlink alink")),"html4"!==e&&(c("input button select textarea","autofocus"),c("input textarea","placeholder"),c("a","download"),c("link script img","crossorigin"),c("iframe","sandbox seamless allowfullscreen")),Yo(Zo("a form meter progress dfn"),function(e){s[e]&&delete s[e].children[e]}),delete s.caption.children.table,delete s.script,Wo[e]=s)},ti=function(e,n){var r;return e&&(r={},"string"==typeof e&&(e={"*":e}),Yo(e,function(e,t){r[t]=r[t.toUpperCase()]="map"===n?Xo(e,/[, ]/):Jo(e,/[, ]/)})),r};function ni(i){var e,t,n,r,o,a,u,s,c,l,f,d,m,N={},g={},E=[],p={},h={},v=function(e,t,n){var r=i[e];return r?r=Xo(r,/[, ]/,Xo(r.toUpperCase(),/[, ]/)):(r=Wo[e])||(r=Xo(t," ",Xo(t.toUpperCase()," ")),r=Go(r,n),Wo[e]=r),r};n=ei((i=i||{}).schema),!1===i.verify_html&&(i.valid_elements="*[*]"),e=ti(i.valid_styles),t=ti(i.invalid_styles,"map"),s=ti(i.valid_classes,"map"),r=v("whitespace_elements","pre script noscript style textarea video audio iframe object code"),o=v("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=v("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),u=v("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),l=v("non_empty_elements","td th iframe video audio object script pre code",a),f=v("move_caret_before_on_enter_elements","table",l),d=v("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"),c=v("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",d),m=v("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),Yo((i.special||"script noscript noframes noembed title style textarea xmp").split(" "),function(e){h[e]=new RegExp("</"+e+"[^>]*>","gi")});var S=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},b=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,x=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,w=/[*?+]/;if(e)for(e=Zo(e,","),N["@"]&&(h=N["@"].attributes,v=N["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=C.exec(e[t])){if(g=i[1],c=i[2],p=i[3],s=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===g&&(a.paddEmpty=!0),"-"===g&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),h){for(b in h)d[b]=h[b];m.push.apply(m,v)}if(s)for(r=0,o=(s=Zo(s,"|")).length;r<o;r++)if(i=x.exec(s[r])){if(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),g=i[3],y=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"===f){delete d[l],m.splice(Qo(m,l),1);continue}g&&("="===g&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:y}),u.defaultValue=y),":"===g&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:y}),u.forcedValue=y),"<"===g&&(u.validValues=Xo(y,"?"))),w.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=S(l),a.attributePatterns.push(u)):(d[l]||m.push(l),d[l]=u)}h||"@"!==c||(h=d,v=m),p&&(a.outputName=c,N[p]=a),w.test(c)?(a.pattern=S(c),E.push(a)):N[c]=a}},y=function(e){N={},E=[],b(e),Yo(n,function(e,t){g[t]=e.children})},C=function(e){var a=/^(~)?(.+)$/;e&&(Wo.text_block_elements=Wo.block_elements=null,Yo(Zo(e,","),function(e){var t=a.exec(e),n="~"===t[1],r=n?"span":"div",o=t[2];if(g[o]=g[r],p[o]=r,n||(c[o.toUpperCase()]={},c[o]={}),!N[o]){var i=N[r];delete(i=Go({},i)).removeEmptyAttrs,delete i.removeEmpty,N[o]=i}Yo(g,function(e,t){e[r]&&(g[t]=e=Go({},g[t]),e[o]=e[r])})}))},x=function(e){var o=/^([+\-]?)(\w+)\[([^\]]+)\]$/;Wo[i.schema]=null,e&&Yo(Zo(e,","),function(e){var t,n,r=o.exec(e);r&&(n=r[1],t=n?g[r[2]]:g[r[2]]={"#comment":{}},t=g[r[2]],Yo(Zo(r[3],"|"),function(e){"-"===n?delete t[e]:t[e]={}}))})},w=function(e){var t,n=N[e];if(n)return n;for(t=E.length;t--;)if((n=E[t]).pattern.test(e))return n};return i.valid_elements?y(i.valid_elements):(Yo(n,function(e,t){N[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},g[t]=e.children}),"html5"!==i.schema&&Yo(Zo("strong/b em/i"),function(e){e=Zo(e,"/"),N[e[1]].outputName=e[0]}),Yo(Zo("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){N[e]&&(N[e].removeEmpty=!0)}),Yo(Zo("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){N[e].paddEmpty=!0}),Yo(Zo("span"),function(e){N[e].removeEmptyAttrs=!0})),C(i.custom_elements),x(i.valid_children),b(i.extended_valid_elements),x("+ol[ul|ol],+ul[ul|ol]"),Yo({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(e,t){N[t]&&(N[t].parentsRequired=Zo(e))}),i.invalid_elements&&Yo(Jo(i.invalid_elements),function(e){N[e]&&delete N[e]}),w("span")||b("span[!data-mce-type|*]"),{children:g,elements:N,getValidStyles:function(){return e},getValidClasses:function(){return s},getBlockElements:function(){return c},getInvalidStyles:function(){return t},getShortEndedElements:function(){return a},getTextBlockElements:function(){return d},getTextInlineElements:function(){return m},getBoolAttrs:function(){return u},getElementRule:w,getSelfClosingElements:function(){return o},getNonEmptyElements:function(){return l},getMoveCaretBeforeOnEnterElements:function(){return f},getWhiteSpaceElements:function(){return r},getSpecialElements:function(){return h},isValidChild:function(e,t){var n=g[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t){var n,r,o=w(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:function(){return p},addValidElements:b,setValidElements:y,addCustomElements:C,addValidChildren:x}}var ri=function(e,t,n,r){var o=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+o(t)+o(n)+o(r)};function oi(y,e){var C,t,c,l,x=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,w=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,N=/\s*([^:]+):\s*([^;]+);?/g,E=/\s+$/,S={},k="\ufeff";for(y=y||{},e&&(c=e.getValidStyles(),l=e.getInvalidStyles()),t=("\\\" \\' \\; \\: ; : "+k).split(" "),C=0;C<t.length;C++)S[t[C]]=k+C,S[k+C]=t[C];return{toHex:function(e){return e.replace(x,ri)},parse:function(e){var t,n,r,o,i,a,u,s,c={},l=y.url_converter,f=y.url_converter_scope||this,d=function(e,t,n){var r,o,i,a;if((r=c[e+"-top"+t])&&(o=c[e+"-right"+t])&&(i=c[e+"-bottom"+t])&&(a=c[e+"-left"+t])){var u=[r,o,i,a];for(C=u.length-1;C--&&u[C]===u[C+1];);-1<C&&n||(c[e+t]=-1===C?u[0]:u.join(" "),delete c[e+"-top"+t],delete c[e+"-right"+t],delete c[e+"-bottom"+t],delete c[e+"-left"+t])}},m=function(e){var t,n=c[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return c[e]=n[0],!0}},g=function(e){return o=!0,S[e]},p=function(e,t){return o&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return S[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},h=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},v=function(e){return e.replace(/\\[0-9a-f]+/gi,h)},b=function(e,t,n,r,o,i){if(o=o||i)return"'"+(o=p(o)).replace(/\'/g,"\\'")+"'";if(t=p(t||n||r),!y.allow_script_urls){var a=t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!y.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return l&&(t=l.call(f,t,"style")),"url('"+t.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,g).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,g)});t=N.exec(e);)if(N.lastIndex=t.index+t[0].length,n=t[1].replace(E,"").toLowerCase(),r=t[2].replace(E,""),n&&r){if(n=v(n),r=v(r),-1!==n.indexOf(k)||-1!==n.indexOf('"'))continue;if(!y.allow_script_urls&&("behavior"===n||/expression\s*\(|\/\*|\*\//.test(r)))continue;"font-weight"===n&&"700"===r?r="bold":"color"!==n&&"background-color"!==n||(r=r.toLowerCase()),r=(r=r.replace(x,ri)).replace(w,b),c[n]=o?p(r,!0):r}d("border","",!0),d("border","-width"),d("border","-color"),d("border","-style"),d("padding",""),d("margin",""),i="border",u="border-style",s="border-color",m(a="border-width")&&m(u)&&m(s)&&(c[i]=c[a]+" "+c[u]+" "+c[s],delete c[a],delete c[u],delete c[s]),"medium none"===c.border&&delete c.border,"none"===c["border-image"]&&delete c["border-image"]}return c},serialize:function(i,e){var t,n,r,o,a,u="",s=function(e){var t,n,r,o;if(t=c[e])for(n=0,r=t.length;n<r;n++)e=t[n],(o=i[e])&&(u+=(0<u.length?" ":"")+e+": "+o+";")};if(e&&c)s("*"),s(e);else for(t in i)!(n=i[t])||l&&(r=t,o=e,a=void 0,(a=l["*"])&&a[r]||(a=l[o])&&a[r])||(u+=(0<u.length?" ":"")+t+": "+n+";");return u}}}var ii,ai=Yt.each,ui=Yt.grep,si=de.ie,ci=/^([a-z0-9],?)+$/i,li=/^[ \t\r\n]*$/,fi=function(n,r,o){var e={},i=r.keep_values,t={set:function(e,t,n){r.url_converter&&(t=r.url_converter.call(r.url_converter_scope||o(),t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}};return e={style:{set:function(e,t){null===t||"object"!=typeof t?(i&&e.attr("data-mce-style",t),e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return t=n.serialize(n.parse(t),e[0].nodeName)}}},i&&(e.href=e.src=t),e},di=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r)},mi=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o};function gi(a,u){var s,c=this;void 0===u&&(u={});var r={},i=window,o={},t=0,e=function j(g,p){void 0===p&&(p={});var h,v=0,b={};h=p.maxLoadTime||5e3;var y=function(e){g.getElementsByTagName("head")[0].appendChild(e)},n=function(e,t,n){var o,r,i,a,u=function(e){a.status=e,a.passed=[],a.failed=[],o&&(o.onload=null,o.onerror=null,o=null)},s=function(){for(var e=a.passed,t=e.length;t--;)e[t]();u(2)},c=function(){for(var e=a.failed,t=e.length;t--;)e[t]();u(3)},l=function(e,t){e()||((new Date).getTime()-i<h?ve.setTimeout(t):c())},f=function(){l(function(){for(var e,t,n=g.styleSheets,r=n.length;r--;)if((t=(e=n[r]).ownerNode?e.ownerNode:e.owningElement)&&t.id===o.id)return s(),!0},f)},d=function(){l(function(){try{var e=r.sheet.cssRules;return s(),!!e}catch(t){}},d)};if(e=Yt._addCacheSuffix(e),b[e]?a=b[e]:(a={passed:[],failed:[]},b[e]=a),t&&a.passed.push(t),n&&a.failed.push(n),1!==a.status)if(2!==a.status)if(3!==a.status){if(a.status=1,(o=g.createElement("link")).rel="stylesheet",o.type="text/css",o.id="u"+v++,o.async=!1,o.defer=!1,i=(new Date).getTime(),p.contentCssCors&&(o.crossOrigin="anonymous"),"onload"in o&&!((m=navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(m[1],10)<536))o.onload=f,o.onerror=c;else{if(0<navigator.userAgent.indexOf("Firefox"))return(r=g.createElement("style")).textContent='@import "'+e+'"',d(),void y(r);f()}var m;y(o),o.href=e}else c();else s()},t=function(t){return Qr.nu(function(e){n(t,H(e,q(ro.value(t))),H(e,q(ro.error(t))))})},o=function(e){return e.fold($,$)};return{load:n,loadAll:function(e,n,r){eo(W(e,t)).get(function(e){var t=K(e,function(e){return e.isValue()});0<t.fail.length?r(t.fail.map(o)):n(t.pass.map(o))})}}}(a,{contentCssCors:u.contentCssCors}),l=[],f=u.schema?u.schema:ni({}),d=oi({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope},u.schema),m=u.ownEvents?new ke(u.proxy):ke.Event,n=f.getBlockElements(),g=pn.overrideDefaults(function(){return{context:a,element:V.getRoot()}}),p=function(e){if(e&&a&&"string"==typeof e){var t=a.getElementById(e);return t&&t.id!==e?a.getElementsByName(e)[1]:t}return e},h=function(e){return"string"==typeof e&&(e=p(e)),g(e)},v=function(e,t,n){var r,o,i=h(e);return i.length&&(o=(r=s[t])&&r.get?r.get(i,t):i.attr(t)),void 0===o&&(o=n||""),o},b=function(e){var t=p(e);return t?t.attributes:[]},y=function(e,t,n){var r,o;""===n&&(n=null);var i=h(e);r=i.attr(t),i.length&&((o=s[t])&&o.set?o.set(i,n,t):i.attr(t,n),r!==n&&u.onSetAttrib&&u.onSetAttrib({attrElm:i,attrName:t,attrValue:n}))},C=function(){return u.root_element||a.body},x=function(e,t){return Xr.getPos(a.body,p(e),t)},w=function(e,t,n){var r=h(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=de.ie&&de.ie<12?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:undefined)},N=function(e){var t,n;return e=p(e),t=w(e,"width"),n=w(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},E=function(e,t){var n;if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(ci.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;0<=n;n--)if(r[n]===o)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return 0<kt(t,i[0].ownerDocument||i[0],null,i).length},S=function(e,t,n,r){var o,i=[],a=p(e);for(r=r===undefined,n=n||("BODY"!==C().nodeName?C().parentNode:null),Yt.is(t,"string")&&(t="*"===(o=t)?function(e){return 1===e.nodeType}:function(e){return E(e,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},k=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return E(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},T=function(e,n,r){var o,t="string"==typeof e?p(e):e;if(!t)return!1;if(Yt.isArray(t)&&(t.length||0===t.length))return o=[],ai(t,function(e,t){e&&("string"==typeof e&&(e=p(e)),o.push(n.call(r,e,t)))}),o;var i=r||c;return n.call(i,t)},A=function(e,t){h(e).each(function(e,n){ai(t,function(e,t){y(n,t,e)})})},R=function(e,r){var t=h(e);si?t.each(function(e,t){if(!1!==t.canHaveHTML){for(;t.firstChild;)t.removeChild(t.firstChild);try{t.innerHTML="<br>"+r,t.removeChild(t.firstChild)}catch(n){pn("<div></div>").html("<br>"+r).contents().slice(1).appendTo(t)}return r}}):t.html(r)},D=function(e,n,r,o,i){return T(e,function(e){var t="string"==typeof n?a.createElement(n):n;return A(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&R(t,o)),i?t:e.appendChild(t)})},B=function(e,t,n){return D(a.createElement(e),e,t,n,!0)},O=$o.decode,_=$o.encodeAllRaw,P=function(e,t){var n=h(e);return t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():n.remove(),1<n.length?n.toArray():n[0]},I=function(e,t,n){h(e).toggleClass(t,n).each(function(){""===this.className&&pn(this).attr("class",null)})},L=function(t,e,n){return T(e,function(e){return Yt.is(e,"array")&&(t=t.cloneNode(!0)),n&&ai(ui(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})},M=function(){return a.createRange()},F=function(e,t,n,r){if(Yt.isArray(e)){for(var o=e.length;o--;)e[o]=F(e[o],t,n,r);return e}return!u.collect||e!==a&&e!==i||l.push([e,t,n,r]),m.bind(e,t,n,r||V)},U=function(e,t,n){var r;if(Yt.isArray(e)){for(r=e.length;r--;)e[r]=U(e[r],t,n);return e}if(l&&(e===a||e===i))for(r=l.length;r--;){var o=l[r];e!==o[0]||t&&t!==o[1]||n&&n!==o[2]||m.unbind(o[0],o[1],o[2])}return m.unbind(e,t,n)},z=function(e){if(e&&Bo.isElement(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},V={doc:a,settings:u,win:i,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:e,boundEvents:l,styles:d,schema:f,events:m,isBlock:function(e){if("string"==typeof e)return!!n[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!n[e.nodeName])}return!1},$:g,$$:h,root:null,clone:function(t,e){if(!si||1!==t.nodeType||e)return t.cloneNode(e);if(e)return null;var n=a.createElement(t.nodeName);return ai(b(t),function(e){y(n,e.nodeName,v(t,e.nodeName))}),n},getRoot:C,getViewPort:function(e){var t=e||i,n=t.document,r=n.documentElement;return{x:t.pageXOffset||r.scrollLeft,y:t.pageYOffset||r.scrollTop,w:t.innerWidth||r.clientWidth,h:t.innerHeight||r.clientHeight}},getRect:function(e){var t,n;return e=p(e),t=x(e),n=N(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:N,getParent:function(e,t,n){var r=S(e,t,n,!1);return r&&0<r.length?r[0]:null},getParents:S,get:p,getNext:function(e,t){return k(e,t,"nextSibling")},getPrev:function(e,t){return k(e,t,"previousSibling")},select:function(e,t){return kt(e,p(t)||u.root_element||a,[])},is:E,add:D,create:B,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)t.hasOwnProperty(r)&&null!==t[r]&&"undefined"!=typeof t[r]&&(o+=" "+r+'="'+_(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n=a.createElement("div"),r=a.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r},remove:P,setStyle:function(e,t,n){var r=h(e).css(t,n);u.update_styles&&di(d,r)},getStyle:w,setStyles:function(e,t){var n=h(e).css(t);u.update_styles&&di(d,n)},removeAllAttribs:function(e){return T(e,function(e){var t,n=e.attributes;for(t=n.length-1;0<=t;t--)e.removeAttributeNode(n.item(t))})},setAttrib:y,setAttribs:A,getAttrib:v,getPos:x,parseStyle:function(e){return d.parse(e)},serializeStyle:function(e,t){return d.serialize(e,t)},addStyle:function(e){var t,n;if(V!==gi.DOM&&a===document){if(r[e])return;r[e]=!0}(n=a.getElementById("mceDefaultStyles"))||((n=a.createElement("style")).id="mceDefaultStyles",n.type="text/css",(t=a.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(a.createTextNode(e))},loadCSS:function(e){var n;V===gi.DOM||a!==document?(e||(e=""),n=a.getElementsByTagName("head")[0],ai(e.split(","),function(e){var t;e=Yt._addCacheSuffix(e),o[e]||(o[e]=!0,t=B("link",{rel:"stylesheet",href:e}),n.appendChild(t))})):gi.DOM.loadCSS(e)},addClass:function(e,t){h(e).addClass(t)},removeClass:function(e,t){I(e,t,!1)},hasClass:function(e,t){return h(e).hasClass(t)},toggleClass:I,show:function(e){h(e).show()},hide:function(e){h(e).hide()},isHidden:function(e){return"none"===h(e).css("display")},uniqueId:function(e){return(e||"mce_")+t++},setHTML:R,getOuterHTML:function(e){var t="string"==typeof e?p(e):e;return Bo.isElement(t)?t.outerHTML:pn("<div></div>").append(pn(t).clone()).html()},setOuterHTML:function(e,t){h(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}P(pn(this).html(t),!0)})},decode:O,encode:_,insertAfter:function(e,t){var r=p(t);return T(e,function(e){var t,n;return t=r.parentNode,(n=r.nextSibling)?t.insertBefore(e,n):t.appendChild(e),e})},replace:L,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=B(e),ai(b(t),function(e){y(n,e.nodeName,v(t,e.nodeName))}),L(n,t,!0)),n||t},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return d.toHex(Yt.trim(e))},run:T,getAttribs:b,isEmpty:function(e,t){var n,r,o,i,a,u,s=0;if(e=e.firstChild){a=new oo(e,e.parentNode),t=t||(f?f.getNonEmptyElements():null),i=f?f.getWhiteSpaceElements():{};do{if(o=e.nodeType,Bo.isElement(e)){var c=e.getAttribute("data-mce-bogus");if(c){e=a.next("all"===c);continue}if(u=e.nodeName.toLowerCase(),t&&t[u]){if("br"!==u)return!1;s++,e=a.next();continue}for(n=(r=b(e)).length;n--;)if("name"===(u=r[n].nodeName)||"data-mce-bookmark"===u)return!1}if(8===o)return!1;if(3===o&&!li.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&li.test(e.nodeValue))return!1;e=a.next()}while(e)}return s<=1},createRng:M,nodeIndex:mi,split:function(e,t,n){var r,o,i,a=M();if(e&&t)return a.setStart(e.parentNode,mi(e)),a.setEnd(t.parentNode,mi(t)),r=a.extractContents(),(a=M()).setStart(t.parentNode,mi(t)+1),a.setEnd(e.parentNode,mi(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(Po.trimNode(V,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(Po.trimNode(V,o),e),P(e),n||t},bind:F,unbind:U,fire:function(e,t,n){return m.fire(e,t,n)},getContentEditable:z,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=z(e));e=e.parentNode);return n},destroy:function(){if(l)for(var e=l.length;e--;){var t=l[e];m.unbind(t[0],t[1],t[2])}kt.setDocument&&kt.setDocument()},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}};return s=fi(d,u,function(){return V}),V}(ii=gi||(gi={})).DOM=ii(document),ii.nodeIndex=mi;var pi=gi,hi=pi.DOM,vi=Yt.each,bi=Yt.grep,yi=function(e){return"function"==typeof e},Ci=function(){var u={},o=[],s={},c=[],l=0,f=function(e,t,n){var r,o,i=hi;o=i.uniqueId(),(r=document.createElement("script")).id=o,r.type="text/javascript",r.src=Yt._addCacheSuffix(e),r.onload=function(){i.remove(o),r&&(r.onreadystatechange=r.onload=r=null),t()},r.onerror=function(){yi(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+e)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)};this.loadScript=function(e,t,n){f(e,t,n)},this.isDone=function(e){return 2===u[e]},this.markDone=function(e){u[e]=2},this.add=this.load=function(e,t,n,r){u[e]===undefined&&(o.push(e),u[e]=0),t&&(s[e]||(s[e]=[]),s[e].push({success:t,failure:r,scope:n||this}))},this.remove=function(e){delete u[e],delete s[e]},this.loadQueue=function(e,t,n){this.loadScripts(o,e,t,n)},this.loadScripts=function(n,e,t,r){var o,i=[],a=function(t,e){vi(s[e],function(e){yi(e[t])&&e[t].call(e.scope)}),s[e]=undefined};c.push({success:e,failure:r,scope:t||this}),(o=function(){var e=bi(n);if(n.length=0,vi(e,function(e){2!==u[e]?3!==u[e]?1!==u[e]&&(u[e]=1,l++,f(e,function(){u[e]=2,l--,a("success",e),o()},function(){u[e]=3,l--,i.push(e),a("failure",e),o()})):a("failure",e):a("success",e)}),!l){var t=c.slice(0);c.length=0,vi(t,function(e){0===i.length?yi(e.success)&&e.success.call(e.scope):yi(e.failure)&&e.failure.call(e.scope,i)})}})()}};Ci.ScriptLoader=new Ci;var xi,wi=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return wi(n())}}},Ni={},Ei=wi("en"),Si={setCode:function(e){e&&Ei.set(e)},getCode:function(){return Ei.get()},add:function(e,t){var n=Ni[e];for(var r in n||(Ni[e]=n={}),t)n[r.toLowerCase()]=t[r]},translate:function(e){var t,n,r=Ni[Ei.get()]||{},o=function(e){return P(e)?Object.prototype.toString.call(e):i(e)?"":""+e},i=function(e){return""===e||null===e||e===undefined},a=function(e){var t=o(e),n=t.toLowerCase();return hr(r,n)?o(r[n]):t},u=function(e){return e.replace(/{context:\w+}$/,"")},s=function(e){return e};if(i(e))return s("");if(D(t=e)&&hr(t,"raw"))return s(o(e.raw));if(B(n=e)&&1<n.length){var c=e.slice(1);return s(u(a(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return hr(c,t)?o(c[t]):e})))}return s(u(a(e)))},isRtl:function(){return pr(Ni,Ei.get()).bind(function(e){return pr(e,"_dir")}).exists(function(e){return"rtl"===e})},hasCode:function(e){return hr(Ni,e)}},ki=Yt.each;function Ti(){var r=this,o=[],a={},u={},i=[],s=function(e){var t;return u[e]&&(t=u[e].dependencies),t||[]},c=function(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},l=function(e,n,t,r){var o=s(e);ki(o,function(e){var t=c(n,e);f(t.resource,t,undefined,undefined)}),t&&(r?t.call(r):t.call(Ci))},f=function(e,t,n,r,o){if(!a[e]){var i="string"==typeof t?t:t.prefix+t.resource+t.suffix;0!==i.indexOf("/")&&-1===i.indexOf("://")&&(i=Ti.baseURL+"/"+i),a[e]=i.substring(0,i.lastIndexOf("/")),u[e]?l(e,t,n,r):Ci.ScriptLoader.add(i,function(){return l(e,t,n,r)},r,o)}};return{items:o,urls:a,lookup:u,_listeners:i,get:function(e){return u[e]?u[e].instance:undefined},dependencies:s,requireLangPack:function(e,t){var n=Si.getCode();if(n&&!1!==Ti.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;Ci.ScriptLoader.add(a[e]+"/langs/"+n+".js")}},add:function(t,e,n){o.push(e),u[t]={instance:e,dependencies:n};var r=K(i,function(e){return e.name===t});return i=r.fail,ki(r.pass,function(e){e.callback()}),e},remove:function(e){delete a[e],delete u[e]},createUrl:c,addComponents:function(e,t){var n=r.urls[e];ki(t,function(e){Ci.ScriptLoader.add(n+"/"+e)})},load:f,waitFor:function(e,t){u.hasOwnProperty(e)?t():i.push({name:e,callback:t})}}}(xi=Ti||(Ti={})).PluginManager=xi(),xi.ThemeManager=xi();var Ai=function(t,n){Mr(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},Ri=function(e,t){Ur(e).fold(function(){Mr(e).each(function(e){Bi(e,t)})},function(e){Ai(e,t)})},Di=function(t,n){qr(t).fold(function(){Bi(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},Bi=function(e,t){e.dom().appendChild(t.dom())},Oi=function(t,e){F(e,function(e){Bi(t,e)})},_i=function(e){e.dom().textContent="",F(jr(e),function(e){Pi(e)})},Pi=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Ii=function(e){var t,n=jr(e);0<n.length&&(t=e,F(n,function(e){Ai(t,e)})),Pi(e)},Li=function(n,r){var o=null;return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null===o&&(o=setTimeout(function(){n.apply(null,e),o=null},r))}}},Mi=function(e,t){var n=Cr(e,t);return n===undefined||""===n?[]:n.split(" ")},Fi=function(e){return e.dom().classList!==undefined},Ui=function(e,t){return o=t,i=Mi(n=e,r="class").concat([o]),br(n,r,i.join(" ")),!0;var n,r,o,i},zi=function(e,t){return o=t,0<(i=U(Mi(n=e,r="class"),function(e){return e!==o})).length?br(n,r,i.join(" ")):xr(n,r),!1;var n,r,o,i},Vi=function(e,t){Fi(e)?e.dom().classList.add(t):Ui(e,t)},ji=function(e){0===(Fi(e)?e.dom().classList:Mi(e,"class")).length&&xr(e,"class")},Hi=function(e,t){return Fi(e)&&e.dom().classList.contains(t)},qi=function(e,t){var n=[];return F(jr(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(qi(e,t))}),n},$i=function(e,t){return n=t,o=(r=e)===undefined?document:r.dom(),_r(o)?[]:W(o.querySelectorAll(n),rr.fromDom);var n,r,o};function Wi(e,t,n,r,o){return e(n,r)?A.some(n):P(o)&&o(n)?A.none():t(n,r,o)}var Ki,Xi=function(e,t,n){for(var r=e.dom(),o=P(n)?n:q(!1);r.parentNode;){r=r.parentNode;var i=rr.fromDom(r);if(t(i))return A.some(i);if(o(i))break}return A.none()},Yi=function(e,t,n){return Wi(function(e){return t(e)},Xi,e,t,n)},Gi=function(e,t,n){return Xi(e,function(e){return Or(e,t)},n)},Ji=function(e,t){return n=t,o=(r=e)===undefined?document:r.dom(),_r(o)?A.none():A.from(o.querySelector(n)).map(rr.fromDom);var n,r,o},Qi=function(e,t,n){return Wi(Or,Gi,e,t,n)},Zi=q("mce-annotation"),ea=q("data-mce-annotation"),ta=q("data-mce-annotation-uid"),na=function(r,e){var t=r.selection.getRng(),n=rr.fromDom(t.startContainer),o=rr.fromDom(r.getBody()),i=e.fold(function(){return"."+Zi()},function(e){return"["+ea()+'="'+e+'"]'}),a=Hr(n,t.startOffset).getOr(n),u=Qi(a,i,function(e){return Pr(e,o)}),s=function(e,t){return n=t,(r=e.dom())&&r.hasAttribute&&r.hasAttribute(n)?A.some(Cr(e,t)):A.none();var n,r};return u.bind(function(e){return s(e,""+ta()).bind(function(n){return s(e,""+ea()).map(function(e){var t=ra(r,n);return{uid:n,name:e,elements:t}})})})},ra=function(e,t){var n=rr.fromDom(e.getBody());return $i(n,"["+ta()+'="'+t+'"]')},oa=function(i,e){var n,r,o,a=wi({}),c=function(e,t){u(e,function(e){return t(e),e})},u=function(e,t){var n=a.get(),r=t(n.hasOwnProperty(e)?n[e]:{listeners:[],previous:wi(A.none())});n[e]=r,a.set(n)},t=(n=function(){var e,t,n,r=a.get(),o=(e=fr(r),(n=Q.call(e,0)).sort(t),n);F(o,function(e){u(e,function(u){var s=u.previous.get();return na(i,A.some(e)).fold(function(){var t;s.isSome()&&(c(t=e,function(e){F(e.listeners,function(e){return e(!1,t)})}),u.previous.set(A.none()))},function(e){var t,n,r,o=e.uid,i=e.name,a=e.elements;s.is(o)||(n=o,r=a,c(t=i,function(e){F(e.listeners,function(e){return e(!0,t,{uid:n,nodes:W(r,function(e){return e.dom()})})})}),u.previous.set(A.some(o)))}),{previous:u.previous,listeners:u.listeners}})})},r=30,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==o&&clearTimeout(o),o=setTimeout(function(){n.apply(null,e),o=null},r)}});return i.on("remove",function(){t.cancel()}),i.on("nodeChange",function(){t.throttle()}),{addListener:function(e,t){u(e,function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}})}}},ia=function(e,n){e.on("init",function(){e.serializer.addNodeFilter("span",function(e){F(e,function(t){var e;(e=t,A.from(e.attributes.map[ea()]).bind(n.lookup)).each(function(e){!1===e.persistent&&t.unwrap()})})})})},aa=0,ua=function(e,t){return rr.fromDom(e.dom().cloneNode(t))},sa=function(e){return ua(e,!1)},ca=function(e){return ua(e,!0)},la=function(e,t){var n,r,o=Lr(e).dom(),i=rr.fromDom(o.createDocumentFragment()),a=(n=t,(r=(o||document).createElement("div")).innerHTML=n,jr(rr.fromDom(r)));Oi(i,a),_i(e),Bi(e,i)},fa="\ufeff",da=function(e){return e===fa},ma=fa,ga=function(e){return e.replace(new RegExp(fa,"g"),"")},pa=Bo.isElement,ha=Bo.isText,va=function(e){return ha(e)&&(e=e.parentNode),pa(e)&&e.hasAttribute("data-mce-caret")},ba=function(e){return ha(e)&&da(e.data)},ya=function(e){return va(e)||ba(e)},Ca=function(e){return e.firstChild!==e.lastChild||!Bo.isBr(e.firstChild)},xa=function(e){var t=e.container();return e&&Bo.isText(t)&&t.data.charAt(e.offset())===ma},wa=function(e){var t=e.container();return e&&Bo.isText(t)&&t.data.charAt(e.offset()-1)===ma},Na=function(e,t,n){var r,o,i;return(r=t.ownerDocument.createElement(e)).setAttribute("data-mce-caret",n?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(((i=document.createElement("br")).setAttribute("data-mce-bogus","1"),i)),o=t.parentNode,n?o.insertBefore(r,t):t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r),r},Ea=function(e){return ha(e)&&e.data[0]===ma},Sa=function(e){return ha(e)&&e.data[e.data.length-1]===ma},ka=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],Bo.isBogus(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n},Ta=Bo.isContentEditableTrue,Aa=Bo.isContentEditableFalse,Ra=Bo.isBr,Da=Bo.isText,Ba=Bo.matchNodeNames("script style textarea"),Oa=Bo.matchNodeNames("img input textarea hr iframe video audio object"),_a=Bo.matchNodeNames("table"),Pa=ya,Ia=function(e){return!Pa(e)&&(Da(e)?!Ba(e.parentNode):Oa(e)||Ra(e)||_a(e)||La(e))},La=function(e){return!1===(t=e,Bo.isElement(t)&&"true"===t.getAttribute("unselectable"))&&Aa(e);var t},Ma=function(e,t){return Ia(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(La(e))return!1;if(Ta(e))return!0}return!0}(e,t)},Fa=Math.round,Ua=function(e){return e?{left:Fa(e.left),top:Fa(e.top),bottom:Fa(e.bottom),right:Fa(e.right),width:Fa(e.width),height:Fa(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},za=function(e,t){return(e=Ua(e)).right=(t||(e.left=e.left+e.width),e.left),e.width=0,e},Va=function(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2},ja=function(e,t){return e.bottom-e.height/2<t.top||!(e.top>t.bottom)&&Va(t.top-e.bottom,e,t)},Ha=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&Va(t.bottom-e.top,e,t)},qa=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},$a=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},Wa=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]"),Ka=function(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&Wa.test(e)},Xa=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return A.none();n.push(o.getOrDie())}return A.some(t.apply(null,n))},Ya=[].slice,Ga=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ya.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},Ja=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ya.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}},Qa=Bo.isElement,Za=Ia,eu=Bo.matchStyleValues("display","block table"),tu=Bo.matchStyleValues("float","left right"),nu=Ga(Qa,Za,y(tu)),ru=y(Bo.matchStyleValues("white-space","pre pre-line pre-wrap")),ou=Bo.isText,iu=Bo.isBr,au=pi.nodeIndex,uu=$a,su=function(e){return"createRange"in e?e.createRange():pi.DOM.createRng()},cu=function(e){return e&&/[\r\n\t ]/.test(e)},lu=function(e){return!!e.setStart&&!!e.setEnd},fu=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(cu(e.toString())&&ru(n.parentNode)&&Bo.isText(n)&&(t=n.data,cu(t[r-1])||cu(t[r+1])))},du=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},mu=function(e){var t,n,r,o,i,a,u,s;return t=0<(n=e.getClientRects()).length?Ua(n[0]):Ua(e.getBoundingClientRect()),!lu(e)&&iu(e)&&du(t)?(i=(r=e).ownerDocument,a=su(i),u=i.createTextNode("\xa0"),(s=r.parentNode).insertBefore(u,r),a.setStart(u,0),a.setEnd(u,1),o=Ua(a.getBoundingClientRect()),s.removeChild(u),o):du(t)&&lu(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&Bo.isText(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),mu(i)}return null}(e):t},gu=function(e,t){var n=za(e,t);return n.width=1,n.right=n.left+1,n},pu=function(e){var t,n,r=[],o=function(e){var t,n;0!==e.height&&(0<r.length&&(t=e,n=r[r.length-1],t.left===n.left&&t.top===n.top&&t.bottom===n.bottom&&t.right===n.right)||r.push(e))},i=function(e,t){var n=su(e.ownerDocument);if(t<e.data.length){if(Ka(e.data[t]))return r;if(Ka(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!fu(n)))return o(gu(mu(n),!1)),r}0<t&&(n.setStart(e,t-1),n.setEnd(e,t),fu(n)||o(gu(mu(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),fu(n)||o(gu(mu(n),!0)))};if(ou(e.container()))return i(e.container(),e.offset()),r;if(Qa(e.container()))if(e.isAtEnd())n=uu(e.container(),e.offset()),ou(n)&&i(n,n.data.length),nu(n)&&!iu(n)&&o(gu(mu(n),!1));else{if(n=uu(e.container(),e.offset()),ou(n)&&i(n,0),nu(n)&&e.isAtEnd())return o(gu(mu(n),!1)),r;t=uu(e.container(),e.offset()-1),nu(t)&&!iu(t)&&(eu(t)||eu(n)||!nu(n))&&o(gu(mu(t),!1)),nu(n)&&o(gu(mu(n),!0))}return r};function hu(t,n,e){var r=function(){return e||(e=pu(hu(t,n))),e};return{container:q(t),offset:q(n),toRange:function(){var e;return(e=su(t.ownerDocument)).setStart(t,n),e.setEnd(t,n),e},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return ou(t),0===n},isAtEnd:function(){return ou(t)?n>=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return uu(t,e?n-1:n)}}}(Ki=hu||(hu={})).fromRangeStart=function(e){return Ki(e.startContainer,e.startOffset)},Ki.fromRangeEnd=function(e){return Ki(e.endContainer,e.endOffset)},Ki.after=function(e){return Ki(e.parentNode,au(e)+1)},Ki.before=function(e){return Ki(e.parentNode,au(e))},Ki.isAbove=function(e,t){return Xa([ee(t.getClientRects()),te(e.getClientRects())],ja).getOr(!1)},Ki.isBelow=function(e,t){return Xa([te(t.getClientRects()),ee(e.getClientRects())],Ha).getOr(!1)},Ki.isAtStart=function(e){return!!e&&e.isAtStart()},Ki.isAtEnd=function(e){return!!e&&e.isAtEnd()},Ki.isTextPosition=function(e){return!!e&&Bo.isText(e.container())},Ki.isElementPosition=function(e){return!1===Ki.isTextPosition(e)};var vu,bu,yu,Cu=hu,xu=Bo.isText,wu=Bo.isBogus,Nu=pi.nodeIndex,Eu=function(e){var t=e.parentNode;return wu(t)?Eu(t):t},Su=function(e){return e?qt.reduce(e.childNodes,function(e,t){return wu(t)&&"BR"!==t.nodeName?e=e.concat(Su(t)):e.push(t),e},[]):[]},ku=function(t){return function(e){return t===e}},Tu=function(e){var t,r,n,o;return(xu(e)?"text()":e.nodeName.toLowerCase())+"["+(r=Su(Eu(t=e)),n=qt.findIndex(r,ku(t),t),r=r.slice(0,n+1),o=qt.reduce(r,function(e,t,n){return xu(t)&&xu(r[n-1])&&e++,e},0),r=qt.filter(r,Bo.matchNodeNames(t.nodeName)),(n=qt.findIndex(r,ku(t),t))-o)+"]"},Au=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),xu(n)?o=function(e,t){for(;(e=e.previousSibling)&&xu(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Tu(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=qt.filter(a,y(Bo.isBogus)),(u=u.concat(qt.map(a,function(e){return Tu(e)}))).reverse().join("/")+","+o},Ru=function(e,t){var n,r,o;return t?(t=(n=t.split(","))[0].split("/"),o=1<n.length?n[1]:"before",(r=qt.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),n=e,r=t[1],o=parseInt(t[2],10),i=Su(n),i=qt.filter(i,function(e,t){return!xu(e)||!xu(i[t-1])}),(i=qt.filter(i,Bo.matchNodeNames(r)))[o]):null;var n,r,o,i},e))?xu(r)?function(e,t){for(var n,r=e,o=0;xu(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!xu(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return xu(e)&&t>e.data.length&&(t=e.data.length),Cu(e,t)}(r,parseInt(o,10)):(o="after"===o?Nu(r)+1:Nu(r),Cu(r.parentNode,o)):null):null},Du=Bo.isContentEditableFalse,Bu=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=e.getRoot();for(Bo.isText(a)?s.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&Bo.isText(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(e.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(e.nodeIndex(a,n));return s},Ou=function(e){Bo.isText(e)&&0===e.data.length&&e.parentNode.removeChild(e)},_u=function(e,t,n){var r=0;return Yt.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},Pu=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],Bo.isElement(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r))},Iu=function(e){return Pu(e,!0),Pu(e,!1),e},Lu=function(e,t){var n;if(Bo.isElement(e)&&(e=$a(e,t),Du(e)))return e;if(ya(e)){if(Bo.isText(e)&&va(e)&&(e=e.parentNode),n=e.previousSibling,Du(n))return n;if(n=e.nextSibling,Du(n))return n}},Mu=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Du(r)||"IMG"===o)return{name:o,index:_u(n.dom,o,r)};var a,u,s,c,l,f,d,m=Lu((a=i).startContainer,a.startOffset)||Lu(a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:_u(n.dom,o,m)}:(u=e,c=t,l=i,f=(s=n).dom,(d={}).start=Bu(f,u,c,l,!0),s.isCollapsed()||(d.end=Bu(f,u,c,l,!1)),d)},Fu=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,"&#xFEFF;"):e.create("span",r)},Uu=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:_u(n,u,a)};var s=Iu(r.cloneRange());if(!i){s.collapse(!1);var c=Fu(n,o+"_end",t);s.insertNode(c),Ou(c.nextSibling)}(r=Iu(r)).collapse(!0);var l=Fu(n,o+"_start",t);return r.insertNode(l),Ou(l.previousSibling),Ou(l.nextSibling),e.moveToBookmark({id:o,keep:1}),{id:o}},zu={getBookmark:function(e,t,n){return 2===t?Mu(ga,n,e):3===t?(o=(r=e).getRng(),{start:Au(r.dom.getRoot(),Cu.fromRangeStart(o)),end:Au(r.dom.getRoot(),Cu.fromRangeEnd(o))}):t?{rng:e.getRng()}:Uu(e,!1);var r,o},getUndoBookmark:d(Mu,$,!0),getPersistentBookmark:Uu},Vu="_mce_caret",ju=function(e){return Bo.isElement(e)&&e.id===Vu},Hu=function(e,t){for(;t&&t!==e;){if(t.id===Vu)return t;t=t.parentNode}return null},qu=Bo.isElement,$u=Bo.isText,Wu=function(e){var t=e.parentNode;t&&t.removeChild(e)},Ku=function(e,t){0===t.length?Wu(e):e.nodeValue=t},Xu=function(e){var t=ga(e);return{count:e.length-t.length,text:t}},Yu=function(e,t){return Qu(e),t},Gu=function(e,t){var n,r,o,i=t.container(),a=(n=ne(i.childNodes),r=e,o=L(n,r),-1===o?A.none():A.some(o)).map(function(e){return e<t.offset()?Cu(i,t.offset()-1):t}).getOr(t);return Qu(e),a},Ju=function(e,t){return $u(e)&&t.container()===e?(r=t,o=Xu((n=e).data.substr(0,r.offset())),i=Xu(n.data.substr(r.offset())),0<(a=o.text+i.text).length?(Ku(n,a),Cu(n,r.offset()-o.count)):r):Yu(e,t);var n,r,o,i,a},Qu=function(e){if(qu(e)&&ya(e)&&(Ca(e)?e.removeAttribute("data-mce-caret"):Wu(e)),$u(e)){var t=ga(function(e){try{return e.nodeValue}catch(t){return""}}(e));Ku(e,t)}},Zu={removeAndReposition:function(e,t){return Cu.isTextPosition(t)?Ju(e,t):(n=e,(r=t).container()===n.parentNode?Gu(n,r):Yu(n,r));var n,r},remove:Qu},es=tr.detect().browser,ts=Bo.isContentEditableFalse,ns=function(e,t,n){var r,o,i,a,u,s=za(t.getBoundingClientRect(),n);return i="BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,e.scrollTop||r.scrollTop):(u=e.getBoundingClientRect(),o=e.scrollLeft-u.left,e.scrollTop-u.top),s.left+=o,s.right+=o,s.top+=i,s.bottom+=i,s.width=1,0<(a=t.offsetWidth-t.clientWidth)&&(n&&(a*=-1),s.left+=a,s.right+=a),s},rs=function(a,u,e){var t,s,c=wi(A.none()),l=function(){!function(e){var t,n,r,o,i;for(t=pn("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,Sa(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,Ea(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(a),s&&(Zu.remove(s),s=null),c.get().each(function(e){pn(e.caret).remove(),c.set(A.none())}),clearInterval(t)},f=function(){t=ve.setInterval(function(){e()?pn("div.mce-visual-caret",a).toggleClass("mce-visual-caret-hidden"):pn("div.mce-visual-caret",a).addClass("mce-visual-caret-hidden")},500)};return{show:function(t,e){var n,r,o;if(l(),o=e,Bo.isElement(o)&&/^(TD|TH)$/i.test(o.tagName))return null;if(!u(e))return s=function(e,t){var n,r,o;if(r=e.ownerDocument.createTextNode(ma),o=e.parentNode,t){if(n=e.previousSibling,ha(n)){if(ya(n))return n;if(Sa(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else{if(n=e.nextSibling,ha(n)){if(ya(n))return n;if(Ea(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r}(e,t),r=e.ownerDocument.createRange(),ts(s.nextSibling)?(r.setStart(s,0),r.setEnd(s,0)):(r.setStart(s,1),r.setEnd(s,1)),r;s=Na("p",e,t),n=ns(a,e,t),pn(s).css("top",n.top);var i=pn('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(n).appendTo(a)[0];return c.set(A.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&pn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:l,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(){c.get().each(function(e){var t=ns(a,e.element,e.before);pn(e.caret).css(t)})},destroy:function(){return ve.clearInterval(t)}}},os=function(){return es.isIE()||es.isEdge()||es.isFirefox()},is=function(e){return ts(e)||Bo.isTable(e)&&os()},as=(vu="\xa0",function(e){return vu===e}),us=function(e){return/^[\r\n\t ]$/.test(e)},ss=function(e){return!us(e)&&!as(e)},cs=Bo.isContentEditableFalse,ls=Bo.matchStyleValues("display","block table table-cell table-caption list-item"),fs=ya,ds=va,ms=Bo.isElement,gs=Ia,ps=function(e){return 0<e},hs=function(e){return e<0},vs=function(e,t){for(var n;n=e(t);)if(!ds(n))return n;return null},bs=function(e,t,n,r,o){var i=new oo(e,r);if(hs(t)){if((cs(e)||ds(e))&&n(e=vs(i.prev,!0)))return e;for(;e=vs(i.prev,o);)if(n(e))return e}if(ps(t)){if((cs(e)||ds(e))&&n(e=vs(i.next,!0)))return e;for(;e=vs(i.next,o);)if(n(e))return e}return null},ys=function(e,t){for(;e&&e!==t;){if(ls(e))return e;e=e.parentNode}return null},Cs=function(e,t,n){return ys(e.container(),n)===ys(t.container(),n)},xs=function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),ms(n)?n.childNodes[r+e]:null):null},ws=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},Ns=function(e,t,n){var r,o,i,a;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],fs(r)&&(r=r[o]),cs(r)){if(a=n,ys(r,i=t)===ys(a,i))return r;break}if(gs(r))break;n=n.parentNode}return null},Es=d(ws,!0),Ss=d(ws,!1),ks=function(e,t,n){var r,o,i,a,u=d(Ns,!0,t),s=d(Ns,!1,t);if(o=n.startContainer,i=n.startOffset,va(o)){if(ms(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,is(r)))return Es(r);if("after"===a&&(r=o.previousSibling,is(r)))return Ss(r)}if(!n.collapsed)return n;if(Bo.isText(o)){if(fs(o)){if(1===e){if(r=s(o))return Es(r);if(r=u(o))return Ss(r)}if(-1===e){if(r=u(o))return Ss(r);if(r=s(o))return Es(r)}return n}if(Sa(o)&&i>=o.data.length-1)return 1===e&&(r=s(o))?Es(r):n;if(Ea(o)&&i<=1)return-1===e&&(r=u(o))?Ss(r):n;if(i===o.data.length)return(r=s(o))?Es(r):n;if(0===i)return(r=u(o))?Ss(r):n}return n},Ts=function(e,t){var n=xs(e,t);return cs(n)&&!Bo.isBogusAll(n)},As=function(e,t){return Bo.isTable(xs(e,t))},Rs=function(e,t){return A.from(xs(e?0:-1,t)).filter(cs)},Ds=function(e,t,n){var r=ks(e,t,n);return-1===e?hu.fromRangeStart(r):hu.fromRangeEnd(r)},Bs=d(Ts,0),Os=d(Ts,-1),_s=d(As,0),Ps=d(As,-1),Is=function(n,r,o){return A.from(o.container()).filter(Bo.isText).exists(function(e){var t=n?0:-1;return r(e.data.charAt(o.offset()+t))})},Ls=d(Is,!0,us),Ms=d(Is,!1,us),Fs=function(e){return A.from(e.getNode()).map(rr.fromDom)};(yu=bu||(bu={}))[yu.Backwards=-1]="Backwards",yu[yu.Forwards=1]="Forwards";var Us=Bo.isContentEditableFalse,zs=Bo.isText,Vs=Bo.isElement,js=Bo.isBr,Hs=Ia,qs=function(e){return Oa(e)||!!La(t=e)&&!0!==z(ne(t.getElementsByTagName("*")),function(e,t){return e||Ta(t)},!1);var t},$s=Ma,Ws=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},Ks=function(e,t){if(ps(e)){if(Hs(t.previousSibling)&&!zs(t.previousSibling))return Cu.before(t);if(zs(t))return Cu(t,0)}if(hs(e)){if(Hs(t.nextSibling)&&!zs(t.nextSibling))return Cu.after(t);if(zs(t))return Cu(t,t.data.length)}return hs(e)?js(t)?Cu.before(t):Cu.after(t):Cu.before(t)},Xs=function(e,t,n){var r,o,i,a,u;if(!Vs(n)||!t)return null;if(t.isEqual(Cu.after(n))&&n.lastChild){if(u=Cu.after(n.lastChild),hs(e)&&Hs(n.lastChild)&&Vs(n.lastChild))return js(n.lastChild)?Cu.before(n.lastChild):u}else u=t;var s,c,l,f=u.container(),d=u.offset();if(zs(f)){if(hs(e)&&0<d)return Cu(f,--d);if(ps(e)&&d<f.length)return Cu(f,++d);r=f}else{if(hs(e)&&0<d&&(o=Ws(f,d-1),Hs(o)))return!qs(o)&&(i=bs(o,e,$s,o))?zs(i)?Cu(i,i.data.length):Cu.after(i):zs(o)?Cu(o,o.data.length):Cu.before(o);if(ps(e)&&d<f.childNodes.length&&(o=Ws(f,d),Hs(o)))return js(o)?(s=n,(l=(c=o).nextSibling)&&Hs(l)?zs(l)?Cu(l,0):Cu.before(l):Xs(bu.Forwards,Cu.after(c),s)):!qs(o)&&(i=bs(o,e,$s,o))?zs(i)?Cu(i,0):Cu.before(i):zs(o)?Cu(o,0):Cu.after(o);r=o||u.getNode()}return(ps(e)&&u.isAtEnd()||hs(e)&&u.isAtStart())&&(r=bs(r,e,q(!0),n,!0),$s(r,n))?Ks(e,r):(o=bs(r,e,$s,n),!(a=qt.last(U(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(f,n),Us)))||o&&a.contains(o)?o?Ks(e,o):null:u=ps(e)?Cu.after(a):Cu.before(a))},Ys=function(t){return{next:function(e){return Xs(bu.Forwards,e,t)},prev:function(e){return Xs(bu.Backwards,e,t)}}},Gs=function(e){return Cu.isTextPosition(e)?0===e.offset():Ia(e.getNode())},Js=function(e){if(Cu.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return Ia(e.getNode(!0))},Qs=function(e,t){return!Cu.isTextPosition(e)&&!Cu.isTextPosition(t)&&e.getNode()===t.getNode(!0)},Zs=function(e,t,n){return e?!Qs(t,n)&&(r=t,!(!Cu.isTextPosition(r)&&Bo.isBr(r.getNode())))&&Js(t)&&Gs(n):!Qs(n,t)&&Gs(t)&&Js(n);var r},ec=function(e,t,n){var r=Ys(t);return A.from(e?r.next(n):r.prev(n))},tc=function(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return Bo.isText(u)?A.some(Cu(u,e?0:u.data.length)):u?Ia(u)?A.some(e?Cu.before(u):(a=u,Bo.isBr(a)?Cu.before(a):Cu.after(a))):(r=t,o=u,i=(n=e)?Cu.before(o):Cu.after(o),ec(n,r,i)):A.none()},nc=d(ec,!0),rc=d(ec,!1),oc={fromPosition:ec,nextPosition:nc,prevPosition:rc,navigate:function(t,n,r){return ec(t,n,r).bind(function(e){return Cs(r,e,n)&&Zs(t,r,e)?ec(t,n,e):A.some(e)})},positionIn:tc,firstPositionIn:d(tc,!0),lastPositionIn:d(tc,!1)},ic=function(e,t){return!e.isBlock(t)||t.innerHTML||de.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t},ac=function(e,t){return oc.lastPositionIn(e).fold(function(){return!1},function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})},uc=function(e,t,n){return!(!1!==t.hasChildNodes()||!Hu(e,t)||(o=n,i=(r=t).ownerDocument.createTextNode(ma),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),0));var r,o,i},sc=function(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,uc(c,i,r))return!0;if(s[o]>u.length-1)return!!uc(c,i,r)||ac(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},cc=function(e){return Bo.isText(e)&&0<e.data.length},lc=function(e,t,n){var r,o,i,a,u,s,c=e.get(n.id+"_"+t),l=n.keep;if(c){if(r=c.parentNode,o="start"===t?l?c.hasChildNodes()?(r=c.firstChild,1):cc(c.nextSibling)?(r=c.nextSibling,0):cc(c.previousSibling)?(r=c.previousSibling,c.previousSibling.data.length):(r=c.parentNode,e.nodeIndex(c)+1):e.nodeIndex(c):l?c.hasChildNodes()?(r=c.firstChild,1):cc(c.previousSibling)?(r=c.previousSibling,c.previousSibling.data.length):(r=c.parentNode,e.nodeIndex(c)):e.nodeIndex(c),u=r,s=o,!l){for(a=c.previousSibling,i=c.nextSibling,Yt.each(Yt.grep(c.childNodes),function(e){Bo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});c=e.get(n.id+"_"+t);)e.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&Bo.isText(a)&&!de.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return A.some(Cu(u,s))}return A.none()},fc=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b=e.dom;if(t){if(v=t,Yt.isArray(v.start))return p=t,h=(g=b).createRng(),sc(g,!0,p,h)&&sc(g,!1,p,h)?A.some(h):A.none();if("string"==typeof t.start)return A.some((f=t,d=(l=b).createRng(),m=Ru(l.getRoot(),f.start),d.setStart(m.container(),m.offset()),m=Ru(l.getRoot(),f.end),d.setEnd(m.container(),m.offset()),d));if(t.hasOwnProperty("id"))return s=lc(o=b,"start",i=t),c=lc(o,"end",i),Xa([s,(a=c,u=s,a.isSome()?a:u)],function(e,t){var n=o.createRng();return n.setStart(ic(o,e.container()),e.offset()),n.setEnd(ic(o,t.container()),t.offset()),n});if(t.hasOwnProperty("name"))return n=b,r=t,A.from(n.select(r.name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(t.hasOwnProperty("rng"))return A.some(t.rng)}return A.none()},dc=function(e,t,n){return zu.getBookmark(e,t,n)},mc=function(t,e){fc(t,e).each(function(e){t.setRng(e)})},gc=function(e){return Bo.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},pc=function(e){return e&&/^(IMG)$/.test(e.nodeName)},hc=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},vc=function(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},bc={isInlineBlock:pc,moveStart:function(e,t,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!pc(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?r=new oo(u=i[a],e.getParent(u,e.isBlock)):(r=new oo(u=i[i.length-1],e.getParent(u,e.isBlock))).next(!0),o=r.current();o;o=r.next())if(3===o.nodeType&&!hc(o))return n.setStart(o,0),void t.setRng(n)},getNonWhiteSpaceSibling:function(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1===e.nodeType||!hc(e))return e},isTextBlock:function(e,t){return t.nodeType&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},isValid:function(e,t,n){return e.schema.isValidChild(t,n)},isWhiteSpaceNode:hc,replaceVars:function(e,n){return"string"!=typeof e?e=e(n):n&&(e=e.replace(/%(\w+)/g,function(e,t){return n[t]||e})),e},isEq:function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},normalizeStyleValue:vc,getStyle:function(e,t,n){return vc(e,e.getStyle(t,n),n)},getTextDecoration:function(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n}),n},getParents:function(e,t,n){return e.getParents(t,n,e.getRoot())}},yc=gc,Cc=bc.getParents,xc=bc.isWhiteSpaceNode,wc=bc.isTextBlock,Nc=function(e,t){for(void 0===t&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)(e=e.childNodes[t])&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}},Ec=function(e,t){for(var n=t;n;){if(1===n.nodeType&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},Sc=function(e,t,n,r){var o,i,a=n.nodeValue;return void 0===r&&(r=e?a.length:0),e?(o=a.lastIndexOf(" ",r),-1!==(o=(i=a.lastIndexOf("\xa0",r))<o?o:i)&&!t&&(o<r||!e)&&o<=a.length&&o++):(o=a.indexOf(" ",r),i=a.indexOf("\xa0",r),o=-1!==o&&(-1===i||o<i)?o:i),o},kc=function(e,t,n,r,o,i){var a,u,s,c;if(3===n.nodeType){if(-1!==(s=Sc(o,i,n,r)))return{container:n,offset:s};c=n}for(a=new oo(n,e.getParent(n,e.isBlock)||t);u=a[o?"prev":"next"]();)if(3!==u.nodeType||yc(u.parentNode)){if(e.isBlock(u)||bc.isEq(u,"BR"))break}else if(-1!==(s=Sc(o,i,c=u)))return{container:u,offset:s};if(c)return{container:c,offset:r=o?0:c.length}},Tc=function(e,t,n,r,o){var i,a,u,s;for(3===r.nodeType&&0===r.nodeValue.length&&r[o]&&(r=r[o]),i=Cc(e,r),a=0;a<i.length;a++)for(u=0;u<t.length;u++)if(!("collapsed"in(s=t[u])&&s.collapsed!==n.collapsed)&&e.is(i[a],s.selector))return i[a];return r},Ac=function(t,e,n,r){var o,i=t.dom,a=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,a)),!o){var u=i.getParent(n,"LI,TD,TH");o=i.getParent(3===n.nodeType?n.parentNode:n,function(e){return e!==a&&wc(t,e)},u)}if(o&&e[0].wrapper&&(o=Cc(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!bc.isEq(o,"br")););return o||n},Rc=function(e,t,n,r,o,i,a){var u,s,c,l,f,d;if(u=s=a?n:o,l=a?"previousSibling":"nextSibling",f=e.getRoot(),3===u.nodeType&&!xc(u)&&(a?0<r:i<u.nodeValue.length))return u;for(;;){if(!t[0].block_expand&&e.isBlock(s))return s;for(c=s[l];c;c=c[l])if(!yc(c)&&!xc(c)&&("BR"!==(d=c).nodeName||!d.getAttribute("data-mce-bogus")||d.nextSibling))return s;if(s===f||s.parentNode===f){u=s;break}s=s.parentNode}return u},Dc=function(e,t,n,r){var o,i=t.startContainer,a=t.startOffset,u=t.endContainer,s=t.endOffset,c=e.dom;return 1===i.nodeType&&i.hasChildNodes()&&3===(i=$a(i,a)).nodeType&&(a=0),1===u.nodeType&&u.hasChildNodes()&&3===(u=$a(u,t.collapsed?s:s-1)).nodeType&&(s=u.nodeValue.length),i=Ec(c,i),u=Ec(c,u),(yc(i.parentNode)||yc(i))&&(i=yc(i)?i:i.parentNode,3===(i=t.collapsed?i.previousSibling||i:i.nextSibling||i).nodeType&&(a=t.collapsed?i.length:0)),(yc(u.parentNode)||yc(u))&&(u=yc(u)?u:u.parentNode,3===(u=t.collapsed?u.nextSibling||u:u.previousSibling||u).nodeType&&(s=t.collapsed?0:u.length)),t.collapsed&&((o=kc(c,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=kc(c,e.getBody(),u,s,!1,r))&&(u=o.container,s=o.offset)),n[0].inline&&(u=r?u:function(e,t){var n=Nc(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=Nc(n.node.previousSibling);n.node&&0<n.offset&&3===n.node.nodeType&&" "===n.node.nodeValue.charAt(n.offset-1)&&1<n.offset&&(e=n.node).splitText(n.offset-1)}return e}(u,s)),(n[0].inline||n[0].block_expand)&&(n[0].inline&&3===i.nodeType&&0!==a||(i=Rc(c,n,i,a,u,s,!0)),n[0].inline&&3===u.nodeType&&s!==u.nodeValue.length||(u=Rc(c,n,i,a,u,s,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(i=Tc(c,n,t,i,"previousSibling"),u=Tc(c,n,t,u,"nextSibling")),(n[0].block||n[0].selector)&&(i=Ac(e,n,i,"previousSibling"),u=Ac(e,n,u,"nextSibling"),n[0].block&&(c.isBlock(i)||(i=Rc(c,n,i,a,u,s,!0)),c.isBlock(u)||(u=Rc(c,n,i,a,u,s,!1)))),1===i.nodeType&&(a=c.nodeIndex(i),i=i.parentNode),1===u.nodeType&&(s=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:i,startOffset:a,endContainer:u,endOffset:s}},Bc=Yt.each,Oc=function(e,t,o){var n,r,i,a,u,s,c,l=t.startContainer,f=t.startOffset,d=t.endContainer,m=t.endOffset;if(0<(c=e.select("td[data-mce-selected],th[data-mce-selected]")).length)Bc(c,function(e){o([e])});else{var g,p,h,v=function(e){var t;return 3===(t=e[0]).nodeType&&t===l&&f>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&0<e.length&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e},b=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},y=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},C=function(e,t,n){var r=n?"nextSibling":"previousSibling";for(u=(a=e).parentNode;a&&a!==t;a=u)u=a.parentNode,(s=b(a===e?a:a[r],r)).length&&(n||s.reverse(),o(v(s)))};if(1===l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[f]),1===d.nodeType&&d.hasChildNodes()&&(p=m,h=(g=d).childNodes,--p>h.length-1?p=h.length-1:p<0&&(p=0),d=h[p]||g),l===d)return o(v([l]));for(n=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,n);if(a===n)break}r=y(l,n)||l,i=y(d,n)||d,C(l,r,!0),(s=b(r===l?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},_c=function HN(n,r){var t=function(e){return n(e)?A.from(e.dom().nodeValue):A.none()},e=tr.detect().browser,o=e.isIE()&&10===e.version.major?function(e){try{return t(e)}catch(jN){return A.none()}}:t;return{get:function(e){if(!n(e))throw new Error("Can only get "+r+" value of a "+r+" node");return o(e).getOr("")},getOption:o,set:function(e,t){if(!n(e))throw new Error("Can only set raw "+r+" value of a "+r+" node");e.dom().nodeValue=t}}}(lr,"text"),Pc=function(e){return _c.get(e)},Ic=function(r,o,i,a){return Mr(o).fold(function(){return"skipping"},function(e){return"br"===a||lr(n=o)&&"\ufeff"===Pc(n)?"valid":cr(t=o)&&Hi(t,Zi())?"existing":ju(o)?"caret":bc.isValid(r,i,a)&&bc.isValid(r,ur(e),i)?"valid":"invalid-child";var t,n})},Lc=function(e,t,n,r){var o,i,a=t.uid,u=void 0===a?(o="mce-annotation",i=(new Date).getTime(),o+"_"+Math.floor(1e9*Math.random())+ ++aa+String(i)):a,s=function h(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n}(t,["uid"]),c=rr.fromTag("span",e);Vi(c,Zi()),br(c,""+ta(),u),br(c,""+ea(),n);var l,f=r(u,s),d=f.attributes,m=void 0===d?{}:d,g=f.classes,p=void 0===g?[]:g;return yr(c,m),l=c,F(p,function(e){Vi(l,e)}),c},Mc=function(i,e,t,n,r){var a=[],u=Lc(i.getDoc(),r,t,n),s=wi(A.none()),c=function(){s.set(A.none())},l=function(e){F(e,o)},o=function(e){var t,n;switch(Ic(i,e,"span",ur(e))){case"invalid-child":c();var r=jr(e);l(r),c();break;case"valid":var o=s.get().getOrThunk(function(){var e=sa(u);return a.push(e),s.set(A.some(e)),e});Ai(t=e,n=o),Bi(n,t)}};return Oc(i.dom,e,function(e){var t;c(),t=W(e,rr.fromDom),l(t)}),a},Fc=function(s,c,l,f){s.undoManager.transact(function(){var e,t,n,r,o=s.selection.getRng();if(o.collapsed&&(r=Dc(e=s,t=o,[{inline:!0}],3===(n=t).startContainer.nodeType&&n.startContainer.nodeValue.length>=n.startOffset&&"\xa0"===n.startContainer.nodeValue[n.startOffset]),t.setStart(r.startContainer,r.startOffset),t.setEnd(r.endContainer,r.endOffset),e.selection.setRng(t)),s.selection.getRng().collapsed){var i=Lc(s.getDoc(),f,c,l.decorate);la(i,"\xa0"),s.selection.getRng().insertNode(i.dom()),s.selection.select(i.dom())}else{var a=zu.getPersistentBookmark(s.selection,!1),u=s.selection.getRng();Mc(s,u,c,l.decorate,f),s.selection.moveToBookmark(a)}})};function Uc(s){var n,r=(n={},{register:function(e,t){n[e]={name:e,settings:t}},lookup:function(e){return n.hasOwnProperty(e)?A.from(n[e]).map(function(e){return e.settings}):A.none()}});ia(s,r);var o=oa(s);return{register:function(e,t){r.register(e,t)},annotate:function(t,n){r.lookup(t).each(function(e){Fc(s,t,e,n)})},annotationChanged:function(e,t){o.addListener(e,t)},remove:function(e){na(s,A.some(e)).each(function(e){var t=e.elements;F(t,Ii)})},getAll:function(e){var t,n,r,o,i,a,u=(t=s,n=e,r=rr.fromDom(t.getBody()),o=$i(r,"["+ea()+'="'+n+'"]'),i={},F(o,function(e){var t=Cr(e,ta()),n=i.hasOwnProperty(t)?i[t]:[];i[t]=n.concat([e])}),i);return a=function(e){return W(e,function(e){return e.dom()})},gr(u,function(e,t,n){return{k:t,v:a(e,t,n)}})}}}var zc,Vc=Object.prototype.hasOwnProperty,jc=(zc=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Vc.call(o,i)&&(n[i]=zc(n[i],o[i]))}return n}),Hc=/^[ \t\r\n]*$/,qc={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},$c=function(e,t,n){var r,o,i=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[i])return e[i];if(e!==t){if(r=e[a])return r;for(o=e.parent;o&&o!==t;o=o.parent)if(r=o[a])return r}},Wc=function(){function a(e,t){this.name=e,1===(this.type=t)&&(this.attributes=[],this.attributes.map={})}return a.create=function(e,t){var n,r;if(n=new a(e,qc[e]||1),t)for(r in t)n.attr(r,t[r]);return n},a.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},a.prototype.attr=function(e,t){var n,r;if("string"!=typeof e){for(r in e)this.attr(r,e[r]);return this}if(n=this.attributes){if(t===undefined)return n.map[e];if(null===t){if(e in n.map)for(delete n.map[e],r=n.length;r--;)if(n[r].name===e)return n=n.splice(r,1),this;return this}if(e in n.map){for(r=n.length;r--;)if(n[r].name===e){n[r].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,this}},a.prototype.clone=function(){var e,t,n,r,o,i=new a(this.name,this.type);if(n=this.attributes){for((o=[]).map={},e=0,t=n.length;e<t;e++)"id"!==(r=n[e]).name&&(o[o.length]={name:r.name,value:r.value},o.map[r.name]=r.value);i.attributes=o}return i.value=this.value,i.shortEnded=this.shortEnded,i},a.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},a.prototype.unwrap=function(){var e,t;for(e=this.firstChild;e;)t=e.next,this.insert(e,this,!0),e=t;this.remove()},a.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t)&&(t.prev=null):n.next=t,e.lastChild===this?(e.lastChild=n)&&(n.next=null):t.prev=n,this.parent=this.next=this.prev=null),this},a.prototype.append=function(e){var t;return e.parent&&e.remove(),t=this.lastChild,this.lastChild=t?((t.next=e).prev=t,e):this.firstChild=e,e.parent=this,e},a.prototype.insert=function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,(e.next=t).prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,(e.prev=t).next=e),e.parent=r,e},a.prototype.getAll=function(e){var t,n=[];for(t=this.firstChild;t;t=$c(t,this))t.name===e&&n.push(t);return n},a.prototype.empty=function(){var e,t,n;if(this.firstChild){for(e=[],n=this.firstChild;n;n=$c(n,this))e.push(n);for(t=e.length;t--;)(n=e[t]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return this.firstChild=this.lastChild=null,this},a.prototype.isEmpty=function(e,t,n){var r,o,i=this.firstChild;if(t=t||{},i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(e[i.name])return!1;for(r=i.attributes.length;r--;)if("name"===(o=i.attributes[r].name)||0===o.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!Hc.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&Hc.test(i.value))return!1;if(n&&n(i))return!1}while(i=$c(i,this));return!0},a.prototype.walk=function(e){return $c(this,null,e)},a}(),Kc=function(e,t,n){var r,o,i,a,u=1;for(a=e.getShortEndedElements(),(i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r};function Xc(F,U){void 0===U&&(U=ni());var e=function(){};!1!==(F=F||{}).fix_self_closing&&(F.fix_self_closing=!0);var z=F.comment?F.comment:e,V=F.cdata?F.cdata:e,j=F.text?F.text:e,H=F.start?F.start:e,q=F.end?F.end:e,$=F.pi?F.pi:e,W=F.doctype?F.doctype:e;return{parse:function(e){var t,n,r,d,o,i,a,m,u,s,g,c,p,l,f,h,v,b,y,C,x,w,N,E,S,k,T,A,R,D=0,B=[],O=0,_=$o.decode,P=Yt.makeMap("src,href,data,background,formaction,poster,xlink:href"),I=/((java|vb)script|mhtml):/i,L=function(e){var t,n;for(t=B.length;t--&&B[t].name!==e;);if(0<=t){for(n=B.length-1;t<=n;n--)(e=B[n]).valid&&q(e.name);B.length=t}},M=function(e,t,n,r,o){var i,a,u,s,c;if(n=(t=t.toLowerCase())in g?t:_(n||r||o||""),p&&!m&&0==(0===(u=t).indexOf("data-")||0===u.indexOf("aria-"))){if(!(i=b[t])&&y){for(a=y.length;a--&&!(i=y[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(P[t]&&!F.allow_script_urls){var l=n.replace(/[\s\u0000-\u001F]+/g,"");try{l=decodeURIComponent(l)}catch(f){l=unescape(l)}if(I.test(l))return;if(c=l,!(s=F).allow_html_data_urls&&(/^data:image\//i.test(c)?!1===s.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(c):/^data:/i.test(c)))return}m&&(t in P||0===t.indexOf("on"))||(d.map[t]=n,d.push({name:t,value:n}))};for(S=new RegExp("<(?:(?:!--([\\w\\W]*?)--\x3e)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),k=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=U.getShortEndedElements(),E=F.self_closing_elements||U.getSelfClosingElements(),g=U.getBoolAttrs(),p=F.validate,u=F.remove_internals,R=F.fix_self_closing,T=U.getSpecialElements(),N=e+">";t=S.exec(N);){if(D<t.index&&j(_(e.substr(D,t.index-D))),n=t[6])":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),L(n);else if(n=t[7]){if(t.index+t[0].length>e.length){j(_(e.substr(t.index))),D=t.index+t[0].length;continue}if(":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),c=n in s,R&&E[n]&&0<B.length&&B[B.length-1].name===n&&L(n),!p||(l=U.getElementRule(n))){if(f=!0,p&&(b=l.attributes,y=l.attributePatterns),(v=t[8])?((m=-1!==v.indexOf("data-mce-type"))&&u&&(f=!1),(d=[]).map={},v.replace(k,M)):(d=[]).map={},p&&!m){if(C=l.attributesRequired,x=l.attributesDefault,w=l.attributesForced,l.removeEmptyAttrs&&!d.length&&(f=!1),w)for(o=w.length;o--;)a=(h=w[o]).name,"{$uid}"===(A=h.value)&&(A="mce_"+O++),d.map[a]=A,d.push({name:a,value:A});if(x)for(o=x.length;o--;)(a=(h=x[o]).name)in d.map||("{$uid}"===(A=h.value)&&(A="mce_"+O++),d.map[a]=A,d.push({name:a,value:A}));if(C){for(o=C.length;o--&&!(C[o]in d.map););-1===o&&(f=!1)}if(h=d.map["data-mce-bogus"]){if("all"===h){D=Kc(U,e,S.lastIndex),S.lastIndex=D;continue}f=!1}}f&&H(n,d,c)}else f=!1;if(r=T[n]){r.lastIndex=D=t.index+t[0].length,D=(t=r.exec(e))?(f&&(i=e.substr(D,t.index-D)),t.index+t[0].length):(i=e.substr(D),e.length),f&&(0<i.length&&j(i,!0),q(n)),S.lastIndex=D;continue}c||(v&&v.indexOf("/")===v.length-1?f&&q(n):B.push({name:n,valid:f}))}else(n=t[1])?(">"===n.charAt(0)&&(n=" "+n),F.allow_conditional_comments||"[if"!==n.substr(0,3).toLowerCase()||(n=" "+n),z(n)):(n=t[2])?V(n.replace(/<!--|-->/g,"")):(n=t[3])?W(n):(n=t[4])&&$(n,t[5]);D=t.index+t[0].length}for(D<e.length&&j(_(e.substr(D))),o=B.length-1;0<=o;o--)(n=B[o]).valid&&q(n.name)}}}(Xc||(Xc={})).findEndTag=Kc;var Yc=Xc,Gc=function(e,t){var n,r,o,i,a,u,s,c,l=t,f=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(u=e.getTempAttrs(),s=l,c=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),l=s.replace(c,""),a=d.getShortEndedElements();i=f.exec(l);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:Yc.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=r-o;return ga(l)},Jc={trimExternal:Gc,trimInternal:Gc},Qc=function(e,t,n){var r=e.getParam(t,n);if(-1===r.indexOf("="))return r;var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n},Zc=function(e){return e.getParam("iframe_attrs",{})},el=function(e){return e.getParam("doctype","<!DOCTYPE html>")},tl=function(e){return e.getParam("document_base_url","")},nl=function(e){return Qc(e,"body_id","tinymce")},rl=function(e){return Qc(e,"body_class","")},ol=function(e){return e.getParam("content_security_policy","")},il=function(e){return e.getParam("br_in_pre",!0)},al=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":!0===t?"p":t},ul=function(e){return e.getParam("forced_root_block_attrs",{})},sl=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},cl=function(e){return e.getParam("no_newline_selector","")},ll=function(e){return e.getParam("keep_styles",!0)},fl=function(e){return e.getParam("end_container_on_empty_block",!1)},dl=function(e){return Yt.explode(e.getParam("font_size_style_values",""))},ml=function(e){return Yt.explode(e.getParam("font_size_classes",""))},gl=function(e){return e.getParam("images_dataimg_filter",q(!0),"function")},pl=function(e){return e.getParam("automatic_uploads",!0,"boolean")},hl=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},vl=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},bl=function(e){return e.getParam("images_upload_url","","string")},yl=function(e){return e.getParam("images_upload_base_path","","string")},Cl=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},xl=function(e){return e.getParam("images_upload_handler",null,"function")},wl=function(e){return e.getParam("content_css_cors",!1,"boolean")},Nl=function(e){return e.getParam("language","en","string")},El=function(e){return e.getParam("language_url","","string")},Sl=function(e){return e.getParam("indent_use_margin",!1)},kl=function(e){return e.getParam("indentation","40px","string")},Tl=function(e){var t=e.settings.content_css;return R(t)?W(t.split(","),Kn):B(t)?t:!1===t?[]:["default"]},Al=function(e,t,n){var r,o,i,a,u;if(t.format=t.format?t.format:"html",t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)r=Yt.trim(Jc.trimExternal(e.serializer,n.innerHTML));else if("text"===t.format)r=ga(n.innerText||n.textContent);else{if("tree"===t.format)return e.serializer.serialize(n,t);i=(o=e).serializer.serialize(n,t),a=al(o),u=new RegExp("^(<"+a+"[^>]*>(&nbsp;|&#160;|\\s|\xa0|<br \\/>|)<\\/"+a+">[\r\n]*|<br \\/>[\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||Co(rr.fromDom(n))?t.content=r:t.content=Yt.trim(r),t.no_events||e.fire("GetContent",t),t.content},Rl=Yt.makeMap;function Dl(e){var u,s,c,l,f,d=[];return u=(e=e||{}).indent,s=Rl(e.indent_before||""),c=Rl(e.indent_after||""),l=$o.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n"),d.push("<",e),t)for(r=0,o=t.length;r<o;r++)i=t[r],d.push(" ",i.name,'="',l(i.value,!0),'"');d[d.length]=!n||f?">":" />",n&&u&&c[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n")},end:function(e){var t;d.push("</",e,">"),u&&c[e]&&0<d.length&&0<(t=d[d.length-1]).length&&"\n"!==t&&d.push("\n")},text:function(e,t){0<e.length&&(d[d.length]=t?e:l(e))},cdata:function(e){d.push("<![CDATA[",e,"]]>")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push("<?",e," ",l(t),"?>"):d.push("<?",e,"?>"),u&&d.push("\n")},doctype:function(e){d.push("<!DOCTYPE",e,">",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function Bl(t,g){void 0===g&&(g=ni());var p=Dl(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},p.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1<r.length&&((a=[]).map={},c=g.getElementRule(e.name))){for(u=0,s=c.attributesOrder.length;u<s;u++)(o=c.attributesOrder[u])in r.map&&(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));for(u=0,s=r.length;u<s;u++)(o=r[u].name)in a.map||(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));r=a}if(p.start(e.name,r,n),!n){if(e=e.firstChild)for(;m(e),e=e.next;);p.end(t)}}};return 1!==e.type||t.inner?f[11](e):m(e),p.getContent()}}}var Ol=function(e,t){t(e),e.firstChild&&Ol(e.firstChild,t),e.next&&Ol(e.next,t)},_l=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&Ol(t.firstChild,function(t){F(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),F(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);F(r,function(t){F(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Pl=function(e){var t=Lr(e).dom();return e.dom()===t.activeElement},Il=function(t){return(e=Lr(t),n=e!==undefined?e.dom():document,A.from(n.activeElement).map(rr.fromDom)).filter(function(e){return t.dom().contains(e.dom())});var e,n},Ll=function(a){if(!B(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return F(a,function(e,r){var t=fr(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!B(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=fr(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!J(u,function(e){return M(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+u.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:u,constructor:o,params:n})}}}}),n},Ml=(Ll([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Ll([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}])),Fl=Sr("start","soffset","finish","foffset"),Ul=(Ml.domRange,Ml.relative,Ml.exact,tr.detect().browser),zl=function(e,t){var n=lr(t)?Pc(t).length:jr(t).length+1;return n<e?n:e<0?0:e},Vl=function(e){return Fl(e.start(),zl(e.soffset(),e.start()),e.finish(),zl(e.foffset(),e.finish()))},jl=function(e,t){return Ir(e,t)||Pr(e,t)},Hl=function(t){return function(e){return jl(t,e.start())&&jl(t,e.finish())}},ql=function(e){return!0===e.inline||Ul.isIE()},$l=function(e){return Fl(rr.fromDom(e.startContainer),e.startOffset,rr.fromDom(e.endContainer),e.endOffset)},Wl=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?A.from(t.getRangeAt(0)):A.none()).map($l)},Kl=function(e){var t,n=(t=e.dom().ownerDocument.defaultView,rr.fromDom(t));return Wl(n.dom()).filter(Hl(e))},Xl=function(e,t){return A.from(t).filter(Hl(e)).map(Vl)},Yl=function(e){var t=document.createRange();try{return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),A.some(t)}catch(n){return A.none()}},Gl=function(e){return(e.bookmark?e.bookmark:A.none()).bind(d(Xl,rr.fromDom(e.getBody()))).bind(Yl)},Jl=function(e){var t=ql(e)?Kl(rr.fromDom(e.getBody())):A.none();e.bookmark=t.isSome()?t:e.bookmark},Ql=function(t){Gl(t).each(function(e){t.selection.setRng(e)})},Zl=Gl,ef=function(t,e){return(n=e,n.collapsed?A.from($a(n.startContainer,n.startOffset)).map(rr.fromDom):A.none()).bind(function(e){return bo(e)?A.some(e):!1===Ir(t,e)?A.some(t):A.none()});var n},tf=function(t,e){ef(rr.fromDom(t.getBody()),e).bind(function(e){return oc.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},nf=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},rf=function(e){var t,n=e.getBody();return n&&(t=rr.fromDom(n),Pl(t)||Il(t).isSome())},of=function(e){return e.inline?rf(e):(t=e).iframeElement&&Pl(rr.fromDom(t.iframeElement));var t},af=function(e){return e.editorManager.setActive(e)},uf=function(e,t){e.removed||(t?af(e):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable();var o,i,a=(o=t,i=e.getNode(),o.dom.getParent(i,function(e){return"true"===o.dom.getContentEditable(e)}));if(t.$.contains(n,a))return nf(a),tf(t,r),af(t);t.bookmark!==undefined&&!1===of(t)&&Zl(t).each(function(e){t.selection.setRng(e),r=e}),t.inline||(de.opera||nf(n),t.getWin().focus()),(de.gecko||t.inline)&&(nf(n),tf(t,r)),af(t)}(e))},sf=of,cf=function(e){return e instanceof Wc},lf=function(e,t){var r;e.dom.setHTML(e.getBody(),t),sf(r=e)&&oc.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=Bo.isTable(t)?oc.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},ff=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=cf(s)?"":s,cf(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),A.from(u.getBody()).fold(q(s),function(e){return cf(s)?function(e,t,n,r){_l(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=Bl({validate:e.validate},e.schema).serialize(n);return r.content=Co(rr.fromDom(t))?o:Yt.trim(o),lf(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='<br data-mce-bogus="1">',"TABLE"===n.nodeName?r="<tr><td>"+a+"</td></tr>":/^(UL|OL)$/.test(n.nodeName)&&(r="<li>"+a+"</li>"),(i=al(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='<br data-mce-bogus="1">'),lf(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=Bl({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=Co(rr.fromDom(n))?r:Yt.trim(r),lf(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},df=function(e,t){return e.fire("PreProcess",t)},mf=function(e,t){return e.fire("PostProcess",t)},gf=function(e){return e.fire("remove")},pf=function(e){return e.fire("detach")},hf=function(e,t){return e.fire("SwitchMode",{mode:t})},vf=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},bf=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},yf=pi.DOM,Cf=function(e){return A.from(e).each(function(e){return e.destroy()})},xf=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&yf.remove(o.nextSibling),!e.inline&&r&&(i=e,yf.setStyle(i.id,"display",i.orgDisplay)),gf(e),e.editorManager.remove(e),pf(e),yf.remove(e.getContainer()),Cf(t),Cf(n),e.destroy()}var i},wf=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Cf(i),Cf(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),yf.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed=!0):e.remove())},Nf=Sr("sections","settings"),Ef=tr.detect(),Sf=Ef.deviceType.isTouch(),kf=Ef.deviceType.isPhone(),Tf=["lists","autolink","autosave"],Af=kf?{theme:"mobile"}:{},Rf=function(e){var t=B(e)?e.join(" "):e,n=W(R(t)?t.split(" "):[],Kn);return U(n,function(e){return 0<e.length})},Df=function(n,e){var r,o,i,t=(r=function(e,t){return M(n,t)},o={},i={},mr(e,function(e,t){(r(e,t)?o:i)[t]=e}),{t:o,f:i});return Nf(t.t,t.f)},Bf=function(e,t,n,r){var o,i,a=Rf(n.forced_plugins),u=Rf(r.plugins),s=e&&(o="mobile",t.sections().hasOwnProperty(o))?U(u,d(M,Tf)):u,c=(i=s,[].concat(Rf(a)).concat(Rf(i)));return Yt.extend(r,{plugins:c.join(" ")})},Of=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m=Df(["mobile"],r),g=Yt.extend(t,n,m.settings(),(f=e,d=m.settings().inline,f&&!d?(u="mobile",s=Af,c=m.sections(),l=c.hasOwnProperty(u)?c[u]:{},Yt.extend({},s,l)):{}),{validate:!0,external_plugins:(o=n,i=m.settings(),a=i.external_plugins?i.external_plugins:{},o&&o.external_plugins?Yt.extend({},o.external_plugins,a):a)});return Bf(e,m,n,g)},_f=function(e,t,n){return A.from(t.settings[n]).filter(e)},Pf=d(_f,R),If=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?F(0<i.indexOf("=")?i.split(/[;,](?![^=;,]*(?:[;,]|$))/):i.split(","),function(e){var t=e.split("=");1<t.length?a[Yt.trim(t[0])]=Yt.trim(t[1]):a[Yt.trim(t[0])]=Yt.trim(t)}):a=i,a):"string"===r?_f(R,e,t).getOr(n):"number"===r?_f(I,e,t).getOr(n):"boolean"===r?_f(_,e,t).getOr(n):"object"===r?_f(D,e,t).getOr(n):"array"===r?_f(B,e,t).getOr(n):"string[]"===r?_f((o=R,function(e){return B(e)&&J(e,o)}),e,t).getOr(n):"function"===r?_f(P,e,t).getOr(n):u},Lf=function(e,t){return t.dom()[e]},Mf=function(e,t){return parseInt(wr(t,e),10)},Ff=d(Lf,"clientWidth"),Uf=d(Lf,"clientHeight"),zf=d(Mf,"margin-top"),Vf=d(Mf,"margin-left"),jf=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g=rr.fromDom(e.getBody()),p=e.inline?g:(r=g,rr.fromDom(r.dom().ownerDocument.documentElement)),h=(o=e.inline,a=t,u=n,s=(i=p).dom().getBoundingClientRect(),{x:a-(o?s.left+i.dom().clientLeft+Vf(i):0),y:u-(o?s.top+i.dom().clientTop+zf(i):0)});return l=h.x,f=h.y,d=Ff(c=p),m=Uf(c),0<=l&&0<=f&&l<=d&&f<=m},Hf=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,A.from(t).map(rr.fromDom)).map(function(e){return Ir(Lr(e),e)}).getOr(!1)};function qf(n){var t,o=[],i=function(){var e=n.theme;return e&&e.getNotificationManagerImpl?e.getNotificationManagerImpl():function t(){var e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:e,close:e,reposition:e,getArgs:e}}()},a=function(){0<o.length&&i().reposition(o)},u=function(t){j(o,function(e){return e===t}).each(function(e){o.splice(e,1)})},r=function(r){if(!n.removed&&Hf(n))return V(o,function(e){return t=i().getArgs(e),n=r,!(t.type!==n.type||t.text!==n.text||t.progressBar||t.timeout||n.progressBar||n.timeout);var t,n}).getOrThunk(function(){n.editorManager.setActive(n);var e,t=i().open(r,function(){u(t),a()});return e=t,o.push(e),a(),t})};return(t=n).on("SkinLoaded",function(){var e=t.settings.service_message;e&&r({text:e,type:"warning",timeout:0})}),t.on("ResizeEditor ResizeWindow NodeChange",function(){ve.requestAnimationFrame(a)}),t.on("remove",function(){F(o.slice(),function(e){i().close(e)})}),{open:r,close:function(){A.from(o[0]).each(function(e){i().close(e),u(e),a()})},getNotifications:function(){return o}}}function $f(r){var n=[],o=function(){var e=r.theme;return e&&e.getWindowManagerImpl?e.getWindowManagerImpl():function t(){var e=function(){throw new Error("Theme did not provide a WindowManager implementation.")};return{open:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}}()},i=function(e,t){return function(){return t?t.apply(e,arguments):undefined}},a=function(e){var t;n.push(e),t=e,r.fire("OpenWindow",{dialog:t})},u=function(t){var e;e=t,r.fire("CloseWindow",{dialog:e}),0===(n=U(n,function(e){return e!==t})).length&&r.focus()};return r.on("remove",function(){F(n,function(e){o().close(e)})}),{open:function(e,t){r.editorManager.setActive(r),Jl(r);var n=o().open(e,t,u);return a(n),n},alert:function(e,t,n){o().alert(e,i(n||this,t))},confirm:function(e,t,n){o().confirm(e,i(n||this,t))},close:function(){A.from(n[n.length-1]).each(function(e){o().close(e),u(e)})}}}var Wf,Kf=Ti.PluginManager,Xf=function(e,t){var n=function(e,t){for(var n in Kf.urls)if(Kf.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?"Failed to load plugin: "+n+" from url "+t:"Failed to load plugin url: "+t},Yf=function(e,t){e.notificationManager.open({type:"error",text:t})},Gf=function(e,t){e._skinLoaded?Yf(e,t):e.on("SkinLoaded",function(){Yf(e,t)})},Jf=function(e,t){Gf(e,Xf(e,t))},Qf=function(e,t){Gf(e,"Failed to upload image: "+t)},Zf=Gf,ed=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,arguments):r.log.apply(r,arguments))},td=(Wf={},{add:function(e,t){Wf[e]=t},get:function(e){return Wf[e]?Wf[e]:{icons:{}}}}),nd=Ti.PluginManager,rd=Ti.ThemeManager;function od(){return new(ie.getOrDie("XMLHttpRequest"))}function id(u,s){var r={},n=function(e,r,o,t){var i,n;(i=od()).open("POST",s.url),i.withCredentials=s.credentials,i.upload.onprogress=function(e){t(e.loaded/e.total*100)},i.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,t,n;i.status<200||300<=i.status?o("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?r((t=s.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):o("Invalid JSON: "+i.responseText)},(n=new FormData).append("file",e.blob(),e.filename()),i.send(n)},c=function(e,t){return{url:t,blobInfo:e,status:!0}},l=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},f=function(e,t){Yt.each(r[e],function(e){e(t)}),delete r[e]},o=function(e,n){return e=Yt.grep(e,function(e){return!u.isUploaded(e.blobUri())}),me.all(Yt.map(e,function(e){return u.isPending(e.blobUri())?(t=e.blobUri(),new me(function(e){r[t]=r[t]||[],r[t].push(e)})):(o=e,i=s.handler,a=n,u.markPending(o.blobUri()),new me(function(t){var n;try{var r=function(){n&&n.close()};i(o,function(e){r(),u.markUploaded(o.blobUri(),e),f(o.blobUri(),c(o,e)),t(c(o,e))},function(e){r(),u.removeFailed(o.blobUri()),f(o.blobUri(),l(o,e)),t(l(o,e))},function(e){e<0||100<e||(n||(n=a()),n.progressBar.value(e))})}catch(e){t(l(o,e.message))}}));var o,i,a,t}))};return!1===P(s.handler)&&(s.handler=n),{upload:function(e,t){return s.url||s.handler!==n?o(e,t):new me(function(e){e([])})}}}var ad=function(e){return ie.getOrDie("atob")(e)},ud=function(e){var t,n,r=decodeURIComponent(e).split(",");return(n=/data:([^;]+)/.exec(r[0]))&&(t=n[1]),{type:t,data:r[1]}},sd=function(a){return new me(function(e){var t,n,r,o=ud(a);try{t=ad(o.data)}catch(jN){return void e(new Blob([]))}for(n=function i(e){return new(ie.getOrDie("Uint8Array"))(e)}(t.length),r=0;r<n.length;r++)n[r]=t.charCodeAt(r);e(new Blob([n],{type:o.type}))})},cd=function(e){return 0===e.indexOf("blob:")?(i=e,new me(function(e,t){var n=function(){t("Cannot convert "+i+" to Blob. Resource might not exist or is inaccessible.")};try{var r=od();r.open("GET",i,!0),r.responseType="blob",r.onload=function(){200===this.status?e(this.response):n()},r.onerror=n,r.send()}catch(o){n()}})):0===e.indexOf("data:")?sd(e):null;var i},ld=function(r){return new me(function(e){var t=function n(){return new(ie.getOrDie("FileReader"))}();t.onloadend=function(){e(t.result)},t.readAsDataURL(r)})},fd=ud,dd=0,md=function(e){return(e||"blobid")+dd++},gd=function(n,r,o,t){var i,a;0!==r.src.indexOf("blob:")?(i=fd(r.src).data,(a=n.findFirst(function(e){return e.base64()===i}))?o({image:r,blobInfo:a}):cd(r.src).then(function(e){a=n.create(md(),e,i),n.add(a),o({image:r,blobInfo:a})},function(e){t(e)})):(a=n.getByUri(r.src))?o({image:r,blobInfo:a}):cd(r.src).then(function(t){ld(t).then(function(e){i=fd(e).data,a=n.create(md(),t,i),n.add(a),o({image:r,blobInfo:a})})},function(e){t(e)})},pd=function(e){return e?ne(e.getElementsByTagName("img")):[]},hd=0,vd={uuid:function(e){return e+hd+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t}};function bd(o){var t,n,i=function v(){var n=[],o=function(e){var t,n,r;if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");return t=e.id||vd.uuid("blobid"),n=e.name||t,{id:q(t),name:q(n),filename:q(n+"."+(r=e.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[r.toLowerCase()]||"dat")),blob:q(e.blob),base64:q(e.base64),blobUri:q(e.blobUri||ue.createObjectURL(e.blob)),uri:q(e.uri)}},t=function(t){return e(function(e){return e.id()===t})},e=function(e){return U(n,e)[0]};return{create:function(e,t,n,r){if(R(e))return o({id:e,name:r,blob:t,base64:n});if(D(e))return o(e);throw new Error("Unknown input type")},add:function(e){t(e.id())||n.push(e)},get:t,getByUri:function(t){return e(function(e){return e.blobUri()===t})},findFirst:e,removeByUri:function(t){n=U(n,function(e){return e.blobUri()!==t||(ue.revokeObjectURL(e.blobUri()),!1)})},destroy:function(){F(n,function(e){ue.revokeObjectURL(e.blobUri())}),n=[]}}}(),a=function b(){var n={},r=function(e,t){return{status:e,resultUri:t}},t=function(e){return e in n};return{hasBlobUri:t,getResultUri:function(e){var t=n[e];return t?t.resultUri:null},isPending:function(e){return!!t(e)&&1===n[e].status},isUploaded:function(e){return!!t(e)&&2===n[e].status},markPending:function(e){n[e]=r(1,null)},markUploaded:function(e,t){n[e]=r(2,t)},removeFailed:function(e){delete n[e]},destroy:function(){n={}}}}(),r=[],u=function(t){return function(e){return o.selection?t(e):[]}},s=function(e,t,n){for(var r=0;-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1),-1!==r;);return e},c=function(e,t,n){return e=s(e,'src="'+t+'"','src="'+n+'"'),e=s(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},l=function(t,n){F(o.undoManager.data,function(e){"fragmented"===e.type?e.fragments=W(e.fragments,function(e){return c(e,t,n)}):e.content=c(e.content,t,n)})},f=function(){return o.notificationManager.open({text:o.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},d=function(e,t){i.removeByUri(e.src),l(e.src,t),o.$(e).attr({src:hl(o)?t+"?"+(new Date).getTime():t,"data-mce-src":o.convertURL(t,"src")})},m=function(n){return t||(t=id(a,{url:bl(o),basePath:yl(o),credentials:Cl(o),handler:xl(o)})),p().then(u(function(r){var e;return e=W(r,function(e){return e.blobInfo}),t.upload(e,f).then(u(function(e){var t=W(e,function(e,t){var n=r[t].image;return e.status&&vl(o)?d(n,e.url):e.error&&Qf(o,e.error),{element:n,status:e.status}});return n&&n(t),t}))}))},e=function(e){if(pl(o))return m(e)},g=function(t){return!1!==J(r,function(e){return e(t)})&&(0!==t.getAttribute("src").indexOf("data:")||gl(o)(t))},p=function(){return n||(n=function e(o,i){var a={};return{findAll:function(e,n){var t;n||(n=q(!0)),t=U(pd(e),function(e){var t=e.src;return!!de.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!t||t===de.transparentSrc)&&(0===t.indexOf("blob:")?!o.isUploaded(t)&&n(e):0===t.indexOf("data:")&&n(e))});var r=W(t,function(n){if(a[n.src])return new me(function(t){a[n.src].then(function(e){if("string"==typeof e)return e;t({image:n,blobInfo:e.blobInfo})})});var e=new me(function(e,t){gd(i,n,e,t)}).then(function(e){return delete a[e.image.src],e})["catch"](function(e){return delete a[n.src],e});return a[n.src]=e});return me.all(r)}}}(a,i)),n.findAll(o.getBody(),g).then(u(function(e){return e=U(e,function(e){return"string"!=typeof e||(Zf(o,e),!1)}),F(e,function(e){l(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))},h=function(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var t=a.getResultUri(n);if(t)return'src="'+t+'"';var r=i.getByUri(n);return r||(r=z(o.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null)),r?'src="data:'+r.blob().type+";base64,"+r.base64()+'"':e})};return o.on("setContent",function(){pl(o)?e():p()}),o.on("RawSaveContent",function(e){e.content=h(e.content)}),o.on("getContent",function(e){e.source_view||"raw"===e.format||(e.content=h(e.content))}),o.on("PostRender",function(){o.parser.addNodeFilter("img",function(e){F(e,function(e){var t=e.attr("src");if(!i.getByUri(t)){var n=a.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:i,addFilter:function(e){r.push(e)},uploadImages:m,uploadImagesAuto:e,scanForImages:p,destroy:function(){i.destroy(),a.destroy(),n=t=null}}}var yd=function(e,t,n){return Ir(t,e)?function(e,t){for(var n=P(t)?t:q(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=rr.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Pr(e,t)}).slice(0,-1):[]},Cd=function(e,t){return yd(e,t,q(!1))},xd=Cd,wd=function(e,t){return[e].concat(Cd(e,t))},Nd=function(e,t){return e.hasOwnProperty(t.nodeName)},Ed=function(t,e,n){return r=xd(rr.fromDom(n),rr.fromDom(e)),j(r,function(e){return Nd(t,e.dom())}).isSome();var r},Sd=function(e,t){if(Bo.isText(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||Nd(e,t.nextSibling)))return!0}return!1},kd=function(e){var t,n,r,o,i,a,u,s,c,l,f=e.dom,d=e.selection,m=e.schema,g=m.getBlockElements(),p=d.getStart(),h=e.getBody(),v=al(e);if(p&&Bo.isElement(p)&&v&&(l=h.nodeName.toLowerCase(),m.isValidChild(l,v.toLowerCase())&&!Ed(g,h,p))){for(n=(t=d.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=sf(e),p=h.firstChild;p;)if(b=g,y=p,Bo.isText(y)||Bo.isElement(y)&&!Nd(b,y)&&!gc(y)){if(Sd(g,p)){p=(u=p).nextSibling,f.remove(u);continue}a||(a=f.create(v,e.settings.forced_root_block_attrs),p.parentNode.insertBefore(a,p),s=!0),p=(u=p).nextSibling,a.appendChild(u)}else a=null,p=p.nextSibling;var b,y;s&&c&&(t.setStart(n,r),t.setEnd(o,i),d.setRng(t),e.nodeChanged())}},Td=function(e){al(e)&&e.on("NodeChange",d(kd,e))},Ad=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},Rd=function(t){return qr(t).fold(q([t]),function(e){return[t].concat(Rd(e))})},Dd=function(t){return $r(t).fold(q([t]),function(e){return"br"===ur(e)?Fr(e).map(function(e){return[t].concat(Dd(e))}).getOr([]):[t].concat(Dd(e))})},Bd=function(o,e){return Xa([(i=e,a=i.startContainer,u=i.startOffset,Bo.isText(a)?0===u?A.some(rr.fromDom(a)):A.none():A.from(a.childNodes[u]).map(rr.fromDom)),(t=e,n=t.endContainer,r=t.endOffset,Bo.isText(n)?r===n.data.length?A.some(rr.fromDom(n)):A.none():A.from(n.childNodes[r-1]).map(rr.fromDom))],function(e,t){var n=V(Rd(o),d(Pr,e)),r=V(Dd(o),d(Pr,t));return n.isSome()&&r.isSome()}).getOr(!1);var t,n,r,i,a,u},Od=function(e,t,n,r){var o=n,i=new oo(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==Yt.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(de.ie&&de.ie<11&&e.isBlock(n)&&e.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},_d=function(e){var t=e.selection.getSel();return t&&0<t.rangeCount};function Pd(i){var r,o=[];"onselectionchange"in i.getDoc()||i.on("NodeChange Click MouseUp KeyUp Focus",function(e){var t,n;n={startContainer:(t=i.selection.getRng()).startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset},"nodechange"!==e.type&&Ad(n,r)||i.fire("SelectionChange"),r=n}),i.on("contextmenu",function(){i.fire("SelectionChange")}),i.on("SelectionChange",function(){var e=i.selection.getStart(!0);!e||!de.range&&i.selection.isCollapsed()||_d(i)&&!function(e){var t,n;if((n=i.$(e).parentsUntil(i.getBody()).add(e)).length===o.length){for(t=n.length;0<=t&&n[t]===o[t];t--);if(-1===t)return o=n,!0}return o=n,!1}(e)&&i.dom.isChildOf(e,i.getBody())&&i.nodeChanged({selectionChange:!0})}),i.on("MouseUp",function(e){!e.isDefaultPrevented()&&_d(i)&&("IMG"===i.selection.getNode().nodeName?ve.setEditorTimeout(i,function(){i.nodeChanged()}):i.nodeChanged())}),this.nodeChanged=function(e){var t,n,r,o=i.selection;i.initialized&&o&&!i.settings.disable_nodechange&&!i.readonly&&(r=i.getBody(),(t=o.getStart(!0)||r).ownerDocument===i.getDoc()&&i.dom.isChildOf(t,r)||(t=r),n=[],i.dom.getParent(t,function(e){if(e===r)return!0;n.push(e)}),(e=e||{}).element=t,e.parents=n,i.fire("NodeChange",e))}}var Id,Ld,Md=function(e){var t,n,r,o;return o=e.getBoundingClientRect(),n=(t=e.ownerDocument).documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},Fd=function(e,t){return n=(u=e).inline?Md(u.getBody()):{left:0,top:0},a=(i=e).getBody(),r=i.inline?{left:a.scrollLeft,top:a.scrollTop}:{left:0,top:0},{pageX:(o=function(e,t){if(t.target.ownerDocument===e.getDoc())return{left:t.pageX,top:t.pageY};var n,r,o,i,a,u=Md(e.getContentAreaContainer()),s=(r=(n=e).getBody(),o=n.getDoc().documentElement,i={left:r.scrollLeft,top:r.scrollTop},a={left:r.scrollLeft||o.scrollLeft,top:r.scrollTop||o.scrollTop},n.inline?i:a);return{left:t.pageX-u.left+s.left,top:t.pageY-u.top+s.top}}(e,t)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o,i,a,u},Ud=Bo.isContentEditableFalse,zd=Bo.isContentEditableTrue,Vd=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},jd=function(u,s){return function(e){if(0===e.button){var t=V(s.dom.getParents(e.target),Ja(Ud,zd)).getOr(null);if(i=s.getBody(),Ud(a=t)&&a!==i){var n=s.dom.getPos(t),r=s.getBody(),o=s.getDoc().documentElement;u.element=t,u.screenX=e.screenX,u.screenY=e.screenY,u.maxX=(s.inline?r.scrollWidth:o.offsetWidth)-2,u.maxY=(s.inline?r.scrollHeight:o.offsetHeight)-2,u.relX=e.pageX-n.x,u.relY=e.pageY-n.y,u.width=t.offsetWidth,u.height=t.offsetHeight,u.ghost=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(s,t,u.width,u.height)}}var i,a}},Hd=function(l,f){return function(e){if(l.dragging&&(s=(i=f).selection,c=s.getSel().getRangeAt(0).startContainer,a=3===c.nodeType?c.parentNode:c,u=l.element,a!==u&&!i.dom.isChildOf(a,u)&&!Ud(a))){var t=(r=l.element,(o=r.cloneNode(!0)).removeAttribute("data-mce-selected"),o),n=f.fire("drop",{targetClone:t,clientX:e.clientX,clientY:e.clientY});n.isDefaultPrevented()||(t=n.targetClone,f.undoManager.transact(function(){Vd(l.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,c;qd(l)}},qd=function(e){e.dragging=!1,e.element=null,Vd(e.ghost)},$d=function(e){var t,n,r,o,i,a,p,h,v,u,s,c={};t=pi.DOM,a=document,n=jd(c,e),p=c,h=e,v=ve.throttle(function(e,t){h._selectionOverrides.hideFakeCaret(),h.selection.placeCaretAt(e,t)},0),r=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m=Math.max(Math.abs(e.screenX-p.screenX),Math.abs(e.screenY-p.screenY));if(p.element&&!p.dragging&&10<m){if(h.fire("dragstart",{target:p.element}).isDefaultPrevented())return;p.dragging=!0,h.focus()}if(p.dragging){var g=(f=p,{pageX:(d=Fd(h,e)).pageX-f.relX,pageY:d.pageY+5});c=p.ghost,l=h.getBody(),c.parentNode!==l&&l.appendChild(c),t=p.ghost,n=g,r=p.width,o=p.height,i=p.maxX,a=p.maxY,s=u=0,t.style.left=n.pageX+"px",t.style.top=n.pageY+"px",n.pageX+r>i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=Hd(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),qd(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},Wd=function(e){var n;$d(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(Ud(t)||Ud(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},Kd=function(e){return z(e,function(e,t){return e.concat(function(t){var e=function(e){return W(e,function(e){return(e=Ua(e)).node=t,e})};if(Bo.isElement(t))return e(t.getClientRects());if(Bo.isText(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}}(t))},[])};(Ld=Id||(Id={}))[Ld.Up=-1]="Up",Ld[Ld.Down=1]="Down";var Xd=function(o,i,a,e,u,t){var n,s,c=0,l=[],r=function(e){var t,n,r;for(r=Kd([e]),-1===o&&(r=r.reverse()),t=0;t<r.length;t++)if(n=r[t],!a(n,s)){if(0<l.length&&i(n,qt.last(l))&&c++,n.line=c,u(n))return!0;l.push(n)}};return(s=qt.last(t.getClientRects()))&&(r(n=t.getNode()),function(e,t,n,r){for(;r=bs(r,e,Ma,t);)if(n(r))return}(o,e,r,n)),l},Yd=d(Xd,Id.Up,ja,Ha),Gd=d(Xd,Id.Down,Ha,ja),Jd=function(n){return function(e){return t=n,e.line>t;var t}},Qd=function(n){return function(e){return t=n,e.line===t;var t}},Zd=Bo.isContentEditableFalse,em=bs,tm=function(e,t){return Math.abs(e.left-t)},nm=function(e,t){return Math.abs(e.right-t)},rm=function(e,t){return e>=t.left&&e<=t.right},om=function(e,o){return qt.reduce(e,function(e,t){var n,r;return n=Math.min(tm(e,o),nm(e,o)),r=Math.min(tm(t,o),nm(t,o)),rm(o,t)?t:rm(o,e)?e:r===n&&Zd(t.node)?t:r<n?t:e})},im=function(e,t,n,r){for(;r=em(r,e,Ma,t);)if(n(r))return},am=function(e,t,n){var r,o,i,a,u,s,c,l=Kd(U(ne(e.getElementsByTagName("*")),is)),f=U(l,function(e){return n>=e.top&&n<=e.bottom});return(r=om(f,t))&&(r=om((a=e,c=function(t,e){var n;return n=U(Kd([e]),function(e){return!t(e,u)}),s=s.concat(n),0===n.length},(s=[]).push(u=r),im(Id.Up,a,d(c,ja),u.node),im(Id.Down,a,d(c,Ha),u.node),s),t))&&is(r.node)?(i=t,{node:(o=r).node,before:tm(o,i)<nm(o,i)}):null},um=function(i,a,e){return!e.collapsed&&z(e.getClientRects(),function(e,t){return e||(o=a,(r=i)>=(n=t).left&&r<=n.right&&o>=n.top&&o<=n.bottom);var n,r,o},!1)},sm=Bo.isContentEditableTrue,cm=Bo.isContentEditableFalse,lm=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},fm=function(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:((r=(n=t).ownerDocument.createRange()).selectNode(n),r)},dm=function(e,t,n){var r=ks(1,e.getBody(),t),o=Cu.fromRangeStart(r),i=o.getNode();if(cm(i))return lm(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(cm(a))return lm(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return cm(e)||sm(e)});return cm(u)?lm(1,e,u,!1,n):null},mm=function(e,t,n){if(!t||!t.collapsed)return t;var r=dm(e,t,n);return r||t},gm=function(t){var e=Li(function(){if(!t.removed&&t.getBody().contains(document.activeElement)&&t.selection.getRng().collapsed){var e=mm(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},pm={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return de.mac?e.metaKey:e.ctrlKey&&!e.altKey}},hm=Bo.isContentEditableTrue,vm=Bo.isContentEditableFalse,bm=Os,ym=Bs,Cm=function(e,t){for(var n=e.getBody();t&&t!==n;){if(hm(t)||vm(t))return t;t=t.parentNode}return null},xm=function(g){var p,a=g.getBody(),o=rs(g.getBody(),function(e){return g.dom.isBlock(e)},function(){return sf(g)}),h="sel-"+g.dom.uniqueId(),u=function(e){e&&g.selection.setRng(e)},s=function(){return g.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},b=function(e,t){return t=ks(e,a,t),-1===e?Cu.fromRangeStart(t):Cu.fromRangeEnd(t)},t=function(e){return ya(e)||Ea(e)||Sa(e)},y=function(e){return t(e.startContainer)||t(e.endContainer)},c=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!y(e))if(!1===t){if(c=b(-1,e),is(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(is(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=b(1,e),is(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(is(c.getNode(!0)))return v(1,c.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&vm(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&(n=i.childNodes[a]),vm(n)?(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=Ji(rr.fromDom(g.getBody()),"#"+h).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",h)).appendTo(g.getBody()),e=g.dom.createRng(),l===f&&de.ie?(r.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append("\xa0").append(l).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e),F($i(rr.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){xr(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),p=n,C(),e)):null)},l=function(){p&&(p.removeAttribute("data-mce-selected"),Ji(rr.fromDom(g.getBody()),"#"+h).each(Pi),p=null),Ji(rr.fromDom(g.getBody()),"#"+h).each(Pi),p=null},C=function(){o.hide()};return de.ceFalse&&function(){g.on("mouseup",function(e){var t=s();t.collapsed&&jf(g,e.clientX,e.clientY)&&u(dm(g,t,!1))}),g.on("click",function(e){var t;(t=Cm(g,e.target))&&(vm(t)&&(e.preventDefault(),g.focus()),hm(t)&&g.dom.isChildOf(t,g.selection.getNode())&&l())}),g.on("blur NewBlock",function(){l()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==vm(Cm(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Ys(e);if(!e.firstChild)return!1;var n=Cu.before(e.firstChild),r=t.next(n);return r&&!ym(r)&&!bm(r)}(o)};r=!1,(n=g).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=Cm(n,e.target);vm(t)&&(r||(e.preventDefault(),c(fm(n,t))))}),g.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||g.dom.isChildOf(n,a))&&!1!==jf(g,e.clientX,e.clientY))if(t=Cm(g,n))vm(t)?(e.preventDefault(),c(fm(g,t))):(l(),hm(t)&&e.shiftKey||um(e.clientX,e.clientY,g.selection.getRng())||(C(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===is(n)){l(),C();var r=am(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);g.getBody().focus(),u(o)}}}),g.on("keypress",function(e){pm.modifierPressed(e)||(e.keyCode,vm(g.selection.getNode())&&e.preventDefault())}),g.on("getSelectionRange",function(e){var t=e.range;if(p){if(!p.parentNode)return void(p=null);(t=t.cloneRange()).selectNode(p),e.range=t}}),g.on("setSelectionRange",function(e){var t;(t=c(e.range,e.forward))&&(e.range=t)}),g.on("AfterSetSelectionRange",function(e){var t,n=e.range;y(n)||"mcepastebin"===n.startContainer.parentNode.id||C(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||l()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!de.ie){var r=(t=g.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),Wd(g),gm(g)}(),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(ka(e),u(s()),g.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),p=null}}},wm=0,Nm=2,Em=1,Sm=function(g,p){var e=g.length+p.length+2,h=new Array(e),v=new Array(e),c=function(e,t,n,r,o){var i=l(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var a=e,u=n;a<t||u<r;)a<t&&u<r&&g[a]===p[u]?(o.push([0,g[a]]),++a,++u):r-n<t-e?(o.push([2,g[a]]),++a):(o.push([1,p[u]]),++u);else{c(e,i.start,n,i.start-i.diag,o);for(var s=i.start;s<i.end;++s)o.push([0,g[s]]);c(i.end,t,i.end-i.diag,r,o)}},b=function(e,t,n,r){for(var o=e;o-t<r&&o<n&&g[o]===p[o-t];)++o;return{start:e,end:o,diag:t}},l=function(e,t,n,r){var o=t-e,i=r-n;if(0===o||0===i)return null;var a,u,s,c,l,f=o-i,d=i+o,m=(d%2==0?d:d+1)/2;for(h[1+m]=e,v[1+m]=t+1,a=0;a<=m;++a){for(u=-a;u<=a;u+=2){for(s=u+m,u===-a||u!==a&&h[s-1]<h[s+1]?h[s]=h[s+1]:h[s]=h[s-1]+1,l=(c=h[s])-e+n-u;c<t&&l<r&&g[c]===p[l];)h[s]=++c,++l;if(f%2!=0&&f-a<=u&&u<=f+a&&v[s-f]<=h[s])return b(v[s-f],u+e-n,t,r)}for(u=f-a;u<=f+a;u+=2){for(s=u+m-f,u===f-a||u!==f+a&&v[s+1]<=v[s-1]?v[s]=v[s+1]-1:v[s]=v[s-1],l=(c=v[s]-1)-e+n-u;e<=c&&n<=l&&g[c]===p[l];)v[s]=c--,l--;if(f%2==0&&-a<=u&&u<=a&&v[s]<=h[s+f])return b(v[s],u+e-n,t,r)}}},t=[];return c(0,g.length,0,p.length,t),t},km=function(e){return Bo.isElement(e)?e.outerHTML:Bo.isText(e)?$o.encodeRaw(e.data,!1):Bo.isComment(e)?"\x3c!--"+e.data+"--\x3e":""},Tm=function(e,t,n){var r=function(e){var t,n,r;for(r=document.createElement("div"),t=document.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o)}else e.appendChild(r)},Am=function(e){return U(W(ne(e.childNodes),km),function(e){return 0<e.length})},Rm=function(e,t){var n,r,o,i=W(ne(t.childNodes),km);return n=Sm(i,e),r=t,o=0,F(n,function(e){e[0]===wm?o++:e[0]===Em?(Tm(r,e[1],o),o++):e[0]===Nm&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(r,o)}),t},Dm=wi(A.none()),Bm=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},Om=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},_m=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},Pm=function(e){var t=rr.fromTag("body",Dm.get().getOrThunk(function(){var e=document.implementation.createHTMLDocument("undo");return Dm.set(A.some(e)),e}));return la(t,_m(e)),F($i(t,"*[data-mce-bogus]"),Ii),t.dom().innerHTML},Im=function(n){var e,t,r;return e=Am(n.getBody()),-1!==(t=(r=G(e,function(e){var t=Jc.trimInternal(n.serializer,e);return 0<t.length?[t]:[]})).join("")).indexOf("</iframe>")?Bm(r):Om(t)},Lm=function(e,t,n){"fragmented"===t.type?Rm(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},Mm=function(e,t){return!(!e||!t)&&(r=t,_m(e)===_m(r)||(n=t,Pm(e)===Pm(n)));var n,r};function Fm(u){var s,r,o=this,c=0,l=[],t=0,f=function(){return 0===t},i=function(e){f()&&(o.typing=e)},d=function(e){u.setDirty(e)},a=function(e){i(!1),o.add({},e)},n=function(){o.typing&&(i(!1),o.add())};return u.on("init",function(){o.add()}),u.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(n(),o.beforeChange())}),u.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&a(e)}),u.on("ObjectResizeStart Cut",function(){o.beforeChange()}),u.on("SaveContent ObjectResized blur",a),u.on("DragEnd",a),u.on("KeyUp",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),u.nodeChanged()),46!==t&&8!==t||u.nodeChanged(),r&&o.typing&&!1===Mm(Im(u),l[0])&&(!1===u.isDirty()&&(d(!0),u.fire("change",{level:l[0],lastLevel:null})),u.fire("TypingUndo"),r=!1,u.nodeChanged()))}),u.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)o.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20<t)||224===t||91===t||o.typing||n||(o.beforeChange(),i(!0),o.add({},e),r=!0)}}),u.on("MouseDown",function(e){o.typing&&a(e)}),u.on("input",function(e){var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data)&&a(e)}),u.addShortcut("meta+z","","Undo"),u.addShortcut("meta+y,meta+shift+z","","Redo"),u.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||u.nodeChanged()}),o={data:l,typing:!1,beforeChange:function(){f()&&(s=zu.getUndoBookmark(u.selection))},add:function(e,t){var n,r,o,i=u.settings;if(o=Im(u),e=e||{},e=Yt.extend(e,o),!1===f()||u.removed)return null;if(r=l[c],u.fire("BeforeAddUndo",{level:e,lastLevel:r,originalEvent:t}).isDefaultPrevented())return null;if(r&&Mm(r,e))return null;if(l[c]&&(l[c].beforeBookmark=s),i.custom_undo_redo_levels&&l.length>i.custom_undo_redo_levels){for(n=0;n<l.length-1;n++)l[n]=l[n+1];l.length--,c=l.length}e.bookmark=zu.getUndoBookmark(u.selection),c<l.length-1&&(l.length=c+1),l.push(e),c=l.length-1;var a={level:e,lastLevel:r,originalEvent:t};return u.fire("AddUndo",a),0<c&&(d(!0),u.fire("change",a)),e},undo:function(){var e;return o.typing&&(o.add(),o.typing=!1,i(!1)),0<c&&(e=l[--c],Lm(u,e,!0),d(!0),u.fire("undo",{level:e})),e},redo:function(){var e;return c<l.length-1&&(e=l[++c],Lm(u,e,!1),d(!0),u.fire("redo",{level:e})),e},clear:function(){l=[],c=0,o.typing=!1,o.data=l,u.fire("ClearUndos")},hasUndo:function(){return 0<c||o.typing&&l[0]&&!Mm(Im(u),l[0])},hasRedo:function(){return c<l.length-1&&!o.typing},transact:function(e){return n(),o.beforeChange(),o.ignore(e),o.add()},ignore:function(e){try{t++,e()}finally{t--}},extra:function(e,t){var n,r;o.transact(e)&&(r=l[c].bookmark,n=l[c-1],Lm(u,n,!0),o.transact(t)&&(l[c-1].beforeBookmark=r))}}}var Um,zm,Vm=function(e){var t=$i(e,"br"),n=U(function(e){for(var t=[],n=e.dom();n;)t.push(rr.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),mo);t.length===n.length&&F(n,Pi)},jm=function(e){_i(e),Bi(e,rr.fromHtml('<br data-mce-bogus="1">'))},Hm=function(n){$r(n).each(function(t){Fr(t).each(function(e){lo(n)&&mo(t)&&lo(e)&&Pi(t)})})},qm=bc.isEq,$m=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&e.dom.is(t,r[o].selector))return!0;return!1},Wm=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,function(e){return!!$m(t,e,n)||e.parentNode===o||!!Ym(t,e,n,r,!0)}),Ym(t,e,n,r))},Km=function(e,t,n){return!!qm(t,n.inline)||!!qm(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)},Xm=function(e,t,n,r,o,i){var a,u,s,c=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(c)if("undefined"==typeof c.length){for(a in c)if(c.hasOwnProperty(a)){if(u="attributes"===r?e.getAttrib(t,a):bc.getStyle(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!qm(u,bc.normalizeStyleValue(e,bc.replaceVars(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?e.getAttrib(t,c[s]):bc.getStyle(e,t,c[s]))return n;return n},Ym=function(e,t,n,r,o){var i,a,u,s,c=e.formatter.get(n),l=e.dom;if(c&&t)for(a=0;a<c.length;a++)if(i=c[a],Km(e.dom,t,i)&&Xm(l,t,i,"attributes",o,r)&&Xm(l,t,i,"styles",o,r)){if(s=i.classes)for(u=0;u<s.length;u++)if(!e.dom.hasClass(t,s[u]))return;return i}},Gm={matchNode:Ym,matchName:Km,match:function(e,t,n,r){var o;return r?Wm(e,r,t,n):(r=e.selection.getNode(),!!Wm(e,r,t,n)||!((o=e.selection.getStart())===r||!Wm(e,o,t,n)))},matchAll:function(r,o,i){var e,a=[],u={};return e=r.selection.getStart(),r.dom.getParent(e,function(e){var t,n;for(t=0;t<o.length;t++)n=o[t],!u[n]&&Ym(r,e,n,i)&&(u[n]=!0,a.push(n))},r.dom.getRoot()),a},canApply:function(e,t){var n,r,o,i,a,u=e.formatter.get(t),s=e.dom;if(u)for(n=e.selection.getStart(),r=bc.getParents(s,n),i=u.length-1;0<=i;i--){if(!(a=u[i].selector)||u[i].defaultBlock)return!0;for(o=r.length-1;0<=o;o--)if(s.is(r[o],a))return!0}return!1},matchesUnInheritedFormatSelector:$m},Jm=function(e,t){return e.splitText(t)},Qm=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Bo.isText(t)?0<n&&n<t.nodeValue.length&&(t=(r=Jm(t,n)).previousSibling,n<o?(t=r=Jm(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Bo.isText(t)&&0<n&&n<t.nodeValue.length&&(t=Jm(t,n),n=0),Bo.isText(r)&&0<o&&o<r.nodeValue.length&&(o=(r=Jm(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},Zm=function(e,t,n){if(0!==n){var r,o,i,a=e.data.slice(t,t+n),u=t+n>=e.data.length,s=0===t;e.replaceData(t,n,(o=s,i=u,z((r=a).split(""),function(e,t){return-1!==" \f\n\r\t\x0B".indexOf(t)||"\xa0"===t?e.previousCharIsSpace||""===e.str&&o||e.str.length===r.length-1&&i?{previousCharIsSpace:!1,str:e.str+"\xa0"}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str))}},eg=function(e,t){var n,r=e.data.slice(t),o=r.length-(n=r,n.replace(/^\s+/g,"")).length;return Zm(e,t,o)},tg=function(e,t){var n,r,o,i=rr.fromDom(e),a=rr.fromDom(t);return n=a,r="pre,code",o=d(Pr,i),Gi(n,r,o).isSome()},ng=function(e,t){return Ia(t)&&!1===(r=e,o=t,Bo.isText(o)&&/^[ \t\r\n]*$/.test(o.data)&&!1===tg(r,o))||(n=t,Bo.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||rg(t);var n,r,o},rg=Bo.hasAttribute("data-mce-bookmark"),og=Bo.hasAttribute("data-mce-bogus"),ig=Bo.hasAttributeValue("data-mce-bogus","all"),ag=function(e){return function(e){var t,n,r=0;if(ng(e,e))return!1;if(!(n=e.firstChild))return!0;t=new oo(n,e);do{if(ig(n))n=t.next(!0);else if(og(n))n=t.next();else if(Bo.isBr(n))r++,n=t.next();else{if(ng(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},ug=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===Cu.isTextPosition(n)&&o===r.parentNode&&i>Cu.before(r).offset()?Cu(t.container(),t.offset()-1):t;var n,r,o,i},sg=function(e){return Ia(e.previousSibling)?A.some((t=e.previousSibling,Bo.isText(t)?Cu(t,t.data.length):Cu.after(t))):e.previousSibling?oc.lastPositionIn(e.previousSibling):A.none();var t},cg=function(e){return Ia(e.nextSibling)?A.some((t=e.nextSibling,Bo.isText(t)?Cu(t,0):Cu.before(t))):e.nextSibling?oc.firstPositionIn(e.nextSibling):A.none();var t},lg=function(r,o){return sg(o).orThunk(function(){return cg(o)}).orThunk(function(){return e=r,t=o,n=Cu.before(t.previousSibling?t.previousSibling:t.parentNode),oc.prevPosition(e,n).fold(function(){return oc.nextPosition(e,Cu.after(t))},A.some);var e,t,n})},fg=function(n,r){return cg(r).orThunk(function(){return sg(r)}).orThunk(function(){return e=n,t=r,oc.nextPosition(e,Cu.after(t)).fold(function(){return oc.prevPosition(e,Cu.before(t))},A.some);var e,t})},dg=function(e,t,n){return(r=e,o=t,i=n,r?fg(o,i):lg(o,i)).map(d(ug,n));var r,o,i},mg=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},gg=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(ur(t))},pg=function(e){if(ag(e)){var t=rr.fromHtml('<br data-mce-bogus="1">');return _i(e),Bi(e,t),A.some(Cu.before(t.dom()))}return A.none()},hg=function(e,t,l){var n=Fr(e).filter(function(e){return Bo.isText(e.dom())}),r=Ur(e).filter(function(e){return Bo.isText(e.dom())});return Pi(e),Xa([n,r,t],function(e,t,n){var r,o,i,a,u=e.dom(),s=t.dom(),c=u.data.length;return o=s,i=l,a=Xn((r=u).data).length,r.appendData(o.data),Pi(rr.fromDom(o)),i&&eg(r,a),n.container()===s?Cu(u,c):n}).orThunk(function(){return l&&(n.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Xn(r).length,Zm(t,n-o,o);var t,n,r,o}),r.each(function(e){return eg(e.dom(),0)})),t})},vg=function(t,n,e,r){void 0===r&&(r=!0);var o,i,a=dg(n,t.getBody(),e.dom()),u=Xi(e,d(gg,t),(o=t.getBody(),function(e){return e.dom()===o})),s=hg(e,a,(i=e,hr(t.schema.getTextInlineElements(),ur(i))));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(pg).fold(function(){r&&mg(t,n,s)},function(e){r&&mg(t,n,A.some(e))})},bg=ma,yg="_mce_caret",Cg=function(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==bg||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length},xg=function(e){var t;if(e)for(e=(t=new oo(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},wg=function(e){var t=rr.fromTag("span");return yr(t,{id:yg,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Bi(t,rr.fromText(bg)),t},Ng=function(e,t,n){void 0===n&&(n=!0);var r,o=e.dom,i=e.selection;if(Cg(t))vg(e,!1,rr.fromDom(t),n);else{var a=i.getRng(),u=o.getParent(t,o.isBlock),s=((r=xg(t))&&r.nodeValue.charAt(0)===bg&&r.deleteData(0,1),r);a.startContainer===s&&0<a.startOffset&&a.setStart(s,a.startOffset-1),a.endContainer===s&&0<a.endOffset&&a.setEnd(s,a.endOffset-1),o.remove(t,!0),u&&o.isEmpty(u)&&jm(rr.fromDom(u)),i.setRng(a)}},Eg=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)Ng(e,t,n);else if(!(t=Hu(e.getBody(),o.getStart())))for(;t=r.get(yg);)Ng(e,t,!1)},Sg=function(e,t,n){var r=e.dom,o=r.getParent(n,d(bc.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Vm(rr.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},kg=function(e,t){return e.appendChild(t),t},Tg=function(e,t){var n,r,o=(n=function(e,t){return kg(e,t.cloneNode(!1))},r=t,function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){r=n(r,e)}),r);return kg(o,o.ownerDocument.createTextNode(bg))},Ag=function(i){i.on("mouseup keydown",function(e){var t,n,r,o;t=i,n=e.keyCode,r=t.selection,o=t.getBody(),Eg(t,null,!1),8!==n&&46!==n||!r.isCollapsed()||r.getStart().innerHTML!==bg||Eg(t,Hu(o,r.getStart())),37!==n&&39!==n||Eg(t,Hu(o,r.getStart()))})},Rg=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(ur(t))&&!ju(t.dom())&&!Bo.isBogus(t.dom())},Dg={},Bg=qt.filter,Og=qt.each;zm=function(e){var t,n,r=e.selection.getRng();t=Bo.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),Og(Bg(Bg(n,t),function(e){return t(e.previousSibling)&&-1!==qt.indexOf(n,e.previousSibling)}),function(e){var t,n;t=e.previousSibling,pn(n=e).remove(),pn(t).append("<br><br>").append(n.childNodes)}))},Dg[Um="pre"]||(Dg[Um]=[]),Dg[Um].push(zm);var _g=function(e,t){Og(Dg[e],function(e){e(t)})},Pg=Yt.each,Ig=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return Pg(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!(!r(n(e),n(t))||!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))||gc(e)||gc(t))}},Lg=/^(src|href|style)$/,Mg=Yt.each,Fg=bc.isEq,Ug=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},zg=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],Bo.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[i<o?i:o]),Bo.isText(r)&&n&&o>=r.nodeValue.length&&(r=new oo(r,e.getBody()).next()||r),Bo.isText(r)&&!n&&0===o&&(r=new oo(r,e.getBody()).prev()||r),r},Vg=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},jg=function(e,t,n,r,o){var i=rr.fromDom(t),a=rr.fromDom(e.create(r,o)),u=n?Vr(i):zr(i);return Oi(a,u),n?(Ai(i,a),Di(a,i)):(Ri(i,a),Bi(a,i)),a.dom()},Hg=function(e,t,n,r){return!(t=bc.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},qg=function(e,n,r,o,i){var t,a,u,s,c,l,f,d,m,g,p,h,v,b,y=e.dom;if(c=y,!(Fg(l=o,(f=n).inline)||Fg(l,f.block)||(f.selector?Bo.isElement(l)&&c.is(l,f.selector):void 0)||(s=o,n.links&&"A"===s.tagName)))return!1;if("all"!==n.remove)for(Mg(n.styles,function(e,t){e=bc.normalizeStyleValue(y,bc.replaceVars(e,r),t),"number"==typeof t&&(t=e,i=0),(n.remove_similar||!i||Fg(bc.getStyle(y,i,t),e))&&y.setStyle(o,t,""),u=1}),u&&""===y.getAttrib(o,"style")&&(o.removeAttribute("style"),o.removeAttribute("data-mce-style")),Mg(n.attributes,function(e,t){var n;if(e=bc.replaceVars(e,r),"number"==typeof t&&(t=e,i=0),!i||Fg(y.getAttrib(i,t),e)){if("class"===t&&(e=y.getAttrib(o,t))&&(n="",Mg(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n))return void y.setAttrib(o,t,n);"class"===t&&o.removeAttribute("className"),Lg.test(t)&&o.removeAttribute("data-mce-"+t),o.removeAttribute(t)}}),Mg(n.classes,function(e){e=bc.replaceVars(e,r),i&&!y.hasClass(i,e)||y.removeClass(o,e)}),a=y.getAttribs(o),t=0;t<a.length;t++){var C=a[t].nodeName;if(0!==C.indexOf("_")&&0!==C.indexOf("data-"))return!1}return"none"!==n.remove?(d=e,g=n,h=(m=o).parentNode,v=d.dom,b=al(d),g.block&&(b?h===v.getRoot()&&(g.list_block&&Fg(m,g.list_block)||Mg(Yt.grep(m.childNodes),function(e){bc.isValid(d,b,e.nodeName.toLowerCase())?p?p.appendChild(e):(p=Vg(v,e,b),v.setAttribs(p,d.settings.forced_root_block_attrs)):p=0})):v.isBlock(m)&&!v.isBlock(h)&&(Hg(v,m,!1)||Hg(v,m.firstChild,!0,1)||m.insertBefore(v.create("br"),m.firstChild),Hg(v,m,!0)||Hg(v,m.lastChild,!1,1)||m.appendChild(v.create("br")))),g.selector&&g.inline&&!Fg(g.inline,m)||v.remove(m,1),!0):void 0},$g=qg,Wg=function(s,c,l,e,f){var t,n,d=s.formatter.get(c),m=d[0],a=!0,u=s.dom,r=s.selection,i=function(e){var n,t,r,o,i,a,u=(n=s,t=e,r=c,o=l,i=f,Mg(bc.getParents(n.dom,t.parentNode).reverse(),function(e){var t;a||"_start"===e.id||"_end"===e.id||(t=Gm.matchNode(n,e,r,o,i))&&!1!==t.split&&(a=e)}),a);return function(e,t,n,r,o,i,a,u){var s,c,l,f,d,m,g=e.dom;if(n){for(m=n.parentNode,s=r.parentNode;s&&s!==m;s=s.parentNode){for(c=g.clone(s,!1),d=0;d<t.length;d++)if(qg(e,t[d],u,c,c)){c=0;break}c&&(l&&c.appendChild(l),f||(f=c),l=c)}!i||a.mixed&&g.isBlock(n)||(r=g.split(n,r)),l&&(o.parentNode.insertBefore(l,o),f.appendChild(o))}return r}(s,d,u,e,e,!0,m,l)},g=function(e){var t,n,r,o,i;if(Bo.isElement(e)&&u.getContentEditable(e)&&(o=a,a="true"===u.getContentEditable(e),i=!0),t=Yt.grep(e.childNodes),a&&!i)for(n=0,r=d.length;n<r&&!qg(s,d[n],l,e,e);n++);if(m.deep&&t.length){for(n=0,r=t.length;n<r;n++)g(t[n]);i&&(a=o)}},p=function(e){var t,n=u.get(e?"_start":"_end"),r=n[e?"firstChild":"lastChild"];return gc(t=r)&&Bo.isElement(t)&&("_start"===t.id||"_end"===t.id)&&(r=r[e?"firstChild":"lastChild"]),Bo.isText(r)&&0===r.data.length&&(r=e?n.previousSibling||n.nextSibling:n.nextSibling||n.previousSibling),u.remove(n,!0),r},o=function(e){var t,n,r=e.commonAncestorContainer;if(e=Dc(s,e,d,!0),m.split){if(e=Qm(e),(t=zg(s,e,!0))!==(n=zg(s,e))){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"===t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&/^(TH|TD)$/.test(n.nodeName)&&n.firstChild&&(n=n.firstChild||n),Ug(u,t,n)){var o=A.from(t.firstChild).getOr(t);return i(jg(u,o,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void p(!0)}if(Ug(u,n,t))return o=A.from(n.lastChild).getOr(n),i(jg(u,o,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void p(!1);t=Vg(u,t,"span",{id:"_start","data-mce-type":"bookmark"}),n=Vg(u,n,"span",{id:"_end","data-mce-type":"bookmark"}),i(t),i(n),t=p(!0),n=p()}else t=n=i(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=u.nodeIndex(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=u.nodeIndex(n)+1}Oc(u,e,function(e){Mg(e,function(e){g(e),Bo.isElement(e)&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===bc.getTextDecoration(u,e.parentNode)&&qg(s,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})};if(e)e.nodeType?((n=u.createRng()).setStartBefore(e),n.setEndAfter(e),o(n)):o(e);else if("false"!==u.getContentEditable(r.getNode()))r.isCollapsed()&&m.inline&&!u.select("td[data-mce-selected],th[data-mce-selected]").length?function(e,t,n,r){var o,i,a,u,s,c,l,f=e.dom,d=e.selection,m=[],g=d.getRng();for(o=g.startContainer,i=g.startOffset,3===(s=o).nodeType&&(i!==o.nodeValue.length&&(u=!0),s=s.parentNode);s;){if(Gm.matchNode(e,s,t,n,r)){c=s;break}s.nextSibling&&(u=!0),m.push(s),s=s.parentNode}if(c)if(u){a=d.getBookmark(),g.collapse(!0);var p=Dc(e,g,e.formatter.get(t),!0);p=Qm(p),e.formatter.remove(t,n,p),d.moveToBookmark(a)}else{l=Hu(e.getBody(),c);var h=wg(!1).dom(),v=Tg(m,h);Sg(e,h,l||c),Ng(e,l,!1),d.setCursorLocation(v,1),f.isEmpty(c)&&f.remove(c)}}(s,c,l,f):(t=zu.getPersistentBookmark(s.selection,!0),o(r.getRng()),r.moveToBookmark(t),m.inline&&Gm.match(s,c,l,r.getStart())&&bc.moveStart(u,r,r.getRng()),s.nodeChanged());else{e=r.getNode();for(var h=0,v=d.length;h<v&&(!d[h].ceFalseOverride||!qg(s,d[h],l,e,e));h++);}},Kg=Yt.each,Xg=function(e){return e&&1===e.nodeType&&!gc(e)&&!ju(e)&&!Bo.isBogus(e)},Yg=function(e,t){var n;for(n=e;n;n=n[t]){if(3===n.nodeType&&0!==n.nodeValue.length)return e;if(1===n.nodeType&&!gc(n))return n}return e},Gg=function(e,t,n){var r,o,i=new Ig(e);if(t&&n&&(t=Yg(t,"previousSibling"),n=Yg(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),Yt.each(Yt.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},Jg=function(e,t,n){Kg(e.childNodes,function(e){Xg(e)&&(t(e)&&n(e),e.hasChildNodes()&&Jg(e,t,n))})},Qg=function(n,e){return d(function(e,t){return!(!t||!bc.getStyle(n,t,e))},e)},Zg=function(r,e,t){return d(function(e,t,n){r.setStyle(n,e,t),""===n.getAttribute("style")&&n.removeAttribute("style"),ep(r,n)},e,t)},ep=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},tp=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=bc.getTextDecoration(e,t.parentNode),e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null))},np=function(n,e,r,o){Kg(e,function(t){Kg(n.dom.select(t.inline,o),function(e){Xg(e)&&$g(n,t,r,e,t.exact?e:null)}),function(r,e,t){if(e.clear_child_styles){var n=e.links?"*:not(a)":"*";Kg(r.select(n,t),function(n){Xg(n)&&Kg(e.styles,function(e,t){r.setStyle(n,t,"")})})}}(n.dom,t,o)})},rp=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&(Yt.walk(r,d(tp,e),"childNodes"),tp(e,r))},op=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&Jg(r,Qg(e,"fontSize"),Zg(e,"backgroundColor",bc.replaceVars(t.styles.backgroundColor,n)))},ip=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(Jg(r,Qg(e,"fontSize"),Zg(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},ap=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=Gg(e,bc.getNonWhiteSpaceSibling(r),r),r=Gg(e,r,bc.getNonWhiteSpaceSibling(r,!0)))},up=function(t,n,r,o,i){Gm.matchNode(t,i.parentNode,r,o)&&$g(t,n,o,i)||n.merge_with_parents&&t.dom.getParent(i.parentNode,function(e){if(Gm.matchNode(t,e,r,o))return $g(t,n,o,i),!0})},sp=function(a){var u=Cu.fromRangeStart(a),s=Cu.fromRangeEnd(a),c=a.commonAncestorContainer;return oc.fromPosition(!1,c,s).map(function(e){return!Cs(u,s,c)&&Cs(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},cp=function(e){return e.collapsed?e:sp(e)},lp=Yt.each,fp=function(g,p,h,r){var e,t,v=g.formatter.get(p),b=v[0],o=!r&&g.selection.isCollapsed(),i=g.dom,n=g.selection,y=function(n,e){if(e=e||b,n){if(e.onformat&&e.onformat(n,e,h,r),lp(e.styles,function(e,t){i.setStyle(n,t,bc.replaceVars(e,h))}),e.styles){var t=i.getAttrib(n,"style");t&&n.setAttribute("data-mce-style",t)}lp(e.attributes,function(e,t){i.setAttrib(n,t,bc.replaceVars(e,h))}),lp(e.classes,function(e){e=bc.replaceVars(e,h),i.hasClass(n,e)||i.addClass(n,e)})}},C=function(e,t){var n=!1;return!!b.selector&&(lp(e,function(e){if(!("collapsed"in e&&e.collapsed!==o))return i.is(t,e.selector)&&!ju(t)?(y(t,e),!(n=!0)):void 0}),n)},a=function(s,e,t,c){var l,f,d=[],m=!0;l=b.inline||b.block,f=s.create(l),y(f),Oc(s,e,function(e){var a,u=function(e){var t,n,r,o;if(o=m,t=e.nodeName.toLowerCase(),n=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&s.getContentEditable(e)&&(o=m,m="true"===s.getContentEditable(e),r=!0),bc.isEq(t,"br"))return a=0,void(b.block&&s.remove(e));if(b.wrapper&&Gm.matchNode(g,e,p,h))a=0;else{if(m&&!r&&b.block&&!b.wrapper&&bc.isTextBlock(g,t)&&bc.isValid(g,n,l))return e=s.rename(e,l),y(e),d.push(e),void(a=0);if(b.selector){var i=C(v,e);if(!b.inline||i)return void(a=0)}!m||r||!bc.isValid(g,l,t)||!bc.isValid(g,n,l)||!c&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||ju(e)||b.inline&&s.isBlock(e)?(a=0,lp(Yt.grep(e.childNodes),u),r&&(m=o),a=0):(a||(a=s.clone(f,!1),e.parentNode.insertBefore(a,e),d.push(a)),a.appendChild(e))}};lp(e,u)}),!0===b.links&&lp(d,function(e){var t=function(e){"A"===e.nodeName&&y(e,b),lp(Yt.grep(e.childNodes),t)};t(e)}),lp(d,function(e){var t,n,r,o,i,a=function(e){var n=!1;return lp(e.childNodes,function(e){if((t=e)&&1===t.nodeType&&!gc(t)&&!ju(t)&&!Bo.isBogus(t))return n=e,!1;var t}),n};n=0,lp(e.childNodes,function(e){bc.isWhiteSpaceNode(e)||gc(e)||n++}),t=n,!(1<d.length)&&s.isBlock(e)||0!==t?(b.inline||b.wrapper)&&(b.exact||1!==t||((o=a(r=e))&&!gc(o)&&Gm.matchName(s,o,b)&&(i=s.clone(o,!1),y(i),s.replace(i,r,!0),s.remove(o,1)),e=i||r),np(g,v,h,e),up(g,b,p,h,e),op(s,b,h,e),ip(s,b,h,e),ap(s,b,h,e)):s.remove(e,1)})};if("false"!==i.getContentEditable(n.getNode())){if(b){if(r)r.nodeType?C(v,r)||((t=i.createRng()).setStartBefore(r),t.setEndAfter(r),a(i,Dc(g,t,v),0,!0)):a(i,r,0,!0);else if(o&&b.inline&&!i.select("td[data-mce-selected],th[data-mce-selected]").length)!function(e,t,n){var r,o,i,a,u,s,c=e.selection;a=(r=c.getRng(!0)).startOffset,s=r.startContainer.nodeValue,(o=Hu(e.getBody(),c.getStart()))&&(i=xg(o));var l,f,d=/[^\s\u00a0\u00ad\u200b\ufeff]/;s&&0<a&&a<s.length&&d.test(s.charAt(a))&&d.test(s.charAt(a-1))?(u=c.getBookmark(),r.collapse(!0),r=Dc(e,r,e.formatter.get(t)),r=Qm(r),e.formatter.apply(t,n,r),c.moveToBookmark(u)):(o&&i.nodeValue===bg||(l=e.getDoc(),f=wg(!0).dom(),i=(o=l.importNode(f,!0)).firstChild,r.insertNode(o),a=1),e.formatter.apply(t,n,o),c.setCursorLocation(i,a))}(g,p,h);else{var u=g.selection.getNode();g.settings.forced_root_block||!v[0].defaultBlock||i.getParent(u,i.isBlock)||fp(g,v[0].defaultBlock),g.selection.setRng(cp(g.selection.getRng())),e=zu.getPersistentBookmark(g.selection,!0),a(i,Dc(g,n.getRng(),v)),b.styles&&rp(i,b,h,u),n.moveToBookmark(e),bc.moveStart(i,n,n.getRng()),g.nodeChanged()}_g(p,g)}}else{r=n.getNode();for(var s=0,c=v.length;s<c;s++)if(v[s].ceFalseOverride&&i.is(r,v[s].selector))return void y(r,v[s])}},dp={applyFormat:fp},mp=Yt.each,gp=function(e,t,n,r,o){var i,a,u,s,c,l,f,d;null===t.get()&&(a=e,u={},(i=t).set({}),a.on("NodeChange",function(n){var r=bc.getParents(a.dom,n.element),o={};r=Yt.grep(r,function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")}),mp(i.get(),function(e,n){mp(r,function(t){return a.formatter.matchNode(t,n,{},e.similar)?(u[n]||(mp(e,function(e){e(!0,{node:t,format:n,parents:r})}),u[n]=e),o[n]=e,!1):!Gm.matchesUnInheritedFormatSelector(a,t,n)&&void 0})}),mp(u,function(e,t){o[t]||(delete u[t],mp(e,function(e){e(!1,{node:n.element,format:t,parents:r})}))})})),c=n,l=r,f=o,d=(s=t).get(),mp(c.split(","),function(e){d[e]||(d[e]=[],d[e].similar=f),d[e].push(l)}),s.set(d)},pp={get:function(r){var t={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",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",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",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"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],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},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(){return!0},onformat:function(n,e,t){Yt.each(t,function(e,t){r.setAttrib(n,t,e)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",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 Yt.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t}},hp=Yt.each,vp=pi.DOM,bp=function(e,t){var n,o,r,m=t&&t.schema||ni({}),g=function(e){var t,n,r;return o="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=vp.create(o.name),n=t,(r=o).classes.length&&vp.addClass(n,r.classes.join(" ")),vp.setAttribs(n,r.attrs),t},p=function(n,e,t){var r,o,i,a,u,s,c,l,f=0<e.length&&e[0],d=f&&f.name;if(u=d,s="string"!=typeof(a=n)?a.nodeName.toLowerCase():a,c=m.getElementRule(s),i=!(!(l=c&&c.parentsRequired)||!l.length)&&(u&&-1!==Yt.inArray(l,u)?u:l[0]))d===i?(o=e[0],e=e.slice(1)):o=i;else if(f)o=e[0],e=e.slice(1);else if(!t)return n;return o&&(r=g(o)).appendChild(n),t&&(r||(r=vp.create("div")).appendChild(n),Yt.each(t,function(e){var t=g(e);r.insertBefore(t,n)})),p(r,e,o&&o.siblings)};return e&&e.length?(o=e[0],n=g(o),(r=vp.create("div")).appendChild(p(n,e.slice(1),o.siblings)),r):""},yp=function(e){var t,a={classes:[],attrs:{}};return"*"!==(e=a.selector=Yt.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,n,r,o){switch(t){case"#":a.attrs.id=n;break;case".":a.classes.push(n);break;case":":-1!==Yt.inArray("checked disabled enabled read-only required".split(" "),n)&&(a.attrs[n]=n)}if("["===r){var i=o.match(/([\w\-]+)(?:\=\"([^\"]+))?/);i&&(a.attrs[i[1]]=i[2])}return""})),a.name=t||"div",a},Cp=function(e){return e&&"string"==typeof e?(e=(e=e.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Yt.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Yt.map(e.split(/(?:~\+|~|\+)/),yp),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},xp=function(n,e){var t,r,o,i,a,u,s="";if(!1===(u=n.settings.preview_styles))return"";"string"!=typeof u&&(u="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var c=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=n.formatter.get(e)))return;e=e[0]}return"preview"in e&&!1===(u=e.preview)?"":(t=e.block||e.inline||"span",r=(i=Cp(e.selector)).length?(i[0].name||(i[0].name=t),t=e.selector,bp(i,n)):bp([t],n),o=vp.select(t,r)[0]||r.firstChild,hp(e.styles,function(e,t){(e=c(e))&&vp.setStyle(o,t,e)}),hp(e.attributes,function(e,t){(e=c(e))&&vp.setAttrib(o,t,e)}),hp(e.classes,function(e){e=c(e),vp.hasClass(o,e)||vp.addClass(o,e)}),n.fire("PreviewFormats"),vp.setStyles(r,{position:"absolute",left:-65535}),n.getBody().appendChild(r),a=vp.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,hp(u.split(" "),function(e){var t=vp.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=vp.getStyle(n.getBody(),e,!0),"#ffffff"===vp.toHex(t).toLowerCase())||"color"===e&&"#000000"===vp.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===a)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*a+"px"}"border"===e&&t&&(s+="padding:0 2px;"),s+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),vp.remove(r),s)},wp=function(e,t,n,r,o){var i=t.get(n);!Gm.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?dp.applyFormat(e,n,r,o):Wg(e,n,r,o)},Np=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])};function Ep(e){var t=function o(e){var n={},r=function(e,t){e&&("string"!=typeof e?Yt.each(e,function(e,t){r(t,e)}):(B(t)||(t=[t]),Yt.each(t,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selector),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),n[e]=t))};return r(pp.get(e.dom)),r(e.settings.formats),{get:function(e){return e?n[e]:n},has:function(e){return hr(n,e)},register:r,unregister:function(e){return e&&n[e]&&delete n[e],n}}}(e),n=wi(null);return Np(e),Ag(e),{get:t.get,has:t.has,register:t.register,unregister:t.unregister,apply:d(dp.applyFormat,e),remove:d(Wg,e),toggle:d(wp,e,t),match:d(Gm.match,e),matchAll:d(Gm.matchAll,e),matchNode:d(Gm.matchNode,e),canApply:d(Gm.canApply,e),formatChanged:d(gp,e,n),getCssText:d(xp,e)}}var Sp={register:function(t,s,c){t.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n,r=e.length;r--;)(n=e[r]).attr("tabindex",n.attributes.map["data-mce-tabindex"]),n.attr(t,null)}),t.addAttributeFilter("src,href,style",function(e,t){for(var n,r,o=e.length,i="data-mce-"+t,a=s.url_converter,u=s.url_converter_scope;o--;)(r=(n=e[o]).attributes.map[i])!==undefined?(n.attr(t,0<r.length?r:null),n.attr(i,null)):(r=n.attributes.map[t],"style"===t?r=c.serializeStyle(c.parseStyle(r),n.name):a&&(r=a.call(u,r,t,n.name)),n.attr(t,0<r.length?r:null))}),t.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)(n=(t=e[r]).attr("class"))&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr("class",0<n.length?n:null))}),t.addAttributeFilter("data-mce-type",function(e,t,n){for(var r,o=e.length;o--;)"bookmark"!==(r=e[o]).attributes.map["data-mce-type"]||n.cleanup||r.remove()}),t.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=$o.decode(t.value))}),t.addNodeFilter("script,style",function(e,t){for(var n,r,o,i=e.length,a=function(e){return e.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,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="// <![CDATA[\n"+a(r)+"\n// ]]>")):"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="\x3c!--\n"+a(r)+"\n--\x3e")}),t.addNodeFilter("#comment",function(e){for(var t,n=e.length;n--;)0===(t=e[n]).value.indexOf("[CDATA[")?(t.name="#cdata",t.type=4,t.value=t.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===t.value.indexOf("mce:protected ")&&(t.name="#text",t.type=3,t.raw=!0,t.value=unescape(t.value).substr(14))}),t.addNodeFilter("xml:namespace,input",function(e,t){for(var n,r=e.length;r--;)7===(n=e[r]).type?n.remove():1===n.type&&("input"!==t||"type"in n.attributes.map||n.attr("type","text"))}),t.addAttributeFilter("data-mce-type",function(e){F(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",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})},trimTrailingBr:function(e){var t,n,r=function(e){return e&&"br"===e.name};r(t=e.lastChild)&&r(n=t.prev)&&(t.remove(),n.remove())}},kp={process:function(e,t,n){return f=n,(l=e)&&l.hasEventListeners("PreProcess")&&!f.no_events?(o=t,i=n,c=(r=e).dom,o=o.cloneNode(!0),(a=document.implementation).createHTMLDocument&&(u=a.createHTMLDocument(""),Yt.each("BODY"===o.nodeName?o.childNodes:[o],function(e){u.body.appendChild(u.importNode(e,!0))}),o="BODY"!==o.nodeName?u.body.firstChild:u.body,s=c.doc,c.doc=u),df(r,jc(i,{node:o})),s&&(c.doc=s),o):t;var r,o,i,a,u,s,c,l,f}},Tp=function(e,a,u){e.addNodeFilter("font",function(e){F(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,F(["color","face","size"],function(e){t.attr(e,null)})})})},Ap=function(e,t){var n,r=oi();t.convert_fonts_to_spans&&Tp(e,r,Yt.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){F(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},Rp={register:function(e,t){t.inline_styles&&Ap(e,t)}},Dp=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new Wc("br",1)).shortEnded=!0:r.empty().append(new Wc("#text",3)).value="\xa0"},Bp=function(e){return Op(e,"#text")&&"\xa0"===e.firstChild.value},Op=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},_p=function(r,e,t,n){return n.isEmpty(e,t,function(e){return t=e,(n=r.getElementRule(t.name))&&n.paddEmpty;var t,n})},Pp=function(e,t){return e&&(t[e.name]||"br"===e.name)},Ip=function(e,p){var h=e.schema;p.remove_trailing_brs&&e.addNodeFilter("br",function(e,t,n){var r,o,i,a,u,s,c,l,f=e.length,d=Yt.extend({},h.getBlockElements()),m=h.getNonEmptyElements(),g=h.getNonEmptyElements();for(d.body=1,r=0;r<f;r++)if(i=(o=e[r]).parent,d[o.parent.name]&&o===i.lastChild){for(u=o.prev;u;){if("span"!==(s=u.name)||"bookmark"!==u.attr("data-mce-type")){if("br"!==s)break;if("br"===s){o=null;break}}u=u.prev}o&&(o.remove(),_p(h,m,g,i)&&(c=h.getElementRule(i.name))&&(c.removeEmpty?i.remove():c.paddEmpty&&Dp(p,n,d,i)))}else{for(a=o;i&&i.firstChild===a&&i.lastChild===a&&!d[(a=i).name];)i=i.parent;a===i&&!0!==p.padd_empty_with_br&&((l=new Wc("#text",3)).value="\xa0",o.replace(l))}}),e.addAttributeFilter("href",function(e){var t,n,r,o=e.length;if(!p.allow_unsafe_link_target)for(;o--;)"a"===(t=e[o]).name&&"_blank"===t.attr("target")&&t.attr("rel",(n=t.attr("rel"),r=n?Yt.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter(function(e){return 0<e.length}).concat(["noopener"]).sort().join(" ")))}),p.allow_html_in_named_anchor||e.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,t=o.lastChild;n=t.prev,r.insert(t,o),t=n;);}),p.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new Wc("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),p.validate&&h.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t,n,r,o,i,a,u,s=e.length,c=h.getValidClasses();s--;){for(n=(t=e[s]).attr("class").split(" "),i="",r=0;r<n.length;r++)o=n[r],u=!1,(a=c["*"])&&a[o]&&(u=!0),a=c[t.name],!u&&a&&a[o]&&(u=!0),u&&(i&&(i+=" "),i+=o);i.length||(i=null),t.attr("class",i)}})},Lp=Yt.makeMap,Mp=Yt.each,Fp=Yt.explode,Up=Yt.extend;function zp(A,R){void 0===R&&(R=ni());var D={},B=[],O={},_={};(A=A||{}).validate=!("validate"in A)||A.validate,A.root_name=A.root_name||"body";var P=function(e){var t,n,r;(n=e.name)in D&&((r=O[n])?r.push(e):O[n]=[e]),t=B.length;for(;t--;)(n=B[t].name)in e.attributes.map&&((r=_[n])?r.push(e):_[n]=[e]);return e},e={schema:R,addAttributeFilter:function(e,n){Mp(Fp(e),function(e){var t;for(t=0;t<B.length;t++)if(B[t].name===e)return void B[t].callbacks.push(n);B.push({name:e,callbacks:[n]})})},getAttributeFilters:function(){return[].concat(B)},addNodeFilter:function(e,n){Mp(Fp(e),function(e){var t=D[e];t||(D[e]=t=[]),t.push(n)})},getNodeFilters:function(){var e=[];for(var t in D)D.hasOwnProperty(t)&&e.push({name:t,callbacks:D[t]});return e},filterNode:P,parse:function(e,a){var t,n,r,o,i,u,s,c,l,f,d,m=[];a=a||{},O={},_={},l=Up(Lp("script,style,head,html,body,title,meta,param"),R.getBlockElements());var g,p=R.getNonEmptyElements(),h=R.children,v=A.validate,b="forced_root_block"in a?a.forced_root_block:A.forced_root_block,y=!1===(g=b)?"":!0===g?"p":g,C=R.getWhiteSpaceElements(),x=/^[ \t\r\n]+/,w=/[ \t\r\n]+$/,N=/[ \t\r\n]+/g,E=/^[ \t\r\n]+$/;f=C.hasOwnProperty(a.context)||C.hasOwnProperty(A.root_name);var S=function(e,t){var n,r=new Wc(e,t);return e in D&&((n=O[e])?n.push(r):O[e]=[r]),r},k=function(e){var t,n,r,o,i=R.getBlockElements();for(t=e.prev;t&&3===t.type;){if(0<(r=t.value.replace(w,"")).length)return void(t.value=r);if(n=t.next){if(3===n.type&&n.value.length){t=t.prev;continue}if(!i[n.name]&&"script"!==n.name&&"style"!==n.name){t=t.prev;continue}}o=t.prev,t.remove(),t=o}};t=Yc({validate:v,allow_script_urls:A.allow_script_urls,allow_conditional_comments:A.allow_conditional_comments,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(R.getSelfClosingElements()),cdata:function(e){d.append(S("#cdata",4)).value=e},text:function(e,t){var n;f||(e=e.replace(N," "),Pp(d.lastChild,l)&&(e=e.replace(x,""))),0!==e.length&&((n=S("#text",3)).raw=!!t,d.append(n).value=e)},comment:function(e){d.append(S("#comment",8)).value=e},pi:function(e,t){d.append(S(e,7)).value=t,k(d)},doctype:function(e){d.append(S("#doctype",10)).value=e,k(d)},start:function(e,t,n){var r,o,i,a,u;if(i=v?R.getElementRule(e):{}){for((r=S(i.outputName||e,1)).attributes=t,r.shortEnded=n,d.append(r),(u=h[d.name])&&h[r.name]&&!u[r.name]&&m.push(r),o=B.length;o--;)(a=B[o].name)in t.map&&((s=_[a])?s.push(r):_[a]=[r]);l[e]&&k(r),n||(d=r),!f&&C[e]&&(f=!0)}},end:function(e){var t,n,r,o,i;if(n=v?R.getElementRule(e):{}){if(l[e]&&!f){if((t=d.firstChild)&&3===t.type)if(0<(r=t.value.replace(x,"")).length)t.value=r,t=t.next;else for(o=t.next,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.next,(0===r.length||E.test(r))&&(t.remove(),t=o),t=o;if((t=d.lastChild)&&3===t.type)if(0<(r=t.value.replace(w,"")).length)t.value=r,t=t.prev;else for(o=t.prev,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.prev,(0===r.length||E.test(r))&&(t.remove(),t=o),t=o}if(f&&C[e]&&(f=!1),n.removeEmpty&&_p(R,p,C,d)&&!d.attributes.map.name&&!d.attr("id"))return i=d.parent,l[d.name]?d.empty().remove():d.unwrap(),void(d=i);n.paddEmpty&&(Bp(d)||_p(R,p,C,d))&&Dp(A,a,l,d),d=d.parent}}},R);var T=d=new Wc(a.context||A.root_name,11);if(t.parse(e),v&&m.length&&(a.context?a.invalid=!0:function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h;for(d=Lp("tr,td,th,tbody,thead,tfoot,table"),l=R.getNonEmptyElements(),f=R.getWhiteSpaceElements(),m=R.getTextBlockElements(),g=R.getSpecialElements(),t=0;t<e.length;t++)if((n=e[t]).parent&&!n.fixed)if(m[n.name]&&"li"===n.parent.name){for(p=n.next;p&&m[p.name];)p.name="li",p.fixed=!0,n.parent.insert(p,n.parent),p=p.next;n.unwrap(n)}else{for(o=[n],r=n.parent;r&&!R.isValidChild(r.name,n.name)&&!d[r.name];r=r.parent)o.push(r);if(r&&1<o.length){for(o.reverse(),i=a=P(o[0].clone()),c=0;c<o.length-1;c++){for(R.isValidChild(a.name,o[c].name)?(u=P(o[c].clone()),a.append(u)):u=a,s=o[c].firstChild;s&&s!==o[c+1];)h=s.next,u.append(s),s=h;a=u}_p(R,l,f,i)?r.insert(n,o[0],!0):(r.insert(i,o[0],!0),r.insert(n,i)),r=o[0],(_p(R,l,f,r)||Op(r,"br"))&&r.empty().remove()}else if(n.parent){if("li"===n.name){if((p=n.prev)&&("ul"===p.name||"ul"===p.name)){p.append(n);continue}if((p=n.next)&&("ul"===p.name||"ul"===p.name)){p.insert(n,p.firstChild,!0);continue}n.wrap(P(new Wc("ul",1)));continue}R.isValidChild(n.parent.name,"div")&&R.isValidChild("div",n.name)?n.wrap(P(new Wc("div",1))):g[n.name]?n.empty().remove():n.unwrap()}}}(m)),y&&("body"===T.name||a.isRootContent)&&function(){var e,t,n=T.firstChild,r=function(e){e&&((n=e.firstChild)&&3===n.type&&(n.value=n.value.replace(x,"")),(n=e.lastChild)&&3===n.type&&(n.value=n.value.replace(w,"")))};if(R.isValidChild(T.name,y.toLowerCase())){for(;n;)e=n.next,3===n.type||1===n.type&&"p"!==n.name&&!l[n.name]&&!n.attr("data-mce-type")?(t||((t=S(y,1)).attr(A.forced_root_block_attrs),T.insert(t,n)),t.append(n)):(r(t),t=null),n=e;r(t)}}(),!a.invalid){for(c in O){for(s=D[c],i=(n=O[c]).length;i--;)n[i].parent||n.splice(i,1);for(r=0,o=s.length;r<o;r++)s[r](n,c,a)}for(r=0,o=B.length;r<o;r++)if((s=B[r]).name in _){for(i=(n=_[s.name]).length;i--;)n[i].parent||n.splice(i,1);for(i=0,u=s.callbacks.length;i<u;i++)s.callbacks[i](n,s.name,a)}}return T}};return Ip(e,A),Rp.register(e,A),e}var Vp=function(e,t,n){-1===Yt.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},jp=function(e,t,n){var r=ga(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||Co(rr.fromDom(t))?r:Yt.trim(r)},Hp=function(e,t,n){var r=n.selection?jc({forced_root_block:!1},n):n,o=e.parse(t,r);return Sp.trimTrailingBr(o),o},qp=function(e,t,n,r,o){var i,a,u,s,c=(i=r,Bl(t,n).serialize(i));return a=e,s=c,(u=o).no_events||!a?s:mf(a,jc(u,{content:s})).content};function $p(e,t){var n=function r(a,u){var s,c,l,e=["data-mce-selected"];return s=u&&u.dom?u.dom:pi.DOM,c=u&&u.schema?u.schema:ni(a),a.entity_encoding=a.entity_encoding||"named",a.remove_trailing_brs=!("remove_trailing_brs"in a)||a.remove_trailing_brs,l=zp(a,c),Sp.register(l,a,s),{schema:c,addNodeFilter:l.addNodeFilter,addAttributeFilter:l.addAttributeFilter,serialize:function(e,t){var n=jc({format:"html"},t||{}),r=kp.process(u,e,n),o=jp(s,r,n),i=Hp(l,o,n);return"tree"===n.format?i:qp(u,a,c,i,n)},addRules:function(e){c.addValidElements(e)},setRules:function(e){c.setValidElements(e)},addTempAttr:d(Vp,l,e),getTempAttrs:function(){return e}}}(e,t);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}}function Wp(e){return{getBookmark:d(dc,e),moveToBookmark:d(mc,e)}}(Wp||(Wp={})).isBookmarkNode=gc;var Kp,Xp,Yp=Wp,Gp=Bo.isContentEditableFalse,Jp=Bo.isContentEditableTrue,Qp=function(r,a){var u,s,c,l,f,d,m,g,p,h,v,b,i,y,C,x,w,N=a.dom,E=Yt.each,S=a.getDoc(),k=document,T=Math.abs,A=Math.round,R=a.getBody();l={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var D=function(e){return e&&("IMG"===e.nodeName||a.dom.is(e,"figure.image"))},e=function(e){var t,n,r=e.target;t=e,n=a.selection.getRng(),!D(t.target)||um(t.clientX,t.clientY,n)||e.isDefaultPrevented()||(e.preventDefault(),a.selection.select(r))},B=function(e){return a.dom.is(e,"figure.image")?e.querySelector("img"):e},O=function(e){var t=a.settings.object_resizing;return!1!==t&&!de.iOS&&("string"!=typeof t&&(t="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&e!==a.getBody()&&Or(rr.fromDom(e),t))},_=function(e){var t,n,r,o;t=e.screenX-d,n=e.screenY-m,y=t*f[2]+h,C=n*f[3]+v,y=y<5?5:y,C=C<5?5:C,(D(u)&&!1!==a.settings.resize_img_proportional?!pm.modifierPressed(e):pm.modifierPressed(e)||D(u)&&f[2]*f[3]!=0)&&(T(t)>T(n)?(C=A(y*b),y=A(C/b)):(y=A(C/b),C=A(y*b))),N.setStyles(B(s),{width:y,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(c,{left:r,top:o,display:"block"}),c.innerHTML=y+" &times; "+C,f[2]<0&&s.clientWidth<=y&&N.setStyle(s,"left",g+(h-y)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",p+(v-C)),(t=R.scrollWidth-x)+(n=R.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(vf(a,u,h,v),i=!0)},P=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(B(u),e,t):N.setAttrib(B(u),e,t))};e("width",y),e("height",C),N.unbind(S,"mousemove",_),N.unbind(S,"mouseup",P),k!==S&&(N.unbind(k,"mousemove",_),N.unbind(k,"mouseup",P)),N.remove(s),N.remove(c),o(u),bf(a,u,y,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;I(),M(),t=N.getPos(e,R),g=t.x,p=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,y=C=0),n=a.fire("ObjectSelected",{target:e}),O(e)&&!n.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(R,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===de.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=B(u).clientWidth,v=B(u).clientHeight,b=v/h,(f=n).startPos={x:r*n[0]+g,y:o*n[1]+p},x=R.scrollWidth,w=R.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttrib(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:g,top:p,margin:0}),s.removeAttribute("data-mce-selected"),R.appendChild(s),N.bind(S,"mousemove",_),N.bind(S,"mouseup",P),k!==S&&(N.bind(k,"mousemove",_),N.bind(k,"mouseup",P)),c=N.add(R,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" &times; "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+p-t.offsetHeight/2})}):I(),u.setAttribute("data-mce-selected","1")},I=function(){var e,t;for(e in M(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},n=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],R)&&(F(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):I())},L=function(e){return Gp(function(e,t){for(;t&&t!==e;){if(Jp(t)||Gp(t))return t;t=t.parentNode}return null}(a.getBody(),e))},M=function(){for(var e in l){var t=l[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},F=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){F(),de.ie&&11<=de.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||L(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(R,"mscontrolselect",function(e){var t=function(e){ve.setEditorTimeout(a,function(){a.selection.select(e)})};if(L(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=ve.throttle(function(e){a.composing||n(e)});a.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",I),a.on("contextmenu",e)}),a.on("remove",M),{isResizable:O,showResizeRect:o,hideResizeRect:I,updateResizeRect:n,destroy:function(){u=s=null}}},Zp=function(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}},eh=function(e,t,n){var r,o,i,a,u,s=e.dom,c=s.getRoot(),l=0;if(u={elm:t,alignToTop:n},e.fire("scrollIntoView",u),!u.isDefaultPrevented()&&Bo.isElement(t)){if(!1===n&&(l=t.offsetHeight),"BODY"!==c.nodeName){var f=e.selection.getScrollContainer();if(f)return r=Zp(t).y-Zp(f).y+l,a=f.clientHeight,void((r<(i=f.scrollTop)||i+a<r+25)&&(f.scrollTop=r<i?r:r-a+25))}o=s.getViewPort(e.getWin()),r=s.getPos(t).y+l,i=o.y,a=o.h,(r<o.y||i+a<r+25)&&e.getWin().scrollTo(0,r<i?r:r-a+25)}},th=function(d,e){ee(hu.fromRangeStart(e).getClientRects()).each(function(e){var t,n,r,o,i,a,u,s,c,l=function(e){if(e.inline)return e.getBody().getBoundingClientRect();var t=e.getWin();return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight,width:t.innerWidth,height:t.innerHeight}}(d),f={x:(i=t=l,a=n=e,a.left>i.left&&a.right<i.right?0:a.left<i.left?a.left-i.left:a.right-i.right),y:(r=t,o=n,o.top>r.top&&o.bottom<r.bottom?0:o.top<r.top?o.top-r.top:o.bottom-r.bottom)};s=0!==f.x?0<f.x?f.x+4:f.x-4:0,c=0!==f.y?0<f.y?f.y+4:f.y-4:0,(u=d).inline?(u.getBody().scrollLeft+=s,u.getBody().scrollTop+=c):u.getWin().scrollBy(s,c)})},nh=function(e){return Bo.isContentEditableTrue(e)||Bo.isContentEditableFalse(e)},rh=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=Yt.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,Bo.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,nh))?null:i}return r},oh=function(n,e){return W(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},ih=function(e,t){var n=(t||document).createDocumentFragment();return F(e,function(e){n.appendChild(e.dom())}),rr.fromDom(n)},ah=Sr("element","width","rows"),uh=Sr("element","cells"),sh=Sr("x","y"),ch=function(e,t){var n=parseInt(Cr(e,t),10);return isNaN(n)?1:n},lh=function(e){return z(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},fh=function(e,t){for(var n=e.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Pr(o[i],t))return A.some(sh(i,r));return A.none()},dh=function(e,t,n,r,o){for(var i=[],a=e.rows(),u=n;u<=o;u++){var s=a[u].cells(),c=t<r?s.slice(t,r+1):s.slice(r,t+1);i.push(uh(a[u].element(),c))}return i},mh=function(e){var o=ah(sa(e),0,[]);return F($i(e,"tr"),function(n,r){F($i(n,"td,th"),function(e,t){!function(e,t,n,r,o){for(var i=ch(o,"rowspan"),a=ch(o,"colspan"),u=e.rows(),s=n;s<n+i;s++){u[s]||(u[s]=uh(ca(r),[]));for(var c=t;c<t+a;c++)u[s].cells()[c]=s===n&&c===t?o:sa(o)}}(o,function(e,t,n){for(;r=t,o=n,i=void 0,((i=e.rows())[o]?i[o].cells():[])[r];)t++;var r,o,i;return t}(o,t,r),r,n,e)})}),ah(o.element(),lh(o.rows()),o.rows())},gh=function(e){return n=W((t=e).rows(),function(e){var t=W(e.cells(),function(e){var t=ca(e);return xr(t,"colspan"),xr(t,"rowspan"),t}),n=sa(e.element());return Oi(n,t),n}),r=sa(t.element()),o=rr.fromTag("tbody"),Oi(o,n),Bi(r,o),r;var t,n,r,o},ph=function(l,e,t){return fh(l,e).bind(function(c){return fh(l,t).map(function(e){return t=l,r=e,o=(n=c).x(),i=n.y(),a=r.x(),u=r.y(),s=i<u?dh(t,o,i,a,u):dh(t,o,u,a,i),ah(t.element(),lh(s),s);var t,n,r,o,i,a,u,s})})},hh=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},vh=hh,bh=function(e){return G(e,function(e){var t=qa(e);return t?[rr.fromDom(t)]:[]})},yh=function(e){return 1<hh(e).length},Ch=function(e){return U(bh(e),yo)},xh=function(e){return $i(e,"td[data-mce-selected],th[data-mce-selected]")},wh=function(e,t){var n=xh(t),r=Ch(e);return 0<n.length?n:r},Nh=wh,Eh=function(e){return wh(vh(e.selection.getSel()),rr.fromDom(e.getBody()))},Sh=function(n,t){return V(n,function(e){return"li"===ur(e)&&Bd(e,t)}).fold(q([]),function(e){return(t=n,V(t,function(e){return"ul"===ur(e)||"ol"===ur(e)})).map(function(e){return[rr.fromTag("li"),rr.fromTag(ur(e))]}).getOr([]);var t})},kh=function(e,t){var n,r=rr.fromDom(t.commonAncestorContainer),o=wd(r,e),i=U(o,function(e){return fo(e)||co(e)}),a=Sh(o,t),u=i.concat(a.length?a:ho(n=r)?Mr(n).filter(po).fold(q([]),function(e){return[n,e]}):po(n)?[n]:[]);return W(u,sa)},Th=function(){return ih([])},Ah=function(e,t){return n=rr.fromDom(t.cloneContents()),r=kh(e,t),o=z(r,function(e,t){return Bi(t,e),t},n),0<r.length?ih([o]):o;var n,r,o},Rh=function(e,o){return(t=e,n=o[0],Gi(n,"table",d(Pr,t))).bind(function(e){var t=o[0],n=o[o.length-1],r=mh(e);return ph(r,t,n).map(function(e){return ih([gh(e)])})}).getOrThunk(Th);var t,n},Dh=function(e,t){var n,r,o=Nh(t,e);return 0<o.length?Rh(e,o):(n=e,0<(r=t).length&&r[0].collapsed?Th():Ah(n,r[0]))},Bh=function(e,t){if(void 0===t&&(t={}),t.get=!0,t.format=t.format||"html",t.selection=!0,(t=e.fire("BeforeGetContent",t)).isDefaultPrevented())return e.fire("GetContent",t),t.content;if("text"===t.format)return c=e,A.from(c.selection.getRng()).map(function(e){return ga(e.toString())}).getOr("");t.getInner=!0;var n,r,o,i,a,u,s,c,l=(r=t,i=(n=e).selection.getRng(),a=n.dom.create("body"),u=n.selection.getSel(),s=oh(n,vh(u)),i.cloneContents?(o=r.contextual?Dh(rr.fromDom(n.getBody()),s).dom():i.cloneContents())&&a.appendChild(o):a.innerHTML=i.toString(),n.selection.serializer.serialize(a,r));return"tree"===t.format?l:(t.content=e.selection.isCollapsed()?"":l,e.fire("GetContent",t),t.content)},Oh=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},_h=function(e,t,n){return Oh(e,t,function(e){return e.nodeName===n})},Ph=function(e){return e&&"TABLE"===e.nodeName},Ih=function(e,t,n){for(var r=new oo(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(Bo.isBr(t))return!0},Lh=function(e,t,n,r,o){var i,a,u,s,c,l,f=e.getRoot(),d=e.schema.getNonEmptyElements();if(u=e.getParent(o.parentNode,e.isBlock)||f,r&&Bo.isBr(o)&&t&&e.isEmpty(u))return A.some(hu(o.parentNode,e.nodeIndex(o)));for(i=new oo(o,u);s=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(s)||(l=f,ya(c=s)&&!1===Oh(c,l,ju)))return A.none();if(Bo.isText(s)&&0<s.nodeValue.length)return!1===_h(s,f,"A")?A.some(hu(s,r?s.nodeValue.length:0)):A.none();if(e.isBlock(s)||d[s.nodeName.toLowerCase()])return A.none();a=s}return n&&a?A.some(hu(a,0)):A.none()},Mh=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=e.getRoot(),p=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],l=Bo.isElement(o)&&i===o.childNodes.length,s=e.schema.getNonEmptyElements(),c=n,ya(o))return A.none();if(Bo.isElement(o)&&i>o.childNodes.length-1&&(c=!1),Bo.isDocument(o)&&(o=g,i=0),o===g){if(c&&(u=o.childNodes[0<i?i-1:0])){if(ya(u))return A.none();if(s[u.nodeName]||Ph(u))return A.none()}if(o.hasChildNodes()){if(i=Math.min(!c&&0<i?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Bo.isText(o)&&l?o.data.length:0,!t&&o===g.lastChild&&Ph(o))return A.none();if(function(e,t){for(;t&&t!==e;){if(Bo.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(g,o)||ya(o))return A.none();if(o.hasChildNodes()&&!1===Ph(o)){a=new oo(u=o,g);do{if(Bo.isContentEditableFalse(u)||ya(u)){p=!1;break}if(Bo.isText(u)&&0<u.nodeValue.length){i=c?0:u.nodeValue.length,o=u,p=!0;break}if(s[u.nodeName.toLowerCase()]&&(!(f=u)||!/^(TD|TH|CAPTION)$/.test(f.nodeName))){i=e.nodeIndex(u),o=u.parentNode,c||i++,p=!0;break}}while(u=c?a.next():a.prev())}}}return t&&(Bo.isText(o)&&0===i&&Lh(e,l,t,!0,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),Bo.isElement(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Bo.isBr(u)||(m="A",(d=u).previousSibling&&d.previousSibling.nodeName===m)||Ih(e,u,!1)||Ih(e,u,!0)||Lh(e,l,t,!0,u).each(function(e){o=e.container(),i=e.offset(),p=!0}))),c&&!t&&Bo.isText(o)&&i===o.nodeValue.length&&Lh(e,l,t,!1,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),p?A.some(hu(o,i)):A.none()},Fh=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=hu.fromRangeStart(t);return Mh(e,n,!0,r).each(function(e){n&&hu.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||Mh(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),Ad(t,r)?A.none():A.some(r)},Uh=function(e){return 0===e.dom().length?(Pi(e),A.none()):A.some(e)},zh=function(e,t,n){var r,o;if(o=t,(r=(r=n)||{format:"html"}).set=!0,r.selection=!0,r.content=o,(n=r).no_events||!(n=e.fire("BeforeSetContent",n)).isDefaultPrevented()){var i=e.selection.getRng();!function(r,e){var t=A.from(e.firstChild).map(rr.fromDom),n=A.from(e.lastChild).map(rr.fromDom);r.deleteContents(),r.insertNode(e);var o=t.bind(Fr).filter(lr).bind(Uh),i=n.bind(Ur).filter(lr).bind(Uh);Xa([o,t.filter(lr)],function(e,t){var n,r;n=t.dom(),r=e.dom().data,n.insertData(0,r),Pi(e)}),Xa([i,n.filter(lr)],function(e,t){var n=t.dom().length;t.dom().appendData(e.dom().data),r.setEnd(t.dom(),n),Pi(e)}),r.collapse(!1)}(i,i.createContextualFragment(n.content)),e.selection.setRng(i),th(e,i),n.no_events||e.fire("SetContent",n)}else e.fire("SetContent",n)},Vh=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return A.from(i).map(rr.fromDom).map(function(e){return r&&t.collapsed?e:Hr(e,o(e,a)).getOr(e)}).bind(function(e){return cr(e)?A.some(e):Mr(e)}).map(function(e){return e.dom()}).getOr(e)},jh=function(e,t,n){return Vh(e,t,!0,n,function(e,t){return Math.min(e.dom().childNodes.length,t)})},Hh=function(e,t,n){return Vh(e,t,!1,n,function(e,t){return 0<t?t-1:t})},qh=function(e,t){for(var n=e;e&&Bo.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},$h=function(e,t,n){if(e&&e.hasOwnProperty(t)){var r=U(e[t],function(e){return e!==n});0===r.length?delete e[t]:e[t]=r}},Wh=function(e){return!!e.select},Kh=function(e){return!(!e||!e.ownerDocument)&&Ir(rr.fromDom(e.ownerDocument),rr.fromDom(e))},Xh=function(u,s,e,c){var n,t,l,f,r=function h(i,n){var a,u;return{selectorChangedWithUnbind:function(e,t){return a||(a={},u={},n.on("NodeChange",function(e){var n=e.element,r=i.getParents(n,null,i.getRoot()),o={};Yt.each(a,function(e,n){Yt.each(r,function(t){if(i.is(t,n))return u[n]||(Yt.each(e,function(e){e(!0,{node:t,selector:n,parents:r})}),u[n]=e),o[n]=e,!1})}),Yt.each(u,function(e,t){o[t]||(delete u[t],Yt.each(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),{unbind:function(){$h(a,e,t),$h(u,e,t)}}}}}(u,c).selectorChangedWithUnbind,o=function(e,t){return zh(c,e,t)},i=function(e){var t=m();t.collapse(!!e),a(t)},d=function(){return s.getSelection?s.getSelection():s.document.selection},m=function(){var e,t,n,r,o=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!s)return null;if(null==(r=s.document))return null;if(c.bookmark!==undefined&&!1===sf(c)){var i=Zl(c);if(i.isSome())return i.map(function(e){return oh(c,[e])[0]}).getOr(r.createRange())}try{(e=d())&&(t=0<e.rangeCount?e.getRangeAt(0):e.createRange?e.createRange():r.createRange())}catch(a){}return(t=oh(c,[t])[0])||(t=r.createRange?r.createRange():r.body.createTextRange()),t.setStart&&9===t.startContainer.nodeType&&t.collapsed&&(n=u.getRoot(),t.setStart(n,0),t.setEnd(n,0)),l&&f&&(0===o(t.START_TO_START,t,l)&&0===o(t.END_TO_END,t,l)?t=f:f=l=null),t},a=function(e,t){var n,r;if((o=e)&&(Wh(o)||Kh(o.startContainer)&&Kh(o.endContainer))){var o,i=Wh(e)?e:null;if(i){f=null;try{i.select()}catch(a){}}else{if(n=d(),e=c.fire("SetSelectionRange",{range:e,forward:t}).range,n){f=e;try{n.removeAllRanges(),n.addRange(e)}catch(a){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),l=0<n.rangeCount?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExtent||de.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(r=e.startContainer.childNodes[e.startOffset])&&"IMG"===r.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(r,0,r,1)),c.fire("AfterSetSelectionRange",{range:e,forward:t})}}},g=function(){var e,t,n=d();return!(n&&n.anchorNode&&n.focusNode)||((e=u.createRng()).setStart(n.anchorNode,n.anchorOffset),e.collapse(!0),(t=u.createRng()).setStart(n.focusNode,n.focusOffset),t.collapse(!0),e.compareBoundaryPoints(e.START_TO_START,t)<=0)},p={bookmarkManager:null,controlSelection:null,dom:u,win:s,serializer:e,editor:c,collapse:i,setCursorLocation:function(e,t){var n=u.createRng();e?(n.setStart(e,t),n.setEnd(e,t),a(n),i(!1)):(Od(u,n,c.getBody(),!0),a(n))},getContent:function(e){return Bh(c,e)},setContent:o,getBookmark:function(e,t){return n.getBookmark(e,t)},moveToBookmark:function(e){return n.moveToBookmark(e)},select:function(e,t){var r,n,o;return(r=u,n=e,o=t,A.from(n).map(function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),o&&(Od(r,n,e,!0),Od(r,n,e,!1)),n})).each(a),e},isCollapsed:function(){var e=m(),t=d();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:g,setNode:function(e){return o(u.getOuterHTML(e)),e},getNode:function(){return e=c.getBody(),(t=m())?(r=t.startContainer,o=t.endContainer,i=t.startOffset,a=t.endOffset,n=t.commonAncestorContainer,!t.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?qh(r.nextSibling,!0):r.parentNode,o=0===a?qh(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n):e;var e,t,n,r,o,i,a},getSel:d,setRng:a,getRng:m,getStart:function(e){return jh(c.getBody(),m(),e)},getEnd:function(e){return Hh(c.getBody(),m(),e)},getSelectedBlocks:function(e,t){return function(e,t,n,r){var o,i,a=[];if(i=e.getRoot(),n=e.getParent(n||jh(i,t,t.collapsed),e.isBlock),r=e.getParent(r||Hh(i,t,t.collapsed),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r)for(var u=new oo(o=n,i);(o=u.next())&&o!==r;)e.isBlock(o)&&a.push(o);return r&&n!==r&&r!==i&&a.push(r),a}(u,m(),e,t)},normalize:function(){var e=m(),t=d();if(yh(t)||!_d(c))return e;var n=Fh(u,e);return n.each(function(e){a(e,g())}),n.getOr(e)},selectorChanged:function(e,t){return r(e,t),p},selectorChangedWithUnbind:r,getScrollContainer:function(){for(var e,t=u.getRoot();t&&"BODY"!==t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return eh(c,e,t)},placeCaretAt:function(e,t){return a(rh(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?Cu.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=Yp(p),t=Qp(p,c),p.bookmarkManager=n,p.controlSelection=t,p},Yh=Bo.isText,Gh=function(e){return Yh(e)&&e.data[0]===ma},Jh=function(e){return Yh(e)&&e.data[e.data.length-1]===ma},Qh=function(e){return e.ownerDocument.createTextNode(ma)},Zh=function(e,t){return e?function(e){if(Yh(e.previousSibling))return Jh(e.previousSibling)||e.previousSibling.appendData(ma),e.previousSibling;if(Yh(e))return Gh(e)||e.insertData(0,ma),e;var t=Qh(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(Yh(e.nextSibling))return Gh(e.nextSibling)||e.nextSibling.insertData(0,ma),e.nextSibling;if(Yh(e))return Jh(e)||e.appendData(ma),e;var t=Qh(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},ev=d(Zh,!0),tv=d(Zh,!1),nv=function(e,t){return Bo.isText(e.container())?Zh(t,e.container()):Zh(t,e.getNode())},rv=function(e,t){var n=t.get();return n&&e.container()===n&&ba(n)},ov=function(n,e){return e.fold(function(e){Zu.remove(n.get());var t=ev(e);return n.set(t),A.some(Cu(t,t.length-1))},function(e){return oc.firstPositionIn(e).map(function(e){if(rv(e,n))return Cu(n.get(),1);Zu.remove(n.get());var t=nv(e,!0);return n.set(t),Cu(t,1)})},function(e){return oc.lastPositionIn(e).map(function(e){if(rv(e,n))return Cu(n.get(),n.get().length-1);Zu.remove(n.get());var t=nv(e,!1);return n.set(t),Cu(t,t.length-1)})},function(e){Zu.remove(n.get());var t=tv(e);return n.set(t),A.some(Cu(t,1))})},iv=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,av=function(e,t){var n=t.container(),r=t.offset();return e?ba(n)?Bo.isText(n.nextSibling)?Cu(n.nextSibling,0):Cu.after(n):xa(t)?Cu(n,r+1):t:ba(n)?Bo.isText(n.previousSibling)?Cu(n.previousSibling,n.previousSibling.data.length):Cu.before(n):wa(t)?Cu(n,r-1):t},uv={isInlineTarget:function(e,t){var n=Pf(e,"inline_boundaries_selector").getOr("a[href],code");return Or(rr.fromDom(t),n)},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,U(pi.DOM.getParents(i.container(),"*",o),r));return A.from(a[a.length-1])},isRtl:function(e){return"rtl"===pi.DOM.getStyle(e,"direction",!0)||(t=e.textContent,iv.test(t));var t},isAtZwsp:function(e){return xa(e)||wa(e)},normalizePosition:av,normalizeForwards:d(av,!0),normalizeBackwards:d(av,!1),hasSameParentBlock:function(e,t,n){var r=ys(t,e),o=ys(n,e);return r&&r===o}},sv=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return A.none()},cv=Ll([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),lv=function(e,t){var n=ys(t,e);return n||e},fv=function(e,t,n){var r=uv.normalizeForwards(n),o=lv(t,r.container());return uv.findRootInline(e,o,r).fold(function(){return oc.nextPosition(o,r).bind(d(uv.findRootInline,e,o)).map(function(e){return cv.before(e)})},A.none)},dv=function(e,t){return null===Hu(e,t)},mv=function(e,t,n){return uv.findRootInline(e,t,n).filter(d(dv,t))},gv=function(e,t,n){var r=uv.normalizeBackwards(n);return mv(e,t,r).bind(function(e){return oc.prevPosition(e,r).isNone()?A.some(cv.start(e)):A.none()})},pv=function(e,t,n){var r=uv.normalizeForwards(n);return mv(e,t,r).bind(function(e){return oc.nextPosition(e,r).isNone()?A.some(cv.end(e)):A.none()})},hv=function(e,t,n){var r=uv.normalizeBackwards(n),o=lv(t,r.container());return uv.findRootInline(e,o,r).fold(function(){return oc.prevPosition(o,r).bind(d(uv.findRootInline,e,o)).map(function(e){return cv.after(e)})},A.none)},vv=function(e){return!1===uv.isRtl(yv(e))},bv=function(e,t,n){return sv([fv,gv,pv,hv],[e,t,n]).filter(vv)},yv=function(e){return e.fold($,$,$,$)},Cv=function(e){return e.fold(q("before"),q("start"),q("end"),q("after"))},xv=function(e){return e.fold(cv.before,cv.before,cv.after,cv.after)},wv=function(n,e,r,t,o,i){return Xa([uv.findRootInline(e,r,t),uv.findRootInline(e,r,o)],function(e,t){return e!==t&&uv.hasSameParentBlock(r,e,t)?cv.after(n?e:t):i}).getOr(i)},Nv=function(e,r){return e.fold(q(!0),function(e){return n=r,!(Cv(t=e)===Cv(n)&&yv(t)===yv(n));var t,n})},Ev=function(e,t){return e?t.fold(H(A.some,cv.start),A.none,H(A.some,cv.after),A.none):t.fold(A.none,H(A.some,cv.before),A.none,H(A.some,cv.end))},Sv=function(a,u,s,c){var e=uv.normalizePosition(a,c),l=bv(u,s,e);return bv(u,s,e).bind(d(Ev,a)).orThunk(function(){return t=a,n=u,r=s,o=l,e=c,i=uv.normalizePosition(t,e),oc.fromPosition(t,r,i).map(d(uv.normalizePosition,t)).fold(function(){return o.map(xv)},function(e){return bv(n,r,e).map(d(wv,t,n,r,i,e)).filter(d(Nv,o))}).filter(vv);var t,n,r,o,e,i})},kv=bv,Tv=Sv,Av=(d(Sv,!1),d(Sv,!0),xv),Rv=function(e){return e.fold(cv.start,cv.start,cv.end,cv.end)},Dv=function(e){return P(e.selection.getSel().modify)},Bv=function(e,t,n){var r=e?1:-1;return t.setRng(Cu(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},Ov=function(e,t){var n=t.selection.getRng(),r=e?Cu.fromRangeEnd(n):Cu.fromRangeStart(n);return!!Dv(t)&&(e&&xa(r)?Bv(!0,t.selection,r):!(e||!wa(r))&&Bv(!1,t.selection,r))},_v=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},Pv=function(e){return!1!==e.settings.inline_boundaries},Iv=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},Lv=function(t,e,n){return ov(e,n).map(function(e){return _v(t,e),n})},Mv=function(e,t,n){return function(){return!!Pv(t)&&Ov(e,t)}},Fv={move:function(a,u,s){return function(){return!!Pv(a)&&(t=a,n=u,e=s,r=t.getBody(),o=Cu.fromRangeStart(t.selection.getRng()),i=d(uv.isInlineTarget,t),Tv(e,i,r,o).bind(function(e){return Lv(t,n,e)})).isSome();var t,n,e,r,o,i}},moveNextWord:d(Mv,!0),movePrevWord:d(Mv,!1),setupSelectedState:function(a){var u=wi(null),s=d(uv.isInlineTarget,a);return a.on("NodeChange",function(e){var t,n,r,o,i;Pv(a)&&(t=s,n=a.dom,r=e.parents,o=U(n.select('*[data-mce-selected="inline-boundary"]'),t),i=U(r,t),F(Z(o,i),d(Iv,!1)),F(Z(i,o),d(Iv,!0)),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=Cu.fromRangeStart(e.selection.getRng());Cu.isTextPosition(n)&&!1===uv.isAtZwsp(n)&&(_v(e,Zu.removeAndReposition(t.get(),n)),t.set(null))}}(a,u),function(n,r,o,e){if(r.selection.isCollapsed()){var t=U(e,n);F(t,function(e){var t=Cu.fromRangeStart(r.selection.getRng());kv(n,r.getBody(),t).bind(function(e){return Lv(r,o,e)})})}}(s,a,u,e.parents))}),u},setCaretPosition:_v},Uv=Bo.isContentEditableFalse,zv=qa,Vv=Os,jv=Bs,Hv=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},qv=function(e,t,n,r){var o,i,a,u,s,c,l=e===bu.Forwards,f=l?jv:Vv;return!r.collapsed&&(o=zv(r),Uv(o))?lm(e,t,o,e===bu.Backwards,!0):(u=va(r.startContainer),f(i=Ds(e,t.getBody(),r))?fm(t,i.getNode(!l)):(i=n(i))?f(i)?lm(e,t,i.getNode(!l),l,!0):f(a=n(i))&&(!(c=Cs(s=i,a))&&Bo.isBr(s.getNode())||c)?lm(e,t,a.getNode(!l),l,!0):u?mm(t,i.toRange(),!0):null:u?r:null)},$v=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=zv(r),o=Ds(e,t.getBody(),r),i=n(t.getBody(),Jd(1),o),a=U(i,Qd(1)),s=qt.last(o.getClientRects()),(jv(o)||_s(o))&&(d=o.getNode()),(Vv(o)||Ps(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=om(a,c))&&Uv(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),lm(e,t,u.node,l<f,!0);if(d){var m=function(e,t,n,r){var o,i,a,u,s,c,l=Ys(t),f=[],d=0,m=function(e){return qt.last(e.getClientRects())};c=m(u=1===e?(o=l.next,i=Ha,a=ja,Cu.after(r)):(o=l.prev,i=ja,a=Ha,Cu.before(r)));do{if(u.isVisible()&&!a(s=m(u),c)){if(0<f.length&&i(s,qt.last(f))&&d++,(s=Ua(s)).position=u,s.line=d,n(s))return f;f.push(s)}}while(u=o(u));return f}(e,t.getBody(),Jd(1),d);if(u=om(U(m,Qd(1)),c))return mm(t,u.position.toRange(),!0);if(u=qt.last(U(m,Qd(0))))return mm(t,u.position.toRange(),!0)}},Wv=function(e,t,n){var r,o,i,a,u=Ys(e.getBody()),s=d(Hv,u.next),c=d(Hv,u.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?s(Cu.fromRangeStart(n)):c(Cu.fromRangeStart(n)))||(a=(i=e).dom.create(al(i)),(!de.ie||11<=de.ie)&&(a.innerHTML='<br data-mce-bogus="1">'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},Kv=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Ys((e=l).getBody()),o=d(Hv,r.next),i=d(Hv,r.prev),a=t?bu.Forwards:bu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=qv(a,e,u,s))?n:(n=Wv(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},Xv=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?Gd:Yd,i=(e=u).selection.getRng(),(n=$v(r,e,o,i))?n:(n=Wv(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}};(Xp=Kp||(Kp={}))[Xp.Br=0]="Br",Xp[Xp.Block=1]="Block",Xp[Xp.Wrap=2]="Wrap",Xp[Xp.Eol=3]="Eol";var Yv=function(e,t){return e===bu.Backwards?t.reverse():t},Gv=function(e,t,n,r){for(var o,i,a,u,s,c,l=Ys(n),f=r,d=[];f&&(s=l,c=f,o=t===bu.Forwards?s.next(c):s.prev(c));){if(Bo.isBr(o.getNode(!1)))return t===bu.Forwards?{positions:Yv(t,d).concat([o]),breakType:Kp.Br,breakAt:A.some(o)}:{positions:Yv(t,d),breakType:Kp.Br,breakAt:A.some(o)};if(o.isVisible()){if(e(f,o)){var m=(i=t,a=f,u=o,Bo.isBr(u.getNode(i===bu.Forwards))?Kp.Br:!1===Cs(a,u)?Kp.Block:Kp.Wrap);return{positions:Yv(t,d),breakType:m,breakAt:A.some(o)}}d.push(o),f=o}else f=o}return{positions:Yv(t,d),breakType:Kp.Eol,breakAt:A.none()}},Jv=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===bu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},Qv=function(e,i){return z(e,function(e,o){return e.fold(function(){return A.some(o)},function(r){return Xa([ee(r.getClientRects()),ee(o.getClientRects())],function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},A.none())},Zv=function(t,e){return ee(e.getClientRects()).bind(function(e){return Qv(t,e.left)})},eb=d(Gv,hu.isAbove,-1),tb=d(Gv,hu.isBelow,1),nb=d(Jv,-1,eb),rb=d(Jv,1,tb),ob=function(e,t,n,r,o){var i,a,u,s,c=$i(rr.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),l=U((i=e,G(c,function(e){var t,n,r=(t=Ua(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:i(r),cell:e},{x:r.right,y:i(r),cell:e}]})),function(e){return t(e,o)});return(a=l,u=r,s=o,z(a,function(e,r){return e.fold(function(){return A.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-u)+Math.abs(e.y-s)),n=Math.sqrt(Math.abs(r.x-u)+Math.abs(r.y-s));return A.some(n<t?r:e)})},A.none())).map(function(e){return e.cell})},ib=d(ob,function(e){return e.bottom},function(e,t){return e.y<t}),ab=d(ob,function(e){return e.top},function(e,t){return e.y>t}),ub=function(t,n){return ee(n.getClientRects()).bind(function(e){return ib(t,e.left,e.top)}).bind(function(e){return Zv((t=e,oc.lastPositionIn(t).map(function(e){return eb(t,e).positions.concat(e)}).getOr([])),n);var t})},sb=function(t,n){return te(n.getClientRects()).bind(function(e){return ab(t,e.left,e.top)}).bind(function(e){return Zv((t=e,oc.firstPositionIn(t).map(function(e){return[e].concat(tb(t,e).positions)}).getOr([])),n);var t})},cb=function(e,t){e.selection.setRng(t),th(e,t)},lb=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===Kp.Wrap&&0===a.positions.length||!Bo.isBr(n.getNode())&&(i=u).breakType===Kp.Br&&1===i.positions.length?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},fb=d(lb,eb),db=d(lb,tb),mb=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(os()&&(o=t,i=s,a=n,u=Cu.fromRangeStart(i),oc.positionIn(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=lm(c,e,n,!t,!0);return cb(e,l),!0}return!1},gb=function(e,t){var n=t.getNode(e);return Bo.isElement(n)&&"TABLE"===n.nodeName?A.some(n):A.none()},pb=function(u,s,c){var e=gb(!!s,c),t=!1===s;e.fold(function(){return cb(u,c.toRange())},function(a){return oc.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return cb(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=al(r=u))?r.undoManager.transact(function(){var e=rr.fromTag(i);yr(e,ul(r)),Bi(e,rr.fromTag("br")),n?Ri(rr.fromDom(o),e):Ai(rr.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),cb(r,t)}):cb(r,t.toRange()));var n,r,o,t,i})})},hb=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=Cu.fromRangeStart(l),d=e.getBody();if(t||!fb(r,f))return!(!t||!db(r,f))&&(o=d,m=sb(i=n,a=f).orThunk(function(){return ee(a.getClientRects()).bind(function(e){return Qv(rb(o,Cu.after(i)),e.left)})}).getOr(Cu.after(i)),pb(e,t,m),!0);var m=(u=d,ub(s=n,c=f).orThunk(function(){return ee(c.getClientRects()).bind(function(e){return Qv(nb(u,Cu.before(s)),e.left)})}).getOr(Cu.before(s)));return pb(e,t,m),!0},vb=function(t,n){return function(){return A.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return A.from(t.dom.getParent(e,"table")).map(function(e){return mb(t,n,e)})}).getOr(!1)}},bb=function(n,r){return function(){return A.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return A.from(n.dom.getParent(t,"table")).map(function(e){return hb(n,r,e,t)})}).getOr(!1)}},yb=function(e){return M(["figcaption"],ur(e))},Cb=function(e){var t=document.createRange();return t.setStartBefore(e.dom()),t.setEndBefore(e.dom()),t},xb=function(e,t,n){n?Bi(e,t):Di(e,t)},wb=function(e,t,n,r){return""===t?(l=e,f=r,d=rr.fromTag("br"),xb(l,d,f),Cb(d)):(o=e,i=r,a=t,u=n,s=rr.fromTag(a),c=rr.fromTag("br"),yr(s,u),Bi(s,c),xb(o,s,i),Cb(c));var o,i,a,u,s,c,l,f,d},Nb=function(e,t,n){return t?(o=e.dom(),tb(o,n).breakAt.isNone()):(r=e.dom(),eb(r,n).breakAt.isNone());var r,o},Eb=function(t,n){var e,r,o,i=rr.fromDom(t.getBody()),a=Cu.fromRangeStart(t.selection.getRng()),u=al(t),s=ul(t);return(e=a,r=i,o=d(Pr,r),Yi(rr.fromDom(e.container()),lo,o).filter(yb)).exists(function(){if(Nb(i,n,a)){var e=wb(i,u,s,n);return t.selection.setRng(e),!0}return!1})},Sb=function(e,t){return function(){return!!e.selection.isCollapsed()&&Eb(e,t)}},kb=function(e,r){return G(W(e,function(e){return jc({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:o},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},Tb=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,r)}},Ab=function(e,t){return V(kb(e,t),function(e){return e.action()})},Rb=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=tr.detect().os,Ab([{keyCode:pm.RIGHT,action:Kv(t,!0)},{keyCode:pm.LEFT,action:Kv(t,!1)},{keyCode:pm.UP,action:Xv(t,!1)},{keyCode:pm.DOWN,action:Xv(t,!0)},{keyCode:pm.RIGHT,action:vb(t,!0)},{keyCode:pm.LEFT,action:vb(t,!1)},{keyCode:pm.UP,action:bb(t,!1)},{keyCode:pm.DOWN,action:bb(t,!0)},{keyCode:pm.RIGHT,action:Fv.move(t,n,!0)},{keyCode:pm.LEFT,action:Fv.move(t,n,!1)},{keyCode:pm.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:Fv.moveNextWord(t,n)},{keyCode:pm.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:Fv.movePrevWord(t,n)},{keyCode:pm.UP,action:Sb(t,!1)},{keyCode:pm.DOWN,action:Sb(t,!0)}],r).each(function(e){r.preventDefault()}))})},Db=function(e,t){return Ir(e,t)?Yi(t,function(e){return go(e)||ho(e)},(n=e,function(e){return Pr(n,rr.fromDom(e.dom().parentNode))})):A.none();var n},Bb=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},Ob=function(i,a,u){return Xa([oc.firstPositionIn(u),oc.lastPositionIn(u)],function(e,t){var n=uv.normalizePosition(!0,e),r=uv.normalizePosition(!1,t),o=uv.normalizePosition(!1,a);return i?oc.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):oc.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},_b=Sr("block","position"),Pb=Sr("from","to"),Ib=function(e,t){var n=rr.fromDom(e),r=rr.fromDom(t.container());return Db(n,r).map(function(e){return _b(e,t)})},Lb=function(o,i,e){var t=Ib(o,Cu.fromRangeStart(e)),n=t.bind(function(e){return oc.fromPosition(i,o,e.position()).bind(function(e){return Ib(o,e).map(function(e){return t=o,n=i,r=e,Bo.isBr(r.position().getNode())&&!1===ag(r.block())?oc.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?oc.fromPosition(n,t,e).bind(function(e){return Ib(t,e)}):A.some(r)}).getOr(r):r;var t,n,r})})});return Xa([t,n],Pb).filter(function(e){return!1===Pr((r=e).from().block(),r.to().block())&&Mr((n=e).from().block()).bind(function(t){return Mr(n.to().block()).filter(function(e){return Pr(t,e)})}).isSome()&&(t=e,!1===Bo.isContentEditableFalse(t.from().block())&&!1===Bo.isContentEditableFalse(t.to().block()));var t,n,r})},Mb=function(e,t,n){return n.collapsed?Lb(e,t,n):A.none()},Fb=function(e){var t,n=(t=jr(e),j(t,lo).fold(function(){return t},function(e){return t.slice(0,e)}));return F(n,Pi),n},Ub=function(e,t){var n=wd(t,e);return V(n.reverse(),ag).each(Pi)},zb=function(e,t,n,r){if(ag(n))return jm(n),oc.firstPositionIn(n.dom());0===U(zr(r),function(e){return!ag(e)}).length&&ag(t)&&Ai(r,rr.fromTag("br"));var o=oc.prevPosition(n.dom(),Cu.before(r.dom()));return F(Fb(t),function(e){Ai(r,e)}),Ub(e,t),o},Vb=function(e,t,n){if(ag(n))return Pi(n),ag(t)&&jm(t),oc.firstPositionIn(t.dom());var r=oc.lastPositionIn(n.dom());return F(Fb(t),function(e){Bi(n,e)}),Ub(e,t),r},jb=function(e,t){return Ir(t,e)?(n=wd(e,t),A.from(n[n.length-1])):A.none();var n},Hb=function(e,t){oc.positionIn(e,t.dom()).map(function(e){return e.getNode()}).map(rr.fromDom).filter(mo).each(Pi)},qb=function(e,t,n){return Hb(!0,t),Hb(!1,n),jb(t,n).fold(d(Vb,e,t,n),d(zb,e,t,n))},$b=function(e,t,n,r){return t?qb(e,r,n):qb(e,n,r)},Wb=function(t,n){var e,r=rr.fromDom(t.getBody());return(e=Mb(r.dom(),n,t.selection.getRng()).bind(function(e){return $b(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},Kb=function(e,t){var n=rr.fromDom(t),r=d(Pr,e);return Xi(n,yo,r).isSome()},Xb=function(e,t){var n,r,o=oc.prevPosition(e.dom(),Cu.fromRangeStart(t)).isNone(),i=oc.nextPosition(e.dom(),Cu.fromRangeEnd(t)).isNone();return!(Kb(n=e,(r=t).startContainer)||Kb(n,r.endContainer))&&o&&i},Yb=function(e){var n,r,o,t,i=rr.fromDom(e.getBody()),a=e.selection.getRng();return Xb(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),Xa([Db(n,rr.fromDom(o.startContainer)),Db(n,rr.fromDom(o.endContainer))],function(e,t){return!1===Pr(e,t)&&(o.deleteContents(),$b(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},Gb=function(e,t){return!e.selection.isCollapsed()&&Yb(e)},Jb=function(e){return Fs(e).exists(mo)},Qb=function(e,t,n){var r=U(wd(rr.fromDom(n.container()),t),lo),o=ee(r).getOr(t);return oc.fromPosition(e,o.dom(),n).filter(Jb)},Zb=function(e,t){return Fs(t).exists(mo)||Qb(!0,e,t).isSome()},ey=function(e,t){return(n=t,A.from(n.getNode(!0)).map(rr.fromDom)).exists(mo)||Qb(!1,e,t).isSome();var n},ty=d(Qb,!1),ny=d(Qb,!0),ry=Ll([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),oy=function(e,t,n,r){var o=r.getNode(!1===t);return Db(rr.fromDom(e),rr.fromDom(n.getNode())).map(function(e){return ag(e)?ry.remove(e.dom()):ry.moveToElement(o)}).orThunk(function(){return A.some(ry.moveToElement(o))})},iy=function(u,s,c){return oc.fromPosition(s,u,c).bind(function(e){return a=e.getNode(),yo(rr.fromDom(a))||ho(rr.fromDom(a))?A.none():(t=u,o=e,i=function(e){return fo(rr.fromDom(e))&&!Cs(r,o,t)},Rs(!(n=s),r=c).fold(function(){return Rs(n,o).fold(q(!1),i)},i)?A.none():s&&Bo.isContentEditableFalse(e.getNode())?oy(u,s,c,e):!1===s&&Bo.isContentEditableFalse(e.getNode(!0))?oy(u,s,c,e):s&&Os(c)?A.some(ry.moveToPosition(e)):!1===s&&Bs(c)?A.some(ry.moveToPosition(e)):A.none());var t,n,r,o,i,a})},ay=function(r,e,o){return i=e,a=o.getNode(!1===i),u=i?"after":"before",Bo.isElement(a)&&a.getAttribute("data-mce-caret")===u?(t=e,n=o.getNode(!1===e),t&&Bo.isContentEditableFalse(n.nextSibling)?A.some(ry.moveToElement(n.nextSibling)):!1===t&&Bo.isContentEditableFalse(n.previousSibling)?A.some(ry.moveToElement(n.previousSibling)):A.none()).fold(function(){return iy(r,e,o)},A.some):iy(r,e,o).bind(function(e){return t=r,n=o,e.fold(function(e){return A.some(ry.remove(e))},function(e){return A.some(ry.moveToElement(e))},function(e){return Cs(n,e,t)?A.none():A.some(ry.moveToPosition(e))});var t,n});var t,n,i,a,u},uy=function(a,u){var e,t,n,r,o,i;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=ks(t?1:-1,e,n),o=Cu.fromRangeStart(r),i=rr.fromDom(e),!1===t&&Os(o)?A.some(ry.remove(o.getNode(!0))):t&&Bs(o)?A.some(ry.remove(o.getNode())):!1===t&&Bs(o)&&ey(i,o)?ty(i,o).map(function(e){return ry.remove(e.getNode())}):t&&Os(o)&&Zb(i,o)?ny(i,o).map(function(e){return ry.remove(e.getNode())}):ay(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),vg(o,i,rr.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?Cu.before(e):Cu.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},sy=function(e,t){var n,r=e.selection.getNode();return!!Bo.isContentEditableFalse(r)&&(n=rr.fromDom(e.getBody()),F($i(n,".mce-offscreen-selection"),Pi),vg(e,t,rr.fromDom(e.selection.getNode())),Bb(e),!0)},cy=function(e,t){return e.selection.isCollapsed()?uy(e,t):sy(e,t)},ly=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(Bo.isContentEditableTrue(t)||Bo.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return Bo.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(Cu.before(t).toRange())),!0},fy=function(t,n){return function(e){return ov(n,e).map(function(e){return Fv.setCaretPosition(t,e),!0}).getOr(!1)}},dy=function(r,o,i,a){var u=r.getBody(),s=d(uv.isInlineTarget,r);r.undoManager.ignore(function(){var e,t,n;r.selection.setRng((e=i,t=a,(n=document.createRange()).setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n)),r.execCommand("Delete"),kv(s,u,Cu.fromRangeStart(r.selection.getRng())).map(Rv).map(fy(r,o))}),r.nodeChanged()},my=function(n,r,i,o){var e,t,a=(e=n.getBody(),t=o.container(),ys(t,e)||e),u=d(uv.isInlineTarget,n),s=kv(u,a,o);return s.bind(function(e){return i?e.fold(q(A.some(Rv(e))),A.none,q(A.some(Av(e))),A.none):e.fold(A.none,q(A.some(Av(e))),A.none,q(A.some(Rv(e))))}).map(fy(n,r)).getOrThunk(function(){var t=oc.navigate(i,a,o),e=t.bind(function(e){return kv(u,a,e)});return s.isSome()&&e.isSome()?uv.findRootInline(u,a,o).map(function(e){return o=e,!!Xa([oc.firstPositionIn(o),oc.lastPositionIn(o)],function(e,t){var n=uv.normalizePosition(!0,e),r=uv.normalizePosition(!1,t);return oc.nextPosition(o,n).map(function(e){return e.isEqual(r)}).getOr(!0)}).getOr(!0)&&(vg(n,i,rr.fromDom(e)),!0);var o}).getOr(!1):e.bind(function(e){return t.map(function(e){return i?dy(n,r,o,e):dy(n,r,e,o),!0})}).getOr(!1)})},gy=function(e,t,n){if(e.selection.isCollapsed()&&!1!==e.settings.inline_boundaries){var r=Cu.fromRangeStart(e.selection.getRng());return my(e,t,n,r)}return!1},py=function(e){return 1===jr(e).length},hy=function(e,t,n,r){var o,i,a,u,s=d(Rg,t),c=W(U(r,s),function(e){return e.dom()});if(0===c.length)vg(t,e,n);else{var l=(o=n.dom(),i=c,a=wg(!1),u=Tg(i,a.dom()),Ai(rr.fromDom(o),a),Pi(rr.fromDom(o)),Cu(u,0));t.selection.setRng(l.toRange())}},vy=function(r,o){var t,e=rr.fromDom(r.getBody()),n=rr.fromDom(r.selection.getStart()),i=U((t=wd(n,e),j(t,lo).fold(q(t),function(e){return t.slice(0,e)})),py);return te(i).map(function(e){var t,n=Cu.fromRangeStart(r.selection.getRng());return!(!Ob(o,n,e.dom())||ju((t=e).dom())&&Cg(t.dom())||(hy(o,r,e,i),0))}).getOr(!1)},by=function(e,t){return!!e.selection.isCollapsed()&&vy(e,t)},yy=Sr("start","end"),Cy=Sr("rng","table","cells"),xy=Ll([{removeTable:["element"]},{emptyCells:["cells"]}]),wy=function(e,t){return Qi(rr.fromDom(e),"td,th",t)},Ny=function(e,t){return Gi(e,"table",t)},Ey=function(e){return!1===Pr(e.start(),e.end())},Sy=function(e,n){return Ny(e.start(),n).bind(function(t){return Ny(e.end(),n).bind(function(e){return Pr(t,e)?A.some(t):A.none()})})},ky=function(e){return $i(e,"td,th")},Ty=function(r,e){var t=wy(e.startContainer,r),n=wy(e.endContainer,r);return e.collapsed?A.none():Xa([t,n],yy).fold(function(){return t.fold(function(){return n.bind(function(t){return Ny(t,r).bind(function(e){return ee(ky(e)).map(function(e){return yy(e,t)})})})},function(t){return Ny(t,r).bind(function(e){return te(ky(e)).map(function(e){return yy(t,e)})})})},function(e){return Ay(r,e)?A.none():(n=r,Ny((t=e).start(),n).bind(function(e){return te(ky(e)).map(function(e){return yy(t.start(),e)})}));var t,n})},Ay=function(e,t){return Sy(t,e).isSome()},Ry=function(e,t){var n,r,o,i,a=d(Pr,e);return(n=t,r=a,o=wy(n.startContainer,r),i=wy(n.endContainer,r),Xa([o,i],yy).filter(Ey).filter(function(e){return Ay(r,e)}).orThunk(function(){return Ty(r,n)})).bind(function(e){return Sy(t=e,a).map(function(e){return Cy(t,e,ky(e))});var t})},Dy=function(e,t){return j(e,function(e){return Pr(e,t)})},By=function(n){return(r=n,Xa([Dy(r.cells(),r.rng().start()),Dy(r.cells(),r.rng().end())],function(e,t){return r.cells().slice(e,t+1)})).map(function(e){var t=n.cells();return e.length===t.length?xy.removeTable(n.table()):xy.emptyCells(e)});var r},Oy=function(e,t){return Ry(e,t).bind(By)},_y=function(e,t){return F(t,jm),e.selection.setCursorLocation(t[0].dom(),0),!0},Py=function(e,t){return vg(e,!1,t),!0},Iy=function(n,e,r,t){return My(e,t).fold(function(){return t=n,Oy(e,r).map(function(e){return e.fold(d(Py,t),d(_y,t))});var t},function(e){return Fy(n,e)}).getOr(!1)},Ly=function(e,t){return V(wd(t,e),yo)},My=function(e,t){return V(wd(t,e),function(e){return"caption"===ur(e)})},Fy=function(e,t){return jm(t),e.selection.setCursorLocation(t.dom(),0),A.some(!0)},Uy=function(u,s,c,l,f){return oc.navigate(c,u.getBody(),f).bind(function(e){return r=l,o=c,i=f,a=e,oc.firstPositionIn(r.dom()).bind(function(t){return oc.lastPositionIn(r.dom()).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?Fy(u,l):(t=l,n=e,My(s,rr.fromDom(n.getNode())).map(function(e){return!1===Pr(e,t)}));var t,n,r,o,i,a}).or(A.some(!0))},zy=function(a,u,s,e){var c=Cu.fromRangeStart(a.selection.getRng());return Ly(s,e).bind(function(e){return ag(e)?Fy(a,e):(t=a,n=s,r=u,o=e,i=c,oc.navigate(r,t.getBody(),i).bind(function(e){return Ly(n,rr.fromDom(e.getNode())).map(function(e){return!1===Pr(e,o)})}));var t,n,r,o,i})},Vy=function(a,u,e){var s=rr.fromDom(a.getBody());return My(s,e).fold(function(){return zy(a,u,s,e)},function(e){return t=a,n=u,r=s,o=e,i=Cu.fromRangeStart(t.selection.getRng()),ag(o)?Fy(t,o):Uy(t,r,n,o,i);var t,n,r,o,i}).getOr(!1)},jy=function(e,t){var n,r,o,i,a,u=rr.fromDom(e.selection.getStart(!0)),s=Eh(e);return e.selection.isCollapsed()&&0===s.length?Vy(e,t,u):(n=e,r=u,o=rr.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=Eh(n)).length?_y(n,a):Iy(n,o,i,r))},Hy=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,Ab([{keyCode:pm.BACKSPACE,action:Tb(cy,t,!1)},{keyCode:pm.DELETE,action:Tb(cy,t,!0)},{keyCode:pm.BACKSPACE,action:Tb(gy,t,n,!1)},{keyCode:pm.DELETE,action:Tb(gy,t,n,!0)},{keyCode:pm.BACKSPACE,action:Tb(jy,t,!1)},{keyCode:pm.DELETE,action:Tb(jy,t,!0)},{keyCode:pm.BACKSPACE,action:Tb(Gb,t,!1)},{keyCode:pm.DELETE,action:Tb(Gb,t,!0)},{keyCode:pm.BACKSPACE,action:Tb(Wb,t,!1)},{keyCode:pm.DELETE,action:Tb(Wb,t,!0)},{keyCode:pm.BACKSPACE,action:Tb(by,t,!1)},{keyCode:pm.DELETE,action:Tb(by,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,Ab([{keyCode:pm.BACKSPACE,action:Tb(ly,t)},{keyCode:pm.DELETE,action:Tb(ly,t)}],n))})},qy=function(e){return A.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},$y=function(e,t){var n,r,o,i=t,a=e.dom,u=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var s=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);s&&/^(UL|OL|DL)$/.test(s.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(o=a.createRng(),t.normalize(),t.hasChildNodes()){for(n=new oo(t,t);r=n.current();){if(Bo.isText(r)){o.setStart(r,0),o.setEnd(r,0);break}if(u[r.nodeName.toLowerCase()]){o.setStartBefore(r),o.setEndBefore(r);break}i=r,r=n.next()}r||(o.setStart(i,0),o.setEnd(i,0))}else Bo.isBr(t)?t.nextSibling&&a.isBlock(t.nextSibling)?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)):(o.setStart(t,0),o.setEnd(t,0));e.selection.setRng(o),a.remove(void 0),e.selection.scrollIntoView(t)}},Wy=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},Ky=qy,Xy=function(e){return qy(e).fold(q(""),function(e){return e.nodeName.toUpperCase()})},Yy=function(e){return qy(e).filter(function(e){return ho(rr.fromDom(e))}).isSome()},Gy=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},Jy=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},Qy=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},Zy=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Bo.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},eC=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;Jy(u=n)&&Jy(u.parentNode)&&(o="LI");var s,c,l=o?t(o):i.create("BR");if(Zy(n,r,!0)&&Zy(n,r,!1))Gy(n,"LI")?i.insertAfter(l,Qy(n)):i.replace(l,n);else if(Zy(n,r,!0))Gy(n,"LI")?(i.insertAfter(l,Qy(n)),l.appendChild(i.doc.createTextNode(" ")),l.appendChild(n)):n.parentNode.insertBefore(l,n);else if(Zy(n,r,!1))i.insertAfter(l,Qy(n));else{n=Qy(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var d=f.extractContents();"LI"===o&&(c="LI",(s=d).firstChild&&s.firstChild.nodeName===c)?(l=d.firstChild,i.insertAfter(d,n)):(i.insertAfter(d,n),i.insertAfter(l,n))}i.remove(r),$y(e,l)}},tC=function(e){e.innerHTML='<br data-mce-bogus="1">'},nC=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},rC=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},oC=function(e,t,n){return!1===Bo.isText(t)?n:e?1===n&&t.data.charAt(n-1)===ma?0:n:n===t.data.length-1&&t.data.charAt(n)===ma?t.data.length:n},iC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},aC=function(e,t){var n=al(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&e.dom.setAttribs(t,ul(e))},uC=function(a,e){var t,u,s,i,c,n,r,o,l,f,d,m,g,p=a.dom,h=a.schema,v=h.getNonEmptyElements(),b=a.selection.getRng(),y=function(e){var t,n,r,o=s,i=h.getTextInlineElements();if(e||"TABLE"===f||"HR"===f?(t=p.create(e||m),aC(a,t)):t=c.cloneNode(!1),r=t,!1===ll(a))p.setAttrib(t,"style",null),p.setAttrib(t,"class",null);else do{if(i[o.nodeName]){if(ju(o))continue;n=o.cloneNode(!1),p.setAttrib(n,"id",""),t.hasChildNodes()?n.appendChild(t.firstChild):r=n,t.appendChild(n)}}while((o=o.parentNode)&&o!==u);return tC(r),t},C=function(e){var t,n,r,o;if(o=oC(e,s,i),Bo.isText(s)&&(e?0<o:o<s.nodeValue.length))return!1;if(s.parentNode===c&&g&&!e)return!0;if(e&&Bo.isElement(s)&&s===c.firstChild)return!0;if(nC(s,"TABLE")||nC(s,"HR"))return g&&!e||!g&&e;for(t=new oo(s,c),Bo.isText(s)&&(e&&0===o?t.prev():e||o!==s.nodeValue.length||t.next());n=t.current();){if(Bo.isElement(n)){if(!n.getAttribute("data-mce-bogus")&&(r=n.nodeName.toLowerCase(),v[r]&&"br"!==r))return!1}else if(Bo.isText(n)&&!/^[ \t\r\n]*$/.test(n.nodeValue))return!1;e?t.prev():t.next()}return!0},x=function(){r=/^(H[1-6]|PRE|FIGURE)$/.test(f)&&"HGROUP"!==d?y(m):y(),fl(a)&&rC(p,l)&&p.isEmpty(c)?r=p.split(l,c):p.insertAfter(r,c),$y(a,r)};Fh(p,b).each(function(e){b.setStart(e.startContainer,e.startOffset),b.setEnd(e.endContainer,e.endOffset)}),s=b.startContainer,i=b.startOffset,m=al(a),n=!(!e||!e.shiftKey);var w,N,E,S,k,T,A=!(!e||!e.ctrlKey);Bo.isElement(s)&&s.hasChildNodes()&&(g=i>s.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=g&&Bo.isText(s)?s.nodeValue.length:0),(u=iC(p,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,g=iC(m,r);if(!(a=m.getParent(r,m.isBlock))||!rC(m,a)){if(l=(a=a||g)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),aC(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),aC(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,b,s,i)),c=p.getParent(s,p.isBlock),l=c?p.getParent(c.parentNode,p.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||A||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&p.isEmpty(c)?eC(a,y,l,c,m):m&&c===a.getBody()||(m=m||"P",va(c)?(r=ka(c),p.isEmpty(c)&&tC(c),$y(a,r)):C()?x():C(!0)?(r=c.parentNode.insertBefore(y(),c),$y(a,nC(c,"HR")?r:c)):((t=(k=b,T=k.cloneRange(),T.setStart(k.startContainer,oC(!0,k.startContainer,k.startOffset)),T.setEnd(k.endContainer,oC(!1,k.endContainer,k.endOffset)),T).cloneRange()).setEndAfter(c),o=t.extractContents(),S=o,F(qi(rr.fromDom(S),lr),function(e){var t=e.dom();t.nodeValue=ga(t.nodeValue)}),function(e){for(;Bo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o),r=o.firstChild,p.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Bo.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=e,(u=o)&&"A"===u.nodeName&&a.isEmpty(u)&&e.remove(o));var a,u}}(p,v,r),w=p,(N=c).normalize(),(E=N.lastChild)&&!/^(left|right)$/gi.test(w.getStyle(E,"float",!0))||w.add(N,"br"),p.isEmpty(c)&&tC(c),r.normalize(),p.isEmpty(r)?(p.remove(r),x()):$y(a,r)),p.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},sC=function(e,t,n){var r=e.create("span",{},"&nbsp;");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},cC=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},lC=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();Fh(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u=a.startOffset,s=a.startContainer;if(1===s.nodeType&&s.hasChildNodes()){var c=u>s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new oo(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0<r.length)return!0}(e.schema,s,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),a.insertNode(n),sC(i,o,n),cC(i,o,n,r),e.undoManager.add()},fC=function(e,t){var n=rr.fromTag("br");Ai(rr.fromDom(t),n),e.undoManager.add()},dC=function(e,t){mC(e.getBody(),t)||Ri(rr.fromDom(t),rr.fromTag("br"));var n=rr.fromTag("br");Ri(rr.fromDom(t),n),sC(e.dom,e.selection,n.dom()),cC(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},mC=function(e,t){return n=Cu.after(t),!!Bo.isBr(n.getNode())||oc.nextPosition(e,Cu.after(t)).map(function(e){return Bo.isBr(e.getNode())}).getOr(!1);var n},gC=function(e){return e&&"A"===e.nodeName&&"href"in e},pC=function(e){return e.fold(q(!1),gC,gC,q(!1))},hC=function(e,t){t.fold(o,d(fC,e),d(dC,e),o)},vC=function(e,t){var n,r,o,i=(n=e,r=d(uv.isInlineTarget,n),o=Cu.fromRangeStart(n.selection.getRng()),kv(r,n.getBody(),o).filter(pC));i.isSome()?i.each(d(hC,e)):lC(e,t)},bC=function(e,t){return Ky(e).filter(function(e){return 0<t.length&&Or(rr.fromDom(e),t)}).isSome()},yC=function(e){return bC(e,sl(e))},CC=function(e){return bC(e,cl(e))},xC=Ll([{br:[]},{block:[]},{none:[]}]),wC=function(e,t){return CC(e)},NC=function(n){return function(e,t){return""===al(e)===n}},EC=function(n){return function(e,t){return Yy(e)===n}},SC=function(n,r){return function(e,t){return Xy(e)===n.toUpperCase()===r}},kC=function(e){return SC("pre",e)},TC=function(n){return function(e,t){return il(e)===n}},AC=function(e,t){return yC(e)},RC=function(e,t){return t},DC=function(e){var t=al(e),n=Wy(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},BC=function(e,t){return function(n,r){return z(e,function(e,t){return e&&t(n,r)},!0)?A.some(t):A.none()}},OC=function(e,t){return sv([BC([wC],xC.none()),BC([SC("summary",!0)],xC.br()),BC([kC(!0),TC(!1),RC],xC.br()),BC([kC(!0),TC(!1)],xC.block()),BC([kC(!0),TC(!0),RC],xC.block()),BC([kC(!0),TC(!0)],xC.br()),BC([EC(!0),RC],xC.br()),BC([EC(!0)],xC.block()),BC([NC(!0),RC,DC],xC.block()),BC([NC(!0)],xC.br()),BC([AC],xC.br()),BC([NC(!1),RC],xC.br()),BC([DC],xC.block())],[e,!(!t||!t.shiftKey)]).getOr(xC.none())},_C=function(e,t){OC(e,t).fold(function(){vC(e,t)},function(){uC(e,t)},o)},PC=function(o){o.on("keydown",function(e){var t,n,r;e.keyCode===pm.ENTER&&(t=o,(n=e).isDefaultPrevented()||(n.preventDefault(),(r=t.undoManager).typing&&(r.typing=!1,r.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),_C(t,n)})))})},IC=function(n,r){var e=r.container(),t=r.offset();return Bo.isText(e)?(e.insertData(t,n),A.some(hu(e,t+n.length))):Fs(r).map(function(e){var t=rr.fromText(n);return r.isAtEnd()?Ri(e,t):Ai(e,t),hu(t.dom(),n.length)})},LC=d(IC,"\xa0"),MC=d(IC," "),FC=function(t,n,r){var e=U(wd(rr.fromDom(r.container()),n),lo);return ee(e).fold(function(){return oc.navigate(t,n.dom(),r).forall(function(e){return!1===Cs(e,r,n.dom())})},function(e){return oc.navigate(t,e.dom(),r).isNone()})},UC=d(FC,!1),zC=d(FC,!0),VC=function(e){return hu.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},jC=function(e,t){var n=U(wd(rr.fromDom(t.container()),e),lo);return ee(n).getOr(e)},HC=function(e,t){return VC(t)?Ms(t):Ms(t)||oc.prevPosition(jC(e,t).dom(),t).exists(Ms)},qC=function(e,t){return VC(t)?Ls(t):Ls(t)||oc.nextPosition(jC(e,t).dom(),t).exists(Ls)},$C=function(e){return Fs(e).bind(function(e){return Yi(e,cr)}).exists(function(e){return t=wr(e,"white-space"),M(["pre","pre-line","pre-wrap"],t);var t})},WC=function(e,t){return o=e,i=t,oc.prevPosition(o.dom(),i).isNone()||(n=e,r=t,oc.nextPosition(n.dom(),r).isNone())||UC(e,t)||zC(e,t)||ey(e,t)||Zb(e,t);var n,r,o,i},KC=function(e,t){return as(e.charAt(t))},XC=function(e){var t=e.container();return Bo.isText(t)&&Wn(t.data,"\xa0")},YC=function(e,t,n){var r,o,i=hu(t,0);return KC(n,0)&&(r=e,$C(o=i)||!(UC(r,o)||ey(r,o)||HC(r,o)))?" "+n.slice(1):n},GC=function(e,t,n){var r,o,i=hu(t,n.length);return KC(n,n.length-1)&&(r=e,$C(o=i)||!(zC(r,o)||Zb(r,o)||qC(r,o)))?n.slice(0,-1)+" ":n},JC=function(i,e){return A.some(e).filter(XC).bind(function(e){var t,n=e.container(),r=n.nodeValue,o=YC(i,n,(t=GC(i,n,r),W(t.split(""),function(e,t,n){return as(e)&&0<t&&t<n.length-1&&ss(n[t-1])&&ss(n[t+1])?" ":e}).join("")));return r!==o?(e.container().nodeValue=o,A.some(e)):A.none()})},QC=function(t){var e=rr.fromDom(t.getBody());t.selection.isCollapsed()&&JC(e,hu.fromRangeStart(t.selection.getRng())).each(function(e){t.selection.setRng(e.toRange())})},ZC=function(r,o){return function(e){return t=r,!$C(n=e)&&(WC(t,n)||HC(t,n)||qC(t,n))?LC(o):MC(o);var t,n}},ex=function(e){var t,n,r=Cu.fromRangeStart(e.selection.getRng()),o=rr.fromDom(e.getBody());if(e.selection.isCollapsed()){var i=d(uv.isInlineTarget,e),a=Cu.fromRangeStart(e.selection.getRng());return kv(i,e.getBody(),a).bind((n=o,function(e){return e.fold(function(e){return oc.prevPosition(n.dom(),Cu.before(e))},function(e){return oc.firstPositionIn(e)},function(e){return oc.lastPositionIn(e)},function(e){return oc.nextPosition(n.dom(),Cu.after(e))})})).bind(ZC(o,r)).exists((t=e,function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}))}return!1},tx=function(r){r.on("keydown",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=r,n=e,Ab([{keyCode:pm.SPACEBAR,action:Tb(ex,t)}],n).each(function(e){n.preventDefault()}))})},nx=function(e,t){var n;t.hasAttribute("data-mce-caret")&&(ka(t),(n=e).selection.setRng(n.selection.getRng()),e.selection.scrollIntoView(t))},rx=function(e,t){var n,r=(n=e,Ji(rr.fromDom(n.getBody()),"*[data-mce-caret]").fold(q(null),function(e){return e.dom()}));if(r)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void nx(e,r)):void(Ca(r)&&(nx(e,r),e.undoManager.add()))},ox=function(e){e.on("keyup compositionstart",d(rx,e))},ix=tr.detect().browser,ax=function(t){var e,n;e=t,n=Li(function(){e.composing||QC(e)},0),ix.isIE()&&(e.on("keypress",function(e){n.throttle()}),e.on("remove",function(e){n.cancel()})),t.on("input",function(e){!1===e.isComposing&&QC(t)})},ux=function(e){var t=Fv.setupSelectedState(e);ox(e),Rb(e,t),Hy(e,t),PC(e),tx(e),ax(e)};function sx(u){var s,n,r,o=Yt.each,c=pm.BACKSPACE,l=pm.DELETE,f=u.dom,d=u.selection,e=u.settings,t=u.parser,i=de.gecko,a=de.ie,m=de.webkit,g="data:text/mce-internal,",p=a?"Text":"URL",h=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},v=function(e){return e.isDefaultPrevented()},b=function(){u.shortcuts.add("meta+a",null,"SelectAll")},y=function(){u.on("keydown",function(e){if(!v(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11<de.ie)return void u.getBody().focus();t=u.selection.getRng(),u.getBody().focus(),u.selection.setRng(t),u.selection.normalize(),u.nodeChanged()}}))};return u.on("keydown",function(e){var t,n,r,o,i;if(!v(e)&&e.keyCode===pm.BACKSPACE&&(n=(t=d.getRng()).startContainer,r=t.startOffset,o=f.getRoot(),i=n,t.collapsed&&0===r)){for(;i&&i.parentNode&&i.parentNode.firstChild===i&&i.parentNode!==o;)i=i.parentNode;"BLOCKQUOTE"===i.tagName&&(u.formatter.toggle("blockquote",null,i),(t=f.createRng()).setStart(n,0),t.setEnd(n,0),d.setRng(t))}}),s=function(e){var t=f.create("body"),n=e.cloneContents();return t.appendChild(n),d.serializer.serialize(t,{format:"html"})},u.on("keydown",function(e){var t,n,r,o,i,a=e.keyCode;if(!v(e)&&(a===l||a===c)){if(t=u.selection.isCollapsed(),n=u.getBody(),t&&!f.isEmpty(n))return;if(!t&&(r=u.selection.getRng(),o=s(r),(i=f.createRng()).selectNode(u.getBody()),o!==s(i)))return;e.preventDefault(),u.setContent(""),n.firstChild&&f.isBlock(n.firstChild)?u.selection.setCursorLocation(n.firstChild,0):u.selection.setCursorLocation(n,0),u.nodeChanged()}}),de.windowsPhone||u.on("keyup focusin mouseup",function(e){pm.modifierPressed(e)||d.normalize()},!0),m&&(u.inline||f.bind(u.getDoc(),"mousedown mouseup",function(e){var t;if(e.target===u.getDoc().documentElement)if(t=d.getRng(),u.getBody().focus(),"mousedown"===e.type){if(ya(t.startContainer))return;d.placeCaretAt(e.clientX,e.clientY)}else d.setRng(t)}),u.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==f.getContentEditableParent(t)&&(e.preventDefault(),u.selection.select(t),u.nodeChanged()),"A"===t.nodeName&&f.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),d.select(t))}),e.forced_root_block&&u.on("init",function(){h("DefaultParagraphSeparator",al(u))}),u.on("init",function(){u.dom.bind(u.getBody(),"submit",function(e){e.preventDefault()})}),y(),t.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),de.iOS?(u.inline||u.on("keydown",function(){document.activeElement===document.body&&u.getWin().focus()}),C(),u.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),u.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):b()),11<=de.ie&&(C(),y()),de.ie&&(b(),h("AutoUrlDetect",!1),u.on("dragstart",function(e){var t,n,r;(t=e).dataTransfer&&(u.selection.isCollapsed()&&"IMG"===t.target.tagName&&d.select(t.target),0<(n=u.selection.getContent()).length&&(r=g+escape(u.id)+","+escape(n),t.dataTransfer.setData(p,r)))}),u.on("drop",function(e){if(!v(e)){var t=(i=e).dataTransfer&&(a=i.dataTransfer.getData(p))&&0<=a.indexOf(g)?(a=a.substr(g.length).split(","),{id:unescape(a[0]),html:unescape(a[1])}):null;if(t&&t.id!==u.id){e.preventDefault();var n=rh(e.x,e.y,u.getDoc());d.setRng(n),r=t.html,o=!0,u.queryCommandSupported("mceInsertClipboardContent")?u.execCommand("mceInsertClipboardContent",!1,{content:r,internal:o}):u.execCommand("mceInsertContent",!1,r)}}var r,o,i,a})),i&&(u.on("keydown",function(e){if(!v(e)&&e.keyCode===c){if(!u.getBody().getElementsByTagName("hr").length)return;if(d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode(),n=t.previousSibling;if("HR"===t.nodeName)return f.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(f.remove(n),e.preventDefault())}}}),Range.prototype.getClientRects||u.on("mousedown",function(e){if(!v(e)&&"HTML"===e.target.nodeName){var t=u.getBody();t.blur(),ve.setEditorTimeout(u,function(){t.focus()})}}),n=function(){var e=f.getAttribs(d.getStart().cloneNode(!1));return function(){var t=d.getStart();t!==u.getBody()&&(f.setAttrib(t,"style",null),o(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!d.isCollapsed()&&f.getParent(d.getStart(),f.isBlock)!==f.getParent(d.getEnd(),f.isBlock)},u.on("keypress",function(e){var t;if(!v(e)&&(8===e.keyCode||46===e.keyCode)&&r())return t=n(),u.getDoc().execCommand("delete",!1,null),t(),e.preventDefault(),!1}),f.bind(u.getDoc(),"cut",function(e){var t;!v(e)&&r()&&(t=n(),ve.setEditorTimeout(u,function(){t()}))}),e.readonly||u.on("BeforeExecCommand MouseDown",function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),e.object_resizing||h("enableObjectResizing",!1)}),u.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||o(f.select("a"),function(e){var t=e.parentNode,n=f.getRoot();if(t.lastChild===e){for(;t&&!f.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}f.add(t,"br",{"data-mce-bogus":1})}})}),u.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),de.mac&&u.on("keydown",function(e){!pm.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),u.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}),y()),{refreshContentEditable:function(){},isHidden:function(){var e;return!i||u.removed?0:!(e=u.selection.getSel())||!e.rangeCount||0===e.rangeCount}}}var cx=function(e){return Bo.isElement(e)&&go(rr.fromDom(e))},lx=function(t){t.on("click",function(e){3<=e.detail&&function(e){var t=e.selection.getRng(),n=hu.fromRangeStart(t),r=hu.fromRangeEnd(t);if(hu.isElementPosition(n)){var o=n.container();cx(o)&&oc.firstPositionIn(o).each(function(e){return t.setStart(e.container(),e.offset())})}hu.isElementPosition(r)&&(o=n.container(),cx(o)&&oc.lastPositionIn(o).each(function(e){return t.setEnd(e.container(),e.offset())})),e.selection.setRng(cp(t))}(t)})},fx=function(e){var t,n;(t=e).on("click",function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}),(n=e).parser.addNodeFilter("details",function(e){F(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),n.serializer.addNodeFilter("details",function(e){F(e,function(e){var t=e.attr("data-mce-open");e.attr("open",R(t)?t:null),e.attr("data-mce-open",null)})})},dx=pi.DOM,mx=function(e){var t;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("init"),e.focus(!0),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&ve.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)},gx=function(t,e){var n,r,u,o,i,a,s,c,l,f=t.settings,d=t.getElement(),m=t.getDoc();f.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(m.open(),m.write(t.iframeHTML),m.close()),t.inline&&(t.on("remove",function(){var e=this.getBody();dx.removeClass(e,"mce-content-body"),dx.removeClass(e,"mce-edit-focus"),dx.setAttrib(e,"contentEditable",null)}),dx.addClass(d,"mce-content-body"),t.contentDocument=m=f.content_document||document,t.contentWindow=f.content_window||window,t.bodyElement=d,t.contentAreaContainer=d,f.content_document=f.content_window=null,f.root_name=d.nodeName.toLowerCase()),(n=t.getBody()).disabled=!0,t.readonly=f.readonly,t.readonly||(t.inline&&"static"===dx.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=t.getParam("content_editable_state",!0)),n.disabled=!1,t.editorUpload=bd(t),t.schema=ni(f),t.dom=pi(m,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:f.force_hex_style_colors,class_filter:f.class_filter,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:wl(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((o=zp((u=t).settings,u.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,o,i=e.length,a=u.dom;i--;)if(r=(n=e[i]).attr(t),o="data-mce-"+t,!n.attributes.map[o]){if(0===r.indexOf("data:")||0===r.indexOf("blob:"))continue;"style"===t?((r=a.serializeStyle(a.parseStyle(r),n.name)).length||(r=null),n.attr(o,r),n.attr(t,r)):"tabindex"===t?(n.attr(o,r),n.attr(t,null)):n.attr(o,u.convertURL(r,t,n.name))}}),o.addNodeFilter("script",function(e){for(var t,n,r=e.length;r--;)0!==(n=(t=e[r]).attr("type")||"no/type").indexOf("mce-")&&t.attr("type","mce-"+n)}),o.addNodeFilter("#cdata",function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"}),o.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t,n=e.length,r=u.schema.getNonEmptyElements();n--;)(t=e[n]).isEmpty(r)&&0===t.getAll("br").length&&(t.append(new Wc("br",1)).shortEnded=!0)}),o),t.serializer=$p(f,t),t.selection=Xh(t.dom,t.getWin(),t.serializer,t),t.annotator=Uc(t),t.formatter=Ep(t),t.undoManager=Fm(t),t._nodeChangeDispatcher=new Pd(t),t._selectionOverrides=xm(t),fx(t),lx(t),ux(t),Td(t),t.fire("PreInit"),f.browser_spellcheck||f.gecko_spellcheck||(m.body.spellcheck=!1,dx.setAttrib(n,"spellcheck","false")),t.quirks=sx(t),t.fire("PostRender"),f.directionality&&(n.dir=f.directionality),f.protect&&t.on("BeforeSetContent",function(t){Yt.each(f.protect,function(e){t.content=t.content.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",function(e){t.composing="compositionstart"===e.type}),0<t.contentStyles.length&&(r="",Yt.each(t.contentStyles,function(e){r+=e+"\r\n"}),t.dom.addStyle(r)),(i=t,i.inline?dx.styleSheetLoader:i.dom.styleSheetLoader).loadAll(t.contentCSS,function(e){mx(t)},function(e){mx(t)}),f.content_style&&(a=t,s=f.content_style,c=rr.fromDom(a.getDoc().head),l=rr.fromTag("style"),br(l,"type","text/css"),Bi(l,rr.fromText(s)),Bi(c,l))},px=pi.DOM,hx=function(e,t){var n,r,o,i,a=e.editorManager.translate("Rich Text Area. Press ALT-0 for help."),u=(n=e.id,r=a,t.height,o=Zc(e),i=rr.fromTag("iframe"),yr(i,o),yr(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Vi(i,"tox-edit-area__iframe"),i).dom();u.onload=function(){u.onload=null,e.fire("load")};var s,c,l,f,d=function(e,t){if(document.domain!==window.location.hostname&&de.ie&&de.ie<12){var n=vd.uuid("mce");e[n]=function(){gx(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return px.setAttrib(t,"src",r),!0}return!1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=(f=el(s=e)+"<html><head>",tl(s)!==s.documentBaseUrl&&(f+='<base href="'+s.documentBaseURI.getURI()+'" />'),f+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',c=nl(s),l=rl(s),ol(s)&&(f+='<meta http-equiv="Content-Security-Policy" content="'+ol(s)+'" />'),f+='</head><body id="'+c+'" class="mce-content-body '+l+'" data-id="'+s.id+'"><br></body></html>'),px.add(t.iframeContainer,u),d},vx=function(e,t){var n=hx(e,t);t.editorContainer&&(px.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=px.isHidden(t.editorContainer)),e.getElement().style.display="none",px.setAttrib(e.id,"aria-hidden","true"),n||gx(e)},bx=function(e){var t,n,r,o,i;e.contentCSS=e.contentCSS.concat((n=Tl(t=e),r=t.editorManager.baseURL+"/skins/content",o="content"+t.editorManager.suffix+".css",i=!0===t.inline,W(n,function(e){return/^[a-z0-9\-]+$/i.test(e)&&!i?r+"/"+e+"/"+o:t.documentBaseURI.toAbsolute(e)})))},yx=pi.DOM,Cx=function(t,n,e){var r=nd.get(e),o=nd.urls[e]||t.documentBaseUrl.replace(/\/$/,"");if(e=Yt.trim(e),r&&-1===Yt.inArray(n,e)){if(Yt.each(nd.dependencies(e),function(e){Cx(t,n,e)}),t.plugins[e])return;var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}},xx=function(e){return e.replace(/^\-/,"")},wx=function(e){return{editorContainer:e,iframeContainer:e}},Nx=function(e){var t,n,r=e.getElement();return e.inline?wx(null):(t=r,n=yx.create("div"),yx.insertAfter(n,t),wx(n))},Ex=function(e){var t,n,r,o;e.fire("ScriptsLoaded"),function(e){var t=e.settings.theme;if(R(t)){e.settings.theme=xx(t);var n=rd.get(t);e.theme=new n(e,rd.urls[t]),e.theme.init&&e.theme.init(e,rd.urls[t]||e.documentBaseUrl.replace(/\/$/,""),e.$)}else e.theme={}}(e),t=e,n=[],Yt.each(t.settings.plugins.split(/[ ,]/),function(e){Cx(t,n,xx(e))}),r=e,o=Yt.trim(r.settings.icons),mr(td.get(o).icons,function(e,t){r.ui.registry.addIcon(t,e)});var i,a,u,s,c,l,f=(c=(i=e).settings,l=i.getElement(),i.orgDisplay=l.style.display,R(c.theme)?i.theme.renderUI():P(c.theme)?(u=(a=i).getElement(),(s=a.settings.theme(a,u)).editorContainer.nodeType&&(s.editorContainer.id=s.editorContainer.id||a.id+"_parent"),s.iframeContainer&&s.iframeContainer.nodeType&&(s.iframeContainer.id=s.iframeContainer.id||a.id+"_iframecontainer"),s.height=s.iframeHeight?s.iframeHeight:u.offsetHeight,s):Nx(i));return e.editorContainer=f.editorContainer?f.editorContainer:null,bx(e),e.inline?gx(e):vx(e,f)},Sx=pi.DOM,kx=function(e){return"-"===e.charAt(0)},Tx=function(a,u){var s=Ci.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(R(i)){if(!kx(i)&&!rd.urls.hasOwnProperty(i)){var a=o.theme_url;a?rd.load(i,t.documentBaseURI.toAbsolute(a)):rd.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){rd.waitFor(i,r)})}else r()}(s,a,u,function(){var e,t,n,r,o,i;e=s,n=Nl(t=a),r=El(t),!1===Si.hasCode(n)&&"en"!==n&&(""!==r?e.add(r):e.add(t.editorManager.baseURL+"/langs/"+n+".js")),function(e,t){var n=e.icons;if(R(n)){var r=t.editorManager.baseURL+"/icons/"+Yt.trim(n)+"/icons.js";Ci.ScriptLoader.add(r)}}(a.settings,a),o=a.settings,i=u,Yt.isArray(o.plugins)&&(o.plugins=o.plugins.join(" ")),Yt.each(o.external_plugins,function(e,t){nd.load(t,e),o.plugins+=" "+t}),Yt.each(o.plugins.split(/[ ,]/),function(e){if((e=Yt.trim(e))&&!nd.urls[e])if(kx(e)){e=e.substr(1,e.length);var t=nd.dependencies(e);Yt.each(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+i+".js"};e=nd.createUrl(t,e),nd.load(e.resource,e)})}else nd.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+i+".js"})}),s.loadQueue(function(){a.removed||Ex(a)},a,function(e){Jf(a,e[0]),a.removed||Ex(a)})})},Ax=function(t){var e=t.settings,n=t.id;Si.setCode(Nl(t));var r=function(){Sx.unbind(window,"ready",r),t.render()};if(ke.Event.domLoaded){if(t.getElement()&&de.contentEditable){e.inline?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var o=t.getElement().form||Sx.getParent(n,"form");o&&(t.formElement=o,e.hidden_input&&!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&(Sx.insertAfter(Sx.create("input",{type:"hidden",name:n}),n),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},Sx.bind(o,"submit reset",t.formEventDelegate),t.on("reset",function(){t.setContent(t.startContent,{format:"raw"})}),!e.submit_patch||o.submit.nodeType||o.submit.length||o._mceOldSubmit||(o._mceOldSubmit=o.submit,o.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),o._mceOldSubmit(o)})),t.windowManager=$f(t),t.notificationManager=qf(t),"xml"===e.encoding&&t.on("GetContent",function(e){e.save&&(e.content=Sx.encode(e.content))}),e.add_form_submit_trigger&&t.on("submit",function(){t.initialized&&t.save()}),e.add_unload_trigger&&(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),Tx(t,t.suffix)}}else Sx.bind(window,"ready",r)},Rx=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},Dx=function(e,t,n){var r,o;Hi(e,t)&&!1===n?(o=t,Fi(r=e)?r.dom().classList.remove(o):zi(r,o),ji(r)):n&&Vi(e,t)},Bx=function(e,t){Dx(rr.fromDom(e.getBody()),"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable="false"):(e.readonly=!1,e.getBody().contentEditable="true",Rx(e,"StyleWithCSS",!1),Rx(e,"enableInlineTableEditing",!1),Rx(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},Ox=function(e){return e.readonly?"readonly":"design"},_x=function(e){return Yt.grep(e.childNodes,function(e){return"LI"===e.nodeName})},Px=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||Bo.isBr(t));var t},Ix=function(e){return 0<e.length&&(!(t=e[e.length-1]).firstChild||Px(t))?e.slice(0,-1):e;var t},Lx=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},Mx=function(e,t){var n=Cu.after(e),r=Ys(t).prev(n);return r?r.toRange():null},Fx=function(t,e,n){var r,o,i,a,u=t.parentNode;return Yt.each(e,function(e){u.insertBefore(e,t)}),r=t,o=n,i=Cu.before(r),(a=Ys(o).next(i))?a.toRange():null},Ux=function(e,t){var n,r,o,i,a,u,s=t.firstChild,c=t.lastChild;return s&&"meta"===s.name&&(s=s.next),c&&"mce_marker"===c.attr("id")&&(c=c.prev),r=c,u=(n=e).getNonEmptyElements(),r&&(r.isEmpty(u)||(o=r,n.getBlockElements()[o.name]&&(a=o).firstChild&&a.firstChild===a.lastChild&&("br"===(i=o.firstChild).name||"\xa0"===i.value)))&&(c=c.prev),!(!s||s!==c||"ul"!==s.name&&"ol"!==s.name)},zx=function(e,o,i,t){var n,r,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x,w,N=(n=o,r=t,c=e.serialize(r),l=n.createFragment(c),u=(a=l).firstChild,s=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),s&&"mce_marker"===s.id&&s.parentNode.removeChild(s),a),E=Lx(o,i.startContainer),S=Ix(_x(N.firstChild)),k=o.getRoot(),T=function(e){var t=Cu.fromRangeStart(i),n=Ys(o.getRoot()),r=1===e?n.prev(t):n.next(t);return!r||Lx(o,r.getNode())!==E};return T(1)?Fx(E,S,k):T(2)?(f=E,d=S,m=k,o.insertAfter(d.reverse(),f),Mx(d[0],m)):(p=S,h=k,v=g=E,y=(b=i).cloneRange(),C=b.cloneRange(),y.setStartBefore(v),C.setEndAfter(v),x=[y.cloneContents(),C.cloneContents()],(w=g.parentNode).insertBefore(x[0],g),Yt.each(p,function(e){w.insertBefore(e,g)}),w.insertBefore(x[1],g),w.removeChild(g),Mx(p[p.length-1],h))},Vx=function(e,t){return!!Lx(e,t)},jx=Bo.matchNodeNames("td th"),Hx=function(e,t){var n,r,o=e.selection.getRng(),i=o.startContainer,a=o.startOffset;o.collapsed&&(n=i,r=a,Bo.isText(n)&&"\xa0"===n.nodeValue[r-1])&&Bo.isText(i)&&(i.insertData(a-1," "),i.deleteData(a,1),o.setStart(i,a),o.setEnd(i,a),e.selection.setRng(o)),e.selection.setContent(t)},qx=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g=e.selection,p=e.dom;if(/^ | $/.test(t)&&(t=function(e,t){var n,r;n=e.startContainer,r=e.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(0<r?t=t.replace(/^&nbsp;/," "):o("previousSibling")||(t=t.replace(/^ /,"&nbsp;")),r<n.length?t=t.replace(/&nbsp;(<br>|)$/," "):o("nextSibling")||(t=t.replace(/(&nbsp;| )(<br>|)$/,"&nbsp;"))),t}(g.getRng(),t)),r=e.parser,m=n.merge,o=Bl({validate:e.settings.validate},e.schema),d='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;&#x200B;</span>',s={content:t,format:"html",selection:!0,paste:n.paste},(s=e.fire("BeforeSetContent",s)).isDefaultPrevented())e.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=s.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var h,v,b,y,C,x,w=(l=g.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=e.getBody();w===N&&g.isCollapsed()&&p.isBlock(N.firstChild)&&(h=e,(v=N.firstChild)&&!h.schema.getShortEndedElements()[v.nodeName])&&p.isEmpty(N.firstChild)&&((l=p.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),g.setRng(l)),g.isCollapsed()||(e.selection.setRng(cp(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),b=e.selection.getRng(),y=t,C=b.startContainer,x=b.startOffset,3===C.nodeType&&b.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(y)||(y+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(y)||(y=" "+y))),t=y);var E,S,k,T={context:(i=g.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,T),!0===n.paste&&Ux(e.schema,u)&&Vx(p,i))return l=zx(o,p,e.selection.getRng(),u),e.selection.setRng(l),void e.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!p.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),T.invalid){for(Hx(e,d),i=g.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;t=i===a?a.innerHTML:p.getOuterHTML(i),t=o.serialize(r.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return o.serialize(u)}))),i===a?p.setHTML(a,t):p.setOuterHTML(i,t)}else!function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):Hx(e,t)}}(e,t=o.serialize(u),i);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new Ig(r);Yt.each(r.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}}(e,m),function(n,e){var t,r,o,i,a,u=n.dom,s=n.selection;if(e){if(n.selection.scrollIntoView(e),t=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===n.dom.getContentEditable(e))return e;return null}(e))return u.remove(e),s.select(t);var c=u.createRng();(i=e.previousSibling)&&3===i.nodeType?(c.setStart(i,i.nodeValue.length),de.ie||(a=e.nextSibling)&&3===a.nodeType&&(i.appendData(a.data),a.parentNode.removeChild(a))):(c.setStartBefore(e),c.setEndBefore(e)),r=u.getParent(e,u.isBlock),u.remove(e),r&&u.isEmpty(r)&&(n.$(r).empty(),c.setStart(r,0),c.setEnd(r,0),jx(r)||r.getAttribute("data-mce-fragment")||!(o=function(e){var t=Cu.fromRangeStart(e);if(t=Ys(n.getBody()).next(t))return t.toRange()}(c))?u.add(r,u.create("br",{"data-mce-bogus":"1"})):(c=o,u.remove(r))),s.setRng(c)}}(e,p.get("mce_marker")),E=e.getBody(),Yt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=e.dom,k=e.selection.getStart(),A.from(S.getParent(k,"td,th")).map(rr.fromDom).each(Hm),e.fire("SetContent",s),e.addVisual()}},$x=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Yt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};qx(e,o.content,o.details)},Wx=function(e,t){e.getDoc().execCommand(t,!1,null)},Kx=function(e){cy(e,!1)||gy(e,!1)||Wb(e,!1)||jy(e)||Gb(e,!1)||(Wx(e,"Delete"),Bb(e))},Xx=function(e){cy(e,!0)||gy(e,!0)||Wb(e,!0)||jy(e)||Gb(e,!0)||Wx(e,"ForwardDelete")},Yx=function(s){return function(u,e){return A.from(e).map(rr.fromDom).filter(cr).bind(function(e){return(r=s,o=u,i=e.dom(),a=function(e){return Er(e,r)},Yi(rr.fromDom(i),function(e){return a(e).isSome()},function(e){return Pr(rr.fromDom(o),e)}).bind(a)).or((t=s,n=e.dom(),A.from(pi.DOM.getStyle(n,t,!0))));var t,n,r,o,i,a}).getOr("")}},Gx={getFontSize:Yx("font-size"),getFontFamily:H(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},Yx("font-family")),toPt:function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,r=t||0,o=Math.pow(10,r),Math.round(n*o)/o+"pt"):e;var n,r,o}},Jx=function(e){return oc.firstPositionIn(e.getBody()).map(function(e){var t=e.container();return Bo.isText(t)?t.parentNode:t})},Qx=function(o){return A.from(o.selection.getRng()).bind(function(e){var t,n,r=o.getBody();return n=r,(t=e).startContainer===n&&0===t.startOffset?A.none():A.from(o.selection.getStart(!0))})},Zx=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=dl(e),o=ml(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},ew=function(e){var t=parseInt(e,10);return isNaN(t)?0:t},tw=function(e,t){return(e||"table"===ur(t)?"margin":"padding")+("rtl"===wr(t,"direction")?"-right":"-left")},nw=function(e){var r,t=ow(e);return!0!==e.readonly&&(1<t.length||(r=e,J(t,function(e){var t=tw(Sl(r),e),n=Er(e,t).map(ew).getOr(0);return"false"!==r.dom.getContentEditable(e.dom())&&0<n})))},rw=function(e){return po(e)||ho(e)},ow=function(e){return U(W(e.selection.getSelectedBlocks(),rr.fromDom),function(e){return!rw(e)&&!Mr(e).map(rw).getOr(!1)&&Yi(e,function(e){return Bo.isContentEditableTrue(e.dom())||Bo.isContentEditableFalse(e.dom())}).exists(function(e){return Bo.isContentEditableTrue(e.dom())})})},iw=function(e,t){var n=e.dom,r=e.selection,o=e.formatter,i=kl(e),a=/[a-z%]+$/i.exec(i)[0],u=parseInt(i,10),s=Sl(e),c=al(e);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||""!==c||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),F(ow(e),function(e){!function(e,t,n,r,o,i){var a=tw(n,rr.fromDom(i));if("outdent"===t){var u=Math.max(0,ew(i.style[a])-r);e.setStyle(i,a,u?u+o:"")}else u=ew(i.style[a])+r+o,e.setStyle(i,a,u)}(n,t,s,u,a,e.dom())})},aw=Yt.each,uw=Yt.extend,sw=Yt.map,cw=Yt.inArray;function lw(s){var o,i,a,t,c={state:{},exec:{},value:{}};s.on("PreInit",function(){o=s.dom,i=s.selection,a=s.formatter});var e=function(e,n){n=n||"exec",aw(e,function(t,e){aw(e.toLowerCase().split(","),function(e){c[n][e]=t})})},n=function(e,t,n){e=e.toLowerCase(),c.value[e]=function(){return t.call(n||s)}};uw(this,{execCommand:function(t,n,r,e){var o,i,a=!1;if(!s.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||e&&e.skip_focus?Ql(s):s.focus(),(e=s.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;if(i=t.toLowerCase(),o=c.exec[i])return o(i,n,r),s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if(aw(s.plugins,function(e){if(e.execCommand&&e.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!(a=!0)}),a)return a;if(s.theme&&s.theme.execCommand&&s.theme.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;try{a=s.getDoc().execCommand(t,n,r)}catch(u){}return!!a&&(s.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},queryCommandState:function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.state[e])return t(e);try{return s.getDoc().queryCommandState(e)}catch(n){}return!1}},queryCommandValue:function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.value[e])return t(e);try{return s.getDoc().queryCommandValue(e)}catch(n){}}},queryCommandSupported:function(e){if(e=e.toLowerCase(),c.exec[e])return!0;try{return s.getDoc().queryCommandSupported(e)}catch(t){}return!1},addCommands:e,addCommand:function(e,o,i){e=e.toLowerCase(),c.exec[e]=function(e,t,n,r){return o.call(i||s,t,n,r)}},addQueryStateHandler:function(e,t,n){e=e.toLowerCase(),c.state[e]=function(){return t.call(n||s)}},addQueryValueHandler:n,hasCustomCommand:function(e){return e=e.toLowerCase(),!!c.exec[e]}});var u=function(e,t,n){return t===undefined&&(t=!1),n===undefined&&(n=null),s.getDoc().execCommand(e,t,n)},r=function(e){return a.match(e)},l=function(e,t){a.toggle(e,t?{value:t}:undefined),s.nodeChanged()},f=function(e){t=i.getBookmark(e)},d=function(){i.moveToBookmark(t)};e({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){s.undoManager.add()},"Cut,Copy,Paste":function(e){var t,n=s.getDoc();try{u(e)}catch(o){t=!0}if("paste"!==e||n.queryCommandEnabled(e)||(t=!0),t||!n.queryCommandSupported(e)){var r=s.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");de.mac&&(r=r.replace(/Ctrl\+/g,"\u2318+")),s.notificationManager.open({text:r,type:"error"})}},unlink:function(){if(i.isCollapsed()){var e=s.dom.getParent(s.selection.getStart(),"a");e&&s.dom.remove(e,!0)}else a.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),aw("left,center,right,justify".split(","),function(e){t!==e&&a.remove("align"+e)}),"none"!==t&&l("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;u(e),(t=o.getParent(i.getNode(),"ol,ul"))&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(f(),o.split(n,t),d()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){l(e)},"ForeColor,HiliteColor":function(e,t,n){l(e,n)},FontName:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontname",{value:Zx(r,o)}),r.nodeChanged()},FontSize:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontsize",{value:Zx(r,o)}),r.nodeChanged()},RemoveFormat:function(e){a.remove(e)},mceBlockQuote:function(){l("blockquote")},FormatBlock:function(e,t,n){return l(n||"p")},mceCleanup:function(){var e=i.getBookmark();s.setContent(s.getContent()),i.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var r=n||i.getNode();r!==s.getBody()&&(f(),s.dom.remove(r,!0),d())},mceSelectNodeDepth:function(e,t,n){var r=0;o.getParent(i.getNode(),function(e){if(1===e.nodeType&&r++===n)return i.select(e),!1},s.getBody())},mceSelectNode:function(e,t,n){i.select(n)},mceInsertContent:function(e,t,n){$x(s,n)},mceInsertRawHTML:function(e,t,n){i.setContent("tiny_mce_marker");var r=s.getContent();s.setContent(r.replace(/tiny_mce_marker/g,function(){return n}))},mceInsertNewLine:function(e,t,n){_C(s,n)},mceToggleFormat:function(e,t,n){l(n)},mceSetContent:function(e,t,n){s.setContent(n)},"Indent,Outdent":function(e){iw(s,e)},mceRepaint:function(){},InsertHorizontalRule:function(){s.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},selectAll:function(){var e=o.getParent(i.getStart(),Bo.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){Kx(s)},forwardDelete:function(){Xx(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return vC(s,n),!0}});var m=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=sw(e,function(e){return!!a.matchNode(e,n)});return-1!==cw(t,!0)}};e({JustifyLeft:m("alignleft"),JustifyCenter:m("aligncenter"),JustifyRight:m("alignright"),JustifyFull:m("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return r(e)},mceBlockQuote:function(){return r("blockquote")},Outdent:function(){return nw(s)},"InsertUnorderedList,InsertOrderedList":function(e){var t=o.getParent(i.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),e({Undo:function(){s.undoManager.undo()},Redo:function(){s.undoManager.redo()}}),n("FontName",function(){return Qx(t=s).fold(function(){return Jx(t).map(function(e){return Gx.getFontFamily(t.getBody(),e)}).getOr("")},function(e){return Gx.getFontFamily(t.getBody(),e)});var t},this),n("FontSize",function(){return Qx(t=s).fold(function(){return Jx(t).map(function(e){return Gx.getFontSize(t.getBody(),e)}).getOr("")},function(e){return Gx.getFontSize(t.getBody(),e)});var t},this)}var fw=Yt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," "),dw=function(a){var u,s,c=this,l={},f=function(){return!1},d=function(){return!0};u=(a=a||{}).scope||c,s=a.toggleEvent||f;var r=function(e,t,n,r){var o,i,a;if(!1===t&&(t=f),t)for(t={func:t},r&&Yt.extend(t,r),a=(i=e.toLowerCase().split(" ")).length;a--;)e=i[a],(o=l[e])||(o=l[e]=[],s(e,!0)),n?o.unshift(t):o.push(t);return c},m=function(e,t){var n,r,o,i,a;if(e)for(n=(i=e.toLowerCase().split(" ")).length;n--;){if(e=i[n],r=l[e],!e){for(o in l)s(o,!1),delete l[o];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),l[e]=r);else r.length=0;r.length||(s(e,!1),delete l[e])}}else{for(e in l)s(e,!1);l={}}return c};c.fire=function(e,t){var n,r,o,i;if(e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=u),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=d},t.stopPropagation=function(){t.isPropagationStopped=d},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=d},t.isDefaultPrevented=f,t.isPropagationStopped=f,t.isImmediatePropagationStopped=f),a.beforeFire&&a.beforeFire(t),n=l[e])for(r=0,o=n.length;r<o;r++){if((i=n[r]).once&&m(e,i.func),t.isImmediatePropagationStopped())return t.stopPropagation(),t;if(!1===i.func.call(u,t))return t.preventDefault(),t}return t},c.on=r,c.off=m,c.once=function(e,t,n){return r(e,t,n,{once:!0})},c.has=function(e){return e=e.toLowerCase(),!(!l[e]||0===l[e].length)}};dw.isNative=function(e){return!!fw[e.toLowerCase()]};var mw,gw=function(n){return n._eventDispatcher||(n._eventDispatcher=new dw({scope:n,toggleEvent:function(e,t){dw.isNative(e)&&n.toggleNativeEvent&&n.toggleNativeEvent(e,t)}})),n._eventDispatcher},pw={fire:function(e,t,n){if(this.removed&&"remove"!==e&&"detach"!==e)return t;if(t=gw(this).fire(e,t,n),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},on:function(e,t,n){return gw(this).on(e,t,n)},off:function(e,t){return gw(this).off(e,t)},once:function(e,t){return gw(this).once(e,t)},hasEventListeners:function(e){return gw(this).has(e)}},hw=pi.DOM,vw=function(e,t){return"selectionchange"===t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=hw.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},bw=function(e,t,n){var r;(r=e).hidden||r.readonly?!0===e.readonly&&n.preventDefault():e.fire(t,n)},yw=function(i,a){var e,t;if(i.delegates||(i.delegates={}),!i.delegates[a]&&!i.removed)if(e=vw(i,a),i.settings.event_root){if(mw||(mw={},i.editorManager.on("removeEditor",function(){var e;if(!i.editorManager.activeEditor&&mw){for(e in mw)i.dom.unbind(vw(i,e));mw=null}})),mw[a])return;t=function(e){for(var t=e.target,n=i.editorManager.get(),r=n.length;r--;){var o=n[r].getBody();(o===t||hw.isChildOf(t,o))&&bw(n[r],a,e)}},mw[a]=t,hw.bind(e,a,t)}else t=function(e){bw(i,a,e)},hw.bind(e,a,t),i.delegates[a]=t},Cw={bindPendingEventDelegates:function(){var t=this;Yt.each(t._pendingNativeEvents,function(e){yw(t,e)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(t?n.initialized?yw(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(vw(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e,t=this,n=t.getBody(),r=t.dom;if(t.delegates){for(e in t.delegates)t.dom.unbind(vw(t,e),e,t.delegates[e]);delete t.delegates}!t.inline&&n&&r&&(n.onload=null,r.unbind(t.getWin()),r.unbind(t.getDoc())),r&&(r.unbind(n),r.unbind(t.getContainer()))}},xw=Cw=Yt.extend({},pw,Cw),ww=Yt.each,Nw=Yt.explode,Ew={f9:120,f10:121,f11:122},Sw=Yt.makeMap("alt,ctrl,shift,meta,access");function kw(i){var a={},r=[],u=function(e){var t,n,r={};for(n in ww(Nw(e,"+"),function(e){e in Sw?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=Ew[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode],Sw)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,de.mac?r.ctrl=!0:r.shift=!0),r.meta&&(de.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},s=function(e,t,n,r){var o;return(o=Yt.map(Nw(e,">"),u))[o.length-1]=Yt.extend(o[o.length-1],{func:n,scope:r||i}),Yt.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},c=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(ww(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&c(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.type&&c(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:Yt.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),ww(Nw(Yt.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var Tw=Yt.each,Aw=Yt.trim,Rw="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Dw={ftp:21,http:80,https:443,mailto:25},Bw=function(r,e){var t,n,o=this;if(r=Aw(r),t=(e=o.settings=e||{}).base_uri,/^([\w\-]+):([^\/]{2})/i.test(r)||/^\s*#/.test(r))o.source=r;else{var i=0===r.indexOf("//");0!==r.indexOf("/")||i||(r=(t&&t.protocol||"http")+"://mce_host"+r),/^[\w\-]*:?\/\//.test(r)||(n=e.base_uri?e.base_uri.path:new Bw(document.location.href).directory,r=""==e.base_uri.protocol?"//mce_host"+o.toAbsPath(n,r):(r=/([^#?]*)([#?]?.*)/.exec(r),(t&&t.protocol||"http")+"://mce_host"+o.toAbsPath(n,r[1])+r[2])),r=r.replace(/@@/g,"(mce_at)"),r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(r),Tw(Rw,function(e,t){var n=r[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n}),t&&(o.protocol||(o.protocol=t.protocol),o.userInfo||(o.userInfo=t.userInfo),o.port||"mce_host"!==o.host||(o.port=t.port),o.host&&"mce_host"!==o.host||(o.host=t.host),o.source=""),i&&(o.protocol="")}};Bw.prototype={setPath:function(e){e=/^(.*?)\/?(\w+)?$/.exec(e),this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},toRelative:function(e){var t;if("./"===e)return e;if("mce_host"!==(e=new Bw(e,{base_uri:this})).host&&this.host!==e.host&&e.host||this.port!==e.port||this.protocol!==e.protocol&&""!==e.protocol)return e.getURI();var n=this.getURI(),r=e.getURI();return n===r||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===r?n:(t=this.toRelPath(this.path,e.path),e.query&&(t+="?"+e.query),e.anchor&&(t+="#"+e.anchor),t)},toAbsolute:function(e,t){return(e=new Bw(e,{base_uri:this})).getURI(t&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=Dw[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r,o,i=0,a="";if(e=(e=e.substring(0,e.lastIndexOf("/"))).split("/"),n=t.split("/"),e.length>=n.length)for(r=0,o=e.length;r<o;r++)if(r>=n.length||e[r]!==n[r]){i=r+1;break}if(e.length<n.length)for(r=0,o=n.length;r<o;r++)if(r>=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r<o;r++)a+="../";for(r=i-1,o=n.length;r<o;r++)a+=r!==i-1?"/"+n[r]:n[r];return a},toAbsPath:function(e,t){var n,r,o,i=0,a=[];for(r=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),Tw(e,function(e){e&&a.push(e)}),e=a,n=t.length-1,a=[];0<=n;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?0<i?i--:a.push(t[n]):i++);return 0!==(o=(n=e.length-i)<=0?a.reverse().join("/"):e.slice(0,n).join("/")+"/"+a.reverse().join("/")).indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(n.protocol?t+=n.protocol+"://":t+="//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},Bw.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},Bw.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t};var Ow=function(n,t,e){var r=function(){return A.from(n.queryCommandValue("ToggleSidebar")).is(t)},o=n.sidebars?n.sidebars:[];o.push({name:t,settings:e}),n.sidebars=o,n.ui.registry.addToggleButton(t,{icon:e.icon,tooltip:e.tooltip,onAction:function(e){n.execCommand("ToggleSidebar",!1,t),e.setActive(r())},onSetup:function(e){var t=function(){return e.setActive(r())};return n.on("ToggleSidebar",t),function(){n.off("ToggleSidebar",t)}}})},_w=pi.DOM,Pw=Yt.extend,Iw=Yt.each,Lw=Yt.resolve,Mw=de.ie,Fw=function(e,t,n){var r,o,i,a,u,s,c,l=this,f=l.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=l,o=e,i=f,a=n.defaultSettings,u=t,c={id:o,theme:"silver",popup_css:"",plugins:"",document_base_url:i,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_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",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:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=Of(Sf,c,a,u),l.settings=t,Ti.languageLoad=t.language_load,Ti.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new Bw(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new kw(l),l.loadedCSS={},l.editorCommands=new lw(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(de.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(de.overrideViewPort=!1);var m,g,p,h,v,b,y,C=(g={},p={},h={},v={},b={},{addButton:(y=function(n,r){return function(e,t){return n[e.toLowerCase()]=jc({type:r},t)}})(m={},"button"),addToggleButton:y(m,"togglebutton"),addMenuButton:y(m,"menubutton"),addSplitButton:y(m,"splitbutton"),addMenuItem:y(g,"menuitem"),addNestedMenuItem:y(g,"nestedmenuitem"),addToggleMenuItem:y(g,"togglemenuitem"),addAutocompleter:y(p,"autocompleter"),addContextMenu:y(v,"contextmenu"),addContextToolbar:y(b,"contexttoolbar"),addContextForm:y(b,"contextform"),addIcon:function(e,t){return h[e.toLowerCase()]=t},getAll:function(){return{buttons:m,menuItems:g,icons:h,popups:p,contextMenus:v,contextToolbars:b}}});l.ui={registry:C},n.fire("SetupEditor",{editor:l}),l.execCallback("setup",l),l.$=pn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};Pw(Fw.prototype={render:function(){Ax(this)},focus:function(e){uf(this,e)},hasFocus:function(){return sf(this)},execCallback:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?Lw(r):0,o=Lw(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,Array.prototype.slice.call(arguments,1))},translate:function(e){return Si.translate(e)},getParam:function(e,t,n){return If(this,e,t,n)},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){console.error("editor.addButton is deprecated in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},addSidebar:function(e,t){return Ow(this,e,t)},addMenuItem:function(e,t){console.error("editor.addMenuItem is deprecated in tinymce 5x, use editor.ui.registry.addMenuItem instead")},addContextToolbar:function(e,t){console.error("editor.addContextToolbar is deprecated in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable=!0:(_w.show(this.getContainer()),_w.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(Mw&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(_w.hide(e.getContainer()),_w.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var t,n=this.getElement();return this.removed?"":n?((e=e||{}).load=!0,t=this.setContent(n.value!==undefined?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,/TEXTAREA|INPUT/i.test(o.nodeName)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=_w.getParent(r.id,"form"))&&Iw(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},setContent:function(e,t){return ff(this,e,t)},getContent:function(e){return t=this,void 0===(n=e)&&(n={}),A.from(t.getBody()).fold(q("tree"===n.format?new Wc("body",11):""),function(e){return Al(t,n,e)});var t,n},insertContent:function(e,t){t&&(e=Pw({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},setMode:function(e){var t,n;(n=e)!==Ox(t=this)&&(t.initialized?Bx(t,"readonly"===n):t.on("init",function(){Bx(t,"readonly"===n)}),hf(t,n))},getContainer:function(){return this.container||(this.container=_w.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=_w.get(this.id)),this.targetElm},getWin:function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},getDoc:function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},addVisual:function(e){var n,r=this,o=r.settings,i=r.dom;e=e||r.getBody(),r.hasVisual===undefined&&(r.hasVisual=o.visual),Iw(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return n=o.visual_table_class||"mce-item-table",void((t=i.getAttrib(e,"border"))&&"0"!==t||!r.hasVisual?i.removeClass(e,n):i.addClass(e,n));case"A":return void(i.getAttrib(e,"href")||(t=i.getAttrib(e,"name")||e.id,n=o.visual_anchor_class||"mce-item-anchor",t&&r.hasVisual?i.addClass(e,n):i.removeClass(e,n)))}}),r.fire("VisualAid",{element:e,hasVisual:r.hasVisual})},remove:function(){xf(this)},destroy:function(e){wf(this,e)},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},xw);var Uw,zw,Vw,jw={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("tox-")||-1!==e.className.toString().indexOf("mce-")}},Hw=function(n,e){var t,r;tr.detect().browser.isIE()?(r=n).on("focusout",function(){Jl(r)}):(t=e,n.on("mouseup touchend",function(e){t.throttle()})),n.on("keyup nodechange",function(e){var t;"nodechange"===(t=e).type&&t.selectionChange||Jl(n)})},qw=function(e){var t,n,r,o=Li(function(){Jl(e)},0);e.inline&&(t=e,n=o,r=function(){n.throttle()},pi.DOM.bind(document,"mouseup",r),t.on("remove",function(){pi.DOM.unbind(document,"mouseup",r)})),e.on("init",function(){Hw(e,o)}),e.on("remove",function(){o.cancel()})},$w=pi.DOM,Ww=function(e){return jw.isEditorUIElement(e)},Kw=function(t,e){var n=t?t.settings.custom_ui_selector:"";return null!==$w.getParent(e,function(e){return Ww(e)||!!n&&t.dom.is(e,n)})},Xw=function(r,e){var t=e.editor;qw(t),t.on("focusin",function(){var e=r.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),r.setActive(this),(r.focusedEditor=this).fire("focus",{blurredEditor:e}),this.focus(!0))}),t.on("focusout",function(){var t=this;ve.setEditorTimeout(t,function(){var e=r.focusedEditor;Kw(t,function(){try{return document.activeElement}catch(e){return document.body}}())||e!==t||(t.fire("blur",{focusedEditor:null}),r.focusedEditor=null)})}),Uw||(Uw=function(e){var t,n=r.activeEditor;t=e.target,n&&t.ownerDocument===document&&(t===document.body||Kw(n,t)||r.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),r.focusedEditor=null))},$w.bind(document,"focusin",Uw))},Yw=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||($w.unbind(document,"focusin",Uw),Uw=null)},Gw=function(e){e.on("AddEditor",d(Xw,e)),e.on("RemoveEditor",d(Yw,e))},Jw=pi.DOM,Qw=Yt.explode,Zw=Yt.each,eN=Yt.extend,tN=0,nN=!1,rN=[],oN=[],iN=function(t){Zw(Vw.get(),function(e){"scroll"===t.type?e.fire("ScrollWindow",t):e.fire("ResizeWindow",t)})},aN=function(e){e!==nN&&(e?pn(window).on("resize scroll",iN):pn(window).off("resize scroll",iN),nN=e)},uN=function(t){var e=oN;delete rN[t.id];for(var n=0;n<rN.length;n++)if(rN[n]===t){rN.splice(n,1);break}return oN=U(oN,function(e){return t!==e}),Vw.activeEditor===t&&(Vw.activeEditor=0<oN.length?oN[0]:null),Vw.focusedEditor===t&&(Vw.focusedEditor=null),e.length!==oN.length};eN(Vw={defaultSettings:{},$:pn,majorVersion:"5",minorVersion:"0.0-rc-1-build.17",releaseDate:"TBD",editors:rN,i18n:Si,activeEditor:null,settings:{},setup:function(){var e,t,n,r,o="";if(t=Bw.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),n=window.tinymce||window.tinyMCEPreInit)e=n.base||n.baseURL,o=n.suffix;else{for(var i=document.getElementsByTagName("script"),a=0;a<i.length;a++){var u=(r=i[a].src).substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==u.indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/"));break}}!e&&document.currentScript&&(-1!==(r=document.currentScript.src).indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/")))}this.baseURL=new Bw(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new Bw(this.baseURL),this.suffix=o,Gw(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new Bw(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new Bw(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;for(var o in r)Ti.PluginManager.urls[o]=r[o]},init:function(r){var n,u,s=this;u=Yt.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var c=function(e){var t=e.id;return t||(t=(t=e.name)&&!Jw.get(t)?e.name:Jw.uniqueId(),e.setAttribute("id",t)),t},l=function(e,t){return t.constructor===RegExp?t.test(e.className):Jw.hasClass(e,t)},f=function(e){n=e},e=function(){var o,i=0,a=[],n=function(e,t,n){var r=new Fw(e,t,s);a.push(r),r.on("init",function(){++i===o.length&&f(a)}),r.targetElm=r.targetElm||n,r.render()};Jw.unbind(window,"ready",e),function(e){var t=r[e];t&&t.apply(s,Array.prototype.slice.call(arguments,2))}("onpageload"),o=pn.unique(function(t){var e,n=[];if(de.ie&&de.ie<11)return ed("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(t.types)return Zw(t.types,function(e){n=n.concat(Jw.select(e.selector))}),n;if(t.selector)return Jw.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":0<(e=t.elements||"").length&&Zw(Qw(e),function(t){var e;(e=Jw.get(t))?n.push(e):Zw(document.forms,function(e){Zw(e.elements,function(e){e.name===t&&(t="mce_editor_"+tN++,Jw.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":Zw(Jw.select("textarea"),function(e){t.editor_deselector&&l(e,t.editor_deselector)||t.editor_selector&&!l(e,t.editor_selector)||n.push(e)})}return n}(r)),r.types?Zw(r.types,function(t){Yt.each(o,function(e){return!Jw.is(e,t.selector)||(n(c(e),eN({},r,t),e),!1)})}):(Yt.each(o,function(e){var t;(t=s.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(uN(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(o=Yt.grep(o,function(e){return!s.get(e.id)})).length?f([]):Zw(o,function(e){var t;t=e,r.inline&&t.tagName.toLowerCase()in u?ed("Could not initialize inline editor on invalid inline target element",e):n(c(e),r,e)}))};return s.settings=r,Jw.bind(window,"ready",e),new me(function(t){n?t(n):f=function(e){t(e)}})},get:function(t){return 0===arguments.length?oN.slice(0):R(t)?V(oN,function(e){return e.id===t}).getOr(null):I(t)&&oN[t]?oN[t]:null},add:function(e){var t=this;return rN[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(rN[e.id]=e),rN.push(e),oN.push(e)),aN(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),zw||(zw=function(){t.fire("BeforeUnload")},Jw.bind(window,"beforeunload",zw))),e},createEditor:function(e,t){return this.add(new Fw(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!R(e))return n=e,O(r.get(n.id))?null:(uN(n)&&r.fire("RemoveEditor",{editor:n}),0===oN.length&&Jw.unbind(window,"beforeunload",zw),n.remove(),aN(0<oN.length),n);Zw(Jw.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})}else for(t=oN.length-1;0<=t;t--)r.remove(oN[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new Fw(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",0,n),!0}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){Zw(oN,function(e){e.save()})},addI18n:function(e,t){Si.add(e,t)},translate:function(e){return Si.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},pw),Vw.setup();var sN,cN=Vw;function lN(n){return{walk:function(e,t){return Oc(n,e,t)},split:Qm,normalize:function(t){return Fh(n,t).fold(q(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}(sN=lN||(lN={})).compareRanges=Ad,sN.getCaretRangeFromPoint=rh,sN.getSelectedNode=qa,sN.getNode=$a;var fN,dN,mN=lN,gN=Math.min,pN=Math.max,hN=Math.round,vN=function(e,t,n){var r,o,i,a,u,s;return r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,s=t.h,"b"===(n=(n||"").split(""))[0]&&(o+=s),"r"===n[1]&&(r+=u),"c"===n[0]&&(o+=hN(s/2)),"c"===n[1]&&(r+=hN(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=hN(a/2)),"c"===n[4]&&(r-=hN(i/2)),bN(r,o,i,a)},bN=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},yN={inflate:function(e,t,n){return bN(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:vN,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=vN(e,t,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(e,t){var n,r,o,i;return n=pN(e.x,t.x),r=pN(e.y,t.y),o=gN(e.x+e.w,t.x+t.w),i=gN(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:bN(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=pN(0,t.x-u),o=pN(0,t.y-s),i=pN(0,c-f),a=pN(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),bN(u,s,(c-=i)-u,(l-=a)-s)},create:bN,fromClientRect:function(e){return bN(e.left,e.top,e.width,e.height)}},CN={},xN={add:function(e,t){CN[e.toLowerCase()]=t},has:function(e){return!!CN[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=CN.hasOwnProperty(t)?CN[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=CN[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},wN=Yt.each,NN=Yt.extend,EN=function(){};EN.extend=fN=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!dN&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in dN=!0,e=new this,dN=!1,n.Mixins&&(wN(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&wN(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&wN(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&wN(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=NN({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=fN,i};var SN=Math.min,kN=Math.max,TN=Math.round,AN=function(e,n){var r,o,t,i;if(n=n||'"',null===e)return"null";if("string"==(t=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",n+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=o.indexOf(t))+1?"\\"+o.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+n;if("object"!==t)return""+e;if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(r=0,o="[";r<e.length;r++)o+=(0<r?",":"")+AN(e[r],n);return o+"]"}for(i in o="{",e)e.hasOwnProperty(i)&&(o+="function"!=typeof e[i]?(1<o.length?","+n:n)+i+n+":"+AN(e[i],n):"");return o+"}"},RN={serialize:AN,parse:function(e){try{return JSON.parse(e)}catch(t){}}},DN={callbacks:{},count:0,send:function(t){var n=this,r=pi.DOM,o=t.count!==undefined?t.count:n.count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},BN={send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4<n++?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,1e4<n?"TIMED_OUT":"GENERAL",t,e),t=null):setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",BN.fire("beforeInitialize",{settings:e}),t=od()){if(t.overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&Yt.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=BN.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};Yt.extend(BN,pw);var ON,_N,PN,IN,LN=Yt.extend,MN=function(e){this.settings=LN({},e),this.count=0};MN.sendRPC=function(e){return(new MN).send(e)},MN.prototype={send:function(n){var r=n.error,o=n.success;(n=LN(this.settings,n)).success=function(e,t){void 0===(e=RN.parse(e))&&(e={error:"JSON Parse error."}),e.error?r.call(n.error_scope||n.scope,e.error,t):o.call(n.success_scope||n.scope,e.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=RN.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",BN.send(n)}};try{ON=window.localStorage}catch(jN){_N={},PN=[],IN={getItem:function(e){var t=_N[e];return t||null},setItem:function(e,t){PN.push(e),_N[e]=String(t)},key:function(e){return PN[e]},removeItem:function(t){PN=PN.filter(function(e){return e===t}),delete _N[t]},clear:function(){PN=[],_N={}},length:0},Object.defineProperty(IN,"length",{get:function(){return PN.length},configurable:!1,enumerable:!1}),ON=IN}var FN,UN=cN,zN={geom:{Rect:yN},util:{Promise:me,Delay:ve,Tools:Yt,VK:pm,URI:Bw,Class:EN,EventDispatcher:dw,Observable:pw,I18n:Si,XHR:BN,JSON:RN,JSONRequest:MN,JSONP:DN,LocalStorage:ON,Color:function(e){var n={},u=0,s=0,c=0,t=function(e){var t;return"object"==typeof e?"r"in e?(u=e.r,s=e.g,c=e.b):"v"in e&&function(e,t,n){var r,o,i,a;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,n=parseInt(n,10)/100,t=kN(0,SN(t,1)),n=kN(0,SN(n,1)),0!==t){switch(r=e/60,i=(o=n*t)*(1-Math.abs(r%2-1)),a=n-o,Math.floor(r)){case 0:u=o,s=i,c=0;break;case 1:u=i,s=o,c=0;break;case 2:u=0,s=o,c=i;break;case 3:u=0,s=i,c=o;break;case 4:u=i,s=0,c=o;break;case 5:u=o,s=0,c=i;break;default:u=s=c=0}u=TN(255*(u+a)),s=TN(255*(s+a)),c=TN(255*(c+a))}else u=s=c=TN(255*n)}(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(u=parseInt(t[1],10),s=parseInt(t[2],10),c=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(u=parseInt(t[1],16),s=parseInt(t[2],16),c=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(u=parseInt(t[1]+t[1],16),s=parseInt(t[2]+t[2],16),c=parseInt(t[3]+t[3],16)),u=u<0?0:255<u?255:u,s=s<0?0:255<s?255:s,c=c<0?0:255<c?255:c,n};return e&&t(e),n.toRgb=function(){return{r:u,g:s,b:c}},n.toHsv=function(){return e=u,t=s,n=c,o=0,(i=SN(e/=255,SN(t/=255,n/=255)))===(a=kN(e,kN(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,{h:TN(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/((o=a)-i))),s:TN(100*r),v:TN(100*o)});var e,t,n,r,o,i,a},n.toHex=function(){var e=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+e(u)+e(s)+e(c)},n.parse=t,n}},dom:{EventUtils:ke,Sizzle:kt,DomQuery:pn,TreeWalker:oo,DOMUtils:pi,ScriptLoader:Ci,RangeUtils:mN,Serializer:$p,ControlSelection:Qp,BookmarkManager:Yp,Selection:Xh,Event:ke.Event},html:{Styles:oi,Entities:$o,Node:Wc,Schema:ni,SaxParser:Yc,DomParser:zp,Writer:Dl,Serializer:Bl},ui:{Factory:xN},Env:de,AddOnManager:Ti,Annotator:Uc,Formatter:Ep,UndoManager:Fm,EditorCommands:lw,WindowManager:$f,NotificationManager:qf,EditorObservable:xw,Shortcuts:kw,Editor:Fw,FocusManager:jw,EditorManager:cN,DOM:pi.DOM,ScriptLoader:Ci.ScriptLoader,PluginManager:Ti.PluginManager,ThemeManager:Ti.ThemeManager,IconManager:td,trim:Yt.trim,isArray:Yt.isArray,is:Yt.is,toArray:Yt.toArray,makeMap:Yt.makeMap,each:Yt.each,map:Yt.map,grep:Yt.grep,inArray:Yt.inArray,extend:Yt.extend,create:Yt.create,walk:Yt.walk,createNS:Yt.createNS,resolve:Yt.resolve,explode:Yt.explode,_addCacheSuffix:Yt._addCacheSuffix,isOpera:de.opera,isWebKit:de.webkit,isIE:de.ie,isGecko:de.gecko,isMac:de.mac},VN=UN=Yt.extend(UN,zN);FN=VN,window.tinymce=FN,window.tinyMCE=FN,function(e){if("object"==typeof module)try{module.exports=e}catch(t){}}(VN)}();!function(){"use strict";var N=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},g=function(n,o){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n(o.apply(null,t))}},U=function(t){return function(){return t}},d=function(t){return t};function f(o){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=r.concat(t);return o.apply(null,n)}}var t,e,n,o,r,s,i,m=function(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return!n.apply(null,t)}},u=function(t){return function(){throw new Error(t)}},a=U(!1),c=U(!0),l=a,h=c,v=function(){return p},p=(o={fold:function(t,e){return t()},is:l,isSome:l,isNone:h,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:e,map:v,ap:v,each:function(){},bind:v,flatten:v,exists:l,forall:h,filter:v,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:U("none()")},Object.freeze&&Object.freeze(o),o),b=function(n){var t=function(){return n},e=function(){return r},o=function(t){return t(n)},r={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:h,isNone:l,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return b(t(n))},ap:function(t){return t.fold(v,function(t){return b(t(n))})},each:function(t){t(n)},bind:o,flatten:t,exists:o,forall:o,filter:function(t){return t(n)?r:p},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(l,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},P={some:b,none:v,from:function(t){return null===t||t===undefined?p:b(t)}},y=function(e){return function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&Array.prototype.isPrototypeOf(t)?"array":"object"===e&&String.prototype.isPrototypeOf(t)?"string":e}(t)===e}},x=y("string"),w=y("object"),O=y("array"),z=y("boolean"),S=y("function"),k=y("number"),C=(r=Array.prototype.indexOf)===undefined?function(t,e){return L(t,e)}:function(t,e){return r.call(t,e)},M=function(t,e){return-1<C(t,e)},H=function(t,e){return F(t,e).isSome()},E=function(t,e){for(var n=[],o=0;o<t.length;o+=e){var r=t.slice(o,o+e);n.push(r)}return n},V=function(t,e){for(var n=t.length,o=new Array(n),r=0;r<n;r++){var i=t[r];o[r]=e(i,r,t)}return o},T=function(t,e){for(var n=0,o=t.length;n<o;n++)e(t[n],n,t)},A=function(t,e){for(var n=[],o=0,r=t.length;o<r;o++){var i=t[o];e(i,o,t)&&n.push(i)}return n},B=function(t,e,n){return function(t,e){for(var n=t.length-1;0<=n;n--)e(t[n],n,t)}(t,function(t){n=e(n,t)}),n},D=function(t,e,n){return T(t,function(t){n=e(n,t)}),n},_=function(t,e){for(var n=0,o=t.length;n<o;n++){var r=t[n];if(e(r,n,t))return P.some(r)}return P.none()},F=function(t,e){for(var n=0,o=t.length;n<o;n++)if(e(t[n],n,t))return P.some(n);return P.none()},L=function(t,e){for(var n=0,o=t.length;n<o;++n)if(t[n]===e)return n;return-1},I=Array.prototype.push,R=function(t){for(var e=[],n=0,o=t.length;n<o;++n){if(!Array.prototype.isPrototypeOf(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);I.apply(e,t[n])}return e},j=function(t,e){var n=V(t,e);return R(n)},W=function(t,e){for(var n=0,o=t.length;n<o;++n)if(!0!==e(t[n],n,t))return!1;return!0},G=Array.prototype.slice,X=function(t){var e=G.call(t,0);return e.reverse(),e},Y=function(t,e){return A(t,function(t){return!M(e,t)})},q=function(t){return[t]},K=function(t){return 0===t.length?P.none():P.some(t[0])},J=function(t){return 0===t.length?P.none():P.some(t[t.length-1])},$=S(Array.from)?Array.from:function(t){return G.call(t)},Q=Object.keys,Z=Object.hasOwnProperty,tt=function(t,e){for(var n=Q(t),o=0,r=n.length;o<r;o++){var i=n[o];e(t[i],i,t)}},et=function(t,o){return nt(t,function(t,e,n){return{k:e,v:o(t,e,n)}})},nt=function(o,r){var i={};return tt(o,function(t,e){var n=r(t,e,o);i[n.k]=n.v}),i},ot=function(t,n){var o=[];return tt(t,function(t,e){o.push(n(t,e))}),o},rt=function(t){return ot(t,function(t){return t})},it=function(t,e){return Z.call(t,e)},ut=function(e){return function(t){return it(t,e)?P.from(t[e]):P.none()}},at=function(t,e){return ut(e)(t)},ct=function(t,e){var n={};return n[t]=e,n},st=function(n){return{is:function(t){return n===t},isValue:c,isError:a,getOr:U(n),getOrThunk:U(n),getOrDie:U(n),or:function(t){return st(n)},orThunk:function(t){return st(n)},fold:function(t,e){return e(n)},map:function(t){return st(t(n))},mapError:function(t){return st(n)},each:function(t){t(n)},bind:function(t){return t(n)},exists:function(t){return t(n)},forall:function(t){return t(n)},toOption:function(){return P.some(n)}}},lt=function(n){return{is:a,isValue:a,isError:c,getOr:d,getOrThunk:function(t){return t()},getOrDie:function(){return u(String(n))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,e){return t(n)},map:function(t){return lt(n)},mapError:function(t){return lt(t(n))},each:N,bind:function(t){return lt(n)},exists:a,forall:c,toOption:P.none}},ft={value:st,error:lt},dt=function(u){if(!O(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],n={};return T(u,function(t,o){var e=Q(t);if(1!==e.length)throw new Error("one and only one name per case");var r=e[0],i=t[r];if(n[r]!==undefined)throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!O(i))throw new Error("case arguments must be an array");a.push(r),n[r]=function(){var t=arguments.length;if(t!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+t);for(var n=new Array(t),e=0;e<n.length;e++)n[e]=arguments[e];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[o].apply(null,n)},match:function(t){var e=Q(t);if(a.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+e.join(","));if(!W(a,function(t){return M(e,t)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+a.join(", "));return t[r].apply(null,n)},log:function(t){console.log(t,{constructors:a,constructor:r,params:n})}}}}),n},mt=(dt([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),Object.prototype.hasOwnProperty),ht=function(u){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},o=0;o<t.length;o++){var r=t[o];for(var i in r)mt.call(r,i)&&(n[i]=u(n[i],r[i]))}return n}},gt=ht(function(t,e){return w(t)&&w(e)?gt(t,e):e}),vt=ht(function(t,e){return e}),pt=function(t,e){return n=e,o={},tt(t,function(t,e){M(n,e)||(o[e]=t)}),o;var n,o},bt=function(t){return ut(t)},yt=function(t,e){return n=t,o=e,function(t){return it(t,n)?t[n]:o};var n,o},xt=function(t,e){return at(t,e)},wt=function(t,e){return ct(t,e)},zt=function(t){return e={},T(t,function(t){e[t.key]=t.value}),e;var e},St=function(t,e){var n,o,r,i,u,a=(n=[],o=[],T(t,function(t){t.fold(function(t){n.push(t)},function(t){o.push(t)})}),{errors:n,values:o});return 0<a.errors.length?(u=a.errors,g(ft.error,R)(u)):(i=e,0===(r=a.values).length?ft.value(i):ft.value(gt(i,vt.apply(undefined,r))))},kt=function(t,e){return it(n=t,o=e)&&n[o]!==undefined&&null!==n[o];var n,o},Ct=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return Ct(n())}}},Ot=function(t){for(var e=[],n=function(t){e.push(t)},o=0;o<t.length;o++)t[o].each(n);return e},Mt=function(t,e){for(var n=0;n<t.length;n++){var o=e(t[n],n);if(o.isSome())return o}return P.none()},Ht=U("touchstart"),Et=U("touchmove"),Vt=U("touchend"),Tt=U("mousedown"),At=U("mousemove"),Bt=U("mouseout"),Dt=U("mouseup"),_t=U("mouseover"),Ft=U("focusin"),Lt=U("focusout"),It=U("keydown"),Rt=U("keyup"),Nt=U("input"),Pt=U("change"),jt=U("click"),Ut=U("transitionend"),Wt=U("selectstart"),Gt=function(n){var o,r=!1;return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r||(r=!0,o=n.apply(null,t)),o}},Xt=function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var o=t[n];if(o.test(e))return o}return undefined}(t,e);if(!n)return{major:0,minor:0};var o=function(t){return Number(e.replace(n,"$"+t))};return qt(o(1),o(2))},Yt=function(){return qt(0,0)},qt=function(t,e){return{major:t,minor:e}},Kt={nu:qt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Yt():Xt(t,n)},unknown:Yt},Jt="Firefox",$t=function(t,e){return function(){return e===t}},Qt=function(t){var e=t.current;return{current:e,version:t.version,isEdge:$t("Edge",e),isChrome:$t("Chrome",e),isIE:$t("IE",e),isOpera:$t("Opera",e),isFirefox:$t(Jt,e),isSafari:$t("Safari",e)}},Zt={unknown:function(){return Qt({current:undefined,version:Kt.unknown()})},nu:Qt,edge:U("Edge"),chrome:U("Chrome"),ie:U("IE"),opera:U("Opera"),firefox:U(Jt),safari:U("Safari")},te="Windows",ee="Android",ne="Solaris",oe="FreeBSD",re=function(t,e){return function(){return e===t}},ie=function(t){var e=t.current;return{current:e,version:t.version,isWindows:re(te,e),isiOS:re("iOS",e),isAndroid:re(ee,e),isOSX:re("OSX",e),isLinux:re("Linux",e),isSolaris:re(ne,e),isFreeBSD:re(oe,e)}},ue={unknown:function(){return ie({current:undefined,version:Kt.unknown()})},nu:ie,windows:U(te),ios:U("iOS"),android:U(ee),linux:U("Linux"),osx:U("OSX"),solaris:U(ne),freebsd:U(oe)},ae=function(t,e){var n=String(e).toLowerCase();return _(t,function(t){return t.search(n)})},ce=function(t,n){return ae(t,n).map(function(t){var e=Kt.detect(t.versionRegexes,n);return{current:t.name,version:e}})},se=function(t,n){return ae(t,n).map(function(t){var e=Kt.detect(t.versionRegexes,n);return{current:t.name,version:e}})},le=function(t,e){return-1!==t.indexOf(e)},fe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,de=function(e){return function(t){return le(t,e)}},me=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return le(t,"edge/")&&le(t,"chrome")&&le(t,"safari")&&le(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,fe],search:function(t){return le(t,"chrome")&&!le(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return le(t,"msie")||le(t,"trident")}},{name:"Opera",versionRegexes:[fe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:de("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:de("firefox")},{name:"Safari",versionRegexes:[fe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(le(t,"safari")||le(t,"mobile/"))&&le(t,"applewebkit")}}],he=[{name:"Windows",search:de("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return le(t,"iphone")||le(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:de("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:de("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:de("linux"),versionRegexes:[]},{name:"Solaris",search:de("sunos"),versionRegexes:[]},{name:"FreeBSD",search:de("freebsd"),versionRegexes:[]}],ge={browsers:U(me),oses:U(he)},ve=function(t){var e,n,o,r,i,u,a,c,s,l,f,d=ge.browsers(),m=ge.oses(),h=ce(d,t).fold(Zt.unknown,Zt.nu),g=se(m,t).fold(ue.unknown,ue.nu);return{browser:h,os:g,deviceType:(n=h,o=t,r=(e=g).isiOS()&&!0===/ipad/i.test(o),i=e.isiOS()&&!r,u=e.isAndroid()&&3===e.version.major,a=e.isAndroid()&&4===e.version.major,c=r||u||a&&!0===/mobile/i.test(o),s=e.isiOS()||e.isAndroid(),l=s&&!c,f=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),{isiPad:U(r),isiPhone:U(i),isTablet:U(c),isPhone:U(l),isTouch:U(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:U(f)})}},pe={detect:Gt(function(){var t=navigator.userAgent;return ve(t)})},be={tap:U("alloy.tap")},ye=U("alloy.focus"),xe=U("alloy.blur.post"),we=U("alloy.paste.post"),ze=U("alloy.receive"),Se=U("alloy.execute"),ke=U("alloy.focus.item"),Ce=be.tap,Oe=pe.detect().deviceType.isTouch()?be.tap:jt,Me=U("alloy.longpress"),He=U("alloy.sandbox.close"),Ee=U("alloy.typeahead.cancel"),Ve=U("alloy.system.init"),Te=U("alloy.system.scroll"),Ae=U("alloy.system.attached"),Be=U("alloy.system.detached"),De=U("alloy.system.dismissRequested"),_e=U("alloy.focusmanager.shifted"),Fe=U("alloy.slotcontainer.visibility"),Le=U("alloy.change.tab"),Ie=U("alloy.dismiss.tab"),Re=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:U(t)}},Ne={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)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){var o=t.dom();return P.from(o.elementFromPoint(e,n)).map(Re)}},Pe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];if(e.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+n.length+" arguments");var o={};return T(e,function(t,e){o[t]=U(n[e])}),o}},je=function(t){return t.slice(0).sort()},Ue=function(e,t){if(!O(t))throw new Error("The "+e+" fields must be an array. Was: "+t+".");T(t,function(t){if(!x(t))throw new Error("The value "+t+" in the "+e+" fields was not a string.")})},We=function(r,i){var n,u=r.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return Ue("required",r),Ue("optional",i),n=je(u),_(n,function(t,e){return e<n.length-1&&t===n[e+1]}).each(function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+n.join(", ")+"].")}),function(e){var n=Q(e);W(r,function(t){return M(n,t)})||function(t,e){throw new Error("All required keys ("+je(t).join(", ")+") were not specified. Specified keys were: "+je(e).join(", ")+".")}(r,n);var t=A(n,function(t){return!M(u,t)});0<t.length&&function(t){throw new Error("Unsupported keys for object: "+je(t).join(", "))}(t);var o={};return T(r,function(t){o[t]=U(e[t])}),T(i,function(t){o[t]=U(Object.prototype.hasOwnProperty.call(e,t)?P.some(e[t]):P.none())}),o}},Ge="undefined"!=typeof window?window:Function("return this;")(),Xe=function(t,e){return function(t,e){for(var n=e!==undefined&&null!==e?e:Ge,o=0;o<t.length&&n!==undefined&&null!==n;++o)n=n[t[o]];return n}(t.split("."),e)},Ye={getOrDie:function(t,e){var n=Xe(t,e);if(n===undefined||null===n)throw t+" not available on this browser";return n}},qe=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE),Ke=(Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),Je=Node.TEXT_NODE,$e=(Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,Ke),Qe=qe,Ze=function(t,e){var n=t.dom();if(n.nodeType!==$e)return!1;if(n.matches!==undefined)return n.matches(e);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(e);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(e);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},tn=function(t){return t.nodeType!==$e&&t.nodeType!==Qe||0===t.childElementCount},en=function(t,e){var n=e===undefined?document:e.dom();return tn(n)?[]:V(n.querySelectorAll(t),Ne.fromDom)},nn=function(t,e){return t.dom()===e.dom()},on=(pe.detect().browser.isIE(),function(t){return Ne.fromDom(t.dom().ownerDocument)}),rn=function(t){var e=t.dom().ownerDocument.defaultView;return Ne.fromDom(e)},un=function(t){var e=t.dom();return P.from(e.parentNode).map(Ne.fromDom)},an=function(t){var e=t.dom();return P.from(e.offsetParent).map(Ne.fromDom)},cn=function(t){var e=t.dom();return V(e.childNodes,Ne.fromDom)},sn=function(t,e){var n=t.dom().childNodes;return P.from(n[e]).map(Ne.fromDom)},ln=(Pe("element","offset"),function(e,n){un(e).each(function(t){t.dom().insertBefore(n.dom(),e.dom())})}),fn=function(t,e){var n;(n=t.dom(),P.from(n.nextSibling).map(Ne.fromDom)).fold(function(){un(t).each(function(t){mn(t,e)})},function(t){ln(t,e)})},dn=function(e,n){sn(e,0).fold(function(){mn(e,n)},function(t){e.dom().insertBefore(n.dom(),t.dom())})},mn=function(t,e){t.dom().appendChild(e.dom())},hn=function(e,t){T(t,function(t){mn(e,t)})},gn=function(t){t.dom().textContent="",T(cn(t),function(t){vn(t)})},vn=function(t){var e=t.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},pn=function(t){return t.dom().innerHTML},bn=function(t,e){var n,o,r=on(t).dom(),i=Ne.fromDom(r.createDocumentFragment()),u=(n=e,(o=(r||document).createElement("div")).innerHTML=n,cn(Ne.fromDom(o)));hn(i,u),gn(t),mn(t,i)},yn=function(t){return t.dom().nodeName.toLowerCase()},xn=function(e){return function(t){return t.dom().nodeType===e}},wn=xn(Ke),zn=xn(Je),Sn=xn(qe),kn=function(t,e,n){if(!(x(n)||z(n)||k(n)))throw console.error("Invalid call to Attr.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Cn=function(t,e,n){kn(t.dom(),e,n)},On=function(t,e){var n=t.dom();tt(e,function(t,e){kn(n,e,t)})},Mn=function(t,e){var n=t.dom().getAttribute(e);return null===n?undefined:n},Hn=function(t,e){var n=t.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},En=function(t,e){t.dom().removeAttribute(e)},Vn=function(t){return e=t,n=!1,Ne.fromDom(e.dom().cloneNode(n));var e,n},Tn=function(t){var e,n,o,r=Vn(t);return e=r,n=Ne.fromTag("div"),o=Ne.fromDom(e.dom().cloneNode(!0)),mn(n,o),pn(n)},An=function(t){return Tn(t)},Bn="unknown",Dn="__CHROME_INSPECTOR_CONNECTION_TO_ALLOY__";(i=s||(s={}))[i.STOP=0]="STOP",i[i.NORMAL=1]="NORMAL",i[i.LOGGING=2]="LOGGING";var _n=Ct({}),Fn=function(e,t,n){var o,r,i,u;switch(xt(_n.get(),e).orThunk(function(){var t=Q(_n.get());return Mt(t,function(t){return-1<e.indexOf(t)?P.some(_n.get()[t]):P.none()})}).getOr(s.NORMAL)){case s.NORMAL:return n(Pn());case s.LOGGING:var a=(o=e,r=t,i=[],u=(new Date).getTime(),{logEventCut:function(t,e,n){i.push({outcome:"cut",target:e,purpose:n})},logEventStopped:function(t,e,n){i.push({outcome:"stopped",target:e,purpose:n})},logNoParent:function(t,e,n){i.push({outcome:"no-parent",target:e,purpose:n})},logEventNoHandlers:function(t,e){i.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,n){i.push({outcome:"response",purpose:n,target:e})},write:function(){var t=(new Date).getTime();M(["mousemove","mouseover","mouseout",Ve()],o)||console.log(o,{event:o,time:t-u,target:r.dom(),sequence:V(i,function(t){return M(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+An(t.target)+")":t.outcome})})}}),c=n(a);return a.write(),c;case s.STOP:return!0}},Ln=["alloy/data/Fields","alloy/debugging/Debugging"],In=function(t,e,n){return Fn(t,e,n)},Rn=function(){if(window[Dn]!==undefined)return window[Dn];var e=function(t,e){var n=_n.get();n[t]=e,_n.set(n)};return window[Dn]={systems:{},lookup:function(e){var n=window[Dn].systems,t=Q(n);return Mt(t,function(t){return n[t].getByUid(e).toOption().map(function(t){return wt(An(t.element()),(e=function(n){var t=n.spec();return{"(original.spec)":t,"(dom.ref)":n.element().dom(),"(element)":An(n.element()),"(initComponents)":V(t.components!==undefined?t.components:[],e),"(components)":V(n.components(),e),"(bound.events)":ot(n.events(),function(t,e){return[e]}).join(", "),"(behaviours)":t.behaviours!==undefined?et(t.behaviours,function(t,e){return t===undefined?"--revoked--":{config:t.configAsRaw(),"original-config":t.initialConfig,state:n.readState(e)}}):"none"}})(t));var e})}).orThunk(function(){return P.some({error:"Systems ("+t.join(", ")+") did not contain uid: "+e})})},events:{setToNormal:function(t){e(t,s.NORMAL)},setToLogging:function(t){e(t,s.LOGGING)},setToStop:function(t){e(t,s.STOP)}}},window[Dn]},Nn=function(t,e){Rn().systems[t]=e},Pn=U({logEventCut:N,logEventStopped:N,logNoParent:N,logEventNoHandlers:N,logEventResponse:N,write:N}),jn=0,Un=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++jn+String(e)},Wn=tinymce.util.Tools.resolve("tinymce.ThemeManager"),Gn=function(){return(Gn=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function Xn(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&(n[o[r]]=t[o[r]])}return n}var Yn,qn,Kn=dt([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Jn=function(t){return Kn.defaultedThunk(U(t))},$n=Kn.strict,Qn=Kn.asOption,Zn=Kn.defaultedThunk,to=Kn.mergeWithThunk;(qn=Yn||(Yn={}))[qn.Error=0]="Error",qn[qn.Value=1]="Value";var eo=function(t,e,n){return t.stype===Yn.Error?e(t.serror):n(t.svalue)},no=function(t){return{stype:Yn.Value,svalue:t}},oo=function(t){return{stype:Yn.Error,serror:t}},ro=function(t){return t.fold(oo,no)},io=function(t){return eo(t,ft.error,ft.value)},uo=no,ao=function(t){var e=[],n=[];return T(t,function(t){eo(t,function(t){return n.push(t)},function(t){return e.push(t)})}),{values:e,errors:n}},co=oo,so=function(t,e){return t.stype===Yn.Value?e(t.svalue):t},lo=function(t,e){return t.stype===Yn.Error?e(t.serror):t},fo=function(t,e){return t.stype===Yn.Value?{stype:Yn.Value,svalue:e(t.svalue)}:t},mo=function(t,e){return t.stype===Yn.Error?{stype:Yn.Error,serror:e(t.serror)}:t},ho=function(t){return g(co,R)(t)},go=function(t,e){var n,o,r=ao(t);return 0<r.errors.length?ho(r.errors):(n=r.values,o=e,0<n.length?uo(gt(o,vt.apply(undefined,n))):uo(o))},vo=function(t){var e=ao(t);return 0<e.errors.length?ho(e.errors):uo(e.values)},po=dt([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),bo=dt([{field:["name","presence","type"]},{state:["name"]}]),yo=function(){return Ye.getOrDie("JSON")},xo=function(t,e,n){return yo().stringify(t,e,n)},wo=function(t){return w(t)&&100<Q(t).length?" removed due to size":xo(t,null,2)},zo=function(t,e){return co([{path:t,getErrorInfo:e}])},So=dt([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),ko=function(n,o,r){return at(o,r).fold(function(){return t=r,e=o,zo(n,function(){return'Could not find valid *strict* value for "'+t+'" in '+wo(e)});var t,e},uo)},Co=function(t,e,n){var o=at(t,e).fold(function(){return n(t)},d);return uo(o)},Oo=function(a,c,t,s){return t.fold(function(r,n,t,o){var i=function(t){var e=o.extract(a.concat([r]),s,t);return fo(e,function(t){return ct(n,s(t))})},u=function(t){return t.fold(function(){var t=ct(n,s(P.none()));return uo(t)},function(t){var e=o.extract(a.concat([r]),s,t);return fo(e,function(t){return ct(n,s(P.some(t)))})})};return t.fold(function(){return so(ko(a,c,r),i)},function(t){return so(Co(c,r,t),i)},function(){return so(uo(at(c,r)),u)},function(t){return so((n=t,o=at(e=c,r).map(function(t){return!0===t?n(e):t}),uo(o)),u);var e,n,o},function(t){var e=t(c),n=fo(Co(c,r,U({})),function(t){return gt(e,t)});return so(n,i)})},function(t,e){var n=e(c);return uo(ct(t,s(n)))})},Mo=function(o){return{extract:function(n,t,e){return lo(o(e,t),function(t){return e=t,zo(n,function(){return e});var e})},toString:function(){return"val"},toDsl:function(){return po.itemOf(o)}}},Ho=function(t){var c=Eo(t),s=B(t,function(e,t){return t.fold(function(t){return gt(e,wt(t,!0))},U(e))},{});return{extract:function(t,e,n){var o,r,i,u=z(n)?[]:(r=Q(o=n),A(r,function(t){return kt(o,t)})),a=A(u,function(t){return!kt(s,t)});return 0===a.length?c.extract(t,e,n):(i=a,zo(t,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:c.toString,toDsl:c.toDsl}},Eo=function(a){return{extract:function(t,e,n){return o=t,r=n,i=e,u=V(a,function(t){return Oo(o,r,t,i)}),go(u,{});var o,r,i,u},toString:function(){return"obj{\n"+V(a,function(t){return t.fold(function(t,e,n,o){return t+" -> "+o.toString()},function(t,e){return"state("+t+")"})}).join("\n")+"}"},toDsl:function(){return po.objOf(V(a,function(t){return t.fold(function(t,e,n,o){return bo.field(t,n,o)},function(t,e){return bo.state(t)})}))}}},Vo=function(r){return{extract:function(n,o,t){var e=V(t,function(t,e){return r.extract(n.concat(["["+e+"]"]),o,t)});return vo(e)},toString:function(){return"array("+r.toString()+")"},toDsl:function(){return po.arrOf(r)}}},To=function(a,c){return{extract:function(n,o,r){var t,e,i=Q(r),u=(t=n,e=i,Vo(Mo(a)).extract(t,d,e));return so(u,function(t){var e=V(t,function(t){return So.field(t,t,$n(),c)});return Eo(e).extract(n,o,r)})},toString:function(){return"setOf("+c.toString()+")"},toDsl:function(){return po.setOf(a,c)}}},Ao=U(Mo(uo)),Bo=g(Vo,Eo),Do=So.state,_o=So.field,Fo=function(n,e,o,r,i){return xt(r,i).fold(function(){return t=r,e=i,zo(n,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+wo(t)});var t,e},function(t){return Eo(t).extract(n.concat(["branch: "+i]),e,o)})},Lo=function(r,i){return{extract:function(e,n,o){return xt(o,r).fold(function(){return t=r,zo(e,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return Fo(e,n,o,i,t)})},toString:function(){return"chooseOn("+r+"). Possible values: "+Q(i)},toDsl:function(){return po.choiceOf(r,i)}}},Io=Mo(uo),Ro=function(e){return Mo(function(t){return e(t).fold(co,uo)})},No=function(e,t){return To(function(t){return ro(e(t))},t)},Po=function(t,e,n){return io((o=t,r=d,i=n,u=e.extract([o],r,i),mo(u,function(t){return{input:i,errors:t}})));var o,r,i,u},jo=function(t){return t.fold(function(t){throw new Error(Wo(t))},d)},Uo=function(t,e,n){return jo(Po(t,e,n))},Wo=function(t){return"Errors: \n"+(e=t.errors,n=10<e.length?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,V(n,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))+"\n\nInput object: "+wo(t.input);var e,n},Go=function(t,e){return Lo(t,e)},Xo=U(Io),Yo=function(n,o){return Mo(function(t){var e=typeof t;return n(t)?uo(t):co("Expected type: "+o+" but got: "+e)})},qo=Yo(k,"number"),Ko=Yo(x,"string"),Jo=Yo(z,"boolean"),$o=Yo(S,"function"),Qo=function(e){return Ro(function(t){return M(e,t)?ft.value(t):ft.error('Unsupported value: "'+t+'", choose one of "'+e.join(", ")+'".')})},Zo=function(t){return _o(t,t,$n(),Ao())},tr=function(t,e){return _o(t,t,$n(),e)},er=function(t){return tr(t,Ko)},nr=function(t,e){return _o(t,t,$n(),Qo(e))},or=function(t){return tr(t,$o)},rr=function(t,e){return _o(t,t,$n(),Eo(e))},ir=function(t,e){return _o(t,t,$n(),Bo(e))},ur=function(t,e){return _o(t,t,$n(),Vo(e))},ar=function(t){return _o(t,t,Qn(),Ao())},cr=function(t,e){return _o(t,t,Qn(),e)},sr=function(t){return cr(t,Ko)},lr=function(t){return cr(t,$o)},fr=function(t,e){return _o(t,t,Qn(),Eo(e))},dr=function(t,e){return _o(t,t,Jn(e),Ao())},mr=function(t,e,n){return _o(t,t,Jn(e),n)},hr=function(t,e){return mr(t,e,qo)},gr=function(t,e){return mr(t,e,Ko)},vr=function(t,e,n){return mr(t,e,Qo(n))},pr=function(t,e){return mr(t,e,Jo)},br=function(t,e){return mr(t,e,$o)},yr=function(t,e,n){return _o(t,t,Jn(e),Eo(n))},xr=function(t,e){return Do(t,e)},wr=function(t,e){return nn(t.element(),e.event().target())},zr=function(t){if(!kt(t,"can")&&!kt(t,"abort")&&!kt(t,"run"))throw new Error("EventHandler defined by: "+xo(t,null,2)+" does not have can, abort, or run!");return Uo("Extracting event.handler",Ho([dr("can",U(!0)),dr("abort",U(!1)),dr("run",N)]),t)},Sr=function(n){var e,o,r,i,t=(e=n,o=function(t){return t.can},function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return D(e,function(t,e){return t&&o(e).apply(undefined,n)},!0)}),u=(r=n,i=function(t){return t.abort},function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return D(r,function(t,e){return t||i(e).apply(undefined,n)},!1)});return zr({can:t,abort:u,run:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];T(n,function(t){t.run.apply(undefined,e)})}})},kr=function(t,e){Hr(t,t.element(),e,{})},Cr=function(t,e,n){Hr(t,t.element(),e,n)},Or=function(t){kr(t,Se())},Mr=function(t,e,n){Hr(t,e,n,{})},Hr=function(t,e,n,o){var r=Gn({target:e},o);t.getSystem().triggerEvent(n,e,et(r,U))},Er=function(t,e,n,o){t.getSystem().triggerEvent(n,e,o.event())};function Vr(t,e,n,o,r){return t(n,o)?P.some(n):S(r)&&r(n)?P.none():e(n,o,r)}var Tr,Ar,Br,Dr=function(t){var e=zn(t)?t.dom().parentNode:t.dom();return e!==undefined&&null!==e&&e.ownerDocument.body.contains(e)},_r=Gt(function(){return Fr(Ne.fromDom(document))}),Fr=function(t){var e=t.dom().body;if(null===e||e===undefined)throw new Error("Body is not available yet");return Ne.fromDom(e)},Lr=function(t,e,n){for(var o=t.dom(),r=S(n)?n:U(!1);o.parentNode;){o=o.parentNode;var i=Ne.fromDom(o);if(e(i))return P.some(i);if(r(i))break}return P.none()},Ir=function(t,e,n){return Vr(function(t){return e(t)},Lr,t,e,n)},Rr=function(t,o){var r=function(t){for(var e=0;e<t.childNodes.length;e++){if(o(Ne.fromDom(t.childNodes[e])))return P.some(Ne.fromDom(t.childNodes[e]));var n=r(t.childNodes[e]);if(n.isSome())return n}return P.none()};return r(t.dom())},Nr=function(t,e,n){return Ir(t,function(t){return e(t).isSome()},n).bind(e)},Pr=function(t){return zt(t)},jr=function(t,e){return{key:t,value:zr({abort:e})}},Ur=function(t){return{key:t,value:zr({run:function(t,e){e.event().prevent()}})}},Wr=function(t,e){return{key:t,value:zr({run:e})}},Gr=function(t,e,n){return{key:t,value:zr({run:function(t){e.apply(undefined,[t].concat(n))}})}},Xr=function(t){return function(n){return{key:t,value:zr({run:function(t,e){wr(t,e)&&n(t,e)}})}}},Yr=function(t,e,n){var o,r,i=e.partUids[n];return r=i,Wr(o=t,function(t,e){t.getSystem().getByUid(r).each(function(t){Er(t,t.element(),o,e)})})},qr=function(t,r){return Wr(t,function(e,t){var n=t.event(),o=e.getSystem().getByDom(n.target()).fold(function(){return Nr(n.target(),function(t){return e.getSystem().getByDom(t).toOption()},U(!1)).getOr(e)},function(t){return t});r(e,o,t)})},Kr=function(t){return Wr(t,function(t,e){e.cut()})},Jr=function(t){return Wr(t,function(t,e){e.stop()})},$r=function(t,e){return Xr(t)(e)},Qr=Xr(Ae()),Zr=Xr(Be()),ti=Xr(Ve()),ei=(Tr=Se(),function(t){return Wr(Tr,t)}),ni=Pr([(Ar=ye(),Br=function(t,e){var n,o,r=e.event().originator(),i=e.event().target();return o=i,!(nn(n=r,t.element())&&!nn(n,o)&&(console.warn(ye()+" did not get interpreted by the desired target. \nOriginator: "+An(r)+"\nTarget: "+An(i)+"\nCheck the "+ye()+" event handlers"),1))},{key:Ar,value:zr({can:Br})})]),oi=Object.freeze({events:ni}),ri=U("alloy-id-"),ii=U("data-alloy-id"),ui=ri(),ai=ii(),ci=function(t,e){Object.defineProperty(t.dom(),ai,{value:e,writable:!0})},si=function(t){var e=wn(t)?t.dom()[ai]:null;return P.from(e)},li=function(t){return Un(t)},fi=d,di=function(e){var t=function(t){return function(){throw new Error("The component must be in a context to send: "+t+"\n"+An(e().element())+" is not in context.")}};return{debugInfo:U("fake"),triggerEvent:t("triggerEvent"),triggerFocus:t("triggerFocus"),triggerEscape:t("triggerEscape"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),broadcast:t("broadcast"),broadcastOn:t("broadcastOn"),broadcastEvent:t("broadcastEvent"),isConnected:U(!1)}},mi=di(),hi=function(t){return V(t,function(t){return o=e="/*",r=(n=t).length-e.length,""!==o&&(n.length<o.length||n.substr(r,r+o.length)!==o)?t:t.substring(0,t.length-"/*".length);var e,n,o,r})},gi=function(t,e){var n=t.toString(),o=n.indexOf(")")+1,r=n.indexOf("("),i=n.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:hi(i)}},t},vi=Un("alloy-premade"),pi=function(t){return wt(vi,t)},bi=function(o){return t=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return o.apply(undefined,[t.getApis()].concat([t].concat(e)))},e=o.toString(),n=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,n-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:hi(i.slice(1))}},t;var t,e,n,r,i},yi={init:function(){return xi({readState:function(){return"No State required"}})}},xi=function(t){return t},wi=function(t,r){var i={};return tt(t,function(t,o){tt(t,function(t,e){var n=yt(e,[])(i);i[e]=n.concat([r(o,t)])})}),i},zi=function(t){return{classes:t.classes!==undefined?t.classes:[],attributes:t.attributes!==undefined?t.attributes:{},styles:t.styles!==undefined?t.styles:{}}},Si=function(t,e){return n=f.apply(undefined,[t.handler].concat(e)),o=t.purpose(),{cHandler:n,purpose:U(o)};var n,o},ki=function(t){return t.cHandler},Ci=function(t,e){return{name:U(t),handler:U(e)}},Oi=function(t,e,n){var o,r,i=Gn({},n,(o=t,r={},T(e,function(t){r[t.name()]=t.handlers(o)}),r));return wi(i,Ci)},Mi=function(t){var e,i=S(e=t)?{can:U(!0),abort:U(!1),run:e}:e;return function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=[t,e].concat(n);i.abort.apply(undefined,r)?e.stop():i.can.apply(undefined,r)&&i.run.apply(undefined,r)}},Hi=function(t,e,n){var o,r,i=e[n];return i?function(u,a,t,c){var e=t.slice(0);try{var n=e.sort(function(t,e){var n=t[a](),o=e[a](),r=c.indexOf(n),i=c.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+n+".\nOrder specified: "+xo(c,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+xo(c,null,2));return r<i?-1:i<r?1:0});return ft.value(n)}catch(o){return ft.error([o])}}("Event: "+n,"name",t,i).map(function(t){var e=V(t,function(t){return t.handler()});return Sr(e)}):(o=n,r=t,ft.error(["The event ("+o+') 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: '+xo(V(r,function(t){return t.name()}),null,2)]))},Ei=function(t,i){var e=ot(t,function(o,r){return(1===o.length?ft.value(o[0].handler()):Hi(o,i,r)).map(function(t){var e=Mi(t),n=1<o.length?A(i,function(e){return M(o,function(t){return t.name()===e})}).join(" > "):o[0].name();return wt(r,{handler:e,purpose:U(n)})})});return St(e,{})},Vi=function(t){return Po("custom.definition",Eo([_o("dom","dom",$n(),Eo([Zo("tag"),dr("styles",{}),dr("classes",[]),dr("attributes",{}),ar("value"),ar("innerHtml")])),Zo("components"),Zo("uid"),dr("events",{}),dr("apis",{}),_o("eventOrder","eventOrder",(e={"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing"],mousedown:["focusing","alloy.base.behaviour","item-type-events"]},Kn.mergeWithThunk(U(e))),Xo()),ar("domModification")]),t);var e},Ti=function(t,e){var n=Mn(t,e);return n===undefined||""===n?[]:n.split(" ")},Ai=function(t){return t.dom().classList!==undefined},Bi=function(t,e){return r=e,i=Ti(n=t,o="class").concat([r]),Cn(n,o,i.join(" ")),!0;var n,o,r,i},Di=function(t,e){return r=e,0<(i=A(Ti(n=t,o="class"),function(t){return t!==r})).length?Cn(n,o,i.join(" ")):En(n,o),!1;var n,o,r,i},_i=function(t,e){Ai(t)?t.dom().classList.add(e):Bi(t,e)},Fi=function(t){0===(Ai(t)?t.dom().classList:Ti(t,"class")).length&&En(t,"class")},Li=function(t,e){Ai(t)?t.dom().classList.remove(e):Di(t,e),Fi(t)},Ii=function(t,e){return Ai(t)&&t.dom().classList.contains(e)},Ri=function(e,t){T(t,function(t){_i(e,t)})},Ni=function(e,t){T(t,function(t){Li(e,t)})},Pi=function(t){return t.style!==undefined},ji=function(t,e,n){if(!x(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Pi(t)&&t.style.setProperty(e,n)},Ui=function(t,e){Pi(t)&&t.style.removeProperty(e)},Wi=function(t,e,n){var o=t.dom();ji(o,e,n)},Gi=function(t,e){var n=t.dom();tt(e,function(t,e){ji(n,e,t)})},Xi=function(t,e){var n=t.dom(),o=window.getComputedStyle(n).getPropertyValue(e),r=""!==o||Dr(t)?o:Yi(n,e);return null===r?undefined:r},Yi=function(t,e){return Pi(t)?t.style.getPropertyValue(e):""},qi=function(t,e){var n=t.dom(),o=Yi(n,e);return P.from(o).filter(function(t){return 0<t.length})},Ki=function(t,e,n){var o=Ne.fromTag(t);return Wi(o,e,n),qi(o,e).isSome()},Ji=function(t,e){var n=t.dom();Ui(n,e),Hn(t,"style")&&""===Mn(t,"style").replace(/^\s+|\s+$/g,"")&&En(t,"style")},$i=function(t){return t.dom().offsetWidth},Qi=function(t){return t.dom().value},Zi=function(t,e){if(e===undefined)throw new Error("Value.set was undefined");t.dom().value=e},tu=function(t,e){return n=t,r=V(o=e,function(t){return fr(t.name(),[Zo("config"),dr("state",yi)])}),i=Po("component.behaviours",Eo(r),n.behaviours).fold(function(t){throw new Error(Wo(t)+"\nComplete spec:\n"+xo(n,null,2))},function(t){return t}),{list:o,data:et(i,function(t){var e=t.map(function(t){return{config:t.config,state:t.state.init(t.config)}});return function(){return e}})};var n,o,r,i},eu=function(t){var e,n,o,r=(e=t,n=yt("behaviours",{})(e),o=A(Q(n),function(t){return n[t]!==undefined}),V(o,function(t){return n[t].me}));return tu(t,r)},nu=function(t,e,n){var o,r,i,u=Gn({},(o=t).dom,{uid:o.uid,domChildren:V(o.components,function(t){return t.element()})}),a=t.domModification.fold(function(){return zi({})},zi),c={"alloy.base.modification":a},s=0<e.length?function(e,t,n,o){var r=Gn({},t);T(n,function(t){r[t.name()]=t.exhibit(e,o)});var i=wi(r,function(t,e){return{name:t,modification:e}}),u=function(t){return B(t,function(t,e){return Gn({},e.modification,t)},{})},a=B(i.classes,function(t,e){return e.modification.concat(t)},[]),c=u(i.attributes),s=u(i.styles);return zi({classes:a,attributes:c,styles:s})}(n,c,e,u):a;return i=s,Gn({},r=u,{attributes:Gn({},r.attributes,i.attributes),styles:Gn({},r.styles,i.styles),classes:r.classes.concat(i.classes)})},ou=function(t,e,n){var o,r,i,u,a,c,s={"alloy.base.behaviour":(o=t,o.events)};return(r=n,i=t.eventOrder,u=e,a=s,c=Oi(r,u,a),Ei(c,i)).getOrDie()},ru=function(n){var t=function(){return l},o=Ct(mi),e=jo(Vi(n)),r=eu(n),i=r.list,u=r.data,a=function(t){var e=Ne.fromTag(t.tag);On(e,t.attributes),Ri(e,t.classes),Gi(e,t.styles),t.innerHtml.each(function(t){return bn(e,t)});var n=t.domChildren;return hn(e,n),t.value.each(function(t){Zi(e,t)}),t.uid,ci(e,t.uid),e}(nu(e,i,u)),c=ou(e,i,u),s=Ct(e.components),l={getSystem:o.get,config:function(t){var e=u;return(S(e[t.name()])?e[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+xo(n,null,2))})()},hasConfigured:function(t){return S(u[t.name()])},spec:U(n),readState:function(t){return u[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return e.apis},connect:function(t){o.set(t)},disconnect:function(){o.set(di(t))},element:U(a),syncComponents:function(){var t=cn(a),e=j(t,function(t){return o.get().getByDom(t).fold(function(){return[]},function(t){return[t]})});s.set(e)},components:s.get,events:U(c)};return l},iu=function(t){var e,n,o=fi(t),r=o.events,i=Xn(o,["events"]),u=(e=i,n=yt("components",[])(e),V(n,su)),a=Gn({},i,{events:Gn({},oi,r),components:u});return ft.value(ru(a))},uu=function(t){var e=Ne.fromText(t);return au({element:e})},au=function(t){var e=Uo("external.component",Ho([Zo("element"),ar("uid")]),t),n=Ct(di());e.uid.each(function(t){ci(e.element,t)});var o={getSystem:n.get,config:P.none,hasConfigured:U(!1),connect:function(t){n.set(t)},disconnect:function(){n.set(di(function(){return o}))},getApis:function(){return{}},element:U(e.element),spec:U(t),readState:U("No state"),syncComponents:N,components:U([]),events:U({})};return pi(o)},cu=li,su=function(e){return(t=e,xt(t,vi)).fold(function(){var t=e.hasOwnProperty("uid")?e:Gn({uid:cu("")},e);return iu(t).getOrDie()},function(t){return t});var t},lu=pi,fu=function(t,e,n){return Lr(t,function(t){return Ze(t,e)},n)},du=function(t,e){return n=e,r=(o=t)===undefined?document:o.dom(),tn(r)?P.none():P.from(r.querySelector(n)).map(Ne.fromDom);var n,o,r},mu=function(t,e,n){return Vr(Ze,fu,t,e,n)},hu=function(e,t){return(n=t,Ir(n,function(t){if(!wn(t))return!1;var e=Mn(t,"id");return e!==undefined&&-1<e.indexOf("aria-owns")}).bind(function(t){var e=Mn(t,"id"),n=on(t);return du(n,'[aria-owns="'+e+'"]')})).exists(function(t){return gu(e,t)});var n},gu=function(e,t){return n=t,r=U(!(o=function(t){return nn(t,e.element())})),Ir(n,o,r).isSome()||hu(e,t);var n,o,r},vu=U([Zo("menu"),Zo("selectedMenu")]),pu=U([Zo("item"),Zo("selectedItem")]),bu=(U(Eo(pu().concat(vu()))),U(Eo(pu()))),yu=rr("initSize",[Zo("numColumns"),Zo("numRows")]),xu=function(){return rr("markers",[Zo("backgroundMenu")].concat(vu()).concat(pu()))},wu=function(t){return rr("markers",V(t,Zo))},zu=function(t,e,n){return function(){var t=new Error;if(t.stack!==undefined){var e=t.stack.split("\n");_(e,function(e){return 0<e.indexOf("alloy")&&!H(Ln,function(t){return-1<e.indexOf(t)})}).getOr(Bn)}}(),_o(e,e,n,Ro(function(n){return ft.value(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.apply(undefined,t)})}))},Su=function(t){return zu(0,t,Jn(N))},ku=function(t){return zu(0,t,Jn(P.none))},Cu=function(t){return zu(0,t,$n())},Ou=function(t){return zu(0,t,$n())},Mu=function(t,e){return xr(t,U(e))},Hu=function(t){return xr(t,d)},Eu=U(yu),Vu=function(n,o,r){return ti(function(t,e){r(t,n,o)})},Tu=function(t,e,n,o,r,i){var u,a,c=Ho(t),s=fr(e,[(u="config",a=t,_o(u,u,Qn(),Ho(a)))]);return Du(c,s,e,n,o,r,i)},Au=function(r,i,u){var t,e,n,o,a,c;return t=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];var o=[n].concat(t);return n.config({name:U(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(t){var e=Array.prototype.slice.call(o,1);return i.apply(undefined,[n,t.config,t.state].concat(e))})},e=u,n=i.toString(),o=n.indexOf(")")+1,a=n.indexOf("("),c=n.substring(a+1,o-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:e,parameters:hi(c.slice(0,1).concat(c.slice(3)))}},t},Bu=function(t){return{key:t,value:undefined}},Du=function(n,t,o,r,e,i,u){var a=function(t){return kt(t,o)?t[o]():P.none()},c=et(e,function(t,e){return Au(o,t,e)}),s=et(i,function(t,e){return gi(t,e)}),l=Gn({},s,c,{revoke:f(Bu,o),config:function(t){var e=Uo(o+"-config",n,t);return{key:o,value:{config:e,me:l,configAsRaw:Gt(function(){return Uo(o+"-config",n,t)}),initialConfig:t,state:u}}},schema:function(){return t},exhibit:function(t,n){return a(t).bind(function(e){return xt(r,"exhibit").map(function(t){return t(n,e.config,e.state)})}).getOr(zi({}))},name:function(){return o},handlers:function(t){return a(t).map(function(t){return yt("events",function(t,e){return{}})(r)(t.config,t.state)}).getOr({})}});return l},_u=function(t){return zt(t)},Fu=Ho([Zo("fields"),Zo("name"),dr("active",{}),dr("apis",{}),dr("state",yi),dr("extra",{})]),Lu=function(t){var e=Uo("Creating behaviour: "+t.name,Fu,t);return Tu(e.fields,e.name,e.active,e.apis,e.extra,e.state)},Iu=Ho([Zo("branchKey"),Zo("branches"),Zo("name"),dr("active",{}),dr("apis",{}),dr("state",yi),dr("extra",{})]),Ru=function(t){var e,n,o,r,i,u,a,c,s=Uo("Creating behaviour: "+t.name,Iu,t);return e=Go(s.branchKey,s.branches),n=s.name,o=s.active,r=s.apis,i=s.extra,u=s.state,c=fr(n,[cr("config",a=e)]),Du(a,c,n,o,r,i,u)},Nu=U(undefined),Pu=Object.freeze({events:function(a){return Pr([Wr(ze(),function(r,i){var t,e,u=a.channels,n=Q(u),o=(t=n,(e=i).universal()?t:A(t,function(t){return M(e.channels(),t)}));T(o,function(t){var e=u[t],n=e.schema,o=Uo("channel["+t+"] data\nReceiver: "+An(r.element()),n,i.data());e.onReceive(r,o)})})])}}),ju=[tr("channels",No(ft.value,Ho([Cu("onReceive"),dr("schema",Xo())])))],Uu=Lu({fields:ju,name:"receiving",active:Pu}),Wu=Object.freeze({exhibit:function(t,e){return zi({classes:[],styles:e.useFixed?{}:{position:"relative"}})}}),Gu=function(n,o){return{left:U(n),top:U(o),translate:function(t,e){return Gu(n+t,o+e)}}},Xu=Gu,Yu=function(t,e){return t!==undefined?t:e!==undefined?e:0},qu=function(t){var e,n,o=t.dom().ownerDocument,r=o.body,i=(e=Ne.fromDom(o),(n=e.dom())===n.window&&e instanceof Window?e:Sn(e)?n.defaultView||n.parentWindow:null),u=o.documentElement,a=Yu(i.pageYOffset,u.scrollTop),c=Yu(i.pageXOffset,u.scrollLeft),s=Yu(u.clientTop,r.clientTop),l=Yu(u.clientLeft,r.clientLeft);return Ku(t).translate(c-l,a-s)},Ku=function(t){var e,n,o,r=t.dom(),i=r.ownerDocument,u=i.body,a=Ne.fromDom(i.documentElement);return u===r?Xu(u.offsetLeft,u.offsetTop):(e=t,n=a||Ne.fromDom(document.documentElement),Lr(e,f(nn,n)).isSome()?(o=r.getBoundingClientRect(),Xu(o.left,o.top)):Xu(0,0))},Ju=(pe.detect().browser.isSafari(),function(t){var e=t!==undefined?t.dom():document,n=e.body.scrollLeft||e.documentElement.scrollLeft,o=e.body.scrollTop||e.documentElement.scrollTop;return Xu(n,o)});function $u(o,r){var t=function(t){var e=r(t);if(e<=0||null===e){var n=Xi(t,o);return parseFloat(n)||0}return e},i=function(r,t){return D(t,function(t,e){var n=Xi(r,e),o=n===undefined?0:parseInt(n,10);return isNaN(o)?t:t+o},0)};return{set:function(t,e){if(!k(e)&&!e.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+e);var n=t.dom();Pi(n)&&(n.style[o]=e+"px")},get:t,getOuter:t,aggregate:i,max:function(t,e,n){var o=i(t,n);return o<e?e-o:0}}}var Qu,Zu,ta=$u("width",function(t){return t.dom().offsetWidth}),ea=function(t){return ta.get(t)},na=function(t){return ta.getOuter(t)},oa=$u("height",function(t){var e=t.dom();return Dr(t)?e.getBoundingClientRect().height:e.offsetHeight}),ra=function(t){return oa.get(t)},ia=function(t){return oa.getOuter(t)},ua=We(["x","y","width","height","maxHeight","direction","classes","label","candidateYforTest"],[]),aa=Pe("position","left","top","right","bottom"),ca=dt([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),sa=ca.southeast,la=ca.southwest,fa=ca.northeast,da=ca.northwest,ma=ca.south,ha=ca.north,ga=ca.east,va=ca.west,pa=Pe("point","width","height"),ba=Pe("x","y","width","height"),ya=function(t,e,n,o){return{x:U(t),y:U(e),width:U(n),height:U(o),right:U(t+n),bottom:U(e+o)}},xa=function(t){var e=qu(t),n=na(t),o=ia(t);return ya(e.left(),e.top(),n,o)},wa=function(o,t){return o.view(t).fold(U([]),function(t){var e=o.owner(t),n=wa(o,e);return[t].concat(n)})},za=Object.freeze({view:function(t){return(t.dom()===document?P.none():P.from(t.dom().defaultView.frameElement)).map(Ne.fromDom)},owner:function(t){return on(t)}}),Sa=function(o){var t,e,n,r,i=Ne.fromDom(document),u=Ju(i);return(t=o,n=(e=za).owner(t),r=wa(e,n),P.some(r)).fold(f(qu,o),function(t){var e=Ku(o),n=B(t,function(t,e){var n=Ku(e);return{left:t.left+n.left(),top:t.top+n.top()}},{left:0,top:0});return Xu(n.left+e.left()+u.left(),n.top+e.top()+u.top())})},ka=function(){var t=window.innerWidth,e=window.innerHeight,n=Ne.fromDom(document),o=Ju(n);return ya(o.left(),o.top(),t,e)},Ca=dt([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Oa=function(t,e,n,o,r,i){var u,a,c,s,l,f,d,m,h,g=e.x()-n,v=e.y()-o,p=r-(g+e.width()),b=i-(v+e.height()),y=P.some(g),x=P.some(v),w=P.some(p),z=P.some(b),S=P.none();return u=e.direction(),a=function(){return aa(t,y,x,S,S)},c=function(){return aa(t,S,x,w,S)},s=function(){return aa(t,y,S,S,z)},l=function(){return aa(t,S,S,w,z)},f=function(){return aa(t,y,x,S,S)},d=function(){return aa(t,y,S,S,z)},m=function(){return aa(t,y,x,S,S)},h=function(){return aa(t,S,x,w,S)},u.fold(a,c,s,l,f,d,m,h)},Ma=function(t,e){var n=f(Sa,e),o=t.fold(n,n,function(){var t=Ju();return Sa(e).translate(-t.left(),-t.top())}),r=na(e),i=ia(e);return ya(o.left(),o.top(),r,i)},Ha=Ca.relative,Ea=Ca.fixed,Va=Pe("anchorBox","origin"),Ta=dt([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),Aa=function(t,L,I,R,N){var P=I.width(),j=I.height(),o=function(t,o,r,i){var e,n,u,a,c,s,l,f,d,m,h,g,v,p,b,y,x,w,z,S,k,C,O,M,H,E,V,T,A,B,D,_,F=t(L,I,R);return(n=P,u=j,a=N,d=(e=F).x(),m=e.y(),h=e.bubble().offset().left(),g=e.bubble().offset().top(),v=a.x(),p=a.y(),b=a.width(),y=a.height(),S=p<=(w=m+g),k=(z=v<=(x=d+h))&&S,C=x+n<=v+b&&w+u<=p+y,O=z?Math.min(n,v+b-x):Math.abs(v-(x+n)),M=S?Math.min(u,p+y-w):Math.abs(p-(w+u)),H=a.x()+a.width(),E=Math.max(a.x(),x),V=Math.min(E,H),A=U((T=S?w:w+(u-M))+M-p),B=U(p+y-T),c=e.direction(),l=s=B,f=A,D=c.fold(s,s,f,f,s,f,l,l),_=ua({x:V,y:T,width:O,height:M,maxHeight:D,direction:e.direction(),classes:{on:e.bubble().classesOn(),off:e.bubble().classesOff()},label:e.label(),candidateYforTest:w}),k&&C?Ta.fit(_):Ta.nofit(_,O,M)).fold(Ta.fit,function(t,e,n){return i<n||r<e?Ta.nofit(t,e,n):Ta.nofit(o,r,i)})};return D(t,function(t,e){var n=f(o,e);return t.fold(Ta.fit,n)},Ta.nofit(ua({x:L.x(),y:L.y(),width:I.width(),height:I.height(),maxHeight:I.height(),direction:sa(),classes:[],label:"none",candidateYforTest:L.y()}),-1,-1)).fold(d,d)},Ba=function(t,e,n,o){Ji(e,"max-height");var r,i={width:U(na(r=e)),height:U(ia(r))};return Aa(o.preference(),t,i,n,o.bounds())},Da=function(t,e,n){var o,r,i,u,a,c=function(t){return t+"px"},s=(o=n.origin(),r=e,o.fold(function(){return aa("absolute",P.some(r.x()),P.some(r.y()),P.none(),P.none())},function(t,e,n,o){return Oa("absolute",r,t,e,n,o)},function(t,e,n,o){return Oa("fixed",r,t,e,n,o)}));i=t,u={position:P.some(s.position()),left:s.left().map(c),top:s.top().map(c),right:s.right().map(c),bottom:s.bottom().map(c)},a=i.dom(),tt(u,function(t,e){t.fold(function(){Ui(a,e)},function(t){ji(a,e,t)})})},_a=function(t,e){var n,o,r;n=t,o=Math.floor(e),r=oa.max(n,o,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]),Wi(n,"max-height",r+"px")},Fa=U(function(t,e){_a(t,e),Gi(t,{"overflow-x":"hidden","overflow-y":"auto"})}),La=U(function(t,e){_a(t,e)}),Ia=We(["bounds","origin","preference","maxHeightFunction"],[]),Ra=function(t,e,n,o,r,i){var u,a,c,s,l,f=(u=i,a="maxHeightFunction",c=Fa(),u[a]===undefined?c:u[a]),d=t.anchorBox(),m=t.origin(),h=Ia({bounds:(s=m,l=r,l.fold(function(){return s.fold(ka,ka,ya)},function(t){return s.fold(t,t,ya)})),origin:m,preference:o,maxHeightFunction:f});Na(d,e,n,h)},Na=function(t,e,n,o){var r,i,u,a,c=Ba(t,e,n,o);Da(e,c,o),r=e,i=c.classes(),Ni(r,i.off),Ri(r,i.on),u=e,a=c,o.maxHeightFunction()(u,a.maxHeight())},Pa=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],ja=function(t,e,n){var r=function(t){return xt(n,t).getOr([])},o=function(t,e,n){var o=Y(Pa,n);return{offset:function(){return Xu(t,e)},classesOn:function(){return j(n,r)},classesOff:function(){return j(o,r)}}};return{southeast:function(){return o(-t,e,["top","alignLeft"])},southwest:function(){return o(t,e,["top","alignRight"])},south:function(){return o(-t/2,e,["top","alignCentre"])},northeast:function(){return o(-t,-e,["bottom","alignLeft"])},northwest:function(){return o(t,-e,["bottom","alignRight"])},north:function(){return o(-t/2,-e,["bottom","alignCentre"])},east:function(){return o(t,-e/2,["valignCentre","left"])},west:function(){return o(-t,-e/2,["valignCentre","right"])}}},Ua=function(){return ja(0,0,{})},Wa=Pe("x","y","bubble","direction","label"),Ga=function(t){return t.x()},Xa=function(t,e){return t.x()+t.width()/2-e.width()/2},Ya=function(t,e){return t.x()+t.width()-e.width()},qa=function(t,e){return t.y()-e.height()},Ka=function(t){return t.y()+t.height()},Ja=function(t,e){return t.y()+t.height()/2-e.height()/2},$a=function(t,e,n){return Wa(Ga(t),Ka(t),n.southeast(),sa(),"layout-se")},Qa=function(t,e,n){return Wa(Ya(t,e),Ka(t),n.southwest(),la(),"layout-sw")},Za=function(t,e,n){return Wa(Ga(t),qa(t,e),n.northeast(),fa(),"layout-ne")},tc=function(t,e,n){return Wa(Ya(t,e),qa(t,e),n.northwest(),da(),"layout-nw")},ec=function(t,e,n){return Wa(Xa(t,e),qa(t,e),n.north(),ha(),"layout-n")},nc=function(t,e,n){return Wa(Xa(t,e),Ka(t),n.south(),ma(),"layout-s")},oc=function(t,e,n){return Wa((o=t).x()+o.width(),Ja(t,e),n.east(),ga(),"layout-e");var o},rc=function(t,e,n){return Wa((o=e,t.x()-o.width()),Ja(t,e),n.west(),va(),"layout-w");var o},ic=function(){return[$a,Qa,Za,tc,nc,ec,oc,rc]},uc=function(){return[Qa,$a,tc,Za,nc,ec,oc,rc]},ac=function(t){return t},cc=function(e,n){return function(t){return"rtl"===sc(t)?n:e}},sc=function(t){return"rtl"===Xi(t,"direction")?"rtl":"ltr"},lc=function(){return fr("layouts",[Zo("onLtr"),Zo("onRtl")])},fc=function(e,t,n,o){var r=t.layouts.map(function(t){return t.onLtr(e)}).getOr(n),i=t.layouts.map(function(t){return t.onRtl(e)}).getOr(o);return cc(r,i)(e)},dc=[Zo("hotspot"),lc(),Mu("placement",function(t,e,n){var o=e.hotspot,r=Ma(n,o.element()),i=fc(t.element(),e,ic(),uc());return P.some(ac({anchorBox:r,bubble:Ua(),overrides:{},layouts:i,placer:P.none()}))})],mc=[Zo("x"),Zo("y"),dr("height",0),dr("width",0),dr("bubble",Ua()),lc(),Mu("placement",function(t,e,n){var o=ya(e.x,e.y,e.width,e.height),r=fc(t.element(),e,ic(),uc());return P.some(ac({anchorBox:o,bubble:e.bubble,overrides:{},layouts:r,placer:P.none()}))})],hc=(dt([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),dt([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}])),gc=Pe("start","soffset","finish","foffset"),vc=(hc.domRange,hc.relative,hc.exact),pc=function(t,e,n,o){var r,i,u,a,c,s=(i=e,u=n,a=o,(c=on(r=t).dom().createRange()).setStart(r.dom(),i),c.setEnd(u.dom(),a),c),l=nn(t,n)&&e===o;return s.collapsed&&!l},bc=function(t,e,n){var o,r,i=t.document.createRange();return o=i,e.fold(function(t){o.setStartBefore(t.dom())},function(t,e){o.setStart(t.dom(),e)},function(t){o.setStartAfter(t.dom())}),r=i,n.fold(function(t){r.setEndBefore(t.dom())},function(t,e){r.setEnd(t.dom(),e)},function(t){r.setEndAfter(t.dom())}),i},yc=function(t,e,n,o,r){var i=t.document.createRange();return i.setStart(e.dom(),n),i.setEnd(o.dom(),r),i},xc=function(t){return{left:U(t.left),top:U(t.top),right:U(t.right),bottom:U(t.bottom),width:U(t.width),height:U(t.height)}},wc=dt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),zc=function(t,e,n){return e(Ne.fromDom(n.startContainer),n.startOffset,Ne.fromDom(n.endContainer),n.endOffset)},Sc=function(t,e){var r,n,o,i=(r=t,e.match({domRange:function(t){return{ltr:U(t),rtl:P.none}},relative:function(t,e){return{ltr:Gt(function(){return bc(r,t,e)}),rtl:Gt(function(){return P.some(bc(r,e,t))})}},exact:function(t,e,n,o){return{ltr:Gt(function(){return yc(r,t,e,n,o)}),rtl:Gt(function(){return P.some(yc(r,n,o,t,e))})}}}));return(o=(n=i).ltr()).collapsed?n.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return wc.rtl(Ne.fromDom(t.endContainer),t.endOffset,Ne.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return zc(0,wc.ltr,o)}):zc(0,wc.ltr,o)},kc=function aE(n,o){var r=function(t){return n(t)?P.from(t.dom().nodeValue):P.none()},t=pe.detect().browser,e=t.isIE()&&10===t.version.major?function(t){try{return r(t)}catch(e){return P.none()}}:r;return{get:function(t){if(!n(t))throw new Error("Can only get "+o+" value of a "+o+" node");return e(t).getOr("")},getOption:e,set:function(t,e){if(!n(t))throw new Error("Can only set raw "+o+" value of a "+o+" node");t.dom().nodeValue=e}}}(zn,"text"),Cc=function(t){return kc.get(t)},Oc=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(t,e){return en(e,t)}),Mc=function(t){var e=Ne.fromDom(t.anchorNode),n=Ne.fromDom(t.focusNode);return pc(e,t.anchorOffset,n,t.focusOffset)?P.some(gc(Ne.fromDom(t.anchorNode),t.anchorOffset,Ne.fromDom(t.focusNode),t.focusOffset)):function(t){if(0<t.rangeCount){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return P.some(gc(Ne.fromDom(e.startContainer),e.startOffset,Ne.fromDom(n.endContainer),n.endOffset))}return P.none()}(t)},Hc=function(t,e){var i,n,o,r,u=Sc(i=t,e).match({ltr:function(t,e,n,o){var r=i.document.createRange();return r.setStart(t.dom(),e),r.setEnd(n.dom(),o),r},rtl:function(t,e,n,o){var r=i.document.createRange();return r.setStart(n.dom(),o),r.setEnd(t.dom(),e),r}});return o=(n=u).getClientRects(),0<(r=0<o.length?o[0]:n.getBoundingClientRect()).width||0<r.height?P.some(r).map(xc):P.none()},Ec=Pe("element","offset"),Vc=dt([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Tc=function(t){return t.fold(function(t){return t},function(t,e,n){return t.translate(-e,-n)})},Ac=function(t){return t.fold(function(t){return t},function(t,e,n){return t})},Bc=function(t){return D(t,function(t,e){return t.translate(e.left(),e.top())},Xu(0,0))},Dc=function(t){var e=V(t,Ac);return Bc(e)},_c=Vc.screen,Fc=Vc.absolute,Lc=function(t,e,n){var o,r,i,u=on(t.element()),a=Ju(u),c=(o=t,r=n,i=rn(r.root).dom(),P.from(i.frameElement).map(Ne.fromDom).filter(function(t){var e=on(t),n=on(o.element());return nn(e,n)}).map(qu)).getOr(a);return Fc(c,a.left(),a.top())},Ic=function(t,e,n,o){var r=t,i=e,u=n,a=o;t<0&&(r=0,u=n+t),e<0&&(i=0,a=o+e);var c=_c(Xu(r,i));return P.some(pa(c,u,a))},Rc=function(t,c,s,l,f){return t.map(function(t){var e,n,o,r=[c,t.point()],i=(e=function(){return Dc(r)},n=function(){return Dc(r)},o=function(){return t=V(r,Tc),Bc(t);var t},l.fold(e,n,o)),u=ba(i.left(),i.top(),t.width(),t.height()),a=fc(f,s,s.showAbove?[Za,tc,$a,Qa,ec,nc]:[$a,Qa,Za,tc,nc,nc],s.showAbove?[tc,Za,Qa,$a,ec,nc]:[Qa,$a,tc,Za,nc,ec]);return ac({anchorBox:u,bubble:s.bubble.getOr(Ua()),overrides:s.overrides,layouts:a,placer:P.none()})})},Nc=Pe("element","offset"),Pc=function(t,e){return zn(t)?Nc(t,e):function(t,e){var n=cn(t);if(0===n.length)return Ec(t,e);if(e<n.length)return Ec(n[e],0);var o=n[n.length-1],r=zn(o)?Cc(o).length:cn(o).length;return Ec(o,r)}(t,e)},jc=function(e,t){return t.getSelection.getOrThunk(function(){return function(){return t=e,P.from(t.getSelection()).filter(function(t){return 0<t.rangeCount}).bind(Mc);var t}})().map(function(t){var e=Pc(t.start(),t.soffset()),n=Pc(t.finish(),t.foffset());return gc(e.element(),e.offset(),n.element(),n.offset())})},Uc=[ar("getSelection"),Zo("root"),ar("bubble"),lc(),dr("overrides",{}),dr("showAbove",!1),Mu("placement",function(t,e,n){var o=rn(e.root).dom(),r=Lc(t,0,e),i=jc(o,e).bind(function(t){var e;return Hc(o,(e=t,hc.exact(e.start(),e.soffset(),e.finish(),e.foffset()))).orThunk(function(){var e=Ne.fromText("\ufeff");return ln(t.start(),e),Hc(o,vc(e,0,e,1)).map(function(t){return vn(e),t})}).bind(function(t){return Ic(t.left(),t.top(),t.width(),t.height())})}),u=jc(o,e).bind(function(t){return wn(t.start())?P.some(t.start()):un(t.start())}).getOr(t.element());return Rc(i,r,e,n,u)})],Wc=[Zo("node"),Zo("root"),ar("bubble"),lc(),dr("overrides",{}),dr("showAbove",!1),Mu("placement",function(r,i,u){var a=Lc(r,0,i);return i.node.bind(function(t){var e=t.dom().getBoundingClientRect(),n=Ic(e.left,e.top,e.width,e.height),o=i.node.getOr(r.element());return Rc(n,a,i,u,o)})})],Gc=function(t){return t.x()+t.width()},Xc=function(t,e){return t.x()-e.width()},Yc=function(t,e){return t.y()-e.height()+t.height()},qc=function(t){return t.y()},Kc=function(t,e,n){return Wa(Gc(t),qc(t),n.southeast(),sa(),"link-layout-se")},Jc=function(t,e,n){return Wa(Xc(t,e),qc(t),n.southwest(),la(),"link-layout-sw")},$c=function(t,e,n){return Wa(Gc(t),Yc(t,e),n.northeast(),fa(),"link-layout-ne")},Qc=function(t,e,n){return Wa(Xc(t,e),Yc(t,e),n.northwest(),da(),"link-layout-nw")},Zc=[Zo("item"),lc(),Mu("placement",function(t,e,n){var o=Ma(n,e.item.element()),r=fc(t.element(),e,[Kc,Jc,$c,Qc],[Jc,Kc,Qc,$c]);return P.some(ac({anchorBox:o,bubble:Ua(),overrides:{},layouts:r,placer:P.none()}))})],ts=Go("anchor",{selection:Uc,node:Wc,hotspot:dc,submenu:Zc,makeshift:mc}),es=function(t,e,n,o,r){var i,u=(i=n.anchorBox,Va(i,e));Ra(u,r.element(),n.bubble,n.layouts,o,n.overrides)},ns=function(e,t,n,o,r,i){var u=Uo("positioning anchor.info",ts,o);Wi(r.element(),"position","fixed");var a=qi(r.element(),"visibility");Wi(r.element(),"visibility","hidden");var c,s,l,f=t.useFixed?Ea(0,0,window.innerWidth,window.innerHeight):(s=qu((c=e).element()),l=c.element().dom().getBoundingClientRect(),Ha(s.left(),s.top(),l.width,l.height)),d=u.placement,m=i.map(function(t){return function(){return xa(t)}}).or(t.getBounds);d(e,u,f).each(function(t){t.placer.getOr(es)(e,f,t,m,r)}),a.fold(function(){Ji(r.element(),"visibility")},function(t){Wi(r.element(),"visibility",t)}),qi(r.element(),"left").isNone()&&qi(r.element(),"top").isNone()&&qi(r.element(),"right").isNone()&&qi(r.element(),"bottom").isNone()&&qi(r.element(),"position").is("fixed")&&Ji(r.element(),"position")},os=Object.freeze({position:function(t,e,n,o,r){var i=P.none();ns(t,e,n,o,r,i)},positionWithin:ns,getMode:function(t,e,n){return e.useFixed?"fixed":"absolute"}}),rs=[dr("useFixed",!1),ar("getBounds")],is=Lu({fields:rs,name:"positioning",active:Wu,apis:os}),us=function(t){kr(t,Be());var e=t.components();T(e,us)},as=function(t){var e=t.components();T(e,as),kr(t,Ae())},cs=function(t,e){ss(t,e,mn)},ss=function(t,e,n){t.getSystem().addToWorld(e),n(t.element(),e.element()),Dr(t.element())&&as(e),t.syncComponents()},ls=function(t){us(t),vn(t.element()),t.getSystem().removeFromWorld(t)},fs=function(e){var t=un(e.element()).bind(function(t){return e.getSystem().getByDom(t).fold(P.none,P.some)});ls(e),t.each(function(t){t.syncComponents()})},ds=function(t){var e=t.components();T(e,ls),gn(t.element()),t.syncComponents()},ms=function(t,e){hs(t,e,mn)},hs=function(t,e,n){n(t,e.element());var o=cn(e.element());T(o,function(t){e.getByDom(t).each(as)})},gs=function(e){var t=cn(e.element());T(t,function(t){e.getByDom(t).each(us)}),vn(e.element())},vs=function(t,e,n,o){var r=function(e,t,n,o){n.get().each(function(t){ds(e)});var r=t.getAttachPoint(e);cs(r,e);var i=e.getSystem().build(o);return cs(e,i),n.set(i),i}(t,e,n,o);return e.onOpen(t,r),r},ps=function(e,n,o){o.get().each(function(t){ds(e),fs(e),n.onClose(e,t),o.clear()})},bs=function(t,e,n){return n.isOpen()},ys=function(t,e,n){var o,r,i,u,a=e.getAttachPoint(t);Wi(t.element(),"position",is.getMode(a)),o=t,r="visibility",i=e.cloakVisibilityAttr,u="hidden",qi(o.element(),r).fold(function(){En(o.element(),i)},function(t){Cn(o.element(),i,t)}),Wi(o.element(),r,u)},xs=function(t,e,n){var o;o=t.element(),H(["top","left","right","bottom"],function(t){return qi(o,t).isSome()})||Ji(t.element(),"position"),function(t,e,n){if(Hn(t.element(),n)){var o=Mn(t.element(),n);Wi(t.element(),e,o)}else Ji(t.element(),e)}(t,"visibility",e.cloakVisibilityAttr)},ws=Object.freeze({cloak:ys,decloak:xs,open:vs,openWhileCloaked:function(t,e,n,o,r){ys(t,e,n),vs(t,e,n,o),r(),xs(t,e,n)},close:ps,isOpen:bs,isPartOf:function(e,n,t,o){return bs(0,0,t)&&t.get().exists(function(t){return n.isPartOf(e,t,o)})},getState:function(t,e,n){return n.get()}}),zs=Object.freeze({events:function(n,o){return Pr([Wr(He(),function(t,e){ps(t,n,o)})])}}),Ss=[Su("onOpen"),Su("onClose"),Zo("isPartOf"),Zo("getAttachPoint"),dr("cloakVisibilityAttr","data-precloak-visibility")],ks=Lu({fields:Ss,name:"sandboxing",active:zs,apis:ws,state:Object.freeze({init:function(){var e=Ct(P.none()),t=U("not-implemented");return xi({readState:t,isOpen:function(){return e.get().isSome()},clear:function(){e.set(P.none())},set:function(t){e.set(P.some(t))},get:function(t){return e.get()}})}})}),Cs=U("dismiss.popups"),Os=U("mouse.released"),Ms=Ho([dr("isExtraPart",U(!1)),fr("fireEventInstead",[dr("event",De())])]),Hs=function(t){var e=Es(t);return Uu.config(e)},Es=function(t){var n=Uo("Dismissal",Ms,t);return{channels:wt(Cs(),{schema:Ho([Zo("target")]),onReceive:function(e,t){ks.isOpen(e)&&(ks.isPartOf(e,t.target)||n.isExtraPart(e,t.target)||n.fireEventInstead.fold(function(){return ks.close(e)},function(t){return kr(e,t.event)}))}})}},Vs=function(o,t){return yr(o,{},V(t,function(t){return e=t.name(),n="Cannot configure "+t.name()+" for "+o,_o(e,e,Qn(),Mo(function(t){return co("The field: "+e+" is forbidden. "+n)}));var e,n}).concat([xr("dump",d)]))},Ts=function(t){return t.dump},As=function(t,e){return Gn({},t.dump,_u(e))},Bs=Vs,Ds=As,_s="placeholder",Fs=dt([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Ls=function(t,e,n,o){return n.uiType===_s?(i=n,u=o,(r=t).exists(function(t){return t!==i.owner})?Fs.single(!0,U(i)):xt(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+Q(u)+"]\nNamespace: "+r.getOr("none")+"\nSpec: "+xo(i,null,2))},function(t){return t.replace()})):Fs.single(!1,U(n));var r,i,u},Is=function(i,u,a,c){return Ls(i,0,a,c).fold(function(t,e){var n=e(u,a.config,a.validated),o=xt(n,"components").getOr([]),r=j(o,function(t){return Is(i,u,t,c)});return[Gn({},n,{components:r})]},function(t,e){var n=e(u,a.config,a.validated);return a.validated.preprocess.getOr(d)(n)})},Rs=function(e,n,t,o){var r,i,u,a=et(o,function(t,e){return o=t,r=!1,{name:U(n=e),required:function(){return o.fold(function(t,e){return t},function(t,e){return t})},used:function(){return r},replace:function(){if(!0===r)throw new Error("Trying to use the same placeholder more than once: "+n);return r=!0,o}};var n,o,r}),c=(r=e,i=n,u=a,j(t,function(t){return Is(r,i,t,u)}));return tt(a,function(t){if(!1===t.used()&&t.required())throw new Error("Placeholder: "+t.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+xo(n.components,null,2))}),c},Ns=Fs.single,Ps=Fs.multiple,js=U(_s),Us=dt([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Ws=dr("factory",{sketch:d}),Gs=dr("schema",[]),Xs=Zo("name"),Ys=_o("pname","pname",Zn(function(t){return"<alloy."+Un(t.name)+">"}),Xo()),qs=xr("schema",function(){return[ar("preprocess")]}),Ks=dr("defaults",U({})),Js=dr("overrides",U({})),$s=Eo([Ws,Gs,Xs,Ys,Ks,Js]),Qs=Eo([Ws,Gs,Xs,Ks,Js]),Zs=Eo([Ws,Gs,Xs,Ys,Ks,Js]),tl=Eo([Ws,qs,Xs,Zo("unit"),Ys,Ks,Js]),el=function(t){return t.fold(P.some,P.none,P.some,P.some)},nl=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},ol=function(n,o){return function(t){var e=Uo("Converting part type",o,t);return n(e)}},rl=ol(Us.required,$s),il=ol(Us.external,Qs),ul=ol(Us.optional,Zs),al=ol(Us.group,tl),cl=U("entirety"),sl=Object.freeze({required:rl,external:il,optional:ul,group:al,asNamedPart:el,name:nl,asCommon:function(t){return t.fold(d,d,d,d)},original:cl}),ll=function(t,e,n,o){return gt(e.defaults(t,n,o),n,{uid:t.partUids[e.name]},e.overrides(t,n,o))},fl=function(r,t){var e={};return T(t,function(t){el(t).each(function(n){var o=dl(r,n.pname);e[n.name]=function(t){var e=Uo("Part: "+n.name+" in "+r,Eo(n.schema),t);return Gn({},o,{config:t,validated:e})}})}),e},dl=function(t,e){return{uiType:js(),owner:t,name:e}},ml=function(t,e,n){return{uiType:js(),owner:t,name:e,config:n,validated:{}}},hl=function(t){return j(t,function(t){return t.fold(P.none,P.some,P.none,P.none).map(function(t){return rr(t.name,t.schema.concat([Hu(cl())]))}).toArray()})},gl=function(t){return V(t,nl)},vl=function(t,e,n){return o=e,i={},r={},T(n,function(t){t.fold(function(o){i[o.pname]=Ns(!0,function(t,e,n){return o.factory.sketch(ll(t,o,e,n))})},function(t){var e=o.parts[t.name];r[t.name]=U(t.factory.sketch(ll(o,t,e[cl()]),e))},function(o){i[o.pname]=Ns(!1,function(t,e,n){return o.factory.sketch(ll(t,o,e,n))})},function(r){i[r.pname]=Ps(!0,function(e,t,n){var o=e[r.name];return V(o,function(t){return r.factory.sketch(gt(r.defaults(e,t,n),t,r.overrides(e,t)))})})})}),{internals:U(i),externals:U(r)};var o,i,r},pl=function(t,e,n){return Rs(P.some(t),e,e.components,n)},bl=function(t,e,n){var o=e.partUids[n];return t.getSystem().getByUid(o).toOption()},yl=function(t,e,n){return bl(t,e,n).getOrDie("Could not find part: "+n)},xl=function(t,e,n){var o={},r=e.partUids,i=t.getSystem();return T(n,function(t){o[t]=i.getByUid(r[t])}),et(o,U)},wl=function(t,e){var n=t.getSystem();return et(e.partUids,function(t,e){return U(n.getByUid(t))})},zl=function(t){return Q(t.partUids)},Sl=function(t,e,n){var o={},r=e.partUids,i=t.getSystem();return T(n,function(t){o[t]=i.getByUid(r[t]).getOrDie()}),et(o,U)},kl=function(e,t){var n=gl(t);return zt(V(n,function(t){return{key:t,value:e+"-"+t}}))},Cl=function(e){return _o("partUids","partUids",to(function(t){return kl(t.uid,e)}),Xo())},Ol=Object.freeze({generate:fl,generateOne:ml,schemas:hl,names:gl,substitutes:vl,components:pl,defaultUids:kl,defaultUidsSchema:Cl,getAllParts:wl,getAllPartNames:zl,getPart:bl,getPartOrDie:yl,getParts:xl,getPartsOrDie:Sl}),Ml=function(t,e,n,o,r){var i,u,a=(u=r,(0<(i=o).length?[rr("parts",i)]:[]).concat([Zo("uid"),dr("dom",{}),dr("components",[]),Hu("originalSpec"),dr("debug.sketcher",{})]).concat(u));return Uo(t+" [SpecSchema]",Ho(a.concat(e)),n)},Hl=function(t,e,n,o,r){var i=El(r),u=hl(n),a=Cl(n),c=Ml(t,e,i,u,[a]),s=vl(0,c,n);return o(c,pl(t,c,s.internals()),i,s.externals())},El=function(t){return t.hasOwnProperty("uid")?t:Gn({},t,{uid:li("uid")})},Vl=Ho([Zo("name"),Zo("factory"),Zo("configFields"),dr("apis",{}),dr("extraApis",{})]),Tl=Ho([Zo("name"),Zo("factory"),Zo("configFields"),Zo("partFields"),dr("apis",{}),dr("extraApis",{})]),Al=function(t){var i=Uo("Sketcher for "+t.name,Vl,t),e=et(i.apis,bi),n=et(i.extraApis,function(t,e){return gi(t,e)});return Gn({name:U(i.name),partFields:U([]),configFields:U(i.configFields),sketch:function(t){return e=i.name,n=i.configFields,o=i.factory,r=El(t),o(Ml(e,n,r,[],[]),r);var e,n,o,r}},e,n)},Bl=function(t){var e=Uo("Sketcher for "+t.name,Tl,t),n=fl(e.name,e.partFields),o=et(e.apis,bi),r=et(e.extraApis,function(t,e){return gi(t,e)});return Gn({name:U(e.name),partFields:U(e.partFields),configFields:U(e.configFields),sketch:function(t){return Hl(e.name,e.configFields,e.partFields,e.factory,t)},parts:U(n)},o,r)},Dl=function(t){return"input"===yn(t)&&"radio"!==Mn(t,"type")||"textarea"===yn(t)},_l=Object.freeze({getCurrent:function(t,e,n){return e.find(t)}}),Fl=[Zo("find")],Ll=Lu({fields:Fl,name:"composing",apis:_l}),Il=function(t,e,n,o){var r=t+e;return o<r?n:r<n?o:r},Rl=function(t,e,n){return t<=e?e:n<=t?n:t},Nl=function(e,n,t){var o=Oc(e.element(),"."+n.highlightClass);T(o,function(t){Li(t,n.highlightClass),e.getSystem().getByDom(t).each(function(t){n.onDehighlight(e,t)})})},Pl=function(t,e,n,o){var r=jl(t,e,n,o);Nl(t,e),_i(o.element(),e.highlightClass),r||e.onHighlight(t,o)},jl=function(t,e,n,o){return Ii(o.element(),e.highlightClass)},Ul=function(t,e,n,o){var r=Oc(t.element(),"."+e.itemClass);return P.from(r[o]).fold(function(){return ft.error("No element found with index "+o)},t.getSystem().getByDom)},Wl=function(e,t,n){return du(e.element(),"."+t.itemClass).bind(function(t){return e.getSystem().getByDom(t).toOption()})},Gl=function(e,t,n){var o=Oc(e.element(),"."+t.itemClass);return(0<o.length?P.some(o[o.length-1]):P.none()).bind(function(t){return e.getSystem().getByDom(t).toOption()})},Xl=function(n,e,t,o){var r=Oc(n.element(),"."+e.itemClass);return F(r,function(t){return Ii(t,e.highlightClass)}).bind(function(t){var e=Il(t,o,0,r.length-1);return n.getSystem().getByDom(r[e]).toOption()})},Yl=function(e,t,n){var o=Oc(e.element(),"."+t.itemClass);return Ot(V(o,function(t){return e.getSystem().getByDom(t).toOption()}))},ql=Object.freeze({dehighlightAll:Nl,dehighlight:function(t,e,n,o){var r=jl(t,e,n,o);Li(o.element(),e.highlightClass),r&&e.onDehighlight(t,o)},highlight:Pl,highlightFirst:function(e,n,o){Wl(e,n,o).each(function(t){Pl(e,n,o,t)})},highlightLast:function(e,n,o){Gl(e,n,o).each(function(t){Pl(e,n,o,t)})},highlightAt:function(e,n,o,t){Ul(e,n,o,t).fold(function(t){throw new Error(t)},function(t){Pl(e,n,o,t)})},highlightBy:function(e,n,o,t){var r=Yl(e,n,o);_(r,t).each(function(t){Pl(e,n,o,t)})},isHighlighted:jl,getHighlighted:function(e,t,n){return du(e.element(),"."+t.highlightClass).bind(function(t){return e.getSystem().getByDom(t).toOption()})},getFirst:Wl,getLast:Gl,getPrevious:function(t,e,n){return Xl(t,e,0,-1)},getNext:function(t,e,n){return Xl(t,e,0,1)},getCandidates:Yl}),Kl=[Zo("highlightClass"),Zo("itemClass"),Su("onHighlight"),Su("onDehighlight")],Jl=Lu({fields:Kl,name:"highlighting",apis:ql}),$l=function(t,e,n){var o=X(t.slice(0,e)),r=X(t.slice(e+1));return _(o.concat(r),n)},Ql=function(t,e,n){var o=X(t.slice(0,e));return _(o,n)},Zl=function(t,e,n){var o=t.slice(0,e),r=t.slice(e+1);return _(r.concat(o),n)},tf=function(t,e,n){var o=t.slice(e+1);return _(o,n)},ef=function(n){return function(t){var e=t.raw();return M(n,e.which)}},nf=function(t){return function(e){return W(t,function(t){return t(e)})}},of=function(t){return!0===t.raw().shiftKey},rf=function(t){return!0===t.raw().ctrlKey},uf=m(of),af=function(t,e){return{matches:t,classification:e}},cf=function(t){t.dom().focus()},sf=function(t){var e=t!==undefined?t.dom():document;return P.from(e.activeElement).map(Ne.fromDom)},lf=function(e){return sf(on(e)).filter(function(t){return e.dom().contains(t.dom())})},ff=function(t,e,n){e.exists(function(e){return n.exists(function(t){return nn(t,e)})})||Cr(t,_e(),{prevFocus:e,newFocus:n})},df=function(){var r=function(t){return lf(t.element())};return{get:r,set:function(t,e){var n=r(t);t.getSystem().triggerFocus(e,t.element());var o=r(t);ff(t,n,o)}}},mf=function(){var r=function(t){return Jl.getHighlighted(t).map(function(t){return t.element()})};return{get:r,set:function(e,t){var n=r(e);e.getSystem().getByDom(t).fold(N,function(t){Jl.highlight(e,t)});var o=r(e);ff(e,n,o)}}};(Zu=Qu||(Qu={})).OnFocusMode="onFocus",Zu.OnEnterOrSpaceMode="onEnterOrSpace",Zu.OnApiMode="onApi";var hf=function(t,e,n,o,a){var c=function(e,n,t,o,r){var i,u,a=t(e,n,o,r);return(i=a,u=n.event(),_(i,function(t){return t.matches(u)}).map(function(t){return t.classification})).bind(function(t){return t(e,n,o,r)})},r={schema:function(){return t.concat([dr("focusManager",df()),mr("focusInside","onFocus",Ro(function(t){return M(["onFocus","onEnterOrSpace","onApi"],t)?ft.value(t):ft.error("Invalid value for focusInside")})),Mu("handler",r),Mu("state",e),Mu("sendFocusIn",a)])},processKey:c,toEvents:function(i,u){var t=i.focusInside!==Qu.OnFocusMode?P.none():a(i).map(function(n){return Wr(ye(),function(t,e){n(t,i,u),e.stop()})});return Pr(t.toArray().concat([Wr(It(),function(o,r){c(o,r,n,i,u).fold(function(){var e,n,t;e=o,n=r,t=ef([32].concat([13]))(n.event()),i.focusInside===Qu.OnEnterOrSpaceMode&&t&&wr(e,n)&&a(i).each(function(t){t(e,i,u),n.stop()})},function(t){r.stop()})}),Wr(Rt(),function(t,e){c(t,e,o,i,u).each(function(t){e.stop()})})]))}};return r},gf=function(t){var e=[ar("onEscape"),ar("onEnter"),dr("selector",'[data-alloy-tabstop="true"]'),dr("firstTabstop",0),dr("useTabstopAt",U(!0)),ar("visibilitySelector")].concat([t]),u=function(t,e){var n=t.visibilitySelector.bind(function(t){return mu(e,t)}).getOr(e);return 0<ra(n)},n=function(e,n){var t,o,r,i;(t=e,o=n,r=Oc(t.element(),o.selector),i=A(r,function(t){return u(o,t)}),P.from(i[o.firstTabstop])).each(function(t){n.focusManager.set(e,t)})},a=function(e,t,n,o,r){return r(t,n,function(t){return u(e=o,n=t)&&e.useTabstopAt(n);var e,n}).fold(function(){return o.cyclic?P.some(!0):P.none()},function(t){return o.focusManager.set(e,t),P.some(!0)})},i=function(e,t,n,o){var r,i,u=Oc(e.element(),n.selector);return(r=e,i=n,i.focusManager.get(r).bind(function(t){return mu(t,i.selector)})).bind(function(t){return F(u,f(nn,t)).bind(function(t){return a(e,u,t,n,o)})})},o=U([af(nf([of,ef([9])]),function(t,e,n,o){var r=n.cyclic?$l:Ql;return i(t,0,n,r)}),af(ef([9]),function(t,e,n,o){var r=n.cyclic?Zl:tf;return i(t,0,n,r)}),af(ef([27]),function(e,n,t,o){return t.onEscape.bind(function(t){return t(e,n)})}),af(nf([uf,ef([13])]),function(e,n,t,o){return t.onEnter.bind(function(t){return t(e,n)})})]),r=U([]);return hf(e,yi.init,o,r,function(){return P.some(n)})},vf=gf(xr("cyclic",U(!1))),pf=gf(xr("cyclic",U(!0))),bf=function(t,e,n){return Dl(n)&&ef([32])(e.event())?P.none():(Mr(t,n,Se()),P.some(!0))},yf=function(t,e){return P.some(!0)},xf=[dr("execute",bf),dr("useSpace",!1),dr("useEnter",!0),dr("useControlEnter",!1),dr("useDown",!1)],wf=function(t,e,n){return n.execute(t,e,t.element())},zf=hf(xf,yi.init,function(t,e,n,o){var r=n.useSpace&&!Dl(t.element())?[32]:[],i=n.useEnter?[13]:[],u=n.useDown?[40]:[],a=r.concat(i).concat(u);return[af(ef(a),wf)].concat(n.useControlEnter?[af(nf([rf,ef([13])]),wf)]:[])},function(t,e,n,o){return n.useSpace&&!Dl(t.element())?[af(ef([32]),yf)]:[]},function(){return P.none()}),Sf=function(t){var n=Ct(P.none());return xi({readState:function(){return n.get().map(function(t){return{numRows:t.numRows(),numColumns:t.numColumns()}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(t,e){n.set(P.some({numRows:U(t),numColumns:U(e)}))},getNumRows:function(){return n.get().map(function(t){return t.numRows()})},getNumColumns:function(){return n.get().map(function(t){return t.numColumns()})}})},kf=Object.freeze({flatgrid:Sf,init:function(t){return t.state(t)}}),Cf=function(i){return function(t,e,n,o){var r=i(t.element());return Ef(r,t,e,n,o)}},Of=function(t,e){var n=cc(t,e);return Cf(n)},Mf=function(t,e){var n=cc(e,t);return Cf(n)},Hf=function(r){return function(t,e,n,o){return Ef(r,t,e,n,o)}},Ef=function(e,n,t,o,r){return o.focusManager.get(n).bind(function(t){return e(n.element(),t,o,r)}).map(function(t){return o.focusManager.set(n,t),!0})},Vf=Hf,Tf=Hf,Af=Hf,Bf=function(t){var e,n=t.dom();return!((e=n).offsetWidth<=0&&e.offsetHeight<=0)},Df=We(["index","candidates"],[]),_f=function(t,e,n){return Ff(t,e,n,Bf)},Ff=function(t,e,n,o){var r,i=f(nn,e),u=Oc(t,n),a=A(u,Bf);return F(r=a,i).map(function(t){return Df({index:t,candidates:r})})},Lf=function(t,e){return F(t,function(t){return nn(e,t)})},If=function(n,t,o,e){return e(Math.floor(t/o),t%o).bind(function(t){var e=t.row()*o+t.column();return 0<=e&&e<n.length?P.some(n[e]):P.none()})},Rf=function(r,t,i,u,a){return If(r,t,u,function(t,e){var n=t===i-1?r.length-t*u:u,o=Il(e,a,0,n-1);return P.some({row:U(t),column:U(o)})})},Nf=function(i,t,u,a,c){return If(i,t,a,function(t,e){var n=Il(t,c,0,u-1),o=n===u-1?i.length-n*a:a,r=Rl(e,0,o-1);return P.some({row:U(n),column:U(r)})})},Pf=[Zo("selector"),dr("execute",bf),ku("onEscape"),dr("captureTab",!1),Eu()],jf=function(e,n,t){du(e.element(),n.selector).each(function(t){n.focusManager.set(e,t)})},Uf=function(r){return function(t,e,n,o){return _f(t,e,n.selector).bind(function(t){return r(t.candidates(),t.index(),o.getNumRows().getOr(n.initSize.numRows),o.getNumColumns().getOr(n.initSize.numColumns))})}},Wf=function(t,e,n,o){return n.captureTab?P.some(!0):P.none()},Gf=Uf(function(t,e,n,o){return Rf(t,e,n,o,-1)}),Xf=Uf(function(t,e,n,o){return Rf(t,e,n,o,1)}),Yf=Uf(function(t,e,n,o){return Nf(t,e,n,o,-1)}),qf=Uf(function(t,e,n,o){return Nf(t,e,n,o,1)}),Kf=U([af(ef([37]),Of(Gf,Xf)),af(ef([39]),Mf(Gf,Xf)),af(ef([38]),Vf(Yf)),af(ef([40]),Tf(qf)),af(nf([of,ef([9])]),Wf),af(nf([uf,ef([9])]),Wf),af(ef([27]),function(t,e,n,o){return n.onEscape(t,e)}),af(ef([32].concat([13])),function(e,n,o,t){return(r=e,i=o,i.focusManager.get(r).bind(function(t){return mu(t,i.selector)})).bind(function(t){return o.execute(e,n,t)});var r,i})]),Jf=U([af(ef([32]),yf)]),$f=hf(Pf,Sf,Kf,Jf,function(){return P.some(jf)}),Qf=function(t,e,n,i){var u=function(t,e,n){var o,r=Il(e,i,0,n.length-1);return r===t?P.none():(o=n[r],"button"===yn(o)&&"disabled"===Mn(o,"disabled")?u(t,r,n):P.from(n[r]))};return _f(t,n,e).bind(function(t){var e=t.index(),n=t.candidates();return u(e,e,n)})},Zf=[Zo("selector"),dr("getInitial",P.none),dr("execute",bf),ku("onEscape"),dr("executeOnMove",!1),dr("allowVertical",!0)],td=function(e,n,o){return(t=e,r=o,r.focusManager.get(t).bind(function(t){return mu(t,r.selector)})).bind(function(t){return o.execute(e,n,t)});var t,r},ed=function(e,n){n.getInitial(e).orThunk(function(){return du(e.element(),n.selector)}).each(function(t){n.focusManager.set(e,t)})},nd=function(t,e,n){return Qf(t,n.selector,e,-1)},od=function(t,e,n){return Qf(t,n.selector,e,1)},rd=function(o){return function(t,e,n){return o(t,e,n).bind(function(){return n.executeOnMove?td(t,e,n):P.some(!0)})}},id=function(t,e,n,o){return n.onEscape(t,e)},ud=U([af(ef([32]),yf)]),ad=hf(Zf,yi.init,function(t,e,n,o){var r=[37].concat(n.allowVertical?[38]:[]),i=[39].concat(n.allowVertical?[40]:[]);return[af(ef(r),rd(Of(nd,od))),af(ef(i),rd(Mf(nd,od))),af(ef([13]),td),af(ef([32]),td),af(ef([27]),id)]},ud,function(){return P.some(ed)}),cd=We(["rowIndex","columnIndex","cell"],[]),sd=function(t,e,n){return P.from(t[e]).bind(function(t){return P.from(t[n]).map(function(t){return cd({rowIndex:e,columnIndex:n,cell:t})})})},ld=function(t,e,n,o){var r=t[e].length,i=Il(n,o,0,r-1);return sd(t,e,i)},fd=function(t,e,n,o){var r=Il(n,o,0,t.length-1),i=t[r].length,u=Rl(e,0,i-1);return sd(t,r,u)},dd=function(t,e,n,o){var r=t[e].length,i=Rl(n+o,0,r-1);return sd(t,e,i)},md=function(t,e,n,o){var r=Rl(n+o,0,t.length-1),i=t[r].length,u=Rl(e,0,i-1);return sd(t,r,u)},hd=[rr("selectors",[Zo("row"),Zo("cell")]),dr("cycles",!0),dr("previousSelector",P.none),dr("execute",bf)],gd=function(e,n){n.previousSelector(e).orThunk(function(){var t=n.selectors;return du(e.element(),t.cell)}).each(function(t){n.focusManager.set(e,t)})},vd=function(t,e){return function(n,o,i){var u=i.cycles?t:e;return mu(o,i.selectors.row).bind(function(t){var e=Oc(t,i.selectors.cell);return Lf(e,o).bind(function(o){var r=Oc(n,i.selectors.row);return Lf(r,t).bind(function(t){var e,n=(e=i,V(r,function(t){return Oc(t,e.selectors.cell)}));return u(n,t,o).map(function(t){return t.cell()})})})})}},pd=vd(function(t,e,n){return ld(t,e,n,-1)},function(t,e,n){return dd(t,e,n,-1)}),bd=vd(function(t,e,n){return ld(t,e,n,1)},function(t,e,n){return dd(t,e,n,1)}),yd=vd(function(t,e,n){return fd(t,n,e,-1)},function(t,e,n){return md(t,n,e,-1)}),xd=vd(function(t,e,n){return fd(t,n,e,1)},function(t,e,n){return md(t,n,e,1)}),wd=U([af(ef([37]),Of(pd,bd)),af(ef([39]),Mf(pd,bd)),af(ef([38]),Vf(yd)),af(ef([40]),Tf(xd)),af(ef([32].concat([13])),function(e,n,o){return lf(e.element()).bind(function(t){return o.execute(e,n,t)})})]),zd=U([af(ef([32]),yf)]),Sd=hf(hd,yi.init,wd,zd,function(){return P.some(gd)}),kd=[Zo("selector"),dr("execute",bf),dr("moveOnTab",!1)],Cd=function(e,n,o){return o.focusManager.get(e).bind(function(t){return o.execute(e,n,t)})},Od=function(e,n){du(e.element(),n.selector).each(function(t){n.focusManager.set(e,t)})},Md=function(t,e,n){return Qf(t,n.selector,e,-1)},Hd=function(t,e,n){return Qf(t,n.selector,e,1)},Ed=U([af(ef([38]),Af(Md)),af(ef([40]),Af(Hd)),af(nf([of,ef([9])]),function(t,e,n){return n.moveOnTab?Af(Md)(t,e,n):P.none()}),af(nf([uf,ef([9])]),function(t,e,n){return n.moveOnTab?Af(Hd)(t,e,n):P.none()}),af(ef([13]),Cd),af(ef([32]),Cd)]),Vd=U([af(ef([32]),yf)]),Td=hf(kd,yi.init,Ed,Vd,function(){return P.some(Od)}),Ad=[ku("onSpace"),ku("onEnter"),ku("onShiftEnter"),ku("onLeft"),ku("onRight"),ku("onTab"),ku("onShiftTab"),ku("onUp"),ku("onDown"),ku("onEscape"),dr("stopSpaceKeyup",!1),ar("focusIn")],Bd=hf(Ad,yi.init,function(t,e,n){return[af(ef([32]),n.onSpace),af(nf([uf,ef([13])]),n.onEnter),af(nf([of,ef([13])]),n.onShiftEnter),af(nf([of,ef([9])]),n.onShiftTab),af(nf([uf,ef([9])]),n.onTab),af(ef([38]),n.onUp),af(ef([40]),n.onDown),af(ef([37]),n.onLeft),af(ef([39]),n.onRight),af(ef([32]),n.onSpace),af(ef([27]),n.onEscape)]},function(t,e,n){return n.stopSpaceKeyup?[af(ef([32]),yf)]:[]},function(t){return t.focusIn}),Dd=vf.schema(),_d=pf.schema(),Fd=ad.schema(),Ld=$f.schema(),Id=Sd.schema(),Rd=zf.schema(),Nd=Td.schema(),Pd=Bd.schema(),jd=Ru({branchKey:"mode",branches:Object.freeze({acyclic:Dd,cyclic:_d,flow:Fd,flatgrid:Ld,matrix:Id,execution:Rd,menu:Nd,special:Pd}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(e,n,o){n.sendFocusIn(n).fold(function(){e.getSystem().triggerFocus(e.element(),e.element())},function(t){t(e,n,o)})},setGridSize:function(t,e,n,o,r){kt(n,"setGridSize")?n.setGridSize(o,r):console.error("Layout does not support setGridSize")}},state:kf}),Ud=function(t,e,n,o){var r=t.getSystem().build(o);ss(t,r,n)},Wd=function(t,e,n,o){var r=Gd(t,e);_(r,function(t){return nn(o.element(),t.element())}).each(fs)},Gd=function(t,e){return t.components()},Xd=function(e,n,t,r,o){var i=Gd(e,n);return P.from(i[r]).map(function(t){return Wd(e,n,0,t),o.each(function(t){Ud(e,0,function(t,e){var n,o;o=e,sn(n=t,r).fold(function(){mn(n,o)},function(t){ln(t,o)})},t)}),t})},Yd=Lu({fields:[],name:"replacing",apis:Object.freeze({append:function(t,e,n,o){Ud(t,0,mn,o)},prepend:function(t,e,n,o){Ud(t,0,dn,o)},remove:Wd,replaceAt:Xd,replaceBy:function(e,n,t,o,r){var i=Gd(e,n);return F(i,o).bind(function(t){return Xd(e,n,0,t,r)})},set:function(e,t,n,o){var r,i,u,a;ds(e),r=function(){var t=V(o,e.getSystem().build);T(t,function(t){cs(e,t)})},i=e.element(),u=on(i),a=sf(u).bind(function(e){var t=function(t){return nn(e,t)};return t(i)?P.some(i):Rr(i,t)}),r(i),a.each(function(e){sf(u).filter(function(t){return nn(t,e)}).fold(function(){cf(e)},N)})},contents:Gd})}),qd=function(t,e,n){e.store.manager.onLoad(t,e,n)},Kd=function(t,e,n){e.store.manager.onUnload(t,e,n)},Jd=Object.freeze({onLoad:qd,onUnload:Kd,setValue:function(t,e,n,o){e.store.manager.setValue(t,e,n,o)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),$d=Object.freeze({events:function(n,o){var t=n.resetOnDom?[Qr(function(t,e){qd(t,n,o)}),Zr(function(t,e){Kd(t,n,o)})]:[Vu(n,o,qd)];return Pr(t)}}),Qd=function(){var t=Ct(null);return xi({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()}}})},Zd=function(){var i=Ct({}),u=Ct({});return xi({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(t){return xt(i.get(),t).orThunk(function(){return xt(u.get(),t)})},update:function(t){var e=i.get(),n=u.get(),o={},r={};T(t,function(e){o[e.value]=e,xt(e,"meta").each(function(t){xt(t,"text").each(function(t){r[t]=e})})}),i.set(Gn({},e,o)),u.set(Gn({},n,r))},clear:function(){i.set({}),u.set({})}})},tm=Object.freeze({memory:Qd,dataset:Zd,manual:function(){return xi({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),em=function(t,e,n,o){var r=e.store;n.update([o]),r.setValue(t,o),e.onSetValue(t,o)},nm=[ar("initialValue"),Zo("getFallbackEntry"),Zo("getDataKey"),Zo("setValue"),Mu("manager",{setValue:em,getValue:function(t,e,n){var o=e.store,r=o.getDataKey(t);return n.lookup(r).fold(function(){return o.getFallbackEntry(r)},function(t){return t})},onLoad:function(e,n,o){n.store.initialValue.each(function(t){em(e,n,o,t)})},onUnload:function(t,e,n){n.clear()},state:Zd})],om=[Zo("getValue"),dr("setValue",N),ar("initialValue"),Mu("manager",{setValue:function(t,e,n,o){e.store.setValue(t,o),e.onSetValue(t,o)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(e,n,t){n.store.initialValue.each(function(t){n.store.setValue(e,t)})},onUnload:N,state:yi.init})],rm=[ar("initialValue"),Mu("manager",{setValue:function(t,e,n,o){n.set(o),e.onSetValue(t,o)},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:Qd})],im=[mr("store",{mode:"memory"},Go("mode",{memory:rm,manual:om,dataset:nm})),Su("onSetValue"),dr("resetOnDom",!1)],um=Lu({fields:im,name:"representing",active:$d,apis:Jd,extra:{setValueFrom:function(t,e){var n=um.getValue(e);um.setValue(t,n)}},state:tm}),am=function(t,e){e.ignore||(cf(t.element()),e.onFocus(t))},cm=Object.freeze({focus:am,blur:function(t,e){e.ignore||t.element().dom().blur()},isFocused:function(t){return e=t.element(),n=on(e).dom(),e.dom()===n.activeElement;var e,n}}),sm=Object.freeze({exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return zi(n)},events:function(n){return Pr([Wr(ye(),function(t,e){am(t,n),e.stop()})].concat(n.stopMousedown?[Wr(Tt(),function(t,e){e.event().prevent()})]:[]))}}),lm=[Su("onFocus"),dr("stopMousedown",!1),dr("ignore",!1)],fm=Lu({fields:lm,name:"focusing",active:sm,apis:cm}),dm=function(t,e,n){var o=e.aria;o.update(t,o,n.get())},mm=function(e,t,n){t.toggleClass.each(function(t){n.get()?_i(e.element(),t):Li(e.element(),t)})},hm=function(t,e,n){pm(t,e,n,!n.get())},gm=function(t,e,n){n.set(!0),mm(t,e,n),dm(t,e,n)},vm=function(t,e,n){n.set(!1),mm(t,e,n),dm(t,e,n)},pm=function(t,e,n,o){(o?gm:vm)(t,e,n)},bm=function(t,e,n){pm(t,e,n,e.selected)},ym=Object.freeze({onLoad:bm,toggle:hm,isOn:function(t,e,n){return n.get()},on:gm,off:vm,set:pm}),xm=Object.freeze({exhibit:function(t,e,n){return zi({})},events:function(t,e){var n,o,r,i=(n=t,o=e,r=hm,ei(function(t){r(t,n,o)})),u=Vu(t,e,bm);return Pr(R([t.toggleOnExecute?[i]:[],[u]]))}}),wm=Object.freeze({init:function(t){var e=Ct(!1);return{readState:function(){return e.get()},get:function(){return e.get()},set:function(t){return e.set(t)},clear:function(){return e.set(!1)}}}}),zm=function(t,e,n){Cn(t.element(),"aria-expanded",n)},Sm=[dr("selected",!1),ar("toggleClass"),dr("toggleOnExecute",!0),mr("aria",{mode:"none"},Go("mode",{pressed:[dr("syncWithExpanded",!1),Mu("update",function(t,e,n){Cn(t.element(),"aria-pressed",n),e.syncWithExpanded&&zm(t,e,n)})],checked:[Mu("update",function(t,e,n){Cn(t.element(),"aria-checked",n)})],expanded:[Mu("update",zm)],selected:[Mu("update",function(t,e,n){Cn(t.element(),"aria-selected",n)})],none:[Mu("update",N)]}))],km=Lu({fields:Sm,name:"toggling",active:xm,apis:ym,state:wm}),Cm="alloy.item-hover",Om="alloy.item-focus",Mm=function(t){(lf(t.element()).isNone()||fm.isFocused(t))&&(fm.isFocused(t)||fm.focus(t),Cr(t,Cm,{item:t}))},Hm=function(t){Cr(t,Om,{item:t})},Em=U(Cm),Vm=U(Om),Tm=function(t,e){var n,o;return{key:t,value:{config:{},me:(n=t,o=Pr(e),Lu({fields:[Zo("enabled")],name:n,active:{events:U(o)}})),configAsRaw:U({}),initialConfig:{},state:yi}}},Am=[Zo("data"),Zo("components"),Zo("dom"),dr("hasSubmenu",!1),ar("toggling"),Bs("itemBehaviours",[km,fm,jd,um]),dr("ignoreFocus",!1),dr("domModification",{}),Mu("builder",function(t){return{dom:t.dom,domModification:Gn({},t.domModification,{attributes:Gn({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes,{"aria-haspopup":t.hasSubmenu},t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Ds(t.itemBehaviours,[t.toggling.fold(km.revoke,function(t){return km.config(Gn({aria:{mode:"checked"}},t))}),fm.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Hm(t)}}),jd.config({mode:"execution"}),um.config({store:{mode:"memory",initialValue:t.data}}),Tm("item-type-events",[Wr(Oe(),Or),Kr(Tt()),Wr(_t(),Mm),Wr(ke(),fm.focus)])]),components:t.components,eventOrder:t.eventOrder}}),dr("eventOrder",{})],Bm=[Zo("dom"),Zo("components"),Mu("builder",function(t){return{dom:t.dom,components:t.components,events:Pr([Jr(ke())])}})],Dm=U([rl({name:"widget",overrides:function(e){return{behaviours:_u([um.config({store:{mode:"manual",getValue:function(t){return e.data},setValue:function(){}}})])}}})]),_m=[Zo("uid"),Zo("data"),Zo("components"),Zo("dom"),dr("autofocus",!1),dr("ignoreFocus",!1),Bs("widgetBehaviours",[um,fm,jd]),dr("domModification",{}),Cl(Dm()),Mu("builder",function(n){var t=vl(0,n,Dm()),e=pl("item-widget",n,t.internals()),o=function(t){return bl(t,n,"widget").map(function(t){return jd.focusIn(t),t})},r=function(t,e){return Dl(e.event().target())||n.autofocus&&e.setSource(t.element()),P.none()};return{dom:n.dom,components:e,domModification:n.domModification,events:Pr([ei(function(t,e){o(t).each(function(t){e.stop()})}),Wr(_t(),Mm),Wr(ke(),function(t,e){n.autofocus?o(t):fm.focus(t)})]),behaviours:Ds(n.widgetBehaviours,[um.config({store:{mode:"memory",initialValue:n.data}}),fm.config({ignore:n.ignoreFocus,onFocus:function(t){Hm(t)}}),jd.config({mode:"special",focusIn:n.autofocus?function(t){o(t)}:Nu(),onLeft:r,onRight:r,onEscape:function(t,e){return fm.isFocused(t)||n.autofocus?(n.autofocus&&e.setSource(t.element()),P.none()):(fm.focus(t),P.some(!0))}})])}})],Fm=Go("type",{widget:_m,item:Am,separator:Bm}),Lm=U([al({factory:{sketch:function(t){var e=Uo("menu.spec item",Fm,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return e.hasOwnProperty("uid")?e:Gn({},e,{uid:li("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Im=U([Zo("value"),Zo("items"),Zo("dom"),Zo("components"),dr("eventOrder",{}),Vs("menuBehaviours",[Jl,um,Ll,jd]),mr("movement",{mode:"menu",moveOnTab:!0},Go("mode",{grid:[Eu(),Mu("config",function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}})],matrix:[Mu("config",function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}}),Zo("rowSelector")],menu:[dr("moveOnTab",!0),Mu("config",function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}})]})),tr("markers",bu()),dr("fakeFocus",!1),dr("focusManager",df()),Su("onHighlight")]),Rm=U("alloy.menu-focus"),Nm=Bl({name:"Menu",configFields:Im(),partFields:Lm(),factory:function(t,e,n,o){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:As(t.menuBehaviours,[Jl.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),um.config({store:{mode:"memory",initialValue:t.value}}),Ll.config({find:P.some}),jd.config(t.movement.config(t,t.movement))]),events:Pr([Wr(Vm(),function(e,n){var t=n.event();e.getSystem().getByDom(t.target()).each(function(t){Jl.highlight(e,t),n.stop(),Cr(e,Rm(),{menu:e,item:t})})}),Wr(Em(),function(t,e){var n=e.event().item();Jl.highlight(t,n)})]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Pm=function(n,o,r,t){return xt(r,t).bind(function(t){return xt(n,t).bind(function(t){var e=Pm(n,o,r,t);return P.some([t].concat(e))})}).getOr([])},jm=function(t,e){var n={};tt(t,function(t,e){T(t,function(t){n[t]=e})});var o=e,r=nt(e,function(t,e){return{k:t,v:e}}),i=et(r,function(t,e){return[e].concat(Pm(n,o,r,e))});return et(n,function(t){return xt(i,t).getOr([t])})},Um=function(){var i=Ct({}),u=Ct({}),a=Ct({}),c=Ct(P.none()),s=Ct({}),e=function(t){return xt(u.get(),t)};return{setMenuBuilt:function(t,e){var n;u.set(Gn({},u.get(),((n={})[t]={type:"prepared",menu:e},n)))},setContents:function(t,e,n,o){c.set(P.some(t)),i.set(n),u.set(e),s.set(o);var r=jm(o,n);a.set(r)},expand:function(n){return xt(i.get(),n).map(function(t){var e=xt(a.get(),n).getOr([]);return[t].concat(e)})},refresh:function(t){return xt(a.get(),t)},collapse:function(t){return xt(a.get(),t).bind(function(t){return 1<t.length?P.some(t.slice(1)):P.none()})},lookupMenu:e,otherMenus:function(t){var e=s.get();return Y(Q(e),t)},getPrimary:function(){return c.get().bind(function(t){return e(t).bind(function(t){return"prepared"===t.type?P.some(t.menu):P.none()})})},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),a.set({}),c.set(P.none())},isClear:function(){return c.get().isNone()}}},Wm=U("collapse-item"),Gm=Al({name:"TieredMenu",configFields:[Ou("onExecute"),Ou("onEscape"),Cu("onOpenMenu"),Cu("onOpenSubmenu"),Su("onCollapseMenu"),dr("highlightImmediately",!0),rr("data",[Zo("primary"),Zo("menus"),Zo("expansions")]),dr("fakeFocus",!1),Su("onHighlight"),Su("onHover"),xu(),Zo("dom"),dr("navigateOnHover",!0),dr("stayInDom",!1),Vs("tmenuBehaviours",[jd,Jl,Ll,Yd]),dr("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)}},factory:function(a,t){var c,e,i=Ct(P.none()),s=Um(),n=function(t){var o,r,e,n=(o=t,r=a.data.primary,e=a.data.menus,et(e,function(t,e){var n=function(){return Nm.sketch(Gn({dom:t.dom},t,{value:e,items:t.items,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:a.fakeFocus?mf():df()}))};return e===r?{type:"prepared",menu:o.getSystem().build(n())}:{type:"notbuilt",nbMenu:n}})),i=u(t);return s.setContents(a.data.primary,n,a.data.expansions,i),s.getPrimary()},l=function(t){return um.getValue(t).value},u=function(t){return et(a.data.menus,function(t,e){return j(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})})},f=function(e,t){Jl.highlight(e,t),Jl.getHighlighted(t).orThunk(function(){return Jl.getFirst(t)}).each(function(t){Mr(e,t.element(),ke())})},d=function(e,t){return Ot(V(t,function(t){return e.lookupMenu(t).bind(function(t){return"prepared"===t.type?P.some(t.menu):P.none()})}))},m=function(e,t,n){var o=d(t,t.otherMenus(n));T(o,function(t){Ni(t.element(),[a.markers.backgroundMenu]),a.stayInDom||Yd.remove(e,t)})},h=function(t,o){var r,e=(r=t,i.get().getOrThunk(function(){var n={},t=Oc(r.element(),"."+a.markers.item),e=A(t,function(t){return"true"===Mn(t,"aria-haspopup")});return T(e,function(t){r.getSystem().getByDom(t).each(function(t){var e=l(t);n[e]=t})}),i.set(P.some(n)),n}));tt(e,function(t,e){var n=M(o,e);Cn(t.element(),"aria-expanded",n)})},g=function(o,r,i){return P.from(i[0]).bind(function(t){return r.lookupMenu(t).bind(function(t){if("notbuilt"===t.type)return P.none();var e=t.menu,n=d(r,i.slice(1));return T(n,function(t){_i(t.element(),a.markers.backgroundMenu)}),Dr(e.element())||Yd.append(o,lu(e)),Ni(e.element(),[a.markers.backgroundMenu]),f(o,e),m(o,r,i),P.some(e)})})};(e=c||(c={}))[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent";var v=function(r,i,u){void 0===u&&(u=c.HighlightSubmenu);var t=l(i);return s.expand(t).bind(function(o){return h(r,o),P.from(o[0]).bind(function(n){return s.lookupMenu(n).bind(function(t){var e=function(t,e,n){if("notbuilt"!==n.type)return n.menu;var o=t.getSystem().build(n.nbMenu());return s.setMenuBuilt(e,o),o}(r,n,t);return Dr(e.element())||Yd.append(r,lu(e)),a.onOpenSubmenu(r,i,e),u===c.HighlightSubmenu?(Jl.highlightFirst(e),g(r,s,o)):(Jl.dehighlightAll(e),P.some(i))})})})},o=function(e,n){var t=l(n);return s.collapse(t).bind(function(t){return h(e,t),g(e,s,t).map(function(t){return a.onCollapseMenu(e,n,t),t})})},r=function(n){return function(e,t){return mu(t.getSource(),"."+a.markers.item).bind(function(t){return e.getSystem().getByDom(t).toOption().bind(function(t){return n(e,t).map(function(){return!0})})})}},p=Pr([Wr(Rm(),function(e,t){var n=t.event().menu();Jl.highlight(e,n);var o=l(t.event().item());s.refresh(o).each(function(t){return m(e,s,t)})}),ei(function(e,t){var n=t.event().target();e.getSystem().getByDom(n).each(function(t){0===l(t).indexOf("collapse-item")&&o(e,t),v(e,t,c.HighlightSubmenu).fold(function(){a.onExecute(e,t)},function(){})})}),Qr(function(e,t){n(e).each(function(t){Yd.append(e,lu(t)),a.onOpenMenu(e,t),a.highlightImmediately&&f(e,t)})})].concat(a.navigateOnHover?[Wr(Em(),function(t,e){var n,o,r=e.event().item();n=t,o=l(r),s.refresh(o).bind(function(t){return h(n,t),g(n,s,t)}),v(t,r,c.HighlightParent),a.onHover(t,r)})]:[])),b={collapseMenu:function(e){Jl.getHighlighted(e).each(function(t){Jl.getHighlighted(t).each(function(t){o(e,t)})})},highlightPrimary:function(e){s.getPrimary().each(function(t){f(e,t)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:As(a.tmenuBehaviours,[jd.config({mode:"special",onRight:r(function(t,e){return Dl(e.element())?P.none():v(t,e,c.HighlightSubmenu)}),onLeft:r(function(t,e){return Dl(e.element())?P.none():o(t,e)}),onEscape:r(function(t,e){return o(t,e).orThunk(function(){return a.onEscape(t,e).map(function(){return t})})}),focusIn:function(e,t){s.getPrimary().each(function(t){Mr(e,t.element(),ke())})}}),Jl.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),Ll.config({find:function(t){return Jl.getHighlighted(t)}}),Yd.config({})]),eventOrder:a.eventOrder,apis:b,events:p}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:wt(t,e),expansions:{}}},collapseItem:function(t){return{value:Un(Wm()),meta:{text:t}}}}}),Xm=Al({name:"InlineView",configFields:[Zo("lazySink"),Su("onShow"),Su("onHide"),lr("onEscape"),Vs("inlineBehaviours",[ks,Uu]),fr("fireDismissalEventInstead",[dr("event",De())]),dr("getRelated",P.none),dr("eventOrder",P.none)],factory:function(s,t){var r=function(t,e,n,o){var r=s.lazySink(t).getOrDie();ks.openWhileCloaked(t,n,function(){return is.positionWithin(r,e,t,o)}),s.onShow(t)},e={setContent:function(t,e){ks.open(t,e)},showAt:function(t,e,n){var o=P.none();r(t,e,n,o)},showWithin:r,showMenuAt:function(t,e,n){var o,r,i,u,a,c=(o=s,r=t,i=e,u=n,a=function(){return o.lazySink(r)},Gm.sketch({dom:{tag:"div"},data:u.data,markers:u.menu.markers,onEscape:function(){return ks.close(r),o.onEscape.map(function(t){return t(r)}),P.some(!0)},onExecute:function(){return P.some(!0)},onOpenMenu:function(t,e){is.position(a().getOrDie(),i,e)},onOpenSubmenu:function(t,e,n){var o=a().getOrDie();is.position(o,{anchor:"submenu",item:e},n)}}));ks.open(t,c),s.onShow(t)},hide:function(t){ks.close(t),s.onHide(t)},getContent:function(t){return ks.getState(t)},isOpen:ks.isOpen};return{uid:s.uid,dom:s.dom,behaviours:As(s.inlineBehaviours,[ks.config({isPartOf:function(t,e,n){return gu(e,n)||(o=t,r=n,s.getRelated(o).exists(function(t){return gu(t,r)}));var o,r},getAttachPoint:function(t){return s.lazySink(t).getOrDie()}}),Hs(Gn({isExtraPart:U(!1)},s.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))]),eventOrder:s.eventOrder,apis:e}},apis:{showAt:function(t,e,n,o){t.showAt(e,n,o)},showWithin:function(t,e,n,o,r){t.showWithin(e,n,o,r)},showMenuAt:function(t,e,n,o){t.showMenuAt(e,n,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)}}}),Ym=function(t){var e=function(t,e){e.stop(),Or(t)},n=pe.detect().deviceType.isTouch()?[Wr(Ce(),e)]:[Wr(jt(),e),Wr(Tt(),function(t,e){e.cut()})];return Pr(R([t.map(function(n){return Wr(Se(),function(t,e){n(t),e.stop()})}).toArray(),n]))},qm=Al({name:"Button",factory:function(t){var e=Ym(t.action),n=t.dom.tag,o=function(e){return xt(t.dom,"attributes").bind(function(t){return xt(t,e)})};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:Ds(t.buttonBehaviours,[fm.config({}),jd.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==n)return{role:o("role").getOr("button")};var t=o("type").getOr("button"),e=o("role").map(function(t){return{role:t}}).getOr({});return Gn({type:t},e)}()},eventOrder:t.eventOrder}},configFields:[dr("uid",undefined),Zo("dom"),dr("components",[]),Bs("buttonBehaviours",[fm,jd]),ar("action"),ar("role"),dr("eventOrder",{})]}),Km=function(t){var e=function n(t){return t.uid!==undefined}(t)&&kt(t,"uid")?t.uid:li("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).fold(P.none,P.some)},asSpec:function(){return Gn({},t,{uid:e})}}},Jm={"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5c0-.6-.4-1-1-1a1 1 0 0 0-1 1v5c0 .6-.4 1-1 1a1 1 0 0 1-1-1V9H4a1 1 0 1 1 0-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" fill-rule="nonzero"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-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 1 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-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 1 1 0-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 1 1 0-2h9.2zm4 0h.8a1 1 0 0 1 0 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 0 1 0-2h6.8zm4 0H19a1 1 0 0 1 0 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 0 1 0-2h4.4zm4 0H19a1 1 0 0 1 0 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 0 1 0-2h2zm4 0h8a1 1 0 0 1 0 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 1 1 0-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 0 0 1.4-1V6a1 1 0 0 0-1.4-.9l-12 6a1 1 0 0 0 0 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 0 1 5 18V6a1 1 0 0 1 1.4-.9l12 6a1 1 0 0 1 0 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 0 1-.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 0 0-1 1z" fill-rule="nonzero"/></svg>',"border-width":'<svg width="24" height="24"><path d="M5 14.8h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2zm-.5 3.7h15c.3 0 .5.2.5.5s-.2.5-.5.5h-15a.5.5 0 1 1 0-1zm.5-8.3h14c.6 0 1 .4 1 1v1c0 .5-.4 1-1 1H5a1 1 0 0 1-1-1v-1c0-.6.4-1 1-1zm0-5.7h14c.6 0 1 .4 1 1v2c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-2c0-.6.4-1 1-1z" fill-rule="evenodd"/></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 0 1-.7.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 0 1-.7-.3A1 1 0 0 1 11 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 0 1-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-1a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H5a1 1 0 0 1-.7-.3A1 1 0 0 1 4 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 0 1-.8.3 1 1 0 0 1-.6-.3l-.8-.7a1 1 0 0 1-.3-.8c0-.2.1-.5.3-.7a1 1 0 0 1 1.4 0zm-10-7l-.7-.8a1 1 0 0 1-.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 0 1-.7.3 1 1 0 0 1-.8-.3zm10 0a1 1 0 0 1-.8.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.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 0 1 0 1.4l-.8.8a1 1 0 0 1-.6.3 1 1 0 0 1-.8-.3 1 1 0 0 1-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 0 1 3.7 2.4 4 4 0 0 1 0 3.2A4 4 0 0 1 12 16a4 4 0 0 1-3.7-2.4 4 4 0 0 1 0-3.2A4 4 0 0 1 12 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 0 1 2 2v12a2 2 0 0 1-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 1 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1-1.4 1.4L13 13.4V20a1 1 0 0 1-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 1 1 0 14.8 7.4 7.4 0 0 1 0-14.8zM12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-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>',"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 0 1-.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 0 1-1 .7h-.2a.7.7 0 0 1-.7-1l4-12a1 1 0 1 1 2 0l4 12a.7.7 0 0 1-.8 1h-.2a1 1 0 0 1-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 0 1-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 0 0-.5-.1 1 1 0 0 0-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 0 0-.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 0 0 1.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 0 0-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 0 0-.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 0 1-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 0 1-.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:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8a1 1 0 0 1 0 2h-8a1 1 0 0 1 0-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 0 1 0-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 0 1 0-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 0 1 0-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 0 1 1.6 1.2l-8 12a1 1 0 0 1-1.5.1l-5-5a1 1 0 1 1 1.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 0 1 0-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 0 1 0-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 0 1 0-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 0 1 0-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 0 1 0-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 0 1-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 0 1-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 0 1 1.5-1.5l3.8 3.9 3.8-3.9a1 1 0 0 1 1.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 0 1-.8 2 2.8 2.8 0 0 1 .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 0 1-.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 0 1-.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 0 1-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 0 1 .8-2 2.8 2.8 0 0 1-.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 0 1-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 0 1-.5-.5V17a3 3 0 0 0 1-.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 0 1 18 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 0 1-3.7 3 5.7 5.7 0 0 1-3.2 0A5.9 5.9 0 0 1 7.6 18a6.2 6.2 0 0 1-1.4-2.6 6.7 6.7 0 0 1 0-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 0 1 2.3-4A20 20 0 0 1 12 4a26.4 26.4 0 0 1 3.2 3.4 18.2 18.2 0 0 1 2.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 0 0-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 0 1-1.3 3 5.3 5.3 0 0 1-2.3 1.5 4.9 4.9 0 0 1-2 .1 4.3 4.3 0 0 0 2.4.8 4 4 0 0 0 2-.6 4 4 0 0 0 1.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 0 0 0 18 1.5 1.5 0 0 0 1.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 0 0 5-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm3-4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm3 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 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:'<svg width="24" height="24"><path d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23z" fill-rule="nonzero"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4zm-6 8a6 6 0 0 0 6 6V6a6 6 0 0 0-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 0 0-2 2v11h2V5h10V3zm1 4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-7a2 2 0 0 1-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 0 1-1-1v-2H7V9H5a1 1 0 1 1 0-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:'<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 0 1-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 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 0 1 0 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 0 0-.2-.5 1 1 0 0 0-.4-.2 1.6 1.6 0 0 0-.8 0 2.6 2.6 0 0 0-.8.3 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3 2.8 2.8 0 0 0 1-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 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3 1.5 1.5 0 0 0-.8 0 1 1 0 0 0-.4.2 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4l.3.4.3.4a2.8 2.8 0 0 0 .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 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-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:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10zm3 8h-2V9h-7v10h9a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7a2 2 0 0 1 2 2v2z"/><path d="M17 14h1a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1h-1a1 1 0 0 1 0-2h1v-1a1 1 0 0 1 2 0v1z"/></g></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 0 0-2-2H7v2h11v9zM6 17h15a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1H6a2 2 0 0 1-2-2V7H3a1 1 0 1 1 0-2h1V4a1 1 0 1 1 2 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 0 1 19 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 0 0 8 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 0 0-4 4.5h2.2zm-3.4 0a12 12 0 0 1 2.8-4 12 12 0 0 0-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 0 1-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 0 1 0 .8l-5.6 4A.5.5 0 0 1 9 16V8a.5.5 0 0 1 .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 0 0-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-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 1 0 0 16 8 8 0 0 0 0-16zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13z" fill-rule="nonzero"/></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 0 0 2.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 0 0 2-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 0 0-2 2zm14-2v2h2a2 2 0 0 0-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 0 0 2-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 0 0-2 2v3h2V6h10v3h2V6a2 2 0 0 0-2-2zm2 14h-2v2a2 2 0 0 0 2-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 0 0-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>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 1 1 0-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 1 1-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 1 1 1.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 1 1 0-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 1 1 0 1.7H5a.9.9 0 0 1-.9-.9v-4.4a.9.9 0 1 1 1.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 0 1-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 0 1 0 1.8H7l3 2.9-1.3 1.2z" fill-rule="nonzero"/></svg>',gamma:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 0 0-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 0 1 .6.5l.1.3a8.5 8.5 0 0 1 .3.6l1.9 4.6 2-5.2a1 1 0 0 1 1-.6.5.5 0 0 1 .5.6L13 14v2.8a.7.7 0 0 1-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 0 0-6 9 6.3 6.3 0 0 0 1.4 2l1 1a6.3 6.3 0 0 0 3.6 1 6.5 6.5 0 0 0 6-9 6.3 6.3 0 0 0-1.4-2l-1-1a6.3 6.3 0 0 0-3.6-1zM12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4z"/><path d="M9.6 9.7a.7.7 0 0 1-.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 0 0-.8.8.8.8 0 0 1-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 0 1 2.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 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-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 0 1-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 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 1 1 0-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6z" fill-rule="evenodd"/></svg>',indeterminate:'<svg width="24" height="24"><path d="M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9 11a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2H9z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 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 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 2H5a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3zm-7 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16z"/><path d="M15 12h-3V7a.5.5 0 0 0-1 0v6h4a.5.5 0 0 0 0-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 0 1-3.1 1.9 6.1 6.1 0 0 1-5.5-1.6A5.8 5.8 0 0 1 6 14v-.3l.1-1.2A13.9 13.9 0 0 1 7.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 0 0 .2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 0 0-3-4.2L12 6a26.1 26.1 0 0 0-2.2 2.5l-1-1a20.9 20.9 0 0 1 2.9-3.3L12 4l1 .8a22.2 22.2 0 0 1 4 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>',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 0 1 1.4 1.4l-2.1 2a2 2 0 1 0 2.7 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.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 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6zM11 26a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6zM11 36a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 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":'<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":'<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":'<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 0 0-.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":'<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":'<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":'<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 0 1-.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 0 0-.3-.7A1 1 0 0 0 13 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 7.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6z" fill-rule="evenodd"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-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 1 1 0-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 0 1-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":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2H4.5a.5.5 0 0 1-.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 0 1 0-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 1 1 0-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 1 1 0-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 0 1 0-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 1 1-4.3 16.9l1.5-1.5A7 7 0 1 0 13 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 1 1 0-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2zm1.6-3.8a1 1 0 0 1-1.2 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 0 1 1.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 0 1 0-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 0 1 0-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 0 1-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5H7v5c0 .6-.4 1-1 1z"/></g></svg>',paragraph:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5z" fill-rule="evenodd"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 0 0-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 0 1-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 0 0-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 0 1 0-3L14 3l1 1-7.3 7.3a1 1 0 0 0 0 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 0 1-2.8 0l-.1-.1z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><g fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="#000" stroke-width="2"><path d="M12 5v14M5 12h14"/></g></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 0 1-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 0 1-1.4 0l-1.5-1.2a6.2 6.2 0 0 1-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 0 1-1-.9l-.2-1.9a5.8 5.8 0 0 1-1.5-.6l-1.5 1.2a1 1 0 0 1-1.4 0l-.7-.7a1 1 0 0 1 0-1.4l1.2-1.5a6.2 6.2 0 0 1-.6-1.5l-1.9-.2a1 1 0 0 1-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 0 1 .6-1.5L5.2 7.3a1 1 0 0 1 0-1.4l.7-.7a1 1 0 0 1 1.4 0l1.5 1.2a6.2 6.2 0 0 1 1.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 0 1 1.5.6l1.5-1.2a1 1 0 0 1 1.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 0 1 .6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 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 0 0 2.1-2.8 15.7 15.7 0 0 0-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 0 0-6.7 3.2A16.2 16.2 0 0 0 3.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 0 1 2.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 0 1-2.8-3.7 1 1 0 0 1 0-1zm12-3.3a2 2 0 1 0 2.7 2.6 4 4 0 1 1-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 0 0-3 3v6h2v3h14v-3h2v-6a3 3 0 0 0-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 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .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 1 1-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 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-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 0 1 1-1l5 .4a1 1 0 1 1-.2 2l-2.2-.2a7.8 7.8 0 0 0 8.4.2 7.5 7.5 0 0 0 3.5-6.4 1 1 0 1 1 2 0 9.5 9.5 0 0 1-4.5 8 9.9 9.9 0 0 1-10.2 0l.4 1.4a1 1 0 1 1-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 0 0-9.5-1 7.5 7.5 0 0 0-3.6 7 1 1 0 0 1-2 0 9.5 9.5 0 0 1 4.5-8.6 10 10 0 0 1 10.9.3l-.3-1a1 1 0 0 1 2-.5l1.1 4.8a1 1 0 0 1-1 1.2l-5-.4a1 1 0 0 1-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8zM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 0 1 0 2h-1v9a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V9H5a1 1 0 1 1 0-2h3V6a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 0 0-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4zm4 0a1 1 0 0 1 2 0v4a1 1 0 0 1-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 1 1 9 2l-7 7A.5.5 0 1 1 1 8l7-7zM8.1 5.1A.5.5 0 1 1 9 6l-3 3A.5.5 0 1 1 5 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 0 1-.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 0 1-.7.3h-6a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3A1 1 0 0 1 4 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 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 0 1 2 0v6c0 .6-.4 1-1 1h-6a1 1 0 0 1 0-2h4.3L16 7A7.2 7.2 0 0 0 7.7 6a7 7 0 0 0 3 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 0 1 1.4 1.5A9.2 9.2 0 0 1 2.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 0 1 4.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L8 5zm12 11.2a1 1 0 1 1-1 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 1 1 1 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 1 0-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 1 0-1.4-1.4L13 11.6V4a1 1 0 0 0-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 0 0-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 0 0-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 0 0 2-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 d="M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zm-2.4-6.1L7 12.3a.7.7 0 0 0-1 1L9.6 17 18 8.6a.7.7 0 0 0 0-1 .7.7 0 0 0-1 0l-7.4 7.3z" fill-rule="evenodd"/></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 0 1-.2-.6V8H5a1 1 0 1 1 0-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 0 1-.2-.6V13H5a1 1 0 0 1 0-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 0 1-.2-.6V18H5a1 1 0 0 1 0-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 0 1 0-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 0 0-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 0 1-.7-.3 1 1 0 0 1-.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 0 1-.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 0 1 7 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 0 1 0 2H5a1 1 0 0 1 0-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 0 0-.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 0 1-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-cell-properties":'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm10 10h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10 0v3h4v-3h-4zm0-1h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" fill-rule="evenodd"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><path d="M12.5 5.5v6h6v-6h-6zm-1 0h-6v6h6v-6zm1 13h6v-6h-6v6zm-1 0v-6h-6v6h6zm-7-14h15v15h-15v-15z" fill-rule="nonzero"/></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5.5 5.5v13h13v-13h-13zm-1-1h15v15h-15v-15z" opacity=".2"/><path d="M11.5 11.5v-7h1v7h7v1h-7v7h-1v-7h-7v-1h7z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path d="M9 11.2l1 1v.2l-1 1v-2.2zm5 1l1-1v2.2l-1-1v-.2zM20 5v14H4V5h16zm-1 2h-4v.8l-.2-.2-.8.8V7h-4v1.4l-.8-.8-.2.2V7H5v11h4v-1.8l.5.5.5-.4V18h4v-1.8l.8.8.2-.3V18h4V7zm-3.9 3.4l-1.8 1.9 1.8 1.9c.4.3.4.9 0 1.2-.3.3-.8.3-1.2 0L12 13.5l-1.8 1.9a.8.8 0 0 1-1.2 0 .9.9 0 0 1 0-1.2l1.8-1.9-1.9-2a.9.9 0 0 1 1.2-1.2l2 2 1.8-1.8c.3-.4.9-.4 1.2 0a.8.8 0 0 1 0 1.1z" fill-rule="evenodd"/></svg>',"table-delete-row":'<svg width="24" height="24"><path d="M16.7 8.8l1.1 1.2-2.4 2.5L18 15l-1.2 1.2-2.5-2.5-2.4 2.5-1.3-1.2 2.5-2.5-2.5-2.5 1.2-1.3 2.6 2.6 2.4-2.5zM4 5h16v14H4V5zm15 5V7H5v3h4.8l1 1H5v3h5.8l-1 1H5v3h14v-3h-.4l-1-1H19v-3h-1.3l1-1h.3z" fill-rule="evenodd"/></svg>',"table-delete-table":'<svg width="24" height="26"><path d="M4 6h16v14H4V6zm1 2v11h14V8H5zm11.7 8.7l-1.5 1.5L12 15l-3.3 3.2-1.4-1.5 3.2-3.2-3.3-3.2 1.5-1.5L12 12l3.2-3.2 1.5 1.5-3.2 3.2 3.2 3.2z" fill-rule="evenodd"/></svg>',"table-insert-column-after":'<svg width="24" height="24"><path d="M14.3 9c.4 0 .7.3.7.6v2.2h2.1c.4 0 .7.3.7.7 0 .4-.3.7-.7.7H15v2.2c0 .3-.3.6-.7.6a.7.7 0 0 1-.6-.6v-2.2h-2.2a.7.7 0 0 1 0-1.4h2.2V9.6c0-.3.3-.6.6-.6zM4 5h16v14H4V5zm5 13v-3H5v3h4zm0-4v-3H5v3h4zm0-4V7H5v3h4zm10 8V7h-9v11h9z" fill-rule="evenodd"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path d="M9.7 16a.7.7 0 0 1-.7-.6v-2.2H6.9a.7.7 0 0 1 0-1.4H9V9.6c0-.3.3-.6.7-.6.3 0 .6.3.6.6v2.2h2.2c.4 0 .8.3.8.7 0 .4-.4.7-.8.7h-2.2v2.2c0 .3-.3.6-.6.6zM4 5h16v14H4V5zm10 13V7H5v11h9zm5 0v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V7h-4v3h4z" fill-rule="evenodd"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path d="M14.8 10.5c0 .3-.2.5-.5.5h-1.8v1.8c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.6V11H9.7a.5.5 0 0 1 0-1h1.8V8.3c0-.3.2-.6.5-.6s.5.3.5.6V10h1.8c.3 0 .5.2.5.5zM4 5h16v14H4V5zm5 13v-3H5v3h4zm5 0v-3h-4v3h4zm5 0v-3h-4v3h4zm0-4V7H5v7h14z" fill-rule="evenodd"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path d="M9.2 14.5c0-.3.2-.5.5-.5h1.8v-1.8c0-.3.2-.5.5-.5s.5.2.5.6V14h1.8c.3 0 .5.2.5.5s-.2.5-.5.5h-1.8v1.7c0 .3-.2.6-.5.6a.5.5 0 0 1-.5-.6V15H9.7a.5.5 0 0 1-.5-.5zM4 5h16v14H4V5zm6 2v3h4V7h-4zM5 7v3h4V7H5zm14 11v-7H5v7h14zm0-8V7h-4v3h4z" fill-rule="evenodd"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M4 5h16v13H4V5zm10 12v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V6h-4v3h4zm5 8v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V6h-4v3h4z" fill-rule="evenodd"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm6 13h9v-7h-9v7zm4-11h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10-1h4V7h-4v3zM5 15v3h4v-3H5z" fill-rule="evenodd"/></svg>',"table-row-properties":'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm10 10h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm6 3h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" fill-rule="evenodd"/></svg>',"table-split-cells":'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm6 2v3h4V7h-4zM9 18v-3H5v3h4zm0-4v-3H5v3h4zm0-4V7H5v3h4zm10 8v-7h-9v7h9zm0-8V7h-4v3h4zm-3.5 4.5l1.5 1.6c.3.2.3.7 0 1-.2.2-.7.2-1 0l-1.5-1.6-1.6 1.5c-.2.3-.7.3-1 0a.7.7 0 0 1 0-1l1.6-1.5-1.5-1.6a.7.7 0 0 1 1-1l1.5 1.6 1.6-1.5c.2-.3.7-.3 1 0 .2.2.2.7 0 1l-1.6 1.5z" fill-rule="evenodd"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M4 5h16v13H4V5zm5 12v-3H5v3h4zm0-4v-3H5v3h4zm5 4v-3h-4v3h4zm0-4v-3h-4v3h4zm5 4v-3h-4v3h4zm0-4v-3h-4v3h4z" fill-rule="evenodd"/></svg>',table:'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm6 9h4v-3h-4v3zm4 1h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10 0v3h4v-3h-4zm0-1h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" fill-rule="evenodd"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14zM9 16v-4a5 5 0 1 1 6 0v4h4a2 2 0 0 1 2 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 1 0-3.6 0l.8.6v5h2z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><path d="M20.5 2.5c-.8 0-1.5.7-1.5 1.5a1.5 1.5 0 0 1-3 0 3 3 0 0 0-6 0v2H8.5c-.3 0-.5.2-.5.5v1a8 8 0 1 0 6 0v-1c0-.3-.2-.5-.5-.5H11V4a2 2 0 0 1 4 0 2.5 2.5 0 0 0 5 0c0-.3.2-.5.5-.5a.5.5 0 0 0 0-1zM8.1 10.9a5 5 0 0 0-1.2 7 .5.5 0 0 1-.8.5 6 6 0 0 1 1.5-8.3.5.5 0 1 1 .5.8z" fill-rule="nonzero"/></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 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.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 0 0 .5.6h1.6a.5.5 0 0 0 .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 1 1 0-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-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 0 1 0-1l3.1-3A12.4 12.4 0 0 1 6.7 9H8a10.1 10.1 0 0 0 1.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 1 1 0-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 0 1-1 2.4 13.5 13.5 0 0 1-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 0 1-.4.7 1 1 0 0 1-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 0 1-1 .7.5.5 0 0 1-.4-.7l2.7-7.4a1 1 0 1 1 2 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 0 1-.4 1.8l-1 1.4a5.3 5.3 0 0 1-5.5 1 5 5 0 0 1-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 0 1-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 0 0 2.2.8 3.4 3.4 0 0 0 2.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 0 1 0-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 0 1-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 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2zm11.6-.6a1 1 0 0 1-1.4-1.4l2.1-2a2 2 0 1 0-2.7-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2zM7.6 6.3a.8.8 0 0 1-1 1.1L3.3 4.2a.7.7 0 1 1 1-1l3.2 3.1zM5.1 8.6a.8.8 0 0 1 0 1.5H3a.8.8 0 0 1 0-1.5H5zm5-3.5a.8.8 0 0 1-1.5 0V3a.8.8 0 0 1 1.5 0V5zm6 11.8a.8.8 0 0 1 1-1l3.2 3.2a.8.8 0 0 1-1 1L16 17zm-2.2 2a.8.8 0 0 1 1.5 0V21a.8.8 0 0 1-1.5 0V19zm5-3.5a.7.7 0 1 1 0-1.5H21a.8.8 0 0 1 0 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 0 0-.3-.7A1 1 0 0 0 16 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.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 0 1-.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 0 1 0-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-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 d="M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zm0-1a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" fill-rule="evenodd"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 0 1 2 0v3c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-3a1 1 0 0 1 2 0v2h12zM11 6.4L8.7 8.7a1 1 0 0 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 1 1-1.4 1.4L13 6.4V16a1 1 0 0 1-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 1 1 0-24 12 12 0 0 1 0 24zm-8.7-5.3a11 11 0 0 0 17.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>',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 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm-1-9a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0V8zm-2 4a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm-3-5a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8z" fill-rule="nonzero"/></svg>'},$m=P.from(Jm["temporary-placeholder"]).getOr("!not found!"),Qm=function(e,t){return P.from(t()[e]).getOrThunk(function(){return t=e,P.from(Jm[t]).getOr($m);var t})},Zm=function(n,t,o){return P.from(t()[n]).getOrThunk(function(){return t=n,e=o,P.from(Jm[t]).getOrThunk(function(){return e.getOr($m)});var t,e})},th=function(t,e){return Mt(t,function(t){return P.from(e()[t])}).getOrThunk(function(){return Mt(t,function(t){return P.from(Jm[t])}).getOr($m)})},eh={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},nh=Al({name:"Notification",factory:function(e){var o=Km({dom:{tag:"p",innerHtml:e.translationProvider(e.text)},behaviours:_u([Yd.config({})])}),n=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},r=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},i=Km({dom:{tag:"div",classes:e.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:_u([Yd.config({})])}),t={updateProgress:function(t,e){t.getSystem().isConnected()&&i.getOpt(t).each(function(t){Yd.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},r(e)])})},updateText:function(t,e){if(t.getSystem().isConnected()){var n=o.get(t);Yd.set(n,[uu(e)])}}},u=R([e.icon.toArray(),e.level.toArray(),e.level.bind(function(t){return P.from(eh[t])}).toArray()]);return{uid:e.uid,dom:{tag:"div",attributes:{role:"alert"},classes:e.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]}).getOr(["tox-notification","tox-notification--in"])},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:th(u,e.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[o.asSpec()],behaviours:_u([Yd.config({})])}].concat(e.progress?[i.asSpec()]:[]).concat(qm.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:Qm("close",e.iconProvider),attributes:{"aria-label":e.translationProvider("Close")}}}],action:function(t){e.onAction(t)}})),apis:t}},configFields:[ar("level"),Zo("progress"),Zo("icon"),Zo("onAction"),Zo("text"),Zo("iconProvider"),Zo("translationProvider")],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function oh(r,i,u){var a=i.backstage;return{open:function(t,e){var n=function(){e(),Xm.hide(r)},o=su(nh.sketch({text:t.text,level:M(["success","error","warning","info"],t.type)?t.type:undefined,progress:!0===t.progressBar,icon:P.from(t.icon),onAction:n,iconProvider:a.shared.providers.icons,translationProvider:a.shared.providers.translate})),r=su(Xm.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:i.backstage.shared.getSink,fireDismissalEventInstead:{}}));return u.add(r),t.timeout&&setTimeout(function(){n()},t.timeout),{close:n,moveTo:function(t,e){Xm.showAt(r,{anchor:"makeshift",x:t,y:e},lu(o))},moveRel:function(t,e){Xm.showAt(r,i.backstage.shared.anchors.banner(),lu(o))},text:function(t){nh.updateText(o,t)},settings:t,getEl:function(){},progressBar:{value:function(t){nh.updateProgress(o,t)}}}},close:function(t){t.close()},reposition:function(t){T(t,function(t){t.moveTo(0,0)}),function(n){if(0<n.length){var t=n.slice(0,1)[0],e=(o=r).inline?o.getElement():o.getContentAreaContainer();t.moveRel(e,"tc-tc"),T(n,function(t,e){0<e&&t.moveRel(n[e-1].getEl(),"bc-tc")})}var o}(t)},getArgs:function(t){return t.settings}}}var rh,ih,uh=function(n,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];null!==r&&clearTimeout(r),r=setTimeout(function(){n.apply(null,t),r=null},o)}}},ah=/[\u00a0 \t\r\n]/,ch=function(n,t,e,o,r){return void 0===r&&(r=0),(i=n).collapsed&&3===i.startContainer.nodeType?function(t,e,n,o){var r;for(r=e-1;0<=r;r--){if(ah.test(t.charAt(r)))return P.none();if(t.charAt(r)===n)break}return-1===r||e-r<o?P.none():P.some(t.substring(r+1,e))}(e,o,t,r).map(function(t){var e=n.cloneRange();return e.setStart(n.startContainer,n.startOffset-t.length-1),e.setEnd(n.startContainer,n.startOffset),{text:t,rng:e}}):P.none();var i},sh=function(n,t){t.on("keypress",n.onKeypress.throttle),t.on("remove",n.onKeypress.cancel);var o=function(t,e){Cr(t,It(),{raw:e})};t.on("keydown",function(e){var t=function(){return n.getView().bind(Jl.getHighlighted)};8===e.which&&n.onKeypress.throttle(e),n.isActive()&&(27===e.which?n.closeIfNecessary():32===e.which?n.closeIfNecessary():13===e.which?(t().each(Or),e.preventDefault()):40===e.which?(t().fold(function(){n.getView().each(Jl.highlightFirst)},function(t){o(t,e)}),e.preventDefault()):37!==e.which&&38!==e.which&&39!==e.which||t().each(function(t){o(t,e),e.preventDefault()}))})},lh=tinymce.util.Tools.resolve("tinymce.util.Promise"),fh=function(t,e){var n,o,r,i=e(),u=t.selection.getRng(),a=u.startContainer.nodeValue;return(n=u,o=a,r=i,Mt(r.triggerChars,function(e){return ch(n,e,o,n.startOffset).map(function(t){return{range:t.rng,text:t.text,triggerChar:e}})})).map(function(n){var t=A(i.lookupByChar(n.triggerChar),function(t){return n.text.length>=t.minChars&&t.matches(n.range,a,n.text)});return{lookupData:lh.all(V(t,function(e){return e.fetch(n.text,e.maxResults).then(function(t){return{items:t,columns:e.columns,onAction:e.onAction}})})),triggerChar:n.triggerChar,range:n.range}})},dh=Eo([xr("type",function(){return"autocompleteitem"}),xr("active",function(){return!1}),xr("disabled",function(){return!1}),dr("meta",{}),er("value"),sr("text"),sr("icon")]),mh=Eo([er("type"),er("ch"),hr("minChars",0),dr("columns",1),hr("maxResults",10),br("matches",function(){return!0}),or("fetch"),or("onAction")]),hh=function(t){var e,n,o=t.ui.registry.getAll().popups,r=et(o,function(t){return(e=t,Po("Autocompleter",mh,e)).fold(function(t){throw new Error(Wo(t))},function(t){return t});var e}),i=(e=ot(r,function(t){return t.ch}),n={},T(e,function(t){n[t]={}}),Q(n)),u=rt(r);return{dataset:r,triggerChars:i,lookupByChar:function(e){return A(u,function(t){return t.ch===e})}}},gh=[pr("disabled",!1),sr("text"),sr("shortcut"),_o("value","value",Zn(function(){return Un("menuitem-value")}),Xo()),dr("meta",{})],vh=Eo([er("type"),br("onSetup",function(){return N}),br("onAction",N),sr("icon")].concat(gh)),ph=function(t){return Po("menuitem",vh,t)},bh=Eo([er("type"),or("getSubmenuItems"),br("onSetup",function(){return N}),sr("icon")].concat(gh)),yh=Eo([er("type"),pr("active",!1),br("onSetup",function(){return N}),or("onAction")].concat(gh)),xh=function(t){return Po("togglemenuitem",yh,t)},wh=Eo([er("type"),pr("active",!1),sr("icon")].concat(gh)),zh=Eo([er("type"),sr("text")]),Sh=Eo([er("type"),nr("fancytype",["inserttable"]),br("onAction",N)]),kh=function(t,o,e){var r=Oc(t.element(),"."+e);if(0<r.length){var n=F(r,function(t){var e=t.dom().getBoundingClientRect().top,n=r[0].dom().getBoundingClientRect().top;return Math.abs(e-n)>o}).getOr(r.length);return P.some({numColumns:n,numRows:Math.ceil(r.length/n)})}return P.none()},Ch=function(t,e){return _u([Tm(t,e)])},Oh=function(t){return Ch(Un("unnamed-events"),t)},Mh="tox-menu-nav__js",Hh="tox-collection__item",Eh="tox-swatch",Vh={normal:Mh,color:Eh},Th="tox-collection__item--enabled",Ah="tox-collection__item-icon",Bh="tox-collection__item-label",Dh="tox-collection__item--active",_h=function(t){return xt(Vh,t).getOr(Mh)},Fh=function(t){var e,n,o,r=Ne.fromHtml(t),i=cn(r),u=(n=(e=r).dom().attributes!==undefined?e.dom().attributes:[],D(n,function(t,e){var n;return"class"===e.name?t:Gn({},t,((n={})[e.name]=e.value,n))},{})),a=(o=r,Array.prototype.slice.call(o.dom().classList,0)),c=0===i.length?{}:{innerHtml:pn(r)};return Gn({tag:yn(r),classes:a,attributes:u},c)},Lh=tinymce.util.Tools.resolve("tinymce.util.I18n"),Ih=tinymce.util.Tools.resolve("tinymce.Env"),Rh=function(t){var n=Ih.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;"}:{meta:"Ctrl"},e=t.split("+"),o=V(e,function(t){var e=t.toLowerCase().trim();return it(n,e)?n[e]:t});return Ih.mac?o.join(""):o.join("+")},Nh=function(t){return{dom:{tag:"span",classes:[Ah],innerHtml:t}}},Ph=function(t){return{dom:{tag:"span",classes:[Bh]},components:[uu(Lh.translate(t))]}},jh=function(t){return{dom:{tag:"span",classes:["tox-collection__item-accessory"],innerHtml:Rh(t)}}},Uh=function(t){return{dom:{tag:"span",classes:[Ah,"tox-collection__item-checkmark"],innerHtml:Qm("checkmark",t)}}},Wh=function(t,e,n){void 0===n&&(n=P.none());var o,r,i,u,a,c,s,l,f,d=t.iconContent.map(function(t){return Zm(t,e.icons,n)});return"color"===t.presets?(a=t.ariaLabel,c=t.value,{dom:(s=Eh,l=d.getOr(""),f=a.map(function(t){return' title="'+t+'"'}).getOr(""),Fh("custom"===c?'<button class="'+s+' tox-swatches__picker-btn"'+f+">"+l+"</button>":"remove"===c?'<div class="'+s+' tox-swatch--remove"'+f+">"+l+"</div>":'<div class="'+s+'" style="background-color: '+c+'" data-mce-color="'+c+'"'+f+"></div>")),optComponents:[]}):(r=d,i=(o=t).checkMark.orThunk(function(){return r.or(P.some("")).map(Nh)}),u=o.ariaLabel.map(function(t){return{attributes:{title:Lh.translate(t)}}}).getOr({}),{dom:vt({tag:"div",classes:[Mh,Hh]},u),optComponents:[i,o.textContent.map(Ph),o.shortcutContent.map(jh),o.caret]})},Gh=["input","button","textarea"],Xh=function(t,e,n){e.disabled&&Qh(t,e,n)},Yh=function(t){return M(Gh,yn(t.element()))},qh=function(t){Cn(t.element(),"disabled","disabled")},Kh=function(t){En(t.element(),"disabled")},Jh=function(t){Cn(t.element(),"aria-disabled","true")},$h=function(t){Cn(t.element(),"aria-disabled","false")},Qh=function(e,t,n){t.disableClass.each(function(t){_i(e.element(),t)}),(Yh(e)?qh:Jh)(e)},Zh=function(t){return Yh(t)?Hn(t.element(),"disabled"):"true"===Mn(t.element(),"aria-disabled")},tg=Object.freeze({enable:function(e,t,n){t.disableClass.each(function(t){Li(e.element(),t)}),(Yh(e)?Kh:$h)(e)},disable:Qh,isDisabled:Zh,onLoad:Xh}),eg=Object.freeze({exhibit:function(t,e,n){return zi({classes:e.disabled?e.disableClass.map(q).getOr([]):[]})},events:function(t,e){return Pr([jr(Se(),function(t,e){return Zh(t)}),Vu(t,e,Xh)])}}),ng=[dr("disabled",!1),ar("disableClass")],og=Lu({fields:ng,name:"disabling",active:eg,apis:tg}),rg=function(t){return og.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},ig=function(t){return og.config({disabled:t})},ug=function(t){return og.config({disabled:t,disableClass:"tox-tbtn--disabled"})},ag=function(t,e){var n=t.getApi(e);return function(t){t(n)}},cg=function(n,o){return Qr(function(t){ag(n,t)(function(t){var e=n.onSetup(t);null!==e&&e!==undefined&&o.set(e)})})},sg=function(e,n){return Zr(function(t){return ag(e,t)(n.get())})};(ih=rh||(rh={}))[ih.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",ih[ih.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var lg,fg,dg=rh,mg={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},hg=function(t){return j(t,function(t){return t.toArray()})},gg=function(t,e,n){var o,r,i=Ct(N);return{type:"item",dom:e.dom,components:hg(e.optComponents),data:t.data,eventOrder:mg,hasSubmenu:t.triggersSubmenu,itemBehaviours:_u([Tm("item-events",[(o=t,r=n,ei(function(t,e){ag(o,t)(o.onAction),o.triggersSubmenu||r!==dg.CLOSE_ON_EXECUTE||(kr(t,He()),e.stop())})),cg(t,i),sg(t,i)]),rg(t.disabled),Yd.config({})].concat(t.itemBehaviours))}},vg=function(t){return{value:t.value,meta:vt({text:t.text.getOr("")},t.meta)}},pg=U(fl("item-widget",Dm())),bg=Un("cell-over"),yg=Un("cell-execute"),xg=function(e,n,t){var o,r=function(t){return Cr(t,yg,{row:e,col:n})};return su({dom:{tag:"div",attributes:(o={role:"button"},o["aria-labelledby"]=t,o)},behaviours:_u([Tm("insert-table-picker-cell",[Wr(_t(),fm.focus),Wr(Se(),r),Wr(Oe(),r)]),km.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),fm.config({onFocus:function(t){return Cr(t,bg,{row:e,col:n})}})])})},wg={inserttable:function cE(o){var t,e=Un("size-label"),a=function(t,e,n){for(var o=[],r=0;r<e;r++){for(var i=[],u=0;u<n;u++)i.push(xg(r,u,t));o.push(i)}return o}(e,10,10),c=Km({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[uu("0x0")],behaviours:_u([Yd.config({})])});return{type:"widget",data:{value:Un("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[pg().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:(t=a,j(t,function(t){return V(t,lu)})).concat(c.asSpec()),behaviours:_u([Tm("insert-table-picker",[qr(bg,function(t,e,n){var o,r,i=n.event().row(),u=n.event().col();!function(t,e,n,o,r){for(var i=0;i<o;i++)for(var u=0;u<r;u++)km.set(t[i][u],i<=e&&u<=n)}(a,i,u,10,10),Yd.set(c.get(t),[(o=i,r=u,uu(r+1+"x"+(o+1)))])}),qr(yg,function(t,e,n){o.onAction({numRows:n.event().row()+1,numColumns:n.event().col()+1}),kr(t,He())})]),jd.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}}},zg=function(t,u,e){return{dom:{tag:"div",classes:[Mh,Hh]},optComponents:[P.some(e),t.map(function(t){return e=u.tag,n=u.styleAttr,o="span",r=[Bh],i=[{dom:{tag:e,attributes:{style:n}},components:[uu(t)]}],{dom:{tag:o,classes:r},components:i};var e,n,o,r,i})]}},Sg=function(e,t,n,o,r,i,u){var a=Wh({presets:n,textContent:t?e.text:P.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:t?e.shortcut:P.none(),checkMark:t?P.some(Uh(u.icons)):P.none(),caret:P.none(),value:e.value},u);return gt(gg({data:vg(e),disabled:e.disabled,getApi:function(e){return{setActive:function(t){km.set(e,t)},isActive:function(){return km.isOn(e)},isDisabled:function(){return og.isDisabled(e)},setDisabled:function(t){return t?og.disable(e):og.enable(e)}}},onAction:function(t){return o(e.value)},onSetup:function(t){return t.setActive(r),function(){}},triggersSubmenu:!1,itemBehaviours:[]},a,i),{toggling:{toggleClass:Th,toggleOnExecute:!1,selected:e.active}})},kg=function(e,t,n,o,r,i){var u=Wh({presets:n,textContent:t?e.text:P.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:P.none(),checkMark:P.none(),caret:P.none(),value:e.value},i,e.icon);return gg({data:vg(e),disabled:e.disabled,getApi:function(){return{}},onAction:function(t){return o(e.value,e.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:[]},u,r)},Cg=function(t){var e=t.text.fold(function(){return{}},function(t){return{innerHtml:t}});return{type:"separator",dom:Gn({tag:"div",classes:[Hh,"tox-collection__group-heading"]},e),components:[]}},Og=function(t,e,n){var o="togglemenuitem"===t.type&&t.active?Uh(n.icons):Nh(""),r=zg(t.text,t.meta,o);return gt(gg({data:vg(t),disabled:t.disabled,getApi:function(){return 10},onAction:t.onAction,onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:[]},r,e),"togglemenuitem"===t.type?{toggling:{toggleClass:Th,toggleOnExecute:!1,selected:t.active}}:{})},Mg=function(t,e,n){var o=Wh({presets:"normal",iconContent:t.icon,textContent:t.text,ariaLabel:t.text,caret:P.none(),checkMark:P.none(),shortcutContent:t.shortcut},n);return gg({data:vg(t),getApi:function(e){return{isDisabled:function(){return og.isDisabled(e)},setDisabled:function(t){return t?og.disable(e):og.enable(e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e)},Hg=function(t,e,n){var o,r=(o=n.icons,{dom:{tag:"span",classes:["tox-collection__item-caret"],innerHtml:Qm("chevron-right",o)}}),i=Wh({presets:"normal",iconContent:t.icon,textContent:t.text,ariaLabel:t.text,caret:P.some(r),checkMark:P.none(),shortcutContent:t.shortcut},n);return gg({data:vg(t),getApi:function(e){return{isDisabled:function(){return og.isDisabled(e)},setDisabled:function(t){return t?og.disable(e):og.enable(e)}}},disabled:t.disabled,onAction:N,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},i,e)},Eg=function(t,e,n){var o=Wh({iconContent:P.none(),textContent:t.text,ariaLabel:t.text,checkMark:P.some(Uh(n.icons)),caret:P.none(),shortcutContent:t.shortcut,presets:"normal"},n);return gt(gg({data:vg(t),disabled:t.disabled,getApi:function(e){return{setActive:function(t){km.set(e,t)},isActive:function(){return km.isOn(e)},isDisabled:function(){return og.isDisabled(e)},setDisabled:function(t){return t?og.disable(e):og.enable(e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e),{toggling:{toggleClass:Th,toggleOnExecute:!1,selected:t.active}})},Vg=function(e){return(t=wg,n=e.fancytype,Object.prototype.hasOwnProperty.call(t,n)?P.some(t[n]):P.none()).map(function(t){return t(e)});var t,n},Tg=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:(e=t,"color"===e?"tox-swatches":"tox-menu"),tieredMenu:"tox-tiered-menu"};var e},Ag=function(t){var e=Tg(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:_h(t)}},Bg=[Nm.parts().items({})],Dg=function(t,e,n){var o=Tg(n);return{dom:{tag:"div",classes:R([[o.tieredMenu]])},markers:Ag(n)}},_g=function(t,e){var n=Ag(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")}},Fg=function(n,o){return function(t){var e=E(t,o);return V(e,function(t){return{dom:n,components:t}})}},Lg=function(e,i){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[Nm.parts().items({preprocess:function(t){return"auto"!==e&&1<e?Fg({tag:"div",classes:["tox-collection__group"]},e)(t):(n=function(t,e){return"separator"===i[e].type},o=[],r=[],T(t,function(t,e){n(t,e)?(0<r.length&&o.push(r),r=[],it(t.dom,"innerHtml")&&r.push(t)):r.push(t)}),0<r.length&&o.push(r),V(o,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}));var n,o,r}})]}};(fg=lg||(lg={}))[fg.ContentFocus=0]="ContentFocus",fg[fg.UiFocus=1]="UiFocus";var Ig=function(t){return console.error(Wo(t)),console.log(t),P.none()},Rg=function(t){return t.icon!==undefined},Ng=function(t){return H(t,Rg)},Pg=function(t,e,n){switch(t.type){case"menuitem":return ph(t).fold(Ig,function(t){return P.some(Mg(t,e,n))});case"nestedmenuitem":return(i=t,Po("nestedmenuitem",bh,i)).fold(Ig,function(t){return P.some(Hg(t,e,n))});case"styleitem":return"menuitem"===t.item.type?ph(t.item).fold(Ig,function(t){return P.some(Og(t,e,n))}):"togglemenuitem"===t.item.type?xh(t.item).fold(Ig,function(t){return P.some(Og(t,e,n))}):(console.error("Unsupported style item delegate",t.item),P.none());case"togglemenuitem":return xh(t).fold(Ig,function(t){return P.some(Eg(t,e,n))});case"separator":return(r=t,Po("separatormenuitem",zh,r)).fold(Ig,function(t){return P.some(Cg(t))});case"fancymenuitem":return(o=t,Po("fancymenuitem",Sh,o)).fold(Ig,function(t){return Vg(t)});default:return console.error("Unknown item in general menu",t),P.none()}var o,r,i},jg=function(t,e,n,o,r){var i,u,a,c,s,l,f;return"color"===r?{value:t,dom:(i=o,f={dom:{tag:"div",classes:["tox-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Nm.parts().items({preprocess:"auto"!==i?Fg({tag:"div",classes:["tox-swatches__row"]},i):d})]}]}).dom,components:f.components,items:n}:"normal"===r&&"auto"===o?{value:t,dom:(f=Lg(o,n)).dom,components:f.components,items:n}:"normal"===r&&1===o?{value:t,dom:(f=Lg(1,n)).dom,components:f.components,items:n}:"normal"===r?{value:t,dom:(f=Lg(o,n)).dom,components:f.components,items:n}:"toolbar"!==r||"auto"===o?{value:t,dom:(a=e,c=o,s=r,l=Tg(s),{tag:"div",classes:R([[l.menu,"tox-menu-"+c+"-column"],a?[l.hasIcons]:[]])}),components:Bg,items:n}:{value:t,dom:(u=o,f={dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Nm.parts().items({preprocess:Fg({tag:"div",classes:["tox-collection__group"]},u)})]}).dom,components:f.components,items:n}},Ug=function(t,n,o,r,i,u,a){return Ot(V(t,function(e){return"choiceitem"===e.type?(t=e,Po("choicemenuitem",wh,t)).fold(Ig,function(t){return P.some(Sg(t,1===o,r,n,u(e.value),i,a))}):P.none();var t}))},Wg=function(t,n,o,r,i){return Ot(V(t,function(t){return(e=t,Po("Autocompleter.Item",dh,e)).fold(Ig,function(t){return P.some(kg(t,1===o,"normal",n,r,i))});var e}))},Gg=function(t,e,n,o,r,i,u,a){var c=Ng(e),s=Ug(e,n,o,"color"!==r?"normal":"color",i,u,a);return jg(t,c,s,o,r)},Xg=function(t,e,n,o){var r=Ng(e),i=Ot(V(e,function(t){return Pg(t,n,o)}));return jg(t,r,i,1,"normal")},Yg=function(t){return Gm.singleData(t.value,t)},qg=function(h,g){var v=su(Xm.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],lazySink:g.getSink})),t=function(){return Xm.isOpen(v)},p=function(){t()&&Xm.hide(v)},e=Gt(function(){return hh(h)}),n=uh(function(t){(" "===t.key?P.none():fh(h,e)).fold(p,function(m){m.lookupData.then(function(t){var n,e,o,r,i,u,a,c,s,l,f=(n=m.triggerChar,o=Mt(e=t,function(t){return P.from(t.columns)}).getOr(1),j(e,function(i){var t=i.items;return Wg(t,function(o,r){var t=h.selection.getRng(),e=t.startContainer;ch(t,n,e.data,t.startOffset).fold(function(){return console.error("Lost context. Cursor probably moved")},function(t){var e=t.rng,n={hide:p};i.onAction(n,e,o,r)})},o,dg.BUBBLE_TO_SANDBOX,g.providers)}));if(0<f.length){var d=Mt(t,function(t){return P.from(t.columns)}).getOr(1);Xm.showAt(v,{anchor:"selection",root:Ne.fromDom(h.getBody()),getSelection:function(){return P.some({start:function(){return Ne.fromDom(m.range.startContainer)},soffset:function(){return m.range.startOffset},finish:function(){return Ne.fromDom(m.range.endContainer)},foffset:function(){return m.range.endOffset}})}},Nm.sketch((r=jg("autocompleter-value",!0,f,d,"normal"),i=d,u=lg.ContentFocus,a="normal",c=u===lg.ContentFocus?mf():df(),s=_g(i,a),l=Ag(a),{dom:r.dom,components:r.components,items:r.items,value:r.value,markers:{selectedItem:l.selectedItem,item:l.item},movement:s,fakeFocus:u===lg.ContentFocus,focusManager:c,menuBehaviours:Oh("auto"!==i?[]:[Qr(function(o,t){kh(o,4,l.item).each(function(t){var e=t.numColumns,n=t.numRows;jd.setGridSize(o,n,e)})})])}))),Xm.getContent(v).each(Jl.highlightFirst)}else p()})})},50);sh({onKeypress:n,closeIfNecessary:p,isActive:t,getView:function(){return Xm.getContent(v)}},h)},Kg=function(m,h){return function(t){if(m(t)){var e,n,o,r,i,u,a,c=Ne.fromDom(t.target),s=function(){t.stopPropagation()},l=function(){t.preventDefault()},f=g(l,s),d=(e=c,n=t.clientX,o=t.clientY,r=s,i=l,u=f,a=t,{target:U(e),x:U(n),y:U(o),stop:r,prevent:i,kill:u,raw:U(a)});h(d)}}},Jg=function(t,e,n,o,r){var i=Kg(n,o);return t.dom().addEventListener(e,i,r),{unbind:f($g,t,e,i,r)}},$g=function(t,e,n,o){t.dom().removeEventListener(e,n,o)},Qg=U(!0),Zg=function(t,e,n){return Jg(t,e,Qg,n,!1)},tv=function(t,e,n){return Jg(t,e,Qg,n,!0)},ev=function(t,e,n){return mu(t,e,n).isSome()};function nv(n,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},schedule:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r=setTimeout(function(){n.apply(null,t),r=null},o)}}}var ov=function(t){var e=t.raw();return e.touches===undefined||1!==e.touches.length?P.none():P.some(e.touches[0])},rv=function(n){var u=Ct(P.none()),o=nv(function(t){u.set(P.none()),n.triggerEvent(Me(),t)},400),r=zt([{key:Ht(),value:function(n){return ov(n).each(function(t){o.cancel();var e={x:U(t.clientX),y:U(t.clientY),target:n.target};o.schedule(n),u.set(P.some(e))}),P.none()}},{key:Et(),value:function(t){return o.cancel(),ov(t).each(function(i){u.get().each(function(t){var e,n,o,r;e=i,n=t,o=Math.abs(e.clientX-n.x()),r=Math.abs(e.clientY-n.y()),(5<o||5<r)&&u.set(P.none())})}),P.none()}},{key:Vt(),value:function(e){return o.cancel(),u.get().filter(function(t){return nn(t.target(),e.target())}).map(function(t){return n.triggerEvent(Ce(),e)})}}]);return{fireIfReady:function(e,t){return xt(r,t).bind(function(t){return t(e)})}}},iv=pe.detect().browser.isFirefox(),uv=Ho([or("triggerEvent"),dr("stopBackspace",!0)]),av=function(e,t){var n,o,r,i,u=Uo("Getting GUI events settings",uv,t),a=pe.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],c=rv(u),s=V(a.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(t){return Zg(e,t,function(e){c.fireIfReady(e,t).each(function(t){t&&e.kill()}),u.triggerEvent(t,e)&&e.kill()})}),l=Ct(P.none()),f=Zg(e,"paste",function(e){c.fireIfReady(e,"paste").each(function(t){t&&e.kill()}),u.triggerEvent("paste",e)&&e.kill(),l.set(P.some(setTimeout(function(){u.triggerEvent(we(),e)},0)))}),d=Zg(e,"keydown",function(t){var e;u.triggerEvent("keydown",t)?t.kill():!0!==u.stopBackspace||8!==(e=t).raw().which||M(["input","textarea"],yn(e.target()))||ev(e.target(),'[contenteditable="true"]')||t.prevent()}),m=(n=e,o=function(t){u.triggerEvent("focusin",t)&&t.kill()},iv?tv(n,"focus",o):Zg(n,"focusin",o)),h=Ct(P.none()),g=(r=e,i=function(t){u.triggerEvent("focusout",t)&&t.kill(),h.set(P.some(setTimeout(function(){u.triggerEvent(xe(),t)},0)))},iv?tv(r,"blur",i):Zg(r,"focusout",i));return{unbind:function(){T(s,function(t){t.unbind()}),d.unbind(),m.unbind(),g.unbind(),f.unbind(),l.get().each(clearTimeout),h.get().each(clearTimeout)}}},cv=function(t,e){var n=xt(t,"target").map(function(t){return t()}).getOr(e);return Ct(n)},sv=dt([{stopped:[]},{resume:["element"]},{complete:[]}]),lv=function(t,o,e,n,r,i){var u,a,c,s,l=t(o,n),f=(u=e,a=r,c=Ct(!1),s=Ct(!1),{stop:function(){c.set(!0)},cut:function(){s.set(!0)},isStopped:c.get,isCut:s.get,event:U(u),setSource:a.set,getSource:a.get});return l.fold(function(){return i.logEventNoHandlers(o,n),sv.complete()},function(e){var n=e.descHandler();return ki(n)(f),f.isStopped()?(i.logEventStopped(o,e.element(),n.purpose()),sv.stopped()):f.isCut()?(i.logEventCut(o,e.element(),n.purpose()),sv.complete()):un(e.element()).fold(function(){return i.logNoParent(o,e.element(),n.purpose()),sv.complete()},function(t){return i.logEventResponse(o,e.element(),n.purpose()),sv.resume(t)})})},fv=function(e,n,o,t,r,i){return lv(e,n,o,t,r,i).fold(function(){return!0},function(t){return fv(e,n,o,t,r,i)},function(){return!1})},dv=function(t,e,n){var o,r,i=(o=e,r=Ct(!1),{stop:function(){r.set(!0)},cut:N,isStopped:r.get,isCut:U(!1),event:U(o),setSource:u("Cannot set source of a broadcasted event"),getSource:u("Cannot get source of a broadcasted event")});return T(t,function(t){var e=t.descHandler();ki(e)(i)}),i.isStopped()},mv=function(t,e,n,o,r){var i=cv(n,o);return fv(t,e,n,o,i,r)},hv=Pe("element","descHandler"),gv=function(t,e){return{id:U(t),descHandler:U(e)}};function vv(){var i={};return{registerId:function(o,r,t){tt(t,function(t,e){var n=i[e]!==undefined?i[e]:{};n[r]=Si(t,o),i[e]=n})},unregisterId:function(n){tt(i,function(t,e){t.hasOwnProperty(n)&&delete t[n]})},filterByType:function(t){return xt(i,t).map(function(t){return ot(t,function(t,e){return gv(e,t)})}).getOr([])},find:function(t,e,n){var r=bt(e)(i);return Nr(n,function(t){return n=r,si(o=t).fold(function(){return P.none()},function(t){var e=bt(t);return n.bind(e).map(function(t){return hv(o,t)})});var n,o},t)}}}function pv(){var o=vv(),r={},i=function(o){var t=o.element();return si(t).fold(function(){return t="uid-",e=o.element(),n=Un(ui+t),ci(e,n),n;var t,e,n},function(t){return t})},u=function(t){si(t.element()).each(function(t){r[t]=undefined,o.unregisterId(t)})};return{find:function(t,e,n){return o.find(t,e,n)},filter:function(t){return o.filterByType(t)},register:function(t){var e=i(t);kt(r,e)&&function(t,e){var n=r[e];if(n!==t)throw new Error('The tagId "'+e+'" is already used by: '+An(n.element())+"\nCannot use it for: "+An(t.element())+"\nThe conflicting element is"+(Dr(n.element())?" ":" not ")+"already in the DOM");u(t)}(t,e);var n=[t];o.registerId(n,e,t.events()),r[e]=t},unregister:u,getById:function(t){return bt(t)(r)}}}var bv,yv,xv=Al({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,o=Xn(e,["attributes"]);return{uid:t.uid,dom:Gn({tag:"div",attributes:Gn({role:"presentation"},n)},o),components:t.components,behaviours:Ts(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[dr("components",[]),Vs("containerBehaviours",[]),dr("events",{}),dr("domModification",{}),dr("eventOrder",{})]}),wv=function(n){var o=function(e){return un(n.element()).fold(function(){return!0},function(t){return nn(e,t)})},r=pv(),s=function(t,e){return r.find(o,t,e)},t=av(n.element(),{triggerEvent:function(u,a){return In(u,a.target(),function(t){return e=s,n=u,r=t,i=(o=a).target(),mv(e,n,o,i,r);var e,n,o,r,i})}}),i={debugInfo:U("real"),triggerEvent:function(e,n,o){In(e,n,function(t){mv(s,e,o,n,t)})},triggerFocus:function(a,c){si(a).fold(function(){cf(a)},function(t){In(ye(),a,function(t){var e,n,o,r,i,u;e=s,n=ye(),o={originator:U(c),kill:N,prevent:N,target:U(a)},i=t,u=cv(o,r=a),lv(e,n,o,r,u,i)})})},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element(),e.event())},getByUid:function(t){return h(t)},getByDom:function(t){return g(t)},build:su,addToGui:function(t){a(t)},removeFromGui:function(t){c(t)},addToWorld:function(t){e(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:U(!0)},e=function(t){t.connect(i),zn(t.element())||(r.register(t),T(t.components(),e),i.triggerEvent(Ve(),t.element(),{target:U(t.element())}))},u=function(t){zn(t.element())||(T(t.components(),u),r.unregister(t)),t.disconnect()},a=function(t){cs(n,t)},c=function(t){fs(t)},l=function(n){var t=r.filter(ze());T(t,function(t){var e=t.descHandler();ki(e)(n)})},f=function(t){l({universal:U(!0),data:U(t)})},d=function(t,e){l({universal:U(!1),channels:U(t),data:U(e)})},m=function(t,e){var n=r.filter(t);return dv(n,e)},h=function(t){return r.getById(t).fold(function(){return ft.error(new Error('Could not find component with uid: "'+t+'" in system.'))},ft.value)},g=function(t){var e=si(t).getOr("not found");return h(e)};return e(n),{root:U(n),element:n.element,destroy:function(){t.unbind(),vn(n.element())},add:a,remove:c,getByUid:h,getByDom:g,addToWorld:e,removeFromWorld:u,broadcast:f,broadcastOn:d,broadcastEvent:m}},zv=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Sv=tinymce.util.Tools.resolve("tinymce.EditorManager"),kv=function(t){return P.from(t.settings.min_width).filter(k)},Cv=function(t){return P.from(t.settings.min_height).filter(k)},Ov=function(e){var t=Q(e.settings),n=A(t,function(t){return/^toolbar([1-9])$/.test(t)}),o=V(n,function(t){return e.getParam(t,!1,"string")}),r=A(o,function(t){return"string"==typeof t});return 0<r.length?P.some(r):P.none()},Mv=Un("form-component-change"),Hv=Un("form-close"),Ev=Un("form-cancel"),Vv=Un("form-action"),Tv=Un("form-submit"),Av=Un("form-block"),Bv=Un("form-unblock"),Dv=Un("form-tabchange"),_v=Un("form-resize"),Fv=U([dr("prefix","form-field"),Vs("fieldBehaviours",[Ll,um])]),Lv=U([ul({schema:[Zo("dom")],name:"label"}),ul({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Zo("text")],name:"aria-descriptor"}),rl({factory:{sketch:function(t){var e=pt(t,["factory"]);return t.factory.sketch(e)}},schema:[Zo("factory")],name:"field"})]),Iv=Bl({name:"FormField",configFields:Fv(),partFields:Lv(),factory:function(r,t,e,n){var o=As(r.fieldBehaviours,[Ll.config({find:function(t){return bl(t,r,"field")}}),um.config({store:{mode:"manual",getValue:function(t){return Ll.getCurrent(t).bind(um.getValue)},setValue:function(t,e){Ll.getCurrent(t).each(function(t){um.setValue(t,e)})}}})]),i=Pr([Qr(function(t,e){var o=xl(t,r,["label","field","aria-descriptor"]);o.field().each(function(n){var e=Un(r.prefix);o.label().each(function(t){Cn(t.element(),"for",e),Cn(n.element(),"id",e)}),o["aria-descriptor"]().each(function(t){var e=Un(r.prefix);Cn(t.element(),"id",e),Cn(n.element(),"aria-describedby",e)})})})]),u={getField:function(t){return bl(t,r,"field")},getLabel:function(t){return bl(t,r,"label")}};return{uid:r.uid,dom:r.dom,components:t,behaviours:o,events:i,apis:u}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),Rv=Object.freeze({getCoupled:function(t,e,n,o){return n.getOrCreate(t,e,o)}}),Nv=[tr("others",No(ft.value,Xo()))],Pv=Lu({fields:Nv,name:"coupling",apis:Rv,state:Object.freeze({init:function(t){var i={},e=U({});return xi({readState:e,getOrCreate:function(n,o,r){var t=Q(o.others);if(t)return xt(i,r).getOrThunk(function(){var t=xt(o.others,r).getOrDie("No information found for coupled component: "+r)(n),e=n.getSystem().build(t);return i[r]=e});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+xo(t,null,2))}})}})}),jv=Object.freeze({events:function(t,e){var n=t.stream.streams.setup(t,e);return Pr([Wr(t.event,n),Zr(function(){return e.cancel()})].concat(t.cancelEvent.map(function(t){return[Wr(t,function(){return e.cancel()})]}).getOr([])))}}),Uv=function(t){var e=Ct(null);return xi({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()}})},Wv=Object.freeze({throttle:Uv,init:function(t){return t.stream.streams.state(t)}}),Gv=[tr("stream",Go("mode",{throttle:[Zo("delay"),dr("stopEvent",!0),Mu("streams",{setup:function(t,e){var n=t.stream,o=uh(t.onStream,n.delay);return e.setTimer(o),function(t,e){o.throttle(t,e),n.stopEvent&&e.stop()}},state:Uv})]})),dr("event","input"),ar("cancelEvent"),Cu("onStream")],Xv=Lu({fields:Gv,name:"streaming",active:jv,state:Wv}),Yv=function(t){var n=P.none(),e=[],o=function(t){r()?u(t):e.push(t)},r=function(){return n.isSome()},i=function(t){T(t,u)},u=function(e){n.each(function(t){setTimeout(function(){e(t)},0)})};return t(function(t){n=P.some(t),i(e),e=[]}),{get:o,map:function(n){return Yv(function(e){o(function(t){e(n(t))})})},isReady:r}},qv={nu:Yv,pure:function(e){return Yv(function(t){t(e)})}},Kv=function(e){var t=function(t){var o;e((o=t,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this;setTimeout(function(){o.apply(n,t)},0)}))},n=function(){return qv.nu(t)};return{map:function(o){return Kv(function(n){t(function(t){var e=o(t);n(e)})})},bind:function(n){return Kv(function(e){t(function(t){n(t).get(e)})})},anonBind:function(n){return Kv(function(e){t(function(t){n.get(e)})})},toLazy:n,toCached:function(){var e=null;return Kv(function(t){null===e&&(e=n()),e.get(t)})},get:t}},Jv={nu:Kv,pure:function(e){return Kv(function(t){t(e)})}},$v=U("sink"),Qv=U(ul({name:$v(),overrides:U({dom:{tag:"div"},behaviours:_u([is.config({useFixed:!0})]),events:Pr([Kr(It()),Kr(Tt()),Kr(jt())])})}));(yv=bv||(bv={}))[yv.HighlightFirst=0]="HighlightFirst",yv[yv.HighlightNone=1]="HighlightNone";var Zv=function(t,e){var n=t.getHotspot(e).getOr(e);return t.layouts.fold(function(){return{anchor:"hotspot",hotspot:n}},function(t){return{anchor:"hotspot",hotspot:n,layouts:t}})},tp=function(t,e,n,o,r,i,u){var a,c,s,l,f,d,m,h,g,v,p=Zv(t,n);return(c=p,l=o,f=r,d=u,m=e,h=s=n,g=(0,(a=t).fetch)(h).map(m),v=rp(s,a),g.map(function(t){return Gm.sketch(Gn({},f.menu(),{uid:li(""),data:t,highlightImmediately:d===bv.HighlightFirst,onOpenMenu:function(t,e){var n=v().getOrDie();is.position(n,c,e),ks.decloak(l)},onOpenSubmenu:function(t,e,n){var o=v().getOrDie();is.position(o,{anchor:"submenu",item:e},n),ks.decloak(l)},onEscape:function(){return fm.focus(s),ks.close(l),P.some(!0)}}))})).map(function(t){return ks.cloak(o),ks.open(o,t),i(o),o})},ep=function(t,e,n,o,r,i,u){return ks.close(o),Jv.pure(o)},np=function(t,e,n,o,r,i){var u=Pv.getCoupled(n,"sandbox");return(ks.isOpen(u)?ep:tp)(t,e,n,u,o,r,i)},op=function(t,e,n){var o,r,i=Ll.getCurrent(e).getOr(e),u=ea(t.element());n?Wi(i.element(),"min-width",u+"px"):(o=i.element(),r=u,ta.set(o,r))},rp=function(e,t){return e.getSystem().getByUid(t.uid+"-"+$v()).map(function(t){return function(){return ft.value(t)}}).getOrThunk(function(){return t.lazySink.fold(function(){return function(){return ft.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(t){return function(){return t(e)}})})},ip=function(o,r,i){var e,u=(e=Un("aria-owns"),{id:U(e),link:function(t){Cn(t,"aria-owns",e)},unlink:function(t){En(t,"aria-owns")}}),t=rp(r,o);return{dom:{tag:"div",classes:o.sandboxClasses,attributes:{id:u.id()}},behaviours:Ds(o.sandboxBehaviours,[um.config({store:{mode:"memory",initialValue:r}}),ks.config({onOpen:function(t,e){var n=Zv(o,r);u.link(r.element()),o.matchWidth&&op(n.hotspot,e,o.useMinWidth),o.onOpen(n,t,e),i!==undefined&&i.onOpen!==undefined&&i.onOpen(t,e)},onClose:function(t,e){u.unlink(r.element()),i!==undefined&&i.onClose!==undefined&&i.onClose(t,e)},isPartOf:function(t,e,n){return gu(e,n)||gu(r,n)},getAttachPoint:function(){return t().getOrDie()}}),Ll.config({find:function(t){return ks.getState(t).bind(function(t){return Ll.getCurrent(t)})}}),Hs({isExtraPart:U(!1)})])}},up=function(t,e,n){var o=um.getValue(n);um.setValue(e,o),cp(e)},ap=function(t,e){var n=t.element(),o=Qi(n),r=n.dom();"number"!==Mn(n,"type")&&e(r,o)},cp=function(t){ap(t,function(t,e){return t.setSelectionRange(e.length,e.length)})},sp=function(t,e,o){if(t.selectsOver){var n=um.getValue(e),r=t.getDisplayText(n),i=um.getValue(o);return 0===t.getDisplayText(i).indexOf(r)?P.some(function(){var t,n;up(0,e,o),t=e,n=r.length,ap(t,function(t,e){return t.setSelectionRange(n,e.length)})}):P.none()}return P.none()},lp=U([ar("data"),dr("inputAttributes",{}),dr("inputStyles",{}),dr("tag","input"),dr("inputClasses",[]),Su("onSetValue"),dr("styles",{}),dr("eventOrder",{}),Vs("inputBehaviours",[um,fm]),dr("selectOnFocus",!0)]),fp=function(t){return _u([fm.config({onFocus:!1===t.selectOnFocus?N:function(t){var e=t.element(),n=Qi(e);e.dom().setSelectionRange(0,n.length)}})])},dp=function(t){return{tag:t.tag,attributes:Gn({type:"input"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},mp=U("alloy.typeahead.itemexecute"),hp=function(){return[dr("sandboxClasses",[]),Bs("sandboxBehaviours",[Ll,Uu,ks,um])]},gp=U([ar("lazySink"),Zo("fetch"),dr("minChars",5),dr("responseTime",1e3),Su("onOpen"),dr("getHotspot",P.some),dr("layouts",P.none()),dr("eventOrder",{}),yr("model",{},[dr("getDisplayText",function(t){return t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.value}),dr("selectsOver",!0),dr("populateFromBrowse",!0)]),Su("onSetValue"),ku("onExecute"),Su("onItemExecute"),dr("inputClasses",[]),dr("inputAttributes",{}),dr("inputStyles",{}),dr("matchWidth",!0),dr("useMinWidth",!1),dr("dismissOnBlur",!0),wu(["openClass"]),ar("initialData"),Vs("typeaheadBehaviours",[fm,um,Xv,jd,km,Pv]),xr("previewing",function(){return Ct(!0)})].concat(lp()).concat(hp())),vp=U([il({schema:[xu()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(e,n){o.previewing.get()?e.getSystem().getByUid(o.uid).each(function(t){sp(o.model,t,n).fold(function(){return Jl.dehighlight(e,n)},function(t){return t()})}):e.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&up(o.model,t,n)}),o.previewing.set(!1)},onExecute:function(t,e){return t.getSystem().getByUid(o.uid).toOption().map(function(t){return Cr(t,mp(),{item:e}),!0})},onHover:function(t,e){o.previewing.set(!1),t.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&up(o.model,t,e)})}}}})]),pp=Bl({name:"Typeahead",configFields:gp(),partFields:vp(),factory:function(r,t,e,i){var n=function(t,e,n){r.previewing.set(!1);var o=Pv.getCoupled(t,"sandbox");ks.isOpen(o)?Ll.getCurrent(o).each(function(t){Jl.getHighlighted(t).fold(function(){n(t)},function(){Er(o,t.element(),"keydown",e)})}):tp(r,u(t),t,o,i,function(t){Ll.getCurrent(t).each(n)},bv.HighlightFirst).get(N)},o=fp(r),u=function(o){return function(t){var e=rt(t.menus),n=j(e,function(t){return A(t.items,function(t){return"item"===t.type})});return um.getState(o).update(V(n,function(t){return t.data})),t}},a=[fm.config({}),um.config({onSetValue:r.onSetValue,store:Gn({mode:"dataset",getDataKey:function(t){return Qi(t.element())},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,e){Zi(t.element(),r.model.getDisplayText(e))}},r.initialData.map(function(t){return wt("initialValue",t)}).getOr({}))}),Xv.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:function(t,e){var n=Pv.getCoupled(t,"sandbox");if(fm.isFocused(t)&&Qi(t.element()).length>=r.minChars){var o=Ll.getCurrent(n).bind(function(t){return Jl.getHighlighted(t).map(um.getValue)});r.previewing.set(!0),tp(r,u(t),t,n,i,function(t){Ll.getCurrent(n).each(function(t){o.fold(function(){r.model.selectsOver&&Jl.highlightFirst(t)},function(e){Jl.highlightBy(t,function(t){return um.getValue(t).value===e.value}),Jl.getHighlighted(t).orThunk(function(){return Jl.highlightFirst(t),P.none()})})})},bv.HighlightFirst).get(N)}},cancelEvent:Ee()}),jd.config({mode:"special",onDown:function(t,e){return n(t,e,Jl.highlightFirst),P.some(!0)},onEscape:function(t){var e=Pv.getCoupled(t,"sandbox");return ks.isOpen(e)?(ks.close(e),P.some(!0)):P.none()},onUp:function(t,e){return n(t,e,Jl.highlightLast),P.some(!0)},onEnter:function(e){var t=Pv.getCoupled(e,"sandbox"),n=ks.isOpen(t);if(n&&!r.previewing.get())return Ll.getCurrent(t).bind(function(t){return Jl.getHighlighted(t)}).map(function(t){return Cr(e,mp(),{item:t}),!0});var o=um.getValue(e);return kr(e,Ee()),r.onExecute(t,e,o),n&&ks.close(t),P.some(!0)}}),km.config({toggleClass:r.markers.openClass,aria:{mode:"pressed",syncWithExpanded:!0}}),Pv.config({others:{sandbox:function(t){return ip(r,t,{onOpen:d,onClose:d})}}}),Tm("typeaheadevents",[ei(function(t){var e=N;np(r,u(t),t,i,e,bv.HighlightFirst).get(N)}),Wr(mp(),function(t,e){var n=Pv.getCoupled(t,"sandbox");up(r.model,t,e.event().item()),kr(t,Ee()),r.onItemExecute(t,n,e.event().item(),um.getValue(t)),ks.close(n),cp(t)})].concat(r.dismissOnBlur?[Wr(xe(),function(t){var e=Pv.getCoupled(t,"sandbox");lf(e.element()).isNone()&&ks.close(e)})]:[]))];return{uid:r.uid,dom:dp(r),behaviours:Gn({},o,As(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),bp=function(t,e,n){var o=xp(t,e,n);return Iv.sketch(o)},yp=function(t,e){return bp(t,e,[])},xp=function(t,e,n){return{dom:wp(n),components:t.toArray().concat([e])}},wp=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},zp=function(t,e){return Iv.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},Sp=function(t){return"separator"===t.type},kp={type:"separator"},Cp=function(t,n){var e=D(t,function(t,e){return x(e)?""===e?t:"|"===e?0<t.length&&!Sp(t[t.length-1])?t.concat([kp]):t:it(n,e.toLowerCase())?t.concat([n[e.toLowerCase()]]):(console.error("No representation for menuItem: "+e),t):t.concat([e])},[]);return 0<e.length&&Sp(e[e.length-1])&&e.pop(),e},Op=function(t,e){return it(t,"getSubmenuItems")?(o=e,r=(n=t).getSubmenuItems(),i=Mp(r,o),{item:n,menus:gt(i.menus,wt(n.value,i.items)),expansions:gt(i.expansions,wt(n.value,n.value))}):{item:t,menus:{},expansions:{}};var n,o,r,i},Mp=function(t,r){var e=Cp(x(t)?t.split(" "):t,r);return B(e,function(t,e){var n=function(t){if(Sp(t))return t;var e=xt(t,"value").getOrThunk(function(){return Un("generated-menu-item")});return gt({value:e},t)}(e),o=Op(n,r);return{menus:gt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:gt(t.expansions,o.expansions)}},{menus:{},expansions:{},items:[]})},Hp=function(t,n,o){var e=Un("primary-menu"),r=Mp(t,o.menuItems()),i=Xg(e,r.items,n,o),u=et(r.menus,function(t,e){return Xg(e,t,n,o)}),a=gt(u,wt(e,i));return Gm.tieredData(e,a,r.expansions)},Ep=Al({name:"Input",configFields:lp(),factory:function(t,e){return{uid:t.uid,dom:dp(t),components:[],behaviours:(n=t,Gn({},fp(n),As(n.inputBehaviours,[um.config({store:{mode:"manual",initialValue:n.data.getOr(undefined),getValue:function(t){return Qi(t.element())},setValue:function(t,e){Qi(t.element())!==e&&Zi(t.element(),e)}},onSetValue:n.onSetValue})]))),eventOrder:t.eventOrder};var n}}),Vp=pe.detect().browser.isFirefox(),Tp={position:"absolute",left:"-9999px"},Ap=function(t,e,n){var o,r,i,u=function(t,e){var n=Ne.fromTag("span",t.dom());Cn(n,"role","presentation");var o=Ne.fromText(e,t.dom());return mn(n,o),n}(on(e),n);Vp&&(o=e,r=u,i=Un("ephox-alloy-aria-voice"),Cn(r,"id",i),Cn(o,"aria-describedby",i)),On(u,t(n)),Gi(u,Tp),mn(e,u),setTimeout(function(){En(u,"aria-live"),vn(u)},1e3)},Bp=function(t){return{"aria-live":"assertive","aria-atomic":"true",role:"alert"}},Dp=["input","textarea"],_p=function(t){var e=yn(t);return M(Dp,e)},Fp=function(t,e){var n=e.getRoot(t).getOr(t.element());Li(n,e.invalidClass),e.notify.each(function(e){_p(t.element())&&En(n,"title"),e.getContainer(t).each(function(t){bn(t,e.validHtml)}),e.onValid(t)})},Lp=function(n,t,e,o){var r=t.getRoot(n).getOr(n.element());_i(r,t.invalidClass),t.notify.each(function(t){var e;_p(n.element())&&Cn(n.element(),"title",o),e=_r(),Ap(Bp,e,o),t.getContainer(n).each(function(t){bn(t,o)}),t.onInvalid(n,o)})},Ip=function(e,t,n){return t.validator.fold(function(){return Jv.pure(ft.value(!0))},function(t){return t.validate(e)})},Rp=function(e,n,t){return n.notify.each(function(t){t.onValidate(e)}),Ip(e,n).map(function(t){return e.getSystem().isConnected()?t.fold(function(t){return Lp(e,n,0,t),ft.error(t)},function(t){return Fp(e,n),ft.value(t)}):ft.error("No longer in system")})},Np=Object.freeze({markValid:Fp,markInvalid:Lp,query:Ip,run:Rp,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element());return Ii(n,e.invalidClass)}}),Pp=Object.freeze({events:function(e,t){return e.validator.map(function(t){return Pr([Wr(t.onEvent,function(t){Rp(t,e).get(d)})].concat(t.validateOnLoad?[Qr(function(t){Rp(t,e).get(N)})]:[]))}).getOr({})}}),jp=[Zo("invalidClass"),dr("getRoot",P.none),fr("notify",[dr("aria","alert"),dr("getContainer",P.none),dr("validHtml",""),Su("onValid"),Su("onInvalid"),Su("onValidate")]),fr("validator",[Zo("validate"),dr("onEvent","input"),dr("validateOnLoad",!0)])],Up=Lu({fields:jp,name:"invalidating",active:Pp,apis:Np,extra:{validation:function(n){return function(t){var e=um.getValue(t);return Jv.pure(n(e))}}}}),Wp=Object.freeze({exhibit:function(t,e){return zi({attributes:zt([{key:e.tabAttr,value:"true"}])})}}),Gp=[dr("tabAttr","data-alloy-tabstop")],Xp=Lu({fields:Gp,name:"tabstopping",active:Wp}),Yp=function(t){return{value:U(t)}},qp=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Kp=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Jp=function(t){return qp.test(t)||Kp.test(t)},$p=function(t){var e,n=(e=t.value().replace(qp,function(t,e,n,o){return e+e+n+n+o+o}),{value:U(e)});return Kp.exec(n.value())},Qp=function(t){var e=t.toString(16);return 1==e.length?"0"+e:e},Zp=function(t){var e=Qp(t.red())+Qp(t.green())+Qp(t.blue());return Yp(e)},tb=Math.min,eb=Math.max,nb=Math.round,ob=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,rb=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,ib=function(t,e,n,o){return{red:U(t),green:U(e),blue:U(n),alpha:U(o)}},ub=function(t){var e=parseInt(t,10);return e.toString()===t&&0<=e&&e<=255},ab=function(t){var e,n,o,r,i,u,a,c,s,l;if(i=(t.hue()||0)%360,u=t.saturation()/100,a=t.value()/100,u=eb(0,tb(u,1)),a=eb(0,tb(a,1)),0===u)return c=s=l=nb(255*a),ib(c,s,l,1);switch(e=i/60,o=(n=a*u)*(1-Math.abs(e%2-1)),r=a-n,Math.floor(e)){case 0:c=n,s=o,l=0;break;case 1:c=o,s=n,l=0;break;case 2:c=0,s=n,l=o;break;case 3:c=0,s=o,l=n;break;case 4:c=o,s=0,l=n;break;case 5:c=n,s=0,l=o;break;default:c=s=l=0}return c=nb(255*(c+r)),s=nb(255*(s+r)),l=nb(255*(l+r)),ib(c,s,l,1)},cb=function(t){var e=$p(t),n=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16);return ib(n,o,r,1)},sb=function(t,e,n,o){var r=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(o);return ib(r,i,u,a)},lb=function(t){return"rgba("+t.red()+","+t.green()+","+t.blue()+","+t.alpha()+")"},fb=U(ib(255,0,0,1)),db=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),mb="tinymce-custom-colors",hb="choiceitem",gb=[{type:hb,text:"Turquoise",value:"#18BC9B"},{type:hb,text:"Green",value:"#2FCC71"},{type:hb,text:"Blue",value:"#3598DB"},{type:hb,text:"Purple",value:"#9B59B6"},{type:hb,text:"Navy Blue",value:"#34495E"},{type:hb,text:"Dark Turquoise",value:"#18A085"},{type:hb,text:"Dark Green",value:"#27AE60"},{type:hb,text:"Medium Blue",value:"#2880B9"},{type:hb,text:"Medium Purple",value:"#8E44AD"},{type:hb,text:"Midnight Blue",value:"#2B3E50"},{type:hb,text:"Yellow",value:"#F1C40F"},{type:hb,text:"Orange",value:"#E67E23"},{type:hb,text:"Red",value:"#E74C3C"},{type:hb,text:"Light Gray",value:"#ECF0F1"},{type:hb,text:"Gray",value:"#95A5A6"},{type:hb,text:"Dark Yellow",value:"#F29D12"},{type:hb,text:"Dark Orange",value:"#D35400"},{type:hb,text:"Dark Red",value:"#E74C3C"},{type:hb,text:"Medium Gray",value:"#BDC3C7"},{type:hb,text:"Dark Gray",value:"#7E8C8D"},{type:hb,text:"Black",value:"#000000"},{type:hb,text:"White",value:"#ffffff"}],vb=function sE(r){void 0===r&&(r=10);var t,e=db.getItem(mb),n=x(e)?JSON.parse(e):[],i=r-(t=n).length<0?t.slice(0,r):t,u=function(t){i.splice(t,1)};return{add:function(t){var e,n,o;(e=i,n=t,o=C(e,n),-1===o?P.none():P.some(o)).each(u),i.unshift(t),i.length>r&&i.pop(),db.setItem(mb,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),pb=function(t){var e,n=[];for(e=0;e<t.length;e+=2)n.push({text:t[e+1],value:"#"+t[e],type:"choiceitem"});return n},bb=function(t){return t.getParam("color_map")},yb=function(t,e){return t.getParam("color_cols",e,"number")},xb=function(t){return!1!==t.getParam("custom_colors")},wb=function(t){var e=bb(t);return e!==undefined?pb(e):gb},zb=function(){return V(vb.state(),function(t){return{type:hb,text:t,value:t}})},Sb=function(t){vb.add(t)},kb=function(t,n){var o;return t.dom.getParents(t.selection.getStart(),function(t){var e;(e=t.style["forecolor"===n?"color":"background-color"])&&(o=o||e)}),o},Cb=function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))},Ob=function(t){var e=wb(t),n=Cb(e.length);return yb(t,n)},Mb=function(e,n,t,o){"custom"===t?Vb(e)(function(t){t.each(function(t){Sb(t),e.execCommand("mceApplyTextcolor",n,t),o(t)})},"#000000"):"remove"===t?(o(""),e.execCommand("mceRemoveTextcolor",n)):(o(t),e.execCommand("mceApplyTextcolor",n,t))},Hb=function(o,r){return function(t){var e,n;t(o.concat(zb().concat((n={type:e="choiceitem",text:"Remove color",icon:"color-swatch-remove-color",value:"remove"},r?[n,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[n]))))}},Eb=function(e,r,i,t){var u;e.ui.registry.addSplitButton(r,(u=Ct(null),{type:"splitbutton",tooltip:t,presets:"color",icon:"forecolor"===r?"text-color":"highlight-bg-color",select:function(n){return P.from(kb(e,i)).bind(function(t){return function(t){if("transparent"===t)return P.some(ib(0,0,0,0));if(ob.test(t)){var e=ob.exec(t);return P.some(sb(e[1],e[2],e[3],"1"))}if(rb.test(t)){var n=ob.exec(t);return P.some(sb(n[1],n[2],n[3],n[4]))}return P.none()}(t).map(function(t){var e=Zp(t).value();return le(n.toLowerCase(),e)})}).getOr(!1)},columns:Ob(e),fetch:Hb(wb(e),xb(e)),onAction:function(t){null!==u.get()&&Mb(e,i,u.get(),function(){})},onItemAction:function(o,t){Mb(e,i,t,function(t){var e,n;u.set(t),e="forecolor"===r?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",n=t,o.setIconFill(e,n),o.setIconStroke(e,n)})}}))},Vb=function(i){return function(t,e){var n,o={colorpicker:e},r=(n=t,function(t){var e=t.getData();n(P.from(e.colorpicker)),t.close()});i.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&&(e.value?t.enable("ok"):t.disable("ok"))},onSubmit:r,onClose:function(){},onCancel:function(){t(P.none())}})}},Tb={register:function(t){var i;(i=t).addCommand("mceApplyTextcolor",function(t,e){var n,o,r;o=t,r=e,(n=i).undoManager.transact(function(){n.focus(),n.formatter.apply(o,{value:r}),n.nodeChanged()})}),i.addCommand("mceRemoveTextcolor",function(t){var e,n;n=t,(e=i).undoManager.transact(function(){e.focus(),e.formatter.remove(n,{value:null},null,!0),e.nodeChanged()})}),Eb(t,"forecolor","forecolor","Text color"),Eb(t,"backcolor","hilitecolor","Background color")},getFetch:Hb,colorPickerDialog:Vb,getCurrentColor:kb,getColorCols:Ob,calcCols:Cb},Ab=U([Zo("dom"),Zo("fetch"),Su("onOpen"),ku("onExecute"),dr("getHotspot",P.some),dr("layouts",P.none()),Vs("dropdownBehaviours",[km,Pv,jd,fm]),Zo("toggleClass"),dr("eventOrder",{}),ar("lazySink"),dr("matchWidth",!1),dr("useMinWidth",!1),ar("role")].concat(hp())),Bb=U([il({schema:[xu()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Qv()]),Db=Bl({name:"Dropdown",configFields:Ab(),partFields:Bb(),factory:function(e,t,n,o){var r,i,u=function(t){ks.getState(t).each(function(t){Gm.highlightPrimary(t)})},a={expand:function(t){km.isOn(t)||np(e,function(t){return t},t,o,N,bv.HighlightNone).get(N)},open:function(t){km.isOn(t)||np(e,function(t){return t},t,o,N,bv.HighlightFirst).get(N)},isOpen:km.isOn,close:function(t){km.isOn(t)&&np(e,function(t){return t},t,o,N,bv.HighlightFirst).get(N)}},c=function(t,e){return Or(t),P.some(!0)};return{uid:e.uid,dom:e.dom,components:t,behaviours:As(e.dropdownBehaviours,[km.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),Pv.config({others:{sandbox:function(t){return ip(e,t,{onOpen:function(){km.on(t)},onClose:function(){km.off(t)}})}}}),jd.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,e){if(Db.isOpen(t)){var n=Pv.getCoupled(t,"sandbox");u(n)}else Db.open(t);return P.some(!0)},onEscape:function(t,e){return Db.isOpen(t)?(Db.close(t),P.some(!0)):P.none()}}),fm.config({})]),events:Ym(P.some(function(t){np(e,function(t){return t},t,o,u,bv.HighlightFirst).get(N)})),eventOrder:Gn({},e.eventOrder,(r={},r[Se()]=["disabling","toggling","alloy.base.behaviour"],r)),apis:a,domModification:{attributes:Gn({"aria-haspopup":"true"},e.role.fold(function(){return{}},function(t){return{role:t}}),"button"===e.dom.tag?{type:(i="type",xt(e.dom,"attributes").bind(function(t){return xt(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)}}}),_b=Lu({fields:[],name:"unselecting",active:Object.freeze({events:function(t){return Pr([jr(Wt(),U(!0))])},exhibit:function(t,e){return zi({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Fb=Un("color-input-change"),Lb=Un("color-swatch-change"),Ib=Un("color-picker-cancel"),Rb=function(t,e,o){var n,r,i=Iv.parts().field({factory:Ep,inputClasses:["tox-textfield"],onSetValue:function(t){return Up.run(t).get(function(){})},inputBehaviours:_u([Xp.config({}),Up.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return un(t.element())},notify:{onValid:function(t){var e=um.getValue(t);Cr(t,Fb,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=um.getValue(t);if(0===e.length)return Jv.pure(ft.value(!0));var n=Ne.fromTag("span");Wi(n,"background-color",e);var o=qi(n,"background-color").fold(function(){return ft.error("blah")},function(t){return ft.value(e)});return Jv.pure(o)}}})]),selectOnFocus:!1}),u=t.label.map(function(t){return zp(t,e.providers)}),a=function(t,e){Cr(t,Lb,{value:e})},c=Km((n={dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:P.some({onRtl:function(){return[$a]},onLtr:function(){return[Qa]}}),components:[],fetch:Tb.getFetch(o.getColors(),o.hasCustomColors()),onItemAction:function(n){e.getSink().each(function(t){c.getOpt(t).each(function(e){"custom"===n?o.colorPicker(function(t){t.fold(function(){return kr(e,Ib)},function(t){a(e,t),Sb(t)})},"#ffffff"):a(e,"remove"===n?"":n)})})}},r=e,Db.sketch({dom:n.dom,components:n.components,toggleClass:"mce-active",dropdownBehaviours:_u([_b.config({}),Xp.config({})]),layouts:n.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:r.getSink,fetch:function(){return Jv.nu(function(t){return n.fetch(t)}).map(function(t){return Yg(gt(Gg(Un("menu-value"),t,function(t){n.onItemAction(t)},5,"color",dg.CLOSE_ON_EXECUTE,function(){return!1},r.providers),{movement:_g(5,"color")}))})},parts:{menu:Dg(0,0,"color")}})));return Iv.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:u.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[i,c.asSpec()]}]),fieldBehaviours:_u([Tm("form-field-events",[Wr(Fb,function(t,e){c.getOpt(t).each(function(t){Wi(t.element(),"background-color",e.event().color())})}),Wr(Lb,function(e,n){Iv.getField(e).each(function(t){um.setValue(t,n.event().value()),Ll.getCurrent(e).each(fm.focus)})}),Wr(Ib,function(e,t){Iv.getField(e).each(function(t){Ll.getCurrent(e).each(fm.focus)})})])])})},Nb=pe.detect().deviceType.isTouch(),Pb=ul({schema:[Zo("dom")],name:"label"}),jb=function(t){return ul({name:t+"-edge",overrides:function(o){return o.model.manager.edgeActions[t].fold(function(){return{}},function(n){var t=Pr([Gr(Ht(),n,[o])]),e=Pr([Gr(Tt(),n,[o]),Gr(At(),function(t,e){e.mouseIsDown.get()&&n(t,e)},[o])]);return{events:Nb?t:e}})}})},Ub=jb("top-left"),Wb=jb("top"),Gb=jb("top-right"),Xb=jb("right"),Yb=jb("bottom-right"),qb=jb("bottom"),Kb=jb("bottom-left"),Jb=[Pb,jb("left"),Xb,Wb,qb,Ub,Gb,Kb,Yb,rl({name:"thumb",defaults:U({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Pr([Yr(Ht(),t,"spectrum"),Yr(Et(),t,"spectrum"),Yr(Vt(),t,"spectrum"),Yr(Tt(),t,"spectrum"),Yr(At(),t,"spectrum"),Yr(Dt(),t,"spectrum")])}}}),rl({schema:[xr("mouseIsDown",function(){return Ct(!1)})],name:"spectrum",overrides:function(n){var o=n.model.manager,r=function(e,t){return o.getValueFromEvent(t).map(function(t){return o.setValueFrom(e,n,t)})},t=Pr([Wr(Ht(),r),Wr(Et(),r)]),e=Pr([Wr(Tt(),r),Wr(At(),function(t,e){n.mouseIsDown.get()&&r(t,e)})]);return{behaviours:_u(Nb?[]:[jd.config({mode:"special",onLeft:function(t){return o.onLeft(t,n)},onRight:function(t){return o.onRight(t,n)},onUp:function(t){return o.onUp(t,n)},onDown:function(t){return o.onDown(t,n)}}),fm.config({})]),events:Nb?t:e}}})],$b=pe.detect().deviceType.isTouch(),Qb=U("slider.change.value"),Zb=function(t){var e=t.event().raw();if($b){var n=e;return n.touches!==undefined&&1===n.touches.length?P.some(n.touches[0]).map(function(t){return Xu(t.clientX,t.clientY)}):P.none()}var o=e;return o.clientX!==undefined?P.some(o).map(function(t){return Xu(t.clientX,t.clientY)}):P.none()},ty=function(t,e,n,o){return t<e?t:n<t?n:t===e?e-1:Math.max(e,t-o)},ey=function(t,e,n,o){return n<t?t:t<e?e:t===n?n+1:Math.min(n,t+o)},ny=function(t,e,n){return Math.max(e,Math.min(n,t))},oy=function(t){var e=t.min,n=t.max,o=t.range,r=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,h=s?e-1:e,g=l?n+1:n;if(r<f)return h;if(d<r)return g;var v,p,b,y,x,w,z,S=(x=r,w=f,z=d,Math.min(z,Math.max(x,w))-w),k=ny(S/m*o+e,h,g);return u&&e<=k&&k<=n?(v=k,p=e,b=n,y=i,a.fold(function(){var t=v-p,e=Math.round(t/y)*y;return ny(p+e,p-1,b+1)},function(t){var e=(v-t)%y,n=Math.round(e/y),o=Math.floor((v-t)/y),r=Math.floor((b-t)/y),i=t+Math.min(r,o+n)*y;return Math.max(t,i)})):c?Math.round(k):k},ry=function(t){var e=t.min,n=t.max,o=t.range,r=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return r<e?i?0:s:n<r?u?a:l:(r-e)/o*c},iy=function(t){return t.model.minX},uy=function(t){return t.model.minY},ay=function(t){return t.model.minX-1},cy=function(t){return t.model.minY-1},sy=function(t){return t.model.maxX},ly=function(t){return t.model.maxY},fy=function(t){return t.model.maxX+1},dy=function(t){return t.model.maxY+1},my=function(t,e,n){return e(t)-n(t)},hy=function(t){return my(t,sy,iy)},gy=function(t){return my(t,ly,uy)},vy=function(t){return hy(t)/2},py=function(t){return gy(t)/2},by=function(t){return t.stepSize},yy=function(t){return t.snapToGrid},xy=function(t){return t.snapStart},wy=function(t){return t.rounded},zy=function(t,e){return t[e+"-edge"]!==undefined},Sy=function(t){return zy(t,"left")},ky=function(t){return zy(t,"right")},Cy=function(t){return zy(t,"top")},Oy=function(t){return zy(t,"bottom")},My=function(t){return t.model.value.get()},Hy=function(t){return{x:U(t)}},Ey=function(t){return{y:U(t)}},Vy=function(t,e){return{x:U(t),y:U(e)}},Ty=function(t,e){Cr(t,Qb(),{value:e})},Ay="left",By=function(t){return t.element().dom().getBoundingClientRect()},Dy=function(t,e){return t[e]},_y=function(t){var e=By(t);return Dy(e,Ay)},Fy=function(t){var e=By(t);return Dy(e,"right")},Ly=function(t){var e=By(t);return Dy(e,"top")},Iy=function(t){var e=By(t);return Dy(e,"bottom")},Ry=function(t){var e=By(t);return Dy(e,"width")},Ny=function(t){var e=By(t);return Dy(e,"height")},Py=function(t,e,n){return(t+e)/2-n},jy=function(t,e){var n=By(t),o=By(e),r=Dy(n,Ay),i=Dy(n,"right"),u=Dy(o,Ay);return Py(r,i,u)},Uy=function(t,e){var n=By(t),o=By(e),r=Dy(n,"top"),i=Dy(n,"bottom"),u=Dy(o,"top");return Py(r,i,u)},Wy=function(t,e){Cr(t,Qb(),{value:e})},Gy=function(t){return{x:U(t)}},Xy=function(t,e,n){var o={min:iy(e),max:sy(e),range:hy(e),value:n,step:by(e),snap:yy(e),snapStart:xy(e),rounded:wy(e),hasMinEdge:Sy(e),hasMaxEdge:ky(e),minBound:_y(t),maxBound:Fy(t),screenRange:Ry(t)};return oy(o)},Yy=function(u){return function(t,e){return(n=u,o=t,r=e,i=(0<n?ey:ty)(My(r).x(),iy(r),sy(r),by(r)),Wy(o,Gy(i)),P.some(i)).map(function(){return!0});var n,o,r,i}},qy=function(t,e,n,o,r,i){var u,a,c,s,l,f,d,m,h,g=(a=i,c=n,s=o,l=r,f=Ry(u=e),d=s.bind(function(t){return P.some(jy(t,u))}).getOr(0),m=l.bind(function(t){return P.some(jy(t,u))}).getOr(f),h={min:iy(a),max:sy(a),range:hy(a),value:c,hasMinEdge:Sy(a),hasMaxEdge:ky(a),minBound:_y(u),minOffset:0,maxBound:Fy(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:m},ry(h));return _y(e)-_y(t)+g},Ky=Yy(-1),Jy=Yy(1),$y=P.none,Qy=P.none,Zy={"top-left":P.none(),top:P.none(),"top-right":P.none(),right:P.some(function(t,e){Ty(t,Hy(fy(e)))}),"bottom-right":P.none(),bottom:P.none(),"bottom-left":P.none(),left:P.some(function(t,e){Ty(t,Hy(ay(e)))})},tx=Object.freeze({setValueFrom:function(t,e,n){var o=Xy(t,e,n),r=Gy(o);return Wy(t,r),o},setToMin:function(t,e){var n=iy(e);Wy(t,Gy(n))},setToMax:function(t,e){var n=sy(e);Wy(t,Gy(n))},findValueOfOffset:Xy,getValueFromEvent:function(t){return Zb(t).map(function(t){return t.left()})},findPositionOfValue:qy,setPositionFromValue:function(t,e,n,o){var r=My(n),i=qy(t,o.getSpectrum(t),r.x(),o.getLeftEdge(t),o.getRightEdge(t),n),u=ea(e.element())/2;Wi(e.element(),"left",i-u+"px")},onLeft:Ky,onRight:Jy,onUp:$y,onDown:Qy,edgeActions:Zy}),ex=function(t,e){Cr(t,Qb(),{value:e})},nx=function(t){return{y:U(t)}},ox=function(t,e,n){var o={min:uy(e),max:ly(e),range:gy(e),value:n,step:by(e),snap:yy(e),snapStart:xy(e),rounded:wy(e),hasMinEdge:Cy(e),hasMaxEdge:Oy(e),minBound:Ly(t),maxBound:Iy(t),screenRange:Ny(t)};return oy(o)},rx=function(u){return function(t,e){return(n=u,o=t,r=e,i=(0<n?ey:ty)(My(r).y(),uy(r),ly(r),by(r)),ex(o,nx(i)),P.some(i)).map(function(){return!0});var n,o,r,i}},ix=function(t,e,n,o,r,i){var u,a,c,s,l,f,d,m,h,g=(a=i,c=n,s=o,l=r,f=Ny(u=e),d=s.bind(function(t){return P.some(Uy(t,u))}).getOr(0),m=l.bind(function(t){return P.some(Uy(t,u))}).getOr(f),h={min:uy(a),max:ly(a),range:gy(a),value:c,hasMinEdge:Cy(a),hasMaxEdge:Oy(a),minBound:Ly(u),minOffset:0,maxBound:Iy(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:m},ry(h));return Ly(e)-Ly(t)+g},ux=P.none,ax=P.none,cx=rx(-1),sx=rx(1),lx={"top-left":P.none(),top:P.some(function(t,e){Ty(t,Ey(cy(e)))}),"top-right":P.none(),right:P.none(),"bottom-right":P.none(),bottom:P.some(function(t,e){Ty(t,Ey(dy(e)))}),"bottom-left":P.none(),left:P.none()},fx=Object.freeze({setValueFrom:function(t,e,n){var o=ox(t,e,n),r=nx(o);return ex(t,r),o},setToMin:function(t,e){var n=uy(e);ex(t,nx(n))},setToMax:function(t,e){var n=ly(e);ex(t,nx(n))},findValueOfOffset:ox,getValueFromEvent:function(t){return Zb(t).map(function(t){return t.top()})},findPositionOfValue:ix,setPositionFromValue:function(t,e,n,o){var r=My(n),i=ix(t,o.getSpectrum(t),r.y(),o.getTopEdge(t),o.getBottomEdge(t),n),u=ra(e.element())/2;Wi(e.element(),"top",i-u+"px")},onLeft:ux,onRight:ax,onUp:cx,onDown:sx,edgeActions:lx}),dx=function(t,e){Cr(t,Qb(),{value:e})},mx=function(t,e){return{x:U(t),y:U(e)}},hx=function(s,l){return function(t,e){return(n=s,o=l,r=t,i=e,u=0<n?ey:ty,a=o?My(i).x():u(My(i).x(),iy(i),sy(i),by(i)),c=o?u(My(i).y(),uy(i),ly(i),by(i)):My(i).y(),dx(r,mx(a,c)),P.some(a)).map(function(){return!0});var n,o,r,i,u,a,c}},gx=hx(-1,!1),vx=hx(1,!1),px=hx(-1,!0),bx=hx(1,!0),yx={"top-left":P.some(function(t,e){Ty(t,Vy(ay(e),cy(e)))}),top:P.some(function(t,e){Ty(t,Vy(vy(e),cy(e)))}),"top-right":P.some(function(t,e){Ty(t,Vy(fy(e),cy(e)))}),right:P.some(function(t,e){Ty(t,Vy(fy(e),py(e)))}),"bottom-right":P.some(function(t,e){Ty(t,Vy(fy(e),dy(e)))}),bottom:P.some(function(t,e){Ty(t,Vy(vy(e),dy(e)))}),"bottom-left":P.some(function(t,e){Ty(t,Vy(ay(e),dy(e)))}),left:P.some(function(t,e){Ty(t,Vy(ay(e),py(e)))})},xx=Object.freeze({setValueFrom:function(t,e,n){var o=Xy(t,e,n.left()),r=ox(t,e,n.top()),i=mx(o,r);return dx(t,i),i},setToMin:function(t,e){var n=iy(e),o=uy(e);dx(t,mx(n,o))},setToMax:function(t,e){var n=sy(e),o=ly(e);dx(t,mx(n,o))},getValueFromEvent:function(t){return Zb(t)},setPositionFromValue:function(t,e,n,o){var r=My(n),i=qy(t,o.getSpectrum(t),r.x(),o.getLeftEdge(t),o.getRightEdge(t),n),u=ix(t,o.getSpectrum(t),r.y(),o.getTopEdge(t),o.getBottomEdge(t),n),a=ea(e.element())/2,c=ra(e.element())/2;Wi(e.element(),"left",i-a+"px"),Wi(e.element(),"top",u-c+"px")},onLeft:gx,onRight:vx,onUp:px,onDown:bx,edgeActions:yx}),wx=pe.detect().deviceType.isTouch(),zx=[dr("stepSize",1),dr("onChange",N),dr("onChoose",N),dr("onInit",N),dr("onDragStart",N),dr("onDragEnd",N),dr("snapToGrid",!1),dr("rounded",!0),ar("snapStart"),tr("model",Go("mode",{x:[dr("minX",0),dr("maxX",100),xr("value",function(t){return Ct(t.mode.minX)}),Zo("getInitialValue"),Mu("manager",tx)],y:[dr("minY",0),dr("maxY",100),xr("value",function(t){return Ct(t.mode.minY)}),Zo("getInitialValue"),Mu("manager",fx)],xy:[dr("minX",0),dr("maxX",100),dr("minY",0),dr("maxY",100),xr("value",function(t){return Ct({x:U(t.mode.minX),y:U(t.mode.minY)})}),Zo("getInitialValue"),Mu("manager",xx)]})),Vs("sliderBehaviours",[jd,um])].concat(wx?[]:[xr("mouseIsDown",function(){return Ct(!1)})]),Sx=pe.detect().deviceType.isTouch(),kx=Bl({name:"Slider",configFields:zx,partFields:Jb,factory:function(i,t,e,n){var u=function(t){return yl(t,i,"thumb")},a=function(t){return yl(t,i,"spectrum")},o=function(t){return bl(t,i,"left-edge")},r=function(t){return bl(t,i,"right-edge")},c=function(t){return bl(t,i,"top-edge")},s=function(t){return bl(t,i,"bottom-edge")},l=i.model,f=l.manager,d=function(t,e){f.setPositionFromValue(t,e,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})},m=function(t,e){l.value.set(e);var n=u(t);return d(t,n),i.onChange(t,n,e),P.some(!0)},h=[Wr(Ht(),function(t,e){i.onDragStart(t,u(t))}),Wr(Vt(),function(t,e){i.onDragEnd(t,u(t))})],g=[Wr(Tt(),function(t,e){e.stop(),i.onDragStart(t,u(t)),i.mouseIsDown.set(!0)}),Wr(Dt(),function(t,e){i.onDragEnd(t,u(t))})],v=Sx?h:g;return{uid:i.uid,dom:i.dom,components:t,behaviours:As(i.sliderBehaviours,R([Sx?[]:[jd.config({mode:"special",focusIn:function(t){return bl(t,i,"spectrum").map(jd.focusIn).map(U(!0))}})],[um.config({store:{mode:"manual",getValue:function(t){return l.value.get()}}}),Uu.config({channels:{"mouse.released":{onReceive:function(n,t){var e=i.mouseIsDown.get();i.mouseIsDown.set(!1),e&&bl(n,i,"thumb").each(function(t){var e=l.value.get();i.onChoose(n,t,e)})}}}})]])),events:Pr([Wr(Qb(),function(t,e){m(t,e.event().value())}),Qr(function(t,e){var n=l.getInitialValue();l.value.set(n);var o=u(t);d(t,o);var r=a(t);i.onInit(t,o,r,l.value.get())})].concat(v)),apis:{resetToMin:function(t){f.setToMin(t,i)},resetToMax:function(t){f.setToMax(t,i)},changeValue:m,refresh:d},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),Cx=U(Un("rgb-hex-update")),Ox=U(Un("slider-update")),Mx=U(Un("palette-update")),Hx=function(t,o){var r=kx.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=kx.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"<div class="+o("sv-palette-inner-thumb")+' role="presentation"></div>'}}),u=function(t,e){var n=t.width,o=t.height,r=t.getContext("2d");r.fillStyle=e,r.fillRect(0,0,n,o);var i=r.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,n,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,n,o)};return Al({factory:function(t){var e=U({x:U(0),y:U(0)}),n=_u([Ll.config({find:P.some}),fm.config({})]);return kx.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:e},rounded:!1,components:[r,i],onChange:function(t,e,n){Cr(t,Mx(),{value:n})},onInit:function(t,e,n,o){u(n.element().dom(),lb(fb()))},sliderBehaviours:n})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,e,n){var o,r;o=n,r=e.components()[0].element().dom(),u(r,lb(o))}},extraApis:{}})},Ex=function(t,e){var n=kx.parts().spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=kx.parts().thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return kx.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:U({y:U(0)})},components:[n,o],sliderBehaviours:_u([fm.config({})]),onChange:function(t,e,n){Cr(t,Ox(),{value:n})}})},Vx=[Vs("formBehaviours",[um])],Tx=function(t){return"<alloy.field."+t+">"},Ax=function(o,t,e){return{uid:o.uid,dom:o.dom,components:t,behaviours:As(o.formBehaviours,[um.config({store:{mode:"manual",getValue:function(t){var e=wl(t,o);return et(e,function(t,e){return t().bind(function(t){var e,n=Ll.getCurrent(t);return e="missing current",n.fold(function(){return ft.error(e)},ft.value)}).map(um.getValue)})},setValue:function(n,t){tt(t,function(e,t){bl(n,o,t).each(function(t){Ll.getCurrent(t).each(function(t){um.setValue(t,e)})})})}}})]),apis:{getField:function(t,e){return bl(t,o,e).bind(Ll.getCurrent)}}}},Bx={getField:bi(function(t,e,n){return t.getField(e,n)}),sketch:function(t){var n,e=(n=[],{field:function(t,e){return n.push(t),ml("form",Tx(t),e)},record:function(){return n}}),o=t(e),r=e.record(),i=V(r,function(t){return rl({name:t,pname:Tx(t)})});return Hl("form",Vx,i,Ax,o)}},Dx=Un("valid-input"),_x=Un("invalid-input"),Fx=Un("validating-input"),Lx="colorcustom.rgb.",Ix=function(m,h,g,v){var p=function(t,e,n,o,r){var i,u,a=m(Lx+"range"),c=[Iv.parts().label({dom:{tag:"label",innerHtml:n,attributes:{"aria-label":o}}}),Iv.parts().field({data:r,factory:Ep,inputAttributes:Gn({type:"text"},"hex"===e?{"aria-live":"polite"}:{}),inputClasses:[h("textfield")],inputBehaviours:_u([(i=e,u=t,Up.config({invalidClass:h("invalid"),notify:{onValidate:function(t){Cr(t,Fx,{type:i})},onValid:function(t){Cr(t,Dx,{type:i,value:um.getValue(t)})},onInvalid:function(t){Cr(t,_x,{type:i,value:um.getValue(t)})}},validator:{validate:function(t){var e=um.getValue(t),n=u(e)?ft.value(!0):ft.error(m("aria.input.invalid"));return Jv.pure(n)},validateOnLoad:!1}})),Xp.config({})]),onSetValue:function(t){Up.isInvalid(t)&&Up.run(t).get(N)}})],s="hex"!==e?[Iv.parts()["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}},b=function(t,e){var n=e.red(),o=e.green(),r=e.blue();um.setValue(t,{red:n,green:o,blue:r})},y=Km({dom:{tag:"div",classes:[h("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),x=function(t,e){y.getOpt(t).each(function(t){Wi(t.element(),"background-color","#"+e.value())})};return Al({factory:function(t){var n={red:U(Ct(P.some(255))),green:U(Ct(P.some(255))),blue:U(Ct(P.some(255))),hex:U(Ct(P.some("ffffff")))},o=function(t){return n[t]().get()},i=function(t,e){n[t]().set(e)},r=function(t){var e=t.red(),n=t.green(),o=t.blue();i("red",P.some(e)),i("green",P.some(n)),i("blue",P.some(o))},e=function(t,e){var n=e.event();"hex"!==n.type()?i(n.type(),P.none()):v(t)},u=function(r,t,e){var n=parseInt(e,10);i(t,P.some(n)),o("red").bind(function(n){return o("green").bind(function(e){return o("blue").map(function(t){return ib(n,e,t,1)})})}).each(function(t){var e,n,o=(e=r,n=Zp(t),Bx.getField(e,"hex").each(function(t){fm.isFocused(t)||um.setValue(e,{hex:n.value()})}),n);x(r,o)})},a=function(t,e){var n=e.event();"hex"===n.type()?function(t,e){g(t);var n=Yp(e);i("hex",P.some(e));var o=cb(n);b(t,o),r(o),Cr(t,Cx(),{hex:n}),x(t,n)}(t,n.value()):u(t,n.type(),n.value())},c=function(t){return{label:m(Lx+t+".label"),description:m(Lx+t+".description")}},s=c("red"),l=c("green"),f=c("blue"),d=c("hex");return gt(Bx.sketch(function(t){return{dom:{tag:"form",classes:[h("rgb-form")],attributes:{"aria-label":m("aria.color.picker")}},components:[t.field("red",Iv.sketch(p(ub,"red",s.label,s.description,255))),t.field("green",Iv.sketch(p(ub,"green",l.label,l.description,255))),t.field("blue",Iv.sketch(p(ub,"blue",f.label,f.description,255))),t.field("hex",Iv.sketch(p(Jp,"hex",d.label,d.description,"ffffff"))),y.asSpec()],formBehaviours:_u([Up.config({invalidClass:h("form-invalid")}),Tm("rgb-form-events",[Wr(Dx,a),Wr(_x,e),Wr(Fx,e)])])}}),{apis:{updateHex:function(t,e){var n,o;um.setValue(t,{hex:e.value()}),n=t,o=cb(e),b(n,o),r(o),x(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},Rx=function(t,e,n){return{hue:U(t),saturation:U(e),value:U(n)}},Nx=function(c,s){return Al({name:"ColourPicker",configFields:[dr("onValidHex",N),dr("onInvalidHex",N),sr("formChangeEvent")],factory:function(t){var a,p,n=Ix(c,s,t.onValidHex,t.onInvalidHex),o=Hx(c,s),b={paletteRgba:U(Ct(fb()))},e=Km(o.sketch({})),r=Km(n.sketch({})),i=function(t,n){e.getOpt(t).each(function(t){var e=cb(n);b.paletteRgba().set(e),o.setRgba(t,e)})},u=function(t,e){r.getOpt(t).each(function(t){n.updateHex(t,e)})},y=function(e,n,t){T(t,function(t){t(e,n)})};return{uid:t.uid,dom:t.dom,components:[e.asSpec(),Ex(c,s),r.asSpec()],behaviours:_u([Tm("colour-picker-events",[Wr(Mx(),(p=[u],function(t,e){var n,o,r,i,u,a,c,s,l,f=e.event().value(),d=b.paletteRgba().get(),m=(c=u=0,o=(n=d).red()/255,r=n.green()/255,i=n.blue()/255,(s=Math.min(o,Math.min(r,i)))===(l=Math.max(o,Math.max(r,i)))?Rx(0,0,100*(c=s)):(u=60*((u=o===s?3:i===s?1:5)-(o===s?r-i:i===s?o-r:i-o)/(l-s)),a=(l-s)/l,c=l,Rx(Math.round(u),Math.round(100*a),Math.round(100*c)))),h=Rx(m.hue(),f.x(),100-f.y()),g=ab(h),v=Zp(g);y(t,v,p)})),Wr(Ox(),(a=[i,u],function(t,e){var n,o,r,i=e.event().value(),u=(n=i.y(),o=Rx(360*(100-n/100),100,100),r=ab(o),Zp(r));y(t,u,a)}))]),Ll.config({find:function(t){return r.getOpt(t)}}),jd.config({mode:"acyclic"})])}}})},Px=function(){return Ll.config({find:P.some})},jx=function(t){return Ll.config({find:t.getOpt})},Ux=function(t){return Ll.config({find:function(e){return sn(e.element(),t).bind(function(t){return e.getSystem().getByDom(t).toOption()})}})},Wx={"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"},Gx=function(t){return Wx[t]},Xx=Eo([dr("preprocess",d),dr("postprocess",d)]),Yx=function(t,e,n){return um.config(gt({store:{mode:"manual",getValue:e,setValue:n}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},qx=function(t,e,n){return Yx(t,function(t){return e(t.element())},function(t,e){return n(t.element(),e)})},Kx=function(r,t){var i=Uo("RepresentingConfigs.memento processors",Xx,t);return um.config({store:{mode:"manual",getValue:function(t){var e=r.get(t),n=um.getValue(e);return i.postprocess(n)},setValue:function(t,e){var n=i.preprocess(e),o=r.get(t);um.setValue(o,n)}}})},Jx=Yx,$x=function(t){return qx(t,pn,bn)},Qx=function(t){return um.config({store:{mode:"memory",initialValue:t}})},Zx=function(r,e){var n=function(t,e){e.stop()},o=function(t){return function(e,n){T(t,function(t){t(e,n)})}},i=function(t,e){if(!og.isDisabled(t)){var n=e.event().raw();a(t,n.dataTransfer.files)}},u=function(t,e){var n=e.event().raw().target.files;a(t,n)},a=function(t,e){var n,o;um.setValue(t,(n=e,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),A($(n),function(t){return o.test(t.name)}))),Cr(t,Mv,{name:r.name})},c=Km({dom:{tag:"input",attributes:{type:"file",multiple:"multiple"},styles:{display:"none"}},behaviours:_u([Tm("input-file-events",[Kr(jt())])])}),t=r.label.map(function(t){return zp(t,e)}),s=Iv.parts().field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:_u([Qx([]),Px(),og.config({}),km.config({toggleClass:"dragenter",toggleOnExecute:!1}),Tm("dropzone-events",[Wr("dragenter",o([n,km.toggle])),Wr("dragleave",o([n,km.toggle])),Wr("dragover",n),Wr("drop",o([n,i])),Wr(Pt(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},qm.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element().dom().click()},buttonBehaviours:_u([Xp.config({})])})]}]}}}});return bp(t,s,["tox-form__group--stretched"])},tw=Un("alloy-fake-before-tabstop"),ew=Un("alloy-fake-after-tabstop"),nw=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:_u([fm.config({ignore:!0}),Xp.config({})])}},ow=function(t,e){Cr(t,It(),{raw:{which:9,shiftKey:e}})},rw=function(t){return ev(t,["."+tw,"."+ew].join(","),U(!1))},iw=function(t,e){var n=e.element();Ii(n,tw)?ow(t,!0):Ii(n,ew)&&ow(t,!1)},uw=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[nw([tw]),t,nw([ew])],behaviours:_u([Ux(1)])}},aw=!(pe.detect().browser.isIE()||pe.detect().browser.isEdge()),cw=function(t,e){var o,r,n=aw&&t.sandboxed,i=Gn({},t.label.map(function(t){return{title:t}}).getOr({}),n?{sandbox:"allow-scripts"}:{}),u=(o=n,r=Ct(""),{getValue:function(t){return r.get()},setValue:function(t,e){if(o)Cn(t.element(),"src","data:text/html;charset=utf-8,"+encodeURIComponent(e));else{Cn(t.element(),"src","javascript:''");var n=t.element().dom().contentWindow.document;n.open(),n.write(e),n.close()}r.set(e)}}),a=t.label.map(function(t){return zp(t,e)}),c=Iv.parts().field({factory:{sketch:function(t){return uw({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:_u([Xp.config({}),fm.config({}),Jx(P.none(),u.getValue,u.setValue)])})}}});return bp(a,c,["tox-form__group--stretched"])};function sw(t,e){return fw(document.createElement("canvas"),t,e)}function lw(t){return t.getContext("2d")}function fw(t,e,n){return t.width=e,t.height=n,t}var dw={create:sw,clone:function lE(t){var e;return lw(e=sw(t.width,t.height)).drawImage(t,0,0),e},resize:fw,get2dContext:lw,get3dContext:function fE(t){var e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(n){}return e||(e=null),e}},mw={getWidth:function dE(t){return t.naturalWidth||t.width},getHeight:function mE(t){return t.naturalHeight||t.height}},hw=window.Promise?window.Promise:function(){var t=function(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=null,this._value=null,this._deferreds=[],s(t,o(r,this),o(u,this))},e=t.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){setTimeout(t,1)};function o(t,e){return function(){t.apply(e,arguments)}}var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(o){var r=this;null!==this._state?e(function(){var t=r._state?o.onFulfilled:o.onRejected;if(null!==t){var e;try{e=t(r._value)}catch(n){return void o.reject(n)}o.resolve(e)}else(r._state?o.resolve:o.reject)(r._value)}):this._deferreds.push(o)}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void s(o(e,t),o(r,this),o(u,this))}this._state=!0,this._value=t,a.call(this)}catch(n){u.call(this,n)}}function u(t){this._state=!1,this._value=t,a.call(this)}function a(){for(var t=0,e=this._deferreds.length;t<e;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=o}function s(t,e,n){var o=!1;try{t(function(t){o||(o=!0,e(t))},function(t){o||(o=!0,n(t))})}catch(r){if(o)return;o=!0,n(r)}}return t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype.then=function(n,o){var r=this;return new t(function(t,e){i.call(r,new c(n,o,t,e))})},t.all=function(){var c=Array.prototype.slice.call(1===arguments.length&&n(arguments[0])?arguments[0]:arguments);return new t(function(r,i){if(0===c.length)return r([]);var u=c.length;function a(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){a(e,t)},i)}c[e]=t,0==--u&&r(c)}catch(o){i(o)}}for(var t=0;t<c.length;t++)a(t,c[t])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(t){t(e)})},t.reject=function(n){return new t(function(t,e){e(n)})},t.race=function(r){return new t(function(t,e){for(var n=0,o=r.length;n<o;n++)r[n].then(t,e)})},t}();function gw(){return new(Ye.getOrDie("FileReader"))}var vw={atob:function(t){return Ye.getOrDie("atob")(t)},requestAnimationFrame:function(t){Ye.getOrDie("requestAnimationFrame")(t)}};function pw(a){return new hw(function(t,e){var n=URL.createObjectURL(a),o=new Image,r=function(){o.removeEventListener("load",i),o.removeEventListener("error",u)};function i(){r(),t(o)}function u(){r(),e("Unable to load data of type "+a.type+": "+n)}o.addEventListener("load",i),o.addEventListener("error",u),o.src=n,o.complete&&i()})}function bw(o){return new hw(function(t,n){var e=new XMLHttpRequest;e.open("GET",o,!0),e.responseType="blob",e.onload=function(){200==this.status&&t(this.response)},e.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"))},e.send()})}function yw(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return P.none();for(var o,r=n[1],i=e[1],u=vw.atob(i),a=u.length,c=Math.ceil(a/1024),s=new Array(c),l=0;l<c;++l){for(var f=1024*l,d=Math.min(f+1024,a),m=new Array(d-f),h=f,g=0;h<d;++g,++h)m[g]=u[h].charCodeAt(0);s[l]=(o=m,new(Ye.getOrDie("Uint8Array"))(o))}return P.some(function v(t,e){return new(Ye.getOrDie("Blob"))(t,e)}(s,{type:r}))}function xw(n){return new hw(function(t,e){yw(n).fold(function(){e("uri is not base64: "+n)},t)})}function ww(n){return new hw(function(t){var e=gw();e.onloadend=function(){t(e.result)},e.readAsDataURL(n)})}var zw={blobToImage:pw,imageToBlob:function hE(t){var e=t.src;return 0===e.indexOf("data:")?xw(e):bw(e)},blobToArrayBuffer:function gE(n){return new hw(function(t){var e=gw();e.onloadend=function(){t(e.result)},e.readAsArrayBuffer(n)})},blobToDataUri:ww,blobToBase64:function vE(t){return ww(t).then(function(t){return t.split(",")[1]})},dataUriToBlobSync:yw,canvasToBlob:function pE(t,n,o){return n=n||"image/png",HTMLCanvasElement.prototype.toBlob?new hw(function(e){t.toBlob(function(t){e(t)},n,o)}):xw(t.toDataURL(n,o))},canvasToDataURL:function bE(t,e,n){return e=e||"image/png",t.then(function(t){return t.toDataURL(e,n)})},blobToCanvas:function yE(t){return pw(t).then(function(t){var e;return function n(t){URL.revokeObjectURL(t.src)}(t),e=dw.create(mw.getWidth(t),mw.getHeight(t)),dw.get2dContext(e).drawImage(t,0,0),e})},uriToBlob:function xE(t){return 0===t.indexOf("blob:")?bw(t):0===t.indexOf("data:")?xw(t):null}};function Sw(t,e,n){var o=e.type;function r(e,n){return t.then(function(t){return zw.canvasToDataURL(t,e,n)})}return{getType:U(o),toBlob:function i(){return hw.resolve(e)},toDataURL:function u(){return n},toBase64:function a(){return n.split(",")[1]},toAdjustedBlob:function c(e,n){return t.then(function(t){return zw.canvasToBlob(t,e,n)})},toAdjustedDataURL:r,toAdjustedBase64:function s(t,e){return r(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function l(){return t.then(dw.clone)}}}function kw(e){return zw.blobToDataUri(e).then(function(t){return Sw(zw.blobToCanvas(e),e,t)})}var Cw={fromBlob:kw,fromCanvas:function wE(e,t){return zw.canvasToBlob(e,t).then(function(t){return Sw(hw.resolve(e),t,e.toDataURL())})},fromImage:function zE(t){return zw.imageToBlob(t).then(function(t){return kw(t)})},fromBlobAndUrlSync:function(t,e){return Sw(zw.blobToCanvas(t),t,e)}},Ow=function(t){return Cw.fromBlob(t)};function Mw(t,e,n){return n<(t=parseFloat(t))?t=n:t<e&&(t=e),t}var Hw=[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];function Ew(t,e){var n,o,r,i,u=[],a=new Array(10);for(n=0;n<5;n++){for(o=0;o<5;o++)u[o]=e[o+5*n];for(o=0;o<5;o++){for(r=i=0;r<5;r++)i+=t[o+5*r]*u[r];a[o+5*n]=i}}return a}function Vw(t,n){return n=Mw(n,0,1),t.map(function(t,e){return e%6==0?t=1-(1-t)*n:t*=n,Mw(t,0,1)})}var Tw={identity:function SE(){return[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]},adjust:Vw,multiply:Ew,adjustContrast:function kE(t,e){var n;return e=Mw(e,-1,1),Ew(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0==(n=e%1)?Hw[e]:Hw[Math.floor(e)]*(1-n)+Hw[Math.floor(e)+1]*n)+127)/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])},adjustBrightness:function CE(t,e){return Ew(t,[1,0,0,0,e=Mw(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])},adjustSaturation:function OE(t,e){var n;return Ew(t,[.3086*(1-(n=1+(0<(e=Mw(e,-1,1))?3*e:e)))+n,.6094*(1-n),.082*(1-n),0,0,.3086*(1-n),.6094*(1-n)+n,.082*(1-n),0,0,.3086*(1-n),.6094*(1-n),.082*(1-n)+n,0,0,0,0,0,1,0,0,0,0,0,1])},adjustHue:function ME(t,e){var n,o;return e=Mw(e,-180,180)/180*Math.PI,Ew(t,[.213+.787*(n=Math.cos(e))+-.213*(o=Math.sin(e)),.715+-.715*n+-.715*o,.072+-.072*n+.928*o,0,0,.213+-.213*n+.143*o,.715+n*(1-.715)+.14*o,.072+-.072*n+-.283*o,0,0,.213+-.213*n+-.787*o,.715+-.715*n+.715*o,.072+.928*n+.072*o,0,0,0,0,0,1,0,0,0,0,0,1])},adjustColors:function HE(t,e,n,o){return Ew(t,[e=Mw(e,0,2),0,0,0,0,0,n=Mw(n,0,2),0,0,0,0,0,o=Mw(o,0,2),0,0,0,0,0,1,0,0,0,0,0,1])},adjustSepia:function EE(t,e){return Ew(t,Vw([.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0,0,0,0,0,1],e=Mw(e,0,1)))},adjustGrayscale:function VE(t,e){return Ew(t,Vw([.33,.34,.33,0,0,.33,.34,.33,0,0,.33,.34,.33,0,0,0,0,0,1,0,0,0,0,0,1],e=Mw(e,0,1)))}};function Aw(e,n){return e.toCanvas().then(function(t){return function i(t,e,n){var o,r=dw.get2dContext(t);return o=function H(t,e){var n,o,r,i,u,a=t.data,c=e[0],s=e[1],l=e[2],f=e[3],d=e[4],m=e[5],h=e[6],g=e[7],v=e[8],p=e[9],b=e[10],y=e[11],x=e[12],w=e[13],z=e[14],S=e[15],k=e[16],C=e[17],O=e[18],M=e[19];for(u=0;u<a.length;u+=4)n=a[u],o=a[u+1],r=a[u+2],i=a[u+3],a[u]=n*c+o*s+r*l+i*f+d,a[u+1]=n*m+o*h+r*g+i*v+p,a[u+2]=n*b+o*y+r*x+i*w+z,a[u+3]=n*S+o*k+r*C+i*O+M;return t}(r.getImageData(0,0,t.width,t.height),n),r.putImageData(o,0,0),Cw.fromCanvas(t,e)}(t,e.getType(),n)})}function Bw(e,n){return e.toCanvas().then(function(t){return function u(t,e,n){var o,r,i=dw.get2dContext(t);return o=i.getImageData(0,0,t.width,t.height),r=i.getImageData(0,0,t.width,t.height),r=function w(t,e,n){var o,r,i,u,a,c,s,l,f,d,m,h,g,v,p,b,y;function x(t,e,n){return n<t?t=n:t<e&&(t=e),t}for(i=Math.round(Math.sqrt(n.length)),u=Math.floor(i/2),o=t.data,r=e.data,b=t.width,y=t.height,c=0;c<y;c++)for(a=0;a<b;a++){for(s=l=f=0,m=0;m<i;m++)for(d=0;d<i;d++)h=x(a+d-u,0,b-1),g=x(c+m-u,0,y-1),v=4*(g*b+h),p=n[m*i+d],s+=o[v]*p,l+=o[v+1]*p,f+=o[v+2]*p;r[v=4*(c*b+a)]=x(s,0,255),r[v+1]=x(l,0,255),r[v+2]=x(f,0,255)}return e}(o,r,n),i.putImageData(r,0,0),Cw.fromCanvas(t,e)}(t,e.getType(),n)})}function Dw(c){return function(e,n){return e.toCanvas().then(function(t){return function(t,e,n){var o,r,i=dw.get2dContext(t),u=new Array(256);for(r=0;r<u.length;r++)u[r]=c(r,n);return o=function a(t,e){var n,o=t.data;for(n=0;n<o.length;n+=4)o[n]=e[o[n]],o[n+1]=e[o[n+1]],o[n+2]=e[o[n+2]];return t}(i.getImageData(0,0,t.width,t.height),u),i.putImageData(o,0,0),Cw.fromCanvas(t,e)}(t,e.getType(),n)})}}function _w(n){return function(t,e){return Aw(t,n(Tw.identity(),e))}}function Fw(e){return function(t){return Bw(t,e)}}var Lw={invert:function TE(e){return function(t){return Aw(t,e)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0]),brightness:_w(Tw.adjustBrightness),hue:_w(Tw.adjustHue),saturate:_w(Tw.adjustSaturation),contrast:_w(Tw.adjustContrast),grayscale:_w(Tw.adjustGrayscale),sepia:_w(Tw.adjustSepia),colorize:function(t,e,n,o){return Aw(t,Tw.adjustColors(Tw.identity(),e,n,o))},sharpen:Fw([0,-1,0,-1,5,-1,0,-1,0]),emboss:Fw([-2,-1,0,-1,1,1,0,1,2]),gamma:Dw(function(t,e){return 255*Math.pow(t/255,1-e)}),exposure:Dw(function(t,e){return 255*(1-Math.exp(-t/255*e))}),colorFilter:Aw,convoluteFilter:Bw},Iw={scale:function AE(t,e,n){var o=mw.getWidth(t),r=mw.getHeight(t),i=e/o,u=n/r,a=!1;(i<.5||2<i)&&(i=i<.5?.5:2,a=!0),(u<.5||2<u)&&(u=u<.5?.5:2,a=!0);var c=function l(a,c,s){return new hw(function(t){var e=mw.getWidth(a),n=mw.getHeight(a),o=Math.floor(e*c),r=Math.floor(n*s),i=dw.create(o,r),u=dw.get2dContext(i);u.drawImage(a,0,0,e,n,0,0,o,r),t(i)})}(t,i,u);return a?c.then(function(t){return AE(t,e,n)}):c}},Rw={rotate:function BE(e,n){return e.toCanvas().then(function(t){return function a(t,e,n){var o=dw.create(t.width,t.height),r=dw.get2dContext(o),i=0,u=0;return 90!=(n=n<0?360+n:n)&&270!=n||dw.resize(o,o.height,o.width),90!=n&&180!=n||(i=o.width),270!=n&&180!=n||(u=o.height),r.translate(i,u),r.rotate(n*Math.PI/180),r.drawImage(t,0,0),Cw.fromCanvas(o,e)}(t,e.getType(),n)})},flip:function DE(e,n){return e.toCanvas().then(function(t){return function i(t,e,n){var o=dw.create(t.width,t.height),r=dw.get2dContext(o);return"v"==n?(r.scale(1,-1),r.drawImage(t,0,-o.height)):(r.scale(-1,1),r.drawImage(t,-o.width,0)),Cw.fromCanvas(o,e)}(t,e.getType(),n)})},crop:function _E(e,n,o,r,i){return e.toCanvas().then(function(t){return function a(t,e,n,o,r,i){var u=dw.create(r,i);return dw.get2dContext(u).drawImage(t,-n,-o),Cw.fromCanvas(u,e)}(t,e.getType(),n,o,r,i)})},resize:function FE(e,n,o){return e.toCanvas().then(function(t){return Iw.scale(t,n,o).then(function(t){return Cw.fromCanvas(t,e.getType())})})}},Nw=(function(){function t(t){this.littleEndian=!1,this._dv=new DataView(t)}t.prototype.readByteAt=function(t){return this._dv.getUint8(t)},t.prototype.read=function(t,e){if(t+e>this.length())return null;for(var n=this.littleEndian?0:-8*(e-1),o=0,r=0;o<e;o++)r|=this.readByteAt(t+o)<<Math.abs(n+8*o);return r},t.prototype.BYTE=function(t){return this.read(t,1)},t.prototype.SHORT=function(t){return this.read(t,2)},t.prototype.LONG=function(t){return this.read(t,4)},t.prototype.SLONG=function(t){var e=this.read(t,4);return 2147483647<e?e-4294967296:e},t.prototype.CHAR=function(t){return String.fromCharCode(this.read(t,1))},t.prototype.STRING=function(t,e){return this.asArray("CHAR",t,e).join("")},t.prototype.SEGMENT=function(t,e){var n=this._dv.buffer;switch(arguments.length){case 2:return n.slice(t,t+e);case 1:return n.slice(t);default:return n}},t.prototype.asArray=function(t,e,n){for(var o=[],r=0;r<n;r++)o[r]=this[t](e+r);return o},t.prototype.length=function(){return this._dv?this._dv.byteLength:0}}(),function(t,e){return Rw.rotate(t,e)}),Pw=function(t){return Lw.invert(t)},jw=function(t){return Lw.sharpen(t)},Uw=function(t,e){return Lw.brightness(t,e)},Ww=function(t,e){return Lw.contrast(t,e)},Gw=function(t,e,n,o){return Lw.colorize(t,e,n,o)},Xw=function(t,e){return Lw.gamma(t,e)},Yw=function(t,e){return Rw.flip(t,e)},qw=function(t,e,n,o,r){return Rw.crop(t,e,n,o,r)},Kw=function(t,e,n){return Rw.resize(t,e,n)},Jw=Nw,$w=function(t,e){return{dom:{tag:"span",innerHtml:Qm(t,e),classes:["tox-icon","tox-tbtn__icon-wrap"]}}},Qw=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:_u([Yd.config({})])}},Zw=function(t,e,n,o,r){void 0===n&&(n=[]);var i={buttonBehaviours:_u([ig(t.disabled),Xp.config({}),Tm("button press",[Ur("click"),Ur("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},action:e},u=gt(i,{dom:o}),a=gt(u,{components:r});return qm.sketch(a)},tz=function(t,e,n,o){void 0===o&&(o=[]);var r={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 $w(t,n.icons)}),u=hg([i]);return Zw(t,e,o,r,u)},ez=function(t,e,n,o){void 0===o&&(o=[]);var r=n.translate(t.text),i=t.icon?t.icon.map(function(t){return $w(t,n.icons)}):P.none(),u=i.isSome()?hg([i]):[],a=i.isSome()?{}:{innerHtml:r},c=(t.primary?["tox-button"]:["tox-button","tox-button--secondary"]).concat(i.isSome()?["tox-button--icon"]:[]),s=Gn({tag:"button",classes:c},a,{attributes:{title:r}});return Zw(t,e,o,s,u)},nz=function(e,n){return function(t){"custom"===n?Cr(t,Vv,{name:e,value:{}}):"submit"===n?kr(t,Tv):"cancel"===n?kr(t,Ev):console.error("Unknown button type: ",n)}},oz=function(t,e,n){var o=nz(t.name,e);return ez(t,o,n,[])},rz=U([dr("field1Name","field1"),dr("field2Name","field2"),Cu("onLockedChange"),wu(["lockClass"]),dr("locked",!1),Bs("coupledFieldBehaviours",[Ll,um])]),iz=function(t,i){return rl({factory:Iv,name:t,overrides:function(r){return{fieldBehaviours:_u([Tm("coupled-input-behaviour",[Wr(Nt(),function(n){var t,e,o;(t=n,e=r,o=i,bl(t,e,o).bind(Ll.getCurrent)).each(function(e){bl(n,r,"lock").each(function(t){km.isOn(t)&&r.onLockedChange(n,e,t)})})})])])}}})},uz=U([iz("field1","field2"),iz("field2","field1"),rl({factory:qm,schema:[Zo("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:_u([km.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),az=Bl({name:"FormCoupledInputs",configFields:rz(),partFields:uz(),factory:function(o,t,e,n){return{uid:o.uid,dom:o.dom,components:t,behaviours:Ds(o.coupledFieldBehaviours,[Ll.config({find:P.some}),um.config({store:{mode:"manual",getValue:function(t){var e,n=Sl(t,o,["field1","field2"]);return(e={})[o.field1Name]=um.getValue(n.field1()),e[o.field2Name]=um.getValue(n.field2()),e},setValue:function(t,e){var n=Sl(t,o,["field1","field2"]);kt(e,o.field1Name)&&um.setValue(n.field1(),e[o.field1Name]),kt(e,o.field2Name)&&um.setValue(n.field2(),e[o.field2Name])}}})]),apis:{getField1:function(t){return bl(t,o,"field1")},getField2:function(t){return bl(t,o,"field2")},getLock:function(t){return bl(t,o,"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)}}}),cz=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)return ft.error(t);var n=parseFloat(e[1]),o=e[2];return ft.value({value:n,unit:o})},sz=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,"in":1},o=function(t){return Object.prototype.hasOwnProperty.call(n,t)};return t.unit===e?P.some(t.value):o(t.unit)&&o(e)?n[t.unit]===n[e]?P.some(t.value):P.some(t.value/n[t.unit]*n[e]):P.none()},lz=function(t){return P.none()},fz=function(t,e){return function(t,e){for(var n=[],o=0;o<t.length;o++){var r=t[o];if(!r.isSome())return P.none();n.push(r.getOrDie())}return P.some(e.apply(null,n))}([cz(t).toOption(),cz(e).toOption()],function(t,o){return sz(t,o.unit).map(function(t){return o.value/t}).map(function(t){return e=t,n=o.unit,function(t){return sz(t,n).map(function(t){return{value:t*e,unit:n}})};var e,n}).getOr(lz)}).getOr(lz)},dz=function(o,e){var a=lz,r=Un("ratio-event"),t=az.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(o.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:Qm("lock",e.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:Qm("unlock",e.icons)}}],buttonBehaviours:_u([Xp.config({})])}),n=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},i=function(n){return Iv.parts().field({factory:Ep,inputClasses:["tox-textfield"],inputBehaviours:_u([Xp.config({}),Tm("size-input-events",[Wr(Ft(),function(t,e){Cr(t,r,{isField1:n})}),Wr(Pt(),function(t,e){Cr(t,Mv,{name:o.name})})])]),selectOnFocus:!1})},u=function(t){return Iv.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},c=az.parts().field1(n([u("Width"),i(!0)])),s=function(t){return{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:t}},l=az.parts().field2(n([u("Height"),s([i(!1),t])]));return az.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[s([c,l])],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,i,e){cz(um.getValue(t)).each(function(t){a(t).each(function(t){var e,n,o,r;um.setValue(i,(o={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,"in":4,"%":4},-1!==(r=(e=t).value.toFixed((n=e.unit)in o?o[n]:1)).indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+e.unit))})})},coupledFieldBehaviours:_u([Tm("size-input-events2",[Wr(r,function(t,e){var n=e.event().isField1(),o=n?az.getField1(t):az.getField2(t),r=n?az.getField2(t):az.getField1(t),i=o.map(um.getValue).getOr(""),u=r.map(um.getValue).getOr("");a=fz(i,u)})])])})},mz={undo:U(Un("undo")),redo:U(Un("redo")),zoom:U(Un("zoom")),back:U(Un("back")),apply:U(Un("apply")),swap:U(Un("swap")),transform:U(Un("transform")),tempTransform:U(Un("temp-transform")),transformApply:U(Un("transform-apply"))},hz=U("save-state"),gz=U("disable"),vz=U("enable"),pz={formActionEvent:Vv,saveState:hz,disable:gz,enable:vz},bz=function(r,c){var t=function(t,e,n,o){return ez({name:t,text:t,disabled:n,primary:o},e,c)},e=function(t,e,n,o){return tz({name:t,icon:P.some(t),tooltip:P.some(e),disabled:o},n,c)},l={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},n=P.none(),o=N,i=function(t,e,n){Cr(t,e,n)},f=function(t,e){i(t,mz.transform(),{transform:e})},u=function(t,e){i(t,mz.tempTransform(),{transform:e})},a=function(t){return function(){R.getOpt(t).each(function(t){Yd.set(t,[L])})}},s=function(t,e){i(t,mz.transformApply(),{transform:e,swap:a(t)})},d=function(){return t("Back",function(t){return i(t,mz.back(),{swap:a(t)})},!1,!1)},m=function(){return t("Apply",function(t){return i(t,mz.apply(),{swap:a(t)})},!0,!0)},h=xv.sketch({dom:l,components:[d(),{dom:{tag:"div",classes:["tox-spacer"]}},t("Apply",function(t){s(t,function(t){var e=r.getRect();return qw(t,e.x,e.y,e.w,e.h)}),r.hideCrop()},!1,!0)]}),g=Km(dz({name:"size",label:n,type:"sizeinput",constrain:!0},c)),v=xv.sketch({dom:l,components:[d(),{dom:{tag:"div",classes:["tox-spacer"]}},g.asSpec(),{dom:{tag:"div",classes:["tox-spacer"]}},t("Apply",function(a){g.getOpt(a).each(function(t){var e,n,o=um.getValue(t),r=parseInt(o.width,10),i=parseInt(o.height,10),u=(e=r,n=i,function(t){return Kw(t,e,n)});s(a,u)})},!1,!0)]}),p=function(e,n){return function(t){return e(t,n)}},b=p(Yw,"h"),y=p(Yw,"v"),x=p(Jw,-90),w=p(Jw,90),z=xv.sketch({dom:l,components:[d(),{dom:{tag:"div",classes:["tox-spacer"]}},e("flip-horizontally","Flip horizontally",function(t){u(t,b)},!1),e("flip-vertically","Flip vertically",function(t){u(t,y)},!1),e("rotate-left","Rotate counterclockwise",function(t){u(t,x)},!1),e("rotate-right","Rotate clockwise",function(t){u(t,w)},!1),{dom:{tag:"div",classes:["tox-spacer"]}},m()]}),S=function(t,e,n,o,r){var i=kx.parts().label({dom:{tag:"label",innerHtml:c.translate(t)}}),u=kx.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),a=kx.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return kx.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:n,maxX:r,getInitialValue:U({x:U(o)})},components:[i,u,a],sliderBehaviours:_u([fm.config({})]),onChoose:e})},k=function(t,e,n,o,r){return xv.sketch({dom:l,components:[d(),(i=t,u=e,a=n,c=o,s=r,S(i,function(t,e,n){var o=p(u,n.x()/100);f(t,o)},a,c,s)),m()]});var i,u,a,c,s},C=xv.sketch({dom:l,components:[d(),{dom:{tag:"div",classes:["tox-spacer"]}},m()]}),O=k("Brightness",Uw,-100,0,100),M=k("Contrast",Ww,-100,0,100),H=k("Gamma",Xw,-100,0,100),E=function(t){return S(t,function(l,t,e){var n=V.getOpt(l),o=A.getOpt(l),r=T.getOpt(l);n.each(function(s){o.each(function(c){r.each(function(t){var e,n,o,r=um.getValue(s).x()/100,i=um.getValue(t).x()/100,u=um.getValue(c).x()/100,a=(e=r,n=i,o=u,function(t){return Gw(t,e,n,o)});f(l,a)})})})},0,100,200)},V=Km(E("R")),T=Km(E("G")),A=Km(E("B")),B=xv.sketch({dom:l,components:[d(),V.asSpec(),T.asSpec(),A.asSpec(),m()]}),D=function(e,n,o){return function(t){i(t,mz.swap(),{transform:n,swap:function(){R.getOpt(t).each(function(t){Yd.set(t,[e]),o(t)})}})}},_=P.some(jw),F=P.some(Pw),L=xv.sketch({dom:l,components:[e("crop","Crop",D(h,n,function(t){r.showCrop()}),!1),e("resize","Resize",D(v,n,function(t){g.getOpt(t).each(function(t){var e=r.getMeasurements(),n=e.width,o=e.height;um.setValue(t,{width:n,height:o})})}),!1),e("orientation","Orientation",D(z,n,o),!1),e("brightness","Brightness",D(O,n,o),!1),e("sharpen","Sharpen",D(C,_,o),!1),e("contrast","Contrast",D(M,n,o),!1),e("color-levels","Color levels",D(B,n,o),!1),e("gamma","Gamma",D(H,n,o),!1),e("invert","Invert",D(C,F,o),!1)]}),I=xv.sketch({dom:{tag:"div"},components:[L],containerBehaviours:_u([Yd.config({})])}),R=Km(I);return{memContainer:R,getApplyButton:function(t){return R.getOpt(t).map(function(t){var e=t.components()[0];return e.components()[e.components().length-1]})}}},yz=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),xz=tinymce.util.Tools.resolve("tinymce.geom.Rect"),wz=tinymce.util.Tools.resolve("tinymce.util.Observable"),zz=tinymce.util.Tools.resolve("tinymce.util.Tools"),Sz=tinymce.util.Tools.resolve("tinymce.util.VK");function kz(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 Cz(t,r){var i,u,e,a,c,l,f,d=r.document||document;r=r||{};var m=d.getElementById(r.handle||t);e=function(t){var e,n,o=function s(t){var e,n,o,r,i,u,a,c=Math.max;return e=t.documentElement,n=t.body,o=c(e.scrollWidth,n.scrollWidth),r=c(e.clientWidth,n.clientWidth),i=c(e.offsetWidth,n.offsetWidth),u=c(e.scrollHeight,n.scrollHeight),a=c(e.clientHeight,n.clientHeight),{width:o<i?r:o,height:u<c(e.offsetHeight,n.offsetHeight)?a:u}}(d);kz(t),t.preventDefault(),u=t.button,e=m,l=t.screenX,f=t.screenY,n=window.getComputedStyle?window.getComputedStyle(e,null).getPropertyValue("cursor"):e.runtimeStyle.cursor,i=yz("<div></div>").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:n}).appendTo(d.body),yz(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(t)},c=function(t){if(kz(t),t.button!==u)return a(t);t.deltaX=t.screenX-l,t.deltaY=t.screenY-f,t.preventDefault(),r.drag(t)},a=function(t){kz(t),yz(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(t)},this.destroy=function(){yz(m).off()},yz(m).on("mousedown touchstart",e)}var Oz,Mz,Hz,Ez=0,Vz=function(e){var l=Km({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),f=Ct(1),d=Ct(P.none()),m=Ct({x:0,y:0,w:1,h:1}),c=Ct({x:0,y:0,w:1,h:1}),s=function(t,s){h.getOpt(t).each(function(t){var n=f.get(),o=ea(t.element()),r=ra(t.element()),i=s.dom().naturalWidth*n,u=s.dom().naturalHeight*n,a=Math.max(0,o/2-i/2),c=Math.max(0,r/2-u/2),e={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};Gi(s,e),l.getOpt(t).each(function(t){Gi(t.element(),e)}),d.get().each(function(t){var e=m.get();t.setRect({x:e.x*n+a,y:e.y*n+c,w:e.w*n,h:e.h*n}),t.setClampRect({x:a,y:c,w:i,h:u}),t.setViewPortRect({x:0,y:0,w:o,h:r})})})},n=function(t,e){var n,a=Ne.fromTag("img");return Cn(a,"src",e),(n=a.dom(),new lh(function(t){var e=function(){n.removeEventListener("load",e),t(n)};n.complete?t(n):n.addEventListener("load",e)})).then(function(){return h.getOpt(t).map(function(t){var e=au({element:a});Yd.replaceAt(t,1,P.some(e));var n=c.get(),o={x:0,y:0,w:a.dom().naturalWidth,h:a.dom().naturalHeight};c.set(o);var r,u,i=xz.inflate(o,-20,-20);return m.set(i),n.w===o.w&&n.h===o.h||(r=t,u=a,h.getOpt(r).each(function(t){var e=ea(t.element()),n=ra(t.element()),o=u.dom().naturalWidth,r=u.dom().naturalHeight,i=Math.min(e/o,n/r);1<=i?f.set(1):f.set(i)})),s(t,a),a})})},t=xv.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[l.asSpec(),{dom:{tag:"img",attributes:{src:e}}},{dom:{tag:"div"},behaviours:_u([Tm("image-panel-crop-events",[Qr(function(t){h.getOpt(t).each(function(t){var e=function z(s,n,l,o,r){var f,u,e,i,a="tox-",c="tox-crid-"+Ez++;function d(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}}function m(t,e,n,o){var r,i,u,a,c;r=e.x,i=e.y,u=e.w,a=e.h,r+=n*t.deltaX,i+=o*t.deltaY,(u+=n*t.deltaW)<20&&(u=20),(a+=o*t.deltaH)<20&&(a=20),c=s=xz.clamp({x:r,y:i,w:u,h:a},l,"move"===t.name),c=d(l,c),f.fire("updateRect",{rect:c}),v(c)}function h(e){function t(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),yz("#"+c+"-"+t,o).css({left:e.x,top:e.y,width:e.w,height:e.h})}zz.each(u,function(t){yz("#"+c+"-"+t.name,o).css({left:e.w*t.xMul+e.x,top:e.h*t.yMul+e.y})}),t("top",{x:n.x,y:n.y,w:n.w,h:e.y-n.y}),t("right",{x:e.x+e.w,y:e.y,w:n.w-e.x-e.w+n.x,h:e.h}),t("bottom",{x:n.x,y:e.y+e.h,w:n.w,h:n.h-e.y-e.h+n.y}),t("left",{x:n.x,y:e.y,w:e.x-n.x,h:e.h}),t("move",e)}function g(t){h(s=t)}function v(t){g(function n(t,e){return{x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}}(l,t))}return 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"}],i=["top","right","bottom","left"],function p(){yz('<div id="'+c+'" class="'+a+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(o),zz.each(i,function(t){yz("#"+c,o).append('<div id="'+c+"-"+t+'"class="'+a+'croprect-block" style="display: none" data-mce-bogus="all">')}),zz.each(u,function(t){yz("#"+c,o).append('<div id="'+c+"-"+t.name+'" class="'+a+"croprect-handle "+a+"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+'">')}),e=zz.map(u,function t(e){var n;return new Cz(c,{document:o.ownerDocument,handle:c+"-"+e.name,start:function(){n=s},drag:function(t){m(e,n,t.deltaX,t.deltaY)}})}),h(s),yz(o).on("focusin focusout",function(t){yz(t.target).attr("aria-grabbed","focus"===t.type)}),yz(o).on("keydown",function(e){var i;function t(t,e,n,o,r){t.stopPropagation(),t.preventDefault(),m(i,n,o,r)}switch(zz.each(u,function(t){if(e.target.id===c+"-"+t.name)return i=t,!1}),e.keyCode){case Sz.LEFT:t(e,0,s,-10,0);break;case Sz.RIGHT:t(e,0,s,10,0);break;case Sz.UP:t(e,0,s,0,-10);break;case Sz.DOWN:t(e,0,s,0,10);break;case Sz.ENTER:case Sz.SPACEBAR:e.preventDefault(),r()}})}(),f=zz.extend({toggleVisibility:function b(t){var e;e=zz.map(u,function(t){return"#"+c+"-"+t.name}).concat(zz.map(i,function(t){return"#"+c+"-"+t})).join(","),t?yz(e,o).show():yz(e,o).hide()},setClampRect:function y(t){l=t,h(s)},setRect:g,getInnerRect:function t(){return d(l,s)},setInnerRect:v,setViewPortRect:function x(t){n=t,h(s)},destroy:function w(){zz.each(e,function(t){t.destroy()}),e=[]}},wz)}({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t.element().dom(),function(){});e.toggleVisibility(!1),e.on("updateRect",function(t){var e=t.rect,n=f.get(),o={x:Math.round(e.x/n),y:Math.round(e.y/n),w:Math.round(e.w/n),h:Math.round(e.h/n)};m.set(o)}),d.set(P.some(e))})})])])}],containerBehaviours:_u([Yd.config({}),Tm("image-panel-events",[Qr(function(t){n(t,e)})])])}),h=Km(t);return{memContainer:h,updateSrc:n,zoom:function(t,e){var n=f.get(),o=0<e?Math.min(2,n+.1):Math.max(.1,n-.1);f.set(o),h.getOpt(t).each(function(t){var e=t.components()[1].element();s(t,e)})},showCrop:function(){d.get().each(function(t){t.toggleVisibility(!0)})},hideCrop:function(){d.get().each(function(t){t.toggleVisibility(!1)})},getRect:function(){return m.get()},getMeasurements:function(){var t=c.get();return{width:t.w,height:t.h}}}},Tz=function(t,e,n,o,r){return tz({name:t,icon:P.some(e),disabled:n,tooltip:P.some(t)},o,r)},Az=function(t,e){e?og.enable(t):og.disable(t)},Bz=function(){return Ye.getOrDie("URL")},Dz=function(t){return Bz().createObjectURL(t)},_z=function(t){Bz().revokeObjectURL(t)},Fz=function(t){var e=Ct(t),n=Ct(P.none()),r=function s(){var n=[],o=-1;function t(){return 0<o}function e(){return-1!==o&&o<n.length-1}return{data:n,add:function r(t){var e;return e=n.splice(++o),n.push(t),{state:t,removed:e}},undo:function i(){if(t())return n[--o]},redo:function u(){if(e())return n[++o]},canUndo:t,canRedo:e}}();r.add(t);var i=function(t){e.set(t)},u=function(t){return{blob:t,url:Dz(t)}},a=function(t){_z(t.url)},o=function(){n.get().each(a),n.set(P.none())},c=function(t){var e=u(t);i(e);var n,o=r.add(e).removed;return n=o,zz.each(n,a),e.url};return{getBlobState:function(){return e.get()},setBlobState:i,addBlobState:c,getTempState:function(){return n.get().fold(function(){return e.get()},function(t){return t})},updateTempState:function(t){var e=u(t);return o(),n.set(P.some(e)),e.url},addTempState:function(t){var e=u(t);return n.set(P.some(e)),e.url},applyTempState:function(e){return n.get().fold(function(){},function(t){c(t.blob),e()})},destroyTempState:o,undo:function(){var t=r.undo();return i(t),t.url},redo:function(){var t=r.redo();return i(t),t.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}},Lz=function(t,e){var n,o,r,u=Fz(t.currentState),i=function(t){var e=u.getHistoryStates();g.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),Cr(t,pz.formActionEvent,{name:pz.saveState(),value:e.undoEnabled})},a=function(t){return t.toBlob()},c=function(t){Cr(t,pz.formActionEvent,{name:pz.disable(),value:{}})},s=function(t){v.getApplyButton(t).each(function(t){og.enable(t)}),Cr(t,pz.formActionEvent,{name:pz.enable(),value:{}})},l=function(t,e){return c(t),h.updateSrc(t,e)},f=function(e,t,n,o,r){return c(e),Ow(t).then(n).then(a).then(o).then(function(t){return l(e,t).then(function(t){return i(e),r(),s(e),t})})["catch"](function(t){console.log(t),s(e)})},d=function(t,e,n){var o=u.getBlobState().blob;f(t,o,e,function(t){return u.updateTempState(t)},n)},m=function(t){var e=u.getBlobState().url;return u.destroyTempState(),i(t),e},h=Vz(t.currentState.url),g=(o=Km(Tz("Undo","undo",!0,function(t){Cr(t,mz.undo(),{direction:1})},n=e)),r=Km(Tz("Redo","redo",!0,function(t){Cr(t,mz.redo(),{direction:1})},n)),{container:xv.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[o.asSpec(),r.asSpec(),Tz("Zoom in","zoom-in",!1,function(t){Cr(t,mz.zoom(),{direction:1})},n),Tz("Zoom out","zoom-out",!1,function(t){Cr(t,mz.zoom(),{direction:-1})},n)]}),updateButtonUndoStates:function(t,e,n){o.getOpt(t).each(function(t){Az(t,e)}),r.getOpt(t).each(function(t){Az(t,n)})}}),v=bz(h,e);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[v.memContainer.asSpec(),h.memContainer.asSpec(),g.container],behaviours:_u([um.config({store:{mode:"manual",getValue:function(){return u.getBlobState()}}}),Tm("image-tools-events",[Wr(mz.undo(),function(e,t){var n=u.undo();l(e,n).then(function(t){s(e),i(e)})}),Wr(mz.redo(),function(e,t){var n=u.redo();l(e,n).then(function(t){s(e),i(e)})}),Wr(mz.zoom(),function(t,e){var n=e.event().direction();h.zoom(t,n)}),Wr(mz.back(),function(t,e){var n,o;o=m(n=t),l(n,o).then(function(t){s(n)}),e.event().swap()(),h.hideCrop()}),Wr(mz.apply(),function(t,e){u.applyTempState(function(){m(t),e.event().swap()()})}),Wr(mz.transform(),function(t,e){return d(t,e.event().transform(),N)}),Wr(mz.tempTransform(),function(t,e){return n=t,o=e.event().transform(),r=u.getTempState().blob,void f(n,r,o,function(t){return u.addTempState(t)},N);var n,o,r}),Wr(mz.transformApply(),function(t,e){return n=t,o=e.event().transform(),r=e.event().swap(),i=u.getBlobState().blob,void f(n,i,o,function(t){var e=u.addBlobState(t);return m(n),e},r);var n,o,r,i}),Wr(mz.swap(),function(e,t){var n;n=e,g.updateButtonUndoStates(n,!1,!1);var o=t.event().transform(),r=t.event().swap();o.fold(function(){r()},function(t){d(e,t,r)})})]),Px()])}},Iz=Al({name:"HtmlSelect",configFields:[Zo("options"),Vs("selectBehaviours",[fm,um]),dr("selectClasses",[]),dr("selectAttributes",{}),ar("data")],factory:function(n,t){var e=V(n.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),o=n.data.map(function(t){return wt("initialValue",t)}).getOr({});return{uid:n.uid,dom:{tag:"select",classes:n.selectClasses,attributes:n.selectAttributes},components:e,behaviours:As(n.selectBehaviours,[fm.config({}),um.config({store:Gn({mode:"manual",getValue:function(t){return Qi(t.element())},setValue:function(t,e){_(n.options,function(t){return t.value===e}).isSome()&&Zi(t.element(),e)}},o)})])}}}),Rz=function(n,e){var t=n.label.map(function(t){return zp(t,e)}),o=[jd.config({mode:"execution",useEnter:!0!==n.multiline,useControlEnter:!0===n.multiline,execute:function(t){return kr(t,Tv),P.some(!0)}}),Tm("textfield-change",[Wr(Nt(),function(t,e){Cr(t,Mv,{name:n.name})}),Wr(we(),function(t,e){Cr(t,Mv,{name:n.name})})]),Xp.config({})],r=n.validation.map(function(o){return Up.config({getRoot:function(t){return un(t.element())},invalidClass:"tox-invalid",validator:{validate:function(t){var e=um.getValue(t),n=o.validator(e);return Jv.pure(!0===n?ft.value(e):ft.error(n))},validateOnLoad:o.validateOnLoad}})}).toArray(),i=Iv.parts().field({tag:!0===n.multiline?"textarea":"input",inputAttributes:n.placeholder.fold(function(){},function(t){return{placeholder:e.translate(t)}}),inputClasses:[n.classname],inputBehaviours:_u(R([o,r])),selectOnFocus:!1,factory:Ep}),u=n.flex?["tox-form__group--stretched"]:[];return bp(t,i,u)},Nz=function(i){return Gn({},i,{toCached:function(){return Nz(i.toCached())},bindFuture:function(e){return Nz(i.bind(function(t){return t.fold(function(t){return Jv.pure(ft.error(t))},function(t){return e(t)})}))},bindResult:function(e){return Nz(i.map(function(t){return t.bind(e)}))},mapResult:function(e){return Nz(i.map(function(t){return t.map(e)}))},mapError:function(e){return Nz(i.map(function(t){return t.mapError(e)}))},foldResult:function(e,n){return i.map(function(t){return t.fold(e,n)})},withTimeout:function(t,r){return Nz(Jv.nu(function(e){var n=!1,o=window.setTimeout(function(){n=!0,e(ft.error(r()))},t);i.get(function(t){n||(window.clearTimeout(o),e(t))})}))}})},Pz=function(t){return Nz(Jv.nu(t))},jz=Pz,Uz={type:"separator"},Wz=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},Gz=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:N},onAction:function(){}}},Xz=function(t,e){return o=t,n=A(e,function(t){return t.type===o}),V(n,Wz);var n,o},Yz=function(t,e){var n=t.toLowerCase();return A(e,function(t){var e=t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.text;return le(e.toLowerCase(),n)||le(t.value.toLowerCase(),n)})},qz=function(c,t,s){var e=um.getValue(t),l=e.meta.text!==undefined?e.meta.text:e.value;return s.getLinkInformation().fold(function(){return[]},function(t){var e,n,o,r,i,u,a=Yz(l,(e=s.getHistory(c),V(e,function(t){return Gz(t,t)})));return"file"===c?(n=[a,Yz(l,(u=t,Xz("header",u.targets))),Yz(l,R([(i=t,i.anchorTop.map(function(t){return Gz("<top>",t)}).toArray()),(r=t,Xz("anchor",r.targets)),(o=t,o.anchorBottom.map(function(t){return Gz("<bottom>",t)}).toArray())]))],D(n,function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(Uz,e)},[])):a})},Kz=function(i,u,o){var t,r=function(t){var e=um.getValue(t);o.addToHistory(e.value,i.filetype)},e=Iv.parts().field({factory:pp,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],minChars:0,responseTime:0,fetch:function(t){var e=qz(i.filetype,t,o),n=Hp(e,dg.BUBBLE_TO_SANDBOX,u.providers);return Jv.pure(n)},getHotspot:function(t){return f.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(Up)&&Up.run(t).get(N)},typeaheadBehaviours:_u(R([o.getValidationHandler().map(function(o){return Up.config({getRoot:function(t){return un(t.element())},invalidClass:"tox-control-wrap--status-invalid",notify:{},validator:{validate:function(e){var n=um.getValue(e);return jz(function(t){o({type:i.filetype,url:n.value},function(n){f.getOpt(e).each(function(t){var e=function(t,e,n){(n?_i:Li)(t.element(),e)};e(t,"tox-control-wrap--status-valid","valid"===n.status),e(t,"tox-control-wrap--status-unknown","unknown"===n.status)}),t(("invalid"===n.status?ft.error:ft.value)(n.message))})})},validateOnLoad:!1}})}).toArray(),[Xp.config({}),Tm("urlinput-events",R(["file"===i.filetype?[Wr(Nt(),function(t){Cr(t,Mv,{name:i.name})})]:[],[Wr(Pt(),function(t){Cr(t,Mv,{name:i.name}),r(t)}),Wr(we(),function(t){Cr(t,Mv,{name:i.name}),r(t)})]]))]])),eventOrder:(t={},t[Nt()]=["streaming","urlinput-events","invalidating"],t),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"dog"},lazySink:u.getSink,parts:{menu:Dg(0,0,"normal")},onExecute:function(t,e,n){Cr(e,Tv,{})},onItemExecute:function(t,e,n,o){r(t),Cr(t,Mv,{name:i.name})}}),n=i.label.map(function(t){return zp(t,u.providers)}),a=function(t,e,n){return void 0===e&&(e=t),void 0===n&&(n=t),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],innerHtml:Qm(e,u.providers.icons),attributes:{title:u.providers.translate(n)}}}},c=Km({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[a("valid","checkmark","valid"),a("unknown","warning"),a("invalid","warning")]}),s=o.getUrlPicker(i.filetype),l=Un("browser.url.event"),f=Km({dom:{tag:"div",classes:["tox-control-wrap"]},components:[e,c.asSpec()]});return Iv.sketch({dom:wp([]),components:n.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:R([[f.asSpec()],s.map(function(){return t=i.label,e=l,n="tox-browse-url",o="browse",r=u.providers,qm.sketch({dom:{tag:"button",classes:["tox-tbtn",n],innerHtml:Qm(o,r.icons),attributes:{title:r.translate(t.getOr(""))}},buttonBehaviours:_u([Xp.config({})]),action:function(t){kr(t,e)}});var t,e,n,o,r}).toArray()])}]),fieldBehaviours:_u([Tm("url-input-events",[Wr(l,function(o){Ll.getCurrent(o).each(function(e){var n=um.getValue(e);s.each(function(t){t(n).get(function(t){um.setValue(e,t),Cr(o,Mv,{name:i.name})})})})})])])})},Jz=function(u,e){var t,n,o=u.label.map(function(t){return zp(t,e)}),r=function(n){return function(e,t){mu(t.event().target(),"[data-collection-item-value]").each(function(t){n(e,t,Mn(t,"data-collection-item-value"))})}},i=[Wr(_t(),r(function(t,e){cf(e)})),Wr(jt(),r(function(t,e,n){Cr(t,Vv,{name:u.name,value:n})})),Wr(Ft(),r(function(t,e,n){du(t.element(),"."+Dh).each(function(t){Li(t,Dh)}),_i(e,Dh)})),Wr(Lt(),r(function(t,e,n){du(t.element(),"."+Dh).each(function(t){Li(t,Dh)})})),ei(r(function(t,e,n){Cr(t,Vv,{name:u.name,value:n})}))],a=Iv.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==u.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:d},behaviours:_u([Yd.config({}),um.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){var e,n,r,i;e=o,n=V(t,function(t){var e,n=1===u.columns?t.text.map(function(t){return'<span class="tox-collection__item-label">'+t+"</span>"}).getOr(""):"",o=t.icon.map(function(t){return'<span class="tox-collection__item-icon">'+t+"</span>"}).getOr(""),r={_:" "," - ":" ","-":" "},i=t.text.getOr("").replace(/\_| \- |\-/g,function(t){return r[t]});return'<div class="tox-collection__item" tabindex="-1" data-collection-item-value="'+('"'===(e=t.value)?"&quot;":e)+'" title="'+i+'" aria-label="'+i+'">'+o+n+"</div>"}),r=1<u.columns&&"auto"!==u.columns?E(n,u.columns):[n],i=V(r,function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}),bn(e.element(),i.join("")),"auto"===u.columns&&kh(o,5,"tox-collection__item").each(function(t){var e=t.numRows,n=t.numColumns;jd.setGridSize(o,e,n)}),kr(o,_v)}}),Xp.config({}),jd.config((t=u.columns,n="normal",1===t?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===t?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===n?".tox-swatches__row":".tox-collection__group",cell:"color"===n?"."+Eh:"."+Hh}})),Tm("collection-events",i)])});return bp(o,a,["tox-form__group--collection"])},$z=function(r){return function(e,n,o){return xt(n,"name").fold(function(){return r(n,o)},function(t){return e.field(t,r(n,o))})}},Qz={bar:$z(function(t,e){return n=t,o=e.shared,{dom:{tag:"div",classes:["tox-bar"]},components:V(n.items,o.interpreter)};var n,o}),collection:$z(function(t,e){return Jz(t,e.shared.providers)}),alloy:$z(d),alertbanner:$z(function(t,e){return n=t,o=e.shared.providers,xv.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+n.level]},components:[{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:o.translate(n.text)}},qm.sketch({dom:{tag:"button",classes:["tox-notification__right-icon","tox-button","tox-button--naked","tox-button--icon"],innerHtml:Qm(n.icon,o.icons),attributes:{title:o.translate(n.actionLabel)}},action:function(t){Cr(t,Vv,{name:"alert-banner",value:n.url})}})]});var n,o}),input:$z(function(t,e){return n=t,o=e.shared.providers,Rz({name:n.name,multiline:!1,label:n.label,placeholder:n.placeholder,flex:!1,classname:"tox-textfield",validation:P.none()},o);var n,o}),textarea:$z(function(t,e){return n=t,o=e.shared.providers,Rz({name:n.name,multiline:!0,label:n.label,placeholder:n.placeholder,flex:!0,classname:"tox-textarea",validation:P.none()},o);var n,o}),listbox:$z(function(t,e){return n=t,o=e.shared.providers,r=zp(n.label,o),i=Iv.parts().field({factory:Iz,dom:{classes:["mce-select-field"]},selectBehaviours:_u([Xp.config({})]),options:n.values,data:n.initialValue.getOr(undefined)}),yp(P.some(r),i);var n,o,r,i}),label:$z(function(t,e){return n=t,o=e.shared,r={dom:{tag:"label",innerHtml:o.providers.translate(n.label),classes:["tox-label"]}},i=V(n.items,o.interpreter),{dom:{tag:"div",classes:["tox-form__group"]},components:[r].concat(i),behaviours:_u([Px(),Yd.config({}),$x(P.none()),jd.config({mode:"acyclic"})])};var n,o,r,i}),iframe:(Oz=function(t,e){return cw(t,e.shared.providers)},function(t,e,n){var o=gt(e,{source:"dynamic"});return $z(Oz)(t,o,n)}),autocomplete:$z(function(t,e){return r=t,i=e.shared,n=zp(r.label.getOr("?"),i.providers),o=Iv.parts().field({factory:pp,dismissOnBlur:!1,inputClasses:["tox-textfield"],minChars:1,fetch:function(t){var e=um.getValue(t),n=r.getItems(e),o=Hp(n,dg.BUBBLE_TO_SANDBOX,i.providers);return Jv.pure(o)},markers:{openClass:"dog"},lazySink:i.getSink,parts:{menu:Dg(0,0,"normal")}}),yp(P.some(n),o);var r,i,n,o}),button:$z(function(t,e){return n=t,o=e.shared.providers,r=nz(n.name,"custom"),ez(n,r,o,[Qx(""),Px()]);var n,o,r}),checkbox:$z(function(t,e){return n=t,o=e.shared.providers,r=um.config({store:{mode:"manual",getValue:function(t){return t.element().dom().checked},setValue:function(t,e){t.element().dom().checked=e}}}),i=function(t){return t.element().dom().click(),P.some(!0)},u=Iv.parts().field({factory:{sketch:d},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:_u([Px(),Xp.config({}),fm.config({}),r,jd.config({mode:"special",onEnter:i,onSpace:i,stopSpaceKeyup:!0}),Tm("checkbox-events",[Wr(Pt(),function(t,e){Cr(t,Mv,{name:n.name})})])])}),a=Iv.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:o.translate(n.label)},behaviours:_u([_b.config({})])}),s=Km({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[(c=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:Qm("checked"===t?"selected":"unselected",o.icons)}}})("checked"),c("unchecked")]}),Iv.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[u,s.asSpec(),a]});var n,o,r,i,u,a,c,s}),colorinput:$z(function(t,e){return Rb(t,e.shared,e.colorinput)}),colorpicker:$z(function(t){var e=function(t){return"tox-"+t},n=Nx(Gx,e),r=Km(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Cr(t,Vv,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Cr(t,Vv,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:_u([um.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return Ll.getCurrent(e).bind(function(t){return um.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);Ll.getCurrent(o).fold(function(){console.log("Can not find form")},function(t){um.setValue(t,{hex:P.from(n[1]).getOr("")}),Bx.getField(t,"hex").each(function(t){kr(t,Nt())})})}}}),Px()])}}),dropzone:$z(function(t,e){return Zx(t,e.shared.providers)}),grid:$z(function(t,e){return n=t,o=e.shared,{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+n.columns+"col"]},components:V(n.items,o.interpreter)};var n,o}),selectbox:$z(function(t,e){return n=t,o=e.shared.providers,r=n.label.map(function(t){return zp(t,o)}),i=Iv.parts().field({dom:{},selectAttributes:{size:n.size},options:n.items,factory:Iz,selectBehaviours:_u([Xp.config({}),Tm("selectbox-change",[Wr(Pt(),function(t,e){Cr(t,Mv,{name:n.name})})])])}),u=1<n.size?P.none():P.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:Qm("chevron-down",o.icons)}}),a={dom:{tag:"div",classes:["tox-selectfield"]},components:R([[i],u.toArray()])},Iv.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:R([r.toArray(),[a]])});var n,o,r,i,u,a}),sizeinput:$z(function(t,e){return dz(t,e.shared.providers)}),urlinput:$z(function(t,e){return Kz(t,e.shared,e.urlinput)}),customeditor:$z(function(e){var n=Ct(P.none()),o=Km({dom:{tag:e.tag}}),r=Ct(P.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:_u([Tm("editor-foo-events",[Qr(function(t){o.getOpt(t).each(function(t){e.init(t.element().dom()).then(function(e){r.get().each(function(t){e.setValue(t)}),r.set(P.none()),n.set(P.some(e))})})})]),um.config({store:{mode:"manual",getValue:function(){return n.get().fold(function(){return r.get().getOr("")},function(t){return t.getValue()})},setValue:function(t,e){n.get().fold(function(){r.set(P.some(e))},function(t){return t.setValue(e)})}}}),Px()]),components:[o.asSpec()]}}),htmlpanel:$z(function(t){return xv.sketch({dom:{tag:"div",innerHtml:t.html},containerBehaviours:_u([Xp.config({}),fm.config({})])})}),imagetools:$z(function(t,e){return Lz(t,e.shared.providers)}),table:$z(function(t,e){return n=t,o=e.shared.providers,u=function(t){return{dom:{tag:"th",innerHtml:o.translate(t)}}},a=function(t){return{dom:{tag:"td",innerHtml:o.translate(t)}}},c=function(t){return{dom:{tag:"tr"},components:V(t,a)}},{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(i=n.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:V(i,u)}]}),(r=n.cells,{dom:{tag:"tbody"},components:V(r,c)})],behaviours:_u([Xp.config({}),fm.config({})])};var n,o,r,i,u,a,c})},Zz={field:function(t,e){return e}},tS=function(e,t,n){var o=gt(n,{shared:{interpreter:function(t){return eS(e,t,o)}}});return eS(e,t,o)},eS=function(e,n,o){return xt(Qz,n.type).fold(function(){return console.error('Unknown factory type "'+n.type+'", defaulting to container: ',n),n},function(t){return t(e,n,o)})},nS=function(t){return{colorPicker:(o=t,function(t,e){Tb.colorPickerDialog(o)(t,e)}),hasCustomColors:(n=t,function(){return xb(n)}),getColors:(e=t,function(){return wb(e)})};var e,n,o},oS=[{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",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strike-through",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}]}],rS=function(t){return D(t,function(t,e){if(it(e,"items")){var n=rS(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(it(e,"inline")||it(e,"block")||it(e,"selector")){var o="custom-"+e.title.toLowerCase();return{customFormats:t.customFormats.concat([{name:o,format:e}]),formats:t.formats.concat([{title:e.title,format:o,icon:e.icon}])}}return Gn({},t,{formats:t.formats.concat(e)})},{customFormats:[],formats:[]})},iS=function(i){return(t=i,P.from(t.getParam("style_formats")).filter(O)).map(function(t){var e,n,o,r=(e=i,n=rS(t),o=function(t){T(t,function(t){e.formatter.has(t.name)||e.formatter.register(t.name,t.format)})},e.formatter?o(n.customFormats):e.on("init",function(){o(n.customFormats)}),n.formats);return i.getParam("style_formats_merge",!1,"boolean")?oS.concat(r):r}).getOr(oS);var t},uS=function(t,e,n){var o={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return gt(t,o)},aS=function(s,t,l,f){var d=function(t){return V(t,function(t){var e,n,o,r,i,u,a=Q(t);if(kt(t,"items")){var c=d(t.items);return gt((i=t,u={type:"submenu",isSelected:U(!1),getStylePreview:function(){return P.none()}},gt(i,u)),{getStyleItems:function(){return c}})}return kt(t,"format")?uS(t,l,f):1===a.length&&M(a,"title")?gt(t,{type:"separator"}):(n=Un((e=t).title),o={type:"formatter",format:n,isSelected:l(n),getStylePreview:f(n)},r=gt(e,o),s.formatter.register(n,r),r)})};return d(t)},cS=zz.trim,sS=function(e){return function(t){if(t&&1===t.nodeType){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}},lS=sS("true"),fS=sS("false"),dS=function(t,e,n,o,r){return{type:t,title:e,url:n,level:o,attach:r}},mS=function(t){return t.innerText||t.textContent},hS=function(t){return(e=t)&&"A"===e.nodeName&&(e.id||e.name)!==undefined&&vS(t);var e},gS=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},vS=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return lS(t)}return!1}(t)&&!fS(t)},pS=function(t){return gS(t)&&vS(t)},bS=function(t){var e,n,o=(e=t).id?e.id:Un("h");return dS("header",mS(t),"#"+o,gS(n=t)?parseInt(n.nodeName.substr(1),10):0,function(){t.id=o})},yS=function(t){var e=t.id||t.name,n=mS(t);return dS("anchor",n||"#"+e,"#"+e,0,N)},xS=function(t){var e,n;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,V(Oc(Ne.fromDom(n),e),function(t){return t.dom()})},wS=function(t){return 0<cS(t.title).length},zS=function(t){var e,n=xS(t);return A((e=n,V(A(e,pS),bS)).concat(V(A(n,hS),yS)),wS)},SS="tinymce-url-history",kS=function(t){return x(t)&&/^https?/.test(t)},CS=function(t){return w(t)&&function(t,e){for(var n=Q(t),o=0,r=n.length;o<r;o++){var i=n[o],u=t[i];if(e(u,i,t))return P.some(u)}return P.none()}(t,function(t){return!(O(e=t)&&e.length<=5&&W(e,kS));var e}).isNone()},OS=function(){var t,e=localStorage.getItem(SS);if(null===e)return{};try{t=JSON.parse(e)}catch(n){if(n instanceof SyntaxError)return console.log("Local storage "+SS+" was not valid JSON",n),{};throw n}return CS(t)?t:(console.log("Local storage "+SS+" was not valid format",t),{})},MS=function(t){var e=OS();return Object.prototype.hasOwnProperty.call(e,t)?e[t]:[]},HS=function(e,t){if(kS(e)){var n=OS(),o=Object.prototype.hasOwnProperty.call(n,t)?n[t]:[],r=A(o,function(t){return t!==e});n[t]=[e].concat(r).slice(0,5),function(t){if(!CS(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));localStorage.setItem(SS,JSON.stringify(t))}(n)}},ES=Object.prototype.hasOwnProperty,VS=function(t){return!!t},TS=function(t){return et(zz.makeMap(t,/[, ]/),VS)},AS=function(t,e){return ES.call(t,e)?P.some(t[e]):P.none()},BS=function(t,e,n){var o=AS(t,e).getOr(n);return x(o)?P.some(o):P.none()},DS=function(a){return function(r){return(t=a.settings,e=r,n=P.some(t.file_picker_types).filter(VS),o=P.some(t.file_browser_callback_types).filter(VS),i=n.or(o).map(TS).fold(function(){return!0},function(t){return AS(t,e).getOr(!1)}),u=P.some(t.file_picker_callback).filter(S),i?u:P.none()).map(function(o){return function(e){return Jv.nu(function(n){var t=zz.extend({filetype:r},P.from(e.meta).getOr({}));o.call(a,function(t,e){if(!x(t))throw new Error("Expected value to be string");if(e!==undefined&&!w(e))throw new Error("Expected meta to be a object");n({value:t,meta:e})},e.value,t)})}});var t,e,n,o,i,u}},_S=function(t){return{getHistory:MS,addToHistory:HS,getLinkInformation:(n=t,function(){return!1===n.settings.typeahead_urls?P.none():P.some({targets:zS(n.getBody()),anchorTop:BS(n.settings,"anchor_top","#top"),anchorBottom:BS(n.settings,"anchor_bottom","#bottom")})}),getValidationHandler:(e=t,function(){var t=e.settings.filepicker_validator_handler;return S(t)?P.some(t):P.none()}),getUrlPicker:DS(t)};var e,n},FS={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},LS=function(t,e,n){var o,r,i,u,a,c,s,l,f,d={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:Lh.translate},interpreter:function(t){return eS(Zz,t,d)},anchors:{toolbar:function(){return{anchor:"hotspot",hotspot:n(),bubble:ja(-12,12,FS),layouts:{onRtl:function(){return[$a]},onLtr:function(){return[Qa]}}}},banner:function(){return{anchor:"hotspot",hotspot:n(),layouts:{onRtl:function(){return[nc]},onLtr:function(){return[nc]}}}},cursor:function(){return{anchor:"selection",root:Ne.fromDom(e.getBody()),getSelection:function(){var t=e.selection.getRng();return P.some(gc(Ne.fromDom(t.startContainer),t.startOffset,Ne.fromDom(t.endContainer),t.endOffset))}}},node:function(t){return{anchor:"node",root:Ne.fromDom(e.getBody()),node:t}}},getSink:function(){return ft.value(t)}},urlinput:_S(e),styleselect:(o=e,r=function(t){return function(){return o.formatter.match(t)}},i=function(e){return function(){var t=o.formatter.get(e);return t!==undefined?P.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:o.formatter.getCssText(e)}):P.none()}},u=function(t){var e=t.items;return e!==undefined&&0<e.length?j(e,u):[t.format]},a=Ct([]),c=Ct([]),s=Ct([]),l=Ct([]),f=Ct(!1),o.on("init",function(){var t=iS(o),e=aS(o,t,r,i);a.set(e),c.set(j(e,u))}),o.on("addStyleModifications",function(t){var e=aS(o,t.items,r,i);s.set(e),f.set(t.replace),l.set(j(e,u))}),{getData:function(){var t=f.get()?[]:a.get(),e=s.get();return t.concat(e)},getFlattenedKeys:function(){var t=f.get()?[]:c.get(),e=l.get();return t.concat(e)}}),colorinput:nS(e)};return d},IS=tinymce.util.Tools.resolve("tinymce.util.Delay"),RS=U([dr("shell",!0),Vs("toolbarBehaviours",[Yd])]),NS=U([ul({name:"groups",overrides:function(t){return{behaviours:_u([Yd.config({})])}}})]),PS=Bl({name:"Toolbar",configFields:RS(),partFields:NS(),factory:function(e,t,n,o){var r=function(t){return e.shell?P.some(t):bl(t,e,"groups")},i=e.shell?{behaviours:[Yd.config({})],components:[]}:{behaviours:[],components:t};return{uid:e.uid,dom:e.dom,components:i.components,behaviours:As(e.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,e){r(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){Yd.set(t,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),jS=U([Zo("items"),wu(["itemSelector"]),Vs("tgroupBehaviours",[jd])]),US=U([al({name:"items",unit:"item"})]),WS=Bl({name:"ToolbarGroup",configFields:jS(),partFields:US(),factory:function(t,e,n,o){return{uid:t.uid,dom:t.dom,components:e,behaviours:As(t.tgroupBehaviours,[jd.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),GS=function(t){var e=t.title.fold(function(){return{}},function(t){return{attributes:{title:t}}});return WS.sketch({dom:Gn({tag:"div",classes:["tox-toolbar__group"]},e),components:[WS.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:_u([Xp.config({}),fm.config({})])})},XS=function(n){var t=n.cyclicKeying?"cyclic":"acyclic";return PS.sketch({uid:n.uid,dom:{tag:"div",classes:["tox-toolbar"]},components:[PS.parts().groups({})],toolbarBehaviours:_u([jd.config({mode:t,onEscape:n.onEscape,selector:".tox-toolbar__group"}),Tm("toolbar-events",[Qr(function(t){var e=V(n.initGroups,GS);PS.setGroups(t,e)})])])})},YS=[pr("disabled",!1),sr("tooltip"),sr("icon"),sr("text"),br("onSetup",function(){return N})],qS=Eo([er("type"),or("onAction")].concat(YS)),KS=function(t){return Po("toolbarbutton",qS,t)},JS=Eo([er("type"),sr("tooltip"),sr("icon"),sr("text"),or("fetch"),br("onSetup",function(){return N})]),$S=Eo([er("type"),sr("tooltip"),sr("icon"),sr("text"),lr("select"),or("fetch"),br("onSetup",function(){return N}),vr("presets","normal",["normal","color","toolbar"]),dr("columns",1),or("onAction"),or("onItemAction")]),QS=[pr("active",!1)].concat(YS),ZS=Eo(QS.concat([er("type"),or("onAction")])),tk=function(t){return Po("ToggleButton",ZS,t)},ek=[br("predicate",function(){return!1}),vr("scope","node",["node","editor"]),vr("position","selection",["node","selection","line"])],nk=YS.concat([dr("type","contextformbutton"),dr("primary",!1),or("onAction"),xr("original",d)]),ok=QS.concat([dr("type","contextformbutton"),dr("primary",!1),or("onAction"),xr("original",d)]),rk=YS.concat([dr("type","contextformbutton")]),ik=QS.concat([dr("type","contextformtogglebutton")]),uk=Go("type",{contextformbutton:nk,contextformtogglebutton:ok}),ak=Eo([dr("type","contextform"),br("initValue",function(){return""}),sr("label"),ur("commands",uk),cr("launch",Go("type",{contextformbutton:rk,contextformtogglebutton:ik}))].concat(ek)),ck=Eo([dr("type","contexttoolbar"),er("items")].concat(ek)),sk=Un("toolbar.button.execute"),lk={"alloy.execute":["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},fk=Object.freeze({getState:function(t,e,n){return n}}),dk=Object.freeze({events:function(r,i){var o=function(n,o){r.updateState.each(function(t){var e=t(n,o);i.set(e)}),r.renderComponents.each(function(t){var e=t(o,i.get());ds(n),T(e,function(t){cs(n,n.getSystem().build(t))})})};return Pr([Wr(ze(),function(t,e){var n=r.channel;M(e.channels(),n)&&o(t,e.data())}),Qr(function(e,t){r.initialData.each(function(t){o(e,t)})})])}}),mk=Object.freeze({init:function(t){var e=Ct(P.none());return{readState:function(){return e.get().getOr("none")},get:function(){return e.get()},set:function(t){return e.set(t)},clear:function(){return e.set(P.none())}}}}),hk=[Zo("channel"),ar("renderComponents"),ar("updateState"),ar("initialData")],gk=Lu({fields:hk,name:"reflecting",active:dk,apis:fk,state:mk}),vk=U([Zo("toggleClass"),Zo("fetch"),Cu("onExecute"),dr("getHotspot",P.some),dr("layouts",P.none()),Cu("onItemExecute"),ar("lazySink"),Zo("dom"),Su("onOpen"),Vs("splitDropdownBehaviours",[Pv,jd,fm]),dr("matchWidth",!1),dr("useMinWidth",!1),dr("eventOrder",{}),ar("role")].concat(hp())),pk=rl({factory:qm,schema:[Zo("dom")],name:"arrow",defaults:function(t){return{buttonBehaviours:_u([fm.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(e.uid).each(Or)},buttonBehaviours:_u([km.config({toggleOnExecute:!1,toggleClass:e.toggleClass})])}}}),bk=rl({factory:qm,schema:[Zo("dom")],name:"button",defaults:function(t){return{buttonBehaviours:_u([fm.revoke()])}},overrides:function(n){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(n.uid).each(function(t){n.onExecute(t,e)})}}}}),yk=U([pk,bk,ul({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Zo("text")],name:"aria-descriptor"}),il({schema:[xu()],name:"menu",defaults:function(o){return{onExecute:function(e,n){e.getSystem().getByUid(o.uid).each(function(t){o.onItemExecute(t,e,n)})}}}}),Qv()]),xk=Bl({name:"SplitDropdown",configFields:vk(),partFields:yk(),factory:function(o,t,e,n){var r=function(t){Ll.getCurrent(t).each(function(t){Jl.highlightFirst(t),jd.focusIn(t)})},i=function(t){np(o,function(t){return t},t,n,r,bv.HighlightFirst).get(N)},u=function(t){var e=yl(t,o,"button");return Or(e),P.some(!0)},a=vt(Pr([Qr(function(n,t){bl(n,o,"aria-descriptor").each(function(t){var e=Un("aria");Cn(t.element(),"id",e),Cn(n.element(),"aria-describedby",e)})})]),Ym(P.some(i)));return{uid:o.uid,dom:o.dom,components:t,eventOrder:Gn({},o.eventOrder,{"alloy.execute":["disabling","toggling","alloy.base.behaviour"]}),events:a,behaviours:As(o.splitDropdownBehaviours,[Pv.config({others:{sandbox:function(t){var e=yl(t,o,"arrow");return ip(o,t,{onOpen:function(){km.on(e),km.on(t)},onClose:function(){km.off(e),km.off(t)}})}}}),jd.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return i(t),P.some(!0)}}),fm.config({}),km.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:o.role.getOr("button"),"aria-haspopup":!0}}}}}),wk=function(e){return{isDisabled:function(){return og.isDisabled(e)},setDisabled:function(t){return t?og.disable(e):og.enable(e)}}},zk=function(e){return{setActive:function(t){km.set(e,t)},isActive:function(){return km.isOn(e)},isDisabled:function(){return og.isDisabled(e)},setDisabled:function(t){return t?og.disable(e):og.enable(e)}}},Sk=function(t,e){return t.map(function(t){return{"aria-label":e.translate(t),title:e.translate(t)}}).getOr({})},kk=Un("focus-button"),Ck=function(e,n,t,o,r,i){var u;return{dom:{tag:"button",classes:["tox-tbtn"].concat(n.isSome()?["tox-tbtn--select"]:[]),attributes:Sk(t,i)},components:hg([e.map(function(t){return $w(t,i.icons)}),n.map(function(t){return Qw(t,"tox-tbtn",i)})]),eventOrder:(u={},u[Tt()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:_u([Tm("common-button-display-events",[Wr(Tt(),function(t,e){e.event().prevent(),kr(t,kk)})])].concat(o.map(function(t){return gk.config({channel:t,initialData:{icon:e,text:n},renderComponents:function(t,e){return hg([t.icon.map(function(t){return $w(t,i.icons)}),t.text.map(function(t){return Qw(t,"tox-tbtn",i)})])}})}).toArray()).concat(r.getOr([])))}},Ok=function(t,e,n){var o,r=Ct(N),i=Ck(t.icon,t.text,t.tooltip,P.none(),P.none(),n);return qm.sketch({dom:i.dom,components:i.components,eventOrder:lk,buttonBehaviours:_u([Tm("toolbar-button-events",[(o={onAction:t.onAction,getApi:e.getApi},ei(function(e,t){ag(o,e)(function(t){Cr(e,sk,{buttonApi:t}),o.onAction(t)})})),cg(e,r),sg(e,r)]),ig(t.disabled)].concat(e.toolbarButtonBehaviours))})},Mk=function(t,e,n){return Ok(t,{toolbarButtonBehaviours:[].concat(0<n.length?[Tm("toolbarButtonWith",n)]:[]),getApi:wk,onSetup:t.onSetup},e)},Hk=function(t,e,n){return gt(Ok(t,{toolbarButtonBehaviours:[Yd.config({}),km.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<n.length?[Tm("toolbarToggleButtonWith",n)]:[]),getApi:zk,onSetup:t.onSetup},e))},Ek=function(e,t){var n,o,r,i,u=Un("channel-update-split-dropdown-display"),a=function(n){return{isDisabled:function(){return og.isDisabled(n)},setDisabled:function(t){return t?og.disable(n):og.enable(n)},setIconFill:function(t,e){du(n.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){Cn(t,"fill",e)})},setIconStroke:function(t,e){du(n.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){Cn(t,"stroke",e)})},setActive:function(e){Cn(n.element(),"aria-pressed",e),du(n.element(),"span").each(function(t){n.getSystem().getByDom(t).each(function(t){return km.set(t,e)})})},isActive:function(){return du(n.element(),"span").exists(function(t){return n.getSystem().getByDom(t).exists(km.isOn)})}}},c=Ct(N),s={getApi:a,onSetup:e.onSetup};return xk.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:vt({"aria-pressed":!1},Sk(e.tooltip,t.providers))},onExecute:function(t){e.onAction(a(t))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:_u([ug(!1),Tm("split-dropdown-events",[Wr(kk,fm.focus),cg(s,c),sg(s,c)])]),eventOrder:(n={},n[Ae()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:(o=a,r=e,i=t.providers,function(e){return Jv.nu(function(t){return r.fetch(t)}).map(function(t){return Yg(gt(Gg(Un("menu-value"),t,function(t){r.onItemAction(o(e),t)},r.columns,r.presets,dg.CLOSE_ON_EXECUTE,r.select.getOr(function(){return!1}),i),{movement:_g(r.columns,r.presets),menuBehaviours:Oh("auto"!==r.columns?[]:[Qr(function(o,t){kh(o,4,_h(r.presets)).each(function(t){var e=t.numRows,n=t.numColumns;jd.setGridSize(o,e,n)})})])}))})}),parts:{menu:Dg(0,e.columns,e.presets)},components:[xk.parts().button(Ck(e.icon,e.text,P.none(),P.some(u),P.some([km.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),t.providers)),xk.parts().arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Qm("chevron-down",t.providers.icons)}}),xk.parts()["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})},Vk=function(i,u){return Wr(sk,function(t,e){var n,o=i.get(t),r=(n=o,{hide:function(){return kr(n,He())},getValue:function(){return um.getValue(n)}});u.onAction(r,e.event().buttonApi())})},Tk=function(t,e,n){var o,r,i,u,a,c,s,l,f,d,m,h,g={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?(s=t,f=g,(d=(l=e).original).primary,m=Xn(d,["primary"]),h=jo(tk(Gn({},m,{type:"togglebutton",onAction:function(){}}))),Hk(h,f.backstage.shared.providers,[Vk(s,l)])):(o=t,i=g,(u=(r=e).original).primary,a=Xn(u,["primary"]),c=jo(KS(Gn({},a,{type:"button",onAction:function(){}}))),Mk(c,i.backstage.shared.providers,[Vk(o,r)]))},Ak=function(t,e){var n,o,r,i,u=t.label.fold(function(){return{}},function(t){return{"aria-label":t}}),a=Km(Ep.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:u,selectOnFocus:!0,inputBehaviours:_u([jd.config({mode:"special",onEnter:function(t){return c.findPrimary(t).map(function(t){return Or(t),!0})},onLeft:function(t,e){return e.cut(),P.none()},onRight:function(t,e){return e.cut(),P.none()}})])})),c=(n=a,o=t.commands,r=e,i=V(o,function(t){return Km(Tk(n,t,r))}),{asSpecs:function(){return V(i,function(t){return t.asSpec()})},findPrimary:function(n){return Mt(o,function(t,e){return t.primary?P.from(i[e]).bind(function(t){return t.getOpt(n)}).filter(m(og.isDisabled)):P.none()})}});return XS({uid:Un("context-toolbar"),initGroups:[{title:P.none(),items:[a.asSpec()]},{title:P.none(),items:c.asSpecs()}],onEscape:P.none,cyclicKeying:!0})},Bk=Un("forward-slide"),Dk=Un("backward-slide"),_k=Un("change-slide-event"),Fk="tox-pop--resizing",Lk=function(e,t){return Mt(t,function(t){return t.predicate(e.dom())?P.some({toolbarApi:t,elem:e}):P.none()})},Ik=function(e,n){var t=function(t){return t.dom()===n.getBody()},o=Ne.fromDom(n.selection.getNode());return Lk(o,e.inNodeScope).orThunk(function(){return Lk(o,e.inEditorScope).orThunk(function(){return function(t,e,n){for(var o=t.dom(),r=S(n)?n:U(!1);o.parentNode;){o=o.parentNode;var i=Ne.fromDom(o),u=e(i);if(u.isSome())return u;if(r(i))break}return P.none()}(o,function(t){return Lk(t,e.inNodeScope)},t)})})},Rk=function(n,r){var t={},i=[],u=[],a={},c={},o=function(e,n){var o=jo(Po("ContextForm",ak,n));(t[e]=o).launch.map(function(t){a["form:"+e]=Gn({},n.launch,{type:"contextformtogglebutton"===t.type?"togglebutton":"button",onAction:function(){r(o)}})}),"editor"===o.scope?u.push(o):i.push(o),c[e]=o},s=function(e,n){var t;(t=n,Po("ContextToolbar",ck,t)).each(function(t){"editor"===n.scope?u.push(t):i.push(t),c[e]=t})},e=Q(n);return T(e,function(t){var e=n[t];"contextform"===e.type?o(t,e):"contexttoolbar"===e.type&&s(t,e)}),{forms:t,inNodeScope:i,inEditorScope:u,lookupTable:c,formNavigators:a}},Nk=Un("update-menu-text"),Pk=function(t,e,o){var r=t.text.map(function(t){return Km(Qw(t,e,o.providers))}),n=function(t,e){var n=um.getValue(t);return fm.focus(n),Cr(n,"keydown",{raw:e.event().raw()}),Db.close(n),P.some(!0)},i=t.role.fold(function(){return{}},function(t){return{role:t}}),u=t.tooltip.fold(function(){return{}},function(t){var e=o.providers.translate(t);return{title:e,"aria-label":e}});return Km(Db.sketch(Gn({},i,{dom:{tag:"button",classes:[e,e+"--select"].concat(V(t.classes,function(t){return e+"--"+t})),attributes:Gn({},u)},components:hg([t.icon.map(function(t){return $w(t,o.providers.icons)}),r.map(function(t){return t.asSpec()}),P.some({dom:{tag:"div",classes:[e+"__select-chevron"],innerHtml:Qm("chevron-down",o.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:_u([ig(t.disabled),_b.config({}),Yd.config({}),Tm("menubutton-update-display-text",[Qr(t.onAttach),Zr(t.onDetach),Wr(Nk,function(e,n){r.bind(function(t){return t.getOpt(e)}).each(function(t){Yd.set(t,[uu(o.providers.translate(n.event().text()))])})})])]),eventOrder:gt(lk,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:_u([jd.config({mode:"special",onLeft:n,onRight:n})]),lazySink:o.getSink,toggleClass:e+"--active",parts:{menu:Dg(0,t.columns,t.presets)},fetch:function(){return Jv.nu(t.fetch)}}))).asSpec()},jk=function(t,e,n,o){var i,u,r,a,c,s="basic"===n.type?function(){return V(n.data,function(t){return uS(t,o.isSelectedFor,o.getPreviewFor)})}:n.getData;return{items:(i=e,u=o,r=function(e,n,o){var r=i.shared.providers.translate(e.title);return"separator"===e.type?{type:"separator",text:r}:"submenu"===e.type?{type:"nestedmenuitem",text:r,disabled:o,getSubmenuItems:function(){return j(e.getStyleItems(),function(t){return a(t,n)})}}:e.getStylePreview().fold(function(){return{type:"togglemenuitem",text:r,active:e.isSelected(),disabled:o,onAction:u.onAction(e)}},function(t){return{type:"styleitem",item:{type:"togglemenuitem",text:r,disabled:o,active:e.isSelected(),onAction:u.onAction(e),meta:t}}})},a=function(t,e){var n="formatter"===t.type&&u.isInvalid(t);return 0===e?n?[]:[r(t,e,!1)]:[r(t,e,n)]},c=function(t){var e=u.shouldHide?0:1;return j(t,function(t){return a(t,e)})},{validateItems:c,getFetch:function(o,r){return function(t){var e=r(),n=c(e);t(Hp(n,dg.CLOSE_ON_EXECUTE,o.shared.providers))}}}),getStyleItems:s}},Uk=function(n,t,e,o){var r=jk(0,t,e,o),i=r.items,u=r.getStyleItems;return Pk({text:P.some(""),icon:P.none(),tooltip:P.from(o.tooltip),role:P.none(),fetch:i.getFetch(t,u),onAttach:o.nodeChangeHandler.map(function(e){return function(t){return n.on("nodeChange",e(t))}}).getOr(function(){}),onDetach:o.nodeChangeHandler.map(function(e){return function(t){return n.off("nodeChange",e(t))}}).getOr(function(){}),columns:1,presets:"normal",classes:["bespoke"]},"tox-tbtn",t.shared)};(Hz=Mz||(Mz={}))[Hz.SemiColon=0]="SemiColon",Hz[Hz.Space=1]="Space";var Wk,Gk,Xk=function(t,e,n,o){var r,i,u=xt(t.settings,e).getOr(n);return{type:"basic",data:(i=u,r=o===Mz.SemiColon?i.replace(/;$/,"").split(";"):i.split(" "),V(r,function(t){var e=t,n=t,o=t.split("=");return 1<o.length&&(e=o[0],n=o[1]),{title:e,format:n}}))}},Yk=[{title:"Left",icon:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}],qk=function(n,o){var t=P.some(function(e){return function(){var t=_(Yk,function(t){return n.formatter.match(t.format)}).fold(function(){return"Align"},function(t){return t.title});Cr(e,Nk,{text:o.shared.providers.translate(t)})}}),e={type:"basic",data:Yk};return Uk(n,o,e,{tooltip:"Align",isSelectedFor:function(t){return function(){return n.formatter.match(t)}},getPreviewFor:function(t){return function(){return P.none()}},onAction:function(t){return function(){n.undoManager.transact(function(){n.focus(),n.formatter.match(t.format)?n.formatter.remove(t.format):n.formatter.apply(t.format)})}},nodeChangeHandler:t,shouldHide:!1,isInvalid:function(t){return!n.formatter.canApply(t.format)}})},Kk=["-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Helvetica Neue","sans-serif"],Jk=function(r){var o=function(){var n=function(t){return t?t.split(",")[0]:""},t=r.queryCommandValue("FontName"),e=i.data,o=t?t.toLowerCase():"";return _(e,function(t){var e=t.format;return e.toLowerCase()===o||n(e).toLowerCase()===n(o).toLowerCase()}).orThunk(function(){return 0===(t=o).indexOf("-apple-system")&&(e=t.toLowerCase().split(/['"]?\s*,\s*['"]?/),W(Kk,function(t){return-1<e.indexOf(t.toLowerCase())}))?P.from({title:"System Font",format:o}):P.none();var t,e})},t=P.some(function(n){return function(){var t=r.queryCommandValue("FontName"),e=o().fold(function(){return t},function(t){return t.title});Cr(n,Nk,{text:e})}}),i=Xk(r,"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",Mz.SemiColon);return{tooltip:"Fonts",isSelectedFor:function(e){return function(){return o().exists(function(t){return t.format===e})}},getPreviewFor:function(t){return function(){return P.some({tag:"div",styleAttr:-1===t.indexOf("dings")?"font-family:"+t:""})}},onAction:function(t){return function(){r.undoManager.transact(function(){r.focus(),r.execCommand("FontName",!1,t.format)})}},nodeChangeHandler:t,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},$k=function(t,e){return/[0-9.]+px$/.test(t)?(n=72*parseInt(t,10)/96,o=e||0,r=Math.pow(10,o),Math.round(n*r)/r+"pt"):t;var n,o,r},Qk=function(i){var u=function(){var n=P.none(),o=a.data,r=i.queryCommandValue("FontSize");if(r)for(var t=function(t){var e=$k(r,t);n=_(o,function(t){return t.format===r||t.format===e})},e=3;n.isNone()&&0<=e;e--)t(e);return{matchOpt:n,px:r}},t=P.some(function(r){return function(){var t=u(),e=t.matchOpt,n=t.px,o=e.fold(function(){return n},function(t){return t.title});Cr(r,Nk,{text:o})}}),a=Xk(i,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",Mz.Space);return{tooltip:"Font Sizes",isSelectedFor:function(e){return function(){return u().matchOpt.exists(function(t){return t.format===e})}},getPreviewFor:function(){return function(){return P.none()}},onAction:function(t){return function(){i.undoManager.transact(function(){i.focus(),i.execCommand("FontSize",!1,t.format)})}},nodeChangeHandler:t,dataset:a,shouldHide:!1,isInvalid:function(){return!1}}},Zk=function(n,t,e){var o=e.parents,r=t();return Mt(o,function(e){return _(r,function(t){return n.formatter.matchNode(e,t.format)})}).orThunk(function(){return n.formatter.match("p")?P.some({title:"Paragraph",format:"p"}):P.none()})},tC=function(o){var t=P.some(function(n){return function(t){var e=Zk(o,function(){return r.data},t).fold(function(){return"Paragraph"},function(t){return t.title});Cr(n,Nk,{text:e})}}),r=Xk(o,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",Mz.SemiColon);return{tooltip:"Blocks",isSelectedFor:function(t){return function(){return o.formatter.match(t)}},getPreviewFor:function(e){return function(){var t=o.formatter.get(e);return P.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:o.formatter.getCssText(e)})}},onAction:function(t){return function(){o.undoManager.transact(function(){o.focus(),o.formatter.match(t.format)?o.formatter.remove(t.format):o.formatter.apply(t.format)})}},nodeChangeHandler:t,dataset:r,shouldHide:!1,isInvalid:function(t){return!o.formatter.canApply(t.format)}}},eC=function(i){return{tooltip:"Formats",isSelectedFor:function(t){return function(){return i.formatter.match(t)}},getPreviewFor:function(e){return function(){var t=i.formatter.get(e);return t!==undefined?P.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:i.formatter.getCssText(e)}):P.none()}},onAction:function(t){return function(){i.undoManager.transact(function(){i.focus(),i.formatter.match(t.format)?i.formatter.remove(t.format):i.formatter.apply(t.format)})}},nodeChangeHandler:P.some(function(n){var o=function(t){var e=t.items;return e!==undefined&&0<e.length?j(e,o):[{title:t.title,format:t.format}]},r=j(iS(i),o);return function(t){var e=Zk(i,function(){return r},t).fold(function(){return"Paragraph"},function(t){return t.title});Cr(n,Nk,{text:e})}}),shouldHide:i.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!i.formatter.canApply(t.format)}}},nC={file:{title:"File",items:"newdocument restoredraft | preview | 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 | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable tableprops deletetable row column cell"},help:{title:"Help",items:"help"}},oC=function(t,e,n,o){return Pk({text:t.text,icon:t.icon,tooltip:t.tooltip,role:o,fetch:function(e){t.fetch(function(t){e(Hp(t,dg.CLOSE_ON_EXECUTE,n.providers))})},onAttach:function(){},onDetach:function(){},columns:1,presets:"normal",classes:[]},e,n)},rC={formats:function(t,e){var n=e.styleselect,o=jk(0,e,n,eC(t));return{type:"nestedmenuitem",text:"Formats",getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}}},blockformats:function(t,e){var n=tC(t),o=jk(0,e,n.dataset,n);return{type:"nestedmenuitem",text:"Blocks",getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}}},fontformats:function(t,e){var n=Jk(t),o=jk(0,e,n.dataset,n);return{type:"nestedmenuitem",text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}}},fontsizes:function(t,e){var n=Qk(t),o=jk(0,e,n.dataset,n);return{type:"nestedmenuitem",text:"Font Sizes",getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}}}},iC=function(t){return"string"==typeof t?t.split(" "):t},uC=function(c,s,l){var f=vt(nC,s.menus),e=0<Q(s.menus).length,t=s.menubar===undefined||!0===s.menubar?iC("file edit view insert format tools table help"):iC(!1===s.menubar?"":s.menubar),n=A(t,function(t){return e&&s.menus.hasOwnProperty(t)&&s.menus[t].hasOwnProperty("items")||nC.hasOwnProperty(t)}),o=V(n,function(t){var e,n,o,r,i,u,a=f[t];return e={title:a.title,items:iC(a.items)},n=s,r=l,u=(i=o=c,i.getParam("removed_menuitems","")).split(/[ ,]/),{text:e.title,getItems:function(){return j(e.items,function(e){return 0===e.trim().length?[]:H(u,function(t){return t===e})?[]:"separator"===e||"|"===e?[{type:"separator"}]:n.menuItems[e]?[n.menuItems[e]]:rC[e]?[rC[e](o,r)]:[]})}}});return A(o,function(t){return 0<t.getItems().length})},aC=[{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"]}],cC=function(o,r){return function(t,e){var n=o(t).fold(g(ft.error,Wo),ft.value).getOrDie();return r(n,e)}},sC={button:cC(KS,function(t,e){return n=t,o=e.backstage.shared.providers,Mk(n,o,[]);var n,o}),togglebutton:cC(tk,function(t,e){return n=t,o=e.backstage.shared.providers,Hk(n,o,[]);var n,o}),menubutton:cC(function(t){return Po("menubutton",JS,t)},function(t,e){return oC(t,"tox-tbtn",e.backstage.shared,P.none())}),splitbutton:cC(function(t){return Po("SplitButton",$S,t)},function(t,e){return Ek(t,e.backstage.shared)}),styleSelectButton:function(t,e){return n=t,o=e.backstage,r=o.styleselect,Uk(n,o,r,eC(n));var n,o,r},fontsizeSelectButton:function(t,e){return n=t,o=e.backstage,r=Qk(n),Uk(n,o,r.dataset,r);var n,o,r},fontSelectButton:function(t,e){return n=t,o=e.backstage,r=Jk(n),Uk(n,o,r.dataset,r);var n,o,r},formatButton:function(t,e){return n=t,o=e.backstage,r=tC(n),Uk(n,o,r.dataset,r);var n,o,r},alignMenuButton:function(t,e){return qk(t,e.backstage)}},lC={styleselect:sC.styleSelectButton,fontsizeselect:sC.fontsizeSelectButton,fontselect:sC.fontSelectButton,formatselect:sC.formatButton,align:sC.alignMenuButton},fC=function(t){var e=t.split("|");return V(e,function(t){return{items:t.trim().split(" ")}})},dC=function(t){return!1===t.toolbar?[]:t.toolbar===undefined||!0===t.toolbar?(n=t.buttons,e=V(aC,function(t){var e=A(t.items,function(t){return it(n,t)||it(lC,t)});return{name:t.name,items:e}}),A(e,function(t){return 0<t.items.length})):x(t.toolbar)?fC(t.toolbar):O(t.toolbar)&&x(t.toolbar[0])?fC(t.toolbar.join(" | ")):t.toolbar;var n,e},mC=function(n,o,r){var t=dC(o),e=V(t,function(t){var e=j(t.items,function(t){return 0===t.trim().length?[]:xt(o.buttons,t.toLowerCase()).fold(function(){return xt(lC,t.toLowerCase()).map(function(t){return t(n,r)}).orThunk(function(){return console.error("No representation for toolbarItem: "+t),P.none()})},function(t){return n=r,xt(sC,(e=t).type).fold(function(){return console.error("skipping button defined by",e),P.none()},function(t){return P.some(t(e,n))});var e,n}).toArray()});return{title:P.from(n.translate(t.name)),items:e}});return A(e,function(t){return 0<t.items.length})},hC=function(i,t,u,c){var n,o,s=su((n={sink:u,onEscape:function(){return i.focus(),P.some(!0)}},o=Ct([]),Xm.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){o.set([]),Xm.getContent(t).each(function(t){Ji(t.element(),"visibility")}),Li(t.element(),Fk),Ji(t.element(),"width")},inlineBehaviours:_u([Tm("context-toolbar-events",[$r(Ut(),function(t,e){Xm.getContent(t).each(function(t){}),Li(t.element(),Fk),Ji(t.element(),"width")}),Wr(_k,function(e,n){Ji(e.element(),"width");var t=ea(e.element());Xm.setContent(e,n.event().contents()),_i(e.element(),Fk);var o=ea(e.element());Wi(e.element(),"width",t+"px"),Xm.getContent(e).each(function(t){n.event().focus().bind(function(t){return cf(t),lf(e.element())}).orThunk(function(){return jd.focusIn(t),sf()})}),setTimeout(function(){Wi(e.element(),"width",o+"px")},0)}),Wr(Bk,function(t,e){Xm.getContent(t).each(function(t){o.set(o.get().concat([{bar:t,focus:sf()}]))}),Cr(t,_k,{contents:e.event().forwardContents(),focus:P.none()})}),Wr(Dk,function(e,t){J(o.get()).each(function(t){o.set(o.get().slice(0,o.get().length-1)),Cr(e,_k,{contents:lu(t.bar),focus:t.focus})})})]),jd.config({mode:"special",onEscape:function(e){return J(o.get()).fold(function(){return n.onEscape()},function(t){return kr(e,Dk),P.some(!0)})}})]),lazySink:function(){return ft.value(n.sink)}}))),l=function(){return P.some(Ne.fromDom(i.contentAreaContainer))};i.on("init",function(){var t=i.getBody().ownerDocument.defaultView,e=Zg(Ne.fromDom(t),"scroll",function(){f.get().each(function(t){var e=d.get().getOr(i.selection.getNode()).getBoundingClientRect(),n=i.contentAreaContainer.getBoundingClientRect(),o=e.bottom<0,r=e.top>n.height;o||r?Wi(s.element(),"display","none"):(Ji(s.element(),"display"),is.positionWithin(u,t,s,l()))})});i.on("remove",function(){e.unbind()})});var f=Ct(P.none()),d=Ct(P.none()),e=Ct(null),m=function(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:_u([jd.config({mode:"acyclic"}),Tm("pop-dialog-wrap-events",[Qr(function(t){i.shortcuts.add("ctrl+F9","focus statusbar",function(){return jd.focusIn(t)})}),Zr(function(t){i.shortcuts.remove("ctrl+F9")})])])}},a=Gt(function(){return Rk(t,function(t){var e=h(t);Cr(s,Bk,{forwardContents:m(e)})})}),h=function(t){var e,n,o=i.ui.registry.getAll().buttons,r=a();return"contexttoolbar"===t.type?(e=vt(o,r.formNavigators),n=mC(i,{buttons:e,toolbar:t.items},c),XS({uid:Un("context-toolbar"),initGroups:n,onEscape:P.none,cyclicKeying:!0})):Ak(t,c.backstage.shared.providers)};i.on("contexttoolbar-show",function(e){var t=a();xt(t.lookupTable,e.toolbarKey).each(function(t){b(t,e.target===i?P.none():P.some(e)),Xm.getContent(s).each(jd.focusIn)})});var r={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"]},g={maxHeightFunction:La()},v={bubble:ja(12,0,r),layouts:{onLtr:function(){return[oc]},onRtl:function(){return[rc]}},overrides:g},p={bubble:ja(0,12,r),layouts:{onLtr:function(){return[ec,nc,Za,$a,tc,Qa]},onRtl:function(){return[ec,nc,tc,Qa,Za,$a]}},overrides:g},b=function(t,e){x();var n,o,r,i=h(t),u=e.map(Ne.fromDom),a=(n=t.position,o=u,r="node"===n?c.backstage.shared.anchors.node(o):c.backstage.shared.anchors.cursor(),gt(r,"line"===n?v:p));f.set(P.some(a)),d.set(e),Xm.showWithin(s,a,m(i),l()),Ji(s.element(),"display")},y=function(){var t=a();Ik(t,i).fold(function(){f.set(P.none()),Xm.hide(s)},function(t){b(t.toolbarApi,P.some(t.elem.dom()))})},x=function(){var t=e.get();null!==t&&(clearTimeout(t),e.set(null))},w=function(t){x(),e.set(t)};i.on("click keyup setContent ObjectResized ResizeEditor",function(t){w(IS.setEditorTimeout(i,y,0))}),i.on("nodeChange",function(t){lf(s.element()).fold(function(){w(IS.setEditorTimeout(i,y,0))},function(t){})})},gC=function(t,n,o){var e=Zg(Ne.fromDom(document),"mousedown",function(e){T([n,o],function(t){t.broadcastOn([Cs()],{target:e.target()})})}),r=Zg(Ne.fromDom(document),"touchstart",function(e){T([n,o],function(t){t.broadcastOn([Cs()],{target:e.target()})})}),i=Zg(Ne.fromDom(document),"mouseup",function(e){0===e.raw().button&&T([n,o],function(t){t.broadcastOn([Os()],{target:e.target()})})}),u=function(e){T([n,o],function(t){t.broadcastOn([Cs()],{target:Ne.fromDom(e.target)})})};t.on("mousedown",u),t.on("touchstart",u);var a=function(e){0===e.button&&T([n,o],function(t){t.broadcastOn([Os()],{target:Ne.fromDom(e.target)})})};t.on("mouseup",a);var c=Zg(Ne.fromDom(window),"scroll",function(e){T([n,o],function(t){t.broadcastEvent(Te(),e)})});t.on("remove",function(){t.off("mousedown",u),t.off("touchstart",u),t.off("mouseup",a),e.unbind(),r.unbind(),i.unbind(),c.unbind()}),t.on("detach",function(){gs(n),gs(o),n.destroy(),o.destroy()})},vC=Ol,pC=sl,bC=Al({factory:function(o,t){var e={focus:jd.focusIn,setMenus:function(t,e){var n=V(e,function(e){var t={text:P.some(e.text),icon:P.none(),tooltip:P.none(),fetch:function(t){t(e.getItems())}};return oC(t,"tox-mbtn",{getSink:o.getSink,providers:o.providers},P.some("menuitem"))});Yd.set(t,n)}};return{uid:o.uid,dom:o.dom,components:[],behaviours:_u([Yd.config({}),Tm("menubar-events",[Qr(function(t){o.onSetup(t)}),Wr(_t(),function(n,t){du(n.element(),".tox-mbtn--active").each(function(e){mu(t.event().target(),".tox-mbtn").each(function(t){nn(e,t)||n.getSystem().getByDom(e).each(function(e){n.getSystem().getByDom(t).each(function(t){Db.expand(t),Db.close(e),fm.focus(t)})})})})}),Wr(_e(),function(n,t){t.event().prevFocus().bind(function(t){return n.getSystem().getByDom(t).toOption()}).each(function(e){t.event().newFocus().bind(function(t){return n.getSystem().getByDom(t).toOption()}).each(function(t){Db.isOpen(e)&&(Db.expand(t),Db.close(e))})})})]),jd.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return o.onEscape(t),P.some(!0)}}),Xp.config({})]),apis:e,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Zo("dom"),Zo("uid"),Zo("onEscape"),Zo("getSink"),Zo("providers"),dr("onSetup",N)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),yC=function(e,t){return t.getAnimationRoot.fold(function(){return e.element()},function(t){return t(e)})},xC=function(t){return t.dimension.property},wC=function(t,e){return t.dimension.getDimension(e)},zC=function(t,e){var n=yC(t,e);Ni(n,[e.shrinkingClass,e.growingClass])},SC=function(t,e){Li(t.element(),e.openClass),_i(t.element(),e.closedClass),Wi(t.element(),xC(e),"0px"),$i(t.element())},kC=function(t,e){Li(t.element(),e.closedClass),_i(t.element(),e.openClass),Ji(t.element(),xC(e))},CC=function(t,e,n,o){n.setCollapsed(),Wi(t.element(),xC(e),wC(e,t.element())),$i(t.element()),zC(t,e),SC(t,e),e.onStartShrink(t),e.onShrunk(t)},OC=function(t,e,n,o){var r=o.getOrThunk(function(){return wC(e,t.element())});n.setCollapsed(),Wi(t.element(),xC(e),r),$i(t.element());var i=yC(t,e);Li(i,e.growingClass),_i(i,e.shrinkingClass),SC(t,e),e.onStartShrink(t)},MC=function(t,e,n){var o=wC(e,t.element());("0px"===o?CC:OC)(t,e,n,P.some(o))},HC=function(t,e,n){var o=yC(t,e),r=Ii(o,e.shrinkingClass),i=wC(e,t.element());kC(t,e);var u=wC(e,t.element());(r?function(){Wi(t.element(),xC(e),i),$i(t.element())}:function(){SC(t,e)})(),Li(o,e.shrinkingClass),_i(o,e.growingClass),kC(t,e),Wi(t.element(),xC(e),u),n.setExpanded(),e.onStartGrow(t)},EC=function(t,e,n){var o=yC(t,e);return!0===Ii(o,e.growingClass)},VC=function(t,e,n){var o=yC(t,e);return!0===Ii(o,e.shrinkingClass)},TC=Object.freeze({grow:function(t,e,n){n.isExpanded()||HC(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&MC(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&CC(t,e,n,P.none())},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:EC,isShrinking:VC,isTransitioning:function(t,e,n){return!0===EC(t,e)||!0===VC(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?MC:HC)(t,e,n)},disableTransitions:zC}),AC=Object.freeze({exhibit:function(t,e){var n=e.expanded;return zi(n?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:wt(e.dimension.property,"0px")})},events:function(n,o){return Pr([$r(Ut(),function(t,e){e.event().raw().propertyName===n.dimension.property&&(zC(t,n),o.isExpanded()&&Ji(t.element(),n.dimension.property),(o.isExpanded()?n.onGrown:n.onShrunk)(t))})])}}),BC=[Zo("closedClass"),Zo("openClass"),Zo("shrinkingClass"),Zo("growingClass"),ar("getAnimationRoot"),Su("onShrunk"),Su("onStartShrink"),Su("onGrown"),Su("onStartGrow"),dr("expanded",!1),tr("dimension",Go("property",{width:[Mu("property","width"),Mu("getDimension",function(t){return ea(t)+"px"})],height:[Mu("property","height"),Mu("getDimension",function(t){return ra(t)+"px"})]}))],DC=Lu({fields:BC,name:"sliding",active:AC,apis:TC,state:Object.freeze({init:function(t){var e=Ct(t.expanded);return xi({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:f(e.set,!1),setExpanded:f(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),_C="container",FC=[Vs("slotBehaviours",[])],LC=function(t){return"<alloy.field."+t+">"},IC=function(r,t,e){var n,o=function(t){return zl(r)},i=function(n,o){return void 0===o&&(o=undefined),function(t,e){return bl(t,r,e).map(function(t){return n(t,e)}).getOr(o)}},u=function(t,e){return"true"!==Mn(t.element(),"aria-hidden")},a=i(u,!1),c=i(function(t,e){if(u(t)){var n=t.element();Wi(n,"display","none"),Cn(n,"aria-hidden","true"),Cr(t,Fe(),{name:e,visible:!1})}}),s=(n=c,function(e,t){T(t,function(t){return n(e,t)})}),l=i(function(t,e){if(!u(t)){var n=t.element();Ji(n,"display"),En(n,"aria-hidden"),Cr(t,Fe(),{name:e,visible:!0})}}),f={getSlotNames:o,getSlot:function(t,e){return bl(t,r,e)},isShowing:a,hideSlot:c,hideAllSlots:function(t){return s(t,o())},showSlot:l};return{uid:r.uid,dom:r.dom,components:t,behaviours:Ts(r.slotBehaviours),apis:f}},RC=et({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)}},bi),NC=Gn({},RC,{sketch:function(t){var n,e=(n=[],{slot:function(t,e){return n.push(t),ml(_C,LC(t),e)},record:function(){return n}}),o=t(e),r=e.record(),i=V(r,function(t){return rl({name:t,pname:LC(t)})});return Hl(_C,FC,i,IC,o)}}),PC=function(t){return{element:function(){return t.element().dom()}}},jC=function(e){return NC.sketch(function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:(o=t,i=e,V(i,function(t){var e=t.name,n=t.settings;return o.slot(e,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Oh([Qr(function(t){n.onrender&&n.onrender(PC(t))}),Wr(Fe(),function(o,t){var r=t.event();_(i,function(t){return t.name===r.name()}).each(function(t){var e=t.settings,n=r.visible()?e.onshow:e.onhide;n&&n(PC(o))})})])})})),slotBehaviours:Oh([Qr(function(t){return NC.hideAllSlots(t)})])};var o,i})},UC=Un("FixSizeEvent"),WC=Un("AutoSizeEvent"),GC={setSidebar:function(t,e){Ll.getCurrent(t).each(function(t){return Yd.set(t,[jC(e)])})},toggleSidebar:function(t,n){Ll.getCurrent(t).each(function(e){Ll.getCurrent(e).each(function(t){DC.hasGrown(e)?NC.isShowing(t,n)?DC.shrink(e):(NC.hideAllSlots(t),NC.showSlot(t,n)):(NC.hideAllSlots(t),NC.showSlot(t,n),DC.grow(e))})})},whichSidebar:function(t){return Ll.getCurrent(t).bind(function(t){return DC.isGrowing(t)||DC.hasGrown(t)?Ll.getCurrent(t).bind(function(e){return _(NC.getSlotNames(e),function(t){return NC.isShowing(e,t)})}):P.none()})},renderSidebar: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:_u([Xp.config({}),fm.config({}),DC.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){Ll.getCurrent(t).each(NC.hideAllSlots),kr(t,WC)},onGrown:function(t){kr(t,WC)},onStartGrow:function(t){Cr(t,UC,{width:qi(t.element(),"width").getOr("")})},onStartShrink:function(t){Cr(t,UC,{width:ea(t.element())+"px"})}}),Yd.config({}),Ll.config({find:function(t){var e=Yd.contents(t);return K(e)}})])}],behaviours:_u([Ux(0),Tm("sidebar-sliding-events",[Wr(UC,function(t,e){Wi(t.element(),"width",e.event().width())}),Wr(WC,function(t,e){Ji(t.element(),"width")})])])}}},XC=pC.optional({factory:bC,name:"menubar",schema:[Zo("dom"),Zo("getSink")]}),YC=pC.optional({factory:{sketch:function(t){return XS({uid:t.uid,onEscape:function(){return t.onEscape(),P.some(!0)},cyclicKeying:!1,initGroups:[]})}},name:"toolbar",schema:[Zo("dom"),Zo("onEscape")]}),qC=pC.optional({name:"socket",schema:[Zo("dom")]}),KC=pC.optional({factory:{sketch:GC.renderSidebar},name:"sidebar",schema:[Zo("dom")]}),JC=Bl({name:"OuterContainer",factory:function(n,t,e){var o={getSocket:function(t){return vC.getPart(t,n,"socket")},setSidebar:function(t,e){vC.getPart(t,n,"sidebar").each(function(t){return GC.setSidebar(t,e)})},toggleSidebar:function(t,e){vC.getPart(t,n,"sidebar").each(function(t){return GC.toggleSidebar(t,e)})},whichSidebar:function(t){return vC.getPart(t,n,"sidebar").bind(GC.whichSidebar).getOrNull()},getToolbar:function(t){return vC.getPart(t,n,"toolbar")},setToolbar:function(t,e){vC.getPart(t,n,"toolbar").each(function(t){PS.setGroups(t,e)})},focusToolbar:function(t){vC.getPart(t,n,"toolbar").each(function(t){jd.focusIn(t)})},setMenubar:function(t,e){vC.getPart(t,n,"menubar").each(function(t){bC.setMenus(t,e)})},focusMenubar:function(t){vC.getPart(t,n,"menubar").each(function(t){bC.focus(t)})}};return{uid:n.uid,dom:n.dom,components:t,apis:o,behaviours:n.behaviours}},configFields:[Zo("dom"),Zo("behaviours")],partFields:[XC,YC,qC,KC],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)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var o=V(n,function(t){return GS(t)});t.setToolbar(e,o)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),$C=function(t){return t.fire("SkinLoaded")},QC=function(t){return t.fire("ResizeEditor")},ZC=function(t){var e=function(){t._skinLoaded=!0,$C(t)};return function(){t.initialized?e():t.on("init",e)}},tO=function(t,e){var n,o=function(t){var e=t.settings,n=e.skin,o=e.skin_url;if(!1!==n){var r=n||"oxide";o=o?t.documentBaseURI.toAbsolute(o):Sv.baseURL+"/skins/ui/"+r}return o}(e);o&&(n=o+"/skin.min.css",e.contentCSS.push(o+(t?"/content.inline":"/content")+".min.css")),0==(!1===e.getParam("skin"))&&n?zv.DOM.styleSheetLoader.load(n,ZC(e)):ZC(e)()},eO=f(tO,!1),nO=f(tO,!0),oO=function(t){return function(e){var n=t.outerContainer;en("*",n.element()).forEach(function(t){n.getSystem().getByDom(t).each(function(t){t.hasConfigured(og)&&("readonly"===e.mode?og.disable(t):og.enable(t))})})}},rO={render:function(n,o,t,e,r){var i,u;eO(n),i=Ne.fromDom(r.targetNode),u=o.mothership,hs(i,u,fn),ms(_r(),o.uiMothership),n.on("init",function(){JC.setToolbar(o.outerContainer,mC(n,t,{backstage:e})),JC.setMenubar(o.outerContainer,uC(n,t,e)),JC.setSidebar(o.outerContainer,n.sidebars||[]),n.readonly&&oO(o)({mode:"readonly"})});var a=JC.getSocket(o.outerContainer).getOrDie("Could not find expected socket element");return n.on("SwitchMode",oO(o)),n.getParam("readonly",!1,"boolean")&&n.setMode("readonly"),n.addCommand("ToggleSidebar",function(t,e){JC.toggleSidebar(o.outerContainer,e),n.fire("ToggleSidebar")}),n.addQueryValueHandler("ToggleSidebar",function(){return JC.whichSidebar(o.outerContainer)}),{iframeContainer:a.element().dom(),editorContainer:o.outerContainer.element().dom()}},getBehaviours:function(t){return[]}},iO=function(n,e){return an(n).orThunk(function(){var t=Ne.fromTag("span");ln(n,t);var e=an(t);return vn(t),e}).map(function(t){return qu(t).translate(-e.left(),-e.top())}).getOrThunk(function(){return Xu(0,0)})},uO=dt([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),aO=function(e){return function(t){return t.translate(-e.left(),-e.top())}},cO=function(e){return function(t){return t.translate(e.left(),e.top())}},sO=function(n){return function(t,e){return D(n,function(t,e){return e(t)},Xu(t,e))}},lO=function(t,e,n){return t.fold(sO([cO(n),aO(e)]),sO([aO(e)]),sO([]))},fO=function(t,e,n){return t.fold(sO([cO(n)]),sO([]),sO([cO(e)]))},dO=function(t,e,n){return t.fold(sO([]),sO([aO(n)]),sO([cO(e),aO(n)]))},mO=function(t,e,n){return t.fold(function(t,e){return{position:"absolute",left:t+"px",top:e+"px"}},function(t,e){return{position:"absolute",left:t-n.left()+"px",top:e-n.top()+"px"}},function(t,e){return{position:"fixed",left:t+"px",top:e+"px"}})},hO=uO.offset,gO=uO.absolute,vO=uO.fixed,pO=function(t,e){_i(t.element(),e.transitionClass),Li(t.element(),e.fadeOutClass),_i(t.element(),e.fadeInClass)},bO=function(t,e){_i(t.element(),e.transitionClass),Li(t.element(),e.fadeInClass),_i(t.element(),e.fadeOutClass)},yO=function(t,e){return t.y()>=e.y()&&t.bottom()<=e.bottom()},xO=function(t,e){return Hn(t,e)?P.some(parseInt(Mn(t,e),10)):P.none()},wO=function(o,r,i){return(u=o,t=r,e=u.element(),xO(e,t.leftAttr).bind(function(o){return xO(e,t.topAttr).map(function(t){var e=ea(u.element()),n=ra(u.element());return ya(o,t,e,n)})})).bind(function(t){return yO(t,i)?(e=r,n=o.element(),En(n,e.leftAttr),En(n,e.topAttr),P.some(gO(t.x(),t.y()))):P.none();var e,n});var u,t,e},zO=function(t,e,n,o,r){var i=qu(t.element()),u=ya(i.left(),i.top(),ea(t.element()),ra(t.element()));if(yO(u,n))return P.none();a=t,c=e,s=i.left(),l=i.top(),f=a.element(),Cn(f,c.leftAttr,s),Cn(f,c.topAttr,l);var a,c,s,l,f,d=gO(i.left(),i.top()),m=lO(d,o,r),h=gO(n.x(),n.y()),g=lO(h,o,r),v=u.y()<=n.y()?g.top():g.top()+n.height()-u.height();return P.some(vO(m.left(),v))},SO=function(i,t,e){var u=t.lazyViewport(i);t.contextual.each(function(r){r.lazyContext(i).each(function(t){var e,n,o=xa(t);n=u,((e=o).y()<n.bottom()&&e.bottom()>n.y()?pO:bO)(i,r)})});var n,o,r,a,c,s=on(i.element()),l=Ju(s),f=iO(i.element(),l);(n=i,o=t,r=u,a=l,c=f,qi(n.element(),"position").is("fixed")?wO(n,o,r):zO(n,o,r,a,c)).each(function(t){var e=mO(t,0,f);Gi(i.element(),e)})},kO=Object.freeze({refresh:SO}),CO=Object.freeze({events:function(o,t){return Pr([Wr(Ut(),function(e,n){o.contextual.each(function(t){nn(e.element(),n.event().target())&&(Li(e.element(),t.transitionClass),n.stop())})}),Wr(Te(),function(t,e){SO(t,o)})])}}),OO=[fr("contextual",[Zo("fadeInClass"),Zo("fadeOutClass"),Zo("transitionClass"),Zo("lazyContext")]),dr("lazyViewport",function(t){var e=Ju();return ya(e.left(),e.top(),window.innerWidth,window.innerHeight)}),Zo("leftAttr"),Zo("topAttr")],MO=Lu({fields:OO,name:"docking",active:CO,apis:kO}),HO={render:function(t,e,n,o,r){var i,u=zv.DOM;nO(t);var a=function(){qi(i.element(),"position").is("fixed")||Gi(i.element(),{top:qu(Ne.fromDom(t.getBody())).top()-ra(i.element())+"px",left:qu(Ne.fromDom(t.getBody())).left()+"px"}),MO.refresh(i)},c=function(){Wi(e.outerContainer.element(),"display","flex"),u.addClass(t.getBody(),"mce-edit-focus"),a(),MO.refresh(i)},s=function(){e.outerContainer&&(Wi(e.outerContainer.element(),"display","none"),u.removeClass(t.getBody(),"mce-edit-focus"))};return t.on("focus",function(){i?c():(i=e.outerContainer,ms(_r(),e.mothership),ms(_r(),e.uiMothership),JC.setToolbar(e.outerContainer,mC(t,n,{backstage:o})),JC.setMenubar(e.outerContainer,uC(t,n,o)),Gi(i.element(),{position:"absolute",top:qu(Ne.fromDom(t.getBody())).top()-ra(i.element())+"px",left:qu(Ne.fromDom(t.getBody())).left()+"px"}),a(),c(),t.on("nodeChange ResizeWindow",a),t.on("activate",c),t.on("deactivate",s),t.nodeChanged())}),t.on("blur hide",s),{editorContainer:e.outerContainer.element().dom()}},getBehaviours:function(e){return[MO.config({leftAttr:"data-dock-left",topAttr:"data-dock-top",contextual:{lazyContext:function(t){return P.from(e).map(function(t){return Ne.fromDom(t.getBody())})},fadeInClass:"tox-toolbar-dock-fadein",fadeOutClass:"tox-toolbar-dock-fadeout",transitionClass:"tox-toolbar-dock-transition"}}),fm.config({})]}},EO=function(t,e){return{anchor:"makeshift",x:t,y:e}},VO=function(t,e){var n,o,r,i=zv.DOM.getPos(t);return n=e,o=i.x,r=i.y,EO(n.x+o,n.y+r)},TO=function(t,e){return"contextmenu"===e.type?t.inline?EO((o=e).pageX,o.pageY):VO(t.getContentAreaContainer(),EO((n=e).clientX,n.clientY)):AO(t);var n,o},AO=function(t){return{anchor:"selection",root:Ne.fromDom(t.selection.getNode())}},BO=function(t){return"string"==typeof t?t.split(/[ ,]/):t},DO=function(t,e,n){var o,r,i=t.ui.registry.getAll().contextMenus;return(o=t.settings,r=e,it(o,r)?P.some(o[r]):P.none()).map(BO).getOrThunk(function(){return A(BO(n),function(t){return it(i,t)})})},_O=function(t){return t.settings.contextmenu_never_use_native||!1},FO=function(t){return DO(t,"contextmenu","link image imagetools table spellchecker configurepermanentpen")},LO=function(t){return x(t)?"|"===t:"separator"===t.type},IO={type:"separator"},RO=function(e){if(x(e))return e;switch(e.type){case"separator":return IO;case"submenu":return{type:"nestedmenuitem",text:e.text,icon:e.icon,getSubmenuItems:function(){var t=e.getSubmenuItems();return x(t)?t:V(t,RO)}};default:return{type:"menuitem",text:e.text,icon:e.icon,onAction:(n=e.onAction,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n()})}}var n},NO=function(t,e){if(0===e.length)return t;var n=J(t).filter(function(t){return!LO(t)}).fold(function(){return[]},function(t){return[IO]});return t.concat(n).concat(e).concat([IO])},PO=function(d,t,m){var h=su(Xm.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return d.focus()},fireDismissalEventInstead:{},inlineBehaviours:_u([Tm("dismissContextMenu",[Wr(De(),function(t,e){ks.close(t),d.focus()})])])}));d.on("contextmenu",function(t){if(e=d,!t.ctrlKey||_O(e)){var e,n,r,i,o,u=2!==t.button||t.target===d.getBody(),a=u?(n=d,{anchor:"node",node:P.some(Ne.fromDom(n.selection.getNode())),root:Ne.fromDom(n.getBody())}):TO(d,t),c=d.ui.registry.getAll(),s=FO(d),l=u?d.selection.getStart(!0):t.target,f=(r=c.contextMenus,i=l,0<(o=D(s,function(t,e){if(it(r,e)){var n=r[e].update(i);if(x(n))return NO(t,n.split(" "));if(0<n.length){var o=V(n,RO);return NO(t,o)}return t}return t.concat([e])},[])).length&&LO(o[o.length-1])&&o.pop(),o);0<f.length&&(t.preventDefault(),Xm.showMenuAt(h,a,{menu:{markers:Ag("normal")},data:Hp(f,dg.CLOSE_ON_EXECUTE,m.providers)}))}})},jO=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?P.some(parseInt(t,10)):P.none()},UO=function(t){return k(t)?t+"px":t},WO="data-initial-z-index",GO=function(t,e){var n;t.getSystem().addToGui(e),un((n=e).element()).each(function(e){qi(e,"z-index").each(function(t){Cn(e,WO,t)}),Wi(e,"z-index",Xi(n.element(),"z-index"))})},XO=function(t){un(t.element()).each(function(t){var e=Mn(t,WO);Hn(t,WO)?Wi(t,"z-index",e):Ji(t,"z-index"),En(t,WO)}),t.getSystem().removeFromGui(t)},YO=function(t,e,n,o){return(r=t,i=e,u=r.element(),a=parseInt(Mn(u,i.leftAttr),10),c=parseInt(Mn(u,i.topAttr),10),isNaN(a)||isNaN(c)?P.none():P.some(Xu(a,c))).fold(function(){return n},function(t){return vO(t.left()+o.left(),t.top()+o.top())});var r,i,u,a,c},qO=function(t,e,n,o,r,i){var u,a,c,s=YO(t,e,n,o),l=JO(t,e,s,r,i),f=lO(s,r,i);return u=e,a=f,c=t.element(),Cn(c,u.leftAttr,a.left()+"px"),Cn(c,u.topAttr,a.top()+"px"),l.fold(function(){return{coord:vO(f.left(),f.top()),extra:P.none()}},function(t){return{coord:t.output(),extra:t.extra()}})},KO=function(t,e){var n,o;n=e,o=t.element(),En(o,n.leftAttr),En(o,n.topAttr)},JO=function(t,e,g,v,p){var n=e.getSnapPoints(t);return Mt(n,function(t){var e,n,o,r,i,u,a,c,s,l,f,d,m,h=t.sensor();return e=g,n=h,o=t.range().left(),r=t.range().top(),a=fO(e,i=v,u=p),c=fO(n,i,u),Math.abs(a.left()-c.left())<=o&&Math.abs(a.top()-c.top())<=r?P.some({output:U((s=t.output(),l=g,f=v,d=p,m=function(o,r){return function(t,e){var n=o(l,f,d);return r(t.getOr(n.left()),e.getOr(n.top()))}},s.fold(m(dO,uO.offset),m(fO,uO.absolute),m(lO,uO.fixed)))),extra:t.extra}):P.none()})},$O=function(n,t,i,u,a,c){return t.fold(function(){var t,n,o,e=(t=i,n=c.left(),o=c.top(),t.fold(function(t,e){return uO.offset(t+n,e+o)},function(t,e){return uO.absolute(t+n,e+o)},function(t,e){return uO.fixed(t+n,e+o)})),r=lO(e,u,a);return vO(r.left(),r.top())},function(e){var t=qO(n,e,i,c,u,a);return t.extra.each(function(t){e.onSensor(n,t)}),t.coord})},QO=function(t,e,n){var o,r=e.getTarget(t.element());if(e.repositionTarget){var i=on(t.element()),u=Ju(i),a=iO(r,u),c=qi(o=r,"left").bind(function(n){return qi(o,"top").bind(function(e){return qi(o,"position").map(function(t){return("fixed"===t?vO:hO)(parseInt(n,10),parseInt(e,10))})})}).getOrThunk(function(){var t=qu(o);return gO(t.left(),t.top())}),s=$O(t,e.snaps,c,u,a,n),l=mO(s,0,a);Gi(r,l)}e.onDrag(t,r,n)},ZO=fr("snaps",[Zo("getSnapPoints"),Su("onSensor"),Zo("leftAttr"),Zo("topAttr"),dr("lazyViewport",function(){var t=Ju();return{x:t.left,y:t.top,width:U(window.innerWidth),height:U(window.innerHeight),bottom:U(t.top()+window.innerHeight),right:U(t.left()+window.innerWidth)}})]),tM=Object.freeze({getData:function(t){return P.from(Xu(t.x(),t.y()))},getDelta:function(t,e){return Xu(e.left()-t.left(),e.top()-t.top())}}),eM=[dr("useFixed",!1),Zo("blockerClass"),dr("getTarget",d),dr("onDrag",N),dr("repositionTarget",!0),Su("onDrop"),ZO,Mu("dragger",{handlers:function(a,c){return Pr([Wr(Tt(),function(e,t){if(0===t.event().raw().button){t.stop();var n,o={drop:function(){i()},delayDrop:function(){u.schedule()},forceDrop:function(){i()},move:function(t){u.cancel(),c.update(tM,t).each(function(t){QO(e,a,t)})}},r=e.getSystem().build(xv.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[a.blockerClass]},events:(n=o,Pr([Wr(Tt(),n.forceDrop),Wr(Dt(),n.drop),Wr(At(),function(t,e){n.move(e.event())}),Wr(Bt(),n.delayDrop)]))})),i=function(){XO(r),a.snaps.each(function(t){KO(e,t)});var t=a.getTarget(e.element());a.onDrop(e,t)},u=nv(i,200);c.reset(),GO(e,r)}})])}})],nM=Object.freeze({getData:function(t){var e,n=t.raw().touches;return 1===n.length?(e=n[0],P.some(Xu(e.clientX,e.clientY))):P.none()},getDelta:function(t,e){return Xu(e.left()-t.left(),e.top()-t.top())}}),oM=eM,rM=[dr("useFixed",!1),dr("getTarget",d),dr("onDrag",N),dr("repositionTarget",!0),dr("onDrop",N),ZO,Mu("dragger",{handlers:function(o,r){return Pr([Jr(Ht()),Wr(Et(),function(e,t){t.stop(),r.update(nM,t.event()).each(function(t){QO(e,o,t)})}),Wr(Vt(),function(e,t){o.snaps.each(function(t){KO(e,t)});var n=o.getTarget(e.element());r.reset(),o.onDrop(e,n)})])}})],iM=Object.freeze({mouse:oM,touch:rM}),uM=Object.freeze({init:function(){var i=P.none(),t=U({});return xi({readState:t,reset:function(){i=P.none()},update:function(r,t){return r.getData(t).bind(function(t){return e=r,n=t,o=i.map(function(t){return e.getDelta(t,n)}),i=P.some(n),o;var e,n,o})}})}}),aM=Ru({branchKey:"mode",branches:iM,name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:We(["sensor","range","output"],["extra"])},state:uM});(Gk=Wk||(Wk={}))[Gk.None=0]="None",Gk[Gk.Both=1]="Both",Gk[Gk.Vertical=2]="Vertical";var cM,sM,lM,fM,dM,mM=function(t,e,n,o){var r=t+e,i=n.filter(function(t){return r<t}),u=o.filter(function(t){return t<r});return i.or(u).getOr(r)},hM=function(t,e,n,o,r){var i,u,a={};return a.height=mM(o,e.top(),Cv(t),(i=t,P.from(i.getParam("max_height")).filter(k))),n===Wk.Both&&(a.width=mM(r,e.left(),kv(t),(u=t,P.from(u.getParam("max_width")).filter(k)))),a},gM=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},vM=function(i,u){return u.delimiter||(u.delimiter="\xbb"),{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:_u([jd.config({mode:"flow",selector:"div[role=button]"}),Xp.config({}),Yd.config({}),Tm("elementPathEvents",[Qr(function(r,t){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return jd.focusIn(r)}),i.on("nodeChange",function(t){var e,o,n=function(t){for(var e=[],n=t.length;0<n--;){var o=t[n];if(1===o.nodeType&&!gM(o)){var r=i.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(r.isDefaultPrevented()||e.push({name:r.name,element:o}),r.isPropagationStopped())break}}return e}(t.parents);0<n.length&&Yd.set(r,(e=V(n||[],function(e,t){return qm.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":t,"tab-index":-1,"aria-level":t+1},innerHtml:e.name},action:function(t){i.focus(),i.selection.select(e.element),i.nodeChanged()}})}),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+u.delimiter+" "}},D(e.slice(1),function(t,e){var n=t;return n.push(o),n.push(e),n},[e[0]])))})})])]),components:[]}},pM=function(s,t){var e,n,o,r,i,u,a,c,l,f,d,m=function(c){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:t.translate("Resize")},innerHtml:Qm("resize-handle",t.icons)},behaviours:_u([aM.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,e,n){var o,r,i,u,a;o=s,r=n,i=c,u=Ne.fromDom(o.getContainer()),a=hM(o,r,i,o.getContainer().scrollHeight,ea(u)),tt(a,function(t,e){return Wi(u,e,t+"px")}),QC(o)},blockerClass:"tox-blocker"})])}};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(d=[],s.getParam("elementpath",!0,"boolean")&&d.push(vM(s,{})),le(s.settings.plugins,"wordcount")&&d.push((u=s,a=t,l=function(t,e,n){return Yd.set(t,[uu(a.translate(["{0} "+n,e[n]]))])},qm.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:_u([Xp.config({}),Yd.config({}),um.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Tm("wordcount-events",[Wr(jt(),function(t){var e=um.getValue(t),n="words"===e.mode?"characters":"words";um.setValue(t,{mode:n,count:e.count}),l(t,e.count,n)}),Qr(function(n){u.on("wordCountUpdate",function(t){var e=um.getValue(n).mode;um.setValue(n,{mode:e,count:t.wordCount}),l(n,t.wordCount,e)})})])]),eventOrder:(c={},c[jt()]=["wordcount-events","alloy.base.behaviour"],c)}))),s.getParam("branding",!0,"boolean")&&d.push((f='<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="'+Lh.translate(["Powered by {0}","Tiny"])+'">Tiny</a>',{dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:Lh.translate(["Powered by {0}",f])}})),r=0<d.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:d}]:[],n=!le((e=s).settings.plugins,"autoresize"),i=!1===(o=e.getParam("resize",n))?Wk.None:"both"===o?Wk.Both:Wk.Vertical,i!==Wk.None&&r.push(m(i)),r)}},bM=function(f){var t,e,n=f.getParam("inline",!1,"boolean"),s=n?HO:rO,o=P.none(),r=Lh.isRtl()?{attributes:{dir:"rtl"}}:{},l=su({dom:Gn({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"]},r),behaviours:_u([is.config({useFixed:!1})])}),i=Km({dom:{tag:"div",classes:["tox-anchorbar"]}}),d=LS(l,f,function(){return o.bind(function(t){return i.getOpt(t)}).getOrDie("Could not find a toolbar element")}),m=function(){return ft.value(l)},u=JC.parts().menubar({dom:{tag:"div",classes:["tox-menubar"]},getSink:m,providers:d.shared.providers,onEscape:function(){f.focus()}}),a=JC.parts().toolbar({dom:{tag:"div",classes:["tox-toolbar"]},onEscape:function(){f.focus()}}),c=JC.parts().socket({dom:{tag:"div",classes:["tox-edit-area"]}}),h=JC.parts().sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),g=f.getParam("statusbar",!0,"boolean")&&!n?P.some(pM(f,d.shared.providers)):P.none(),v={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[c,h]},p=(e=(t=f).getParam("toolbar"),(O(e)?0<e.length:!1!==t.getParam("toolbar",!0,"boolean"))||Ov(f).isSome()),b=!1!==f.getParam("menubar",!0,"boolean"),y=R([b?[u]:[],p?[a]:[],[i.asSpec()],n?[]:[v]]),x=R([[{dom:{tag:"div",classes:["tox-editor-container"]},components:y}],n?[]:g.toArray()]),w=Gn({role:"application"},Lh.isRtl()?{dir:"rtl"}:{}),z=su(JC.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(n?["tox-tinymce-inline"]:[]),styles:{visibility:"hidden"},attributes:w},components:x,behaviours:_u(s.getBehaviours(f).concat([jd.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-sidebar--sliding-open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a"})]))}));o=P.some(z),f.shortcuts.add("alt+F9","focus menubar",function(){JC.focusMenubar(z)}),f.shortcuts.add("alt+F10","focus toolbar",function(){JC.focusToolbar(z)});var S=wv(z),k=wv(l);gC(f,S,k);var C=function(t){var e,n=zv.DOM,o=f.getParam("width",n.getStyle(t,"width")),r=(e=f).getParam("height",Math.max(e.getElement().offsetHeight,200)),i=kv(f),u=Cv(f),a=jO(o).bind(function(e){return UO(i.map(function(t){return Math.max(e,t)}))}).getOr(UO(o)),c=jO(r).bind(function(e){return u.map(function(t){return Math.max(e,t)})}).getOr(r),s=UO(a);if(Ki("div","width",s)&&Wi(z.element(),"width",s),!f.inline){var l=UO(c);Ki("div","height",l)?Wi(z.element(),"height",l):Wi(z.element(),"height","200px")}return c};return{mothership:S,uiMothership:k,backstage:d,renderUI:function(){PO(f,m,d.shared);var t=f.ui.registry.getAll(),e=t.buttons,n=t.menuItems,o=t.contextToolbars,r={menuItems:n,buttons:e,menus:f.settings.menu?et(f.settings.menu,function(t){return vt(t,{items:t.items})}):{},menubar:f.settings.menubar,toolbar:Ov(f).getOr(f.getParam("toolbar",!0)),sidebar:f.sidebars?f.sidebars:[]};hC(f,o,l,{backstage:d});var i=f.getElement(),u=C(i),a={mothership:S,uiMothership:k,outerContainer:z},c={targetNode:i,height:u};return s.render(f,a,r,d,c)},getUi:function(){return{channels:{broadcastAll:k.broadcast,broadcastOn:k.broadcastOn,register:function(){}}}}}},yM=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},xM=function(n){var t=[{type:"menuitem",text:"Left",icon:"align-left",onAction:yM(n,"alignleft")},{type:"menuitem",text:"Center",icon:"align-center",onAction:yM(n,"aligncenter")},{type:"menuitem",text:"Right",icon:"align-right",onAction:yM(n,"alignright")},{type:"menuitem",text:"Justify",icon:"align-justify",onAction:yM(n,"alignjustify")}];n.ui.registry.addNestedMenuItem("align",{text:"Align",icon:"align-left",getSubmenuItems:function(){return t}});var e=function(e){return function(t){return n.formatter?n.formatter.formatChanged(e.name,t.setActive):n.on("init",function(){n.formatter.formatChanged(e.name,t.setActive)}),function(){}}};zz.each([{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(t){n.ui.registry.addToggleButton(t.name,{tooltip:t.text,onAction:function(){return n.execCommand(t.cmd)},icon:t.icon,onSetup:e(t)})});var o={name:"alignnone",text:"No alignment",cmd:"JustifyNone",icon:"align-justify"};n.ui.registry.addButton(o.name,{tooltip:o.text,onAction:function(){return n.execCommand(o.cmd)},icon:o.icon,onSetup:e(o)})},wM=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},zM=function(i,u){return function(e){var t,n,o,r;return n=u,o=function(t){e.setActive(t)},r=function(t){o(t,n)},(t=i).formatter?t.formatter.formatChanged(n,r):t.on("init",function(){t.formatter.formatChanged(n,r)}),function(){}}},SM=function(t){var e,n,o;e=t,zz.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(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:zM(e,t.name),onAction:wM(e,t.name)})}),n=t,zz.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(t){n.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return n.execCommand(t.action)}})}),o=t,zz.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(t){o.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return o.execCommand(t.action)},onSetup:zM(o,t.name)})})},kM=function(t){var e;SM(t),e=t,zz.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(t){e.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:function(){return e.execCommand(t.action)}})}),e.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:wM(e,"code")})},CM=function(t,e,n){var o=function(){return!!e.undoManager&&e.undoManager[n]()},r=function(){t.setDisabled(e.readonly||!o())};return t.setDisabled(!o()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r),function(){return e.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r)}},OM=function(t){var e,n;(e=t).ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(t){return CM(t,e,"hasUndo")},onAction:function(){return e.execCommand("undo")}}),e.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(t){return CM(t,e,"hasRedo")},onAction:function(){return e.execCommand("redo")}}),(n=t).ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(t){return CM(t,n,"hasUndo")},onAction:function(){return n.execCommand("undo")}}),n.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(t){return CM(t,n,"hasRedo")},onAction:function(){return n.execCommand("redo")}})},MM=function(t){var e,n;(e=t).ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return e.execCommand("mceToggleVisualAid")}}),(n=t).ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(t){return function(e,t){e.setActive(t.hasVisual);var n=function(t){e.setActive(t.hasVisual)};return t.on("VisualAid",n),function(){return t.off("VisualAid",n)}}(t,n)},onAction:function(){n.execCommand("mceToggleVisualAid")}})},HM=function(t){var r;(r=t).ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(t){return e=t,o=function(){e.setDisabled(!n.queryCommandState("outdent"))},(n=r).on("NodeChange",o),function(){return n.off("NodeChange",o)};var e,n,o},onAction:function(){return r.execCommand("outdent")}}),r.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return r.execCommand("indent")}})},EM=function(t){xM(t),kM(t),OM(t),Tb.register(t),MM(t),HM(t)},VM=function(t,e){var n=P.from(Mn(t,"id")).fold(function(){var t=Un("dialog-label");return Cn(e,"id",t),t},d);Cn(t,"aria-labelledby",n)},TM=U([Zo("lazySink"),ar("dragBlockClass"),dr("useTabstopAt",U(!0)),dr("eventOrder",{}),Vs("modalBehaviours",[jd]),ku("onExecute"),Ou("onEscape")]),AM={sketch:d},BM=U([ul({name:"draghandle",overrides:function(t,e){return{behaviours:_u([aM.config({mode:"mouse",getTarget:function(t){return fu(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"+xo(e,null,2)).message)})])}}}),rl({schema:[Zo("dom")],name:"title"}),rl({factory:AM,schema:[Zo("dom")],name:"close"}),rl({factory:AM,schema:[Zo("dom")],name:"body"}),rl({factory:AM,schema:[Zo("dom")],name:"footer"}),il({factory:{sketch:function(t,e){return Gn({},t,{dom:e.dom,components:e.components})}},schema:[dr("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),dr("components",[])],name:"blocker"})]),DM=Bl({name:"ModalDialog",configFields:TM(),partFields:BM(),factory:function(o,t,e,r){var a=Un("alloy.dialog.busy"),c=Un("alloy.dialog.idle"),s=_u([jd.config({mode:"special",onTab:function(){return P.some(!0)},onShiftTab:function(){return P.some(!0)}}),fm.config({})]),n=Un("modal-events"),i=Gn({},o.eventOrder,{"alloy.system.attached":[n].concat(o.eventOrder["alloy.system.attached"]||[])});return{uid:o.uid,dom:o.dom,components:t,apis:{show:function(i){var t=o.lazySink(i).getOrDie(),u=Ct(P.none()),e=r.blocker(),n=t.getSystem().build(Gn({},e,{components:e.components.concat([lu(i)]),behaviours:_u([Tm("dialog-blocker-events",[Wr(c,function(t,e){Hn(i.element(),"aria-busy")&&(En(i.element(),"aria-busy"),u.get().each(function(t){return Yd.remove(i,t)}))}),Wr(a,function(t,e){Cn(i.element(),"aria-busy","true");var n=e.event().getBusySpec();u.get().each(function(t){Yd.remove(i,t)});var o=n(i,s),r=t.getSystem().build(o);u.set(P.some(r)),Yd.append(i,lu(r)),r.hasConfigured(jd)&&jd.focusIn(r)})])])}));cs(t,n),jd.focusIn(i)},hide:function(e){un(e.element()).each(function(t){e.getSystem().getByDom(t).each(function(t){fs(t)})})},getBody:function(t){return yl(t,o,"body")},getFooter:function(t){return yl(t,o,"footer")},setIdle:function(t){kr(t,c)},setBusy:function(t,e){Cr(t,a,{getBusySpec:e})}},eventOrder:i,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:As(o.modalBehaviours,[Yd.config({}),jd.config({mode:"cyclic",onEnter:o.onExecute,onEscape:o.onEscape,useTabstopAt:o.useTabstopAt}),Tm(n,[Qr(function(t){VM(t.element(),yl(t,o,"title").element())})])])}},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)}}}),_M=[er("type"),er("text"),nr("level",["info","warn","error","success"]),er("icon"),dr("url","")],FM=[er("type"),er("text"),pr("primary",!1),_o("name","name",Zn(function(){return Un("button-name")}),Ko),sr("icon")],LM=[er("type"),er("name"),er("label")],IM=Jo,RM=[er("type"),er("name"),sr("label")],NM=RM,PM=Ko,jM=RM,UM=Ko,WM=RM,GM=Vo(Io),XM=RM.concat([pr("sandboxed",!0)]),YM=Ko,qM=RM.concat([sr("placeholder")]),KM=Ko,JM=RM.concat([ir("items",[er("text"),er("value")]),hr("size",1)]),$M=Ko,QM=RM.concat([pr("constrain",!0)]),ZM=Eo([er("width"),er("height")]),tH=RM.concat([sr("placeholder")]),eH=Ko,nH=RM.concat([vr("filetype","file",["image","media","file"])]),oH=Eo([er("value"),dr("meta",{})]),rH=RM.concat([er("type"),gr("tag","textarea"),or("init")]),iH=Ko,uH=[er("type"),er("html")],aH=RM.concat([tr("currentState",Eo([Zo("blob"),er("url")]))]),cH=RM.concat([dr("columns",1)]),sH=(cM=[er("value"),sr("text"),sr("icon")],Bo(cM)),lH=[er("type"),ur("header",Ko),ur("cells",Vo(Ko))],fH=function(e){return _o("items","items",$n(),Vo(Ro(function(t){return Po("Checking item of "+e,dH,t).fold(function(t){return ft.error(Wo(t))},function(t){return ft.value(t)})})))},dH=Go("type",{alertbanner:_M,bar:(dM=fH("bar"),[er("type"),dM]),button:FM,checkbox:LM,colorinput:NM,colorpicker:jM,dropzone:WM,grid:(lM=fH("grid"),[er("type"),(fM="columns",tr(fM,qo)),lM]),iframe:XM,input:qM,selectbox:JM,sizeinput:QM,textarea:tH,urlinput:nH,customeditor:rH,htmlpanel:uH,imagetools:aH,collection:cH,label:(sM=fH("label"),[er("type"),er("label"),sM]),table:lH}),mH=[er("type"),ur("items",dH)],hH=[er("title"),ur("items",dH)],gH=[er("type"),ir("tabs",hH)],vH=Eo([nr("type",["submit","cancel","custom"]),_o("name","name",Zn(function(){return Un("button-name")}),Ko),er("text"),sr("icon"),vr("align","end",["start","end"]),pr("primary",!1),pr("disabled",!1)]),pH=Eo([er("title"),tr("body",Go("type",{panel:mH,tabpanel:gH})),gr("size","normal"),ur("buttons",vH),dr("initialData",{}),br("onAction",N),br("onChange",N),br("onSubmit",N),br("onClose",N),br("onCancel",N),dr("onTabChange",N),ar("readyWhen")]),bH=function(t){return w(t)?[t].concat(j(rt(t),bH)):O(t)?j(t,bH):[]},yH=function(t){return x(t.type)&&x(t.name)},xH={checkbox:IM,colorinput:PM,colorpicker:UM,dropzone:GM,input:KM,iframe:YM,sizeinput:ZM,selectbox:$M,size:ZM,textarea:eH,urlinput:oH,customeditor:iH,collection:sH},wH=function(t){var e=j(A(bH(t),yH),function(e){return(t=e,P.from(xH[t.type])).fold(function(){return[]},function(t){return[tr(e.name,t)]});var t});return Eo(e)},zH=function(t){return{internalDialog:jo(Po("dialog",pH,t)),dataValidator:wH(t),initialData:t.initialData}},SH={open:function(t,e){var n=zH(e);return t(n.internalDialog,n.initialData,n.dataValidator)},redial:function(t){return zH(t)}},kH=Un("update-dialog"),CH=Un("update-title"),OH=Un("update-body"),MH=Un("update-footer"),HH=function(t){var n=[],o={};return tt(t,function(t,e){t.fold(function(){n.push(e)},function(t){o[e]=t})}),0<n.length?ft.error(n):ft.value(o)},EH=Al({name:"TabButton",configFields:[dr("uid",undefined),Zo("value"),_o("dom","dom",to(function(t){return{attributes:{role:"tab",id:Un("aria"),"aria-selected":"false"}}}),Xo()),ar("action"),dr("domModification",{}),Vs("tabButtonBehaviours",[fm,jd,um]),Zo("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Ym(t.action),behaviours:As(t.tabButtonBehaviours,[fm.config({}),jd.config({mode:"execution",useSpace:!0,useEnter:!0}),um.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),VH=U([Zo("tabs"),Zo("dom"),dr("clickToDismiss",!1),Vs("tabbarBehaviours",[Jl,jd]),wu(["tabClass","selectedClass"])]),TH=al({factory:EH,name:"tabs",unit:"tab",overrides:function(o,t){var r=function(t,e){Jl.dehighlight(t,e),Cr(t,Ie(),{tabbar:t,button:e})},i=function(t,e){Jl.highlight(t,e),Cr(t,Le(),{tabbar:t,button:e})};return{action:function(t){var e=t.getSystem().getByUid(o.uid).getOrDie(),n=Jl.isHighlighted(e,t);(n&&o.clickToDismiss?r:n?N:i)(e,t)},domModification:{classes:[o.markers.tabClass]}}}}),AH=U([TH]),BH=Bl({name:"Tabbar",configFields:VH(),partFields:AH(),factory:function(t,e,n,o){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:As(t.tabbarBehaviours,[Jl.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){Cn(e.element(),"aria-selected","true")},onDehighlight:function(t,e){Cn(e.element(),"aria-selected","false")}}),jd.config({mode:"flow",getInitial:function(t){return Jl.getHighlighted(t).map(function(t){return t.element()})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),DH=Al({name:"Tabview",configFields:[Vs("tabviewBehaviours",[Yd])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:As(t.tabviewBehaviours,[Yd.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),_H=U([dr("selectFirst",!0),Su("onChangeTab"),Su("onDismissTab"),dr("tabs",[]),Vs("tabSectionBehaviours",[])]),FH=rl({factory:BH,schema:[Zo("dom"),rr("markers",[Zo("tabClass"),Zo("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),LH=rl({factory:DH,name:"tabview"}),IH=U([FH,LH]),RH=Bl({name:"TabSection",configFields:_H(),partFields:IH(),factory:function(i,t,e,n){var o=function(t,e){bl(t,i,"tabbar").each(function(t){e(t).each(Or)})};return{uid:i.uid,dom:i.dom,components:t,behaviours:Ts(i.tabSectionBehaviours),events:Pr(R([i.selectFirst?[Qr(function(t,e){o(t,Jl.getFirst)})]:[],[Wr(Le(),function(t,e){var o,r,n=e.event().button();o=n,r=um.getValue(o),bl(o,i,"tabview").each(function(n){_(i.tabs,function(t){return t.value===r}).each(function(t){var e=t.view();Cn(n.element(),"aria-labelledby",Mn(o.element(),"id")),Yd.set(n,e),i.onChangeTab(n,o,e)})})}),Wr(Ie(),function(t,e){var n=e.event().button();i.onDismissTab(t,n)})]])),apis:{getViewItems:function(t){return bl(t,i,"tabview").map(function(t){return Yd.contents(t)}).getOr([])},showTab:function(t,n){o(t,function(e){var t=Jl.getCandidates(e);return _(t,function(t){return um.getValue(t)===n}).filter(function(t){return!Jl.isHighlighted(e,t)})})}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),NH=function(t){return K((e=t,n=function(t,e){return e<t?-1:t<e?1:0},(o=G.call(e,0)).sort(n),o));var e,n,o},PH=function(u){return{smartTabHeight:{extraEvents:[Qr(function(t){du(t.element(),'[role="tabpanel"]').each(function(n){var e;Wi(n,"visibility","hidden"),t.getSystem().getByDom(n).toOption().bind(function(t){var o,r,i,e=(r=n,i=t,V(o=u,function(t,e){Yd.set(i,o[e].view());var n=r.dom().getBoundingClientRect();return Yd.set(i,[]),n.height}));return NH(e)}).each(function(t){Wi(n,"height",t+"px")}),Ji(n,"visibility"),e=t,K(u).each(function(t){return RH.showTab(e,t.value)})})}),Wr(_v,function(t,e){du(t.element(),'[role="tabpanel"]').each(function(e){var t=sf();Wi(e,"visibility","hidden");var n=qi(e,"height").map(function(t){return parseInt(t,10)});Ji(e,"height");var o=e.dom().getBoundingClientRect().height;n.forall(function(t){return t<o})?Wi(e,"height",o+"px"):n.each(function(t){Wi(e,"height",t+"px")}),Ji(e,"visibility"),t.each(cf)})})],selectFirst:!1},naiveTabHeight:{extraEvents:[],selectFirst:!0}}},jH="send-data-to-section",UH="send-data-to-view",WH=function(t,d){return{dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[],behaviours:_u([Ux(0),gk.config({channel:OH,updateState:function(t,e){return P.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[(r={tabs:t.body.tabs},i=d,u=Ct({}),a=function(t){var e=um.getValue(t),n=HH(e).getOr({}),o=u.get(),r=gt(o,n);u.set(r)},c=function(t){var e=u.get();um.setValue(t,e)},s=Ct(null),l=V(r.tabs,function(t){return{value:t.title,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:i.shared.providers.translate(t.title)},view:function(){return[Bx.sketch(function(e){return{dom:{tag:"div",classes:["tox-form"]},components:V(t.items,function(t){return tS(e,t,i)}),formBehaviours:_u([jd.config({mode:"acyclic",useTabstopAt:m(rw)}),Tm("TabView.form.events",[Qr(c),Zr(a)]),Uu.config({channels:zt([{key:jH,value:{onReceive:a}},{key:UH,value:{onReceive:c}}])})])}})]}}}),f=PH(l).smartTabHeight,RH.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var o=um.getValue(e);Cr(t,Dv,{title:o,oldTitle:s.get()}),s.set(o)},tabs:l,components:[RH.parts().tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[BH.parts().tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:_u([Xp.config({})])}),RH.parts().tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:f.selectFirst,tabSectionBehaviours:_u([Tm("tabpanel",f.extraEvents),jd.config({mode:"acyclic"}),Ll.config({find:function(t){return K(RH.getViewItems(t))}}),um.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([jH],{}),u.get()},setValue:function(t,e){u.set(e),t.getSystem().broadcastOn([UH],{})}}})])}))];default:return[(n={items:t.body.items},o=d,e=Km(Bx.sketch(function(e){return{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:V(n.items,function(t){return tS(e,t,o)})}})),{dom:{tag:"div",classes:["tox-dialog__body"]},components:[e.asSpec()],behaviours:_u([jd.config({mode:"acyclic",useTabstopAt:m(rw)}),jx(e),Kx(e,{postprocess:function(t){return HH(t).fold(function(t){return console.error(t),{}},function(t){return t})}})])})]}var n,o,e,r,i,u,a,c,s,l,f},initialData:t})])}},GH=function(o,n){var t=function(t,r){return Wr(t,function(n,o){e(n,function(t,e){r(t,o.event(),n)})})},e=function(e,n){gk.getState(e).get().each(function(t){n(t.internalDialog,e)})};return[qr(Ft(),iw),t(Tv,function(t){return t.onSubmit(o())}),t(Mv,function(t,e){t.onChange(o(),{name:e.name()})}),t(Vv,function(t,e){t.onAction(o(),{name:e.name(),value:e.value()})}),t(Dv,function(t,e){t.onTabChange(o(),e.title())}),t(Hv,function(t){n.onClose(),t.onClose()}),t(Ev,function(t,e,n){t.onCancel(o()),kr(n,Hv)}),Zr(function(t){var e=o();um.setValue(t,e.getData())}),Wr(Bv,function(t,e){return n.onUnblock()}),Wr(Av,function(t,e){return n.onBlock(e.event())})]},XH=function(t,e){var n=function(t,e){for(var n=[],o=[],r=0,i=t.length;r<i;r++){var u=t[r];(e(u,r,t)?n:o).push(u)}return{pass:n,fail:o}}(e.map(function(t){return t.footerButtons}).getOr([]),function(t){return"start"===t.align}),o=function(t,e){return xv.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:V(e,function(t){return t.memento.asSpec()})})};return[o("start",n.pass),o("end",n.fail)]},YH=function(t,i){return{dom:Fh('<div class="tox-dialog__footer"></div>'),components:[],behaviours:_u([gk.config({channel:MH,initialData:t,updateState:function(t,e){var r=V(e.buttons,function(t){var e,n,o=Km((n=i,oz(e=t,e.type,n)));return{name:t.name,align:t.align,memento:o}});return P.some({lookupByName:function(t,e){return n=t,o=e,_(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(n)});var n,o},footerButtons:r})},renderComponents:XH})])}},qH=function(t){return qm.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:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M17.953 7.453L13.422 12l4.531 4.547-1.406 1.406L12 13.422l-4.547 4.531-1.406-1.406L10.578 12 6.047 7.453l1.406-1.406L12 10.578l4.547-4.531z" fill-rule="evenodd"></path></svg>'}}],action:function(t){kr(t,Ev)}})},KH=function(t,e,n){var o=function(t){return[uu(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:Gn({},e.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:_u([gk.config({channel:CH,renderComponents:o})])}},JH=function(e,n){if(e.getRoot().getSystem().isConnected()){var o=Ll.getCurrent(e.getFormWrapper()).getOr(e.getFormWrapper());return Bx.getField(o,n).fold(function(){var t=e.getFooter();return gk.getState(t).get().bind(function(t){return t.lookupByName(o,n)})},function(t){return P.some(t)})}return P.none()},$H=function(c,o){var t=function(t){var e=c.getRoot();e.getSystem().isConnected()&&t(e)},s={getData:function(){var t=c.getRoot(),e=t.getSystem().isConnected()?c.getFormWrapper():t;return um.getValue(e)},setData:function(a){t(function(t){var e,n,o=s.getData(),r=vt(o,a),i=(e=r,n=c.getRoot(),gk.getState(n).get().map(function(t){return jo(Po("data",t.dataValidator,e))}).getOr(e)),u=c.getFormWrapper();um.setValue(u,i)})},disable:function(t){JH(c,t).each(og.disable)},enable:function(t){JH(c,t).each(og.enable)},focus:function(t){JH(c,t).each(fm.focus)},block:function(e){t(function(t){Cr(t,Av,{message:e})})},unblock:function(){t(function(t){kr(t,Bv)})},showTab:function(n){t(function(t){var e=c.getBody();gk.getState(e).get().exists(function(t){return t.isTabPanel()})&&Ll.getCurrent(e).each(function(t){RH.showTab(t,n)})})},redial:function(n){t(function(t){var e=o(n);t.getSystem().broadcastOn([kH],e),t.getSystem().broadcastOn([CH],e.internalDialog),t.getSystem().broadcastOn([OH],e.internalDialog),t.getSystem().broadcastOn([MH],e.internalDialog),s.setData(e.initialData)})},close:function(){t(function(t){kr(t,Hv)})}};return s},QH=function(t,e,n){var o,r,i,u,a,c,s,l,f,d,m,h=(r={title:n.shared.providers.translate(t.internalDialog.title),draggable:!0},i=n.shared.providers,u=DM.parts().title(KH(r,P.none(),i)),a=DM.parts().draghandle({dom:Fh('<div class="tox-dialog__draghandle"></div>')}),c=DM.parts().close(qH(i)),s=[u].concat(r.draggable?[a]:[]).concat([c]),xv.sketch({dom:Fh('<div class="tox-dialog__header"></div>'),components:s})),g=(l={body:t.internalDialog.body},f=n,DM.parts().body(WH(l,f))),v=(d={buttons:t.internalDialog.buttons},m=n.shared.providers,DM.parts().footer(YH(d,m))),p=GH(function(){return x},{onClose:function(){return e.closeWindow()},onBlock:function(n){DM.setBusy(y,function(t,e){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:Fh('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}})},onUnblock:function(){DM.setIdle(y)}}),b="normal"!==t.internalDialog.size?"large"===t.internalDialog.size?"tox-dialog--width-lg":"tox-dialog--width-md":[],y=su(DM.sketch({lazySink:n.shared.getSink,onEscape:function(t){return kr(t,Ev),P.some(!0)},useTabstopAt:function(t){return!rw(t)&&("button"!==yn(t)||"disabled"!==Mn(t,"disabled"))},modalBehaviours:_u([gk.config({channel:kH,updateState:function(t,e){return P.some(e)},initialData:t}),fm.config({}),Tm("execute-on-form",p.concat([$r(Ft(),function(t,e){jd.focusIn(t)})])),Qx({})]),eventOrder:(o={},o[Se()]=["execute-on-form"],o[Ae()]=["reflecting","execute-on-form"],o),dom:{tag:"div",classes:["tox-dialog"].concat(b),styles:{position:"relative"}},components:[h,g,v],dragBlockClass:"tox-dialog-wrap",parts:{blocker:{dom:Fh('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}}})),x=$H({getRoot:function(){return y},getBody:function(){return DM.getBody(y)},getFooter:function(){return DM.getFooter(y)},getFormWrapper:function(){var t=DM.getBody(y);return Ll.getCurrent(t).getOr(t)}},e.redial);return{dialog:y,instanceApi:x}},ZH=function(t,e,n){var o,r,i,u,a,c,s,l,f=Un("dialog-label"),d=Km((i={title:t.internalDialog.title,draggable:!0},u=f,a=n.shared.providers,xv.sketch({dom:Fh('<div class="tox-dialog__header"></div>'),components:[KH(i,P.some(u),a),qH(a)],containerBehaviours:_u([aM.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return mu(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),m=Km((c={body:t.internalDialog.body},WH(c,n))),h=Km((s={buttons:t.internalDialog.buttons},l=n.shared.providers,YH(s,l))),g=GH(function(){return p},{onBlock:function(){},onUnblock:function(){},onClose:function(){return e.closeWindow()}}),v=su({dom:{tag:"div",classes:["tox-dialog"],attributes:(o={role:"dialog"},o["aria-labelledby"]=f,o)},eventOrder:(r={},r[ze()]=[gk.name(),Uu.name()],r[Se()]=["execute-on-form"],r[Ae()]=["reflecting","execute-on-form"],r),behaviours:_u([jd.config({mode:"cyclic",onEscape:function(t){return kr(t,Hv),P.some(!0)},useTabstopAt:function(t){return!rw(t)&&("button"!==yn(t)||"disabled"!==Mn(t,"disabled"))}}),gk.config({channel:kH,updateState:function(t,e){return P.some(e)},initialData:t}),Tm("execute-on-form",g),Qx({})]),components:[d.asSpec(),m.asSpec(),h.asSpec()]}),p=$H({getRoot:function(){return v},getFooter:function(){return h.get(v)},getBody:function(){return m.get(v)},getFormWrapper:function(){var t=m.get(v);return Ll.getCurrent(t).getOr(t)}},e.redial);return{dialog:v,instanceApi:p}},tE=function(t,e){return DM.parts().close(qm.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:_u([Xp.config({})])}))},eE=function(){return DM.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},nE=function(t,e){return DM.parts().body({dom:{tag:"div",classes:["tox-dialog__body","todo-tox-fit"]},components:[{dom:Fh("<p>"+e.translate(t)+"</p>")}]})},oE=function(t){return DM.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},rE=function(t,e){return[xv.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),xv.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},iE=function(n){return DM.sketch({lazySink:n.lazySink,onEscape:function(){return n.onCancel(),P.some(!0)},dom:{tag:"div",classes:["tox-dialog"].concat(n.extraClasses)},components:[{dom:{tag:"div",classes:["tox-dialog__header"]},components:[n.partSpecs.title,n.partSpecs.close]},n.partSpecs.body,n.partSpecs.footer],parts:{blocker:{dom:Fh('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}},modalBehaviours:_u([Tm("basic-dialog-events",[Wr(Ev,function(t,e){n.onCancel()}),Wr(Tv,function(t,e){n.onSubmit()})])])})},uE=function(c){var u,a,n=(u=c.backstage.shared,{open:function(t,e){var n=function(){DM.hide(r),e()},o=Km(oz({name:"close-alert",text:"OK",primary:!0,icon:P.none()},"cancel",u.providers)),r=su(iE({lazySink:function(){return u.getSink()},partSpecs:{title:eE(),close:tE(function(){n()},u.providers),body:nE(t,u.providers),footer:oE(rE([],[o.asSpec()]))},onCancel:function(){return n()},onSubmit:N,extraClasses:["tox-alert-dialog"]}));DM.show(r);var i=o.get(r);fm.focus(i)}}),o=(a=c.backstage.shared,{open:function(t,e){var n=function(t){DM.hide(i),e(t)},o=Km(oz({name:"yes",text:"Yes",primary:!0,icon:P.none()},"submit",a.providers)),r=oz({name:"no",text:"No",primary:!0,icon:P.none()},"cancel",a.providers),i=su(iE({lazySink:function(){return a.getSink()},partSpecs:{title:eE(),close:tE(function(){n(!1)},a.providers),body:nE(t,a.providers),footer:oE(rE([],[r,o.asSpec()]))},onCancel:function(){return n(!1)},onSubmit:function(){return n(!0)},extraClasses:["tox-confirm-dialog"]}));DM.show(i);var u=o.get(i);fm.focus(u)}}),r=function(t,i){return SH.open(function(t,e,n){var o=e,r=QH({dataValidator:n,initialData:o,internalDialog:t},{redial:SH.redial,closeWindow:function(){DM.hide(r.dialog),i(r.instanceApi)}},c.backstage);return DM.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},t)},i=function(t,u,a){return SH.open(function(t,e,n){var o=jo(Po("data",n,e)),r=ZH({dataValidator:n,initialData:o,internalDialog:t},{redial:SH.redial,closeWindow:function(){Xm.hide(i),a(r.instanceApi)}},c.backstage),i=su(Xm.sketch({lazySink:c.backstage.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},inlineBehaviours:_u([Tm("window-manager-inline-events",[Wr(De(),function(t,e){kr(r.dialog,Ev)})])])}));return Xm.showAt(i,u,lu(r.dialog)),r.instanceApi.setData(o),jd.focusIn(r.dialog),r.instanceApi},t)};return{open:function(t,e,n){return e!==undefined&&"toolbar"===e.inline?i(t,c.backstage.shared.anchors.toolbar(),n):e!==undefined&&"cursor"===e.inline?i(t,c.backstage.shared.anchors.cursor(),n):r(t,n)},alert:function(t,e){n.open(t,function(){e()})},close:function(t){t.close()},confirm:function(t,e){o.open(t,function(t){e(t)})}}};Wn.add("silver",function(t){var e=bM(t),n=e.mothership,o=e.uiMothership,r=e.backstage,i=e.renderUI,u=e.getUi;EM(t),Nn(Un("silver-demo"),n),Nn(Un("silver-ui-demo"),o),qg(t,r.shared);var a=uE({backstage:r});return{renderUI:i,getWindowManagerImpl:U(a),getNotificationManagerImpl:function(){return oh(t,{backstage:r},o)},ui:u()}}),function LE(){}}();!function(n){"use strict";var y=function(){return(y=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function c(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&(t[r[o]]=n[r[o]])}return t}var x=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e]},p=function(t,r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,n))}},h=function(n){return function(){return n}},b=function(n){return n};function l(r){for(var o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=o.concat(n);return r.apply(null,t)}}var e,t,r,o,i,u,a,S=function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return!t.apply(null,n)}},f=function(n){return function(){throw new Error(n)}},s=function(n){return n()},d=h(!1),m=h(!0),g=d,v=m,w=function(){return O},O=(o={fold:function(n,e){return n()},is:g,isSome:g,isNone:v,getOr:r=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:t,map:w,ap:w,each:function(){},bind:w,flatten:w,exists:g,forall:v,filter:w,equals:e=function(n){return n.isNone()},equals_:e,toArray:function(){return[]},toString:h("none()")},Object.freeze&&Object.freeze(o),o),T=function(t){var n=function(){return t},e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:v,isNone:g,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return T(n(t))},ap:function(n){return n.fold(w,function(n){return T(n(t))})},each:function(n){n(t)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(t)?o:O},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(g,function(n){return e(t,n)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},k={some:T,none:w,from:function(n){return null===n||n===undefined?O:T(n)}},E=Object.keys,C=Object.hasOwnProperty,D=function(n,e){for(var t=E(n),r=0,o=t.length;r<o;r++){var i=t[r];e(n[i],i,n)}},M=function(n,r){return A(n,function(n,e,t){return{k:e,v:r(n,e,t)}})},A=function(r,o){var i={};return D(r,function(n,e){var t=o(n,e,r);i[t.k]=t.v}),i},I=function(n,t){var r=[];return D(n,function(n,e){r.push(t(n,e))}),r},B=function(n,e){return C.call(n,e)},R=h("touchstart"),F=h("touchmove"),V=h("touchend"),N=h("mousedown"),H=h("mousemove"),j=h("mouseup"),z=h("mouseover"),L=h("keydown"),P=h("keyup"),U=h("input"),G=h("change"),$=h("click"),W=h("transitionend"),_=h("selectstart"),q=function(t){var r,o=!1;return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return o||(o=!0,r=t.apply(null,n)),r}},X=function(n,e){var t=function(n,e){for(var t=0;t<n.length;t++){var r=n[t];if(r.test(e))return r}return undefined}(n,e);if(!t)return{major:0,minor:0};var r=function(n){return Number(e.replace(t,"$"+n))};return K(r(1),r(2))},Y=function(){return K(0,0)},K=function(n,e){return{major:n,minor:e}},J={nu:K,detect:function(n,e){var t=String(e).toLowerCase();return 0===n.length?Y():X(n,t)},unknown:Y},Q="Edge",Z="Chrome",nn="Opera",en="Firefox",tn=function(n,e){return function(){return e===n}},rn=function(n){var e=n.current;return{current:e,version:n.version,isEdge:tn(Q,e),isChrome:tn(Z,e),isIE:tn("IE",e),isOpera:tn(nn,e),isFirefox:tn(en,e),isSafari:tn("Safari",e)}},on={unknown:function(){return rn({current:undefined,version:J.unknown()})},nu:rn,edge:h(Q),chrome:h(Z),ie:h("IE"),opera:h(nn),firefox:h(en),safari:h("Safari")},un="Windows",an="Android",cn="Solaris",fn="FreeBSD",sn=function(n,e){return function(){return e===n}},ln=function(n){var e=n.current;return{current:e,version:n.version,isWindows:sn(un,e),isiOS:sn("iOS",e),isAndroid:sn(an,e),isOSX:sn("OSX",e),isLinux:sn("Linux",e),isSolaris:sn(cn,e),isFreeBSD:sn(fn,e)}},dn={unknown:function(){return ln({current:undefined,version:J.unknown()})},nu:ln,windows:h(un),ios:h("iOS"),android:h(an),linux:h("Linux"),osx:h("OSX"),solaris:h(cn),freebsd:h(fn)},mn=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&Array.prototype.isPrototypeOf(n)?"array":"object"===e&&String.prototype.isPrototypeOf(n)?"string":e}(n)===e}},gn=mn("string"),pn=mn("object"),vn=mn("array"),hn=mn("boolean"),bn=mn("function"),yn=mn("number"),xn=(i=Array.prototype.indexOf)===undefined?function(n,e){return Mn(n,e)}:function(n,e){return i.call(n,e)},wn=function(n,e){return-1<xn(n,e)},Sn=function(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var i=n[o];r[o]=e(i,o,n)}return r},On=function(n,e){for(var t=0,r=n.length;t<r;t++)e(n[t],t,n)},Tn=function(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var i=n[r];e(i,r,n)&&t.push(i)}return t},kn=function(n,e,t){return function(n,e){for(var t=n.length-1;0<=t;t--)e(n[t],t,n)}(n,function(n){t=e(t,n)}),t},En=function(n,e,t){return On(n,function(n){t=e(t,n)}),t},Cn=function(n,e){for(var t=0,r=n.length;t<r;t++){var o=n[t];if(e(o,t,n))return k.some(o)}return k.none()},Dn=function(n,e){for(var t=0,r=n.length;t<r;t++)if(e(n[t],t,n))return k.some(t);return k.none()},Mn=function(n,e){for(var t=0,r=n.length;t<r;++t)if(n[t]===e)return t;return-1},An=Array.prototype.push,In=function(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!Array.prototype.isPrototypeOf(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);An.apply(e,n[t])}return e},Bn=function(n,e){var t=Sn(n,e);return In(t)},Rn=function(n,e){for(var t=0,r=n.length;t<r;++t)if(!0!==e(n[t],t,n))return!1;return!0},Fn=Array.prototype.slice,Vn=function(n){var e=Fn.call(n,0);return e.reverse(),e},Nn=function(n){return[n]},Hn=(bn(Array.from)&&Array.from,function(n,e){var t=String(e).toLowerCase();return Cn(n,function(n){return n.search(t)})}),jn=function(n,t){return Hn(n,t).map(function(n){var e=J.detect(n.versionRegexes,t);return{current:n.name,version:e}})},zn=function(n,t){return Hn(n,t).map(function(n){var e=J.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Ln=function(n,e){return-1!==n.indexOf(e)},Pn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Un=function(e){return function(n){return Ln(n,e)}},Gn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return Ln(n,"edge/")&&Ln(n,"chrome")&&Ln(n,"safari")&&Ln(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Pn],search:function(n){return Ln(n,"chrome")&&!Ln(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return Ln(n,"msie")||Ln(n,"trident")}},{name:"Opera",versionRegexes:[Pn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Un("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Un("firefox")},{name:"Safari",versionRegexes:[Pn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(Ln(n,"safari")||Ln(n,"mobile/"))&&Ln(n,"applewebkit")}}],$n=[{name:"Windows",search:Un("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return Ln(n,"iphone")||Ln(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Un("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Un("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Un("linux"),versionRegexes:[]},{name:"Solaris",search:Un("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Un("freebsd"),versionRegexes:[]}],Wn={browsers:h(Gn),oses:h($n)},_n=function(n){var e,t,r,o,i,u,a,c,f,s,l,d=Wn.browsers(),m=Wn.oses(),g=jn(d,n).fold(on.unknown,on.nu),p=zn(m,n).fold(dn.unknown,dn.nu);return{browser:g,os:p,deviceType:(t=g,r=n,o=(e=p).isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,u=e.isAndroid()&&3===e.version.major,a=e.isAndroid()&&4===e.version.major,c=o||u||a&&!0===/mobile/i.test(r),f=e.isiOS()||e.isAndroid(),s=f&&!c,l=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),{isiPad:h(o),isiPhone:h(i),isTablet:h(c),isPhone:h(s),isTouch:h(f),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:h(l)})}},qn={detect:q(function(){var n=navigator.userAgent;return _n(n)})},Xn={tap:h("alloy.tap")},Yn=h("alloy.focus"),Kn=h("alloy.blur.post"),Jn=h("alloy.paste.post"),Qn=h("alloy.receive"),Zn=h("alloy.execute"),ne=h("alloy.focus.item"),ee=Xn.tap,te=qn.detect().deviceType.isTouch()?Xn.tap:$,re=h("alloy.longpress"),oe=h("alloy.system.init"),ie=h("alloy.system.attached"),ue=h("alloy.system.detached"),ae=h("alloy.focusmanager.shifted"),ce=function(n,e){de(n,n.element(),e,{})},fe=function(n,e,t){de(n,n.element(),e,t)},se=function(n){ce(n,Zn())},le=function(n,e,t){de(n,e,t,{})},de=function(n,e,t,r){var o=y({target:e},r);n.getSystem().triggerEvent(t,e,M(o,h))},me=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:h(n)}},ge={fromHtml:function(n,e){var t=(e||document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return me(t.childNodes[0])},fromTag:function(n,e){var t=(e||document).createElement(n);return me(t)},fromText:function(n,e){var t=(e||document).createTextNode(n);return me(t)},fromDom:me,fromPoint:function(n,e,t){var r=n.dom();return k.from(r.elementFromPoint(e,t)).map(me)}},pe=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE),ve=(Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),he=Node.TEXT_NODE,be=(Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,function(n){return n.dom().nodeName.toLowerCase()}),ye=function(e){return function(n){return n.dom().nodeType===e}},xe=ye(ve),we=ye(he),Se=function(n){var e=we(n)?n.dom().parentNode:n.dom();return e!==undefined&&null!==e&&e.ownerDocument.body.contains(e)},Oe=q(function(){return Te(ge.fromDom(document))}),Te=function(n){var e=n.dom().body;if(null===e||e===undefined)throw new Error("Body is not available yet");return ge.fromDom(e)},ke=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(e.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+t.length+" arguments");var r={};return On(e,function(n,e){r[n]=h(t[e])}),r}},Ee=function(n){return n.slice(0).sort()},Ce=function(e,n){if(!vn(n))throw new Error("The "+e+" fields must be an array. Was: "+n+".");On(n,function(n){if(!gn(n))throw new Error("The value "+n+" in the "+e+" fields was not a string.")})},De=function(o,i){var t,u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return Ce("required",o),Ce("optional",i),t=Ee(u),Cn(t,function(n,e){return e<t.length-1&&n===t[e+1]}).each(function(n){throw new Error("The field: "+n+" occurs more than once in the combined fields: ["+t.join(", ")+"].")}),function(e){var t=E(e);Rn(o,function(n){return wn(t,n)})||function(n,e){throw new Error("All required keys ("+Ee(n).join(", ")+") were not specified. Specified keys were: "+Ee(e).join(", ")+".")}(o,t);var n=Tn(t,function(n){return!wn(u,n)});0<n.length&&function(n){throw new Error("Unsupported keys for object: "+Ee(n).join(", "))}(n);var r={};return On(o,function(n){r[n]=h(e[n])}),On(i,function(n){r[n]=h(Object.prototype.hasOwnProperty.call(e,n)?k.some(e[n]):k.none())}),r}},Me="undefined"!=typeof window?window:Function("return this;")(),Ae=function(n,e){return function(n,e){for(var t=e!==undefined&&null!==e?e:Me,r=0;r<n.length&&t!==undefined&&null!==t;++r)t=t[n[r]];return t}(n.split("."),e)},Ie={getOrDie:function(n,e){var t=Ae(n,e);if(t===undefined||null===t)throw n+" not available on this browser";return t}},Be=ve,Re=pe,Fe=function(n,e){var t=n.dom();if(t.nodeType!==Be)return!1;if(t.matches!==undefined)return t.matches(e);if(t.msMatchesSelector!==undefined)return t.msMatchesSelector(e);if(t.webkitMatchesSelector!==undefined)return t.webkitMatchesSelector(e);if(t.mozMatchesSelector!==undefined)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Ve=function(n){return n.nodeType!==Be&&n.nodeType!==Re||0===n.childElementCount},Ne=function(n,e){var t=e===undefined?document:e.dom();return Ve(t)?[]:Sn(t.querySelectorAll(n),ge.fromDom)},He=function(n,e){var t=e===undefined?document:e.dom();return Ve(t)?k.none():k.from(t.querySelector(n)).map(ge.fromDom)},je=function(n,e){return n.dom()===e.dom()},ze=(qn.detect().browser.isIE(),function(n){return ge.fromDom(n.dom().ownerDocument)}),Le=function(n){var e=n.dom();return k.from(e.parentNode).map(ge.fromDom)},Pe=function(n){var e=n.dom();return Sn(e.childNodes,ge.fromDom)},Ue=function(n,e){var t=n.dom().childNodes;return k.from(t[e]).map(ge.fromDom)},Ge=(ke("element","offset"),function(e,t){Le(e).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})}),$e=function(n,e){var t;(t=n.dom(),k.from(t.nextSibling).map(ge.fromDom)).fold(function(){Le(n).each(function(n){_e(n,e)})},function(n){Ge(n,e)})},We=function(e,t){Ue(e,0).fold(function(){_e(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})},_e=function(n,e){n.dom().appendChild(e.dom())},qe=function(e,n){On(n,function(n){_e(e,n)})},Xe=function(n){n.dom().textContent="",On(Pe(n),function(n){Ye(n)})},Ye=function(n){var e=n.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},Ke=function(n){ce(n,ue());var e=n.components();On(e,Ke)},Je=function(n){var e=n.components();On(e,Je),ce(n,ie())},Qe=function(n,e){Ze(n,e,_e)},Ze=function(n,e,t){n.getSystem().addToWorld(e),t(n.element(),e.element()),Se(n.element())&&Je(e),n.syncComponents()},nt=function(n){Ke(n),Ye(n.element()),n.getSystem().removeFromWorld(n)},et=function(e){var n=Le(e.element()).bind(function(n){return e.getSystem().getByDom(n).fold(k.none,k.some)});nt(e),n.each(function(n){n.syncComponents()})},tt=function(n,e,t){t(n,e.element());var r=Pe(e.element());On(r,function(n){e.getByDom(n).each(Je)})},rt=function(t){return{is:function(n){return t===n},isValue:m,isError:d,getOr:h(t),getOrThunk:h(t),getOrDie:h(t),or:function(n){return rt(t)},orThunk:function(n){return rt(t)},fold:function(n,e){return e(t)},map:function(n){return rt(n(t))},mapError:function(n){return rt(t)},each:function(n){n(t)},bind:function(n){return n(t)},exists:function(n){return n(t)},forall:function(n){return n(t)},toOption:function(){return k.some(t)}}},ot=function(t){return{is:d,isValue:d,isError:m,getOr:b,getOrThunk:function(n){return n()},getOrDie:function(){return f(String(t))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return ot(t)},mapError:function(n){return ot(n(t))},each:x,bind:function(n){return ot(t)},exists:d,forall:m,toOption:k.none}},it={value:rt,error:ot},ut=function(u){if(!vn(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],t={};return On(u,function(n,r){var e=E(n);if(1!==e.length)throw new Error("one and only one name per case");var o=e[0],i=n[o];if(t[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!vn(i))throw new Error("case arguments must be an array");a.push(o),t[o]=function(){var n=arguments.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+n);for(var t=new Array(n),e=0;e<t.length;e++)t[e]=arguments[e];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,t)},match:function(n){var e=E(n);if(a.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+e.join(","));if(!Rn(a,function(n){return wn(e,n)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+a.join(", "));return n[o].apply(null,t)},log:function(n){console.log(n,{constructors:a,constructor:o,params:t})}}}}),t},at=Object.prototype.hasOwnProperty,ct=function(u){return function(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];if(0===n.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<n.length;r++){var o=n[r];for(var i in o)at.call(o,i)&&(t[i]=u(t[i],o[i]))}return t}},ft=ct(function(n,e){return pn(n)&&pn(e)?ft(n,e):e}),st=ct(function(n,e){return e}),lt=ut([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),dt=function(n){return lt.defaultedThunk(h(n))},mt=lt.strict,gt=lt.asOption,pt=lt.defaultedThunk,vt=(lt.asDefaultedOptionThunk,lt.mergeWithThunk),ht=function(e){return function(n){return B(n,e)?k.from(n[e]):k.none()}},bt=function(n,e){return ht(e)(n)},yt=function(n,e){var t={};return t[n]=e,t},xt=(ut([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n){return ht(n)}),wt=function(n,e){return t=n,r=e,function(n){return B(n,t)?n[t]:r};var t,r},St=function(n,e){return bt(n,e)},Ot=function(n,e){return yt(n,e)},Tt=function(n){return e={},On(n,function(n){e[n.key]=n.value}),e;var e},kt=function(n,e){var t,r,o,i,u,a=(t=[],r=[],On(n,function(n){n.fold(function(n){t.push(n)},function(n){r.push(n)})}),{errors:t,values:r});return 0<a.errors.length?(u=a.errors,p(it.error,In)(u)):(i=e,0===(o=a.values).length?it.value(i):it.value(ft(i,st.apply(undefined,o))))},Et=function(n,e){return B(t=n,r=e)&&t[r]!==undefined&&null!==t[r];var t,r};(a=u||(u={}))[a.Error=0]="Error",a[a.Value=1]="Value";var Ct,Dt,Mt=function(n,e,t){return n.stype===u.Error?e(n.serror):t(n.svalue)},At=function(n){return{stype:u.Value,svalue:n}},It=function(n){return{stype:u.Error,serror:n}},Bt=function(n){return n.fold(It,At)},Rt=function(n){return Mt(n,it.error,it.value)},Ft=At,Vt=function(n){var e=[],t=[];return On(n,function(n){Mt(n,function(n){return t.push(n)},function(n){return e.push(n)})}),{values:e,errors:t}},Nt=It,Ht=function(n,e){return n.stype===u.Value?e(n.svalue):n},jt=function(n,e){return n.stype===u.Error?e(n.serror):n},zt=function(n,e){return n.stype===u.Value?{stype:u.Value,svalue:e(n.svalue)}:n},Lt=function(n,e){return n.stype===u.Error?{stype:u.Error,serror:e(n.serror)}:n},Pt=function(n){return p(Nt,In)(n)},Ut=function(n,e){var t,r,o=Vt(n);return 0<o.errors.length?Pt(o.errors):(t=o.values,r=e,0<t.length?Ft(ft(r,st.apply(undefined,t))):Ft(r))},Gt=function(n){var e=Vt(n);return 0<e.errors.length?Pt(e.errors):Ft(e.values)},$t=ut([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),Wt=ut([{field:["name","presence","type"]},{state:["name"]}]),_t=function(){return Ie.getOrDie("JSON")},qt=function(n,e,t){return _t().stringify(n,e,t)},Xt=function(n){return pn(n)&&100<E(n).length?" removed due to size":qt(n,null,2)},Yt=function(n,e){return Nt([{path:n,getErrorInfo:e}])},Kt=ut([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Jt=function(t,r,o){return bt(r,o).fold(function(){return n=o,e=r,Yt(t,function(){return'Could not find valid *strict* value for "'+n+'" in '+Xt(e)});var n,e},Ft)},Qt=function(n,e,t){var r=bt(n,e).fold(function(){return t(n)},b);return Ft(r)},Zt=function(a,c,n,f){return n.fold(function(o,t,n,r){var i=function(n){var e=r.extract(a.concat([o]),f,n);return zt(e,function(n){return yt(t,f(n))})},u=function(n){return n.fold(function(){var n=yt(t,f(k.none()));return Ft(n)},function(n){var e=r.extract(a.concat([o]),f,n);return zt(e,function(n){return yt(t,f(k.some(n)))})})};return n.fold(function(){return Ht(Jt(a,c,o),i)},function(n){return Ht(Qt(c,o,n),i)},function(){return Ht(Ft(bt(c,o)),u)},function(n){return Ht((t=n,r=bt(e=c,o).map(function(n){return!0===n?t(e):n}),Ft(r)),u);var e,t,r},function(n){var e=n(c),t=zt(Qt(c,o,h({})),function(n){return ft(e,n)});return Ht(t,i)})},function(n,e){var t=e(c);return Ft(yt(n,f(t)))})},nr=function(r){return{extract:function(t,n,e){return jt(r(e,n),function(n){return e=n,Yt(t,function(){return e});var e})},toString:function(){return"val"},toDsl:function(){return $t.itemOf(r)}}},er=function(n){var c=tr(n),f=kn(n,function(e,n){return n.fold(function(n){return ft(e,Ot(n,!0))},h(e))},{});return{extract:function(n,e,t){var r,o,i,u=hn(t)?[]:(o=E(r=t),Tn(o,function(n){return Et(r,n)})),a=Tn(u,function(n){return!Et(f,n)});return 0===a.length?c.extract(n,e,t):(i=a,Yt(n,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:c.toString,toDsl:c.toDsl}},tr=function(a){return{extract:function(n,e,t){return r=n,o=t,i=e,u=Sn(a,function(n){return Zt(r,o,n,i)}),Ut(u,{});var r,o,i,u},toString:function(){return"obj{\n"+Sn(a,function(n){return n.fold(function(n,e,t,r){return n+" -> "+r.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return $t.objOf(Sn(a,function(n){return n.fold(function(n,e,t,r){return Wt.field(n,t,r)},function(n,e){return Wt.state(n)})}))}}},rr=function(t,i){var u=function(n,e){return(o=nr(t),{extract:function(t,r,n){var e=Sn(n,function(n,e){return o.extract(t.concat(["["+e+"]"]),r,n)});return Gt(e)},toString:function(){return"array("+o.toString()+")"},toDsl:function(){return $t.arrOf(o)}}).extract(n,b,e);var o};return{extract:function(t,r,o){var n=E(o),e=u(t,n);return Ht(e,function(n){var e=Sn(n,function(n){return Kt.field(n,n,mt(),i)});return tr(e).extract(t,r,o)})},toString:function(){return"setOf("+i.toString()+")"},toDsl:function(){return $t.setOf(t,i)}}},or=h(nr(Ft)),ir=Kt.state,ur=Kt.field,ar=function(t,e,r,o,i){return St(o,i).fold(function(){return n=o,e=i,Yt(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Xt(n)});var n,e},function(n){return tr(n).extract(t.concat(["branch: "+i]),e,r)})},cr=function(o,i){return{extract:function(e,t,r){return St(r,o).fold(function(){return n=o,Yt(e,function(){return'Choice schema did not contain choice key: "'+n+'"'});var n},function(n){return ar(e,t,r,i,n)})},toString:function(){return"chooseOn("+o+"). Possible values: "+E(i)},toDsl:function(){return $t.choiceOf(o,i)}}},fr=nr(Ft),sr=function(e){return nr(function(n){return e(n).fold(Nt,Ft)})},lr=function(e,n){return rr(function(n){return Bt(e(n))},n)},dr=function(n,e,t){return Rt((r=n,o=b,i=t,u=e.extract([r],o,i),Lt(u,function(n){return{input:i,errors:n}})));var r,o,i,u},mr=function(n){return n.fold(function(n){throw new Error(pr(n))},b)},gr=function(n,e,t){return mr(dr(n,e,t))},pr=function(n){return"Errors: \n"+(e=n.errors,t=10<e.length?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,Sn(t,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()}))+"\n\nInput object: "+Xt(n.input);var e,t},vr=function(n,e){return cr(n,e)},hr=h(fr),br=(Ct=bn,Dt="function",nr(function(n){var e=typeof n;return Ct(n)?Ft(n):Nt("Expected type: "+Dt+" but got: "+e)})),yr=function(n){return ur(n,n,mt(),or())},xr=function(n,e){return ur(n,n,mt(),e)},wr=function(n,e){return ur(n,n,mt(),tr(e))},Sr=function(n){return ur(n,n,gt(),or())},Or=function(n,e){return ur(n,n,gt(),tr(e))},Tr=function(n,e){return ur(n,n,gt(),er(e))},kr=function(n,e){return ur(n,n,dt(e),or())},Er=function(n,e,t){return ur(n,n,dt(e),t)},Cr=function(n,e){return ir(n,e)},Dr=function(n,e){return je(n.element(),e.event().target())},Mr=function(n){if(!Et(n,"can")&&!Et(n,"abort")&&!Et(n,"run"))throw new Error("EventHandler defined by: "+qt(n,null,2)+" does not have can, abort, or run!");return gr("Extracting event.handler",er([kr("can",h(!0)),kr("abort",h(!1)),kr("run",x)]),n)},Ar=function(t){var e,r,o,i,n=(e=t,r=function(n){return n.can},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return En(e,function(n,e){return n&&r(e).apply(undefined,t)},!0)}),u=(o=t,i=function(n){return n.abort},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return En(o,function(n,e){return n||i(e).apply(undefined,t)},!1)});return Mr({can:n,abort:u,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];On(t,function(n){n.run.apply(undefined,e)})}})};function Ir(n,e,t,r,o){return n(t,r)?k.some(t):bn(o)&&o(t)?k.none():e(t,r,o)}var Br,Rr,Fr,Vr=function(n,e,t){for(var r=n.dom(),o=bn(t)?t:h(!1);r.parentNode;){r=r.parentNode;var i=ge.fromDom(r);if(e(i))return k.some(i);if(o(i))break}return k.none()},Nr=function(n,e,t){return Ir(function(n){return e(n)},Vr,n,e,t)},Hr=function(n,r){var o=function(n){for(var e=0;e<n.childNodes.length;e++){if(r(ge.fromDom(n.childNodes[e])))return k.some(ge.fromDom(n.childNodes[e]));var t=o(n.childNodes[e]);if(t.isSome())return t}return k.none()};return o(n.dom())},jr=function(n,e,t){return Nr(n,function(n){return e(n).isSome()},t).bind(e)},zr=function(n){return Tt(n)},Lr=function(n,e){return{key:n,value:Mr({abort:e})}},Pr=function(n,e){return{key:n,value:Mr({run:e})}},Ur=function(n,e,t){return{key:n,value:Mr({run:function(n){e.apply(undefined,[n].concat(t))}})}},Gr=function(n){return function(t){return{key:n,value:Mr({run:function(n,e){Dr(n,e)&&t(n,e)}})}}},$r=function(n,e,t){var u,r,o=e.partUids[t];return r=o,Pr(u=n,function(n,i){n.getSystem().getByUid(r).each(function(n){var e,t,r,o;t=(e=n).element(),r=u,o=i,e.getSystem().triggerEvent(r,t,o.event())})})},Wr=function(n){return Pr(n,function(n,e){e.cut()})},_r=Gr(ie()),qr=Gr(ue()),Xr=Gr(oe()),Yr=(Br=Zn(),function(n){return Pr(Br,n)}),Kr=function(n){return Sn(n,function(n){return r=e="/*",o=(t=n).length-e.length,""!==r&&(t.length<r.length||t.substr(o,o+r.length)!==r)?n:n.substring(0,n.length-"/*".length);var e,t,r,o})},Jr=function(n,e){var t=n.toString(),r=t.indexOf(")")+1,o=t.indexOf("("),i=t.substring(o+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:e,parameters:Kr(i)}},n},Qr=function(n){return{classes:n.classes!==undefined?n.classes:[],attributes:n.attributes!==undefined?n.attributes:{},styles:n.styles!==undefined?n.styles:{}}},Zr=function(t,r,o){return Xr(function(n,e){o(n,t,r)})},no=function(n,e,t,r,o,i){var u,a,c=n,f=Or(e,[(u="config",a=n,ur(u,u,gt(),a))]);return ro(c,f,e,t,r,o,i)},eo=function(o,i,u){var n,e,t,r,a,c;return n=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var r=[t].concat(n);return t.config({name:h(o)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+o+". Using API: "+u)},function(n){var e=Array.prototype.slice.call(r,1);return i.apply(undefined,[t,n.config,n.state].concat(e))})},e=u,t=i.toString(),r=t.indexOf(")")+1,a=t.indexOf("("),c=t.substring(a+1,r-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:e,parameters:Kr(c.slice(0,1).concat(c.slice(3)))}},n},to=function(n){return{key:n,value:undefined}},ro=function(t,n,r,o,e,i,u){var a=function(n){return Et(n,r)?n[r]():k.none()},c=M(e,function(n,e){return eo(r,n,e)}),f=M(i,function(n,e){return Jr(n,e)}),s=y({},f,c,{revoke:l(to,r),config:function(n){var e=gr(r+"-config",t,n);return{key:r,value:{config:e,me:s,configAsRaw:q(function(){return gr(r+"-config",t,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,t){return a(n).bind(function(e){return St(o,"exhibit").map(function(n){return n(t,e.config,e.state)})}).getOr(Qr({}))},name:function(){return r},handlers:function(n){return a(n).map(function(n){return wt("events",function(n,e){return{}})(o)(n.config,n.state)}).getOr({})}});return s},oo={init:function(){return io({readState:function(){return"No State required"}})}},io=function(n){return n},uo=function(n){return Tt(n)},ao=er([yr("fields"),yr("name"),kr("active",{}),kr("apis",{}),kr("state",oo),kr("extra",{})]),co=function(n){var e,t,r,o,i,u,a,c,f=gr("Creating behaviour: "+n.name,ao,n);return e=f.fields,t=f.name,r=f.active,o=f.apis,i=f.extra,u=f.state,a=er(e),c=Or(t,[Tr("config",e)]),ro(a,c,t,r,o,i,u)},fo=er([yr("branchKey"),yr("branches"),yr("name"),kr("active",{}),kr("apis",{}),kr("state",oo),kr("extra",{})]),so=h(undefined),lo=function(n,e,t){if(!(gn(t)||hn(t)||yn(t)))throw console.error("Invalid call to Attr.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")},mo=function(n,e,t){lo(n.dom(),e,t)},go=function(n,e){var t=n.dom();D(e,function(n,e){lo(t,e,n)})},po=function(n,e){var t=n.dom().getAttribute(e);return null===t?undefined:t},vo=function(n,e){var t=n.dom();return!(!t||!t.hasAttribute)&&t.hasAttribute(e)},ho=function(n,e){n.dom().removeAttribute(e)},bo=function(n,e){var t=po(n,e);return t===undefined||""===t?[]:t.split(" ")},yo=function(n){return n.dom().classList!==undefined},xo=function(n,e){return o=e,i=bo(t=n,r="class").concat([o]),mo(t,r,i.join(" ")),!0;var t,r,o,i},wo=function(n,e){return o=e,0<(i=Tn(bo(t=n,r="class"),function(n){return n!==o})).length?mo(t,r,i.join(" ")):ho(t,r),!1;var t,r,o,i},So=function(n,e){yo(n)?n.dom().classList.add(e):xo(n,e)},Oo=function(n){0===(yo(n)?n.dom().classList:bo(n,"class")).length&&ho(n,"class")},To=function(n,e){yo(n)?n.dom().classList.remove(e):wo(n,e),Oo(n)},ko=function(n,e){return yo(n)&&n.dom().classList.contains(e)},Eo=function(n,e,t){To(n,t),So(n,e)},Co=Object.freeze({toAlpha:function(n,e,t){Eo(n.element(),e.alpha,e.omega)},toOmega:function(n,e,t){Eo(n.element(),e.omega,e.alpha)},isAlpha:function(n,e,t){return ko(n.element(),e.alpha)},isOmega:function(n,e,t){return ko(n.element(),e.omega)},clear:function(n,e,t){To(n.element(),e.alpha),To(n.element(),e.omega)}}),Do=[yr("alpha"),yr("omega")],Mo=co({fields:Do,name:"swapping",apis:Co}),Ao=function(n){var e=n,t=function(){return e};return{get:t,set:function(n){e=n},clone:function(){return Ao(t())}}},Io=function(n){n.dom().focus()},Bo=function(n){n.dom().blur()},Ro=function(n){var e=n!==undefined?n.dom():document;return k.from(e.activeElement).map(ge.fromDom)},Fo=function(e){return Ro(ze(e)).filter(function(n){return e.dom().contains(n.dom())})},Vo=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),No=tinymce.util.Tools.resolve("tinymce.ThemeManager"),Ho=function(n){var e=document.createElement("a");e.target="_blank",e.href=n.href,e.rel="noreferrer noopener";var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)},jo={formatChanged:h("formatChanged"),orientationChanged:h("orientationChanged"),dropupDismissed:h("dropupDismissed")},zo=function(n){return n.dom().innerHTML},Lo=function(n,e){var t,r,o=ze(n).dom(),i=ge.fromDom(o.createDocumentFragment()),u=(t=e,(r=(o||document).createElement("div")).innerHTML=t,Pe(ge.fromDom(r)));qe(i,u),Xe(n),_e(n,i)},Po=function(n){return e=n,t=!1,ge.fromDom(e.dom().cloneNode(t));var e,t},Uo=function(n){var e,t,r,o=Po(n);return e=o,t=ge.fromTag("div"),r=ge.fromDom(e.dom().cloneNode(!0)),_e(t,r),zo(t)},Go=function(n){return Uo(n)},$o=Object.freeze({events:function(a){return zr([Pr(Qn(),function(o,i){var n,e,u=a.channels,t=E(u),r=(n=t,(e=i).universal()?n:Tn(n,function(n){return wn(e.channels(),n)}));On(r,function(n){var e=u[n],t=e.schema,r=gr("channel["+n+"] data\nReceiver: "+Go(o.element()),t,i.data());e.onReceive(o,r)})})])}}),Wo=function(n){for(var e=[],t=function(n){e.push(n)},r=0;r<n.length;r++)n[r].each(t);return e},_o=function(n,e){for(var t=0;t<n.length;t++){var r=e(n[t],t);if(r.isSome())return r}return k.none()},qo="unknown";(Fr=Rr||(Rr={}))[Fr.STOP=0]="STOP",Fr[Fr.NORMAL=1]="NORMAL",Fr[Fr.LOGGING=2]="LOGGING";var Xo=Ao({}),Yo=function(e,n,t){var r,o,i,u;switch(St(Xo.get(),e).orThunk(function(){var n=E(Xo.get());return _o(n,function(n){return-1<e.indexOf(n)?k.some(Xo.get()[n]):k.none()})}).getOr(Rr.NORMAL)){case Rr.NORMAL:return t(Zo());case Rr.LOGGING:var a=(r=e,o=n,i=[],u=(new Date).getTime(),{logEventCut:function(n,e,t){i.push({outcome:"cut",target:e,purpose:t})},logEventStopped:function(n,e,t){i.push({outcome:"stopped",target:e,purpose:t})},logNoParent:function(n,e,t){i.push({outcome:"no-parent",target:e,purpose:t})},logEventNoHandlers:function(n,e){i.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(n,e,t){i.push({outcome:"response",purpose:t,target:e})},write:function(){var n=(new Date).getTime();wn(["mousemove","mouseover","mouseout",oe()],r)||console.log(r,{event:r,time:n-u,target:o.dom(),sequence:Sn(i,function(n){return wn(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+Go(n.target)+")":n.outcome})})}}),c=t(a);return a.write(),c;case Rr.STOP:return!0}},Ko=["alloy/data/Fields","alloy/debugging/Debugging"],Jo=function(){var n=new Error;if(n.stack===undefined)return qo;var e=n.stack.split("\n");return Cn(e,function(e){return 0<e.indexOf("alloy")&&!Dn(Ko,function(n){return-1<e.indexOf(n)}).isSome()}).getOr(qo)},Qo=function(n,e,t){return Yo(n,e,t)},Zo=h({logEventCut:x,logEventStopped:x,logNoParent:x,logEventNoHandlers:x,logEventResponse:x,write:x}),ni=h([yr("menu"),yr("selectedMenu")]),ei=h([yr("item"),yr("selectedItem")]),ti=(h(tr(ei().concat(ni()))),h(tr(ei()))),ri=wr("initSize",[yr("numColumns"),yr("numRows")]),oi=function(n,e,t){return Jo(),ur(e,e,t,sr(function(t){return it.value(function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.apply(undefined,n)})}))},ii=function(n){return oi(0,n,dt(x))},ui=function(n){return oi(0,n,dt(k.none))},ai=function(n){return oi(0,n,mt())},ci=function(n){return oi(0,n,mt())},fi=function(n,e){return Cr(n,h(e))},si=function(n){return Cr(n,b)},li=h(ri),di=[xr("channels",lr(it.value,er([ai("onReceive"),kr("schema",hr())])))],mi=co({fields:di,name:"receiving",active:$o}),gi=function(n,e,t){var r=e.aria;r.update(n,r,t.get())},pi=function(e,n,t){n.toggleClass.each(function(n){t.get()?So(e.element(),n):To(e.element(),n)})},vi=function(n,e,t){yi(n,e,t,!t.get())},hi=function(n,e,t){t.set(!0),pi(n,e,t),gi(n,e,t)},bi=function(n,e,t){t.set(!1),pi(n,e,t),gi(n,e,t)},yi=function(n,e,t,r){(r?hi:bi)(n,e,t)},xi=function(n,e,t){yi(n,e,t,e.selected)},wi=Object.freeze({onLoad:xi,toggle:vi,isOn:function(n,e,t){return t.get()},on:hi,off:bi,set:yi}),Si=Object.freeze({exhibit:function(n,e,t){return Qr({})},events:function(n,e){var t,r,o,i=(t=n,r=e,o=vi,Yr(function(n){o(n,t,r)})),u=Zr(n,e,xi);return zr(In([n.toggleOnExecute?[i]:[],[u]]))}}),Oi=Object.freeze({init:function(n){var e=Ao(!1);return{readState:function(){return e.get()},get:function(){return e.get()},set:function(n){return e.set(n)},clear:function(){return e.set(!1)}}}}),Ti=function(n,e,t){mo(n.element(),"aria-expanded",t)},ki=[kr("selected",!1),Sr("toggleClass"),kr("toggleOnExecute",!0),Er("aria",{mode:"none"},vr("mode",{pressed:[kr("syncWithExpanded",!1),fi("update",function(n,e,t){mo(n.element(),"aria-pressed",t),e.syncWithExpanded&&Ti(n,e,t)})],checked:[fi("update",function(n,e,t){mo(n.element(),"aria-checked",t)})],expanded:[fi("update",Ti)],selected:[fi("update",function(n,e,t){mo(n.element(),"aria-selected",t)})],none:[fi("update",x)]}))],Ei=co({fields:ki,name:"toggling",active:Si,apis:wi,state:Oi}),Ci=function(t,r){return mi.config({channels:Ot(jo.formatChanged(),{onReceive:function(n,e){e.command===t&&r(n,e.state)}})})},Di=function(n){return mi.config({channels:Ot(jo.orientationChanged(),{onReceive:n})})},Mi=function(n,e){return{key:n,value:{onReceive:e}}},Ai="tinymce-mobile",Ii={resolve:function(n){return Ai+"-"+n},prefix:h(Ai)},Bi=function(n,e){e.ignore||(Io(n.element()),e.onFocus(n))},Ri=Object.freeze({focus:Bi,blur:function(n,e){e.ignore||Bo(n.element())},isFocused:function(n){return e=n.element(),t=ze(e).dom(),e.dom()===t.activeElement;var e,t}}),Fi=Object.freeze({exhibit:function(n,e){var t=e.ignore?{}:{attributes:{tabindex:"-1"}};return Qr(t)},events:function(t){return zr([Pr(Yn(),function(n,e){Bi(n,t),e.stop()})].concat(t.stopMousedown?[Pr(N(),function(n,e){e.event().prevent()})]:[]))}}),Vi=[ii("onFocus"),kr("stopMousedown",!1),kr("ignore",!1)],Ni=co({fields:Vi,name:"focusing",active:Fi,apis:Ri}),Hi=function(n){return n.style!==undefined},ji=function(n,e,t){if(!gn(t))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);Hi(n)&&n.style.setProperty(e,t)},zi=function(n,e,t){var r=n.dom();ji(r,e,t)},Li=function(n,e){var t=n.dom();D(e,function(n,e){ji(t,e,n)})},Pi=function(n,e){var t=n.dom(),r=window.getComputedStyle(t).getPropertyValue(e),o=""!==r||Se(n)?r:Ui(t,e);return null===o?undefined:o},Ui=function(n,e){return Hi(n)?n.style.getPropertyValue(e):""},Gi=function(n,e){var t=n.dom(),r=Ui(t,e);return k.from(r).filter(function(n){return 0<n.length})},$i=function(n,e){var t,r,o=n.dom();r=e,Hi(t=o)&&t.style.removeProperty(r),vo(n,"style")&&""===po(n,"style").replace(/^\s+|\s+$/g,"")&&ho(n,"style")},Wi=function(n){return n.dom().offsetWidth};function _i(r,o){var n=function(n){var e=o(n);if(e<=0||null===e){var t=Pi(n,r);return parseFloat(t)||0}return e},i=function(o,n){return En(n,function(n,e){var t=Pi(o,e),r=t===undefined?0:parseInt(t,10);return isNaN(r)?n:n+r},0)};return{set:function(n,e){if(!yn(e)&&!e.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+e);var t=n.dom();Hi(t)&&(t.style[r]=e+"px")},get:n,getOuter:n,aggregate:i,max:function(n,e,t){var r=i(n,t);return r<e?e-r:0}}}var qi,Xi,Yi=_i("height",function(n){var e=n.dom();return Se(n)?e.getBoundingClientRect().height:e.offsetHeight}),Ki=function(n){return Yi.get(n)},Ji=function(n,e,t){return Tn(function(n,e){for(var t=bn(e)?e:h(!1),r=n.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=ge.fromDom(i);if(o.push(u),!0===t(u))break;r=i}return o}(n,t),e)},Qi=function(n,e){return Tn(Le(t=n).map(Pe).map(function(n){return Tn(n,function(n){return!je(t,n)})}).getOr([]),e);var t},Zi=function(n,e){return Ne(e,n)},nu=function(n){return He(n)},eu=function(n,e,t){return Vr(n,function(n){return Fe(n,e)},t)},tu=function(n,e){return He(e,n)},ru=function(n,e,t){return Ir(Fe,eu,n,e,t)},ou=function(n,e,t){var r=Vn(n.slice(0,e)),o=Vn(n.slice(e+1));return Cn(r.concat(o),t)},iu=function(n,e,t){var r=Vn(n.slice(0,e));return Cn(r,t)},uu=function(n,e,t){var r=n.slice(0,e),o=n.slice(e+1);return Cn(o.concat(r),t)},au=function(n,e,t){var r=n.slice(e+1);return Cn(r,t)},cu=function(t){return function(n){var e=n.raw();return wn(t,e.which)}},fu=function(n){return function(e){return Rn(n,function(n){return n(e)})}},su=function(n){return!0===n.raw().shiftKey},lu=function(n){return!0===n.raw().ctrlKey},du=S(su),mu=function(n,e){return{matches:n,classification:e}},gu=function(n,e,t,r){var o=n+e;return r<o?t:o<t?r:o},pu=function(n,e,t){return n<=e?e:t<=n?t:n},vu=function(e,t,n){var r=Zi(e.element(),"."+t.highlightClass);On(r,function(n){To(n,t.highlightClass),e.getSystem().getByDom(n).each(function(n){t.onDehighlight(e,n)})})},hu=function(n,e,t,r){var o=bu(n,e,t,r);vu(n,e),So(r.element(),e.highlightClass),o||e.onHighlight(n,r)},bu=function(n,e,t,r){return ko(r.element(),e.highlightClass)},yu=function(n,e,t,r){var o=Zi(n.element(),"."+e.itemClass);return k.from(o[r]).fold(function(){return it.error("No element found with index "+r)},n.getSystem().getByDom)},xu=function(e,n,t){return tu(e.element(),"."+n.itemClass).bind(function(n){return e.getSystem().getByDom(n).toOption()})},wu=function(e,n,t){var r=Zi(e.element(),"."+n.itemClass);return(0<r.length?k.some(r[r.length-1]):k.none()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Su=function(t,e,n,r){var o=Zi(t.element(),"."+e.itemClass);return Dn(o,function(n){return ko(n,e.highlightClass)}).bind(function(n){var e=gu(n,r,0,o.length-1);return t.getSystem().getByDom(o[e]).toOption()})},Ou=function(e,n,t){var r=Zi(e.element(),"."+n.itemClass);return Wo(Sn(r,function(n){return e.getSystem().getByDom(n).toOption()}))},Tu=Object.freeze({dehighlightAll:vu,dehighlight:function(n,e,t,r){var o=bu(n,e,t,r);To(r.element(),e.highlightClass),o&&e.onDehighlight(n,r)},highlight:hu,highlightFirst:function(e,t,r){xu(e,t,r).each(function(n){hu(e,t,r,n)})},highlightLast:function(e,t,r){wu(e,t,r).each(function(n){hu(e,t,r,n)})},highlightAt:function(e,t,r,n){yu(e,t,r,n).fold(function(n){throw new Error(n)},function(n){hu(e,t,r,n)})},highlightBy:function(e,t,r,n){var o=Ou(e,t,r);Cn(o,n).each(function(n){hu(e,t,r,n)})},isHighlighted:bu,getHighlighted:function(e,n,t){return tu(e.element(),"."+n.highlightClass).bind(function(n){return e.getSystem().getByDom(n).toOption()})},getFirst:xu,getLast:wu,getPrevious:function(n,e,t){return Su(n,e,0,-1)},getNext:function(n,e,t){return Su(n,e,0,1)},getCandidates:Ou}),ku=[yr("highlightClass"),yr("itemClass"),ii("onHighlight"),ii("onDehighlight")],Eu=co({fields:ku,name:"highlighting",apis:Tu}),Cu=function(n,e,t){e.exists(function(e){return t.exists(function(n){return je(n,e)})})||fe(n,ae(),{prevFocus:e,newFocus:t})},Du=function(){var o=function(n){return Fo(n.element())};return{get:o,set:function(n,e){var t=o(n);n.getSystem().triggerFocus(e,n.element());var r=o(n);Cu(n,t,r)}}};(Xi=qi||(qi={})).OnFocusMode="onFocus",Xi.OnEnterOrSpaceMode="onEnterOrSpace",Xi.OnApiMode="onApi";var Mu,Au,Iu=function(n,e,t,r,a){var c=function(e,t,n,r,o){var i,u,a=n(e,t,r,o);return(i=a,u=t.event(),Cn(i,function(n){return n.matches(u)}).map(function(n){return n.classification})).bind(function(n){return n(e,t,r,o)})},o={schema:function(){return n.concat([kr("focusManager",Du()),Er("focusInside","onFocus",sr(function(n){return wn(["onFocus","onEnterOrSpace","onApi"],n)?it.value(n):it.error("Invalid value for focusInside")})),fi("handler",o),fi("state",e),fi("sendFocusIn",a)])},processKey:c,toEvents:function(i,u){var n=i.focusInside!==qi.OnFocusMode?k.none():a(i).map(function(t){return Pr(Yn(),function(n,e){t(n,i,u),e.stop()})});return zr(n.toArray().concat([Pr(L(),function(r,o){c(r,o,t,i,u).fold(function(){var e,t,n;e=r,t=o,n=cu([32].concat([13]))(t.event()),i.focusInside===qi.OnEnterOrSpaceMode&&n&&Dr(e,t)&&a(i).each(function(n){n(e,i,u),t.stop()})},function(n){o.stop()})}),Pr(P(),function(n,e){c(n,e,r,i,u).each(function(n){e.stop()})})]))}};return o},Bu=function(n){var e=[Sr("onEscape"),Sr("onEnter"),kr("selector",'[data-alloy-tabstop="true"]'),kr("firstTabstop",0),kr("useTabstopAt",h(!0)),Sr("visibilitySelector")].concat([n]),u=function(n,e){var t=n.visibilitySelector.bind(function(n){return ru(e,n)}).getOr(e);return 0<Ki(t)},t=function(e,t){var n,r,o,i;(n=e,r=t,o=Zi(n.element(),r.selector),i=Tn(o,function(n){return u(r,n)}),k.from(i[r.firstTabstop])).each(function(n){t.focusManager.set(e,n)})},a=function(e,n,t,r,o){return o(n,t,function(n){return u(e=r,t=n)&&e.useTabstopAt(t);var e,t}).fold(function(){return r.cyclic?k.some(!0):k.none()},function(n){return r.focusManager.set(e,n),k.some(!0)})},i=function(e,n,t,r){var o,i,u=Zi(e.element(),t.selector);return(o=e,i=t,i.focusManager.get(o).bind(function(n){return ru(n,i.selector)})).bind(function(n){return Dn(u,l(je,n)).bind(function(n){return a(e,u,n,t,r)})})},r=h([mu(fu([su,cu([9])]),function(n,e,t,r){var o=t.cyclic?ou:iu;return i(n,0,t,o)}),mu(cu([9]),function(n,e,t,r){var o=t.cyclic?uu:au;return i(n,0,t,o)}),mu(cu([27]),function(e,t,n,r){return n.onEscape.bind(function(n){return n(e,t)})}),mu(fu([du,cu([13])]),function(e,t,n,r){return n.onEnter.bind(function(n){return n(e,t)})})]),o=h([]);return Iu(e,oo.init,r,o,function(){return k.some(t)})},Ru=Bu(Cr("cyclic",h(!1))),Fu=Bu(Cr("cyclic",h(!0))),Vu=function(n){return"input"===be(n)&&"radio"!==po(n,"type")||"textarea"===be(n)},Nu=function(n,e,t){return Vu(t)&&cu([32])(e.event())?k.none():(le(n,t,Zn()),k.some(!0))},Hu=function(n,e){return k.some(!0)},ju=[kr("execute",Nu),kr("useSpace",!1),kr("useEnter",!0),kr("useControlEnter",!1),kr("useDown",!1)],zu=function(n,e,t){return t.execute(n,e,n.element())},Lu=Iu(ju,oo.init,function(n,e,t,r){var o=t.useSpace&&!Vu(n.element())?[32]:[],i=t.useEnter?[13]:[],u=t.useDown?[40]:[],a=o.concat(i).concat(u);return[mu(cu(a),zu)].concat(t.useControlEnter?[mu(fu([lu,cu([13])]),zu)]:[])},function(n,e,t,r){return t.useSpace&&!Vu(n.element())?[mu(cu([32]),Hu)]:[]},function(){return k.none()}),Pu=function(n){var t=Ao(k.none());return io({readState:function(){return t.get().map(function(n){return{numRows:n.numRows(),numColumns:n.numColumns()}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(n,e){t.set(k.some({numRows:h(n),numColumns:h(e)}))},getNumRows:function(){return t.get().map(function(n){return n.numRows()})},getNumColumns:function(){return t.get().map(function(n){return n.numColumns()})}})},Uu=Object.freeze({flatgrid:Pu,init:function(n){return n.state(n)}}),Gu=function(e,t){return function(n){return"rtl"===$u(n)?t:e}},$u=function(n){return"rtl"===Pi(n,"direction")?"rtl":"ltr"},Wu=function(i){return function(n,e,t,r){var o=i(n.element());return Yu(o,n,e,t,r)}},_u=function(n,e){var t=Gu(n,e);return Wu(t)},qu=function(n,e){var t=Gu(e,n);return Wu(t)},Xu=function(o){return function(n,e,t,r){return Yu(o,n,e,t,r)}},Yu=function(e,t,n,r,o){return r.focusManager.get(t).bind(function(n){return e(t.element(),n,r,o)}).map(function(n){return r.focusManager.set(t,n),!0})},Ku=Xu,Ju=Xu,Qu=Xu,Zu=function(n){var e,t=n.dom();return!((e=t).offsetWidth<=0&&e.offsetHeight<=0)},na=De(["index","candidates"],[]),ea=function(n,e,t){return ta(n,e,t,Zu)},ta=function(n,e,t,r){var o,i=l(je,e),u=Zi(n,t),a=Tn(u,Zu);return Dn(o=a,i).map(function(n){return na({index:n,candidates:o})})},ra=function(n,e){return Dn(n,function(n){return je(e,n)})},oa=function(t,n,r,e){return e(Math.floor(n/r),n%r).bind(function(n){var e=n.row()*r+n.column();return 0<=e&&e<t.length?k.some(t[e]):k.none()})},ia=function(o,n,i,u,a){return oa(o,n,u,function(n,e){var t=n===i-1?o.length-n*u:u,r=gu(e,a,0,t-1);return k.some({row:h(n),column:h(r)})})},ua=function(i,n,u,a,c){return oa(i,n,a,function(n,e){var t=gu(n,c,0,u-1),r=t===u-1?i.length-t*a:a,o=pu(e,0,r-1);return k.some({row:h(t),column:h(o)})})},aa=[yr("selector"),kr("execute",Nu),ui("onEscape"),kr("captureTab",!1),li()],ca=function(e,t,n){tu(e.element(),t.selector).each(function(n){t.focusManager.set(e,n)})},fa=function(o){return function(n,e,t,r){return ea(n,e,t.selector).bind(function(n){return o(n.candidates(),n.index(),r.getNumRows().getOr(t.initSize.numRows),r.getNumColumns().getOr(t.initSize.numColumns))})}},sa=function(n,e,t,r){return t.captureTab?k.some(!0):k.none()},la=fa(function(n,e,t,r){return ia(n,e,t,r,-1)}),da=fa(function(n,e,t,r){return ia(n,e,t,r,1)}),ma=fa(function(n,e,t,r){return ua(n,e,t,r,-1)}),ga=fa(function(n,e,t,r){return ua(n,e,t,r,1)}),pa=h([mu(cu([37]),_u(la,da)),mu(cu([39]),qu(la,da)),mu(cu([38]),Ku(ma)),mu(cu([40]),Ju(ga)),mu(fu([su,cu([9])]),sa),mu(fu([du,cu([9])]),sa),mu(cu([27]),function(n,e,t,r){return t.onEscape(n,e)}),mu(cu([32].concat([13])),function(e,t,r,n){return(o=e,i=r,i.focusManager.get(o).bind(function(n){return ru(n,i.selector)})).bind(function(n){return r.execute(e,t,n)});var o,i})]),va=h([mu(cu([32]),Hu)]),ha=Iu(aa,Pu,pa,va,function(){return k.some(ca)}),ba=function(n,e,t,i){var u=function(n,e,t){var r,o=gu(e,i,0,t.length-1);return o===n?k.none():(r=t[o],"button"===be(r)&&"disabled"===po(r,"disabled")?u(n,o,t):k.from(t[o]))};return ea(n,t,e).bind(function(n){var e=n.index(),t=n.candidates();return u(e,e,t)})},ya=[yr("selector"),kr("getInitial",k.none),kr("execute",Nu),ui("onEscape"),kr("executeOnMove",!1),kr("allowVertical",!0)],xa=function(e,t,r){return(n=e,o=r,o.focusManager.get(n).bind(function(n){return ru(n,o.selector)})).bind(function(n){return r.execute(e,t,n)});var n,o},wa=function(e,t){t.getInitial(e).orThunk(function(){return tu(e.element(),t.selector)}).each(function(n){t.focusManager.set(e,n)})},Sa=function(n,e,t){return ba(n,t.selector,e,-1)},Oa=function(n,e,t){return ba(n,t.selector,e,1)},Ta=function(r){return function(n,e,t){return r(n,e,t).bind(function(){return t.executeOnMove?xa(n,e,t):k.some(!0)})}},ka=function(n,e,t,r){return t.onEscape(n,e)},Ea=h([mu(cu([32]),Hu)]),Ca=Iu(ya,oo.init,function(n,e,t,r){var o=[37].concat(t.allowVertical?[38]:[]),i=[39].concat(t.allowVertical?[40]:[]);return[mu(cu(o),Ta(_u(Sa,Oa))),mu(cu(i),Ta(qu(Sa,Oa))),mu(cu([13]),xa),mu(cu([32]),xa),mu(cu([27]),ka)]},Ea,function(){return k.some(wa)}),Da=De(["rowIndex","columnIndex","cell"],[]),Ma=function(n,e,t){return k.from(n[e]).bind(function(n){return k.from(n[t]).map(function(n){return Da({rowIndex:e,columnIndex:t,cell:n})})})},Aa=function(n,e,t,r){var o=n[e].length,i=gu(t,r,0,o-1);return Ma(n,e,i)},Ia=function(n,e,t,r){var o=gu(t,r,0,n.length-1),i=n[o].length,u=pu(e,0,i-1);return Ma(n,o,u)},Ba=function(n,e,t,r){var o=n[e].length,i=pu(t+r,0,o-1);return Ma(n,e,i)},Ra=function(n,e,t,r){var o=pu(t+r,0,n.length-1),i=n[o].length,u=pu(e,0,i-1);return Ma(n,o,u)},Fa=[wr("selectors",[yr("row"),yr("cell")]),kr("cycles",!0),kr("previousSelector",k.none),kr("execute",Nu)],Va=function(e,t){t.previousSelector(e).orThunk(function(){var n=t.selectors;return tu(e.element(),n.cell)}).each(function(n){t.focusManager.set(e,n)})},Na=function(n,e){return function(t,r,i){var u=i.cycles?n:e;return ru(r,i.selectors.row).bind(function(n){var e=Zi(n,i.selectors.cell);return ra(e,r).bind(function(r){var o=Zi(t,i.selectors.row);return ra(o,n).bind(function(n){var e,t=(e=i,Sn(o,function(n){return Zi(n,e.selectors.cell)}));return u(t,n,r).map(function(n){return n.cell()})})})})}},Ha=Na(function(n,e,t){return Aa(n,e,t,-1)},function(n,e,t){return Ba(n,e,t,-1)}),ja=Na(function(n,e,t){return Aa(n,e,t,1)},function(n,e,t){return Ba(n,e,t,1)}),za=Na(function(n,e,t){return Ia(n,t,e,-1)},function(n,e,t){return Ra(n,t,e,-1)}),La=Na(function(n,e,t){return Ia(n,t,e,1)},function(n,e,t){return Ra(n,t,e,1)}),Pa=h([mu(cu([37]),_u(Ha,ja)),mu(cu([39]),qu(Ha,ja)),mu(cu([38]),Ku(za)),mu(cu([40]),Ju(La)),mu(cu([32].concat([13])),function(e,t,r){return Fo(e.element()).bind(function(n){return r.execute(e,t,n)})})]),Ua=h([mu(cu([32]),Hu)]),Ga=Iu(Fa,oo.init,Pa,Ua,function(){return k.some(Va)}),$a=[yr("selector"),kr("execute",Nu),kr("moveOnTab",!1)],Wa=function(e,t,r){return r.focusManager.get(e).bind(function(n){return r.execute(e,t,n)})},_a=function(e,t){tu(e.element(),t.selector).each(function(n){t.focusManager.set(e,n)})},qa=function(n,e,t){return ba(n,t.selector,e,-1)},Xa=function(n,e,t){return ba(n,t.selector,e,1)},Ya=h([mu(cu([38]),Qu(qa)),mu(cu([40]),Qu(Xa)),mu(fu([su,cu([9])]),function(n,e,t){return t.moveOnTab?Qu(qa)(n,e,t):k.none()}),mu(fu([du,cu([9])]),function(n,e,t){return t.moveOnTab?Qu(Xa)(n,e,t):k.none()}),mu(cu([13]),Wa),mu(cu([32]),Wa)]),Ka=h([mu(cu([32]),Hu)]),Ja=Iu($a,oo.init,Ya,Ka,function(){return k.some(_a)}),Qa=[ui("onSpace"),ui("onEnter"),ui("onShiftEnter"),ui("onLeft"),ui("onRight"),ui("onTab"),ui("onShiftTab"),ui("onUp"),ui("onDown"),ui("onEscape"),kr("stopSpaceKeyup",!1),Sr("focusIn")],Za=Iu(Qa,oo.init,function(n,e,t){return[mu(cu([32]),t.onSpace),mu(fu([du,cu([13])]),t.onEnter),mu(fu([su,cu([13])]),t.onShiftEnter),mu(fu([su,cu([9])]),t.onShiftTab),mu(fu([du,cu([9])]),t.onTab),mu(cu([38]),t.onUp),mu(cu([40]),t.onDown),mu(cu([37]),t.onLeft),mu(cu([39]),t.onRight),mu(cu([32]),t.onSpace),mu(cu([27]),t.onEscape)]},function(n,e,t){return t.stopSpaceKeyup?[mu(cu([32]),Hu)]:[]},function(n){return n.focusIn}),nc=Ru.schema(),ec=Fu.schema(),tc=Ca.schema(),rc=ha.schema(),oc=Ga.schema(),ic=Lu.schema(),uc=Ja.schema(),ac=Za.schema(),cc=(Au=gr("Creating behaviour: "+(Mu={branchKey:"mode",branches:Object.freeze({acyclic:nc,cyclic:ec,flow:tc,flatgrid:rc,matrix:oc,execution:ic,menu:uc,special:ac}),name:"keying",active:{events:function(n,e){return n.handler.toEvents(n,e)}},apis:{focusIn:function(e,t,r){t.sendFocusIn(t).fold(function(){e.getSystem().triggerFocus(e.element(),e.element())},function(n){n(e,t,r)})},setGridSize:function(n,e,t,r,o){Et(t,"setGridSize")?t.setGridSize(r,o):console.error("Layout does not support setGridSize")}},state:Uu}).name,fo,Mu),no(vr(Au.branchKey,Au.branches),Au.name,Au.active,Au.apis,Au.extra,Au.state)),fc=function(r,n){return e=r,t={},o=Sn(n,function(n){return e=n.name(),t="Cannot configure "+n.name()+" for "+r,ur(e,e,gt(),nr(function(n){return Nt("The field: "+e+" is forbidden. "+t)}));var e,t}).concat([Cr("dump",b)]),ur(e,e,dt(t),tr(o));var e,t,o},sc=function(n){return n.dump},lc=function(n,e){return y({},n.dump,uo(e))},dc=fc,mc=lc,gc="placeholder",pc=ut([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),vc=function(n,e,t,r){return t.uiType===gc?(i=t,u=r,(o=n).exists(function(n){return n!==i.owner})?pc.single(!0,h(i)):St(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+E(u)+"]\nNamespace: "+o.getOr("none")+"\nSpec: "+qt(i,null,2))},function(n){return n.replace()})):pc.single(!1,h(t));var o,i,u},hc=function(i,u,a,c){return vc(i,0,a,c).fold(function(n,e){var t=e(u,a.config,a.validated),r=St(t,"components").getOr([]),o=Bn(r,function(n){return hc(i,u,n,c)});return[y({},t,{components:o})]},function(n,e){var t=e(u,a.config,a.validated);return a.validated.preprocess.getOr(b)(t)})},bc=function(e,t,n,r){var o,i,u,a=M(r,function(n,e){return r=n,o=!1,{name:h(t=e),required:function(){return r.fold(function(n,e){return n},function(n,e){return n})},used:function(){return o},replace:function(){if(!0===o)throw new Error("Trying to use the same placeholder more than once: "+t);return o=!0,r}};var t,r,o}),c=(o=e,i=t,u=a,Bn(n,function(n){return hc(o,i,n,u)}));return D(a,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+qt(t.components,null,2))}),c},yc=pc.single,xc=pc.multiple,wc=h(gc),Sc=0,Oc=function(n){var e=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++Sc+String(e)},Tc=ut([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),kc=kr("factory",{sketch:b}),Ec=kr("schema",[]),Cc=yr("name"),Dc=ur("pname","pname",pt(function(n){return"<alloy."+Oc(n.name)+">"}),hr()),Mc=Cr("schema",function(){return[Sr("preprocess")]}),Ac=kr("defaults",h({})),Ic=kr("overrides",h({})),Bc=tr([kc,Ec,Cc,Dc,Ac,Ic]),Rc=tr([kc,Ec,Cc,Ac,Ic]),Fc=tr([kc,Ec,Cc,Dc,Ac,Ic]),Vc=tr([kc,Mc,Cc,yr("unit"),Dc,Ac,Ic]),Nc=function(n){var e=function(n){return n.name};return n.fold(e,e,e,e)},Hc=function(t,r){return function(n){var e=gr("Converting part type",r,n);return t(e)}},jc=Hc(Tc.required,Bc),zc=(Hc(Tc.external,Rc),Hc(Tc.optional,Fc)),Lc=Hc(Tc.group,Vc),Pc=h("entirety"),Uc=function(n,e,t,r){return ft(e.defaults(n,t,r),t,{uid:n.partUids[e.name]},e.overrides(n,t,r))},Gc=function(o,n){var i={};return On(n,function(n){var e;(e=n,e.fold(k.some,k.none,k.some,k.some)).each(function(t){var r=$c(o,t.pname);i[t.name]=function(n){var e=gr("Part: "+t.name+" in "+o,tr(t.schema),n);return y({},r,{config:n,validated:e})}})}),i},$c=function(n,e){return{uiType:wc(),owner:n,name:e}},Wc=function(n,e,t){return r=e,i={},o={},On(t,function(n){n.fold(function(r){i[r.pname]=yc(!0,function(n,e,t){return r.factory.sketch(Uc(n,r,e,t))})},function(n){var e=r.parts[n.name];o[n.name]=h(n.factory.sketch(Uc(r,n,e[Pc()]),e))},function(r){i[r.pname]=yc(!1,function(n,e,t){return r.factory.sketch(Uc(n,r,e,t))})},function(o){i[o.pname]=xc(!0,function(e,n,t){var r=e[o.name];return Sn(r,function(n){return o.factory.sketch(ft(o.defaults(e,n,t),n,o.overrides(e,n)))})})})}),{internals:h(i),externals:h(o)};var r,i,o},_c=function(n,e,t){return bc(k.some(n),e,e.components,t)},qc=function(n,e,t){var r=e.partUids[t];return n.getSystem().getByUid(r).toOption()},Xc=function(n,e,t){return qc(n,e,t).getOrDie("Could not find part: "+t)},Yc=function(e,n){var t=Sn(n,Nc);return Tt(Sn(t,function(n){return{key:n,value:e+"-"+n}}))},Kc=function(e){return ur("partUids","partUids",vt(function(n){return Yc(n.uid,e)}),hr())},Jc=Oc("alloy-premade"),Qc=function(n){return Ot(Jc,n)},Zc=function(r){return n=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return r.apply(undefined,[n.getApis()].concat([n].concat(e)))},e=r.toString(),t=e.indexOf(")")+1,o=e.indexOf("("),i=e.substring(o+1,t-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Kr(i.slice(1))}},n;var n,e,t,o,i},nf=h("alloy-id-"),ef=h("data-alloy-id"),tf=nf(),rf=ef(),of=function(n,e){Object.defineProperty(n.dom(),rf,{value:e,writable:!0})},uf=function(n){var e=xe(n)?n.dom()[rf]:null;return k.from(e)},af=function(n){return Oc(n)},cf=function(n,e,t,r,o){var i,u,a=(u=o,(0<(i=r).length?[wr("parts",i)]:[]).concat([yr("uid"),kr("dom",{}),kr("components",[]),si("originalSpec"),kr("debug.sketcher",{})]).concat(u));return gr(n+" [SpecSchema]",er(a.concat(e)),t)},ff=function(n,e,t,r,o){var i=sf(o),u=Bn(t,function(n){return n.fold(k.none,k.some,k.none,k.none).map(function(n){return wr(n.name,n.schema.concat([si(Pc())]))}).toArray()}),a=Kc(t),c=cf(n,e,i,u,[a]),f=Wc(0,c,t);return r(c,_c(n,c,f.internals()),i,f.externals())},sf=function(n){return n.hasOwnProperty("uid")?n:y({},n,{uid:af("uid")})},lf=er([yr("name"),yr("factory"),yr("configFields"),kr("apis",{}),kr("extraApis",{})]),df=er([yr("name"),yr("factory"),yr("configFields"),yr("partFields"),kr("apis",{}),kr("extraApis",{})]),mf=function(n){var i=gr("Sketcher for "+n.name,lf,n),e=M(i.apis,Zc),t=M(i.extraApis,function(n,e){return Jr(n,e)});return y({name:h(i.name),partFields:h([]),configFields:h(i.configFields),sketch:function(n){return e=i.name,t=i.configFields,r=i.factory,o=sf(n),r(cf(e,t,o,[],[]),o);var e,t,r,o}},e,t)},gf=function(n){var e=gr("Sketcher for "+n.name,df,n),t=Gc(e.name,e.partFields),r=M(e.apis,Zc),o=M(e.extraApis,function(n,e){return Jr(n,e)});return y({name:h(e.name),partFields:h(e.partFields),configFields:h(e.configFields),sketch:function(n){return ff(e.name,e.configFields,e.partFields,e.factory,n)},parts:h(t)},r,o)},pf=mf({name:"Button",factory:function(n){var e,t,r,o=(e=n.action,t=function(n,e){e.stop(),se(n)},r=qn.detect().deviceType.isTouch()?[Pr(ee(),t)]:[Pr($(),t),Pr(N(),function(n,e){e.cut()})],zr(In([e.map(function(t){return Pr(Zn(),function(n,e){t(n),e.stop()})}).toArray(),r]))),i=n.dom.tag,u=function(e){return St(n.dom,"attributes").bind(function(n){return St(n,e)})};return{uid:n.uid,dom:n.dom,components:n.components,events:o,behaviours:mc(n.buttonBehaviours,[Ni.config({}),cc.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==i)return{role:u("role").getOr("button")};var n=u("type").getOr("button"),e=u("role").map(function(n){return{role:n}}).getOr({});return y({type:n},e)}()},eventOrder:n.eventOrder}},configFields:[kr("uid",undefined),yr("dom"),kr("components",[]),dc("buttonBehaviours",[Ni,cc]),Sr("action"),Sr("role"),kr("eventOrder",{})]}),vf=co({fields:[],name:"unselecting",active:Object.freeze({events:function(n){return zr([Lr(_(),h(!0))])},exhibit:function(n,e){return Qr({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),hf=function(n){var e,t,r,o=ge.fromHtml(n),i=Pe(o),u=(t=(e=o).dom().attributes!==undefined?e.dom().attributes:[],En(t,function(n,e){var t;return"class"===e.name?n:y({},n,((t={})[e.name]=e.value,t))},{})),a=(r=o,Array.prototype.slice.call(r.dom().classList,0)),c=0===i.length?{}:{innerHtml:zo(o)};return y({tag:be(o),classes:a,attributes:u},c)},bf=function(n){var e,o,t=(e=n,o={prefix:Ii.prefix()},e.replace(/\$\{([^{}]*)\}/g,function(n,e){var t,r=o[e];return"string"==(t=typeof r)||"number"===t?r.toString():n}));return hf(t)},yf=function(n){return{dom:bf(n)}},xf=function(n){return uo([Ei.config({toggleClass:Ii.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Ci(n,function(n,e){(e?Ei.on:Ei.off)(n)})])},wf=function(n,e,t){return pf.sketch({dom:bf('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item ${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:e,buttonBehaviours:ft(uo([vf.config({})]),t)})},Sf={forToolbar:wf,forToolbarCommand:function(n,e){return wf(e,function(){n.execCommand(e)},{})},forToolbarStateAction:function(n,e,t,r){var o=xf(t);return wf(e,r,o)},forToolbarStateCommand:function(n,e){var t=xf(e);return wf(e,function(){n.execCommand(e)},t)}},Of=qn.detect().deviceType.isTouch(),Tf=zc({schema:[yr("dom")],name:"label"}),kf=function(n){return zc({name:n+"-edge",overrides:function(r){return r.model.manager.edgeActions[n].fold(function(){return{}},function(t){var n=zr([Ur(R(),t,[r])]),e=zr([Ur(N(),t,[r]),Ur(H(),function(n,e){e.mouseIsDown.get()&&t(n,e)},[r])]);return{events:Of?n:e}})}})},Ef=kf("top-left"),Cf=kf("top"),Df=kf("top-right"),Mf=kf("right"),Af=kf("bottom-right"),If=kf("bottom"),Bf=kf("bottom-left"),Rf=[Tf,kf("left"),Mf,Cf,If,Ef,Df,Bf,Af,jc({name:"thumb",defaults:h({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:zr([$r(R(),n,"spectrum"),$r(F(),n,"spectrum"),$r(V(),n,"spectrum"),$r(N(),n,"spectrum"),$r(H(),n,"spectrum"),$r(j(),n,"spectrum")])}}}),jc({schema:[Cr("mouseIsDown",function(){return Ao(!1)})],name:"spectrum",overrides:function(t){var r=t.model.manager,o=function(e,n){return r.getValueFromEvent(n).map(function(n){return r.setValueFrom(e,t,n)})},n=zr([Pr(R(),o),Pr(F(),o)]),e=zr([Pr(N(),o),Pr(H(),function(n,e){t.mouseIsDown.get()&&o(n,e)})]);return{behaviours:uo(Of?[]:[cc.config({mode:"special",onLeft:function(n){return r.onLeft(n,t)},onRight:function(n){return r.onRight(n,t)},onUp:function(n){return r.onUp(n,t)},onDown:function(n){return r.onDown(n,t)}}),Ni.config({})]),events:Of?n:e}}})],Ff=function(n,e,t){e.store.manager.onLoad(n,e,t)},Vf=function(n,e,t){e.store.manager.onUnload(n,e,t)},Nf=Object.freeze({onLoad:Ff,onUnload:Vf,setValue:function(n,e,t,r){e.store.manager.setValue(n,e,t,r)},getValue:function(n,e,t){return e.store.manager.getValue(n,e,t)},getState:function(n,e,t){return t}}),Hf=Object.freeze({events:function(t,r){var n=t.resetOnDom?[_r(function(n,e){Ff(n,t,r)}),qr(function(n,e){Vf(n,t,r)})]:[Zr(t,r,Ff)];return zr(n)}}),jf=function(){var n=Ao(null);return io({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})},zf=function(){var i=Ao({}),u=Ao({});return io({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return St(i.get(),n).orThunk(function(){return St(u.get(),n)})},update:function(n){var e=i.get(),t=u.get(),r={},o={};On(n,function(e){r[e.value]=e,St(e,"meta").each(function(n){St(n,"text").each(function(n){o[n]=e})})}),i.set(y({},e,r)),u.set(y({},t,o))},clear:function(){i.set({}),u.set({})}})},Lf=Object.freeze({memory:jf,dataset:zf,manual:function(){return io({readState:function(){}})},init:function(n){return n.store.manager.state(n)}}),Pf=function(n,e,t,r){var o=e.store;t.update([r]),o.setValue(n,r),e.onSetValue(n,r)},Uf=[Sr("initialValue"),yr("getFallbackEntry"),yr("getDataKey"),yr("setValue"),fi("manager",{setValue:Pf,getValue:function(n,e,t){var r=e.store,o=r.getDataKey(n);return t.lookup(o).fold(function(){return r.getFallbackEntry(o)},function(n){return n})},onLoad:function(e,t,r){t.store.initialValue.each(function(n){Pf(e,t,r,n)})},onUnload:function(n,e,t){t.clear()},state:zf})],Gf=[yr("getValue"),kr("setValue",x),Sr("initialValue"),fi("manager",{setValue:function(n,e,t,r){e.store.setValue(n,r),e.onSetValue(n,r)},getValue:function(n,e,t){return e.store.getValue(n)},onLoad:function(e,t,n){t.store.initialValue.each(function(n){t.store.setValue(e,n)})},onUnload:x,state:oo.init})],$f=[Sr("initialValue"),fi("manager",{setValue:function(n,e,t,r){t.set(r),e.onSetValue(n,r)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store.initialValue.each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:jf})],Wf=[Er("store",{mode:"memory"},vr("mode",{memory:$f,manual:Gf,dataset:Uf})),ii("onSetValue"),kr("resetOnDom",!1)],_f=co({fields:Wf,name:"representing",active:Hf,apis:Nf,extra:{setValueFrom:function(n,e){var t=_f.getValue(e);_f.setValue(n,t)}},state:Lf}),qf=function(t,r){return{left:h(t),top:h(r),translate:function(n,e){return qf(t+n,r+e)}}},Xf=qf,Yf=qn.detect().deviceType.isTouch(),Kf=h("slider.change.value"),Jf=function(n){var e=n.event().raw();if(Yf){var t=e;return t.touches!==undefined&&1===t.touches.length?k.some(t.touches[0]).map(function(n){return Xf(n.clientX,n.clientY)}):k.none()}var r=e;return r.clientX!==undefined?k.some(r).map(function(n){return Xf(n.clientX,n.clientY)}):k.none()},Qf=function(n,e,t,r){return n<e?n:t<n?t:n===e?e-1:Math.max(e,n-r)},Zf=function(n,e,t,r){return t<n?n:n<e?e:n===t?t+1:Math.min(t,n+r)},ns=function(n,e,t){return Math.max(e,Math.min(t,n))},es=function(n){var e=n.min,t=n.max,r=n.range,o=n.value,i=n.step,u=n.snap,a=n.snapStart,c=n.rounded,f=n.hasMinEdge,s=n.hasMaxEdge,l=n.minBound,d=n.maxBound,m=n.screenRange,g=f?e-1:e,p=s?t+1:t;if(o<l)return g;if(d<o)return p;var v,h,b,y,x,w,S,O=(x=o,w=l,S=d,Math.min(S,Math.max(x,w))-w),T=ns(O/m*r+e,g,p);return u&&e<=T&&T<=t?(v=T,h=e,b=t,y=i,a.fold(function(){var n=v-h,e=Math.round(n/y)*y;return ns(h+e,h-1,b+1)},function(n){var e=(v-n)%y,t=Math.round(e/y),r=Math.floor((v-n)/y),o=Math.floor((b-n)/y),i=n+Math.min(o,r+t)*y;return Math.max(n,i)})):c?Math.round(T):T},ts=function(n){var e=n.min,t=n.max,r=n.range,o=n.value,i=n.hasMinEdge,u=n.hasMaxEdge,a=n.maxBound,c=n.maxOffset,f=n.centerMinEdge,s=n.centerMaxEdge;return o<e?i?0:f:t<o?u?a:s:(o-e)/r*c},rs=_i("width",function(n){return n.dom().offsetWidth}),os=function(n,e){rs.set(n,e)},is=function(n){return rs.get(n)},us=function(n){return n.model.minX},as=function(n){return n.model.minY},cs=function(n){return n.model.minX-1},fs=function(n){return n.model.minY-1},ss=function(n){return n.model.maxX},ls=function(n){return n.model.maxY},ds=function(n){return n.model.maxX+1},ms=function(n){return n.model.maxY+1},gs=function(n,e,t){return e(n)-t(n)},ps=function(n){return gs(n,ss,us)},vs=function(n){return gs(n,ls,as)},hs=function(n){return ps(n)/2},bs=function(n){return vs(n)/2},ys=function(n){return n.stepSize},xs=function(n){return n.snapToGrid},ws=function(n){return n.snapStart},Ss=function(n){return n.rounded},Os=function(n,e){return n[e+"-edge"]!==undefined},Ts=function(n){return Os(n,"left")},ks=function(n){return Os(n,"right")},Es=function(n){return Os(n,"top")},Cs=function(n){return Os(n,"bottom")},Ds=function(n){return n.model.value.get()},Ms=function(n){return{x:h(n)}},As=function(n){return{y:h(n)}},Is=function(n,e){return{x:h(n),y:h(e)}},Bs=function(n,e){fe(n,Kf(),{value:e})},Rs="left",Fs=function(n){return n.element().dom().getBoundingClientRect()},Vs=function(n,e){return n[e]},Ns=function(n){var e=Fs(n);return Vs(e,Rs)},Hs=function(n){var e=Fs(n);return Vs(e,"right")},js=function(n){var e=Fs(n);return Vs(e,"top")},zs=function(n){var e=Fs(n);return Vs(e,"bottom")},Ls=function(n){var e=Fs(n);return Vs(e,"width")},Ps=function(n){var e=Fs(n);return Vs(e,"height")},Us=function(n,e,t){return(n+e)/2-t},Gs=function(n,e){var t=Fs(n),r=Fs(e),o=Vs(t,Rs),i=Vs(t,"right"),u=Vs(r,Rs);return Us(o,i,u)},$s=function(n,e){var t=Fs(n),r=Fs(e),o=Vs(t,"top"),i=Vs(t,"bottom"),u=Vs(r,"top");return Us(o,i,u)},Ws=function(n,e){fe(n,Kf(),{value:e})},_s=function(n){return{x:h(n)}},qs=function(n,e,t){var r={min:us(e),max:ss(e),range:ps(e),value:t,step:ys(e),snap:xs(e),snapStart:ws(e),rounded:Ss(e),hasMinEdge:Ts(e),hasMaxEdge:ks(e),minBound:Ns(n),maxBound:Hs(n),screenRange:Ls(n)};return es(r)},Xs=function(u){return function(n,e){return(t=u,r=n,o=e,i=(0<t?Zf:Qf)(Ds(o).x(),us(o),ss(o),ys(o)),Ws(r,_s(i)),k.some(i)).map(function(){return!0});var t,r,o,i}},Ys=function(n,e,t,r,o,i){var u,a,c,f,s,l,d,m,g,p=(a=i,c=t,f=r,s=o,l=Ls(u=e),d=f.bind(function(n){return k.some(Gs(n,u))}).getOr(0),m=s.bind(function(n){return k.some(Gs(n,u))}).getOr(l),g={min:us(a),max:ss(a),range:ps(a),value:c,hasMinEdge:Ts(a),hasMaxEdge:ks(a),minBound:Ns(u),minOffset:0,maxBound:Hs(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m},ts(g));return Ns(e)-Ns(n)+p},Ks=Xs(-1),Js=Xs(1),Qs=k.none,Zs=k.none,nl={"top-left":k.none(),top:k.none(),"top-right":k.none(),right:k.some(function(n,e){Bs(n,Ms(ds(e)))}),"bottom-right":k.none(),bottom:k.none(),"bottom-left":k.none(),left:k.some(function(n,e){Bs(n,Ms(cs(e)))})},el=Object.freeze({setValueFrom:function(n,e,t){var r=qs(n,e,t),o=_s(r);return Ws(n,o),r},setToMin:function(n,e){var t=us(e);Ws(n,_s(t))},setToMax:function(n,e){var t=ss(e);Ws(n,_s(t))},findValueOfOffset:qs,getValueFromEvent:function(n){return Jf(n).map(function(n){return n.left()})},findPositionOfValue:Ys,setPositionFromValue:function(n,e,t,r){var o=Ds(t),i=Ys(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=is(e.element())/2;zi(e.element(),"left",i-u+"px")},onLeft:Ks,onRight:Js,onUp:Qs,onDown:Zs,edgeActions:nl}),tl=function(n,e){fe(n,Kf(),{value:e})},rl=function(n){return{y:h(n)}},ol=function(n,e,t){var r={min:as(e),max:ls(e),range:vs(e),value:t,step:ys(e),snap:xs(e),snapStart:ws(e),rounded:Ss(e),hasMinEdge:Es(e),hasMaxEdge:Cs(e),minBound:js(n),maxBound:zs(n),screenRange:Ps(n)};return es(r)},il=function(u){return function(n,e){return(t=u,r=n,o=e,i=(0<t?Zf:Qf)(Ds(o).y(),as(o),ls(o),ys(o)),tl(r,rl(i)),k.some(i)).map(function(){return!0});var t,r,o,i}},ul=function(n,e,t,r,o,i){var u,a,c,f,s,l,d,m,g,p=(a=i,c=t,f=r,s=o,l=Ps(u=e),d=f.bind(function(n){return k.some($s(n,u))}).getOr(0),m=s.bind(function(n){return k.some($s(n,u))}).getOr(l),g={min:as(a),max:ls(a),range:vs(a),value:c,hasMinEdge:Es(a),hasMaxEdge:Cs(a),minBound:js(u),minOffset:0,maxBound:zs(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m},ts(g));return js(e)-js(n)+p},al=k.none,cl=k.none,fl=il(-1),sl=il(1),ll={"top-left":k.none(),top:k.some(function(n,e){Bs(n,As(fs(e)))}),"top-right":k.none(),right:k.none(),"bottom-right":k.none(),bottom:k.some(function(n,e){Bs(n,As(ms(e)))}),"bottom-left":k.none(),left:k.none()},dl=Object.freeze({setValueFrom:function(n,e,t){var r=ol(n,e,t),o=rl(r);return tl(n,o),r},setToMin:function(n,e){var t=as(e);tl(n,rl(t))},setToMax:function(n,e){var t=ls(e);tl(n,rl(t))},findValueOfOffset:ol,getValueFromEvent:function(n){return Jf(n).map(function(n){return n.top()})},findPositionOfValue:ul,setPositionFromValue:function(n,e,t,r){var o=Ds(t),i=ul(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),u=Ki(e.element())/2;zi(e.element(),"top",i-u+"px")},onLeft:al,onRight:cl,onUp:fl,onDown:sl,edgeActions:ll}),ml=function(n,e){fe(n,Kf(),{value:e})},gl=function(n,e){return{x:h(n),y:h(e)}},pl=function(f,s){return function(n,e){return(t=f,r=s,o=n,i=e,u=0<t?Zf:Qf,a=r?Ds(i).x():u(Ds(i).x(),us(i),ss(i),ys(i)),c=r?u(Ds(i).y(),as(i),ls(i),ys(i)):Ds(i).y(),ml(o,gl(a,c)),k.some(a)).map(function(){return!0});var t,r,o,i,u,a,c}},vl=pl(-1,!1),hl=pl(1,!1),bl=pl(-1,!0),yl=pl(1,!0),xl={"top-left":k.some(function(n,e){Bs(n,Is(cs(e),fs(e)))}),top:k.some(function(n,e){Bs(n,Is(hs(e),fs(e)))}),"top-right":k.some(function(n,e){Bs(n,Is(ds(e),fs(e)))}),right:k.some(function(n,e){Bs(n,Is(ds(e),bs(e)))}),"bottom-right":k.some(function(n,e){Bs(n,Is(ds(e),ms(e)))}),bottom:k.some(function(n,e){Bs(n,Is(hs(e),ms(e)))}),"bottom-left":k.some(function(n,e){Bs(n,Is(cs(e),ms(e)))}),left:k.some(function(n,e){Bs(n,Is(cs(e),bs(e)))})},wl=Object.freeze({setValueFrom:function(n,e,t){var r=qs(n,e,t.left()),o=ol(n,e,t.top()),i=gl(r,o);return ml(n,i),i},setToMin:function(n,e){var t=us(e),r=as(e);ml(n,gl(t,r))},setToMax:function(n,e){var t=ss(e),r=ls(e);ml(n,gl(t,r))},getValueFromEvent:function(n){return Jf(n)},setPositionFromValue:function(n,e,t,r){var o=Ds(t),i=Ys(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=ul(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),a=is(e.element())/2,c=Ki(e.element())/2;zi(e.element(),"left",i-a+"px"),zi(e.element(),"top",u-c+"px")},onLeft:vl,onRight:hl,onUp:bl,onDown:yl,edgeActions:xl}),Sl=qn.detect().deviceType.isTouch(),Ol=[kr("stepSize",1),kr("onChange",x),kr("onChoose",x),kr("onInit",x),kr("onDragStart",x),kr("onDragEnd",x),kr("snapToGrid",!1),kr("rounded",!0),Sr("snapStart"),xr("model",vr("mode",{x:[kr("minX",0),kr("maxX",100),Cr("value",function(n){return Ao(n.mode.minX)}),yr("getInitialValue"),fi("manager",el)],y:[kr("minY",0),kr("maxY",100),Cr("value",function(n){return Ao(n.mode.minY)}),yr("getInitialValue"),fi("manager",dl)],xy:[kr("minX",0),kr("maxX",100),kr("minY",0),kr("maxY",100),Cr("value",function(n){return Ao({x:h(n.mode.minX),y:h(n.mode.minY)})}),yr("getInitialValue"),fi("manager",wl)]})),fc("sliderBehaviours",[cc,_f])].concat(Sl?[]:[Cr("mouseIsDown",function(){return Ao(!1)})]),Tl=qn.detect().deviceType.isTouch(),kl=gf({name:"Slider",configFields:Ol,partFields:Rf,factory:function(i,n,e,t){var u=function(n){return Xc(n,i,"thumb")},a=function(n){return Xc(n,i,"spectrum")},r=function(n){return qc(n,i,"left-edge")},o=function(n){return qc(n,i,"right-edge")},c=function(n){return qc(n,i,"top-edge")},f=function(n){return qc(n,i,"bottom-edge")},s=i.model,l=s.manager,d=function(n,e){l.setPositionFromValue(n,e,i,{getLeftEdge:r,getRightEdge:o,getTopEdge:c,getBottomEdge:f,getSpectrum:a})},m=function(n,e){s.value.set(e);var t=u(n);return d(n,t),i.onChange(n,t,e),k.some(!0)},g=[Pr(R(),function(n,e){i.onDragStart(n,u(n))}),Pr(V(),function(n,e){i.onDragEnd(n,u(n))})],p=[Pr(N(),function(n,e){e.stop(),i.onDragStart(n,u(n)),i.mouseIsDown.set(!0)}),Pr(j(),function(n,e){i.onDragEnd(n,u(n))})],v=Tl?g:p;return{uid:i.uid,dom:i.dom,components:n,behaviours:lc(i.sliderBehaviours,In([Tl?[]:[cc.config({mode:"special",focusIn:function(n){return qc(n,i,"spectrum").map(cc.focusIn).map(h(!0))}})],[_f.config({store:{mode:"manual",getValue:function(n){return s.value.get()}}}),mi.config({channels:{"mouse.released":{onReceive:function(t,n){var e=i.mouseIsDown.get();i.mouseIsDown.set(!1),e&&qc(t,i,"thumb").each(function(n){var e=s.value.get();i.onChoose(t,n,e)})}}}})]])),events:zr([Pr(Kf(),function(n,e){m(n,e.event().value())}),_r(function(n,e){var t=s.getInitialValue();s.value.set(t);var r=u(n);d(n,r);var o=a(n);i.onInit(n,r,o,s.value.get())})].concat(v)),apis:{resetToMin:function(n){l.setToMin(n,i)},resetToMax:function(n){l.setToMax(n,i)},changeValue:m,refresh:d},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),El=function(e,t,r){return Sf.forToolbar(t,function(){var n=r();e.setContextToolbar([{label:t+" group",items:n}])},{})},Cl=function(n){return[(o=n,i=function(n){return n<0?"black":360<n?"white":"hsl("+n+", 100%, 50%)"},kl.sketch({dom:bf('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[kl.parts()["left-edge"](yf('<div class="${prefix}-hue-slider-black"></div>')),kl.parts().spectrum({dom:bf('<div class="${prefix}-slider-gradient-container"></div>'),components:[yf('<div class="${prefix}-slider-gradient"></div>')],behaviours:uo([Ei.config({toggleClass:Ii.resolve("thumb-active")})])}),kl.parts()["right-edge"](yf('<div class="${prefix}-hue-slider-white"></div>')),kl.parts().thumb({dom:bf('<div class="${prefix}-slider-thumb"></div>'),behaviours:uo([Ei.config({toggleClass:Ii.resolve("thumb-active")})])})],onChange:function(n,e,t){var r=i(t.x());zi(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){Ei.on(e)},onDragEnd:function(n,e){Ei.off(e)},onInit:function(n,e,t,r){var o=i(r.x());zi(e.element(),"background-color",o)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:function(){return o.getInitialValue()}}}},sliderBehaviours:uo([Di(kl.refresh)])}))];var o,i},Dl=function(n,r){var e={onChange:function(n,e,t){r.undoManager.transact(function(){r.formatter.apply("forecolor",{value:t}),r.nodeChanged()})},getInitialValue:function(){return-1}};return El(n,"color",function(){return Cl(e)})},Ml=er([yr("getInitialValue"),yr("onChange"),yr("category"),yr("sizes")]),Al=function(n){var i=gr("SizeSlider",Ml,n);return kl.sketch({dom:{tag:"div",classes:[Ii.resolve("slider-"+i.category+"-size-container"),Ii.resolve("slider"),Ii.resolve("slider-size-container")]},onChange:function(n,e,t){var r,o=t.x();0<=(r=o)&&r<i.sizes.length&&i.onChange(o)},onDragStart:function(n,e){Ei.on(e)},onDragEnd:function(n,e){Ei.off(e)},model:{mode:"x",minX:0,maxX:i.sizes.length-1,getInitialValue:function(){return{x:function(){return i.getInitialValue()}}}},stepSize:1,snapToGrid:!0,sliderBehaviours:uo([Di(kl.refresh)]),components:[kl.parts().spectrum({dom:bf('<div class="${prefix}-slider-size-container"></div>'),components:[yf('<div class="${prefix}-slider-size-line"></div>')]}),kl.parts().thumb({dom:bf('<div class="${prefix}-slider-thumb"></div>'),behaviours:uo([Ei.config({toggleClass:Ii.resolve("thumb-active")})])})]})},Il=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Bl=function(n){var e,t,r=n.selection.getStart(),o=ge.fromDom(r),i=ge.fromDom(n.getBody()),u=(e=function(n){return je(i,n)},(xe(t=o)?k.some(t):Le(t)).map(function(n){return Nr(n,function(n){return Gi(n,"font-size").isSome()},e).bind(function(n){return Gi(n,"font-size")}).getOrThunk(function(){return Pi(n,"font-size")})}).getOr(""));return Cn(Il,function(n){return u===n}).getOr("medium")},Rl={candidates:h(Il),get:function(n){var e,t=Bl(n);return(e=t,Dn(Il,function(n){return n===e})).getOr(2)},apply:function(r,n){var e;(e=n,k.from(Il[e])).each(function(n){var e,t;t=n,Bl(e=r)!==t&&e.execCommand("fontSize",!1,t)})}},Fl=Rl.candidates(),Vl=function(n){return[yf('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),(e=n,Al({onChange:e.onChange,sizes:Fl,category:"font",getInitialValue:e.getInitialValue})),yf('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')];var e},Nl=function(n){var e=function t(n){return n.uid!==undefined}(n)&&Et(n,"uid")?n.uid:af("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).fold(k.none,k.some)},asSpec:function(){return y({},n,{uid:e})}}};function Hl(n,e){return zl(document.createElement("canvas"),n,e)}function jl(n){return n.getContext("2d")}function zl(n,e,t){return n.width=e,n.height=t,n}var Ll={create:Hl,clone:function Bh(n){var e;return jl(e=Hl(n.width,n.height)).drawImage(n,0,0),e},resize:zl,get2dContext:jl,get3dContext:function Rh(n){var e=null;try{e=n.getContext("webgl")||n.getContext("experimental-webgl")}catch(t){}return e||(e=null),e}},Pl={getWidth:function Fh(n){return n.naturalWidth||n.width},getHeight:function Vh(n){return n.naturalHeight||n.height}},Ul=window.Promise?window.Promise:function(){var n=function(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(n,r(o,this),r(u,this))},e=n.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){setTimeout(n,1)};function r(n,e){return function(){n.apply(e,arguments)}}var t=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};function i(r){var o=this;null!==this._state?e(function(){var n=o._state?r.onFulfilled:r.onRejected;if(null!==n){var e;try{e=n(o._value)}catch(t){return void r.reject(t)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void f(r(e,n),r(o,this),r(u,this))}this._state=!0,this._value=n,a.call(this)}catch(t){u.call(this,t)}}function u(n){this._state=!1,this._value=n,a.call(this)}function a(){for(var n=0,e=this._deferreds.length;n<e;n++)i.call(this,this._deferreds[n]);this._deferreds=null}function c(n,e,t,r){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.resolve=t,this.reject=r}function f(n,e,t){var r=!1;try{n(function(n){r||(r=!0,e(n))},function(n){r||(r=!0,t(n))})}catch(o){if(r)return;r=!0,t(o)}}return n.prototype["catch"]=function(n){return this.then(null,n)},n.prototype.then=function(t,r){var o=this;return new n(function(n,e){i.call(o,new c(t,r,n,e))})},n.all=function(){var c=Array.prototype.slice.call(1===arguments.length&&t(arguments[0])?arguments[0]:arguments);return new n(function(o,i){if(0===c.length)return o([]);var u=c.length;function a(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void t.call(n,function(n){a(e,n)},i)}c[e]=n,0==--u&&o(c)}catch(r){i(r)}}for(var n=0;n<c.length;n++)a(n,c[n])})},n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===n?e:new n(function(n){n(e)})},n.reject=function(t){return new n(function(n,e){e(t)})},n.race=function(o){return new n(function(n,e){for(var t=0,r=o.length;t<r;t++)o[t].then(n,e)})},n}();function Gl(){return new(Ie.getOrDie("FileReader"))}var $l={atob:function(n){return Ie.getOrDie("atob")(n)},requestAnimationFrame:function(n){Ie.getOrDie("requestAnimationFrame")(n)}};function Wl(a){return new Ul(function(n,e){var t=URL.createObjectURL(a),r=new Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",u)};function i(){o(),n(r)}function u(){o(),e("Unable to load data of type "+a.type+": "+t)}r.addEventListener("load",i),r.addEventListener("error",u),r.src=t,r.complete&&i()})}function _l(r){return new Ul(function(n,t){var e=new XMLHttpRequest;e.open("GET",r,!0),e.responseType="blob",e.onload=function(){200==this.status&&n(this.response)},e.onerror=function(){var n,e=this;t(0===this.status?((n=new Error("No access to download image")).code=18,n.name="SecurityError",n):new Error("Error "+e.status+" downloading image"))},e.send()})}function ql(n){var e=n.split(","),t=/data:([^;]+)/.exec(e[0]);if(!t)return k.none();for(var r,o=t[1],i=e[1],u=$l.atob(i),a=u.length,c=Math.ceil(a/1024),f=new Array(c),s=0;s<c;++s){for(var l=1024*s,d=Math.min(l+1024,a),m=new Array(d-l),g=l,p=0;g<d;++p,++g)m[p]=u[g].charCodeAt(0);f[s]=(r=m,new(Ie.getOrDie("Uint8Array"))(r))}return k.some(function v(n,e){return new(Ie.getOrDie("Blob"))(n,e)}(f,{type:o}))}function Xl(t){return new Ul(function(n,e){ql(t).fold(function(){e("uri is not base64: "+t)},n)})}function Yl(t){return new Ul(function(n){var e=Gl();e.onloadend=function(){n(e.result)},e.readAsDataURL(t)})}var Kl,Jl,Ql,Zl={blobToImage:Wl,imageToBlob:function Nh(n){var e=n.src;return 0===e.indexOf("data:")?Xl(e):_l(e)},blobToArrayBuffer:function Hh(t){return new Ul(function(n){var e=Gl();e.onloadend=function(){n(e.result)},e.readAsArrayBuffer(t)})},blobToDataUri:Yl,blobToBase64:function jh(n){return Yl(n).then(function(n){return n.split(",")[1]})},dataUriToBlobSync:ql,canvasToBlob:function zh(n,t,r){return t=t||"image/png",HTMLCanvasElement.prototype.toBlob?new Ul(function(e){n.toBlob(function(n){e(n)},t,r)}):Xl(n.toDataURL(t,r))},canvasToDataURL:function Lh(n,e,t){return e=e||"image/png",n.then(function(n){return n.toDataURL(e,t)})},blobToCanvas:function Ph(n){return Wl(n).then(function(n){var e;return function t(n){URL.revokeObjectURL(n.src)}(n),e=Ll.create(Pl.getWidth(n),Pl.getHeight(n)),Ll.get2dContext(e).drawImage(n,0,0),e})},uriToBlob:function Uh(n){return 0===n.indexOf("blob:")?_l(n):0===n.indexOf("data:")?Xl(n):null}},nd=function(n){return Zl.blobToBase64(n)},ed=function(u){var e=Nl({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:zr([Wr($()),Pr(G(),function(n,e){var t,r,o;(t=e,r=t.event(),o=r.raw().target.files||r.raw().dataTransfer.files,k.from(o[0])).each(function(n){var o,i;o=u,nd(i=n).then(function(r){o.undoManager.transact(function(){var n=o.editorUpload.blobCache,e=n.create(Oc("mceu"),i,r);n.add(e);var t=o.dom.createHTML("img",{src:e.blobUri()});o.insertContent(t)})})})})])});return pf.sketch({dom:bf('<span class="${prefix}-toolbar-button ${prefix}-icon-image ${prefix}-icon"></span>'),components:[e.asSpec()],action:function(n){e.get(n).element().dom().click()}})},td=function(n){return n.dom().textContent},rd=function(n){return 0<n.length},od=function(n){return n===undefined||null===n?"":n},id=function(e,t,n){return n.text.toOption().filter(rd).fold(function(){return po(n=e,"href")===td(n)?k.some(t):k.none();var n},k.some)},ud=function(n){var e=ge.fromDom(n.selection.getStart());return ru(e,"a")},ad={getInfo:function(n){return ud(n).fold(function(){return{url:"",text:n.selection.getContent({format:"text"}),title:"",target:"",link:k.none()}},function(n){return t=td(e=n),r=po(e,"href"),o=po(e,"title"),i=po(e,"target"),{url:od(r),text:t!==r?od(t):"",title:od(o),target:od(i),link:k.some(e)};var e,t,r,o,i})},applyInfo:function(o,i){i.url.toOption().filter(rd).fold(function(){var e;e=o,i.link.bind(b).each(function(n){e.execCommand("unlink")})},function(e){var n,t,r=(n=i,(t={}).href=e,n.title.toOption().filter(rd).each(function(n){t.title=n}),n.target.toOption().filter(rd).each(function(n){t.target=n}),t);i.link.bind(b).fold(function(){var n=i.text.toOption().filter(rd).getOr(e);o.insertContent(o.dom.createHTML("a",r,o.dom.encode(n)))},function(t){var n=id(t,e,i);go(t,r),n.each(function(n){var e;e=n,t.dom().textContent=e})})})},query:ud},cd=qn.detect(),fd=function(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)},sd=function(n,e){(cd.os.isAndroid()?fd:s)(e,n)},ld=function(n,e){var t,r;return{key:n,value:{config:{},me:(t=n,r=zr(e),co({fields:[yr("enabled")],name:t,active:{events:h(r)}})),configAsRaw:h({}),initialConfig:{},state:oo}}},dd=Object.freeze({getCurrent:function(n,e,t){return e.find(n)}}),md=[yr("find")],gd=co({fields:md,name:"composing",apis:dd}),pd=mf({name:"Container",factory:function(n){var e=n.dom,t=e.attributes,r=c(e,["attributes"]);return{uid:n.uid,dom:y({tag:"div",attributes:y({role:"presentation"},t)},r),components:n.components,behaviours:sc(n.containerBehaviours),events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},configFields:[kr("components",[]),fc("containerBehaviours",[]),kr("events",{}),kr("domModification",{}),kr("eventOrder",{})]}),vd=mf({name:"DataField",factory:function(t){return{uid:t.uid,dom:t.dom,behaviours:mc(t.dataBehaviours,[_f.config({store:{mode:"memory",initialValue:t.getInitialValue()}}),gd.config({find:k.some})]),events:zr([_r(function(n,e){_f.setValue(n,t.getInitialValue())})])}},configFields:[yr("uid"),yr("dom"),yr("getInitialValue"),dc("dataBehaviours",[_f,gd])]}),hd=function(n){return n.dom().value},bd=function(n,e){if(e===undefined)throw new Error("Value.set was undefined");n.dom().value=e},yd=h([Sr("data"),kr("inputAttributes",{}),kr("inputStyles",{}),kr("tag","input"),kr("inputClasses",[]),ii("onSetValue"),kr("styles",{}),kr("eventOrder",{}),fc("inputBehaviours",[_f,Ni]),kr("selectOnFocus",!0)]),xd=function(n){return y({},(e=n,uo([Ni.config({onFocus:!1===e.selectOnFocus?x:function(n){var e=n.element(),t=hd(e);e.dom().setSelectionRange(0,t.length)}})])),lc(n.inputBehaviours,[_f.config({store:{mode:"manual",initialValue:n.data.getOr(undefined),getValue:function(n){return hd(n.element())},setValue:function(n,e){hd(n.element())!==e&&bd(n.element(),e)}},onSetValue:n.onSetValue})]));var e},wd=mf({name:"Input",configFields:yd(),factory:function(n,e){return{uid:n.uid,dom:(t=n,{tag:t.tag,attributes:y({type:"input"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}),components:[],behaviours:xd(n),eventOrder:n.eventOrder};var t}}),Sd=Object.freeze({exhibit:function(n,e){return Qr({attributes:Tt([{key:e.tabAttr,value:"true"}])})}}),Od=[kr("tabAttr","data-alloy-tabstop")],Td=co({fields:Od,name:"tabstopping",active:Sd}),kd=function(n,e){var t=Nl(wd.sketch({inputAttributes:{placeholder:e},onSetValue:function(n,e){ce(n,U())},inputBehaviours:uo([gd.config({find:k.some}),Td.config({}),cc.config({mode:"execution"})]),selectOnFocus:!1})),r=Nl(pf.sketch({dom:bf('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(n){var e=t.get(n);_f.setValue(e,"")}}));return{name:n,spec:pd.sketch({dom:bf('<div class="${prefix}-input-container"></div>'),components:[t.asSpec(),r.asSpec()],containerBehaviours:uo([Ei.config({toggleClass:Ii.resolve("input-container-empty")}),gd.config({find:function(n){return k.some(t.get(n))}}),ld("input-clearing",[Pr(U(),function(n){var e=t.get(n);(0<_f.getValue(e).length?Ei.off:Ei.on)(n)})])])})}},Ed=["input","button","textarea"],Cd=function(n,e,t){e.disabled&&Rd(n,e,t)},Dd=function(n){return wn(Ed,be(n.element()))},Md=function(n){mo(n.element(),"disabled","disabled")},Ad=function(n){ho(n.element(),"disabled")},Id=function(n){mo(n.element(),"aria-disabled","true")},Bd=function(n){mo(n.element(),"aria-disabled","false")},Rd=function(e,n,t){n.disableClass.each(function(n){So(e.element(),n)}),(Dd(e)?Md:Id)(e)},Fd=function(n){return Dd(n)?vo(n.element(),"disabled"):"true"===po(n.element(),"aria-disabled")},Vd=Object.freeze({enable:function(e,n,t){n.disableClass.each(function(n){To(e.element(),n)}),(Dd(e)?Ad:Bd)(e)},disable:Rd,isDisabled:Fd,onLoad:Cd}),Nd=Object.freeze({exhibit:function(n,e,t){return Qr({classes:e.disabled?e.disableClass.map(Nn).getOr([]):[]})},events:function(n,e){return zr([Lr(Zn(),function(n,e){return Fd(n)}),Zr(n,e,Cd)])}}),Hd=[kr("disabled",!1),Sr("disableClass")],jd=co({fields:Hd,name:"disabling",active:Nd,apis:Vd}),zd=[fc("formBehaviours",[_f])],Ld=function(n){return"<alloy.field."+n+">"},Pd=function(o,n,e){return{uid:o.uid,dom:o.dom,components:n,behaviours:lc(o.formBehaviours,[_f.config({store:{mode:"manual",getValue:function(n){var e,t,r=(e=o,t=n.getSystem(),M(e.partUids,function(n,e){return h(t.getByUid(n))}));return M(r,function(n,e){return n().bind(function(n){var e,t=gd.getCurrent(n);return e="missing current",t.fold(function(){return it.error(e)},it.value)}).map(_f.getValue)})},setValue:function(t,n){D(n,function(e,n){qc(t,o,n).each(function(n){gd.getCurrent(n).each(function(n){_f.setValue(n,e)})})})}}})]),apis:{getField:function(n,e){return qc(n,o,e).bind(gd.getCurrent)}}}},Ud=(Zc(function(n,e,t){return n.getField(e,t)}),function(n){var i,e=(i=[],{field:function(n,e){return i.push(n),t="form",r=Ld(n),o=e,{uiType:wc(),owner:t,name:r,config:o,validated:{}};var t,r,o},record:function(){return i}}),t=n(e),r=e.record(),o=Sn(r,function(n){return jc({name:n,pname:Ld(n)})});return ff("form",zd,o,Pd,t)}),Gd=function(){var e=Ao(k.none()),t=function(){e.get().each(function(n){n.destroy()})};return{clear:function(){t(),e.set(k.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(k.some(n))},run:function(n){e.get().each(n)}}},$d=function(){var e=Ao(k.none());return{clear:function(){e.set(k.none())},set:function(n){e.set(k.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}},Wd=function(n){return{xValue:n,points:[]}},_d=function(n,e){if(e===n.xValue)return n;var t=0<e-n.xValue?1:-1,r={direction:t,xValue:e};return{xValue:e,points:(0===n.points.length?[]:n.points[n.points.length-1].direction===t?n.points.slice(0,n.points.length-1):n.points).concat([r])}},qd=function(n){if(0===n.points.length)return 0;var e=n.points[0].direction,t=n.points[n.points.length-1].direction;return-1===e&&-1===t?-1:1===e&&1===t?1:0},Xd=function(n){var r="navigateEvent",e=tr([yr("fields"),kr("maxFieldIndex",n.fields.length-1),yr("onExecute"),yr("getInitialValue"),Cr("state",function(){return{dialogSwipeState:$d(),currentScreen:Ao(0)}})]),u=gr("SerialisedDialog",e,n),o=function(e,n,t){return pf.sketch({dom:bf('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){fe(n,r,{direction:e})},buttonBehaviours:uo([jd.config({disableClass:Ii.resolve("toolbar-navigation-disabled"),disabled:!t})])})},i=function(n,o){var i=Zi(n.element(),"."+Ii.resolve("serialised-dialog-screen"));tu(n.element(),"."+Ii.resolve("serialised-dialog-chain")).each(function(r){0<=u.state.currentScreen.get()+o&&u.state.currentScreen.get()+o<i.length&&(Gi(r,"left").each(function(n){var e=parseInt(n,10),t=is(i[0]);zi(r,"left",e-o*t+"px")}),u.state.currentScreen.set(u.state.currentScreen.get()+o))})},a=function(r){var n=Zi(r.element(),"input");k.from(n[u.state.currentScreen.get()]).each(function(n){r.getSystem().getByDom(n).each(function(n){var e,t;e=r,t=n.element(),e.getSystem().triggerFocus(t,e.element())})});var e=f.get(r);Eu.highlightAt(e,u.state.currentScreen.get())},c=Nl(Ud(function(t){return{dom:bf('<div class="${prefix}-serialised-dialog"></div>'),components:[pd.sketch({dom:bf('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:Sn(u.fields,function(n,e){return e<=u.maxFieldIndex?pd.sketch({dom:bf('<div class="${prefix}-serialised-dialog-screen"></div>'),components:[o(-1,"previous",0<e),t.field(n.name,n.spec),o(1,"next",e<u.maxFieldIndex)]}):t.field(n.name,n.spec)})})],formBehaviours:uo([Di(function(n,e){var t;t=e,tu(n.element(),"."+Ii.resolve("serialised-dialog-chain")).each(function(n){zi(n,"left",-u.state.currentScreen.get()*t.width+"px")})}),cc.config({mode:"special",focusIn:function(n){a(n)},onTab:function(n){return i(n,1),k.some(!0)},onShiftTab:function(n){return i(n,-1),k.some(!0)}}),ld("form-events",[_r(function(e,n){u.state.currentScreen.set(0),u.state.dialogSwipeState.clear();var t=f.get(e);Eu.highlightFirst(t),u.getInitialValue(e).each(function(n){_f.setValue(e,n)})}),Yr(u.onExecute),Pr(W(),function(n,e){"left"===e.event().raw().propertyName&&a(n)}),Pr(r,function(n,e){var t=e.event().direction();i(n,t)})])])}})),f=Nl({dom:bf('<div class="${prefix}-dot-container"></div>'),behaviours:uo([Eu.config({highlightClass:Ii.resolve("dot-active"),itemClass:Ii.resolve("dot-item")})]),components:Bn(u.fields,function(n,e){return e<=u.maxFieldIndex?[yf('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})});return{dom:bf('<div class="${prefix}-serializer-wrapper"></div>'),components:[c.asSpec(),f.asSpec()],behaviours:uo([cc.config({mode:"special",focusIn:function(n){var e=c.get(n);cc.focusIn(e)}}),ld("serializer-wrapper-events",[Pr(R(),function(n,e){var t=e.event();u.state.dialogSwipeState.set(Wd(t.raw().touches[0].clientX))}),Pr(F(),function(n,e){var t=e.event();u.state.dialogSwipeState.on(function(n){e.event().prevent(),u.state.dialogSwipeState.set(_d(n,t.raw().touches[0].clientX))})}),Pr(V(),function(r){u.state.dialogSwipeState.on(function(n){var e=c.get(r),t=-1*qd(n);i(e,t)})})])])}},Yd=q(function(t,r){return[{label:"the link group",items:[Xd({fields:[kd("url","Type or paste URL"),kd("text","Link text"),kd("title","Link title"),kd("target","Link target"),(n="link",{name:n,spec:vd.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return k.none()}})})],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return k.some(ad.getInfo(r))},onExecute:function(n){var e=_f.getValue(n);ad.applyInfo(r,e),t.restoreToolbar(),r.focus()}})]}];var n}),Kd=[{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",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],Jd=zr([(Kl=Yn(),Jl=function(n,e){var t,r,o=e.event().originator(),i=e.event().target();return r=i,!(je(t=o,n.element())&&!je(t,r)&&(console.warn(Yn()+" did not get interpreted by the desired target. \nOriginator: "+Go(o)+"\nTarget: "+Go(i)+"\nCheck the "+Yn()+" event handlers"),1))},{key:Kl,value:Mr({can:Jl})})]),Qd=Object.freeze({events:Jd}),Zd=b,nm=function(e){var n=function(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+Go(e().element())+" is not in context.")}};return{debugInfo:h("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),isConnected:h(!1)}},em=nm(),tm=function(n,o){var i={};return D(n,function(n,r){D(n,function(n,e){var t=wt(e,[])(i);i[e]=t.concat([o(r,n)])})}),i},rm=function(n,e){return t=l.apply(undefined,[n.handler].concat(e)),r=n.purpose(),{cHandler:t,purpose:h(r)};var t,r},om=function(n){return n.cHandler},im=function(n,e){return{name:h(n),handler:h(e)}},um=function(n,e,t){var r,o,i=y({},t,(r=n,o={},On(e,function(n){o[n.name()]=n.handlers(r)}),o));return tm(i,im)},am=function(n){var e,i=bn(e=n)?{can:h(!0),abort:h(!1),run:e}:e;return function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var o=[n,e].concat(t);i.abort.apply(undefined,o)?e.stop():i.can.apply(undefined,o)&&i.run.apply(undefined,o)}},cm=function(n,e,t){var r,o,i=e[t];return i?function(u,a,n,c){var e=n.slice(0);try{var t=e.sort(function(n,e){var t=n[a](),r=e[a](),o=c.indexOf(t),i=c.indexOf(r);if(-1===o)throw new Error("The ordering for "+u+" does not have an entry for "+t+".\nOrder specified: "+qt(c,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+r+".\nOrder specified: "+qt(c,null,2));return o<i?-1:i<o?1:0});return it.value(t)}catch(r){return it.error([r])}}("Event: "+t,"name",n,i).map(function(n){var e=Sn(n,function(n){return n.handler()});return Ar(e)}):(r=t,o=n,it.error(["The event ("+r+') 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: '+qt(Sn(o,function(n){return n.name()}),null,2)]))},fm=function(n,i){var e=I(n,function(r,o){return(1===r.length?it.value(r[0].handler()):cm(r,i,o)).map(function(n){var e=am(n),t=1<r.length?Tn(i,function(e){return wn(r,function(n){return n.name()===e})}).join(" > "):r[0].name();return Ot(o,{handler:e,purpose:h(t)})})});return kt(e,{})},sm=function(n){return dr("custom.definition",tr([ur("dom","dom",mt(),tr([yr("tag"),kr("styles",{}),kr("classes",[]),kr("attributes",{}),Sr("value"),Sr("innerHtml")])),yr("components"),yr("uid"),kr("events",{}),kr("apis",{}),ur("eventOrder","eventOrder",(e={"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing"],mousedown:["focusing","alloy.base.behaviour","item-type-events"]},lt.mergeWithThunk(h(e))),hr()),Sr("domModification")]),n);var e},lm=function(e,n){On(n,function(n){So(e,n)})},dm=function(e,n){On(n,function(n){To(e,n)})},mm=function(n,e){return t=n,o=Sn(r=e,function(n){return Or(n.name(),[yr("config"),kr("state",oo)])}),i=dr("component.behaviours",tr(o),t.behaviours).fold(function(n){throw new Error(pr(n)+"\nComplete spec:\n"+qt(t,null,2))},function(n){return n}),{list:r,data:M(i,function(n){var e=n.map(function(n){return{config:n.config,state:n.state.init(n.config)}});return function(){return e}})};var t,r,o,i},gm=function(n){var e,t,r,o=(e=n,t=wt("behaviours",{})(e),r=Tn(E(t),function(n){return t[n]!==undefined}),Sn(r,function(n){return t[n].me}));return mm(n,o)},pm=function(n,e,t){var r,o,i,u=y({},(r=n).dom,{uid:r.uid,domChildren:Sn(r.components,function(n){return n.element()})}),a=n.domModification.fold(function(){return Qr({})},Qr),c={"alloy.base.modification":a},f=0<e.length?function(e,n,t,r){var o=y({},n);On(t,function(n){o[n.name()]=n.exhibit(e,r)});var i=tm(o,function(n,e){return{name:n,modification:e}}),u=function(n){return kn(n,function(n,e){return y({},e.modification,n)},{})},a=kn(i.classes,function(n,e){return e.modification.concat(n)},[]),c=u(i.attributes),f=u(i.styles);return Qr({classes:a,attributes:c,styles:f})}(t,c,e,u):a;return i=f,y({},o=u,{attributes:y({},o.attributes,i.attributes),styles:y({},o.styles,i.styles),classes:o.classes.concat(i.classes)})},vm=function(n,e,t){var r,o,i,u,a,c,f={"alloy.base.behaviour":(r=n,r.events)};return(o=t,i=n.eventOrder,u=e,a=f,c=um(o,u,a),fm(c,i)).getOrDie()},hm=function(t){var n=function(){return s},r=Ao(em),e=mr(sm(t)),o=gm(t),i=o.list,u=o.data,a=function(n){var e=ge.fromTag(n.tag);go(e,n.attributes),lm(e,n.classes),Li(e,n.styles),n.innerHtml.each(function(n){return Lo(e,n)});var t=n.domChildren;return qe(e,t),n.value.each(function(n){bd(e,n)}),n.uid,of(e,n.uid),e}(pm(e,i,u)),c=vm(e,i,u),f=Ao(e.components),s={getSystem:r.get,config:function(n){var e=u;return(bn(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+qt(t,null,2))})()},hasConfigured:function(n){return bn(u[n.name()])},spec:h(t),readState:function(n){return u[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},getApis:function(){return e.apis},connect:function(n){r.set(n)},disconnect:function(){r.set(nm(n))},element:h(a),syncComponents:function(){var n=Pe(a),e=Bn(n,function(n){return r.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});f.set(e)},components:f.get,events:h(c)};return s},bm=function(n){var e,t,r=Zd(n),o=r.events,i=c(r,["events"]),u=(e=i,t=wt("components",[])(e),Sn(t,Sm)),a=y({},i,{events:y({},Qd,o),components:u});return it.value(hm(a))},ym=function(n){var e=ge.fromText(n);return xm({element:e})},xm=function(n){var e=gr("external.component",er([yr("element"),Sr("uid")]),n),t=Ao(nm());e.uid.each(function(n){of(e.element,n)});var r={getSystem:t.get,config:k.none,hasConfigured:h(!1),connect:function(n){t.set(n)},disconnect:function(){t.set(nm(function(){return r}))},getApis:function(){return{}},element:h(e.element),spec:h(n),readState:h("No state"),syncComponents:x,components:h([]),events:h({})};return Qc(r)},wm=af,Sm=function(e){return(n=e,St(n,Jc)).fold(function(){var n=e.hasOwnProperty("uid")?e:y({uid:wm("")},e);return bm(n).getOrDie()},function(n){return n});var n},Om=Qc,Tm="alloy.item-hover",km="alloy.item-focus",Em=function(n){(Fo(n.element()).isNone()||Ni.isFocused(n))&&(Ni.isFocused(n)||Ni.focus(n),fe(n,Tm,{item:n}))},Cm=function(n){fe(n,km,{item:n})},Dm=h(Tm),Mm=h(km),Am=[yr("data"),yr("components"),yr("dom"),kr("hasSubmenu",!1),Sr("toggling"),dc("itemBehaviours",[Ei,Ni,cc,_f]),kr("ignoreFocus",!1),kr("domModification",{}),fi("builder",function(n){return{dom:n.dom,domModification:y({},n.domModification,{attributes:y({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes,{"aria-haspopup":n.hasSubmenu},n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:mc(n.itemBehaviours,[n.toggling.fold(Ei.revoke,function(n){return Ei.config(y({aria:{mode:"checked"}},n))}),Ni.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){Cm(n)}}),cc.config({mode:"execution"}),_f.config({store:{mode:"memory",initialValue:n.data}}),ld("item-type-events",[Pr(te(),se),Wr(N()),Pr(z(),Em),Pr(ne(),Ni.focus)])]),components:n.components,eventOrder:n.eventOrder}}),kr("eventOrder",{})],Im=[yr("dom"),yr("components"),fi("builder",function(n){return{dom:n.dom,components:n.components,events:zr([(e=ne(),Pr(e,function(n,e){e.stop()}))])};var e})],Bm=h([jc({name:"widget",overrides:function(e){return{behaviours:uo([_f.config({store:{mode:"manual",getValue:function(n){return e.data},setValue:function(){}}})])}}})]),Rm=[yr("uid"),yr("data"),yr("components"),yr("dom"),kr("autofocus",!1),kr("ignoreFocus",!1),dc("widgetBehaviours",[_f,Ni,cc]),kr("domModification",{}),Kc(Bm()),fi("builder",function(t){var n=Wc(0,t,Bm()),e=_c("item-widget",t,n.internals()),r=function(n){return qc(n,t,"widget").map(function(n){return cc.focusIn(n),n})},o=function(n,e){return Vu(e.event().target())||t.autofocus&&e.setSource(n.element()),k.none()};return{dom:t.dom,components:e,domModification:t.domModification,events:zr([Yr(function(n,e){r(n).each(function(n){e.stop()})}),Pr(z(),Em),Pr(ne(),function(n,e){t.autofocus?r(n):Ni.focus(n)})]),behaviours:mc(t.widgetBehaviours,[_f.config({store:{mode:"memory",initialValue:t.data}}),Ni.config({ignore:t.ignoreFocus,onFocus:function(n){Cm(n)}}),cc.config({mode:"special",focusIn:t.autofocus?function(n){r(n)}:so(),onLeft:o,onRight:o,onEscape:function(n,e){return Ni.isFocused(n)||t.autofocus?(t.autofocus&&e.setSource(n.element()),k.none()):(Ni.focus(n),k.some(!0))}})])}})],Fm=vr("type",{widget:Rm,item:Am,separator:Im}),Vm=h([Lc({factory:{sketch:function(n){var e=gr("menu.spec item",Fm,n);return e.builder(e)}},name:"items",unit:"item",defaults:function(n,e){return e.hasOwnProperty("uid")?e:y({},e,{uid:af("item")})},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus,domModification:{classes:[n.markers.item]}}}})]),Nm=h([yr("value"),yr("items"),yr("dom"),yr("components"),kr("eventOrder",{}),fc("menuBehaviours",[Eu,_f,gd,cc]),Er("movement",{mode:"menu",moveOnTab:!0},vr("mode",{grid:[li(),fi("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:n.focusManager}})],matrix:[fi("config",function(n,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+n.markers.item},focusManager:n.focusManager}}),yr("rowSelector")],menu:[kr("moveOnTab",!0),fi("config",function(n,e){return{mode:"menu",selector:"."+n.markers.item,moveOnTab:e.moveOnTab,focusManager:n.focusManager}})]})),xr("markers",ti()),kr("fakeFocus",!1),kr("focusManager",Du()),ii("onHighlight")]),Hm=h("alloy.menu-focus"),jm=gf({name:"Menu",configFields:Nm(),partFields:Vm(),factory:function(n,e,t,r){return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:lc(n.menuBehaviours,[Eu.config({highlightClass:n.markers.selectedItem,itemClass:n.markers.item,onHighlight:n.onHighlight}),_f.config({store:{mode:"memory",initialValue:n.value}}),gd.config({find:k.some}),cc.config(n.movement.config(n,n.movement))]),events:zr([Pr(Mm(),function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){Eu.highlight(e,n),t.stop(),fe(e,Hm(),{menu:e,item:n})})}),Pr(Dm(),function(n,e){var t=e.event().item();Eu.highlight(n,t)})]),components:e,eventOrder:n.eventOrder,domModification:{attributes:{role:"menu"}}}}}),zm=function(n,e,t,r){var o=n.getSystem().build(r);Ze(n,o,t)},Lm=function(n,e,t,r){var o=Pm(n,e);Cn(o,function(n){return je(r.element(),n.element())}).each(et)},Pm=function(n,e){return n.components()},Um=function(e,t,n,o,r){var i=Pm(e,t);return k.from(i[o]).map(function(n){return Lm(e,t,0,n),r.each(function(n){zm(e,0,function(n,e){var t,r;r=e,Ue(t=n,o).fold(function(){_e(t,r)},function(n){Ge(n,r)})},n)}),n})},Gm=co({fields:[],name:"replacing",apis:Object.freeze({append:function(n,e,t,r){zm(n,0,_e,r)},prepend:function(n,e,t,r){zm(n,0,We,r)},remove:Lm,replaceAt:Um,replaceBy:function(e,t,n,r,o){var i=Pm(e,t);return Dn(i,r).bind(function(n){return Um(e,t,0,n,o)})},set:function(e,n,t,r){var o,i,u,a,c,f;i=(o=e).components(),On(i,nt),Xe(o.element()),o.syncComponents(),u=function(){var n=Sn(r,e.getSystem().build);On(n,function(n){Qe(e,n)})},a=e.element(),c=ze(a),f=Ro(c).bind(function(e){var n=function(n){return je(e,n)};return n(a)?k.some(a):Hr(a,n)}),u(a),f.each(function(e){Ro(c).filter(function(n){return je(n,e)}).fold(function(){Io(e)},x)})},contents:Pm})}),$m=function(t,r,o,n){return St(o,n).bind(function(n){return St(t,n).bind(function(n){var e=$m(t,r,o,n);return k.some([n].concat(e))})}).getOr([])},Wm=function(n,e){var t={};D(n,function(n,e){On(n,function(n){t[n]=e})});var r=e,o=A(e,function(n,e){return{k:n,v:e}}),i=M(o,function(n,e){return[e].concat($m(t,r,o,e))});return M(t,function(n){return St(i,n).getOr([n])})},_m=function(){var i=Ao({}),u=Ao({}),a=Ao({}),c=Ao(k.none()),f=Ao({}),e=function(n){return St(u.get(),n)};return{setMenuBuilt:function(n,e){var t;u.set(y({},u.get(),((t={})[n]={type:"prepared",menu:e},t)))},setContents:function(n,e,t,r){c.set(k.some(n)),i.set(t),u.set(e),f.set(r);var o=Wm(r,t);a.set(o)},expand:function(t){return St(i.get(),t).map(function(n){var e=St(a.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return St(a.get(),n)},collapse:function(n){return St(a.get(),n).bind(function(n){return 1<n.length?k.some(n.slice(1)):k.none()})},lookupMenu:e,otherMenus:function(n){var e,t,r=f.get();return e=E(r),t=n,Tn(e,function(n){return!wn(t,n)})},getPrimary:function(){return c.get().bind(function(n){return e(n).bind(function(n){return"prepared"===n.type?k.some(n.menu):k.none()})})},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),a.set({}),c.set(k.none())},isClear:function(){return c.get().isNone()}}},qm=h("collapse-item"),Xm=mf({name:"TieredMenu",configFields:[ci("onExecute"),ci("onEscape"),ai("onOpenMenu"),ai("onOpenSubmenu"),ii("onCollapseMenu"),kr("highlightImmediately",!0),wr("data",[yr("primary"),yr("menus"),yr("expansions")]),kr("fakeFocus",!1),ii("onHighlight"),ii("onHover"),wr("markers",[yr("backgroundMenu")].concat(ni()).concat(ei())),yr("dom"),kr("navigateOnHover",!0),kr("stayInDom",!1),fc("tmenuBehaviours",[cc,Eu,gd,Gm]),kr("eventOrder",{})],apis:{collapseMenu:function(n,e){n.collapseMenu(e)},highlightPrimary:function(n,e){n.highlightPrimary(e)}},factory:function(a,n){var c,e,i=Ao(k.none()),u=function(r,o,n){return M(n,function(n,e){var t=function(){return jm.sketch(y({dom:n.dom},n,{value:e,items:n.items,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:a.fakeFocus?(o=function(n){return Eu.getHighlighted(n).map(function(n){return n.element()})},{get:o,set:function(e,n){var t=o(e);e.getSystem().getByDom(n).fold(x,function(n){Eu.highlight(e,n)});var r=o(e);Cu(e,t,r)}}):Du()}));var o};return e===o?{type:"prepared",menu:r.getSystem().build(t())}:{type:"notbuilt",nbMenu:t}})},f=_m(),s=function(n){return _f.getValue(n).value},l=function(n){return M(a.data.menus,function(n,e){return Bn(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})},d=function(e,n){Eu.highlight(e,n),Eu.getHighlighted(n).orThunk(function(){return Eu.getFirst(n)}).each(function(n){le(e,n.element(),ne())})},m=function(e,n){return Wo(Sn(n,function(n){return e.lookupMenu(n).bind(function(n){return"prepared"===n.type?k.some(n.menu):k.none()})}))},g=function(e,n,t){var r=m(n,n.otherMenus(t));On(r,function(n){dm(n.element(),[a.markers.backgroundMenu]),a.stayInDom||Gm.remove(e,n)})},p=function(n,r){var o,e=(o=n,i.get().getOrThunk(function(){var t={},n=Zi(o.element(),"."+a.markers.item),e=Tn(n,function(n){return"true"===po(n,"aria-haspopup")});return On(e,function(n){o.getSystem().getByDom(n).each(function(n){var e=s(n);t[e]=n})}),i.set(k.some(t)),t}));D(e,function(n,e){var t=wn(r,e);mo(n.element(),"aria-expanded",t)})},v=function(r,o,i){return k.from(i[0]).bind(function(n){return o.lookupMenu(n).bind(function(n){if("notbuilt"===n.type)return k.none();var e=n.menu,t=m(o,i.slice(1));return On(t,function(n){So(n.element(),a.markers.backgroundMenu)}),Se(e.element())||Gm.append(r,Om(e)),dm(e.element(),[a.markers.backgroundMenu]),d(r,e),g(r,o,i),k.some(e)})})};(e=c||(c={}))[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent";var h=function(o,i,u){void 0===u&&(u=c.HighlightSubmenu);var n=s(i);return f.expand(n).bind(function(r){return p(o,r),k.from(r[0]).bind(function(t){return f.lookupMenu(t).bind(function(n){var e=function(n,e,t){if("notbuilt"!==t.type)return t.menu;var r=n.getSystem().build(t.nbMenu());return f.setMenuBuilt(e,r),r}(o,t,n);return Se(e.element())||Gm.append(o,Om(e)),a.onOpenSubmenu(o,i,e),u===c.HighlightSubmenu?(Eu.highlightFirst(e),v(o,f,r)):(Eu.dehighlightAll(e),k.some(i))})})})},r=function(e,t){var n=s(t);return f.collapse(n).bind(function(n){return p(e,n),v(e,f,n).map(function(n){return a.onCollapseMenu(e,t,n),n})})},t=function(t){return function(e,n){return ru(n.getSource(),"."+a.markers.item).bind(function(n){return e.getSystem().getByDom(n).toOption().bind(function(n){return t(e,n).map(function(){return!0})})})}},o=zr([Pr(Hm(),function(e,n){var t=n.event().menu();Eu.highlight(e,t);var r=s(n.event().item());f.refresh(r).each(function(n){return g(e,f,n)})}),Yr(function(e,n){var t=n.event().target();e.getSystem().getByDom(t).each(function(n){0===s(n).indexOf("collapse-item")&&r(e,n),h(e,n,c.HighlightSubmenu).fold(function(){a.onExecute(e,n)},function(){})})}),_r(function(e,n){var t,r,o;(t=e,r=u(t,a.data.primary,a.data.menus),o=l(t),f.setContents(a.data.primary,r,a.data.expansions,o),f.getPrimary()).each(function(n){Gm.append(e,Om(n)),a.onOpenMenu(e,n),a.highlightImmediately&&d(e,n)})})].concat(a.navigateOnHover?[Pr(Dm(),function(n,e){var t,r,o=e.event().item();t=n,r=s(o),f.refresh(r).bind(function(n){return p(t,n),v(t,f,n)}),h(n,o,c.HighlightParent),a.onHover(n,o)})]:[])),b={collapseMenu:function(e){Eu.getHighlighted(e).each(function(n){Eu.getHighlighted(n).each(function(n){r(e,n)})})},highlightPrimary:function(e){f.getPrimary().each(function(n){d(e,n)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:lc(a.tmenuBehaviours,[cc.config({mode:"special",onRight:t(function(n,e){return Vu(e.element())?k.none():h(n,e,c.HighlightSubmenu)}),onLeft:t(function(n,e){return Vu(e.element())?k.none():r(n,e)}),onEscape:t(function(n,e){return r(n,e).orThunk(function(){return a.onEscape(n,e).map(function(){return n})})}),focusIn:function(e,n){f.getPrimary().each(function(n){le(e,n.element(),ne())})}}),Eu.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),gd.config({find:function(n){return Eu.getHighlighted(n)}}),Gm.config({})]),eventOrder:a.eventOrder,apis:b,events:o}},extraApis:{tieredData:function(n,e,t){return{primary:n,menus:e,expansions:t}},singleData:function(n,e){return{primary:n,menus:Ot(n,e),expansions:{}}},collapseItem:function(n){return{value:Oc(qm()),meta:{text:n}}}}}),Ym=function(n,e,t,r){return St(e.routes,r.start).bind(function(n){return St(n,r.destination)})},Km=function(n,e,t,r){return Ym(0,e,0,r).bind(function(e){return e.transition.map(function(n){return{transition:n,route:e}})})},Jm=function(t,r,n){var e,o,i;(e=t,o=r,i=n,Qm(e,o,i).bind(function(n){return Km(e,o,i,n)})).each(function(n){var e=n.transition;To(t.element(),e.transitionClass),ho(t.element(),r.destinationAttr)})},Qm=function(n,e,t){var r=n.element();return vo(r,e.destinationAttr)?k.some({start:po(n.element(),e.stateAttr),destination:po(n.element(),e.destinationAttr)}):k.none()},Zm=function(n,e,t,r){Jm(n,e,t),vo(n.element(),e.stateAttr)&&po(n.element(),e.stateAttr)!==r&&e.onFinish(n,r),mo(n.element(),e.stateAttr,r)},ng=Object.freeze({findRoute:Ym,disableTransition:Jm,getCurrentRoute:Qm,jumpTo:Zm,progressTo:function(t,r,o,i){var n,e;e=r,vo((n=t).element(),e.destinationAttr)&&(mo(n.element(),e.stateAttr,po(n.element(),e.destinationAttr)),ho(n.element(),e.destinationAttr));var u,a,c=(u=r,a=i,{start:po(t.element(),u.stateAttr),destination:a});Km(t,r,o,c).fold(function(){Zm(t,r,o,i)},function(n){Jm(t,r,o);var e=n.transition;So(t.element(),e.transitionClass),mo(t.element(),r.destinationAttr,i)})},getState:function(n,e,t){var r=n.element();return vo(r,e.stateAttr)?k.some(po(r,e.stateAttr)):k.none()}}),eg=Object.freeze({events:function(o,i){return zr([Pr(W(),function(t,n){var r=n.event().raw();Qm(t,o,i).each(function(e){Ym(0,o,0,e).each(function(n){n.transition.each(function(n){r.propertyName===n.property&&(Zm(t,o,i,e.destination),o.onTransition(t,e))})})})}),_r(function(n,e){Zm(n,o,i,o.initialState)})])}}),tg=[kr("destinationAttr","data-transitioning-destination"),kr("stateAttr","data-transitioning-state"),yr("initialState"),ii("onTransition"),ii("onFinish"),xr("routes",lr(it.value,lr(it.value,er([Tr("transition",[yr("property"),yr("transitionClass")])]))))],rg=co({fields:tg,name:"transitioning",active:eg,apis:ng,extra:{createRoutes:function(n){var r={};return D(n,function(n,e){var t=e.split("<->");r[t[0]]=Ot(t[1],n),r[t[1]]=Ot(t[0],n)}),r},createBistate:function(n,e,t){return Tt([{key:n,value:Ot(e,t)},{key:e,value:Ot(n,t)}])},createTristate:function(n,e,t,r){return Tt([{key:n,value:Tt([{key:e,value:r},{key:t,value:r}])},{key:e,value:Tt([{key:n,value:r},{key:t,value:r}])},{key:t,value:Tt([{key:n,value:r},{key:e,value:r}])}])}}}),og=Ii.resolve("scrollable"),ig={register:function(n){So(n,og)},deregister:function(n){To(n,og)},scrollable:h(og)},ug=function(n){return St(n,"format").getOr(n.title)},ag=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[Ii.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:Ii.resolve("format-matches"),selected:t},itemBehaviours:uo(o?[]:[Ci(n,function(n,e){(e?Ei.on:Ei.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},cg=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[pf.sketch({dom:{tag:"div",classes:[Ii.resolve("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[Ii.resolve("styles-collapse-icon")]}},ym(n)]:[ym(n)],action:function(n){if(r){var e=t().get(n);Xm.collapseMenu(e)}}}),{dom:{tag:"div",classes:[Ii.resolve("styles-menu-items-container")]},components:[jm.parts().items({})],behaviours:uo([ld("adhoc-scrollable-menu",[_r(function(n,e){zi(n.element(),"overflow-y","auto"),zi(n.element(),"-webkit-overflow-scrolling","touch"),ig.register(n.element())}),qr(function(n){$i(n.element(),"overflow-y"),$i(n.element(),"-webkit-overflow-scrolling"),ig.deregister(n.element())})])])}],items:e,menuBehaviours:uo([rg.config({initialState:"after",routes:rg.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},fg=function(r){var o,i,n,e,t,u=(o=r.formats,i=function(){return a},n=cg("Styles",[].concat(Sn(o.items,function(n){return ag(ug(n),n.title,n.isSelected(),n.getPreview(),Et(o.expansions,ug(n)))})),i,!1),e=M(o.menus,function(n,e){var t=Sn(n,function(n){return ag(ug(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",Et(o.expansions,ug(n)))});return cg(e,t,i,!0)}),t=ft(e,Ot("styles",n)),{tmenu:Xm.tieredData("styles",t,o.expansions)}),a=Nl(Xm.sketch({dom:{tag:"div",classes:[Ii.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=_f.getValue(e);return r.handle(e,t.value),k.none()},onEscape:function(){return k.none()},onOpenMenu:function(n,e){var t=is(n.element());os(e.element(),t),rg.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=is(n.element()),o=eu(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();os(t.element(),r),rg.progressTo(i,"before"),rg.jumpTo(t,"after"),rg.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=eu(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();rg.progressTo(o,"after"),rg.progressTo(t,"current")},navigateOnHover:!1,highlightImmediately:!0,data:u.tmenu,markers:{backgroundMenu:Ii.resolve("styles-background-menu"),menu:Ii.resolve("styles-menu"),selectedMenu:Ii.resolve("styles-selected-menu"),item:Ii.resolve("styles-item"),selectedItem:Ii.resolve("styles-selected-item")}}));return a.asSpec()},sg=function(n){return Et(n,"items")?(i=ft((ut([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),e=o=n,t=["items"],r={},D(e,function(n,e){wn(t,e)||(r[e]=n)}),r),{menu:!0}),u=lg(o.items),{item:i,menus:ft(u.menus,Ot(o.title,u.items)),expansions:ft(u.expansions,Ot(o.title,o.title))}):{item:n,menus:{},expansions:{}};var e,t,r,o,i,u},lg=function(n){return kn(n,function(n,e){var t=sg(e);return{menus:ft(n.menus,t.menus),items:[t.item].concat(n.items),expansions:ft(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},dg={expand:lg},mg=function(u,n){var a=function(n){return function(){return u.formatter.match(n)}},c=function(n){return function(){return u.formatter.getCssText(n)}},e=St(n,"style_formats").getOr(Kd),f=function(n){return Sn(n,function(n){if(Et(n,"items")){var e=f(n.items);return ft(ft(n,{isSelected:h(!1),getPreview:h("")}),{items:e})}return Et(n,"format")?ft(i=n,{isSelected:a(i.format),getPreview:c(i.format)}):(r=Oc((t=n).title),o=ft(t,{format:r,isSelected:a(r),getPreview:c(r)}),u.formatter.register(r,o),o);var t,r,o,i})};return f(e)},gg=function(t,n,r){var e,o,i,u=(e=t,i=(o=function(n){return Bn(n,function(n){return n.items===undefined?!Et(n,"format")||e.formatter.canApply(n.format)?[n]:[]:0<o(n.items).length?[n]:[]})})(n),dg.expand(i));return fg({formats:u,handle:function(n,e){t.undoManager.transact(function(){Ei.isOn(n)?t.formatter.remove(e):t.formatter.apply(e)}),r()}})},pg=["undo","bold","italic","link","image","bullist","styleselect"],vg=function(n){var e=n.replace(/\|/g," ").trim();return 0<e.length?e.split(/\s+/):[]},hg=function(n){return Bn(n,function(n){return vn(n)?hg(n):vg(n)})},bg=function(n){var e=n.toolbar!==undefined?n.toolbar:pg;return vn(e)?hg(e):vg(e)},yg=function(r,o){var n=function(n){return function(){return Sf.forToolbarCommand(o,n)}},e=function(n){return function(){return Sf.forToolbarStateCommand(o,n)}},t=function(n,e,t){return function(){return Sf.forToolbarStateAction(o,n,e,t)}},i=n("undo"),u=n("redo"),a=e("bold"),c=e("italic"),f=e("underline"),s=n("removeformat"),l=t("unlink","link",function(){o.execCommand("unlink",null,!1)}),d=t("unordered-list","ul",function(){o.execCommand("InsertUnorderedList",null,!1)}),m=t("ordered-list","ol",function(){o.execCommand("InsertOrderedList",null,!1)}),g=mg(o,o.settings),p=function(){return gg(o,g,function(){o.fire("scrollIntoView")})},v=function(n,e){return{isSupported:function(){return n.forall(function(n){return Et(o.buttons,n)})},sketch:e}};return{undo:v(k.none(),i),redo:v(k.none(),u),bold:v(k.none(),a),italic:v(k.none(),c),underline:v(k.none(),f),removeformat:v(k.none(),s),link:v(k.none(),function(){return e=r,t=o,Sf.forToolbarStateAction(t,"link","link",function(){var n=Yd(e,t);e.setContextToolbar(n),sd(t,function(){e.focusToolbar()}),ad.query(t).each(function(n){t.selection.select(n.dom())})});var e,t}),unlink:v(k.none(),l),image:v(k.none(),function(){return ed(o)}),bullist:v(k.some("bullist"),d),numlist:v(k.some("numlist"),m),fontsizeselect:v(k.none(),function(){return e=o,n={onChange:function(n){Rl.apply(e,n)},getInitialValue:function(){return Rl.get(e)}},El(r,"font-size",function(){return Vl(n)});var e,n}),forecolor:v(k.none(),function(){return Dl(r,o)}),styleselect:v(k.none(),function(){return Sf.forToolbar("style-formats",function(n){o.fire("toReading"),r.dropup().appear(p,Ei.on,n)},uo([Ei.config({toggleClass:Ii.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),mi.config({channels:Tt([Mi(jo.orientationChanged(),Ei.off),Mi(jo.dropupDismissed(),Ei.off)])})]))})}},xg=function(n,t){var e=bg(n),r={};return Bn(e,function(n){var e=!Et(r,n)&&Et(t,n)&&t[n].isSupported()?[t[n].sketch()]:[];return r[n]=!0,e})},wg=function(m,g){return function(n){if(m(n)){var e,t,r,o,i,u,a,c=ge.fromDom(n.target),f=function(){n.stopPropagation()},s=function(){n.preventDefault()},l=p(s,f),d=(e=c,t=n.clientX,r=n.clientY,o=f,i=s,u=l,a=n,{target:h(e),x:h(t),y:h(r),stop:o,prevent:i,kill:u,raw:h(a)});g(d)}}},Sg=function(n,e,t,r,o){var i=wg(t,r);return n.dom().addEventListener(e,i,o),{unbind:l(Og,n,e,i,o)}},Og=function(n,e,t,r){n.dom().removeEventListener(e,t,r)},Tg=h(!0),kg=function(n,e,t){return Sg(n,e,Tg,t,!1)},Eg=function(n,e,t){return Sg(n,e,Tg,t,!0)},Cg=function(n){var e=n.matchMedia("(orientation: portrait)").matches;return{isPortrait:h(e)}},Dg=Cg,Mg=function(r,e){var n=ge.fromDom(r),o=null,t=kg(n,"orientationchange",function(){clearInterval(o);var n=Cg(r);e.onChange(n),i(function(){e.onReady(n)})}),i=function(n){clearInterval(o);var e=r.innerHeight,t=0;o=setInterval(function(){e!==r.innerHeight?(clearInterval(o),n(k.some(r.innerHeight))):20<t&&(clearInterval(o),n(k.none())),t++},50)};return{onAdjustment:i,destroy:function(){t.unbind()}}},Ag=function(n){var e=qn.detect().os.isiOS(),t=Cg(n).isPortrait();return e&&!t?n.screen.height:n.screen.width},Ig=function(n){var e=n.raw();return e.touches===undefined||1!==e.touches.length?k.none():k.some(e.touches[0])},Bg=function(t){var u=Ao(k.none()),r=function n(t,r){var o=null;return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},schedule:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];o=setTimeout(function(){t.apply(null,n),o=null},r)}}}(function(n){u.set(k.none()),t.triggerEvent(re(),n)},400),o=Tt([{key:R(),value:function(t){return Ig(t).each(function(n){r.cancel();var e={x:h(n.clientX),y:h(n.clientY),target:t.target};r.schedule(t),u.set(k.some(e))}),k.none()}},{key:F(),value:function(n){return r.cancel(),Ig(n).each(function(i){u.get().each(function(n){var e,t,r,o;e=i,t=n,r=Math.abs(e.clientX-t.x()),o=Math.abs(e.clientY-t.y()),(5<r||5<o)&&u.set(k.none())})}),k.none()}},{key:V(),value:function(e){return r.cancel(),u.get().filter(function(n){return je(n.target(),e.target())}).map(function(n){return t.triggerEvent(ee(),e)})}}]);return{fireIfReady:function(e,n){return St(o,n).bind(function(n){return n(e)})}}},Rg=function(t){var e=Bg({triggerEvent:function(n,e){t.onTapContent(e)}});return{fireTouchstart:function(n){e.fireIfReady(n,"touchstart")},onTouchend:function(){return kg(t.body(),"touchend",function(n){e.fireIfReady(n,"touchend")})},onTouchmove:function(){return kg(t.body(),"touchmove",function(n){e.fireIfReady(n,"touchmove")})}}},Fg=6<=qn.detect().os.version.major,Vg=function(r,e,t){var o=Rg(r),i=ze(e),u=function(n){return!je(n.start(),n.finish())||n.soffset()!==n.foffset()},n=function(){var n=r.doc().dom().hasFocus()&&r.getSelection().exists(u);t.getByDom(e).each(!0===(n||Ro(i).filter(function(n){return"input"===be(n)}).exists(function(n){return n.dom().selectionStart!==n.dom().selectionEnd}))?Ei.on:Ei.off)},a=[kg(r.body(),"touchstart",function(n){r.onTouchContent(),o.fireTouchstart(n)}),o.onTouchmove(),o.onTouchend(),kg(e,"touchstart",function(n){r.onTouchToolstrip()}),r.onToReading(function(){Bo(r.body())}),r.onToEditing(x),r.onScrollToCursor(function(n){n.preventDefault(),r.getCursorBox().each(function(n){var e=r.win(),t=n.top()>e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!==t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0===Fg?[]:[kg(ge.fromDom(r.win()),"blur",function(){t.getByDom(e).each(Ei.off)}),kg(i,"select",n),kg(r.doc(),"selectionchange",n)]);return{destroy:function(){On(a,function(n){n.unbind()})}}},Ng=function(n,e){var t=parseInt(po(n,e),10);return isNaN(t)?0:t},Hg=function Gh(t,r){var o=function(n){return t(n)?k.from(n.dom().nodeValue):k.none()},n=qn.detect().browser,e=n.isIE()&&10===n.version.major?function(n){try{return o(n)}catch(e){return k.none()}}:o;return{get:function(n){if(!t(n))throw new Error("Can only get "+r+" value of a "+r+" node");return e(n).getOr("")},getOption:e,set:function(n,e){if(!t(n))throw new Error("Can only set raw "+r+" value of a "+r+" node");n.dom().nodeValue=e}}}(we,"text"),jg=function(n){return Hg.getOption(n)},zg=ut([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Lg={before:zg.before,on:zg.on,after:zg.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(b,b,b)}},Pg=ut([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ug=ke("start","soffset","finish","foffset"),Gg=Pg.relative,$g=Pg.exact,Wg=function(n,e,t,r){var o,i,u,a,c,f=(i=e,u=t,a=r,(c=ze(o=n).dom().createRange()).setStart(o.dom(),i),c.setEnd(u.dom(),a),c),s=je(n,t)&&e===r;return f.collapsed&&!s},_g=function(n,e,t){var r,o,i=n.document.createRange();return r=i,e.fold(function(n){r.setStartBefore(n.dom())},function(n,e){r.setStart(n.dom(),e)},function(n){r.setStartAfter(n.dom())}),o=i,t.fold(function(n){o.setEndBefore(n.dom())},function(n,e){o.setEnd(n.dom(),e)},function(n){o.setEndAfter(n.dom())}),i},qg=function(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i},Xg=function(n){return{left:h(n.left),top:h(n.top),right:h(n.right),bottom:h(n.bottom),width:h(n.width),height:h(n.height)}},Yg=ut([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Kg=function(n,e,t){return e(ge.fromDom(t.startContainer),t.startOffset,ge.fromDom(t.endContainer),t.endOffset)},Jg=function(n,e){var o,t,r,i=(o=n,e.match({domRange:function(n){return{ltr:h(n),rtl:k.none}},relative:function(n,e){return{ltr:q(function(){return _g(o,n,e)}),rtl:q(function(){return k.some(_g(o,e,n))})}},exact:function(n,e,t,r){return{ltr:q(function(){return qg(o,n,e,t,r)}),rtl:q(function(){return k.some(qg(o,t,r,n,e))})}}}));return(r=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Yg.rtl(ge.fromDom(n.endContainer),n.endOffset,ge.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Kg(0,Yg.ltr,r)}):Kg(0,Yg.ltr,r)},Qg=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(n,e){var t=be(n);return"input"===t?Lg.after(n):wn(["br","img"],t)?0===e?Lg.before(n):Lg.after(n):Lg.on(n,e)}),Zg=function(n,e,t,r,o){var i,u,a=qg(n,e,t,r,o);i=n,u=a,k.from(i.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(u)})},np=function(n,e,t,r,o){var i,u,a,c,l,f=(i=r,u=o,a=Qg(e,t),c=Qg(i,u),Gg(a,c));Jg(l=n,f).match({ltr:function(n,e,t,r){Zg(l,n,e,t,r)},rtl:function(n,e,t,r){var o,i,u,a,c,f=l.getSelection();if(f.setBaseAndExtent)f.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(f.extend)try{i=n,u=e,a=t,c=r,(o=f).collapse(i.dom(),u),o.extend(a.dom(),c)}catch(s){Zg(l,t,r,n,e)}else Zg(l,t,r,n,e)}})},ep=function(n){var e=ge.fromDom(n.anchorNode),t=ge.fromDom(n.focusNode);return Wg(e,n.anchorOffset,t,n.focusOffset)?k.some(Ug(ge.fromDom(n.anchorNode),n.anchorOffset,ge.fromDom(n.focusNode),n.focusOffset)):function(n){if(0<n.rangeCount){var e=n.getRangeAt(0),t=n.getRangeAt(n.rangeCount-1);return k.some(Ug(ge.fromDom(e.startContainer),e.startOffset,ge.fromDom(t.endContainer),t.endOffset))}return k.none()}(n)},tp=function(n){return k.from(n.getSelection()).filter(function(n){return 0<n.rangeCount}).bind(ep)},rp=function(n,e){var i,t,r,o,u=Jg(i=n,e).match({ltr:function(n,e,t,r){var o=i.document.createRange();return o.setStart(n.dom(),e),o.setEnd(t.dom(),r),o},rtl:function(n,e,t,r){var o=i.document.createRange();return o.setStart(t.dom(),r),o.setEnd(n.dom(),e),o}});return r=(t=u).getClientRects(),0<(o=0<r.length?r[0]:t.getBoundingClientRect()).width||0<o.height?k.some(o).map(Xg):k.none()},op=function(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:h(2),height:n.height}},ip=function(n){return{left:h(n.left),top:h(n.top),right:h(n.right),bottom:h(n.bottom),width:h(n.width),height:h(n.height)}},up=function(r){if(r.collapsed){var o=ge.fromDom(r.startContainer);return Le(o).bind(function(n){var e,t=$g(o,r.startOffset,n,"img"===be(e=n)?1:jg(e).fold(function(){return Pe(e).length},function(n){return n.length}));return rp(r.startContainer.ownerDocument.defaultView,t).map(op).map(Nn)}).getOr([])}return Sn(r.getClientRects(),ip)},ap=function(n){var e=n.getSelection();return e!==undefined&&0<e.rangeCount?up(e.getRangeAt(0)):[]},cp=function(n){n.focus();var e=ge.fromDom(n.document.body);(Ro().exists(function(n){return wn(["input","textarea"],be(n))})?function(n){setTimeout(function(){n()},0)}:s)(function(){Ro().each(Bo),Io(e)})},fp="data-"+Ii.resolve("last-outer-height"),sp=function(n,e){mo(n,fp,e)},lp=function(n){return{top:h(n.top()),bottom:h(n.top()+n.height())}},dp=function(n,e){var t=Ng(e,fp),r=n.innerHeight;return r<t?k.some(t-r):k.none()},mp=function(n,u){var e=ge.fromDom(u.document.body),t=kg(ge.fromDom(n),"resize",function(){dp(n,e).each(function(i){var n,e;(n=u,e=ap(n),0<e.length?k.some(e[0]).map(lp):k.none()).each(function(n){var e,t,r,o=(e=u,r=i,(t=n).top()>e.innerHeight||t.bottom()>e.innerHeight?Math.min(r,t.bottom()-e.innerHeight+50):0);0!==o&&u.scrollTo(u.pageXOffset,u.pageYOffset+o)})}),sp(e,n.innerHeight)});return sp(e,n.innerHeight),{toEditing:function(){cp(u)},destroy:function(){t.unbind()}}},gp=function(n){return k.some(ge.fromDom(n.dom().contentWindow.document.body))},pp=function(n){return k.some(ge.fromDom(n.dom().contentWindow.document))},vp=function(n){return k.from(n.dom().contentWindow)},hp=function(n){return vp(n).bind(tp)},bp=function(n){return n.getFrame()},yp=function(n,t){return function(e){return e[n].getOrThunk(function(){var n=bp(e);return function(){return t(n)}})()}},xp=function(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return kg(e,r,n)}})},wp=function(n){return{left:h(n.left),top:h(n.top),right:h(n.right),bottom:h(n.bottom),width:h(n.width),height:h(n.height)}},Sp={getBody:yp("getBody",gp),getDoc:yp("getDoc",pp),getWin:yp("getWin",vp),getSelection:yp("getSelection",hp),getFrame:bp,getActiveApi:function(a){var c=bp(a);return gp(c).bind(function(u){return pp(c).bind(function(i){return vp(c).map(function(o){var n=ge.fromDom(i.dom().documentElement),e=a.getCursorBox.getOrThunk(function(){return function(){return(n=o,tp(n).map(function(n){return $g(n.start(),n.soffset(),n.finish(),n.foffset())})).bind(function(n){return rp(o,n).orThunk(function(){return tp(o).filter(function(n){return je(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0<e.width||0<e.height?k.some(e).map(wp):k.none()})})});var n}}),t=a.setSelection.getOrThunk(function(){return function(n,e,t,r){np(o,n,e,t,r)}}),r=a.clearSelection.getOrThunk(function(){return function(){o.getSelection().removeAllRanges()}});return{body:h(u),doc:h(i),win:h(o),html:h(n),getSelection:l(hp,c),setSelection:t,clearSelection:r,frame:h(c),onKeyup:xp(a,i,"onKeyup","keyup"),onNodeChanged:xp(a,i,"onNodeChanged","selectionchange"),onDomChanged:a.onDomChanged,onScrollToCursor:a.onScrollToCursor,onScrollToElement:a.onScrollToElement,onToReading:a.onToReading,onToEditing:a.onToEditing,onToolbarScrollStart:a.onToolbarScrollStart,onTouchContent:a.onTouchContent,onTapContent:a.onTapContent,onTouchToolstrip:a.onTouchToolstrip,getCursorBox:e}})})})}},Op="data-ephox-mobile-fullscreen-style",Tp="position:absolute!important;",kp="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;",Ep=qn.detect().os.isAndroid(),Cp=function(n,e){var t,r,o,i=function(r){return function(n){var e=po(n,"style"),t=e===undefined?"no-styles":e.trim();t!==r&&(mo(n,Op,t),mo(n,"style",r))}},u=(t="*",Ji(n,function(n){return Fe(n,t)},r)),a=Bn(u,function(n){var e;return e="*",Qi(n,function(n){return Fe(n,e)})}),c=(o=Pi(e,"background-color"))!==undefined&&""!==o?"background-color:"+o+"!important":"background-color:rgb(255,255,255)!important;";On(a,i("display:none!important;")),On(u,i(Tp+kp+c)),i((!0===Ep?"":Tp)+kp+c)(n)},Dp=function(){var n=Ne("["+Op+"]");On(n,function(n){var e=po(n,Op);"no-styles"!==e?mo(n,"style",e):ho(n,"style"),ho(n,Op)})},Mp=function(){var e=nu("head").getOrDie(),n=nu('meta[name="viewport"]').getOrThunk(function(){var n=ge.fromTag("meta");return mo(n,"name","viewport"),_e(e,n),n}),t=po(n,"content");return{maximize:function(){mo(n,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){t!==undefined&&null!==t&&0<t.length?mo(n,"content",t):mo(n,"content","user-scalable=yes")}}},Ap=function(e,n){var t=Mp(),r=Gd(),o=Gd();return{enter:function(){n.hide(),So(e.container,Ii.resolve("fullscreen-maximized")),So(e.container,Ii.resolve("android-maximized")),t.maximize(),So(e.body,Ii.resolve("android-scroll-reload")),r.set(mp(e.win,Sp.getWin(e.editor).getOrDie("no"))),Sp.getActiveApi(e.editor).each(function(n){Cp(e.container,n.body()),o.set(Vg(n,e.toolstrip,e.alloy))})},exit:function(){t.restore(),n.show(),To(e.container,Ii.resolve("fullscreen-maximized")),To(e.container,Ii.resolve("android-maximized")),Dp(),To(e.body,Ii.resolve("android-scroll-reload")),o.clear(),r.clear()}}},Ip=function(t,r){var o=null;return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==o&&clearTimeout(o),o=setTimeout(function(){t.apply(null,n),o=null},r)}}},Bp=function(n,e){var t,r,o,i=Nl(pd.sketch({dom:bf('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:uo([Ei.config({toggleClass:Ii.resolve("mask-tap-icon-selected"),toggleOnExecute:!1})])})),u=(t=n,r=200,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null===o&&(o=setTimeout(function(){t.apply(null,n),o=null},r))}});return pd.sketch({dom:bf('<div class="${prefix}-disabled-mask"></div>'),components:[pd.sketch({dom:bf('<div class="${prefix}-content-container"></div>'),components:[pf.sketch({dom:bf('<div class="${prefix}-content-tap-section"></div>'),components:[i.asSpec()],action:function(n){u.throttle()},buttonBehaviours:uo([Ei.config({toggleClass:Ii.resolve("mask-tap-icon-selected")})])})]})]})},Rp=tr([wr("editor",[yr("getFrame"),Sr("getBody"),Sr("getDoc"),Sr("getWin"),Sr("getSelection"),Sr("setSelection"),Sr("clearSelection"),Sr("cursorSaver"),Sr("onKeyup"),Sr("onNodeChanged"),Sr("getCursorBox"),yr("onDomChanged"),kr("onTouchContent",x),kr("onTapContent",x),kr("onTouchToolstrip",x),kr("onScrollToCursor",h({unbind:x})),kr("onScrollToElement",h({unbind:x})),kr("onToEditing",h({unbind:x})),kr("onToReading",h({unbind:x})),kr("onToolbarScrollStart",b)]),yr("socket"),yr("toolstrip"),yr("dropup"),yr("toolbar"),yr("container"),yr("alloy"),Cr("win",function(n){return ze(n.socket).dom().defaultView}),Cr("body",function(n){return ge.fromDom(n.socket.dom().ownerDocument.body)}),kr("translate",b),kr("setReadOnly",x),kr("readOnlyOnInit",h(!0))]),Fp=function(n){var e=gr("Getting AndroidWebapp schema",Rp,n);zi(e.toolstrip,"width","100%");var t=Sm(Bp(function(){e.setReadOnly(e.readOnlyOnInit()),o.enter()},e.translate));e.alloy.add(t);var r={show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}};_e(e.container,t.element());var o=Ap(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:x,enter:o.enter,exit:o.exit,destroy:x}},Vp=h([kr("shell",!0),fc("toolbarBehaviours",[Gm])]),Np=h([zc({name:"groups",overrides:function(n){return{behaviours:uo([Gm.config({})])}}})]),Hp=gf({name:"Toolbar",configFields:Vp(),partFields:Np(),factory:function(e,n,t,r){var o=function(n){return e.shell?k.some(n):qc(n,e,"groups")},i=e.shell?{behaviours:[Gm.config({})],components:[]}:{behaviours:[],components:n};return{uid:e.uid,dom:e.dom,components:i.components,behaviours:lc(e.toolbarBehaviours,i.behaviours),apis:{setGroups:function(n,e){o(n).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(n){Gm.set(n,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,e,t){n.setGroups(e,t)}}}),jp=h([yr("items"),(Ql=["itemSelector"],wr("markers",Sn(Ql,yr))),fc("tgroupBehaviours",[cc])]),zp=h([Lc({name:"items",unit:"item"})]),Lp=gf({name:"ToolbarGroup",configFields:jp(),partFields:zp(),factory:function(n,e,t,r){return{uid:n.uid,dom:n.dom,components:e,behaviours:lc(n.tgroupBehaviours,[cc.config({mode:"flow",selector:n.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),Pp="data-"+Ii.resolve("horizontal-scroll"),Up=function(n){return"true"===po(n,Pp)?0<(t=n).dom().scrollLeft||function(n){n.dom().scrollLeft=1;var e=0!==n.dom().scrollLeft;return n.dom().scrollLeft=0,e}(t):0<(e=n).dom().scrollTop||function(n){n.dom().scrollTop=1;var e=0!==n.dom().scrollTop;return n.dom().scrollTop=0,e}(e);var e,t},Gp={exclusive:function(n,e){return kg(n,"touchmove",function(n){ru(n.target(),e).filter(Up).fold(function(){n.raw().preventDefault()},x)})},markAsHorizontal:function(n){mo(n,Pp,"true")}};function $p(){var e=function(n){var e=!0===n.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:bf('<div aria-label="'+n.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:uo([ld("adhoc-scrollable-toolbar",!0===n.scrollable?[Xr(function(n,e){zi(n.element(),"overflow-x","auto"),Gp.markAsHorizontal(n.element()),ig.register(n.element())})]:[])]),components:[pd.sketch({components:[Lp.parts().items({})]})],markers:{itemSelector:"."+Ii.resolve("toolbar-group-item")},items:n.items}},t=Sm(Hp.sketch({dom:bf('<div class="${prefix}-toolbar"></div>'),components:[Hp.parts().groups({})],toolbarBehaviours:uo([Ei.config({toggleClass:Ii.resolve("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),cc.config({mode:"cyclic"})]),shell:!0})),n=Sm(pd.sketch({dom:{classes:[Ii.resolve("toolstrip")]},components:[Om(t)],containerBehaviours:uo([Ei.config({toggleClass:Ii.resolve("android-selection-context-toolbar"),toggleOnExecute:!1})])})),r=function(){Hp.setGroups(t,o.get()),Ei.off(t)},o=Ao([]);return{wrapper:h(n),toolbar:h(t),createGroups:function(n){return Sn(n,p(Lp.sketch,e))},setGroups:function(n){o.set(n),r()},setContextToolbar:function(n){Ei.on(t),Hp.setGroups(t,n)},restoreToolbar:function(){Ei.isOn(t)&&r()},refresh:function(){},focus:function(){cc.focusIn(t)}}}var Wp,_p=function(n,e){Gm.append(n,Om(e))},qp=function(n,e){Gm.remove(n,e)},Xp=function(n){return Sm(pf.sketch({dom:bf('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){n.run(function(n){n.setReadOnly(!1)})}}))},Yp=function(){return Sm(pd.sketch({dom:bf('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:uo([Gm.config({})])}))},Kp=function(n,e,t,r){(!0===t?Mo.toAlpha:Mo.toOmega)(r),(t?_p:qp)(n,e)},Jp=function(e,n){return n.getAnimationRoot.fold(function(){return e.element()},function(n){return n(e)})},Qp=function(n){return n.dimension.property},Zp=function(n,e){return n.dimension.getDimension(e)},nv=function(n,e){var t=Jp(n,e);dm(t,[e.shrinkingClass,e.growingClass])},ev=function(n,e){To(n.element(),e.openClass),So(n.element(),e.closedClass),zi(n.element(),Qp(e),"0px"),Wi(n.element())},tv=function(n,e){To(n.element(),e.closedClass),So(n.element(),e.openClass),$i(n.element(),Qp(e))},rv=function(n,e,t,r){t.setCollapsed(),zi(n.element(),Qp(e),Zp(e,n.element())),Wi(n.element()),nv(n,e),ev(n,e),e.onStartShrink(n),e.onShrunk(n)},ov=function(n,e,t,r){var o=r.getOrThunk(function(){return Zp(e,n.element())});t.setCollapsed(),zi(n.element(),Qp(e),o),Wi(n.element());var i=Jp(n,e);To(i,e.growingClass),So(i,e.shrinkingClass),ev(n,e),e.onStartShrink(n)},iv=function(n,e,t){var r=Zp(e,n.element());("0px"===r?rv:ov)(n,e,t,k.some(r))},uv=function(n,e,t){var r=Jp(n,e),o=ko(r,e.shrinkingClass),i=Zp(e,n.element());tv(n,e);var u=Zp(e,n.element());(o?function(){zi(n.element(),Qp(e),i),Wi(n.element())}:function(){ev(n,e)})(),To(r,e.shrinkingClass),So(r,e.growingClass),tv(n,e),zi(n.element(),Qp(e),u),t.setExpanded(),e.onStartGrow(n)},av=function(n,e,t){var r=Jp(n,e);return!0===ko(r,e.growingClass)},cv=function(n,e,t){var r=Jp(n,e);return!0===ko(r,e.shrinkingClass)},fv=Object.freeze({grow:function(n,e,t){t.isExpanded()||uv(n,e,t)},shrink:function(n,e,t){t.isExpanded()&&iv(n,e,t)},immediateShrink:function(n,e,t){t.isExpanded()&&rv(n,e,t,k.none())},hasGrown:function(n,e,t){return t.isExpanded()},hasShrunk:function(n,e,t){return t.isCollapsed()},isGrowing:av,isShrinking:cv,isTransitioning:function(n,e,t){return!0===av(n,e)||!0===cv(n,e)},toggleGrow:function(n,e,t){(t.isExpanded()?iv:uv)(n,e,t)},disableTransitions:nv}),sv=Object.freeze({exhibit:function(n,e){var t=e.expanded;return Qr(t?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:Ot(e.dimension.property,"0px")})},events:function(t,r){return zr([(n=W(),e=function(n,e){e.event().raw().propertyName===t.dimension.property&&(nv(n,t),r.isExpanded()&&$i(n.element(),t.dimension.property),(r.isExpanded()?t.onGrown:t.onShrunk)(n))},Gr(n)(e))]);var n,e}}),lv=[yr("closedClass"),yr("openClass"),yr("shrinkingClass"),yr("growingClass"),Sr("getAnimationRoot"),ii("onShrunk"),ii("onStartShrink"),ii("onGrown"),ii("onStartGrow"),kr("expanded",!1),xr("dimension",vr("property",{width:[fi("property","width"),fi("getDimension",function(n){return is(n)+"px"})],height:[fi("property","height"),fi("getDimension",function(n){return Ki(n)+"px"})]}))],dv=co({fields:lv,name:"sliding",active:sv,apis:fv,state:Object.freeze({init:function(n){var e=Ao(n.expanded);return io({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:l(e.set,!1),setExpanded:l(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),mv=function(e,t){var r=Sm(pd.sketch({dom:{tag:"div",classes:[Ii.resolve("dropup")]},components:[],containerBehaviours:uo([Gm.config({}),dv.config({closedClass:Ii.resolve("dropup-closed"),openClass:Ii.resolve("dropup-open"),shrinkingClass:Ii.resolve("dropup-shrinking"),growingClass:Ii.resolve("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){e(),t(),Gm.set(n,[])},onGrown:function(n){e(),t()}}),Di(function(n,e){o(x)})])})),o=function(n){window.requestAnimationFrame(function(){n(),dv.shrink(r)})};return{appear:function(n,e,t){!0===dv.hasShrunk(r)&&!1===dv.isTransitioning(r)&&window.requestAnimationFrame(function(){e(t),Gm.set(r,[n()]),dv.grow(r)})},disappear:o,component:h(r),element:r.element}},gv=function(n){var e,t;return 8===n.raw().which&&!wn(["input","textarea"],be(n.target()))&&(e=n.target(),!ru(e,'[contenteditable="true"]',t).isSome())},pv=qn.detect().browser.isFirefox(),vv=er([(Wp="triggerEvent",xr(Wp,br)),kr("stopBackspace",!0)]),hv=function(e,n){var t,r,o,i,u=gr("Getting GUI events settings",vv,n),a=qn.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],c=Bg(u),f=Sn(a.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(n){return kg(e,n,function(e){c.fireIfReady(e,n).each(function(n){n&&e.kill()}),u.triggerEvent(n,e)&&e.kill()})}),s=Ao(k.none()),l=kg(e,"paste",function(e){c.fireIfReady(e,"paste").each(function(n){n&&e.kill()}),u.triggerEvent("paste",e)&&e.kill(),s.set(k.some(setTimeout(function(){u.triggerEvent(Jn(),e)},0)))}),d=kg(e,"keydown",function(n){u.triggerEvent("keydown",n)?n.kill():!0===u.stopBackspace&&gv(n)&&n.prevent()}),m=(t=e,r=function(n){u.triggerEvent("focusin",n)&&n.kill()},pv?Eg(t,"focus",r):kg(t,"focusin",r)),g=Ao(k.none()),p=(o=e,i=function(n){u.triggerEvent("focusout",n)&&n.kill(),g.set(k.some(setTimeout(function(){u.triggerEvent(Kn(),n)},0)))},pv?Eg(o,"blur",i):kg(o,"focusout",i));return{unbind:function(){On(f,function(n){n.unbind()}),d.unbind(),m.unbind(),p.unbind(),l.unbind(),s.get().each(clearTimeout),g.get().each(clearTimeout)}}},bv=function(n,e){var t=St(n,"target").map(function(n){return n()}).getOr(e);return Ao(t)},yv=ut([{stopped:[]},{resume:["element"]},{complete:[]}]),xv=function(n,r,e,t,o,i){var u,a,c,f,s=n(r,t),l=(u=e,a=o,c=Ao(!1),f=Ao(!1),{stop:function(){c.set(!0)},cut:function(){f.set(!0)},isStopped:c.get,isCut:f.get,event:h(u),setSource:a.set,getSource:a.get});return s.fold(function(){return i.logEventNoHandlers(r,t),yv.complete()},function(e){var t=e.descHandler();return om(t)(l),l.isStopped()?(i.logEventStopped(r,e.element(),t.purpose()),yv.stopped()):l.isCut()?(i.logEventCut(r,e.element(),t.purpose()),yv.complete()):Le(e.element()).fold(function(){return i.logNoParent(r,e.element(),t.purpose()),yv.complete()},function(n){return i.logEventResponse(r,e.element(),t.purpose()),yv.resume(n)})})},wv=function(e,t,r,n,o,i){return xv(e,t,r,n,o,i).fold(function(){return!0},function(n){return wv(e,t,r,n,o,i)},function(){return!1})},Sv=function(n,e,t){var r,o,i=(r=e,o=Ao(!1),{stop:function(){o.set(!0)},cut:x,isStopped:o.get,isCut:h(!1),event:h(r),setSource:f("Cannot set source of a broadcasted event"),getSource:f("Cannot get source of a broadcasted event")});return On(n,function(n){var e=n.descHandler();om(e)(i)}),i.isStopped()},Ov=function(n,e,t,r,o){var i=bv(t,r);return wv(n,e,t,r,i,o)},Tv=ke("element","descHandler"),kv=function(n,e){return{id:h(n),descHandler:h(e)}};function Ev(){var i={};return{registerId:function(r,o,n){D(n,function(n,e){var t=i[e]!==undefined?i[e]:{};t[o]=rm(n,r),i[e]=t})},unregisterId:function(t){D(i,function(n,e){n.hasOwnProperty(t)&&delete n[t]})},filterByType:function(n){return St(i,n).map(function(n){return I(n,function(n,e){return kv(e,n)})}).getOr([])},find:function(n,e,t){var o=xt(e)(i);return jr(t,function(n){return t=o,uf(r=n).fold(function(){return k.none()},function(n){var e=xt(n);return t.bind(e).map(function(n){return Tv(r,n)})});var t,r},n)}}}function Cv(){var r=Ev(),o={},i=function(r){var n=r.element();return uf(n).fold(function(){return n="uid-",e=r.element(),t=Oc(tf+n),of(e,t),t;var n,e,t},function(n){return n})},u=function(n){uf(n.element()).each(function(n){o[n]=undefined,r.unregisterId(n)})};return{find:function(n,e,t){return r.find(n,e,t)},filter:function(n){return r.filterByType(n)},register:function(n){var e=i(n);Et(o,e)&&function(n,e){var t=o[e];if(t!==n)throw new Error('The tagId "'+e+'" is already used by: '+Go(t.element())+"\nCannot use it for: "+Go(n.element())+"\nThe conflicting element is"+(Se(t.element())?" ":" not ")+"already in the DOM");u(n)}(n,e);var t=[n];r.registerId(t,e,n.events()),o[e]=n},unregister:u,getById:function(n){return xt(n)(o)}}}var Dv=function(t){var r=function(e){return Le(t.element()).fold(function(){return!0},function(n){return je(e,n)})},o=Cv(),f=function(n,e){return o.find(r,n,e)},n=hv(t.element(),{triggerEvent:function(u,a){return Qo(u,a.target(),function(n){return e=f,t=u,o=n,i=(r=a).target(),Ov(e,t,r,i,o);var e,t,r,o,i})}}),i={debugInfo:h("real"),triggerEvent:function(e,t,r){Qo(e,t,function(n){Ov(f,e,r,t,n)})},triggerFocus:function(a,c){uf(a).fold(function(){Io(a)},function(n){Qo(Yn(),a,function(n){var e,t,r,o,i,u;e=f,t=Yn(),r={originator:h(c),kill:x,prevent:x,target:h(a)},i=n,u=bv(r,o=a),xv(e,t,r,o,u,i)})})},triggerEscape:function(n,e){i.triggerEvent("keydown",n.element(),e.event())},getByUid:function(n){return g(n)},getByDom:function(n){return p(n)},build:Sm,addToGui:function(n){a(n)},removeFromGui:function(n){c(n)},addToWorld:function(n){e(n)},removeFromWorld:function(n){u(n)},broadcast:function(n){l(n)},broadcastOn:function(n,e){d(n,e)},broadcastEvent:function(n,e){m(n,e)},isConnected:h(!0)},e=function(n){n.connect(i),we(n.element())||(o.register(n),On(n.components(),e),i.triggerEvent(oe(),n.element(),{target:h(n.element())}))},u=function(n){we(n.element())||(On(n.components(),u),o.unregister(n)),n.disconnect()},a=function(n){Qe(t,n)},c=function(n){et(n)},s=function(t){var n=o.filter(Qn());On(n,function(n){var e=n.descHandler();om(e)(t)})},l=function(n){s({universal:h(!0),data:h(n)})},d=function(n,e){s({universal:h(!1),channels:h(n),data:h(e)})},m=function(n,e){var t=o.filter(n);return Sv(t,e)},g=function(n){return o.getById(n).fold(function(){return it.error(new Error('Could not find component with uid: "'+n+'" in system.'))},it.value)},p=function(n){var e=uf(n).getOr("not found");return g(e)};return e(t),{root:h(t),element:t.element,destroy:function(){n.unbind(),Ye(t.element())},add:a,remove:c,getByUid:g,getByDom:p,addToWorld:e,removeFromWorld:u,broadcast:l,broadcastOn:d,broadcastEvent:m}},Mv=h(Ii.resolve("readonly-mode")),Av=h(Ii.resolve("edit-mode"));function Iv(n){var e=Sm(pd.sketch({dom:{classes:[Ii.resolve("outer-container")].concat(n.classes)},containerBehaviours:uo([Mo.config({alpha:Mv(),omega:Av()})])}));return Dv(e)}var Bv=function(n,e){var t=ge.fromTag("input");Li(t,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),_e(n,t),Io(t),e(t),Ye(t)},Rv=function(n){var e=n.getSelection();if(0<e.rangeCount){var t=e.getRangeAt(0),r=n.document.createRange();r.setStart(t.startContainer,t.startOffset),r.setEnd(t.endContainer,t.endOffset),e.removeAllRanges(),e.addRange(r)}},Fv=function(n,e){Ro().each(function(n){je(n,e)||Bo(n)}),n.focus(),Io(ge.fromDom(n.document.body)),Rv(n)},Vv={stubborn:function(n,e,t,r){var o=function(){Fv(e,r)},i=kg(t,"keydown",function(n){wn(["input","textarea"],be(n.target()))||o()});return{toReading:function(){Bv(n,Bo)},toEditing:o,onToolbarTouch:function(){},destroy:function(){i.unbind()}}},timid:function(n,e,t,r){var o=function(){Bo(r)};return{toReading:function(){o()},toEditing:function(){Fv(e,r)},onToolbarTouch:function(){o()},destroy:x}}},Nv=function(t,r,o,i,n){var u=function(){r.run(function(n){n.refreshSelection()})},e=function(n,e){var t=n-i.dom().scrollTop;r.run(function(n){n.scrollIntoView(t,t+e)})},a=function(){r.run(function(n){n.clearSelection()})},c=function(){t.getCursorBox().each(function(n){e(n.top(),n.height())}),r.run(function(n){n.syncHeight()})},f=Rg(t),s=Ip(c,300),l=[t.onKeyup(function(){a(),s.throttle()}),t.onNodeChanged(u),t.onDomChanged(s.throttle),t.onDomChanged(u),t.onScrollToCursor(function(n){n.preventDefault(),s.throttle()}),t.onScrollToElement(function(n){n.element(),e(r,i)}),t.onToEditing(function(){r.run(function(n){n.toEditing()})}),t.onToReading(function(){r.run(function(n){n.toReading()})}),kg(t.doc(),"touchend",function(n){je(t.html(),n.target())||je(t.body(),n.target())}),kg(o,"transitionend",function(n){var e;"height"===n.raw().propertyName&&(e=Ki(o),r.run(function(n){n.setViewportOffset(e)}),u(),c())}),Eg(o,"touchstart",function(n){var e;r.run(function(n){n.highlightSelection()}),e=n,r.run(function(n){n.onToolbarTouch(e)}),t.onTouchToolstrip()}),kg(t.body(),"touchstart",function(n){a(),t.onTouchContent(),f.fireTouchstart(n)}),f.onTouchmove(),f.onTouchend(),kg(t.body(),"click",function(n){n.kill()}),kg(o,"touchmove",function(){t.onToolbarScrollStart()})];return{destroy:function(){On(l,function(n){n.unbind()})}}},Hv=function(n){var t=k.none(),e=[],r=function(n){o()?u(n):e.push(n)},o=function(){return t.isSome()},i=function(n){On(n,u)},u=function(e){t.each(function(n){setTimeout(function(){e(n)},0)})};return n(function(n){t=k.some(n),i(e),e=[]}),{get:r,map:function(t){return Hv(function(e){r(function(n){e(t(n))})})},isReady:o}},jv={nu:Hv,pure:function(e){return Hv(function(n){n(e)})}},zv=function(e){var n=function(n){var r;e((r=n,function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=this;setTimeout(function(){r.apply(t,n)},0)}))},t=function(){return jv.nu(n)};return{map:function(r){return zv(function(t){n(function(n){var e=r(n);t(e)})})},bind:function(t){return zv(function(e){n(function(n){t(n).get(e)})})},anonBind:function(t){return zv(function(e){n(function(n){t.get(e)})})},toLazy:t,toCached:function(){var e=null;return zv(function(n){null===e&&(e=t()),e.get(n)})},get:n}},Lv={nu:zv,pure:function(e){return zv(function(n){n(e)})}},Pv=function(n,e,t){return Math.abs(n-e)<=t?k.none():n<e?k.some(n+t):k.some(n-t)},Uv=function(){var f=null;return{animate:function(r,o,n,i,e,t){var u=!1,a=function(n){u=!0,e(n)};clearInterval(f);var c=function(n){clearInterval(f),a(n)};f=setInterval(function(){var t=r();Pv(t,o,n).fold(function(){clearInterval(f),a(o)},function(n){if(i(n,c),!u){var e=r();(e!==n||Math.abs(e-o)>Math.abs(t-o))&&(clearInterval(f),a(o))}})},t)}}},Gv=function(e,t){return _o([{width:320,height:480,keyboard:{portrait:300,landscape:240}},{width:320,height:568,keyboard:{portrait:300,landscape:240}},{width:375,height:667,keyboard:{portrait:305,landscape:240}},{width:414,height:736,keyboard:{portrait:320,landscape:240}},{width:768,height:1024,keyboard:{portrait:320,landscape:400}},{width:1024,height:1366,keyboard:{portrait:380,landscape:460}}],function(n){return e<=n.width&&t<=n.height?k.some(n.keyboard):k.none()}).getOr({portrait:t/5,landscape:e/4})},$v=function(n){var e,t=Dg(n).isPortrait(),r=Gv((e=n).screen.width,e.screen.height),o=t?r.portrait:r.landscape;return(t?n.screen.height:n.screen.width)-n.innerHeight>o?0:o},Wv=function(n,e){var t=ze(n).dom().defaultView;return Ki(n)+Ki(e)-$v(t)},_v=Wv,qv=function(n,e,t){var r=Wv(e,t),o=Ki(e)+Ki(t)-r;zi(n,"padding-bottom",o+"px")},Xv=ut([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Yv="data-"+Ii.resolve("position-y-fixed"),Kv="data-"+Ii.resolve("y-property"),Jv="data-"+Ii.resolve("scrolling"),Qv="data-"+Ii.resolve("last-window-height"),Zv=function(n){return Ng(n,Yv)},nh=function(n,e){var t=po(n,Kv);return Xv.fixed(n,t,e)},eh=function(n,e){return Xv.scroller(n,e)},th=function(n){var e=Zv(n);return("true"===po(n,Jv)?eh:nh)(n,e)},rh=function(n,e,t){var r=ze(n).dom().defaultView.innerHeight;return mo(n,Qv,r+"px"),r-e-t},oh=function(n){var e=Zi(n,"["+Yv+"]");return Sn(e,th)},ih=function(r,o,i,u){var n,e,t,a,c,f,s,l,d=ze(r).dom().defaultView,m=(l=po(s=i,"style"),Li(s,{position:"absolute",top:"0px"}),mo(s,Yv,"0px"),mo(s,Kv,"top"),{restore:function(){mo(s,"style",l||""),ho(s,Yv),ho(s,Kv)}}),g=Ki(i),p=Ki(u),v=rh(r,g,p),h=(t=g,a=v,f=po(c=r,"style"),ig.register(c),Li(c,{position:"absolute",height:a+"px",width:"100%",top:t+"px"}),mo(c,Yv,t+"px"),mo(c,Jv,"true"),mo(c,Kv,"top"),{restore:function(){ig.deregister(c),mo(c,"style",f||""),ho(c,Yv),ho(c,Jv),ho(c,Kv)}}),b=(e=po(n=u,"style"),Li(n,{position:"absolute",bottom:"0px"}),mo(n,Yv,"0px"),mo(n,Kv,"bottom"),{restore:function(){mo(n,"style",e||""),ho(n,Yv),ho(n,Kv)}}),y=!0,x=function(){var n=d.innerHeight;return Ng(r,Qv)<n},w=function(){if(y){var n=Ki(i),e=Ki(u),t=rh(r,n,e);mo(r,Yv,n+"px"),zi(r,"height",t+"px"),zi(u,"bottom",-(n+t+e)+"px"),qv(o,r,u)}};return qv(o,r,u),{setViewportOffset:function(n){mo(r,Yv,n+"px"),w()},isExpanding:x,isShrinking:S(x),refresh:w,restore:function(){y=!1,m.restore(),h.restore(),b.restore()}}},uh=Zv,ah=Uv(),ch="data-"+Ii.resolve("last-scroll-top"),fh=function(n){var e=Gi(n,"top").getOr("0");return parseInt(e,10)},sh=function(n){return parseInt(n.dom().scrollTop,10)},lh=function(n,e){var t=e+uh(n)+"px";zi(n,"top",t)},dh=function(t,r,o){return Lv.nu(function(n){var e=l(sh,t);ah.animate(e,r,15,function(n){t.dom().scrollTop=n,zi(t,"top",fh(t)+15+"px")},function(){t.dom().scrollTop=r,zi(t,"top",o+"px"),n(r)},10)})},mh=function(o,i){return Lv.nu(function(n){var e=l(sh,o);mo(o,ch,e());var t=Math.abs(i-e()),r=Math.ceil(t/10);ah.animate(e,i,r,function(n,e){Ng(o,ch)!==o.dom().scrollTop?e(o.dom().scrollTop):(o.dom().scrollTop=n,mo(o,ch,n))},function(){o.dom().scrollTop=i,mo(o,ch,i),n(i)},10)})},gh=function(i,u){return Lv.nu(function(n){var e=l(fh,i),t=function(n){zi(i,"top",n+"px")},r=Math.abs(u-e()),o=Math.ceil(r/10);ah.animate(e,u,o,t,function(){t(u),n(u)},10)})},ph=function(e,t,r){var o=ze(e).dom().defaultView;return Lv.nu(function(n){lh(e,r),lh(t,r),o.scrollTo(0,r),n(r)})},vh=function(n,e,t,r,o){var i=_v(e,t),u=l(Rv,n);i<r||i<o?mh(e,e.dom().scrollTop-i+o).get(u):r<0&&mh(e,e.dom().scrollTop+r).get(u)},hh=function(u,n){return n(function(r){var o=[],i=0;0===u.length?r([]):On(u,function(n,e){var t;n.get((t=e,function(n){o[t]=n,++i>=u.length&&r(o)}))})})},bh=function(n,c){return n.fold(function(n,e,t){return zi(n,e,c+(r=t)+"px"),Lv.pure(r);var r},function(n,e){return o=c+(r=e),i=Gi(t=n,"top").getOr(r),u=o-parseInt(i,10),a=t.dom().scrollTop+u,dh(t,a,o);var t,r,o,i,u,a})},yh=function(n,e){var t=oh(n),r=Sn(t,function(n){return bh(n,e)});return hh(r,Lv.nu)},xh=function(e,t,n,r,o,i){var u=function f(t){var r=Ao(jv.pure({}));return{start:function(e){var n=jv.nu(function(n){return t(e).get(n)});r.set(n)},idle:function(n){r.get().get(function(){n()})}}}(function(n){return ph(e,t,n)}),a=Ip(function(){u.idle(function(){yh(n,r.pageYOffset).get(function(){var n;(n=ap(i),k.from(n[0]).bind(function(n){var e=n.top()-t.dom().scrollTop;return e>r.innerHeight+5||e<-5?k.some({top:h(e),bottom:h(e+n.height())}):k.none()})).each(function(n){t.dom().scrollTop=t.dom().scrollTop+n.top()}),u.start(0),o.refresh()})})},1e3),c=kg(ge.fromDom(r),"scroll",function(){r.pageYOffset<0||a.throttle()});return yh(n,r.pageYOffset).get(b),{unbind:c.unbind}},wh=function(n){var t=n.cWin(),e=n.ceBody(),r=n.socket(),o=n.toolstrip(),i=n.toolbar(),u=n.contentElement(),a=n.keyboardType(),c=n.outerWindow(),f=n.dropup(),s=ih(r,e,o,f),l=a(n.outerBody(),t,Oe(),u,o,i),d=Mg(c,{onChange:x,onReady:s.refresh});d.onAdjustment(function(){s.refresh()});var m=kg(ge.fromDom(c),"resize",function(){s.isExpanding()&&s.refresh()}),g=xh(o,r,n.outerBody(),c,s,t),p=function h(t,e){var n=t.document,r=ge.fromTag("div");So(r,Ii.resolve("unfocused-selections")),_e(ge.fromDom(n.documentElement),r);var o=kg(r,"touchstart",function(n){n.prevent(),Fv(t,e),u()}),i=function(n){var e=ge.fromTag("span");return lm(e,[Ii.resolve("layer-editor"),Ii.resolve("unfocused-selection")]),Li(e,{left:n.left()+"px",top:n.top()+"px",width:n.width()+"px",height:n.height()+"px"}),e},u=function(){Xe(r)};return{update:function(){u();var n=ap(t),e=Sn(n,i);qe(r,e)},isActive:function(){return 0<Pe(r).length},destroy:function(){o.unbind(),Ye(r)},clear:u}}(t,u),v=function(){p.clear()};return{toEditing:function(){l.toEditing(),v()},toReading:function(){l.toReading()},onToolbarTouch:function(n){l.onToolbarTouch(n)},refreshSelection:function(){p.isActive()&&p.update()},clearSelection:v,highlightSelection:function(){p.update()},scrollIntoView:function(n,e){vh(t,r,f,n,e)},updateToolbarPadding:x,setViewportOffset:function(n){s.setViewportOffset(n),gh(r,n).get(b)},syncHeight:function(){zi(u,"height",u.dom().contentWindow.document.body.scrollHeight+"px")},refreshStructure:s.refresh,destroy:function(){s.restore(),d.destroy(),g.unbind(),m.unbind(),l.destroy(),p.destroy(),Bv(Oe(),Bo)}}},Sh=function(r,n){var o=Mp(),i=$d(),u=$d(),a=Gd(),c=Gd();return{enter:function(){n.hide();var t=ge.fromDom(document);Sp.getActiveApi(r.editor).each(function(n){i.set({socketHeight:Gi(r.socket,"height"),iframeHeight:Gi(n.frame(),"height"),outerScroll:document.body.scrollTop}),u.set({exclusives:Gp.exclusive(t,"."+ig.scrollable())}),So(r.container,Ii.resolve("fullscreen-maximized")),Cp(r.container,n.body()),o.maximize(),zi(r.socket,"overflow","scroll"),zi(r.socket,"-webkit-overflow-scrolling","touch"),Io(n.body());var e=De(["cWin","ceBody","socket","toolstrip","toolbar","dropup","contentElement","cursor","keyboardType","isScrolling","outerWindow","outerBody"],[]);a.set(wh(e({cWin:n.win(),ceBody:n.body(),socket:r.socket,toolstrip:r.toolstrip,toolbar:r.toolbar,dropup:r.dropup.element(),contentElement:n.frame(),cursor:x,outerBody:r.body,outerWindow:r.win,keyboardType:Vv.stubborn,isScrolling:function(){return u.get().exists(function(n){return n.socket.isScrolling()})}}))),a.run(function(n){n.syncHeight()}),c.set(Nv(n,a,r.toolstrip,r.socket,r.dropup))})},refreshStructure:function(){a.run(function(n){n.refreshStructure()})},exit:function(){o.restore(),c.clear(),a.clear(),n.show(),i.on(function(n){n.socketHeight.each(function(n){zi(r.socket,"height",n)}),n.iframeHeight.each(function(n){zi(r.editor.getFrame(),"height",n)}),document.body.scrollTop=n.scrollTop}),i.clear(),u.on(function(n){n.exclusives.unbind()}),u.clear(),To(r.container,Ii.resolve("fullscreen-maximized")),Dp(),ig.deregister(r.toolbar),$i(r.socket,"overflow"),$i(r.socket,"-webkit-overflow-scrolling"),Bo(r.editor.getFrame()),Sp.getActiveApi(r.editor).each(function(n){n.clearSelection()})}}},Oh=function(n){var e=gr("Getting IosWebapp schema",Rp,n);zi(e.toolstrip,"width","100%"),zi(e.container,"position","relative");var t=Sm(Bp(function(){e.setReadOnly(e.readOnlyOnInit()),r.enter()},e.translate));e.alloy.add(t);var r=Sh(e,{show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}});return{setReadOnly:e.setReadOnly,refreshStructure:r.refreshStructure,enter:r.enter,exit:r.exit,destroy:x}},Th=tinymce.util.Tools.resolve("tinymce.EditorManager"),kh=function(n){var e=St(n.settings,"skin_url").fold(function(){return Th.baseURL+"/skins/ui/oxide"},function(n){return n});return{content:e+"/content.mobile.min.css",ui:e+"/skin.mobile.min.css"}},Eh=function(n,e,t){n.system().broadcastOn([jo.formatChanged()],{command:e,state:t})},Ch=function(r,n){var e=E(n.formatter.get());On(e,function(e){n.formatter.formatChanged(e,function(n){Eh(r,e,n)})}),On(["ul","ol"],function(t){n.selection.selectorChanged(t,function(n,e){Eh(r,t,n)})})},Dh=(h(["x-small","small","medium","large","x-large"]),function(n){var e=function(){n._skinLoaded=!0,n.fire("SkinLoaded")};return function(){n.initialized?e():n.on("init",e)}}),Mh=h("toReading"),Ah=h("toEditing"),Ih=function(p){return{getNotificationManagerImpl:function(){return{open:h({progressBar:{value:x},close:x}),close:x,reposition:x,getArgs:b}},renderUI:function(){var n=p.getElement(),e=kh(p);0==(!1===p.settings.skin)?(p.contentCSS.push(e.content),Vo.DOM.styleSheetLoader.load(e.ui,Dh(p))):Dh(p)();var t,r,o=function(){p.fire("scrollIntoView")},i=ge.fromTag("div"),f=qn.detect().os.isAndroid()?function m(n){var e=Iv({classes:[Ii.resolve("android-container")]}),t=$p(),r=Gd(),o=Xp(r),i=Yp(),u=mv(x,n);return e.add(t.wrapper()),e.add(i),e.add(u.component()),{system:h(e),element:e.element,init:function(n){r.set(Fp(n))},exit:function(){r.run(function(n){n.exit(),Gm.remove(i,o)})},setToolbarGroups:function(n){var e=t.createGroups(n);t.setGroups(e)},setContextToolbar:function(n){var e=t.createGroups(n);t.setContextToolbar(e)},focusToolbar:function(){t.focus()},restoreToolbar:function(){t.restoreToolbar()},updateMode:function(n){Kp(i,o,n,e.root())},socket:h(i),dropup:h(u)}}(o):function g(n){var e=Iv({classes:[Ii.resolve("ios-container")]}),t=$p(),r=Gd(),o=Xp(r),i=Yp(),u=mv(function(){r.run(function(n){n.refreshStructure()})},n);return e.add(t.wrapper()),e.add(i),e.add(u.component()),{system:h(e),element:e.element,init:function(n){r.set(Oh(n))},exit:function(){r.run(function(n){Gm.remove(i,o),n.exit()})},setToolbarGroups:function(n){var e=t.createGroups(n);t.setGroups(e)},setContextToolbar:function(n){var e=t.createGroups(n);t.setContextToolbar(e)},focusToolbar:function(){t.focus()},restoreToolbar:function(){t.restoreToolbar()},updateMode:function(n){Kp(i,o,n,e.root())},socket:h(i),dropup:h(u)}}(o),u=ge.fromDom(n);$e(u,i),t=i,r=f.system(),tt(t,r,_e);var a=n.ownerDocument.defaultView,s=Mg(a,{onChange:function(){f.system().broadcastOn([jo.orientationChanged()],{width:Ag(a)})},onReady:x}),l=function(n,e,t,r){!1===r&&p.selection.collapse();var o=c(n,e,t);f.setToolbarGroups(!0===r?o.readOnly:o.main),p.setMode(!0===r?"readonly":"design"),p.fire(!0===r?Mh():Ah()),f.updateMode(r)},c=function(n,e,t){var r=n.get();return{readOnly:r.backToMask.concat(e.get()),main:r.backToMask.concat(t.get())}},d=function(n,e){return p.on(n,e),{unbind:function(){p.off(n)}}};return p.on("init",function(){f.init({editor:{getFrame:function(){return ge.fromDom(p.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:x}},onToReading:function(n){return d(Mh(),n)},onToEditing:function(n){return d(Ah(),n)},onScrollToCursor:function(e){return p.on("scrollIntoView",function(n){e(n)}),{unbind:function(){p.off("scrollIntoView"),s.destroy()}}},onTouchToolstrip:function(){t()},onTouchContent:function(){var n,e=ge.fromDom(p.editorContainer.querySelector("."+Ii.resolve("toolbar")));(n=e,Fo(n).bind(function(n){return f.system().getByDom(n).toOption()})).each(se),f.restoreToolbar(),t()},onTapContent:function(n){var e=n.target();"img"===be(e)?(p.selection.select(e.dom()),n.kill()):"a"===be(e)&&f.system().getByDom(ge.fromDom(p.editorContainer)).each(function(n){Mo.isAlpha(n)&&Ho(e.dom())})}},container:ge.fromDom(p.editorContainer),socket:ge.fromDom(p.contentAreaContainer),toolstrip:ge.fromDom(p.editorContainer.querySelector("."+Ii.resolve("toolstrip"))),toolbar:ge.fromDom(p.editorContainer.querySelector("."+Ii.resolve("toolbar"))),dropup:f.dropup(),alloy:f.system(),translate:x,setReadOnly:function(n){l(c,a,u,n)},readOnlyOnInit:function(){return!1}});var t=function(){f.dropup().disappear(function(){f.system().broadcastOn([jo.dropupDismissed()],{})})},n={label:"The first group",scrollable:!1,items:[Sf.forToolbar("back",function(){p.selection.collapse(),f.exit()},{})]},e={label:"Back to read only",scrollable:!1,items:[Sf.forToolbar("readonly-back",function(){l(c,a,u,!0)},{})]},r=yg(f,p),o=xg(p.settings,r),i={label:"The extra group",scrollable:!1,items:[]},u=Ao([{label:"the action group",scrollable:!0,items:o},i]),a=Ao([{label:"The read only mode group",scrollable:!0,items:[]},i]),c=Ao({backToMask:[n],backToReadOnly:[e]});Ch(f,p)}),{iframeContainer:f.socket().element().dom(),editorContainer:f.element().dom()}}}};No.add("mobile",Ih),n.renderMobileTheme=Ih,n["default"]=function $h(){}}({});!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},x=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}},C=function(e){return function(){return e}},o=function(e){return e};function b(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var t,n,r,i,u,m=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}},a=function(e){return e()},c=C(!1),l=C(!0),f=c,s=l,d=function(){return g},g=(i={fold:function(e,t){return e()},is:f,isSome:f,isNone:s,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:n,map:d,ap:d,each:function(){},bind:d,flatten:d,exists:f,forall:s,filter:d,equals:t=function(e){return e.isNone()},equals_:t,toArray:function(){return[]},toString:C("none()")},Object.freeze&&Object.freeze(i),i),p=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:s,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return p(e(n))},ap:function(e){return e.fold(d,function(e){return p(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:g},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(f,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},S={some:p,none:d,from:function(e){return null===e||e===undefined?g:p(e)}},h=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},v=h("string"),w=h("array"),R=h("boolean"),T=h("function"),D=h("number"),O=(u=Array.prototype.indexOf)===undefined?function(e,t){return _(e,t)}:function(e,t){return u.call(e,t)},A=function(e,t){return-1<O(e,t)},E=function(e,t){return W(e,t).isSome()},N=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},k=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},I=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},P=function(e,t,n){return function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){n=t(n,e)}),n},B=function(e,t,n){return k(e,function(e){n=t(n,e)}),n},M=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return S.some(o)}return S.none()},W=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return S.some(n);return S.none()},_=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},L=Array.prototype.push,j=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);L.apply(t,e[n])}return t},z=function(e,t){var n=N(e,t);return j(n)},H=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},F=Array.prototype.slice,U=function(e){var t=F.call(e,0);return t.reverse(),t},q=(T(Array.from)&&Array.from,Object.keys),V=Object.hasOwnProperty,G=function(e,t){for(var n=q(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},Y=function(e,r){return K(e,function(e,t,n){return{k:t,v:r(e,t,n)}})},K=function(r,o){var i={};return G(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},X=function(e,t){return $(e,t)?S.some(e[t]):S.none()},$=function(e,t){return V.call(e,t)},J=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return k(t,function(e,t){r[e]=C(n[t])}),r}},Q=function(e){return e.slice(0).sort()},Z=function(e,t){throw new Error("All required keys ("+Q(e).join(", ")+") were not specified. Specified keys were: "+Q(t).join(", ")+".")},ee=function(e){throw new Error("Unsupported keys for object: "+Q(e).join(", "))},te=function(t,e){if(!w(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");k(e,function(e){if(!v(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})},ne=function(e){var n=Q(e);M(n,function(e,t){return t<n.length-1&&e===n[t+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})},re=function(o,i){var u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return te("required",o),te("optional",i),ne(u),function(t){var n=q(t);H(o,function(e){return A(n,e)})||Z(o,n);var e=I(n,function(e){return!A(u,e)});0<e.length&&ee(e);var r={};return k(o,function(e){r[e]=C(t[e])}),k(i,function(e){r[e]=C(Object.prototype.hasOwnProperty.call(t,e)?S.some(t[e]):S.none())}),r}},oe=J("width","height"),ie=J("rows","columns"),ue=J("row","column"),ce=J("x","y"),ae=J("element","rowspan","colspan"),le=J("element","rowspan","colspan","isNew"),fe={dimensions:oe,grid:ie,address:ue,coords:ce,extended:J("element","rowspan","colspan","row","column"),detail:ae,detailnew:le,rowdata:J("element","cells","section"),elementnew:J("element","isNew"),rowdatanew:J("element","cells","section","isNew"),rowcells:J("cells","section"),rowdetails:J("details","section"),bounds:J("startRow","startCol","finishRow","finishCol")},se=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:C(e)}},de={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return se(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return se(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return se(n)},fromDom:se,fromPoint:function(e,t,n){var r=e.dom();return S.from(r.elementFromPoint(t,n)).map(se)}},me=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE),ge=Node.DOCUMENT_NODE,pe=(Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),he=Node.TEXT_NODE,ve=(Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,pe),be=ge,we=function(e,t){var n=e.dom();if(n.nodeType!==ve)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},ye=function(e){return e.nodeType!==ve&&e.nodeType!==be||0===e.childElementCount},xe="undefined"!=typeof window?window:Function("return this;")(),Ce=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:xe,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},Se=function(e,t){var n=Ce(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n},Re=function(){return Se("Node")},Te=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},De=function(e,t){return Te(e,t,Re().DOCUMENT_POSITION_CONTAINED_BY)},Oe=function(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}},Ae=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Ne(r(1),r(2))},Ee=function(){return Ne(0,0)},Ne=function(e,t){return{major:e,minor:t}},ke={nu:Ne,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Ee():Ae(e,n)},unknown:Ee},Ie="Firefox",Pe=function(e,t){return function(){return t===e}},Be=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Pe("Edge",t),isChrome:Pe("Chrome",t),isIE:Pe("IE",t),isOpera:Pe("Opera",t),isFirefox:Pe(Ie,t),isSafari:Pe("Safari",t)}},Me={unknown:function(){return Be({current:undefined,version:ke.unknown()})},nu:Be,edge:C("Edge"),chrome:C("Chrome"),ie:C("IE"),opera:C("Opera"),firefox:C(Ie),safari:C("Safari")},We="Windows",_e="Android",Le="Solaris",je="FreeBSD",ze=function(e,t){return function(){return t===e}},He=function(e){var t=e.current;return{current:t,version:e.version,isWindows:ze(We,t),isiOS:ze("iOS",t),isAndroid:ze(_e,t),isOSX:ze("OSX",t),isLinux:ze("Linux",t),isSolaris:ze(Le,t),isFreeBSD:ze(je,t)}},Fe={unknown:function(){return He({current:undefined,version:ke.unknown()})},nu:He,windows:C(We),ios:C("iOS"),android:C(_e),linux:C("Linux"),osx:C("OSX"),solaris:C(Le),freebsd:C(je)},Ue=function(e,t){var n=String(t).toLowerCase();return M(e,function(e){return e.search(n)})},qe=function(e,n){return Ue(e,n).map(function(e){var t=ke.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Ve=function(e,n){return Ue(e,n).map(function(e){var t=ke.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Ge=function(e,t,n){return""===t||!(e.length<t.length)&&e.substr(n,n+t.length)===t},Ye=function(e,t){return-1!==e.indexOf(t)},Ke=function(e,t){return Ge(e,t,0)},Xe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$e=function(t){return function(e){return Ye(e,t)}},Je=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Ye(e,"edge/")&&Ye(e,"chrome")&&Ye(e,"safari")&&Ye(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Xe],search:function(e){return Ye(e,"chrome")&&!Ye(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Ye(e,"msie")||Ye(e,"trident")}},{name:"Opera",versionRegexes:[Xe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$e("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$e("firefox")},{name:"Safari",versionRegexes:[Xe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Ye(e,"safari")||Ye(e,"mobile/"))&&Ye(e,"applewebkit")}}],Qe=[{name:"Windows",search:$e("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Ye(e,"iphone")||Ye(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$e("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$e("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$e("linux"),versionRegexes:[]},{name:"Solaris",search:$e("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$e("freebsd"),versionRegexes:[]}],Ze={browsers:C(Je),oses:C(Qe)},et=function(e){var t,n,r,o,i,u,c,a,l,f,s,d=Ze.browsers(),m=Ze.oses(),g=qe(d,e).fold(Me.unknown,Me.nu),p=Ve(m,e).fold(Fe.unknown,Fe.nu);return{browser:g,os:p,deviceType:(n=g,r=e,o=(t=p).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,u=t.isAndroid()&&3===t.version.major,c=t.isAndroid()&&4===t.version.major,a=o||u||c&&!0===/mobile/i.test(r),l=t.isiOS()||t.isAndroid(),f=l&&!a,s=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:C(o),isiPhone:C(i),isTablet:C(a),isPhone:C(f),isTouch:C(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:C(s)})}},tt={detect:Oe(function(){var e=navigator.userAgent;return et(e)})},nt=function(e,t){return e.dom()===t.dom()},rt=tt.detect().browser.isIE()?function(e,t){return De(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},ot=we,it=function(e){return de.fromDom(e.dom().ownerDocument)},ut=function(e){var t=e.dom();return S.from(t.parentNode).map(de.fromDom)},ct=function(e,t){for(var n=T(t)?t:C(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=de.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},at=function(e){var t=e.dom();return S.from(t.previousSibling).map(de.fromDom)},lt=function(e){var t=e.dom();return S.from(t.nextSibling).map(de.fromDom)},ft=function(e){var t=e.dom();return N(t.childNodes,de.fromDom)},st=function(e,t){var n=e.dom().childNodes;return S.from(n[t]).map(de.fromDom)},dt=(J("element","offset"),function(e,t,n){return z(ft(e),function(e){return we(e,t)?n(e)?[e]:[]:dt(e,t,n)})}),mt={firstLayer:function(e,t){return dt(e,t,C(!0))},filterFirstLayer:dt},gt=function(e){return e.dom().nodeName.toLowerCase()},pt=function(e){return e.dom().nodeType},ht=function(t){return function(e){return pt(e)===t}},vt=function(e){return pt(e)===me||"#comment"===gt(e)},bt=ht(pe),wt=ht(he),yt=ht(ge),xt=function(e,t,n){if(!(v(n)||R(n)||D(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},Ct=function(e,t,n){xt(e.dom(),t,n)},St=function(e,t){var n=e.dom();G(t,function(e,t){xt(n,t,e)})},Rt=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},Tt=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},Dt=function(e,t){e.dom().removeAttribute(t)},Ot=function(e){return B(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},At=function(e){var t=wt(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)},Et=Oe(function(){return Nt(de.fromDom(document))}),Nt=function(e){var t=e.dom().body;if(null===t||t===undefined)throw new Error("Body is not available yet");return de.fromDom(t)},kt=function(e,t){var n=[];return k(ft(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(kt(e,t))}),n},It=function(e,t,n){return r=function(e){return we(e,t)},I(ct(e,n),r);var r},Pt=function(e,t){return n=function(e){return we(e,t)},I(ft(e),n);var n},Bt=function(e,t){return n=t,o=(r=e)===undefined?document:r.dom(),ye(o)?[]:N(o.querySelectorAll(n),de.fromDom);var n,r,o};function Mt(e,t,n,r,o){return e(n,r)?S.some(n):T(o)&&o(n)?S.none():t(n,r,o)}var Wt=function(e,t,n){for(var r=e.dom(),o=T(n)?n:C(!1);r.parentNode;){r=r.parentNode;var i=de.fromDom(r);if(t(i))return S.some(i);if(o(i))break}return S.none()},_t=function(e,t,n){return Wt(e,function(e){return we(e,t)},n)},Lt=function(e,t){return n=function(e){return we(e,t)},M(e.dom().childNodes,x(n,de.fromDom)).map(de.fromDom);var n},jt=function(e,t){return n=t,o=(r=e)===undefined?document:r.dom(),ye(o)?S.none():S.from(o.querySelector(n)).map(de.fromDom);var n,r,o},zt=function(e,t,n){return Mt(we,_t,e,t,n)},Ht=function(e,t,n){var r=n!==undefined?n:C(!1);return r(t)?S.none():A(e,gt(t))?S.some(t):_t(t,e.join(","),function(e){return we(e,"table")||r(e)})},Ft=function(t,e){return ut(e).map(function(e){return Pt(e,t)})},Ut=b(Ft,"th,td"),qt=b(Ft,"tr"),Vt=function(e,t){return parseInt(Rt(e,t),10)},Gt={cell:function(e,t){return Ht(["td","th"],e,t)},firstCell:function(e){return jt(e,"th,td")},cells:function(e){return mt.firstLayer(e,"th,td")},neighbourCells:Ut,table:function(e,t){return zt(e,"table",t)},row:function(e,t){return Ht(["tr"],e,t)},rows:function(e){return mt.firstLayer(e,"tr")},notCell:function(e,t){return Ht(["caption","tr","tbody","tfoot","thead"],e,t)},neighbourRows:qt,attr:Vt,grid:function(e,t,n){var r=Vt(e,t),o=Vt(e,n);return fe.grid(r,o)}},Yt=function(e){var t=Gt.rows(e);return N(t,function(e){var t=e,n=ut(t).map(function(e){var t=gt(e);return"tfoot"===t||"thead"===t||"tbody"===t?t:"tbody"}).getOr("tbody"),r=N(Gt.cells(e),function(e){var t=Tt(e,"rowspan")?parseInt(Rt(e,"rowspan"),10):1,n=Tt(e,"colspan")?parseInt(Rt(e,"colspan"),10):1;return fe.detail(e,t,n)});return fe.rowdata(t,r,n)})},Kt=function(e,n){return N(e,function(e){var t=N(Gt.cells(e),function(e){var t=Tt(e,"rowspan")?parseInt(Rt(e,"rowspan"),10):1,n=Tt(e,"colspan")?parseInt(Rt(e,"colspan"),10):1;return fe.detail(e,t,n)});return fe.rowdata(e,t,n.section())})},Xt=function(e,t){return e+","+t},$t=function(e,t){var n=z(e.all(),function(e){return e.cells()});return I(n,t)},Jt={generate:function(e){var f={},t=[],n=e.length,s=0;k(e,function(e,a){var l=[];k(e.cells(),function(e,t){for(var n=0;f[Xt(a,n)]!==undefined;)n++;for(var r=fe.extended(e.element(),e.rowspan(),e.colspan(),a,n),o=0;o<e.colspan();o++)for(var i=0;i<e.rowspan();i++){var u=n+o,c=Xt(a+i,u);f[c]=r,s=Math.max(s,u+1)}l.push(r)}),t.push(fe.rowdata(e.element(),l,e.section()))});var r=fe.grid(n,s);return{grid:C(r),access:C(f),all:C(t)}},getAt:function(e,t,n){var r=e.access()[Xt(t,n)];return r!==undefined?S.some(r):S.none()},findItem:function(e,t,n){var r=$t(e,function(e){return n(t,e.element())});return 0<r.length?S.some(r[0]):S.none()},filterItems:$t,justCells:function(e){var t=N(e.all(),function(e){return e.cells()});return j(t)}},Qt=function(e){return e.style!==undefined},Zt=function(e,t,n){if(!v(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Qt(e)&&e.style.setProperty(t,n)},en=function(e,t,n){var r=e.dom();Zt(r,t,n)},tn=function(e,t){var n=e.dom();G(t,function(e,t){Zt(n,t,e)})},nn=function(e,t){var n=e.dom(),r=window.getComputedStyle(n).getPropertyValue(t),o=""!==r||At(e)?r:rn(n,t);return null===o?undefined:o},rn=function(e,t){return Qt(e)?e.style.getPropertyValue(t):""},on=function(e,t){var n=e.dom(),r=rn(n,t);return S.from(r).filter(function(e){return 0<e.length})},un=function(e,t){var n,r,o=e.dom();r=t,Qt(n=o)&&n.style.removeProperty(r),Tt(e,"style")&&""===Rt(e,"style").replace(/^\s+|\s+$/g,"")&&Dt(e,"style")},cn=function(t,n){ut(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},an=function(e,t){lt(e).fold(function(){ut(e).each(function(e){fn(e,t)})},function(e){cn(e,t)})},ln=function(t,n){st(t,0).fold(function(){fn(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},fn=function(e,t){e.dom().appendChild(t.dom())},sn=function(e,t){cn(e,t),fn(t,e)},dn=function(r,o){k(o,function(e,t){var n=0===t?r:o[t-1];an(n,e)})},mn=function(t,e){k(e,function(e){fn(t,e)})},gn=function(e){e.dom().textContent="",k(ft(e),function(e){pn(e)})},pn=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},hn=function(e){var t,n=ft(e);0<n.length&&(t=e,k(n,function(e){cn(t,e)})),pn(e)},vn=J("minRow","minCol","maxRow","maxCol"),bn=function(e,t){var n,i,r,u,c,a,l,o,f,s,d=function(e){return we(e.element(),t)},m=Yt(e),g=Jt.generate(m),p=(i=d,r=(n=g).grid().columns(),u=n.grid().rows(),c=r,l=a=0,G(n.access(),function(e){if(i(e)){var t=e.row(),n=t+e.rowspan()-1,r=e.column(),o=r+e.colspan()-1;t<u?u=t:a<n&&(a=n),r<c?c=r:l<o&&(l=o)}}),vn(u,c,a,l)),h="th:not("+t+"),td:not("+t+")",v=mt.filterFirstLayer(e,"th,td",function(e){return we(e,h)});return k(v,pn),function(e,t,n,r){for(var o,i,u,c=t.grid().columns(),a=t.grid().rows(),l=0;l<a;l++)for(var f=!1,s=0;s<c;s++)l<n.minRow()||l>n.maxRow()||s<n.minCol()||s>n.maxCol()||(Jt.getAt(t,l,s).filter(r).isNone()?(o=f,i=e[l].element(),u=de.fromTag("td"),fn(u,de.fromTag("br")),(o?fn:ln)(i,u)):f=!0)}(m,g,p,d),o=e,f=p,s=I(mt.firstLayer(o,"tr"),function(e){return 0===e.dom().childElementCount}),k(s,pn),f.minCol()!==f.maxCol()&&f.minRow()!==f.maxRow()||k(mt.firstLayer(o,"th,td"),function(e){Dt(e,"rowspan"),Dt(e,"colspan")}),Dt(o,"width"),Dt(o,"height"),un(o,"width"),un(o,"height"),e},wn=function(e,t){return de.fromDom(e.dom().cloneNode(t))},yn=function(e){return wn(e,!1)},xn=function(e){return wn(e,!0)},Cn=function(e,t){var n,r,o,i,u=(n=e,r=t,o=de.fromTag(r),i=Ot(n),St(o,i),o),c=ft(xn(e));return mn(u,c),u},Sn=function ls(n,r){var o=function(e){return n(e)?S.from(e.dom().nodeValue):S.none()},e=tt.detect().browser,t=e.isIE()&&10===e.version.major?function(e){try{return o(e)}catch(t){return S.none()}}:o;return{get:function(e){if(!n(e))throw new Error("Can only get "+r+" value of a "+r+" node");return t(e).getOr("")},getOption:t,set:function(e,t){if(!n(e))throw new Error("Can only set raw "+r+" value of a "+r+" node");e.dom().nodeValue=t}}}(wt,"text"),Rn=function(e){return Sn.get(e)},Tn=function(e){return Sn.getOption(e)},Dn=function(e,t){Sn.set(e,t)},On=function(e){return"img"===gt(e)?1:Tn(e).fold(function(){return ft(e).length},function(e){return e.length})},An=["img","br"],En=function(e){return Tn(e).filter(function(e){return 0!==e.trim().length||-1<e.indexOf("\xa0")}).isSome()||A(An,gt(e))},Nn=function(e){return r=En,(o=function(e){for(var t=0;t<e.childNodes.length;t++){if(r(de.fromDom(e.childNodes[t])))return S.some(de.fromDom(e.childNodes[t]));var n=o(e.childNodes[t]);if(n.isSome())return n}return S.none()})(e.dom());var r,o},kn=function(e){return In(e,En)},In=function(e,i){var u=function(e){for(var t=ft(e),n=t.length-1;0<=n;n--){var r=t[n];if(i(r))return S.some(r);var o=u(r);if(o.isSome())return o}return S.none()};return u(e)},Pn=function(){var e=de.fromTag("td");return fn(e,de.fromTag("br")),e},Bn=function(e,t,n){var r=Cn(e,t);return G(n,function(e,t){null===e?Dt(r,t):Ct(r,t,e)}),r},Mn=function(e){return e},Wn=function(e){return function(){return de.fromTag("tr",e.dom())}},_n=function(d,e,m){return{row:Wn(e),cell:function(e){var r,o,i,t,n,u,c,a=it(e.element()),l=de.fromTag(gt(e.element()),a.dom()),f=m.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),s=0<f.length?(r=e.element(),o=l,i=f,Nn(r).map(function(e){var t=i.join(","),n=It(e,t,function(e){return nt(e,r)});return P(n,function(e,t){var n=yn(t);return Dt(n,"contenteditable"),fn(e,n),n},o)}).getOr(o)):l;return fn(s,de.fromTag("br")),t=e.element(),n=l,u=t.dom(),c=n.dom(),Qt(u)&&Qt(c)&&(c.style.cssText=u.style.cssText),un(l,"height"),1!==e.colspan()&&un(e.element(),"width"),d(e.element(),l),l},replace:Bn,gap:Pn}},Ln=function(e){return{row:Wn(e),cell:Pn,replace:Mn,gap:Pn}},jn=["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 zn(){return{up:C({selector:_t,closest:zt,predicate:Wt,all:ct}),down:C({selector:Bt,predicate:kt}),styles:C({get:nn,getRaw:on,set:en,remove:un}),attrs:C({get:Rt,set:Ct,remove:Dt,copyTo:function(e,t){var n=Ot(e);St(t,n)}}),insert:C({before:cn,after:an,afterAll:dn,append:fn,appendAll:mn,prepend:ln,wrap:sn}),remove:C({unwrap:hn,remove:pn}),create:C({nu:de.fromTag,clone:function(e){return de.fromDom(e.dom().cloneNode(!1))},text:de.fromText}),query:C({comparePosition:function(e,t){return e.dom().compareDocumentPosition(t.dom())},prevSibling:at,nextSibling:lt}),property:C({children:ft,name:gt,parent:ut,isText:wt,isComment:vt,isElement:bt,getText:Rn,setText:Dn,isBoundary:function(e){return!!bt(e)&&("body"===gt(e)||A(jn,gt(e)))},isEmptyTag:function(e){return!!bt(e)&&A(["br","img","hr","input"],gt(e))}}),eq:nt,is:ot}}var Hn=J("left","right"),Fn=function(e,t,n){var r=e.property().children(t);return W(r,b(e.eq,n)).map(function(e){return{before:C(r.slice(0,e)),after:C(r.slice(e+1))}})},Un=function(n,r,o){return Fn(n,r,o).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.before().concat([o])),n.insert().appendAll(r,e.after()),n.insert().before(r,t),Hn(t,r)})},qn=function(n,r,e){return Fn(n,r,e).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.after()),n.insert().after(r,t),Hn(r,t)})},Vn=function(i,e,u,c){var r=J("first","second","splits"),a=function(e,t,o){var n=r(e,S.none(),o);return u(e)?r(e,t,o):i.property().parent(e).bind(function(r){return c(i,r,e).map(function(e){var t=[{first:e.left,second:e.right}],n=u(r)?r:e.left();return a(n,S.some(e.right()),o.concat(t))}).getOr(n)})};return a(e,S.none(),[])},Gn=function(r,o,e,t){var n=o(r,e);return P(t,function(e,t){var n=o(r,t);return Yn(r,e,n)},n)},Yn=function(t,e,n){return e.bind(function(e){return n.filter(b(t.eq,e))})},Kn=function(e,t,n){return 0<n.length?Gn(e,t,(r=n)[0],r.slice(1)):S.none();var r},Xn=function(e,t){return b(e.eq,t)},$n=function(t,e,n,r){var o=r!==undefined?r:C(!1),i=[e].concat(t.up().all(e)),u=[n].concat(t.up().all(n)),c=function(t){return W(t,o).fold(function(){return t},function(e){return t.slice(0,e+1)})},a=c(i),l=c(u),f=M(a,function(e){return E(l,Xn(t,e))});return{firstpath:C(a),secondpath:C(l),shared:C(f)}},Jn=function(t,e,n){var r=$n(t,e,n);return r.shared().bind(function(e){return function(o,i,e,t){var u=o.property().children(i);if(o.eq(i,e[0]))return S.some([e[0]]);if(o.eq(i,t[0]))return S.some([t[0]]);var n=function(e){var t=U(e),n=W(t,Xn(o,i)).getOr(-1),r=n<t.length-1?t[n+1]:t[n];return W(u,Xn(o,r))},r=n(e),c=n(t);return r.bind(function(r){return c.map(function(e){var t=Math.min(r,e),n=Math.max(r,e);return u.slice(t,n+1)})})}(t,e,r.firstpath(),r.secondpath())})},Qn=$n,Zn=function(e,t,n){return Kn(e,t,n)},er=function(e,t,n){return Jn(e,t,n)},tr=function(e,t,n,r){return Qn(e,t,n,r)},nr=function(e,t,n){return Un(e,t,n)},rr=function(e,t,n){return qn(e,t,n)},or=function(e,t,n,r){return Vn(e,t,n,r)},ir=zn(),ur={sharedOne:function(n,e){return Zn(ir,function(e,t){return n(t)},e)},subset:function(e,t){return er(ir,e,t)},ancestors:function(e,t,n){return tr(ir,e,t,n)},breakToLeft:function(e,t){return nr(ir,e,t)},breakToRight:function(e,t){return rr(ir,e,t)},breakPath:function(e,t,r){return or(ir,e,t,function(e,t,n){return r(t,n)})}},cr=function(e,t){return t.column()>=e.startCol()&&t.column()+t.colspan()-1<=e.finishCol()&&t.row()>=e.startRow()&&t.row()+t.rowspan()-1<=e.finishRow()},ar=function(e,t){var n=t.column(),r=t.column()+t.colspan()-1,o=t.row(),i=t.row()+t.rowspan()-1;return n<=e.finishCol()&&r>=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},lr=function(e,t){for(var n=!0,r=b(cr,t),o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)n=n&&Jt.getAt(e,o,i).exists(r);return n?S.some(t):S.none()},fr=function(e,t,n){var r=Jt.findItem(e,t,nt),o=Jt.findItem(e,n,nt);return r.bind(function(r){return o.map(function(e){return t=r,n=e,fe.bounds(Math.min(t.row(),n.row()),Math.min(t.column(),n.column()),Math.max(t.row()+t.rowspan()-1,n.row()+n.rowspan()-1),Math.max(t.column()+t.colspan()-1,n.column()+n.colspan()-1));var t,n})})},sr=fr,dr=function(t,e,n){return fr(t,e,n).bind(function(e){return lr(t,e)})},mr=function(r,e,o,i){return Jt.findItem(r,e,nt).bind(function(e){var t=0<o?e.row()+e.rowspan()-1:e.row(),n=0<i?e.column()+e.colspan()-1:e.column();return Jt.getAt(r,t+o,n+i).map(function(e){return e.element()})})},gr=function(n,e,t){return sr(n,e,t).map(function(e){var t=Jt.filterItems(n,b(ar,e));return N(t,function(e){return e.element()})})},pr=function(e,t){return Jt.findItem(e,t,function(e,t){return rt(t,e)}).bind(function(e){return e.element()})},hr=function(e){var t=Yt(e);return Jt.generate(t)},vr=function(n,r,o){return Gt.table(n).bind(function(e){var t=hr(e);return mr(t,n,r,o)})},br=function(e,t,n){var r=hr(e);return gr(r,t,n)},wr=function(e,t,n,r,o){var i=hr(e),u=nt(e,n)?t:pr(i,t),c=nt(e,o)?r:pr(i,r);return gr(i,u,c)},yr=function(e,t,n){var r=hr(e);return dr(r,t,n)},xr=function(e,t){return _t(e,"table")},Cr=re(["boxes","start","finish"],[]),Sr=function(c,a,r){var l=function(t){return function(e){return r(e)||nt(e,t)}};return nt(c,a)?S.some(Cr({boxes:S.some([c]),start:c,finish:a})):xr(c).bind(function(u){return xr(a).bind(function(i){if(nt(u,i))return S.some(Cr({boxes:br(u,c,a),start:c,finish:a}));if(rt(u,i)){var e=0<(t=It(a,"td,th",l(u))).length?t[t.length-1]:a;return S.some(Cr({boxes:wr(u,c,u,a,i),start:c,finish:e}))}if(rt(i,u)){var t,n=0<(t=It(c,"td,th",l(i))).length?t[t.length-1]:c;return S.some(Cr({boxes:wr(i,c,u,a,i),start:c,finish:n}))}return ur.ancestors(c,a).shared().bind(function(e){return zt(e,"table",r).bind(function(e){var t=It(a,"td,th",l(e)),n=0<t.length?t[t.length-1]:a,r=It(c,"td,th",l(e)),o=0<r.length?r[r.length-1]:c;return S.some(Cr({boxes:wr(e,c,u,a,i),start:o,finish:n}))})})})})},Rr=Sr,Tr=function(e,t){var n=Bt(e,t);return 0<n.length?S.some(n):S.none()},Dr=function(e,t,n,r,o){return(i=e,u=o,M(i,function(e){return we(e,u)})).bind(function(e){return vr(e,t,n).bind(function(e){return n=r,_t(t=e,"table").bind(function(e){return jt(e,n).bind(function(e){return Sr(e,t).bind(function(t){return t.boxes().map(function(e){return{boxes:C(e),start:C(t.start()),finish:C(t.finish())}})})})});var t,n})});var i,u},Or=function(e,t,r){return jt(e,t).bind(function(n){return jt(e,r).bind(function(t){return ur.sharedOne(xr,[n,t]).map(function(e){return{first:C(n),last:C(t),table:C(e)}})})})},Ar=function(e,t){return Tr(e,t)},Er=function(o,e,t){return Or(o,e,t).bind(function(n){var e=function(e){return nt(o,e)},t=_t(n.first(),"thead,tfoot,tbody,table",e),r=_t(n.last(),"thead,tfoot,tbody,table",e);return t.bind(function(t){return r.bind(function(e){return nt(t,e)?yr(n.table(),n.first(),n.last()):S.none()})})})},Nr="data-mce-selected",kr="data-mce-first-selected",Ir="data-mce-last-selected",Pr={selected:C(Nr),selectedSelector:C("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:C("[data-mce-selected]"),firstSelected:C(kr),firstSelectedSelector:C("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:C(Ir),lastSelectedSelector:C("td[data-mce-last-selected],th[data-mce-last-selected]")},Br=function(u){if(!w(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var c=[],n={};return k(u,function(e,r){var t=q(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!w(i))throw new Error("case arguments must be an array");c.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=q(e);if(c.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+t.join(","));if(!H(c,function(e){return A(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+c.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:c,constructor:o,params:n})}}}}),n},Mr=Br([{none:[]},{multiple:["elements"]},{single:["selection"]}]),Wr={cata:function(e,t,n,r){return e.fold(t,n,r)},none:Mr.none,multiple:Mr.multiple,single:Mr.single},_r=function(e,t){return Wr.cata(t.get(),C([]),o,C([e]))},Lr=function(n,e){return Wr.cata(e.get(),S.none,function(t,e){return 0===t.length?S.none():Er(n,Pr.firstSelectedSelector(),Pr.lastSelectedSelector()).bind(function(e){return 1<t.length?S.some({bounds:C(e),cells:C(t)}):S.none()})},S.none)},jr=function(e,t){var n=_r(e,t);return 0<n.length&&H(n,function(e){return Tt(e,"rowspan")&&1<parseInt(Rt(e,"rowspan"),10)||Tt(e,"colspan")&&1<parseInt(Rt(e,"colspan"),10)})?S.some(n):S.none()},zr=_r,Hr=function(e){return{element:C(e),mergable:S.none,unmergable:S.none,selection:C([e])}},Fr=J("element","clipboard","generators"),Ur={noMenu:Hr,forMenu:function(e,t,n){return{element:C(n),mergable:C(Lr(t,e)),unmergable:C(jr(n,e)),selection:C(zr(n,e))}},notCell:function(e){return Hr(e)},paste:Fr,pasteRows:function(e,t,n,r,o){return{element:C(n),mergable:S.none,unmergable:S.none,selection:C(zr(n,e)),clipboard:C(r),generators:C(o)}}},qr=function(f,e,s,d){f.on("BeforeGetContent",function(n){!0===n.selection&&Wr.cata(e.get(),y,function(e){var t;n.preventDefault(),(t=e,Gt.table(t[0]).map(xn).map(function(e){return[bn(e,Pr.attributeSelector())]})).each(function(e){var t;n.content="text"===n.format?N(e,function(e){return e.dom().innerText}).join(""):(t=f,N(e,function(e){return t.selection.serializer.serialize(e.dom(),{})}).join(""))})},y)}),f.on("BeforeSetContent",function(l){!0===l.selection&&!0===l.paste&&S.from(f.dom.getParent(f.selection.getStart(),"th,td")).each(function(e){var a=de.fromDom(e);Gt.table(a).bind(function(t){var e,n,r,o=I((e=l.content,(r=(n||document).createElement("div")).innerHTML=e,ft(de.fromDom(r))),function(e){return"meta"!==gt(e)});if(1===o.length&&"table"===gt(o[0])){l.preventDefault();var i=de.fromDom(f.getDoc()),u=Ln(i),c=Ur.paste(a,o[0],u);s.pasteCells(t,c).each(function(e){f.selection.setRng(e),f.focus(),d.clear(t)})}})})})};function Vr(r,o){var e=function(e){var t=o(e);if(t<=0||null===t){var n=nn(e,r);return parseFloat(n)||0}return t},i=function(o,e){return B(e,function(e,t){var n=nn(o,t),r=n===undefined?0:parseInt(n,10);return isNaN(r)?e:e+r},0)};return{set:function(e,t){if(!D(t)&&!t.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+t);var n=e.dom();Qt(n)&&(n.style[r]=t+"px")},get:e,getOuter:e,aggregate:i,max:function(e,t,n){var r=i(e,n);return r<t?t-r:0}}}var Gr=Vr("height",function(e){var t=e.dom();return At(e)?t.getBoundingClientRect().height:t.offsetHeight}),Yr=function(e){return Gr.get(e)},Kr=function(e){return Gr.getOuter(e)},Xr=Vr("width",function(e){return e.dom().offsetWidth}),$r=function(e){return Xr.get(e)},Jr=function(e){return Xr.getOuter(e)},Qr=tt.detect(),Zr=function(e,t,n){return r=nn(e,t),o=n,i=parseFloat(r),isNaN(i)?o:i;var r,o,i},eo=function(e){return Qr.browser.isIE()||Qr.browser.isEdge()?(n=Zr(t=e,"padding-top",0),r=Zr(t,"padding-bottom",0),o=Zr(t,"border-top-width",0),i=Zr(t,"border-bottom-width",0),u=t.dom().getBoundingClientRect().height,"border-box"===nn(t,"box-sizing")?u:u-n-r-(o+i)):Zr(e,"height",Yr(e));var t,n,r,o,i,u},to=/(\d+(\.\d+)?)(\w|%)*/,no=/(\d+(\.\d+)?)%/,ro=/(\d+(\.\d+)?)px|em/,oo=function(e,t){en(e,"height",t+"px")},io=function(e,t,n,r){var o,i,u,c,a,l,f,s=parseInt(e,10);return Ge(l=e,f="%",l.length-f.length)&&"table"!==gt(t)?(o=t,i=s,u=n,c=r,a=Gt.table(o).map(function(e){var t=u(e);return Math.floor(i/100*t)}).getOr(i),c(o,a),a):s},uo=function(e){var t,n=on(t=e,"height").getOrThunk(function(){return eo(t)+"px"});return n?io(n,e,Yr,oo):Yr(e)},co=function(e,t){return Tt(e,t)?parseInt(Rt(e,t),10):1},ao=function(e){return on(e,"width").fold(function(){return S.from(Rt(e,"width"))},function(e){return S.some(e)})},lo=function(e,t){return e/t.pixelWidth()*100},fo={percentageBasedSizeRegex:C(no),pixelBasedSizeRegex:C(ro),setPixelWidth:function(e,t){en(e,"width",t+"px")},setPercentageWidth:function(e,t){en(e,"width",t+"%")},setHeight:oo,getPixelWidth:function(t,n){return ao(t).fold(function(){return $r(t)},function(e){return function(e,t,n){if(ro.test(t)){var r=ro.exec(t);return parseInt(r[1],10)}if(no.test(t)){var o=no.exec(t),i=parseFloat(o[1]);return i/100*n.pixelWidth()}return $r(e)}(t,e,n)})},getPercentageWidth:function(t,n){return ao(t).fold(function(){var e=$r(t);return lo(e,n)},function(e){return function(e,t,n){if(no.test(t)){var r=no.exec(t);return parseFloat(r[1])}var o=$r(e);return lo(o,n)}(t,e,n)})},getGenericWidth:function(e){return ao(e).bind(function(e){if(to.test(e)){var t=to.exec(e);return S.some({width:C(t[1]),unit:C(t[3])})}return S.none()})},setGenericWidth:function(e,t,n){en(e,"width",t+n)},getHeight:function(e){return n="rowspan",uo(t=e)/co(t,n);var t,n},getRawWidth:ao},so=function(n,r){fo.getGenericWidth(n).each(function(e){var t=e.width()/2;fo.setGenericWidth(n,t,e.unit()),fo.setGenericWidth(r,t,e.unit())})},mo=function(n,r){return{left:C(n),top:C(r),translate:function(e,t){return mo(n+e,r+t)}}},go=mo,po=function(e,t){return e!==undefined?e:t!==undefined?t:0},ho=function(e){var t,n,r=e.dom().ownerDocument,o=r.body,i=(t=de.fromDom(r),(n=t.dom())===n.window&&t instanceof Window?t:yt(t)?n.defaultView||n.parentWindow:null),u=r.documentElement,c=po(i.pageYOffset,u.scrollTop),a=po(i.pageXOffset,u.scrollLeft),l=po(u.clientTop,o.clientTop),f=po(u.clientLeft,o.clientLeft);return vo(e).translate(a-f,c-l)},vo=function(e){var t,n,r,o=e.dom(),i=o.ownerDocument,u=i.body,c=de.fromDom(i.documentElement);return u===o?go(u.offsetLeft,u.offsetTop):(t=e,n=c||de.fromDom(document.documentElement),Wt(t,b(nt,n)).isSome()?(r=o.getBoundingClientRect(),go(r.left,r.top)):go(0,0))},bo=J("row","y"),wo=J("col","x"),yo=function(e){return ho(e).left()+Jr(e)},xo=function(e){return ho(e).left()},Co=function(e,t){return wo(e,xo(t))},So=function(e,t){return wo(e,yo(t))},Ro=function(e){return ho(e).top()},To=function(n,t,r){if(0===r.length)return[];var e=N(r.slice(1),function(e,t){return e.map(function(e){return n(t,e)})}),o=r[r.length-1].map(function(e){return t(r.length-1,e)});return e.concat([o])},Do={delta:o,positions:b(To,function(e,t){return bo(e,Ro(t))},function(e,t){return bo(e,Ro(t)+Kr(t))}),edge:Ro},Oo={delta:o,edge:xo,positions:b(To,Co,So)},Ao={height:Do,rtl:{delta:function(e,t){return-e},edge:yo,positions:b(To,So,Co)},ltr:Oo},Eo={ltr:Ao.ltr,rtl:Ao.rtl};function No(t){var n=function(e){return t(e).isRtl()?Eo.rtl:Eo.ltr};return{delta:function(e,t){return n(t).delta(e,t)},edge:function(e){return n(e).edge(e)},positions:function(e,t){return n(t).positions(e,t)}}}var ko,Io=function(e){var t=Yt(e);return Jt.generate(t).grid()},Po=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Po(n())}}},Bo=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return te("required",o),ne(o),function(t){var n=q(t);H(o,function(e){return A(n,e)})||Z(o,n),r(o,n);var e=I(o,function(e){return!i.validate(t[e],e)});return 0<e.length&&function(e,t){throw new Error("All values need to be of type: "+t+". Keys ("+Q(e).join(", ")+") were not.")}(e,i.label),t}},Mo=function(t,e){var n=I(e,function(e){return!A(t,e)});0<n.length&&ee(n)},Wo=function(e){return Bo(Mo,e,{validate:T,label:"function"})},_o=function(e){var t=Tt(e,"colspan")?parseInt(Rt(e,"colspan"),10):1,n=Tt(e,"rowspan")?parseInt(Rt(e,"rowspan"),10):1;return{element:C(e),colspan:C(t),rowspan:C(n)}},Lo=Wo(["cell","row","replace","gap"]),jo=function(r,e){Lo(r);var n=Po(S.none()),o=e!==undefined?e:_o,i=function(e){var t,n=o(e);return t=n,r.cell(t)},u=function(e){var t=i(e);return n.get().isNone()&&n.set(S.some(t)),c=S.some({item:e,replacement:t}),t},c=S.none();return{getOrInit:function(t,n){return c.fold(function(){return u(t)},function(e){return n(t,e.item)?e.replacement:u(t)})},cursor:n.get}},zo=function(o,c){return function(n){var r=Po(S.none());Lo(n);var i=[],u=function(e){var t=n.replace(e,c,{scope:o});return i.push({item:e,sub:t}),r.get().isNone()&&r.set(S.some(t)),t};return{replaceOrInit:function(t,n){return(r=t,o=n,M(i,function(e){return o(e.item,r)})).fold(function(){return u(t)},function(e){return n(t,e.item)?e.sub:u(t)});var r,o},cursor:r.get}}},Ho=function(n){Lo(n);var e=Po(S.none());return{combine:function(t){return e.get().isNone()&&e.set(S.some(t)),function(){var e=n.cell({element:C(t),colspan:C(1),rowspan:C(1)});return un(e,"width"),un(t,"width"),e}},cursor:e.get}},Fo=["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"],Uo=function(e,t){var n=e.property().name(t);return A(Fo,n)},qo=function(e,t){return A(["br","img","hr","input"],e.property().name(t))},Vo=Uo,Go=function(e,t){var n=e.property().name(t);return A(["ol","ul"],n)},Yo=qo,Ko=zn(),Xo=function(e){return Vo(Ko,e)},$o=function(e){return Go(Ko,e)},Jo=function(e){return Yo(Ko,e)},Qo=function(e){var t,i=function(e){return"br"===gt(e)},n=function(o){return kn(o).bind(function(n){var r=lt(n).map(function(e){return!!Xo(e)||(Jo(e)?"img"!==gt(e):void 0)}).getOr(!1);return ut(n).map(function(e){return!0===r||"li"===gt(t=e)||Wt(t,$o).isSome()||i(n)||Xo(e)&&!nt(o,e)?[]:[de.fromTag("br")];var t})}).getOr([])},r=0===(t=z(e,function(e){var t=ft(e);return H(t,function(e){return i(e)||wt(e)&&0===Rn(e).trim().length})?[]:t.concat(n(e))})).length?[de.fromTag("br")]:t;gn(e[0]),mn(e[0],r)},Zo=Object.prototype.hasOwnProperty,ei=(ko=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Zo.call(o,i)&&(n[i]=ko(n[i],o[i]))}return n}),ti=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},ni=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return S.none()},ri=function(e,t){return fe.rowcells(t,e.section())},oi=function(e,t){return e.cells()[t]},ii={addCell:function(e,t,n){var r=e.cells(),o=r.slice(0,t),i=r.slice(t),u=o.concat([n]).concat(i);return ri(e,u)},setCells:ri,mutateCell:function(e,t,n){e.cells()[t]=n},getCell:oi,getCellElement:function(e,t){return oi(e,t).element()},mapCells:function(e,t){var n=e.cells(),r=N(n,t);return fe.rowcells(r,e.section())},cellLength:function(e){return e.cells().length}},ui=function(e,t){if(0===e.length)return 0;var n=e[0];return W(e,function(e){return!t(n.element(),e.element())}).fold(function(){return e.length},function(e){return e})},ci=function(e,t,n,r){var o,i,u,c,a=(o=e,i=t,o[i]).cells().slice(n),l=ui(a,r),f=(u=e,c=n,N(u,function(e){return ii.getCell(e,c)})).slice(t),s=ui(f,r);return{colspan:C(l),rowspan:C(s)}},ai=function(o,i){var u=N(o,function(e,t){return N(e.cells(),function(e,t){return!1})});return N(o,function(e,r){var t=z(e.cells(),function(e,t){if(!1!==u[r][t])return[];var n=ci(o,r,t,i);return function(e,t,n,r){for(var o=e;o<e+n;o++)for(var i=t;i<t+r;i++)u[o][i]=!0}(r,t,n.rowspan(),n.colspan()),[fe.detailnew(e.element(),n.rowspan(),n.colspan(),e.isNew())]});return fe.rowdetails(t,e.section())})},li=function(e,t,n){for(var r=[],o=0;o<e.grid().rows();o++){for(var i=[],u=0;u<e.grid().columns();u++){var c=Jt.getAt(e,o,u).map(function(e){return fe.elementnew(e.element(),n)}).getOrThunk(function(){return fe.elementnew(t.gap(),!0)});i.push(c)}var a=fe.rowcells(i,e.all()[o].section());r.push(a)}return r},fi=function(e,t,n,r){n===r?Dt(e,t):Ct(e,t,n)},si=function(o,e){var i=[],u=[],t=function(e,t){0<e.length?function(e,t){var n=Lt(o,t).getOrThunk(function(){var e=de.fromTag(t,it(o).dom());return fn(o,e),e});gn(n);var r=N(e,function(e){e.isNew()&&i.push(e.element());var t=e.element();return gn(t),k(e.cells(),function(e){e.isNew()&&u.push(e.element()),fi(e.element(),"colspan",e.colspan(),1),fi(e.element(),"rowspan",e.rowspan(),1),fn(t,e.element())}),t});mn(n,r)}(e,t):Lt(o,t).each(pn)},n=[],r=[],c=[];return k(e,function(e){switch(e.section()){case"thead":n.push(e);break;case"tbody":r.push(e);break;case"tfoot":c.push(e)}}),t(n,"thead"),t(r,"tbody"),t(c,"tfoot"),{newRows:C(i),newCells:C(u)}},di=function(e){return N(e,function(e){var n=yn(e.element());return k(e.cells(),function(e){var t=xn(e.element());fi(t,"colspan",e.colspan(),1),fi(t,"rowspan",e.rowspan(),1),fn(n,t)}),n})},mi=function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n},gi=function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n},pi=function(t,n){if(n<0||n>=t.length-1)return S.none();var e=t[n].fold(function(){var e=U(t.slice(0,n));return ni(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return S.some({value:e,delta:0})}),r=t[n+1].fold(function(){var e=t.slice(n+1);return ni(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return S.some({value:e,delta:1})});return e.bind(function(n){return r.map(function(e){var t=e.delta+n.delta;return Math.abs(e.value-n.value)/t})})},hi=function(e,t,n){var r=e();return M(r,t).orThunk(function(){return S.from(r[0]).orThunk(n)}).map(function(e){return e.element()})},vi=function(n){var e=n.grid(),t=gi(0,e.columns()),r=gi(0,e.rows());return N(t,function(t){return hi(function(){return z(r,function(e){return Jt.getAt(n,e,t).filter(function(e){return e.column()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.colspan()},function(){return Jt.getAt(n,0,t)})})},bi=function(n){var e=n.grid(),t=gi(0,e.rows()),r=gi(0,e.columns());return N(t,function(t){return hi(function(){return z(r,function(e){return Jt.getAt(n,t,e).filter(function(e){return e.row()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.rowspan()},function(){return Jt.getAt(n,t,0)})})},wi=function(e,t,n,r,o){var i=de.fromTag("div");return tn(i,{position:"absolute",left:t-r/2+"px",top:n+"px",height:o+"px",width:r+"px"}),St(i,{"data-column":e,role:"presentation"}),i},yi=function(e,t,n,r,o){var i=de.fromTag("div");return tn(i,{position:"absolute",left:t+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),St(i,{"data-row":e,role:"presentation"}),i},xi=function(e){var t=e.replace(/\./g,"-");return{resolve:function(e){return t+"-"+e}}},Ci={resolve:xi("ephox-snooker").resolve},Si=function(e,t){var n=Rt(e,t);return n===undefined||""===n?[]:n.split(" ")},Ri=function(e){return e.dom().classList!==undefined},Ti=function(e,t){return o=t,i=Si(n=e,r="class").concat([o]),Ct(n,r,i.join(" ")),!0;var n,r,o,i},Di=function(e,t){return o=t,0<(i=I(Si(n=e,r="class"),function(e){return e!==o})).length?Ct(n,r,i.join(" ")):Dt(n,r),!1;var n,r,o,i},Oi=function(e,t){Ri(e)?e.dom().classList.add(t):Ti(e,t)},Ai=function(e){0===(Ri(e)?e.dom().classList:Si(e,"class")).length&&Dt(e,"class")},Ei=function(e,t){return Ri(e)&&e.dom().classList.contains(t)},Ni=Ci.resolve("resizer-bar"),ki=Ci.resolve("resizer-rows"),Ii=Ci.resolve("resizer-cols"),Pi=function(e){var t=Bt(e.parent(),"."+Ni);k(t,pn)},Bi=function(n,e,r){var o=n.origin();k(e,function(e,t){e.each(function(e){var t=r(o,e);Oi(t,Ni),fn(n.parent(),t)})})},Mi=function(e,t,n,r,o,i){var u,c,a,l,f=ho(t),s=0<n.length?o.positions(n,t):[];u=e,c=s,a=f,l=Jr(t),Bi(u,c,function(e,t){var n=yi(t.row(),a.left()-e.left(),t.y()-e.top(),l,7);return Oi(n,ki),n});var d,m,g,p,h=0<r.length?i.positions(r,t):[];d=e,m=h,g=f,p=Kr(t),Bi(d,m,function(e,t){var n=wi(t.col(),t.x()-e.left(),g.top()-e.top(),7,p);return Oi(n,Ii),n})},Wi=function(e,t){var n=Bt(e.parent(),"."+Ni);k(n,t)},_i={refresh:function(e,t,n,r){Pi(e);var o=Yt(t),i=Jt.generate(o),u=bi(i),c=vi(i);Mi(e,t,u,c,n,r)},hide:function(e){Wi(e,function(e){en(e,"display","none")})},show:function(e){Wi(e,function(e){en(e,"display","block")})},destroy:Pi,isRowBar:function(e){return Ei(e,ki)},isColBar:function(e){return Ei(e,Ii)}},Li=function(e,r){return N(e,function(e){var t,n=(t=e.details(),ni(t,function(e){return ut(e.element()).map(function(e){var t=ut(e).isNone();return fe.elementnew(e,t)})}).getOrThunk(function(){return fe.elementnew(r.row(),!0)}));return fe.rowdatanew(n.element(),e.details(),e.section(),n.isNew())})},ji=function(e,t){var n=ai(e,nt);return Li(n,t)},zi=function(e,t){var n=j(N(e.all(),function(e){return e.cells()}));return M(n,function(e){return nt(t,e.element())})},Hi=function(c,a,l,f,s){return function(n,r,e,o,i){var t=Yt(r),u=Jt.generate(t);return a(u,e).map(function(e){var t=li(u,o,!1),n=c(t,e,nt,s(o)),r=ji(n.grid(),o);return{grid:C(r),cursor:n.cursor}}).fold(function(){return S.none()},function(e){var t=si(r,e.grid());return l(r,e.grid(),i),f(r),_i.refresh(n,r,Ao.height,i),S.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})})}},Fi=ji,Ui=function(t,e){return Gt.cell(e.element()).bind(function(e){return zi(t,e)})},qi=function(t,e){var n=N(e.selection(),function(e){return Gt.cell(e).bind(function(e){return zi(t,e)})}),r=ti(n);return 0<r.length?S.some(r):S.none()},Vi=function(t,n){return Gt.cell(n.element()).bind(function(e){return zi(t,e).map(function(e){return ei(e,{generators:n.generators,clipboard:n.clipboard})})})},Gi=function(t,e){var n=N(e.selection(),function(e){return Gt.cell(e).bind(function(e){return zi(t,e)})}),r=ti(n);return 0<r.length?S.some(ei({cells:r},{generators:e.generators,clipboard:e.clipboard})):S.none()},Yi=function(e,t){return t.mergable()},Ki=function(e,t){return t.unmergable()},Xi=function(n){return{is:function(e){return n===e},isValue:l,isError:c,getOr:C(n),getOrThunk:C(n),getOrDie:C(n),or:function(e){return Xi(n)},orThunk:function(e){return Xi(n)},fold:function(e,t){return t(n)},map:function(e){return Xi(e(n))},mapError:function(e){return Xi(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return S.some(n)}}},$i=function(n){return{is:c,isValue:c,isError:l,getOr:o,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return $i(n)},mapError:function(e){return $i(e(n))},each:y,bind:function(e){return $i(n)},exists:c,forall:l,toOption:S.none}},Ji={value:Xi,error:$i},Qi=function(e,t){return N(e,function(){return fe.elementnew(t.cell(),!0)})},Zi=function(t,e,n){return t.concat(mi(e,function(e){return ii.setCells(t[t.length-1],Qi(t[t.length-1].cells(),n))}))},eu=function(e,t,n){return N(e,function(e){return ii.setCells(e,e.cells().concat(Qi(gi(0,t),n)))})},tu=function(e,t,n){if(e.row()>=t.length||e.column()>ii.cellLength(t[0]))return Ji.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=t.slice(e.row()),o=r[0].cells().slice(e.column()),i=ii.cellLength(n[0]),u=n.length;return Ji.value({rowDelta:C(r.length-u),colDelta:C(o.length-i)})},nu=function(e,t){var n=ii.cellLength(e[0]),r=ii.cellLength(t[0]);return{rowDelta:C(0),colDelta:C(n-r)}},ru=function(e,t,n){var r=t.colDelta()<0?eu:o;return(t.rowDelta()<0?Zi:o)(r(e,Math.abs(t.colDelta()),n),Math.abs(t.rowDelta()),n)},ou=function(e,t,n,r){if(0===e.length)return e;for(var o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)ii.mutateCell(e[o],i,fe.elementnew(r(),!1));return e},iu=function(e,t,n,r){for(var o=!0,i=0;i<e.length;i++)for(var u=0;u<ii.cellLength(e[0]);u++){var c=n(ii.getCellElement(e[i],u),t);!0===c&&!1===o?ii.mutateCell(e[i],u,fe.elementnew(r(),!0)):!0===c&&(o=!1)}return e},uu=function(i,u,c,a){if(0<u&&u<i.length){var e=i[u-1].cells(),t=(n=c,B(e,function(e,t){return E(e,function(e){return n(e.element(),t.element())})?e:e.concat([t])},[]));k(t,function(e){for(var t=S.none(),n=u;n<i.length;n++)for(var r=0;r<ii.cellLength(i[0]);r++){var o=i[n].cells()[r];c(o.element(),e.element())&&(t.isNone()&&(t=S.some(a())),t.each(function(e){ii.mutateCell(i[n],r,fe.elementnew(e,!0))}))}})}var n;return i},cu=function(n,r,o,i,u){return tu(n,r,o).map(function(e){var t=ru(r,e,i);return function(e,t,n,r,o){for(var i,u,c,a,l,f=e.row(),s=e.column(),d=f+n.length,m=s+ii.cellLength(n[0]),g=f;g<d;g++)for(var p=s;p<m;p++){i=t,u=g,c=p,a=void 0,a=b(o,ii.getCell(i[u],c).element()),l=i[u],1<i.length&&1<ii.cellLength(l)&&(0<c&&a(ii.getCellElement(l,c-1))||c<l.length-1&&a(ii.getCellElement(l,c+1))||0<u&&a(ii.getCellElement(i[u-1],c))||u<i.length-1&&a(ii.getCellElement(i[u+1],c)))&&iu(t,ii.getCellElement(t[g],p),o,r.cell);var h=ii.getCellElement(n[g-f],p-s),v=r.replace(h);ii.mutateCell(t[g],p,fe.elementnew(v,!0))}return t}(n,t,o,i,u)})},au=function(e,t,n,r,o){uu(t,e,o,r.cell);var i=nu(n,t),u=ru(n,i,r),c=nu(t,u),a=ru(t,c,r);return a.slice(0,e).concat(u).concat(a.slice(e,a.length))},lu=function(n,r,e,o,i){var t=n.slice(0,r),u=n.slice(r),c=ii.mapCells(n[e],function(e,t){return 0<r&&r<n.length&&o(ii.getCellElement(n[r-1],t),ii.getCellElement(n[r],t))?ii.getCell(n[r],t):fe.elementnew(i(e.element(),o),!0)});return t.concat([c]).concat(u)},fu=function(e,n,r,o,i){return N(e,function(e){var t=0<n&&n<ii.cellLength(e)&&o(ii.getCellElement(e,n-1),ii.getCellElement(e,n))?ii.getCell(e,n):fe.elementnew(i(ii.getCellElement(e,r),o),!0);return ii.addCell(e,n,t)})},su=function(e,r,o,i,u){var c=o+1;return N(e,function(e,t){var n=t===r?fe.elementnew(u(ii.getCellElement(e,o),i),!0):ii.getCell(e,o);return ii.addCell(e,c,n)})},du=function(e,t,n,r,o){var i=t+1,u=e.slice(0,i),c=e.slice(i),a=ii.mapCells(e[t],function(e,t){return t===n?fe.elementnew(o(e.element(),r),!0):e});return u.concat([a]).concat(c)},mu=function(e,t,n){return e.slice(0,t).concat(e.slice(n+1))},gu=function(e,n,r){var t=N(e,function(e){var t=e.cells().slice(0,n).concat(e.cells().slice(r+1));return fe.rowcells(t,e.section())});return I(t,function(e){return 0<e.cells().length})},pu=function(e,n,r,o){return N(e,function(e){return ii.mapCells(e,function(e){return t=e,E(n,function(e){return r(t.element(),e.element())})?fe.elementnew(o(e.element(),r),!0):e;var t})})},hu=function(e,t,n,r){return ii.getCellElement(e[t],n)!==undefined&&0<t&&r(ii.getCellElement(e[t-1],n),ii.getCellElement(e[t],n))},vu=function(e,t,n){return 0<t&&n(ii.getCellElement(e,t-1),ii.getCellElement(e,t))},bu=function(n,r,o,e){var t=z(n,function(e,t){return hu(n,t,r,o)||vu(e,r,o)?[]:[ii.getCell(e,r)]});return pu(n,t,o,e)},wu=function(n,r,o,e){var i=n[r],t=z(i.cells(),function(e,t){return hu(n,r,t,o)||vu(i,t,o)?[]:[e]});return pu(n,t,o,e)},yu=function(e){return{fold:e}},xu=function(){return yu(function(e,t,n,r,o){return e()})},Cu=function(i){return yu(function(e,t,n,r,o){return t(i)})},Su=function(i,u){return yu(function(e,t,n,r,o){return n(i,u)})},Ru=function(i,u,c){return yu(function(e,t,n,r,o){return r(i,u,c)})},Tu=function(i,u){return yu(function(e,t,n,r,o){return o(i,u)})},Du=function(e,t,i,u){var n,r,c=e.slice(0),o=(r=t,0===(n=e).length?xu():1===n.length?Cu(0):0===r?Su(0,1):r===n.length-1?Tu(r-1,r):0<r&&r<n.length-1?Ru(r-1,r,r+1):xu()),a=function(e){return N(e,C(0))},l=C(a(c)),f=function(e,t){if(0<=i){var n=Math.max(u.minCellWidth(),c[t]-i);return a(c.slice(0,e)).concat([i,n-c[t]]).concat(a(c.slice(t+1)))}var r=Math.max(u.minCellWidth(),c[e]+i),o=c[e]-r;return a(c.slice(0,e)).concat([r-c[e],o]).concat(a(c.slice(t+1)))},s=f;return o.fold(l,function(e){return u.singleColumnWidth(c[e],i)},s,function(e,t,n){return f(t,n)},function(e,t){if(0<=i)return a(c.slice(0,t)).concat([i]);var n=Math.max(u.minCellWidth(),c[t]+i);return a(c.slice(0,t)).concat([n-c[t]])})},Ou=function(e,t){return Tt(e,t)&&1<parseInt(Rt(e,t),10)},Au={hasColspan:function(e){return Ou(e,"colspan")},hasRowspan:function(e){return Ou(e,"rowspan")},minWidth:C(10),minHeight:C(10),getInt:function(e,t){return parseInt(nn(e,t),10)}},Eu=function(e,t,n){return on(e,t).fold(function(){return n(e)+"px"},function(e){return e})},Nu=function(e){return Eu(e,"width",fo.getPixelWidth)},ku=function(e){return Eu(e,"height",fo.getHeight)},Iu=function(e,t,n,r,o){var i=vi(e),u=N(i,function(e){return e.map(t.edge)});return N(i,function(e,t){return e.filter(m(Au.hasColspan)).fold(function(){var e=pi(u,t);return r(e)},function(e){return n(e,o)})})},Pu=function(e){return e.map(function(e){return e+"px"}).getOr("")},Bu=function(e,t,n,r){var o=bi(e),i=N(o,function(e){return e.map(t.edge)});return N(o,function(e,t){return e.filter(m(Au.hasRowspan)).fold(function(){var e=pi(i,t);return r(e)},function(e){return n(e)})})},Mu={getRawWidths:function(e,t){return Iu(e,t,Nu,Pu)},getPixelWidths:function(e,t,n){return Iu(e,t,fo.getPixelWidth,function(e){return e.getOrThunk(n.minCellWidth)},n)},getPercentageWidths:function(e,t,n){return Iu(e,t,fo.getPercentageWidth,function(e){return e.fold(function(){return n.minCellWidth()},function(e){return e/n.pixelWidth()*100})},n)},getPixelHeights:function(e,t){return Bu(e,t,fo.getHeight,function(e){return e.getOrThunk(Au.minHeight)})},getRawHeights:function(e,t){return Bu(e,t,ku,Pu)}},Wu=function(e,t,n){for(var r=0,o=e;o<t;o++)r+=n[o]!==undefined?n[o]:0;return r},_u=function(e,n){var t=Jt.justCells(e);return N(t,function(e){var t=Wu(e.column(),e.column()+e.colspan(),n);return{element:e.element,width:C(t),colspan:e.colspan}})},Lu=function(e,n){var t=Jt.justCells(e);return N(t,function(e){var t=Wu(e.row(),e.row()+e.rowspan(),n);return{element:e.element,height:C(t),rowspan:e.rowspan}})},ju=function(e,n){return N(e.all(),function(e,t){return{element:e.element,height:C(n[t])}})},zu=function(e){var t=parseInt(e,10),n=o;return{width:C(t),pixelWidth:C(t),getWidths:Mu.getPixelWidths,getCellDelta:n,singleColumnWidth:function(e,t){return[Math.max(Au.minWidth(),e+t)-e]},minCellWidth:Au.minWidth,setElementWidth:fo.setPixelWidth,setTableWidth:function(e,t,n){var r=P(t,function(e,t){return e+t},0);fo.setPixelWidth(e,r)}}},Hu=function(e,t){if(fo.percentageBasedSizeRegex().test(t)){var n=fo.percentageBasedSizeRegex().exec(t);return o=n[1],i=e,u=parseFloat(o),c=$r(i),{width:C(u),pixelWidth:C(c),getWidths:Mu.getPercentageWidths,getCellDelta:function(e){return e/c*100},singleColumnWidth:function(e,t){return[100-e]},minCellWidth:function(){return Au.minWidth()/c*100},setElementWidth:fo.setPercentageWidth,setTableWidth:function(e,t,n){var r=u+n;fo.setPercentageWidth(e,r)}}}if(fo.pixelBasedSizeRegex().test(t)){var r=fo.pixelBasedSizeRegex().exec(t);return zu(r[1])}var o,i,u,c,a=$r(e);return zu(a)},Fu=function(t){return fo.getRawWidth(t).fold(function(){var e=$r(t);return zu(e)},function(e){return Hu(t,e)})},Uu=function(e){return Jt.generate(e)},qu=function(e){var t=Yt(e);return Uu(t)},Vu=function(e,t,n,r){var o=Fu(e),i=o.getCellDelta(t),u=qu(e),c=o.getWidths(u,r,o),a=Du(c,n,i,o),l=N(a,function(e,t){return e+c[t]}),f=_u(u,l);k(f,function(e){o.setElementWidth(e.element(),e.width())}),n===u.grid().columns()-1&&o.setTableWidth(e,l,i)},Gu=function(e,n,r,t){var o=qu(e),i=Mu.getPixelHeights(o,t),u=N(i,function(e,t){return r===t?Math.max(n+e,Au.minHeight()):e}),c=Lu(o,u),a=ju(o,u);k(a,function(e){fo.setHeight(e.element(),e.height())}),k(c,function(e){fo.setHeight(e.element(),e.height())});var l=P(u,function(e,t){return e+t},0);fo.setHeight(e,l)},Yu=function(e,t,n){var r=Fu(e),o=Uu(t),i=r.getWidths(o,n,r),u=_u(o,i);k(u,function(e){r.setElementWidth(e.element(),e.width())});var c=P(i,function(e,t){return t+e},0);0<u.length&&r.setTableWidth(e,c)},Ku=function(e){0===Gt.cells(e).length&&pn(e)},Xu=J("grid","cursor"),$u=function(e,t,n){return Ju(e,t,n).orThunk(function(){return Ju(e,0,0)})},Ju=function(e,t,n){return S.from(e[t]).bind(function(e){return S.from(e.cells()[n]).bind(function(e){return S.from(e.element())})})},Qu=function(e,t,n){return Xu(e,Ju(e,t,n))},Zu=function(e){return B(e,function(e,t){return E(e,function(e){return e.row()===t.row()})?e:e.concat([t])},[]).sort(function(e,t){return e.row()-t.row()})},ec=function(e){return B(e,function(e,t){return E(e,function(e){return e.column()===t.column()})?e:e.concat([t])},[]).sort(function(e,t){return e.column()-t.column()})},tc=function(e,t,n){var r=Kt(e,n),o=Jt.generate(r);return li(o,t,!0)},nc=Yu,rc={insertRowBefore:Hi(function(e,t,n,r){var o=t.row(),i=t.row(),u=lu(e,i,o,n,r.getOrInit);return Qu(u,i,t.column())},Ui,y,y,jo),insertRowsBefore:Hi(function(e,t,n,r){var o=t[0].row(),i=t[0].row(),u=Zu(t),c=B(u,function(e,t){return lu(e,i,o,n,r.getOrInit)},e);return Qu(c,i,t[0].column())},qi,y,y,jo),insertRowAfter:Hi(function(e,t,n,r){var o=t.row(),i=t.row()+t.rowspan(),u=lu(e,i,o,n,r.getOrInit);return Qu(u,i,t.column())},Ui,y,y,jo),insertRowsAfter:Hi(function(e,t,n,r){var o=Zu(t),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),c=B(o,function(e,t){return lu(e,u,i,n,r.getOrInit)},e);return Qu(c,u,t[0].column())},qi,y,y,jo),insertColumnBefore:Hi(function(e,t,n,r){var o=t.column(),i=t.column(),u=fu(e,i,o,n,r.getOrInit);return Qu(u,t.row(),i)},Ui,nc,y,jo),insertColumnsBefore:Hi(function(e,t,n,r){var o=ec(t),i=o[0].column(),u=o[0].column(),c=B(o,function(e,t){return fu(e,u,i,n,r.getOrInit)},e);return Qu(c,t[0].row(),u)},qi,nc,y,jo),insertColumnAfter:Hi(function(e,t,n,r){var o=t.column(),i=t.column()+t.colspan(),u=fu(e,i,o,n,r.getOrInit);return Qu(u,t.row(),i)},Ui,nc,y,jo),insertColumnsAfter:Hi(function(e,t,n,r){var o=t[t.length-1].column(),i=t[t.length-1].column()+t[t.length-1].colspan(),u=ec(t),c=B(u,function(e,t){return fu(e,i,o,n,r.getOrInit)},e);return Qu(c,t[0].row(),i)},qi,nc,y,jo),splitCellIntoColumns:Hi(function(e,t,n,r){var o=su(e,t.row(),t.column(),n,r.getOrInit);return Qu(o,t.row(),t.column())},Ui,nc,y,jo),splitCellIntoRows:Hi(function(e,t,n,r){var o=du(e,t.row(),t.column(),n,r.getOrInit);return Qu(o,t.row(),t.column())},Ui,y,y,jo),eraseColumns:Hi(function(e,t,n,r){var o=ec(t),i=gu(e,o[0].column(),o[o.length-1].column()),u=$u(i,t[0].row(),t[0].column());return Xu(i,u)},qi,nc,Ku,jo),eraseRows:Hi(function(e,t,n,r){var o=Zu(t),i=mu(e,o[0].row(),o[o.length-1].row()),u=$u(i,t[0].row(),t[0].column());return Xu(i,u)},qi,y,Ku,jo),makeColumnHeader:Hi(function(e,t,n,r){var o=bu(e,t.column(),n,r.replaceOrInit);return Qu(o,t.row(),t.column())},Ui,y,y,zo("row","th")),unmakeColumnHeader:Hi(function(e,t,n,r){var o=bu(e,t.column(),n,r.replaceOrInit);return Qu(o,t.row(),t.column())},Ui,y,y,zo(null,"td")),makeRowHeader:Hi(function(e,t,n,r){var o=wu(e,t.row(),n,r.replaceOrInit);return Qu(o,t.row(),t.column())},Ui,y,y,zo("col","th")),unmakeRowHeader:Hi(function(e,t,n,r){var o=wu(e,t.row(),n,r.replaceOrInit);return Qu(o,t.row(),t.column())},Ui,y,y,zo(null,"td")),mergeCells:Hi(function(e,t,n,r){var o=t.cells();Qo(o);var i=ou(e,t.bounds(),n,C(o[0]));return Xu(i,S.from(o[0]))},Yi,y,y,Ho),unmergeCells:Hi(function(e,t,n,r){var o=P(t,function(e,t){return iu(e,t,n,r.combine(t))},e);return Xu(o,S.from(t[0]))},Ki,nc,y,Ho),pasteCells:Hi(function(e,n,t,r){var o,i,u,c,a=(o=n.clipboard(),i=n.generators(),u=Yt(o),c=Jt.generate(u),li(c,i,!0)),l=fe.address(n.row(),n.column());return cu(l,e,a,n.generators(),t).fold(function(){return Xu(e,S.some(n.element()))},function(e){var t=$u(e,n.row(),n.column());return Xu(e,t)})},Vi,nc,y,jo),pasteRowsBefore:Hi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[0].row(),u=tc(t.clipboard(),t.generators(),o),c=au(i,e,u,t.generators(),n),a=$u(c,t.cells[0].row(),t.cells[0].column());return Xu(c,a)},Gi,y,y,jo),pasteRowsAfter:Hi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[t.cells.length-1].row()+t.cells[t.cells.length-1].rowspan(),u=tc(t.clipboard(),t.generators(),o),c=au(i,e,u,t.generators(),n),a=$u(c,t.cells[0].row(),t.cells[0].column());return Xu(c,a)},Gi,y,y,jo)},oc=function(e){return de.fromDom(e.getBody())},ic=function(e){return e.getBoundingClientRect().width},uc=function(e){return e.getBoundingClientRect().height},cc=function(t){return function(e){return nt(e,oc(t))}},ac=function(e){return/^[0-9]+$/.test(e)&&(e+="px"),e},lc=function(e){var t=Bt(e,"td[data-mce-style],th[data-mce-style]");Dt(e,"data-mce-style"),k(t,function(e){Dt(e,"data-mce-style")})},fc={isRtl:C(!1)},sc={isRtl:C(!0)},dc={directionAt:function(e){return"rtl"==("rtl"===nn(e,"direction")?"rtl":"ltr")?sc:fc}},mc={"border-collapse":"collapse",width:"100%"},gc={border:"1"},pc=function(e){return e.getParam("table_default_attributes",gc,"object")},hc=function(e){return e.getParam("table_default_styles",mc,"object")},vc=function(e){return e.getParam("table_cell_advtab",!0,"boolean")},bc=function(e){return e.getParam("table_row_advtab",!0,"boolean")},wc=function(e){return e.getParam("table_advtab",!0,"boolean")},yc=function(e){return e.getParam("table_style_by_css",!1,"boolean")},xc=function(e){return e.getParam("table_class_list",[],"array")},Cc=function(e){return!1===e.getParam("table_responsive_width")},Sc=function(e,t){return e.fire("newrow",{node:t})},Rc=function(e,t){return e.fire("newcell",{node:t})},Tc=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},Dc=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},Oc=function(f,e){var t,n=function(e){return"table"===gt(oc(e))},s=(t=f.getParam("table_clone_elements"),v(t)?S.some(t.split(/[ ,]/)):Array.isArray(t)?S.some(t):S.none()),r=function(u,c,a,l){return function(e,t){lc(e);var n=l(),r=de.fromDom(f.getDoc()),o=No(dc.directionAt),i=_n(a,r,s);return c(e)?u(n,e,t,i,o).bind(function(e){return k(e.newRows(),function(e){Sc(f,e.dom())}),k(e.newCells(),function(e){Rc(f,e.dom())}),e.cursor().map(function(e){var t=f.dom.createRng();return t.setStart(e.dom(),0),t.setEnd(e.dom(),0),t})}):S.none()}};return{deleteRow:r(rc.eraseRows,function(e){var t=Io(e);return!1===n(f)||1<t.rows()},y,e),deleteColumn:r(rc.eraseColumns,function(e){var t=Io(e);return!1===n(f)||1<t.columns()},y,e),insertRowsBefore:r(rc.insertRowsBefore,l,y,e),insertRowsAfter:r(rc.insertRowsAfter,l,y,e),insertColumnsBefore:r(rc.insertColumnsBefore,l,so,e),insertColumnsAfter:r(rc.insertColumnsAfter,l,so,e),mergeCells:r(rc.mergeCells,l,y,e),unmergeCells:r(rc.unmergeCells,l,y,e),pasteRowsBefore:r(rc.pasteRowsBefore,l,y,e),pasteRowsAfter:r(rc.pasteRowsAfter,l,y,e),pasteCells:r(rc.pasteCells,l,y,e)}},Ac=function(e,t,r){var n=Yt(e),o=Jt.generate(n);return qi(o,t).map(function(e){var t=li(o,r,!1).slice(e[0].row(),e[e.length-1].row()+e[e.length-1].rowspan()),n=Fi(t,r);return di(n)})},Ec=tinymce.util.Tools.resolve("tinymce.util.Tools"),Nc=function(e,t,n){n&&e.formatter.apply("align"+n,{},t)},kc=function(e,t,n){n&&e.formatter.apply("valign"+n,{},t)},Ic=function(t,n){Ec.each("left center right".split(" "),function(e){t.formatter.remove("align"+e,{},n)})},Pc=function(t,n){Ec.each("top middle bottom".split(" "),function(e){t.formatter.remove("valign"+e,{},n)})},Bc=function(o,e,i){var t;return t=function(e,t){for(var n=0;n<t.length;n++){var r=o.getStyle(t[n],i);if(void 0===e&&(e=r),e!==r)return""}return e}(t,o.select("td,th",e))},Mc=function(){return(Mc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Wc=function(t,e){var n=function(e){return Ke(e,"rgb")?t.toHex(e):e};return{borderstyle:on(de.fromDom(e),"border-style").getOr(""),bordercolor:on(de.fromDom(e),"border-color").map(n).getOr(""),backgroundcolor:on(de.fromDom(e),"background-color").map(n).getOr("")}},_c=function(e,t,n,r,o){var i={};return Ec.each(e.split(" "),function(e){r.formatter.matchNode(o,t+e)&&(i[n]=e)}),i[n]||(i[n]=""),i},Lc=b(_c,"left center right"),jc=b(_c,"top middle bottom"),zc=function(e,r,t){var o=function(e,n){return n=n||[],Ec.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=o(e.menu):(t.value=e.value,r&&r(t)),n.push(t)}),n};return o(e,t||[])},Hc=function(e){var i=e[0],t=e.slice(1),n=q(i);return k(t,function(e){k(n,function(o){G(e,function(e,t,n){var r=i[o];""!==r&&o===t&&r!==e&&(i[o]="")})})}),i},Fc=function(){return{title:"Advanced",items:[{name:"borderstyle",type:"selectbox",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"}]},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}]}},Uc=function(e,t,n){var r,o,i,u=e.dom;return Mc({width:u.getStyle(t,"width")||u.getAttrib(t,"width"),height:u.getStyle(t,"height")||u.getAttrib(t,"height"),cellspacing:u.getStyle(t,"border-spacing")||u.getAttrib(t,"cellspacing"),cellpadding:u.getAttrib(t,"cellpadding")||Bc(e.dom,t,"padding"),border:(r=u,o=t,i=on(de.fromDom(o),"border-width"),yc(e)&&i.isSome()?i.getOr(""):r.getAttrib(o,"border")||Bc(e.dom,o,"border-width")||Bc(e.dom,o,"border")),caption:!!u.select("caption",t)[0],"class":u.getAttrib(t,"class","")},Lc("align","align",e,t),n?Wc(u,t):{})},qc=function(e,t,n){var r=e.dom;return Mc({height:r.getStyle(t,"height")||r.getAttrib(t,"height"),scope:r.getAttrib(t,"scope"),"class":r.getAttrib(t,"class",""),align:"",type:t.parentNode.nodeName.toLowerCase()},Lc("align","align",e,t),n?Wc(r,t):{})},Vc=function(e,t,n){var r=e.dom;return Mc({width:r.getStyle(t,"width")||r.getAttrib(t,"width"),height:r.getStyle(t,"height")||r.getAttrib(t,"height"),scope:r.getAttrib(t,"scope"),celltype:t.nodeName.toLowerCase(),"class":r.getAttrib(t,"class","")},Lc("align","halign",e,t),jc("valign","valign",e,t),n?Wc(r,t):{})},Gc=function(e,t){var n,r,o,i,u,c,a,l,f=hc(e),s=pc(e),d=e.dom,m=t?(n=d,r=function(e){return Ke(e,"rgb")?n.toHex(e):e},o=X(f,"border-style").getOr(""),i=X(f,"border-color").getOr(""),u=X(f,"background-color").getOr(""),{borderstyle:o,bordercolor:r(i),backgroundcolor:r(u)}):{};return Mc({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,"class":"",align:"",border:""},f,s,m,(l=f["border-width"],yc(e)&&l?{border:l}:X(s,"border").fold(function(){return{}},function(e){return{border:e}})),(c=X(f,"border-spacing").or(X(s,"cellspacing")).fold(function(){return{}},function(e){return{cellspacing:e}}),a=X(f,"border-padding").or(X(s,"cellpadding")).fold(function(){return{}},function(e){return{cellpadding:e}}),Mc({},c,a)))},Yc=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"selectbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"selectbox",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:"selectbox",label:"H Align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"selectbox",label:"V Align",items:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}],Kc=function(e){return(t=e,n=t.getParam("table_cell_class_list",[],"array"),r=zc(n,function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[e.value]})})}),0<n.length?S.some({name:"class",type:"selectbox",label:"Class",items:r}):S.none()).fold(function(){return Yc},function(e){return Yc.concat(e)});var t,n,r},Xc={normal:function(n,r){return{setAttrib:function(e,t){n.setAttrib(r,e,t)},setStyle:function(e,t){n.setStyle(r,e,t)}}},ifTruthy:function(n,r){return{setAttrib:function(e,t){t&&n.setAttrib(r,e,t)},setStyle:function(e,t){t&&n.setStyle(r,e,t)}}}},$c=function(e,t){e.setAttrib("scope",t.scope),e.setAttrib("class",t["class"]),e.setStyle("width",ac(t.width)),e.setStyle("height",ac(t.height))},Jc=function(e,t){e.setStyle("background-color",t.backgroundcolor),e.setStyle("border-color",t.bordercolor),e.setStyle("border-style",t.borderstyle)},Qc=function(e,t,n){var r=e.dom,o=n.celltype&&t[0].nodeName.toLowerCase()!==n.celltype?r.rename(t[0],n.celltype):t[0],i=Xc.normal(r,o);$c(i,n),vc(e)&&Jc(i,n),Ic(e,o),Pc(e,o),n.halign&&Nc(e,o,n.halign),n.valign&&kc(e,o,n.valign)},Zc=function(n,e,r){var o=n.dom;Ec.each(e,function(e){r.celltype&&e.nodeName.toLowerCase()!==r.celltype&&(e=o.rename(e,r.celltype));var t=Xc.ifTruthy(o,e);$c(t,r),vc(n)&&Jc(t,r),r.halign&&Nc(n,e,r.halign),r.valign&&kc(n,e,r.valign)})},ea=function(e,t,n){var r=n.getData();n.close(),e.undoManager.transact(function(){(1===t.length?Qc:Zc)(e,t,r),e.focus()})},ta=function(t){var e,n=[];if(n=t.dom.select("td[data-mce-selected],th[data-mce-selected]"),e=t.dom.getParent(t.selection.getStart(),"td,th"),!n.length&&e&&n.push(e),e=e||n[0]){var r=Ec.map(n,function(e){return Vc(t,e,vc(t))}),o=Hc(r),i={type:"tabpanel",tabs:[{title:"General",items:Kc(t)},Fc()]},u={type:"panel",items:[{type:"grid",columns:2,items:Kc(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:vc(t)?i:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:b(ea,t,n)})}},na=[{type:"selectbox",name:"type",label:"Row type",items:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"selectbox",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"}],ra=function(e){return(t=e,n=t.getParam("table_row_class_list",[],"array"),r=zc(n,function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[e.value]})})}),0<n.length?S.some({name:"class",type:"selectbox",label:"Class",items:r}):S.none()).fold(function(){return na},function(e){return na.concat(e)});var t,n,r},oa=function(f,e,s,t){var d=f.dom,m=t.getData();t.close();var g=1===e.length?Xc.normal:Xc.ifTruthy;f.undoManager.transact(function(){Ec.each(e,function(e){var t,n,r,o,i,u;m.type!==e.parentNode.nodeName.toLowerCase()&&(t=f.dom,n=e,r=m.type,o=t.getParent(n,"table"),i=n.parentNode,(u=t.select(r,o)[0])||(u=t.create(r),o.firstChild?"CAPTION"===o.firstChild.nodeName?t.insertAfter(u,o.firstChild):o.insertBefore(u,o.firstChild):o.appendChild(u)),u.appendChild(n),i.hasChildNodes()||t.remove(i));var c,a,l=g(d,e);l.setAttrib("scope",m.scope),l.setAttrib("class",m["class"]),l.setStyle("height",ac(m.height)),bc(f)&&(a=m,(c=l).setStyle("background-color",a.backgroundcolor),c.setStyle("border-color",a.bordercolor),c.setStyle("border-style",a.borderstyle)),m.align!==s.align&&(Ic(f,e),Nc(f,e,m.align))}),f.focus()})},ia=function(t){var e,n,r=t.dom,o=[];if((e=r.getParent(t.selection.getStart(),"table"))&&(n=r.getParent(t.selection.getStart(),"td,th"),Ec.each(e.rows,function(t){Ec.each(t.cells,function(e){if((r.getAttrib(e,"data-mce-selected")||e===n)&&o.indexOf(t)<0)return o.push(t),!1})}),o[0])){var i=Ec.map(o,function(e){return qc(t,e,bc(t))}),u=Hc(i),c={type:"tabpanel",tabs:[{title:"General",items:ra(t)},Fc()]},a={type:"panel",items:[{type:"grid",columns:2,items:ra(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:bc(t)?c:a,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:u,onSubmit:b(oa,t,o,u)})}},ua=tinymce.util.Tools.resolve("tinymce.Env"),ca={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},percentages:!0},aa=function(e,t,n,r,o){void 0===o&&(o=ca);var i=de.fromTag("table");tn(i,o.styles),St(i,o.attributes);var u=de.fromTag("tbody");fn(i,u);for(var c=[],a=0;a<e;a++){for(var l=de.fromTag("tr"),f=0;f<t;f++){var s=a<n||f<r?de.fromTag("th"):de.fromTag("td");f<r&&Ct(s,"scope","row"),a<n&&Ct(s,"scope","col"),fn(s,de.fromTag("br")),o.percentages&&en(s,"width",100/t+"%"),fn(l,s)}c.push(l)}return mn(u,c),i},la=function(e,t){e.selection.select(t.dom(),!0),e.selection.collapse(!0)},fa=function(r,e,t){var n,o=hc(r),i={styles:o,attributes:pc(r),percentages:(n=o.width,v(n)&&-1!==n.indexOf("%")&&!Cc(r))},u=aa(t,e,0,0,i);Ct(u,"data-mce-id","__mce");var c,a,l,f=(c=u,a=de.fromTag("div"),l=de.fromDom(c.dom().cloneNode(!0)),fn(a,l),a.dom().innerHTML);return r.insertContent(f),jt(oc(r),'table[data-mce-id="__mce"]').map(function(e){var t,n;return Cc(r)&&en(e,"width",nn(e,"width")),Dt(e,"data-mce-id"),t=r,k(Bt(e,"tr"),function(e){Sc(t,e.dom()),k(Bt(e,"th,td"),function(e){Rc(t,e.dom())})}),n=r,jt(e,"td,th").each(b(la,n)),e.dom()}).getOr(null)},sa=function(e,t,n,r){if("TD"===t.tagName||"TH"===t.tagName)e.setStyle(t,n,r);else if(t.children)for(var o=0;o<t.children.length;o++)sa(e,t.children[o],n,r)},da=function(n,r,e){var o,i=n.dom,u=e.getData();e.close(),""===u["class"]&&delete u["class"],n.undoManager.transact(function(){if(!r){var e=parseInt(u.cols,10)||1,t=parseInt(u.rows,10)||1;r=fa(n,e,t)}!function(e,t,n){var r,o=e.dom,i={},u={};if(i["class"]=n["class"],u.height=ac(n.height),o.getAttrib(t,"width")&&!yc(e)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=ac(n.width),yc(e)?(u["border-width"]=ac(n.border),u["border-spacing"]=ac(n.cellspacing)):(i.border=n.border,i.cellpadding=n.cellpadding,i.cellspacing=n.cellspacing),yc(e)&&t.children)for(var c=0;c<t.children.length;c++)sa(o,t.children[c],{"border-width":ac(n.border),padding:ac(n.cellpadding)}),wc(e)&&sa(o,t.children[c],{"border-color":n.bordercolor});wc(e)&&(u["background-color"]=n.backgroundcolor,u["border-color"]=n.bordercolor,u["border-style"]=n.borderstyle),i.style=o.serializeStyle(ei(hc(e),u)),o.setAttribs(t,ei(pc(e),i))}(n,r,u),(o=i.select("caption",r)[0])&&!u.caption&&i.remove(o),!o&&u.caption&&((o=i.create("caption")).innerHTML=ua.ie?"\xa0":'<br data-mce-bogus="1"/>',r.insertBefore(o,r.firstChild)),""===u.align?Ic(n,r):Nc(n,r,u.align),n.focus(),n.addVisual()})},ma=function(t,e){var n,r=t.dom,o=Gc(t,wc(t));!1===e?(n=r.getParent(t.selection.getStart(),"table"))?o=Uc(t,n,wc(t)):wc(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""):(o.cols="1",o.rows="1",wc(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=0<xc(t).length;i&&o["class"]&&(o["class"]=o["class"].replace(/\s*mce\-item\-table\s*/g,""));var u=e?[{type:"input",name:"cols",label:"Cols"},{type:"input",name:"rows",label:"Rows"}]:[],c=t.getParam("table_appearance_options",!0,"boolean")?[{type:"input",name:"cellspacing",label:"Cell spacing"},{type:"input",name:"cellpadding",label:"Cell padding"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],a=i?[{type:"selectbox",name:"class",label:"Class",items:zc(xc(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"table",classes:[e.value]})})})}]:[],l={type:"grid",columns:2,items:u.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(c).concat([{type:"selectbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(a)},f={type:"panel",items:[l]},s={type:"tabpanel",tabs:[{title:"General",items:[l]},Fc()]},d=wc(t)?s:f;t.windowManager.open({title:"Table Properties",size:"normal",body:d,onSubmit:b(da,t,n),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},ga=Ec.each,pa=function(c,t,a,l,n){var r=cc(c),f=function(){return de.fromDom(c.dom.getParent(c.selection.getStart(),"th,td"))},s=function(e){return Gt.table(e,r)},d=function(e){return{width:ic(e.dom()),height:ic(e.dom())}},o=function(t){var n=f();s(n).each(function(i){var e=Ur.forMenu(l,i,n),u=d(i);t(i,e).each(function(e){var t,n,r,o;t=c,n=u,o=d(r=i),n.width===o.width&&n.height===o.height||(Tc(t,r.dom(),n.width,n.height),Dc(t,r.dom(),o.width,o.height)),c.selection.setRng(e),c.focus(),a.clear(i),lc(i)})})},i=function(e){var o=f();return s(o).bind(function(e){var t=de.fromDom(c.getDoc()),n=Ur.forMenu(l,e,o),r=_n(y,t,S.none());return Ac(e,n,r)})},u=function(u){n.get().each(function(e){var o=N(e,function(e){return xn(e)}),i=f();s(i).bind(function(t){var e=de.fromDom(c.getDoc()),n=Ln(e),r=Ur.pasteRows(l,t,i,o,n);u(t,r).each(function(e){c.selection.setRng(e),c.focus(),a.clear(t)})})})};ga({mceTableSplitCells:function(){o(t.unmergeCells)},mceTableMergeCells:function(){o(t.mergeCells)},mceTableInsertRowBefore:function(){o(t.insertRowsBefore)},mceTableInsertRowAfter:function(){o(t.insertRowsAfter)},mceTableInsertColBefore:function(){o(t.insertColumnsBefore)},mceTableInsertColAfter:function(){o(t.insertColumnsAfter)},mceTableDeleteCol:function(){o(t.deleteColumn)},mceTableDeleteRow:function(){o(t.deleteRow)},mceTableCutRow:function(e){n.set(i()),o(t.deleteRow)},mceTableCopyRow:function(e){n.set(i())},mceTablePasteRowBefore:function(e){u(t.pasteRowsBefore)},mceTablePasteRowAfter:function(e){u(t.pasteRowsAfter)},mceTableDelete:function(){var e=de.fromDom(c.dom.getParent(c.selection.getStart(),"th,td"));Gt.table(e,r).filter(m(r)).each(function(e){var t=de.fromText("");if(an(e,t),pn(e),c.dom.isEmpty(c.getBody()))c.setContent(""),c.selection.setCursorLocation();else{var n=c.dom.createRng();n.setStart(t.dom(),0),n.setEnd(t.dom(),0),c.selection.setRng(n),c.nodeChanged()}})}},function(e,t){c.addCommand(t,e)}),ga({mceInsertTable:b(ma,c,!0),mceTableProps:b(ma,c,!1),mceTableRowProps:b(ia,c),mceTableCellProps:b(ta,c)},function(n,e){c.addCommand(e,function(e,t){n(t)})})},ha=function(e){var t=S.from(e.dom().documentElement).map(de.fromDom).getOr(e);return{parent:C(t),view:C(e),origin:C(go(0,0))}},va=function(e,t){return{parent:C(t),view:C(e),origin:C(go(0,0))}};function ba(e){var n=J.apply(null,e),r=[];return{bind:function(e){if(e===undefined)throw"Event bind error: undefined handler";r.push(e)},unbind:function(t){r=I(r,function(e){return e!==t})},trigger:function(){var t=n.apply(null,arguments);k(r,function(e){e(t)})}}}var wa={create:function(e){return{registry:Y(e,function(e){return{bind:e.bind,unbind:e.unbind}}),trigger:Y(e,function(e){return e.trigger})}}},ya={mode:Wo(["compare","extract","mutate","sink"]),sink:Wo(["element","start","stop","destroy"]),api:Wo(["forceDrop","drop","move","delayDrop"])},xa={resolve:xi("ephox-dragster").resolve},Ca=function(m,g){return function(e){if(m(e)){var t,n,r,o,i,u,c,a=de.fromDom(e.target),l=function(){e.stopPropagation()},f=function(){e.preventDefault()},s=x(f,l),d=(t=a,n=e.clientX,r=e.clientY,o=l,i=f,u=s,c=e,{target:C(t),x:C(n),y:C(r),stop:o,prevent:i,kill:u,raw:C(c)});g(d)}}},Sa=function(e,t,n,r){return o=e,i=t,u=!1,c=Ca(n,r),o.dom().addEventListener(i,c,u),{unbind:b(Ra,o,i,c,u)};var o,i,u,c},Ra=function(e,t,n,r){e.dom().removeEventListener(t,n,r)},Ta=C(!0),Da=function(e,t,n){return Sa(e,t,Ta,n)},Oa=ya.mode({compare:function(e,t){return go(t.left()-e.left(),t.top()-e.top())},extract:function(e){return S.some(go(e.x(),e.y()))},sink:function(e,t){var n=function c(e){var t=ei({layerClass:xa.resolve("blocker")},e),n=de.fromTag("div");return Ct(n,"role","presentation"),tn(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Oi(n,xa.resolve("blocker")),Oi(n,t.layerClass),{element:function(){return n},destroy:function(){pn(n)}}}(t),r=Da(n.element(),"mousedown",e.forceDrop),o=Da(n.element(),"mouseup",e.drop),i=Da(n.element(),"mousemove",e.move),u=Da(n.element(),"mouseout",e.delayDrop);return ya.sink({element:n.element,start:function(e){fn(e,n.element())},stop:function(){pn(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(e,t){e.mutate(t.left(),t.top())}});function Aa(){var i=S.none(),u=wa.create({move:ba(["info"])});return{onEvent:function(e,o){o.extract(e).each(function(e){var t,n,r;(t=o,n=e,r=i.map(function(e){return t.compare(e,n)}),i=S.some(n),r).each(function(e){u.trigger.move(e)})})},reset:function(){i=S.none()},events:u.registry}}function Ea(){var e=function r(e){return{onEvent:function(e,t){},reset:y}}(),t=Aa(),n=e;return{on:function(){n.reset(),n=t},off:function(){n.reset(),n=e},isOn:function(){return n===t},onEvent:function(e,t){n.onEvent(e,t)},events:t.events}}var Na=function(t,n,e){var r,o,i,u=!1,c=wa.create({start:ba([]),stop:ba([])}),a=Ea(),l=function(){d.stop(),a.isOn()&&(a.off(),c.trigger.stop())},f=(r=l,o=200,i=null,{cancel:function(){null!==i&&(clearTimeout(i),i=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==i&&clearTimeout(i),i=setTimeout(function(){r.apply(null,e),i=null},o)}});a.events.move.bind(function(e){n.mutate(t,e.info())});var s=function(t){return function(){var e=Array.prototype.slice.call(arguments,0);if(u)return t.apply(null,e)}},d=n.sink(ya.api({forceDrop:l,drop:s(l),move:s(function(e,t){f.cancel(),a.onEvent(e,n)}),delayDrop:s(f.throttle)}),e);return{element:d.element,go:function(e){d.start(e),a.on(),c.trigger.start()},on:function(){u=!0},off:function(){u=!1},destroy:function(){d.destroy()},events:c.registry}},ka={transform:function(e,t){var n=t!==undefined?t:{},r=n.mode!==undefined?n.mode:Oa;return Na(e,r,t)}};function Ia(){var n=wa.create({drag:ba(["xDelta","yDelta","target"])}),r=S.none(),e=function t(){var n=wa.create({drag:ba(["xDelta","yDelta"])});return{mutate:function(e,t){n.trigger.drag(e,t)},events:n.registry}}();return e.events.drag.bind(function(t){r.each(function(e){n.trigger.drag(t.xDelta(),t.yDelta(),e)})}),{assign:function(e){r=S.some(e)},get:function(){return r},mutate:e.mutate,events:n.registry}}var Pa=function(e,t,n){return zt(e,t,n).isSome()},Ba=Ci.resolve("resizer-bar-dragging");function Ma(e,n){var r=Ao.height,t=function m(o,t,i){var n=Ia(),r=ka.transform(n,{}),u=S.none(),e=function(e,t){return S.from(Rt(e,t))};n.events.drag.bind(function(n){e(n.target(),"data-row").each(function(e){var t=Au.getInt(n.target(),"top");en(n.target(),"top",t+n.yDelta()+"px")}),e(n.target(),"data-column").each(function(e){var t=Au.getInt(n.target(),"left");en(n.target(),"left",t+n.xDelta()+"px")})});var c=function(e,t){return Au.getInt(e,t)-parseInt(Rt(e,"data-initial-"+t),10)};r.events.stop.bind(function(){n.get().each(function(r){u.each(function(n){e(r,"data-row").each(function(e){var t=c(r,"top");Dt(r,"data-initial-top"),d.trigger.adjustHeight(n,t,parseInt(e,10))}),e(r,"data-column").each(function(e){var t=c(r,"left");Dt(r,"data-initial-left"),d.trigger.adjustWidth(n,t,parseInt(e,10))}),_i.refresh(o,n,i,t)})})});var a=function(e,t){d.trigger.startAdjust(),n.assign(e),Ct(e,"data-initial-"+t,parseInt(nn(e,t),10)),Oi(e,Ba),en(e,"opacity","0.2"),r.go(o.parent())},l=Da(o.parent(),"mousedown",function(e){_i.isRowBar(e.target())&&a(e.target(),"top"),_i.isColBar(e.target())&&a(e.target(),"left")}),f=function(e){return nt(e,o.view())},s=Da(o.view(),"mouseover",function(e){"table"===gt(e.target())||Pa(e.target(),"table",f)?(u="table"===gt(e.target())?S.some(e.target()):_t(e.target(),"table",f)).each(function(e){_i.refresh(o,e,i,t)}):At(e.target())&&_i.destroy(o)}),d=wa.create({adjustHeight:ba(["table","delta","row"]),adjustWidth:ba(["table","delta","column"]),startAdjust:ba([])});return{destroy:function(){l.unbind(),s.unbind(),r.destroy(),_i.destroy(o)},refresh:function(e){_i.refresh(o,e,i,t)},on:r.on,off:r.off,hideBars:b(_i.hide,o),showBars:b(_i.show,o),events:d.registry}}(e,n,r),o=wa.create({beforeResize:ba(["table"]),afterResize:ba(["table"]),startDrag:ba([])});return t.events.adjustHeight.bind(function(e){o.trigger.beforeResize(e.table());var t=r.delta(e.delta(),e.table());Gu(e.table(),t,e.row(),r),o.trigger.afterResize(e.table())}),t.events.startAdjust.bind(function(e){o.trigger.startDrag()}),t.events.adjustWidth.bind(function(e){o.trigger.beforeResize(e.table());var t=n.delta(e.delta(),e.table());Vu(e.table(),t,e.column(),n),o.trigger.afterResize(e.table())}),{on:t.on,off:t.off,hideBars:t.hideBars,showBars:t.showBars,destroy:t.destroy,events:o.registry}}var Wa=function(e,t){return e.inline?va(oc(e),(n=de.fromTag("div"),tn(n,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),fn(Et(),n),n)):ha(de.fromDom(e.getDoc()));var n},_a=function(e,t){e.inline&&pn(t.parent())},La=function(u){var c,a,o=S.none(),i=S.none(),l=S.none(),f=/(\d+(\.\d+)?)%/,s=function(e){return"TABLE"===e.nodeName};return u.on("init",function(){var e,t=No(dc.directionAt),n=Wa(u);if(l=S.some(n),("table"===(e=u.getParam("object_resizing",!0))||e)&&u.getParam("table_resize_bars",!0,"boolean")){var r=Ma(n,t);r.on(),r.events.startDrag.bind(function(e){o=S.some(u.selection.getRng())}),r.events.beforeResize.bind(function(e){var t=e.table().dom();Tc(u,t,ic(t),uc(t))}),r.events.afterResize.bind(function(e){var t=e.table(),n=t.dom();lc(t),o.each(function(e){u.selection.setRng(e),u.focus()}),Dc(u,n,ic(n),uc(n)),u.undoManager.add()}),i=S.some(r)}}),u.on("ObjectResizeStart",function(e){var t,n=e.target;s(n)&&(c=e.width,t=n,a=u.dom.getStyle(t,"width")||u.dom.getAttrib(t,"width"))}),u.on("ObjectResized",function(e){var t=e.target;if(s(t)){var n=t;if(f.test(a)){var r=parseFloat(f.exec(a)[1]),o=e.width*r/c;u.dom.setStyle(n,"width",o+"%")}else{var i=[];Ec.each(n.rows,function(e){Ec.each(e.cells,function(e){var t=u.dom.getStyle(e,"width",!0);i.push({cell:e,width:t})})}),Ec.each(i,function(e){u.dom.setStyle(e.cell,"width",e.width),u.dom.setAttrib(e.cell,"width",null)})}}}),{lazyResize:function(){return i},lazyWire:function(){return l.getOr(ha(de.fromDom(u.getBody())))},destroy:function(){i.each(function(e){e.destroy()}),l.each(function(e){_a(u,e)})}}},ja=function(e){return{fold:e}},za=function(o){return ja(function(e,t,n,r){return e(o)})},Ha=function(o){return ja(function(e,t,n,r){return t(o)})},Fa=function(o,i){return ja(function(e,t,n,r){return n(o,i)})},Ua=function(o){return ja(function(e,t,n,r){return r(o)})},qa=function(n,e){return Gt.table(n,e).bind(function(e){var t=Gt.cells(e);return W(t,function(e){return nt(n,e)}).map(function(e){return{index:C(e),all:C(t)}})})},Va=function(t,e){return qa(t,e).fold(function(){return za(t)},function(e){return e.index()+1<e.all().length?Fa(t,e.all()[e.index()+1]):Ua(t)})},Ga=function(t,e){return qa(t,e).fold(function(){return za()},function(e){return 0<=e.index()-1?Fa(t,e.all()[e.index()-1]):Ha(t)})},Ya=Br([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Ka={before:Ya.before,on:Ya.on,after:Ya.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(o,o,o)}},Xa=Br([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),$a=J("start","soffset","finish","foffset"),Ja=function(e){var t,n=e.match({domRange:function(e){return de.fromDom(e.startContainer)},relative:function(e,t){return Ka.getStart(e)},exact:function(e,t,n,r){return e}});return t=n.dom().ownerDocument.defaultView,de.fromDom(t)},Qa=Xa.relative,Za=Xa.exact,el=function(e,t,n,r){var o,i,u,c,a,l=(i=t,u=n,c=r,(a=it(o=e).dom().createRange()).setStart(o.dom(),i),a.setEnd(u.dom(),c),a),f=nt(e,n)&&t===r;return l.collapsed&&!f},tl=function(e,t){e.selectNodeContents(t.dom())},nl=function(e,t,n){var r,o,i=e.document.createRange();return r=i,t.fold(function(e){r.setStartBefore(e.dom())},function(e,t){r.setStart(e.dom(),t)},function(e){r.setStartAfter(e.dom())}),o=i,n.fold(function(e){o.setEndBefore(e.dom())},function(e,t){o.setEnd(e.dom(),t)},function(e){o.setEndAfter(e.dom())}),i},rl=function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom(),n),i.setEnd(r.dom(),o),i},ol=function(e){return{left:C(e.left),top:C(e.top),right:C(e.right),bottom:C(e.bottom),width:C(e.width),height:C(e.height)}},il=Br([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),ul=function(e,t,n){return t(de.fromDom(n.startContainer),n.startOffset,de.fromDom(n.endContainer),n.endOffset)},cl=function(e,t){var o,n,r,i=(o=e,t.match({domRange:function(e){return{ltr:C(e),rtl:S.none}},relative:function(e,t){return{ltr:Oe(function(){return nl(o,e,t)}),rtl:Oe(function(){return S.some(nl(o,t,e))})}},exact:function(e,t,n,r){return{ltr:Oe(function(){return rl(o,e,t,n,r)}),rtl:Oe(function(){return S.some(rl(o,n,r,e,t))})}}}));return(r=(n=i).ltr()).collapsed?n.rtl().filter(function(e){return!1===e.collapsed}).map(function(e){return il.rtl(de.fromDom(e.endContainer),e.endOffset,de.fromDom(e.startContainer),e.startOffset)}).getOrThunk(function(){return ul(0,il.ltr,r)}):ul(0,il.ltr,r)},al=function(i,e){return cl(i,e).match({ltr:function(e,t,n,r){var o=i.document.createRange();return o.setStart(e.dom(),t),o.setEnd(n.dom(),r),o},rtl:function(e,t,n,r){var o=i.document.createRange();return o.setStart(n.dom(),r),o.setEnd(e.dom(),t),o}})},ll=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},fl=function(n,r,e,t,o){var i=function(e){var t=n.dom().createRange();return t.setStart(r.dom(),e),t.collapse(!0),t},u=Rn(r).length,c=function(e,t,n,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,u=1;u<o;u++){var c=e(u),a=Math.abs(t-c.left);if(n<=c.bottom){if(n<c.top||i<a)return u-1;i=a}}return 0}(function(e){return i(e).getBoundingClientRect()},e,t,o.right,u);return i(c)},sl=function(t,n,r,o){var e=t.dom().createRange();e.selectNode(n.dom());var i=e.getClientRects();return ni(i,function(e){return ll(e,r,o)?S.some(e):S.none()}).map(function(e){return fl(t,n,r,o,e)})},dl=function(t,e,n,r){var o=t.dom().createRange(),i=ft(e);return ni(i,function(e){return o.selectNode(e.dom()),ll(o.getBoundingClientRect(),n,r)?ml(t,e,n,r):S.none()})},ml=function(e,t,n,r){return(wt(t)?sl:dl)(e,t,n,r)},gl=function(e,t){return t-e.left<e.right-t},pl=function(e,t,n){var r=e.dom().createRange();return r.selectNode(t.dom()),r.collapse(n),r},hl=function(t,e,n){var r=t.dom().createRange();r.selectNode(e.dom());var o=r.getBoundingClientRect(),i=gl(o,n);return(!0===i?Nn:kn)(e).map(function(e){return pl(t,e,i)})},vl=function(e,t,n){var r=t.dom().getBoundingClientRect(),o=gl(r,n);return S.some(pl(e,t,o))},bl=function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect();return function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),c=Math.max(i.top,Math.min(i.bottom,r));return ml(e,t,u,c)}(e,t,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},wl=document.caretPositionFromPoint?function(n,e,t){return S.from(n.dom().caretPositionFromPoint(e,t)).bind(function(e){if(null===e.offsetNode)return S.none();var t=n.dom().createRange();return t.setStart(e.offsetNode,e.offset),t.collapse(),S.some(t)})}:document.caretRangeFromPoint?function(e,t,n){return S.from(e.dom().caretRangeFromPoint(t,n))}:function(o,i,t){return de.fromPoint(o,i,t).bind(function(r){var e=function(){return e=o,n=i,(0===ft(t=r).length?vl:hl)(e,t,n);var e,t,n};return 0===ft(r).length?e():bl(o,r,i,t).orThunk(e)})},yl=function(e,t){var n=gt(e);return"input"===n?Ka.after(e):A(["br","img"],n)?0===t?Ka.before(e):Ka.after(e):Ka.on(e,t)},xl=function(e,t){var n=e.fold(Ka.before,yl,Ka.after),r=t.fold(Ka.before,yl,Ka.after);return Qa(n,r)},Cl=function(e,t,n,r){var o=yl(e,t),i=yl(n,r);return Qa(o,i)},Sl=function(e,t){S.from(e.getSelection()).each(function(e){e.removeAllRanges(),e.addRange(t)})},Rl=function(e,t,n,r,o){var i=rl(e,t,n,r,o);Sl(e,i)},Tl=function(s,e){return cl(s,e).match({ltr:function(e,t,n,r){Rl(s,e,t,n,r)},rtl:function(e,t,n,r){var o,i,u,c,a,l=s.getSelection();if(l.setBaseAndExtent)l.setBaseAndExtent(e.dom(),t,n.dom(),r);else if(l.extend)try{i=e,u=t,c=n,a=r,(o=l).collapse(i.dom(),u),o.extend(c.dom(),a)}catch(f){Rl(s,n,r,e,t)}else Rl(s,n,r,e,t)}})},Dl=function(e){var o=Ja(e).dom(),t=function(e,t,n,r){return rl(o,e,t,n,r)},n=e.match({domRange:function(e){var t=de.fromDom(e.startContainer),n=de.fromDom(e.endContainer);return Cl(t,e.startOffset,n,e.endOffset)},relative:xl,exact:Cl});return cl(o,n).match({ltr:t,rtl:t})},Ol=function(e){var t=de.fromDom(e.anchorNode),n=de.fromDom(e.focusNode);return el(t,e.anchorOffset,n,e.focusOffset)?S.some($a(de.fromDom(e.anchorNode),e.anchorOffset,de.fromDom(e.focusNode),e.focusOffset)):function(e){if(0<e.rangeCount){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return S.some($a(de.fromDom(t.startContainer),t.startOffset,de.fromDom(n.endContainer),n.endOffset))}return S.none()}(e)},Al=function(e,t){var n,r,o=(n=t,r=e.document.createRange(),tl(r,n),r);Sl(e,o)},El=function(e){return(t=e,S.from(t.getSelection()).filter(function(e){return 0<e.rangeCount}).bind(Ol)).map(function(e){return Za(e.start(),e.soffset(),e.finish(),e.foffset())});var t},Nl=function(e,t){var n,r,o,i=al(e,t);return r=(n=i).getClientRects(),0<(o=0<r.length?r[0]:n.getBoundingClientRect()).width||0<o.height?S.some(o).map(ol):S.none()},kl=function(e,t,n){return r=e,o=t,i=n,u=de.fromDom(r.document),wl(u,o,i).map(function(e){return $a(de.fromDom(e.startContainer),e.startOffset,de.fromDom(e.endContainer),e.endOffset)});var r,o,i,u},Il=tinymce.util.Tools.resolve("tinymce.util.VK"),Pl=function(e,t,n,r){return _l(e,t,Va(n),r)},Bl=function(e,t,n,r){return _l(e,t,Ga(n),r)},Ml=function(e,t){var n=Za(t,0,t,0);return Dl(n)},Wl=function(e,t){var n,r=Bt(t,"tr");return(n=r,0===n.length?S.none():S.some(n[n.length-1])).bind(function(e){return jt(e,"td,th").map(function(e){return Ml(0,e)})})},_l=function(r,e,t,o,n){return t.fold(S.none,S.none,function(e,t){return Nn(t).map(function(e){return Ml(0,e)})},function(n){return Gt.table(n,e).bind(function(e){var t=Ur.noMenu(n);return r.undoManager.transact(function(){o.insertRowsAfter(e,t)}),Wl(0,e)})})},Ll=["table","li","dl"],jl=function(t,n,r,o){if(t.keyCode===Il.TAB){var i=oc(n),u=function(e){var t=gt(e);return nt(e,i)||A(Ll,t)},e=n.selection.getRng();if(e.collapsed){var c=de.fromDom(e.startContainer);Gt.cell(c,u).each(function(e){t.preventDefault(),(t.shiftKey?Bl:Pl)(n,u,e,r,o).each(function(e){n.selection.setRng(e)})})}}},zl={response:J("selection","kill")},Hl=function(t){return function(e){return e===t}},Fl=Hl(38),Ul=Hl(40),ql={ltr:{isBackward:Hl(37),isForward:Hl(39)},rtl:{isBackward:Hl(39),isForward:Hl(37)},isUp:Fl,isDown:Ul,isNavigation:function(e){return 37<=e&&e<=40}},Vl=function(e,t){var n=al(e,t);return{start:C(de.fromDom(n.startContainer)),soffset:C(n.startOffset),finish:C(de.fromDom(n.endContainer)),foffset:C(n.endOffset)}},Gl=function(e,t,n,r){return{start:C(Ka.on(e,t)),finish:C(Ka.on(n,r))}};function Yl(c){return{elementFromPoint:function(e,t){return de.fromPoint(de.fromDom(c.document),e,t)},getRect:function(e){return e.dom().getBoundingClientRect()},getRangedRect:function(e,t,n,r){var o=Za(e,t,n,r);return Nl(c,o).map(function(e){return Y(e,a)})},getSelection:function(){return El(c).map(function(e){return Vl(c,e)})},fromSitus:function(e){var t=Qa(e.start(),e.finish());return Vl(c,t)},situsFromPoint:function(e,t){return kl(c,e,t).map(function(e){return{start:C(Ka.on(e.start(),e.soffset())),finish:C(Ka.on(e.finish(),e.foffset()))}})},clearSelection:function(){c.getSelection().removeAllRanges()},setSelection:function(e){var t,n,r,o,i,u;t=c,n=e.start(),r=e.soffset(),o=e.finish(),i=e.foffset(),u=Cl(n,r,o,i),Tl(t,u)},setRelativeSelection:function(e,t){var n,r;n=c,r=xl(e,t),Tl(n,r)},selectContents:function(e){Al(c,e)},getInnerHeight:function(){return c.innerHeight},getScrollY:function(){var e,t,n,r;return(e=de.fromDom(c.document),t=e!==undefined?e.dom():document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop,go(n,r)).top()},scrollBy:function(e,t){var n,r,o;n=e,r=t,((o=de.fromDom(c.document))!==undefined?o.dom():document).defaultView.scrollBy(n,r)}}}tt.detect().browser.isSafari();var Kl=function(n,e,r,t,o){return nt(r,t)?S.none():Rr(r,t,e).bind(function(e){var t=e.boxes().getOr([]);return 0<t.length?(o(n,t,e.start(),e.finish()),S.some(zl.response(S.some(Gl(r,0,r,On(r))),!0))):S.none()})},Xl={sync:function(n,r,e,t,o,i,u){return nt(e,o)&&t===i?S.none():zt(e,"td,th",r).bind(function(t){return zt(o,"td,th",r).bind(function(e){return Kl(n,r,t,e,u)})})},detect:Kl,update:function(e,t,n,r,o){return Dr(r,e,t,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(e){return o.clear(n),o.selectRange(n,e.boxes(),e.start(),e.finish()),e.boxes()})}},$l=re(["left","top","right","bottom"],[]),Jl={nu:$l,moveUp:function(e,t){return $l({left:e.left(),top:e.top()-t,right:e.right(),bottom:e.bottom()-t})},moveDown:function(e,t){return $l({left:e.left(),top:e.top()+t,right:e.right(),bottom:e.bottom()+t})},moveBottomTo:function(e,t){var n=e.bottom()-e.top();return $l({left:e.left(),top:t-n,right:e.right(),bottom:t})},moveTopTo:function(e,t){var n=e.bottom()-e.top();return $l({left:e.left(),top:t,right:e.right(),bottom:t+n})},getTop:function(e){return e.top()},getBottom:function(e){return e.bottom()},translate:function(e,t,n){return $l({left:e.left()+t,top:e.top()+n,right:e.right()+t,bottom:e.bottom()+n})},toString:function(e){return"("+e.left()+", "+e.top()+") -> ("+e.right()+", "+e.bottom()+")"}},Ql=function(e){return Jl.nu({left:e.left,top:e.top,right:e.right,bottom:e.bottom})},Zl=function(e,t){return S.some(e.getRect(t))},ef=function(e,t,n){return bt(t)?Zl(e,t).map(Ql):wt(t)?(r=e,o=t,i=n,0<=i&&i<On(o)?r.getRangedRect(o,i,o,i+1):0<i?r.getRangedRect(o,i-1,o,i):S.none()).map(Ql):S.none();var r,o,i},tf=function(e,t){return bt(t)?Zl(e,t).map(Ql):wt(t)?e.getRangedRect(t,0,t,On(t)).map(Ql):S.none()},nf=J("item","mode"),rf=function(e,t,n,r){var o=r!==undefined?r:of;return e.property().parent(t).map(function(e){return nf(e,o)})},of=function(e,t,n,r){var o=r!==undefined?r:uf;return n.sibling(e,t).map(function(e){return nf(e,o)})},uf=function(e,t,n,r){var o=r!==undefined?r:uf,i=e.property().children(t);return n.first(i).map(function(e){return nf(e,o)})},cf=[{current:rf,next:of,fallback:S.none()},{current:of,next:uf,fallback:S.some(rf)},{current:uf,next:uf,fallback:S.some(of)}],af=function(t,n,r,o,e){return e=e!==undefined?e:cf,M(e,function(e){return e.current===r}).bind(function(e){return e.current(t,n,o,e.next).orThunk(function(){return e.fallback.bind(function(e){return af(t,n,e,o)})})})},lf={backtrack:rf,sidestep:of,advance:uf,go:af},ff={left:function(){return{sibling:function(e,t){return e.query().prevSibling(t)},first:function(e){return 0<e.length?S.some(e[e.length-1]):S.none()}}},right:function(){return{sibling:function(e,t){return e.query().nextSibling(t)},first:function(e){return 0<e.length?S.some(e[0]):S.none()}}}},sf=function(t,e,n,r,o,i){return lf.go(t,e,r,o).bind(function(e){return i(e.item())?S.none():n(e.item())?S.some(e.item()):sf(t,e.item(),n,e.mode(),o,i)})},df=function(e,t,n,r){return sf(e,t,n,lf.sidestep,ff.left(),r)},mf=function(e,t,n,r){return sf(e,t,n,lf.sidestep,ff.right(),r)},gf=function(e,t){return 0===e.property().children(t).length},pf=function(e,t,n,r){return df(e,t,n,r)},hf=function(e,t,n,r){return mf(e,t,n,r)},vf={before:function(e,t,n){return pf(e,t,b(gf,e),n)},after:function(e,t,n){return hf(e,t,b(gf,e),n)},seekLeft:pf,seekRight:hf,walkers:function(){return{left:ff.left,right:ff.right}},walk:function(e,t,n,r,o){return lf.go(e,t,n,r,o)},backtrack:lf.backtrack,sidestep:lf.sidestep,advance:lf.advance},bf=zn(),wf={gather:function(e,t,n){return vf.gather(bf,e,t,n)},before:function(e,t){return vf.before(bf,e,t)},after:function(e,t){return vf.after(bf,e,t)},seekLeft:function(e,t,n){return vf.seekLeft(bf,e,t,n)},seekRight:function(e,t,n){return vf.seekRight(bf,e,t,n)},walkers:function(){return vf.walkers()},walk:function(e,t,n,r){return vf.walk(bf,e,t,n,r)}},yf=Br([{none:[]},{retry:["caret"]}]),xf=function(t,e,r){return(n=e,o=Xo,Mt(function(e){return o(e)},Wt,n,o,i)).fold(C(!1),function(e){return tf(t,e).exists(function(e){return n=e,(t=r).left()<n.left()||Math.abs(n.right()-t.left())<1||t.left()>n.right();var t,n})});var n,o,i},Cf={point:Jl.getTop,adjuster:function(e,t,n,r,o){var i=Jl.moveUp(o,5);return Math.abs(n.top()-r.top())<1?yf.retry(i):n.bottom()<o.top()?yf.retry(i):n.bottom()===o.top()?yf.retry(Jl.moveUp(o,1)):xf(e,t,o)?yf.retry(Jl.translate(i,5,0)):yf.none()},move:Jl.moveUp,gather:wf.before},Sf={point:Jl.getBottom,adjuster:function(e,t,n,r,o){var i=Jl.moveDown(o,5);return Math.abs(n.bottom()-r.bottom())<1?yf.retry(i):n.top()>o.bottom()?yf.retry(i):n.top()===o.bottom()?yf.retry(Jl.moveDown(o,1)):xf(e,t,o)?yf.retry(Jl.translate(i,5,0)):yf.none()},move:Jl.moveDown,gather:wf.after},Rf=function(n,r,o,i,u){return 0===u?S.some(i):(a=n,l=i.left(),f=r.point(i),a.elementFromPoint(l,f).filter(function(e){return"table"===gt(e)}).isSome()?(t=i,c=u-1,Rf(n,e=r,o,e.move(t,5),c)):n.situsFromPoint(i.left(),r.point(i)).bind(function(e){return e.start().fold(S.none,function(t,e){return tf(n,t,e).bind(function(e){return r.adjuster(n,t,e,o,i).fold(S.none,function(e){return Rf(n,r,o,e,u-1)})}).orThunk(function(){return S.some(i)})},S.none)}));var e,t,c,a,l,f},Tf=function(t,n,e){var r,o,i,u=t.move(e,5),c=Rf(n,t,e,u,100).getOr(u);return(r=t,o=c,i=n,r.point(o)>i.getInnerHeight()?S.some(r.point(o)-i.getInnerHeight()):r.point(o)<0?S.some(-r.point(o)):S.none()).fold(function(){return n.situsFromPoint(c.left(),t.point(c))},function(e){return n.scrollBy(0,e),n.situsFromPoint(c.left(),t.point(c)-e)})},Df={tryUp:b(Tf,Cf),tryDown:b(Tf,Sf),ieTryUp:function(e,t){return e.situsFromPoint(t.left(),t.top()-5)},ieTryDown:function(e,t){return e.situsFromPoint(t.left(),t.bottom()+5)},getJumpSize:C(5)},Of=Br([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Af=function(e){return zt(e,"tr")},Ef={verify:function(c,e,t,n,r,a,o){return zt(n,"td,th",o).bind(function(u){return zt(e,"td,th",o).map(function(i){return nt(u,i)?nt(n,u)&&On(u)===r?a(i):Of.none("in same cell"):ur.sharedOne(Af,[u,i]).fold(function(){return t=i,n=u,r=(e=c).getRect(t),(o=e.getRect(n)).right>r.left&&o.left<r.right?Of.success():a(i);var e,t,n,r,o},function(e){return a(i)})})}).getOr(Of.none("default"))},cata:function(e,t,n,r,o){return e.fold(t,n,r,o)},adt:Of},Nf={point:J("element","offset"),delta:J("element","deltaOffset"),range:J("element","start","finish"),points:J("begin","end"),text:J("element","text")},kf=(J("ancestor","descendants","element","index"),J("parent","children","element","index")),If=function(e,t){return W(e,b(nt,t))},Pf=function(e){return"br"===gt(e)},Bf=function(e,t,n){return t(e,n).bind(function(e){return wt(e)&&0===Rn(e).trim().length?Bf(e,t,n):S.some(e)})},Mf=function(t,e,n,r){return(o=e,i=n,st(o,i).filter(Pf).orThunk(function(){return st(o,i-1).filter(Pf)})).bind(function(e){return r.traverse(e).fold(function(){return Bf(e,r.gather,t).map(r.relative)},function(e){return(r=e,ut(r).bind(function(t){var n=ft(t);return If(n,r).map(function(e){return kf(t,n,r,e)})})).map(function(e){return Ka.on(e.parent(),e.index())});var r})});var o,i},Wf=function(e,t,n,r){var o,i,u;return(Pf(t)?(o=e,i=t,(u=r).traverse(i).orThunk(function(){return Bf(i,u.gather,o)}).map(u.relative)):Mf(e,t,n,r)).map(function(e){return{start:C(e),finish:C(e)}})},_f=function(e){return Ef.cata(e,function(e){return S.none()},function(){return S.none()},function(e){return S.some(Nf.point(e,0))},function(e){return S.some(Nf.point(e,On(e)))})},Lf=tt.detect(),jf=function(r,o,i,u,c,a){return 0===a?S.none():Ff(r,o,i,u,c).bind(function(e){var t=r.fromSitus(e),n=Ef.verify(r,i,u,t.finish(),t.foffset(),c.failure,o);return Ef.cata(n,function(){return S.none()},function(){return S.some(e)},function(e){return nt(i,e)&&0===u?zf(r,i,u,Jl.moveUp,c):jf(r,o,e,0,c,a-1)},function(e){return nt(i,e)&&u===On(e)?zf(r,i,u,Jl.moveDown,c):jf(r,o,e,On(e),c,a-1)})})},zf=function(t,e,n,r,o){return ef(t,e,n).bind(function(e){return Hf(t,o,r(e,Df.getJumpSize()))})},Hf=function(e,t,n){return Lf.browser.isChrome()||Lf.browser.isSafari()||Lf.browser.isFirefox()||Lf.browser.isEdge()?t.otherRetry(e,n):Lf.browser.isIE()?t.ieRetry(e,n):S.none()},Ff=function(t,e,n,r,o){return ef(t,n,r).bind(function(e){return Hf(t,o,e)})},Uf=function(t,n,r){return(o=t,i=n,u=r,o.getSelection().bind(function(r){return Wf(i,r.finish(),r.foffset(),u).fold(function(){return S.some(Nf.point(r.finish(),r.foffset()))},function(e){var t=o.fromSitus(e),n=Ef.verify(o,r.finish(),r.foffset(),t.finish(),t.foffset(),u.failure,i);return _f(n)})})).bind(function(e){return jf(t,n,e.element(),e.offset(),r,20).map(t.fromSitus)});var o,i,u},qf=tt.detect(),Vf=function(e,t){return Wt(e,function(e){return ut(e).exists(function(e){return nt(e,t)})},n).isSome();var n},Gf=function(t,r,o,e,i){return zt(e,"td,th",r).bind(function(n){return zt(n,"table",r).bind(function(e){return Vf(i,e)?Uf(t,r,o).bind(function(t){return zt(t.finish(),"td,th",r).map(function(e){return{start:C(n),finish:C(e),range:C(t)}})}):S.none()})})},Yf=function(e,t,n,r,o,i){return qf.browser.isIE()?S.none():i(r,t).orThunk(function(){return Gf(e,t,n,r,o).map(function(e){var t=e.range();return zl.response(S.some(Gl(t.start(),t.soffset(),t.finish(),t.foffset())),!0)})})},Kf=function(e,t,n,r,o,i,u){return Gf(e,n,r,o,i).bind(function(e){return Xl.detect(t,n,e.start(),e.finish(),u)})},Xf=function(e,r){return zt(e,"tr",r).bind(function(n){return zt(n,"table",r).bind(function(e){var t=Bt(e,"tr");return nt(n,t[0])?wf.seekLeft(e,function(e){return kn(e).isSome()},r).map(function(e){var t=On(e);return zl.response(S.some(Gl(e,t,e,t)),!0)}):S.none()})})},$f=function(e,r){return zt(e,"tr",r).bind(function(n){return zt(n,"table",r).bind(function(e){var t=Bt(e,"tr");return nt(n,t[t.length-1])?wf.seekRight(e,function(e){return Nn(e).isSome()},r).map(function(e){return zl.response(S.some(Gl(e,0,e,0)),!0)}):S.none()})})},Jf=function(e,t){return zt(e,"td,th",t)},Qf={down:{traverse:lt,gather:wf.after,relative:Ka.before,otherRetry:Df.tryDown,ieRetry:Df.ieTryDown,failure:Ef.adt.failedDown},up:{traverse:at,gather:wf.before,relative:Ka.before,otherRetry:Df.tryUp,ieRetry:Df.ieTryUp,failure:Ef.adt.failedUp}},Zf=J("rows","cols"),es={mouse:function(e,t,n,r){var o=function c(o,i,t,u){var n=S.none(),e=function(){n=S.none()};return{mousedown:function(e){u.clear(i),n=Jf(e.target(),t)},mouseover:function(e){n.each(function(r){u.clear(i),Jf(e.target(),t).each(function(n){Rr(r,n,t).each(function(e){var t=e.boxes().getOr([]);(1<t.length||1===t.length&&!nt(r,n))&&(u.selectRange(i,t,e.start(),e.finish()),o.selectContents(n))})})})},mouseup:function(){n.each(e)}}}(Yl(e),t,n,r);return{mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},keyboard:function(e,a,l,f){var s=Yl(e),d=function(){return f.clear(a),S.none()};return{keydown:function(e,t,n,r,o,i){var u=e.raw().which,c=!0===e.raw().shiftKey;return Tr(a,f.selectedSelector()).fold(function(){return ql.isDown(u)&&c?b(Kf,s,a,l,Qf.down,r,t,f.selectRange):ql.isUp(u)&&c?b(Kf,s,a,l,Qf.up,r,t,f.selectRange):ql.isDown(u)?b(Yf,s,l,Qf.down,r,t,$f):ql.isUp(u)?b(Yf,s,l,Qf.up,r,t,Xf):S.none},function(t){var e=function(e){return function(){return ni(e,function(e){return Xl.update(e.rows(),e.cols(),a,t,f)}).fold(function(){return Or(a,f.firstSelectedSelector(),f.lastSelectedSelector()).map(function(e){var t=ql.isDown(u)||i.isForward(u)?Ka.after:Ka.before;return s.setRelativeSelection(Ka.on(e.first(),0),t(e.table())),f.clear(a),zl.response(S.none(),!0)})},function(e){return S.some(zl.response(S.none(),!0))})}};return ql.isDown(u)&&c?e([Zf(1,0)]):ql.isUp(u)&&c?e([Zf(-1,0)]):i.isBackward(u)&&c?e([Zf(0,-1),Zf(-1,0)]):i.isForward(u)&&c?e([Zf(0,1),Zf(1,0)]):ql.isNavigation(u)&&!1===c?d:S.none})()},keyup:function(t,n,r,o,i){return Tr(a,f.selectedSelector()).fold(function(){var e=t.raw().which;return 0==(!0===t.raw().shiftKey)?S.none():ql.isNavigation(e)?Xl.sync(a,l,n,r,o,i,f.selectRange):S.none()},S.none)}}}},ts=function(r,e){k(e,function(e){var t,n;n=e,Ri(t=r)?t.dom().classList.remove(n):Di(t,n),Ai(t)})},ns={byClass:function(o){var t,n,i=(t=o.selected(),function(e){Oi(e,t)}),r=(n=[o.selected(),o.lastSelected(),o.firstSelected()],function(e){ts(e,n)}),u=function(e){var t=Bt(e,o.selectedSelector());k(t,r)};return{clear:u,selectRange:function(e,t,n,r){u(e),k(t,i),Oi(n,o.firstSelected()),Oi(r,o.lastSelected())},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}},byAttr:function(o){var n=function(e){Dt(e,o.selected()),Dt(e,o.firstSelected()),Dt(e,o.lastSelected())},i=function(e){Ct(e,o.selected(),"1")},u=function(e){var t=Bt(e,o.selectedSelector());k(t,n)};return{clear:u,selectRange:function(e,t,n,r){u(e),k(t,i),Ct(n,o.firstSelected(),"1"),Ct(r,o.lastSelected(),"1")},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}}},rs=function(e){return!1===Ei(de.fromDom(e.target),"ephox-snooker-resizer-bar")};function os(p,h){var v=re(["mousedown","mouseover","mouseup","keyup","keydown"],[]),b=S.none(),w=ns.byAttr(Pr);return p.on("init",function(e){var r=p.getWin(),o=oc(p),t=cc(p),n=es.mouse(r,o,t,w),c=es.keyboard(r,o,t,w),a=function(e,t){!0===e.raw().shiftKey&&(t.kill()&&e.kill(),t.selection().each(function(e){var t=Qa(e.start(),e.finish()),n=al(r,t);p.selection.setRng(n)}))},i=function(e){var t=f(e);if(t.raw().shiftKey&&ql.isNavigation(t.raw().which)){var n=p.selection.getRng(),r=de.fromDom(n.startContainer),o=de.fromDom(n.endContainer);c.keyup(t,r,n.startOffset,o,n.endOffset).each(function(e){a(t,e)})}},u=function(e){var t=f(e);h().each(function(e){e.hideBars()});var n=p.selection.getRng(),r=de.fromDom(p.selection.getStart()),o=de.fromDom(n.startContainer),i=de.fromDom(n.endContainer),u=dc.directionAt(r).isRtl()?ql.rtl:ql.ltr;c.keydown(t,o,n.startOffset,i,n.endOffset,u).each(function(e){a(t,e)}),h().each(function(e){e.showBars()})},l=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},f=function(e){var t=de.fromDom(e.target),n=function(){e.stopPropagation()},r=function(){e.preventDefault()},o=x(r,n);return{target:C(t),x:C(l(e)?e.x:null),y:C(l(e)?e.y:null),stop:n,prevent:r,kill:o,raw:C(e)}},s=function(e){return 0===e.button},d=function(e){s(e)&&rs(e)&&n.mousedown(f(e))},m=function(e){var t;(t=e).buttons!==undefined&&0==(1&t.buttons)||!rs(e)||n.mouseover(f(e))},g=function(e){s(e)&&rs(e)&&n.mouseup(f(e))};p.on("mousedown",d),p.on("mouseover",m),p.on("mouseup",g),p.on("keyup",i),p.on("keydown",u),p.on("nodechange",function(){var e=p.selection,t=de.fromDom(e.getStart()),n=de.fromDom(e.getEnd());ur.sharedOne(Gt.table,[t,n]).fold(function(){w.clear(o)},y)}),b=S.some(v({mousedown:d,mouseover:m,mouseup:g,keyup:i,keydown:u}))}),{clear:w.clear,destroy:function(){b.each(function(e){})}}}var is=function(t){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(e){return e("inserttable tableprops deletetable | cell row column")}});var e=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:e("mceTableProps"),icon:"table"}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:e("mceTableDelete"),icon:"table-delete-table"}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:e("mceTableCellProps"),icon:"table-cell-properties"}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:e("mceTableMergeCells"),icon:"table-merge-cells"}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:e("mceTableSplitCells"),icon:"table-split-cells"}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:e("mceTableInsertRowBefore"),icon:"table-insert-row-above"}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:e("mceTableInsertRowAfter"),icon:"table-insert-row-after"}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:e("mceTableDeleteRow"),icon:"table-delete-row"}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:e("mceTableRowProps"),icon:"table-row-properties"}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:e("mceTableInsertColBefore"),icon:"table-insert-column-before"}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:e("mceTableInsertColAfter"),icon:"table-insert-column-after"}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:e("mceTableDeleteCol"),icon:"table-delete-column"}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",onAction:e("mceTableCutRow"),icon:"temporary-placeholder"}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",onAction:e("mceTableCopyRow"),icon:"temporary-placeholder"}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",onAction:e("mceTablePasteRowBefore"),icon:"temporary-placeholder"}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",onAction:e("mceTablePasteRowAfter"),icon:"temporary-placeholder"})},us=function(t){var e=t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol");0<e.length&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})},cs=function(r,n){var e=S.none,o=function(e){e.setDisabled(!0)},t=function(t){return e().fold(function(){o(t)},function(e){t.setDisabled(!1)}),function(){}},i=function(t){return e().fold(function(){o(t)},function(e){t.setDisabled(e.mergable().isNone())}),function(){}},u=function(t){return e().fold(function(){o(t)},function(e){t.setDisabled(e.unmergable().isNone())}),function(){}},c=function(){e=Oe(function(){return S.from(r.dom.getParent(r.selection.getStart(),"th,td")).bind(function(e){var t=de.fromDom(e);return Gt.table(t).map(function(e){return Ur.forMenu(n,e,t)})})})};r.on("nodechange",c);var a=function(e){return function(){return r.execCommand(e)}},l=function(e){var t=e.numRows,n=e.numColumns;r.undoManager.transact(function(){fa(r,n,t)}),r.addVisual()},f={text:"Table properties",onSetup:t,onAction:a("mceTableProps")},s={text:"Delete table",icon:"table-delete-table",onSetup:t,onAction:a("mceTableDelete")},d={type:"nestedmenuitem",text:"Row",getSubmenuItems:function(){return[{type:"menuitem",text:"Insert row before",icon:"table-insert-row-above",onAction:a("mceTableInsertRowBefore"),onSetup:t},{type:"menuitem",text:"Insert row after",icon:"table-insert-row-after",onAction:a("mceTableInsertRowAfter"),onSetup:t},{type:"menuitem",text:"Delete row",icon:"table-delete-row",onAction:a("mceTableDeleteRow"),onSetup:t},{type:"menuitem",text:"Row properties",icon:"table-row-properties",onAction:a("mceTableRowProps"),onSetup:t},{type:"separator"},{type:"menuitem",text:"Cut row",onAction:a("mceTableCutRow"),onSetup:t},{type:"menuitem",text:"Copy row",onAction:a("mceTableCopyRow"),onSetup:t},{type:"menuitem",text:"Paste row before",onAction:a("mceTablePasteRowBefore"),onSetup:t},{type:"menuitem",text:"Paste row after",onAction:a("mceTablePasteRowAfter"),onSetup:t}]}},m={type:"nestedmenuitem",text:"Column",getSubmenuItems:function(){return[{type:"menuitem",text:"Insert column before",icon:"table-insert-column-before",onAction:a("mceTableInsertColBefore"),onSetup:t},{type:"menuitem",text:"Insert column after",icon:"table-insert-column-after",onAction:a("mceTableInsertColAfter"),onSetup:t},{type:"menuitem",text:"Delete column",icon:"table-delete-column",onAction:a("mceTableDeleteCol"),onSetup:t}]}},g={type:"nestedmenuitem",text:"Cell",getSubmenuItems:function(){return[{type:"menuitem",text:"Cell properties",icon:"table-cell-properties",onAction:a("mceTableCellProps"),onSetup:t},{type:"menuitem",text:"Merge cells",icon:"table-merge-cells",onAction:a("mceTableMergeCells"),onSetup:i},{type:"menuitem",text:"Split cell",icon:"table-split-cells",onAction:a("mceTableSplitCells"),onSetup:u}]}};!1===r.getParam("table_grid",!0,"boolean")?r.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:a("mceInsertTable")}):r.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:l}]}}),r.ui.registry.addMenuItem("tableprops",f),r.ui.registry.addMenuItem("deletetable",s),r.ui.registry.addNestedMenuItem("row",d),r.ui.registry.addNestedMenuItem("column",m),r.ui.registry.addNestedMenuItem("cell",g),r.ui.registry.addContextMenu("table",{update:function(){return c(),e().fold(function(){return""},function(){return"cell row column | tableprops deletetable"})}})},as=function(n,r){return{insertTable:function(e,t){return fa(n,e,t)},setClipboardRows:function(e){return t=r,n=N(e,de.fromDom),void t.set(S.from(n));var t,n},getClipboardRows:function(){return r.get().fold(function(){},function(e){return N(e,function(e){return e.dom()})})}}};e.add("table",function fs(t){var n,r=La(t),e=os(t,r.lazyResize),o=Oc(t,r.lazyWire),i=(n=t,{get:function(){var e=oc(n);return Ar(e,Pr.selectedSelector()).fold(function(){return n.selection.getStart()===undefined?Wr.none():Wr.single(n.selection)},function(e){return Wr.multiple(e)})}}),u=Po(S.none());return pa(t,o,e,i,u),qr(t,i,o,e),cs(t,i),is(t),us(t),t.on("PreInit",function(){t.serializer.addTempAttr(Pr.firstSelected()),t.serializer.addTempAttr(Pr.lastSelected())}),t.getParam("table_tab_navigation",!0,"boolean")&&t.on("keydown",function(e){jl(e,t,o,r.lazyWire)}),t.on("remove",function(){r.destroy(),e.destroy()}),as(t,u)}),function ss(){}}();!function(){"use strict";var l=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return l(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(t.settings.plugins)||!e.get("powerpaste")||("undefined"!=typeof window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},u=function(t,e){return{clipboard:t,quirks:e}},f=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})},d=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})},i=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},n=function(t,e){return t.fire("paste",{ieFake:e})},m={shouldPlainTextInform:function(t){return t.getParam("paste_plaintext_inform",!0)},shouldBlockDrop:function(t){return t.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(t){return t.getParam("paste_data_images",!1)},shouldFilterDrop:function(t){return t.getParam("paste_filter_drop",!0)},getPreProcess:function(t){return t.getParam("paste_preprocess")},getPostProcess:function(t){return t.getParam("paste_postprocess")},getWebkitStyles:function(t){return t.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(t){return t.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(t){return t.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(t){return t.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(t){return t.getParam("paste_as_text",!1)},getRetainStyleProps:function(t){return t.getParam("paste_retain_style_properties")},getWordValidElements: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")},shouldConvertWordFakeLists:function(t){return t.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(t){return t.getParam("paste_enable_default_filters",!0)}},r=function(t,e,n){var r,o;"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),i(t,!1)):(e.pasteFormat.set("text"),i(t,!0),o=t,!1===n.get()&&m.shouldPlainTextInform(o)&&(r="Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",t.notificationManager.open({text:r,type:"info"}),n.set(!0))),t.focus()},s=function(t,n,e){t.addCommand("mceTogglePlainTextPaste",function(){r(t,n,e)}),t.addCommand("mceInsertClipboardContent",function(t,e){e.content&&n.pasteHtml(e.content,e.internal),e.text&&n.pasteText(e.text)})},v=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),t="x-tinymce/html",c="\x3c!-- "+t+" --\x3e",g=function(t){return c+t},p=function(t){return t.replace(c,"")},b=function(t){return-1!==t.indexOf(c)},x=function(){return t},P=tinymce.util.Tools.resolve("tinymce.html.Entities"),w=function(t){return t.replace(/\r?\n/g,"<br>")},T=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+'="'+P.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",a=y.map(r,function(t){return t.split(/\n/).join("<br />")});return 1===a.length?a[0]:y.map(a,function(t){return o+t+i}).join("")},_=function(t){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(t)},D=function(t,e,n){return e?T(t,e,n):w(t)},C=tinymce.util.Tools.resolve("tinymce.html.DomParser"),k=tinymce.util.Tools.resolve("tinymce.html.Node"),S=tinymce.util.Tools.resolve("tinymce.html.Schema"),O=tinymce.util.Tools.resolve("tinymce.html.Serializer");function R(e,t){return y.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var A={filter:R,innerText:function Zt(t){var e=S(),n=C({},e),r="",o=e.getShortEndedElements(),i=y.makeMap("script noscript style textarea video audio iframe object"," "),a=e.getBlockElements();return t=R(t,[/<!\[[^\]]+\]>/g]),function u(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))for(;u(t),t=t.next;);a[e]&&n.next&&(r+="\n","p"===e&&(r+="\n"))}}else r+="\n"}(n.parse(t)),r},trimHtml:function Jt(t){return t=R(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function r(t,e,n){return e||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function Qt(t){var e=0;return function(){return t+e++}},isMsEdge:function(){return-1!==navigator.userAgent.indexOf(" Edge/")}};function E(e){var n,t;return t=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \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]/],e=e.replace(/^[\u00a0 ]+/,""),y.each(t,function(t){if(t.test(e))return!(n=!0)}),n}function F(t){var i,a,u=1;function n(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)for(;e+=n(t),t=t.next;);return e}function s(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!s(t,e))return!1}while(t=t.next);return!0}function e(t,e,n){var r=t._listLevel||u;r!==u&&(r<u?i&&(i=i.parent.parent):(a=i,i=null)),i&&i.name===e?i.append(t):(a=a||i,i=new k(e,1),1<n&&i.attr("start",""+n),t.wrap(i)),t.name="li",u<r&&a&&a.lastChild.append(i),u=r,function o(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)for(;o(t),t=t.next;);}(t),s(t,/^\u00a0+/),s(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),s(t,/^\u00a0+/)}for(var r=[],o=t.firstChild;null!=o;)if(r.push(o),null!==(o=o.walk()))for(;void 0!==o&&o.parent!==t;)o=o.walk();for(var l=0;l<r.length;l++)if("p"===(t=r[l]).name&&t.firstChild){var c=n(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(c)){e(t,"ul");continue}if(E(c)){var f=/([0-9]+)\./.exec(c),d=1;f&&(d=parseInt(f[1],10)),e(t,"ol",d);continue}if(t._listLevel){e(t,"ul",1);continue}i=null}else a=i,i=null}function I(n,r,o,i){var a,u={},t=n.dom.parseStyle(i);return y.each(t,function(t,e){switch(e){case"mso-list":(a=/\w+ \w+([0-9]+)/i.exec(i))&&(o._listLevel=parseInt(a[1],10)),/Ignore/i.test(t)&&o.firstChild&&(o._listIgnore=!0,o.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":return void("normal"!==t&&(u[e]=t));case"mso-element":if(/^(comment|comment-list)$/i.test(t))return void o.remove()}0!==e.indexOf("mso-comment")?0!==e.indexOf("mso-")&&("all"===m.getRetainStyleProps(n)||r&&r[e])&&(u[e]=t):o.remove()}),/(bold)/i.test(u["font-weight"])&&(delete u["font-weight"],o.wrap(new k("b",1))),/(italic)/i.test(u["font-style"])&&(delete u["font-style"],o.wrap(new k("i",1))),(u=n.dom.serializeStyle(u,o.name))||null}var M,B,H,j,L,N={preProcess:function(t,e){return m.shouldUseDefaultFilters(t)?function(r,t){var e,o;(e=m.getRetainStyleProps(r))&&(o=y.makeMap(e.split(/[, ]/))),t=A.filter(t,[/<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,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return 0<e.length?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join("\xa0"):""}]]);var n=m.getWordValidElements(r),i=S({valid_elements:n,valid_children:"-li[p]"});y.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=C({},i);a.addAttributeFilter("style",function(t){for(var e,n=t.length;n--;)(e=t[n]).attr("style",I(r,o,e,e.attr("style"))),"span"===e.name&&e.parent&&!e.attributes.length&&e.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(t);return m.shouldConvertWordFakeLists(r)&&F(u),t=O({validate:r.settings.validate},i).serialize(u)}(t,e):e},isWordContent:function te(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)}},$=function(t,e){return{content:t,cancelled:e}},W=function(t,e,n,r){var o,i,a,u,s,l,c=f(t,e,n,r);return t.hasEventListeners("PastePostProcess")&&!c.isDefaultPrevented()?(o=t,i=c.content,a=n,u=r,s=o.dom.create("div",{style:"display:none"},i),l=d(o,s,a,u),$(l.node.innerHTML,l.isDefaultPrevented())):$(c.content,c.isDefaultPrevented())},z=function(t,e,n){var r=N.isWordContent(e),o=r?N.preProcess(t,e):e;return W(t,o,n,r)},U=function(t,e){var n,r;return t.insertContent((n=e,r=t.dom.create("body",{},n),y.each(r.querySelectorAll("meta"),function(t){return t.parentNode.removeChild(t)}),r.innerHTML),{merge:m.shouldMergeFormats(t),paste:!0}),!0},V=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},q=function(t){return V(t)&&/.(gif|jpe?g|png)$/.test(t)},K=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!V(e)||(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.execCommand("mceInsertLink",!1,o)}),0));var r,o,i},G=function(t,e,n){return!!q(e)&&(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.insertContent('<img src="'+o+'">')}),!0);var r,o,i},X=function(t,e){var n,r;!1===m.isSmartPasteEnabled(t)?U(t,e):(n=t,r=e,y.each([K,G,U],function(t){return!0!==t(n,r,U)}))},Y=function(t){return function(){return t}},Z=Y(!1),J=Y(!0),Q=Z,tt=J,et=function(){return nt},nt=(j={fold:function(t,e){return t()},is:Q,isSome:Q,isNone:tt,getOr:H=function(t){return t},getOrThunk:B=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:H,orThunk:B,map:et,ap:et,each:function(){},bind:et,flatten:et,exists:Q,forall:tt,filter:et,equals:M=function(t){return t.isNone()},equals_:M,toArray:function(){return[]},toString:Y("none()")},Object.freeze&&Object.freeze(j),j),rt=function(n){var t=function(){return n},e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:tt,isNone:Q,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return rt(t(n))},ap:function(t){return t.fold(et,function(t){return rt(t(n))})},each:function(t){t(n)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(n)?o:nt},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(Q,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},ot={some:rt,none:et,from:function(t){return null===t||t===undefined?nt:rt(t)}},it=(L="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&Array.prototype.isPrototypeOf(t)?"array":"object"===e&&String.prototype.isPrototypeOf(t)?"string":e}(t)===L}),at=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,t)}return r},ut=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n,t)},st=Array.prototype.slice,lt=it(Array.from)?Array.from:function(t){return st.call(t)},ct=function(t){var n=ot.none(),e=[],r=function(t){o()?a(t):e.push(t)},o=function(){return n.isSome()},i=function(t){ut(t,a)},a=function(e){n.each(function(t){setTimeout(function(){e(t)},0)})};return t(function(t){n=ot.some(t),i(e),e=[]}),{get:r,map:function(n){return ct(function(e){r(function(t){e(n(t))})})},isReady:o}},ft={nu:ct,pure:function(e){return ct(function(t){t(e)})}},dt=function(e){var t=function(t){var r;e((r=t,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this;setTimeout(function(){r.apply(n,t)},0)}))},n=function(){return ft.nu(t)};return{map:function(r){return dt(function(n){t(function(t){var e=r(t);n(e)})})},bind:function(n){return dt(function(e){t(function(t){n(t).get(e)})})},anonBind:function(n){return dt(function(e){t(function(t){n.get(e)})})},toLazy:n,toCached:function(){var e=null;return dt(function(t){null===e&&(e=n()),e.get(t)})},get:t}},mt={nu:dt,pure:function(e){return dt(function(t){t(e)})}},gt=function(a,t){return t(function(r){var o=[],i=0;0===a.length?r([]):ut(a,function(t,e){var n;t.get((n=e,function(t){o[n]=t,++i>=a.length&&r(o)}))})})},pt=function(t,e){var n=at(t,e);return gt(n,mt.nu)},vt=function(t,e,n){var r=n||b(e),o=z(t,p(e),r);!1===o.cancelled&&X(t,o.content)},ht=function(t,e){e=t.dom.encode(e).replace(/\r\n/g,"\n"),e=D(e,t.settings.forced_root_block,t.settings.forced_root_block_attrs),vt(t,e,!1)},yt=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&0<n.length&&-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(i){e[o]=""}}}return e},bt=function(t,e){return e in t&&0<t[e].length},xt=function(t){return bt(t,"text/html")||bt(t,"text/plain")},Pt=A.createIdGenerator("mceclip"),wt=function(e,t,n){var r,o,i,a,u="paste"===t.type?t.clipboardData:t.dataTransfer;if(e.settings.paste_data_images&&u){var s=(i=(o=u).items?at(lt(o.items),function(t){return t.getAsFile()}):[],a=o.files?lt(o.files):[],function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n}(0<i.length?i:a,function(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)}));if(0<s.length)return t.preventDefault(),(r=s,pt(r,function(r){return mt.nu(function(t){var e=r.getAsFile?r.getAsFile():r,n=new window.FileReader;n.onload=function(){t({blob:e,uri:n.result})},n.readAsDataURL(e)})})).get(function(t){n&&e.selection.setRng(n),ut(t,function(t){!function(t,e){var n,r,o,i,a,u,s,l=(n=e.uri,-1!==(r=n.indexOf(","))?n.substr(r+1):null),c=Pt(),f=t.settings.images_reuse_filename&&e.blob.name?(o=t,i=e.blob.name,(a=i.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i))?o.dom.encode(a[1]):null):c,d=new Image;if(d.src=e.uri,u=t.settings,s=d,!u.images_dataimg_filter||u.images_dataimg_filter(s)){var m,g=t.editorUpload.blobCache,p=void 0;(m=g.findFirst(function(t){return t.base64()===l}))?p=m:(p=g.create(c,e.blob,l,f),g.add(p)),vt(t,'<img src="'+p.blobUri()+'">',!1)}else vt(t,'<img src="'+e.uri+'">',!1)}(e,t)})}),!0}return!1},Tt=function(t){return o.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},_t=function(c,f,d){var m,g=0;function p(t,e,n,r){var o,i;bt(t,"text/html")?o=t["text/html"]:(o=f.getHtml(),r=r||b(o),f.isDefaultContent(o)&&(n=!0)),o=A.trimHtml(o),f.remove(),i=!1===r&&_(o),o.length&&!i||(n=!0),n&&(o=bt(t,"text/plain")&&i?t["text/plain"]:A.innerText(o)),f.isDefaultContent(o)?e||c.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?ht(c,o):vt(c,o,r)}c.on("keydown",function(t){function e(t){Tt(t)&&!t.isDefaultPrevented()&&f.remove()}if(Tt(t)&&!t.isDefaultPrevented()){if((m=t.shiftKey&&86===t.keyCode)&&v.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),g=(new Date).getTime(),v.ie&&m)return t.preventDefault(),void n(c,!0);f.remove(),f.create(),c.once("keyup",e),c.once("paste",function(){c.off("keyup",e)})}}),c.on("paste",function(t){var e,n,r,o=(new Date).getTime(),i=(e=c,n=yt(t.clipboardData||e.getDoc().dataTransfer),A.isMsEdge()?y.extend(n,{"text/html":""}):n),a=(new Date).getTime()-o,u=(new Date).getTime()-g-a<1e3,s="text"===d.get()||m,l=bt(i,x());m=!1,t.isDefaultPrevented()||(r=t.clipboardData,-1!==navigator.userAgent.indexOf("Android")&&r&&r.items&&0===r.items.length)?f.remove():xt(i)||!wt(c,t,f.getLastRng()||c.selection.getRng())?(u||t.preventDefault(),!v.ie||u&&!t.ieFake||bt(i,"text/html")||(f.create(),c.dom.bind(f.getEl(),"paste",function(t){t.stopPropagation()}),c.getDoc().execCommand("Paste",!1,null),i["text/html"]=f.getHtml()),bt(i,"text/html")?(t.preventDefault(),l||(l=b(i["text/html"])),p(i,u,s,l)):h.setEditorTimeout(c,function(){p(i,u,s,l)},0)):f.remove()})},Dt=function(t){return v.ie&&t.inline?document.body:t.getBody()},Ct=function(e,t,n){var r;Dt(r=e)!==r.getBody()&&e.dom.bind(t,"paste keyup",function(t){Ot(e,n)||e.fire("paste")})},kt=function(t){return t.dom.get("mcepastebin")},St=function(t,e){return e===t},Ot=function(t,e){var n,r=kt(t);return(n=r)&&"mcepastebin"===n.id&&St(e,r.innerHTML)},Rt=function(a){var u=l(null),s="%MCEPASTEBIN%";return{create:function(){return e=u,n=s,o=(t=a).dom,i=t.getBody(),e.set(t.selection.getRng()),r=t.dom.add(Dt(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),(v.ie||v.gecko)&&o.setStyle(r,"left","rtl"===o.getStyle(i,"direction",!0)?65535:-65535),o.bind(r,"beforedeactivate focusin focusout",function(t){t.stopPropagation()}),Ct(t,r,n),r.focus(),void t.selection.select(r,!0);var t,e,n,r,o,i},remove:function(){return function(t,e){if(kt(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)}(a,u)},getEl:function(){return kt(a)},getHtml:function(){return function(n){var e,t,r,o,i,a=function(t,e){t.appendChild(e),n.dom.remove(e,!0)};for(t=y.grep(Dt(n).childNodes,function(t){return"mcepastebin"===t.id}),e=t.shift(),y.each(t,function(t){a(e,t)}),r=(o=n.dom.select("div[id=mcepastebin]",e)).length-1;0<=r;r--)i=n.dom.create("div"),e.insertBefore(i,o[r]),a(i,o[r]);return e?e.innerHTML:""}(a)},getLastRng:function(){return u.get()},isDefault:function(){return Ot(a,s)},isDefaultContent:function(t){return St(s,t)}}},At=function(n,t){var e=Rt(n);return n.on("preInit",function(){return _t(a=n,e,t),void a.parser.addNodeFilter("img",function(t,e,n){var r,o=function(t){t.attr("data-mce-object")||u===v.transparentSrc||t.remove()};if(!a.settings.paste_data_images&&(r=n).data&&!0===r.data.paste)for(var i=t.length;i--;)(u=t[i].attributes.map.src)&&(0===u.indexOf("webkit-fake-url")?o(t[i]):a.settings.allow_html_data_urls||0!==u.indexOf("data:")||o(t[i]))});var a,u}),{pasteFormat:t,pasteHtml:function(t,e){return vt(n,t,e)},pasteText:function(t){return ht(n,t)},pasteImageData:function(t,e){return wt(n,t,e)},getDataTransferItems:yt,hasHtmlOrText:xt,hasContentType:bt}},Et=function(){},Ft=function(t,e,n){if(r=t,!1!==v.iOS||r===undefined||"function"!=typeof r.setData||!0===A.isMsEdge())return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(x(),e),!0}catch(o){return!1}var r},It=function(t,e,n,r){Ft(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)},Mt=function(u){return function(t,e){var n=g(t),r=u.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=u.dom.create("div",{contenteditable:"true"},n);u.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(o),u.dom.add(u.getBody(),r);var i=u.selection.getRng();o.focus();var a=u.dom.createRng();a.selectNodeContents(o),u.selection.setRng(a),setTimeout(function(){u.selection.setRng(i),r.parentNode.removeChild(r),e()},0)}},Bt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},Ht=function(t){return!t.selection.isCollapsed()||!!(e=t).dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody());var e},jt=function(t){var e,n;t.on("cut",(e=t,function(t){Ht(e)&&It(t,Bt(e),Mt(e),function(){setTimeout(function(){e.execCommand("Delete")},0)})})),t.on("copy",(n=t,function(t){Ht(n)&&It(t,Bt(n),Mt(n),Et)}))},Lt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Nt=function(t,e){return Lt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},$t=function(t,e){t.focus(),t.selection.setRng(e)},Wt=function(a,u,s){m.shouldBlockDrop(a)&&a.on("dragend dragover draggesture dragdrop drop drag",function(t){t.preventDefault(),t.stopPropagation()}),m.shouldPasteDataImages(a)||a.on("drop",function(t){var e=t.dataTransfer;e&&e.files&&0<e.files.length&&t.preventDefault()}),a.on("drop",function(t){var e,n;if(n=Nt(a,t),!t.isDefaultPrevented()&&!s.get()){e=u.getDataTransferItems(t.dataTransfer);var r,o=u.hasContentType(e,x());if((u.hasHtmlOrText(e)&&(!(r=e["text/plain"])||0!==r.indexOf("file://"))||!u.pasteImageData(t,n))&&n&&m.shouldFilterDrop(a)){var i=e["mce-internal"]||e["text/html"]||e["text/plain"];i&&(t.preventDefault(),h.setEditorTimeout(a,function(){a.undoManager.transact(function(){e["mce-internal"]&&a.execCommand("Delete"),$t(a,n),i=A.trimHtml(i),e["text/html"]?u.pasteHtml(i,o):u.pasteText(i)})}))}}}),a.on("dragstart",function(t){s.set(!0)}),a.on("dragover dragend",function(t){m.shouldPasteDataImages(a)&&!1===s.get()&&(t.preventDefault(),$t(a,Nt(a,t))),"dragend"===t.type&&s.set(!1)})},zt=function(t){var e=t.plugins.paste,n=m.getPreProcess(t);n&&t.on("PastePreProcess",function(t){n.call(e,e,t)});var r=m.getPostProcess(t);r&&t.on("PastePostProcess",function(t){r.call(e,e,t)})};function Ut(e,n){e.on("PastePreProcess",function(t){t.content=n(e,t.content,t.internal,t.wordContent)})}function Vt(t,e){if(!N.isWordContent(e))return e;var n=[];y.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=A.filter(e,[[r,"$1"]]),e=A.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function qt(t,e,n,r){if(r||n)return e;var l,o=m.getWebkitStyles(t);if(!1===m.shouldRemoveWebKitStyles(t)||"all"===o)return e;if(o&&(l=o.split(/[, ]/)),l){var c=t.dom,f=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(t,e,n,r){var o=c.parseStyle(c.decode(n)),i={};if("none"===l)return e+r;for(var a=0;a<l.length;a++){var u=o[l[a]],s=c.getStyle(f,l[a],!0);/color/.test(l[a])&&(u=c.toHex(u),s=c.toHex(s)),s!==u&&(i[l[a]]=u)}return(i=c.serializeStyle(i,"span"))?e+' style="'+i+'"'+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})}function Kt(n,t){n.$("a",t).find("font,u").each(function(t,e){n.dom.remove(e,!0)})}var Gt=function(t){v.webkit&&Ut(t,qt),v.ie&&(Ut(t,Vt),function r(e,n){e.on("PastePostProcess",function(t){n(e,t.node)})}(t,Kt))},Xt=function(n,r){return function(e){e.setActive("text"===r.pasteFormat.get());var t=function(t){return e.setActive(t.state)};return n.on("PastePlainTextToggle",t),function(){return n.off("PastePlainTextToggle",t)}}},Yt=function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Xt(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Xt(t,e)})};e.add("paste",function(t){if(!1===a(t)){var e=l(!1),n=l(!1),r=l(m.isPasteAsTextEnabled(t)?"text":"html"),o=At(t,r),i=Gt(t);return Yt(t,o),s(t,o,e),zt(t),jt(t),Wt(t,o,n),u(o,i)}}),function ee(){}}();!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(n){n.addCommand("mcePrint",function(){n.getWin().print()})},i=function(n){n.ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:function(){return n.execCommand("mcePrint")}}),n.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:function(){return n.execCommand("mcePrint")}})};n.add("print",function(n){t(n),i(n),n.addShortcut("Meta+P","","mcePrint")}),function r(){}}();!function(){"use strict";var r=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=tinymce.util.Tools.resolve("tinymce.util.Tools");function x(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var t,n,a,o,i,s={findAndReplaceDOMText:function R(e,t,n,r,a){var o,i,m,f,p,g,d=[],c=0;function l(e,t){if(t=t||0,!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");var n=e.index;if(0<t){var r=e[t];if(!r)throw new Error("Invalid capture group");n+=e[0].indexOf(r),e[0]=r}return[n,n+e[0].length,[e[0]]]}if(m=t.ownerDocument,f=a.getBlockElements(),p=a.getWhiteSpaceElements(),g=a.getShortEndedElements(),i=function u(e){var t;if(3===e.nodeType)return e.data;if(p[e.nodeName]&&!f[e.nodeName])return"";if(t="",x(e))return"\n";if((f[e.nodeName]||g[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=u(e),e=e.nextSibling;);return t}(t)){if(e.global)for(;o=e.exec(i);)d.push(l(o,r));else o=i.match(e),d.push(l(o,r));return d.length&&(c=d.length,function h(e,t,n){var r,a,o,i,d=[],c=0,l=e,u=t.shift(),s=0;e:for(;;){if((f[l.nodeName]||g[l.nodeName]||x(l))&&c++,3===l.nodeType&&(!a&&l.length+c>=u[1]?(a=l,i=u[1]-c):r&&d.push(l),!r&&l.length+c>u[0]&&(r=l,o=u[0]-c),c+=l.length),r&&a){if(l=n({startNode:r,startNodeIndex:o,endNode:a,endNodeIndex:i,innerNodes:d,match:u[2],matchIndex:s}),c-=a.length-i,a=r=null,d=[],s++,!(u=t.shift()))break}else if(p[l.nodeName]&&!f[l.nodeName]||!l.firstChild){if(l.nextSibling){l=l.nextSibling;continue}}else if(!x(l)){l=l.firstChild;continue}for(;;){if(l.nextSibling){l=l.nextSibling;break}if(l.parentNode===e)break e;l=l.parentNode}}}(t,d,function s(e){var h;if("function"!=typeof e){var r=e.nodeType?e:m.createElement(e);h=function(e,t){var n=r.cloneNode(!1);return n.setAttribute("data-mce-index",t),e&&n.appendChild(m.createTextNode(e)),n}}else h=e;return function(e){var t,n,r,a=e.startNode,o=e.endNode,i=e.matchIndex;if(a===o){var d=a;r=d.parentNode,0<e.startNodeIndex&&(t=m.createTextNode(d.data.substring(0,e.startNodeIndex)),r.insertBefore(t,d));var c=h(e.match[0],i);return r.insertBefore(c,d),e.endNodeIndex<d.length&&(n=m.createTextNode(d.data.substring(e.endNodeIndex)),r.insertBefore(n,d)),d.parentNode.removeChild(d),c}t=m.createTextNode(a.data.substring(0,e.startNodeIndex)),n=m.createTextNode(o.data.substring(e.endNodeIndex));for(var l=h(a.data.substring(e.startNodeIndex),i),u=0,s=e.innerNodes.length;u<s;++u){var f=e.innerNodes[u],p=h(f.data,i);f.parentNode.replaceChild(p,f)}var g=h(o.data.substring(0,e.endNodeIndex),i);return(r=a.parentNode).insertBefore(t,a),r.insertBefore(l,a),r.removeChild(a),(r=o.parentNode).insertBefore(g,o),r.insertBefore(n,o),r.removeChild(o),g}}(n))),c}}},g=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},h=function(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)},d=function(e,t){var n,r=[];if((n=p.toArray(e.getBody().getElementsByTagName("span"))).length)for(var a=0;a<n.length;a++){var o=g(n[a]);null!==o&&o.length&&o===t.toString()&&r.push(n[a])}return r},f=function(e,t,n){var r=t.get(),a=e.dom;(n=!1!==n)?r++:r--,a.removeClass(d(e,t.get()),"mce-match-marker-selected");var o=d(e,r);return o.length?(a.addClass(d(e,r),"mce-match-marker-selected"),e.selection.scrollIntoView(o[0]),r):-1},m=function(e,t){var n=t.parentNode;e.remove(t),e.isEmpty(n)&&e.remove(n)},v=function(e,t){var n=f(e,t,!0);-1!==n&&t.set(n)},b=function(e,t){var n=f(e,t,!1);-1!==n&&t.set(n)},N=function(e){var t=g(e);return null!==t&&0<t.length},y=function(e,t,n){var r,a,o,i;for(a=p.toArray(e.getBody().getElementsByTagName("span")),r=0;r<a.length;r++){var d=g(a[r]);null!==d&&d.length&&(d===t.get().toString()&&(o||(o=a[r].firstChild),i=a[r].firstChild),h(a[r]))}if(o&&i){var c=e.dom.createRng();return c.setStart(o,0),c.setEnd(i,i.data.length),!1!==n&&e.selection.setRng(c),c}},w=function(e,t){return 0<d(e,t.get()+1).length},C=function(e,t){return 0<d(e,t.get()-1).length},u={done:y,find:function(e,t,n,r,a){n=(n=n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")).replace(/\s/g,"[^\\S\\r\\n]"),n=a?"\\b"+n+"\\b":n;var o,i,d,c,l,u=(o=e,i=t,d=new RegExp(n,r?"g":"gi"),(l=o.dom.create("span",{"data-mce-bogus":1})).className="mce-match-marker",c=o.getBody(),y(o,i,!1),s.findAndReplaceDOMText(d,c,l,!1,o.schema));return u&&(t.set(-1),t.set(f(e,t,!0))),u},next:v,prev:b,replace:function(e,t,n,r,a){var o,i,d,c,l,u,s=t.get();for(r=!1!==r,d=e.getBody(),i=p.grep(p.toArray(d.getElementsByTagName("span")),N),o=0;o<i.length;o++){var f=g(i[o]);if(c=l=parseInt(f,10),a||c===t.get()){for(n.length?(i[o].firstChild.nodeValue=n,h(i[o])):m(e.dom,i[o]);i[++o];){if((c=parseInt(g(i[o]),10))!==l){o--;break}m(e.dom,i[o])}r&&s--}else l>t.get()&&i[o].setAttribute("data-mce-index",l-1)}return t.set(s),r?(u=w(e,t),v(e,t)):(u=C(e,t),b(e,t)),!a&&u},hasNext:w,hasPrev:C},c=function(r,a){return{done:function(e){return u.done(r,a,e)},find:function(e,t,n){return u.find(r,a,e,t,n)},next:function(){return u.next(r,a)},prev:function(){return u.prev(r,a)},replace:function(e,t,n){return u.replace(r,a,e,t,n)}}},l=function(e){return function(){return e}},T=l(!1),k=l(!0),A=function(){return S},S=(o={fold:function(e,t){return e()},is:T,isSome:T,isNone:k,getOr:a=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:a,orThunk:n,map:A,ap:A,each:function(){},bind:A,flatten:A,exists:T,forall:k,filter:A,equals:t=function(e){return e.isNone()},equals_:t,toArray:function(){return[]},toString:l("none()")},Object.freeze&&Object.freeze(o),o),B=(i="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===i}),I=(Array.prototype.slice,B(Array.from)&&Array.from,function(r,a){var e,o={};function i(e){(u.hasNext(r,a)?e.enable:e.disable)("next"),(u.hasPrev(r,a)?e.enable:e.disable)("prev")}r.undoManager.add(),e=p.trim(r.selection.getContent({format:"text"}));var d=function(e,t){!function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)}(["replace","replaceall","prev","next"],t?e.disable:e.enable)};function c(e){r.windowManager.alert("Could not find the specified string.",function(){e.focus("findtext")})}var l=function(e){var t=e.getData();if(!t.findtext.length)return u.done(r,a,!1),d(e,!0),void i(e);if(o.text===t.findtext&&o.caseState===t.matchcase&&o.wholeWord===t.wholewords)return u.hasNext(r,a)?(u.next(r,a),void i(e)):void c(e);var n=u.find(r,a,t.findtext,t.matchcase,t.wholewords);n||c(e),d(e,0===n),i(e),o={text:t.findtext,caseState:t.matchcase,wholeWord:t.wholewords}},t={findtext:e,replacetext:"",matchcase:"unchecked",wholewords:"unchecked"};r.windowManager.open({title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"input",name:"findtext",label:"Find"},{type:"input",name:"replacetext",label:"Replace with"},{type:"grid",columns:2,items:[{type:"checkbox",name:"matchcase",label:"Match case"},{type:"checkbox",name:"wholewords",label:"Find whole words only"}]}]},buttons:[{type:"custom",name:"find",text:"Find",align:"start",primary:!0},{type:"custom",name:"replace",text:"Replace",align:"start",disabled:!0},{type:"custom",name:"replaceall",text:"Replace All",align:"start",disabled:!0},{type:"custom",name:"prev",text:"Previous",align:"end",icon:"arrow-left",disabled:!0},{type:"custom",name:"next",text:"Next",align:"end",icon:"arrow-right",disabled:!0}],initialData:t,onAction:function(e,t){var n=e.getData();switch(t.name){case"find":l(e);break;case"replace":u.replace(r,a,n.replacetext)||(d(e,!0),a.set(-1),o={});break;case"replaceall":u.replace(r,a,n.replacetext,!0,!0),d(e,!0),o={};break;case"prev":u.prev(r,a),i(e);break;case"next":u.next(r,a),i(e)}},onSubmit:l,onClose:function(){r.focus(),u.done(r,a),r.undoManager.add()}})}),E=function(e,t){e.addCommand("SearchReplace",function(){I(e,t)})},O=function(e,t){return function(){I(e,t)}},M=function(e,t){e.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:O(e,t),icon:"search"}),e.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:O(e,t),icon:"search"}),e.shortcuts.add("Meta+F","",O(e,t))};e.add("searchreplace",function(e){var t=r(-1);return E(e,t),M(e,t),c(e,t)}),function D(){}}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.Env"),m=function(e){return e.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i)},y=function(e){return e.getParam("default_link_target","")},o=function(e,t){if(t<0&&(t=0),3===e.nodeType){var n=e.data.length;n<t&&(t=n)}return t},k=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)},p=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)},r=function(e,t,n){var i,o,r,a,f,s,d,l,c,u,g=m(e),h=y(e);if("A"!==e.selection.getNode().tagName){if((i=e.selection.getRng(!0).cloneRange()).startOffset<5){if(!(l=i.endContainer.previousSibling)){if(!i.endContainer.firstChild||!i.endContainer.firstChild.nextSibling)return;l=i.endContainer.firstChild.nextSibling}if(c=l.length,k(i,l,c),p(i,l,c),i.endOffset<5)return;o=i.endOffset,a=l}else{if(3!==(a=i.endContainer).nodeType&&a.firstChild){for(;3!==a.nodeType&&a.firstChild;)a=a.firstChild;3===a.nodeType&&(k(i,a,0),p(i,a,a.nodeValue.length))}o=1===i.endOffset?2:i.endOffset-1-t}for(r=o;k(i,a,2<=o?o-2:0),p(i,a,1<=o?o-1:0),o-=1," "!==(u=i.toString())&&""!==u&&160!==u.charCodeAt(0)&&0<=o-2&&u!==n;);var C;(C=i.toString())===n||" "===C||160===C.charCodeAt(0)?(k(i,a,o),p(i,a,r),o+=1):(0===i.startOffset?k(i,a,0):k(i,a,o),p(i,a,r)),"."===(s=i.toString()).charAt(s.length-1)&&p(i,a,r-1),(d=(s=i.toString().trim()).match(g))&&("www."===d[1]?d[1]="http://www.":/@$/.test(d[1])&&!/^mailto:/.test(d[1])&&(d[1]="mailto:"+d[1]),f=e.selection.getBookmark(),e.selection.setRng(i),e.execCommand("createlink",!1,d[1]+d[2]),h&&e.dom.setAttrib(e.selection.getNode(),"target",h),e.selection.moveToBookmark(f),e.nodeChanged())}},t=function(t){var n;t.on("keydown",function(e){13!==e.keyCode||r(t,-1,"")}),i.ie?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){41!==e.keyCode||r(t,-1,"(")}),t.on("keyup",function(e){32!==e.keyCode||r(t,0,"")}))};e.add("autolink",function(e){t(e)}),function n(){}}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(t,n){var e,i=t.dom,o=t.selection.getSelectedBlocks();o.length&&(e=i.getAttrib(o[0],"dir"),c.each(o,function(t){i.getParent(t.parentNode,'*[dir="'+n+'"]',i.getRoot())||i.setAttrib(t,"dir",e!==n?n:null)}),t.nodeChanged())},e=function(t){t.addCommand("mceDirectionLTR",function(){n(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){n(t,"rtl")})},i=function(n){var e=[];return c.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(t){e.push(t+"[dir="+n+"]")}),e.join(",")},o=function(n){n.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return n.execCommand("mceDirectionLTR")},onSetup:function(t){return n.selection.selectorChangedWithUnbind(i("ltr"),t.setActive).unbind}}),n.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return n.execCommand("mceDirectionRTL")},onSetup:function(t){return n.selection.selectorChangedWithUnbind(i("rtl"),t.setActive).unbind}})};t.add("directionality",function(t){e(t),o(t)}),function r(){}}();!function(){"use strict";var e=function(t){var n=t,o=function(){return n};return{get:o,set:function(t){n=t},clone:function(){return e(o())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t,n){t.fire("VisualBlocks",{state:n})},u=function(t,n,o){t.dom.toggleClass(t.getBody(),"mce-visualblocks"),o.set(!o.get()),i(t,o.get())},c=function(t,n,o){t.addCommand("mceVisualBlocks",function(){u(t,n,o)})},s=function(t){return t.getParam("visualblocks_default_state",!1,"boolean")},r=function(n,t,o){n.on("PreviewFormats AfterPreviewFormats",function(t){o.get()&&n.dom.toggleClass(n.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)}),n.on("init",function(){s(n)&&u(n,t,o)}),n.on("remove",function(){n.dom.removeClass(n.getBody(),"mce-visualblocks")})},o=function(o,e){return function(n){n.setActive(e.get());var t=function(t){return n.setActive(t.state)};return o.on("VisualBlocks",t),function(){return o.off("VisualBlocks",t)}}},a=function(t,n){t.ui.registry.addToggleButton("visualblocks",{icon:"paragraph",tooltip:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:o(t,n)}),t.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:o(t,n)})};t.add("visualblocks",function(t,n){var o=e(!1);c(t,n,o),a(t,o),r(t,n,o)}),function n(){}}();!function(){"use strict";var n,e,r,t,o,u,i=function(n){var e=n,r=function(){return e};return{get:r,set:function(n){e=n},clone:function(){return i(r())}}},c=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(n){return{isEnabled:function(){return n.get()}}},f=function(n,e){return n.fire("VisualChars",{state:e})},l={"\xa0":"nbsp","\xad":"shy"},s=function(n,e){var r,t="";for(r in n)t+=r;return new RegExp("["+t+"]",e?"g":"")},d=function(n){var e,r="";for(e in n)r&&(r+=","),r+="span.mce-"+n[e];return r},m={charMap:l,regExp:s(l),regExpGlobal:s(l,!0),selector:d(l),charMapToRegExp:s,charMapToSelector:d},N=function(n){return function(){return n}},g=N(!1),E=N(!0),h=g,p=E,T=function(){return v},v=(t={fold:function(n,e){return n()},is:h,isSome:h,isNone:p,getOr:r=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:e,map:T,ap:T,each:function(){},bind:T,flatten:T,exists:h,forall:p,filter:T,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:N("none()")},Object.freeze&&Object.freeze(t),t),O=function(r){var n=function(){return r},e=function(){return o},t=function(n){return n(r)},o={fold:function(n,e){return e(r)},is:function(n){return r===n},isSome:p,isNone:h,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return O(n(r))},ap:function(n){return n.fold(T,function(n){return O(n(r))})},each:function(n){n(r)},bind:t,flatten:n,exists:t,forall:t,filter:function(n){return n(r)?o:v},equals:function(n){return n.is(r)},equals_:function(n,e){return n.fold(h,function(n){return e(r,n)})},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return o},y=function(n){return null===n||n===undefined?v:O(n)},D=(o="function",function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&Array.prototype.isPrototypeOf(n)?"array":"object"===e&&String.prototype.isPrototypeOf(n)?"string":e}(n)===o}),C=function(n,e){for(var r=0,t=n.length;r<t;r++)e(n[r],r,n)},_=(Array.prototype.slice,D(Array.from)&&Array.from,function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:N(n)}}),M={fromHtml:function(n,e){var r=(e||document).createElement("div");if(r.innerHTML=n,!r.hasChildNodes()||1<r.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return _(r.childNodes[0])},fromTag:function(n,e){var r=(e||document).createElement(n);return _(r)},fromText:function(n,e){var r=(e||document).createTextNode(n);return _(r)},fromDom:_,fromPoint:function(n,e,r){var t=n.dom();return y(t.elementFromPoint(e,r)).map(_)}},A=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE,Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE,Node.TEXT_NODE),b=(Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,function(n){return n.dom().nodeValue}),S=(u=A,function(n){return n.dom().nodeType===u}),k=function(n){return'<span data-mce-bogus="1" class="mce-'+m.charMap[n]+'">'+n+"</span>"},x=function(n,e){var r=[],t=function(n,e){for(var r=n.length,t=new Array(r),o=0;o<r;o++){var u=n[o];t[o]=e(u,o,n)}return t}(n.dom().childNodes,M.fromDom);return C(t,function(n){e(n)&&(r=r.concat([n])),r=r.concat(x(n,e))}),r},w={isMatch:function(n){return S(n)&&b(n)!==undefined&&m.regExp.test(b(n))},filterDescendants:x,findParentElm:function(n,e){for(;n.parentNode;){if(n.parentNode===e)return n;n=n.parentNode}},replaceWithSpans:function(n){return n.replace(m.regExpGlobal,k)}},I=function(r,n){var t,o,e=w.filterDescendants(M.fromDom(n),w.isMatch);C(e,function(n){var e=w.replaceWithSpans(b(n));for(o=r.dom.create("div",null,e);t=o.lastChild;)r.dom.insertAfter(t,n.dom());r.dom.remove(n.dom())})},P=function(e,n){var r=e.dom.select(m.selector,n);C(r,function(n){e.dom.remove(n,1)})},B=I,R=P,U=function(n){var e=n.getBody(),r=n.selection.getBookmark(),t=w.findParentElm(n.selection.getNode(),e);t=t!==undefined?t:e,P(n,t),I(n,t),n.selection.moveToBookmark(r)},V=function(n,e){var r,t=n.getBody(),o=n.selection;e.set(!e.get()),f(n,e.get()),r=o.getBookmark(),!0===e.get()?B(n,t):R(n,t),o.moveToBookmark(r)},j=function(n,e){n.addCommand("mceVisualChars",function(){V(n,e)})},q=tinymce.util.Tools.resolve("tinymce.util.Delay"),G=function(e,r){var t=q.debounce(function(){U(e)},300);!1!==e.settings.forced_root_block&&e.on("keydown",function(n){!0===r.get()&&(13===n.keyCode?U(e):t())})},H=function(r,t){return function(e){e.setActive(t.get());var n=function(n){return e.setActive(n.state)};return r.on("VisualChars",n),function(){return r.off("VisualChars",n)}}};c.add("visualchars",function(n){var e,r,t=i(!1);return j(n,t),r=t,(e=n).ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"paragraph",onAction:function(){return e.execCommand("mceVisualChars")},onSetup:H(e,r)}),e.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",onAction:function(){return e.execCommand("mceVisualChars")},onSetup:H(e,r)}),G(n,t),a(t)}),function L(){}}();!function(){"use strict";var e,n,t,r,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]},h=function(e){return function(){return e}},a=function(e){return e},u=h(!1),s=h(!0),c=u,l=s,f=function(){return d},d=(r={fold:function(e,n){return e()},is:c,isSome:c,isNone:l,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:t,orThunk:n,map:f,ap:f,each:function(){},bind:f,flatten:f,exists:c,forall:l,filter:f,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:h("none()")},Object.freeze&&Object.freeze(r),r),m=function(t){var e=function(){return t},n=function(){return i},r=function(e){return e(t)},i={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:l,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return m(e(t))},ap:function(e){return e.fold(f,function(e){return m(e(t))})},each:function(e){e(t)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(t)?i:d},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,function(e){return n(t,e)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return i},y={some:m,none:f,from:function(e){return null===e||e===undefined?d:m(e)}},g=function(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&Array.prototype.isPrototypeOf(e)?"array":"object"===n&&String.prototype.isPrototypeOf(e)?"string":n}(e)===n}},w=g("string"),p=g("object"),v=g("function"),b=g("number"),O=function(e,n){for(var t=0,r=e.length;t<r;t++)n(e[t],t,e)},S=Array.prototype.push,N=function(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!Array.prototype.isPrototypeOf(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);S.apply(n,e[t])}return n},x=(Array.prototype.slice,v(Array.from)&&Array.from,function(){return(x=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e}).apply(this,arguments)}),T=function(e){var t=y.none(),n=[],r=function(e){i()?a(e):n.push(e)},i=function(){return t.isSome()},o=function(e){O(e,a)},a=function(n){t.each(function(e){setTimeout(function(){n(e)},0)})};return e(function(e){t=y.some(e),o(n),n=[]}),{get:r,map:function(t){return T(function(n){r(function(e){n(t(e))})})},isReady:i}},E={nu:T,pure:function(n){return T(function(e){e(n)})}},D=function(n){var e=function(e){var r;n((r=e,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=this;setTimeout(function(){r.apply(t,e)},0)}))},t=function(){return E.nu(e)};return{map:function(r){return D(function(t){e(function(e){var n=r(e);t(n)})})},bind:function(t){return D(function(n){e(function(e){t(e).get(n)})})},anonBind:function(t){return D(function(n){e(function(e){t.get(n)})})},toLazy:t,toCached:function(){var n=null;return D(function(e){null===n&&(n=t()),n.get(e)})},get:e}},A={nu:D,pure:function(n){return D(function(e){e(n)})}},C=function(t){return{is:function(e){return t===e},isValue:s,isError:u,getOr:h(t),getOrThunk:h(t),getOrDie:h(t),or:function(e){return C(t)},orThunk:function(e){return C(t)},fold:function(e,n){return n(t)},map:function(e){return C(e(t))},mapError:function(e){return C(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOption:function(){return y.some(t)}}},_=function(t){return{is:u,isValue:u,isError:s,getOr:a,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(t),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,n){return e(t)},map:function(e){return _(t)},mapError:function(e){return _(e(t))},each:o,bind:function(e){return _(t)},exists:u,forall:s,toOption:y.none}},I={value:C,error:_},R=function(o){return x({},o,{toCached:function(){return R(o.toCached())},bindFuture:function(n){return R(o.bind(function(e){return e.fold(function(e){return A.pure(I.error(e))},function(e){return n(e)})}))},bindResult:function(n){return R(o.map(function(e){return e.bind(n)}))},mapResult:function(n){return R(o.map(function(e){return e.map(n)}))},mapError:function(n){return R(o.map(function(e){return e.mapError(n)}))},foldResult:function(n,t){return o.map(function(e){return e.fold(n,t)})},withTimeout:function(e,i){return R(A.nu(function(n){var t=!1,r=window.setTimeout(function(){t=!0,n(I.error(i()))},e);o.get(function(e){t||(window.clearTimeout(r),n(e))})}))}})},L=function(e){return R(A.nu(e))},U=L,P=Object.prototype.hasOwnProperty,k=function(a){return function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<e.length;r++){var i=e[r];for(var o in i)P.call(i,o)&&(t[o]=a(t[o],i[o]))}return t}},M=k(function(e,n){return p(e)&&p(n)?M(e,n):n}),j=k(function(e,n){return n}),z="undefined"!=typeof window?window:Function("return this;")(),B=function(e,n){return function(e,n){for(var t=n!==undefined&&null!==n?n:z,r=0;r<e.length&&t!==undefined&&null!==t;++r)t=t[e[r]];return t}(e.split("."),n)},F={getOrDie:function(e,n){var t=B(e,n);if(t===undefined||null===t)throw e+" not available on this browser";return t}},H=function(){return F.getOrDie("URL")},W=function(e){return H().createObjectURL(e)},G=function(e){H().revokeObjectURL(e)},X=function(e){var n=e.imageList.map(function(e){return{name:"images",type:"selectbox",label:"Image list",items:e}}),t=e.classList.map(function(e){return{name:"classes",type:"selectbox",label:"Class",items:e}});return N([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],n.toArray(),e.hasDescription?[{name:"alt",type:"input",label:"Image description"}]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{type:"grid",columns:2,items:N([t.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]])},$=function(e){return{title:"General",type:"form",items:X(e)}},q=X,V=tinymce.util.Tools.resolve("tinymce.util.Promise"),J=tinymce.util.Tools.resolve("tinymce.util.Tools"),Y=tinymce.util.Tools.resolve("tinymce.util.XHR"),Z=function(e){return!1!==e.settings.image_dimensions},K=function(e){return!0===e.settings.image_advtab},Q=function(e){return e.getParam("image_prepend_url","")},ee=function(e){return e.getParam("image_class_list")},ne=function(e){return!1!==e.settings.image_description},te=function(e){return!0===e.settings.image_title},re=function(e){return!0===e.settings.image_caption},ie=function(e){return e.getParam("image_list",!1)},oe=function(e){return!!e.getParam("images_upload_url",!1)},ae=function(e){return!!e.getParam("images_upload_handler",!1)},ue=function(e){return e.getParam("images_upload_url")},se=function(e){return e.getParam("images_upload_handler")},ce=function(e){return e.getParam("images_upload_base_path")},le=function(e){return e.getParam("images_upload_credentials")},fe=function(e,n){return Math.max(parseInt(e,10),parseInt(n,10))},de=function(e,n){var t=document.createElement("img");function r(e){t.parentNode&&t.parentNode.removeChild(t),n(e)}t.onload=function(){var e={width:fe(t.width,t.clientWidth),height:fe(t.height,t.clientHeight)};r(I.value(e))},t.onerror=function(){r(I.error(undefined))};var i=t.style;i.visibility="hidden",i.position="fixed",i.bottom=i.left="0px",i.width=i.height="auto",document.body.appendChild(t),t.src=e},me=function(e){return e&&(e=e.replace(/px$/,"")),e},ge=function(e){return 0<e.length&&/^[0-9]+$/.test(e)&&(e+="px"),e},pe=function(e){if(e.margin){var n=String(e.margin).split(" ");switch(n.length){case 1:e["margin-top"]=e["margin-top"]||n[0],e["margin-right"]=e["margin-right"]||n[0],e["margin-bottom"]=e["margin-bottom"]||n[0],e["margin-left"]=e["margin-left"]||n[0];break;case 2:e["margin-top"]=e["margin-top"]||n[0],e["margin-right"]=e["margin-right"]||n[1],e["margin-bottom"]=e["margin-bottom"]||n[0],e["margin-left"]=e["margin-left"]||n[1];break;case 3:e["margin-top"]=e["margin-top"]||n[0],e["margin-right"]=e["margin-right"]||n[1],e["margin-bottom"]=e["margin-bottom"]||n[2],e["margin-left"]=e["margin-left"]||n[1];break;case 4:e["margin-top"]=e["margin-top"]||n[0],e["margin-right"]=e["margin-right"]||n[1],e["margin-bottom"]=e["margin-bottom"]||n[2],e["margin-left"]=e["margin-left"]||n[3]}delete e.margin}return e},he=function(e,n){var t=ie(e);"string"==typeof t?Y.send({url:t,success:function(e){n(JSON.parse(e))}}):"function"==typeof t?t(n):n(t)},ve=function(e,n,t){function r(){t.onload=t.onerror=null,e.selection&&(e.selection.select(t),e.nodeChanged())}t.onload=function(){n.width||n.height||!Z(e)||e.dom.setAttribs(t,{width:t.clientWidth,height:t.clientHeight}),r()},t.onerror=r},be=function(i){return new V(function(e,n){var t=function r(){return new(F.getOrDie("FileReader"))}();t.onload=function(){e(t.result)},t.onerror=function(){n(t.error.message)},t.readAsDataURL(i)})},ye=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils").DOM,we=function(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?me(e.style.marginLeft):""},Oe=function(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?me(e.style.marginTop):""},Se=function(e){return e.style.borderWidth?me(e.style.borderWidth):""},Ne=function(e,n){return e.hasAttribute(n)?e.getAttribute(n):""},xe=function(e,n){return e.style[n]?e.style[n]:""},Te=function(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName},Ee=function(e,n,t){e.setAttribute(n,t)},De=function(e){var n,t,r,i;Te(e)?(i=(r=e).parentNode,ye.insertAfter(r,i),ye.remove(i)):(n=e,t=ye.create("figure",{"class":"image"}),ye.insertAfter(t,n),t.appendChild(n),t.appendChild(ye.create("figcaption",{contentEditable:!0},"Caption")),t.contentEditable="false")},Ae=function(e,n){var t=e.getAttribute("style"),r=n(null!==t?t:"");0<r.length?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")},Ce=function(e,r){return function(e,n,t){e.style[n]?(e.style[n]=ge(t),Ae(e,r)):Ee(e,n,t)}},_e=function(e,n){return e.style[n]?me(e.style[n]):Ne(e,n)},Ie=function(e,n){var t=ge(n);e.style.marginLeft=t,e.style.marginRight=t},Re=function(e,n){var t=ge(n);e.style.marginTop=t,e.style.marginBottom=t},Le=function(e,n){var t=ge(n);e.style.borderWidth=t},Ue=function(e,n){e.style.borderStyle=n},Pe=function(e){return"FIGURE"===e.nodeName},ke=function(e,n){var t=document.createElement("img");return Ee(t,"style",n.style),(we(t)||""!==n.hspace)&&Ie(t,n.hspace),(Oe(t)||""!==n.vspace)&&Re(t,n.vspace),(Se(t)||""!==n.border)&&Le(t,n.border),(xe(t,"borderStyle")||""!==n.borderStyle)&&Ue(t,n.borderStyle),e(t.getAttribute("style"))},Me=function(e,n){return{src:Ne(n,"src"),alt:Ne(n,"alt"),title:Ne(n,"title"),width:_e(n,"width"),height:_e(n,"height"),"class":Ne(n,"class"),style:e(Ne(n,"style")),caption:Te(n),hspace:we(n),vspace:Oe(n),border:Se(n),borderStyle:xe(n,"borderStyle")}},je=function(e,n,t,r,i){t[r]!==n[r]&&i(e,r,t[r])},ze=function(r,i){return function(e,n,t){r(e,t),Ae(e,i)}},Be=function(e,n,t){var r=Me(e,t);je(t,r,n,"caption",function(e,n,t){return De(e)}),je(t,r,n,"src",Ee),je(t,r,n,"alt",Ee),je(t,r,n,"title",Ee),je(t,r,n,"width",Ce(0,e)),je(t,r,n,"height",Ce(0,e)),je(t,r,n,"class",Ee),je(t,r,n,"style",ze(function(e,n){return Ee(e,"style",n)},e)),je(t,r,n,"hspace",ze(Ie,e)),je(t,r,n,"vspace",ze(Re,e)),je(t,r,n,"border",ze(Le,e)),je(t,r,n,"borderStyle",ze(Ue,e))},Fe=function(e,n){var t=e.dom.styles.parse(n),r=pe(t),i=e.dom.styles.parse(e.dom.styles.serialize(r));return e.dom.styles.serialize(i)},He=function(e){var n=e.selection.getNode(),t=e.dom.getParent(n,"figure.image");return t?e.dom.select("img",t)[0]:n&&("IMG"!==n.nodeName||n.getAttribute("data-mce-object")||n.getAttribute("data-mce-placeholder"))?null:n},We=function(n,e){var t=n.dom,r=t.getParent(e.parentNode,function(e){return n.schema.getTextBlockElements()[e.nodeName]},n.getBody());return r?t.split(r,e):e},Ge=function(n,e){var t=function(e,n){var t=document.createElement("img");if(Be(e,j(n,{caption:!1}),t),Ee(t,"alt",n.alt),n.caption){var r=ye.create("figure",{"class":"image"});return r.appendChild(t),r.appendChild(ye.create("figcaption",{contentEditable:!0},"Caption")),r.contentEditable="false",r}return t}(function(e){return Fe(n,e)},e);n.dom.setAttrib(t,"data-mce-id","__mcenew"),n.focus(),n.selection.setContent(t.outerHTML);var r=n.dom.select('*[data-mce-id="__mcenew"]')[0];if(n.dom.setAttrib(r,"data-mce-id",null),Pe(r)){var i=We(n,r);n.selection.select(i)}else n.selection.select(r)},Xe=function(e,n){var t=He(e);t?n.src?function(n,e){var t,r=He(n);if(Be(function(e){return Fe(n,e)},e,r),t=r,n.dom.setAttrib(t,"src",t.getAttribute("src")),Pe(r.parentNode)){var i=r.parentNode;We(n,i),n.selection.select(r.parentNode)}else n.selection.select(r),ve(n,e,r)}(e,n):function(e,n){if(n){var t=e.dom.is(n.parentNode,"figure.image")?n.parentNode:n;e.dom.remove(t),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}}(e,t):n.src&&Ge(e,n)},$e=function(e){return w(e.value)?e.value:""},qe=function(e,i){var o=[];return J.each(e,function(e){var n=w(e.text)?e.text:w(e.title)?e.title:"";if(e.menu!==undefined){var t=qe(e.menu,i);o.push({text:n,items:t})}else{var r=i(e);o.push({text:n,value:r})}}),o},Ve=function(n){return void 0===n&&(n=$e),function(e){return e?y.from(e).map(function(e){return qe(e,n)}):y.none()}},Je=function(e,t){return function(e,n){for(var t=0;t<e.length;t++){var r=n(e[t],t);if(r.isSome())return r}return y.none()}(e,function(e){return n=e,Object.prototype.hasOwnProperty.call(n,"items")?Je(e.items,t):e.value===t?y.some(e):y.none();var n})},Ye=Ve,Ze=function(e){return Ve($e)(e)},Ke=function(e,n){return e.bind(function(e){return Je(e,n)})},Qe=function(){};function en(u){var n=function(e,r,i,n){var o,t;(o=function a(){return new(F.getOrDie("XMLHttpRequest"))}()).open("POST",u.url),o.withCredentials=u.credentials,o.upload.onprogress=function(e){n(e.loaded/e.total*100)},o.onerror=function(){i("Image upload failed due to a XHR Transport error. Code: "+o.status)},o.onload=function(){var e,n,t;o.status<200||300<=o.status?i("HTTP Error: "+o.status):(e=JSON.parse(o.responseText))&&"string"==typeof e.location?r((n=u.basePath,t=e.location,n?n.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t)):i("Invalid JSON: "+o.responseText)},(t=new FormData).append("file",e.blob(),e.filename()),o.send(t)};return u=J.extend({credentials:!1,handler:n},u),{upload:function(e){return u.url||u.handler!==n?(r=e,i=u.handler,new V(function(e,n){try{i(r,e,n,Qe)}catch(t){n(t.message)}})):V.reject("Upload url missing from the settings.");var r,i}}}var nn,tn,rn,on=function(e){return{title:"Advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace"},{type:"input",label:"Horizontal space",name:"hspace"},{type:"input",label:"Border width",name:"border"},{type:"selectbox",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"}]}]}]}},an=function(t){var n,e,r=Ye(function(e){return t.convertURL(e.value||e.url,"src")}),i=A.nu(function(n){he(t,function(e){n(r(e).map(function(e){return N([[{text:"None",value:""}],e])}))})}),o=Ze(ee(t)),a=K(t),u=oe(t),s=ae(t),c=(e=He(n=t))?Me(function(e){return Fe(n,e)},e):{src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""},l=ne(t),f=te(t),d=Z(t),m=re(t),g=ue(t),p=ce(t),h=le(t),v=se(t),b=y.some(Q(t)).filter(function(e){return w(e)&&0<e.length});return i.map(function(e){return{image:c,imageList:e,classList:o,hasAdvTab:a,hasUploadUrl:u,hasUploadHandler:s,hasDescription:l,hasImageTitle:f,hasDimensions:d,hasImageCaption:m,url:g,basePath:p,credentials:h,handler:v,prependURL:b}})},un=function(e){return{title:"Upload",type:"form",items:[{type:"dropzone",name:"fileinput",flex:!0}]}},sn=function(e){return{src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e["class"],caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[]}},cn=function(e){return{src:e.src.value,alt:e.alt,title:e.title,width:e.dimensions.width,height:e.dimensions.height,"class":e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle}},ln=function(e,n){var t,r,i=n.getData();(t=e,r=i.src.value,/^(?:[a-zA-Z]+:)?\/\//.test(r)?y.none():t.prependURL.bind(function(e){return r.substring(0,e.length)!==e?y.some(e+r):y.none()})).each(function(e){n.setData({src:{value:e,meta:i.src.meta}})})},fn=function(e,n){(function(e,n){var t=n.src.meta;if(t===undefined)return y.none();var r=M({},n);return e.hasDescription&&w(t.alt)&&(r.alt=t.alt),e.hasImageTitle&&w(t.title)&&(r.title=t.title),e.hasDimensions&&(w(t.width)&&(r.dimensions.width=t.width),w(t.height)&&(r.dimensions.height=t.height)),w(t["class"])&&Ke(e.classList,t["class"]).each(function(e){r.classes=e.value}),e.hasAdvTab&&(w(t.vspace)&&(r.vspace=t.vspace),w(t.border)&&(r.border=t.border),w(t.hspace)&&(r.hspace=t.hspace),w(t.borderstyle)&&(r.borderstyle=t.borderstyle)),y.some(r)})(e,n.getData()).each(function(e){return n.setData(e)})},dn=function(e,n,t,r){var i,o,a,u,s,c,l,f,d,m,g,p;ln(n,r),fn(n,r),i=e,o=n,a=t,s=(u=r).getData(),c=s.src.value,(l=s.src.meta||{}).width||l.height||!o.hasDimensions||i.imageSize(c).get(function(e){e.each(function(e){a.open&&u.setData({dimensions:e})})}),f=n,d=t,g=(m=r).getData(),p=Ke(f.imageList,g.src.value),d.prevImage=p,m.setData({images:p.map(function(e){return e.value}).getOr("")})},mn=function(e,n,t){var r,i,o,a,u,s=pe(e(t.style)),c=M({},t);return c.vspace=(r=s)["margin-top"]&&r["margin-bottom"]&&r["margin-top"]===r["margin-bottom"]?me(String(r["margin-top"])):"",c.hspace=(i=s)["margin-right"]&&i["margin-left"]&&i["margin-right"]===i["margin-left"]?me(String(i["margin-right"])):"",c.border=(o=s)["border-width"]?me(String(o["border-width"])):"",c.borderstyle=(a=s)["border-style"]?String(a["border-style"]):"",c.style=(u=n)(e(u(s))),c},gn=function(h,v,b){return function(e,n){var t,r,i,o,a,u,s,c,l,f,d,m,g,p;"src"===n.name?dn(h,v,b,e):"images"===n.name?(l=h,f=v,d=b,g=(m=e).getData(),(p=Ke(f.imageList,g.images)).each(function(e){""===g.alt||d.prevImage.map(function(e){return e.text===g.alt}).getOr(!1)?""===e.value?m.setData({src:e,alt:d.prevAlt}):m.setData({src:e,alt:e.text}):m.setData({src:e})}),d.prevImage=p,dn(l,f,d,m)):"alt"===n.name?b.prevAlt=e.getData().alt:"style"===n.name?(a=h,s=(u=e).getData(),c=mn(a.parseStyle,a.serializeStyle,s),u.setData(c)):"vspace"===n.name||"hspace"===n.name||"border"===n.name||"borderstyle"===n.name?(t=h,r=e,i=M(sn(v.image),r.getData()),o=ke(t.normalizeCss,cn(i)),r.setData({style:o})):"fileinput"===n.name&&function(t,r,i,o){var e=o.getData();o.block("Uploading image");var a=e.fileinput[0],u=W(a),s=en({url:r.url,basePath:r.basePath,credentials:r.credentials,handler:r.handler}),c=function(){o.unblock(),G(u)};be(a).then(function(e){var n=t.createBlobCache(a,u,e);s.upload(n).then(function(e){o.setData({src:{value:e,meta:{}}}),o.showTab("General"),dn(t,r,i,o),c()})["catch"](function(e){c(),t.alertErr(o,e)})})}(h,v,b,e)}},pn=function(o){return function(e){var n,t,r,i={prevImage:Ke((n=e).imageList,n.image.src),prevAlt:n.image.alt,open:!0};return{title:"Insert/Edit Image",size:"normal",body:(r=e,r.hasAdvTab||r.hasUploadUrl||r.hasUploadHandler?{type:"tabpanel",tabs:N([[$(r)],r.hasAdvTab?[on(r)]:[],r.hasUploadUrl||r.hasUploadHandler?[un(r)]:[]])}:{type:"panel",items:q(r)}),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:sn(e.image),onSubmit:o.onSubmit(e),onChange:gn(o,e,i),onClose:(t=i,function(){t.open=!1})}}},hn=function(n){var t,r,i,o,a,u,s,e={onSubmit:(s=n,function(t){return function(e){var n=M(sn(t.image),e.getData());s.undoManager.transact(function(){Xe(s,cn(n))}),s.editorUpload.uploadImagesAuto(),e.close()}}),imageSize:(u=n,function(e){return U(function(t){de(u.documentBaseURI.toAbsolute(e),function(e){var n=e.bind(function(e){return(w(e.width)||b(e.width))&&(w(e.height)||b(e.height))?I.value({width:String(e.width),height:String(e.height)}):I.error(undefined)});t(n)})})}),createBlobCache:(a=n,function(e,n,t){return a.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,base64:t.split(",")[1]})}),alertErr:(o=n,function(e,n){o.windowManager.alert(n,e.close)}),normalizeCss:(i=n,function(e){return Fe(i,e)}),parseStyle:(r=n,function(e){return r.dom.parseStyle(e)}),serializeStyle:(t=n,function(e,n){return t.dom.serializeStyle(e,n)})};return{open:function(){return an(n).map(pn(e)).get(function(e){n.windowManager.open(e)})}}},vn=function(e){e.addCommand("mceImage",hn(e).open)},bn=function(o){return function(e){for(var n,t,r=e.length,i=function(e){e.attr("contenteditable",o?"true":null)};r--;)n=e[r],(t=n.attr("class"))&&/\bimage\b/.test(t)&&(n.attr("contenteditable",o?"false":null),J.each(n.getAll("figcaption"),i))}},yn=function(e){e.on("preInit",function(){e.parser.addNodeFilter("figure",bn(!0)),e.serializer.addNodeFilter("figure",bn(!1))})},wn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:h(e)}},On={fromHtml:function(e,n){var t=(n||document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return wn(t.childNodes[0])},fromTag:function(e,n){var t=(n||document).createElement(e);return wn(t)},fromText:function(e,n){var t=(n||document).createTextNode(e);return wn(t)},fromDom:wn,fromPoint:function(e,n,t){var r=e.dom();return y.from(r.elementFromPoint(n,t)).map(wn)}},Sn=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE,Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE,Node.TEXT_NODE,Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,function(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};var r=function(e){return Number(n.replace(t,"$"+e))};return xn(r(1),r(2))}),Nn=function(){return xn(0,0)},xn=function(e,n){return{major:e,minor:n}},Tn={nu:xn,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?Nn():Sn(e,t)},unknown:Nn},En="Firefox",Dn=function(e,n){return function(){return n===e}},An=function(e){var n=e.current;return{current:n,version:e.version,isEdge:Dn("Edge",n),isChrome:Dn("Chrome",n),isIE:Dn("IE",n),isOpera:Dn("Opera",n),isFirefox:Dn(En,n),isSafari:Dn("Safari",n)}},Cn={unknown:function(){return An({current:undefined,version:Tn.unknown()})},nu:An,edge:h("Edge"),chrome:h("Chrome"),ie:h("IE"),opera:h("Opera"),firefox:h(En),safari:h("Safari")},_n="Windows",In="Android",Rn="Solaris",Ln="FreeBSD",Un=function(e,n){return function(){return n===e}},Pn=function(e){var n=e.current;return{current:n,version:e.version,isWindows:Un(_n,n),isiOS:Un("iOS",n),isAndroid:Un(In,n),isOSX:Un("OSX",n),isLinux:Un("Linux",n),isSolaris:Un(Rn,n),isFreeBSD:Un(Ln,n)}},kn={unknown:function(){return Pn({current:undefined,version:Tn.unknown()})},nu:Pn,windows:h(_n),ios:h("iOS"),android:h(In),linux:h("Linux"),osx:h("OSX"),solaris:h(Rn),freebsd:h(Ln)},Mn=function(e,n){var t=String(n).toLowerCase();return function(e,n){for(var t=0,r=e.length;t<r;t++){var i=e[t];if(n(i,t,e))return y.some(i)}return y.none()}(e,function(e){return e.search(t)})},jn=function(e,t){return Mn(e,t).map(function(e){var n=Tn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},zn=function(e,t){return Mn(e,t).map(function(e){var n=Tn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Bn=function(e,n){return-1!==e.indexOf(n)},Fn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Hn=function(n){return function(e){return Bn(e,n)}},Wn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Bn(e,"edge/")&&Bn(e,"chrome")&&Bn(e,"safari")&&Bn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Fn],search:function(e){return Bn(e,"chrome")&&!Bn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Bn(e,"msie")||Bn(e,"trident")}},{name:"Opera",versionRegexes:[Fn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Hn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Hn("firefox")},{name:"Safari",versionRegexes:[Fn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Bn(e,"safari")||Bn(e,"mobile/"))&&Bn(e,"applewebkit")}}],Gn=[{name:"Windows",search:Hn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Bn(e,"iphone")||Bn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Hn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Hn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Hn("linux"),versionRegexes:[]},{name:"Solaris",search:Hn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Hn("freebsd"),versionRegexes:[]}],Xn={browsers:h(Wn),oses:h(Gn)},$n=function(e){var n,t,r,i,o,a,u,s,c,l,f,d=Xn.browsers(),m=Xn.oses(),g=jn(d,e).fold(Cn.unknown,Cn.nu),p=zn(m,e).fold(kn.unknown,kn.nu);return{browser:g,os:p,deviceType:(t=g,r=e,i=(n=p).isiOS()&&!0===/ipad/i.test(r),o=n.isiOS()&&!i,a=n.isAndroid()&&3===n.version.major,u=n.isAndroid()&&4===n.version.major,s=i||a||u&&!0===/mobile/i.test(r),c=n.isiOS()||n.isAndroid(),l=c&&!s,f=t.isSafari()&&n.isiOS()&&!1===/safari/i.test(r),{isiPad:h(i),isiPhone:h(o),isTablet:h(s),isPhone:h(l),isTouch:h(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:h(f)})}},qn=((nn=function(){var e=navigator.userAgent;return $n(e)},rn=!1,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return rn||(rn=!0,tn=nn.apply(null,e)),tn}()).browser.isIE(),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]}("element","offset"),function(o){o.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:hn(o).open,onSetup:function(e){return o.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),o.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:hn(o).open}),o.ui.registry.addContextMenu("image",{update:function(e){return Pe(e)||"IMG"===e.nodeName?[(i=e,{text:"Image",icon:"image",onAction:function(){var e,n,t,r=((nn=function(){var e=navigator.userAgent;return $n(e)},rn=!1,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return rn||(rn=!0,tn=nn.apply(null,e)),tn}()).browser.isIE(),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]}("element","offset"),e=On.fromDom(i),(n=e,t=n.dom(),y.from(t.parentNode).map(On.fromDom)).filter(function(e){return"figure"===e.dom().nodeName.toLowerCase()}).getOr(e));o.selection.select(r.dom()),hn(o).open()}})]:[];var i}})});i.add("image",function(e){yn(e),qn(e),vn(e)}),function Vn(){}}();!function(){"use strict";var n,t,e,r,o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.VK"),a=function(n){return n.target_list},c=function(n){return n.rel_list},l=function(n){return n.link_class_list},h=function(n){return"boolean"==typeof n.link_assume_external_targets&&n.link_assume_external_targets},f=function(n){return"boolean"==typeof n.link_context_toolbar&&n.link_context_toolbar},s=function(n){return n.link_list},p=function(n){return"string"==typeof n.default_link_target},v=function(n){return n.default_link_target},d=a,g=function(n){return!1!==a(n)},m=c,y=function(n){return c(n)!==undefined},k=l,x=function(n){return l(n)!==undefined},b=function(n){return!1!==n.link_title},O=function(n){return"boolean"==typeof n.allow_unsafe_link_target&&n.allow_unsafe_link_target},w=function(n){return!0===n.link_quicklink},_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),A=tinymce.util.Tools.resolve("tinymce.Env"),C=function(n){if(!A.ie||10<A.ie){var t=document.createElement("a");t.target="_blank",t.href=n,t.rel="noreferrer noopener";var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),i=t,u=e,document.body.appendChild(i),i.dispatchEvent(u),document.body.removeChild(i)}else{var r=window.open("","_blank");if(r){r.opener=null;var o=r.document;o.open(),o.write('<meta http-equiv="refresh" content="0; url='+_.DOM.encode(n)+'">'),o.close()}}var i,u},T=function(){return(T=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)},N=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(n,t){var e,r,o=["noopener"],i=n?n.split(/\s+/):[],u=function(n){return n.filter(function(n){return-1===N.inArray(o,n)})};return(i=t?(e=u(e=i)).length?e.concat(o):o:u(i)).length?(r=i,N.trim(r.sort().join(" "))):null},M=function(n,t){return t=t||n.selection.getNode(),z(t)?n.dom.select("a[href]",t)[0]:n.dom.getParent(t,"a[href]")},D=function(n){return n&&"A"===n.nodeName&&n.href},z=function(n){return n&&"FIGURE"===n.nodeName&&/\bimage\b/i.test(n.className)},E=function(n,t){var e,r;(r=n.dom.select("img",t)[0])&&(e=n.dom.getParents(r,"a[href]",t)[0])&&(e.parentNode.insertBefore(r,e),n.dom.remove(e))},L=function(n,t,e){var r,o;(o=n.dom.select("img",t)[0])&&(r=n.dom.create("a",e),o.parentNode.insertBefore(r,o),r.appendChild(o))},U=function(s,d){return function(f){s.undoManager.transact(function(){var n,t,e,r=s.selection.getNode(),o=M(s,r),i=f.target?{target:f.target}:{},u=f.rel?{rel:f.rel}:{},a=(t=o,(e=(n=f)["class"]?n["class"]:t&&t.className?t.className:null)?{"class":e}:{}),c=f.title?{title:f.title}:{},l=T({href:f.href},i,u,a,c);y(s.settings)||!1!==O(s.settings)||(l.rel=S(l.rel,"_blank"===l.target)),f.href===d.href&&(d.attach(),d={}),o?(s.focus(),f.hasOwnProperty("text")&&("innerText"in o?o.innerText=f.text:o.textContent=f.text),s.dom.setAttribs(o,l),s.selection.select(o),s.undoManager.add()):z(r)?L(s,r,l):f.hasOwnProperty("text")?s.insertContent(s.dom.createHTML("a",l,s.dom.encode(f.text))):s.execCommand("mceInsertLink",!1,l)})}},P=function(t){return function(){t.undoManager.transact(function(){var n=t.selection.getNode();z(n)?E(t,n):t.execCommand("unlink")})}},R=function(n){return 0<N.grep(n,D).length},K=function(n){var t=n.getAttribute("data-mce-href");return t||n.getAttribute("href")},q=function(n){return!(/</.test(n)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(n)||-1===n.indexOf("href=")))},I=M,j=function(n,t){var e=t?t.innerText||t.textContent:n.getContent({format:"text"});return e.replace(/\uFEFF/g,"")},V=S,B=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t]},F=function(n){return function(){return n}},W=F(!1),H=F(!0),$=W,G=H,J=function(){return X},X=(r={fold:function(n,t){return n()},is:$,isSome:$,isNone:G,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:t,map:J,ap:J,each:function(){},bind:J,flatten:J,exists:$,forall:G,filter:J,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:F("none()")},Object.freeze&&Object.freeze(r),r),Q=function(e){var n=function(){return e},t=function(){return o},r=function(n){return n(e)},o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:G,isNone:$,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return Q(n(e))},ap:function(n){return n.fold(J,function(n){return Q(n(e))})},each:function(n){n(e)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(e)?o:X},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold($,function(n){return t(e,n)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},Y={some:Q,none:J,from:function(n){return null===n||n===undefined?X:Q(n)}},Z=function(t){return function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"===t&&Array.prototype.isPrototypeOf(n)?"array":"object"===t&&String.prototype.isPrototypeOf(n)?"string":t}(n)===t}},nn=Z("string"),tn=Z("function"),en=(o=Array.prototype.indexOf)===undefined?function(n,t){return rn(n,t)}:function(n,t){return o.call(n,t)},rn=function(n,t){for(var e=0,r=n.length;e<r;++e)if(n[e]===t)return e;return-1},on=Array.prototype.push,un=function(n){for(var t=[],e=0,r=n.length;e<r;++e){if(!Array.prototype.isPrototypeOf(n[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+n);on.apply(t,n[e])}return t},an=function(n,t){var e=function(n,t){for(var e=n.length,r=new Array(e),o=0;o<e;o++){var i=n[o];r[o]=t(i,o,n)}return r}(n,t);return un(e)},cn=(Array.prototype.slice,tn(Array.from)&&Array.from,function(n,t){for(var e=0;e<n.length;e++){var r=t(n[e],e);if(r.isSome())return r}return Y.none()}),ln=function(n){return nn(n.value)?n.value:""},fn=function(e){return void 0===e&&(e=ln),function(n){return Y.from(n).map(function(n){return t=n,r=e,o=[],N.each(t,function(n){var t=nn(n.text)?n.text:nn(n.title)?n.title:"";if(n.menu!==undefined);else{var e=r(n);o.push({text:t,value:e})}}),o;var t,r,o})}},sn={sanitize:function(n){return fn(ln)(n)},sanitizeWith:fn,createUi:function(t,e){return function(n){return{name:t,type:"selectbox",label:e,items:n}}},getValue:ln},dn=function(n){var t=n,e=function(){return t};return{get:e,set:function(n){t=n},clone:function(){return dn(e())}}},gn=function(t,n,e,r){var o,i,u=r[n],a=0<t.length;return u!==undefined?(o=u,i=e,cn(i,function(n){return Y.some(n).filter(function(n){return n.value===o})})).map(function(n){return{url:{value:n.value,meta:{text:a?t:n.text,attach:B}},text:a?t:n.text}}):Y.none()},mn=function(n,i){var u=dn(n.text),o=function(n,t){var e,r,o=(e=i,r=t.name,"link"===r?e.catalogs.link:"anchor"===r?e.catalogs.anchor:Y.none()).getOr([]);return gn(u.get(),t.name,o,n)};return{onChange:function(n,t){return"url"===t.name?function(n){if(u.get().length<=0){var t=n.url.meta.text!==undefined?n.url.meta.text:n.url.value;return Y.some({text:t})}return Y.none()}(n()):(e=["anchor","link"],r=t.name,-1<en(e,r)?o(n(),t):("text"===t.name&&u.set(n().text),Y.none()));var e,r}}},hn=function(n){var e=Y.none(),t=[],r=function(n){o()?u(n):t.push(n)},o=function(){return e.isSome()},i=function(n){!function(n,t){for(var e=0,r=n.length;e<r;e++)t(n[e],e,n)}(n,u)},u=function(t){e.each(function(n){setTimeout(function(){t(n)},0)})};return n(function(n){e=Y.some(n),i(t),t=[]}),{get:r,map:function(e){return hn(function(t){r(function(n){t(e(n))})})},isReady:o}},pn={nu:hn,pure:function(t){return hn(function(n){n(t)})}},vn=function(t){var n=function(n){var r;t((r=n,function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=this;setTimeout(function(){r.apply(e,n)},0)}))},e=function(){return pn.nu(n)};return{map:function(r){return vn(function(e){n(function(n){var t=r(n);e(t)})})},bind:function(e){return vn(function(t){n(function(n){e(n).get(t)})})},anonBind:function(e){return vn(function(t){n(function(n){e.get(t)})})},toLazy:e,toCached:function(){var t=null;return vn(function(n){null===t&&(t=e()),t.get(n)})},get:n}},yn={nu:vn,pure:function(t){return vn(function(n){n(t)})}},kn=tinymce.util.Tools.resolve("tinymce.util.Delay"),xn=function(n){var t=n.href;return 0<t.indexOf("@")&&-1===t.indexOf("//")&&-1===t.indexOf("mailto:")?Y.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(n){return T({},n,{href:"mailto:"+t})}}):Y.none()},bn=function(u,n,a){return cn([xn,(e=n,function(n){var t=n.href;return!0===e&&!/^\w+:/i.test(t)||!1===e&&/^\s*www[\.|\d\.]/i.test(t)?Y.some({message:"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",preprocess:function(n){return T({},n,{href:"http://"+t})}}):Y.none()})],function(n){return n(a)}).fold(function(){return yn.pure(a)},function(i){return yn.nu(function(t){var e,n,r,o;e=u,n=i.message,r=function(n){console.log("state",n),t(n?i.preprocess(a):a)},o=e.selection.getRng(),kn.setEditorTimeout(e,function(){e.windowManager.confirm(n,function(n){e.selection.setRng(o),r(n)})})})});var e},On=function(n){var t=n.dom.select("a:not([href])"),e=an(t,function(n){var t=n.name||n.id;return t?[{text:t,value:"#"+t}]:[]});return 0<e.length?Y.some([{text:"None",value:""}].concat(e)):Y.none()},wn=function(n){if(x(n.settings)){var t=k(n.settings);return sn.sanitize(t)}return Y.none()},_n=tinymce.util.Tools.resolve("tinymce.util.XHR"),An=function(t){var e=function(n){return t.convertURL(n.value||n.url,"href")},n=s(t.settings);return yn.nu(function(t){"string"==typeof n?_n.send({url:n,success:function(n){return t(function(n){try{return Y.some(JSON.parse(n))}catch(t){return Y.none()}}(n))},error:function(n){return t(Y.none())}}):"function"==typeof n?n(function(n){return t(Y.some(n))}):t(Y.from(n))}).map(function(n){return n.bind(sn.sanitizeWith(e))})},Cn=function(n,t){if(y(n.settings)){var e=m(n.settings),r=t.is("_blank");return(!1===O(n.settings)?sn.sanitizeWith(function(n){return V(sn.getValue(n),r)}):sn.sanitize)(e)}return Y.none()},Tn=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Nn=function(n){if(g(n.settings)){var t=d(n.settings);return sn.sanitize(t).orThunk(function(){return Y.some(Tn)})}return Y.none()},Sn=function(n,t,e){var r=n.getAttrib(t,e);return null!==r&&0<r.length?Y.some(r):Y.none()},Mn=function(g,m,h){return An(g).map(function(n){var t,e,r,o,i,u,a,c,l,f,s,d=(e=m,r=h,o=(t=g).selection,i=t.dom,u=q(o.getContent())?Y.some(j(o,r)):Y.none(),a=r?Y.some(i.getAttrib(r,"href")):Y.none(),c=p(e)?Y.some(v(e)):Y.none(),l=r?Y.from(i.getAttrib(r,"target")):c,f=Sn(i,r,"rel"),s=Sn(i,r,"class"),{url:a,text:u,title:Sn(i,r,"title"),target:l,rel:f,linkClass:s});return{anchor:d,catalogs:{targets:Nn(g),rels:Cn(g,d.target),classes:wn(g),anchor:On(g),link:n},optNode:Y.from(h),flags:{titleEnabled:b(m)}}})},Dn=function(m){var n,t,e;(t=(n=m).settings,e=I(n),Mn(n,t,e)).map(function(n){var u,a,c,l,t,e,r,o,i,f,s,d,g=(u=m,c=(a=n).anchor.text,l=h(m.settings),function(n){var t=n.getData(),e={href:t.url.value,text:t.text?t.text:c.getOr(undefined),target:t.target?t.target:undefined,rel:t.rel?t.rel:undefined,"class":t.classz?t.classz:undefined,title:t.title?t.title:undefined},r={href:t.url.value,attach:t.url.meta!==undefined&&t.url.meta.attach?t.url.meta.attach:function(){}},o=U(u,r),i=P(u);if(!t.url.value)return i(),void n.close();(c.is(t.text)||a.optNode.isNone()&&!t.text)&&delete e.text,bn(u,l,e).get(function(n){o(n)}),n.close()});return e=g,o=(t=n).anchor.text.map(function(){return{name:"text",type:"input",label:"Text to display"}}).toArray(),i=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],f={url:{value:(r=t).anchor.url.getOr(""),meta:{attach:function(){},text:r.anchor.url.fold(function(){return""},function(){return r.anchor.text.getOr("")}),original:{value:r.anchor.url.getOr("")}}},text:r.anchor.text.getOr(""),title:r.anchor.title.getOr(""),anchor:r.anchor.url.getOr(""),link:r.anchor.url.getOr(""),rel:r.anchor.rel.getOr(""),target:r.anchor.target.getOr(""),classz:r.anchor.linkClass.getOr("")},s=mn(f,t),d=t.catalogs,{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:un([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],o,i,function(n){for(var t=[],e=function(n){t.push(n)},r=0;r<n.length;r++)n[r].each(e);return t}([d.anchor.map(sn.createUi("anchor","Anchors")),d.rels.map(sn.createUi("rel","Rel")),d.targets.map(sn.createUi("target","Open link in...")),d.link.map(sn.createUi("link","Link list")),d.classes.map(sn.createUi("classz","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:f,onChange:function(t,n){var e=n.name;s.onChange(t.getData,{name:e}).each(function(n){t.setData(n)})},onSubmit:e}}).get(function(n){m.windowManager.open(n)})},zn=function(n,t){return n.dom.getParent(t,"a[href]")},En=function(n){return zn(n,n.selection.getStart())},Ln=function(n,t){if(t){var e=K(t);if(/^#/.test(e)){var r=n.$(e);r.length&&n.selection.scrollIntoView(r[0],!0)}else C(t.href)}},Un=function(n){return function(){Dn(n)}},Pn=function(n){return function(){Ln(n,En(n))}},Rn=function(r){r.on("click",function(n){var t=zn(r,n.target);t&&u.metaKeyPressed(n)&&(n.preventDefault(),Ln(r,t))}),r.on("keydown",function(n){var t,e=En(r);e&&13===n.keyCode&&!0===(t=n).altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey&&(n.preventDefault(),Ln(r,e))})},Kn=function(e){return function(t){var n=function(n){return t.setActive(!e.readonly&&!!I(e,n.element))};return e.on("nodechange",n),function(){return e.off("nodechange",n)}}},qn=function(e){return function(t){t.setDisabled(!R(e.dom.getParents(e.selection.getStart())));var n=function(n){return t.setDisabled(!R(n.parents))};return e.on("nodechange",n),function(){return e.off("nodechange",n)}}},In=function(n){n.addCommand("mceLink",function(){w(n.settings)?n.fire("contexttoolbar-show",{toolbarKey:"link-form"}):Un(n)()})},jn=function(n){n.addShortcut("Meta+K","",function(){n.execCommand("mceLink")})},Vn=function(n){n.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Un(n),onSetup:Kn(n)}),n.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:P(n),onSetup:qn(n)})},Bn=function(n){n.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Pn(n),onSetup:qn(n)}),n.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Un(n)}),n.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:P(n),onSetup:qn(n)})},Fn=function(t){t.ui.registry.addContextMenu("link",{update:function(n){return R(t.dom.getParents(n,"a"))?"link unlink openlink":"link"}})},Wn=function(i){i.ui.registry.addContextForm("link-form",{launch:{type:"contextformtogglebutton",icon:"link",onSetup:Kn(i)},label:"Link",predicate:function(n){return!!I(i,n)&&f(i.settings)},initValue:function(){var n=I(i);return n?K(n):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(n){var t=i.selection.getNode();return n.setActive(!!I(i,t)),Kn(i)(n)},onAction:function(n){var t=I(i),e=n.getValue();if(t)i.dom.setAttrib(t,"href",e),i.selection.collapse(!1),n.hide();else{var r={href:e,attach:function(){}},o=q(i.selection.getContent())?Y.some(j(i.selection,t)).filter(function(n){return 0<n.length}):Y.none();U(i,r)({href:e,text:o.getOr(e)}),n.hide()}}},{type:"contextformtogglebutton",icon:"unlink",tooltip:"Remove link",active:!1,onSetup:function(){return function(){}},onAction:function(n){P(i)(),n.hide()}}]})};i.add("link",function(n){Vn(n),Bn(n),Fn(n),Wn(n),Rn(n),In(n),jn(n)}),function Hn(){}}();!function(){"use strict";var t,a,e,r,n,i,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=(t="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}),u=Object.prototype.hasOwnProperty,v=(a=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},n=0;n<e.length;n++){var i=e[n];for(var o in i)u.call(i,o)&&(r[o]=a(r[o],i[o]))}return r}),s=function(e){return function(){return e}},l=s(!1),m=s(!0),d=l,h=m,f=function(){return p},p=(i={fold:function(e,t){return e()},is:d,isSome:d,isNone:h,getOr:n=function(e){return e},getOrThunk:r=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:r,map:f,ap:f,each:function(){},bind:f,flatten:f,exists:d,forall:h,filter:f,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:s("none()")},Object.freeze&&Object.freeze(i),i),g=function(r){var e=function(){return r},t=function(){return i},n=function(e){return e(r)},i={fold:function(e,t){return t(r)},is:function(e){return r===e},isSome:h,isNone:d,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return g(e(r))},ap:function(e){return e.fold(f,function(e){return g(e(r))})},each:function(e){e(r)},bind:n,flatten:e,exists:n,forall:n,filter:function(e){return e(r)?i:p},equals:function(e){return e.is(r)},equals_:function(e,t){return e.fold(d,function(e){return t(r,e)})},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return i},w={some:g,none:f,from:function(e){return null===e||e===undefined?p:g(e)}},b=Object.hasOwnProperty,y=function(e,t){return x(e,t)?w.some(e[t]):w.none()},x=function(e,t){return b.call(e,t)},j=Array.prototype.push,O=(Array.prototype.slice,c(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.Tools")),A=function(e){return e.getParam("media_scripts")},_=function(e){return e.getParam("audio_template_callback")},C=function(e){return e.getParam("video_template_callback")},M=function(e){return e.getParam("media_live_embeds",!0)},F=function(e){return e.getParam("media_filter_html",!0)},P=function(e){return e.getParam("media_url_resolver")},S=function(e){return e.getParam("media_alt_source",!0)},k=function(e){return e.getParam("media_poster",!0)},T=function(e){return e.getParam("media_dimensions",!0)},$=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),z=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),D=function(e,t){if(e)for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r].filter))return e[r]},N=function(t){return function(e){return e?e.style[t].replace(/px$/,""):""}},E=function(n){return function(e,t){var r;e&&(e.style[n]=/^[0-9.]+$/.test(r=t)?r+"px":r)}},U={getMaxWidth:N("maxWidth"),getMaxHeight:N("maxHeight"),setMaxWidth:E("maxWidth"),setMaxHeight:E("maxHeight")},R=z.DOM,W=function(e){return R.getAttrib(e,"data-ephox-embed-iri")},H=function(e,t){return c=t,u=R.createFragment(c),""!==W(u.firstChild)?(o=t,a=R.createFragment(o).firstChild,{type:"ephox-embed-iri",source1:W(a),source2:"",poster:"",width:U.getMaxWidth(a),height:U.getMaxHeight(a)}):(n=e,r=t,$({validate:(i={},!1),allow_conditional_comments:!0,special:"script,noscript",start:function(e,t){if(i.source1||"param"!==e||(i.source1=t.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(i.type||(i.type=e),i=O.extend(t.map,i)),"script"===e){var r=D(n,t.map.src);if(!r)return;i={type:"script",source1:t.map.src,width:r.width,height:r.height}}"source"===e&&(i.source1?i.source2||(i.source2=t.map.src):i.source1=t.map.src),"img"!==e||i.poster||(i.poster=t.map.src)}}).parse(r),i.source1=i.source1||i.src||i.data,i.source2=i.source2||"",i.poster=i.poster||"",i);var n,r,i,o,a,c,u},L=tinymce.util.Tools.resolve("tinymce.util.Promise"),I=function(e){var t={mp3:"audio/mpeg",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[e.toLowerCase().split(".").pop()];return t||""},q=tinymce.util.Tools.resolve("tinymce.html.Writer"),B=tinymce.util.Tools.resolve("tinymce.html.Schema"),G=z.DOM,J=function(e,t){var r,n,i,o;for(r in t)if(i=""+t[r],e.map[r])for(n=e.length;n--;)(o=e[n]).name===r&&(i?(e.map[r]=i,o.value=i):(delete e.map[r],e.splice(n,1)));else i&&(e.push({name:r,value:i}),e.map[r]=i)},K=function(e,t){var r,n,i=G.createFragment(e).firstChild;return U.setMaxWidth(i,t.width),U.setMaxHeight(i,t.height),r=i.outerHTML,n=q(),$(n).parse(r),n.getContent()},Q=function(e,t,r){return s=e,l=G.createFragment(s),""!==G.getAttrib(l.firstChild,"data-ephox-embed-iri")?K(e,t):(n=e,i=t,o=r,c=q(),$({validate:!1,allow_conditional_comments:!(u=0),special:"script,noscript",comment:function(e){c.comment(e)},cdata:function(e){c.cdata(e)},text:function(e,t){c.text(e,t)},start:function(e,t,r){switch(e){case"video":case"object":case"embed":case"img":case"iframe":i.height!==undefined&&i.width!==undefined&&J(t,{width:i.width,height:i.height})}if(o)switch(e){case"video":J(t,{poster:i.poster,src:""}),i.source2&&J(t,{src:""});break;case"iframe":J(t,{src:i.source1});break;case"source":if(++u<=2&&(J(t,{src:i["source"+u],type:i["source"+u+"mime"]}),!i["source"+u]))return;break;case"img":if(!i.poster)return;a=!0}c.start(e,t,r)},end:function(e){if("video"===e&&o)for(var t=1;t<=2;t++)if(i["source"+t]){var r=[];r.map={},u<t&&(J(r,{src:i["source"+t],type:i["source"+t+"mime"]}),c.start("source",r,!0))}if(i.poster&&"object"===e&&o&&!a){var n=[];n.map={},J(n,{src:i.poster,width:i.width,height:i.height}),c.start("img",n,!0)}c.end(e)}},B({})).parse(n),c.getContent());var n,i,o,a,c,u,s,l},V=[{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}],X=function(r,e){var n=O.extend({},e);if(!n.source1&&(O.extend(n,H(A(r),n.embed)),!n.source1))return"";n.source2||(n.source2=""),n.poster||(n.poster=""),n.source1=r.convertURL(n.source1,"source"),n.source2=r.convertURL(n.source2,"source"),n.source1mime=I(n.source1),n.source2mime=I(n.source2),n.poster=r.convertURL(n.poster,"poster");var t,i,o=(t=n.source1,0<(i=V.filter(function(e){return e.regex.test(t)})).length?O.extend({},i[0],{url:function(e,t){for(var r=e.regex.exec(t),n=e.url,i=function(e){n=n.replace("$"+e,function(){return r[e]?r[e]:""})},o=0;o<r.length;o++)i(o);return n.replace(/\?$/,"")}(i[0],t)}):null);if(o&&(n.source1=o.url,n.type=o.type,n.allowFullscreen=o.allowFullscreen,n.width=n.width||o.w,n.height=n.height||o.h),n.embed)return Q(n.embed,n,!0);var a=D(A(r),n.source1);a&&(n.type="script",n.width=a.width,n.height=a.height);var c,u,s,l,m,d,h,f,p=_(r),g=C(r);return n.width=n.width||300,n.height=n.height||150,O.each(n,function(e,t){n[t]=r.dom.encode(e)}),"iframe"===n.type?(f=(h=n).allowFullscreen?' allowFullscreen="1"':"",'<iframe src="'+h.source1+'" width="'+h.width+'" height="'+h.height+'"'+f+"></iframe>"):"application/x-shockwave-flash"===n.source1mime?(d='<object data="'+(m=n).source1+'" width="'+m.width+'" height="'+m.height+'" type="application/x-shockwave-flash">',m.poster&&(d+='<img src="'+m.poster+'" width="'+m.width+'" height="'+m.height+'" />'),d+="</object>"):-1!==n.source1mime.indexOf("audio")?(s=n,(l=p)?l(s):'<audio controls="controls" src="'+s.source1+'">'+(s.source2?'\n<source src="'+s.source2+'"'+(s.source2mime?' type="'+s.source2mime+'"':"")+" />\n":"")+"</audio>"):"script"===n.type?'<script src="'+n.source1+'"><\/script>':(c=n,(u=g)?u(c):'<video width="'+c.width+'" height="'+c.height+'"'+(c.poster?' poster="'+c.poster+'"':"")+' controls="controls">\n<source src="'+c.source1+'"'+(c.source1mime?' type="'+c.source1mime+'"':"")+" />\n"+(c.source2?'<source src="'+c.source2+'"'+(c.source2mime?' type="'+c.source2mime+'"':"")+" />\n":"")+"</video>")},Y={},Z=function(t){return function(e){return X(t,e)}},ee=function(e,t){var r,n,i,o,a,c=P(e);return c?(i=t,o=Z(e),a=c,new L(function(t,e){var r=function(e){return e.html&&(Y[i.source1]=e),t({url:i.source1,html:e.html?e.html:o(i)})};Y[i.source1]?r(Y[i.source1]):a({url:i.source1},r,e)})):(r=t,n=Z(e),new L(function(e){e({html:n(r),url:r.source1})}))},te=function(e){return Y.hasOwnProperty(e)},re=function(e){return v(e,{source1:e.source1.value,source2:e.source2.value,poster:e.poster.value})},ne=function(e){return v(e,{source1:{value:y(e,"source1").getOr("")},source2:{value:y(e,"source2").getOr("")},poster:{value:y(e,"poster").getOr("")}})},ie=function(r){return function(e){var t=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";r.notificationManager.open({type:"error",text:t})}},oe=function(e,t){return O.extend({},H(A(e),t))},ae=function(e,t){var r=e.dom.select("img[data-mce-object]");e.insertContent(t),function(e,t){var r,n,i=e.dom.select("img[data-mce-object]");for(r=0;r<t.length;r++)for(n=i.length-1;0<=n;n--)t[r]===i[n]&&i.splice(n,1);e.selection.select(i[0])}(e,r),e.nodeChanged()},ce=function(a){var e,t,r,n,i,o=(t=(e=a).selection.getNode(),(r=t.getAttribute("data-ephox-embed-iri"))?{source1:r,width:U.getMaxWidth(t),height:U.getMaxHeight(t)}:t.getAttribute("data-mce-object")?H(A(e),e.serializer.serialize(t,{selection:!0})):{}),c={source1:"",source2:"",embed:(n=a,i=n.selection.getNode(),i.getAttribute("data-mce-object")||i.getAttribute("data-ephox-embed-iri")?n.selection.getContent():""),poster:"",dimensions:{height:o.height?o.height:"",width:o.width?o.width:""}},u=ne(v(c,o)),s=function(e){var t=re(e.getData());return T(a)?v(t,{width:t.dimensions.width,height:t.dimensions.height}):t},l=function(e){var i,o,t=s(e);ee(a,t).then((i=w,o=a,function(e){var t=e.html,r=oe(o,t),n={source1:e.url,embed:t,dimensions:{width:r.width?r.width:"",height:r.height?r.height:""}};i.setData(ne(n))}))["catch"](ie(a))},m={title:"General",items:function(e){for(var t=[],r=0,n=e.length;r<n;++r){if(!Array.prototype.isPrototypeOf(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);j.apply(t,e[r])}return t}([[{name:"source1",type:"urlinput",filetype:"media",label:"Source"}],T(a)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[]])},d={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},h=[];S(a)&&h.push({name:"source2",type:"urlinput",filetype:"media",label:"Alternative image URL"}),k(a)&&h.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var f={title:"Advanced",items:h},p=[m,d];0<h.length&&p.push(f);var g={type:"tabpanel",tabs:p},w=a.windowManager.open({title:"Insert/Edit Media",size:"normal",body:g,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var t,r,n=s(e);r=a,(t=n).embed=Q(t.embed,t),t.embed&&te(t.source1)?ae(r,t.embed):ee(r,t).then(function(e){ae(r,e.html)})["catch"](ie(r)),e.close()},onChange:function(e,t){switch(t.name){case"source1":l(e);break;case"dimensions":l(e);case"embed":n=re((r=e).getData()),(i=oe(a,n.embed)).dimensions={width:i.width?i.width:n.dimensions.width,height:i.height?i.height:n.dimensions.height},r.setData(ne(i))}var r,n,i},initialData:u})},ue=function(e){return{showDialog:function(){ce(e)}}},se=function(e){e.addCommand("mceMedia",function(){ce(e)})},le=tinymce.util.Tools.resolve("tinymce.html.Node"),me=tinymce.util.Tools.resolve("tinymce.Env"),de=function(i,e){if(!1===F(i))return e;var o,a=q();return $({validate:!1,allow_conditional_comments:!1,special:"script,noscript",comment:function(e){a.comment(e)},cdata:function(e){a.cdata(e)},text:function(e,t){a.text(e,t)},start:function(e,t,r){if(o=!0,"script"!==e&&"noscript"!==e){for(var n=0;n<t.length;n++){if(0===t[n].name.indexOf("on"))return;"style"===t[n].name&&(t[n].value=i.dom.serializeStyle(i.dom.parseStyle(t[n].value),e))}a.start(e,t,r),o=!1}},end:function(e){o||a.end(e)}},B({})).parse(e),a.getContent()},he=function(e,t){var r,n=t.name;return(r=new le("img",1)).shortEnded=!0,pe(e,t,r),r.attr({width:t.attr("width")||"300",height:t.attr("height")||("audio"===n?"30":"150"),style:t.attr("style"),src:me.transparentSrc,"data-mce-object":n,"class":"mce-object mce-object-"+n}),r},fe=function(e,t){var r,n,i,o=t.name;return(r=new le("span",1)).attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":o,"class":"mce-preview-object mce-object-"+o}),pe(e,t,r),(n=new le(o,1)).attr({src:t.attr("src"),allowfullscreen:t.attr("allowfullscreen"),style:t.attr("style"),"class":t.attr("class"),width:t.attr("width"),height:t.attr("height"),frameborder:"0"}),(i=new le("span",1)).attr("class","mce-shim"),r.append(n),r.append(i),r},pe=function(e,t,r){var n,i,o,a,c;for(a=(o=t.attributes).length;a--;)n=o[a].name,i=o[a].value,"width"!==n&&"height"!==n&&"style"!==n&&("data"!==n&&"src"!==n||(i=e.convertURL(i,n)),r.attr("data-mce-p-"+n,i));(c=t.firstChild&&t.firstChild.value)&&(r.attr("data-mce-html",escape(de(e,c))),r.firstChild=null)},ge=function(e){for(;e=e.parent;)if(e.attr("data-ephox-embed-iri")||(t=e.attr("class"))&&/\btiny-pageembed\b/.test(t))return!0;var t;return!1},we=function(i){return function(e){for(var t,r,n=e.length;n--;)(t=e[n]).parent&&(t.parent.attr("data-mce-object")||("script"!==t.name||(r=D(A(i),t.attr("src"))))&&(r&&(r.width&&t.attr("width",r.width.toString()),r.height&&t.attr("height",r.height.toString())),"iframe"===t.name&&M(i)&&me.ceFalse?ge(t)||t.replace(fe(i,t)):ge(t)||t.replace(he(i,t))))}},ve=function(d){d.on("preInit",function(){var t=d.schema.getSpecialElements();O.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")});var r=d.schema.getBoolAttrs();O.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){r[e]={}}),d.parser.addNodeFilter("iframe,video,audio,object,embed,script",we(d)),d.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var r,n,i,o,a,c,u,s,l=e.length;l--;)if((r=e[l]).parent){for(u=r.attr(t),n=new le(u,1),"audio"!==u&&"script"!==u&&((s=r.attr("class"))&&-1!==s.indexOf("mce-preview-object")?n.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):n.attr({width:r.attr("width"),height:r.attr("height")})),n.attr({style:r.attr("style")}),i=(o=r.attributes).length;i--;){var m=o[i].name;0===m.indexOf("data-mce-p-")&&n.attr(m.substr(11),o[i].value)}"script"===u&&n.attr("type","text/javascript"),(a=r.attr("data-mce-html"))&&((c=new le("#text",3)).raw=!0,c.value=de(d,unescape(a)),n.append(c)),r.replace(n)}})}),d.on("setContent",function(){d.$("span.mce-preview-object").each(function(e,t){var r=d.$(t);0===r.find("span.mce-shim",t).length&&r.append('<span class="mce-shim"></span>')})})},be=function(e){e.on("ResolveName",function(e){var t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)})},ye=function(t){t.on("click keyup",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(e){var t=e.target.getAttribute("data-mce-object");"audio"!==t&&"script"!==t||e.preventDefault()}),t.on("objectResized",function(e){var t,r=e.target;r.getAttribute("data-mce-object")&&(t=r.getAttribute("data-mce-html"))&&(t=unescape(t),r.setAttribute("data-mce-html",escape(Q(t,{width:e.width,height:e.height}))))})},xe=function(e){var t,r;e.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:function(){e.execCommand("mceMedia")},onSetup:(t=e,r=["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"],function(e){return t.selection.selectorChangedWithUnbind(r.join(","),e.setActive).unbind})}),e.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:function(){e.execCommand("mceMedia")}})};o.add("media",function(e){return se(e),xe(e),be(e),ve(e),ye(e),ue(e)}),function je(){}}();!function(){"use strict";var e,t,n,r,a,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(e){return function(){return e}},i=u(!1),c=u(!0),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),p=tinymce.util.Tools.resolve("tinymce.util.XHR"),l=function(e){return e.getParam("template_cdate_classes","cdate")},s=function(e){return e.getParam("template_mdate_classes","mdate")},m=function(e){return e.getParam("template_selected_content_classes","selcontent")},d=function(e){return e.getParam("template_preview_replace_values")},g=function(e){return e.getParam("template_replace_values")},y=function(e){return e.templates},v=function(e){return e.getParam("template_cdate_format",e.translate("%Y-%m-%d"))},h=function(e){return e.getParam("template_mdate_format",e.translate("%Y-%m-%d"))},b=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},T=function(e,t,n){var r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),u="January February March April May June July August September October November December".split(" ");return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",b(n.getMonth()+1,2))).replace("%d",b(n.getDate(),2))).replace("%H",""+b(n.getHours(),2))).replace("%M",""+b(n.getMinutes(),2))).replace("%S",""+b(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(u[n.getMonth()]))).replace("%b",""+e.translate(o[n.getMonth()]))).replace("%A",""+e.translate(a[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")},M=function(n,e){return f.each(e,function(e,t){"function"==typeof e&&(e=e(t)),n=n.replace(new RegExp("\\{\\$"+t+"\\}","g"),e)}),n},_=function(e,t){var r=e.dom,a=g(e);f.each(r.select("*",t),function(n){f.each(a,function(e,t){r.hasClass(n,t)&&"function"==typeof a[t]&&a[t](n)})})},O=function(e,t){return new RegExp("\\b"+t+"\\b","g").test(e.className)},S=function(t,n){return function(){var e=y(t);"function"!=typeof e?"string"==typeof e?p.send({url:e,success:function(e){n(JSON.parse(e))}}):n(e):e(n)}},x=M,P=_,A=function(t,e,n){var r,a,o=t.dom,u=t.selection.getContent();n=M(n,g(t)),r=o.create("div",null,n),(a=o.select(".mceTmpl",r))&&0<a.length&&(r=o.create("div",null)).appendChild(a[0].cloneNode(!0)),f.each(o.select("*",r),function(e){O(e,l(t).replace(/\s+/g,"|"))&&(e.innerHTML=T(t,v(t))),O(e,s(t).replace(/\s+/g,"|"))&&(e.innerHTML=T(t,h(t))),O(e,m(t).replace(/\s+/g,"|"))&&(e.innerHTML=u)}),_(t,r),t.execCommand("mceInsertContent",!1,r.innerHTML),t.addVisual()},w=function(e){e.addCommand("mceInsertTemplate",function t(r){for(var a=[],e=1;e<arguments.length;e++)a[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.concat(e);return r.apply(null,n)}}(A,e))},D=function(r){r.on("PreProcess",function(e){var t=r.dom,n=h(r);f.each(t.select("div",e.node),function(e){t.hasClass(e,"mceTmpl")&&(f.each(t.select("*",e),function(e){t.hasClass(e,r.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(e.innerHTML=T(r,n))}),P(r,e))})})},C=i,N=c,H=function(){return k},k=(r={fold:function(e,t){return e()},is:C,isSome:C,isNone:N,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:H,ap:H,each:function(){},bind:H,flatten:H,exists:C,forall:N,filter:H,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(r),r),I=function(n){var e=function(){return n},t=function(){return a},r=function(e){return e(n)},a={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:N,isNone:C,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return I(e(n))},ap:function(e){return e.fold(H,function(e){return I(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?a:k},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(C,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return a},J={some:I,none:H,from:function(e){return null===e||e===undefined?k:I(e)}},L=(a="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===a}),Y=(Array.prototype.slice,L(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.Promise")),F=function(t,e){if(-1===e.indexOf("<html>")){var n="";f.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+t.documentBaseURI.toAbsolute(e)+'">'});var r=t.settings.body_class||"";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_class","","hash"))[t.id]||""),e="<!DOCTYPE html><html><head>"+n+'</head><body class="'+r+'">'+e+"</body></html>"}return x(e,d(t))},j=function(c,t){var e=function(e){return function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var o=e[a];r[a]=t(o,a,e)}return r}(e,function(e){return{text:e.text,value:e.text}})},l=function(e,t){return function(e,t){for(var n=0,r=e.length;n<r;n++){var a=e[n];if(t(a,n,e))return J.some(a)}return J.none()}(e,function(e){return e.text===t})},s=function(e){return new Y(function(t,n){e.value.url?p.send({url:e.value.url,success:function(e){t(e)},error:function(e){n(e)}}):t(e.value.content)})};(function(){if(t&&0!==t.length)return J.from(f.map(t,function(e,t){return{selected:0===t,text:e.title,value:{url:e.url,content:e.content,description:e.description}}}));var e=c.translate("No templates defined.");return c.notificationManager.open({text:e,type:"info"}),J.none()})().each(function(a){var o=e(a),u=function(e,t){return{title:"Insert Template",size:"large",body:{type:"panel",items:e},initialData:t,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:(n=a,function(t){var e=t.getData();l(n,e.template).each(function(e){s(e).then(function(e){A(c,!1,e),t.close()})})}),onChange:(r=a,function(n,e){if("template"===e.name){var t=n.getData().template;l(r,t).each(function(e){n.block("Loading..."),s(e).then(function(e){var t=F(c,e);n.setData({preview:t}),n.unblock()})})}})};var r,n},i=c.windowManager.open(u([],{template:"",preview:""}));i.block("Loading..."),s(a[0]).then(function(e){var t=F(c,e),n=[{type:"selectbox",name:"template",label:"Templates",items:o},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1}],r={template:a[0].text,preview:t};i.unblock(),i.redial(u(n,r)),i.focus("template")})})},q=function(t){return function(e){j(t,e)}},E=function(e){e.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:S(e.settings,q(e))}),e.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:S(e.settings,q(e))})};o.add("template",function(e){E(e),w(e),D(e)}),function R(){}}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t={},n=t,c=void 0!==t?t:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},i=function(){var u=/\blang(?:uage)?-(?!\*)(\w+)\b/i,S=c.Prism={util:{encode:function(e){return e instanceof s?new s(e.type,S.util.encode(e.content),e.alias):"Array"===S.util.type(e)?e.map(S.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){switch(S.util.type(e)){case"Object":var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=S.util.clone(e[n]));return t;case"Array":return e.map&&e.map(function(e){return S.util.clone(e)})}return e}},languages:{extend:function(e,t){var n=S.util.clone(S.languages[e]);for(var a in t)n[a]=t[a];return n},insertBefore:function(n,e,t,a){var r=(a=a||S.languages)[n];if(2===arguments.length){for(var i in t=e)t.hasOwnProperty(i)&&(r[i]=t[i]);return r}var o={};for(var s in r)if(r.hasOwnProperty(s)){if(s===e)for(var i in t)t.hasOwnProperty(i)&&(o[i]=t[i]);o[s]=r[s]}return S.languages.DFS(S.languages,function(e,t){t===a[n]&&e!==n&&(this[e]=o)}),a[n]=o},DFS:function(e,t,n){for(var a in e)e.hasOwnProperty(a)&&(t.call(e,a,e[a],n||a),"Object"===S.util.type(e[a])?S.languages.DFS(e[a],t):"Array"===S.util.type(e[a])&&S.languages.DFS(e[a],t,a))}},plugins:{},highlightAll:function(e,t){for(var n=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),a=0,r=void 0;r=n[a++];)S.highlightElement(r,!0===e,t)},highlightElement:function(e,t,n){for(var a,r,i=e;i&&!u.test(i.className);)i=i.parentNode;i&&(a=(i.className.match(u)||[,""])[1],r=S.languages[a]),e.className=e.className.replace(u,"").replace(/\s+/g," ")+" language-"+a,i=e.parentNode,/pre/i.test(i.nodeName)&&(i.className=i.className.replace(u,"").replace(/\s+/g," ")+" language-"+a);var o=e.textContent,s={element:e,language:a,grammar:r,code:o};if(o&&r)if(S.hooks.run("before-highlight",s),t&&c.Worker){var l=new Worker(S.filename);l.onmessage=function(e){s.highlightedCode=e.data,S.hooks.run("before-insert",s),s.element.innerHTML=s.highlightedCode,n&&n.call(s.element),S.hooks.run("after-highlight",s),S.hooks.run("complete",s)},l.postMessage(JSON.stringify({language:s.language,code:s.code,immediateClose:!0}))}else s.highlightedCode=S.highlight(s.code,s.grammar,s.language),S.hooks.run("before-insert",s),s.element.innerHTML=s.highlightedCode,n&&n.call(e),S.hooks.run("after-highlight",s),S.hooks.run("complete",s);else S.hooks.run("complete",s)},highlight:function(e,t,n){var a=S.tokenize(e,t);return s.stringify(S.util.encode(a),n)},tokenize:function(e,t,n){var a=S.Token,r=[e],i=t.rest;if(i){for(var o in i)t[o]=i[o];delete t.rest}e:for(var o in t)if(t.hasOwnProperty(o)&&t[o]){var s=t[o];s="Array"===S.util.type(s)?s:[s];for(var l=0;l<s.length;++l){var u=s[l],c=u.inside,g=!!u.lookbehind,d=0,p=u.alias;u=u.pattern||u;for(var f=0;f<r.length;f++){var h=r[f];if(r.length>e.length)break e;if(!(h instanceof a)){u.lastIndex=0;var m=u.exec(h);if(m){g&&(d=m[1].length);var b=m.index-1+d,y=b+(m=m[0].slice(d)).length,k=h.slice(0,b+1),v=h.slice(y+1),w=[f,1];k&&w.push(k);var x=new a(o,c?S.tokenize(m,c):m,p);w.push(x),v&&w.push(v),Array.prototype.splice.apply(r,w)}}}}}return r},hooks:{all:{},add:function(e,t){var n=S.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=S.hooks.all[e];if(n&&n.length)for(var a=0,r=void 0;r=n[a++];)r(t)}}},s=S.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(s.stringify=function(t,n,e){if("string"==typeof t)return t;if("Array"===S.util.type(t))return t.map(function(e){return s.stringify(e,n,t)}).join("");var a={type:t.type,content:s.stringify(t.content,n,e),tag:"span",classes:["token",t.type],attributes:{},language:n,parent:e};if("comment"===a.type&&(a.attributes.spellcheck="true"),t.alias){var r="Array"===S.util.type(t.alias)?t.alias:[t.alias];Array.prototype.push.apply(a.classes,r)}S.hooks.run("wrap",a);var i="";for(var o in a.attributes)i+=(i?" ":"")+o+'="'+(a.attributes[o]||"")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'" '+i+">"+a.content+"</"+a.tag+">"},!c.document)return c.addEventListener&&c.addEventListener("message",function(e){var t=JSON.parse(e.data),n=t.language,a=t.code,r=t.immediateClose;c.postMessage(S.highlight(a,S.languages[n],n)),r&&c.close()},!1),c.Prism}();void 0!==n&&(n.Prism=i),i.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},i.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),i.languages.xml=i.languages.markup,i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},i.languages.css.atrule.inside.rest=i.util.clone(i.languages.css),i.languages.markup&&(i.languages.insertBefore("markup","tag",{style:{pattern:/<style[\w\W]*?>[\w\W]*?<\/style>/i,inside:{tag:{pattern:/<style[\w\W]*?>|<\/style>/i,inside:i.languages.markup.tag.inside},rest:i.languages.css},alias:"language-css"}}),i.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:i.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:i.languages.css}},alias:"language-css"}},i.languages.markup.tag)),i.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},i.languages.javascript=i.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),i.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),i.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:i.languages.javascript}},string:/[\s\S]+/}}}),i.languages.markup&&i.languages.insertBefore("markup","tag",{script:{pattern:/<script[\w\W]*?>[\w\W]*?<\/script>/i,inside:{tag:{pattern:/<script[\w\W]*?>|<\/script>/i,inside:i.languages.markup.tag.inside},rest:i.languages.javascript},alias:"language-javascript"}}),i.languages.js=i.languages.javascript,i.languages.c=i.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),i.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0}}}}),delete i.languages.c["class-name"],delete i.languages.c["boolean"],i.languages.csharp=i.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+)\b/i}),i.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0}}),i.languages.cpp=i.languages.extend("c",{keyword:/\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,"boolean":/\b(true|false)\b/,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),i.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}),i.languages.java=i.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}}),i.languages.php=i.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0}}),i.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),i.languages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),i.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),i.languages.markup&&(i.hooks.add("before-highlight",function(t){"php"===t.language&&(t.tokenStack=[],t.backupCode=t.code,t.code=t.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(e){return t.tokenStack.push(e),"{{{PHP"+t.tokenStack.length+"}}}"}))}),i.hooks.add("before-insert",function(e){"php"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),i.hooks.add("after-highlight",function(e){if("php"===e.language){for(var t=0,n=void 0;n=e.tokenStack[t];t++)e.highlightedCode=e.highlightedCode.replace("{{{PHP"+(t+1)+"}}}",i.highlight(n,e.grammar,"php").replace(/\$/g,"$$$$"));e.element.innerHTML=e.highlightedCode}}),i.hooks.add("wrap",function(e){"php"===e.language&&"markup"===e.type&&(e.content=e.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'<span class="token php">$1</span>'))}),i.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:i.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})),i.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:/"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,"boolean":/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/},function(e){e.languages.ruby=e.languages.extend("clike",{comment:/#(?!\{[^\r\n]*?\}).*/,keyword:/\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/});var t={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.util.clone(e.languages.ruby)}};e.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,inside:{interpolation:t}},{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}],variable:/[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,symbol:/:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.insertBefore("ruby","number",{builtin:/\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,inside:{interpolation:t}},{pattern:/("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,inside:{interpolation:t}}]}(i);var a,o,s,l,u,g={isCodeSample:function T(e){return e&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-")},trimArg:function B(n){return function(e,t){return n(t)}}},d=function(e){return function(){return e}},p=d(!1),f=d(!0),h=p,m=f,b=function(){return y},y=(l={fold:function(e,t){return e()},is:h,isSome:h,isNone:m,getOr:s=function(e){return e},getOrThunk:o=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:s,orThunk:o,map:b,ap:b,each:function(){},bind:b,flatten:b,exists:h,forall:m,filter:b,equals:a=function(e){return e.isNone()},equals_:a,toArray:function(){return[]},toString:d("none()")},Object.freeze&&Object.freeze(l),l),k=function(n){var e=function(){return n},t=function(){return r},a=function(e){return e(n)},r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:m,isNone:h,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return k(e(n))},ap:function(e){return e.fold(b,function(e){return k(e(n))})},each:function(e){e(n)},bind:a,flatten:e,exists:a,forall:a,filter:function(e){return e(n)?r:y},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(h,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},v={some:k,none:b,from:function(e){return null===e||e===undefined?y:k(e)}},w=function(e){var t=e.selection?e.selection.getNode():null;return g.isCodeSample(t)?v.some(t):v.none()},x=w,S=function(t,n,a){t.undoManager.transact(function(){var e=w(t);return a=r.DOM.encode(a),e.fold(function(){t.insertContent('<pre id="__new" class="language-'+n+'">'+a+"</pre>"),t.selection.select(t.$("#__new").removeAttr("id")[0])},function(e){t.dom.setAttrib(e,"class","language-"+n),e.innerHTML=a,i.highlightElement(e),t.selection.select(e)})})},A=function(e){return w(e).fold(function(){return""},function(e){return e.textContent})},C=function(e){return e.settings.codesample_languages},_=function(e){var t=C(e);return t||[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}]},O=function(e,n){return x(e).fold(function(){return n},function(e){var t=e.className.match(/language-(\w+)/);return t?t[1]:n})},N=(u="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===u}),z=(Array.prototype.slice,N(Array.from)&&Array.from,function(n){var e,t=_(n),a=(e=t,0===e.length?v.none():v.some(e[0])).fold(function(){return""},function(e){return e.value}),r=O(n,a),i=A(n);n.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"selectbox",name:"language",label:"Language",items:t},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:r,code:i},onSubmit:function(e){var t=e.getData();S(n,t.language,t.code),e.close()}})}),P=function(t){t.addCommand("codesample",function(){var e=t.selection.getNode();t.selection.isCollapsed()||g.isCodeSample(e)?z(t):t.formatter.toggle("code")})},W=function(n){var r=n.$;n.on("PreProcess",function(e){r("pre[contenteditable=false]",e.node).filter(g.trimArg(g.isCodeSample)).each(function(e,t){var n=r(t),a=t.textContent;n.attr("class",r.trim(n.attr("class"))),n.removeAttr("contentEditable"),n.empty().append(r("<code></code>").each(function(){this.textContent=a}))})}),n.on("SetContent",function(){var e=r("pre").filter(g.trimArg(g.isCodeSample)).filter(function(e,t){return"false"!==t.contentEditable});e.length&&n.undoManager.transact(function(){e.each(function(e,t){r(t).find("br").each(function(e,t){t.parentNode.replaceChild(n.getDoc().createTextNode("\n"),t)}),t.contentEditable=!1,t.innerHTML=n.dom.encode(t.textContent),i.highlightElement(t),t.className=r.trim(t.className)})})})},j=function(e){e.ui.registry.addButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:function(){return z(e)}}),e.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:function(){return z(e)}})};e.add("codesample",function(t,e){W(t),j(t),P(t),t.on("dblclick",function(e){g.isCodeSample(e.target)&&z(t)})}),function M(){}}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},x=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}},C=function(e){return function(){return e}},o=function(e){return e};function b(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var t,n,r,i,u,m=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}},a=function(e){return e()},c=C(!1),l=C(!0),f=c,s=l,d=function(){return g},g=(i={fold:function(e,t){return e()},is:f,isSome:f,isNone:s,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:n,map:d,ap:d,each:function(){},bind:d,flatten:d,exists:f,forall:s,filter:d,equals:t=function(e){return e.isNone()},equals_:t,toArray:function(){return[]},toString:C("none()")},Object.freeze&&Object.freeze(i),i),p=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:s,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return p(e(n))},ap:function(e){return e.fold(d,function(e){return p(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:g},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(f,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},S={some:p,none:d,from:function(e){return null===e||e===undefined?g:p(e)}},h=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},v=h("string"),w=h("array"),R=h("boolean"),T=h("function"),D=h("number"),O=(u=Array.prototype.indexOf)===undefined?function(e,t){return _(e,t)}:function(e,t){return u.call(e,t)},A=function(e,t){return-1<O(e,t)},E=function(e,t){return W(e,t).isSome()},N=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},k=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},I=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},P=function(e,t,n){return function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){n=t(n,e)}),n},B=function(e,t,n){return k(e,function(e){n=t(n,e)}),n},M=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return S.some(o)}return S.none()},W=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return S.some(n);return S.none()},_=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},L=Array.prototype.push,j=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);L.apply(t,e[n])}return t},z=function(e,t){var n=N(e,t);return j(n)},H=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},F=Array.prototype.slice,U=function(e){var t=F.call(e,0);return t.reverse(),t},q=(T(Array.from)&&Array.from,Object.keys),V=Object.hasOwnProperty,G=function(e,t){for(var n=q(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},Y=function(e,r){return K(e,function(e,t,n){return{k:t,v:r(e,t,n)}})},K=function(r,o){var i={};return G(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},X=function(e,t){return $(e,t)?S.some(e[t]):S.none()},$=function(e,t){return V.call(e,t)},J=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return k(t,function(e,t){r[e]=C(n[t])}),r}},Q=function(e){return e.slice(0).sort()},Z=function(e,t){throw new Error("All required keys ("+Q(e).join(", ")+") were not specified. Specified keys were: "+Q(t).join(", ")+".")},ee=function(e){throw new Error("Unsupported keys for object: "+Q(e).join(", "))},te=function(t,e){if(!w(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");k(e,function(e){if(!v(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})},ne=function(e){var n=Q(e);M(n,function(e,t){return t<n.length-1&&e===n[t+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})},re=function(o,i){var u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return te("required",o),te("optional",i),ne(u),function(t){var n=q(t);H(o,function(e){return A(n,e)})||Z(o,n);var e=I(n,function(e){return!A(u,e)});0<e.length&&ee(e);var r={};return k(o,function(e){r[e]=C(t[e])}),k(i,function(e){r[e]=C(Object.prototype.hasOwnProperty.call(t,e)?S.some(t[e]):S.none())}),r}},oe=J("width","height"),ie=J("rows","columns"),ue=J("row","column"),ce=J("x","y"),ae=J("element","rowspan","colspan"),le=J("element","rowspan","colspan","isNew"),fe={dimensions:oe,grid:ie,address:ue,coords:ce,extended:J("element","rowspan","colspan","row","column"),detail:ae,detailnew:le,rowdata:J("element","cells","section"),elementnew:J("element","isNew"),rowdatanew:J("element","cells","section","isNew"),rowcells:J("cells","section"),rowdetails:J("details","section"),bounds:J("startRow","startCol","finishRow","finishCol")},se=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:C(e)}},de={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return se(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return se(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return se(n)},fromDom:se,fromPoint:function(e,t,n){var r=e.dom();return S.from(r.elementFromPoint(t,n)).map(se)}},me=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE),ge=Node.DOCUMENT_NODE,pe=(Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),he=Node.TEXT_NODE,ve=(Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,pe),be=ge,we=function(e,t){var n=e.dom();if(n.nodeType!==ve)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},ye=function(e){return e.nodeType!==ve&&e.nodeType!==be||0===e.childElementCount},xe="undefined"!=typeof window?window:Function("return this;")(),Ce=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:xe,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},Se=function(e,t){var n=Ce(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n},Re=function(){return Se("Node")},Te=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},De=function(e,t){return Te(e,t,Re().DOCUMENT_POSITION_CONTAINED_BY)},Oe=function(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}},Ae=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Ne(r(1),r(2))},Ee=function(){return Ne(0,0)},Ne=function(e,t){return{major:e,minor:t}},ke={nu:Ne,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Ee():Ae(e,n)},unknown:Ee},Ie="Firefox",Pe=function(e,t){return function(){return t===e}},Be=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Pe("Edge",t),isChrome:Pe("Chrome",t),isIE:Pe("IE",t),isOpera:Pe("Opera",t),isFirefox:Pe(Ie,t),isSafari:Pe("Safari",t)}},Me={unknown:function(){return Be({current:undefined,version:ke.unknown()})},nu:Be,edge:C("Edge"),chrome:C("Chrome"),ie:C("IE"),opera:C("Opera"),firefox:C(Ie),safari:C("Safari")},We="Windows",_e="Android",Le="Solaris",je="FreeBSD",ze=function(e,t){return function(){return t===e}},He=function(e){var t=e.current;return{current:t,version:e.version,isWindows:ze(We,t),isiOS:ze("iOS",t),isAndroid:ze(_e,t),isOSX:ze("OSX",t),isLinux:ze("Linux",t),isSolaris:ze(Le,t),isFreeBSD:ze(je,t)}},Fe={unknown:function(){return He({current:undefined,version:ke.unknown()})},nu:He,windows:C(We),ios:C("iOS"),android:C(_e),linux:C("Linux"),osx:C("OSX"),solaris:C(Le),freebsd:C(je)},Ue=function(e,t){var n=String(t).toLowerCase();return M(e,function(e){return e.search(n)})},qe=function(e,n){return Ue(e,n).map(function(e){var t=ke.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Ve=function(e,n){return Ue(e,n).map(function(e){var t=ke.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Ge=function(e,t,n){return""===t||!(e.length<t.length)&&e.substr(n,n+t.length)===t},Ye=function(e,t){return-1!==e.indexOf(t)},Ke=function(e,t){return Ge(e,t,0)},Xe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$e=function(t){return function(e){return Ye(e,t)}},Je=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Ye(e,"edge/")&&Ye(e,"chrome")&&Ye(e,"safari")&&Ye(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Xe],search:function(e){return Ye(e,"chrome")&&!Ye(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Ye(e,"msie")||Ye(e,"trident")}},{name:"Opera",versionRegexes:[Xe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$e("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$e("firefox")},{name:"Safari",versionRegexes:[Xe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Ye(e,"safari")||Ye(e,"mobile/"))&&Ye(e,"applewebkit")}}],Qe=[{name:"Windows",search:$e("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Ye(e,"iphone")||Ye(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$e("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$e("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$e("linux"),versionRegexes:[]},{name:"Solaris",search:$e("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$e("freebsd"),versionRegexes:[]}],Ze={browsers:C(Je),oses:C(Qe)},et=function(e){var t,n,r,o,i,u,c,a,l,f,s,d=Ze.browsers(),m=Ze.oses(),g=qe(d,e).fold(Me.unknown,Me.nu),p=Ve(m,e).fold(Fe.unknown,Fe.nu);return{browser:g,os:p,deviceType:(n=g,r=e,o=(t=p).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,u=t.isAndroid()&&3===t.version.major,c=t.isAndroid()&&4===t.version.major,a=o||u||c&&!0===/mobile/i.test(r),l=t.isiOS()||t.isAndroid(),f=l&&!a,s=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:C(o),isiPhone:C(i),isTablet:C(a),isPhone:C(f),isTouch:C(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:C(s)})}},tt={detect:Oe(function(){var e=navigator.userAgent;return et(e)})},nt=function(e,t){return e.dom()===t.dom()},rt=tt.detect().browser.isIE()?function(e,t){return De(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},ot=we,it=function(e){return de.fromDom(e.dom().ownerDocument)},ut=function(e){var t=e.dom();return S.from(t.parentNode).map(de.fromDom)},ct=function(e,t){for(var n=T(t)?t:C(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=de.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},at=function(e){var t=e.dom();return S.from(t.previousSibling).map(de.fromDom)},lt=function(e){var t=e.dom();return S.from(t.nextSibling).map(de.fromDom)},ft=function(e){var t=e.dom();return N(t.childNodes,de.fromDom)},st=function(e,t){var n=e.dom().childNodes;return S.from(n[t]).map(de.fromDom)},dt=(J("element","offset"),function(e,t,n){return z(ft(e),function(e){return we(e,t)?n(e)?[e]:[]:dt(e,t,n)})}),mt={firstLayer:function(e,t){return dt(e,t,C(!0))},filterFirstLayer:dt},gt=function(e){return e.dom().nodeName.toLowerCase()},pt=function(e){return e.dom().nodeType},ht=function(t){return function(e){return pt(e)===t}},vt=function(e){return pt(e)===me||"#comment"===gt(e)},bt=ht(pe),wt=ht(he),yt=ht(ge),xt=function(e,t,n){if(!(v(n)||R(n)||D(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},Ct=function(e,t,n){xt(e.dom(),t,n)},St=function(e,t){var n=e.dom();G(t,function(e,t){xt(n,t,e)})},Rt=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},Tt=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},Dt=function(e,t){e.dom().removeAttribute(t)},Ot=function(e){return B(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},At=function(e){var t=wt(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)},Et=Oe(function(){return Nt(de.fromDom(document))}),Nt=function(e){var t=e.dom().body;if(null===t||t===undefined)throw new Error("Body is not available yet");return de.fromDom(t)},kt=function(e,t){var n=[];return k(ft(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(kt(e,t))}),n},It=function(e,t,n){return r=function(e){return we(e,t)},I(ct(e,n),r);var r},Pt=function(e,t){return n=function(e){return we(e,t)},I(ft(e),n);var n},Bt=function(e,t){return n=t,o=(r=e)===undefined?document:r.dom(),ye(o)?[]:N(o.querySelectorAll(n),de.fromDom);var n,r,o};function Mt(e,t,n,r,o){return e(n,r)?S.some(n):T(o)&&o(n)?S.none():t(n,r,o)}var Wt=function(e,t,n){for(var r=e.dom(),o=T(n)?n:C(!1);r.parentNode;){r=r.parentNode;var i=de.fromDom(r);if(t(i))return S.some(i);if(o(i))break}return S.none()},_t=function(e,t,n){return Wt(e,function(e){return we(e,t)},n)},Lt=function(e,t){return n=function(e){return we(e,t)},M(e.dom().childNodes,x(n,de.fromDom)).map(de.fromDom);var n},jt=function(e,t){return n=t,o=(r=e)===undefined?document:r.dom(),ye(o)?S.none():S.from(o.querySelector(n)).map(de.fromDom);var n,r,o},zt=function(e,t,n){return Mt(we,_t,e,t,n)},Ht=function(e,t,n){var r=n!==undefined?n:C(!1);return r(t)?S.none():A(e,gt(t))?S.some(t):_t(t,e.join(","),function(e){return we(e,"table")||r(e)})},Ft=function(t,e){return ut(e).map(function(e){return Pt(e,t)})},Ut=b(Ft,"th,td"),qt=b(Ft,"tr"),Vt=function(e,t){return parseInt(Rt(e,t),10)},Gt={cell:function(e,t){return Ht(["td","th"],e,t)},firstCell:function(e){return jt(e,"th,td")},cells:function(e){return mt.firstLayer(e,"th,td")},neighbourCells:Ut,table:function(e,t){return zt(e,"table",t)},row:function(e,t){return Ht(["tr"],e,t)},rows:function(e){return mt.firstLayer(e,"tr")},notCell:function(e,t){return Ht(["caption","tr","tbody","tfoot","thead"],e,t)},neighbourRows:qt,attr:Vt,grid:function(e,t,n){var r=Vt(e,t),o=Vt(e,n);return fe.grid(r,o)}},Yt=function(e){var t=Gt.rows(e);return N(t,function(e){var t=e,n=ut(t).map(function(e){var t=gt(e);return"tfoot"===t||"thead"===t||"tbody"===t?t:"tbody"}).getOr("tbody"),r=N(Gt.cells(e),function(e){var t=Tt(e,"rowspan")?parseInt(Rt(e,"rowspan"),10):1,n=Tt(e,"colspan")?parseInt(Rt(e,"colspan"),10):1;return fe.detail(e,t,n)});return fe.rowdata(t,r,n)})},Kt=function(e,n){return N(e,function(e){var t=N(Gt.cells(e),function(e){var t=Tt(e,"rowspan")?parseInt(Rt(e,"rowspan"),10):1,n=Tt(e,"colspan")?parseInt(Rt(e,"colspan"),10):1;return fe.detail(e,t,n)});return fe.rowdata(e,t,n.section())})},Xt=function(e,t){return e+","+t},$t=function(e,t){var n=z(e.all(),function(e){return e.cells()});return I(n,t)},Jt={generate:function(e){var f={},t=[],n=e.length,s=0;k(e,function(e,a){var l=[];k(e.cells(),function(e,t){for(var n=0;f[Xt(a,n)]!==undefined;)n++;for(var r=fe.extended(e.element(),e.rowspan(),e.colspan(),a,n),o=0;o<e.colspan();o++)for(var i=0;i<e.rowspan();i++){var u=n+o,c=Xt(a+i,u);f[c]=r,s=Math.max(s,u+1)}l.push(r)}),t.push(fe.rowdata(e.element(),l,e.section()))});var r=fe.grid(n,s);return{grid:C(r),access:C(f),all:C(t)}},getAt:function(e,t,n){var r=e.access()[Xt(t,n)];return r!==undefined?S.some(r):S.none()},findItem:function(e,t,n){var r=$t(e,function(e){return n(t,e.element())});return 0<r.length?S.some(r[0]):S.none()},filterItems:$t,justCells:function(e){var t=N(e.all(),function(e){return e.cells()});return j(t)}},Qt=function(e){return e.style!==undefined},Zt=function(e,t,n){if(!v(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Qt(e)&&e.style.setProperty(t,n)},en=function(e,t,n){var r=e.dom();Zt(r,t,n)},tn=function(e,t){var n=e.dom();G(t,function(e,t){Zt(n,t,e)})},nn=function(e,t){var n=e.dom(),r=window.getComputedStyle(n).getPropertyValue(t),o=""!==r||At(e)?r:rn(n,t);return null===o?undefined:o},rn=function(e,t){return Qt(e)?e.style.getPropertyValue(t):""},on=function(e,t){var n=e.dom(),r=rn(n,t);return S.from(r).filter(function(e){return 0<e.length})},un=function(e,t){var n,r,o=e.dom();r=t,Qt(n=o)&&n.style.removeProperty(r),Tt(e,"style")&&""===Rt(e,"style").replace(/^\s+|\s+$/g,"")&&Dt(e,"style")},cn=function(t,n){ut(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},an=function(e,t){lt(e).fold(function(){ut(e).each(function(e){fn(e,t)})},function(e){cn(e,t)})},ln=function(t,n){st(t,0).fold(function(){fn(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},fn=function(e,t){e.dom().appendChild(t.dom())},sn=function(e,t){cn(e,t),fn(t,e)},dn=function(r,o){k(o,function(e,t){var n=0===t?r:o[t-1];an(n,e)})},mn=function(t,e){k(e,function(e){fn(t,e)})},gn=function(e){e.dom().textContent="",k(ft(e),function(e){pn(e)})},pn=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},hn=function(e){var t,n=ft(e);0<n.length&&(t=e,k(n,function(e){cn(t,e)})),pn(e)},vn=J("minRow","minCol","maxRow","maxCol"),bn=function(e,t){var n,i,r,u,c,a,l,o,f,s,d=function(e){return we(e.element(),t)},m=Yt(e),g=Jt.generate(m),p=(i=d,r=(n=g).grid().columns(),u=n.grid().rows(),c=r,l=a=0,G(n.access(),function(e){if(i(e)){var t=e.row(),n=t+e.rowspan()-1,r=e.column(),o=r+e.colspan()-1;t<u?u=t:a<n&&(a=n),r<c?c=r:l<o&&(l=o)}}),vn(u,c,a,l)),h="th:not("+t+"),td:not("+t+")",v=mt.filterFirstLayer(e,"th,td",function(e){return we(e,h)});return k(v,pn),function(e,t,n,r){for(var o,i,u,c=t.grid().columns(),a=t.grid().rows(),l=0;l<a;l++)for(var f=!1,s=0;s<c;s++)l<n.minRow()||l>n.maxRow()||s<n.minCol()||s>n.maxCol()||(Jt.getAt(t,l,s).filter(r).isNone()?(o=f,i=e[l].element(),u=de.fromTag("td"),fn(u,de.fromTag("br")),(o?fn:ln)(i,u)):f=!0)}(m,g,p,d),o=e,f=p,s=I(mt.firstLayer(o,"tr"),function(e){return 0===e.dom().childElementCount}),k(s,pn),f.minCol()!==f.maxCol()&&f.minRow()!==f.maxRow()||k(mt.firstLayer(o,"th,td"),function(e){Dt(e,"rowspan"),Dt(e,"colspan")}),Dt(o,"width"),Dt(o,"height"),un(o,"width"),un(o,"height"),e},wn=function(e,t){return de.fromDom(e.dom().cloneNode(t))},yn=function(e){return wn(e,!1)},xn=function(e){return wn(e,!0)},Cn=function(e,t){var n,r,o,i,u=(n=e,r=t,o=de.fromTag(r),i=Ot(n),St(o,i),o),c=ft(xn(e));return mn(u,c),u},Sn=function ls(n,r){var o=function(e){return n(e)?S.from(e.dom().nodeValue):S.none()},e=tt.detect().browser,t=e.isIE()&&10===e.version.major?function(e){try{return o(e)}catch(t){return S.none()}}:o;return{get:function(e){if(!n(e))throw new Error("Can only get "+r+" value of a "+r+" node");return t(e).getOr("")},getOption:t,set:function(e,t){if(!n(e))throw new Error("Can only set raw "+r+" value of a "+r+" node");e.dom().nodeValue=t}}}(wt,"text"),Rn=function(e){return Sn.get(e)},Tn=function(e){return Sn.getOption(e)},Dn=function(e,t){Sn.set(e,t)},On=function(e){return"img"===gt(e)?1:Tn(e).fold(function(){return ft(e).length},function(e){return e.length})},An=["img","br"],En=function(e){return Tn(e).filter(function(e){return 0!==e.trim().length||-1<e.indexOf("\xa0")}).isSome()||A(An,gt(e))},Nn=function(e){return r=En,(o=function(e){for(var t=0;t<e.childNodes.length;t++){if(r(de.fromDom(e.childNodes[t])))return S.some(de.fromDom(e.childNodes[t]));var n=o(e.childNodes[t]);if(n.isSome())return n}return S.none()})(e.dom());var r,o},kn=function(e){return In(e,En)},In=function(e,i){var u=function(e){for(var t=ft(e),n=t.length-1;0<=n;n--){var r=t[n];if(i(r))return S.some(r);var o=u(r);if(o.isSome())return o}return S.none()};return u(e)},Pn=function(){var e=de.fromTag("td");return fn(e,de.fromTag("br")),e},Bn=function(e,t,n){var r=Cn(e,t);return G(n,function(e,t){null===e?Dt(r,t):Ct(r,t,e)}),r},Mn=function(e){return e},Wn=function(e){return function(){return de.fromTag("tr",e.dom())}},_n=function(d,e,m){return{row:Wn(e),cell:function(e){var r,o,i,t,n,u,c,a=it(e.element()),l=de.fromTag(gt(e.element()),a.dom()),f=m.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),s=0<f.length?(r=e.element(),o=l,i=f,Nn(r).map(function(e){var t=i.join(","),n=It(e,t,function(e){return nt(e,r)});return P(n,function(e,t){var n=yn(t);return Dt(n,"contenteditable"),fn(e,n),n},o)}).getOr(o)):l;return fn(s,de.fromTag("br")),t=e.element(),n=l,u=t.dom(),c=n.dom(),Qt(u)&&Qt(c)&&(c.style.cssText=u.style.cssText),un(l,"height"),1!==e.colspan()&&un(e.element(),"width"),d(e.element(),l),l},replace:Bn,gap:Pn}},Ln=function(e){return{row:Wn(e),cell:Pn,replace:Mn,gap:Pn}},jn=["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 zn(){return{up:C({selector:_t,closest:zt,predicate:Wt,all:ct}),down:C({selector:Bt,predicate:kt}),styles:C({get:nn,getRaw:on,set:en,remove:un}),attrs:C({get:Rt,set:Ct,remove:Dt,copyTo:function(e,t){var n=Ot(e);St(t,n)}}),insert:C({before:cn,after:an,afterAll:dn,append:fn,appendAll:mn,prepend:ln,wrap:sn}),remove:C({unwrap:hn,remove:pn}),create:C({nu:de.fromTag,clone:function(e){return de.fromDom(e.dom().cloneNode(!1))},text:de.fromText}),query:C({comparePosition:function(e,t){return e.dom().compareDocumentPosition(t.dom())},prevSibling:at,nextSibling:lt}),property:C({children:ft,name:gt,parent:ut,isText:wt,isComment:vt,isElement:bt,getText:Rn,setText:Dn,isBoundary:function(e){return!!bt(e)&&("body"===gt(e)||A(jn,gt(e)))},isEmptyTag:function(e){return!!bt(e)&&A(["br","img","hr","input"],gt(e))}}),eq:nt,is:ot}}var Hn=J("left","right"),Fn=function(e,t,n){var r=e.property().children(t);return W(r,b(e.eq,n)).map(function(e){return{before:C(r.slice(0,e)),after:C(r.slice(e+1))}})},Un=function(n,r,o){return Fn(n,r,o).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.before().concat([o])),n.insert().appendAll(r,e.after()),n.insert().before(r,t),Hn(t,r)})},qn=function(n,r,e){return Fn(n,r,e).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.after()),n.insert().after(r,t),Hn(r,t)})},Vn=function(i,e,u,c){var r=J("first","second","splits"),a=function(e,t,o){var n=r(e,S.none(),o);return u(e)?r(e,t,o):i.property().parent(e).bind(function(r){return c(i,r,e).map(function(e){var t=[{first:e.left,second:e.right}],n=u(r)?r:e.left();return a(n,S.some(e.right()),o.concat(t))}).getOr(n)})};return a(e,S.none(),[])},Gn=function(r,o,e,t){var n=o(r,e);return P(t,function(e,t){var n=o(r,t);return Yn(r,e,n)},n)},Yn=function(t,e,n){return e.bind(function(e){return n.filter(b(t.eq,e))})},Kn=function(e,t,n){return 0<n.length?Gn(e,t,(r=n)[0],r.slice(1)):S.none();var r},Xn=function(e,t){return b(e.eq,t)},$n=function(t,e,n,r){var o=r!==undefined?r:C(!1),i=[e].concat(t.up().all(e)),u=[n].concat(t.up().all(n)),c=function(t){return W(t,o).fold(function(){return t},function(e){return t.slice(0,e+1)})},a=c(i),l=c(u),f=M(a,function(e){return E(l,Xn(t,e))});return{firstpath:C(a),secondpath:C(l),shared:C(f)}},Jn=function(t,e,n){var r=$n(t,e,n);return r.shared().bind(function(e){return function(o,i,e,t){var u=o.property().children(i);if(o.eq(i,e[0]))return S.some([e[0]]);if(o.eq(i,t[0]))return S.some([t[0]]);var n=function(e){var t=U(e),n=W(t,Xn(o,i)).getOr(-1),r=n<t.length-1?t[n+1]:t[n];return W(u,Xn(o,r))},r=n(e),c=n(t);return r.bind(function(r){return c.map(function(e){var t=Math.min(r,e),n=Math.max(r,e);return u.slice(t,n+1)})})}(t,e,r.firstpath(),r.secondpath())})},Qn=$n,Zn=function(e,t,n){return Kn(e,t,n)},er=function(e,t,n){return Jn(e,t,n)},tr=function(e,t,n,r){return Qn(e,t,n,r)},nr=function(e,t,n){return Un(e,t,n)},rr=function(e,t,n){return qn(e,t,n)},or=function(e,t,n,r){return Vn(e,t,n,r)},ir=zn(),ur={sharedOne:function(n,e){return Zn(ir,function(e,t){return n(t)},e)},subset:function(e,t){return er(ir,e,t)},ancestors:function(e,t,n){return tr(ir,e,t,n)},breakToLeft:function(e,t){return nr(ir,e,t)},breakToRight:function(e,t){return rr(ir,e,t)},breakPath:function(e,t,r){return or(ir,e,t,function(e,t,n){return r(t,n)})}},cr=function(e,t){return t.column()>=e.startCol()&&t.column()+t.colspan()-1<=e.finishCol()&&t.row()>=e.startRow()&&t.row()+t.rowspan()-1<=e.finishRow()},ar=function(e,t){var n=t.column(),r=t.column()+t.colspan()-1,o=t.row(),i=t.row()+t.rowspan()-1;return n<=e.finishCol()&&r>=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},lr=function(e,t){for(var n=!0,r=b(cr,t),o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)n=n&&Jt.getAt(e,o,i).exists(r);return n?S.some(t):S.none()},fr=function(e,t,n){var r=Jt.findItem(e,t,nt),o=Jt.findItem(e,n,nt);return r.bind(function(r){return o.map(function(e){return t=r,n=e,fe.bounds(Math.min(t.row(),n.row()),Math.min(t.column(),n.column()),Math.max(t.row()+t.rowspan()-1,n.row()+n.rowspan()-1),Math.max(t.column()+t.colspan()-1,n.column()+n.colspan()-1));var t,n})})},sr=fr,dr=function(t,e,n){return fr(t,e,n).bind(function(e){return lr(t,e)})},mr=function(r,e,o,i){return Jt.findItem(r,e,nt).bind(function(e){var t=0<o?e.row()+e.rowspan()-1:e.row(),n=0<i?e.column()+e.colspan()-1:e.column();return Jt.getAt(r,t+o,n+i).map(function(e){return e.element()})})},gr=function(n,e,t){return sr(n,e,t).map(function(e){var t=Jt.filterItems(n,b(ar,e));return N(t,function(e){return e.element()})})},pr=function(e,t){return Jt.findItem(e,t,function(e,t){return rt(t,e)}).bind(function(e){return e.element()})},hr=function(e){var t=Yt(e);return Jt.generate(t)},vr=function(n,r,o){return Gt.table(n).bind(function(e){var t=hr(e);return mr(t,n,r,o)})},br=function(e,t,n){var r=hr(e);return gr(r,t,n)},wr=function(e,t,n,r,o){var i=hr(e),u=nt(e,n)?t:pr(i,t),c=nt(e,o)?r:pr(i,r);return gr(i,u,c)},yr=function(e,t,n){var r=hr(e);return dr(r,t,n)},xr=function(e,t){return _t(e,"table")},Cr=re(["boxes","start","finish"],[]),Sr=function(c,a,r){var l=function(t){return function(e){return r(e)||nt(e,t)}};return nt(c,a)?S.some(Cr({boxes:S.some([c]),start:c,finish:a})):xr(c).bind(function(u){return xr(a).bind(function(i){if(nt(u,i))return S.some(Cr({boxes:br(u,c,a),start:c,finish:a}));if(rt(u,i)){var e=0<(t=It(a,"td,th",l(u))).length?t[t.length-1]:a;return S.some(Cr({boxes:wr(u,c,u,a,i),start:c,finish:e}))}if(rt(i,u)){var t,n=0<(t=It(c,"td,th",l(i))).length?t[t.length-1]:c;return S.some(Cr({boxes:wr(i,c,u,a,i),start:c,finish:n}))}return ur.ancestors(c,a).shared().bind(function(e){return zt(e,"table",r).bind(function(e){var t=It(a,"td,th",l(e)),n=0<t.length?t[t.length-1]:a,r=It(c,"td,th",l(e)),o=0<r.length?r[r.length-1]:c;return S.some(Cr({boxes:wr(e,c,u,a,i),start:o,finish:n}))})})})})},Rr=Sr,Tr=function(e,t){var n=Bt(e,t);return 0<n.length?S.some(n):S.none()},Dr=function(e,t,n,r,o){return(i=e,u=o,M(i,function(e){return we(e,u)})).bind(function(e){return vr(e,t,n).bind(function(e){return n=r,_t(t=e,"table").bind(function(e){return jt(e,n).bind(function(e){return Sr(e,t).bind(function(t){return t.boxes().map(function(e){return{boxes:C(e),start:C(t.start()),finish:C(t.finish())}})})})});var t,n})});var i,u},Or=function(e,t,r){return jt(e,t).bind(function(n){return jt(e,r).bind(function(t){return ur.sharedOne(xr,[n,t]).map(function(e){return{first:C(n),last:C(t),table:C(e)}})})})},Ar=function(e,t){return Tr(e,t)},Er=function(o,e,t){return Or(o,e,t).bind(function(n){var e=function(e){return nt(o,e)},t=_t(n.first(),"thead,tfoot,tbody,table",e),r=_t(n.last(),"thead,tfoot,tbody,table",e);return t.bind(function(t){return r.bind(function(e){return nt(t,e)?yr(n.table(),n.first(),n.last()):S.none()})})})},Nr="data-mce-selected",kr="data-mce-first-selected",Ir="data-mce-last-selected",Pr={selected:C(Nr),selectedSelector:C("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:C("[data-mce-selected]"),firstSelected:C(kr),firstSelectedSelector:C("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:C(Ir),lastSelectedSelector:C("td[data-mce-last-selected],th[data-mce-last-selected]")},Br=function(u){if(!w(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var c=[],n={};return k(u,function(e,r){var t=q(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!w(i))throw new Error("case arguments must be an array");c.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=q(e);if(c.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+t.join(","));if(!H(c,function(e){return A(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+c.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:c,constructor:o,params:n})}}}}),n},Mr=Br([{none:[]},{multiple:["elements"]},{single:["selection"]}]),Wr={cata:function(e,t,n,r){return e.fold(t,n,r)},none:Mr.none,multiple:Mr.multiple,single:Mr.single},_r=function(e,t){return Wr.cata(t.get(),C([]),o,C([e]))},Lr=function(n,e){return Wr.cata(e.get(),S.none,function(t,e){return 0===t.length?S.none():Er(n,Pr.firstSelectedSelector(),Pr.lastSelectedSelector()).bind(function(e){return 1<t.length?S.some({bounds:C(e),cells:C(t)}):S.none()})},S.none)},jr=function(e,t){var n=_r(e,t);return 0<n.length&&H(n,function(e){return Tt(e,"rowspan")&&1<parseInt(Rt(e,"rowspan"),10)||Tt(e,"colspan")&&1<parseInt(Rt(e,"colspan"),10)})?S.some(n):S.none()},zr=_r,Hr=function(e){return{element:C(e),mergable:S.none,unmergable:S.none,selection:C([e])}},Fr=J("element","clipboard","generators"),Ur={noMenu:Hr,forMenu:function(e,t,n){return{element:C(n),mergable:C(Lr(t,e)),unmergable:C(jr(n,e)),selection:C(zr(n,e))}},notCell:function(e){return Hr(e)},paste:Fr,pasteRows:function(e,t,n,r,o){return{element:C(n),mergable:S.none,unmergable:S.none,selection:C(zr(n,e)),clipboard:C(r),generators:C(o)}}},qr=function(f,e,s,d){f.on("BeforeGetContent",function(n){!0===n.selection&&Wr.cata(e.get(),y,function(e){var t;n.preventDefault(),(t=e,Gt.table(t[0]).map(xn).map(function(e){return[bn(e,Pr.attributeSelector())]})).each(function(e){var t;n.content="text"===n.format?N(e,function(e){return e.dom().innerText}).join(""):(t=f,N(e,function(e){return t.selection.serializer.serialize(e.dom(),{})}).join(""))})},y)}),f.on("BeforeSetContent",function(l){!0===l.selection&&!0===l.paste&&S.from(f.dom.getParent(f.selection.getStart(),"th,td")).each(function(e){var a=de.fromDom(e);Gt.table(a).bind(function(t){var e,n,r,o=I((e=l.content,(r=(n||document).createElement("div")).innerHTML=e,ft(de.fromDom(r))),function(e){return"meta"!==gt(e)});if(1===o.length&&"table"===gt(o[0])){l.preventDefault();var i=de.fromDom(f.getDoc()),u=Ln(i),c=Ur.paste(a,o[0],u);s.pasteCells(t,c).each(function(e){f.selection.setRng(e),f.focus(),d.clear(t)})}})})})};function Vr(r,o){var e=function(e){var t=o(e);if(t<=0||null===t){var n=nn(e,r);return parseFloat(n)||0}return t},i=function(o,e){return B(e,function(e,t){var n=nn(o,t),r=n===undefined?0:parseInt(n,10);return isNaN(r)?e:e+r},0)};return{set:function(e,t){if(!D(t)&&!t.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+t);var n=e.dom();Qt(n)&&(n.style[r]=t+"px")},get:e,getOuter:e,aggregate:i,max:function(e,t,n){var r=i(e,n);return r<t?t-r:0}}}var Gr=Vr("height",function(e){var t=e.dom();return At(e)?t.getBoundingClientRect().height:t.offsetHeight}),Yr=function(e){return Gr.get(e)},Kr=function(e){return Gr.getOuter(e)},Xr=Vr("width",function(e){return e.dom().offsetWidth}),$r=function(e){return Xr.get(e)},Jr=function(e){return Xr.getOuter(e)},Qr=tt.detect(),Zr=function(e,t,n){return r=nn(e,t),o=n,i=parseFloat(r),isNaN(i)?o:i;var r,o,i},eo=function(e){return Qr.browser.isIE()||Qr.browser.isEdge()?(n=Zr(t=e,"padding-top",0),r=Zr(t,"padding-bottom",0),o=Zr(t,"border-top-width",0),i=Zr(t,"border-bottom-width",0),u=t.dom().getBoundingClientRect().height,"border-box"===nn(t,"box-sizing")?u:u-n-r-(o+i)):Zr(e,"height",Yr(e));var t,n,r,o,i,u},to=/(\d+(\.\d+)?)(\w|%)*/,no=/(\d+(\.\d+)?)%/,ro=/(\d+(\.\d+)?)px|em/,oo=function(e,t){en(e,"height",t+"px")},io=function(e,t,n,r){var o,i,u,c,a,l,f,s=parseInt(e,10);return Ge(l=e,f="%",l.length-f.length)&&"table"!==gt(t)?(o=t,i=s,u=n,c=r,a=Gt.table(o).map(function(e){var t=u(e);return Math.floor(i/100*t)}).getOr(i),c(o,a),a):s},uo=function(e){var t,n=on(t=e,"height").getOrThunk(function(){return eo(t)+"px"});return n?io(n,e,Yr,oo):Yr(e)},co=function(e,t){return Tt(e,t)?parseInt(Rt(e,t),10):1},ao=function(e){return on(e,"width").fold(function(){return S.from(Rt(e,"width"))},function(e){return S.some(e)})},lo=function(e,t){return e/t.pixelWidth()*100},fo={percentageBasedSizeRegex:C(no),pixelBasedSizeRegex:C(ro),setPixelWidth:function(e,t){en(e,"width",t+"px")},setPercentageWidth:function(e,t){en(e,"width",t+"%")},setHeight:oo,getPixelWidth:function(t,n){return ao(t).fold(function(){return $r(t)},function(e){return function(e,t,n){if(ro.test(t)){var r=ro.exec(t);return parseInt(r[1],10)}if(no.test(t)){var o=no.exec(t),i=parseFloat(o[1]);return i/100*n.pixelWidth()}return $r(e)}(t,e,n)})},getPercentageWidth:function(t,n){return ao(t).fold(function(){var e=$r(t);return lo(e,n)},function(e){return function(e,t,n){if(no.test(t)){var r=no.exec(t);return parseFloat(r[1])}var o=$r(e);return lo(o,n)}(t,e,n)})},getGenericWidth:function(e){return ao(e).bind(function(e){if(to.test(e)){var t=to.exec(e);return S.some({width:C(t[1]),unit:C(t[3])})}return S.none()})},setGenericWidth:function(e,t,n){en(e,"width",t+n)},getHeight:function(e){return n="rowspan",uo(t=e)/co(t,n);var t,n},getRawWidth:ao},so=function(n,r){fo.getGenericWidth(n).each(function(e){var t=e.width()/2;fo.setGenericWidth(n,t,e.unit()),fo.setGenericWidth(r,t,e.unit())})},mo=function(n,r){return{left:C(n),top:C(r),translate:function(e,t){return mo(n+e,r+t)}}},go=mo,po=function(e,t){return e!==undefined?e:t!==undefined?t:0},ho=function(e){var t,n,r=e.dom().ownerDocument,o=r.body,i=(t=de.fromDom(r),(n=t.dom())===n.window&&t instanceof Window?t:yt(t)?n.defaultView||n.parentWindow:null),u=r.documentElement,c=po(i.pageYOffset,u.scrollTop),a=po(i.pageXOffset,u.scrollLeft),l=po(u.clientTop,o.clientTop),f=po(u.clientLeft,o.clientLeft);return vo(e).translate(a-f,c-l)},vo=function(e){var t,n,r,o=e.dom(),i=o.ownerDocument,u=i.body,c=de.fromDom(i.documentElement);return u===o?go(u.offsetLeft,u.offsetTop):(t=e,n=c||de.fromDom(document.documentElement),Wt(t,b(nt,n)).isSome()?(r=o.getBoundingClientRect(),go(r.left,r.top)):go(0,0))},bo=J("row","y"),wo=J("col","x"),yo=function(e){return ho(e).left()+Jr(e)},xo=function(e){return ho(e).left()},Co=function(e,t){return wo(e,xo(t))},So=function(e,t){return wo(e,yo(t))},Ro=function(e){return ho(e).top()},To=function(n,t,r){if(0===r.length)return[];var e=N(r.slice(1),function(e,t){return e.map(function(e){return n(t,e)})}),o=r[r.length-1].map(function(e){return t(r.length-1,e)});return e.concat([o])},Do={delta:o,positions:b(To,function(e,t){return bo(e,Ro(t))},function(e,t){return bo(e,Ro(t)+Kr(t))}),edge:Ro},Oo={delta:o,edge:xo,positions:b(To,Co,So)},Ao={height:Do,rtl:{delta:function(e,t){return-e},edge:yo,positions:b(To,So,Co)},ltr:Oo},Eo={ltr:Ao.ltr,rtl:Ao.rtl};function No(t){var n=function(e){return t(e).isRtl()?Eo.rtl:Eo.ltr};return{delta:function(e,t){return n(t).delta(e,t)},edge:function(e){return n(e).edge(e)},positions:function(e,t){return n(t).positions(e,t)}}}var ko,Io=function(e){var t=Yt(e);return Jt.generate(t).grid()},Po=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Po(n())}}},Bo=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return te("required",o),ne(o),function(t){var n=q(t);H(o,function(e){return A(n,e)})||Z(o,n),r(o,n);var e=I(o,function(e){return!i.validate(t[e],e)});return 0<e.length&&function(e,t){throw new Error("All values need to be of type: "+t+". Keys ("+Q(e).join(", ")+") were not.")}(e,i.label),t}},Mo=function(t,e){var n=I(e,function(e){return!A(t,e)});0<n.length&&ee(n)},Wo=function(e){return Bo(Mo,e,{validate:T,label:"function"})},_o=function(e){var t=Tt(e,"colspan")?parseInt(Rt(e,"colspan"),10):1,n=Tt(e,"rowspan")?parseInt(Rt(e,"rowspan"),10):1;return{element:C(e),colspan:C(t),rowspan:C(n)}},Lo=Wo(["cell","row","replace","gap"]),jo=function(r,e){Lo(r);var n=Po(S.none()),o=e!==undefined?e:_o,i=function(e){var t,n=o(e);return t=n,r.cell(t)},u=function(e){var t=i(e);return n.get().isNone()&&n.set(S.some(t)),c=S.some({item:e,replacement:t}),t},c=S.none();return{getOrInit:function(t,n){return c.fold(function(){return u(t)},function(e){return n(t,e.item)?e.replacement:u(t)})},cursor:n.get}},zo=function(o,c){return function(n){var r=Po(S.none());Lo(n);var i=[],u=function(e){var t=n.replace(e,c,{scope:o});return i.push({item:e,sub:t}),r.get().isNone()&&r.set(S.some(t)),t};return{replaceOrInit:function(t,n){return(r=t,o=n,M(i,function(e){return o(e.item,r)})).fold(function(){return u(t)},function(e){return n(t,e.item)?e.sub:u(t)});var r,o},cursor:r.get}}},Ho=function(n){Lo(n);var e=Po(S.none());return{combine:function(t){return e.get().isNone()&&e.set(S.some(t)),function(){var e=n.cell({element:C(t),colspan:C(1),rowspan:C(1)});return un(e,"width"),un(t,"width"),e}},cursor:e.get}},Fo=["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"],Uo=function(e,t){var n=e.property().name(t);return A(Fo,n)},qo=function(e,t){return A(["br","img","hr","input"],e.property().name(t))},Vo=Uo,Go=function(e,t){var n=e.property().name(t);return A(["ol","ul"],n)},Yo=qo,Ko=zn(),Xo=function(e){return Vo(Ko,e)},$o=function(e){return Go(Ko,e)},Jo=function(e){return Yo(Ko,e)},Qo=function(e){var t,i=function(e){return"br"===gt(e)},n=function(o){return kn(o).bind(function(n){var r=lt(n).map(function(e){return!!Xo(e)||(Jo(e)?"img"!==gt(e):void 0)}).getOr(!1);return ut(n).map(function(e){return!0===r||"li"===gt(t=e)||Wt(t,$o).isSome()||i(n)||Xo(e)&&!nt(o,e)?[]:[de.fromTag("br")];var t})}).getOr([])},r=0===(t=z(e,function(e){var t=ft(e);return H(t,function(e){return i(e)||wt(e)&&0===Rn(e).trim().length})?[]:t.concat(n(e))})).length?[de.fromTag("br")]:t;gn(e[0]),mn(e[0],r)},Zo=Object.prototype.hasOwnProperty,ei=(ko=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Zo.call(o,i)&&(n[i]=ko(n[i],o[i]))}return n}),ti=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},ni=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return S.none()},ri=function(e,t){return fe.rowcells(t,e.section())},oi=function(e,t){return e.cells()[t]},ii={addCell:function(e,t,n){var r=e.cells(),o=r.slice(0,t),i=r.slice(t),u=o.concat([n]).concat(i);return ri(e,u)},setCells:ri,mutateCell:function(e,t,n){e.cells()[t]=n},getCell:oi,getCellElement:function(e,t){return oi(e,t).element()},mapCells:function(e,t){var n=e.cells(),r=N(n,t);return fe.rowcells(r,e.section())},cellLength:function(e){return e.cells().length}},ui=function(e,t){if(0===e.length)return 0;var n=e[0];return W(e,function(e){return!t(n.element(),e.element())}).fold(function(){return e.length},function(e){return e})},ci=function(e,t,n,r){var o,i,u,c,a=(o=e,i=t,o[i]).cells().slice(n),l=ui(a,r),f=(u=e,c=n,N(u,function(e){return ii.getCell(e,c)})).slice(t),s=ui(f,r);return{colspan:C(l),rowspan:C(s)}},ai=function(o,i){var u=N(o,function(e,t){return N(e.cells(),function(e,t){return!1})});return N(o,function(e,r){var t=z(e.cells(),function(e,t){if(!1!==u[r][t])return[];var n=ci(o,r,t,i);return function(e,t,n,r){for(var o=e;o<e+n;o++)for(var i=t;i<t+r;i++)u[o][i]=!0}(r,t,n.rowspan(),n.colspan()),[fe.detailnew(e.element(),n.rowspan(),n.colspan(),e.isNew())]});return fe.rowdetails(t,e.section())})},li=function(e,t,n){for(var r=[],o=0;o<e.grid().rows();o++){for(var i=[],u=0;u<e.grid().columns();u++){var c=Jt.getAt(e,o,u).map(function(e){return fe.elementnew(e.element(),n)}).getOrThunk(function(){return fe.elementnew(t.gap(),!0)});i.push(c)}var a=fe.rowcells(i,e.all()[o].section());r.push(a)}return r},fi=function(e,t,n,r){n===r?Dt(e,t):Ct(e,t,n)},si=function(o,e){var i=[],u=[],t=function(e,t){0<e.length?function(e,t){var n=Lt(o,t).getOrThunk(function(){var e=de.fromTag(t,it(o).dom());return fn(o,e),e});gn(n);var r=N(e,function(e){e.isNew()&&i.push(e.element());var t=e.element();return gn(t),k(e.cells(),function(e){e.isNew()&&u.push(e.element()),fi(e.element(),"colspan",e.colspan(),1),fi(e.element(),"rowspan",e.rowspan(),1),fn(t,e.element())}),t});mn(n,r)}(e,t):Lt(o,t).each(pn)},n=[],r=[],c=[];return k(e,function(e){switch(e.section()){case"thead":n.push(e);break;case"tbody":r.push(e);break;case"tfoot":c.push(e)}}),t(n,"thead"),t(r,"tbody"),t(c,"tfoot"),{newRows:C(i),newCells:C(u)}},di=function(e){return N(e,function(e){var n=yn(e.element());return k(e.cells(),function(e){var t=xn(e.element());fi(t,"colspan",e.colspan(),1),fi(t,"rowspan",e.rowspan(),1),fn(n,t)}),n})},mi=function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n},gi=function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n},pi=function(t,n){if(n<0||n>=t.length-1)return S.none();var e=t[n].fold(function(){var e=U(t.slice(0,n));return ni(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return S.some({value:e,delta:0})}),r=t[n+1].fold(function(){var e=t.slice(n+1);return ni(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return S.some({value:e,delta:1})});return e.bind(function(n){return r.map(function(e){var t=e.delta+n.delta;return Math.abs(e.value-n.value)/t})})},hi=function(e,t,n){var r=e();return M(r,t).orThunk(function(){return S.from(r[0]).orThunk(n)}).map(function(e){return e.element()})},vi=function(n){var e=n.grid(),t=gi(0,e.columns()),r=gi(0,e.rows());return N(t,function(t){return hi(function(){return z(r,function(e){return Jt.getAt(n,e,t).filter(function(e){return e.column()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.colspan()},function(){return Jt.getAt(n,0,t)})})},bi=function(n){var e=n.grid(),t=gi(0,e.rows()),r=gi(0,e.columns());return N(t,function(t){return hi(function(){return z(r,function(e){return Jt.getAt(n,t,e).filter(function(e){return e.row()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.rowspan()},function(){return Jt.getAt(n,t,0)})})},wi=function(e,t,n,r,o){var i=de.fromTag("div");return tn(i,{position:"absolute",left:t-r/2+"px",top:n+"px",height:o+"px",width:r+"px"}),St(i,{"data-column":e,role:"presentation"}),i},yi=function(e,t,n,r,o){var i=de.fromTag("div");return tn(i,{position:"absolute",left:t+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),St(i,{"data-row":e,role:"presentation"}),i},xi=function(e){var t=e.replace(/\./g,"-");return{resolve:function(e){return t+"-"+e}}},Ci={resolve:xi("ephox-snooker").resolve},Si=function(e,t){var n=Rt(e,t);return n===undefined||""===n?[]:n.split(" ")},Ri=function(e){return e.dom().classList!==undefined},Ti=function(e,t){return o=t,i=Si(n=e,r="class").concat([o]),Ct(n,r,i.join(" ")),!0;var n,r,o,i},Di=function(e,t){return o=t,0<(i=I(Si(n=e,r="class"),function(e){return e!==o})).length?Ct(n,r,i.join(" ")):Dt(n,r),!1;var n,r,o,i},Oi=function(e,t){Ri(e)?e.dom().classList.add(t):Ti(e,t)},Ai=function(e){0===(Ri(e)?e.dom().classList:Si(e,"class")).length&&Dt(e,"class")},Ei=function(e,t){return Ri(e)&&e.dom().classList.contains(t)},Ni=Ci.resolve("resizer-bar"),ki=Ci.resolve("resizer-rows"),Ii=Ci.resolve("resizer-cols"),Pi=function(e){var t=Bt(e.parent(),"."+Ni);k(t,pn)},Bi=function(n,e,r){var o=n.origin();k(e,function(e,t){e.each(function(e){var t=r(o,e);Oi(t,Ni),fn(n.parent(),t)})})},Mi=function(e,t,n,r,o,i){var u,c,a,l,f=ho(t),s=0<n.length?o.positions(n,t):[];u=e,c=s,a=f,l=Jr(t),Bi(u,c,function(e,t){var n=yi(t.row(),a.left()-e.left(),t.y()-e.top(),l,7);return Oi(n,ki),n});var d,m,g,p,h=0<r.length?i.positions(r,t):[];d=e,m=h,g=f,p=Kr(t),Bi(d,m,function(e,t){var n=wi(t.col(),t.x()-e.left(),g.top()-e.top(),7,p);return Oi(n,Ii),n})},Wi=function(e,t){var n=Bt(e.parent(),"."+Ni);k(n,t)},_i={refresh:function(e,t,n,r){Pi(e);var o=Yt(t),i=Jt.generate(o),u=bi(i),c=vi(i);Mi(e,t,u,c,n,r)},hide:function(e){Wi(e,function(e){en(e,"display","none")})},show:function(e){Wi(e,function(e){en(e,"display","block")})},destroy:Pi,isRowBar:function(e){return Ei(e,ki)},isColBar:function(e){return Ei(e,Ii)}},Li=function(e,r){return N(e,function(e){var t,n=(t=e.details(),ni(t,function(e){return ut(e.element()).map(function(e){var t=ut(e).isNone();return fe.elementnew(e,t)})}).getOrThunk(function(){return fe.elementnew(r.row(),!0)}));return fe.rowdatanew(n.element(),e.details(),e.section(),n.isNew())})},ji=function(e,t){var n=ai(e,nt);return Li(n,t)},zi=function(e,t){var n=j(N(e.all(),function(e){return e.cells()}));return M(n,function(e){return nt(t,e.element())})},Hi=function(c,a,l,f,s){return function(n,r,e,o,i){var t=Yt(r),u=Jt.generate(t);return a(u,e).map(function(e){var t=li(u,o,!1),n=c(t,e,nt,s(o)),r=ji(n.grid(),o);return{grid:C(r),cursor:n.cursor}}).fold(function(){return S.none()},function(e){var t=si(r,e.grid());return l(r,e.grid(),i),f(r),_i.refresh(n,r,Ao.height,i),S.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})})}},Fi=ji,Ui=function(t,e){return Gt.cell(e.element()).bind(function(e){return zi(t,e)})},qi=function(t,e){var n=N(e.selection(),function(e){return Gt.cell(e).bind(function(e){return zi(t,e)})}),r=ti(n);return 0<r.length?S.some(r):S.none()},Vi=function(t,n){return Gt.cell(n.element()).bind(function(e){return zi(t,e).map(function(e){return ei(e,{generators:n.generators,clipboard:n.clipboard})})})},Gi=function(t,e){var n=N(e.selection(),function(e){return Gt.cell(e).bind(function(e){return zi(t,e)})}),r=ti(n);return 0<r.length?S.some(ei({cells:r},{generators:e.generators,clipboard:e.clipboard})):S.none()},Yi=function(e,t){return t.mergable()},Ki=function(e,t){return t.unmergable()},Xi=function(n){return{is:function(e){return n===e},isValue:l,isError:c,getOr:C(n),getOrThunk:C(n),getOrDie:C(n),or:function(e){return Xi(n)},orThunk:function(e){return Xi(n)},fold:function(e,t){return t(n)},map:function(e){return Xi(e(n))},mapError:function(e){return Xi(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return S.some(n)}}},$i=function(n){return{is:c,isValue:c,isError:l,getOr:o,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return $i(n)},mapError:function(e){return $i(e(n))},each:y,bind:function(e){return $i(n)},exists:c,forall:l,toOption:S.none}},Ji={value:Xi,error:$i},Qi=function(e,t){return N(e,function(){return fe.elementnew(t.cell(),!0)})},Zi=function(t,e,n){return t.concat(mi(e,function(e){return ii.setCells(t[t.length-1],Qi(t[t.length-1].cells(),n))}))},eu=function(e,t,n){return N(e,function(e){return ii.setCells(e,e.cells().concat(Qi(gi(0,t),n)))})},tu=function(e,t,n){if(e.row()>=t.length||e.column()>ii.cellLength(t[0]))return Ji.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=t.slice(e.row()),o=r[0].cells().slice(e.column()),i=ii.cellLength(n[0]),u=n.length;return Ji.value({rowDelta:C(r.length-u),colDelta:C(o.length-i)})},nu=function(e,t){var n=ii.cellLength(e[0]),r=ii.cellLength(t[0]);return{rowDelta:C(0),colDelta:C(n-r)}},ru=function(e,t,n){var r=t.colDelta()<0?eu:o;return(t.rowDelta()<0?Zi:o)(r(e,Math.abs(t.colDelta()),n),Math.abs(t.rowDelta()),n)},ou=function(e,t,n,r){if(0===e.length)return e;for(var o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)ii.mutateCell(e[o],i,fe.elementnew(r(),!1));return e},iu=function(e,t,n,r){for(var o=!0,i=0;i<e.length;i++)for(var u=0;u<ii.cellLength(e[0]);u++){var c=n(ii.getCellElement(e[i],u),t);!0===c&&!1===o?ii.mutateCell(e[i],u,fe.elementnew(r(),!0)):!0===c&&(o=!1)}return e},uu=function(i,u,c,a){if(0<u&&u<i.length){var e=i[u-1].cells(),t=(n=c,B(e,function(e,t){return E(e,function(e){return n(e.element(),t.element())})?e:e.concat([t])},[]));k(t,function(e){for(var t=S.none(),n=u;n<i.length;n++)for(var r=0;r<ii.cellLength(i[0]);r++){var o=i[n].cells()[r];c(o.element(),e.element())&&(t.isNone()&&(t=S.some(a())),t.each(function(e){ii.mutateCell(i[n],r,fe.elementnew(e,!0))}))}})}var n;return i},cu=function(n,r,o,i,u){return tu(n,r,o).map(function(e){var t=ru(r,e,i);return function(e,t,n,r,o){for(var i,u,c,a,l,f=e.row(),s=e.column(),d=f+n.length,m=s+ii.cellLength(n[0]),g=f;g<d;g++)for(var p=s;p<m;p++){i=t,u=g,c=p,a=void 0,a=b(o,ii.getCell(i[u],c).element()),l=i[u],1<i.length&&1<ii.cellLength(l)&&(0<c&&a(ii.getCellElement(l,c-1))||c<l.length-1&&a(ii.getCellElement(l,c+1))||0<u&&a(ii.getCellElement(i[u-1],c))||u<i.length-1&&a(ii.getCellElement(i[u+1],c)))&&iu(t,ii.getCellElement(t[g],p),o,r.cell);var h=ii.getCellElement(n[g-f],p-s),v=r.replace(h);ii.mutateCell(t[g],p,fe.elementnew(v,!0))}return t}(n,t,o,i,u)})},au=function(e,t,n,r,o){uu(t,e,o,r.cell);var i=nu(n,t),u=ru(n,i,r),c=nu(t,u),a=ru(t,c,r);return a.slice(0,e).concat(u).concat(a.slice(e,a.length))},lu=function(n,r,e,o,i){var t=n.slice(0,r),u=n.slice(r),c=ii.mapCells(n[e],function(e,t){return 0<r&&r<n.length&&o(ii.getCellElement(n[r-1],t),ii.getCellElement(n[r],t))?ii.getCell(n[r],t):fe.elementnew(i(e.element(),o),!0)});return t.concat([c]).concat(u)},fu=function(e,n,r,o,i){return N(e,function(e){var t=0<n&&n<ii.cellLength(e)&&o(ii.getCellElement(e,n-1),ii.getCellElement(e,n))?ii.getCell(e,n):fe.elementnew(i(ii.getCellElement(e,r),o),!0);return ii.addCell(e,n,t)})},su=function(e,r,o,i,u){var c=o+1;return N(e,function(e,t){var n=t===r?fe.elementnew(u(ii.getCellElement(e,o),i),!0):ii.getCell(e,o);return ii.addCell(e,c,n)})},du=function(e,t,n,r,o){var i=t+1,u=e.slice(0,i),c=e.slice(i),a=ii.mapCells(e[t],function(e,t){return t===n?fe.elementnew(o(e.element(),r),!0):e});return u.concat([a]).concat(c)},mu=function(e,t,n){return e.slice(0,t).concat(e.slice(n+1))},gu=function(e,n,r){var t=N(e,function(e){var t=e.cells().slice(0,n).concat(e.cells().slice(r+1));return fe.rowcells(t,e.section())});return I(t,function(e){return 0<e.cells().length})},pu=function(e,n,r,o){return N(e,function(e){return ii.mapCells(e,function(e){return t=e,E(n,function(e){return r(t.element(),e.element())})?fe.elementnew(o(e.element(),r),!0):e;var t})})},hu=function(e,t,n,r){return ii.getCellElement(e[t],n)!==undefined&&0<t&&r(ii.getCellElement(e[t-1],n),ii.getCellElement(e[t],n))},vu=function(e,t,n){return 0<t&&n(ii.getCellElement(e,t-1),ii.getCellElement(e,t))},bu=function(n,r,o,e){var t=z(n,function(e,t){return hu(n,t,r,o)||vu(e,r,o)?[]:[ii.getCell(e,r)]});return pu(n,t,o,e)},wu=function(n,r,o,e){var i=n[r],t=z(i.cells(),function(e,t){return hu(n,r,t,o)||vu(i,t,o)?[]:[e]});return pu(n,t,o,e)},yu=function(e){return{fold:e}},xu=function(){return yu(function(e,t,n,r,o){return e()})},Cu=function(i){return yu(function(e,t,n,r,o){return t(i)})},Su=function(i,u){return yu(function(e,t,n,r,o){return n(i,u)})},Ru=function(i,u,c){return yu(function(e,t,n,r,o){return r(i,u,c)})},Tu=function(i,u){return yu(function(e,t,n,r,o){return o(i,u)})},Du=function(e,t,i,u){var n,r,c=e.slice(0),o=(r=t,0===(n=e).length?xu():1===n.length?Cu(0):0===r?Su(0,1):r===n.length-1?Tu(r-1,r):0<r&&r<n.length-1?Ru(r-1,r,r+1):xu()),a=function(e){return N(e,C(0))},l=C(a(c)),f=function(e,t){if(0<=i){var n=Math.max(u.minCellWidth(),c[t]-i);return a(c.slice(0,e)).concat([i,n-c[t]]).concat(a(c.slice(t+1)))}var r=Math.max(u.minCellWidth(),c[e]+i),o=c[e]-r;return a(c.slice(0,e)).concat([r-c[e],o]).concat(a(c.slice(t+1)))},s=f;return o.fold(l,function(e){return u.singleColumnWidth(c[e],i)},s,function(e,t,n){return f(t,n)},function(e,t){if(0<=i)return a(c.slice(0,t)).concat([i]);var n=Math.max(u.minCellWidth(),c[t]+i);return a(c.slice(0,t)).concat([n-c[t]])})},Ou=function(e,t){return Tt(e,t)&&1<parseInt(Rt(e,t),10)},Au={hasColspan:function(e){return Ou(e,"colspan")},hasRowspan:function(e){return Ou(e,"rowspan")},minWidth:C(10),minHeight:C(10),getInt:function(e,t){return parseInt(nn(e,t),10)}},Eu=function(e,t,n){return on(e,t).fold(function(){return n(e)+"px"},function(e){return e})},Nu=function(e){return Eu(e,"width",fo.getPixelWidth)},ku=function(e){return Eu(e,"height",fo.getHeight)},Iu=function(e,t,n,r,o){var i=vi(e),u=N(i,function(e){return e.map(t.edge)});return N(i,function(e,t){return e.filter(m(Au.hasColspan)).fold(function(){var e=pi(u,t);return r(e)},function(e){return n(e,o)})})},Pu=function(e){return e.map(function(e){return e+"px"}).getOr("")},Bu=function(e,t,n,r){var o=bi(e),i=N(o,function(e){return e.map(t.edge)});return N(o,function(e,t){return e.filter(m(Au.hasRowspan)).fold(function(){var e=pi(i,t);return r(e)},function(e){return n(e)})})},Mu={getRawWidths:function(e,t){return Iu(e,t,Nu,Pu)},getPixelWidths:function(e,t,n){return Iu(e,t,fo.getPixelWidth,function(e){return e.getOrThunk(n.minCellWidth)},n)},getPercentageWidths:function(e,t,n){return Iu(e,t,fo.getPercentageWidth,function(e){return e.fold(function(){return n.minCellWidth()},function(e){return e/n.pixelWidth()*100})},n)},getPixelHeights:function(e,t){return Bu(e,t,fo.getHeight,function(e){return e.getOrThunk(Au.minHeight)})},getRawHeights:function(e,t){return Bu(e,t,ku,Pu)}},Wu=function(e,t,n){for(var r=0,o=e;o<t;o++)r+=n[o]!==undefined?n[o]:0;return r},_u=function(e,n){var t=Jt.justCells(e);return N(t,function(e){var t=Wu(e.column(),e.column()+e.colspan(),n);return{element:e.element,width:C(t),colspan:e.colspan}})},Lu=function(e,n){var t=Jt.justCells(e);return N(t,function(e){var t=Wu(e.row(),e.row()+e.rowspan(),n);return{element:e.element,height:C(t),rowspan:e.rowspan}})},ju=function(e,n){return N(e.all(),function(e,t){return{element:e.element,height:C(n[t])}})},zu=function(e){var t=parseInt(e,10),n=o;return{width:C(t),pixelWidth:C(t),getWidths:Mu.getPixelWidths,getCellDelta:n,singleColumnWidth:function(e,t){return[Math.max(Au.minWidth(),e+t)-e]},minCellWidth:Au.minWidth,setElementWidth:fo.setPixelWidth,setTableWidth:function(e,t,n){var r=P(t,function(e,t){return e+t},0);fo.setPixelWidth(e,r)}}},Hu=function(e,t){if(fo.percentageBasedSizeRegex().test(t)){var n=fo.percentageBasedSizeRegex().exec(t);return o=n[1],i=e,u=parseFloat(o),c=$r(i),{width:C(u),pixelWidth:C(c),getWidths:Mu.getPercentageWidths,getCellDelta:function(e){return e/c*100},singleColumnWidth:function(e,t){return[100-e]},minCellWidth:function(){return Au.minWidth()/c*100},setElementWidth:fo.setPercentageWidth,setTableWidth:function(e,t,n){var r=u+n;fo.setPercentageWidth(e,r)}}}if(fo.pixelBasedSizeRegex().test(t)){var r=fo.pixelBasedSizeRegex().exec(t);return zu(r[1])}var o,i,u,c,a=$r(e);return zu(a)},Fu=function(t){return fo.getRawWidth(t).fold(function(){var e=$r(t);return zu(e)},function(e){return Hu(t,e)})},Uu=function(e){return Jt.generate(e)},qu=function(e){var t=Yt(e);return Uu(t)},Vu=function(e,t,n,r){var o=Fu(e),i=o.getCellDelta(t),u=qu(e),c=o.getWidths(u,r,o),a=Du(c,n,i,o),l=N(a,function(e,t){return e+c[t]}),f=_u(u,l);k(f,function(e){o.setElementWidth(e.element(),e.width())}),n===u.grid().columns()-1&&o.setTableWidth(e,l,i)},Gu=function(e,n,r,t){var o=qu(e),i=Mu.getPixelHeights(o,t),u=N(i,function(e,t){return r===t?Math.max(n+e,Au.minHeight()):e}),c=Lu(o,u),a=ju(o,u);k(a,function(e){fo.setHeight(e.element(),e.height())}),k(c,function(e){fo.setHeight(e.element(),e.height())});var l=P(u,function(e,t){return e+t},0);fo.setHeight(e,l)},Yu=function(e,t,n){var r=Fu(e),o=Uu(t),i=r.getWidths(o,n,r),u=_u(o,i);k(u,function(e){r.setElementWidth(e.element(),e.width())});var c=P(i,function(e,t){return t+e},0);0<u.length&&r.setTableWidth(e,c)},Ku=function(e){0===Gt.cells(e).length&&pn(e)},Xu=J("grid","cursor"),$u=function(e,t,n){return Ju(e,t,n).orThunk(function(){return Ju(e,0,0)})},Ju=function(e,t,n){return S.from(e[t]).bind(function(e){return S.from(e.cells()[n]).bind(function(e){return S.from(e.element())})})},Qu=function(e,t,n){return Xu(e,Ju(e,t,n))},Zu=function(e){return B(e,function(e,t){return E(e,function(e){return e.row()===t.row()})?e:e.concat([t])},[]).sort(function(e,t){return e.row()-t.row()})},ec=function(e){return B(e,function(e,t){return E(e,function(e){return e.column()===t.column()})?e:e.concat([t])},[]).sort(function(e,t){return e.column()-t.column()})},tc=function(e,t,n){var r=Kt(e,n),o=Jt.generate(r);return li(o,t,!0)},nc=Yu,rc={insertRowBefore:Hi(function(e,t,n,r){var o=t.row(),i=t.row(),u=lu(e,i,o,n,r.getOrInit);return Qu(u,i,t.column())},Ui,y,y,jo),insertRowsBefore:Hi(function(e,t,n,r){var o=t[0].row(),i=t[0].row(),u=Zu(t),c=B(u,function(e,t){return lu(e,i,o,n,r.getOrInit)},e);return Qu(c,i,t[0].column())},qi,y,y,jo),insertRowAfter:Hi(function(e,t,n,r){var o=t.row(),i=t.row()+t.rowspan(),u=lu(e,i,o,n,r.getOrInit);return Qu(u,i,t.column())},Ui,y,y,jo),insertRowsAfter:Hi(function(e,t,n,r){var o=Zu(t),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),c=B(o,function(e,t){return lu(e,u,i,n,r.getOrInit)},e);return Qu(c,u,t[0].column())},qi,y,y,jo),insertColumnBefore:Hi(function(e,t,n,r){var o=t.column(),i=t.column(),u=fu(e,i,o,n,r.getOrInit);return Qu(u,t.row(),i)},Ui,nc,y,jo),insertColumnsBefore:Hi(function(e,t,n,r){var o=ec(t),i=o[0].column(),u=o[0].column(),c=B(o,function(e,t){return fu(e,u,i,n,r.getOrInit)},e);return Qu(c,t[0].row(),u)},qi,nc,y,jo),insertColumnAfter:Hi(function(e,t,n,r){var o=t.column(),i=t.column()+t.colspan(),u=fu(e,i,o,n,r.getOrInit);return Qu(u,t.row(),i)},Ui,nc,y,jo),insertColumnsAfter:Hi(function(e,t,n,r){var o=t[t.length-1].column(),i=t[t.length-1].column()+t[t.length-1].colspan(),u=ec(t),c=B(u,function(e,t){return fu(e,i,o,n,r.getOrInit)},e);return Qu(c,t[0].row(),i)},qi,nc,y,jo),splitCellIntoColumns:Hi(function(e,t,n,r){var o=su(e,t.row(),t.column(),n,r.getOrInit);return Qu(o,t.row(),t.column())},Ui,nc,y,jo),splitCellIntoRows:Hi(function(e,t,n,r){var o=du(e,t.row(),t.column(),n,r.getOrInit);return Qu(o,t.row(),t.column())},Ui,y,y,jo),eraseColumns:Hi(function(e,t,n,r){var o=ec(t),i=gu(e,o[0].column(),o[o.length-1].column()),u=$u(i,t[0].row(),t[0].column());return Xu(i,u)},qi,nc,Ku,jo),eraseRows:Hi(function(e,t,n,r){var o=Zu(t),i=mu(e,o[0].row(),o[o.length-1].row()),u=$u(i,t[0].row(),t[0].column());return Xu(i,u)},qi,y,Ku,jo),makeColumnHeader:Hi(function(e,t,n,r){var o=bu(e,t.column(),n,r.replaceOrInit);return Qu(o,t.row(),t.column())},Ui,y,y,zo("row","th")),unmakeColumnHeader:Hi(function(e,t,n,r){var o=bu(e,t.column(),n,r.replaceOrInit);return Qu(o,t.row(),t.column())},Ui,y,y,zo(null,"td")),makeRowHeader:Hi(function(e,t,n,r){var o=wu(e,t.row(),n,r.replaceOrInit);return Qu(o,t.row(),t.column())},Ui,y,y,zo("col","th")),unmakeRowHeader:Hi(function(e,t,n,r){var o=wu(e,t.row(),n,r.replaceOrInit);return Qu(o,t.row(),t.column())},Ui,y,y,zo(null,"td")),mergeCells:Hi(function(e,t,n,r){var o=t.cells();Qo(o);var i=ou(e,t.bounds(),n,C(o[0]));return Xu(i,S.from(o[0]))},Yi,y,y,Ho),unmergeCells:Hi(function(e,t,n,r){var o=P(t,function(e,t){return iu(e,t,n,r.combine(t))},e);return Xu(o,S.from(t[0]))},Ki,nc,y,Ho),pasteCells:Hi(function(e,n,t,r){var o,i,u,c,a=(o=n.clipboard(),i=n.generators(),u=Yt(o),c=Jt.generate(u),li(c,i,!0)),l=fe.address(n.row(),n.column());return cu(l,e,a,n.generators(),t).fold(function(){return Xu(e,S.some(n.element()))},function(e){var t=$u(e,n.row(),n.column());return Xu(e,t)})},Vi,nc,y,jo),pasteRowsBefore:Hi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[0].row(),u=tc(t.clipboard(),t.generators(),o),c=au(i,e,u,t.generators(),n),a=$u(c,t.cells[0].row(),t.cells[0].column());return Xu(c,a)},Gi,y,y,jo),pasteRowsAfter:Hi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[t.cells.length-1].row()+t.cells[t.cells.length-1].rowspan(),u=tc(t.clipboard(),t.generators(),o),c=au(i,e,u,t.generators(),n),a=$u(c,t.cells[0].row(),t.cells[0].column());return Xu(c,a)},Gi,y,y,jo)},oc=function(e){return de.fromDom(e.getBody())},ic=function(e){return e.getBoundingClientRect().width},uc=function(e){return e.getBoundingClientRect().height},cc=function(t){return function(e){return nt(e,oc(t))}},ac=function(e){return/^[0-9]+$/.test(e)&&(e+="px"),e},lc=function(e){var t=Bt(e,"td[data-mce-style],th[data-mce-style]");Dt(e,"data-mce-style"),k(t,function(e){Dt(e,"data-mce-style")})},fc={isRtl:C(!1)},sc={isRtl:C(!0)},dc={directionAt:function(e){return"rtl"==("rtl"===nn(e,"direction")?"rtl":"ltr")?sc:fc}},mc={"border-collapse":"collapse",width:"100%"},gc={border:"1"},pc=function(e){return e.getParam("table_default_attributes",gc,"object")},hc=function(e){return e.getParam("table_default_styles",mc,"object")},vc=function(e){return e.getParam("table_cell_advtab",!0,"boolean")},bc=function(e){return e.getParam("table_row_advtab",!0,"boolean")},wc=function(e){return e.getParam("table_advtab",!0,"boolean")},yc=function(e){return e.getParam("table_style_by_css",!1,"boolean")},xc=function(e){return e.getParam("table_class_list",[],"array")},Cc=function(e){return!1===e.getParam("table_responsive_width")},Sc=function(e,t){return e.fire("newrow",{node:t})},Rc=function(e,t){return e.fire("newcell",{node:t})},Tc=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},Dc=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},Oc=function(f,e){var t,n=function(e){return"table"===gt(oc(e))},s=(t=f.getParam("table_clone_elements"),v(t)?S.some(t.split(/[ ,]/)):Array.isArray(t)?S.some(t):S.none()),r=function(u,c,a,l){return function(e,t){lc(e);var n=l(),r=de.fromDom(f.getDoc()),o=No(dc.directionAt),i=_n(a,r,s);return c(e)?u(n,e,t,i,o).bind(function(e){return k(e.newRows(),function(e){Sc(f,e.dom())}),k(e.newCells(),function(e){Rc(f,e.dom())}),e.cursor().map(function(e){var t=f.dom.createRng();return t.setStart(e.dom(),0),t.setEnd(e.dom(),0),t})}):S.none()}};return{deleteRow:r(rc.eraseRows,function(e){var t=Io(e);return!1===n(f)||1<t.rows()},y,e),deleteColumn:r(rc.eraseColumns,function(e){var t=Io(e);return!1===n(f)||1<t.columns()},y,e),insertRowsBefore:r(rc.insertRowsBefore,l,y,e),insertRowsAfter:r(rc.insertRowsAfter,l,y,e),insertColumnsBefore:r(rc.insertColumnsBefore,l,so,e),insertColumnsAfter:r(rc.insertColumnsAfter,l,so,e),mergeCells:r(rc.mergeCells,l,y,e),unmergeCells:r(rc.unmergeCells,l,y,e),pasteRowsBefore:r(rc.pasteRowsBefore,l,y,e),pasteRowsAfter:r(rc.pasteRowsAfter,l,y,e),pasteCells:r(rc.pasteCells,l,y,e)}},Ac=function(e,t,r){var n=Yt(e),o=Jt.generate(n);return qi(o,t).map(function(e){var t=li(o,r,!1).slice(e[0].row(),e[e.length-1].row()+e[e.length-1].rowspan()),n=Fi(t,r);return di(n)})},Ec=tinymce.util.Tools.resolve("tinymce.util.Tools"),Nc=function(e,t,n){n&&e.formatter.apply("align"+n,{},t)},kc=function(e,t,n){n&&e.formatter.apply("valign"+n,{},t)},Ic=function(t,n){Ec.each("left center right".split(" "),function(e){t.formatter.remove("align"+e,{},n)})},Pc=function(t,n){Ec.each("top middle bottom".split(" "),function(e){t.formatter.remove("valign"+e,{},n)})},Bc=function(o,e,i){var t;return t=function(e,t){for(var n=0;n<t.length;n++){var r=o.getStyle(t[n],i);if(void 0===e&&(e=r),e!==r)return""}return e}(t,o.select("td,th",e))},Mc=function(){return(Mc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Wc=function(t,e){var n=function(e){return Ke(e,"rgb")?t.toHex(e):e};return{borderstyle:on(de.fromDom(e),"border-style").getOr(""),bordercolor:on(de.fromDom(e),"border-color").map(n).getOr(""),backgroundcolor:on(de.fromDom(e),"background-color").map(n).getOr("")}},_c=function(e,t,n,r,o){var i={};return Ec.each(e.split(" "),function(e){r.formatter.matchNode(o,t+e)&&(i[n]=e)}),i[n]||(i[n]=""),i},Lc=b(_c,"left center right"),jc=b(_c,"top middle bottom"),zc=function(e,r,t){var o=function(e,n){return n=n||[],Ec.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=o(e.menu):(t.value=e.value,r&&r(t)),n.push(t)}),n};return o(e,t||[])},Hc=function(e){var i=e[0],t=e.slice(1),n=q(i);return k(t,function(e){k(n,function(o){G(e,function(e,t,n){var r=i[o];""!==r&&o===t&&r!==e&&(i[o]="")})})}),i},Fc=function(){return{title:"Advanced",items:[{name:"borderstyle",type:"selectbox",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"}]},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}]}},Uc=function(e,t,n){var r,o,i,u=e.dom;return Mc({width:u.getStyle(t,"width")||u.getAttrib(t,"width"),height:u.getStyle(t,"height")||u.getAttrib(t,"height"),cellspacing:u.getStyle(t,"border-spacing")||u.getAttrib(t,"cellspacing"),cellpadding:u.getAttrib(t,"cellpadding")||Bc(e.dom,t,"padding"),border:(r=u,o=t,i=on(de.fromDom(o),"border-width"),yc(e)&&i.isSome()?i.getOr(""):r.getAttrib(o,"border")||Bc(e.dom,o,"border-width")||Bc(e.dom,o,"border")),caption:!!u.select("caption",t)[0],"class":u.getAttrib(t,"class","")},Lc("align","align",e,t),n?Wc(u,t):{})},qc=function(e,t,n){var r=e.dom;return Mc({height:r.getStyle(t,"height")||r.getAttrib(t,"height"),scope:r.getAttrib(t,"scope"),"class":r.getAttrib(t,"class",""),align:"",type:t.parentNode.nodeName.toLowerCase()},Lc("align","align",e,t),n?Wc(r,t):{})},Vc=function(e,t,n){var r=e.dom;return Mc({width:r.getStyle(t,"width")||r.getAttrib(t,"width"),height:r.getStyle(t,"height")||r.getAttrib(t,"height"),scope:r.getAttrib(t,"scope"),celltype:t.nodeName.toLowerCase(),"class":r.getAttrib(t,"class","")},Lc("align","halign",e,t),jc("valign","valign",e,t),n?Wc(r,t):{})},Gc=function(e,t){var n,r,o,i,u,c,a,l,f=hc(e),s=pc(e),d=e.dom,m=t?(n=d,r=function(e){return Ke(e,"rgb")?n.toHex(e):e},o=X(f,"border-style").getOr(""),i=X(f,"border-color").getOr(""),u=X(f,"background-color").getOr(""),{borderstyle:o,bordercolor:r(i),backgroundcolor:r(u)}):{};return Mc({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,"class":"",align:"",border:""},f,s,m,(l=f["border-width"],yc(e)&&l?{border:l}:X(s,"border").fold(function(){return{}},function(e){return{border:e}})),(c=X(f,"border-spacing").or(X(s,"cellspacing")).fold(function(){return{}},function(e){return{cellspacing:e}}),a=X(f,"border-padding").or(X(s,"cellpadding")).fold(function(){return{}},function(e){return{cellpadding:e}}),Mc({},c,a)))},Yc=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"selectbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"selectbox",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:"selectbox",label:"H Align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"selectbox",label:"V Align",items:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}],Kc=function(e){return(t=e,n=t.getParam("table_cell_class_list",[],"array"),r=zc(n,function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[e.value]})})}),0<n.length?S.some({name:"class",type:"selectbox",label:"Class",items:r}):S.none()).fold(function(){return Yc},function(e){return Yc.concat(e)});var t,n,r},Xc={normal:function(n,r){return{setAttrib:function(e,t){n.setAttrib(r,e,t)},setStyle:function(e,t){n.setStyle(r,e,t)}}},ifTruthy:function(n,r){return{setAttrib:function(e,t){t&&n.setAttrib(r,e,t)},setStyle:function(e,t){t&&n.setStyle(r,e,t)}}}},$c=function(e,t){e.setAttrib("scope",t.scope),e.setAttrib("class",t["class"]),e.setStyle("width",ac(t.width)),e.setStyle("height",ac(t.height))},Jc=function(e,t){e.setStyle("background-color",t.backgroundcolor),e.setStyle("border-color",t.bordercolor),e.setStyle("border-style",t.borderstyle)},Qc=function(e,t,n){var r=e.dom,o=n.celltype&&t[0].nodeName.toLowerCase()!==n.celltype?r.rename(t[0],n.celltype):t[0],i=Xc.normal(r,o);$c(i,n),vc(e)&&Jc(i,n),Ic(e,o),Pc(e,o),n.halign&&Nc(e,o,n.halign),n.valign&&kc(e,o,n.valign)},Zc=function(n,e,r){var o=n.dom;Ec.each(e,function(e){r.celltype&&e.nodeName.toLowerCase()!==r.celltype&&(e=o.rename(e,r.celltype));var t=Xc.ifTruthy(o,e);$c(t,r),vc(n)&&Jc(t,r),r.halign&&Nc(n,e,r.halign),r.valign&&kc(n,e,r.valign)})},ea=function(e,t,n){var r=n.getData();n.close(),e.undoManager.transact(function(){(1===t.length?Qc:Zc)(e,t,r),e.focus()})},ta=function(t){var e,n=[];if(n=t.dom.select("td[data-mce-selected],th[data-mce-selected]"),e=t.dom.getParent(t.selection.getStart(),"td,th"),!n.length&&e&&n.push(e),e=e||n[0]){var r=Ec.map(n,function(e){return Vc(t,e,vc(t))}),o=Hc(r),i={type:"tabpanel",tabs:[{title:"General",items:Kc(t)},Fc()]},u={type:"panel",items:[{type:"grid",columns:2,items:Kc(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:vc(t)?i:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:b(ea,t,n)})}},na=[{type:"selectbox",name:"type",label:"Row type",items:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"selectbox",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"}],ra=function(e){return(t=e,n=t.getParam("table_row_class_list",[],"array"),r=zc(n,function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[e.value]})})}),0<n.length?S.some({name:"class",type:"selectbox",label:"Class",items:r}):S.none()).fold(function(){return na},function(e){return na.concat(e)});var t,n,r},oa=function(f,e,s,t){var d=f.dom,m=t.getData();t.close();var g=1===e.length?Xc.normal:Xc.ifTruthy;f.undoManager.transact(function(){Ec.each(e,function(e){var t,n,r,o,i,u;m.type!==e.parentNode.nodeName.toLowerCase()&&(t=f.dom,n=e,r=m.type,o=t.getParent(n,"table"),i=n.parentNode,(u=t.select(r,o)[0])||(u=t.create(r),o.firstChild?"CAPTION"===o.firstChild.nodeName?t.insertAfter(u,o.firstChild):o.insertBefore(u,o.firstChild):o.appendChild(u)),u.appendChild(n),i.hasChildNodes()||t.remove(i));var c,a,l=g(d,e);l.setAttrib("scope",m.scope),l.setAttrib("class",m["class"]),l.setStyle("height",ac(m.height)),bc(f)&&(a=m,(c=l).setStyle("background-color",a.backgroundcolor),c.setStyle("border-color",a.bordercolor),c.setStyle("border-style",a.borderstyle)),m.align!==s.align&&(Ic(f,e),Nc(f,e,m.align))}),f.focus()})},ia=function(t){var e,n,r=t.dom,o=[];if((e=r.getParent(t.selection.getStart(),"table"))&&(n=r.getParent(t.selection.getStart(),"td,th"),Ec.each(e.rows,function(t){Ec.each(t.cells,function(e){if((r.getAttrib(e,"data-mce-selected")||e===n)&&o.indexOf(t)<0)return o.push(t),!1})}),o[0])){var i=Ec.map(o,function(e){return qc(t,e,bc(t))}),u=Hc(i),c={type:"tabpanel",tabs:[{title:"General",items:ra(t)},Fc()]},a={type:"panel",items:[{type:"grid",columns:2,items:ra(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:bc(t)?c:a,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:u,onSubmit:b(oa,t,o,u)})}},ua=tinymce.util.Tools.resolve("tinymce.Env"),ca={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},percentages:!0},aa=function(e,t,n,r,o){void 0===o&&(o=ca);var i=de.fromTag("table");tn(i,o.styles),St(i,o.attributes);var u=de.fromTag("tbody");fn(i,u);for(var c=[],a=0;a<e;a++){for(var l=de.fromTag("tr"),f=0;f<t;f++){var s=a<n||f<r?de.fromTag("th"):de.fromTag("td");f<r&&Ct(s,"scope","row"),a<n&&Ct(s,"scope","col"),fn(s,de.fromTag("br")),o.percentages&&en(s,"width",100/t+"%"),fn(l,s)}c.push(l)}return mn(u,c),i},la=function(e,t){e.selection.select(t.dom(),!0),e.selection.collapse(!0)},fa=function(r,e,t){var n,o=hc(r),i={styles:o,attributes:pc(r),percentages:(n=o.width,v(n)&&-1!==n.indexOf("%")&&!Cc(r))},u=aa(t,e,0,0,i);Ct(u,"data-mce-id","__mce");var c,a,l,f=(c=u,a=de.fromTag("div"),l=de.fromDom(c.dom().cloneNode(!0)),fn(a,l),a.dom().innerHTML);return r.insertContent(f),jt(oc(r),'table[data-mce-id="__mce"]').map(function(e){var t,n;return Cc(r)&&en(e,"width",nn(e,"width")),Dt(e,"data-mce-id"),t=r,k(Bt(e,"tr"),function(e){Sc(t,e.dom()),k(Bt(e,"th,td"),function(e){Rc(t,e.dom())})}),n=r,jt(e,"td,th").each(b(la,n)),e.dom()}).getOr(null)},sa=function(e,t,n,r){if("TD"===t.tagName||"TH"===t.tagName)e.setStyle(t,n,r);else if(t.children)for(var o=0;o<t.children.length;o++)sa(e,t.children[o],n,r)},da=function(n,r,e){var o,i=n.dom,u=e.getData();e.close(),""===u["class"]&&delete u["class"],n.undoManager.transact(function(){if(!r){var e=parseInt(u.cols,10)||1,t=parseInt(u.rows,10)||1;r=fa(n,e,t)}!function(e,t,n){var r,o=e.dom,i={},u={};if(i["class"]=n["class"],u.height=ac(n.height),o.getAttrib(t,"width")&&!yc(e)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=ac(n.width),yc(e)?(u["border-width"]=ac(n.border),u["border-spacing"]=ac(n.cellspacing)):(i.border=n.border,i.cellpadding=n.cellpadding,i.cellspacing=n.cellspacing),yc(e)&&t.children)for(var c=0;c<t.children.length;c++)sa(o,t.children[c],{"border-width":ac(n.border),padding:ac(n.cellpadding)}),wc(e)&&sa(o,t.children[c],{"border-color":n.bordercolor});wc(e)&&(u["background-color"]=n.backgroundcolor,u["border-color"]=n.bordercolor,u["border-style"]=n.borderstyle),i.style=o.serializeStyle(ei(hc(e),u)),o.setAttribs(t,ei(pc(e),i))}(n,r,u),(o=i.select("caption",r)[0])&&!u.caption&&i.remove(o),!o&&u.caption&&((o=i.create("caption")).innerHTML=ua.ie?"\xa0":'<br data-mce-bogus="1"/>',r.insertBefore(o,r.firstChild)),""===u.align?Ic(n,r):Nc(n,r,u.align),n.focus(),n.addVisual()})},ma=function(t,e){var n,r=t.dom,o=Gc(t,wc(t));!1===e?(n=r.getParent(t.selection.getStart(),"table"))?o=Uc(t,n,wc(t)):wc(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""):(o.cols="1",o.rows="1",wc(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=0<xc(t).length;i&&o["class"]&&(o["class"]=o["class"].replace(/\s*mce\-item\-table\s*/g,""));var u=e?[{type:"input",name:"cols",label:"Cols"},{type:"input",name:"rows",label:"Rows"}]:[],c=t.getParam("table_appearance_options",!0,"boolean")?[{type:"input",name:"cellspacing",label:"Cell spacing"},{type:"input",name:"cellpadding",label:"Cell padding"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],a=i?[{type:"selectbox",name:"class",label:"Class",items:zc(xc(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"table",classes:[e.value]})})})}]:[],l={type:"grid",columns:2,items:u.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(c).concat([{type:"selectbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(a)},f={type:"panel",items:[l]},s={type:"tabpanel",tabs:[{title:"General",items:[l]},Fc()]},d=wc(t)?s:f;t.windowManager.open({title:"Table Properties",size:"normal",body:d,onSubmit:b(da,t,n),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},ga=Ec.each,pa=function(c,t,a,l,n){var r=cc(c),f=function(){return de.fromDom(c.dom.getParent(c.selection.getStart(),"th,td"))},s=function(e){return Gt.table(e,r)},d=function(e){return{width:ic(e.dom()),height:ic(e.dom())}},o=function(t){var n=f();s(n).each(function(i){var e=Ur.forMenu(l,i,n),u=d(i);t(i,e).each(function(e){var t,n,r,o;t=c,n=u,o=d(r=i),n.width===o.width&&n.height===o.height||(Tc(t,r.dom(),n.width,n.height),Dc(t,r.dom(),o.width,o.height)),c.selection.setRng(e),c.focus(),a.clear(i),lc(i)})})},i=function(e){var o=f();return s(o).bind(function(e){var t=de.fromDom(c.getDoc()),n=Ur.forMenu(l,e,o),r=_n(y,t,S.none());return Ac(e,n,r)})},u=function(u){n.get().each(function(e){var o=N(e,function(e){return xn(e)}),i=f();s(i).bind(function(t){var e=de.fromDom(c.getDoc()),n=Ln(e),r=Ur.pasteRows(l,t,i,o,n);u(t,r).each(function(e){c.selection.setRng(e),c.focus(),a.clear(t)})})})};ga({mceTableSplitCells:function(){o(t.unmergeCells)},mceTableMergeCells:function(){o(t.mergeCells)},mceTableInsertRowBefore:function(){o(t.insertRowsBefore)},mceTableInsertRowAfter:function(){o(t.insertRowsAfter)},mceTableInsertColBefore:function(){o(t.insertColumnsBefore)},mceTableInsertColAfter:function(){o(t.insertColumnsAfter)},mceTableDeleteCol:function(){o(t.deleteColumn)},mceTableDeleteRow:function(){o(t.deleteRow)},mceTableCutRow:function(e){n.set(i()),o(t.deleteRow)},mceTableCopyRow:function(e){n.set(i())},mceTablePasteRowBefore:function(e){u(t.pasteRowsBefore)},mceTablePasteRowAfter:function(e){u(t.pasteRowsAfter)},mceTableDelete:function(){var e=de.fromDom(c.dom.getParent(c.selection.getStart(),"th,td"));Gt.table(e,r).filter(m(r)).each(function(e){var t=de.fromText("");if(an(e,t),pn(e),c.dom.isEmpty(c.getBody()))c.setContent(""),c.selection.setCursorLocation();else{var n=c.dom.createRng();n.setStart(t.dom(),0),n.setEnd(t.dom(),0),c.selection.setRng(n),c.nodeChanged()}})}},function(e,t){c.addCommand(t,e)}),ga({mceInsertTable:b(ma,c,!0),mceTableProps:b(ma,c,!1),mceTableRowProps:b(ia,c),mceTableCellProps:b(ta,c)},function(n,e){c.addCommand(e,function(e,t){n(t)})})},ha=function(e){var t=S.from(e.dom().documentElement).map(de.fromDom).getOr(e);return{parent:C(t),view:C(e),origin:C(go(0,0))}},va=function(e,t){return{parent:C(t),view:C(e),origin:C(go(0,0))}};function ba(e){var n=J.apply(null,e),r=[];return{bind:function(e){if(e===undefined)throw"Event bind error: undefined handler";r.push(e)},unbind:function(t){r=I(r,function(e){return e!==t})},trigger:function(){var t=n.apply(null,arguments);k(r,function(e){e(t)})}}}var wa={create:function(e){return{registry:Y(e,function(e){return{bind:e.bind,unbind:e.unbind}}),trigger:Y(e,function(e){return e.trigger})}}},ya={mode:Wo(["compare","extract","mutate","sink"]),sink:Wo(["element","start","stop","destroy"]),api:Wo(["forceDrop","drop","move","delayDrop"])},xa={resolve:xi("ephox-dragster").resolve},Ca=function(m,g){return function(e){if(m(e)){var t,n,r,o,i,u,c,a=de.fromDom(e.target),l=function(){e.stopPropagation()},f=function(){e.preventDefault()},s=x(f,l),d=(t=a,n=e.clientX,r=e.clientY,o=l,i=f,u=s,c=e,{target:C(t),x:C(n),y:C(r),stop:o,prevent:i,kill:u,raw:C(c)});g(d)}}},Sa=function(e,t,n,r){return o=e,i=t,u=!1,c=Ca(n,r),o.dom().addEventListener(i,c,u),{unbind:b(Ra,o,i,c,u)};var o,i,u,c},Ra=function(e,t,n,r){e.dom().removeEventListener(t,n,r)},Ta=C(!0),Da=function(e,t,n){return Sa(e,t,Ta,n)},Oa=ya.mode({compare:function(e,t){return go(t.left()-e.left(),t.top()-e.top())},extract:function(e){return S.some(go(e.x(),e.y()))},sink:function(e,t){var n=function c(e){var t=ei({layerClass:xa.resolve("blocker")},e),n=de.fromTag("div");return Ct(n,"role","presentation"),tn(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Oi(n,xa.resolve("blocker")),Oi(n,t.layerClass),{element:function(){return n},destroy:function(){pn(n)}}}(t),r=Da(n.element(),"mousedown",e.forceDrop),o=Da(n.element(),"mouseup",e.drop),i=Da(n.element(),"mousemove",e.move),u=Da(n.element(),"mouseout",e.delayDrop);return ya.sink({element:n.element,start:function(e){fn(e,n.element())},stop:function(){pn(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(e,t){e.mutate(t.left(),t.top())}});function Aa(){var i=S.none(),u=wa.create({move:ba(["info"])});return{onEvent:function(e,o){o.extract(e).each(function(e){var t,n,r;(t=o,n=e,r=i.map(function(e){return t.compare(e,n)}),i=S.some(n),r).each(function(e){u.trigger.move(e)})})},reset:function(){i=S.none()},events:u.registry}}function Ea(){var e=function r(e){return{onEvent:function(e,t){},reset:y}}(),t=Aa(),n=e;return{on:function(){n.reset(),n=t},off:function(){n.reset(),n=e},isOn:function(){return n===t},onEvent:function(e,t){n.onEvent(e,t)},events:t.events}}var Na=function(t,n,e){var r,o,i,u=!1,c=wa.create({start:ba([]),stop:ba([])}),a=Ea(),l=function(){d.stop(),a.isOn()&&(a.off(),c.trigger.stop())},f=(r=l,o=200,i=null,{cancel:function(){null!==i&&(clearTimeout(i),i=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==i&&clearTimeout(i),i=setTimeout(function(){r.apply(null,e),i=null},o)}});a.events.move.bind(function(e){n.mutate(t,e.info())});var s=function(t){return function(){var e=Array.prototype.slice.call(arguments,0);if(u)return t.apply(null,e)}},d=n.sink(ya.api({forceDrop:l,drop:s(l),move:s(function(e,t){f.cancel(),a.onEvent(e,n)}),delayDrop:s(f.throttle)}),e);return{element:d.element,go:function(e){d.start(e),a.on(),c.trigger.start()},on:function(){u=!0},off:function(){u=!1},destroy:function(){d.destroy()},events:c.registry}},ka={transform:function(e,t){var n=t!==undefined?t:{},r=n.mode!==undefined?n.mode:Oa;return Na(e,r,t)}};function Ia(){var n=wa.create({drag:ba(["xDelta","yDelta","target"])}),r=S.none(),e=function t(){var n=wa.create({drag:ba(["xDelta","yDelta"])});return{mutate:function(e,t){n.trigger.drag(e,t)},events:n.registry}}();return e.events.drag.bind(function(t){r.each(function(e){n.trigger.drag(t.xDelta(),t.yDelta(),e)})}),{assign:function(e){r=S.some(e)},get:function(){return r},mutate:e.mutate,events:n.registry}}var Pa=function(e,t,n){return zt(e,t,n).isSome()},Ba=Ci.resolve("resizer-bar-dragging");function Ma(e,n){var r=Ao.height,t=function m(o,t,i){var n=Ia(),r=ka.transform(n,{}),u=S.none(),e=function(e,t){return S.from(Rt(e,t))};n.events.drag.bind(function(n){e(n.target(),"data-row").each(function(e){var t=Au.getInt(n.target(),"top");en(n.target(),"top",t+n.yDelta()+"px")}),e(n.target(),"data-column").each(function(e){var t=Au.getInt(n.target(),"left");en(n.target(),"left",t+n.xDelta()+"px")})});var c=function(e,t){return Au.getInt(e,t)-parseInt(Rt(e,"data-initial-"+t),10)};r.events.stop.bind(function(){n.get().each(function(r){u.each(function(n){e(r,"data-row").each(function(e){var t=c(r,"top");Dt(r,"data-initial-top"),d.trigger.adjustHeight(n,t,parseInt(e,10))}),e(r,"data-column").each(function(e){var t=c(r,"left");Dt(r,"data-initial-left"),d.trigger.adjustWidth(n,t,parseInt(e,10))}),_i.refresh(o,n,i,t)})})});var a=function(e,t){d.trigger.startAdjust(),n.assign(e),Ct(e,"data-initial-"+t,parseInt(nn(e,t),10)),Oi(e,Ba),en(e,"opacity","0.2"),r.go(o.parent())},l=Da(o.parent(),"mousedown",function(e){_i.isRowBar(e.target())&&a(e.target(),"top"),_i.isColBar(e.target())&&a(e.target(),"left")}),f=function(e){return nt(e,o.view())},s=Da(o.view(),"mouseover",function(e){"table"===gt(e.target())||Pa(e.target(),"table",f)?(u="table"===gt(e.target())?S.some(e.target()):_t(e.target(),"table",f)).each(function(e){_i.refresh(o,e,i,t)}):At(e.target())&&_i.destroy(o)}),d=wa.create({adjustHeight:ba(["table","delta","row"]),adjustWidth:ba(["table","delta","column"]),startAdjust:ba([])});return{destroy:function(){l.unbind(),s.unbind(),r.destroy(),_i.destroy(o)},refresh:function(e){_i.refresh(o,e,i,t)},on:r.on,off:r.off,hideBars:b(_i.hide,o),showBars:b(_i.show,o),events:d.registry}}(e,n,r),o=wa.create({beforeResize:ba(["table"]),afterResize:ba(["table"]),startDrag:ba([])});return t.events.adjustHeight.bind(function(e){o.trigger.beforeResize(e.table());var t=r.delta(e.delta(),e.table());Gu(e.table(),t,e.row(),r),o.trigger.afterResize(e.table())}),t.events.startAdjust.bind(function(e){o.trigger.startDrag()}),t.events.adjustWidth.bind(function(e){o.trigger.beforeResize(e.table());var t=n.delta(e.delta(),e.table());Vu(e.table(),t,e.column(),n),o.trigger.afterResize(e.table())}),{on:t.on,off:t.off,hideBars:t.hideBars,showBars:t.showBars,destroy:t.destroy,events:o.registry}}var Wa=function(e,t){return e.inline?va(oc(e),(n=de.fromTag("div"),tn(n,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),fn(Et(),n),n)):ha(de.fromDom(e.getDoc()));var n},_a=function(e,t){e.inline&&pn(t.parent())},La=function(u){var c,a,o=S.none(),i=S.none(),l=S.none(),f=/(\d+(\.\d+)?)%/,s=function(e){return"TABLE"===e.nodeName};return u.on("init",function(){var e,t=No(dc.directionAt),n=Wa(u);if(l=S.some(n),("table"===(e=u.getParam("object_resizing",!0))||e)&&u.getParam("table_resize_bars",!0,"boolean")){var r=Ma(n,t);r.on(),r.events.startDrag.bind(function(e){o=S.some(u.selection.getRng())}),r.events.beforeResize.bind(function(e){var t=e.table().dom();Tc(u,t,ic(t),uc(t))}),r.events.afterResize.bind(function(e){var t=e.table(),n=t.dom();lc(t),o.each(function(e){u.selection.setRng(e),u.focus()}),Dc(u,n,ic(n),uc(n)),u.undoManager.add()}),i=S.some(r)}}),u.on("ObjectResizeStart",function(e){var t,n=e.target;s(n)&&(c=e.width,t=n,a=u.dom.getStyle(t,"width")||u.dom.getAttrib(t,"width"))}),u.on("ObjectResized",function(e){var t=e.target;if(s(t)){var n=t;if(f.test(a)){var r=parseFloat(f.exec(a)[1]),o=e.width*r/c;u.dom.setStyle(n,"width",o+"%")}else{var i=[];Ec.each(n.rows,function(e){Ec.each(e.cells,function(e){var t=u.dom.getStyle(e,"width",!0);i.push({cell:e,width:t})})}),Ec.each(i,function(e){u.dom.setStyle(e.cell,"width",e.width),u.dom.setAttrib(e.cell,"width",null)})}}}),{lazyResize:function(){return i},lazyWire:function(){return l.getOr(ha(de.fromDom(u.getBody())))},destroy:function(){i.each(function(e){e.destroy()}),l.each(function(e){_a(u,e)})}}},ja=function(e){return{fold:e}},za=function(o){return ja(function(e,t,n,r){return e(o)})},Ha=function(o){return ja(function(e,t,n,r){return t(o)})},Fa=function(o,i){return ja(function(e,t,n,r){return n(o,i)})},Ua=function(o){return ja(function(e,t,n,r){return r(o)})},qa=function(n,e){return Gt.table(n,e).bind(function(e){var t=Gt.cells(e);return W(t,function(e){return nt(n,e)}).map(function(e){return{index:C(e),all:C(t)}})})},Va=function(t,e){return qa(t,e).fold(function(){return za(t)},function(e){return e.index()+1<e.all().length?Fa(t,e.all()[e.index()+1]):Ua(t)})},Ga=function(t,e){return qa(t,e).fold(function(){return za()},function(e){return 0<=e.index()-1?Fa(t,e.all()[e.index()-1]):Ha(t)})},Ya=Br([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Ka={before:Ya.before,on:Ya.on,after:Ya.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(o,o,o)}},Xa=Br([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),$a=J("start","soffset","finish","foffset"),Ja=function(e){var t,n=e.match({domRange:function(e){return de.fromDom(e.startContainer)},relative:function(e,t){return Ka.getStart(e)},exact:function(e,t,n,r){return e}});return t=n.dom().ownerDocument.defaultView,de.fromDom(t)},Qa=Xa.relative,Za=Xa.exact,el=function(e,t,n,r){var o,i,u,c,a,l=(i=t,u=n,c=r,(a=it(o=e).dom().createRange()).setStart(o.dom(),i),a.setEnd(u.dom(),c),a),f=nt(e,n)&&t===r;return l.collapsed&&!f},tl=function(e,t){e.selectNodeContents(t.dom())},nl=function(e,t,n){var r,o,i=e.document.createRange();return r=i,t.fold(function(e){r.setStartBefore(e.dom())},function(e,t){r.setStart(e.dom(),t)},function(e){r.setStartAfter(e.dom())}),o=i,n.fold(function(e){o.setEndBefore(e.dom())},function(e,t){o.setEnd(e.dom(),t)},function(e){o.setEndAfter(e.dom())}),i},rl=function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom(),n),i.setEnd(r.dom(),o),i},ol=function(e){return{left:C(e.left),top:C(e.top),right:C(e.right),bottom:C(e.bottom),width:C(e.width),height:C(e.height)}},il=Br([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),ul=function(e,t,n){return t(de.fromDom(n.startContainer),n.startOffset,de.fromDom(n.endContainer),n.endOffset)},cl=function(e,t){var o,n,r,i=(o=e,t.match({domRange:function(e){return{ltr:C(e),rtl:S.none}},relative:function(e,t){return{ltr:Oe(function(){return nl(o,e,t)}),rtl:Oe(function(){return S.some(nl(o,t,e))})}},exact:function(e,t,n,r){return{ltr:Oe(function(){return rl(o,e,t,n,r)}),rtl:Oe(function(){return S.some(rl(o,n,r,e,t))})}}}));return(r=(n=i).ltr()).collapsed?n.rtl().filter(function(e){return!1===e.collapsed}).map(function(e){return il.rtl(de.fromDom(e.endContainer),e.endOffset,de.fromDom(e.startContainer),e.startOffset)}).getOrThunk(function(){return ul(0,il.ltr,r)}):ul(0,il.ltr,r)},al=function(i,e){return cl(i,e).match({ltr:function(e,t,n,r){var o=i.document.createRange();return o.setStart(e.dom(),t),o.setEnd(n.dom(),r),o},rtl:function(e,t,n,r){var o=i.document.createRange();return o.setStart(n.dom(),r),o.setEnd(e.dom(),t),o}})},ll=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},fl=function(n,r,e,t,o){var i=function(e){var t=n.dom().createRange();return t.setStart(r.dom(),e),t.collapse(!0),t},u=Rn(r).length,c=function(e,t,n,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,u=1;u<o;u++){var c=e(u),a=Math.abs(t-c.left);if(n<=c.bottom){if(n<c.top||i<a)return u-1;i=a}}return 0}(function(e){return i(e).getBoundingClientRect()},e,t,o.right,u);return i(c)},sl=function(t,n,r,o){var e=t.dom().createRange();e.selectNode(n.dom());var i=e.getClientRects();return ni(i,function(e){return ll(e,r,o)?S.some(e):S.none()}).map(function(e){return fl(t,n,r,o,e)})},dl=function(t,e,n,r){var o=t.dom().createRange(),i=ft(e);return ni(i,function(e){return o.selectNode(e.dom()),ll(o.getBoundingClientRect(),n,r)?ml(t,e,n,r):S.none()})},ml=function(e,t,n,r){return(wt(t)?sl:dl)(e,t,n,r)},gl=function(e,t){return t-e.left<e.right-t},pl=function(e,t,n){var r=e.dom().createRange();return r.selectNode(t.dom()),r.collapse(n),r},hl=function(t,e,n){var r=t.dom().createRange();r.selectNode(e.dom());var o=r.getBoundingClientRect(),i=gl(o,n);return(!0===i?Nn:kn)(e).map(function(e){return pl(t,e,i)})},vl=function(e,t,n){var r=t.dom().getBoundingClientRect(),o=gl(r,n);return S.some(pl(e,t,o))},bl=function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect();return function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),c=Math.max(i.top,Math.min(i.bottom,r));return ml(e,t,u,c)}(e,t,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},wl=document.caretPositionFromPoint?function(n,e,t){return S.from(n.dom().caretPositionFromPoint(e,t)).bind(function(e){if(null===e.offsetNode)return S.none();var t=n.dom().createRange();return t.setStart(e.offsetNode,e.offset),t.collapse(),S.some(t)})}:document.caretRangeFromPoint?function(e,t,n){return S.from(e.dom().caretRangeFromPoint(t,n))}:function(o,i,t){return de.fromPoint(o,i,t).bind(function(r){var e=function(){return e=o,n=i,(0===ft(t=r).length?vl:hl)(e,t,n);var e,t,n};return 0===ft(r).length?e():bl(o,r,i,t).orThunk(e)})},yl=function(e,t){var n=gt(e);return"input"===n?Ka.after(e):A(["br","img"],n)?0===t?Ka.before(e):Ka.after(e):Ka.on(e,t)},xl=function(e,t){var n=e.fold(Ka.before,yl,Ka.after),r=t.fold(Ka.before,yl,Ka.after);return Qa(n,r)},Cl=function(e,t,n,r){var o=yl(e,t),i=yl(n,r);return Qa(o,i)},Sl=function(e,t){S.from(e.getSelection()).each(function(e){e.removeAllRanges(),e.addRange(t)})},Rl=function(e,t,n,r,o){var i=rl(e,t,n,r,o);Sl(e,i)},Tl=function(s,e){return cl(s,e).match({ltr:function(e,t,n,r){Rl(s,e,t,n,r)},rtl:function(e,t,n,r){var o,i,u,c,a,l=s.getSelection();if(l.setBaseAndExtent)l.setBaseAndExtent(e.dom(),t,n.dom(),r);else if(l.extend)try{i=e,u=t,c=n,a=r,(o=l).collapse(i.dom(),u),o.extend(c.dom(),a)}catch(f){Rl(s,n,r,e,t)}else Rl(s,n,r,e,t)}})},Dl=function(e){var o=Ja(e).dom(),t=function(e,t,n,r){return rl(o,e,t,n,r)},n=e.match({domRange:function(e){var t=de.fromDom(e.startContainer),n=de.fromDom(e.endContainer);return Cl(t,e.startOffset,n,e.endOffset)},relative:xl,exact:Cl});return cl(o,n).match({ltr:t,rtl:t})},Ol=function(e){var t=de.fromDom(e.anchorNode),n=de.fromDom(e.focusNode);return el(t,e.anchorOffset,n,e.focusOffset)?S.some($a(de.fromDom(e.anchorNode),e.anchorOffset,de.fromDom(e.focusNode),e.focusOffset)):function(e){if(0<e.rangeCount){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return S.some($a(de.fromDom(t.startContainer),t.startOffset,de.fromDom(n.endContainer),n.endOffset))}return S.none()}(e)},Al=function(e,t){var n,r,o=(n=t,r=e.document.createRange(),tl(r,n),r);Sl(e,o)},El=function(e){return(t=e,S.from(t.getSelection()).filter(function(e){return 0<e.rangeCount}).bind(Ol)).map(function(e){return Za(e.start(),e.soffset(),e.finish(),e.foffset())});var t},Nl=function(e,t){var n,r,o,i=al(e,t);return r=(n=i).getClientRects(),0<(o=0<r.length?r[0]:n.getBoundingClientRect()).width||0<o.height?S.some(o).map(ol):S.none()},kl=function(e,t,n){return r=e,o=t,i=n,u=de.fromDom(r.document),wl(u,o,i).map(function(e){return $a(de.fromDom(e.startContainer),e.startOffset,de.fromDom(e.endContainer),e.endOffset)});var r,o,i,u},Il=tinymce.util.Tools.resolve("tinymce.util.VK"),Pl=function(e,t,n,r){return _l(e,t,Va(n),r)},Bl=function(e,t,n,r){return _l(e,t,Ga(n),r)},Ml=function(e,t){var n=Za(t,0,t,0);return Dl(n)},Wl=function(e,t){var n,r=Bt(t,"tr");return(n=r,0===n.length?S.none():S.some(n[n.length-1])).bind(function(e){return jt(e,"td,th").map(function(e){return Ml(0,e)})})},_l=function(r,e,t,o,n){return t.fold(S.none,S.none,function(e,t){return Nn(t).map(function(e){return Ml(0,e)})},function(n){return Gt.table(n,e).bind(function(e){var t=Ur.noMenu(n);return r.undoManager.transact(function(){o.insertRowsAfter(e,t)}),Wl(0,e)})})},Ll=["table","li","dl"],jl=function(t,n,r,o){if(t.keyCode===Il.TAB){var i=oc(n),u=function(e){var t=gt(e);return nt(e,i)||A(Ll,t)},e=n.selection.getRng();if(e.collapsed){var c=de.fromDom(e.startContainer);Gt.cell(c,u).each(function(e){t.preventDefault(),(t.shiftKey?Bl:Pl)(n,u,e,r,o).each(function(e){n.selection.setRng(e)})})}}},zl={response:J("selection","kill")},Hl=function(t){return function(e){return e===t}},Fl=Hl(38),Ul=Hl(40),ql={ltr:{isBackward:Hl(37),isForward:Hl(39)},rtl:{isBackward:Hl(39),isForward:Hl(37)},isUp:Fl,isDown:Ul,isNavigation:function(e){return 37<=e&&e<=40}},Vl=function(e,t){var n=al(e,t);return{start:C(de.fromDom(n.startContainer)),soffset:C(n.startOffset),finish:C(de.fromDom(n.endContainer)),foffset:C(n.endOffset)}},Gl=function(e,t,n,r){return{start:C(Ka.on(e,t)),finish:C(Ka.on(n,r))}};function Yl(c){return{elementFromPoint:function(e,t){return de.fromPoint(de.fromDom(c.document),e,t)},getRect:function(e){return e.dom().getBoundingClientRect()},getRangedRect:function(e,t,n,r){var o=Za(e,t,n,r);return Nl(c,o).map(function(e){return Y(e,a)})},getSelection:function(){return El(c).map(function(e){return Vl(c,e)})},fromSitus:function(e){var t=Qa(e.start(),e.finish());return Vl(c,t)},situsFromPoint:function(e,t){return kl(c,e,t).map(function(e){return{start:C(Ka.on(e.start(),e.soffset())),finish:C(Ka.on(e.finish(),e.foffset()))}})},clearSelection:function(){c.getSelection().removeAllRanges()},setSelection:function(e){var t,n,r,o,i,u;t=c,n=e.start(),r=e.soffset(),o=e.finish(),i=e.foffset(),u=Cl(n,r,o,i),Tl(t,u)},setRelativeSelection:function(e,t){var n,r;n=c,r=xl(e,t),Tl(n,r)},selectContents:function(e){Al(c,e)},getInnerHeight:function(){return c.innerHeight},getScrollY:function(){var e,t,n,r;return(e=de.fromDom(c.document),t=e!==undefined?e.dom():document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop,go(n,r)).top()},scrollBy:function(e,t){var n,r,o;n=e,r=t,((o=de.fromDom(c.document))!==undefined?o.dom():document).defaultView.scrollBy(n,r)}}}tt.detect().browser.isSafari();var Kl=function(n,e,r,t,o){return nt(r,t)?S.none():Rr(r,t,e).bind(function(e){var t=e.boxes().getOr([]);return 0<t.length?(o(n,t,e.start(),e.finish()),S.some(zl.response(S.some(Gl(r,0,r,On(r))),!0))):S.none()})},Xl={sync:function(n,r,e,t,o,i,u){return nt(e,o)&&t===i?S.none():zt(e,"td,th",r).bind(function(t){return zt(o,"td,th",r).bind(function(e){return Kl(n,r,t,e,u)})})},detect:Kl,update:function(e,t,n,r,o){return Dr(r,e,t,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(e){return o.clear(n),o.selectRange(n,e.boxes(),e.start(),e.finish()),e.boxes()})}},$l=re(["left","top","right","bottom"],[]),Jl={nu:$l,moveUp:function(e,t){return $l({left:e.left(),top:e.top()-t,right:e.right(),bottom:e.bottom()-t})},moveDown:function(e,t){return $l({left:e.left(),top:e.top()+t,right:e.right(),bottom:e.bottom()+t})},moveBottomTo:function(e,t){var n=e.bottom()-e.top();return $l({left:e.left(),top:t-n,right:e.right(),bottom:t})},moveTopTo:function(e,t){var n=e.bottom()-e.top();return $l({left:e.left(),top:t,right:e.right(),bottom:t+n})},getTop:function(e){return e.top()},getBottom:function(e){return e.bottom()},translate:function(e,t,n){return $l({left:e.left()+t,top:e.top()+n,right:e.right()+t,bottom:e.bottom()+n})},toString:function(e){return"("+e.left()+", "+e.top()+") -> ("+e.right()+", "+e.bottom()+")"}},Ql=function(e){return Jl.nu({left:e.left,top:e.top,right:e.right,bottom:e.bottom})},Zl=function(e,t){return S.some(e.getRect(t))},ef=function(e,t,n){return bt(t)?Zl(e,t).map(Ql):wt(t)?(r=e,o=t,i=n,0<=i&&i<On(o)?r.getRangedRect(o,i,o,i+1):0<i?r.getRangedRect(o,i-1,o,i):S.none()).map(Ql):S.none();var r,o,i},tf=function(e,t){return bt(t)?Zl(e,t).map(Ql):wt(t)?e.getRangedRect(t,0,t,On(t)).map(Ql):S.none()},nf=J("item","mode"),rf=function(e,t,n,r){var o=r!==undefined?r:of;return e.property().parent(t).map(function(e){return nf(e,o)})},of=function(e,t,n,r){var o=r!==undefined?r:uf;return n.sibling(e,t).map(function(e){return nf(e,o)})},uf=function(e,t,n,r){var o=r!==undefined?r:uf,i=e.property().children(t);return n.first(i).map(function(e){return nf(e,o)})},cf=[{current:rf,next:of,fallback:S.none()},{current:of,next:uf,fallback:S.some(rf)},{current:uf,next:uf,fallback:S.some(of)}],af=function(t,n,r,o,e){return e=e!==undefined?e:cf,M(e,function(e){return e.current===r}).bind(function(e){return e.current(t,n,o,e.next).orThunk(function(){return e.fallback.bind(function(e){return af(t,n,e,o)})})})},lf={backtrack:rf,sidestep:of,advance:uf,go:af},ff={left:function(){return{sibling:function(e,t){return e.query().prevSibling(t)},first:function(e){return 0<e.length?S.some(e[e.length-1]):S.none()}}},right:function(){return{sibling:function(e,t){return e.query().nextSibling(t)},first:function(e){return 0<e.length?S.some(e[0]):S.none()}}}},sf=function(t,e,n,r,o,i){return lf.go(t,e,r,o).bind(function(e){return i(e.item())?S.none():n(e.item())?S.some(e.item()):sf(t,e.item(),n,e.mode(),o,i)})},df=function(e,t,n,r){return sf(e,t,n,lf.sidestep,ff.left(),r)},mf=function(e,t,n,r){return sf(e,t,n,lf.sidestep,ff.right(),r)},gf=function(e,t){return 0===e.property().children(t).length},pf=function(e,t,n,r){return df(e,t,n,r)},hf=function(e,t,n,r){return mf(e,t,n,r)},vf={before:function(e,t,n){return pf(e,t,b(gf,e),n)},after:function(e,t,n){return hf(e,t,b(gf,e),n)},seekLeft:pf,seekRight:hf,walkers:function(){return{left:ff.left,right:ff.right}},walk:function(e,t,n,r,o){return lf.go(e,t,n,r,o)},backtrack:lf.backtrack,sidestep:lf.sidestep,advance:lf.advance},bf=zn(),wf={gather:function(e,t,n){return vf.gather(bf,e,t,n)},before:function(e,t){return vf.before(bf,e,t)},after:function(e,t){return vf.after(bf,e,t)},seekLeft:function(e,t,n){return vf.seekLeft(bf,e,t,n)},seekRight:function(e,t,n){return vf.seekRight(bf,e,t,n)},walkers:function(){return vf.walkers()},walk:function(e,t,n,r){return vf.walk(bf,e,t,n,r)}},yf=Br([{none:[]},{retry:["caret"]}]),xf=function(t,e,r){return(n=e,o=Xo,Mt(function(e){return o(e)},Wt,n,o,i)).fold(C(!1),function(e){return tf(t,e).exists(function(e){return n=e,(t=r).left()<n.left()||Math.abs(n.right()-t.left())<1||t.left()>n.right();var t,n})});var n,o,i},Cf={point:Jl.getTop,adjuster:function(e,t,n,r,o){var i=Jl.moveUp(o,5);return Math.abs(n.top()-r.top())<1?yf.retry(i):n.bottom()<o.top()?yf.retry(i):n.bottom()===o.top()?yf.retry(Jl.moveUp(o,1)):xf(e,t,o)?yf.retry(Jl.translate(i,5,0)):yf.none()},move:Jl.moveUp,gather:wf.before},Sf={point:Jl.getBottom,adjuster:function(e,t,n,r,o){var i=Jl.moveDown(o,5);return Math.abs(n.bottom()-r.bottom())<1?yf.retry(i):n.top()>o.bottom()?yf.retry(i):n.top()===o.bottom()?yf.retry(Jl.moveDown(o,1)):xf(e,t,o)?yf.retry(Jl.translate(i,5,0)):yf.none()},move:Jl.moveDown,gather:wf.after},Rf=function(n,r,o,i,u){return 0===u?S.some(i):(a=n,l=i.left(),f=r.point(i),a.elementFromPoint(l,f).filter(function(e){return"table"===gt(e)}).isSome()?(t=i,c=u-1,Rf(n,e=r,o,e.move(t,5),c)):n.situsFromPoint(i.left(),r.point(i)).bind(function(e){return e.start().fold(S.none,function(t,e){return tf(n,t,e).bind(function(e){return r.adjuster(n,t,e,o,i).fold(S.none,function(e){return Rf(n,r,o,e,u-1)})}).orThunk(function(){return S.some(i)})},S.none)}));var e,t,c,a,l,f},Tf=function(t,n,e){var r,o,i,u=t.move(e,5),c=Rf(n,t,e,u,100).getOr(u);return(r=t,o=c,i=n,r.point(o)>i.getInnerHeight()?S.some(r.point(o)-i.getInnerHeight()):r.point(o)<0?S.some(-r.point(o)):S.none()).fold(function(){return n.situsFromPoint(c.left(),t.point(c))},function(e){return n.scrollBy(0,e),n.situsFromPoint(c.left(),t.point(c)-e)})},Df={tryUp:b(Tf,Cf),tryDown:b(Tf,Sf),ieTryUp:function(e,t){return e.situsFromPoint(t.left(),t.top()-5)},ieTryDown:function(e,t){return e.situsFromPoint(t.left(),t.bottom()+5)},getJumpSize:C(5)},Of=Br([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Af=function(e){return zt(e,"tr")},Ef={verify:function(c,e,t,n,r,a,o){return zt(n,"td,th",o).bind(function(u){return zt(e,"td,th",o).map(function(i){return nt(u,i)?nt(n,u)&&On(u)===r?a(i):Of.none("in same cell"):ur.sharedOne(Af,[u,i]).fold(function(){return t=i,n=u,r=(e=c).getRect(t),(o=e.getRect(n)).right>r.left&&o.left<r.right?Of.success():a(i);var e,t,n,r,o},function(e){return a(i)})})}).getOr(Of.none("default"))},cata:function(e,t,n,r,o){return e.fold(t,n,r,o)},adt:Of},Nf={point:J("element","offset"),delta:J("element","deltaOffset"),range:J("element","start","finish"),points:J("begin","end"),text:J("element","text")},kf=(J("ancestor","descendants","element","index"),J("parent","children","element","index")),If=function(e,t){return W(e,b(nt,t))},Pf=function(e){return"br"===gt(e)},Bf=function(e,t,n){return t(e,n).bind(function(e){return wt(e)&&0===Rn(e).trim().length?Bf(e,t,n):S.some(e)})},Mf=function(t,e,n,r){return(o=e,i=n,st(o,i).filter(Pf).orThunk(function(){return st(o,i-1).filter(Pf)})).bind(function(e){return r.traverse(e).fold(function(){return Bf(e,r.gather,t).map(r.relative)},function(e){return(r=e,ut(r).bind(function(t){var n=ft(t);return If(n,r).map(function(e){return kf(t,n,r,e)})})).map(function(e){return Ka.on(e.parent(),e.index())});var r})});var o,i},Wf=function(e,t,n,r){var o,i,u;return(Pf(t)?(o=e,i=t,(u=r).traverse(i).orThunk(function(){return Bf(i,u.gather,o)}).map(u.relative)):Mf(e,t,n,r)).map(function(e){return{start:C(e),finish:C(e)}})},_f=function(e){return Ef.cata(e,function(e){return S.none()},function(){return S.none()},function(e){return S.some(Nf.point(e,0))},function(e){return S.some(Nf.point(e,On(e)))})},Lf=tt.detect(),jf=function(r,o,i,u,c,a){return 0===a?S.none():Ff(r,o,i,u,c).bind(function(e){var t=r.fromSitus(e),n=Ef.verify(r,i,u,t.finish(),t.foffset(),c.failure,o);return Ef.cata(n,function(){return S.none()},function(){return S.some(e)},function(e){return nt(i,e)&&0===u?zf(r,i,u,Jl.moveUp,c):jf(r,o,e,0,c,a-1)},function(e){return nt(i,e)&&u===On(e)?zf(r,i,u,Jl.moveDown,c):jf(r,o,e,On(e),c,a-1)})})},zf=function(t,e,n,r,o){return ef(t,e,n).bind(function(e){return Hf(t,o,r(e,Df.getJumpSize()))})},Hf=function(e,t,n){return Lf.browser.isChrome()||Lf.browser.isSafari()||Lf.browser.isFirefox()||Lf.browser.isEdge()?t.otherRetry(e,n):Lf.browser.isIE()?t.ieRetry(e,n):S.none()},Ff=function(t,e,n,r,o){return ef(t,n,r).bind(function(e){return Hf(t,o,e)})},Uf=function(t,n,r){return(o=t,i=n,u=r,o.getSelection().bind(function(r){return Wf(i,r.finish(),r.foffset(),u).fold(function(){return S.some(Nf.point(r.finish(),r.foffset()))},function(e){var t=o.fromSitus(e),n=Ef.verify(o,r.finish(),r.foffset(),t.finish(),t.foffset(),u.failure,i);return _f(n)})})).bind(function(e){return jf(t,n,e.element(),e.offset(),r,20).map(t.fromSitus)});var o,i,u},qf=tt.detect(),Vf=function(e,t){return Wt(e,function(e){return ut(e).exists(function(e){return nt(e,t)})},n).isSome();var n},Gf=function(t,r,o,e,i){return zt(e,"td,th",r).bind(function(n){return zt(n,"table",r).bind(function(e){return Vf(i,e)?Uf(t,r,o).bind(function(t){return zt(t.finish(),"td,th",r).map(function(e){return{start:C(n),finish:C(e),range:C(t)}})}):S.none()})})},Yf=function(e,t,n,r,o,i){return qf.browser.isIE()?S.none():i(r,t).orThunk(function(){return Gf(e,t,n,r,o).map(function(e){var t=e.range();return zl.response(S.some(Gl(t.start(),t.soffset(),t.finish(),t.foffset())),!0)})})},Kf=function(e,t,n,r,o,i,u){return Gf(e,n,r,o,i).bind(function(e){return Xl.detect(t,n,e.start(),e.finish(),u)})},Xf=function(e,r){return zt(e,"tr",r).bind(function(n){return zt(n,"table",r).bind(function(e){var t=Bt(e,"tr");return nt(n,t[0])?wf.seekLeft(e,function(e){return kn(e).isSome()},r).map(function(e){var t=On(e);return zl.response(S.some(Gl(e,t,e,t)),!0)}):S.none()})})},$f=function(e,r){return zt(e,"tr",r).bind(function(n){return zt(n,"table",r).bind(function(e){var t=Bt(e,"tr");return nt(n,t[t.length-1])?wf.seekRight(e,function(e){return Nn(e).isSome()},r).map(function(e){return zl.response(S.some(Gl(e,0,e,0)),!0)}):S.none()})})},Jf=function(e,t){return zt(e,"td,th",t)},Qf={down:{traverse:lt,gather:wf.after,relative:Ka.before,otherRetry:Df.tryDown,ieRetry:Df.ieTryDown,failure:Ef.adt.failedDown},up:{traverse:at,gather:wf.before,relative:Ka.before,otherRetry:Df.tryUp,ieRetry:Df.ieTryUp,failure:Ef.adt.failedUp}},Zf=J("rows","cols"),es={mouse:function(e,t,n,r){var o=function c(o,i,t,u){var n=S.none(),e=function(){n=S.none()};return{mousedown:function(e){u.clear(i),n=Jf(e.target(),t)},mouseover:function(e){n.each(function(r){u.clear(i),Jf(e.target(),t).each(function(n){Rr(r,n,t).each(function(e){var t=e.boxes().getOr([]);(1<t.length||1===t.length&&!nt(r,n))&&(u.selectRange(i,t,e.start(),e.finish()),o.selectContents(n))})})})},mouseup:function(){n.each(e)}}}(Yl(e),t,n,r);return{mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},keyboard:function(e,a,l,f){var s=Yl(e),d=function(){return f.clear(a),S.none()};return{keydown:function(e,t,n,r,o,i){var u=e.raw().which,c=!0===e.raw().shiftKey;return Tr(a,f.selectedSelector()).fold(function(){return ql.isDown(u)&&c?b(Kf,s,a,l,Qf.down,r,t,f.selectRange):ql.isUp(u)&&c?b(Kf,s,a,l,Qf.up,r,t,f.selectRange):ql.isDown(u)?b(Yf,s,l,Qf.down,r,t,$f):ql.isUp(u)?b(Yf,s,l,Qf.up,r,t,Xf):S.none},function(t){var e=function(e){return function(){return ni(e,function(e){return Xl.update(e.rows(),e.cols(),a,t,f)}).fold(function(){return Or(a,f.firstSelectedSelector(),f.lastSelectedSelector()).map(function(e){var t=ql.isDown(u)||i.isForward(u)?Ka.after:Ka.before;return s.setRelativeSelection(Ka.on(e.first(),0),t(e.table())),f.clear(a),zl.response(S.none(),!0)})},function(e){return S.some(zl.response(S.none(),!0))})}};return ql.isDown(u)&&c?e([Zf(1,0)]):ql.isUp(u)&&c?e([Zf(-1,0)]):i.isBackward(u)&&c?e([Zf(0,-1),Zf(-1,0)]):i.isForward(u)&&c?e([Zf(0,1),Zf(1,0)]):ql.isNavigation(u)&&!1===c?d:S.none})()},keyup:function(t,n,r,o,i){return Tr(a,f.selectedSelector()).fold(function(){var e=t.raw().which;return 0==(!0===t.raw().shiftKey)?S.none():ql.isNavigation(e)?Xl.sync(a,l,n,r,o,i,f.selectRange):S.none()},S.none)}}}},ts=function(r,e){k(e,function(e){var t,n;n=e,Ri(t=r)?t.dom().classList.remove(n):Di(t,n),Ai(t)})},ns={byClass:function(o){var t,n,i=(t=o.selected(),function(e){Oi(e,t)}),r=(n=[o.selected(),o.lastSelected(),o.firstSelected()],function(e){ts(e,n)}),u=function(e){var t=Bt(e,o.selectedSelector());k(t,r)};return{clear:u,selectRange:function(e,t,n,r){u(e),k(t,i),Oi(n,o.firstSelected()),Oi(r,o.lastSelected())},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}},byAttr:function(o){var n=function(e){Dt(e,o.selected()),Dt(e,o.firstSelected()),Dt(e,o.lastSelected())},i=function(e){Ct(e,o.selected(),"1")},u=function(e){var t=Bt(e,o.selectedSelector());k(t,n)};return{clear:u,selectRange:function(e,t,n,r){u(e),k(t,i),Ct(n,o.firstSelected(),"1"),Ct(r,o.lastSelected(),"1")},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}}},rs=function(e){return!1===Ei(de.fromDom(e.target),"ephox-snooker-resizer-bar")};function os(p,h){var v=re(["mousedown","mouseover","mouseup","keyup","keydown"],[]),b=S.none(),w=ns.byAttr(Pr);return p.on("init",function(e){var r=p.getWin(),o=oc(p),t=cc(p),n=es.mouse(r,o,t,w),c=es.keyboard(r,o,t,w),a=function(e,t){!0===e.raw().shiftKey&&(t.kill()&&e.kill(),t.selection().each(function(e){var t=Qa(e.start(),e.finish()),n=al(r,t);p.selection.setRng(n)}))},i=function(e){var t=f(e);if(t.raw().shiftKey&&ql.isNavigation(t.raw().which)){var n=p.selection.getRng(),r=de.fromDom(n.startContainer),o=de.fromDom(n.endContainer);c.keyup(t,r,n.startOffset,o,n.endOffset).each(function(e){a(t,e)})}},u=function(e){var t=f(e);h().each(function(e){e.hideBars()});var n=p.selection.getRng(),r=de.fromDom(p.selection.getStart()),o=de.fromDom(n.startContainer),i=de.fromDom(n.endContainer),u=dc.directionAt(r).isRtl()?ql.rtl:ql.ltr;c.keydown(t,o,n.startOffset,i,n.endOffset,u).each(function(e){a(t,e)}),h().each(function(e){e.showBars()})},l=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},f=function(e){var t=de.fromDom(e.target),n=function(){e.stopPropagation()},r=function(){e.preventDefault()},o=x(r,n);return{target:C(t),x:C(l(e)?e.x:null),y:C(l(e)?e.y:null),stop:n,prevent:r,kill:o,raw:C(e)}},s=function(e){return 0===e.button},d=function(e){s(e)&&rs(e)&&n.mousedown(f(e))},m=function(e){var t;(t=e).buttons!==undefined&&0==(1&t.buttons)||!rs(e)||n.mouseover(f(e))},g=function(e){s(e)&&rs(e)&&n.mouseup(f(e))};p.on("mousedown",d),p.on("mouseover",m),p.on("mouseup",g),p.on("keyup",i),p.on("keydown",u),p.on("nodechange",function(){var e=p.selection,t=de.fromDom(e.getStart()),n=de.fromDom(e.getEnd());ur.sharedOne(Gt.table,[t,n]).fold(function(){w.clear(o)},y)}),b=S.some(v({mousedown:d,mouseover:m,mouseup:g,keyup:i,keydown:u}))}),{clear:w.clear,destroy:function(){b.each(function(e){})}}}var is=function(t){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(e){return e("inserttable tableprops deletetable | cell row column")}});var e=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:e("mceTableProps"),icon:"table"}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:e("mceTableDelete"),icon:"table-delete-table"}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:e("mceTableCellProps"),icon:"table-cell-properties"}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:e("mceTableMergeCells"),icon:"table-merge-cells"}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:e("mceTableSplitCells"),icon:"table-split-cells"}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:e("mceTableInsertRowBefore"),icon:"table-insert-row-above"}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:e("mceTableInsertRowAfter"),icon:"table-insert-row-after"}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:e("mceTableDeleteRow"),icon:"table-delete-row"}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:e("mceTableRowProps"),icon:"table-row-properties"}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:e("mceTableInsertColBefore"),icon:"table-insert-column-before"}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:e("mceTableInsertColAfter"),icon:"table-insert-column-after"}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:e("mceTableDeleteCol"),icon:"table-delete-column"}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",onAction:e("mceTableCutRow"),icon:"temporary-placeholder"}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",onAction:e("mceTableCopyRow"),icon:"temporary-placeholder"}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",onAction:e("mceTablePasteRowBefore"),icon:"temporary-placeholder"}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",onAction:e("mceTablePasteRowAfter"),icon:"temporary-placeholder"})},us=function(t){var e=t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol");0<e.length&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})},cs=function(r,n){var e=S.none,o=function(e){e.setDisabled(!0)},t=function(t){return e().fold(function(){o(t)},function(e){t.setDisabled(!1)}),function(){}},i=function(t){return e().fold(function(){o(t)},function(e){t.setDisabled(e.mergable().isNone())}),function(){}},u=function(t){return e().fold(function(){o(t)},function(e){t.setDisabled(e.unmergable().isNone())}),function(){}},c=function(){e=Oe(function(){return S.from(r.dom.getParent(r.selection.getStart(),"th,td")).bind(function(e){var t=de.fromDom(e);return Gt.table(t).map(function(e){return Ur.forMenu(n,e,t)})})})};r.on("nodechange",c);var a=function(e){return function(){return r.execCommand(e)}},l=function(e){var t=e.numRows,n=e.numColumns;r.undoManager.transact(function(){fa(r,n,t)}),r.addVisual()},f={text:"Table properties",onSetup:t,onAction:a("mceTableProps")},s={text:"Delete table",icon:"table-delete-table",onSetup:t,onAction:a("mceTableDelete")},d={type:"nestedmenuitem",text:"Row",getSubmenuItems:function(){return[{type:"menuitem",text:"Insert row before",icon:"table-insert-row-above",onAction:a("mceTableInsertRowBefore"),onSetup:t},{type:"menuitem",text:"Insert row after",icon:"table-insert-row-after",onAction:a("mceTableInsertRowAfter"),onSetup:t},{type:"menuitem",text:"Delete row",icon:"table-delete-row",onAction:a("mceTableDeleteRow"),onSetup:t},{type:"menuitem",text:"Row properties",icon:"table-row-properties",onAction:a("mceTableRowProps"),onSetup:t},{type:"separator"},{type:"menuitem",text:"Cut row",onAction:a("mceTableCutRow"),onSetup:t},{type:"menuitem",text:"Copy row",onAction:a("mceTableCopyRow"),onSetup:t},{type:"menuitem",text:"Paste row before",onAction:a("mceTablePasteRowBefore"),onSetup:t},{type:"menuitem",text:"Paste row after",onAction:a("mceTablePasteRowAfter"),onSetup:t}]}},m={type:"nestedmenuitem",text:"Column",getSubmenuItems:function(){return[{type:"menuitem",text:"Insert column before",icon:"table-insert-column-before",onAction:a("mceTableInsertColBefore"),onSetup:t},{type:"menuitem",text:"Insert column after",icon:"table-insert-column-after",onAction:a("mceTableInsertColAfter"),onSetup:t},{type:"menuitem",text:"Delete column",icon:"table-delete-column",onAction:a("mceTableDeleteCol"),onSetup:t}]}},g={type:"nestedmenuitem",text:"Cell",getSubmenuItems:function(){return[{type:"menuitem",text:"Cell properties",icon:"table-cell-properties",onAction:a("mceTableCellProps"),onSetup:t},{type:"menuitem",text:"Merge cells",icon:"table-merge-cells",onAction:a("mceTableMergeCells"),onSetup:i},{type:"menuitem",text:"Split cell",icon:"table-split-cells",onAction:a("mceTableSplitCells"),onSetup:u}]}};!1===r.getParam("table_grid",!0,"boolean")?r.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:a("mceInsertTable")}):r.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:l}]}}),r.ui.registry.addMenuItem("tableprops",f),r.ui.registry.addMenuItem("deletetable",s),r.ui.registry.addNestedMenuItem("row",d),r.ui.registry.addNestedMenuItem("column",m),r.ui.registry.addNestedMenuItem("cell",g),r.ui.registry.addContextMenu("table",{update:function(){return c(),e().fold(function(){return""},function(){return"cell row column | tableprops deletetable"})}})},as=function(n,r){return{insertTable:function(e,t){return fa(n,e,t)},setClipboardRows:function(e){return t=r,n=N(e,de.fromDom),void t.set(S.from(n));var t,n},getClipboardRows:function(){return r.get().fold(function(){},function(e){return N(e,function(e){return e.dom()})})}}};e.add("table",function fs(t){var n,r=La(t),e=os(t,r.lazyResize),o=Oc(t,r.lazyWire),i=(n=t,{get:function(){var e=oc(n);return Ar(e,Pr.selectedSelector()).fold(function(){return n.selection.getStart()===undefined?Wr.none():Wr.single(n.selection)},function(e){return Wr.multiple(e)})}}),u=Po(S.none());return pa(t,o,e,i,u),qr(t,i,o,e),cs(t,i),is(t),us(t),t.on("PreInit",function(){t.serializer.addTempAttr(Pr.firstSelected()),t.serializer.addTempAttr(Pr.lastSelected())}),t.getParam("table_tab_navigation",!0,"boolean")&&t.on("keydown",function(e){jl(e,t,o,r.lazyWire)}),t.on("remove",function(){r.destroy(),e.destroy()}),as(t,u)}),function ss(){}}();!function(){"use strict";var e,n,r,t,a,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(e,n){return e.fire("insertCustomChar",{chr:n})},l=function(e,n){var r=o(e,n).chr;e.execCommand("mceInsertContent",!1,r)},c=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(e){return e.settings.charmap},s=function(e){return e.settings.charmap_append},f=function(e){return function(){return e}},g=f(!1),m=f(!0),h=g,d=m,p=function(){return y},y=(t={fold:function(e,n){return e()},is:h,isSome:h,isNone:d,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:n,map:p,ap:p,each:function(){},bind:p,flatten:p,exists:h,forall:d,filter:p,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:f("none()")},Object.freeze&&Object.freeze(t),t),b=function(r){var e=function(){return r},n=function(){return a},t=function(e){return e(r)},a={fold:function(e,n){return n(r)},is:function(e){return r===e},isSome:d,isNone:h,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return b(e(r))},ap:function(e){return e.fold(p,function(e){return b(e(r))})},each:function(e){e(r)},bind:t,flatten:e,exists:t,forall:t,filter:function(e){return e(r)?a:y},equals:function(e){return e.is(r)},equals_:function(e,n){return e.fold(h,function(e){return n(r,e)})},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return a},v={some:b,none:p,from:function(e){return null===e||e===undefined?y:b(e)}},w=(a="function",function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&Array.prototype.isPrototypeOf(e)?"array":"object"===n&&String.prototype.isPrototypeOf(e)?"string":n}(e)===a}),k=function(e,n){for(var r=e.length,t=new Array(r),a=0;a<r;a++){var i=e[a];t[a]=n(i,a,e)}return t},C=Array.prototype.push,O=function(e,n){return function(e){for(var n=[],r=0,t=e.length;r<t;++r){if(!Array.prototype.isPrototypeOf(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);C.apply(n,e[r])}return n}(k(e,n))},A=(Array.prototype.slice,w(Array.from)&&Array.from,c.isArray),x="User Defined",q=function(e){return A(e)?[].concat((n=e,c.grep(n,function(e){return A(e)&&2===e.length}))):"function"==typeof e?e():[];var n},S=function(e){var n=function(e,n){var r=u(e);r&&(n=[{name:x,characters:q(r)}]);var t=s(e);if(t){var a=c.grep(n,function(e){return e.name===x});return a.length?(a[0].characters=[].concat(a[0].characters).concat(q(t)),n):[].concat(n).concat({name:x,characters:q(t)})}return n}(e,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[402,"function / florin"],[8747,"integral"],[8721,"n-ary sumation"],[8734,"infinity"],[8730,"square root"],[8764,"similar to"],[8773,"approximately equal to"],[8776,"almost equal to"],[8800,"not equal to"],[8801,"identical to"],[8712,"element of"],[8713,"not an element of"],[8715,"contains as member"],[8719,"n-ary product"],[8743,"logical and"],[8744,"logical or"],[172,"not sign"],[8745,"intersection"],[8746,"union"],[8706,"partial differential"],[8704,"for all"],[8707,"there exists"],[8709,"diameter"],[8711,"backward difference"],[8727,"asterisk operator"],[8733,"proportional to"],[8736,"angle"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Symbols",characters:[[8501,"alef symbol"],[982,"pi symbol"],[8476,"real part symbol"],[978,"upsilon - hook symbol"],[8472,"Weierstrass p"],[8465,"imaginary part"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8629,"carriage return"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8756,"therefore"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8853,"circled plus"],[8855,"circled times"],[8869,"perpendicular"],[8901,"dot operator"],[8968,"left ceiling"],[8969,"right ceiling"],[8970,"left floor"],[8971,"right floor"],[9001,"left-pointing angle bracket"],[9002,"right-pointing angle bracket"],[9674,"lozenge"],[9824,"black spade suit"],[9827,"black club suit"],[9829,"black heart suit"],[9830,"black diamond suit"],[8194,"en space"],[8195,"em space"],[8201,"thin space"],[8204,"zero width non-joiner"],[8205,"zero width joiner"],[8206,"left-to-right mark"],[8207,"right-to-left mark"]]}]);return 1<n.length?[{name:"All",characters:O(n,function(e){return e.characters})}].concat(n):n},T=function(n){return{getCharMap:function(){return S(n)},insertChar:function(e){l(n,e)}}},E=function(e){var n=e,r=function(){return n};return{get:r,set:function(e){n=e},clone:function(){return E(r())}}},z=function(e,n){return-1!==e.indexOf(n)},U=function(e,n){var a=[],i=n.toLowerCase();return function(e,n){for(var r=0,t=e.length;r<t;r++)n(e[r],r,e)}(e.characters,function(e){var n,r,t;n=e[0],r=e[1],t=i,(z(String.fromCharCode(n).toLowerCase(),t)||z(r.toLowerCase(),t)||z(r.toLowerCase().replace(/\s+/g,""),t))&&a.push(e)}),k(a,function(e){return{text:e[1],value:String.fromCharCode(e[0]),icon:String.fromCharCode(e[0])}})},D="pattern",I=function(r,e){var t,a,i,n=function(){return[{label:"Search",type:"input",name:D},{type:"collection",name:"results",columns:"auto"}]},o=1===e.length?E(x):E("All"),c=function(r,t){(function(e,n){for(var r=0,t=e.length;r<t;r++){var a=e[r];if(n(a,r,e))return v.some(a)}return v.none()})(e,function(e){return e.name===o.get()}).each(function(e){var n=U(e,t);r.setData({results:n})})},u=(t=function(e){var n=e.getData().pattern;c(e,n)},a=40,i=null,{cancel:function(){null!==i&&(clearTimeout(i),i=null)},throttle:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];null!==i&&clearTimeout(i),i=setTimeout(function(){t.apply(null,e),i=null},a)}}),s={title:"Special Character",size:"normal",body:1===e.length?{type:"panel",items:n()}:{type:"tabpanel",tabs:k(e,function(e){return{title:e.name,items:n()}})},buttons:[{type:"cancel",name:"close",text:"Close"}],initialData:{pattern:"",results:U(e[0],"")},onAction:function(e,n){"results"===n.name&&(l(r,n.value),e.close())},onTabChange:function(e,n){o.set(n),u.throttle(e)},onChange:function(e,n){n.name===D&&u.throttle(e)}};r.windowManager.open(s)},N=function(e,n){e.addCommand("mceShowCharmap",function(){I(e,n)})},P=tinymce.util.Tools.resolve("tinymce.util.Promise"),j=function(e,n){return 0===e.startOffset||/\s/.test(n.charAt(e.startOffset-1))},L=function(e){e.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:function(){return e.execCommand("mceShowCharmap")}}),e.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:function(){return e.execCommand("mceShowCharmap")}})};i.add("charmap",function(e){var t,a,n=S(e);return N(e,n),L(e),t=e,a=n[0],t.ui.registry.addAutocompleter("charmap",{ch:":",columns:"auto",minChars:2,matches:j,fetch:function(r,e){return new P(function(e,n){e(U(a,r))})},onAction:function(e,n,r){t.selection.setRng(n),t.insertContent(r),e.hide()}}),T(e)}),function M(){}}();!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")})},t=function(n){n.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}}),n.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}})};n.add("hr",function(n){o(n),t(n)}),function e(){}}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),a=function(e){return e.getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e")},i=function(e){return e.getParam("pagebreak_split_block",!1)},t=function(){return"mce-pagebreak"},r=function(){return'<img src="'+n.transparentSrc+'" class="mce-pagebreak" data-mce-resize="false" data-mce-placeholder />'},o=function(o){var c=a(o),n=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi");o.on("BeforeSetContent",function(e){e.content=e.content.replace(n,r())}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var n,a,t=e.length;t--;)if((a=(n=e[t]).attr("class"))&&-1!==a.indexOf("mce-pagebreak")){var r=n.parent;if(o.schema.getBlockElements()[r.name]&&i(o)){r.type=3,r.value=c,r.raw=!0,n.remove();continue}n.type=3,n.value=c,n.raw=!0}})})},c=r,u=t,g=function(e){e.addCommand("mcePageBreak",function(){e.settings.pagebreak_split_block?e.insertContent("<p>"+c()+"</p>"):e.insertContent(c())})},m=function(n){n.on("ResolveName",function(e){"IMG"===e.target.nodeName&&n.dom.hasClass(e.target,u())&&(e.name="pagebreak")})},s=function(e){e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:function(){return e.execCommand("mcePageBreak")}}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:function(){return e.execCommand("mcePageBreak")}})};e.add("pagebreak",function(e){g(e),s(e),o(e),m(e)}),function l(){}}();!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(n,e){var o,t=(o=n).plugins.visualchars&&o.plugins.visualchars.isEnabled()?'<span class="mce-nbsp">&nbsp;</span>':"&nbsp;";n.insertContent(function(n,e){for(var o="",t=0;t<e;t++)o+=n;return o}(t,e)),n.dom.setAttrib(n.dom.select("span.mce-nbsp"),"data-mce-bogus","1")},e=function(n){n.addCommand("mceNonBreaking",function(){t(n,1)})},i=tinymce.util.Tools.resolve("tinymce.util.VK"),a=function(n){var e=n.getParam("nonbreaking_force_tab",0);return"boolean"==typeof e?!0===e?3:0:e},o=function(e){var o=a(e);0<o&&e.on("keydown",function(n){if(n.keyCode===i.TAB&&!n.isDefaultPrevented()){if(n.shiftKey)return;n.preventDefault(),n.stopImmediatePropagation(),t(e,o)}})},r=function(n){n.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:function(){return n.execCommand("mceNonBreaking")}}),n.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:function(){return n.execCommand("mceNonBreaking")}})};n.add("nonbreaking",function(n){e(n),r(n),o(n)}),function c(){}}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(e){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(e)},t=function(e){var t=e.selection.getNode();return"A"===t.tagName&&""===e.dom.getAttrib(t,"href")?t.getAttribute("id")||t.getAttribute("name"):""},r=function(e,t){var n=e.selection.getNode();"A"===n.tagName&&""===e.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=t,e.undoManager.add()):(e.focus(),e.selection.collapse(!0),e.execCommand("mceInsertContent",!1,e.dom.createHTML("a",{id:t})))},n=function(o){var e=t(o);o.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:e},onSubmit:function(e){var t,n;t=o,n=e.getData().id,(a(n)?(r(t,n),0):(t.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))||e.close()}})},o=function(e){e.addCommand("mceAnchor",function(){n(e)})},i=function(o){return function(e){for(var t=0;t<e.length;t++)(n=e[t]).attr("href")||!n.attr("id")&&!n.attr("name")||n.firstChild||e[t].attr("contenteditable",o);var n}},c=function(e){e.on("PreInit",function(){e.parser.addNodeFilter("a",i("false")),e.serializer.addNodeFilter("a",i(null))})},d=function(t){t.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return t.execCommand("mceAnchor")},onSetup:function(e){return t.selection.selectorChangedWithUnbind("a:not([href])",e.setActive).unbind}}),t.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return t.execCommand("mceAnchor")}})};e.add("anchor",function(e){c(e),o(e),d(e)}),function u(){}}();!function(){"use strict";var e,n,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.util.I18n"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(t){return t.getParam("toc_class","mce-toc")},m=function(t){var e=t.getParam("toc_header","h2");return/^h[1-6]$/.test(e)?e:"h2"},c=function(t){var e=parseInt(t.getParam("toc_depth","3"),10);return 1<=e&&e<=9?e:3},l=(e="mcetoc_",n=0,function(){var t=(new Date).getTime().toString(32);return e+t+(n++).toString(32)}),u=function u(t){var e,n=[];for(e=1;e<=t;e++)n.push("h"+e);return n.join(",")},v=function(n){var o=a(n),t=m(n),e=u(c(n)),r=n.$(e);return r.length&&/^h[1-9]$/i.test(t)&&(r=r.filter(function(t,e){return!n.dom.hasClass(e.parentNode,o)})),i.map(r,function(t){return{id:t.id?t.id:l(),level:parseInt(t.nodeName.replace(/^H/i,""),10),title:n.$.text(t),element:t}})},d=function(t){var e,n,o,r,i,c,a,l="",u=v(t),d=function(t){var e,n=9;for(e=0;e<t.length;e++)if(t[e].level<n&&(n=t[e].level),1===n)return n;return n}(u)-1;if(!u.length)return"";for(l+=(i=m(t),c=f.translate("Table of Contents"),a="</"+i+">","<"+i+' contenteditable="true">'+s.DOM.encode(c)+a),e=0;e<u.length;e++){if((o=u[e]).element.id=o.id,r=u[e+1]&&u[e+1].level,d===o.level)l+="<li>";else for(n=d;n<o.level;n++)l+="<ul><li>";if(l+='<a href="#'+o.id+'">'+o.title+"</a>",r!==o.level&&r)for(n=o.level;r<n;n--)l+="</li></ul><li>";else l+="</li>",r||(l+="</ul>");d=o.level}return l},g=function(t){var e=a(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(d(t))})},o={hasHeaders:function(t){return 0<v(t).length},insertToc:function(t){var e,n,o,r,i=a(t),c=t.$("."+i);o=t,!(r=c).length||0<o.dom.getParents(r[0],".mce-offscreen-selection").length?t.insertContent((n=d(e=t),'<div class="'+e.dom.encode(a(e))+'" contenteditable="false">'+n+"</div>")):g(t)},updateToc:g},r=function(t){t.addCommand("mceInsertToc",function(){o.insertToc(t)}),t.addCommand("mceUpdateToc",function(){o.updateToc(t)})},h=function(t){var n=t.$,o=a(t);t.on("PreProcess",function(t){var e=n("."+o,t.node);e.length&&(e.removeAttr("contentEditable"),e.find("[contenteditable]").removeAttr("contentEditable"))}),t.on("SetContent",function(){var t=n("."+o);t.length&&(t.attr("contentEditable",!1),t.children(":first-child").attr("contentEditable",!0))})},p=function(n){return function(t){var e=function(){return t.setDisabled(n.readonly||!o.hasHeaders(n))};return e(),n.on("LoadContent SetContent change",e),function(){return n.on("LoadContent SetContent change",e)}}},T=function(t){var e;t.ui.registry.addButton("toc",{icon:"toc",tooltip:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:p(t)}),t.ui.registry.addButton("tocupdate",{icon:"reload",tooltip:"Update",onAction:function(){return t.execCommand("mceUpdateToc")}}),t.ui.registry.addMenuItem("toc",{icon:"toc",text:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:p(t)}),t.ui.registry.addContextToolbar("toc",{items:"tocupdate",predicate:(e=t,function(t){return t&&e.dom.is(t,"."+a(e))&&e.getBody().contains(t)}),scope:"node",position:"node"})};t.add("toc",function(t){r(t),T(t),h(t)}),function y(){}}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},r=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},t=function(e){return e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d"))},a=n,i=r,o=function(e){var t=r(e);return 0<t.length?t[0]:n(e)},l=function(e){return e.getParam("insertdatetime_element",!1)},u="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),c="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),m="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),s="January February March April May June July August September October November December".split(" "),d=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},p=function(e,t,n){return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",d(n.getMonth()+1,2))).replace("%d",d(n.getDate(),2))).replace("%H",""+d(n.getHours(),2))).replace("%M",""+d(n.getMinutes(),2))).replace("%S",""+d(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(s[n.getMonth()]))).replace("%b",""+e.translate(m[n.getMonth()]))).replace("%A",""+e.translate(c[n.getDay()]))).replace("%a",""+e.translate(u[n.getDay()]))).replace("%%","%")},f=function(e,t){if(l(e)){var n=p(e,t),r=void 0;r=/%[HMSIp]/.test(t)?p(e,"%Y-%m-%dT%H:%M"):p(e,"%Y-%m-%d");var a=e.dom.getParent(e.selection.getStart(),"time");a?(o=a,u=r,c=n,m=(i=e).dom.create("time",{datetime:u},c),o.parentNode.insertBefore(m,o),i.dom.remove(o),i.selection.select(m,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")}else e.insertContent(p(e,t));var i,o,u,c,m},g=p,y=function(e){e.addCommand("mceInsertDate",function(){f(e,t(e))}),e.addCommand("mceInsertTime",function(){f(e,a(e))})},M=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return S(n())}}},v=function(n){var t=i(n),r=S(o(n));n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",fetch:function(e){e(M.map(t,function(e){return{type:"choiceitem",text:g(n,e),value:e}}))},onAction:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];f(n,r.get())},onItemAction:function(e,t){r.set(t),f(n,t)}}),n.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return M.map(t,function(e){return{type:"menuitem",text:g(n,e),onAction:(t=e,function(){r.set(t),f(n,t)})};var t})}})};e.add("insertdatetime",function(e){y(e),v(e)}),function h(){}}();!function(){"use strict";var n,t,e,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),O=function(n,t,e){var r="UL"===t?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===e?null:{"list-style-type":e})},u=function(e){e.addCommand("ApplyUnorderedListStyle",function(n,t){O(e,"UL",t["list-style-type"])}),e.addCommand("ApplyOrderedListStyle",function(n,t){O(e,"OL",t["list-style-type"])})},i=function(n){var t=n.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return t?t.split(/[ ,]/):[]},l=function(n){var t=n.getParam("advlist_bullet_styles","default,circle,square");return t?t.split(/[ ,]/):[]},c=function(n){return function(){return n}},f=c(!1),s=c(!0),a=f,d=s,g=function(){return p},p=(r={fold:function(n,t){return n()},is:a,isSome:a,isNone:d,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:t,map:g,ap:g,each:function(){},bind:g,flatten:g,exists:a,forall:d,filter:g,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:c("none()")},Object.freeze&&Object.freeze(r),r),m=function(e){var n=function(){return e},t=function(){return o},r=function(n){return n(e)},o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:d,isNone:a,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return m(n(e))},ap:function(n){return n.fold(g,function(n){return m(n(e))})},each:function(n){n(e)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(e)?o:p},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(a,function(n){return t(e,n)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},y=function(n){return null===n||n===undefined?p:m(n)},h=function(n){return n&&/^(TH|TD)$/.test(n.nodeName)},L=function(r){return function(n){return n&&/^(OL|UL|DL)$/.test(n.nodeName)&&(e=n,(t=r).$.contains(t.getBody(),e));var t,e}},b=function(n){var t=n.dom.getParent(n.selection.getNode(),"ol,ul"),e=n.dom.getStyle(t,"listStyleType");return y(e)},S=function(n,t,e){var r=function(n,t){for(var e=0;e<n.length;e++)if(t(n[e]))return e;return-1}(t.parents,h),o=-1!==r?t.parents.slice(0,r):t.parents,u=v.grep(o,L(n));return 0<u.length&&u[0].nodeName===e},T=function(n,t,e,r,o,u){var i,l,c,f,s,a,d,g,p,m,y;0<u.length?(d=t,g=e,p=r,m=o,y=u,(a=n).ui.registry.addSplitButton(d,{tooltip:g,icon:"OL"===m?"ordered-list":"unordered-list",presets:"toolbar",columns:3,fetch:function(n){n(v.map(y,function(n){var t="OL"===m?"num":"bull",e="disc"===n||"decimal"===n?"default":n,r="default"===n?"":n,o=n.replace(/\-/g," ").replace(/\b\w/g,function(n){return n.toUpperCase()});return{type:"choiceitem",value:r,icon:"list-"+t+"-"+e,text:o,ariaLabel:o}}))},onAction:function(){return a.execCommand(p)},onItemAction:function(n,t){O(a,m,t)},select:function(t){return b(a).map(function(n){return t===n}).getOr(!1)},onSetup:function(t){var n=function(n){t.setActive(S(a,n,m))};return a.on("nodeChange",n),function(){return a.off("nodeChange",n)}}})):(l=t,c=e,f=r,s=o,(i=n).ui.registry.addToggleButton(l,{active:!1,tooltip:c,icon:"OL"===s?"ordered-list":"unordered-list",onSetup:function(t){var n=function(n){t.setActive(S(i,n,s))};return i.on("nodeChange",n),function(){return i.off("nodeChange",n)}},onAction:function(){return i.execCommand(f)}}))},A=function(n){T(n,"numlist","Numbered list","InsertOrderedList","OL",i(n)),T(n,"bullist","Bullet list","InsertUnorderedList","UL",l(n))};o.add("advlist",function(n){var t,e,r;e="lists",r=(t=n).settings.plugins?t.settings.plugins:"",-1!==v.inArray(r.split(/[ ,]/),e)&&(A(n),u(n))}),function C(){}}();!function(){"use strict";var e,t,n,r,o,i,u,s,l,a,c=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),d=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),m=tinymce.util.Tools.resolve("tinymce.util.VK"),p=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),h=function(e){return e&&"BR"===e.nodeName},y=function(e){return e&&3===e.nodeType},N=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},S=function(e){return e&&/^(OL|UL)$/.test(e.nodeName)},O=function(e){return e&&/^(DT|DD)$/.test(e.nodeName)},C=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},L=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},b=h,T=function(e,t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]},D=function(e,t){return e&&e.nodeName in t},E=function(e,t){return!!h(t)&&!(!e.isBlock(t.nextSibling)||h(t.previousSibling))},w=function(e,t,n){var r=e.isEmpty(t);return!(n&&0<e.select("span[data-mce-type=bookmark]",t).length)&&r},k=function(e,t){return e.isChildOf(t,e.getRoot())},A=function(e,t){if(y(e))return{container:e,offset:t};var n=f.getNode(e,t);return y(n)?{container:n,offset:t>=e.childNodes.length?n.data.length:0}:n.previousSibling&&y(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&y(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:e,offset:t}},x=function(e){var t=e.cloneRange(),n=A(e.startContainer,e.startOffset);t.setStart(n.container,n.offset);var r=A(e.endContainer,e.endOffset);return t.setEnd(r.container,r.offset),t},R=g.DOM,I=function(o){var i={},e=function(e){var t,n,r;n=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"],1===n.nodeType&&(t=R.create("span",{"data-mce-type":"bookmark"}),n.hasChildNodes()?(r=Math.min(r,n.childNodes.length-1),e?n.insertBefore(t,n.childNodes[r]):R.insertAfter(t,n.childNodes[r])):n.appendChild(t),n=t,r=0),i[e?"startContainer":"endContainer"]=n,i[e?"startOffset":"endOffset"]=r};return e(!0),o.collapsed||e(),i},B=function(o){function e(e){var t,n,r;t=r=o[e?"startContainer":"endContainer"],n=o[e?"startOffset":"endOffset"],t&&(1===t.nodeType&&(n=function(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t===e)return n;1===t.nodeType&&"bookmark"===t.getAttribute("data-mce-type")||n++,t=t.nextSibling}return-1}(t),t=t.parentNode,R.remove(r),!t.hasChildNodes()&&R.isBlock(t)&&t.appendChild(R.create("br"))),o[e?"startContainer":"endContainer"]=t,o[e?"startOffset":"endOffset"]=n)}e(!0),e();var t=R.createRng();return t.setStart(o.startContainer,o.startOffset),o.endContainer&&t.setEnd(o.endContainer,o.endOffset),x(t)},_=function(e){return function(){return e}},P=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}},M=_(!1),U=_(!0),F=M,j=U,H=function(){return $},$=(r={fold:function(e,t){return e()},is:F,isSome:F,isNone:j,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:H,ap:H,each:function(){},bind:H,flatten:H,exists:F,forall:j,filter:H,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:_("none()")},Object.freeze&&Object.freeze(r),r),q=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:j,isNone:F,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return q(e(n))},ap:function(e){return e.fold(H,function(e){return q(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:$},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(F,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},W={some:q,none:H,from:function(e){return null===e||e===undefined?$:q(e)}},z=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},K=z("string"),V=z("boolean"),X=z("function"),Q=z("number"),Y=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},G=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},J=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},Z=function(e,t,n){return G(e,function(e){n=t(n,e)}),n},ee=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return W.some(o)}return W.none()},te=Array.prototype.push,ne=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);te.apply(t,e[n])}return t}(Y(e,t))},re=Array.prototype.slice,oe=function(e){return 0===e.length?W.none():W.some(e[0])},ie=function(e){return 0===e.length?W.none():W.some(e[e.length-1])},ue=(X(Array.from)&&Array.from,"undefined"!=typeof window?window:Function("return this;")()),se=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:ue,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},ae=function(e,t){var n=se(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n},ce=function(e){var t,n=se("ownerDocument.defaultView",e);return(t=n,ae("HTMLElement",t)).prototype.isPrototypeOf(e)},fe=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),le=function(e){var t=e.selection.getStart(!0);return e.dom.getParent(t,"OL,UL,DL",me(e,t))},de=function(e){var n,t,r,o=e.selection.getSelectedBlocks();return v.grep((n=e,t=o,r=v.map(t,function(e){var t=n.dom.getParent(e,"li,dd,dt",me(n,e));return t||e}),fe.unique(r)),function(e){return C(e)})},me=function(e,t){var n=e.dom.getParents(t,"TD,TH");return 0<n.length?n[0]:e.getBody()},ge=function(e,t){var n=e.dom.getParents(t,"ol,ul",me(e,t));return ie(n)},pe=function(t,e){var n=Y(e,function(e){return ge(t,e).getOr(e)});return fe.unique(n)},ve={isList:function(e){var t=le(e);return ce(t)},getParentList:le,getSelectedSubLists:function(e){var t,n,r,o=le(e),i=e.selection.getSelectedBlocks();return r=i,(n=o)&&1===r.length&&r[0]===n?(t=o,v.grep(t.querySelectorAll("ol,ul,dl"),function(e){return N(e)})):v.grep(i,function(e){return N(e)&&o!==e})},getSelectedListItems:de,getClosestListRootElm:me,getSelectedDlItems:function(e){return J(de(e),O)},getSelectedListRoots:function(e){var t,n,r,o=(n=ge(t=e,t.selection.getStart()),r=J(t.selection.getSelectedBlocks(),S),n.toArray().concat(r));return pe(e,o)}},he=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Ne(r(1),r(2))},ye=function(){return Ne(0,0)},Ne=function(e,t){return{major:e,minor:t}},Se={nu:Ne,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?ye():he(e,n)},unknown:ye},Oe="Firefox",Ce=function(e,t){return function(){return t===e}},Le=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Ce("Edge",t),isChrome:Ce("Chrome",t),isIE:Ce("IE",t),isOpera:Ce("Opera",t),isFirefox:Ce(Oe,t),isSafari:Ce("Safari",t)}},be={unknown:function(){return Le({current:undefined,version:Se.unknown()})},nu:Le,edge:_("Edge"),chrome:_("Chrome"),ie:_("IE"),opera:_("Opera"),firefox:_(Oe),safari:_("Safari")},Te="Windows",De="Android",Ee="Solaris",we="FreeBSD",ke=function(e,t){return function(){return t===e}},Ae=function(e){var t=e.current;return{current:t,version:e.version,isWindows:ke(Te,t),isiOS:ke("iOS",t),isAndroid:ke(De,t),isOSX:ke("OSX",t),isLinux:ke("Linux",t),isSolaris:ke(Ee,t),isFreeBSD:ke(we,t)}},xe={unknown:function(){return Ae({current:undefined,version:Se.unknown()})},nu:Ae,windows:_(Te),ios:_("iOS"),android:_(De),linux:_("Linux"),osx:_("OSX"),solaris:_(Ee),freebsd:_(we)},Re=function(e,t){var n=String(t).toLowerCase();return ee(e,function(e){return e.search(n)})},Ie=function(e,n){return Re(e,n).map(function(e){var t=Se.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Be=function(e,n){return Re(e,n).map(function(e){var t=Se.detect(e.versionRegexes,n);return{current:e.name,version:t}})},_e=function(e,t){return-1!==e.indexOf(t)},Pe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Me=function(t){return function(e){return _e(e,t)}},Ue=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return _e(e,"edge/")&&_e(e,"chrome")&&_e(e,"safari")&&_e(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Pe],search:function(e){return _e(e,"chrome")&&!_e(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return _e(e,"msie")||_e(e,"trident")}},{name:"Opera",versionRegexes:[Pe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Me("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Me("firefox")},{name:"Safari",versionRegexes:[Pe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(_e(e,"safari")||_e(e,"mobile/"))&&_e(e,"applewebkit")}}],Fe=[{name:"Windows",search:Me("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return _e(e,"iphone")||_e(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Me("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Me("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Me("linux"),versionRegexes:[]},{name:"Solaris",search:Me("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Me("freebsd"),versionRegexes:[]}],je={browsers:_(Ue),oses:_(Fe)},He=function(e){var t,n,r,o,i,u,s,a,c,f,l,d=je.browsers(),m=je.oses(),g=Ie(d,e).fold(be.unknown,be.nu),p=Be(m,e).fold(xe.unknown,xe.nu);return{browser:g,os:p,deviceType:(n=g,r=e,o=(t=p).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,u=t.isAndroid()&&3===t.version.major,s=t.isAndroid()&&4===t.version.major,a=o||u||s&&!0===/mobile/i.test(r),c=t.isiOS()||t.isAndroid(),f=c&&!a,l=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:_(o),isiPhone:_(i),isTablet:_(a),isPhone:_(f),isTouch:_(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:_(l)})}},$e={detect:(o=function(){var e=navigator.userAgent;return He(e)},u=!1,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return u||(u=!0,i=o.apply(null,e)),i})},qe=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:_(e)}},We={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return qe(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return qe(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return qe(n)},fromDom:qe,fromPoint:function(e,t,n){var r=e.dom();return W.from(r.elementFromPoint(t,n)).map(qe)}},ze=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE,Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),Ke=(Node.TEXT_NODE,Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,ze),Ve=($e.detect().browser.isIE(),function(e,t){var n=e.dom();if(n.nodeType!==Ke)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}),Xe=Object.keys,Qe=function(e){return e.dom().nodeName.toLowerCase()},Ye=function(e,t){var n=e.dom();!function(e,t){for(var n=Xe(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}}(t,function(e,t){!function(e,t,n){if(!(K(n)||V(n)||Q(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(n,t,e)})},Ge=function(e){return Z(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},Je=function(e){var t=e.dom();return W.from(t.parentNode).map(We.fromDom)},Ze=function(e){var t=e.dom();return Y(t.childNodes,We.fromDom)},et=function(e,t){var n=e.dom().childNodes;return W.from(n[t]).map(We.fromDom)},tt=function(e){return et(e,0)},nt=function(e){return et(e,e.dom().childNodes.length-1)},rt=(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}("element","offset"),function(t,n){Je(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})}),ot=function(e,t){e.dom().appendChild(t.dom())},it=function(t,e){G(e,function(e){ot(t,e)})},ut=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},st=function(e){return t=e,n=!0,We.fromDom(t.dom().cloneNode(n));var t,n},at=function(e,t){var n,r,o,i,u=(n=e,r=t,o=We.fromTag(r),i=Ge(n),Ye(o,i),o);rt(e,u);var s=Ze(e);return it(u,s),ut(e),u},ct=tinymce.util.Tools.resolve("tinymce.Env"),ft=g.DOM,lt=function(e,t,n){var r,o,i,u=ft.createFragment(),s=e.schema.getBlockElements();if(e.settings.forced_root_block&&(n=n||e.settings.forced_root_block),n&&((o=ft.create(n)).tagName===e.settings.forced_root_block&&ft.setAttribs(o,e.settings.forced_root_block_attrs),D(t.firstChild,s)||u.appendChild(o)),t)for(;r=t.firstChild;){var a=r.nodeName;i||"SPAN"===a&&"bookmark"===r.getAttribute("data-mce-type")||(i=!0),D(r,s)?(u.appendChild(r),o=null):n?(o||(o=ft.create(n),u.appendChild(o)),o.appendChild(r)):u.appendChild(r)}return e.settings.forced_root_block?i||ct.ie&&!(10<ct.ie)||o.appendChild(ft.create("br",{"data-mce-bogus":"1"})):u.appendChild(ft.create("br")),u},dt=g.DOM,mt=function(e,t,n,r){var o,i,u,s,a;for(u=dt.select('span[data-mce-type="bookmark"]',t),r=r||lt(e,n),(o=dt.createRng()).setStartAfter(n),o.setEndAfter(t),s=(i=o.extractContents()).firstChild;s;s=s.firstChild)if("LI"===s.nodeName&&e.dom.isEmpty(s)){dt.remove(s);break}e.dom.isEmpty(i)||dt.insertAfter(i,t),dt.insertAfter(r,t),w(e.dom,n.parentNode)&&(a=n.parentNode,v.each(u,function(e){a.parentNode.insertBefore(e,n.parentNode)}),dt.remove(a)),dt.remove(n),w(e.dom,t)&&dt.remove(t)},gt=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return W.none();n.push(o.getOrDie())}return W.some(t.apply(null,n))},pt=function(e,t,n){if(!K(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);e.style!==undefined&&e.style.setProperty(t,n)},vt=function(e,t){ot(e.item,t.list)},ht=function(i,e,u){for(var s=[],t=function(e){var t,n,r,o=(t=i,n=u,r={list:We.fromTag(n,t),item:We.fromTag("li",t)},ot(r.list,r.item),r);ie(s).each(function(e){return vt(e,o)}),s.push(o)},n=0;n<e;n++)t();return s},yt=function(c,e,f){var t=e.slice(0,f.depth);return ie(t).each(function(e){var t,n,r,o,i,u,s,a;t=e,r=c,o=f.itemAttributes,i=f.content,u=We.fromTag("li",r),Ye(u,o),it(u,i),n=u,ot(t.list,n),t.item=n,a=f,Qe((s=e).list).toUpperCase()!==a.listType&&(s.list=at(s.list,a.listType)),Ye(s.list,a.listAttributes)}),t},Nt=function(e,t,n){var r=ht(e,n.depth-t.length,n.listType);return function(e,t){ie(e).each(function(e){Ye(e.list,t.listAttributes),Ye(e.item,t.itemAttributes),it(e.item,t.content)});for(var n=0;n<e.length-1;n++)r=e[n].item,o="list-style-type",i="none",u=r.dom(),pt(u,o,i);var r,o,i,u}(r,n),gt([ie(t),oe(r)],vt),t.concat(r)},St=function(e){return 0<e.depth},Ot=function(e){return e.isSelected},Ct=Object.prototype.hasOwnProperty,Lt=(s=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Ct.call(o,i)&&(n[i]=s(n[i],o[i]))}return n}),bt=function(e,r){var t=r.depth-1;e[t].each(function(e){return n=e,(t=r).listType=n.listType,void(t.listAttributes=Lt({},n.listAttributes));var t,n});var n=e.slice(0,t);return n.push(W.some(r)),n},Tt=function(e){Z(e,function(e,t){return t.depth>e.length?function(e,t){for(var n=e.slice(0),r=t.depth-e.length,o=1;o<r;o++)n.push(W.none());return n.push(W.some(t)),n}(e,t):bt(e,t)},[])},Dt=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Dt(n())}}};(a=l||(l={})).OL="OL",a.UL="UL",a.DL="DL";var Et=function(e){switch(Qe(e)){case"ol":return W.some(l.OL);case"ul":return W.some(l.UL);case"dl":return W.some(l.DL);default:return W.none()}},wt=function(e){return Ve(e,"OL,UL,DL")},kt=function(e){return tt(e).map(wt).getOr(!1)},At=function(e){var t=Ze(e),n=t.length+(nt(e).map(wt).getOr(!1)?-1:0);return Y(t.slice(0,n),st)},xt=function(u,e,s,a){var c=function t(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}(Rt,u,e,s),f=function(r){return e.each(function(e){var t,n;t="Start"===r?e.start:e.end,n=a,t.dom()===n.dom()&&s.set("Start"===r)})};return tt(a).filter(wt).fold(function(){f("Start");var e,t,n,r,o=(e=a,t=u,n=s.get(),r=Je(e),{depth:t,isSelected:n,content:At(e),listType:r.bind(Et).getOr(l.OL),listAttributes:r.map(Ge).getOr({}),itemAttributes:Ge(e)});f("End");var i=nt(a).filter(wt).map(c).getOr([]);return[o].concat(i)},c)},Rt=function(e,t,n,r){var o=e+1;return ne(Ze(r),function(e){return wt(e)?Rt(o,t,n,e):xt(o,t,n,e)})},It=function(e,t,n){return e.fire("ListMutation",{action:t,element:n})},Bt=function(i,e){return Y(e,function(e){var t,n,r,o=(t=e.content,r=(n||document).createDocumentFragment(),G(t,function(e){r.appendChild(e.dom())}),We.fromDom(r));return We.fromDom(lt(i,o.dom()))})},_t=function(e,t){return Tt(t),(n=e.contentDocument,r=t,o=Z(r,function(e,t){return t.depth>e.length?Nt(n,e,t):yt(n,e,t)},[]),oe(o).map(function(e){return e.list})).toArray();var n,r,o},Pt=function(e){var t,n,r=Y(ve.getSelectedListItems(e),We.fromDom);return gt([ee(r,P(kt)),ee((t=r,n=re.call(t,0),n.reverse(),n),P(kt))],function(e,t){return{start:e,end:t}})},Mt=function(s,e,a){var t,n,r,o=(t=e,n=Pt(s),r=Dt(!1),Y(t,function(e){return{entries:Rt(0,n,r,e),sourceList:e}}));G(o,function(e){var t,n;t=e.entries,n=a,G(J(t,Ot),function(e){return function(e,t){switch(e){case"Indent":t.depth++;break;case"Outdent":t.depth--;break;case"Flatten":t.depth=0}}(n,e)});var r,o,i,u=(r=s,o=e.entries,ne(function(e,t){if(0===e.length)return[];for(var n=t(e[0]),r=[],o=[],i=0,u=e.length;i<u;i++){var s=e[i],a=t(s);a!==n&&(r.push(o),o=[]),n=a,o.push(s)}return 0!==o.length&&r.push(o),r}(o,St),function(e){return oe(e).map(St).getOr(!1)?_t(r,e):Bt(r,e)}));G(u,function(e){It(s,"Indent"===a?"IndentList":"OutdentList",e.dom())}),i=e.sourceList,G(u,function(e){rt(i,e)}),ut(e.sourceList)})},Ut=function(e){Ve(e,"DT")&&at(e,"DD")},Ft=function(r,e,t){G(t,"Indent"===e?Ut:function(e){return t=r,void(Ve(n=e,"DD")?at(n,"DT"):Ve(n,"DT")&&Je(n).each(function(e){return mt(t,e.dom(),n.dom())}));var t,n})},jt=function(e,t){var n=Y(ve.getSelectedDlItems(e),We.fromDom),r=Y(ve.getSelectedListRoots(e),We.fromDom);if(n.length||r.length){var o=e.selection.getBookmark();Ft(e,t,n),Mt(e,r,t),e.selection.moveToBookmark(o),e.selection.setRng(x(e.selection.getRng())),e.nodeChanged()}},Ht=function(e){jt(e,"Indent")},$t=function(e){jt(e,"Outdent")},qt=function(e){jt(e,"Flatten")},Wt=function(e){return/\btox\-/.test(e.className)},zt=function(e){switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Kt=function(n,e){v.each(e,function(e,t){n.setAttribute(t,e)})},Vt=function(e,t,n){var r,o,i,u,s,a,c;r=e,o=t,u=(i=n)["list-style-type"]?i["list-style-type"]:null,r.setStyle(o,"list-style-type",u),s=e,Kt(a=t,(c=n)["list-attributes"]),v.each(s.select("li",a),function(e){Kt(e,c["list-item-attributes"])})},Xt=function(e,t,n,r){var o,i;for(o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&b(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(T(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},Qt=function(f,l,d){void 0===d&&(d={});var e,t=f.selection.getRng(!0),m="LI",n=ve.getClosestListRootElm(f,f.selection.getStart(!0)),g=f.dom;"false"!==g.getContentEditable(f.selection.getNode())&&("DL"===(l=l.toUpperCase())&&(m="DT"),e=I(t),v.each(function(n,e,r){for(var o,i=[],u=n.dom,t=Xt(n,e,!0,r),s=Xt(n,e,!1,r),a=[],c=t;c&&(a.push(c),c!==s);c=c.nextSibling);return v.each(a,function(e){if(T(n,e))return i.push(e),void(o=null);if(u.isBlock(e)||b(e))return b(e)&&u.remove(e),void(o=null);var t=e.nextSibling;p.isBookmarkNode(e)&&(T(n,t)||!t&&e.parentNode===r)?o=null:(o||(o=u.create("p"),e.parentNode.insertBefore(o,e),i.push(o)),o.appendChild(e))}),i}(f,t,n),function(e){var t,n,r,o,i,u,s,a,c;(n=e.previousSibling)&&N(n)&&n.nodeName===l&&(r=n,o=d,i=g.getStyle(r,"list-style-type"),u=o?o["list-style-type"]:"",i===(u=null===u?"":u))?(t=n,e=g.rename(e,m),n.appendChild(e)):(t=g.create(l),e.parentNode.insertBefore(t,e),t.appendChild(e),e=g.rename(e,m)),s=g,a=e,c=["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],v.each(c,function(e){var t;return s.setStyle(a,((t={})[e]="",t))}),Vt(g,t,d),Gt(f.dom,t)}),f.selection.setRng(B(e)))},Yt=function(e,t,n){return a=n,(s=t)&&a&&N(s)&&s.nodeName===a.nodeName&&(i=t,u=n,(o=e).getStyle(i,"list-style-type",!0)===o.getStyle(u,"list-style-type",!0))&&(r=n,t.className===r.className);var r,o,i,u,s,a},Gt=function(e,t){var n,r;if(n=t.nextSibling,Yt(e,t,n)){for(;r=n.firstChild;)t.appendChild(r);e.remove(n)}if(n=t.previousSibling,Yt(e,t,n)){for(;r=n.lastChild;)t.insertBefore(r,t.firstChild);e.remove(n)}},Jt=function(t,e,n,r,o){if(e.nodeName!==r||Zt(o)){var i=I(t.selection.getRng(!0));v.each([e].concat(n),function(e){!function(e,t,n,r){if(t.nodeName!==n){var o=e.dom.rename(t,n);Vt(e.dom,o,r),It(e,zt(n),o)}else Vt(e.dom,t,r),It(e,zt(n),t)}(t,e,r,o)}),t.selection.setRng(B(i))}else qt(t)},Zt=function(e){return"list-style-type"in e},en={toggleList:function(e,t,n){var r=ve.getParentList(e),o=ve.getSelectedSubLists(e);n=n||{},r&&0<o.length?Jt(e,r,o,t,n):function(e,t,n,r){if(t!==e.getBody())if(t)if(t.nodeName!==n||Zt(r)||Wt(t)){var o=I(e.selection.getRng(!0));Vt(e.dom,t,r);var i=e.dom.rename(t,n);Gt(e.dom,i),e.selection.setRng(B(o)),It(e,zt(n),i)}else qt(e);else Qt(e,n,r),It(e,zt(n),t)}(e,r,t,n)},mergeWithAdjacentLists:Gt},tn=g.DOM,nn=function(e,t){var n,r=t.parentNode;"LI"===r.nodeName&&r.firstChild===t&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(t),w(e,r)&&tn.remove(r)):tn.setStyle(r,"listStyleType","none")),N(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(t)},rn=function(t,e){v.each(v.grep(t.select("ol,ul",e)),function(e){nn(t,e)})},on=function(e,t,n,r){var o,i,u=t.startContainer,s=t.startOffset;if(3===u.nodeType&&(n?s<u.data.length:0<s))return u;for(o=e.schema.getNonEmptyElements(),1===u.nodeType&&(u=f.getNode(u,s)),i=new d(u,r),n&&E(e.dom,u)&&i.next();u=i[n?"next":"prev2"]();){if("LI"===u.nodeName&&!u.hasChildNodes())return u;if(o[u.nodeName])return u;if(3===u.nodeType&&0<u.data.length)return u}},un=function(e,t){var n=t.childNodes;return 1===n.length&&!N(n[0])&&e.isBlock(n[0])},sn=function(e,t,n){var r,o,i,u;if(o=un(e,n)?n.firstChild:n,un(i=e,u=t)&&i.remove(u.firstChild,!0),!w(e,t,!0))for(;r=t.firstChild;)o.appendChild(r)},an=function(e,t,n){var r,o,i=t.parentNode;k(e,t)&&k(e,n)&&(N(n.lastChild)&&(o=n.lastChild),i===n.lastChild&&b(i.previousSibling)&&e.remove(i.previousSibling),(r=n.lastChild)&&b(r)&&t.hasChildNodes()&&e.remove(r),w(e,n,!0)&&e.$(n).empty(),sn(e,t,n),o&&n.appendChild(o),e.remove(t),w(e,i)&&i!==e.getRoot()&&e.remove(i))},cn=function(e,t,n,r){var o,i,u,s=e.dom;if(s.isEmpty(r))i=n,u=r,(o=e).dom.$(u).empty(),an(o.dom,i,u),o.selection.setCursorLocation(u);else{var a=I(t);an(s,n,r),e.selection.setRng(B(a))}},fn=function(e,t){var n,r,o,i=e.dom,u=e.selection,s=u.getStart(),a=ve.getClosestListRootElm(e,s),c=i.getParent(u.getStart(),"LI",a);if(c){if((n=c.parentNode)===e.getBody()&&w(i,n))return!0;if(r=x(u.getRng(!0)),(o=i.getParent(on(e,r,t,a),"LI",a))&&o!==c)return t?cn(e,r,o,c):function(e,t,n,r){var o=I(t);an(e.dom,n,r);var i=B(o);e.selection.setRng(i)}(e,r,c,o),!0;if(!o&&!t)return qt(e),!0}return!1},ln=function(e,t){return fn(e,t)||function(o,i){var u=o.dom,e=o.selection.getStart(),s=ve.getClosestListRootElm(o,e),a=u.getParent(e,u.isBlock,s);if(a&&u.isEmpty(a)){var t=x(o.selection.getRng(!0)),c=u.getParent(on(o,t,i,s),"LI",s);if(c)return o.undoManager.transact(function(){var e,t,n,r;t=a,n=s,r=(e=u).getParent(t.parentNode,e.isBlock,n),e.remove(t),r&&e.isEmpty(r)&&e.remove(r),en.mergeWithAdjacentLists(u,c.parentNode),o.selection.select(c,!0),o.selection.collapse(i)}),!0}return!1}(e,t)},dn=function(e,t){return e.selection.isCollapsed()?ln(e,t):(r=(n=e).selection.getStart(),o=ve.getClosestListRootElm(n,r),!!(n.dom.getParent(r,"LI,DT,DD",o)||0<ve.getSelectedListItems(n).length)&&(n.undoManager.transact(function(){n.execCommand("Delete"),rn(n.dom,n.getBody())}),!0));var n,r,o},mn=function(t){t.on("keydown",function(e){e.keyCode===m.BACKSPACE?dn(t,!1)&&e.preventDefault():e.keyCode===m.DELETE&&dn(t,!0)&&e.preventDefault()})},gn=dn,pn=function(t){return{backspaceDelete:function(e){gn(t,e)}}},vn=function(t,n){return function(){var e=t.dom.getParent(t.selection.getStart(),"UL,OL,DL");return e&&e.nodeName===n}},hn=function(n){n.on("BeforeExecCommand",function(e){var t=e.command.toLowerCase();"indent"===t?Ht(n):"outdent"===t&&$t(n)}),n.addCommand("InsertUnorderedList",function(e,t){en.toggleList(n,"UL",t)}),n.addCommand("InsertOrderedList",function(e,t){en.toggleList(n,"OL",t)}),n.addCommand("InsertDefinitionList",function(e,t){en.toggleList(n,"DL",t)}),n.addCommand("RemoveList",function(){qt(n)}),n.addQueryStateHandler("InsertUnorderedList",vn(n,"UL")),n.addQueryStateHandler("InsertOrderedList",vn(n,"OL")),n.addQueryStateHandler("InsertDefinitionList",vn(n,"DL"))},yn=function(e){return e.getParam("lists_indent_on_tab",!0)},Nn=function(e){var t;yn(e)&&(t=e).on("keydown",function(e){e.keyCode!==m.TAB||m.metaKeyPressed(e)||ve.isList(t)&&(e.preventDefault(),t.undoManager.transact(function(){e.shiftKey?$t(t):Ht(t)}))}),mn(e)},Sn=function(t,i){return function(o){var e=function(e){var t=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}(e.parents,L),n=-1!==t?e.parents.slice(0,t):e.parents,r=v.grep(n,N);o.setActive(0<r.length&&r[0].nodeName===i&&!Wt(r[0]))};return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}}},On=function(t){var e,n,r,o=function(e){return function(){return t.execCommand(e)}};n="advlist",r=(e=t).settings.plugins?e.settings.plugins:"",-1===v.inArray(r.split(/[ ,]/),n)&&(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:o("InsertOrderedList"),onSetup:Sn(t,"OL")}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:o("InsertUnorderedList"),onSetup:Sn(t,"UL")}))};c.add("lists",function(e){return Nn(e),On(e),hn(e),pn(e)}),function Cn(){}}();!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("textcolor",function(){console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")}),function o(){}}();!function(){"use strict";var e,n,t,r,o,u=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),i="[-'\\.\u2018\u2019\u2024\ufe52\uff07\uff0e]",c="[:\xb7\xb7\u05f4\u2027\ufe13\ufe55\uff1a]",E="[\xb1+*/,;;\u0589\u060c\u060d\u066c\u07f8\u2044\ufe10\ufe14\ufe50\ufe54\uff0c\uff1b]",s="[0-9\u0660-\u0669\u066b\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9]",f="\\r",T="\\n",l="[\x0B\f\x85\u2028\u2029]",d="[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f\u109a-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b6-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u192b\u1930-\u193b\u19b0-\u19c0\u19c8\u19c9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f\u1b00-\u1b04\u1b34-\u1b44\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1baa\u1be6-\u1bf3\u1c24-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe3-\uabea\uabec\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]",g="[\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200e\u200f\u202a-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb]",p="[\u3031-\u3035\u309b\u309c\u30a0-\u30fa\u30fc-\u30ff\u31f0-\u31ff\u32d0-\u32fe\u3300-\u3357\uff66-\uff9d]",A="[=_\u203f\u2040\u2054\ufe33\ufe34\ufe4d-\ufe4f\uff3f\u2200-\u22ff<>]",N="[!-#%-*,-\\/:;?@\\[-\\]_{}\xa1\xab\xb7\xbb\xbf;\xb7\u055a-\u055f\u0589\u058a\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1361-\u1368\u1400\u166d\u166e\u169b\u169c\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d\u207e\u208d\u208e\u3008\u3009\u2768-\u2775\u27c5\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc\u29fd\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e2e\u2e30\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030\u303d\u30a0\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb\ufd3e\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a\uff1b\uff1f\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]",R={ALETTER:0,MIDNUMLET:1,MIDLETTER:2,MIDNUM:3,NUMERIC:4,CR:5,LF:6,NEWLINE:7,EXTEND:8,FORMAT:9,KATAKANA:10,EXTENDNUMLET:11,AT:12,OTHER:13},M=[new RegExp("[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24b6-\u24e9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]"),new RegExp(i),new RegExp(c),new RegExp(E),new RegExp(s),new RegExp(f),new RegExp(T),new RegExp(l),new RegExp(d),new RegExp(g),new RegExp(p),new RegExp(A),new RegExp("@")],h=new RegExp("^"+N+"$"),w=function(e){return function(){return e}},L=w(!1),y=w(!0),m=function(){return v},v=(r={fold:function(e,n){return e()},is:L,isSome:L,isNone:y,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:t,orThunk:n,map:m,ap:m,each:function(){},bind:m,flatten:m,exists:L,forall:y,filter:m,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:w("none()")},Object.freeze&&Object.freeze(r),r),C=(o="function",function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&Array.prototype.isPrototypeOf(e)?"array":"object"===n&&String.prototype.isPrototypeOf(e)?"string":n}(e)===o}),I=(Array.prototype.slice,C(Array.from)&&Array.from,M),D=R.OTHER,U=function(e){var n,t,r=D,o=I.length;for(n=0;n<o;++n)if((t=I[n])&&t.test(e)){r=n;break}return r},x=function(e){var t,r,n=(t=U,r={},function(e){if(r[e])return r[e];var n=t(e);return r[e]=n});return function(e,n){for(var t=e.length,r=new Array(t),o=0;o<t;o++){var u=e[o];r[o]=n(u,o,e)}return r}(e.split(""),n)},O=R,S=/^\s+$/,b=h,K=function(e,n,t){var r=function(e,n){var t;for(t=n;t<e.length;++t){var r=e.charAt(t);if(S.test(r))break}return t}(n,t+1),o=n.substring(t+1,r);return"://"===o.substr(0,3)?{word:e+o,index:r}:{word:e,index:t}},W=function(e,n){return function(e,n){void 0===n&&(n={});var t,r,o,u,i,c,a,E,s,f,T=0,l=x(e),d=l.length,g=[],p=[];for(n.ignoreCase&&(e=e.toLowerCase()),r=n.includePunctuation,o=n.includeWhitespace;T<d;++T)if(t=e.charAt(T),g.push(t),E=a=void 0,s=(i=l)[c=T],f=i[c+1],!(c<0||c>i.length-1&&0!==c||s===O.ALETTER&&f===O.ALETTER||(E=i[c+2],s===O.ALETTER&&(f===O.MIDLETTER||f===O.MIDNUMLET||f===O.AT)&&E===O.ALETTER||(a=i[c-1],(s===O.MIDLETTER||s===O.MIDNUMLET||f===O.AT)&&f===O.ALETTER&&a===O.ALETTER||!(s!==O.NUMERIC&&s!==O.ALETTER||f!==O.NUMERIC&&f!==O.ALETTER)||(s===O.MIDNUM||s===O.MIDNUMLET)&&f===O.NUMERIC&&a===O.NUMERIC||s===O.NUMERIC&&(f===O.MIDNUM||f===O.MIDNUMLET)&&E===O.NUMERIC||s===O.EXTEND||s===O.FORMAT||a===O.EXTEND||a===O.FORMAT||f===O.EXTEND||f===O.FORMAT||s===O.CR&&f===O.LF||s!==O.NEWLINE&&s!==O.CR&&s!==O.LF&&f!==O.NEWLINE&&f!==O.CR&&f!==O.LF&&(s===O.KATAKANA&&f===O.KATAKANA||f===O.EXTENDNUMLET&&(s===O.ALETTER||s===O.NUMERIC||s===O.KATAKANA||s===O.EXTENDNUMLET)||s===O.EXTENDNUMLET&&(f===O.ALETTER||f===O.NUMERIC||f===O.KATAKANA)||s===O.AT))))){if((g=g.join(""))&&(o||!S.test(g))&&(r||!b.test(g)))if("http"===(u=g)||"https"===u){var A=K(g,e,T);p.push(A.word),T=A.index}else p.push(g);g=[]}return p}(e.replace(/\ufeff/g,""),n)},F=function(e,n){for(var t,r=n.getBlockElements(),o=n.getShortEndedElements(),u=n.getWhiteSpaceElements(),i="",c=new a(e,e);e=c.next();)3===e.nodeType?i+=e.data:0!==i.length&&(r[(t=e).nodeName]||o[t.nodeName]||u[t.nodeName])&&(i+=" ");return i},X=function(e){return{words:W(e).length,characters:e.length,charactersNoSpace:e.replace(/\s/g,"").length}},k=function(e){return X((n=e).removed?"":F(n.getBody(),n.schema));var n},j=tinymce.util.Tools.resolve("tinymce.util.Delay"),P=function(e){var n,t=k(e);n=t,e.fire("wordCountUpdate",{wordCount:n})},z=function(e){var n,t,r=k(e),o=(t=F((n=e).selection.getRng().cloneContents(),n.schema),n.selection.isCollapsed()?X(""):X(t));e.windowManager.open({title:"Wordcount",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(r.words),String(o.words)],["Characters (no spaces)",String(r.charactersNoSpace),String(o.charactersNoSpace)],["Characters",String(r.characters),String(o.characters)]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})};u.add("wordcount",function(e){var n,t,r,o;return(n=e).ui.registry.addButton("wordcount",{tooltip:"Wordcount",icon:"character-count",onAction:function(){return z(n)}}),n.ui.registry.addMenuItem("wordcount",{text:"Wordcount",icon:"character-count",onAction:function(){return z(n)}}),t=e,r=j.debounce(function(){return P(t)},300),t.on("init",function(){P(t),j.setEditorTimeout(t,function(){t.on("setcontent beforeaddundo undo redo keyup",r)},0)}),o=e,{getCount:function(){return k(o).words}}}),function B(){}}();!function(){"use strict";var r=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return r(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools");function n(t,e){return i(document.createElement("canvas"),t,e)}function o(t){return t.getContext("2d")}function i(t,e,n){return t.width=e,t.height=n,t}var e,u,c,s,l={create:n,clone:function Re(t){var e;return o(e=n(t.width,t.height)).drawImage(t,0,0),e},resize:i,get2dContext:o,get3dContext:function De(t){var e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(n){}return e||(e=null),e}},d={getWidth:function je(t){return t.naturalWidth||t.width},getHeight:function Ue(t){return t.naturalHeight||t.height}},h=window.Promise?window.Promise:function(){var t=function(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=null,this._value=null,this._deferreds=[],s(t,r(o,this),r(u,this))},e=t.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){t.apply(e,arguments)}}var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(r){var o=this;null!==this._state?e(function(){var t=o._state?r.onFulfilled:r.onRejected;if(null!==t){var e;try{e=t(o._value)}catch(n){return void r.reject(n)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void s(r(e,t),r(o,this),r(u,this))}this._state=!0,this._value=t,a.call(this)}catch(n){u.call(this,n)}}function u(t){this._state=!1,this._value=t,a.call(this)}function a(){for(var t=0,e=this._deferreds.length;t<e;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function s(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(o){if(r)return;r=!0,n(o)}}return t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype.then=function(n,r){var o=this;return new t(function(t,e){i.call(o,new c(n,r,t,e))})},t.all=function(){var c=Array.prototype.slice.call(1===arguments.length&&n(arguments[0])?arguments[0]:arguments);return new t(function(o,i){if(0===c.length)return o([]);var u=c.length;function a(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){a(e,t)},i)}c[e]=t,0==--u&&o(c)}catch(r){i(r)}}for(var t=0;t<c.length;t++)a(t,c[t])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(t){t(e)})},t.reject=function(n){return new t(function(t,e){e(n)})},t.race=function(o){return new t(function(t,e){for(var n=0,r=o.length;n<r;n++)o[n].then(t,e)})},t}(),v=function(t){return function(){return t}},f=v(!1),m=v(!0),g=f,p=m,y=function(){return w},w=(s={fold:function(t,e){return t()},is:g,isSome:g,isNone:p,getOr:c=function(t){return t},getOrThunk:u=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:c,orThunk:u,map:y,ap:y,each:function(){},bind:y,flatten:y,exists:g,forall:p,filter:y,equals:e=function(t){return t.isNone()},equals_:e,toArray:function(){return[]},toString:v("none()")},Object.freeze&&Object.freeze(s),s),b=function(n){var t=function(){return n},e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:p,isNone:g,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return b(t(n))},ap:function(t){return t.fold(y,function(t){return b(t(n))})},each:function(t){t(n)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(n)?o:w},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(g,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},T={some:b,none:y,from:function(t){return null===t||t===undefined?w:b(t)}},O="undefined"!=typeof window?window:Function("return this;")(),I=function(t,e){return function(t,e){for(var n=e!==undefined&&null!==e?e:O,r=0;r<t.length&&n!==undefined&&null!==n;++r)n=n[t[r]];return n}(t.split("."),e)},x={getOrDie:function(t,e){var n=I(t,e);if(n===undefined||null===n)throw t+" not available on this browser";return n}};function C(){return new(x.getOrDie("FileReader"))}var E={atob:function(t){return x.getOrDie("atob")(t)},requestAnimationFrame:function(t){x.getOrDie("requestAnimationFrame")(t)}};function S(a){return new h(function(t,e){var n=URL.createObjectURL(a),r=new Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",u)};function i(){o(),t(r)}function u(){o(),e("Unable to load data of type "+a.type+": "+n)}r.addEventListener("load",i),r.addEventListener("error",u),r.src=n,r.complete&&i()})}function N(r){return new h(function(t,n){var e=new XMLHttpRequest;e.open("GET",r,!0),e.responseType="blob",e.onload=function(){200==this.status&&t(this.response)},e.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"))},e.send()})}function A(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return T.none();for(var r,o=n[1],i=e[1],u=E.atob(i),a=u.length,c=Math.ceil(a/1024),s=new Array(c),f=0;f<c;++f){for(var l=1024*f,d=Math.min(l+1024,a),h=new Array(d-l),m=l,g=0;m<d;++g,++m)h[g]=u[m].charCodeAt(0);s[f]=(r=h,new(x.getOrDie("Uint8Array"))(r))}return T.some(function v(t,e){return new(x.getOrDie("Blob"))(t,e)}(s,{type:o}))}function _(n){return new h(function(t,e){A(n).fold(function(){e("uri is not base64: "+n)},t)})}function R(n){return new h(function(t){var e=C();e.onloadend=function(){t(e.result)},e.readAsDataURL(n)})}var D={blobToImage:S,imageToBlob:function Be(t){var e=t.src;return 0===e.indexOf("data:")?_(e):N(e)},blobToArrayBuffer:function Me(n){return new h(function(t){var e=C();e.onloadend=function(){t(e.result)},e.readAsArrayBuffer(n)})},blobToDataUri:R,blobToBase64:function Le(t){return R(t).then(function(t){return t.split(",")[1]})},dataUriToBlobSync:A,canvasToBlob:function ke(t,n,r){return n=n||"image/png",HTMLCanvasElement.prototype.toBlob?new h(function(e){t.toBlob(function(t){e(t)},n,r)}):_(t.toDataURL(n,r))},canvasToDataURL:function Pe(t,e,n){return e=e||"image/png",t.then(function(t){return t.toDataURL(e,n)})},blobToCanvas:function Fe(t){return S(t).then(function(t){var e;return function n(t){URL.revokeObjectURL(t.src)}(t),e=l.create(d.getWidth(t),d.getHeight(t)),l.get2dContext(e).drawImage(t,0,0),e})},uriToBlob:function He(t){return 0===t.indexOf("blob:")?N(t):0===t.indexOf("data:")?_(t):null}},j=function(t){return D.blobToImage(t)},U=function(t){return D.imageToBlob(t)};function B(t,e,n){var r=e.type;function o(e,n){return t.then(function(t){return D.canvasToDataURL(t,e,n)})}return{getType:v(r),toBlob:function i(){return h.resolve(e)},toDataURL:function u(){return n},toBase64:function a(){return n.split(",")[1]},toAdjustedBlob:function c(e,n){return t.then(function(t){return D.canvasToBlob(t,e,n)})},toAdjustedDataURL:o,toAdjustedBase64:function s(t,e){return o(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function f(){return t.then(l.clone)}}}function M(e){return D.blobToDataUri(e).then(function(t){return B(D.blobToCanvas(e),e,t)})}var L={fromBlob:M,fromCanvas:function ze(e,t){return D.canvasToBlob(e,t).then(function(t){return B(h.resolve(e),t,e.toDataURL())})},fromImage:function qe(t){return D.imageToBlob(t).then(function(t){return M(t)})},fromBlobAndUrlSync:function(t,e){return B(D.blobToCanvas(t),t,e)}};function k(t,e,n){return n<(t=parseFloat(t))?t=n:t<e&&(t=e),t}var P=[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];function F(t,e){var n,r,o,i,u=[],a=new Array(10);for(n=0;n<5;n++){for(r=0;r<5;r++)u[r]=e[r+5*n];for(r=0;r<5;r++){for(o=i=0;o<5;o++)i+=t[r+5*o]*u[o];a[r+5*n]=i}}return a}function H(t,n){return n=k(n,0,1),t.map(function(t,e){return e%6==0?t=1-(1-t)*n:t*=n,k(t,0,1)})}var z={identity:function Ge(){return[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]},adjust:H,multiply:F,adjustContrast:function We(t,e){var n;return e=k(e,-1,1),F(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0==(n=e%1)?P[e]:P[Math.floor(e)]*(1-n)+P[Math.floor(e)+1]*n)+127)/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])},adjustBrightness:function $e(t,e){return F(t,[1,0,0,0,e=k(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])},adjustSaturation:function Xe(t,e){var n;return F(t,[.3086*(1-(n=1+(0<(e=k(e,-1,1))?3*e:e)))+n,.6094*(1-n),.082*(1-n),0,0,.3086*(1-n),.6094*(1-n)+n,.082*(1-n),0,0,.3086*(1-n),.6094*(1-n),.082*(1-n)+n,0,0,0,0,0,1,0,0,0,0,0,1])},adjustHue:function Ve(t,e){var n,r,o,i,u;return e=k(e,-180,180)/180*Math.PI,F(t,[(o=.213)+.787*(n=Math.cos(e))+(r=Math.sin(e))*-o,(i=.715)+n*-i+r*-i,(u=.072)+n*-u+.928*r,0,0,o+n*-o+.143*r,i+n*(1-i)+.14*r,u+n*-u+-.283*r,0,0,o+n*-o+-.787*r,i+n*-i+r*i,u+.928*n+r*u,0,0,0,0,0,1,0,0,0,0,0,1])},adjustColors:function Ye(t,e,n,r){return F(t,[e=k(e,0,2),0,0,0,0,0,n=k(n,0,2),0,0,0,0,0,r=k(r,0,2),0,0,0,0,0,1,0,0,0,0,0,1])},adjustSepia:function Je(t,e){return F(t,H([.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0,0,0,0,0,1],e=k(e,0,1)))},adjustGrayscale:function Ke(t,e){return F(t,H([.33,.34,.33,0,0,.33,.34,.33,0,0,.33,.34,.33,0,0,0,0,0,1,0,0,0,0,0,1],e=k(e,0,1)))}};function q(e,n){return e.toCanvas().then(function(t){return function i(t,e,n){var r,o=l.get2dContext(t);return r=function N(t,e){var n,r,o,i,u,a=t.data,c=e[0],s=e[1],f=e[2],l=e[3],d=e[4],h=e[5],m=e[6],g=e[7],v=e[8],p=e[9],y=e[10],w=e[11],b=e[12],T=e[13],O=e[14],I=e[15],x=e[16],C=e[17],E=e[18],S=e[19];for(u=0;u<a.length;u+=4)n=a[u],r=a[u+1],o=a[u+2],i=a[u+3],a[u]=n*c+r*s+o*f+i*l+d,a[u+1]=n*h+r*m+o*g+i*v+p,a[u+2]=n*y+r*w+o*b+i*T+O,a[u+3]=n*I+r*x+o*C+i*E+S;return t}(o.getImageData(0,0,t.width,t.height),n),o.putImageData(r,0,0),L.fromCanvas(t,e)}(t,e.getType(),n)})}function G(e,n){return e.toCanvas().then(function(t){return function u(t,e,n){var r,o,i=l.get2dContext(t);return r=i.getImageData(0,0,t.width,t.height),o=i.getImageData(0,0,t.width,t.height),o=function T(t,e,n){var r,o,i,u,a,c,s,f,l,d,h,m,g,v,p,y,w;function b(t,e,n){return n<t?t=n:t<e&&(t=e),t}for(i=Math.round(Math.sqrt(n.length)),u=Math.floor(i/2),r=t.data,o=e.data,y=t.width,w=t.height,c=0;c<w;c++)for(a=0;a<y;a++){for(s=f=l=0,h=0;h<i;h++)for(d=0;d<i;d++)m=b(a+d-u,0,y-1),g=b(c+h-u,0,w-1),v=4*(g*y+m),p=n[h*i+d],s+=r[v]*p,f+=r[v+1]*p,l+=r[v+2]*p;o[v=4*(c*y+a)]=b(s,0,255),o[v+1]=b(f,0,255),o[v+2]=b(l,0,255)}return e}(r,o,n),i.putImageData(o,0,0),L.fromCanvas(t,e)}(t,e.getType(),n)})}function W(c){return function(e,n){return e.toCanvas().then(function(t){return function(t,e,n){var r,o,i=l.get2dContext(t),u=new Array(256);for(o=0;o<u.length;o++)u[o]=c(o,n);return r=function a(t,e){var n,r=t.data;for(n=0;n<r.length;n+=4)r[n]=e[r[n]],r[n+1]=e[r[n+1]],r[n+2]=e[r[n+2]];return t}(i.getImageData(0,0,t.width,t.height),u),i.putImageData(r,0,0),L.fromCanvas(t,e)}(t,e.getType(),n)})}}function $(n){return function(t,e){return q(t,n(z.identity(),e))}}function X(e){return function(t){return G(t,e)}}(function Qe(e){return function(t){return q(t,e)}})([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0]),$(z.adjustBrightness),$(z.adjustHue),$(z.adjustSaturation),$(z.adjustContrast),$(z.adjustGrayscale),$(z.adjustSepia),X([0,-1,0,-1,5,-1,0,-1,0]),X([-2,-1,0,-1,1,1,0,1,2]),W(function(t,e){return 255*Math.pow(t/255,1-e)}),W(function(t,e){return 255*(1-Math.exp(-t/255*e))});var V,Y={scale:function Ze(t,e,n){var r=d.getWidth(t),o=d.getHeight(t),i=e/r,u=n/o,a=!1;(i<.5||2<i)&&(i=i<.5?.5:2,a=!0),(u<.5||2<u)&&(u=u<.5?.5:2,a=!0);var c=function f(a,c,s){return new h(function(t){var e=d.getWidth(a),n=d.getHeight(a),r=Math.floor(e*c),o=Math.floor(n*s),i=l.create(r,o),u=l.get2dContext(i);u.drawImage(a,0,0,e,n,0,0,r,o),t(i)})}(t,i,u);return a?c.then(function(t){return Ze(t,e,n)}):c}},J={rotate:function tn(e,n){return e.toCanvas().then(function(t){return function a(t,e,n){var r=l.create(t.width,t.height),o=l.get2dContext(r),i=0,u=0;return 90!=(n=n<0?360+n:n)&&270!=n||l.resize(r,r.height,r.width),90!=n&&180!=n||(i=r.width),270!=n&&180!=n||(u=r.height),o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),L.fromCanvas(r,e)}(t,e.getType(),n)})},flip:function en(e,n){return e.toCanvas().then(function(t){return function i(t,e,n){var r=l.create(t.width,t.height),o=l.get2dContext(r);return"v"==n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),L.fromCanvas(r,e)}(t,e.getType(),n)})},crop:function nn(e,n,r,o,i){return e.toCanvas().then(function(t){return function a(t,e,n,r,o,i){var u=l.create(o,i);return l.get2dContext(u).drawImage(t,-n,-r),L.fromCanvas(u,e)}(t,e.getType(),n,r,o,i)})},resize:function rn(e,n,r){return e.toCanvas().then(function(t){return Y.scale(t,n,r).then(function(t){return L.fromCanvas(t,e.getType())})})}},K=(function(){function t(t){this.littleEndian=!1,this._dv=new DataView(t)}t.prototype.readByteAt=function(t){return this._dv.getUint8(t)},t.prototype.read=function(t,e){if(t+e>this.length())return null;for(var n=this.littleEndian?0:-8*(e-1),r=0,o=0;r<e;r++)o|=this.readByteAt(t+r)<<Math.abs(n+8*r);return o},t.prototype.BYTE=function(t){return this.read(t,1)},t.prototype.SHORT=function(t){return this.read(t,2)},t.prototype.LONG=function(t){return this.read(t,4)},t.prototype.SLONG=function(t){var e=this.read(t,4);return 2147483647<e?e-4294967296:e},t.prototype.CHAR=function(t){return String.fromCharCode(this.read(t,1))},t.prototype.STRING=function(t,e){return this.asArray("CHAR",t,e).join("")},t.prototype.SEGMENT=function(t,e){var n=this._dv.buffer;switch(arguments.length){case 2:return n.slice(t,t+e);case 1:return n.slice(t);default:return n}},t.prototype.asArray=function(t,e,n){for(var r=[],o=0;o<n;o++)r[o]=this[t](e+o);return r},t.prototype.length=function(){return this._dv?this._dv.byteLength:0}}(),function(t,e){return J.rotate(t,e)}),Q=function(t,e){return J.flip(t,e)},Z=K,tt=function(t){return L.fromBlob(t)},et=function(){return x.getOrDie("URL")},nt=function(t){return et().createObjectURL(t)},rt=function(t){et().revokeObjectURL(t)},ot=tinymce.util.Tools.resolve("tinymce.util.Delay"),it=tinymce.util.Tools.resolve("tinymce.util.Promise"),ut=tinymce.util.Tools.resolve("tinymce.util.URI"),at={getImageSize:function on(t){var e,n;function r(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)},setImageSize:function un(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",e.w),t.setAttribute("height",e.h)))},getNaturalImageSize:function an(t){return{w:t.naturalWidth,h:t.naturalHeight}}},ct=(V="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&Array.prototype.isPrototypeOf(t)?"array":"object"===e&&String.prototype.isPrototypeOf(t)?"string":e}(t)===V}),st=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n,t))return T.some(o)}return T.none()};Array.prototype.slice;ct(Array.from)&&Array.from;var ft,lt,dt,ht=function(t){return null!==t&&t!==undefined},mt=function(t,e){var n;return n=e.reduce(function(t,e){return ht(t)?t[e]:undefined},t),ht(n)?n:null},gt=function(e){return new it(function(n){var t=C();t.onload=function(t){var e=t.target;n(e.result)},t.readAsText(e)})},vt=function(r,o,i){return new it(function(t){var n;(n=function e(){return new(x.getOrDie("XMLHttpRequest"))}()).onreadystatechange=function(){4===n.readyState&&t({status:n.status,blob:this.response})},n.open("GET",r,!0),n.withCredentials=i,a.each(o,function(t,e){n.setRequestHeader(e,t)}),n.responseType="blob",n.send()})},pt=function(t){var e;try{e=JSON.parse(t)}catch(n){}return e},yt=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],wt=[{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."}],bt=function(e){return"ImageProxy HTTP error: "+st(yt,function(t){return e===t.code}).fold(v("Unknown ImageProxy error"),function(t){return t.message})},Tt=function(t){var e=bt(t);return it.reject(e)},Ot=function(e){return st(wt,function(t){return t.type===e}).fold(v("Unknown service error"),function(t){return t.message})},It=function(t,e){return gt(e).then(function(t){var e,n,r=(e=pt(t),"ImageProxy Service error: "+((n=mt(e,["error","type"]))?Ot(n):"Invalid JSON in service error message"));return it.reject(r)})},xt=function(t,e){return 400===(n=t)||403===n||500===n?It(0,e):Tt(t);var n},Ct=Tt,Et=function(t,e){var n,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return vt((n=t,r=e,o=-1===n.indexOf("?")?"?":"&",/[?&]apiKey=/.test(n)||!r?n:n+o+"apiKey="+encodeURIComponent(r)),i,!1).then(function(t){return t.status<200||300<=t.status?xt(t.status,t.blob):it.resolve(t.blob)})},St=function(t,e,n){return e?Et(t,e):function r(t,e){return vt(t,{},e).then(function(t){return t.status<200||300<=t.status?Ct(t.status):it.resolve(t.blob)})}(t,n)},Nt=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}return undefined}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return _t(r(1),r(2))},At=function(){return _t(0,0)},_t=function(t,e){return{major:t,minor:e}},Rt={nu:_t,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?At():Nt(t,n)},unknown:At},Dt="Firefox",jt=function(t,e){return function(){return e===t}},Ut=function(t){var e=t.current;return{current:e,version:t.version,isEdge:jt("Edge",e),isChrome:jt("Chrome",e),isIE:jt("IE",e),isOpera:jt("Opera",e),isFirefox:jt(Dt,e),isSafari:jt("Safari",e)}},Bt={unknown:function(){return Ut({current:undefined,version:Rt.unknown()})},nu:Ut,edge:v("Edge"),chrome:v("Chrome"),ie:v("IE"),opera:v("Opera"),firefox:v(Dt),safari:v("Safari")},Mt="Windows",Lt="Android",kt="Solaris",Pt="FreeBSD",Ft=function(t,e){return function(){return e===t}},Ht=function(t){var e=t.current;return{current:e,version:t.version,isWindows:Ft(Mt,e),isiOS:Ft("iOS",e),isAndroid:Ft(Lt,e),isOSX:Ft("OSX",e),isLinux:Ft("Linux",e),isSolaris:Ft(kt,e),isFreeBSD:Ft(Pt,e)}},zt={unknown:function(){return Ht({current:undefined,version:Rt.unknown()})},nu:Ht,windows:v(Mt),ios:v("iOS"),android:v(Lt),linux:v("Linux"),osx:v("OSX"),solaris:v(kt),freebsd:v(Pt)},qt=function(t,e){var n=String(e).toLowerCase();return st(t,function(t){return t.search(n)})},Gt=function(t,n){return qt(t,n).map(function(t){var e=Rt.detect(t.versionRegexes,n);return{current:t.name,version:e}})},Wt=function(t,n){return qt(t,n).map(function(t){var e=Rt.detect(t.versionRegexes,n);return{current:t.name,version:e}})},$t=function(t,e){return-1!==t.indexOf(e)},Xt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Vt=function(e){return function(t){return $t(t,e)}},Yt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return $t(t,"edge/")&&$t(t,"chrome")&&$t(t,"safari")&&$t(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Xt],search:function(t){return $t(t,"chrome")&&!$t(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return $t(t,"msie")||$t(t,"trident")}},{name:"Opera",versionRegexes:[Xt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Vt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Vt("firefox")},{name:"Safari",versionRegexes:[Xt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return($t(t,"safari")||$t(t,"mobile/"))&&$t(t,"applewebkit")}}],Jt=[{name:"Windows",search:Vt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return $t(t,"iphone")||$t(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Vt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Vt("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Vt("linux"),versionRegexes:[]},{name:"Solaris",search:Vt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Vt("freebsd"),versionRegexes:[]}],Kt={browsers:v(Yt),oses:v(Jt)},Qt=function(t){var e,n,r,o,i,u,a,c,s,f,l,d=Kt.browsers(),h=Kt.oses(),m=Gt(d,t).fold(Bt.unknown,Bt.nu),g=Wt(h,t).fold(zt.unknown,zt.nu);return{browser:m,os:g,deviceType:(n=m,r=t,o=(e=g).isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,u=e.isAndroid()&&3===e.version.major,a=e.isAndroid()&&4===e.version.major,c=o||u||a&&!0===/mobile/i.test(r),s=e.isiOS()||e.isAndroid(),f=s&&!c,l=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),{isiPad:v(o),isiPhone:v(i),isTablet:v(c),isPhone:v(f),isTouch:v(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:v(l)})}},Zt={detect:(ft=function(){var t=navigator.userAgent;return Qt(t)},dt=!1,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return dt||(dt=!0,lt=ft.apply(null,t)),lt})},te=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:v(t)}},ee={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return te(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return te(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return te(n)},fromDom:te,fromPoint:function(t,e,n){var r=t.dom();return T.from(r.elementFromPoint(e,n)).map(te)}},ne=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE,Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),re=(Node.TEXT_NODE,Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,ne),oe=(Zt.detect().browser.isIE(),0),ie=function(t){return Zt.detect().browser.isIE(),e=ee.fromDom(t),n="img",r=function(t){return function(t,e){var n=t.dom();if(n.nodeType!==re)return!1;if(n.matches!==undefined)return n.matches(e);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(e);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(e);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(t,n)},st(e.dom().childNodes,(o=r,i=ee.fromDom,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o(i.apply(null,t))})).map(ee.fromDom);var e,n,r,o,i},ue=function(t,e){return t.dom.is(e,"figure")},ae=function(t,e){t.notificationManager.open({text:e,type:"error"})},ce=function(t){var e=t.selection.getNode();return ue(t,e)?ie(e):T.some(ee.fromDom(e))},se=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new ut(n).host===t.documentBaseURI.host},fe=function(t,e){return-1!==a.inArray(t.getParam("imagetools_cors_hosts",[],"string[]"),new ut(e.src).host)},le=function(t,e){var n,r,o,i,u=e.src;return fe(t,e)?St(e.src,null,(r=t,o=e,-1!==a.inArray(r.getParam("imagetools_credentials_hosts",[],"string[]"),new ut(o.src).host))):se(t,e)?U(e):(u=t.getParam("imagetools_proxy"),u+=(-1===u.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),n=(i=t).getParam("api_key",i.getParam("imagetools_api_key","","string"),"string"),St(u,n,!1))},de=function(t,e){var n;return(n=t.editorUpload.blobCache.getByUri(e.src))?it.resolve(n.blob()):le(t,e)},he=function(t){clearTimeout(t.get())},me=function(a,c,s,f,l,d){return c.toBlob().then(function(t){var e,n,r,o,i,u;return r=a.editorUpload.blobCache,e=l.src,a.getParam("images_reuse_filename",!1,"boolean")&&(n=(o=r.getByUri(e))?(e=o.uri(),o.name()):(i=a,(u=e.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i))?i.dom.encode(u[1]):null)),o=r.create({id:"imagetools"+oe++,blob:t,base64:c.toBase64(),uri:e,name:n}),r.add(o),a.undoManager.transact(function(){a.$(l).on("load",function r(){var t,e,n;a.$(l).off("load",r),a.nodeChanged(),s?a.editorUpload.uploadImagesAuto():(he(f),t=a,e=f,n=ot.setEditorTimeout(t,function(){t.editorUpload.uploadImagesAuto()},t.getParam("images_upload_timeout",3e4,"number")),e.set(n))}),d&&a.$(l).attr({width:d.w,height:d.h}),a.$(l).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})},ge=function(n,r,t,o){return function(){return ce(n).fold(function(){ae(n,"Could not find selected image")},function(e){return n._scanForImages().then(function(){return de(n,e.dom())}).then(tt).then(t).then(function(t){return me(n,t,!1,r,e.dom(),o)},function(t){ae(n,t)})})}},ve=function(e,n,r){return function(){var t=ce(e).fold(function(){return null},function(t){var e=at.getImageSize(t.dom());return e?{w:e.h,h:e.w}:null});return ge(e,n,function(t){return Z(t,r)},t)()}},pe=function(t,e,n){return function(){return ge(t,e,function(t){return Q(t,n)})()}},ye=function(n,t){var e=function(t){return e=t,n.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")&&(se(n,t)||fe(n,t)||n.settings.imagetools_proxy);var e};return ue(n,t)?ie(t).map(function(t){return e(t.dom())?T.some(t.dom()):T.none()}):e(t)?T.some(t):T.none()},we=he,be=de,Te=ce,Oe=function(e,n,r,o,i){return new it(function(t){j(i).then(function(t){var e=at.getNaturalImageSize(t);return o.w===e.w&&o.h===e.h||at.getImageSize(r)&&at.setImageSize(r,e),rt(t.src),i}).then(tt).then(function(t){return me(e,t,!0,n,r)},function(){})})},Ie=v("save-state"),xe=v("disable"),Ce=v("enable"),Ee=function(i,u){return function(){var r=Te(i),o=r.map(function(t){return at.getNaturalImageSize(t.dom())});Te(i).each(function(e){ye(i,e.dom()).each(function(t){be(i,e.dom()).then(function(t){var e,n={blob:e=t,url:nt(e)};i.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:n}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(t){var n=t.getData().imagetools.blob;r.each(function(e){o.each(function(t){Oe(i,u,e.dom(),t,n)})}),t.close()},onCancel:function(){},onAction:function(t,e){switch(e.name){case Ie():e.value?t.enable("save"):t.disable("save");break;case xe():t.block("Updating image"),t.disable("save"),t.disable("cancel");break;case Ce():t.unblock(),t.enable("cancel")}}})})})})}},Se=function(n,t){a.each({mceImageRotateLeft:ve(n,t,-90),mceImageRotateRight:ve(n,t,90),mceImageFlipVertical:pe(n,t,"v"),mceImageFlipHorizontal:pe(n,t,"h"),mceEditImage:Ee(n,t)},function(t,e){n.addCommand(e,t)})},Ne=function(n,r,o){n.on("NodeChange",function(t){var e=o.get();e&&e.src!==t.element.src&&(we(r),n.editorUpload.uploadImagesAuto(),o.set(null)),ye(n,t.element).each(o.set)})},Ae=function(r){var e=function(t){return function(){return r.execCommand(t)}};r.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:e("mceImageRotateLeft")}),r.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:e("mceImageRotateRight")}),r.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:e("mceImageFlipVertical")}),r.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:e("mceImageFlipHorizontal")}),r.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:e("mceEditImage"),onSetup:function(n){var t=function(){Te(r).each(function(t){var e=ye(r,t.dom()).isNone();n.setDisabled(e)})};return r.on("NodeChange",t),function(){r.off("NodeChange",t)}}}),r.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image-options",onAction:e("mceImage")}),r.ui.registry.addContextMenu("imagetools",{update:function(t){return ye(r,t).fold(function(){return[]},function(t){return[{text:"Edit image",icon:"edit-image",onAction:e("mceEditImage")}]})}})},_e=function(e){var t;e.ui.registry.addContextToolbar("imagetools",{items:(t=e,t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph crop editimage imageoptions")),predicate:function(t){return ye(e,t).isSome()},position:"node",scope:"node"})};t.add("imagetools",function(t){var e=r(0),n=r(null);Se(t,e),Ae(t),_e(t),Ne(t,e,n)}),function cn(){}}();!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("colorpicker",function(){console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")}),function o(){}}();!function(){"use strict";var t,n,e,r,o,a=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return a(e())}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},f=function(t){return function(){return t}},s=function(t){return t},c=f(!1),l=f(!0),d=c,m=l,g=function(){return h},h=(r={fold:function(t,n){return t()},is:d,isSome:d,isNone:m,getOr:e=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:n,map:g,ap:g,each:function(){},bind:g,flatten:g,exists:d,forall:m,filter:g,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:f("none()")},Object.freeze&&Object.freeze(r),r),p=function(e){var t=function(){return e},n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:m,isNone:d,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return p(t(e))},ap:function(t){return t.fold(g,function(t){return p(t(e))})},each:function(t){t(e)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(e)?o:h},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(d,function(t){return n(e,t)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},T={some:p,none:g,from:function(t){return null===t||t===undefined?h:p(t)}},v=function(n){return function(t){return function(t){if(null===t)return"null";var n=typeof t;return"object"===n&&Array.prototype.isPrototypeOf(t)?"array":"object"===n&&String.prototype.isPrototypeOf(t)?"string":n}(t)===n}},y=v("string"),O=v("object"),N=v("array"),E=v("function"),b=(o=Array.prototype.indexOf)===undefined?function(t,n){return C(t,n)}:function(t,n){return o.call(t,n)},w=function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var a=t[o];r[o]=n(a,o,t)}return r},k=function(t,n){for(var e=0,r=t.length;e<r;e++)n(t[e],e,t)},D=function(t,n){for(var e=[],r=0,o=t.length;r<o;r++){var a=t[r];n(a,r,t)&&e.push(a)}return e},C=function(t,n){for(var e=0,r=t.length;e<r;++e)if(t[e]===n)return e;return-1},x=function(t,n){for(var e=0,r=t.length;e<r;++e)if(!0!==n(t[e],e,t))return!1;return!0},_=Array.prototype.slice,P=(E(Array.from)&&Array.from,Object.keys),R=Object.hasOwnProperty,I=function(t,n){return R.call(t,n)},A=(function(i){if(!N(i))throw new Error("cases must be an array");if(0===i.length)throw new Error("there must be at least one case");var u=[],e={};k(i,function(t,r){var n=P(t);if(1!==n.length)throw new Error("one and only one name per case");var o=n[0],a=t[o];if(e[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!N(a))throw new Error("case arguments must be an array");u.push(o),e[o]=function(){var t=arguments.length;if(t!==a.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+a.length+" ("+a+"), got "+t);for(var e=new Array(t),n=0;n<e.length;n++)e[n]=arguments[n];return{fold:function(){if(arguments.length!==i.length)throw new Error("Wrong number of arguments to fold. Expected "+i.length+", got "+arguments.length);return arguments[r].apply(null,e)},match:function(t){var n=P(t);if(u.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+n.join(","));if(!x(u,function(t){return-1<b(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+u.join(", "));return t[o].apply(null,e)},log:function(t){console.log(t,{constructors:u,constructor:o,params:e})}}}})}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){var n=[],e=[];return k(t,function(t){t.fold(function(t){n.push(t)},function(t){e.push(t)})}),{errors:n,values:e}}),S=function(e){return{is:function(t){return e===t},isValue:l,isError:c,getOr:f(e),getOrThunk:f(e),getOrDie:f(e),or:function(t){return S(e)},orThunk:function(t){return S(e)},fold:function(t,n){return n(e)},map:function(t){return S(t(e))},mapError:function(t){return S(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOption:function(){return T.some(e)}}},B=function(e){return{is:c,isValue:c,isError:l,getOr:s,getOrThunk:function(t){return t()},getOrDie:function(){return t=String(e),function(){throw new Error(t)}();var t},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return B(e)},mapError:function(t){return B(t(e))},each:u,bind:function(t){return B(e)},exists:c,forall:l,toOption:T.none}},M={value:S,error:B},j=function(t){return"inline-command"===t.type||"inline-format"===t.type},U=function(t){return"block-command"===t.type||"block-format"===t.type},L=function(t){return n=t,e=function(t,n){return t.start.length===n.start.length?0:t.start.length>n.start.length?-1:1},(r=_.call(n,0)).sort(e),r;var n,e,r},q=function(o){var a=function(t){return M.error({message:t,pattern:o})},t=function(t,n,e){if(o.format===undefined)return o.cmd!==undefined?y(o.cmd)?M.value(e(o.cmd,o.value)):a(t+" pattern has non-string `cmd` parameter"):a(t+" pattern is missing both `format` and `cmd` parameters");var r=void 0;if(N(o.format)){if(!x(o.format,y))return a(t+" pattern has non-string items in the `format` array");r=o.format}else{if(!y(o.format))return a(t+" pattern has non-string `format` parameter");r=[o.format]}return M.value(n(r))};if(!O(o))return a("Raw pattern is not an object");if(!y(o.start))return a("Raw pattern is missing `start` parameter");if(o.end===undefined)return o.replacement!==undefined?y(o.replacement)?0===o.start.length?a("Replacement pattern has empty `start` parameter"):M.value({type:"inline-command",start:"",end:o.start,cmd:"mceInsertContent",value:o.replacement}):a("Replacement pattern has non-string `replacement` parameter"):0===o.start.length?a("Block pattern has empty `start` parameter"):t("Block",function(t){return{type:"block-format",start:o.start,format:t[0]}},function(t,n){return{type:"block-command",start:o.start,cmd:t,value:n}});if(!y(o.end))return a("Inline pattern has non-string `end` parameter");if(0===o.start.length&&0===o.end.length)return a("Inline pattern has empty `start` and `end` parameters");var e=o.start,r=o.end;return 0===r.length&&(r=e,e=""),t("Inline",function(t){return{type:"inline-format",start:e,end:r,format:t}},function(t,n){return{type:"inline-command",start:e,end:r,cmd:t,value:n}})},F=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},V=function(t){return{inlinePatterns:D(t,j),blockPatterns:L(D(t,U))}},W=function(r){return{setPatterns:function(t){var n=A(w(t,q));if(0<n.errors.length){var e=n.errors[0];throw new Error(e.message+":\n"+JSON.stringify(e.pattern,null,2))}r.set(V(n.values))},getPatterns:function(){return w(r.get().inlinePatterns,F).concat(w(r.get().blockPatterns,F))}}},Y="undefined"!=typeof window?window:Function("return this;")(),z=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=Y.console;e&&(e.error?e.error.apply(e,t):e.log.apply(e,t))},G=[{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"}],J=function(t){var n,e,r=(n=t,e="textpattern_patterns",I(n,e)?T.some(n[e]):T.none()).getOr(G);if(!N(r))return z("The setting textpattern_patterns should be an array"),{inlinePatterns:[],blockPatterns:[]};var o=A(w(r,q));return k(o.errors,function(t){return z(t.message,t.pattern)}),V(o.values)},K=tinymce.util.Tools.resolve("tinymce.util.Delay"),X=tinymce.util.Tools.resolve("tinymce.util.VK"),H=function(t,n,e){return""===n||!(t.length<n.length)&&t.substr(e,e+n.length)===n},Q=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Z=tinymce.util.Tools.resolve("tinymce.util.Tools"),$=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE,Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),tt=Node.TEXT_NODE,nt=(Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,function(t){return t.nodeType===$}),et=function(t){return t.nodeType===tt},rt=function(t,n,e){if(e<0||e>n.data.length)return T.none();for(var r=[e],o=n;o!==t&&o.parentNode;){for(var a=o.parentNode,i=0;i<a.childNodes.length;i++)if(a.childNodes[i]===o){r.push(i);break}o=a}return o===t?T.some(r.reverse()):T.none()},ot=function(t,n,e,r,o){return rt(t,n,e).bind(function(n){return rt(t,r,o).map(function(t){return{start:n,end:t}})})},at=function(t,n){var e,r,o,a=n.slice(),i=a.pop();return(e=a,r=function(t,n){return t.bind(function(t){return T.from(t.childNodes[n])})},o=T.some(t),k(e,function(t){o=r(o,t)}),o).bind(function(t){return et(t)&&0<=i&&i<=t.data.length?T.some({node:t,offset:i}):T.none()})},it=function(t,n,e){if(et(t)&&0<n)return T.some({node:t,offset:n});var r;if(0<n)r=t.childNodes[n-1];else for(var o=t;o&&o!==e&&!r;o=o.parentNode)r=o.previousSibling;var a=new Q(r,e);for(o=a.current();o;o=a.prev())if(et(o)&&0<o.length)return T.some({node:o,offset:o.length});return T.none()},ut=function(a,i,t,n,u,f){return void 0===f&&(f=!1),0!==i.start.length||f?it(t,n,u).filter(function(t){return a.getParent(t.node,a.isBlock)===u}).bind(function(t){var n=t.node,e=t.offset,r=n.data.substring(0,e),o=r.lastIndexOf(i.start);return-1===o?-1!==r.indexOf(i.end)?T.none():ut(a,i,n,0,u,f&&0===r.length):-1!==r.indexOf(i.end,o+i.start.length)?T.none():f&&o+i.start.length===r.length?T.none():T.some({node:n,offset:o})}):T.some({node:t,offset:n})},ft=function(c,l,t,n,d){return it(t,n,d).bind(function(t){for(var u=t.node,f=t.offset,s=u.data.substring(0,f),n=function(n){var t,e,a=l[n];if(t=s,e=a.end,!H(t,e,t.length-e.length))return"continue";var r=f-a.end.length,o=0<a.start.length&&0<a.end.length,i=(o?T.some(!0):T.none()).bind(function(){var t=l.slice();return t.splice(n,1),ft(c,t,u,r,d)}).fold(function(){return ut(c,a,u,r,d,o).map(function(t){var n=t.node,e=t.offset,r=ot(c.getRoot(),n,e,u,f).getOrDie("Internal constraint violation");return[{pattern:a,range:r}]})},function(o){var n,e,t=(n=c.getRoot(),e=o[o.length-1].range,at(n,e.start).bind(function(t){var r=t.node,o=t.offset;return at(n,e.end).map(function(t){var n=t.node,e=t.offset;return{startNode:r,startOffset:o,endNode:n,endOffset:e}})})).getOrDie("Internal constraint violation");return ut(c,a,t.startNode,t.startOffset,d).map(function(t){var n=t.node,e=t.offset,r=ot(c.getRoot(),n,e,u,f).getOrDie("Internal constraint violation");return o.concat([{pattern:a,range:r}])})});return i.isSome()?{value:i}:void 0},e=0;e<l.length;e++){var r=n(e);if("object"==typeof r)return r.value}return T.none()})},st=function(t,n,e,r){if(!1===e.collapsed)return[];var o=t.getParent(e.startContainer,t.isBlock);return ft(t,n,e.startContainer,e.startOffset-(r?1:0),o).getOr([])},ct=0;function lt(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(t,n){for(var e=[],r=0;r<t.length;r++){var o=t[r];if(!o.isSome())return T.none();e.push(o.getOrDie())}return T.some(n.apply(null,e))}(t,t.pop())}var dt=function(e,r){for(var t,n,o=e.dom,a=function(t){return o.create("span",{"data-mce-type":"bookmark",id:t})},i=function(t){return lt(T.from(o.select("#"+t.start)[0]),T.from(o.select("#"+t.end)[0]),function(t,n){var e=o.createRng();return e.setStartAfter(t),function(t,n,e){for(var r=new Q(t,e);r.next();){var o=r.current();if(!et(o)||0!==o.data.length)return o===n}return!1}(t,n,o.getRoot())?e.collapse(!0):e.setEndBefore(n),e})},u=(t="mce_",n=(new Date).getTime(),t+"_"+Math.floor(1e9*Math.random())+ ++ct+String(n)),f=w(r,function(t,n){return{start:u+"_"+n+"_start",end:u+"_"+n+"_end"}}),s=e.selection.getBookmark(),c=r.length-1;0<=c;c--){var l=r[c],d=l.pattern,m=l.range,g=at(o.getRoot(),m.end).getOrDie("Failed to resolve range["+c+"].end"),h=g.node,p=g.offset,v=0===p?h:h.splitText(p);v.parentNode.insertBefore(a(f[c].end),v),0<d.start.length&&h.deleteData(p-d.end.length,d.end.length)}for(c=0;c<r.length;c++){var y=r[c],O=(d=y.pattern,m=y.range,at(o.getRoot(),m.start).getOrDie("Failed to resolve range.start")),N=O.node,E=O.offset,b=0===E?N:N.splitText(E);b.parentNode.insertBefore(a(f[c].start),b),0<d.start.length?b.deleteData(0,d.start.length):b.deleteData(0,d.end.length)}var k=function(t){var n=r[t].pattern;i(f[t]).each(function(t){e.selection.setRng(t),"inline-format"===n.type?n.format.forEach(function(t){e.formatter.apply(t)}):e.execCommand(n.cmd,!1,n.value)}),o.remove(f[t].start),o.remove(f[t].end)};for(c=0;c<r.length;c++)k(c);e.selection.moveToBookmark(s)},mt=function(t,n){var e=t.dom,r=t.selection.getRng(),o=e.getParent(r.startContainer,e.isBlock);if(o&&e.is(o,"p")&&nt(o)){for(var a,i,u,f,s=new Q(o,o);a=s.next();)if(et(a)){i=a;break}if(i&&(u=i.data,f=n.start,H(u,f,0)&&Z.trim(o.textContent).length!==n.start.length)){var c=t.selection.getBookmark();if("block-format"===n.type){var l=t.formatter.get(n.format);l&&l[0].block&&t.undoManager.transact(function(){i.deleteData(0,n.start.length),t.selection.select(o),t.formatter.apply(n.format)})}else"block-command"===n.type&&t.undoManager.transact(function(){i.deleteData(0,n.start.length),t.selection.select(o),t.execCommand(n.cmd,!1,n.value)});t.selection.moveToBookmark(c)}}},gt=function(t,n,e){for(var r=0;r<t.length;r++)if(e(t[r],n))return!0},ht=function(r,t){var o=st(r.dom,t.inlinePatterns,r.selection.getRng(),!1),a=function(t,n,e){var r=t.getParent(e.startContainer,t.isBlock);if(!t.is(r,"p")||!nt(r))return T.none();for(var o,a,i=new Q(r,r);o=i.next();)if(et(o)){a=o;break}if(!a)return T.none();var u=function(t,n){for(var e=0;e<t.length;e++){var r=t[e];if(0===n.indexOf(r.start)&&(!r.end||n.lastIndexOf(r.end)===n.length-r.end.length))return r}}(n,a.data);return u?Z.trim(r.textContent).length===u.start.length?T.none():T.some(u):T.none()}(r.dom,t.blockPatterns,r.selection.getRng());return!(!r.selection.isCollapsed()||!(0<o.length||a.isSome())||(r.undoManager.add(),r.undoManager.extra(function(){r.execCommand("mceInsertNewLine")},function(){r.insertContent("\ufeff"),dt(r,o),a.each(function(t){return mt(r,t)});var t=r.selection.getRng(),n=r.dom.getParent(t.startContainer,r.dom.isBlock),e=it(t.startContainer,t.startOffset,n);r.execCommand("mceInsertNewLine"),e.each(function(t){"\ufeff"===t.node.data.charAt(t.offset-1)&&(t.node.deleteData(t.offset-1,1),r.dom.isEmpty(t.node.parentNode)&&r.dom.remove(t.node.parentNode))})}),0))},pt=function(t,n){var e=st(t.dom,n.inlinePatterns,t.selection.getRng(),!0);0<e.length&&t.undoManager.transact(function(){dt(t,e)})},vt=function(t,n){return gt(t,n,function(t,n){return t.charCodeAt(0)===n.charCode})},yt=function(t,n){return gt(t,n,function(t,n){return t===n.keyCode&&!1===X.modifierPressed(n)})},Ot=function(n,e){var r=[",",".",";",":","!","?"],o=[32];n.on("keydown",function(t){13!==t.keyCode||X.modifierPressed(t)||ht(n,e.get())&&t.preventDefault()},!0),n.on("keyup",function(t){yt(o,t)&&pt(n,e.get())}),n.on("keypress",function(t){vt(r,t)&&K.setEditorTimeout(n,function(){pt(n,e.get())})})};i.add("textpattern",function(t){var n=a(J(t.settings));return Ot(t,n),W(n)}),function Nt(){}}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return function(){return e}};function p(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var n,r,o,a,i,u,l=t(!1),c=t(!0),s=l,m=c,f=function(){return d},d=(a={fold:function(e,t){return e()},is:s,isSome:s,isNone:m,getOr:o=function(e){return e},getOrThunk:r=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:o,orThunk:r,map:f,ap:f,each:function(){},bind:f,flatten:f,exists:s,forall:m,filter:f,equals:n=function(e){return e.isNone()},equals_:n,toArray:function(){return[]},toString:t("none()")},Object.freeze&&Object.freeze(a),a),y=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:m,isNone:s,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return y(e(n))},ap:function(e){return e.fold(f,function(e){return y(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:d},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(s,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},h={some:y,none:f,from:function(e){return null===e||e===undefined?d:y(e)}},g=(i="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===i}),k=(u=Array.prototype.indexOf)===undefined?function(e,t){return A(e,t)}:function(e,t){return u.call(e,t)},v=function(e,t){return-1<k(e,t)},b=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var a=e[o];r[o]=t(a,o,e)}return r},A=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},C=(Array.prototype.slice,g(Array.from)&&Array.from,[{shortcuts:["Meta + B"],action:"Bold"},{shortcuts:["Meta + I"],action:"Italic"},{shortcuts:["Meta + U"],action:"Underline"},{shortcuts:["Meta + A"],action:"Select all"},{shortcuts:["Meta + Y","Meta + Shift + Z"],action:"Redo"},{shortcuts:["Meta + Z"],action:"Undo"},{shortcuts:["Ctrl + Alt + 1"],action:"Header 1"},{shortcuts:["Ctrl + Alt + 2"],action:"Header 2"},{shortcuts:["Ctrl + Alt + 3"],action:"Header 3"},{shortcuts:["Ctrl + Alt + 4"],action:"Header 4"},{shortcuts:["Ctrl + Alt + 5"],action:"Header 5"},{shortcuts:["Ctrl + Alt + 6"],action:"Header 6"},{shortcuts:["Ctrl + Alt + 7"],action:"Paragraph"},{shortcuts:["Ctrl + Alt + 8"],action:"Div"},{shortcuts:["Ctrl + Alt + 9"],action:"Address"},{shortcuts:["Alt + 0"],action:"Open help dialog"},{shortcuts:["Alt + F9"],action:"Focus to menubar"},{shortcuts:["Alt + F10"],action:"Focus to toolbar"},{shortcuts:["Alt + F11"],action:"Focus to element path"},{shortcuts:["Ctrl + F9"],action:"Focus to contextual toolbar"},{shortcuts:["Shift + Enter"],action:"Open popup menu for split buttons"},{shortcuts:["Meta + K"],action:"Insert link (if link plugin activated)"},{shortcuts:["Meta + S"],action:"Save (if save plugin activated)"},{shortcuts:["Meta + F"],action:"Find (if searchreplace plugin activated)"},{shortcuts:["Meta + Shift + F"],action:"Switch to or from fullscreen mode"}]),O=Object.keys,S=Object.hasOwnProperty,w=tinymce.util.Tools.resolve("tinymce.Env"),M=function(e){var o=w.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;"}:{meta:"Ctrl "},t=e.split("+"),n=b(t,function(e){var t,n,r=e.toLowerCase().trim();return t=o,n=r,S.call(t,n)?o[r]:e});return w.mac?n.join("").replace(/\s/,""):n.join("+")},P=function(){return{title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:b(C,function(e){var t=b(e.shortcuts,M).join(" or ");return[e.action,t]})}]}},x=function(e,o){return e.replace(/\$\{([^{}]*)\}/g,function(e,t){var n,r=o[t];return"string"==(n=typeof r)||"number"===n?r.toString():e})},T=tinymce.util.Tools.resolve("tinymce.util.I18n"),_=[{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"bbcode",name:"BBCode"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullpage",name:"Full Page"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"hr",name:"Horizontal Rule"},{key:"image",name:"Image"},{key:"imagetools",name:"Image Tools"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"legacyoutput",name:"Legacy Output"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"noneditable",name:"Noneditable"},{key:"pagebreak",name:"Page Break"},{key:"paste",name:"Paste"},{key:"preview",name:"Preview"},{key:"print",name:"Print"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"spellchecker",name:"Spell Checker"},{key:"tabfocus",name:"Tab Focus"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"textpattern",name:"Text Pattern"},{key:"toc",name:"Table of Contents"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"}],F=function(e){var t,n,r,o,a,i,u,l,c,s,m=p(x,'<a href="${url}" target="_blank" rel="noopener">${name}</a>'),f=function(t,n){return function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return h.some(o)}return h.none()}(_,function(e){return e.key===n}).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?m(e()):n},function(e){return m({name:e.name,url:"https://www.tiny.cloud/docs/plugins/"+e.key})})};return{title:"Plugins",items:[{type:"htmlpanel",html:[(n=e,null==n?"":'<div data-mce-tabstop="1" tabindex="-1">'+(r=n,i=O((o=r).plugins),u=o.settings.forced_plugins===undefined?i:function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var a=e[r];t(a,r,e)&&n.push(a)}return n}(i,(a=p(v,o.settings.forced_plugins),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!a.apply(null,e)})),l=b(u,function(e){return"<li>"+f(r,e)+"</li>"}),c=l.length,s=l.join(""),"<p><b>"+T.translate(["Plugins installed ({0}):",c])+"</b></p><ul>"+s+"</ul>")+"</div>"),(t=b(["PowerPaste","Spell Checker Pro","Accessibility Checker","Advanced Code Editor","Enhanced Media Embed","Link Checker"],function(e){return"<li>"+T.translate(e)+"</li>"}).join(""),'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+T.translate("Premium plugins:")+"</b></p><ul>"+t+'</ul><br /><p style="float: right;"><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">'+T.translate("Learn more...")+"</a></p></div>")].join("")}]}},H=tinymce.util.Tools.resolve("tinymce.EditorManager"),j=function(){var e,t,n='<a href="https://www.tinymce.com/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+(e=H.majorVersion,t=H.minorVersion,0===e.indexOf("@")?"X.X.X":e+"."+t)+"</a>";return{title:"Version",items:[{type:"htmlpanel",html:"<p>"+T.translate(["You are using {0}",n])+"</p>"}]}},E=function(t){return function(){var e={type:"tabpanel",tabs:[P(),F(t),j()]};t.windowManager.open({title:"Help",size:"medium",body:e,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})}},I=function(e){e.addCommand("mceHelp",E(e))},B=function(e){e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:E(e)}),e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:E(e)})};e.add("help",function(e){B(e),I(e),e.shortcuts.add("Alt+0","Open help dialog","mceHelp")}),function D(){}}();!function(){"use strict";var l=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return l(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(t.settings.plugins)||!e.get("powerpaste")||("undefined"!=typeof window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},u=function(t,e){return{clipboard:t,quirks:e}},f=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})},d=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})},i=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},n=function(t,e){return t.fire("paste",{ieFake:e})},m={shouldPlainTextInform:function(t){return t.getParam("paste_plaintext_inform",!0)},shouldBlockDrop:function(t){return t.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(t){return t.getParam("paste_data_images",!1)},shouldFilterDrop:function(t){return t.getParam("paste_filter_drop",!0)},getPreProcess:function(t){return t.getParam("paste_preprocess")},getPostProcess:function(t){return t.getParam("paste_postprocess")},getWebkitStyles:function(t){return t.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(t){return t.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(t){return t.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(t){return t.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(t){return t.getParam("paste_as_text",!1)},getRetainStyleProps:function(t){return t.getParam("paste_retain_style_properties")},getWordValidElements: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")},shouldConvertWordFakeLists:function(t){return t.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(t){return t.getParam("paste_enable_default_filters",!0)}},r=function(t,e,n){var r,o;"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),i(t,!1)):(e.pasteFormat.set("text"),i(t,!0),o=t,!1===n.get()&&m.shouldPlainTextInform(o)&&(r="Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",t.notificationManager.open({text:r,type:"info"}),n.set(!0))),t.focus()},s=function(t,n,e){t.addCommand("mceTogglePlainTextPaste",function(){r(t,n,e)}),t.addCommand("mceInsertClipboardContent",function(t,e){e.content&&n.pasteHtml(e.content,e.internal),e.text&&n.pasteText(e.text)})},v=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),t="x-tinymce/html",c="\x3c!-- "+t+" --\x3e",g=function(t){return c+t},p=function(t){return t.replace(c,"")},b=function(t){return-1!==t.indexOf(c)},x=function(){return t},P=tinymce.util.Tools.resolve("tinymce.html.Entities"),w=function(t){return t.replace(/\r?\n/g,"<br>")},T=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+'="'+P.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",a=y.map(r,function(t){return t.split(/\n/).join("<br />")});return 1===a.length?a[0]:y.map(a,function(t){return o+t+i}).join("")},_=function(t){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(t)},D=function(t,e,n){return e?T(t,e,n):w(t)},C=tinymce.util.Tools.resolve("tinymce.html.DomParser"),k=tinymce.util.Tools.resolve("tinymce.html.Node"),S=tinymce.util.Tools.resolve("tinymce.html.Schema"),O=tinymce.util.Tools.resolve("tinymce.html.Serializer");function R(e,t){return y.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var A={filter:R,innerText:function Zt(t){var e=S(),n=C({},e),r="",o=e.getShortEndedElements(),i=y.makeMap("script noscript style textarea video audio iframe object"," "),a=e.getBlockElements();return t=R(t,[/<!\[[^\]]+\]>/g]),function u(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))for(;u(t),t=t.next;);a[e]&&n.next&&(r+="\n","p"===e&&(r+="\n"))}}else r+="\n"}(n.parse(t)),r},trimHtml:function Jt(t){return t=R(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function r(t,e,n){return e||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function Qt(t){var e=0;return function(){return t+e++}},isMsEdge:function(){return-1!==navigator.userAgent.indexOf(" Edge/")}};function E(e){var n,t;return t=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \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]/],e=e.replace(/^[\u00a0 ]+/,""),y.each(t,function(t){if(t.test(e))return!(n=!0)}),n}function F(t){var i,a,u=1;function n(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)for(;e+=n(t),t=t.next;);return e}function s(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!s(t,e))return!1}while(t=t.next);return!0}function e(t,e,n){var r=t._listLevel||u;r!==u&&(r<u?i&&(i=i.parent.parent):(a=i,i=null)),i&&i.name===e?i.append(t):(a=a||i,i=new k(e,1),1<n&&i.attr("start",""+n),t.wrap(i)),t.name="li",u<r&&a&&a.lastChild.append(i),u=r,function o(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)for(;o(t),t=t.next;);}(t),s(t,/^\u00a0+/),s(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),s(t,/^\u00a0+/)}for(var r=[],o=t.firstChild;null!=o;)if(r.push(o),null!==(o=o.walk()))for(;void 0!==o&&o.parent!==t;)o=o.walk();for(var l=0;l<r.length;l++)if("p"===(t=r[l]).name&&t.firstChild){var c=n(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(c)){e(t,"ul");continue}if(E(c)){var f=/([0-9]+)\./.exec(c),d=1;f&&(d=parseInt(f[1],10)),e(t,"ol",d);continue}if(t._listLevel){e(t,"ul",1);continue}i=null}else a=i,i=null}function I(n,r,o,i){var a,u={},t=n.dom.parseStyle(i);return y.each(t,function(t,e){switch(e){case"mso-list":(a=/\w+ \w+([0-9]+)/i.exec(i))&&(o._listLevel=parseInt(a[1],10)),/Ignore/i.test(t)&&o.firstChild&&(o._listIgnore=!0,o.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":return void("normal"!==t&&(u[e]=t));case"mso-element":if(/^(comment|comment-list)$/i.test(t))return void o.remove()}0!==e.indexOf("mso-comment")?0!==e.indexOf("mso-")&&("all"===m.getRetainStyleProps(n)||r&&r[e])&&(u[e]=t):o.remove()}),/(bold)/i.test(u["font-weight"])&&(delete u["font-weight"],o.wrap(new k("b",1))),/(italic)/i.test(u["font-style"])&&(delete u["font-style"],o.wrap(new k("i",1))),(u=n.dom.serializeStyle(u,o.name))||null}var M,B,H,j,L,N={preProcess:function(t,e){return m.shouldUseDefaultFilters(t)?function(r,t){var e,o;(e=m.getRetainStyleProps(r))&&(o=y.makeMap(e.split(/[, ]/))),t=A.filter(t,[/<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,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return 0<e.length?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join("\xa0"):""}]]);var n=m.getWordValidElements(r),i=S({valid_elements:n,valid_children:"-li[p]"});y.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=C({},i);a.addAttributeFilter("style",function(t){for(var e,n=t.length;n--;)(e=t[n]).attr("style",I(r,o,e,e.attr("style"))),"span"===e.name&&e.parent&&!e.attributes.length&&e.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(t);return m.shouldConvertWordFakeLists(r)&&F(u),t=O({validate:r.settings.validate},i).serialize(u)}(t,e):e},isWordContent:function te(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)}},$=function(t,e){return{content:t,cancelled:e}},W=function(t,e,n,r){var o,i,a,u,s,l,c=f(t,e,n,r);return t.hasEventListeners("PastePostProcess")&&!c.isDefaultPrevented()?(o=t,i=c.content,a=n,u=r,s=o.dom.create("div",{style:"display:none"},i),l=d(o,s,a,u),$(l.node.innerHTML,l.isDefaultPrevented())):$(c.content,c.isDefaultPrevented())},z=function(t,e,n){var r=N.isWordContent(e),o=r?N.preProcess(t,e):e;return W(t,o,n,r)},U=function(t,e){var n,r;return t.insertContent((n=e,r=t.dom.create("body",{},n),y.each(r.querySelectorAll("meta"),function(t){return t.parentNode.removeChild(t)}),r.innerHTML),{merge:m.shouldMergeFormats(t),paste:!0}),!0},V=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},q=function(t){return V(t)&&/.(gif|jpe?g|png)$/.test(t)},K=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!V(e)||(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.execCommand("mceInsertLink",!1,o)}),0));var r,o,i},G=function(t,e,n){return!!q(e)&&(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.insertContent('<img src="'+o+'">')}),!0);var r,o,i},X=function(t,e){var n,r;!1===m.isSmartPasteEnabled(t)?U(t,e):(n=t,r=e,y.each([K,G,U],function(t){return!0!==t(n,r,U)}))},Y=function(t){return function(){return t}},Z=Y(!1),J=Y(!0),Q=Z,tt=J,et=function(){return nt},nt=(j={fold:function(t,e){return t()},is:Q,isSome:Q,isNone:tt,getOr:H=function(t){return t},getOrThunk:B=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:H,orThunk:B,map:et,ap:et,each:function(){},bind:et,flatten:et,exists:Q,forall:tt,filter:et,equals:M=function(t){return t.isNone()},equals_:M,toArray:function(){return[]},toString:Y("none()")},Object.freeze&&Object.freeze(j),j),rt=function(n){var t=function(){return n},e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:tt,isNone:Q,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return rt(t(n))},ap:function(t){return t.fold(et,function(t){return rt(t(n))})},each:function(t){t(n)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(n)?o:nt},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(Q,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},ot={some:rt,none:et,from:function(t){return null===t||t===undefined?nt:rt(t)}},it=(L="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&Array.prototype.isPrototypeOf(t)?"array":"object"===e&&String.prototype.isPrototypeOf(t)?"string":e}(t)===L}),at=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,t)}return r},ut=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n,t)},st=Array.prototype.slice,lt=it(Array.from)?Array.from:function(t){return st.call(t)},ct=function(t){var n=ot.none(),e=[],r=function(t){o()?a(t):e.push(t)},o=function(){return n.isSome()},i=function(t){ut(t,a)},a=function(e){n.each(function(t){setTimeout(function(){e(t)},0)})};return t(function(t){n=ot.some(t),i(e),e=[]}),{get:r,map:function(n){return ct(function(e){r(function(t){e(n(t))})})},isReady:o}},ft={nu:ct,pure:function(e){return ct(function(t){t(e)})}},dt=function(e){var t=function(t){var r;e((r=t,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this;setTimeout(function(){r.apply(n,t)},0)}))},n=function(){return ft.nu(t)};return{map:function(r){return dt(function(n){t(function(t){var e=r(t);n(e)})})},bind:function(n){return dt(function(e){t(function(t){n(t).get(e)})})},anonBind:function(n){return dt(function(e){t(function(t){n.get(e)})})},toLazy:n,toCached:function(){var e=null;return dt(function(t){null===e&&(e=n()),e.get(t)})},get:t}},mt={nu:dt,pure:function(e){return dt(function(t){t(e)})}},gt=function(a,t){return t(function(r){var o=[],i=0;0===a.length?r([]):ut(a,function(t,e){var n;t.get((n=e,function(t){o[n]=t,++i>=a.length&&r(o)}))})})},pt=function(t,e){var n=at(t,e);return gt(n,mt.nu)},vt=function(t,e,n){var r=n||b(e),o=z(t,p(e),r);!1===o.cancelled&&X(t,o.content)},ht=function(t,e){e=t.dom.encode(e).replace(/\r\n/g,"\n"),e=D(e,t.settings.forced_root_block,t.settings.forced_root_block_attrs),vt(t,e,!1)},yt=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&0<n.length&&-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(i){e[o]=""}}}return e},bt=function(t,e){return e in t&&0<t[e].length},xt=function(t){return bt(t,"text/html")||bt(t,"text/plain")},Pt=A.createIdGenerator("mceclip"),wt=function(e,t,n){var r,o,i,a,u="paste"===t.type?t.clipboardData:t.dataTransfer;if(e.settings.paste_data_images&&u){var s=(i=(o=u).items?at(lt(o.items),function(t){return t.getAsFile()}):[],a=o.files?lt(o.files):[],function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n}(0<i.length?i:a,function(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)}));if(0<s.length)return t.preventDefault(),(r=s,pt(r,function(r){return mt.nu(function(t){var e=r.getAsFile?r.getAsFile():r,n=new window.FileReader;n.onload=function(){t({blob:e,uri:n.result})},n.readAsDataURL(e)})})).get(function(t){n&&e.selection.setRng(n),ut(t,function(t){!function(t,e){var n,r,o,i,a,u,s,l=(n=e.uri,-1!==(r=n.indexOf(","))?n.substr(r+1):null),c=Pt(),f=t.settings.images_reuse_filename&&e.blob.name?(o=t,i=e.blob.name,(a=i.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i))?o.dom.encode(a[1]):null):c,d=new Image;if(d.src=e.uri,u=t.settings,s=d,!u.images_dataimg_filter||u.images_dataimg_filter(s)){var m,g=t.editorUpload.blobCache,p=void 0;(m=g.findFirst(function(t){return t.base64()===l}))?p=m:(p=g.create(c,e.blob,l,f),g.add(p)),vt(t,'<img src="'+p.blobUri()+'">',!1)}else vt(t,'<img src="'+e.uri+'">',!1)}(e,t)})}),!0}return!1},Tt=function(t){return o.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},_t=function(c,f,d){var m,g=0;function p(t,e,n,r){var o,i;bt(t,"text/html")?o=t["text/html"]:(o=f.getHtml(),r=r||b(o),f.isDefaultContent(o)&&(n=!0)),o=A.trimHtml(o),f.remove(),i=!1===r&&_(o),o.length&&!i||(n=!0),n&&(o=bt(t,"text/plain")&&i?t["text/plain"]:A.innerText(o)),f.isDefaultContent(o)?e||c.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?ht(c,o):vt(c,o,r)}c.on("keydown",function(t){function e(t){Tt(t)&&!t.isDefaultPrevented()&&f.remove()}if(Tt(t)&&!t.isDefaultPrevented()){if((m=t.shiftKey&&86===t.keyCode)&&v.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),g=(new Date).getTime(),v.ie&&m)return t.preventDefault(),void n(c,!0);f.remove(),f.create(),c.once("keyup",e),c.once("paste",function(){c.off("keyup",e)})}}),c.on("paste",function(t){var e,n,r,o=(new Date).getTime(),i=(e=c,n=yt(t.clipboardData||e.getDoc().dataTransfer),A.isMsEdge()?y.extend(n,{"text/html":""}):n),a=(new Date).getTime()-o,u=(new Date).getTime()-g-a<1e3,s="text"===d.get()||m,l=bt(i,x());m=!1,t.isDefaultPrevented()||(r=t.clipboardData,-1!==navigator.userAgent.indexOf("Android")&&r&&r.items&&0===r.items.length)?f.remove():xt(i)||!wt(c,t,f.getLastRng()||c.selection.getRng())?(u||t.preventDefault(),!v.ie||u&&!t.ieFake||bt(i,"text/html")||(f.create(),c.dom.bind(f.getEl(),"paste",function(t){t.stopPropagation()}),c.getDoc().execCommand("Paste",!1,null),i["text/html"]=f.getHtml()),bt(i,"text/html")?(t.preventDefault(),l||(l=b(i["text/html"])),p(i,u,s,l)):h.setEditorTimeout(c,function(){p(i,u,s,l)},0)):f.remove()})},Dt=function(t){return v.ie&&t.inline?document.body:t.getBody()},Ct=function(e,t,n){var r;Dt(r=e)!==r.getBody()&&e.dom.bind(t,"paste keyup",function(t){Ot(e,n)||e.fire("paste")})},kt=function(t){return t.dom.get("mcepastebin")},St=function(t,e){return e===t},Ot=function(t,e){var n,r=kt(t);return(n=r)&&"mcepastebin"===n.id&&St(e,r.innerHTML)},Rt=function(a){var u=l(null),s="%MCEPASTEBIN%";return{create:function(){return e=u,n=s,o=(t=a).dom,i=t.getBody(),e.set(t.selection.getRng()),r=t.dom.add(Dt(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),(v.ie||v.gecko)&&o.setStyle(r,"left","rtl"===o.getStyle(i,"direction",!0)?65535:-65535),o.bind(r,"beforedeactivate focusin focusout",function(t){t.stopPropagation()}),Ct(t,r,n),r.focus(),void t.selection.select(r,!0);var t,e,n,r,o,i},remove:function(){return function(t,e){if(kt(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)}(a,u)},getEl:function(){return kt(a)},getHtml:function(){return function(n){var e,t,r,o,i,a=function(t,e){t.appendChild(e),n.dom.remove(e,!0)};for(t=y.grep(Dt(n).childNodes,function(t){return"mcepastebin"===t.id}),e=t.shift(),y.each(t,function(t){a(e,t)}),r=(o=n.dom.select("div[id=mcepastebin]",e)).length-1;0<=r;r--)i=n.dom.create("div"),e.insertBefore(i,o[r]),a(i,o[r]);return e?e.innerHTML:""}(a)},getLastRng:function(){return u.get()},isDefault:function(){return Ot(a,s)},isDefaultContent:function(t){return St(s,t)}}},At=function(n,t){var e=Rt(n);return n.on("preInit",function(){return _t(a=n,e,t),void a.parser.addNodeFilter("img",function(t,e,n){var r,o=function(t){t.attr("data-mce-object")||u===v.transparentSrc||t.remove()};if(!a.settings.paste_data_images&&(r=n).data&&!0===r.data.paste)for(var i=t.length;i--;)(u=t[i].attributes.map.src)&&(0===u.indexOf("webkit-fake-url")?o(t[i]):a.settings.allow_html_data_urls||0!==u.indexOf("data:")||o(t[i]))});var a,u}),{pasteFormat:t,pasteHtml:function(t,e){return vt(n,t,e)},pasteText:function(t){return ht(n,t)},pasteImageData:function(t,e){return wt(n,t,e)},getDataTransferItems:yt,hasHtmlOrText:xt,hasContentType:bt}},Et=function(){},Ft=function(t,e,n){if(r=t,!1!==v.iOS||r===undefined||"function"!=typeof r.setData||!0===A.isMsEdge())return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(x(),e),!0}catch(o){return!1}var r},It=function(t,e,n,r){Ft(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)},Mt=function(u){return function(t,e){var n=g(t),r=u.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=u.dom.create("div",{contenteditable:"true"},n);u.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(o),u.dom.add(u.getBody(),r);var i=u.selection.getRng();o.focus();var a=u.dom.createRng();a.selectNodeContents(o),u.selection.setRng(a),setTimeout(function(){u.selection.setRng(i),r.parentNode.removeChild(r),e()},0)}},Bt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},Ht=function(t){return!t.selection.isCollapsed()||!!(e=t).dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody());var e},jt=function(t){var e,n;t.on("cut",(e=t,function(t){Ht(e)&&It(t,Bt(e),Mt(e),function(){setTimeout(function(){e.execCommand("Delete")},0)})})),t.on("copy",(n=t,function(t){Ht(n)&&It(t,Bt(n),Mt(n),Et)}))},Lt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Nt=function(t,e){return Lt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},$t=function(t,e){t.focus(),t.selection.setRng(e)},Wt=function(a,u,s){m.shouldBlockDrop(a)&&a.on("dragend dragover draggesture dragdrop drop drag",function(t){t.preventDefault(),t.stopPropagation()}),m.shouldPasteDataImages(a)||a.on("drop",function(t){var e=t.dataTransfer;e&&e.files&&0<e.files.length&&t.preventDefault()}),a.on("drop",function(t){var e,n;if(n=Nt(a,t),!t.isDefaultPrevented()&&!s.get()){e=u.getDataTransferItems(t.dataTransfer);var r,o=u.hasContentType(e,x());if((u.hasHtmlOrText(e)&&(!(r=e["text/plain"])||0!==r.indexOf("file://"))||!u.pasteImageData(t,n))&&n&&m.shouldFilterDrop(a)){var i=e["mce-internal"]||e["text/html"]||e["text/plain"];i&&(t.preventDefault(),h.setEditorTimeout(a,function(){a.undoManager.transact(function(){e["mce-internal"]&&a.execCommand("Delete"),$t(a,n),i=A.trimHtml(i),e["text/html"]?u.pasteHtml(i,o):u.pasteText(i)})}))}}}),a.on("dragstart",function(t){s.set(!0)}),a.on("dragover dragend",function(t){m.shouldPasteDataImages(a)&&!1===s.get()&&(t.preventDefault(),$t(a,Nt(a,t))),"dragend"===t.type&&s.set(!1)})},zt=function(t){var e=t.plugins.paste,n=m.getPreProcess(t);n&&t.on("PastePreProcess",function(t){n.call(e,e,t)});var r=m.getPostProcess(t);r&&t.on("PastePostProcess",function(t){r.call(e,e,t)})};function Ut(e,n){e.on("PastePreProcess",function(t){t.content=n(e,t.content,t.internal,t.wordContent)})}function Vt(t,e){if(!N.isWordContent(e))return e;var n=[];y.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=A.filter(e,[[r,"$1"]]),e=A.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function qt(t,e,n,r){if(r||n)return e;var l,o=m.getWebkitStyles(t);if(!1===m.shouldRemoveWebKitStyles(t)||"all"===o)return e;if(o&&(l=o.split(/[, ]/)),l){var c=t.dom,f=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(t,e,n,r){var o=c.parseStyle(c.decode(n)),i={};if("none"===l)return e+r;for(var a=0;a<l.length;a++){var u=o[l[a]],s=c.getStyle(f,l[a],!0);/color/.test(l[a])&&(u=c.toHex(u),s=c.toHex(s)),s!==u&&(i[l[a]]=u)}return(i=c.serializeStyle(i,"span"))?e+' style="'+i+'"'+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})}function Kt(n,t){n.$("a",t).find("font,u").each(function(t,e){n.dom.remove(e,!0)})}var Gt=function(t){v.webkit&&Ut(t,qt),v.ie&&(Ut(t,Vt),function r(e,n){e.on("PastePostProcess",function(t){n(e,t.node)})}(t,Kt))},Xt=function(n,r){return function(e){e.setActive("text"===r.pasteFormat.get());var t=function(t){return e.setActive(t.state)};return n.on("PastePlainTextToggle",t),function(){return n.off("PastePlainTextToggle",t)}}},Yt=function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Xt(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Xt(t,e)})};e.add("paste",function(t){if(!1===a(t)){var e=l(!1),n=l(!1),r=l(m.isPasteAsTextEnabled(t)?"text":"html"),o=At(t,r),i=Gt(t);return Yt(t,o),s(t,o,e),zt(t),jt(t),Wt(t,o,n),u(o,i)}}),function ee(){}}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e,n){e.focus(),e.undoManager.transact(function(){e.setContent(n)}),e.selection.setCursorLocation(),e.nodeChanged()},o=function(e){return e.getContent({source_view:!0})},n=function(n){var e=o(n);n.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){t(n,e.getData().code),e.close()}})},c=function(e){e.addCommand("mceCodeEditor",function(){n(e)})},i=function(e){e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return n(e)}}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return n(e)}})};e.add("code",function(e){return c(e),i(e),{}}),function u(){}}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.EditorManager"),s=tinymce.util.Tools.resolve("tinymce.Env"),a=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),d=function(e){return e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))},m=t.DOM,n=function(e){e.keyCode!==f.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==f.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=y.explode(d(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):m.get(e[0]):":next"===e[1]?u(1):m.get(e[1]))){var t=c.get(o.id||o.name);o.id&&t?t.focus():a.setTimeout(function(){s.webkit||window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&c.get(n.id)&&-1!==e.tabIndex&&function t(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&t(e.parentNode)}(e)}if(o=m.select(":input:enabled,*[tabindex]:not(iframe)"),y.each(o,function(e,t){if(e.id===r.id)return i=t,!1}),0<e){for(l=i+1;l<o.length;l++)if(t(o[l]))return o[l]}else for(l=i-1;0<=l;l--)if(t(o[l]))return o[l];return null}}r.on("init",function(){r.inline&&m.setAttrib(r.getBody(),"tabIndex",null),r.on("keyup",n),s.gecko?r.on("keypress keydown",e):r.on("keydown",e)})};e.add("tabfocus",function(e){i(e)}),function o(){}}();