(window.webpackJsonp_name_=window.webpackJsonp_name_||[]).push([[0],{1:function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return o})),n.d(e,"__assign",(function(){return i})),n.d(e,"__rest",(function(){return u})),n.d(e,"__decorate",(function(){return a})),n.d(e,"__param",(function(){return c})),n.d(e,"__metadata",(function(){return s})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return f})),n.d(e,"__createBinding",(function(){return d})),n.d(e,"__exportStar",(function(){return m})),n.d(e,"__values",(function(){return g})),n.d(e,"__read",(function(){return h})),n.d(e,"__spread",(function(){return p})),n.d(e,"__spreadArrays",(function(){return v})),n.d(e,"__spreadArray",(function(){return b})),n.d(e,"__await",(function(){return y})),n.d(e,"__asyncGenerator",(function(){return w})),n.d(e,"__asyncDelegator",(function(){return x})),n.d(e,"__asyncValues",(function(){return C})),n.d(e,"__makeTemplateObject",(function(){return S})),n.d(e,"__importStar",(function(){return O})),n.d(e,"__importDefault",(function(){return _})),n.d(e,"__classPrivateFieldGet",(function(){return T})),n.d(e,"__classPrivateFieldSet",(function(){return E}));
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function u(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function a(t,e,n,r){var o,i=arguments.length,u=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(u=(i<3?o(u):i>3?o(e,n,u):o(e,n))||u);return i>3&&u&&Object.defineProperty(e,n,u),u}function c(t,e){return function(n,r){e(n,r,t)}}function s(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}c((r=r.apply(t,e||[])).next())}))}function f(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var d=Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function m(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||d(e,t,n)}function g(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function p(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(h(arguments[e]));return t}function v(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}function b(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function w(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(t,e||[]),i=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(t){o[t]&&(r[t]=function(e){return new Promise((function(n,r){i.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{(n=o[t](e)).value instanceof y?Promise.resolve(n.value.v).then(c,s):l(i[0][2],n)}catch(t){l(i[0][3],t)}var n}function c(t){a("next",t)}function s(t){a("throw",t)}function l(t,e){t(e),i.shift(),i.length&&a(i[0][0],i[0][1])}}function x(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,o){e[r]=t[r]?function(e){return(n=!n)?{value:y(t[r](e)),done:"return"===r}:o?o(e):e}:o}}function C(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=g(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,o){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,o,(e=t[n](e)).done,e.value)}))}}}function S(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var k=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function O(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&d(e,t,n);return k(e,t),e}function _(t){return t&&t.__esModule?t:{default:t}}function T(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function E(t,e,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,n):o?o.value=n:e.set(t,n),n}},257:function(t,e,n){"use strict";var r=n(354),o=n(358),i=n(258);t.exports=function(t){var e,n=r(t);return n.space?((e=Array(3))[0]=i(n.values[0],0,255),e[1]=i(n.values[1],0,255),e[2]=i(n.values[2],0,255),"h"===n.space[0]&&(e=o.rgb(e)),e.push(i(n.alpha,0,1)),e):[]}},258:function(t,e){t.exports=function(t,e,n){return e<n?t<e?e:t>n?n:t:t<n?n:t>e?e:t}},260:function(t,e,n){var r;void 0===(r=function(){return function(t){function e(t,e){var n,r;for(n=-1,r=t.length;++n<r;)e(t[n],n,t)}function n(t,n){var r;return r=Array(t.length),e(t,(function(t,e,o){r[e]=n(t,e,o)})),r}function r(t,n,r){return e(t,(function(t,e,o){r=n(t,e,o)})),r}function o(t,n){var r,o,i;return i=this._matrix=[],t==n?this.distance=0:""==t?this.distance=n.length:""==n?this.distance=t.length:(r=[0],e(t,(function(t,e){e++,r[e]=e})),i[0]=r,e(n,(function(u,a){o=[++a],e(t,(function(e,i){i++,t.charAt(i-1)==n.charAt(a-1)?o[i]=r[i-1]:o[i]=Math.min(r[i]+1,o[i-1]+1,r[i-1]+1)})),r=o,i[i.length]=r})),this.distance=o[o.length-1])}return o.prototype.toString=o.prototype.inspect=function(t){var e,o,i,u;for(o=r(e=this.getMatrix(),(function(t,e){return Math.max(t,r(e,Math.max,0))}),0),i=Array((o+"").length).join(" "),u=[];u.length<(e[0]&&e[0].length||0);)u[u.length]=Array(i.length+1).join("-");return u=u.join("-+")+"-",n(e,(function(t){return n(t,(function(t){return(i+t).slice(-i.length)})).join(" |")+" "})).join("\n"+u+"\n")},o.prototype.getMatrix=function(){return this._matrix.slice()},o.prototype.valueOf=function(){return this.distance},o}()}.call(e,n,e,t))||(t.exports=r)},31:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},319:function(t,e,n){(function(e){!function(){"use strict";var n=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return{eq:t}},o=r((function(t,e){return t===e})),i=function(t){return r((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))},u=function(t,e){return function(t,e){return r((function(n,r){return t.eq(e(n),e(r))}))}(i(t),(function(t){return function(t,e){return Array.prototype.slice.call(t).sort(e)}(t,e)}))},a=function(t){return r((function(e,n){var r=Object.keys(e),i=Object.keys(n);if(!u(o).eq(r,i))return!1;for(var a=r.length,c=0;c<a;c++){var s=r[c];if(!t.eq(e[s],n[s]))return!1}return!0}))},c=r((function(t,e){if(t===e)return!0;var r=n(t);return r===n(e)&&(function(t){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(t)}(r)?t===e:"array"===r?i(c).eq(t,e):"object"===r&&a(c).eq(t,e))})),s=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},l=function(t){return function(e){return typeof e===t}},f=function(t){return function(e){return t===e}},d=s("string"),m=s("object"),g=s("array"),h=f(null),p=l("boolean"),v=f(void 0),b=function(t){return null==t},y=function(t){return!b(t)},w=l("function"),x=l("number"),C=function(){},S=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},k=function(t,e){return function(n){return t(e(n))}},O=function(t){return function(){return t}},_=function(t){return t},T=function(t,e){return t===e};function E(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var A=function(t){return function(e){return!t(e)}},D=function(t){return t()},M=function(t){t()},R=O(!1),N=O(!0),z=function(){return B},B=function(){var t=function(t){return t()},e=_;return{fold:function(t,e){return t()},isSome:R,isNone:N,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:O(null),getOrUndefined:O(void 0),or:e,orThunk:t,map:z,each:C,bind:z,exists:R,forall:N,filter:function(){return z()},toArray:function(){return[]},toString:O("none()")}}(),P=function(t){var e=O(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:N,isNone:R,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return P(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:B},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},I={some:P,none:z,from:function(t){return null==t?B:P(t)}},L=Array.prototype.slice,H=Array.prototype.indexOf,F=Array.prototype.push,V=function(t,e){return H.call(t,e)},j=function(t,e){return V(t,e)>-1},U=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},W=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},q=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},G=function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}},$=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},X=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},K=function(t,e,n){return G(t,(function(t,r){n=e(n,t,r)})),n},Y=function(t,e,n){return q(t,(function(t,r){n=e(n,t,r)})),n},J=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return I.some(i);if(n(i,r))break}return I.none()},Q=function(t,e){return J(t,e,R)},Z=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return I.some(n)}return I.none()},tt=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!g(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);F.apply(e,t[n])}return e}(W(t,e))},et=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},nt=function(t){var e=L.call(t,0);return e.reverse(),e},rt=function(t,e){return X(t,(function(t){return!j(e,t)}))},ot=function(t,e){var n=L.call(t,0);return n.sort(e),n},it=function(t,e){return e>=0&&e<t.length?I.some(t[e]):I.none()},ut=function(t){return it(t,0)},at=function(t){return it(t,t.length-1)},ct=w(Array.from)?Array.from:function(t){return L.call(t)},st=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return I.none()},lt=Object.keys,ft=Object.hasOwnProperty,dt=function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},mt=function(t,e){return gt(t,(function(t,n){return{k:n,v:e(t,n)}}))},gt=function(t,e){var n={};return dt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},ht=function(t){return function(e,n){t[n]=e}},pt=function(t,e,n,r){return dt(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},vt=function(t,e){var n={};return pt(t,e,ht(n),C),n},bt=function(t){return function(t,e){var n=[];return dt(t,(function(t,r){n.push(e(t,r))})),n}(t,_)},yt=function(t,e){return wt(t,e)?I.from(t[e]):I.none()},wt=function(t,e){return ft.call(t,e)},xt=function(t,e){return wt(t,e)&&void 0!==t[e]&&null!==t[e]},Ct=Array.isArray,St=function(t,e,n){var r,o;if(!t)return!1;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return!1}else for(r in t)if(wt(t,r)&&!1===e.call(n,t[r],r,t))return!1;return!0},kt=function(t,e){var n=[];return St(t,(function(r,o){n.push(e(r,o,t))})),n},Ot=function(t,e){var n=[];return St(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},_t=function(t,e){if(t)for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},Tt=function(t,e,n,r){for(var o=v(n)?t[0]:n,i=0;i<t.length;i++)o=e.call(r,o,t[i],i);return o},Et=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},At=function(t){return t[t.length-1]},Dt=function(){return(Dt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Mt(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var Rt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Nt=function(){return zt(0,0)},zt=function(t,e){return{major:t,minor:e}},Bt={nu:zt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?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}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return zt(r(1),r(2))}(t,n)},unknown:Nt},Pt=function(t,e){var n=String(e).toLowerCase();return Q(t,(function(t){return t.search(n)}))},It=function(t,e){return-1!==t.indexOf(e)},Lt=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,0)},Ht=function(t){return function(e){return e.replace(t,"")}},Ft=Ht(/^\s+|\s+$/g),Vt=Ht(/^\s+/g),jt=Ht(/\s+$/g),Ut=function(t){return t.length>0},Wt=function(t){return!Ut(t)},qt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Gt=function(t){return function(e){return It(e,t)}},$t=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return It(t,"edge/")&&It(t,"chrome")&&It(t,"safari")&&It(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,qt],search:function(t){return It(t,"chrome")&&!It(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return It(t,"msie")||It(t,"trident")}},{name:"Opera",versionRegexes:[qt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Gt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Gt("firefox")},{name:"Safari",versionRegexes:[qt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(It(t,"safari")||It(t,"mobile/"))&&It(t,"applewebkit")}}],Xt=[{name:"Windows",search:Gt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return It(t,"iphone")||It(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Gt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Gt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Gt("linux"),versionRegexes:[]},{name:"Solaris",search:Gt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Gt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Gt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Kt={browsers:O($t),oses:O(Xt)},Yt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},Jt={unknown:function(){return Yt({current:void 0,version:Bt.unknown()})},nu:Yt,edge:O("Edge"),chrome:O("Chrome"),ie:O("IE"),opera:O("Opera"),firefox:O("Firefox"),safari:O("Safari")},Qt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},Zt={unknown:function(){return Qt({current:void 0,version:Bt.unknown()})},nu:Qt,windows:O("Windows"),ios:O("iOS"),android:O("Android"),linux:O("Linux"),osx:O("OSX"),solaris:O("Solaris"),freebsd:O("FreeBSD"),chromeos:O("ChromeOS")},te=function(t,e,n){var r=Kt.browsers(),o=Kt.oses(),i=e.bind((function(t){return function(t,e){return st(e.brands,(function(e){var n=e.brand.toLowerCase();return Q(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:Bt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return Pt(t,e).map((function(t){var n=Bt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(Jt.unknown,Jt.nu),u=function(t,e){return Pt(t,e).map((function(t){var n=Bt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(Zt.unknown,Zt.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:O(o),isiPhone:O(i),isTablet:O(c),isPhone:O(s),isTouch:O(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:O(l),isDesktop:O(f)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}},ee=function(t){return window.matchMedia(t).matches},ne=Rt((function(){return te(navigator.userAgent,I.from(navigator.userAgentData),ee)})),re=function(){return ne()},oe=navigator.userAgent,ie=re(),ue=ie.browser,ae=ie.os,ce=ie.deviceType,se=/WebKit/.test(oe)&&!ue.isEdge(),le="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,fe=-1!==oe.indexOf("Windows Phone"),de={opera:ue.isOpera(),webkit:se,ie:!(!ue.isIE()&&!ue.isEdge())&&ue.version.major,gecko:ue.isFirefox(),mac:ae.isOSX()||ae.isiOS(),iOS:ce.isiPad()||ce.isiPhone(),android:ae.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:ue.isIE()?document.documentMode||7:10,fileApi:le,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!ue.isIE(),desktop:ce.isDesktop(),windowsPhone:fe,browser:{current:ue.current,version:ue.version,isChrome:ue.isChrome,isEdge:ue.isEdge,isFirefox:ue.isFirefox,isIE:ue.isIE,isOpera:ue.isOpera,isSafari:ue.isSafari},os:{current:ae.current,version:ae.version,isAndroid:ae.isAndroid,isChromeOS:ae.isChromeOS,isFreeBSD:ae.isFreeBSD,isiOS:ae.isiOS,isLinux:ae.isLinux,isOSX:ae.isOSX,isSolaris:ae.isSolaris,isWindows:ae.isWindows},deviceType:{isDesktop:ce.isDesktop,isiPad:ce.isiPad,isiPhone:ce.isiPhone,isPhone:ce.isPhone,isTablet:ce.isTablet,isTouch:ce.isTouch,isWebView:ce.isWebView}},me=/^\s*|\s*$/g,ge=function(t){return null==t?"":(""+t).replace(me,"")},he=function(t,e){return e?!("array"!==e||!Ct(t))||typeof t===e:void 0!==t},pe=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),St(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;pe(t,e,n,r)})))},ve={trim:ge,isArray:Ct,is:he,toArray:function(t){if(Ct(t))return t;for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e},makeMap:function(t,e,n){var r;for(e=e||",","string"==typeof(t=t||[])&&(t=t.split(e)),n=n||{},r=t.length;r--;)n[t[r]]={};return n},each:St,map:kt,grep:Ot,inArray:_t,hasOwn:wt,extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(wt(o,i)){var u=o[i];void 0!==u&&(t[i]=u)}}return t},create:function(t,e,n){var r,o,i,u=0,a=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],c=this.createNS(t[3].replace(/\.\w+$/,""),n);if(!c[a]){if("static"===t[2])return c[a]=e,void(this.onCreate&&this.onCreate(t[2],t[3],c[a]));e[a]||(e[a]=function(){},u=1),c[a]=e[a],this.extend(c[a].prototype,e),t[5]&&(r=this.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=c[a],c[a]=u?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},c[a].prototype[a]=c[a],this.each(r,(function(t,e){c[a].prototype[e]=r[e]})),this.each(e,(function(t,e){r[e]?c[a].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==a&&(c[a].prototype[e]=t)}))),this.each(e.static,(function(t,e){c[a][e]=t}))}},walk:pe,createNS:function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0;n<t.length;n++)e[r=t[n]]||(e[r]={}),e=e[r];return e},resolve:function(t,e){var n,r;for(e=e||window,n=0,r=(t=t.split(".")).length;n<r&&(e=e[t[n]]);n++);return e},explode:function(t,e){return!t||he(t,"array")?t:kt(t.split(e||","),ge)},_addCacheSuffix:function(t){var e=de.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},be=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},ye={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return be(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return be(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return be(n)},fromDom:be,fromPoint:function(t,e,n){return I.from(t.dom.elementFromPoint(e,n)).map(be)}},we=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},xe=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Ce=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Se=function(t,e){return t.dom===e.dom},ke=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},Oe=function(t,e){return re().browser.isIE()?ke(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)};"undefined"!=typeof window?window:Function("return this;")();var _e=function(t){return t.dom.nodeName.toLowerCase()},Te=function(t){return t.dom.nodeType},Ee=function(t){return function(e){return Te(e)===t}},Ae=Ee(1),De=Ee(3),Me=Ee(9),Re=Ee(11),Ne=function(t){return ye.fromDom(t.dom.ownerDocument)},ze=function(t){return Me(t)?t:Ne(t)},Be=function(t){return ye.fromDom(ze(t).dom.defaultView)},Pe=function(t){return I.from(t.dom.parentNode).map(ye.fromDom)},Ie=function(t){return I.from(t.dom.previousSibling).map(ye.fromDom)},Le=function(t){return I.from(t.dom.nextSibling).map(ye.fromDom)},He=function(t){return nt(we(t,Ie))},Fe=function(t){return we(t,Le)},Ve=function(t){return W(t.dom.childNodes,ye.fromDom)},je=function(t,e){var n=t.dom.childNodes;return I.from(n[e]).map(ye.fromDom)},Ue=function(t){return je(t,0)},We=function(t){return je(t,t.dom.childNodes.length-1)},qe=function(t){return t.dom.childNodes.length},Ge=function(t){return Re(t)&&y(t.dom.host)},$e=w(Element.prototype.attachShadow)&&w(Node.prototype.getRootNode),Xe=O($e),Ke=$e?function(t){return ye.fromDom(t.dom.getRootNode())}:ze,Ye=function(t){return Ge(t)?t:function(t){var e=t.dom.head;if(null==e)throw new Error("Head is not available yet");return ye.fromDom(e)}(ze(t))},Je=function(t){return ye.fromDom(t.dom.host)},Qe=function(t){return y(t.dom.shadowRoot)},Ze=function(t,e){Pe(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},tn=function(t,e){Le(t).fold((function(){Pe(t).each((function(t){nn(t,e)}))}),(function(t){Ze(t,e)}))},en=function(t,e){Ue(t).fold((function(){nn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},nn=function(t,e){t.dom.appendChild(e.dom)},rn=function(t,e){q(e,(function(e){nn(t,e)}))},on=function(t){t.dom.textContent="",q(Ve(t),(function(t){un(t)}))},un=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},an=function(t){var e,n=Ve(t);n.length>0&&(e=t,q(n,(function(t){Ze(e,t)}))),un(t)},cn=function(t){var e=De(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n=e.ownerDocument;return function(t){var e=Ke(t);return Ge(e)?I.some(e):I.none()}(ye.fromDom(e)).fold((function(){return n.body.contains(e)}),k(cn,Je))},sn=function(t,e){return{left:t,top:e,translate:function(n,r){return sn(t+n,e+r)}}},ln=sn,fn=function(t,e){return void 0!==t?t:void 0!==e?e:0},dn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?ln(n.offsetLeft,n.offsetTop):cn(t)?function(t){var e=t.getBoundingClientRect();return ln(e.left,e.top)}(e):ln(0,0)},mn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return ln(n,r)},gn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},hn=function(t,e){re().browser.isSafari()&&w(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},pn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},vn=function(t){var e=void 0===t?window:t,n=e.document,r=mn(ye.fromDom(n));return function(t){var e=void 0===t?window:t;return re().browser.isFirefox()?I.none():I.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return pn(r.left,r.top,n,o)}),(function(t){return pn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},bn=function(t){return function(e){return!!e&&e.nodeType===t}},yn=function(t){return!!t&&!Object.getPrototypeOf(t)},wn=bn(1),xn=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return j(e,n)}return!1}},Cn=function(t,e){var n=e.toLowerCase().split(" ");return function(e){if(wn(e))for(var r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}},Sn=function(t){return function(e){return wn(e)&&e.hasAttribute(t)}},kn=function(t){return wn(t)&&t.hasAttribute("data-mce-bogus")},On=function(t){return wn(t)&&"TABLE"===t.tagName},_n=function(t){return function(e){if(wn(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Tn=xn(["textarea","input"]),En=bn(3),An=bn(8),Dn=bn(9),Mn=bn(11),Rn=xn(["br"]),Nn=xn(["img"]),zn=_n("true"),Bn=_n("false"),Pn=xn(["td","th"]),In=xn(["video","audio","object","embed"]),Ln=function(t,e,n){return void 0===n&&(n=T),t.exists((function(t){return n(t,e)}))},Hn=function(t,e,n){return t.isSome()&&e.isSome()?I.some(n(t.getOrDie(),e.getOrDie())):I.none()},Fn=function(t){return void 0!==t.style&&w(t.style.getPropertyValue)},Vn=function(t,e,n){if(!(d(n)||p(n)||x(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},jn=function(t,e,n){Vn(t.dom,e,n)},Un=function(t,e){var n=t.dom;dt(e,(function(t,e){Vn(n,e,t)}))},Wn=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},qn=function(t,e){return I.from(Wn(t,e))},Gn=function(t,e){t.dom.removeAttribute(e)},$n=function(t,e){var n=t.dom;dt(e,(function(t,e){!function(t,e,n){if(!d(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Fn(t)&&t.style.setProperty(e,n)}(n,e,t)}))},Xn=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||cn(t)?r:Kn(n,e)},Kn=function(t,e){return Fn(t)?t.style.getPropertyValue(e):""},Yn=function(t,e){var n=t.dom,r=Kn(n,e);return I.from(r).filter((function(t){return t.length>0}))},Jn=function(t){var e={},n=t.dom;if(Fn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},Qn=re().browser,Zn=function(t){return Q(t,Ae)},tr=function(t,e){return t.children&&j(t.children,e)},er=function(t,e,n){var r=0,o=0,i=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===Xn(ye.fromDom(t),"position")){var u=e.getBoundingClientRect();return{x:r=u.left+(i.documentElement.scrollLeft||t.scrollLeft)-i.documentElement.clientLeft,y:o=u.top+(i.documentElement.scrollTop||t.scrollTop)-i.documentElement.clientTop}}for(var a=e;a&&a!==n&&a.nodeType&&!tr(a,n);){var c=a;r+=c.offsetLeft||0,o+=c.offsetTop||0,a=c.offsetParent}for(a=e.parentNode;a&&a!==n&&a.nodeType&&!tr(a,n);)r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;o+=function(t){return Qn.isFirefox()&&"table"===_e(t)?Zn(Ve(t)).filter((function(t){return"caption"===_e(t)})).bind((function(t){return Zn(Fe(t)).map((function(e){var n=e.dom.offsetTop,r=t.dom.offsetTop,o=t.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(ye.fromDom(e))}return{x:r,y:o}},nr={},rr={exports:nr};!function(t,n,r,o){!function(e,o){"object"==typeof n&&void 0!==r?r.exports=o():"function"==typeof t&&t.amd?t(o):(e="undefined"!=typeof globalThis?globalThis:e||self).EphoxContactWrapper=o()}(this,(function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},n={exports:{}};!function(e){!function(t){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void a(e.promise,t)}u(e.promise,r)}else(1===t._state?u:a)(e.promise,t._value)}))):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){a(t,e)}var r,i}function a(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,u(e,t))}),(function(t){n||(n=!0,a(e,t))}))}catch(t){if(n)return;n=!0,a(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(t)}(n);var r=n.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||r}}))}(void 0,nr,rr);var or=rr.exports.boltExport,ir=function(t){var e=I.none(),n=[],r=function(t){o()?u(t):n.push(t)},o=function(){return e.isSome()},i=function(t){q(t,u)},u=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=I.some(t),i(n),n=[])})),{get:r,map:function(t){return ir((function(e){r((function(n){e(t(n))}))}))},isReady:o}},ur={nu:ir,pure:function(t){return ir((function(e){e(t)}))}},ar=function(t){setTimeout((function(){throw t}),0)},cr=function(t){var e=function(e){t().then(e,ar)};return{map:function(e){return cr((function(){return t().then(e)}))},bind:function(e){return cr((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return cr((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return ur.nu(e)},toCached:function(){var e=null;return cr((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},sr=function(t){return cr((function(){return new or(t)}))},lr=function(t,e){return e((function(e){var n=[],r=0;0===t.length?e([]):q(t,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))}))}))},fr=function(t){return{isValue:N,isError:R,getOr:O(t),getOrThunk:O(t),getOrDie:O(t),or:function(e){return fr(t)},orThunk:function(e){return fr(t)},fold:function(e,n){return n(t)},map:function(e){return fr(e(t))},mapError:function(e){return fr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return I.some(t)}}},dr=function(t){return{isValue:R,isError:N,getOr:_,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:_,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return dr(t)},mapError:function(e){return dr(e(t))},each:C,bind:function(e){return dr(t)},exists:R,forall:N,toOptional:I.none}},mr={value:fr,error:dr,fromOption:function(t,e){return t.fold((function(){return dr(e)}),fr)}},gr=function(t){if(!g(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return q(t,(function(r,o){var i=lt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!g(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+i);var c=function(t){var r=lt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!et(e,(function(t){return j(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:n})}}}})),n};gr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var hr=function(t){return t.fold(_,_)};function pr(t,e,n,r,o){return t(n,r)?I.some(n):w(o)&&o(n)?I.none():e(n,r,o)}var vr,br,yr,wr,xr,Cr,Sr,kr,Or,_r,Tr,Er,Ar,Dr,Mr,Rr,Nr,zr,Br,Pr,Ir=function(t,e,n){for(var r=t.dom,o=w(n)?n:R;r.parentNode;){r=r.parentNode;var i=ye.fromDom(r);if(e(i))return I.some(i);if(o(i))break}return I.none()},Lr=function(t,e,n){return pr((function(t,e){return e(t)}),Ir,t,e,n)},Hr=function(t,e){return Q(t.dom.childNodes,(function(t){return e(ye.fromDom(t))})).map(ye.fromDom)},Fr=function(t,e,n){return Ir(t,(function(t){return xe(t,e)}),n)},Vr=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ce(n)?I.none():I.from(n.querySelector(t)).map(ye.fromDom)}(e,t)},jr=function(t,e,n){return pr((function(t,e){return xe(t,e)}),Fr,t,e,n)},Ur=window.Promise?window.Promise:or,Wr=function(t,e){return"number"!=typeof e&&(e=0),setTimeout(t,e)},qr=function(t,e){return"number"!=typeof e&&(e=1),setInterval(t,e)},Gr=function(t,e){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=Wr((function(){t.apply(this,r)}),e)};return r.stop=function(){clearTimeout(n)},r},$r={requestAnimationFrame:function(t,e){vr?vr.then(t):vr=new Ur((function(t){e||(e=document.body),function(t,e){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];n||(n=function(t){window.setTimeout(t,0)}),n(t,e)}(t,e)})).then(t)},setTimeout:Wr,setInterval:qr,setEditorTimeout:function(t,e,n){return Wr((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,n){var r=qr((function(){t.removed?clearInterval(r):e()}),n);return r},debounce:Gr,throttle:Gr,clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)}},Xr=function(t,e){void 0===e&&(e={});var n=0,r={},o=ye.fromDom(t),i=ze(o),u=e.maxLoadTime||5e3,a=function(a,c,s){var l,f=ve._addCacheSuffix(a),d=function(t){return yt(r,t).getOrThunk((function(){return{id:"mce-u"+n++,passed:[],failed:[],count:0}}))}(f);r[f]=d,d.count++;var m=function(t,e){for(var n=t.length;n--;)t[n]();d.status=e,d.passed=[],d.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},g=function(){return m(d.passed,2)},h=function(){return m(d.failed,3)},p=function(){var e;e=p,function(){for(var e=t.styleSheets,n=e.length;n--;){var r=e[n].ownerNode;if(r&&r.id===l.id)return g(),!0}return!1}()||(Date.now()-y<u?$r.setTimeout(e):h())};if(c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var v=ye.fromTag("link",i.dom);Un(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();e.contentCssCors&&jn(v,"crossOrigin","anonymous"),e.referrerPolicy&&jn(v,"referrerpolicy",e.referrerPolicy),(l=v.dom).onload=p,l.onerror=h,b=v,nn(Ye(o),b),jn(v,"href",f)}else h();else g()},c=function(t){return sr((function(e){a(t,S(e,O(mr.value(t))),S(e,O(mr.error(t))))}))},s=function(t){var e=ve._addCacheSuffix(t);yt(r,e).each((function(t){var n,i;0===--t.count&&(delete r[e],n=t.id,i=Ye(o),Vr(i,"#"+n).each(un))}))};return{load:a,loadAll:function(t,e,n){var r;(r=W(t,c),lr(r,sr)).get((function(t){var r=$(t,(function(t){return t.isValue()}));r.fail.length>0?n(r.fail.map(hr)):e(r.pass.map(hr))}))},unload:s,unloadAll:function(t){q(t,(function(t){s(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}},Kr=function(){var t=new WeakMap;return{forElement:function(e,n){var r=Ke(e).dom;return I.from(t.get(r)).getOrThunk((function(){var e=Xr(r,n);return t.set(r,e),e}))}}}(),Yr=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,u;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(u=o[e];u;u=u[e])if(!u[e])return u;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),Jr=function(t){var e;return function(n){return e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,N),wt(e,_e(n))}},Qr=Jr(["h1","h2","h3","h4","h5","h6"]),Zr=Jr(["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"]),to=function(t){return Ae(t)&&!Zr(t)},eo=function(t){return Ae(t)&&"br"===_e(t)},no=Jr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),ro=Jr(["ul","ol","dl"]),oo=Jr(["li","dd","dt"]),io=Jr(["thead","tbody","tfoot"]),uo=Jr(["td","th"]),ao=Jr(["pre","script","textarea","style"]),co="\ufeff",so=function(t){return"\ufeff"===t},lo=function(t){return t.replace(/\uFEFF/g,"")},fo=wn,mo=En,go=function(t){return mo(t)&&(t=t.parentNode),fo(t)&&t.hasAttribute("data-mce-caret")},ho=function(t){return mo(t)&&so(t.data)},po=function(t){return go(t)||ho(t)},vo=function(t){return t.firstChild!==t.lastChild||!Rn(t.firstChild)},bo=function(t){var e=t.container();return!!En(e)&&(e.data.charAt(t.offset())===co||t.isAtStart()&&ho(e.previousSibling))},yo=function(t){var e=t.container();return!!En(e)&&(e.data.charAt(t.offset()-1)===co||t.isAtEnd()&&ho(e.nextSibling))},wo=function(t,e,n){var r,o=e.ownerDocument.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o},xo=function(t){return mo(t)&&t.data[0]===co},Co=function(t){return mo(t)&&t.data[t.data.length-1]===co},So=function(t){return t&&t.hasAttribute("data-mce-caret")?(e=t.getElementsByTagName("br"),n=e[e.length-1],kn(n)&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n},ko=function(t){return go(t.startContainer)},Oo=zn,_o=Bn,To=Rn,Eo=En,Ao=xn(["script","style","textarea"]),Do=xn(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Mo=xn(["table"]),Ro=po,No=function(t){return!Ro(t)&&(Eo(t)?!Ao(t.parentNode):Do(t)||To(t)||Mo(t)||zo(t))},zo=function(t){return!1===function(t){return wn(t)&&"true"===t.getAttribute("unselectable")}(t)&&_o(t)},Bo=function(t,e){return No(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(zo(t))return!1;if(Oo(t))return!0}return!0}(t,e)},Po=/^[ \t\r\n]*$/,Io=function(t){return Po.test(t)},Lo=function(t,e){var n,r,o,i=ye.fromDom(e),u=ye.fromDom(t);return n=u,r="pre,code",o=E(Se,i),Fr(n,r,o).isSome()},Ho=function(t,e){return No(t)&&!1===function(t,e){return En(t)&&Io(t.data)&&!1===Lo(t,e)}(t,e)||function(t){return wn(t)&&"A"===t.nodeName&&!t.hasAttribute("href")&&(t.hasAttribute("name")||t.hasAttribute("id"))}(t)||Fo(t)},Fo=Sn("data-mce-bookmark"),Vo=Sn("data-mce-bogus"),jo=(br="data-mce-bogus",yr="all",function(t){return wn(t)&&t.getAttribute(br)===yr}),Uo=function(t,e){return void 0===e&&(e=!0),function(t,e){var n=0;if(Ho(t,t))return!1;var r=t.firstChild;if(!r)return!0;var o=new Yr(r,t);do{if(e){if(jo(r)){r=o.next(!0);continue}if(Vo(r)){r=o.next();continue}}if(Rn(r))n++,r=o.next();else{if(Ho(r,t))return!1;r=o.next()}}while(r);return n<=1}(t.dom,e)},Wo=function(t,e){return y(t)&&(Ho(t,e)||to(ye.fromDom(t)))},qo=function(t){return function(t){return"span"===t.nodeName.toLowerCase()}(t)&&"bookmark"===t.getAttribute("data-mce-type")},Go=function(t,e){return En(t)&&t.data.length>0&&function(t,e){var n=new Yr(t,e).prev(!1),r=new Yr(t,e).next(!1),o=v(n)||Wo(n,e),i=v(r)||Wo(r,e);return o&&i}(t,e)},$o=function(t,e,n){var r=n||e;if(wn(e)&&qo(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)$o(t,o[i],r);if(wn(e)){var u=e.childNodes;1===u.length&&qo(u[0])&&e.parentNode.insertBefore(u[0],e)}return function(t){return Mn(t)||Dn(t)}(e)||Ho(e,r)||function(t){return!!wn(t)&&t.childNodes.length>0}(e)||Go(e,r)||t.remove(e),e},Xo=ve.makeMap,Ko=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Yo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Jo=/[<>&\"\']/g,Qo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Zo={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},ti={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},ei={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},ni=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),ti[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},ri=ni("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),oi=function(t,e){return t.replace(e?Ko:Yo,(function(t){return ti[t]||t}))},ii=function(t,e){return t.replace(e?Ko:Yo,(function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":ti[t]||"&#"+t.charCodeAt(0)+";"}))},ui=function(t,e,n){return n=n||ri,t.replace(e?Ko:Yo,(function(t){return ti[t]||n[t]||t}))},ai={encodeRaw:oi,encodeAllRaw:function(t){return(""+t).replace(Jo,(function(t){return ti[t]||t}))},encodeNumeric:ii,encodeNamed:ui,getEncodeFunc:function(t,e){var n=ni(e)||ri,r=Xo(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?Ko:Yo,(function(t){return void 0!==ti[t]?ti[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return ui(t,e,n)}:ui:r.numeric?ii:oi},decode:function(t){return t.replace(Qo,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):Zo[e]||String.fromCharCode(e):ei[t]||ri[t]||function(t){var e=ye.fromTag("div").dom;return e.innerHTML=t,e.textContent||e.innerText||t}(t)}))}},ci={},si={},li=ve.makeMap,fi=ve.each,di=ve.extend,mi=ve.explode,gi=ve.inArray,hi=function(t,e){return(t=ve.trim(t))?t.split(e||" "):[]},pi=function(t,e){var n=li(t," ",li(t.toUpperCase()," "));return di(n,e)},vi=function(t){return pi("td th li dt dd figcaption caption details summary",t.getTextBlockElements())},bi=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),fi(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?li(t,/[, ]/):mi(t,/[, ]/)}))),n},yi=function(t){var e={},n={},r=[],o={},i={},u=function(e,n,r){var o=t[e];return o?o=li(o,/[, ]/,li(o.toUpperCase(),/[, ]/)):(o=ci[e])||(o=pi(n,r),ci[e]=o),o},a=function(t){var e,n,r,o,i,u,a={},c=function(t,n,r){var o,i,u,c=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};n=n||"","string"==typeof(r=r||[])&&(r=hi(r));var s=hi(t);for(o=s.length;o--;)u={attributes:c(i=hi([e,n].join(" "))),attributesOrder:i,children:c(r,si)},a[s[o]]=u},s=function(t,e){var n,r,o,i,u=hi(t);n=u.length;for(var c=hi(e);n--;)for(r=a[u[n]],o=0,i=c.length;o<i;o++)r.attributes[c[o]]={},r.attributesOrder.push(c[o])};return ci[t]?ci[t]:(e="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==t&&(e+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(e+=" xml:lang",r=[r,u="acronym applet basefont big font strike tt"].join(" "),fi(hi(u),(function(t){c(t,"",r)})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),fi(hi(i),(function(t){c(t,"",o)}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",r),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==t&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==t&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),fi(hi("a form meter progress dfn"),(function(t){a[t]&&delete a[t].children[t]})),delete a.caption.children.table,delete a.script,ci[t]=a,a)}((t=t||{}).schema);!1===t.verify_html&&(t.valid_elements="*[*]");var c=bi(t.valid_styles),s=bi(t.invalid_styles,"map"),l=bi(t.valid_classes,"map"),f=u("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=u("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=u("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=u("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),h=u("non_empty_elements","td th iframe video audio object script code pre",m),p=u("move_caret_before_on_enter_elements","td th iframe video audio object script code table",m),v=u("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"),b=u("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",v),y=u("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp");fi((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){i[t]=new RegExp("</"+t+"[^>]*>","gi")}));var w=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},x=function(t){var n,o,i,u,a,c,s,l,f,d,m,g,h,p,v,b,y,x,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(t){var O=hi(t,",");for(e["@"]&&(b=e["@"].attributes,y=e["@"].attributesOrder),n=0,o=O.length;n<o;n++)if(a=C.exec(O[n])){if(p=a[1],f=a[2],v=a[3],l=a[5],c={attributes:g={},attributesOrder:h=[]},"#"===p&&(c.paddEmpty=!0),"-"===p&&(c.removeEmpty=!0),"!"===a[4]&&(c.removeEmptyAttrs=!0),b&&(dt(b,(function(t,e){g[e]=t})),h.push.apply(h,y)),l)for(i=0,u=(l=hi(l,"|")).length;i<u;i++)if(a=S.exec(l[i])){if(s={},m=a[1],d=a[2].replace(/[\\:]:/g,":"),p=a[3],x=a[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],h.splice(gi(h,d),1);continue}p&&("="===p&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:x}),s.defaultValue=x),":"===p&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:x}),s.forcedValue=x),"<"===p&&(s.validValues=li(x,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=w(d),c.attributePatterns.push(s)):(g[d]||h.push(d),g[d]=s)}b||"@"!==f||(b=g,y=h),v&&(c.outputName=f,e[v]=c),k.test(f)?(c.pattern=w(f),r.push(c)):e[f]=c}}},C=function(t){e={},r=[],x(t),fi(a,(function(t,e){n[e]=t.children}))},S=function(t){var r=/^(~)?(.+)$/;t&&(ci.text_block_elements=ci.block_elements=null,fi(hi(t,","),(function(t){var i=r.exec(t),u="~"===i[1],a=u?"span":"div",c=i[2];if(n[c]=n[a],o[c]=a,u||(b[c.toUpperCase()]={},b[c]={}),!e[c]){var s=e[a];delete(s=di({},s)).removeEmptyAttrs,delete s.removeEmpty,e[c]=s}fi(n,(function(t,e){t[a]&&(n[e]=t=di({},n[e]),t[c]=t[a])}))})))},k=function(e){var r=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;ci[t.schema]=null,e&&fi(hi(e,","),(function(t){var e,o,i=r.exec(t);i&&(o=i[1],e=o?n[i[2]]:n[i[2]]={"#comment":{}},e=n[i[2]],fi(hi(i[3],"|"),(function(t){"-"===o?delete e[t]:e[t]={}})))}))},_=function(t){var n,o=e[t];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(t))return o};t.valid_elements?C(t.valid_elements):(fi(a,(function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children})),"html5"!==t.schema&&fi(hi("strong/b em/i"),(function(t){var n=hi(t,"/");e[n[1]].outputName=n[0]})),fi(y,(function(n,r){e[r]&&(t.padd_empty_block_inline_children&&(e[r].paddInEmptyBlock=!0),e[r].removeEmpty=!0)})),fi(hi("ol ul blockquote a table tbody"),(function(t){e[t]&&(e[t].removeEmpty=!0)})),fi(hi("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){e[t].paddEmpty=!0})),fi(hi("span"),(function(t){e[t].removeEmptyAttrs=!0}))),S(t.custom_elements),k(t.valid_children),x(t.extended_valid_elements),k("+ol[ul|ol],+ul[ul|ol]"),fi({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(function(t,n){e[n]&&(e[n].parentsRequired=hi(t))})),t.invalid_elements&&fi(mi(t.invalid_elements),(function(t){e[t]&&delete e[t]})),_("span")||x("span[!data-mce-type|*]");var T=O(c),E=O(s),A=O(l),D=O(g),M=O(b),R=O(v),N=O(y),z=O(m),B=O(d),P=O(h),I=O(p),L=O(f),H=O(i),F=O(o);return{children:n,elements:e,getValidStyles:T,getValidClasses:A,getBlockElements:M,getInvalidStyles:E,getShortEndedElements:z,getTextBlockElements:R,getTextInlineElements:N,getBoolAttrs:D,getElementRule:_,getSelfClosingElements:B,getNonEmptyElements:P,getMoveCaretBeforeOnEnterElements:I,getWhiteSpaceElements:L,getSpecialElements:H,isValidChild:function(t,e){var r=n[t.toLowerCase()];return!(!r||!r[e.toLowerCase()])},isValid:function(t,e){var n,r,o=_(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:F,addValidElements:x,setValidElements:C,addCustomElements:S,addValidChildren:k}},wi=function(t,e,n,r){var o=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},xi=function(t,e){var n,r,o,i=this,u=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,a=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,c=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,l={};t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var f="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<f.length;n++)l[f[n]]="\ufeff"+n,l["\ufeff"+n]=f[n];return{toHex:function(t){return t.replace(u,wi)},parse:function(e){var r,o,f,d,m,g,h,p,v={},b=t.url_converter,y=t.url_converter_scope||i,w=function(t,e,r){var o=v[t+"-top"+e];if(o){var i=v[t+"-right"+e];if(i){var u=v[t+"-bottom"+e];if(u){var a=v[t+"-left"+e];if(a){var c=[o,i,u,a];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(v[t+e]=-1===n?c[0]:c.join(" "),delete v[t+"-top"+e],delete v[t+"-right"+e],delete v[t+"-bottom"+e],delete v[t+"-left"+e])}}}}},x=function(t){var e,n=v[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return v[t]=n[0],!0}},C=function(t){return d=!0,l[t]},S=function(t,e){return d&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return l[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},k=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},O=function(t){return t.replace(/\\[0-9a-f]+/gi,k)},_=function(e,n,r,o,i,u){if(i=i||u)return"'"+(i=S(i)).replace(/\'/g,"\\'")+"'";if(n=S(n||r||o),!t.allow_script_urls){var a=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return b&&(n=b.call(y,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,C).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,C)}));r=c.exec(e);)if(c.lastIndex=r.index+r[0].length,o=r[1].replace(s,"").toLowerCase(),f=r[2].replace(s,""),o&&f){if(o=O(o),f=O(f),-1!==o.indexOf("\ufeff")||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(f)))continue;"font-weight"===o&&"700"===f?f="bold":"color"!==o&&"background-color"!==o||(f=f.toLowerCase()),f=(f=f.replace(u,wi)).replace(a,_),v[o]=d?S(f,!0):f}w("border","",!0),w("border","-width"),w("border","-color"),w("border","-style"),w("padding",""),w("margin",""),m="border",h="border-style",p="border-color",x(g="border-width")&&x(h)&&x(p)&&(v[m]=v[g]+" "+v[h]+" "+v[p],delete v[g],delete v[h],delete v[p]),"medium none"===v.border&&delete v.border,"none"===v["border-image"]&&delete v["border-image"]}return v},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var u=0,a=i.length;u<a;u++)e=i[u],(o=t[e])&&(n+=(n.length>0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):dt(t,(function(t,r){!t||o&&!function(t,e){var n=o["*"];return(!n||!n[t])&&!((n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},Ci={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Si=function(t){return t instanceof Event||w(t.initEvent)},ki=function(t,e,n,r){var o,i=function(t,e){var n=null!=e?e:{};for(var r in t)wt(Ci,r)||(n[r]=t[r]);return y(n.composedPath)&&(n.composedPath=function(){return t.composedPath()}),n}(e,r);return i.type=t,b(i.target)&&(i.target=null!==(o=i.srcElement)&&void 0!==o?o:n),function(t){return b(t.preventDefault)||Si(t)}(e)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=N,w(e.preventDefault)?e.preventDefault():Si(e)&&(e.returnValue=!1)},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=N,w(e.stopPropagation)?e.stopPropagation():Si(e)&&(e.cancelBubble=!0)},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=N,i.stopPropagation()},function(t){return t.isDefaultPrevented===N||t.isDefaultPrevented===R}(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?N:R,i.isPropagationStopped=!0===i.cancelBubble?N:R,i.isImmediatePropagationStopped=R)),i},Oi=/^(?:mouse|contextmenu)|click/,_i=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},Ti=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},Ei=function(t,e){var n=ki(t.type,t,document,e);if(function(t){return y(t)&&Oi.test(t.type)}(t)&&v(t.pageX)&&!v(t.clientX)){var r=n.target.ownerDocument||document,o=r.documentElement,i=r.body,u=n;u.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),u.pageY=t.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)}return v(n.metaKey)&&(n.metaKey=!1),n},Ai=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){Ti(t,"DOMContentLoaded",i),Ti(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():_i(t,"DOMContentLoaded",i),n.domLoaded||_i(t,"load",i)}},Di=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}return t.prototype.bind=function(t,e,n,r){var o,i,u,a,c,s,l,f=this,d=window,m=function(t){f.executeHandlers(Ei(t||d.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?o=t[f.expando]:(o=f.count++,t[f.expando]=o,f.events[o]={}),r=r||t;var g=e.split(" ");for(u=g.length;u--;)s=m,c=l=!1,"DOMContentLoaded"===(a=g[u])&&(a="ready"),f.domLoaded&&"ready"===a&&"complete"===t.readyState?n.call(r,Ei({type:a})):(f.hasMouseEnterLeave||(c=f.mouseEnterLeave[a])&&(s=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=Ei(t||d.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,o))}),f.hasFocusIn||"focusin"!==a&&"focusout"!==a||(l=!0,c="focusin"===a?"focus":"blur",s=function(t){(t=Ei(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][a])?"ready"===a&&f.domLoaded?n(Ei({type:a})):i.push({func:n,scope:r}):(f.events[o][a]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=l,i.nativeHandler=s,"ready"===a?Ai(t,s,f):_i(t,c||a,s,l)));return t=i=null,n}},t.prototype.unbind=function(t,e,n){var r,o,i,u,a;if(!t||3===t.nodeType||8===t.nodeType)return this;var c=t[this.expando];if(c){if(a=this.events[c],e){var s=e.split(" ");for(o=s.length;o--;)if(r=a[u=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var l=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=l,r.fakeName=f,r.capture=d,a[u]=r}n&&0!==r.length||(delete a[u],Ti(t,r.fakeName||u,r.nativeHandler,r.capture))}}else dt(a,(function(e,n){Ti(t,e.fakeName||n,e.nativeHandler,e.capture)})),a={};for(u in a)if(wt(a,u))return this;delete this.events[c];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=Ei({type:e,target:t},n);do{(r=t[this.expando])&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var u=r[o];if(u&&!1===u.func.call(u.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),Mi="sizzle"+-new Date,Ri=window.document,Ni=0,zi=0,Bi=du(),Pi=du(),Ii=du(),Li=function(t,e){return t===e&&(Ar=!0),0},Hi={}.hasOwnProperty,Fi=[],Vi=Fi.pop,ji=Fi.push,Ui=Fi.push,Wi=Fi.slice,qi=Fi.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},Gi="[\\x20\\t\\r\\n\\f]",$i="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Xi="\\["+Gi+"*("+$i+")(?:"+Gi+"*([*^$|!~]?=)"+Gi+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+$i+"))|)"+Gi+"*\\]",Ki=":("+$i+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Xi+")*)|.*)\\)|)",Yi=new RegExp("^"+Gi+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Gi+"+$","g"),Ji=new RegExp("^"+Gi+"*,"+Gi+"*"),Qi=new RegExp("^"+Gi+"*([>+~]|"+Gi+")"+Gi+"*"),Zi=new RegExp("="+Gi+"*([^\\]'\"]*?)"+Gi+"*\\]","g"),tu=new RegExp(Ki),eu=new RegExp("^"+$i+"$"),nu={ID:new RegExp("^#("+$i+")"),CLASS:new RegExp("^\\.("+$i+")"),TAG:new RegExp("^("+$i+"|[*])"),ATTR:new RegExp("^"+Xi),PSEUDO:new RegExp("^"+Ki),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Gi+"*(even|odd|(([+-]|)(\\d*)n|)"+Gi+"*(?:([+-]|)"+Gi+"*(\\d+)|))"+Gi+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+Gi+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Gi+"*((?:-\\d)?\\d*)"+Gi+"*\\)|)(?=[^-]|$)","i")},ru=/^(?:input|select|textarea|button)$/i,ou=/^h\d$/i,iu=/^[^{]+\{\s*\[native \w/,uu=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,au=/[+~]/,cu=/'|\\/g,su=new RegExp("\\\\([\\da-f]{1,6}"+Gi+"?|("+Gi+")|.)","ig"),lu=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Ui.apply(Fi=Wi.call(Ri.childNodes),Ri.childNodes),Fi[Ri.childNodes.length].nodeType}catch(t){Ui={apply:Fi.length?function(t,e){ji.apply(t,Wi.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var fu=function(t,e,n,r){var o,i,u,a,c,s,l,f,d,m;if((e?e.ownerDocument||e:Ri)!==Mr&&Dr(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(a=(e=e||Mr).nodeType)&&9!==a)return[];if(Nr&&!r){if(o=uu.exec(t))if(u=o[1]){if(9===a){if(!(i=e.getElementById(u))||!i.parentNode)return n;if(i.id===u)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(u))&&Pr(e,i)&&i.id===u)return n.push(i),n}else{if(o[2])return Ui.apply(n,e.getElementsByTagName(t)),n;if((u=o[3])&&wr.getElementsByClassName)return Ui.apply(n,e.getElementsByClassName(u)),n}if(wr.qsa&&(!zr||!zr.test(t))){if(f=l=Mi,d=e,m=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){for(s=kr(t),(l=e.getAttribute("id"))?f=l.replace(cu,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+bu(s[c]);d=au.test(t)&&pu(e.parentNode)||e,m=s.join(",")}if(m)try{return Ui.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{l||e.removeAttribute("id")}}}return _r(t.replace(Yi,"$1"),e,n,r)};function du(){var t=[];return function e(n,r){return t.push(n+" ")>xr.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function mu(t){return t[Mi]=!0,t}function gu(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||1<<31)-(~t.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function hu(t){return mu((function(e){return e=+e,mu((function(n,r){for(var o,i=t([],n.length,e),u=i.length;u--;)n[o=i[u]]&&(n[o]=!(r[o]=n[o]))}))}))}function pu(t){return t&&void 0!==t.getElementsByTagName&&t}function vu(){}function bu(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function yu(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=zi++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,u){var a,c,s=[Ni,i];if(u){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,u))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((a=(c=e[Mi]||(e[Mi]={}))[r])&&a[0]===Ni&&a[1]===i)return s[2]=a[2];if(c[r]=s,s[2]=t(e,n,u))return!0}}}function wu(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function xu(t,e,n,r,o){for(var i,u=[],a=0,c=t.length,s=null!=e;a<c;a++)(i=t[a])&&(n&&!n(i,r,o)||(u.push(i),s&&e.push(a)));return u}function Cu(t,e,n,r,o,i){return r&&!r[Mi]&&(r=Cu(r)),o&&!o[Mi]&&(o=Cu(o,i)),mu((function(i,u,a,c){var s,l,f,d=[],m=[],g=u.length,h=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)fu(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),p=!t||!i&&e?h:xu(h,d,t,a,c),v=n?o||(i?t:g||r)?[]:u:p;if(n&&n(p,v,a,c),r)for(s=xu(v,m),r(s,[],a,c),l=s.length;l--;)(f=s[l])&&(v[m[l]]=!(p[m[l]]=f));if(i){if(o||t){if(o){for(s=[],l=v.length;l--;)(f=v[l])&&s.push(p[l]=f);o(null,v=[],s,c)}for(l=v.length;l--;)(f=v[l])&&(s=o?qi.call(i,f):d[l])>-1&&(i[s]=!(u[s]=f))}}else v=xu(v===u?v.splice(g,v.length):v),o?o(null,u,v,c):Ui.apply(u,v)}))}function Su(t){for(var e,n,r,o=t.length,i=xr.relative[t[0].type],u=i||xr.relative[" "],a=i?1:0,c=yu((function(t){return t===e}),u,!0),s=yu((function(t){return qi.call(e,t)>-1}),u,!0),l=[function(t,n,r){var o=!i&&(r||n!==Tr)||((e=n).nodeType?c(t,n,r):s(t,n,r));return e=null,o}];a<o;a++)if(n=xr.relative[t[a].type])l=[yu(wu(l),n)];else{if((n=xr.filter[t[a].type].apply(null,t[a].matches))[Mi]){for(r=++a;r<o&&!xr.relative[t[r].type];r++);return Cu(a>1&&wu(l),a>1&&bu(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(Yi,"$1"),n,a<r&&Su(t.slice(a,r)),r<o&&Su(t=t.slice(r)),r<o&&bu(t))}l.push(n)}return wu(l)}wr=fu.support={},Sr=fu.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},Dr=fu.setDocument=function(t){var e,n=t?t.ownerDocument||t:Ri,r=n.defaultView;return n!==Mr&&9===n.nodeType&&n.documentElement?(Mr=n,Rr=n.documentElement,Nr=!Sr(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){Dr()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){Dr()}))),wr.attributes=!0,wr.getElementsByTagName=!0,wr.getElementsByClassName=iu.test(n.getElementsByClassName),wr.getById=!0,xr.find.ID=function(t,e){if(void 0!==e.getElementById&&Nr){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},xr.filter.ID=function(t){var e=t.replace(su,lu);return function(t){return t.getAttribute("id")===e}},xr.find.TAG=wr.getElementsByTagName?function(t,e){if(void 0!==e.getElementsByTagName)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},xr.find.CLASS=wr.getElementsByClassName&&function(t,e){if(Nr)return e.getElementsByClassName(t)},Br=[],zr=[],wr.disconnectedMatch=!0,zr=zr.length&&new RegExp(zr.join("|")),Br=Br.length&&new RegExp(Br.join("|")),e=iu.test(Rr.compareDocumentPosition),Pr=e||iu.test(Rr.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Li=e?function(t,e){if(t===e)return Ar=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!wr.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===Ri&&Pr(Ri,t)?-1:e===n||e.ownerDocument===Ri&&Pr(Ri,e)?1:Er?qi.call(Er,t)-qi.call(Er,e):0:4&r?-1:1)}:function(t,e){if(t===e)return Ar=!0,0;var r,o=0,i=t.parentNode,u=e.parentNode,a=[t],c=[e];if(!i||!u)return t===n?-1:e===n?1:i?-1:u?1:Er?qi.call(Er,t)-qi.call(Er,e):0;if(i===u)return gu(t,e);for(r=t;r=r.parentNode;)a.unshift(r);for(r=e;r=r.parentNode;)c.unshift(r);for(;a[o]===c[o];)o++;return o?gu(a[o],c[o]):a[o]===Ri?-1:c[o]===Ri?1:0},n):Mr},fu.matches=function(t,e){return fu(t,null,null,e)},fu.matchesSelector=function(t,e){if((t.ownerDocument||t)!==Mr&&Dr(t),e=e.replace(Zi,"='$1']"),wr.matchesSelector&&Nr&&(!Br||!Br.test(e))&&(!zr||!zr.test(e)))try{var n=(void 0).call(t,e);if(n||wr.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return fu(e,Mr,null,[t]).length>0},fu.contains=function(t,e){return(t.ownerDocument||t)!==Mr&&Dr(t),Pr(t,e)},fu.attr=function(t,e){(t.ownerDocument||t)!==Mr&&Dr(t);var n=xr.attrHandle[e.toLowerCase()],r=n&&Hi.call(xr.attrHandle,e.toLowerCase())?n(t,e,!Nr):void 0;return void 0!==r?r:wr.attributes||!Nr?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},fu.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},fu.uniqueSort=function(t){var e,n=[],r=0,o=0;if(Ar=!wr.detectDuplicates,Er=!wr.sortStable&&t.slice(0),t.sort(Li),Ar){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return Er=null,t},Cr=fu.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=Cr(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=Cr(e);return n},(xr=fu.selectors={cacheLength:50,createPseudo:mu,match:nu,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(su,lu),t[3]=(t[3]||t[4]||t[5]||"").replace(su,lu),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||fu.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&fu.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return nu.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&tu.test(n)&&(e=kr(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(su,lu).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Bi[t+" "];return e||(e=new RegExp("(^|"+Gi+")"+t+"("+Gi+"|$)"))&&Bi(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=fu.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),u="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,l,f,d,m,g,h=i!==u?"nextSibling":"previousSibling",p=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!c&&!a;if(p){if(i){for(;h;){for(f=e;f=f[h];)if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;g=h="only"===t&&!g&&"nextSibling"}return!0}if(g=[u?p.firstChild:p.lastChild],u&&b){for(m=(s=(l=p[Mi]||(p[Mi]={}))[t]||[])[0]===Ni&&s[1],d=s[0]===Ni&&s[2],f=m&&p.childNodes[m];f=++m&&f&&f[h]||(d=m=0)||g.pop();)if(1===f.nodeType&&++d&&f===e){l[t]=[Ni,m,d];break}}else if(b&&(s=(e[Mi]||(e[Mi]={}))[t])&&s[0]===Ni)d=s[1];else for(;(f=++m&&f&&f[h]||(d=m=0)||g.pop())&&((a?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[Mi]||(f[Mi]={}))[t]=[Ni,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=xr.pseudos[t]||xr.setFilters[t.toLowerCase()]||fu.error("unsupported pseudo: "+t);return r[Mi]?r(e):r.length>1?(n=[t,t,"",e],xr.setFilters.hasOwnProperty(t.toLowerCase())?mu((function(t,n){for(var o,i=r(t,e),u=i.length;u--;)t[o=qi.call(t,i[u])]=!(n[o]=i[u])})):function(t){return r(t,0,n)}):r}},pseudos:{not:mu((function(t){var e=[],n=[],r=Or(t.replace(Yi,"$1"));return r[Mi]?mu((function(t,e,n,o){for(var i,u=r(t,null,o,[]),a=t.length;a--;)(i=u[a])&&(t[a]=!(e[a]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}})),has:mu((function(t){return function(e){return fu(t,e).length>0}})),contains:mu((function(t){return t=t.replace(su,lu),function(e){return(e.textContent||e.innerText||Cr(e)).indexOf(t)>-1}})),lang:mu((function(t){return eu.test(t||"")||fu.error("unsupported lang: "+t),t=t.replace(su,lu).toLowerCase(),function(e){var n;do{if(n=Nr?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===Rr},focus:function(t){return t===Mr.activeElement&&(!Mr.hasFocus||Mr.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!xr.pseudos.empty(t)},header:function(t){return ou.test(t.nodeName)},input:function(t){return ru.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:hu((function(){return[0]})),last:hu((function(t,e){return[e-1]})),eq:hu((function(t,e,n){return[n<0?n+e:n]})),even:hu((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:hu((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:hu((function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t})),gt:hu((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=xr.pseudos.eq,q(["radio","checkbox","file","password","image"],(function(t){xr.pseudos[t]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(t)})),q(["submit","reset"],(function(t){xr.pseudos[t]=function(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}(t)})),vu.prototype=xr.filters=xr.pseudos,xr.setFilters=new vu,kr=fu.tokenize=function(t,e){var n,r,o,i,u,a,c,s=Pi[t+" "];if(s)return e?0:s.slice(0);for(u=t,a=[],c=xr.preFilter;u;){for(i in n&&!(r=Ji.exec(u))||(r&&(u=u.slice(r[0].length)||u),a.push(o=[])),n=!1,(r=Qi.exec(u))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Yi," ")}),u=u.slice(n.length)),xr.filter)xr.filter.hasOwnProperty(i)&&(!(r=nu[i].exec(u))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),u=u.slice(n.length)));if(!n)break}return e?u.length:u?fu.error(t):Pi(t,a).slice(0)},Or=fu.compile=function(t,e){var n,r=[],o=[],i=Ii[t+" "];if(!i){for(e||(e=kr(t)),n=e.length;n--;)(i=Su(e[n]))[Mi]?r.push(i):o.push(i);(i=Ii(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,u,a,c){var s,l,f,d=0,m="0",g=o&&[],h=[],p=Tr,v=o||r&&xr.find.TAG("*",c),b=Ni+=null==p?1:Math.random()||.1,y=v.length;for(c&&(Tr=i!==Mr&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){for(l=0;f=t[l++];)if(f(s,i,u)){a.push(s);break}c&&(Ni=b)}n&&((s=!f&&s)&&d--,o&&g.push(s))}if(d+=m,n&&m!==d){for(l=0;f=e[l++];)f(g,h,i,u);if(o){if(d>0)for(;m--;)g[m]||h[m]||(h[m]=Vi.call(a));h=xu(h)}Ui.apply(a,h),c&&!o&&h.length>0&&d+e.length>1&&fu.uniqueSort(a)}return c&&(Ni=b,Tr=p),g};return n?mu(o):o}(o,r))).selector=t}return i},_r=fu.select=function(t,e,n,r){var o,i,u,a,c,s="function"==typeof t&&t,l=!r&&kr(t=s.selector||t);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(u=i[0]).type&&wr.getById&&9===e.nodeType&&Nr&&xr.relative[i[1].type]){if(!(e=(xr.find.ID(u.matches[0].replace(su,lu),e)||[])[0]))return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=nu.needsContext.test(t)?0:i.length;o--&&(u=i[o],!xr.relative[a=u.type]);)if((c=xr.find[a])&&(r=c(u.matches[0].replace(su,lu),au.test(i[0].type)&&pu(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&bu(i)))return Ui.apply(n,r),n;break}}return(s||Or(t,l))(r,e,!Nr,n,au.test(t)&&pu(e.parentNode)||e),n},wr.sortStable=Mi.split("").sort(Li).join("")===Mi,wr.detectDuplicates=!!Ar,Dr(),wr.sortDetached=!0;var ku=document,Ou=Array.prototype.push,_u=Array.prototype.slice,Tu=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Eu=Di.Event,Au=ve.makeMap("children,contents,next,prev"),Du=function(t){return void 0!==t},Mu=function(t){return"string"==typeof t},Ru=function(t,e){var n,r=(e=e||ku).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},Nu=function(t,e,n,r){var o;if(Mu(e))e=Ru(e,$u(t[0]));else if(e.length&&!e.nodeType){if(e=Ju.makeArray(e),r)for(o=e.length-1;o>=0;o--)Nu(t,e[o],n,r);else for(o=0;o<e.length;o++)Nu(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},zu=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},Bu=function(t,e,n){var r,o;return e=Ju(e)[0],t.each((function(){n&&r===this.parentNode?o.appendChild(this):(r=this.parentNode,o=e.cloneNode(!1),this.parentNode.insertBefore(o,this),o.appendChild(this))})),t},Pu=ve.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Iu=ve.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Lu={for:"htmlFor",class:"className",readonly:"readOnly"},Hu={float:"cssFloat"},Fu={},Vu={},ju=function(t,e){return new Ju.fn.init(t,e)},Uu=/^\s*|\s*$/g,Wu=function(t){return null==t?"":(""+t).replace(Uu,"")},qu=function(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t},Gu=function(t,e){var n=[];return qu(t,(function(t,r){e(r,t)&&n.push(r)})),n},$u=function(t){return t?9===t.nodeType?t:t.ownerDocument:ku};ju.fn=ju.prototype={constructor:ju,selector:"",context:null,length:0,init:function(t,e){var n,r;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if(e&&e.nodeType)this.context=e;else{if(e)return Ju(t).attr(e);this.context=e=document}if(Mu(t)){if(this.selector=t,!(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:Tu.exec(t)))return Ju(e).find(t);if(n[1])for(r=Ru(t,$u(e)).firstChild;r;)Ou.call(this,r),r=r.nextSibling;else{if(!(r=$u(e).getElementById(n[2])))return this;if(r.id!==n[2])return this.find(t);this.length=1,this[0]=r}}else this.add(t,!1);return this},toArray:function(){return ve.toArray(this)},add:function(t,e){var n,r;if(Mu(t))return this.add(Ju(t));if(!1!==e)for(n=Ju.unique(this.toArray().concat(Ju.makeArray(t))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else Ou.apply(this,Ju.makeArray(t));return this},attr:function(t,e){var n,r=this;if("object"==typeof t)qu(t,(function(t,e){r.attr(t,e)}));else{if(!Du(e)){if(r[0]&&1===r[0].nodeType){if((n=Fu[t])&&n.get)return n.get(r[0],t);if(Iu[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each((function(){var n;if(1===this.nodeType){if((n=Fu[t])&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==typeof(t=Lu[t]||t))qu(t,(function(t,e){n.prop(t,e)}));else{if(!Du(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))},u=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))};if("object"==typeof t)qu(t,(function(t,e){o.css(t,e)}));else if(Du(e))t=i(t),"number"!=typeof e||Pu[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if((r=Vu[t])&&r.set)r.set(this,e);else{try{this.style[Hu[t]||t]=e}catch(t){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(u(t)):n.removeAttribute(t))}}));else{if(n=o[0],(r=Vu[t])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(u(t))}catch(t){return}}return o},remove:function(){for(var t,e=this.length;e--;)t=this[e],Eu.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e;if(Du(t)){e=this.length;try{for(;e--;)this[e].innerHTML=t}catch(n){Ju(this[e]).empty().append(t)}return this}return this[0]?this[0].innerHTML:""},text:function(t){var e;if(Du(t)){for(e=this.length;e--;)"innerText"in this[e]?this[e].innerText=t:this[0].textContent=t;return this}return this[0]?this[0].innerText||this[0].textContent:""},append:function(){return Nu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return Nu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){var t=this;return t[0]&&t[0].parentNode?Nu(t,arguments,(function(t){this.parentNode.insertBefore(t,this)})):t},after:function(){var t=this;return t[0]&&t[0].parentNode?Nu(t,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):t},appendTo:function(t){return Ju(t).append(this),this},prependTo:function(t){return Ju(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return Bu(this,t)},wrapAll:function(t){return Bu(this,t,!0)},wrapInner:function(t){return this.each((function(){Ju(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){Ju(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),Ju(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t?n:(-1!==t.indexOf(" ")?qu(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o=zu(r,t);if(o!==e){var i=r.className;o?r.className=Wu((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}})),n)},hasClass:function(t){return zu(this[0],t)},each:function(t){return qu(this,t)},on:function(t,e){return this.each((function(){Eu.bind(this,t,e)}))},off:function(t,e){return this.each((function(){Eu.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"==typeof t?Eu.fire(this,t.type,t):Eu.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return Ju(_u.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)Ju.find(t,this[e],r);return Ju(r)},filter:function(t){return Ju("function"==typeof t?Gu(this.toArray(),(function(e,n){return t(n,e)})):Ju.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof Ju&&(t=t[0]),this.each((function(n,r){for(;r;){if("string"==typeof t&&Ju(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),Ju(e)},offset:function(t){var e,n,r,o,i=0,u=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,u=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:u})},push:Ou,sort:Array.prototype.sort,splice:Array.prototype.splice},ve.extend(ju,{extend:ve.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:ve.toArray(t);var e},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:ve.isArray,each:qu,trim:Wu,grep:Gu,find:fu,expr:fu.selectors,unique:fu.uniqueSort,text:fu.getText,contains:fu.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return e=1===e.length?Ju.find.matchesSelector(e[0],t)?[e[0]]:[]:Ju.find.matches(t,e)}});var Xu=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof Ju&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&Ju(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},Ku=function(t,e,n,r){var o=[];for(r instanceof Ju&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&Ju(t).is(r))break}o.push(t)}return o},Yu=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};qu({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Xu(t,"parentNode")},next:function(t){return Yu(t,"nextSibling",1)},prev:function(t){return Yu(t,"previousSibling",1)},children:function(t){return Ku(t.firstChild,"nextSibling",1)},contents:function(t){return ve.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){ju.fn[t]=function(n){var r=[];this.each((function(){var t=e.call(r,this,n,r);t&&(Ju.isArray(t)?r.push.apply(r,t):r.push(t))})),this.length>1&&(Au[t]||(r=Ju.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=Ju(r);return n?o.filter(n):o}})),qu({parentsUntil:function(t,e){return Xu(t,"parentNode",e)},nextUntil:function(t,e){return Ku(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return Ku(t,"previousSibling",1,e).slice(1)}},(function(t,e){ju.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(Ju.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(o=Ju.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=Ju(o);return r?i.filter(r):i}})),ju.fn.is=function(t){return!!t&&this.filter(t).length>0},ju.fn.init.prototype=ju.fn,ju.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return Ju.extend(n,this),n},ju.attrHooks=Fu,ju.cssHooks=Vu;var Ju=ju,Qu=ve.each,Zu=ve.grep,ta=de.ie,ea=/^([a-z0-9],?)+$/i,na=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},ra=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o},oa=function(t,e){void 0===e&&(e={});var n={},r=window,o={},i=0,u=Kr.forElement(ye.fromDom(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),a=[],c=e.schema?e.schema:yi({}),s=xi({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),l=e.ownEvents?new Di:Di.Event,f=c.getBlockElements(),m=Ju.overrideDefaults((function(){return{context:t,element:U.getRoot()}})),g=function(e){return e&&t&&d(e)?t.getElementById(e):e},h=function(t){return m("string"==typeof t?g(t):t)},p=function(t,e,n){var r,o,i=h(t);return i.length&&(o=(r=W[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},v=function(t){var e=g(t);return e?e.attributes:[]},y=function(t,n,r){""===r&&(r=null);var o=h(t),i=o.attr(n);if(o.length){var u=W[n];u&&u.set?u.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},w=function(){return e.root_element||t.body},x=function(e,n){return er(t.body,g(e),n)},S=function(t,e,n){var r=h(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})))&&(e=de.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},k=function(t){var e,n;return t=g(t),e=S(t,"width"),n=S(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},_=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(ea.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return fu(e,i[0].ownerDocument||i[0],null,i).length>0},T=function(t,e,n,r){var o,i=[],u=g(t);for(r=void 0===r,n=n||("BODY"!==w().nodeName?w().parentNode:null),ve.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return _(t,o)});u&&!(u===n||b(u.nodeType)||Dn(u)||Mn(u));){if(!e||"function"==typeof e&&e(u)){if(!r)return[u];i.push(u)}u=u.parentNode}return r?i:null},E=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return _(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},A=function(t,e,n){var r,o="string"==typeof t?g(t):t;if(!o)return!1;if(ve.isArray(o)&&(o.length||0===o.length))return r=[],Qu(o,(function(t,o){t&&r.push(e.call(n,"string"==typeof t?g(t):t,o))})),r;var i=n||this;return e.call(i,o)},D=function(t,e){h(t).each((function(t,n){Qu(e,(function(t,e){y(n,e,t)}))}))},M=function(t,e){var n=h(t);ta?n.each((function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(t){Ju("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},R=function(e,n,r,o,i){return A(e,(function(e){var u="string"==typeof n?t.createElement(n):n;return D(u,r),o&&("string"!=typeof o&&o.nodeType?u.appendChild(o):"string"==typeof o&&M(u,o)),i?u:e.appendChild(u)}))},N=function(e,n,r){return R(t.createElement(e),e,n,r,!0)},z=ai.encodeAllRaw,B=function(t,e){var n=h(t);return e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},P=function(t,e,n){h(t).toggleClass(e,n).each((function(){""===this.className&&Ju(this).attr("class",null)}))},I=function(t,e,n){return A(e,(function(e){return ve.is(e,"array")&&(t=t.cloneNode(!0)),n&&Qu(Zu(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},L=function(t){if(wn(t)){var e="a"===t.nodeName.toLowerCase()&&!p(t,"href")&&p(t,"id");if(p(t,"name")||p(t,"data-mce-bookmark")||e)return!0}return!1},H=function(){return t.createRange()},F=function(n,o,i,u){if(ve.isArray(n)){for(var c=n.length,s=[];c--;)s[c]=F(n[c],o,i,u);return s}return!e.collect||n!==t&&n!==r||a.push([n,o,i,u]),l.bind(n,o,i,u||U)},V=function(e,n,o){if(ve.isArray(e)){for(var i=e.length,u=[];i--;)u[i]=V(e[i],n,o);return u}if(a.length>0&&(e===t||e===r))for(i=a.length;i--;){var c=a[i];e!==c[0]||n&&n!==c[1]||o&&o!==c[2]||l.unbind(c[0],c[1],c[2])}return l.unbind(e,n,o)},j=function(t){if(t&&wn(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},U={doc:t,settings:e,win:r,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:u,boundEvents:a,styles:s,schema:c,events:l,isBlock:function(t){if("string"==typeof t)return!!f[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!f[t.nodeName])}return!1},$:m,$$:h,root:null,clone:function(e,n){if(!ta||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return Qu(v(e),(function(t){y(r,t.nodeName,p(e,t.nodeName))})),r},getRoot:w,getViewPort:function(t){var e=vn(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=g(t);var e=x(t),n=k(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:k,getParent:function(t,e,n){var r=T(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:T,get:g,getNext:function(t,e){return E(t,e,"nextSibling")},getPrev:function(t,e){return E(t,e,"previousSibling")},select:function(n,r){return fu(n,g(r)||e.root_element||t,[])},is:_,add:R,create:N,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)xt(e,r)&&(o+=" "+r+'="'+z(e[r])+'"');return void 0!==n?o+">"+n+"</"+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:B,setStyle:function(t,n,r){var o=d(n)?h(t).css(n,r):h(t).css(n);e.update_styles&&na(s,o)},getStyle:S,setStyles:function(t,n){var r=h(t).css(n);e.update_styles&&na(s,r)},removeAllAttribs:function(t){return A(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},setAttrib:y,setAttribs:D,getAttrib:p,getPos:x,parseStyle:function(t){return s.parse(t)},serializeStyle:function(t,e){return s.serialize(t,e)},addStyle:function(e){var r,o;if(U!==oa.DOM&&t===document){if(n[e])return;n[e]=!0}(o=t.getElementById("mceDefaultStyles"))||((o=t.createElement("style")).id="mceDefaultStyles",o.type="text/css",(r=t.getElementsByTagName("head")[0]).firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(t.createTextNode(e))},loadCSS:function(t){t||(t=""),q(t.split(","),(function(t){o[t]=!0,u.load(t,C)}))},addClass:function(t,e){h(t).addClass(e)},removeClass:function(t,e){P(t,e,!1)},hasClass:function(t,e){return h(t).hasClass(e)},toggleClass:P,show:function(t){h(t).show()},hide:function(t){h(t).hide()},isHidden:function(t){return"none"===h(t).css("display")},uniqueId:function(t){return(t||"mce_")+i++},setHTML:M,getOuterHTML:function(t){var e="string"==typeof t?g(t):t;return wn(e)?e.outerHTML:Ju("<div></div>").append(Ju(e).clone()).html()},setOuterHTML:function(t,e){h(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}B(Ju(this).html(e),!0)}))},decode:ai.decode,encode:z,insertAfter:function(t,e){var n=g(e);return A(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:I,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=N(e),Qu(v(t),(function(e){y(n,e.nodeName,p(t,e.nodeName))})),I(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return s.toHex(ve.trim(t))},run:A,getAttribs:v,isEmpty:function(t,e){var n,r,o=0;if(L(t))return!1;if(t=t.firstChild){var i=new Yr(t,t.parentNode),u=c?c.getWhiteSpaceElements():{};e=e||(c?c.getNonEmptyElements():null);do{if(n=t.nodeType,wn(t)){var a=t.getAttribute("data-mce-bogus");if(a){t=i.next("all"===a);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(L(t))return!1}if(8===n)return!1;if(3===n&&!Io(t.nodeValue))return!1;if(3===n&&t.parentNode&&u[t.parentNode.nodeName]&&Io(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:H,nodeIndex:ra,split:function(t,e,n){var r,o,i,u=H();if(t&&e)return u.setStart(t.parentNode,ra(t)),u.setEnd(e.parentNode,ra(e)),r=u.extractContents(),(u=H()).setStart(e.parentNode,ra(e)+1),u.setEnd(t.parentNode,ra(t)+1),o=u.extractContents(),(i=t.parentNode).insertBefore($o(U,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore($o(U,o),t),B(t),n||e},bind:F,unbind:V,fire:function(t,e,n){return l.fire(t,e,n)},getContentEditable:j,getContentEditableParent:function(t){for(var e=w(),n=null;t&&t!==e&&null===(n=j(t));t=t.parentNode);return n},destroy:function(){if(a.length>0)for(var t=a.length;t--;){var e=a[t];l.unbind(e[0],e[1],e[2])}dt(o,(function(t,e){u.unload(e),delete o[e]})),fu.setDocument&&fu.setDocument()},isChildOf:function(t,e){if(ta){for(;t;){if(e===t)return!0;t=t.parentNode}return!1}return t===e||e.contains(t)},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},W=function(t,e,n){var r=e.keep_values,o={set:function(t,r,o){e.url_converter&&null!==r&&(r=e.url_converter.call(e.url_converter_scope||n(),r,o,t[0])),t.attr("data-mce-"+o,r).attr(o,r)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return n=t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(s,e,O(U));return U};oa.DOM=oa(document),oa.nodeIndex=ra;var ia=oa.DOM,ua=ve.each,aa=ve.grep,ca=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,n){var r,o=ia,i=function(){o.remove(u),r&&(r.onerror=r.onload=r=null)},u=o.uniqueId();(r=document.createElement("script")).id=u,r.type="text/javascript",r.src=ve._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),e()},r.onerror=function(){i(),w(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)},t.prototype.isDone=function(t){return 2===this.states[t]},t.prototype.markDone=function(t){this.states[t]=2},t.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],u=function(t,e){ua(o.scriptLoadedCallbacks[e],(function(e){w(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var a=function(){var e=aa(t);if(t.length=0,ua(e,(function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,(function(){o.states[t]=2,o.loading--,u("success",t),a()}),(function(){o.states[t]=3,o.loading--,i.push(t),u("failure",t),a()}))):u("failure",t):u("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,ua(n,(function(t){0===i.length?w(t.success)&&t.success.call(t.scope):w(t.failure)&&t.failure.call(t.scope,i)}))}};a()},t.ScriptLoader=new t,t}(),sa=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},la={},fa=sa("en"),da=function(){return yt(la,fa.get())},ma={getData:function(){return mt(la,(function(t){return Dt({},t)}))},setCode:function(t){t&&fa.set(t)},getCode:function(){return fa.get()},add:function(t,e){var n=la[t];n||(la[t]=n={}),dt(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=da().getOr({}),r=function(t){return w(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null==t},i=function(t){var e=r(t);return yt(n,e.toLowerCase()).map(r).getOr(e)},u=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(m(e=t)&&wt(e,"raw"))return r(t.raw);if(function(t){return g(t)&&t.length>1}(t)){var a=t.slice(1);return u(i(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return wt(a,e)?r(a[e]):t})))}return u(i(t))},isRtl:function(){return da().bind((function(t){return yt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return wt(la,t)}},ga=function(){var t=[],e={},n={},r=[],o=function(t,e){var n=X(r,(function(n){return n.name===t&&n.state===e}));q(n,(function(t){return t.callback()}))},i=function(t){var e;return n[t]&&(e=n[t].dependencies),e||[]},u=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},a=function(t,r,c,s,l){if(!e[t]){var f="string"==typeof r?r:r.prefix+r.resource+r.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=ga.baseURL+"/"+f),e[t]=f.substring(0,f.lastIndexOf("/"));var d=function(){o(t,"loaded"),function(t,e,n,r){var o=i(t);q(o,(function(t){var n=u(e,t);a(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(ca))}(t,r,c,s)};n[t]?d():ca.ScriptLoader.add(f,d,s,l)}},c=function(t,o,i){void 0===i&&(i="added"),wt(n,t)&&"added"===i?o():wt(e,t)&&"loaded"===i?o():r.push({name:t,state:i,callback:o})};return{items:t,urls:e,lookup:n,_listeners:r,get:function(t){if(n[t])return n[t].instance},dependencies:i,requireLangPack:function(t,n){!1!==ga.languageLoad&&c(t,(function(){var r=ma.getCode();!r||n&&-1===(","+(n||"")+",").indexOf(","+r+",")||ca.ScriptLoader.add(e[t]+"/langs/"+r+".js")}),"loaded")},add:function(e,r,i){var u=r;return t.push(u),n[e]={instance:u,dependencies:i},o(e,"added"),u},remove:function(t){delete e[t],delete n[t]},createUrl:u,addComponents:function(t,n){var r=e[t];q(n,(function(t){ca.ScriptLoader.add(r+"/"+t)}))},load:a,waitFor:c}};ga.languageLoad=!0,ga.baseURL="",ga.PluginManager=ga(),ga.ThemeManager=ga();var ha=function(){var t=function(t){var e=sa(I.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(I.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(I.some(t))}}}(C);return Dt(Dt({},t),{on:function(e){return t.get().each(e)}})},pa=function(t,e){var n=null;return{cancel:function(){h(n)||(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];h(n)&&(n=setTimeout((function(){n=null,t.apply(null,r)}),e))}}},va=function(t,e){var n=null,r=function(){h(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)}}},ba=function(t,e){var n=Wn(t,e);return void 0===n||""===n?[]:n.split(" ")},ya=function(t){return void 0!==t.dom.classList},wa=function(t,e){return function(t,e,n){var r=ba(t,e).concat([n]);return jn(t,e,r.join(" ")),!0}(t,"class",e)},xa=function(t,e){return function(t,e,n){var r=X(ba(t,e),(function(t){return t!==n}));return r.length>0?jn(t,e,r.join(" ")):Gn(t,e),!1}(t,"class",e)},Ca=function(t,e){ya(t)?t.dom.classList.add(e):wa(t,e)},Sa=function(t){0===(ya(t)?t.dom.classList:function(t){return ba(t,"class")}(t)).length&&Gn(t,"class")},ka=function(t,e){return ya(t)&&t.dom.classList.contains(e)},Oa=function(t,e){var n=[];return q(Ve(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(Oa(t,e))})),n},_a=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ce(n)?[]:W(n.querySelectorAll(t),ye.fromDom)}(e,t)},Ta=O("mce-annotation"),Ea=O("data-mce-annotation"),Aa=O("data-mce-annotation-uid"),Da=function(t,e){var n=t.selection.getRng(),r=ye.fromDom(n.startContainer),o=ye.fromDom(t.getBody()),i=e.fold((function(){return"."+Ta()}),(function(t){return"["+Ea()+'="'+t+'"]'})),u=je(r,n.startOffset).getOr(r),a=jr(u,i,(function(t){return Se(t,o)})),c=function(t,e){return function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)}(t,e)?I.some(Wn(t,e)):I.none()};return a.bind((function(e){return c(e,""+Aa()).bind((function(n){return c(e,""+Ea()).map((function(e){var r=Ma(t,n);return{uid:n,name:e,elements:r}}))}))}))},Ma=function(t,e){var n=ye.fromDom(t.getBody());return _a(n,"["+Aa()+'="'+e+'"]')},Ra=function(t,e){var n=sa({}),r=function(){return{listeners:[],previous:ha()}},o=function(t,e){i(t,(function(t){return e(t),t}))},i=function(t,e){var o=n.get(),i=e(yt(o,t).getOrThunk(r));o[t]=i,n.set(o)},u=va((function(){var e=n.get(),r=ot(lt(e));q(r,(function(e){i(e,(function(n){var r=n.previous.get();return Da(t,I.some(e)).fold((function(){r.isSome()&&(!function(t){o(t,(function(e){q(e.listeners,(function(e){return e(!1,t)}))}))}(e),n.previous.clear())}),(function(t){var e=t.uid,i=t.name,u=t.elements;Ln(r,e)||(!function(t,e,n){o(t,(function(r){q(r.listeners,(function(r){return r(!0,t,{uid:e,nodes:W(n,(function(t){return t.dom}))})}))}))}(i,e,u),n.previous.set(e))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);t.on("remove",(function(){u.cancel()})),t.on("NodeChange",(function(){u.throttle()}));return{addListener:function(t,e){i(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))}}},Na=function(t,e){t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){q(t,(function(t){(function(t){return I.from(t.attr(Ea())).bind(e.lookup)})(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))},za=0,Ba=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++za+String(e)},Pa=function(t,e){var n,r,o=Ne(t).dom,i=ye.fromDom(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Ve(ye.fromDom(r)));rn(i,u),on(t),nn(t,i)},Ia=function(t,e){return ye.fromDom(t.dom.cloneNode(e))},La=function(t){return Ia(t,!1)},Ha=function(t){return Ia(t,!0)},Fa=function(t,e,n){void 0===n&&(n=R);var r=new Yr(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!En(e)&&!n(e));return I.from(e).filter(En)};return{current:function(){return I.from(r.current()).filter(En)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Va=function(t,e){var n=e||function(e){return t.isBlock(e)||Rn(e)||Bn(e)},r=function(t,e,n,o){if(En(t)){var i=o(t,e,t.data);if(-1!==i)return I.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))};return{backwards:function(t,e,o,i){var u=Fa(t,i,n);return r(t,e,(function(){return u.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},forwards:function(t,e,o,i){var u=Fa(t,i,n);return r(t,e,(function(){return u.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}},ja=Math.round,Ua=function(t){return t?{left:ja(t.left),top:ja(t.top),bottom:ja(t.bottom),right:ja(t.right),width:ja(t.width),height:ja(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Wa=function(t,e){return t=Ua(t),e?t.right=t.left:(t.left=t.left+t.width,t.right=t.left),t.width=0,t},qa=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},Ga=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&qa(e.top-t.bottom,t,e)},$a=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&qa(e.bottom-t.top,t,e)},Xa=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},Ka=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},Ya=function(t,e){if(wn(t)&&t.hasChildNodes()){var n=t.childNodes;return n[function(t,e,n){return Math.min(Math.max(t,e),n)}(e,0,n.length-1)]}return t},Ja=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︯ﾞ-ﾟ]"),Qa=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&Ja.test(t)},Za=wn,tc=No,ec=Cn("display","block table"),nc=Cn("float","left right"),rc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(Za,tc,A(nc)),oc=A(Cn("white-space","pre pre-line pre-wrap")),ic=En,uc=Rn,ac=oa.nodeIndex,cc=function(t,e){return e<0&&wn(t)&&t.hasChildNodes()?void 0:Ya(t,e)},sc=function(t){return"createRange"in t?t.createRange():oa.DOM.createRng()},lc=function(t){return t&&/[\r\n\t ]/.test(t)},fc=function(t){return!!t.setStart&&!!t.setEnd},dc=function(t){var e=t.startContainer,n=t.startOffset;if(lc(t.toString())&&oc(e.parentNode)&&En(e)){var r=e.data;if(lc(r[n-1])||lc(r[n+1]))return!0}return!1},mc=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},gc=function(t){var e,n=t.getClientRects();return e=n.length>0?Ua(n[0]):Ua(t.getBoundingClientRect()),!fc(t)&&uc(t)&&mc(e)?function(t){var e=t.ownerDocument,n=sc(e),r=e.createTextNode(" "),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=Ua(n.getBoundingClientRect());return o.removeChild(r),i}(t):mc(e)&&fc(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&En(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),gc(i)}return null}(t):e},hc=function(t,e){var n=Wa(t,e);return n.width=1,n.right=n.left+1,n},pc=function(t){var e=[],n=function(t){var n,r;0!==t.height&&(e.length>0&&(n=t,r=e[e.length-1],n.left===r.left&&n.top===r.top&&n.bottom===r.bottom&&n.right===r.right)||e.push(t))},r=function(t,r){var o=sc(t.ownerDocument);if(r<t.data.length){if(Qa(t.data[r]))return e;if(Qa(t.data[r-1])&&(o.setStart(t,r),o.setEnd(t,r+1),!dc(o)))return n(hc(gc(o),!1)),e}r>0&&(o.setStart(t,r-1),o.setEnd(t,r),dc(o)||n(hc(gc(o),!1))),r<t.data.length&&(o.setStart(t,r),o.setEnd(t,r+1),dc(o)||n(hc(gc(o),!0)))},o=t.container(),i=t.offset();if(ic(o))return r(o,i),e;if(Za(o))if(t.isAtEnd()){var u=cc(o,i);ic(u)&&r(u,u.data.length),rc(u)&&!uc(u)&&n(hc(gc(u),!1))}else{u=cc(o,i);if(ic(u)&&r(u,0),rc(u)&&t.isAtEnd())return n(hc(gc(u),!1)),e;var a=cc(t.container(),t.offset()-1);rc(a)&&!uc(a)&&(ec(a)||ec(u)||!rc(u))&&n(hc(gc(a),!1)),rc(u)&&n(hc(gc(u),!0))}return e},vc=function(t,e,n){var r=function(){return n||(n=pc(vc(t,e))),n};return{container:O(t),offset:O(e),toRange:function(){var n=sc(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return ic(t),0===e},isAtEnd:function(){return ic(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return cc(t,n?e-1:e)}}};vc.fromRangeStart=function(t){return vc(t.startContainer,t.startOffset)},vc.fromRangeEnd=function(t){return vc(t.endContainer,t.endOffset)},vc.after=function(t){return vc(t.parentNode,ac(t)+1)},vc.before=function(t){return vc(t.parentNode,ac(t))},vc.isAbove=function(t,e){return Hn(ut(e.getClientRects()),at(t.getClientRects()),Ga).getOr(!1)},vc.isBelow=function(t,e){return Hn(at(e.getClientRects()),ut(t.getClientRects()),$a).getOr(!1)},vc.isAtStart=function(t){return!!t&&t.isAtStart()},vc.isAtEnd=function(t){return!!t&&t.isAtEnd()},vc.isTextPosition=function(t){return!!t&&En(t.container())},vc.isElementPosition=function(t){return!1===vc.isTextPosition(t)};var bc,yc=function(t,e){En(e)&&0===e.data.length&&t.remove(e)},wc=function(t,e,n){Mn(n)?function(t,e,n){var r=I.from(n.firstChild),o=I.from(n.lastChild);e.insertNode(n),r.each((function(e){return yc(t,e.previousSibling)})),o.each((function(e){return yc(t,e.nextSibling)}))}(t,e,n):function(t,e,n){e.insertNode(n),yc(t,n.previousSibling),yc(t,n.nextSibling)}(t,e,n)},xc=En,Cc=kn,Sc=oa.nodeIndex,kc=function(t){var e=t.parentNode;return Cc(e)?kc(e):e},Oc=function(t){return t?Tt(t.childNodes,(function(t,e){return Cc(e)&&"BR"!==e.nodeName?t=t.concat(Oc(e)):t.push(e),t}),[]):[]},_c=function(t){return function(e){return t===e}},Tc=function(t){return(xc(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=Oc(kc(t)),n=Et(e,_c(t),t),e=e.slice(0,n+1);var r=Tt(e,(function(t,n,r){return xc(n)&&xc(e[r-1])&&t++,t}),0);return e=Ot(e,xn([t.nodeName])),(n=Et(e,_c(t),t))-r}(t)+"]"},Ec=function(t,e){var n,r,o,i,u,a=[];return n=e.container(),r=e.offset(),xc(n)?o=function(t,e){for(;(t=t.previousSibling)&&xc(t);)e+=t.data.length;return e}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),a.push(Tc(n)),u=function(t,e,n){var r=[];for(e=e.parentNode;e!==t&&(!n||!n(e));e=e.parentNode)r.push(e);return r}(t,n),u=Ot(u,A(kn)),(a=a.concat(kt(u,(function(t){return Tc(t)})))).reverse().join("/")+","+o},Ac=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=Tt(o,(function(t,e){var n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return n?("text()"===n[1]&&(n[1]="#text"),function(t,e,n){var r=Oc(t);return r=Ot(r,(function(t,e){return!xc(t)||!xc(r[e-1])})),(r=Ot(r,xn([e])))[n]}(t,n[1],parseInt(n[2],10))):null}),t);return i?xc(i)?function(t,e){for(var n,r=t,o=0;xc(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!xc(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return xc(t)&&e>t.data.length&&(e=t.data.length),vc(t,e)}(i,parseInt(n,10)):(n="after"===n?Sc(i)+1:Sc(i),vc(i.parentNode,n)):null},Dc=Bn,Mc=function(t,e,n,r,o){var i,u=r[o?"startContainer":"endContainer"],a=r[o?"startOffset":"endOffset"],c=[],s=0,l=t.getRoot();for(En(u)?c.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&En(r);r=r.previousSibling)o+=t(r.data).length;return o}(e,u,a):a):(a>=(i=u.childNodes).length&&i.length&&(s=1,a=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[a],n)+s));u&&u!==l;u=u.parentNode)c.push(t.nodeIndex(u,n));return c},Rc=function(t,e,n){var r=0;return ve.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},Nc=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],wn(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(e?r:r-1,o.length-1)])&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r))},zc=function(t){return Nc(t,!0),Nc(t,!1),t},Bc=function(t,e){var n;if(wn(t)&&(t=Ya(t,e),Dc(t)))return t;if(po(t)){if(En(t)&&go(t)&&(t=t.parentNode),n=t.previousSibling,Dc(n))return n;if(n=t.nextSibling,Dc(n))return n}},Pc=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Dc(r)||"IMG"===o)return{name:o,index:Rc(n.dom,o,r)};var u=function(t){return Bc(t.startContainer,t.startOffset)||Bc(t.endContainer,t.endOffset)}(i);return u?{name:o=u.tagName,index:Rc(n.dom,o,u)}:function(t,e,n,r){var o=e.dom,i={};return i.start=Mc(o,t,n,r,!0),e.isCollapsed()||(i.end=Mc(o,t,n,r,!1)),ko(r)&&(i.isFakeCaret=!0),i}(t,n,e,i)},Ic=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,"&#xFEFF;"):t.create("span",r)},Lc=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),u=t.getNode(),a=u.nodeName;if("IMG"===a)return{name:a,index:Rc(n,a,u)};var c=zc(r.cloneRange());if(!i){c.collapse(!1);var s=Ic(n,o+"_end",e);wc(n,c,s)}(r=zc(r)).collapse(!0);var l=Ic(n,o+"_start",e);return wc(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},Hc=function(t,e,n){return 2===e?Pc(lo,n,t):3===e?function(t){var e=t.getRng();return{start:Ec(t.dom.getRoot(),vc.fromRangeStart(e)),end:Ec(t.dom.getRoot(),vc.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):Lc(t,!1)},Fc=E(Pc,_,!0),Vc=oa.DOM,jc=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return yt(o,t.id).getOr(n)}return r},Uc=function(t){return t.getParam("content_security_policy","")},Wc=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},qc=function(t){return t.getParam("forced_root_block_attrs",{})},Gc=function(t){return t.getParam("automatic_uploads",!0,"boolean")},$c=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},Xc=function(t){return t.getParam("icons","","string")},Kc=function(t){return t.getParam("images_upload_url","","string")},Yc=function(t){return t.getParam("images_upload_base_path","","string")},Jc=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},Qc=function(t){return t.getParam("images_upload_handler",null,"function")},Zc=function(t){return t.getParam("content_css_cors",!1,"boolean")},ts=function(t){return t.getParam("referrer_policy","","string")},es=function(t){return t.getParam("language","en","string")},ns=function(t){return t.getParam("indent_use_margin",!1)},rs=function(t){var e=t.getParam("font_css",[]);return g(e)?e:W(e.split(","),Ft)},os=function(t){var e=t.getParam("object_resizing");return!1!==e&&!de.iOS&&(d(e)?e:"table,img,figure.image,div,video,iframe")},is=function(t){return t.getParam("event_root")},us=function(t){return t.getParam("theme")},as=function(t){return t.getParam("validate")},cs=function(t){return!1!==t.getParam("inline_boundaries")},ss=function(t){return t.getParam("content_css_cors")},ls=function(t){return t.getParam("plugins","","string")},fs=wn,ds=En,ms=function(t){var e=t.parentNode;e&&e.removeChild(t)},gs=function(t){var e=lo(t);return{count:t.length-e.length,text:e}},hs=function(t){for(var e;-1!==(e=t.data.lastIndexOf(co));)t.deleteData(e,1)},ps=function(t,e){return ws(t),e},vs=function(t,e){var n=e.container(),r=function(t,e){var n=V(t,e);return-1===n?I.none():I.some(n)}(ct(n.childNodes),t).map((function(t){return t<e.offset()?vc(n,e.offset()-1):e})).getOr(e);return ws(t),r},bs=function(t,e){return ds(t)&&e.container()===t?function(t,e){var n=gs(t.data.substr(0,e.offset())),r=gs(t.data.substr(e.offset()));return(n.text+r.text).length>0?(hs(t),vc(t,e.offset()-n.count)):e}(t,e):ps(t,e)},ys=function(t,e){return vc.isTextPosition(e)?bs(t,e):function(t,e){return e.container()===t.parentNode?vs(t,e):ps(t,e)}(t,e)},ws=function(t){fs(t)&&po(t)&&(vo(t)?t.removeAttribute("data-mce-caret"):ms(t)),ds(t)&&(hs(t),0===t.data.length&&ms(t))},xs=re().browser,Cs=Bn,Ss=In,ks=Pn,Os=function(t,e,n){var r,o,i=Wa(e.getBoundingClientRect(),n);if("BODY"===t.tagName){var u=t.ownerDocument.documentElement;r=t.scrollLeft||u.scrollLeft,o=t.scrollTop||u.scrollTop}else{var a=t.getBoundingClientRect();r=t.scrollLeft-a.left,o=t.scrollTop-a.top}i.left+=r,i.right+=r,i.top+=o,i.bottom+=o,i.width=1;var c=e.offsetWidth-e.clientWidth;return c>0&&(n&&(c*=-1),i.left+=c,i.right+=c),i},_s=function(t,e,n,r){var o,i,u=ha(),a=Wc(t),c=a.length>0?a:"p",s=function(){!function(t){for(var e=_a(ye.fromDom(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n<e.length;n++){var r,o=e[n].dom,i=o.previousSibling;if(Co(i))1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1);if(i=o.nextSibling,xo(i))1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1)}}(e),i&&(ws(i),i=null),u.on((function(t){Ju(t.caret).remove(),u.clear()})),o&&($r.clearInterval(o),o=void 0)},l=function(){o=$r.setInterval((function(){r()?Ju("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):Ju("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500)};return{show:function(t,r){var o;if(s(),ks(r))return null;if(!n(r))return i=function(t,e){var n=t.ownerDocument.createTextNode(co),r=t.parentNode;if(e){o=t.previousSibling;if(mo(o)){if(po(o))return o;if(Co(o))return o.splitText(o.data.length-1)}r.insertBefore(n,t)}else{var o=t.nextSibling;if(mo(o)){if(po(o))return o;if(xo(o))return o.splitText(1),o}t.nextSibling?r.insertBefore(n,t.nextSibling):r.appendChild(n)}return n}(r,t),o=r.ownerDocument.createRange(),Es(i.nextSibling)?(o.setStart(i,0),o.setEnd(i,0)):(o.setStart(i,1),o.setEnd(i,1)),o;i=wo(c,r,t);var a=Os(e,r,t);Ju(i).css("top",a.top);var f=Ju('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(Dt({},a)).appendTo(e)[0];return u.set({caret:f,element:r,before:t}),t&&Ju(f).addClass("mce-visual-caret-before"),l(),(o=r.ownerDocument.createRange()).setStart(i,0),o.setEnd(i,0),o},hide:s,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){u.on((function(t){var n=Os(e,t.element,t.before);Ju(t.caret).css(Dt({},n))}))},destroy:function(){return $r.clearInterval(o)}}},Ts=function(){return xs.isIE()||xs.isEdge()||xs.isFirefox()},Es=function(t){return Cs(t)||Ss(t)},As=function(t){return Es(t)||On(t)&&Ts()},Ds=Bn,Ms=In,Rs=Cn("display","block table table-cell table-caption list-item"),Ns=po,zs=go,Bs=wn,Ps=No,Is=function(t){return t>0},Ls=function(t){return t<0},Hs=function(t,e){for(var n;n=t(e);)if(!zs(n))return n;return null},Fs=function(t,e,n,r,o){var i=new Yr(t,r),u=Ds(t)||zs(t);if(Ls(e)){if(u&&n(t=Hs(i.prev.bind(i),!0)))return t;for(;t=Hs(i.prev.bind(i),o);)if(n(t))return t}if(Is(e)){if(u&&n(t=Hs(i.next.bind(i),!0)))return t;for(;t=Hs(i.next.bind(i),o);)if(n(t))return t}return null},Vs=function(t,e){for(;t&&t!==e;){if(Rs(t))return t;t=t.parentNode}return null},js=function(t,e,n){return Vs(t.container(),n)===Vs(e.container(),n)},Us=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return Bs(n)?n.childNodes[r+t]:null},Ws=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},qs=function(t,e,n){return Vs(e,t)===Vs(n,t)},Gs=function(t,e,n){for(var r=t?"previousSibling":"nextSibling";n&&n!==e;){var o=n[r];if(Ns(o)&&(o=o[r]),Ds(o)||Ms(o)){if(qs(e,o,n))return o;break}if(Ps(o))break;n=n.parentNode}return null},$s=E(Ws,!0),Xs=E(Ws,!1),Ks=function(t,e,n){var r,o=E(Gs,!0,e),i=E(Gs,!1,e),u=n.startContainer,a=n.startOffset;if(go(u)){Bs(u)||(u=u.parentNode);var c=u.getAttribute("data-mce-caret");if("before"===c&&(r=u.nextSibling,As(r)))return $s(r);if("after"===c&&(r=u.previousSibling,As(r)))return Xs(r)}if(!n.collapsed)return n;if(En(u)){if(Ns(u)){if(1===t){if(r=i(u))return $s(r);if(r=o(u))return Xs(r)}if(-1===t){if(r=o(u))return Xs(r);if(r=i(u))return $s(r)}return n}if(Co(u)&&a>=u.data.length-1)return 1===t&&(r=i(u))?$s(r):n;if(xo(u)&&a<=1)return-1===t&&(r=o(u))?Xs(r):n;if(a===u.data.length)return(r=i(u))?$s(r):n;if(0===a)return(r=o(u))?Xs(r):n}return n},Ys=function(t,e){return I.from(Us(t?0:-1,e)).filter(Ds)},Js=function(t,e,n){var r=Ks(t,e,n);return-1===t?vc.fromRangeStart(r):vc.fromRangeEnd(r)},Qs=function(t){return I.from(t.getNode()).map(ye.fromDom)},Zs=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},tl=function(t,e){var n=js(t,e);return!(n||!Rn(t.getNode()))||n};!function(t){t[t.Backwards=-1]="Backwards",t[t.Forwards=1]="Forwards"}(bc||(bc={}));var el,nl=Bn,rl=En,ol=wn,il=Rn,ul=No,al=function(t){return Do(t)||function(t){return!!zo(t)&&!0!==Y(ct(t.getElementsByTagName("*")),(function(t,e){return t||Oo(e)}),!1)}(t)},cl=Bo,sl=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},ll=function(t,e){if(Is(t)){if(ul(e.previousSibling)&&!rl(e.previousSibling))return vc.before(e);if(rl(e))return vc(e,0)}if(Ls(t)){if(ul(e.nextSibling)&&!rl(e.nextSibling))return vc.after(e);if(rl(e))return vc(e,e.data.length)}return Ls(t)?il(e)?vc.before(e):vc.after(e):vc.before(e)},fl=function(t,e,n){var r,o,i,u;if(!ol(n)||!e)return null;if(e.isEqual(vc.after(n))&&n.lastChild){if(u=vc.after(n.lastChild),Ls(t)&&ul(n.lastChild)&&ol(n.lastChild))return il(n.lastChild)?vc.before(n.lastChild):u}else u=e;var a=u.container(),c=u.offset();if(rl(a)){if(Ls(t)&&c>0)return vc(a,--c);if(Is(t)&&c<a.length)return vc(a,++c);r=a}else{if(Ls(t)&&c>0&&(o=sl(a,c-1),ul(o)))return!al(o)&&(i=Fs(o,t,cl,o))?rl(i)?vc(i,i.data.length):vc.after(i):rl(o)?vc(o,o.data.length):vc.before(o);if(Is(t)&&c<a.childNodes.length&&(o=sl(a,c),ul(o)))return il(o)?function(t,e){var n=e.nextSibling;return n&&ul(n)?rl(n)?vc(n,0):vc.before(n):fl(bc.Forwards,vc.after(e),t)}(n,o):!al(o)&&(i=Fs(o,t,cl,o))?rl(i)?vc(i,0):vc.before(i):rl(o)?vc(o,0):vc.after(o);r=o||u.getNode()}if((Is(t)&&u.isAtEnd()||Ls(t)&&u.isAtStart())&&(r=Fs(r,t,N,n,!0),cl(r,n)))return ll(t,r);o=Fs(r,t,cl,n);var s=At(X(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(a,n),nl));return!s||o&&s.contains(o)?o?ll(t,o):null:u=Is(t)?vc.after(s):vc.before(s)},dl=function(t){return{next:function(e){return fl(bc.Forwards,e,t)},prev:function(e){return fl(bc.Backwards,e,t)}}},ml=function(t){return vc.isTextPosition(t)?0===t.offset():No(t.getNode())},gl=function(t){if(vc.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return No(t.getNode(!0))},hl=function(t,e){return!vc.isTextPosition(t)&&!vc.isTextPosition(e)&&t.getNode()===e.getNode(!0)},pl=function(t,e,n){return t?!hl(e,n)&&(r=e,!(!vc.isTextPosition(r)&&Rn(r.getNode())))&&gl(e)&&ml(n):!hl(n,e)&&ml(e)&&gl(n);var r},vl=function(t,e,n){var r=dl(e);return I.from(t?r.next(n):r.prev(n))},bl=function(t,e,n){return vl(t,e,n).bind((function(r){return js(n,r,e)&&pl(t,n,r)?vl(t,e,r):I.some(r)}))},yl=function(t,e,n,r){return bl(t,e,n).bind((function(n){return r(n)?yl(t,e,n,r):I.some(n)}))},wl=function(t,e){var n,r=t?e.firstChild:e.lastChild;return En(r)?I.some(vc(r,t?0:r.data.length)):r?No(r)?I.some(t?vc.before(r):Rn(n=r)?vc.before(n):vc.after(n)):function(t,e,n){var r=t?vc.before(n):vc.after(n);return vl(t,e,r)}(t,e,r):I.none()},xl=E(vl,!0),Cl=E(vl,!1),Sl=E(wl,!0),kl=E(wl,!1),Ol=function(t){return wn(t)&&"_mce_caret"===t.id},_l=function(t,e){for(;e&&e!==t;){if("_mce_caret"===e.id)return e;e=e.parentNode}return null},Tl=function(t){return ve.isArray(t.start)},El=function(t,e){return wn(e)&&t.isBlock(e)&&!e.innerHTML&&!de.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},Al=function(t,e){return kl(t).fold(R,(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},Dl=function(t,e,n){return!(!function(t){return!1===t.hasChildNodes()}(e)||!_l(t,e))&&(function(t,e){var n=t.ownerDocument.createTextNode(co);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),!0)},Ml=function(t,e,n,r){var o,i,u,a,c=n[e?"start":"end"],s=t.getRoot();if(c){for(u=c[0],i=s,o=c.length-1;o>=1;o--){if(a=i.childNodes,Dl(s,i,r))return!0;if(c[o]>a.length-1)return!!Dl(s,i,r)||Al(i,r);i=a[c[o]]}3===i.nodeType&&(u=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(u=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,u):r.setEnd(i,u)}return!0},Rl=function(t){return En(t)&&t.data.length>0},Nl=function(t,e,n){var r,o,i,u,a,c,s=t.get(n.id+"_"+e),l=n.keep;if(s){if(r=s.parentNode,"start"===e?(l?s.hasChildNodes()?(r=s.firstChild,o=1):Rl(s.nextSibling)?(r=s.nextSibling,o=0):Rl(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)+1):o=t.nodeIndex(s),a=r,c=o):(l?s.hasChildNodes()?(r=s.firstChild,o=1):Rl(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)):o=t.nodeIndex(s),a=r,c=o),!l){for(u=s.previousSibling,i=s.nextSibling,ve.each(ve.grep(s.childNodes),(function(t){En(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));s=t.get(n.id+"_"+e);)t.remove(s,!0);u&&i&&u.nodeType===i.nodeType&&En(u)&&!de.opera&&(o=u.nodeValue.length,u.appendData(i.nodeValue),t.remove(i),a=u,c=o)}return I.some(vc(a,c))}return I.none()},zl=function(t,e){var n=t.dom;if(e){if(Tl(e))return function(t,e){var n=t.createRng();return Ml(t,!0,e,n)&&Ml(t,!1,e,n)?I.some(n):I.none()}(n,e);if(function(t){return d(t.start)}(e))return I.some(function(t,e){var n,r=t.createRng();return n=Ac(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=Ac(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r}(n,e));if(function(t){return wt(t,"id")}(e))return function(t,e){var n=Nl(t,"start",e),r=Nl(t,"end",e);return Hn(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(El(t,e.container()),e.offset()),r.setEnd(El(t,n.container()),n.offset()),r}))}(n,e);if(function(t){return wt(t,"name")}(e))return function(t,e){return I.from(t.select(e.name)[e.index]).map((function(e){var n=t.createRng();return n.selectNode(e),n}))}(n,e);if(function(t){return wt(t,"rng")}(e))return I.some(e.rng)}return I.none()},Bl=function(t,e,n){return Hc(t,e,n)},Pl=function(t,e){zl(t,e).each((function(e){t.setRng(e)}))},Il=function(t){return wn(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Ll=(el=" ",function(t){return el===t}),Hl=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Fl=function(t){return!Hl(t)&&!Ll(t)},Vl=function(t){return!!t.nodeType},jl=function(t,e,n){var r=n.startOffset,o=n.startContainer;if((o!==n.endContainer||!function(t){return t&&/^(IMG)$/.test(t.nodeName)}(o.childNodes[r]))&&wn(o)){var i=o.childNodes,u=void 0;r<i.length?(o=i[r],u=new Yr(o,t.getParent(o,t.isBlock))):(o=i[i.length-1],(u=new Yr(o,t.getParent(o,t.isBlock))).next(!0));for(var a=u.current();a;a=u.next())if(En(a)&&!Gl(a))return n.setStart(a,0),void e.setRng(n)}},Ul=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(wn(t)||!Gl(t))return t}},Wl=function(t,e){return Vl(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},ql=function(t,e,n){return t.schema.isValidChild(e,n)},Gl=function(t,e){if(void 0===e&&(e=!1),y(t)&&En(t)){var n=e?t.data.replace(/ /g," "):t.data;return Io(n)}return!1},$l=function(t,e){return w(t)?t=t(e):y(e)&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},Xl=function(t,e){return e=e||"",t=""+((t=t||"").nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},Kl=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},Yl=function(t,e,n){return Kl(t,t.getStyle(e,n),n)},Jl=function(t,e){var n;return t.getParent(e,(function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n})),n},Ql=function(t,e,n){return t.getParents(e,n,t.getRoot())},Zl=function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return vt(t,(function(t,e){return U(r,(function(t){return t===e}))}))};return U(t.formatter.get(e),(function(e){var r=o(e);return U(t.formatter.get(n),(function(t){var e=o(t);return function(t,e,n){return void 0===n&&(n=c),a(n).eq(t,e)}(r,e)}))}))},tf=function(t){return xt(t,"block")},ef=function(t){return xt(t,"selector")},nf=function(t){return xt(t,"inline")},rf=function(t){return ef(t)&&!1!==t.expand&&!nf(t)},of=Il,uf=Ql,af=Gl,cf=Wl,sf=function(t,e){for(var n=e;n;){if(wn(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},lf=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},ff=function(t,e,n){return lf(t,e,n,(function(t){return Ll(t)||Hl(t)}))},df=function(t,e,n){return lf(t,e,n,Fl)},mf=function(t,e,n,r,o,i){var u,a=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=Va(t),c=o?i.backwards:i.forwards;return I.from(c(e,n,(function(t,e){return of(t.parentNode)?-1:(u=t,r(o,t,e))}),a))};return c(n,r,ff).bind((function(t){return i?c(t.container,t.offset+(o?-1:0),df):I.some(t)})).orThunk((function(){return u?I.some({container:u,offset:o?0:u.length}):I.none()}))},gf=function(t,e,n,r,o){En(r)&&Wt(r.data)&&r[o]&&(r=r[o]);for(var i=uf(t,r),u=0;u<i.length;u++)for(var a=0;a<e.length;a++){var c=e[a];if((!y(c.collapsed)||c.collapsed===n.collapsed)&&(ef(c)&&t.is(i[u],c.selector)))return i[u]}return r},hf=function(t,e,n,r){var o=n,i=t.dom,u=i.getRoot(),a=e[0];if(tf(a)&&(o=a.wrapper?null:i.getParent(n,a.block,u)),!o){var c=i.getParent(n,"LI,TD,TH");o=i.getParent(En(n)?n.parentNode:n,(function(e){return e!==u&&cf(t,e)}),c)}if(o&&tf(a)&&a.wrapper&&(o=uf(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!Xl(o,"br")););return o||n},pf=function(t,e,n,r){var o=n.parentNode;return!y(n[r])&&(!(o!==e&&!b(o)&&!t.isBlock(o))||pf(t,e,o,r))},vf=function(t,e,n,r,o){var i,u=n,a=o?"previousSibling":"nextSibling",c=t.getRoot();if(En(n)&&!af(n)&&(o?r>0:r<n.data.length))return n;for(;;){if(!e[0].block_expand&&t.isBlock(u))return u;for(var s=u[a];s;s=s[a]){var l=En(s)&&!pf(t,c,s,a);if(!of(s)&&(!Rn(i=s)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!af(s,l))return u}if(u===c||u.parentNode===c){n=u;break}u=u.parentNode}return n},bf=function(t){return of(t.parentNode)||of(t)},yf=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,u=e.endContainer,a=e.endOffset,c=t.dom,s=n[0];(wn(o)&&o.hasChildNodes()&&(o=Ya(o,i),En(o)&&(i=0)),wn(u)&&u.hasChildNodes()&&(u=Ya(u,e.collapsed?a:a-1),En(u)&&(a=u.nodeValue.length)),o=sf(c,o),u=sf(c,u),bf(o)&&(o=of(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,En(o)&&(i=e.collapsed?o.length:0)),bf(u)&&(u=of(u)?u:u.parentNode,u=e.collapsed?u.nextSibling||u:u.previousSibling||u,En(u)&&(a=e.collapsed?0:u.length)),e.collapsed)&&(mf(c,t.getBody(),o,i,!0,r).each((function(t){var e=t.container,n=t.offset;o=e,i=n})),mf(c,t.getBody(),u,a,!1,r).each((function(t){var e=t.container,n=t.offset;u=e,a=n})));return(nf(s)||s.block_expand)&&(nf(s)&&En(o)&&0!==i||(o=vf(c,n,o,i,!0)),nf(s)&&En(u)&&a!==u.nodeValue.length||(u=vf(c,n,u,a,!1))),rf(s)&&(o=gf(c,n,e,o,"previousSibling"),u=gf(c,n,e,u,"nextSibling")),(tf(s)||ef(s))&&(o=hf(t,n,o,"previousSibling"),u=hf(t,n,u,"nextSibling"),tf(s)&&(c.isBlock(o)||(o=vf(c,n,o,i,!0)),c.isBlock(u)||(u=vf(c,n,u,a,!1)))),wn(o)&&(i=c.nodeIndex(o),o=o.parentNode),wn(u)&&(a=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:o,startOffset:i,endContainer:u,endOffset:a}},wf=function(t,e,n){var r=e.startOffset,o=Ya(e.startContainer,r),i=e.endOffset,u=Ya(e.endContainer,i-1),a=function(t){var e=t[0];En(e)&&e===o&&r>=e.data.length&&t.splice(0,1);var n=t[t.length-1];return 0===i&&t.length>0&&n===u&&En(n)&&t.splice(t.length-1,1),t},c=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},s=function(e,n){return t.getParent(e,(function(t){return t.parentNode===n}),n)},l=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,u=i.parentNode;i&&i!==e;i=u){u=i.parentNode;var s=c(i===t?i:i[o],o);s.length&&(r||s.reverse(),n(a(s)))}};if(o===u)return n(a([o]));var f=t.findCommonAncestor(o,u);if(t.isChildOf(o,u))return l(o,f,!0);if(t.isChildOf(u,o))return l(u,f);var d=s(o,f)||o,m=s(u,f)||u;l(o,d,!0);var g=c(d===o?d:d.nextSibling,"nextSibling",m===u?m.nextSibling:m);g.length&&n(a(g)),l(u,m)},xf=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},Cf=function(t){return X(function(t){return tt(t,(function(t){var e=Ka(t);return e?[ye.fromDom(e)]:[]}))}(t),uo)},Sf=function(t,e){var n=_a(e,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:Cf(t)},kf=function(t){return Sf(xf(t.selection.getSel()),ye.fromDom(t.getBody()))},Of=function(t,e){return Fr(t,"table",e)},_f=function(t){return Ue(t).fold(O([t]),(function(e){return[t].concat(_f(e))}))},Tf=function(t){return We(t).fold(O([t]),(function(e){return"br"===_e(e)?Ie(e).map((function(e){return[t].concat(Tf(e))})).getOr([]):[t].concat(Tf(e))}))},Ef=function(t,e){return Hn(function(t){var e=t.startContainer,n=t.startOffset;return En(e)?0===n?I.some(ye.fromDom(e)):I.none():I.from(e.childNodes[n]).map(ye.fromDom)}(e),function(t){var e=t.endContainer,n=t.endOffset;return En(e)?n===e.data.length?I.some(ye.fromDom(e)):I.none():I.from(e.childNodes[n-1]).map(ye.fromDom)}(e),(function(e,n){var r=Q(_f(t),E(Se,e)),o=Q(Tf(t),E(Se,n));return r.isSome()&&o.isSome()})).getOr(!1)},Af=function(t,e,n,r){var o=n,i=new Yr(n,o),u=vt(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!j(["td","th","table"],e.toLowerCase())}));do{if(En(n)&&0!==ve.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(u[n.nodeName])return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},Df=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},Mf=function(t,e){var n=kf(t);n.length>0?q(n,(function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},Rf=function(t,e,n){var r=Lc(t,e);n(r),t.moveToBookmark(r)},Nf=function(t,e){var n=function(e){return t(e)?I.from(e.dom.nodeValue):I.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(De,"text"),zf=function(t){return Nf.get(t)},Bf=function(t,e,n,r){return Pe(e).fold((function(){return"skipping"}),(function(o){return"br"===r||function(t){return De(t)&&zf(t)===co}(e)?"valid":function(t){return Ae(t)&&ka(t,Ta())}(e)?"existing":Ol(e.dom)?"caret":ql(t,n,r)&&ql(t,_e(o),n)?"valid":"invalid-child"}))},Pf=function(t,e,n,r){var o=e.uid,i=void 0===o?Ba("mce-annotation"):o,u=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["uid"]),a=ye.fromTag("span",t);Ca(a,Ta()),jn(a,""+Aa(),i),jn(a,""+Ea(),n);var c=r(i,u),s=c.attributes,l=void 0===s?{}:s,f=c.classes,d=void 0===f?[]:f;return Un(a,l),function(t,e){q(e,(function(e){Ca(t,e)}))}(a,d),a},If=function(t,e,n,r,o){var i=[],u=Pf(t.getDoc(),o,n,r),a=ha(),c=function(){a.clear()},s=function(t){q(t,l)},l=function(e){switch(Bf(t,e,"span",_e(e))){case"invalid-child":c();var n=Ve(e);s(n),c();break;case"valid":!function(t,e){Ze(t,e),nn(e,t)}(e,a.get().getOrThunk((function(){var t=La(u);return i.push(t),a.set(t),t})))}};return wf(t.dom,e,(function(t){c(),function(t){var e=W(t,ye.fromDom);s(e)}(t)})),i},Lf=function(t,e,n,r){t.undoManager.transact((function(){var o=t.selection,i=o.getRng(),u=kf(t).length>0;if(i.collapsed&&!u&&function(t,e){var n=yf(t,e,[{inline:"span"}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)}(t,i),o.getRng().collapsed&&!u){var a=Pf(t.getDoc(),r,e,n.decorate);Pa(a," "),o.getRng().insertNode(a.dom),o.select(a.dom)}else Rf(o,!1,(function(){Mf(t,(function(o){If(t,o,e,n.decorate,r)}))}))}))},Hf=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return yt(e,t).map((function(t){return t.settings}))}});Na(t,n);var r=Ra(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each((function(n){Lf(t,e,n,r)}))},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){Da(t,I.some(e)).each((function(t){var e=t.elements;q(e,an)}))},getAll:function(e){var n=function(t,e){var n=ye.fromDom(t.getBody()),r=_a(n,"["+Ea()+'="'+e+'"]'),o={};return q(r,(function(t){var e=Wn(t,Aa()),n=yt(o,e).getOr([]);o[e]=n.concat([t])})),o}(t,e);return mt(n,(function(t){return W(t,(function(t){return t.dom}))}))}}},Ff=function(t){return{getBookmark:E(Bl,t),moveToBookmark:E(Pl,t)}};Ff.isBookmarkNode=Il;var Vf=function(t,e){for(;e&&e!==t;){if(zn(e)||Bn(e))return e;e=e.parentNode}return null},jf=function(t,e,n){if(n.collapsed)return!1;if(de.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(wn(r))return U(r.getClientRects(),(function(n){return Xa(n,t,e)}))}return U(n.getClientRects(),(function(n){return Xa(n,t,e)}))},Uf=function(t,e,n){return t.fire(e,n)},Wf=function(t,e,n,r){return t.fire("FormatApply",{format:e,node:n,vars:r})},qf=function(t,e,n,r){return t.fire("FormatRemove",{format:e,node:n,vars:r})},Gf={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||Gf.metaKeyPressed(t)},metaKeyPressed:function(t){return de.mac?t.metaKey:t.ctrlKey&&!t.altKey}},$f=Bn,Xf=function(t,e){var n,r,o,i,u,a,c,s,l,f,d,m,g,h,p,v=e.dom,b=ve.each,w=e.getDoc(),x=document,C=Math.abs,S=Math.round,k=e.getBody(),O={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},_=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},T=function(t){return In(t)||v.hasClass(t,"mce-preview-object")},E=function(t){var n=t.target;(function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return _(t.target)&&!jf(n.clientX,n.clientY,e)}return _(t.target)&&!jf(t.clientX,t.clientY,e)})(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},A=function(t){return v.is(t,"figure.image")?[t.querySelector("img")]:v.hasClass(t,"mce-preview-object")&&y(t.firstElementChild)?[t,t.firstElementChild]:[t]},D=function(t){var n=os(e);return!!n&&("false"!==t.getAttribute("data-mce-resize")&&(t!==e.getBody()&&(v.hasClass(t,"mce-preview-object")?xe(ye.fromDom(t.firstElementChild),n):xe(ye.fromDom(t),n))))},M=function(t,n,r){if(y(r)){var o=A(t);q(o,(function(t){t.style[n]||!e.schema.isValid(t.nodeName.toLowerCase(),n)?v.setStyle(t,n,r):v.setAttrib(t,n,""+r)}))}},R=function(t,e,n){M(t,"width",e),M(t,"height",n)},N=function(t){var u,b,y,w;u=t.screenX-a,b=t.screenY-c,m=u*i[2]+s,g=b*i[3]+l,m=m<5?5:m,g=g<5?5:g,((_(n)||T(n))&&!1!==function(t){return t.getParam("resize_img_proportional",!0,"boolean")}(e)?!Gf.modifierPressed(t):Gf.modifierPressed(t))&&(C(u)>C(b)?(g=S(m*f),m=S(g/f)):(m=S(g/f),g=S(m*f))),R(r,m,g),y=(y=i.startPos.x+u)>0?y:0,w=(w=i.startPos.y+b)>0?w:0,v.setStyles(o,{left:y,top:w,display:"block"}),o.innerHTML=m+" &times; "+g,i[2]<0&&r.clientWidth<=m&&v.setStyle(r,"left",void 0+(s-m)),i[3]<0&&r.clientHeight<=g&&v.setStyle(r,"top",void 0+(l-g)),(u=k.scrollWidth-h)+(b=k.scrollHeight-p)!==0&&v.setStyles(o,{left:y-u,top:w-b}),d||(!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(e,n,s,l,"corner-"+i.name),d=!0)},z=function(){var t=d;d=!1,t&&(M(n,"width",m),M(n,"height",g)),v.unbind(w,"mousemove",N),v.unbind(w,"mouseup",z),x!==w&&(v.unbind(x,"mousemove",N),v.unbind(x,"mouseup",z)),v.remove(r),v.remove(o),v.remove(u),B(n),t&&(!function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(e,n,m,g,"corner-"+i.name),v.setAttrib(n,"style",v.getAttrib(n,"style"))),e.nodeChanged()},B=function(t){H();var d=v.getPos(t,k),y=d.x,C=d.y,S=t.getBoundingClientRect(),_=S.width||S.right-S.left,E=S.height||S.bottom-S.top;n!==t&&(P(),n=t,m=g=0);var M=e.fire("ObjectSelected",{target:t}),B=v.getAttrib(n,"data-mce-selected","1");D(t)&&!M.isDefaultPrevented()?b(O,(function(t,e){var d,m=function(d){var m,g=A(n)[0];a=d.screenX,c=d.screenY,s=g.clientWidth,l=g.clientHeight,f=l/s,(i=t).name=e,i.startPos={x:_*t[0]+y,y:E*t[1]+C},h=k.scrollWidth,p=k.scrollHeight,u=v.add(k,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),v.setStyles(u,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),r=T(m=n)?v.create("img",{src:de.transparentSrc}):m.cloneNode(!0),v.addClass(r,"mce-clonedresizable"),v.setAttrib(r,"data-mce-bogus","all"),r.contentEditable="false",v.setStyles(r,{left:y,top:C,margin:0}),R(r,_,E),r.removeAttribute("data-mce-selected"),k.appendChild(r),v.bind(w,"mousemove",N),v.bind(w,"mouseup",z),x!==w&&(v.bind(x,"mousemove",N),v.bind(x,"mouseup",z)),o=v.add(k,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},s+" &times; "+l)};(d=v.get("mceResizeHandle"+e))&&v.remove(d),d=v.add(k,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===de.ie&&(d.contentEditable=!1),v.bind(d,"mousedown",(function(t){t.stopImmediatePropagation(),t.preventDefault(),m(t)})),t.elm=d,v.setStyles(d,{left:_*t[0]+y-d.offsetWidth/2,top:E*t[1]+C-d.offsetHeight/2})})):P(),v.getAttrib(n,"data-mce-selected")||n.setAttribute("data-mce-selected",B)},P=function(){H(),n&&n.removeAttribute("data-mce-selected"),dt(O,(function(t,e){var n=v.get("mceResizeHandle"+e);n&&(v.unbind(n),v.remove(n))}))},I=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};d||e.removed||(b(v.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute("data-mce-selected")})),r="mousedown"===n.type?n.target:t.getNode(),o(r=v.$(r).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],k)&&(F(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?B(r):P())},L=function(t){return $f(Vf(e.getBody(),t))},H=function(){dt(O,(function(t){t.elm&&(v.unbind(t.elm),delete t.elm)}))},F=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}};e.on("init",(function(){if(F(),de.browser.isIE()||de.browser.isEdge()){e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;d||!/^(TABLE|IMG|HR)$/.test(r)||L(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())}));var t=function(t){var n=function(t){$r.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(L(t.target)||In(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};v.bind(k,"mscontrolselect",t),e.on("remove",(function(){return v.unbind(k,"mscontrolselect",t)}))}var r=$r.throttle((function(t){e.composing||I(t)}));e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),e.on("keyup compositionend",(function(t){n&&"TABLE"===n.nodeName&&r(t)})),e.on("hide blur",P),e.on("contextmenu longpress",E,!0)})),e.on("remove",H);return{isResizable:D,showResizeRect:B,hideResizeRect:P,updateResizeRect:I,destroy:function(){n=r=u=null}}},Kf=function(t){return zn(t)||Bn(t)},Yf=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(i.caretRangeFromPoint)r=i.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=ve.toArray(i.getClientRects())).sort((function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-(n=Math.abs(Math.max(n.top-e,n.bottom-e)))}))).length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return function(t,e){var n=t&&t.parentElement?t.parentElement():null;return Bn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,Kf))?null:t}(r,n.body)}return r},Jf=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},Qf=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},Zf=function(t,e,n){return Qf(t,e,(function(t){return t.nodeName===n}))},td=function(t){return t&&"TABLE"===t.nodeName},ed=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},nd=function(t,e){return po(t)&&!1===Qf(t,e,Ol)},rd=function(t,e,n){for(var r=new Yr(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(Rn(e))return!0},od=function(t,e,n,r,o){var i,u,a=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||a;if(r&&Rn(o)&&e&&t.isEmpty(s))return I.some(vc(o.parentNode,t.nodeIndex(o)));for(var l=new Yr(o,s);u=l[r?"prev":"next"]();){if("false"===t.getContentEditableParent(u)||nd(u,a))return I.none();if(En(u)&&u.nodeValue.length>0)return!1===Zf(u,a,"A")?I.some(vc(u,r?u.nodeValue.length:0)):I.none();if(t.isBlock(u)||c[u.nodeName.toLowerCase()])return I.none();i=u}return n&&i?I.some(vc(i,0)):I.none()},id=function(t,e,n,r){var o,i,u,a,c=t.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var l=wn(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(a=n,po(o))return I.none();if(wn(o)&&i>o.childNodes.length-1&&(a=!1),Dn(o)&&(o=c,i=0),o===c){if(a&&(u=o.childNodes[i>0?i-1:0])){if(po(u))return I.none();if(f[u.nodeName]||td(u))return I.none()}if(o.hasChildNodes()){if(i=Math.min(!a&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=En(o)&&l?o.data.length:0,!e&&o===c.lastChild&&td(o))return I.none();if(function(t,e){for(;e&&e!==t;){if(Bn(e))return!0;e=e.parentNode}return!1}(c,o)||po(o))return I.none();if(o.hasChildNodes()&&!1===td(o)){u=o;var d=new Yr(o,c);do{if(Bn(u)||po(u)){s=!1;break}if(En(u)&&u.nodeValue.length>0){i=a?0:u.nodeValue.length,o=u,s=!0;break}if(f[u.nodeName.toLowerCase()]&&!ed(u)){i=t.nodeIndex(u),o=u.parentNode,a||i++,s=!0;break}}while(u=a?d.next():d.prev())}}}return e&&(En(o)&&0===i&&od(t,l,e,!0,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),wn(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Rn(u)||function(t,e){return t.previousSibling&&t.previousSibling.nodeName===e}(u,"A")||rd(t,u,!1)||rd(t,u,!0)||od(t,l,e,!0,u).each((function(t){o=t.container(),i=t.offset(),s=!0})))),a&&!e&&En(o)&&i===o.nodeValue.length&&od(t,l,e,!1,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),s?I.some(vc(o,i)):I.none()},ud=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=vc.fromRangeStart(e);return id(t,n,!0,r).each((function(t){n&&vc.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||id(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),Jf(e,r)?I.none():I.some(r)},ad=function(t,e){return t.splitText(e)},cd=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&En(e)?n>0&&n<e.nodeValue.length&&(e=(r=ad(e,n)).previousSibling,o>n?(e=r=ad(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(En(e)&&n>0&&n<e.nodeValue.length&&(e=ad(e,n),n=0),En(r)&&o>0&&o<r.nodeValue.length&&(o=(r=ad(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}},sd=function(t){return{walk:function(e,n){return wf(t,e,n)},split:cd,normalize:function(e){return ud(t,e).fold(R,(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))}}};sd.compareRanges=Jf,sd.getCaretRangeFromPoint=Yf,sd.getSelectedNode=Ka,sd.getNode=Ya;var ld,fd=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Xn(n,t);return parseFloat(o)||0}return r},r=function(t,e){return Y(e,(function(e,n){var r=Xn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!x(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Fn(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}("height",(function(t){var e=t.dom;return cn(t)?e.getBoundingClientRect().height:e.offsetHeight})),dd=function(t,e){return t.view(e).fold(O([]),(function(e){var n=t.owner(e),r=dd(t,n);return[e].concat(r)}))},md=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?I.none():I.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(ye.fromDom)},owner:function(t){return ze(t)}}),gd=function(t){var e=ye.fromDom(document),n=mn(e),r=function(t,e){var n=e.owner(t);return dd(e,n)}(t,md),o=dn(t),i=K(r,(function(t,e){var n=dn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return ln(i.left+o.left+n.left,i.top+o.top+n.top)},hd=function(t){return"textarea"===_e(t)},pd=function(t,e){var n=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return ln(n.offsetLeft,n.offsetTop);var i=fn(null==r?void 0:r.pageYOffset,o.scrollTop),u=fn(null==r?void 0:r.pageXOffset,o.scrollLeft),a=fn(o.clientTop,n.clientTop),c=fn(o.clientLeft,n.clientLeft);return dn(t).translate(u-c,i-a)}(t),r=function(t){return fd.get(t)}(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}},vd=function(t,e){var n=function(t,e){var n=Ve(t);if(0===n.length||hd(t))return{element:t,offset:e};if(e<n.length&&!hd(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return hd(r)?{element:t,offset:e}:"img"===_e(r)?{element:r,offset:1}:De(r)?{element:r,offset:zf(r).length}:{element:r,offset:Ve(r).length}}(t,e),r=ye.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>');return Ze(n.element,r),pd(r,(function(){return un(r)}))},bd=function(t,e,n,r){Cd(t,(function(o,i){return wd(t,e,n,r)}),n)},yd=function(t,e,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(t,e){return t.fire("ScrollIntoView",e).isDefaultPrevented()})(t,i)||(n(e,mn(e).top,r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},wd=function(t,e,n,r){var o=ye.fromDom(t.getBody()),i=ye.fromDom(t.getDoc());o.dom.offsetWidth;var u=vd(ye.fromDom(n.startContainer),n.startOffset);yd(t,i,e,u,r),u.cleanup()},xd=function(t,e,n,r){var o=ye.fromDom(t.getDoc());yd(t,o,n,function(t){return pd(ye.fromDom(t),C)}(e),r)},Cd=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,u=n.endOffset;e(ye.fromDom(r),ye.fromDom(i));var a=t.dom.createRng();a.setStart(r,o),a.setEnd(i,u),t.selection.setRng(n)},Sd=function(t,e,n,r){var o=t.pos;if(n)gn(o.left,o.top,r);else{var i=o.top-e+t.height;gn(o.left,i,r)}},kd=function(t,e,n,r,o){var i=n+e,u=r.pos.top,a=r.bottom,c=a-u>=n;if(u<e)Sd(r,n,!1!==o,t);else if(u>i){Sd(r,n,c?!1!==o:!0===o,t)}else a>i&&!c&&Sd(r,n,!0===o,t)},Od=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;kd(t,e,o,n,r)},_d=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;kd(t,e,o,n,r);var i=gd(n.element),u=vn(window);i.top<u.y?hn(n.element,!1!==r):i.top>u.bottom&&hn(n.element,!0===r)},Td=function(t,e,n){return bd(t,Od,e,n)},Ed=function(t,e,n){return xd(t,e,Od,n)},Ad=function(t,e,n){return bd(t,_d,e,n)},Dd=function(t,e,n){return xd(t,e,_d,n)},Md=function(t,e,n){(t.inline?Td:Ad)(t,e,n)},Rd=function(t){var e=Ke(t).dom;return t.dom===e.activeElement},Nd=function(t){return void 0===t&&(t=ye.fromDom(document)),I.from(t.dom.activeElement).map(ye.fromDom)},zd=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Bd=gr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Pd=(Bd.before,Bd.on,Bd.after,function(t){return t.fold(_,_,_)}),Id=gr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ld={domRange:Id.domRange,relative:Id.relative,exact:Id.exact,exactFromRange:function(t){return Id.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return ye.fromDom(t.startContainer)},relative:function(t,e){return Pd(t)},exact:function(t,e,n,r){return t}})}(t);return Be(e)},range:zd},Hd=re().browser,Fd=function(t,e){var n=De(e)?zf(e).length:Ve(e).length+1;return t>n?n:t<0?0:t},Vd=function(t){return Ld.range(t.start,Fd(t.soffset,t.start),t.finish,Fd(t.foffset,t.finish))},jd=function(t,e){return!yn(e.dom)&&(Oe(t,e)||Se(t,e))},Ud=function(t){return function(e){return jd(t,e.start)&&jd(t,e.finish)}},Wd=function(t){return!0===t.inline||Hd.isIE()},qd=function(t){return Ld.range(ye.fromDom(t.startContainer),t.startOffset,ye.fromDom(t.endContainer),t.endOffset)},Gd=function(t){return function(t){var e=t.getSelection();return(e&&0!==e.rangeCount?I.from(e.getRangeAt(0)):I.none()).map(qd)}(Be(t).dom).filter(Ud(t))},$d=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),I.some(e)}catch(t){return I.none()}},Xd=function(t){var e=Wd(t)?Gd(ye.fromDom(t.getBody())):I.none();t.bookmark=e.isSome()?e:t.bookmark},Kd=function(t){return(t.bookmark?t.bookmark:I.none()).bind((function(e){return function(t,e){return I.from(e).filter(Ud(t)).map(Vd)}(ye.fromDom(t.getBody()),e)})).bind($d)},Yd={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},Jd=function(t,e){re().browser.isIE()?function(t){t.on("focusout",(function(){Xd(t)}))}(t):function(t,e){t.on("mouseup touchend",(function(t){e.throttle()}))}(t,e),t.on("keyup NodeChange",(function(e){(function(t){return"nodechange"===t.type&&t.selectionChange})(e)||Xd(t)}))},Qd=function(t){var e=pa((function(){Xd(t)}),0);t.on("init",(function(){t.inline&&function(t,e){var n=function(){e.throttle()};oa.DOM.bind(document,"mouseup",n),t.on("remove",(function(){oa.DOM.unbind(document,"mouseup",n)}))}(t,e),Jd(t,e)})),t.on("remove",(function(){e.cancel()}))},Zd=oa.DOM,tm=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t);return null!==Zd.getParent(e,(function(e){return function(t){return Yd.isEditorUIElement(t)}(e)||!!n&&t.dom.is(e,n)}))},em=function(t,e){var n=e.editor;Qd(n),n.on("focusin",(function(){var e=t.focusedEditor;e!==n&&(e&&e.fire("blur",{focusedEditor:n}),t.setActive(n),t.focusedEditor=n,n.fire("focus",{blurredEditor:e}),n.focus(!0))})),n.on("focusout",(function(){$r.setEditorTimeout(n,(function(){var e=t.focusedEditor;tm(n,function(t){try{var e=Ke(ye.fromDom(t.getElement()));return Nd(e).fold((function(){return document.body}),(function(t){return t.dom}))}catch(t){return document.body}}(n))||e!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),ld||(ld=function(e){var n=t.activeEditor;n&&function(t){if(Xe()&&y(t.target)){var e=ye.fromDom(t.target);if(Ae(e)&&Qe(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return ut(n)}}return I.from(t.target)}(e).each((function(e){e.ownerDocument===document&&(e===document.body||tm(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},Zd.bind(document,"focusin",ld))},nm=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(Zd.unbind(document,"focusin",ld),ld=null)},rm=function(t,e){return function(t){return t.collapsed?I.from(Ya(t.startContainer,t.startOffset)).map(ye.fromDom):I.none()}(e).bind((function(e){return io(e)?I.some(e):!1===Oe(t,e)?I.some(t):I.none()}))},om=function(t,e){rm(ye.fromDom(t.getBody()),e).bind((function(t){return Sl(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},im=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},um=function(t){return Rd(t)||(e=t,Nd(Ke(e)).filter((function(t){return e.dom.contains(t.dom)}))).isSome();var e},am=function(t){return t.inline?function(t){var e=t.getBody();return e&&um(ye.fromDom(e))}(t):function(t){return t.iframeElement&&Rd(ye.fromDom(t.iframeElement))}(t)},cm=function(t){return am(t)||function(t){var e=Ke(ye.fromDom(t.getElement()));return Nd(e).filter((function(e){return n=e.dom,!(void 0!==(r=n.classList)&&(r.contains("tox-edit-area")||r.contains("tox-edit-area__iframe")||r.contains("mce-content-body")))&&tm(t,e.dom);var n,r})).isSome()}(t)},sm=function(t){return t.editorManager.setActive(t)},lm=function(t,e){t.removed||(e?sm(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===am(t)&&Kd(t).each((function(e){t.selection.setRng(e),r=e}));var o=function(t,e){return t.dom.getParent(e,(function(e){return"true"===t.dom.getContentEditable(e)}))}(t,e.getNode());if(t.$.contains(n,o))return im(o),om(t,r),void sm(t);t.inline||(de.opera||im(n),t.getWin().focus()),(de.gecko||t.inline)&&(im(n),om(t,r)),sm(t)}(t))},fm=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,u=n?e.startOffset:e.endOffset;return I.from(i).map(ye.fromDom).map((function(t){return r&&e.collapsed?t:je(t,o(t,u)).getOr(t)})).bind((function(t){return Ae(t)?I.some(t):Pe(t).filter(Ae)})).map((function(t){return t.dom})).getOr(t)},dm=function(t,e,n){return fm(t,e,!0,n,(function(t,e){return Math.min(qe(t),e)}))},mm=function(t,e,n){return fm(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},gm=function(t,e){for(var n=t;t&&En(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},hm=function(t,e){return W(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},pm={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},vm=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var u=t.parent;u&&u!==e;u=u.parent)if(i=u[o])return i}},bm=function(t){if(!Io(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},ym=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},wm=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,pm[e]||1);return n&&dt(n,(function(t,e){r.attr(e,t)})),r},t.prototype.replace=function(t){return t.parent&&t.remove(),this.insert(t,this),this.remove(),this},t.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&dt(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=new t(this.name,this.type);if(e=this.attributes){var r=[];r.map={};for(var o=0,i=e.length;o<i;o++){var u=e[o];"id"!==u.name&&(r[r.length]={name:u.name,value:u.value},r.map[u.name]=u.value)}n.attributes=r}return n.value=this.value,n.shortEnded=this.shortEnded,n},t.prototype.wrap=function(t){return this.parent.insert(t,this),t.append(this),this},t.prototype.unwrap=function(){for(var t=this.firstChild;t;){var e=t.next;this.insert(t,this,!0),t=e}this.remove()},t.prototype.remove=function(){var t=this.parent,e=this.next,n=this.prev;return t&&(t.firstChild===this?(t.firstChild=e,e&&(e.prev=null)):n.next=e,t.lastChild===this?(t.lastChild=n,n&&(n.next=null)):e.prev=n,this.parent=this.next=this.prev=null),this},t.prototype.append=function(t){t.parent&&t.remove();var e=this.lastChild;return e?(e.next=t,t.prev=e,this.lastChild=t):this.lastChild=this.firstChild=t,t.parent=this,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=vm(n,this))n.name===t&&e.push(n);return e},t.prototype.children=function(){for(var t=[],e=this.firstChild;e;e=e.next)t.push(e);return t},t.prototype.empty=function(){if(this.firstChild){for(var t=[],e=this.firstChild;e;e=vm(e,this))t.push(e);for(var n=t.length;n--;){(e=t[n]).parent=e.firstChild=e.lastChild=e.next=e.prev=null}}return this.firstChild=this.lastChild=null,this},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this.firstChild;if(ym(this))return!1;if(r)do{if(1===r.type){if(r.attr("data-mce-bogus"))continue;if(t[r.name])return!1;if(ym(r))return!1}if(8===r.type)return!1;if(3===r.type&&!bm(r))return!1;if(3===r.type&&r.parent&&e[r.parent.name]&&Io(r.value))return!1;if(n&&n(r))return!1}while(r=vm(r,this));return!0},t.prototype.walk=function(t){return vm(this,null,t)},t}(),xm=function(t,e){return t.replace(e.re,(function(t){return yt(e.uris,t).getOr(t)}))},Cm=ve.each,Sm=ve.trim,km="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Om={ftp:21,http:80,https:443,mailto:25},_m=["img","video"],Tm=function(t,e,n){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?function(t,e){return y(t)?!t:!y(e)||!j(_m,e)}(t.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))},Em=function(){function t(e,n){e=Sm(e),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))o.source=e;else{var i=0===e.indexOf("//");if(0!==e.indexOf("/")||i||(e=(r&&r.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var u=this.settings.base_uri?this.settings.base_uri.path:new t(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+o.toAbsPath(u,e);else{var a=/([^#?]*)([#?]?.*)/.exec(e);e=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(u,a[1])+a[2]}}e=e.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);Cm(km,(function(t,e){var n=c[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[t]=n})),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="")}}return t.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.isDomSafe=function(t,e,n){if(void 0===n&&(n={}),n.allow_script_urls)return!0;var r=ai.decode(t).replace(/[\s\u0000-\u001F]+/g,"");try{r=decodeURIComponent(r)}catch(t){r=unescape(r)}return!/((java|vb)script|mhtml):/i.test(r)&&!Tm(n,r,e)},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=Om[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",u=t.substring(0,t.lastIndexOf("/")).split("/"),a=e.split("/");if(u.length>=a.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||u[n]!==a[n]){o=n+1;break}if(u.length<a.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||u[n]!==a[n]){o=n+1;break}if(1===o)return e;for(n=0,r=u.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=a.length;n<r;n++)i+=n!==o-1?"/"+a[n]:a[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],u=/\/$/.test(e)?"/":"",a=t.split("/"),c=e.split("/");for(Cm(a,(function(t){t&&i.push(t)})),a=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=a.length-o)<=0?nt(i).join("/"):a.slice(0,n).join("/")+"/"+nt(i).join("/")).indexOf("/")&&(r="/"+r),u&&r.lastIndexOf("/")!==r.length-1&&(r+=u),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),Am=ve.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),Dm=function(t,e,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=t.getShortEndedElements(),u=1,a=n;0!==u;)for(r.lastIndex=a;;){var c=r.exec(e);if(null===c)return a;if("!"===c[1]){a=Lt(c[2],"--")?Mm(e,!1,c.index+"!--".length):Mm(e,!0,c.index+1);break}o.lastIndex=r.lastIndex;var s=o.exec(e);if(!h(s)&&s.index===r.lastIndex){"/"===c[1]?u-=1:wt(i,c[2])||(u+=1),a=r.lastIndex+s[0].length;break}}return a},Mm=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(t.substr(e))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var u=/--!?>/g;u.lastIndex=n;var a=u.exec(t);return a?a.index+a[0].length:r.length},Rm=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null},Nm=function(t,e){var n;void 0===e&&(e=yi());var r=null!==(n=(t=t||{}).document)&&void 0!==n?n:document,o=r.createElement("form");!1!==t.fix_self_closing&&(t.fix_self_closing=!0);var i=t.comment?t.comment:C,u=t.cdata?t.cdata:C,a=t.text?t.text:C,c=t.start?t.start:C,s=t.end?t.end:C,l=t.pi?t.pi:C,f=t.doctype?t.doctype:C,d=function(n,d){void 0===d&&(d="html");for(var m,g,h,p,v,b,y,w,x,C,S,k,O,_,T,E,A,D,M,R=n.html,N=0,z=[],B=0,P=ai.decode,I=ve.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),L="html"===d?0:1,H=function(t){var e,n;for(e=z.length;e--&&z[e].name!==t;);if(e>=0){for(n=z.length-1;n>=e;n--)(t=z[n]).valid&&s(t.name);z.length=e}},F=function(t,e){return a(xm(t,n),e)},V=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),i(xm(e,n)))},j=function(t,e){var n=t||"",r=!Lt(n,"--"),o=Mm(R,r,e);return t=R.substr(e,o-e),V(r?n+t:t),o+1},U=function(e,i,u,a,c){if(u=function(t){return xm(t,n)}((i=i.toLowerCase())in X?i:P(u||a||c||"")),K&&!w&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(i)){var s=_[i];if(!s&&T){for(var l=T.length;l--&&!(s=T[l]).pattern.test(i););-1===l&&(s=null)}if(!s)return;if(s.validValues&&!(u in s.validValues))return}("name"===i||"id"===i)&&e in Am&&(u in r||u in o)||I[i]&&!Em.isDomSafe(u,e,t)||w&&(i in I||0===i.indexOf("on"))||(p.map[i]=u,p.push({name:i,value:u}))},W=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),q=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,G=e.getShortEndedElements(),$=t.self_closing_elements||e.getSelfClosingElements(),X=e.getBoolAttrs(),K=t.validate,Y=t.remove_internals,J=t.fix_self_closing,Q=e.getSpecialElements(),Z=R+">";m=W.exec(Z);){var tt=m[0];if(N<m.index&&F(P(R.substr(N,m.index-N))),g=m[7])":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),H(g);else if(g=m[8]){if(m.index+tt.length>R.length){F(P(R.substr(m.index))),N=m.index+tt.length;continue}":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),x=g in G,J&&$[g]&&z.length>0&&z[z.length-1].name===g&&H(g);var et=Rm(q,m[9]);if(null!==et){if("all"===et){N=Dm(e,R,W.lastIndex),W.lastIndex=N;continue}S=!1}if(!K||(C=e.getElementRule(g))){if(S=!0,K&&(_=C.attributes,T=C.attributePatterns),(O=m[9])?((w=-1!==O.indexOf("data-mce-type"))&&Y&&(S=!1),(p=[]).map={},O.replace(q,(function(t,e,n,r,o){return U(g,e,n,r,o),""}))):(p=[]).map={},K&&!w){if(E=C.attributesRequired,A=C.attributesDefault,D=C.attributesForced,C.removeEmptyAttrs&&!p.length&&(S=!1),D)for(v=D.length;v--;)y=(k=D[v]).name,"{$uid}"===(M=k.value)&&(M="mce_"+B++),p.map[y]=M,p.push({name:y,value:M});if(A)for(v=A.length;v--;)(y=(k=A[v]).name)in p.map||("{$uid}"===(M=k.value)&&(M="mce_"+B++),p.map[y]=M,p.push({name:y,value:M}));if(E){for(v=E.length;v--&&!(E[v]in p.map););-1===v&&(S=!1)}if(k=p.map["data-mce-bogus"]){if("all"===k){N=Dm(e,R,W.lastIndex),W.lastIndex=N;continue}S=!1}}S&&c(g,p,x)}else S=!1;if(h=Q[g]){h.lastIndex=N=m.index+tt.length,(m=h.exec(R))?(S&&(b=R.substr(N,m.index-N)),N=m.index+m[0].length):(b=R.substr(N),N=R.length),S&&(b.length>0&&F(b,!0),s(g)),W.lastIndex=N;continue}x||(O&&O.indexOf("/")===O.length-1?S&&s(g):z.push({name:g,valid:S}))}else if(g=m[1])V(g);else if(g=m[2]){if(!(1===L||t.preserve_cdata||z.length>0&&e.isValidChild(z[z.length-1].name,"#cdata"))){N=j("",m.index+2),W.lastIndex=N;continue}u(g)}else if(g=m[3])f(g);else{if((g=m[4])||"<!"===tt){N=j(g,m.index+tt.length),W.lastIndex=N;continue}if(g=m[5]){if(1!==L){N=j("?",m.index+2),W.lastIndex=N;continue}l(g,m[6])}}N=m.index+tt.length}for(N<R.length&&F(P(R.substr(N))),v=z.length-1;v>=0;v--)(g=z[v]).valid&&s(g.name)};return{parse:function(t,e){void 0===e&&(e="html"),d(function(t){for(var e,n=/data:[^;<"'\s]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=Ba("img"),u=0,a=0;e=n.exec(t);){var c=e[0],s=i+"_"+a++;o[s]=c,u<e.index&&r.push(t.substr(u,e.index-u)),r.push(s),u=e.index+c.length}var l=new RegExp(i+"_[0-9]+","g");return 0===u?{prefix:i,uris:o,html:t,re:l}:(u<t.length&&r.push(t.substr(u)),{prefix:i,uris:o,html:r.join(""),re:l})}(t),e)}}};Nm.findEndTag=Dm;var zm=function(t,e){for(var n,r=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,o=t.schema,i=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")}(t.getTempAttrs(),e),u=o.getShortEndedElements();n=r.exec(i);){var a=r.lastIndex,c=n[0].length,s=void 0;s=u[n[1]]?a:Nm.findEndTag(o,i,a),i=i.substring(0,a-c)+i.substring(s),r.lastIndex=a-c}return lo(i)},Bm=zm,Pm=function(t,e,n,r){var o,i=function(t,e){return Dt(Dt({},t),{format:e,get:!0,getInner:!0})}(e,n),u=e.no_events?i:t.fire("BeforeGetContent",i);return o="raw"===u.format?ve.trim(Bm(t.serializer,r.innerHTML)):"text"===u.format?t.dom.isEmpty(r)?"":lo(r.innerText||r.textContent):"tree"===u.format?t.serializer.serialize(r,u):function(t,e){var n=Wc(t),r=new RegExp("^(<"+n+"[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,u)),j(["text","tree"],u.format)||ao(ye.fromDom(r))?u.content=o:u.content=ve.trim(o),u.no_events?u.content:t.fire("GetContent",u).content},Im=ve.each,Lm=function(t){return{compare:function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return Im(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(wt(t,r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(wt(e,r))return!1;return!0};return!!o(r(e),r(n))&&(!!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))&&(!Il(e)&&!Il(n)))}}},Hm=ve.makeMap,Fm=function(t){var e=[],n=(t=t||{}).indent,r=Hm(t.indent_before||""),o=Hm(t.indent_after||""),i=ai.getEncodeFunc(t.entity_encoding||"raw",t.entities),u="html"===t.element_format;return{start:function(t,a,c){var s,l,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),a)for(s=0,l=a.length;s<l;s++)f=a[s],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!c||u?">":" />",c&&n&&o[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1]).length>0&&"\n"!==r&&e.push("\n")},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},Vm=function(t,e){void 0===e&&(e=yi());var n=Fm(t);(t=t||{}).validate=!("validate"in t)||t.validate;return{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{u(t)}while(t=t.next)}};n.reset();var u=function(t){var r=i[t.type];if(r)r(t);else{var a=t.name,c=t.shortEnded,s=t.attributes;if(o&&s&&s.length>1){var l=[];l.map={};var f=e.getElementRule(t.name);if(f){for(var d=0,m=f.attributesOrder.length;d<m;d++){if((h=f.attributesOrder[d])in s.map){var g=s.map[h];l.map[h]=g,l.push({name:h,value:g})}}for(d=0,m=s.length;d<m;d++){var h;if(!((h=s[d].name)in l.map)){g=s.map[h];l.map[h]=g,l.push({name:h,value:g})}}s=l}}if(n.start(t.name,s,c),!c){if(t=t.firstChild)do{u(t)}while(t=t.next);n.end(a)}}};return 1!==r.type||t.inner?i[11](r):u(r),n.getContent()}}},jm=new Set;q(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],(function(t){jm.add(t)}));var Um=["font","text-decoration","text-emphasis"],Wm=function(t,e){return lt(t.parseStyle(t.getAttrib(e,"style")))},qm=function(t,e){return et(Wm(t,e),(function(t){return!function(t){return jm.has(t)}(t)}))},Gm=function(t,e,n){var r=Wm(t,e),o=Wm(t,n),i=function(r){var o=t.getStyle(e,r),i=t.getStyle(n,r);return Ut(o)&&Ut(i)&&o!==i};return U(r,(function(t){var e=function(e){return U(e,(function(e){return e===t}))};if(!e(o)&&e(Um)){var n=X(o,(function(t){return U(Um,(function(e){return Lt(t,e)}))}));return U(n,i)}return i(t)}))},$m=function(t,e,n){return I.from(n.container()).filter(En).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},Xm=E($m,!0,Hl),Km=E($m,!1,Hl),Ym=function(t){var e=t.container();return En(e)&&(0===e.data.length||so(e.data)&&Ff.isBookmarkNode(e.parentNode))},Jm=function(t,e){return function(n){return I.from(Us(t?0:-1,n)).filter(e).isSome()}},Qm=function(t){return Nn(t)&&"block"===Xn(ye.fromDom(t),"display")},Zm=function(t){return Bn(t)&&!function(t){return wn(t)&&"all"===t.getAttribute("data-mce-bogus")}(t)},tg=Jm(!0,Qm),eg=Jm(!1,Qm),ng=Jm(!0,In),rg=Jm(!1,In),og=Jm(!0,On),ig=Jm(!1,On),ug=Jm(!0,Zm),ag=Jm(!1,Zm),cg=function(t){var e=_a(t,"br"),n=X(function(t){for(var e=[],n=t.dom;n;)e.push(ye.fromDom(n)),n=n.lastChild;return e}(t).slice(-1),eo);e.length===n.length&&q(n,un)},sg=function(t){on(t),nn(t,ye.fromHtml('<br data-mce-bogus="1">'))},lg=function(t){We(t).each((function(e){Ie(e).each((function(n){Zr(t)&&eo(e)&&Zr(n)&&un(e)}))}))},fg=function(t,e,n){return Oe(e,t)?function(t,e){for(var n=w(e)?e:R,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=ye.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o}(t,(function(t){return n(t)||Se(t,e)})).slice(0,-1):[]},dg=function(t,e){return fg(t,e,R)},mg=function(t,e){return[t].concat(dg(t,e))},gg=function(t,e,n){return yl(t,e,n,Ym)},hg=function(t,e){return Q(mg(ye.fromDom(e.container()),t),Zr)},pg=function(t,e,n){return gg(t,e.dom,n).forall((function(t){return hg(e,n).fold((function(){return!1===js(t,n,e.dom)}),(function(r){return!1===js(t,n,e.dom)&&Oe(r,ye.fromDom(t.container()))}))}))},vg=function(t,e,n){return hg(e,n).fold((function(){return gg(t,e.dom,n).forall((function(t){return!1===js(t,n,e.dom)}))}),(function(e){return gg(t,e.dom,n).isNone()}))},bg=E(vg,!1),yg=E(vg,!0),wg=E(pg,!1),xg=E(pg,!0),Cg=function(t){return Qs(t).exists(eo)},Sg=function(t,e,n){var r=X(mg(ye.fromDom(n.container()),e),Zr),o=ut(r).getOr(e);return vl(t,o.dom,n).filter(Cg)},kg=function(t,e){return Qs(e).exists(eo)||Sg(!0,t,e).isSome()},Og=function(t,e){return function(t){return I.from(t.getNode(!0)).map(ye.fromDom)}(e).exists(eo)||Sg(!1,t,e).isSome()},_g=E(Sg,!1),Tg=E(Sg,!0),Eg=function(t){return vc.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},Ag=function(t,e){var n=X(mg(ye.fromDom(e.container()),t),Zr);return ut(n).getOr(t)},Dg=function(t,e){return Eg(e)?Km(e):Km(e)||Cl(Ag(t,e).dom,e).exists(Km)},Mg=function(t,e){return Eg(e)?Xm(e):Xm(e)||xl(Ag(t,e).dom,e).exists(Xm)},Rg=function(t){return Qs(t).bind((function(t){return Lr(t,Ae)})).exists((function(t){return function(t){return j(["pre","pre-wrap"],t)}(Xn(t,"white-space"))}))},Ng=function(t,e){return function(t,e){return Cl(t.dom,e).isNone()}(t,e)||function(t,e){return xl(t.dom,e).isNone()}(t,e)||bg(t,e)||yg(t,e)||Og(t,e)||kg(t,e)},zg=function(t,e){return!Rg(e)&&(bg(t,e)||wg(t,e)||Og(t,e)||Dg(t,e))},Bg=function(t,e){return!Rg(e)&&(yg(t,e)||xg(t,e)||kg(t,e)||Mg(t,e))},Pg=function(t,e){return zg(t,e)||Bg(t,function(t){var e=t.container(),n=t.offset();return En(e)&&n<e.data.length?vc(e,n+1):t}(e))},Ig=function(t,e){return Ll(t.charAt(e))},Lg=function(t){var e=t.container();return En(e)&&It(e.data," ")},Hg=function(t){var e=t.data,n=function(t){var e=t.split("");return W(e,(function(t,n){return Ll(t)&&n>0&&n<e.length-1&&Fl(e[n-1])&&Fl(e[n+1])?" ":t})).join("")}(e);return n!==e&&(t.data=n,!0)},Fg=function(t,e){return I.some(e).filter(Lg).bind((function(e){var n=e.container();return function(t,e){var n=e.data,r=vc(e,0);return!(!Ig(n,0)||Pg(t,r))&&(e.data=" "+n.slice(1),!0)}(t,n)||Hg(n)||function(t,e){var n=e.data,r=vc(e,n.length-1);return!(!Ig(n,n.length-1)||Pg(t,r))&&(e.data=n.slice(0,-1)+" ",!0)}(t,n)?I.some(e):I.none()}))},Vg=function(t){var e=ye.fromDom(t.getBody());t.selection.isCollapsed()&&Fg(e,vc.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},jg=function(t,e,n){if(0!==n){var r=ye.fromDom(t),o=Ir(r,Zr).getOr(r),i=t.data.slice(e,e+n),u=e+n>=t.data.length&&Bg(o,vc(t,t.data.length)),a=0===e&&zg(o,vc(t,0));t.replaceData(e,n,function(t,e,n){return Y(t,(function(r,o){return Hl(o)||Ll(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+" "}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(i,a,u))}},Ug=function(t,e){var n=t.data.slice(e),r=n.length-Vt(n).length;jg(t,e,r)},Wg=function(t,e){var n=t.data.slice(0,e),r=n.length-jt(n).length;jg(t,e-r,r)},qg=function(t,e,n,r){void 0===r&&(r=!0);var o=jt(t.data).length,i=r?t:e,u=r?e:t;return r?i.appendData(u.data):i.insertData(0,u.data),un(ye.fromDom(u)),n&&Ug(i,o),i},Gg=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===vc.isTextPosition(t)&&n===e.parentNode&&r>vc.before(e).offset()}(e,t)?vc(e.container(),e.offset()-1):e},$g=function(t){return No(t.previousSibling)?I.some((e=t.previousSibling,En(e)?vc(e,e.data.length):vc.after(e))):t.previousSibling?kl(t.previousSibling):I.none();var e},Xg=function(t){return No(t.nextSibling)?I.some((e=t.nextSibling,En(e)?vc(e,0):vc.before(e))):t.nextSibling?Sl(t.nextSibling):I.none();var e},Kg=function(t,e){return $g(e).orThunk((function(){return Xg(e)})).orThunk((function(){return function(t,e){var n=vc.before(e.previousSibling?e.previousSibling:e.parentNode);return Cl(t,n).fold((function(){return xl(t,vc.after(e))}),I.some)}(t,e)}))},Yg=function(t,e){return Xg(e).orThunk((function(){return $g(e)})).orThunk((function(){return function(t,e){return xl(t,vc.after(e)).fold((function(){return Cl(t,vc.before(e))}),I.some)}(t,e)}))},Jg=function(t,e,n){return function(t,e,n){return t?Yg(e,n):Kg(e,n)}(t,e,n).map(E(Gg,n))},Qg=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},Zg=function(t,e){return e&&wt(t.schema.getBlockElements(),_e(e))},th=function(t){if(Uo(t)){var e=ye.fromHtml('<br data-mce-bogus="1">');return on(t),nn(t,e),I.some(vc.before(e.dom))}return I.none()},eh=function(t,e,n){var r,o,i,u,a=Ie(t).filter(De),c=Le(t).filter(De);return un(t),(r=a,o=c,i=e,u=function(t,e,r){var o=t.dom,i=e.dom,u=o.data.length;return qg(o,i,n),r.container()===i?vc(o,u):r},r.isSome()&&o.isSome()&&i.isSome()?I.some(u(r.getOrDie(),o.getOrDie(),i.getOrDie())):I.none()).orThunk((function(){return n&&(a.each((function(t){return Wg(t.dom,t.dom.length)})),c.each((function(t){return Ug(t.dom,0)}))),e}))},nh=function(t,e,n,r){void 0===r&&(r=!0);var o,i=Jg(e,t.getBody(),n.dom),u=Ir(n,E(Zg,t),(o=t.getBody(),function(t){return t.dom===o})),a=eh(n,i,function(t,e){return wt(t.schema.getTextInlineElements(),_e(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(th).fold((function(){r&&Qg(t,e,a)}),(function(n){r&&Qg(t,e,I.some(n))}))},rh=function(t){return _a(t,"td,th")},oh=function(t,e){return{start:t,end:e}},ih=gr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),uh=function(t,e){return jr(ye.fromDom(t),"td,th",e)},ah=function(t){return!Se(t.start,t.end)},ch=function(t,e){return Of(t.start,e).bind((function(n){return Of(t.end,e).bind((function(t){return e=Se(n,t),r=n,e?I.some(r):I.none();var e,r}))}))},sh=function(t){return function(e){return ch(e,t).map((function(t){return function(t,e,n){return{rng:t,table:e,cells:n}}(e,t,rh(t))}))}},lh=function(t,e,n,r){if(n.collapsed||!t.forall(ah))return I.none();if(e.isSameTable){var o=t.bind(sh(r));return I.some({start:o,end:o})}var i=uh(n.startContainer,r),u=uh(n.endContainer,r),a=i.bind(function(t){return function(e){return Of(e,t).bind((function(t){return at(rh(t)).map((function(t){return oh(e,t)}))}))}}(r)).bind(sh(r)),c=u.bind(function(t){return function(e){return Of(e,t).bind((function(t){return ut(rh(t)).map((function(t){return oh(t,e)}))}))}}(r)).bind(sh(r));return I.some({start:a,end:c})},fh=function(t,e){return Z(t,(function(t){return Se(t,e)}))},dh=function(t){return Hn(fh(t.cells,t.rng.start),fh(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))},mh=function(t,e,n){return t.exists((function(t){return function(t,e){return!ah(t)&&ch(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&Ef(t.start,e)}))},gh=function(t,e){var n=e.startTable,r=e.endTable,o=t.cloneRange();return n.each((function(t){return o.setStartAfter(t.dom)})),r.each((function(t){return o.setEndBefore(t.dom)})),o},hh=function(t,e){var n=function(t){return function(e){return Se(t,e)}}(t),r=function(t,e){var n=uh(t.startContainer,e),r=uh(t.endContainer,e);return Hn(n,r,oh)}(e,n),o=function(t,e){var n=function(t){return Of(ye.fromDom(t),e)},r=n(t.startContainer),o=n(t.endContainer),i=r.isSome(),u=o.isSome(),a=Hn(r,o,Se).getOr(!1);return{startTable:r,endTable:o,isStartInTable:i,isEndInTable:u,isSameTable:a,isMultiTable:!a&&i&&u}}(e,n);return mh(r,e,n)?r.map((function(t){return ih.singleCellTable(e,t.start)})):o.isMultiTable?function(t,e,n,r){return lh(t,e,n,r).bind((function(t){var r=t.start,o=t.end,i=r.bind(dh).getOr([]),u=o.bind(dh).getOr([]);if(i.length>0&&u.length>0){var a=gh(n,e);return I.some(ih.multiTable(i,u,a))}return I.none()}))}(r,o,e,n):function(t,e,n,r){return lh(t,e,n,r).bind((function(t){var e=t.start,n=t.end;return e.or(n)})).bind((function(t){var r=e.isSameTable,o=dh(t).getOr([]);if(r&&t.cells.length===o.length)return I.some(ih.fullTable(t.table));if(o.length>0){if(r)return I.some(ih.partialTable(o,I.none()));var i=gh(n,e);return I.some(ih.partialTable(o,I.some(Dt(Dt({},e),{rng:i}))))}return I.none()}))}(r,o,e,n)},ph=function(t){var e;return(8===Te(e=t)||"#comment"===_e(e)?Ie(t):We(t)).bind(ph).orThunk((function(){return I.some(t)}))},vh=function(t){return q(t,(function(t){Gn(t,"contenteditable"),sg(t)}))},bh=function(t,e,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(e.dom.lastChild)):(o.setStartBefore(e.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),Ch(t,o,e,!1)},yh=function(t){var e=kf(t),n=ye.fromDom(t.selection.getNode());Pn(n.dom)&&Uo(n)?t.selection.setCursorLocation(n.dom,0):t.selection.collapse(!0),e.length>1&&U(e,(function(t){return Se(t,n)}))&&jn(n,"data-mce-selected","1")},wh=function(t,e,n){var r=t.selection.getRng(),o=n.bind((function(n){var o=n.rng,i=n.isStartInTable,u=function(t,e){return I.from(t.dom.getParent(e,t.dom.isBlock)).map(ye.fromDom)}(t,i?o.endContainer:o.startContainer);o.deleteContents(),function(t,e,n){n.each((function(n){e?un(n):(sg(n),t.selection.setCursorLocation(n.dom,0))}))}(t,i,u.filter(Uo));var a=i?e[0]:e[e.length-1];return bh(t,a,r,i),Uo(a)?I.none():I.some(i?e.slice(1):e.slice(0,-1))})).getOr(e);return vh(o),yh(t),!0},xh=function(t,e,n,r){var o=t.selection.getRng(),i=e[0],u=n[n.length-1];bh(t,i,o,!0),bh(t,u,o,!1);var a=Uo(i)?e:e.slice(1),c=Uo(u)?n:n.slice(0,-1);return vh(a.concat(c)),r.deleteContents(),yh(t),!0},Ch=function(t,e,n,r){void 0===r&&(r=!0),e.deleteContents();var o,i=ph(n).getOr(n),u=ye.fromDom(t.dom.getParent(i.dom,t.dom.isBlock));if(Uo(u)&&(sg(u),r&&t.selection.setCursorLocation(u.dom,0)),!Se(n,u)){var a=Ln(Pe(u),n)?[]:Pe(o=u).map(Ve).map((function(t){return X(t,(function(t){return!Se(o,t)}))})).getOr([]);q(a.concat(Ve(n)),(function(t){Se(t,u)||Oe(t,u)||!Uo(t)||un(t)}))}return!0},Sh=function(t,e){return nh(t,!1,e),!0},kh=function(t,e,n,r){return _h(e,r).fold((function(){return function(t,e,n){return hh(e,n).map((function(e){return e.fold(E(Ch,t),E(Sh,t),E(wh,t),E(xh,t))}))}(t,e,n)}),(function(e){return function(t,e){return Th(t,e)}(t,e)})).getOr(!1)},Oh=function(t,e){return Q(mg(e,t),uo)},_h=function(t,e){return Q(mg(e,t),(n="caption",function(t){return Ae(t)&&_e(t)===n}));var n},Th=function(t,e){return sg(e),t.selection.setCursorLocation(e.dom,0),I.some(!0)},Eh=function(t,e,n,r,o){return bl(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return Sl(t.dom).bind((function(o){return kl(t.dom).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(t,e){return Th(t,e)}(t,r):function(t,e,n){return _h(t,ye.fromDom(n.getNode())).map((function(t){return!1===Se(t,e)}))}(e,r,i)})).or(I.some(!0))},Ah=function(t,e,n,r){var o=vc.fromRangeStart(t.selection.getRng());return Oh(n,r).bind((function(r){return Uo(r)?Th(t,r):function(t,e,n,r,o){return bl(n,t.getBody(),o).bind((function(t){return Oh(e,ye.fromDom(t.getNode())).map((function(t){return!1===Se(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)},Dh=function(t,e){return t?og(e):ig(e)},Mh=function(t,e,n){var r=ye.fromDom(t.getBody());return _h(r,n).fold((function(){return Ah(t,e,r,n)||function(t,e){var n=vc.fromRangeStart(t.selection.getRng());return Dh(e,n)||vl(e,t.getBody(),n).exists((function(t){return Dh(e,t)}))}(t,e)}),(function(n){return function(t,e,n,r){var o=vc.fromRangeStart(t.selection.getRng());return Uo(r)?Th(t,r):Eh(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},Rh=function(t,e){var n=ye.fromDom(t.selection.getStart(!0)),r=kf(t);return t.selection.isCollapsed()&&0===r.length?Mh(t,e,n):function(t,e,n){var r=ye.fromDom(t.getBody()),o=t.selection.getRng();return 0!==n.length?wh(t,n,I.none()):kh(t,r,o,e)}(t,n,r)},Nh=function(t){var e=vc.fromRangeStart(t),n=vc.fromRangeEnd(t),r=t.commonAncestorContainer;return vl(!1,r,n).map((function(o){return!js(e,n,r)&&js(e,o,r)?function(t,e,n,r){var o=document.createRange();return o.setStart(t,e),o.setEnd(n,r),o}(e.container(),e.offset(),o.container(),o.offset()):t})).getOr(t)},zh=function(t){return t.collapsed?t:Nh(t)},Bh=function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&function(t){return" "===t.data||Rn(t)}(t.firstChild)},Ph=function(t){return t.length>0&&(!(e=t[t.length-1]).firstChild||Bh(e))?t.slice(0,-1):t;var e},Ih=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},Lh=function(t,e){var n=vc.after(t),r=dl(e).prev(n);return r?r.toRange():null},Hh=function(t,e,n){var r=t.parentNode;return ve.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=vc.before(t),r=dl(e).next(n);return r?r.toRange():null}(t,n)},Fh=function(t,e,n,r){var o,i=function(t,e,n){var r=e.serialize(n);return function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t}(t.createFragment(r))}(e,t,r),u=Ih(e,n.startContainer),a=Ph((o=i.firstChild,X(o.childNodes,(function(t){return"LI"===t.nodeName})))),c=e.getRoot(),s=function(t){var r=vc.fromRangeStart(n),o=dl(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Ih(e,i.getNode())!==u};return s(1)?Hh(u,a,c):s(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),Lh(e[0],n)}(u,a,c,e):function(t,e,n,r){var o=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]}(t,r),i=t.parentNode;return i.insertBefore(o[0],t),ve.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),Lh(e[e.length-1],n)}(u,a,c,n)},Vh=Pn,jh=function(t){var e=t.dom,n=zh(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,Vh);!function(t,e,n){return null!==n&&(n===t.getParent(e.endContainer,Vh)&&Ef(ye.fromDom(n),e))}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):Ch(t,n,ye.fromDom(r))},Uh=function(t,e,n){var r,o,i,u=t.selection,a=t.dom;/^ | $/.test(e)&&(e=function(t,e,n){var r=ye.fromDom(t.getRoot());return n=zg(r,vc.fromRangeStart(e))?n.replace(/^ /,"&nbsp;"):n.replace(/^&nbsp;/," "),n=Bg(r,vc.fromRangeEnd(e))?n.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):n.replace(/&nbsp;(<br( \/)?>)?$/," ")}(a,u.getRng(),e));var c=t.parser,s=n.merge,l=Vm({validate:as(t)},t.schema),f='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>',d=t.fire("BeforeSetContent",{content:e,format:"html",selection:!0,paste:n.paste});if(d.isDefaultPrevented())t.fire("SetContent",{content:d.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=d.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,f);var m=(o=u.getRng()).startContainer||(o.parentElement?o.parentElement():null),g=t.getBody();m===g&&u.isCollapsed()&&a.isBlock(g.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,g.firstChild)&&a.isEmpty(g.firstChild)&&((o=a.createRng()).setStart(g.firstChild,0),o.setEnd(g.firstChild,0),u.setRng(o)),u.isCollapsed()||jh(t);var h,p={context:(r=u.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},v=c.parse(e,p);if(!0===n.paste&&function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||function(t,e){return t.getBlockElements()[e.name]&&function(t){return t.firstChild&&t.firstChild===t.lastChild}(e)&&function(t){return"br"===t.name||" "===t.value}(e.firstChild)}(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r)&&("ul"===n.name||"ol"===n.name)}(t.schema,v)&&function(t,e){return!!Ih(t,e)}(a,r))return o=Fh(l,a,u.getRng(),v),u.setRng(o),void t.fire("SetContent",d);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(v),"mce_marker"===(i=v.lastChild).attr("id")){var b=i;for(i=i.prev;i;i=i.walk(!0))if(3===i.type||!a.isBlock(i.name)){t.schema.isValidChild(i.parent.name,"span")&&i.parent.insert(b,i,"br"===i.name);break}}if(t._selectionOverrides.showBlockCaretContainer(r),p.invalid){t.selection.setContent(f),r=u.getNode();var w=t.getBody();for(9===r.nodeType?r=i=w:i=r;i!==w;)r=i,i=i.parentNode;e=r===w?w.innerHTML:a.getOuterHTML(r),e=l.serialize(c.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return l.serialize(v)})))),r===w?a.setHTML(w,e):a.setOuterHTML(r,e)}else!function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):t.selection.setContent(e)}}(t,e=l.serialize(v),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=Lm(r);ve.each(r.select("*[data-mce-fragment]"),(function(t){if(y(n[t.nodeName.toLowerCase()])&&qm(r,t))for(var e=t.parentNode;y(e)&&e!==o;e=e.parentNode){if(Gm(r,t,e))break;if(i.compare(e,t)){r.remove(t,!0);break}}}))}}(t,s),function(t,e){var n,r=t.dom,o=t.selection;if(e){o.scrollIntoView(e);var i=Vf(t.getBody(),e);if("false"===r.getContentEditable(i))return r.remove(e),void o.select(i);var u=r.createRng(),a=e.previousSibling;if(En(a)){if(u.setStart(a,a.nodeValue.length),!de.ie){var c=e.nextSibling;En(c)&&(a.appendData(c.data),c.parentNode.removeChild(c))}}else u.setStartBefore(e),u.setEndBefore(e);var s=r.getParent(e,r.isBlock);r.remove(e),s&&r.isEmpty(s)&&(t.$(s).empty(),u.setStart(s,0),u.setEnd(s,0),Vh(s)||function(t){return!!t.getAttribute("data-mce-fragment")}(s)||!(n=function(e){var n=vc.fromRangeStart(e);if(n=dl(t.getBody()).next(n))return n.toRange()}(u))?r.add(s,r.create("br",{"data-mce-bogus":"1"})):(u=n,r.remove(s))),o.setRng(u)}}(t,a.get("mce_marker")),h=t.getBody(),ve.each(h.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){I.from(t.getParent(e,"td,th")).map(ye.fromDom).each(lg)}(a,u.getStart()),t.fire("SetContent",d),t.addVisual()}},Wh=function(t,e){e(t),t.firstChild&&Wh(t.firstChild,e),t.next&&Wh(t.next,e)},qh=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var u in n.firstChild&&Wh(n.firstChild,(function(n){q(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),q(e,(function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)wt(r,u)&&i.push(r[u]);for(var a in o)wt(o,a)&&i.push(o[a]);return i}(t,e,n);q(r,(function(t){q(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},Gh=function(t){return t instanceof wm},$h=function(t,e,n){t.dom.setHTML(t.getBody(),e),!0!==n&&function(t){am(t)&&Sl(t.getBody()).each((function(e){var n=e.getNode(),r=On(n)?Sl(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},Xh=function(t,e,n){var r=function(t,e){return Dt(Dt({format:"html"},t),{set:!0,content:Gh(e)?"":e})}(n,e),o=n.no_events?r:t.fire("BeforeSetContent",r);return Gh(e)||(e=o.content),I.from(t.getBody()).fold(O(e),(function(n){return Gh(e)?function(t,e,n,r){qh(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=Vm({validate:t.validate},t.schema).serialize(n);return r.content=ao(ye.fromDom(e))?o:ve.trim(o),$h(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r),n}(t,n,e,o):function(t,e,n,r){if(0===n.length||/^\s+$/.test(n)){var o='<br data-mce-bogus="1">';"TABLE"===e.nodeName?n="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+o+"</li>");var i=Wc(t);i&&t.schema.isValidChild(e.nodeName.toLowerCase(),i.toLowerCase())?(n=o,n=t.dom.createHTML(i,qc(t),n)):n||(n='<br data-mce-bogus="1">'),$h(t,n,r.no_selection),t.fire("SetContent",r)}else"raw"!==r.format&&(n=Vm({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=ao(ye.fromDom(e))?n:ve.trim(n),$h(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r);return r.content}(t,n,e,o)}))},Kh=function(t,e){return function(t,e){var n=t.dom;return n.parentNode?Hr(ye.fromDom(n.parentNode),(function(n){return!Se(t,n)&&e(n)})):I.none()}(t,e).isSome()},Yh=function(t){return w(t)?t:R},Jh=function(t,e,n){var r=e(t),o=Yh(n);return r.orThunk((function(){return o(t)?I.none():function(t,e,n){for(var r=t.dom,o=Yh(n);r.parentNode;){r=r.parentNode;var i=ye.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return I.none()}(t,e,o)}))},Qh=Xl,Zh=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(ef(i)&&!1===i.inherit&&t.dom.is(e,i.selector))return!0}return!1},tp=function(t,e,n,r,o){var i=t.dom.getRoot();return e!==i&&(e=t.dom.getParent(e,(function(e){return!!Zh(t,e,n)||(e.parentNode===i||!!rp(t,e,n,r,!0))})),!!rp(t,e,n,r,o))},ep=function(t,e,n){return!!Qh(e,n.inline)||(!!Qh(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0))},np=function(t,e,n,r,o,i){var u=n[r];if(w(n.onmatch))return n.onmatch(e,n,r);if(u)if(v(u.length)){for(var a in u)if(wt(u,a)){var c="attributes"===r?t.getAttrib(e,a):Yl(t,e,a),s=$l(u[a],i),l=b(c)||Wt(c);if(l&&b(s))continue;if(o&&l&&!n.exact)return!1;if((!o||n.exact)&&!Qh(c,Kl(t,s,a)))return!1}}else for(var f=0;f<u.length;f++)if("attributes"===r?t.getAttrib(e,u[f]):Yl(t,e,u[f]))return!0;return!0},rp=function(t,e,n,r,o){var i=t.formatter.get(n),u=t.dom;if(i&&e)for(var a=0;a<i.length;a++){var c=i[a];if(ep(t.dom,e,c)&&np(u,e,c,"attributes",o,r)&&np(u,e,c,"styles",o,r)){var s=c.classes;if(s)for(var l=0;l<s.length;l++)if(!t.dom.hasClass(e,$l(s[l],r)))return;return c}}},op=function(t,e,n,r,o){if(r)return tp(t,r,e,n,o);if(r=t.selection.getNode(),tp(t,r,e,n,o))return!0;var i=t.selection.getStart();return!(i===r||!tp(t,i,e,n,o))},ip=function(t,e){var n=function(e){return Se(e,ye.fromDom(t.getBody()))};return I.from(t.selection.getStart(!0)).bind((function(r){return Jh(ye.fromDom(r),(function(n){return st(e,(function(e){return function(e,n){return rp(t,e.dom,n)?I.some(n):I.none()}(n,e)}))}),n)})).getOrNull()},up=function(t,e,n){return Y(n,(function(n,r){var o=function(t,e){return U(t.formatter.get(e),(function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return U(["styles","attributes"],(function(n){return yt(t,n).exists((function(t){var n=g(t)?t:bt(t);return U(n,e)}))}))}))}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},ap=co,cp=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==ap||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},sp=function(t){if(t){var e=new Yr(t,t);for(t=e.current();t;t=e.next())if(En(t))return t}return null},lp=function(t){var e=ye.fromTag("span");return Un(e,{id:"_mce_caret","data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&nn(e,ye.fromText(ap)),e},fp=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(cp(e))nh(t,!1,ye.fromDom(e),n);else{var i=o.getRng(),u=r.getParent(e,r.isBlock),a=i.startContainer,c=i.startOffset,s=i.endContainer,l=i.endOffset,f=function(t){var e=sp(t);return e&&e.nodeValue.charAt(0)===ap&&e.deleteData(0,1),e}(e);r.remove(e,!0),a===f&&c>0&&i.setStart(f,c-1),s===f&&l>0&&i.setEnd(f,l-1),u&&r.isEmpty(u)&&sg(ye.fromDom(u)),o.setRng(i)}},dp=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)fp(t,e,n);else if(!(e=_l(t.getBody(),o.getStart())))for(;e=r.get("_mce_caret");)fp(t,e,!1)},mp=function(t,e){return t.appendChild(e),e},gp=function(t,e){var n=K(t,(function(t,e){return mp(t,e.cloneNode(!1))}),e);return mp(n,n.ownerDocument.createTextNode(ap))},hp=function(t,e,n,r){var o,i,u,a=t.dom,c=t.selection,s=[],l=c.getRng(),f=l.startContainer,d=l.startOffset;for(i=f,3===f.nodeType&&(d!==f.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(rp(t,i,e,n,r)){u=i;break}i.nextSibling&&(o=!0),s.push(i),i=i.parentNode}if(u)if(o){var m=c.getBookmark();l.collapse(!0);var g=yf(t,l,t.formatter.get(e),!0);g=cd(g),t.formatter.remove(e,n,g,r),c.moveToBookmark(m)}else{var h=_l(t.getBody(),u),p=lp(!1).dom;!function(t,e,n){var r=t.dom,o=r.getParent(n,E(Wl,t));o&&r.isEmpty(o)?n.parentNode.replaceChild(e,n):(cg(ye.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(e,n):r.insertAfter(e,n))}(t,p,null!==h?h:u);var v=function(t,e,n,r,o,i){var u=t.formatter,a=t.dom,c=X(lt(u.get()),(function(t){return t!==r&&!It(t,"removeformat")})),s=up(t,n,c);if(X(s,(function(e){return!Zl(t,e,r)})).length>0){var l=n.cloneNode(!1);return a.add(e,l),u.remove(r,o,l,i),a.remove(l),I.some(l)}return I.none()}(t,p,u,e,n,r),b=gp(s.concat(v.toArray()),p);fp(t,h,!1),c.setCursorLocation(b,1),a.isEmpty(u)&&a.remove(u)}},pp=function(t){t.on("mouseup keydown",(function(e){!function(t,e){var n=t.selection,r=t.getBody();dp(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==ap||dp(t,_l(r,n.getStart())),37!==e&&39!==e||dp(t,_l(r,n.getStart()))}(t,e.keyCode)}))},vp=function(t,e){var n=t.schema.getTextInlineElements();return wt(n,_e(e))&&!Ol(e.dom)&&!kn(e.dom)},bp={},yp=Ot,wp=St;!function(t,e){bp[t]||(bp[t]=[]),bp[t].push(e)}("pre",(function(t){var e,n=t.selection.getRng(),r=xn(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),wp(yp(yp(e,r),(function(t){return r(t.previousSibling)&&-1!==_t(e,t.previousSibling)})),(function(t){var e,n;e=t.previousSibling,Ju(n=t).remove(),Ju(e).append("<br><br>").append(n.childNodes)})))}));var xp=ve.each,Cp=function(t){return wn(t)&&!Il(t)&&!Ol(t)&&!kn(t)},Sp=function(t,e){for(var n=t;n;n=n[e]){if(En(n)&&Ut(n.data))return t;if(wn(n)&&!Il(n))return n}return t},kp=function(t,e,n){var r=Lm(t);if(e&&n&&(e=Sp(e,"previousSibling"),n=Sp(n,"nextSibling"),r.compare(e,n))){for(var o=e.nextSibling;o&&o!==n;){var i=o;o=o.nextSibling,e.appendChild(i)}return t.remove(n),ve.each(ve.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},Op=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=kp(t,Ul(r),r);kp(t,o,Ul(o,!0))}},_p=function(t,e,n){xp(t.childNodes,(function(t){Cp(t)&&(e(t)&&n(t),t.hasChildNodes()&&_p(t,e,n))}))},Tp=function(t,e){return function(n){return!(!n||!Yl(t,n,e))}},Ep=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)}(t,r)}},Ap=gr([{keep:[]},{rename:["name"]},{removed:[]}]),Dp=/^(src|href|style)$/,Mp=ve.each,Rp=Xl,Np=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},zp=function(t,e,n){var r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"];if(wn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return En(r)&&n&&o>=r.nodeValue.length&&(r=new Yr(r,t.getBody()).next()||r),En(r)&&!n&&0===o&&(r=new Yr(r,t.getBody()).prev()||r),r},Bp=function(t,e){var n=e?"firstChild":"lastChild";if(function(t){return/^(TR|TH|TD)$/.test(t.nodeName)}(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},Pp=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},Ip=function(t,e,n,r,o){var i=ye.fromDom(e),u=ye.fromDom(t.create(r,o)),a=n?Fe(i):He(i);return rn(u,a),n?(Ze(i,u),en(u,i)):(tn(i,u),nn(u,i)),u.dom},Lp=function(t,e,n,r){var o=Ul(e,n,r);return b(o)||"BR"===o.nodeName||t.isBlock(o)},Hp=function(t,e,n){var r,o=e.parentNode,i=t.dom,u=Wc(t);tf(n)&&(u?o===i.getRoot()&&(n.list_block&&Rp(e,n.list_block)||q(ct(e.childNodes),(function(e){ql(t,u,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=Pp(i,e,u),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=null}))):i.isBlock(e)&&!i.isBlock(o)&&(Lp(i,e,!1)||Lp(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),Lp(i,e,!0)||Lp(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),function(t){return ef(t)&&nf(t)&&Ln(yt(t,"mixed"),!0)}(n)&&!Rp(n.inline,e)||i.remove(e,!0)},Fp=function(t,e,n,r,o){var i,u=t.dom;if(!function(t,e,n){return!(!nf(n)||!Rp(e,n.inline))||(!(!tf(n)||!Rp(e,n.block))||(ef(n)?wn(e)&&t.is(e,n.selector):void 0))}(u,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return Ap.keep();var a=r;if(nf(e)&&"all"===e.remove&&g(e.preserve_attributes)){var c=X(u.getAttribs(a),(function(t){return j(e.preserve_attributes,t.name.toLowerCase())}));if(u.removeAllAttribs(a),q(c,(function(t){return u.setAttrib(a,t.name,t.value)})),c.length>0)return Ap.rename("span")}if("all"!==e.remove){Mp(e.styles,(function(t,r){t=Kl(u,$l(t,n),r+""),x(r)&&(r=t,o=null),(e.remove_similar||!o||Rp(Yl(u,o,r),t))&&u.setStyle(a,r,""),i=!0})),i&&""===u.getAttrib(a,"style")&&(a.removeAttribute("style"),a.removeAttribute("data-mce-style")),Mp(e.attributes,(function(t,r){var i;if(t=$l(t,n),x(r)&&(r=t,o=null),e.remove_similar||!o||Rp(u.getAttrib(o,r),t)){if("class"===r&&(t=u.getAttrib(a,r))&&(i="",q(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))return void u.setAttrib(a,r,i);if(Dp.test(r)&&a.removeAttribute("data-mce-"+r),"style"===r&&xn(["li"])(a)&&"none"===u.getStyle(a,"list-style-type"))return a.removeAttribute(r),void u.setStyle(a,"list-style-type","none");"class"===r&&a.removeAttribute("className"),a.removeAttribute(r)}})),Mp(e.classes,(function(t){t=$l(t,n),o&&!u.hasClass(o,t)||u.removeClass(a,t)}));for(var s=u.getAttribs(a),l=0;l<s.length;l++){var f=s[l].nodeName;if(0!==f.indexOf("_")&&0!==f.indexOf("data-"))return Ap.keep()}}return"none"!==e.remove?(Hp(t,a,e),Ap.removed()):Ap.keep()},Vp=function(t,e,n,r,o){return Fp(t,e,n,r,o).fold(R,(function(e){return t.dom.rename(r,e),!0}),N)},jp=function(t,e,n,r){return Fp(t,e,n,r,r).fold(O(r),(function(e){return t.dom.createFragment().appendChild(r),t.dom.rename(r,e)}),O(null))},Up=function(t,e,n,r,o){var i=t.formatter.get(e),u=i[0],a=!0,c=t.dom,s=t.selection,l=function(r){var a=function(t,e,n,r,o){var i;return q(Ql(t.dom,e.parentNode).reverse(),(function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var u=rp(t,e,n,r,o);u&&!1!==u.split&&(i=e)}})),i}(t,r,e,n,o);return function(t,e,n,r,o,i,u,a){var c,s,l,f=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=f.clone(m,!1);for(var g=0;g<e.length&&null!==(c=jp(t,e[g],a,c));g++);c&&(s&&c.appendChild(s),l||(l=c),s=c)}!i||u.mixed&&f.isBlock(n)||(r=f.split(n,r)),s&&(o.parentNode.insertBefore(s,o),l.appendChild(o),nf(u)&&Op(f,u,0,s))}return r}(t,i,a,r,r,!0,u,n)},f=function(e){return U(i,(function(r){return Vp(t,r,n,e,e)}))},d=function(e){var n=!0,r=!1;wn(e)&&c.getContentEditable(e)&&(n=a,a="true"===c.getContentEditable(e),r=!0);var o=ct(e.childNodes);if(a&&!r){var s=f(e)||U(i,(function(t){return ep(c,e,t)})),l=e.parentNode;!s&&y(l)&&rf(u)&&f(l)}if(u.deep&&o.length){for(var m=0;m<o.length;m++)d(o[m]);r&&(a=n)}q(["underline","line-through","overline"],(function(n){wn(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&Jl(c,e.parentNode)===n&&Vp(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))},m=function(t){var e=c.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return function(t){return Il(t)&&wn(t)&&("_start"===t.id||"_end"===t.id)}(n)&&(n=n[t?"firstChild":"lastChild"]),En(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),c.remove(e,!0),n},g=function(e){var n,r,o=yf(t,e,i,e.collapsed);if(u.split){if(o=cd(o),(n=zp(t,o,!0))!==(r=zp(t,o))){if(n=Bp(n,!0),r=Bp(r,!1),Np(c,n,r)){var a=I.from(n.firstChild).getOr(n);return l(Ip(c,a,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void m(!0)}if(Np(c,r,n)){a=I.from(r.lastChild).getOr(r);return l(Ip(c,a,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void m(!1)}n=Pp(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=Pp(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),wf(c,s,(function(t){q(t,(function(t){Il(t)||Il(t.parentNode)||l(t)}))})),l(n),l(r),n=m(!0),r=m()}else n=r=l(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1}wf(c,o,(function(t){q(t,d)}))};if(r){if(Vl(r)){var h=c.createRng();h.setStartBefore(r),h.setEndAfter(r),g(h)}else g(r);qf(t,e,r,n)}else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&nf(u)&&!kf(t).length?hp(t,e,n,o):(Rf(s,!0,(function(){Mf(t,g)})),nf(u)&&op(t,e,n,s.getStart())&&jl(c,s,s.getRng()),t.nodeChanged()),qf(t,e,r,n);else{r=s.getNode();for(var p=0;p<i.length&&(!i[p].ceFalseOverride||!Vp(t,i[p],n,r,r));p++);qf(t,e,r,n)}},Wp=ve.each,qp=function(t,e,n,r){Wp(e,(function(e){nf(e)&&Wp(t.dom.select(e.inline,r),(function(r){Cp(r)&&Vp(t,e,n,r,e.exact?r:null)})),function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";xp(t.select(r,n),(function(n){Cp(n)&&xp(e.styles,(function(e,r){t.setStyle(n,r,"")}))}))}}(t.dom,e,r)}))},Gp=ve.each,$p=function(t){return wn(t)&&!Il(t)&&!Ol(t)&&!kn(t)},Xp=function(t,e,n,r){var o=t.formatter.get(e),i=o[0],u=!r&&t.selection.isCollapsed(),a=t.dom,c=t.selection,s=function(t,e){if(void 0===e&&(e=i),w(e.onformat)&&e.onformat(t,e,n,r),Gp(e.styles,(function(e,r){a.setStyle(t,r,$l(e,n))})),e.styles){var o=a.getAttrib(t,"style");o&&a.setAttrib(t,"data-mce-style",o)}Gp(e.attributes,(function(e,r){a.setAttrib(t,r,$l(e,n))})),Gp(e.classes,(function(e){e=$l(e,n),a.hasClass(t,e)||a.addClass(t,e)}))},l=function(t,e){var n=!1;return Gp(t,(function(t){return!!ef(t)&&(y(t.collapsed)&&t.collapsed!==u?void 0:a.is(e,t.selector)&&!Ol(e)?(s(e,t),n=!0,!1):void 0)})),n},f=function(t){if(d(t)){var e=a.create(t);return s(e),e}return null},m=function(r,u,a){var c=[],d=!0,m=i.inline||i.block,g=f(m);wf(r,u,(function(u){var f,h=function(u){var p=!1,v=d,b=u.nodeName.toLowerCase(),w=u.parentNode,x=w.nodeName.toLowerCase();if(wn(u)&&r.getContentEditable(u)&&(v=d,d="true"===r.getContentEditable(u),p=!0),Rn(u)&&!function(t,e,n,r){if(function(t){return t.getParam("format_empty_lines",!1,"boolean")}(t)&&nf(e)){var o=vi(t.schema),i=Kh(ye.fromDom(n),(function(t){return Ol(t.dom)}));return xt(o,r)&&Uo(ye.fromDom(n.parentNode),!1)&&!i}return!1}(t,i,u,x))return f=null,void(tf(i)&&r.remove(u));if(tf(i)&&i.wrapper&&rp(t,u,e,n))f=null;else{if(d&&!p&&tf(i)&&!i.wrapper&&Wl(t,b)&&ql(t,x,m)){var C=r.rename(u,m);return s(C),c.push(C),void(f=null)}if(ef(i)){var S=l(o,u);if(!S&&y(w)&&rf(i)&&(S=l(o,w)),!nf(i)||S)return void(f=null)}!d||p||!ql(t,m,b)||!ql(t,x,m)||!a&&En(u)&&so(u.data)||Ol(u)||nf(i)&&r.isBlock(u)?(f=null,q(ct(u.childNodes),h),p&&(d=v),f=null):(f||(f=r.clone(g,!1),u.parentNode.insertBefore(f,u),c.push(f)),f.appendChild(u))}};q(u,h)})),!0===i.links&&q(c,(function(t){var e=function(t){"A"===t.nodeName&&s(t,i),q(ct(t.childNodes),e)};e(t)})),q(c,(function(u){var a=function(t){var e=0;return q(t.childNodes,(function(t){(function(t){return y(t)&&En(t)&&0===t.length})(t)||Il(t)||e++})),e}(u);!(c.length>1)&&r.isBlock(u)||0!==a?(nf(i)||tf(i)&&i.wrapper)&&(i.exact||1!==a||(u=function(t){return Q(t.childNodes,$p).filter((function(t){return ep(r,t,i)})).map((function(e){var n=r.clone(e,!1);return s(n),r.replace(n,t,!0),r.remove(e,!0),n})).getOr(t)}(u)),qp(t,o,n,u),function(t,e,n,r,o){rp(t,o.parentNode,n,r)&&Vp(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(rp(t,i,n,r))return Vp(t,e,r,o),!0}))}(t,i,e,n,u),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&_p(r,Tp(t,"fontSize"),Ep(t,"backgroundColor",$l(e.styles.backgroundColor,n)))}(r,i,n,u),function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=Jl(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(ve.walk(r,o,"childNodes"),o(r))}(r,i,0,u),function(t,e,n,r){!nf(e)||"sub"!==e.inline&&"sup"!==e.inline||(_p(r,Tp(t,"fontSize"),Ep(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(r,i,0,u),Op(r,i,0,u)):r.remove(u,!0)}))};if("false"!==a.getContentEditable(c.getNode())){if(i){if(r)if(Vl(r)){if(!l(o,r)){var g=a.createRng();g.setStartBefore(r),g.setEndAfter(r),m(a,yf(t,g,o),!0)}}else m(a,r,!0);else if(u&&nf(i)&&!kf(t).length)!function(t,e,n){var r,o,i=t.selection,u=i.getRng(),a=u.startOffset,c=u.startContainer.nodeValue;(r=_l(t.getBody(),i.getStart()))&&(o=sp(r));var s,l,f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&a>0&&a<c.length&&f.test(c.charAt(a))&&f.test(c.charAt(a-1))){var d=i.getBookmark();u.collapse(!0);var m=yf(t,u,t.formatter.get(e));m=cd(m),t.formatter.apply(e,n,m),i.moveToBookmark(d)}else r&&o.nodeValue===ap?t.formatter.apply(e,n,r):(s=t.getDoc(),l=lp(!0).dom,o=(r=s.importNode(l,!0)).firstChild,u.insertNode(r),a=1,t.formatter.apply(e,n,r)),i.setCursorLocation(o,a)}(t,e,n);else{var h=c.getNode(),p=o[0];t.settings.forced_root_block||!p.defaultBlock||a.getParent(h,a.isBlock)||Xp(t,p.defaultBlock),c.setRng(zh(c.getRng())),Rf(c,!0,(function(){Mf(t,(function(e,n){var r=n?e:yf(t,e,o);m(a,r,!1)}))})),jl(a,c,c.getRng()),t.nodeChanged()}!function(t,e){wp(bp[t],(function(t){t(e)}))}(e,t)}Wf(t,e,r,n)}else{r=c.getNode();for(var v=0,b=o.length;v<b;v++){var x=o[v];if(x.ceFalseOverride&&ef(x)&&a.is(r,x.selector)){s(r,x);break}}Wf(t,e,r,n)}},Kp=function(t){return wt(t,"vars")},Yp=function(t){return t.selection.getStart()},Jp=function(t,e,n,r,o){return J(e,(function(e){var i=t.formatter.matchNode(e,n,null!=o?o:{},r);return!v(i)}),(function(e){return!!Zh(t,e,n)||!r&&y(t.formatter.matchNode(e,n,o,!0))}))},Qp=function(t,e){var n=null!=e?e:Yp(t);return X(Ql(t.dom,n),(function(t){return wn(t)&&!kn(t)}))},Zp=function(t,e,n){var r=Qp(t,e);dt(n,(function(n,o){var i=function(n){var i=Jp(t,r,o,n.similar,Kp(n)?n.vars:void 0),u=i.isSome();if(n.state.get()!==u){n.state.set(u);var a=i.getOr(e);Kp(n)?n.callback(u,{node:a,format:o,parents:r}):q(n.callbacks,(function(t){return t(u,{node:a,format:o,parents:r})}))}};q([n.withSimilar,n.withoutSimilar],i),q(n.withVars,i)}))},tv=function(t,e,n,r,o,i){return null===e.get()&&function(t,e){t.set({}),e.on("NodeChange",(function(n){Zp(e,n.element,t.get())})),e.on("FormatApply FormatRemove",(function(n){var r=I.from(n.node).map((function(t){return Vl(t)?t:t.startContainer})).bind((function(t){return wn(t)?I.some(t):I.from(t.parentElement)})).getOrThunk((function(){return Yp(e)}));Zp(e,r,t.get())}))}(e,t),function(t,e,n,r,o,i){var u=e.get();q(n.split(","),(function(e){var n=yt(u,e).getOrThunk((function(){var t={withSimilar:{state:sa(!1),similar:!0,callbacks:[]},withoutSimilar:{state:sa(!1),similar:!1,callbacks:[]},withVars:[]};return u[e]=t,t})),a=function(){var n=Qp(t);return Jp(t,n,e,o,i).isSome()};if(v(i)){var c=o?n.withSimilar:n.withoutSimilar;c.callbacks.push(r),1===c.callbacks.length&&c.state.set(a())}else n.withVars.push({state:sa(a()),similar:o,vars:i,callback:r})})),e.set(u)}(t,e,n,r,o,i),{unbind:function(){return function(t,e,n){var r=t.get();q(e.split(","),(function(t){return yt(r,t).each((function(e){r[t]={withSimilar:Dt(Dt({},e.withSimilar),{callbacks:X(e.withSimilar.callbacks,(function(t){return t!==n}))}),withoutSimilar:Dt(Dt({},e.withoutSimilar),{callbacks:X(e.withoutSimilar.callbacks,(function(t){return t!==n}))}),withVars:X(e.withVars,(function(t){return t.callback!==n}))}}))})),t.set(r)}(e,n,r)}}},ev=function(t,e){var n=(e||document).createDocumentFragment();return q(t,(function(t){n.appendChild(t.dom)})),ye.fromDom(n)},nv=function(t,e,n){return{element:t,width:e,rows:n}},rv=function(t,e){return{element:t,cells:e}},ov=function(t,e){return{x:t,y:e}},iv=function(t,e){var n=parseInt(Wn(t,e),10);return isNaN(n)?1:n},uv=function(t,e,n){var r=t.rows;return!!(r[n]?r[n].cells:[])[e]},av=function(t){return Y(t,(function(t,e){return e.cells.length>t?e.cells.length:t}),0)},cv=function(t,e){for(var n=t.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Se(o[i],e))return I.some(ov(i,r));return I.none()},sv=function(t,e,n,r,o){for(var i=[],u=t.rows,a=n;a<=o;a++){var c=u[a].cells,s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(rv(u[a].element,s))}return i},lv=function(t){var e=nv(La(t),0,[]);return q(_a(t,"tr"),(function(t,n){q(_a(t,"td,th"),(function(r,o){!function(t,e,n,r,o){for(var i=iv(o,"rowspan"),u=iv(o,"colspan"),a=t.rows,c=n;c<n+i;c++){a[c]||(a[c]=rv(Ha(r),[]));for(var s=e;s<e+u;s++){a[c].cells[s]=c===n&&s===e?o:La(o)}}}(e,function(t,e,n){for(;uv(t,e,n);)e++;return e}(e,o,n),n,t,r)}))})),nv(e.element,av(e.rows),e.rows)},fv=function(t){return function(t,e){var n=La(t.element),r=ye.fromTag("tbody");return rn(r,e),nn(n,r),n}(t,function(t){return W(t.rows,(function(t){var e=W(t.cells,(function(t){var e=Ha(t);return Gn(e,"colspan"),Gn(e,"rowspan"),e})),n=La(t.element);return rn(n,e),n}))}(t))},dv=function(t,e,n){return cv(t,e).bind((function(e){return cv(t,n).map((function(n){return function(t,e,n){var r=e.x,o=e.y,i=n.x,u=n.y,a=o<u?sv(t,r,o,i,u):sv(t,r,u,i,o);return nv(t.element,av(a),a)}(t,e,n)}))}))},mv=function(t,e){return Q(t,(function(t){return"li"===_e(t)&&Ef(t,e)})).fold(O([]),(function(e){return function(t){return Q(t,(function(t){return"ul"===_e(t)||"ol"===_e(t)}))}(t).map((function(t){var e=ye.fromTag(_e(t)),n=vt(Jn(t),(function(t,e){return Lt(e,"list-style")}));return $n(e,n),[ye.fromTag("li"),e]})).getOr([])}))},gv=function(t,e){var n=ye.fromDom(e.commonAncestorContainer),r=mg(n,t),o=X(r,(function(t){return to(t)||Qr(t)})),i=mv(r,e),u=o.concat(i.length?i:function(t){return oo(t)?Pe(t).filter(ro).fold(O([]),(function(e){return[t,e]})):ro(t)?[t]:[]}(n));return W(u,La)},hv=function(){return ev([])},pv=function(t,e){return n=ye.fromDom(e.cloneContents()),r=gv(t,e),o=Y(r,(function(t,e){return nn(e,t),e}),n),r.length>0?ev([o]):o;var n,r,o},vv=function(t,e){return(n=t,r=e[0],Fr(r,"table",E(Se,n))).bind((function(t){var n=e[0],r=e[e.length-1],o=lv(t);return dv(o,n,r).map((function(t){return ev([fv(t)])}))})).getOrThunk(hv);var n,r},bv=function(t,e){var n=Sf(e,t);return n.length>0?vv(t,n):function(t,e){return e.length>0&&e[0].collapsed?hv():pv(t,e[0])}(t,e)},yv=function(t,e){return e>=0&&e<t.length&&Hl(t.charAt(e))},wv=function(t,e){var n=lo(t.innerText);return e?function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},xv=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return Dt(Dt({},t),{format:e,get:!0,selection:!0})}(n,e),o=t.fire("BeforeGetContent",r);if(o.isDefaultPrevented())return t.fire("GetContent",o),o.content;if("text"===o.format)return function(t){return I.from(t.selection.getRng()).map((function(e){var n=I.from(t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock)),r=t.getBody(),o=function(t){return t.map((function(t){return t.nodeName})).getOr("div").toLowerCase()}(n),i=de.browser.isIE()&&"pre"!==o,u=t.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=wv(u,i),c=lo(u.textContent);if(t.dom.remove(u),yv(c,0)||yv(c,c.length-1)){var s=n.getOr(r),l=wv(s,i),f=l.indexOf(a);return-1===f?a:(yv(l,f-1)?" ":"")+a+(yv(l,f+a.length)?" ":"")}return a})).getOr("")}(t);o.getInner=!0;var i=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=hm(t,xf(o)),u=e.contextual?bv(ye.fromDom(t.getBody()),i).dom:n.cloneContents();return u&&r.appendChild(u),t.selection.serializer.serialize(r,e)}(t,o);return"tree"===o.format?i:(o.content=t.selection.isCollapsed()?"":i,t.fire("GetContent",o),o.content)},Cv=function(t){return wn(t)?t.outerHTML:En(t)?ai.encodeRaw(t.data,!1):An(t)?"\x3c!--"+t.data+"--\x3e":""},Sv=function(t,e,n){var r=function(t){var e,n=document.createElement("div"),r=document.createDocumentFragment();for(t&&(n.innerHTML=t);e=n.firstChild;)r.appendChild(e);return r}(e);if(t.hasChildNodes()&&n<t.childNodes.length){var o=t.childNodes[n];o.parentNode.insertBefore(r,o)}else t.appendChild(r)},kv=function(t,e){var n,r,o,i,u,a,c,s,l,f=W(ct(e.childNodes),Cv);return function(t,e){var n=0;q(t,(function(t){0===t[0]?n++:1===t[0]?(Sv(e,t[1],n),n++):2===t[0]&&function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}}(e,n)}))}((r=t,o=(n=f).length+r.length+2,i=new Array(o),u=new Array(o),a=function(t,e,o,i,u){var c=s(t,e,o,i);if(null===c||c.start===e&&c.diag===e-i||c.end===t&&c.diag===t-o)for(var l=t,f=o;l<e||f<i;)l<e&&f<i&&n[l]===r[f]?(u.push([0,n[l]]),++l,++f):e-t>i-o?(u.push([2,n[l]]),++l):(u.push([1,r[f]]),++f);else{a(t,c.start,o,c.start-c.diag,u);for(var d=c.start;d<c.end;++d)u.push([0,n[d]]);a(c.end,e,c.end-c.diag,i,u)}},c=function(t,e,o,i){for(var u=t;u-e<i&&u<o&&n[u]===r[u-e];)++u;return function(t,e,n){return{start:t,end:e,diag:n}}(t,u,e)},s=function(t,e,o,a){var s=e-t,l=a-o;if(0===s||0===l)return null;var f,d,m,g,h,p=s-l,v=l+s,b=(v%2==0?v:v+1)/2;for(i[1+b]=t,u[1+b]=e+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){for(m=d+b,d===-f||d!==f&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,h=(g=i[m])-t+o-d;g<e&&h<a&&n[g]===r[h];)i[m]=++g,++h;if(p%2!=0&&p-f<=d&&d<=p+f&&u[m-p]<=i[m])return c(u[m-p],d+t-o,e,a)}for(d=p-f;d<=p+f;d+=2){for(m=d+b-p,d===p-f||d!==p+f&&u[m+1]<=u[m-1]?u[m]=u[m+1]-1:u[m]=u[m-1],h=(g=u[m]-1)-t+o-d;g>=t&&h>=o&&n[g]===r[h];)u[m]=g--,h--;if(p%2==0&&-f<=d&&d<=f&&u[m]<=i[m+p])return c(u[m],d+t-o,e,a)}}},l=[],a(0,n.length,0,r.length,l),l),e),e},Ov=Rt((function(){return document.implementation.createHTMLDocument("undo")})),_v=function(t){var e,n=(e=t.getBody(),X(W(ct(e.childNodes),Cv),(function(t){return t.length>0}))),r=tt(n,(function(e){var n=zm(t.serializer,e);return n.length>0?[n]:[]})),o=r.join("");return-1!==o.indexOf("</iframe>")?function(t){return{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}}(r):function(t){return{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}}(o)},Tv=function(t,e,n){var r=n?e.beforeBookmark:e.bookmark;"fragmented"===e.type?kv(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw",no_selection:!y(r)||!Tl(r)||!r.isFakeCaret}),t.selection.moveToBookmark(r)},Ev=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},Av=function(t){var e=ye.fromTag("body",Ov());return Pa(e,Ev(t)),q(_a(e,"*[data-mce-bogus]"),an),e.dom.innerHTML},Dv=function(t,e){return!(!t||!e)&&(!!function(t,e){return Ev(t)===Ev(e)}(t,e)||function(t,e){return Av(t)===Av(e)}(t,e))},Mv=function(t){return 0===t.get()},Rv=function(t,e,n){Mv(n)&&(t.typing=e)},Nv=function(t,e){t.typing&&(Rv(t,!1,e),t.add())},zv=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){Mv(e)&&n.set(Fc(t.selection))}(t,e,n)},add:function(e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=_v(t);if(i=i||{},i=ve.extend(i,a),!1===Mv(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:u}).isDefaultPrevented())return null;if(c&&Dv(c,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var s=function(t){return t.getParam("custom_undo_redo_levels",0,"number")}(t);if(s&&e.data.length>s){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=Fc(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:c,originalEvent:u};return n.get()>0?(t.setDirty(!0),t.fire("AddUndo",f),t.fire("change",f)):t.fire("AddUndo",f),i}(t,e,n,r,o,i,u)},undo:function(e,n,r){return function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,Rv(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],Tv(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o}(t,e,n,r)},redo:function(e,n){return function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],Tv(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r}(t,e,n)},clear:function(e,n){return function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")}(t,e,n)},reset:function(t){return function(t){t.clear(),t.add()}(t)},hasUndo:function(e,n){return function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!Dv(_v(t),e.data[0])}(t,e,n)},hasRedo:function(t,e){return function(t,e){return e.get()<t.data.length-1&&!t.typing}(t,e)},transact:function(t,e,n){return function(t,e,n){return Nv(t,e),t.beforeChange(),t.ignore(n),t.add()}(t,e,n)},ignore:function(t,e){return function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}}(t,e)},extra:function(e,n,r,o){return function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,u=e.data[n.get()-1];Tv(t,u,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}}(t,e,n,r,o)}},formatter:{match:function(e,n,r,o){return op(t,e,n,r,o)},matchAll:function(e,n){return function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,(function(i){for(var u=0;u<e.length;u++){var a=e[u];!o[a]&&rp(t,i,a,n)&&(o[a]=!0,r.push(a))}}),t.dom.getRoot()),r}(t,e,n)},matchNode:function(e,n,r,o){return rp(t,e,n,r,o)},canApply:function(e){return function(t,e){var n=t.formatter.get(e),r=t.dom;if(n)for(var o=t.selection.getStart(),i=Ql(r,o),u=n.length-1;u>=0;u--){var a=n[u];if(!ef(a)||y(a.defaultBlock))return!0;for(var c=i.length-1;c>=0;c--)if(r.is(i[c],a.selector))return!0}return!1}(t,e)},closest:function(e){return ip(t,e)},apply:function(e,n,r){return Xp(t,e,n,r)},remove:function(e,n,r,o){return Up(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!op(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?Xp(t,e,n,r):Up(t,e,n,r)}(t,e,n,r)},formatChanged:function(e,n,r,o,i){return tv(t,e,n,r,o,i)}},editor:{getContent:function(e,n){return function(t,e,n){return I.from(t.getBody()).fold(O("tree"===e.format?new wm("body",11):""),(function(r){return Pm(t,e,n,r)}))}(t,e,n)},setContent:function(e,n){return Xh(t,e,n)},insertContent:function(e,n){return Uh(t,e,n)},addVisual:function(e){return function(t,e){var n=t.dom,r=y(e)?e:t.getBody();v(t.hasVisual)&&(t.hasVisual=function(t){return t.getParam("visual",!0,"boolean")}(t)),q(n.select("table,a",r),(function(e){switch(e.nodeName){case"TABLE":var r=function(t){return t.getParam("visual_table_class","mce-item-table","string")}(t),o=n.getAttrib(e,"border");o&&"0"!==o||!t.hasVisual?n.removeClass(e,r):n.addClass(e,r);break;case"A":if(!n.getAttrib(e,"href")){var i=n.getAttrib(e,"name")||e.id,u=function(t){return t.getParam("visual_anchor_class","mce-item-anchor","string")}(t);i&&t.hasVisual?n.addClass(e,u):n.removeClass(e,u)}}})),t.fire("VisualAid",{element:e,hasVisual:t.hasVisual})}(t,e)}},selection:{getContent:function(e,n){return xv(t,e,n)}},raw:{getModel:function(){return I.none()}}}},Bv=function(t){return wt(t.plugins,"rtc")},Pv=function(t){var e=t;return function(t){return yt(t.plugins,"rtc").bind((function(t){return I.from(t.setup)}))}(t).fold((function(){return e.rtcInstance=zv(t),I.none()}),(function(t){return e.rtcInstance=function(){var t=O(null),e=O("");return{undoManager:{beforeChange:C,add:t,undo:t,redo:t,clear:C,reset:C,hasUndo:R,hasRedo:R,transact:t,ignore:C,extra:C},formatter:{match:R,matchAll:O([]),matchNode:O(void 0),canApply:R,closest:e,apply:C,remove:C,toggle:C,formatChanged:O({unbind:C})},editor:{getContent:e,setContent:e,insertContent:C,addVisual:C},selection:{getContent:e},raw:{getModel:O(I.none())}}}(),I.some((function(){return t().then((function(t){return e.rtcInstance=function(t){var e=function(t){return m(t)?t:{}},n=t.undoManager,r=t.formatter,o=t.editor,i=t.selection,u=t.raw;return{undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:function(t,e,r){return n.transact(r)},ignore:function(t,e){return n.ignore(e)},extra:function(t,e,r,o){return n.extra(r,o)}},formatter:{match:function(t,n,o,i){return r.match(t,e(n),i)},matchAll:r.matchAll,matchNode:r.matchNode,canApply:function(t){return r.canApply(t)},closest:function(t){return r.closest(t)},apply:function(t,n,o){return r.apply(t,e(n))},remove:function(t,n,o,i){return r.remove(t,e(n))},toggle:function(t,n,o){return r.toggle(t,e(n))},formatChanged:function(t,e,n,o,i){return r.formatChanged(e,n,o,i)}},editor:{getContent:function(t,e){return o.getContent(t)},setContent:function(t,e){return o.setContent(t,e)},insertContent:function(t,e){return o.insertContent(t)},addVisual:o.addVisual},selection:{getContent:function(t,e){return i.getContent(e)}},raw:{getModel:function(){return I.some(u.getRawModel())}}}}(t),t.rtc.isRemote}))}))}))},Iv=function(t){return t.rtcInstance?t.rtcInstance:zv(t)},Lv=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},Hv=function(t,e){return void 0===e&&(e={}),function(t,e,n){return Lv(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)},Fv=function(t){return 0===t.dom.length?(un(t),I.none()):I.some(t)},Vv=function(t,e,n,r){t.bind((function(t){return(r?Wg:Ug)(t.dom,r?t.dom.length:0),e.filter(De).map((function(e){return function(t,e,n,r){var o=t.dom,i=e.dom,u=r?o.length:i.length;r?(qg(o,i,!1,!r),n.setStart(i,u)):(qg(i,o,!1,!r),n.setEnd(i,u))}(t,e,n,r)}))})).orThunk((function(){return function(t,e){return t.filter((function(t){return Ff.isBookmarkNode(t.dom)})).bind(e?Le:Ie)}(e,r).or(e).filter(De).map((function(t){return function(t,e){Pe(t).each((function(n){var r=t.dom;e&&zg(n,vc(r,0))?Ug(r,0):!e&&Bg(n,vc(r,r.length))&&Wg(r,r.length)}))}(t,r)}))}))},jv=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return Dt(Dt({format:"html"},t),{set:!0,selection:!0,content:e})}(n,e),o=r;if(!r.no_events){var i=t.fire("BeforeSetContent",r);if(i.isDefaultPrevented())return void t.fire("SetContent",i);o=i}o.content=function(t,e){if("raw"!==e.format){var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,Dt(Dt({isRootContent:!0,forced_root_block:!1},o),e));return Vm({validate:t.validate},t.schema).serialize(i)}return e.content}(t,o);var u=t.selection.getRng();!function(t,e){var n=I.from(e.firstChild).map(ye.fromDom),r=I.from(e.lastChild).map(ye.fromDom);t.deleteContents(),t.insertNode(e);var o=n.bind(Ie).filter(De).bind(Fv),i=r.bind(Le).filter(De).bind(Fv);Vv(o,n,t,!0),Vv(i,r,t,!1),t.collapse(!1)}(u,u.createContextualFragment(o.content)),t.selection.setRng(u),Md(t,u),o.no_events||t.fire("SetContent",o)},Uv=function(t,e,n){if(t&&wt(t,e)){var r=X(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}};var Wv,qv,Gv=function(t){return!!t.select},$v=function(t){return!(!t||!t.ownerDocument)&&Oe(ye.fromDom(t.ownerDocument),ye.fromDom(t))},Xv=function(t,e,n,r){var o,i,u=function(t,e){var n,r,o=function(e,n){return Q(n,(function(n){return t.is(n,e)}))},i=function(e){return t.getParents(e,null,t.getRoot())};return{selectorChangedWithUnbind:function(t,u){return n||(n={},r={},e.on("NodeChange",(function(t){var e=t.element,u=i(e),a={};ve.each(n,(function(t,e){o(e,u).each((function(n){r[e]||(q(t,(function(t){t(!0,{node:n,selector:e,parents:u})})),r[e]=t),a[e]=t}))})),ve.each(r,(function(t,n){a[n]||(delete r[n],ve.each(t,(function(t){t(!1,{node:e,selector:n,parents:u})})))}))}))),n[t]||(n[t]=[]),n[t].push(u),o(t,i(e.selection.getStart())).each((function(){r[t]=n[t]})),{unbind:function(){Uv(n,t,u),Uv(r,t,u)}}}}}(t,r).selectorChangedWithUnbind,a=function(t,e){return jv(r,t,e)},c=function(t){var e=l();e.collapse(!!t),f(e)},s=function(){return e.getSelection?e.getSelection():e.document.selection},l=function(){var n,u,a,c=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}},l=e.document;if(void 0!==r.bookmark&&!1===am(r)){var f=Kd(r);if(f.isSome())return f.map((function(t){return hm(r,[t])[0]})).getOr(l.createRange())}try{(n=s())&&!yn(n.anchorNode)&&(u=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():l.createRange(),u=hm(r,[u])[0])}catch(t){}return u||(u=l.createRange?l.createRange():l.body.createTextRange()),u.setStart&&9===u.startContainer.nodeType&&u.collapsed&&(a=t.getRoot(),u.setStart(a,0),u.setEnd(a,0)),o&&i&&(0===c(u.START_TO_START,u,o)&&0===c(u.END_TO_END,u,o)?u=i:(o=null,i=null)),u},f=function(t,e){var n;if(function(t){return!!t&&(!!Gv(t)||$v(t.startContainer)&&$v(t.endContainer))}(t)){var u=Gv(t)?t:null;if(u){i=null;try{u.select()}catch(t){}}else{var a=s();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,a){i=t;try{a.removeAllRanges(),a.addRange(t)}catch(t){}!1===e&&a.extend&&(a.collapse(t.endContainer,t.endOffset),a.extend(t.startContainer,t.startOffset)),o=a.rangeCount>0?a.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!a.setBaseAndExtent||de.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(a.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),a.anchorNode===t.startContainer&&a.focusNode===t.endContainer||a.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},d=function(){var e=s(),n=null==e?void 0:e.anchorNode,r=null==e?void 0:e.focusNode;if(!e||!n||!r||yn(n)||yn(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},m={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:c,setCursorLocation:function(e,n){var o=t.createRng();y(e)&&y(n)?(o.setStart(e,n),o.setEnd(e,n),f(o),c(!1)):(Af(t,o,r.getBody(),!0),f(o))},getContent:function(t){return Hv(r,t)},setContent:a,getBookmark:function(t,e){return g.getBookmark(t,e)},moveToBookmark:function(t){return g.moveToBookmark(t)},select:function(e,n){return function(t,e,n){return I.from(e).map((function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(Af(t,o,e,!0),Af(t,o,e,!1)),o}))}(t,e,n).each(f),e},isCollapsed:function(){var t=l(),e=s();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:d,setNode:function(e){return a(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,u=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&u-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?gm(r.nextSibling,!0):r.parentNode,o=0===u?gm(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),l())},getSel:s,setRng:f,getRng:l,getStart:function(t){return dm(r.getBody(),l(),t)},getEnd:function(t){return mm(r.getBody(),l(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],u=t.getRoot();if(n=t.getParent(n||dm(u,e,e.collapsed),t.isBlock),r=t.getParent(r||mm(u,e,e.collapsed),t.isBlock),n&&n!==u&&i.push(n),n&&r&&n!==r){o=n;for(var a=new Yr(n,u);(o=a.next())&&o!==r;)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==u&&i.push(r),i}(t,l(),e,n)},normalize:function(){var e=l(),n=s();if(!(xf(n).length>1)&&Df(r)){var o=ud(t,e);return o.each((function(t){f(t,d())})),o.getOr(e)}return e},selectorChanged:function(t,e){return u(t,e),m},selectorChangedWithUnbind:u,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){y(t)?function(t,e,n){(t.inline?Ed:Dd)(t,e,n)}(r,t,e):Md(r,l(),e)},placeCaretAt:function(t,e){return f(Yf(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=l();return t.collapsed?vc.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,h.destroy()}},g=Ff(m),h=Xf(m,r);return m.bookmarkManager=g,m.controlSelection=h,m},Kv=function(t,e,n){t.addNodeFilter("font",(function(t){q(t,(function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),u=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),u&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),function(t,e){q(e,(function(e){t.attr(e,null)}))}(t,["color","face","size"])}))}))},Yv=function(t,e){var n=xi();e.convert_fonts_to_spans&&Kv(t,n,ve.explode(e.font_size_legacy_values)),function(t,e){t.addNodeFilter("strike",(function(t){q(t,(function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))}))}))}(t,n)},Jv=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},Qv=function(t,e){var n;try{n=atob(e)}catch(t){return I.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return I.some(new Blob([r],{type:t}))},Zv=function(t){return 0===t.indexOf("blob:")?function(t){return new Ur((function(e,n){var r=function(){n("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){200===o.status?e(o.response):r()},o.onerror=r,o.send()}catch(t){r()}}))}(t):0===t.indexOf("data:")?(e=t,new Ur((function(t){var n=Jv(e),r=n.type,o=n.data;Qv(r,o).fold((function(){return t(new Blob([]))}),t)}))):null;var e},tb=0,eb=function(t){return(t||"blobid")+tb++},nb=function(t,e,n,r){var o,i;if(0!==e.src.indexOf("blob:")){var u=Jv(e.src),a=u.data,c=u.type;o=a,(i=t.getByData(o,c))?n({image:e,blobInfo:i}):Zv(e.src).then((function(r){i=t.create(eb(),r,o),t.add(i),n({image:e,blobInfo:i})}),(function(t){r(t)}))}else(i=t.getByUri(e.src))?n({image:e,blobInfo:i}):Zv(e.src).then((function(r){(function(t){return new Ur((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))})(r).then((function(u){o=Jv(u).data,i=t.create(eb(),r,o),t.add(i),n({image:e,blobInfo:i})}))}),(function(t){r(t)}))},rb=function(t,e){var n={};return{findAll:function(r,o){o||(o=N);var i=X(function(t){return t?ct(t.getElementsByTagName("img")):[]}(r),(function(e){var n=e.src;return!!de.fileApi&&(!e.hasAttribute("data-mce-bogus")&&(!e.hasAttribute("data-mce-placeholder")&&(!(!n||n===de.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e)))))})),u=W(i,(function(t){if(void 0!==n[t.src])return new Ur((function(e){n[t.src].then((function(n){if("string"==typeof n)return n;e({image:t,blobInfo:n.blobInfo})}))}));var r=new Ur((function(n,r){nb(e,t,n,r)})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r,r}));return Ur.all(u)}}},ob=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new wm("br",1)).shortEnded=!0:r.empty().append(new wm("#text",3)).value=" "},ib=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},ub=function(t,e,n,r){return r.isEmpty(e,n,(function(e){return function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty}(t,e)}))},ab=function(t,e){var n=e.blob_cache,r=function(t){var r=t.attr("src");(function(t){return t.attr("src")===de.transparentSrc||y(t.attr("data-mce-placeholder"))})(t)||function(t){return y(t.attr("data-mce-bogus"))}(t)||function(t){var e=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(t);return e?I.some({type:e[1],data:decodeURIComponent(e[2])}):I.none()}(r).filter((function(){return function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),dt(t.attributes.map,(function(t,e){n.setAttribute(e,t)})),e.images_dataimg_filter(n)}return!0}(t,e)})).bind((function(t){var e=t.type,r=t.data;return I.from(n.getByData(r,e)).orThunk((function(){return Qv(e,r).map((function(t){var e=n.create(eb(),t,r);return n.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))};n&&t.addAttributeFilter("src",(function(t){return q(t,r)}))},cb=ve.makeMap,sb=ve.each,lb=ve.explode,fb=ve.extend,db=function(t,e){void 0===e&&(e=yi());var n={},r=[],o={},i={};(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var u=function(t){var e=t.name;e in n&&((a=o[e])?a.push(t):o[e]=[t]);for(var u=r.length;u--;){var a,c=r[u].name;if(c in t.attributes.map)(a=i[c])?a.push(t):i[c]=[t]}return t},a={schema:e,addAttributeFilter:function(t,e){sb(lb(t),(function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){sb(lb(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},getNodeFilters:function(){var t=[];for(var e in n)wt(n,e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:u,parse:function(a,c){var s,l,f,d,m,g,h,p,v=[];c=c||{},o={},i={};var b=fb(cb("script,style,head,html,body,title,meta,param"),e.getBlockElements()),w=vi(e),x=e.getNonEmptyElements(),C=e.children,S=t.validate,k=function(t){return!1===t?"":!0===t?"p":t}("forced_root_block"in c?c.forced_root_block:t.forced_root_block),O=e.getWhiteSpaceElements(),_=/^[ \t\r\n]+/,T=/[ \t\r\n]+$/,E=/[ \t\r\n]+/g,A=/^[ \t\r\n]+$/,D=wt(O,c.context)||wt(O,t.root_name),M=function(t,e){var r,i=new wm(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i},R=function(t){for(var n=e.getBlockElements(),r=t.prev;r&&3===r.type;){var o=r.value.replace(T,"");if(o.length>0)return void(r.value=o);var i=r.next;if(i){if(3===i.type&&i.value.length){r=r.prev;continue}if(!n[i.name]&&"script"!==i.name&&"style"!==i.name){r=r.prev;continue}}var u=r.prev;r.remove(),r=u}},N=Nm({validate:S,document:t.document,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e={};for(var n in t)"li"!==n&&"p"!==n&&(e[n]=t[n]);return e}(e.getSelfClosingElements()),cdata:function(t){p.append(M("#cdata",4)).value=t},text:function(t,e){var n;D||(t=t.replace(E," "),function(t,e){return t&&(wt(e,t.name)||"br"===t.name)}(p.lastChild,b)&&(t=t.replace(_,""))),0!==t.length&&((n=M("#text",3)).raw=!!e,p.append(n).value=t)},comment:function(t){p.append(M("#comment",8)).value=t},pi:function(t,e){p.append(M(t,7)).value=e,R(p)},doctype:function(t){p.append(M("#doctype",10)).value=t,R(p)},start:function(t,n,o){var u=S?e.getElementRule(t):{};if(u){var a=M(u.outputName||t,1);a.attributes=n,a.shortEnded=o,p.append(a);var c=C[p.name];c&&C[a.name]&&!c[a.name]&&v.push(a);for(var s=r.length;s--;){var l=r[s].name;l in n.map&&((g=i[l])?g.push(a):i[l]=[a])}b[t]&&R(a),o||(p=a),!D&&O[t]&&(D=!0)}},end:function(n){var r,o,i,u=S?e.getElementRule(n):{};if(u){if(b[n]&&!D){if((r=p.firstChild)&&3===r.type)if((o=r.value.replace(_,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||A.test(o))&&(r.remove(),r=i),r=i;if((r=p.lastChild)&&3===r.type)if((o=r.value.replace(T,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||A.test(o))&&(r.remove(),r=i),r=i}D&&O[n]&&(D=!1);var a=ub(e,x,O,p),s=p.parent;u.paddInEmptyBlock&&a&&function(t){for(var n=t;y(n);){if(n.name in w)return ub(e,x,O,n);n=n.parent}return!1}(p)?ob(t,c,b,p):u.removeEmpty&&a?b[p.name]?p.empty().remove():p.unwrap():u.paddEmpty&&(function(t){return ib(t,"#text")&&" "===t.firstChild.value}(p)||a)&&ob(t,c,b,p),p=s}}},e),z=p=new wm(c.context||t.root_name,11);if(N.parse(a,c.format),S&&v.length&&(c.context?c.invalid=!0:function(t){for(var n=cb("tr,td,th,tbody,thead,tfoot,table"),r=e.getNonEmptyElements(),o=e.getWhiteSpaceElements(),i=e.getTextBlockElements(),a=e.getSpecialElements(),c=function(t,n){if(void 0===n&&(n=t.parent),a[t.name])t.empty().remove();else{for(var r=0,o=t.children();r<o.length;r++){var i=o[r];e.isValidChild(n.name,i.name)||c(i,n)}t.unwrap()}},s=0;s<t.length;s++){var l=t[s],f=void 0,d=void 0,m=void 0;if(l.parent&&!l.fixed)if(i[l.name]&&"li"===l.parent.name){for(var g=l.next;g&&i[g.name];)g.name="li",g.fixed=!0,l.parent.insert(g,l.parent),g=g.next;l.unwrap()}else{var h=[l];for(f=l.parent;f&&!e.isValidChild(f.name,l.name)&&!n[f.name];f=f.parent)h.push(f);if(f&&h.length>1)if(e.isValidChild(f.name,l.name)){h.reverse();for(var p=d=u(h[0].clone()),v=0;v<h.length-1;v++){e.isValidChild(p.name,h[v].name)?(m=u(h[v].clone()),p.append(m)):m=p;for(var b=h[v].firstChild;b&&b!==h[v+1];){var y=b.next;m.append(b),b=y}p=m}ub(e,r,o,d)?f.insert(l,h[0],!0):(f.insert(d,h[0],!0),f.insert(l,d)),f=h[0],(ub(e,r,o,f)||ib(f,"br"))&&f.empty().remove()}else c(l);else if(l.parent){if("li"===l.name){if((g=l.prev)&&("ul"===g.name||"ol"===g.name)){g.append(l);continue}if((g=l.next)&&("ul"===g.name||"ol"===g.name)){g.insert(l,g.firstChild,!0);continue}l.wrap(u(new wm("ul",1)));continue}e.isValidChild(l.parent.name,"div")&&e.isValidChild("div",l.name)?l.wrap(u(new wm("div",1))):c(l)}}}}(v)),k&&("body"===z.name||c.isRootContent)&&function(){var n=z.firstChild,r=null,o=function(t){t&&((n=t.firstChild)&&3===n.type&&(n.value=n.value.replace(_,"")),(n=t.lastChild)&&3===n.type&&(n.value=n.value.replace(T,"")))};if(e.isValidChild(z.name,k.toLowerCase())){for(;n;){var i=n.next;3===n.type||1===n.type&&"p"!==n.name&&!b[n.name]&&!n.attr("data-mce-type")?r?r.append(n):((r=M(k,1)).attr(t.forced_root_block_attrs),z.insert(r,n),r.append(n)):(o(r),r=null),n=i}o(r)}}(),!c.invalid){for(h in o)if(wt(o,h)){for(g=n[h],d=(s=o[h]).length;d--;)s[d].parent||s.splice(d,1);for(l=0,f=g.length;l<f;l++)g[l](s,h,c)}for(l=0,f=r.length;l<f;l++)if((g=r[l]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c)}}return z}};return function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,r,o){var i,u,a,c,s,l,f,d,m=t.length,g=ve.extend({},n.getBlockElements()),h=n.getNonEmptyElements(),p=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(a=(u=t[i]).parent,g[u.parent.name]&&u===a.lastChild){for(s=u.prev;s;){if("span"!==(l=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===l&&(u=null);break}s=s.prev}u&&(u.remove(),ub(n,h,p,a)&&(f=n.getElementRule(a.name))&&(f.removeEmpty?a.remove():f.paddEmpty&&ob(e,o,g,a)))}else{for(c=u;a&&a.firstChild===c&&a.lastChild===c&&(c=a,!g[a.name]);)a=a.parent;c===a&&!0!==e.padd_empty_with_br&&((d=new wm("#text",3)).value=" ",u.replace(d))}})),t.addAttributeFilter("href",(function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(n=i.attr("rel"),r=void 0,r=n?ve.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(t){return t.split(" ").filter((function(t){return t.length>0})).concat(["noopener"]).sort().join(" ")}(r)))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){for(var e,n,r=t.length;r--;)if("ul"===(n=(e=t[r]).parent).name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new wm("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){for(var e=n.getValidClasses(),r=t.length;r--;){for(var o=t[r],i=o.attr("class").split(" "),u="",a=0;a<i.length;a++){var c=i[a],s=!1,l=e["*"];l&&l[c]&&(s=!0),l=e[o.name],!s&&l&&l[c]&&(s=!0),s&&(u&&(u+=" "),u+=c)}u.length||(u=null),o.attr("class",u)}})),ab(t,e)}(a,t),function(t,e){e.inline_styles&&Yv(t,e)}(a,t),a},mb=function(t,e,n){return function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events}(t,n)?function(t,e,n){var r,o=t.dom,i=e.cloneNode(!0),u=document.implementation;if(u.createHTMLDocument){var a=u.createHTMLDocument("");ve.each("BODY"===i.nodeName?i.childNodes:[i],(function(t){a.body.appendChild(a.importNode(t,!0))})),i="BODY"!==i.nodeName?a.body.firstChild:a.body,r=o.doc,o.doc=a}return function(t,e){t.fire("PreProcess",e)}(t,Dt(Dt({},n),{node:i})),r&&(o.doc=r),i}(t,e,n):e},gb=function(t,e,n){-1===ve.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),e.push(n))},hb=function(t,e,n,r,o){return function(t,e,n){return!e.no_events&&t?function(t,e){return t.fire("PostProcess",e)}(t,Dt(Dt({},e),{content:n})).content:n}(t,o,function(t,e,n){return Vm(t,e).serialize(n)}(e,n,r))},pb=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:oa.DOM,o=e&&e.schema?e.schema:yi(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=db(t,o);!function(t,e,n){t.addAttributeFilter("data-mce-tabindex",(function(t,e){for(var n=t.length;n--;){var r=t[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(e,null)}})),t.addAttributeFilter("src,href,style",(function(t,r){for(var o="data-mce-"+r,i=e.url_converter,u=e.url_converter_scope,a=t.length;a--;){var c=t[a],s=c.attr(o);void 0!==s?(c.attr(r,s.length>0?s:null),c.attr(o,null)):(s=c.attr(r),"style"===r?s=n.serializeStyle(n.parseStyle(s),c.name):i&&(s=i.call(u,s,r,c.name)),c.attr(r,s.length>0?s:null))}})),t.addAttributeFilter("class",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("class");r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}})),t.addAttributeFilter("data-mce-type",(function(t,e,n){for(var r=t.length;r--;){var o=t[r];if("bookmark"===o.attr("data-mce-type")&&!n.cleanup)I.from(o.firstChild).exists((function(t){return!so(t.value)}))?o.unwrap():o.remove()}})),t.addNodeFilter("noscript",(function(t){for(var e=t.length;e--;){var n=t[e].firstChild;n&&(n.value=ai.decode(n.value))}})),t.addNodeFilter("script,style",(function(t,n){for(var r=function(t){return t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")},o=t.length;o--;){var i=t[o],u=i.firstChild?i.firstChild.value:"";if("script"===n){var a=i.attr("type");a&&i.attr("type","mce-no/type"===a?null:a.replace(/^mce\-/,"")),"xhtml"===e.element_format&&u.length>0&&(i.firstChild.value="// <![CDATA[\n"+r(u)+"\n// ]]>")}else"xhtml"===e.element_format&&u.length>0&&(i.firstChild.value="\x3c!--\n"+r(u)+"\n--\x3e")}})),t.addNodeFilter("#comment",(function(t){for(var r=t.length;r--;){var o=t[r];e.preserve_cdata&&0===o.value.indexOf("[CDATA[")?(o.name="#cdata",o.type=4,o.value=n.decode(o.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===o.value.indexOf("mce:protected ")&&(o.name="#text",o.type=3,o.raw=!0,o.value=unescape(o.value).substr(14))}})),t.addNodeFilter("xml:namespace,input",(function(t,e){for(var n=t.length;n--;){var r=t[n];7===r.type?r.remove():1===r.type&&("input"!==e||r.attr("type")||r.attr("type","text"))}})),t.addAttributeFilter("data-mce-type",(function(e){q(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)}))}(i,t,r);return{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,u){void 0===u&&(u={});var a=Dt({format:"html"},u),c=mb(e,n,a),s=function(t,e,n){var r=lo(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||ao(ye.fromDom(e))?r:ve.trim(r)}(r,c,a),l=function(t,e,n){var r=n.selection?Dt({forced_root_block:!1},n):n,o=t.parse(e,r);return function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}}(o),o}(i,s,a);return"tree"===a.format?l:hb(e,t,o,l,a)},addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:E(gb,i,n),getTempAttrs:O(n),getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},vb=function(t,e){var n=pb(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},bb=function(t,e){return void 0===e&&(e={}),function(t,e,n){return Iv(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")},yb=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return Iv(t).editor.setContent(e,n)}(t,e,n)},wb=oa.DOM,xb=function(t){return I.from(t).each((function(t){return t.destroy()}))},Cb=function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&wb.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){wb.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),wb.remove(t.getContainer()),xb(e),xb(n),t.destroy()}},Sb=function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),xb(n),xb(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),wb.unbind(e,"submit reset",t.formEventDelegate))}(t),function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)}(t),t.destroyed=!0):t.remove())},kb=(Wv=function(t,e){return m(t)&&m(e)?kb(t,e):e},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)wt(o,i)&&(n[i]=Wv(n[i],o[i]))}return n}),Ob="autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),_b="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),Tb="imagetools,toc".split(","),Eb=function(t){var e=X(Ob,(function(e){return wt(t,e)})),n=t.forced_root_block;return!1!==n&&""!==n||e.push("forced_root_block (false only)"),ot(e)},Ab=function(t){var e=ve.makeMap(t.plugins," "),n=function(t){return wt(e,t)},r=Mt(Mt([],X(_b,n),!0),tt(Tb,(function(t){return n(t)?[t+" (moving to premium)"]:[]})),!0);return ot(r)},Db=re().deviceType,Mb=Db.isTouch(),Rb=Db.isPhone(),Nb=Db.isTablet(),zb=["lists","autolink","autosave"],Bb={table_grid:!1,object_resizing:!1,resize:!1},Pb=function(t){var e=g(t)?t.join(" "):t,n=W(d(e)?e.split(" "):[],Ft);return X(n,(function(t){return t.length>0}))},Ib=function(t,e){var n,r,o=(r={},pt(e,(function(e,n){return j(t,n)}),ht(n={}),ht(r)),{t:n,f:r});return function(t,e){return{sections:O(t),settings:O(e)}}(o.t,o.f)},Lb=function(t,e){return wt(t.sections(),e)},Hb=function(t,e){return yt(t,"toolbar_mode").orThunk((function(){return yt(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},Fb=function(t,e){var n={resize:!1,toolbar_mode:Hb(t,"scrolling"),toolbar_sticky:!1};return Dt(Dt(Dt({},Bb),n),e?{menubar:!1}:{})},Vb=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?ve.extend({},t.external_plugins,n):n},jb=function(t,e,n,r){return t&&function(t,e,n){var r=t.sections();return Lb(t,e)&&r[e].theme===n}(e,"mobile","mobile")?X(r,E(j,zb)):t&&Lb(e,"mobile")?r:n},Ub=function(t,e,n,r){var o=Pb(n.forced_plugins),i=Pb(r.plugins),u=function(t,e){return Lb(t,e)?t.sections()[e]:{}}(e,"mobile"),a=u.plugins?Pb(u.plugins):i,c=function(t,e){return[].concat(Pb(t)).concat(Pb(e))}(o,jb(t,e,i,a));if(de.browser.isIE()&&j(c,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return ve.extend(r,{plugins:c.join(" ")})},Wb=function(t,e,n,r,o){var i=t?{mobile:Fb(o.mobile||{},e)}:{},u=Ib(["mobile"],kb(i,o)),a=ve.extend(n,r,u.settings(),function(t,e){return t&&Lb(e,"mobile")}(t,u)?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=yt(r,e).getOr({});return ve.extend({},n,o)}(u,"mobile"):{},{validate:!0,external_plugins:Vb(r,u.settings())});return Ub(t,u,r,a)},qb=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:Hb(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return Dt(Dt({},i),r?Bb:{})}(o,e,n,Mb,t),u=Wb(Rb||Nb,Rb,i,r,o);return!1!==u.deprecation_warnings&&function(t,e){var n=Eb(t),r=Ab(e),o=r.length>0,i=n.length>0,u="mobile"===e.theme;if(o||i||u){var a=u?"\n\nThemes:\n- mobile":"",c=o?"\n\nPlugins:\n- "+r.join("\n- "):"",s=i?"\n\nSettings:\n- "+n.join("\n- "):"";console.warn("The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information."+a+c+s)}}(o,u),u},Gb=function(t,e,n){return I.from(e.settings[n]).filter(t)},$b=function(t,e,n,r){var o,i=e in t.settings?t.settings[e]:n;return"hash"===r?function(t){var e={};return"string"==typeof t?q(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),(function(t){var n=t.split("=");n.length>1?e[ve.trim(n[0])]=ve.trim(n[1]):e[ve.trim(n[0])]=ve.trim(n[0])})):e=t,e}(i):"string"===r?Gb(d,t,e).getOr(n):"number"===r?Gb(x,t,e).getOr(n):"boolean"===r?Gb(p,t,e).getOr(n):"object"===r?Gb(m,t,e).getOr(n):"array"===r?Gb(g,t,e).getOr(n):"string[]"===r?Gb((o=d,function(t){return g(t)&&et(t,o)}),t,e).getOr(n):"function"===r?Gb(w,t,e).getOr(n):i},Xb=(qv={},{add:function(t,e){qv[t]=e},get:function(t){return qv[t]?qv[t]:{icons:{}}},has:function(t){return wt(qv,t)}}),Kb=function(t,e){return e.dom[t]},Yb=function(t,e){return parseInt(Xn(e,t),10)},Jb=E(Kb,"clientWidth"),Qb=E(Kb,"clientHeight"),Zb=E(Yb,"margin-top"),ty=E(Yb,"margin-left"),ey=function(t,e,n){var r,o=ye.fromDom(t.getBody()),i=t.inline?o:(r=o,ye.fromDom(ze(r).dom.documentElement)),u=function(t,e,n,r){var o=function(t){return t.dom.getBoundingClientRect()}(e);return{x:n-(t?o.left+e.dom.clientLeft+ty(e):0),y:r-(t?o.top+e.dom.clientTop+Zb(e):0)}}(t.inline,i,e,n);return function(t,e,n){var r=Jb(t),o=Qb(t);return e>=0&&n>=0&&e<=r&&n<=o}(i,u.x,u.y)},ny=function(t){var e,n=t.inline?t.getBody():t.getContentAreaContainer();return(e=n,I.from(e).map(ye.fromDom)).map(cn).getOr(!1)},ry=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},r=function(){return I.from(e[0])},o=function(){e.length>0&&n().reposition(e)},i=function(t){Z(e,(function(e){return e===t})).each((function(t){e.splice(t,1)}))},u=function(u,a){if(void 0===a&&(a=!0),!t.removed&&ny(t))return a&&t.fire("BeforeOpenNotification",{notification:u}),Q(e,(function(t){return e=n().getArgs(t),r=u,!(e.type!==r.type||e.text!==r.text||e.progressBar||e.timeout||r.progressBar||r.timeout);var e,r})).getOrThunk((function(){t.editorManager.setActive(t);var a=n().open(u,(function(){i(a),o(),r().fold((function(){return t.focus()}),(function(t){return ye.fromDom(t.getEl()).dom.focus()}))}));return function(t){e.push(t)}(a),o(),t.fire("OpenNotification",{notification:Dt({},a)}),a}))},a=O(e);return function(t){t.on("SkinLoaded",(function(){var e=function(t){return t.getParam("service_message")}(t);e&&u({text:e,type:"warning",timeout:0},!1),o()})),t.on("show ResizeEditor ResizeWindow NodeChange",(function(){$r.requestAnimationFrame(o)})),t.on("remove",(function(){q(e.slice(),(function(t){n().close(t)}))}))}(t),{open:u,close:function(){r().each((function(t){n().close(t),i(t),o()}))},getNotifications:a}},oy=ga.PluginManager,iy=ga.ThemeManager;var uy=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e?e.apply(t,n):void 0}},o=function(n){e.push(n),function(e){t.fire("OpenWindow",{dialog:e})}(n)},i=function(n){!function(e){t.fire("CloseWindow",{dialog:e})}(n),0===(e=X(e,(function(t){return t!==n}))).length&&t.focus()},u=function(e){t.editorManager.setActive(t),Xd(t);var n=e();return o(n),n};return t.on("remove",(function(){q(e,(function(t){n().close(t)}))})),{open:function(t,e){return u((function(){return n().open(t,e,i)}))},openUrl:function(t){return u((function(){return n().openUrl(t,i)}))},alert:function(t,e,o){var i=n();i.alert(t,r(o||i,e))},confirm:function(t,e,o){var i=n();i.confirm(t,r(o||i,e))},close:function(){I.from(e[e.length-1]).each((function(t){n().close(t),i(t)}))}}},ay=function(t,e){t.notificationManager.open({type:"error",text:e})},cy=function(t,e){t._skinLoaded?ay(t,e):t.on("SkinLoaded",(function(){ay(t,e)}))},sy=function(t,e,n){Uf(t,e,{message:n}),console.error(n)},ly=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},fy=function(t,e,n){sy(t,"PluginLoadError",ly("plugin",e,n))},dy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,Mt([t],e,!1)):r.log.apply(r,Mt([t],e,!1)))},my=function(t){return gy(t,function(t){var e=t.getParam("content_css");return d(e)?W(e.split(","),Ft):g(e)?e:!1===e||t.inline?[]:["default"]}(t))},gy=function(t,e){var n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return W(e,(function(e){return function(t){return/^[a-z0-9\-]+$/i.test(t)}(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)}))},hy=function(t){t.contentCSS=t.contentCSS.concat(my(t),function(t){return gy(t,rs(t))}(t))},py=function(){var t={},e=function(t,e){return{status:t,resultUri:e}},n=function(e){return e in t};return{hasBlobUri:n,getResultUri:function(e){var n=t[e];return n?n.resultUri:null},isPending:function(e){return!!n(e)&&1===t[e].status},isUploaded:function(e){return!!n(e)&&2===t[e].status},markPending:function(n){t[n]=e(1,null)},markUploaded:function(n,r){t[n]=e(2,r)},removeFailed:function(e){delete t[e]},destroy:function(){t={}}}},vy=0,by=function(t){return t+vy+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e},yy=function(t,e){var n={},r=function(t,n,r,o){var i=new XMLHttpRequest;i.open("POST",e.url),i.withCredentials=e.credentials,i.upload.onprogress=function(t){o(t.loaded/t.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){if(i.status<200||i.status>=300)r("HTTP Error: "+i.status);else{var t,o,u=JSON.parse(i.responseText);if(u&&"string"==typeof u.location)n((t=e.basePath,o=u.location,t?t.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o));else r("Invalid JSON: "+i.responseText)}};var u=new FormData;u.append("file",t.blob(),t.filename()),i.send(u)},o=function(t,e){return{url:e,blobInfo:t,status:!0}},i=function(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}},u=function(t,e){ve.each(n[t],(function(t){t(e)})),delete n[t]},a=function(r,a){return r=ve.grep(r,(function(e){return!t.isUploaded(e.blobUri())})),Ur.all(ve.map(r,(function(r){return t.isPending(r.blobUri())?function(t){var e=t.blobUri();return new Ur((function(t){n[e]=n[e]||[],n[e].push(t)}))}(r):function(e,n,r){return t.markPending(e.blobUri()),new Ur((function(a){var c;try{var s=function(){c&&(c.close(),C)};n(e,(function(n){s(),t.markUploaded(e.blobUri(),n),u(e.blobUri(),o(e,n)),a(o(e,n))}),(function(n,r){var o=r||{};s(),t.removeFailed(e.blobUri()),u(e.blobUri(),i(e,n,o)),a(i(e,n,o))}),(function(t){t<0||t>100||I.from(c).orThunk((function(){return I.from(r).map(D)})).each((function(e){c=e,e.progressBar.value(t)}))}))}catch(t){a(i(e,t.message,{}))}}))}(r,e.handler,a)})))};return!1===w(e.handler)&&(e.handler=r),{upload:function(t,n){return e.url||e.handler!==r?a(t,n):new Ur((function(t){t([])}))}}},wy=function(t){return function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}},xy=function(t,e){return yy(e,{url:Kc(t),basePath:Yc(t),credentials:Jc(t),handler:Qc(t)})},Cy=function(t){var e,n,r=function(){var t=[],e=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e,n=t.id||by("blobid"),r=t.name||n,o=t.blob;return{id:O(n),name:O(r),filename:O(t.filename||r+"."+(e=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[e.toLowerCase()]||"dat")),blob:O(o),base64:O(t.base64),blobUri:O(t.blobUri||URL.createObjectURL(o)),uri:O(t.uri)}},n=function(e){return Q(t,e).getOrUndefined()},r=function(t){return n((function(e){return e.id()===t}))};return{create:function(t,n,r,o,i){if(d(t))return e({id:t,name:o,filename:i,blob:n,base64:r});if(m(t))return e(t);throw new Error("Unknown input type")},add:function(e){r(e.id())||t.push(e)},get:r,getByUri:function(t){return n((function(e){return e.blobUri()===t}))},getByData:function(t,e){return n((function(n){return n.base64()===t&&n.blob().type===e}))},findFirst:n,removeByUri:function(e){t=X(t,(function(t){return t.blobUri()!==e||(URL.revokeObjectURL(t.blobUri()),!1)}))},destroy:function(){q(t,(function(t){URL.revokeObjectURL(t.blobUri())})),t=[]}}}(),o=py(),i=[],u=function(t){var e=sa(null);t.on("change AddUndo",(function(t){e.set(Dt({},t.level))}));return{fireIfChanged:function(){var n=t.undoManager.data;at(n).filter((function(t){return!Dv(e.get(),t)})).each((function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:it(n,n.length-2).getOrNull()})}))}}}(t),a=function(e){return function(n){return t.selection?e(n):[]}},c=function(t,e,n){var r=0;do{-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},s=function(t,e,n){var r='src="'+n+'"'+(n===de.transparentSrc?' data-mce-placeholder="1"':"");return t=c(t,'src="'+e+'"',r),t=c(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},l=function(e,n){q(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=W(t.fragments,(function(t){return s(t,e,n)})):t.content=s(t.content,e,n)}))},f=function(n){return e||(e=xy(t,o)),p().then(a((function(o){var i=W(o,(function(t){return t.blobInfo}));return e.upload(i,wy(t)).then(a((function(e){var i=[],a=W(e,(function(e,n){var u=o[n].blobInfo,a=o[n].image;return e.status&&function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(r.removeByUri(a.src),Bv(t)||function(e,n){var r,o=t.convertURL(n,"src");l(e.src,n),t.$(e).attr({src:$c(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})}(a,e.url)):e.error&&(e.error.options.remove&&(l(a.getAttribute("src"),de.transparentSrc),i.push(a)),function(t,e){cy(t,ma.translate(["Failed to upload image: {0}",e]))}(t,e.error.message)),{element:a,status:e.status,uploadUri:e.url,blobInfo:u}}));return a.length>0&&u.fireIfChanged(),i.length>0&&(Bv(t)?console.error("Removing images on failed uploads is currently unsupported for RTC"):t.undoManager.transact((function(){q(i,(function(e){t.dom.remove(e),r.removeByUri(e.src)}))}))),n&&n(a),a})))})))},g=function(e){if(Gc(t))return f(e)},h=function(e){return!1!==et(i,(function(t){return t(e)}))&&(0!==e.getAttribute("src").indexOf("data:")||function(t){return t.getParam("images_dataimg_filter",N,"function")}(t)(e))},p=function(){return n||(n=rb(o,r)),n.findAll(t.getBody(),h).then(a((function(e){return e=X(e,(function(e){return"string"!=typeof e||(cy(t,e),!1)})),Bv(t)||q(e,(function(t){l(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},v=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var i=o.getResultUri(n);if(i)return'src="'+i+'"';var u=r.getByUri(n);return u||(u=Y(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null)),u?'src="data:'+u.blob().type+";base64,"+u.base64()+'"':e}))};return t.on("SetContent",(function(){Gc(t)?g():p()})),t.on("RawSaveContent",(function(t){t.content=v(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=v(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){q(t,(function(t){var e=t.attr("src");if(!r.getByUri(e)){var n=o.getResultUri(e);n&&t.attr("src",n)}}))}))})),{blobCache:r,addFilter:function(t){i.push(t)},uploadImages:f,uploadImagesAuto:g,scanForImages:p,destroy:function(){r.destroy(),o.destroy(),n=e=null}}},Sy=function(t){var e={},n=function(t,r){t&&(d(t)?(g(r)||(r=[r]),q(r,(function(t){v(t.deep)&&(t.deep=!ef(t)),v(t.split)&&(t.split=!ef(t)||nf(t)),v(t.remove)&&ef(t)&&!nf(t)&&(t.remove="none"),ef(t)&&nf(t)&&(t.mixed=!0,t.block_expand=!0),d(t.classes)&&(t.classes=t.classes.split(/\s+/))})),e[t]=r):dt(t,(function(t,e){n(e,t)})))};return n(function(t){var e={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(t,e,n){return wn(t)&&t.hasAttribute("href")},onformat:function(e,n,r){ve.each(r,(function(n,r){t.setAttrib(e,r,n)}))}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(t){var e;return null!==(e=null==t?void 0:t.customValue)&&void 0!==e?e:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return ve.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(function(t){e[t]={block:t,remove:"all"}})),e}(t.dom)),n(function(t){return t.getParam("formats")}(t)),{get:function(t){return y(t)?e[t]:e},has:function(t){return wt(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}},ky=ve.each,Oy=oa.DOM,_y=function(t,e){var n,r,o,i=e&&e.schema||yi({}),u=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=Oy.create(r.name);return function(t,e){e.classes.length&&Oy.addClass(t,e.classes.join(" ")),Oy.setAttribs(t,e.attrs)}(e,r),e},a=function(t,e,n){var r,o,c=e.length>0&&e[0],s=c&&c.name,l=function(t,e){var n="string"!=typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==ve.inArray(o,e)?e:o[0])}(t,s);if(l)s===l?(o=e[0],e=e.slice(1)):o=l;else if(c)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=u(o)).appendChild(t),n&&(r||(r=Oy.create("div")).appendChild(t),ve.each(n,(function(e){var n=u(e);r.insertBefore(n,t)}))),a(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=u(r),(o=Oy.create("div")).appendChild(a(n,t.slice(1),r.siblings)),o):""},Ty=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=ve.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==ve.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var u=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);u&&(n.attrs[u[1]]=u[2])}return""}))),n.name=e||"div",n},Ey=function(t,e){var n,r,o,i="",u=function(t){var e=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return d(e)?e:""}(t);if(""===u)return"";var a=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var c=yt(e,"preview");if(Ln(c,!1))return"";u=c.getOr(u)}n=e.block||e.inline||"span";var s,l=(s=e.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),ve.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=ve.map(t.split(/(?:~\+|~|\+)/),Ty),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[];l.length?(l[0].name||(l[0].name=n),n=e.selector,r=_y(l,t)):r=_y([n],t);var f=Oy.select(n,r)[0]||r.firstChild;return ky(e.styles,(function(t,e){var n=a(t);n&&Oy.setStyle(f,e,n)})),ky(e.attributes,(function(t,e){var n=a(t);n&&Oy.setAttrib(f,e,n)})),ky(e.classes,(function(t){var e=a(t);Oy.hasClass(f,e)||Oy.addClass(f,e)})),t.fire("PreviewFormats"),Oy.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=Oy.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,ky(u.split(" "),(function(e){var n=Oy.getStyle(f,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Oy.getStyle(t.getBody(),e,!0),"#ffffff"===Oy.toHex(n).toLowerCase())||"color"===e&&"#000000"===Oy.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),Oy.remove(r),i},Ay=function(t){var e=Sy(t),n=sa(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),pp(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){Lv(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){Lv(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){Lv(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:function(e,n,r,o){return function(t,e,n,r,o){return Lv(t).formatter.match(e,n,r,o)}(t,e,n,r,o)},closest:function(e){return function(t,e){return Lv(t).formatter.closest(e)}(t,e)},matchAll:function(e,n){return function(t,e,n){return Lv(t).formatter.matchAll(e,n)}(t,e,n)},matchNode:function(e,n,r,o){return function(t,e,n,r,o){return Lv(t).formatter.matchNode(e,n,r,o)}(t,e,n,r,o)},canApply:function(e){return function(t,e){return Lv(t).formatter.canApply(e)}(t,e)},formatChanged:function(e,r,o,i){return function(t,e,n,r,o,i){return Lv(t).formatter.formatChanged(e,n,r,o,i)}(t,n,e,r,o,i)},getCssText:E(Ey,t)}},Dy=function(t){switch(t.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return!0;default:return!1}},My=function(t){var e=ha(),n=sa(0),r=sa(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){Lv(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,u){return function(t,e,n,r,o,i,u){return Lv(t).undoManager.add(e,n,r,o,i,u)}(t,o,r,n,e,i,u)},undo:function(){return function(t,e,n,r){return Lv(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return Lv(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){Lv(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){Lv(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return Lv(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return Lv(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return Lv(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){Lv(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){Lv(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return Bv(t)||function(t,e,n){var r=sa(!1),o=function(t){Rv(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command;Dy(r)||(Nv(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command;Dy(e)||o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===Dv(_v(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var u=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||u||(e.beforeChange(),Rv(e,!0,n),e.add({},t),r.set(!0))}})),t.on("mousedown",(function(t){e.typing&&o(t)}));t.on("input",(function(t){t.inputType&&("insertReplacementText"===t.inputType||function(t){return"insertText"===t.inputType&&null===t.data}(t)||function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType}(t))&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))}(t,o,n),function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")}(t),o},Ry=[9,27,Gf.HOME,Gf.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Gf.DOWN,Gf.UP,Gf.LEFT,Gf.RIGHT].concat(de.browser.isFirefox()?[224]:[]),Ny=function(t){return"keydown"===t.type||"keyup"===t.type},zy=function(t){var e=t.keyCode;return e===Gf.BACKSPACE||e===Gf.DELETE},By=function(t){var e=t.dom,n=Wc(t),r=function(t){return t.getParam("placeholder",Vc.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function(i,u){if(!function(t){if(Ny(t)){var e=t.keyCode;return!zy(t)&&(Gf.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||j(Ry,e))}return!1}(i)){var a=t.getBody(),c=!function(t){return Ny(t)&&!(zy(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(Uo(ye.fromDom(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(e,a,n);(""!==e.getAttrib(a,"data-mce-placeholder")!==c||u)&&(e.setAttrib(a,"data-mce-placeholder",c?r:null),e.setAttrib(a,"aria-placeholder",c?r:null),function(t,e){t.fire("PlaceholderToggle",{state:e})}(t,c),t.on(c?"keydown":"keyup",o),t.off(c?"keyup":"keydown",o))}};r&&t.on("init",(function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",(function(e){return $r.setEditorTimeout(t,(function(){return o(e)}))}))}))},Py=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Iy=function(t,e){return xe(ye.fromDom(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},Ly=function(t){return"rtl"===oa.DOM.getStyle(t,"direction",!0)||(e=t.textContent,Py.test(e));var e},Hy=function(t,e,n){var r=function(t,e,n){return X(oa.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return I.from(r[r.length-1])},Fy=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?ho(n)?En(n.nextSibling)?vc(n.nextSibling,0):vc.after(n):bo(e)?vc(n,r+1):e:ho(n)?En(n.previousSibling)?vc(n.previousSibling,n.previousSibling.data.length):vc.before(n):yo(e)?vc(n,r-1):e},Vy=E(Fy,!0),jy=E(Fy,!1),Uy=function(t){return no(t)||oo(t)},Wy=function(t,e){return Oe(t,e)?Lr(e,Uy,function(t){return function(e){return Se(t,ye.fromDom(e.dom.parentNode))}}(t)):I.none()},qy=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)}(t))},Gy=function(t,e){return{from:t,to:e}},$y=function(t,e){var n=ye.fromDom(t),r=ye.fromDom(e.container());return Wy(n,r).map((function(t){return function(t,e){return{block:t,position:e}}(t,e)}))},Xy=function(t,e,n){var r=$y(t,vc.fromRangeStart(n)),o=r.bind((function(n){return vl(e,t,n.position).bind((function(n){return $y(t,n).map((function(n){return function(t,e,n){return Rn(n.position.getNode())&&!1===Uo(n.block)?wl(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?vl(e,t,r).bind((function(e){return $y(t,e)})):I.some(n)})).getOr(n):n}(t,e,n)}))}))}));return Hn(r,o,Gy).filter((function(t){return function(t){return!1===Se(t.from.block,t.to.block)}(t)&&function(t){return Pe(t.from.block).bind((function(e){return Pe(t.to.block).filter((function(t){return Se(e,t)}))})).isSome()}(t)&&function(t){return!1===Bn(t.from.block.dom)&&!1===Bn(t.to.block.dom)}(t)}))},Ky=function(t){var e=Ve(t);return Z(e,Zr).fold(O(e),(function(t){return e.slice(0,t)}))},Yy=function(t){var e=Ky(t);return q(e,un),e},Jy=function(t,e){var n=mg(e,t);return Q(n.reverse(),(function(t){return Uo(t)})).each(un)},Qy=function(t,e,n,r){if(Uo(n))return sg(n),Sl(n.dom);0===X(He(r),(function(t){return!Uo(t)})).length&&Uo(e)&&Ze(r,ye.fromTag("br"));var o=Cl(n.dom,vc.before(r.dom));return q(Yy(e),(function(t){Ze(r,t)})),Jy(t,e),o},Zy=function(t,e,n){if(Uo(n))return un(n),Uo(e)&&sg(e),Sl(e.dom);var r=kl(n.dom);return q(Yy(e),(function(t){nn(n,t)})),Jy(t,e),r},tw=function(t,e){return Oe(e,t)?function(t,e){var n=mg(e,t);return I.from(n[n.length-1])}(e,t):I.none()},ew=function(t,e){wl(t,e.dom).map((function(t){return t.getNode()})).map(ye.fromDom).filter(eo).each(un)},nw=function(t,e,n){return ew(!0,e),ew(!1,n),tw(e,n).fold(E(Zy,t,e,n),E(Qy,t,e,n))},rw=function(t,e,n,r){return e?nw(t,r,n):nw(t,n,r)},ow=function(t,e){var n=ye.fromDom(t.getBody()),r=function(t,e,n){return n.collapsed?Xy(t,e,n):I.none()}(n.dom,e,t.selection.getRng()).bind((function(t){return rw(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},iw=function(t,e){var n=ye.fromDom(e),r=E(Se,t);return Ir(n,uo,r).isSome()},uw=function(t,e){var n=Cl(t.dom,vc.fromRangeStart(e)).isNone(),r=xl(t.dom,vc.fromRangeEnd(e)).isNone();return!function(t,e){return iw(t,e.startContainer)||iw(t,e.endContainer)}(t,e)&&n&&r},aw=function(t){var e=ye.fromDom(t.getBody()),n=t.selection.getRng();return uw(e,n)?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return Hn(Wy(t,ye.fromDom(n.startContainer)),Wy(t,ye.fromDom(n.endContainer)),(function(r,o){return!1===Se(r,o)&&(n.deleteContents(),rw(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)}(e,t.selection)},cw=function(t,e){return!t.selection.isCollapsed()&&aw(t)},sw=zn,lw=Bn,fw=function(t,e,n,r,o){return I.from(e._selectionOverrides.showCaret(t,n,r,o))},dw=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?I.none():I.some(function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e))},mw=function(t,e,n){var r=Ks(1,t.getBody(),e),o=vc.fromRangeStart(r),i=o.getNode();if(Es(i))return fw(1,t,i,!o.isAtEnd(),!1);var u=o.getNode(!0);if(Es(u))return fw(1,t,u,!1,!1);var a=t.dom.getParent(o.getNode(),(function(t){return lw(t)||sw(t)}));return Es(a)?fw(1,t,a,!1,n):I.none()},gw=function(t,e,n){return e.collapsed?mw(t,e,n).getOr(e):e},hw=function(t){return ug(t)||ng(t)},pw=function(t){return ag(t)||rg(t)},vw=function(t,e,n,r,o,i){return fw(r,t,i.getNode(!o),o,!0).each((function(n){if(e.collapsed){var r=e.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()}else e.deleteContents();t.selection.setRng(n)})),function(t,e){En(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},bw=function(t,e){return function(t,e){var n=t.selection.getRng();if(!En(n.commonAncestorContainer))return!1;var r=e?bc.Forwards:bc.Backwards,o=dl(t.getBody()),i=E(Zs,e?o.next:o.prev),u=e?hw:pw,a=Js(r,t.getBody(),n),c=Fy(e,i(a));if(!c||!tl(a,c))return!1;if(u(c))return vw(t,n,a.getNode(),r,e,c);var s=i(c);return!!(s&&u(s)&&tl(c,s))&&vw(t,n,a.getNode(),r,e,s)}(t,e)},yw=gr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),ww=function(t,e,n,r){var o=r.getNode(!1===e);return Wy(ye.fromDom(t),ye.fromDom(n.getNode())).map((function(t){return Uo(t)?yw.remove(t.dom):yw.moveToElement(o)})).orThunk((function(){return I.some(yw.moveToElement(o))}))},xw=function(t,e,n){return vl(e,t,n).bind((function(r){return o=r.getNode(),uo(ye.fromDom(o))||oo(ye.fromDom(o))?I.none():function(t,e,n,r){var o=function(e){return to(ye.fromDom(e))&&!js(n,r,t)};return Ys(!e,n).fold((function(){return Ys(e,r).fold(R,o)}),o)}(t,e,n,r)?I.none():e&&Bn(r.getNode())?ww(t,e,n,r):!1===e&&Bn(r.getNode(!0))?ww(t,e,n,r):e&&ag(n)?I.some(yw.moveToPosition(r)):!1===e&&ug(n)?I.some(yw.moveToPosition(r)):I.none();var o}))},Cw=function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return wn(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&Bn(e.nextSibling)?I.some(yw.moveToElement(e.nextSibling)):!1===t&&Bn(e.previousSibling)?I.some(yw.moveToElement(e.previousSibling)):I.none()}(e,n.getNode(!1===e)).fold((function(){return xw(t,e,n)}),I.some):xw(t,e,n).bind((function(e){return function(t,e,n){return n.fold((function(t){return I.some(yw.remove(t))}),(function(t){return I.some(yw.moveToElement(t))}),(function(n){return js(e,n,t)?I.none():I.some(yw.moveToPosition(n))}))}(t,n,e)}))},Sw=function(t,e){return I.from(Vf(t.getBody(),e))},kw=function(t,e){var n=t.selection.getNode();return Sw(t,n).filter(Bn).fold((function(){return function(t,e,n){var r=Ks(e?1:-1,t,n),o=vc.fromRangeStart(r),i=ye.fromDom(t);return!1===e&&ag(o)?I.some(yw.remove(o.getNode(!0))):e&&ug(o)?I.some(yw.remove(o.getNode())):!1===e&&ug(o)&&Og(i,o)?_g(i,o).map((function(t){return yw.remove(t.getNode())})):e&&ag(o)&&kg(i,o)?Tg(i,o).map((function(t){return yw.remove(t.getNode())})):Cw(t,e,o)}(t.getBody(),e,t.selection.getRng()).exists((function(n){return n.fold(function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),nh(t,e,ye.fromDom(n)),!0}}(t,e),function(t,e){return function(n){var r=e?vc.before(n):vc.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))}))}),N)},Ow=function(t,e){var n=t.selection.getNode();return!(!Bn(n)||Pn(n))&&Sw(t,n.parentNode).filter(Bn).fold((function(){var n;return n=ye.fromDom(t.getBody()),q(_a(n,".mce-offscreen-selection"),un),nh(t,e,ye.fromDom(t.selection.getNode())),qy(t),!0}),N)},_w=function(t){var e=t.dom,n=t.selection,r=Vf(t.getBody(),n.getNode());if(zn(r)&&e.isBlock(r)&&e.isEmpty(r)){var o=e.create("br",{"data-mce-bogus":"1"});e.setHTML(r,""),r.appendChild(o),n.setRng(vc.before(o).toRange())}return!0},Tw=function(t,e){return t.selection.isCollapsed()?kw(t,e):Ow(t,e)},Ew=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=vc.fromRangeStart(t.selection.getRng());return vl(e,t.getBody(),n).filter((function(t){return e?tg(t):eg(t)})).bind((function(t){return I.from(Us(e?0:-1,t))})).exists((function(e){return t.selection.select(e),!0}))}(t,e)},Aw=En,Dw=function(t){return Aw(t)&&t.data[0]===co},Mw=function(t){return Aw(t)&&t.data[t.data.length-1]===co},Rw=function(t){return t.ownerDocument.createTextNode(co)},Nw=function(t,e){return t?function(t){if(Aw(t.previousSibling))return Mw(t.previousSibling)?t.previousSibling:(t.previousSibling.appendData(co),t.previousSibling);if(Aw(t))return Dw(t)?t:(t.insertData(0,co),t);var e=Rw(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if(Aw(t.nextSibling))return Dw(t.nextSibling)?t.nextSibling:(t.nextSibling.insertData(0,co),t.nextSibling);if(Aw(t))return Mw(t)?t:(t.appendData(co),t);var e=Rw(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},zw=E(Nw,!0),Bw=E(Nw,!1),Pw=function(t,e){return En(t.container())?Nw(e,t.container()):Nw(e,t.getNode())},Iw=function(t,e){var n=e.get();return n&&t.container()===n&&ho(n)},Lw=function(t,e){return e.fold((function(e){ws(t.get());var n=zw(e);return t.set(n),I.some(vc(n,n.length-1))}),(function(e){return Sl(e).map((function(e){if(Iw(e,t))return vc(t.get(),1);ws(t.get());var n=Pw(e,!0);return t.set(n),vc(n,1)}))}),(function(e){return kl(e).map((function(e){if(Iw(e,t))return vc(t.get(),t.get().length-1);ws(t.get());var n=Pw(e,!1);return t.set(n),vc(n,n.length-1)}))}),(function(e){ws(t.get());var n=Bw(e);return t.set(n),I.some(vc(n,1))}))},Hw=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return I.none()},Fw=gr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Vw=function(t,e){var n=Vs(e,t);return n||t},jw=function(t,e,n){var r=Vy(n),o=Vw(e,r.container());return Hy(t,o,r).fold((function(){return xl(o,r).bind(E(Hy,t,o)).map((function(t){return Fw.before(t)}))}),I.none)},Uw=function(t,e){return null===_l(t,e)},Ww=function(t,e,n){return Hy(t,e,n).filter(E(Uw,e))},qw=function(t,e,n){var r=jy(n);return Ww(t,e,r).bind((function(t){return Cl(t,r).isNone()?I.some(Fw.start(t)):I.none()}))},Gw=function(t,e,n){var r=Vy(n);return Ww(t,e,r).bind((function(t){return xl(t,r).isNone()?I.some(Fw.end(t)):I.none()}))},$w=function(t,e,n){var r=jy(n),o=Vw(e,r.container());return Hy(t,o,r).fold((function(){return Cl(o,r).bind(E(Hy,t,o)).map((function(t){return Fw.after(t)}))}),I.none)},Xw=function(t){return!1===Ly(Yw(t))},Kw=function(t,e,n){return Hw([jw,qw,Gw,$w],[t,e,n]).filter(Xw)},Yw=function(t){return t.fold(_,_,_,_)},Jw=function(t){return t.fold(O("before"),O("start"),O("end"),O("after"))},Qw=function(t){return t.fold(Fw.before,Fw.before,Fw.after,Fw.after)},Zw=function(t){return t.fold(Fw.start,Fw.start,Fw.end,Fw.end)},tx=function(t,e,n,r,o,i){return Hn(Hy(e,n,r),Hy(e,n,o),(function(e,r){return e!==r&&function(t,e,n){var r=Vs(e,t),o=Vs(n,t);return r&&r===o}(n,e,r)?Fw.after(t?e:r):i})).getOr(i)},ex=function(t,e){return t.fold(N,(function(t){return r=e,!(Jw(n=t)===Jw(r)&&Yw(n)===Yw(r));var n,r}))},nx=function(t,e){return t?e.fold(S(I.some,Fw.start),I.none,S(I.some,Fw.after),I.none):e.fold(I.none,S(I.some,Fw.before),I.none,S(I.some,Fw.end))},rx=function(t,e,n,r){var o=Fy(t,r),i=Kw(e,n,o);return Kw(e,n,o).bind(E(nx,t)).orThunk((function(){return function(t,e,n,r,o){var i=Fy(t,o);return vl(t,n,i).map(E(Fy,t)).fold((function(){return r.map(Qw)}),(function(o){return Kw(e,n,o).map(E(tx,t,e,n,i,o)).filter(E(ex,r))})).filter(Xw)}(t,e,n,i,r)}))};E(rx,!1),E(rx,!0);var ox,ix=function(t,e,n){var r=t?1:-1;return e.setRng(vc(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0},ux=function(t,e){var n=e.selection.getRng(),r=t?vc.fromRangeEnd(n):vc.fromRangeStart(n);return!!function(t){return w(t.selection.getSel().modify)}(e)&&(t&&bo(r)?ix(!0,e.selection,r):!(t||!yo(r))&&ix(!1,e.selection,r))};!function(t){t[t.Br=0]="Br",t[t.Block=1]="Block",t[t.Wrap=2]="Wrap",t[t.Eol=3]="Eol"}(ox||(ox={}));var ax,cx=function(t,e){return t===bc.Backwards?nt(e):e},sx=function(t,e,n){return t===bc.Forwards?e.next(n):e.prev(n)},lx=function(t,e,n,r){return Rn(r.getNode(e===bc.Forwards))?ox.Br:!1===js(n,r)?ox.Block:ox.Wrap},fx=function(t,e,n,r){for(var o=dl(n),i=r,u=[];i;){var a=sx(e,o,i);if(!a)break;if(Rn(a.getNode(!1)))return e===bc.Forwards?{positions:cx(e,u).concat([a]),breakType:ox.Br,breakAt:I.some(a)}:{positions:cx(e,u),breakType:ox.Br,breakAt:I.some(a)};if(a.isVisible()){if(t(i,a)){var c=lx(0,e,i,a);return{positions:cx(e,u),breakType:c,breakAt:I.some(a)}}u.push(a),i=a}else i=a}return{positions:cx(e,u),breakType:ox.Eol,breakAt:I.none()}},dx=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===bc.Backwards?o.concat(r):[r].concat(o)})).getOr([])},mx=function(t,e){return Y(t,(function(t,n){return t.fold((function(){return I.some(n)}),(function(r){return Hn(ut(r.getClientRects()),ut(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r})).or(t)}))}),I.none())},gx=function(t,e){return ut(e.getClientRects()).bind((function(e){return mx(t,e.left)}))},hx=E(fx,vc.isAbove,-1),px=E(fx,vc.isBelow,1),vx=E(dx,-1,hx),bx=E(dx,1,px),yx=function(t){var e=function(e){return W(e,(function(e){var n=Ua(e);return n.node=t,n}))};if(wn(t))return e(t.getClientRects());if(En(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},wx=function(t){return tt(t,yx)};!function(t){t[t.Up=-1]="Up",t[t.Down=1]="Down"}(ax||(ax={}));var xx,Cx,Sx=function(t,e,n,r,o,i){var u=0,a=[],c=function(r){var i=wx([r]);-1===t&&(i=i.reverse());for(var c=0;c<i.length;c++){var l=i[c];if(!n(l,s)){if(a.length>0&&e(l,At(a))&&u++,l.line=u,o(l))return!0;a.push(l)}}},s=At(i.getClientRects());if(!s)return a;var l=i.getNode();return c(l),function(t,e,n,r){for(;r=Fs(r,t,Bo,e);)if(n(r))return}(t,r,c,l),a},kx=E(Sx,ax.Up,Ga,$a),Ox=E(Sx,ax.Down,$a,Ga),_x=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},Tx=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},Ex=Bn,Ax=Fs,Dx=function(t,e){return Math.abs(t.left-e)},Mx=function(t,e){return Math.abs(t.right-e)},Rx=function(t,e){return t>=e.left&&t<=e.right},Nx=function(t,e){return t>=e.top&&t<=e.bottom},zx=function(t,e,n){return void 0===n&&(n=N),Tt(t,(function(t,r){if(Rx(e,r))return n(r)?r:t;if(Rx(e,t))return n(t)?t:r;var o=Math.min(Dx(t,e),Mx(t,e)),i=Math.min(Dx(r,e),Mx(r,e));return i===o&&xt(r,"node")&&Ex(r.node)?r:i<o?r:t}))},Bx=function(t,e,n,r,o){var i=Ax(r,t,Bo,e,!o);do{if(!i||n(i))return}while(i=Ax(i,t,Bo,e))},Px=function(t,e,n){var r=wx(function(t){return X(ct(t.getElementsByTagName("*")),As)}(t)),o=X(r,E(Nx,n)),i=function(t){return!On(t.node)&&!In(t.node)},u=zx(o,e,i);if(u){var a=i(u);if((u=zx(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=X(wx([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),Bx(ax.Up,t,E(o,Ga),e.node,n),Bx(ax.Down,t,E(o,$a),e.node,n),r}(t,u,a),e,i))&&As(u.node))return function(t,e){return{node:t.node,before:Dx(t,e)<Mx(t,e)}}(u,e)}return null},Ix=function(t,e){t.selection.setRng(e),Md(t,t.selection.getRng())},Lx=function(t,e,n){return I.some(gw(t,e,n))},Hx=function(t,e,n,r,o,i){var u=e===bc.Forwards,a=dl(t.getBody()),c=E(Zs,u?a.next:a.prev),s=u?r:o;if(!n.collapsed){var l=Ka(n);if(i(l))return fw(e,t,l,e===bc.Backwards,!1)}var f=Js(e,t.getBody(),n);if(s(f))return dw(t,f.getNode(!u));var d=Fy(u,c(f)),m=ko(n);if(!d)return m?I.some(n):I.none();if(s(d))return fw(e,t,d.getNode(!u),u,!1);var g=c(d);return g&&s(g)&&tl(d,g)?fw(e,t,g.getNode(!u),u,!1):m?Lx(t,d.toRange(),!1):I.none()},Fx=function(t,e,n,r,o,i){var u=Js(e,t.getBody(),n),a=At(u.getClientRects()),c=e===ax.Down;if(!a)return I.none();var s,l=(c?Ox:kx)(t.getBody(),_x(1),u),f=X(l,Tx(1)),d=a.left,m=zx(f,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),h=Math.abs(d-m.right);return fw(e,t,m.node,g<h,!1)}if(s=r(u)?u.getNode():o(u)?u.getNode(!0):Ka(n)){var p=function(t,e,n,r){var o,i,u,a,c=dl(e),s=[],l=0,f=function(t){return At(t.getClientRects())};1===t?(o=c.next,i=$a,u=Ga,a=vc.after(r)):(o=c.prev,i=Ga,u=$a,a=vc.before(r));var d=f(a);do{if(a.isVisible()){var m=f(a);if(!u(m,d)){s.length>0&&i(m,At(s))&&l++;var g=Ua(m);if(g.position=a,g.line=l,n(g))return s;s.push(g)}}}while(a=o(a));return s}(e,t.getBody(),_x(1),s),v=zx(X(p,Tx(1)),d);if(v)return Lx(t,v.position.toRange(),!1);if(v=At(X(p,Tx(0))))return Lx(t,v.position.toRange(),!1)}return 0===f.length?Vx(t,c).filter(c?o:r).map((function(e){return gw(t,e.toRange(),!1)})):I.none()},Vx=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=vc.fromRangeEnd(n),i=px(r,o);return at(i.positions)}o=vc.fromRangeStart(n),i=hx(r,o);return ut(i.positions)},jx=function(t,e,n){return Vx(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))},Ux=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},Wx=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},qx=function(t,e,n){return Lw(e,n).map((function(e){return Ux(t,e),n}))},Gx=function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=vc.fromRangeStart(t.selection.getRng());vc.isTextPosition(n)&&!1===function(t){return bo(t)||yo(t)}(n)&&(Ux(t,ys(e.get(),n)),e.set(null))}},$x=function(t,e,n){return!!cs(t)&&function(t,e,n){var r=t.getBody(),o=vc.fromRangeStart(t.selection.getRng()),i=E(Iy,t);return rx(n,i,r,o).bind((function(n){return qx(t,e,n)}))}(t,e,n).isSome()},Xx=function(t,e,n){return!!cs(e)&&ux(t,e)},Kx=function(t){var e=sa(null),n=E(Iy,t);return t.on("NodeChange",(function(r){!cs(t)||de.browser.isIE()&&r.initial||(function(t,e,n){var r=W(_a(ye.fromDom(e.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom})),o=X(r,t),i=X(n,t);q(rt(o,i),E(Wx,!1)),q(rt(i,o),E(Wx,!0))}(n,t.dom,r.parents),Gx(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=X(r,t);q(o,(function(r){var o=vc.fromRangeStart(e.selection.getRng());Kw(t,e.getBody(),o).bind((function(t){return qx(e,n,t)}))}))}}(n,t,e,r.parents))})),e},Yx=E(Xx,!0),Jx=E(Xx,!1),Qx=function(t,e,n){if(cs(t)){var r=Vx(t,e).getOrThunk((function(){var n=t.selection.getRng();return e?vc.fromRangeEnd(n):vc.fromRangeStart(n)}));return Kw(E(Iy,t),t.getBody(),r).exists((function(e){var r=Qw(e);return Lw(n,r).exists((function(e){return Ux(t,e),!0}))}))}return!1},Zx=function(t,e){return function(n){return Lw(e,n).exists((function(e){return Ux(t,e),!0}))}},tC=function(t,e,n,r){var o=t.getBody(),i=E(Iy,t);t.undoManager.ignore((function(){t.selection.setRng(function(t,e){var n=document.createRange();return n.setStart(t.container(),t.offset()),n.setEnd(e.container(),e.offset()),n}(n,r)),t.execCommand("Delete"),Kw(i,o,vc.fromRangeStart(t.selection.getRng())).map(Zw).map(Zx(t,e))})),t.nodeChanged()},eC=function(t,e,n,r){var o=function(t,e){var n=Vs(e,t);return n||t}(t.getBody(),r.container()),i=E(Iy,t),u=Kw(i,o,r);return u.bind((function(t){return n?t.fold(O(I.some(Zw(t))),I.none,O(I.some(Qw(t))),I.none):t.fold(I.none,O(I.some(Qw(t))),I.none,O(I.some(Zw(t))))})).map(Zx(t,e)).getOrThunk((function(){var a=bl(n,o,r),c=a.bind((function(t){return Kw(i,o,t)}));return Hn(u,c,(function(){return Hy(i,o,r).exists((function(e){return!!function(t){return Hn(Sl(t),kl(t),(function(e,n){var r=Fy(!0,e),o=Fy(!1,n);return xl(t,r).forall((function(t){return t.isEqual(o)}))})).getOr(!0)}(e)&&(nh(t,n,ye.fromDom(e)),!0)}))})).orThunk((function(){return c.bind((function(o){return a.map((function(o){return n?tC(t,e,r,o):tC(t,e,o,r),!0}))}))})).getOr(!1)}))},nC=function(t,e,n){if(t.selection.isCollapsed()&&cs(t)){var r=vc.fromRangeStart(t.selection.getRng());return eC(t,e,n,r)}return!1},rC=function(t){return 1===qe(t)},oC=function(t,e,n,r){var o=E(vp,e),i=W(X(r,o),(function(t){return t.dom}));if(0===i.length)nh(e,t,n);else{var u=function(t,e){var n=lp(!1),r=gp(e,n.dom);return Ze(ye.fromDom(t),n),un(ye.fromDom(t)),vc(r,0)}(n.dom,i);e.selection.setRng(u.toRange())}},iC=function(t,e){var n=ye.fromDom(t.getBody()),r=ye.fromDom(t.selection.getStart()),o=X(function(t,e){var n=mg(e,t);return Z(n,Zr).fold(O(n),(function(t){return n.slice(0,t)}))}(n,r),rC);return at(o).exists((function(n){var r,i=vc.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return Hn(Sl(n),kl(n),(function(r,o){var i=Fy(!0,r),u=Fy(!1,o),a=Fy(!1,e);return t?xl(n,a).exists((function(t){return t.isEqual(u)&&e.isEqual(i)})):Cl(n,a).exists((function(t){return t.isEqual(i)&&e.isEqual(u)}))})).getOr(!0)}(e,i,n.dom)||(r=n,Ol(r.dom)&&cp(r.dom)))&&(oC(e,t,n,o),!0)}))},uC=function(t,e){return!!t.selection.isCollapsed()&&iC(t,e)},aC=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),nh(t,e,ye.fromDom(n)),!0},cC=function(t,e){return t.selection.isCollapsed()?function(t,e){var n=e?ng:rg,r=e?bc.Forwards:bc.Backwards,o=Js(r,t.getBody(),t.selection.getRng());return n(o)?aC(t,e,o.getNode(!e)):I.from(Fy(e,o)).filter((function(t){return n(t)&&tl(o,t)})).exists((function(n){return aC(t,e,n.getNode(!e))}))}(t,e):function(t,e){var n=t.selection.getNode();return!!In(n)&&aC(t,e,n)}(t,e)},sC=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},lC=function(t,e){return(t||"table"===_e(e)?"margin":"padding")+("rtl"===Xn(e,"direction")?"-right":"-left")},fC=function(t){var e=mC(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return et(e,(function(e){var n=lC(ns(t),e),r=Yn(e,n).map(sC).getOr(0);return"false"!==t.dom.getContentEditable(e.dom)&&r>0}))}(t,e))},dC=function(t){return ro(t)||oo(t)},mC=function(t){return X((e=t.selection.getSelectedBlocks(),W(e,ye.fromDom)),(function(t){return!dC(t)&&!function(t){return Pe(t).exists(dC)}(t)&&Lr(t,(function(t){return zn(t.dom)||Bn(t.dom)})).exists((function(t){return zn(t.dom)}))}));var e},gC=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=function(t){return t.getParam("indentation","40px","string")}(t),u=/[a-z%]+$/i.exec(i)[0],a=parseInt(i,10),c=ns(t),s=Wc(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),q(mC(t),(function(t){!function(t,e,n,r,o,i){var u=lC(n,ye.fromDom(i));if("outdent"===e){var a=Math.max(0,sC(i.style[u])-r);t.setStyle(i,u,a?a+o:"")}else{a=sC(i.style[u])+r+o;t.setStyle(i,u,a)}}(n,e,c,a,u,t.dom)}))},hC=function(t,e){if(t.selection.isCollapsed()&&fC(t)){var n=t.dom,r=t.selection.getRng(),o=vc.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&bg(ye.fromDom(i),o))return gC(t,"outdent"),!0}return!1},pC=function(t,e){t.getDoc().execCommand(e,!1,null)},vC=function(t,e){t.addCommand("delete",(function(){!function(t,e){hC(t)||Tw(t,!1)||bw(t,!1)||nC(t,e,!1)||ow(t,!1)||Rh(t)||Ew(t,!1)||cC(t,!1)||cw(t)||uC(t,!1)||(pC(t,"Delete"),qy(t))}(t,e)})),t.addCommand("forwardDelete",(function(){!function(t,e){Tw(t,!0)||bw(t,!0)||nC(t,e,!0)||ow(t,!0)||Rh(t)||Ew(t,!0)||cC(t,!0)||cw(t)||uC(t,!0)||pC(t,"ForwardDelete")}(t,e)}))},bC=function(t){return void 0===t.touches||1!==t.touches.length?I.none():I.some(t.touches[0])},yC=function(t){var e=ha(),n=sa(!1),r=va((function(e){t.fire("longpress",Dt(Dt({},e),{type:"longpress"})),n.set(!0)}),400);t.on("touchstart",(function(t){bC(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.throttle(t),n.set(!1),e.set(i)}))}),!0),t.on("touchmove",(function(o){r.cancel(),bC(o).each((function(r){e.on((function(o){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(r,o)&&(e.clear(),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",Dt(Dt({},o),{type:"tap"}))}))}),!0)},wC=function(t,e){return wt(t,e.nodeName)},xC=function(t,e){return!!En(e)||!!wn(e)&&(!wC(t,e)&&!Il(e))},CC=function(t,e){if(En(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||wC(t,e.nextSibling)))return!0}return!1},SC=function(t){var e,n,r,o=t.dom,i=t.selection,u=t.schema,a=u.getBlockElements(),c=i.getStart(),s=t.getBody(),l=Wc(t);if(c&&wn(c)&&l){var f=s.nodeName.toLowerCase();if(u.isValidChild(f,l.toLowerCase())&&!function(t,e,n){return U(dg(ye.fromDom(n),ye.fromDom(e)),(function(e){return wC(t,e.dom)}))}(a,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,h=d.endContainer,p=d.endOffset,v=am(t);for(c=s.firstChild;c;)if(xC(a,c)){if(CC(a,c)){n=c,c=c.nextSibling,o.remove(n);continue}e||(e=o.create(l,qc(t)),c.parentNode.insertBefore(e,c),r=!0),n=c,c=c.nextSibling,e.appendChild(n)}else e=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(h,p),i.setRng(d),t.nodeChanged())}}},kC=function(t,e){e.hasAttribute("data-mce-caret")&&(So(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},OC=function(t,e){var n=function(t){return Vr(ye.fromDom(t.getBody()),"*[data-mce-caret]").map((function(t){return t.dom})).getOrNull()}(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void kC(t,n)):void(vo(n)&&(kC(t,n),t.undoManager.add()))},_C=Bn,TC=function(t,e,n){var r=dl(t.getBody()),o=E(Zs,1===e?r.next:r.prev);if(n.collapsed&&function(t){return""!==Wc(t)}(t)){var i=t.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(vc.fromRangeStart(n))){var u=function(t){var e=t.dom.create(Wc(t));return(!de.ie||de.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e}(t);1===e?t.$(i).after(u):t.$(i).before(u),t.selection.select(u,!0),t.selection.collapse()}}},EC=function(t,e){var n=e?bc.Forwards:bc.Backwards,r=t.selection.getRng();return function(t,e,n){return Hx(e,t,n,ug,ag,_C)}(n,t,r).orThunk((function(){return TC(t,n,r),I.none()}))},AC=function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return Fx(e,t,n,(function(t){return ug(t)||og(t)}),(function(t){return ag(t)||ig(t)}),_C)}(n,t,r).orThunk((function(){return TC(t,n,r),I.none()}))},DC=function(t,e){return EC(t,e).exists((function(e){return Ix(t,e),!0}))},MC=function(t,e){return AC(t,e).exists((function(e){return Ix(t,e),!0}))},RC=function(t,e){return jx(t,e,e?ag:ug)},NC=function(t){return j(["figcaption"],_e(t))},zC=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},BC=function(t,e,n){n?nn(t,e):en(t,e)},PC=function(t,e,n,r){return""===e?function(t,e){var n=ye.fromTag("br");return BC(t,n,e),zC(n)}(t,r):function(t,e,n,r){var o=ye.fromTag(n),i=ye.fromTag("br");return Un(o,r),nn(o,i),BC(t,o,e),zC(i)}(t,r,e,n)},IC=function(t,e,n){return e?function(t,e){return px(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return hx(t,e).breakAt.isNone()}(t.dom,n)},LC=function(t,e){var n=ye.fromDom(t.getBody()),r=vc.fromRangeStart(t.selection.getRng()),o=Wc(t),i=qc(t);return function(t,e){var n=E(Se,e);return Lr(ye.fromDom(t.container()),Zr,n).filter(NC)}(r,n).exists((function(){if(IC(n,e,r)){var u=PC(n,o,i,e);return t.selection.setRng(u),!0}return!1}))},HC=function(t,e){return!!t.selection.isCollapsed()&&LC(t,e)},FC=function(t,e){return tt(function(t){return W(t,(function(t){return Dt({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:C},t)}))}(t),(function(t){return function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey}(t,e)?[t]:[]}))},VC=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},jC=function(t,e){return Q(FC(t,e),(function(t){return t.action()}))},UC=function(t,e){var n=e?bc.Forwards:bc.Backwards,r=t.selection.getRng();return Hx(t,n,r,ng,rg,In).exists((function(e){return Ix(t,e),!0}))},WC=function(t,e){var n=e?1:-1,r=t.selection.getRng();return Fx(t,n,r,ng,rg,In).exists((function(e){return Ix(t,e),!0}))},qC=function(t,e){return jx(t,e,e?rg:ng)},GC=function(t,e,n,r,o){var i=_a(ye.fromDom(n),"td,th,caption").map((function(t){return t.dom}));return function(t,e,n){return Y(t,(function(t,r){return t.fold((function(){return I.some(r)}),(function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return I.some(i<o?r:t)}))}),I.none())}(X(function(t,e){return tt(e,(function(e){var n=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+2*e,bottom:t.bottom+2*e,width:t.width+e,height:t.height+e}}(Ua(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]}))}(t,i),(function(t){return e(t,o)})),r,o).map((function(t){return t.cell}))},$C=E(GC,(function(t){return t.bottom}),(function(t,e){return t.y<e})),XC=E(GC,(function(t){return t.top}),(function(t,e){return t.y>e})),KC=function(t,e){return ut(e.getClientRects()).bind((function(e){return $C(t,e.left,e.top)})).bind((function(t){return gx(kl(n=t).map((function(t){return hx(n,t).positions.concat(t)})).getOr([]),e);var n}))},YC=function(t,e){return at(e.getClientRects()).bind((function(e){return XC(t,e.left,e.top)})).bind((function(t){return gx(Sl(n=t).map((function(t){return[t].concat(px(n,t).positions)})).getOr([]),e);var n}))},JC=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===ox.Wrap&&0===t.positions.length}(r)||!Rn(n.getNode())&&function(t){return t.breakType===ox.Br&&1===t.positions.length}(r)?!function(t,e,n){return n.breakAt.exists((function(n){return t(e,n).breakAt.isSome()}))}(t,e,r):r.breakAt.isNone()},QC=E(JC,hx),ZC=E(JC,px),tS=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;return!(!Ts()||!function(t,e,n){var r=vc.fromRangeStart(e);return wl(!t,n).exists((function(t){return t.isEqual(r)}))}(e,o,n))&&(fw(i,t,n,!e,!1).each((function(e){Ix(t,e)})),!0)},eS=function(t,e){var n=e.getNode(t);return wn(n)&&"TABLE"===n.nodeName?I.some(n):I.none()},nS=function(t,e,n){var r=eS(!!e,n),o=!1===e;r.fold((function(){return Ix(t,n.toRange())}),(function(r){return wl(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return Ix(t,n.toRange())}),(function(o){return function(t,e,n,r){var o=Wc(e);o?e.undoManager.transact((function(){var r=ye.fromTag(o);Un(r,qc(e)),nn(r,ye.fromTag("br")),t?tn(ye.fromDom(n),r):Ze(ye.fromDom(n),r);var i=e.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),Ix(e,i)})):Ix(e,r.toRange())}(e,t,r,n)}))}))},rS=function(t,e,n,r){var o=t.selection.getRng(),i=vc.fromRangeStart(o),u=t.getBody();if(!e&&QC(r,i)){var a=function(t,e,n){return KC(e,n).orThunk((function(){return ut(n.getClientRects()).bind((function(n){return mx(vx(t,vc.before(e)),n.left)}))})).getOr(vc.before(e))}(u,n,i);return nS(t,e,a),!0}if(e&&ZC(r,i)){a=function(t,e,n){return YC(e,n).orThunk((function(){return ut(n.getClientRects()).bind((function(n){return mx(bx(t,vc.after(e)),n.left)}))})).getOr(vc.after(e))}(u,n,i);return nS(t,e,a),!0}return!1},oS=function(t,e,n){return I.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return I.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)},iS=function(t,e){return oS(t,e,tS)},uS=function(t,e){return oS(t,e,rS)},aS=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=re().os;jC([{keyCode:Gf.RIGHT,action:VC(DC,t,!0)},{keyCode:Gf.LEFT,action:VC(DC,t,!1)},{keyCode:Gf.UP,action:VC(MC,t,!1)},{keyCode:Gf.DOWN,action:VC(MC,t,!0)},{keyCode:Gf.RIGHT,action:VC(iS,t,!0)},{keyCode:Gf.LEFT,action:VC(iS,t,!1)},{keyCode:Gf.UP,action:VC(uS,t,!1)},{keyCode:Gf.DOWN,action:VC(uS,t,!0)},{keyCode:Gf.RIGHT,action:VC(UC,t,!0)},{keyCode:Gf.LEFT,action:VC(UC,t,!1)},{keyCode:Gf.UP,action:VC(WC,t,!1)},{keyCode:Gf.DOWN,action:VC(WC,t,!0)},{keyCode:Gf.RIGHT,action:VC($x,t,e,!0)},{keyCode:Gf.LEFT,action:VC($x,t,e,!1)},{keyCode:Gf.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:VC(Yx,t,e)},{keyCode:Gf.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:VC(Jx,t,e)},{keyCode:Gf.UP,action:VC(HC,t,!1)},{keyCode:Gf.DOWN,action:VC(HC,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},cS=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){jC([{keyCode:Gf.BACKSPACE,action:VC(hC,t,!1)},{keyCode:Gf.BACKSPACE,action:VC(Tw,t,!1)},{keyCode:Gf.DELETE,action:VC(Tw,t,!0)},{keyCode:Gf.BACKSPACE,action:VC(bw,t,!1)},{keyCode:Gf.DELETE,action:VC(bw,t,!0)},{keyCode:Gf.BACKSPACE,action:VC(nC,t,e,!1)},{keyCode:Gf.DELETE,action:VC(nC,t,e,!0)},{keyCode:Gf.BACKSPACE,action:VC(Rh,t,!1)},{keyCode:Gf.DELETE,action:VC(Rh,t,!0)},{keyCode:Gf.BACKSPACE,action:VC(Ew,t,!1)},{keyCode:Gf.DELETE,action:VC(Ew,t,!0)},{keyCode:Gf.BACKSPACE,action:VC(cC,t,!1)},{keyCode:Gf.DELETE,action:VC(cC,t,!0)},{keyCode:Gf.BACKSPACE,action:VC(cw,t,!1)},{keyCode:Gf.DELETE,action:VC(cw,t,!0)},{keyCode:Gf.BACKSPACE,action:VC(ow,t,!1)},{keyCode:Gf.DELETE,action:VC(ow,t,!0)},{keyCode:Gf.BACKSPACE,action:VC(uC,t,!1)},{keyCode:Gf.DELETE,action:VC(uC,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&function(t,e){jC([{keyCode:Gf.BACKSPACE,action:VC(_w,t)},{keyCode:Gf.DELETE,action:VC(_w,t)}],e)}(t,e)}))},sS=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var u=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild);u&&/^(UL|OL|DL)$/.test(u.nodeName)&&e.insertBefore(o.doc.createTextNode(" "),e.firstChild)}var a=o.createRng();if(e.normalize(),e.hasChildNodes()){for(var c=new Yr(e,e);n=c.current();){if(En(n)){a.setStart(n,0),a.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){a.setStartBefore(n),a.setEndBefore(n);break}r=n,n=c.next()}n||(a.setStart(r,0),a.setEnd(r,0))}else Rn(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(a.setStartBefore(e),a.setEndBefore(e)):(a.setStartAfter(e),a.setEndAfter(e)):(a.setStart(e,0),a.setEnd(e,0));t.selection.setRng(a),Md(t,a)}},lS=function(t){return I.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},fS=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},dS=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},mS=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},gS=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!wn(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},hS=function(t,e,n,r,o){var i=t.dom,u=t.selection.getRng();if(n!==t.getBody()){var a;dS(a=n)&&dS(a.parentNode)&&(o="LI");var c=o?e(o):i.create("BR");if(gS(n,r,!0)&&gS(n,r,!1))if(fS(n,"LI")){var s=mS(n);i.insertAfter(c,s),!function(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.firstChild)===t}(n)?i.remove(n):i.remove(s)}else i.replace(c,n);else if(gS(n,r,!0))fS(n,"LI")?(i.insertAfter(c,mS(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n),i.remove(r);else if(gS(n,r,!1))i.insertAfter(c,mS(n)),i.remove(r);else{n=mS(n);var l=u.cloneRange();l.setStartAfter(r),l.setEndAfter(n);var f=l.extractContents();"LI"===o&&function(t,e){return t.firstChild&&t.firstChild.nodeName===e}(f,"LI")?(c=f.firstChild,i.insertAfter(f,n)):(i.insertAfter(f,n),i.insertAfter(c,n)),i.remove(r)}sS(t,c)}},pS=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},vS=function(t){t.innerHTML='<br data-mce-bogus="1">'},bS=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},yS=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},wS=function(t,e,n){return!1===En(e)?n:t?1===n&&e.data.charAt(n-1)===co?0:n:n===e.data.length-1&&e.data.charAt(n)===co?e.data.length:n},xS=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},CS=function(t,e){var n=Wc(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;I.from(n.style).map(r.parseStyle).each((function(t){var n=Jn(ye.fromDom(e)),o=Dt(Dt({},n),t);r.setStyles(e,o)}));var o=I.from(n.class).map((function(t){return t.split(/\s+/)})),i=I.from(e.className).map((function(t){return X(t.split(/\s+/),(function(t){return""!==t}))}));Hn(o,i,(function(t,n){var o=X(n,(function(e){return!j(t,e)})),i=Mt(Mt([],t,!0),o,!0);r.setAttrib(e,"class",i.join(" "))}));var u=["style","class"],a=vt(n,(function(t,e){return!j(u,e)}));r.setAttribs(e,a)}(t,e,qc(t))},SS=function(t,e){var n,r,o,i,u,a,c,s,l,f,d=t.dom,m=t.schema,g=m.getNonEmptyElements(),h=t.selection.getRng(),p=function(e){var n,o,u,a=r,c=m.getTextInlineElements();if(u=n=e||"TABLE"===s||"HR"===s?d.create(e||l):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[a.nodeName]){if(Ol(a)||Il(a))continue;o=a.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(u=o,n.appendChild(o))}}while((a=a.parentNode)&&a!==x);return CS(t,n),vS(u),n},v=function(t){var e,n,u=wS(t,r,o);if(En(r)&&(t?u>0:u<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&wn(r)&&r===i.firstChild)return!0;if(bS(r,"TABLE")||bS(r,"HR"))return f&&!t||!f&&t;var a=new Yr(r,i);for(En(r)&&(t&&0===u?a.prev():t||u!==r.nodeValue.length||a.next());e=a.current();){if(wn(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),g[n]&&"br"!==n))return!1}else if(En(e)&&!Io(e.nodeValue))return!1;t?a.prev():a.next()}return!0},b=function(){u=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==C?p(l):p(),function(t){return t.getParam("end_container_on_empty_block",!1)}(t)&&yS(d,c)&&d.isEmpty(i)?u=d.split(c,i):d.insertAfter(u,i),sS(t,u)};ud(d,h).each((function(t){h.setStart(t.startContainer,t.startOffset),h.setEnd(t.endContainer,t.endOffset)})),r=h.startContainer,o=h.startOffset,l=Wc(t);var y=!(!e||!e.shiftKey),w=!(!e||!e.ctrlKey);wn(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&En(r)?r.nodeValue.length:0);var x=xS(d,r);if(x){(l&&!y||!l&&y)&&(r=function(t,e,n,r,o){var i,u,a,c,s,l,f=e||"P",d=t.dom,m=xS(d,r);if(!(u=d.getParent(r,d.isBlock))||!yS(d,u)){if(l=(u=u||m)===t.getBody()||function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)}(u)?u.nodeName.toLowerCase():u.parentNode.nodeName.toLowerCase(),!u.hasChildNodes())return i=d.create(f),CS(t,i),u.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==u;)c=c.parentNode;for(;c&&!d.isBlock(c);)a=c,c=c.previousSibling;if(a&&t.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),CS(t,i),a.parentNode.insertBefore(i,a),c=a;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(t,l,h,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var C=c?c.nodeName.toUpperCase():"";"LI"!==C||w||(i=c,c=c.parentNode,s=C),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?hS(t,p,c,i,l):l&&i===t.getBody()||(l=l||"P",go(i)?(u=So(i),d.isEmpty(i)&&vS(i),CS(t,u),sS(t,u)):v()?b():v(!0)?(u=i.parentNode.insertBefore(p(),i),sS(t,bS(i,"HR")?u:i)):((n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,wS(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,wS(!1,t.endContainer,t.endOffset)),e}(h).cloneRange()).setEndAfter(i),function(t){q(Oa(ye.fromDom(t),De),(function(t){var e=t.dom;e.nodeValue=lo(e.nodeValue)}))}(a=n.extractContents()),function(t){do{En(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)}(a),u=a.firstChild,d.insertAfter(a,i),function(t,e,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;wn(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?t.remove(o):pS(t,o)&&t.remove(o)}}(d,g,u),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(d,i),d.isEmpty(i)&&vS(i),u.normalize(),d.isEmpty(u)?(d.remove(u),b()):(CS(t,u),sS(t,u))),d.setAttrib(u,"id",""),t.fire("NewBlock",{newBlock:u}))}},kS=function(t,e,n){var r=t.dom.createRng();n?(r.setStartBefore(e),r.setEndBefore(e)):(r.setStartAfter(e),r.setEndAfter(e)),t.selection.setRng(r),Md(t,r)},OS=function(t,e){var n,r,o=t.selection,i=t.dom,u=o.getRng();ud(i,u).each((function(t){u.setStart(t.startContainer,t.startOffset),u.setEnd(t.endContainer,t.endOffset)}));var a=u.startOffset,c=u.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=a>c.childNodes.length-1;c=c.childNodes[Math.min(a,c.childNodes.length-1)]||c,a=s&&3===c.nodeType?c.nodeValue.length:0}var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&a>=c.nodeValue.length&&(function(t,e,n){for(var r,o=new Yr(e,n),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(t.schema,c,l)||(n=i.create("br"),u.insertNode(n),u.setStartAfter(n),u.setEndAfter(n),r=!0)),n=i.create("br"),wc(i,u,n),kS(t,n,r),t.undoManager.add()},_S=function(t,e){var n=ye.fromTag("br");Ze(ye.fromDom(e),n),t.undoManager.add()},TS=function(t,e){ES(t.getBody(),e)||tn(ye.fromDom(e),ye.fromTag("br"));var n=ye.fromTag("br");tn(ye.fromDom(e),n),kS(t,n.dom,!1),t.undoManager.add()},ES=function(t,e){return n=vc.after(e),!!Rn(n.getNode())||xl(t,vc.after(e)).map((function(t){return Rn(t.getNode())})).getOr(!1);var n},AS=function(t){return t&&"A"===t.nodeName&&"href"in t},DS=function(t){return t.fold(R,AS,AS,R)},MS=function(t,e){e.fold(C,E(_S,t),E(TS,t),C)},RS=function(t,e){var n=function(t){var e=E(Iy,t),n=vc.fromRangeStart(t.selection.getRng());return Kw(e,t.getBody(),n).filter(DS)}(t);n.isSome()?n.each(E(MS,t)):OS(t,e)},NS=function(t,e){return lS(t).filter((function(t){return e.length>0&&xe(ye.fromDom(t),e)})).isSome()},zS=gr([{br:[]},{block:[]},{none:[]}]),BS=function(t,e){return function(t){return NS(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},PS=function(t){return function(e,n){return""===Wc(e)===t}},IS=function(t){return function(e,n){return function(t){return lS(t).filter((function(t){return oo(ye.fromDom(t))})).isSome()}(e)===t}},LS=function(t,e){return function(n,r){return function(t){return lS(t).fold(O(""),(function(t){return t.nodeName.toUpperCase()}))}(n)===t.toUpperCase()===e}},HS=function(t){return LS("pre",t)},FS=function(t){return function(e,n){return function(t){return t.getParam("br_in_pre",!0)}(e)===t}},VS=function(t,e){return function(t){return NS(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},jS=function(t,e){return e},US=function(t){var e=Wc(t),n=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},WS=function(t,e){return function(n,r){return Y(t,(function(t,e){return t&&e(n,r)}),!0)?I.some(e):I.none()}},qS=function(t,e){(function(t,e){return Hw([WS([BS],zS.none()),WS([LS("summary",!0)],zS.br()),WS([HS(!0),FS(!1),jS],zS.br()),WS([HS(!0),FS(!1)],zS.block()),WS([HS(!0),FS(!0),jS],zS.block()),WS([HS(!0),FS(!0)],zS.br()),WS([IS(!0),jS],zS.br()),WS([IS(!0)],zS.block()),WS([PS(!0),jS,US],zS.block()),WS([PS(!0)],zS.br()),WS([VS],zS.br()),WS([PS(!1),jS],zS.br()),WS([US],zS.block())],[t,!(!e||!e.shiftKey)]).getOr(zS.none())})(t,e).fold((function(){RS(t,e)}),(function(){SS(t,e)}),C)},GS=function(t){t.on("keydown",(function(e){e.keyCode===Gf.ENTER&&function(t,e){var n;e.isDefaultPrevented()||(e.preventDefault(),(n=t.undoManager).typing&&(n.typing=!1,n.add()),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),qS(t,e)})))}(t,e)}))},$S=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){jC([{keyCode:Gf.END,action:VC(RC,t,!0)},{keyCode:Gf.HOME,action:VC(RC,t,!1)},{keyCode:Gf.END,action:VC(qC,t,!0)},{keyCode:Gf.HOME,action:VC(qC,t,!1)},{keyCode:Gf.END,action:VC(Qx,t,!0,e)},{keyCode:Gf.HOME,action:VC(Qx,t,!1,e)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},XS=re().browser,KS=function(t){!function(t){var e=pa((function(){t.composing||Vg(t)}),0);XS.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))}(t),t.on("input",(function(e){!1===e.isComposing&&Vg(t)}))},YS=re(),JS=function(t){return t.stopImmediatePropagation()},QS=function(t){return t.keyCode===Gf.PAGE_UP||t.keyCode===Gf.PAGE_DOWN},ZS=function(t,e,n){n&&!t.get()?e.on("NodeChange",JS,!0):!n&&t.get()&&e.off("NodeChange",JS),t.set(n)},tk=function(t,e){if(!YS.os.isOSX()){var n=sa(!1);t.on("keydown",(function(e){QS(e)&&ZS(n,t,!0)})),t.on("keyup",(function(r){!1===r.isDefaultPrevented()&&function(t,e,n){jC([{keyCode:Gf.PAGE_UP,action:VC(Qx,t,!1,e)},{keyCode:Gf.PAGE_DOWN,action:VC(Qx,t,!0,e)}],n)}(t,e,r),QS(r)&&n.get()&&(ZS(n,t,!1),t.nodeChanged())}))}},ek=function(t,e){var n=e.container(),r=e.offset();return En(n)?(n.insertData(r,t),I.some(vc(n,r+t.length))):Qs(e).map((function(n){var r=ye.fromText(t);return e.isAtEnd()?tn(n,r):Ze(n,r),vc(r.dom,t.length)}))},nk=E(ek," "),rk=E(ek," "),ok=function(t,e){return function(n){return function(t,e){return!Rg(e)&&(Ng(t,e)||Dg(t,e)||Mg(t,e))}(t,n)?nk(e):rk(e)}},ik=function(t){var e=vc.fromRangeStart(t.selection.getRng()),n=ye.fromDom(t.getBody());if(t.selection.isCollapsed()){var r=E(Iy,t),o=vc.fromRangeStart(t.selection.getRng());return Kw(r,t.getBody(),o).bind(function(t){return function(e){return e.fold((function(e){return Cl(t.dom,vc.before(e))}),(function(t){return Sl(t)}),(function(t){return kl(t)}),(function(e){return xl(t.dom,vc.after(e))}))}}(n)).bind(ok(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},uk=function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){jC([{keyCode:Gf.SPACEBAR,action:VC(ik,t)}],e).each((function(t){e.preventDefault()}))}(t,e)}))},ak=function(t){var e=Kx(t);return function(t){t.on("keyup compositionstart",E(OC,t))}(t),aS(t,e),cS(t,e),GS(t),uk(t),KS(t),$S(t,e),tk(t,e),e},ck=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&Jf(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!de.range&&t.selection.isCollapsed()||Df(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&Df(t)&&("IMG"===t.selection.getNode().nodeName?$r.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){if(t===r)return!0;n.push(t)})),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),sk=function(t){!function(t){t.on("click",(function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}))}(t),function(t){t.parser.addNodeFilter("details",(function(t){q(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),t.serializer.addNodeFilter("details",(function(t){q(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",d(e)?e:null),t.attr("data-mce-open",null)}))}))}(t)},lk=function(t){return wn(t)&&no(ye.fromDom(t))},fk=function(t){t.on("click",(function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=vc.fromRangeStart(e),r=vc.fromRangeEnd(e);if(vc.isElementPosition(n)){var o=n.container();lk(o)&&Sl(o).each((function(t){return e.setStart(t.container(),t.offset())}))}if(vc.isElementPosition(r)){o=n.container();lk(o)&&kl(o).each((function(t){return e.setEnd(t.container(),t.offset())}))}t.selection.setRng(zh(e))}(t)}))},dk=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},mk=function(t,e){return function(t,e,n){return{pageX:n.left-t.left+e.left,pageY:n.top-t.top+e.top}}(function(t){return t.inline?dk(t.getBody()):{left:0,top:0}}(t),function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}}(t),function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=dk(t.getContentAreaContainer()),r=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o}(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}}(t,e))},gk=Bn,hk=zn,pk=function(t,e,n,r){var o=t.dom,i=e.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var u=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(u,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),u.appendChild(i),u},vk=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},bk=function(t,e){return function(n){if(function(t){return 0===t.button}(n)){var r=Q(e.dom.getParents(n.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(gk,hk)).getOr(null);if(a=e.getBody(),gk(c=r)&&c!==a){var o=e.dom.getPos(r),i=e.getBody(),u=e.getDoc().documentElement;t.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(e.inline?i.scrollWidth:u.offsetWidth)-2,maxY:(e.inline?i.scrollHeight:u.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:pk(e,r,r.offsetWidth,r.offsetHeight)})}}var a,c}},yk=function(t,e){return function(n){t.on((function(t){if(t.dragging){if(function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!gk(e)}(e,(u=e.selection,3===(a=u.getSel().getRangeAt(0).startContainer).nodeType?a.parentNode:a),t.element)){var r=(o=t.element,(i=o.cloneNode(!0)).removeAttribute("data-mce-selected"),i);e.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||e.undoManager.transact((function(){vk(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()}))}e.fire("dragend")}var o,i,u,a})),wk(t)}},wk=function(t){t.on((function(t){vk(t.ghost)})),t.clear()},xk=function(t){var e=ha(),n=oa.DOM,r=document,o=bk(e,t),i=function(t,e){var n=$r.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return e.on("remove",n.stop),function(r){return t.on((function(t){var o,i,u=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(!t.dragging&&u>10){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var a=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}}(t,mk(e,r));o=t.ghost,i=e.getBody(),o.parentNode!==i&&i.appendChild(o),function(t,e,n,r,o,i){var u=0,a=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(u=e.pageX+n-o),e.pageY+r>i&&(a=e.pageY+r-i),t.style.width=n-u+"px",t.style.height=r-a+"px"}(t.ghost,a,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}))}}(e,t),u=yk(e,t),a=function(t,e){return function(){t.on((function(t){t.dragging&&e.fire("dragend")})),wk(t)}}(e,t);t.on("mousedown",o),t.on("mousemove",i),t.on("mouseup",u),n.bind(r,"mousemove",i),n.bind(r,"mouseup",a),t.on("remove",(function(){n.unbind(r,"mousemove",i),n.unbind(r,"mouseup",a)})),t.on("keydown",(function(t){t.keyCode===Gf.ESC&&a()}))},Ck=function(t){xk(t),function(t){t.on("drop",(function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(gk(n)||"false"===t.dom.getContentEditableParent(n))&&e.preventDefault()}))}(t),function(t){return t.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var e=function(e){if(!e.isDefaultPrevented()){var n=e.dataTransfer;n&&(j(n.types,"Files")||n.files.length>0)&&(e.preventDefault(),"drop"===e.type&&cy(t,"Dropped file type is not supported"))}},n=function(n){tm(t,n.target)&&e(n)},r=function(){var r=oa.DOM,o=t.dom,i=document,u=t.inline?t.getBody():t.getDoc(),a=["drop","dragover"];q(a,(function(t){r.bind(i,t,n),o.bind(u,t,e)})),t.on("remove",(function(){q(a,(function(t){r.unbind(i,t,n),o.unbind(u,t,e)}))}))};t.on("init",(function(){$r.setEditorTimeout(t,r,0)}))}(t)},Sk=zn,kk=Bn,Ok=function(t,e){return Vf(t.getBody(),e)},_k=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),u=_s(t,i,o,(function(){return am(t)})),a="sel-"+r.uniqueId(),c=function(t){return t!==i&&(kk(t)||In(t))&&r.isChildOf(t,i)},s=function(t){return ug(t)||ag(t)||ng(t)||rg(t)},l=function(t){t&&n.setRng(t)},f=n.getRng,d=function(e,r,o,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:r,direction:e,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===e),u.show(o,r))},m=function(t){return po(t)||xo(t)||Co(t)},g=function(t){return m(t.startContainer)||m(t.endContainer)},h=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,u=e.startOffset,a=e.endContainer,c=e.endOffset;return wt(n,i.nodeName.toLowerCase())?0===u?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,u),wt(n,a.nodeName.toLowerCase())?0===c?o.setEndBefore(a):o.setEndAfter(a):o.setEnd(a,c),o},p=function(o){var i=o.cloneNode(!0),u=t.fire("ObjectSelected",{target:o,targetClone:i});if(u.isDefaultPrevented())return null;var c=function(e,o,i){var u=t.$,c=Vr(ye.fromDom(t.getBody()),"#"+a).fold((function(){return u([])}),(function(t){return u([t.dom])}));0===c.length&&(c=u('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",a)).appendTo(t.getBody());var s=r.createRng();o===i&&de.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(" ").append(o).append(" "),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(e,t.getBody()).y}),c[0].focus();var l=n.getSel();return l.removeAllRanges(),l.addRange(s),s}(o,u.targetClone,i),s=ye.fromDom(o);return q(_a(ye.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){Se(s,t)||Gn(t,"data-mce-selected")})),r.getAttrib(o,"data-mce-selected")||o.setAttribute("data-mce-selected","1"),e=o,w(),c},v=function(t,e){if(!t)return null;if(t.collapsed){if(!g(t)){var n=e?1:-1,o=Js(n,i,t),u=o.getNode(!e);if(As(u))return d(n,u,!!e&&!o.isAtEnd(),!1);var a=o.getNode(e);if(As(a))return d(n,a,!e&&!o.isAtEnd(),!1)}return null}var s=t.startContainer,l=t.startOffset,f=t.endOffset;if(3===s.nodeType&&0===l&&kk(s.parentNode)&&(s=s.parentNode,l=r.nodeIndex(s),s=s.parentNode),1!==s.nodeType)return null;if(f===l+1&&s===t.endContainer){var m=s.childNodes[l];if(c(m))return p(m)}return null},y=function(){e&&e.removeAttribute("data-mce-selected"),Vr(ye.fromDom(t.getBody()),"#"+a).each(un),e=null},w=function(){u.hide()};return de.ceFalse&&!Bv(t)&&function(){t.on("mouseup",(function(e){var n=f();n.collapsed&&ey(t,e.clientX,e.clientY)&&mw(t,n,!1).each(l)})),t.on("click",(function(e){var o=Ok(t,e.target);o&&(kk(o)&&(e.preventDefault(),t.focus()),Sk(o)&&r.isChildOf(o,n.getNode())&&y())})),t.on("blur NewBlock",y),t.on("ResizeWindow FullscreenStateChanged",u.reposition);var m=function(e,n){var i,u,a=r.getParent(e,o),c=r.getParent(n,o);return!b(a)&&(!(e===c||!r.isChildOf(a,c)||!1!==kk(Ok(t,a)))||!r.isChildOf(c,a)&&(i=a,u=c,!(r.getParent(i,o)===r.getParent(u,o)))&&function(t){var e=t.firstChild;if(b(e))return!1;var n=vc.before(e);if(Rn(n.getNode())&&1===t.childNodes.length)return!s(n);var r=dl(t).next(n);return r&&!s(r)}(a))};t.on("tap",(function(e){var n=e.target,r=Ok(t,n);kk(r)?(e.preventDefault(),dw(t,r).each(v)):c(n)&&dw(t,n).each(v)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==ey(t,e.clientX,e.clientY)){var u=Ok(t,o);if(u)kk(u)?(e.preventDefault(),dw(t,u).each(v)):(y(),Sk(u)&&e.shiftKey||jf(e.clientX,e.clientY,n.getRng())||(w(),n.placeCaretAt(e.clientX,e.clientY)));else if(c(o))dw(t,o).each(v);else if(!1===As(o)){y(),w();var a=Px(i,e.clientX,e.clientY);if(a&&!m(o,a.node)){e.preventDefault();var s=d(1,a.node,a.before,!1);l(s),t.getBody().focus()}}}})),t.on("keypress",(function(t){Gf.modifierPressed(t)||kk(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=h(t.range);var e=v(t.range,t.forward);e&&(t.range=e)}));t.on("AfterSetSelectionRange",(function(t){var e=t.range,n=e.startContainer.parentNode;g(e)||"mcepastebin"===n.id||w(),function(t){return r.hasClass(t,"mce-offscreen-selection")}(n)||y()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!de.ie){var o=(e=r.get(a))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),Ck(t),function(t){var e=pa((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=gw(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(In(n)){var r=Vf(t.getBody(),n),o=Bn(r)?r:n;t.selection.getNode()!==o&&dw(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:d,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(So(t),l(f()),n.scrollIntoView(t))},hideFakeCaret:w,destroy:function(){u.destroy(),e=null}}},Tk=function(t){var e,n,r=ve.each,o=Gf.BACKSPACE,i=Gf.DELETE,u=t.dom,a=t.selection,c=t.parser,s=de.gecko,l=de.ie,f=de.webkit,d=l?"Text":"URL",m=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},g=function(t){return t.isDefaultPrevented()},h=function(){var e=function(t){var e=u.create("body"),n=t.cloneContents();return e.appendChild(n),a.serializer.serialize(e,{format:"html"})};t.on("keydown",(function(n){var r,a,c=n.keyCode;if(!g(n)&&(c===i||c===o)){if(r=t.selection.isCollapsed(),a=t.getBody(),r&&!u.isEmpty(a))return;if(!r&&!function(n){var r=e(n),o=u.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),a.firstChild&&u.isBlock(a.firstChild)?t.selection.setCursorLocation(a.firstChild,0):t.selection.setCursorLocation(a,0),t.nodeChanged()}}))},p=function(){t.shortcuts.add("meta+a",null,"SelectAll")},v=function(){t.inline||u.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=a.getRng(),t.getBody().focus(),"mousedown"===e.type){if(po(n.startContainer))return;a.placeCaretAt(e.clientX,e.clientY)}else a.setRng(n)}))},b=function(){Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!g(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),$r.setEditorTimeout(t,(function(){n.focus()}))}}))},y=function(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==u.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&u.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),a.select(n))}))},w=function(){t.on("keydown",(function(t){if(!g(t)&&t.keyCode===o&&a.isCollapsed()&&0===a.getRng().startOffset){var e=a.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},x=function(){(function(t){return t.getParam("readonly")})(t)||t.on("BeforeExecCommand mousedown",(function(){m("StyleWithCSS",!1),m("enableInlineTableEditing",!1),os(t)||m("enableObjectResizing",!1)}))},S=function(){t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||r(u.select("a"),(function(t){var e=t.parentNode,n=u.getRoot();if(e.lastChild===t){for(;e&&!u.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}u.add(e,"br",{"data-mce-bogus":1})}}))}))},k=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},O=function(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))},_=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(de.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},T=function(){de.mac&&t.on("keydown",(function(e){!Gf.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}))},E=function(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},A=function(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))},D=function(){t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&a.select(e.target),(n=t.selection.getContent()).length>0&&(r="data:text/mce-internal,"+escape(t.id)+","+escape(n),e.dataTransfer.setData(d,r)))}(e)})),t.on("drop",(function(e){if(!g(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(d))&&e.indexOf("data:text/mce-internal,")>=0?(e=e.substr("data:text/mce-internal,".length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=Yf(e.x,e.y,t.getDoc());a.setRng(r),o=n.html,i=!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):t.execCommand("mceInsertContent",!1,o)}}var o,i}))},M=C;return Bv(t)?(f&&(v(),y(),A(),p(),de.iOS&&(O(),_(),E())),s&&(b(),x(),k(),T())):(t.on("keydown",(function(e){var n,r;if(!g(e)&&e.keyCode===Gf.BACKSPACE){var o=(n=a.getRng()).startContainer,i=n.startOffset,c=u.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==c;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=u.createRng()).setStart(o,0),n.setEnd(o,0),a.setRng(n))}}})),h(),de.windowsPhone||t.on("keyup focusin mouseup",(function(t){Gf.modifierPressed(t)||a.normalize()}),!0),f&&(v(),y(),Wc(t)&&t.on("init",(function(){m("DefaultParagraphSeparator",Wc(t))})),A(),w(),c.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),de.iOS?(O(),_(),E()):p()),de.ie>=11&&(_(),w()),de.ie&&(p(),m("AutoUrlDetect",!1),D()),s&&(t.on("keydown",(function(e){if(!g(e)&&e.keyCode===o){if(!t.getBody().getElementsByTagName("hr").length)return;if(a.isCollapsed()&&0===a.getRng().startOffset){var n=a.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return u.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(u.remove(r),e.preventDefault())}}})),b(),e=function(){var e=u.getAttribs(a.getStart().cloneNode(!1));return function(){var n=a.getStart();n!==t.getBody()&&(u.setAttrib(n,"style",null),r(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},n=function(){return!a.isCollapsed()&&u.getParent(a.getStart(),u.isBlock)!==u.getParent(a.getEnd(),u.isBlock)},t.on("keypress",(function(r){var o;if(!g(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=e(),t.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),u.bind(t.getDoc(),"cut",(function(r){var o;!g(r)&&n()&&(o=e(),$r.setEditorTimeout(t,(function(){o()})))})),x(),S(),k(),T(),w())),{refreshContentEditable:M,isHidden:function(){if(!s||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},Ek=oa.DOM,Ak=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},Dk=function(t){return vt(t,(function(t){return!1===v(t)}))},Mk=function(t){var e=t.settings;return Dk({block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements,padd_empty_block_inline_children:e.format_empty_lines})},Rk=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Dk({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:Ak(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},Nk=function(t){var e=t.dom.getRoot();t.inline||Df(t)&&t.selection.getStart(!0)!==e||Sl(e).each((function(e){var n=e.getNode(),r=On(n)?Sl(n).getOr(e):e;de.browser.isIE()?function(t,e){var n=ye.fromDom(t.getBody()),r=(Wd(t)?I.from(e):I.none()).map(qd).filter(Ud(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},zk=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),Nk(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&$r.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},Bk=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},Pk=function(t){var e=Bk(t),n=rs(t),r=t.contentCSS,o=function(){e.unloadAll(r),t.inline||t.ui.styleSheetLoader.unloadAll(n)},i=function(){t.removed?o():t.on("remove",o)};if(t.contentStyles.length>0){var u="";ve.each(t.contentStyles,(function(t){u+=t+"\r\n"})),t.dom.addStyle(u)}var a=Ur.all(function(t,e,n){var r=[new Ur((function(n,r){return Bk(t).loadAll(e,n,r)}))];return t.inline?r:r.concat([new Ur((function(e,r){return t.ui.styleSheetLoader.loadAll(n,e,r)}))])}(t,r,n)).then(i).catch(i);return t.settings.content_style&&function(t,e){var n=ye.fromDom(t.getBody()),r=Ye(Ke(n)),o=ye.fromTag("style");jn(o,"type","text/css"),nn(o,ye.fromText(e)),nn(r,o),t.on("remove",(function(){un(o)}))}(t,t.settings.content_style),a},Ik=function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();!function(t){t.fire("PreInit")}(t),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,Ek.setAttrib(r,"spellcheck","false")),t.quirks=Tk(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",ma.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){ve.each(e.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type}))},Lk=function(t){!0!==t.removed&&(!function(t){Bv(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),zk(t))},Hk=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(Ek.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===Ek.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=Cy(t),t.schema=yi(Mk(t)),t.dom=oa(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:Zc(t),referrerPolicy:ts(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=db(Rk(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,u=t.dom,a="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(a)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=u.serializeStyle(u.parseStyle(o),r.name)).length||(o=null),r.attr(a,o),r.attr(n,o)):"tabindex"===n?(r.attr(a,o),r.attr(n,null)):r.attr(a,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new wm("br",1)).shortEnded=!0)}})),e}(t),t.serializer=vb(function(t){var e=t.settings;return Dt(Dt(Dt({},Rk(t)),Mk(t)),Dk({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before}))}(t),t),t.selection=Xv(t.dom,t.getWin(),t.serializer,t),t.annotator=Hf(t),t.formatter=Ay(t),t.undoManager=My(t),t._nodeChangeDispatcher=new ck(t),t._selectionOverrides=_k(t),yC(t),sk(t),Bv(t)||fk(t);var u=function(t){return Bv(t)?sa(null):ak(t)}(t);vC(t,u),function(t){Wc(t)&&t.on("NodeChange",E(SC,t))}(t),By(t);var a=Pv(t);Ik(t),a.fold((function(){Pk(t).then((function(){return Lk(t)}))}),(function(e){t.setProgressState(!0),Pk(t).then((function(){e().then((function(e){t.setProgressState(!1),Lk(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),Lk(t)}))}))}))},Fk=oa.DOM,Vk=function(t){var e=function(t){return t.getParam("doctype","<!DOCTYPE html>")}(t)+"<html><head>";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(t){return jc(t,"body_id","tinymce")}(t),r=function(t){return jc(t,"body_class","")}(t),o=t.translate(function(t){return t.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string")}(t));return Uc(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+Uc(t)+'" />'),e+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'" aria-label="'+o+'"><br></body></html>'},jk=function(t,e){var n,r,o,i,u=t.translate("Rich Text Area"),a=(n=t.id,r=u,e.height,o=function(t){return t.getParam("iframe_attrs",{})}(t),i=ye.fromTag("iframe"),Un(i,o),Un(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Ca(i,"tox-edit-area__iframe"),i).dom;a.onload=function(){a.onload=null,t.fire("load")};var c=function(t,e){if(document.domain!==window.location.hostname&&de.browser.isIE()){var n=by("mce");t[n]=function(){Hk(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return Fk.setAttrib(e,"src",r),!0}return!1}(t,a);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=a,t.iframeHTML=Vk(t),Fk.add(e.iframeContainer,a),c},Uk=oa.DOM,Wk=function(t,e,n){var r=oy.get(n),o=oy.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=ve.trim(n),r&&-1===ve.inArray(e,n)){if(ve.each(oy.dependencies(n),(function(n){Wk(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(e){!function(t,e,n){var r=ma.translate(["Failed to initialize plugin: {0}",e]);Uf(t,"PluginLoadError",{message:r}),dy(r,n),cy(t,r)}(t,n,e)}}},qk=function(t){return t.replace(/^\-/,"")},Gk=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},$k=function(t){var e=t.getElement();return t.inline?Gk(null):function(t){var e=Uk.create("div");return Uk.insertAfter(e,t),Gk(e)}(e)},Xk=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,d(us(t))?function(t){return t.theme.renderUI()}(t):w(us(t))?function(t){var e=t.getElement(),n=us(t)(t,e);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:e.offsetHeight,n}(t):$k(t)},Kk=function(t){t.fire("ScriptsLoaded"),function(t){var e=ve.trim(Xc(t)),n=t.ui.registry.getAll().icons,r=Dt(Dt({},Xb.get("default").icons),Xb.get(e).icons);dt(r,(function(e,r){wt(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=us(t);if(d(e)){t.settings.theme=qk(e);var n=iy.get(e);t.theme=new n(t,iy.urls[e]),t.theme.init&&t.theme.init(t,iy.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];ve.each(ls(t).split(/[ ,]/),(function(n){Wk(t,e,qk(n))}))}(t);var e=Xk(t);!function(t,e){var n={show:I.from(e.show).getOr(C),hide:I.from(e.hide).getOr(C),disable:I.from(e.disable).getOr(C),isDisabled:I.from(e.isDisabled).getOr(R),enable:function(){t.mode.isReadOnly()||I.from(e.enable).map(M)}};t.ui=Dt(Dt({},t.ui),n)}(t,I.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,hy(t),t.inline?Hk(t):function(t,e){var n=jk(t,e);e.editorContainer&&(Fk.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=Fk.isHidden(e.editorContainer)),t.getElement().style.display="none",Fk.setAttrib(t.id,"aria-hidden","true"),n||Hk(t)}(t,n)},Yk=oa.DOM,Jk=function(t){return"-"===t.charAt(0)},Qk=function(t,e){var n=es(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===ma.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,C,void 0,(function(){!function(t,e,n){sy(t,"LanguageLoadError",ly("language",e,n))}(e,o,n)}))}},Zk=function(t,e,n){return I.from(e).filter((function(t){return t.length>0&&!Xb.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:I.some(e)}}))},tO=function(t,e,n){var r=Zk(e,"default",n),o=function(t){return I.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:I.none()}}))}(e).orThunk((function(){return Zk(e,Xc(e),"")}));q(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([r,o]),(function(n){t.add(n.url,C,void 0,(function(){!function(t,e,n){sy(t,"IconsLoadError",ly("icons",e,n))}(e,n.url,n.name.getOrUndefined())}))}))},eO=function(t,e){var n=ca.ScriptLoader;!function(t,e,n,r){var o=us(e);if(d(o)){if(!Jk(o)&&!wt(iy.urls,o)){var i=function(t){return t.getParam("theme_url")}(e);i?iy.load(o,e.documentBaseURI.toAbsolute(i)):iy.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue((function(){iy.waitFor(o,r)}))}else r()}(n,t,e,(function(){Qk(n,t),tO(n,t,e),function(t,e){ve.each(function(t){return t.getParam("external_plugins")}(t),(function(e,n){oy.load(n,e,C,void 0,(function(){fy(t,e,n)})),t.settings.plugins+=" "+n})),ve.each(ls(t).split(/[ ,]/),(function(n){if((n=ve.trim(n))&&!oy.urls[n])if(Jk(n)){n=n.substr(1,n.length);var r=oy.dependencies(n);ve.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=oy.createUrl(r,n);oy.load(o.resource,o,C,void 0,(function(){fy(t,o.prefix+o.resource+o.suffix,o.resource)}))}))}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};oy.load(n,o,C,void 0,(function(){fy(t,o.prefix+o.resource+o.suffix,n)}))}}))}(t,e),n.loadQueue((function(){t.removed||Kk(t)}),t,(function(){t.removed||Kk(t)}))}))},nO=function(t){var e=t.id;ma.setCode(es(t));var n=function(){Yk.unbind(window,"ready",n),t.render()};if(Di.Event.domLoaded){if(t.getElement()&&de.contentEditable){var r=ye.fromDom(t.getElement()),o=function(t){return Y(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})}(r);t.on("remove",(function(){G(r.dom.attributes,(function(t){return Gn(r,t.name)})),Un(r,o)})),t.ui.styleSheetLoader=function(t,e){return Kr.forElement(t,{contentCssCors:ss(e),referrerPolicy:ts(e)})}(r,t),!function(t){return t.getParam("inline")}(t)?(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden"):t.inline=!0;var i=t.getElement().form||Yk.getParent(e,"form");i&&(t.formElement=i,function(t){return t.getParam("hidden_input")}(t)&&!Tn(t.getElement())&&(Yk.insertAfter(Yk.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},Yk.bind(i,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!function(t){return t.getParam("submit_patch")}(t)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=uy(t),t.notificationManager=ry(t),function(t){return"xml"===t.getParam("encoding")}(t)&&t.on("GetContent",(function(t){t.save&&(t.content=Yk.encode(t.content))})),function(t){return t.getParam("add_form_submit_trigger")}(t)&&t.on("submit",(function(){t.initialized&&t.save()})),function(t){return t.getParam("add_unload_trigger")}(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),eO(t,t.suffix)}}else Yk.bind(window,"ready",n)},rO=function(t,e){return function(t,e){return Lv(t).editor.addVisual(e)}(t,e)},oO={"font-size":"size","font-family":"face"},iO=function(t,e,n){return Jh(ye.fromDom(n),(function(e){return function(e){return Yn(e,t).orThunk((function(){return"font"===_e(e)?yt(oO,t).bind((function(t){return qn(e,t)})):I.none()}))}(e)}),(function(t){return Se(ye.fromDom(e),t)}))},uO=function(t){return function(e,n){return I.from(n).map(ye.fromDom).filter(Ae).bind((function(n){return iO(t,e,n.dom).or(function(t,e){return I.from(oa.DOM.getStyle(e,t,!0))}(t,n.dom))})).getOr("")}},aO=uO("font-size"),cO=S((function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),uO("font-family")),sO=function(t){return Sl(t.getBody()).map((function(t){var e=t.container();return En(e)?e.parentNode:e}))},lO=function(t,e){return function(t){return I.from(t.selection.getRng()).bind((function(e){var n=t.getBody();return e.startContainer===n&&0===e.startOffset?I.none():I.from(t.selection.getStart(!0))}))}(t).orThunk(E(sO,t)).map(ye.fromDom).filter(Ae).bind(e)},fO=function(t,e){return lO(t,k(I.some,e))},dO=function(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=function(t){return ve.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return ve.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},mO=function(t){var e=t.split(/\s*,\s*/);return W(e,(function(t){return-1===t.indexOf(" ")||Lt(t,'"')||Lt(t,"'")?t:"'"+t+"'"})).join(",")},gO=function(t,e){var n=function(t){if("string"!=typeof t){var e=ve.extend({paste:t.paste,data:{paste:t.paste}},t);return{content:t.content,details:e}}return{content:t,details:{}}}(e);!function(t,e,n){Iv(t).editor.insertContent(e,n)}(t,n.content,n.details)},hO=ve.each,pO=ve.map,vO=ve.inArray,bO=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,u=this;if(!u.editor.removed){var a;if("mcefocus"!==t.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(a=u.editor,Kd(a).each((function(t){return a.selection.setRng(t)}))):u.editor.focus()),(r=u.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var c=t.toLowerCase();if(o=u.commands.exec[c])return o(c,e,n),u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(hO(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1})),i)return i;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=u.editor.getDoc().execCommand(t,e,n)}catch(t){}return!!i&&(u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},t.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;hO(t,(function(t,r){hO(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,u){return e.call(n||r.editor,o,i,u)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":C,"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},mceFocus:function(e,n,r){lm(t,r)},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(t){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");de.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),hO("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,{value:r})},FontName:function(e,n,r){!function(t,e){var n=dO(t,e);t.formatter.toggle("fontname",{value:mO(n)}),t.nodeChanged()}(t,r)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:dO(t,e)}),t.nodeChanged()}(t,r)},LineHeight:function(e,n,r){!function(t,e){t.formatter.toggle("lineheight",{value:String(e)}),t.nodeChanged()}(t,r)},Lang:function(t,n,r){e.toggleFormat(t,{value:r.code,customValue:r.customCode})},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){gO(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){qS(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){gC(t,e)},mceRepaint:C,InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),zn);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return RS(t,r),!0}});var n=function(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=pO(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==vO(o,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return fC(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return function(t){return fO(t,(function(e){return cO(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return fO(t,(function(e){return aO(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return function(t){return fO(t,(function(e){var n=ye.fromDom(t.getBody());return Jh(e,(function(t){return Yn(t,"line-height")}),E(Se,n)).getOrThunk((function(){var t=parseFloat(Xn(e,"line-height")),n=parseFloat(Xn(e,"font-size"));return String(t/n)}))})).getOr("")}(t)}),this)},t}(),yO=function(t,e,n){ka(t,e)&&!1===n?function(t,e){ya(t)?t.dom.classList.remove(e):xa(t,e);Sa(t)}(t,e):n&&Ca(t,e)},wO=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},xO=function(t,e){t.dom.contentEditable=e?"true":"false"},CO=function(t,e){var n=ye.fromDom(t.getBody());yO(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){I.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,xO(n,!1),q(_a(n,'*[contenteditable="true"]'),(function(t){jn(t,"data-mce-contenteditable","true"),xO(t,!1)}))):(t.readonly=!1,xO(n,!0),function(t){q(_a(t,'*[data-mce-contenteditable="true"]'),(function(t){Gn(t,"data-mce-contenteditable"),xO(t,!0)}))}(n),wO(t,"StyleWithCSS",!1),wO(t,"enableInlineTableEditing",!1),wO(t,"enableObjectResizing",!1),cm(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},SO=function(t){return t.readonly},kO=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){SO(t)&&q(e,(function(t){t.attr("data-mce-contenteditable",t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter("data-mce-contenteditable",(function(e){SO(t)&&q(e,(function(t){t.attr("contenteditable",t.attr("data-mce-contenteditable"))}))})),t.serializer.addTempAttr("data-mce-contenteditable")},OO=function(t,e){if(function(t){return"click"===t.type}(e)&&!Gf.metaKeyPressed(e)){var n=ye.fromDom(e.target);(function(t,e){return jr(e,"a",(function(e){return Se(e,ye.fromDom(t.getBody()))})).bind((function(t){return qn(t,"href")}))})(t,n).each((function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+(Lt(o=n,i="#")?function(t,e){return t.substring(e)}(o,i.length):o)+'"]');r.length&&t.selection.scrollIntoView(r[0],!0)}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o,i}))}},_O=ve.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),TO=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||R}return t.isNative=function(t){return!!_O[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=ki(n,e||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,u=o.length;i<u;i++){var a=o[i];if(!a.removed){if(a.once&&this.off(n,a.func),r.isImmediatePropagationStopped())return r;if(!1===a.func.call(this.scope,r))return r.preventDefault(),r}}return r},t.prototype.on=function(t,e,n,r){if(!1===e&&(e=R),e){var o={func:e,removed:!1};r&&ve.extend(o,r);for(var i=t.toLowerCase().split(" "),u=i.length;u--;){var a=i[u],c=this.bindings[a];c||(c=[],this.toggleEvent(a,!0)),c=n?Mt([o],c,!0):Mt(Mt([],c,!0),[o],!1),this.bindings[a]=c}}return this},t.prototype.off=function(t,e){var n=this;if(t)for(var r=t.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],u=this.bindings[i];if(!i)return dt(this.bindings,(function(t,e){n.toggleEvent(e,!1),delete n.bindings[e]})),this;if(u){if(e){var a=$(u,(function(t){return t.func===e}));u=a.fail,this.bindings[i]=u,q(a.pass,(function(t){t.removed=!0}))}else u.length=0;u.length||(this.toggleEvent(t,!1),delete this.bindings[i])}}else dt(this.bindings,(function(t,e){n.toggleEvent(e,!1)})),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),EO=function(t){return t._eventDispatcher||(t._eventDispatcher=new TO({scope:t,toggleEvent:function(e,n){TO.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},AO={fire:function(t,e,n){if(this.removed&&"remove"!==t&&"detach"!==t)return e;var r=EO(this).fire(t,e);if(!1!==n&&this.parent)for(var o=this.parent();o&&!r.isPropagationStopped();)o.fire(t,r,!1),o=o.parent();return r},on:function(t,e,n){return EO(this).on(t,e,n)},off:function(t,e){return EO(this).off(t,e)},once:function(t,e){return EO(this).once(t,e)},hasEventListeners:function(t){return EO(this).has(t)}},DO=oa.DOM,MO=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=is(t);return n?(t.eventRoot||(t.eventRoot=DO.select(n)[0]),t.eventRoot):t.getBody()},RO=function(t,e,n){!function(t){return!t.hidden&&!SO(t)}(t)?SO(t)&&OO(t,n):t.fire(e,n)},NO=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=MO(t,e);if(is(t)){if(xx||(xx={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||xx&&(dt(xx,(function(e,n){t.dom.unbind(MO(t,n))})),xx=null)}))),xx[e])return;n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var u=o[i].getBody();(u===r||DO.isChildOf(r,u))&&RO(o[i],e,n)}},xx[e]=n,DO.bind(r,e,n)}else n=function(n){RO(t,e,n)},DO.bind(r,e,n),t.delegates[e]=n}},zO=Dt(Dt({},AO),{bindPendingEventDelegates:function(){var t=this;ve.each(t._pendingNativeEvents,(function(e){NO(t,e)}))},toggleNativeEvent:function(t,e){"focus"!==t&&"blur"!==t&&(this.removed||(e?this.initialized?NO(this,t):this._pendingNativeEvents?this._pendingNativeEvents.push(t):this._pendingNativeEvents=[t]:this.initialized&&(this.dom.unbind(MO(this,t),t,this.delegates[t]),delete this.delegates[t])))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(dt(t.delegates,(function(e,n){t.dom.unbind(MO(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),BO=["design","readonly"],PO=function(t,e,n,r){var o=n[e.get()],i=n[r];try{i.activate()}catch(t){return void console.error("problem while activating editor mode "+r+":",t)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&CO(t,i.editorReadOnly),e.set(r),function(t,e){t.fire("SwitchMode",{mode:e})}(t,r)},IO=function(t){var e=sa("design"),n=sa({design:{activate:C,deactivate:C,editorReadOnly:!1},readonly:{activate:C,deactivate:C,editorReadOnly:!0}});return function(t){t.serializer?kO(t):t.on("PreInit",(function(){kO(t)}))}(t),function(t){t.on("ShowCaret",(function(e){SO(t)&&e.preventDefault()})),t.on("ObjectSelected",(function(e){SO(t)&&e.preventDefault()}))}(t),{isReadOnly:function(){return SO(t)},set:function(r){return function(t,e,n,r){if(r!==n.get()){if(!wt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?PO(t,n,e,r):t.on("init",(function(){return PO(t,n,e,r)}))}}(t,n.get(),e,r)},get:function(){return e.get()},register:function(t,e){n.set(function(t,e,n){var r;if(j(BO,e))throw new Error("Cannot override default mode "+e);return Dt(Dt({},t),((r={})[e]=Dt(Dt({},n),{deactivate:function(){try{n.deactivate()}catch(t){console.error("problem while deactivating editor mode "+e+":",t)}}}),r))}(n.get(),t,e))}}},LO=ve.each,HO=ve.explode,FO={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},VO=ve.makeMap("alt,ctrl,shift,meta,access"),jO=function(t){var e,n={};LO(HO(t.toLowerCase(),"+"),(function(t){t in VO?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=FO[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in VO)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,de.mac?n.ctrl=!0:n.shift=!0),n.meta&&(de.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},UO=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(LO(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}return t.prototype.add=function(t,e,n,r){var o=this,i=o.normalizeCommandFunc(n);return LO(HO(ve.trim(t)),(function(t){var n=o.createShortcut(t,e,i,r);o.shortcuts[n.id]=n})),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.normalizeCommandFunc=function(t){var e=this,n=t;return"string"==typeof n?function(){e.editor.execCommand(n,!1,null)}:ve.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},t.prototype.createShortcut=function(t,e,n,r){var o=ve.map(HO(t,">"),jO);return o[o.length-1]=ve.extend(o[o.length-1],{func:n,scope:r||this.editor}),ve.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&(e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&(e.alt===t.altKey&&e.shift===t.shiftKey&&(!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0))))},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),WO=function(){var t=function(){var t={},e={},n={},r={},o={},i={},u={},a=function(t,e){return function(n,r){return t[n.toLowerCase()]=Dt(Dt({},r),{type:e})}};return{addButton:a(t,"button"),addGroupToolbarButton:a(t,"grouptoolbarbutton"),addToggleButton:a(t,"togglebutton"),addMenuButton:a(t,"menubutton"),addSplitButton:a(t,"splitbutton"),addMenuItem:a(e,"menuitem"),addNestedMenuItem:a(e,"nestedmenuitem"),addToggleMenuItem:a(e,"togglemenuitem"),addAutocompleter:a(n,"autocompleter"),addContextMenu:a(o,"contextmenu"),addContextToolbar:a(i,"contexttoolbar"),addContextForm:a(i,"contextform"),addSidebar:a(u,"sidebar"),addIcon:function(t,e){return r[t.toLowerCase()]=e},getAll:function(){return{buttons:t,menuItems:e,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:u}}}}();return{addAutocompleter:t.addAutocompleter,addButton:t.addButton,addContextForm:t.addContextForm,addContextMenu:t.addContextMenu,addContextToolbar:t.addContextToolbar,addIcon:t.addIcon,addMenuButton:t.addMenuButton,addMenuItem:t.addMenuItem,addNestedMenuItem:t.addNestedMenuItem,addSidebar:t.addSidebar,addSplitButton:t.addSplitButton,addToggleButton:t.addToggleButton,addGroupToolbarButton:t.addGroupToolbarButton,addToggleMenuItem:t.addToggleMenuItem,getAll:t.getAll}},qO=oa.DOM,GO=ve.extend,$O=ve.each,XO=ve.resolve,KO=de.ie,YO=function(){function t(t,e,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,GO(this,zO),this.settings=qb(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(ca.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),oa.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),ga.languageLoad=this.settings.language_load,ga.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new Em(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new UO(this),this.editorCommands=new bO(this),this.settings.cache_suffix&&(de.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:WO(),styleSheetLoader:void 0,show:C,hide:C,enable:C,disable:C,isDisabled:R};var o=IO(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Ju.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))}return t.prototype.render=function(){nO(this)},t.prototype.focus=function(t){this.execCommand("mceFocus",!1,t)},t.prototype.hasFocus=function(){return am(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this,i=o.settings[t];if(i)return o.callbackLookup&&(r=o.callbackLookup[t])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?XO(r):0,i=XO(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return ma.translate(t)},t.prototype.getParam=function(t,e,n){return $b(this,t,e,n)},t.prototype.hasPlugin=function(t,e){return!!j(ls(this).split(/[ ,]/),t)&&(!e||void 0!==oy.get(t))},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable="true":(qO.show(this.getContainer()),qO.hide(this.id)),this.load(),this.fire("show"))},t.prototype.hide=function(){var t=this.getDoc();this.hidden||(KO&&t&&!this.inline&&t.execCommand("SelectAll"),this.save(),this.inline?(this.getBody().contentEditable="false",this===this.editorManager.focusedEditor&&(this.editorManager.focusedEditor=null)):(qO.hide(this.getContainer()),qO.setStyle(this.id,"display",this.orgDisplay)),this.hidden=!0,this.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this.getElement();if(this.removed)return"";if(n){(t=t||{}).load=!0;var r=Tn(n)?n.value:n.innerHTML;return e=this.setContent(r,t),t.element=n,t.no_events||this.fire("LoadContent",t),t.element=n=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,Tn(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=qO.getParent(r.id,"form"))&&$O(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return yb(this,t,e)},t.prototype.getContent=function(t){return bb(this,t)},t.prototype.insertContent=function(t,e){e&&(t=GO({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?yb(this,this.startContent,{format:"raw"}):yb(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){return this.container||(this.container=qO.get(this.editorContainer||this.id+"_parent")),this.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=qO.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t;return this.contentWindow||(t=this.iframeElement)&&(this.contentWindow=t.contentWindow),this.contentWindow},t.prototype.getDoc=function(){var t;return this.contentDocument||(t=this.getWin())&&(this.contentDocument=t.document),this.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",t,n,!0,e):!r.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:r.relative_urls?this.documentBaseURI.toRelative(t):t=this.documentBaseURI.toAbsolute(t,r.remove_script_host)},t.prototype.addVisual=function(t){rO(this,t)},t.prototype.remove=function(){Cb(this)},t.prototype.destroy=function(t){Sb(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),JO=oa.DOM,QO=ve.explode,ZO=ve.each,t_=ve.extend,e_=0,n_=!1,r_=[],o_=[],i_=function(t){var e=t.type;ZO(s_.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}}))},u_=function(t){t!==n_&&(t?Ju(window).on("resize scroll",i_):Ju(window).off("resize scroll",i_),n_=t)},a_=function(t){var e=o_;delete r_[t.id];for(var n=0;n<r_.length;n++)if(r_[n]===t){r_.splice(n,1);break}return o_=X(o_,(function(e){return t!==e})),s_.activeEditor===t&&(s_.activeEditor=o_.length>0?o_[0]:null),s_.focusedEditor===t&&(s_.focusedEditor=null),e.length!==o_.length},c_="CSS1Compat"!==document.compatMode,s_=Dt(Dt({},AO),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Ju,majorVersion:"5",minorVersion:"10.5",releaseDate:"2022-05-25",editors:r_,i18n:ma,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,n="";e=Em.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var r,o=window.tinymce||window.tinyMCEPreInit;if(o)t=o.base||o.baseURL,n=o.suffix;else{for(var i=document.getElementsByTagName("script"),u=0;u<i.length;u++){var a;if(""!==(a=i[u].src||"")){var c=a.substring(a.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)){-1!==c.indexOf(".min")&&(n=".min"),t=a.substring(0,a.lastIndexOf("/"));break}}}if(!t&&document.currentScript)-1!==(a=document.currentScript.src).indexOf(".min")&&(n=".min"),t=a.substring(0,a.lastIndexOf("/"))}this.baseURL=new Em(e).toAbsolute(t),this.documentBaseURL=e,this.baseURI=new Em(this.baseURL),this.suffix=n,(r=this).on("AddEditor",E(em,r)),r.on("RemoveEditor",E(nm,r))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&dt(r,(function(t,e){ga.PluginManager.urls[e]=t}))},init:function(t){var e,n=this,r=ve.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),o=function(t){var e=t.id;return e||(e=yt(t,"name").filter((function(t){return!JO.get(t)})).getOrThunk(JO.uniqueId),t.setAttribute("id",e)),e},i=function(t,e){return e.constructor===RegExp?e.test(t.className):JO.hasClass(t,e)},u=function(t){e=t},a=function(){var e,c=0,s=[],l=function(t,r,o){var i=new YO(t,r,n);s.push(i),i.on("init",(function(){++c===e.length&&u(s)})),i.targetElm=i.targetElm||o,i.render()};JO.unbind(window,"ready",a),function(e){var r=t[e];if(r)r.apply(n,[])}("onpageload"),e=Ju.unique(function(t){var e=[];if(de.browser.isIE()&&de.browser.version.major<11)return dy("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(c_)return dy("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return ZO(t.types,(function(t){e=e.concat(JO.select(t.selector))})),e;if(t.selector)return JO.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var n=t.elements||"";n.length>0&&ZO(QO(n),(function(t){var n=JO.get(t);n?e.push(n):ZO(document.forms,(function(n){ZO(n.elements,(function(n){n.name===t&&(t="mce_editor_"+e_++,JO.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":ZO(JO.select("textarea"),(function(n){t.editor_deselector&&i(n,t.editor_deselector)||t.editor_selector&&!i(n,t.editor_selector)||e.push(n)}))}return e}(t)),t.types?ZO(t.types,(function(n){ve.each(e,(function(e){return!JO.is(e,n.selector)||(l(o(e),t_({},t,n),e),!1)}))})):(ve.each(e,(function(t){var e;(e=n.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(a_(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)})),0===(e=ve.grep(e,(function(t){return!n.get(t.id)}))).length?u([]):ZO(e,(function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in r}(t,e)?l(o(e),t,e):dy("Could not initialize inline editor on invalid inline target element",e)})))};return n.settings=t,JO.bind(window,"ready",a),new Ur((function(t){e?t(e):u=function(e){t(e)}}))},get:function(t){return 0===arguments.length?o_.slice(0):d(t)?Q(o_,(function(e){return e.id===t})).getOr(null):x(t)&&o_[t]?o_[t]:null},add:function(t){var e=this;return r_[t.id]===t?t:(null===e.get(t.id)&&("length"!==t.id&&(r_[t.id]=t),r_.push(t),o_.push(t)),u_(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),Cx||(Cx=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Cx)),t)},createEditor:function(t,e){return this.add(new YO(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!d(t))return n=t,h(r.get(n.id))?null:(a_(n)&&r.fire("RemoveEditor",{editor:n}),0===o_.length&&window.removeEventListener("beforeunload",Cx),n.remove(),u_(o_.length>0),n);ZO(JO.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=o_.length-1;e>=0;e--)r.remove(o_[e])},execCommand:function(t,e,n){var r=this.get(n);switch(t){case"mceAddEditor":return this.get(n)||new YO(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?(r.isHidden()?r.show():r.hide(),!0):(this.execCommand("mceAddEditor",!1,n),!0)}return!!this.activeEditor&&this.activeEditor.execCommand(t,e,n)},triggerSave:function(){ZO(o_,(function(t){t.save()}))},addI18n:function(t,e){ma.add(t,e)},translate:function(t){return ma.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new Em(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new Em(this.baseURL)}});s_.setup();var l_,f_,d_,m_,g_=Math.min,h_=Math.max,p_=Math.round,v_=function(t,e,n){var r=e.x,o=e.y,i=t.w,u=t.h,a=e.w,c=e.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=a),"c"===s[0]&&(o+=p_(c/2)),"c"===s[1]&&(r+=p_(a/2)),"b"===s[3]&&(o-=u),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=p_(u/2)),"c"===s[4]&&(r-=p_(i/2)),b_(r,o,i,u)},b_=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},y_={inflate:function(t,e,n){return b_(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:v_,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if((o=v_(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=h_(t.x,e.x),r=h_(t.y,e.y),o=g_(t.x+t.w,e.x+e.w),i=g_(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:b_(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,u=t.y+t.h,a=e.x+e.w,c=e.y+e.h,s=h_(0,e.x-r),l=h_(0,e.y-o),f=h_(0,i-a),d=h_(0,u-c);return r+=s,o+=l,n&&(i+=s,u+=l,r-=f,o-=d),b_(r,o,(i-=f)-r,(u-=d)-o)},create:b_,fromClientRect:function(t){return b_(t.left,t.top,t.width,t.height)}},w_=(l_={},f_={},{load:function(t,e){var n='Script at URL "'+e+'" failed to load',r='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==l_[t])return l_[t];var o=new Ur((function(o,i){var u=function(t,e,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),t.apply(null,e))}},u=i(t),a=i(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r||null!==o||(o=setTimeout((function(){return a.apply(null,t)}),n))},resolve:u,reject:a}}(o,i);f_[t]=u.resolve,ca.ScriptLoader.loadScript(e,(function(){return u.start(r)}),(function(){return u.reject(n)}))}));return l_[t]=o,o},add:function(t,e){void 0!==f_[t]&&(f_[t](e),delete f_[t]),l_[t]=Ur.resolve(e)}}),x_=ve.each,C_=ve.extend,S_=function(){};S_.extend=d_=function(t){var e=this.prototype,n=function(){var t,e,n,r=this;if(!m_&&(r.init&&r.init.apply(r,arguments),e=r.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(r,arguments)},r=function(){return this};m_=!0;var o=new this;return m_=!1,t.Mixins&&(x_(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),e.Mixins&&(t.Mixins=e.Mixins.concat(t.Mixins))),t.Methods&&x_(t.Methods.split(","),(function(e){t[e]=r})),t.Properties&&x_(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){return void 0!==t?(this[n]=t,this):this[n]}})),t.Statics&&x_(t.Statics,(function(t,e){n[e]=t})),t.Defaults&&e.Defaults&&(t.Defaults=C_({},e.Defaults,t.Defaults)),dt(t,(function(t,n){"function"==typeof t&&e[n]?o[n]=function(t,n){return function(){var r=this,o=r._super;r._super=e[t];var i=n.apply(r,arguments);return r._super=o,i}}(n,t):o[n]=t})),n.prototype=o,n.constructor=n,n.extend=d_,n};var k_,O_=Math.min,__=Math.max,T_=Math.round,E_={serialize:function(t){var e=JSON.stringify(t);return d(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},parse:function(t){try{return JSON.parse(t)}catch(t){}}},A_={callbacks:{},count:0,send:function(t){var e=this,n=oa.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},D_=Dt(Dt({},AO),{send:function(t){var e,n=0,r=function(){!t.async||4===e.readyState||n++>1e4?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,n>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):$r.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",D_.fire("beforeInitialize",{settings:t}),(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&ve.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=D_.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();$r.setTimeout(r,10)}}),M_=ve.extend,R_=function(){function t(t){this.settings=M_({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=M_(this.settings,t);r.success=function(t,o){void 0===(t=E_.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=E_.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",D_.send(r)},t}();try{var N_="__storage_test__";(k_=window.localStorage).setItem(N_,N_),k_.removeItem(N_)}catch(t){k_=function(){var t={},e=[],n={getItem:function(e){var n=t[e];return n||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter((function(t){return t===n})),delete t[n]},clear:function(){e=[],t={}},length:0};return Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n}()}var z_={geom:{Rect:y_},util:{Promise:Ur,Delay:$r,Tools:ve,VK:Gf,URI:Em,Class:S_,EventDispatcher:TO,Observable:AO,I18n:ma,XHR:D_,JSON:E_,JSONRequest:R_,JSONP:A_,LocalStorage:k_,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=__(0,O_(e,1)),i=__(0,O_(i,1)),0!==e){var u=t/60,a=i*e,c=a*(1-Math.abs(u%2-1)),s=i-a;switch(Math.floor(u)){case 0:n=a,r=c,o=0;break;case 1:n=c,r=a,o=0;break;case 2:n=0,r=a,o=c;break;case 3:n=0,r=c,o=a;break;case 4:n=c,r=0,o=a;break;case 5:n=a,r=0,o=c;break;default:n=r=o=0}n=T_(255*(n+s)),r=T_(255*(r+s)),o=T_(255*(o+s))}else n=r=o=T_(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return function(t,e,n){var r,o;o=0;var i=O_(t/=255,O_(e/=255,n/=255)),u=__(t,__(e,n));return i===u?{h:0,s:0,v:100*(o=i)}:(r=(u-i)/u,o=u,{h:T_(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(u-i))),s:T_(100*r),v:T_(100*o)})}(n,r,o)},e.toHex=function(){var t=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e},ImageUploader:function(t){var e=py(),n=xy(t,e);return{upload:function(e,r){return void 0===r&&(r=!0),n.upload(e,r?wy(t):void 0)}}}},dom:{EventUtils:Di,Sizzle:fu,DomQuery:Ju,TreeWalker:Yr,TextSeeker:Va,DOMUtils:oa,ScriptLoader:ca,RangeUtils:sd,Serializer:vb,StyleSheetLoader:Xr,ControlSelection:Xf,BookmarkManager:Ff,Selection:Xv,Event:Di.Event},html:{Styles:xi,Entities:ai,Node:wm,Schema:yi,SaxParser:Nm,DomParser:db,Writer:Fm,Serializer:Vm},Env:de,AddOnManager:ga,Annotator:Hf,Formatter:Ay,UndoManager:My,EditorCommands:bO,WindowManager:uy,NotificationManager:ry,EditorObservable:zO,Shortcuts:UO,Editor:YO,FocusManager:Yd,EditorManager:s_,DOM:oa.DOM,ScriptLoader:ca.ScriptLoader,PluginManager:oy,ThemeManager:iy,IconManager:Xb,Resource:w_,trim:ve.trim,isArray:ve.isArray,is:ve.is,toArray:ve.toArray,makeMap:ve.makeMap,each:ve.each,map:ve.map,grep:ve.grep,inArray:ve.inArray,extend:ve.extend,create:ve.create,walk:ve.walk,createNS:ve.createNS,resolve:ve.resolve,explode:ve.explode,_addCacheSuffix:ve._addCacheSuffix,isOpera:de.opera,isWebKit:de.webkit,isIE:de.ie,isGecko:de.gecko,isMac:de.mac},B_=ve.extend(s_,z_);!function(t){window.tinymce=t,window.tinyMCE=t}(B_),function(e){try{t.exports=e}catch(t){}}(B_)}()}).call(this,n(31))},320:function(t,e,n){n(583)},321:function(t,e,n){n(584)},322:function(t,e,n){n(585)},323:function(t,e,n){n(586)},324:function(t,e,n){n(587)},325:function(t,e,n){n(588)},326:function(t,e,n){n(589)},327:function(t,e,n){n(590)},328:function(t,e,n){n(591)},329:function(t,e,n){n(592)},330:function(t,e,n){n(593)},331:function(t,e,n){n(594)},332:function(t,e,n){n(595)},354:function(t,e,n){"use strict";(function(e){var r=n(355),o=n(356),i=n(357);t.exports=function(t){var n,a,c=[],s=1;if("string"==typeof t)if(r[t])c=r[t].slice(),a="rgb";else if("transparent"===t)s=0,a="rgb",c=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var l=(m=t.slice(1)).length;s=1,l<=4?(c=[parseInt(m[0]+m[0],16),parseInt(m[1]+m[1],16),parseInt(m[2]+m[2],16)],4===l&&(s=parseInt(m[3]+m[3],16)/255)):(c=[parseInt(m[0]+m[1],16),parseInt(m[2]+m[3],16),parseInt(m[4]+m[5],16)],8===l&&(s=parseInt(m[6]+m[7],16)/255)),c[0]||(c[0]=0),c[1]||(c[1]=0),c[2]||(c[2]=0),a="rgb"}else if(n=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=n[1],d="rgb"===f,m=f.replace(/a$/,"");a=m;l="cmyk"===m?4:"gray"===m?1:3;c=n[2].trim().split(/\s*,\s*/).map((function(t,e){if(/%$/.test(t))return e===l?parseFloat(t)/100:"rgb"===m?255*parseFloat(t)/100:parseFloat(t);if("h"===m[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==u[t])return u[t]}return parseFloat(t)})),f===m&&c.push(1),s=d?1:void 0===c[l]?1:c[l],c=c.slice(0,l)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(c=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),a=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(o(t)){var g=i(t.r,t.red,t.R,null);null!==g?(a="rgb",c=[g,i(t.g,t.green,t.G),i(t.b,t.blue,t.B)]):(a="hsl",c=[i(t.h,t.hue,t.H),i(t.s,t.saturation,t.S),i(t.l,t.lightness,t.L,t.b,t.brightness)]),s=i(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(s/=100)}else(Array.isArray(t)||e.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(c=[t[0],t[1],t[2]],a="rgb",s=4===t.length?t[3]:1);else a="rgb",c=[t>>>16,(65280&t)>>>8,255&t];return{space:a,values:c,alpha:s}};var u={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,n(31))},355:function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},356:function(t,e,n){"use strict";var r=Object.prototype.toString;t.exports=function(t){var e;return"[object Object]"===r.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},357:function(t,e){t.exports=function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}},358:function(t,e,n){"use strict";var r=n(359);t.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,n,r,o,i,u=t[0]/360,a=t[1]/100,c=t[2]/100;if(0===a)return[i=255*c,i,i];e=2*c-(n=c<.5?c*(1+a):c+a-c*a),o=[0,0,0];for(var s=0;s<3;s++)(r=u+1/3*-(s-1))<0?r++:r>1&&r--,i=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,o[s]=255*i;return o}},r.hsl=function(t){var e,n,r=t[0]/255,o=t[1]/255,i=t[2]/255,u=Math.min(r,o,i),a=Math.max(r,o,i),c=a-u;return a===u?e=0:r===a?e=(o-i)/c:o===a?e=2+(i-r)/c:i===a&&(e=4+(r-o)/c),(e=Math.min(60*e,360))<0&&(e+=360),n=(u+a)/2,[e,100*(a===u?0:n<=.5?c/(a+u):c/(2-a-u)),100*n]}},359:function(t,e,n){"use strict";t.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},48:function(t,e,n){"use strict";n.r(e);var r="top",o="bottom",i="right",u="left",a=[r,o,i,u],c=a.reduce((function(t,e){return t.concat([e+"-start",e+"-end"])}),[]),s=[].concat(a,["auto"]).reduce((function(t,e){return t.concat([e,e+"-start",e+"-end"])}),[]),l=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function f(t){return t?(t.nodeName||"").toLowerCase():null}function d(t){if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function m(t){return t instanceof d(t).Element||t instanceof Element}function g(t){return t instanceof d(t).HTMLElement||t instanceof HTMLElement}var h={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},o=e.elements[t];g(o)&&f(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(t){var e=r[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var r=e.elements[t],o=e.attributes[t]||{},i=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});g(r)&&f(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]};function p(t){return t.split("-")[0]}function v(t){return{x:t.offsetLeft,y:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}}function b(t,e){var n,r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&((n=r)instanceof d(n).ShadowRoot||n instanceof ShadowRoot)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function y(t){return d(t).getComputedStyle(t)}function w(t){return["table","td","th"].indexOf(f(t))>=0}function x(t){return((m(t)?t.ownerDocument:t.document)||window.document).documentElement}function C(t){return"html"===f(t)?t:t.assignedSlot||t.parentNode||t.host||x(t)}function S(t){if(!g(t)||"fixed"===y(t).position)return null;var e=t.offsetParent;if(e){var n=x(e);if("body"===f(e)&&"static"===y(e).position&&"static"!==y(n).position)return n}return e}function k(t){for(var e=d(t),n=S(t);n&&w(n)&&"static"===y(n).position;)n=S(n);return n&&"body"===f(n)&&"static"===y(n).position?e:n||function(t){for(var e=C(t);g(e)&&["html","body"].indexOf(f(e))<0;){var n=y(e);if("none"!==n.transform||"none"!==n.perspective||n.willChange&&"auto"!==n.willChange)return e;e=e.parentNode}return null}(t)||e}function O(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function _(t,e,n){return Math.max(t,Math.min(e,n))}function T(t){return Object.assign(Object.assign({},{top:0,right:0,bottom:0,left:0}),t)}function E(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}var A={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,a=t.name,c=n.elements.arrow,s=n.modifiersData.popperOffsets,l=p(n.placement),f=O(l),d=[u,i].indexOf(l)>=0?"height":"width";if(c&&s){var m=n.modifiersData[a+"#persistent"].padding,g=v(c),h="y"===f?r:u,b="y"===f?o:i,y=n.rects.reference[d]+n.rects.reference[f]-s[f]-n.rects.popper[d],w=s[f]-n.rects.reference[f],x=k(c),C=x?"y"===f?x.clientHeight||0:x.clientWidth||0:0,S=y/2-w/2,T=m[h],E=C-g[d]-m[b],A=C/2-g[d]/2+S,D=_(T,A,E),M=f;n.modifiersData[a]=((e={})[M]=D,e.centerOffset=D-A,e)}},effect:function(t){var e=t.state,n=t.options,r=t.name,o=n.element,i=void 0===o?"[data-popper-arrow]":o,u=n.padding,c=void 0===u?0:u;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&b(e.elements.popper,i)&&(e.elements.arrow=i,e.modifiersData[r+"#persistent"]={padding:T("number"!=typeof c?c:E(c,a))})},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},D={top:"auto",right:"auto",bottom:"auto",left:"auto"};function M(t){var e,n=t.popper,a=t.popperRect,c=t.placement,s=t.offsets,l=t.position,f=t.gpuAcceleration,m=t.adaptive,g=t.roundOffsets?function(t){var e=t.x,n=t.y,r=window.devicePixelRatio||1;return{x:Math.round(e*r)/r||0,y:Math.round(n*r)/r||0}}(s):s,h=g.x,p=void 0===h?0:h,v=g.y,b=void 0===v?0:v,y=s.hasOwnProperty("x"),w=s.hasOwnProperty("y"),C=u,S=r,O=window;if(m){var _=k(n);_===d(n)&&(_=x(n)),c===r&&(S=o,b-=_.clientHeight-a.height,b*=f?1:-1),c===u&&(C=i,p-=_.clientWidth-a.width,p*=f?1:-1)}var T,E=Object.assign({position:l},m&&D);return f?Object.assign(Object.assign({},E),{},((T={})[S]=w?"0":"",T[C]=y?"0":"",T.transform=(O.devicePixelRatio||1)<2?"translate("+p+"px, "+b+"px)":"translate3d("+p+"px, "+b+"px, 0)",T)):Object.assign(Object.assign({},E),{},((e={})[S]=w?b+"px":"",e[C]=y?p+"px":"",e.transform="",e))}var R={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,u=void 0===i||i,a=n.roundOffsets,c=void 0===a||a,s={placement:p(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign(Object.assign({},e.styles.popper),M(Object.assign(Object.assign({},s),{},{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:u,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign(Object.assign({},e.styles.arrow),M(Object.assign(Object.assign({},s),{},{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign(Object.assign({},e.attributes.popper),{},{"data-popper-placement":e.placement})},data:{}},N={passive:!0};var z={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=void 0===o||o,u=r.resize,a=void 0===u||u,c=d(e.elements.popper),s=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&s.forEach((function(t){t.addEventListener("scroll",n.update,N)})),a&&c.addEventListener("resize",n.update,N),function(){i&&s.forEach((function(t){t.removeEventListener("scroll",n.update,N)})),a&&c.removeEventListener("resize",n.update,N)}},data:{}},B={left:"right",right:"left",bottom:"top",top:"bottom"};function P(t){return t.replace(/left|right|bottom|top/g,(function(t){return B[t]}))}var I={start:"end",end:"start"};function L(t){return t.replace(/start|end/g,(function(t){return I[t]}))}function H(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function F(t){var e=d(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function V(t){return H(x(t)).left+F(t).scrollLeft}function j(t){var e=y(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function U(t,e){void 0===e&&(e=[]);var n=function t(e){return["html","body","#document"].indexOf(f(e))>=0?e.ownerDocument.body:g(e)&&j(e)?e:t(C(e))}(t),r="body"===f(n),o=d(n),i=r?[o].concat(o.visualViewport||[],j(n)?n:[]):n,u=e.concat(i);return r?u:u.concat(U(C(i)))}function W(t){return Object.assign(Object.assign({},t),{},{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function q(t,e){return"viewport"===e?W(function(t){var e=d(t),n=x(t),r=e.visualViewport,o=n.clientWidth,i=n.clientHeight,u=0,a=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(u=r.offsetLeft,a=r.offsetTop)),{width:o,height:i,x:u+V(t),y:a}}(t)):g(e)?function(t){var e=H(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):W(function(t){var e=x(t),n=F(t),r=t.ownerDocument.body,o=Math.max(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),i=Math.max(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),u=-n.scrollLeft+V(t),a=-n.scrollTop;return"rtl"===y(r||e).direction&&(u+=Math.max(e.clientWidth,r?r.clientWidth:0)-o),{width:o,height:i,x:u,y:a}}(x(t)))}function G(t,e,n){var r="clippingParents"===e?function(t){var e=U(C(t)),n=["absolute","fixed"].indexOf(y(t).position)>=0&&g(t)?k(t):t;return m(n)?e.filter((function(t){return m(t)&&b(t,n)&&"body"!==f(t)})):[]}(t):[].concat(e),o=[].concat(r,[n]),i=o[0],u=o.reduce((function(e,n){var r=q(t,n);return e.top=Math.max(r.top,e.top),e.right=Math.min(r.right,e.right),e.bottom=Math.min(r.bottom,e.bottom),e.left=Math.max(r.left,e.left),e}),q(t,i));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function $(t){return t.split("-")[1]}function X(t){var e,n=t.reference,a=t.element,c=t.placement,s=c?p(c):null,l=c?$(c):null,f=n.x+n.width/2-a.width/2,d=n.y+n.height/2-a.height/2;switch(s){case r:e={x:f,y:n.y-a.height};break;case o:e={x:f,y:n.y+n.height};break;case i:e={x:n.x+n.width,y:d};break;case u:e={x:n.x-a.width,y:d};break;default:e={x:n.x,y:n.y}}var m=s?O(s):null;if(null!=m){var g="y"===m?"height":"width";switch(l){case"start":e[m]=e[m]-(n[g]/2-a[g]/2);break;case"end":e[m]=e[m]+(n[g]/2-a[g]/2)}}return e}function K(t,e){void 0===e&&(e={});var n=e,u=n.placement,c=void 0===u?t.placement:u,s=n.boundary,l=void 0===s?"clippingParents":s,f=n.rootBoundary,d=void 0===f?"viewport":f,g=n.elementContext,h=void 0===g?"popper":g,p=n.altBoundary,v=void 0!==p&&p,b=n.padding,y=void 0===b?0:b,w=T("number"!=typeof y?y:E(y,a)),C="popper"===h?"reference":"popper",S=t.elements.reference,k=t.rects.popper,O=t.elements[v?C:h],_=G(m(O)?O:O.contextElement||x(t.elements.popper),l,d),A=H(S),D=X({reference:A,element:k,strategy:"absolute",placement:c}),M=W(Object.assign(Object.assign({},k),D)),R="popper"===h?M:A,N={top:_.top-R.top+w.top,bottom:R.bottom-_.bottom+w.bottom,left:_.left-R.left+w.left,right:R.right-_.right+w.right},z=t.modifiersData.offset;if("popper"===h&&z){var B=z[c];Object.keys(N).forEach((function(t){var e=[i,o].indexOf(t)>=0?1:-1,n=[r,o].indexOf(t)>=0?"y":"x";N[t]+=B[n]*e}))}return N}var Y={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,l=t.name;if(!e.modifiersData[l]._skip){for(var f=n.mainAxis,d=void 0===f||f,m=n.altAxis,g=void 0===m||m,h=n.fallbackPlacements,v=n.padding,b=n.boundary,y=n.rootBoundary,w=n.altBoundary,x=n.flipVariations,C=void 0===x||x,S=n.allowedAutoPlacements,k=e.options.placement,O=p(k),_=h||(O===k||!C?[P(k)]:function(t){if("auto"===p(t))return[];var e=P(t);return[L(t),e,L(e)]}(k)),T=[k].concat(_).reduce((function(t,n){return t.concat("auto"===p(n)?function(t,e){void 0===e&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,u=n.padding,l=n.flipVariations,f=n.allowedAutoPlacements,d=void 0===f?s:f,m=$(r),g=m?l?c:c.filter((function(t){return $(t)===m})):a,h=g.filter((function(t){return d.indexOf(t)>=0}));0===h.length&&(h=g);var v=h.reduce((function(e,n){return e[n]=K(t,{placement:n,boundary:o,rootBoundary:i,padding:u})[p(n)],e}),{});return Object.keys(v).sort((function(t,e){return v[t]-v[e]}))}(e,{placement:n,boundary:b,rootBoundary:y,padding:v,flipVariations:C,allowedAutoPlacements:S}):n)}),[]),E=e.rects.reference,A=e.rects.popper,D=new Map,M=!0,R=T[0],N=0;N<T.length;N++){var z=T[N],B=p(z),I="start"===$(z),H=[r,o].indexOf(B)>=0,F=H?"width":"height",V=K(e,{placement:z,boundary:b,rootBoundary:y,altBoundary:w,padding:v}),j=H?I?i:u:I?o:r;E[F]>A[F]&&(j=P(j));var U=P(j),W=[];if(d&&W.push(V[B]<=0),g&&W.push(V[j]<=0,V[U]<=0),W.every((function(t){return t}))){R=z,M=!1;break}D.set(z,W)}if(M)for(var q=function(t){var e=T.find((function(e){var n=D.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return R=e,"break"},G=C?3:1;G>0;G--){if("break"===q(G))break}e.placement!==R&&(e.modifiersData[l]._skip=!0,e.placement=R,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function J(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Q(t){return[r,i,o,u].some((function(e){return t[e]>=0}))}var Z={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,u=K(e,{elementContext:"reference"}),a=K(e,{altBoundary:!0}),c=J(u,r),s=J(a,o,i),l=Q(c),f=Q(s);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:s,isReferenceHidden:l,hasPopperEscaped:f},e.attributes.popper=Object.assign(Object.assign({},e.attributes.popper),{},{"data-popper-reference-hidden":l,"data-popper-escaped":f})}};var tt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,o=t.name,a=n.offset,c=void 0===a?[0,0]:a,l=s.reduce((function(t,n){return t[n]=function(t,e,n){var o=p(t),a=[u,r].indexOf(o)>=0?-1:1,c="function"==typeof n?n(Object.assign(Object.assign({},e),{},{placement:t})):n,s=c[0],l=c[1];return s=s||0,l=(l||0)*a,[u,i].indexOf(o)>=0?{x:l,y:s}:{x:s,y:l}}(n,e.rects,c),t}),{}),f=l[e.placement],d=f.x,m=f.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=m),e.modifiersData[o]=l}};var et={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=X({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};var nt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,a=t.name,c=n.mainAxis,s=void 0===c||c,l=n.altAxis,f=void 0!==l&&l,d=n.boundary,m=n.rootBoundary,g=n.altBoundary,h=n.padding,b=n.tether,y=void 0===b||b,w=n.tetherOffset,x=void 0===w?0:w,C=K(e,{boundary:d,rootBoundary:m,padding:h,altBoundary:g}),S=p(e.placement),T=$(e.placement),E=!T,A=O(S),D="x"===A?"y":"x",M=e.modifiersData.popperOffsets,R=e.rects.reference,N=e.rects.popper,z="function"==typeof x?x(Object.assign(Object.assign({},e.rects),{},{placement:e.placement})):x,B={x:0,y:0};if(M){if(s){var P="y"===A?r:u,I="y"===A?o:i,L="y"===A?"height":"width",H=M[A],F=M[A]+C[P],V=M[A]-C[I],j=y?-N[L]/2:0,U="start"===T?R[L]:N[L],W="start"===T?-N[L]:-R[L],q=e.elements.arrow,G=y&&q?v(q):{width:0,height:0},X=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Y=X[P],J=X[I],Q=_(0,R[L],G[L]),Z=E?R[L]/2-j-Q-Y-z:U-Q-Y-z,tt=E?-R[L]/2+j+Q+J+z:W+Q+J+z,et=e.elements.arrow&&k(e.elements.arrow),nt=et?"y"===A?et.clientTop||0:et.clientLeft||0:0,rt=e.modifiersData.offset?e.modifiersData.offset[e.placement][A]:0,ot=M[A]+Z-rt-nt,it=M[A]+tt-rt,ut=_(y?Math.min(F,ot):F,H,y?Math.max(V,it):V);M[A]=ut,B[A]=ut-H}if(f){var at="x"===A?r:u,ct="x"===A?o:i,st=M[D],lt=_(st+C[at],st,st-C[ct]);M[D]=lt,B[D]=lt-st}e.modifiersData[a]=B}},requiresIfExists:["offset"]};function rt(t,e,n){void 0===n&&(n=!1);var r,o,i=x(e),u=H(t),a=g(e),c={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(a||!a&&!n)&&(("body"!==f(e)||j(i))&&(c=(r=e)!==d(r)&&g(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:F(r)),g(e)?((s=H(e)).x+=e.clientLeft,s.y+=e.clientTop):i&&(s.x=V(i))),{x:u.left+c.scrollLeft-s.x,y:u.top+c.scrollTop-s.y,width:u.width,height:u.height}}function ot(t){var e=new Map,n=new Set,r=[];return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||function t(o){n.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var o=e.get(r);o&&t(o)}})),r.push(o)}(t)})),r}var it={placement:"bottom",modifiers:[],strategy:"absolute"};function ut(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function at(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,r=void 0===n?[]:n,o=e.defaultOptions,i=void 0===o?it:o;return function(t,e,n){void 0===n&&(n=i);var o,u,a={placement:"bottom",orderedModifiers:[],options:Object.assign(Object.assign({},it),i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},c=[],s=!1,f={state:a,setOptions:function(n){d(),a.options=Object.assign(Object.assign(Object.assign({},i),a.options),n),a.scrollParents={reference:m(t)?U(t):t.contextElement?U(t.contextElement):[],popper:U(e)};var o=function(t){var e=ot(t);return l.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}(function(t){var e=t.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign(Object.assign(Object.assign({},n),e),{},{options:Object.assign(Object.assign({},n.options),e.options),data:Object.assign(Object.assign({},n.data),e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}([].concat(r,a.options.modifiers)));return a.orderedModifiers=o.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,r=void 0===n?{}:n,o=t.effect;if("function"==typeof o){var i=o({state:a,name:e,instance:f,options:r});c.push(i||function(){})}})),f.update()},forceUpdate:function(){if(!s){var t=a.elements,e=t.reference,n=t.popper;if(ut(e,n)){a.rects={reference:rt(e,k(n),"fixed"===a.options.strategy),popper:v(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var o=a.orderedModifiers[r],i=o.fn,u=o.options,c=void 0===u?{}:u,l=o.name;"function"==typeof i&&(a=i({state:a,options:c,name:l,instance:f})||a)}else a.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(t){f.forceUpdate(),t(a)}))},function(){return u||(u=new Promise((function(t){Promise.resolve().then((function(){u=void 0,t(o())}))}))),u}),destroy:function(){d(),s=!0}};if(!ut(t,e))return f;function d(){c.forEach((function(t){return t()})),c=[]}return f.setOptions(n).then((function(t){!s&&n.onFirstUpdate&&n.onFirstUpdate(t)})),f}}var ct=at(),st=at({defaultModifiers:[z,et,R,h,tt,Y,nt,A,Z]}),lt=at({defaultModifiers:[z,et,R,h]});n.d(e,"top",(function(){return r})),n.d(e,"bottom",(function(){return o})),n.d(e,"right",(function(){return i})),n.d(e,"left",(function(){return u})),n.d(e,"auto",(function(){return"auto"})),n.d(e,"basePlacements",(function(){return a})),n.d(e,"start",(function(){return"start"})),n.d(e,"end",(function(){return"end"})),n.d(e,"clippingParents",(function(){return"clippingParents"})),n.d(e,"viewport",(function(){return"viewport"})),n.d(e,"popper",(function(){return"popper"})),n.d(e,"reference",(function(){return"reference"})),n.d(e,"variationPlacements",(function(){return c})),n.d(e,"placements",(function(){return s})),n.d(e,"beforeRead",(function(){return"beforeRead"})),n.d(e,"read",(function(){return"read"})),n.d(e,"afterRead",(function(){return"afterRead"})),n.d(e,"beforeMain",(function(){return"beforeMain"})),n.d(e,"main",(function(){return"main"})),n.d(e,"afterMain",(function(){return"afterMain"})),n.d(e,"beforeWrite",(function(){return"beforeWrite"})),n.d(e,"write",(function(){return"write"})),n.d(e,"afterWrite",(function(){return"afterWrite"})),n.d(e,"modifierPhases",(function(){return l})),n.d(e,"applyStyles",(function(){return h})),n.d(e,"arrow",(function(){return A})),n.d(e,"computeStyles",(function(){return R})),n.d(e,"eventListeners",(function(){return z})),n.d(e,"flip",(function(){return Y})),n.d(e,"hide",(function(){return Z})),n.d(e,"offset",(function(){return tt})),n.d(e,"popperOffsets",(function(){return et})),n.d(e,"preventOverflow",(function(){return nt})),n.d(e,"popperGenerator",(function(){return at})),n.d(e,"detectOverflow",(function(){return K})),n.d(e,"createPopperBase",(function(){return ct})),n.d(e,"createPopper",(function(){return st})),n.d(e,"createPopperLite",(function(){return lt}))},583:function(t,e,n){(function(t){!function(){"use strict";var e=function(t){return function(e){return function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(e)===t}},n=function(t){return function(e){return typeof e===t}},r=function(t){return function(e){return t===e}},o=e("string"),i=e("object"),u=e("array"),a=r(null),c=n("boolean"),s=r(void 0),l=function(t){return null==t},f=function(t){return!l(t)},d=n("function"),m=n("number"),g=function(t,e){if(u(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},h=function(){},p=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},v=function(t){return function(){return t}},b=function(t){return t},y=function(t,e){return t===e};function w(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var x=function(t){return function(e){return!t(e)}},C=function(t){return function(){throw new Error(t)}},S=v(!1),k=v(!0),O=tinymce.util.Tools.resolve("tinymce.ThemeManager"),_=function(){return(_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function T(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function E(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var A,D,M=function(){return R},R={fold:function(t,e){return t()},isSome:S,isNone:k,getOr:D=b,getOrThunk:A=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:v(null),getOrUndefined:v(void 0),or:D,orThunk:A,map:M,each:h,bind:M,exists:S,forall:k,filter:function(){return M()},toArray:function(){return[]},toString:v("none()")},N=function(t){var e=v(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:k,isNone:S,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return N(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:R},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},z={some:N,none:M,from:function(t){return null==t?R:N(t)}},B=Array.prototype.slice,P=Array.prototype.indexOf,I=Array.prototype.push,L=function(t,e){return P.call(t,e)},H=function(t,e){return L(t,e)>-1},F=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},V=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},j=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=B.call(t,r,r+e);n.push(o)}return n},U=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},W=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},q=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},G=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},$=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}}(t,(function(t,r){n=e(n,t,r)})),n},X=function(t,e,n){return W(t,(function(t,r){n=e(n,t,r)})),n},K=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return z.some(i);if(n(i,r))break}return z.none()}(t,e,S)},Y=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return z.some(n)}return z.none()},J=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!u(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);I.apply(e,t[n])}return e},Q=function(t,e){return J(U(t,e))},Z=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},tt=function(t){var e=B.call(t,0);return e.reverse(),e},et=function(t,e){return G(t,(function(t){return!H(e,t)}))},nt=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},rt=function(t){return[t]},ot=function(t,e){var n=B.call(t,0);return n.sort(e),n},it=function(t,e){return e>=0&&e<t.length?z.some(t[e]):z.none()},ut=function(t){return it(t,0)},at=function(t){return it(t,t.length-1)},ct=d(Array.from)?Array.from:function(t){return B.call(t)},st=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return z.none()},lt=Object.keys,ft=Object.hasOwnProperty,dt=function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},mt=function(t,e){return gt(t,(function(t,n){return{k:n,v:e(t,n)}}))},gt=function(t,e){var n={};return dt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},ht=function(t,e){var n={};return function(t,e,n,r){dt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),h),n},pt=function(t,e){var n=[];return dt(t,(function(t,r){n.push(e(t,r))})),n},vt=function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];if(e(u,i,t))return z.some(u)}return z.none()},bt=function(t){return pt(t,b)},yt=function(t,e){return wt(t,e)?z.from(t[e]):z.none()},wt=function(t,e){return ft.call(t,e)},xt=function(t,e){return wt(t,e)&&void 0!==t[e]&&null!==t[e]},Ct=function(t,e,n){return void 0===n&&(n=y),t.exists((function(t){return n(t,e)}))},St=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},kt=function(t,e,n){return t.isSome()&&e.isSome()?z.some(n(t.getOrDie(),e.getOrDie())):z.none()},Ot=function(t,e){return t?z.some(e):z.none()},_t=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},Tt=function(t,e){return-1!==t.indexOf(e)},Et=function(t,e){return _t(t,e,0)},At=function(t,e){return _t(t,e,t.length-e.length)},Dt=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),Mt=function(t){return t.length>0},Rt=function(t){return void 0!==t.style&&d(t.style.getPropertyValue)},Nt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},zt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Nt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Nt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Nt(n)},fromDom:Nt,fromPoint:function(t,e,n){return z.from(t.dom.elementFromPoint(e,n)).map(Nt)}};"undefined"!=typeof window?window:Function("return this;")();var Bt,Pt=function(t){return t.dom.nodeName.toLowerCase()},It=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},Lt=It(1),Ht=It(3),Ft=It(9),Vt=It(11),jt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Ut=function(){return Wt(0,0)},Wt=function(t,e){return{major:t,minor:e}},qt={nu:Wt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Ut():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Wt(r(1),r(2))}(t,n)},unknown:Ut},Gt=function(t,e){var n=String(e).toLowerCase();return K(t,(function(t){return t.search(n)}))},$t=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Xt=function(t){return function(e){return Tt(e,t)}},Kt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Tt(t,"edge/")&&Tt(t,"chrome")&&Tt(t,"safari")&&Tt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,$t],search:function(t){return Tt(t,"chrome")&&!Tt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Tt(t,"msie")||Tt(t,"trident")}},{name:"Opera",versionRegexes:[$t,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Xt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Xt("firefox")},{name:"Safari",versionRegexes:[$t,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Tt(t,"safari")||Tt(t,"mobile/"))&&Tt(t,"applewebkit")}}],Yt=[{name:"Windows",search:Xt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Tt(t,"iphone")||Tt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Xt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Xt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Xt("linux"),versionRegexes:[]},{name:"Solaris",search:Xt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Xt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Xt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Jt={browsers:v(Kt),oses:v(Yt)},Qt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},Zt={unknown:function(){return Qt({current:void 0,version:qt.unknown()})},nu:Qt,edge:v("Edge"),chrome:v("Chrome"),ie:v("IE"),opera:v("Opera"),firefox:v("Firefox"),safari:v("Safari")},te=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},ee={unknown:function(){return te({current:void 0,version:qt.unknown()})},nu:te,windows:v("Windows"),ios:v("iOS"),android:v("Android"),linux:v("Linux"),osx:v("OSX"),solaris:v("Solaris"),freebsd:v("FreeBSD"),chromeos:v("ChromeOS")},ne=function(t,e,n){var r=Jt.browsers(),o=Jt.oses(),i=e.bind((function(t){return function(t,e){return st(e.brands,(function(e){var n=e.brand.toLowerCase();return K(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:qt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return Gt(t,e).map((function(t){var n=qt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(Zt.unknown,Zt.nu),u=function(t,e){return Gt(t,e).map((function(t){var n=qt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(ee.unknown,ee.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:v(o),isiPhone:v(i),isTablet:v(c),isPhone:v(s),isTouch:v(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:v(l),isDesktop:v(f)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}},re=function(t){return window.matchMedia(t).matches},oe=jt((function(){return ne(navigator.userAgent,z.from(navigator.userAgentData),re)})),ie=function(){return oe()},ue=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},ae=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},ce=function(t,e){return t.dom===e.dom},se=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)}(t.dom,e.dom)},le=function(t,e){return ie().browser.isIE()?se(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},fe=function(t){return zt.fromDom(t.dom.ownerDocument)},de=function(t){return Ft(t)?t:fe(t)},me=function(t){return zt.fromDom(de(t).dom.documentElement)},ge=function(t){return zt.fromDom(de(t).dom.defaultView)},he=function(t){return z.from(t.dom.parentNode).map(zt.fromDom)},pe=function(t){return z.from(t.dom.offsetParent).map(zt.fromDom)},ve=function(t){return U(t.dom.childNodes,zt.fromDom)},be=function(t,e){var n=t.dom.childNodes;return z.from(n[e]).map(zt.fromDom)},ye=function(t,e){return{element:t,offset:e}},we=function(t,e){var n=ve(t);return n.length>0&&e<n.length?ye(n[e],0):ye(t,e)},xe=function(t){return Vt(t)&&f(t.dom.host)},Ce=d(Element.prototype.attachShadow)&&d(Node.prototype.getRootNode),Se=v(Ce),ke=Ce?function(t){return zt.fromDom(t.dom.getRootNode())}:de,Oe=function(t){return xe(t)?t:zt.fromDom(de(t).dom.body)},_e=function(t){var e=ke(t);return xe(e)?z.some(e):z.none()},Te=function(t){return zt.fromDom(t.dom.host)},Ee=function(t){return f(t.dom.shadowRoot)},Ae=function(t){var e=Ht(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return _e(zt.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=Ae,r=Te,function(t){return n(r(t))}))},De=function(){return Me(zt.fromDom(document))},Me=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return zt.fromDom(e)},Re=function(t,e,n){if(!(o(n)||c(n)||m(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Ne=function(t,e,n){Re(t.dom,e,n)},ze=function(t,e){var n=t.dom;dt(e,(function(t,e){Re(n,e,t)}))},Be=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Pe=function(t,e){return z.from(Be(t,e))},Ie=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Le=function(t,e){t.dom.removeAttribute(e)},He=function(t,e,n){if(!o(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Rt(t)&&t.style.setProperty(e,n)},Fe=function(t,e){Rt(t)&&t.style.removeProperty(e)},Ve=function(t,e,n){var r=t.dom;He(r,e,n)},je=function(t,e){var n=t.dom;dt(e,(function(t,e){He(n,e,t)}))},Ue=function(t,e){var n=t.dom;dt(e,(function(t,e){t.fold((function(){Fe(n,e)}),(function(t){He(n,e,t)}))}))},We=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Ae(t)?r:qe(n,e)},qe=function(t,e){return Rt(t)?t.style.getPropertyValue(e):""},Ge=function(t,e){var n=t.dom,r=qe(n,e);return z.from(r).filter((function(t){return t.length>0}))},$e=function(t){var e={},n=t.dom;if(Rt(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},Xe=function(t,e,n){var r=zt.fromTag(t);return Ve(r,e,n),Ge(r,e).isSome()},Ke=function(t,e){var n=t.dom;Fe(n,e),Ct(Pe(t,"style").map(Dt),"")&&Le(t,"style")},Ye=function(t){return t.dom.offsetWidth},Je=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=We(n,t);return parseFloat(o)||0}return r},r=function(t,e){return X(e,(function(e,n){var r=We(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!m(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Rt(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},Qe=Je("height",(function(t){var e=t.dom;return Ae(t)?e.getBoundingClientRect().height:e.offsetHeight})),Ze=function(t){return Qe.get(t)},tn=function(t){return Qe.getOuter(t)},en=function(t,e){return{left:t,top:e,translate:function(n,r){return en(t+n,e+r)}}},nn=en,rn=function(t,e){return void 0!==t?t:void 0!==e?e:0},on=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return nn(n.offsetLeft,n.offsetTop);var i=rn(null==r?void 0:r.pageYOffset,o.scrollTop),u=rn(null==r?void 0:r.pageXOffset,o.scrollLeft),a=rn(o.clientTop,n.clientTop),c=rn(o.clientLeft,n.clientLeft);return un(t).translate(u-c,i-a)},un=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?nn(n.offsetLeft,n.offsetTop):Ae(t)?function(t){var e=t.getBoundingClientRect();return nn(e.left,e.top)}(e):nn(0,0)},an=Je("width",(function(t){return t.dom.offsetWidth})),cn=function(t){return an.get(t)},sn=function(t){return an.getOuter(t)},ln=function(t){var e=zt.fromDom(function(t){if(Se()&&f(t.target)){var e=zt.fromDom(t.target);if(Lt(e)&&Ee(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return ut(n)}}return z.from(t.target)}(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=p(r,n);return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(e,t.clientX,t.clientY,n,r,o,t)},fn=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(ln(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:w(dn,t,e,i,o)}},dn=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},mn=function(t,e){he(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},gn=function(t,e){(function(t){return z.from(t.dom.nextSibling).map(zt.fromDom)})(t).fold((function(){he(t).each((function(t){pn(t,e)}))}),(function(t){mn(t,e)}))},hn=function(t,e){(function(t){return be(t,0)})(t).fold((function(){pn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},pn=function(t,e){t.dom.appendChild(e.dom)},vn=function(t,e){W(e,(function(e){pn(t,e)}))},bn=function(t){t.dom.textContent="",W(ve(t),(function(t){yn(t)}))},yn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},wn=function(t){var e,n=ve(t);n.length>0&&(e=t,W(n,(function(t){mn(e,t)}))),yn(t)},xn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return nn(n,r)},Cn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},Sn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},kn=function(t){var e=void 0===t?window:t,n=e.document,r=xn(zt.fromDom(n));return function(t){var e=void 0===t?window:t;return ie().browser.isFirefox()?z.none():z.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Sn(r.left,r.top,n,o)}),(function(t){return Sn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},On=function(t,e){return t.view(e).fold(v([]),(function(e){var n=t.owner(e),r=On(t,n);return[e].concat(r)}))},_n=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?z.none():z.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(zt.fromDom)},owner:function(t){return fe(t)}}),Tn=function(t){var e=zt.fromDom(document),n=xn(e);return function(t,e){var n=e.owner(t),r=On(e,n);return z.some(r)}(t,_n).fold(w(on,t),(function(e){var r=un(t),o=$(e,(function(t,e){var n=un(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return nn(o.left+r.left+n.left,o.top+r.top+n.top)}))},En=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},An=function(t){var e=on(t),n=sn(t),r=tn(t);return En(e.left,e.top,n,r)},Dn=function(t){var e=Tn(t),n=sn(t),r=tn(t);return En(e.left,e.top,n,r)},Mn=function(){return kn(window)},Rn=function(t){return{isValue:k,isError:S,getOr:v(t),getOrThunk:v(t),getOrDie:v(t),or:function(e){return Rn(t)},orThunk:function(e){return Rn(t)},fold:function(e,n){return n(t)},map:function(e){return Rn(e(t))},mapError:function(e){return Rn(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return z.some(t)}}},Nn=function(t){return{isValue:S,isError:k,getOr:b,getOrThunk:function(t){return t()},getOrDie:function(){return C(String(t))()},or:b,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Nn(t)},mapError:function(e){return Nn(e(t))},each:h,bind:function(e){return Nn(t)},exists:S,forall:k,toOptional:z.none}},zn={value:Rn,error:Nn,fromOption:function(t,e){return t.fold((function(){return Nn(e)}),Rn)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(Bt||(Bt={}));var Bn=function(t,e,n){return t.stype===Bt.Error?e(t.serror):n(t.svalue)},Pn=function(t){return{stype:Bt.Value,svalue:t}},In=function(t){return{stype:Bt.Error,serror:t}},Ln=function(t){return t.fold(In,Pn)},Hn=function(t){return Bn(t,zn.error,zn.value)},Fn=Pn,Vn=function(t){var e=[],n=[];return W(t,(function(t){Bn(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},jn=In,Un=function(t,e){return t.stype===Bt.Value?e(t.svalue):t},Wn=function(t,e){return t.stype===Bt.Error?e(t.serror):t},qn=function(t,e){return t.stype===Bt.Value?{stype:Bt.Value,svalue:e(t.svalue)}:t},Gn=function(t,e){return t.stype===Bt.Error?{stype:Bt.Error,serror:e(t.serror)}:t},$n=Bn,Xn=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},Kn=function(t,e,n){switch(t.tag){case"field":return e(t.key,t.newKey,t.presence,t.prop);case"custom":return n(t.newKey,t.instantiator)}},Yn=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)wt(i,u)&&(r[u]=t(r[u],i[u]))}return r}},Jn=Yn((function(t,e){return i(t)&&i(e)?Jn(t,e):e})),Qn=Yn((function(t,e){return e})),Zn=function(t){return{tag:"defaultedThunk",process:t}},tr=function(t){return Zn(v(t))},er=function(t){return{tag:"mergeWithThunk",process:t}},nr=function(t){return p(jn,J)(t)},rr=function(t){var e=Vn(t);return e.errors.length>0?nr(e.errors):Fn(e.values)},or=function(t){return i(t)&&lt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},ir=function(t,e){return jn([{path:t,getErrorInfo:e}])},ur=function(t){return{extract:function(e,n){return Wn(t(n),(function(t){return function(t,e){return ir(t,v(e))}(e,t)}))},toString:v("val")}},ar=ur(Fn),cr=function(t,e,n,r){return yt(e,n).fold((function(){return function(t,e,n){return ir(t,(function(){return'Could not find valid *required* value for "'+e+'" in '+or(n)}))}(t,n,e)}),r)},sr=function(t,e,n,r){return r(yt(t,e).getOrThunk((function(){return n(t)})))},lr=function(t,e,n,r,o){var i=function(t){return o.extract(e.concat([r]),t)},u=function(t){return t.fold((function(){return Fn(z.none())}),(function(t){var n=o.extract(e.concat([r]),t);return qn(n,z.some)}))};switch(t.tag){case"required":return cr(e,n,r,i);case"defaultedThunk":return sr(n,r,t.process,i);case"option":return function(t,e,n){return n(yt(t,e))}(n,r,u);case"defaultedOptionThunk":return function(t,e,n,r){return r(yt(t,e).map((function(e){return!0===e?n(t):e})))}(n,r,t.process,u);case"mergeWithThunk":return sr(n,r,v({}),(function(e){var r=Jn(t.process(n),e);return i(r)}))}},fr=function(t){return{extract:function(e,n){return t().extract(e,n)},toString:function(){return t().toString()}}},dr=function(t){return lt(ht(t,f))},mr=function(t){var e=gr(t),n=$(t,(function(t,e){return Kn(e,(function(e){var n;return Jn(t,((n={})[e]=!0,n))}),v(t))}),{});return{extract:function(t,r){var o=c(r)?[]:dr(r),i=G(o,(function(t){return!xt(n,t)}));return 0===i.length?e.extract(t,r):function(t,e){return ir(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,i)},toString:e.toString}},gr=function(t){return{extract:function(e,n){return function(t,e,n){for(var r={},o=[],i=0,u=n;i<u.length;i++){var a=u[i];Kn(a,(function(n,i,u,a){var c=lr(u,t,e,n,a);$n(c,(function(t){o.push.apply(o,t)}),(function(t){r[i]=t}))}),(function(t,n){r[t]=n(e)}))}return o.length>0?jn(o):Fn(r)}(e,n,t)},toString:function(){return"obj{\n"+U(t,(function(t){return Kn(t,(function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},hr=function(t){return{extract:function(e,n){var r=U(n,(function(n,r){return t.extract(e.concat(["["+r+"]"]),n)}));return rr(r)},toString:function(){return"array("+t.toString()+")"}}},pr=function(t){return{extract:function(e,n){for(var r=[],o=0,i=t;o<i.length;o++){var u=i[o].extract(e,n);if(u.stype===Bt.Value)return u;r.push(u)}return rr(r)},toString:function(){return"oneOf("+U(t,(function(t){return t.toString()})).join(", ")+")"}}},vr=function(t,e){return{extract:function(n,r){var o=lt(r),i=function(e,n){return hr(ur(t)).extract(e,n)}(n,o);return Un(i,(function(t){var o=U(t,(function(t){return Xn(t,t,{tag:"required",process:{}},e)}));return gr(o).extract(n,r)}))},toString:function(){return"setOf("+e.toString()+")"}}},br=p(hr,gr),yr=v(ar),wr=function(t,e){return ur((function(n){var r=typeof n;return t(n)?Fn(n):jn("Expected type: "+e+" but got: "+r)}))},xr=wr(m,"number"),Cr=wr(o,"string"),Sr=wr(c,"boolean"),kr=wr(d,"function"),Or=function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every((function(e){return Or(t[e])}));default:return!1}},_r=ur((function(t){return Or(t)?Fn(t):jn("Expected value to be acceptable for sending via postMessage")})),Tr=function(t,e,n,r){return yt(n,r).fold((function(){return function(t,e,n){return ir(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+or(e)}))}(t,n,r)}),(function(n){return n.extract(t.concat(["branch: "+r]),e)}))},Er=function(t,e){return{extract:function(n,r){return yt(r,t).fold((function(){return function(t,e){return ir(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return Tr(n,r,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+lt(e)}}},Ar=function(t){return ur((function(e){return t(e).fold(jn,Fn)}))},Dr=function(t,e){return vr((function(e){return Ln(t(e))}),e)},Mr=function(t,e,n){return Hn(function(t,e,n){var r=e.extract([t],n);return Gn(r,(function(t){return{input:n,errors:t}}))}(t,e,n))},Rr=function(t){return t.fold((function(t){throw new Error(zr(t))}),b)},Nr=function(t,e,n){return Rr(Mr(t,e,n))},zr=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:v("... (only showing first ten failures)")}]):e,U(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+or(t.input);var e,n},Br=function(t,e){return Er(t,mt(e,gr))},Pr=Xn,Ir=function(t,e){return{tag:"custom",newKey:t,instantiator:e}},Lr=function(t){return Ar((function(e){return H(t,e)?zn.value(e):zn.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},Hr=function(t){return Pr(t,t,{tag:"required",process:{}},yr())},Fr=function(t,e){return Pr(t,t,{tag:"required",process:{}},e)},Vr=function(t){return Fr(t,xr)},jr=function(t){return Fr(t,Cr)},Ur=function(t,e){return Pr(t,t,{tag:"required",process:{}},Lr(e))},Wr=function(t){return Fr(t,kr)},qr=function(t,e){return Pr(t,t,{tag:"required",process:{}},gr(e))},Gr=function(t,e){return Pr(t,t,{tag:"required",process:{}},br(e))},$r=function(t,e){return Pr(t,t,{tag:"required",process:{}},hr(e))},Xr=function(t){return Pr(t,t,{tag:"option",process:{}},yr())},Kr=function(t,e){return Pr(t,t,{tag:"option",process:{}},e)},Yr=function(t){return Kr(t,xr)},Jr=function(t){return Kr(t,Cr)},Qr=function(t){return Kr(t,kr)},Zr=function(t,e){return Kr(t,hr(e))},to=function(t,e){return Kr(t,gr(e))},eo=function(t,e){return Pr(t,t,tr(e),yr())},no=function(t,e,n){return Pr(t,t,tr(e),n)},ro=function(t,e){return no(t,e,xr)},oo=function(t,e){return no(t,e,Cr)},io=function(t,e,n){return no(t,e,Lr(n))},uo=function(t,e){return no(t,e,Sr)},ao=function(t,e){return no(t,e,kr)},co=function(t,e,n){return no(t,e,hr(n))},so=function(t,e,n){return no(t,e,gr(n))},lo=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},fo=function(t){if(!u(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return W(t,(function(r,o){var i=lt(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!u(c))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+i);var u=function(t){var r=lt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!Z(e,(function(t){return H(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:u,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}})),n};fo([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var mo,go=function(t,e){return function(t,e){var n={};return dt(t,(function(t,r){H(e,r)||(n[r]=t)})),n}(t,e)},ho=function(t,e){return function(t,e){var n;return(n={})[t]=e,n}(t,e)},po=function(t){return function(t){var e={};return W(t,(function(t){e[t.key]=t.value})),e}(t)},vo=function(t,e){var n,r=function(t){var e=[],n=[];return W(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}(t);return r.errors.length>0?(n=r.errors,zn.error(J(n))):function(t,e){return 0===t.length?zn.value(e):zn.value(Jn(e,Qn.apply(void 0,t)))}(r.values,e)},bo=function(t){return d(t)?t:S},yo=function(t,e,n){for(var r=t.dom,o=bo(n);r.parentNode;){r=r.parentNode;var i=zt.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return z.none()},wo=function(t,e,n){var r=e(t),o=bo(n);return r.orThunk((function(){return o(t)?z.none():yo(t,e,o)}))},xo=function(t,e){return ce(t.element,e.event.target)},Co={can:k,abort:S,run:h},So=function(t){if(!xt(t,"can")&&!xt(t,"abort")&&!xt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return _(_({},Co),t)},ko=function(t){return{can:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return X(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),abort:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return X(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort})),run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];W(t,(function(t){t.run.apply(void 0,e)}))}}},Oo=v,_o=Oo("touchstart"),To=Oo("touchmove"),Eo=Oo("touchend"),Ao=Oo("touchcancel"),Do=Oo("mousedown"),Mo=Oo("mousemove"),Ro=Oo("mouseout"),No=Oo("mouseup"),zo=Oo("mouseover"),Bo=Oo("focusin"),Po=Oo("focusout"),Io=Oo("keydown"),Lo=Oo("keyup"),Ho=Oo("input"),Fo=Oo("change"),Vo=Oo("click"),jo=Oo("transitioncancel"),Uo=Oo("transitionend"),Wo=Oo("transitionstart"),qo=Oo("selectstart"),Go=function(t){return v("alloy."+t)},$o={tap:Go("tap")},Xo=Go("focus"),Ko=Go("blur.post"),Yo=Go("paste.post"),Jo=Go("receive"),Qo=Go("execute"),Zo=Go("focus.item"),ti=$o.tap,ei=Go("longpress"),ni=Go("sandbox.close"),ri=Go("typeahead.cancel"),oi=Go("system.init"),ii=Go("system.touchmove"),ui=Go("system.touchend"),ai=Go("system.scroll"),ci=Go("system.resize"),si=Go("system.attached"),li=Go("system.detached"),fi=Go("system.dismissRequested"),di=Go("system.repositionRequested"),mi=Go("focusmanager.shifted"),gi=Go("slotcontainer.visibility"),hi=Go("change.tab"),pi=Go("dismiss.tab"),vi=Go("highlight"),bi=Go("dehighlight"),yi=function(t,e){Si(t,t.element,e,{})},wi=function(t,e,n){Si(t,t.element,e,n)},xi=function(t){yi(t,Qo())},Ci=function(t,e,n){Si(t,e,n,{})},Si=function(t,e,n,r){var o=_({target:e},r);t.getSystem().triggerEvent(n,e,o)},ki=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},Oi=function(t){return po(t)},_i=function(t,e){return{key:t,value:So({abort:e})}},Ti=function(t){return{key:t,value:So({run:function(t,e){e.event.prevent()}})}},Ei=function(t,e){return{key:t,value:So({run:e})}},Ai=function(t,e,n){return{key:t,value:So({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Di=function(t){return function(e){return{key:t,value:So({run:function(t,n){xo(t,n)&&e(t,n)}})}}},Mi=function(t,e,n){return function(t,e){return Ei(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){ki(e,e.element,t,r)}))}))}(t,e.partUids[n])},Ri=function(t,e){return Ei(t,(function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).getOrThunk((function(){return wo(r.target,(function(e){return t.getSystem().getByDom(e).toOptional()}),S).getOr(t)}));e(t,o,n)}))},Ni=function(t){return Ei(t,(function(t,e){e.cut()}))},zi=function(t){return Ei(t,(function(t,e){e.stop()}))},Bi=function(t,e){return Di(t)(e)},Pi=Di(si()),Ii=Di(li()),Li=Di(oi()),Hi=function(t){return function(e){return Ei(t,e)}}(Qo()),Fi=function(t){return t.dom.innerHTML},Vi=function(t,e){var n,r,o=fe(t).dom,i=zt.fromDom(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,ve(zt.fromDom(r)));vn(i,u),bn(t),pn(t,i)},ji=function(t){return function(t,e){return zt.fromDom(t.dom.cloneNode(e))}(t,!1)},Ui=function(t){return xe(t)?"#shadow-root":function(t){var e=zt.fromTag("div"),n=zt.fromDom(t.dom.cloneNode(!0));return pn(e,n),Fi(e)}(ji(t))},Wi=function(t){return Ui(t)},qi=Oi([function(t,e){return{key:t,value:So({can:e})}}(Xo(),(function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return ce(e,t.element)&&!ce(e,n)}(t,r,o)||(console.warn(Xo()+" did not get interpreted by the desired target. \nOriginator: "+Wi(r)+"\nTarget: "+Wi(o)+"\nCheck the "+Xo()+" event handlers"),!1)}))]),Gi=Object.freeze({__proto__:null,events:qi}),$i=0,Xi=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++$i+String(e)},Ki=v("alloy-id-"),Yi=v("data-alloy-id"),Ji=Ki(),Qi=Yi(),Zi=function(t,e){Object.defineProperty(t.dom,Qi,{value:e,writable:!0})},tu=function(t){var e=Lt(t)?t.dom[Qi]:null;return z.from(e)},eu=function(t){return Xi(t)},nu=b,ru=function(t){var e=function(e){return"The component must be in a context to execute: "+e+(t?"\n"+Wi(t().element)+" is not in context.":"")},n=function(t){return function(){throw new Error(e(t))}},r=function(t){return function(){console.warn(e(t))}};return{debugInfo:v("fake"),triggerEvent:r("triggerEvent"),triggerFocus:r("triggerFocus"),triggerEscape:r("triggerEscape"),broadcast:r("broadcast"),broadcastOn:r("broadcastOn"),broadcastEvent:r("broadcastEvent"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),isConnected:S}},ou=ru(),iu=function(t){return U(t,(function(t){return At(t,"/*")?t.substring(0,t.length-"/*".length):t}))},uu=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:iu(i)}},t},au=Xi("alloy-premade"),cu=function(t){return ho(au,t)},su=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:iu(i.slice(1))}},t}((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,E([e.getApis(),e],n,!1))}),t)},lu={init:function(){return fu({readState:v("No State required")})}},fu=function(t){return t},du=function(t,e){var n={};return dt(t,(function(t,r){dt(t,(function(t,o){var i=yt(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},mu=function(t){return{classes:s(t.classes)?[]:t.classes,attributes:s(t.attributes)?{}:t.attributes,styles:s(t.styles)?{}:t.styles}},gu=function(t){return t.cHandler},hu=function(t,e){return{name:t,handler:e}},pu=function(t,e,n){var r=_(_({},n),function(t,e){var n={};return W(t,(function(t){n[t.name()]=t.handlers(e)})),n}(e,t));return du(r,hu)},vu=function(t){var e=function(t){return d(t)?{can:k,abort:S,run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}},bu=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=ot(n,(function(n,o){var i=n[e],u=o[e],a=r.indexOf(i),c=r.indexOf(u);if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+u+".\nOrder specified: "+JSON.stringify(r,null,2));return a<c?-1:c<a?1:0}));return zn.value(o)}catch(t){return zn.error([t])}}("Event: "+n,"name",t,r).map((function(t){var e=U(t,(function(t){return t.handler}));return ko(e)})):function(t,e){return zn.error(["The event ("+t+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(U(e,(function(t){return t.name})),null,2)])}(n,t)},yu=function(t,e){var n=pt(t,(function(t,n){return(1===t.length?zn.value(t[0].handler):bu(t,e,n)).map((function(r){var o=vu(r),i=t.length>1?G(e[n],(function(e){return F(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return ho(n,function(t,e){return{handler:t,purpose:e}}(o,i))}))}));return vo(n,{})},wu="alloy.base.behaviour",xu=gr([Pr("dom","dom",{tag:"required",process:{}},gr([Hr("tag"),eo("styles",{}),eo("classes",[]),eo("attributes",{}),Xr("value"),Xr("innerHtml")])),Hr("components"),Hr("uid"),eo("events",{}),eo("apis",{}),Pr("eventOrder","eventOrder",function(t){return er(v(t))}((mo={},mo[Qo()]=["disabling",wu,"toggling","typeaheadevents"],mo[Xo()]=[wu,"focusing","keying"],mo[oi()]=[wu,"disabling","toggling","representing"],mo[Ho()]=[wu,"representing","streaming","invalidating"],mo[li()]=[wu,"representing","item-events","tooltipping"],mo[Do()]=["focusing",wu,"item-type-events"],mo[_o()]=["focusing",wu,"item-type-events"],mo[zo()]=["item-type-events","tooltipping"],mo[Jo()]=["receiving","reflecting","tooltipping"],mo)),yr()),Xr("domModification")]),Cu=function(t){return t.events},Su=function(t,e){var n=Be(t,e);return void 0===n||""===n?[]:n.split(" ")},ku=function(t){return void 0!==t.dom.classList},Ou=function(t,e){return function(t,e,n){var r=Su(t,e).concat([n]);return Ne(t,e,r.join(" ")),!0}(t,"class",e)},_u=function(t,e){return function(t,e,n){var r=G(Su(t,e),(function(t){return t!==n}));return r.length>0?Ne(t,e,r.join(" ")):Le(t,e),!1}(t,"class",e)},Tu=function(t,e){ku(t)?t.dom.classList.add(e):Ou(t,e)},Eu=function(t){0===(ku(t)?t.dom.classList:function(t){return Su(t,"class")}(t)).length&&Le(t,"class")},Au=function(t,e){ku(t)?t.dom.classList.remove(e):_u(t,e);Eu(t)},Du=function(t,e){return ku(t)&&t.dom.classList.contains(e)},Mu=function(t,e){W(e,(function(e){Tu(t,e)}))},Ru=function(t,e){W(e,(function(e){Au(t,e)}))},Nu=function(t){return t.dom.value},zu=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},Bu=function(t,e){return function(t,e){var n=U(e,(function(t){return to(t.name(),[Hr("config"),eo("state",lu)])})),r=Mr("component.behaviours",gr(n),t.behaviours).fold((function(e){throw new Error(zr(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),b);return{list:e,data:mt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return v(e)}))}}(t,e)},Pu=function(t){var e=function(t){var e=yt(t,"behaviours").getOr({});return Q(lt(e),(function(t){var n=e[t];return f(n)?[n.me]:[]}))}(t);return Bu(t,e)},Iu=function(t,e,n){var r,o,i,u=_(_({},(r=t).dom),{uid:r.uid,domChildren:U(r.components,(function(t){return t.element}))}),a=function(t){return t.domModification.fold((function(){return mu({})}),mu)}(t),c={"alloy.base.modification":a},s=e.length>0?function(t,e,n,r){var o=_({},e);W(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=du(o,(function(t,e){return{name:t,modification:e}})),u=function(t){return $(t,(function(t,e){return _(_({},e.modification),t)}),{})},a=$(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=u(i.attributes),s=u(i.styles);return mu({classes:a,attributes:c,styles:s})}(n,c,e,u):a;return i=s,_(_({},o=u),{attributes:_(_({},o.attributes),i.attributes),styles:_(_({},o.styles),i.styles),classes:o.classes.concat(i.classes)})},Lu=function(t,e,n){var r={"alloy.base.behaviour":Cu(t)};return function(t,e,n,r){var o=pu(t,n,r);return yu(o,e)}(n,t.eventOrder,e,r).getOrDie()},Hu=function(t){var e=function(){return l},n=lo(ou),r=Rr(function(t){return Mr("custom.definition",xu,t)}(t)),o=Pu(t),i=function(t){return t.list}(o),u=function(t){return t.data}(o),a=function(t){var e=zt.fromTag(t.tag);ze(e,t.attributes),Mu(e,t.classes),je(e,t.styles),t.innerHtml.each((function(t){return Vi(e,t)}));var n=t.domChildren;return vn(e,n),t.value.each((function(t){zu(e,t)})),t.uid,Zi(e,t.uid),e}(Iu(r,i,u)),c=Lu(r,i,u),s=lo(r.components),l={uid:t.uid,getSystem:n.get,config:function(e){var n=u;return(d(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return d(u[t.name()])},spec:t,readState:function(t){return u[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(ru(e))},element:a,syncComponents:function(){var t=ve(a),e=Q(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),rt)}));s.set(e)},components:s.get,events:c};return l},Fu=function(t){var e=nu(t),n=e.events,r=T(e,["events"]),o=function(t){var e=yt(t,"components").getOr([]);return U(e,Wu)}(r),i=_(_({},r),{events:_(_({},Gi),n),components:o});return zn.value(Hu(i))},Vu=function(t){var e=zt.fromText(t);return ju({element:e})},ju=function(t){var e=Nr("external.component",mr([Hr("element"),Xr("uid")]),t),n=lo(ru()),r=e.uid.getOrThunk((function(){return eu("external")}));Zi(e.element,r);var o={uid:r,getSystem:n.get,config:z.none,hasConfigured:S,connect:function(t){n.set(t)},disconnect:function(){n.set(ru((function(){return o})))},getApis:function(){return{}},element:e.element,spec:t,readState:v("No state"),syncComponents:h,components:v([]),events:{}};return cu(o)},Uu=eu,Wu=function(t){return function(t){return yt(t,au)}(t).getOrThunk((function(){var e=function(t){return wt(t,"uid")}(t)?t:_({uid:Uu("")},t);return Fu(e).getOrDie()}))},qu=cu;function Gu(t,e,n,r,o){return t(n,r)?z.some(n):d(o)&&o(n)?z.none():e(n,r,o)}var $u,Xu=function(t,e,n){for(var r=t.dom,o=d(n)?n:S;r.parentNode;){r=r.parentNode;var i=zt.fromDom(r);if(e(i))return z.some(i);if(o(i))break}return z.none()},Ku=function(t,e,n){return Gu((function(t,e){return e(t)}),Xu,t,e,n)},Yu=function(t,e,n){return Ku(t,e,n).isSome()},Ju=function(t,e,n){return Xu(t,(function(t){return ue(t,e)}),n)},Qu=function(t,e){return function(t,e){return K(t.dom.childNodes,(function(t){return e(zt.fromDom(t))})).map(zt.fromDom)}(t,(function(t){return ue(t,e)}))},Zu=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return ae(n)?z.none():z.from(n.querySelector(t)).map(zt.fromDom)}(e,t)},ta=function(t,e,n){return Gu((function(t,e){return ue(t,e)}),Ju,t,e,n)},ea=function(){var t=Xi("aria-owns");return{id:t,link:function(e){Ne(e,"aria-owns",t)},unlink:function(t){Le(t,"aria-owns")}}},na=function(t,e){return function(t){return Ku(t,(function(t){if(!Lt(t))return!1;var e=Be(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1})).bind((function(t){var e=Be(t,"id"),n=ke(t);return Zu(n,'[aria-owns="'+e+'"]')}))}(e).exists((function(e){return ra(t,e)}))},ra=function(t,e){return Yu(e,(function(e){return ce(e,t.element)}),S)||na(t,e)};!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}($u||($u={}));var oa=lo({}),ia=function(t,e,n){switch(yt(oa.get(),t).orThunk((function(){var e=lt(oa.get());return st(e,(function(e){return t.indexOf(e)>-1?z.some(oa.get()[e]):z.none()}))})).getOr($u.NORMAL)){case $u.NORMAL:return n(ca());case $u.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();H(["mousemove","mouseover","mouseout",oi()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:U(n,(function(t){return H(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Wi(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case $u.STOP:return!0}},ua=["alloy/data/Fields","alloy/debugging/Debugging"],aa=function(t,e,n){return ia(t,e,n)},ca=v({logEventCut:h,logEventStopped:h,logNoParent:h,logEventNoHandlers:h,logEventResponse:h,write:h}),sa=v([Hr("menu"),Hr("selectedMenu")]),la=v([Hr("item"),Hr("selectedItem")]);v(gr(la().concat(sa())));var fa=v(gr(la())),da=qr("initSize",[Hr("numColumns"),Hr("numRows")]),ma=function(){return qr("markers",[Hr("backgroundMenu")].concat(sa()).concat(la()))},ga=function(t){return qr("markers",U(t,Hr))},ha=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return K(e,(function(t){return t.indexOf("alloy")>0&&!F(ua,(function(e){return t.indexOf(e)>-1}))})).getOr("unknown")}}(),Pr(e,e,n,Ar((function(t){return zn.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},pa=function(t){return ha(0,t,tr(h))},va=function(t){return ha(0,t,tr(z.none))},ba=function(t){return ha(0,t,{tag:"required",process:{}})},ya=function(t){return ha(0,t,{tag:"required",process:{}})},wa=function(t,e){return Ir(t,v(e))},xa=function(t){return Ir(t,b)},Ca=v(da),Sa=function(t,e,n,r,o,i,u,a){return void 0===a&&(a=!1),{x:t,y:e,bubble:n,direction:r,placement:o,restriction:i,label:u+"-"+o,alwaysFit:a}},ka=fo([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Oa=ka.southeast,_a=ka.southwest,Ta=ka.northeast,Ea=ka.northwest,Aa=ka.south,Da=ka.north,Ma=ka.east,Ra=ka.west,Na=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},za=function(t,e,n){return Math.min(Math.max(t,e),n)},Ba=function(t,e){return nt(["left","right","top","bottom"],(function(n){return yt(e,n).map((function(e){return function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(t,e)}))}))},Pa=function(t){return t.x},Ia=function(t,e){return t.x+t.width/2-e.width/2},La=function(t,e){return t.x+t.width-e.width},Ha=function(t,e){return t.y-e.height},Fa=function(t){return t.y+t.height},Va=function(t,e){return t.y+t.height/2-e.height/2},ja=function(t,e,n){return Sa(Pa(t),Fa(t),n.southeast(),Oa(),"southeast",Ba(t,{left:1,top:3}),"layout")},Ua=function(t,e,n){return Sa(La(t,e),Fa(t),n.southwest(),_a(),"southwest",Ba(t,{right:0,top:3}),"layout")},Wa=function(t,e,n){return Sa(Pa(t),Ha(t,e),n.northeast(),Ta(),"northeast",Ba(t,{left:1,bottom:2}),"layout")},qa=function(t,e,n){return Sa(La(t,e),Ha(t,e),n.northwest(),Ea(),"northwest",Ba(t,{right:0,bottom:2}),"layout")},Ga=function(t,e,n){return Sa(Ia(t,e),Ha(t,e),n.north(),Da(),"north",Ba(t,{bottom:2}),"layout")},$a=function(t,e,n){return Sa(Ia(t,e),Fa(t),n.south(),Aa(),"south",Ba(t,{top:3}),"layout")},Xa=function(t,e,n){return Sa(function(t){return t.x+t.width}(t),Va(t,e),n.east(),Ma(),"east",Ba(t,{left:0}),"layout")},Ka=function(t,e,n){return Sa(function(t,e){return t.x-e.width}(t,e),Va(t,e),n.west(),Ra(),"west",Ba(t,{right:1}),"layout")},Ya=function(){return[ja,Ua,Wa,qa,$a,Ga,Xa,Ka]},Ja=function(){return[Ua,ja,qa,Wa,$a,Ga,Xa,Ka]},Qa=function(){return[Wa,qa,ja,Ua,Ga,$a]},Za=function(){return[qa,Wa,Ua,ja,Ga,$a]},tc=function(){return[ja,Ua,Wa,qa,$a,Ga]},ec=function(){return[Ua,ja,qa,Wa,$a,Ga]},nc=Object.freeze({__proto__:null,events:function(t){return Oi([Ei(Jo(),(function(e,n){var r=t.channels,o=lt(r),i=n,u=function(t,e){return e.universal?t:G(t,(function(t){return H(e.channels,t)}))}(o,i);W(u,(function(t){var n=r[t],o=n.schema,u=Nr("channel["+t+"] data\nReceiver: "+Wi(e.element),o,i.data);n.onReceive(e,u)}))}))])}}),rc=[Fr("channels",Dr(zn.value,mr([ba("onReceive"),eo("schema",yr())])))],oc=function(t,e,n){return Li((function(r,o){n(r,t,e)}))},ic=function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:iu(u.slice(0,1).concat(u.slice(3)))}},t}((function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var u=[r].concat(o);return r.config({name:v(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(u,1);return e.apply(void 0,[r,t.config,t.state].concat(n))}))}),n,e)},uc=function(t){return{key:t,value:void 0}},ac=function(t,e,n,r,o,i,u){var a=function(t){return xt(t,n)?t[n]():z.none()},c=mt(o,(function(t,e){return ic(n,t,e)})),s=mt(i,(function(t,e){return uu(t,e)})),l=_(_(_({},s),c),{revoke:w(uc,n),config:function(e){var r=Nr(n+"-config",t,e);return{key:n,value:{config:r,me:l,configAsRaw:jt((function(){return Nr(n+"-config",t,e)})),initialConfig:e,state:u}}},schema:v(e),exhibit:function(t,e){return kt(a(t),yt(r,"exhibit"),(function(t,n){return n(e,t.config,t.state)})).getOrThunk((function(){return mu({})}))},name:v(n),handlers:function(t){return a(t).map((function(t){return yt(r,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return l},cc=function(t){return po(t)},sc=mr([Hr("fields"),Hr("name"),eo("active",{}),eo("apis",{}),eo("state",lu),eo("extra",{})]),lc=function(t){var e=Nr("Creating behaviour: "+t.name,sc,t);return function(t,e,n,r,o,i){var u,a,c=mr(t),s=to(e,[(u="config",a=t,Kr(u,mr(a)))]);return ac(c,s,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},fc=mr([Hr("branchKey"),Hr("branches"),Hr("name"),eo("active",{}),eo("apis",{}),eo("state",lu),eo("extra",{})]),dc=function(t){var e=Nr("Creating behaviour: "+t.name,fc,t);return function(t,e,n,r,o,i){var u=t,a=to(e,[Kr("config",t)]);return ac(u,a,e,n,r,o,i)}(Br(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},mc=v(void 0),gc=lc({fields:rc,name:"receiving",active:nc}),hc=Object.freeze({__proto__:null,exhibit:function(t,e){return mu({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),pc=function(){return zt.fromDom(document)},vc=function(t){return t.dom.focus()},bc=function(t){var e=ke(t).dom;return t.dom===e.activeElement},yc=function(t){return void 0===t&&(t=pc()),z.from(t.dom.activeElement).map(zt.fromDom)},wc=function(t){return yc(ke(t)).filter((function(e){return t.dom.contains(e.dom)}))},xc=function(t,e){var n=ke(e),r=yc(n).bind((function(t){var n,r,o=function(e){return ce(t,e)};return o(e)?z.some(e):(n=o,(r=function(t){for(var e=0;e<t.childNodes.length;e++){var o=zt.fromDom(t.childNodes[e]);if(n(o))return z.some(o);var i=r(t.childNodes[e]);if(i.isSome())return i}return z.none()})(e.dom))})),o=t(e);return r.each((function(t){yc(n).filter((function(e){return ce(e,t)})).fold((function(){vc(t)}),h)})),o},Cc=function(t,e,n,r,o){var i=function(t){return t+"px"};return{position:t,left:e.map(i),top:n.map(i),right:r.map(i),bottom:o.map(i)}},Sc=function(t,e){Ue(t,function(t){return _(_({},t),{position:z.some(t.position)})}(e))},kc=fo([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Oc=function(t,e,n,r,o,i){var u=e.rect,a=u.x-n,c=u.y-r,s=o-(a+u.width),l=i-(c+u.height),f=z.some(a),d=z.some(c),m=z.some(s),g=z.some(l),h=z.none();return function(t,e,n,r,o,i,u,a,c){return t.fold(e,n,r,o,i,u,a,c)}(e.direction,(function(){return Cc(t,f,d,h,h)}),(function(){return Cc(t,h,d,m,h)}),(function(){return Cc(t,f,h,h,g)}),(function(){return Cc(t,h,h,m,g)}),(function(){return Cc(t,f,d,h,h)}),(function(){return Cc(t,f,h,h,g)}),(function(){return Cc(t,f,d,h,h)}),(function(){return Cc(t,h,d,m,h)}))},_c=function(t,e){return t.fold((function(){var t=e.rect;return Cc("absolute",z.some(t.x),z.some(t.y),z.none(),z.none())}),(function(t,n,r,o){return Oc("absolute",e,t,n,r,o)}),(function(t,n,r,o){return Oc("fixed",e,t,n,r,o)}))},Tc=function(t,e){var n=w(Tn,e),r=t.fold(n,n,(function(){var t=xn();return Tn(e).translate(-t.left,-t.top)})),o=sn(e),i=tn(e);return En(r.left,r.top,o,i)},Ec=function(t,e){return e.fold((function(){return t.fold(Mn,Mn,En)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=Ac(t,n.x,n.y);return En(r.left,r.top,n.width,n.height)}))}))},Ac=function(t,e,n){var r=nn(e,n);return t.fold(v(r),v(r),(function(){var t=xn();return r.translate(-t.left,-t.top)}))};kc.none;var Dc,Mc=kc.relative,Rc=kc.fixed,Nc=function(t,e){return function(t,e){return{anchorBox:t,origin:e}}(t,e)},zc=function(t){return Pe(t,"data-alloy-placement")},Bc=fo([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Pc=function(t,e,n,r){var o=t.bubble,i=o.offset,u=function(t,e,n){var r=function(r,o){return e[r].map((function(e){var i="top"===r||"bottom"===r,u=i?n.top:n.left,a=("left"===r||"top"===r?Math.max:Math.min)(e,o)+u;return i?za(a,t.y,t.bottom):za(a,t.x,t.right)})).getOr(o)},o=r("left",t.x),i=r("top",t.y),u=r("right",t.right),a=r("bottom",t.bottom);return En(o,i,u-o,a-i)}(r,t.restriction,i),a=t.x+i.left,c=t.y+i.top,s=En(a,c,e,n),l=function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,u=t.x,a=t.y,c=t.right,s=t.bottom,l=t.width,f=t.height;return{originInBounds:u>=n&&u<=o&&(a>=r&&a<=i),sizeInBounds:c<=o&&c>=n&&(s<=i&&s>=r),visibleW:Math.min(l,u>=n?o-u:c-n),visibleH:Math.min(f,a>=r?i-a:s-r)}}(s,u),f=l.originInBounds,d=l.sizeInBounds,m=l.visibleW,g=l.visibleH,h=f&&d,p=h?s:function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,u=t.x,a=t.y,c=t.width,s=t.height,l=Math.max(n,o-c),f=Math.max(r,i-s),d=za(u,n,l),m=za(a,r,f),g=Math.min(d+c,o)-d,h=Math.min(m+s,i)-m;return En(d,m,g,h)}(s,u),b=p.width>0&&p.height>0,y=function(t,e,n){var r=v(e.bottom-n.y),o=v(n.bottom-e.y),i=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)}(t,o,o,r),u=v(e.right-n.x),a=v(n.right-e.x);return{maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t,a,a,u),maxHeight:i}}(t.direction,p,r),w=y.maxWidth,x={rect:p,maxHeight:y.maxHeight,maxWidth:w,direction:t.direction,placement:t.placement,classes:{on:o.classesOn,off:o.classesOff},layout:t.label,testY:c};return h||t.alwaysFit?Bc.fit(x):Bc.nofit(x,m,g,b)},Ic=function(t){var e=lo(z.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(z.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(z.some(t))}}},Lc=function(){return Ic((function(t){return t.destroy()}))},Hc=function(){return Ic((function(t){return t.unbind()}))},Fc=function(){var t=Ic(h);return _(_({},t),{on:function(e){return t.get().each(e)}})},Vc=k,jc=function(t,e,n){return function(t,e,n,r){return fn(t,e,n,r,!1)}(t,e,Vc,n)},Uc=function(t,e,n){return function(t,e,n,r){return fn(t,e,n,r,!0)}(t,e,Vc,n)},Wc=ln,qc=["top","bottom","right","left"],Gc="data-alloy-transition-timer",$c=function(t,e){return function(t,e){return Z(e,(function(e){return Du(t,e)}))}(t,e.classes)},Xc=function(t,e){var n=function(t){return parseFloat(t).toFixed(3)};return vt(e,(function(e,r){var o,i,u,a=t[r].map(n),c=e.map(n);return void 0===u&&(u=y),!kt(o=a,i=c,u).getOr(o.isNone()&&i.isNone())})).isSome()},Kc=function(t,e){var n,r=Hc(),i=Hc(),u=function(e){var n,r=null!==(n=e.raw.pseudoElement)&&void 0!==n?n:"";return ce(e.target,t)&&!Mt(r)&&H(qc,e.raw.propertyName)},a=function(o){if(l(o)||u(o)){r.clear(),i.clear();var a=null==o?void 0:o.raw.type;(l(a)||a===Uo())&&(clearTimeout(n),Le(t,Gc),Ru(t,e.classes))}},c=function(){r.set(jc(t,Uo(),a)),i.set(jc(t,jo(),a))};if("ontransitionstart"in t.dom)var s=jc(t,Wo(),(function(t){u(t)&&(s.unbind(),c())}));else c();var f=function(t){var e=function(e){var n=We(t,e),r=o(n)?n.split(/\s*,\s*/):[];return G(r,Mt)},n=function(t){if(o(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return At(t,"ms")?e:1e3*e}return 0},r=e("transition-delay"),i=e("transition-duration");return X(i,(function(t,e,o){var i=n(r[o])+n(e);return Math.max(t,i)}),0)}(t);requestAnimationFrame((function(){n=setTimeout(a,f+17),Ne(t,Gc,n)}))},Yc=function(t,e,n,r,o,i){var u=function(t,e,n){return n.exists((function(n){var r=t.mode;return"all"===r||n[r]!==e[r]}))}(r,o,i);if(u||$c(t,r)){Ve(t,"position",n.position);var a=Tc(e,t),c=_c(e,_(_({},o),{rect:a})),s=nt(qc,(function(t){return c[t]}));Xc(n,s)&&(Ue(t,s),u&&function(t,e){Mu(t,e.classes),Pe(t,Gc).each((function(e){clearTimeout(parseInt(e,10)),Le(t,Gc)})),Kc(t,e)}(t,r),Ye(t))}else Ru(t,r.classes)},Jc=function(t,e,n,r){Ke(e,"max-height"),Ke(e,"max-width");var o,i={width:sn(o=e),height:tn(o)};return function(t,e,n,r,o,i){var u=r.width,a=r.height,c=function(e,c,s,l,f){var d=e(n,r,o,t,i),m=Pc(d,u,a,i);return m.fold(v(m),(function(t,e,n,r){return(f===r?n>l||e>s:!f&&r)?m:Bc.nofit(c,s,l,f)}))};return X(e,(function(t,e){var n=w(c,e);return t.fold(v(t),n)}),Bc.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:Oa(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1)).fold(b,b)}(e,r.preference,t,i,n,r.bounds)},Qc=function(t,e){!function(t,e){Ne(t,"data-alloy-placement",e)}(t,e.placement)},Zc=function(t,e){!function(t,e){var n=Qe.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Ve(t,"max-height",n+"px")}(t,Math.floor(e))},ts=v((function(t,e){Zc(t,e),je(t,{"overflow-x":"hidden","overflow-y":"auto"})})),es=v((function(t,e){Zc(t,e)})),ns=function(t,e,n){return void 0===t[e]?n:t[e]},rs=function(t,e,n,r){var o=Jc(t,e,n,r);return function(t,e,n){var r=_c(n.origin,e);n.transition.each((function(o){Yc(t,n.origin,r,o,e,n.lastPlacement)})),Sc(t,r)}(e,o,r),Qc(e,o),function(t,e){var n=e.classes;Ru(t,n.off),Mu(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r),{layout:o.layout,placement:o.placement}},os=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],is=function(t,e,n,r){void 0===r&&(r=1);var o=t*r,i=e*r,u=function(t){return yt(n,t).getOr([])},a=function(t,e,n){var r=et(os,n);return{offset:nn(t,e),classesOn:Q(n,u),classesOff:Q(r,u)}};return{southeast:function(){return a(-t,e,["top","alignLeft"])},southwest:function(){return a(t,e,["top","alignRight"])},south:function(){return a(-t/2,e,["top","alignCentre"])},northeast:function(){return a(-t,-e,["bottom","alignLeft"])},northwest:function(){return a(t,-e,["bottom","alignRight"])},north:function(){return a(-t/2,-e,["bottom","alignCentre"])},east:function(){return a(t,-e/2,["valignCentre","left"])},west:function(){return a(-t,-e/2,["valignCentre","right"])},insetNortheast:function(){return a(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return a(-o,i,["top","alignRight","inset"])},insetNorth:function(){return a(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return a(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return a(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return a(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return a(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return a(o,-i/2,["valignCentre","left","inset"])}}},us=function(){return is(0,0,{})},as=b,cs=function(t,e){return function(n){return"rtl"===ss(n)?e:t}},ss=function(t){return"rtl"===We(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(Dc||(Dc={}));var ls="data-alloy-vertical-dir",fs=function(t){return Yu(t,(function(t){return Lt(t)&&Be(t,"data-alloy-vertical-dir")===Dc.BottomToTop}))},ds=function(){return to("layouts",[Hr("onLtr"),Hr("onRtl"),Xr("onBottomLtr"),Xr("onBottomRtl")])},ms=function(t,e,n,r,o,i,u){var a=u.map(fs).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=a?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=a?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r);return cs(l,f)(t)},gs=[Hr("hotspot"),Xr("bubble"),eo("overrides",{}),ds(),wa("placement",(function(t,e,n){var r=e.hotspot,o=Tc(n,r.element),i=ms(t.element,e,tc(),ec(),Qa(),Za(),z.some(e.hotspot.element));return z.some(as({anchorBox:o,bubble:e.bubble.getOr(us()),overrides:e.overrides,layouts:i,placer:z.none()}))}))],hs=[Hr("x"),Hr("y"),eo("height",0),eo("width",0),eo("bubble",us()),eo("overrides",{}),ds(),wa("placement",(function(t,e,n){var r=Ac(n,e.x,e.y),o=En(r.left,r.top,e.width,e.height),i=ms(t.element,e,Ya(),Ja(),Ya(),Ja(),z.none());return z.some(as({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:z.none()}))}))],ps=fo([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),vs=function(t){return t.fold(b,(function(t,e,n){return t.translate(-e,-n)}))},bs=function(t){return t.fold(b,b)},ys=function(t){return X(t,(function(t,e){return t.translate(e.left,e.top)}),nn(0,0))},ws=function(t){var e=U(t,bs);return ys(e)},xs=ps.screen,Cs=ps.absolute,Ss=function(t,e,n){var r=fe(t.element),o=xn(r),i=function(t,e,n){var r=ge(n.root).dom;return z.from(r.frameElement).map(zt.fromDom).filter((function(e){var n=fe(e),r=fe(t.element);return ce(n,r)})).map(on)}(t,0,n).getOr(o);return Cs(i,o.left,o.top)},ks=function(t,e,n,r){var o=xs(nn(t,e));return z.some(function(t,e,n){return{point:t,width:e,height:n}}(o,n,r))},Os=function(t,e,n,r,o){return t.map((function(t){var i,u,a,c=[e,t.point],s=(i=function(){return ws(c)},u=function(){return ws(c)},a=function(){return function(t){var e=U(t,vs);return ys(e)}(c)},r.fold(i,u,a)),l=function(t,e,n,r){return{x:t,y:e,width:n,height:r}}(s.left,s.top,t.width,t.height),f=n.showAbove?Qa():tc(),d=n.showAbove?Za():ec(),m=ms(o,n,f,d,f,d,z.none());return as({anchorBox:l,bubble:n.bubble.getOr(us()),overrides:n.overrides,layouts:m,placer:z.none()})}))},_s=[Hr("node"),Hr("root"),Xr("bubble"),ds(),eo("overrides",{}),eo("showAbove",!1),wa("placement",(function(t,e,n){var r=Ss(t,0,e);return e.node.filter(Ae).bind((function(o){var i=o.dom.getBoundingClientRect(),u=ks(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return Os(u,r,e,n,a)}))}))],Ts=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Es=fo([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),As=(Es.before,Es.on,Es.after,function(t){return t.fold(b,b,b)}),Ds=fo([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ms={domRange:Ds.domRange,relative:Ds.relative,exact:Ds.exact,exactFromRange:function(t){return Ds.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return zt.fromDom(t.startContainer)},relative:function(t,e){return As(t)},exact:function(t,e,n,r){return t}})}(t);return ge(e)},range:Ts},Rs=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Ns=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},zs=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Bs=fo([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ps=function(t,e,n){return e(zt.fromDom(n.startContainer),n.startOffset,zt.fromDom(n.endContainer),n.endOffset)},Is=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return Bs.rtl(zt.fromDom(t.endContainer),t.endOffset,zt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Ps(0,Bs.ltr,n)})):Ps(0,Bs.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:v(t),rtl:z.none}},relative:function(e,n){return{ltr:jt((function(){return Rs(t,e,n)})),rtl:jt((function(){return z.some(Rs(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:jt((function(){return Ns(t,e,n,r,o)})),rtl:jt((function(){return z.some(Ns(t,r,o,e,n))}))}}})}(t,e))},Ls=function(t,e){return Is(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};Bs.ltr,Bs.rtl;var Hs,Fs=function(t,e){var n=function(e){return t(e)?z.from(e.dom.nodeValue):z.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Ht,"text"),Vs=function(t){return Fs.getOption(t)},js=["img","br"],Us=function(t){return Vs(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||H(js,Pt(t))},Ws=function(t,e){var n=function(t){for(var r=ve(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return z.some(i);var u=n(i);if(u.isSome())return u}return z.none()};return n(t)},qs=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return ae(n)?[]:U(n.querySelectorAll(t),zt.fromDom)}(e,t)},Gs=function(t,e,n,r){var o=function(t,e,n,r){var o=fe(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=ce(t,n)&&e===r;return o.collapsed&&!i},$s=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return z.some(Ts(zt.fromDom(e.startContainer),e.startOffset,zt.fromDom(n.endContainer),n.endOffset))}return z.none()},Xs=function(t){if(null===t.anchorNode||null===t.focusNode)return $s(t);var e=zt.fromDom(t.anchorNode),n=zt.fromDom(t.focusNode);return Gs(e,t.anchorOffset,n,t.focusOffset)?z.some(Ts(e,t.anchorOffset,n,t.focusOffset)):$s(t)},Ks=function(t){return function(t){return z.from(t.getSelection())}(t).filter((function(t){return t.rangeCount>0})).bind(Xs)},Ys=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?z.some(n).map(zs):z.none()}(Ls(t,e))},Js=function(t,e){return function(t){var e=t.getBoundingClientRect();return e.width>0||e.height>0?z.some(e).map(zs):z.none()}(Ls(t,e))},Qs=function(t,e){return{element:t,offset:e}},Zs=function(t,e){var n=ve(t);if(0===n.length)return Qs(t,e);if(e<n.length)return Qs(n[e],0);var r=n[n.length-1],o=Ht(r)?function(t){return Fs.get(t)}(r).length:ve(r).length;return Qs(r,o)},tl=function(t,e){return Ht(t)?Qs(t,e):Zs(t,e)},el=function(t,e){return e.getSelection.getOrThunk((function(){return function(){return Ks(t)}}))().map((function(t){var e=tl(t.start,t.soffset),n=tl(t.finish,t.foffset);return Ms.range(e.element,e.offset,n.element,n.offset)}))},nl=[Xr("getSelection"),Hr("root"),Xr("bubble"),ds(),eo("overrides",{}),eo("showAbove",!1),wa("placement",(function(t,e,n){var r=ge(e.root).dom,o=Ss(t,0,e),i=el(r,e).bind((function(t){return Js(r,Ms.exactFromRange(t)).orThunk((function(){var e=zt.fromText("\ufeff");mn(t.start,e);var n=Ys(r,Ms.exact(e,0,e,1));return yn(e),n})).bind((function(t){return ks(t.left,t.top,t.width,t.height)}))})),u=el(r,e).bind((function(t){return Lt(t.start)?z.some(t.start):function(t){return he(t)}(t.start)})).getOr(t.element);return Os(i,o,e,n,u)}))],rl=function(t){return t.x+t.width},ol=function(t,e){return t.x-e.width},il=function(t,e){return t.y-e.height+t.height},ul=function(t){return t.y},al=function(t,e,n){return Sa(rl(t),ul(t),n.southeast(),Oa(),"southeast",Ba(t,{left:0,top:2}),"link-layout")},cl=function(t,e,n){return Sa(ol(t,e),ul(t),n.southwest(),_a(),"southwest",Ba(t,{right:1,top:2}),"link-layout")},sl=function(t,e,n){return Sa(rl(t),il(t,e),n.northeast(),Ta(),"northeast",Ba(t,{left:0,bottom:3}),"link-layout")},ll=function(t,e,n){return Sa(ol(t,e),il(t,e),n.northwest(),Ea(),"northwest",Ba(t,{right:1,bottom:3}),"link-layout")},fl=function(){return[al,cl,sl,ll]},dl=function(){return[cl,al,ll,sl]},ml=[Hr("item"),ds(),eo("overrides",{}),wa("placement",(function(t,e,n){var r=Tc(n,e.item.element),o=ms(t.element,e,fl(),dl(),fl(),dl(),z.none());return z.some(as({anchorBox:r,bubble:us(),overrides:e.overrides,layouts:o,placer:z.none()}))}))],gl=Br("type",{selection:nl,node:_s,hotspot:gs,submenu:ml,makeshift:hs}),hl=[$r("classes",Cr),io("mode","all",["all","layout","placement"])],pl=[eo("useFixed",S),Xr("getBounds")],vl=[Fr("anchor",gl),to("transition",hl)],bl=function(t,e,n,r,o,i,u){return function(t,e,n,r,o,i,u,a){var c=ns(u,"maxHeightFunction",ts()),s=ns(u,"maxWidthFunction",h),l=t.anchorBox,f=t.origin,d={bounds:Ec(f,i),origin:f,preference:r,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:o,transition:a};return rs(l,e,n,d)}(Nc(n.anchorBox,e),o.element,n.bubble,n.layouts,i,r,n.overrides,u)},yl=function(t,e,n,r,o,i){var u=i.map(An);return wl(t,e,n,r,o,u)},wl=function(t,e,n,r,o,i){var u=Nr("placement.info",gr(vl),o),a=u.anchor,c=r.element,s=n.get(r.uid);xc((function(){Ve(c,"position","fixed");var o=Ge(c,"visibility");Ve(c,"visibility","hidden");var l,f=e.useFixed()?(l=document.documentElement,Rc(0,0,l.clientWidth,l.clientHeight)):function(t){var e=on(t.element),n=t.element.dom.getBoundingClientRect();return Mc(e.left,e.top,n.width,n.height)}(t),d=a.placement,m=i.map(v).or(e.getBounds);d(t,a,f).each((function(e){var o=e.placer.getOr(bl)(t,f,e,m,r,s,u.transition);n.set(r.uid,o)})),o.fold((function(){Ke(c,"visibility")}),(function(t){Ve(c,"visibility",t)})),Ge(c,"left").isNone()&&Ge(c,"top").isNone()&&Ge(c,"right").isNone()&&Ge(c,"bottom").isNone()&&Ct(Ge(c,"position"),"fixed")&&Ke(c,"position")}),c)},xl=Object.freeze({__proto__:null,position:function(t,e,n,r,o){yl(t,e,n,r,o,z.none())},positionWithin:yl,positionWithinBounds:wl,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"},reset:function(t,e,n,r){var o=r.element;W(["position","left","right","top","bottom"],(function(t){return Ke(o,t)})),function(t){Le(t,"data-alloy-placement")}(o),n.clear(r.uid)}}),Cl=Object.freeze({__proto__:null,init:function(){var t={};return fu({readState:function(){return t},clear:function(e){f(e)?delete t[e]:t={}},set:function(e,n){t[e]=n},get:function(e){return yt(t,e)}})}}),Sl=lc({fields:pl,name:"positioning",active:hc,apis:xl,state:Cl}),kl=function(t){yi(t,li());var e=t.components();W(e,kl)},Ol=function(t){var e=t.components();W(e,Ol),yi(t,si())},_l=function(t,e){pn(t.element,e.element)},Tl=function(t,e){var n=t.components();!function(t){W(t.components(),(function(t){return yn(t.element)})),bn(t.element),t.syncComponents()}(t);var r=et(n,e);W(r,(function(e){kl(e),t.getSystem().removeFromWorld(e)})),W(e,(function(e){e.getSystem().isConnected()?_l(t,e):(t.getSystem().addToWorld(e),_l(t,e),Ae(t.element)&&Ol(e)),t.syncComponents()}))},El=function(t,e){Al(t,e,pn)},Al=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),Ae(t.element)&&Ol(e),t.syncComponents()},Dl=function(t){kl(t),yn(t.element),t.getSystem().removeFromWorld(t)},Ml=function(t){var e=he(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));Dl(t),e.each((function(t){t.syncComponents()}))},Rl=function(t){var e=t.components();W(e,Dl),bn(t.element),t.syncComponents()},Nl=function(t,e){zl(t,e,pn)},zl=function(t,e,n){n(t,e.element);var r=ve(e.element);W(r,(function(t){e.getByDom(t).each(Ol)}))},Bl=function(t){var e=ve(t.element);W(e,(function(e){t.getByDom(e).each(kl)})),yn(t.element)},Pl=function(t,e,n,r){n.get().each((function(e){Rl(t)}));var o=e.getAttachPoint(t);El(o,t);var i=t.getSystem().build(r);return El(t,i),n.set(i),i},Il=function(t,e,n,r){var o=Pl(t,e,n,r);return e.onOpen(t,o),o},Ll=function(t,e,n){n.get().each((function(r){Rl(t),Ml(t),e.onClose(t,r),n.clear()}))},Hl=function(t,e,n){return n.isOpen()},Fl=function(t,e,n){var r=e.getAttachPoint(t);Ve(t.element,"position",Sl.getMode(r)),function(t,e,n,r){Ge(t.element,e).fold((function(){Le(t.element,n)}),(function(e){Ne(t.element,n,e)})),Ve(t.element,e,r)}(t,"visibility",e.cloakVisibilityAttr,"hidden")},Vl=function(t,e,n){(function(t){return F(["top","left","right","bottom"],(function(e){return Ge(t,e).isSome()}))})(t.element)||Ke(t.element,"position"),function(t,e,n){Pe(t.element,n).fold((function(){return Ke(t.element,e)}),(function(n){return Ve(t.element,e,n)}))}(t,"visibility",e.cloakVisibilityAttr)},jl=Object.freeze({__proto__:null,cloak:Fl,decloak:Vl,open:Il,openWhileCloaked:function(t,e,n,r,o){Fl(t,e),Il(t,e,n,r),o(),Vl(t,e)},close:Ll,isOpen:Hl,isPartOf:function(t,e,n,r){return Hl(0,0,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map((function(){return Pl(t,e,n,r)}))}}),Ul=Object.freeze({__proto__:null,events:function(t,e){return Oi([Ei(ni(),(function(n,r){Ll(n,t,e)}))])}}),Wl=[pa("onOpen"),pa("onClose"),Hr("isPartOf"),Hr("getAttachPoint"),eo("cloakVisibilityAttr","data-precloak-visibility")],ql=lc({fields:Wl,name:"sandboxing",active:Ul,apis:jl,state:Object.freeze({__proto__:null,init:function(){var t=Fc(),e=v("not-implemented");return fu({readState:e,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}})}),Gl=v("dismiss.popups"),$l=v("reposition.popups"),Xl=v("mouse.released"),Kl=mr([eo("isExtraPart",S),to("fireEventInstead",[eo("event",fi())])]),Yl=function(t){var e,n=Nr("Dismissal",Kl,t);return(e={})[Gl()]={schema:mr([Hr("target")]),onReceive:function(t,e){ql.isOpen(t)&&(ql.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold((function(){return ql.close(t)}),(function(e){return yi(t,e.event)})))}},e},Jl=mr([to("fireEventInstead",[eo("event",di())]),Wr("doReposition")]),Ql=function(t){var e,n=Nr("Reposition",Jl,t);return(e={})[$l()]={onReceive:function(t){ql.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return yi(t,e.event)}))}},e},Zl=function(t,e,n){e.store.manager.onLoad(t,e,n)},tf=function(t,e,n){e.store.manager.onUnload(t,e,n)},ef=Object.freeze({__proto__:null,onLoad:Zl,onUnload:tf,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),nf=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[Pi((function(n,r){Zl(n,t,e)})),Ii((function(n,r){tf(n,t,e)}))]:[oc(t,e,Zl)];return Oi(n)}}),rf=function(){var t=lo(null);return fu({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()}}})},of=function(){var t=lo({}),e=lo({});return fu({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return yt(t.get(),n).orThunk((function(){return yt(e.get(),n)}))},update:function(n){var r=t.get(),o=e.get(),i={},u={};W(n,(function(t){i[t.value]=t,yt(t,"meta").each((function(e){yt(e,"text").each((function(e){u[e]=t}))}))})),t.set(_(_({},r),i)),e.set(_(_({},o),u))},clear:function(){t.set({}),e.set({})}})},uf=Object.freeze({__proto__:null,memory:rf,dataset:of,manual:function(){return fu({readState:h})},init:function(t){return t.store.manager.state(t)}}),af=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},cf=[Xr("initialValue"),Hr("getFallbackEntry"),Hr("getDataKey"),Hr("setValue"),wa("manager",{setValue:af,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).getOrThunk((function(){return r.getFallbackEntry(o)}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){af(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:of})],sf=[Hr("getValue"),eo("setValue",h),Xr("initialValue"),wa("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:h,state:lu.init})],lf=[Xr("initialValue"),wa("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:rf})],ff=[no("store",{mode:"memory"},Br("mode",{memory:lf,manual:sf,dataset:cf})),pa("onSetValue"),eo("resetOnDom",!1)],df=lc({fields:ff,name:"representing",active:nf,apis:ef,extra:{setValueFrom:function(t,e){var n=df.getValue(e);df.setValue(t,n)}},state:uf}),mf=function(t,e){return so(t,{},U(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,Pr(n,n,{tag:"option",process:{}},ur((function(t){return jn("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([Ir("dump",b)]))},gf=function(t){return t.dump},hf=function(t,e){return _(_({},cc(e)),t.dump)},pf=mf,vf=hf,bf=fo([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),yf=function(t){return wt(t,"uiType")},wf=function(t,e,n,r){return yf(n)&&"placeholder"===n.uiType?function(t,e,n,r){return t.exists((function(t){return t!==n.owner}))?bf.single(!0,v(n)):yt(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+lt(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,r):bf.single(!1,v(n))},xf=function(t,e,n,r){return wf(t,0,n,r).fold((function(o,i){var u=yf(n)?i(e,n.config,n.validated):i(e),a=yt(u,"components").getOr([]),c=Q(a,(function(n){return xf(t,e,n,r)}));return[_(_({},u),{components:c})]}),(function(t,r){if(yf(n)){var o=r(e,n.config,n.validated);return n.validated.preprocess.getOr(b)(o)}return r(e)}))},Cf=function(t,e,n,r){var o=mt(r,(function(t,e){return r=t,o=!1,{name:v(n=e),required:function(){return r.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return o},replace:function(){if(o)throw new Error("Trying to use the same placeholder more than once: "+n);return o=!0,r}};var n,r,o})),i=function(t,e,n,r){return Q(n,(function(n){return xf(t,e,n,r)}))}(t,e,n,o);return dt(o,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),i},Sf=bf.single,kf=bf.multiple,Of=v("placeholder"),_f=fo([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Tf=eo("factory",{sketch:b}),Ef=eo("schema",[]),Af=Hr("name"),Df=Pr("pname","pname",Zn((function(t){return"<alloy."+Xi(t.name)+">"})),yr()),Mf=Ir("schema",(function(){return[Xr("preprocess")]})),Rf=eo("defaults",v({})),Nf=eo("overrides",v({})),zf=gr([Tf,Ef,Af,Df,Rf,Nf]),Bf=gr([Tf,Ef,Af,Rf,Nf]),Pf=gr([Tf,Ef,Af,Df,Rf,Nf]),If=gr([Tf,Mf,Af,Hr("unit"),Df,Rf,Nf]),Lf=function(t){return t.fold(z.some,z.none,z.some,z.some)},Hf=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Ff=function(t,e){return function(n){var r=Nr("Converting part type",e,n);return t(r)}},Vf=Ff(_f.required,zf),jf=Ff(_f.external,Bf),Uf=Ff(_f.optional,Pf),Wf=Ff(_f.group,If),qf=v("entirety"),Gf=Object.freeze({__proto__:null,required:Vf,external:jf,optional:Uf,group:Wf,asNamedPart:Lf,name:Hf,asCommon:function(t){return t.fold(b,b,b,b)},original:qf}),$f=function(t,e,n,r){return Jn(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},Xf=function(t,e){var n={};return W(e,(function(e){Lf(e).each((function(e){var r=Kf(t,e.pname);n[e.name]=function(n){var o=Nr("Part: "+e.name+" in "+t,gr(e.schema),n);return _(_({},r),{config:n,validated:o})}}))})),n},Kf=function(t,e){return{uiType:Of(),owner:t,name:e}},Yf=function(t,e,n){return{uiType:Of(),owner:t,name:e,config:n,validated:{}}},Jf=function(t){return Q(t,(function(t){return t.fold(z.none,z.some,z.none,z.none).map((function(t){return qr(t.name,t.schema.concat([xa(qf())]))})).toArray()}))},Qf=function(t){return U(t,Hf)},Zf=function(t,e,n){return function(t,e,n){var r={},o={};return W(n,(function(t){t.fold((function(t){r[t.pname]=Sf(!0,(function(e,n,r){return t.factory.sketch($f(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=v(t.factory.sketch($f(e,t,n[qf()]),n))}),(function(t){r[t.pname]=Sf(!1,(function(e,n,r){return t.factory.sketch($f(e,t,n,r))}))}),(function(t){r[t.pname]=kf(!0,(function(e,n,r){var o=e[t.name];return U(o,(function(n){return t.factory.sketch(Jn(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:v(r),externals:v(o)}}(0,e,n)},td=function(t,e,n){return Cf(z.some(t),e,e.components,n)},ed=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},nd=function(t,e,n){return ed(t,e,n).getOrDie("Could not find part: "+n)},rd=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return W(n,(function(t){r[t]=v(i.getByUid(o[t]))})),r},od=function(t,e){var n=t.getSystem();return mt(e.partUids,(function(t,e){return v(n.getByUid(t))}))},id=function(t){return lt(t.partUids)},ud=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return W(n,(function(t){r[t]=v(i.getByUid(o[t]).getOrDie())})),r},ad=function(t,e){var n=Qf(e);return po(U(n,(function(e){return{key:e,value:t+"-"+e}})))},cd=function(t){return Pr("partUids","partUids",er((function(e){return ad(e.uid,t)})),yr())},sd=Object.freeze({__proto__:null,generate:Xf,generateOne:Yf,schemas:Jf,names:Qf,substitutes:Zf,components:td,defaultUids:ad,defaultUidsSchema:cd,getAllParts:od,getAllPartNames:id,getPart:ed,getPartOrDie:nd,getParts:rd,getPartsOrDie:ud}),ld=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[qr("parts",t)]:[]).concat([Hr("uid"),eo("dom",{}),eo("components",[]),xa("originalSpec"),eo("debug.sketcher",{})]).concat(e)}(r,o);return Nr(t+" [SpecSchema]",mr(i.concat(e)),n)},fd=function(t,e,n,r,o){var i=dd(o),u=Jf(n),a=cd(n),c=ld(t,e,i,u,[a]),s=Zf(0,c,n);return r(c,td(t,c,s.internals()),i,s.externals())},dd=function(t){return function(t){return wt(t,"uid")}(t)?t:_(_({},t),{uid:eu("uid")})},md=mr([Hr("name"),Hr("factory"),Hr("configFields"),eo("apis",{}),eo("extraApis",{})]),gd=mr([Hr("name"),Hr("factory"),Hr("configFields"),Hr("partFields"),eo("apis",{}),eo("extraApis",{})]),hd=function(t){var e=Nr("Sketcher for "+t.name,md,t),n=mt(e.apis,su),r=mt(e.extraApis,(function(t,e){return uu(t,e)}));return _(_({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=dd(r);return n(ld(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},pd=function(t){var e=Nr("Sketcher for "+t.name,gd,t),n=Xf(e.name,e.partFields),r=mt(e.apis,su),o=mt(e.extraApis,(function(t,e){return uu(t,e)}));return _(_({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return fd(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},vd=function(t){return"input"===Pt(t)&&"radio"!==Be(t,"type")||"textarea"===Pt(t)},bd=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),yd=[Hr("find")],wd=lc({fields:yd,name:"composing",apis:bd}),xd=["input","button","textarea","select"],Cd=function(t,e,n){(e.disabled()?Ed:Ad)(t,e)},Sd=function(t,e){return!0===e.useNative&&H(xd,Pt(t.element))},kd=function(t){Ne(t.element,"disabled","disabled")},Od=function(t){Le(t.element,"disabled")},_d=function(t){Ne(t.element,"aria-disabled","true")},Td=function(t){Ne(t.element,"aria-disabled","false")},Ed=function(t,e,n){e.disableClass.each((function(e){Tu(t.element,e)})),(Sd(t,e)?kd:_d)(t),e.onDisabled(t)},Ad=function(t,e,n){e.disableClass.each((function(e){Au(t.element,e)})),(Sd(t,e)?Od:Td)(t),e.onEnabled(t)},Dd=function(t,e){return Sd(t,e)?function(t){return Ie(t.element,"disabled")}(t):function(t){return"true"===Be(t.element,"aria-disabled")}(t)},Md=Object.freeze({__proto__:null,enable:Ad,disable:Ed,isDisabled:Dd,onLoad:Cd,set:function(t,e,n,r){(r?Ed:Ad)(t,e)}}),Rd=Object.freeze({__proto__:null,exhibit:function(t,e){return mu({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return Oi([_i(Qo(),(function(e,n){return Dd(e,t)})),oc(t,e,Cd)])}}),Nd=[ao("disabled",S),eo("useNative",!0),Xr("disableClass"),pa("onDisabled"),pa("onEnabled")],zd=lc({fields:Nd,name:"disabling",active:Rd,apis:Md}),Bd=function(t,e,n,r){var o=qs(t.element,"."+e.highlightClass);W(o,(function(n){F(r,(function(t){return t.element===n}))||(Au(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),yi(n,bi())})))}))},Pd=function(t,e,n,r){Bd(t,e,0,[r]),Id(t,e,n,r)||(Tu(r.element,e.highlightClass),e.onHighlight(t,r),yi(r,vi()))},Id=function(t,e,n,r){return Du(r.element,e.highlightClass)},Ld=function(t,e,n,r){var o=qs(t.element,"."+e.itemClass);return z.from(o[r]).fold((function(){return zn.error(new Error("No element found with index "+r))}),t.getSystem().getByDom)},Hd=function(t,e,n){return Zu(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Fd=function(t,e,n){var r=qs(t.element,"."+e.itemClass);return(r.length>0?z.some(r[r.length-1]):z.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Vd=function(t,e,n,r){var o=qs(t.element,"."+e.itemClass);return Y(o,(function(t){return Du(t,e.highlightClass)})).bind((function(e){var n=Na(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},jd=function(t,e,n){var r=qs(t.element,"."+e.itemClass);return St(U(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},Ud=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return Bd(t,e,0,[])},dehighlight:function(t,e,n,r){Id(t,e,n,r)&&(Au(r.element,e.highlightClass),e.onDehighlight(t,r),yi(r,bi()))},highlight:Pd,highlightFirst:function(t,e,n){Hd(t,e).each((function(r){Pd(t,e,n,r)}))},highlightLast:function(t,e,n){Fd(t,e).each((function(r){Pd(t,e,n,r)}))},highlightAt:function(t,e,n,r){Ld(t,e,n,r).fold((function(t){throw t}),(function(r){Pd(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=jd(t,e);K(o,r).each((function(r){Pd(t,e,n,r)}))},isHighlighted:Id,getHighlighted:function(t,e,n){return Zu(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:Hd,getLast:Fd,getPrevious:function(t,e,n){return Vd(t,e,0,-1)},getNext:function(t,e,n){return Vd(t,e,0,1)},getCandidates:jd}),Wd=[Hr("highlightClass"),Hr("itemClass"),pa("onHighlight"),pa("onDehighlight")],qd=lc({fields:Wd,name:"highlighting",apis:Ud}),Gd=[8],$d=[9],Xd=[13],Kd=[27],Yd=[32],Jd=[37],Qd=[38],Zd=[39],tm=[40],em=function(t,e,n){var r=tt(t.slice(0,e)),o=tt(t.slice(e+1));return K(r.concat(o),n)},nm=function(t,e,n){var r=tt(t.slice(0,e));return K(r,n)},rm=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return K(o.concat(r),n)},om=function(t,e,n){var r=t.slice(e+1);return K(r,n)},im=function(t){return function(e){var n=e.raw;return H(t,n.which)}},um=function(t){return function(e){return Z(t,(function(t){return t(e)}))}},am=function(t){return!0===t.raw.shiftKey},cm=function(t){return!0===t.raw.ctrlKey},sm=x(am),lm=function(t,e){return{matches:t,classification:e}},fm=function(t,e,n){e.exists((function(t){return n.exists((function(e){return ce(e,t)}))}))||wi(t,mi(),{prevFocus:e,newFocus:n})},dm=function(){var t=function(t){return wc(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);fm(e,r,o)}}},mm=function(){var t=function(t){return qd.getHighlighted(t).map((function(t){return t.element}))};return{get:t,set:function(e,n){var r=t(e);e.getSystem().getByDom(n).fold(h,(function(t){qd.highlight(e,t)}));var o=t(e);fm(e,r,o)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Hs||(Hs={}));var gm,hm=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,u,a=n(t,e,r,o);return(i=a,u=e.event,K(i,(function(t){return t.matches(u)})).map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},u={schema:function(){return t.concat([eo("focusManager",dm()),no("focusInside","onFocus",Ar((function(t){return H(["onFocus","onEnterOrSpace","onApi"],t)?zn.value(t):zn.error("Invalid value for focusInside")}))),wa("handler",u),wa("state",e),wa("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var u=t.focusInside!==Hs.OnFocusMode?z.none():o(t).map((function(n){return Ei(Xo(),(function(r,o){n(r,t,e),o.stop()}))})),a=[Ei(Io(),(function(r,u){i(r,u,n,t,e).fold((function(){!function(n,r){var i=im(Yd.concat(Xd))(r.event);t.focusInside===Hs.OnEnterOrSpaceMode&&i&&xo(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,u)}),(function(t){u.stop()}))})),Ei(Lo(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return Oi(u.toArray().concat(a))}};return u},pm=function(t){var e=[Xr("onEscape"),Xr("onEnter"),eo("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),eo("firstTabstop",0),eo("useTabstopAt",k),Xr("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return ta(e,t)})).getOr(e);return Ze(n)>0},r=function(t,e,r){(function(t,e){var r=qs(t.element,e.selector),o=G(r,(function(t){return n(e,t)}));return z.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},o=function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?z.some(!0):z.none()}),(function(e){return o.focusManager.set(t,e),z.some(!0)}))},i=function(t,e,n,r){var i=qs(t.element,n.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return ta(t,e.selector)}))}(t,n).bind((function(e){return Y(i,w(ce,e)).bind((function(e){return o(t,i,e,n,r)}))}))},u=v([lm(um([am,im($d)]),(function(t,e,n){var r=n.cyclic?em:nm;return i(t,0,n,r)})),lm(im($d),(function(t,e,n){var r=n.cyclic?rm:om;return i(t,0,n,r)})),lm(im(Kd),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),lm(um([sm,im(Xd)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),a=v([]);return hm(e,lu.init,u,a,(function(){return z.some(r)}))},vm=pm(Ir("cyclic",S)),bm=pm(Ir("cyclic",k)),ym=function(t,e,n){return vd(n)&&im(Yd)(e.event)?z.none():function(t,e,n){return Ci(t,n,Qo()),z.some(!0)}(t,0,n)},wm=function(t,e){return z.some(!0)},xm=[eo("execute",ym),eo("useSpace",!1),eo("useEnter",!0),eo("useControlEnter",!1),eo("useDown",!1)],Cm=function(t,e,n){return n.execute(t,e,t.element)},Sm=hm(xm,lu.init,(function(t,e,n,r){var o=n.useSpace&&!vd(t.element)?Yd:[],i=n.useEnter?Xd:[],u=n.useDown?tm:[],a=o.concat(i).concat(u);return[lm(im(a),Cm)].concat(n.useControlEnter?[lm(um([cm,im(Xd)]),Cm)]:[])}),(function(t,e,n,r){return n.useSpace&&!vd(t.element)?[lm(im(Yd),wm)]:[]}),(function(){return z.none()})),km=function(){var t=Fc();return fu({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set({numRows:e,numColumns:n})},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},Om=Object.freeze({__proto__:null,flatgrid:km,init:function(t){return t.state(t)}}),_m=function(t){return function(e,n,r,o){var i=t(e.element);return Dm(i,e,n,r,o)}},Tm=function(t,e){var n=cs(t,e);return _m(n)},Em=function(t,e){var n=cs(e,t);return _m(n)},Am=function(t){return function(e,n,r,o){return Dm(t,e,n,r,o)}},Dm=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},Mm=Am,Rm=Am,Nm=Am,zm=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},Bm=function(t,e,n){var r=qs(t,n);return function(t,e){return Y(t,e).map((function(e){return{index:e,candidates:t}}))}(G(r,zm),(function(t){return ce(t,e)}))},Pm=function(t,e){return Y(t,(function(t){return ce(e,t)}))},Im=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?z.some(t[r]):z.none()}))},Lm=function(t,e,n,r,o){return Im(t,e,r,(function(e,i){var u=e===n-1?t.length-e*r:r,a=Na(i,o,0,u-1);return z.some({row:e,column:a})}))},Hm=function(t,e,n,r,o){return Im(t,e,r,(function(e,i){var u=Na(e,o,0,n-1),a=u===n-1?t.length-u*r:r,c=za(i,0,a-1);return z.some({row:u,column:c})}))},Fm=[Hr("selector"),eo("execute",ym),va("onEscape"),eo("captureTab",!1),Ca()],Vm=function(t,e,n){Zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},jm=function(t){return function(e,n,r,o){return Bm(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},Um=function(t,e,n){return n.captureTab?z.some(!0):z.none()},Wm=jm((function(t,e,n,r){return Lm(t,e,n,r,-1)})),qm=jm((function(t,e,n,r){return Lm(t,e,n,r,1)})),Gm=jm((function(t,e,n,r){return Hm(t,e,n,r,-1)})),$m=jm((function(t,e,n,r){return Hm(t,e,n,r,1)})),Xm=v([lm(im(Jd),Tm(Wm,qm)),lm(im(Zd),Em(Wm,qm)),lm(im(Qd),Mm(Gm)),lm(im(tm),Rm($m)),lm(um([am,im($d)]),Um),lm(um([sm,im($d)]),Um),lm(im(Kd),(function(t,e,n){return n.onEscape(t,e)})),lm(im(Yd.concat(Xd)),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return ta(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),Km=v([lm(im(Yd),wm)]),Ym=hm(Fm,km,Xm,Km,(function(){return z.some(Vm)})),Jm=function(t,e,n,r){var o=function(t,e,n){var i,u=Na(e,r,0,n.length-1);return u===t?z.none():(i=n[u],"button"===Pt(i)&&"disabled"===Be(i,"disabled")?o(t,u,n):z.from(n[u]))};return Bm(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},Qm=[Hr("selector"),eo("getInitial",z.none),eo("execute",ym),va("onEscape"),eo("executeOnMove",!1),eo("allowVertical",!0)],Zm=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return ta(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},tg=function(t,e,n){e.getInitial(t).orThunk((function(){return Zu(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},eg=function(t,e,n){return Jm(t,n.selector,e,-1)},ng=function(t,e,n){return Jm(t,n.selector,e,1)},rg=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?Zm(e,n,r):z.some(!0)}))}},og=function(t,e,n){return n.onEscape(t,e)},ig=v([lm(im(Yd),wm)]),ug=hm(Qm,lu.init,(function(t,e,n,r){var o=Jd.concat(n.allowVertical?Qd:[]),i=Zd.concat(n.allowVertical?tm:[]);return[lm(im(o),rg(Tm(eg,ng))),lm(im(i),rg(Em(eg,ng))),lm(im(Xd),Zm),lm(im(Yd),Zm),lm(im(Kd),og)]}),ig,(function(){return z.some(tg)})),ag=function(t,e,n){return z.from(t[e]).bind((function(t){return z.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},cg=function(t,e,n,r){var o=t[e].length,i=Na(n,r,0,o-1);return ag(t,e,i)},sg=function(t,e,n,r){var o=Na(n,r,0,t.length-1),i=t[o].length,u=za(e,0,i-1);return ag(t,o,u)},lg=function(t,e,n,r){var o=t[e].length,i=za(n+r,0,o-1);return ag(t,e,i)},fg=function(t,e,n,r){var o=za(n+r,0,t.length-1),i=t[o].length,u=za(e,0,i-1);return ag(t,o,u)},dg=[qr("selectors",[Hr("row"),Hr("cell")]),eo("cycles",!0),eo("previousSelector",z.none),eo("execute",ym)],mg=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return Zu(t.element,n.cell)})).each((function(n){e.focusManager.set(t,n)}))},gg=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return ta(r,o.selectors.row).bind((function(t){var e=qs(t,o.selectors.cell);return Pm(e,r).bind((function(e){var r=qs(n,o.selectors.row);return Pm(r,t).bind((function(t){var n=function(t,e){return U(t,(function(t){return qs(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},hg=gg((function(t,e,n){return cg(t,e,n,-1)}),(function(t,e,n){return lg(t,e,n,-1)})),pg=gg((function(t,e,n){return cg(t,e,n,1)}),(function(t,e,n){return lg(t,e,n,1)})),vg=gg((function(t,e,n){return sg(t,n,e,-1)}),(function(t,e,n){return fg(t,n,e,-1)})),bg=gg((function(t,e,n){return sg(t,n,e,1)}),(function(t,e,n){return fg(t,n,e,1)})),yg=v([lm(im(Jd),Tm(hg,pg)),lm(im(Zd),Em(hg,pg)),lm(im(Qd),Mm(vg)),lm(im(tm),Rm(bg)),lm(im(Yd.concat(Xd)),(function(t,e,n){return wc(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),wg=v([lm(im(Yd),wm)]),xg=hm(dg,lu.init,yg,wg,(function(){return z.some(mg)})),Cg=[Hr("selector"),eo("execute",ym),eo("moveOnTab",!1)],Sg=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},kg=function(t,e,n){Zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Og=function(t,e,n){return Jm(t,n.selector,e,-1)},_g=function(t,e,n){return Jm(t,n.selector,e,1)},Tg=v([lm(im(Qd),Nm(Og)),lm(im(tm),Nm(_g)),lm(um([am,im($d)]),(function(t,e,n,r){return n.moveOnTab?Nm(Og)(t,e,n,r):z.none()})),lm(um([sm,im($d)]),(function(t,e,n,r){return n.moveOnTab?Nm(_g)(t,e,n,r):z.none()})),lm(im(Xd),Sg),lm(im(Yd),Sg)]),Eg=v([lm(im(Yd),wm)]),Ag=hm(Cg,lu.init,Tg,Eg,(function(){return z.some(kg)})),Dg=[va("onSpace"),va("onEnter"),va("onShiftEnter"),va("onLeft"),va("onRight"),va("onTab"),va("onShiftTab"),va("onUp"),va("onDown"),va("onEscape"),eo("stopSpaceKeyup",!1),Xr("focusIn")],Mg=hm(Dg,lu.init,(function(t,e,n){return[lm(im(Yd),n.onSpace),lm(um([sm,im(Xd)]),n.onEnter),lm(um([am,im(Xd)]),n.onShiftEnter),lm(um([am,im($d)]),n.onShiftTab),lm(um([sm,im($d)]),n.onTab),lm(im(Qd),n.onUp),lm(im(tm),n.onDown),lm(im(Jd),n.onLeft),lm(im(Zd),n.onRight),lm(im(Yd),n.onSpace),lm(im(Kd),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[lm(im(Yd),wm)]:[]}),(function(t){return t.focusIn})),Rg=vm.schema(),Ng=bm.schema(),zg=ug.schema(),Bg=Ym.schema(),Pg=xg.schema(),Ig=Sm.schema(),Lg=Ag.schema(),Hg=Mg.schema(),Fg=dc({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Rg,cyclic:Ng,flow:zg,flatgrid:Bg,matrix:Pg,execution:Ig,menu:Lg,special:Hg}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){!function(t){return xt(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:Om}),Vg=function(t,e,n,r){var o=t.getSystem().build(r);Al(t,o,n)},jg=function(t,e,n,r){var o=Ug(t);K(o,(function(t){return ce(r.element,t.element)})).each(Ml)},Ug=function(t,e){return t.components()},Wg=function(t,e,n,r,o){var i=Ug(t);return z.from(i[r]).map((function(e){return jg(t,0,0,e),o.each((function(e){Vg(t,0,(function(t,e){!function(t,e,n){be(t,n).fold((function(){pn(t,e)}),(function(t){mn(t,e)}))}(t,e,r)}),e)})),e}))},qg=lc({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){Vg(t,0,pn,r)},prepend:function(t,e,n,r){Vg(t,0,hn,r)},remove:jg,replaceAt:Wg,replaceBy:function(t,e,n,r,o){var i=Ug(t);return Y(i,r).bind((function(e){return Wg(t,0,0,e,o)}))},set:function(t,e,n,r){xc((function(){var e=U(r,t.getSystem().build);Tl(t,e)}),t.element)},contents:Ug})}),Gg=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=Oi(e);return lc({fields:[Hr("enabled")],name:t,active:{events:v(n)}})}(t,e),configAsRaw:v({}),initialConfig:{},state:lu}}},$g=function(t,e){e.ignore||(vc(t.element),e.onFocus(t))},Xg=Object.freeze({__proto__:null,focus:$g,blur:function(t,e){e.ignore||function(t){t.dom.blur()}(t.element)},isFocused:function(t){return bc(t.element)}}),Kg=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return mu(n)},events:function(t){return Oi([Ei(Xo(),(function(e,n){$g(e,t),n.stop()}))].concat(t.stopMousedown?[Ei(Do(),(function(t,e){e.event.prevent()}))]:[]))}}),Yg=[pa("onFocus"),eo("stopMousedown",!1),eo("ignore",!1)],Jg=lc({fields:Yg,name:"focusing",active:Kg,apis:Xg}),Qg=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},Zg=function(t,e,n){e.toggleClass.each((function(e){n.get()?Tu(t.element,e):Au(t.element,e)}))},th=function(t,e,n){rh(t,e,n,!n.get())},eh=function(t,e,n){n.set(!0),Zg(t,e,n),Qg(t,e,n)},nh=function(t,e,n){n.set(!1),Zg(t,e,n),Qg(t,e,n)},rh=function(t,e,n,r){(r?eh:nh)(t,e,n)},oh=function(t,e,n){rh(t,e,n,e.selected)},ih=Object.freeze({__proto__:null,onLoad:oh,toggle:th,isOn:function(t,e,n){return n.get()},on:eh,off:nh,set:rh}),uh=Object.freeze({__proto__:null,exhibit:function(){return mu({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=th,Hi((function(t){o(t,n,r)}))),u=oc(t,e,oh);return Oi(J([t.toggleOnExecute?[i]:[],[u]]))}}),ah=function(t,e,n){Ne(t.element,"aria-expanded",n)},ch=[eo("selected",!1),Xr("toggleClass"),eo("toggleOnExecute",!0),no("aria",{mode:"none"},Br("mode",{pressed:[eo("syncWithExpanded",!1),wa("update",(function(t,e,n){Ne(t.element,"aria-pressed",n),e.syncWithExpanded&&ah(t,e,n)}))],checked:[wa("update",(function(t,e,n){Ne(t.element,"aria-checked",n)}))],expanded:[wa("update",ah)],selected:[wa("update",(function(t,e,n){Ne(t.element,"aria-selected",n)}))],none:[wa("update",h)]}))],sh=lc({fields:ch,name:"toggling",active:uh,apis:ih,state:(gm=!1,{init:function(){var t=lo(gm);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(gm)},readState:function(){return t.get()}}}})}),lh=function(){var t=function(t,e){e.stop(),xi(t)};return[Ei(Vo(),t),Ei(ti(),t),Ni(_o()),Ni(Do())]},fh=function(t){return Oi(J([t.map((function(t){return Hi((function(e,n){t(e),n.stop()}))})).toArray(),lh()]))},dh=function(t){(wc(t.element).isNone()||Jg.isFocused(t))&&(Jg.isFocused(t)||Jg.focus(t),wi(t,"alloy.item-hover",{item:t}))},mh=function(t){wi(t,"alloy.item-focus",{item:t})},gh=v("alloy.item-hover"),hh=v("alloy.item-focus"),ph=[Hr("data"),Hr("components"),Hr("dom"),eo("hasSubmenu",!1),Xr("toggling"),pf("itemBehaviours",[sh,Jg,Fg,df]),eo("ignoreFocus",!1),eo("domModification",{}),wa("builder",(function(t){return{dom:t.dom,domModification:_(_({},t.domModification),{attributes:_(_(_({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:vf(t.itemBehaviours,[t.toggling.fold(sh.revoke,(function(t){return sh.config(_({aria:{mode:"checked"}},t))})),Jg.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){mh(t)}}),Fg.config({mode:"execution"}),df.config({store:{mode:"memory",initialValue:t.data}}),Gg("item-type-events",E(E([],lh(),!0),[Ei(zo(),dh),Ei(Zo(),Jg.focus)],!1))]),components:t.components,eventOrder:t.eventOrder}})),eo("eventOrder",{})],vh=[Hr("dom"),Hr("components"),wa("builder",(function(t){return{dom:t.dom,components:t.components,events:Oi([zi(Zo())])}}))],bh=v("item-widget"),yh=v([Vf({name:"widget",overrides:function(t){return{behaviours:cc([df.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:h}})])}}})]),wh=[Hr("uid"),Hr("data"),Hr("components"),Hr("dom"),eo("autofocus",!1),eo("ignoreFocus",!1),pf("widgetBehaviours",[df,Jg,Fg]),eo("domModification",{}),cd(yh()),wa("builder",(function(t){var e=Zf(bh(),t,yh()),n=td(bh(),t,e.internals()),r=function(e){return ed(e,t,"widget").map((function(t){return Fg.focusIn(t),t}))},o=function(e,n){return vd(n.event.target)?z.none():t.autofocus?(n.setSource(e.element),z.none()):z.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:Oi([Hi((function(t,e){r(t).each((function(t){e.stop()}))})),Ei(zo(),dh),Ei(Zo(),(function(e,n){t.autofocus?r(e):Jg.focus(e)}))]),behaviours:vf(t.widgetBehaviours,[df.config({store:{mode:"memory",initialValue:t.data}}),Jg.config({ignore:t.ignoreFocus,onFocus:function(t){mh(t)}}),Fg.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:mc(),onLeft:o,onRight:o,onEscape:function(e,n){return Jg.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),z.none()):z.none():(Jg.focus(e),z.some(!0))}})])}}))],xh=Br("type",{widget:wh,item:ph,separator:vh}),Ch=v([Wf({factory:{sketch:function(t){var e=Nr("menu.spec item",xh,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return wt(e,"uid")?e:_(_({},e),{uid:eu("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Sh=v([Hr("value"),Hr("items"),Hr("dom"),Hr("components"),eo("eventOrder",{}),mf("menuBehaviours",[qd,df,wd,Fg]),no("movement",{mode:"menu",moveOnTab:!0},Br("mode",{grid:[Ca(),wa("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[wa("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),Hr("rowSelector")],menu:[eo("moveOnTab",!0),wa("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Fr("markers",fa()),eo("fakeFocus",!1),eo("focusManager",dm()),pa("onHighlight")]),kh=v("alloy.menu-focus"),Oh=pd({name:"Menu",configFields:Sh(),partFields:Ch(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:hf(t.menuBehaviours,[qd.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),df.config({store:{mode:"memory",initialValue:t.value}}),wd.config({find:z.some}),Fg.config(t.movement.config(t,t.movement))]),events:Oi([Ei(hh(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){qd.highlight(t,n),e.stop(),wi(t,kh(),{menu:t,item:n})}))})),Ei(gh(),(function(t,e){var n=e.event.item;qd.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),_h=function(t,e,n,r){return yt(n,r).bind((function(r){return yt(t,r).bind((function(r){var o=_h(t,e,n,r);return z.some([r].concat(o))}))})).getOr([])},Th=function(t,e){var n={};dt(t,(function(t,e){W(t,(function(t){n[t]=e}))}));var r=e,o=gt(e,(function(t,e){return{k:t,v:e}})),i=mt(o,(function(t,e){return[e].concat(_h(n,r,o,e))}));return mt(n,(function(t){return yt(i,t).getOr([t])}))},Eh=function(t){return"prepared"===t.type?z.some(t.menu):z.none()},Ah={init:function(){var t=lo({}),e=lo({}),n=lo({}),r=Fc(),o=lo({}),i=function(e,n,r){return u(e).bind((function(o){return function(e){return vt(t.get(),(function(t,n){return t===e}))}(e).bind((function(t){return n(t).map((function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}}))}))}))},u=function(t){return a(t).bind(Eh)},a=function(t){return yt(e.get(),t)},c=function(e){return yt(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(_(_({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,u,a,c){r.set(i),t.set(a),e.set(u),o.set(c);var s=Th(c,a);n.set(s)},expand:function(e){return yt(t.get(),e).map((function(t){var r=yt(n.get(),e).getOr([]);return[t].concat(r)}))},refresh:function(t){return yt(n.get(),t)},collapse:function(t){return yt(n.get(),t).bind((function(t){return t.length>1?z.some(t.slice(1)):z.none()}))},lookupMenu:a,lookupItem:c,otherMenus:function(t){var e=o.get();return et(lt(e),t)},getPrimary:function(){return r.get().bind(u)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.clear()},isClear:function(){return r.get().isNone()},getTriggeringPath:function(t,e){var o=G(c(t).toArray(),(function(t){return u(t).isSome()}));return yt(n.get(),t).bind((function(t){var n=tt(o.concat(t));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return z.none();e.push(r.getOrDie())}return z.some(e)}(Q(n,(function(t,o){return i(t,e,n.slice(0,o+1)).fold((function(){return Ct(r.get(),t)?[]:[z.none()]}),(function(t){return[z.some(t)]}))})))}))}}},extractPreparedMenu:Eh},Dh=v("collapse-item"),Mh=hd({name:"TieredMenu",configFields:[ya("onExecute"),ya("onEscape"),ba("onOpenMenu"),ba("onOpenSubmenu"),pa("onRepositionMenu"),pa("onCollapseMenu"),eo("highlightImmediately",!0),qr("data",[Hr("primary"),Hr("menus"),Hr("expansions")]),eo("fakeFocus",!1),pa("onHighlight"),pa("onHover"),ma(),Hr("dom"),eo("navigateOnHover",!0),eo("stayInDom",!1),mf("tmenuBehaviours",[Fg,qd,wd,qg]),eo("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r=Fc(),o=Ah.init(),i=function(e){var n=function(e,n,r){return mt(r,(function(r,o){var i=function(){return Oh.sketch(_(_({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?mm():dm()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))}(e,t.data.primary,t.data.menus),r=a();return o.setContents(t.data.primary,n,t.data.expansions,r),o.getPrimary()},u=function(t){return df.getValue(t).value},a=function(e){return mt(t.data.menus,(function(t,e){return Q(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},c=function(t,e){qd.highlight(t,e),qd.getHighlighted(e).orThunk((function(){return qd.getFirst(e)})).each((function(e){Ci(t,e.element,Zo())}))},s=function(t,e){return St(U(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?z.some(t.menu):z.none()}))})))},l=function(e,n,r){var o=s(n,n.otherMenus(r));W(o,(function(n){Ru(n.element,[t.markers.backgroundMenu]),t.stayInDom||qg.remove(e,n)}))},f=function(e,n){var o=function(e){return r.get().getOrThunk((function(){var n={},o=qs(e.element,"."+t.markers.item),i=G(o,(function(t){return"true"===Be(t,"aria-haspopup")}));return W(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=u(t);n[e]=t}))})),r.set(n),n}))}(e);dt(o,(function(t,e){var r=H(n,e);Ne(t.element,"aria-expanded",r)}))},d=function(e,n,r){return z.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return z.none();var i=o.menu,u=s(n,r.slice(1));return W(u,(function(e){Tu(e.element,t.markers.backgroundMenu)})),Ae(i.element)||qg.append(e,qu(i)),Ru(i.element,[t.markers.backgroundMenu]),c(e,i),l(e,n,r),z.some(i)}))}))};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(n||(n={}));var m=function(e,r,i){if(void 0===i&&(i=n.HighlightSubmenu),r.hasConfigured(zd)&&zd.isDisabled(r))return z.some(r);var a=u(r);return o.expand(a).bind((function(u){return f(e,u),z.from(u[0]).bind((function(a){return o.lookupMenu(a).bind((function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return o.setMenuBuilt(e,r),r}return n.menu}(e,a,c);return Ae(s.element)||qg.append(e,qu(s)),t.onOpenSubmenu(e,r,s,tt(u)),i===n.HighlightSubmenu?(qd.highlightFirst(s),d(e,o,u)):(qd.dehighlightAll(s),z.some(r))}))}))}))},g=function(e,n){var r=u(n);return o.collapse(r).bind((function(r){return f(e,r),d(e,o,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},p=function(e){return function(n,r){return ta(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map(k)}))}))}},v=Oi([Ei(kh(),(function(t,e){var n=e.event.item;o.lookupItem(u(n)).each((function(){var n=e.event.menu;qd.highlight(t,n);var r=u(e.event.item);o.refresh(r).each((function(e){return l(t,o,e)}))}))})),Hi((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){0===u(r).indexOf("collapse-item")&&g(e,r),m(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),h)}))})),Pi((function(e,n){i(e).each((function(n){qg.append(e,qu(n)),t.onOpenMenu(e,n),t.highlightImmediately&&c(e,n)}))}))].concat(t.navigateOnHover?[Ei(gh(),(function(e,r){var i=r.event.item;!function(t,e){var n=u(e);o.refresh(n).bind((function(e){return f(t,e),d(t,o,e)}))}(e,i),m(e,i,n.HighlightParent),t.onHover(e,i)}))]:[])),b=function(t){return qd.getHighlighted(t).bind(qd.getHighlighted)},y={collapseMenu:function(t){b(t).each((function(e){g(t,e)}))},highlightPrimary:function(t){o.getPrimary().each((function(e){c(t,e)}))},repositionMenus:function(e){o.getPrimary().bind((function(t){return b(e).bind((function(t){var e=u(t),n=bt(o.getMenus()),r=St(U(n,Ah.extractPreparedMenu));return o.getTriggeringPath(e,(function(t){return function(t,e,n){return st(e,(function(t){if(!t.getSystem().isConnected())return z.none();var e=qd.getCandidates(t);return K(e,(function(t){return u(t)===n}))}))}(0,r,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))})).fold((function(){(function(t){return z.from(t.components()[0]).filter((function(t){return"menu"===Be(t.element,"role")}))})(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:hf(t.tmenuBehaviours,[Fg.config({mode:"special",onRight:p((function(t,e){return vd(e.element)?z.none():m(t,e,n.HighlightSubmenu)})),onLeft:p((function(t,e){return vd(e.element)?z.none():g(t,e)})),onEscape:p((function(e,n){return g(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))})),focusIn:function(t,e){o.getPrimary().each((function(e){Ci(t,e.element,Zo())}))}}),qd.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),wd.config({find:function(t){return qd.getHighlighted(t)}}),qg.config({})]),eventOrder:t.eventOrder,apis:y,events:v}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:ho(t,e),expansions:{}}},collapseItem:function(t){return{value:Xi(Dh()),meta:{text:t}}}}}),Rh=hd({name:"InlineView",configFields:[Hr("lazySink"),pa("onShow"),pa("onHide"),Qr("onEscape"),mf("inlineBehaviours",[ql,df,gc]),to("fireDismissalEventInstead",[eo("event",fi())]),to("fireRepositionEventInstead",[eo("event",di())]),eo("getRelated",z.none),eo("isExtraPart",S),eo("eventOrder",z.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,(function(){return o.map((function(t){return An(t)}))}))},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();ql.openWhileCloaked(e,n,(function(){return Sl.positionWithinBounds(i,e,r,o())})),df.setValue(e,z.some({mode:"position",config:r,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return tc()},onRtl:function(){return ec()}}}:{},a=function(t){return function(t){return 2===t.length}(t)?u:{}};return Mh.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return ql.close(e),t.onEscape.map((function(t){return t(e)})),z.some(!0)},onExecute:function(){return z.some(!0)},onOpenMenu:function(t,e){Sl.positionWithinBounds(i().getOrDie(),e,n,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Sl.position(o,n,{anchor:_({type:"submenu",item:e},a(r))})},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Sl.positionWithinBounds(u,e,n,o()),W(r,(function(t){var e=a(t.triggeringPath);Sl.position(u,t.triggeredMenu,{anchor:_({type:"submenu",item:t.triggeringItem},e)})}))}})}(t,e,n,r,o);ql.open(e,i),df.setValue(e,z.some({mode:"menu",menu:i}))},i=function(e){ql.isOpen(e)&&df.getValue(e).each((function(n){switch(n.mode){case"menu":ql.getState(e).each(Mh.repositionMenus);break;case"position":var r=t.lazySink(e).getOrDie();Sl.positionWithinBounds(r,e,n.config,n.getBounds())}}))},u={setContent:function(t,e){ql.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,z.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,z.none)},showMenuWithinBounds:o,hide:function(t){ql.isOpen(t)&&(df.setValue(t,z.none()),ql.close(t))},getContent:function(t){return ql.getState(t)},reposition:i,isOpen:ql.isOpen};return{uid:t.uid,dom:t.dom,behaviours:hf(t.inlineBehaviours,[ql.config({isPartOf:function(e,n,r){return ra(n,r)||function(e,n){return t.getRelated(e).exists((function(t){return ra(t,n)}))}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),df.config({store:{mode:"memory",initialValue:z.none()}}),gc.config({channels:_(_({},Yl(_({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Ql(_(_({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:u}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),Nh=function(t){return t.x},zh=function(t,e){return t.x+t.width/2-e.width/2},Bh=function(t,e){return t.x+t.width-e.width},Ph=function(t){return t.y},Ih=function(t,e){return t.y+t.height-e.height},Lh=function(t,e){return t.y+t.height/2-e.height/2},Hh=function(t,e,n){return Sa(Bh(t,e),Ih(t,e),n.insetSouthwest(),Ea(),"southwest",Ba(t,{right:0,bottom:3}),"layout-inset")},Fh=function(t,e,n){return Sa(Nh(t),Ih(t,e),n.insetSoutheast(),Ta(),"southeast",Ba(t,{left:1,bottom:3}),"layout-inset")},Vh=function(t,e,n){return Sa(Bh(t,e),Ph(t),n.insetNorthwest(),_a(),"northwest",Ba(t,{right:0,top:2}),"layout-inset")},jh=function(t,e,n){return Sa(Nh(t),Ph(t),n.insetNortheast(),Oa(),"northeast",Ba(t,{left:1,top:2}),"layout-inset")},Uh=function(t,e,n){return Sa(zh(t,e),Ph(t),n.insetNorth(),Aa(),"north",Ba(t,{top:2}),"layout-inset")},Wh=function(t,e,n){return Sa(zh(t,e),Ih(t,e),n.insetSouth(),Da(),"south",Ba(t,{bottom:3}),"layout-inset")},qh=function(t,e,n){return Sa(Bh(t,e),Lh(t,e),n.insetEast(),Ra(),"east",Ba(t,{right:0}),"layout-inset")},Gh=function(t,e,n){return Sa(Nh(t),Lh(t,e),n.insetWest(),Ma(),"west",Ba(t,{left:1}),"layout-inset")},$h=function(t){switch(t){case"north":return Uh;case"northeast":return jh;case"northwest":return Vh;case"south":return Wh;case"southeast":return Fh;case"southwest":return Hh;case"east":return qh;case"west":return Gh}},Xh=function(t,e,n,r,o){return zc(r).map($h).getOr(Uh)(t,e,n,r,o)},Kh=function(t){switch(t){case"north":return Wh;case"northeast":return Fh;case"northwest":return Hh;case"south":return Uh;case"southeast":return jh;case"southwest":return Vh;case"east":return Gh;case"west":return qh}},Yh=function(t,e,n,r,o){return zc(r).map(Kh).getOr(Uh)(t,e,n,r,o)},Jh=tinymce.util.Tools.resolve("tinymce.util.Delay"),Qh=hd({name:"Button",factory:function(t){var e=fh(t.action),n=t.dom.tag,r=function(e){return yt(t.dom,"attributes").bind((function(t){return yt(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:vf(t.buttonBehaviours,[Jg.config({}),Fg.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return _({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[eo("uid",void 0),Hr("dom"),eo("components",[]),pf("buttonBehaviours",[Jg,Fg]),Xr("action"),Xr("role"),eo("eventOrder",{})]}),Zh=function(t){var e=function(t){return void 0!==t.uid}(t)&&xt(t,"uid")?t.uid:eu("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return _(_({},t),{uid:e})}}},tp=tinymce.util.Tools.resolve("tinymce.util.I18n"),ep={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},np=function(t){return function(){return yt(t,"temporary-placeholder").getOr("!not found!")}},rp=function(t,e){var n=t.toLowerCase();if(tp.isRtl()){var r=function(t,e){return At(t,e)?t:function(t,e){return t+e}(t,e)}(n,"-rtl");return wt(e,r)?r:n}return n},op=function(t,e){return yt(e,rp(t,e))},ip=function(t,e){var n=e();return op(t,n).getOrThunk(np(n))},up=function(){return Gg("add-focusable",[Pi((function(t){Qu(t.element,"svg").each((function(t){return Ne(t,"focusable","false")}))}))])},ap=function(t,e,n,r){var o,i,u=function(t){return!!tp.isRtl()&&wt(ep,t)}(e)?["tox-icon--flip"]:[],a=yt(n,rp(e,n)).or(r).getOrThunk(np(n));return{dom:{tag:t.tag,attributes:null!==(o=t.attributes)&&void 0!==o?o:{},classes:t.classes.concat(u),innerHtml:a},behaviours:cc(E(E([],null!==(i=t.behaviours)&&void 0!==i?i:[],!0),[up()],!1))}},cp=function(t,e,n,r){return void 0===r&&(r=z.none()),ap(e,t,n(),r)},sp={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},lp=hd({name:"Notification",factory:function(t){var e,n,r,o,i,u=Zh({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:cc([qg.config({})])}),a=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},c=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},s=Zh({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[a(0)]},c(0)],behaviours:cc([qg.config({})])}),l={updateProgress:function(t,e){t.getSystem().isConnected()&&s.getOpt(t).each((function(t){qg.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[a(e)]},c(e)])}))},updateText:function(t,e){if(t.getSystem().isConnected()){var n=u.get(t);qg.set(n,[Vu(e)])}}},f=J([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return z.from(sp[t])})).toArray()]),d=Zh(Qh.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[cp("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":t.translationProvider("Close")}},t.iconProvider)],action:function(e){t.onAction(e)}})),m=[(e=f,n={tag:"div",classes:["tox-notification__icon"]},r=t.iconProvider,o=r(),i=K(e,(function(t){return wt(o,rp(t,o))})),ap(n,i.getOr("temporary-placeholder"),o,z.none())),{dom:{tag:"div",classes:["tox-notification__body"]},components:[u.asSpec()],behaviours:cc([qg.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:cc([Jg.config({}),Gg("notification-events",[Ei(Bo(),(function(t){d.getOpt(t).each(Jg.focus)}))])]),components:m.concat(t.progress?[s.asSpec()]:[]).concat(t.closeButton?[d.asSpec()]:[]),apis:l}},configFields:[Xr("level"),Hr("progress"),Hr("icon"),Hr("onAction"),Hr("text"),Hr("iconProvider"),Hr("translationProvider"),uo("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function fp(t,e,n){var r=e.backstage.shared;return{open:function(e,o){var i=!e.closeButton&&e.timeout&&(e.timeout>0||e.timeout<0),u=function(){o(),Rh.hide(c)},a=Wu(lp.sketch({text:e.text,level:H(["success","error","warning","warn","info"],e.type)?e.type:void 0,progress:!0===e.progressBar,icon:z.from(e.icon),closeButton:!i,onAction:u,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),c=Wu(Rh.sketch(_({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));n.add(c),e.timeout>0&&Jh.setTimeout((function(){u()}),e.timeout);var s=function(){var e=An(zt.fromDom(t.getContentAreaContainer())),n=Mn(),r=za(n.x,e.x,e.right),o=za(n.y,e.y,e.bottom),i=Math.max(e.right,n.right),u=Math.max(e.bottom,n.bottom);return z.some(En(r,o,i-r,u-o))};return{close:u,moveTo:function(t,e){Rh.showAt(c,qu(a),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){var n=qu(a),o={maxHeightFunction:es()};if("banner"!==e&&f(t)){var i=function(t){switch(t){case"bc-bc":return Wh;case"tc-tc":return Uh;case"tc-bc":return Ga;case"bc-tc":default:return $a}}(e),u={type:"node",root:De(),node:z.some(zt.fromDom(t)),overrides:o,layouts:{onRtl:function(){return[i]},onLtr:function(){return[i]}}};Rh.showWithinBounds(c,n,{anchor:u},s)}else{var l=_(_({},r.anchors.banner()),{overrides:o});Rh.showWithinBounds(c,n,{anchor:l},s)}},text:function(t){lp.updateText(a,t)},settings:e,getEl:function(){return a.element.dom},progressBar:{value:function(t){lp.updateProgress(a,t)}}}},close:function(t){t.close()},reposition:function(t){t.length>0&&W(t,(function(e,n){0===n?e.moveRel(null,"banner"):e.moveRel(t[n-1].getEl(),"bc-tc")}))},getArgs:function(t){return t.settings}}}var dp,mp=function(t,e){var n=null,r=function(){a(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)}}},gp=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),hp=function(t,e,n,r,o){var i=gp(t,(function(e){return function(t,e){return t.isBlock(e)||H(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)}));return z.from(i.backwards(e,n,r,o))},pp=function(t,e){return vp(zt.fromDom(t.selection.getNode())).getOrThunk((function(){var n=zt.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return pn(n,zt.fromDom(e.extractContents())),e.insertNode(n.dom),he(n).each((function(t){return t.dom.normalize()})),function(t){return Ws(t,Us)}(n).map((function(e){t.selection.setCursorLocation(e.dom,function(t){return"img"===Pt(t)?1:Vs(t).fold((function(){return ve(t).length}),(function(t){return t.length}))}(e))})),n}))},vp=function(t){return ta(t,"[data-mce-autocompleter]")},bp=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},yp=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},wp=function(t,e){return t.substring(e.length)},xp=function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return z.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return hp(t,e.startContainer,e.startOffset,(function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(yp(o))return z.none();if(o===n)break}return z.some(r)}(r,e,n).getOr(e)}),i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return z.none();var i=bp(o);return 0!==i.lastIndexOf(n)||wp(i,n).length<r?z.none():z.some({text:wp(i,n),range:o,triggerChar:n})}))},Cp=function(t,e,n,r){return void 0===r&&(r=0),vp(zt.fromDom(e.startContainer)).fold((function(){return xp(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom);var o=bp(r);return z.some({range:r,text:wp(o,n),triggerChar:n})}))},Sp=function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){wi(t,Io(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(qd.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(xi),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(qd.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&vp(zt.fromDom(e.element)).isNone()&&t.cancelIfNecessary()}))},kp=tinymce.util.Tools.resolve("tinymce.util.Promise"),Op=function(t,e){return{container:t,offset:e}},_p=function(t){if(function(t){return 3===t.nodeType}(t))return Op(t,t.data.length);var e=t.childNodes;return e.length>0?_p(e[e.length-1]):Op(t,e.length)},Tp=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?Tp(n[e],0):n.length>0&&function(t){return 1===t.nodeType}(t)&&n.length===e?_p(n[n.length-1]):Op(t,e)},Ep=function(t){return function(e){var n=Tp(e.startContainer,e.startOffset);return!function(t,e){return hp(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!yp(e)})).isSome()}(t,n)}},Ap=function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return st(n.triggerChars,(function(n){return Cp(t,e,n)}))}(t.dom,r,n).bind((function(n){return Dp(t,e,n)}))},Dp=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,u=G(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return Ep(t.dom)}))(n.range,i,n.text)}));if(0===u.length)return z.none();var a=kp.all(U(u,(function(t){return t.fetch(n.text,t.maxResults,r).then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return z.some({lookupData:a,context:n})},Mp=gr([jr("type"),Jr("text")]),Rp=gr([eo("type","autocompleteitem"),eo("active",!1),eo("disabled",!1),eo("meta",{}),jr("value"),Jr("text"),Jr("icon")]),Np=gr([jr("type"),jr("ch"),ro("minChars",1),eo("columns",1),ro("maxResults",10),Qr("matches"),Wr("fetch"),Wr("onAction"),co("highlightOn",[],Cr)]),zp=[uo("disabled",!1),Jr("tooltip"),Jr("icon"),Jr("text"),ao("onSetup",(function(){return h}))],Bp=gr([jr("type"),Wr("onAction")].concat(zp)),Pp=function(t){return Mr("toolbarbutton",Bp,t)},Ip=[uo("active",!1)].concat(zp),Lp=gr(Ip.concat([jr("type"),Wr("onAction")])),Hp=function(t){return Mr("ToggleButton",Lp,t)},Fp=[ao("predicate",S),io("scope","node",["node","editor"]),io("position","selection",["node","selection","line"])],Vp=zp.concat([eo("type","contextformbutton"),eo("primary",!1),Wr("onAction"),Ir("original",b)]),jp=Ip.concat([eo("type","contextformbutton"),eo("primary",!1),Wr("onAction"),Ir("original",b)]),Up=zp.concat([eo("type","contextformbutton")]),Wp=Ip.concat([eo("type","contextformtogglebutton")]),qp=Br("type",{contextformbutton:Vp,contextformtogglebutton:jp}),Gp=gr([eo("type","contextform"),ao("initValue",v("")),Jr("label"),$r("commands",qp),Kr("launch",Br("type",{contextformbutton:Up,contextformtogglebutton:Wp}))].concat(Fp)),$p=gr([eo("type","contexttoolbar"),jr("items")].concat(Fp)),Xp=function(t){var e=t.ui.registry.getAll().popups,n=mt(e,(function(t){return(e=t,Mr("Autocompleter",Np,e)).fold((function(t){throw new Error(zr(t))}),b);var e})),r=function(t){var e={};return W(t,(function(t){e[t]={}})),lt(e)}(pt(n,(function(t){return t.ch}))),o=bt(n);return{dataset:n,triggerChars:r,lookupByChar:function(t){return G(o,(function(e){return e.ch===t}))}}};!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(dp||(dp={}));var Kp,Yp=dp,Jp="tox-menu-nav__js",Qp={normal:Jp,color:"tox-swatch"},Zp="tox-collection__item-label",tv="tox-collection__item--active",ev=function(t){return yt(Qp,t).getOr(Jp)},nv=function(t){return"color"===t?"tox-swatches":"tox-menu"},rv=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:nv(t),tieredMenu:"tox-tiered-menu"}},ov=function(t){var e=rv(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:ev(t)}},iv=function(t,e,n){var r=rv(n);return{tag:"div",classes:J([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},uv=[Oh.parts.items({})],av=function(t,e,n){var r=rv(n);return{dom:{tag:"div",classes:J([[r.tieredMenu]])},markers:ov(n)}},cv=function(t,e){return function(n){var r=j(n,e);return U(r,(function(e){return{dom:t,components:e}}))}},sv=function(t,e){var n=[],r=[];return W(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],wt(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),U(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},lv=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Oh.parts.items({preprocess:function(n){return"auto"!==t&&t>1?cv({tag:"div",classes:["tox-collection__group"]},t)(n):sv(n,(function(t,n){return"separator"===e[n].type}))}})]}},fv=function(t){return F(t,(function(t){return"icon"in t&&void 0!==t.icon}))},dv=function(t){return console.error(zr(t)),console.log(t),z.none()},mv=function(t,e,n,r,o){var i,u=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Oh.parts.items({preprocess:function(t){return sv(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:u.dom,components:u.components,items:n}},gv=function(t,e,n,r,o){var i;return"color"===o?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Oh.parts.items({preprocess:"auto"!==t?cv({tag:"div",classes:["tox-swatches__row"]},t):b})]}]}}(r)).dom,components:i.components,items:n}:"normal"===o&&"auto"===r?{value:t,dom:(i=lv(r,n)).dom,components:i.components,items:n}:"normal"===o&&1===r?{value:t,dom:(i=lv(1,n)).dom,components:i.components,items:n}:"normal"===o?{value:t,dom:(i=lv(r,n)).dom,components:i.components,items:n}:"listpreview"===o&&"auto"!==r?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Oh.parts.items({preprocess:cv({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:i.components,items:n}:{value:t,dom:iv(e,r,o),components:uv,items:n}},hv=[jr("type"),jr("src"),Jr("alt"),co("classes",[],Cr)],pv=gr(hv),vv=[jr("type"),jr("text"),Jr("name"),co("classes",["tox-collection__item-label"],Cr)],bv=gr(vv),yv=fr((function(){return Er("type",{cardimage:pv,cardtext:bv,cardcontainer:wv})})),wv=gr([jr("type"),oo("direction","horizontal"),oo("align","left"),oo("valign","middle"),$r("items",yv)]),xv=[uo("disabled",!1),Jr("text"),Jr("shortcut"),Pr("value","value",Zn((function(){return Xi("menuitem-value")})),yr()),eo("meta",{})],Cv=gr([jr("type"),Jr("label"),$r("items",yv),ao("onSetup",(function(){return h})),ao("onAction",h)].concat(xv)),Sv=gr([jr("type"),uo("active",!1),Jr("icon")].concat(xv)),kv=[jr("type"),jr("fancytype"),ao("onAction",h)],Ov=[eo("initData",{})].concat(kv),_v=[so("initData",{},[uo("allowCustomColors",!0),Zr("colors",yr())])].concat(kv),Tv=Br("fancytype",{inserttable:Ov,colorswatch:_v}),Ev=gr([jr("type"),ao("onSetup",(function(){return h})),ao("onAction",h),Jr("icon")].concat(xv)),Av=gr([jr("type"),Wr("getSubmenuItems"),ao("onSetup",(function(){return h})),Jr("icon")].concat(xv)),Dv=gr([jr("type"),Jr("icon"),uo("active",!1),ao("onSetup",(function(){return h})),Wr("onAction")].concat(xv)),Mv=function(t,e,n){var r=qs(t.element,"."+n);if(r.length>0){var o=Y(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return z.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return z.none()},Rv=function(t,e){return cc([Gg(t,e)])},Nv=function(t){return Rv(Xi("unnamed-events"),t)},zv=Xi("tooltip.exclusive"),Bv=Xi("tooltip.show"),Pv=Xi("tooltip.hide"),Iv=function(t,e,n){t.getSystem().broadcastOn([zv],{})},Lv=Object.freeze({__proto__:null,hideAllExclusive:Iv,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&qg.set(t,r)}))}}),Hv=Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){Ml(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return Oi(J([[Ei(Bv,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){Iv(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:Oi("normal"===t.mode?[Ei(zo(),(function(t){yi(n,Bv)})),Ei(Ro(),(function(t){yi(n,Pv)}))]:[]),behaviours:cc([qg.config({})])});e.setTooltip(o),El(r,o),t.onShow(n,o),Sl.position(r,o,{anchor:t.anchor(n)})}}(n)}),t.delay)})),Ei(Pv,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Ei(Jo(),(function(t,e){var r=e;r.universal||H(r.channels,zv)&&n(t)})),Ii((function(t){n(t)}))],"normal"===t.mode?[Ei(Bo(),(function(t){yi(t,Bv)})),Ei(Ko(),(function(t){yi(t,Pv)})),Ei(zo(),(function(t){yi(t,Bv)})),Ei(Ro(),(function(t){yi(t,Pv)}))]:[Ei(vi(),(function(t,e){yi(t,Bv)})),Ei(bi(),(function(t){yi(t,Pv)}))]]))}}),Fv=[Hr("lazySink"),Hr("tooltipDom"),eo("exclusive",!0),eo("tooltipComponents",[]),eo("delay",300),io("mode","normal",["normal","follow-highlight"]),eo("anchor",(function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:v([$a,Ga,ja,Wa,Ua,qa]),onRtl:v([$a,Ga,ja,Wa,Ua,qa])}}})),pa("onHide"),pa("onShow")],Vv=lc({fields:Fv,name:"tooltipping",active:Hv,state:Object.freeze({__proto__:null,init:function(){var t=Fc(),e=Fc(),n=function(){t.on(clearTimeout)},r=v("not-implemented");return fu({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:n,resetTimer:function(e,r){n(),t.set(setTimeout(e,r))},readState:r})}}),apis:Lv}),jv=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Uv=tinymce.util.Tools.resolve("tinymce.EditorManager"),Wv=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},qv=function(t){return t.getParam("width",jv.DOM.getStyle(t.getElement(),"width"))},Gv=function(t){return z.from(t.getParam("min_width")).filter(m)},$v=function(t){return z.from(t.getParam("min_height")).filter(m)},Xv=function(t){return z.from(t.getParam("max_width")).filter(m)},Kv=function(t){return z.from(t.getParam("max_height")).filter(m)},Yv=function(t){return!1!==t.getParam("menubar",!0,"boolean")},Jv=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=o(e),i=u(e)&&e.length>0;return!Zv(t)&&(i||r||n)},Qv=function(t){var e=V(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=G(e,(function(t){return"string"==typeof t}));return n.length>0?z.some(n):z.none()},Zv=function(t){return Qv(t).fold((function(){return t.getParam("toolbar",[],"string[]").length>0}),k)};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(Kp||(Kp={}));var tb,eb=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(tb||(tb={}));var nb,rb,ob=function(t){return t.getParam("toolbar_location",tb.auto,"string")},ib=function(t){return ob(t)===tb.bottom},ub=function(t){if(!t.inline)return z.none();var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);if(e.length>0)return Zu(De(),e);var n=function(t){return t.getParam("fixed_toolbar_container_target")}(t);return f(n)?z.some(zt.fromDom(n)):z.none()},ab=function(t){return t.inline&&ub(t).isSome()},cb=function(t){return ub(t).getOrThunk((function(){return Oe(ke(zt.fromDom(t.getElement())))}))},sb=function(t){return t.inline&&!Yv(t)&&!Jv(t)&&!Zv(t)},lb=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!ab(t)&&!sb(t)},fb=function(t){var e=t.getParam("menu");return e?mt(e,(function(t){return _(_({},t),{items:t.items})})):{}},db=function(t){return t.getParam("menubar")},mb=function(t){return t.getParam("anchor_top","#top")},gb=function(t){return t.getParam("anchor_bottom","#bottom")},hb=gr([(nb="readonly",Fr(nb,Sr))]),pb=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([Gl()],{target:n}),t.uiMothership.broadcastOn([Gl()],{target:n})),t.mothership.broadcastOn(["silver.readonly"],{readonly:e}),t.uiMothership.broadcastOn(["silver.readonly"],{readonly:e})},vb=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&pb(e,!0)})),t.on("SwitchMode",(function(){return pb(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},bb=function(){var t;return gc.config({channels:(t={},t["silver.readonly"]={schema:hb,onReceive:function(t,e){zd.set(t,e.readonly)}},t)})},yb=function(t){return zd.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},wb=function(t){return zd.config({disabled:t})},xb=function(t){return zd.config({disabled:t,disableClass:"tox-tbtn--disabled"})},Cb=function(t){return zd.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Sb=function(t,e){var n=t.getApi(e);return function(t){t(n)}},kb=function(t,e){return Pi((function(n){Sb(t,n)((function(n){var r=t.onSetup(n);d(r)&&e.set(r)}))}))},Ob=function(t,e){return Ii((function(n){return Sb(t,n)(e.get())}))},_b=function(t,e){return Hi((function(n,r){Sb(t,n)(t.onAction),t.triggersSubmenu||e!==Yp.CLOSE_ON_EXECUTE||(yi(n,ni()),r.stop())}))},Tb=((rb={})[Qo()]=["disabling","alloy.base.behaviour","toggling","item-events"],rb),Eb=St,Ab=function(t,e,n,r){var o=lo(h);return{type:"item",dom:e.dom,components:Eb(e.optComponents),data:t.data,eventOrder:Tb,hasSubmenu:t.triggersSubmenu,itemBehaviours:cc([Gg("item-events",[_b(t,n),kb(t,o),Ob(t,o)]),yb((function(){return t.disabled||r.isDisabled()})),bb(),qg.config({})].concat(t.itemBehaviours))}},Db=function(t){return{value:t.value,meta:_({text:t.text.getOr("")},t.meta)}},Mb=tinymce.util.Tools.resolve("tinymce.Env"),Rb=function(t){var e=Mb.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=U(n,(function(t){var n=t.toLowerCase().trim();return wt(e,n)?e[n]:t}));return Mb.mac?r.join(""):r.join("+")},Nb=function(t,e,n){return void 0===n&&(n=["tox-collection__item-icon"]),cp(t,{tag:"div",classes:n},e)},zb=function(t){return{dom:{tag:"div",classes:[Zp]},components:[Vu(tp.translate(t))]}},Bb=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},Pb=function(t,e){return{dom:{tag:"div",classes:[Zp]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Vu(tp.translate(e))]}]}},Ib=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:Rb(t)}}},Lb=function(t){return Nb("checkmark",t,["tox-collection__item-checkmark"])},Hb=function(t,e,n){var r,o,i=t.ariaLabel,u=t.value,a=t.iconContent.map((function(t){return function(t,e,n){var r=e();return op(t,r).or(n).getOrThunk(np(r))}(t,e.icons,n)}));return{dom:(r=a.getOr(""),o={tag:"div",attributes:i.map((function(t){return{title:e.translate(t)}})).getOr({}),classes:["tox-swatch"]},_(_({},o),"custom"===u?{tag:"button",classes:E(E([],o.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:r}:"remove"===u?{classes:E(E([],o.classes,!0),["tox-swatch--remove"],!1),innerHtml:r}:{attributes:_(_({},o.attributes),{"data-mce-color":u}),styles:{"background-color":u}})),optComponents:[]}},Fb=function(t){var e=t.map((function(t){return{attributes:{title:tp.translate(t)}}})).getOr({});return _({tag:"div",classes:[Jp,"tox-collection__item"]},e)},Vb=function(t,e,n,r){return void 0===r&&(r=z.none()),"color"===t.presets?Hb(t,e,r):function(t,e,n,r){var o={tag:"div",classes:["tox-collection__item-icon"]},i=n?t.iconContent.map((function(t){return cp(t,o,e.icons,r)})).orThunk((function(){return z.some({dom:o})})):z.none(),u=t.checkMark,a=z.from(t.meta).fold((function(){return zb}),(function(t){return wt(t,"style")?w(Pb,t.style):zb})),c=t.htmlContent.fold((function(){return t.textContent.map(a)}),(function(t){return z.some(Bb(t,[Zp]))}));return{dom:Fb(t.ariaLabel),optComponents:[i,c,t.shortcutContent.map(Ib),u,t.caret]}}(t,e,n,r)},jb=function(t,e){return yt(t,"tooltipWorker").map((function(t){return[Vv.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:es}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){Vv.setComponents(e,[ju({element:zt.fromDom(t)})])}))}})]})).getOr([])},Ub=function(t,e){var n=function(t){return jv.DOM.encode(t)}(tp.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return n},Wb=function(t,e){return U(t,(function(t){switch(t.type){case"cardcontainer":return function(t,e){return{dom:{tag:"div",classes:["tox-collection__item-container","vertical"===t.direction?"tox-collection__item-container--column":"tox-collection__item-container--row","left"===t.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right",function(){switch(t.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:e}}(t,Wb(t.items,e));case"cardimage":return function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}}(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return H(e.cardText.highlightOn,t)}))?z.from(e.cardText.matchText).getOr(""):"";return Bb(Ub(t.text,n),t.classes)}}))},qb=Xf(bh(),yh()),Gb=function(t){return{value:t}},$b=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Xb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Kb=function(t){return $b.test(t)||Xb.test(t)},Yb=function(t){return function(t,e){return Et(t,e)?function(t,e){return t.substring(e)}(t,e.length):t}(t,"#").toUpperCase()},Jb=function(t){var e=function(t){return{value:t.value.replace($b,(function(t,e,n,r){return e+e+n+n+r+r}))}}(t),n=Xb.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},Qb=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Zb=function(t){var e=Qb(t.red)+Qb(t.green)+Qb(t.blue);return Gb(e)},ty=Math.min,ey=Math.max,ny=Math.round,ry=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,oy=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,iy=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},uy=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},ay=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=ey(0,ty(i,1)),u=ey(0,ty(u,1)),0===i)return e=n=r=ny(255*u),iy(e,n,r,1);var a=o/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=ny(255*(e+l)),n=ny(255*(n+l)),r=ny(255*(r+l)),iy(e,n,r,1)},cy=function(t){var e=Jb(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return iy(n,r,o,1)},sy=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return iy(o,i,u,a)},ly=function(t){if("transparent"===t)return z.some(iy(0,0,0,0));var e=ry.exec(t);if(null!==e)return z.some(sy(e[1],e[2],e[3],"1"));var n=oy.exec(t);return null!==n?z.some(sy(n[1],n[2],n[3],n[4])):z.none()},fy=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},dy=iy(255,0,0,1),my=function(t,e){return t.fire("ResizeContent",e)},gy=function(t,e,n){return{hue:t,saturation:e,value:n}},hy=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(o,Math.min(i,u)),c=Math.max(o,Math.max(i,u));return a===c?gy(0,0,100*(r=a)):(n=60*((n=o===a?3:u===a?1:5)-(o===a?i-u:u===a?o-i:u-o)/(c-a)),e=(c-a)/c,r=c,gy(Math.round(n),Math.round(100*e),Math.round(100*r)))},py=function(t){return Zb(ay(t))},vy=function(t){return(e=t,Kb(e)?z.some({value:Yb(e)}):z.none()).orThunk((function(){return ly(t).map(Zb)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],u=r[2],a=r[3];return Zb(iy(o,i,u,a))}));var e},by=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");var yy,wy="choiceitem",xy=[{type:wy,text:"Light Green",value:"#BFEDD2"},{type:wy,text:"Light Yellow",value:"#FBEEB8"},{type:wy,text:"Light Red",value:"#F8CAC6"},{type:wy,text:"Light Purple",value:"#ECCAFA"},{type:wy,text:"Light Blue",value:"#C2E0F4"},{type:wy,text:"Green",value:"#2DC26B"},{type:wy,text:"Yellow",value:"#F1C40F"},{type:wy,text:"Red",value:"#E03E2D"},{type:wy,text:"Purple",value:"#B96AD9"},{type:wy,text:"Blue",value:"#3598DB"},{type:wy,text:"Dark Turquoise",value:"#169179"},{type:wy,text:"Orange",value:"#E67E23"},{type:wy,text:"Dark Red",value:"#BA372A"},{type:wy,text:"Dark Purple",value:"#843FA1"},{type:wy,text:"Dark Blue",value:"#236FA1"},{type:wy,text:"Light Gray",value:"#ECF0F1"},{type:wy,text:"Medium Gray",value:"#CED4D9"},{type:wy,text:"Gray",value:"#95A5A6"},{type:wy,text:"Dark Gray",value:"#7E8C8D"},{type:wy,text:"Navy Blue",value:"#34495E"},{type:wy,text:"Black",value:"#000000"},{type:wy,text:"White",value:"#ffffff"}],Cy=function(t){void 0===t&&(t=10);var e,n=by.getItem("tinymce-custom-colors"),r=o(n)?JSON.parse(n):[],i=t-(e=r).length<0?e.slice(0,t):e,u=function(t){i.splice(t,1)};return{add:function(e){(function(t,e){var n=L(t,e);return-1===n?z.none():z.some(n)})(i,e).each(u),i.unshift(e),i.length>t&&i.pop(),by.setItem("tinymce-custom-colors",JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Sy=function(t){return!1!==t.getParam("custom_colors")},ky=function(t){var e=function(t){return t.getParam("color_map")}(t);return void 0!==e?function(t){for(var e=[],n=0;n<t.length;n+=2)e.push({text:t[n+1],value:"#"+vy(t[n]).value,type:"choiceitem"});return e}(e):xy},Oy=function(t){Cy.add(t)},_y=function(t){return function(t,e){return t.getParam("color_cols",e,"number")}(t,function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))}(ky(t).length))},Ty=function(t){var e={type:"choiceitem",text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[e,{type:"choiceitem",text:"Custom color",icon:"color-picker",value:"custom"}]:[e]},Ey=function(t,e,n,r){"custom"===n?zy(t)((function(n){n.each((function(n){Oy(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},Ay=function(t,e){return t.concat(U(Cy.state(),(function(t){return{type:wy,text:t,value:t}})).concat(Ty(e)))},Dy=function(t,e){return function(n){n(Ay(t,e))}},My=function(t,e,n){var r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";t.setIconFill(r,n)},Ry=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),z.from(n)}(t,n).bind((function(t){return ly(t).map((function(t){var n=Zb(t).value;return Tt(e.toLowerCase(),n)}))})).getOr(!1)},columns:_y(t),fetch:Dy(ky(t),Sy(t)),onAction:function(e){Ey(t,n,o.get(),h)},onItemAction:function(r,i){Ey(t,n,i,(function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})}))},onSetup:function(n){My(n,e,o.get());var r=function(t){t.name===e&&My(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},Ny=function(t,e,n,r){t.ui.registry.addNestedMenuItem(e,{text:r,icon:"forecolor"===e?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(e){Ey(t,n,e.value,h)}}]}})},zy=function(t){return function(e,n){var r=!1,o={colorpicker:n};t.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(t,e){"hex-valid"===e.name&&(r=e.value)},onSubmit:function(n){var o=n.getData().colorpicker;r?(e(z.from(o)),n.close()):t.windowManager.alert(t.translate(["Invalid hex color code: {0}",o]))},onClose:h,onCancel:function(){e(z.none())}})}},By=function(t,e,n,r,o,i,u,a){var c=fv(e),s=Py(e,n,r,"color"!==o?"normal":"color",i,u,a);return gv(t,c,s,r,o)},Py=function(t,e,n,r,o,i,u){return St(U(t,(function(a){return"choiceitem"===a.type?(c=a,Mr("choicemenuitem",Sv,c)).fold(dv,(function(c){return z.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=Vb({presets:n,textContent:e?t.text:z.none(),htmlContent:z.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:z.none(),checkMark:e?z.some(Lb(u.icons)):z.none(),caret:z.none(),value:t.value},u,a);return Jn(Ab({data:Db(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){sh.set(t,e)},isActive:function(){return sh.isOn(t)},isDisabled:function(){return zd.isDisabled(t)},setDisabled:function(e){return zd.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),h},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:"tox-collection__item--enabled",toggleOnExecute:!1,selected:t.active}})}(c,1===n,r,e,i(a.value),o,u,fv(t)))})):z.none();var c})))},Iy=function(t,e){var n=ov(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")}},Ly=function(t,e){var n=t.initData.allowCustomColors&&e.colorinput.hasCustomColors();return t.initData.colors.fold((function(){return Ay(e.colorinput.getColors(),n)}),(function(t){return t.concat(Ty(n))}))},Hy=Xi("cell-over"),Fy=Xi("cell-execute"),Vy=function(t,e,n){var r,o=function(n){return wi(n,Fy,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return Wu({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:cc([Gg("insert-table-picker-cell",[Ei(zo(),Jg.focus),Ei(Qo(),o),Ei(Vo(),i),Ei(ti(),i)]),sh.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Jg.config({onFocus:function(n){return wi(n,Hy,{row:t,col:e})}})])})},jy=function(t){return Q(t,(function(t){return U(t,qu)}))},Uy=function(t,e){return Vu(e+"x"+t)},Wy={inserttable:function(t){var e=Xi("size-label"),n=function(t,e,n){for(var r=[],o=0;o<e;o++){for(var i=[],u=0;u<n;u++)i.push(Vy(o,u,t));r.push(i)}return r}(e,10,10),r=Uy(0,0),o=Zh({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[r],behaviours:cc([qg.config({})])});return{type:"widget",data:{value:Xi("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[qb.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:jy(n).concat(o.asSpec()),behaviours:cc([Gg("insert-table-picker",[Pi((function(t){qg.set(o.get(t),[r])})),Ri(Hy,(function(t,e,r){var i=r.event,u=i.row,a=i.col;!function(t,e,n,r,o){for(var i=0;i<r;i++)for(var u=0;u<o;u++)sh.set(t[i][u],i<=e&&u<=n)}(n,u,a,10,10),qg.set(o.get(t),[Uy(u+1,a+1)])})),Ri(Fy,(function(e,n,r){var o=r.event,i=o.row,u=o.col;t.onAction({numRows:i+1,numColumns:u+1}),yi(e,ni())}))]),Fg.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=Ly(t,e),r=e.colorinput.getColorCols(),o=By(Xi("menu-value"),n,(function(e){t.onAction({value:e})}),r,"color",Yp.CLOSE_ON_EXECUTE,S,e.shared.providers),i=_(_({},o),{markers:ov("color"),movement:Iy(r,"color")});return{type:"widget",data:{value:Xi("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[qb.widget(Oh.sketch(i))]}}},qy=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=Vb({presets:r,textContent:z.none(),htmlContent:n?t.text.map((function(t){return Ub(t,e)})):z.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:z.none(),checkMark:z.none(),caret:z.none(),value:t.value},u.providers,a,t.icon);return Ab({data:Db(t),disabled:t.disabled,getApi:v({}),onAction:function(e){return o(t.value,t.meta)},onSetup:v(h),triggersSubmenu:!1,itemBehaviours:jb(t.meta,u)},c,i,u.providers)},Gy=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:_({tag:"div",classes:["tox-collection__item","tox-collection__group-heading"]},e),components:[]}},$y=function(t,e,n,r){void 0===r&&(r=!0);var o=Vb({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:z.none(),ariaLabel:t.text,caret:z.none(),checkMark:z.none(),shortcutContent:t.shortcut},n,r);return Ab({data:Db(t),getApi:function(t){return{isDisabled:function(){return zd.isDisabled(t)},setDisabled:function(e){return zd.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)},Xy=function(t,e,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var i,u=o?(i=n.icons,Nb("chevron-down",i,["tox-collection__item-caret"])):function(t){return Nb("chevron-right",t,["tox-collection__item-caret"])}(n.icons),a=Vb({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:z.none(),ariaLabel:t.text,caret:z.some(u),checkMark:z.none(),shortcutContent:t.shortcut},n,r);return Ab({data:Db(t),getApi:function(t){return{isDisabled:function(){return zd.isDisabled(t)},setDisabled:function(e){return zd.set(t,e)}}},disabled:t.disabled,onAction:h,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},a,e,n)},Ky=function(t,e,n,r){void 0===r&&(r=!0);var o=Vb({iconContent:t.icon,textContent:t.text,htmlContent:z.none(),ariaLabel:t.text,checkMark:z.some(Lb(n.icons)),caret:z.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return Jn(Ab({data:Db(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){sh.set(t,e)},isActive:function(){return sh.isOn(t)},isDisabled:function(){return zd.isDisabled(t)},setDisabled:function(e){return zd.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:"tox-collection__item--enabled",toggleOnExecute:!1,selected:t.active}})},Yy=function(t,e){return yt(Wy,t.fancytype).map((function(n){return n(t,e)}))},Jy=function(t,e,n,r){var o={dom:Fb(t.label),optComponents:[z.some({dom:{tag:"div",classes:["tox-collection__item-container","tox-collection__item-container--row"]},components:Wb(t.items,r)})]};return Ab({data:Db(_({text:z.none()},t)),disabled:t.disabled,getApi:function(t){return{isDisabled:function(){return zd.isDisabled(t)},setDisabled:function(e){zd.set(t,e),W(qs(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(zd)&&zd.set(t,e)}))}))}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:z.from(r.itemBehaviours).getOr([])},o,e,n.providers)};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(yy||(yy={}));var Qy=function(t,e,n,r,o){var i,u=n.shared.providers,a=function(t){return o?_(_({},t),{shortcut:z.none(),icon:t.text.isSome()?z.none():t.icon}):t};switch(t.type){case"menuitem":return(i=t,Mr("menuitem",Ev,i)).fold(dv,(function(t){return z.some($y(a(t),e,u,r))}));case"nestedmenuitem":return function(t){return Mr("nestedmenuitem",Av,t)}(t).fold(dv,(function(t){return z.some(Xy(a(t),e,u,r,o))}));case"togglemenuitem":return function(t){return Mr("togglemenuitem",Dv,t)}(t).fold(dv,(function(t){return z.some(Ky(a(t),e,u,r))}));case"separator":return function(t){return Mr("separatormenuitem",Mp,t)}(t).fold(dv,(function(t){return z.some(Gy(t))}));case"fancymenuitem":return function(t){return Mr("fancymenuitem",Tv,t)}(t).fold(dv,(function(t){return Yy(a(t),n)}));default:return console.error("Unknown item in general menu",t),z.none()}},Zy=function(t,e,n,r,o,i,u){var a=1===r,c=!a||fv(t);return St(U(t,(function(t){switch(t.type){case"separator":return(r=t,Mr("Autocompleter.Separator",Mp,r)).fold(dv,(function(t){return z.some(Gy(t))}));case"cardmenuitem":return function(t){return Mr("cardmenuitem",Cv,t)}(t).fold(dv,(function(t){return z.some(Jy(_(_({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:jb(t.meta,i),cardText:{matchText:e,highlightOn:u}}))}));case"autocompleteitem":default:return function(t){return Mr("Autocompleter.Item",Rp,t)}(t).fold(dv,(function(t){return z.some(qy(t,e,a,"normal",n,o,i,c))}))}var r})))},tw=function(t,e,n,r,o){var i=fv(e),u=St(U(e,(function(t){var e=function(t){return Qy(t,n,r,function(t){return o?!wt(t,"text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(_(_({},t),{disabled:!0})):e(t)})));return(o?mv:gv)(t,i,u,1,"normal")},ew=function(t){return Mh.singleData(t.value,t)},nw=function(t,e){var n=Fc(),r=lo(!1),o=Wu(Rh.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:cc([Gg("dismissAutocompleter",[Ei(fi(),(function(){return a()}))])]),lazySink:e.getSink})),i=function(){return n.get().isSome()},u=function(){i()&&Rh.hide(o)},a=function(){if(i()){var e=n.get().map((function(t){return t.element}));vp(e.getOr(zt.fromDom(t.selection.getNode()))).each(wn),u(),n.clear(),r.set(!1)}},c=jt((function(){return Xp(t)})),s=function(e,n,r,i){e.matchLength=n.text.length;var u=st(r,(function(t){return z.from(t.columns)})).getOr(1);Rh.showAt(o,Oh.sketch(function(t,e,n,r){var o=n===yy.ContentFocus?mm():dm(),i=Iy(e,r),u=ov(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:n===yy.ContentFocus,focusManager:o,menuBehaviours:Nv("auto"!==e?[]:[Pi((function(t,e){Mv(t,4,u.item).each((function(e){var n=e.numColumns,r=e.numRows;Fg.setGridSize(t,r,n)}))}))])}}(gv("autocompleter-value",!0,i,u,"normal"),u,yy.ContentFocus,"normal")),{anchor:{type:"node",root:zt.fromDom(t.getBody()),node:z.from(e.element)}}),Rh.getContent(o).each(qd.highlightFirst)},l=function(o){(function(e){return n.get().map((function(n){return Cp(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return Dp(t,c,n,e)}))})).getOrThunk((function(){return Ap(t,c)}))})(o).fold(a,(function(o){!function(e){if(!i()){var o=pp(t,e.range);n.set({triggerChar:e.triggerChar,element:o,matchLength:e.text.length}),r.set(!1)}}(o.context),o.lookupData.then((function(i){n.get().map((function(n){var c,f,d,m=o.context;if(n.triggerChar===m.triggerChar){var g=(c=m.triggerChar,d=st(f=i,(function(t){return z.from(t.columns)})).getOr(1),Q(f,(function(n){var o=n.items;return Zy(o,n.matchText,(function(e,o){var i=t.selection.getRng();Cp(t.dom,i,c).fold((function(){return console.error("Lost context. Cursor probably moved")}),(function(t){var i=t.range,c={hide:function(){a()},reload:function(t){u(),l(t)}};r.set(!0),n.onAction(c,i,e,o),r.set(!1)}))}),d,Yp.BUBBLE_TO_SANDBOX,e,n.highlightOn)})));g.length>0?s(n,m,i,g):m.text.length-n.matchLength>=10?a():u()}}))}))}))},f={onKeypress:mp((function(t){27!==t.which&&l()}),50),cancelIfNecessary:a,isMenuOpen:function(){return Rh.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return Rh.getContent(o)}};!1===t.hasPlugin("rtc")&&Sp(f,t)},rw=function(t,e,n){return ta(t,e,n).isSome()},ow=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},schedule:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},iw=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?z.none():z.some(e.touches[0])},uw=function(t){var e=Fc(),n=lo(!1),r=ow((function(e){t.triggerEvent(ei(),e),n.set(!0)}),400),o=po([{key:_o(),value:function(t){return iw(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(i)})),z.none()}},{key:To(),value:function(t){return r.cancel(),iw(t).each((function(t){e.on((function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.clear()}))})),z.none()}},{key:Eo(),value:function(o){r.cancel();return e.get().filter((function(t){return ce(t.target,o.target)})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(ti(),o)}))}}]);return{fireIfReady:function(t,e){return yt(o,e).bind((function(e){return e(t)}))}}},aw=function(){return ie().browser.isFirefox()},cw=function(t,e){var n=_({stopBackspace:!0},e),r=uw(n),o=U(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return jc(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=Fc(),u=jc(t,"paste",(function(t){r.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),n.triggerEvent("paste",t)&&t.kill(),i.set(setTimeout((function(){n.triggerEvent(Yo(),t)}),0))})),a=jc(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():n.stopBackspace&&function(t){return t.raw.which===Gd[0]&&!H(["input","textarea"],Pt(t.target))&&!rw(t.target,'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return aw()?Uc(t,"focus",e):jc(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=Fc(),l=function(t,e){return aw()?Uc(t,"blur",e):jc(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(setTimeout((function(){n.triggerEvent(Ko(),t)}),0))}));return{unbind:function(){W(o,(function(t){t.unbind()})),a.unbind(),c.unbind(),l.unbind(),u.unbind(),i.on(clearTimeout),s.on(clearTimeout)}}},sw=function(t,e){var n=yt(t,"target").getOr(e);return lo(n)},lw=fo([{stopped:[]},{resume:["element"]},{complete:[]}]),fw=function(t,e,n,r,o,i){var u=t(e,r),a=function(t,e){var n=lo(!1),r=lo(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),lw.complete()}),(function(t){var n=t.descHandler;return gu(n)(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),lw.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),lw.complete()):he(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),lw.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),lw.resume(r)}))}))},dw=function(t,e,n,r,o,i){return fw(t,e,n,r,o,i).fold(k,(function(r){return dw(t,e,n,r,o,i)}),S)},mw=function(t,e,n){var r=function(t){var e=lo(!1);return{stop:function(){e.set(!0)},cut:h,isStopped:e.get,isCut:S,event:t,setSource:C("Cannot set source of a broadcasted event"),getSource:C("Cannot get source of a broadcasted event")}}(e);return W(t,(function(t){var e=t.descHandler;gu(e)(r)})),r.isStopped()},gw=function(t,e,n,r,o){var i=sw(n,r);return dw(t,e,n,r,i,o)},hw=function(){var t={};return{registerId:function(e,n,r){dt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=function(t,e){return n=w.apply(void 0,[t.handler].concat(e)),r=t.purpose,{cHandler:n,purpose:r};var n,r}(r,e),t[o]=i}))},unregisterId:function(e){dt(t,(function(t,n){wt(t,e)&&delete t[e]}))},filterByType:function(e){return yt(t,e).map((function(t){return pt(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){return yt(t,n).bind((function(t){return wo(r,(function(e){return function(t,e){return tu(e).bind((function(e){return yt(t,e)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}(t,e)}),e)}))}}},pw=function(){var t=hw(),e={},n=function(t){var e=t.element;return tu(e).getOrThunk((function(){return function(t,e){var n=Xi(Ji+t);return Zi(e,n),n}("uid-",t.element)}))},r=function(n){tu(n.element).each((function(n){delete e[n],t.unregisterId(n)}))};return{find:function(e,n,r){return t.find(e,n,r)},filter:function(e){return t.filterByType(e)},register:function(o){var i=n(o);xt(e,i)&&function(t,n){var o=e[n];if(o!==t)throw new Error('The tagId "'+n+'" is already used by: '+Wi(o.element)+"\nCannot use it for: "+Wi(t.element)+"\nThe conflicting element is"+(Ae(o.element)?" ":" not ")+"already in the DOM");r(t)}(o,i);var u=[o];t.registerId(u,i,o.events),e[i]=o},unregister:r,getById:function(t){return yt(e,t)}}},vw=hd({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=T(e,["attributes"]);return{uid:t.uid,dom:_({tag:"div",attributes:_({role:"presentation"},n)},r),components:t.components,behaviours:gf(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[eo("components",[]),mf("containerBehaviours",[]),eo("events",{}),eo("domModification",{}),eo("eventOrder",{})]}),bw=function(t){var e=function(e){return he(t.element).fold(k,(function(t){return ce(e,t)}))},n=pw(),r=function(t,r){return n.find(e,t,r)},o=cw(t.element,{triggerEvent:function(t,e){return aa(t,e.target,(function(n){return function(t,e,n,r){return gw(t,e,n,n.target,r)}(r,t,e,n)}))}}),i={debugInfo:v("real"),triggerEvent:function(t,e,n){aa(t,e,(function(o){return gw(r,t,n,e,o)}))},triggerFocus:function(t,e){tu(t).fold((function(){vc(t)}),(function(n){aa(Xo(),t,(function(n){return function(t,e,n,r,o){var i=sw(n,r);fw(t,e,n,r,i,o)}(r,Xo(),{originator:e,kill:h,prevent:h,target:t},t,n),!1}))}))},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:Wu,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){u(t)},removeFromWorld:function(t){a(t)},broadcast:function(t){f(t)},broadcastOn:function(t,e){d(t,e)},broadcastEvent:function(t,e){m(t,e)},isConnected:k},u=function(t){t.connect(i),Ht(t.element)||(n.register(t),W(t.components(),u),i.triggerEvent(oi(),t.element,{target:t.element}))},a=function(t){Ht(t.element)||(W(t.components(),a),n.unregister(t)),t.disconnect()},c=function(e){El(t,e)},s=function(t){Ml(t)},l=function(t){var e=n.filter(Jo());W(e,(function(e){var n=e.descHandler;gu(n)(t)}))},f=function(t){l({universal:!0,data:t})},d=function(t,e){l({universal:!1,channels:t,data:e})},m=function(t,e){var r=n.filter(t);return mw(r,e)},g=function(t){return n.getById(t).fold((function(){return zn.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),zn.value)},p=function(t){var e=tu(t).getOr("not found");return g(e)};return u(t),{root:t,element:t.element,destroy:function(){o.unbind(),yn(t.element)},add:c,remove:s,getByUid:g,getByDom:p,addToWorld:u,removeFromWorld:a,broadcast:f,broadcastOn:d,broadcastEvent:m}},yw=v([eo("prefix","form-field"),mf("fieldBehaviours",[wd,df])]),ww=v([Uf({schema:[Hr("dom")],name:"label"}),Uf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Hr("text")],name:"aria-descriptor"}),Vf({factory:{sketch:function(t){var e=go(t,["factory"]);return t.factory.sketch(e)}},schema:[Hr("factory")],name:"field"})]),xw=pd({name:"FormField",configFields:yw(),partFields:ww(),factory:function(t,e,n,r){var o=hf(t.fieldBehaviours,[wd.config({find:function(e){return ed(e,t,"field")}}),df.config({store:{mode:"manual",getValue:function(t){return wd.getCurrent(t).bind(df.getValue)},setValue:function(t,e){wd.getCurrent(t).each((function(t){df.setValue(t,e)}))}}})]),i=Oi([Pi((function(e,n){var r=rd(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=Xi(t.prefix);r.label().each((function(t){Ne(t.element,"for",n),Ne(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=Xi(t.prefix);Ne(n.element,"id",r),Ne(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return ed(e,t,"field")},getLabel:function(e){return ed(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),Cw=Object.freeze({__proto__:null,exhibit:function(t,e){return mu({attributes:po([{key:e.tabAttr,value:"true"}])})}}),Sw=[eo("tabAttr","data-alloy-tabstop")],kw=lc({fields:Sw,name:"tabstopping",active:Cw}),Ow=tinymce.util.Tools.resolve("tinymce.html.Entities"),_w=function(t,e,n,r){var o=Tw(t,e,n,r);return xw.sketch(o)},Tw=function(t,e,n,r){return{dom:Ew(n),components:t.toArray().concat([e]),fieldBehaviours:cc(r)}},Ew=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},Aw=function(t,e){return xw.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},Dw=Xi("form-component-change"),Mw=Xi("form-close"),Rw=Xi("form-cancel"),Nw=Xi("form-action"),zw=Xi("form-submit"),Bw=Xi("form-block"),Pw=Xi("form-unblock"),Iw=Xi("form-tabchange"),Lw=Xi("form-resize"),Hw=function(t,e){var n,r,o,i=t.label.map((function(t){return Aw(t,e)})),u=function(t){return function(e,n){ta(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,Be(r,"data-collection-item-value"))}))}},a=u((function(n,r,o,i){r.stop(),e.isDisabled()||wi(n,Nw,{name:t.name,value:i})})),c=[Ei(zo(),u((function(t,e,n){vc(n)}))),Ei(Vo(),a),Ei(ti(),a),Ei(Bo(),u((function(t,e,n){Zu(t.element,"."+tv).each((function(t){Au(t,tv)})),Tu(n,tv)}))),Ei(Po(),u((function(t){Zu(t.element,"."+tv).each((function(t){Au(t,tv)}))}))),Hi(u((function(e,n,r,o){wi(e,Nw,{name:t.name,value:o})})))],s=function(t,e){return U(qs(t.element,".tox-collection__item"),e)},l=xw.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:b},behaviours:cc([zd.config({disabled:e.isDisabled,onDisabled:function(t){s(t,(function(t){Tu(t,"tox-collection__item--state-disabled"),Ne(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){Au(t,"tox-collection__item--state-disabled"),Le(t,"aria-disabled")}))}}),bb(),qg.config({}),df.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=U(r,(function(n){var r=tp.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",u={_:" "," - ":" ","-":" "},a=r.replace(/\_| \- |\-/g,(function(t){return u[t]}));return'<div class="tox-collection__item'+(e.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+Ow.encodeAllRaw(n.value)+'" title="'+a+'" aria-label="'+a+'">'+i+o+"</div>"})),i="auto"!==t.columns&&t.columns>1?j(o,t.columns):[o],u=U(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));Vi(n.element,u.join(""))}(n,r),"auto"===t.columns&&Mv(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;Fg.setGridSize(n,e,r)})),yi(n,Lw)}}),kw.config({}),Fg.config((r=t.columns,o="normal",1===r?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===r?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===o?".tox-swatches__row":".tox-collection__group",cell:"color"===o?".tox-swatch":".tox-collection__item"}})),Gg("collection-events",c)]),eventOrder:(n={},n[Qo()]=["disabling","alloy.base.behaviour","collection-events"],n)});return _w(i,l,["tox-form__group--collection"],[])},Fw=v([Xr("data"),eo("inputAttributes",{}),eo("inputStyles",{}),eo("tag","input"),eo("inputClasses",[]),pa("onSetValue"),eo("styles",{}),eo("eventOrder",{}),mf("inputBehaviours",[df,Jg]),eo("selectOnFocus",!0)]),Vw=function(t){return cc([Jg.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=Nu(e);e.dom.setSelectionRange(0,n.length)}:h})])},jw=function(t){return _(_({},Vw(t)),hf(t.inputBehaviours,[df.config({store:_(_({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return Nu(t.element)},setValue:function(t,e){Nu(t.element)!==e&&zu(t.element,e)}}),onSetValue:t.onSetValue})]))},Uw=function(t){return{tag:t.tag,attributes:_({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Ww=hd({name:"Input",configFields:Fw(),factory:function(t,e){return{uid:t.uid,dom:Uw(t),components:[],behaviours:jw(t),eventOrder:t.eventOrder}}}),qw={},Gw={exports:qw};!function(e,n,r,o){!function(t,o){"object"==typeof n&&void 0!==r?r.exports=o():"function"==typeof e&&e.amd?e(o):(t="undefined"!=typeof globalThis?globalThis:t||self).EphoxContactWrapper=o()}(this,(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},n={exports:{}};!function(t){!function(e){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void a(e.promise,t)}u(e.promise,r)}else(1===t._state?u:a)(e.promise,t._value)}))):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){a(t,e)}var r,i}function a(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,u(e,t))}),(function(t){n||(n=!0,a(e,t))}))}catch(t){if(n)return;n=!0,a(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},t.exports?t.exports=o:e.Promise||(e.Promise=o)}(e)}(n);var r=n.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||r}}))}(void 0,qw,Gw);var $w,Xw=Gw.exports.boltExport,Kw=function(t){var e=z.none(),n=[],r=function(t){o()?u(t):n.push(t)},o=function(){return e.isSome()},i=function(t){W(t,u)},u=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=z.some(t),i(n),n=[])})),{get:r,map:function(t){return Kw((function(e){r((function(n){e(t(n))}))}))},isReady:o}},Yw={nu:Kw,pure:function(t){return Kw((function(e){e(t)}))}},Jw=function(t){setTimeout((function(){throw t}),0)},Qw=function(t){var e=function(e){t().then(e,Jw)};return{map:function(e){return Qw((function(){return t().then(e)}))},bind:function(e){return Qw((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return Qw((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return Yw.nu(e)},toCached:function(){var e=null;return Qw((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Zw=function(t){return Qw((function(){return new Xw(t)}))},tx=function(t){return Qw((function(){return Xw.resolve(t)}))},ex=["input","textarea"],nx=function(t){var e=Pt(t);return H(ex,e)},rx=function(t,e){var n=e.getRoot(t).getOr(t.element);Au(n,e.invalidClass),e.notify.each((function(e){nx(t.element)&&Ne(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){Vi(t,e.validHtml)})),e.onValid(t)}))},ox=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);Tu(o,e.invalidClass),e.notify.each((function(e){nx(t.element)&&Ne(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){Vi(t,r)})),e.onInvalid(t,r)}))},ix=function(t,e,n){return e.validator.fold((function(){return tx(zn.value(!0))}),(function(e){return e.validate(t)}))},ux=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),ix(t,e).map((function(n){return t.getSystem().isConnected()?n.fold((function(n){return ox(t,e,0,n),zn.error(n)}),(function(n){return rx(t,e),zn.value(n)})):zn.error("No longer in system")}))},ax=Object.freeze({__proto__:null,markValid:rx,markInvalid:ox,query:ix,run:ux,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element);return Du(n,e.invalidClass)}}),cx=Object.freeze({__proto__:null,events:function(t,e){return t.validator.map((function(e){return Oi([Ei(e.onEvent,(function(e){ux(e,t).get(b)}))].concat(e.validateOnLoad?[Pi((function(e){ux(e,t).get(h)}))]:[]))})).getOr({})}}),sx=[Hr("invalidClass"),eo("getRoot",z.none),to("notify",[eo("aria","alert"),eo("getContainer",z.none),eo("validHtml",""),pa("onValid"),pa("onInvalid"),pa("onValidate")]),to("validator",[Hr("validate"),eo("onEvent","input"),eo("validateOnLoad",!0)])],lx=lc({fields:sx,name:"invalidating",active:cx,apis:ax,extra:{validation:function(t){return function(e){var n=df.getValue(e);return tx(t(n))}}}}),fx=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),dx=[Fr("others",Dr(zn.value,yr()))],mx=lc({fields:dx,name:"coupling",apis:fx,state:Object.freeze({__proto__:null,init:function(){var t={},e=v({});return fu({readState:e,getOrCreate:function(e,n,r){var o=lt(n.others);if(o)return yt(t,r).getOrThunk((function(){var o=yt(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})}),gx=v("sink"),hx=v(Uf({name:gx(),overrides:v({dom:{tag:"div"},behaviours:cc([Sl.config({useFixed:k})]),events:Oi([Ni(Io()),Ni(Do()),Ni(Vo())])})}));!function(t){t[t.HighlightFirst=0]="HighlightFirst",t[t.HighlightNone=1]="HighlightNone"}($w||($w={}));var px,vx,bx,yx=function(t,e){var n=t.getHotspot(e).getOr(e),r=t.getAnchorOverrides();return t.layouts.fold((function(){return{type:"hotspot",hotspot:n,overrides:r}}),(function(t){return{type:"hotspot",hotspot:n,overrides:r,layouts:t}}))},wx=function(t,e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),c=kx(r,t);return a.map((function(t){return t.bind((function(t){return z.from(Mh.sketch(_(_({},i.menu()),{uid:eu(""),data:t,highlightImmediately:u===$w.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Sl.position(r,e,{anchor:n}),ql.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Sl.position(r,n,{anchor:{type:"submenu",item:e}}),ql.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Sl.position(o,e,{anchor:n}),W(r,(function(t){Sl.position(o,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})}))},onEscape:function(){return Jg.focus(r),ql.close(o),z.some(!0)}})))}))}))}(t,e,yx(t,n),n,r,o,u).map((function(t){return t.fold((function(){ql.isOpen(r)&&ql.close(r)}),(function(t){ql.cloak(r),ql.open(r,t),i(r)})),r}))},xx=function(t,e,n,r,o,i,u){return ql.close(r),tx(r)},Cx=function(t,e,n,r,o,i){var u=mx.getCoupled(n,"sandbox");return(ql.isOpen(u)?xx:wx)(t,e,n,u,r,o,i)},Sx=function(t,e,n){var r=wd.getCurrent(e).getOr(e),o=cn(t.element);n?Ve(r.element,"min-width",o+"px"):function(t,e){an.set(t,e)}(r.element,o)},kx=function(t,e){return t.getSystem().getByUid(e.uid+"-"+gx()).map((function(t){return function(){return zn.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return zn.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},Ox=function(t){ql.getState(t).each((function(t){Mh.repositionMenus(t)}))},_x=function(t,e,n){var r=ea(),o=kx(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:vf(t.sandboxBehaviours,[df.config({store:{mode:"memory",initialValue:e}}),ql.config({onOpen:function(o,i){var u=yx(t,e);r.link(e.element),t.matchWidth&&Sx(u.hotspot,i,t.useMinWidth),t.onOpen(u,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return ra(n,r)||ra(e,r)},getAttachPoint:function(){return o().getOrDie()}}),wd.config({find:function(t){return ql.getState(t).bind((function(t){return wd.getCurrent(t)}))}}),gc.config({channels:_(_({},Yl({isExtraPart:S})),Ql({doReposition:Ox}))})])}},Tx=function(t){var e=mx.getCoupled(t,"sandbox");Ox(e)},Ex=function(){return[eo("sandboxClasses",[]),pf("sandboxBehaviours",[wd,gc,ql,df])]},Ax=v([Hr("dom"),Hr("fetch"),pa("onOpen"),va("onExecute"),eo("getHotspot",z.some),eo("getAnchorOverrides",v({})),ds(),mf("dropdownBehaviours",[sh,mx,Fg,Jg]),Hr("toggleClass"),eo("eventOrder",{}),Xr("lazySink"),eo("matchWidth",!1),eo("useMinWidth",!1),Xr("role")].concat(Ex())),Dx=v([jf({schema:[ma()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),hx()]),Mx=pd({name:"Dropdown",configFields:Ax(),partFields:Dx(),factory:function(t,e,n,r){var o,i,u=function(t){ql.getState(t).each((function(t){Mh.highlightPrimary(t)}))},a={expand:function(e){sh.isOn(e)||Cx(t,b,e,r,h,$w.HighlightNone).get(h)},open:function(e){sh.isOn(e)||Cx(t,b,e,r,h,$w.HighlightFirst).get(h)},isOpen:sh.isOn,close:function(e){sh.isOn(e)&&Cx(t,b,e,r,h,$w.HighlightFirst).get(h)},repositionMenus:function(t){sh.isOn(t)&&Tx(t)}},c=function(t,e){return xi(t),z.some(!0)};return{uid:t.uid,dom:t.dom,components:e,behaviours:hf(t.dropdownBehaviours,[sh.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),mx.config({others:{sandbox:function(e){return _x(t,e,{onOpen:function(){return sh.on(e)},onClose:function(){return sh.off(e)}})}}}),Fg.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,e){if(Mx.isOpen(t)){var n=mx.getCoupled(t,"sandbox");u(n)}else Mx.open(t);return z.some(!0)},onEscape:function(t,e){return Mx.isOpen(t)?(Mx.close(t),z.some(!0)):z.none()}}),Jg.config({})]),events:fh(z.some((function(e){Cx(t,b,e,r,u,$w.HighlightFirst).get(h)}))),eventOrder:_(_({},t.eventOrder),(o={},o[Qo()]=["disabling","toggling","alloy.base.behaviour"],o)),apis:a,domModification:{attributes:_(_({"aria-haspopup":"true"},t.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===t.dom.tag?{type:(i="type",yt(t.dom,"attributes").bind((function(t){return yt(t,i)}))).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),Rx=Object.freeze({__proto__:null,events:function(){return Oi([_i(qo(),k)])},exhibit:function(){return mu({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),Nx=lc({fields:[],name:"unselecting",active:Rx}),zx=Xi("color-input-change"),Bx=Xi("color-swatch-change"),Px=Xi("color-picker-cancel"),Ix=function(t,e,n){var r=xw.parts.field({factory:Ww,inputClasses:["tox-textfield"],onSetValue:function(t){return lx.run(t).get(h)},inputBehaviours:cc([zd.config({disabled:e.providers.isDisabled}),bb(),kw.config({}),lx.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return he(t.element)},notify:{onValid:function(t){var e=df.getValue(t);wi(t,zx,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=df.getValue(t);if(0===e.length)return tx(zn.value(!0));var n=zt.fromTag("span");Ve(n,"background-color",e);var r=Ge(n,"background-color").fold((function(){return zn.error("blah")}),(function(t){return zn.value(e)}));return tx(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return Aw(t,e.providers)})),i=function(t,e){wi(t,Bx,{value:e})},u=Zh(function(t,e){return Mx.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:cc([wb(e.providers.isDisabled),bb(),Nx.config({}),kw.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return Zw((function(e){return t.fetch(e)})).map((function(r){return z.from(ew(Jn(By(Xi("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,Yp.CLOSE_ON_EXECUTE,S,e.providers),{movement:Iy(t.columns,t.presets)})))}))},parts:{menu:av(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[Ua,ja,$a]},onLtr:function(){return[ja,Ua,$a]}},components:[],fetch:Dy(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){u.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return yi(t,Px)}),(function(e){i(t,e),Oy(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))}},e));return xw.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,u.asSpec()]}]),fieldBehaviours:cc([Gg("form-field-events",[Ei(zx,(function(e,n){u.getOpt(e).each((function(t){Ve(t.element,"background-color",n.event.color)})),wi(e,Dw,{name:t.name})})),Ei(Bx,(function(t,e){xw.getField(t).each((function(n){df.setValue(n,e.event.value),wd.getCurrent(t).each(Jg.focus)}))})),Ei(Px,(function(t,e){xw.getField(t).each((function(e){wd.getCurrent(t).each(Jg.focus)}))}))])])})},Lx=Uf({schema:[Hr("dom")],name:"label"}),Hx=function(t){return Uf({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:Oi([Ai(_o(),(function(e,n,r){return t(e,r)}),[e]),Ai(Do(),(function(e,n,r){return t(e,r)}),[e]),Ai(Mo(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},Fx=Hx("top-left"),Vx=Hx("top"),jx=Hx("top-right"),Ux=Hx("right"),Wx=Hx("bottom-right"),qx=Hx("bottom"),Gx=Hx("bottom-left"),$x=Hx("left"),Xx=Vf({name:"thumb",defaults:v({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Oi([Mi(_o(),t,"spectrum"),Mi(To(),t,"spectrum"),Mi(Eo(),t,"spectrum"),Mi(Do(),t,"spectrum"),Mi(Mo(),t,"spectrum"),Mi(No(),t,"spectrum")])}}}),Kx=Vf({schema:[Ir("mouseIsDown",(function(){return lo(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:cc([Fg.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),Jg.config({})]),events:Oi([Ei(_o(),n),Ei(To(),n),Ei(Do(),n),Ei(Mo(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}}),Yx=[Lx,$x,Ux,Vx,qx,Fx,jx,Gx,Wx,Xx,Kx],Jx=v("slider.change.value"),Qx=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?z.some(n.touches[0]).map((function(t){return nn(t.clientX,t.clientY)})):z.none()}var r=e;return void 0!==r.clientX?z.some(r).map((function(t){return nn(t.clientX,t.clientY)})):z.none()},Zx=function(t){return t.model.minX},tC=function(t){return t.model.minY},eC=function(t){return t.model.minX-1},nC=function(t){return t.model.minY-1},rC=function(t){return t.model.maxX},oC=function(t){return t.model.maxY},iC=function(t){return t.model.maxX+1},uC=function(t){return t.model.maxY+1},aC=function(t,e,n){return e(t)-n(t)},cC=function(t){return aC(t,rC,Zx)},sC=function(t){return aC(t,oC,tC)},lC=function(t){return cC(t)/2},fC=function(t){return sC(t)/2},dC=function(t){return t.stepSize},mC=function(t){return t.snapToGrid},gC=function(t){return t.snapStart},hC=function(t){return t.rounded},pC=function(t,e){return void 0!==t[e+"-edge"]},vC=function(t){return pC(t,"left")},bC=function(t){return pC(t,"right")},yC=function(t){return pC(t,"top")},wC=function(t){return pC(t,"bottom")},xC=function(t){return t.model.value.get()},CC=function(t){return{x:t}},SC=function(t){return{y:t}},kC=function(t,e){return{x:t,y:e}},OC=function(t,e){wi(t,Jx(),{value:e})},_C=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},TC=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},EC=function(t,e,n){return Math.max(e,Math.min(n,t))},AC=function(t){var e=t.min,n=t.max,r=t.range,o=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,g=s?e-1:e,h=l?n+1:n;if(o<f)return g;if(o>d)return h;var p=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=EC(p/m*r+e,g,h);return u&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return EC(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),u=Math.floor((t-e)/r),a=Math.floor((n-e)/r),c=e+Math.min(a,u+i)*r;return Math.max(e,c)}))}(v,e,n,i,a):c?Math.round(v):v},DC=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:s:o>n?u?a:l:(o-e)/r*c},MC=function(t){return t.element.dom.getBoundingClientRect()},RC=function(t,e){return t[e]},NC=function(t){var e=MC(t);return RC(e,"left")},zC=function(t){var e=MC(t);return RC(e,"right")},BC=function(t){var e=MC(t);return RC(e,"top")},PC=function(t){var e=MC(t);return RC(e,"bottom")},IC=function(t){var e=MC(t);return RC(e,"width")},LC=function(t){var e=MC(t);return RC(e,"height")},HC=function(t,e,n){return(t+e)/2-n},FC=function(t,e){var n=MC(t),r=MC(e),o=RC(n,"left"),i=RC(n,"right"),u=RC(r,"left");return HC(o,i,u)},VC=function(t,e){var n=MC(t),r=MC(e),o=RC(n,"top"),i=RC(n,"bottom"),u=RC(r,"top");return HC(o,i,u)},jC=function(t,e){wi(t,Jx(),{value:e})},UC=function(t){return{x:t}},WC=function(t,e,n){var r={min:Zx(e),max:rC(e),range:cC(e),value:n,step:dC(e),snap:mC(e),snapStart:gC(e),rounded:hC(e),hasMinEdge:vC(e),hasMaxEdge:bC(e),minBound:NC(t),maxBound:zC(t),screenRange:IC(t)};return AC(r)},qC=function(t){return function(e,n){return function(t,e,n){var r=(t>0?TC:_C)(xC(n).x,Zx(n),rC(n),dC(n));return jC(e,UC(r)),z.some(r)}(t,e,n).map(k)}},GC=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=IC(t),u=r.bind((function(e){return z.some(FC(e,t))})).getOr(0),a=o.bind((function(e){return z.some(FC(e,t))})).getOr(i),c={min:Zx(e),max:rC(e),range:cC(e),value:n,hasMinEdge:vC(e),hasMaxEdge:bC(e),minBound:NC(t),minOffset:0,maxBound:zC(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return DC(c)}(e,i,n,r,o);return NC(e)-NC(t)+u},$C=qC(-1),XC=qC(1),KC=z.none,YC=z.none,JC={"top-left":z.none(),top:z.none(),"top-right":z.none(),right:z.some((function(t,e){OC(t,CC(iC(e)))})),"bottom-right":z.none(),bottom:z.none(),"bottom-left":z.none(),left:z.some((function(t,e){OC(t,CC(eC(e)))}))},QC=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=WC(t,e,n),o=UC(r);return jC(t,o),r},setToMin:function(t,e){var n=Zx(e);jC(t,UC(n))},setToMax:function(t,e){var n=rC(e);jC(t,UC(n))},findValueOfOffset:WC,getValueFromEvent:function(t){return Qx(t).map((function(t){return t.left}))},findPositionOfValue:GC,setPositionFromValue:function(t,e,n,r){var o=xC(n),i=GC(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=cn(e.element)/2;Ve(e.element,"left",i-u+"px")},onLeft:$C,onRight:XC,onUp:KC,onDown:YC,edgeActions:JC}),ZC=function(t,e){wi(t,Jx(),{value:e})},tS=function(t){return{y:t}},eS=function(t,e,n){var r={min:tC(e),max:oC(e),range:sC(e),value:n,step:dC(e),snap:mC(e),snapStart:gC(e),rounded:hC(e),hasMinEdge:yC(e),hasMaxEdge:wC(e),minBound:BC(t),maxBound:PC(t),screenRange:LC(t)};return AC(r)},nS=function(t){return function(e,n){return function(t,e,n){var r=(t>0?TC:_C)(xC(n).y,tC(n),oC(n),dC(n));return ZC(e,tS(r)),z.some(r)}(t,e,n).map(k)}},rS=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=LC(t),u=r.bind((function(e){return z.some(VC(e,t))})).getOr(0),a=o.bind((function(e){return z.some(VC(e,t))})).getOr(i),c={min:tC(e),max:oC(e),range:sC(e),value:n,hasMinEdge:yC(e),hasMaxEdge:wC(e),minBound:BC(t),minOffset:0,maxBound:PC(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return DC(c)}(e,i,n,r,o);return BC(e)-BC(t)+u},oS=z.none,iS=z.none,uS=nS(-1),aS=nS(1),cS={"top-left":z.none(),top:z.some((function(t,e){OC(t,SC(nC(e)))})),"top-right":z.none(),right:z.none(),"bottom-right":z.none(),bottom:z.some((function(t,e){OC(t,SC(uC(e)))})),"bottom-left":z.none(),left:z.none()},sS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=eS(t,e,n),o=tS(r);return ZC(t,o),r},setToMin:function(t,e){var n=tC(e);ZC(t,tS(n))},setToMax:function(t,e){var n=oC(e);ZC(t,tS(n))},findValueOfOffset:eS,getValueFromEvent:function(t){return Qx(t).map((function(t){return t.top}))},findPositionOfValue:rS,setPositionFromValue:function(t,e,n,r){var o=xC(n),i=rS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=Ze(e.element)/2;Ve(e.element,"top",i-u+"px")},onLeft:oS,onRight:iS,onUp:uS,onDown:aS,edgeActions:cS}),lS=function(t,e){wi(t,Jx(),{value:e})},fS=function(t,e){return{x:t,y:e}},dS=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?TC:_C,i=e?xC(r).x:o(xC(r).x,Zx(r),rC(r),dC(r)),u=e?o(xC(r).y,tC(r),oC(r),dC(r)):xC(r).y;return lS(n,fS(i,u)),z.some(i)}(t,e,n,r).map(k)}},mS=dS(-1,!1),gS=dS(1,!1),hS=dS(-1,!0),pS=dS(1,!0),vS={"top-left":z.some((function(t,e){OC(t,kC(eC(e),nC(e)))})),top:z.some((function(t,e){OC(t,kC(lC(e),nC(e)))})),"top-right":z.some((function(t,e){OC(t,kC(iC(e),nC(e)))})),right:z.some((function(t,e){OC(t,kC(iC(e),fC(e)))})),"bottom-right":z.some((function(t,e){OC(t,kC(iC(e),uC(e)))})),bottom:z.some((function(t,e){OC(t,kC(lC(e),uC(e)))})),"bottom-left":z.some((function(t,e){OC(t,kC(eC(e),uC(e)))})),left:z.some((function(t,e){OC(t,kC(eC(e),fC(e)))}))},bS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=WC(t,e,n.left),o=eS(t,e,n.top),i=fS(r,o);return lS(t,i),i},setToMin:function(t,e){var n=Zx(e),r=tC(e);lS(t,fS(n,r))},setToMax:function(t,e){var n=rC(e),r=oC(e);lS(t,fS(n,r))},getValueFromEvent:function(t){return Qx(t)},setPositionFromValue:function(t,e,n,r){var o=xC(n),i=GC(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=rS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=cn(e.element)/2,c=Ze(e.element)/2;Ve(e.element,"left",i-a+"px"),Ve(e.element,"top",u-c+"px")},onLeft:mS,onRight:gS,onUp:hS,onDown:pS,edgeActions:vS}),yS=pd({name:"Slider",configFields:[eo("stepSize",1),eo("onChange",h),eo("onChoose",h),eo("onInit",h),eo("onDragStart",h),eo("onDragEnd",h),eo("snapToGrid",!1),eo("rounded",!0),Xr("snapStart"),Fr("model",Br("mode",{x:[eo("minX",0),eo("maxX",100),Ir("value",(function(t){return lo(t.mode.minX)})),Hr("getInitialValue"),wa("manager",QC)],y:[eo("minY",0),eo("maxY",100),Ir("value",(function(t){return lo(t.mode.minY)})),Hr("getInitialValue"),wa("manager",sS)],xy:[eo("minX",0),eo("maxX",100),eo("minY",0),eo("maxY",100),Ir("value",(function(t){return lo({x:t.mode.minX,y:t.mode.minY})})),Hr("getInitialValue"),wa("manager",bS)]})),mf("sliderBehaviours",[Fg,df]),Ir("mouseIsDown",(function(){return lo(!1)}))],partFields:Yx,factory:function(t,e,n,r){var o,i=function(e){return nd(e,t,"thumb")},u=function(e){return nd(e,t,"spectrum")},a=function(e){return ed(e,t,"left-edge")},c=function(e){return ed(e,t,"right-edge")},s=function(e){return ed(e,t,"top-edge")},l=function(e){return ed(e,t,"bottom-edge")},f=t.model,d=f.manager,m=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:u})},g=function(t,e){f.value.set(e);var n=i(t);m(t,n)},h=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&ed(e,t,"thumb").each((function(n){var r=f.value.get();t.onChoose(e,n,r)}))},p=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},v=function(e,n){n.stop(),t.onDragEnd(e,i(e)),h(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:hf(t.sliderBehaviours,[Fg.config({mode:"special",focusIn:function(e){return ed(e,t,"spectrum").map(Fg.focusIn).map(k)}}),df.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),gc.config({channels:(o={},o[Xl()]={onReceive:h},o)})]),events:Oi([Ei(Jx(),(function(e,n){!function(e,n){g(e,n);var r=i(e);t.onChange(e,r,n),z.some(!0)}(e,n.event.value)})),Pi((function(e,n){var r=f.getInitialValue();f.value.set(r);var o=i(e);m(e,o);var a=u(e);t.onInit(e,o,a,f.value.get())})),Ei(_o(),p),Ei(Eo(),v),Ei(Do(),p),Ei(No(),v)]),apis:{resetToMin:function(e){d.setToMin(e,t)},resetToMax:function(e){d.setToMax(e,t)},setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(t,e,n){t.setValue(e,n)},resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),wS=Xi("rgb-hex-update"),xS=Xi("slider-update"),CS=Xi("palette-update"),SS=[mf("formBehaviours",[df])],kS=function(t){return"<alloy.field."+t+">"},OS=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:hf(t.formBehaviours,[df.config({store:{mode:"manual",getValue:function(e){var n=od(e,t);return mt(n,(function(t,e){return t().bind((function(t){var n,r,o=wd.getCurrent(t);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Wi(t.element)),n.fold((function(){return zn.error(r)}),zn.value)})).map(df.getValue)}))},setValue:function(e,n){dt(n,(function(n,r){ed(e,t,r).each((function(t){wd.getCurrent(t).each((function(t){df.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return ed(e,t,n).bind(wd.getCurrent)}}}},_S={getField:su((function(t,e,n){return t.getField(e,n)})),sketch:function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),Yf("form",kS(e),n)},record:v(t)}}(),n=t(e),r=e.record(),o=U(r,(function(t){return Vf({name:t,pname:kS(t)})}));return fd("form",SS,o,OS,n)}},TS=Xi("valid-input"),ES=Xi("invalid-input"),AS=Xi("validating-input"),DS=function(t,e,n,r){var o=function(n,r){return lx.config({invalidClass:e("invalid"),notify:{onValidate:function(t){wi(t,AS,{type:n})},onValid:function(t){wi(t,TS,{type:n,value:df.getValue(t)})},onInvalid:function(t){wi(t,ES,{type:n,value:df.getValue(t)})}},validator:{validate:function(e){var n=df.getValue(e),o=r(n)?zn.value(!0):zn.error(t("aria.input.invalid"));return tx(o)},validateOnLoad:!1}})},i=function(n,r,i,u,a){var c=t("colorcustom.rgb.range"),s=[xw.parts.label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":u}}}),xw.parts.field({data:a,factory:Ww,inputAttributes:_({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:cc([o(r,n),kw.config({})]),onSetValue:function(t){lx.isInvalid(t)&&lx.run(t).get(h)}})],l="hex"!==r?[xw.parts["aria-descriptor"]({text:c})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:s.concat(l)}},u=function(t,e){var n=e.red,r=e.green,o=e.blue;df.setValue(t,{red:n,green:r,blue:o})},a=Zh({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),c=function(t,e){a.getOpt(t).each((function(t){Ve(t.element,"background-color","#"+e.value)}))};return hd({factory:function(){var o={red:lo(z.some(255)),green:lo(z.some(255)),blue:lo(z.some(255)),hex:lo(z.some("ffffff"))},s=function(t){return o[t].get()},l=function(t,e){o[t].set(e)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",z.some(e)),l("green",z.some(n)),l("blue",z.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?l(n.type,z.none()):r(t)},m=function(t,e,n){var r=parseInt(n,10);l(e,z.some(r)),s("red").bind((function(t){return s("green").bind((function(e){return s("blue").map((function(n){return iy(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=Zb(e);return _S.getField(t,"hex").each((function(e){Jg.isFocused(e)||df.setValue(t,{hex:n.value})})),n}(t,e);wi(t,wS,{hex:n}),c(t,n)}))},g=function(t,e){var r=e.event;!function(t){return"hex"===t.type}(r)?m(t,r.type,r.value):function(t,e){n(t);var r=Gb(e);l("hex",z.some(e));var o=cy(r);u(t,o),f(o),wi(t,wS,{hex:r}),c(t,r)}(t,r.value)},h=function(e){return{label:t("colorcustom.rgb."+e+".label"),description:t("colorcustom.rgb."+e+".description")}},p=h("red"),v=h("green"),b=h("blue"),y=h("hex");return Jn(_S.sketch((function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",xw.sketch(i(uy,"red",p.label,p.description,255))),n.field("green",xw.sketch(i(uy,"green",v.label,v.description,255))),n.field("blue",xw.sketch(i(uy,"blue",b.label,b.description,255))),n.field("hex",xw.sketch(i(Kb,"hex",y.label,y.description,"ffffff"))),a.asSpec()],formBehaviours:cc([lx.config({invalidClass:e("form-invalid")}),Gg("rgb-form-events",[Ei(TS,g),Ei(ES,d),Ei(AS,d)])])}})),{apis:{updateHex:function(t,e){df.setValue(t,{hex:e.value}),function(t,e){var n=cy(e);u(t,n),f(n)}(t,e),c(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},MS=function(t,e){var n=yS.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=yS.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),o=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var u=o.createLinearGradient(0,0,0,r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=u,o.fillRect(0,0,n,r)}};return hd({factory:function(t){var i=v({x:0,y:0}),u=cc([wd.config({find:z.some}),Jg.config({})]);return yS.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:function(t,e,n){wi(t,CS,{value:n})},onInit:function(t,e,n,r){o(n.element.dom,fy(dy))},sliderBehaviours:u})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom,r=gy(e,100,100),i=ay(r);o(n,fy(i))}(e,n)},setThumb:function(t,e,n){!function(t,e){var n=hy(cy(e));yS.setValue(t,{x:n.saturation,y:100-n.value})}(e,n)}},extraApis:{}})},RS=function(t,e){return hd({name:"ColourPicker",configFields:[Hr("dom"),eo("onValidHex",h),eo("onInvalidHex",h)],factory:function(n){var r,o=DS(t,e,n.onValidHex,n.onInvalidHex),i=MS(0,e),u=function(t){return 100-t/360*100},a={paletteRgba:lo(dy),paletteHue:lo(0)},c=Zh(function(t,e){var n=yS.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=yS.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return yS.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:v({y:0})},components:[n,r],sliderBehaviours:cc([Jg.config({})]),onChange:function(t,e,n){wi(t,xS,{value:n})}})}(0,e)),s=Zh(i.sketch({})),l=Zh(o.sketch({})),f=function(t,e,n){s.getOpt(t).each((function(t){i.setHue(t,n)}))},d=function(t,e){l.getOpt(t).each((function(t){o.updateHex(t,e)}))},m=function(t,e,n){c.getOpt(t).each((function(t){yS.setValue(t,{y:u(n)})}))},g=function(t,e){s.getOpt(t).each((function(t){i.setThumb(t,e)}))},h=function(t,e,n,r){!function(t,e){var n=cy(t);a.paletteRgba.set(n),a.paletteHue.set(e)}(e,n),W(r,(function(r){r(t,e,n)}))};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),c.asSpec(),l.asSpec()],behaviours:cc([Gg("colour-picker-events",[Ei(wS,(r=[f,m,g],function(t,e){var n=e.event.hex,o=function(t){return hy(cy(t))}(n);h(t,n,o.hue,r)})),Ei(CS,function(){var t=[d];return function(e,n){var r=n.event.value,o=a.paletteHue.get(),i=gy(o,r.x,100-r.y),u=py(i);h(e,u,o,t)}}()),Ei(xS,function(){var t=[f,d];return function(e,n){var r=function(t){return(100-t)/100*360}(n.event.value.y),o=a.paletteRgba.get(),i=hy(o),u=gy(r,i.saturation,i.value),c=py(u);h(e,c,r,t)}}())]),wd.config({find:function(t){return l.getOpt(t)}}),Fg.config({mode:"acyclic"})])}}})},NS=function(){return wd.config({find:z.some})},zS=function(t){return wd.config({find:t.getOpt})},BS=function(t){return wd.config({find:function(e){return be(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},PS={"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"},IS=function(t){return function(t){return PS[t]}(t)},LS=tinymce.util.Tools.resolve("tinymce.Resource"),HS=tinymce.util.Tools.resolve("tinymce.util.Tools"),FS=gr([eo("preprocess",b),eo("postprocess",b)]),VS=function(t,e,n){return df.config(Jn({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},jS=function(t,e,n){return VS(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},US=function(t,e){var n=Nr("RepresentingConfigs.memento processors",FS,e);return df.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=df.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);df.setValue(i,o)}}})},WS=VS,qS=function(t){return jS(t,Fi,Vi)},GS=function(t){return df.config({store:{mode:"memory",initialValue:t}})},$S=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){W(t,(function(t){t(e,n)}))}},o=function(t,e){if(!zd.isDisabled(t)){var n=e.event.raw;u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;u(t,n.files)},u=function(n,r){df.setValue(n,function(t,e){var n=HS.explode(e.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return G(ct(t),(function(t){return F(n,(function(e){return At(t.name.toLowerCase(),"."+e.toLowerCase())}))}))}(r,e)),wi(n,Dw,{name:t.name})},a=Zh({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:cc([Gg("input-file-events",[Ni(Vo()),Ni(ti())])])}),c=t.label.map((function(t){return Aw(t,e)})),s=xw.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:cc([GS([]),NS(),zd.config({}),sh.config({toggleClass:"dragenter",toggleOnExecute:!1}),Gg("dropzone-events",[Ei("dragenter",r([n,sh.toggle])),Ei("dragleave",r([n,sh.toggle])),Ei("dragover",n),Ei("drop",r([n,o])),Ei(Fo(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Qh.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(t){a.get(t).element.dom.click()},buttonBehaviours:cc([kw.config({}),wb(e.isDisabled),bb()])})]}]}}}});return _w(c,s,["tox-form__group--stretched"],[])},XS=Xi("alloy-fake-before-tabstop"),KS=Xi("alloy-fake-after-tabstop"),YS=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:cc([Jg.config({ignore:!0}),kw.config({})])}},JS=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[YS([XS]),t,YS([KS])],behaviours:cc([BS(1)])}},QS=function(t,e){wi(t,Io(),{raw:{which:9,shiftKey:e}})},ZS=function(t,e){var n=e.element;Du(n,XS)?QS(t,!0):Du(n,KS)&&QS(t,!1)},tk=function(t){return rw(t,["."+XS,"."+KS].join(","),S)},ek=!(ie().browser.isIE()||ie().browser.isEdge()),nk=function(t,e){var n=ek&&t.sandboxed,r=_(_({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=lo("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)Ne(n.element,"srcdoc",r);else{Ne(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map((function(t){return Aw(t,e)})),u=xw.parts.field({factory:{sketch:function(t){return JS({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:cc([kw.config({}),Jg.config({}),WS(z.none(),o.getValue,o.setValue)])})}}});return _w(i,u,["tox-form__group--stretched"],[])},rk=function(t,e){return uk(document.createElement("canvas"),t,e)},ok=function(t){var e=rk(t.width,t.height);return ik(e).drawImage(t,0,0),e},ik=function(t){return t.getContext("2d")},uk=function(t,e,n){return t.width=e,t.height=n,t},ak=function(t){return t.naturalWidth||t.width},ck=function(t){return t.naturalHeight||t.height},sk=function(t){return new Xw((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return z.none();for(var r=n[1],o=e[1],i=atob(o),u=i.length,a=Math.ceil(u/1024),c=new Array(a),s=0;s<a;++s){for(var l=1024*s,f=Math.min(l+1024,u),d=new Array(f-l),m=l,g=0;m<f;++g,++m)d[g]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return z.some(new Blob(c,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))},lk=function(t,e,n){return e=e||"image/png",d(HTMLCanvasElement.prototype.toBlob)?new Xw((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):sk(t.toDataURL(e,n))},fk=function(t){return function(t){return new Xw((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)},u=function(){i(),e(o)},a=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(u,0)}))}(t).then((function(t){dk(t);var e=rk(ak(t),ck(t));return ik(e).drawImage(t,0,0),e}))},dk=function(t){URL.revokeObjectURL(t.src)},mk=function(t,e,n){var r=e.type,o=v(r),i=v(n),u=function(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))};return{getType:o,toBlob:function(){return Xw.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return lk(t,e,n)}))},toAdjustedDataURL:u,toAdjustedBase64:function(t,e){return u(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(ok)}}},gk=function(t){return function(t){return new Xw((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return mk(fk(t),t,e)}))},hk=function(t,e){return lk(t,e).then((function(e){return mk(Xw.resolve(t),e,t.toDataURL())}))},pk=function(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r},vk=[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],bk=function(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)r[u]=e[u+5*i];for(u=0;u<5;u++){n=0;for(var a=0;a<5;a++)n+=t[u+5*a]*r[a];o[u+5*i]=n}}return o},yk=function(t,e){return t.toCanvas().then((function(n){return wk(n,t.getType(),e)}))},wk=function(t,e,n){var r=ik(t),o=function(t,e){for(var n,r,o,i,u=t.data,a=e[0],c=e[1],s=e[2],l=e[3],f=e[4],d=e[5],m=e[6],g=e[7],h=e[8],p=e[9],v=e[10],b=e[11],y=e[12],w=e[13],x=e[14],C=e[15],S=e[16],k=e[17],O=e[18],_=e[19],T=0;T<u.length;T+=4)n=u[T],r=u[T+1],o=u[T+2],i=u[T+3],u[T]=n*a+r*c+o*s+i*l+f,u[T+1]=n*d+r*m+o*g+i*h+p,u[T+2]=n*v+r*b+o*y+i*w+x,u[T+3]=n*C+r*S+o*k+i*O+_;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),hk(t,e)},xk=function(t,e,n){var r=ik(t),o=r.getImageData(0,0,t.width,t.height),i=r.getImageData(0,0,t.width,t.height);return i=function(t,e,n){for(var r=function(t,e,n){return t>n?t=n:t<e&&(t=e),t},o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),u=t.data,a=e.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,h=0;h<o;h++)for(var p=0;p<o;p++){var v=r(f+p-i,0,c-1),b=4*(r(l+h-i,0,s-1)*c+v),y=n[h*o+p];d+=u[b]*y,m+=u[b+1]*y,g+=u[b+2]*y}var w=4*(l*c+f);a[w]=r(d,0,255),a[w+1]=r(m,0,255),a[w+2]=r(g,0,255)}return e}(o,i,n),r.putImageData(i,0,0),hk(t,e)},Ck=function(t){return function(e,n){return yk(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}},Sk=function(t){return function(e){return yk(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),kk=Ck((function(t,e){return e=pk(255*e,-255,255),bk(t,[1,0,0,0,e,0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])})),Ok=Ck((function(t,e){var n;return e=pk(e,-1,1),n=(e*=100)<0?127+e/100*127:127*(n=0===(n=e%1)?vk[e]:vk[Math.floor(e)]*(1-n)+vk[Math.floor(e)+1]*n)+127,bk(t,[n/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),_k=function(t,e,n,r){return yk(t,function(t,e,n,r){return e=pk(e,0,2),n=pk(n,0,2),r=pk(r,0,2),bk(t,[e,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0,0,0,0,0,1])}([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],e,n,r))},Tk=(px=[0,-1,0,-1,5,-1,0,-1,0],function(t){return function(t,e){return t.toCanvas().then((function(n){return xk(n,t.getType(),e)}))}(t,px)}),Ek=(vx=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){for(var r=ik(t),o=new Array(256),i=0;i<o.length;i++)o[i]=vx(i,n);var u=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(u,0,0),hk(t,e)}(n,t.getType(),e)}))}),Ak=function(t,e,n){var r=ak(t),o=ck(t),i=e/r,u=n/o,a=!1;(i<.5||i>2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=Dk(t,i,u);return a?c.then((function(t){return Ak(t,e,n)})):c},Dk=function(t,e,n){return new Xw((function(r){var o=ak(t),i=ck(t),u=Math.floor(o*e),a=Math.floor(i*n),c=rk(u,a);ik(c).drawImage(t,0,0,o,i,0,0,u,a),r(c)}))},Mk=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},Rk=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,u=Math.sin(r),a=Math.cos(r),c=Mk(Math.abs(o*a)+Math.abs(i*u)),s=Mk(Math.abs(o*u)+Math.abs(i*a)),l=rk(c,s),f=ik(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),hk(l,e)},Nk=function(t,e,n){var r=rk(t.width,t.height),o=ik(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),hk(r,e)},zk=function(t,e,n,r,o,i){var u=rk(o,i);return ik(u).drawImage(t,-n,-r),hk(u,e)},Bk=function(t){return Sk(t)},Pk=function(t){return Tk(t)},Ik=function(t,e){return Ek(t,e)},Lk=function(t,e){return kk(t,e)},Hk=function(t,e){return Ok(t,e)},Fk=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return Nk(n,t.getType(),e)}))}(t,e)},Vk=function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then((function(i){return zk(i,t.getType(),e,n,r,o)}))}(t,e,n,r,o)},jk=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return Ak(r,e,n).then((function(e){return hk(e,t.getType())}))}))}(t,e,n)},Uk=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return Rk(n,t.getType(),e)}))}(t,e)},Wk=function(t,e,n){return cp(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)},qk=function(t,e){return Wk(t,e,[])},Gk=function(t,e){return Wk(t,e,[qg.config({})])},$k=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:cc([qg.config({})])}},Xk=Xi("toolbar.button.execute"),Kk=((bx={})[Qo()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],bx),Yk=Xi("update-menu-text"),Jk=Xi("update-menu-icon"),Qk=function(t,e,n){var r=lo(h),o=t.text.map((function(t){return Zh($k(t,e,n.providers))})),i=t.icon.map((function(t){return Zh(Gk(t,n.providers.icons))})),u=function(t,e){var n=df.getValue(t);return Jg.focus(n),wi(n,"keydown",{raw:e.event.raw}),Mx.close(n),z.some(!0)},a=t.role.fold((function(){return{}}),(function(t){return{role:t}})),c=t.tooltip.fold((function(){return{}}),(function(t){var e=n.providers.translate(t);return{title:e,"aria-label":e}})),s=cp("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},n.providers.icons);return Zh(Mx.sketch(_(_(_({},t.uid?{uid:t.uid}:{}),a),{dom:{tag:"button",classes:[e,e+"--select"].concat(U(t.classes,(function(t){return e+"--"+t}))),attributes:_({},c)},components:Eb([i.map((function(t){return t.asSpec()})),o.map((function(t){return t.asSpec()})),z.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:cc(E(E([],t.dropdownBehaviours,!0),[wb((function(){return t.disabled||n.providers.isDisabled()})),bb(),Nx.config({}),qg.config({}),Gg("dropdown-events",[kb(t,r),Ob(t,r)]),Gg("menubutton-update-display-text",[Ei(Yk,(function(t,e){o.bind((function(e){return e.getOpt(t)})).each((function(t){qg.set(t,[Vu(n.providers.translate(e.event.text))])}))})),Ei(Jk,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){qg.set(t,[Gk(e.event.icon,n.providers.icons)])}))}))])],!1)),eventOrder:Jn(Kk,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:cc([Fg.config({mode:"special",onLeft:u,onRight:u})]),lazySink:n.getSink,toggleClass:e+"--active",parts:{menu:av(0,t.columns,t.presets)},fetch:function(e){return Zw(w(t.fetch,e))}}))).asSpec()},Zk=function(t){return"separator"===t.type},tO={type:"separator"},eO=function(t,e){var n=X(t,(function(t,n){return function(t){return o(t)}(n)?""===n?t:"|"===n?t.length>0&&!Zk(t[t.length-1])?t.concat([tO]):t:wt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&Zk(n[n.length-1])&&n.pop(),n},nO=function(t,e){return function(t){return wt(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=rO(n,e);return{item:t,menus:Jn(r.menus,ho(t.value,r.items)),expansions:Jn(r.expansions,ho(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}},rO=function(t,e){var n=eO(o(t)?t.split(" "):t,e);return $(n,(function(t,n){var r=function(t){if(Zk(t))return t;var e=yt(t,"value").getOrThunk((function(){return Xi("generated-menu-item")}));return Jn({value:e},t)}(n),o=nO(r,e);return{menus:Jn(t.menus,o.menus),items:[o.item].concat(t.items),expansions:Jn(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},oO=function(t,e,n,r){var o=Xi("primary-menu"),i=rO(t,n.shared.providers.menuItems());if(0===i.items.length)return z.none();var u=tw(o,i.items,e,n,r),a=mt(i.menus,(function(t,r){return tw(r,t,e,n,!1)})),c=Jn(a,ho(o,u));return z.from(Mh.tieredData(o,c,i.expansions))},iO=function(t){return{isDisabled:function(){return zd.isDisabled(t)},setDisabled:function(e){return zd.set(t,e)},setActive:function(e){var n=t.element;e?(Tu(n,"tox-tbtn--enabled"),Ne(n,"aria-pressed",!0)):(Au(n,"tox-tbtn--enabled"),Le(n,"aria-pressed"))},isActive:function(){return Du(t.element,"tox-tbtn--enabled")}}},uO=function(t,e,n,r){return Qk({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(oO(t,Yp.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:iO,columns:1,presets:"normal",classes:[],dropdownBehaviours:[kw.config({})]},e,n.shared)},aO=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){vc(e.element),wi(e,Nw,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(U(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return _(_({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},cO=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=_({buttonBehaviours:cc([wb((function(){return t.disabled||i.isDisabled()})),bb(),kw.config({}),Gg("button press",[Ti("click"),Ti("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Jn(a,{dom:r});return Jn(c,{components:o})},sO=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({})},i=t.icon.map((function(t){return qk(t,n.icons)})),u=Eb([i]);return cO(t,e,r,o,u,n)},lO=function(t,e,n,r){void 0===r&&(r=[]);var o=sO(t,z.some(e),n,r);return Qh.sketch(o)},fO=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),u=t.icon?t.icon.map((function(t){return qk(t,n.icons)})):z.none(),a=u.isSome()?Eb([u]):[],c=u.isSome()?{}:{innerHtml:i},s=E(E(E(E([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),u.isSome()?["tox-button--icon"]:[],!0),t.borderless?["tox-button--naked"]:[],!0),o,!0),l=_(_({tag:"button",classes:s},c),{attributes:{title:i}});return cO(t,e,r,l,a,n)},dO=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=fO(t,z.some(e),n,r,o);return Qh.sketch(i)},mO=function(t,e){return function(n){"custom"===e?wi(n,Nw,{name:t,value:{}}):"submit"===e?yi(n,zw):"cancel"===e?yi(n,Rw):console.error("Unknown button type: ",e)}},gO=function(t,e,n){if(function(t,e){return"menu"===e}(0,e)){var r=t,o=_(_({},t),{onSetup:function(e){return e.setDisabled(t.disabled),h},fetch:aO(r.items,(function(){return i}),n)}),i=Zh(uO(o,"tox-tbtn",n,z.none()));return i.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,e)){var u=mO(t.name,e),a=_(_({},t),{borderless:!1});return dO(a,u,n.shared.providers,[])}console.error("Unknown footer button type: ",e)},hO=function(t,e){var n,r,o=mO(t.name,"custom");return n=z.none(),r=xw.parts.field(_({factory:Qh},fO(t,z.some(o),e,[GS(""),NS()]))),_w(n,r,[],[])},pO=v([eo("field1Name","field1"),eo("field2Name","field2"),ba("onLockedChange"),ga(["lockClass"]),eo("locked",!1),pf("coupledFieldBehaviours",[wd,df])]),vO=function(t,e){return Vf({factory:xw,name:t,overrides:function(t){return{fieldBehaviours:cc([Gg("coupled-input-behaviour",[Ei(Ho(),(function(n){(function(t,e,n){return ed(t,e,n).bind(wd.getCurrent)})(n,t,e).each((function(e){ed(n,t,"lock").each((function(r){sh.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},bO=v([vO("field1","field2"),vO("field2","field1"),Vf({factory:Qh,schema:[Hr("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:cc([sh.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),yO=pd({name:"FormCoupledInputs",configFields:pO(),partFields:bO(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:vf(t.coupledFieldBehaviours,[wd.config({find:z.some}),df.config({store:{mode:"manual",getValue:function(e){var n,r=ud(e,t,["field1","field2"]);return(n={})[t.field1Name]=df.getValue(r.field1()),n[t.field2Name]=df.getValue(r.field2()),n},setValue:function(e,n){var r=ud(e,t,["field1","field2"]);xt(n,t.field1Name)&&df.setValue(r.field1(),n[t.field1Name]),xt(n,t.field2Name)&&df.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return ed(e,t,"field1")},getField2:function(e){return ed(e,t,"field2")},getLock:function(e){return ed(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),wO=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return zn.value({value:n,unit:r})}return zn.error(t)},xO=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return wt(n,t)};return t.unit===e?z.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?z.some(t.value):z.some(t.value/n[t.unit]*n[e]):z.none()},CO=function(t){return z.none()},SO=function(t,e){var n=wO(t).toOptional(),r=wO(e).toOptional();return kt(n,r,(function(t,e){return xO(t,e.unit).map((function(t){return e.value/t})).map((function(t){return function(t,e){return function(n){return xO(n,e).map((function(n){return{value:n*t,unit:e}}))}}(t,e.unit)})).getOr(CO)})).getOr(CO)},kO=function(t,e){var n=CO,r=Xi("ratio-event"),o=function(t){return cp(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)},i=yO.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[o("lock"),o("unlock")],buttonBehaviours:cc([zd.config({disabled:function(){return t.disabled||e.isDisabled()}}),bb(),kw.config({})])}),u=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},a=function(n){return xw.parts.field({factory:Ww,inputClasses:["tox-textfield"],inputBehaviours:cc([zd.config({disabled:function(){return t.disabled||e.isDisabled()}}),bb(),kw.config({}),Gg("size-input-events",[Ei(Bo(),(function(t,e){wi(t,r,{isField1:n})})),Ei(Fo(),(function(e,n){wi(e,Dw,{name:t.name})}))])]),selectOnFocus:!1})},c=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=yO.parts.field1(u([xw.parts.label(c("Width")),a(!0)])),l=yO.parts.field2(u([xw.parts.label(c("Height")),a(!1)]));return yO.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,l,u([c("&nbsp;"),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){wO(df.getValue(t)).each((function(t){n(t).each((function(t){df.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))}))}))},coupledFieldBehaviours:cc([zd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){yO.getField1(t).bind(xw.getField).each(zd.disable),yO.getField2(t).bind(xw.getField).each(zd.disable),yO.getLock(t).each(zd.disable)},onEnabled:function(t){yO.getField1(t).bind(xw.getField).each(zd.enable),yO.getField2(t).bind(xw.getField).each(zd.enable),yO.getLock(t).each(zd.enable)}}),bb(),Gg("size-input-events2",[Ei(r,(function(t,e){var r=e.event.isField1,o=r?yO.getField1(t):yO.getField2(t),i=r?yO.getField2(t):yO.getField1(t),u=o.map(df.getValue).getOr(""),a=i.map(df.getValue).getOr("");n=SO(u,a)}))])])})},OO={undo:v(Xi("undo")),redo:v(Xi("redo")),zoom:v(Xi("zoom")),back:v(Xi("back")),apply:v(Xi("apply")),swap:v(Xi("swap")),transform:v(Xi("transform")),tempTransform:v(Xi("temp-transform")),transformApply:v(Xi("transform-apply"))},_O=v("save-state"),TO=v("disable"),EO=v("enable"),AO={formActionEvent:Nw,saveState:_O,disable:TO,enable:EO},DO=function(t,e){var n=function(t,n,r,o){return Zh(dO({name:t,text:t,disabled:r,primary:o,icon:z.none(),borderless:!1},n,e))},r=function(t,n,r,o){return Zh(lO({name:t,icon:z.some(t),tooltip:z.some(n),disabled:o,primary:!1,borderless:!1},r,e))},o=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(zd)&&zd.disable(n)}))},i=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(zd)&&zd.enable(n)}))},u={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},a=h,c=function(t,e,n){wi(t,e,n)},s=function(t){return yi(t,AO.disable())},l=function(t){return yi(t,AO.enable())},f=function(t,e){s(t),c(t,OO.transform(),{transform:e}),l(t)},d=function(t){return function(){tt.getOpt(t).each((function(t){qg.set(t,[Q])}))}},m=function(t,e){s(t),c(t,OO.transformApply(),{transform:e,swap:d(t)}),l(t)},g=function(){return n("Back",(function(t){return c(t,OO.back(),{swap:d(t)})}),!1,!1)},p=function(){return Zh({dom:{tag:"div",classes:["tox-spacer"]},behaviours:cc([zd.config({})])})},b=function(){return n("Apply",(function(t){return c(t,OO.apply(),{swap:d(t)})}),!0,!0)},y=[g(),p(),n("Apply",(function(e){m(e,(function(e){var n=t.getRect();return Vk(e,n.x,n.y,n.w,n.h)})),t.hideCrop()}),!1,!0)],w=vw.sketch({dom:u,components:y.map((function(t){return t.asSpec()})),containerBehaviours:cc([Gg("image-tools-crop-buttons-events",[Ei(AO.disable(),(function(t,e){o(y,t)})),Ei(AO.enable(),(function(t,e){i(y,t)}))])])}),x=Zh(kO({name:"size",label:z.none(),constrain:!0,disabled:!1},e)),C=[g(),p(),x,p(),n("Apply",(function(t){x.getOpt(t).each((function(e){var n=df.getValue(e),r=function(t,e){return function(n){return jk(n,t,e)}}(parseInt(n.width,10),parseInt(n.height,10));m(t,r)}))}),!1,!0)],S=vw.sketch({dom:u,components:C.map((function(t){return t.asSpec()})),containerBehaviours:cc([Gg("image-tools-resize-buttons-events",[Ei(AO.disable(),(function(t,e){o(C,t)})),Ei(AO.enable(),(function(t,e){i(C,t)}))])])}),k=function(t,e){return function(n){return t(n,e)}},O=k(Fk,"h"),_=k(Fk,"v"),T=k(Uk,-90),E=k(Uk,90),A=function(t,e){!function(t,e){s(t),c(t,OO.tempTransform(),{transform:e}),l(t)}(t,e)},D=[g(),p(),r("flip-horizontally","Flip horizontally",(function(t){A(t,O)}),!1),r("flip-vertically","Flip vertically",(function(t){A(t,_)}),!1),r("rotate-left","Rotate counterclockwise",(function(t){A(t,T)}),!1),r("rotate-right","Rotate clockwise",(function(t){A(t,E)}),!1),p(),b()],M=vw.sketch({dom:u,components:D.map((function(t){return t.asSpec()})),containerBehaviours:cc([Gg("image-tools-fliprotate-buttons-events",[Ei(AO.disable(),(function(t,e){o(D,t)})),Ei(AO.enable(),(function(t,e){i(D,t)}))])])}),R=function(t,n,r,o,i){var u=yS.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),a=yS.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=yS.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Zh(yS.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:v({x:o})},components:[u,a,c],sliderBehaviours:cc([Jg.config({})]),onChoose:n}))},N=function(t,e,n,r,o){return R(t,(function(t,n,r){var o=k(e,r.x/100);f(t,o)}),n,r,o)},B=function(t,e,n,r,a){var c=function(t,e,n,r,o){return[g(),N(t,e,n,r,o),b()]}(t,e,n,r,a);return vw.sketch({dom:u,components:c.map((function(t){return t.asSpec()})),containerBehaviours:cc([Gg("image-tools-filter-panel-buttons-events",[Ei(AO.disable(),(function(t,e){o(c,t)})),Ei(AO.enable(),(function(t,e){i(c,t)}))])])})},P=[g(),p(),b()],I=vw.sketch({dom:u,components:P.map((function(t){return t.asSpec()}))}),L=B("Brightness",Lk,-100,0,100),H=B("Contrast",Hk,-100,0,100),F=B("Gamma",Ik,-100,0,100),V=function(t,e,n){return function(r){return function(t,e,n,r){return _k(t,e,n,r)}(r,t,e,n)}},j=function(t){return R(t,(function(t,e,n){var r=U.getOpt(t),o=q.getOpt(t),i=W.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=df.getValue(e).x/100,i=df.getValue(r).x/100,u=df.getValue(n).x/100,a=V(o,i,u);f(t,a)}))}))}))}),0,100,200)},U=j("R"),W=j("G"),q=j("B"),G=[g(),U,W,q,b()],$=vw.sketch({dom:u,components:G.map((function(t){return t.asSpec()}))}),X=function(t,e,n){return function(r){c(r,OO.swap(),{transform:e,swap:function(){tt.getOpt(r).each((function(e){qg.set(e,[t]),n(e)}))}})}},K=z.some(Pk),Y=z.some(Bk),J=[r("crop","Crop",X(w,z.none(),(function(e){t.showCrop()})),!1),r("resize","Resize",X(S,z.none(),(function(e){x.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;df.setValue(e,{width:r,height:o})}))})),!1),r("orientation","Orientation",X(M,z.none(),a),!1),r("brightness","Brightness",X(L,z.none(),a),!1),r("sharpen","Sharpen",X(I,K,a),!1),r("contrast","Contrast",X(H,z.none(),a),!1),r("color-levels","Color levels",X($,z.none(),a),!1),r("gamma","Gamma",X(F,z.none(),a),!1),r("invert","Invert",X(I,Y,a),!1)],Q=vw.sketch({dom:u,components:J.map((function(t){return t.asSpec()}))}),Z=vw.sketch({dom:{tag:"div"},components:[Q],containerBehaviours:cc([qg.config({})])}),tt=Zh(Z);return{memContainer:tt,getApplyButton:function(t){return tt.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))}}},MO=tinymce.util.Tools.resolve("tinymce.geom.Rect"),RO=tinymce.util.Tools.resolve("tinymce.util.Observable"),NO=tinymce.util.Tools.resolve("tinymce.util.VK"),zO=function(t){if(function(t){return f(t.changedTouches)}(t))for(var e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]};function BO(t,e){var n,r,o,i,u,a,c,s=[],l=[],d=null!==(n=e.document)&&void 0!==n?n:document,m=null!==(r=e.root)&&void 0!==r?r:d,g=zt.fromDom(d),h=zt.fromDom(m.getElementById(null!==(o=e.handle)&&void 0!==o?o:t)),p=function(t){var n=t.raw,r=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),u=e(n.offsetWidth,r.offsetWidth),a=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight);return{width:o<u?i:o,height:a<e(n.offsetHeight,r.offsetHeight)?c:a}}(d);zO(n),t.prevent(),u=n.button,a=n.screenX,c=n.screenY;var o=We(h,"cursor");i=zt.fromTag("div",d),je(i,{position:"absolute",top:"0",left:"0",width:r.width+"px",height:r.height+"px","z-index":"2147483647",opacity:"0.0001",cursor:o}),pn(Me(g),i),l.push(jc(g,"mousemove",v),jc(g,"touchmove",v),jc(g,"mouseup",b),jc(g,"touchend",b)),e.start(n)},v=function(t){var n=t.raw;if(zO(n),n.button!==u)return b(t);n.deltaX=n.screenX-a,n.deltaY=n.screenY-c,t.prevent(),e.drag(n)},b=function(t){zO(t.raw),W(l,(function(t){return t.unbind()})),l=[],yn(i),e.stop&&e.stop(t.raw)};return s.push(jc(h,"mousedown",p),jc(h,"touchstart",p)),{destroy:function(){W(l.concat(s),(function(t){return t.unbind()})),l=[],s=[],f(i)&&yn(i)}}}var PO=0,IO=function(t,e,n,r,o){var i,u=[],a="tox-crid-"+PO++,c=zt.fromDom(r),s=[{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"}],l=["top","right","bottom","left"],f=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}},d=function(e,r,o,i){var u=r.x+o*e.deltaX,a=r.y+i*e.deltaY,c=Math.max(20,r.w+o*e.deltaW),s=Math.max(20,r.h+i*e.deltaH),l=t=MO.clamp({x:u,y:a,w:c,h:s},n,"move"===e.name);l=f(n,l),p.fire("updateRect",{rect:l}),h(l)},m=function(t){var n=function(t,e){Zu(c,"#"+a+"-"+t).each((function(t){je(t,{left:e.x+"px",top:e.y+"px",width:Math.max(0,e.w)+"px",height:Math.max(0,e.h)+"px"})}))};W(s,(function(e){Zu(c,"#"+a+"-"+e.name).each((function(n){je(n,{left:t.w*e.xMul+t.x+"px",top:t.h*e.yMul+t.y+"px"})}))})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)},g=function(e){m(t=e)},h=function(t){var e,r;g((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))};!function(){var e=zt.fromTag("div");ze(e,{id:a,class:"tox-croprect-container",role:"grid","aria-dropeffect":"execute"}),pn(c,e),W(l,(function(t){Zu(c,"#"+a).each((function(e){var n=zt.fromTag("div");ze(n,{id:a+"-"+t,class:"tox-croprect-block","data-mce-bogus":"all"}),Ve(n,"display","none"),pn(e,n)}))})),W(s,(function(t){Zu(c,"#"+a).each((function(e){var n=zt.fromTag("div");ze(n,{id:a+"-"+t.name,"aria-label":t.label,"aria-grabbed":"false","data-mce-bogus":"all",role:"gridcell",tabindex:"-1",title:t.label}),Mu(n,["tox-croprect-handle","tox-croprect-handle-"+t.name]),Ve(n,"display","none"),pn(e,n)}))})),i=U(s,(function(e){var n;return BO(a,{document:r.ownerDocument,root:ke(c).dom,handle:a+"-"+e.name,start:function(){n=t},drag:function(t){d(e,n,t.deltaX,t.deltaY)}})})),m(t);var n=function(t){Ne(t.target,"aria-grabbed","focus"===t.raw.type?"true":"false")};u.push(jc(c,"focusin",n),jc(c,"focusout",n),jc(c,"keydown",(function(e){var n;W(s,(function(t){if(Be(e.target,"id")===a+"-"+t.name)return n=t,!1}));var r=function(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),d(n,r,o,i)};switch(e.raw.keyCode){case NO.LEFT:r(e,0,t,-10,0);break;case NO.RIGHT:r(e,0,t,10,0);break;case NO.UP:r(e,0,t,0,-10);break;case NO.DOWN:r(e,0,t,0,10);break;case NO.ENTER:case NO.SPACEBAR:e.prevent(),o()}})))}();var p=_(_({},RO),{toggleVisibility:function(t){var e=E(E([],U(s,(function(t){return"#"+a+"-"+t.name})),!0),U(l,(function(t){return"#"+a+"-"+t})),!0).join(","),n=qs(c,e);W(n,t?function(t){return Ke(t,"display")}:function(t){return Ve(t,"display","none")})},setClampRect:function(e){n=e,m(t)},setRect:g,getInnerRect:function(){return f(n,t)},setInnerRect:h,setViewPortRect:function(n){e=n,m(t)},destroy:function(){W(i,(function(t){return t.destroy()})),i=[],W(u,(function(t){return t.unbind()})),u=[]}});return p},LO=function(t){var e,n=Zh({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),r=lo(1),o=(e=Lc(),_(_({},e),{run:function(t){return e.get().each(t)}})),i=lo({x:0,y:0,w:1,h:1}),u=lo({x:0,y:0,w:1,h:1}),a=function(t,e){l.getOpt(t).each((function(t){var u=r.get(),a=cn(t.element),c=Ze(t.element),s=e.dom.naturalWidth*u,l=e.dom.naturalHeight*u,f=Math.max(0,a/2-s/2),d=Math.max(0,c/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:l.toString()+"px",position:"absolute"};je(e,m),n.getOpt(t).each((function(t){je(t.element,m)})),o.run((function(t){var e=i.get();t.setRect({x:e.x*u+f,y:e.y*u+d,w:e.w*u,h:e.h*u}),t.setClampRect({x:f,y:d,w:s,h:l}),t.setViewPortRect({x:0,y:0,w:a,h:c})}))}))},c=function(t,e){var n,o=zt.fromTag("img");return Ne(o,"src",e),(n=o.dom,new kp((function(t){var e=function(){n.removeEventListener("load",e),t(n)};n.complete?t(n):n.addEventListener("load",e)}))).then((function(){t.getSystem().isConnected()&&l.getOpt(t).map((function(t){var e=ju({element:o});qg.replaceAt(t,1,z.some(e));var n=u.get(),c={x:0,y:0,w:o.dom.naturalWidth,h:o.dom.naturalHeight};u.set(c);var s=MO.inflate(c,-20,-20);i.set(s),n.w===c.w&&n.h===c.h||function(t,e){l.getOpt(t).each((function(t){var n=cn(t.element),o=Ze(t.element),i=e.dom.naturalWidth,u=e.dom.naturalHeight,a=Math.min(n/i,o/u);a>=1?r.set(1):r.set(a)}))}(t,o),a(t,o)}))}))},s=vw.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[n.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:cc([Gg("image-panel-crop-events",[Pi((function(t){l.getOpt(t).each((function(t){var e=t.element.dom,n=IO({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,h);n.toggleVisibility(!1),n.on("updateRect",(function(t){var e=t.rect,n=r.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)};i.set(o)})),o.set(n)}))})),Ii((function(){o.clear()}))])])}],containerBehaviours:cc([qg.config({}),Gg("image-panel-events",[Pi((function(e){c(e,t)}))])])}),l=Zh(s);return{memContainer:l,updateSrc:c,zoom:function(t,e){var n=r.get(),o=e>0?Math.min(2,n+.1):Math.max(.1,n-.1);r.set(o),l.getOpt(t).each((function(t){var e=t.components()[1].element;a(t,e)}))},showCrop:function(){o.run((function(t){t.toggleVisibility(!0)}))},hideCrop:function(){o.run((function(t){t.toggleVisibility(!1)}))},getRect:function(){return i.get()},getMeasurements:function(){var t=u.get();return{width:t.w,height:t.h}}}},HO=function(t,e,n,r,o){return lO({name:t,icon:z.some(e),disabled:n,tooltip:z.some(t),primary:!1,borderless:!1},r,o)},FO=function(t,e){e?zd.enable(t):zd.disable(t)};var VO,jO=function(t){var e,n,r,o,i=lo(t),u=Fc(),a=(n=-1,{data:e=[],add:function(t){var r=e.splice(++n);return e.push(t),{state:t,removed:r}},undo:function(){if(r())return e[--n]},redo:function(){if(o())return e[++n]},canUndo:r=function(){return n>0},canRedo:o=function(){return-1!==n&&n<e.length-1}});a.add(t);var c=function(t){i.set(t)},s=function(t){return{blob:t,url:URL.createObjectURL(t)}},l=function(t){URL.revokeObjectURL(t.url)},f=function(){u.on(l),u.clear()},d=function(t){var e=s(t);c(e);var n,r=a.add(e).removed;return n=r,HS.each(n,l),e.url};return{getBlobState:function(){return i.get()},setBlobState:c,addBlobState:d,getTempState:function(){return u.get().getOrThunk(i.get)},updateTempState:function(t){var e=s(t);return f(),u.set(e),e.url},addTempState:function(t){var e=s(t);return u.set(e),e.url},applyTempState:function(t){return u.get().fold(h,(function(e){d(e.blob),t()}))},destroyTempState:f,undo:function(){var t=a.undo();return c(t),t.url},redo:function(){var t=a.redo();return c(t),t.url},getHistoryStates:function(){return{undoEnabled:a.canUndo(),redoEnabled:a.canRedo()}}}},UO=function(t,e){var n=jO(t.currentState),r=function(t){var e=n.getHistoryStates();d.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),wi(t,AO.formActionEvent,{name:AO.saveState(),value:e.undoEnabled})},o=function(t){return t.toBlob()},i=function(t){wi(t,AO.formActionEvent,{name:AO.disable(),value:{}})},u=function(t){m.getApplyButton(t).each((function(t){zd.enable(t)})),wi(t,AO.formActionEvent,{name:AO.enable(),value:{}})},a=function(t,e){return i(t),f.updateSrc(t,e)},c=function(t,e,n,c,s){i(t),function(t){return gk(t)}(e).then(n).then(o).then(c).then((function(e){return a(t,e)})).then((function(){r(t),s(),u(t)})).catch((function(e){console.log(e),t.getSystem().isConnected()&&u(t)}))},s=function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,(function(t){return n.updateTempState(t)}),r)},l=function(t){var e=n.getBlobState().url;return n.destroyTempState(),r(t),e},f=LO(t.currentState.url),d=function(t){var e=Zh(HO("Undo","undo",!0,(function(t){wi(t,OO.undo(),{direction:1})}),t)),n=Zh(HO("Redo","redo",!0,(function(t){wi(t,OO.redo(),{direction:1})}),t));return{container:vw.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),HO("Zoom in","zoom-in",!1,(function(t){wi(t,OO.zoom(),{direction:1})}),t),HO("Zoom out","zoom-out",!1,(function(t){wi(t,OO.zoom(),{direction:-1})}),t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each((function(t){FO(t,r)})),n.getOpt(t).each((function(t){FO(t,o)}))}}}(e),m=DO(f,e);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[m.memContainer.asSpec(),f.memContainer.asSpec(),d.container],behaviours:cc([df.config({store:{mode:"manual",getValue:function(){return n.getBlobState()}}}),Gg("image-tools-events",[Ei(OO.undo(),(function(t,e){var o=n.undo();a(t,o).then((function(e){u(t),r(t)}))})),Ei(OO.redo(),(function(t,e){var o=n.redo();a(t,o).then((function(e){u(t),r(t)}))})),Ei(OO.zoom(),(function(t,e){var n=e.event.direction;f.zoom(t,n)})),Ei(OO.back(),(function(t,e){!function(t){var e=l(t);a(t,e).then((function(e){u(t)}))}(t),(0,e.event.swap)(),f.hideCrop()})),Ei(OO.apply(),(function(t,e){n.applyTempState((function(){l(t),(0,e.event.swap)()}))})),Ei(OO.transform(),(function(t,e){return s(t,e.event.transform,h)})),Ei(OO.tempTransform(),(function(t,e){return function(t,e){var r=n.getTempState().blob;c(t,r,e,(function(t){return n.addTempState(t)}),h)}(t,e.event.transform)})),Ei(OO.transformApply(),(function(t,e){return function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,(function(e){var r=n.addBlobState(e);return l(t),r}),r)}(t,e.event.transform,e.event.swap)})),Ei(OO.swap(),(function(t,e){!function(t){d.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event.transform,r=e.event.swap;n.fold((function(){r()}),(function(e){s(t,e,r)}))}))]),NS()])}},WO=function(t){return!wt(t,"items")},qO=function(t,e,n,r){return U(n,(function(n){return WO(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){df.setValue(t,n.value),wi(t,Dw,{name:e}),Jg.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return qO(t,e,n.items,r)}}}))},GO=function(t,e){return st(t,(function(t){return WO(t)?Ot(t.value===e,t):GO(t.items,e)}))},$O=hd({name:"HtmlSelect",configFields:[Hr("options"),mf("selectBehaviours",[Jg,df]),eo("selectClasses",[]),eo("selectAttributes",{}),Xr("data")],factory:function(t,e){var n=U(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return ho("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:hf(t.selectBehaviours,[Jg.config({}),df.config({store:_({mode:"manual",getValue:function(t){return Nu(t.element)},setValue:function(e,n){K(t.options,(function(t){return t.value===n})).isSome()&&zu(e.element,n)}},r)})])}}}),XO=function(t,e){var n=t.label.map((function(t){return Aw(t,e)})),r=[zd.config({disabled:function(){return t.disabled||e.isDisabled()}}),bb(),Fg.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return yi(t,zw),z.some(!0)}}),Gg("textfield-change",[Ei(Ho(),(function(e,n){wi(e,Dw,{name:t.name})})),Ei(Yo(),(function(e,n){wi(e,Dw,{name:t.name})}))]),kw.config({})],o=t.validation.map((function(t){return lx.config({getRoot:function(t){return he(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=df.getValue(e),r=t.validator(n);return tx(!0===r?zn.value(n):zn.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),i=t.placeholder.fold(v({}),(function(t){return{placeholder:e.translate(t)}})),u=t.inputMode.fold(v({}),(function(t){return{inputmode:t}})),a=_(_({},i),u),c=xw.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:a,inputClasses:[t.classname],inputBehaviours:cc(J([r,o])),selectOnFocus:!1,factory:Ww}),s=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),l=[zd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){xw.getField(t).each(zd.disable)},onEnabled:function(t){xw.getField(t).each(zd.enable)}}),bb()];return _w(n,c,s,l)},KO=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return Oi([Ei(t.event,n),Ii((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Ei(t,(function(){return e.cancel()}))]})).getOr([])))}}),YO=function(t){var e=lo(null);return fu({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()}})},JO=Object.freeze({__proto__:null,throttle:YO,init:function(t){return t.stream.streams.state(t)}}),QO=[Fr("stream",Br("mode",{throttle:[Hr("delay"),eo("stopEvent",!0),wa("streams",{setup:function(t,e){var n=t.stream,r=mp(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:YO})]})),eo("event","input"),Xr("cancelEvent"),ba("onStream")],ZO=lc({fields:QO,name:"streaming",active:KO,state:JO}),t_=function(t,e,n){var r=df.getValue(n);df.setValue(e,r),n_(e)},e_=function(t,e){var n=t.element,r=Nu(n),o=n.dom;"number"!==Be(n,"type")&&e(o,r)},n_=function(t){e_(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},r_=function(t,e,n){if(t.selectsOver){var r=df.getValue(e),o=t.getDisplayText(r),i=df.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?z.some((function(){t_(0,e,n),function(t,e){e_(t,(function(t,n){return t.setSelectionRange(e,n.length)}))}(e,o.length)})):z.none()}return z.none()},o_=v("alloy.typeahead.itemexecute"),i_=v([Xr("lazySink"),Hr("fetch"),eo("minChars",5),eo("responseTime",1e3),pa("onOpen"),eo("getHotspot",z.some),eo("getAnchorOverrides",v({})),eo("layouts",z.none()),eo("eventOrder",{}),so("model",{},[eo("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),eo("selectsOver",!0),eo("populateFromBrowse",!0)]),pa("onSetValue"),va("onExecute"),pa("onItemExecute"),eo("inputClasses",[]),eo("inputAttributes",{}),eo("inputStyles",{}),eo("matchWidth",!0),eo("useMinWidth",!1),eo("dismissOnBlur",!0),ga(["openClass"]),Xr("initialData"),mf("typeaheadBehaviours",[Jg,df,ZO,Fg,sh,mx]),Ir("previewing",(function(){return lo(!0)}))].concat(Fw()).concat(Ex())),u_=v([jf({schema:[ma()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){r_(t.model,r,n).fold((function(){return qd.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&t_(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return wi(t,o_(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&t_(t.model,e,n)}))}}}})]),a_=pd({name:"Typeahead",configFields:i_(),partFields:u_(),factory:function(t,e,n,r){var o=function(e,n,o){t.previewing.set(!1);var i=mx.getCoupled(e,"sandbox");if(ql.isOpen(i))wd.getCurrent(i).each((function(t){qd.getHighlighted(t).fold((function(){o(t)}),(function(){ki(i,t.element,"keydown",n)}))}));else{wx(t,u(e),e,i,r,(function(t){wd.getCurrent(t).each(o)}),$w.HighlightFirst).get(h)}},i=Vw(t),u=function(t){return function(e){return e.map((function(e){var n=bt(e.menus),r=Q(n,(function(t){return G(t.items,(function(t){return"item"===t.type}))}));return df.getState(t).update(U(r,(function(t){return t.data}))),e}))}},a=[Jg.config({}),df.config({onSetValue:t.onSetValue,store:_({mode:"dataset",getDataKey:function(t){return Nu(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){zu(e.element,t.model.getDisplayText(n))}},t.initialData.map((function(t){return ho("initialValue",t)})).getOr({}))}),ZO.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,n){var o=mx.getCoupled(e,"sandbox");if(Jg.isFocused(e)&&Nu(e.element).length>=t.minChars){var i=wd.getCurrent(o).bind((function(t){return qd.getHighlighted(t).map(df.getValue)}));t.previewing.set(!0);wx(t,u(e),e,o,r,(function(e){wd.getCurrent(o).each((function(e){i.fold((function(){t.model.selectsOver&&qd.highlightFirst(e)}),(function(t){qd.highlightBy(e,(function(e){return df.getValue(e).value===t.value})),qd.getHighlighted(e).orThunk((function(){return qd.highlightFirst(e),z.none()}))}))}))}),$w.HighlightFirst).get(h)}},cancelEvent:ri()}),Fg.config({mode:"special",onDown:function(t,e){return o(t,e,qd.highlightFirst),z.some(!0)},onEscape:function(t){var e=mx.getCoupled(t,"sandbox");return ql.isOpen(e)?(ql.close(e),z.some(!0)):z.none()},onUp:function(t,e){return o(t,e,qd.highlightLast),z.some(!0)},onEnter:function(e){var n=mx.getCoupled(e,"sandbox"),r=ql.isOpen(n);if(r&&!t.previewing.get())return wd.getCurrent(n).bind((function(t){return qd.getHighlighted(t)})).map((function(t){return wi(e,o_(),{item:t}),!0}));var o=df.getValue(e);return yi(e,ri()),t.onExecute(n,e,o),r&&ql.close(n),z.some(!0)}}),sh.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),mx.config({others:{sandbox:function(e){return _x(t,e,{onOpen:function(){return sh.on(e)},onClose:function(){return sh.off(e)}})}}}),Gg("typeaheadevents",[Hi((function(e){var n=h;Cx(t,u(e),e,r,n,$w.HighlightFirst).get(h)})),Ei(o_(),(function(e,n){var r=mx.getCoupled(e,"sandbox");t_(t.model,e,n.event.item),yi(e,ri()),t.onItemExecute(e,r,n.event.item,df.getValue(e)),ql.close(r),n_(e)}))].concat(t.dismissOnBlur?[Ei(Ko(),(function(t){var e=mx.getCoupled(t,"sandbox");wc(e.element).isNone()&&ql.close(e)}))]:[]))];return{uid:t.uid,dom:Uw(Jn(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:_(_({},i),hf(t.typeaheadBehaviours,a)),eventOrder:t.eventOrder}}}),c_=function(t){return _(_({},t),{toCached:function(){return c_(t.toCached())},bindFuture:function(e){return c_(t.bind((function(t){return t.fold((function(t){return tx(zn.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return c_(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return c_(t.map((function(t){return t.map(e)})))},mapError:function(e){return c_(t.map((function(t){return t.mapError(e)})))},foldResult:function(e,n){return t.map((function(t){return t.fold(e,n)}))},withTimeout:function(e,n){return c_(Zw((function(r){var o=!1,i=setTimeout((function(){o=!0,r(zn.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))}})},s_=function(t){return c_(Zw(t))},l_=s_,f_={type:"separator"},d_=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:h}},m_=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:h}},g_=function(t,e){return function(t){return U(t,d_)}(function(t,e){return G(e,(function(e){return e.type===t}))}(t,e))},h_=function(t){return g_("header",t.targets)},p_=function(t){return g_("anchor",t.targets)},v_=function(t){return z.from(t.anchorTop).map((function(t){return m_("<top>",t)})).toArray()},b_=function(t){return z.from(t.anchorBottom).map((function(t){return m_("<bottom>",t)})).toArray()},y_=function(t,e){var n=t.toLowerCase();return G(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return Tt(e.toLowerCase(),n)||Tt(t.value.toLowerCase(),n)}))},w_=function(t,e,n){var r=df.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=y_(o,function(t){return U(t,(function(t){return m_(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,y_(o,h_(e)),y_(o,J([v_(e),p_(e),b_(e)]))],X(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(f_,e)}),[])):i}))},x_=Xi("aria-invalid"),C_=function(t){return function(e,n,r){return yt(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},S_={bar:C_((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:U(t.items,e.interpreter)}}(t,e.shared)})),collection:C_((function(t,e){return Hw(t,e.shared.providers)})),alertbanner:C_((function(t,e){return function(t,e){return vw.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Qh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:ip(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){wi(e,Nw,{name:"alert-banner",value:t.url})},buttonBehaviours:cc([up()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:C_((function(t,e){return function(t,e){return XO({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:z.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:C_((function(t,e){return function(t,e){return XO({name:t.name,multiline:!0,label:t.label,inputMode:z.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:z.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:C_((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=U(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:cc([NS(),qg.config({}),qS(z.none()),Fg.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:function(t){return function(e,n,r){var o=Jn(n,{source:"dynamic"});return C_(t)(e,o,r)}}((function(t,e){return nk(t,e.shared.providers)})),button:C_((function(t,e){return hO(t,e.shared.providers)})),checkbox:C_((function(t,e){return function(t,e){var n=df.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),r=function(t){return t.element.dom.click(),z.some(!0)},o=xw.parts.field({factory:{sketch:b},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:cc([NS(),zd.config({disabled:function(){return t.disabled||e.isDisabled()}}),kw.config({}),Jg.config({}),n,Fg.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),Gg("checkbox-events",[Ei(Fo(),(function(e,n){wi(e,Dw,{name:t.name})}))])])}),i=xw.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:cc([Nx.config({})])}),u=function(t){return cp("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},e.icons)},a=Zh({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[u("checked"),u("unchecked")]});return xw.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,a.asSpec(),i],fieldBehaviours:cc([zd.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){xw.getField(t).each(zd.disable)},onEnabled:function(t){xw.getField(t).each(zd.enable)}}),bb()])})}(t,e.shared.providers)})),colorinput:C_((function(t,e){return Ix(t,e.shared,e.colorinput)})),colorpicker:C_((function(t){var e=function(t){return"tox-"+t},n=RS(IS,e),r=Zh(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){wi(t,Nw,{name:"hex-valid",value:!0})},onInvalidHex:function(t){wi(t,Nw,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:cc([df.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return wd.getCurrent(e).bind((function(t){return df.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);wd.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(t){df.setValue(t,{hex:z.from(n[1]).getOr("")}),_S.getField(t,"hex").each((function(t){yi(t,Ho())}))}))}}}),NS()])}})),dropzone:C_((function(t,e){return $S(t,e.shared.providers)})),grid:C_((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:U(t.items,e.interpreter)}}(t,e.shared)})),listbox:C_((function(t,e){return function(t,e){var n=e.shared.providers,r=ut(t.items).filter(WO),o=t.label.map((function(t){return Aw(t,n)})),i={dom:{tag:"div",classes:["tox-listboxfield"]},components:[xw.parts.field({dom:{},factory:{sketch:function(n){return Qk({uid:n.uid,text:r.map((function(t){return t.text})),icon:z.none(),tooltip:t.label,role:z.none(),fetch:function(n,r){var o=qO(n,t.name,t.items,df.getValue(n));r(oO(o,Yp.CLOSE_ON_EXECUTE,e,!1))},onSetup:v(h),getApi:v({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[kw.config({}),df.config({store:{mode:"manual",initialValue:r.map((function(t){return t.value})).getOr(""),getValue:function(t){return Be(t.element,"data-value")},setValue:function(e,n){GO(t.items,n).each((function(t){Ne(e.element,"data-value",t.value),wi(e,Yk,{text:t.text})}))}}})]},"tox-listbox",e.shared)}}})]};return xw.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:J([o.toArray(),[i]]),fieldBehaviours:cc([zd.config({disabled:v(t.disabled),onDisabled:function(t){xw.getField(t).each(zd.disable)},onEnabled:function(t){xw.getField(t).each(zd.enable)}})])})}(t,e)})),selectbox:C_((function(t,e){return function(t,e){var n=U(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return Aw(t,e)})),o=xw.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:$O,selectBehaviours:cc([zd.config({disabled:function(){return t.disabled||e.isDisabled()}}),kw.config({}),Gg("selectbox-change",[Ei(Fo(),(function(e,n){wi(e,Dw,{name:t.name})}))])])}),i=t.size>1?z.none():z.some(cp("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),u={dom:{tag:"div",classes:["tox-selectfield"]},components:J([[o],i.toArray()])};return xw.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:J([r.toArray(),[u]]),fieldBehaviours:cc([zd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){xw.getField(t).each(zd.disable)},onEnabled:function(t){xw.getField(t).each(zd.enable)}}),bb()])})}(t,e.shared.providers)})),sizeinput:C_((function(t,e){return kO(t,e.shared.providers)})),urlinput:C_((function(t,e){return function(t,e,n){var r,o=e.shared.providers,i=function(e){var r=df.getValue(e);n.addToHistory(r.value,t.filetype)},u=xw.parts.field({factory:a_,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":x_,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=w_(t.filetype,r,n),i=oO(o,Yp.BUBBLE_TO_SANDBOX,e,!1);return tx(i)},getHotspot:function(t){return d.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(lx)&&lx.run(t).get(h)},typeaheadBehaviours:cc(J([n.getValidationHandler().map((function(e){return lx.config({getRoot:function(t){return he(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){c.getOpt(t).each((function(t){Ne(t.element,"title",o.translate(e))}))}},validator:{validate:function(n){var r=df.getValue(n);return l_((function(n){e({type:t.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=zn.error(t.message);n(e)}else{var r=zn.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[zd.config({disabled:function(){return t.disabled||o.isDisabled()}}),kw.config({}),Gg("urlinput-events",J(["file"===t.filetype?[Ei(Ho(),(function(e){wi(e,Dw,{name:t.name})}))]:[],[Ei(Fo(),(function(e){wi(e,Dw,{name:t.name}),i(e)})),Ei(Yo(),(function(e){wi(e,Dw,{name:t.name}),i(e)}))]]))]])),eventOrder:(r={},r[Ho()]=["streaming","urlinput-events","invalidating"],r),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:av(0,0,"normal")},onExecute:function(t,e,n){wi(e,zw,{})},onItemExecute:function(e,n,r,o){i(e),wi(e,Dw,{name:t.name})}}),a=t.label.map((function(t){return Aw(t,o)})),c=Zh(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),cp(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:_({title:o.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))},o.icons)}("invalid",z.some(x_),"warning")),s=Zh({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),l=n.getUrlPicker(t.filetype),f=Xi("browser.url.event"),d=Zh({dom:{tag:"div",classes:["tox-control-wrap"]},components:[u,s.asSpec()],behaviours:cc([zd.config({disabled:function(){return t.disabled||o.isDisabled()}})])}),m=Zh(dO({name:t.name,icon:z.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return yi(t,f)}),o,[],["tox-browse-url"]));return xw.sketch({dom:Ew([]),components:a.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:J([[d.asSpec()],l.map((function(){return m.asSpec()})).toArray()])}]),fieldBehaviours:cc([zd.config({disabled:function(){return t.disabled||o.isDisabled()},onDisabled:function(t){xw.getField(t).each(zd.disable),m.getOpt(t).each(zd.disable)},onEnabled:function(t){xw.getField(t).each(zd.enable),m.getOpt(t).each(zd.enable)}}),bb(),Gg("url-input-events",[Ei(f,(function(e){wd.getCurrent(e).each((function(n){var r=df.getValue(n),o=_({fieldname:t.name},r);l.each((function(r){r(o).get((function(r){df.setValue(n,r),wi(e,Dw,{name:t.name})}))}))}))}))])])})}(t,e,e.urlinput)})),customeditor:C_((function(t){var e=Fc(),n=Zh({dom:{tag:t.tag}}),r=Fc();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:cc([Gg("custom-editor-events",[Pi((function(o){n.getOpt(o).each((function(n){(!function(t){return wt(t,"init")}(t)?LS.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)})):t.init(n.element.dom)).then((function(t){r.on((function(e){t.setValue(e)})),r.clear(),e.set(t)}))}))}))]),df.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(n)}),(function(t){return t.setValue(n)}))}}}),NS()]),components:[n.asSpec()]}})),htmlpanel:C_((function(t){return"presentation"===t.presets?vw.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):vw.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:cc([kw.config({}),Jg.config({})])})})),imagetools:C_((function(t,e){return UO(t,e.shared.providers)})),table:C_((function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},u=function(t){return{dom:{tag:"tr"},components:U(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:U(r,o)}]}),(n=t.cells,{dom:{tag:"tbody"},components:U(n,u)})],behaviours:cc([kw.config({}),Jg.config({})])}}(t,e.shared.providers)})),panel:C_((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:U(t.items,e.shared.interpreter)}}(t,e)}))},k_={field:function(t,e){return e}},O_=function(t,e,n){var r=Jn(n,{shared:{interpreter:function(e){return __(t,e,r)}}});return __(t,e,r)},__=function(t,e,n){return yt(S_,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},T_={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},E_=function(t,e,n){var r={maxHeightFunction:es()};return function(){return n()?{type:"node",root:Oe(t()),node:z.from(t()),bubble:is(12,12,T_),layouts:{onRtl:function(){return[jh]},onLtr:function(){return[Vh]}},overrides:r}:{type:"hotspot",hotspot:e(),bubble:is(-12,12,T_),layouts:{onRtl:function(){return[ja]},onLtr:function(){return[Ua]}},overrides:r}}},A_=function(t,e,n){return function(){return n()?{type:"node",root:Oe(t()),node:z.from(t()),layouts:{onRtl:function(){return[Uh]},onLtr:function(){return[Uh]}}}:{type:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[$a]},onLtr:function(){return[$a]}}}}},D_=function(t,e){return function(){return{type:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return z.some(Ms.range(zt.fromDom(e.startContainer),e.startOffset,zt.fromDom(e.endContainer),e.endOffset))}}}},M_=function(t){return function(e){return{type:"node",root:t(),node:e}}},R_=function(t,e,n){var r=ab(t),o=function(){return zt.fromDom(t.getBody())},i=function(){return zt.fromDom(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:E_(i,e,u),banner:A_(i,e,u),cursor:D_(t,o),node:M_(o)}},N_=function(t){return function(e,n){zy(t)(e,n)}},z_=function(t){return function(){return Sy(t)}},B_=function(t){return function(){return ky(t)}},P_=function(t){return function(){return _y(t)}},I_=function(t){return{colorPicker:N_(t),hasCustomColors:z_(t),getColors:B_(t),getColorCols:P_(t)}},L_=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},H_=function(t){return{isDraggableModal:L_(t)}},F_=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],V_=function(t){return X(t,(function(t,e){if(wt(e,"items")){var n=V_(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(function(t){return wt(t,"inline")}(e)||function(t){return wt(t,"block")}(e)||function(t){return wt(t,"selector")}(e)){var r="custom-"+(o(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:r,format:e}]),formats:t.formats.concat([{title:e.title,format:r,icon:e.icon}])}}return _(_({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},j_=function(t){return function(t){return z.from(t.getParam("style_formats")).filter(u)}(t).map((function(e){var n=function(t,e){var n=V_(e),r=function(e){W(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?F_.concat(n):n})).getOr(F_)},U_=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Jn(t,r)},W_=function(t,e,n,r){var i=function(e){return U(e,(function(e){var u=lt(e);if(xt(e,"items")){var a=i(e.items);return Jn(function(t){return Jn(t,{type:"submenu"})}(e),{getStyleItems:v(a)})}return xt(e,"format")?function(t){return U_(t,n,r)}(e):1===u.length&&H(u,"title")?Jn(e,{type:"separator"}):function(e){var i=o(e.name)?e.name:Xi(e.title),u="custom-"+i,a={type:"formatter",format:u,isSelected:n(u),getStylePreview:r(u)},c=Jn(e,a);return t.formatter.register(i,c),c}(e)}))};return i(e)},q_=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?z.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):z.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?Q(e,r):[t.format]},o=lo([]),i=lo([]),u=lo([]),a=lo([]),c=lo(!1);t.on("PreInit",(function(u){var a=j_(t),c=W_(t,a,e,n);o.set(c),i.set(Q(c,r))})),t.on("addStyleModifications",(function(o){var i=W_(t,o.items,e,n);u.set(i),c.set(o.replace),a.set(Q(i,r))}));return{getData:function(){var t=c.get()?[]:o.get(),e=u.get();return t.concat(e)},getFlattenedKeys:function(){var t=c.get()?[]:i.get(),e=a.get();return t.concat(e)}}},G_=HS.trim,$_=function(t){return function(e){if(function(t){return f(t)&&1===t.nodeType}(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},X_=$_("true"),K_=$_("false"),Y_=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},J_=function(t){return t.innerText||t.textContent},Q_=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&tT(t)},Z_=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},tT=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return X_(t)}return!1}(t)&&!K_(t)},eT=function(t){return Z_(t)&&tT(t)},nT=function(t){var e=function(t){return t.id?t.id:Xi("h")}(t);return Y_("header",J_(t),"#"+e,function(t){return Z_(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},rT=function(t){var e=t.id||t.name,n=J_(t);return Y_("anchor",n||"#"+e,"#"+e,0,h)},oT=function(t){var e,n;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,U(qs(zt.fromDom(n),e),(function(t){return t.dom}))},iT=function(t){return G_(t.title).length>0},uT=function(t){var e=oT(t);return G(function(t){return U(G(t,eT),nT)}(e).concat(function(t){return U(G(t,Q_),rT)}(e)),iT)},aT="tinymce-url-history",cT=function(t){return o(t)&&/^https?/.test(t)},sT=function(t){return i(t)&&vt(t,(function(t){return!(u(e=t)&&e.length<=5&&Z(e,cT));var e})).isNone()},lT=function(){var t,e=by.getItem(aT);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+aT+" was not valid JSON",t),{};throw t}return sT(t)?t:(console.log("Local storage "+aT+" was not valid format",t),{})},fT=function(t){var e=lT();return yt(e,t).getOr([])},dT=function(t,e){if(cT(t)){var n=lT(),r=yt(n,e).getOr([]),o=G(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!sT(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));by.setItem(aT,JSON.stringify(t))}(n)}},mT=function(t){return!!t},gT=function(t){return mt(HS.makeMap(t,/[, ]/),mT)},hT=function(t){return z.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(d)},pT=function(t,e){var n=function(t){var e=z.some(function(t){return t.getParam("file_picker_types")}(t)).filter(mT),n=z.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(mT),r=e.or(n).map(gT);return hT(t).fold(S,(function(t){return r.fold(k,(function(t){return lt(t).length>0&&t}))}))}(t);return c(n)?n?hT(t):z.none():n[e]?hT(t):z.none()},vT=function(t){return z.from(t).filter(o).getOrUndefined()},bT=function(t){return{getHistory:fT,addToHistory:dT,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?z.none():z.some({targets:uT(t.getBody()),anchorTop:vT(mb(t)),anchorBottom:vT(gb(t))})}(t)},getValidationHandler:function(){return function(t){return z.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return pT(t,e).map((function(n){return function(r){return Zw((function(u){var a=_({filetype:e,fieldname:r.fieldname},z.from(r.meta).getOr({}));n.call(t,(function(t,e){if(!o(t))throw new Error("Expected value to be string");if(void 0!==e&&!i(e))throw new Error("Expected meta to be a object");u({value:t,meta:e})}),r.value,a)}))}}))}(t,e)}}},yT=function(t,e,n){var r=lo(!1),o=function(t){var e=lo(ib(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:tp.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return __(k_,t,e)}(t,i)},anchors:R_(e,n,o.isPositionedAtTop),header:o,getSink:function(){return zn.value(t)}},urlinput:bT(e),styleselect:q_(e),colorinput:I_(e),dialog:H_(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},wT=sd,xT=Gf,CT=v([eo("shell",!1),Hr("makeItem"),eo("setupItem",h),pf("listBehaviours",[qg])]),ST=Uf({name:"items",overrides:function(){return{behaviours:cc([qg.config({})])}}}),kT=v([ST]),OT=v("CustomList"),_T=pd({name:OT(),configFields:CT(),partFields:kT(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[qg.config({})],components:[]}:{behaviours:[],components:e},i=function(e){return t.shell?z.some(e):ed(e,t,"items")};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:hf(t.listBehaviours,o.behaviours),apis:{setItems:function(e,n){i(e).fold((function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(function(r){var o=qg.contents(r),i=n.length,u=i-o.length,a=u>0?V(u,(function(){return t.makeItem()})):[],c=o.slice(i);W(c,(function(t){return qg.remove(r,t)})),W(a,(function(t){return qg.append(r,t)}));var s=qg.contents(r);W(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),TT=v([Hr("dom"),eo("shell",!0),mf("toolbarBehaviours",[qg])]),ET=v([Uf({name:"groups",overrides:function(){return{behaviours:cc([qg.config({})])}}})]),AT=pd({name:"Toolbar",configFields:TT(),partFields:ET(),factory:function(t,e,n,r){var o=function(e){return t.shell?z.some(e):ed(e,t,"groups")},i=t.shell?{behaviours:[qg.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:hf(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,e){o(t).fold((function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(function(t){qg.set(t,e)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),DT=h,MT=S,RT=v([]),NT=Object.freeze({__proto__:null,setup:DT,isDocked:MT,getBehaviours:RT}),zT=function(t){return(Ct(Ge(t,"position"),"fixed")?z.none():pe(t)).orThunk((function(){var e=zt.fromTag("span");return he(t).bind((function(t){pn(t,e);var n=pe(e);return yn(e),n}))}))},BT=function(t){return zT(t).map(on).getOrThunk((function(){return nn(0,0)}))},PT=fo([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),IT=function(t,e){var n=t.element;Tu(n,e.transitionClass),Au(n,e.fadeOutClass),Tu(n,e.fadeInClass),e.onShow(t)},LT=function(t,e){var n=t.element;Tu(n,e.transitionClass),Au(n,e.fadeInClass),Tu(n,e.fadeOutClass),e.onHide(t)},HT=function(t,e,n){return Z(t,(function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}}))},FT=function(t,e){return e.getInitialPos().map((function(e){return En(e.bounds.x,e.bounds.y,cn(t),Ze(t))}))},VT=function(t,e,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return z.some(PT.static());case"absolute":var o=zT(t).map(An).getOrThunk((function(){return An(De())}));return z.some(PT.absolute(Cc("absolute",yt(r.style,"left").map((function(t){return e.x-o.x})),yt(r.style,"top").map((function(t){return e.y-o.y})),yt(r.style,"right").map((function(t){return o.right-e.right})),yt(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return z.none()}}))},jT=function(t,e,n){var r=An(t);if(HT(n.getModes(),r,e))return z.none();!function(t,e,n){n.setInitialPos({style:$e(t),position:We(t,"position")||"static",bounds:e})}(t,r,n);var o=Mn(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return z.some(PT.fixed(Cc("fixed",z.some(i),c?z.some(u):z.none(),z.none(),c?z.none():z.some(a))))},UT=function(t,e,n){var r=t.element;return Ct(Ge(r,"position"),"fixed")?function(t,e,n){return FT(t,n).filter((function(t){return HT(n.getModes(),t,e)})).bind((function(e){return VT(t,e,n)}))}(r,e,n):jT(r,e,n)},WT=function(t,e,n){n.setDocked(!1),W(["left","right","top","bottom","position"],(function(e){return Ke(t.element,e)})),e.onUndocked(t)},qT=function(t,e,n,r){var o="fixed"===r.position;n.setDocked(o),Sc(t.element,r),(o?e.onDocked:e.onUndocked)(t)},GT=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var u=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);u!==n.isVisible()&&(n.setVisible(u),o&&!u?(Mu(t.element,[e.fadeOutClass]),e.onHide(t)):(u?IT:LT)(t,e))}))}))},$T=function(t,e,n){var r=t.element;n.setDocked(!1),function(t,e){var n=t.element;return FT(n,e).bind((function(t){return VT(n,t,e)}))}(t,n).each((function(r){r.fold((function(){return WT(t,e,n)}),(function(r){return qT(t,e,n,r)}),h)})),n.setVisible(!0),e.contextual.each((function(e){Ru(r,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),XT(t,e,n)},XT=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t);n.isDocked()&&GT(t,e,n,r),UT(t,r,n).each((function(o){o.fold((function(){return WT(t,e,n)}),(function(r){return qT(t,e,n,r)}),(function(o){GT(t,e,n,r,!0),qT(t,e,n,o)}))}))}(t,e,n)},KT=function(t,e,n){n.isDocked()&&$T(t,e,n)},YT=Object.freeze({__proto__:null,refresh:XT,reset:KT,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),JT=Object.freeze({__proto__:null,events:function(t,e){return Oi([Bi(Uo(),(function(n,r){t.contextual.each((function(t){Du(n.element,t.transitionClass)&&(Ru(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n));r.stop()}))})),Ei(ai(),(function(n,r){XT(n,t,e)})),Ei(ci(),(function(n,r){KT(n,t,e)}))])}}),QT=[to("contextual",[jr("fadeInClass"),jr("fadeOutClass"),jr("transitionClass"),Wr("lazyContext"),pa("onShow"),pa("onShown"),pa("onHide"),pa("onHidden")]),ao("lazyViewport",Mn),co("modes",["top","bottom"],Cr),pa("onDocked"),pa("onUndocked")],ZT=lc({fields:QT,name:"docking",active:JT,apis:YT,state:Object.freeze({__proto__:null,init:function(t){var e=lo(!1),n=lo(!0),r=Fc(),o=lo(t.modes);return fu({isDocked:e.get,setDocked:e.set,getInitialPos:r.get,setInitialPos:r.set,clearInitialPos:r.clear,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked:  "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}})}),tE=v(Xi("toolbar-height-change")),eE={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},nE=function(t,e){return H(ZT.getModes(t),e)},rE=function(t){var e=t.element;he(e).each((function(n){var r="padding-"+ZT.getModes(t)[0];if(ZT.isDocked(t)){var o=cn(n);Ve(e,"width",o+"px"),Ve(n,r,function(t){return tn(t)+(parseInt(We(t,"margin-top"),10)||0)+(parseInt(We(t,"margin-bottom"),10)||0)}(e)+"px")}else Ke(e,"width"),Ke(n,r)}))},oE=function(t,e){e?(Au(t,eE.fadeOutClass),Mu(t,[eE.transitionClass,eE.fadeInClass])):(Au(t,eE.fadeInClass),Mu(t,[eE.fadeOutClass,eE.transitionClass]))},iE=function(t,e){var n=zt.fromDom(t.getContainer());e?(Tu(n,"tox-tinymce--toolbar-sticky-on"),Au(n,"tox-tinymce--toolbar-sticky-off")):(Tu(n,"tox-tinymce--toolbar-sticky-off"),Au(n,"tox-tinymce--toolbar-sticky-on"))},uE=function(t,e){var n=Fc(),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||rE(e),iE(t,ZT.isDocked(e)),e.getSystem().broadcastOn([$l()],{}),r().each((function(t){return t.getSystem().broadcastOn([$l()],{})}))},u=t.inline?[]:function(){var t;return[gc.config({channels:(t={},t[tE()]={onReceive:rE},t)})]}();return E([Jg.config({}),ZT.config({contextual:_({lazyContext:function(e){var n=tn(e.element),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=An(zt.fromDom(r)),i=o.height-n,u=o.y+(nE(e,"top")?0:n);return z.some(En(o.x,u,o.width,i))},onShow:function(){o((function(t){return oE(t,!0)}))},onShown:function(t){o((function(t){return Ru(t,[eE.transitionClass,eE.fadeInClass])})),n.get().each((function(e){var r,o,i;r=t.element,i=fe(o=e),yc(i).filter((function(t){return!ce(o,t)})).filter((function(t){return ce(t,zt.fromDom(i.dom.body))||le(r,t)})).each((function(){return vc(o)})),n.clear()}))},onHide:function(t){(function(t,e){return wc(t).orThunk((function(){return e().toOptional().bind((function(t){return wc(t.element)}))}))})(t.element,r).fold(n.clear,n.set),o((function(t){return oE(t,!1)}))},onHidden:function(){o((function(t){return Ru(t,[eE.transitionClass])}))}},eE),lazyViewport:function(e){var n=Mn(),r=function(t){return t.getParam("toolbar_sticky_offset",0,"number")}(t),o=n.y+(nE(e,"top")?r:0),i=n.height-(nE(e,"bottom")?r:0);return En(n.x,o,n.width,i)},modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],u,!0)},aE=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(ZT.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(rE)})),t.on("SkinLoaded",(function(){n().each((function(t){ZT.isDocked(t)?ZT.reset(t):ZT.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(ZT.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){ZT.refresh(e);var n=e.element;zm(n)&&function(t,e){var n=fe(e),r=n.dom.defaultView.innerHeight,o=xn(n),i=zt.fromDom(t.elm),u=Dn(i),a=Ze(i),c=u.y,s=c+a,l=on(e),f=Ze(e),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,h=Math.abs(m-(o.top+r))<2;if(g&&c<m)Cn(o.left,c-f,n);else if(h&&s>d){var p=c-r+a+f;Cn(o.left,p,n)}}(t,n)}))})),t.on("PostRender",(function(){iE(t,!1)}))},isDocked:function(t){return t().map(ZT.isDocked).getOr(!1)},getBehaviours:uE}),cE=gr([jr("type"),Fr("items",pr([br([jr("name"),$r("items",Cr)]),Cr]))].concat(zp)),sE=[Jr("text"),Jr("tooltip"),Jr("icon"),Wr("fetch"),ao("onSetup",(function(){return h}))],lE=gr(E([jr("type")],sE,!0)),fE=function(t){return Mr("menubutton",lE,t)},dE=gr([jr("type"),Jr("tooltip"),Jr("icon"),Jr("text"),Qr("select"),Wr("fetch"),ao("onSetup",(function(){return h})),io("presets","normal",["normal","color","listpreview"]),eo("columns",1),Wr("onAction"),Wr("onItemAction")]),mE=hd({factory:function(t,e){var n={focus:Fg.focusIn,setMenus:function(t,n){var r=U(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=fE(n).mapError((function(t){return zr(t)})).getOrDie();return uO(r,"tox-mbtn",e.backstage,z.some("menuitem"))}));qg.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:cc([qg.config({}),Gg("menubar-events",[Pi((function(e){t.onSetup(e)})),Ei(zo(),(function(t,e){Zu(t.element,".tox-mbtn--active").each((function(n){ta(e.event.target,".tox-mbtn").each((function(e){ce(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){Mx.expand(t),Mx.close(n),Jg.focus(t)}))}))}))}))})),Ei(mi(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){Mx.isOpen(n)&&(Mx.expand(t),Mx.close(n))}))}))}))]),Fg.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),z.some(!0)}}),kw.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Hr("dom"),Hr("uid"),Hr("onEscape"),Hr("backstage"),eo("onSetup",h)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),gE=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},hE=function(t){return t.dimension.property},pE=function(t,e){return t.dimension.getDimension(e)},vE=function(t,e){var n=gE(t,e);Ru(n,[e.shrinkingClass,e.growingClass])},bE=function(t,e){Au(t.element,e.openClass),Tu(t.element,e.closedClass),Ve(t.element,hE(e),"0px"),Ye(t.element)},yE=function(t,e){Au(t.element,e.closedClass),Tu(t.element,e.openClass),Ke(t.element,hE(e))},wE=function(t,e,n,r){n.setCollapsed(),Ve(t.element,hE(e),pE(e,t.element)),Ye(t.element),vE(t,e),bE(t,e),e.onStartShrink(t),e.onShrunk(t)},xE=function(t,e,n,r){var o=r.getOrThunk((function(){return pE(e,t.element)}));n.setCollapsed(),Ve(t.element,hE(e),o),Ye(t.element);var i=gE(t,e);Au(i,e.growingClass),Tu(i,e.shrinkingClass),bE(t,e),e.onStartShrink(t)},CE=function(t,e,n){var r=pE(e,t.element);("0px"===r?wE:xE)(t,e,n,z.some(r))},SE=function(t,e,n){var r=gE(t,e),o=Du(r,e.shrinkingClass),i=pE(e,t.element);yE(t,e);var u=pE(e,t.element);(o?function(){Ve(t.element,hE(e),i),Ye(t.element)}:function(){bE(t,e)})(),Au(r,e.shrinkingClass),Tu(r,e.growingClass),yE(t,e),Ve(t.element,hE(e),u),n.setExpanded(),e.onStartGrow(t)},kE=function(t,e,n){var r=gE(t,e);return!0===Du(r,e.growingClass)},OE=function(t,e,n){var r=gE(t,e);return!0===Du(r,e.shrinkingClass)},_E=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){Ke(t.element,hE(e));var r=pE(e,t.element);Ve(t.element,hE(e),r)}},grow:function(t,e,n){n.isExpanded()||SE(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&CE(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&wE(t,e,n)},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:kE,isShrinking:OE,isTransitioning:function(t,e,n){return kE(t,e)||OE(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?CE:SE)(t,e,n)},disableTransitions:vE}),TE=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return mu(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:ho(e.dimension.property,"0px")})},events:function(t,e){return Oi([Bi(Uo(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(vE(n,t),e.isExpanded()&&Ke(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),EE=[Hr("closedClass"),Hr("openClass"),Hr("shrinkingClass"),Hr("growingClass"),Xr("getAnimationRoot"),pa("onShrunk"),pa("onStartShrink"),pa("onGrown"),pa("onStartGrow"),eo("expanded",!1),Fr("dimension",Br("property",{width:[wa("property","width"),wa("getDimension",(function(t){return cn(t)+"px"}))],height:[wa("property","height"),wa("getDimension",(function(t){return Ze(t)+"px"}))]}))],AE=lc({fields:EE,name:"sliding",active:TE,apis:_E,state:Object.freeze({__proto__:null,init:function(t){var e=lo(t.expanded);return fu({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:w(e.set,!1),setExpanded:w(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),DE=[mf("slotBehaviours",[])],ME=function(t){return"<alloy.field."+t+">"},RE=function(t,e){var n,r=function(e){return id(t)},o=function(e,n){return function(r,o){return ed(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==Be(t.element,"aria-hidden")},u=o(i,!1),a=o((function(t,e){if(i(t)){var n=t.element;Ve(n,"display","none"),Ne(n,"aria-hidden","true"),wi(t,gi(),{name:e,visible:!1})}})),c=(n=a,function(t,e){W(e,(function(e){return n(t,e)}))}),s=o((function(t,e){if(!i(t)){var n=t.element;Ke(n,"display"),Le(n,"aria-hidden"),wi(t,gi(),{name:e,visible:!0})}})),l={getSlotNames:r,getSlot:function(e,n){return ed(e,t,n)},isShowing:u,hideSlot:a,hideAllSlots:function(t){return c(t,r())},showSlot:s};return{uid:t.uid,dom:t.dom,components:e,behaviours:gf(t.slotBehaviours),apis:l}},NE=mt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return su(t)})),zE=_(_({},NE),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),Yf("container",ME(e),n)},record:v(t)}}(),n=t(e),r=e.record(),o=U(r,(function(t){return Vf({name:t,pname:ME(t)})}));return fd("container",DE,o,RE,n)}}),BE=gr([Jr("icon"),Jr("tooltip"),ao("onShow",h),ao("onHide",h),ao("onSetup",(function(){return h}))]),PE=function(t){return{element:function(){return t.element.dom}}},IE=function(t,e){var n=U(lt(e),(function(t){var n=e[t],r=Rr(function(t){return Mr("sidebar",BE,t)}(n));return{name:t,getApi:PE,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return U(n,(function(e){var r=lo(h);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Nv([kb(e,r),Ob(e,r),Ei(gi(),(function(t,e){var r=e.event;K(n,(function(t){return t.name===r.name})).each((function(e){(r.visible?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},LE=function(t){return zE.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:IE(e,t),slotBehaviours:Nv([Pi((function(t){return zE.hideAllSlots(t)}))])}}))},HE=function(t){return wd.getCurrent(t).bind((function(t){return AE.isGrowing(t)||AE.hasGrown(t)?wd.getCurrent(t).bind((function(t){return K(zE.getSlotNames(t),(function(e){return zE.isShowing(t,e)}))})):z.none()}))},FE=Xi("FixSizeEvent"),VE=Xi("AutoSizeEvent"),jE=Object.freeze({__proto__:null,block:function(t,e,n,r){Ne(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=cc([Fg.config({mode:"special",onTab:function(){return z.some(!0)},onShiftTab:function(){return z.some(!0)}}),Jg.config({})]),u=r(o,i),a=o.getSystem().build(u);qg.append(o,qu(a)),a.hasConfigured(Fg)&&e.focus&&Fg.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return qg.remove(o,a)}))},unblock:function(t,e,n){Le(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),UE=[ao("getRoot",z.none),uo("focus",!0),pa("onBlock"),pa("onUnblock")],WE=lc({fields:UE,name:"blocking",apis:jE,state:Object.freeze({__proto__:null,init:function(){var t=Lc();return fu({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),qE=function(t){var e=zt.fromHtml(t),n=ve(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return X(e,(function(t,e){var n;return"class"===e.name?t:_(_({},t),((n={})[e.name]=e.value,n))}),{})}(e),o=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(e),i=0===n.length?{}:{innerHtml:Fi(e)};return _({tag:Pt(e),classes:o,attributes:r},i)},GE=function(t){return wd.getCurrent(t).each((function(t){return vc(t.element)}))},$E=function(t,e,n,r){var o=e.element;if(function(t,e){z.from(t.iframeElement).map(zt.fromDom).each((function(t){e?(Pe(t,"tabindex").each((function(e){return Ne(t,"data-mce-tabindex",e)})),Ne(t,"tabindex",-1)):(Le(t,"tabindex"),Pe(t,"data-mce-tabindex").each((function(e){Ne(t,"tabindex",e),Le(t,"data-mce-tabindex")})))}))}(t,n),n)WE.block(e,function(t){return function(e,n){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:qE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}}(r)),Ke(o,"display"),Le(o,"aria-hidden"),t.hasFocus()&&GE(e);else{var i=wd.getCurrent(e).exists((function(t){return bc(t.element)}));WE.unblock(e),Ve(o,"display","none"),Ne(o,"aria-hidden","true"),i&&t.focus()}},XE=function(t,e,n){var r=lo(!1),o=Fc(),i=function(n){var o;!r.get()||function(t){return"focusin"===t.type}(o=n)&&(o.composed?ut(o.composedPath()):z.from(o.target)).map(zt.fromDom).filter(Lt).exists((function(t){return Du(t,"mce-pastebin")}))||(n.preventDefault(),GE(e()),t.editorManager.setActive(t))};t.inline||t.on("PreInit",(function(){t.dom.bind(t.getWin(),"focusin",i),t.on("BeforeExecCommand",(function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&i(t)}))}));var u=function(o){o!==r.get()&&(r.set(o),$E(t,e(),o,n.providers),t.fire("AfterProgressState",{state:o}))};t.on("ProgressState",(function(e){if(o.on(Jh.clearTimeout),m(e.time)){var n=Jh.setEditorTimeout(t,(function(){return u(e.state)}),e.time);o.set(n)}else u(e.state),o.clear()}))},KE=function(t,e,n){return{within:t,extra:e,withinWidth:n}},YE=function(t,e,n){var r,o=(r=function(t,e){var r=n(t);return z.some({element:t,start:e,finish:e+r,width:r})},X(t,(function(t,e){return r(e,t.len).fold(v(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),{len:0,list:[]}).list),i=G(o,(function(t){return t.finish<=e})),u=$(i,(function(t,e){return t+e.width}),0);return{within:i,extra:o.slice(i.length),withinWidth:u}},JE=function(t){return U(t,(function(t){return t.element}))},QE=function(t,e,n,r){var o=function(t,e,n){var r=YE(e,t,n);return 0===r.extra.length?z.some(r):z.none()}(t,e,n).getOrThunk((function(){return YE(e,t-n(r),n)})),i=o.within,u=o.extra,a=o.withinWidth;return 1===u.length&&u[0].width<=n(r)?function(t,e,n){var r=JE(t.concat(e));return KE(r,[],n)}(i,u,a):u.length>=1?function(t,e,n,r){var o=JE(t).concat([n]);return KE(o,JE(e),r)}(i,u,r,a):function(t,e,n){return KE(JE(t),[],n)}(i,0,a)},ZE=function(t,e){var n=U(e,(function(t){return qu(t)}));AT.setGroups(t,n)},tA=function(t,e,n){var r=e.builtGroups.get();if(0!==r.length){var o=nd(t,e,"primary"),i=mx.getCoupled(t,"overflowGroup");Ve(o.element,"visibility","hidden");var u=r.concat([i]),a=st(u,(function(t){return wc(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}));n([]),ZE(o,u);var c=cn(o.element),s=QE(c,e.builtGroups.get(),(function(t){return cn(t.element)}),i);0===s.extra.length?(qg.remove(o,i),n([])):(ZE(o,s.within),n(s.extra)),Ke(o.element,"visibility"),Ye(o.element),a.each(Jg.focus)}},eA=v([mf("splitToolbarBehaviours",[mx]),Ir("builtGroups",(function(){return lo([])}))]),nA=v([ga(["overflowToggledClass"]),Qr("getOverflowBounds"),Hr("lazySink"),Ir("overflowGroups",(function(){return lo([])}))].concat(eA())),rA=v([Vf({factory:AT,schema:TT(),name:"primary"}),jf({schema:TT(),name:"overflow"}),jf({name:"overflow-button"}),jf({name:"overflow-group"})]),oA=v((function(t,e){!function(t,e){var n=an.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Ve(t,"max-width",n+"px")}(t,Math.floor(e))})),iA=v([ga(["toggledClass"]),Hr("lazySink"),Wr("fetch"),Qr("getBounds"),to("fireDismissalEventInstead",[eo("event",fi())]),ds()]),uA=v([jf({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:cc([sh.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),jf({factory:AT,schema:TT(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:cc([Fg.config({mode:"cyclic",onEscape:function(e){return ed(e,t,"button").each(Jg.focus),z.none()}})])}}})]),aA=function(t,e){var n=mx.getCoupled(t,"toolbarSandbox");ql.isOpen(n)?ql.close(n):ql.open(n,e.toolbar())},cA=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Sl.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:oA()}}},o)},sA=function(t,e,n,r,o){AT.setGroups(e,o),cA(t,e,n,r),sh.on(t)},lA=pd({name:"FloatingToolbarButton",factory:function(t,e,n,r){return _(_({},Qh.sketch(_(_({},r.button()),{action:function(t){aA(t,r)},buttonBehaviours:vf({dump:r.button().buttonBehaviours},[mx.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=ea();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:cc([Fg.config({mode:"special",onEscape:function(t){return ql.close(t),z.some(!0)}}),ql.config({onOpen:function(o,i){n.fetch().get((function(o){sA(t,i,n,e.layouts,o),r.link(t.element),Fg.focusIn(i)}))},onClose:function(){sh.off(t),Jg.focus(t),r.unlink(t.element)},isPartOf:function(e,n,r){return ra(n,r)||ra(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),gc.config({channels:_(_({},Yl(_({isExtraPart:S},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Ql({doReposition:function(){ql.getState(mx.getCoupled(t,"toolbarSandbox")).each((function(r){cA(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){ql.getState(mx.getCoupled(e,"toolbarSandbox")).each((function(o){sA(e,o,t,n.layouts,r)}))},reposition:function(e){ql.getState(mx.getCoupled(e,"toolbarSandbox")).each((function(r){cA(e,r,t,n.layouts)}))},toggle:function(t){aA(t,r)},getToolbar:function(t){return ql.getState(mx.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return ql.isOpen(mx.getCoupled(t,"toolbarSandbox"))}}})},configFields:iA(),partFields:uA(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),fA=v([Hr("items"),ga(["itemSelector"]),mf("tgroupBehaviours",[Fg])]),dA=v([Wf({name:"items",unit:"item"})]),mA=pd({name:"ToolbarGroup",configFields:fA(),partFields:dA(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:hf(t.tgroupBehaviours,[Fg.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),gA=function(t){return U(t,(function(t){return qu(t)}))},hA=function(t,e,n){tA(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){lA.setGroups(t,gA(r))}))}))},pA=pd({name:"SplitFloatingToolbar",configFields:nA(),partFields:rA(),factory:function(t,e,n,r){var o=Zh(lA.sketch({fetch:function(){return Zw((function(e){e(gA(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[Ua,ja]},onRtl:function(){return[ja,Ua]},onBottomLtr:function(){return[qa,Wa]},onBottomRtl:function(){return[Wa,qa]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:hf(t.splitToolbarBehaviours,[mx.config({others:{overflowGroup:function(){return mA.sketch(_(_({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(U(n,e.getSystem().build)),hA(e,o,t)},refresh:function(e){return hA(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){lA.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(lA.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){lA.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(lA.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),vA=v([ga(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),pa("onOpened"),pa("onClosed")].concat(eA())),bA=v([Vf({factory:AT,schema:TT(),name:"primary"}),Vf({factory:AT,schema:TT(),name:"overflow",overrides:function(t){return{toolbarBehaviours:cc([AE.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){ed(e,t,"overflow-button").each((function(t){sh.off(t),Jg.focus(t)})),t.onClosed(e)},onGrown:function(e){Fg.focusIn(e),t.onOpened(e)},onStartGrow:function(e){ed(e,t,"overflow-button").each(sh.on)}}),Fg.config({mode:"acyclic",onEscape:function(e){return ed(e,t,"overflow-button").each(Jg.focus),z.some(!0)}})])}}}),jf({name:"overflow-button",overrides:function(t){return{buttonBehaviours:cc([sh.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),jf({name:"overflow-group"})]),yA=function(t,e){ed(t,e,"overflow-button").bind((function(){return ed(t,e,"overflow")})).each((function(n){wA(t,e),AE.toggleGrow(n)}))},wA=function(t,e){ed(t,e,"overflow").each((function(n){tA(t,e,(function(t){var e=U(t,(function(t){return qu(t)}));AT.setGroups(n,e)})),ed(t,e,"overflow-button").each((function(t){AE.hasGrown(n)&&sh.on(t)})),AE.refresh(n)}))},xA=pd({name:"SplitSlidingToolbar",configFields:vA(),partFields:bA(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:hf(t.splitToolbarBehaviours,[mx.config({others:{overflowGroup:function(t){return mA.sketch(_(_({},r["overflow-group"]()),{items:[Qh.sketch(_(_({},r["overflow-button"]()),{action:function(e){yi(t,"alloy.toolbar.toggle")}}))]}))}}}),Gg("toolbar-toggle-events",[Ei("alloy.toolbar.toggle",(function(e){yA(e,t)}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=U(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),wA(e,t)},refresh:function(e){return wA(e,t)},toggle:function(e){return yA(e,t)},isOpen:function(e){return function(t,e){return ed(t,e,"overflow").map(AE.hasGrown).getOr(!1)}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),CA=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:_({tag:"div",classes:["tox-toolbar__group"]},e),components:[mA.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:cc([kw.config({}),Jg.config({})])}},SA=function(t){return mA.sketch(CA(t))},kA=function(t,e){var n=Pi((function(e){var n=U(t.initGroups,SA);AT.setGroups(e,n)}));return cc([Cb(t.providers.isDisabled),bb(),Fg.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Gg("toolbar-events",[n])])},OA=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":CA({title:z.none(),items:[]}),"overflow-button":sO({name:"more",icon:z.some("more-drawer"),disabled:!1,tooltip:z.some("More..."),primary:!1,borderless:!1},z.none(),t.providers)},splitToolbarBehaviours:kA(t,e)}},_A=function(t){var e=OA(t),n=pA.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return pA.sketch(_(_({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=Dn(e),r=me(e),o=Dn(r),i=Math.max(r.dom.scrollHeight,o.height);return En(n.x+4,o.y,n.width-8,i)},parts:_(_({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},TA=function(t){var e=xA.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=xA.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=OA(t);return xA.sketch(_(_({},r),{components:[e,n],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([tE()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([tE()],{type:"closed"})}}))},EA=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return AT.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===Kp.scrolling?["tox-toolbar--scrolling"]:[])},components:[AT.parts.groups({})],toolbarBehaviours:kA(t,e)})},AA=xT.optional({factory:mE,name:"menubar",schema:[Hr("backstage")]}),DA=xT.optional({factory:{sketch:function(t){return _T.sketch({uid:t.uid,dom:t.dom,listBehaviours:cc([Fg.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return EA({type:t.type,uid:Xi("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),z.some(!0)}})},setupItem:function(t,e,n,r){AT.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Hr("dom"),Hr("onEscape")]}),MA=xT.optional({factory:{sketch:function(t){return function(t){return t.type===Kp.sliding?TA:t.type===Kp.floating?_A:EA}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),z.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[Hr("dom"),Hr("onEscape"),Hr("getSink")]}),RA=xT.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?uE:RT;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:cc(n(e,t.sharedBackstage))}}},name:"header",schema:[Hr("dom")]}),NA=xT.optional({name:"socket",schema:[Hr("dom")]}),zA=xT.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:cc([kw.config({}),Jg.config({}),AE.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){wd.getCurrent(t).each(zE.hideAllSlots),yi(t,VE)},onGrown:function(t){yi(t,VE)},onStartGrow:function(t){wi(t,FE,{width:Ge(t.element,"width").getOr("")})},onStartShrink:function(t){wi(t,FE,{width:cn(t.element)+"px"})}}),qg.config({}),wd.config({find:function(t){var e=qg.contents(t);return ut(e)}})])}],behaviours:cc([BS(0),Gg("sidebar-sliding-events",[Ei(FE,(function(t,e){Ve(t.element,"width",e.event.width)})),Ei(VE,(function(t,e){Ke(t.element,"width")}))])])}}},name:"sidebar",schema:[Hr("dom")]}),BA=xT.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:cc([qg.config({}),WE.config({focus:!1}),wd.config({find:function(t){return ut(t.components())}})]),components:[]}}},name:"throbber",schema:[Hr("dom")]}),PA=pd({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return wT.getPart(e,t,"socket")},setSidebar:function(e,n){wT.getPart(e,t,"sidebar").each((function(t){return function(t,e){wd.getCurrent(t).each((function(t){return qg.set(t,[LE(e)])}))}(t,n)}))},toggleSidebar:function(e,n){wT.getPart(e,t,"sidebar").each((function(t){return function(t,e){wd.getCurrent(t).each((function(t){wd.getCurrent(t).each((function(n){AE.hasGrown(t)?zE.isShowing(n,e)?AE.shrink(t):(zE.hideAllSlots(n),zE.showSlot(n,e)):(zE.hideAllSlots(n),zE.showSlot(n,e),AE.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return wT.getPart(e,t,"sidebar").bind(HE).getOrNull()},getHeader:function(e){return wT.getPart(e,t,"header")},getToolbar:function(e){return wT.getPart(e,t,"toolbar")},setToolbar:function(e,n){wT.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){wT.getPart(e,t,"multiple-toolbar").each((function(t){_T.setItems(t,n)}))},refreshToolbar:function(e){wT.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){wT.getPart(e,t,"toolbar").each((function(t){var e,n;e=t.getApis().toggle,n=function(e){return e(t)},null!=e?z.some(n(e)):z.none()}))},isToolbarDrawerToggled:function(e){return wT.getPart(e,t,"toolbar").bind((function(t){return z.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return wT.getPart(e,t,"throbber")},focusToolbar:function(e){wT.getPart(e,t,"toolbar").orThunk((function(){return wT.getPart(e,t,"multiple-toolbar")})).each((function(t){Fg.focusIn(t)}))},setMenubar:function(e,n){wT.getPart(e,t,"menubar").each((function(t){mE.setMenus(t,n)}))},focusMenubar:function(e){wT.getPart(e,t,"menubar").each((function(t){mE.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[Hr("dom"),Hr("behaviours")],partFields:[RA,AA,MA,DA,NA,zA,BA],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=U(n,(function(t){return SA(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=U(n,(function(t){return U(t,SA)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),IA={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},LA=function(t){return"string"==typeof t?t.split(" "):t},HA=function(t,e){var n=_(_({},IA),e.menus),r=lt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?LA("file edit view insert format tools table help"):LA(!1===e.menubar?"":e.menubar),i=G(o,(function(t){var n=wt(IA,t);return r?n||yt(e.menus,t).exists((function(t){return wt(t,"items")})):n})),u=U(i,(function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return Q(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length?[]:F(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:LA(o.items)},e,t)}));return G(u,(function(t){return t.getItems().length>0&&F(t.getItems(),(function(t){return"separator"!==t.type}))}))},FA=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},VA=function(t,e,n){return new kp((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},jA=function(t,e){return VA(t,e+"/skin.min.css",t.ui.styleSheetLoader)},UA=function(t,e){var n;return(n=zt.fromDom(t.getElement()),_e(n).isSome())?VA(t,e+"/skin.shadowdom.min.css",jv.DOM.styleSheetLoader):kp.resolve()},WA=function(t,e){var n=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):Uv.baseURL+"/skins/ui/"+r}return n}(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===function(t){return!1===t.getParam("skin")}(e)&&o(n)?kp.all([jA(e,n),UA(e,n)]).then(FA(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:e})}}(e,"Skin could not be loaded")):FA(e)()},qA=w(WA,!1),GA=w(WA,!0),$A=function(t,e){return function(n){var r=Hc(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.once("init",o),function(){t.off("init",o),r.clear()}}},XA=function(t,e,n){return function(r){var o=function(){return n(r)},i=function(){n(r),t.on(e,o)};return t.initialized?i():t.once("init",i),function(){t.off("init",i),t.off(e,o)}}},KA=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},YA=function(t,e){return function(){return t.execCommand(e)}},JA=function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return z.some({type:"separator",text:a});if("submenu"===t.type){var c=Q(t.getStyleItems(),(function(t){return o(t,r,u)}));return 0===r&&c.length<=0?z.none():z.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return Q(t.getStyleItems(),(function(t){return o(t,r,u)}))}})}return z.some(_({type:"togglemenuitem",text:a,icon:t.icon,active:t.isSelected(u),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return Q(t,(function(t){return o(t,r,e)}))};return{validateItems:i,getFetch:function(t,e){return function(n,r){var o=e(),u=i(o);r(oO(u,Yp.CLOSE_ON_EXECUTE,t,!1))}}}},QA=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return U(r.data,(function(t){return U_(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:JA(0,e,n),getStyleItems:o}},ZA=function(t,e,n){var r=QA(0,e,n),o=r.items,i=r.getStyleItems,u=XA(t,"NodeChange",(function(t){var e=t.getComponent();n.updateText(e)}));return Qk({text:n.icon.isSome()?z.none():n.text,icon:n.icon,tooltip:z.from(n.tooltip),role:z.none(),fetch:o.getFetch(e,i),onSetup:u,getApi:function(t){return{getComponent:v(t)}},columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(VO||(VO={}));var tD,eD,nD,rD=function(t,e,n,r){return{type:"basic",data:function(t){return U(t,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}}))}(function(t,e){return e===VO.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r))}},oD=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],iD=function(t){var e={type:"basic",data:oD};return{tooltip:"Align",text:z.none(),icon:z.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:z.none,getPreviewFor:function(t){return z.none},onAction:function(e){return function(){return K(oD,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},updateText:function(e){var n=K(oD,(function(e){return t.formatter.match(e.format)})).fold(v("left"),(function(t){return t.title.toLowerCase()}));wi(e,Jk,{icon:"align-"+n})},dataset:e,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},uD=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],aD=function(t){var e=t.split(/\s*,\s*/);return U(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},cD=function(t){var e=function(){var e=function(t){return t?aD(t)[0]:""},r=t.queryCommandValue("FontName"),o=n.data,i=r?r.toLowerCase():"";return{matchOpt:K(o,(function(t){var n=t.format;return n.toLowerCase()===i||e(n).toLowerCase()===e(i).toLowerCase()})).orThunk((function(){return Ot(function(t){var e;return 0===t.indexOf("-apple-system")&&(e=aD(t.toLowerCase()),Z(uD,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(i),{title:"System Font",format:i})})),font:r}},n=rD(t,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",VO.SemiColon);return{tooltip:"Fonts",text:z.some("System Font"),icon:z.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getCurrentValue:function(){return e().matchOpt},getPreviewFor:function(t){return function(){return z.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},updateText:function(t){var n=e(),r=n.matchOpt,o=n.font,i=r.fold(v(o),(function(t){return t.title}));wi(t,Yk,{text:i})},dataset:n,shouldHide:!1,isInvalid:S}},sD={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},lD={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},fD=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":yt(lD,t).getOr(t)},dD=function(t){var e=function(){var e=z.none(),n=r.data,o=t.queryCommandValue("FontSize");if(o)for(var i=function(t){var r=fD(o,t),i=function(t){return yt(sD,t).getOr("")}(r);e=K(n,(function(t){return t.format===o||t.format===r||t.format===i}))},u=3;e.isNone()&&u>=0;u--)i(u);return{matchOpt:e,size:o}},n=v(z.none),r=rD(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",VO.Space);return{tooltip:"Font sizes",text:z.some("12pt"),icon:z.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},updateText:function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold(v(o),(function(t){return t.title}));wi(t,Yk,{text:i})},dataset:r,shouldHide:!1,isInvalid:S}},mD=function(t,e){var n=e(),r=U(n,(function(t){return t.format}));return z.from(t.formatter.closest(r)).bind((function(t){return K(n,(function(e){return e.format===t}))})).orThunk((function(){return Ot(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},gD=function(t){var e=rD(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",VO.SemiColon);return{tooltip:"Blocks",text:z.some("Paragraph"),icon:z.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:z.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return z.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:KA(t),updateText:function(n){var r=mD(t,(function(){return e.data})).fold(v("Paragraph"),(function(t){return t.title}));wi(n,Yk,{text:r})},dataset:e,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},hD=function(t,e){return{tooltip:"Formats",text:z.some("Paragraph"),icon:z.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:z.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?z.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):z.none()}},onAction:KA(t),updateText:function(e){var n=function(t){var e=t.items;return void 0!==e&&e.length>0?Q(e,n):[{title:t.title,format:t.format}]},r=Q(j_(t),n),o=mD(t,v(r)).fold(v("Paragraph"),(function(t){return t.title}));wi(e,Yk,{text:o})},shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},pD=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=U(o,n.getSystem().build);Tl(n,i)}))};return Oi([Ei(Jo(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;H(o.channels,i)&&n(e,o.data)}})),Pi((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),vD=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),bD=[Hr("channel"),Xr("renderComponents"),Xr("updateState"),Xr("initialData")],yD=Object.freeze({__proto__:null,init:function(){var t=lo(z.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(z.none())}}}}),wD=lc({fields:bD,name:"reflecting",active:pD,apis:vD,state:yD}),xD=v([Hr("toggleClass"),Hr("fetch"),ba("onExecute"),eo("getHotspot",z.some),eo("getAnchorOverrides",v({})),ds(),ba("onItemExecute"),Xr("lazySink"),Hr("dom"),pa("onOpen"),mf("splitDropdownBehaviours",[mx,Fg,Jg]),eo("matchWidth",!1),eo("useMinWidth",!1),eo("eventOrder",{}),Xr("role")].concat(Ex())),CD=Vf({factory:Qh,schema:[Hr("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:cc([Jg.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(xi)},buttonBehaviours:cc([sh.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),SD=Vf({factory:Qh,schema:[Hr("dom")],name:"button",defaults:function(){return{buttonBehaviours:cc([Jg.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),kD=v([CD,SD,Uf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Hr("text")],name:"aria-descriptor"}),jf({schema:[ma()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),hx()]),OD=pd({name:"SplitDropdown",configFields:xD(),partFields:kD(),factory:function(t,e,n,r){var o,i=function(t){wd.getCurrent(t).each((function(t){qd.highlightFirst(t),Fg.focusIn(t)}))},u=function(e){Cx(t,b,e,r,i,$w.HighlightFirst).get(h)},a=function(e){var n=nd(e,t,"button");return xi(n),z.some(!0)},c=_(_({},Oi([Pi((function(e,n){ed(e,t,"aria-descriptor").each((function(t){var n=Xi("aria");Ne(t.element,"id",n),Ne(e.element,"aria-describedby",n)}))}))])),fh(z.some(u))),s={repositionMenus:function(t){sh.isOn(t)&&Tx(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:s,eventOrder:_(_({},t.eventOrder),(o={},o[Qo()]=["disabling","toggling","alloy.base.behaviour"],o)),events:c,behaviours:hf(t.splitDropdownBehaviours,[mx.config({others:{sandbox:function(e){var n=nd(e,t,"arrow");return _x(t,e,{onOpen:function(){sh.on(n),sh.on(e)},onClose:function(){sh.off(n),sh.off(e)}})}}}),Fg.config({mode:"special",onSpace:a,onEnter:a,onDown:function(t){return u(t),z.some(!0)}}),Jg.config({}),sh.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),_D=function(t){return{isDisabled:function(){return zd.isDisabled(t)},setDisabled:function(e){return zd.set(t,e)}}},TD=function(t){return{setActive:function(e){sh.set(t,e)},isActive:function(){return sh.isOn(t)},isDisabled:function(){return zd.isDisabled(t)},setDisabled:function(e){return zd.set(t,e)}}},ED=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},AD=Xi("focus-button"),DD=function(t,e,n,r,o,i){var u;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:ED(n,i)},components:Eb([t.map((function(t){return qk(t,i.icons)})),e.map((function(t){return $k(t,"tox-tbtn",i)}))]),eventOrder:(u={},u[Do()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:cc([Cb(i.isDisabled),bb(),Gg("common-button-display-events",[Ei(Do(),(function(t,e){e.event.prevent(),yi(t,AD)}))])].concat(r.map((function(n){return wD.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return Eb([t.icon.map((function(t){return qk(t,i.icons)})),t.text.map((function(t){return $k(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},MD=function(t,e,n){var r,o=lo(h),i=DD(t.icon,t.text,t.tooltip,z.none(),z.none(),n);return Qh.sketch({dom:i.dom,components:i.components,eventOrder:Kk,buttonBehaviours:cc([Gg("toolbar-button-events",[(r={onAction:t.onAction,getApi:e.getApi},Hi((function(t,e){Sb(r,t)((function(e){wi(t,Xk,{buttonApi:e}),r.onAction(e)}))}))),kb(e,o),Ob(e,o)]),Cb((function(){return t.disabled||n.isDisabled()})),bb()].concat(e.toolbarButtonBehaviours))})},RD=function(t,e,n){return MD(t,{toolbarButtonBehaviours:[].concat(n.length>0?[Gg("toolbarButtonWith",n)]:[]),getApi:_D,onSetup:t.onSetup},e)},ND=function(t,e,n){return Jn(MD(t,{toolbarButtonBehaviours:[qg.config({}),sh.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[Gg("toolbarToggleButtonWith",n)]:[]),getApi:TD,onSetup:t.onSetup},e))},zD=function(t,e,n){return function(r){return Zw((function(t){return e.fetch(t)})).map((function(o){return z.from(ew(Jn(By(Xi("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,Yp.CLOSE_ON_EXECUTE,e.select.getOr(S),n),{movement:Iy(e.columns,e.presets),menuBehaviours:Nv("auto"!==e.columns?[]:[Pi((function(t,n){Mv(t,4,ev(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;Fg.setGridSize(t,n,r)}))}))])})))}))}},BD=[{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"]}],PD=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return zr(t)})).getOrDie();return e(i,r,o)}},ID={button:PD(Pp,(function(t,e){return n=t,r=e.backstage.shared.providers,RD(n,r,[]);var n,r})),togglebutton:PD(Hp,(function(t,e){return n=t,r=e.backstage.shared.providers,ND(n,r,[]);var n,r})),menubutton:PD(fE,(function(t,e){return uO(t,"tox-tbtn",e.backstage,z.none())})),splitbutton:PD((function(t){return Mr("SplitButton",dE,t)}),(function(t,e){return function(t,e){var n,r=Xi("channel-update-split-dropdown-display"),o=function(t){return{isDisabled:function(){return zd.isDisabled(t)},setDisabled:function(e){return zd.set(t,e)},setIconFill:function(e,n){Zu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){Ne(t,"fill",n)}))},setIconStroke:function(e,n){Zu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){Ne(t,"stroke",n)}))},setActive:function(e){Ne(t.element,"aria-pressed",e),Zu(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return sh.set(t,e)}))}))},isActive:function(){return Zu(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(sh.isOn)}))}}},i=lo(h),u={getApi:o,onSetup:t.onSetup};return OD.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:_({"aria-pressed":!1},ED(t.tooltip,e.providers))},onExecute:function(e){t.onAction(o(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:cc([xb(e.providers.isDisabled),bb(),Gg("split-dropdown-events",[Ei(AD,Jg.focus),kb(u,i),Ob(u,i)]),Nx.config({})]),eventOrder:(n={},n[si()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:zD(o,t,e.providers),parts:{menu:av(0,t.columns,t.presets)},components:[OD.parts.button(DD(t.icon,t.text,z.none(),z.some(r),z.some([sh.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),OD.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:ip("chevron-down",e.providers.icons)},buttonBehaviours:cc([xb(e.providers.isDisabled),bb(),up()])}),OD.parts["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})}(t,e.backstage.shared)})),grouptoolbarbutton:PD((function(t){return Mr("GroupToolbarButton",cE,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[ls]=e.backstage.shared.header.isPositionedAtTop()?Dc.TopToBottom:Dc.BottomToTop,r);switch(eb(n)){case Kp.floating:return function(t,e,n,r){var o=e.shared;return lA.sketch({lazySink:o.getSink,fetch:function(){return Zw((function(e){e(U(n(t.items),SA))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:DD(t.icon,t.text,t.tooltip,z.none(),z.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return VD(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,z.none())}),i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return function(t,e){var n=_({type:"advanced"},e.styleselect);return ZA(t,e,hD(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return ZA(t,e,dD(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return ZA(t,e,cD(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return ZA(t,e,gD(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return ZA(t,e,iD(t))}(t,e.backstage)}},LD={styleselect:ID.styleSelectButton,fontsizeselect:ID.fontsizeSelectButton,fontselect:ID.fontSelectButton,formatselect:ID.formatButton,align:ID.alignMenuButton},HD=function(t){var e,n=t.toolbar,r=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=U(BD,(function(e){var n=G(e.items,(function(e){return wt(t,e)||wt(LD,e)}));return{name:e.name,items:n}}));return G(e,(function(t){return t.items.length>0}))}(r):o(n)?(e=n.split("|"),U(e,(function(t){return{items:t.trim().split(" ")}}))):function(t){return g(t,(function(t){return wt(t,"name")&&wt(t,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},FD=function(t,e,n,r,o,i){return yt(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return st(t,(function(t){return yt(e,t+n.toLowerCase())}))}))})).fold((function(){return yt(LD,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return z.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return yt(ID,t.type).fold((function(){return console.error("skipping button defined by",t),z.none()}),(function(r){return z.some(r(t,e,n))}))}(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),z.none())}))},VD=function(t,e,n,r){var o=HD(e),i=U(o,(function(o){var i=Q(o.items,(function(o){return 0===o.trim().length?[]:FD(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:z.from(t.translate(o.name)),items:i}}));return G(i,(function(t){return t.items.length>0}))},jD=function(t,e,n,r){var i=e.outerContainer,u=n.toolbar,a=n.buttons;if(g(u,o)){var c=u.map((function(e){var o={toolbar:e,buttons:a,allowToolbarGroups:n.allowToolbarGroups};return VD(t,o,{backstage:r},z.none())}));PA.setToolbars(i,c)}else PA.setToolbar(i,VD(t,n,{backstage:r},z.none()))},UD=ie(),WD=UD.os.isiOS()&&UD.os.version.major<=12,qD=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=lo(0),u=e.outerContainer;qA(t);var c=zt.fromDom(o.targetNode),s=Oe(ke(c));!function(t,e){zl(t,e,gn)}(c,e.mothership),Nl(s,e.uiMothership),t.on("PostRender",(function(){jD(t,e,n,r),i.set(t.getWin().innerWidth),PA.setMenubar(u,HA(t,n)),PA.setSidebar(u,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=lo(nn(r.innerWidth,r.innerHeight)),u=lo(nn(o.offsetWidth,o.offsetHeight)),a=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(nn(r.innerWidth,r.innerHeight)),my(t))},c=function(){var e=t.getDoc().documentElement,n=u.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(u.set(nn(e.offsetWidth,e.offsetHeight)),my(t))},s=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};n.bind(r,"resize",a),n.bind(r,"scroll",s);var l=Uc(zt.fromDom(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){Ve(f,"display","none")})),t.on("show",(function(){Ke(f,"display")})),t.on("NodeChange",c),t.on("remove",(function(){l.unbind(),n.unbind(r,"resize",a),n.unbind(r,"scroll",s),r=null}))}(t,e)}));var l,f,d,m=PA.getSocket(u).getOrDie("Could not find expected socket element");if(WD){je(m.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var g=(l=function(){t.fire("ScrollContent")},f=20,d=null,{cancel:function(){a(d)||(clearTimeout(d),d=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a(d)&&(d=setTimeout((function(){d=null,l.apply(null,t)}),f))}}),h=jc(m.element,"scroll",g.throttle);t.on("remove",h.unbind)}vb(t,e),t.addCommand("ToggleSidebar",(function(e,n){PA.toggleSidebar(u,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return PA.whichSidebar(u)}));var p=eb(t);p!==Kp.sliding&&p!==Kp.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var n=t.getWin().innerWidth;n!==i.get()&&(PA.refreshToolbar(e.outerContainer),i.set(n))}));var v={enable:function(){pb(e,!1)},disable:function(){pb(e,!0)},isDisabled:function(){return zd.isDisabled(u)}};return{iframeContainer:m.element.dom,editorContainer:u.element.dom,api:v}}}),GD=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?z.some(parseInt(""+t,10)):z.none()},$D=function(t){return m(t)?t+"px":t},XD=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},KD=function(t){return function(t){var e=Wv(t),n=$v(t),r=Kv(t);return GD(e).map((function(t){return XD(t,n,r)}))}(t).getOr(Wv(t))},YD=function(t){var e=qv(t),n=Gv(t),r=Xv(t);return GD(e).map((function(t){return XD(t,n,r)}))},JD=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=jv.DOM,c=ab(t),s=lb(t),l=Xv(t).or(YD(t)),f=r.shared.header,d=f.isPositionedAtTop,m=eb(t),g=m===Kp.sliding||m===Kp.floating,h=lo(!1),p=function(){return h.get()&&!t.removed},b=function(t){return g?t.fold(v(0),(function(t){return t.components().length>1?Ze(t.components()[1].element):0})):0},y=function(){i.broadcastOn([$l()],{})},w=function(t){if(void 0===t&&(t=!1),p()){var n;if(c||(n=l.getOrThunk((function(){var t=GD(We(De(),"margin-left")).getOr(0);return cn(De())-on(e).left+t})),Ve(o.get().element,"max-width",n+"px")),g&&PA.refreshToolbar(u),c||function(){var t=PA.getToolbar(u),n=b(t),r=An(e),i=d()?Math.max(r.y-Ze(o.get().element)+n,0):r.bottom;je(u.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),s){var r=o.get();t?ZT.reset(r):ZT.refresh(r)}y()}},x=function(n){if(void 0===n&&(n=!0),!c&&s&&p()){var r=f.getDockingMode(),i=function(n){switch(ob(t)){case tb.auto:var r=PA.getToolbar(u),o=b(r),i=Ze(n.element)-o,a=An(e);if(a.y>i)return"top";var c=me(e),s=Math.max(c.dom.scrollHeight,Ze(c));return a.bottom<s-i?"bottom":Mn().bottom<a.bottom-i?"bottom":"top";case tb.bottom:return"bottom";case tb.top:default:return"top"}}(o.get());i!==r&&(!function(t){var e=o.get();ZT.setModes(e,[t]),f.setDockingMode(t);var n=d()?Dc.TopToBottom:Dc.BottomToTop;Ne(e.element,ls,n)}(i),n&&w(!0))}};return{isVisible:p,isPositionedAtTop:d,show:function(){h.set(!0),Ve(u.element,"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),Ke(i.element,"display"),x(!1),w()},hide:function(){h.set(!1),n.outerContainer&&(Ve(u.element,"display","none"),a.removeClass(t.getBody(),"mce-edit-focus")),Ve(i.element,"display","none")},update:w,updateMode:x,repositionPopups:y}},QD=function(t,e){var n=An(t);return{pos:e?n.y:n.bottom,bounds:n}},ZD=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=lo(null),s=zt.fromDom(o.targetNode),l=JD(t,s,e,r,c),f=function(t){return t.getParam("toolbar_persist",!1,"boolean")}(t);GA(t);var d=function(){if(c.get())l.show();else{c.set(PA.getHeader(a).getOrDie());var o=cb(t);Nl(o,i),Nl(o,u),jD(t,e,n,r),PA.setMenubar(a,HA(t,n)),l.show(),function(t,e,n,r){var o=lo(QD(e,n.isPositionedAtTop())),i=function(r){var i=QD(e,n.isPositionedAtTop()),u=i.pos,a=i.bounds,c=o.get(),s=c.pos,l=c.bounds,f=a.height!==l.height||a.width!==l.width;o.set({pos:u,bounds:a}),f&&my(t,r),n.isVisible()&&(s!==u?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};r||(t.on("activate",n.show),t.on("deactivate",n.hide)),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){Jh.requestAnimationFrame((function(){return i(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var u=Hc();u.set(Uc(zt.fromDom(t.getBody()),"load",i)),t.on("remove",(function(){u.clear()}))}(t,s,l,f),t.nodeChanged()}};t.on("show",d),t.on("hide",l.hide),f||(t.on("focus",d),t.on("blur",l.hide)),t.on("init",(function(){(t.hasFocus()||f)&&d()})),vb(t,e);var m={show:function(){l.show()},hide:function(){l.hide()},enable:function(){pb(e,!1)},disable:function(){pb(e,!0)},isDisabled:function(){return zd.isDisabled(a)}};return{editorContainer:a.element.dom,api:m}}}),tM=function(t,e){return Ei(Xk,(function(n,r){var o=function(t){return{hide:function(){return yi(t,ni())},getValue:function(){return df.getValue(t)}}}(t.get(n));e.onAction(o,r.event.buttonApi)}))},eM=function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original;r.primary;var o=T(r,["primary"]),i=Rr(Hp(_(_({},o),{type:"togglebutton",onAction:h})));return ND(i,n.backstage.shared.providers,[tM(t,e)])}(t,e,r):function(t,e,n){var r=e.original;r.primary;var o=T(r,["primary"]),i=Rr(Pp(_(_({},o),{type:"button",onAction:h})));return RD(i,n.backstage.shared.providers,[tM(t,e)])}(t,e,r)},nM=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=Zh(Ww.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:cc([Fg.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return xi(t),!0}))},onLeft:function(t,e){return e.cut(),z.none()},onRight:function(t,e){return e.cut(),z.none()}})])})),o=function(t,e,n){var r=U(e,(function(e){return Zh(eM(t,e,n))}));return{asSpecs:function(){return U(r,(function(t){return t.asSpec()}))},findPrimary:function(t){return st(e,(function(e,n){return e.primary?z.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(x(zd.isDisabled)):z.none()}))}}}(r,t.commands,e);return[{title:z.none(),items:[r.asSpec()]},{title:z.none(),items:o.asSpecs()}]},rM=nM,oM=function(t,e,n){return void 0===n&&(n=.01),e.bottom-t.y>=n&&t.bottom-e.y>=n},iM=function(t){var e=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=we(zt.fromDom(t.startContainer),t.startOffset).element;return(Ht(n)?he(n):z.some(n)).filter(Lt).map((function(t){return t.dom.getBoundingClientRect()})).getOr(e)}return e}(t.selection.getRng());if(t.inline){var n=xn();return En(n.left+e.left,n.top+e.top,e.width,e.height)}var r=Dn(zt.fromDom(t.getBody()));return En(r.x+e.left,r.y+e.top,e.width,e.height)},uM=function(t,e,n,r){void 0===r&&(r=0);var o=kn(window),i=An(zt.fromDom(t.getContentAreaContainer())),u=Yv(t)||Jv(t)||Zv(t),a=function(t,e,n){var r=Math.max(t.x+n,e.x);return{x:r,width:Math.min(t.right-n,e.right)-r}}(i,o,r),c=a.x,s=a.width;if(t.inline&&!u)return En(c,o.y,s,o.height);var l=function(t,e,n,r,o,i){var u=zt.fromDom(t.getContainer()),a=Zu(u,".tox-editor-header").getOr(u),c=An(a),s=c.y>=e.bottom,l=r&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(t.inline&&!l)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var f="line"===o?An(u):e;return l?{y:Math.max(c.bottom+i,n.y),bottom:Math.min(f.bottom-i,n.bottom)}:{y:Math.max(f.y+i,n.y),bottom:Math.min(c.y-i,n.bottom)}}(t,i,o,e.header.isPositionedAtTop(),n,r),f=l.y,d=l.bottom;return En(c,f,s,d-f)},aM={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},cM={maxHeightFunction:es(),maxWidthFunction:oA()},sM=function(t){return"node"===t},lM=function(t,e,n,r,o){var i=iM(t),u=r.lastElement().exists((function(t){return ce(n,t)}));return function(t,e){var n=t.selection.getRng(),r=we(zt.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&ce(r.element,e)}(t,n)?u?Xh:Uh:u?function(t,e,n){var r=Ge(t,"position");Ve(t,"position",e);var o=n(t);return r.each((function(e){return Ve(t,"position",e)})),o}(e,r.getMode(),(function(){return oM(i,An(e))&&!r.isReposition()?Yh:Xh})):("fixed"===r.getMode()?o.y+xn().top:o.y)+(Ze(e)+12)<=i.y?Uh:Wh},fM=function(t,e,n,r){var o=function(e){return function(r,o,i,u,a){var c=lM(t,u,e,n,a),s=_(_({},r),{y:a.y,height:a.height});return _(_({},c(s,o,i,u,a)),{alwaysFit:!0})}},i=function(t){return sM(r)?[o(t)]:[]};return e?{onLtr:function(t){return[$a,ja,Ua,Wa,qa,Ga].concat(i(t))},onRtl:function(t){return[$a,Ua,ja,qa,Wa,Ga].concat(i(t))}}:{onLtr:function(t){return[Ga,$a,Wa,ja,qa,Ua].concat(i(t))},onRtl:function(t){return[Ga,$a,qa,Ua,Wa,ja].concat(i(t))}}},dM=function(t,e){var n=G(e,(function(e){return e.predicate(t.dom)})),r=q(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},mM=function(t,e,n){var r=dM(t,e);if(r.contextForms.length>0)return z.some({elem:t,toolbars:[r.contextForms[0]]});var o=dM(t,n);if(o.contextForms.length>0)return z.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return F(t,(function(t){return t.position===e}))},n=function(e){return G(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),u=U(n("selection"),(function(t){return _(_({},t),{position:"node"})}));return i.concat(u)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return z.some({elem:t,toolbars:i})}return z.none()},gM=function(t,e,n){return t(e)?z.none():yo(e,(function(t){if(Lt(t)){var e=dM(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return K(t,(function(t){return t.position===e}))};return e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position})).fold((function(){return[]}),(function(e){return G(t,(function(t){return t.position===e}))}))}(r);return i.length>0?z.some({elem:t,toolbars:i}):z.none()}return z.none()}),t)},hM=function(t,e){var n={},r=[],o=[],i={},u={},a=function(t,a){var c=Rr(Mr("ContextForm",Gp,a));n[t]=c,c.launch.map((function(n){i["form:"+t]=_(_({},a.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),u[t]=c},c=function(t,e){var n;(n=e,Mr("ContextToolbar",$p,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n}))},s=lt(t);return W(s,(function(e){var n=t[e];"contextform"===n.type?a(e,n):"contexttoolbar"===n.type&&c(e,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:u,formNavigators:i}},pM=Xi("forward-slide"),vM=Xi("backward-slide"),bM=Xi("change-slide-event"),yM=function(t,e,n,r){var o,i,u=r.backstage,a=u.shared,c=ie().deviceType.isTouch,s=Fc(),l=Fc(),f=Fc(),d=Wu((o={sink:n,onEscape:function(){return t.focus(),z.some(!0)}},i=lo([]),Rh.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),Rh.getContent(t).each((function(t){Ke(t.element,"visibility")})),Au(t.element,"tox-pop--resizing"),Ke(t.element,"width")},inlineBehaviours:cc([Gg("context-toolbar-events",[Bi(Uo(),(function(t,e){"width"===e.event.raw.propertyName&&(Au(t.element,"tox-pop--resizing"),Ke(t.element,"width"))})),Ei(bM,(function(t,e){var n=t.element;Ke(n,"width");var r=cn(n);Rh.setContent(t,e.event.contents),Tu(n,"tox-pop--resizing");var o=cn(n);Ve(n,"width",r+"px"),Rh.getContent(t).each((function(t){e.event.focus.bind((function(t){return vc(t),wc(n)})).orThunk((function(){return Fg.focusIn(t),yc(ke(n))}))})),Jh.setTimeout((function(){Ve(t.element,"width",o+"px")}),0)})),Ei(pM,(function(t,e){Rh.getContent(t).each((function(e){i.set(i.get().concat([{bar:e,focus:yc(ke(t.element))}]))})),wi(t,bM,{contents:e.event.forwardContents,focus:z.none()})})),Ei(vM,(function(t,e){at(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),wi(t,bM,{contents:qu(e.bar),focus:e.focus})}))}))]),Fg.config({mode:"special",onEscape:function(t){return at(i.get()).fold((function(){return o.onEscape()}),(function(e){return yi(t,vM),z.some(!0)}))}})]),lazySink:function(){return zn.value(o.sink)}}))),m=function(){var e=f.get().getOr("node"),n=sM(e)?1:0;return uM(t,a,e,n)},g=function(){return!(t.removed||c()&&u.isContextMenuOpen())},p=function(){if(g()){var e=m(),n=Ct(f.get(),"node")?function(t,e){return e.filter(Ae).map(Dn).getOrThunk((function(){return iM(t)}))}(t,s.get()):iM(t);return e.height<=0||!oM(n,e)}return!0},v=function(){s.clear(),l.clear(),f.clear(),Rh.hide(d)},b=function(){if(Rh.isOpen(d)){var t=d.element;Ke(t,"display"),p()?Ve(t,"display","none"):(l.set(0),Rh.reposition(d))}},y=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:cc([Fg.config({mode:"acyclic"}),Gg("pop-dialog-wrap-events",[Pi((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return Fg.focusIn(e)}))})),Ii((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},w=jt((function(){return hM(e,(function(t){var e=x([t]);wi(d,pM,{forwardContents:y(e)})}))})),x=function(e){var n=t.ui.registry.getAll().buttons,o=w(),i=_(_({},n),o.formNavigators),u=eb(t)===Kp.scrolling?Kp.scrolling:Kp.default,c=J(U(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return VD(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,z.some(["form:"]))}(i,e):function(t,e){return rM(t,e)}(e,a.providers)})));return EA({type:u,uid:Xi("context-toolbar"),initGroups:c,onEscape:z.none,cyclicKeying:!0,providers:a.providers})},C=function(e,r){var o="node"===e?a.anchors.node(r):a.anchors.cursor(),i=function(t,e,n,r){return"line"===e?{bubble:is(12,0,aM),layouts:{onLtr:function(){return[Xa]},onRtl:function(){return[Ka]}},overrides:cM}:{bubble:is(0,12,aM,1/12),layouts:fM(t,n,r,e),overrides:cM}}(t,e,c(),{lastElement:s.get,isReposition:function(){return Ct(l.get(),0)},getMode:function(){return Sl.getMode(n)}});return Jn(o,i)},S=function(t,e){if(k.cancel(),g()){var r=x(t),o=t[0].position,i=C(o,e);f.set(o),l.set(1);var u=d.element;Ke(u,"display"),function(t){return Ct(kt(t,s.get(),ce),!0)}(e)||(Au(u,"tox-pop--transition"),Sl.reset(n,d)),Rh.showWithinBounds(d,y(r),{anchor:i,transition:{classes:["tox-pop--transition"],mode:"placement"}},(function(){return z.some(m())})),e.fold(s.clear,s.set),p()&&Ve(u,"display","none")}},k=mp((function(){t.hasFocus()&&!t.removed&&(Du(d.element,"tox-pop--transition")?k.throttle():function(t,e){var n=zt.fromDom(e.getBody()),r=function(t){return ce(t,n)},o=zt.fromDom(e.selection.getNode());return function(t){return!r(t)&&!le(n,t)}(o)?z.none():mM(o,t.inNodeScope,t.inEditorScope).orThunk((function(){return gM(r,o,t)}))}(w(),t).fold(v,(function(t){S(t.toolbars,z.some(t.elem))})))}),17);t.on("init",(function(){t.on("remove",v),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",b),t.on("click keyup focus SetContent",k.throttle),t.on("contexttoolbar-hide",v),t.on("contexttoolbar-show",(function(e){var n=w();yt(n.lookupTable,e.toolbarKey).each((function(n){S([n],Ot(e.target!==t,e.target)),Rh.getContent(d).each(Fg.focusIn)}))})),t.on("focusout",(function(e){Jh.setEditorTimeout(t,(function(){wc(n.element).isNone()&&wc(d.element).isNone()&&v()}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&v()})),t.on("AfterProgressState",(function(e){e.state?v():t.hasFocus()&&k.throttle()})),t.on("NodeChange",(function(t){wc(d.element).fold(k.throttle,h)}))}))},wM={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},xM=(eD=["Infinity","[0-9]+\\."+(tD=function(t){return"(?:"+t+")?"})("[0-9]+")+tD("[eE][+-]?[0-9]+"),"\\.[0-9]+"+tD("[eE][+-]?[0-9]+"),"[0-9]+"+tD("[eE][+-]?[0-9]+")].join("|"),new RegExp("^([+-]?(?:"+eD+"))(.*)$")),CM=function(t,e){return z.from(xM.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return F(e,(function(e){return F(wM[e],(function(e){return t===e}))}))}(r,e)?z.some({value:n,unit:r}):z.none()}))},SM=function(t,e){var n=function(){var n=e.getOptions(t),r=e.getCurrent(t).map(e.hash),o=Fc();return U(n,(function(n){return{type:"togglemenuitem",text:e.display(n),onSetup:function(i){var u=function(t){t&&(o.on((function(t){return t.setActive(!1)})),o.set(i)),i.setActive(t)};u(Ct(r,e.hash(n)));var a=e.watcher(t,n,u);return function(){o.clear(),a()}},onAction:function(){return e.setCurrent(t,n)}}}))};t.ui.registry.addMenuButton(e.name,{tooltip:e.text,icon:e.icon,fetch:function(t){return t(n())},onSetup:e.onToolbarSetup}),t.ui.registry.addNestedMenuItem(e.name,{type:"nestedmenuitem",text:e.text,getSubmenuItems:n,onSetup:e.onMenuSetup})},kM={name:"lineheight",text:"Line height",icon:"line-height",getOptions:function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},hash:function(t){return function(t,e){return CM(t,e).map((function(t){return t.value+t.unit}))}(t,["fixed","relative","empty"]).getOr(t)},display:b,watcher:function(t,e,n){return t.formatter.formatChanged("lineheight",n,!1,{value:e}).unbind},getCurrent:function(t){return z.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},OM=function(t){SM(t,kM),function(t){return z.from(function(t){return t.getParam("content_langs",void 0,"array")}(t)).map((function(e){return{name:"language",text:"Language",icon:"language",getOptions:v(e),hash:function(t){return s(t.customCode)?t.code:t.code+"/"+t.customCode},display:function(t){return t.title},watcher:function(t,e,n){return t.formatter.formatChanged("lang",n,!1,{value:e.code,customValue:e.customCode}).unbind},getCurrent:function(t){var e=zt.fromDom(t.selection.getNode());return wo(e,(function(t){return z.some(t).filter(Lt).bind((function(t){return Pe(t,"lang").map((function(e){return{code:e,customCode:Pe(t,"data-mce-lang").getOrUndefined(),title:""}}))}))}))},setCurrent:function(t,e){return t.execCommand("Lang",!1,e)},onToolbarSetup:function(e){var n=Hc();return e.setActive(t.formatter.match("lang",{},void 0,!0)),n.set(t.formatter.formatChanged("lang",e.setActive,!0)),n.clear}}}))}(t).each((function(e){return SM(t,e)}))},_M=function(t,e){!function(t,e){var n=QA(0,e,iD(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=QA(0,e,cD(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=_({type:"advanced"},e.styleselect),r=QA(0,e,hD(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=QA(0,e,gD(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=QA(0,e,dD(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)},TM=function(t){return XA(t,"NodeChange",(function(e){e.setDisabled(!t.queryCommandState("outdent"))}))},EM=function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:TM(t),onAction:YA(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:YA(t,"indent")})}(t)},AM=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},DM=function(t){!function(t){HS.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:$A(t,e.name),onAction:AM(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:$A(t,n),onAction:AM(t,n)})}}(t),function(t){HS.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:YA(t,e.action)})}))}(t),function(t){HS.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:YA(t,e.action),onSetup:$A(t,e.name)})}))}(t)},MM=function(t){DM(t),function(t){HS.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:YA(t,e.action)})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:AM(t,"code")})}(t)},RM=function(t,e){return XA(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(t.mode.isReadOnly()||!t.undoManager[e]())}))},NM=function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:RM(t,"hasUndo"),onAction:YA(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:RM(t,"hasRedo"),onAction:YA(t,"redo")})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:RM(t,"hasUndo"),onAction:YA(t,"undo")}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:RM(t,"hasRedo"),onAction:YA(t,"redo")})}(t)},zM=function(t){return XA(t,"VisualAid",(function(e){e.setActive(t.hasVisual)}))},BM=function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:YA(t,"mceToggleVisualAid")})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:zM(t),onAction:YA(t,"mceToggleVisualAid")})}(t)},PM=function(t,e){!function(t){W([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:YA(t,e.cmd),onSetup:$A(t,e.name)})})),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:YA(t,"JustifyNone")})}(t),MM(t),_M(t,e),NM(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",(function(e,n){!function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))}(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){!function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))}(t,e)}))}(t);var e=lo("#000000"),n=lo("#000000");Ry(t,"forecolor","forecolor","Text color",e),Ry(t,"backcolor","hilitecolor","Background color",n),Ny(t,"forecolor","forecolor","Text color"),Ny(t,"backcolor","hilitecolor","Background color")}(t),BM(t),EM(t),OM(t)},IM=function(t,e){return{type:"makeshift",x:t,y:e}},LM=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},HM=function(t,e){var n=jv.DOM.getPos(t);return function(t,e,n){return IM(t.x+e,t.y+n)}(e,n.x,n.y)},FM=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(LM(t)){var e=t.touches[0];return IM(e.pageX,e.pageY)}return IM(t.pageX,t.pageY)}(e):HM(t.getContentAreaContainer(),function(t){if(LM(t)){var e=t.touches[0];return IM(e.clientX,e.clientY)}return IM(t.clientX,t.clientY)}(e)):VM(t)},VM=function(t){return{type:"selection",root:zt.fromDom(t.selection.getNode())}},jM=function(t,e,n){switch(n){case"node":return function(t){return{type:"node",node:z.some(zt.fromDom(t.selection.getNode())),root:zt.fromDom(t.getBody())}}(t);case"point":return FM(t,e);case"selection":return VM(t)}},UM=function(t,e,n,r,o,i){var u=n(),a=jM(t,e,i);oO(u,Yp.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),Rh.showMenuAt(o,{anchor:a},{menu:{markers:ov("normal")},data:t})}))},WM={onLtr:function(){return[$a,ja,Ua,Wa,qa,Ga,Uh,Wh,jh,Fh,Vh,Hh]},onRtl:function(){return[$a,Ua,ja,qa,Wa,Ga,Uh,Wh,Vh,Hh,jh,Fh]}},qM={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"]},GM=function(t,e,n,r,o,i,u){var a=function(t,e,n){var r=jM(t,e,n);return _({bubble:is(0,"point"===n?12:0,qM),layouts:WM,overrides:{maxWidthFunction:oA(),maxHeightFunction:es()}},r)}(t,e,i);oO(n,Yp.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),Rh.showMenuWithinBounds(o,{anchor:a},{menu:{markers:ov("normal"),highlightImmediately:u},data:n,type:"horizontal"},(function(){return z.some(uM(t,r.shared,"node"===i?"node":"selection"))})),t.fire("contexttoolbar-hide")}))},$M=function(t,e,n,r,o,i){var u=ie(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),l=u.deviceType.isTouch(),f=function(){var u=n();GM(t,e,u,r,o,i,!(s||a||c&&l))};if((c||a)&&"node"!==i){var d=function(){!function(t){var e=t.selection.getRng(),n=function(){Jh.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),f()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return Ys(t.getWin(),Ms.domRange(o)).exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))}(t,e)?(t.once("selectionchange",d),t.once("touchend",(function(){return t.off("selectionchange",d)}))):d()}else f()},XM=function(t){return"string"==typeof t?t.split(/[ ,]/):t},KM=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},YM=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return z.from(t.getParam(e)).map(XM).getOrThunk((function(){return G(XM(n),(function(t){return wt(r,t)}))}))}(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},JM=function(t){return o(t)?"|"===t:"separator"===t.type},QM={type:"separator"},ZM=function(t){var e,n=function(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}};if(o(t))return t;switch(t.type){case"separator":return QM;case"submenu":return _(_({type:"nestedmenuitem"},n(t)),{getSubmenuItems:function(){var e=t.getSubmenuItems();return o(e)?e:U(e,ZM)}});default:return _(_({type:"menuitem"},n(t)),{onAction:(e=t.onAction,function(){return e()})})}},tR=function(t,e){if(0===e.length)return t;var n=at(t).filter((function(t){return!JM(t)})).fold((function(){return[]}),(function(t){return[QM]}));return t.concat(n).concat(e).concat([QM])},eR=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},nR=function(t,e){return eR(t,e)?t.selection.getStart(!0):e.target},rR=function(t,e,n){var r=ie().deviceType.isTouch,i=Wu(Rh.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:cc([Gg("dismissContextMenu",[Ei(fi(),(function(e,n){ql.close(e),t.focus()}))])])})),u=function(t){return Rh.hide(i)},a=function(e){if(KM(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!KM(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var u=function(t,e){var n=function(t){return t.getParam("contextmenu_avoid_overlap","","string")}(t),r=eR(t,e)?"selection":"point";if(Mt(n)){var o=nR(t,e);return rw(zt.fromDom(o),n)?"node":r}return r}(t,e);(r()?$M:UM)(t,e,(function(){var n=nR(t,e),r=t.ui.registry.getAll(),i=YM(t);return function(t,e,n){var r=X(e,(function(e,r){return yt(t,r.toLowerCase()).map((function(t){var r=t.update(n);if(o(r))return tR(e,r.split(" "));if(r.length>0){var i=U(r,ZM);return tR(e,i)}return e})).getOrThunk((function(){return e.concat([r])}))}),[]);return r.length>0&&JM(r[r.length-1])&&r.pop(),r}(r.contextMenus,i,n)}),n,i,u)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");t.on(e,u),t.on("longpress contextmenu",a)}))},oR=fo([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),iR=function(t){return function(e){return e.translate(-t.left,-t.top)}},uR=function(t){return function(e){return e.translate(t.left,t.top)}},aR=function(t){return function(e,n){return X(t,(function(t,e){return e(t)}),nn(e,n))}},cR=function(t,e,n){return t.fold(aR([uR(n),iR(e)]),aR([iR(e)]),aR([]))},sR=function(t,e,n){return t.fold(aR([uR(n)]),aR([]),aR([uR(e)]))},lR=function(t,e,n){return t.fold(aR([]),aR([iR(n)]),aR([uR(e),iR(n)]))},fR=function(t,e,n){var r=t.fold((function(t,e){return{position:z.some("absolute"),left:z.some(t+"px"),top:z.some(e+"px")}}),(function(t,e){return{position:z.some("absolute"),left:z.some(t-n.left+"px"),top:z.some(e-n.top+"px")}}),(function(t,e){return{position:z.some("fixed"),left:z.some(t+"px"),top:z.some(e+"px")}}));return _({right:z.none(),bottom:z.none()},r)},dR=function(t,e,n,r){var o=function(t,o){return function(i,u){var a=t(e,n,r);return o(i.getOr(a.left),u.getOr(a.top))}};return t.fold(o(lR,mR),o(sR,gR),o(cR,hR))},mR=oR.offset,gR=oR.absolute,hR=oR.fixed,pR=function(t,e){var n=Be(t,e);return s(n)?NaN:parseInt(n,10)},vR=function(t,e,n,r){return function(t,e){var n=t.element,r=pR(n,e.leftAttr),o=pR(n,e.topAttr);return isNaN(r)||isNaN(o)?z.none():z.some(nn(r,o))}(t,e).fold((function(){return n}),(function(t){return hR(t.left+r.left,t.top+r.top)}))},bR=function(t,e,n,r,o,i){var u=vR(t,e,n,r),a=e.mustSnap?xR(t,e,u,o,i):CR(t,e,u,o,i),c=cR(u,o,i);return function(t,e,n){var r=t.element;Ne(r,e.leftAttr,n.left+"px"),Ne(r,e.topAttr,n.top+"px")}(t,e,c),a.fold((function(){return{coord:hR(c.left,c.top),extra:z.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},yR=function(t,e){!function(t,e){var n=t.element;Le(n,e.leftAttr),Le(n,e.topAttr)}(t,e)},wR=function(t,e,n,r){return st(t,(function(t){var o=t.sensor;return function(t,e,n,r,o,i){var u=sR(t,o,i),a=sR(e,o,i);return Math.abs(u.left-a.left)<=n&&Math.abs(u.top-a.top)<=r}(e,o,t.range.left,t.range.top,n,r)?z.some({output:dR(t.output,e,n,r),extra:t.extra}):z.none()}))},xR=function(t,e,n,r,o){var i=e.getSnapPoints(t);return wR(i,n,r,o).orThunk((function(){return X(i,(function(t,e){var i=e.sensor,u=function(t,e,n,r,o,i){var u=sR(t,o,i),a=sR(e,o,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return nn(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:z.some(u),snap:z.some(e)}}),(function(n){return(u.left+u.top)/2<=(n.left+n.top)/2?{deltas:z.some(u),snap:z.some(e)}:t}))}),{deltas:z.none(),snap:z.none()}).snap.map((function(t){return{output:dR(t.output,n,r,o),extra:t.extra}}))}))},CR=function(t,e,n,r,o){var i=e.getSnapPoints(t);return wR(i,n,r,o)},SR=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=fe(t.element),u=xn(i),a=BT(o),c=function(t,e,n){return{coord:dR(t.output,t.output,e,n),extra:t.extra}}(r,u,a),s=fR(c.coord,0,a);Ue(o,s)}}}),kR=function(t,e){t.getSystem().addToGui(e),function(t){he(t.element).filter(Lt).each((function(e){Ge(e,"z-index").each((function(t){Ne(e,"data-initial-z-index",t)})),Ve(e,"z-index",We(t.element,"z-index"))}))}(e)},OR=function(t){!function(t){he(t.element).filter(Lt).each((function(t){Pe(t,"data-initial-z-index").fold((function(){return Ke(t,"z-index")}),(function(e){return Ve(t,"z-index",e)})),Le(t,"data-initial-z-index")}))}(t),t.getSystem().removeFromGui(t)},_R=function(t,e,n){return t.getSystem().build(vw.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},TR=to("snaps",[Hr("getSnapPoints"),pa("onSensor"),Hr("leftAttr"),Hr("topAttr"),eo("lazyViewport",Mn),eo("mustSnap",!1)]),ER=[eo("useFixed",S),Hr("blockerClass"),eo("getTarget",b),eo("onDrag",h),eo("repositionTarget",!0),eo("onDrop",h),ao("getBounds",Mn),TR],AR=function(t){return(e=Ge(t,"left"),n=Ge(t,"top"),r=Ge(t,"position"),o=function(t,e,n){return("fixed"===n?hR:mR)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?z.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):z.none()).getOrThunk((function(){var e=on(t);return gR(e.left,e.top)}));var e,n,r,o},DR=function(t,e,n,r,o,i,u){return function(t,e,n,r,o){var i=o.bounds,u=sR(e,n,r),a=za(u.left,i.x,i.x+i.width-o.width),c=za(u.top,i.y,i.y+i.height-o.height),s=gR(a,c);return e.fold((function(){var t=lR(s,n,r);return mR(t.left,t.top)}),v(s),(function(){var t=cR(s,n,r);return hR(t.left,t.top)}))}(0,e.fold((function(){var t,e,u,a=(t=n,e=i.left,u=i.top,t.fold((function(t,n){return mR(t+e,n+u)}),(function(t,n){return gR(t+e,n+u)}),(function(t,n){return hR(t+e,n+u)}))),c=cR(a,r,o);return hR(c.left,c.top)}),(function(e){var u=bR(t,e,n,i,r,o);return u.extra.each((function(n){e.onSensor(t,n)})),u.coord})),r,o,u)},MR=function(t,e){return{bounds:t.getBounds(),height:tn(e.element),width:sn(e.element)}},RR=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk((function(){return MR(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=fe(t.element),u=xn(i),a=BT(o),c=AR(o),s=DR(t,e.snaps,c,u,a,r,n),l=fR(s,0,a);Ue(o,l)}e.onDrag(t,o,r)}(t,e,u,n)}))},NR=function(t,e,n,r){e.each(OR),n.snaps.each((function(e){yR(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},zR=function(t){return function(e,n){var r=function(t){n.setStartData(MR(e,t))};return Oi(E([Ei(ai(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r),!0))}},BR=Object.freeze({__proto__:null,getData:function(t){return z.from(nn(t.x,t.y))},getDelta:function(t,e){return nn(e.left-t.left,e.top-t.top)}}),PR=function(t,e,n){return[Ei(Do(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return NR(r,z.some(c),t,e)},u=ow(i,200),a={drop:i,delayDrop:u.schedule,forceDrop:i,move:function(n){u.cancel(),RR(r,t,e,BR,n)}},c=_R(r,t.blockerClass,function(t){return Oi([Ei(Do(),t.forceDrop),Ei(No(),t.drop),Ei(Mo(),(function(e,n){t.move(n.event)})),Ei(Ro(),t.delayDrop)])}(a));n(r),kR(r,c)}}))]},IR=E(E([],ER,!0),[wa("dragger",{handlers:zR(PR)})],!1),LR=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return z.some(nn(e.clientX,e.clientY))}(e):z.none()},getDelta:function(t,e){return nn(e.left-t.left,e.top-t.top)}}),HR=function(t,e,n){var r=Fc(),o=function(n){NR(n,r.get(),t,e),r.clear()};return[Ei(_o(),(function(i,u){u.stop();var a=function(){return o(i)},c={drop:a,delayDrop:h,forceDrop:a,move:function(n){RR(i,t,e,LR,n)}},s=_R(i,t.blockerClass,function(t){return Oi([Ei(_o(),t.forceDrop),Ei(Eo(),t.drop),Ei(Ao(),t.drop),Ei(To(),(function(e,n){t.move(n.event)}))])}(c));r.set(s);n(i),kR(i,s)})),Ei(To(),(function(n,r){r.stop(),RR(n,t,e,LR,r.event)})),Ei(Eo(),(function(t,e){e.stop(),o(t)})),Ei(Ao(),o)]},FR=IR,VR=E(E([],ER,!0),[wa("dragger",{handlers:zR(HR)})],!1),jR=E(E([],ER,!0),[wa("dragger",{handlers:zR((function(t,e,n){return E(E([],PR(t,e,n),!0),HR(t,e,n),!0)}))})],!1),UR=dc({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:FR,touch:VR,mouseOrTouch:jR}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:z.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=z.none(),e=z.none(),n=v({});return fu({readState:n,reset:function(){t=z.none(),e=z.none()},update:function(e,n){return e.getData(n).bind((function(n){return function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=z.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=z.some(t)}})}}),apis:SR}),WR=function(t,e,n,r,o,i){return t.fold((function(){return UR.snap({sensor:gR(n-20,r-20),range:nn(o,i),output:gR(z.some(n),z.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,u=t.element.dom.getBoundingClientRect();return UR.snap({sensor:gR(o,i),range:nn(40,40),output:gR(z.some(n-u.width/2),z.some(r-u.height/2)),extra:{td:e}})}))},qR=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists((function(t){return ce(t,e)}))})(e.get(),o)||(e.set(o),n(o))},mustSnap:!0}},GR=function(t){return Zh(Qh.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:cc([UR.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),Nx.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},$R=function(t,e){var n=lo([]),r=lo([]),o=lo(!1),i=Fc(),u=Fc(),a=function(t){var n=Dn(t);return WR(f.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=Dn(t);return WR(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=qR((function(){return U(n.get(),(function(t){return a(t)}))}),i,(function(e){u.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),l=qR((function(){return U(r.get(),(function(t){return c(t)}))}),u,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),f=GR(s),d=GR(l),m=Wu(f.asSpec()),g=Wu(d.asSpec()),h=function(e,n,r,o){var i=r(n);UR.snapTo(e,i);!function(e,n,r,o){var i=n.dom.getBoundingClientRect();Ke(e.element,"display");var u=ge(zt.fromDom(t.getBody())).dom.innerHeight,a=r(i),c=o(i,u);(a||c)&&Ve(e.element,"display","none")}(e,n,(function(t){return t[o]<0}),(function(t,e){return t[o]>e}))},p=function(t){return h(m,t,a,"top")},v=function(t){return h(g,t,c,"bottom")};ie().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(El(e,m),El(e,g),o.set(!0)),i.set(t.start),u.set(t.finish),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),p(t.start),v(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(p),u.get().each(v)})),t.on("TableSelectionClear",(function(){o.get()&&(Ml(m),Ml(g),o.set(!1)),i.clear(),u.clear()})))},XR=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},KR=function(t,e,n){e.delimiter||(e.delimiter="»");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:cc([Fg.config({mode:"flow",selector:"div[role=button]"}),zd.config({disabled:n.isDisabled}),bb(),kw.config({}),qg.config({}),Gg("elementPathEvents",[Pi((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return Fg.focusIn(r)})),t.on("NodeChange",(function(o){var i,u,a=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!XR(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);a.length>0?qg.set(r,(i=U(a||[],(function(e,r){return Qh.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:cc([wb(n.isDisabled),bb()])})})),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},X(i.slice(1),(function(t,e){var n=t;return n.push(u),n.push(e),n}),[i[0]]))):qg.set(r,[])}))}))])]),components:[]}};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(nD||(nD={}));var YR=function(t,e,n){var r=zt.fromDom(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=XD(r+e.top,$v(t),Kv(t)),n===nD.Both&&(i.width=XD(o+e.left,Gv(t),Xv(t))),i}(t,e,n,Ze(r),cn(r));dt(o,(function(t,e){return Ve(r,e,$D(t))})),function(t){t.fire("ResizeEditor")}(t)},JR=function(t,e,n,r){var o=nn(20*n,20*r);return YR(t,o,e),z.some(!0)},QR=function(t,e){var n=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?nD.None:"both"===n?nD.Both:nD.Vertical}(t);return n===nD.None?z.none():z.some(cp("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize")},behaviours:[UR.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){return YR(t,o,n)},blockerClass:"tox-blocker"}),Fg.config({mode:"special",onLeft:function(){return JR(t,n,-1,0)},onRight:function(){return JR(t,n,1,0)},onUp:function(){return JR(t,n,0,-1)},onDown:function(){return JR(t,n,0,1)}}),kw.config({}),Jg.config({})]},e.icons))},ZR=function(t,e){var n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(KR(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return qg.set(t,[Vu(e.translate(["{0} "+r,n[r]]))])};return Qh.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:cc([wb(e.isDisabled),bb(),kw.config({}),qg.config({}),df.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Gg("wordcount-events",[Hi((function(t){var e=df.getValue(t),n="words"===e.mode?"characters":"words";df.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),Pi((function(e){t.on("wordCountUpdate",(function(t){var n=df.getValue(e).mode;df.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[Qo()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce&amp;utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=tp.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var r=n(),o=QR(t,e);return r.concat(o.toArray())}()}},tN=function(t){var e,n,r,o,i=t.inline,u=i?ZD:qD,a=lb(t)?aE:NT,c=z.none(),s=ie(),l=s.browser.isIE()?["tox-platform-ie"]:[],f=s.deviceType.isTouch()?["tox-platform-touch"]:[],d=ib(t),m=cb(t),g=tp.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[ls]=d?Dc.BottomToTop:Dc.TopToBottom,e)},v=function(){return c.bind(PA.getHeader)},b=function(){Ve(G.element,"width",document.body.clientWidth+"px")},y=Wu((n=ce(De(),m)&&"grid"===We(m,"display"),r={dom:_({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(f)},g),behaviours:cc([Sl.config({useFixed:function(){return a.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:Oi([Ei(ci(),b)])},Jn(r,n?o:{}))),w=function(){return zn.value(y)},x=Zh({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind((function(t){return PA.getThrobber(t)})).getOrDie("Could not find throbber element")},S=yT(y,t,(function(){return c.bind((function(t){return x.getOpt(t)})).getOrDie("Could not find a anchor bar element")})),k=PA.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){t.focus()}}),O=eb(t),T=PA.parts.toolbar(_({dom:{tag:"div",classes:["tox-toolbar"]},getSink:w,providers:S.shared.providers,onEscape:function(){t.focus()},type:O,lazyToolbar:function(){return c.bind((function(t){return PA.getToolbar(t)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),E=PA.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.shared.providers,onEscape:function(){t.focus()},type:O}),A=PA.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),D=PA.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),M=PA.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),R=t.getParam("statusbar",!0,"boolean")&&!i?z.some(ZR(t,S.shared.providers)):z.none(),N={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[A,D]},B=Zv(t),P=Jv(t),I=Yv(t),L=PA.parts.header({dom:_({tag:"div",classes:["tox-editor-header"]},p),components:J([I?[k]:[],B?[E]:P?[T]:[],ab(t)?[]:[x.asSpec()]]),sticky:lb(t),editor:t,sharedBackstage:S.shared}),H=J([d?[]:[L],i?[]:[N],d?[L]:[]]),F=J([[{dom:{tag:"div",classes:["tox-editor-container"]},components:H}],i?[]:R.toArray(),[M]]),V=sb(t),j=_(_({role:"application"},tp.isRtl()?{dir:"rtl"}:{}),V?{"aria-hidden":"true"}:{}),U=Wu(PA.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(f).concat(l),styles:_({visibility:"hidden"},V?{opacity:"0",border:"0"}:{}),attributes:j},components:F,behaviours:cc([bb(),zd.config({disableClass:"tox-tinymce--disabled"}),Fg.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])}));c=z.some(U),t.shortcuts.add("alt+F9","focus menubar",(function(){PA.focusMenubar(U)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){PA.focusToolbar(U)})),t.addCommand("ToggleToolbarDrawer",(function(){PA.toggleToolbarDrawer(U)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return PA.isToolbarDrawerToggled(U)}));var q=bw(U),G=bw(y);!function(t,e,n){var r=function(t,r){W([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){W([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(Gl(),{target:t.target})},u=pc(),a=jc(u,"touchstart",i),c=jc(u,"touchmove",(function(t){return r(ii(),t)})),s=jc(u,"touchend",(function(t){return r(ui(),t)})),l=jc(u,"mousedown",i),f=jc(u,"mouseup",(function(t){0===t.raw.button&&o(Xl(),{target:t.target})})),d=function(t){return o(Gl(),{target:zt.fromDom(t.target)})},m=function(t){0===t.button&&o(Xl(),{target:zt.fromDom(t.target)})},g=function(){W(t.editorManager.get(),(function(e){t!==e&&e.fire("DismissPopups",{relatedTarget:t})}))},h=function(t){return r(ai(),Wc(t))},p=function(t){o($l(),{}),r(ci(),Wc(t))},v=function(){return o($l(),{})},b=function(e){e.state&&o(Gl(),{target:zt.fromDom(t.getContainer())})},y=function(t){o(Gl(),{target:zt.fromDom(t.relatedTarget.getContainer())})};t.on("PostRender",(function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("mousedown",g),t.on("ScrollWindow",h),t.on("ResizeWindow",p),t.on("ResizeEditor",v),t.on("AfterProgressState",b),t.on("DismissPopups",y)})),t.on("remove",(function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("mousedown",g),t.off("ScrollWindow",h),t.off("ResizeWindow",p),t.off("ResizeEditor",v),t.off("AfterProgressState",b),t.off("DismissPopups",y),l.unbind(),a.unbind(),c.unbind(),s.unbind(),f.unbind()})),t.on("detach",(function(){Bl(e),Bl(n),e.destroy(),n.destroy()}))}(t,q,G);var $=function(){var e=$D(KD(t)),n=$D(function(t){return YD(t).getOr(qv(t))}(t));return t.inline||(Xe("div","width",n)&&Ve(U.element,"width",n),Xe("div","height",e)?Ve(U.element,"height",e):Ve(U.element,"height","200px")),e};return{mothership:q,uiMothership:G,backstage:S,renderUI:function(){a.setup(t,S.shared,v),PM(t,S),rR(t,w,S),function(t){var e=t.ui.registry.getAll().sidebars;W(lt(e),(function(n){var r=e[n],o=function(){return Ct(z.from(t.queryCommandValue("ToggleSidebar")),n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))}(t),XE(t,C,S.shared),mt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,o=e.contextToolbars,i=e.sidebars,c=Qv(t),s={menuItems:r,menus:fb(t),menubar:db(t),toolbar:c.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:O===Kp.floating,buttons:n,sidebar:i};yM(t,o,y,{backstage:S}),$R(t,y);var l=t.getElement(),f=$(),d={mothership:q,uiMothership:G,outerContainer:U},m={targetNode:l,height:f};return u.render(t,d,s,S,m)},getUi:function(){return{channels:{broadcastAll:G.broadcast,broadcastOn:G.broadcastOn,register:h}}}}},eN=v([Hr("lazySink"),Xr("dragBlockClass"),ao("getBounds",Mn),eo("useTabstopAt",k),eo("eventOrder",{}),mf("modalBehaviours",[Fg]),va("onExecute"),ya("onEscape")]),nN={sketch:b},rN=v([Uf({name:"draghandle",overrides:function(t,e){return{behaviours:cc([UR.config({mode:"mouse",getTarget:function(t){return Ju(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),Vf({schema:[Hr("dom")],name:"title"}),Vf({factory:nN,schema:[Hr("dom")],name:"close"}),Vf({factory:nN,schema:[Hr("dom")],name:"body"}),Uf({factory:nN,schema:[Hr("dom")],name:"footer"}),jf({factory:{sketch:function(t,e){return _(_({},t),{dom:e.dom,components:e.components})}},schema:[eo("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),eo("components",[])],name:"blocker"})]),oN=pd({name:"ModalDialog",configFields:eN(),partFields:rN(),factory:function(t,e,n,r){var o,i=Fc(),u=Xi("modal-events"),a=_(_({},t.eventOrder),((o={})[si()]=[u].concat(t.eventOrder["alloy.system.attached"]||[]),o));return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){i.set(e);var n=t.lazySink(e).getOrDie(),o=r.blocker(),u=n.getSystem().build(_(_({},o),{components:o.components.concat([qu(e)]),behaviours:cc([Jg.config({}),Gg("dialog-blocker-events",[Bi(Bo(),(function(){Fg.focusIn(e)}))])])}));El(n,u),Fg.focusIn(e)},hide:function(t){i.clear(),he(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){Ml(t)}))}))},getBody:function(e){return nd(e,t,"body")},getFooter:function(e){return nd(e,t,"footer")},setIdle:function(t){WE.unblock(t)},setBusy:function(t,e){WE.block(t,e)}},eventOrder:a,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:hf(t.modalBehaviours,[qg.config({}),Fg.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),WE.config({getRoot:i.get}),Gg(u,[Pi((function(e){var n,r,o,i,u,a;n=e.element,r=nd(e,t,"title").element,o=Pe(n,"id").fold((function(){var t=Xi("dialog-label");return Ne(r,"id",t),t}),b),Ne(n,"aria-labelledby",o),i=e.element,u=nd(e,t,"body").element,a=z.from(Be(i,"id")).fold((function(){var t=Xi("dialog-describe");return Ne(u,"id",t),t}),b),Ne(i,"aria-describedby",a)}))])])}},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)}}}),iN=gr([jr("type"),jr("name")].concat(xv)),uN=Sr,aN=[Pr("name","name",Zn((function(){return Xi("button-name")})),Cr),Jr("icon"),io("align","end",["start","end"]),uo("primary",!1),uo("disabled",!1)],cN=E(E([],aN,!0),[jr("text")],!1),sN=E([Ur("type",["submit","cancel","custom"])],cN,!0),lN=E([Ur("type",["menu"]),Jr("text"),Jr("tooltip"),Jr("icon"),$r("items",iN)],aN,!0),fN=Br("type",{submit:sN,cancel:sN,custom:sN,menu:lN}),dN=[jr("type"),jr("text"),Ur("level",["info","warn","error","success"]),jr("icon"),eo("url","")],mN=gr(dN),gN=[jr("type"),jr("text"),uo("disabled",!1),uo("primary",!1),Pr("name","name",Zn((function(){return Xi("button-name")})),Cr),Jr("icon"),uo("borderless",!1)],hN=gr(gN),pN=[jr("type"),jr("name"),jr("label"),uo("disabled",!1)],vN=gr(pN),bN=Sr,yN=[jr("type"),jr("name")],wN=yN.concat([Jr("label")]),xN=wN.concat([eo("columns","auto")]),CN=gr(xN),SN=br([jr("value"),jr("text"),jr("icon")]),kN=gr(wN),ON=Cr,_N=gr(wN),TN=Cr,EN=yN.concat([oo("tag","textarea"),jr("scriptId"),jr("scriptUrl"),function(t,e){return no(t,e,_r)}("settings",void 0)]),AN=yN.concat([oo("tag","textarea"),Wr("init")]),DN=Ar((function(t){return Mr("customeditor.old",mr(AN),t).orThunk((function(){return Mr("customeditor.new",mr(EN),t)}))})),MN=Cr,RN=gr(wN),NN=hr(ar),zN=function(t){return[jr("type"),Vr("columns"),t]},BN=[jr("type"),jr("html"),io("presets","presentation",["presentation","document"])],PN=gr(BN),IN=wN.concat([uo("sandboxed",!0)]),LN=gr(IN),HN=Cr,FN=wN.concat([Fr("currentState",gr([Hr("blob"),jr("url")]))]),VN=gr(FN),jN=wN.concat([Jr("inputMode"),Jr("placeholder"),uo("maximized",!1),uo("disabled",!1)]),UN=gr(jN),WN=Cr,qN=function(t){return[jr("type"),jr("label"),t]},GN=[jr("text"),jr("value")],$N=[jr("text"),$r("items",function(t,e){return n=jt(e),{extract:function(t,e){return n().extract(t,e)},toString:function(){return n().toString()}};var n}(0,(function(){return XN})))],XN=pr([gr(GN),gr($N)]),KN=wN.concat([$r("items",XN),uo("disabled",!1)]),YN=gr(KN),JN=Cr,QN=wN.concat([Gr("items",[jr("text"),jr("value")]),ro("size",1),uo("disabled",!1)]),ZN=gr(QN),tz=Cr,ez=wN.concat([uo("constrain",!0),uo("disabled",!1)]),nz=gr(ez),rz=gr([jr("width"),jr("height")]),oz=[jr("type"),$r("header",Cr),$r("cells",hr(Cr))],iz=gr(oz),uz=wN.concat([Jr("placeholder"),uo("maximized",!1),uo("disabled",!1)]),az=gr(uz),cz=Cr,sz=wN.concat([io("filetype","file",["image","media","file"]),eo("disabled",!1)]),lz=gr(sz),fz=gr([jr("value"),eo("meta",{})]),dz=function(t){return Pr("items","items",{tag:"required",process:{}},hr(Ar((function(e){return Mr("Checking item of "+t,mz,e).fold((function(t){return zn.error(zr(t))}),(function(t){return zn.value(t)}))}))))},mz=fr((function(){return Er("type",{alertbanner:mN,bar:gr((t=dz("bar"),[jr("type"),t])),button:hN,checkbox:vN,colorinput:kN,colorpicker:_N,dropzone:RN,grid:gr(zN(dz("grid"))),iframe:LN,input:UN,listbox:YN,selectbox:ZN,sizeinput:nz,textarea:az,urlinput:lz,customeditor:DN,htmlpanel:PN,imagetools:VN,collection:CN,label:gr(qN(dz("label"))),table:iz,panel:hz});var t})),gz=[jr("type"),eo("classes",[]),$r("items",mz)],hz=gr(gz),pz=[Pr("name","name",Zn((function(){return Xi("tab-name")})),Cr),jr("title"),$r("items",mz)],vz=[jr("type"),Gr("tabs",pz)],bz=gr(vz),yz=cN,wz=fN,xz=gr([jr("title"),Fr("body",Er("type",{panel:hz,tabpanel:bz})),oo("size","normal"),$r("buttons",wz),eo("initialData",{}),ao("onAction",h),ao("onChange",h),ao("onSubmit",h),ao("onClose",h),ao("onCancel",h),eo("onTabChange",h)]),Cz=gr(E([Ur("type",["cancel","custom"])],yz,!0)),Sz=gr([jr("title"),jr("url"),Yr("height"),Yr("width"),Zr("buttons",Cz),ao("onAction",h),ao("onCancel",h),ao("onClose",h),ao("onMessage",h)]),kz=function(t){return i(t)?[t].concat(Q(bt(t),kz)):u(t)?Q(t,kz):[]},Oz=function(t){return o(t.type)&&o(t.name)},_z={checkbox:bN,colorinput:ON,colorpicker:TN,dropzone:NN,input:WN,iframe:HN,sizeinput:rz,selectbox:tz,listbox:JN,size:rz,textarea:cz,urlinput:fz,customeditor:MN,collection:SN,togglemenuitem:uN},Tz=function(t){var e=function(t){return G(kz(t),Oz)}(t),n=Q(e,(function(t){return function(t){return z.from(_z[t.type])}(t).fold((function(){return[]}),(function(e){return[Fr(t.name,e)]}))}));return gr(n)},Ez=function(t){return{internalDialog:Rr(Mr("dialog",xz,t)),dataValidator:Tz(t),initialData:t.initialData}},Az={open:function(t,e){var n=Ez(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(Rr(Mr("dialog",Sz,e)))},redial:function(t){return Ez(t)}},Dz=function(t){var e=[],n={};return dt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?zn.error(e):zn.value(n)},Mz=function(t,e){var n=Zh(_S.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:U(t.items,(function(t){return O_(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:cc([Fg.config({mode:"acyclic",useTabstopAt:x(tk)}),zS(n),US(n,{postprocess:function(t){return Dz(t).fold((function(t){return console.error(t),{}}),b)}})])}},Rz=hd({name:"TabButton",configFields:[eo("uid",void 0),Hr("value"),Pr("dom","dom",er((function(){return{attributes:{role:"tab",id:Xi("aria"),"aria-selected":"false"}}})),yr()),Xr("action"),eo("domModification",{}),mf("tabButtonBehaviours",[Jg,Fg,df]),Hr("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:fh(t.action),behaviours:hf(t.tabButtonBehaviours,[Jg.config({}),Fg.config({mode:"execution",useSpace:!0,useEnter:!0}),df.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),Nz=v([Hr("tabs"),Hr("dom"),eo("clickToDismiss",!1),mf("tabbarBehaviours",[qd,Fg]),ga(["tabClass","selectedClass"])]),zz=Wf({factory:Rz,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){qd.dehighlight(t,e),wi(t,pi(),{tabbar:t,button:e})},n=function(t,e){qd.highlight(t,e),wi(t,hi(),{tabbar:t,button:e})};return{action:function(r){var o=r.getSystem().getByUid(t.uid).getOrDie(),i=qd.isHighlighted(o,r);(i&&t.clickToDismiss?e:i?h:n)(o,r)},domModification:{classes:[t.markers.tabClass]}}}}),Bz=v([zz]),Pz=pd({name:"Tabbar",configFields:Nz(),partFields:Bz(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:hf(t.tabbarBehaviours,[qd.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){Ne(e.element,"aria-selected","true")},onDehighlight:function(t,e){Ne(e.element,"aria-selected","false")}}),Fg.config({mode:"flow",getInitial:function(t){return qd.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),Iz=hd({name:"Tabview",configFields:[mf("tabviewBehaviours",[qg])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:hf(t.tabviewBehaviours,[qg.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),Lz=v([eo("selectFirst",!0),pa("onChangeTab"),pa("onDismissTab"),eo("tabs",[]),mf("tabSectionBehaviours",[])]),Hz=Vf({factory:Pz,schema:[Hr("dom"),qr("markers",[Hr("tabClass"),Hr("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),Fz=Vf({factory:Iz,name:"tabview"}),Vz=v([Hz,Fz]),jz=pd({name:"TabSection",configFields:Lz(),partFields:Vz(),factory:function(t,e,n,r){var o=function(e,n){ed(e,t,"tabbar").each((function(t){n(t).each(xi)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:gf(t.tabSectionBehaviours),events:Oi(J([t.selectFirst?[Pi((function(t,e){o(t,qd.getFirst)}))]:[],[Ei(hi(),(function(e,n){!function(e){var n=df.getValue(e);ed(e,t,"tabview").each((function(r){K(t.tabs,(function(t){return t.value===n})).each((function(n){var o=n.view();Pe(e.element,"id").each((function(t){Ne(r.element,"aria-labelledby",t)})),qg.set(r,o),t.onChangeTab(r,e,o)}))}))}(n.event.button)})),Ei(pi(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return ed(e,t,"tabview").map((function(t){return qg.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=qd.getCandidates(t);return K(n,(function(t){return df.getValue(t)===e})).filter((function(e){return!qd.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),Uz=function(t,e){Ve(t,"height",e+"px"),ie().browser.isIE()?Ke(t,"flex-basis"):Ve(t,"flex-basis",e+"px")},Wz=function(t,e,n){Ju(t,'[role="dialog"]').each((function(t){Zu(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Ve(e,"height","0"),Ve(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=me(t).dom,i=Ju(t,".tox-dialog-wrap").getOr(t);r="fixed"===We(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var u=Ze(e),a=e.dom.offsetLeft>=n.dom.offsetLeft+cn(n)?Math.max(Ze(n),u):u,c=parseInt(We(t,"margin-top"),10)||0,s=parseInt(We(t,"margin-bottom"),10)||0;return r-(Ze(t)+c+s-a)}(t,e,r))})).each((function(t){Uz(e,t)}))}))}))},qz=function(t){return Zu(t,'[role="tabpanel"]')},Gz=function(t){var e;return{smartTabHeight:(e=Fc(),{extraEvents:[Pi((function(n){var r=n.element;qz(r).each((function(o){Ve(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){(function(t){return ut(ot(t,(function(t,e){return t>e?-1:t<e?1:0})))})(function(t,e,n){return U(t,(function(r,o){qg.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return qg.set(n,[]),i.height}))}(t,o,n)).fold(e.clear,e.set)})),Wz(r,o,e),Ke(o,"visibility"),function(t,e){ut(t).each((function(t){return jz.showTab(e,t.value)}))}(t,n),Jh.requestAnimationFrame((function(){Wz(r,o,e)}))}))})),Ei(ci(),(function(t){var n=t.element;qz(n).each((function(t){Wz(n,t,e)}))})),Ei(Lw,(function(t,n){var r=t.element;qz(r).each((function(t){var n=yc(ke(t));Ve(t,"visibility","hidden");var o=Ge(t,"height").map((function(t){return parseInt(t,10)}));Ke(t,"height"),Ke(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;o.forall((function(t){return i>t}))?(e.set(i),Wz(r,t,e)):o.each((function(e){Uz(t,e)})),Ke(t,"visibility"),n.each(vc)}))}))],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},$z=function(t,e){var n=lo({}),r=function(t){var e=df.getValue(t),r=Dz(e).getOr({}),o=n.get(),i=Jn(o,r);n.set(i)},o=function(t){var e=n.get();df.setValue(t,e)},i=lo(null),u=U(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[_S.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:U(t.items,(function(t){return O_(n,t,e)})),formBehaviours:cc([Fg.config({mode:"acyclic",useTabstopAt:x(tk)}),Gg("TabView.form.events",[Pi(o),Ii(r)]),gc.config({channels:po([{key:"send-data-to-section",value:{onReceive:r}},{key:"send-data-to-view",value:{onReceive:o}}])})])}}))]}}})),a=Gz(u).smartTabHeight;return jz.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=df.getValue(e);wi(t,Iw,{name:r,oldName:i.get()}),i.set(r)},tabs:u,components:[jz.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[Pz.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:cc([kw.config({})])}),jz.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:a.selectFirst,tabSectionBehaviours:cc([Gg("tabpanel",a.extraEvents),Fg.config({mode:"acyclic"}),wd.config({find:function(t){return ut(jz.getViewItems(t))}}),df.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn(["send-data-to-section"],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn(["send-data-to-view"],{})}}})])})},Xz=Xi("update-dialog"),Kz=Xi("update-title"),Yz=Xi("update-body"),Jz=Xi("update-footer"),Qz=Xi("body-send-message"),Zz=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:_(_({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:cc([BS(0),wD.config({channel:Yz,updateState:function(t,e){return z.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[$z(t.body,n)];default:return[Mz(t.body,n)]}},initialData:t})])}},tB=Mb.deviceType.isTouch(),eB=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},nB=function(t,e){return oN.parts.close(Qh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:cc([kw.config({})])}))},rB=function(){return oN.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},oB=function(t,e){return oN.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:qE("<p>"+e.translate(t)+"</p>")}]}]})},iB=function(t){return oN.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},uB=function(t,e){return[vw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),vw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},aB=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return oN.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),z.some(!0)},useTabstopAt:function(t){return!tk(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:_({position:"relative"},t.extraStyles)},components:E([t.header,t.body],t.footer.toArray(),!0),parts:{blocker:{dom:qE('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:tB?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:cc(E([Jg.config({}),Gg("dialog-events",t.dialogEvents.concat([Bi(Bo(),(function(t,e){Fg.focusIn(t)}))])),Gg("scroll-lock",[Pi((function(){Tu(De(),i)})),Ii((function(){Au(De(),i)}))])],t.extraBehaviours,!0)),eventOrder:_((e={},e[Qo()]=["dialog-events"],e[si()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[li()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},cB=function(t){return Qh.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:[cp("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){yi(t,Rw)}})},sB=function(t,e,n){var r=function(t){return[Vu(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:_({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:cc([wD.config({channel:Kz,renderComponents:r})])}},lB=function(){return{dom:qE('<div class="tox-dialog__draghandle"></div>')}},fB=function(t,e){return function(t,e){var n=oN.parts.title(sB(t,z.none(),e)),r=oN.parts.draghandle(lB()),o=oN.parts.close(cB(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return vw.sketch({dom:qE('<div class="tox-dialog__header"></div>'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},dB=function(t,e,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:qE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},mB=function(t,e,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){oN.setBusy(t(),(function(t,r){return dB(n.message,r,e)}))},onUnblock:function(){oN.setIdle(t())}}},gB=function(t,e,n,r){var o;return Wu(aB(_(_({},t),{lazySink:r.shared.getSink,extraBehaviours:E([wD.config({channel:Xz,updateState:function(t,e){return z.some(e)},initialData:e}),GS({})],t.extraBehaviours,!0),onEscape:function(t){yi(t,Rw)},dialogEvents:n,eventOrder:(o={},o[Jo()]=[wD.name(),gc.name()],o[si()]=["scroll-lock",wD.name(),"messages","dialog-events","alloy.base.behaviour"],o[li()]=["alloy.base.behaviour","dialog-events","messages",wD.name(),"scroll-lock"],o)})))},hB=function(t){return U(t,(function(t){return"menu"===t.type?function(t){var e=U(t.items,(function(t){var e=lo(!1);return _(_({},t),{storage:e})}));return _(_({},t),{items:e})}(t):t}))},pB=function(t){return X(t,(function(t,e){return"menu"===e.type?X(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},vB=function(t,e){return[Ri(Bo(),ZS),t(Mw,(function(t,n){e.onClose(),n.onClose()})),t(Rw,(function(t,e,n,r){e.onCancel(t),yi(r,Mw)})),Ei(Pw,(function(t,n){return e.onUnblock()})),Ei(Bw,(function(t,n){return e.onBlock(n.event)}))]},bB=function(t,e){var n=function(e,n){return Ei(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event,e)}))}))},r=function(t,e){wD.getState(t).get().each((function(n){e(n,t)}))};return E(E([],vB(n,e),!0),[n(Nw,(function(t,e,n){e.onAction(t,{name:n.name})}))],!1)},yB=function(t,e,n){var r=function(e,n){return Ei(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){wD.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return E(E([],vB(r,e),!0),[r(zw,(function(t,e){return e.onSubmit(t)})),r(Dw,(function(t,e,n){e.onChange(t,{name:n.name})})),r(Nw,(function(t,e,r,o){var i=function(){return Fg.focusIn(o)},u=function(t){return Ie(t,"disabled")||Pe(t,"aria-disabled").exists((function(t){return"true"===t}))},a=ke(o.element),c=yc(a);e.onAction(t,{name:r.name,value:r.value}),yc(a).fold(i,(function(t){u(t)?i():c.exists((function(e){return le(t,e)&&u(e)}))?i():n().toOptional().filter((function(e){return!le(e.element,t)})).each(i)}))})),r(Iw,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),Ii((function(e){var n=t();df.setValue(e,n.getData())}))],!1)},wB=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=q(n,(function(t){return"start"===t.align})),o=function(t,e){return vw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:U(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},xB=function(t,e){return{dom:qE('<div class="tox-dialog__footer"></div>'),components:[],behaviours:cc([wD.config({channel:Jz,initialData:t,updateState:function(t,n){var r=U(n.buttons,(function(t){var n=Zh(function(t,e){return gO(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return z.some({lookupByName:function(t,e){return function(t,e,n){return K(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:wB})])}},CB=function(t,e){return oN.parts.footer(xB(t,e))},SB=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=wd.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return _S.getField(n,e).fold((function(){var r=t.getFooter();return wD.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return z.some(t)}))}return z.none()},kB=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},i={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=df.getValue(r),i=mt(n,(function(t){return t.get()}));return _(_({},o),i)},setData:function(e){r((function(r){var o=i.getData(),u=_(_({},o),e),a=function(t,e){var n=t.getRoot();return wD.getState(n).get().map((function(t){return Rr(Mr("data",t.dataValidator,e))})).getOr(e)}(t,u),c=t.getFormWrapper();df.setValue(c,a),dt(n,(function(t,e){wt(u,e)&&t.set(u[e])}))}))},disable:function(e){SB(t,e).each(zd.disable)},enable:function(e){SB(t,e).each(zd.enable)},focus:function(e){SB(t,e).each(Jg.focus)},block:function(t){if(!o(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){wi(e,Bw,{message:t})}))},unblock:function(){r((function(t){yi(t,Pw)}))},showTab:function(e){r((function(n){var r=t.getBody();wD.getState(r).get().exists((function(t){return t.isTabPanel()}))&&wd.getCurrent(r).each((function(t){jz.showTab(t,e)}))}))},redial:function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([Xz],r),n.getSystem().broadcastOn([Kz],r.internalDialog),n.getSystem().broadcastOn([Yz],r.internalDialog),n.getSystem().broadcastOn([Jz],r.internalDialog),i.setData(r.initialData)}))},close:function(){r((function(t){yi(t,Mw)}))}};return i},OB=function(t,e,n){var r=fB(t.internalDialog.title,n),o=function(t,e){var n=Zz(t,z.none(),e,!1);return oN.parts.body(n)}({body:t.internalDialog.body},n),i=hB(t.internalDialog.buttons),u=pB(i),a=CB({buttons:i},n),c=yB((function(){return m}),mB((function(){return f}),n.shared.providers,e),n.shared.getSink),s=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),l={header:r,body:o,footer:z.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=gB(l,t,c,n),d={getRoot:v(f),getBody:function(){return oN.getBody(f)},getFooter:function(){return oN.getFooter(f)},getFormWrapper:function(){var t=oN.getBody(f);return wd.getCurrent(t).getOr(t)}},m=kB(d,e.redial,u);return{dialog:f,instanceApi:m}},_B=function(t,e,n,r){var o,i,u,a,c,s=Xi("dialog-label"),l=Xi("dialog-content"),f=Zh((u={title:t.internalDialog.title,draggable:!0},a=s,c=n.shared.providers,vw.sketch({dom:qE('<div class="tox-dialog__header"></div>'),components:[sB(u,z.some(a),c),lB(),cB(c)],containerBehaviours:cc([UR.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return ta(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=Zh(function(t,e,n,r){return Zz(t,z.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=hB(t.internalDialog.buttons),g=pB(m),h=Zh(function(t,e){return xB(t,e)}({buttons:m},n)),p=yB((function(){return y}),{onBlock:function(t){WE.block(b,(function(e,r){return dB(t.message,r,n.shared.providers)}))},onUnblock:function(){WE.unblock(b)},onClose:function(){return e.closeWindow()}},n.shared.getSink),b=Wu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=s,o["aria-describedby"]=l,o)},eventOrder:(i={},i[Jo()]=[wD.name(),gc.name()],i[Qo()]=["execute-on-form"],i[si()]=["reflecting","execute-on-form"],i),behaviours:cc([Fg.config({mode:"cyclic",onEscape:function(t){return yi(t,Mw),z.some(!0)},useTabstopAt:function(t){return!tk(t)&&("button"!==Pt(t)||"disabled"!==Be(t,"disabled"))}}),wD.config({channel:Xz,updateState:function(t,e){return z.some(e)},initialData:t}),Jg.config({}),Gg("execute-on-form",p.concat([Bi(Bo(),(function(t,e){Fg.focusIn(t)}))])),WE.config({getRoot:function(){return z.some(b)}}),qg.config({}),GS({})]),components:[f.asSpec(),d.asSpec(),h.asSpec()]}),y=kB({getRoot:v(b),getFooter:function(){return h.get(b)},getBody:function(){return d.get(b)},getFormWrapper:function(){var t=d.get(b);return wd.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:b,instanceApi:y}},TB=tinymce.util.Tools.resolve("tinymce.util.URI"),EB=["insertContent","setContent","execCommand","close","block","unblock"],AB=function(t){return i(t)&&-1!==EB.indexOf(t.mceAction)},DB=function(t,e,n,r){var u,a,s,l=fB(t.title,r),f=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[JS({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:cc([kw.config({}),Jg.config({})])})]}],behaviours:cc([Fg.config({mode:"acyclic",useTabstopAt:x(tk)})])};return oN.parts.body(e)}(t),d=t.buttons.bind((function(t){return 0===t.length?z.none():z.some(CB({buttons:t},r))})),m=bB((function(){return C}),mB((function(){return w}),r.shared.providers,e)),g=_(_({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),h=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],p=new TB(t.url,{base_uri:new TB(window.location.href)}),v=p.protocol+"://"+p.host+(p.port?":"+p.port:""),b=Hc(),y=[Gg("messages",[Pi((function(){var e=jc(zt.fromDom(window),"message",(function(e){if(p.isSameOrigin(new TB(e.raw.origin))){var r=e.raw.data;AB(r)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!c(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(n,C,r):function(t){return!AB(t)&&i(t)&&wt(t,"mceAction")}(r)&&t.onMessage(C,r)}}));b.set(e)})),Ii(b.clear)]),gc.config({channels:(u={},u[Qz]={onReceive:function(t,e){Zu(t.element,"iframe").each((function(t){t.dom.contentWindow.postMessage(e,v)}))}},u)})],w=gB({header:l,body:f,footer:d,extraClasses:h,extraBehaviours:y,extraStyles:g},t,m,r),C=(a=w,s=function(t){a.getSystem().isConnected()&&t(a)},{block:function(t){if(!o(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");s((function(e){wi(e,Bw,{message:t})}))},unblock:function(){s((function(t){yi(t,Pw)}))},close:function(){s((function(t){yi(t,Mw)}))},sendMessage:function(t){s((function(e){e.getSystem().broadcastOn([Qz],t)}))}});return{dialog:w,instanceApi:C}},MB=function(t,e,n){return e&&n?[]:[ZT.config({contextual:{lazyContext:function(){return z.some(An(zt.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},RB=function(t){var e=t.backstage,n=t.editor,r=lb(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){oN.hide(c),r()},i=Zh(gO({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:z.none()},"cancel",t.backstage)),u=rB(),a=nB(o,e.providers),c=Wu(aB({lazySink:function(){return e.getSink()},header:eB(u,a),body:oB(n,e.providers),footer:z.some(iB(uB([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ei(Rw,o)],eventOrder:{}}));oN.show(c);var s=i.get(c);Jg.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){oN.hide(s),r(t)},i=Zh(gO({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:z.none()},"submit",t.backstage)),u=gO({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:z.none()},"cancel",t.backstage),a=rB(),c=nB((function(){return o(!1)}),e.providers),s=Wu(aB({lazySink:function(){return e.getSink()},header:eB(a,c),body:oB(n,e.providers),footer:z.some(iB(uB([],[u,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ei(Rw,(function(){return o(!1)})),Ei(zw,(function(){return o(!0)}))],eventOrder:{}}));oN.show(s);var l=i.get(s);Jg.focus(l)}}}(t),u=function(t,r){return Az.openUrl((function(t){var o=DB(t,{closeWindow:function(){oN.hide(o.dialog),r(o.instanceApi)}},n,e);return oN.show(o.dialog),o.instanceApi}),t)},a=function(t,n){return Az.open((function(t,r,o){var i=r,u=OB({dataValidator:o,initialData:i,internalDialog:t},{redial:Az.redial,closeWindow:function(){oN.hide(u.dialog),n(u.instanceApi)}},e);return oN.show(u.dialog),u.instanceApi.setData(i),u.instanceApi}),t)},c=function(t,o,i,u){return Az.open((function(t,a,c){var s=Rr(Mr("data",c,a)),l=Fc(),f=e.shared.header.isPositionedAtTop(),d=function(){return l.on((function(t){Rh.reposition(t),ZT.refresh(t)}))},m=_B({dataValidator:c,initialData:s,internalDialog:t},{redial:Az.redial,closeWindow:function(){l.on(Rh.hide),n.off("ResizeEditor",d),l.clear(),i(m.instanceApi)}},e,u),g=Wu(Rh.sketch(_(_({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},f?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:cc(E([Gg("window-manager-inline-events",[Ei(fi(),(function(t,e){yi(m.dialog,Rw)}))])],MB(n,r,f),!0)),isExtraPart:function(t,e){return function(t){return rw(t,".tox-alert-dialog")||rw(t,".tox-confirm-dialog")}(e)}})));return l.set(g),Rh.showWithin(g,qu(m.dialog),{anchor:o},z.some(De())),r&&f||(ZT.refresh(g),n.on("ResizeEditor",d)),m.instanceApi.setData(s),Fg.focusIn(m.dialog),m.instanceApi}),t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?c(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?c(t,e.shared.anchors.cursor(),r,n.ariaAttrs):a(t,r)},openUrl:function(t,e){return u(t,e)},alert:function(t,e){o.open(t,(function(){e()}))},close:function(t){t.close()},confirm:function(t,e){i.open(t,(function(t){e(t)}))}}};O.add("silver",(function(t){var e=tN(t),n=e.uiMothership,r=e.backstage,o=e.renderUI,i=e.getUi;nw(t,r.shared);var u=RB({editor:t,backstage:r});return{renderUI:o,getWindowManagerImpl:v(u),getNotificationManagerImpl:function(){return fp(t,{backstage:r},n)},ui:i()}}))}()}).call(this,n(31))},584:function(t,e){tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 01-1-1v-5c0-.6-.4-1-1-1a1 1 0 00-1 1v5c0 .6-.4 1-1 1a1 1 0 01-1-1V9H4a1 1 0 110-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" fill-rule="nonzero"/></svg>',"action-next":'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 00-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 10-1.4-1.4L12 13.6 5.7 7.3z"/></svg>',"action-prev":'<svg width="24" height="24"><path fill-rule="nonzero" d="M18.3 15.7a1 1 0 001.4-1.4L12 6.6l-7.7 7.7a1 1 0 001.4 1.4L12 9.4l6.3 6.3z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 110-2h9.2zm4 0h.8a1 1 0 010 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h6.8zm4 0H19a1 1 0 010 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h4.4zm4 0H19a1 1 0 010 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 010-2h2zm4 0h8a1 1 0 010 2H9.8l1.2-2zm5.2-13.5l1.3.7-9.7 16.3-1.3-.7 9.7-16.3z" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 001.4-1V6a1 1 0 00-1.4-.9l-12 6a1 1 0 000 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 015 18V6a1 1 0 011.4-.9l12 6a1 1 0 010 1.8z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 01-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4z" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 00-1 1z" fill-rule="nonzero"/></svg>',"border-style":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="2" x="3" y="6" rx="1"/><rect width="2.8" height="2" x="3" y="16" rx="1"/><rect width="2.8" height="2" x="6.8" y="16" rx="1"/><rect width="2.8" height="2" x="10.6" y="16" rx="1"/><rect width="2.8" height="2" x="14.4" y="16" rx="1"/><rect width="2.8" height="2" x="18.2" y="16" rx="1"/><rect width="8" height="2" x="3" y="11" rx="1"/><rect width="8" height="2" x="13" y="11" rx="1"/></g></svg>',"border-width":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="5" x="3" y="5" rx="1"/><rect width="18" height="3.5" x="3" y="11.5" rx="1"/><rect width="18" height="2" x="3" y="17" rx="1"/></g></svg>',brightness:'<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 01-.7-.3A1 1 0 0111 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3h-1a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 01-.7.3H5a1 1 0 01-.7-.3A1 1 0 014 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7zm10 3.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 01-.8.3 1 1 0 01-.6-.3l-.8-.7a1 1 0 01-.3-.8c0-.2.1-.5.3-.7a1 1 0 011.4 0zm-10-7l-.7-.8a1 1 0 01-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.8-.3zm10 0a1 1 0 01-.8.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 010 1.4l-.8.8a1 1 0 01-.6.3 1 1 0 01-.8-.3 1 1 0 01-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 013.7 2.4 4 4 0 010 3.2A4 4 0 0112 16a4 4 0 01-3.7-2.4 4 4 0 010-3.2A4 4 0 0112 8zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7z" fill-rule="evenodd"/></svg>',browse:'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 11-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L13 13.4V20a1 1 0 01-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 110 14.8 7.4 7.4 0 010-14.8zM12 3a9 9 0 100 18 9 9 0 000-18zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7z" fill-rule="nonzero"/></svg>',"cell-background-color":'<svg width="24" height="24"><path d="M15.7 2l1.6 1.6-2.7 2.6 5.9 5.8c.7.7.7 1.7 0 2.4l-6.3 6.1a1.7 1.7 0 01-2.4 0l-6.3-6.1c-.7-.7-.7-1.7 0-2.4L15.7 2zM18 12l-4.5-4L9 12h9zM4 16s2 2.4 2 3.8C6 21 5.1 22 4 22s-2-1-2-2.2C2 18.4 4 16 4 16z"/></svg>',"cell-border-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M5 13v5h2v2H5a2 2 0 01-2-2v-5h2zm8-7V4h6a2 2 0 012 2h-8z" opacity=".2"/><path fill-rule="nonzero" d="M13 4v2H5v7H3V6c0-1.1.9-2 2-2h8zm-2.6 14.1l.1-.1.1.1.2.3.2.2.2.2c.4.6.8 1.2.8 1.7 0 .8-.7 1.5-1.5 1.5S9 21.3 9 20.5c0-.5.4-1.1.8-1.7l.2-.2.2-.2.2-.3z"/><path d="M13 11l-2 2H5v-2h6V6h2z"/><path fill-rule="nonzero" d="M18.4 8l1 1-1.8 1.9 4 4c.5.4.5 1.1 0 1.6l-4.3 4.2a1.2 1.2 0 01-1.6 0l-4.4-4.2c-.4-.5-.4-1.2 0-1.7l7-6.8zm1.6 7l-3-3-3 3h6z"/></g></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 01-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 01-1 .7h-.2a.7.7 0 01-.7-1l4-12a1 1 0 012 0l4 12a.7.7 0 01-.8 1h-.2a1 1 0 01-1-.7l-.8-2.6zm-.3-1.5l-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1zm4.8-6.8V10H7.7V5.8h-1v-1h2zM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1zM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 01-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 00-.5-.1 1 1 0 00-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 00-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 001.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 00-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 00-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 01-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 01-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1z" fill-rule="evenodd"/></svg>',"checklist-rtl":'<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8a1 1 0 010 2h-8a1 1 0 010-2zM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 011.6 1.2l-8 12a1 1 0 01-1.5.1l-5-5a1 1 0 111.4-1.4l4.1 4.1 7.4-11z" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 010-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8z" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><path d="M7.8 1.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 010-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1z" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 010-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 010-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 010-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0z" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><path d="M17.3 8.2L13.4 12l3.9 3.8a1 1 0 01-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 01-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 011.5-1.5l3.8 3.9 3.8-3.9a1 1 0 011.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 01-.8 2 2.8 2.8 0 01.8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 01-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 01.8-2 2.8 2.8 0 01-.8-2zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2zM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 01-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 01-.5-.5V17a3 3 0 001-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5z" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0118 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 01-3.7 3 5.7 5.7 0 01-3.2 0A5.9 5.9 0 017.6 18a6.2 6.2 0 01-1.4-2.6 6.7 6.7 0 010-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 012.3-4A20 20 0 0112 4a26.4 26.4 0 013.2 3.4 18.2 18.2 0 012.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 00-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 01-1.3 3 5.3 5.3 0 01-2.3 1.5 4.9 4.9 0 01-2 .1 4.3 4.3 0 002.4.8 4 4 0 002-.6 4 4 0 001.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 000 18 1.5 1.5 0 001.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 005-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3-4a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm5 0a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3 4a1.5 1.5 0 110-3 1.5 1.5 0 010 3z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',"comment-add":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/><path d="M13 10h2a1 1 0 010 2h-2v2a1 1 0 01-2 0v-2H9a1 1 0 010-2h2V8a1 1 0 012 0v2z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-6 8a6 6 0 006 6V6a6 6 0 00-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 00-2 2v11h2V5h10V3zm1 4a2 2 0 012 2v10a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7zm0 12V9h-7v10h7z" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 01-1-1v-2H7V9H5a1 1 0 110-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3zM9 9v5l5-5H9zm1 6h5v-5l-5 5z" fill-rule="evenodd"/></svg>',"cut-column":'<svg width="24" height="24"><path fill-rule="evenodd" d="M7.2 4.5c.9 0 1.6.4 2.2 1A3.7 3.7 0 0110.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 012 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 017 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7zm12.3 5h-3v10h3v-10zM8 13.8h-.3l-.4.2a2.8 2.8 0 00-.7.4v.1a2.8 2.8 0 00-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 00.8-.3 2.4 2.4 0 00.7-.7 2.5 2.5 0 00.3-.8 1.5 1.5 0 000-.8 1 1 0 00-.2-.4 1 1 0 00-.5-.2H8zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zM7 5.8h-.4a1 1 0 00-.5.3 1 1 0 00-.2.5v.7a2.5 2.5 0 00.3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 000-.8 2.6 2.6 0 00-.3-.8A2.5 2.5 0 007.7 6l-.4-.1H7z"/></svg>',"cut-row":'<svg width="24" height="24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 00-.8.4 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3L9 18V18l.4-.4.2-.4.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2h-.5zm7 0H15a1 1 0 00-.4.3 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4a2.8 2.8 0 00.5.7h.1a2.8 2.8 0 00.8.6l.4.1h.7l.5-.2.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3h-.3zM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zm8.5-7.1h-11v2h11v-2z"/></svg>',cut:'<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 010 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8zm-8.5 2.2l.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2 1.6 1.6 0 00-.8 0 2.6 2.6 0 00-.8.3 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3 2.8 2.8 0 001-1zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4zm5.4 4l.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3 1.5 1.5 0 00-.8 0 1 1 0 00-.4.2 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4l.3.4.3.4a2.8 2.8 0 00.8.5l.4.1h.7l.5-.2z" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5zm0 4h2v2h-2V9zM9 9h2v2H9V9zm4 4h2v2h-2v-2zm-4 0h2v2H9v-2zm0 4h2v2H9v-2zm4 0h2v2h-2v-2zM9 5h2v2H9V5z" fill-rule="evenodd"/></svg>',"duplicate-column":'<svg width="24" height="24"><path d="M17 6v16h-7V6h7zm-2 2h-3v12h3V8zm-2-6v2H8v15H6V2h7z"/></svg>',"duplicate-row":'<svg width="24" height="24"><path d="M22 11v7H6v-7h16zm-2 2H8v3h12v-3zm-1-6v2H4v5H2V7h17z"/></svg>',duplicate:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10zm3 8h-2V9h-7v10h9a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7a2 2 0 012 2v2z"/><path d="M17 14h1a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1h-1a1 1 0 010-2h1v-1a1 1 0 012 0v1z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5zm-2-.2l1-.9v-.3l-2.2-2.2a.3.3 0 00-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5z"/></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 00-2-2H7v2h11v9zM6 17h15a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1H6a2 2 0 01-2-2V7H3a1 1 0 110-2h1V4a1 1 0 112 0v13zm3-5.3l1.3 2 3-4.7 3.7 6H7l2-3.3z" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0119 6zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 008 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 00-4 4.5h2.2zm-3.4 0a12 12 0 012.8-4 12 12 0 00-5 4h2.2z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 010 .8l-5.6 4A.5.5 0 019 16V8a.5.5 0 01.8-.4z" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5zM12 4a8 8 0 100 16 8 8 0 000-16zm0 14.5a6.5 6.5 0 110-13 6.5 6.5 0 010 13z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3L18 7v1h-5V5H7v14h9a1 1 0 012 0c0 1-.8 2-1.9 2H7c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h7.5z"/><path d="M18.1 12c.5 0 .9.4.9 1 0 .5-.3 1-.8 1h-7.3c-.5 0-.9-.4-.9-1 0-.5.3-1 .8-1h7.3z"/><path d="M16.4 9.2a1 1 0 011.4.2l2.4 3.6-2.4 3.6a1 1 0 01-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 01.2-1.4z"/></g></svg>',fill:'<svg width="24" height="26"><path d="M16.6 12l-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 002.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 002-2c0-1.3-2-3.5-2-3.5z" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 00-2 2zm14-2v2h2a2 2 0 00-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 002-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 00-2 2v3h2V6h10v3h2V6a2 2 0 00-2-2zm2 14h-2v2a2 2 0 002-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 00-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3z" fill-rule="nonzero"/></svg>',format:'<svg width="24" height="24"><path fill-rule="evenodd" d="M17 5a1 1 0 010 2h-4v11a1 1 0 01-2 0V7H7a1 1 0 110-2h10z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 110-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 11-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 111.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 110-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 110 1.7H5a.9.9 0 01-.9-.9v-4.4a.9.9 0 111.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 01-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 010 1.8H7l3 2.9-1.3 1.2z" fill-rule="nonzero"/></svg>',gallery:'<svg width="24" height="24"><path fill-rule="nonzero" d="M5 15.7l2.3-2.2c.3-.3.7-.3 1 0L11 16l5.1-5c.3-.4.8-.4 1 0l2 1.9V8H5v7.7zM5 18V19h3l1.8-1.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 01-1-1V7c0-.6.4-1 1-1zm6 7a2 2 0 110-4 2 2 0 010 4zM4.5 4h15a.5.5 0 110 1h-15a.5.5 0 010-1zm2-2h11a.5.5 0 110 1h-11a.5.5 0 010-1z"/></svg>',gamma:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 00-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 01.6.5l.1.3a8.5 8.5 0 01.3.6l1.9 4.6 2-5.2a1 1 0 011-.6.5.5 0 01.5.6L13 14v2.8a.7.7 0 01-1.4 0z" fill-rule="nonzero"/></svg>',help:'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 00-6 9 6.3 6.3 0 001.4 2l1 1a6.3 6.3 0 003.6 1 6.5 6.5 0 006-9 6.3 6.3 0 00-1.4-2l-1-1a6.3 6.3 0 00-3.6-1zM12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4z"/><path d="M9.6 9.7a.7.7 0 01-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 00-.8.8.8.8 0 01-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 012.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="M5 15.7l3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7zM5 18V19h3l2.8-2.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 100-4 2 2 0 000 4z" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-1 3v2h2V7h-2zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4z" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 001.8-2.9 6.3 6.3 0 00-.1-4.1 5.8 5.8 0 00-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 00-3.9 1.8 6.3 6.3 0 00-1.3 6 6.2 6.2 0 001.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 014 11c0-1 .2-1.9.6-2.7A7 7 0 016.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 015.7 2 7 7 0 011.7 2.3 6 6 0 01.2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 01-3.6 2.5v.5z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 100-14 7 7 0 000 14zm0 2a9 9 0 110-18 9 9 0 010 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 00-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 01-3.1 1.9 6.1 6.1 0 01-5.5-1.6A5.8 5.8 0 016 14v-.3l.1-1.2A13.9 13.9 0 017.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 00.2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 00-3-4.2L12 6a26.1 26.1 0 00-2.2 2.5l-1-1a20.9 20.9 0 012.9-3.3L12 4l1 .8a22.2 22.2 0 014 5.4c.6 1.2 1 2.4 1 3.6z" fill-rule="evenodd"/></svg>',italic:'<svg width="24" height="24"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8z" fill-rule="evenodd"/></svg>',language:'<svg width="24" height="24"><path d="M12 3a9 9 0 110 18 9 9 0 010-18zm4.3 13.3c-.5 1-1.2 2-2 2.9a7.5 7.5 0 003.2-2.1l-.2-.2a6 6 0 00-1-.6zm-8.6 0c-.5.2-.9.5-1.2.8.9 1 2 1.7 3.2 2a10 10 0 01-2-2.8zm3.6-.8c-.8 0-1.6.1-2.2.3.5 1 1.2 1.9 2.1 2.7zm1.5 0v3c.9-.8 1.6-1.7 2.1-2.7-.6-.2-1.4-.3-2.1-.3zm-6-2.7H4.5c.2 1 .5 2.1 1 3h.3l1.3-1a10 10 0 01-.3-2zm12.7 0h-2.3c0 .7-.1 1.4-.3 2l1.6 1.1c.5-1 .9-2 1-3.1zm-3.8 0h-3V14c1 0 2 .1 2.7.4.2-.5.3-1 .3-1.6zm-4.4 0h-3l.3 1.6c.8-.3 1.7-.4 2.7-.4v-1.3zm-5.5-5c-.7 1-1.1 2.2-1.3 3.5h2.3c0-1 .2-1.8.5-2.6l-1.5-1zm2.9 1.4v.1c-.2.6-.4 1.3-.4 2h3V9.4c-1 0-1.8-.1-2.6-.3zm6.6 0h-.1l-2.4.3v1.8h3l-.5-2.1zm3-1.4l-.3.1-1.3.8c.3.8.5 1.6.5 2.6h2.3a7.5 7.5 0 00-1.3-3.5zm-9 0l2 .2V5.5a9 9 0 00-2 2.2zm3.5-2.3V8c.6 0 1.3 0 1.9-.2a9 9 0 00-2-2.3zm-3-.7h-.1c-1.1.4-2.1 1-3 1.8l1.2.7a10 10 0 011.9-2.5zm4.4 0l.1.1a10 10 0 011.8 2.4l1.1-.7a7.5 7.5 0 00-3-1.8z"/></svg>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zM7 3.6l3.7 3.7a1 1 0 01-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 011.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 011.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 01-1.3 0h-.1a1 1 0 010-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1zM4 18h16v2H4v-2z" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2.1 2a2 2 0 102.7 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2-2a2 2 0 10-2.6-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 26a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 36a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-num-default-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 17v-4.8l-1.6 1v-1.1l1.6-1h1.2V17zM33.3 17.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm1.7 5.7c0-1.2 1-2 2.2-2 1.3 0 2.1.8 2.1 1.8 0 .7-.3 1.2-1.3 2.2l-1.2 1v.2h2.6v1h-4.3v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H35zm-1.7 4.3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm3.2 7.3v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H35c0-1.1 1-1.8 2.2-1.8 1.2 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.7.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .6 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm-3.3 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-lower-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M36.5 16c-.9 0-1.5-.5-1.5-1.3s.6-1.3 1.8-1.4h1v-.4c0-.4-.2-.6-.7-.6-.4 0-.7.1-.8.4h-1.1c0-.8.8-1.4 2-1.4S39 12 39 13V16h-1.2v-.6c-.3.4-.8.7-1.4.7zm.4-.8c.6 0 1-.4 1-.9V14h-1c-.5.1-.7.3-.7.6 0 .4.3.6.7.6zM33.1 16.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zM37.7 26c-.7 0-1.2-.2-1.5-.7v.7H35v-6.3h1.2v2.5c.3-.5.8-.9 1.5-.9 1.1 0 1.8 1 1.8 2.4 0 1.5-.7 2.4-1.8 2.4zm-.5-3.6c-.6 0-1 .5-1 1.3s.4 1.4 1 1.4c.7 0 1-.6 1-1.4 0-.8-.3-1.3-1-1.3zM33.2 26.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm6 7h-1c-.1-.5-.4-.8-1-.8s-1 .5-1 1.4c0 1 .4 1.4 1 1.4.5 0 .9-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm-6.1 3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 16c-1.2 0-2-.8-2-2.3 0-1.5.8-2.4 2-2.4.6 0 1 .4 1.3 1v-.9H40v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1-.7h-.2c-.2.4-.7.8-1.3.8zm.3-1c.6 0 1-.5 1-1.3s-.4-1.3-1-1.3-1 .5-1 1.3.4 1.4 1 1.4zM33.3 16.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM36 21.9c0-1.5.8-2.3 2.1-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.9 1.3.9.3 1.3.8 1.3 1.7 0 1.2-.7 1.9-1.8 1.9-.6 0-1.1-.3-1.4-.8v2.2H36V22zm1.8 1.2v-1h.3c.5 0 .9-.2.9-.7 0-.5-.3-.8-.9-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1 1.3s1-.4 1-1-.4-1-1.2-1h-.3zM33.3 26.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM37.1 34.6L34.8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.2.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zM33.3 36.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3zM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M32.9 16v-1.2h-1.3V16H33zm0 10v-1.2h-1.3V26H33zm0 10v-1.2h-1.3V36H33z"/><path fill-rule="nonzero" d="M36 21h-1.5v5H36zM36 31h-1.5v5H36zM39 21h-1.5v5H39zM39 31h-1.5v5H39zM42 31h-1.5v5H42zM36 11h-1.5v5H36zM36 19h-1.5v1H36zM36 29h-1.5v1H36zM39 19h-1.5v1H39zM39 29h-1.5v1H39zM42 29h-1.5v1H42zM36 9h-1.5v1H36z"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15zm0 10v-1.2h1.3V26H15zm0 10v-1.2h1.3V36H15z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M39.3 17l-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3zm-1.6-4.7l-.7 2.3h1.6l-.8-2.3zM33.4 17c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm4.7 9.9h-2.7v-6H38c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zm-1.4-5v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4h1.1c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9h-1.1V26zM33 27.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm4.9 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm-4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M12.6 17l-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3zM11 12.3l-.7 2.3h1.6l-.8-2.3zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M31.6 17v-1.2H33V17h-1.3zm0 10v-1.2H33V27h-1.3zm0 10v-1.2H33V37h-1.3z"/><path fill-rule="nonzero" d="M34.5 20H36v7h-1.5zM34.5 30H36v7h-1.5zM37.5 20H39v7h-1.5zM37.5 30H39v7h-1.5zM40.5 30H42v7h-1.5zM34.5 10H36v7h-1.5z"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15zm0 10v-1.2h1.3V27H15zm0 10v-1.2h1.3V37H15z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3zM10 8v3h4V8a1 1 0 00-.3-.7A1 1 0 0013 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 017.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-2v8H5V7h8l-2 2H7v8h8v-4zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><path d="M11 11H8a1 1 0 110-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 01-1-1v-3zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1z" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><path d="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 110-2zm13-1v3.5a.5.5 0 11-1 0V5h-.5a.5.5 0 110-1H19zm-1 8.8l.2.2h1.3a.5.5 0 110 1h-1.6a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2h-1.3a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zm2 4.2v2c0 .6-.4 1-1 1h-1.5a.5.5 0 010-1h1.2a.3.3 0 100-.6h-1.3a.4.4 0 110-.8h1.3a.3.3 0 000-.6h-1.2a.5.5 0 110-1H19c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 110-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 01-.5-.5V5h-.5a.5.5 0 010-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2H4.5a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 010-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 110-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 110-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4L1 13l6.4 6.5 6.5-6.5-6.5-6.5zM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7zM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 010-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 11-4.3 16.9l1.5-1.5A7 7 0 1013 6h-1z" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.2 1.6L6.8 12l1.8 1.2z" fill-rule="evenodd"/></svg>',"page-break":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 01-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 01-1-1v-5H7v5c0 .6-.4 1-1 1z"/></g></svg>',paragraph:'<svg width="24" height="24"><path fill-rule="evenodd" d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2z" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1z" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5L8 20H3v-3l3.5-3.5a2 2 0 010-3L14 3l1 1-7.3 7.3a1 1 0 000 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 01-2.8 0l-.1-.1z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><path d="M12 4c.5 0 1 .4 1 .9V11h6a1 1 0 01.1 2H13v6a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H11V5c0-.6.4-1 1-1z"/></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 01-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 01-1.4 0l-1.5-1.2a6.2 6.2 0 01-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 01-1-.9l-.2-1.9a5.8 5.8 0 01-1.5-.6l-1.5 1.2a1 1 0 01-1.4 0l-.7-.7a1 1 0 010-1.4l1.2-1.5a6.2 6.2 0 01-.6-1.5l-1.9-.2a1 1 0 01-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 01.6-1.5L5.2 7.3a1 1 0 010-1.4l.7-.7a1 1 0 011.4 0l1.5 1.2a6.2 6.2 0 011.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 011.5.6l1.5-1.2a1 1 0 011.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 01.6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 100-6 3 3 0 000 6z" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 002.1-2.8 15.7 15.7 0 00-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 00-6.7 3.2A16.2 16.2 0 003.2 12c0 .2.2.3.3.5zm-2.4-1l.7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 012.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 01-2.8-3.7 1 1 0 010-1zm12-3.3a2 2 0 102.7 2.6 4 4 0 11-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 00-3 3v6h2v3h14v-3h2v-6a3 3 0 00-3-3zm-1 10H7v-4h10v4zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5zm.5-8H6v2h12V5z" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3z" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 11-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 111.4-1.4l5 5a1 1 0 010 1.4l-5 5a1 1 0 01-1.4-1.4l3.3-3.3z" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5 22.1l-1.2-4.7v-.2a1 1 0 011-1l5 .4a1 1 0 11-.2 2l-2.2-.2a7.8 7.8 0 008.4.2 7.5 7.5 0 003.5-6.4 1 1 0 112 0 9.5 9.5 0 01-4.5 8 9.9 9.9 0 01-10.2 0l.4 1.4a1 1 0 11-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 00-9.5-1 7.5 7.5 0 00-3.6 7 1 1 0 01-2 0 9.5 9.5 0 014.5-8.6 10 10 0 0110.9.3l-.3-1a1 1 0 012-.5l1.1 4.8a1 1 0 01-1 1.2l-5-.4a1 1 0 01-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 010 .2l-2.6 10a1 1 0 01-1 .8h-.2a.8.8 0 01-.8-1l2.6-10H8a1 1 0 110-2h9a1 1 0 010 2h-3.8zM5 18h7a1 1 0 010 2H5a1 1 0 010-2zm13 1.5L16.5 18 15 19.5a.7.7 0 01-1-1l1.5-1.5-1.5-1.5a.7.7 0 011-1l1.5 1.5 1.5-1.5a.7.7 0 011 1L17.5 17l1.5 1.5a.7.7 0 01-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 010 2h-1v9a3 3 0 01-3 3H9a3 3 0 01-3-3V9H5a1 1 0 110-2h3V6a3 3 0 013-3h2a3 3 0 013 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 00-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 012 0v4a1 1 0 01-2 0v-4zm4 0a1 1 0 012 0v4a1 1 0 01-2 0v-4z" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 119 2l-7 7A.5.5 0 111 8l7-7zM8.1 5.1A.5.5 0 119 6l-3 3A.5.5 0 115 8l3-3z"/></g></svg>',resize:'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-6a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3A1 1 0 014 11V5z" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1z"/><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 012 0v6c0 .6-.4 1-1 1h-6a1 1 0 010-2h4.3L16 7A7.2 7.2 0 007.7 6a7 7 0 003 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 011.4 1.5A9.2 9.2 0 012.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8z" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 014.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L8 5zm12 11.2a1 1 0 11-1 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 111 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 10-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 10-1.4-1.4L13 11.6V4a1 1 0 00-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 00-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 00-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 002-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2zM7 17h10V7H7v10zm2-8h6v6H9V9z" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 00-1 1L9.6 17 18 8.6a.7.7 0 000-1 .7.7 0 00-1 0l-7.4 7.3z"/></svg>',settings:'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V8H5a1 1 0 110-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6zM8 8h2V6H8v2zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V13H5a1 1 0 010-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6zM14 13h2v-2h-2v2zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V18H5a1 1 0 010-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6zM8 18h2v-2H8v2z" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><path d="M16 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2z" fill-rule="evenodd"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 010-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7zM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 00-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7z"/></g></svg>',"spell-check":'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6zm0-3v2h2V5H6zm13 0h-3v5h3v1h-3a1 1 0 01-.7-.3 1 1 0 01-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12z" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 017 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1z"/><path d="M5 11h14a1 1 0 010 2H5a1 1 0 010-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="M10.4 10l4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10zM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 00-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 01-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4L10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11z" fill-rule="nonzero"/></svg>',"table-caption":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="12" height="2" x="3" y="4" rx="1"/><path d="M19 8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2v-8c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></g></svg>',"table-cell-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M13 4v9H3V6c0-1.1.9-2 2-2h8zm-2 2H5v5h6V6z"/><path fill-rule="nonzero" d="M13 4h6a2 2 0 012 2v7h-8v-2h6V6h-6V4z" opacity=".2"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/><path fill-rule="nonzero" d="M3 13v5c0 1.1.9 2 2 2h8v-7h-2v5H5v-5H3z" opacity=".2"/></g></svg>',"table-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8 0h-6v5h6v-5zm-8-7H5v5h6V6z"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z" opacity=".2"/></g></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z"/></g></svg>',"table-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v7h-8v7H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8-7h-6v5h6V6zm-8 0H5v5h6V6z"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5l1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5z"/></svg>',"table-delete-row":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8l1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3z"/></svg>',"table-delete-table":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="M14.4 8.6l1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-1-1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></g></svg>',"table-insert-column-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M20 4c.6 0 1 .4 1 1v2a1 1 0 01-2 0V6h-8v12h8v-1a1 1 0 012 0v2c0 .5-.4 1-.9 1H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H17v2a1 1 0 01-2 .1V13h-2a1 1 0 01-.1-2H15V9c0-.6.4-1 1-1zM9 6H5v5h4V6z"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H4a1 1 0 01-1-1v-2a1 1 0 012 0v1h8V6H5v1a1 1 0 11-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H9v2a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H7V9c0-.6.4-1 1-1zm11-2h-4v5h4V6z"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4a1 1 0 110 2H5v6h14V6h-1a1 1 0 010-2h2c.6 0 1 .4 1 1v13a2 2 0 01-2 2H5a2 2 0 01-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 010 2h-2v2a1 1 0 01-2 .1V8H9a1 1 0 010-2h2V4c0-.6.4-1 1-1z"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 01.1 2H13v2a1 1 0 01-2 .1V18H9a1 1 0 01-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 010-2h1v-6H5v6h1a1 1 0 010 2H4a1 1 0 01-1-1V6c0-1.1.9-2 2-2h14a2 2 0 012 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 9h-4v5h4v-5zm-6 0H9v5h4v-5zm0-7H9v5h4V6zm6 0h-4v5h4V6z"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15.5V18h3v-2.5H5zm14-5h-9V18h9v-7.5zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6zm-8 7.5h3v-3H5v3z"/></svg>',"table-row-numbering-rtl":'<svg width="24" height="24"><path d="M6 4a2 2 0 00-2 2v13c0 1.1.9 2 2 2h12a2 2 0 002-2V6a2 2 0 00-2-2H6zm0 12h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 11h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 6h8v3H6V6zm11 0c.6 0 1 .4 1 1v1a1 1 0 11-2 0V7c0-.6.4-1 1-1z"/></svg>',"table-row-numbering":'<svg width="24" height="24"><path d="M18 4a2 2 0 012 2v13a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2h12zm0 12h-8v3h8v-3zM7 16a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8v-3zM7 11a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8V6zM7 6a1 1 0 00-1 1v1a1 1 0 102 0V7c0-.6-.4-1-1-1z"/></svg>',"table-row-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-9h-6v3h6V6zM5 9h6V6H5v3z"/></svg>',"table-split-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1l1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2zm-8.5-1H5v3h3v-3zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6z"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 11H5v3h6v-3zm8 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></svg>',table:'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 14v4h6v-4H5zm14 0h-6v4h6v-4zm0-6h-6v4h6V8zM5 12h6V8H5v4z"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14zM9 16v-4a5 5 0 116 0v4h4a2 2 0 012 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 10-3.6 0l.8.6v5h2z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 111 0V6H15v1.6a8 8 0 11-6 0zm-2.6 5.3a.5.5 0 00.3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 013.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 00-4.1 3.7z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"/></g></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 010-1l3.1-3A12.4 12.4 0 016.7 9H8a10.1 10.1 0 001.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 110-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 01-1 2.4 13.5 13.5 0 01-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 01-.4.7 1 1 0 01-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 01-1 .7.5.5 0 01-.4-.7l2.7-7.4a1 1 0 012 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 01-.4 1.8l-1 1.4a5.3 5.3 0 01-5.5 1 5 5 0 01-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 01-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 002.2.8 3.4 3.4 0 002.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1zM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 01-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 11-1.4 1.4l-5-5a1 1 0 010-1.4l5-5a1 1 0 011.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2 2a2 2 0 102.6 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2.1-2a2 2 0 10-2.7-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2zM7.6 6.3a.8.8 0 01-1 1.1L3.3 4.2a.7.7 0 111-1l3.2 3.1zM5.1 8.6a.8.8 0 010 1.5H3a.8.8 0 010-1.5H5zm5-3.5a.8.8 0 01-1.5 0V3a.8.8 0 011.5 0V5zm6 11.8a.8.8 0 011-1l3.2 3.2a.8.8 0 01-1 1L16 17zm-2.2 2a.8.8 0 011.5 0V21a.8.8 0 01-1.5 0V19zm5-3.5a.7.7 0 110-1.5H21a.8.8 0 010 1.5H19z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 00-.3-.7A1 1 0 0016 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6z"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 012 0v3c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-3a1 1 0 012 0v2h12zM11 6.4L8.7 8.7a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L13 6.4V16a1 1 0 01-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 110-24 12 12 0 010 24zm-8.7-5.3a11 11 0 0017.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7zM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13z" fill-rule="nonzero"/></svg>',"vertical-align":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="18" height="2" x="3" y="11" rx="1"/><path d="M12 2c.6 0 1 .4 1 1v4l2-1.3a1 1 0 011.2 1.5l-.1.1-4.1 3-4-3a1 1 0 011-1.7l2 1.5V3c0-.6.4-1 1-1zm0 11.8l4 2.9a1 1 0 01-1 1.7l-2-1.5V21c0 .5-.4 1-.9 1H12a1 1 0 01-1-1v-4l-2 1.3a1 1 0 01-1.2-.1l-.1-.1a1 1 0 01.1-1.3l.1-.1 4.1-3z"/></g></svg>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2zm-4 0v2a2 2 0 01-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 01-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 010 2v7a1 1 0 01-2 0V9h-1v7a1 1 0 01-2 0v-4a2.5 2.5 0 01-.2-5H15zM5 15v2H3v-2h2zm16 0v2h-2v-2h2zM5 11v2H3v-2h2zm16 0v2h-2v-2h2zM5 7v2H3V7h2zm16 0v2h-2V7h2zM5 3v2H3c0-1.1.9-2 2-2zm8 0v2h-2V3h2zm6 0a2 2 0 012 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z" fill-rule="evenodd"/></svg>',warning:'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6zM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-1-9a1 1 0 012 0v6a1 1 0 01-2 0V8zm-2 4a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-3-5a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>'}})},585:function(t,e){!function(){"use strict";var t,e,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},o=function(t){return function(e){return typeof e===t}},i=r("string"),u=r("object"),a=r("array"),c=o("boolean"),s=o("function"),l=o("number"),f=function(){},d=function(t){return function(){return t}},m=function(t){return t},g=function(t,e){return t===e},h=function(t){return function(e){return!t(e)}},p=d(!1),v=d(!0),b=function(){return y},y={fold:function(t,e){return t()},isSome:p,isNone:v,getOr:e=m,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:e,orThunk:t,map:b,each:f,bind:b,exists:p,forall:v,filter:function(){return b()},toArray:function(){return[]},toString:d("none()")},w=function(t){var e=d(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=Array.prototype.slice,S=Array.prototype.push,k=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},O=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},_=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},T=function(t,e,n){return O(t,(function(t,r){n=e(n,t,r)})),n},E=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()},A=function(t,e){return E(t,e,p)},D=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!a(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e}(k(t,e))},M=function(t){var e=C.call(t,0);return e.reverse(),e},R=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},N=function(t){return R(t,0)},z=function(t){return R(t,t.length-1)},B=function(){return(B=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};var P,I=function(){return L(0,0)},L=function(t,e){return{major:t,minor:e}},H={nu:L,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?I():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return L(r(1),r(2))}(t,n)},unknown:I},F=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()}(e.brands,(function(e){var n=e.brand.toLowerCase();return A(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:H.nu(parseInt(e.version,10),0)}}))}))},V=function(t,e){var n=String(e).toLowerCase();return A(t,(function(t){return t.search(n)}))},j=function(t,e){return-1!==t.indexOf(e)},U=(P=/^\s+|\s+$/g,function(t){return t.replace(P,"")}),W=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,q=function(t){return function(e){return j(e,t)}},G=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return j(t,"edge/")&&j(t,"chrome")&&j(t,"safari")&&j(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,W],search:function(t){return j(t,"chrome")&&!j(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return j(t,"msie")||j(t,"trident")}},{name:"Opera",versionRegexes:[W,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:q("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:q("firefox")},{name:"Safari",versionRegexes:[W,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(j(t,"safari")||j(t,"mobile/"))&&j(t,"applewebkit")}}],$=[{name:"Windows",search:q("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return j(t,"iphone")||j(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:q("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:q("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:q("linux"),versionRegexes:[]},{name:"Solaris",search:q("sunos"),versionRegexes:[]},{name:"FreeBSD",search:q("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:q("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],X={browsers:d(G),oses:d($)},K=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},Y={unknown:function(){return K({current:void 0,version:H.unknown()})},nu:K,edge:d("Edge"),chrome:d("Chrome"),ie:d("IE"),opera:d("Opera"),firefox:d("Firefox"),safari:d("Safari")},J=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},Q={unknown:function(){return J({current:void 0,version:H.unknown()})},nu:J,windows:d("Windows"),ios:d("iOS"),android:d("Android"),linux:d("Linux"),osx:d("OSX"),solaris:d("Solaris"),freebsd:d("FreeBSD"),chromeos:d("ChromeOS")},Z=function(t,e,n){var r=X.browsers(),o=X.oses(),i=e.bind((function(t){return F(r,t)})).orThunk((function(){return function(t,e){return V(t,e).map((function(t){var n=H.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(Y.unknown,Y.nu),u=function(t,e){return V(t,e).map((function(t){var n=H.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(Q.unknown,Q.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:d(o),isiPhone:d(i),isTablet:d(c),isPhone:d(s),isTouch:d(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:d(l),isDesktop:d(f)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}},tt=function(t){return window.matchMedia(t).matches},et=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}}((function(){return Z(navigator.userAgent,x.from(navigator.userAgentData),tt)})),nt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},rt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return nt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return nt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return nt(n)},fromDom:nt,fromPoint:function(t,e,n){return x.from(t.dom.elementFromPoint(e,n)).map(nt)}},ot=function(t,e){return t.dom===e.dom},it=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},ut=function(t,e){return et().browser.isIE()?it(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},at=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},ct=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),st=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),lt=tinymce.util.Tools.resolve("tinymce.util.VK"),ft=Object.keys,dt=function(t,e){for(var n=ft(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},mt=function(t,e){var n={};return function(t,e,n,r){dt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),f),n};"undefined"!=typeof window?window:Function("return this;")();var gt,ht=function(t){return t.dom.nodeName.toLowerCase()},pt=(gt=1,function(t){return function(t){return t.dom.nodeType}(t)===gt}),vt=function(t){return function(e){return pt(e)&&ht(e)===t}},bt=function(t,e){var n=t.dom;dt(e,(function(t,e){!function(t,e,n){if(!(i(n)||c(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(n,e,t)}))},yt=function(t){return T(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},wt=function(t){return x.from(t.dom.parentNode).map(rt.fromDom)},xt=function(t){return k(t.dom.childNodes,rt.fromDom)},Ct=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(rt.fromDom)},St=function(t){return Ct(t,0)},kt=function(t){return Ct(t,t.dom.childNodes.length-1)},Ot=function(t,e){wt(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},_t=function(t,e){t.dom.appendChild(e.dom)},Tt=function(t,e){O(e,(function(e){_t(t,e)}))},Et=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},At=function(t){return function(t,e){return rt.fromDom(t.dom.cloneNode(e))}(t,!0)},Dt=function(t,e){var n=function(t,e){var n=rt.fromTag(e),r=yt(t);return bt(n,r),n}(t,e);Ot(t,n);var r=xt(t);return Tt(n,r),Et(t),n},Mt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Rt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Nt=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},zt=function(t){return function(e){return e&&t.test(e.nodeName)}},Bt=function(t){return t&&3===t.nodeType},Pt=zt(/^(OL|UL|DL)$/),It=zt(/^(OL|UL)$/),Lt=Nt("ol"),Ht=zt(/^(LI|DT|DD)$/),Ft=zt(/^(DT|DD)$/),Vt=zt(/^(TH|TD)$/),jt=Nt("br"),Ut=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},Wt=function(t,e){return t&&t.nodeName in e},qt=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},Gt=function(t,e){return t.isChildOf(e,t.getRoot())},$t=function(t,e){var n,r,o,i=t.dom,u=t.schema.getBlockElements(),a=i.createFragment(),c=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e}(t);if(c&&((r=i.create(c)).tagName===c.toUpperCase()&&i.setAttribs(r,function(t){return t.getParam("forced_root_block_attrs",{})}(t)),Wt(e.firstChild,u)||a.appendChild(r)),e)for(;n=e.firstChild;){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),Wt(n,u)?(a.appendChild(n),r=null):c?(r||(r=i.create(c),a.appendChild(r)),r.appendChild(n)):a.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):a.appendChild(i.create("br")),a},Xt=Mt.DOM,Kt=vt("dd"),Yt=vt("dt"),Jt=function(t,e){Kt(e)?Dt(e,"dt"):Yt(e)&&wt(e).each((function(n){return function(t,e,n){var r=Xt.select('span[data-mce-type="bookmark"]',e),o=$t(t,n),i=Xt.createRng();i.setStartAfter(n),i.setEndAfter(e);for(var u,a=i.extractContents(),c=a.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){Xt.remove(c);break}t.dom.isEmpty(a)||Xt.insertAfter(a,e),Xt.insertAfter(o,e),qt(t.dom,n.parentNode)&&(u=n.parentNode,Rt.each(r,(function(t){u.parentNode.insertBefore(t,n.parentNode)})),Xt.remove(u)),Xt.remove(n),qt(t.dom,e)&&Xt.remove(e)}(t,n.dom,e.dom)}))},Qt=function(t){Yt(t)&&Dt(t,"dd")},Zt=function(t,e){if(Bt(t))return{container:t,offset:e};var n=ct.getNode(t,e);return Bt(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&Bt(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&Bt(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},te=function(t){var e=t.cloneRange(),n=Zt(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=Zt(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},ee=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),ne=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",ie(t,n))},re=function(t){var e=ne(t),n=t.selection.getSelectedBlocks();return function(t,e){return t&&1===e.length&&e[0]===t}(e,n)?function(t){return _(t.querySelectorAll("ol,ul,dl"),Pt)}(e):_(n,(function(t){return Pt(t)&&e!==t}))},oe=function(t){var e=t.selection.getSelectedBlocks();return _(function(t,e){var n=Rt.map(e,(function(e){var n=t.dom.getParent(e,"li,dd,dt",ie(t,e));return n||e}));return ee.unique(n)}(t,e),Ht)},ie=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},ue=function(t,e){var n=t.dom.getParents(e,"ol,ul",ie(t,e));return z(n)},ae=function(t){var e=function(t){var e=ue(t,t.selection.getStart()),n=_(t.selection.getSelectedBlocks(),It);return e.toArray().concat(n)}(t);return ce(t,e)},ce=function(t,e){var n=k(e,(function(e){return ue(t,e).getOr(e)}));return ee.unique(n)},se=function(t,e,n){return void 0===n&&(n=g),t.exists((function(t){return n(t,e)}))},le=function(t,e,n){return t.isSome()&&e.isSome()?x.some(n(t.getOrDie(),e.getOrDie())):x.none()},fe=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},de=function(t,e,n){if(!i(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);(function(t){return void 0!==t.style&&s(t.style.getPropertyValue)})(t)&&t.style.setProperty(e,n)},me=function(t,e){_t(t.item,e.list)},ge=function(t,e){var n={list:rt.fromTag(e,t),item:rt.fromTag("li",t)};return _t(n.list,n.item),n},he=function(t,e,n){var r=e.slice(0,n.depth);return z(r).each((function(e){!function(t,e){_t(t.list,e),t.item=e}(e,function(t,e,n){var r=rt.fromTag("li",t);return bt(r,e),Tt(r,n),r}(t,n.itemAttributes,n.content)),function(t,e){ht(t.list)!==e.listType&&(t.list=Dt(t.list,e.listType)),bt(t.list,e.listAttributes)}(e,n)})),r},pe=function(t,e,n){var r,o=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(ge(t,e.listType));return r}(t,n,n.depth-e.length);return function(t){for(var e=1;e<t.length;e++)me(t[e-1],t[e])}(o),function(t,e){for(var n=0;n<t.length-1;n++)r=t[n].item,o="list-style-type",i="none",u=void 0,u=r.dom,de(u,o,i);var r,o,i,u;z(t).each((function(t){bt(t.list,e.listAttributes),bt(t.item,e.itemAttributes),Tt(t.item,e.content)}))}(o,n),r=o,le(z(e),N(r),me),e.concat(o)},ve=function(t){return at(t,"OL,UL")},be=function(t){return St(t).exists(ve)},ye=function(t){return t.depth>0},we=function(t){return t.isSelected},xe=function(t){var e=xt(t),n=kt(t).exists(ve)?e.slice(0,-1):e;return k(n,At)},Ce=function(t){return O(t,(function(e,n){(function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return E(M(t.slice(0,e)),r,o).orThunk((function(){return E(t.slice(e+1),r,o)}))})(t,n).fold((function(){e.dirty&&function(t){t.listAttributes=mt(t.listAttributes,(function(t,e){return"start"!==e}))}(e)}),(function(t){return r=t,(n=e).listType=r.listType,void(n.listAttributes=B({},r.listAttributes));var n,r}))})),t},Se=function(t,e,n,r){return St(r).filter(ve).fold((function(){e.each((function(t){ot(t.start,r)&&n.set(!0)}));var o=function(t,e,n){return wt(t).filter(pt).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:xe(t),itemAttributes:yt(t),listAttributes:yt(r),listType:ht(r)}}))}(r,t,n.get());e.each((function(t){ot(t.end,r)&&n.set(!1)}));var i=kt(r).filter(ve).map((function(r){return ke(t,e,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return ke(t,e,n,r)}))},ke=function(t,e,n,r){return D(xt(r),(function(r){return(ve(r)?ke:Se)(t+1,e,n,r)}))},Oe=function(t,e){var n=Ce(e);return k(n,(function(e){var n,r,o,i=(n=e.content,o=(r||document).createDocumentFragment(),O(n,(function(t){o.appendChild(t.dom)})),rt.fromDom(o));return rt.fromDom($t(t,i.dom))}))},_e=function(t,e){var n=Ce(e);return function(t,e){var n=T(e,(function(e,n){return n.depth>e.length?pe(t,e,n):he(t,e,n)}),[]);return N(n).map((function(t){return t.list}))}(t.contentDocument,n).toArray()},Te=function(t,e,n){var r=function(t,e){var n,r=(n=!1,{get:function(){return n},set:function(t){n=t}});return k(t,(function(t){return{sourceList:t,entries:ke(0,e,r,t)}}))}(e,function(t){var e=k(oe(t),rt.fromDom);return le(A(e,h(be)),A(M(e),h(be)),(function(t,e){return{start:t,end:e}}))}(t));O(r,(function(e){!function(t,e){O(_(t,we),(function(t){return function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0}(e,t)}))}(e.entries,n);var r,o=function(t,e){return D(function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}(e,ye),(function(e){return N(e).exists(ye)?_e(t,e):Oe(t,e)}))}(t,e.entries);O(o,(function(e){fe(t,"Indent"===n?"IndentList":"OutdentList",e.dom)})),r=e.sourceList,O(o,(function(t){Ot(r,t)})),Et(e.sourceList)}))},Ee=function(t,e){var n=k(ae(t),rt.fromDom),r=k(function(t){return _(oe(t),Ft)}(t),rt.fromDom),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();Te(t,n,e),function(t,e,n){O(n,"Indent"===e?Qt:function(e){return Jt(t,e)})}(t,e,r),t.selection.moveToBookmark(i),t.selection.setRng(te(t.selection.getRng())),t.nodeChanged(),o=!0}return o},Ae=function(t){return Ee(t,"Indent")},De=function(t){return Ee(t,"Outdent")},Me=function(t){return Ee(t,"Flatten")},Re=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Ne=Mt.DOM,ze=function(t){var e={},n=function(n){var r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"];if(1===r.nodeType){var i=Ne.create("span",{"data-mce-type":"bookmark"});r.hasChildNodes()?(o=Math.min(o,r.childNodes.length-1),n?r.insertBefore(i,r.childNodes[o]):Ne.insertAfter(i,r.childNodes[o])):r.appendChild(i),r=i,o=0}e[n?"startContainer":"endContainer"]=r,e[n?"startOffset":"endOffset"]=o};return n(!0),t.collapsed||n(),e},Be=function(t){var e=function(e){var n,r=n=t[e?"startContainer":"endContainer"],o=t[e?"startOffset":"endOffset"];r&&(1===r.nodeType&&(o=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(r),r=r.parentNode,Ne.remove(n),!r.hasChildNodes()&&Ne.isBlock(r)&&r.appendChild(Ne.create("br"))),t[e?"startContainer":"endContainer"]=r,t[e?"startOffset":"endOffset"]=o)};e(!0),e();var n=Ne.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),te(n)},Pe=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Ie=function(t){return/\btox\-/.test(t.className)},Le=function(t,e,n){var r=function(t){var r=E(t.parents,Pt,Vt).filter((function(t){return t.nodeName===e&&!Ie(t)})).isSome();n(r)},o=t.dom.getParents(t.selection.getNode());return r({parents:o}),t.on("NodeChange",r),function(){return t.off("NodeChange",r)}},He=function(t,e){Rt.each(e,(function(e,n){t.setAttribute(n,e)}))},Fe=function(t,e,n){!function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)}(t,e,n),function(t,e,n){He(e,n["list-attributes"]),Rt.each(t.select("li",e),(function(t){He(t,n["list-item-attributes"])}))}(t,e,n)},Ve=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&jt(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Ut(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},je=function(t,e,n){var r=t.selection.getRng(),o="LI",i=ie(t,t.selection.getStart(!0)),u=t.dom;if("false"!==u.getContentEditable(t.selection.getNode())){"DL"===(e=e.toUpperCase())&&(o="DT");var a=ze(r),c=function(t,e,n){for(var r,o=[],i=t.dom,u=Ve(t,e,!0,n),a=Ve(t,e,!1,n),c=[],s=u;s&&(c.push(s),s!==a);s=s.nextSibling);return Rt.each(c,(function(e){if(Ut(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||jt(e))return jt(e)&&i.remove(e),void(r=null);var u=e.nextSibling;Re.isBookmarkNode(e)&&(Pt(u)||Ut(t,u)||!u&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))})),o}(t,r,i);Rt.each(c,(function(r){var i,a=r.previousSibling,c=r.parentNode;Ht(c)||(a&&Pt(a)&&a.nodeName===e&&function(t,e,n){var r=t.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return r===(o=null===o?"":o)}(u,a,n)?(i=a,r=u.rename(r,o),a.appendChild(r)):(i=u.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=u.rename(r,o)),function(t,e,n){Rt.each(n,(function(n){var r;return t.setStyle(e,((r={})[n]="",r))}))}(u,r,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),Fe(u,i,n),We(t.dom,i))})),t.selection.setRng(Be(a))}},Ue=function(t,e,n){return function(t,e){return t&&e&&Pt(t)&&t.nodeName===e.nodeName}(e,n)&&function(t,e,n){return t.getStyle(e,"list-style-type",!0)===t.getStyle(n,"list-style-type",!0)}(t,e,n)&&(r=n,e.className===r.className);var r},We=function(t,e){var n,r;if(n=e.nextSibling,Ue(t,e,n)){for(;r=n.firstChild;)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,Ue(t,e,n)){for(;r=n.lastChild;)e.insertBefore(r,e.firstChild);t.remove(n)}},qe=function(t,e,n,r,o){var i=Pt(e);if(i&&e.nodeName===r&&!Ge(o))Me(t);else{je(t,r,o);var u=ze(t.selection.getRng()),a=i?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([e],n,!0):n;Rt.each(a,(function(e){!function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);Fe(t.dom,o,r),fe(t,Pe(n),o)}else Fe(t.dom,e,r),fe(t,Pe(n),e)}(t,e,r,o)})),t.selection.setRng(Be(u))}},Ge=function(t){return"list-style-type"in t},$e=function(t,e,n){var r=ne(t),o=re(t),i=u(n)?n:{};o.length>0?qe(t,r,o,e,i):function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||Ge(r)||Ie(e)){var o=ze(t.selection.getRng());Fe(t.dom,e,r);var i=t.dom.rename(e,n);We(t.dom,i),t.selection.setRng(Be(o)),je(t,n,r),fe(t,Pe(n),i)}else Me(t);else je(t,n,r),fe(t,Pe(n),e)}(t,r,e,i)},Xe=Mt.DOM,Ke=function(t,e){var n=Rt.grep(t.select("ol,ul",e));Rt.each(n,(function(e){!function(t,e){var n,r=e.parentNode;"LI"===r.nodeName&&r.firstChild===e&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(e),qt(t,r)&&Xe.remove(r)):Xe.setStyle(r,"listStyleType","none"));Pt(r)&&((n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(e))}(t,e)}))},Ye=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(Bt(o)&&(n?i<o.data.length:i>0))return o;var u=t.schema.getNonEmptyElements();1===o.nodeType&&(o=ct.getNode(o,i));var a=new st(o,r);for(n&&function(t,e){return!!jt(e)&&(t.isBlock(e.nextSibling)&&!jt(e.previousSibling))}(t.dom,o)&&a.next();o=a[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(Bt(o)&&o.data.length>0)return o}},Je=function(t,e){var n=e.childNodes;return 1===n.length&&!Pt(n[0])&&t.isBlock(n[0])},Qe=function(t,e,n){var r,o=Je(t,n)?n.firstChild:n;if(function(t,e){Je(t,e)&&t.remove(e.firstChild,!0)}(t,e),!qt(t,e,!0))for(;r=e.firstChild;)o.appendChild(r)},Ze=function(t,e,n){var r,o=e.parentNode;if(Gt(t,e)&&Gt(t,n)){Pt(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&jt(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&jt(i)&&e.hasChildNodes()&&t.remove(i),qt(t,n,!0)&&t.$(n).empty(),Qe(t,e,n),r&&n.appendChild(r);var u=ut(rt.fromDom(n),rt.fromDom(e))?t.getParents(e,Pt,n):[];t.remove(e),O(u,(function(e){qt(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},tn=function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))!function(t,e,n){t.dom.$(n).empty(),Ze(t.dom,e,n),t.selection.setCursorLocation(n,0)}(t,n,r);else{var i=ze(e);Ze(o,n,r),t.selection.setRng(Be(i))}},en=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=ie(t,o),u=n.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===t.getBody()&&qt(n,a))return!0;var c=te(r.getRng()),s=n.getParent(Ye(t,c,e,i),"LI",i);if(s&&s!==u)return t.undoManager.transact((function(){var n;e?tn(t,c,s,u):(n=u).parentNode.firstChild===n?De(t):function(t,e,n,r){var o=ze(e);Ze(t.dom,n,r);var i=Be(o);t.selection.setRng(i)}(t,c,u,s)})),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){Me(t)})),!0}return!1},nn=function(t,e){return en(t,e)||function(t,e){var n=t.dom,r=t.selection.getStart(),o=ie(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var u=te(t.selection.getRng()),a=n.getParent(Ye(t,u,e,o),"LI",o);if(a)return t.undoManager.transact((function(){!function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)}(n,i,o),We(n,a.parentNode),t.selection.select(a,!0),t.selection.collapse(e)})),!0}return!1}(t,e)},rn=function(t,e){return t.selection.isCollapsed()?nn(t,e):function(t){var e=t.selection.getStart(),n=ie(t,e);return!!(t.dom.getParent(e,"LI,DT,DD",n)||oe(t).length>0)&&(t.undoManager.transact((function(){t.execCommand("Delete"),Ke(t.dom,t.getBody())})),!0)}(t)},on=function(t){var e=M(U(t).split("")),n=k(e,(function(t,e){var n=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,e)*n}));return T(n,(function(t,e){return t+e}),0)},un=function(t){if(--t<0)return"";var e=t%26,n=Math.floor(t/26);return un(n)+String.fromCharCode("A".charCodeAt(0)+e)},an=function(t){var e,n,r=ne(t);Lt(r)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:(e={start:t.dom.getAttrib(r,"start","1"),listStyleType:x.some(t.dom.getStyle(r,"list-style-type"))},n=parseInt(e.start,10),se(e.listStyleType,"upper-alpha")?un(n):se(e.listStyleType,"lower-alpha")?un(n).toLowerCase():e.start)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){(function(t){switch(function(t){return/^[0-9]+$/.test(t)?2:function(t){return/^[A-Z]+$/.test(t)}(t)?0:function(t){return/^[a-z]+$/.test(t)}(t)?1:function(t){return t.length>0}(t)?4:3}(t)){case 2:return x.some({listStyleType:x.none(),start:t});case 0:return x.some({listStyleType:x.some("upper-alpha"),start:on(t).toString()});case 1:return x.some({listStyleType:x.some("lower-alpha"),start:on(t).toString()});case 3:return x.some({listStyleType:x.none(),start:""});case 4:return x.none()}})(e.getData().start).each((function(e){t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===e.start?"":e.start},styles:{"list-style-type":e.listStyleType.getOr("")}})})),e.close()}})},cn=function(t,e){return function(){var n=ne(t);return n&&n.nodeName===e}},sn=function(t){t.addCommand("mceListProps",(function(){an(t)}))},ln=function(t){t.on("BeforeExecCommand",(function(e){var n=e.command.toLowerCase();"indent"===n?Ae(t):"outdent"===n&&De(t)})),t.addCommand("InsertUnorderedList",(function(e,n){$e(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){$e(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){$e(t,"DL",n)})),t.addCommand("RemoveList",(function(){Me(t)})),sn(t),t.addCommand("mceListUpdate",(function(e,n){u(n)&&function(t,e){var n=ne(t);t.undoManager.transact((function(){u(e.styles)&&t.dom.setStyles(n,e.styles),u(e.attrs)&&dt(e.attrs,(function(e,r){return t.dom.setAttrib(n,r,e)}))}))}(t,n)})),t.addQueryStateHandler("InsertUnorderedList",cn(t,"UL")),t.addQueryStateHandler("InsertOrderedList",cn(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",cn(t,"DL"))},fn=function(t){(function(t){return t.getParam("lists_indent_on_tab",!0)})(t)&&function(t){t.on("keydown",(function(e){e.keyCode!==lt.TAB||lt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?De(t):Ae(t))&&e.preventDefault()}))}))}(t),function(t){t.on("keydown",(function(e){e.keyCode===lt.BACKSPACE?rn(t,!1)&&e.preventDefault():e.keyCode===lt.DELETE&&rn(t,!0)&&e.preventDefault()}))}(t)};n.add("lists",(function(t){return!1===t.hasPlugin("rtc",!0)?(fn(t),ln(t)):sn(t),function(t){var e=function(e){return function(){return t.execCommand(e)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return Le(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return Le(t,"UL",e.setActive)}}))}(t),function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return t.execCommand("mceListProps")},onSetup:function(e){return Le(t,"OL",(function(t){return e.setDisabled(!t)}))}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=ne(t,e);return Lt(n)?["listprops"]:[]}})}(t),function(t){return{backspaceDelete:function(e){rn(t,e)}}}(t)}))}()},586:function(t,e){!function(){"use strict";var t=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},e=function(t){return function(e){return typeof e===t}},n=function(t){return function(e){return t===e}},r=t("string"),o=t("object"),i=t("array"),u=n(null),a=e("boolean"),c=n(void 0),s=function(t){return!function(t){return null==t}(t)},l=e("function"),f=e("number"),d=function(){},m=function(t){return function(){return t}},g=function(t){return t},h=function(t,e){return t===e};function p(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var v,b,y=function(t){return function(e){return!t(e)}},w=m(!1),x=m(!0),C=function(){return S},S={fold:function(t,e){return t()},isSome:w,isNone:x,getOr:b=g,getOrThunk:v=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(void 0),or:b,orThunk:v,map:C,each:d,bind:C,exists:w,forall:x,filter:function(){return C()},toArray:function(){return[]},toString:m("none()")},k=function(t){var e=m(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:x,isNone:w,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return k(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:S},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},O={some:k,none:C,from:function(t){return null==t?S:k(t)}},_=Array.prototype.slice,T=Array.prototype.indexOf,E=Array.prototype.push,A=function(t,e){return n=t,r=e,T.call(n,r)>-1;var n,r},D=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},M=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},R=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},N=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},z=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},B=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},P=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}}(t,(function(t,r){n=e(n,t,r)})),n},I=function(t,e,n){return N(t,(function(t,r){n=e(n,t,r)})),n},L=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return O.some(i);if(n(i,r))break}return O.none()}(t,e,w)},H=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return O.some(n)}return O.none()},F=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!i(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);E.apply(e,t[n])}return e},V=function(t,e){return F(R(t,e))},j=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},U=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},W=function(t){return[t]},q=function(t,e){return e>=0&&e<t.length?O.some(t[e]):O.none()},G=function(t){return q(t,0)},$=function(t){return q(t,t.length-1)},X=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return O.none()},K=function(){return(K=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Y(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var J=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Q=function(){return Z(0,0)},Z=function(t,e){return{major:t,minor:e}},tt={nu:Z,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Q():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Z(r(1),r(2))}(t,n)},unknown:Q},et=function(t,e){var n=String(e).toLowerCase();return L(t,(function(t){return t.search(n)}))},nt=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},rt=function(t,e){return-1!==t.indexOf(e)},ot=function(t,e){return nt(t,e,0)},it=function(t,e){return nt(t,e,t.length-e.length)},ut=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),at=function(t){return t.length>0},ct=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,st=function(t){return function(e){return rt(e,t)}},lt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return rt(t,"edge/")&&rt(t,"chrome")&&rt(t,"safari")&&rt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ct],search:function(t){return rt(t,"chrome")&&!rt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return rt(t,"msie")||rt(t,"trident")}},{name:"Opera",versionRegexes:[ct,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:st("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:st("firefox")},{name:"Safari",versionRegexes:[ct,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(rt(t,"safari")||rt(t,"mobile/"))&&rt(t,"applewebkit")}}],ft=[{name:"Windows",search:st("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return rt(t,"iphone")||rt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:st("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:st("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:st("linux"),versionRegexes:[]},{name:"Solaris",search:st("sunos"),versionRegexes:[]},{name:"FreeBSD",search:st("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:st("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],dt={browsers:m(lt),oses:m(ft)},mt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},gt={unknown:function(){return mt({current:void 0,version:tt.unknown()})},nu:mt,edge:m("Edge"),chrome:m("Chrome"),ie:m("IE"),opera:m("Opera"),firefox:m("Firefox"),safari:m("Safari")},ht=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},pt={unknown:function(){return ht({current:void 0,version:tt.unknown()})},nu:ht,windows:m("Windows"),ios:m("iOS"),android:m("Android"),linux:m("Linux"),osx:m("OSX"),solaris:m("Solaris"),freebsd:m("FreeBSD"),chromeos:m("ChromeOS")},vt=function(t,e,n){var r=dt.browsers(),o=dt.oses(),i=e.bind((function(t){return function(t,e){return X(e.brands,(function(e){var n=e.brand.toLowerCase();return L(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:tt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return et(t,e).map((function(t){var n=tt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(gt.unknown,gt.nu),u=function(t,e){return et(t,e).map((function(t){var n=tt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(pt.unknown,pt.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:m(o),isiPhone:m(i),isTablet:m(c),isPhone:m(s),isTouch:m(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:m(l),isDesktop:m(f)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}},bt=function(t){return window.matchMedia(t).matches},yt=J((function(){return vt(navigator.userAgent,O.from(navigator.userAgentData),bt)})),wt=function(){return yt()},xt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Ct={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return xt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return xt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return xt(n)},fromDom:xt,fromPoint:function(t,e,n){return O.from(t.dom.elementFromPoint(e,n)).map(xt)}},St=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},kt=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Ot=function(t,e){var n=void 0===e?document:e.dom;return kt(n)?O.none():O.from(n.querySelector(t)).map(Ct.fromDom)},_t=function(t,e){return t.dom===e.dom},Tt=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},Et=function(t,e){return wt().browser.isIE()?Tt(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},At=St,Dt=Object.keys,Mt=Object.hasOwnProperty,Rt=function(t,e){for(var n=Dt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Nt=function(t,e){return zt(t,(function(t,n){return{k:n,v:e(t,n)}}))},zt=function(t,e){var n={};return Rt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Bt=function(t,e){var n={};return function(t,e,n,r){Rt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),d),n},Pt=function(t,e){var n=[];return Rt(t,(function(t,r){n.push(e(t,r))})),n},It=function(t){return Pt(t,g)},Lt=function(t){return Dt(t).length},Ht=function(t,e){return Ft(t,e)?O.from(t[e]):O.none()},Ft=function(t,e){return Mt.call(t,e)},Vt=function(t,e){return Ft(t,e)&&void 0!==t[e]&&null!==t[e]},jt=["tfoot","thead","tbody","colgroup"],Ut=function(t,e,n){return{element:t,rowspan:e,colspan:n}},Wt=function(t,e,n){return{element:t,cells:e,section:n}},qt=function(t,e,n){return{element:t,isNew:e,isLocked:n}},Gt=function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}};"undefined"!=typeof window?window:Function("return this;")();var $t=function(t){return t.dom.nodeName.toLowerCase()},Xt=function(t){return t.dom.nodeType},Kt=function(t){return function(e){return Xt(e)===t}},Yt=function(t){return 8===Xt(t)||"#comment"===$t(t)},Jt=Kt(1),Qt=Kt(3),Zt=Kt(9),te=Kt(11),ee=function(t){return function(e){return Jt(e)&&$t(e)===t}},ne=function(t){return Ct.fromDom(t.dom.ownerDocument)},re=function(t){return Zt(t)?t:ne(t)},oe=function(t){return O.from(t.dom.parentNode).map(Ct.fromDom)},ie=function(t,e){for(var n=l(e)?e:w,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=Ct.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},ue=function(t){return O.from(t.dom.previousSibling).map(Ct.fromDom)},ae=function(t){return O.from(t.dom.nextSibling).map(Ct.fromDom)},ce=function(t){return R(t.dom.childNodes,Ct.fromDom)},se=function(t,e){var n=t.dom.childNodes;return O.from(n[e]).map(Ct.fromDom)},le=l(Element.prototype.attachShadow)&&l(Node.prototype.getRootNode),fe=m(le),de=le?function(t){return Ct.fromDom(t.dom.getRootNode())}:re,me=function(t){var e,n=de(t);return te(e=n)&&s(e.dom.host)?O.some(n):O.none()},ge=function(t){return Ct.fromDom(t.dom.host)},he=function(t){return s(t.dom.shadowRoot)},pe=function(t){var e=Qt(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return me(Ct.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=pe,r=ge,function(t){return n(r(t))}))},ve=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return Ct.fromDom(e)},be=function(t,e){var n=[];return N(ce(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(be(t,e))})),n},ye=function(t,e,n){return function(t,e,n){return B(ie(t,n),e)}(t,(function(t){return St(t,e)}),n)},we=function(t,e){return function(t,e){return B(ce(t),e)}(t,(function(t){return St(t,e)}))},xe=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return kt(n)?[]:R(n.querySelectorAll(t),Ct.fromDom)}(e,t)};function Ce(t,e,n,r,o){return t(n,r)?O.some(n):l(o)&&o(n)?O.none():e(n,r,o)}var Se=function(t,e,n){for(var r=t.dom,o=l(n)?n:w;r.parentNode;){r=r.parentNode;var i=Ct.fromDom(r);if(e(i))return O.some(i);if(o(i))break}return O.none()},ke=function(t,e,n){return Se(t,(function(t){return St(t,e)}),n)},Oe=function(t,e){return function(t,e){return L(t.dom.childNodes,(function(t){return e(Ct.fromDom(t))})).map(Ct.fromDom)}(t,(function(t){return St(t,e)}))},_e=function(t,e){return Ot(e,t)},Te=function(t,e,n){return Ce((function(t,e){return St(t,e)}),ke,t,e,n)},Ee=function(t,e,n){if(!(r(n)||a(n)||f(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Ae=function(t,e,n){Ee(t.dom,e,n)},De=function(t,e){var n=t.dom;Rt(e,(function(t,e){Ee(n,e,t)}))},Me=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Re=function(t,e){return O.from(Me(t,e))},Ne=function(t,e){t.dom.removeAttribute(e)},ze=function(t){return I(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Be=function(t,e,n){return void 0===n&&(n=h),t.exists((function(t){return n(t,e)}))},Pe=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},Ie=function(t,e,n){return t.isSome()&&e.isSome()?O.some(n(t.getOrDie(),e.getOrDie())):O.none()},Le=function(t,e){return t?O.some(e):O.none()},He=function(t){return void 0!==t.style&&l(t.style.getPropertyValue)},Fe=function(t,e,n){if(!r(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);He(t)&&t.style.setProperty(e,n)},Ve=function(t,e,n){var r=t.dom;Fe(r,e,n)},je=function(t,e){var n=t.dom;Rt(e,(function(t,e){Fe(n,e,t)}))},Ue=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||pe(t)?r:We(n,e)},We=function(t,e){return He(t)?t.style.getPropertyValue(e):""},qe=function(t,e){var n=t.dom,r=We(n,e);return O.from(r).filter((function(t){return t.length>0}))},Ge=function(t,e){!function(t,e){He(t)&&t.style.removeProperty(e)}(t.dom,e),Be(Re(t,"style").map(ut),"")&&Ne(t,"style")},$e=function(t,e,n){return void 0===n&&(n=0),Re(t,e).map((function(t){return parseInt(t,10)})).getOr(n)},Xe=function(t,e){return $e(t,e,1)},Ke=function(t){return ee("col")(t)?$e(t,"span",1)>1:Xe(t,"colspan")>1},Ye=function(t){return Xe(t,"rowspan")>1},Je=function(t,e){return parseInt(Ue(t,e),10)},Qe=m(10),Ze=m(10),tn=function(t,e){return en(t,e,x)},en=function(t,e,n){return V(ce(t),(function(t){return St(t,e)?n(t)?[t]:[]:en(t,e,n)}))},nn=function(t,e){return function(t,e,n){if(void 0===n&&(n=w),n(e))return O.none();if(A(t,$t(e)))return O.some(e);return ke(e,t.join(","),(function(t){return St(t,"table")||n(t)}))}(["td","th"],t,e)},rn=function(t){return tn(t,"th,td")},on=function(t){return St(t,"colgroup")?we(t,"col"):V(cn(t),(function(t){return we(t,"col")}))},un=function(t,e){return Te(t,"table",e)},an=function(t){return tn(t,"tr")},cn=function(t){return un(t).fold(m([]),(function(t){return we(t,"colgroup")}))},sn=function(t,e){return R(t,(function(t){if("colgroup"===$t(t)){var n=R(on(t),(function(t){var e=$e(t,"span",1);return Ut(t,1,e)}));return Wt(t,n,"colgroup")}n=R(rn(t),(function(t){var e=$e(t,"rowspan",1),n=$e(t,"colspan",1);return Ut(t,e,n)}));return Wt(t,n,e(t))}))},ln=function(t){return oe(t).map((function(t){var e=$t(t);return function(t){return A(jt,t)}(e)?e:"tbody"})).getOr("tbody")},fn=function(t){var e=an(t),n=Y(Y([],cn(t),!0),e,!0);return sn(n,ln)},dn=function(t,e,n){var r=t.cells,o=r.slice(0,e),i=r.slice(e),u=o.concat(n).concat(i);return hn(t,u)},mn=function(t,e,n){return dn(t,e,[n])},gn=function(t,e,n){t.cells[e]=n},hn=function(t,e){return Gt(t.element,e,t.section,t.isNew)},pn=function(t,e){return t.cells[e]},vn=function(t,e){return pn(t,e).element},bn=function(t){return t.cells.length},yn=function(t){var e=z(t,(function(t){return"colgroup"===t.section}));return{rows:e.fail,cols:e.pass}},wn=function(t,e,n){var r=R(t.cells,n);return Gt(e(t.element),r,t.section,!0)},xn="data-snooker-locked-cols",Cn=function(t){return Re(t,xn).bind((function(t){return O.from(t.match(/\d+/g))})).map((function(t){return U(t,x)}))},Sn=function(t){var e=I(yn(t).rows,(function(t,e){return N(e.cells,(function(e,n){e.isLocked&&(t[n]=!0)})),t}),{});return function(t,e){var n=_.call(t,0);return n.sort(e),n}(Pt(e,(function(t,e){return parseInt(e,10)})))},kn=function(t,e){return t+","+e},On=function(t,e){var n=V(t.all,(function(t){return t.cells}));return B(n,e)},_n=function(t){var e={},n=[],r=G(t).map((function(t){return t.element})).bind(un).bind(Cn).getOr({}),o=0,i=0,u=0,a=z(t,(function(t){return"colgroup"===t.section})),c=a.pass,s=a.fail;N(s,(function(t){var a=[];N(t.cells,(function(t){for(var n=0;void 0!==e[kn(u,n)];)n++;for(var o=Vt(r,n.toString()),c=function(t,e,n,r,o,i){return{element:t,rowspan:e,colspan:n,row:r,column:o,isLocked:i}}(t.element,t.rowspan,t.colspan,u,n,o),s=0;s<t.colspan;s++)for(var l=0;l<t.rowspan;l++){var f=n+s,d=kn(u+l,f);e[d]=c,i=Math.max(i,f+1)}a.push(c)})),o++,n.push(Wt(t.element,a,t.section)),u++}));var l=$(c).map((function(t){var e=function(t){var e={},n=0;return N(t.cells,(function(t){var r=t.colspan;M(r,(function(o){var i=n+o;e[i]=function(t,e,n){return{element:t,colspan:e,column:n}}(t.element,r,i)})),n+=r})),e}(t);return{colgroups:[function(t,e){return{element:t,columns:e}}(t.element,It(e))],columns:e}})).getOrThunk((function(){return{colgroups:[],columns:{}}})),f=l.columns,d=l.colgroups;return{grid:function(t,e){return{rows:t,columns:e}}(o,i),access:e,all:n,columns:f,colgroups:d}},Tn={fromTable:function(t){var e=fn(t);return _n(e)},generate:_n,getAt:function(t,e,n){return O.from(t.access[kn(e,n)])},findItem:function(t,e,n){var r=On(t,(function(t){return n(e,t.element)}));return r.length>0?O.some(r[0]):O.none()},filterItems:On,justCells:function(t){return V(t.all,(function(t){return t.cells}))},justColumns:function(t){return It(t.columns)},hasColumns:function(t){return Dt(t.columns).length>0},getColumnAt:function(t,e){return O.from(t.columns[e])}},En=function(t,e){var n=e.column,r=e.column+e.colspan-1,o=e.row,i=e.row+e.rowspan-1;return n<=t.finishCol&&r>=t.startCol&&o<=t.finishRow&&i>=t.startRow},An=function(t,e){return e.column>=t.startCol&&e.column+e.colspan-1<=t.finishCol&&e.row>=t.startRow&&e.row+e.rowspan-1<=t.finishRow},Dn=function(t,e,n){var r=Tn.findItem(t,e,_t),o=Tn.findItem(t,n,_t);return r.bind((function(t){return o.map((function(e){return n=t,r=e,o=Math.min(n.row,r.row),i=Math.min(n.column,r.column),u=Math.max(n.row+n.rowspan-1,r.row+r.rowspan-1),a=Math.max(n.column+n.colspan-1,r.column+r.colspan-1),{startRow:o,startCol:i,finishRow:u,finishCol:a};var n,r,o,i,u,a}))}))},Mn=function(t,e,n){return Dn(t,e,n).bind((function(e){return function(t,e){for(var n=!0,r=p(An,e),o=e.startRow;o<=e.finishRow;o++)for(var i=e.startCol;i<=e.finishCol;i++)n=n&&Tn.getAt(t,o,i).exists(r);return n?O.some(e):O.none()}(t,e)}))},Rn=function(t,e,n){return Dn(t,e,n).map((function(e){var n=Tn.filterItems(t,p(En,e));return R(n,(function(t){return t.element}))}))},Nn=function(t,e){return Tn.findItem(t,e,(function(t,e){return Et(e,t)})).map((function(t){return t.element}))},zn=function(t,e,n){return un(t).bind((function(r){return function(t,e,n,r){return Tn.findItem(t,e,_t).bind((function(e){var o=n>0?e.row+e.rowspan-1:e.row,i=r>0?e.column+e.colspan-1:e.column;return Tn.getAt(t,o+n,i+r).map((function(t){return t.element}))}))}(In(r),t,e,n)}))},Bn=function(t,e,n){var r=In(t);return Rn(r,e,n)},Pn=function(t,e,n,r,o){var i=In(t),u=_t(t,n)?O.some(e):Nn(i,e),a=_t(t,o)?O.some(r):Nn(i,r);return u.bind((function(t){return a.bind((function(e){return Rn(i,t,e)}))}))},In=Tn.fromTable,Ln=function(t,e){oe(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Hn=function(t,e){ae(t).fold((function(){oe(t).each((function(t){Vn(t,e)}))}),(function(t){Ln(t,e)}))},Fn=function(t,e){(function(t){return se(t,0)})(t).fold((function(){Vn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Vn=function(t,e){t.dom.appendChild(e.dom)},jn=function(t,e){Ln(t,e),Vn(e,t)},Un=function(t,e){N(e,(function(n,r){var o=0===r?t:e[r-1];Hn(o,n)}))},Wn=function(t,e){N(e,(function(e){Vn(t,e)}))},qn=function(t){t.dom.textContent="",N(ce(t),(function(t){Gn(t)}))},Gn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},$n=function(t){var e,n=ce(t);n.length>0&&(e=t,N(n,(function(t){Ln(e,t)}))),Gn(t)},Xn=function(t,e){var n=function(e){return t(e)?O.from(e.dom.nodeValue):O.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Qt,"text"),Kn=function(t){return Xn.get(t)},Yn=function(t){return Xn.getOption(t)},Jn=function(t,e){return Xn.set(t,e)},Qn=["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:m({selector:ke,closest:Te,predicate:Se,all:ie}),down:m({selector:xe,predicate:be}),styles:m({get:Ue,getRaw:qe,set:Ve,remove:Ge}),attrs:m({get:Me,set:Ae,remove:Ne,copyTo:function(t,e){var n=ze(t);De(e,n)}}),insert:m({before:Ln,after:Hn,afterAll:Un,append:Vn,appendAll:Wn,prepend:Fn,wrap:jn}),remove:m({unwrap:$n,remove:Gn}),create:m({nu:Ct.fromTag,clone:function(t){return Ct.fromDom(t.dom.cloneNode(!1))},text:Ct.fromText}),query:m({comparePosition:function(t,e){return t.dom.compareDocumentPosition(e.dom)},prevSibling:ue,nextSibling:ae}),property:m({children:ce,name:$t,parent:oe,document:function(t){return re(t).dom},isText:Qt,isComment:Yt,isElement:Jt,isSpecial:function(t){var e=$t(t);return A(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],e)},getLanguage:function(t){return Jt(t)?Re(t,"lang"):O.none()},getText:Kn,setText:Jn,isBoundary:function(t){return!!Jt(t)&&("body"===$t(t)||A(Qn,$t(t)))},isEmptyTag:function(t){return!!Jt(t)&&A(["br","img","hr","input"],$t(t))},isNonEditable:function(t){return Jt(t)&&"false"===Me(t,"contenteditable")}}),eq:_t,is:At}}var tr,er,nr=function(t,e,n,r){var o=e(t,n);return P(r,(function(n,r){var o=e(t,r);return rr(t,n,o)}),o)},rr=function(t,e,n){return e.bind((function(e){return n.filter(p(t.eq,e))}))},or=function(t,e,n){return n.length>0?function(t,e,n,r){return r(t,e,n[0],n.slice(1))}(t,e,n,nr):O.none()},ir=function(t,e,n,r){void 0===r&&(r=w);var o=[e].concat(t.up().all(e)),i=[n].concat(t.up().all(n)),u=function(t){return H(t,r).fold((function(){return t}),(function(e){return t.slice(0,e+1)}))},a=u(o),c=u(i),s=L(a,(function(e){return D(c,function(t,e){return p(t.eq,e)}(t,e))}));return{firstpath:a,secondpath:c,shared:s}},ur=Zn(),ar=function(t,e){return or(ur,(function(e,n){return t(n)}),e)},cr=function(t){return ke(t,"table")},sr=function(t,e,n){var r=function(t){return function(e){return void 0!==n&&n(e)||_t(e,t)}};return _t(t,e)?O.some({boxes:O.some([t]),start:t,finish:e}):cr(t).bind((function(o){return cr(e).bind((function(i){if(_t(o,i))return O.some({boxes:Bn(o,t,e),start:t,finish:e});if(Et(o,i)){var u=(a=ye(e,"td,th",r(o))).length>0?a[a.length-1]:e;return O.some({boxes:Pn(o,t,o,e,i),start:t,finish:u})}if(Et(i,o)){var a,c=(a=ye(t,"td,th",r(i))).length>0?a[a.length-1]:t;return O.some({boxes:Pn(i,t,o,e,i),start:t,finish:c})}return function(t,e,n){return ir(ur,t,e,n)}(t,e).shared.bind((function(u){return Te(u,"table",n).bind((function(n){var u=ye(e,"td,th",r(n)),a=u.length>0?u[u.length-1]:e,c=ye(t,"td,th",r(n)),s=c.length>0?c[c.length-1]:t;return O.some({boxes:Pn(n,t,o,e,i),start:s,finish:a})}))}))}))}))},lr=function(t,e){var n=xe(t,e);return n.length>0?O.some(n):O.none()},fr=function(t,e,n){return _e(t,e).bind((function(e){return _e(t,n).bind((function(t){return ar(cr,[e,t]).map((function(n){return{first:e,last:t,table:n}}))}))}))},dr=function(t,e,n,r,o){return function(t,e){return L(t,(function(t){return St(t,e)}))}(t,o).bind((function(t){return zn(t,e,n).bind((function(t){return function(t,e){return ke(t,"table").bind((function(n){return _e(n,e).bind((function(e){return sr(e,t).bind((function(t){return t.boxes.map((function(e){return{boxes:e,start:t.start,finish:t.finish}}))}))}))}))}(t,r)}))}))},mr=function(t,e){return lr(t,e)},gr=function(t,e,n){return fr(t,e,n).bind((function(e){var n=function(e){return _t(t,e)},r=ke(e.first,"thead,tfoot,tbody,table",n),o=ke(e.last,"thead,tfoot,tbody,table",n);return r.bind((function(t){return o.bind((function(n){return _t(t,n)?function(t,e,n){var r=In(t);return Mn(r,e,n)}(e.table,e.first,e.last):O.none()}))}))}))},hr=function(t){if(!i(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return N(t,(function(r,o){var u=Dt(r);if(1!==u.length)throw new Error("one and only one name per case");var a=u[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!i(c))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+i);var u=function(t){var r=Dt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!j(e,(function(t){return A(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:u,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}})),n},pr=hr([{none:[]},{multiple:["elements"]},{single:["element"]}]),vr=function(t,e,n,r){return t.fold(e,n,r)},br=pr.none,yr=pr.multiple,wr=pr.single,xr=tinymce.util.Tools.resolve("tinymce.PluginManager"),Cr=function(t,e){return Ct.fromDom(t.dom.cloneNode(e))},Sr=function(t){return Cr(t,!1)},kr=function(t){return Cr(t,!0)},Or=function(t,e){var n=Ct.fromTag(e),r=ze(t);return De(n,r),n},_r=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Ue(n,t);return parseFloat(o)||0}return r},r=function(t,e){return I(e,(function(e,n){var r=Ue(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!f(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;He(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},Tr=function(){var t=wt().browser;return t.isIE()||t.isEdge()},Er=function(t,e){return function(t){var e=parseFloat(t);return isNaN(e)?O.none():O.some(e)}(t).getOr(e)},Ar=function(t,e,n){return Er(Ue(t,e),n)},Dr=function(t){return Ue(t,"box-sizing")},Mr=function(t,e,n,r){return e-Ar(t,"padding-"+n,0)-Ar(t,"padding-"+r,0)-Ar(t,"border-"+n+"-width",0)-Ar(t,"border-"+r+"-width",0)},Rr=function(t,e){var n=t.dom,r=n.getBoundingClientRect().width||n.offsetWidth;return"border-box"===e?r:Mr(t,r,"left","right")},Nr=_r("width",(function(t){return t.dom.offsetWidth})),zr=function(t){return Nr.get(t)},Br=function(t){return Nr.getOuter(t)},Pr=function(t){return Rr(t,"content-box")},Ir=function(t){return Tr()?Rr(t,Dr(t)):Ar(t,"width",t.dom.offsetWidth)},Lr=function(t,e){void 0===e&&(e=x);var n=t.grid,r=M(n.columns,g),o=M(n.rows,g);return R(r,(function(n){return Hr((function(){return V(o,(function(e){return Tn.getAt(t,e,n).filter((function(t){return t.column===n})).toArray()}))}),(function(t){return 1===t.colspan&&e(t.element)}),(function(){return Tn.getAt(t,0,n)}))}))},Hr=function(t,e,n){var r=t();return L(r,e).orThunk((function(){return O.from(r[0]).orThunk(n)})).map((function(t){return t.element}))},Fr=function(t){var e=t.grid,n=M(e.rows,g),r=M(e.columns,g);return R(n,(function(e){return Hr((function(){return V(r,(function(n){return Tn.getAt(t,e,n).filter((function(t){return t.row===e})).fold(m([]),(function(t){return[t]}))}))}),(function(t){return 1===t.rowspan}),(function(){return Tn.getAt(t,e,0)}))}))},Vr=function(t,e){if(e<0||e>=t.length-1)return O.none();var n=t[e].fold((function(){var n=function(t){var e=_.call(t,0);return e.reverse(),e}(t.slice(0,e));return X(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return O.some({value:t,delta:0})})),r=t[e+1].fold((function(){var n=t.slice(e+1);return X(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return O.some({value:t,delta:1})}));return n.bind((function(t){return r.map((function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n}))}))},jr=function(t,e){return function(n){return"rtl"===Ur(n)?e:t}},Ur=function(t){return"rtl"===Ue(t,"direction")?"rtl":"ltr"},Wr=_r("height",(function(t){var e=t.dom;return pe(t)?e.getBoundingClientRect().height:e.offsetHeight})),qr=function(t){return Wr.get(t)},Gr=function(t){return Wr.getOuter(t)},$r=function(t){return Tr()?function(t,e){var n=t.dom,r=n.getBoundingClientRect().height||n.offsetHeight;return"border-box"===e?r:Mr(t,r,"top","bottom")}(t,Dr(t)):Ar(t,"height",t.dom.offsetHeight)},Xr=function(t,e){return{left:t,top:e,translate:function(n,r){return Xr(t+n,e+r)}}},Kr=Xr,Yr=function(t,e){return void 0!==t?t:void 0!==e?e:0},Jr=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return Kr(n.offsetLeft,n.offsetTop);var i=Yr(null==r?void 0:r.pageYOffset,o.scrollTop),u=Yr(null==r?void 0:r.pageXOffset,o.scrollLeft),a=Yr(o.clientTop,n.clientTop),c=Yr(o.clientLeft,n.clientLeft);return Qr(t).translate(u-c,i-a)},Qr=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?Kr(n.offsetLeft,n.offsetTop):pe(t)?function(t){var e=t.getBoundingClientRect();return Kr(e.left,e.top)}(e):Kr(0,0)},Zr=function(t,e){return{row:t,y:e}},to=function(t,e){return{col:t,x:e}},eo=function(t){return Jr(t).left+Br(t)},no=function(t){return Jr(t).left},ro=function(t,e){return to(t,no(e))},oo=function(t,e){return to(t,eo(e))},io=function(t){return Jr(t).top},uo=function(t,e){return Zr(t,io(e))},ao=function(t,e){return Zr(t,io(e)+Gr(e))},co=function(t,e,n){if(0===n.length)return[];var r=R(n.slice(1),(function(e,n){return e.map((function(e){return t(n,e)}))})),o=n[n.length-1].map((function(t){return e(n.length-1,t)}));return r.concat([o])},so={delta:g,positions:function(t){return co(uo,ao,t)},edge:io},lo={delta:g,edge:no,positions:function(t){return co(ro,oo,t)}},fo={delta:function(t){return-t},edge:eo,positions:function(t){return co(oo,ro,t)}},mo=jr(lo,fo),go={delta:function(t,e){return mo(e).delta(t,e)},positions:function(t,e){return mo(e).positions(t,e)},edge:function(t){return mo(t).edge(t)}},ho={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},po=(tr=function(t){return"(?:"+t+")?"},er=["Infinity","[0-9]+\\."+tr("[0-9]+")+tr("[eE][+-]?[0-9]+"),"\\.[0-9]+"+tr("[eE][+-]?[0-9]+"),"[0-9]+"+tr("[eE][+-]?[0-9]+")].join("|"),new RegExp("^([+-]?(?:"+er+"))(.*)$")),vo=function(t,e){return O.from(po.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return D(e,(function(e){return D(ho[e],(function(e){return t===e}))}))}(r,e)?O.some({value:n,unit:r}):O.none()}))},bo=/(\d+(\.\d+)?)%/,yo=/(\d+(\.\d+)?)px|em/,wo=ee("col"),xo=function(t,e,n){var r,o=(r=t,O.from(r.dom.parentElement).map(Ct.fromDom)).getOrThunk((function(){return ve(ne(t))}));return e(t)/n(o)*100},Co=function(t,e){Ve(t,"width",e+"px")},So=function(t,e){Ve(t,"width",e+"%")},ko=function(t,e){Ve(t,"height",e+"px")},Oo=function(t,e,n,r){var o=parseFloat(t);return it(t,"%")&&"table"!==$t(e)?function(t,e,n,r){var o=un(t).map((function(t){var r=n(t);return Math.floor(e/100*r)})).getOr(e);return r(t,o),o}(e,o,n,r):o},_o=function(t){var e=function(t){return $r(t)+"px"}(t);return e?Oo(e,t,qr,ko):qr(t)},To=function(t,e){return qe(t,e).orThunk((function(){return Re(t,e).map((function(t){return t+"px"}))}))},Eo=function(t){return To(t,"width")},Ao=function(t){return xo(t,zr,Pr)},Do=function(t){return wo(t)?zr(t):Ir(t)},Mo=function(t){return function(t,e,n){return n(t)/Xe(t,e)}(t,"rowspan",_o)},Ro=function(t,e,n){Ve(t,"width",e+n)},No=function(t){return xo(t,zr,Pr)+"%"},zo=m(bo),Bo=ee("col"),Po=function(t){return Eo(t).getOrThunk((function(){return Do(t)+"px"}))},Io=function(t){return(e=t,To(e,"height")).getOrThunk((function(){return Mo(t)+"px"}));var e},Lo=function(t,e,n,r,o,i){return t.filter(r).fold((function(){return i(Vr(n,e))}),(function(t){return o(t)}))},Ho=function(t,e,n,r){var o=Lr(t),i=Tn.hasColumns(t)?function(t){return R(Tn.justColumns(t),(function(t){return O.from(t.element)}))}(t):o,u=[O.some(go.edge(e))].concat(R(go.positions(o,e),(function(t){return t.map((function(t){return t.x}))}))),a=y(Ke);return R(i,(function(t,e){return Lo(t,e,u,a,(function(t){if(function(t){var e=wt().browser,n=e.isChrome()||e.isFirefox();return!Bo(t)||n}(t))return n(t);var i,c,s=(i=o[e],c=g,null!=i?c(i):O.none());return Lo(s,e,u,a,(function(t){return r(O.some(zr(t)))}),r)}),r)}))},Fo=function(t){return t.map((function(t){return t+"px"})).getOr("")},Vo=function(t,e,n){return Ho(t,e,Do,(function(t){return t.getOrThunk(n.minCellWidth)}))},jo=function(t,e,n,r,o){var i=Fr(t),u=[O.some(n.edge(e))].concat(R(n.positions(i,e),(function(t){return t.map((function(t){return t.y}))})));return R(i,(function(t,e){return Lo(t,e,u,y(Ye),r,o)}))},Uo=function(t,e){return function(){return pe(t)?e(t):parseFloat(qe(t,"width").getOr("0"))}},Wo=function(t){var e=Uo(t,zr),n=m(0);return{width:e,pixelWidth:e,getWidths:function(e,n){return Vo(e,t,n)},getCellDelta:n,singleColumnWidth:m([0]),minCellWidth:n,setElementWidth:d,adjustTableWidth:d,isRelative:!0,label:"none"}},qo=function(t){var e=Uo(t,(function(t){return parseFloat(No(t))})),n=Uo(t,zr);return{width:e,pixelWidth:n,getWidths:function(e,n){return function(t,e,n){return Ho(t,e,Ao,(function(t){return t.fold((function(){return n.minCellWidth()}),(function(t){return t/n.pixelWidth()*100}))}))}(e,t,n)},getCellDelta:function(t){return t/n()*100},singleColumnWidth:function(t,e){return[100-t]},minCellWidth:function(){return Qe()/n()*100},setElementWidth:So,adjustTableWidth:function(n){var r=e();So(t,r+n/100*r)},isRelative:!0,label:"percent"}},Go=function(t){var e=Uo(t,zr);return{width:e,pixelWidth:e,getWidths:function(e,n){return Vo(e,t,n)},getCellDelta:g,singleColumnWidth:function(t,e){return[Math.max(Qe(),t+e)-t]},minCellWidth:Qe,setElementWidth:Co,adjustTableWidth:function(n){var r=e()+n;Co(t,r)},isRelative:!1,label:"pixel"}},$o=function(t){return Eo(t).fold((function(){return Wo(t)}),(function(e){return function(t,e){return null!==zo().exec(e)?qo(t):Go(t)}(t,e)}))},Xo=Go,Ko=qo,Yo=function(t,e,n){var r=t[n].element,o=Ct.fromTag("td");Vn(o,Ct.fromTag("br")),(e?Vn:Fn)(r,o)},Jo=function(t,e){var n=function(t){return St(t.element,e)},r=kr(t),o=fn(r),i=$o(t),u=Tn.generate(o),a=function(t,e){var n=t.grid.columns,r=t.grid.rows,o=n,i=0,u=0,a=[],c=[];return Rt(t.access,(function(t){if(a.push(t),e(t)){c.push(t);var n=t.row,s=n+t.rowspan-1,l=t.column,f=l+t.colspan-1;n<r?r=n:s>i&&(i=s),l<o?o=l:f>u&&(u=f)}})),function(t,e,n,r,o,i){return{minRow:t,minCol:e,maxRow:n,maxCol:r,allCells:o,selectedCells:i}}(r,o,i,u,a,c)}(u,n),c="th:not("+e+"),td:not("+e+")",s=en(r,"th,td",(function(t){return St(t,c)}));return N(s,Gn),function(t,e,n,r){for(var o=e.grid.columns,i=e.grid.rows,u=0;u<i;u++)for(var a=!1,c=0;c<o;c++){if(!(u<n.minRow||u>n.maxRow||c<n.minCol||c>n.maxCol))Tn.getAt(e,u,c).filter(r).isNone()?Yo(t,a,u):a=!0}}(o,u,a,n),function(t,e,n,r){Rt(n.columns,(function(t){(t.column<e.minCol||t.column>e.maxCol)&&Gn(t.element)}));var o=B(tn(t,"tr"),(function(t){return 0===t.dom.childElementCount}));N(o,Gn),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||N(tn(t,"th,td"),(function(t){Ne(t,"rowspan"),Ne(t,"colspan")})),Ne(t,xn),Ne(t,"data-snooker-col-series"),$o(t).adjustTableWidth(r)}(r,a,u,function(t,e,n,r){if(0===r.minCol&&e.grid.columns===r.maxCol+1)return 0;var o=Vo(e,t,n),i=I(o,(function(t,e){return t+e}),0),u=I(o.slice(r.minCol,r.maxCol+1),(function(t,e){return t+e}),0)/i*n.pixelWidth()-n.pixelWidth();return n.getCellDelta(u)}(t,Tn.fromTable(t),i,a)),r},Qo=function(t){return"img"===$t(t)?1:Yn(t).fold((function(){return ce(t).length}),(function(t){return t.length}))},Zo=["img","br"],ti=function(t){return Yn(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||A(Zo,$t(t))},ei=function(t){return e=ti,(n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=Ct.fromDom(t.childNodes[r]);if(e(o))return O.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return O.none()})(t.dom);var e,n},ni=function(t){return ri(t,ti)},ri=function(t,e){var n=function(t){for(var r=ce(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return O.some(i);var u=n(i);if(u.isSome())return u}return O.none()};return n(t)},oi={scope:["row","col"]},ii=function(t){return function(){var e=Ct.fromTag("td",t.dom);return Vn(e,Ct.fromTag("br",t.dom)),e}},ui=function(t){return function(){return Ct.fromTag("col",t.dom)}},ai=function(t){return function(){return Ct.fromTag("colgroup",t.dom)}},ci=function(t){return function(){return Ct.fromTag("tr",t.dom)}},si=function(t,e,n){var r=function(t,e){var n=Or(t,e),r=ce(kr(t));return Wn(n,r),n}(t,e);return Rt(n,(function(t,e){null===t?Ne(r,e):Ae(r,e,t)})),r},li=function(t){return t},fi=function(t,e,n){var r=function(t,e){var n,r,o,i;n=t.element,r=e,o=n.dom,i=r.dom,He(o)&&He(i)&&(i.style.cssText=o.style.cssText),Ge(e,"height"),1!==t.colspan&&Ge(e,"width")};return{col:function(n){var o=Ct.fromTag($t(n.element),e.dom);return r(n,o),t(n.element,o),o},colgroup:ai(e),row:ci(e),cell:function(o){var i=Ct.fromTag($t(o.element),e.dom),u=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=u.length>0?function(t,e,n){return ei(t).map((function(r){var o=n.join(","),i=ye(r,o,(function(e){return _t(e,t)}));return P(i,(function(t,e){var n=Sr(e);return Ne(n,"contenteditable"),Vn(t,n),n}),e)})).getOr(e)}(o.element,i,u):i;return Vn(a,Ct.fromTag("br")),r(o,i),function(t,e){Rt(oi,(function(n,r){return Re(t,r).filter((function(t){return A(n,t)})).each((function(t){return Ae(e,r,t)}))}))}(o.element,i),t(o.element,i),i},replace:si,colGap:ui(e),gap:ii(e)}},di=function(t){return{col:ui(t),colgroup:ai(t),row:ci(t),cell:ii(t),replace:li,colGap:ui(t),gap:ii(t)}},mi=function(t){return R(t,Ct.fromDom)},gi=function(t){return Ct.fromDom(t.getBody())},hi=function(t){return t.getBoundingClientRect().width},pi=function(t){return t.getBoundingClientRect().height},vi=function(t){return function(e){return _t(e,gi(t))}},bi=function(t){return/^\d+(\.\d+)?$/.test(t)?t+"px":t},yi=function(t){Ne(t,"data-mce-style");var e=function(t){return Ne(t,"data-mce-style")};N(rn(t),e),N(on(t),e),N(an(t),e)},wi=function(t){return Ct.fromDom(t.selection.getStart())},xi=function(t){return vr(t.get(),m([]),g,W)},Ci=function(t){var e=function(t,e){return Re(t,e).exists((function(t){return parseInt(t,10)>1}))},n=xi(t);return n.length>0&&j(n,(function(t){return e(t,"rowspan")||e(t,"colspan")}))?O.some(n):O.none()},Si=function(t,e,n){return vr(e.get(),O.none,(function(e){return e.length<=1?O.none():gr(t,n.firstSelectedSelector,n.lastSelectedSelector).map((function(t){return{bounds:t,cells:e}}))}),O.none)},ki={selected:"data-mce-selected",selectedSelector:"td[data-mce-selected],th[data-mce-selected]",firstSelected:"data-mce-first-selected",firstSelectedSelector:"td[data-mce-first-selected],th[data-mce-first-selected]",lastSelected:"data-mce-last-selected",lastSelectedSelector:"td[data-mce-last-selected],th[data-mce-last-selected]"},Oi=function(t,e,n){return{element:n,mergable:Si(e,t,ki),unmergable:Ci(t),selection:xi(t)}},_i=function(t){return function(e,n){var r,o=$t(e),i="col"===o||"colgroup"===o?un(r=e).bind((function(t){return mr(t,ki.firstSelectedSelector)})).fold(m(r),(function(t){return t[0]})):e;return Te(i,t,n)}},Ti=_i("th,td,caption"),Ei=_i("th,td"),Ai=function(t){return xi(t)},Di=function(t,e,n){t.on("BeforeGetContent",(function(n){!0===n.selection&&vr(e.get(),d,(function(e){n.preventDefault(),function(t){return un(t[0]).map((function(t){var e=Jo(t,"[data-mce-selected]");return yi(e),[e]}))}(e).each((function(e){n.content="text"===n.format?function(t){return R(t,(function(t){return t.dom.innerText})).join("")}(e):function(t,e){return R(e,(function(e){return t.selection.serializer.serialize(e.dom,{})})).join("")}(t,e)}))}),d)})),t.on("BeforeSetContent",(function(r){if(!0===r.selection&&!0===r.paste){var o=Ai(e);G(o).each((function(e){un(e).each((function(o){var i,u,a,c=B((i=r.content,(a=(u||document).createElement("div")).innerHTML=i,ce(Ct.fromDom(a))),(function(t){return"meta"!==$t(t)})),s=ee("table");if(1===c.length&&s(c[0])){r.preventDefault();var l=Ct.fromDom(t.getDoc()),f=di(l),d=function(t,e,n){return{element:t,clipboard:e,generators:n}}(e,c[0],f);n.pasteCells(o,d).each((function(){t.focus()}))}}))}))}}))},Mi=hr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Ri=K({},Mi),Ni=function(t,e,n,r,o){var i=t.slice(0),u=function(t,e){return 0===t.length?Ri.none():1===t.length?Ri.only(0):0===e?Ri.left(0,1):e===t.length-1?Ri.right(e-1,e):e>0&&e<t.length-1?Ri.middle(e-1,e,e+1):Ri.none()}(t,e),a=m(R(i,m(0)));return u.fold(a,(function(t){return r.singleColumnWidth(i[t],n)}),(function(t,e){return o.calcLeftEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)}),(function(t,e,u){return o.calcMiddleDeltas(i,t,e,u,n,r.minCellWidth(),r.isRelative)}),(function(t,e){return o.calcRightEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)}))},zi=function(t,e,n){for(var r=0,o=t;o<e;o++)r+=void 0!==n[o]?n[o]:0;return r},Bi=function(t,e){var n=Tn.justCells(t);return R(n,(function(t){var n=zi(t.row,t.row+t.rowspan,e);return{element:t.element,height:n,rowspan:t.rowspan}}))},Pi=function(t,e){return Tn.hasColumns(t)?function(t,e){var n=Tn.justColumns(t);return R(n,(function(t,n){return{element:t.element,width:e[n],colspan:t.colspan}}))}(t,e):function(t,e){var n=Tn.justCells(t);return R(n,(function(t){var n=zi(t.column,t.column+t.colspan,e);return{element:t.element,width:n,colspan:t.colspan}}))}(t,e)},Ii=function(t,e,n){var r=Pi(t,e);N(r,(function(t){n.setElementWidth(t.element,t.width)}))},Li=function(t,e,n,r,o){var i=Tn.fromTable(t),u=o.getCellDelta(e),a=o.getWidths(i,o),c=n===i.grid.columns-1,s=r.clampTableDelta(a,n,u,o.minCellWidth(),c),l=Ni(a,n,s,o,r),f=R(l,(function(t,e){return t+a[e]}));Ii(i,f,o),r.resizeTable(o.adjustTableWidth,s,c)},Hi=function(t,e,n,r){var o=Tn.fromTable(t),i=function(t,e,n){return jo(t,e,n,Mo,(function(t){return t.getOrThunk(Ze)}))}(o,t,r),u=R(i,(function(t,r){return n===r?Math.max(e+t,Ze()):t})),a=Bi(o,u),c=function(t,e){return R(t.all,(function(t,n){return{element:t.element,height:e[n]}}))}(o,u);N(c,(function(t){ko(t.element,t.height)})),N(a,(function(t){ko(t.element,t.height)}));var s=P(u,(function(t,e){return t+e}),0);ko(t,s)},Fi=function(t){return R(t,m(0))},Vi=function(t,e,n,r,o){return o(t.slice(0,e)).concat(r).concat(o(t.slice(n)))},ji=function(t){return function(e,n,r,o){if(t(r)){var i=Math.max(o,e[n]-Math.abs(r)),u=Math.abs(i-e[n]);return r>=0?u:-u}return r}},Ui=ji((function(t){return t<0})),Wi=ji(x),qi=function(){var t=function(t,e,n,r){var o=(100+n)/100,i=Math.max(r,(t[e]+n)/o);return R(t,(function(t,n){return(n===e?i:t/o)-t}))},e=function(e,n,r,o,i,u){return u?t(e,n,o,i):function(t,e,n,r,o){var i=Ui(t,e,r,o);return Vi(t,e,n+1,[i,0],Fi)}(e,n,r,o,i)};return{resizeTable:function(t,e){return t(e)},clampTableDelta:Ui,calcLeftEdgeDeltas:e,calcMiddleDeltas:function(t,n,r,o,i,u,a){return e(t,r,o,i,u,a)},calcRightEdgeDeltas:function(e,n,r,o,i,u){if(u)return t(e,r,o,i);var a=Ui(e,r,o,i);return Fi(e.slice(0,r)).concat([a])},calcRedestributedWidths:function(t,e,n,r){if(r){var o=(e+n)/e,i=R(t,(function(t){return t/o}));return{delta:100*o-100,newSizes:i}}return{delta:n,newSizes:t}}}},Gi=function(){var t=function(t,e,n,r,o){var i=Wi(t,r>=0?n:e,r,o);return Vi(t,e,n+1,[i,-i],Fi)};return{resizeTable:function(t,e,n){n&&t(e)},clampTableDelta:function(t,e,n,r,o){if(o){if(n>=0)return n;var i=I(t,(function(t,e){return t+e-r}),0);return Math.max(-i,n)}return Ui(t,e,n,r)},calcLeftEdgeDeltas:t,calcMiddleDeltas:function(e,n,r,o,i,u){return t(e,r,o,i,u)},calcRightEdgeDeltas:function(t,e,n,r,o,i){if(i)return Fi(t);var u=r/t.length;return R(t,m(u))},calcRedestributedWidths:function(t,e,n,r){return{delta:0,newSizes:t}}}},$i=function(t,e){var n=O.from(t.dom.documentElement).map(Ct.fromDom).getOr(t);return{parent:m(n),view:m(t),origin:m(Kr(0,0)),isResizable:e}},Xi=function(t,e,n){return{parent:m(e),view:m(t),origin:m(Kr(0,0)),isResizable:n}},Ki=hr([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),Yi=function(t,e,n){var r=n.substring(0,n.length-t.length),o=parseFloat(r);return r===o.toString()?e(o):Ki.invalid(n)},Ji=K(K({},Ki),{from:function(t){return it(t,"%")?Yi("%",Ki.percent,t):it(t,"px")?Yi("px",Ki.pixels,t):Ki.invalid(t)}}),Qi=function(t,e,n){return t.fold((function(){return e}),(function(t){return function(t,e,n){var r=n/e;return R(t,(function(t){return Ji.from(t).fold((function(){return t}),(function(t){return t*r+"px"}),(function(t){return t/100*n+"px"}))}))}(e,n,t)}),(function(t){return function(t,e){return R(t,(function(t){return Ji.from(t).fold((function(){return t}),(function(t){return t/e*100+"%"}),(function(t){return t+"%"}))}))}(e,n)}))},Zi=function(t,e,n){var r=Ji.from(n),o=j(t,(function(t){return"0px"===t}))?function(t,e){var n=t.fold((function(){return m("")}),(function(t){return m(t/e+"px")}),(function(){return m(100/e+"%")}));return M(e,n)}(r,t.length):Qi(r,t,e);return nu(o)},tu=function(t,e){return 0===t.length?e:P(t,(function(t,e){return Ji.from(e).fold(m(0),g,g)+t}),0)},eu=function(t,e){return Ji.from(t).fold(m(t),(function(t){return t+e+"px"}),(function(t){return t+e+"%"}))},nu=function(t){if(0===t.length)return t;var e=P(t,(function(t,e){var n=Ji.from(e).fold((function(){return{value:e,remainder:0}}),(function(t){return function(t,e){var n=Math.floor(t);return{value:n+e,remainder:t-n}}(t,"px")}),(function(t){return{value:t+"%",remainder:0}}));return{output:[n.value].concat(t.output),remainder:t.remainder+n.remainder}}),{output:[],remainder:0}),n=e.output;return n.slice(0,n.length-1).concat([eu(n[n.length-1],Math.round(e.remainder))])},ru=Ji.from,ou=function(t){return ru(t).fold(m("px"),m("px"),m("%"))},iu=function(t,e,n){var r=Tn.fromTable(t),o=r.all,i=Tn.justCells(r),u=Tn.justColumns(r);e.each((function(e){var n=ou(e),o=zr(t),a=function(t,e){return Ho(t,e,Po,Fo)}(r,t),c=Zi(a,o,e);Tn.hasColumns(r)?function(t,e,n){N(e,(function(e,r){var o=tu([t[r]],Qe());Ve(e.element,"width",o+n)}))}(c,u,n):function(t,e,n){N(e,(function(e){var r=t.slice(e.column,e.colspan+e.column),o=tu(r,Qe());Ve(e.element,"width",o+n)}))}(c,i,n),Ve(t,"width",e)})),n.each((function(e){var n=ou(e),u=qr(t),a=function(t,e,n){return jo(t,e,n,Io,Fo)}(r,t,so);!function(t,e,n,r){N(n,(function(e){var n=t.slice(e.row,e.rowspan+e.row),o=tu(n,Ze());Ve(e.element,"height",o+r)})),N(e,(function(e,n){Ve(e.element,"height",t[n])}))}(Zi(a,u,e),o,i,n),Ve(t,"height",e)}))},uu=function(t){return Eo(t).exists((function(t){return bo.test(t)}))},au=function(t){return Eo(t).exists((function(t){return yo.test(t)}))},cu=function(t){return Eo(t).isNone()},su=function(t){return Tn.fromTable(t).grid},lu=function(t){var e=[];return{bind:function(t){if(void 0===t)throw new Error("Event bind error: undefined handler");e.push(t)},unbind:function(t){e=B(e,(function(e){return e!==t}))},trigger:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={};N(t,(function(t,e){o[t]=n[e]})),N(e,(function(t){t(o)}))}}},fu=function(t){return{registry:Nt(t,(function(t){return{bind:t.bind,unbind:t.unbind}})),trigger:Nt(t,(function(t){return t.trigger}))}},du=function(t){return t.slice(0).sort()},mu=function(t,e,n){if(0===e.length)throw new Error("You must specify at least one required field.");var o;return function(t,e){if(!i(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");N(e,(function(e){if(!r(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")}))}("required",e),o=du(e),L(o,(function(t,e){return e<o.length-1&&t===o[e+1]})).each((function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+o.join(", ")+"].")})),function(r){var o=Dt(r);j(e,(function(t){return A(o,t)}))||function(t,e){throw new Error("All required keys ("+du(t).join(", ")+") were not specified. Specified keys were: "+du(e).join(", ")+".")}(e,o),t(e,o);var i=B(e,(function(t){return!n.validate(r[t],t)}));return i.length>0&&function(t,e){throw new Error("All values need to be of type: "+e+". Keys ("+du(t).join(", ")+") were not.")}(i,n.label),r}},gu=function(t,e){var n=B(e,(function(e){return!A(t,e)}));n.length>0&&function(t){throw new Error("Unsupported keys for object: "+du(t).join(", "))}(n)},hu=function(t){return function(t,e){return mu(t,e,{validate:l,label:"function"})}(gu,t)},pu=hu(["compare","extract","mutate","sink"]),vu=hu(["element","start","stop","destroy"]),bu=hu(["forceDrop","drop","move","delayDrop"]),yu=function(){var t=O.none(),e=fu({move:lu(["info"])});return{onEvent:function(n,r){r.extract(n).each((function(n){(function(e,n){var r=t.map((function(t){return e.compare(t,n)}));return t=O.some(n),r})(r,n).each((function(t){e.trigger.move(t)}))}))},reset:function(){t=O.none()},events:e.registry}},wu=function(){var t,e=(t=fu({move:lu(["info"])}),{onEvent:d,reset:d,events:t.registry}),n=yu(),r=e;return{on:function(){r.reset(),r=n},off:function(){r.reset(),r=e},isOn:function(){return r===n},onEvent:function(t,e){r.onEvent(t,e)},events:n.events}},xu=function(t,e,n){var r,o,i,a,c=!1,s=fu({start:lu([]),stop:lu([])}),l=wu(),f=function(){g.stop(),l.isOn()&&(l.off(),s.trigger.stop())},d=(r=f,o=200,i=null,{cancel:a=function(){u(i)||(clearTimeout(i),i=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a(),i=setTimeout((function(){i=null,r.apply(null,t)}),o)}});l.events.move.bind((function(n){e.mutate(t,n.info)}));var m=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];c&&t.apply(null,e)}},g=e.sink(bu({forceDrop:f,drop:m(f),move:m((function(t){d.cancel(),l.onEvent(t,e)})),delayDrop:m(d.throttle)}),n);return{element:g.element,go:function(t){g.start(t),l.on(),s.trigger.start()},on:function(){c=!0},off:function(){c=!1},destroy:function(){g.destroy()},events:s.registry}},Cu=function(t){var e,n,r=Ct.fromDom(function(t){if(fe()&&s(t.target)){var e=Ct.fromDom(t.target);if(Jt(e)&&he(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return G(n)}}return O.from(t.target)}(t).getOr(t.target)),o=function(){return t.stopPropagation()},i=function(){return t.preventDefault()},u=(e=i,n=o,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e(n.apply(null,t))});return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(r,t.clientX,t.clientY,o,i,u,t)},Su=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(Cu(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:p(ku,t,e,i,o)}},ku=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Ou=x,_u=function(t,e,n){return function(t,e,n,r){return Su(t,e,n,r,!1)}(t,e,Ou,n)},Tu=Cu,Eu=function(t,e){var n=Me(t,e);return void 0===n||""===n?[]:n.split(" ")},Au=function(t){return void 0!==t.dom.classList},Du=function(t,e){return function(t,e,n){var r=Eu(t,e).concat([n]);return Ae(t,e,r.join(" ")),!0}(t,"class",e)},Mu=function(t,e){Au(t)?t.dom.classList.add(e):Du(t,e)},Ru=function(t,e){return Au(t)&&t.dom.classList.contains(e)},Nu=function(t){var e=t.replace(/\./g,"-");return{resolve:function(t){return e+"-"+t}}},zu=Nu("ephox-dragster"),Bu=zu.resolve,Pu=pu({compare:function(t,e){return Kr(e.left-t.left,e.top-t.top)},extract:function(t){return O.some(Kr(t.x,t.y))},sink:function(t,e){var n=function(t){var e=K({layerClass:Bu("blocker")},t),n=Ct.fromTag("div");Ae(n,"role","presentation"),je(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Mu(n,Bu("blocker")),Mu(n,e.layerClass);return{element:m(n),destroy:function(){Gn(n)}}}(e),r=_u(n.element(),"mousedown",t.forceDrop),o=_u(n.element(),"mouseup",t.drop),i=_u(n.element(),"mousemove",t.move),u=_u(n.element(),"mouseout",t.delayDrop);return vu({element:n.element,start:function(t){Vn(t,n.element())},stop:function(){Gn(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(t,e){t.mutate(e.left,e.top)}}),Iu=function(t){return Te(t,"[contenteditable]")},Lu=function(t,e){return void 0===e&&(e=!1),!wt().browser.isIE()&&pe(t)?t.dom.isContentEditable:Iu(t).fold(m(e),(function(t){return"true"===Hu(t)}))},Hu=function(t){return t.dom.contentEditable},Fu=Nu("ephox-snooker"),Vu=Fu.resolve,ju=function(){var t=fu({drag:lu(["xDelta","yDelta","target"])}),e=O.none(),n=function(){var t=fu({drag:lu(["xDelta","yDelta"])});return{mutate:function(e,n){t.trigger.drag(e,n)},events:t.registry}}();n.events.drag.bind((function(n){e.each((function(e){t.trigger.drag(n.xDelta,n.yDelta,e)}))}));return{assign:function(t){e=O.some(t)},get:function(){return e},mutate:n.mutate,events:t.registry}},Uu=Vu("resizer-bar"),Wu=Vu("resizer-rows"),qu=Vu("resizer-cols"),Gu=function(t){var e=xe(t.parent(),"."+Uu);N(e,Gn)},$u=function(t,e,n){var r=t.origin();N(e,(function(e){e.each((function(e){var o=n(r,e);Mu(o,Uu),Vn(t.parent(),o)}))}))},Xu=function(t,e,n,r){$u(t,e,(function(t,e){var o,i,u,a,c,s,l=(o=e.col,i=e.x-t.left,u=n.top-t.top,a=7,c=r,s=Ct.fromTag("div"),je(s,{position:"absolute",left:i-a/2+"px",top:u+"px",height:c+"px",width:a+"px"}),De(s,{"data-column":o,role:"presentation"}),s);return Mu(l,qu),l}))},Ku=function(t,e,n,r){$u(t,e,(function(t,e){var o=function(t,e,n,r,o){var i=Ct.fromTag("div");return je(i,{position:"absolute",left:e+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),De(i,{"data-row":t,role:"presentation"}),i}(e.row,n.left-t.left,e.y-t.top,r,7);return Mu(o,Wu),o}))},Yu=function(t,e,n,r,o){var i=Jr(n),u=e.isResizable,a=r.length>0?so.positions(r,n):[],c=a.length>0?function(t,e){return V(t.all,(function(t,n){return e(t.element)?[n]:[]}))}(t,u):[],s=B(a,(function(t,e){return D(c,(function(t){return e===t}))}));Ku(e,s,i,Br(n));var l=o.length>0?go.positions(o,n):[],f=l.length>0?function(t,e){var n=[];return M(t.grid.columns,(function(r){Tn.getColumnAt(t,r).map((function(t){return t.element})).forall(e)&&n.push(r)})),B(n,(function(n){var r=Tn.filterItems(t,(function(t){return t.column===n}));return j(r,(function(t){return e(t.element)}))}))}(t,u):[],d=B(l,(function(t,e){return D(f,(function(t){return e===t}))}));Xu(e,d,i,Gr(n))},Ju=function(t,e){if(Gu(t),t.isResizable(e)){var n=Tn.fromTable(e),r=Fr(n),o=Lr(n);Yu(n,t,e,r,o)}},Qu=function(t,e){var n=xe(t.parent(),"."+Uu);N(n,e)},Zu=function(t){Qu(t,(function(t){Ve(t,"display","none")}))},ta=function(t){Qu(t,(function(t){Ve(t,"display","block")}))},ea=Vu("resizer-bar-dragging"),na=function(t){var e=ju(),n=function(t,e){void 0===e&&(e={});var n=void 0!==e.mode?e.mode:Pu;return xu(t,n,e)}(e,{}),r=O.none(),o=function(t,e){return O.from(Me(t,e))};e.events.drag.bind((function(t){o(t.target,"data-row").each((function(e){var n=Je(t.target,"top");Ve(t.target,"top",n+t.yDelta+"px")})),o(t.target,"data-column").each((function(e){var n=Je(t.target,"left");Ve(t.target,"left",n+t.xDelta+"px")}))}));var i=function(t,e){return Je(t,e)-$e(t,"data-initial-"+e,0)};n.events.stop.bind((function(){e.get().each((function(e){r.each((function(n){o(e,"data-row").each((function(t){var r=i(e,"top");Ne(e,"data-initial-top"),l.trigger.adjustHeight(n,r,parseInt(t,10))})),o(e,"data-column").each((function(t){var r=i(e,"left");Ne(e,"data-initial-left"),l.trigger.adjustWidth(n,r,parseInt(t,10))})),Ju(t,n)}))}))}));var u=function(r,o){l.trigger.startAdjust(),e.assign(r),Ae(r,"data-initial-"+o,Je(r,o)),Mu(r,ea),Ve(r,"opacity","0.2"),n.go(t.parent())},a=_u(t.parent(),"mousedown",(function(t){var e;e=t.target,Ru(e,Wu)&&u(t.target,"top"),function(t){return Ru(t,qu)}(t.target)&&u(t.target,"left")})),c=function(e){return _t(e,t.view())},s=_u(t.view(),"mouseover",(function(e){var n;(n=e.target,Te(n,"table",c).filter(Lu)).fold((function(){pe(e.target)&&Gu(t)}),(function(e){r=O.some(e),Ju(t,e)}))})),l=fu({adjustHeight:lu(["table","delta","row"]),adjustWidth:lu(["table","delta","column"]),startAdjust:lu([])});return{destroy:function(){a.unbind(),s.unbind(),n.destroy(),Gu(t)},refresh:function(e){Ju(t,e)},on:n.on,off:n.off,hideBars:p(Zu,t),showBars:p(ta,t),events:l.registry}},ra=function(t,e,n){var r=so,o=go,i=na(t),u=fu({beforeResize:lu(["table","type"]),afterResize:lu(["table","type"]),startDrag:lu([])});return i.events.adjustHeight.bind((function(t){var e=t.table;u.trigger.beforeResize(e,"row");var n=r.delta(t.delta,e);Hi(e,n,t.row,r),u.trigger.afterResize(e,"row")})),i.events.startAdjust.bind((function(t){u.trigger.startDrag()})),i.events.adjustWidth.bind((function(t){var r=t.table;u.trigger.beforeResize(r,"col");var i=o.delta(t.delta,r),a=n(r);Li(r,i,t.column,e,a),u.trigger.afterResize(r,"col")})),{on:i.on,off:i.off,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:u.registry}},oa=function(t,e){return t.fire("newrow",{node:e})},ia=function(t,e){return t.fire("newcell",{node:e})},ua=function(t,e,n){t.fire("TableModified",K(K({},n),{table:e}))},aa={structure:!1,style:!0},ca={structure:!0,style:!1},sa={structure:!0,style:!0},la={"border-collapse":"collapse",width:"100%"},fa=M(5,(function(t){var e=t+1+"px";return{title:e,value:e}})),da=R(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(function(t){return{title:t,value:t.toLowerCase()}})),ma={border:"1"},ga=function(t){return t.getParam("table_sizing_mode","auto")},ha=function(t){return t.getParam("table_responsive_width")},pa=function(t){return t.getParam("table_border_widths",fa,"array")},va=function(t){return t.getParam("table_border_styles",da,"array")},ba=function(t){return t.getParam("table_default_attributes",ma,"object")},ya=function(t){return t.getParam("table_default_styles",function(t){var e;if(Ta(t)){var n=t.dom,r=null!==(e=n.getParent(t.selection.getStart(),n.isBlock))&&void 0!==e?e:t.getBody(),o=Pr(Ct.fromDom(r));return K(K({},la),{width:o+"px"})}return Ea(t)?Bt(la,(function(t,e){return"width"!==e})):la}(t),"object")},wa=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},xa=function(t){return t.getParam("table_row_advtab",!0,"boolean")},Ca=function(t){return t.getParam("table_advtab",!0,"boolean")},Sa=function(t){return t.getParam("table_style_by_css",!1,"boolean")},ka=function(t){return t.getParam("table_cell_class_list",[],"array")},Oa=function(t){return t.getParam("table_class_list",[],"array")},_a=function(t){return"relative"===ga(t)||!0===ha(t)},Ta=function(t){return"fixed"===ga(t)||!1===ha(t)},Ea=function(t){return"responsive"===ga(t)},Aa=function(t){return t.getParam("table_use_colgroups",!1,"boolean")},Da=function(t){var e=t.getParam("table_header_type","section","string");return A(["section","cells","sectionCells","auto"],e)?e:"section"},Ma=function(t){var e=t.getParam("table_column_resizing","preservetable","string");return L(["preservetable","resizetable"],(function(t){return t===e})).getOr("preservetable")},Ra=function(t){return"preservetable"===Ma(t)},Na=function(t){return"resizetable"===Ma(t)},za=function(t){var e=t.getParam("table_clone_elements");return r(e)?O.some(e.split(/[ ,]/)):Array.isArray(e)?O.some(e):O.none()},Ba=function(t){return t.getParam("table_background_color_map",[],"array")},Pa=function(t){return t.getParam("table_border_color_map",[],"array")},Ia=function(t,e){return _a(t)?Ko(e):Ta(t)?Xo(e):$o(e)},La=function(t){Ne(t,"width")},Ha=function(t){var e=No(t);iu(t,O.some(e),O.none()),La(t)},Fa=function(t){var e=function(t){return zr(t)+"px"}(t);iu(t,O.some(e),O.none()),La(t)},Va=function(t){Ge(t,"width");var e=on(t),n=e.length>0?e:rn(t);N(n,(function(t){Ge(t,"width"),La(t)})),La(t)},ja=function(){var t=Ct.fromTag("div");return je(t,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Vn(ve(Ct.fromDom(document)),t),t},Ua=function(t){return"false"!==Me(t,"data-mce-resize")},Wa=function(t){var e,n,o=O.none(),i=O.none(),u=O.none(),a=function(t){return"TABLE"===t.nodeName},c=function(){return i},s=function(e){return Ia(t,e)},l=function(){return Ra(t)?Gi():qi()},f=function(r,o,i){var u=it(o,"e");if(""===n&&Ha(r),i!==e&&""!==n){Ve(r,"width",n);var a=l(),c=s(r),f=Ra(t)||u?function(t){return su(t).columns}(r)-1:0;Li(r,i-e,f,a,c)}else if(function(t){return/^(\d+(\.\d+)?)%$/.test(t)}(n)){var d=parseFloat(n.replace("%",""));Ve(r,"width",i*d/e+"%")}(function(t){return/^(\d+(\.\d+)?)px$/.test(t)})(n)&&function(t){var e=Tn.fromTable(t);Tn.hasColumns(e)||N(rn(t),(function(t){var e=Ue(t,"width");Ve(t,"width",e),Ne(t,"width")}))}(r)};return t.on("init",(function(){var e=function(t,e){return t.inline?Xi(gi(t),ja(),e):$i(Ct.fromDom(t.getDoc()),e)}(t,Ua);if(u=O.some(e),function(t){var e=t.getParam("object_resizing",!0);return r(e)?"table"===e:e}(t)&&function(t){return t.getParam("table_resize_bars",!0,"boolean")}(t)){var n=l(),a=ra(e,n,s);a.on(),a.events.startDrag.bind((function(e){o=O.some(t.selection.getRng())})),a.events.beforeResize.bind((function(e){var n=e.table.dom;!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(t,n,hi(n),pi(n),"bar-"+e.type)})),a.events.afterResize.bind((function(e){var n=e.table,r=n.dom;yi(n),o.each((function(e){t.selection.setRng(e),t.focus()})),function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(t,r,hi(r),pi(r),"bar-"+e.type),t.undoManager.add()})),i=O.some(a)}})),t.on("ObjectResizeStart",(function(r){var o=r.target;if(a(o)){var i=Ct.fromDom(o);N(t.dom.select(".mce-clonedresizable"),(function(e){t.dom.addClass(e,"mce-"+Ma(t)+"-columns")})),!au(i)&&Ta(t)?Fa(i):!uu(i)&&_a(t)&&Ha(i),cu(i)&&ot(r.origin,"bar-")&&Ha(i),e=r.width,n=Ea(t)?"":function(t,e){var n=t.dom.getStyle(e,"width")||t.dom.getAttrib(e,"width");return O.from(n).filter(at)}(t,o).getOr("")}})),t.on("ObjectResized",(function(e){var n=e.target;if(a(n)){var r=Ct.fromDom(n),o=e.origin;ot(o,"corner-")&&f(r,o,e.width),yi(r),ua(t,r.dom,aa)}})),t.on("SwitchMode",(function(){c().each((function(e){t.mode.isReadOnly()?e.hideBars():e.showBars()}))})),{lazyResize:c,lazyWire:function(){return u.getOr($i(Ct.fromDom(t.getBody()),Ua))},destroy:function(){i.each((function(t){t.destroy()})),u.each((function(e){!function(t,e){t.inline&&Gn(e.parent())}(t,e)}))}}},qa=function(t,e){return{element:t,offset:e}},Ga=function(t,e,n){return t.property().isText(e)&&0===t.property().getText(e).trim().length||t.property().isComment(e)?n(e).bind((function(e){return Ga(t,e,n).orThunk((function(){return O.some(e)}))})):O.none()},$a=function(t,e){return t.property().isText(e)?t.property().getText(e).length:t.property().children(e).length},Xa=function(t,e){var n=Ga(t,e,t.query().prevSibling).getOr(e);if(t.property().isText(n))return qa(n,$a(t,n));var r=t.property().children(n);return r.length>0?Xa(t,r[r.length-1]):qa(n,$a(t,n))},Ka=Xa,Ya=Zn(),Ja=function(t,e){1===Xe(t,"colspan")&&function(t){return Eo(t).bind((function(t){return vo(t,["fixed","relative","empty"])}))}(t).each((function(n){var r=n.value/2;Ro(t,r,n.unit),Ro(e,r,n.unit)}))},Qa=ee("th"),Za=function(t){return j(t,(function(t){return Qa(t.element)}))},tc=function(t,e){return t&&e?"sectionCells":t?"section":"cells"},ec=function(t){var e="thead"===t.section,n=Be(nc(t.cells),"th");return e||n?{type:"header",subType:tc(e,n)}:"tfoot"===t.section?{type:"footer"}:{type:"body"}},nc=function(t){var e=B(t,(function(t){return Qa(t.element)}));return 0===e.length?O.some("td"):e.length===t.length?O.some("th"):O.none()},rc=function(t,e,n){return qt(n(t.element,e),!0,t.isLocked)},oc=function(t,e){return t.section!==e?Gt(t.element,t.cells,e,t.isNew):t},ic=function(){return{transformRow:oc,transformCell:function(t,e,n){var r=n(t.element,e),o="td"!==$t(r)?function(t,e){var n=Or(t,e);Ln(t,n);var r=ce(t);return Wn(n,r),Gn(t),n}(r,"td"):r;return qt(o,t.isNew,t.isLocked)}}},uc=function(){return{transformRow:oc,transformCell:rc}},ac=function(){return{transformRow:function(t,e){return oc(t,"thead"===e?"tbody":e)},transformCell:rc}},cc=function(t,e){switch(function(t){return X(t.all,(function(t){var e=ec(t);return"header"===e.type?O.from(e.subType):O.none()}))}(Tn.fromTable(t)).getOr(e)){case"section":return ic();case"sectionCells":return uc();case"cells":return ac()}},sc=ic,lc=uc,fc=ac,dc=function(){return{transformRow:g,transformCell:rc}},mc=function(t,e,n,r){n===r?Ne(t,e):Ae(t,e,n)},gc=function(t,e,n){$(we(t,e)).fold((function(){return Fn(t,n)}),(function(t){return Hn(t,n)}))},hc=function(t,e){var n=[],r=[],o=function(t){return R(t,(function(t){t.isNew&&n.push(t.element);var e=t.element;return qn(e),N(t.cells,(function(t){t.isNew&&r.push(t.element),mc(t.element,"colspan",t.colspan,1),mc(t.element,"rowspan",t.rowspan,1),Vn(e,t.element)})),e}))},i=function(t){return V(t,(function(t){return R(t.cells,(function(t){return mc(t.element,"span",t.colspan,1),t.element}))}))},u=function(e,n){var r=function(t,e){var n=Oe(t,e).getOrThunk((function(){var n=Ct.fromTag(e,ne(t).dom);return"thead"===e?gc(t,"caption,colgroup",n):"colgroup"===e?gc(t,"caption",n):Vn(t,n),n}));return qn(n),n}(t,n),u=("colgroup"===n?i:o)(e);Wn(r,u)},a=function(e,n){e.length>0?u(e,n):function(e){Oe(t,e).each(Gn)}(n)},c=[],s=[],l=[],f=[];return N(e,(function(t){switch(t.section){case"thead":c.push(t);break;case"tbody":s.push(t);break;case"tfoot":l.push(t);break;case"colgroup":f.push(t)}})),a(f,"colgroup"),a(c,"thead"),a(s,"tbody"),a(l,"tfoot"),{newRows:n,newCells:r}},pc=function(t,e){if(0===t.length)return 0;var n=t[0];return H(t,(function(t){return!e(n.element,t.element)})).getOr(t.length)},vc=function(t,e,n,r){var o=function(t,e){return t[e]}(t,e),i="colgroup"===o.section;return{colspan:pc(o.cells.slice(n),r),rowspan:i?1:pc(function(t,e){return R(t,(function(t){return pn(t,e)}))}(t.slice(e),n),r)}},bc=function(t,e){var n=R(t,(function(t){return R(t.cells,w)}));return R(t,(function(r,o){var i=V(r.cells,(function(r,i){if(!1===n[o][i]){var u=vc(t,o,i,e);return function(t,e,r,o){for(var i=t;i<t+r;i++)for(var u=e;u<e+o;u++)n[i][u]=!0}(o,i,u.rowspan,u.colspan),[(a=r.element,c=u.rowspan,s=u.colspan,l=r.isNew,{element:a,rowspan:c,colspan:s,isNew:l})]}return[];var a,c,s,l}));return function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}}(r.element,i,r.section,r.isNew)}))},yc=function(t,e,n){var r=[];N(t.colgroups,(function(o){for(var i=[],u=0;u<t.grid.columns;u++){var a=Tn.getColumnAt(t,u).map((function(t){return qt(t.element,n,!1)})).getOrThunk((function(){return qt(e.colGap(),!0,!1)}));i.push(a)}r.push(Gt(o.element,i,"colgroup",n))}));for(var o=0;o<t.grid.rows;o++){for(var i=[],u=0;u<t.grid.columns;u++){var a=Tn.getAt(t,o,u).map((function(t){return qt(t.element,n,t.isLocked)})).getOrThunk((function(){return qt(e.gap(),!0,!1)}));i.push(a)}var c=t.all[o],s=Gt(c.element,i,c.section,n);r.push(s)}return r},wc=function(t){return bc(t,_t)},xc=function(t,e){return X(t.all,(function(t){return L(t.cells,(function(t){return _t(e,t.element)}))}))},Cc=function(t,e,n){var r=R(e.selection,(function(e){return nn(e).bind((function(e){return xc(t,e)})).filter(n)})),o=Pe(r);return Le(o.length>0,o)},Sc=function(t,e,n,r,o){return function(i,u,a,c,s){var l=Tn.fromTable(u),f=O.from(null==s?void 0:s.section).getOrThunk(dc);return e(l,a).map((function(e){var n=function(t,e){return yc(t,e,!1)}(l,c),r=t(n,e,_t,o(c),f),i=Sn(r.grid);return{info:e,grid:wc(r.grid),cursor:r.cursor,lockedColumns:i}})).bind((function(t){var e=hc(u,t.grid),o=O.from(null==s?void 0:s.sizing).getOrThunk((function(){return $o(u)})),a=O.from(null==s?void 0:s.resize).getOrThunk(Gi);return n(u,t.grid,t.info,{sizing:o,resize:a,section:f}),r(u),Ju(i,u),Ne(u,xn),t.lockedColumns.length>0&&Ae(u,xn,t.lockedColumns.join(",")),O.some({cursor:t.cursor,newRows:e.newRows,newCells:e.newCells})}))}},kc=function(t,e){return Cc(t,e,x).map((function(t){return{cells:t,generators:e.generators,clipboard:e.clipboard}}))},Oc=function(t,e){return Cc(t,e,x)},_c=function(t,e){return Cc(t,e,(function(t){return!t.isLocked}))},Tc=function(t,e){return j(e,(function(e){return function(t,e){return xc(t,e).exists((function(t){return!t.isLocked}))}(t,e)}))},Ec=function(t,e){return function(t,e){return e.mergable}(0,e).filter((function(e){return Tc(t,e.cells)}))},Ac=function(t,e){return function(t,e){return e.unmergable}(0,e).filter((function(e){return Tc(t,e)}))},Dc=function(t,e,n,r){for(var o=yn(t).rows,i=!0,u=0;u<o.length;u++)for(var a=0;a<bn(o[0]);a++){var c=o[u],s=pn(c,a),l=n(s.element,e);!0===l&&!1===i?gn(c,a,qt(r(),!0,s.isLocked)):!0===l&&(i=!1)}return t},Mc=function(t,e,n,r){var o=yn(t).rows;if(e>0&&e<o.length){var i=function(t,e){return I(t,(function(t,n){return D(t,(function(t){return e(t.element,n.element)}))?t:t.concat([n])}),[])}(o[e-1].cells,n);N(i,(function(t){for(var i=O.none(),u=e;u<o.length;u++)for(var a=function(e){var a=o[u],c=pn(a,e);n(c.element,t.element)&&(i.isNone()&&(i=O.some(r())),i.each((function(t){gn(a,e,qt(t,!0,c.isLocked))})))},c=0;c<bn(o[0]);c++)a(c)}))}return t},Rc=function(t){return{isValue:x,isError:w,getOr:m(t),getOrThunk:m(t),getOrDie:m(t),or:function(e){return Rc(t)},orThunk:function(e){return Rc(t)},fold:function(e,n){return n(t)},map:function(e){return Rc(e(t))},mapError:function(e){return Rc(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return O.some(t)}}},Nc=function(t){return{isValue:w,isError:x,getOr:g,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:g,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Nc(t)},mapError:function(e){return Nc(e(t))},each:d,bind:function(e){return Nc(t)},exists:w,forall:x,toOptional:O.none}},zc={value:Rc,error:Nc,fromOption:function(t,e){return t.fold((function(){return Nc(e)}),Rc)}},Bc=function(t,e){return{rowDelta:0,colDelta:bn(t[0])-bn(e[0])}},Pc=function(t,e){return{rowDelta:t.length-e.length,colDelta:0}},Ic=function(t,e,n,r){var o="colgroup"===e.section?n.col:n.cell;return M(t,(function(t){return qt(o(),!0,r(t))}))},Lc=function(t,e,n,r){var o=t[t.length-1];return t.concat(M(e,(function(){var t="colgroup"===o.section?n.colgroup:n.row,e=wn(o,t,g),i=Ic(e.cells.length,e,n,(function(t){return Ft(r,t.toString())}));return hn(e,i)})))},Hc=function(t,e,n,r){return R(t,(function(t){var o=Ic(e,t,n,w);return dn(t,r,o)}))},Fc=function(t,e,n){var r=e.colDelta<0?Hc:g,o=e.rowDelta<0?Lc:g,i=Sn(t),u=bn(t[0]),a=D(i,(function(t){return t===u-1})),c=r(t,Math.abs(e.colDelta),n,a?u-1:u),s=Sn(c);return o(c,Math.abs(e.rowDelta),n,U(s,x))},Vc=function(t,e,n,r){var o=p(r,pn(t[e],n).element),i=t[e];return t.length>1&&bn(i)>1&&(n>0&&o(vn(i,n-1))||n<i.cells.length-1&&o(vn(i,n+1))||e>0&&o(vn(t[e-1],n))||e<t.length-1&&o(vn(t[e+1],n)))},jc=function(t,e,n){return B(n,(function(n){return n>=t.column&&n<=bn(e[0])+t.column}))},Uc=function(t,e,n,r,o){var i=Sn(e),u=function(t,e,n){var r=bn(e[0]),o=yn(e).cols.length+t.row,i=M(r-t.column,(function(e){return e+t.column}));return{row:o,column:L(i,(function(t){return j(n,(function(e){return e!==t}))})).getOr(r-1)}}(t,e,i),a=yn(n).rows,c=jc(u,a,i);return function(t,e,n){if(t.row>=e.length||t.column>bn(e[0]))return zc.error("invalid start address out of table bounds, row: "+t.row+", column: "+t.column);var r=e.slice(t.row),o=r[0].cells.slice(t.column),i=bn(n[0]),u=n.length;return zc.value({rowDelta:r.length-u,colDelta:o.length-i})}(u,e,a).map((function(t){var n=K(K({},t),{colDelta:t.colDelta-c.length}),i=Fc(e,n,r),s=Sn(i),l=jc(u,a,s);return function(t,e,n,r,o,i){for(var u=t.row,a=t.column,c=u+n.length,s=a+bn(n[0])+i.length,l=U(i,x),f=u;f<c;f++)for(var d=0,m=a;m<s;m++)if(l[m])d++;else{Vc(e,f,m,o)&&Dc(e,vn(e[f],m),o,r.cell);var g=m-a-d,h=pn(n[f-u],g),p=h.element,v=r.replace(p);gn(e[f],m,qt(v,!0,h.isLocked))}return e}(u,i,a,r,o,l)}))},Wc=function(t,e,n,r,o){!function(t,e,n,r){e>0&&e<t[0].cells.length&&N(t,(function(t){var o=t.cells[e-1],i=t.cells[e];n(i.element,o.element)&&gn(t,e,qt(r(),!0,i.isLocked))}))}(e,t,o,r.cell);var i=Pc(n,e),u=Fc(n,i,r),a=Pc(e,u),c=Fc(e,a,r);return R(c,(function(e,n){return dn(e,t,u[n].cells)}))},qc=function(t,e,n,r,o){Mc(e,t,o,r.cell);var i=Sn(e),u=Bc(e,n),a=K(K({},u),{colDelta:u.colDelta-i.length}),c=Fc(e,a,r),s=yn(c),l=s.cols,f=s.rows,d=Sn(c),m=Bc(n,e),g=K(K({},m),{colDelta:m.colDelta+d.length}),h=function(t,e,n){return R(t,(function(t){return I(n,(function(n,r){var o=Ic(1,t,e,x)[0];return mn(n,r,o)}),t)}))}(n,r,d),p=Fc(h,g,r);return l.concat(f.slice(0,t)).concat(p).concat(f.slice(t,f.length))},Gc=function(t,e,n,r,o){var i=yn(t),u=i.rows,a=i.cols,c=u.slice(0,e),s=u.slice(e),l=function(t,e,n,r){return wn(t,(function(t){return r(t,n)}),e)}(u[n],(function(t,n){return e>0&&e<u.length&&r(vn(u[e-1],n),vn(u[e],n))?pn(u[e],n):qt(o(t.element,r),!0,t.isLocked)}),r,o);return a.concat(c).concat([l]).concat(s)},$c=function(t,e,n,r,o){return R(t,(function(t){var i=e>0&&e<bn(t)&&r(vn(t,e-1),vn(t,e)),u=function(t,e,n,r,o,i,u){if("colgroup"!==n&&r)return pn(t,e);var a=pn(t,o);return qt(u(a.element,i),!0,!1)}(t,e,t.section,i,n,r,o);return mn(t,e,u)}))},Xc=function(t,e,n,r){return function(t,e,n,r){return void 0!==vn(t[e],n)&&e>0&&r(vn(t[e-1],n),vn(t[e],n))}(t,e,n,r)||function(t,e,n){return e>0&&n(vn(t,e-1),vn(t,e))}(t[e],n,r)},Kc=function(t,e,n,r){var o=function(t){return function(t){return"row"===t?Ye(e):Ke(e)}(t)?t+"group":t};return t?Qa(e)?o(n):null:r&&Qa(e)?o("row"===n?"col":"row"):null},Yc=function(t,e,n){return qt(n(t.element,e),!0,t.isLocked)},Jc=function(t,e,n,r,o,i,u){return R(t,(function(t,a){return function(t,e){var n=t.cells,r=R(n,e);return Gt(t.element,r,t.section,t.isNew)}(t,(function(t,c){if(function(t){return D(e,(function(e){return n(t.element,e.element)}))}(t)){var s=u(t,a,c)?o(t,n,r):t;return i(s,a,c).each((function(t){var e,n;e=s.element,n={scope:O.from(t)},Rt(n,(function(t,n){t.fold((function(){Ne(e,n)}),(function(t){Ee(e.dom,n,t)}))}))})),s}return t}))}))},Qc=function(t,e,n){return V(t,(function(r,o){return Xc(t,o,e,n)?[]:[pn(r,e)]}))},Zc=function(t,e,n,r,o){var i=yn(t).rows,u=V(e,(function(t){return Qc(i,t,r)})),a=R(t,(function(t){return Za(t.cells)})),c=function(t,e){return j(e,g)&&Za(t)?x:function(t,n,r){return!("th"===$t(t.element)&&e[n])}}(u,a),s=function(t,e){return function(n,r){return O.some(Kc(t,n.element,"row",e[r]))}}(n,a);return Jc(t,u,r,o,Yc,s,c)},ts=function(t,e,n,r,o,i,u){var a=yn(t),c=a.cols,s=a.rows,l=s[e[0]],f=V(e,(function(t){return function(t,e,n){var r=t[e];return V(r.cells,(function(r,o){return Xc(t,e,o,n)?[]:[r]}))}(s,t,o)})),d=R(l.cells,(function(t,e){return Za(Qc(s,e,o))})),m=Y([],s,!0);N(e,(function(t){m[t]=u.transformRow(s[t],n)}));var h=c.concat(m),p=function(t,e){return j(e,g)&&Za(t.cells)?x:function(t,n,r){return!("th"===$t(t.element)&&e[r])}}(l,d),v=function(t,e){return function(n,r,o){return O.some(Kc(t,n.element,"col",e[o]))}}(r,d);return Jc(h,f,o,i,u.transformCell,v,p)},es=function(t,e,n,r){var o=yn(t).rows,i=R(e,(function(t){return pn(o[t.row],t.column)}));return Jc(t,i,n,r,Yc,O.none,x)},ns=function(t){return I(t,(function(t,e){return D(t,(function(t){return t.column===e.column}))?t:t.concat([e])}),[]).sort((function(t,e){return t.column-e.column}))},rs=ee("col"),os=ee("colgroup"),is=function(t){return"tr"===$t(t)||os(t)},us=function(t){return{element:t,colspan:$e(t,"colspan",1),rowspan:$e(t,"rowspan",1)}},as=function(t){return Re(t,"scope").map((function(t){return t.substr(0,3)}))},cs=function(t,e){void 0===e&&(e=us);var n=function(n){if(is(n))return os((o={element:n}).element)?t.colgroup(o):t.row(o);var o,i=function(e){return rs(e.element)?t.col(e):t.cell(e)}(e(n));return r=O.some({item:n,replacement:i}),i},r=O.none();return{getOrInit:function(t,e){return r.fold((function(){return n(t)}),(function(r){return e(t,r.item)?r.replacement:n(t)}))}}},ss=function(t){return function(e){var n=[],r=function(r){var o="td"===t?{scope:null}:{},i=e.replace(r,t,o);return n.push({item:r,sub:i}),i};return{replaceOrInit:function(t,e){return is(t)||rs(t)?t:function(t,e){return L(n,(function(n){return e(n.item,t)}))}(t,e).fold((function(){return r(t)}),(function(n){return e(t,n.item)?n.sub:r(t)}))}}}},ls=function(t){return{unmerge:function(e){var n=as(e);return n.each((function(t){return Ae(e,"scope",t)})),function(){var r=t.cell({element:e,colspan:1,rowspan:1});return Ge(r,"width"),Ge(e,"width"),n.each((function(t){return Ae(r,"scope",t)})),r}},merge:function(t){return Ge(t[0],"width"),function(){var e=Pe(R(t,as));if(0===e.length)return O.none();var n=e[0],r=["row","col"];return D(e,(function(t){return t!==n&&A(r,t)}))?O.none():O.from(n)}().fold((function(){return Ne(t[0],"scope")}),(function(e){return Ae(t[0],"scope",e+"group")})),m(t[0])}}},fs=["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"],ds=Zn(),ms=function(t){return function(t,e){var n=t.property().name(e);return A(fs,n)}(ds,t)},gs=function(t){return function(t,e){var n=t.property().name(e);return A(["ol","ul"],n)}(ds,t)},hs=function(t){return function(t,e){return A(["br","img","hr","input"],t.property().name(e))}(ds,t)},ps=function(t){var e,n=function(t){return"br"===$t(t)},r=function(t){return ni(t).bind((function(e){var r=ae(e).map((function(t){return!!ms(t)||!!hs(t)&&"img"!==$t(t)})).getOr(!1);return oe(e).map((function(o){return!0===r||function(t){return"li"===$t(t)||Se(t,gs).isSome()}(o)||n(e)||ms(o)&&!_t(t,o)?[]:[Ct.fromTag("br")]}))})).getOr([])},o=0===(e=V(t,(function(t){var e=ce(t);return function(t){return j(t,(function(t){return n(t)||Qt(t)&&0===Kn(t).trim().length}))}(e)?[]:e.concat(r(t))}))).length?[Ct.fromTag("br")]:e;qn(t[0]),Wn(t[0],o)},vs=function(t){return Lu(t,!0)},bs=function(t){0===rn(t).length&&Gn(t)},ys=function(t,e){return{grid:t,cursor:e}},ws=function(t,e,n){var r,o,i=yn(t).rows;return O.from(null===(o=null===(r=i[e])||void 0===r?void 0:r.cells[n])||void 0===o?void 0:o.element).filter(vs).orThunk((function(){return function(t){return X(t,(function(t){return X(t.cells,(function(t){var e=t.element;return Le(vs(e),e)}))}))}(i)}))},xs=function(t,e,n){var r=ws(t,e,n);return ys(t,r)},Cs=function(t){return I(t,(function(t,e){return D(t,(function(t){return t.row===e.row}))?t:t.concat([e])}),[]).sort((function(t,e){return t.row-e.row}))},Ss=function(t,e){return function(n,r,o,i,u){var a=Cs(r),c=R(a,(function(t){return t.row})),s=ts(n,c,t,e,o,i.replaceOrInit,u);return xs(s,r[0].row,r[0].column)}},ks=Ss("thead",!0),Os=Ss("tbody",!1),_s=Ss("tfoot",!1),Ts=function(t,e,n){var r=function(t,e){return sn(t,(function(){return e}))}(t,n.section),o=Tn.generate(r);return yc(o,e,!0)},Es=function(t,e,n,r){return function(t,e,n,r){var o=Tn.generate(e),i=r.getWidths(o,r);Ii(o,i,r)}(0,e,0,r.sizing)},As=function(t,e,n,r){return function(t,e,n,r,o){var i=Tn.generate(e),u=r.getWidths(i,r),a=r.pixelWidth(),c=o.calcRedestributedWidths(u,a,n.pixelDelta,r.isRelative),s=c.newSizes,l=c.delta;Ii(i,s,r),r.adjustTableWidth(l)}(0,e,n,r.sizing,r.resize)},Ds=function(t,e){return D(e,(function(t){return 0===t.column&&t.isLocked}))},Ms=function(t,e){return D(e,(function(e){return e.column+e.colspan>=t.grid.columns&&e.isLocked}))},Rs=function(t,e){var n=Lr(t),r=ns(e);return I(r,(function(t,e){return t+n[e.column].map(Br).getOr(0)}),0)},Ns=function(t){return function(e,n){return Oc(e,n).filter((function(n){return!(t?Ds:Ms)(e,n)})).map((function(t){return{details:t,pixelDelta:Rs(e,t)}}))}},zs=function(t){return function(e,n){return kc(e,n).filter((function(n){return!(t?Ds:Ms)(e,n.cells)}))}},Bs=ss("th"),Ps=ss("td"),Is=Sc((function(t,e,n,r){var o=e[0].row,i=Cs(e),u=P(i,(function(t,e){return{grid:Gc(t.grid,o,e.row+t.delta,n,r.getOrInit),delta:t.delta+1}}),{grid:t,delta:0}).grid;return xs(u,o,e[0].column)}),Oc,d,d,cs),Ls=Sc((function(t,e,n,r){var o=Cs(e),i=o[o.length-1],u=i.row+i.rowspan,a=P(o,(function(t,e){return Gc(t,u,e.row,n,r.getOrInit)}),t);return xs(a,u,e[0].column)}),Oc,d,d,cs),Hs=Sc((function(t,e,n,r){var o=e.details,i=ns(o),u=i[0].column,a=P(i,(function(t,e){return{grid:$c(t.grid,u,e.column+t.delta,n,r.getOrInit),delta:t.delta+1}}),{grid:t,delta:0}).grid;return xs(a,o[0].row,u)}),Ns(!0),As,d,cs),Fs=Sc((function(t,e,n,r){var o=e.details,i=o[o.length-1],u=i.column+i.colspan,a=ns(o),c=P(a,(function(t,e){return $c(t,u,e.column,n,r.getOrInit)}),t);return xs(c,o[0].row,u)}),Ns(!1),As,d,cs),Vs=Sc((function(t,e,n,r){var o=ns(e.details),i=function(t,e){return V(t,(function(t){var n=t.cells,r=P(e,(function(t,e){return e>=0&&e<t.length?t.slice(0,e).concat(t.slice(e+1)):t}),n);return r.length>0?[Gt(t.element,r,t.section,t.isNew)]:[]}))}(t,R(o,(function(t){return t.column}))),u=i.length>0?i[0].cells.length-1:0;return xs(i,o[0].row,Math.min(o[0].column,u))}),(function(t,e){return _c(t,e).map((function(e){return{details:e,pixelDelta:-Rs(t,e)}}))}),As,bs,cs),js=Sc((function(t,e,n,r){var o=Cs(e),i=function(t,e,n){var r=yn(t),o=r.rows;return r.cols.concat(o.slice(0,e)).concat(o.slice(n+1))}(t,o[0].row,o[o.length-1].row),u=i.length>0?i.length-1:0;return xs(i,Math.min(e[0].row,u),e[0].column)}),Oc,d,bs,cs),Us=Sc((function(t,e,n,r){var o=ns(e),i=R(o,(function(t){return t.column})),u=Zc(t,i,!0,n,r.replaceOrInit);return xs(u,e[0].row,e[0].column)}),_c,d,d,Bs),Ws=Sc((function(t,e,n,r){var o=ns(e),i=R(o,(function(t){return t.column})),u=Zc(t,i,!1,n,r.replaceOrInit);return xs(u,e[0].row,e[0].column)}),_c,d,d,Ps),qs=Sc(ks,_c,d,d,Bs),Gs=Sc(Os,_c,d,d,Ps),$s=Sc(_s,_c,d,d,Ps),Xs=Sc((function(t,e,n,r){var o=es(t,e,n,r.replaceOrInit);return xs(o,e[0].row,e[0].column)}),_c,d,d,Bs),Ks=Sc((function(t,e,n,r){var o=es(t,e,n,r.replaceOrInit);return xs(o,e[0].row,e[0].column)}),_c,d,d,Ps),Ys=Sc((function(t,e,n,r){var o=e.cells;ps(o);var i=function(t,e,n,r){var o=yn(t).rows;if(0===o.length)return t;for(var i=e.startRow;i<=e.finishRow;i++)for(var u=e.startCol;u<=e.finishCol;u++){var a=o[i],c=pn(a,u).isLocked;gn(a,u,qt(r(),!1,c))}return t}(t,e.bounds,0,r.merge(o));return ys(i,O.from(o[0]))}),Ec,Es,d,ls),Js=Sc((function(t,e,n,r){var o=P(e,(function(t,e){return Dc(t,e,n,r.unmerge(e))}),t);return ys(o,O.from(e[0]))}),Ac,Es,d,ls),Qs=Sc((function(t,e,n,r){var o=function(t,e){var n=Tn.fromTable(t);return yc(n,e,!0)}(e.clipboard,e.generators),i=function(t,e){return{row:t,column:e}}(e.row,e.column);return Uc(i,t,o,e.generators,n).fold((function(){return ys(t,O.some(e.element))}),(function(t){return xs(t,e.row,e.column)}))}),(function(t,e){return nn(e.element).bind((function(n){return xc(t,n).map((function(t){return K(K({},t),{generators:e.generators,clipboard:e.clipboard})}))}))}),Es,d,cs),Zs=Sc((function(t,e,n,r){var o=yn(t).rows,i=e.cells[0].column,u=o[e.cells[0].row],a=Ts(e.clipboard,e.generators,u),c=Wc(i,t,a,e.generators,n);return xs(c,e.cells[0].row,e.cells[0].column)}),zs(!0),d,d,cs),tl=Sc((function(t,e,n,r){var o=yn(t).rows,i=e.cells[e.cells.length-1].column+e.cells[e.cells.length-1].colspan,u=o[e.cells[0].row],a=Ts(e.clipboard,e.generators,u),c=Wc(i,t,a,e.generators,n);return xs(c,e.cells[0].row,e.cells[0].column)}),zs(!1),d,d,cs),el=Sc((function(t,e,n,r){var o=yn(t).rows,i=e.cells[0].row,u=o[i],a=Ts(e.clipboard,e.generators,u),c=qc(i,t,a,e.generators,n);return xs(c,e.cells[0].row,e.cells[0].column)}),kc,d,d,cs),nl=Sc((function(t,e,n,r){var o=yn(t).rows,i=e.cells[e.cells.length-1].row+e.cells[e.cells.length-1].rowspan,u=o[e.cells[0].row],a=Ts(e.clipboard,e.generators,u),c=qc(i,t,a,e.generators,n);return xs(c,e.cells[0].row,e.cells[0].column)}),kc,d,d,cs),rl=function(t,e){var n=Tn.fromTable(t);return Oc(n,e).bind((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=F(R(n.all,(function(t){return B(t.cells,(function(t){return t.column>=r&&t.column<o}))})));return nc(i)})).getOr("")},ol=function(t,e){var n=Tn.fromTable(t);return Oc(n,e).bind(nc).getOr("")},il=function(t,e){var n=Tn.fromTable(t);return Oc(n,e).bind((function(t){var e=t[t.length-1],r=t[0].row,o=e.row+e.rowspan;return function(t){var e=R(t,(function(t){return ec(t).type})),n=A(e,"header"),r=A(e,"footer");if(n||r){var o=A(e,"body");return!n||o||r?n||o||!r?O.none():O.some("footer"):O.some("header")}return O.some("body")}(n.all.slice(r,o))})).getOr("")},ul=function(t,e,n){var r=function(t){return"table"===$t(gi(t))},o=za(t),i=Na(t)?d:Ja,u=function(e){switch(Da(t)){case"section":return sc();case"sectionCells":return lc();case"cells":return fc();default:return cc(e,"section")}},a=function(n,r){return r.cursor.fold((function(){var r=rn(n);return G(r).filter(pe).map((function(r){e.clear(n);var o=t.dom.createRng();return o.selectNode(r.dom),t.selection.setRng(o),Ae(r,"data-mce-selected","1"),o}))}),(function(r){var o=Ka(Ya,r),i=t.dom.createRng();return i.setStart(o.element.dom,o.offset),i.setEnd(o.element.dom,o.offset),t.selection.setRng(i),e.clear(n),O.some(i)}))},c=function(e,n,r,i,c){return function(s,l,f){void 0===f&&(f=!1),yi(s);var d=i(),m=Ct.fromDom(t.getDoc()),g=fi(r,m,o),h={sizing:Ia(t,s),resize:Na(t)?qi():Gi(),section:u(s)};return n(s)?e(d,s,l,g,h).bind((function(e){N(e.newRows,(function(e){oa(t,e.dom)})),N(e.newCells,(function(e){ia(t,e.dom)}));var n=a(s,e);return pe(s)&&(yi(s),f||ua(t,s.dom,c)),n.map((function(t){return{rng:t,effect:c}}))})):O.none()}};return{deleteRow:c(js,(function(e){return!1===r(t)||su(e).rows>1}),d,n,ca),deleteColumn:c(Vs,(function(e){return!1===r(t)||su(e).columns>1}),d,n,ca),insertRowsBefore:c(Is,x,d,n,ca),insertRowsAfter:c(Ls,x,d,n,ca),insertColumnsBefore:c(Hs,x,i,n,ca),insertColumnsAfter:c(Fs,x,i,n,ca),mergeCells:c(Ys,x,d,n,ca),unmergeCells:c(Js,x,d,n,ca),pasteColsBefore:c(Zs,x,d,n,ca),pasteColsAfter:c(tl,x,d,n,ca),pasteRowsBefore:c(el,x,d,n,ca),pasteRowsAfter:c(nl,x,d,n,ca),pasteCells:c(Qs,x,d,n,sa),makeCellsHeader:c(Xs,x,d,n,ca),unmakeCellsHeader:c(Ks,x,d,n,ca),makeColumnsHeader:c(Us,x,d,n,ca),unmakeColumnsHeader:c(Ws,x,d,n,ca),makeRowsHeader:c(qs,x,d,n,ca),makeRowsBody:c(Gs,x,d,n,ca),makeRowsFooter:c($s,x,d,n,ca),getTableRowType:il,getTableCellType:ol,getTableColType:rl}},al={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},cl=function(t){var e=Ct.fromTag("colgroup");return M(t,(function(){return Vn(e,Ct.fromTag("col"))})),e},sl=function(t,e,n,r){return M(t,(function(t){return function(t,e,n,r){for(var o=Ct.fromTag("tr"),i=0;i<t;i++){var u=r<e||i<n?Ct.fromTag("th"):Ct.fromTag("td");i<n&&Ae(u,"scope","row"),r<e&&Ae(u,"scope","col"),Vn(u,Ct.fromTag("br")),Vn(o,u)}return o}(e,n,r,t)}))},ll=function(t,e){t.selection.select(e.dom,!0),t.selection.collapse(!0)},fl=function(t,e,n,o,i){var u=ya(t),a={styles:u,attributes:ba(t),colGroups:Aa(t)};return t.undoManager.ignore((function(){var r=function(t,e,n,r,o,i){void 0===i&&(i=al);var u=Ct.fromTag("table"),a="cells"!==o;je(u,i.styles),De(u,i.attributes),i.colGroups&&Vn(u,cl(e));var c=Math.min(t,n);if(a&&n>0){var s=Ct.fromTag("thead");Vn(u,s);var l=sl(n,e,"sectionCells"===o?c:0,r);Wn(s,l)}var f=Ct.fromTag("tbody");Vn(u,f);var d=sl(a?t-c:t,e,a?0:n,r);return Wn(f,d),u}(n,e,i,o,Da(t),a);Ae(r,"data-mce-id","__mce");var u=function(t){var e=Ct.fromTag("div"),n=Ct.fromDom(t.dom.cloneNode(!0));return Vn(e,n),function(t){return t.dom.innerHTML}(e)}(r);t.insertContent(u),t.addVisual()})),_e(gi(t),'table[data-mce-id="__mce"]').map((function(e){return Ta(t)?Fa(e):Ea(t)?Va(e):(_a(t)||function(t){return r(t)&&-1!==t.indexOf("%")}(u.width))&&Ha(e),yi(e),Ne(e,"data-mce-id"),function(t,e){N(xe(e,"tr"),(function(e){oa(t,e.dom),N(xe(e,"th,td"),(function(e){ia(t,e.dom)}))}))}(t,e),function(t,e){_e(e,"td,th").each(p(ll,t))}(t,e),e.dom})).getOr(null)},dl=function(t,e,n,r,o){void 0===r&&(r={});var i=function(t){return f(t)&&t>0};if(i(e)&&i(n)){var u=r.headerRows||0,a=r.headerColumns||0;return fl(t,n,e,a,u)}return console.error(o),null},ml=function(t){return function(){return t().fold((function(){return[]}),(function(t){return R(t,(function(t){return t.dom}))}))}},gl=function(t){return function(e){var n=e.length>0?O.some(mi(e)):O.none();t(n)}},hl=function(t){return function(e,n,r){void 0===r&&(r={});var o=dl(t,n,e,r,"Invalid values for insertTable - rows and columns values are required to insert a table.");return t.undoManager.add(),o}},pl=function(t,e,n){var r=$e(t,e,1);1===n||r<=1?Ne(t,e):Ae(t,e,Math.min(n,r))},vl=function(t,e){var n=Tn.fromTable(t);return _c(n,e).map((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=function(t,e,n){if(Tn.hasColumns(t)){var r=B(Tn.justColumns(t),(function(t){return t.column>=e&&t.column<n})),o=R(r,(function(t){var r=kr(t.element);return pl(r,"span",n-e),r})),i=Ct.fromTag("colgroup");return Wn(i,o),[i]}return[]}(n,r,o),u=function(t,e,n){return R(t.all,(function(t){var r=B(t.cells,(function(t){return t.column>=e&&t.column<n})),o=R(r,(function(t){var r=kr(t.element);return pl(r,"colspan",n-e),r})),i=Ct.fromTag("tr");return Wn(i,o),i}))}(n,r,o);return Y(Y([],i,!0),u,!0)}))},bl=function(t,e,n){var r=Tn.fromTable(t);return Oc(r,e).bind((function(t){var e=yc(r,n,!1),o=yn(e).rows.slice(t[0].row,t[t.length-1].row+t[t.length-1].rowspan),i=V(o,(function(t){var e=B(t.cells,(function(t){return!t.isLocked}));return e.length>0?[K(K({},t),{cells:e})]:[]})),u=wc(i);return Le(u.length>0,u)})).map((function(t){return function(t){return R(t,(function(t){var e=Sr(t.element);return N(t.cells,(function(t){var n=kr(t.element);mc(n,"colspan",t.colspan,1),mc(n,"rowspan",t.rowspan,1),Vn(e,n)})),e}))}(t)}))},yl=tinymce.util.Tools.resolve("tinymce.util.Tools"),wl=function(t,e,n){return function(e,r){for(var o=0;o<r.length;o++){var i=t.getStyle(r[o],n);if(void 0===e&&(e=i),e!==i)return""}return e}(void 0,t.select("td,th",e))},xl=function(t,e,n){n&&t.formatter.apply("align"+n,{},e)},Cl=function(t,e){yl.each("left center right".split(" "),(function(n){t.formatter.remove("align"+n,{},e)}))},Sl=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],kl=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Ol=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,_l=function(t){return(e=t,n="#",ot(e,n)?function(t,e){return t.substring(e)}(e,n.length):e).toUpperCase();var e,n},Tl=function(t){return function(t){return kl.test(t)||Ol.test(t)}(t)?O.some({value:_l(t)}):O.none()},El=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Al=function(t){return function(t){return{value:t}}(El(t.red)+El(t.green)+El(t.blue))},Dl=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Ml=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Rl=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},Nl=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return Rl(o,i,u,a)},zl=function(t){return Tl(t).orThunk((function(){return function(t){if("transparent"===t)return O.some(Rl(0,0,0,0));var e=Dl.exec(t);if(null!==e)return O.some(Nl(e[1],e[2],e[3],"1"));var n=Ml.exec(t);return null!==n?O.some(Nl(n[1],n[2],n[3],n[4])):O.none()}(t).map(Al)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],u=r[2],a=r[3];return Al(Rl(o,i,u,a))}))},Bl=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Pl=function(t){var e=Bl(O.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(O.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(O.some(t))}}},Il=function(){var t=Pl(d);return K(K({},t),{on:function(e){return t.get().each(e)}})},Ll=function(t,e,n,r){return function(o){var i=Pl((function(t){return t.unbind()})),u=!at(r),a=function(){var a=Ai(e),c=function(e){return t.formatter.match(n,{value:r},e.dom,u)};u?(o.setActive(!D(a,c)),i.set(t.formatter.formatChanged(n,(function(t){return o.setActive(!t)}),!0))):(o.setActive(j(a,c)),i.set(t.formatter.formatChanged(n,o.setActive,!1,{value:r})))};return t.initialized?a():t.on("init",a),i.clear}},Hl=function(t){return Vt(t,"menu")},Fl=function(t){return R(t,(function(t){var e=t.text||t.title;return Hl(t)?{text:e,items:Fl(t.menu)}:{text:e,value:t.value}}))},Vl=function(t,e,n,r,o){return R(n,(function(n){var i=n.text||n.title;return Hl(n)?{type:"nestedmenuitem",text:i,getSubmenuItems:function(){return Vl(t,e,n.menu,r,o)}}:{text:i,type:"togglemenuitem",onAction:function(){return o(n.value)},onSetup:Ll(t,e,r,n.value)}}))},jl=function(t,e){return function(n){var r;t.execCommand("mceTableApplyCellStyle",!1,((r={})[e]=n,r))}},Ul=function(t){return V(t,(function(t){return Hl(t)?[K(K({},t),{menu:Ul(t.menu)})]:at(t.value)?[t]:[]}))},Wl=function(t,e,n,r,o){return function(i){return i(Vl(t,e,n,r,o))}},ql=function(t,e,n){var r=R(e,(function(t){return{text:t.title,value:"#"+zl(t.value).value,type:"choiceitem"}}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:r.length>0?r:void 0,allowCustomColors:!1},onAction:function(e){var r,o="remove"===e.value?"":e.value;t.execCommand("mceTableApplyCellStyle",!1,((r={})[n]=o,r))}}]},Gl=function(t){return function(){var e="header"===t.queryCommandValue("mceTableRowType")?"body":"header";t.execCommand("mceTableRowType",!1,{type:e})}},$l=function(t){return function(){var e="th"===t.queryCommandValue("mceTableColType")?"td":"th";t.execCommand("mceTableColType",!1,{type:e})}},Xl=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:Sl}],Kl=function(t){return Xl.concat(function(t){var e=Fl(ka(t));return e.length>0?O.some({name:"class",type:"listbox",label:"Class",items:e}):O.none()}(t).toArray())},Yl=function(t,e){var n=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(Fl(va(t)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===e?[{name:"borderwidth",type:"input",label:"Border width"}].concat(n):n}},Jl=function(t){return function(e,n){var r=e.dom;return{setAttrib:function(e,o){t&&!o||r.setAttrib(n,e,o)},setStyle:function(e,o){t&&!o||r.setStyle(n,e,o)},setFormat:function(r,o){t&&!o||(""===o?e.formatter.remove(r,{value:null},n,!0):e.formatter.apply(r,{value:o},n))}}}},Ql={normal:Jl(!1),ifTruthy:Jl(!0)},Zl=function(t){return function(e){return ot(e,"rgb")?t.toHex(e):e}},tf=function(t,e){var n=Ct.fromDom(e);return{borderwidth:qe(n,"border-width").getOr(""),borderstyle:qe(n,"border-style").getOr(""),bordercolor:qe(n,"border-color").map(Zl(t)).getOr(""),backgroundcolor:qe(n,"background-color").map(Zl(t)).getOr("")}},ef=function(t){var e=t[0],n=t.slice(1);return N(n,(function(t){N(Dt(e),(function(n){Rt(t,(function(t,r){var o=e[n];""!==o&&n===r&&o!==t&&(e[n]="")}))}))})),e},nf=function(t,e,n,r){return L(t,(function(t){return!c(n.formatter.matchNode(r,e+t))})).getOr("")},rf=p(nf,["left","center","right"],"align"),of=p(nf,["top","middle","bottom"],"valign"),uf=function(t){return un(Ct.fromDom(t)).map((function(e){var n={selection:mi(t.cells)};return il(e,n)})).getOr("")},af=function(t,e){var n=Tn.fromTable(t),r=Tn.justCells(n),o=B(r,(function(t){return D(e,(function(e){return _t(t.element,e)}))}));return R(o,(function(t){return{element:t.element.dom,column:Tn.getColumnAt(n,t.column).map((function(t){return t.element.dom}))}}))},cf=function(t,e,n){var r=1===e.length;N(e,(function(e){var o=e.element,i=r?Ql.normal(t,o):Ql.ifTruthy(t,o);!function(t,e,n){t.setAttrib("scope",n.scope),t.setAttrib("class",n.class),t.setStyle("height",bi(n.height)),e.setStyle("width",bi(n.width))}(i,e.column.map((function(e){return r?Ql.normal(t,e):Ql.ifTruthy(t,e)})).getOr(i),n),wa(t)&&function(t,e){t.setFormat("tablecellbackgroundcolor",e.backgroundcolor),t.setFormat("tablecellbordercolor",e.bordercolor),t.setFormat("tablecellborderstyle",e.borderstyle),t.setFormat("tablecellborderwidth",bi(e.borderwidth))}(i,n),r&&(Cl(t,o),function(t,e){yl.each("top middle bottom".split(" "),(function(n){t.formatter.remove("valign"+n,{},e)}))}(t,o)),n.halign&&xl(t,o,n.halign),n.valign&&function(t,e,n){n&&t.formatter.apply("valign"+n,{},e)}(t,o,n.valign)}))},sf=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){!function(t,e,n,r){var o=Bt(r,(function(t,e){return n[e]!==t}));Lt(o)>0&&e.length>=1&&un(e[0]).each((function(n){var i=af(n,e),u=Lt(Bt(o,(function(t,e){return"scope"!==e&&"celltype"!==e})))>0,a=Ft(o,"celltype");(u||Ft(o,"scope"))&&cf(t,i,r),a&&function(t,e){t.execCommand("mceTableCellType",!1,{type:e.celltype,no_events:!0})}(t,r),ua(t,n.dom,{structure:a,style:u})}))}(t,e,n,o),t.focus()}))},lf=function(t,e){var n=un(e[0]).map((function(n){return R(af(n,e),(function(e){return function(t,e,n,r){var o,i=t.dom,u=r.getOr(e),a=function(t,e){return i.getStyle(t,e)||i.getAttrib(t,e)};return K({width:a(u,"width"),height:a(e,"height"),scope:i.getAttrib(e,"scope"),celltype:(o=e,o.nodeName.toLowerCase()),class:i.getAttrib(e,"class",""),halign:rf(t,e),valign:of(t,e)},n?tf(i,e):{})}(t,e.element,wa(t),e.column)}))}));return ef(n.getOrDie())},ff=function(t,e){var n=Ai(e);if(0!==n.length){var r=lf(t,n),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:Kl(t)},Yl(t,"cell")]},i={type:"panel",items:[{type:"grid",columns:2,items:Kl(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:wa(t)?o:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:p(sf,t,n,r)})}},df=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],mf=function(t){return df.concat(function(t){var e=Fl(function(t){return t.getParam("table_row_class_list",[],"array")}(t));return e.length>0?O.some({name:"class",type:"listbox",label:"Class",items:e}):O.none()}(t).toArray())},gf=function(t,e,n,r){var o=1===e.length;N(e,(function(e){var i=o?Ql.normal(t,e):Ql.ifTruthy(t,e);!function(t,e){t.setAttrib("class",e.class),t.setStyle("height",bi(e.height))}(i,n),xa(t)&&function(t,e){t.setStyle("background-color",e.backgroundcolor),t.setStyle("border-color",e.bordercolor),t.setStyle("border-style",e.borderstyle)}(i,n),n.align!==r.align&&(Cl(t,e),xl(t,e,n.align))}))},hf=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){!function(t,e,n,r){var o=Bt(r,(function(t,e){return n[e]!==t}));if(Lt(o)>0){var i=Ft(o,"type"),u=!i||Lt(o)>1;u&&gf(t,e,r,n),i&&function(t,e){t.execCommand("mceTableRowType",!1,{type:e.type,no_events:!0})}(t,r),un(Ct.fromDom(e[0])).each((function(e){return ua(t,e.dom,{structure:i,style:u})}))}}(t,e,n,o),t.focus()}))},pf=function(t){var e,n,r,o,i=(e=wi(t),n=ki.selected,r=Ei(e),o=r.bind((function(t){return un(t)})).map((function(t){return an(t)})),Ie(r,o,(function(t,e){return B(e,(function(e){return D(mi(e.dom.cells),(function(e){return"1"===Me(e,n)||_t(e,t)}))}))})).getOr([]));if(0!==i.length){var u=R(i,(function(e){return function(t,e,n){var r=t.dom;return K({height:r.getStyle(e,"height")||r.getAttrib(e,"height"),class:r.getAttrib(e,"class",""),type:uf(e),align:rf(t,e)},n?tf(r,e):{})}(t,e.dom,xa(t))})),a=ef(u),c={type:"tabpanel",tabs:[{title:"General",name:"general",items:mf(t)},Yl(t,"row")]},s={type:"panel",items:[{type:"grid",columns:2,items:mf(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:xa(t)?c:s,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:a,onSubmit:p(hf,t,R(i,(function(t){return t.dom})),a)})}},vf=function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=function(t){return t.getParam("table_appearance_options",!0,"boolean")}(t)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],i=e.length>0?[{type:"listbox",name:"class",label:"Class",items:e}]:[];return r.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(o).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(i)},bf=function(t,e,n,o){if("TD"===e.tagName||"TH"===e.tagName)r(n)?t.setStyle(e,n,o):t.setStyle(e,n);else if(e.children)for(var i=0;i<e.children.length;i++)bf(t,e.children[i],n,o)},yf=function(t,e,n,r){var o=t.dom,i=r.getData(),u=Bt(i,(function(t,e){return n[e]!==t}));r.close(),""===i.class&&delete i.class,t.undoManager.transact((function(){if(!e){var n=parseInt(i.cols,10)||1,r=parseInt(i.rows,10)||1;e=fl(t,n,r,0,0)}if(Lt(u)>0){!function(t,e,n){var r=t.dom,o={},i={};if(o.class=n.class,i.height=bi(n.height),r.getAttrib(e,"width")&&!Sa(t)?o.width=function(t){return t?t.replace(/px$/,""):""}(n.width):i.width=bi(n.width),Sa(t)?(i["border-width"]=bi(n.border),i["border-spacing"]=bi(n.cellspacing)):(o.border=n.border,o.cellpadding=n.cellpadding,o.cellspacing=n.cellspacing),Sa(t)&&e.children)for(var u=0;u<e.children.length;u++)bf(r,e.children[u],{"border-width":bi(n.border),padding:bi(n.cellpadding)}),Ca(t)&&bf(r,e.children[u],{"border-color":n.bordercolor});Ca(t)&&(i["background-color"]=n.backgroundcolor,i["border-color"]=n.bordercolor,i["border-style"]=n.borderstyle),o.style=r.serializeStyle(K(K({},ya(t)),i)),r.setAttribs(e,K(K({},ba(t)),o))}(t,e,i);var a=o.select("caption",e)[0];(a&&!i.caption||!a&&i.caption)&&t.execCommand("mceTableToggleCaption"),""===i.align?Cl(t,e):xl(t,e,i.align)}if(t.focus(),t.addVisual(),Lt(u)>0){var c=Ft(u,"caption"),s=!c||Lt(u)>1;ua(t,e,{structure:c,style:s})}}))},wf=function(t,e){var n,r=t.dom,o=function(t,e){var n,r,o,i,u=ya(t),a=ba(t),c=e?(n=t.dom,{borderstyle:Ht(u,"border-style").getOr(""),bordercolor:Zl(n)(Ht(u,"border-color").getOr("")),backgroundcolor:Zl(n)(Ht(u,"background-color").getOr(""))}):{};return K(K(K(K(K(K({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),u),a),c),(i=u["border-width"],Sa(t)&&i?{border:i}:Ht(a,"border").fold((function(){return{}}),(function(t){return{border:t}})))),(r=Ht(u,"border-spacing").or(Ht(a,"cellspacing")).fold((function(){return{}}),(function(t){return{cellspacing:t}})),o=Ht(u,"border-padding").or(Ht(a,"cellpadding")).fold((function(){return{}}),(function(t){return{cellpadding:t}})),K(K({},r),o)))}(t,Ca(t));!1===e?(n=r.getParent(t.selection.getStart(),"table",t.getBody()))?o=function(t,e,n){var r=t.dom,o=Sa(t)?r.getStyle(e,"border-spacing")||r.getAttrib(e,"cellspacing"):r.getAttrib(e,"cellspacing")||r.getStyle(e,"border-spacing"),i=Sa(t)?wl(r,e,"padding")||r.getAttrib(e,"cellpadding"):r.getAttrib(e,"cellpadding")||wl(r,e,"padding");return K({width:r.getStyle(e,"width")||r.getAttrib(e,"width"),height:r.getStyle(e,"height")||r.getAttrib(e,"height"),cellspacing:o,cellpadding:i,border:function(e,n){var r=qe(Ct.fromDom(n),"border-width");return Sa(t)&&r.isSome()?r.getOr(""):e.getAttrib(n,"border")||wl(t.dom,n,"border-width")||wl(t.dom,n,"border")}(r,e),caption:!!r.select("caption",e)[0],class:r.getAttrib(e,"class",""),align:rf(t,e)},n?tf(r,e):{})}(t,n,Ca(t)):Ca(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""):(o.cols="1",o.rows="1",Ca(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=Fl(Oa(t));i.length>0&&o.class&&(o.class=o.class.replace(/\s*mce\-item\-table\s*/g,""));var u={type:"grid",columns:2,items:vf(t,i,e)},a=Ca(t)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[u]},Yl(t,"table")]}:{type:"panel",items:[u]};t.windowManager.open({title:"Table Properties",size:"normal",body:a,onSubmit:p(yf,t,n,o),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},xf=function(t){return Ti(wi(t),vi(t))},Cf=function(t,e,n,i,u){var a=vi(t),c=function(t){return un(t,a)},s=function(e){return function(t){return Ei(wi(t),vi(t))}(t).bind((function(t){return c(t).map((function(n){return e(n,t)}))}))},l=function(e){t.focus()},f=function(t,e){return void 0===e&&(e=!1),s((function(n,r){var o=Oi(i,n,r);t(n,o,e).each(l)}))},m=function(){return s((function(e,n){var r=Oi(i,e,n),o=fi(d,Ct.fromDom(t.getDoc()),O.none());return bl(e,r,o)}))},g=function(){return s((function(t,e){var n=Oi(i,t,e);return vl(t,n)}))},h=function(e,n){return n().each((function(n){var r=R(n,(function(t){return kr(t)}));s((function(n,o){var u=di(Ct.fromDom(t.getDoc())),a=function(t,e,n,r){return{selection:xi(t),clipboard:n,generators:r}}(i,0,r,u);e(n,a).each(l)}))}))},v=function(t){return function(e,n){return Ht(n,"type").each((function(e){f(t(e),n.no_events)}))}};Rt({mceTableSplitCells:function(){return f(e.unmergeCells)},mceTableMergeCells:function(){return f(e.mergeCells)},mceTableInsertRowBefore:function(){return f(e.insertRowsBefore)},mceTableInsertRowAfter:function(){return f(e.insertRowsAfter)},mceTableInsertColBefore:function(){return f(e.insertColumnsBefore)},mceTableInsertColAfter:function(){return f(e.insertColumnsAfter)},mceTableDeleteCol:function(){return f(e.deleteColumn)},mceTableDeleteRow:function(){return f(e.deleteRow)},mceTableCutCol:function(){return g().each((function(t){u.setColumns(t),f(e.deleteColumn)}))},mceTableCutRow:function(){return m().each((function(t){u.setRows(t),f(e.deleteRow)}))},mceTableCopyCol:function(){return g().each((function(t){return u.setColumns(t)}))},mceTableCopyRow:function(){return m().each((function(t){return u.setRows(t)}))},mceTablePasteColBefore:function(){return h(e.pasteColsBefore,u.getColumns)},mceTablePasteColAfter:function(){return h(e.pasteColsAfter,u.getColumns)},mceTablePasteRowBefore:function(){return h(e.pasteRowsBefore,u.getRows)},mceTablePasteRowAfter:function(){return h(e.pasteRowsAfter,u.getRows)},mceTableDelete:function(){return xf(t).each((function(e){un(e,a).filter(y(a)).each((function(e){var n=Ct.fromText("");if(Hn(e,n),Gn(e),t.dom.isEmpty(t.getBody()))t.setContent(""),t.selection.setCursorLocation();else{var r=t.dom.createRng();r.setStart(n.dom,0),r.setEnd(n.dom,0),t.selection.setRng(r),t.nodeChanged()}}))}))},mceTableCellToggleClass:function(e,n){s((function(e){var r=Ai(i),o=j(r,(function(e){return t.formatter.match("tablecellclass",{value:n},e.dom)}))?t.formatter.remove:t.formatter.apply;N(r,(function(t){return o("tablecellclass",{value:n},t.dom)})),ua(t,e.dom,aa)}))},mceTableToggleClass:function(e,n){s((function(e){t.formatter.toggle("tableclass",{value:n},e.dom),ua(t,e.dom,aa)}))},mceTableToggleCaption:function(){xf(t).each((function(e){un(e,a).each((function(n){Oe(n,"caption").fold((function(){var e=Ct.fromTag("caption");Vn(e,Ct.fromText("Caption")),function(t,e,n){se(t,n).fold((function(){Vn(t,e)}),(function(t){Ln(t,e)}))}(n,e,0),t.selection.setCursorLocation(e.dom,0)}),(function(r){ee("caption")(e)&&Ot("td",n).each((function(e){return t.selection.setCursorLocation(e.dom,0)})),Gn(r)})),ua(t,n.dom,ca)}))}))},mceTableSizingMode:function(e,n){return function(e){return xf(t).each((function(n){Ea(t)||Ta(t)||_a(t)||un(n,a).each((function(n){"relative"!==e||uu(n)?"fixed"!==e||au(n)?"responsive"!==e||cu(n)||Va(n):Fa(n):Ha(n),yi(n),ua(t,n.dom,ca)}))}))}(n)},mceTableCellType:v((function(t){return"th"===t?e.makeCellsHeader:e.unmakeCellsHeader})),mceTableColType:v((function(t){return"th"===t?e.makeColumnsHeader:e.unmakeColumnsHeader})),mceTableRowType:v((function(t){switch(t){case"header":return e.makeRowsHeader;case"footer":return e.makeRowsFooter;default:return e.makeRowsBody}}))},(function(e,n){return t.addCommand(n,e)})),Rt({mceTableProps:p(wf,t,!1),mceTableRowProps:p(pf,t),mceTableCellProps:p(ff,t,i)},(function(e,n){return t.addCommand(n,(function(){return e()}))})),t.addCommand("mceInsertTable",(function(e,n){o(n)&&Dt(n).length>0?dl(t,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):wf(t,!0)})),t.addCommand("mceTableApplyCellStyle",(function(e,n){var u=function(t){return"tablecell"+t.toLowerCase().replace("-","")};if(o(n)){var a=Ai(i);if(0!==a.length){var s=Bt(n,(function(e,n){return t.formatter.has(u(n))&&r(e)}));(function(t){for(var e in t)if(Mt.call(t,e))return!1;return!0})(s)||(Rt(s,(function(e,n){N(a,(function(r){Ql.normal(t,r.dom).setFormat(u(n),e)}))})),c(a[0]).each((function(e){return ua(t,e.dom,aa)})))}}}))},Sf={remove_similar:!0,inherit:!1},kf=K({selector:"td,th"},Sf),Of={tablecellbackgroundcolor:K({styles:{backgroundColor:"%value"}},kf),tablecellverticalalign:K({styles:{"vertical-align":"%value"}},kf),tablecellbordercolor:K({styles:{borderColor:"%value"}},kf),tablecellclass:K({classes:["%value"]},kf),tableclass:K({selector:"table",classes:["%value"]},Sf),tablecellborderstyle:K({styles:{borderStyle:"%value"}},kf),tablecellborderwidth:K({styles:{borderWidth:"%value"}},kf)},_f=hr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),Tf=K(K({},_f),{none:function(t){return void 0===t&&(t=void 0),_f.none(t)}}),Ef=function(t,e,n,r,o){void 0===o&&(o=x);var i=1===r;if(!i&&n<=0)return Tf.first(t[0]);if(i&&n>=t.length-1)return Tf.last(t[t.length-1]);var u=n+r,a=t[u];return o(a)?Tf.middle(e,a):Ef(t,e,u,r,o)},Af=function(t,e){return un(t,e).bind((function(e){var n=rn(e);return H(n,(function(e){return _t(t,e)})).map((function(t){return{index:t,all:n}}))}))},Df=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Mf=hr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Rf={before:Mf.before,on:Mf.on,after:Mf.after,cata:function(t,e,n,r){return t.fold(e,n,r)},getStart:function(t){return t.fold(g,g,g)}},Nf=hr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),zf={domRange:Nf.domRange,relative:Nf.relative,exact:Nf.exact,exactFromRange:function(t){return Nf.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e,n=function(t){return t.match({domRange:function(t){return Ct.fromDom(t.startContainer)},relative:function(t,e){return Rf.getStart(t)},exact:function(t,e,n,r){return t}})}(t);return e=n,Ct.fromDom(re(e).dom.defaultView)},range:Df},Bf=function(t,e){var n=t.document.createRange();return n.selectNode(e.dom),n},Pf=function(t,e){var n=t.document.createRange();return If(n,e),n},If=function(t,e){return t.selectNodeContents(e.dom)},Lf=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Hf=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Ff=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Vf=hr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),jf=function(t,e,n){return e(Ct.fromDom(n.startContainer),n.startOffset,Ct.fromDom(n.endContainer),n.endOffset)},Uf=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return Vf.rtl(Ct.fromDom(t.endContainer),t.endOffset,Ct.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return jf(0,Vf.ltr,n)})):jf(0,Vf.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:m(t),rtl:O.none}},relative:function(e,n){return{ltr:J((function(){return Lf(t,e,n)})),rtl:J((function(){return O.some(Lf(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:J((function(){return Hf(t,e,n,r,o)})),rtl:J((function(){return O.some(Hf(t,r,o,e,n))}))}}})}(t,e))},Wf=function(t,e){return Uf(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};Vf.ltr,Vf.rtl;var qf=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},Gf=function(t,e,n,r,o){var i=function(n){var r=t.dom.createRange();return r.setStart(e.dom,n),r.collapse(!0),r},u=Kn(e).length,a=function(t,e,n,r,o){if(0===o)return 0;if(e===r)return o-1;for(var i=r,u=1;u<o;u++){var a=t(u),c=Math.abs(e-a.left);if(n<=a.bottom){if(n<a.top||c>i)return u-1;i=c}}return 0}((function(t){return i(t).getBoundingClientRect()}),n,r,o.right,u);return i(a)},$f=function(t,e,n,r){return Qt(e)?function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getClientRects();return X(i,(function(t){return qf(t,n,r)?O.some(t):O.none()})).map((function(o){return Gf(t,e,n,r,o)}))}(t,e,n,r):function(t,e,n,r){var o=t.dom.createRange(),i=ce(e);return X(i,(function(e){return o.selectNode(e.dom),qf(o.getBoundingClientRect(),n,r)?$f(t,e,n,r):O.none()}))}(t,e,n,r)},Xf=function(t,e){return e-t.left<t.right-e},Kf=function(t,e,n){var r=t.dom.createRange();return r.selectNode(e.dom),r.collapse(n),r},Yf=function(t,e,n){var r=t.dom.createRange();r.selectNode(e.dom);var o=r.getBoundingClientRect(),i=Xf(o,n);return(!0===i?ei:ni)(e).map((function(e){return Kf(t,e,i)}))},Jf=function(t,e,n){var r=e.dom.getBoundingClientRect(),o=Xf(r,n);return O.some(Kf(t,e,o))},Qf=function(t,e,n){var r,o;return O.from(null===(o=(r=t.dom).caretPositionFromPoint)||void 0===o?void 0:o.call(r,e,n)).bind((function(e){if(null===e.offsetNode)return O.none();var n=t.dom.createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),O.some(n)}))},Zf=function(t,e,n){var r,o;return O.from(null===(o=(r=t.dom).caretRangeFromPoint)||void 0===o?void 0:o.call(r,e,n))},td=function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect();return function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return $f(t,e,u,a)}(t,e,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},ed=function(t,e,n){return Ct.fromPoint(t,e,n).bind((function(r){var o=function(){return function(t,e,n){return(0===ce(e).length?Jf:Yf)(t,e,n)}(t,r,e)};return 0===ce(r).length?o():td(t,r,e,n).orThunk(o)}))},nd=document.caretPositionFromPoint?Qf:document.caretRangeFromPoint?Zf:ed,rd=function(t,e){var n=$t(t);return"input"===n?Rf.after(t):A(["br","img"],n)?0===e?Rf.before(t):Rf.after(t):Rf.on(t,e)},od=function(t,e){var n=t.fold(Rf.before,rd,Rf.after),r=e.fold(Rf.before,rd,Rf.after);return zf.relative(n,r)},id=function(t,e,n,r){var o=rd(t,e),i=rd(n,r);return zf.relative(o,i)},ud=function(t,e,n,r){var o=function(t,e,n,r){var o=ne(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=_t(t,n)&&e===r;return o.collapsed&&!i},ad=function(t){return O.from(t.getSelection())},cd=function(t,e){ad(t).each((function(t){t.removeAllRanges(),t.addRange(e)}))},sd=function(t,e,n,r,o){var i=Hf(t,e,n,r,o);cd(t,i)},ld=function(t,e){return Uf(t,e).match({ltr:function(e,n,r,o){sd(t,e,n,r,o)},rtl:function(e,n,r,o){ad(t).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom,n,r.dom,o);else if(i.extend)try{!function(t,e,n,r,o,i){e.collapse(n.dom,r),e.extend(o.dom,i)}(0,i,e,n,r,o)}catch(i){sd(t,r,o,e,n)}else sd(t,r,o,e,n)}))}})},fd=function(t,e,n,r,o){var i=id(e,n,r,o);ld(t,i)},dd=function(t,e,n){var r=od(e,n);ld(t,r)},md=function(t){var e=zf.getWin(t).dom,n=function(t,n,r,o){return Hf(e,t,n,r,o)},r=function(t){return t.match({domRange:function(t){var e=Ct.fromDom(t.startContainer),n=Ct.fromDom(t.endContainer);return id(e,t.startOffset,n,t.endOffset)},relative:od,exact:id})}(t);return Uf(e,r).match({ltr:n,rtl:n})},gd=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return O.some(Df(Ct.fromDom(e.startContainer),e.startOffset,Ct.fromDom(n.endContainer),n.endOffset))}return O.none()},hd=function(t){if(null===t.anchorNode||null===t.focusNode)return gd(t);var e=Ct.fromDom(t.anchorNode),n=Ct.fromDom(t.focusNode);return ud(e,t.anchorOffset,n,t.focusOffset)?O.some(Df(e,t.anchorOffset,n,t.focusOffset)):gd(t)},pd=function(t,e,n){void 0===n&&(n=!0);var r=(n?Pf:Bf)(t,e);cd(t,r)},vd=function(t){return function(t){return ad(t).filter((function(t){return t.rangeCount>0})).bind(hd)}(t).map((function(t){return zf.exact(t.start,t.soffset,t.finish,t.foffset)}))},bd=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?O.some(n).map(Ff):O.none()}(Wf(t,e))},yd=function(t,e,n){return function(t,e,n){var r=Ct.fromDom(t.document);return nd(r,e,n).map((function(t){return Df(Ct.fromDom(t.startContainer),t.startOffset,Ct.fromDom(t.endContainer),t.endOffset)}))}(t,e,n)},wd=tinymce.util.Tools.resolve("tinymce.util.VK"),xd=function(t,e,n){return Sd(t,e,function(t,e,n){return Af(t,n).fold((function(){return Tf.none(t)}),(function(n){return Ef(n.all,t,n.index,1,e)}))}(n,Lu))},Cd=function(t,e,n){return Sd(t,e,function(t,e,n){return Af(t,n).fold((function(){return Tf.none()}),(function(n){return Ef(n.all,t,n.index,-1,e)}))}(n,Lu))},Sd=function(t,e,n){return n.fold(O.none,O.none,(function(t,e){return ei(e).map((function(t){return function(t,e){var n=zf.exact(e,0,e,0);return md(n)}(0,t)}))}),(function(n){return t.execCommand("mceTableInsertRowAfter"),xd(t,e,n)}))},kd=["table","li","dl"],Od=function(t,e){return{selection:t,kill:e}},_d=function(t,e,n,r){return{start:Rf.on(t,e),finish:Rf.on(n,r)}},Td=function(t,e){var n=Wf(t,e);return Df(Ct.fromDom(n.startContainer),n.startOffset,Ct.fromDom(n.endContainer),n.endOffset)},Ed=_d,Ad=function(t,e,n,r,o){return _t(n,r)?O.none():sr(n,r,e).bind((function(e){var r=e.boxes.getOr([]);return r.length>1?(o(t,r,e.start,e.finish),O.some(Od(O.some(Ed(n,0,n,Qo(n))),!0))):O.none()}))},Dd=function(t,e){return{item:t,mode:e}},Md=function(t,e,n,r){return void 0===r&&(r=Rd),t.property().parent(e).map((function(t){return Dd(t,r)}))},Rd=function(t,e,n,r){return void 0===r&&(r=Nd),n.sibling(t,e).map((function(t){return Dd(t,r)}))},Nd=function(t,e,n,r){void 0===r&&(r=Nd);var o=t.property().children(e);return n.first(o).map((function(t){return Dd(t,r)}))},zd=[{current:Md,next:Rd,fallback:O.none()},{current:Rd,next:Nd,fallback:O.some(Md)},{current:Nd,next:Nd,fallback:O.some(Rd)}],Bd=function(t,e,n,r,o){return void 0===o&&(o=zd),L(o,(function(t){return t.current===n})).bind((function(n){return n.current(t,e,r,n.next).orThunk((function(){return n.fallback.bind((function(n){return Bd(t,e,n,r)}))}))}))},Pd=function(){return{sibling:function(t,e){return t.query().prevSibling(e)},first:function(t){return t.length>0?O.some(t[t.length-1]):O.none()}}},Id=function(){return{sibling:function(t,e){return t.query().nextSibling(e)},first:function(t){return t.length>0?O.some(t[0]):O.none()}}},Ld=function(t,e,n,r,o,i){return Bd(t,e,r,o).bind((function(e){return i(e.item)?O.none():n(e.item)?O.some(e.item):Ld(t,e.item,n,e.mode,o,i)}))},Hd=function(t){return function(e){return 0===t.property().children(e).length}},Fd=function(t,e,n,r){return Ld(t,e,n,Rd,Pd(),r)},Vd=function(t,e,n,r){return Ld(t,e,n,Rd,Id(),r)},jd=Zn(),Ud=function(t,e){return function(t,e,n){return Fd(t,e,Hd(t),n)}(jd,t,e)},Wd=function(t,e){return function(t,e,n){return Vd(t,e,Hd(t),n)}(jd,t,e)},qd=hr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Gd=function(t){return Te(t,"tr")},$d=K(K({},qd),{verify:function(t,e,n,r,o,i,u){return Te(r,"td,th",u).bind((function(n){return Te(e,"td,th",u).map((function(e){return _t(n,e)?_t(r,n)&&Qo(n)===o?i(e):qd.none("in same cell"):ar(Gd,[n,e]).fold((function(){return function(t,e,n){var r=t.getRect(e),o=t.getRect(n);return o.right>r.left&&o.left<r.right}(t,e,n)?qd.success():i(e)}),(function(t){return i(e)}))}))})).getOr(qd.none("default"))},cata:function(t,e,n,r,o){return t.fold(e,n,r,o)}}),Xd=function(t,e){return H(t,p(_t,e))},Kd=function(t){return"br"===$t(t)},Yd=function(t,e,n){return e(t,n).bind((function(t){return Qt(t)&&0===Kn(t).trim().length?Yd(t,e,n):O.some(t)}))},Jd=function(t,e,n,r){return function(t,e){return se(t,e).filter(Kd).orThunk((function(){return se(t,e-1).filter(Kd)}))}(e,n).bind((function(e){return r.traverse(e).fold((function(){return Yd(e,r.gather,t).map(r.relative)}),(function(t){return function(t){return oe(t).bind((function(e){var n=ce(e);return Xd(n,t).map((function(r){return function(t,e,n,r){return{parent:t,children:e,element:n,index:r}}(e,n,t,r)}))}))}(t).map((function(t){return Rf.on(t.parent,t.index)}))}))}))},Qd=function(t,e,n,r){return(Kd(e)?function(t,e,n){return n.traverse(e).orThunk((function(){return Yd(e,n.gather,t)})).map(n.relative)}(t,e,r):Jd(t,e,n,r)).map((function(t){return{start:t,finish:t}}))},Zd=function(t,e){return{left:t.left,top:t.top+e,right:t.right,bottom:t.bottom+e}},tm=function(t,e){return{left:t.left,top:t.top-e,right:t.right,bottom:t.bottom-e}},em=function(t,e,n){return{left:t.left+e,top:t.top+n,right:t.right+e,bottom:t.bottom+n}},nm=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}},rm=function(t,e){return O.some(t.getRect(e))},om=function(t,e,n){return Jt(e)?rm(t,e).map(nm):Qt(e)?function(t,e,n){return n>=0&&n<Qo(e)?t.getRangedRect(e,n,e,n+1):n>0?t.getRangedRect(e,n-1,e,n):O.none()}(t,e,n).map(nm):O.none()},im=function(t,e){return Jt(e)?rm(t,e).map(nm):Qt(e)?t.getRangedRect(e,0,e,Qo(e)).map(nm):O.none()},um=hr([{none:[]},{retry:["caret"]}]),am=function(t,e,n){return(r=e,o=ms,Ce((function(t,e){return e(t)}),Se,r,o,i)).fold(w,(function(e){return im(t,e).exists((function(t){return function(t,e){return t.left<e.left||Math.abs(e.right-t.left)<1||t.left>e.right}(n,t)}))}));var r,o,i},cm={point:function(t){return t.bottom},adjuster:function(t,e,n,r,o){var i=Zd(o,5);return Math.abs(n.bottom-r.bottom)<1?um.retry(i):n.top>o.bottom?um.retry(i):n.top===o.bottom?um.retry(Zd(o,1)):am(t,e,o)?um.retry(em(i,5,0)):um.none()},move:Zd,gather:Wd},sm=function(t,e,n,r,o){return 0===o?O.some(r):function(t,e,n){return t.elementFromPoint(e,n).filter((function(t){return"table"===$t(t)})).isSome()}(t,r.left,e.point(r))?function(t,e,n,r,o){return sm(t,e,n,e.move(r,5),o)}(t,e,n,r,o-1):t.situsFromPoint(r.left,e.point(r)).bind((function(i){return i.start.fold(O.none,(function(i){return im(t,i).bind((function(u){return e.adjuster(t,i,u,n,r).fold(O.none,(function(r){return sm(t,e,n,r,o-1)}))})).orThunk((function(){return O.some(r)}))}),O.none)}))},lm=function(t,e,n){var r=t.move(n,5),o=sm(e,t,n,r,100).getOr(r);return function(t,e,n){return t.point(e)>n.getInnerHeight()?O.some(t.point(e)-n.getInnerHeight()):t.point(e)<0?O.some(-t.point(e)):O.none()}(t,o,e).fold((function(){return e.situsFromPoint(o.left,t.point(o))}),(function(n){return e.scrollBy(0,n),e.situsFromPoint(o.left,t.point(o)-n)}))},fm={tryUp:p(lm,{point:function(t){return t.top},adjuster:function(t,e,n,r,o){var i=tm(o,5);return Math.abs(n.top-r.top)<1?um.retry(i):n.bottom<o.top?um.retry(i):n.bottom===o.top?um.retry(tm(o,1)):am(t,e,o)?um.retry(em(i,5,0)):um.none()},move:tm,gather:Ud}),tryDown:p(lm,cm),ieTryUp:function(t,e){return t.situsFromPoint(e.left,e.top-5)},ieTryDown:function(t,e){return t.situsFromPoint(e.left,e.bottom+5)},getJumpSize:m(5)},dm=function(t,e,n){return t.getSelection().bind((function(r){return Qd(e,r.finish,r.foffset,n).fold((function(){return O.some(qa(r.finish,r.foffset))}),(function(o){var i=t.fromSitus(o);return function(t){return $d.cata(t,(function(t){return O.none()}),(function(){return O.none()}),(function(t){return O.some(qa(t,0))}),(function(t){return O.some(qa(t,Qo(t)))}))}($d.verify(t,r.finish,r.foffset,i.finish,i.foffset,n.failure,e))}))}))},mm=function(t,e,n,r,o,i){return 0===i?O.none():pm(t,e,n,r,o).bind((function(u){var a=t.fromSitus(u),c=$d.verify(t,n,r,a.finish,a.foffset,o.failure,e);return $d.cata(c,(function(){return O.none()}),(function(){return O.some(u)}),(function(u){return _t(n,u)&&0===r?gm(t,n,r,tm,o):mm(t,e,u,0,o,i-1)}),(function(u){return _t(n,u)&&r===Qo(u)?gm(t,n,r,Zd,o):mm(t,e,u,Qo(u),o,i-1)}))}))},gm=function(t,e,n,r,o){return om(t,e,n).bind((function(e){return hm(t,o,r(e,fm.getJumpSize()))}))},hm=function(t,e,n){var r=wt().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(t,n):r.isIE()?e.ieRetry(t,n):O.none()},pm=function(t,e,n,r,o){return om(t,n,r).bind((function(e){return hm(t,o,e)}))},vm=function(t,e){return Se(t,(function(t){return oe(t).exists((function(t){return _t(t,e)}))}),n).isSome();var n},bm=function(t,e,n,r,o){return Te(r,"td,th",e).bind((function(r){return Te(r,"table",e).bind((function(i){return vm(o,i)?function(t,e,n){return dm(t,e,n).bind((function(r){return mm(t,e,r.element,r.offset,n,20).map(t.fromSitus)}))}(t,e,n).bind((function(t){return Te(t.finish,"td,th",e).map((function(e){return{start:r,finish:e,range:t}}))})):O.none()}))}))},ym=function(t,e,n,r,o,i){return wt().browser.isIE()?O.none():i(r,e).orThunk((function(){return bm(t,e,n,r,o).map((function(t){var e=t.range;return Od(O.some(Ed(e.start,e.soffset,e.finish,e.foffset)),!0)}))}))},wm=function(t,e){return Te(t,"tr",e).bind((function(t){return Te(t,"table",e).bind((function(n){var r=xe(n,"tr");return _t(t,r[0])?function(t,e,n){return Fd(jd,t,e,n)}(n,(function(t){return ni(t).isSome()}),e).map((function(t){var e=Qo(t);return Od(O.some(Ed(t,e,t,e)),!0)})):O.none()}))}))},xm=function(t,e){return Te(t,"tr",e).bind((function(t){return Te(t,"table",e).bind((function(n){var r=xe(n,"tr");return _t(t,r[r.length-1])?function(t,e,n){return Vd(jd,t,e,n)}(n,(function(t){return ei(t).isSome()}),e).map((function(t){return Od(O.some(Ed(t,0,t,0)),!0)})):O.none()}))}))},Cm=function(t,e,n,r,o,i,u){return bm(t,n,r,o,i).bind((function(t){return Ad(e,n,t.start,t.finish,u)}))},Sm=function(t,e){return Te(t,"td,th",e)},km={traverse:ae,gather:Wd,relative:Rf.before,otherRetry:fm.tryDown,ieRetry:fm.ieTryDown,failure:$d.failedDown},Om={traverse:ue,gather:Ud,relative:Rf.before,otherRetry:fm.tryUp,ieRetry:fm.ieTryUp,failure:$d.failedUp},_m=function(t){return function(e){return e===t}},Tm=_m(38),Em=_m(40),Am=function(t){return t>=37&&t<=40},Dm={isBackward:_m(37),isForward:_m(39)},Mm={isBackward:_m(39),isForward:_m(37)},Rm=function(t){return{elementFromPoint:function(e,n){return Ct.fromPoint(Ct.fromDom(t.document),e,n)},getRect:function(t){return t.dom.getBoundingClientRect()},getRangedRect:function(e,n,r,o){var i=zf.exact(e,n,r,o);return bd(t,i)},getSelection:function(){return vd(t).map((function(e){return Td(t,e)}))},fromSitus:function(e){var n=zf.relative(e.start,e.finish);return Td(t,n)},situsFromPoint:function(e,n){return yd(t,e,n).map((function(t){return _d(t.start,t.soffset,t.finish,t.foffset)}))},clearSelection:function(){!function(t){ad(t).each((function(t){return t.removeAllRanges()}))}(t)},collapseSelection:function(e){void 0===e&&(e=!1),vd(t).each((function(n){return n.fold((function(t){return t.collapse(e)}),(function(n,r){var o=e?n:r;dd(t,o,o)}),(function(n,r,o,i){var u=e?n:o,a=e?r:i;fd(t,u,a,u,a)}))}))},setSelection:function(e){fd(t,e.start,e.soffset,e.finish,e.foffset)},setRelativeSelection:function(e,n){dd(t,e,n)},selectNode:function(e){pd(t,e,!1)},selectContents:function(e){pd(t,e)},getInnerHeight:function(){return t.innerHeight},getScrollY:function(){var e,n,r,o;return(e=Ct.fromDom(t.document),n=void 0!==e?e.dom:document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop,Kr(r,o)).top},scrollBy:function(e,n){!function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollBy(t,e)}(e,n,Ct.fromDom(t.document))}}},Nm=function(t,e){return{rows:t,cols:e}},zm=function(t,e,n,r){var o=function(t,e,n,r){var o=Il(),i=o.clear,u=function(i){o.on((function(o){r.clearBeforeUpdate(e),Sm(i.target,n).each((function(u){sr(o,u,n).each((function(n){var o=n.boxes.getOr([]);if(1===o.length){var a=o[0],c="false"===Hu(a),s=Be(Iu(i.target),a,_t);c&&s&&(r.selectRange(e,o,a,a),t.selectContents(a))}else o.length>1&&(r.selectRange(e,o,n.start,n.finish),t.selectContents(u))}))}))}))};return{clearstate:i,mousedown:function(t){r.clear(e),Sm(t.target,n).each(o.set)},mouseover:function(t){u(t)},mouseup:function(t){u(t),i()}}}(Rm(t),e,n,r);return{clearstate:o.clearstate,mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},Bm=function(t,e,n,r){var o=Rm(t),i=function(){return r.clear(e),O.none()};return{keydown:function(t,u,a,c,s,l){var f=t.raw,d=f.which,m=!0===f.shiftKey;return lr(e,r.selectedSelector).fold((function(){return Am(d)&&!m&&r.clearBeforeUpdate(e),Em(d)&&m?p(Cm,o,e,n,km,c,u,r.selectRange):Tm(d)&&m?p(Cm,o,e,n,Om,c,u,r.selectRange):Em(d)?p(ym,o,n,km,c,u,xm):Tm(d)?p(ym,o,n,Om,c,u,wm):O.none}),(function(t){var n=function(n){return function(){return X(n,(function(n){return function(t,e,n,r,o){return dr(r,t,e,o.firstSelectedSelector,o.lastSelectedSelector).map((function(t){return o.clearBeforeUpdate(n),o.selectRange(n,t.boxes,t.start,t.finish),t.boxes}))}(n.rows,n.cols,e,t,r)})).fold((function(){return fr(e,r.firstSelectedSelector,r.lastSelectedSelector).map((function(t){var n=Em(d)||l.isForward(d)?Rf.after:Rf.before;return o.setRelativeSelection(Rf.on(t.first,0),n(t.table)),r.clear(e),Od(O.none(),!0)}))}),(function(t){return O.some(Od(O.none(),!0))}))}};return Em(d)&&m?n([Nm(1,0)]):Tm(d)&&m?n([Nm(-1,0)]):l.isBackward(d)&&m?n([Nm(0,-1),Nm(-1,0)]):l.isForward(d)&&m?n([Nm(0,1),Nm(1,0)]):Am(d)&&!m?i:O.none}))()},keyup:function(t,o,i,u,a){return lr(e,r.selectedSelector).fold((function(){var c=t.raw,s=c.which;return!0===c.shiftKey&&Am(s)?function(t,e,n,r,o,i,u){return _t(n,o)&&r===i?O.none():Te(n,"td,th",e).bind((function(n){return Te(o,"td,th",e).bind((function(r){return Ad(t,e,n,r,u)}))}))}(e,n,o,i,u,a,r.selectRange):O.none()}),O.none)}}},Pm=function(t,e,n){var r=function(e){Ne(e,t.selected),Ne(e,t.firstSelected),Ne(e,t.lastSelected)},o=function(e){Ae(e,t.selected,"1")},i=function(t){u(t),n()},u=function(e){var n=xe(e,t.selectedSelector+","+t.firstSelectedSelector+","+t.lastSelectedSelector);N(n,r)};return{clearBeforeUpdate:u,clear:i,selectRange:function(n,r,u,a){i(n),N(r,o),Ae(u,t.firstSelected,"1"),Ae(a,t.lastSelected,"1"),e(r,u,a)},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}},Im=function(t,e,n){var r=Tn.fromTable(t);return Oc(r,e).map((function(t){var e=yc(r,n,!1);return{upOrLeftCells:function(t,e){var n=t.slice(0,e[e.length-1].row+1),r=wc(n);return V(r,(function(t){var n=t.cells.slice(0,e[e.length-1].column+1);return R(n,(function(t){return t.element}))}))}(e,t),downOrRightCells:function(t,e){var n=t.slice(e[0].row+e[0].rowspan-1,t.length),r=wc(n);return V(r,(function(t){var n=t.cells.slice(e[0].column+e[0].colspan-1,t.cells.length);return R(n,(function(t){return t.element}))}))}(e,t)}}))},Lm=tinymce.util.Tools.resolve("tinymce.Env"),Hm=function(t){return!1===Ru(Ct.fromDom(t.target),"ephox-snooker-resizer-bar")};function Fm(t,e,n){var r=Pm(ki,(function(e,r,o){n.targets().each((function(n){un(r).each((function(i){var u=za(t),a=fi(d,Ct.fromDom(t.getDoc()),u),c=Im(i,n,a);!function(t,e,n,r,o){t.fire("TableSelectionChange",{cells:e,start:n,finish:r,otherCells:o})}(t,e,r,o,c)}))}))}),(function(){return function(t){t.fire("TableSelectionClear")}(t)}));return t.on("init",(function(n){var o=t.getWin(),i=gi(t),u=vi(t),a=zm(o,i,u,r),c=Bm(o,i,u,r),s=function(t,e,n,r){var o=Rm(t);return function(t,i){r.clearBeforeUpdate(e),sr(t,i,n).each((function(t){var n=t.boxes.getOr([]);r.selectRange(e,n,t.start,t.finish),o.selectContents(i),o.collapseSelection()}))}}(o,i,u,r);t.on("TableSelectorChange",(function(t){return s(t.start,t.finish)}));var l,f,m=function(e,n){(function(t){return!0===t.raw.shiftKey})(e)&&(n.kill&&e.kill(),n.selection.each((function(e){var n=zf.relative(e.start,e.finish),r=Wf(o,n);t.selection.setRng(r)})))},g=function(t){return 0===t.button},h=(l=Bl(Ct.fromDom(i)),f=Bl(0),{touchEnd:function(t){var e=Ct.fromDom(t.target);if("td"===$t(e)||"th"===$t(e)){var n=l.get(),r=f.get();_t(n,e)&&t.timeStamp-r<300&&(t.preventDefault(),s(e,e))}l.set(e),f.set(t.timeStamp)}});t.on("dragstart",(function(t){a.clearstate()})),t.on("mousedown",(function(t){g(t)&&Hm(t)&&a.mousedown(Tu(t))})),t.on("mouseover",(function(t){var e;(void 0===(e=t).buttons||Lm.browser.isEdge()&&0===e.buttons||0!=(1&e.buttons))&&Hm(t)&&a.mouseover(Tu(t))})),t.on("mouseup",(function(t){g(t)&&Hm(t)&&a.mouseup(Tu(t))})),t.on("touchend",h.touchEnd),t.on("keyup",(function(e){var n=Tu(e);if(n.raw.shiftKey&&Am(n.raw.which)){var r=t.selection.getRng(),o=Ct.fromDom(r.startContainer),i=Ct.fromDom(r.endContainer);c.keyup(n,o,r.startOffset,i,r.endOffset).each((function(t){m(n,t)}))}})),t.on("keydown",(function(n){var r=Tu(n);e().each((function(t){return t.hideBars()}));var o=t.selection.getRng(),i=Ct.fromDom(o.startContainer),u=Ct.fromDom(o.endContainer),a=jr(Dm,Mm)(Ct.fromDom(t.selection.getStart()));c.keydown(r,i,o.startOffset,u,o.endOffset,a).each((function(t){m(r,t)})),e().each((function(t){return t.showBars()}))})),t.on("NodeChange",(function(){var e=t.selection,n=Ct.fromDom(e.getStart()),o=Ct.fromDom(e.getEnd());ar(un,[n,o]).fold((function(){return r.clear(i)}),d)}))})),{clear:r.clear}}var Vm=function(t,e){var n=Bl(O.none()),r=Bl([]),o=O.none(),i=ee("caption"),u=function(t){return o.forall((function(e){return!e[t]}))},a=function(){return Ti(function(t){return Ct.fromDom(t.selection.getEnd())}(t),vi(t))},c=function(){return Ti(wi(t),vi(t)).bind((function(t){return Ie(un(t),a().bind(un),(function(n,r){return _t(n,r)?i(t)?O.some(function(t){return{element:t,mergable:O.none(),unmergable:O.none(),selection:[t]}}(t)):O.some(Oi(e,n,t)):O.none()})).bind(g)}))},s=function(t){return un(t.element).map((function(e){var n=Tn.fromTable(e),r=Oc(n,t).getOr([]),o=I(r,(function(t,e){return e.isLocked&&(t.onAny=!0,0===e.column?t.onFirst=!0:e.column+e.colspan>=n.grid.columns&&(t.onLast=!0)),t}),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:Ec(n,t).isSome(),unmergeable:Ac(n,t).isSome(),locked:o}}))},l=function(){n.set(J(c)()),o=n.get().bind(s),N(r.get(),(function(t){return t()}))},f=function(t){return t(),r.set(r.get().concat([t])),function(){r.set(B(r.get(),(function(e){return e!==t})))}},d=function(t,e){return f((function(){return n.get().fold((function(){t.setDisabled(!0)}),(function(n){t.setDisabled(e(n))}))}))},m=function(t,e,r){return f((function(){return n.get().fold((function(){t.setDisabled(!0),t.setActive(!1)}),(function(n){t.setDisabled(e(n)),t.setActive(r(n))}))}))},h=function(t){return o.exists((function(e){return e.locked[t]}))},p=function(e,n){return function(r){return m(r,(function(t){return i(t.element)}),(function(){return t.queryCommandValue(e)===n}))}},v=p("mceTableRowType","header"),b=p("mceTableColType","th");return t.on("NodeChange ExecCommand TableSelectorChange",l),{onSetupTable:function(t){return d(t,(function(t){return!1}))},onSetupCellOrRow:function(t){return d(t,(function(t){return i(t.element)}))},onSetupColumn:function(t){return function(e){return d(e,(function(e){return i(e.element)||h(t)}))}},onSetupPasteable:function(t){return function(e){return d(e,(function(e){return i(e.element)||t().isNone()}))}},onSetupPasteableColumn:function(t,e){return function(n){return d(n,(function(n){return i(n.element)||t().isNone()||h(e)}))}},onSetupMergeable:function(t){return d(t,(function(t){return u("mergeable")}))},onSetupUnmergeable:function(t){return d(t,(function(t){return u("unmergeable")}))},resetTargets:l,onSetupTableWithCaption:function(e){return m(e,w,(function(e){return un(e.element,vi(t)).exists((function(t){return Oe(t,"caption").isSome()}))}))},onSetupTableRowHeaders:v,onSetupTableColumnHeaders:b,targets:n.get}},jm=function(t){var e=function(t,e,n){return{get:function(){return mr(t(),n).fold((function(){return e().fold(br,wr)}),(function(t){return yr(t)}))}}}((function(){return gi(t)}),(function(){return Ei(wi(t),vi(t))}),ki.selectedSelector),n=Vm(t,e),r=Wa(t),o=Fm(t,r.lazyResize,n),i=ul(t,o,r.lazyWire),u=function(){var t=Il(),e=Il();return{getRows:t.get,setRows:function(n){n.fold(t.clear,t.set),e.clear()},clearRows:t.clear,getColumns:e.get,setColumns:function(n){n.fold(e.clear,e.set),t.clear()},clearColumns:e.clear}}();return Cf(t,i,0,e,u),function(t,e,n){var r=vi(t),o=function(e){return Ei(wi(t)).bind((function(t){return un(t,r).map((function(r){var o=Oi(n,r,t);return e(r,o)}))})).getOr("")};Rt({mceTableRowType:function(){return o(e.getTableRowType)},mceTableCellType:function(){return o(e.getTableCellType)},mceTableColType:function(){return o(e.getTableColType)}},(function(e,n){return t.addQueryValueHandler(n,e)}))}(t,i,e),Di(t,e,i),function(t,e,n,r){var o=function(e){return function(){return t.execCommand(e)}},i=function(e){t.execCommand("mceInsertTable",!1,{rows:e.numRows,columns:e.numColumns})},u={text:"Table properties",onSetup:n.onSetupTable,onAction:o("mceTableProps")},a={text:"Delete table",icon:"table-delete-table",onSetup:n.onSetupTable,onAction:o("mceTableDelete")};t.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:o("mceTableInsertRowBefore"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:o("mceTableInsertRowAfter"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:o("mceTableDeleteRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:o("mceTableRowProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)});var c={type:"nestedmenuitem",text:"Row",getSubmenuItems:m("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")};t.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:o("mceTableInsertColBefore"),onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:o("mceTableInsertColAfter"),onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:o("mceTableDeleteCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")});var s={type:"nestedmenuitem",text:"Column",getSubmenuItems:m("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")};t.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:o("mceTableCellProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:o("mceTableMergeCells"),onSetup:n.onSetupMergeable}),t.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:o("mceTableSplitCells"),onSetup:n.onSetupUnmergeable});var l={type:"nestedmenuitem",text:"Cell",getSubmenuItems:m("tablecellprops tablemergecells tablesplitcells")};!1===function(t){return t.getParam("table_grid",!0,"boolean")}(t)?t.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTable")}):t.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:i}]}}),t.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTable")}),t.ui.registry.addMenuItem("tableprops",u),t.ui.registry.addMenuItem("deletetable",a),t.ui.registry.addNestedMenuItem("row",c),t.ui.registry.addNestedMenuItem("column",s),t.ui.registry.addNestedMenuItem("cell",l),t.ui.registry.addContextMenu("table",{update:function(){return n.resetTargets(),n.targets().fold(m(""),(function(t){return"caption"===$t(t.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}});var f=Ul(Oa(t));0!==f.length&&t.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return Vl(t,e,f,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)}))},onSetup:n.onSetupTable});var d=Ul(ka(t));0!==d.length&&t.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return Vl(t,e,d,"tablecellclass",(function(e){return t.execCommand("mceTableCellToggleClass",!1,e)}))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:function(){return Vl(t,e,Sl,"tablecellverticalalign",jl(t,"vertical-align"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return Vl(t,e,pa(t),"tablecellborderwidth",jl(t,"border-width"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return Vl(t,e,va(t),"tablecellborderstyle",jl(t,"border-style"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablecaption",{icon:"table-caption",text:"Table caption",onAction:o("mceTableToggleCaption"),onSetup:n.onSetupTableWithCaption}),t.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:function(){return ql(t,Ba(t),"background-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return ql(t,Pa(t),"border-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablerowheader",{text:"Row header",icon:"table-top-header",onAction:Gl(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleMenuItem("tablecolheader",{text:"Column header",icon:"table-left-header",onAction:$l(t),onSetup:n.onSetupTableColumnHeaders})}(t,e,n,u),function(t,e,n,r){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(t){return t("inserttable | cell row column | advtablesort | tableprops deletetable")}});var o=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:o("mceTableProps"),icon:"table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:o("mceTableDelete"),icon:"table-delete-table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:o("mceTableCellProps"),icon:"table-cell-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:o("mceTableMergeCells"),icon:"table-merge-cells",onSetup:n.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:o("mceTableSplitCells"),icon:"table-split-cells",onSetup:n.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:o("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:o("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:o("mceTableDeleteRow"),icon:"table-delete-row",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:o("mceTableRowProps"),icon:"table-row-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:o("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:o("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:o("mceTableDeleteCol"),icon:"table-delete-column",onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:o("mceInsertTable"),icon:"table"});var i=Ul(Oa(t));0!==i.length&&t.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Wl(t,e,i,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)})),onSetup:n.onSetupTable});var u=Ul(ka(t));0!==u.length&&t.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Wl(t,e,u,"tablecellclass",(function(e){return t.execCommand("mceTableCellToggleClass",!1,e)})),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Wl(t,e,Sl,"tablecellverticalalign",jl(t,"vertical-align")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Wl(t,e,pa(t),"tablecellborderwidth",jl(t,"border-width")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Wl(t,e,va(t),"tablecellborderstyle",jl(t,"border-style")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablecaption",{tooltip:"Table caption",onAction:o("mceTableToggleCaption"),icon:"table-caption",onSetup:n.onSetupTableWithCaption}),t.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:function(e){return e(ql(t,Ba(t),"background-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(e){return e(ql(t,Pa(t),"border-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablerowheader",{tooltip:"Row header",icon:"table-top-header",onAction:Gl(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleButton("tablecolheader",{tooltip:"Column header",icon:"table-left-header",onAction:$l(t),onSetup:n.onSetupTableColumnHeaders})}(t,e,n,u),function(t){var e=function(t){return t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")}(t);e.length>0&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})}(t),t.on("PreInit",(function(){t.serializer.addTempAttr(ki.firstSelected),t.serializer.addTempAttr(ki.lastSelected),function(t){t.formatter.register(Of)}(t)})),function(t){return t.getParam("table_tab_navigation",!0,"boolean")}(t)&&t.on("keydown",(function(e){!function(t,e,n){if(t.keyCode===wd.TAB){var r=gi(e),o=function(t){var e=$t(t);return _t(t,r)||A(kd,e)},i=e.selection.getRng(),u=Ct.fromDom(t.shiftKey?i.startContainer:i.endContainer);nn(u,o).each((function(r){t.preventDefault(),un(r,o).each(n.clear),e.selection.collapse(t.shiftKey),(t.shiftKey?Cd:xd)(e,o,r).each((function(t){e.selection.setRng(t)}))}))}}(e,t,o)})),t.on("remove",(function(){r.destroy()})),function(t,e,n,r){return{insertTable:hl(t),setClipboardRows:gl(e.setRows),getClipboardRows:ml(e.getRows),setClipboardCols:gl(e.setColumns),getClipboardCols:ml(e.getColumns),resizeHandler:n,selectionTargets:r}}(t,u,r,n)};xr.add("table",jm)}()},587:function(t,e){!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},u=function(t){return function(e){return typeof e===t}},a=i("string"),c=i("object"),s=i("array"),l=(t=null,function(e){return t===e}),f=u("boolean"),d=function(t){return!function(t){return null==t}(t)},m=u("function"),g=u("number"),h=function(){},p=function(t){return function(){return t}},v=function(t){return t},b=p(!1),y=p(!0),w=function(){return x},x={fold:function(t,e){return t()},isSome:b,isNone:y,getOr:n=v,getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:p(null),getOrUndefined:p(void 0),or:n,orThunk:e,map:w,each:h,bind:w,exists:b,forall:y,filter:function(){return w()},toArray:function(){return[]},toString:p("none()")},C=function(t){var e=p(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:y,isNone:b,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return C(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:x},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},S={some:C,none:w,from:function(t){return null==t?x:C(t)}},k=Object.keys,O=Object.hasOwnProperty,_=function(t,e,n,r){return function(t,e){for(var n=k(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},T=function(t,e){return O.call(t,e)},E=Array.prototype.push,A=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!s(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);E.apply(e,t[n])}return e},D=function(t){return function(t,e){return e>=0&&e<t.length?S.some(t[e]):S.none()}(t,0)};"undefined"!=typeof window?window:Function("return this;")();var M,R=function(t,e,n){!function(t,e,n){if(!(a(n)||f(n)||g(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},N=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},z={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return N(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return N(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return N(n)},fromDom:N,fromPoint:function(t,e,n){return S.from(t.dom.elementFromPoint(e,n)).map(N)}},B=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),P=tinymce.util.Tools.resolve("tinymce.util.Promise"),I=tinymce.util.Tools.resolve("tinymce.util.URI"),L=tinymce.util.Tools.resolve("tinymce.util.XHR"),H=function(t){return t.getParam("image_dimensions",!0,"boolean")},F=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},V=function(t){return t&&(t=t.replace(/px$/,"")),t},j=function(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t},U=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},W=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},q=function(t,e){return I.isDomSafe(e,"img",t.settings)},G=B.DOM,$=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?V(t.style.marginLeft):""},X=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?V(t.style.marginTop):""},K=function(t){return t.style.borderWidth?V(t.style.borderWidth):""},Y=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},J=function(t,e){return t.style[e]?t.style[e]:""},Q=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},Z=function(t,e,n){""===n?t.removeAttribute(e):t.setAttribute(e,n)},tt=function(t){Q(t)?function(t){var e=t.parentNode;G.insertAfter(t,e),G.remove(e)}(t):function(t){var e=G.create("figure",{class:"image"});G.insertAfter(e,t),e.appendChild(t),e.appendChild(G.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"}(t)},et=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");r.length>0?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},nt=function(t,e){return function(t,n,r){t.style[n]?(t.style[n]=j(r),et(t,e)):Z(t,n,r)}},rt=function(t,e){return t.style[e]?V(t.style[e]):Y(t,e)},ot=function(t,e){var n=j(e);t.style.marginLeft=n,t.style.marginRight=n},it=function(t,e){var n=j(e);t.style.marginTop=n,t.style.marginBottom=n},ut=function(t,e){var n=j(e);t.style.borderWidth=n},at=function(t,e){t.style.borderStyle=e},ct=function(t){return"FIGURE"===t.nodeName},st=function(t){return 0===G.getAttrib(t,"alt").length&&"presentation"===G.getAttrib(t,"role")},lt=function(t){return st(t)?"":Y(t,"alt")},ft=function(t,e){var n=document.createElement("img");return Z(n,"style",e.style),($(n)||""!==e.hspace)&&ot(n,e.hspace),(X(n)||""!==e.vspace)&&it(n,e.vspace),(K(n)||""!==e.border)&&ut(n,e.border),(function(t){return J(t,"borderStyle")}(n)||""!==e.borderStyle)&&at(n,e.borderStyle),t(n.getAttribute("style"))},dt=function(t,e){return{src:Y(e,"src"),alt:lt(e),title:Y(e,"title"),width:rt(e,"width"),height:rt(e,"height"),class:Y(e,"class"),style:t(Y(e,"style")),caption:Q(e),hspace:$(e),vspace:X(e),border:K(e),borderStyle:J(e,"borderStyle"),isDecorative:st(e)}},mt=function(t,e,n,r,o){n[r]!==e[r]&&o(t,r,n[r])},gt=function(t,e,n){if(n){G.setAttrib(t,"role","presentation");var r=z.fromDom(t);R(r,"alt","")}else{if(l(e)){r=z.fromDom(t);o="alt",r.dom.removeAttribute(o)}else{r=z.fromDom(t);R(r,"alt",e)}"presentation"===G.getAttrib(t,"role")&&G.setAttrib(t,"role","")}var o},ht=function(t,e){return function(n,r,o){t(n,o),et(n,e)}},pt=function(t,e,n){var r=dt(t,n);mt(n,r,e,"caption",(function(t,e,n){return tt(t)})),mt(n,r,e,"src",Z),mt(n,r,e,"title",Z),mt(n,r,e,"width",nt(0,t)),mt(n,r,e,"height",nt(0,t)),mt(n,r,e,"class",Z),mt(n,r,e,"style",ht((function(t,e){return Z(t,"style",e)}),t)),mt(n,r,e,"hspace",ht(ot,t)),mt(n,r,e,"vspace",ht(it,t)),mt(n,r,e,"border",ht(ut,t)),mt(n,r,e,"borderStyle",ht(at,t)),function(t,e,n){n.alt===e.alt&&n.isDecorative===e.isDecorative||gt(t,n.alt,n.isDecorative)}(n,r,e)},vt=function(t,e){var n=t.dom.styles.parse(e),r=U(n),o=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(o)},bt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||W(e))?null:e},yt=function(t,e){var n=t.dom,r=function(t,e){var n,r={};return _(t,e,(n=r,function(t,e){n[e]=t}),h),r}(t.schema.getTextBlockElements(),(function(e,n){return!t.schema.isValidChild(n,"figure")})),o=n.getParent(e.parentNode,(function(t){return e=r,n=t.nodeName,T(e,n)&&void 0!==e[n]&&null!==e[n];var e,n}),t.getBody());return o?n.split(o,e):e},wt=function(t,e){var n=function(t,e){var n=document.createElement("img");if(pt(t,o(o({},e),{caption:!1}),n),gt(n,e.alt,e.isDecorative),e.caption){var r=G.create("figure",{class:"image"});return r.appendChild(n),r.appendChild(G.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}((function(e){return vt(t,e)}),e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),ct(r)){var i=yt(t,r);t.selection.select(i)}else t.selection.select(r)},xt=function(t,e){var n=bt(t);if(pt((function(e){return vt(t,e)}),e,n),function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))}(t,n),ct(n.parentNode)){var r=n.parentNode;yt(t,r),t.selection.select(n.parentNode)}else t.selection.select(n),function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!H(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r}(t,e,n)},Ct=function(t,e){var n=bt(t);if(n){var r=dt((function(e){return vt(t,e)}),n),i=o(o({},r),e),u=function(t,e){var n=e.src;return o(o({},e),{src:q(t,n)?n:""})}(t,i);i.src?xt(t,u):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,n)}else e.src&&wt(t,o(o({},{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),e))},St=(M=function(t,e){return c(t)&&c(e)?St(t,e):e},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)T(o,i)&&(n[i]=M(n[i],o[i]))}return n}),kt=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),Ot=tinymce.util.Tools.resolve("tinymce.util.Tools"),_t=function(t){return a(t.value)?t.value:""},Tt=function(t,e){var n=[];return Ot.each(t,(function(t){var r=function(t){return a(t.text)?t.text:a(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=Tt(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},Et=function(t){return void 0===t&&(t=_t),function(e){return e?S.from(e).map((function(e){return Tt(e,t)})):S.none()}},At=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return S.none()}(t,(function(t){return function(t){return T(t,"items")}(t)?At(t.items,e):t.value===e?S.some(t):S.none()}))},Dt=Et,Mt=function(t){return Et(_t)(t)},Rt=function(t,e){return t.bind((function(t){return At(t,e)}))},Nt=function(t){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},zt=function(t){var e=Dt((function(e){return t.convertURL(e.value||e.url,"src")})),n=new P((function(n){!function(t,e){var n=function(t){return t.getParam("image_list",!1)}(t);a(n)?L.send({url:n,success:function(t){e(JSON.parse(t))}}):m(n)?n(e):e(n)}(t,(function(t){n(e(t).map((function(t){return A([[{text:"None",value:""}],t])})))}))})),r=Mt(function(t){return t.getParam("image_class_list")}(t)),o=function(t){return t.getParam("image_advtab",!1,"boolean")}(t),i=function(t){return t.getParam("image_uploadtab",!0,"boolean")}(t),u=function(t){return d(t.getParam("images_upload_url"))}(t),c=function(t){return d(t.getParam("images_upload_handler"))}(t),s=function(t){var e=bt(t);return e?dt((function(e){return vt(t,e)}),e):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}(t),l=function(t){return t.getParam("image_description",!0,"boolean")}(t),f=function(t){return t.getParam("image_title",!1,"boolean")}(t),g=H(t),h=function(t){return t.getParam("image_caption",!1,"boolean")}(t),p=function(t){return t.getParam("a11y_advanced_options",!1,"boolean")}(t),v=function(t){return t.getParam("automatic_uploads",!0,"boolean")}(t),b=S.some(function(t){return t.getParam("image_prepend_url","","string")}(t)).filter((function(t){return a(t)&&t.length>0}));return n.then((function(t){return{image:s,imageList:t,classList:r,hasAdvTab:o,hasUploadTab:i,hasUploadUrl:u,hasUploadHandler:c,hasDescription:l,hasImageTitle:f,hasDimensions:g,hasImageCaption:h,prependURL:b,hasAccessibilityOptions:p,automaticUploads:v}}))},Bt=function(t){var e,n=t.imageList.map((function(t){return{name:"images",type:"listbox",label:"Image list",items:t}})),r={name:"alt",type:"input",label:"Alternative description",disabled:t.hasAccessibilityOptions&&t.image.isDecorative},i=t.classList.map((function(t){return{name:"classes",type:"listbox",label:"Class",items:t}}));return A([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],n.toArray(),t.hasAccessibilityOptions&&t.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],t.hasDescription?[r]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[o(o({},(e=t.classList.isSome()&&t.hasImageCaption,e?{type:"grid",columns:2}:{type:"panel"})),{items:A([i.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])})]])},Pt=function(t){return{title:"General",name:"general",items:Bt(t)}},It=Bt,Lt=function(t){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}},Ht=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t.class,caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[],isDecorative:t.isDecorative}},Ft=function(t,e){return{src:t.src.value,alt:0===t.alt.length&&e?null:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,class:t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle,isDecorative:t.isDecorative}},Vt=function(t,e){var n=e.getData();(function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?S.none():t.prependURL.bind((function(t){return e.substring(0,t.length)!==t?S.some(t+e):S.none()}))})(t,n.src.value).each((function(t){e.setData({src:{value:t,meta:n.src.meta}})}))},jt=function(t,e){var n=e.getData(),r=n.src.meta;if(void 0!==r){var o=St({},n);!function(t,e,n){t.hasDescription&&a(n.alt)&&(e.alt=n.alt),t.hasAccessibilityOptions&&(e.isDecorative=n.isDecorative||e.isDecorative||!1),t.hasImageTitle&&a(n.title)&&(e.title=n.title),t.hasDimensions&&(a(n.width)&&(e.dimensions.width=n.width),a(n.height)&&(e.dimensions.height=n.height)),a(n.class)&&Rt(t.classList,n.class).each((function(t){e.classes=t.value})),t.hasImageCaption&&f(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(a(n.style)&&(e.style=n.style),a(n.vspace)&&(e.vspace=n.vspace),a(n.border)&&(e.border=n.border),a(n.hspace)&&(e.hspace=n.hspace),a(n.borderstyle)&&(e.borderstyle=n.borderstyle))}(t,o,r),e.setData(o)}},Ut=function(t,e,n,r){Vt(e,r),jt(e,r),function(t,e,n,r){var o=r.getData(),i=o.src.value,u=o.src.meta||{};u.width||u.height||!e.hasDimensions||(i.length>0?t.imageSize(i).then((function(t){n.open&&r.setData({dimensions:t})})).catch((function(t){return console.error(t)})):r.setData({dimensions:{width:"",height:""}}))}(t,e,n,r),function(t,e,n){var r=n.getData(),o=Rt(t.imageList,r.src.value);e.prevImage=o,n.setData({images:o.map((function(t){return t.value})).getOr("")})}(e,n,r)},Wt=function(t,e,n){var r=U(t(n.style)),o=St({},n);return o.vspace=function(t){return t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"]?V(String(t["margin-top"])):""}(r),o.hspace=function(t){return t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"]?V(String(t["margin-right"])):""}(r),o.border=function(t){return t["border-width"]?V(String(t["border-width"])):""}(r),o.borderstyle=function(t){return t["border-style"]?String(t["border-style"]):""}(r),o.style=function(t,e,n){return e(t(e(n)))}(t,e,r),o},qt=function(t,e,n,r){var o=r.getData();r.block("Uploading image"),D(o.fileinput).fold((function(){r.unblock()}),(function(o){var i,u=URL.createObjectURL(o),a=function(){r.unblock(),URL.revokeObjectURL(u)},c=function(o){r.setData({src:{value:o,meta:{}}}),r.showTab("general"),Ut(t,e,n,r)};(i=o,new P((function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(i)}))).then((function(n){var i=t.createBlobCache(o,u,n);e.automaticUploads?t.uploadImage(i).then((function(t){c(t.url),a()})).catch((function(e){a(),t.alertErr(e)})):(t.addToBlobCache(i),c(i.blobUri()),r.unblock())}))}))},Gt=function(t,e,n){return function(r,o){"src"===o.name?Ut(t,e,n,r):"images"===o.name?function(t,e,n,r){var o=r.getData(),i=Rt(e.imageList,o.images);i.each((function(t){""===o.alt||n.prevImage.map((function(t){return t.text===o.alt})).getOr(!1)?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})})),n.prevImage=i,Ut(t,e,n,r)}(t,e,n,r):"alt"===o.name?n.prevAlt=r.getData().alt:"style"===o.name?function(t,e){var n=e.getData(),r=Wt(t.parseStyle,t.serializeStyle,n);e.setData(r)}(t,r):"vspace"===o.name||"hspace"===o.name||"border"===o.name||"borderstyle"===o.name?function(t,e,n){var r=St(Ht(e.image),n.getData()),o=ft(t.normalizeCss,Ft(r,!1));n.setData({style:o})}(t,e,r):"fileinput"===o.name?qt(t,e,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},$t=function(t){return function(){t.open=!1}},Xt=function(t){return t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler?{type:"tabpanel",tabs:A([[Pt(t)],t.hasAdvTab?[Nt(t)]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[Lt(t)]:[]])}:{type:"panel",items:It(t)}},Kt=function(t){return function(e){var n=function(t){return{prevImage:Rt(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}}(e);return{title:"Insert/Edit Image",size:"normal",body:Xt(e),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Ht(e.image),onSubmit:t.onSubmit(e),onChange:Gt(t,e,n),onClose:$t(n)}}},Yt=function(t){return function(e){return function(n){var r=St(Ht(e.image),n.getData());t.execCommand("mceUpdateImage",!1,Ft(r,e.hasAccessibilityOptions)),t.editorUpload.uploadImagesAuto(),n.close()}}},Jt=function(t){return function(e){return q(t,e)?function(t){return new P((function(e){var n=document.createElement("img"),r=function(t){n.onload=n.onerror=null,n.parentNode&&n.parentNode.removeChild(n),e(t)};n.onload=function(){var t={width:F(n.width,n.clientWidth),height:F(n.height,n.clientHeight)};r(P.resolve(t))},n.onerror=function(){r(P.reject("Failed to get image dimensions for: "+t))};var o=n.style;o.visibility="hidden",o.position="fixed",o.bottom=o.left="0px",o.width=o.height="auto",document.body.appendChild(n),n.src=t}))}(t.documentBaseURI.toAbsolute(e)).then((function(t){return{width:String(t.width),height:String(t.height)}})):P.resolve({width:"",height:""})}},Qt=function(t){return function(e,n,r){return t.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:r.split(",")[1]})}},Zt=function(t){return function(e){t.editorUpload.blobCache.add(e)}},te=function(t){return function(e){t.windowManager.alert(e)}},ee=function(t){return function(e){return vt(t,e)}},ne=function(t){return function(e){return t.dom.parseStyle(e)}},re=function(t){return function(e,n){return t.dom.serializeStyle(e,n)}},oe=function(t){return function(e){return kt(t).upload([e],!1).then((function(t){return 0===t.length?P.reject("Failed to upload image"):!1===t[0].status?P.reject(t[0].error.message):t[0]}))}},ie=function(t){var e={onSubmit:Yt(t),imageSize:Jt(t),addToBlobCache:Zt(t),createBlobCache:Qt(t),alertErr:te(t),normalizeCss:ee(t),parseStyle:ne(t),serializeStyle:re(t),uploadImage:oe(t)};return{open:function(){zt(t).then(Kt(e)).then(t.windowManager.open)}}},ue=function(t){var e=t.attr("class");return e&&/\bimage\b/.test(e)},ae=function(t){return function(e){for(var n=e.length,r=function(e){e.attr("contenteditable",t?"true":null)};n--;){var o=e[n];ue(o)&&(o.attr("contenteditable",t?"false":null),Ot.each(o.getAll("figcaption"),r))}}};r.add("image",(function(t){!function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("figure",ae(!0)),t.serializer.addNodeFilter("figure",ae(!1))}))}(t),function(t){t.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ie(t).open,onSetup:function(e){return e.setActive(d(bt(t))),t.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),t.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:ie(t).open}),t.ui.registry.addContextMenu("image",{update:function(t){return ct(t)||"IMG"===t.nodeName&&!W(t)?["image"]:[]}})}(t),function(t){t.addCommand("mceImage",ie(t).open),t.addCommand("mceUpdateImage",(function(e,n){t.undoManager.transact((function(){return Ct(t,n)}))}))}(t)}))}()},588:function(t,e,n){(function(t){!function(){"use strict";var e,n,r,o=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=(e="array",function(t){return r=typeof(n=t),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===e;var n,r}),c=function(t){return!function(t){return null==t}(t)},s=function(t){return function(e){return typeof e===t}}("function"),l=function(){},f=function(t){return function(){return t}},d=function(t){return t},m=f(!1),g=f(!0),h=function(){return p},p={fold:function(t,e){return t()},isSome:m,isNone:g,getOr:r=d,getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:f(null),getOrUndefined:f(void 0),or:r,orThunk:n,map:h,each:l,bind:h,exists:m,forall:g,filter:function(){return h()},toArray:function(){return[]},toString:f("none()")},v=function(t){var e=f(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:g,isNone:m,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return v(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:p},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},b={some:v,none:h,from:function(t){return null==t?p:v(t)}},y={},w={exports:y};!function(e,n,r,o){!function(t,o){"object"==typeof n&&void 0!==r?r.exports=o():"function"==typeof e&&e.amd?e(o):(t="undefined"!=typeof globalThis?globalThis:t||self).EphoxContactWrapper=o()}(this,(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},n={exports:{}};!function(t){!function(e){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void a(e.promise,t)}u(e.promise,r)}else(1===t._state?u:a)(e.promise,t._value)}))):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){a(t,e)}var r,i}function a(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,u(e,t))}),(function(t){n||(n=!0,a(e,t))}))}catch(t){if(n)return;n=!0,a(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},t.exports?t.exports=o:e.Promise||(e.Promise=o)}(e)}(n);var r=n.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||r}}))}(void 0,y,w);var x=w.exports.boltExport,C=function(t,e){return O(document.createElement("canvas"),t,e)},S=function(t){var e=C(t.width,t.height);return k(e).drawImage(t,0,0),e},k=function(t){return t.getContext("2d")},O=function(t,e,n){return t.width=e,t.height=n,t},_=function(t){return new x((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)},u=function(){i(),e(o)},a=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(u,0)}))},T=function(t){return new x((function(e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="blob",r.onload=function(){200===this.status&&e(this.response)},r.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},r.send()}))},E=function(t){return new x((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return b.none();for(var r=n[1],o=e[1],i=atob(o),u=i.length,a=Math.ceil(u/1024),c=new Array(a),s=0;s<a;++s){for(var l=1024*s,f=Math.min(l+1024,u),d=new Array(f-l),m=l,g=0;m<f;++g,++m)d[g]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return b.some(new Blob(c,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))},A=function(t,e,n){return e=e||"image/png",s(HTMLCanvasElement.prototype.toBlob)?new x((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):E(t.toDataURL(e,n))},D=function(t){URL.revokeObjectURL(t.src)},M=function(t){return function(t){var e=t.src;return 0===e.indexOf("data:")?E(e):T(e)}(t)},R=Array.prototype.indexOf,N=function(t,e){return n=t,r=e,R.call(n,r)>-1;var n,r},z=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},B=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return b.some(i);if(n(i,r))break}return b.none()}(t,e,m)},P=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},I=Object.keys;(function(t){if(!a(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};z(t,(function(r,o){var i=I(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],c=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!a(c))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+c.length+" ("+c+"), got "+i);var a=function(t){var r=I(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!P(e,(function(t){return N(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:a,log:function(t){console.log(t,{constructors:e,constructor:u,params:n})}}}}))})([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var L=function(t,e,n){var r=e.type,o=f(r),i=f(n),u=function(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))};return{getType:o,toBlob:function(){return x.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return A(t,e,n)}))},toAdjustedDataURL:u,toAdjustedBase64:function(t,e){return u(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(S)}}},H=function(t){return function(t){return new x((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return L(function(t){return _(t).then((function(t){D(t);var e=C(function(t){return t.naturalWidth||t.width}(t),function(t){return t.naturalHeight||t.height}(t));return k(e).drawImage(t,0,0),e}))}(t),t,e)}))},F=function(t,e){return A(t,e).then((function(e){return L(x.resolve(t),e,t.toDataURL())}))},V=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},j=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,u=Math.sin(r),a=Math.cos(r),c=V(Math.abs(o*a)+Math.abs(i*u)),s=V(Math.abs(o*u)+Math.abs(i*a)),l=C(c,s),f=k(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),F(l,e)},U=function(t,e,n){var r=C(t.width,t.height),o=k(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),F(r,e)},W=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return U(n,t.getType(),e)}))}(t,e)},q=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return j(n,t.getType(),e)}))}(t,e)},G=function(t,e,n){return void 0===n&&(n=!1),new x((function(r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&r({status:o.status,blob:o.response})},o.open("GET",t,!0),o.withCredentials=n,function(t,e){for(var n=I(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(e,(function(t,e){o.setRequestHeader(e,t)})),o.responseType="blob",o.send()}))},$=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],X=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],K=function(t,e){var n,r,o=(n=function(t,e){return c(t)?t[e]:void 0},r=t,z(e,(function(t,e){r=n(r,t,e)})),r);return b.from(o)},Y=function(t){var e=function(t){return"ImageProxy HTTP error: "+B($,(function(e){return t===e.code})).fold(f("Unknown ImageProxy error"),(function(t){return t.message}))}(t);return x.reject(e)},J=function(t){return B(X,(function(e){return e.type===t})).fold(f("Unknown service error"),(function(t){return t.message}))},Q=function(t){return"ImageProxy Service error: "+function(t){try{return b.some(JSON.parse(t))}catch(t){return b.none()}}(t).bind((function(t){return K(t,["error","type"]).map(J)})).getOr("Invalid JSON in service error message")},Z=function(t){return function(t){return new x((function(e,n){var r=new FileReader;r.onload=function(){e(r.result)},r.onerror=function(t){n(t)},r.readAsText(t)}))}(t).then((function(t){var e=Q(t);return x.reject(e)}))},tt=function(t){return t<200||t>=300},et=function(t,e){var n={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return G(function(t,e){var n=-1===t.indexOf("?")?"?":"&";return/[?&]apiKey=/.test(t)?t:t+n+"apiKey="+encodeURIComponent(e)}(t,e),n).then((function(t){return tt(t.status)?(e=t.status,n=t.blob,function(t,e){return"application/json"===(null==e?void 0:e.type)&&(400===t||403===t||404===t||500===t)}(e,n)?Z(n):Y(e)):x.resolve(t.blob);var e,n}))},nt=function(t,e,n){return void 0===n&&(n=!1),e?et(t,e):function(t,e){return G(t,{},e).then((function(t){return tt(t.status)?Y(t.status):x.resolve(t.blob)}))}(t,n)},rt=function(t){return H(t)},ot=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},it={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return ot(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return ot(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return ot(n)},fromDom:ot,fromPoint:function(t,e,n){return b.from(t.dom.elementFromPoint(e,n)).map(ot)}};"undefined"!=typeof window?window:Function("return this;")();var ut=function(t,e){return function(t,e){return B(t.dom.childNodes,(function(t){return e(it.fromDom(t))})).map(it.fromDom)}(t,(function(t){return function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(t,e)}))},at=tinymce.util.Tools.resolve("tinymce.util.Delay"),ct=tinymce.util.Tools.resolve("tinymce.util.Promise"),st=tinymce.util.Tools.resolve("tinymce.util.URI"),lt=function(t){return t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")},ft=function(t){return t.getParam("imagetools_proxy")},dt=function(t){var e,n,r=function(t){return/^[0-9\.]+px$/.test(t)};return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)},mt=function(t){return{w:t.naturalWidth,h:t.naturalHeight}},gt=0,ht=function(t){return ut(it.fromDom(t),"img")},pt=function(t,e){return t.dom.is(e,"figure")},vt=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")},bt=function(t,e){var n=function(e){return vt(t,e)&&(Ct(t,e)||St(t,e)||c(ft(t)))};return pt(t,e)?ht(e).bind((function(t){return n(t.dom)?b.some(t.dom):b.none()})):n(e)?b.some(e):b.none()},yt=function(t,e){t.notificationManager.open({text:e,type:"error"})},wt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&&pt(t,n)?ht(n):vt(t,e)?b.some(it.fromDom(e)):b.none()},xt=function(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return c(r)?t.dom.encode(r[n]):null},Ct=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new st(n).host===t.documentBaseURI.host},St=function(t,e){return-1!==u.inArray(function(t){return t.getParam("imagetools_cors_hosts",[],"string[]")}(t),new st(e.src).host)},kt=function(t,e){if(St(t,e))return nt(e.src,null,function(t,e){return-1!==u.inArray(function(t){return t.getParam("imagetools_credentials_hosts",[],"string[]")}(t),new st(e.src).host)}(t,e));if(!Ct(t,e)){var n=ft(t),r=n+(-1===n.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),o=function(t){return t.getParam("api_key",t.getParam("imagetools_api_key","","string"),"string")}(t);return nt(r,o,!1)}return M(e)},Ot=function(t,e){return function(t){return b.from(t.getParam("imagetools_fetch_image",null,"function"))}(t).fold((function(){return kt(t,e)}),(function(t){return t(e)}))},_t=function(t,e){var n=t.editorUpload.blobCache.getByUri(e.src);return n?ct.resolve(n.blob()):Ot(t,e)},Tt=function(t){at.clearTimeout(t.get())},Et=function(t,e,n,r,o,i,u){return n.toBlob().then((function(a){var s,l,f,d,m=t.editorUpload.blobCache;s=i.src;var g=e.type===a.type;return function(t){return t.getParam("images_reuse_filename",!1,"boolean")}(t)&&(d=m.getByUri(s),c(d)?(s=d.uri(),l=d.name(),f=d.filename()):(l=xt(t,s,2),f=xt(t,s,1))),d=m.create({id:"imagetools"+gt++,blob:a,base64:n.toBase64(),uri:s,name:l,filename:g?f:void 0}),m.add(d),t.undoManager.transact((function(){var e=function(){t.$(i).off("load",e),t.nodeChanged(),r?t.editorUpload.uploadImagesAuto():(Tt(o),function(t,e){var n=at.setEditorTimeout(t,(function(){t.editorUpload.uploadImagesAuto()}),function(t){return t.getParam("images_upload_timeout",3e4,"number")}(t));e.set(n)}(t,o))};t.$(i).on("load",e),u&&t.$(i).attr({width:u.w,height:u.h}),t.$(i).attr({src:d.blobUri()}).removeAttr("data-mce-src")})),d}))},At=function(t,e,n,r){return function(){return wt(t).fold((function(){yt(t,"Could not find selected image")}),(function(o){return t._scanForImages().then((function(){return _t(t,o.dom)})).then((function(i){return rt(i).then(n).then((function(n){return Et(t,i,n,!1,e,o.dom,r)}))})).catch((function(e){yt(t,e)}))}))}},Dt=function(t,e,n){return function(){var r=wt(t).map((function(t){var e=dt(t.dom);return e?{w:e.h,h:e.w}:null})).getOrNull();return At(t,e,(function(t){return q(t,n)}),r)()}},Mt=function(t,e,n){return function(){return At(t,e,(function(t){return W(t,n)}))()}},Rt=function(t,e,n,r,o){return function(t){return _(t)}(o).then((function(t){var e=mt(t);return r.w===e.w&&r.h===e.h||dt(n)&&function(t,e){var n,r;e&&(n=t.style.width,r=t.style.height,(n||r)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,r=t.height,(n||r)&&(t.setAttribute("width",String(e.w)),t.setAttribute("height",String(e.h))))}(n,e),URL.revokeObjectURL(t.src),o})).then(rt).then((function(r){return Et(t,o,r,!0,e,n)}))},Nt=function(t,e){return function(){var n=wt(t),r=n.map((function(t){return mt(t.dom)}));n.each((function(o){bt(t,o.dom).each((function(i){_t(t,o.dom).then((function(o){var i=function(t){return{blob:t,url:URL.createObjectURL(t)}}(o);t.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:i}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(o){var i=o.getData().imagetools.blob;n.each((function(n){r.each((function(r){Rt(t,e,n.dom,r,i)}))})),o.close()},onCancel:l,onAction:function(t,e){switch(e.name){case"save-state":e.value?t.enable("save"):t.disable("save");break;case"disable":t.disable("save"),t.disable("cancel");break;case"enable":t.enable("cancel")}}})}))}))}))}};i.add("imagetools",(function(t){var e=o(0),n=o(null);!function(t,e){u.each({mceImageRotateLeft:Dt(t,e,-90),mceImageRotateRight:Dt(t,e,90),mceImageFlipVertical:Mt(t,e,"v"),mceImageFlipHorizontal:Mt(t,e,"h"),mceEditImage:Nt(t,e)},(function(e,n){t.addCommand(n,e)}))}(t,e),function(t){var e=[],n=function(e){return function(){return t.execCommand(e)}},r=function(){return wt(t).exists((function(e){return bt(t,e.dom).isSome()}))},o=function(t){var n=function(e){return t.setDisabled(!e)};return n(r()),e=e.concat([n]),function(){e=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(e,(function(t){return t!==n}))}};t.on("NodeChange",(function(){var t=r();z(e,(function(e){return e(t)}))})),t.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft"),onSetup:o}),t.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight"),onSetup:o}),t.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical"),onSetup:o}),t.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal"),onSetup:o}),t.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:o}),t.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:n("mceImage")}),t.ui.registry.addContextMenu("imagetools",{update:function(e){return bt(t,e).map((function(t){return{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}})).toArray()}})}(t),function(t){t.ui.registry.addContextToolbar("imagetools",{items:lt(t),predicate:function(e){return bt(t,e).isSome()},position:"node",scope:"node"})}(t),function(t,e,n){t.on("NodeChange",(function(r){var o=n.get(),i=bt(t,r.element);o&&!i.exists((function(t){return o.src===t.src}))&&(Tt(e),t.editorUpload.uploadImagesAuto(),n.set(null)),i.each(n.set)}))}(t,e,n)}))}()}).call(this,n(31))},589:function(t,e){!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},u=function(t){return function(e){return typeof e===t}},a=i("string"),c=i("array"),s=(t=null,function(e){return t===e}),l=u("boolean"),f=u("function"),d=function(){},m=function(t){return function(){return t}},g=function(t){return t},h=function(t,e){return t===e},p=m(!1),v=m(!0),b=function(){return y},y={fold:function(t,e){return t()},isSome:p,isNone:v,getOr:n=g,getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(void 0),or:n,orThunk:e,map:b,each:d,bind:b,exists:p,forall:v,filter:function(){return b()},toArray:function(){return[]},toString:m("none()")},w=function(t){var e=m(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=Array.prototype.indexOf,S=Array.prototype.push,k=function(t,e){return function(t,e){return C.call(t,e)}(t,e)>-1},O=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e},_=function(t,e){return O(function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t,e))},T=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()},E=function(t,e,n){return void 0===n&&(n=h),t.exists((function(t){return n(t,e)}))},A=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},D=function(t,e){return t?x.some(e):x.none()},M=function(t){var e=t.getParam("link_assume_external_targets",!1);return l(e)&&e?1:!a(e)||"http"!==e&&"https"!==e?0:e},R=function(t){return t.getParam("default_link_target")},N=function(t){return t.getParam("target_list",!0)},z=function(t){return t.getParam("rel_list",[],"array")},B=function(t){return t.getParam("link_title",!0,"boolean")},P=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},I=function(t){return t.getParam("link_default_protocol","http","string")},L=tinymce.util.Tools.resolve("tinymce.util.Tools"),H=function(t){return a(t.value)?t.value:""},F=function(t,e){var n=[];return L.each(t,(function(t){var r=function(t){return a(t.text)?t.text:a(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=F(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},V=function(t){return void 0===t&&(t=H),function(e){return x.from(e).map((function(e){return F(e,t)}))}},j={sanitize:function(t){return V(H)(t)},sanitizeWith:V,createUi:function(t,e){return function(n){return{name:t,type:"listbox",label:e,items:n}}},getValue:H},U=function(){return(U=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},W=Object.keys,q=Object.hasOwnProperty,G=function(t,e,n,r){return function(t,e){for(var n=W(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},$=function(t,e){return q.call(t,e)},X=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),K=tinymce.util.Tools.resolve("tinymce.util.URI"),Y=function(t){return t&&"a"===t.nodeName.toLowerCase()},J=function(t){return Y(t)&&!!tt(t)},Q=function(t,e){if(t.collapsed)return[];var n=t.cloneContents(),r=new X(n.firstChild,n),o=[],i=n.firstChild;do{e(i)&&o.push(i)}while(i=r.next());return o},Z=function(t){return/^\w+:/i.test(t)},tt=function(t){var e=t.getAttribute("data-mce-href");return e||t.getAttribute("href")},et=function(t,e){var n=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter((function(t){return-1===L.inArray(n,t)}))},i=e?function(t){return(t=o(t)).length>0?t.concat(n):n}(r):o(r);return i.length>0?function(t){return L.trim(t.sort().join(" "))}(i):""},nt=function(t,e){return e=e||t.selection.getNode(),ut(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},rt=function(t,e){return function(t){return t.replace(/\uFEFF/g,"")}(e?e.innerText||e.textContent:t.getContent({format:"text"}))},ot=function(t){return L.grep(t,J).length>0},it=function(t){var e=t.schema.getTextInlineElements();return 0===Q(t.selection.getRng(),(function(t){return 1===t.nodeType&&!Y(t)&&!$(e,t.nodeName.toLowerCase())})).length},ut=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},at=function(t,e){var n=U({},e);if(!(z(t).length>0)&&!1===P(t)){var r=et(n.rel,"_blank"===n.target);n.rel=r||null}return x.from(n.target).isNone()&&!1===N(t)&&(n.target=R(t)),n.href=function(t,e){return"http"!==e&&"https"!==e||Z(t)?t:e+"://"+t}(n.href,M(t)),n},ct=function(t,e,n){var r=t.selection.getNode(),o=nt(t,r),i=at(t,function(t){return function(t,e,n){return function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}}(t,(function(t,r){n=e(n,t,r)})),n}(["title","rel","class","target"],(function(e,n){return t[n].each((function(t){e[n]=t.length>0?t:null})),e}),{href:t.href})}(n));t.undoManager.transact((function(){n.href===e.href&&e.attach(),o?(t.focus(),function(t,e,n,r){n.each((function(t){$(e,"innerText")?e.innerText=t:e.textContent=t})),t.dom.setAttribs(e,r),t.selection.select(e)}(t,o,n.text,i)):function(t,e,n,r){ut(e)?mt(t,e,r):n.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))}))}(t,r,n.text,i)}))},st=function(t){var e=t.class,n=t.href,r=t.rel,o=t.target,i=t.text,u=t.title;return function(t,e){var n,r={};return G(t,e,(n=r,function(t,e){n[e]=t}),d),r}({class:e.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:u.getOrNull()},(function(t,e){return!1===s(t)}))},lt=function(t,e,n){var r=function(t,e){var n=e.href;return U(U({},e),{href:K.isDomSafe(n,"a",t.settings)?n:""})}(t,n);t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,st(r)):ct(t,e,r)},ft=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var e=t.selection.getNode();ut(e)?dt(t,e):function(t){var e=t.dom,n=t.selection,r=n.getBookmark(),o=n.getRng().cloneRange(),i=e.getParent(o.startContainer,"a[href]",t.getBody()),u=e.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),u&&o.setEndAfter(u),n.setRng(o),t.execCommand("unlink"),n.moveToBookmark(r)}(t),t.focus()}))}(t)},dt=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},mt=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},gt=function(t){return $(e=t,n="items")&&void 0!==e[n]&&null!==e[n];var e,n},ht=function(t,e){return T(e,(function(e){return gt(e)?ht(t,e.items):D(e.value===t,e)}))},pt=function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?ht(o,n).map((function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:d}},text:i?t:e.text}})):x.none()},vt=function(t,e){var n={text:t.text,title:t.title},r=function(t){var e,r=(e=t.url,D(n.text.length<=0,x.from(e.meta.text).getOr(e.value))),o=function(t){return D(n.title.length<=0,x.from(t.meta.title).getOr(""))}(t.url);return r.isSome()||o.isSome()?x.some(U(U({},r.map((function(t){return{text:t}})).getOr({})),o.map((function(t){return{title:t}})).getOr({}))):x.none()},o=function(t,r){var o,i,u=(o=e,i=r.name,"link"===i?o.link:"anchor"===i?o.anchor:x.none()).getOr([]);return pt(n.text,r.name,u,t)};return{onChange:function(t,e){var i=e.name;return"url"===i?r(t()):k(["anchor","link"],i)?o(t(),e):"text"===i||"title"===i?(n[i]=t()[i],x.none()):x.none()}}},bt=tinymce.util.Tools.resolve("tinymce.util.Delay"),yt=tinymce.util.Tools.resolve("tinymce.util.Promise"),wt=function(t){var e=t.href;return e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:")?x.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return U(U({},t),{href:"mailto:"+e})}}):x.none()},xt=function(t,e){return function(n){var r=n.href;return 1===t&&!Z(r)||0===t&&/^\s*www(\.|\d\.)/i.test(r)?x.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+e+":// prefix?",preprocess:function(t){return U(U({},t),{href:e+"://"+r})}}):x.none()}},Ct=function(t,e){return T([wt,xt(M(t),I(t))],(function(t){return t(e)})).fold((function(){return yt.resolve(e)}),(function(n){return new yt((function(r){!function(t,e,n){var r=t.selection.getRng();bt.setEditorTimeout(t,(function(){t.windowManager.confirm(e,(function(e){t.selection.setRng(r),n(e)}))}))}(t,n.message,(function(t){r(t?n.preprocess(e):e)}))}))}))},St=function(t){var e=t.dom.select("a:not([href])"),n=_(e,(function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]}));return n.length>0?x.some([{text:"None",value:""}].concat(n)):x.none()},kt=function(t){var e=function(t){return t.getParam("link_class_list",[],"array")}(t);return e.length>0?j.sanitize(e):x.none()},Ot=tinymce.util.Tools.resolve("tinymce.util.XHR"),_t=function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=function(t){return t.getParam("link_list")}(t);return new yt((function(t){a(n)?Ot.send({url:n,success:function(e){return t(function(t){try{return x.some(JSON.parse(t))}catch(t){return x.none()}}(e))},error:function(e){return t(x.none())}}):f(n)?n((function(e){return t(x.some(e))})):t(x.from(n))})).then((function(t){return t.bind(j.sanitizeWith(e)).map((function(t){if(t.length>0){return[{text:"None",value:""}].concat(t)}return t}))}))},Tt=function(t,e){var n=z(t);if(n.length>0){var r=E(e,"_blank");return(!1===P(t)?j.sanitizeWith((function(t){return et(j.getValue(t),r)})):j.sanitize)(n)}return x.none()},Et=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],At=function(t){var e=N(t);return c(e)?j.sanitize(e).orThunk((function(){return x.some(Et)})):!1===e?x.none():x.some(Et)},Dt=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?x.some(r):x.none()},Mt=function(t,e){return _t(t).then((function(n){var r=function(t,e){var n=t.dom,r=it(t)?x.some(rt(t.selection,e)):x.none(),o=e?x.some(n.getAttrib(e,"href")):x.none(),i=e?x.from(n.getAttrib(e,"target")):x.none(),u=Dt(n,e,"rel"),a=Dt(n,e,"class");return{url:o,text:r,title:Dt(n,e,"title"),target:i,rel:u,linkClass:a}}(t,e);return{anchor:r,catalogs:{targets:At(t),rels:Tt(t,r.target),classes:kt(t),anchor:St(t),link:n},optNode:x.from(e),flags:{titleEnabled:B(t)}}}))},Rt=function(t){(function(t){var e=nt(t);return Mt(t,e)})(t).then((function(e){return function(t,e,n){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,e){var n=t.anchor,r=n.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:r,link:r,rel:n.rel.getOr(""),target:n.target.or(e).getOr(""),linkClass:n.linkClass.getOr("")}}(t,x.from(R(n))),u=t.catalogs,a=vt(i,u);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:O([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,A([u.anchor.map(j.createUi("anchor","Anchors")),u.rels.map(j.createUi("rel","Rel")),u.targets.map(j.createUi("target","Open link in...")),u.link.map(j.createUi("link","Link list")),u.classes.map(j.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,e){var n=e.name;a.onChange(t.getData,{name:n}).each((function(e){t.setData(e)}))},onSubmit:e}}(e,function(t,e){return function(n){var r=n.getData();if(!r.url.value)return ft(t),void n.close();var o=function(t){return x.from(r[t]).filter((function(n){return!E(e.anchor[t],n)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:d};Ct(t,i).then((function(e){lt(t,u,e)})),n.close()}}(t,e),t)})).then((function(e){t.windowManager.open(e)}))},Nt=function(t){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,e){document.body.appendChild(t),t.dispatchEvent(e),document.body.removeChild(t)}(e,n)},zt=function(t,e){return t.dom.getParent(e,"a[href]")},Bt=function(t){return zt(t,t.selection.getStart())},Pt=function(t,e){if(e){var n=tt(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else Nt(e.href)}},It=function(t){return function(){Rt(t)}},Lt=function(t){return function(){Pt(t,Bt(t))}},Ht=function(t,e){return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}},Ft=function(t){return function(e){var n=function(){return e.setActive(!t.mode.isReadOnly()&&null!==nt(t,t.selection.getNode()))};return n(),Ht(t,n)}},Vt=function(t){return function(e){var n=function(){return e.setDisabled(null===nt(t,t.selection.getNode()))};return n(),Ht(t,n)}},jt=function(t){return function(e){var n=function(e){return ot(e)||(n=t.selection.getRng(),Q(n,J).length>0);var n},r=t.dom.getParents(t.selection.getStart());return e.setDisabled(!n(r)),Ht(t,(function(t){return e.setDisabled(!n(t.parents))}))}},Ut=function(t){var e=function(e){var n=t.selection.getNode();return e.setDisabled(!nt(t,n)),d};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Ft(t)},label:"Link",predicate:function(e){return!!nt(t,e)&&function(t){return t.getParam("link_context_toolbar",!1,"boolean")}(t)},initValue:function(){var e=nt(t);return e?tt(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!nt(t,n)),Ft(t)(e)},onAction:function(e){var n=e.getValue(),r=function(e){var n=nt(t),r=it(t);if(!n&&r){var o=rt(t.selection,n);return x.some(o.length>0?o:e)}return x.none()}(n);lt(t,{href:n,attach:d},{href:n,text:r,title:x.none(),rel:x.none(),target:x.none(),class:x.none()}),function(t){t.selection.collapse(!1)}(t),e.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:e,onAction:function(e){ft(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:e,onAction:function(e){Lt(t)(),e.hide()}}]})};r.add("link",(function(t){!function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:It(t),onSetup:Ft(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Lt(t),onSetup:Vt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return ft(t)},onSetup:jt(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Lt(t),onSetup:Vt(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:It(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return ft(t)},onSetup:jt(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(e){return ot(t.dom.getParents(e,"a"))?"link unlink openlink":"link"}})}(t),Ut(t),function(t){t.on("click",(function(e){var n=zt(t,e.target);n&&o.metaKeyPressed(e)&&(e.preventDefault(),Pt(t,n))})),t.on("keydown",(function(e){var n=Bt(t);n&&13===e.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(e)&&(e.preventDefault(),Pt(t,n))}))}(t),function(t){t.addCommand("mceLink",(function(){!function(t){return t.getParam("link_quicklink",!1,"boolean")}(t)?It(t)():t.fire("contexttoolbar-show",{toolbarKey:"quicklink"})}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}()},590:function(t,e){!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-+~=.,%()\/\w]*[-+~=%()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i"),r=function(t){return/^[(\[{ \u00a0]$/.test(t)},o=function(t){return 3===t.nodeType},i=function(t){return 1===t.nodeType},u=function(t,e){if(e<0&&(e=0),o(t)){var n=t.data.length;e>n&&(e=n)}return e},a=function(t,e,n){!i(e)||e.hasChildNodes()?t.setStart(e,u(e,n)):t.setStartBefore(e)},c=function(t,e,n){!i(e)||e.hasChildNodes()?t.setEnd(e,u(e,n)):t.setEndAfter(e)},s=function(t,e){var i,u,s,l,f,d,m,g=function(t){return t.getParam("autolink_pattern",n)}(t),h=function(t){return t.getParam("default_link_target",!1)}(t);if(null===t.dom.getParent(t.selection.getNode(),"a[href]")){var p=t.selection.getRng().cloneRange();if(p.startOffset<5){if(!(f=p.endContainer.previousSibling)){if(!p.endContainer.firstChild||!p.endContainer.firstChild.nextSibling)return;f=p.endContainer.firstChild.nextSibling}if(d=f.length,a(p,f,d),c(p,f,d),p.endOffset<5)return;i=p.endOffset,u=f}else{if(u=p.endContainer,!o(u)&&u.firstChild){for(;!o(u)&&u.firstChild;)u=u.firstChild;o(u)&&(a(p,u,0),c(p,u,u.nodeValue.length))}i=1===p.endOffset?2:p.endOffset-1-e}var v,b=i;do{a(p,u,i>=2?i-2:0),c(p,u,i>=1?i-1:0),i-=1,m=p.toString()}while(!r(m)&&i-2>=0);r(p.toString())?(a(p,u,i),c(p,u,b),i+=1):0===p.startOffset?(a(p,u,0),c(p,u,b)):(a(p,u,i),c(p,u,b)),l=p.toString(),v=l.charAt(l.length-1),/[?!,.;:]/.test(v)&&c(p,u,b-1);var y=(l=p.toString().trim()).match(g),w=function(t){return t.getParam("link_default_protocol","http","string")}(t);if(y){var x=y[0];(function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e})(x,"www.",0)?x=w+"://"+x:function(t,e){return-1!==t.indexOf(e)}(x,"@")&&!function(t){return/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(t)}(x)&&(x="mailto:"+x),s=t.selection.getBookmark(),t.selection.setRng(p),t.execCommand("createlink",!1,x),!1!==h&&t.dom.setAttrib(t.selection.getNode(),"target",h),t.selection.moveToBookmark(s),t.nodeChanged()}}},l=function(t){var n;t.on("keydown",(function(e){if(13===e.keyCode)return function(t){return s(t,-1)}(t)})),e.browser.isIE()?t.on("focus",(function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}})):(t.on("keypress",(function(e){if(41===e.keyCode||93===e.keyCode||125===e.keyCode)return function(t){return s(t,-1)}(t)})),t.on("keyup",(function(e){if(32===e.keyCode)return function(t){return s(t,0)}(t)})))};t.add("autolink",(function(t){l(t)}))}()},591:function(t,e){!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("contextmenu",(function(){}))}()},592:function(t,e){!function(){"use strict";var t,e,n=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},u=function(t){return function(e){return typeof e===t}},a=i("string"),c=i("array"),s=u("boolean"),l=u("number"),f=function(){},d=function(t){return function(){return t}},m=function(t){return t},g=d(!1),h=d(!0),p=d("[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫！-＃％-＊，-／：；？＠［-］＿｛｝｟-･]"),v=function(){return b},b={fold:function(t,e){return t()},isSome:g,isNone:h,getOr:e=m,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:e,orThunk:t,map:v,each:f,bind:v,exists:g,forall:h,filter:function(){return v()},toArray:function(){return[]},toString:d("none()")},y=function(t){var e=d(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:h,isNone:g,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return y(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:b},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},w={some:y,none:v,from:function(t){return null==t?b:y(t)}},x=p,C=tinymce.util.Tools.resolve("tinymce.Env"),S=tinymce.util.Tools.resolve("tinymce.util.Tools"),k=Array.prototype.slice,O=Array.prototype.push,_=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},T=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},E=function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}},A=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);O.apply(e,t[n])}return e}(_(t,e))},D=Object.hasOwnProperty,M=function(t,e){return D.call(t,e)};"undefined"!=typeof window?window:Function("return this;")();var R,N,z,B,P=(R=3,function(t){return function(t){return t.dom.nodeType}(t)===R}),I=function(t,e,n){!function(t,e,n){if(!(a(n)||s(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},L=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},H={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return L(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return L(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return L(n)},fromDom:L,fromPoint:function(t,e,n){return w.from(t.dom.elementFromPoint(e,n)).map(L)}},F=function(t,e){return{element:t,offset:e}},V=function(t,e){var n=function(t){return _(t.dom.childNodes,H.fromDom)}(t);return n.length>0&&e<n.length?F(n[e],0):F(t,e)},j=function(t,e){(function(t){return w.from(t.dom.parentNode).map(H.fromDom)})(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},U=function(t,e){j(t,e),function(t,e){t.dom.appendChild(e.dom)}(e,t)},W=(N=P,z="text",{get:function(t){if(!N(t))throw new Error("Can only get "+z+" value of a "+z+" node");return B(t).getOr("")},getOption:B=function(t){return N(t)?w.from(t.dom.nodeValue):w.none()},set:function(t,e){if(!N(t))throw new Error("Can only set raw "+z+" value of a "+z+" node");t.dom.nodeValue=e}}),q=function(t){return W.get(t)},G=function(t,e){return function(t,e){var n,r=void 0===e?document:e.dom;return 1!==(n=r).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:_(r.querySelectorAll(t),H.fromDom)}(e,t)},$=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),X=function(t,e){return t.isBlock(e)||M(t.schema.getShortEndedElements(),e.nodeName)},K=function(t,e){return"false"===t.getContentEditable(e)},Y=function(t,e){return!t.isBlock(e)&&M(t.schema.getWhiteSpaceElements(),e.nodeName)},J=function(t,e){return V(H.fromDom(t),e)},Q=function(t,e,n,r,o,i){void 0===i&&(i=!0);for(var u=i?e(!1):n;u;){var a=K(t,u);if(a||Y(t,u)){if(a?r.cef(u):r.boundary(u))break;u=e(!0)}else{if(X(t,u)){if(r.boundary(u))break}else 3===u.nodeType&&r.text(u);if(u===o)break;u=e(!1)}}},Z=function(t,e,n,r,o){if(!function(t,e){return X(t,e)||K(t,e)||Y(t,e)||function(t,e){return"true"===t.getContentEditable(e)&&"false"===t.getContentEditableParent(e.parentNode)}(t,e)}(t,n)){var i=t.getParent(r,t.isBlock),u=new $(n,i),a=o?u.next.bind(u):u.prev.bind(u);Q(t,a,n,{boundary:h,cef:h,text:function(t){o?e.fOffset+=t.length:e.sOffset+=t.length,e.elements.push(H.fromDom(t))}})}},tt=function(t,e,n,r,o,i){void 0===i&&(i=!0);var u=new $(n,e),a=[],c={sOffset:0,fOffset:0,elements:[]};Z(t,c,n,e,!1);var s=function(){return c.elements.length>0&&(a.push(c),c={sOffset:0,fOffset:0,elements:[]}),!1};return Q(t,u.next.bind(u),n,{boundary:s,cef:function(t){return s(),o&&a.push.apply(a,o.cef(t)),!1},text:function(t){c.elements.push(H.fromDom(t)),o&&o.text(t,c)}},r,i),r&&Z(t,c,r,e,!0),s(),a},et=function(t,e){var n=J(e.startContainer,e.startOffset),r=n.element.dom,o=J(e.endContainer,e.endOffset),i=o.element.dom;return tt(t,e.commonAncestorContainer,r,i,{text:function(t,e){t===i?e.fOffset+=t.length-o.offset:t===r&&(e.sOffset+=n.offset)},cef:function(e){var n,r,o,i=A(G(H.fromDom(e),"*[contenteditable=true]"),(function(e){var n=e.dom;return tt(t,n,n)}));return n=i,r=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_PRECEDING)}(t.elements[0].dom,e.elements[0].dom)?1:-1},(o=k.call(n,0)).sort(r),o}},!1)},nt=function(t,e){return e.collapsed?[]:et(t,e)},rt=function(t,e){var n=t.createRng();return n.selectNode(e),nt(t,n)},ot=function(t,e){return function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}(function(t,e,n){return T(t,(function(t,r){n=e(n,t,r)})),n}(t,(function(t,n){var r=q(n),o=t.last,i=o+r.length,u=A(e,(function(t,e){return t.start<i&&t.finish>o?[{element:n,start:Math.max(o,t.start)-o,finish:Math.min(i,t.finish)-o,matchId:e}]:[]}));return{results:t.results.concat(u),last:i}}),{results:[],last:0}).results,(function(t){return t.matchId}))},it=function(t,e){return A(e,(function(e){var n=e.elements,r=_(n,q).join(""),o=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=e.regex;o.lastIndex=n;for(var i,u=[];i=o.exec(t);){var a=i[e.matchIndex],c=i.index+i[0].indexOf(a),s=c+a.length;if(s>r)break;u.push({start:c,finish:s}),o.lastIndex=s}return u}(r,t,e.sOffset,r.length-e.fOffset);return ot(n,o)}))},ut=function(t,e){E(t,(function(t,n){E(t,(function(t){var r=H.fromDom(e.cloneNode(!1));I(r,"data-mce-index",n);var o=t.element.dom;if(o.length===t.finish&&0===t.start)U(t.element,r);else{o.length!==t.finish&&o.splitText(t.finish);var i=o.splitText(t.start);U(H.fromDom(i),r)}}))}))},at=function(t,e,n,r){var o=n.getBookmark(),i=t.select("td[data-mce-selected],th[data-mce-selected]"),u=i.length>0?function(t,e){return A(e,(function(e){return rt(t,e)}))}(t,i):nt(t,n.getRng()),a=it(e,u);return ut(a,r),n.moveToBookmark(o),a.length},ct=function(t){var e=t.getAttribute("data-mce-index");return"number"==typeof e?""+e:e},st=function(t,e,n,r){var o=t.dom.create("span",{"data-mce-bogus":1});o.className="mce-match-marker";var i=t.getBody();return yt(t,e,!1),r?at(t.dom,n,t.selection,o):function(t,e,n,r){var o=rt(t,n),i=it(e,o);return ut(i,r),i.length}(t.dom,n,i,o)},lt=function(t){var e=t.parentNode;t.firstChild&&e.insertBefore(t.firstChild,t),t.parentNode.removeChild(t)},ft=function(t,e){var n=[],r=S.toArray(t.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var i=ct(r[o]);null!==i&&i.length&&(i===e.toString()&&n.push(r[o]))}return n},dt=function(t,e,n){var r=e.get(),o=r.index,i=t.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,i.removeClass(ft(t,r.index),"mce-match-marker-selected");var u=ft(t,o);return u.length?(i.addClass(ft(t,o),"mce-match-marker-selected"),t.selection.scrollIntoView(u[0]),o):-1},mt=function(t,e){var n=e.parentNode;t.remove(e),t.isEmpty(n)&&t.remove(n)},gt=function(t,e,n,r,o,i){var u=t.selection,a=function(t,e){var n="("+t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return e?"(?:^|\\s|"+x()+")"+n+"(?=$|\\s|"+x()+")":n}(n,o),c=u.isForward(),s={regex:new RegExp(a,r?"g":"gi"),matchIndex:1},l=st(t,e,s,i);if(C.browser.isSafari()&&u.setRng(u.getRng(),c),l){var f=dt(t,e,!0);e.set({index:f,count:l,text:n,matchCase:r,wholeWord:o,inSelection:i})}return l},ht=function(t,e){var n=dt(t,e,!0);e.set(o(o({},e.get()),{index:n}))},pt=function(t,e){var n=dt(t,e,!1);e.set(o(o({},e.get()),{index:n}))},vt=function(t){var e=ct(t);return null!==e&&e.length>0},bt=function(t,e,n,r,i){var u,a=e.get(),c=a.index,s=c;r=!1!==r;for(var l=t.getBody(),f=S.grep(S.toArray(l.getElementsByTagName("span")),vt),d=0;d<f.length;d++){var m=ct(f[d]),g=u=parseInt(m,10);if(i||g===a.index){for(n.length?(f[d].firstChild.nodeValue=n,lt(f[d])):mt(t.dom,f[d]);f[++d];){if((g=parseInt(ct(f[d]),10))!==u){d--;break}mt(t.dom,f[d])}r&&s--}else u>c&&f[d].setAttribute("data-mce-index",String(u-1))}return e.set(o(o({},a),{count:i?0:a.count-1,index:s})),r?ht(t,e):pt(t,e),!i&&e.get().count>0},yt=function(t,e,n){for(var r,i,u=e.get(),a=S.toArray(t.getBody().getElementsByTagName("span")),c=0;c<a.length;c++){var s=ct(a[c]);null!==s&&s.length&&(s===u.index.toString()&&(r||(r=a[c].firstChild),i=a[c].firstChild),lt(a[c]))}if(e.set(o(o({},u),{index:-1,count:0,text:""})),r&&i){var l=t.dom.createRng();return l.setStart(r,0),l.setEnd(i,i.data.length),!1!==n&&t.selection.setRng(l),l}},wt=function(){var t=function(t){var e=n(w.none()),r=function(){return e.get().each(t)};return{clear:function(){r(),e.set(w.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){r(),e.set(w.some(t))}}}(f);return o(o({},t),{on:function(e){return t.get().each(e)}})},xt=function(t,e){var n=wt();t.undoManager.add();var r=S.trim(t.selection.getContent({format:"text"})),i=function(t){(function(t,e){return e.get().count>1}(0,e)?t.enable:t.disable)("next"),(function(t,e){return e.get().count>1}(0,e)?t.enable:t.disable)("prev")},u=function(t,e){var n=e?t.disable:t.enable;T(["replace","replaceall","prev","next"],n)},a=function(t,e){C.browser.isSafari()&&C.deviceType.isTouch()&&("find"===e||"replace"===e||"replaceall"===e)&&t.focus(e)},c=function(n){yt(t,e,!1),u(n,!0),i(n)},s=function(n){var r=n.getData(),o=e.get();if(r.findtext.length){if(o.text===r.findtext&&o.matchCase===r.matchcase&&o.wholeWord===r.wholewords)ht(t,e);else{var a=gt(t,e,r.findtext,r.matchcase,r.wholewords,r.inselection);a<=0&&function(e){t.windowManager.alert("Could not find the specified string.",(function(){e.focus("findtext")}))}(n),u(n,0===a)}i(n)}else c(n)},l=e.get(),f={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace all",disabled:!0}],initialData:{findtext:r,replacetext:"",wholewords:l.wholeWord,matchcase:l.matchCase,inselection:l.inSelection},onChange:function(t,n){"findtext"===n.name&&e.get().count>0&&c(t)},onAction:function(n,r){var u=n.getData();switch(r.name){case"find":s(n);break;case"replace":bt(t,e,u.replacetext)?i(n):c(n);break;case"replaceall":bt(t,e,u.replacetext,!0,!0),c(n);break;case"prev":pt(t,e),i(n);break;case"next":ht(t,e),i(n);break;case"matchcase":case"wholewords":case"inselection":!function(t){var n=t.getData(),r=e.get();e.set(o(o({},r),{matchCase:n.matchcase,wholeWord:n.wholewords,inSelection:n.inselection}))}(n),c(n)}a(n,r.name)},onSubmit:function(t){s(t),a(t,"find")},onClose:function(){t.focus(),yt(t,e),t.undoManager.add()}};n.set(t.windowManager.open(f,{inline:"toolbar"}))},Ct=function(t,e){return function(){xt(t,e)}};r.add("searchreplace",(function(t){var e=n({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return function(t,e){t.addCommand("SearchReplace",(function(){xt(t,e)}))}(t,e),function(t,e){t.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:Ct(t,e),icon:"search"}),t.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:Ct(t,e),icon:"search"}),t.shortcuts.add("Meta+F","",Ct(t,e))}(t,e),function(t,e){return{done:function(n){return yt(t,e,n)},find:function(n,r,o,i){return void 0===i&&(i=!1),gt(t,e,n,r,o,i)},next:function(){return ht(t,e)},prev:function(){return pt(t,e)},replace:function(n,r,o){return bt(t,e,n,r,o)}}}(t,e)}))}()},593:function(t,e){!function(){"use strict";var t=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=Object.hasOwnProperty,r=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=tinymce.util.Tools.resolve("tinymce.util.URI"),i=tinymce.util.Tools.resolve("tinymce.util.XHR"),u=function(t){return t.getParam("spellchecker_rpc_url")},a=function(t){var e=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`§©«®±¶·¸»¼½¾¿×÷¤”“„    ]+',"g");return t.getParam("spellchecker_wordchar_pattern",e)},c=function(t){return t&&1===t.nodeType&&"false"===t.contentEditable},s=function(t,e){var n,r=[],o=e.dom,i=e.schema.getBlockElements(),u=e.schema.getWhiteSpaceElements(),a=e.schema.getShortEndedElements(),s=function(t,e){if(!t[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:t.index,end:t.index+t[0].length,text:t[0],data:e}},l=function(t){if(3===t.nodeType)return t.data;if(u[t.nodeName]&&!i[t.nodeName])return"";if(c(t))return"\n";var e="";if((i[t.nodeName]||a[t.nodeName])&&(e+="\n"),t=t.firstChild)do{e+=l(t)}while(t=t.nextSibling);return e},f=function(t){for(var e=t.parentNode;t.childNodes.length>0;)e.insertBefore(t.childNodes[0],t);e.removeChild(t)},d=function(e){var n=t.getElementsByTagName("*"),r=[];e="number"==typeof e?""+e:null;for(var o=0;o<n.length;o++){var i=n[o],u=i.getAttribute("data-mce-index");null!==u&&u.length&&-1!==i.className.indexOf("mce-spellchecker-word")&&(u!==e&&null!==e||r.push(i))}return r},m=function(t){for(var e=r.length;e--;)if(r[e]===t)return e;return-1};function g(t){for(var e=0,n=r.length;e<n&&!1!==t(r[e],e);e++);return this}function h(t){var e,n=d(t?m(t):null);for(e=n.length;e--;)f(n[e]);return this}var p=function(t){var n=d(m(t)),r=e.dom.createRng();return r.setStartBefore(n[0]),r.setEndAfter(n[n.length-1]),r};var v=l(t);return{text:v,matches:r,each:g,filter:function(t){var e=[];return g((function(n,r){t(n,r)&&e.push(n)})),r=e,this},reset:function(){return r.splice(0,r.length),h(),this},matchFromElement:function(t){return r[t.getAttribute("data-mce-index")]},elementFromMatch:function(t){return d(m(t))[0]},find:function(t,e){if(v&&t.global)for(;n=t.exec(v);)r.push(s(n,e));return this},add:function(t,e,n){return r.push({start:t,end:t+e,text:v.substr(t,e),data:n}),this},wrap:function(e){return r.length&&function(t,e,n){var r,o,s,l,f,d=[],m=0,g=t,h=0;(e=e.slice(0)).sort((function(t,e){return t.start-e.start})),f=e.shift();t:for(;;){if((i[g.nodeName]||a[g.nodeName]||c(g))&&m++,3===g.nodeType&&(!o&&g.length+m>=f.end?(o=g,l=f.end-m):r&&d.push(g),!r&&g.length+m>f.start&&(r=g,s=f.start-m),m+=g.length),r&&o){if(g=n({startNode:r,startNodeIndex:s,endNode:o,endNodeIndex:l,innerNodes:d,match:f.text,matchIndex:h}),m-=o.length-l,r=null,o=null,d=[],h++,!(f=e.shift()))break}else if(u[g.nodeName]&&!i[g.nodeName]||!g.firstChild){if(g.nextSibling){g=g.nextSibling;continue}}else if(!c(g)){g=g.firstChild;continue}for(;;){if(g.nextSibling){g=g.nextSibling;break}if(g.parentNode===t)break t;g=g.parentNode}}}(t,r,function(t){var e=function(e,n){var i=r[n];i.stencil||(i.stencil=t(i));var u=i.stencil.cloneNode(!1);return u.setAttribute("data-mce-index",""+n),e&&u.appendChild(o.doc.createTextNode(e)),u};return function(t){var n,r,i,u=t.startNode,a=t.endNode,c=t.matchIndex,s=o.doc;if(u===a){var l=u;i=l.parentNode,t.startNodeIndex>0&&(n=s.createTextNode(l.data.substring(0,t.startNodeIndex)),i.insertBefore(n,l));var f=e(t.match,c);return i.insertBefore(f,l),t.endNodeIndex<l.length&&(r=s.createTextNode(l.data.substring(t.endNodeIndex)),i.insertBefore(r,l)),l.parentNode.removeChild(l),f}n=s.createTextNode(u.data.substring(0,t.startNodeIndex)),r=s.createTextNode(a.data.substring(t.endNodeIndex));for(var d=e(u.data.substring(t.startNodeIndex),c),m=0,g=t.innerNodes.length;m<g;++m){var h=t.innerNodes[m],p=e(h.data,c);h.parentNode.replaceChild(p,h)}var v=e(a.data.substring(0,t.endNodeIndex),c);return(i=u.parentNode).insertBefore(n,u),i.insertBefore(d,u),i.removeChild(u),(i=a.parentNode).insertBefore(v,a),i.insertBefore(r,a),i.removeChild(a),v}}(e)),this},unwrap:h,replace:function(t,n){var r=p(t);return r.deleteContents(),n.length>0&&r.insertNode(e.dom.doc.createTextNode(n)),r},rangeFromMatch:p,indexOf:m}},l=function(t,e){if(!e.get()){var n=s(t.getBody(),t);e.set(n)}return e.get()},f=function(t,e,n,a,c,s,l){var f=function(t){return t.getParam("spellchecker_callback")}(t);(f||function(t,e,n){return function(a,c,s,l){var f={method:a,lang:n.get()},d="";f["addToDictionary"===a?"word":"text"]=c,r.each(f,(function(t,e){d&&(d+="&"),d+=e+"="+encodeURIComponent(t)})),i.send({url:new o(e).toAbsolute(u(t)),type:"post",content_type:"application/x-www-form-urlencoded",data:d,success:function(e){var n=JSON.parse(e);if(n)n.error?l(n.error):s(n);else{var r=t.translate("Server response wasn't proper JSON.");l(r)}},error:function(){var e=t.translate("The spelling service was not found: (")+u(t)+t.translate(")");l(e)}})}}(t,e,n)).call(t.plugins.spellchecker,a,c,s,l)},d=function(t,e,n,r,o,i){if(!h(t,n,r)){t.setProgressState(!0),f(t,e,i,"spellcheck",l(t,r).text,(function(e){v(t,n,r,o,e)}),(function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1),h(t,n,r)})),t.focus()}},m=function(t,e,n){t.dom.select("span.mce-spellchecker-word").length||h(t,e,n)},g=function(t,e,n,o,i,u){t.selection.collapse(),u?r.each(t.dom.select("span.mce-spellchecker-word"),(function(e){e.getAttribute("data-mce-word")===o&&t.dom.remove(e,!0)})):t.dom.remove(i,!0),m(t,e,n)},h=function(t,e,n){var r=t.selection.getBookmark();if(l(t,n).reset(),t.selection.moveToBookmark(r),n.set(null),e.get())return e.set(!1),function(t){t.fire("SpellcheckEnd")}(t),!0},p=function(t){var e=t.getAttribute("data-mce-index");return"number"==typeof e?""+e:e},v=function(t,e,r,o,i){var u=!!i.dictionary,c=i.words;if(t.setProgressState(!1),function(t){for(var e in t)if(n.call(t,e))return!1;return!0}(c)){var s=t.translate("No misspellings found.");return t.notificationManager.open({text:s,type:"info"}),void e.set(!1)}o.set({suggestions:c,hasDictionarySupport:u});var f=t.selection.getBookmark();l(t,r).find(a(t)).filter((function(t){return!!c[t.text]})).wrap((function(e){return t.dom.create("span",{class:"mce-spellchecker-word","aria-invalid":"spelling","data-mce-bogus":1,"data-mce-word":e.text})})),t.selection.moveToBookmark(f),e.set(!0),function(t){t.fire("SpellcheckStart")}(t)},b=function(){return(b=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},y="SpellcheckStart SpellcheckEnd",w=function(t,e,n,o,i,u){var a,c,s=(a=function(t){return r.map(function(t){return t.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv")}(t).split(","),(function(t){var e=t.split("=");return{name:e[0],value:e[1]}}))}(t),c=[],r.each(a,(function(t){c.push({selectable:!0,text:t.name,data:t.value})})),c),l=function(){d(t,e,n,o,u,i)},f={tooltip:"Spellcheck",onAction:l,icon:"spell-check",onSetup:function(e){var r=function(){e.setActive(n.get())};return t.on(y,r),function(){t.off(y,r)}}},m=b(b({},f),{type:"splitbutton",select:function(t){return t===i.get()},fetch:function(t){t(r.map(s,(function(t){return{type:"choiceitem",value:t.data,text:t.text}})))},onItemAction:function(t,e){i.set(e)}});s.length>1?t.ui.registry.addSplitButton("spellchecker",m):t.ui.registry.addToggleButton("spellchecker",f),t.ui.registry.addToggleMenuItem("spellchecker",{text:"Spellcheck",icon:"spell-check",onSetup:function(e){e.setActive(n.get());var r=function(){e.setActive(n.get())};return t.on(y,r),function(){t.off(y,r)}},onAction:l})},x=function(t,e,n,o,i,u,a,c){var s=[],l=n.get().suggestions[a];return r.each(l,(function(e){s.push({text:e,onAction:function(){t.insertContent(t.dom.encode(e)),t.dom.remove(c),m(t,o,i)}})})),n.get().hasDictionarySupport&&(s.push({type:"separator"}),s.push({text:"Add to dictionary",onAction:function(){!function(t,e,n,r,o,i,u){t.setProgressState(!0),f(t,e,o,"addToDictionary",i,(function(){t.setProgressState(!1),t.dom.remove(u,!0),m(t,n,r)}),(function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1)}))}(t,e,o,i,u,a,c)}})),s.push.apply(s,[{type:"separator"},{text:"Ignore",onAction:function(){g(t,o,i,a,c)}},{text:"Ignore all",onAction:function(){g(t,o,i,a,c,!0)}}]),s},C=function(t,e,n,o,i,u){t.ui.registry.addContextMenu("spellchecker",{update:function(a){var c=a;if("mce-spellchecker-word"!==c.className)return[];var s=function(t,e){var n=[],o=r.toArray(t.getBody().getElementsByTagName("span"));if(o.length)for(var i=0;i<o.length;i++){var u=p(o[i]);null!==u&&u.length&&(u===e.toString()&&n.push(o[i]))}return n}(t,p(c));if(s.length>0){var l=t.dom.createRng();return l.setStartBefore(s[0]),l.setEndAfter(s[s.length-1]),t.selection.setRng(l),x(t,e,n,o,i,u,c.getAttribute("data-mce-word"),s)}}})};e.add("spellchecker",(function(e,n){if(!1===function(t){return!!t.hasPlugin("tinymcespellchecker",!0)&&(void 0!==window.console&&window.console.log&&window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),!0)}(e)){var r=t(!1),o=t(function(t){var e=t.getParam("language","en");return t.getParam("spellchecker_language",e)}(e)),i=t(null),u=t(null);return w(e,n,r,i,o,u),C(e,n,u,r,i,o),function(t,e,n,r,o,i){t.addCommand("mceSpellCheck",(function(){d(t,e,n,r,o,i)}))}(e,n,r,i,u,o),function(t,e,n,r,o){return{getTextMatcher:r.get,getWordCharPattern:function(){return a(t)},markErrors:function(o){v(t,e,r,n,o)},getLanguage:o.get}}(e,r,u,i,o)}}))}()},594:function(t,e){!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("textcolor",(function(){}))}()},595:function(t,e){!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env");t.add("print",(function(t){!function(t){t.addCommand("mcePrint",(function(){e.browser.isIE()?t.getDoc().execCommand("print",!1,null):t.getWin().print()}))}(t),function(t){var e=function(){return t.execCommand("mcePrint")};t.ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:e}),t.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:e})}(t),t.addShortcut("Meta+P","","mcePrint")}))}()},76:function(t,e,n){"use strict";n.r(e),function(t){var n=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return(function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n<r.length;n++){var o=r[n];t.call(e,o[1],o[0])}},e}())}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,o=void 0!==t&&t.Math===Math?t:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),i="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(o):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var u=["top","right","bottom","left","width","height","size","weight"],a="undefined"!=typeof MutationObserver,c=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,r=!1,o=0;function u(){n&&(n=!1,t()),r&&c()}function a(){i(u)}function c(){var t=Date.now();if(n){if(t-o<2)return;r=!0}else n=!0,r=!1,setTimeout(a,e);o=t}return c}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),a?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;u.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),s=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},l=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||o},f=v(0,0,0,0);function d(t){return parseFloat(t)||0}function m(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce((function(e,n){return e+d(t["border-"+n+"-width"])}),0)}function g(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return f;var r=l(t).getComputedStyle(t),o=function(t){for(var e={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var o=r[n],i=t["padding-"+o];e[o]=d(i)}return e}(r),i=o.left+o.right,u=o.top+o.bottom,a=d(r.width),c=d(r.height);if("border-box"===r.boxSizing&&(Math.round(a+i)!==e&&(a-=m(r,"left","right")+i),Math.round(c+u)!==n&&(c-=m(r,"top","bottom")+u)),!function(t){return t===l(t).document.documentElement}(t)){var s=Math.round(a+i)-e,g=Math.round(c+u)-n;1!==Math.abs(s)&&(a-=s),1!==Math.abs(g)&&(c-=g)}return v(o.left,o.top,a,c)}var h="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof l(t).SVGGraphicsElement}:function(t){return t instanceof l(t).SVGElement&&"function"==typeof t.getBBox};function p(t){return r?h(t)?function(t){var e=t.getBBox();return v(0,0,e.width,e.height)}(t):g(t):f}function v(t,e,n,r){return{x:t,y:e,width:n,height:r}}var b=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=v(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=p(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),y=function(t,e){var n,r,o,i,u,a,c,l=(r=(n=e).x,o=n.y,i=n.width,u=n.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,c=Object.create(a.prototype),s(c,{x:r,y:o,width:i,height:u,top:o,right:r+i,bottom:u+o,left:r}),c);s(this,{target:t,contentRect:l})},w=function(){function t(t,e,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=r}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof l(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new b(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof l(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new y(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),x="undefined"!=typeof WeakMap?new WeakMap:new n,C=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=c.getInstance(),r=new w(e,n,this);x.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){C.prototype[t]=function(){var e;return(e=x.get(this))[t].apply(e,arguments)}}));var S=void 0!==o.ResizeObserver?o.ResizeObserver:C;e.default=S}.call(this,n(31))},8:function(t,e,n){var r,o;!function(i,u){"use strict";void 0===(o="function"==typeof(r=function(){var t=function(){},e=["trace","debug","info","warn","error"];function n(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch(e){return function(){return Function.prototype.apply.apply(n,[t,arguments])}}}function r(e){return"debug"===e&&(e="log"),"undefined"!=typeof console&&(void 0!==console[e]?n(console,e):void 0!==console.log?n(console,"log"):t)}function o(n,r){for(var o=0;o<e.length;o++){var i=e[o];this[i]=o<n?t:this.methodFactory(i,n,r)}this.log=this.debug}function i(t,e,n){return function(){"undefined"!=typeof console&&(o.call(this,e,n),this[t].apply(this,arguments))}}function u(t,e,n){return r(t)||i.apply(this,arguments)}function a(t,n,r){var i,a=this,c="loglevel";function s(){var t;if("undefined"!=typeof window){try{t=window.localStorage[c]}catch(t){}if(void 0===t)try{var e=window.document.cookie,n=e.indexOf(encodeURIComponent(c)+"=");-1!==n&&(t=/^([^;]+)/.exec(e.slice(n))[1])}catch(t){}return void 0===a.levels[t]&&(t=void 0),t}}t&&(c+=":"+t),a.name=t,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=r||u,a.getLevel=function(){return i},a.setLevel=function(n,r){if("string"==typeof n&&void 0!==a.levels[n.toUpperCase()]&&(n=a.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(i=n,!1!==r&&function(t){var n=(e[t]||"silent").toUpperCase();if("undefined"!=typeof window){try{return void(window.localStorage[c]=n)}catch(t){}try{window.document.cookie=encodeURIComponent(c)+"="+n+";"}catch(t){}}}(n),o.call(a,n,t),"undefined"==typeof console&&n<a.levels.SILENT)return"No console available for logging"},a.setDefaultLevel=function(t){s()||a.setLevel(t,!1)},a.enableAll=function(t){a.setLevel(a.levels.TRACE,t)},a.disableAll=function(t){a.setLevel(a.levels.SILENT,t)};var l=s();null==l&&(l=null==n?"WARN":n),a.setLevel(l,!1)}var c=new a,s={};c.getLogger=function(t){if("string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=s[t];return e||(e=s[t]=new a(t,c.getLevel(),c.methodFactory)),e};var l="undefined"!=typeof window?window.log:void 0;return c.noConflict=function(){return"undefined"!=typeof window&&window.log===c&&(window.log=l),c},c.getLoggers=function(){return s},c})?r.call(e,n,e,t):r)||(t.exports=o)}()}}]);
//# sourceMappingURL=0.e8675090c1595b0ba0fd.js.map