(window.webpackJsonp_name_=window.webpackJsonp_name_||[]).push([[0],{1:function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return i})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return u})),n.d(t,"__param",(function(){return s})),n.d(t,"__metadata",(function(){return c})),n.d(t,"__awaiter",(function(){return l})),n.d(t,"__generator",(function(){return f})),n.d(t,"__exportStar",(function(){return d})),n.d(t,"__values",(function(){return m})),n.d(t,"__read",(function(){return h})),n.d(t,"__spread",(function(){return g})),n.d(t,"__spreadArrays",(function(){return p})),n.d(t,"__await",(function(){return v})),n.d(t,"__asyncGenerator",(function(){return b})),n.d(t,"__asyncDelegator",(function(){return y})),n.d(t,"__asyncValues",(function(){return w})),n.d(t,"__makeTemplateObject",(function(){return x})),n.d(t,"__importStar",(function(){return C})),n.d(t,"__importDefault",(function(){return S})),n.d(t,"__classPrivateFieldGet",(function(){return E})),n.d(t,"__classPrivateFieldSet",(function(){return k}));
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function d(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function m(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e}function p(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}function v(e){return this instanceof v?(this.v=e,this):new v(e)}function b(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof v?Promise.resolve(n.value.v).then(s,c):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function y(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:v(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=m(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function x(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function C(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function S(e){return e&&e.__esModule?e:{default:e}}function E(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function k(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},258:function(e,t,n){"use strict";var r=n(360),o=n(364),i=n(259);e.exports=function(e){var t,n=r(e);return n.space?((t=Array(3))[0]=i(n.values[0],0,255),t[1]=i(n.values[1],0,255),t[2]=i(n.values[2],0,255),"h"===n.space[0]&&(t=o.rgb(t)),t.push(i(n.alpha,0,1)),t):[]}},259:function(e,t){e.exports=function(e,t,n){return t<n?e<t?t:e>n?n:e:e<n?n:e>t?t:e}},261:function(e,t,n){var r;void 0===(r=function(){return function(e){function t(e,t){var n,r;for(n=-1,r=e.length;++n<r;)t(e[n],n,e)}function n(e,n){var r;return r=Array(e.length),t(e,(function(e,t,o){r[t]=n(e,t,o)})),r}function r(e,n,r){return t(e,(function(e,t,o){r=n(e,t,o)})),r}function o(e,n){var r,o,i;return i=this._matrix=[],e==n?this.distance=0:""==e?this.distance=n.length:""==n?this.distance=e.length:(r=[0],t(e,(function(e,t){t++,r[t]=t})),i[0]=r,t(n,(function(a,u){o=[++u],t(e,(function(t,i){i++,e.charAt(i-1)==n.charAt(u-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(e){var t,o,i,a;for(o=r(t=this.getMatrix(),(function(e,t){return Math.max(e,r(t,Math.max,0))}),0),i=Array((o+"").length).join(" "),a=[];a.length<(t[0]&&t[0].length||0);)a[a.length]=Array(i.length+1).join("-");return a=a.join("-+")+"-",n(t,(function(e){return n(e,(function(e){return(i+e).slice(-i.length)})).join(" |")+" "})).join("\n"+a+"\n")},o.prototype.getMatrix=function(){return this._matrix.slice()},o.prototype.valueOf=function(){return this.distance},o}()}.call(t,n,t,e))||(e.exports=r)},30:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},328:function(e,t,n){(function(t){!function(n){"use strict";var r=function(){},o=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e(t.apply(null,n))}},i=function(e){return function(){return e}},a=function(e){return e};function u(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}var s,c,l,f,d,m,h,g,p,v,b,y,w=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return!e.apply(null,t)}},x=i(!1),C=i(!0),S=function(){return E},E=function(){var e=function(e){return e.isNone()},t=function(e){return e()},n=function(e){return e},o={fold:function(e,t){return e()},is:x,isSome:x,isNone:C,getOr:n,getOrThunk:t,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:t,map:S,each:r,bind:S,exists:x,forall:C,filter:S,equals:e,equals_:e,toArray:function(){return[]},toString:i("none()")};return Object.freeze&&Object.freeze(o),o}(),k=function(e){var t=i(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:C,isNone:x,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return k(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:E},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(x,(function(t){return n(e,t)}))}};return o},N={some:k,none:S,from:function(e){return null==e?E:k(e)}},T=function(e){return function(t){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(t)===e}},_=T("string"),R=T("object"),O=T("array"),A=T("null"),D=T("boolean"),P=T("function"),B=T("number"),I=Array.prototype.slice,M=Array.prototype.indexOf,L=Array.prototype.push,F=function(e,t){return M.call(e,t)},H=function(e,t){return F(e,t)>-1},z=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1},W=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},j=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)},U=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o)?n:r).push(a)}return{pass:n,fail:r}},V=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},q=function(e,t,n){return j(e,(function(e){n=t(n,e)})),n},$=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n))return N.some(o)}return N.none()},Y=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return N.some(n);return N.none()},X=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!O(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);L.apply(t,e[n])}return t}(W(e,t))},K=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n))return!1;return!0},G=function(e,t){return V(e,(function(e){return!H(t,e)}))},J=function(e){return 0===e.length?N.none():N.some(e[0])},Q=function(e){return 0===e.length?N.none():N.some(e[e.length-1])},Z=P(Array.from)?Array.from:function(e){return I.call(e)},ee=void 0!==n.window?n.window:Function("return this;")(),te=function(e,t){return function(e,t){for(var n=null!=t?t:ee,r=0;r<e.length&&null!=n;++r)n=n[e[r]];return n}(e.split("."),t)},ne=function(e,t){var n=function(e,t){return te(e,t)}(e,t);if(null==n)throw new Error(e+" not available on this browser");return n},re=function(){return ne("URL")},oe=function(e){return re().createObjectURL(e)},ie=function(e){re().revokeObjectURL(e)},ae=n.navigator,ue=ae.userAgent,se=function(e){return"matchMedia"in n.window&&n.matchMedia(e).matches};g=/Android/.test(ue),c=(c=!(s=/WebKit/.test(ue))&&/MSIE/gi.test(ue)&&/Explorer/gi.test(ae.appName))&&/MSIE (\w+)\./.exec(ue)[1],l=-1!==ue.indexOf("Trident/")&&(-1!==ue.indexOf("rv:")||-1!==ae.appName.indexOf("Netscape"))&&11,f=-1!==ue.indexOf("Edge/")&&!c&&!l&&12,c=c||l||f,d=!s&&!l&&/Gecko/.test(ue),m=-1!==ue.indexOf("Mac"),h=/(iPad|iPhone)/.test(ue),p="FormData"in n.window&&"FileReader"in n.window&&"URL"in n.window&&!!oe,v=se("only screen and (max-device-width: 480px)")&&(g||h),b=se("only screen and (min-width: 800px)")&&(g||h),y=-1!==ue.indexOf("Windows Phone"),f&&(s=!1);var ce,le={opera:!1,webkit:s,ie:c,gecko:d,mac:m,iOS:h,android:g,contentEditable:!h||p||parseInt(ue.match(/AppleWebKit\/(\d*)/)[1],10)>=534,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==c,range:n.window.getSelection&&"Range"in n.window,documentMode:c&&!f?n.document.documentMode||7:10,fileApi:p,ceFalse:!1===c||c>8,cacheSuffix:null,container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===c||c>11,desktop:!v&&!b,windowsPhone:y},fe=window.Promise?window.Promise:function(){function e(e,t){return function(){e.apply(t,arguments)}}var t=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},n=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],c(t,e(i,this),e(a,this))},r=n.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)};function o(e){var t=this;null!==this._state?r((function(){var n=t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void e.reject(t)}e.resolve(r)}else(t._state?e.resolve:e.reject)(t._value)})):this._deferreds.push(e)}function i(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void c(e(n,t),e(i,this),e(a,this))}this._state=!0,this._value=t,u.call(this)}catch(e){a.call(this,e)}}function a(e){this._state=!1,this._value=e,u.call(this)}function u(){for(var e=0,t=this._deferreds.length;e<t;e++)o.call(this,this._deferreds[e]);this._deferreds=null}function s(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function c(e,t,n){var r=!1;try{e((function(e){r||(r=!0,t(e))}),(function(e){r||(r=!0,n(e))}))}catch(e){if(r)return;r=!0,n(e)}}return n.prototype.catch=function(e){return this.then(null,e)},n.prototype.then=function(e,t){var r=this;return new n((function(n,i){o.call(r,new s(e,t,n,i))}))},n.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&t(arguments[0])?arguments[0]:arguments);return new n((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(e){o(i,e)}),n)}e[i]=a,0==--r&&t(e)}catch(e){n(e)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===n?e:new n((function(t){t(e)}))},n.reject=function(e){return new n((function(t,n){n(e)}))},n.race=function(e){return new n((function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)}))},n}(),de=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},me=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},he=function(e,t){var n,r;return(r=function(){var r=arguments;clearTimeout(n),n=de((function(){e.apply(this,r)}),t)}).stop=function(){clearTimeout(n)},r},ge={requestAnimationFrame:function(e,t){ce?ce.then(e):ce=new fe((function(e){t||(t=n.document.body),function(e,t){var r,o=n.window.requestAnimationFrame,i=["ms","moz","webkit"];for(r=0;r<i.length&&!o;r++)o=n.window[i[r]+"RequestAnimationFrame"];o||(o=function(e){n.window.setTimeout(e,0)}),o(e,t)}(e,t)})).then(e)},setTimeout:de,setInterval:me,setEditorTimeout:function(e,t,n){return de((function(){e.removed||t()}),n)},setEditorInterval:function(e,t,n){var r;return r=me((function(){e.removed?clearInterval(r):t()}),n)},debounce:he,throttle:he,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},pe=/^(?:mouse|contextmenu)|click/,ve={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},be=function(){return!1},ye=function(){return!0},we=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},xe=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},Ce=function(e,t){var r,o=t||{};for(r in e)ve[r]||(o[r]=e[r]);if(o.target||(o.target=o.srcElement||n.document),le.experimentalShadowDom&&(o.target=function(e,t){if(e.composedPath){var n=e.composedPath();if(n&&n.length>0)return n[0]}return t}(e,o.target)),e&&pe.test(e.type)&&void 0===e.pageX&&void 0!==e.clientX){var i=o.target.ownerDocument||n.document,a=i.documentElement,u=i.body;o.pageX=e.clientX+(a&&a.scrollLeft||u&&u.scrollLeft||0)-(a&&a.clientLeft||u&&u.clientLeft||0),o.pageY=e.clientY+(a&&a.scrollTop||u&&u.scrollTop||0)-(a&&a.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=ye,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=ye,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=ye,o.stopPropagation()},!1===function(e){return e.isDefaultPrevented===ye||e.isDefaultPrevented===be}(o)&&(o.isDefaultPrevented=be,o.isPropagationStopped=be,o.isImmediatePropagationStopped=be),void 0===o.metaKey&&(o.metaKey=!1),o},Se=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},a=function(){n.domLoaded||(n.domLoaded=!0,t(o))},u=function(){i()&&(xe(r,"readystatechange",u),a())},s=function(){try{r.documentElement.doScroll("left")}catch(e){return void ge.setTimeout(s)}a()};!r.addEventListener||le.ie&&le.ie<11?(we(r,"readystatechange",u),r.documentElement.doScroll&&e.self===e.top&&s()):i()?a():we(e,"DOMContentLoaded",a),we(e,"load",a)}},Ee=function(){var e,t,r,o,i,a=this,u={};t="mce-data-"+(+new Date).toString(32),o="onmouseenter"in n.document.documentElement,r="onfocusin"in n.document.documentElement,i={mouseenter:"mouseover",mouseleave:"mouseout"},e=1,a.domLoaded=!1,a.events=u;var s=function(e,t){var n,r,o,i,a=u[t];if(n=a&&a[e.type])for(r=0,o=n.length;r<o;r++)if((i=n[r])&&!1===i.func.call(i.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return};a.bind=function(c,l,f,d){var m,h,g,p,v,b,y,w=n.window,x=function(e){s(Ce(e||w.event),m)};if(c&&3!==c.nodeType&&8!==c.nodeType){for(c[t]?m=c[t]:(m=e++,c[t]=m,u[m]={}),d=d||c,g=(l=l.split(" ")).length;g--;)b=x,v=y=!1,"DOMContentLoaded"===(p=l[g])&&(p="ready"),a.domLoaded&&"ready"===p&&"complete"===c.readyState?f.call(d,Ce({type:p})):(o||(v=i[p])&&(b=function(e){var t,n;if(t=e.currentTarget,(n=e.relatedTarget)&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=Ce(e||w.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,s(e,m))}),r||"focusin"!==p&&"focusout"!==p||(y=!0,v="focusin"===p?"focus":"blur",b=function(e){(e=Ce(e||w.event)).type="focus"===e.type?"focusin":"focusout",s(e,m)}),(h=u[m][p])?"ready"===p&&a.domLoaded?f({type:p}):h.push({func:f,scope:d}):(u[m][p]=h=[{func:f,scope:d}],h.fakeName=v,h.capture=y,h.nativeHandler=b,"ready"===p?Se(c,b,a):we(c,v||p,b,y)));return c=h=0,f}},a.unbind=function(e,n,r){var o,i,s,c,l,f;if(!e||3===e.nodeType||8===e.nodeType)return a;if(o=e[t]){if(f=u[o],n){for(s=(n=n.split(" ")).length;s--;)if(i=f[l=n[s]]){if(r)for(c=i.length;c--;)if(i[c].func===r){var d=i.nativeHandler,m=i.fakeName,h=i.capture;(i=i.slice(0,c).concat(i.slice(c+1))).nativeHandler=d,i.fakeName=m,i.capture=h,f[l]=i}r&&0!==i.length||(delete f[l],xe(e,i.fakeName||l,i.nativeHandler,i.capture))}}else{for(l in f)i=f[l],xe(e,i.fakeName||l,i.nativeHandler,i.capture);f={}}for(l in f)return a;delete u[o];try{delete e[t]}catch(n){e[t]=null}}return a},a.fire=function(e,n,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return a;(r=Ce(null,r)).type=n,r.target=e;do{(o=e[t])&&s(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow}while(e&&!r.isPropagationStopped());return a},a.clean=function(e){var n,r,o=a.unbind;if(!e||3===e.nodeType||8===e.nodeType)return a;if(e[t]&&o(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(o(e),n=(r=e.getElementsByTagName("*")).length;n--;)(e=r[n])[t]&&o(e);return a},a.destroy=function(){u={}},a.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}};(Ee.Event=new Ee).bind(n.window,"ready",(function(){}));var ke,Ne,Te,_e,Re,Oe,Ae,De,Pe,Be,Ie,Me,Le,Fe,He,ze,We,je,Ue="sizzle"+-new Date,Ve=n.window.document,qe=0,$e=0,Ye=Et(),Xe=Et(),Ke=Et(),Ge=function(e,t){return e===t&&(Ie=!0),0},Je={}.hasOwnProperty,Qe=[],Ze=Qe.pop,et=Qe.push,tt=Qe.push,nt=Qe.slice,rt=Qe.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},ot="[\\x20\\t\\r\\n\\f]",it="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",at="\\["+ot+"*("+it+")(?:"+ot+"*([*^$|!~]?=)"+ot+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+it+"))|)"+ot+"*\\]",ut=":("+it+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+at+")*)|.*)\\)|)",st=new RegExp("^"+ot+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ot+"+$","g"),ct=new RegExp("^"+ot+"*,"+ot+"*"),lt=new RegExp("^"+ot+"*([>+~]|"+ot+")"+ot+"*"),ft=new RegExp("="+ot+"*([^\\]'\"]*?)"+ot+"*\\]","g"),dt=new RegExp(ut),mt=new RegExp("^"+it+"$"),ht={ID:new RegExp("^#("+it+")"),CLASS:new RegExp("^\\.("+it+")"),TAG:new RegExp("^("+it+"|[*])"),ATTR:new RegExp("^"+at),PSEUDO:new RegExp("^"+ut),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ot+"*(even|odd|(([+-]|)(\\d*)n|)"+ot+"*(?:([+-]|)"+ot+"*(\\d+)|))"+ot+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+ot+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ot+"*((?:-\\d)?\\d*)"+ot+"*\\)|)(?=[^-]|$)","i")},gt=/^(?:input|select|textarea|button)$/i,pt=/^h\d$/i,vt=/^[^{]+\{\s*\[native \w/,bt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,yt=/[+~]/,wt=/'|\\/g,xt=new RegExp("\\\\([\\da-f]{1,6}"+ot+"?|("+ot+")|.)","ig"),Ct=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{tt.apply(Qe=nt.call(Ve.childNodes),Ve.childNodes),Qe[Ve.childNodes.length].nodeType}catch(e){tt={apply:Qe.length?function(e,t){et.apply(e,nt.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var St=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:Ve)!==Le&&Me(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Le).nodeType)&&9!==u)return[];if(He&&!r){if(o=bt.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&je(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return tt.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&Ne.getElementsByClassName)return tt.apply(n,t.getElementsByClassName(a)),n}if(Ne.qsa&&(!ze||!ze.test(e))){if(f=l=Ue,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=Oe(e),(l=t.getAttribute("id"))?f=l.replace(wt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+Dt(c[s]);d=yt.test(e)&&Ot(t.parentNode)||t,m=c.join(",")}if(m)try{return tt.apply(n,d.querySelectorAll(m)),n}catch(e){}finally{l||t.removeAttribute("id")}}}return De(e.replace(st,"$1"),t,n,r)};function Et(){var e=[];return function t(n,r){return e.push(n+" ")>Te.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function kt(e){return e[Ue]=!0,e}function Nt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function Tt(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function _t(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function Rt(e){return kt((function(t){return t=+t,kt((function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))}))}))}function Ot(e){return e&&void 0!==e.getElementsByTagName&&e}for(ke in Ne=St.support={},Re=St.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Me=St.setDocument=function(e){var t,n=e?e.ownerDocument||e:Ve,r=n.defaultView;return n!==Le&&9===n.nodeType&&n.documentElement?(Le=n,Fe=n.documentElement,He=!Re(n),r&&r!==function(e){try{return e.top}catch(e){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){Me()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){Me()}))),Ne.attributes=!0,Ne.getElementsByTagName=!0,Ne.getElementsByClassName=vt.test(n.getElementsByClassName),Ne.getById=!0,Te.find.ID=function(e,t){if(void 0!==t.getElementById&&He){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},Te.filter.ID=function(e){var t=e.replace(xt,Ct);return function(e){return e.getAttribute("id")===t}},Te.find.TAG=Ne.getElementsByTagName?function(e,t){if(void 0!==t.getElementsByTagName)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Te.find.CLASS=Ne.getElementsByClassName&&function(e,t){if(He)return t.getElementsByClassName(e)},We=[],ze=[],Ne.disconnectedMatch=!0,ze=ze.length&&new RegExp(ze.join("|")),We=We.length&&new RegExp(We.join("|")),t=vt.test(Fe.compareDocumentPosition),je=t||vt.test(Fe.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Ge=t?function(e,t){if(e===t)return Ie=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!Ne.sortDetached&&t.compareDocumentPosition(e)===r?e===n||e.ownerDocument===Ve&&je(Ve,e)?-1:t===n||t.ownerDocument===Ve&&je(Ve,t)?1:Be?rt.call(Be,e)-rt.call(Be,t):0:4&r?-1:1)}:function(e,t){if(e===t)return Ie=!0,0;var r,o=0,i=e.parentNode,a=t.parentNode,u=[e],s=[t];if(!i||!a)return e===n?-1:t===n?1:i?-1:a?1:Be?rt.call(Be,e)-rt.call(Be,t):0;if(i===a)return Nt(e,t);for(r=e;r=r.parentNode;)u.unshift(r);for(r=t;r=r.parentNode;)s.unshift(r);for(;u[o]===s[o];)o++;return o?Nt(u[o],s[o]):u[o]===Ve?-1:s[o]===Ve?1:0},n):Le},St.matches=function(e,t){return St(e,null,null,t)},St.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Le&&Me(e),t=t.replace(ft,"='$1']"),Ne.matchesSelector&&He&&(!We||!We.test(t))&&(!ze||!ze.test(t)))try{var n=(void 0).call(e,t);if(n||Ne.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return St(t,Le,null,[e]).length>0},St.contains=function(e,t){return(e.ownerDocument||e)!==Le&&Me(e),je(e,t)},St.attr=function(e,t){(e.ownerDocument||e)!==Le&&Me(e);var n=Te.attrHandle[t.toLowerCase()],r=n&&Je.call(Te.attrHandle,t.toLowerCase())?n(e,t,!He):void 0;return void 0!==r?r:Ne.attributes||!He?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},St.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},St.uniqueSort=function(e){var t,n=[],r=0,o=0;if(Ie=!Ne.detectDuplicates,Be=!Ne.sortStable&&e.slice(0),e.sort(Ge),Ie){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return Be=null,e},_e=St.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=_e(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=_e(t);return n},(Te=St.selectors={cacheLength:50,createPseudo:kt,match:ht,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,Ct),e[3]=(e[3]||e[4]||e[5]||"").replace(xt,Ct),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||St.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&St.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ht.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&dt.test(n)&&(t=Oe(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(xt,Ct).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Ye[e+" "];return t||(t=new RegExp("(^|"+ot+")"+e+"("+ot+"|$)"))&&Ye(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var o=St.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),u="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,s){var c,l,f,d,m,h,g=i!==a?"nextSibling":"previousSibling",p=t.parentNode,v=u&&t.nodeName.toLowerCase(),b=!s&&!u;if(p){if(i){for(;g;){for(f=t;f=f[g];)if(u?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?p.firstChild:p.lastChild],a&&b){for(m=(c=(l=p[Ue]||(p[Ue]={}))[e]||[])[0]===qe&&c[1],d=c[0]===qe&&c[2],f=m&&p.childNodes[m];f=++m&&f&&f[g]||(d=m=0)||h.pop();)if(1===f.nodeType&&++d&&f===t){l[e]=[qe,m,d];break}}else if(b&&(c=(t[Ue]||(t[Ue]={}))[e])&&c[0]===qe)d=c[1];else for(;(f=++m&&f&&f[g]||(d=m=0)||h.pop())&&((u?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[Ue]||(f[Ue]={}))[e]=[qe,d]),f!==t)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(e,t){var n,r=Te.pseudos[e]||Te.setFilters[e.toLowerCase()]||St.error("unsupported pseudo: "+e);return r[Ue]?r(t):r.length>1?(n=[e,e,"",t],Te.setFilters.hasOwnProperty(e.toLowerCase())?kt((function(e,n){for(var o,i=r(e,t),a=i.length;a--;)e[o=rt.call(e,i[a])]=!(n[o]=i[a])})):function(e){return r(e,0,n)}):r}},pseudos:{not:kt((function(e){var t=[],n=[],r=Ae(e.replace(st,"$1"));return r[Ue]?kt((function(e,t,n,o){for(var i,a=r(e,null,o,[]),u=e.length;u--;)(i=a[u])&&(e[u]=!(t[u]=i))})):function(e,o,i){return t[0]=e,r(t,null,i,n),!n.pop()}})),has:kt((function(e){return function(t){return St(e,t).length>0}})),contains:kt((function(e){return e=e.replace(xt,Ct),function(t){return(t.textContent||t.innerText||_e(t)).indexOf(e)>-1}})),lang:kt((function(e){return mt.test(e||"")||St.error("unsupported lang: "+e),e=e.replace(xt,Ct).toLowerCase(),function(t){var n;do{if(n=He?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(e){var t=n.window.location&&n.window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===Fe},focus:function(e){return e===Le.activeElement&&(!Le.hasFocus||Le.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!Te.pseudos.empty(e)},header:function(e){return pt.test(e.nodeName)},input:function(e){return gt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:Rt((function(){return[0]})),last:Rt((function(e,t){return[t-1]})),eq:Rt((function(e,t,n){return[n<0?n+t:n]})),even:Rt((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:Rt((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:Rt((function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e})),gt:Rt((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}}).pseudos.nth=Te.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})Te.pseudos[ke]=Tt(ke);for(ke in{submit:!0,reset:!0})Te.pseudos[ke]=_t(ke);function At(){}function Dt(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Pt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,i=$e++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,a){var u,s,c=[qe,i];if(a){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||o){if((u=(s=t[Ue]||(t[Ue]={}))[r])&&u[0]===qe&&u[1]===i)return c[2]=u[2];if(s[r]=c,c[2]=e(t,n,a))return!0}}}function Bt(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function It(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(u)));return a}function Mt(e,t,n,r,o,i){return r&&!r[Ue]&&(r=Mt(r)),o&&!o[Ue]&&(o=Mt(o,i)),kt((function(i,a,u,s){var c,l,f,d=[],m=[],h=a.length,g=i||function(e,t,n){for(var r=0,o=t.length;r<o;r++)St(e,t[r],n);return n}(t||"*",u.nodeType?[u]:u,[]),p=!e||!i&&t?g:It(g,d,e,u,s),v=n?o||(i?e:h||r)?[]:a:p;if(n&&n(p,v,u,s),r)for(c=It(v,m),r(c,[],u,s),l=c.length;l--;)(f=c[l])&&(v[m[l]]=!(p[m[l]]=f));if(i){if(o||e){if(o){for(c=[],l=v.length;l--;)(f=v[l])&&c.push(p[l]=f);o(null,v=[],c,s)}for(l=v.length;l--;)(f=v[l])&&(c=o?rt.call(i,f):d[l])>-1&&(i[c]=!(a[c]=f))}}else v=It(v===a?v.splice(h,v.length):v),o?o(null,a,v,s):tt.apply(a,v)}))}function Lt(e){for(var t,n,r,o=e.length,i=Te.relative[e[0].type],a=i||Te.relative[" "],u=i?1:0,s=Pt((function(e){return e===t}),a,!0),c=Pt((function(e){return rt.call(t,e)>-1}),a,!0),l=[function(e,n,r){return!i&&(r||n!==Pe)||((t=n).nodeType?s(e,n,r):c(e,n,r))}];u<o;u++)if(n=Te.relative[e[u].type])l=[Pt(Bt(l),n)];else{if((n=Te.filter[e[u].type].apply(null,e[u].matches))[Ue]){for(r=++u;r<o&&!Te.relative[e[r].type];r++);return Mt(u>1&&Bt(l),u>1&&Dt(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(st,"$1"),n,u<r&&Lt(e.slice(u,r)),r<o&&Lt(e=e.slice(r)),r<o&&Dt(e))}l.push(n)}return Bt(l)}At.prototype=Te.filters=Te.pseudos,Te.setFilters=new At,Oe=St.tokenize=function(e,t){var n,r,o,i,a,u,s,c=Xe[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=Te.preFilter;a;){for(i in n&&!(r=ct.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=lt.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(st," ")}),a=a.slice(n.length)),Te.filter)!(r=ht[i].exec(a))||s[i]&&!(r=s[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?St.error(e):Xe(e,u).slice(0)},Ae=St.compile=function(e,t){var n,r=[],o=[],i=Ke[e+" "];if(!i){for(t||(t=Oe(e)),n=t.length;n--;)(i=Lt(t[n]))[Ue]?r.push(i):o.push(i);(i=Ke(e,function(e,t){var n=t.length>0,r=e.length>0,o=function(o,i,a,u,s){var c,l,f,d=0,m="0",h=o&&[],g=[],p=Pe,v=o||r&&Te.find.TAG("*",s),b=qe+=null==p?1:Math.random()||.1,y=v.length;for(s&&(Pe=i!==Le&&i);m!==y&&null!=(c=v[m]);m++){if(r&&c){for(l=0;f=e[l++];)if(f(c,i,a)){u.push(c);break}s&&(qe=b)}n&&((c=!f&&c)&&d--,o&&h.push(c))}if(d+=m,n&&m!==d){for(l=0;f=t[l++];)f(h,g,i,a);if(o){if(d>0)for(;m--;)h[m]||g[m]||(g[m]=Ze.call(u));g=It(g)}tt.apply(u,g),s&&!o&&g.length>0&&d+t.length>1&&St.uniqueSort(u)}return s&&(qe=b,Pe=p),h};return n?kt(o):o}(o,r))).selector=e}return i},De=St.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&Oe(e=c.selector||e);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(a=i[0]).type&&Ne.getById&&9===t.nodeType&&He&&Te.relative[i[1].type]){if(!(t=(Te.find.ID(a.matches[0].replace(xt,Ct),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=ht.needsContext.test(e)?0:i.length;o--&&(a=i[o],!Te.relative[u=a.type]);)if((s=Te.find[u])&&(r=s(a.matches[0].replace(xt,Ct),yt.test(i[0].type)&&Ot(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&Dt(i)))return tt.apply(n,r),n;break}}return(c||Ae(e,l))(r,t,!He,n,yt.test(e)&&Ot(t.parentNode)||t),n},Ne.sortStable=Ue.split("").sort(Ge).join("")===Ue,Ne.detectDuplicates=!!Ie,Me(),Ne.sortDetached=!0;var Ft=Array.isArray,Ht=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,void 0!==e.length){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},zt=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1},Wt={isArray:Ft,toArray:function(e){var t,n,r=e;if(!Ft(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:Ht,map:function(e,t){var n=[];return Ht(e,(function(r,o){n.push(t(r,o,e))})),n},filter:function(e,t){var n=[];return Ht(e,(function(r,o){t&&!t(r,o,e)||n.push(r)})),n},indexOf:function(e,t){var n,r;if(e)for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},reduce:function(e,t,n,r){var o=0;for(arguments.length<3&&(n=e[0]);o<e.length;o++)n=t.call(r,n,e[o],o);return n},findIndex:zt,find:function(e,t,n){var r=zt(e,t,n);if(-1!==r)return e[r]},last:function(e){return e[e.length-1]}},jt=/^\s*|\s*$/g,Ut=function(e){return null==e?"":(""+e).replace(jt,"")},Vt=function(e,t){return t?!("array"!==t||!Wt.isArray(e))||typeof e===t:void 0!==e},qt=function(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),Wt.each(e,(function(e,o){if(!1===t.call(r,e,o,n))return!1;qt(e,t,n,r)})))},$t={trim:Ut,isArray:Wt.isArray,is:Vt,toArray:Wt.toArray,makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:Wt.each,map:Wt.map,grep:Wt.filter,inArray:Wt.indexOf,hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e,t){for(var n,r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var u,s=arguments;for(n=1,r=s.length;n<r;n++)for(o in t=s[n])t.hasOwnProperty(o)&&void 0!==(u=t[o])&&(e[o]=u);return e},create:function(e,t,n){var r,o,i,a,u,s=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],!(o=this.createNS(e[3].replace(/\.\w+$/,""),n))[i]){if("static"===e[2])return o[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[i]));t[i]||(t[i]=function(){},s=1),o[i]=t[i],this.extend(o[i].prototype,t),e[5]&&(r=this.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],u=o[i],o[i]=s?function(){return r[a].apply(this,arguments)}:function(){return this.parent=r[a],u.apply(this,arguments)},o[i].prototype[i]=o[i],this.each(r,(function(e,t){o[i].prototype[t]=r[t]})),this.each(t,(function(e,t){r[t]?o[i].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==i&&(o[i].prototype[t]=e)}))),this.each(t.static,(function(e,t){o[i][t]=e}))}},walk:qt,createNS:function(e,t){var r,o;for(t=t||n.window,e=e.split("."),r=0;r<e.length;r++)t[o=e[r]]||(t[o]={}),t=t[o];return t},resolve:function(e,t){var r,o;for(t=t||n.window,r=0,o=(e=e.split(".")).length;r<o&&(t=t[e[r]]);r++);return t},explode:function(e,t){return!e||Vt(e,"array")?e:Wt.map(e.split(t||","),Ut)},_addCacheSuffix:function(e){var t=le.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Yt=n.document,Xt=Array.prototype.push,Kt=Array.prototype.slice,Gt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Jt=Ee.Event,Qt=$t.makeMap("children,contents,next,prev"),Zt=function(e){return void 0!==e},en=function(e){return"string"==typeof e},tn=function(e,t){var n,r,o;for(o=(t=t||Yt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},nn=function(e,t,n,r){var o;if(en(t))t=tn(t,vn(e[0]));else if(t.length&&!t.nodeType){if(t=dn.makeArray(t),r)for(o=t.length-1;o>=0;o--)nn(e,t[o],n,r);else for(o=0;o<t.length;o++)nn(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},rn=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},on=function(e,t,n){var r,o;return t=dn(t)[0],e.each((function(){n&&r===this.parentNode?o.appendChild(this):(r=this.parentNode,o=t.cloneNode(!1),this.parentNode.insertBefore(o,this),o.appendChild(this))})),e},an=$t.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),un=$t.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),sn={for:"htmlFor",class:"className",readonly:"readOnly"},cn={float:"cssFloat"},ln={},fn={},dn=function(e,t){return new dn.fn.init(e,t)},mn=/^\s*|\s*$/g,hn=function(e){return null==e?"":(""+e).replace(mn,"")},gn=function(e,t){var n,r,o,i;if(e)if(void 0===(n=e.length)){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},pn=function(e,t){var n=[];return gn(e,(function(e,r){t(r,e)&&n.push(r)})),n},vn=function(e){return e?9===e.nodeType?e:e.ownerDocument:Yt};dn.fn=dn.prototype={constructor:dn,selector:"",context:null,length:0,init:function(e,t){var r,o;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(t&&t.nodeType)this.context=t;else{if(t)return dn(e).attr(t);this.context=t=n.document}if(en(e)){if(this.selector=e,!(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Gt.exec(e)))return dn(t).find(e);if(r[1])for(o=tn(e,vn(t)).firstChild;o;)Xt.call(this,o),o=o.nextSibling;else{if(!(o=vn(t).getElementById(r[2])))return this;if(o.id!==r[2])return this.find(e);this.length=1,this[0]=o}}else this.add(e,!1);return this},toArray:function(){return $t.toArray(this)},add:function(e,t){var n,r;if(en(e))return this.add(dn(e));if(!1!==t)for(n=dn.unique(this.toArray().concat(dn.makeArray(e))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else Xt.apply(this,dn.makeArray(e));return this},attr:function(e,t){var n,r=this;if("object"==typeof e)gn(e,(function(e,t){r.attr(e,t)}));else{if(!Zt(t)){if(r[0]&&1===r[0].nodeType){if((n=ln[e])&&n.get)return n.get(r[0],e);if(un[e])return r.prop(e)?e:void 0;null===(t=r[0].getAttribute(e,2))&&(t=void 0)}return t}this.each((function(){var n;if(1===this.nodeType){if((n=ln[e])&&n.set)return void n.set(this,t);null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2)}}))}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=sn[e]||e))gn(e,(function(e,t){n.prop(e,t)}));else{if(!Zt(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each((function(){1===this.nodeType&&(this[e]=t)}))}return n},css:function(e,t){var n,r,o=this,i=function(e){return e.replace(/-(\D)/g,(function(e,t){return t.toUpperCase()}))},a=function(e){return e.replace(/[A-Z]/g,(function(e){return"-"+e}))};if("object"==typeof e)gn(e,(function(e,t){o.css(e,t)}));else if(Zt(t))e=i(e),"number"!=typeof t||an[e]||(t=t.toString()+"px"),o.each((function(){var n=this.style;if((r=fn[e])&&r.set)r.set(this,t);else{try{this.style[cn[e]||e]=t}catch(e){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(a(e)):n.removeAttribute(e))}}));else{if(n=o[0],(r=fn[e])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(e)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(a(e))}catch(e){return}}return o},remove:function(){for(var e,t=this.length;t--;)e=this[t],Jt.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t;if(Zt(e)){t=this.length;try{for(;t--;)this[t].innerHTML=e}catch(n){dn(this[t]).empty().append(e)}return this}return this[0]?this[0].innerHTML:""},text:function(e){var t;if(Zt(e)){for(t=this.length;t--;)"innerText"in this[t]?this[t].innerText=e:this[0].textContent=e;return this}return this[0]?this[0].innerText||this[0].textContent:""},append:function(){return nn(this,arguments,(function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)}))},prepend:function(){return nn(this,arguments,(function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)}),!0)},before:function(){var e=this;return e[0]&&e[0].parentNode?nn(e,arguments,(function(e){this.parentNode.insertBefore(e,this)})):e},after:function(){var e=this;return e[0]&&e[0].parentNode?nn(e,arguments,(function(e){this.parentNode.insertBefore(e,this.nextSibling)}),!0):e},appendTo:function(e){return dn(e).append(this),this},prependTo:function(e){return dn(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return on(this,e)},wrapAll:function(e){return on(this,e,!0)},wrapInner:function(e){return this.each((function(){dn(this).contents().wrapAll(e)})),this},unwrap:function(){return this.parent().each((function(){dn(this).replaceWith(this.childNodes)}))},clone:function(){var e=[];return this.each((function(){e.push(this.cloneNode(!0))})),dn(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return"string"!=typeof e?n:(-1!==e.indexOf(" ")?gn(e.split(" "),(function(){n.toggleClass(this,t)})):n.each((function(n,r){var o,i;(i=rn(r,e))!==t&&(o=r.className,i?r.className=hn((" "+o+" ").replace(" "+e+" "," ")):r.className+=o?" "+e:e)})),n)},hasClass:function(e){return rn(this[0],e)},each:function(e){return gn(this,e)},on:function(e,t){return this.each((function(){Jt.bind(this,e,t)}))},off:function(e,t){return this.each((function(){Jt.unbind(this,e,t)}))},trigger:function(e){return this.each((function(){"object"==typeof e?Jt.fire(this,e.type,e):Jt.fire(this,e)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new dn(Kt.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)dn.find(e,this[t],r);return dn(r)},filter:function(e){return dn("function"==typeof e?pn(this.toArray(),(function(t,n){return e(n,t)})):dn.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof dn&&(e=e[0]),this.each((function(n,r){for(;r;){if("string"==typeof e&&dn(r).is(e)){t.push(r);break}if(r===e){t.push(r);break}r=r.parentNode}})),dn(t)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Xt,sort:[].sort,splice:[].splice},$t.extend(dn,{extend:$t.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:$t.toArray(e);var t},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:$t.isArray,each:gn,trim:hn,grep:pn,find:St,expr:St.selectors,unique:St.uniqueSort,text:St.getText,contains:St.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?dn.find.matchesSelector(t[0],e)?[t[0]]:[]:dn.find.matches(e,t)}});var bn=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof dn&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&dn(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},yn=function(e,t,n,r){var o=[];for(r instanceof dn&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(void 0!==r){if(e===r)break;if("string"==typeof r&&dn(e).is(r))break}o.push(e)}return o},wn=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};gn({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return bn(e,"parentNode")},next:function(e){return wn(e,"nextSibling",1)},prev:function(e){return wn(e,"previousSibling",1)},children:function(e){return yn(e.firstChild,"nextSibling",1)},contents:function(e){return $t.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},(function(e,t){dn.fn[e]=function(n){var r=[];return this.each((function(){var e=t.call(r,this,n,r);e&&(dn.isArray(e)?r.push.apply(r,e):r.push(e))})),this.length>1&&(Qt[e]||(r=dn.unique(r)),0===e.indexOf("parents")&&(r=r.reverse())),r=dn(r),n?r.filter(n):r}})),gn({parentsUntil:function(e,t){return bn(e,"parentNode",t)},nextUntil:function(e,t){return yn(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return yn(e,"previousSibling",1,t).slice(1)}},(function(e,t){dn.fn[e]=function(n,r){var o=[];return this.each((function(){var e=t.call(o,this,n,o);e&&(dn.isArray(e)?o.push.apply(o,e):o.push(e))})),this.length>1&&(o=dn.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse())),o=dn(o),r?o.filter(r):o}})),dn.fn.is=function(e){return!!e&&this.filter(e).length>0},dn.fn.init.prototype=dn.fn,dn.overrideDefaults=function(e){var t,n=function(r,o){return t=t||e(),0===arguments.length&&(r=t.element),o||(o=t.context),new n.fn.init(r,o)};return dn.extend(n,this),n};var xn=function(e,t,n){gn(n,(function(n,r){e[n]=e[n]||{},e[n][t]=r}))};le.ie&&le.ie<8&&(xn(ln,"get",{maxlength:function(e){var t=e.maxLength;if(2147483647!==t)return t},size:function(e){var t=e.size;if(20!==t)return t},class:function(e){return e.className},style:function(e){var t=e.style.cssText;if(0!==t.length)return t}}),xn(ln,"set",{class:function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),le.ie&&le.ie<9&&(cn.float="styleFloat",xn(fn,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),dn.attrHooks=ln,dn.cssHooks=fn;var Cn,Sn,En,kn=function(){return Nn(0,0)},Nn=function(e,t){return{major:e,minor:t}},Tn={nu:Nn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?kn():function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Nn(r(1),r(2))}(e,n)},unknown:kn},_n=function(e,t){return function(){return t===e}},Rn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:_n("Edge",t),isChrome:_n("Chrome",t),isIE:_n("IE",t),isOpera:_n("Opera",t),isFirefox:_n("Firefox",t),isSafari:_n("Safari",t)}},On={unknown:function(){return Rn({current:void 0,version:Tn.unknown()})},nu:Rn,edge:i("Edge"),chrome:i("Chrome"),ie:i("IE"),opera:i("Opera"),firefox:i("Firefox"),safari:i("Safari")},An=function(e,t){return function(){return t===e}},Dn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:An("Windows",t),isiOS:An("iOS",t),isAndroid:An("Android",t),isOSX:An("OSX",t),isLinux:An("Linux",t),isSolaris:An("Solaris",t),isFreeBSD:An("FreeBSD",t)}},Pn={unknown:function(){return Dn({current:void 0,version:Tn.unknown()})},nu:Dn,windows:i("Windows"),ios:i("iOS"),android:i("Android"),linux:i("Linux"),osx:i("OSX"),solaris:i("Solaris"),freebsd:i("FreeBSD")},Bn=function(e,t){var n=String(t).toLowerCase();return $(e,(function(e){return e.search(n)}))},In=function(e,t){return Bn(e,t).map((function(e){var n=Tn.detect(e.versionRegexes,t);return{current:e.name,version:n}}))},Mn=function(e,t){return Bn(e,t).map((function(e){var n=Tn.detect(e.versionRegexes,t);return{current:e.name,version:n}}))},Ln=function(e,t){return-1!==e.indexOf(t)},Fn=function(e){return e.replace(/^\s+|\s+$/g,"")},Hn=function(e){return e.replace(/\s+$/g,"")},zn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Wn=function(e){return function(t){return Ln(t,e)}},jn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Ln(e,"edge/")&&Ln(e,"chrome")&&Ln(e,"safari")&&Ln(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,zn],search:function(e){return Ln(e,"chrome")&&!Ln(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Ln(e,"msie")||Ln(e,"trident")}},{name:"Opera",versionRegexes:[zn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Wn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Wn("firefox")},{name:"Safari",versionRegexes:[zn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Ln(e,"safari")||Ln(e,"mobile/"))&&Ln(e,"applewebkit")}}],Un=[{name:"Windows",search:Wn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Ln(e,"iphone")||Ln(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Wn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Wn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Wn("linux"),versionRegexes:[]},{name:"Solaris",search:Wn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Wn("freebsd"),versionRegexes:[]}],Vn={browsers:i(jn),oses:i(Un)},qn=function(e){var t=Vn.browsers(),n=Vn.oses(),r=In(t,e).fold(On.unknown,On.nu),o=Mn(n,e).fold(Pn.unknown,Pn.nu),a=function(e,t,n){var r=e.isiOS()&&!0===/ipad/i.test(n),o=e.isiOS()&&!r,a=e.isAndroid()&&3===e.version.major,u=e.isAndroid()&&4===e.version.major,s=r||a||u&&!0===/mobile/i.test(n),c=e.isiOS()||e.isAndroid(),l=c&&!s,f=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n);return{isiPad:i(r),isiPhone:i(o),isTablet:i(s),isPhone:i(l),isTouch:i(c),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:i(f)}}(o,r,e);return{browser:r,os:o,deviceType:a}},$n={detect:(Cn=function(){var e=n.navigator.userAgent;return qn(e)},En=!1,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return En||(En=!0,Sn=Cn.apply(null,e)),Sn})},Yn=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:i(e)}},Xn={fromHtml:function(e,t){var r=(t||n.document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||r.childNodes.length>1)throw n.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Yn(r.childNodes[0])},fromTag:function(e,t){var r=(t||n.document).createElement(e);return Yn(r)},fromText:function(e,t){var r=(t||n.document).createTextNode(e);return Yn(r)},fromDom:Yn,fromPoint:function(e,t,n){var r=e.dom();return N.from(r.elementFromPoint(t,n)).map(Yn)}},Kn=(n.Node.ATTRIBUTE_NODE,n.Node.CDATA_SECTION_NODE,n.Node.COMMENT_NODE,n.Node.DOCUMENT_NODE),Gn=(n.Node.DOCUMENT_TYPE_NODE,n.Node.DOCUMENT_FRAGMENT_NODE,n.Node.ELEMENT_NODE),Jn=n.Node.TEXT_NODE,Qn=(n.Node.PROCESSING_INSTRUCTION_NODE,n.Node.ENTITY_REFERENCE_NODE,n.Node.ENTITY_NODE,n.Node.NOTATION_NODE,function(e){return e.dom().nodeName.toLowerCase()}),Zn=function(e){return function(t){return function(e){return e.dom().nodeType}(t)===e}},er=Zn(Gn),tr=Zn(Jn),nr=Object.keys,rr=Object.hasOwnProperty,or=function(e,t){for(var n=nr(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}},ir=function(e,t){var n={};return or(e,(function(e,r){var o=t(e,r);n[o.k]=o.v})),n},ar=function(e,t){var n={},r={};return or(e,(function(e,o){(t(e,o)?n:r)[o]=e})),{t:n,f:r}},ur=function(e,t){return rr.call(e,t)},sr=function(e){return void 0!==e.style&&P(e.style.getPropertyValue)},cr=function(e,t,r){if(!(_(r)||D(r)||B(r)))throw n.console.error("Invalid call to Attr.set. Key ",t,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,r+"")},lr=function(e,t,n){cr(e.dom(),t,n)},fr=function(e,t){var n=e.dom();or(t,(function(e,t){cr(n,t,e)}))},dr=function(e,t){var n=e.dom().getAttribute(t);return null===n?void 0:n},mr=function(e,t){e.dom().removeAttribute(t)},hr=function(e,t){var r=e.dom();or(t,(function(e,t){!function(e,t,r){if(!_(r))throw n.console.error("Invalid call to CSS.set. Property ",t,":: Value ",r,":: Element ",e),new Error("CSS value must be a string: "+r);sr(e)&&e.style.setProperty(t,r)}(r,t,e)}))},gr=function(e,t){var r=e.dom(),o=n.window.getComputedStyle(r).getPropertyValue(t),i=""!==o||function(e){var t=tr(e)?e.dom().parentNode:e.dom();return null!=t&&t.ownerDocument.body.contains(t)}(e)?o:pr(r,t);return null===i?void 0:i},pr=function(e,t){return sr(e)?e.style.getPropertyValue(t):""},vr=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(e.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+t.length+" arguments");var r={};return j(e,(function(e,n){r[e]=i(t[n])})),r}},br=function(e,t){var n=[],r=function(e){return n.push(e),t(e)},o=t(e);do{o=o.bind(r)}while(o.isSome());return n},yr=function(){return ne("Node")},wr=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},xr=function(e,t){return wr(e,t,yr().DOCUMENT_POSITION_CONTAINED_BY)},Cr=Gn,Sr=Kn,Er=function(e,t){var n=e.dom();if(n.nodeType!==Cr)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},kr=function(e){return e.nodeType!==Cr&&e.nodeType!==Sr||0===e.childElementCount},Nr=function(e,t){return e.dom()===t.dom()},Tr=$n.detect().browser.isIE()?function(e,t){return xr(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},_r=function(e){return Xn.fromDom(e.dom().ownerDocument)},Rr=function(e){return Xn.fromDom(e.dom().ownerDocument.defaultView)},Or=function(e){return N.from(e.dom().parentNode).map(Xn.fromDom)},Ar=function(e){return N.from(e.dom().previousSibling).map(Xn.fromDom)},Dr=function(e){return N.from(e.dom().nextSibling).map(Xn.fromDom)},Pr=function(e){return function(e){var t=I.call(e,0);return t.reverse(),t}(br(e,Ar))},Br=function(e){return br(e,Dr)},Ir=function(e){return W(e.dom().childNodes,Xn.fromDom)},Mr=function(e,t){var n=e.dom().childNodes;return N.from(n[t]).map(Xn.fromDom)},Lr=function(e){return Mr(e,0)},Fr=function(e){return Mr(e,e.dom().childNodes.length-1)},Hr=(vr("element","offset"),$n.detect().browser),zr=function(e){return $(e,er)},Wr=function(e,t,n){var r,o,i=0,a=0,u=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===gr(Xn.fromDom(e),"position"))return{x:i=(o=t.getBoundingClientRect()).left+(u.documentElement.scrollLeft||e.scrollLeft)-u.documentElement.clientLeft,y:a=o.top+(u.documentElement.scrollTop||e.scrollTop)-u.documentElement.clientTop};for(r=t;r&&r!==n&&r.nodeType;)i+=r.offsetLeft||0,a+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType;)i-=r.scrollLeft||0,a-=r.scrollTop||0,r=r.parentNode;a+=function(e){return Hr.isFirefox()&&"table"===Qn(e)?zr(Ir(e)).filter((function(e){return"caption"===Qn(e)})).bind((function(e){return zr(Br(e)).map((function(t){var n=t.dom().offsetTop,r=e.dom().offsetTop,o=e.dom().offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(Xn.fromDom(t))}return{x:i,y:a}},jr={},Ur={exports:jr};!function(e,n,r,o){!function(o){"object"==typeof n&&void 0!==r?r.exports=o():"function"==typeof e&&e.amd?e([],o):("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).EphoxContactWrapper=o()}((function(){return function e(t,n,r){function o(a,u){if(!n[a]){if(!t[a]){var s=!1;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,(function(e){return o(t[a][1][e]||e)}),l,l.exports,e,t,n,r)}return n[a].exports}for(var i=!1,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){var r,o,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(e){o=u}}();var c,l=[],f=!1,d=-1;function m(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&h())}function h(){if(!f){var e=s(m);f=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,f=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new g(e,t)),1!==l.length||f||s(h)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(e,t,n){(function(e){!function(n){var r=setTimeout;function o(){}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function a(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,i._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void s(t.promise,e)}u(t.promise,r)}else(1===e._state?u:s)(t.promise,e._value)}))):e._deferreds.push(t)}function u(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof i)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void f((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,c(e)}catch(t){s(e,t)}var r,o}function s(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&i._immediateFn((function(){e._handled||i._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)a(e,e._deferreds[t]);e._deferreds=null}function l(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function f(e,t){var n=!1;try{e((function(e){n||(n=!0,u(t,e))}),(function(e){n||(n=!0,s(t,e))}))}catch(e){if(n)return;n=!0,s(t,e)}}i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(o);return a(this,new l(e,t,n)),n},i.all=function(e){var t=Array.prototype.slice.call(e);return new i((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(e){o(i,e)}),n)}t[i]=a,0==--r&&e(t)}catch(e){n(e)}}for(var i=0;i<t.length;i++)o(i,t[i])}))},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i((function(t){t(e)}))},i.reject=function(e){return new i((function(t,n){n(e)}))},i.race=function(e){return new i((function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)}))},i._immediateFn="function"==typeof e?function(t){e(t)}:function(e){r(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},void 0!==t&&t.exports?t.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,e("timers").setImmediate)},{timers:3}],3:[function(e,t,n){(function(t,r){var o=e("process/browser.js").nextTick,i=Function.prototype.apply,a=Array.prototype.slice,u={},s=0;function c(e,t){this._id=e,this._clearFn=t}n.setTimeout=function(){return new c(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new c(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n.setImmediate="function"==typeof t?t:function(e){var t=s++,r=!(arguments.length<2)&&a.call(arguments,1);return u[t]=!0,o((function(){u[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))})),t},n.clearImmediate="function"==typeof r?r:function(e){delete u[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(e,t,n){var r=e("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();t.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(void 0,jr,Ur);var Vr=Ur.exports.boltExport,qr=function(e){var t=N.none(),r=[],o=function(e){i()?u(e):r.push(e)},i=function(){return t.isSome()},a=function(e){j(e,u)},u=function(e){t.each((function(t){n.setTimeout((function(){e(t)}),0)}))};return e((function(e){t=N.some(e),a(r),r=[]})),{get:o,map:function(e){return qr((function(t){o((function(n){t(e(n))}))}))},isReady:i}},$r={nu:qr,pure:function(e){return qr((function(t){t(e)}))}},Yr=function(e){n.setTimeout((function(){throw e}),0)},Xr=function(e){var t=function(t){e().then(t,Yr)};return{map:function(t){return Xr((function(){return e().then(t)}))},bind:function(t){return Xr((function(){return e().then((function(e){return t(e).toPromise()}))}))},anonBind:function(t){return Xr((function(){return e().then((function(){return t.toPromise()}))}))},toLazy:function(){return $r.nu(t)},toCached:function(){var t=null;return Xr((function(){return null===t&&(t=e()),t}))},toPromise:e,get:t}},Kr=function(e){return Xr((function(){return new Vr(e)}))},Gr=function(e,t){return t((function(t){var n=[],r=0;0===e.length?t([]):j(e,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=e.length&&t(n)}}(i))}))}))},Jr=function(e){return{is:function(t){return e===t},isValue:C,isError:x,getOr:i(e),getOrThunk:i(e),getOrDie:i(e),or:function(t){return Jr(e)},orThunk:function(t){return Jr(e)},fold:function(t,n){return n(e)},map:function(t){return Jr(t(e))},mapError:function(t){return Jr(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOption:function(){return N.some(e)}}},Qr=function(e){return{is:x,isValue:x,isError:C,getOr:a,getOrThunk:function(e){return e()},getOrDie:function(){return(t=String(e),function(){throw new Error(t)})();var t},or:function(e){return e},orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return Qr(e)},mapError:function(t){return Qr(t(e))},each:r,bind:function(t){return Qr(e)},exists:x,forall:C,toOption:N.none}},Zr={value:Jr,error:Qr,fromOption:function(e,t){return e.fold((function(){return Qr(t)}),Jr)}};function eo(e,t){void 0===t&&(t={});var r,u=0,s={};r=t.maxLoadTime||5e3;var c=function(t){e.getElementsByTagName("head")[0].appendChild(t)},l=function(o,i,a){var l,f,d,m,h=function(){for(var e=m.passed,t=e.length;t--;)e[t]();m.status=2,m.passed=[],m.failed=[]},g=function(){for(var e=m.failed,t=e.length;t--;)e[t]();m.status=3,m.passed=[],m.failed=[]},p=function(e,t){e()||((new Date).getTime()-d<r?ge.setTimeout(t):g())},v=function(){p((function(){for(var t,n,r=e.styleSheets,o=r.length;o--;)if((n=(t=r[o]).ownerNode?t.ownerNode:t.owningElement)&&n.id===l.id)return h(),!0}),v)},b=function(){p((function(){try{var e=f.sheet.cssRules;return h(),!!e}catch(e){}}),b)};if(o=$t._addCacheSuffix(o),s[o]?m=s[o]:(m={passed:[],failed:[]},s[o]=m),i&&m.passed.push(i),a&&m.failed.push(a),1!==m.status)if(2!==m.status)if(3!==m.status){if(m.status=1,(l=e.createElement("link")).rel="stylesheet",l.type="text/css",l.id="u"+u++,l.async=!1,l.defer=!1,d=(new Date).getTime(),t.contentCssCors&&(l.crossOrigin="anonymous"),"onload"in l&&!((y=n.navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(y[1],10)<536))l.onload=v,l.onerror=g;else{if(n.navigator.userAgent.indexOf("Firefox")>0)return(f=e.createElement("style")).textContent='@import "'+o+'"',b(),void c(f);v()}var y;c(l),l.href=o}else g();else h()},f=function(e){return Kr((function(t){l(e,o(t,i(Zr.value(e))),o(t,i(Zr.error(e))))}))},d=function(e){return e.fold(a,a)};return{load:l,loadAll:function(e,t,n){var r;(r=W(e,f),Gr(r,Kr)).get((function(e){var r=U(e,(function(e){return e.isValue()}));r.fail.length>0?n(r.fail.map(d)):t(r.pass.map(d))}))}}}function to(e,t){var n=e,r=function(e,n,r,o){var i,a;if(e){if(!o&&e[n])return e[n];if(e!==t){if(i=e[r])return i;for(a=e.parentNode;a&&a!==t;a=a.parentNode)if(i=a[r])return i}}};this.current=function(){return n},this.next=function(e){return n=r(n,"firstChild","nextSibling",e)},this.prev=function(e){return n=r(n,"lastChild","previousSibling",e)},this.prev2=function(e){return n=function(e,n,r,o){var i,a,u;if(e){if(i=e[r],t&&i===t)return;if(i){if(!o)for(u=i[n];u;u=u[n])if(!u[n])return u;return i}if((a=e.parentNode)&&a!==t)return a}}(n,"lastChild","previousSibling",e)}}var no,ro,oo,io=function(e){var t;return function(n){return(t=t||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(e,i(!0))).hasOwnProperty(Qn(n))}},ao=io(["h1","h2","h3","h4","h5","h6"]),uo=io(["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"]),so=function(e){return er(e)&&!uo(e)},co=function(e){return er(e)&&"br"===Qn(e)},lo=io(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),fo=io(["ul","ol","dl"]),mo=io(["li","dd","dt"]),ho=io(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),go=io(["thead","tbody","tfoot"]),po=io(["td","th"]),vo=io(["pre","script","textarea","style"]),bo=function(e){return function(t){return!!t&&t.nodeType===e}},yo=bo(1),wo=function(e){var t=e.toLowerCase().split(" ");return function(e){var n,r;if(e&&e.nodeType)for(r=e.nodeName.toLowerCase(),n=0;n<t.length;n++)if(r===t[n])return!0;return!1}},xo=function(e){return function(t){if(yo(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}},Co=bo(3),So=bo(8),Eo=bo(9),ko=bo(11),No=wo("br"),To=xo("true"),_o=xo("false"),Ro={isText:Co,isElement:yo,isComment:So,isDocument:Eo,isDocumentFragment:ko,isBr:No,isContentEditableTrue:To,isContentEditableFalse:_o,isRestrictedNode:function(e){return!!e&&!Object.getPrototypeOf(e)},matchNodeNames:wo,hasPropValue:function(e,t){return function(n){return yo(n)&&n[e]===t}},hasAttribute:function(e,t){return function(t){return yo(t)&&t.hasAttribute(e)}},hasAttributeValue:function(e,t){return function(n){return yo(n)&&n.getAttribute(e)===t}},matchStyleValues:function(e,t){var n=t.toLowerCase().split(" ");return function(t){var r;if(yo(t))for(r=0;r<n.length;r++){var o=t.ownerDocument.defaultView.getComputedStyle(t,null);if((o?o.getPropertyValue(e):null)===n[r])return!0}return!1}},isBogus:function(e){return yo(e)&&e.hasAttribute("data-mce-bogus")},isBogusAll:function(e){return yo(e)&&"all"===e.getAttribute("data-mce-bogus")},isTable:function(e){return yo(e)&&"TABLE"===e.tagName}},Oo=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Ao=function(e,t){var n,r=t.childNodes;if(!Ro.isElement(t)||!Oo(t)){for(n=r.length-1;n>=0;n--)Ao(e,r[n]);if(!1===Ro.isDocument(t)){if(Ro.isText(t)&&t.nodeValue.length>0){var o=$t.trim(t.nodeValue).length;if(e.isBlock(t.parentNode)||o>0)return;if(0===o&&function(e){var t=e.previousSibling&&"SPAN"===e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"===e.nextSibling.nodeName;return t&&n}(t))return}else if(Ro.isElement(t)&&(1===(r=t.childNodes).length&&Oo(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||ho(Xn.fromDom(t))))return;e.remove(t)}return t}},Do={trimNode:Ao},Po=$t.makeMap,Bo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Io=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Mo=/[<>&\"\']/g,Lo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Fo={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:"Ÿ"};ro={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},oo={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};var Ho=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),ro[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};no=Ho("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var zo=function(e,t){return e.replace(t?Bo:Io,(function(e){return ro[e]||e}))},Wo=function(e,t){return e.replace(t?Bo:Io,(function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":ro[e]||"&#"+e.charCodeAt(0)+";"}))},jo=function(e,t,n){return n=n||no,e.replace(t?Bo:Io,(function(e){return ro[e]||n[e]||e}))},Uo={encodeRaw:zo,encodeAllRaw:function(e){return(""+e).replace(Mo,(function(e){return ro[e]||e}))},encodeNumeric:Wo,encodeNamed:jo,getEncodeFunc:function(e,t){var n=Ho(t)||no,r=Po(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?Bo:Io,(function(e){return void 0!==ro[e]?ro[e]:void 0!==n[e]?n[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"}))}:r.named?t?function(e,t){return jo(e,t,n)}:jo:r.numeric?Wo:zo},decode:function(e){return e.replace(Lo,(function(e,t){return t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):Fo[t]||String.fromCharCode(t):oo[e]||no[e]||function(e){var t;return(t=Xn.fromTag("div").dom()).innerHTML=e,t.textContent||t.innerText||e}(e)}))}},Vo={},qo={},$o=$t.makeMap,Yo=$t.each,Xo=$t.extend,Ko=$t.explode,Go=$t.inArray,Jo=function(e,t){return(e=$t.trim(e))?e.split(t||" "):[]},Qo=function(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),Yo(e,(function(e,r){n[r]=n[r.toUpperCase()]="map"===t?$o(e,/[, ]/):Ko(e,/[, ]/)}))),n};function Zo(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,h={},g={},p=[],v={},b={},y=function(t,n,r){var o=e[t];return o?o=$o(o,/[, ]/,$o(o.toUpperCase(),/[, ]/)):(o=Vo[t])||(o=$o(n," ",$o(n.toUpperCase()," ")),o=Xo(o,r),Vo[t]=o),o};r=function(e){var t,n,r,o,i,a,u={},s=function(e,n,r){var o,i,a,s=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};for(n=n||"","string"==typeof(r=r||[])&&(r=Jo(r)),o=(e=Jo(e)).length;o--;)a={attributes:s(i=Jo([t,n].join(" "))),attributesOrder:i,children:s(r,qo)},u[e[o]]=a},c=function(e,t){var n,r,o,i;for(n=(e=Jo(e)).length,t=Jo(t);n--;)for(r=u[e[n]],o=0,i=t.length;o<i;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o])};return Vo[e]?Vo[e]:(t="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"!==e&&(t+=" 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"!==e&&(t+=" xml:lang",r=[r,a="acronym applet basefont big font strike tt"].join(" "),Yo(Jo(a),(function(e){s(e,"",r)})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),Yo(Jo(i),(function(e){s(e,"",o)}))),o=o||[n,r].join(" "),s("html","manifest","head body"),s("head","","base command link meta noscript script style title"),s("title hr noscript br"),s("base","href target"),s("link","href rel media hreflang type sizes hreflang"),s("meta","name http-equiv content charset"),s("style","media type scoped"),s("script","src async defer type charset"),s("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),s("address dt dd div caption","",o),s("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),s("blockquote","cite",o),s("ol","reversed start type","li"),s("ul","","li"),s("li","value",o),s("dl","","dt dd"),s("a","href target rel media hreflang type",r),s("q","cite",r),s("ins del","cite datetime",o),s("img","src sizes srcset alt usemap ismap width height"),s("iframe","src name width height",o),s("embed","src type width height"),s("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),s("param","name value"),s("map","name",[o,"area"].join(" ")),s("area","alt coords shape href target rel media hreflang type"),s("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),s("colgroup","span","col"),s("col","span"),s("tbody thead tfoot","","tr"),s("tr","","td th"),s("td","colspan rowspan headers",o),s("th","colspan rowspan headers scope abbr",o),s("form","accept-charset action autocomplete enctype method name novalidate target",o),s("fieldset","disabled form name",[o,"legend"].join(" ")),s("label","form for",r),s("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"),s("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?o:r),s("select","disabled form multiple name required size","option optgroup"),s("optgroup","disabled label","option"),s("option","disabled label selected value"),s("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),s("menu","type label",[o,"li"].join(" ")),s("noscript","",o),"html4"!==e&&(s("wbr"),s("ruby","",[r,"rt rp"].join(" ")),s("figcaption","",o),s("mark rt rp summary bdi","",r),s("canvas","width height",o),s("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),s("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),s("picture","","img source"),s("source","src srcset type media sizes"),s("track","kind src srclang label default"),s("datalist","",[r,"option"].join(" ")),s("article section nav aside main header footer","",o),s("hgroup","","h1 h2 h3 h4 h5 h6"),s("figure","",[o,"figcaption"].join(" ")),s("time","datetime",r),s("dialog","open",o),s("command","type label icon disabled checked radiogroup command"),s("output","for form name",r),s("progress","value max",r),s("meter","value min max low high optimum",r),s("details","open",[o,"summary"].join(" ")),s("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(c("script","language xml:space"),c("style","xml:space"),c("object","declare classid code codebase codetype archive standby align border hspace vspace"),c("embed","align name hspace vspace"),c("param","valuetype type"),c("a","charset name rev shape coords"),c("br","clear"),c("applet","codebase archive code object alt name width height align hspace vspace"),c("img","name longdesc align border hspace vspace"),c("iframe","longdesc frameborder marginwidth marginheight scrolling align"),c("font basefont","size color face"),c("input","usemap align"),c("select","onchange"),c("textarea"),c("h1 h2 h3 h4 h5 h6 div p legend caption","align"),c("ul","type compact"),c("li","type"),c("ol dl menu dir","compact"),c("pre","width xml:space"),c("hr","align noshade size width"),c("isindex","prompt"),c("table","summary width frame rules cellspacing cellpadding align bgcolor"),c("col","width align char charoff valign"),c("colgroup","width align char charoff valign"),c("thead","align char charoff valign"),c("tr","align char charoff valign bgcolor"),c("th","axis align char charoff valign nowrap bgcolor width height"),c("form","accept"),c("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),c("tfoot","align char charoff valign"),c("tbody","align char charoff valign"),c("area","nohref"),c("body","background bgcolor text link vlink alink")),"html4"!==e&&(c("input button select textarea","autofocus"),c("input textarea","placeholder"),c("a","download"),c("link script img","crossorigin"),c("iframe","sandbox seamless allowfullscreen")),Yo(Jo("a form meter progress dfn"),(function(e){u[e]&&delete u[e].children[e]})),delete u.caption.children.table,delete u.script,Vo[e]=u,u)}((e=e||{}).schema),!1===e.verify_html&&(e.valid_elements="*[*]"),t=Qo(e.valid_styles),n=Qo(e.invalid_styles,"map"),s=Qo(e.valid_classes,"map"),o=y("whitespace_elements","pre script noscript style textarea video audio iframe object code"),i=y("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=y("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),u=y("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),l=y("non_empty_elements","td th iframe video audio object script pre code",a),f=y("move_caret_before_on_enter_elements","table",l),d=y("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),c=y("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",d),m=y("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),Yo((e.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(e){b[e]=new RegExp("</"+e+"[^>]*>","gi")}));var w=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},x=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,v,b,y,x,C,S=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,E=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(e)for(e=Jo(e,","),h["@"]&&(b=h["@"].attributes,y=h["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=S.exec(e[t])){if(g=i[1],c=i[2],v=i[3],s=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===g&&(a.paddEmpty=!0),"-"===g&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),b){for(x in b)d[x]=b[x];m.push.apply(m,y)}if(s)for(r=0,o=(s=Jo(s,"|")).length;r<o;r++)if(i=E.exec(s[r])){if(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),g=i[3],C=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"===f){delete d[l],m.splice(Go(m,l),1);continue}g&&("="===g&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:C}),u.defaultValue=C),":"===g&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:C}),u.forcedValue=C),"<"===g&&(u.validValues=$o(C,"?"))),k.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=w(l),a.attributePatterns.push(u)):(d[l]||m.push(l),d[l]=u)}b||"@"!==c||(b=d,y=m),v&&(a.outputName=c,h[v]=a),k.test(c)?(a.pattern=w(c),p.push(a)):h[c]=a}},C=function(e){h={},p=[],x(e),Yo(r,(function(e,t){g[t]=e.children}))},S=function(e){var t=/^(~)?(.+)$/;e&&(Vo.text_block_elements=Vo.block_elements=null,Yo(Jo(e,","),(function(e){var n=t.exec(e),r="~"===n[1],o=r?"span":"div",i=n[2];if(g[i]=g[o],v[i]=o,r||(c[i.toUpperCase()]={},c[i]={}),!h[i]){var a=h[o];delete(a=Xo({},a)).removeEmptyAttrs,delete a.removeEmpty,h[i]=a}Yo(g,(function(e,t){e[o]&&(g[t]=e=Xo({},g[t]),e[i]=e[o])}))})))},E=function(t){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;Vo[e.schema]=null,t&&Yo(Jo(t,","),(function(e){var t,r,o=n.exec(e);o&&(r=o[1],t=r?g[o[2]]:g[o[2]]={"#comment":{}},t=g[o[2]],Yo(Jo(o[3],"|"),(function(e){"-"===r?delete t[e]:t[e]={}})))}))},k=function(e){var t,n=h[e];if(n)return n;for(t=p.length;t--;)if((n=p[t]).pattern.test(e))return n};return e.valid_elements?C(e.valid_elements):(Yo(r,(function(e,t){h[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},g[t]=e.children})),"html5"!==e.schema&&Yo(Jo("strong/b em/i"),(function(e){e=Jo(e,"/"),h[e[1]].outputName=e[0]})),Yo(Jo("ol ul sub sup blockquote span font a table tbody tr strong em b i"),(function(e){h[e]&&(h[e].removeEmpty=!0)})),Yo(Jo("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(e){h[e].paddEmpty=!0})),Yo(Jo("span"),(function(e){h[e].removeEmptyAttrs=!0}))),S(e.custom_elements),E(e.valid_children),x(e.extended_valid_elements),E("+ol[ul|ol],+ul[ul|ol]"),Yo({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(function(e,t){h[t]&&(h[t].parentsRequired=Jo(e))})),e.invalid_elements&&Yo(Ko(e.invalid_elements),(function(e){h[e]&&delete h[e]})),k("span")||x("span[!data-mce-type|*]"),{children:g,elements:h,getValidStyles:function(){return t},getValidClasses:function(){return s},getBlockElements:function(){return c},getInvalidStyles:function(){return n},getShortEndedElements:function(){return a},getTextBlockElements:function(){return d},getTextInlineElements:function(){return m},getBoolAttrs:function(){return u},getElementRule:k,getSelfClosingElements:function(){return i},getNonEmptyElements:function(){return l},getMoveCaretBeforeOnEnterElements:function(){return f},getWhiteSpaceElements:function(){return o},getSpecialElements:function(){return b},isValidChild:function(e,t){var n=g[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t){var n,r,o=k(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:function(){return v},addValidElements:x,setValidElements:C,addCustomElements:S,addValidChildren:E}}var ei=function(e,t,n,r){var o=function(e){return(e=parseInt(e,10).toString(16)).length>1?e:"0"+e};return"#"+o(t)+o(n)+o(r)};function ti(e,t){var n,r,o,i,a=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,u=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,s=/\s*([^:]+):\s*([^;]+);?/g,c=/\s+$/,l={};for(e=e||{},t&&(o=t.getValidStyles(),i=t.getInvalidStyles()),r="\\\" \\' \\; \\: ; : \ufeff".split(" "),n=0;n<r.length;n++)l[r[n]]="\ufeff"+n,l["\ufeff"+n]=r[n];return{toHex:function(e){return e.replace(a,ei)},parse:function(t){var r,o,i,f,d,m,h,g,p={},v=e.url_converter,b=e.url_converter_scope||this,y=function(e,t,r){var o,i,a,u;if((o=p[e+"-top"+t])&&(i=p[e+"-right"+t])&&(a=p[e+"-bottom"+t])&&(u=p[e+"-left"+t])){var s=[o,i,a,u];for(n=s.length-1;n--&&s[n]===s[n+1];);n>-1&&r||(p[e+t]=-1===n?s[0]:s.join(" "),delete p[e+"-top"+t],delete p[e+"-right"+t],delete p[e+"-bottom"+t],delete p[e+"-left"+t])}},w=function(e){var t,n=p[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return p[e]=n[0],!0}},x=function(e){return f=!0,l[e]},C=function(e,t){return f&&(e=e.replace(/\uFEFF[0-9]/g,(function(e){return l[e]}))),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},S=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},E=function(e){return e.replace(/\\[0-9a-f]+/gi,S)},k=function(t,n,r,o,i,a){if(i=i||a)return"'"+(i=C(i)).replace(/\'/g,"\\'")+"'";if(n=C(n||r||o),!e.allow_script_urls){var u=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(u))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(u))return""}return v&&(n=v.call(b,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(t){for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,x).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(e){return e.replace(/[;:]/g,x)}));r=s.exec(t);)if(s.lastIndex=r.index+r[0].length,o=r[1].replace(c,"").toLowerCase(),i=r[2].replace(c,""),o&&i){if(o=E(o),i=E(i),-1!==o.indexOf("\ufeff")||-1!==o.indexOf('"'))continue;if(!e.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(i)))continue;"font-weight"===o&&"700"===i?i="bold":"color"!==o&&"background-color"!==o||(i=i.toLowerCase()),i=(i=i.replace(a,ei)).replace(u,k),p[o]=f?C(i,!0):i}y("border","",!0),y("border","-width"),y("border","-color"),y("border","-style"),y("padding",""),y("margin",""),d="border",h="border-style",g="border-color",w(m="border-width")&&w(h)&&w(g)&&(p[d]=p[m]+" "+p[h]+" "+p[g],delete p[m],delete p[h],delete p[g]),"medium none"===p.border&&delete p.border,"none"===p["border-image"]&&delete p["border-image"]}return p},serialize:function(e,t){var n,r,a="",u=function(t){var n,r,i,u;if(n=o[t])for(r=0,i=n.length;r<i;r++)t=n[r],(u=e[t])&&(a+=(a.length>0?" ":"")+t+": "+u+";")},s=function(e,t){var n;return!((n=i["*"])&&n[e]||(n=i[t])&&n[e])};if(t&&o)u("*"),u(t);else for(n in e)!(r=e[n])||i&&!s(n,t)||(a+=(a.length>0?" ":"")+n+": "+r+";");return a}}}var ni=$t.each,ri=$t.grep,oi=le.ie,ii=/^([a-z0-9],?)+$/i,ai=/^[ \t\r\n]*$/,ui=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r)},si=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o};function ci(e,t){var r,o=this;void 0===t&&(t={});var i={},a=n.window,u={},s=0,c=eo(e,{contentCssCors:t.contentCssCors}),l=[],f=t.schema?t.schema:Zo({}),d=ti({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),m=t.ownEvents?new Ee(t.proxy):Ee.Event,h=f.getBlockElements(),g=dn.overrideDefaults((function(){return{context:e,element:W.getRoot()}})),p=function(t){if(t&&e&&"string"==typeof t){var n=e.getElementById(t);return n&&n.id!==t?e.getElementsByName(t)[1]:n}return t},v=function(e){return"string"==typeof e&&(e=p(e)),g(e)},b=function(e,t,n){var o,i,a=v(e);return a.length&&(i=(o=r[t])&&o.get?o.get(a,t):a.attr(t)),void 0===i&&(i=n||""),i},y=function(e){var t=p(e);return t?t.attributes:[]},w=function(e,n,o){var i,a;""===o&&(o=null);var u=v(e);i=u.attr(n),u.length&&((a=r[n])&&a.set?a.set(u,o,n):u.attr(n,o),i!==o&&t.onSetAttrib&&t.onSetAttrib({attrElm:u,attrName:n,attrValue:o}))},x=function(){return t.root_element||e.body},C=function(t,n){return Wr(e.body,p(t),n)},S=function(e,t,n){var r=v(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,(function(e,t){return t.toUpperCase()})))&&(t=le.ie&&le.ie<12?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:void 0)},E=function(e){var t,n;return e=p(e),t=S(e,"width"),n=S(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},k=function(e,t){var n;if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(ii.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return St(t,i[0].ownerDocument||i[0],null,i).length>0},N=function(e,t,n,r){var o,i=[],a=p(e);for(r=void 0===r,n=n||("BODY"!==x().nodeName?x().parentNode:null),$t.is(t,"string")&&(o=t,t="*"===t?function(e){return 1===e.nodeType}:function(e){return k(e,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},T=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return k(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},_=function(e,t,n){var r,i="string"==typeof e?p(e):e;if(!i)return!1;if($t.isArray(i)&&(i.length||0===i.length))return r=[],ni(i,(function(e,o){e&&("string"==typeof e&&(e=p(e)),r.push(t.call(n,e,o)))})),r;var a=n||o;return t.call(a,i)},R=function(e,t){v(e).each((function(e,n){ni(t,(function(e,t){w(n,t,e)}))}))},O=function(e,t){var n=v(e);oi?n.each((function(e,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+t,n.removeChild(n.firstChild)}catch(e){dn("<div></div>").html("<br>"+t).contents().slice(1).appendTo(n)}return t}})):n.html(t)},A=function(t,n,r,o,i){return _(t,(function(t){var a="string"==typeof n?e.createElement(n):n;return R(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&O(a,o)),i?a:t.appendChild(a)}))},D=function(t,n,r){return A(e.createElement(t),t,n,r,!0)},P=Uo.encodeAllRaw,B=function(e,t){var n=v(e);return t?n.each((function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},I=function(e,t,n){v(e).toggleClass(t,n).each((function(){""===this.className&&dn(this).attr("class",null)}))},M=function(e,t,n){return _(t,(function(t){return $t.is(t,"array")&&(e=e.cloneNode(!0)),n&&ni(ri(t.childNodes),(function(t){e.appendChild(t)})),t.parentNode.replaceChild(e,t)}))},L=function(){return e.createRange()},F=function(n,r,o,i){if($t.isArray(n)){for(var u=n.length;u--;)n[u]=F(n[u],r,o,i);return n}return!t.collect||n!==e&&n!==a||l.push([n,r,o,i]),m.bind(n,r,o,i||W)},H=function(t,n,r){var o;if($t.isArray(t)){for(o=t.length;o--;)t[o]=H(t[o],n,r);return t}if(l&&(t===e||t===a))for(o=l.length;o--;){var i=l[o];t!==i[0]||n&&n!==i[1]||r&&r!==i[2]||m.unbind(i[0],i[1],i[2])}return m.unbind(t,n,r)},z=function(e){if(e&&Ro.isElement(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},W={doc:e,settings:t,win:a,files:u,stdMode:!0,boxModel:!0,styleSheetLoader:c,boundEvents:l,styles:d,schema:f,events:m,isBlock:function(e){if("string"==typeof e)return!!h[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!h[e.nodeName])}return!1},$:g,$$:v,root:null,clone:function(t,n){if(!oi||1!==t.nodeType||n)return t.cloneNode(n);if(!n){var r=e.createElement(t.nodeName);return ni(y(t),(function(e){w(r,e.nodeName,b(t,e.nodeName))})),r}return null},getRoot:x,getViewPort:function(e){var t=e||a,n=t.document.documentElement;return{x:t.pageXOffset||n.scrollLeft,y:t.pageYOffset||n.scrollTop,w:t.innerWidth||n.clientWidth,h:t.innerHeight||n.clientHeight}},getRect:function(e){var t,n;return e=p(e),t=C(e),n=E(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:E,getParent:function(e,t,n){var r=N(e,t,n,!1);return r&&r.length>0?r[0]:null},getParents:N,get:p,getNext:function(e,t){return T(e,t,"nextSibling")},getPrev:function(e,t){return T(e,t,"previousSibling")},select:function(n,r){return St(n,p(r)||t.root_element||e,[])},is:k,add:A,create:D,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)t.hasOwnProperty(r)&&null!==t[r]&&void 0!==t[r]&&(o+=" "+r+'="'+P(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(t){var n,r=e.createElement("div"),o=e.createDocumentFragment();for(o.appendChild(r),t&&(r.innerHTML=t);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:B,setStyle:function(e,n,r){var o=v(e).css(n,r);t.update_styles&&ui(d,o)},getStyle:S,setStyles:function(e,n){var r=v(e).css(n);t.update_styles&&ui(d,r)},removeAllAttribs:function(e){return _(e,(function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))}))},setAttrib:w,setAttribs:R,getAttrib:b,getPos:C,parseStyle:function(e){return d.parse(e)},serializeStyle:function(e,t){return d.serialize(e,t)},addStyle:function(t){var r,o;if(W!==ci.DOM&&e===n.document){if(i[t])return;i[t]=!0}(o=e.getElementById("mceDefaultStyles"))||((o=e.createElement("style")).id="mceDefaultStyles",o.type="text/css",(r=e.getElementsByTagName("head")[0]).firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=t:o.appendChild(e.createTextNode(t))},loadCSS:function(t){var r;W===ci.DOM||e!==n.document?(t||(t=""),r=e.getElementsByTagName("head")[0],ni(t.split(","),(function(e){var t;e=$t._addCacheSuffix(e),u[e]||(u[e]=!0,t=D("link",{rel:"stylesheet",href:e}),r.appendChild(t))}))):ci.DOM.loadCSS(t)},addClass:function(e,t){v(e).addClass(t)},removeClass:function(e,t){I(e,t,!1)},hasClass:function(e,t){return v(e).hasClass(t)},toggleClass:I,show:function(e){v(e).show()},hide:function(e){v(e).hide()},isHidden:function(e){return"none"===v(e).css("display")},uniqueId:function(e){return(e||"mce_")+s++},setHTML:O,getOuterHTML:function(e){var t="string"==typeof e?p(e):e;return Ro.isElement(t)?t.outerHTML:dn("<div></div>").append(dn(t).clone()).html()},setOuterHTML:function(e,t){v(e).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}B(dn(this).html(t),!0)}))},decode:Uo.decode,encode:P,insertAfter:function(e,t){var n=p(t);return _(e,(function(e){var t,r;return t=n.parentNode,(r=n.nextSibling)?t.insertBefore(e,r):t.appendChild(e),e}))},replace:M,rename:function(e,t){var n;return e.nodeName!==t.toUpperCase()&&(n=D(t),ni(y(e),(function(t){w(n,t.nodeName,b(e,t.nodeName))})),M(n,e,!0)),n||e},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return d.toHex($t.trim(e))},run:_,getAttribs:y,isEmpty:function(e,t){var n,r,o,i,a,u,s=0;if(e=e.firstChild){a=new to(e,e.parentNode),t=t||(f?f.getNonEmptyElements():null),i=f?f.getWhiteSpaceElements():{};do{if(o=e.nodeType,Ro.isElement(e)){var c=e.getAttribute("data-mce-bogus");if(c){e=a.next("all"===c);continue}if(u=e.nodeName.toLowerCase(),t&&t[u]){if("br"===u){s++,e=a.next();continue}return!1}for(n=(r=y(e)).length;n--;)if("name"===(u=r[n].nodeName)||"data-mce-bookmark"===u)return!1}if(8===o)return!1;if(3===o&&!ai.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&ai.test(e.nodeValue))return!1;e=a.next()}while(e)}return s<=1},createRng:L,nodeIndex:si,split:function(e,t,n){var r,o,i,a=L();if(e&&t)return a.setStart(e.parentNode,si(e)),a.setEnd(t.parentNode,si(t)),r=a.extractContents(),(a=L()).setStart(t.parentNode,si(t)+1),a.setEnd(e.parentNode,si(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(Do.trimNode(W,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(Do.trimNode(W,o),e),B(e),n||t},bind:F,unbind:H,fire:function(e,t,n){return m.fire(e,t,n)},getContentEditable:z,getContentEditableParent:function(e){for(var t=x(),n=null;e&&e!==t&&null===(n=z(e));e=e.parentNode);return n},destroy:function(){if(l)for(var e=l.length;e--;){var t=l[e];m.unbind(t[0],t[1],t[2])}St.setDocument&&St.setDocument()},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}};return r=function(e,t,n){var r={},o=t.keep_values,i={set:function(e,r,o){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||n(),r,o,e[0])),e.attr("data-mce-"+o,r).attr(o,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}};return r={style:{set:function(e,t){null===t||"object"!=typeof t?(o&&e.attr("data-mce-style",t),e.attr("style",t)):e.css(t)},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serialize(e.parse(n),t[0].nodeName)}}},o&&(r.href=r.src=i),r}(d,t,(function(){return W})),W}!function(e){e.DOM=e(n.document),e.nodeIndex=si}(ci||(ci={}));var li=ci,fi=li.DOM,di=$t.each,mi=$t.grep,hi=function(e){return"function"==typeof e},gi=function(){var e={},t=[],r={},o=[],i=0;this.isDone=function(t){return 2===e[t]},this.markDone=function(t){e[t]=2},this.add=this.load=function(n,o,i,a){void 0===e[n]&&(t.push(n),e[n]=0),o&&(r[n]||(r[n]=[]),r[n].push({success:o,failure:a,scope:i||this}))},this.remove=function(t){delete e[t],delete r[t]},this.loadQueue=function(e,n,r){this.loadScripts(t,e,n,r)},this.loadScripts=function(t,a,u,s){var c,l=[],f=function(e,t){di(r[t],(function(t){hi(t[e])&&t[e].call(t.scope)})),r[t]=void 0};o.push({success:a,failure:s,scope:u||this}),(c=function(){var r=mi(t);if(t.length=0,di(r,(function(t){2!==e[t]?3!==e[t]?1!==e[t]&&(e[t]=1,i++,function(e,t,r){var o,i,a=fi;i=a.uniqueId(),(o=n.document.createElement("script")).id=i,o.type="text/javascript",o.src=$t._addCacheSuffix(e),o.onload=function(){a.remove(i),o&&(o.onreadystatechange=o.onload=o=null),t()},o.onerror=function(){hi(r)?r():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+e)},(n.document.getElementsByTagName("head")[0]||n.document.body).appendChild(o)}(t,(function(){e[t]=2,i--,f("success",t),c()}),(function(){e[t]=3,i--,l.push(t),f("failure",t),c()}))):f("failure",t):f("success",t)})),!i){var a=o.slice(0);o.length=0,di(a,(function(e){0===l.length?hi(e.success)&&e.success.call(e.scope):hi(e.failure)&&e.failure.call(e.scope,l)}))}})()}};gi.ScriptLoader=new gi;var pi=$t.each;function vi(){var e=this,t=[],n={},r={},o=[],i=function(e){var t;return r[e]&&(t=r[e].dependencies),t||[]},a=function(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},u=function(e,t,n,r){var o=i(e);pi(o,(function(e){var n=a(t,e);s(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(gi))},s=function(e,t,o,i,a){if(!n[e]){var s="string"==typeof t?t:t.prefix+t.resource+t.suffix;0!==s.indexOf("/")&&-1===s.indexOf("://")&&(s=vi.baseURL+"/"+s),n[e]=s.substring(0,s.lastIndexOf("/")),r[e]?u(e,t,o,i):gi.ScriptLoader.add(s,(function(){return u(e,t,o,i)}),i,a)}};return{items:t,urls:n,lookup:r,_listeners:o,get:function(e){if(r[e])return r[e].instance},dependencies:i,requireLangPack:function(e,t){var r=vi.language;if(r&&!1!==vi.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+r.substr(0,2)+","))r=r.substr(0,2);else if(-1===t.indexOf(","+r+","))return;gi.ScriptLoader.add(n[e]+"/langs/"+r+".js")}},add:function(e,n,i){t.push(n),r[e]={instance:n,dependencies:i};var a=U(o,(function(t){return t.name===e}));return o=a.fail,pi(a.pass,(function(e){e.callback()})),n},remove:function(e){delete n[e],delete r[e]},createUrl:a,addComponents:function(t,n){var r=e.urls[t];pi(n,(function(e){gi.ScriptLoader.add(r+"/"+e)}))},load:s,waitFor:function(e,t){r.hasOwnProperty(e)?t():o.push({name:e,callback:t})}}}!function(e){e.PluginManager=e(),e.ThemeManager=e()}(vi||(vi={}));var bi=function(e,t){Or(e).each((function(n){n.dom().insertBefore(t.dom(),e.dom())}))},yi=function(e,t){Dr(e).fold((function(){Or(e).each((function(e){xi(e,t)}))}),(function(e){bi(e,t)}))},wi=function(e,t){Lr(e).fold((function(){xi(e,t)}),(function(n){e.dom().insertBefore(t.dom(),n.dom())}))},xi=function(e,t){e.dom().appendChild(t.dom())},Ci=function(e,t){j(t,(function(t){xi(e,t)}))},Si=function(e){e.dom().textContent="",j(Ir(e),(function(e){Ei(e)}))},Ei=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},ki=function(e){var t,n=Ir(e);n.length>0&&(t=e,j(n,(function(e){bi(t,e)}))),Ei(e)},Ni=function(e,t){var r=null;return{cancel:function(){null!==r&&(n.clearTimeout(r),r=null)},throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null===r&&(r=n.setTimeout((function(){e.apply(null,o),r=null}),t))}}},Ti=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Ti(n())}}},_i=function(e,t){var n=dr(e,t);return void 0===n||""===n?[]:n.split(" ")},Ri=function(e){return void 0!==e.dom().classList},Oi=function(e,t){return function(e,t,n){var r=_i(e,t).concat([n]);return lr(e,t,r.join(" ")),!0}(e,"class",t)},Ai=function(e,t){return function(e,t,n){var r=V(_i(e,t),(function(e){return e!==n}));return r.length>0?lr(e,t,r.join(" ")):mr(e,t),!1}(e,"class",t)},Di=function(e,t){Ri(e)?e.dom().classList.add(t):Oi(e,t)},Pi=function(e){0===(Ri(e)?e.dom().classList:function(e){return _i(e,"class")}(e)).length&&mr(e,"class")},Bi=function(e,t){return Ri(e)&&e.dom().classList.contains(t)},Ii=function(e,t){var n=[];return j(Ir(e),(function(e){t(e)&&(n=n.concat([e])),n=n.concat(Ii(e,t))})),n},Mi=function(e,t){return function(e,t){var r=void 0===t?n.document:t.dom();return kr(r)?[]:W(r.querySelectorAll(e),Xn.fromDom)}(t,e)};function Li(e,t,n,r,o){return e(n,r)?N.some(n):P(o)&&o(n)?N.none():t(n,r,o)}var Fi=function(e,t,n){for(var r=e.dom(),o=P(n)?n:i(!1);r.parentNode;){r=r.parentNode;var a=Xn.fromDom(r);if(t(a))return N.some(a);if(o(a))break}return N.none()},Hi=function(e,t,n){return Li((function(e,t){return t(e)}),Fi,e,t,n)},zi=function(e,t,n){return Fi(e,(function(e){return Er(e,t)}),n)},Wi=function(e,t){return function(e,t){var r=void 0===t?n.document:t.dom();return kr(r)?N.none():N.from(r.querySelector(e)).map(Xn.fromDom)}(t,e)},ji=function(e,t,n){return Li(Er,zi,e,t,n)},Ui=i("mce-annotation"),Vi=i("data-mce-annotation"),qi=i("data-mce-annotation-uid"),$i=function(e,t){var n=e.selection.getRng(),r=Xn.fromDom(n.startContainer),o=Xn.fromDom(e.getBody()),i=t.fold((function(){return"."+Ui()}),(function(e){return"["+Vi()+'="'+e+'"]'})),a=Mr(r,n.startOffset).getOr(r),u=ji(a,i,(function(e){return Nr(e,o)})),s=function(e,t){return function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)}(e,t)?N.some(dr(e,t)):N.none()};return u.bind((function(t){return s(t,""+qi()).bind((function(n){return s(t,""+Vi()).map((function(t){var r=Yi(e,n);return{uid:n,name:t,elements:r}}))}))}))},Yi=function(e,t){var n=Xn.fromDom(e.getBody());return Mi(n,"["+qi()+'="'+t+'"]')},Xi=function(e,t){var r,o,i,a=Ti({}),u=function(e,t){s(e,(function(e){return t(e),e}))},s=function(e,t){var n=a.get(),r=t(n.hasOwnProperty(e)?n[e]:{listeners:[],previous:Ti(N.none())});n[e]=r,a.set(n)},c=(r=function(){var t,n,r,o=a.get(),i=(t=nr(o),(r=I.call(t,0)).sort(n),r);j(i,(function(t){s(t,(function(n){var r=n.previous.get();return $i(e,N.some(t)).fold((function(){r.isSome()&&(function(e){u(e,(function(t){j(t.listeners,(function(t){return t(!1,e)}))}))}(t),n.previous.set(N.none()))}),(function(e){var t=e.uid,o=e.name,i=e.elements;r.is(t)||(function(e,t,n){u(e,(function(r){j(r.listeners,(function(r){return r(!0,e,{uid:t,nodes:W(n,(function(e){return e.dom()}))})}))}))}(o,t,i),n.previous.set(N.some(t)))})),{previous:n.previous,listeners:n.listeners}}))}))},o=30,i=null,{cancel:function(){null!==i&&(n.clearTimeout(i),i=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==i&&n.clearTimeout(i),i=n.setTimeout((function(){r.apply(null,e),i=null}),o)}});return e.on("remove",(function(){c.cancel()})),e.on("nodeChange",(function(){c.throttle()})),{addListener:function(e,t){s(e,(function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}}))}}},Ki=function(e,t){e.on("init",(function(){e.serializer.addNodeFilter("span",(function(e){j(e,(function(e){(function(e){return N.from(e.attributes.map[Vi()]).bind(t.lookup)})(e).each((function(t){!1===t.persistent&&e.unwrap()}))}))}))}))},Gi=function(){return(Gi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Ji=0,Qi=function(e,t){return Xn.fromDom(e.dom().cloneNode(t))},Zi=function(e){return Qi(e,!1)},ea=function(e){return Qi(e,!0)},ta=function(e,t){var r,o,i=_r(e).dom(),a=Xn.fromDom(i.createDocumentFragment()),u=(r=t,(o=(i||n.document).createElement("div")).innerHTML=r,Ir(Xn.fromDom(o)));Ci(a,u),Si(e),xi(e,a)},na=function(e){return"\ufeff"===e},ra="\ufeff",oa=function(e){return e.replace(new RegExp("\ufeff","g"),"")},ia=Ro.isElement,aa=Ro.isText,ua=function(e){return aa(e)&&(e=e.parentNode),ia(e)&&e.hasAttribute("data-mce-caret")},sa=function(e){return aa(e)&&na(e.data)},ca=function(e){return ua(e)||sa(e)},la=function(e){return e.firstChild!==e.lastChild||!Ro.isBr(e.firstChild)},fa=function(e){var t=e.container();return!(!e||!Ro.isText(t))&&(t.data.charAt(e.offset())===ra||e.isAtStart()&&sa(t.previousSibling))},da=function(e){var t=e.container();return!(!e||!Ro.isText(t))&&(t.data.charAt(e.offset()-1)===ra||e.isAtEnd()&&sa(t.nextSibling))},ma=function(e,t,r){var o,i,a;return(o=t.ownerDocument.createElement(e)).setAttribute("data-mce-caret",r?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((a=n.document.createElement("br")).setAttribute("data-mce-bogus","1"),a)),i=t.parentNode,r?i.insertBefore(o,t):t.nextSibling?i.insertBefore(o,t.nextSibling):i.appendChild(o),o},ha=function(e){return aa(e)&&e.data[0]===ra},ga=function(e){return aa(e)&&e.data[e.data.length-1]===ra},pa=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],Ro.isBogus(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n},va=Ro.isContentEditableTrue,ba=Ro.isContentEditableFalse,ya=Ro.isBr,wa=Ro.isText,xa=Ro.matchNodeNames("script style textarea"),Ca=Ro.matchNodeNames("img input textarea hr iframe video audio object"),Sa=Ro.matchNodeNames("table"),Ea=ca,ka=function(e){return!Ea(e)&&(wa(e)?!xa(e.parentNode):Ca(e)||ya(e)||Sa(e)||Na(e))},Na=function(e){return!1===function(e){return Ro.isElement(e)&&"true"===e.getAttribute("unselectable")}(e)&&ba(e)},Ta=function(e,t){return ka(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(Na(e))return!1;if(va(e))return!0}return!0}(e,t)},_a=Math.round,Ra=function(e){return e?{left:_a(e.left),top:_a(e.top),bottom:_a(e.bottom),right:_a(e.right),width:_a(e.width),height:_a(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Oa=function(e,t){return e=Ra(e),t?e.right=e.left:(e.left=e.left+e.width,e.right=e.left),e.width=0,e},Aa=function(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2},Da=function(e,t){var n=Math.min(t.height/2,e.height/2);return e.bottom-n<t.top||!(e.top>t.bottom)&&Aa(t.top-e.bottom,e,t)},Pa=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&Aa(t.bottom-e.top,e,t)},Ba=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},Ia=function(e,t){return t.left>e.left&&t.right<e.right?0:t.left<e.left?t.left-e.left:t.right-e.right},Ma=function(e,t){return t.top>e.top&&t.bottom<e.bottom?0:t.top<e.top?t.top-e.top:t.bottom-e.bottom},La=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},Fa=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},Ha=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︯ﾞ-ﾟ]"),za=function(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&Ha.test(e)},Wa=function(e,t,n){return e.isSome()&&t.isSome()?N.some(n(e.getOrDie(),t.getOrDie())):N.none()},ja=[].slice,Ua=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=ja.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},Va=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=ja.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}},qa=Ro.isElement,$a=ka,Ya=Ro.matchStyleValues("display","block table"),Xa=Ro.matchStyleValues("float","left right"),Ka=Ua(qa,$a,w(Xa)),Ga=w(Ro.matchStyleValues("white-space","pre pre-line pre-wrap")),Ja=Ro.isText,Qa=Ro.isBr,Za=li.nodeIndex,eu=Fa,tu=function(e){return"createRange"in e?e.createRange():li.DOM.createRng()},nu=function(e){return e&&/[\r\n\t ]/.test(e)},ru=function(e){return!!e.setStart&&!!e.setEnd},ou=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(nu(e.toString())&&Ga(n.parentNode)&&Ro.isText(n)&&(t=n.data,nu(t[r-1])||nu(t[r+1])))},iu=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},au=function(e){var t,n;return t=(n=e.getClientRects()).length>0?Ra(n[0]):Ra(e.getBoundingClientRect()),!ru(e)&&Qa(e)&&iu(t)?function(e){var t,n=e.ownerDocument,r=tu(n),o=n.createTextNode(" "),i=e.parentNode;return i.insertBefore(o,e),r.setStart(o,0),r.setEnd(o,1),t=Ra(r.getBoundingClientRect()),i.removeChild(o),t}(e):iu(t)&&ru(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&Ro.isText(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),au(i)}return null}(e):t},uu=function(e,t){var n=Oa(e,t);return n.width=1,n.right=n.left+1,n},su=function(e){var t,n,r=[],o=function(e){var t,n;0!==e.height&&(r.length>0&&(t=e,n=r[r.length-1],t.left===n.left&&t.top===n.top&&t.bottom===n.bottom&&t.right===n.right)||r.push(e))},i=function(e,t){var n=tu(e.ownerDocument);if(t<e.data.length){if(za(e.data[t]))return r;if(za(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!ou(n)))return o(uu(au(n),!1)),r}t>0&&(n.setStart(e,t-1),n.setEnd(e,t),ou(n)||o(uu(au(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),ou(n)||o(uu(au(n),!0)))};if(Ja(e.container()))return i(e.container(),e.offset()),r;if(qa(e.container()))if(e.isAtEnd())n=eu(e.container(),e.offset()),Ja(n)&&i(n,n.data.length),Ka(n)&&!Qa(n)&&o(uu(au(n),!1));else{if(n=eu(e.container(),e.offset()),Ja(n)&&i(n,0),Ka(n)&&e.isAtEnd())return o(uu(au(n),!1)),r;t=eu(e.container(),e.offset()-1),Ka(t)&&!Qa(t)&&(Ya(t)||Ya(n)||!Ka(n))&&o(uu(au(t),!1)),Ka(n)&&o(uu(au(n),!0))}return r};function cu(e,t,n){var r=function(){return n||(n=su(cu(e,t))),n};return{container:i(e),offset:i(t),toRange:function(){var n;return(n=tu(e.ownerDocument)).setStart(e,t),n.setEnd(e,t),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return Ja(e),0===t},isAtEnd:function(){return Ja(e)?t>=e.data.length:t>=e.childNodes.length},isEqual:function(n){return n&&e===n.container()&&t===n.offset()},getNode:function(n){return eu(e,n?t-1:t)}}}!function(e){e.fromRangeStart=function(t){return e(t.startContainer,t.startOffset)},e.fromRangeEnd=function(t){return e(t.endContainer,t.endOffset)},e.after=function(t){return e(t.parentNode,Za(t)+1)},e.before=function(t){return e(t.parentNode,Za(t))},e.isAbove=function(e,t){return Wa(J(t.getClientRects()),Q(e.getClientRects()),Da).getOr(!1)},e.isBelow=function(e,t){return Wa(Q(t.getClientRects()),J(e.getClientRects()),Pa).getOr(!1)},e.isAtStart=function(e){return!!e&&e.isAtStart()},e.isAtEnd=function(e){return!!e&&e.isAtEnd()},e.isTextPosition=function(e){return!!e&&Ro.isText(e.container())},e.isElementPosition=function(t){return!1===e.isTextPosition(t)}}(cu||(cu={}));var lu,fu=cu,du=Ro.isText,mu=Ro.isBogus,hu=li.nodeIndex,gu=function(e){var t=e.parentNode;return mu(t)?gu(t):t},pu=function(e){return e?Wt.reduce(e.childNodes,(function(e,t){return mu(t)&&"BR"!==t.nodeName?e=e.concat(pu(t)):e.push(t),e}),[]):[]},vu=function(e){return function(t){return e===t}},bu=function(e){return(du(e)?"text()":e.nodeName.toLowerCase())+"["+function(e){var t,n,r;return t=pu(gu(e)),n=Wt.findIndex(t,vu(e),e),t=t.slice(0,n+1),r=Wt.reduce(t,(function(e,n,r){return du(n)&&du(t[r-1])&&e++,e}),0),t=Wt.filter(t,Ro.matchNodeNames(e.nodeName)),(n=Wt.findIndex(t,vu(e),e))-r}(e)+"]"},yu=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),du(n)?o=function(e,t){for(;(e=e.previousSibling)&&du(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(bu(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=Wt.filter(a,w(Ro.isBogus)),(u=u.concat(Wt.map(a,(function(e){return bu(e)})))).reverse().join("/")+","+o},wu=function(e,t){var n,r,o;return t?(n=t.split(","),t=n[0].split("/"),o=n.length>1?n[1]:"before",(r=Wt.reduce(t,(function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),function(e,t,n){var r=pu(e);return r=Wt.filter(r,(function(e,t){return!du(e)||!du(r[t-1])})),(r=Wt.filter(r,Ro.matchNodeNames(t)))[n]}(e,t[1],parseInt(t[2],10))):null}),e))?du(r)?function(e,t){for(var n,r=e,o=0;du(r);){if(n=r.data.length,t>=o&&t<=o+n){e=r,t-=o;break}if(!du(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return du(e)&&t>e.data.length&&(t=e.data.length),fu(e,t)}(r,parseInt(o,10)):(o="after"===o?hu(r)+1:hu(r),fu(r.parentNode,o)):null):null},xu=function(e,t){Ro.isText(t)&&0===t.data.length&&e.remove(t)},Cu=function(e,t,n){Ro.isDocumentFragment(n)?function(e,t,n){var r=N.from(n.firstChild),o=N.from(n.lastChild);t.insertNode(n),r.each((function(t){return xu(e,t.previousSibling)})),o.each((function(t){return xu(e,t.nextSibling)}))}(e,t,n):function(e,t,n){t.insertNode(n),xu(e,n.previousSibling),xu(e,n.nextSibling)}(e,t,n)},Su=Ro.isContentEditableFalse,Eu=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=e.getRoot();for(Ro.isText(a)?s.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&Ro.isText(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(e.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(e.nodeIndex(a,n));return s},ku=function(e,t,n){var r=0;return $t.each(e.select(t),(function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++})),r},Nu=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],Ro.isElement(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r))},Tu=function(e){return Nu(e,!0),Nu(e,!1),e},_u=function(e,t){var n;if(Ro.isElement(e)&&(e=Fa(e,t),Su(e)))return e;if(ca(e)){if(Ro.isText(e)&&ua(e)&&(e=e.parentNode),n=e.previousSibling,Su(n))return n;if(n=e.nextSibling,Su(n))return n}},Ru=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Su(r)||"IMG"===o)return{name:o,index:ku(n.dom,o,r)};var a=function(e){return _u(e.startContainer,e.startOffset)||_u(e.endContainer,e.endOffset)}(i);return a?{name:o=a.tagName,index:ku(n.dom,o,a)}:function(e,t,n,r){var o=t.dom,i={};return i.start=Eu(o,e,n,r,!0),t.isCollapsed()||(i.end=Eu(o,e,n,r,!1)),i}(e,n,t,i)},Ou=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,"&#xFEFF;"):e.create("span",r)},Au=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:ku(n,u,a)};var s=Tu(r.cloneRange());if(!i){s.collapse(!1);var c=Ou(n,o+"_end",t);Cu(n,s,c)}(r=Tu(r)).collapse(!0);var l=Ou(n,o+"_start",t);return Cu(n,r,l),e.moveToBookmark({id:o,keep:1}),{id:o}},Du={getBookmark:function(e,t,n){return 2===t?Ru(oa,n,e):3===t?function(e){var t=e.getRng();return{start:yu(e.dom.getRoot(),fu.fromRangeStart(t)),end:yu(e.dom.getRoot(),fu.fromRangeEnd(t))}}(e):t?function(e){return{rng:e.getRng()}}(e):Au(e,!1)},getUndoBookmark:u(Ru,a,!0),getPersistentBookmark:Au},Pu=function(e){return Ro.isElement(e)&&"_mce_caret"===e.id},Bu=function(e,t){for(;t&&t!==e;){if("_mce_caret"===t.id)return t;t=t.parentNode}return null},Iu=Ro.isElement,Mu=Ro.isText,Lu=function(e){var t=e.parentNode;t&&t.removeChild(e)},Fu=function(e,t){0===t.length?Lu(e):e.nodeValue=t},Hu=function(e){var t=oa(e);return{count:e.length-t.length,text:t}},zu=function(e,t){return Uu(e),t},Wu=function(e,t){var n=t.container(),r=function(e,t){var n=F(e,t);return-1===n?N.none():N.some(n)}(Z(n.childNodes),e).map((function(e){return e<t.offset()?fu(n,t.offset()-1):t})).getOr(t);return Uu(e),r},ju=function(e,t){return Mu(e)&&t.container()===e?function(e,t){var n=Hu(e.data.substr(0,t.offset())),r=Hu(e.data.substr(t.offset())),o=n.text+r.text;return o.length>0?(Fu(e,o),fu(e,t.offset()-n.count)):t}(e,t):zu(e,t)},Uu=function(e){if(Iu(e)&&ca(e)&&(la(e)?e.removeAttribute("data-mce-caret"):Lu(e)),Mu(e)){var t=oa(function(e){try{return e.nodeValue}catch(e){return""}}(e));Fu(e,t)}},Vu={removeAndReposition:function(e,t){return fu.isTextPosition(t)?ju(e,t):function(e,t){return t.container()===e.parentNode?Wu(e,t):zu(e,t)}(e,t)},remove:Uu},qu=$n.detect().browser,$u=Ro.isContentEditableFalse,Yu=function(e,t,n){var r,o,i,a,u,s=Oa(t.getBoundingClientRect(),n);return"BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,i=e.scrollTop||r.scrollTop):(u=e.getBoundingClientRect(),o=e.scrollLeft-u.left,i=e.scrollTop-u.top),s.left+=o,s.right+=o,s.top+=i,s.bottom+=i,s.width=1,(a=t.offsetWidth-t.clientWidth)>0&&(n&&(a*=-1),s.left+=a,s.right+=a),s},Xu=function(e,t,n){var r,o,i=Ti(N.none()),a=function(){!function(e){var t,n,r,o,i;for(t=dn("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,ga(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,ha(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(e),o&&(Vu.remove(o),o=null),i.get().each((function(e){dn(e.caret).remove(),i.set(N.none())})),clearInterval(r)},u=function(){r=ge.setInterval((function(){n()?dn("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):dn("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500)};return{show:function(n,r){var s,c;if(a(),function(e){return Ro.isElement(e)&&/^(TD|TH)$/i.test(e.tagName)}(r))return null;if(!t(r))return o=function(e,t){var n,r,o;if(r=e.ownerDocument.createTextNode(ra),o=e.parentNode,t){if(n=e.previousSibling,aa(n)){if(ca(n))return n;if(ga(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else{if(n=e.nextSibling,aa(n)){if(ca(n))return n;if(ha(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r}(r,n),c=r.ownerDocument.createRange(),$u(o.nextSibling)?(c.setStart(o,0),c.setEnd(o,0)):(c.setStart(o,1),c.setEnd(o,1)),c;o=ma("p",r,n),s=Yu(e,r,n),dn(o).css("top",s.top);var l=dn('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(s).appendTo(e)[0];return i.set(N.some({caret:l,element:r,before:n})),i.get().each((function(e){n&&dn(e.caret).addClass("mce-visual-caret-before")})),u(),(c=r.ownerDocument.createRange()).setStart(o,0),c.setEnd(o,0),c},hide:a,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(){i.get().each((function(t){var n=Yu(e,t.element,t.before);dn(t.caret).css(n)}))},destroy:function(){return ge.clearInterval(r)}}},Ku=function(){return qu.isIE()||qu.isEdge()||qu.isFirefox()},Gu=function(e){return $u(e)||Ro.isTable(e)&&Ku()},Ju=Ro.isContentEditableFalse,Qu=Ro.matchStyleValues("display","block table table-cell table-caption list-item"),Zu=ca,es=ua,ts=Ro.isElement,ns=ka,rs=function(e){return e>0},os=function(e){return e<0},is=function(e,t){for(var n;n=e(t);)if(!es(n))return n;return null},as=function(e,t,n,r,o){var i=new to(e,r);if(os(t)){if((Ju(e)||es(e))&&n(e=is(i.prev,!0)))return e;for(;e=is(i.prev,o);)if(n(e))return e}if(rs(t)){if((Ju(e)||es(e))&&n(e=is(i.next,!0)))return e;for(;e=is(i.next,o);)if(n(e))return e}return null},us=function(e,t){for(;e&&e!==t;){if(Qu(e))return e;e=e.parentNode}return null},ss=function(e,t,n){return us(e.container(),n)===us(t.container(),n)},cs=function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),ts(n)?n.childNodes[r+e]:null):null},ls=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},fs=function(e,t,n){return us(t,e)===us(n,e)},ds=function(e,t,n){var r,o;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],Zu(r)&&(r=r[o]),Ju(r)){if(fs(t,r,n))return r;break}if(ns(r))break;n=n.parentNode}return null},ms=u(ls,!0),hs=u(ls,!1),gs=function(e,t,n){var r,o,i,a,s=u(ds,!0,t),c=u(ds,!1,t);if(o=n.startContainer,i=n.startOffset,ua(o)){if(ts(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,Gu(r)))return ms(r);if("after"===a&&(r=o.previousSibling,Gu(r)))return hs(r)}if(!n.collapsed)return n;if(Ro.isText(o)){if(Zu(o)){if(1===e){if(r=c(o))return ms(r);if(r=s(o))return hs(r)}if(-1===e){if(r=s(o))return hs(r);if(r=c(o))return ms(r)}return n}if(ga(o)&&i>=o.data.length-1)return 1===e&&(r=c(o))?ms(r):n;if(ha(o)&&i<=1)return-1===e&&(r=s(o))?hs(r):n;if(i===o.data.length)return(r=c(o))?ms(r):n;if(0===i)return(r=s(o))?hs(r):n}return n},ps=function(e,t){return N.from(cs(e?0:-1,t)).filter(Ju)},vs=function(e,t,n){var r=gs(e,t,n);return-1===e?cu.fromRangeStart(r):cu.fromRangeEnd(r)},bs=function(e){return N.from(e.getNode()).map(Xn.fromDom)},ys=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},ws=function(e,t){var n=ss(e,t);return!(n||!Ro.isBr(e.getNode()))||n};!function(e){e[e.Backwards=-1]="Backwards",e[e.Forwards=1]="Forwards"}(lu||(lu={}));var xs=Ro.isContentEditableFalse,Cs=Ro.isText,Ss=Ro.isElement,Es=Ro.isBr,ks=ka,Ns=function(e){return Ca(e)||function(e){return!!Na(e)&&!0!==q(Z(e.getElementsByTagName("*")),(function(e,t){return e||va(t)}),!1)}(e)},Ts=Ta,_s=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},Rs=function(e,t){if(rs(e)){if(ks(t.previousSibling)&&!Cs(t.previousSibling))return fu.before(t);if(Cs(t))return fu(t,0)}if(os(e)){if(ks(t.nextSibling)&&!Cs(t.nextSibling))return fu.after(t);if(Cs(t))return fu(t,t.data.length)}return os(e)?Es(t)?fu.before(t):fu.after(t):fu.before(t)},Os=function(e,t,n){var r,o,a,u,s;if(!Ss(n)||!t)return null;if(t.isEqual(fu.after(n))&&n.lastChild){if(s=fu.after(n.lastChild),os(e)&&ks(n.lastChild)&&Ss(n.lastChild))return Es(n.lastChild)?fu.before(n.lastChild):s}else s=t;var c=s.container(),l=s.offset();if(Cs(c)){if(os(e)&&l>0)return fu(c,--l);if(rs(e)&&l<c.length)return fu(c,++l);r=c}else{if(os(e)&&l>0&&(o=_s(c,l-1),ks(o)))return!Ns(o)&&(a=as(o,e,Ts,o))?Cs(a)?fu(a,a.data.length):fu.after(a):Cs(o)?fu(o,o.data.length):fu.before(o);if(rs(e)&&l<c.childNodes.length&&(o=_s(c,l),ks(o)))return Es(o)?function(e,t){var n=t.nextSibling;return n&&ks(n)?Cs(n)?fu(n,0):fu.before(n):Os(lu.Forwards,fu.after(t),e)}(n,o):!Ns(o)&&(a=as(o,e,Ts,o))?Cs(a)?fu(a,0):fu.before(a):Cs(o)?fu(o,0):fu.after(o);r=o||s.getNode()}return(rs(e)&&s.isAtEnd()||os(e)&&s.isAtStart())&&(r=as(r,e,i(!0),n,!0),Ts(r,n))?Rs(e,r):(o=as(r,e,Ts,n),!(u=Wt.last(V(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(c,n),xs)))||o&&u.contains(o)?o?Rs(e,o):null:s=rs(e)?fu.after(u):fu.before(u))},As=function(e){return{next:function(t){return Os(lu.Forwards,t,e)},prev:function(t){return Os(lu.Backwards,t,e)}}},Ds=function(e){return fu.isTextPosition(e)?0===e.offset():ka(e.getNode())},Ps=function(e){if(fu.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return ka(e.getNode(!0))},Bs=function(e,t){return!fu.isTextPosition(e)&&!fu.isTextPosition(t)&&e.getNode()===t.getNode(!0)},Is=function(e,t,n){return e?!Bs(t,n)&&(r=t,!(!fu.isTextPosition(r)&&Ro.isBr(r.getNode())))&&Ps(t)&&Ds(n):!Bs(n,t)&&Ds(t)&&Ps(n);var r},Ms=function(e,t,n){var r=As(t);return N.from(e?r.next(n):r.prev(n))},Ls=function(e,t,n){return Ms(e,t,n).bind((function(r){return ss(n,r,t)&&Is(e,n,r)?Ms(e,t,r):N.some(r)}))},Fs=function(e,t,n,r){return Ls(e,t,n).bind((function(n){return r(n)?Fs(e,t,n,r):N.some(n)}))},Hs=function(e,t){var n=e?t.firstChild:t.lastChild;return Ro.isText(n)?N.some(fu(n,e?0:n.data.length)):n?ka(n)?N.some(e?fu.before(n):function(e){return Ro.isBr(e)?fu.before(e):fu.after(e)}(n)):function(e,t,n){var r=e?fu.before(n):fu.after(n);return Ms(e,t,r)}(e,t,n):N.none()},zs=u(Ms,!0),Ws=u(Ms,!1),js={fromPosition:Ms,nextPosition:zs,prevPosition:Ws,navigate:Ls,navigateIgnore:Fs,positionIn:Hs,firstPositionIn:u(Hs,!0),lastPositionIn:u(Hs,!1)},Us=function(e,t){return Ro.isElement(t)&&e.isBlock(t)&&!t.innerHTML&&!le.ie&&(t.innerHTML='<br data-mce-bogus="1" />'),t},Vs=function(e,t){return js.lastPositionIn(e).fold((function(){return!1}),(function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0}))},qs=function(e,t,n){return!(!function(e){return!1===e.hasChildNodes()}(t)||!Bu(e,t)||(function(e,t){var n=e.ownerDocument.createTextNode(ra);e.appendChild(n),t.setStart(n,0),t.setEnd(n,0)}(t,n),0))},$s=function(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;o>=1;o--){if(u=i.childNodes,qs(c,i,r))return!0;if(s[o]>u.length-1)return!!qs(c,i,r)||Vs(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},Ys=function(e){return Ro.isText(e)&&e.data.length>0},Xs=function(e,t,n){var r,o,i,a,u,s,c=e.get(n.id+"_"+t),l=n.keep;if(c){if(r=c.parentNode,"start"===t?(l?c.hasChildNodes()?(r=c.firstChild,o=1):Ys(c.nextSibling)?(r=c.nextSibling,o=0):Ys(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)+1):o=e.nodeIndex(c),u=r,s=o):(l?c.hasChildNodes()?(r=c.firstChild,o=1):Ys(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)):o=e.nodeIndex(c),u=r,s=o),!l){for(a=c.previousSibling,i=c.nextSibling,$t.each($t.grep(c.childNodes),(function(e){Ro.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))}));c=e.get(n.id+"_"+t);)e.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&Ro.isText(a)&&!le.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return N.some(fu(u,s))}return N.none()},Ks=function(e,t){var n=e.dom;if(t){if(function(e){return $t.isArray(e.start)}(t))return function(e,t){var n=e.createRng();return $s(e,!0,t,n)&&$s(e,!1,t,n)?N.some(n):N.none()}(n,t);if(function(e){return"string"==typeof e.start}(t))return N.some(function(e,t){var n,r;return n=e.createRng(),r=wu(e.getRoot(),t.start),n.setStart(r.container(),r.offset()),r=wu(e.getRoot(),t.end),n.setEnd(r.container(),r.offset()),n}(n,t));if(function(e){return e.hasOwnProperty("id")}(t))return function(e,t){var n,r,o=Xs(e,"start",t),i=Xs(e,"end",t);return Wa(o,(r=o,(n=i).isSome()?n:r),(function(t,n){var r=e.createRng();return r.setStart(Us(e,t.container()),t.offset()),r.setEnd(Us(e,n.container()),n.offset()),r}))}(n,t);if(function(e){return e.hasOwnProperty("name")}(t))return function(e,t){return N.from(e.select(t.name)[t.index]).map((function(t){var n=e.createRng();return n.selectNode(t),n}))}(n,t);if(function(e){return e.hasOwnProperty("rng")}(t))return N.some(t.rng)}return N.none()},Gs=function(e,t,n){return Du.getBookmark(e,t,n)},Js=function(e,t){Ks(e,t).each((function(t){e.setRng(t)}))},Qs=function(e){return Ro.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Zs=function(e){return e&&/^(IMG)$/.test(e.nodeName)},ec=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},tc=function(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},nc={isInlineBlock:Zs,moveStart:function(e,t,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!Zs(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?r=new to(u=i[a],e.getParent(u,e.isBlock)):(r=new to(u=i[i.length-1],e.getParent(u,e.isBlock))).next(!0),o=r.current();o;o=r.next())if(3===o.nodeType&&!ec(o))return n.setStart(o,0),void t.setRng(n)},getNonWhiteSpaceSibling:function(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1===e.nodeType||!ec(e))return e},isTextBlock:function(e,t){return t.nodeType&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},isValid:function(e,t,n){return e.schema.isValidChild(t,n)},isWhiteSpaceNode:ec,replaceVars:function(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,(function(e,n){return t[n]||e}))),e},isEq:function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},normalizeStyleValue:tc,getStyle:function(e,t,n){return tc(e,e.getStyle(t,n),n)},getTextDecoration:function(e,t){var n;return e.getParent(t,(function(t){return(n=e.getStyle(t,"text-decoration"))&&"none"!==n})),n},getParents:function(e,t,n){return e.getParents(t,n,e.getRoot())}},rc=Qs,oc=nc.getParents,ic=nc.isWhiteSpaceNode,ac=nc.isTextBlock,uc=function(e,t){for(void 0===t&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)(e=e.childNodes[t])&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}},sc=function(e){return"BR"===e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling},cc=function(e,t){for(var n=t;n;){if(1===n.nodeType&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},lc=function(e,t,n,r){var o,i,a=n.nodeValue;return void 0===r&&(r=e?a.length:0),e?-1!==(o=(o=a.lastIndexOf(" ",r))>(i=a.lastIndexOf(" ",r))?o:i)&&!t&&(o<r||!e)&&o<=a.length&&o++:(o=a.indexOf(" ",r),i=a.indexOf(" ",r),o=-1!==o&&(-1===i||o<i)?o:i),o},fc=function(e,t,n,r,o,i){var a,u,s,c;if(3===n.nodeType){if(-1!==(s=lc(o,i,n,r)))return{container:n,offset:s};c=n}for(a=new to(n,e.getParent(n,e.isBlock)||t);u=a[o?"prev":"next"]();)if(3!==u.nodeType||rc(u.parentNode)){if(e.isBlock(u)||nc.isEq(u,"BR"))break}else if(c=u,-1!==(s=lc(o,i,u)))return{container:u,offset:s};if(c)return{container:c,offset:r=o?0:c.length}},dc=function(e,t,n,r,o){var i,a,u,s;for(3===r.nodeType&&0===r.nodeValue.length&&r[o]&&(r=r[o]),i=oc(e,r),a=0;a<i.length;a++)for(u=0;u<t.length;u++)if(!("collapsed"in(s=t[u])&&s.collapsed!==n.collapsed)&&e.is(i[a],s.selector))return i[a];return r},mc=function(e,t,n,r){var o,i=e.dom,a=i.getRoot();if(t[0].wrapper||(o=i.getParent(n,t[0].block,a)),!o){var u=i.getParent(n,"LI,TD,TH");o=i.getParent(3===n.nodeType?n.parentNode:n,(function(t){return t!==a&&ac(e,t)}),u)}if(o&&t[0].wrapper&&(o=oc(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!nc.isEq(o,"br")););return o||n},hc=function(e,t,n,r,o,i,a){var u,s,c,l,f;if(u=s=a?n:o,l=a?"previousSibling":"nextSibling",f=e.getRoot(),3===u.nodeType&&!ic(u)&&(a?r>0:i<u.nodeValue.length))return u;for(;;){if(!t[0].block_expand&&e.isBlock(s))return s;for(c=s[l];c;c=c[l])if(!rc(c)&&!ic(c)&&!sc(c))return s;if(s===f||s.parentNode===f){u=s;break}s=s.parentNode}return u},gc=function(e,t,n,r){var o,i=t.startContainer,a=t.startOffset,u=t.endContainer,s=t.endOffset,c=e.dom;return 1===i.nodeType&&i.hasChildNodes()&&3===(i=Fa(i,a)).nodeType&&(a=0),1===u.nodeType&&u.hasChildNodes()&&3===(u=Fa(u,t.collapsed?s:s-1)).nodeType&&(s=u.nodeValue.length),i=cc(c,i),u=cc(c,u),(rc(i.parentNode)||rc(i))&&(i=rc(i)?i:i.parentNode,3===(i=t.collapsed?i.previousSibling||i:i.nextSibling||i).nodeType&&(a=t.collapsed?i.length:0)),(rc(u.parentNode)||rc(u))&&(u=rc(u)?u:u.parentNode,3===(u=t.collapsed?u.nextSibling||u:u.previousSibling||u).nodeType&&(s=t.collapsed?0:u.length)),t.collapsed&&((o=fc(c,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=fc(c,e.getBody(),u,s,!1,r))&&(u=o.container,s=o.offset)),n[0].inline&&(u=r?u:function(e,t){var n=uc(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=uc(n.node.previousSibling);n.node&&n.offset>0&&3===n.node.nodeType&&" "===n.node.nodeValue.charAt(n.offset-1)&&n.offset>1&&(e=n.node).splitText(n.offset-1)}return e}(u,s)),(n[0].inline||n[0].block_expand)&&(n[0].inline&&3===i.nodeType&&0!==a||(i=hc(c,n,i,a,u,s,!0)),n[0].inline&&3===u.nodeType&&s!==u.nodeValue.length||(u=hc(c,n,i,a,u,s,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(i=dc(c,n,t,i,"previousSibling"),u=dc(c,n,t,u,"nextSibling")),(n[0].block||n[0].selector)&&(i=mc(e,n,i,"previousSibling"),u=mc(e,n,u,"nextSibling"),n[0].block&&(c.isBlock(i)||(i=hc(c,n,i,a,u,s,!0)),c.isBlock(u)||(u=hc(c,n,i,a,u,s,!1)))),1===i.nodeType&&(a=c.nodeIndex(i),i=i.parentNode),1===u.nodeType&&(s=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:i,startOffset:a,endContainer:u,endOffset:s}},pc=$t.each,vc=function(e,t,n){var r,o,i,a,u,s,c,l=t.startContainer,f=t.startOffset,d=t.endContainer,m=t.endOffset;if((c=e.select("td[data-mce-selected],th[data-mce-selected]")).length>0)pc(c,(function(e){n([e])}));else{var h,g,p,v=function(e){var t;return 3===(t=e[0]).nodeType&&t===l&&f>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e},b=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},y=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},w=function(e,t,r){var o=r?"nextSibling":"previousSibling";for(u=(a=e).parentNode;a&&a!==t;a=u)u=a.parentNode,(s=b(a===e?a:a[o],o)).length&&(r||s.reverse(),n(v(s)))};if(1===l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[f]),1===d.nodeType&&d.hasChildNodes()&&(g=m,p=(h=d).childNodes,--g>p.length-1?g=p.length-1:g<0&&(g=0),d=p[g]||h),l===d)return n(v([l]));for(r=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return w(l,r,!0);if(a===r)break}for(a=d;a;a=a.parentNode){if(a===l)return w(d,r);if(a===r)break}o=y(l,r)||l,i=y(d,r)||d,w(l,o,!0),(s=b(o===l?o:o.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&n(v(s)),w(d,i)}},bc=function(e,t){var n=function(t){return e(t)?N.from(t.dom().nodeValue):N.none()};return{get:function(r){if(!e(r))throw new Error("Can only get "+t+" value of a "+t+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom().nodeValue=r}}}(tr,"text"),yc=function(e){return bc.get(e)},wc=function(e,t,n,r){return Or(t).fold((function(){return"skipping"}),(function(o){return"br"===r||function(e){return tr(e)&&"\ufeff"===yc(e)}(t)?"valid":function(e){return er(e)&&Bi(e,Ui())}(t)?"existing":Pu(t)?"caret":nc.isValid(e,n,r)&&nc.isValid(e,Qn(o),n)?"valid":"invalid-child"}))},xc=function(e,t,n,r){var o,i,a=t.uid,u=void 0===a?(o="mce-annotation",i=(new Date).getTime(),o+"_"+Math.floor(1e9*Math.random())+ ++Ji+String(i)):a,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["uid"]),c=Xn.fromTag("span",e);Di(c,Ui()),lr(c,""+qi(),u),lr(c,""+Vi(),n);var l=r(u,s),f=l.attributes,d=void 0===f?{}:f,m=l.classes,h=void 0===m?[]:m;return fr(c,d),function(e,t){j(t,(function(t){Di(e,t)}))}(c,h),c},Cc=function(e,t,n,r,o){var i=[],a=xc(e.getDoc(),o,n,r),u=Ti(N.none()),s=function(){u.set(N.none())},c=function(e){j(e,l)},l=function(t){switch(wc(e,t,"span",Qn(t))){case"invalid-child":s();var n=Ir(t);c(n),s();break;case"valid":!function(e,t){bi(e,t),xi(t,e)}(t,u.get().getOrThunk((function(){var e=Zi(a);return i.push(e),u.set(N.some(e)),e})))}};return vc(e.dom,t,(function(e){s(),function(e){var t=W(e,Xn.fromDom);c(t)}(e)})),i},Sc=function(e,t,n,r){e.undoManager.transact((function(){var o=e.selection.getRng();if(o.collapsed&&function(e,t){var n=gc(e,t,[{inline:!0}],function(e){return 3===e.startContainer.nodeType&&e.startContainer.nodeValue.length>=e.startOffset&&" "===e.startContainer.nodeValue[e.startOffset]}(t));t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t)}(e,o),e.selection.getRng().collapsed){var i=xc(e.getDoc(),r,t,n.decorate);ta(i," "),e.selection.getRng().insertNode(i.dom()),e.selection.select(i.dom())}else{var a=Du.getPersistentBookmark(e.selection,!1),u=e.selection.getRng();Cc(e,u,t,n.decorate,r),e.selection.moveToBookmark(a)}}))};function Ec(e){var t,n=(t={},{register:function(e,n){t[e]={name:e,settings:n}},lookup:function(e){return t.hasOwnProperty(e)?N.from(t[e]).map((function(e){return e.settings})):N.none()}});Ki(e,n);var r=Xi(e);return{register:function(e,t){n.register(e,t)},annotate:function(t,r){n.lookup(t).each((function(n){Sc(e,t,n,r)}))},annotationChanged:function(e,t){r.addListener(e,t)},remove:function(t){$i(e,N.some(t)).each((function(e){var t=e.elements;j(t,ki)}))},getAll:function(t){return function(e,t){return ir(e,(function(e,n){return{k:n,v:t(e,n)}}))}(function(e,t){var n=Xn.fromDom(e.getBody()),r=Mi(n,"["+Vi()+'="'+t+'"]'),o={};return j(r,(function(e){var t=dr(e,qi()),n=o.hasOwnProperty(t)?o[t]:[];o[t]=n.concat([e])})),o}(e,t),(function(e){return W(e,(function(e){return e.dom()}))}))}}}var kc=function(e){return $t.grep(e.childNodes,(function(e){return"LI"===e.nodeName}))},Nc=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&function(e){return" "===e.data||Ro.isBr(e)}(e.firstChild)},Tc=function(e){return e.length>0&&(!(t=e[e.length-1]).firstChild||Nc(t))?e.slice(0,-1):e;var t},_c=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},Rc=function(e,t){var n=fu.after(e),r=As(t).prev(n);return r?r.toRange():null},Oc=function(e,t,n){var r=e.parentNode;return $t.each(t,(function(t){r.insertBefore(t,e)})),function(e,t){var n=fu.before(e),r=As(t).next(n);return r?r.toRange():null}(e,n)},Ac=function(e,t){var n=t.firstChild,r=t.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(e,t){var n=e.getNonEmptyElements();return t&&(t.isEmpty(n)||function(e,t){return e.getBlockElements()[t.name]&&function(e){return e.firstChild&&e.firstChild===e.lastChild}(t)&&function(e){return"br"===e.name||" "===e.value}(t.firstChild)}(e,t))}(e,r)&&(r=r.prev),!(!n||n!==r||"ul"!==n.name&&"ol"!==n.name)},Dc=function(e,t,n,r){var o=function(e,t,n){var r=t.serialize(n);return function(e){var t=e.firstChild,n=e.lastChild;return t&&"META"===t.nodeName&&t.parentNode.removeChild(t),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),e}(e.createFragment(r))}(t,e,r),i=_c(t,n.startContainer),a=Tc(kc(o.firstChild)),u=t.getRoot(),s=function(e){var r=fu.fromRangeStart(n),o=As(t.getRoot()),a=1===e?o.prev(r):o.next(r);return!a||_c(t,a.getNode())!==i};return s(1)?Oc(i,a,u):s(2)?function(e,t,n,r){return r.insertAfter(t.reverse(),e),Rc(t[0],n)}(i,a,u,t):function(e,t,n,r){var o=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]}(e,r),i=e.parentNode;return i.insertBefore(o[0],e),$t.each(t,(function(t){i.insertBefore(t,e)})),i.insertBefore(o[1],e),i.removeChild(e),Rc(t[t.length-1],n)}(i,a,u,n)},Pc=function(e,t){return!!_c(e,t)},Bc=$t.each,Ic=function(e){this.compare=function(t,n){if(t.nodeName!==n.nodeName)return!1;var r=function(t){var n={};return Bc(e.getAttribs(t),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=e.getAttrib(t,o))})),n},o=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!(!o(r(t),r(n))||!o(e.parseStyle(e.getAttrib(t,"style")),e.parseStyle(e.getAttrib(n,"style")))||Qs(t)||Qs(n))}},Mc=function(e){var t=Mi(e,"br"),n=V(function(e){for(var t=[],n=e.dom();n;)t.push(Xn.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),co);t.length===n.length&&j(n,Ei)},Lc=function(e){Si(e),xi(e,Xn.fromHtml('<br data-mce-bogus="1">'))},Fc=function(e){Fr(e).each((function(t){Ar(t).each((function(n){uo(e)&&co(t)&&uo(n)&&Ei(t)}))}))},Hc=$t.makeMap;function zc(e){var t,n,r,o,i,a=[];return t=(e=e||{}).indent,n=Hc(e.indent_before||""),r=Hc(e.indent_after||""),o=Uo.getEncodeFunc(e.entity_encoding||"raw",e.entities),i="html"===e.element_format,{start:function(e,u,s){var c,l,f,d;if(t&&n[e]&&a.length>0&&(d=a[a.length-1]).length>0&&"\n"!==d&&a.push("\n"),a.push("<",e),u)for(c=0,l=u.length;c<l;c++)f=u[c],a.push(" ",f.name,'="',o(f.value,!0),'"');a[a.length]=!s||i?">":" />",s&&t&&r[e]&&a.length>0&&(d=a[a.length-1]).length>0&&"\n"!==d&&a.push("\n")},end:function(e){var n;a.push("</",e,">"),t&&r[e]&&a.length>0&&(n=a[a.length-1]).length>0&&"\n"!==n&&a.push("\n")},text:function(e,t){e.length>0&&(a[a.length]=t?e:o(e))},cdata:function(e){a.push("<![CDATA[",e,"]]>")},comment:function(e){a.push("\x3c!--",e,"--\x3e")},pi:function(e,n){n?a.push("<?",e," ",o(n),"?>"):a.push("<?",e,"?>"),t&&a.push("\n")},doctype:function(e){a.push("<!DOCTYPE",e,">",t?"\n":"")},reset:function(){a.length=0},getContent:function(){return a.join("").replace(/\n$/,"")}}}function Wc(e,t){void 0===t&&(t=Zo());var n=zc(e);return(e=e||{}).validate=!("validate"in e)||e.validate,{serialize:function(r){var o,i;i=e.validate,o={3:function(e){n.text(e.value,e.raw)},8:function(e){n.comment(e.value)},7:function(e){n.pi(e.name,e.value)},10:function(e){n.doctype(e.value)},4:function(e){n.cdata(e.value)},11:function(e){if(e=e.firstChild)do{a(e)}while(e=e.next)}},n.reset();var a=function(e){var r,u,s,c,l,f,d,m,h,g=o[e.type];if(g)g(e);else{if(r=e.name,u=e.shortEnded,s=e.attributes,i&&s&&s.length>1&&((f=[]).map={},h=t.getElementRule(e.name))){for(d=0,m=h.attributesOrder.length;d<m;d++)(c=h.attributesOrder[d])in s.map&&(l=s.map[c],f.map[c]=l,f.push({name:c,value:l}));for(d=0,m=s.length;d<m;d++)(c=s[d].name)in f.map||(l=s.map[c],f.map[c]=l,f.push({name:c,value:l}));s=f}if(n.start(e.name,s,u),!u){if(e=e.firstChild)do{a(e)}while(e=e.next);n.end(r)}}};return 1!==r.type||e.inner?o[11](r):a(r),n.getContent()}}}var jc,Uc=function(e){var t=fu.fromRangeStart(e),r=fu.fromRangeEnd(e),o=e.commonAncestorContainer;return js.fromPosition(!1,o,r).map((function(i){return!ss(t,r,o)&&ss(t,i,o)?function(e,t,r,o){var i=n.document.createRange();return i.setStart(e,t),i.setEnd(r,o),i}(t.container(),t.offset(),i.container(),i.offset()):e})).getOr(e)},Vc=function(e){return e.collapsed?e:Uc(e)},qc=Ro.matchNodeNames("td th"),$c=function(e,t){var n=e.selection.getRng(),r=n.startContainer,o=n.startOffset;n.collapsed&&function(e,t){return Ro.isText(e)&&" "===e.nodeValue[t-1]}(r,o)&&Ro.isText(r)&&(r.insertData(o-1," "),r.deleteData(o,1),n.setStart(r,o),n.setEnd(r,o),e.selection.setRng(n)),e.selection.setContent(t)},Yc=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,h=e.selection,g=e.dom;if(/^ | $/.test(t)&&(t=function(e,t){var n,r;n=e.startContainer,r=e.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(r>0?t=t.replace(/^&nbsp;/," "):o("previousSibling")||(t=t.replace(/^ /,"&nbsp;")),r<n.length?t=t.replace(/&nbsp;(<br>|)$/," "):o("nextSibling")||(t=t.replace(/(&nbsp;| )(<br>|)$/,"&nbsp;"))),t}(h.getRng(),t)),r=e.parser,m=n.merge,o=Wc({validate:e.settings.validate},e.schema),d='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;&#x200B;</span>',s={content:t,format:"html",selection:!0,paste:n.paste},(s=e.fire("BeforeSetContent",s)).isDefaultPrevented())e.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=s.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var p=(l=h.getRng()).startContainer||(l.parentElement?l.parentElement():null),v=e.getBody();p===v&&h.isCollapsed()&&g.isBlock(v.firstChild)&&function(e,t){return t&&!e.schema.getShortEndedElements()[t.nodeName]}(e,v.firstChild)&&g.isEmpty(v.firstChild)&&((l=g.createRng()).setStart(v.firstChild,0),l.setEnd(v.firstChild,0),h.setRng(l)),h.isCollapsed()||(e.selection.setRng(Vc(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),t=function(e,t){var n,r;return n=e.startContainer,r=e.startOffset,3===n.nodeType&&e.collapsed&&(" "===n.data[r]?(n.deleteData(r,1),/[\u00a0| ]$/.test(t)||(t+=" ")):" "===n.data[r-1]&&(n.deleteData(r-1,1),/[\u00a0| ]$/.test(t)||(t=" "+t))),t}(e.selection.getRng(),t));var b,y={context:(i=h.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,y),!0===n.paste&&Ac(e.schema,u)&&Pc(g,i))return l=Dc(o,g,e.selection.getRng(),u),e.selection.setRng(l),void e.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(c=f,f=f.prev;f;f=f.walk(!0))if(3===f.type||!g.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),y.invalid){for($c(e,d),i=h.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)i=f,f=f.parentNode;t=i===a?a.innerHTML:g.getOuterHTML(i),t=o.serialize(r.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return o.serialize(u)})))),i===a?g.setHTML(a,t):g.setOuterHTML(i,t)}else!function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):$c(e,t)}}(e,t=o.serialize(u),i);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new Ic(r);$t.each(r.select("*[data-mce-fragment]"),(function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)}))}}(e,m),function(e,t){var n,r,o,i,a,u=e.dom,s=e.selection;if(t){if(e.selection.scrollIntoView(t),n=function(t){for(var n=e.getBody();t&&t!==n;t=t.parentNode)if("false"===e.dom.getContentEditable(t))return t;return null}(t))return u.remove(t),void s.select(n);var c=u.createRng();(i=t.previousSibling)&&3===i.nodeType?(c.setStart(i,i.nodeValue.length),le.ie||(a=t.nextSibling)&&3===a.nodeType&&(i.appendData(a.data),a.parentNode.removeChild(a))):(c.setStartBefore(t),c.setEndBefore(t)),r=u.getParent(t,u.isBlock),u.remove(t),r&&u.isEmpty(r)&&(e.$(r).empty(),c.setStart(r,0),c.setEnd(r,0),qc(r)||function(e){return!!e.getAttribute("data-mce-fragment")}(r)||!(o=function(t){var n=fu.fromRangeStart(t);if(n=As(e.getBody()).next(n))return n.toRange()}(c))?u.add(r,u.create("br",{"data-mce-bogus":"1"})):(c=o,u.remove(r))),s.setRng(c)}}(e,g.get("mce_marker")),b=e.getBody(),$t.each(b.getElementsByTagName("*"),(function(e){e.removeAttribute("data-mce-fragment")})),function(e,t){N.from(e.getParent(t,"td,th")).map(Xn.fromDom).each(Fc)}(e.dom,e.selection.getStart()),e.fire("SetContent",s),e.addVisual()}},Xc=function(e,t){var n=function(e){var t;return"string"!=typeof e?(t=$t.extend({paste:e.paste,data:{paste:e.paste}},e),{content:e.content,details:t}):{content:e,details:{}}}(t);Yc(e,n.content,n.details)},Kc=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Gc=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n}return r},Jc=function(e){return e.getParam("iframe_attrs",{})},Qc=function(e){return e.getParam("doctype","<!DOCTYPE html>")},Zc=function(e){return e.getParam("document_base_url","")},el=function(e){return Gc(e,"body_id","tinymce")},tl=function(e){return Gc(e,"body_class","")},nl=function(e){return e.getParam("content_security_policy","")},rl=function(e){return e.getParam("br_in_pre",!0)},ol=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},il=function(e){return e.getParam("forced_root_block_attrs",{})},al=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},ul=function(e){return e.getParam("no_newline_selector","")},sl=function(e){return e.getParam("keep_styles",!0)},cl=function(e){return e.getParam("end_container_on_empty_block",!1)},ll=function(e){return $t.explode(e.getParam("font_size_style_values",""))},fl=function(e){return $t.explode(e.getParam("font_size_classes",""))},dl=function(e){return e.getParam("images_dataimg_filter",i(!0),"function")},ml=function(e){return e.getParam("automatic_uploads",!0,"boolean")},hl=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},gl=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},pl=function(e){return e.getParam("images_upload_url","","string")},vl=function(e){return e.getParam("images_upload_base_path","","string")},bl=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},yl=function(e){return e.getParam("images_upload_handler",null,"function")},wl=function(e){return e.getParam("content_css_cors",!1,"boolean")},xl=function(e){return e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")},Cl=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?sa(n)?Ro.isText(n.nextSibling)?fu(n.nextSibling,0):fu.after(n):fa(t)?fu(n,r+1):t:sa(n)?Ro.isText(n.previousSibling)?fu(n.previousSibling,n.previousSibling.data.length):fu.before(n):da(t)?fu(n,r-1):t},Sl=u(Cl,!0),El=u(Cl,!1),kl={isInlineTarget:function(e,t){return Er(Xn.fromDom(t),xl(e))},findRootInline:function(e,t,n){var r=function(e,t,n){return V(li.DOM.getParents(n.container(),"*",t),e)}(e,t,n);return N.from(r[r.length-1])},isRtl:function(e){return"rtl"===li.DOM.getStyle(e,"direction",!0)||(t=e.textContent,Kc.test(t));var t},isAtZwsp:function(e){return fa(e)||da(e)},normalizePosition:Cl,normalizeForwards:Sl,normalizeBackwards:El,hasSameParentBlock:function(e,t,n){var r=us(t,e),o=us(n,e);return r&&r===o}},Nl=function(e,t){return Tr(e,t)?Hi(t,(function(e){return lo(e)||mo(e)}),function(e){return function(t){return Nr(e,Xn.fromDom(t.dom().parentNode))}}(e)):N.none()},Tl=function(e){e.dom.isEmpty(e.getBody())&&(e.setContent(""),function(e){var t=e.getBody(),n=t.firstChild&&e.dom.isBlock(t.firstChild)?t.firstChild:t;e.selection.setCursorLocation(n,0)}(e))},_l=function(e,t,n){return Wa(js.firstPositionIn(n),js.lastPositionIn(n),(function(r,o){var i=kl.normalizePosition(!0,r),a=kl.normalizePosition(!1,o),u=kl.normalizePosition(!1,t);return e?js.nextPosition(n,u).map((function(e){return e.isEqual(a)&&t.isEqual(i)})).getOr(!1):js.prevPosition(n,u).map((function(e){return e.isEqual(i)&&t.isEqual(a)})).getOr(!1)})).getOr(!0)},Rl=function(e,t){var n,r,o,i=Xn.fromDom(e),a=Xn.fromDom(t);return n=a,r="pre,code",o=u(Nr,i),zi(n,r,o).isSome()},Ol=function(e,t){return ka(t)&&!1===function(e,t){return Ro.isText(t)&&/^[ \t\r\n]*$/.test(t.data)&&!1===Rl(e,t)}(e,t)||function(e){return Ro.isElement(e)&&"A"===e.nodeName&&e.hasAttribute("name")}(t)||Al(t)},Al=Ro.hasAttribute("data-mce-bookmark"),Dl=Ro.hasAttribute("data-mce-bogus"),Pl=Ro.hasAttributeValue("data-mce-bogus","all"),Bl=function(e){return function(e){var t,n,r=0;if(Ol(e,e))return!1;if(!(n=e.firstChild))return!0;t=new to(n,e);do{if(Pl(n))n=t.next(!0);else if(Dl(n))n=t.next();else if(Ro.isBr(n))r++,n=t.next();else{if(Ol(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Il=vr("block","position"),Ml=vr("from","to"),Ll=function(e,t){var n=Xn.fromDom(e),r=Xn.fromDom(t.container());return Nl(n,r).map((function(e){return Il(e,t)}))},Fl=function(e,t,n){var r=Ll(e,fu.fromRangeStart(n)),o=r.bind((function(n){return js.fromPosition(t,e,n.position()).bind((function(n){return Ll(e,n).map((function(n){return function(e,t,n){return Ro.isBr(n.position().getNode())&&!1===Bl(n.block())?js.positionIn(!1,n.block().dom()).bind((function(r){return r.isEqual(n.position())?js.fromPosition(t,e,r).bind((function(t){return Ll(e,t)})):N.some(n)})).getOr(n):n}(e,t,n)}))}))}));return Wa(r,o,Ml).filter((function(e){return function(e){return!1===Nr(e.from().block(),e.to().block())}(e)&&function(e){return Or(e.from().block()).bind((function(t){return Or(e.to().block()).filter((function(e){return Nr(t,e)}))})).isSome()}(e)&&function(e){return!1===Ro.isContentEditableFalse(e.from().block().dom())&&!1===Ro.isContentEditableFalse(e.to().block().dom())}(e)}))},Hl=function(e,t,n){return n.collapsed?Fl(e,t,n):N.none()},zl=function(e,t,n){return Tr(t,e)?function(e,t){for(var n=P(t)?t:x,r=e.dom(),o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=Xn.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,(function(e){return n(e)||Nr(e,t)})).slice(0,-1):[]},Wl=function(e,t){return zl(e,t,i(!1))},jl=Wl,Ul=function(e,t){return[e].concat(Wl(e,t))},Vl=function(e){var t=Ir(e);return Y(t,uo).fold((function(){return t}),(function(e){return t.slice(0,e)}))},ql=function(e){var t=Vl(e);return j(t,Ei),t},$l=function(e,t){var n=Ul(t,e);return $(n.reverse(),Bl).each(Ei)},Yl=function(e,t,n,r){if(Bl(n))return Lc(n),js.firstPositionIn(n.dom());0===V(Pr(r),(function(e){return!Bl(e)})).length&&Bl(t)&&bi(r,Xn.fromTag("br"));var o=js.prevPosition(n.dom(),fu.before(r.dom()));return j(ql(t),(function(e){bi(r,e)})),$l(e,t),o},Xl=function(e,t,n){if(Bl(n))return Ei(n),Bl(t)&&Lc(t),js.firstPositionIn(t.dom());var r=js.lastPositionIn(n.dom());return j(ql(t),(function(e){xi(n,e)})),$l(e,t),r},Kl=function(e,t){return Tr(t,e)?function(e,t){var n=Ul(t,e);return N.from(n[n.length-1])}(t,e):N.none()},Gl=function(e,t){js.positionIn(e,t.dom()).map((function(e){return e.getNode()})).map(Xn.fromDom).filter(co).each(Ei)},Jl=function(e,t,n){return Gl(!0,t),Gl(!1,n),Kl(t,n).fold(u(Xl,e,t,n),u(Yl,e,t,n))},Ql=function(e,t,n,r){return t?Jl(e,r,n):Jl(e,n,r)},Zl=function(e,t){var n,r=Xn.fromDom(e.getBody());return(n=Hl(r.dom(),t,e.selection.getRng()).bind((function(e){return Ql(r,t,e.from().block(),e.to().block())}))).each((function(t){e.selection.setRng(t.toRange())})),n.isSome()},ef=function(e,t){var n=Xn.fromDom(t),r=u(Nr,e);return Fi(n,po,r).isSome()},tf=function(e,t){var n=js.prevPosition(e.dom(),fu.fromRangeStart(t)).isNone(),r=js.nextPosition(e.dom(),fu.fromRangeEnd(t)).isNone();return!function(e,t){return ef(e,t.startContainer)||ef(e,t.endContainer)}(e,t)&&n&&r},nf=function(e){var t=Xn.fromDom(e.getBody()),n=e.selection.getRng();return tf(t,n)?function(e){return e.setContent(""),e.selection.setCursorLocation(),!0}(e):function(e,t){var n=t.getRng();return Wa(Nl(e,Xn.fromDom(n.startContainer)),Nl(e,Xn.fromDom(n.endContainer)),(function(r,o){return!1===Nr(r,o)&&(n.deleteContents(),Ql(e,!0,r,o).each((function(e){t.setRng(e.toRange())})),!0)})).getOr(!1)}(t,e.selection)},rf=function(e,t){return!e.selection.isCollapsed()&&nf(e)},of=function(e){if(!O(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],r={};return j(e,(function(o,i){var a=nr(o);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],s=o[u];if(void 0!==r[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!O(s))throw new Error("case arguments must be an array");t.push(u),r[u]=function(){var r=arguments.length;if(r!==s.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+s.length+" ("+s+"), got "+r);for(var o=new Array(r),a=0;a<o.length;a++)o[a]=arguments[a];var c=function(e){var n=nr(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!K(t,(function(e){return H(n,e)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[u].apply(null,o)};return{fold:function(){if(arguments.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+arguments.length);var t=arguments[i];return t.apply(null,o)},match:c,log:function(e){n.console.log(e,{constructors:t,constructor:u,params:o})}}}})),r},af=function(e){return bs(e).exists(co)},uf=function(e,t,n){var r=V(Ul(Xn.fromDom(n.container()),t),uo),o=J(r).getOr(t);return js.fromPosition(e,o.dom(),n).filter(af)},sf=function(e,t){return bs(t).exists(co)||uf(!0,e,t).isSome()},cf=function(e,t){return function(e){return N.from(e.getNode(!0)).map(Xn.fromDom)}(t).exists(co)||uf(!1,e,t).isSome()},lf=u(uf,!1),ff=u(uf,!0),df=(jc=" ",function(e){return jc===e}),mf=function(e){return/^[\r\n\t ]$/.test(e)},hf=function(e){return!mf(e)&&!df(e)},gf=function(e,t,n){return N.from(n.container()).filter(Ro.isText).exists((function(r){var o=e?0:-1;return t(r.data.charAt(n.offset()+o))}))},pf=u(gf,!0,mf),vf=u(gf,!1,mf),bf=function(e){var t=e.container();return Ro.isText(t)&&0===t.data.length},yf=function(e,t){var n=cs(e,t);return Ro.isContentEditableFalse(n)&&!Ro.isBogusAll(n)},wf=u(yf,0),xf=u(yf,-1),Cf=function(e,t){return Ro.isTable(cs(e,t))},Sf=u(Cf,0),Ef=u(Cf,-1),kf=of([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Nf=function(e,t,n,r){var o=r.getNode(!1===t);return Nl(Xn.fromDom(e),Xn.fromDom(n.getNode())).map((function(e){return Bl(e)?kf.remove(e.dom()):kf.moveToElement(o)})).orThunk((function(){return N.some(kf.moveToElement(o))}))},Tf=function(e,t,n){return js.fromPosition(t,e,n).bind((function(r){return function(e){return po(Xn.fromDom(e))||mo(Xn.fromDom(e))}(r.getNode())?N.none():function(e,t,n,r){var o=function(t){return so(Xn.fromDom(t))&&!ss(n,r,e)};return ps(!t,n).fold((function(){return ps(t,r).fold(i(!1),o)}),o)}(e,t,n,r)?N.none():t&&Ro.isContentEditableFalse(r.getNode())?Nf(e,t,n,r):!1===t&&Ro.isContentEditableFalse(r.getNode(!0))?Nf(e,t,n,r):t&&xf(n)?N.some(kf.moveToPosition(r)):!1===t&&wf(n)?N.some(kf.moveToPosition(r)):N.none()}))},_f=function(e,t,n){return function(e,t){var n=t.getNode(!1===e),r=e?"after":"before";return Ro.isElement(n)&&n.getAttribute("data-mce-caret")===r}(t,n)?function(e,t){return e&&Ro.isContentEditableFalse(t.nextSibling)?N.some(kf.moveToElement(t.nextSibling)):!1===e&&Ro.isContentEditableFalse(t.previousSibling)?N.some(kf.moveToElement(t.previousSibling)):N.none()}(t,n.getNode(!1===t)).fold((function(){return Tf(e,t,n)}),N.some):Tf(e,t,n).bind((function(t){return function(e,t,n){return n.fold((function(e){return N.some(kf.remove(e))}),(function(e){return N.some(kf.moveToElement(e))}),(function(n){return ss(t,n,e)?N.none():N.some(kf.moveToPosition(n))}))}(e,n,t)}))},Rf=function(e,t,n){if(0!==n){var r=e.data.slice(t,t+n),o=t+n>=e.data.length,i=0===t;e.replaceData(t,n,function(e,t,n){return q(e.split(""),(function(r,o){return function(e){return-1!==" \f\n\r\t\v".indexOf(e)}(o)||" "===o?r.previousCharIsSpace||""===r.str&&t||r.str.length===e.length-1&&n?{previousCharIsSpace:!1,str:r.str+" "}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(r,i,o))}},Of=function(e,t){var n,r=e.data.slice(t),o=r.length-(n=r,n.replace(/^\s+/g,"")).length;return Rf(e,t,o)},Af=function(e,t){return function(e,t){var n=e.container(),r=e.offset();return!1===fu.isTextPosition(e)&&n===t.parentNode&&r>fu.before(t).offset()}(t,e)?fu(t.container(),t.offset()-1):t},Df=function(e){return ka(e.previousSibling)?N.some(function(e){return Ro.isText(e)?fu(e,e.data.length):fu.after(e)}(e.previousSibling)):e.previousSibling?js.lastPositionIn(e.previousSibling):N.none()},Pf=function(e){return ka(e.nextSibling)?N.some(function(e){return Ro.isText(e)?fu(e,0):fu.before(e)}(e.nextSibling)):e.nextSibling?js.firstPositionIn(e.nextSibling):N.none()},Bf=function(e,t){return Df(t).orThunk((function(){return Pf(t)})).orThunk((function(){return function(e,t){var n=fu.before(t.previousSibling?t.previousSibling:t.parentNode);return js.prevPosition(e,n).fold((function(){return js.nextPosition(e,fu.after(t))}),N.some)}(e,t)}))},If=function(e,t){return Pf(t).orThunk((function(){return Df(t)})).orThunk((function(){return function(e,t){return js.nextPosition(e,fu.after(t)).fold((function(){return js.prevPosition(e,fu.before(t))}),N.some)}(e,t)}))},Mf=function(e,t,n){return function(e,t,n){return e?If(t,n):Bf(t,n)}(e,t,n).map(u(Af,n))},Lf=function(e,t,n){n.fold((function(){e.focus()}),(function(n){e.selection.setRng(n.toRange(),t)}))},Ff=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(Qn(t))},Hf=function(e){if(Bl(e)){var t=Xn.fromHtml('<br data-mce-bogus="1">');return Si(e),xi(e,t),N.some(fu.before(t.dom()))}return N.none()},zf=function(e,t,n){var r=Ar(e).filter(tr),o=Dr(e).filter(tr);return Ei(e),function(e,t,n,r){return e.isSome()&&t.isSome()&&n.isSome()?N.some(r(e.getOrDie(),t.getOrDie(),n.getOrDie())):N.none()}(r,o,t,(function(e,t,r){var o=e.dom(),i=t.dom(),a=o.data.length;return function(e,t,n){var r=Hn(e.data).length;e.appendData(t.data),Ei(Xn.fromDom(t)),n&&Of(e,r)}(o,i,n),r.container()===i?fu(o,a):r})).orThunk((function(){return n&&(r.each((function(e){return function(e,t){var n=e.data.slice(0,t),r=n.length-Hn(n).length;return Rf(e,t-r,r)}(e.dom(),e.dom().length)})),o.each((function(e){return Of(e.dom(),0)}))),t}))},Wf=function(e,t,n,r){void 0===r&&(r=!0);var o,i=Mf(t,e.getBody(),n.dom()),a=Fi(n,u(Ff,e),(o=e.getBody(),function(e){return e.dom()===o})),s=zf(n,i,function(e,t){return ur(e.schema.getTextInlineElements(),Qn(t))}(e,n));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):a.bind(Hf).fold((function(){r&&Lf(e,t,s)}),(function(n){r&&Lf(e,t,N.some(n))}))},jf=function(e,t){return function(e,t,n){var r=gs(t?1:-1,e,n),o=fu.fromRangeStart(r),i=Xn.fromDom(e);return!1===t&&xf(o)?N.some(kf.remove(o.getNode(!0))):t&&wf(o)?N.some(kf.remove(o.getNode())):!1===t&&wf(o)&&cf(i,o)?lf(i,o).map((function(e){return kf.remove(e.getNode())})):t&&xf(o)&&sf(i,o)?ff(i,o).map((function(e){return kf.remove(e.getNode())})):_f(e,t,o)}(e.getBody(),t,e.selection.getRng()).map((function(n){return n.fold(function(e,t){return function(n){return e._selectionOverrides.hideFakeCaret(),Wf(e,t,Xn.fromDom(n)),!0}}(e,t),function(e,t){return function(n){var r=t?fu.before(n):fu.after(n);return e.selection.setRng(r.toRange()),!0}}(e,t),function(e){return function(t){return e.selection.setRng(t.toRange()),!0}}(e))})).getOr(!1)},Uf=function(e,t){var n,r=e.selection.getNode();return!!Ro.isContentEditableFalse(r)&&(n=Xn.fromDom(e.getBody()),j(Mi(n,".mce-offscreen-selection"),Ei),Wf(e,t,Xn.fromDom(e.selection.getNode())),Tl(e),!0)},Vf=function(e,t){return e.selection.isCollapsed()?jf(e,t):Uf(e,t)},qf=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(Ro.isContentEditableTrue(t)||Ro.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return Ro.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(fu.before(t).toRange())),!0},$f=Ro.isText,Yf=function(e){return $f(e)&&e.data[0]===ra},Xf=function(e){return $f(e)&&e.data[e.data.length-1]===ra},Kf=function(e){return e.ownerDocument.createTextNode(ra)},Gf=function(e,t){return e?function(e){if($f(e.previousSibling))return Xf(e.previousSibling)?e.previousSibling:(e.previousSibling.appendData(ra),e.previousSibling);if($f(e))return Yf(e)?e:(e.insertData(0,ra),e);var t=Kf(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if($f(e.nextSibling))return Yf(e.nextSibling)?e.nextSibling:(e.nextSibling.insertData(0,ra),e.nextSibling);if($f(e))return Xf(e)?e:(e.appendData(ra),e);var t=Kf(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},Jf=u(Gf,!0),Qf=u(Gf,!1),Zf=function(e,t){return Ro.isText(e.container())?Gf(t,e.container()):Gf(t,e.getNode())},ed=function(e,t){var n=t.get();return n&&e.container()===n&&sa(n)},td=function(e,t){return t.fold((function(t){Vu.remove(e.get());var n=Jf(t);return e.set(n),N.some(fu(n,n.length-1))}),(function(t){return js.firstPositionIn(t).map((function(t){if(ed(t,e))return fu(e.get(),1);Vu.remove(e.get());var n=Zf(t,!0);return e.set(n),fu(n,1)}))}),(function(t){return js.lastPositionIn(t).map((function(t){if(ed(t,e))return fu(e.get(),e.get().length-1);Vu.remove(e.get());var n=Zf(t,!1);return e.set(n),fu(n,n.length-1)}))}),(function(t){Vu.remove(e.get());var n=Qf(t);return e.set(n),N.some(fu(n,1))}))},nd=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return N.none()},rd=of([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),od=function(e,t){var n=us(t,e);return n||e},id=function(e,t,n){var r=kl.normalizeForwards(n),o=od(t,r.container());return kl.findRootInline(e,o,r).fold((function(){return js.nextPosition(o,r).bind(u(kl.findRootInline,e,o)).map((function(e){return rd.before(e)}))}),N.none)},ad=function(e,t){return null===Bu(e,t)},ud=function(e,t,n){return kl.findRootInline(e,t,n).filter(u(ad,t))},sd=function(e,t,n){var r=kl.normalizeBackwards(n);return ud(e,t,r).bind((function(e){return js.prevPosition(e,r).isNone()?N.some(rd.start(e)):N.none()}))},cd=function(e,t,n){var r=kl.normalizeForwards(n);return ud(e,t,r).bind((function(e){return js.nextPosition(e,r).isNone()?N.some(rd.end(e)):N.none()}))},ld=function(e,t,n){var r=kl.normalizeBackwards(n),o=od(t,r.container());return kl.findRootInline(e,o,r).fold((function(){return js.prevPosition(o,r).bind(u(kl.findRootInline,e,o)).map((function(e){return rd.after(e)}))}),N.none)},fd=function(e){return!1===kl.isRtl(md(e))},dd=function(e,t,n){return nd([id,sd,cd,ld],[e,t,n]).filter(fd)},md=function(e){return e.fold(a,a,a,a)},hd=function(e){return e.fold(i("before"),i("start"),i("end"),i("after"))},gd=function(e){return e.fold(rd.before,rd.before,rd.after,rd.after)},pd=function(e,t,n,r,o,i){return Wa(kl.findRootInline(t,n,r),kl.findRootInline(t,n,o),(function(t,r){return t!==r&&kl.hasSameParentBlock(n,t,r)?rd.after(e?t:r):i})).getOr(i)},vd=function(e,t){return e.fold(i(!0),(function(e){return r=t,!(hd(n=e)===hd(r)&&md(n)===md(r));var n,r}))},bd=function(e,t){return e?t.fold(o(N.some,rd.start),N.none,o(N.some,rd.after),N.none):t.fold(N.none,o(N.some,rd.before),N.none,o(N.some,rd.end))},yd=function(e,t,n,r){var o=kl.normalizePosition(e,r),i=dd(t,n,o);return dd(t,n,o).bind(u(bd,e)).orThunk((function(){return function(e,t,n,r,o){var i=kl.normalizePosition(e,o);return js.fromPosition(e,n,i).map(u(kl.normalizePosition,e)).fold((function(){return r.map(gd)}),(function(o){return dd(t,n,o).map(u(pd,e,t,n,i,o)).filter(u(vd,r))})).filter(fd)}(e,t,n,i,r)}))},wd=dd,xd=yd,Cd=(u(yd,!1),u(yd,!0),gd),Sd=function(e){return e.fold(rd.start,rd.start,rd.end,rd.end)},Ed=function(e){return P(e.selection.getSel().modify)},kd=function(e,t,n){var r=e?1:-1;return t.setRng(fu(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},Nd=function(e,t){var n=t.selection.getRng(),r=e?fu.fromRangeEnd(n):fu.fromRangeStart(n);return!!Ed(t)&&(e&&fa(r)?kd(!0,t.selection,r):!(e||!da(r))&&kd(!1,t.selection,r))},Td=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},_d=function(e){return!1!==e.settings.inline_boundaries},Rd=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},Od=function(e,t,n){return td(t,n).map((function(t){return Td(e,t),n}))},Ad=function(e,t,n){return function(){return!!_d(t)&&Nd(e,t)}},Dd=u(Ad,!0),Pd=u(Ad,!1),Bd={move:function(e,t,n){return function(){return!!_d(e)&&function(e,t,n){var r=e.getBody(),o=fu.fromRangeStart(e.selection.getRng()),i=u(kl.isInlineTarget,e);return xd(n,i,r,o).bind((function(n){return Od(e,t,n)}))}(e,t,n).isSome()}},moveNextWord:Dd,movePrevWord:Pd,setupSelectedState:function(e){var t=Ti(null),n=u(kl.isInlineTarget,e);return e.on("NodeChange",(function(r){_d(e)&&(function(e,t,n){var r=V(t.select('*[data-mce-selected="inline-boundary"]'),e),o=V(n,e);j(G(r,o),u(Rd,!1)),j(G(o,r),u(Rd,!0))}(n,e.dom,r.parents),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=fu.fromRangeStart(e.selection.getRng());fu.isTextPosition(n)&&!1===kl.isAtZwsp(n)&&(Td(e,Vu.removeAndReposition(t.get(),n)),t.set(null))}}(e,t),function(e,t,n,r){if(t.selection.isCollapsed()){var o=V(r,e);j(o,(function(r){var o=fu.fromRangeStart(t.selection.getRng());wd(e,t.getBody(),o).bind((function(e){return Od(t,n,e)}))}))}}(n,e,t,r.parents))})),t},setCaretPosition:Td},Id=function(e,t){return function(n){return td(t,n).map((function(t){return Bd.setCaretPosition(e,t),!0})).getOr(!1)}},Md=function(e,t,r,o){var i=e.getBody(),a=u(kl.isInlineTarget,e);e.undoManager.ignore((function(){e.selection.setRng(function(e,t){var r=n.document.createRange();return r.setStart(e.container(),e.offset()),r.setEnd(t.container(),t.offset()),r}(r,o)),e.execCommand("Delete"),wd(a,i,fu.fromRangeStart(e.selection.getRng())).map(Sd).map(Id(e,t))})),e.nodeChanged()},Ld=function(e,t,n,r){var o=function(e,t){var n=us(t,e);return n||e}(e.getBody(),r.container()),a=u(kl.isInlineTarget,e),s=wd(a,o,r);return s.bind((function(e){return n?e.fold(i(N.some(Sd(e))),N.none,i(N.some(Cd(e))),N.none):e.fold(N.none,i(N.some(Cd(e))),N.none,i(N.some(Sd(e))))})).map(Id(e,t)).getOrThunk((function(){var i=js.navigate(n,o,r),u=i.bind((function(e){return wd(a,o,e)}));return s.isSome()&&u.isSome()?kl.findRootInline(a,o,r).map((function(t){return!!function(e){return Wa(js.firstPositionIn(e),js.lastPositionIn(e),(function(t,n){var r=kl.normalizePosition(!0,t),o=kl.normalizePosition(!1,n);return js.nextPosition(e,r).map((function(e){return e.isEqual(o)})).getOr(!0)})).getOr(!0)}(t)&&(Wf(e,n,Xn.fromDom(t)),!0)})).getOr(!1):u.bind((function(o){return i.map((function(o){return n?Md(e,t,r,o):Md(e,t,o,r),!0}))})).getOr(!1)}))},Fd=function(e,t,n){if(e.selection.isCollapsed()&&function(e){return!1!==e.settings.inline_boundaries}(e)){var r=fu.fromRangeStart(e.selection.getRng());return Ld(e,t,n,r)}return!1},Hd=vr("start","end"),zd=vr("rng","table","cells"),Wd=of([{removeTable:["element"]},{emptyCells:["cells"]}]),jd=function(e,t){return ji(Xn.fromDom(e),"td,th",t)},Ud=function(e,t){return zi(e,"table",t)},Vd=function(e){return!1===Nr(e.start(),e.end())},qd=function(e,t){return Ud(e.start(),t).bind((function(n){return Ud(e.end(),t).bind((function(e){return Nr(n,e)?N.some(n):N.none()}))}))},$d=function(e){return Mi(e,"td,th")},Yd=function(e,t){var n=jd(t.startContainer,e),r=jd(t.endContainer,e);return t.collapsed?N.none():Wa(n,r,Hd).fold((function(){return n.fold((function(){return r.bind((function(t){return Ud(t,e).bind((function(e){return J($d(e)).map((function(e){return Hd(e,t)}))}))}))}),(function(t){return Ud(t,e).bind((function(e){return Q($d(e)).map((function(e){return Hd(t,e)}))}))}))}),(function(t){return Xd(e,t)?N.none():function(e,t){return Ud(e.start(),t).bind((function(t){return Q($d(t)).map((function(t){return Hd(e.start(),t)}))}))}(t,e)}))},Xd=function(e,t){return qd(t,e).isSome()},Kd=function(e,t){var n=function(e){return u(Nr,e)}(e);return function(e,t){var n=jd(e.startContainer,t),r=jd(e.endContainer,t);return Wa(n,r,Hd).filter(Vd).filter((function(e){return Xd(t,e)})).orThunk((function(){return Yd(t,e)}))}(t,n).bind((function(e){return function(e,t){return qd(e,t).map((function(t){return zd(e,t,$d(t))}))}(e,n)}))},Gd=function(e,t){return Y(e,(function(e){return Nr(e,t)}))},Jd=function(e){return function(e){return Wa(Gd(e.cells(),e.rng().start()),Gd(e.cells(),e.rng().end()),(function(t,n){return e.cells().slice(t,n+1)}))}(e).map((function(t){var n=e.cells();return t.length===n.length?Wd.removeTable(e.table()):Wd.emptyCells(t)}))},Qd=function(e,t){return Kd(e,t).bind(Jd)},Zd=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},em=Zd,tm=function(e){return X(e,(function(e){var t=La(e);return t?[Xn.fromDom(t)]:[]}))},nm=function(e){return Zd(e).length>1},rm=function(e){return V(tm(e),po)},om=function(e){return Mi(e,"td[data-mce-selected],th[data-mce-selected]")},im=function(e,t){var n=om(t),r=rm(e);return n.length>0?n:r},am=im,um=function(e){return im(em(e.selection.getSel()),Xn.fromDom(e.getBody()))},sm=function(e,t){return j(t,Lc),e.selection.setCursorLocation(t[0].dom(),0),!0},cm=function(e,t){return Wf(e,!1,t),!0},lm=function(e,t,n,r){return dm(t,r).fold((function(){return function(e,t,n){return Qd(t,n).map((function(t){return t.fold(u(cm,e),u(sm,e))}))}(e,t,n)}),(function(t){return function(e,t){return mm(e,t)}(e,t)})).getOr(!1)},fm=function(e,t){return $(Ul(t,e),po)},dm=function(e,t){return $(Ul(t,e),(function(e){return"caption"===Qn(e)}))},mm=function(e,t){return Lc(t),e.selection.setCursorLocation(t.dom(),0),N.some(!0)},hm=function(e,t,n,r,o){return js.navigate(n,e.getBody(),o).bind((function(i){return function(e,t,n,r){return js.firstPositionIn(e.dom()).bind((function(o){return js.lastPositionIn(e.dom()).map((function(e){return t?n.isEqual(o)&&r.isEqual(e):n.isEqual(e)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(e,t){return mm(e,t)}(e,r):function(e,t,n){return dm(e,Xn.fromDom(n.getNode())).map((function(e){return!1===Nr(e,t)}))}(t,r,i)})).or(N.some(!0))},gm=function(e,t,n,r){var o=fu.fromRangeStart(e.selection.getRng());return fm(n,r).bind((function(r){return Bl(r)?mm(e,r):function(e,t,n,r,o){return js.navigate(n,e.getBody(),o).bind((function(e){return fm(t,Xn.fromDom(e.getNode())).map((function(e){return!1===Nr(e,r)}))}))}(e,n,t,r,o)}))},pm=function(e,t,n){var r=Xn.fromDom(e.getBody());return dm(r,n).fold((function(){return gm(e,t,r,n)}),(function(n){return function(e,t,n,r){var o=fu.fromRangeStart(e.selection.getRng());return Bl(r)?mm(e,r):hm(e,n,t,r,o)}(e,t,r,n)})).getOr(!1)},vm=function(e,t){var n=Xn.fromDom(e.selection.getStart(!0)),r=um(e);return e.selection.isCollapsed()&&0===r.length?pm(e,t,n):function(e,t){var n=Xn.fromDom(e.getBody()),r=e.selection.getRng(),o=um(e);return 0!==o.length?sm(e,o):lm(e,n,r,t)}(e,n)},bm=nc.isEq,ym=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&e.dom.is(t,r[o].selector))return!0;return!1},wm=function(e,t,n,r){var o=e.dom.getRoot();return t!==o&&(t=e.dom.getParent(t,(function(t){return!!ym(e,t,n)||t.parentNode===o||!!Sm(e,t,n,r,!0)})),Sm(e,t,n,r))},xm=function(e,t,n){return!!bm(t,n.inline)||!!bm(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)},Cm=function(e,t,n,r,o,i){var a,u,s,c=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(c)if(void 0===c.length){for(a in c)if(c.hasOwnProperty(a)){if(u="attributes"===r?e.getAttrib(t,a):nc.getStyle(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!bm(u,nc.normalizeStyleValue(e,nc.replaceVars(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?e.getAttrib(t,c[s]):nc.getStyle(e,t,c[s]))return n;return n},Sm=function(e,t,n,r,o){var i,a,u,s,c=e.formatter.get(n),l=e.dom;if(c&&t)for(a=0;a<c.length;a++)if(i=c[a],xm(e.dom,t,i)&&Cm(l,t,i,"attributes",o,r)&&Cm(l,t,i,"styles",o,r)){if(s=i.classes)for(u=0;u<s.length;u++)if(!e.dom.hasClass(t,s[u]))return;return i}},Em={matchNode:Sm,matchName:xm,match:function(e,t,n,r){var o;return r?wm(e,r,t,n):(r=e.selection.getNode(),!!wm(e,r,t,n)||!((o=e.selection.getStart())===r||!wm(e,o,t,n)))},matchAll:function(e,t,n){var r,o=[],i={};return r=e.selection.getStart(),e.dom.getParent(r,(function(r){var a,u;for(a=0;a<t.length;a++)u=t[a],!i[u]&&Sm(e,r,u,n)&&(i[u]=!0,o.push(u))}),e.dom.getRoot()),o},canApply:function(e,t){var n,r,o,i,a,u=e.formatter.get(t),s=e.dom;if(u)for(n=e.selection.getStart(),r=nc.getParents(s,n),i=u.length-1;i>=0;i--){if(!(a=u[i].selector)||u[i].defaultBlock)return!0;for(o=r.length-1;o>=0;o--)if(s.is(r[o],a))return!0}return!1},matchesUnInheritedFormatSelector:ym},km=function(e,t){return e.splitText(t)},Nm=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Ro.isText(t)?n>0&&n<t.nodeValue.length&&(t=(r=km(t,n)).previousSibling,o>n?(t=r=km(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Ro.isText(t)&&n>0&&n<t.nodeValue.length&&(t=km(t,n),n=0),Ro.isText(r)&&o>0&&o<r.nodeValue.length&&(o=(r=km(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},Tm=ra,_m=function(e){return function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==Tm||e.childNodes.length>1)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length>0},Rm=function(e){var t;if(e)for(e=(t=new to(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},Om=function(e){var t=Xn.fromTag("span");return fr(t,{id:"_mce_caret","data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&xi(t,Xn.fromText(Tm)),t},Am=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(_m(t))Wf(e,!1,Xn.fromDom(t),n);else{var i=o.getRng(),a=r.getParent(t,r.isBlock),u=function(e){var t=Rm(e);return t&&t.nodeValue.charAt(0)===Tm&&t.deleteData(0,1),t}(t);i.startContainer===u&&i.startOffset>0&&i.setStart(u,i.startOffset-1),i.endContainer===u&&i.endOffset>0&&i.setEnd(u,i.endOffset-1),r.remove(t,!0),a&&r.isEmpty(a)&&Lc(Xn.fromDom(a)),o.setRng(i)}},Dm=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)Am(e,t,n);else if(!(t=Bu(e.getBody(),o.getStart())))for(;t=r.get("_mce_caret");)Am(e,t,!1)},Pm=function(e,t,n){var r=e.dom,o=r.getParent(n,u(nc.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Mc(Xn.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},Bm=function(e,t){return e.appendChild(t),t},Im=function(e,t){var n=function(e,t,n){return function(e,t){for(var n=e.length-1;n>=0;n--)t(e[n],n)}(e,(function(e){n=t(n,e)})),n}(e,(function(e,t){return Bm(e,t.cloneNode(!1))}),t);return Bm(n,n.ownerDocument.createTextNode(Tm))},Mm=function(e){e.on("mouseup keydown",(function(t){!function(e,t){var n=e.selection,r=e.getBody();Dm(e,null,!1),8!==t&&46!==t||!n.isCollapsed()||n.getStart().innerHTML!==Tm||Dm(e,Bu(r,n.getStart())),37!==t&&39!==t||Dm(e,Bu(r,n.getStart()))}(e,t.keyCode)}))},Lm=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(Qn(t))&&!Pu(t.dom())&&!Ro.isBogus(t.dom())},Fm=function(e){return 1===Ir(e).length},Hm=function(e,t,n,r){var o=u(Lm,t),i=W(V(r,o),(function(e){return e.dom()}));if(0===i.length)Wf(t,e,n);else{var a=function(e,t){var n=Om(!1),r=Im(t,n.dom());return bi(Xn.fromDom(e),n),Ei(Xn.fromDom(e)),fu(r,0)}(n.dom(),i);t.selection.setRng(a.toRange())}},zm=function(e,t){var n=Xn.fromDom(e.getBody()),r=Xn.fromDom(e.selection.getStart()),o=V(function(e,t){var n=Ul(t,e);return Y(n,uo).fold(i(n),(function(e){return n.slice(0,e)}))}(n,r),Fm);return Q(o).map((function(n){var r,i=fu.fromRangeStart(e.selection.getRng());return!(!_l(t,i,n.dom())||(r=n,Pu(r.dom())&&_m(r.dom()))||(Hm(t,e,n,o),0))})).getOr(!1)},Wm=function(e,t){return!!e.selection.isCollapsed()&&zm(e,t)},jm=function(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}},Um=function(e,t,n){var r,o,i,a,u=e.dom,s=u.getRoot(),c=0;if(!function(e,t,n){var r={elm:t,alignToTop:n};return e.fire("scrollIntoView",r),r.isDefaultPrevented()}(e,t,n)&&Ro.isElement(t)){if(!1===n&&(c=t.offsetHeight),"BODY"!==s.nodeName){var l=e.selection.getScrollContainer();if(l)return r=jm(t).y-jm(l).y+c,a=l.clientHeight,void((r<(i=l.scrollTop)||r+25>i+a)&&(l.scrollTop=r<i?r:r-a+25))}o=u.getViewPort(e.getWin()),r=u.getPos(t).y+c,i=o.y,a=o.h,(r<o.y||r+25>i+a)&&e.getWin().scrollTo(0,r<i?r:r-a+25)}},Vm=function(e,t){J(cu.fromRangeStart(t).getClientRects()).each((function(t){var n,r,o=function(e){if(e.inline)return e.getBody().getBoundingClientRect();var t=e.getWin();return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight,width:t.innerWidth,height:t.innerHeight}}(e),i={x:Ia(n=o,r=t),y:Ma(n,r)};!function(e,t,n){e.inline?(e.getBody().scrollLeft+=t,e.getBody().scrollTop+=n):e.getWin().scrollBy(t,n)}(e,0!==i.x?i.x>0?i.x+4:i.x-4:0,0!==i.y?i.y>0?i.y+4:i.y-4:0)}))},qm=Ro.isContentEditableTrue,$m=Ro.isContentEditableFalse,Ym=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},Xm=function(e,t){return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:function(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}(t)},Km=function(e,t,n){var r=gs(1,e.getBody(),t),o=fu.fromRangeStart(r),i=o.getNode();if($m(i))return Ym(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if($m(a))return Ym(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),(function(e){return $m(e)||qm(e)}));return $m(u)?Ym(1,e,u,!1,n):null},Gm=function(e,t,n){if(!t||!t.collapsed)return t;var r=Km(e,t,n);return r||t},Jm=function(e,t){e.selection.setRng(t),Vm(e,e.selection.getRng())},Qm=function(e,t,n,r,o,i){var a=Ym(r,e,i.getNode(!o),o,!0);if(t.collapsed){var u=t.cloneRange();o?u.setEnd(a.startContainer,a.startOffset):u.setStart(a.endContainer,a.endOffset),u.deleteContents()}else t.deleteContents();return e.selection.setRng(a),function(e,t){Ro.isText(t)&&0===t.data.length&&e.remove(t)}(e.dom,n),!0},Zm=function(e,t){return function(e,t){var n=e.selection.getRng();if(!Ro.isText(n.commonAncestorContainer))return!1;var r=t?lu.Forwards:lu.Backwards,o=As(e.getBody()),i=u(ys,o.next),a=u(ys,o.prev),s=t?i:a,c=t?wf:xf,l=vs(r,e.getBody(),n),f=kl.normalizePosition(t,s(l));if(!f)return!1;if(c(f))return Qm(e,n,l.getNode(),r,t,f);var d=s(f);return!!(d&&c(d)&&ws(f,d))&&Qm(e,n,l.getNode(),r,t,d)}(e,t)},eh=function(e,t){e.getDoc().execCommand(t,!1,null)},th=function(e){Vf(e,!1)||Zm(e,!1)||Fd(e,!1)||Zl(e,!1)||vm(e)||rf(e,!1)||Wm(e,!1)||(eh(e,"Delete"),Tl(e))},nh=function(e){Vf(e,!0)||Zm(e,!0)||Fd(e,!0)||Zl(e,!0)||vm(e)||rf(e,!0)||Wm(e,!0)||eh(e,"ForwardDelete")},rh=function(e,t,n){var r=function(t){return function(e,t){var n=e.dom(),r=pr(n,t);return N.from(r).filter((function(e){return e.length>0}))}(t,e)};return Hi(Xn.fromDom(n),(function(e){return r(e).isSome()}),(function(e){return Nr(Xn.fromDom(t),e)})).bind(r)},oh=function(e){return function(t,n){return N.from(n).map(Xn.fromDom).filter(er).bind((function(n){return rh(e,t,n.dom()).or(function(e,t){return N.from(li.DOM.getStyle(t,e,!0))}(e,n.dom()))})).getOr("")}},ih={getFontSize:oh("font-size"),getFontFamily:o((function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),oh("font-family")),toPt:function(e,t){return/[0-9.]+px$/.test(e)?function(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}(72*parseInt(e,10)/96,t||0)+"pt":e}},ah=function(e){return js.firstPositionIn(e.getBody()).map((function(e){var t=e.container();return Ro.isText(t)?t.parentNode:t}))},uh=function(e){return N.from(e.selection.getRng()).bind((function(t){return function(e,t){return e.startContainer===t&&0===e.startOffset}(t,e.getBody())?N.none():N.from(e.selection.getStart(!0))}))},sh=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(n>=1&&n<=7){var r=ll(e),o=fl(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},ch=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},lh=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},fh=function(e,t,n){return lh(e,t,(function(e){return e.nodeName===n}))},dh=function(e){return e&&"TABLE"===e.nodeName},mh=function(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)},hh=function(e,t){return ca(e)&&!1===lh(e,t,Pu)},gh=function(e,t,n){for(var r=new to(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(Ro.isBr(t))return!0},ph=function(e,t,n,r,o){var i,a,u,s,c=e.getRoot(),l=e.schema.getNonEmptyElements();if(u=e.getParent(o.parentNode,e.isBlock)||c,r&&Ro.isBr(o)&&t&&e.isEmpty(u))return N.some(cu(o.parentNode,e.nodeIndex(o)));for(i=new to(o,u);s=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(s)||hh(s,c))return N.none();if(Ro.isText(s)&&s.nodeValue.length>0)return!1===fh(s,c,"A")?N.some(cu(s,r?s.nodeValue.length:0)):N.none();if(e.isBlock(s)||l[s.nodeName.toLowerCase()])return N.none();a=s}return n&&a?N.some(cu(a,0)):N.none()},vh=function(e,t,n,r){var o,i,a,u,s,c,l,f=e.getRoot(),d=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],l=Ro.isElement(o)&&i===o.childNodes.length,s=e.schema.getNonEmptyElements(),c=n,ca(o))return N.none();if(Ro.isElement(o)&&i>o.childNodes.length-1&&(c=!1),Ro.isDocument(o)&&(o=f,i=0),o===f){if(c&&(u=o.childNodes[i>0?i-1:0])){if(ca(u))return N.none();if(s[u.nodeName]||dh(u))return N.none()}if(o.hasChildNodes()){if(i=Math.min(!c&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Ro.isText(o)&&l?o.data.length:0,!t&&o===f.lastChild&&dh(o))return N.none();if(function(e,t){for(;t&&t!==e;){if(Ro.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(f,o)||ca(o))return N.none();if(o.hasChildNodes()&&!1===dh(o)){u=o,a=new to(o,f);do{if(Ro.isContentEditableFalse(u)||ca(u)){d=!1;break}if(Ro.isText(u)&&u.nodeValue.length>0){i=c?0:u.nodeValue.length,o=u,d=!0;break}if(s[u.nodeName.toLowerCase()]&&!mh(u)){i=e.nodeIndex(u),o=u.parentNode,c||i++,d=!0;break}}while(u=c?a.next():a.prev())}}}return t&&(Ro.isText(o)&&0===i&&ph(e,l,t,!0,o).each((function(e){o=e.container(),i=e.offset(),d=!0})),Ro.isElement(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Ro.isBr(u)||function(e,t){return e.previousSibling&&e.previousSibling.nodeName===t}(u,"A")||gh(e,u,!1)||gh(e,u,!0)||ph(e,l,t,!0,u).each((function(e){o=e.container(),i=e.offset(),d=!0})))),c&&!t&&Ro.isText(o)&&i===o.nodeValue.length&&ph(e,l,t,!1,o).each((function(e){o=e.container(),i=e.offset(),d=!0})),d?N.some(cu(o,i)):N.none()},bh=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=cu.fromRangeStart(t);return vh(e,n,!0,r).each((function(e){n&&cu.isAbove(o,e)||r.setStart(e.container(),e.offset())})),n||vh(e,n,!1,r).each((function(e){r.setEnd(e.container(),e.offset())})),n&&r.collapse(!0),ch(t,r)?N.none():N.some(r)},yh=function(e,t,n){var r=e.create("span",{},"&nbsp;");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},wh=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},xh=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();bh(i,a).each((function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)}));var u=a.startOffset,s=a.startContainer;if(1===s.nodeType&&s.hasChildNodes()){var c=u>s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=t&&t.ctrlKey;"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new to(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(e.schema,s,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),Cu(i,a,n),yh(i,o,n),wh(i,o,n,r),e.undoManager.add()},Ch=function(e,t){var n=Xn.fromTag("br");bi(Xn.fromDom(t),n),e.undoManager.add()},Sh=function(e,t){Eh(e.getBody(),t)||yi(Xn.fromDom(t),Xn.fromTag("br"));var n=Xn.fromTag("br");yi(Xn.fromDom(t),n),yh(e.dom,e.selection,n.dom()),wh(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},Eh=function(e,t){return n=fu.after(t),!!Ro.isBr(n.getNode())||js.nextPosition(e,fu.after(t)).map((function(e){return Ro.isBr(e.getNode())})).getOr(!1);var n},kh=function(e){return e&&"A"===e.nodeName&&"href"in e},Nh=function(e){return e.fold(i(!1),kh,kh,i(!1))},Th=function(e,t){t.fold(r,u(Ch,e),u(Sh,e),r)},_h=function(e,t){var n=function(e){var t=u(kl.isInlineTarget,e),n=fu.fromRangeStart(e.selection.getRng());return wd(t,e.getBody(),n).filter(Nh)}(e);n.isSome()?n.each(u(Th,e)):xh(e,t)},Rh={create:vr("start","soffset","finish","foffset")},Oh=of([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Ah=(Oh.before,Oh.on,Oh.after,function(e){return e.fold(a,a,a)}),Dh=of([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ph={domRange:Dh.domRange,relative:Dh.relative,exact:Dh.exact,exactFromRange:function(e){return Dh.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){var t=function(e){return e.match({domRange:function(e){return Xn.fromDom(e.startContainer)},relative:function(e,t){return Ah(e)},exact:function(e,t,n,r){return e}})}(e);return Rr(t)},range:Rh.create},Bh=$n.detect().browser,Ih=function(e,t){var n=tr(t)?yc(t).length:Ir(t).length+1;return e>n?n:e<0?0:e},Mh=function(e){return Ph.range(e.start(),Ih(e.soffset(),e.start()),e.finish(),Ih(e.foffset(),e.finish()))},Lh=function(e,t){return!Ro.isRestrictedNode(t.dom())&&(Tr(e,t)||Nr(e,t))},Fh=function(e){return function(t){return Lh(e,t.start())&&Lh(e,t.finish())}},Hh=function(e){return!0===e.inline||Bh.isIE()},zh=function(e){return Ph.range(Xn.fromDom(e.startContainer),e.startOffset,Xn.fromDom(e.endContainer),e.endOffset)},Wh=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?N.from(t.getRangeAt(0)):N.none()).map(zh)},jh=function(e){var t=Rr(e);return Wh(t.dom()).filter(Fh(e))},Uh=function(e,t){return N.from(t).filter(Fh(e)).map(Mh)},Vh=function(e){var t=n.document.createRange();try{return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),N.some(t)}catch(e){return N.none()}},qh=function(e){return(e.bookmark?e.bookmark:N.none()).bind(u(Uh,Xn.fromDom(e.getBody()))).bind(Vh)},$h=function(e){var t=Hh(e)?jh(Xn.fromDom(e.getBody())):N.none();e.bookmark=t.isSome()?t:e.bookmark},Yh=function(e){qh(e).each((function(t){e.selection.setRng(t)}))},Xh=qh,Kh=function(e){return fo(e)||mo(e)},Gh=function(e){return V(W(e.selection.getSelectedBlocks(),Xn.fromDom),(function(e){return!Kh(e)&&!function(e){return Or(e).map(Kh).getOr(!1)}(e)}))},Jh=function(e,t){var n=e.settings,r=e.dom,o=e.selection,i=e.formatter,a=/[a-z%]+$/i.exec(n.indentation)[0],u=parseInt(n.indentation,10),s=e.getParam("indent_use_margin",!1);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||n.forced_root_block||r.getParent(o.getNode(),r.isBlock)||i.apply("div"),j(Gh(e),(function(e){!function(e,t,n,r,o,i){if("false"!==e.getContentEditable(i)){var a=n?"margin":"padding";if(a="TABLE"===i.nodeName?"margin":a,a+="rtl"===e.getStyle(i,"direction",!0)?"Right":"Left","outdent"===t){var u=Math.max(0,parseInt(i.style[a]||0,10)-r);e.setStyle(i,a,u?u+o:"")}else u=parseInt(i.style[a]||0,10)+r+o,e.setStyle(i,a,u)}}(r,t,s,u,a,e.dom())}))},Qh=$t.each,Zh=$t.extend,eg=$t.map,tg=$t.inArray;function ng(e){var t,n,r,o,i={state:{},exec:{},value:{}},a=e.settings;e.on("PreInit",(function(){t=e.dom,n=e.selection,a=e.settings,r=e.formatter}));var u=function(t){var n;if(!e.quirks.isHidden()&&!e.removed){if(t=t.toLowerCase(),n=i.state[t])return n(t);try{return e.getDoc().queryCommandState(t)}catch(e){}return!1}},s=function(e,t){t=t||"exec",Qh(e,(function(e,n){Qh(n.toLowerCase().split(","),(function(n){i[t][n]=e}))}))},c=function(t,n,r){t=t.toLowerCase(),i.value[t]=function(){return n.call(r||e)}};Zh(this,{execCommand:function(t,n,r,o){var a,u,s=!1;if(!e.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||o&&o.skip_focus?Yh(e):e.focus(),(o=e.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;if(u=t.toLowerCase(),a=i.exec[u])return a(u,n,r),e.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if(Qh(e.plugins,(function(o){if(o.execCommand&&o.execCommand(t,n,r))return e.fire("ExecCommand",{command:t,ui:n,value:r}),s=!0,!1})),s)return s;if(e.theme&&e.theme.execCommand&&e.theme.execCommand(t,n,r))return e.fire("ExecCommand",{command:t,ui:n,value:r}),!0;try{s=e.getDoc().execCommand(t,n,r)}catch(e){}return!!s&&(e.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},queryCommandState:u,queryCommandValue:function(t){var n;if(!e.quirks.isHidden()&&!e.removed){if(t=t.toLowerCase(),n=i.value[t])return n(t);try{return e.getDoc().queryCommandValue(t)}catch(e){}}},queryCommandSupported:function(t){if(t=t.toLowerCase(),i.exec[t])return!0;try{return e.getDoc().queryCommandSupported(t)}catch(e){}return!1},addCommands:s,addCommand:function(t,n,r){t=t.toLowerCase(),i.exec[t]=function(t,o,i,a){return n.call(r||e,o,i,a)}},addQueryStateHandler:function(t,n,r){t=t.toLowerCase(),i.state[t]=function(){return n.call(r||e)}},addQueryValueHandler:c,hasCustomCommand:function(e){return e=e.toLowerCase(),!!i.exec[e]}});var l=function(t,n,r){return void 0===n&&(n=!1),void 0===r&&(r=null),e.getDoc().execCommand(t,n,r)},f=function(e){return r.match(e)},d=function(t,n){r.toggle(t,n?{value:n}:void 0),e.nodeChanged()},m=function(e){o=n.getBookmark(e)},h=function(){n.moveToBookmark(o)};s({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){e.undoManager.add()},"Cut,Copy,Paste":function(t){var n,r=e.getDoc();try{l(t)}catch(e){n=!0}if("paste"!==t||r.queryCommandEnabled(t)||(n=!0),n||!r.queryCommandSupported(t)){var o=e.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");le.mac&&(o=o.replace(/Ctrl\+/g,"⌘+")),e.notificationManager.open({text:o,type:"error"})}},unlink:function(){if(n.isCollapsed()){var t=e.dom.getParent(e.selection.getStart(),"a");t&&e.dom.remove(t,!0)}else r.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),Qh("left,center,right,justify".split(","),(function(e){t!==e&&r.remove("align"+e)})),"none"!==t&&d("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var r,o;l(e),(r=t.getParent(n.getNode(),"ol,ul"))&&(o=r.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(o.nodeName)&&(m(),t.split(o,r),h()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){d(e)},"ForeColor,HiliteColor":function(e,t,n){d(e,n)},FontName:function(t,n,r){!function(e,t){e.formatter.toggle("fontname",{value:sh(e,t)}),e.nodeChanged()}(e,r)},FontSize:function(t,n,r){!function(e,t){e.formatter.toggle("fontsize",{value:sh(e,t)}),e.nodeChanged()}(e,r)},RemoveFormat:function(e){r.remove(e)},mceBlockQuote:function(){d("blockquote")},FormatBlock:function(e,t,n){return d(n||"p")},mceCleanup:function(){var t=n.getBookmark();e.setContent(e.getContent()),n.moveToBookmark(t)},mceRemoveNode:function(t,r,o){var i=o||n.getNode();i!==e.getBody()&&(m(),e.dom.remove(i,!0),h())},mceSelectNodeDepth:function(r,o,i){var a=0;t.getParent(n.getNode(),(function(e){if(1===e.nodeType&&a++===i)return n.select(e),!1}),e.getBody())},mceSelectNode:function(e,t,r){n.select(r)},mceInsertContent:function(t,n,r){Xc(e,r)},mceInsertRawHTML:function(t,r,o){n.setContent("tiny_mce_marker");var i=e.getContent();e.setContent(i.replace(/tiny_mce_marker/g,(function(){return o})))},mceToggleFormat:function(e,t,n){d(n)},mceSetContent:function(t,n,r){e.setContent(r)},"Indent,Outdent":function(t){Jh(e,t)},mceRepaint:function(){},InsertHorizontalRule:function(){e.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){e.hasVisual=!e.hasVisual,e.addVisual()},mceReplaceContent:function(t,r,o){e.execCommand("mceInsertContent",!1,o.replace(/\{\$selection\}/g,n.getContent({format:"text"})))},mceInsertLink:function(e,o,i){var a;"string"==typeof i&&(i={href:i}),a=t.getParent(n.getNode(),"a"),i.href=i.href.replace(" ","%20"),a&&i.href||r.remove("link"),i.href&&r.apply("link",i,a)},selectAll:function(){var e=t.getParent(n.getStart(),Ro.isContentEditableTrue);if(e){var r=t.createRng();r.selectNodeContents(e),n.setRng(r)}},delete:function(){th(e)},forwardDelete:function(){nh(e)},mceNewDocument:function(){e.setContent("")},InsertLineBreak:function(t,n,r){return _h(e,r),!0}});var g=function(e){return function(){var o=n.isCollapsed()?[t.getParent(n.getNode(),t.isBlock)]:n.getSelectedBlocks(),i=eg(o,(function(t){return!!r.matchNode(t,e)}));return-1!==tg(i,!0)}};s({JustifyLeft:g("alignleft"),JustifyCenter:g("aligncenter"),JustifyRight:g("alignright"),JustifyFull:g("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return f(e)},mceBlockQuote:function(){return f("blockquote")},Outdent:function(){var e;if(a.inline_styles){if((e=t.getParent(n.getStart(),t.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return!0;if((e=t.getParent(n.getEnd(),t.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return!0}return u("InsertUnorderedList")||u("InsertOrderedList")||!a.inline_styles&&!!t.getParent(n.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var r=t.getParent(n.getNode(),"ul,ol");return r&&("insertunorderedlist"===e&&"UL"===r.tagName||"insertorderedlist"===e&&"OL"===r.tagName)}},"state"),s({Undo:function(){e.undoManager.undo()},Redo:function(){e.undoManager.redo()}}),c("FontName",(function(){return function(e){return uh(e).fold((function(){return ah(e).map((function(t){return ih.getFontFamily(e.getBody(),t)})).getOr("")}),(function(t){return ih.getFontFamily(e.getBody(),t)}))}(e)}),this),c("FontSize",(function(){return function(e){return uh(e).fold((function(){return ah(e).map((function(t){return ih.getFontSize(e.getBody(),t)})).getOr("")}),(function(t){return ih.getFontSize(e.getBody(),t)}))}(e)}),this)}var rg=$t.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," "),og=function(e){var t,n,r=this,o={},i=function(){return!1},a=function(){return!0};t=(e=e||{}).scope||r,n=e.toggleEvent||i;var u=function(e,t,a,u){var s,c,l;if(!1===t&&(t=i),t)for(t={func:t},u&&$t.extend(t,u),l=(c=e.toLowerCase().split(" ")).length;l--;)e=c[l],(s=o[e])||(s=o[e]=[],n(e,!0)),a?s.unshift(t):s.push(t);return r},s=function(e,t){var i,a,u,s,c;if(e)for(i=(s=e.toLowerCase().split(" ")).length;i--;){if(e=s[i],a=o[e],!e){for(u in o)n(u,!1),delete o[u];return r}if(a){if(t)for(c=a.length;c--;)a[c].func===t&&(a=a.slice(0,c).concat(a.slice(c+1)),o[e]=a);else a.length=0;a.length||(n(e,!1),delete o[e])}}else{for(e in o)n(e,!1);o={}}return r};r.fire=function(n,r){var u,c,l,f;if(n=n.toLowerCase(),(r=r||{}).type=n,r.target||(r.target=t),r.preventDefault||(r.preventDefault=function(){r.isDefaultPrevented=a},r.stopPropagation=function(){r.isPropagationStopped=a},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=a},r.isDefaultPrevented=i,r.isPropagationStopped=i,r.isImmediatePropagationStopped=i),e.beforeFire&&e.beforeFire(r),u=o[n])for(c=0,l=u.length;c<l;c++){if((f=u[c]).once&&s(n,f.func),r.isImmediatePropagationStopped())return r.stopPropagation(),r;if(!1===f.func.call(t,r))return r.preventDefault(),r}return r},r.on=u,r.off=s,r.once=function(e,t,n){return u(e,t,n,{once:!0})},r.has=function(e){return e=e.toLowerCase(),!(!o[e]||0===o[e].length)}};og.isNative=function(e){return!!rg[e.toLowerCase()]};var ig,ag=function(e){return e._eventDispatcher||(e._eventDispatcher=new og({scope:e,toggleEvent:function(t,n){og.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,n)}})),e._eventDispatcher},ug={fire:function(e,t,n){if(this.removed&&"remove"!==e&&"detach"!==e)return t;if(t=ag(this).fire(e,t,n),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},on:function(e,t,n){return ag(this).on(e,t,n)},off:function(e,t){return ag(this).off(e,t)},once:function(e,t){return ag(this).once(e,t)},hasEventListeners:function(e){return ag(this).has(e)}},sg=function(e,t){return e.fire("PreProcess",t)},cg=function(e,t){return e.fire("PostProcess",t)},lg=function(e){return e.fire("remove")},fg=function(e){return e.fire("detach")},dg=function(e,t){return e.fire("SwitchMode",{mode:t})},mg=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},hg=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},gg=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(e){}},pg=function(e,t,n){var r,o;Bi(e,t)&&!1===n?(o=t,Ri(r=e)?r.dom().classList.remove(o):Ai(r,o),Pi(r)):n&&Di(e,t)},vg=function(e,t){pg(Xn.fromDom(e.getBody()),"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable="false"):(e.readonly=!1,e.getBody().contentEditable="true",gg(e,"StyleWithCSS",!1),gg(e,"enableInlineTableEditing",!1),gg(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},bg=function(e){return e.readonly?"readonly":"design"},yg=li.DOM,wg=function(e,t){return"selectionchange"===t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=yg.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},xg=function(e,t,n){!function(e){return!e.hidden&&!e.readonly}(e)?function(e){return!0===e.readonly}(e)&&n.preventDefault():e.fire(t,n)},Cg=function(e,t){var n,r;if(e.delegates||(e.delegates={}),!e.delegates[t]&&!e.removed)if(n=wg(e,t),e.settings.event_root){if(ig||(ig={},e.editorManager.on("removeEditor",(function(){var t;if(!e.editorManager.activeEditor&&ig){for(t in ig)e.dom.unbind(wg(e,t));ig=null}}))),ig[t])return;r=function(n){for(var r=n.target,o=e.editorManager.get(),i=o.length;i--;){var a=o[i].getBody();(a===r||yg.isChildOf(r,a))&&xg(o[i],t,n)}},ig[t]=r,yg.bind(n,t,r)}else r=function(n){xg(e,t,n)},yg.bind(n,t,r),e.delegates[t]=r},Sg={bindPendingEventDelegates:function(){var e=this;$t.each(e._pendingNativeEvents,(function(t){Cg(e,t)}))},toggleNativeEvent:function(e,t){"focus"!==e&&"blur"!==e&&(t?this.initialized?Cg(this,e):this._pendingNativeEvents?this._pendingNativeEvents.push(e):this._pendingNativeEvents=[e]:this.initialized&&(this.dom.unbind(wg(this,e),e,this.delegates[e]),delete this.delegates[e]))},unbindAllNativeEvents:function(){var e,t=this.getBody(),n=this.dom;if(this.delegates){for(e in this.delegates)this.dom.unbind(wg(this,e),e,this.delegates[e]);delete this.delegates}!this.inline&&t&&n&&(t.onload=null,n.unbind(this.getWin()),n.unbind(this.getDoc())),n&&(n.unbind(t),n.unbind(this.getContainer()))}},Eg=Sg=$t.extend({},ug,Sg),kg=vr("sections","settings"),Ng=$n.detect().deviceType.isTouch(),Tg=["lists","autolink","autosave"],_g={theme:"mobile"},Rg=function(e){var t=O(e)?e.join(" "):e,n=W(_(t)?t.split(" "):[],Fn);return V(n,(function(e){return e.length>0}))},Og=function(e,t){var n=ar(t,(function(t,n){return H(e,n)}));return kg(n.t,n.f)},Ag=function(e,t){return e.sections().hasOwnProperty(t)},Dg=function(e,t){var n=t.external_plugins?t.external_plugins:{};return e&&e.external_plugins?$t.extend({},e.external_plugins,n):n},Pg=function(e,t,n,r){var o=Rg(n.forced_plugins),i=Rg(r.plugins),a=function(e,t){return[].concat(Rg(e)).concat(Rg(t))}(o,e&&Ag(t,"mobile")?function(e){return V(e,u(H,Tg))}(i):i);return $t.extend(r,{plugins:a.join(" ")})},Bg=function(e,t,n,r){var o=Og(["mobile"],r),i=$t.extend(t,n,o.settings(),function(e,t){var n=t.settings().inline;return e&&Ag(t,"mobile")&&!n}(e,o)?function(e,t,n){var r=e.sections(),o=r.hasOwnProperty(t)?r[t]:{};return $t.extend({},n,o)}(o,"mobile",_g):{},{validate:!0,content_editable:o.settings().inline,external_plugins:Dg(n,o.settings())});return Pg(e,o,n,i)},Ig=function(e,t,n){return N.from(t.settings[n]).filter(e)},Mg=function(e,t,n,r){var o,i=t in e.settings?e.settings[t]:n;return"hash"===r?function(e){var t={};return"string"==typeof e?j(e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(","),(function(e){var n=e.split("=");n.length>1?t[$t.trim(n[0])]=$t.trim(n[1]):t[$t.trim(n[0])]=$t.trim(n)})):t=e,t}(i):"string"===r?Ig(_,e,t).getOr(n):"number"===r?Ig(B,e,t).getOr(n):"boolean"===r?Ig(D,e,t).getOr(n):"object"===r?Ig(R,e,t).getOr(n):"array"===r?Ig(O,e,t).getOr(n):"string[]"===r?Ig((o=_,function(e){return O(e)&&K(e,o)}),e,t).getOr(n):"function"===r?Ig(P,e,t).getOr(n):i},Lg=$t.each,Fg=$t.explode,Hg={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},zg=$t.makeMap("alt,ctrl,shift,meta,access");function Wg(e){var t={},n=[],r=function(e){var t,n,r={};for(n in Lg(Fg(e,"+"),(function(e){e in zg?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=Hg[e]||e.toUpperCase().charCodeAt(0))})),t=[r.keyCode],zg)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,le.mac?r.ctrl=!0:r.shift=!0),r.meta&&(le.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},o=function(t,n,o,i){var a;return(a=$t.map(Fg(t,">"),r))[a.length-1]=$t.extend(a[a.length-1],{func:o,scope:i||e}),$t.extend(a[0],{desc:e.translate(n),subpatterns:a.slice(1)})},i=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},a=function(e){return e.func?e.func.call(e.scope):null};e.on("keyup keypress keydown",(function(e){!function(e){return e.altKey||e.ctrlKey||e.metaKey}(e)&&!function(e){return"keydown"===e.type&&e.keyCode>=112&&e.keyCode<=123}(e)||e.isDefaultPrevented()||(Lg(t,(function(t){if(i(e,t))return n=t.subpatterns.slice(0),"keydown"===e.type&&a(t),!0})),i(e,n[0])&&(1===n.length&&"keydown"===e.type&&a(n[0]),n.shift()))})),this.add=function(n,r,i,a){var u;return u=i,"string"==typeof i?i=function(){e.execCommand(u,!1,null)}:$t.isArray(u)&&(i=function(){e.execCommand(u[0],u[1],u[2])}),Lg(Fg($t.trim(n.toLowerCase())),(function(e){var n=o(e,r,i,a);t[n.id]=n})),!0},this.remove=function(e){var n=o(e);return!!t[n.id]&&(delete t[n.id],!0)}}var jg=function(e){var t=_r(e).dom();return e.dom()===t.activeElement},Ug=function(e){return function(e){var t=void 0!==e?e.dom():n.document;return N.from(t.activeElement).map(Xn.fromDom)}(_r(e)).filter((function(t){return e.dom().contains(t.dom())}))},Vg=function(e,t){return function(e){return e.collapsed?N.from(Fa(e.startContainer,e.startOffset)).map(Xn.fromDom):N.none()}(t).bind((function(t){return go(t)?N.some(t):!1===Tr(e,t)?N.some(e):N.none()}))},qg=function(e,t){Vg(Xn.fromDom(e.getBody()),t).bind((function(e){return js.firstPositionIn(e.dom())})).fold((function(){e.selection.normalize()}),(function(t){return e.selection.setRng(t.toRange())}))},$g=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},Yg=function(e){var t,n=e.getBody();return n&&(t=Xn.fromDom(n),jg(t)||Ug(t).isSome())},Xg=function(e){return e.inline?Yg(e):function(e){return e.iframeElement&&jg(Xn.fromDom(e.iframeElement))}(e)},Kg=function(e){return e.editorManager.setActive(e)},Gg=function(e,t){e.removed||(t?Kg(e):function(e){var t=e.selection,n=e.settings.content_editable,r=e.getBody(),o=t.getRng();e.quirks.refreshContentEditable();var i=function(e,t){return e.dom.getParent(t,(function(t){return"true"===e.dom.getContentEditable(t)}))}(e,t.getNode());if(e.$.contains(r,i))return $g(i),qg(e,o),void Kg(e);void 0!==e.bookmark&&!1===Xg(e)&&Xh(e).each((function(t){e.selection.setRng(t),o=t})),n||(le.opera||$g(r),e.getWin().focus()),(le.gecko||n)&&($g(r),qg(e,o)),Kg(e)}(e))},Jg=Xg,Qg=function(e,t){return t.dom()[e]},Zg=function(e,t){return parseInt(gr(t,e),10)},ep=u(Qg,"clientWidth"),tp=u(Qg,"clientHeight"),np=u(Zg,"margin-top"),rp=u(Zg,"margin-left"),op=function(e,t,n){var r,o=Xn.fromDom(e.getBody()),i=e.inline?o:(r=o,Xn.fromDom(r.dom().ownerDocument.documentElement)),a=function(e,t,n,r){var o=function(e){return e.dom().getBoundingClientRect()}(t);return{x:n-(e?o.left+t.dom().clientLeft+rp(t):0),y:r-(e?o.top+t.dom().clientTop+np(t):0)}}(e.inline,i,t,n);return function(e,t,n){var r=ep(e),o=tp(e);return t>=0&&n>=0&&t<=r&&n<=o}(i,a.x,a.y)},ip=function(e){return function(e){return N.from(e).map(Xn.fromDom)}(e.inline?e.getBody():e.getContentAreaContainer()).map((function(e){return Tr(_r(e),e)})).getOr(!1)};function ap(e){var t=[],n=function(){var t,n=e.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:t=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:t,reposition:t,getArgs:t}},r=function(){t.length>0&&n().reposition(t)},o=function(e){Y(t,(function(t){return t===e})).each((function(e){t.splice(e,1)}))},i=function(i){if(!e.removed&&ip(e))return $(t,(function(e){return t=n().getArgs(e),r=i,!(t.type!==r.type||t.text!==r.text||t.progressBar||t.timeout||r.progressBar||r.timeout);var t,r})).getOrThunk((function(){e.editorManager.setActive(e);var a=n().open(i,(function(){o(a),r()}));return function(e){t.push(e)}(a),r(),a}))};return function(e){e.on("SkinLoaded",(function(){var t=e.settings.service_message;t&&i({text:t,type:"warning",timeout:0,icon:""})})),e.on("ResizeEditor ResizeWindow",(function(){ge.requestAnimationFrame(r)})),e.on("remove",(function(){j(t.slice(),(function(e){n().close(e)}))}))}(e),{open:i,close:function(){N.from(t[0]).each((function(e){n().close(e),o(e),r()}))},getNotifications:function(){return t}}}function up(e){var t=[],n=function(){var t,n=e.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:t=function(){throw new Error("Theme did not provide a WindowManager implementation.")},alert:t,confirm:t,close:t,getParams:t,setParams:t}},r=function(e,t){return function(){return t?t.apply(e,arguments):void 0}},o=function(n){t.push(n),function(t){e.fire("OpenWindow",{win:t})}(n)},i=function(n){Y(t,(function(e){return e===n})).each((function(r){t.splice(r,1),function(t){e.fire("CloseWindow",{win:t})}(n),0===t.length&&e.focus()}))},a=function(){return N.from(t[t.length-1])};return e.on("remove",(function(){j(t.slice(0),(function(e){n().close(e)}))})),{windows:t,open:function(t,r){e.editorManager.setActive(e),$h(e);var a=n().open(t,r,i);return o(a),a},alert:function(e,t,a){var u=n().alert(e,r(a||this,t),i);o(u)},confirm:function(e,t,a){var u=n().confirm(e,r(a||this,t),i);o(u)},close:function(){a().each((function(e){n().close(e),i(e)}))},getParams:function(){return a().map(n().getParams).getOr(null)},setParams:function(e){a().each((function(t){n().setParams(t,e)}))},getWindows:function(){return t}}}var sp={},cp="en",lp={setCode:function(e){e&&(cp=e,this.rtl=!!this.data[e]&&"rtl"===this.data[e]._dir)},getCode:function(){return cp},rtl:!1,add:function(e,t){var n=sp[e];for(var r in n||(sp[e]=n={}),t)n[r]=t[r];this.setCode(e)},translate:function(e){var t=sp[cp]||{},n=function(e){return $t.is(e,"function")?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||$t.is(e,"undefined")},o=function(e){return e=n(e),$t.hasOwn(t,e)?n(t[e]):e};if(r(e))return"";if($t.is(e,"object")&&$t.hasOwn(e,"raw"))return n(e.raw);if($t.is(e,"array")){var i=e.slice(1);e=o(e[0]).replace(/\{([0-9]+)\}/g,(function(e,t){return $t.hasOwn(i,t)?n(i[t]):e}))}return o(e).replace(/{context:\w+}$/,"")},data:sp},fp=vi.PluginManager,dp=function(e,t){var n=function(e,t){for(var n in fp.urls)if(fp.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?lp.translate(["Failed to load plugin: {0} from url {1}",n,t]):lp.translate(["Failed to load plugin url: {0}",t])},mp=function(e,t){e.notificationManager.open({type:"error",text:t})},hp=function(e,t){e._skinLoaded?mp(e,t):e.on("SkinLoaded",(function(){mp(e,t)}))},gp=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var o=n.window.console;o&&(o.error?o.error.apply(o,arguments):o.log.apply(o,arguments))},pp={pluginLoadError:function(e,t){hp(e,dp(e,t))},pluginInitError:function(e,t,n){var r=lp.translate(["Failed to initialize plugin: {0}",t]);gp(r,n),hp(e,r)},uploadError:function(e,t){hp(e,lp.translate(["Failed to upload image: {0}",t]))},displayError:hp,initError:gp},vp=vi.PluginManager,bp=vi.ThemeManager;function yp(){return new(ne("XMLHttpRequest"))}function wp(e,t){var r={},o=function(e,r,o,i){var a,u;(a=yp()).open("POST",t.url),a.withCredentials=t.credentials,a.upload.onprogress=function(e){i(e.loaded/e.total*100)},a.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+a.status)},a.onload=function(){var e,n,i;a.status<200||a.status>=300?o("HTTP Error: "+a.status):(e=JSON.parse(a.responseText))&&"string"==typeof e.location?r((n=t.basePath,i=e.location,n?n.replace(/\/$/,"")+"/"+i.replace(/^\//,""):i)):o("Invalid JSON: "+a.responseText)},(u=new n.FormData).append("file",e.blob(),e.filename()),a.send(u)},i=function(e,t){return{url:t,blobInfo:e,status:!0}},a=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},u=function(e,t){$t.each(r[e],(function(e){e(t)})),delete r[e]},s=function(n,o){return n=$t.grep(n,(function(t){return!e.isUploaded(t.blobUri())})),fe.all($t.map(n,(function(n){return e.isPending(n.blobUri())?function(e){var t=e.blobUri();return new fe((function(e){r[t]=r[t]||[],r[t].push(e)}))}(n):function(t,n,r){return e.markPending(t.blobUri()),new fe((function(o){var s;try{var c=function(){s&&s.close()};n(t,(function(n){c(),e.markUploaded(t.blobUri(),n),u(t.blobUri(),i(t,n)),o(i(t,n))}),(function(n){c(),e.removeFailed(t.blobUri()),u(t.blobUri(),a(t,n)),o(a(t,n))}),(function(e){e<0||e>100||(s||(s=r()),s.progressBar.value(e))}))}catch(e){o(a(t,e.message))}}))}(n,t.handler,o)})))};return!1===P(t.handler)&&(t.handler=o),{upload:function(e,n){return t.url||t.handler!==o?s(e,n):new fe((function(e){e([])}))}}}var xp=function(e){return ne("atob")(e)},Cp=function(e){var t,n,r=decodeURIComponent(e).split(",");return(n=/data:([^;]+)/.exec(r[0]))&&(t=n[1]),{type:t,data:r[1]}},Sp=function(e){return new fe((function(t){var r,o,i,a=Cp(e);try{r=xp(a.data)}catch(e){return void t(new n.Blob([]))}for(o=function(e){return new(ne("Uint8Array"))(e)}(r.length),i=0;i<o.length;i++)o[i]=r.charCodeAt(i);t(new n.Blob([o],{type:a.type}))}))},Ep=function(e){return 0===e.indexOf("blob:")?function(e){return new fe((function(t,n){var r=function(){n("Cannot convert "+e+" to Blob. Resource might not exist or is inaccessible.")};try{var o=yp();o.open("GET",e,!0),o.responseType="blob",o.onload=function(){200===this.status?t(this.response):r()},o.onerror=r,o.send()}catch(e){r()}}))}(e):0===e.indexOf("data:")?Sp(e):null},kp=function(e){return new fe((function(t){var n=new(ne("FileReader"));n.onloadend=function(){t(n.result)},n.readAsDataURL(e)}))},Np=Cp,Tp=0,_p=function(e){return(e||"blobid")+Tp++};function Rp(e,t){var n={};return{findAll:function(r,o){var a;o||(o=i(!0)),a=V(function(e){return e?Z(e.getElementsByTagName("img")):[]}(r),(function(t){var n=t.src;return!!le.fileApi&&!t.hasAttribute("data-mce-bogus")&&!t.hasAttribute("data-mce-placeholder")&&!(!n||n===le.transparentSrc)&&(0===n.indexOf("blob:")?!e.isUploaded(n)&&o(t):0===n.indexOf("data:")&&o(t))}));var u=W(a,(function(e){if(n[e.src])return new fe((function(t){n[e.src].then((function(n){if("string"==typeof n)return n;t({image:e,blobInfo:n.blobInfo})}))}));var r=new fe((function(n,r){!function(e,t,n,r){var o,i;0!==t.src.indexOf("blob:")?(o=Np(t.src).data,(i=e.findFirst((function(e){return e.base64()===o})))?n({image:t,blobInfo:i}):Ep(t.src).then((function(r){i=e.create(_p(),r,o),e.add(i),n({image:t,blobInfo:i})}),(function(e){r(e)}))):(i=e.getByUri(t.src))?n({image:t,blobInfo:i}):Ep(t.src).then((function(r){kp(r).then((function(a){o=Np(a).data,i=e.create(_p(),r,o),e.add(i),n({image:t,blobInfo:i})}))}),(function(e){r(e)}))}(t,e,n,r)})).then((function(e){return delete n[e.image.src],e})).catch((function(t){return delete n[e.src],t}));return n[e.src]=r,r}));return fe.all(u)}}}var Op=0,Ap=function(e){return e+Op+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t};function Dp(e){var t,n,r,o,a,u=function(){var e=[],t=function(e){var t,n,r;if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");return t=e.id||Ap("blobid"),n=e.name||t,{id:i(t),name:i(n),filename:i(n+"."+(r=e.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[r.toLowerCase()]||"dat")),blob:i(e.blob),base64:i(e.base64),blobUri:i(e.blobUri||oe(e.blob)),uri:i(e.uri)}},n=function(e){return r((function(t){return t.id()===e}))},r=function(t){return V(e,t)[0]};return{create:function(e,n,r,o){if(_(e))return t({id:e,name:o,blob:n,base64:r});if(R(e))return t(e);throw new Error("Unknown input type")},add:function(t){n(t.id())||e.push(t)},get:n,getByUri:function(e){return r((function(t){return t.blobUri()===e}))},findFirst:r,removeByUri:function(t){e=V(e,(function(e){return e.blobUri()!==t||(ie(e.blobUri()),!1)}))},destroy:function(){j(e,(function(e){ie(e.blobUri())})),e=[]}}}(),s=(r={},o=function(e,t){return{status:e,resultUri:t}},{hasBlobUri:a=function(e){return e in r},getResultUri:function(e){var t=r[e];return t?t.resultUri:null},isPending:function(e){return!!a(e)&&1===r[e].status},isUploaded:function(e){return!!a(e)&&2===r[e].status},markPending:function(e){r[e]=o(1,null)},markUploaded:function(e,t){r[e]=o(2,t)},removeFailed:function(e){delete r[e]},destroy:function(){r={}}}),c=[],l=function(t){return function(n){return e.selection?t(n):[]}},f=function(e,t,n){var r=0;do{-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1)}while(-1!==r);return e},d=function(e,t,n){return e=f(e,'src="'+t+'"','src="'+n+'"'),e=f(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},m=function(t,n){j(e.undoManager.data,(function(e){"fragmented"===e.type?e.fragments=W(e.fragments,(function(e){return d(e,t,n)})):e.content=d(e.content,t,n)}))},h=function(){return e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},g=function(n){return t||(t=wp(s,{url:pl(e),basePath:vl(e),credentials:bl(e),handler:yl(e)})),b().then(l((function(r){var o;return o=W(r,(function(e){return e.blobInfo})),t.upload(o,h).then(l((function(t){var o=W(t,(function(t,n){var o=r[n].image;return t.status&&gl(e)?function(t,n){u.removeByUri(t.src),m(t.src,n),e.$(t).attr({src:hl(e)?n+"?"+(new Date).getTime():n,"data-mce-src":e.convertURL(n,"src")})}(o,t.url):t.error&&pp.uploadError(e,t.error),{element:o,status:t.status}}));return n&&n(o),o})))})))},p=function(t){if(ml(e))return g(t)},v=function(t){return!1!==K(c,(function(e){return e(t)}))&&(0!==t.getAttribute("src").indexOf("data:")||dl(e)(t))},b=function(){return n||(n=Rp(s,u)),n.findAll(e.getBody(),v).then(l((function(t){return t=V(t,(function(t){return"string"!=typeof t||(pp.displayError(e,t),!1)})),j(t,(function(e){m(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")})),t})))},y=function(t){return t.replace(/src="(blob:[^"]+)"/g,(function(t,n){var r=s.getResultUri(n);if(r)return'src="'+r+'"';var o=u.getByUri(n);return o||(o=q(e.editorManager.get(),(function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)}),null)),o?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':t}))};return e.on("setContent",(function(){ml(e)?p():b()})),e.on("RawSaveContent",(function(e){e.content=y(e.content)})),e.on("getContent",(function(e){e.source_view||"raw"===e.format||(e.content=y(e.content))})),e.on("PostRender",(function(){e.parser.addNodeFilter("img",(function(e){j(e,(function(e){var t=e.attr("src");if(!u.getByUri(t)){var n=s.getResultUri(t);n&&e.attr("src",n)}}))}))})),{blobCache:u,addFilter:function(e){c.push(e)},uploadImages:g,uploadImagesAuto:p,scanForImages:b,destroy:function(){u.destroy(),s.destroy(),n=t=null}}}var Pp=function(e,t){return e.hasOwnProperty(t.nodeName)},Bp=function(e,t){return!!Ro.isText(t)||!!Ro.isElement(t)&&!Pp(e,t)&&!Qs(t)},Ip=function(e,t){if(Ro.isText(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||Pp(e,t.nextSibling)))return!0}return!1},Mp=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.dom,h=e.selection,g=e.schema,p=g.getBlockElements(),v=h.getStart(),b=e.getBody();if(f=d.forced_root_block,v&&Ro.isElement(v)&&f&&(l=b.nodeName.toLowerCase(),g.isValidChild(l,f.toLowerCase())&&!function(e,t,n){return z(jl(Xn.fromDom(n),Xn.fromDom(t)),(function(t){return Pp(e,t.dom())}))}(p,b,v))){for(n=(t=h.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=Jg(e),v=b.firstChild;v;)if(Bp(p,v)){if(Ip(p,v)){u=v,v=v.nextSibling,m.remove(u);continue}a||(a=m.create(f,e.settings.forced_root_block_attrs),v.parentNode.insertBefore(a,v),s=!0),u=v,v=v.nextSibling,a.appendChild(u)}else a=null,v=v.nextSibling;s&&c&&(t.setStart(n,r),t.setEnd(o,i),h.setRng(t),e.nodeChanged())}},Lp=function(e){e.settings.forced_root_block&&e.on("NodeChange",u(Mp,e))},Fp=function(e){return Lr(e).fold(i([e]),(function(t){return[e].concat(Fp(t))}))},Hp=function(e){return Fr(e).fold(i([e]),(function(t){return"br"===Qn(t)?Ar(t).map((function(t){return[e].concat(Hp(t))})).getOr([]):[e].concat(Hp(t))}))},zp=function(e,t){return Wa(function(e){var t=e.startContainer,n=e.startOffset;return Ro.isText(t)?0===n?N.some(Xn.fromDom(t)):N.none():N.from(t.childNodes[n]).map(Xn.fromDom)}(t),function(e){var t=e.endContainer,n=e.endOffset;return Ro.isText(t)?n===t.data.length?N.some(Xn.fromDom(t)):N.none():N.from(t.childNodes[n-1]).map(Xn.fromDom)}(t),(function(t,n){var r=$(Fp(e),u(Nr,t)),o=$(Hp(e),u(Nr,n));return r.isSome()&&o.isSome()})).getOr(!1)},Wp=function(e,t,n,r){var o=n,i=new to(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==$t.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(le.ie&&le.ie<11&&e.isBlock(n)&&e.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},jp=function(e){var t=e.selection.getSel();return t&&t.rangeCount>0};function Up(e){var t,n=[];"onselectionchange"in e.getDoc()||e.on("NodeChange Click MouseUp KeyUp Focus",(function(n){var r,o;o={startContainer:(r=e.selection.getRng()).startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset},"nodechange"!==n.type&&ch(o,t)||e.fire("SelectionChange"),t=o})),e.on("contextmenu",(function(){e.fire("SelectionChange")})),e.on("SelectionChange",(function(){var t=e.selection.getStart(!0);!t||!le.range&&e.selection.isCollapsed()||jp(e)&&!function(t){var r,o;if((o=e.$(t).parentsUntil(e.getBody()).add(t)).length===n.length){for(r=o.length;r>=0&&o[r]===n[r];r--);if(-1===r)return n=o,!0}return n=o,!1}(t)&&e.dom.isChildOf(t,e.getBody())&&e.nodeChanged({selectionChange:!0})})),e.on("MouseUp",(function(t){!t.isDefaultPrevented()&&jp(e)&&("IMG"===e.selection.getNode().nodeName?ge.setEditorTimeout(e,(function(){e.nodeChanged()})):e.nodeChanged())})),this.nodeChanged=function(t){var n,r,o,i=e.selection;e.initialized&&i&&!e.settings.disable_nodechange&&!e.readonly&&(o=e.getBody(),(n=i.getStart(!0)||o).ownerDocument===e.getDoc()&&e.dom.isChildOf(n,o)||(n=o),r=[],e.dom.getParent(n,(function(e){if(e===o)return!0;r.push(e)})),(t=t||{}).element=n,t.parents=r,e.fire("NodeChange",t))}}var Vp,qp={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return le.mac?e.metaKey:e.ctrlKey&&!e.altKey}},$p=function(e){return q(e,(function(e,t){return e.concat(function(e){var t=function(t){return W(t,(function(t){return(t=Ra(t)).node=e,t}))};if(Ro.isElement(e))return t(e.getClientRects());if(Ro.isText(e)){var n=e.ownerDocument.createRange();return n.setStart(e,0),n.setEnd(e,e.data.length),t(n.getClientRects())}}(t))}),[])};!function(e){e[e.Up=-1]="Up",e[e.Down=1]="Down"}(Vp||(Vp={}));var Yp=function(e,t,n,r,o,i){var a,u,s=0,c=[],l=function(r){var i,a,l;for(l=$p([r]),-1===e&&(l=l.reverse()),i=0;i<l.length;i++)if(a=l[i],!n(a,u)){if(c.length>0&&t(a,Wt.last(c))&&s++,a.line=s,o(a))return!0;c.push(a)}};return(u=Wt.last(i.getClientRects()))?(l(a=i.getNode()),function(e,t,n,r){for(;r=as(r,e,Ta,t);)if(n(r))return}(e,r,l,a),c):c},Xp=u(Yp,Vp.Up,Da,Pa),Kp=u(Yp,Vp.Down,Pa,Da),Gp=function(e){return function(t){return function(e,t){return t.line>e}(e,t)}},Jp=function(e){return function(t){return function(e,t){return t.line===e}(e,t)}},Qp=Ro.isContentEditableFalse,Zp=as,ev=function(e,t){return Math.abs(e.left-t)},tv=function(e,t){return Math.abs(e.right-t)},nv=function(e,t){return e>=t.left&&e<=t.right},rv=function(e,t){return Wt.reduce(e,(function(e,n){var r,o;return r=Math.min(ev(e,t),tv(e,t)),o=Math.min(ev(n,t),tv(n,t)),nv(t,n)?n:nv(t,e)?e:o===r&&Qp(n.node)?n:o<r?n:e}))},ov=function(e,t,n,r){for(;r=Zp(r,e,Ta,t);)if(n(r))return},iv=function(e,t,n){var r,o=$p(function(e){return V(Z(e.getElementsByTagName("*")),Gu)}(e)),i=V(o,(function(e){return n>=e.top&&n<=e.bottom}));return(r=rv(i,t))&&(r=rv(function(e,t){var n=[],r=function(e,r){var o;return o=V($p([r]),(function(n){return!e(n,t)})),n=n.concat(o),0===o.length};return n.push(t),ov(Vp.Up,e,u(r,Da),t.node),ov(Vp.Down,e,u(r,Pa),t.node),n}(e,r),t))&&Gu(r.node)?function(e,t){return{node:e.node,before:ev(e,t)<tv(e,t)}}(r,t):null},av=function(e,t,n){if(n.collapsed)return!1;if(le.ie&&le.ie<=11&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(Ro.isElement(r))return z(r.getClientRects(),(function(n){return Ba(n,e,t)}))}return z(n.getClientRects(),(function(n){return Ba(n,e,t)}))},uv=function(e){var t,n,r,o;return o=e.getBoundingClientRect(),n=(t=e.ownerDocument).documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},sv=function(e,t){return function(e,t,n){return{pageX:n.left-e.left+t.left,pageY:n.top-e.top+t.top}}(function(e){return e.inline?uv(e.getBody()):{left:0,top:0}}(e),function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}}(e),function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=uv(e.getContentAreaContainer()),r=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},o={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:o}(e);return{left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}return{left:t.pageX,top:t.pageY}}(e,t))},cv=Ro.isContentEditableFalse,lv=Ro.isContentEditableTrue,fv=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},dv=function(e,t){return function(n){if(function(e){return 0===e.button}(n)){var r=$(t.dom.getParents(n.target),Va(cv,lv)).getOr(null);if(u=t.getBody(),cv(s=r)&&s!==u){var o=t.dom.getPos(r),i=t.getBody(),a=t.getDoc().documentElement;e.element=r,e.screenX=n.screenX,e.screenY=n.screenY,e.maxX=(t.inline?i.scrollWidth:a.offsetWidth)-2,e.maxY=(t.inline?i.scrollHeight:a.offsetHeight)-2,e.relX=n.pageX-o.x,e.relY=n.pageY-o.y,e.width=r.offsetWidth,e.height=r.offsetHeight,e.ghost=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(t,r,e.width,e.height)}}var u,s}},mv=function(e,t){return function(n){if(e.dragging&&function(e,t,n){return t!==n&&!e.dom.isChildOf(t,n)&&!cv(t)}(t,(u=t.selection,3===(s=u.getSel().getRangeAt(0).startContainer).nodeType?s.parentNode:s),e.element)){var r=(i=e.element,(a=i.cloneNode(!0)).removeAttribute("data-mce-selected"),a),o=t.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});o.isDefaultPrevented()||(r=o.targetClone,t.undoManager.transact((function(){fv(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret()})))}var i,a,u,s;hv(e)}},hv=function(e){e.dragging=!1,e.element=null,fv(e.ghost)},gv=function(e){var t,r,o,i,a,u,s={};t=li.DOM,u=n.document,r=dv(s,e),o=function(e,t){var n=ge.throttle((function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n)}),0);return function(r){var o,i,a=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(function(e){return e.element}(e)&&!e.dragging&&a>10){if(t.fire("dragstart",{target:e.element}).isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){var u=function(e,t){return{pageX:t.pageX-e.relX,pageY:t.pageY+5}}(e,sv(t,r));o=e.ghost,i=t.getBody(),o.parentNode!==i&&i.appendChild(o),function(e,t,n,r,o,i){var a=0,u=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>o&&(a=t.pageX+n-o),t.pageY+r>i&&(u=t.pageY+r-i),e.style.width=n-a+"px",e.style.height=r-u+"px"}(e.ghost,u,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY)}}}(s,e),i=mv(s,e),a=function(e,t){return function(){e.dragging&&t.fire("dragend"),hv(e)}}(s,e),e.on("mousedown",r),e.on("mousemove",o),e.on("mouseup",i),t.bind(u,"mousemove",o),t.bind(u,"mouseup",a),e.on("remove",(function(){t.unbind(u,"mousemove",o),t.unbind(u,"mouseup",a)}))},pv=function(e){gv(e),function(e){e.on("drop",(function(t){var n=void 0!==t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(cv(n)||cv(e.dom.getContentEditableParent(n)))&&t.preventDefault()}))}(e)},vv=function(e){var t=Ni((function(){if(!e.removed&&e.selection.getRng().collapsed){var t=Gm(e,e.selection.getRng(),!1);e.selection.setRng(t)}}),0);e.on("focus",(function(){t.throttle()})),e.on("blur",(function(){t.cancel()}))},bv=Ro.isContentEditableTrue,yv=Ro.isContentEditableFalse,wv=function(e,t){for(var n=e.getBody();t&&t!==n;){if(bv(t)||yv(t))return t;t=t.parentNode}return null},xv=function(e){var t,n,r=e.getBody(),o=Xu(e.getBody(),(function(t){return e.dom.isBlock(t)}),(function(){return Jg(e)})),i="sel-"+e.dom.uniqueId(),a=function(t){t&&e.selection.setRng(t)},u=function(){return e.selection.getRng()},s=function(t,n,r,i){return void 0===i&&(i=!0),e.fire("ShowCaret",{target:n,direction:t,before:r}).isDefaultPrevented()?null:(i&&e.selection.scrollIntoView(n,-1===t),o.show(r,n))},c=function(e,t){return t=gs(e,r,t),-1===e?fu.fromRangeStart(t):fu.fromRangeEnd(t)},l=function(e){return ca(e)||ha(e)||ga(e)},f=function(e){return l(e.startContainer)||l(e.endContainer)},d=function(t){var n=e.schema.getShortEndedElements(),r=e.dom.createRng(),o=t.startContainer,i=t.startOffset,a=t.endContainer,u=t.endOffset;return ur(n,o.nodeName.toLowerCase())?0===i?r.setStartBefore(o):r.setStartAfter(o):r.setStart(o,i),ur(n,a.nodeName.toLowerCase())?0===u?r.setEndBefore(a):r.setEndAfter(a):r.setEnd(a,u),r},m=function(n,r){var o,a,u,l,d,m,h,p,v,b,y=e.$,w=e.dom;if(!n)return null;if(n.collapsed){if(!f(n))if(!1===r){if(p=c(-1,n),Gu(p.getNode(!0)))return s(-1,p.getNode(!0),!1,!1);if(Gu(p.getNode()))return s(-1,p.getNode(),!p.isAtEnd(),!1)}else{if(p=c(1,n),Gu(p.getNode()))return s(1,p.getNode(),!p.isAtEnd(),!1);if(Gu(p.getNode(!0)))return s(1,p.getNode(!0),!1,!1)}return null}return l=n.startContainer,d=n.startOffset,m=n.endOffset,3===l.nodeType&&0===d&&yv(l.parentNode)&&(l=l.parentNode,d=w.nodeIndex(l),l=l.parentNode),1!==l.nodeType?null:(m===d+1&&l===n.endContainer&&(o=l.childNodes[d]),yv(o)?(v=b=o.cloneNode(!0),(h=e.fire("ObjectSelected",{target:o,targetClone:v})).isDefaultPrevented()?null:(a=Wi(Xn.fromDom(e.getBody()),"#"+i).fold((function(){return y([])}),(function(e){return y([e.dom()])})),v=h.targetClone,0===a.length&&(a=y('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",i)).appendTo(e.getBody()),n=e.dom.createRng(),v===b&&le.ie?(a.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(v),n.setStartAfter(a[0].firstChild.firstChild),n.setEndAfter(v)):(a.empty().append(" ").append(v).append(" "),n.setStart(a[0].firstChild,1),n.setEnd(a[0].lastChild,0)),a.css({top:w.getPos(o,e.getBody()).y}),a[0].focus(),(u=e.selection.getSel()).removeAllRanges(),u.addRange(n),j(Mi(Xn.fromDom(e.getBody()),"*[data-mce-selected]"),(function(e){mr(e,"data-mce-selected")})),o.setAttribute("data-mce-selected","1"),t=o,g(),n)):null)},h=function(){t&&(t.removeAttribute("data-mce-selected"),Wi(Xn.fromDom(e.getBody()),"#"+i).each(Ei),t=null),Wi(Xn.fromDom(e.getBody()),"#"+i).each(Ei),t=null},g=function(){o.hide()};return le.ceFalse&&(function(){e.on("mouseup",(function(t){var n=u();n.collapsed&&op(e,t.clientX,t.clientY)&&a(Km(e,n,!1))})),e.on("click",(function(t){var n;(n=wv(e,t.target))&&(yv(n)&&(t.preventDefault(),e.focus()),bv(n)&&e.dom.isChildOf(n,e.selection.getNode())&&h())})),e.on("blur NewBlock",(function(){h()})),e.on("ResizeWindow FullscreenStateChanged",(function(){return o.reposition()}));var n=function(t,n){var r,o,i=e.dom.getParent(t,e.dom.isBlock),a=e.dom.getParent(n,e.dom.isBlock);return!(!i||!e.dom.isChildOf(i,a)||!1!==yv(wv(e,i)))||i&&(r=i,o=a,!(e.dom.getParent(r,e.dom.isBlock)===e.dom.getParent(o,e.dom.isBlock)))&&function(e){var t=As(e);if(!e.firstChild)return!1;var n=fu.before(e.firstChild),r=t.next(n);return r&&!wf(r)&&!xf(r)}(i)};!function(e){var t=!1;e.on("touchstart",(function(){t=!1})),e.on("touchmove",(function(){t=!0})),e.on("touchend",(function(n){var r=wv(e,n.target);yv(r)&&(t||(n.preventDefault(),m(Xm(e,r))))}))}(e),e.on("mousedown",(function(t){var o,i=t.target;if((i===r||"HTML"===i.nodeName||e.dom.isChildOf(i,r))&&!1!==op(e,t.clientX,t.clientY))if(o=wv(e,i))yv(o)?(t.preventDefault(),m(Xm(e,o))):(h(),bv(o)&&t.shiftKey||av(t.clientX,t.clientY,e.selection.getRng())||(g(),e.selection.placeCaretAt(t.clientX,t.clientY)));else if(!1===Gu(i)){h(),g();var u=iv(r,t.clientX,t.clientY);if(u&&!n(t.target,u.node)){t.preventDefault();var c=s(1,u.node,u.before,!1);e.getBody().focus(),a(c)}}})),e.on("keypress",(function(t){qp.modifierPressed(t)||(t.keyCode,yv(e.selection.getNode())&&t.preventDefault())})),e.on("getSelectionRange",(function(e){var n=e.range;if(t){if(!t.parentNode)return void(t=null);(n=n.cloneRange()).selectNode(t),e.range=n}})),e.on("setSelectionRange",(function(e){e.range=d(e.range);var t=m(e.range,e.forward);t&&(e.range=t)})),e.on("AfterSetSelectionRange",(function(t){var n,r=t.range;f(r)||function(e){return"mcepastebin"===e.id}(r.startContainer.parentNode)||g(),n=r.startContainer.parentNode,e.dom.hasClass(n,"mce-offscreen-selection")||h()})),e.on("copy",(function(t){var n,r=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!le.ie){var o=(n=e.dom.get(i))?n.getElementsByTagName("*")[0]:n;o&&(t.preventDefault(),r.clearData(),r.setData("text/html",o.outerHTML),r.setData("text/plain",o.outerText))}})),pv(e),vv(e)}(),(n=e.contentStyles).push(o.getCss()),n.push(".mce-content-body .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}.mce-content-body *[contentEditable=false] {cursor: default;}.mce-content-body *[contentEditable=true] {cursor: text;}")),{showCaret:s,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(pa(t),a(u()),e.selection.scrollIntoView(t[0]))},hideFakeCaret:g,destroy:function(){o.destroy(),t=null}}},Cv=function(e){for(var t=e;/<!--|--!?>/g.test(t);)t=t.replace(/<!--|--!?>/g,"");return t},Sv=function(e,t,n){var r,o,i,a,u=1;for(a=e.getShortEndedElements(),(i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r},Ev=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function kv(e,t){void 0===t&&(t=Zo());var n=function(){};!1!==(e=e||{}).fix_self_closing&&(e.fix_self_closing=!0);var r=e.comment?e.comment:n,o=e.cdata?e.cdata:n,i=e.text?e.text:n,a=e.start?e.start:n,u=e.end?e.end:n,s=e.pi?e.pi:n,c=e.doctype?e.doctype:n;return{parse:function(n){var l,f,d,m,h,g,p,v,b,y,w,x,C,S,E,k,N,T,_,R,O,A,D,P,B,I,M,L,F,H=0,z=[],W=0,j=Uo.decode,U=$t.makeMap("src,href,data,background,formaction,poster,xlink:href"),V=/((java|vb)script|mhtml):/i,q=function(e){var t,n;for(t=z.length;t--&&z[t].name!==e;);if(t>=0){for(n=z.length-1;n>=t;n--)(e=z[n]).valid&&u(e.name);z.length=t}},$=function(t,n,r,o,i){var a,u;if(r=(n=n.toLowerCase())in w?n:j(r||o||i||""),C&&!v&&!1===function(e){return 0===e.indexOf("data-")||0===e.indexOf("aria-")}(n)){if(!(a=T[n])&&_){for(u=_.length;u--&&!(a=_[u]).pattern.test(n););-1===u&&(a=null)}if(!a)return;if(a.validValues&&!(r in a.validValues))return}if(U[n]&&!e.allow_script_urls){var s=r.replace(/[\s\u0000-\u001F]+/g,"");try{s=decodeURIComponent(s)}catch(e){s=unescape(s)}if(V.test(s))return;if(function(e,t){return!e.allow_html_data_urls&&(/^data:image\//i.test(t)?!1===e.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(t):/^data:/i.test(t))}(e,s))return}v&&(n in U||0===n.indexOf("on"))||(m.map[n]=r,m.push({name:n,value:r}))};for(B=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),I=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,y=t.getShortEndedElements(),P=e.self_closing_elements||t.getSelfClosingElements(),w=t.getBoolAttrs(),C=e.validate,b=e.remove_internals,F=e.fix_self_closing,M=t.getSpecialElements(),D=n+">";l=B.exec(D);){if(H<l.index&&i(j(n.substr(H,l.index-H))),f=l[6])":"===(f=f.toLowerCase()).charAt(0)&&(f=f.substr(1)),q(f);else if(f=l[7]){if(l.index+l[0].length>n.length){i(j(n.substr(l.index))),H=l.index+l[0].length;continue}":"===(f=f.toLowerCase()).charAt(0)&&(f=f.substr(1)),x=f in y,F&&P[f]&&z.length>0&&z[z.length-1].name===f&&q(f);var Y=Ev(I,l[8]);if(null!==Y){if("all"===Y){H=Sv(t,n,B.lastIndex),B.lastIndex=H;continue}E=!1}if(!C||(S=t.getElementRule(f))){if(E=!0,C&&(T=S.attributes,_=S.attributePatterns),(N=l[8])?((v=-1!==N.indexOf("data-mce-type"))&&b&&(E=!1),(m=[]).map={},N.replace(I,$)):(m=[]).map={},C&&!v){if(R=S.attributesRequired,O=S.attributesDefault,A=S.attributesForced,S.removeEmptyAttrs&&!m.length&&(E=!1),A)for(h=A.length;h--;)p=(k=A[h]).name,"{$uid}"===(L=k.value)&&(L="mce_"+W++),m.map[p]=L,m.push({name:p,value:L});if(O)for(h=O.length;h--;)(p=(k=O[h]).name)in m.map||("{$uid}"===(L=k.value)&&(L="mce_"+W++),m.map[p]=L,m.push({name:p,value:L}));if(R){for(h=R.length;h--&&!(R[h]in m.map););-1===h&&(E=!1)}if(k=m.map["data-mce-bogus"]){if("all"===k){H=Sv(t,n,B.lastIndex),B.lastIndex=H;continue}E=!1}}E&&a(f,m,x)}else E=!1;if(d=M[f]){d.lastIndex=H=l.index+l[0].length,(l=d.exec(n))?(E&&(g=n.substr(H,l.index-H)),H=l.index+l[0].length):(g=n.substr(H),H=n.length),E&&(g.length>0&&i(g,!0),u(f)),B.lastIndex=H;continue}x||(N&&N.indexOf("/")===N.length-1?E&&u(f):z.push({name:f,valid:E}))}else(f=l[1])?(">"===f.charAt(0)&&(f=" "+f),e.allow_conditional_comments||"[if"!==f.substr(0,3).toLowerCase()||(f=" "+f),r(f)):(f=l[2])?o(Cv(f)):(f=l[3])?c(f):(f=l[4])&&s(f,l[5]);H=l.index+l[0].length}for(H<n.length&&i(j(n.substr(H))),h=z.length-1;h>=0;h--)(f=z[h]).valid&&u(f.name)}}}!function(e){e.findEndTag=Sv}(kv||(kv={}));var Nv=kv,Tv=function(e,t){var n,r,o,i,a,u=t,s=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,c=e.schema;for(u=function(e,t){var n=new RegExp(["\\s?("+e.join("|")+')="[^"]+"'].join("|"),"gi");return t.replace(n,"")}(e.getTempAttrs(),u),a=c.getShortEndedElements();i=s.exec(u);)r=s.lastIndex,o=i[0].length,n=a[i[1]]?r:Nv.findEndTag(c,u,r),u=u.substring(0,r-o)+u.substring(n),s.lastIndex=r-o;return oa(u)},_v={trimExternal:Tv,trimInternal:Tv},Rv=0,Ov=2,Av=1,Dv=function(e,t){var n=e.length+t.length+2,r=new Array(n),o=new Array(n),i=function(n,r,o,a,s){var c=u(n,r,o,a);if(null===c||c.start===r&&c.diag===r-a||c.end===n&&c.diag===n-o)for(var l=n,f=o;l<r||f<a;)l<r&&f<a&&e[l]===t[f]?(s.push([0,e[l]]),++l,++f):r-n>a-o?(s.push([2,e[l]]),++l):(s.push([1,t[f]]),++f);else{i(n,c.start,o,c.start-c.diag,s);for(var d=c.start;d<c.end;++d)s.push([0,e[d]]);i(c.end,r,c.end-c.diag,a,s)}},a=function(n,r,o,i){for(var a=n;a-r<i&&a<o&&e[a]===t[a-r];)++a;return function(e,t,n){return{start:e,end:t,diag:n}}(n,a,r)},u=function(n,i,u,s){var c=i-n,l=s-u;if(0===c||0===l)return null;var f,d,m,h,g,p=c-l,v=l+c,b=(v%2==0?v:v+1)/2;for(r[1+b]=n,o[1+b]=i+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){for(m=d+b,d===-f||d!==f&&r[m-1]<r[m+1]?r[m]=r[m+1]:r[m]=r[m-1]+1,g=(h=r[m])-n+u-d;h<i&&g<s&&e[h]===t[g];)r[m]=++h,++g;if(p%2!=0&&p-f<=d&&d<=p+f&&o[m-p]<=r[m])return a(o[m-p],d+n-u,i,s)}for(d=p-f;d<=p+f;d+=2){for(m=d+b-p,d===p-f||d!==p+f&&o[m+1]<=o[m-1]?o[m]=o[m+1]-1:o[m]=o[m-1],g=(h=o[m]-1)-n+u-d;h>=n&&g>=u&&e[h]===t[g];)o[m]=h--,g--;if(p%2==0&&-f<=d&&d<=f&&o[m]<=r[m+p])return a(o[m],d+n-u,i,s)}}},s=[];return i(0,e.length,0,t.length,s),s},Pv=function(e){return Ro.isElement(e)?e.outerHTML:Ro.isText(e)?Uo.encodeRaw(e.data,!1):Ro.isComment(e)?"\x3c!--"+e.data+"--\x3e":""},Bv=function(e,t,r){var o=function(e){var t,r,o;for(o=n.document.createElement("div"),t=n.document.createDocumentFragment(),e&&(o.innerHTML=e);r=o.firstChild;)t.appendChild(r);return t}(t);if(e.hasChildNodes()&&r<e.childNodes.length){var i=e.childNodes[r];i.parentNode.insertBefore(o,i)}else e.appendChild(o)},Iv=function(e){return V(W(Z(e.childNodes),Pv),(function(e){return e.length>0}))},Mv=function(e,t){var n=W(Z(t.childNodes),Pv);return function(e,t){var n=0;j(e,(function(e){e[0]===Rv?n++:e[0]===Av?(Bv(t,e[1],n),n++):e[0]===Ov&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(t,n)}))}(Dv(n,e),t),t},Lv=Ti(N.none()),Fv=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},Hv=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},zv=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},Wv=function(e){var t=Xn.fromTag("body",Lv.get().getOrThunk((function(){var e=n.document.implementation.createHTMLDocument("undo");return Lv.set(N.some(e)),e})));return ta(t,zv(e)),j(Mi(t,"*[data-mce-bogus]"),ki),t.dom().innerHTML},jv=function(e){var t,n,r;return t=Iv(e.getBody()),-1!==(n=(r=X(t,(function(t){var n=_v.trimInternal(e.serializer,t);return n.length>0?[n]:[]}))).join("")).indexOf("</iframe>")?Fv(r):Hv(n)},Uv=function(e,t,n){"fragmented"===t.type?Mv(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},Vv=function(e,t){return!(!e||!t)&&(!!function(e,t){return zv(e)===zv(t)}(e,t)||function(e,t){return Wv(e)===Wv(t)}(e,t))};function qv(e){var t,n,r=this,o=0,i=[],a=0,u=function(){return 0===a},s=function(e){u()&&(r.typing=e)},c=function(t){e.setDirty(t)},l=function(e){s(!1),r.add({},e)},f=function(){r.typing&&(s(!1),r.add())};return e.on("init",(function(){r.add()})),e.on("BeforeExecCommand",(function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(f(),r.beforeChange())})),e.on("ExecCommand",(function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&l(e)})),e.on("ObjectResizeStart Cut",(function(){r.beforeChange()})),e.on("SaveContent ObjectResized blur",l),e.on("DragEnd",l),e.on("KeyUp",(function(t){var o=t.keyCode;t.isDefaultPrevented()||((o>=33&&o<=36||o>=37&&o<=40||45===o||t.ctrlKey)&&(l(),e.nodeChanged()),46!==o&&8!==o||e.nodeChanged(),n&&r.typing&&!1===Vv(jv(e),i[0])&&(!1===e.isDirty()&&(c(!0),e.fire("change",{level:i[0],lastLevel:null})),e.fire("TypingUndo"),n=!1,e.nodeChanged()))})),e.on("KeyDown",(function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(t>=33&&t<=36||t>=37&&t<=40||45===t)r.typing&&l(e);else{var o=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||t>20)||224===t||91===t||r.typing||o||(r.beforeChange(),s(!0),r.add({},e),n=!0)}})),e.on("MouseDown",(function(e){r.typing&&l(e)})),e.on("input",(function(e){e.inputType&&("insertReplacementText"===e.inputType||function(e){return"insertText"===e.inputType&&null===e.data}(e))&&l(e)})),e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),e.on("AddUndo Undo Redo ClearUndos",(function(t){t.isDefaultPrevented()||e.nodeChanged()})),r={data:i,typing:!1,beforeChange:function(){u()&&(t=Du.getUndoBookmark(e.selection))},add:function(n,r){var a,s,l,f=e.settings;if(l=jv(e),n=n||{},n=$t.extend(n,l),!1===u()||e.removed)return null;if(s=i[o],e.fire("BeforeAddUndo",{level:n,lastLevel:s,originalEvent:r}).isDefaultPrevented())return null;if(s&&Vv(s,n))return null;if(i[o]&&(i[o].beforeBookmark=t),f.custom_undo_redo_levels&&i.length>f.custom_undo_redo_levels){for(a=0;a<i.length-1;a++)i[a]=i[a+1];i.length--,o=i.length}n.bookmark=Du.getUndoBookmark(e.selection),o<i.length-1&&(i.length=o+1),i.push(n),o=i.length-1;var d={level:n,lastLevel:s,originalEvent:r};return e.fire("AddUndo",d),o>0&&(c(!0),e.fire("change",d)),n},undo:function(){var t;return r.typing&&(r.add(),r.typing=!1,s(!1)),o>0&&(t=i[--o],Uv(e,t,!0),c(!0),e.fire("undo",{level:t})),t},redo:function(){var t;return o<i.length-1&&(t=i[++o],Uv(e,t,!1),c(!0),e.fire("redo",{level:t})),t},clear:function(){i=[],o=0,r.typing=!1,r.data=i,e.fire("ClearUndos")},hasUndo:function(){return o>0||r.typing&&i[0]&&!Vv(jv(e),i[0])},hasRedo:function(){return o<i.length-1&&!r.typing},transact:function(e){return f(),r.beforeChange(),r.ignore(e),r.add()},ignore:function(e){try{a++,e()}finally{a--}},extra:function(t,n){var a,u;r.transact(t)&&(u=i[o].bookmark,a=i[o-1],Uv(e,a,!0),r.transact(n)&&(i[o-1].beforeBookmark=u))}}}var $v={},Yv=Wt.filter,Xv=Wt.each;!function(e,t){var n=$v[e];n||($v[e]=n=[]),$v[e].push(t)}("pre",(function(e){var t,n,r=e.selection.getRng();t=Ro.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),Xv(Yv(Yv(n,t),(function(e){return t(e.previousSibling)&&-1!==Wt.indexOf(n,e.previousSibling)})),(function(e){var t,n;t=e.previousSibling,dn(n=e).remove(),dn(t).append("<br><br>").append(n.childNodes)})))}));var Kv=function(e,t){Xv($v[e],(function(e){e(t)}))},Gv=/^(src|href|style)$/,Jv=$t.each,Qv=nc.isEq,Zv=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},eb=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],Ro.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[o>i?i:o]),Ro.isText(r)&&n&&o>=r.nodeValue.length&&(r=new to(r,e.getBody()).next()||r),Ro.isText(r)&&!n&&0===o&&(r=new to(r,e.getBody()).prev()||r),r},tb=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},nb=function(e,t,n,r,o){var i=Xn.fromDom(t),a=Xn.fromDom(e.create(r,o)),u=n?Br(i):Pr(i);return Ci(a,u),n?(bi(i,a),wi(a,i)):(yi(i,a),xi(a,i)),a.dom()},rb=function(e,t,n,r){return!(t=nc.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},ob=function(e,t,n,r,o){var i,a,u,s=e.dom;if(!function(e,t,n){return!!Qv(t,n.inline)||!!Qv(t,n.block)||(n.selector?Ro.isElement(t)&&e.is(t,n.selector):void 0)}(s,r,t)&&!function(e,t){return t.links&&"A"===e.tagName}(r,t))return!1;if("all"!==t.remove)for(Jv(t.styles,(function(e,i){e=nc.normalizeStyleValue(s,nc.replaceVars(e,n),i),"number"==typeof i&&(i=e,o=0),(t.remove_similar||!o||Qv(nc.getStyle(s,o,i),e))&&s.setStyle(r,i,""),u=1})),u&&""===s.getAttrib(r,"style")&&(r.removeAttribute("style"),r.removeAttribute("data-mce-style")),Jv(t.attributes,(function(e,t){var i;if(e=nc.replaceVars(e,n),"number"==typeof t&&(t=e,o=0),!o||Qv(s.getAttrib(o,t),e)){if("class"===t&&(e=s.getAttrib(r,t))&&(i="",Jv(e.split(/\s+/),(function(e){/mce\-\w+/.test(e)&&(i+=(i?" ":"")+e)})),i))return void s.setAttrib(r,t,i);"class"===t&&r.removeAttribute("className"),Gv.test(t)&&r.removeAttribute("data-mce-"+t),r.removeAttribute(t)}})),Jv(t.classes,(function(e){e=nc.replaceVars(e,n),o&&!s.hasClass(o,e)||s.removeClass(r,e)})),a=s.getAttribs(r),i=0;i<a.length;i++){var c=a[i].nodeName;if(0!==c.indexOf("_")&&0!==c.indexOf("data-"))return!1}return"none"!==t.remove?(function(e,t,n){var r,o=t.parentNode,i=e.dom,a=e.settings.forced_root_block;n.block&&(a?o===i.getRoot()&&(n.list_block&&Qv(t,n.list_block)||Jv($t.grep(t.childNodes),(function(t){nc.isValid(e,a,t.nodeName.toLowerCase())?r?r.appendChild(t):(r=tb(i,t,a),i.setAttribs(r,e.settings.forced_root_block_attrs)):r=0}))):i.isBlock(t)&&!i.isBlock(o)&&(rb(i,t,!1)||rb(i,t.firstChild,!0,1)||t.insertBefore(i.create("br"),t.firstChild),rb(i,t,!0)||rb(i,t.lastChild,!1,1)||t.appendChild(i.create("br")))),n.selector&&n.inline&&!Qv(n.inline,t)||i.remove(t,1)}(e,r,t),!0):void 0},ib=ob,ab=function(e,t,n,r,o){var i,a,u=e.formatter.get(t),s=u[0],c=!0,l=e.dom,f=e.selection,d=function(r){var i=function(e,t,n,r,o){var i;return Jv(nc.getParents(e.dom,t.parentNode).reverse(),(function(t){var a;i||"_start"===t.id||"_end"===t.id||(a=Em.matchNode(e,t,n,r,o))&&!1!==a.split&&(i=t)})),i}(e,r,t,n,o);return function(e,t,n,r,o,i,a,u){var s,c,l,f,d,m,h=e.dom;if(n){for(m=n.parentNode,s=r.parentNode;s&&s!==m;s=s.parentNode){for(c=h.clone(s,!1),d=0;d<t.length;d++)if(ob(e,t[d],u,c,c)){c=0;break}c&&(l&&c.appendChild(l),f||(f=c),l=c)}!i||a.mixed&&h.isBlock(n)||(r=h.split(n,r)),l&&(o.parentNode.insertBefore(l,o),f.appendChild(o))}return r}(e,u,i,r,r,!0,s,n)},m=function(t){var r,o,i,a,f;if(Ro.isElement(t)&&l.getContentEditable(t)&&(a=c,c="true"===l.getContentEditable(t),f=!0),r=$t.grep(t.childNodes),c&&!f)for(o=0,i=u.length;o<i&&!ob(e,u[o],n,t,t);o++);if(s.deep&&r.length){for(o=0,i=r.length;o<i;o++)m(r[o]);f&&(c=a)}},h=function(e){var t=l.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return function(e){return Qs(e)&&Ro.isElement(e)&&("_start"===e.id||"_end"===e.id)}(n)&&(n=n[e?"firstChild":"lastChild"]),Ro.isText(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),l.remove(t,!0),n},g=function(t){var n,r,o=t.commonAncestorContainer;if(t=gc(e,t,u,!0),s.split){if(t=Nm(t),(n=eb(e,t,!0))!==(r=eb(e,t))){if(/^(TR|TH|TD)$/.test(n.nodeName)&&n.firstChild&&(n="TR"===n.nodeName?n.firstChild.firstChild||n:n.firstChild||n),o&&/^T(HEAD|BODY|FOOT|R)$/.test(o.nodeName)&&function(e){return/^(TH|TD)$/.test(e.nodeName)}(r)&&r.firstChild&&(r=r.firstChild||r),Zv(l,n,r)){var i=N.from(n.firstChild).getOr(n);return d(nb(l,i,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void h(!0)}if(Zv(l,r,n))return i=N.from(r.lastChild).getOr(r),d(nb(l,i,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void h(!1);n=tb(l,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=tb(l,r,"span",{id:"_end","data-mce-type":"bookmark"}),d(n),d(r),n=h(!0),r=h()}else n=r=d(n);t.startContainer=n.parentNode?n.parentNode:n,t.startOffset=l.nodeIndex(n),t.endContainer=r.parentNode?r.parentNode:r,t.endOffset=l.nodeIndex(r)+1}vc(l,t,(function(t){Jv(t,(function(t){m(t),Ro.isElement(t)&&"underline"===e.dom.getStyle(t,"text-decoration")&&t.parentNode&&"underline"===nc.getTextDecoration(l,t.parentNode)&&ob(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,t)}))}))};if(r)r.nodeType?((a=l.createRng()).setStartBefore(r),a.setEndAfter(r),g(a)):g(r);else if("false"!==l.getContentEditable(f.getNode()))f.isCollapsed()&&s.inline&&!l.select("td[data-mce-selected],th[data-mce-selected]").length?function(e,t,n,r){var o,i,a,u,s,c,l,f=e.dom,d=e.selection,m=[],h=d.getRng();for(o=h.startContainer,i=h.startOffset,s=o,3===o.nodeType&&(i!==o.nodeValue.length&&(u=!0),s=s.parentNode);s;){if(Em.matchNode(e,s,t,n,r)){c=s;break}s.nextSibling&&(u=!0),m.push(s),s=s.parentNode}if(c)if(u){a=d.getBookmark(),h.collapse(!0);var g=gc(e,h,e.formatter.get(t),!0);g=Nm(g),e.formatter.remove(t,n,g),d.moveToBookmark(a)}else{l=Bu(e.getBody(),c);var p=Om(!1).dom(),v=Im(m,p);Pm(e,p,l||c),Am(e,l,!1),d.setCursorLocation(v,1),f.isEmpty(c)&&f.remove(c)}}(e,t,n,o):(i=Du.getPersistentBookmark(e.selection,!0),g(f.getRng()),f.moveToBookmark(i),s.inline&&Em.match(e,t,n,f.getStart())&&nc.moveStart(l,f,f.getRng()),e.nodeChanged());else{r=f.getNode();for(var p=0,v=u.length;p<v&&(!u[p].ceFalseOverride||!ob(e,u[p],n,r,r));p++);}},ub=$t.each,sb=function(e){return e&&1===e.nodeType&&!Qs(e)&&!Pu(e)&&!Ro.isBogus(e)},cb=function(e,t){var n;for(n=e;n;n=n[t]){if(3===n.nodeType&&0!==n.nodeValue.length)return e;if(1===n.nodeType&&!Qs(n))return n}return e},lb=function(e,t,n){var r,o,i=new Ic(e);if(t&&n&&(t=cb(t,"previousSibling"),n=cb(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)o=r,r=r.nextSibling,t.appendChild(o);return e.remove(n),$t.each($t.grep(n.childNodes),(function(e){t.appendChild(e)})),t}return n},fb=function(e,t,n){ub(e.childNodes,(function(e){sb(e)&&(t(e)&&n(e),e.hasChildNodes()&&fb(e,t,n))}))},db=function(e,t){return u((function(t,n){return!(!n||!nc.getStyle(e,n,t))}),t)},mb=function(e,t,n){return u((function(t,n,r){e.setStyle(r,t,n),""===r.getAttribute("style")&&r.removeAttribute("style"),hb(e,r)}),t,n)},hb=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},gb=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=nc.getTextDecoration(e,t.parentNode),e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null))},pb=function(e,t,n,r){ub(t,(function(t){ub(e.dom.select(t.inline,r),(function(r){sb(r)&&ib(e,t,n,r,t.exact?r:null)})),function(e,t,n){if(t.clear_child_styles){var r=t.links?"*:not(a)":"*";ub(e.select(r,n),(function(n){sb(n)&&ub(t.styles,(function(t,r){e.setStyle(n,r,"")}))}))}}(e.dom,t,r)}))},vb=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&($t.walk(r,u(gb,e),"childNodes"),gb(e,r))},bb=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&fb(r,db(e,"fontSize"),mb(e,"backgroundColor",nc.replaceVars(t.styles.backgroundColor,n)))},yb=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(fb(r,db(e,"fontSize"),mb(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},wb=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=lb(e,nc.getNonWhiteSpaceSibling(r),r),r=lb(e,r,nc.getNonWhiteSpaceSibling(r,!0)))},xb=function(e,t,n,r,o){Em.matchNode(e,o.parentNode,n,r)&&ib(e,t,r,o)||t.merge_with_parents&&e.dom.getParent(o.parentNode,(function(i){if(Em.matchNode(e,i,n,r))return ib(e,t,r,o),!0}))},Cb=$t.each,Sb=function(e,t,n,r){var o,i,a=e.formatter.get(t),u=a[0],s=!r&&e.selection.isCollapsed(),c=e.dom,l=e.selection,f=function(e,t){if(t=t||u,e){if(t.onformat&&t.onformat(e,t,n,r),Cb(t.styles,(function(t,r){c.setStyle(e,r,nc.replaceVars(t,n))})),t.styles){var o=c.getAttrib(e,"style");o&&e.setAttribute("data-mce-style",o)}Cb(t.attributes,(function(t,r){c.setAttrib(e,r,nc.replaceVars(t,n))})),Cb(t.classes,(function(t){t=nc.replaceVars(t,n),c.hasClass(e,t)||c.addClass(e,t)}))}},d=function(e,t){var n=!1;return!!u.selector&&(Cb(e,(function(e){if(!("collapsed"in e&&e.collapsed!==s))return c.is(t,e.selector)&&!Pu(t)?(f(t,e),n=!0,!1):void 0})),n)},m=function(r,o,i,s){var c,l,m=[],h=!0;c=u.inline||u.block,l=r.create(c),f(l),vc(r,o,(function(o){var i,g=function(o){var p,v,b,y;if(y=h,p=o.nodeName.toLowerCase(),v=o.parentNode.nodeName.toLowerCase(),1===o.nodeType&&r.getContentEditable(o)&&(y=h,h="true"===r.getContentEditable(o),b=!0),nc.isEq(p,"br"))return i=0,void(u.block&&r.remove(o));if(u.wrapper&&Em.matchNode(e,o,t,n))i=0;else{if(h&&!b&&u.block&&!u.wrapper&&nc.isTextBlock(e,p)&&nc.isValid(e,v,c))return o=r.rename(o,c),f(o),m.push(o),void(i=0);if(u.selector){var w=d(a,o);if(!u.inline||w)return void(i=0)}!h||b||!nc.isValid(e,c,p)||!nc.isValid(e,v,c)||!s&&3===o.nodeType&&1===o.nodeValue.length&&65279===o.nodeValue.charCodeAt(0)||Pu(o)||u.inline&&r.isBlock(o)?(i=0,Cb($t.grep(o.childNodes),g),b&&(h=y),i=0):(i||(i=r.clone(l,!1),o.parentNode.insertBefore(i,o),m.push(i)),i.appendChild(o))}};Cb(o,g)})),!0===u.links&&Cb(m,(function(e){var t=function(e){"A"===e.nodeName&&f(e,u),Cb($t.grep(e.childNodes),t)};t(e)})),Cb(m,(function(o){var i,s=function(e){var t=!1;return Cb(e.childNodes,(function(e){if(function(e){return e&&1===e.nodeType&&!Qs(e)&&!Pu(e)&&!Ro.isBogus(e)}(e))return t=e,!1})),t};i=function(e){var t=0;return Cb(e.childNodes,(function(e){nc.isWhiteSpaceNode(e)||Qs(e)||t++})),t}(o),!(m.length>1)&&r.isBlock(o)||0!==i?(u.inline||u.wrapper)&&(u.exact||1!==i||(o=function(e){var t,n;return(t=s(e))&&!Qs(t)&&Em.matchName(r,t,u)&&(n=r.clone(t,!1),f(n),r.replace(n,e,!0),r.remove(t,1)),n||e}(o)),pb(e,a,n,o),xb(e,u,t,n,o),bb(r,u,n,o),yb(r,u,n,o),wb(r,u,n,o)):r.remove(o,1)}))};if("false"!==c.getContentEditable(l.getNode())){if(u){if(r)r.nodeType?d(a,r)||((i=c.createRng()).setStartBefore(r),i.setEndAfter(r),m(c,gc(e,i,a),0,!0)):m(c,r,0,!0);else if(s&&u.inline&&!c.select("td[data-mce-selected],th[data-mce-selected]").length)!function(e,t,n){var r,o,i,a,u,s,c=e.selection;a=(r=c.getRng(!0)).startOffset,s=r.startContainer.nodeValue,(o=Bu(e.getBody(),c.getStart()))&&(i=Rm(o));var l=/[^\s\u00a0\u00ad\u200b\ufeff]/;s&&a>0&&a<s.length&&l.test(s.charAt(a))&&l.test(s.charAt(a-1))?(u=c.getBookmark(),r.collapse(!0),r=gc(e,r,e.formatter.get(t)),r=Nm(r),e.formatter.apply(t,n,r),c.moveToBookmark(u)):(o&&i.nodeValue===Tm?e.formatter.apply(t,n,o):(i=(o=function(e,t){return e.importNode(t,!0)}(e.getDoc(),Om(!0).dom())).firstChild,r.insertNode(o),a=1,e.formatter.apply(t,n,o)),c.setCursorLocation(i,a))}(e,t,n);else{var h=e.selection.getNode();e.settings.forced_root_block||!a[0].defaultBlock||c.getParent(h,c.isBlock)||Sb(e,a[0].defaultBlock),e.selection.setRng(Vc(e.selection.getRng())),o=Du.getPersistentBookmark(e.selection,!0),m(c,gc(e,l.getRng(),a)),u.styles&&vb(c,u,n,h),l.moveToBookmark(o),nc.moveStart(c,l,l.getRng()),e.nodeChanged()}Kv(t,e)}}else{r=l.getNode();for(var g=0,p=a.length;g<p;g++)if(a[g].ceFalseOverride&&c.is(r,a[g].selector))return void f(r,a[g])}},Eb={applyFormat:Sb},kb=$t.each,Nb=function(e,t,n,r,o){null===t.get()&&function(e,t){var n={};e.set({}),t.on("NodeChange",(function(r){var o=nc.getParents(t.dom,r.element),i={};o=$t.grep(o,(function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")})),kb(e.get(),(function(e,r){kb(o,(function(a){return t.formatter.matchNode(a,r,{},e.similar)?(n[r]||(kb(e,(function(e){e(!0,{node:a,format:r,parents:o})})),n[r]=e),i[r]=e,!1):!Em.matchesUnInheritedFormatSelector(t,a,r)&&void 0}))})),kb(n,(function(e,t){i[t]||(delete n[t],kb(e,(function(e){e(!1,{node:r.element,format:t,parents:o})})))}))}))}(t,e),function(e,t,n,r){var o=e.get();kb(t.split(","),(function(e){o[e]||(o[e]=[],o[e].similar=r),o[e].push(n)})),e.set(o)}(t,n,r,o)},Tb=function(e){var t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(t,n,r){$t.each(r,(function(n,r){e.setAttrib(t,r,n)}))}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return $t.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),(function(e){t[e]={block:e,remove:"all"}})),t},_b=$t.each,Rb=li.DOM,Ob=function(e,t){var n,r,o,i=t&&t.schema||Zo({}),a=function(e){var t;return r="string"==typeof e?{name:e,classes:[],attrs:{}}:e,function(e,t){t.classes.length&&Rb.addClass(e,t.classes.join(" ")),Rb.setAttribs(e,t.attrs)}(t=Rb.create(r.name),r),t},u=function(e,t,n){var r,o,s,c=t.length>0&&t[0],l=c&&c.name;if(s=function(e,t){var n="string"!=typeof e?e.nodeName.toLowerCase():e,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(t&&-1!==$t.inArray(o,t)?t:o[0])}(e,l))l===s?(o=t[0],t=t.slice(1)):o=s;else if(c)o=t[0],t=t.slice(1);else if(!n)return e;return o&&(r=a(o)).appendChild(e),n&&(r||(r=Rb.create("div")).appendChild(e),$t.each(n,(function(t){var n=a(t);r.insertBefore(n,e)}))),u(r,t,o&&o.siblings)};return e&&e.length?(r=e[0],n=a(r),(o=Rb.create("div")).appendChild(u(n,e.slice(1),r.siblings)),o):""},Ab=function(e){var t,n={classes:[],attrs:{}};return"*"!==(e=n.selector=$t.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(e,t,r,o,i){switch(t){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==$t.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var a=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);a&&(n.attrs[a[1]]=a[2])}return""}))),n.name=t||"div",n},Db=function(e){return e&&"string"==typeof e?(e=(e=e.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),$t.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(e){var t=$t.map(e.split(/(?:~\+|~|\+)/),Ab),n=t.pop();return t.length&&(n.siblings=t),n})).reverse()):[]},Pb=function(e,t){var n,r,o,i,a,u,s="";if(!1===(u=e.settings.preview_styles))return"";"string"!=typeof u&&(u="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var c=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof t){if(!(t=e.formatter.get(t)))return;t=t[0]}return"preview"in t&&!1===(u=t.preview)?"":(n=t.block||t.inline||"span",(i=Db(t.selector)).length?(i[0].name||(i[0].name=n),n=t.selector,r=Ob(i,e)):r=Ob([n],e),o=Rb.select(n,r)[0]||r.firstChild,_b(t.styles,(function(e,t){(e=c(e))&&Rb.setStyle(o,t,e)})),_b(t.attributes,(function(e,t){(e=c(e))&&Rb.setAttrib(o,t,e)})),_b(t.classes,(function(e){e=c(e),Rb.hasClass(o,e)||Rb.addClass(o,e)})),e.fire("PreviewFormats"),Rb.setStyles(r,{position:"absolute",left:-65535}),e.getBody().appendChild(r),a=Rb.getStyle(e.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,_b(u.split(" "),(function(t){var n=Rb.getStyle(o,t,!0);if(!("background-color"===t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Rb.getStyle(e.getBody(),t,!0),"#ffffff"===Rb.toHex(n).toLowerCase())||"color"===t&&"#000000"===Rb.toHex(n).toLowerCase())){if("font-size"===t&&/em|%$/.test(n)){if(0===a)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*a+"px"}"border"===t&&n&&(s+="padding:0 2px;"),s+=t+":"+n+";"}})),e.fire("AfterPreviewFormats"),Rb.remove(r),s)},Bb=function(e,t,n,r,o){var i=t.get(n);!Em.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?Eb.applyFormat(e,n,r,o):ab(e,n,r,o)},Ib=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])};function Mb(e){var t=function(e){var t={},n=function(e,r){e&&("string"!=typeof e?$t.each(e,(function(e,t){n(t,e)})):(r=r.length?r:[r],$t.each(r,(function(e){void 0===e.deep&&(e.deep=!e.selector),void 0===e.split&&(e.split=!e.selector||e.inline),void 0===e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))})),t[e]=r))};return n(Tb(e.dom)),n(e.settings.formats),{get:function(e){return e?t[e]:t},register:n,unregister:function(e){return e&&t[e]&&delete t[e],t}}}(e),n=Ti(null);return Ib(e),Mm(e),{get:t.get,register:t.register,unregister:t.unregister,apply:u(Eb.applyFormat,e),remove:u(ab,e),toggle:u(Bb,e,t),match:u(Em.match,e),matchAll:u(Em.matchAll,e),matchNode:u(Em.matchNode,e),canApply:u(Em.canApply,e),formatChanged:u(Nb,e,n),getCssText:u(Pb,e)}}var Lb,Fb=Object.prototype.hasOwnProperty,Hb=(Lb=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Fb.call(o,i)&&(n[i]=Lb(n[i],o[i]))}return n}),zb=function(e,t,n){e.addAttributeFilter("data-mce-tabindex",(function(e,t){for(var n,r=e.length;r--;)(n=e[r]).attr("tabindex",n.attributes.map["data-mce-tabindex"]),n.attr(t,null)})),e.addAttributeFilter("src,href,style",(function(e,r){for(var o,i,a=e.length,u="data-mce-"+r,s=t.url_converter,c=t.url_converter_scope;a--;)void 0!==(i=(o=e[a]).attributes.map[u])?(o.attr(r,i.length>0?i:null),o.attr(u,null)):(i=o.attributes.map[r],"style"===r?i=n.serializeStyle(n.parseStyle(i),o.name):s&&(i=s.call(c,i,r,o.name)),o.attr(r,i.length>0?i:null))})),e.addAttributeFilter("class",(function(e){for(var t,n,r=e.length;r--;)(n=(t=e[r]).attr("class"))&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr("class",n.length>0?n:null))})),e.addAttributeFilter("data-mce-type",(function(e,t,n){for(var r,o=e.length;o--;)"bookmark"!==(r=e[o]).attributes.map["data-mce-type"]||n.cleanup||(N.from(r.firstChild).exists((function(e){return!na(e.value)}))?r.unwrap():r.remove())})),e.addNodeFilter("noscript",(function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=Uo.decode(t.value))})),e.addNodeFilter("script,style",(function(e,n){for(var r,o,i,a=e.length,u=function(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};a--;)o=(r=e[a]).firstChild?r.firstChild.value:"","script"===n?((i=r.attr("type"))&&r.attr("type","mce-no/type"===i?null:i.replace(/^mce\-/,"")),"xhtml"===t.element_format&&o.length>0&&(r.firstChild.value="// <![CDATA[\n"+u(o)+"\n// ]]>")):"xhtml"===t.element_format&&o.length>0&&(r.firstChild.value="\x3c!--\n"+u(o)+"\n--\x3e")})),e.addNodeFilter("#comment",(function(e){for(var t,n=e.length;n--;)0===(t=e[n]).value.indexOf("[CDATA[")?(t.name="#cdata",t.type=4,t.value=t.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===t.value.indexOf("mce:protected ")&&(t.name="#text",t.type=3,t.raw=!0,t.value=unescape(t.value).substr(14))})),e.addNodeFilter("xml:namespace,input",(function(e,t){for(var n,r=e.length;r--;)7===(n=e[r]).type?n.remove():1===n.type&&("input"!==t||"type"in n.attributes.map||n.attr("type","text"))})),e.addAttributeFilter("data-mce-type",(function(t){j(t,(function(t){"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(e.schema.getNonEmptyElements())?t.remove():t.unwrap())}))})),e.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",(function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}))},Wb=function(e){var t,n,r=function(e){return e&&"br"===e.name};r(t=e.lastChild)&&r(n=t.prev)&&(t.remove(),n.remove())},jb=function(e,t,r){return function(e,t){return e&&e.hasEventListeners("PreProcess")&&!t.no_events}(e,r)?function(e,t,r){var o,i,a,u=e.dom;return t=t.cloneNode(!0),(o=n.document.implementation).createHTMLDocument&&(i=o.createHTMLDocument(""),$t.each("BODY"===t.nodeName?t.childNodes:[t],(function(e){i.body.appendChild(i.importNode(e,!0))})),t="BODY"!==t.nodeName?i.body.firstChild:i.body,a=u.doc,u.doc=i),sg(e,Hb(r,{node:t})),a&&(u.doc=a),t}(e,t,r):t},Ub=function(e,t,n){e.addNodeFilter("font",(function(e){j(e,(function(e){var r=t.parse(e.attr("style")),o=e.attr("color"),i=e.attr("face"),a=e.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),a&&(r["font-size"]=n[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",t.serialize(r)),function(e,t){j(t,(function(t){e.attr(t,null)}))}(e,["color","face","size"])}))}))},Vb=function(e,t){var n=ti();t.convert_fonts_to_spans&&Ub(e,n,$t.explode(t.font_size_legacy_values)),function(e,t){e.addNodeFilter("strike",(function(e){j(e,(function(e){var n=t.parse(e.attr("style"));n["text-decoration"]="line-through",e.name="span",e.attr("style",t.serialize(n))}))}))}(e,n)},qb=function(e,t){t.inline_styles&&Vb(e,t)},$b=/^[ \t\r\n]*$/,Yb={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Xb=function(e,t,n){var r,o,i=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[i])return e[i];if(e!==t){if(r=e[a])return r;for(o=e.parent;o&&o!==t;o=o.parent)if(r=o[a])return r}},Kb=function(){function e(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}return e.create=function(t,n){var r,o;if(r=new e(t,Yb[t]||1),n)for(o in n)r.attr(o,n[o]);return r},e.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},e.prototype.attr=function(e,t){var n,r;if("string"!=typeof e){for(r in e)this.attr(r,e[r]);return this}if(n=this.attributes){if(void 0!==t){if(null===t){if(e in n.map)for(delete n.map[e],r=n.length;r--;)if(n[r].name===e)return n=n.splice(r,1),this;return this}if(e in n.map){for(r=n.length;r--;)if(n[r].name===e){n[r].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,this}return n.map[e]}},e.prototype.clone=function(){var t,n,r,o,i,a=new e(this.name,this.type);if(r=this.attributes){for((i=[]).map={},t=0,n=r.length;t<n;t++)"id"!==(o=r[t]).name&&(i[i.length]={name:o.name,value:o.value},i.map[o.name]=o.value);a.attributes=i}return a.value=this.value,a.shortEnded=this.shortEnded,a},e.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},e.prototype.unwrap=function(){var e,t;for(e=this.firstChild;e;)t=e.next,this.insert(e,this,!0),e=t;this.remove()},e.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t,t&&(t.prev=null)):n.next=t,e.lastChild===this?(e.lastChild=n,n&&(n.next=null)):t.prev=n,this.parent=this.next=this.prev=null),this},e.prototype.append=function(e){var t;return e.parent&&e.remove(),(t=this.lastChild)?(t.next=e,e.prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},e.prototype.insert=function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},e.prototype.getAll=function(e){var t,n=[];for(t=this.firstChild;t;t=Xb(t,this))t.name===e&&n.push(t);return n},e.prototype.empty=function(){var e,t,n;if(this.firstChild){for(e=[],n=this.firstChild;n;n=Xb(n,this))e.push(n);for(t=e.length;t--;)(n=e[t]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return this.firstChild=this.lastChild=null,this},e.prototype.isEmpty=function(e,t,n){var r,o,i=this.firstChild;if(t=t||{},i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(e[i.name])return!1;for(r=i.attributes.length;r--;)if("name"===(o=i.attributes[r].name)||0===o.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!$b.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&$b.test(i.value))return!1;if(n&&n(i))return!1}while(i=Xb(i,this));return!0},e.prototype.walk=function(e){return Xb(this,null,e)},e}(),Gb=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new Kb("br",1)).shortEnded=!0:r.empty().append(new Kb("#text",3)).value=" "},Jb=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},Qb=function(e,t,n,r){return r.isEmpty(t,n,(function(t){return function(e,t){var n=e.getElementRule(t.name);return n&&n.paddEmpty}(e,t)}))},Zb=$t.makeMap,ey=$t.each,ty=$t.explode,ny=$t.extend;function ry(e,t){void 0===t&&(t=Zo());var n={},r=[],o={},i={};(e=e||{}).validate=!("validate"in e)||e.validate,e.root_name=e.root_name||"body";var a=function(e){var t,a,u;(a=e.name)in n&&((u=o[a])?u.push(e):o[a]=[e]),t=r.length;for(;t--;)(a=r[t].name)in e.attributes.map&&((u=i[a])?u.push(e):i[a]=[e]);return e},u={schema:t,addAttributeFilter:function(e,t){ey(ty(e),(function(e){var n;for(n=0;n<r.length;n++)if(r[n].name===e)return void r[n].callbacks.push(t);r.push({name:e,callbacks:[t]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(e,t){ey(ty(e),(function(e){var r=n[e];r||(n[e]=r=[]),r.push(t)}))},getNodeFilters:function(){var e=[];for(var t in n)n.hasOwnProperty(t)&&e.push({name:t,callbacks:n[t]});return e},filterNode:a,parse:function(u,s){var c,l,f,d,m,h,g,p,v,b,y,w=[];s=s||{},o={},i={},v=ny(Zb("script,style,head,html,body,title,meta,param"),t.getBlockElements());var x=t.getNonEmptyElements(),C=t.children,S=e.validate,E="forced_root_block"in s?s.forced_root_block:e.forced_root_block,k=t.getWhiteSpaceElements(),N=/^[ \t\r\n]+/,T=/[ \t\r\n]+$/,_=/[ \t\r\n]+/g,R=/^[ \t\r\n]+$/;b=k.hasOwnProperty(s.context)||k.hasOwnProperty(e.root_name);var O=function(e,t){var r,i=new Kb(e,t);return e in n&&((r=o[e])?r.push(i):o[e]=[i]),i},A=function(e){var n,r,o,i,a=t.getBlockElements();for(n=e.prev;n&&3===n.type;){if((o=n.value.replace(T,"")).length>0)return void(n.value=o);if(r=n.next){if(3===r.type&&r.value.length){n=n.prev;continue}if(!a[r.name]&&"script"!==r.name&&"style"!==r.name){n=n.prev;continue}}i=n.prev,n.remove(),n=i}};c=Nv({validate:S,allow_script_urls:e.allow_script_urls,allow_conditional_comments:e.allow_conditional_comments,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(t.getSelfClosingElements()),cdata:function(e){y.append(O("#cdata",4)).value=e},text:function(e,t){var n;b||(e=e.replace(_," "),function(e,t){return e&&(t[e.name]||"br"===e.name)}(y.lastChild,v)&&(e=e.replace(N,""))),0!==e.length&&((n=O("#text",3)).raw=!!t,y.append(n).value=e)},comment:function(e){y.append(O("#comment",8)).value=e},pi:function(e,t){y.append(O(e,7)).value=t,A(y)},doctype:function(e){y.append(O("#doctype",10)).value=e,A(y)},start:function(e,n,o){var a,u,s,c,l;if(s=S?t.getElementRule(e):{}){for((a=O(s.outputName||e,1)).attributes=n,a.shortEnded=o,y.append(a),(l=C[y.name])&&C[a.name]&&!l[a.name]&&w.push(a),u=r.length;u--;)(c=r[u].name)in n.map&&((g=i[c])?g.push(a):i[c]=[a]);v[e]&&A(a),o||(y=a),!b&&k[e]&&(b=!0)}},end:function(n){var r,o,i,a,u;if(o=S?t.getElementRule(n):{}){if(v[n]&&!b){if((r=y.firstChild)&&3===r.type)if((i=r.value.replace(N,"")).length>0)r.value=i,r=r.next;else for(a=r.next,r.remove(),r=a;r&&3===r.type;)i=r.value,a=r.next,(0===i.length||R.test(i))&&(r.remove(),r=a),r=a;if((r=y.lastChild)&&3===r.type)if((i=r.value.replace(T,"")).length>0)r.value=i,r=r.prev;else for(a=r.prev,r.remove(),r=a;r&&3===r.type;)i=r.value,a=r.prev,(0===i.length||R.test(i))&&(r.remove(),r=a),r=a}if(b&&k[n]&&(b=!1),o.removeEmpty&&Qb(t,x,k,y)&&!y.attributes.map.name&&!y.attr("id"))return u=y.parent,v[y.name]?y.empty().remove():y.unwrap(),void(y=u);o.paddEmpty&&(function(e){return Jb(e,"#text")&&" "===e.firstChild.value}(y)||Qb(t,x,k,y))&&Gb(e,s,v,y),y=y.parent}}},t);var D=y=new Kb(s.context||e.root_name,11);if(c.parse(u),S&&w.length&&(s.context?s.invalid=!0:function(e){var n,r,o,i,u,s,c,l,f,d,m,h,g,p,v,b;for(h=Zb("tr,td,th,tbody,thead,tfoot,table"),d=t.getNonEmptyElements(),m=t.getWhiteSpaceElements(),g=t.getTextBlockElements(),p=t.getSpecialElements(),n=0;n<e.length;n++)if((r=e[n]).parent&&!r.fixed)if(g[r.name]&&"li"===r.parent.name){for(v=r.next;v&&g[v.name];)v.name="li",v.fixed=!0,r.parent.insert(v,r.parent),v=v.next;r.unwrap(r)}else{for(i=[r],o=r.parent;o&&!t.isValidChild(o.name,r.name)&&!h[o.name];o=o.parent)i.push(o);if(o&&i.length>1){for(i.reverse(),u=s=a(i[0].clone()),f=0;f<i.length-1;f++){for(t.isValidChild(s.name,i[f].name)?(c=a(i[f].clone()),s.append(c)):c=s,l=i[f].firstChild;l&&l!==i[f+1];)b=l.next,c.append(l),l=b;s=c}Qb(t,d,m,u)?o.insert(r,i[0],!0):(o.insert(u,i[0],!0),o.insert(r,u)),o=i[0],(Qb(t,d,m,o)||Jb(o,"br"))&&o.empty().remove()}else if(r.parent){if("li"===r.name){if((v=r.prev)&&("ul"===v.name||"ul"===v.name)){v.append(r);continue}if((v=r.next)&&("ul"===v.name||"ul"===v.name)){v.insert(r,v.firstChild,!0);continue}r.wrap(a(new Kb("ul",1)));continue}t.isValidChild(r.parent.name,"div")&&t.isValidChild("div",r.name)?r.wrap(a(new Kb("div",1))):p[r.name]?r.empty().remove():r.unwrap()}}}(w)),E&&("body"===D.name||s.isRootContent)&&function(){var n,r,o=D.firstChild,i=function(e){e&&((o=e.firstChild)&&3===o.type&&(o.value=o.value.replace(N,"")),(o=e.lastChild)&&3===o.type&&(o.value=o.value.replace(T,"")))};if(t.isValidChild(D.name,E.toLowerCase())){for(;o;)n=o.next,3===o.type||1===o.type&&"p"!==o.name&&!v[o.name]&&!o.attr("data-mce-type")?r?r.append(o):((r=O(E,1)).attr(e.forced_root_block_attrs),D.insert(r,o),r.append(o)):(i(r),r=null),o=n;i(r)}}(),!s.invalid){for(p in o){for(g=n[p],m=(l=o[p]).length;m--;)l[m].parent||l.splice(m,1);for(f=0,d=g.length;f<d;f++)g[f](l,p,s)}for(f=0,d=r.length;f<d;f++)if((g=r[f]).name in i){for(m=(l=i[g.name]).length;m--;)l[m].parent||l.splice(m,1);for(m=0,h=g.callbacks.length;m<h;m++)g.callbacks[m](l,g.name,s)}}return D}};return function(e,t){var n=e.schema;t.remove_trailing_brs&&e.addNodeFilter("br",(function(e,r,o){var i,a,u,s,c,l,f,d,m=e.length,h=$t.extend({},n.getBlockElements()),g=n.getNonEmptyElements(),p=n.getWhiteSpaceElements();for(h.body=1,i=0;i<m;i++)if(u=(a=e[i]).parent,h[a.parent.name]&&a===u.lastChild){for(c=a.prev;c;){if("span"!==(l=c.name)||"bookmark"!==c.attr("data-mce-type")){if("br"!==l)break;if("br"===l){a=null;break}}c=c.prev}a&&(a.remove(),Qb(n,g,p,u)&&(f=n.getElementRule(u.name))&&(f.removeEmpty?u.remove():f.paddEmpty&&Gb(t,o,h,u)))}else{for(s=a;u&&u.firstChild===s&&u.lastChild===s&&(s=u,!h[u.name]);)u=u.parent;s===u&&!0!==t.padd_empty_with_br&&((d=new Kb("#text",3)).value=" ",a.replace(d))}})),e.addAttributeFilter("href",(function(e){var n,r,o,i=e.length;if(!t.allow_unsafe_link_target)for(;i--;)"a"===(n=e[i]).name&&"_blank"===n.attr("target")&&n.attr("rel",(r=n.attr("rel"),o=void 0,o=r?$t.trim(r):"",/\b(noopener)\b/g.test(o)?o:function(e){return e.split(" ").filter((function(e){return e.length>0})).concat(["noopener"]).sort().join(" ")}(o)))})),t.allow_html_in_named_anchor||e.addAttributeFilter("id,name",(function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,t=o.lastChild;do{n=t.prev,r.insert(t,o),t=n}while(t)}})),t.fix_list_elements&&e.addNodeFilter("ul,ol",(function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new Kb("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}})),t.validate&&n.getValidClasses()&&e.addAttributeFilter("class",(function(e){for(var t,r,o,i,a,u,s,c=e.length,l=n.getValidClasses();c--;){for(r=(t=e[c]).attr("class").split(" "),a="",o=0;o<r.length;o++)i=r[o],s=!1,(u=l["*"])&&u[i]&&(s=!0),u=l[t.name],!s&&u&&u[i]&&(s=!0),s&&(a&&(a+=" "),a+=i);a.length||(a=null),t.attr("class",a)}}))}(u,e),qb(u,e),u}var oy=function(e,t,n){-1===$t.inArray(t,n)&&(e.addAttributeFilter(n,(function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})),t.push(n))},iy=function(e,t,n,r,o){return function(e,t,n){return!t.no_events&&e?cg(e,Hb(t,{content:n})).content:n}(e,o,function(e,t,n){return Wc(e,t).serialize(n)}(t,n,r))};function ay(e,t){var n,r,o,i=["data-mce-selected"];return n=t&&t.dom?t.dom:li.DOM,r=t&&t.schema?t.schema:Zo(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs=!("remove_trailing_brs"in e)||e.remove_trailing_brs,o=ry(e,r),zb(o,e,n),{schema:r,addNodeFilter:o.addNodeFilter,addAttributeFilter:o.addAttributeFilter,serialize:function(i,a){var u=Hb({format:"html"},a||{}),s=jb(t,i,u),c=function(e,t,n){var r=oa(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||vo(Xn.fromDom(t))?r:$t.trim(r)}(n,s,u),l=function(e,t,n){var r=n.selection?Hb({forced_root_block:!1},n):n,o=e.parse(t,r);return Wb(o),o}(o,c,u);return"tree"===u.format?l:iy(t,e,r,l,u)},addRules:function(e){r.addValidElements(e)},setRules:function(e){r.setValidElements(e)},addTempAttr:u(oy,o,i),getTempAttrs:function(){return i}}}function uy(e,t){var n=ay(e,t);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs}}function sy(e){return{getBookmark:u(Gs,e),moveToBookmark:u(Js,e)}}!function(e){e.isBookmarkNode=Qs}(sy||(sy={}));var cy,ly=sy,fy=Ro.isContentEditableFalse,dy=Ro.isContentEditableTrue,my=function(e,t){var r,o,i,a,u,s,c,l,f,d,m,h,g,p,v,b,y,w=t.dom,x=$t.each,C=t.getDoc(),S=n.document,E=Math.abs,k=Math.round,N=t.getBody();a={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var T=".mce-content-body";t.contentStyles.push(T+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: content-box;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+T+" .mce-resizehandle:hover {background: #000}"+T+" img[data-mce-selected],"+T+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+T+" .mce-clonedresizable {position: absolute;"+(le.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+T+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}");var _=function(e){return e&&("IMG"===e.nodeName||t.dom.is(e,"figure.image"))},R=function(e){var n=e.target;(function(e,t){return _(e.target)&&!av(e.clientX,e.clientY,t)})(e,t.selection.getRng())&&!e.isDefaultPrevented()&&t.selection.select(n)},O=function(e){return t.dom.is(e,"figure.image")?e.querySelector("img"):e},A=function(e){var n=t.settings.object_resizing;return!1!==n&&!le.iOS&&("string"!=typeof n&&(n="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&e!==t.getBody()&&Er(Xn.fromDom(e),n))},D=function(e){var n,a,x,C;n=e.screenX-s,a=e.screenY-c,p=n*u[2]+d,v=a*u[3]+m,p=p<5?5:p,v=v<5?5:v,(_(r)&&!1!==t.settings.resize_img_proportional?!qp.modifierPressed(e):qp.modifierPressed(e)||_(r)&&u[2]*u[3]!=0)&&(E(n)>E(a)?(v=k(p*h),p=k(v/h)):(p=k(v/h),v=k(p*h))),w.setStyles(O(o),{width:p,height:v}),x=(x=u.startPos.x+n)>0?x:0,C=(C=u.startPos.y+a)>0?C:0,w.setStyles(i,{left:x,top:C,display:"block"}),i.innerHTML=p+" &times; "+v,u[2]<0&&o.clientWidth<=p&&w.setStyle(o,"left",l+(d-p)),u[3]<0&&o.clientHeight<=v&&w.setStyle(o,"top",f+(m-v)),(n=N.scrollWidth-b)+(a=N.scrollHeight-y)!=0&&w.setStyles(i,{left:x-n,top:C-a}),g||(mg(t,r,d,m),g=!0)},P=function(){g=!1;var e=function(e,n){n&&(r.style[e]||!t.schema.isValid(r.nodeName.toLowerCase(),e)?w.setStyle(O(r),e,n):w.setAttrib(O(r),e,n))};e("width",p),e("height",v),w.unbind(C,"mousemove",D),w.unbind(C,"mouseup",P),S!==C&&(w.unbind(S,"mousemove",D),w.unbind(S,"mouseup",P)),w.remove(o),w.remove(i),B(r),hg(t,r,p,v),w.setAttrib(r,"style",w.getAttrib(r,"style")),t.nodeChanged()},B=function(e){var n,g,E,k,T;I(),F(),n=w.getPos(e,N),l=n.x,f=n.y,T=e.getBoundingClientRect(),g=T.width||T.right-T.left,E=T.height||T.bottom-T.top,r!==e&&(r=e,p=v=0),k=t.fire("ObjectSelected",{target:e}),A(e)&&!k.isDefaultPrevented()?x(a,(function(e,t){var n;(n=w.get("mceResizeHandle"+t))&&w.remove(n),n=w.add(N,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),11===le.ie&&(n.contentEditable=!1),w.bind(n,"mousedown",(function(t){t.stopImmediatePropagation(),t.preventDefault(),function(t){s=t.screenX,c=t.screenY,d=O(r).clientWidth,m=O(r).clientHeight,h=m/d,u=e,e.startPos={x:g*e[0]+l,y:E*e[1]+f},b=N.scrollWidth,y=N.scrollHeight,o=r.cloneNode(!0),w.addClass(o,"mce-clonedresizable"),w.setAttrib(o,"data-mce-bogus","all"),o.contentEditable=!1,o.unSelectabe=!0,w.setStyles(o,{left:l,top:f,margin:0}),o.removeAttribute("data-mce-selected"),N.appendChild(o),w.bind(C,"mousemove",D),w.bind(C,"mouseup",P),S!==C&&(w.bind(S,"mousemove",D),w.bind(S,"mouseup",P)),i=w.add(N,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},d+" &times; "+m)}(t)})),e.elm=n,w.setStyles(n,{left:g*e[0]+l-n.offsetWidth/2,top:E*e[1]+f-n.offsetHeight/2})})):I(),r.setAttribute("data-mce-selected","1")},I=function(){var e,t;for(e in F(),r&&r.removeAttribute("data-mce-selected"),a)(t=w.get("mceResizeHandle"+e))&&(w.unbind(t),w.remove(t))},M=function(n){var r,o=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};g||t.removed||(x(w.select("img[data-mce-selected],hr[data-mce-selected]"),(function(e){e.removeAttribute("data-mce-selected")})),r="mousedown"===n.type?n.target:e.getNode(),o(r=w.$(r).closest("table,img,figure.image,hr")[0],N)&&(H(),o(e.getStart(!0),r)&&o(e.getEnd(!0),r))?B(r):I())},L=function(e){return fy(function(e,t){for(;t&&t!==e;){if(dy(t)||fy(t))return t;t=t.parentNode}return null}(t.getBody(),e))},F=function(){for(var e in a){var t=a[e];t.elm&&(w.unbind(t.elm),delete t.elm)}},H=function(){try{t.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return t.on("init",(function(){H(),le.ie&&le.ie>=11&&(t.on("mousedown click",(function(e){var n=e.target,r=n.nodeName;g||!/^(TABLE|IMG|HR)$/.test(r)||L(n)||(2!==e.button&&t.selection.select(n,"TABLE"===r),"mousedown"===e.type&&t.nodeChanged())})),t.dom.bind(N,"mscontrolselect",(function(e){var n=function(e){ge.setEditorTimeout(t,(function(){t.selection.select(e)}))};if(L(e.target))return e.preventDefault(),void n(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&n(e.target))})));var e=ge.throttle((function(e){t.composing||M(e)}));t.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",e),t.on("keyup compositionend",(function(t){r&&"TABLE"===r.nodeName&&e(t)})),t.on("hide blur",I),t.on("contextmenu",R)})),t.on("remove",F),{isResizable:A,showResizeRect:B,hideResizeRect:I,updateResizeRect:M,destroy:function(){r=o=null}}},hy=function(e){return Ro.isContentEditableTrue(e)||Ro.isContentEditableFalse(e)},gy=function(e,t,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r=function(e,t,n){var r,o,i;if(r=n.elementFromPoint(e,t),o=n.body.createTextRange(),r&&"HTML"!==r.tagName||(r=n.body),o.moveToElementText(r),(i=(i=$t.toArray(o.getClientRects())).sort((function(e,n){return(e=Math.abs(Math.max(e.top-t,e.bottom-t)))-(n=Math.abs(Math.max(n.top-t,n.bottom-t)))}))).length>0){t=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,t),o.collapse(!0),o}catch(e){}}return null}(e,t,n)}return function(e,t){var n=e&&e.parentElement?e.parentElement():null;return Ro.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(n,t,hy))?null:e}(r,n.body)}return r},py=function(e,t){return W(t,(function(t){var n=e.fire("GetSelectionRange",{range:t});return n.range!==t?n.range:t}))},vy=function(e,t){var r=(t||n.document).createDocumentFragment();return j(e,(function(e){r.appendChild(e.dom())})),Xn.fromDom(r)},by=vr("element","width","rows"),yy=vr("element","cells"),wy=vr("x","y"),xy=function(e,t){var n=parseInt(dr(e,t),10);return isNaN(n)?1:n},Cy=function(e,t,n){var r=e.rows();return!!(r[n]?r[n].cells():[])[t]},Sy=function(e){return q(e,(function(e,t){return t.cells().length>e?t.cells().length:e}),0)},Ey=function(e,t){for(var n=e.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Nr(o[i],t))return N.some(wy(i,r));return N.none()},ky=function(e,t,n,r,o){for(var i=[],a=e.rows(),u=n;u<=o;u++){var s=a[u].cells(),c=t<r?s.slice(t,r+1):s.slice(r,t+1);i.push(yy(a[u].element(),c))}return i},Ny=function(e){var t=by(Zi(e),0,[]);return j(Mi(e,"tr"),(function(e,n){j(Mi(e,"td,th"),(function(r,o){!function(e,t,n,r,o){for(var i=xy(o,"rowspan"),a=xy(o,"colspan"),u=e.rows(),s=n;s<n+i;s++){u[s]||(u[s]=yy(ea(r),[]));for(var c=t;c<t+a;c++)u[s].cells()[c]=s===n&&c===t?o:Zi(o)}}(t,function(e,t,n){for(;Cy(e,t,n);)t++;return t}(t,o,n),n,e,r)}))})),by(t.element(),Sy(t.rows()),t.rows())},Ty=function(e){return function(e,t){var n=Zi(e.element()),r=Xn.fromTag("tbody");return Ci(r,t),xi(n,r),n}(e,function(e){return W(e.rows(),(function(e){var t=W(e.cells(),(function(e){var t=ea(e);return mr(t,"colspan"),mr(t,"rowspan"),t})),n=Zi(e.element());return Ci(n,t),n}))}(e))},_y=function(e,t,n){return Ey(e,t).bind((function(t){return Ey(e,n).map((function(n){return function(e,t,n){var r=t.x(),o=t.y(),i=n.x(),a=n.y(),u=o<a?ky(e,r,o,i,a):ky(e,r,a,i,o);return by(e.element(),Sy(u),u)}(e,t,n)}))}))},Ry=function(e,t){return $(e,(function(e){return"li"===Qn(e)&&zp(e,t)})).fold(i([]),(function(t){return function(e){return $(e,(function(e){return"ul"===Qn(e)||"ol"===Qn(e)}))}(e).map((function(e){return[Xn.fromTag("li"),Xn.fromTag(Qn(e))]})).getOr([])}))},Oy=function(e,t){var n=Xn.fromDom(t.commonAncestorContainer),r=Ul(n,e),o=V(r,(function(e){return so(e)||ao(e)})),a=Ry(r,t),u=o.concat(a.length?a:function(e){return mo(e)?Or(e).filter(fo).fold(i([]),(function(t){return[e,t]})):fo(e)?[e]:[]}(n));return W(u,Zi)},Ay=function(){return vy([])},Dy=function(e,t){return n=Xn.fromDom(t.cloneContents()),r=Oy(e,t),o=q(r,(function(e,t){return xi(t,e),t}),n),r.length>0?vy([o]):o;var n,r,o},Py=function(e,t){return(n=e,r=t[0],zi(r,"table",u(Nr,n))).bind((function(e){var n=t[0],r=t[t.length-1],o=Ny(e);return _y(o,n,r).map((function(e){return vy([Ty(e)])}))})).getOrThunk(Ay);var n,r},By=function(e,t){var n=am(t,e);return n.length>0?Py(e,n):function(e,t){return t.length>0&&t[0].collapsed?Ay():Dy(e,t[0])}(e,t)},Iy=function(e,t){if(void 0===t&&(t={}),t.get=!0,t.format=t.format||"html",t.selection=!0,(t=e.fire("BeforeGetContent",t)).isDefaultPrevented())return e.fire("GetContent",t),t.content;if("text"===t.format)return function(e){return N.from(e.selection.getRng()).map((function(t){var n=e.dom.add(e.getBody(),"div",{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},t.cloneContents()),r=oa(n.innerText);return e.dom.remove(n),r})).getOr("")}(e);t.getInner=!0;var n=function(e,t){var n,r=e.selection.getRng(),o=e.dom.create("body"),i=e.selection.getSel(),a=py(e,em(i));return(n=t.contextual?By(Xn.fromDom(e.getBody()),a).dom():r.cloneContents())&&o.appendChild(n),e.selection.serializer.serialize(o,t)}(e,t);return"tree"===t.format?n:(t.content=e.selection.isCollapsed()?"":n,e.fire("GetContent",t),t.content)},My=function(e,t,n){var r,o,i,a=function(e,t){return Gi(Gi({format:"html"},e),{set:!0,selection:!0,content:t})}(n,t),u=e.selection.getRng(),s=e.getDoc();if(a.no_events||!(a=e.fire("BeforeSetContent",a)).isDefaultPrevented()){if(t=function(e,t){if("raw"!==t.format){var n=e.parser.parse(t.content,Gi({isRootContent:!0,forced_root_block:!1},t));return Wc({validate:e.validate},e.schema).serialize(n)}return t.content}(e,a),u.insertNode){t+='<span id="__caret">_</span>',u.startContainer===s&&u.endContainer===s?s.body.innerHTML=t:(u.deleteContents(),0===s.body.childNodes.length?s.body.innerHTML=t:u.createContextualFragment?u.insertNode(u.createContextualFragment(t)):(o=s.createDocumentFragment(),i=s.createElement("div"),o.appendChild(i),i.outerHTML=t,u.insertNode(o))),r=e.dom.get("__caret"),(u=s.createRange()).setStartBefore(r),u.setEndBefore(r),e.selection.setRng(u),e.dom.remove("__caret");try{e.selection.setRng(u)}catch(e){}}else{var c=u;c.item&&(s.execCommand("Delete",!1,null),c=e.selection.getRng()),/^\s+/.test(t)?(c.pasteHTML('<span id="__mce_tmp">_</span>'+t),e.dom.remove("__mce_tmp")):c.pasteHTML(t)}a.no_events||e.fire("SetContent",a)}else e.fire("SetContent",a)},Ly=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return N.from(i).map(Xn.fromDom).map((function(e){return r&&t.collapsed?e:Mr(e,o(e,a)).getOr(e)})).bind((function(e){return er(e)?N.some(e):Or(e)})).map((function(e){return e.dom()})).getOr(e)},Fy=function(e,t,n){return Ly(e,t,!0,n,(function(e,t){return Math.min(e.dom().childNodes.length,t)}))},Hy=function(e,t,n){return Ly(e,t,!1,n,(function(e,t){return t>0?t-1:t}))},zy=function(e,t){for(var n=e;e&&Ro.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},Wy=$t.each,jy=function(e){return!!e.select},Uy=function(e){return!(!e||!e.ownerDocument)&&Tr(Xn.fromDom(e.ownerDocument),Xn.fromDom(e))},Vy=function(e,t,n,r){var o,i,a,u,s,c=function(e,t){return My(r,e,t)},l=function(e){var t=d();t.collapse(!!e),m(t)},f=function(){return t.getSelection?t.getSelection():t.document.selection},d=function(){var n,o,i,s,c=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(e){return-1}};if(!t)return null;if(null==(s=t.document))return null;if(void 0!==r.bookmark&&!1===Jg(r)){var l=Xh(r);if(l.isSome())return l.map((function(e){return py(r,[e])[0]})).getOr(s.createRange())}try{(n=f())&&!Ro.isRestrictedNode(n.anchorNode)&&(o=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():s.createRange())}catch(e){}return(o=py(r,[o])[0])||(o=s.createRange?s.createRange():s.body.createTextRange()),o.setStart&&9===o.startContainer.nodeType&&o.collapsed&&(i=e.getRoot(),o.setStart(i,0),o.setEnd(i,0)),a&&u&&(0===c(o.START_TO_START,o,a)&&0===c(o.END_TO_END,o,a)?o=u:(a=null,u=null)),o},m=function(e,t){var n,o;if(function(e){return!!e&&(!!jy(e)||Uy(e.startContainer)&&Uy(e.endContainer))}(e)){var i=jy(e)?e:null;if(i){u=null;try{i.select()}catch(e){}}else{if(n=f(),e=r.fire("SetSelectionRange",{range:e,forward:t}).range,n){u=e;try{n.removeAllRanges(),n.addRange(e)}catch(e){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),a=n.rangeCount>0?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExtent||le.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(o=e.startContainer.childNodes[e.startOffset])&&"IMG"===o.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(o,0,o,1)),r.fire("AfterSetSelectionRange",{range:e,forward:t})}}},h=function(){var t,n,r=f();return!(r&&r.anchorNode&&r.focusNode)||((t=e.createRng()).setStart(r.anchorNode,r.anchorOffset),t.collapse(!0),(n=e.createRng()).setStart(r.focusNode,r.focusOffset),n.collapse(!0),t.compareBoundaryPoints(t.START_TO_START,n)<=0)},g={bookmarkManager:null,controlSelection:null,dom:e,win:t,serializer:n,editor:r,collapse:l,setCursorLocation:function(t,n){var o=e.createRng();t?(o.setStart(t,n),o.setEnd(t,n),m(o),l(!1)):(Wp(e,o,r.getBody(),!0),m(o))},getContent:function(e){return Iy(r,e)},setContent:c,getBookmark:function(e,t){return o.getBookmark(e,t)},moveToBookmark:function(e){return o.moveToBookmark(e)},select:function(t,n){return function(e,t,n){return N.from(t).map((function(t){var r=e.nodeIndex(t),o=e.createRng();return o.setStart(t.parentNode,r),o.setEnd(t.parentNode,r+1),n&&(Wp(e,o,t,!0),Wp(e,o,t,!1)),o}))}(e,t,n).each(m),t},isCollapsed:function(){var e=d(),t=f();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:h,setNode:function(t){return c(e.getOuterHTML(t)),t},getNode:function(){return e=r.getBody(),(t=d())?(o=t.startContainer,i=t.endContainer,a=t.startOffset,u=t.endOffset,n=t.commonAncestorContainer,!t.collapsed&&(o===i&&u-a<2&&o.hasChildNodes()&&(n=o.childNodes[a]),3===o.nodeType&&3===i.nodeType&&(o=o.length===a?zy(o.nextSibling,!0):o.parentNode,i=0===u?zy(i.previousSibling,!1):i.parentNode,o&&o===i))?o:n&&3===n.nodeType?n.parentNode:n):e;var e,t,n,o,i,a,u},getSel:f,setRng:m,getRng:d,getStart:function(e){return Fy(r.getBody(),d(),e)},getEnd:function(e){return Hy(r.getBody(),d(),e)},getSelectedBlocks:function(t,n){return function(e,t,n,r){var o,i,a=[];if(i=e.getRoot(),n=e.getParent(n||Fy(i,t,t.collapsed),e.isBlock),r=e.getParent(r||Hy(i,t,t.collapsed),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r){o=n;for(var u=new to(n,i);(o=u.next())&&o!==r;)e.isBlock(o)&&a.push(o)}return r&&n!==r&&r!==i&&a.push(r),a}(e,d(),t,n)},normalize:function(){var t=d(),n=f();if(!nm(n)&&jp(r)){var o=bh(e,t);return o.each((function(e){m(e,h())})),o.getOr(t)}return t},selectorChanged:function(t,n){var o;return s||(s={},o={},r.on("NodeChange",(function(t){var n=t.element,r=e.getParents(n,null,e.getRoot()),i={};Wy(s,(function(t,n){Wy(r,(function(a){if(e.is(a,n))return o[n]||(Wy(t,(function(e){e(!0,{node:a,selector:n,parents:r})})),o[n]=t),i[n]=t,!1}))})),Wy(o,(function(e,t){i[t]||(delete o[t],Wy(e,(function(e){e(!1,{node:n,selector:t,parents:r})})))}))}))),s[t]||(s[t]=[]),s[t].push(n),g},getScrollContainer:function(){for(var t,n=e.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){t=n;break}n=n.parentNode}return t},scrollIntoView:function(e,t){return Um(r,e,t)},placeCaretAt:function(e,t){return m(gy(e,t,r.getDoc()))},getBoundingClientRect:function(){var e=d();return e.collapsed?fu.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){t=a=u=null,i.destroy()}};return o=ly(g),i=my(g,r),g.bookmarkManager=o,g.controlSelection=i,g};!function(e){e[e.Br=0]="Br",e[e.Block=1]="Block",e[e.Wrap=2]="Wrap",e[e.Eol=3]="Eol"}(cy||(cy={}));var qy=function(e,t){return e===lu.Backwards?t.reverse():t},$y=function(e,t,n){return e===lu.Forwards?t.next(n):t.prev(n)},Yy=function(e,t,n,r){return Ro.isBr(r.getNode(t===lu.Forwards))?cy.Br:!1===ss(n,r)?cy.Block:cy.Wrap},Xy=function(e,t,n,r){for(var o,i=As(n),a=r,u=[];a&&(o=$y(t,i,a));){if(Ro.isBr(o.getNode(!1)))return t===lu.Forwards?{positions:qy(t,u).concat([o]),breakType:cy.Br,breakAt:N.some(o)}:{positions:qy(t,u),breakType:cy.Br,breakAt:N.some(o)};if(o.isVisible()){if(e(a,o)){var s=Yy(0,t,a,o);return{positions:qy(t,u),breakType:s,breakAt:N.some(o)}}u.push(o),a=o}else a=o}return{positions:qy(t,u),breakType:cy.Eol,breakAt:N.none()}},Ky=function(e,t,n,r){return t(n,r).breakAt.map((function(r){var o=t(n,r).positions;return e===lu.Backwards?o.concat(r):[r].concat(o)})).getOr([])},Gy=function(e,t){return q(e,(function(e,n){return e.fold((function(){return N.some(n)}),(function(r){return Wa(J(r.getClientRects()),J(n.getClientRects()),(function(e,o){var i=Math.abs(t-e.left);return Math.abs(t-o.left)<=i?n:r})).or(e)}))}),N.none())},Jy=function(e,t){return J(t.getClientRects()).bind((function(t){return Gy(e,t.left)}))},Qy=u(Xy,cu.isAbove,-1),Zy=u(Xy,cu.isBelow,1),ew=u(Ky,-1,Qy),tw=u(Ky,1,Zy),nw=Ro.isContentEditableFalse,rw=La,ow=function(e,t,n,r){var o=e===lu.Forwards,i=o?wf:xf;if(!r.collapsed){var a=rw(r);if(nw(a))return Ym(e,t,a,e===lu.Backwards,!0)}var u=function(e){return ua(e.startContainer)}(r),s=vs(e,t.getBody(),r);if(i(s))return Xm(t,s.getNode(!o));var c=kl.normalizePosition(o,n(s));if(!c)return u?r:null;if(i(c))return Ym(e,t,c.getNode(!o),o,!0);var l=n(c);return l&&i(l)&&ws(c,l)?Ym(e,t,l.getNode(!o),o,!0):u?Gm(t,c.toRange(),!0):null},iw=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=rw(r),o=vs(e,t.getBody(),r),i=n(t.getBody(),Gp(1),o),a=V(i,Jp(1)),s=Wt.last(o.getClientRects()),(wf(o)||Sf(o))&&(d=o.getNode()),(xf(o)||Ef(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=rv(a,c))&&nw(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),Ym(e,t,u.node,l<f,!0);if(d){var m=function(e,t,n,r){var o,i,a,u,s,c,l=As(t),f=[],d=0,m=function(e){return Wt.last(e.getClientRects())};1===e?(o=l.next,i=Pa,a=Da,u=fu.after(r)):(o=l.prev,i=Da,a=Pa,u=fu.before(r)),c=m(u);do{if(u.isVisible()&&!a(s=m(u),c)){if(f.length>0&&i(s,Wt.last(f))&&d++,(s=Ra(s)).position=u,s.line=d,n(s))return f;f.push(s)}}while(u=o(u));return f}(e,t.getBody(),Gp(1),d);if(u=rv(V(m,Jp(1)),c))return Gm(t,u.position.toRange(),!0);if(u=Wt.last(V(m,Jp(0))))return Gm(t,u.position.toRange(),!0)}},aw=function(e,t,n){var r,o,i=As(e.getBody()),a=u(ys,i.next),s=u(ys,i.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?a(fu.fromRangeStart(n)):s(fu.fromRangeStart(n)))||(o=function(e){var t=e.dom.create(ol(e));return(!le.ie||le.ie>=11)&&(t.innerHTML='<br data-mce-bogus="1">'),t}(e),1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},uw=function(e,t){return function(){var n=function(e,t){var n,r=As(e.getBody()),o=u(ys,r.next),i=u(ys,r.prev),a=t?lu.Forwards:lu.Backwards,s=t?o:i,c=e.selection.getRng();return(n=ow(a,e,s,c))?n:(n=aw(e,a,c))||null}(e,t);return!!n&&(Jm(e,n),!0)}},sw=function(e,t){return function(){var n=function(e,t){var n,r=t?1:-1,o=t?Kp:Xp,i=e.selection.getRng();return(n=iw(r,e,o,i))?n:(n=aw(e,r,i))||null}(e,t);return!!n&&(Jm(e,n),!0)}},cw=function(e,t){return function(){var n=t?fu.fromRangeEnd(e.selection.getRng()):fu.fromRangeStart(e.selection.getRng()),r=t?Zy(e.getBody(),n):Qy(e.getBody(),n);return(t?Q(r.positions):J(r.positions)).filter(function(e){return function(t){return e?xf(t):wf(t)}}(t)).fold(i(!1),(function(t){return e.selection.setRng(t.toRange()),!0}))}},lw=function(e,t,n,r,o){var i=Mi(Xn.fromDom(n),"td,th,caption").map((function(e){return e.dom()}));return function(e,t,n){return q(e,(function(e,r){return e.fold((function(){return N.some(r)}),(function(e){var o=Math.sqrt(Math.abs(e.x-t)+Math.abs(e.y-n)),i=Math.sqrt(Math.abs(r.x-t)+Math.abs(r.y-n));return N.some(i<o?r:e)}))}),N.none())}(V(function(e,t){return X(t,(function(t){var n=function(e,t){return{left:e.left-t,top:e.top-t,right:e.right+2*t,bottom:e.bottom+2*t,width:e.width+t,height:e.height+t}}(Ra(t.getBoundingClientRect()),-1);return[{x:n.left,y:e(n),cell:t},{x:n.right,y:e(n),cell:t}]}))}(e,i),(function(e){return t(e,o)})),r,o).map((function(e){return e.cell}))},fw=u(lw,(function(e){return e.bottom}),(function(e,t){return e.y<t})),dw=u(lw,(function(e){return e.top}),(function(e,t){return e.y>t})),mw=function(e,t){return J(t.getClientRects()).bind((function(t){return fw(e,t.left,t.top)})).bind((function(e){return Jy((n=e,js.lastPositionIn(n).map((function(e){return Qy(n,e).positions.concat(e)})).getOr([])),t);var n}))},hw=function(e,t){return Q(t.getClientRects()).bind((function(t){return dw(e,t.left,t.top)})).bind((function(e){return Jy((n=e,js.firstPositionIn(n).map((function(e){return[e].concat(Zy(n,e).positions)})).getOr([])),t);var n}))},gw=function(e,t,n){var r=e(t,n);return function(e){return e.breakType===cy.Wrap&&0===e.positions.length}(r)||!Ro.isBr(n.getNode())&&function(e){return e.breakType===cy.Br&&1===e.positions.length}(r)?!function(e,t,n){return n.breakAt.map((function(n){return e(t,n).breakAt.isSome()})).getOr(!1)}(e,t,r):r.breakAt.isNone()},pw=u(gw,Qy),vw=u(gw,Zy),bw=function(e,t,n,r){var o=e.selection.getRng(),i=t?1:-1;if(Ku()&&function(e,t,n){var r=fu.fromRangeStart(t);return js.positionIn(!e,n).map((function(e){return e.isEqual(r)})).getOr(!1)}(t,o,n)){var a=Ym(i,e,n,!t,!0);return Jm(e,a),!0}return!1},yw=function(e,t){var n=t.getNode(e);return Ro.isElement(n)&&"TABLE"===n.nodeName?N.some(n):N.none()},ww=function(e,t,n){var r=yw(!!t,n),o=!1===t;r.fold((function(){return Jm(e,n.toRange())}),(function(r){return js.positionIn(o,e.getBody()).filter((function(e){return e.isEqual(n)})).fold((function(){return Jm(e,n.toRange())}),(function(o){return function(e,t,n,r){var o=ol(t);o?t.undoManager.transact((function(){var r=Xn.fromTag(o);fr(r,il(t)),xi(r,Xn.fromTag("br")),e?yi(Xn.fromDom(n),r):bi(Xn.fromDom(n),r);var i=t.dom.createRng();i.setStart(r.dom(),0),i.setEnd(r.dom(),0),Jm(t,i)})):Jm(t,r.toRange())}(t,e,r,n)}))}))},xw=function(e,t,n,r){var o=e.selection.getRng(),i=fu.fromRangeStart(o),a=e.getBody();if(!t&&pw(r,i)){var u=function(e,t,n){return mw(t,n).orThunk((function(){return J(n.getClientRects()).bind((function(n){return Gy(ew(e,fu.before(t)),n.left)}))})).getOr(fu.before(t))}(a,n,i);return ww(e,t,u),!0}return!(!t||!vw(r,i))&&(u=function(e,t,n){return hw(t,n).orThunk((function(){return J(n.getClientRects()).bind((function(n){return Gy(tw(e,fu.after(t)),n.left)}))})).getOr(fu.after(t))}(a,n,i),ww(e,t,u),!0)},Cw=function(e,t){return function(){return N.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind((function(n){return N.from(e.dom.getParent(n,"table")).map((function(n){return bw(e,t,n)}))})).getOr(!1)}},Sw=function(e,t){return function(){return N.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind((function(n){return N.from(e.dom.getParent(n,"table")).map((function(r){return xw(e,t,r,n)}))})).getOr(!1)}},Ew=function(e){return H(["figcaption"],Qn(e))},kw=function(e){var t=n.document.createRange();return t.setStartBefore(e.dom()),t.setEndBefore(e.dom()),t},Nw=function(e,t,n){n?xi(e,t):wi(e,t)},Tw=function(e,t,n,r){return""===t?function(e,t){var n=Xn.fromTag("br");return Nw(e,n,t),kw(n)}(e,r):function(e,t,n,r){var o=Xn.fromTag(n),i=Xn.fromTag("br");return fr(o,r),xi(o,i),Nw(e,o,t),kw(i)}(e,r,t,n)},_w=function(e,t,n){return t?function(e,t){return Zy(e,t).breakAt.isNone()}(e.dom(),n):function(e,t){return Qy(e,t).breakAt.isNone()}(e.dom(),n)},Rw=function(e,t){var n=Xn.fromDom(e.getBody()),r=fu.fromRangeStart(e.selection.getRng()),o=ol(e),i=il(e);return function(e,t){var n=u(Nr,t);return Hi(Xn.fromDom(e.container()),uo,n).filter(Ew)}(r,n).exists((function(){if(_w(n,t,r)){var a=Tw(n,o,i,t);return e.selection.setRng(a),!0}return!1}))},Ow=function(e,t){return function(){return!!e.selection.isCollapsed()&&Rw(e,t)}},Aw=function(e,t){return X(function(e){return W(e,(function(e){return Hb({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:r},e)}))}(e),(function(e){return function(e,t){return t.keyCode===e.keyCode&&t.shiftKey===e.shiftKey&&t.altKey===e.altKey&&t.ctrlKey===e.ctrlKey&&t.metaKey===e.metaKey}(e,t)?[e]:[]}))},Dw=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,r)}},Pw=function(e,t){return $(Aw(e,t),(function(e){return e.action()}))},Bw=function(e,t){e.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(e,t,n){var r=$n.detect().os;Pw([{keyCode:qp.RIGHT,action:uw(e,!0)},{keyCode:qp.LEFT,action:uw(e,!1)},{keyCode:qp.UP,action:sw(e,!1)},{keyCode:qp.DOWN,action:sw(e,!0)},{keyCode:qp.RIGHT,action:Cw(e,!0)},{keyCode:qp.LEFT,action:Cw(e,!1)},{keyCode:qp.UP,action:Sw(e,!1)},{keyCode:qp.DOWN,action:Sw(e,!0)},{keyCode:qp.RIGHT,action:Bd.move(e,t,!0)},{keyCode:qp.LEFT,action:Bd.move(e,t,!1)},{keyCode:qp.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:Bd.moveNextWord(e,t)},{keyCode:qp.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:Bd.movePrevWord(e,t)},{keyCode:qp.UP,action:Ow(e,!1)},{keyCode:qp.DOWN,action:Ow(e,!0)}],n).each((function(e){n.preventDefault()}))}(e,t,n)}))},Iw=function(e,t){e.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(e,t,n){Pw([{keyCode:qp.BACKSPACE,action:Dw(Vf,e,!1)},{keyCode:qp.DELETE,action:Dw(Vf,e,!0)},{keyCode:qp.BACKSPACE,action:Dw(Zm,e,!1)},{keyCode:qp.DELETE,action:Dw(Zm,e,!0)},{keyCode:qp.BACKSPACE,action:Dw(Fd,e,t,!1)},{keyCode:qp.DELETE,action:Dw(Fd,e,t,!0)},{keyCode:qp.BACKSPACE,action:Dw(vm,e,!1)},{keyCode:qp.DELETE,action:Dw(vm,e,!0)},{keyCode:qp.BACKSPACE,action:Dw(rf,e,!1)},{keyCode:qp.DELETE,action:Dw(rf,e,!0)},{keyCode:qp.BACKSPACE,action:Dw(Zl,e,!1)},{keyCode:qp.DELETE,action:Dw(Zl,e,!0)},{keyCode:qp.BACKSPACE,action:Dw(Wm,e,!1)},{keyCode:qp.DELETE,action:Dw(Wm,e,!0)}],n).each((function(e){n.preventDefault()}))}(e,t,n)})),e.on("keyup",(function(t){!1===t.isDefaultPrevented()&&function(e,t){Pw([{keyCode:qp.BACKSPACE,action:Dw(qf,e)},{keyCode:qp.DELETE,action:Dw(qf,e)}],t)}(e,t)}))},Mw=function(e){return N.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},Lw=function(e,t){var n,r,o,i=t,a=e.dom,u=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var s=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);s&&/^(UL|OL|DL)$/.test(s.nodeName)&&t.insertBefore(a.doc.createTextNode(" "),t.firstChild)}if(o=a.createRng(),t.normalize(),t.hasChildNodes()){for(n=new to(t,t);r=n.current();){if(Ro.isText(r)){o.setStart(r,0),o.setEnd(r,0);break}if(u[r.nodeName.toLowerCase()]){o.setStartBefore(r),o.setEndBefore(r);break}i=r,r=n.next()}r||(o.setStart(i,0),o.setEnd(i,0))}else Ro.isBr(t)?t.nextSibling&&a.isBlock(t.nextSibling)?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)):(o.setStart(t,0),o.setEnd(t,0));e.selection.setRng(o),a.remove(void 0),e.selection.scrollIntoView(t)}},Fw=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},Hw=Mw,zw=function(e){return Mw(e).fold(i(""),(function(e){return e.nodeName.toUpperCase()}))},Ww=function(e){return Mw(e).filter((function(e){return mo(Xn.fromDom(e))})).isSome()},jw=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},Uw=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},Vw=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},qw=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Ro.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},$w=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;Uw(u=n)&&Uw(u.parentNode)&&(o="LI");var s=o?t(o):i.create("BR");if(qw(n,r,!0)&&qw(n,r,!1))jw(n,"LI")?i.insertAfter(s,Vw(n)):i.replace(s,n);else if(qw(n,r,!0))jw(n,"LI")?(i.insertAfter(s,Vw(n)),s.appendChild(i.doc.createTextNode(" ")),s.appendChild(n)):n.parentNode.insertBefore(s,n);else if(qw(n,r,!1))i.insertAfter(s,Vw(n));else{n=Vw(n);var c=a.cloneRange();c.setStartAfter(r),c.setEndAfter(n);var l=c.extractContents();"LI"===o&&function(e,t){return e.firstChild&&e.firstChild.nodeName===t}(l,"LI")?(s=l.firstChild,i.insertAfter(l,n)):(i.insertAfter(l,n),i.insertAfter(s,n))}i.remove(r),Lw(e,s)}},Yw=function(e,t){return t&&"A"===t.nodeName&&e.isEmpty(t)},Xw=function(e){e.innerHTML='<br data-mce-bogus="1">'},Kw=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},Gw=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},Jw=function(e,t,n){return!1===Ro.isText(t)?n:e?1===n&&t.data.charAt(n-1)===ra?0:n:n===t.data.length-1&&t.data.charAt(n)===ra?t.data.length:n},Qw=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},Zw=function(e,t,n){N.from(n.style).map(e.dom.parseStyle).each((function(n){var r=function(e){var t={},n=e.dom();if(sr(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);t[o]=n.style[o]}return t}(Xn.fromDom(t)),o=Gi(Gi({},r),n);e.dom.setStyles(t,o)}));var r=N.from(n.class).map((function(e){return e.split(/\s+/)})),o=N.from(t.className).map((function(e){return V(e.split(/\s+/),(function(e){return""!==e}))}));Wa(r,o,(function(n,r){var o=V(r,(function(e){return!H(n,e)})),i=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}(n,o);e.dom.setAttrib(t,"class",i.join(" "))}));var i=["style","class"],a=ar(n,(function(e,t){return!H(i,t)})).t;e.dom.setAttribs(t,a)},ex=function(e,t){var n=ol(e);if(n&&n.toLowerCase()===t.tagName.toLowerCase()){var r=il(e);Zw(e,t,r)}},tx=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,h,g=e.dom,p=e.schema,v=p.getNonEmptyElements(),b=e.selection.getRng(),y=function(t){var n,i,u,s=o,c=p.getTextInlineElements();if(u=n=t||"TABLE"===f||"HR"===f?g.create(t||m):a.cloneNode(!1),!1===sl(e))g.setAttrib(n,"style",null),g.setAttrib(n,"class",null);else do{if(c[s.nodeName]){if(Pu(s)||Qs(s))continue;i=s.cloneNode(!1),g.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(u=i,n.appendChild(i))}}while((s=s.parentNode)&&s!==r);return ex(e,n),Xw(u),n},w=function(e){var t,n,r,u;if(u=Jw(e,o,i),Ro.isText(o)&&(e?u>0:u<o.nodeValue.length))return!1;if(o.parentNode===a&&h&&!e)return!0;if(e&&Ro.isElement(o)&&o===a.firstChild)return!0;if(Kw(o,"TABLE")||Kw(o,"HR"))return h&&!e||!h&&e;for(t=new to(o,a),Ro.isText(o)&&(e&&0===u?t.prev():e||u!==o.nodeValue.length||t.next());n=t.current();){if(Ro.isElement(n)){if(!n.getAttribute("data-mce-bogus")&&(r=n.nodeName.toLowerCase(),v[r]&&"br"!==r))return!1}else if(Ro.isText(n)&&!/^[ \t\r\n]*$/.test(n.nodeValue))return!1;e?t.prev():t.next()}return!0},x=function(){s=/^(H[1-6]|PRE|FIGURE)$/.test(f)&&"HGROUP"!==d?y(m):y(),cl(e)&&Gw(g,l)&&g.isEmpty(a)?s=g.split(l,a):g.insertAfter(s,a),Lw(e,s)};bh(g,b).each((function(e){b.setStart(e.startContainer,e.startOffset),b.setEnd(e.endContainer,e.endOffset)})),o=b.startContainer,i=b.startOffset,m=ol(e),u=t.shiftKey,Ro.isElement(o)&&o.hasChildNodes()&&(h=i>o.childNodes.length-1,o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o,i=h&&Ro.isText(o)?o.nodeValue.length:0),(r=Qw(g,o))&&((m&&!u||!m&&u)&&(o=function(e,t,n,r,o){var i,a,u,s,c,l,f=t||"P",d=e.dom,m=Qw(d,r);if(!(a=d.getParent(r,d.isBlock))||!Gw(d,a)){if(l=(a=a||m)===e.getBody()||function(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}(a)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=d.create(f),ex(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!d.isBlock(s);)u=s,s=s.previousSibling;if(u&&e.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),ex(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!d.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(e,m,b,o,i)),a=g.getParent(o,g.isBlock),l=a?g.getParent(a.parentNode,g.isBlock):null,f=a?a.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||t.ctrlKey||(a=l,l=l.parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&g.isEmpty(a)?$w(e,y,l,a,m):m&&a===e.getBody()||(m=m||"P",ua(a)?(s=pa(a),g.isEmpty(a)&&Xw(a),ex(e,s),Lw(e,s)):w()?x():w(!0)?(s=a.parentNode.insertBefore(y(),a),Lw(e,Kw(a,"HR")?s:a)):((n=function(e){var t=e.cloneRange();return t.setStart(e.startContainer,Jw(!0,e.startContainer,e.startOffset)),t.setEnd(e.endContainer,Jw(!1,e.endContainer,e.endOffset)),t}(b).cloneRange()).setEndAfter(a),function(e){j(Ii(Xn.fromDom(e),tr),(function(e){var t=e.dom();t.nodeValue=oa(t.nodeValue)}))}(c=n.extractContents()),function(e){do{Ro.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild}while(e)}(c),s=c.firstChild,g.insertAfter(c,a),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Ro.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):Yw(e,o)&&e.remove(o)}}(g,v,s),function(e,t){var n;t.normalize(),(n=t.lastChild)&&!/^(left|right)$/gi.test(e.getStyle(n,"float",!0))||e.add(t,"br")}(g,a),g.isEmpty(a)&&Xw(a),s.normalize(),g.isEmpty(s)?(g.remove(s),x()):(ex(e,s),Lw(e,s))),g.setAttrib(s,"id",""),e.fire("NewBlock",{newBlock:s})))},nx=function(e,t){return Hw(e).filter((function(e){return t.length>0&&Er(Xn.fromDom(e),t)})).isSome()},rx=function(e){return nx(e,al(e))},ox=function(e){return nx(e,ul(e))},ix=of([{br:[]},{block:[]},{none:[]}]),ax=function(e,t){return ox(e)},ux=function(e){return function(t,n){return""===ol(t)===e}},sx=function(e){return function(t,n){return Ww(t)===e}},cx=function(e,t){return function(n,r){return zw(n)===e.toUpperCase()===t}},lx=function(e){return cx("pre",e)},fx=function(e){return function(t,n){return rl(t)===e}},dx=function(e,t){return rx(e)},mx=function(e,t){return t},hx=function(e){var t=ol(e),n=Fw(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},gx=function(e,t){return function(n,r){return q(e,(function(e,t){return e&&t(n,r)}),!0)?N.some(t):N.none()}},px=function(e,t){return nd([gx([ax],ix.none()),gx([cx("summary",!0)],ix.br()),gx([lx(!0),fx(!1),mx],ix.br()),gx([lx(!0),fx(!1)],ix.block()),gx([lx(!0),fx(!0),mx],ix.block()),gx([lx(!0),fx(!0)],ix.br()),gx([sx(!0),mx],ix.br()),gx([sx(!0)],ix.block()),gx([ux(!0),mx,hx],ix.block()),gx([ux(!0)],ix.br()),gx([dx],ix.br()),gx([ux(!1),mx],ix.br()),gx([hx],ix.block())],[e,t.shiftKey]).getOr(ix.none())},vx=function(e,t){px(e,t).fold((function(){_h(e,t)}),(function(){tx(e,t)}),r)},bx=function(e){e.on("keydown",(function(t){t.keyCode===qp.ENTER&&function(e,t){var n;t.isDefaultPrevented()||(t.preventDefault(),(n=e.undoManager).typing&&(n.typing=!1,n.add()),e.undoManager.transact((function(){!1===e.selection.isCollapsed()&&e.execCommand("Delete"),vx(e,t)})))}(e,t)}))},yx=function(e,t){var n=t.container(),r=t.offset();return Ro.isText(n)?(n.insertData(r,e),N.some(cu(n,r+e.length))):bs(t).map((function(n){var r=Xn.fromText(e);return t.isAtEnd()?yi(n,r):bi(n,r),cu(r.dom(),e.length)}))},wx=u(yx," "),xx=u(yx," "),Cx=function(e,t,n){return js.navigateIgnore(e,t,n,bf)},Sx=function(e,t){return $(Ul(Xn.fromDom(t.container()),e),uo)},Ex=function(e,t,n){return Cx(e,t.dom(),n).forall((function(e){return Sx(t,n).fold((function(){return!1===ss(e,n,t.dom())}),(function(r){return!1===ss(e,n,t.dom())&&Tr(r,Xn.fromDom(e.container()))}))}))},kx=function(e,t,n){return Sx(t,n).fold((function(){return Cx(e,t.dom(),n).forall((function(e){return!1===ss(e,n,t.dom())}))}),(function(t){return Cx(e,t.dom(),n).isNone()}))},Nx=u(kx,!1),Tx=u(kx,!0),_x=u(Ex,!1),Rx=u(Ex,!0),Ox=function(e){return cu.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},Ax=function(e,t){var n=V(Ul(Xn.fromDom(t.container()),e),uo);return J(n).getOr(e)},Dx=function(e,t){return Ox(t)?vf(t):vf(t)||js.prevPosition(Ax(e,t).dom(),t).exists(vf)},Px=function(e,t){return Ox(t)?pf(t):pf(t)||js.nextPosition(Ax(e,t).dom(),t).exists(pf)},Bx=function(e){return bs(e).bind((function(e){return Hi(e,er)})).exists((function(e){return function(e){return H(["pre","pre-wrap"],e)}(gr(e,"white-space"))}))},Ix=function(e,t){return function(e,t){return js.prevPosition(e.dom(),t).isNone()}(e,t)||function(e,t){return js.nextPosition(e.dom(),t).isNone()}(e,t)||Nx(e,t)||Tx(e,t)||cf(e,t)||sf(e,t)},Mx=function(e,t){var n=function(e){var t=e.container(),n=e.offset();return Ro.isText(t)&&n<t.data.length?cu(t,n+1):e}(t);return!Bx(n)&&(Tx(e,n)||Rx(e,n)||sf(e,n)||Px(e,n))},Lx=function(e,t){return function(e,t){return!Bx(t)&&(Nx(e,t)||_x(e,t)||cf(e,t)||Dx(e,t))}(e,t)||Mx(e,t)},Fx=function(e,t){return df(e.charAt(t))},Hx=function(e){var t=e.container();return Ro.isText(t)&&Ln(t.data," ")},zx=function(e){var t=e.data,n=function(e){var t=e.split("");return W(t,(function(e,n){return df(e)&&n>0&&n<t.length-1&&hf(t[n-1])&&hf(t[n+1])?" ":e})).join("")}(t);return n!==t&&(e.data=n,!0)},Wx=function(e,t){return N.some(t).filter(Hx).bind((function(t){var n=t.container();return function(e,t){var n=t.data,r=cu(t,0);return!(!Fx(n,0)||Lx(e,r)||(t.data=" "+n.slice(1),0))}(e,n)||zx(n)||function(e,t){var n=t.data,r=cu(t,n.length-1);return!(!Fx(n,n.length-1)||Lx(e,r)||(t.data=n.slice(0,-1)+" ",0))}(e,n)?N.some(t):N.none()}))},jx=function(e){var t=Xn.fromDom(e.getBody());e.selection.isCollapsed()&&Wx(t,cu.fromRangeStart(e.selection.getRng())).each((function(t){e.selection.setRng(t.toRange())}))},Ux=function(e,t){return function(n){return function(e,t){return!Bx(t)&&(Ix(e,t)||Dx(e,t)||Px(e,t))}(e,n)?wx(t):xx(t)}},Vx=function(e){var t=fu.fromRangeStart(e.selection.getRng()),n=Xn.fromDom(e.getBody());if(e.selection.isCollapsed()){var r=u(kl.isInlineTarget,e),o=fu.fromRangeStart(e.selection.getRng());return wd(r,e.getBody(),o).bind(function(e){return function(t){return t.fold((function(t){return js.prevPosition(e.dom(),fu.before(t))}),(function(e){return js.firstPositionIn(e)}),(function(e){return js.lastPositionIn(e)}),(function(t){return js.nextPosition(e.dom(),fu.after(t))}))}}(n)).bind(Ux(n,t)).exists(function(e){return function(t){return e.selection.setRng(t.toRange()),e.nodeChanged(),!0}}(e))}return!1},qx=function(e){e.on("keydown",(function(t){!1===t.isDefaultPrevented()&&function(e,t){Pw([{keyCode:qp.SPACEBAR,action:Dw(Vx,e)}],t).each((function(e){t.preventDefault()}))}(e,t)}))},$x=function(e,t){t.hasAttribute("data-mce-caret")&&(pa(t),function(e){e.selection.setRng(e.selection.getRng())}(e),e.selection.scrollIntoView(t))},Yx=function(e,t){var n=function(e){return Wi(Xn.fromDom(e.getBody()),"*[data-mce-caret]").fold(i(null),(function(e){return e.dom()}))}(e);if(n)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void $x(e,n)):void(la(n)&&($x(e,n),e.undoManager.add()))},Xx=function(e){e.on("keyup compositionstart",u(Yx,e))},Kx=$n.detect().browser,Gx=function(e){!function(e){var t=Ni((function(){e.composing||jx(e)}),0);Kx.isIE()&&(e.on("keypress",(function(e){t.throttle()})),e.on("remove",(function(e){t.cancel()})))}(e),e.on("input",(function(t){!1===t.isComposing&&jx(e)}))},Jx=function(e){e.on("keydown",(function(t){!1===t.isDefaultPrevented()&&function(e,t){Pw([{keyCode:qp.END,action:cw(e,!0)},{keyCode:qp.HOME,action:cw(e,!1)}],t).each((function(e){t.preventDefault()}))}(e,t)}))},Qx=function(e){var t=Bd.setupSelectedState(e);Xx(e),Bw(e,t),Iw(e,t),bx(e),qx(e),Gx(e),Jx(e)};function Zx(e){var t,r,o,i=$t.each,a=qp.BACKSPACE,u=qp.DELETE,s=e.dom,c=e.selection,l=e.settings,f=e.parser,d=le.gecko,m=le.ie,h=le.webkit,g=m?"Text":"URL",p=function(t,n){try{e.getDoc().execCommand(t,!1,n)}catch(e){}},v=function(e){return e.isDefaultPrevented()},b=function(){e.shortcuts.add("meta+a",null,"SelectAll")},y=function(){e.on("keydown",(function(e){if(!v(e)&&e.keyCode===a&&c.isCollapsed()&&0===c.getRng().startOffset){var t=c.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}}))},w=function(){e.inline||(e.contentStyles.push("body {min-height: 150px}"),e.on("click",(function(t){var n;if("HTML"===t.target.nodeName){if(le.ie>11)return void e.getBody().focus();n=e.selection.getRng(),e.getBody().focus(),e.selection.setRng(n),e.selection.normalize(),e.nodeChanged()}})))};return e.on("keydown",(function(t){var n,r,o,i,a;if(!v(t)&&t.keyCode===qp.BACKSPACE&&(r=(n=c.getRng()).startContainer,o=n.startOffset,i=s.getRoot(),a=r,n.collapsed&&0===o)){for(;a&&a.parentNode&&a.parentNode.firstChild===a&&a.parentNode!==i;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(e.formatter.toggle("blockquote",null,a),(n=s.createRng()).setStart(r,0),n.setEnd(r,0),c.setRng(n))}})),t=function(e){var t=s.create("body"),n=e.cloneContents();return t.appendChild(n),c.serializer.serialize(t,{format:"html"})},e.on("keydown",(function(n){var r,o,i=n.keyCode;if(!v(n)&&(i===u||i===a)){if(r=e.selection.isCollapsed(),o=e.getBody(),r&&!s.isEmpty(o))return;if(!r&&!function(n){var r=t(n),o=s.createRng();return o.selectNode(e.getBody()),r===t(o)}(e.selection.getRng()))return;n.preventDefault(),e.setContent(""),o.firstChild&&s.isBlock(o.firstChild)?e.selection.setCursorLocation(o.firstChild,0):e.selection.setCursorLocation(o,0),e.nodeChanged()}})),le.windowsPhone||e.on("keyup focusin mouseup",(function(e){qp.modifierPressed(e)||c.normalize()}),!0),h&&(e.settings.content_editable||s.bind(e.getDoc(),"mousedown mouseup",(function(t){var n;if(t.target===e.getDoc().documentElement)if(n=c.getRng(),e.getBody().focus(),"mousedown"===t.type){if(ca(n.startContainer))return;c.placeCaretAt(t.clientX,t.clientY)}else c.setRng(n)})),e.on("click",(function(t){var n=t.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==s.getContentEditableParent(n)&&(t.preventDefault(),e.selection.select(n),e.nodeChanged()),"A"===n.nodeName&&s.hasClass(n,"mce-item-anchor")&&(t.preventDefault(),c.select(n))})),l.forced_root_block&&e.on("init",(function(){p("DefaultParagraphSeparator",l.forced_root_block)})),e.on("init",(function(){e.dom.bind(e.getBody(),"submit",(function(e){e.preventDefault()}))})),y(),f.addNodeFilter("br",(function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()})),le.iOS?(e.inline||e.on("keydown",(function(){n.document.activeElement===n.document.body&&e.getWin().focus()})),w(),e.on("click",(function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)})),e.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):b()),le.ie>=11&&(w(),y()),le.ie&&(b(),p("AutoUrlDetect",!1),e.on("dragstart",(function(t){!function(t){var n,r;t.dataTransfer&&(e.selection.isCollapsed()&&"IMG"===t.target.tagName&&c.select(t.target),(n=e.selection.getContent()).length>0&&(r="data:text/mce-internal,"+escape(e.id)+","+escape(n),t.dataTransfer.setData(g,r)))}(t)})),e.on("drop",(function(t){if(!v(t)){var n=function(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(g))&&t.indexOf("data:text/mce-internal,")>=0?(t=t.substr("data:text/mce-internal,".length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}(t);if(n&&n.id!==e.id){t.preventDefault();var r=gy(t.x,t.y,e.getDoc());c.setRng(r),o=n.html,i=!0,e.queryCommandSupported("mceInsertClipboardContent")?e.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):e.execCommand("mceInsertContent",!1,o)}}var o,i}))),d&&(e.on("keydown",(function(t){if(!v(t)&&t.keyCode===a){if(!e.getBody().getElementsByTagName("hr").length)return;if(c.isCollapsed()&&0===c.getRng().startOffset){var n=c.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return s.remove(n),void t.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(s.remove(r),t.preventDefault())}}})),n.Range.prototype.getClientRects||e.on("mousedown",(function(t){if(!v(t)&&"HTML"===t.target.nodeName){var n=e.getBody();n.blur(),ge.setEditorTimeout(e,(function(){n.focus()}))}})),r=function(){var t=s.getAttribs(c.getStart().cloneNode(!1));return function(){var n=c.getStart();n!==e.getBody()&&(s.setAttrib(n,"style",null),i(t,(function(e){n.setAttributeNode(e.cloneNode(!0))})))}},o=function(){return!c.isCollapsed()&&s.getParent(c.getStart(),s.isBlock)!==s.getParent(c.getEnd(),s.isBlock)},e.on("keypress",(function(t){var n;if(!v(t)&&(8===t.keyCode||46===t.keyCode)&&o())return n=r(),e.getDoc().execCommand("delete",!1,null),n(),t.preventDefault(),!1})),s.bind(e.getDoc(),"cut",(function(t){var n;!v(t)&&o()&&(n=r(),ge.setEditorTimeout(e,(function(){n()})))})),l.readonly||e.on("BeforeExecCommand MouseDown",(function(){p("StyleWithCSS",!1),p("enableInlineTableEditing",!1),l.object_resizing||p("enableObjectResizing",!1)})),e.on("SetContent ExecCommand",(function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||i(s.select("a"),(function(e){var t=e.parentNode,n=s.getRoot();if(t.lastChild===e){for(;t&&!s.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}s.add(t,"br",{"data-mce-bogus":1})}}))})),e.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),le.mac&&e.on("keydown",(function(t){!qp.metaKeyPressed(t)||t.shiftKey||37!==t.keyCode&&39!==t.keyCode||(t.preventDefault(),e.selection.getSel().modify("move",37===t.keyCode?"backward":"forward","lineboundary"))})),y()),{refreshContentEditable:function(){},isHidden:function(){var t;return!d||e.removed?0:!(t=e.selection.getSel())||!t.rangeCount||0===t.rangeCount}}}var eC=function(e){return Ro.isElement(e)&&lo(Xn.fromDom(e))},tC=function(e){e.on("click",(function(t){t.detail>=3&&function(e){var t=e.selection.getRng(),n=cu.fromRangeStart(t),r=cu.fromRangeEnd(t);if(cu.isElementPosition(n)){var o=n.container();eC(o)&&js.firstPositionIn(o).each((function(e){return t.setStart(e.container(),e.offset())}))}cu.isElementPosition(r)&&(o=n.container(),eC(o)&&js.lastPositionIn(o).each((function(e){return t.setEnd(e.container(),e.offset())}))),e.selection.setRng(Vc(t))}(e)}))},nC=function(e){!function(e){e.on("click",(function(t){e.dom.getParent(t.target,"details")&&t.preventDefault()}))}(e),function(e){e.parser.addNodeFilter("details",(function(e){j(e,(function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")}))})),e.serializer.addNodeFilter("details",(function(e){j(e,(function(e){var t=e.attr("data-mce-open");e.attr("open",_(t)?t:null),e.attr("data-mce-open",null)}))}))}(e)},rC=li.DOM,oC=function(e){e.bindPendingEventDelegates(),e.initialized=!0,e.fire("init"),e.focus(!0),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),function(e){e.settings.auto_focus&&ge.setEditorTimeout(e,(function(){var t;(t=!0===e.settings.auto_focus?e:e.editorManager.get(e.settings.auto_focus)).destroyed||t.focus()}),100)}(e)},iC=function(e,t){var r,o,i=e.settings,a=e.getElement(),u=e.getDoc();i.inline||(e.getElement().style.visibility=e.orgVisibility),t||i.content_editable||(u.open(),u.write(e.iframeHTML),u.close()),i.content_editable&&(e.on("remove",(function(){var e=this.getBody();rC.removeClass(e,"mce-content-body"),rC.removeClass(e,"mce-edit-focus"),rC.setAttrib(e,"contentEditable",null)})),rC.addClass(a,"mce-content-body"),e.contentDocument=u=i.content_document||n.document,e.contentWindow=i.content_window||n.window,e.bodyElement=a,i.content_document=i.content_window=null,i.root_name=a.nodeName.toLowerCase()),(r=e.getBody()).disabled=!0,e.readonly=i.readonly,e.readonly||(e.inline&&"static"===rC.getStyle(r,"position",!0)&&(r.style.position="relative"),r.contentEditable=e.getParam("content_editable_state",!0)),r.disabled=!1,e.editorUpload=Dp(e),e.schema=Zo(i),e.dom=li(u,{keep_values:!0,url_converter:e.convertURL,url_converter_scope:e,hex_colors:i.force_hex_style_colors,class_filter:i.class_filter,update_styles:!0,root_element:e.inline?e.getBody():null,collect:i.content_editable,schema:e.schema,contentCssCors:wl(e),onSetAttrib:function(t){e.fire("SetAttrib",t)}}),e.parser=function(e){var t=ry(e.settings,e.schema);return t.addAttributeFilter("src,href,style,tabindex",(function(t,n){for(var r,o,i,a=t.length,u=e.dom;a--;)if(o=(r=t[a]).attr(n),i="data-mce-"+n,!r.attributes.map[i]){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(i,o),r.attr(n,o)):"tabindex"===n?(r.attr(i,o),r.attr(n,null)):r.attr(i,e.convertURL(o,n,r.name))}})),t.addNodeFilter("script",(function(e){for(var t,n,r=e.length;r--;)0!==(n=(t=e[r]).attr("type")||"no/type").indexOf("mce-")&&t.attr("type","mce-"+n)})),t.addNodeFilter("#cdata",(function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"})),t.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(t){for(var n,r=t.length,o=e.schema.getNonEmptyElements();r--;)(n=t[r]).isEmpty(o)&&0===n.getAll("br").length&&(n.append(new Kb("br",1)).shortEnded=!0)})),t}(e),e.serializer=uy(i,e),e.selection=Vy(e.dom,e.getWin(),e.serializer,e),e.annotator=Ec(e),e.formatter=Mb(e),e.undoManager=qv(e),e._nodeChangeDispatcher=new Up(e),e._selectionOverrides=xv(e),nC(e),tC(e),Qx(e),Lp(e),e.fire("PreInit"),i.browser_spellcheck||i.gecko_spellcheck||(u.body.spellcheck=!1,rC.setAttrib(r,"spellcheck","false")),e.quirks=Zx(e),e.fire("PostRender"),i.directionality&&(r.dir=i.directionality),i.nowrap&&(r.style.whiteSpace="nowrap"),i.protect&&e.on("BeforeSetContent",(function(e){$t.each(i.protect,(function(t){e.content=e.content.replace(t,(function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"}))}))})),e.on("SetContent",(function(){e.addVisual(e.getBody())})),e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"}),e.on("compositionstart compositionend",(function(t){e.composing="compositionstart"===t.type})),e.contentStyles.length>0&&(o="",$t.each(e.contentStyles,(function(e){o+=e+"\r\n"})),e.dom.addStyle(o)),function(e){return e.inline?rC.styleSheetLoader:e.dom.styleSheetLoader}(e).loadAll(e.contentCSS,(function(t){oC(e)}),(function(t){oC(e)})),i.content_style&&function(e,t){var n=Xn.fromDom(e.getDoc().head),r=Xn.fromTag("style");lr(r,"type","text/css"),xi(r,Xn.fromText(t)),xi(n,r)}(e,i.content_style)},aC=li.DOM,uC=function(e){var t="number"==typeof e?e+"px":e;return t||""},sC=function(e,t){var r=e.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),o=function(e,t,n,r){var o=Xn.fromTag("iframe");return fr(o,r),fr(o,{id:e+"_ifr",frameBorder:"0",allowTransparency:"true",title:t}),hr(o,{width:"100%",height:uC(n),display:"block"}),o}(e.id,r,t.height,Jc(e)).dom();o.onload=function(){o.onload=null,e.fire("load")};var i=function(e,t){if(n.document.domain!==n.window.location.hostname&&le.ie&&le.ie<12){var r=Ap("mce");e[r]=function(){iC(e)};var o='javascript:(function(){document.open();document.domain="'+n.document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+r+"(true);})()";return aC.setAttrib(t,"src",o),!0}return!1}(e,o);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=o,e.iframeHTML=function(e){var t,n,r;return r=Qc(e)+"<html><head>",Zc(e)!==e.documentBaseUrl&&(r+='<base href="'+e.documentBaseURI.getURI()+'" />'),r+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',t=el(e),n=tl(e),nl(e)&&(r+='<meta http-equiv="Content-Security-Policy" content="'+nl(e)+'" />'),r+='</head><body id="'+t+'" class="mce-content-body '+n+'" data-id="'+e.id+'"><br></body></html>'}(e),aC.add(t.iframeContainer,o),i},cC=function(e,t){var n=sC(e,t);t.editorContainer&&(aC.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=aC.isHidden(t.editorContainer)),e.getElement().style.display="none",aC.setAttrib(e.id,"aria-hidden","true"),n||iC(e)},lC=li.DOM,fC=function(e,t,n){var r=vp.get(n),o=vp.urls[n]||e.documentBaseUrl.replace(/\/$/,"");if(n=$t.trim(n),r&&-1===$t.inArray(t,n)){if($t.each(vp.dependencies(n),(function(n){fC(e,t,n)})),e.plugins[n])return;try{var i=new r(e,o,e.$);e.plugins[n]=i,i.init&&(i.init(e,o),t.push(n))}catch(t){pp.pluginInitError(e,n,t)}}},dC=function(e){return e.replace(/^\-/,"")},mC=function(e){return{editorContainer:e,iframeContainer:e}},hC=function(e){var t=e.getElement();return e.inline?mC(null):function(e){var t=lC.create("div");return lC.insertAfter(t,e),mC(t)}(t)},gC=function(e){var t=e.settings,n=e.getElement();return e.orgDisplay=n.style.display,_(t.theme)?function(e){var t,n,r,o,i,a=e.settings,u=e.getElement();return t=a.width||lC.getStyle(u,"width")||"100%",n=a.height||lC.getStyle(u,"height")||u.offsetHeight,r=a.min_height||100,(o=/^[0-9\.]+(|px)$/i).test(""+t)&&(t=Math.max(parseInt(t,10),100)),o.test(""+n)&&(n=Math.max(parseInt(n,10),r)),i=e.theme.renderUI({targetNode:u,width:t,height:n,deltaWidth:a.delta_width,deltaHeight:a.delta_height}),a.content_editable||(n=(i.iframeHeight||n)+("number"==typeof n?i.deltaHeight||0:""))<r&&(n=r),i.height=n,i}(e):P(t.theme)?function(e){var t,n=e.getElement();return(t=e.settings.theme(e,n)).editorContainer.nodeType&&(t.editorContainer.id=t.editorContainer.id||e.id+"_parent"),t.iframeContainer&&t.iframeContainer.nodeType&&(t.iframeContainer.id=t.iframeContainer.id||e.id+"_iframecontainer"),t.height=t.iframeHeight?t.iframeHeight:n.offsetHeight,t}(e):hC(e)},pC=function(e){var t,n=e.settings,r=e.getElement();return e.rtl=n.rtl_ui||e.editorManager.i18n.rtl,e.editorManager.i18n.setCode(n.language),n.aria_label=n.aria_label||lC.getAttrib(r,"aria-label",e.getLang("aria.rich_text_area")),e.fire("ScriptsLoaded"),function(e){var t,n=e.settings.theme;_(n)?(e.settings.theme=dC(n),t=bp.get(n),e.theme=new t(e,bp.urls[n]),e.theme.init&&e.theme.init(e,bp.urls[n]||e.documentBaseUrl.replace(/\/$/,""),e.$)):e.theme={}}(e),function(e){var t=[];$t.each(e.settings.plugins.split(/[ ,]/),(function(n){fC(e,t,dC(n))}))}(e),t=gC(e),e.editorContainer=t.editorContainer?t.editorContainer:null,n.content_css&&$t.each($t.explode(n.content_css),(function(t){e.contentCSS.push(e.documentBaseURI.toAbsolute(t))})),n.content_editable?iC(e):cC(e,t)},vC=li.DOM,bC=function(e){return"-"===e.charAt(0)},yC=function(e,t){var n=gi.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(_(i)){if(!bC(i)&&!bp.urls.hasOwnProperty(i)){var a=o.theme_url;a?bp.load(i,t.documentBaseURI.toAbsolute(a)):bp.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue((function(){bp.waitFor(i,r)}))}else r()}(n,e,t,(function(){!function(e,t){var n=t.settings;n.language&&"en"!==n.language&&!n.language_url&&(n.language_url=t.editorManager.baseURL+"/langs/"+n.language+".js"),n.language_url&&!t.editorManager.i18n.data[n.language]&&e.add(n.language_url)}(n,e),function(e,t){$t.isArray(e.plugins)&&(e.plugins=e.plugins.join(" ")),$t.each(e.external_plugins,(function(t,n){vp.load(n,t),e.plugins+=" "+n})),$t.each(e.plugins.split(/[ ,]/),(function(e){if((e=$t.trim(e))&&!vp.urls[e])if(bC(e)){e=e.substr(1,e.length);var n=vp.dependencies(e);$t.each(n,(function(e){var n={prefix:"plugins/",resource:e,suffix:"/plugin"+t+".js"};e=vp.createUrl(n,e),vp.load(e.resource,e)}))}else vp.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+t+".js"})}))}(e.settings,t),n.loadQueue((function(){e.removed||pC(e)}),e,(function(t){pp.pluginLoadError(e,t[0]),e.removed||pC(e)}))}))},wC=function(e){var t=e.settings,r=e.id,o=function(){vC.unbind(n.window,"ready",o),e.render()};if(Ee.Event.domLoaded){if(e.getElement()&&le.contentEditable){t.inline?e.inline=!0:(e.orgVisibility=e.getElement().style.visibility,e.getElement().style.visibility="hidden");var i=e.getElement().form||vC.getParent(r,"form");i&&(e.formElement=i,t.hidden_input&&!/TEXTAREA|INPUT/i.test(e.getElement().nodeName)&&(vC.insertAfter(vC.create("input",{type:"hidden",name:r}),r),e.hasHiddenInput=!0),e.formEventDelegate=function(t){e.fire(t.type,t)},vC.bind(i,"submit reset",e.formEventDelegate),e.on("reset",(function(){e.setContent(e.startContent,{format:"raw"})})),!t.submit_patch||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return e.editorManager.triggerSave(),e.setDirty(!1),i._mceOldSubmit(i)})),e.windowManager=up(e),e.notificationManager=ap(e),"xml"===t.encoding&&e.on("GetContent",(function(e){e.save&&(e.content=vC.encode(e.content))})),t.add_form_submit_trigger&&e.on("submit",(function(){e.initialized&&e.save()})),t.add_unload_trigger&&(e._beforeUnload=function(){!e.initialized||e.destroyed||e.isHidden()||e.save({format:"raw",no_events:!0,set_dirty:!1})},e.editorManager.on("BeforeUnload",e._beforeUnload)),e.editorManager.add(e),yC(e,e.suffix)}}else vC.bind(n.window,"ready",o)},xC=function(e,t,n){var r=e.sidebars?e.sidebars:[];r.push({name:t,settings:n}),e.sidebars=r},CC=$t.each,SC=$t.trim,EC="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),kC={ftp:21,http:80,https:443,mailto:25},NC=function(e,t){var r,o,i=this;if(e=SC(e),r=(t=i.settings=t||{}).base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))i.source=e;else{var a=0===e.indexOf("//");0!==e.indexOf("/")||a||(e=(r&&r.protocol||"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(o=t.base_uri?t.base_uri.path:new NC(n.document.location.href).directory,""==t.base_uri.protocol?e="//mce_host"+i.toAbsPath(o,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(r&&r.protocol||"http")+"://mce_host"+i.toAbsPath(o,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),CC(EC,(function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),i[t]=r})),r&&(i.protocol||(i.protocol=r.protocol),i.userInfo||(i.userInfo=r.userInfo),i.port||"mce_host"!==i.host||(i.port=r.port),i.host&&"mce_host"!==i.host||(i.host=r.host),i.source=""),a&&(i.protocol="")}};NC.prototype={setPath:function(e){e=/^(.*?)\/?(\w+)?$/.exec(e),this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},toRelative:function(e){var t;if("./"===e)return e;if("mce_host"!==(e=new NC(e,{base_uri:this})).host&&this.host!==e.host&&e.host||this.port!==e.port||this.protocol!==e.protocol&&""!==e.protocol)return e.getURI();var n=this.getURI(),r=e.getURI();return n===r||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===r?n:(t=this.toRelPath(this.path,e.path),e.query&&(t+="?"+e.query),e.anchor&&(t+="#"+e.anchor),t)},toAbsolute:function(e,t){return(e=new NC(e,{base_uri:this})).getURI(t&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=kC[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r,o,i=0,a="";if(e=(e=e.substring(0,e.lastIndexOf("/"))).split("/"),n=t.split("/"),e.length>=n.length)for(r=0,o=e.length;r<o;r++)if(r>=n.length||e[r]!==n[r]){i=r+1;break}if(e.length<n.length)for(r=0,o=n.length;r<o;r++)if(r>=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r<o;r++)a+="../";for(r=i-1,o=n.length;r<o;r++)a+=r!==i-1?"/"+n[r]:n[r];return a},toAbsPath:function(e,t){var n,r,o,i=0,a=[];for(r=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),CC(e,(function(e){e&&a.push(e)})),e=a,n=t.length-1,a=[];n>=0;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?i>0?i--:a.push(t[n]):i++);return 0!==(o=(n=e.length-i)<=0?a.reverse().join("/"):e.slice(0,n).join("/")+"/"+a.reverse().join("/")).indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},getURI:function(e){var t;return this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source}},NC.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},NC.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t};var TC=function(e,t,n){var r;if(t.format=t.format?t.format:"html",t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)r=$t.trim(_v.trimExternal(e.serializer,n.innerHTML));else if("text"===t.format)r=oa(n.innerText||n.textContent);else{if("tree"===t.format)return e.serializer.serialize(n,t);r=function(e,t){var n=ol(e),r=new RegExp("^(<"+n+"[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return t.replace(r,"")}(e,e.serializer.serialize(n,t))}return"text"===t.format||vo(Xn.fromDom(n))?t.content=r:t.content=$t.trim(r),t.no_events||e.fire("GetContent",t),t.content},_C=function(e,t){t(e),e.firstChild&&_C(e.firstChild,t),e.next&&_C(e.next,t)},RC=function(e,t,n){var r=function(e,t,n){var r={},o={},i=[];for(var a in n.firstChild&&_C(n.firstChild,(function(n){j(e,(function(e){e.name===n.name&&(r[e.name]?r[e.name].nodes.push(n):r[e.name]={filter:e,nodes:[n]})})),j(t,(function(e){"string"==typeof n.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(n):o[e.name]={filter:e,nodes:[n]})}))})),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);j(r,(function(e){j(e.filter.callbacks,(function(t){t(e.nodes,e.filter.name,{})}))}))},OC=function(e){return e instanceof Kb},AC=function(e,t){e.dom.setHTML(e.getBody(),t),function(e){Jg(e)&&js.firstPositionIn(e.getBody()).each((function(t){var n=t.getNode(),r=Ro.isTable(n)?js.firstPositionIn(n).getOr(t):t;e.selection.setRng(r.toRange())}))}(e)},DC=function(e,t,n){return void 0===n&&(n={}),n.format=n.format?n.format:"html",n.set=!0,n.content=OC(t)?"":t,OC(t)||n.no_events||(e.fire("BeforeSetContent",n),t=n.content),N.from(e.getBody()).fold(i(t),(function(r){return OC(t)?function(e,t,n,r){RC(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=Wc({validate:e.validate},e.schema).serialize(n);return r.content=vo(Xn.fromDom(t))?o:$t.trim(o),AC(e,r.content),r.no_events||e.fire("SetContent",r),n}(e,r,t,n):function(e,t,n,r){var o,i;return 0===n.length||/^\s+$/.test(n)?(i='<br data-mce-bogus="1">',"TABLE"===t.nodeName?n="<tr><td>"+i+"</td></tr>":/^(UL|OL)$/.test(t.nodeName)&&(n="<li>"+i+"</li>"),(o=ol(e))&&e.schema.isValidChild(t.nodeName.toLowerCase(),o.toLowerCase())?(n=i,n=e.dom.createHTML(o,e.settings.forced_root_block_attrs,n)):n||(n='<br data-mce-bogus="1">'),AC(e,n),e.fire("SetContent",r)):("raw"!==r.format&&(n=Wc({validate:e.validate},e.schema).serialize(e.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=vo(Xn.fromDom(t))?n:$t.trim(n),AC(e,r.content),r.no_events||e.fire("SetContent",r)),r.content}(e,r,t,n)}))},PC=li.DOM,BC=function(e){return N.from(e).each((function(e){return e.destroy()}))},IC=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&PC.remove(o.nextSibling),lg(e),e.editorManager.remove(e),!e.inline&&r&&function(e){PC.setStyle(e.id,"display",e.orgDisplay)}(e),fg(e),PC.remove(e.getContainer()),BC(t),BC(n),e.destroy()}},MC=function(e,t){var n=e.selection,r=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),BC(n),BC(r)),function(e){var t=e.formElement;t&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,t._mceOldSubmit=null),PC.unbind(t,"submit reset",e.formEventDelegate))}(e),function(e){e.contentAreaContainer=e.formElement=e.container=e.editorContainer=null,e.bodyElement=e.contentDocument=e.contentWindow=null,e.iframeElement=e.targetElm=null,e.selection&&(e.selection=e.selection.win=e.selection.dom=e.selection.dom.doc=null)}(e),e.destroyed=!0):e.remove())},LC=li.DOM,FC=$t.extend,HC=$t.each,zC=$t.resolve,WC=le.ie,jC=function(e,t,n){var r=this,o=r.documentBaseUrl=n.documentBaseURL,i=n.baseURI;t=function(e,t,n,r,o){var i=function(e,t,n){return{id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:t,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,indentation:"40px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:n.convertURL,url_converter_scope:n,ie7_compat:!0}}(t,n,e);return Bg(Ng,i,r,o)}(r,e,o,n.defaultSettings,t),r.settings=t,vi.language=t.language||"en",vi.languageLoad=t.language_load,vi.baseURL=n.baseURL,r.id=e,r.setDirty(!1),r.plugins={},r.documentBaseURI=new NC(t.document_base_url,{base_uri:i}),r.baseURI=i,r.contentCSS=[],r.contentStyles=[],r.shortcuts=new Wg(r),r.loadedCSS={},r.editorCommands=new ng(r),r.suffix=n.suffix,r.editorManager=n,r.inline=t.inline,r.buttons={},r.menuItems={},t.cache_suffix&&(le.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(le.overrideViewPort=!1),n.fire("SetupEditor",{editor:r}),r.execCallback("setup",r),r.$=dn.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))};jC.prototype={render:function(){wC(this)},focus:function(e){Gg(this,e)},hasFocus:function(){return Jg(this)},execCallback:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this,i=o.settings[e];if(i)return o.callbackLookup&&(r=o.callbackLookup[e])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?zC(r):0,i=zC(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[e]={func:i,scope:r}),i.apply(r||o,Array.prototype.slice.call(arguments,1))},translate:function(e){if(e&&$t.is(e,"string")){var t=this.settings.language||"en",n=this.editorManager.i18n;e=n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,(function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}))}return this.editorManager.translate(e)},getLang:function(e,t){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(void 0!==t?t:"{#"+e+"}")},getParam:function(e,t,n){return Mg(this,e,t,n)},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.stateSelector&&void 0===t.active&&(t.active=!1),t.text||t.icon||(t.icon=e),t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addSidebar:function(e,t){return xC(this,e,t)},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems[e]=t},addContextToolbar:function(e,t){var n,r=this;r.contextToolbars=r.contextToolbars||[],"string"==typeof e&&(n=e,e=function(e){return r.dom.is(e,n)}),r.contextToolbars.push({id:Ap("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable=!0:(LC.show(this.getContainer()),LC.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this.getDoc();this.hidden||(WC&&e&&!this.inline&&e.execCommand("SelectAll"),this.save(),this.inline?(this.getBody().contentEditable=!1,this===this.editorManager.focusedEditor&&(this.editorManager.focusedEditor=null)):(LC.hide(this.getContainer()),LC.setStyle(this.id,"display",this.orgDisplay)),this.hidden=!0,this.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var t,n=this.getElement();return this.removed?"":n?((e=e||{}).load=!0,t=this.setContent(void 0!==n.value?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,/TEXTAREA|INPUT/i.test(o.nodeName)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=LC.getParent(r.id,"form"))&&HC(n.elements,(function(e){if(e.name===r.id)return e.value=t,!1}))),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},setContent:function(e,t){return DC(this,e,t)},getContent:function(e){return function(e,t){return void 0===t&&(t={}),N.from(e.getBody()).fold(i("tree"===t.format?new Kb("body",11):""),(function(n){return TC(e,t,n)}))}(this,e)},insertContent:function(e,t){t&&(e=FC({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},setMode:function(e){!function(e,t){t!==bg(e)&&(e.initialized?vg(e,"readonly"===t):e.on("init",(function(){vg(e,"readonly"===t)})),dg(e,t))}(this,e)},getContainer:function(){return this.container||(this.container=LC.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=LC.get(this.id)),this.targetElm},getWin:function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},getDoc:function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},addVisual:function(e){var t,n=this,r=n.settings,o=n.dom;e=e||n.getBody(),void 0===n.hasVisual&&(n.hasVisual=r.visual),HC(o.select("table,a",e),(function(e){var i;switch(e.nodeName){case"TABLE":return t=r.visual_table_class||"mce-item-table",void((i=o.getAttrib(e,"border"))&&"0"!==i||!n.hasVisual?o.removeClass(e,t):o.addClass(e,t));case"A":return void(o.getAttrib(e,"href")||(i=o.getAttrib(e,"name")||e.id,t=r.visual_anchor_class||"mce-item-anchor",i&&n.hasVisual?o.addClass(e,t):o.removeClass(e,t)))}})),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){IC(this)},destroy:function(e){MC(this,e)},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},FC(jC.prototype,Eg);var UC,VC,qC,$C={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("mce-")}},YC=function(e,t){$n.detect().browser.isIE()?function(e){e.on("focusout",(function(){$h(e)}))}(e):function(e,t){e.on("mouseup touchend",(function(e){t.throttle()}))}(e,t),e.on("keyup nodechange",(function(t){(function(e){return"nodechange"===e.type&&e.selectionChange})(t)||$h(e)}))},XC=function(e){var t=Ni((function(){$h(e)}),0);e.inline&&function(e,t){var r=function(){t.throttle()};li.DOM.bind(n.document,"mouseup",r),e.on("remove",(function(){li.DOM.unbind(n.document,"mouseup",r)}))}(e,t),e.on("init",(function(){YC(e,t)})),e.on("remove",(function(){t.cancel()}))},KC=li.DOM,GC=function(e){return $C.isEditorUIElement(e)},JC=function(e,t){var n=e?e.settings.custom_ui_selector:"";return null!==KC.getParent(t,(function(t){return GC(t)||!!n&&e.dom.is(t,n)}))},QC=function(e,t){var r=t.editor;XC(r),r.on("focusin",(function(){var t=e.focusedEditor;t!==this&&(t&&t.fire("blur",{focusedEditor:this}),e.setActive(this),e.focusedEditor=this,this.fire("focus",{blurredEditor:t}),this.focus(!0))})),r.on("focusout",(function(){var t=this;ge.setEditorTimeout(t,(function(){var r=e.focusedEditor;JC(t,function(){try{return n.document.activeElement}catch(e){return n.document.body}}())||r!==t||(t.fire("blur",{focusedEditor:null}),e.focusedEditor=null)}))})),UC||(UC=function(t){var r,o=e.activeEditor;r=t.target,o&&r.ownerDocument===n.document&&(r===n.document.body||JC(o,r)||e.focusedEditor!==o||(o.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},KC.bind(n.document,"focusin",UC))},ZC=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(KC.unbind(n.document,"focusin",UC),UC=null)},eS=function(e){e.on("AddEditor",u(QC,e)),e.on("RemoveEditor",u(ZC,e))},tS=li.DOM,nS=$t.explode,rS=$t.each,oS=$t.extend,iS=0,aS=!1,uS=[],sS=[],cS=function(e){var t=e.type;rS(qC.get(),(function(n){switch(t){case"scroll":n.fire("ScrollWindow",e);break;case"resize":n.fire("ResizeWindow",e)}}))},lS=function(e){e!==aS&&(e?dn(window).on("resize scroll",cS):dn(window).off("resize scroll",cS),aS=e)},fS=function(e){var t=sS;delete uS[e.id];for(var n=0;n<uS.length;n++)if(uS[n]===e){uS.splice(n,1);break}return sS=V(sS,(function(t){return e!==t})),qC.activeEditor===e&&(qC.activeEditor=sS.length>0?sS[0]:null),qC.focusedEditor===e&&(qC.focusedEditor=null),t.length!==sS.length};qC={defaultSettings:{},$:dn,majorVersion:"4",minorVersion:"9.11",releaseDate:"2020-07-13",editors:uS,i18n:lp,activeEditor:null,settings:{},setup:function(){var e,t,r="";t=NC.getDocumentBaseUrl(n.document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/"));var o=window.tinymce||window.tinyMCEPreInit;if(o)e=o.base||o.baseURL,r=o.suffix;else{for(var i=n.document.getElementsByTagName("script"),a=0;a<i.length;a++){var u;if(""!==(u=i[a].src||"")){var s=u.substring(u.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(u)){-1!==s.indexOf(".min")&&(r=".min"),e=u.substring(0,u.lastIndexOf("/"));break}}}!e&&n.document.currentScript&&(-1!==(u=n.document.currentScript.src).indexOf(".min")&&(r=".min"),e=u.substring(0,u.lastIndexOf("/")))}this.baseURL=new NC(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new NC(this.baseURL),this.suffix=r,eS(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new NC(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new NC(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n),this.defaultSettings=e;var r=e.plugin_base_urls;for(var o in r)vi.PluginManager.urls[o]=r[o]},init:function(e){var t,r,o=this;r=$t.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var i=function(e){var t=e.id;return t||(t=(t=e.name)&&!tS.get(t)?e.name:tS.uniqueId(),e.setAttribute("id",t)),t},a=function(e,t){return t.constructor===RegExp?t.test(e.className):tS.hasClass(e,t)},u=function(e){t=e},s=function(){var t,c=0,l=[],f=function(e,n,r){var i=new jC(e,n,o);l.push(i),i.on("init",(function(){++c===t.length&&u(l)})),i.targetElm=i.targetElm||r,i.render()};tS.unbind(window,"ready",s),function(t){var n=e[t];n&&n.apply(o,Array.prototype.slice.call(arguments,2))}("onpageload"),t=dn.unique(function(e){var t,r=[];if(le.ie&&le.ie<11)return pp.initError("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(e.types)return rS(e.types,(function(e){r=r.concat(tS.select(e.selector))})),r;if(e.selector)return tS.select(e.selector);if(e.target)return[e.target];switch(e.mode){case"exact":(t=e.elements||"").length>0&&rS(nS(t),(function(e){var t;(t=tS.get(e))?r.push(t):rS(n.document.forms,(function(t){rS(t.elements,(function(t){t.name===e&&(e="mce_editor_"+iS++,tS.setAttrib(t,"id",e),r.push(t))}))}))}));break;case"textareas":case"specific_textareas":rS(tS.select("textarea"),(function(t){e.editor_deselector&&a(t,e.editor_deselector)||e.editor_selector&&!a(t,e.editor_selector)||r.push(t)}))}return r}(e)),e.types?rS(e.types,(function(n){$t.each(t,(function(t){return!tS.is(t,n.selector)||(f(i(t),oS({},e,n),t),!1)}))})):($t.each(t,(function(e){var t;(t=o.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(fS(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)})),0===(t=$t.grep(t,(function(e){return!o.get(e.id)}))).length?u([]):rS(t,(function(t){!function(e,t){return e.inline&&t.tagName.toLowerCase()in r}(e,t)?f(i(t),e,t):pp.initError("Could not initialize inline editor on invalid inline target element",t)})))};return o.settings=e,tS.bind(window,"ready",s),new fe((function(e){t?e(t):u=function(t){e(t)}}))},get:function(e){return 0===arguments.length?sS.slice(0):_(e)?$(sS,(function(t){return t.id===e})).getOr(null):B(e)&&sS[e]?sS[e]:null},add:function(e){var t=this;return uS[e.id]===e?e:(null===t.get(e.id)&&("length"!==e.id&&(uS[e.id]=e),uS.push(e),sS.push(e)),lS(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),VC||(VC=function(){t.fire("BeforeUnload")},tS.bind(window,"beforeunload",VC)),e)},createEditor:function(e,t){return this.add(new jC(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!_(e))return n=e,A(r.get(n.id))?null:(fS(n)&&r.fire("RemoveEditor",{editor:n}),0===sS.length&&tS.unbind(window,"beforeunload",VC),n.remove(),lS(sS.length>0),n);rS(tS.select(e),(function(e){(n=r.get(e.id))&&r.remove(n)}))}else for(t=sS.length-1;t>=0;t--)r.remove(sS[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new jC(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",0,n),!0)}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){rS(sS,(function(e){e.save()}))},addI18n:function(e,t){lp.add(e,t)},translate:function(e){return lp.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},oS(qC,ug),qC.setup();var dS=qC;function mS(e){return{walk:function(t,n){return vc(e,t,n)},split:Nm,normalize:function(t){return bh(e,t).fold(i(!1),(function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0}))}}}!function(e){e.compareRanges=ch,e.getCaretRangeFromPoint=gy,e.getSelectedNode=La,e.getNode=Fa}(mS||(mS={}));var hS,gS,pS=mS,vS=Math.min,bS=Math.max,yS=Math.round,wS=function(e,t,n){var r,o,i,a,u,s;return r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,s=t.h,"b"===(n=(n||"").split(""))[0]&&(o+=s),"r"===n[1]&&(r+=u),"c"===n[0]&&(o+=yS(s/2)),"c"===n[1]&&(r+=yS(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=yS(a/2)),"c"===n[4]&&(r-=yS(i/2)),xS(r,o,i,a)},xS=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},CS={inflate:function(e,t,n){return xS(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:wS,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=wS(e,t,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=bS(e.x,t.x),r=bS(e.y,t.y),o=vS(e.x+e.w,t.x+t.w),i=vS(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:xS(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=bS(0,t.x-u),o=bS(0,t.y-s),i=bS(0,c-f),a=bS(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),xS(u,s,(c-=i)-u,(l-=a)-s)},create:xS,fromClientRect:function(e){return xS(e.left,e.top,e.width,e.height)}},SS={},ES={add:function(e,t){SS[e.toLowerCase()]=t},has:function(e){return!!SS[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=SS.hasOwnProperty(t)?SS[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=SS[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},kS=$t.each,NS=$t.extend,TS=function(){};TS.extend=hS=function(e){var t,n,r,o=this.prototype,i=function(){var e,t,n,r=this;if(!gS&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(r,arguments)},a=function(){return this},u=function(e,t){return function(){var n,r=this,i=r._super;return r._super=o[e],n=t.apply(r,arguments),r._super=i,n}};for(n in gS=!0,t=new this,gS=!1,e.Mixins&&(kS(e.Mixins,(function(t){for(var n in t)"init"!==n&&(e[n]=t[n])})),o.Mixins&&(e.Mixins=o.Mixins.concat(e.Mixins))),e.Methods&&kS(e.Methods.split(","),(function(t){e[t]=a})),e.Properties&&kS(e.Properties.split(","),(function(t){var n="_"+t;e[t]=function(e){return void 0!==e?(this[n]=e,this):this[n]}})),e.Statics&&kS(e.Statics,(function(e,t){i[t]=e})),e.Defaults&&o.Defaults&&(e.Defaults=NS({},o.Defaults,e.Defaults)),e)"function"==typeof(r=e[n])&&o[n]?t[n]=u(n,r):t[n]=r;return i.prototype=t,i.constructor=i,i.extend=hS,i};var _S=Math.min,RS=Math.max,OS=Math.round,AS=function(e,t){var n,r,o,i;if(t=t||'"',null===e)return"null";if("string"==(o=typeof e))return r="\bb\tt\nn\ff\rr\"\"''\\\\",t+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,(function(e,o){return'"'===t&&"'"===e?e:(n=r.indexOf(o))+1?"\\"+r.charAt(n+1):(e=o.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)}))+t;if("object"===o){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(n=0,r="[";n<e.length;n++)r+=(n>0?",":"")+AS(e[n],t);return r+"]"}for(i in r="{",e)e.hasOwnProperty(i)&&(r+="function"!=typeof e[i]?(r.length>1?","+t:t)+i+t+":"+AS(e[i],t):"");return r+"}"}return""+e},DS={serialize:AS,parse:function(e){try{return JSON.parse(e)}catch(e){}}},PS={callbacks:{},count:0,send:function(e){var t=this,n=li.DOM,r=void 0!==e.count?e.count:t.count,o="tinymce_jsonp_"+r;t.callbacks[r]=function(i){n.remove(o),delete t.callbacks[r],e.callback(i)},n.add(n.doc.body,"script",{id:o,src:e.url,type:"text/javascript"}),t.count++}},BS={send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||n++>1e4?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,n>1e4?"TIMED_OUT":"GENERAL",t,e),t=null):setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",BS.fire("beforeInitialize",{settings:e}),t=yp()){if(t.overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&$t.each(e.requestheaders,(function(e){t.setRequestHeader(e.key,e.value)})),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=BS.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};$t.extend(BS,ug);var IS,MS=$t.extend,LS=function(e){this.settings=MS({},e),this.count=0};LS.sendRPC=function(e){return(new LS).send(e)},LS.prototype={send:function(e){var t=e.error,n=e.success;(e=MS(this.settings,e)).success=function(r,o){void 0===(r=DS.parse(r))&&(r={error:"JSON Parse error."}),r.error?t.call(e.error_scope||e.scope,r.error,o):n.call(e.success_scope||e.scope,r.result)},e.error=function(n,r){t&&t.call(e.error_scope||e.scope,n,r)},e.data=DS.serialize({id:e.id||"c"+this.count++,method:e.method,params:e.params}),e.content_type="application/json",BS.send(e)}};try{IS=n.window.localStorage}catch(e){IS=function(){var e={},t=[],n={getItem:function(t){var n=e[t];return n||null},setItem:function(n,r){t.push(n),e[n]=String(r)},key:function(e){return t[e]},removeItem:function(n){t=t.filter((function(e){return e===n})),delete e[n]},clear:function(){t=[],e={}},length:0};return Object.defineProperty(n,"length",{get:function(){return t.length},configurable:!1,enumerable:!1}),n}()}var FS=dS,HS={geom:{Rect:CS},util:{Promise:fe,Delay:ge,Tools:$t,VK:qp,URI:NC,Class:TS,EventDispatcher:og,Observable:ug,I18n:lp,XHR:BS,JSON:DS,JSONRequest:LS,JSONP:PS,LocalStorage:IS,Color:function(e){var t={},n=0,r=0,o=0,i=function(e){var i;return"object"==typeof e?"r"in e?(n=e.r,r=e.g,o=e.b):"v"in e&&function(e,t,i){var a,u,s,c;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,i=parseInt(i,10)/100,t=RS(0,_S(t,1)),i=RS(0,_S(i,1)),0!==t){switch(a=e/60,s=(u=i*t)*(1-Math.abs(a%2-1)),c=i-u,Math.floor(a)){case 0:n=u,r=s,o=0;break;case 1:n=s,r=u,o=0;break;case 2:n=0,r=u,o=s;break;case 3:n=0,r=s,o=u;break;case 4:n=s,r=0,o=u;break;case 5:n=u,r=0,o=s;break;default:n=r=o=0}n=OS(255*(n+c)),r=OS(255*(r+c)),o=OS(255*(o+c))}else n=r=o=OS(255*i)}(e.h,e.s,e.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(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(e))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(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,t};return e&&i(e),t.toRgb=function(){return{r:n,g:r,b:o}},t.toHsv=function(){return function(e,t,n){var r,o,i,a;return o=0,(i=_S(e/=255,_S(t/=255,n/=255)))===(a=RS(e,RS(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,o=a,{h:OS(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/(a-i))),s:OS(100*r),v:OS(100*o)})}(n,r,o)},t.toHex=function(){var e=function(e){return(e=parseInt(e,10).toString(16)).length>1?e:"0"+e};return"#"+e(n)+e(r)+e(o)},t.parse=i,t}},dom:{EventUtils:Ee,Sizzle:St,DomQuery:dn,TreeWalker:to,DOMUtils:li,ScriptLoader:gi,RangeUtils:pS,Serializer:uy,ControlSelection:my,BookmarkManager:ly,Selection:Vy,Event:Ee.Event},html:{Styles:ti,Entities:Uo,Node:Kb,Schema:Zo,SaxParser:Nv,DomParser:ry,Writer:zc,Serializer:Wc},ui:{Factory:ES},Env:le,AddOnManager:vi,Annotator:Ec,Formatter:Mb,UndoManager:qv,EditorCommands:ng,WindowManager:up,NotificationManager:ap,EditorObservable:Eg,Shortcuts:Wg,Editor:jC,FocusManager:$C,EditorManager:dS,DOM:li.DOM,ScriptLoader:gi.ScriptLoader,PluginManager:vi.PluginManager,ThemeManager:vi.ThemeManager,trim:$t.trim,isArray:$t.isArray,is:$t.is,toArray:$t.toArray,makeMap:$t.makeMap,each:$t.each,map:$t.map,grep:$t.grep,inArray:$t.inArray,extend:$t.extend,create:$t.create,walk:$t.walk,createNS:$t.createNS,resolve:$t.resolve,explode:$t.explode,_addCacheSuffix:$t._addCacheSuffix,isOpera:le.opera,isWebKit:le.webkit,isIE:le.ie,isGecko:le.gecko,isMac:le.mac},zS=FS=$t.extend(FS,HS);!function(e){window.tinymce=e,window.tinyMCE=e}(zS),function(t){try{e.exports=t}catch(e){}}(zS)}(window)}).call(this,n(30))},329:function(e,t){!function(e){"use strict";var t,n,r,o,i=tinymce.util.Tools.resolve("tinymce.ThemeManager"),a=tinymce.util.Tools.resolve("tinymce.EditorManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=function(e){return!1!==c(e)},c=function(e){return e.getParam("menubar")},l=function(e){return e.getParam("toolbar_items_size")},f=function(e){return e.getParam("menu")},d=function(e){return!1===e.settings.skin},m=function(e){var t=e.getParam("resize","vertical");return!1===t?"none":"both"===t?"both":"vertical"},h=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),g=tinymce.util.Tools.resolve("tinymce.ui.Factory"),p=tinymce.util.Tools.resolve("tinymce.util.I18n"),v=function(e){return e.fire("SkinLoaded")},b=function(e){return e.fire("ResizeEditor")},y=function(e){return e.fire("BeforeRenderUI")},w=function(e,t){return function(){var n=e.find(t)[0];n&&n.focus(!0)}},x=function(e,t){e.shortcuts.add("Alt+F9","",w(t,"menubar")),e.shortcuts.add("Alt+F10,F10","",w(t,"toolbar")),e.shortcuts.add("Alt+F11","",w(t,"elementpath")),t.on("cancel",(function(){e.focus()}))},C=tinymce.util.Tools.resolve("tinymce.geom.Rect"),S=tinymce.util.Tools.resolve("tinymce.util.Delay"),E=function(){},k=function(e){return function(){return e}},N=k(!1),T=k(!0),_=function(){return R},R=(t=function(e){return e.isNone()},o={fold:function(e,t){return e()},is:N,isSome:N,isNone:T,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:k(null),getOrUndefined:k(void 0),or:r,orThunk:n,map:_,each:E,bind:_,exists:N,forall:T,filter:_,equals:t,equals_:t,toArray:function(){return[]},toString:k("none()")},Object.freeze&&Object.freeze(o),o),O=function(e){var t=k(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:T,isNone:N,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return O(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:R},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(N,(function(t){return n(e,t)}))}};return o},A={some:O,none:_,from:function(e){return null==e?R:O(e)}},D=function(e){return e?e.getRoot().uiContainer:null},P={getUiContainerDelta:function(e){var t=D(e);if(t&&"static"!==h.DOM.getStyle(t,"position",!0)){var n=h.DOM.getPos(t),r=t.scrollLeft-n.x,o=t.scrollTop-n.y;return A.some({x:r,y:o})}return A.none()},setUiContainer:function(e,t){var n=h.DOM.select(e.settings.ui_container)[0];t.getRoot().uiContainer=n},getUiContainer:D,inheritUiContainer:function(e,t){return t.uiContainer=D(e)}},B=function(e,t,n){var r,o=[];if(t)return u.each(t.split(/[ ,]/),(function(t){var i,a=function(){var n=e.selection;t.settings.stateSelector&&n.selectorChanged(t.settings.stateSelector,(function(e){t.active(e)}),!0),t.settings.disabledStateSelector&&n.selectorChanged(t.settings.disabledStateSelector,(function(e){t.disabled(e)}))};"|"===t?r=null:(r||(r={type:"buttongroup",items:[]},o.push(r)),e.buttons[t]&&(i=t,"function"==typeof(t=e.buttons[i])&&(t=t()),t.type=t.type||"button",t.size=n,t=g.create(t),r.items.push(t),e.initialized?a():e.on("init",a)))})),{type:"toolbar",layout:"flow",items:o}},I=B,M=function(e,t){var n=[];if(u.each(function(e){var t=e.getParam("toolbar");return!1===t?[]:u.isArray(t)?u.grep(t,(function(e){return e.length>0})):function(e,t){for(var n=[],r=1;r<10;r++){var o=e["toolbar"+r];if(!o)break;n.push(o)}var i=e.toolbar?[e.toolbar]:[t];return n.length>0?n:i}(e.settings,"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image")}(e),(function(r){var o;(o=r)&&n.push(B(e,o,t))})),n.length)return{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:n}},L=h.DOM,F=function(e){return{left:e.x,top:e.y,width:e.w,height:e.h,right:e.x+e.w,bottom:e.y+e.h}},H=function(e,t){e.moveTo(t.left,t.top)},z=function(e,t,n,r,o,i){return i=F({x:t,y:n,w:i.w,h:i.h}),e&&(i=e({elementRect:F(r),contentAreaRect:F(o),panelRect:i})),i},W=function(e){var t,n=function(){return e.contextToolbars||[]},r=function(t,n){var r,o,i,a,s,c,l,f=function(e){return e.getParam("inline_toolbar_position_handler")}(e);if(!e.removed)if(t&&t.toolbar.panel){var d,m,h,g;l=["bc-tc","tc-bc","tl-bl","bl-tl","tr-br","br-tr"],s=t.toolbar.panel,n&&s.show(),d=t.element,m=L.getPos(e.getContentAreaContainer()),h=e.dom.getRect(d),"BODY"===(g=e.dom.getRoot()).nodeName&&(h.x-=g.ownerDocument.documentElement.scrollLeft||g.scrollLeft,h.y-=g.ownerDocument.documentElement.scrollTop||g.scrollTop),h.x+=m.x,h.y+=m.y,i=h,o=L.getRect(s.getEl()),a=L.getRect(e.getContentAreaContainer()||e.getBody());var p=P.getUiContainerDelta(s).getOr({x:0,y:0});if(i.x+=p.x,i.y+=p.y,o.x+=p.x,o.y+=p.y,a.x+=p.x,a.y+=p.y,"inline"!==L.getStyle(t.element,"display",!0)){var v=t.element.getBoundingClientRect();i.w=v.width,i.h=v.height}e.inline||(a.w=e.getDoc().documentElement.offsetWidth),e.selection.controlSelection.isResizable(t.element)&&i.w<25&&(i=C.inflate(i,0,8)),r=C.findBestRelativePosition(o,i,a,l),i=C.clamp(i,a),r?(c=C.relativePosition(o,i,r),H(s,z(f,c.x,c.y,i,a,o))):(a.h+=o.h,(i=C.intersect(a,i))?(r=C.findBestRelativePosition(o,i,a,["bc-tc","bl-tl","br-tr"]))?(c=C.relativePosition(o,i,r),H(s,z(f,c.x,c.y,i,a,o))):H(s,z(f,i.x,i.y,i,a,o)):s.hide()),function(e,t,n){t=t?t.substr(0,2):"",u.each({t:"down",b:"up"},(function(r,o){e.classes.toggle("arrow-"+r,n(o,t.substr(0,1)))})),u.each({l:"left",r:"right"},(function(r,o){e.classes.toggle("arrow-"+r,n(o,t.substr(1,1)))}))}(s,r,(function(e,t){return e===t}))}else!function(e){u.each(e.contextToolbars,(function(e){e.panel&&e.panel.hide()}))}(e)},o=function(t){return function(){S.requestAnimationFrame((function(){e.selection&&r(s(e.selection.getNode()),t)}))}},i=function(n){var i;if(n.toolbar.panel)return n.toolbar.panel.show(),void r(n);i=g.create({type:"floatpanel",role:"dialog",classes:"tinymce tinymce-inline arrow",ariaLabel:"Inline toolbar",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!0,border:1,items:I(e,n.toolbar.items),oncancel:function(){e.focus()}}),P.setUiContainer(e,i),function(n){if(!t){var r=o(!0),i=P.getUiContainer(n);t=e.selection.getScrollContainer()||e.getWin(),L.bind(t,"scroll",r),L.bind(i,"scroll",r),e.on("remove",(function(){L.unbind(t,"scroll",r),L.unbind(i,"scroll",r)}))}}(i),n.toolbar.panel=i,i.renderTo().reflow(),r(n)},a=function(){u.each(n(),(function(e){e.panel&&e.panel.hide()}))},s=function(t){var r,o,i,a=n();for(r=(i=e.$(t).parents().add(t)).length-1;r>=0;r--)for(o=a.length-1;o>=0;o--)if(a[o].predicate(i[r]))return{toolbar:a[o],element:i[r]};return null};e.on("click keyup setContent ObjectResized",(function(t){("setcontent"!==t.type||t.selection)&&S.setEditorTimeout(e,(function(){var t;(t=s(e.selection.getNode()))?(a(),i(t)):a()}))})),e.on("blur hide contextmenu",a),e.on("ObjectResizeStart",(function(){var t=s(e.selection.getNode());t&&t.toolbar.panel&&t.toolbar.panel.hide()})),e.on("ResizeEditor ResizeWindow",o(!0)),e.on("nodeChange",o(!1)),e.on("remove",(function(){u.each(n(),(function(e){e.panel&&e.panel.remove()})),e.contextToolbars={}})),e.shortcuts.add("ctrl+F9","",(function(){var t=s(e.selection.getNode());t&&t.toolbar.panel&&t.toolbar.panel.items()[0].focus()}))},j=function(e){return function(t){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(t)===e}},U=j("array"),V=j("function"),q=j("number"),$=(Array.prototype.slice,Array.prototype.indexOf),Y=Array.prototype.push,X=function(e,t){var n,r,o=(n=e,r=t,$.call(n,r));return-1===o?A.none():A.some(o)},K=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1},G=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},J=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)},Q=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},Z=(V(Array.from)&&Array.from,{file:{title:"File",items:"newdocument restoredraft | preview | print"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen"},insert:{title:"Insert",items:"image link media template codesample inserttable | charmap hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | blockformats align | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code"},table:{title:"Table"},help:{title:"Help"}}),ee=function(e,t){return"|"===e?{name:"|",item:{text:"|"}}:t?{name:e,item:t}:null},te=function(e,t){return function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return A.some(n);return A.none()}(e,(function(e){return e.name===t})).isSome()},ne=function(e){return e&&"|"===e.item.text},re=function(e,t,n,r){var o,i,a,s;return t?(i=t[r],s=!0):i=Z[r],i&&(o={text:i.title},a=[],u.each((i.items||"").split(/[ ,]/),(function(t){var n=ee(t,e[t]);n&&a.push(n)})),s||u.each(e,(function(e,t){e.context!==r||te(a,t)||("before"===e.separator&&a.push({name:"|",item:{text:"|"}}),e.prependToContext?a.unshift(ee(t,e)):a.push(ee(t,e)),"after"===e.separator&&a.push({name:"|",item:{text:"|"}}))})),o.menu=G(function(e,t){var n=Q(e,(function(e){return!1===t.hasOwnProperty(e.name)})),r=Q(n,(function(e,t){return!ne(e)||!ne(n[t-1])}));return Q(r,(function(e,t){return!ne(e)||t>0&&t<r.length-1}))}(a,n),(function(e){return e.item})),!o.menu.length)?null:o},oe=function(e){for(var t=[],n=function(e){var t,n=[],r=f(e);if(r)for(t in r)n.push(t);else for(t in Z)n.push(t);return n}(e),r=u.makeMap(function(e){return e.getParam("removed_menuitems","")}(e).split(/[ ,]/)),o=c(e),i="string"==typeof o?o.split(/[ ,]/):n,a=0;a<i.length;a++){var s=i[a],l=re(e.menuItems,f(e),r,s);l&&t.push(l)}return t},ie=h.DOM,ae=function(e){return{width:e.clientWidth,height:e.clientHeight}},ue=function(e,t,n){var r,o,i,a;r=e.getContainer(),o=e.getContentAreaContainer().firstChild,i=ae(r),a=ae(o),null!==t&&(t=Math.max(function(e){return e.getParam("min_width",100,"number")}(e),t),t=Math.min(function(e){return e.getParam("max_width",65535,"number")}(e),t),ie.setStyle(r,"width",t+(i.width-a.width)),ie.setStyle(o,"width",t)),n=Math.max(function(e){return e.getParam("min_height",100,"number")}(e),n),n=Math.min(function(e){return e.getParam("max_height",65535,"number")}(e),n),ie.setStyle(o,"height",n),b(e)},se=ue,ce=function(e,t,n){var r=e.getContentAreaContainer();ue(e,r.clientWidth+t,r.clientHeight+n)},le=tinymce.util.Tools.resolve("tinymce.Env"),fe=function(e,t,n){var r,o=e.settings[n];o&&o((r=t.getEl("body"),{element:function(){return r}}))},de=function(e,t,n){return function(r){var o=r.control,i=o.parents().filter("panel")[0],a=i.find("#"+t)[0],s=function(e,t){return u.grep(e,(function(e){return e.name===t}))[0]}(n,t);!function(e,t,n){u.each(n,(function(n){var r=t.items().filter("#"+n.name)[0];r&&r.visible()&&n.name!==e&&(fe(n,r,"onhide"),r.visible(!1))}))}(t,i,n),o.parent().items().each((function(e){e.active(!1)})),a&&a.visible()?(fe(s,a,"onhide"),a.hide(),o.active(!1)):(a?(a.show(),fe(s,a,"onshow")):(a=g.create({type:"container",name:t,layout:"stack",classes:"sidebar-panel",html:""}),i.prepend(a),fe(s,a,"onrender"),fe(s,a,"onshow")),o.active(!0)),b(e)}},me=function(e){return!(le.ie&&!(le.ie>=11)||!e.sidebars)&&e.sidebars.length>0},he=function(e){return{type:"panel",name:"sidebar",layout:"stack",classes:"sidebar",items:[{type:"toolbar",layout:"stack",classes:"sidebar-toolbar",items:u.map(e.sidebars,(function(t){var n=t.settings;return{type:"button",icon:n.icon,image:n.image,tooltip:n.tooltip,onclick:de(e,t.name,e.sidebars)}}))}]}},ge=function(e){var t=function(){e._skinLoaded=!0,v(e)};return function(){e.initialized?t():e.on("init",t)}},pe=h.DOM,ve=function(e){return{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",border:e,html:""}},be=function(e){return{type:"panel",layout:"stack",classes:"edit-aria-container",border:"1 0 0 0",items:[ve("0"),he(e)]}},ye=function(e,t,n){var r,o,i;if(!1===d(e)&&n.skinUiCss?pe.styleSheetLoader.load(n.skinUiCss,ge(e)):ge(e)(),r=t.panel=g.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[{type:"container",classes:"top-part",items:[!1===s(e)?null:{type:"menubar",border:"0 0 1 0",items:oe(e)},M(e,l(e))]},me(e)?be(e):ve("1 0 0 0")]}),P.setUiContainer(e,r),"none"!==m(e)&&(o={type:"resizehandle",direction:m(e),onResizeStart:function(){var t=e.getContentAreaContainer().firstChild;i={width:t.clientWidth,height:t.clientHeight}},onResize:function(t){"both"===m(e)?se(e,i.width+t.deltaX,i.height+t.deltaY):se(e,null,i.height+t.deltaY)}}),function(e){return e.getParam("statusbar",!0,"boolean")}(e)){var a=p.translate(["Powered by {0}",'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce" rel="noopener" target="_blank" role="presentation" tabindex="-1">Tiny</a>']),u=function(e){return e.getParam("branding",!0,"boolean")}(e)?{type:"label",classes:"branding",html:" "+a}:null;r.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath",editor:e},o,u]})}return y(e),e.on("SwitchMode",function(e){return function(t){e.find("*").disabled("readonly"===t.mode)}}(r)),r.renderBefore(n.targetNode).reflow(),function(e){return e.getParam("readonly",!1,"boolean")}(e)&&e.setMode("readonly"),n.width&&pe.setStyle(r.getEl(),"width",n.width),e.on("remove",(function(){r.remove(),r=null})),x(e,r),W(e),{iframeContainer:r.find("#iframe")[0].getEl(),editorContainer:r.getEl()}},we=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),xe=0,Ce={id:function(){return"mceu_"+xe++},create:function(t,n,r){var o=e.document.createElement(t);return h.DOM.setAttribs(o,n),"string"==typeof r?o.innerHTML=r:u.each(r,(function(e){e.nodeType&&o.appendChild(e)})),o},createFragment:function(e){return h.DOM.createFragment(e)},getWindowSize:function(){return h.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return h.DOM.getPos(e,t||Ce.getContainer())},getContainer:function(){return le.container?le.container:e.document.body},getViewPort:function(e){return h.DOM.getViewPort(e)},get:function(t){return e.document.getElementById(t)},addClass:function(e,t){return h.DOM.addClass(e,t)},removeClass:function(e,t){return h.DOM.removeClass(e,t)},hasClass:function(e,t){return h.DOM.hasClass(e,t)},toggleClass:function(e,t,n){return h.DOM.toggleClass(e,t,n)},css:function(e,t,n){return h.DOM.setStyle(e,t,n)},getRuntimeStyle:function(e,t){return h.DOM.getStyle(e,t,!0)},on:function(e,t,n,r){return h.DOM.bind(e,t,n,r)},off:function(e,t,n){return h.DOM.unbind(e,t,n)},fire:function(e,t,n){return h.DOM.fire(e,t,n)},innerHtml:function(e,t){h.DOM.setHTML(e,t)}},Se=function(e){return"static"===Ce.getRuntimeStyle(e,"position")},Ee=function(e){return e.state.get("fixed")};function ke(t,n,r){var o,i,a,u,s,c,l,f,d,m;return d=Ne(),a=(i=Ce.getPos(n,P.getUiContainer(t))).x,u=i.y,Ee(t)&&Se(e.document.body)&&(a-=d.x,u-=d.y),o=t.getEl(),s=(m=Ce.getSize(o)).width,c=m.height,l=(m=Ce.getSize(n)).width,f=m.height,"b"===(r=(r||"").split(""))[0]&&(u+=f),"r"===r[1]&&(a+=l),"c"===r[0]&&(u+=Math.round(f/2)),"c"===r[1]&&(a+=Math.round(l/2)),"b"===r[3]&&(u-=c),"r"===r[4]&&(a-=s),"c"===r[3]&&(u-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(s/2)),{x:a,y:u,w:s,h:c}}var Ne=function(){var t=e.window;return{x:Math.max(t.pageXOffset,e.document.body.scrollLeft,e.document.documentElement.scrollLeft),y:Math.max(t.pageYOffset,e.document.body.scrollTop,e.document.documentElement.scrollTop),w:t.innerWidth||e.document.documentElement.clientWidth,h:t.innerHeight||e.document.documentElement.clientHeight}},Te=function(e){var t=P.getUiContainer(e);return t&&!Ee(e)?function(e){return{x:0,y:0,w:e.scrollWidth-1,h:e.scrollHeight-1}}(t):Ne()},_e={testMoveRel:function(e,t){for(var n=Te(this),r=0;r<t.length;r++){var o=ke(this,e,t[r]);if(Ee(this)){if(o.x>0&&o.x+o.w<n.w&&o.y>0&&o.y+o.h<n.h)return t[r]}else if(o.x>n.x&&o.x+o.w<n.w+n.x&&o.y>n.y&&o.y+o.h<n.h+n.y)return t[r]}return t[0]},moveRel:function(e,t){"string"!=typeof t&&(t=this.testMoveRel(e,t));var n=ke(this,e,t);return this.moveTo(n.x,n.y)},moveBy:function(e,t){var n=this.layoutRect();return this.moveTo(n.x+e,n.y+t),this},moveTo:function(e,t){function n(e,t,n){return e<0?0:e+n>t&&(e=t-n)<0?0:e}if(this.settings.constrainToViewport){var r=Te(this),o=this.layoutRect();e=n(e,r.w+r.x,o.w),t=n(t,r.h+r.y,o.h)}var i=P.getUiContainer(this);return i&&Se(i)&&!Ee(this)&&(e-=i.scrollLeft,t-=i.scrollTop),i&&(e+=1,t+=1),this.state.get("rendered")?this.layoutRect({x:e,y:t}).repaint():(this.settings.x=e,this.settings.y=t),this.fire("move",{x:e,y:t}),this}},Re=tinymce.util.Tools.resolve("tinymce.util.Class"),Oe=tinymce.util.Tools.resolve("tinymce.util.EventDispatcher"),Ae=function(e){var t;if(e)return"number"==typeof e?{top:e=e||0,left:e,bottom:e,right:e}:(1===(t=(e=e.split(" ")).length)?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],10)||0,right:parseInt(e[1],10)||0,bottom:parseInt(e[2],10)||0,left:parseInt(e[3],10)||0})},De=function(e,t){function n(t){var n=parseFloat(function(t){var n=e.ownerDocument.defaultView;if(n){var r=n.getComputedStyle(e,null);return r?(t=t.replace(/[A-Z]/g,(function(e){return"-"+e})),r.getPropertyValue(t)):null}return e.currentStyle[t]}(t));return isNaN(n)?0:n}return{top:n(t+"TopWidth"),right:n(t+"RightWidth"),bottom:n(t+"BottomWidth"),left:n(t+"LeftWidth")}};function Pe(){}function Be(e){this.cls=[],this.cls._map={},this.onchange=e||Pe,this.prefix=""}u.extend(Be.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){var t=void 0;for(t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),Be.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t=0;t<this.cls.length;t++)t>0&&(e+=" "),e+=this.prefix+this.cls[t];return e};var Ie,Me,Le,Fe=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,He=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,ze=/^\s*|\s*$/g,We=Re.extend({init:function(e){var t=this.match;function n(e,n,o){var i;function a(e){e&&n.push(e)}return a(function(e){if(e)return e=e.toLowerCase(),function(t){return"*"===e||t.type===e}}((i=Fe.exec(e.replace(ze,"")))[1])),a(function(e){if(e)return function(t){return t._name===e}}(i[2])),a(function(e){if(e)return e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.classes.contains(e[n]))return!1;return!0}}(i[3])),a(function(e,t,n){if(e)return function(r){var o=r[e]?r[e]():"";return t?"="===t?o===n:"*="===t?o.indexOf(n)>=0:"~="===t?(" "+o+" ").indexOf(" "+n+" ")>=0:"!="===t?o!==n:"^="===t?0===o.indexOf(n):"$="===t&&o.substr(o.length-n.length)===n:!!n}}(i[4],i[5],i[6])),a(function(e){var n;if(e)return(e=/(?:not\((.+)\))|(.+)/i.exec(e))[1]?(n=r(e[1],[]),function(e){return!t(e,n)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2==0:"odd"===e?n%2==1:!!t[e]&&t[e]()})}(i[7])),n.pseudo=!!i[7],n.direct=o,n}function r(e,t){var o,i,a,u=[];do{if(He.exec(""),(i=He.exec(e))&&(e=i[3],u.push(i[1]),i[2])){o=i[3];break}}while(i);for(o&&r(o,t),e=[],a=0;a<u.length;a++)">"!==u[a]&&e.push(n(u[a],[],">"===u[a-1]));return t.push(e),t}this._selectors=r(e,[])},match:function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,h;for(n=0,r=(t=t||this._selectors).length;n<r;n++){for(h=e,m=0,o=(i=(a=t[n]).length)-1;o>=0;o--)for(c=a[o];h;){if(c.pseudo)for(l=f=(d=h.parent().items()).length;l--&&d[l]!==h;);for(u=0,s=c.length;u<s;u++)if(!c[u](h,l,f)){u=s+1;break}if(u===s){m++;break}if(o===i-1)break;h=h.parent()}if(m===i)return!0}return!1},find:function(e){var t,n,r=[],o=this._selectors;function i(e,t,n){var o,a,u,s,c,l=t[n];for(o=0,a=e.length;o<a;o++){for(c=e[o],u=0,s=l.length;u<s;u++)if(!l[u](c,o,a)){u=s+1;break}if(u===s)n===t.length-1?r.push(c):c.items&&i(c.items(),t,n+1);else if(l.direct)return;c.items&&i(c.items(),t,n)}}if(e.items){for(t=0,n=o.length;t<n;t++)i(e.items(),o[t],0);n>1&&(r=function(e){for(var t,n=[],r=e.length;r--;)(t=e[r]).__checked||(n.push(t),t.__checked=1);for(r=n.length;r--;)delete n[r].__checked;return n}(r))}return Ie||(Ie=We.Collection),new Ie(r)}}),je=Array.prototype.push,Ue=Array.prototype.slice;Le={length:0,init:function(e){e&&this.add(e)},add:function(e){return u.isArray(e)?je.apply(this,e):e instanceof Me?this.add(e.toArray()):je.call(this,e),this},set:function(e){var t,n=this.length;for(this.length=0,this.add(e),t=this.length;t<n;t++)delete this[t];return this},filter:function(e){var t,n,r,o,i=[];for("string"==typeof e?(e=new We(e),o=function(t){return e.match(t)}):o=e,t=0,n=this.length;t<n;t++)o(r=this[t])&&i.push(r);return new Me(i)},slice:function(){return new Me(Ue.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(e){return u.each(this,e),this},toArray:function(){return u.toArray(this)},indexOf:function(e){for(var t=this.length;t--&&this[t]!==e;);return t},reverse:function(){return new Me(u.toArray(this).reverse())},hasClass:function(e){return!!this[0]&&this[0].classes.contains(e)},prop:function(e,t){var n;return void 0!==t?(this.each((function(n){n[e]&&n[e](t)})),this):(n=this[0])&&n[e]?n[e]():void 0},exec:function(e){var t=this,n=u.toArray(arguments).slice(1);return t.each((function(t){t[e]&&t[e].apply(t,n)})),t},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(e){return this.each((function(t){t.classes.add(e)}))},removeClass:function(e){return this.each((function(t){t.classes.remove(e)}))}},u.each("fire on off show hide append prepend before after reflow".split(" "),(function(e){Le[e]=function(){var t=u.toArray(arguments);return this.each((function(n){e in n&&n[e].apply(n,t)})),this}})),u.each("text name disabled active selected checked visible parent value data".split(" "),(function(e){Le[e]=function(t){return this.prop(e,t)}})),Me=Re.extend(Le),We.Collection=Me;var Ve=Me,qe=function(e){this.create=e.create};qe.create=function(e,t){return new qe({create:function(n,r){var o,i=function(e){n.set(r,e.value)};return n.on("change:"+r,(function(n){e.set(t,n.value)})),e.on("change:"+t,i),(o=n._bindings)||(o=n._bindings=[],n.on("destroy",(function(){for(var e=o.length;e--;)o[e]()}))),o.push((function(){e.off("change:"+t,i)})),e.get(t)}})};var $e=tinymce.util.Tools.resolve("tinymce.util.Observable");function Ye(e){return e.nodeType>0}var Xe,Ke,Ge=Re.extend({Mixins:[$e],init:function(e){var t,n;for(t in e=e||{})(n=e[t])instanceof qe&&(e[t]=n.create(this,t));this.data=e},set:function(e,t){var n,r,o=this.data[e];if(t instanceof qe&&(t=t.create(this,e)),"object"==typeof e){for(n in e)this.set(n,e[n]);return this}return function e(t,n){var r,o;if(t===n)return!0;if(null===t||null===n)return t===n;if("object"!=typeof t||"object"!=typeof n)return t===n;if(u.isArray(n)){if(t.length!==n.length)return!1;for(r=t.length;r--;)if(!e(t[r],n[r]))return!1}if(Ye(t)||Ye(n))return t===n;for(r in o={},n){if(!e(t[r],n[r]))return!1;o[r]=!0}for(r in t)if(!o[r]&&!e(t[r],n[r]))return!1;return!0}(o,t)||(this.data[e]=t,r={target:this,name:e,value:t,oldValue:o},this.fire("change:"+e,r),this.fire("change",r)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(e){return qe.create(this,e)},destroy:function(){this.fire("destroy")}}),Je={},Qe={add:function(t){var n=t.parent();if(n){if(!n._layout||n._layout.isNative())return;Je[n._id]||(Je[n._id]=n),Xe||(Xe=!0,S.requestAnimationFrame((function(){var e,t;for(e in Xe=!1,Je)(t=Je[e]).state.get("rendered")&&t.reflow();Je={}}),e.document.body))}},remove:function(e){Je[e._id]&&delete Je[e._id]}},Ze="onmousewheel"in e.document,et=0,tt={Statics:{classPrefix:"mce-"},isRtl:function(){return Ke.rtl},classPrefix:"mce-",init:function(e){var t,n,r=this;function o(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)r.classes.add(e[t])}r.settings=e=u.extend({},r.Defaults,e),r._id=e.id||"mceu_"+et++,r._aria={role:e.role},r._elmCache={},r.$=we,r.state=new Ge({visible:!0,active:!1,disabled:!1,value:""}),r.data=new Ge(e.data),r.classes=new Be((function(){r.state.get("rendered")&&(r.getEl().className=this.toString())})),r.classes.prefix=r.classPrefix,(t=e.classes)&&(r.Defaults&&(n=r.Defaults.classes)&&t!==n&&o(n),o(t)),u.each("title text name visible disabled active value".split(" "),(function(t){t in e&&r[t](e[t])})),r.on("click",(function(){if(r.disabled())return!1})),r.settings=e,r.borderBox=Ae(e.border),r.paddingBox=Ae(e.padding),r.marginBox=Ae(e.margin),e.hidden&&r.hide()},Properties:"parent,name",getContainerElm:function(){var e=P.getUiContainer(this);return e||Ce.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e,t,n,r,o,i,a,u,s,c,l=this.settings,f=this.getEl();e=this.borderBox=this.borderBox||De(f,"border"),this.paddingBox=this.paddingBox||De(f,"padding"),this.marginBox=this.marginBox||De(f,"margin"),c=Ce.getSize(f),u=l.minWidth,s=l.minHeight,o=u||c.width,i=s||c.height,n=l.width,r=l.height,a=void 0!==(a=l.autoResize)?a:!n&&!r,n=n||o,r=r||i;var d=e.left+e.right,m=e.top+e.bottom,h=l.maxWidth||65535,g=l.maxHeight||65535;return this._layoutRect=t={x:l.x||0,y:l.y||0,w:n,h:r,deltaW:d,deltaH:m,contentW:n-d,contentH:r-m,innerW:n-d,innerH:r-m,startMinWidth:u||0,startMinHeight:s||0,minW:Math.min(o,h),minH:Math.min(i,g),maxW:h,maxH:g,autoResize:a,scrollW:0},this._lastLayoutRect={},t},layoutRect:function(e){var t,n,r,o,i,a=this._layoutRect;return a||(a=this.initLayoutRect()),e?(r=a.deltaW,o=a.deltaH,void 0!==e.x&&(a.x=e.x),void 0!==e.y&&(a.y=e.y),void 0!==e.minW&&(a.minW=e.minW),void 0!==e.minH&&(a.minH=e.minH),void 0!==(n=e.w)&&(n=(n=n<a.minW?a.minW:n)>a.maxW?a.maxW:n,a.w=n,a.innerW=n-r),void 0!==(n=e.h)&&(n=(n=n<a.minH?a.minH:n)>a.maxH?a.maxH:n,a.h=n,a.innerH=n-o),void 0!==(n=e.innerW)&&(n=(n=n<a.minW-r?a.minW-r:n)>a.maxW-r?a.maxW-r:n,a.innerW=n,a.w=n+r),void 0!==(n=e.innerH)&&(n=(n=n<a.minH-o?a.minH-o:n)>a.maxH-o?a.maxH-o:n,a.innerH=n,a.h=n+o),void 0!==e.contentW&&(a.contentW=e.contentW),void 0!==e.contentH&&(a.contentH=e.contentH),(t=this._lastLayoutRect).x===a.x&&t.y===a.y&&t.w===a.w&&t.h===a.h||((i=Ke.repaintControls)&&i.map&&!i.map[this._id]&&(i.push(this),i.map[this._id]=!0),t.x=a.x,t.y=a.y,t.w=a.w,t.h=a.h),this):a},repaint:function(){var t,n,r,o,i,a,u,s,c,l;c=e.document.createRange?function(e){return e}:Math.round,t=this.getEl().style,o=this._layoutRect,s=this._lastRepaintRect||{},a=(i=this.borderBox).left+i.right,u=i.top+i.bottom,o.x!==s.x&&(t.left=c(o.x)+"px",s.x=o.x),o.y!==s.y&&(t.top=c(o.y)+"px",s.y=o.y),o.w!==s.w&&(l=c(o.w-a),t.width=(l>=0?l:0)+"px",s.w=o.w),o.h!==s.h&&(l=c(o.h-u),t.height=(l>=0?l:0)+"px",s.h=o.h),this._hasBody&&o.innerW!==s.innerW&&(l=c(o.innerW),(r=this.getEl("body"))&&((n=r.style).width=(l>=0?l:0)+"px"),s.innerW=o.innerW),this._hasBody&&o.innerH!==s.innerH&&(l=c(o.innerH),(r=r||this.getEl("body"))&&((n=n||r.style).height=(l>=0?l:0)+"px"),s.innerH=o.innerH),this._lastRepaintRect=s,this.fire("repaint",{},!1)},updateLayoutRect:function(){this.parent()._lastRect=null,Ce.css(this.getEl(),{width:"",height:""}),this._layoutRect=this._lastRepaintRect=this._lastLayoutRect=null,this.initLayoutRect()},on:function(e,t){var n=this;return nt(n).on(e,function(e){var t,r;return"string"!=typeof e?e:function(o){return t||n.parentsAndSelf().each((function(n){var o=n.settings.callbacks;if(o&&(t=o[e]))return r=n,!1})),t?t.call(r,o):(o.action=e,void this.fire("execute",o))}}(t)),n},off:function(e,t){return nt(this).off(e,t),this},fire:function(e,t,n){if((t=t||{}).control||(t.control=this),t=nt(this).fire(e,t),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},hasEventListeners:function(e){return nt(this).has(e)},parents:function(e){var t,n=new Ve;for(t=this.parent();t;t=t.parent())n.add(t);return e&&(n=n.filter(e)),n},parentsAndSelf:function(e){return new Ve(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=we("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this.getEl(this.ariaTarget);return void 0===t?this._aria[e]:(this._aria[e]=t,this.state.get("rendered")&&n.setAttribute("role"===e?e:"aria-"+e,t),this)},encode:function(e,t){return!1!==t&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,(function(e){return"&#"+e.charCodeAt(0)+";"}))},translate:function(e){return Ke.translate?Ke.translate(e):e},before:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this),!0),this},after:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this)),this},remove:function(){var e,t,n=this,r=n.getEl(),o=n.parent();if(n.items){var i=n.items().toArray();for(t=i.length;t--;)i[t].remove()}o&&o.items&&(e=[],o.items().each((function(t){t!==n&&e.push(t)})),o.items().set(e),o._lastRect=null),n._eventsRoot&&n._eventsRoot===n&&we(r).off();var a=n.getRoot().controlIdLookup;return a&&delete a[n._id],r&&r.parentNode&&r.parentNode.removeChild(r),n.state.set("rendered",!1),n.state.destroy(),n.fire("remove"),n},renderBefore:function(e){return we(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return we(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e,t,n,r,o,i=this,a=i.settings;for(r in i.$el=we(i.getEl()),i.state.set("rendered",!0),a)0===r.indexOf("on")&&i.on(r.substr(2),a[r]);if(i._eventsRoot){for(n=i.parent();!o&&n;n=n.parent())o=n._eventsRoot;if(o)for(r in o._nativeEvents)i._nativeEvents[r]=!0}rt(i),a.style&&(e=i.getEl())&&(e.setAttribute("style",a.style),e.style.cssText=a.style),i.settings.border&&(t=i.borderBox,i.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left}));var u=i.getRoot();for(var s in u.controlIdLookup||(u.controlIdLookup={}),u.controlIdLookup[i._id]=i,i._aria)i.aria(s,i._aria[s]);!1===i.state.get("visible")&&(i.getEl().style.display="none"),i.bindStates(),i.state.on("change:visible",(function(e){var t,n=e.value;i.state.get("rendered")&&(i.getEl().style.display=!1===n?"none":"",i.getEl().getBoundingClientRect()),(t=i.parent())&&(t._lastRect=null),i.fire(n?"show":"hide"),Qe.add(i)})),i.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){var t,n,r,o,i,a,u=this.getEl(),s=u.parentNode,c=function(e,t){var n,r,o=e;for(n=r=0;o&&o!==t&&o.nodeType;)n+=o.offsetLeft||0,r+=o.offsetTop||0,o=o.offsetParent;return{x:n,y:r}}(u,s);return t=c.x,n=c.y,r=u.offsetWidth,o=u.offsetHeight,i=s.clientWidth,a=s.clientHeight,"end"===e?(t-=i-r,n-=a-o):"center"===e&&(t-=i/2-r/2,n-=a/2-o/2),s.scrollLeft=t,s.scrollTop=n,this},getRoot:function(){for(var e,t=this,n=[];t;){if(t.rootControl){e=t.rootControl;break}n.push(t),e=t,t=t.parent()}e||(e=this);for(var r=n.length;r--;)n[r].rootControl=e;return e},reflow:function(){Qe.remove(this);var e=this.parent();return e&&e._layout&&!e._layout.isNative()&&e.reflow(),this}};function nt(e){return e._eventDispatcher||(e._eventDispatcher=new Oe({scope:e,toggleEvent:function(t,n){n&&Oe.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e.state.get("rendered")&&rt(e))}})),e._eventDispatcher}function rt(e){var t,n,r,o,i,a;function u(t){var n=e.getParentCtrl(t.target);n&&n.fire(t.type,t)}function s(){var e=o._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each((function(e){e.fire("mouseleave",{target:e.getEl()})})),o._lastHoverCtrl=null)}function c(t){var n,r,i,a=e.getParentCtrl(t.target),u=o._lastHoverCtrl,s=0;if(a!==u){if(o._lastHoverCtrl=a,(r=a.parents().toArray().reverse()).push(a),u){for((i=u.parents().toArray().reverse()).push(u),s=0;s<i.length&&r[s]===i[s];s++);for(n=i.length-1;n>=s;n--)(u=i[n]).fire("mouseleave",{target:u.getEl()})}for(n=s;n<r.length;n++)(a=r[n]).fire("mouseenter",{target:a.getEl()})}}function l(t){t.preventDefault(),"mousewheel"===t.type?(t.deltaY=-.025*t.wheelDelta,t.wheelDeltaX&&(t.deltaX=-.025*t.wheelDeltaX)):(t.deltaX=0,t.deltaY=t.detail),t=e.fire("wheel",t)}if(i=e._nativeEvents){for((r=e.parents().toArray()).unshift(e),t=0,n=r.length;!o&&t<n;t++)o=r[t]._eventsRoot;for(o||(o=r[r.length-1]||e),e._eventsRoot=o,n=t,t=0;t<n;t++)r[t]._eventsRoot=o;var f=o._delegates;for(a in f||(f=o._delegates={}),i){if(!i)return!1;"wheel"!==a?("mouseenter"===a||"mouseleave"===a?o._hasMouseEnter||(we(o.getEl()).on("mouseleave",s).on("mouseover",c),o._hasMouseEnter=1):f[a]||(we(o.getEl()).on(a,u),f[a]=!0),i[a]=!1):Ze?we(e.getEl()).on("mousewheel",l):we(e.getEl()).on("DOMMouseScroll",l)}}}u.each("text title visible disabled active value".split(" "),(function(e){tt[e]=function(t){return 0===arguments.length?this.state.get(e):(void 0!==t&&this.state.set(e,t),this)}}));var ot=Ke=Re.extend(tt),it=function(e){return!!e.getAttribute("data-mce-tabstop")};function at(t){var n,r,o=t.root;function i(e){return e&&1===e.nodeType}try{n=e.document.activeElement}catch(t){n=e.document.body}function a(e){return i(e=e||n)?e.getAttribute("role"):null}function u(e){for(var t,r=e||n;r=r.parentNode;)if(t=a(r))return t}function s(e){var t=n;if(i(t))return t.getAttribute("aria-"+e)}function c(e){var t=e.tagName.toUpperCase();return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}function l(e){var t=[];return function e(n){if(1===n.nodeType&&"none"!==n.style.display&&!n.disabled){(function(e){return!(!c(e)||e.hidden)||!!it(e)||!!/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(a(e))})(n)&&t.push(n);for(var r=0;r<n.childNodes.length;r++)e(n.childNodes[r])}}(e||o.getEl()),t}function f(e){var t,n;(n=(e=e||r).parents().toArray()).unshift(e);for(var o=0;o<n.length&&!(t=n[o]).settings.ariaRoot;o++);return t}function d(e,t){return e<0?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function m(e,t){var r=-1,o=f();t=t||l(o.getEl());for(var i=0;i<t.length;i++)t[i]===n&&(r=i);r+=e,o.lastAriaIndex=d(r,t)}function h(){"tablist"===u()?m(-1,l(n.parentNode)):r.parent().submenu?b():m(-1)}function g(){var e=a(),t=u();"tablist"===t?m(1,l(n.parentNode)):"menuitem"===e&&"menu"===t&&s("haspopup")?y():m(1)}function p(){m(-1)}function v(){var e=a(),t=u();"menuitem"===e&&"menubar"===t?y():"button"===e&&s("haspopup")?y({key:"down"}):m(1)}function b(){r.fire("cancel")}function y(e){e=e||{},r.fire("click",{target:n,aria:e})}return r=o.getParentCtrl(n),o.on("keydown",(function(e){function t(e,t){c(n)||it(n)||"slider"!==a(n)&&!1!==t(e)&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,h);break;case 39:t(e,g);break;case 38:t(e,p);break;case 40:t(e,v);break;case 27:b();break;case 14:case 13:case 32:t(e,y);break;case 9:!function(e){if("tablist"===u()){var t=l(r.getEl("body"))[0];t&&t.focus()}else m(e.shiftKey?-1:1)}(e),e.preventDefault()}})),o.on("focusin",(function(e){n=e.target,r=e.control})),{focusFirst:function(e){var t=f(e),n=l(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?d(t.lastAriaIndex,n):d(0,n)}}}var ut={},st=ot.extend({init:function(e){var t=this;t._super(e),(e=t.settings).fixed&&t.state.set("fixed",!0),t._items=new Ve,t.isRtl()&&t.classes.add("rtl"),t.bodyClasses=new Be((function(){t.state.get("rendered")&&(t.getEl("body").className=this.toString())})),t.bodyClasses.prefix=t.classPrefix,t.classes.add("container"),t.bodyClasses.add("container-body"),e.containerCls&&t.classes.add(e.containerCls),t._layout=g.create((e.layout||"")+"layout"),t.settings.items?t.add(t.settings.items):t.add(t.render()),t._hasBody=!0},items:function(){return this._items},find:function(e){return(e=ut[e]=ut[e]||new We(e)).find(this)},add:function(e){return this.items().add(this.create(e)).parent(this),this},focus:function(e){var t,n,r;if(!e||!(n=this.keyboardNav||this.parents().eq(-1)[0].keyboardNav))return r=this.find("*"),this.statusbar&&r.add(this.statusbar.items()),r.each((function(e){if(e.settings.autofocus)return t=null,!1;e.canFocus&&(t=t||e)})),t&&t.focus(),this;n.focusFirst(this)},replace:function(e,t){for(var n,r=this.items(),o=r.length;o--;)if(r[o]===e){r[o]=t;break}o>=0&&((n=t.getEl())&&n.parentNode.removeChild(n),(n=e.getEl())&&n.parentNode.removeChild(n)),t.parent(this)},create:function(e){var t,n=this,r=[];return u.isArray(e)||(e=[e]),u.each(e,(function(e){e&&(e instanceof ot||("string"==typeof e&&(e={type:e}),t=u.extend({},n.settings.defaults,e),e.type=t.type=t.type||e.type||n.settings.defaultType||(t.defaults?t.defaults.type:null),e=g.create(t)),r.push(e))})),r},renderNew:function(){var e=this;return e.items().each((function(t,n){var r;t.parent(e),t.state.get("rendered")||((r=e.getEl("body")).hasChildNodes()&&n<=r.childNodes.length-1?we(r.childNodes[n]).before(t.renderHtml()):we(r).append(t.renderHtml()),t.postRender(),Qe.add(t))})),e._layout.applyClasses(e.items().filter(":visible")),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){return this.items().set(this.create(e).concat(this.items().toArray())),this.renderNew()},insert:function(e,t,n){var r,o,i;return e=this.create(e),r=this.items(),!n&&t<r.length-1&&(t+=1),t>=0&&t<r.length&&(o=r.slice(0,t).toArray(),i=r.slice(t).toArray(),r.set(o.concat(e,i))),this.renderNew()},fromJSON:function(e){for(var t in e)this.find("#"+t).value(e[t]);return this},toJSON:function(){var e={};return this.find("*").each((function(t){var n=t.name(),r=t.value();n&&void 0!==r&&(e[n]=r)})),e},renderHtml:function(){var e=this._layout,t=this.settings.role;return this.preRender(),e.preRender(this),'<div id="'+this._id+'" class="'+this.classes+'"'+(t?' role="'+this.settings.role+'"':"")+'><div id="'+this._id+'-body" class="'+this.bodyClasses+'">'+(this.settings.html||"")+e.renderHtml(this)+"</div></div>"},postRender:function(){var e;return this.items().exec("postRender"),this._super(),this._layout.postRender(this),this.state.set("rendered",!0),this.settings.style&&this.$el.css(this.settings.style),this.settings.border&&(e=this.borderBox,this.$el.css({"border-top-width":e.top,"border-right-width":e.right,"border-bottom-width":e.bottom,"border-left-width":e.left})),this.parent()||(this.keyboardNav=at({root:this})),this},initLayoutRect:function(){var e=this._super();return this._layout.recalc(this),e},recalc:function(){var e=this._layoutRect,t=this._lastRect;if(!t||t.w!==e.w||t.h!==e.h)return this._layout.recalc(this),e=this.layoutRect(),this._lastRect={x:e.x,y:e.y,w:e.w,h:e.h},!0},reflow:function(){var e;if(Qe.remove(this),this.visible()){for(ot.repaintControls=[],ot.repaintControls.map={},this.recalc(),e=ot.repaintControls.length;e--;)ot.repaintControls[e].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),ot.repaintControls=[]}return this}});function ct(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}function lt(t,n){var r,o,i,a,u,s,c,l=n.document||e.document;n=n||{};var f=l.getElementById(n.handle||t);i=function(t){var i,d,m=function(e){var t,n,r,o,i,a,u,s=Math.max;return t=e.documentElement,n=e.body,r=s(t.scrollWidth,n.scrollWidth),o=s(t.clientWidth,n.clientWidth),i=s(t.offsetWidth,n.offsetWidth),a=s(t.scrollHeight,n.scrollHeight),u=s(t.clientHeight,n.clientHeight),{width:r<i?o:r,height:a<s(t.offsetHeight,n.offsetHeight)?u:a}}(l);ct(t),t.preventDefault(),o=t.button,i=f,s=t.screenX,c=t.screenY,d=e.window.getComputedStyle?e.window.getComputedStyle(i,null).getPropertyValue("cursor"):i.runtimeStyle.cursor,r=we("<div></div>").css({position:"absolute",top:0,left:0,width:m.width,height:m.height,zIndex:2147483647,opacity:1e-4,cursor:d}).appendTo(l.body),we(l).on("mousemove touchmove",u).on("mouseup touchend",a),n.start(t)},u=function(e){if(ct(e),e.button!==o)return a(e);e.deltaX=e.screenX-s,e.deltaY=e.screenY-c,e.preventDefault(),n.drag(e)},a=function(e){ct(e),we(l).off("mousemove touchmove",u).off("mouseup touchend",a),r.remove(),n.stop&&n.stop(e)},this.destroy=function(){we(f).off()},we(f).on("mousedown touchstart",i)}var ft,dt,mt,ht,gt={init:function(){this.on("repaint",this.renderScroll)},renderScroll:function(){var e=this;function t(){var t,n,r;function o(r,o,i,a,u,s){var c,l,f,d,m,h,g,p;if(l=e.getEl("scroll"+r)){if(g=o.toLowerCase(),p=i.toLowerCase(),we(e.getEl("absend")).css(g,e.layoutRect()[a]-1),!u)return void we(l).css("display","none");we(l).css("display","block"),c=e.getEl("body"),f=e.getEl("scroll"+r+"t"),d=c["client"+i]-4,m=(d-=t&&n?l["client"+s]:0)/c["scroll"+i],(h={})[g]=c["offset"+o]+2,h[p]=d,we(l).css(h),(h={})[g]=c["scroll"+o]*m,h[p]=d*m,we(f).css(h)}}r=e.getEl("body"),t=r.scrollWidth>r.clientWidth,n=r.scrollHeight>r.clientHeight,o("h","Left","Width","contentW",t,"Height"),o("v","Top","Height","contentH",n,"Width")}e.settings.autoScroll&&(e._hasScroll||(e._hasScroll=!0,function(){function t(t,n,r,o,i){var a,u=e._id+"-scroll"+t,s=e.classPrefix;we(e.getEl()).append('<div id="'+u+'" class="'+s+"scrollbar "+s+"scrollbar-"+t+'"><div id="'+u+'t" class="'+s+'scrollbar-thumb"></div></div>'),e.draghelper=new lt(u+"t",{start:function(){a=e.getEl("body")["scroll"+n],we("#"+u).addClass(s+"active")},drag:function(u){var s,c,l,f,d=e.layoutRect();c=d.contentW>d.innerW,l=d.contentH>d.innerH,f=e.getEl("body")["client"+r]-4,s=(f-=c&&l?e.getEl("scroll"+t)["client"+i]:0)/e.getEl("body")["scroll"+r],e.getEl("body")["scroll"+n]=a+u["delta"+o]/s},stop:function(){we("#"+u).removeClass(s+"active")}})}e.classes.add("scroll"),t("v","Top","Height","Y","Width"),t("h","Left","Width","X","Height")}(),e.on("wheel",(function(n){var r=e.getEl("body");r.scrollLeft+=10*(n.deltaX||0),r.scrollTop+=10*n.deltaY,t()})),we(e.getEl("body")).on("scroll",t)),t())}},pt=st.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[gt],renderHtml:function(){var e=this._layout,t=this.settings.html;return this.preRender(),e.preRender(this),void 0===t?t='<div id="'+this._id+'-body" class="'+this.bodyClasses+'">'+e.renderHtml(this)+"</div>":("function"==typeof t&&(t=t.call(this)),this._hasBody=!1),'<div id="'+this._id+'" class="'+this.classes+'" hidefocus="1" tabindex="-1" role="group">'+(this._preBodyHtml||"")+t+"</div>"}}),vt={resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(e,t){if(e<=1||t<=1){var n=Ce.getWindowSize();e=e<=1?e*n.w:e,t=t<=1?t*n.h:t}return this._layoutRect.autoResize=!1,this.layoutRect({minW:e,minH:t,w:e,h:t}).reflow()},resizeBy:function(e,t){var n=this.layoutRect();return this.resizeTo(n.w+e,n.h+t)}},bt=[],yt=[];function wt(e,t){for(;e;){if(e===t)return!0;e=e.parent()}}function xt(){ft||(ft=function(e){2!==e.button&&function(e){for(var t=bt.length;t--;){var n=bt[t],r=n.getParentCtrl(e.target);if(n.settings.autohide){if(r&&(wt(r,n)||n.parent()===r))continue;(e=n.fire("autohide",{target:e.target})).isDefaultPrevented()||n.hide()}}}(e)},we(e.document).on("click touchstart",ft))}function Ct(e){var t=Ce.getViewPort().y;function n(t,n){for(var r,o=0;o<bt.length;o++)if(bt[o]!==e)for(r=bt[o].parent();r&&(r=r.parent());)r===e&&bt[o].fixed(t).moveBy(0,n).repaint()}e.settings.autofix&&(e.state.get("fixed")?e._autoFixY>t&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),n(!1,e._autoFixY-t)):(e._autoFixY=e.layoutRect().y,e._autoFixY<t&&(e.fixed(!0).layoutRect({y:0}).repaint(),n(!0,t-e._autoFixY))))}function St(e,t){var n,r,o=Et.zIndex||65535;if(e)yt.push(t);else for(n=yt.length;n--;)yt[n]===t&&yt.splice(n,1);if(yt.length)for(n=0;n<yt.length;n++)yt[n].modal&&(o++,r=yt[n]),yt[n].getEl().style.zIndex=o,yt[n].zIndex=o,o++;var i=we("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];r?we(i).css("z-index",r.zIndex-1):i&&(i.parentNode.removeChild(i),ht=!1),Et.currentZIndex=o}var Et=pt.extend({Mixins:[_e,vt],init:function(t){var n=this;n._super(t),n._eventsRoot=n,n.classes.add("floatpanel"),t.autohide&&(xt(),function(){if(!mt){var t=e.document.documentElement,n=t.clientWidth,r=t.clientHeight;mt=function(){e.document.all&&n===t.clientWidth&&r===t.clientHeight||(n=t.clientWidth,r=t.clientHeight,Et.hideAll())},we(e.window).on("resize",mt)}}(),bt.push(n)),t.autofix&&(dt||(dt=function(){var e;for(e=bt.length;e--;)Ct(bt[e])},we(e.window).on("scroll",dt)),n.on("move",(function(){Ct(this)}))),n.on("postrender show",(function(e){if(e.control===n){var t,r=n.classPrefix;n.modal&&!ht&&((t=we("#"+r+"modal-block",n.getContainerElm()))[0]||(t=we('<div id="'+r+'modal-block" class="'+r+"reset "+r+'fade"></div>').appendTo(n.getContainerElm())),S.setTimeout((function(){t.addClass(r+"in"),we(n.getEl()).addClass(r+"in")})),ht=!0),St(!0,n)}})),n.on("show",(function(){n.parents().each((function(e){if(e.state.get("fixed"))return n.fixed(!0),!1}))})),t.popover&&(n._preBodyHtml='<div class="'+n.classPrefix+'arrow"></div>',n.classes.add("popover").add("bottom").add(n.isRtl()?"end":"start")),n.aria("label",t.ariaLabel),n.aria("labelledby",n._id),n.aria("describedby",n.describedBy||n._id+"-none")},fixed:function(e){if(this.state.get("fixed")!==e){if(this.state.get("rendered")){var t=Ce.getViewPort();e?this.layoutRect().y-=t.y:this.layoutRect().y+=t.y}this.classes.toggle("fixed",e),this.state.set("fixed",e)}return this},show:function(){var e,t=this._super();for(e=bt.length;e--&&bt[e]!==this;);return-1===e&&bt.push(this),t},hide:function(){return kt(this),St(!1,this),this._super()},hideAll:function(){Et.hideAll()},close:function(){return this.fire("close").isDefaultPrevented()||(this.remove(),St(!1,this)),this},remove:function(){kt(this),this._super()},postRender:function(){return this.settings.bodyRole&&this.getEl("body").setAttribute("role",this.settings.bodyRole),this._super()}});function kt(e){var t;for(t=bt.length;t--;)bt[t]===e&&bt.splice(t,1);for(t=yt.length;t--;)yt[t]===e&&yt.splice(t,1)}Et.hideAll=function(){for(var e=bt.length;e--;){var t=bt[e];t&&t.settings.autohide&&(t.hide(),bt.splice(e,1))}};var Nt=function(e,t){return!(!e||t.settings.ui_container)},Tt=function(e,t,n){var r,o,i=h.DOM,a=function(e){return e.getParam("fixed_toolbar_container")}(e);a&&(o=i.select(a)[0]);var u=function(){if(r&&r.moveRel&&r.visible()&&!r._fixed){var t=e.selection.getScrollContainer(),n=e.getBody(),o=0,a=0;if(t){var u=i.getPos(n),s=i.getPos(t);o=Math.max(0,s.x-u.x),a=Math.max(0,s.y-u.y)}r.fixed(!1).moveRel(n,e.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(o,a)}},c=function(){r&&(r.show(),u(),i.addClass(e.getBody(),"mce-edit-focus"))},f=function(){r&&(r.hide(),Et.hideAll(),i.removeClass(e.getBody(),"mce-edit-focus"))},m=function(){r?r.visible()||c():(r=t.panel=g.create({type:o?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:Nt(o,e),border:1,items:[!1===s(e)?null:{type:"menubar",border:"0 0 1 0",items:oe(e)},M(e,l(e))]}),P.setUiContainer(e,r),y(e),o?r.renderTo(o).reflow():r.renderTo().reflow(),x(e,r),c(),W(e),e.on("nodeChange",u),e.on("ResizeWindow",u),e.on("activate",c),e.on("deactivate",f),e.nodeChanged())};return e.settings.content_editable=!0,e.on("focus",(function(){!1===d(e)&&n.skinUiCss?i.styleSheetLoader.load(n.skinUiCss,m,m):m()})),e.on("blur hide",f),e.on("remove",(function(){r&&(r.remove(),r=null)})),!1===d(e)&&n.skinUiCss?i.styleSheetLoader.load(n.skinUiCss,ge(e)):ge(e)(),{}};function _t(e,t){var n,r,o=this,i=ot.classPrefix;o.show=function(a,u){function s(){n&&(we(e).append('<div class="'+i+"throbber"+(t?" "+i+"throbber-inline":"")+'"></div>'),u&&u())}return o.hide(),n=!0,a?r=S.setTimeout(s,a):s(),o},o.hide=function(){var t=e.lastChild;return S.clearTimeout(r),t&&-1!==t.className.indexOf("throbber")&&t.parentNode.removeChild(t),n=!1,o}}var Rt=function(e,t){var n;e.on("ProgressState",(function(e){n=n||new _t(t.panel.getEl("body")),e.state?n.show(e.time):n.hide()}))},Ot=function(e,t,n){var r=function(e){var t=e.settings,n=t.skin,r=t.skin_url;if(!1!==n){var o=n||"lightgray";r=r?e.documentBaseURI.toAbsolute(r):a.baseURL+"/skins/"+o}return r}(e);return r&&(n.skinUiCss=r+"/skin.min.css",e.contentCSS.push(r+"/content"+(e.inline?".inline":"")+".min.css")),Rt(e,t),function(e){return e.getParam("inline",!1,"boolean")}(e)?Tt(e,t,n):ye(e,t,n)},At=ot.extend({Mixins:[_e],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this.classPrefix;return'<div id="'+this._id+'" class="'+this.classes+'" role="presentation"><div class="'+e+'tooltip-arrow"></div><div class="'+e+'tooltip-inner">'+this.encode(this.state.get("text"))+"</div></div>"},bindStates:function(){var e=this;return e.state.on("change:text",(function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)})),e._super()},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=131070}}),Dt=ot.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&!1!==Dt.tooltips&&(t.on("mouseenter",(function(n){var r=t.tooltip().moveTo(-65535);if(n.control===t){var o=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.classes.toggle("tooltip-n","bc-tc"===o),r.classes.toggle("tooltip-nw","bc-tl"===o),r.classes.toggle("tooltip-ne","bc-tr"===o),r.moveRel(t.getEl(),o)}else r.hide()})),t.on("mouseleave mousedown click",(function(){t.tooltip().remove(),t._tooltip=null}))),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return this._tooltip||(this._tooltip=new At({type:"tooltip"}),P.inheritUiContainer(this,this._tooltip),this._tooltip.renderTo()),this._tooltip},postRender:function(){var e=this.settings;this._super(),this.parent()||!e.width&&!e.height||(this.initLayoutRect(),this.repaint()),e.autofocus&&this.focus()},bindStates:function(){var e=this;function t(t){e.aria("disabled",t),e.classes.toggle("disabled",t)}function n(t){e.aria("pressed",t),e.classes.toggle("active",t)}return e.state.on("change:disabled",(function(e){t(e.value)})),e.state.on("change:active",(function(e){n(e.value)})),e.state.get("disabled")&&t(!0),e.state.get("active")&&n(!0),e._super()},remove:function(){this._super(),this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}}),Pt=Dt.extend({Defaults:{value:0},init:function(e){this._super(e),this.classes.add("progress"),this.settings.filter||(this.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div class="'+t+'bar-container"><div class="'+t+'bar"></div></div><div class="'+t+'text">0%</div></div>'},postRender:function(){return this._super(),this.value(this.settings.value),this},bindStates:function(){var e=this;function t(t){t=e.settings.filter(t),e.getEl().lastChild.innerHTML=t+"%",e.getEl().firstChild.firstChild.style.width=t+"%"}return e.state.on("change:value",(function(e){t(e.value)})),t(e.state.get("value")),e._super()}}),Bt=function(e,t){e.getEl().lastChild.textContent=t+(e.progressBar?" "+e.progressBar.value()+"%":"")},It=ot.extend({Mixins:[_e],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),t.maxWidth=e.maxWidth,e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||e.timeout>0)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new Pt),t.on("click",(function(e){-1!==e.target.className.indexOf(t.classPrefix+"close")&&t.close()}))},renderHtml:function(){var e,t=this.classPrefix,n="",r="",o="";return this.icon&&(n='<i class="'+t+"ico "+t+"i-"+this.icon+'"></i>'),e=' style="max-width: '+this.maxWidth+"px;"+(this.color?"background-color: "+this.color+';"':'"'),this.closeButton&&(r='<button type="button" class="'+t+'close" aria-hidden="true">×</button>'),this.progressBar&&(o=this.progressBar.renderHtml()),'<div id="'+this._id+'" class="'+this.classes+'"'+e+' role="presentation">'+n+'<div class="'+t+'notification-inner">'+this.state.get("text")+"</div>"+o+r+'<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;" aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div></div>'},postRender:function(){var e=this;return S.setTimeout((function(){e.$el.addClass(e.classPrefix+"in"),Bt(e,e.state.get("text"))}),100),e._super()},bindStates:function(){var e=this;return e.state.on("change:text",(function(t){e.getEl().firstChild.innerHTML=t.value,Bt(e,t.value)})),e.progressBar&&(e.progressBar.bindStates(),e.progressBar.state.on("change:value",(function(t){Bt(e,e.state.get("text"))}))),e._super()},close:function(){return this.fire("close").isDefaultPrevented()||this.remove(),this},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=65534}});function Mt(e){var t=function(e){return e.inline?e.getElement():e.getContentAreaContainer()};return{open:function(n,r){var o,i=u.extend(n,{maxWidth:(o=t(e),Ce.getSize(o).width)}),a=new It(i);return a.args=i,i.timeout>0&&(a.timer=setTimeout((function(){a.close(),r()}),i.timeout)),a.on("close",(function(){r()})),a.renderTo(),a},close:function(e){e.close()},reposition:function(n){!function(e){J(e,(function(e){e.moveTo(0,0)}))}(n),function(n){if(n.length>0){var r=n.slice(0,1)[0],o=t(e);r.moveRel(o,"tc-tc"),J(n,(function(e,t){t>0&&e.moveRel(n[t-1].getEl(),"bc-tc")}))}}(n)},getArgs:function(e){return e.args}}}var Lt=[],Ft="";function Ht(t){var n,r=we("meta[name=viewport]")[0];!1!==le.overrideViewPort&&(r||((r=e.document.createElement("meta")).setAttribute("name","viewport"),e.document.getElementsByTagName("head")[0].appendChild(r)),(n=r.getAttribute("content"))&&void 0!==Ft&&(Ft=n),r.setAttribute("content",t?"width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0":Ft))}function zt(t,n){(function(){for(var e=0;e<Lt.length;e++)if(Lt[e]._fullscreen)return!0;return!1})()&&!1===n&&we([e.document.documentElement,e.document.body]).removeClass(t+"fullscreen")}var Wt=Et.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var t=this;t._super(e),t.isRtl()&&t.classes.add("rtl"),t.classes.add("window"),t.bodyClasses.add("window-body"),t.state.set("fixed",!0),e.buttons&&(t.statusbar=new pt({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:t.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),t.statusbar.classes.add("foot"),t.statusbar.parent(t)),t.on("click",(function(e){var n=t.classPrefix+"close";(Ce.hasClass(e.target,n)||Ce.hasClass(e.target.parentNode,n))&&t.close()})),t.on("cancel",(function(){t.close()})),t.on("move",(function(e){e.control===t&&Et.hideAll()})),t.aria("describedby",t.describedBy||t._id+"-none"),t.aria("label",e.title),t._fullscreen=!1},recalc:function(){var e,t,n,r,o=this.statusbar;this._fullscreen&&(this.layoutRect(Ce.getWindowSize()),this.layoutRect().contentH=this.layoutRect().innerH),this._super(),e=this.layoutRect(),this.settings.title&&!this._fullscreen&&(t=e.headerW)>e.w&&(n=e.x-Math.max(0,t/2),this.layoutRect({w:t,x:n}),r=!0),o&&(o.layoutRect({w:this.layoutRect().innerW}).recalc(),(t=o.layoutRect().minW+e.deltaW)>e.w&&(n=e.x-Math.max(0,t-e.w),this.layoutRect({w:t,x:n}),r=!0)),r&&this.recalc()},initLayoutRect:function(){var e,t=this._super(),n=0;if(this.settings.title&&!this._fullscreen){e=this.getEl("head");var r=Ce.getSize(e);t.headerW=r.width,t.headerH=r.height,n+=t.headerH}this.statusbar&&(n+=this.statusbar.layoutRect().h),t.deltaH+=n,t.minH+=n,t.h+=n;var o=Ce.getWindowSize();return t.x=this.settings.x||Math.max(0,o.w/2-t.w/2),t.y=this.settings.y||Math.max(0,o.h/2-t.h/2),t},renderHtml:function(){var e=this._layout,t=this._id,n=this.classPrefix,r=this.settings,o="",i="",a=r.html;return this.preRender(),e.preRender(this),r.title&&(o='<div id="'+t+'-head" class="'+n+'window-head"><div id="'+t+'-title" class="'+n+'title">'+this.encode(r.title)+'</div><div id="'+t+'-dragh" class="'+n+'dragh"></div><button type="button" class="'+n+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),r.url&&(a='<iframe src="'+r.url+'" tabindex="-1"></iframe>'),void 0===a&&(a=e.renderHtml(this)),this.statusbar&&(i=this.statusbar.renderHtml()),'<div id="'+t+'" class="'+this.classes+'" hidefocus="1"><div class="'+this.classPrefix+'reset" role="application">'+o+'<div id="'+t+'-body" class="'+this.bodyClasses+'">'+a+"</div>"+i+"</div></div>"},fullscreen:function(t){var n,r,o=this,i=e.document.documentElement,a=o.classPrefix;if(t!==o._fullscreen)if(we(e.window).on("resize",(function(){var e;if(o._fullscreen)if(n)o._timer||(o._timer=S.setTimeout((function(){var e=Ce.getWindowSize();o.moveTo(0,0).resizeTo(e.w,e.h),o._timer=0}),50));else{e=(new Date).getTime();var t=Ce.getWindowSize();o.moveTo(0,0).resizeTo(t.w,t.h),(new Date).getTime()-e>50&&(n=!0)}})),r=o.layoutRect(),o._fullscreen=t,t){o._initial={x:r.x,y:r.y,w:r.w,h:r.h},o.borderBox=Ae("0"),o.getEl("head").style.display="none",r.deltaH-=r.headerH+2,we([i,e.document.body]).addClass(a+"fullscreen"),o.classes.add("fullscreen");var u=Ce.getWindowSize();o.moveTo(0,0).resizeTo(u.w,u.h)}else o.borderBox=Ae(o.settings.border),o.getEl("head").style.display="",r.deltaH+=r.headerH,we([i,e.document.body]).removeClass(a+"fullscreen"),o.classes.remove("fullscreen"),o.moveTo(o._initial.x,o._initial.y).resizeTo(o._initial.w,o._initial.h);return o.reflow()},postRender:function(){var e,t=this;setTimeout((function(){t.classes.add("in"),t.fire("open")}),0),t._super(),t.statusbar&&t.statusbar.postRender(),t.focus(),this.dragHelper=new lt(t._id+"-dragh",{start:function(){e={x:t.layoutRect().x,y:t.layoutRect().y}},drag:function(n){t.moveTo(e.x+n.deltaX,e.y+n.deltaY)}}),t.on("submit",(function(e){e.isDefaultPrevented()||t.close()})),Lt.push(t),Ht(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e;for(this.dragHelper.destroy(),this._super(),this.statusbar&&this.statusbar.remove(),zt(this.classPrefix,!1),e=Lt.length;e--;)Lt[e]===this&&Lt.splice(e,1);Ht(Lt.length>0)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});!function(){if(!le.desktop){var t={w:e.window.innerWidth,h:e.window.innerHeight};S.setInterval((function(){var n=e.window.innerWidth,r=e.window.innerHeight;t.w===n&&t.h===r||(t={w:n,h:r},we(e.window).trigger("resize"))}),100)}we(e.window).on("resize",(function(){var e,t,n=Ce.getWindowSize();for(e=0;e<Lt.length;e++)t=Lt[e].layoutRect(),Lt[e].moveTo(Lt[e].settings.x||Math.max(0,n.w/2-t.w/2),Lt[e].settings.y||Math.max(0,n.h/2-t.h/2))}))}();var jt,Ut,Vt,qt=Wt.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(t){var n,r=t.callback||function(){};function o(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),r(t)}}}switch(t.buttons){case qt.OK_CANCEL:n=[o("Ok",!0,!0),o("Cancel",!1)];break;case qt.YES_NO:case qt.YES_NO_CANCEL:n=[o("Yes",1,!0),o("No",0)],t.buttons===qt.YES_NO_CANCEL&&n.push(o("Cancel",-1));break;default:n=[o("Ok",!0,!0)]}return new Wt({padding:20,x:t.x,y:t.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:n,title:t.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:t.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:t.onClose,onCancel:function(){r(!1)}}).renderTo(e.document.body).reflow()},alert:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,qt.msgBox(e)},confirm:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,e.buttons=qt.OK_CANCEL,qt.msgBox(e)}}}),$t=function(t){return{renderUI:function(e){return Ot(t,this,e)},resizeTo:function(e,n){return se(t,e,n)},resizeBy:function(e,n){return ce(t,e,n)},getNotificationManagerImpl:function(){return Mt(t)},getWindowManagerImpl:function(){return{open:function(t,n,r){var o;return t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body,data:t.data,callbacks:t.commands}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){o.find("form")[0].submit()}},{text:"Cancel",onclick:function(){o.close()}}]),(o=new Wt(t)).on("close",(function(){r(o)})),t.data&&o.on("postRender",(function(){this.find("*").each((function(e){var n=e.name();n in t.data&&e.value(t.data[n])}))})),o.features=t||{},o.params=n||{},o=o.renderTo(e.document.body).reflow()},alert:function(e,t,n){var r;return(r=qt.alert(e,(function(){t()}))).on("close",(function(){n(r)})),r},confirm:function(e,t,n){var r;return(r=qt.confirm(e,(function(e){t(e)}))).on("close",(function(){n(r)})),r},close:function(e){e.close()},getParams:function(e){return e.params},setParams:function(e,t){e.params=t}}}}},Yt=Re.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=u.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t,n,r,o,i=this.settings;t=i.firstControlClass,n=i.lastControlClass,e.each((function(e){e.classes.remove(t).remove(n).add(i.controlClass),e.visible()&&(r||(r=e),o=e)})),r&&r.classes.add(t),o&&o.classes.add(n)},renderHtml:function(e){var t="";return this.applyClasses(e.items()),e.items().each((function(e){t+=e.renderHtml()})),t},recalc:function(){},postRender:function(){},isNative:function(){return!1}}),Xt=Yt.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each((function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()}))},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}}),Kt=Dt.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t,n=this;n._super(e),e=n.settings,t=n.settings.size,n.on("click mousedown",(function(e){e.preventDefault()})),n.on("touchstart",(function(e){n.fire("click",e),e.preventDefault()})),e.subtype&&n.classes.add(e.subtype),t&&n.classes.add("btn-"+t),e.icon&&n.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e,t=this.getEl().firstChild;t&&((e=t.style).width=e.height="100%"),this._super()},renderHtml:function(){var t,n,r=this._id,o=this.classPrefix,i=this.state.get("icon"),a=this.state.get("text"),u="",s=this.settings;return(t=s.image)?(i="none","string"!=typeof t&&(t=e.window.getSelection?t[0]:t[1]),t=" style=\"background-image: url('"+t+"')\""):t="",a&&(this.classes.add("btn-has-text"),u='<span class="'+o+'txt">'+this.encode(a)+"</span>"),i=i?o+"ico "+o+"i-"+i:"",n="boolean"==typeof s.active?' aria-pressed="'+s.active+'"':"",'<div id="'+r+'" class="'+this.classes+'" tabindex="-1"'+n+'><button id="'+r+'-button" role="presentation" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+t+"></i>":"")+u+"</button></div>"},bindStates:function(){var t=this,n=t.$,r=t.classPrefix+"txt";function o(e){var o=n("span."+r,t.getEl());e?(o[0]||(n("button:first",t.getEl()).append('<span class="'+r+'"></span>'),o=n("span."+r,t.getEl())),o.html(t.encode(e))):o.remove(),t.classes.toggle("btn-has-text",!!e)}return t.state.on("change:text",(function(e){o(e.value)})),t.state.on("change:icon",(function(n){var r=n.value,i=t.classPrefix;t.settings.icon=r,r=r?i+"ico "+i+"i-"+t.settings.icon:"";var a=t.getEl().firstChild,u=a.getElementsByTagName("i")[0];r?(u&&u===a.firstChild||(u=e.document.createElement("i"),a.insertBefore(u,a.firstChild)),u.className=r):u&&a.removeChild(u),o(t.state.get("text"))})),t._super()}}),Gt=Kt.extend({init:function(e){e=u.extend({text:"Browse...",multiple:!1,accept:null},e),this._super(e),this.classes.add("browsebutton"),e.multiple&&this.classes.add("multiple")},postRender:function(){var e=this,t=Ce.create("input",{type:"file",id:e._id+"-browse",accept:e.settings.accept});e._super(),we(t).on("change",(function(t){var n=t.target.files;e.value=function(){return n.length?e.settings.multiple?n:n[0]:null},t.preventDefault(),n.length&&e.fire("change",t)})),we(t).on("click",(function(e){e.stopPropagation()})),we(e.getEl("button")).on("click touchstart",(function(e){e.stopPropagation(),t.click(),e.preventDefault()})),e.getEl().appendChild(t)},remove:function(){we(this.getEl("button")).off(),we(this.getEl("input")).off(),this._super()}}),Jt=st.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this._layout;return this.classes.add("btn-group"),this.preRender(),e.preRender(this),'<div id="'+this._id+'" class="'+this.classes+'"><div id="'+this._id+'-body">'+(this.settings.html||"")+e.renderHtml(this)+"</div></div>"}}),Qt=Dt.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",(function(e){e.preventDefault()})),t.on("click",(function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())})),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'" unselectable="on" aria-labelledby="'+e+'-al" tabindex="-1"><i class="'+t+"ico "+t+'i-checkbox"></i><span id="'+e+'-al" class="'+t+'label">'+this.encode(this.state.get("text"))+"</span></div>"},bindStates:function(){var t=this;function n(e){t.classes.toggle("checked",e),t.aria("checked",e)}return t.state.on("change:text",(function(e){t.getEl("al").firstChild.data=t.translate(e.value)})),t.state.on("change:checked change:value",(function(e){t.fire("change"),n(e.value)})),t.state.on("change:icon",(function(n){var r=n.value,o=t.classPrefix;if(void 0===r)return t.settings.icon;t.settings.icon=r,r=r?o+"ico "+o+"i-"+t.settings.icon:"";var i=t.getEl().firstChild,a=i.getElementsByTagName("i")[0];r?(a&&a===i.firstChild||(a=e.document.createElement("i"),i.insertBefore(a,i.firstChild)),a.className=r):a&&i.removeChild(a)})),t.state.get("checked")&&n(!0),t._super()}}),Zt=tinymce.util.Tools.resolve("tinymce.util.VK"),en=Dt.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.classes.add("combobox"),t.subinput=!0,t.ariaTarget="inp",e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",(function(n){var r=n.target,o=t.getEl();if(we.contains(o,r)||r===o)for(;r&&r!==o;)r.id&&-1!==r.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),r=r.parentNode})),t.on("keydown",(function(e){var n;13===e.keyCode&&"INPUT"===e.target.nodeName&&(e.preventDefault(),t.parents().reverse().each((function(e){if(e.toJSON)return n=e,!1})),t.fire("submit",{data:n.toJSON()}))})),t.on("keyup",(function(e){if("INPUT"===e.target.nodeName){var n=t.state.get("value"),r=e.target.value;r!==n&&(t.state.set("value",r),t.fire("autocomplete",e))}})),t.on("mouseover",(function(e){var n=t.tooltip().moveTo(-65535);if(t.statusLevel()&&-1!==e.target.className.indexOf(t.classPrefix+"status")){var r=t.statusMessage()||"Ok",o=n.text(r).show().testMoveRel(e.target,["bc-tc","bc-tl","bc-tr"]);n.classes.toggle("tooltip-n","bc-tc"===o),n.classes.toggle("tooltip-nw","bc-tl"===o),n.classes.toggle("tooltip-ne","bc-tr"===o),n.moveRel(e.target,o)}}))},statusLevel:function(e){return arguments.length>0&&this.state.set("statusLevel",e),this.state.get("statusLevel")},statusMessage:function(e){return arguments.length>0&&this.state.set("statusMessage",e),this.state.get("statusMessage")},showMenu:function(){var e,t=this,n=t.settings;t.menu||((e=n.menu||[]).length?e={type:"menu",items:e}:e.type=e.type||"menu",t.menu=g.create(e).parent(t).renderTo(t.getContainerElm()),t.fire("createmenu"),t.menu.reflow(),t.menu.on("cancel",(function(e){e.control===t.menu&&t.focus()})),t.menu.on("show hide",(function(e){e.control.items().each((function(e){e.active(e.value()===t.value())}))})).fire("show"),t.menu.on("select",(function(e){t.value(e.control.value())})),t.on("focusin",(function(e){"INPUT"===e.target.tagName.toUpperCase()&&t.menu.hide()})),t.aria("expanded",!0)),t.menu.show(),t.menu.layoutRect({w:t.layoutRect().w}),t.menu.moveRel(t.getEl(),t.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var t,n,r=this.getEl(),o=this.getEl("open"),i=this.layoutRect(),a=0,u=r.firstChild;this.statusLevel()&&"none"!==this.statusLevel()&&(a=parseInt(Ce.getRuntimeStyle(u,"padding-right"),10)-parseInt(Ce.getRuntimeStyle(u,"padding-left"),10)),t=o?i.w-Ce.getSize(o).width-10:i.w-10;var s=e.document;return s.all&&(!s.documentMode||s.documentMode<=8)&&(n=this.layoutRect().h-2+"px"),we(u).css({width:t-a,lineHeight:n}),this._super(),this},postRender:function(){var e=this;return we(this.getEl("inp")).on("change",(function(t){e.state.set("value",t.target.value),e.fire("change",t)})),e._super()},renderHtml:function(){var e,t,n,r=this._id,o=this.settings,i=this.classPrefix,a=this.state.get("value")||"",u="",s="";return"spellcheck"in o&&(s+=' spellcheck="'+o.spellcheck+'"'),o.maxLength&&(s+=' maxlength="'+o.maxLength+'"'),o.size&&(s+=' size="'+o.size+'"'),o.subtype&&(s+=' type="'+o.subtype+'"'),n='<i id="'+r+'-status" class="mce-status mce-ico" style="display: none"></i>',this.disabled()&&(s+=' disabled="disabled"'),(e=o.icon)&&"caret"!==e&&(e=i+"ico "+i+"i-"+o.icon),t=this.state.get("text"),(e||t)&&(u='<div id="'+r+'-open" class="'+i+"btn "+i+'open" tabIndex="-1" role="button"><button id="'+r+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!==e?'<i class="'+e+'"></i>':'<i class="'+i+'caret"></i>')+(t?(e?" ":"")+t:"")+"</button></div>",this.classes.add("has-open")),'<div id="'+r+'" class="'+this.classes+'"><input id="'+r+'-inp" class="'+i+'textbox" value="'+this.encode(a,!1)+'" hidefocus="1"'+s+' placeholder="'+this.encode(o.placeholder)+'" />'+n+u+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},showAutoComplete:function(e,t){var n=this;if(0!==e.length){n.menu?n.menu.items().remove():n.menu=g.create({type:"menu",classes:"combobox-menu",layout:"flow"}).parent(n).renderTo(),u.each(e,(function(e){var r,o;n.menu.add({text:e.title,url:e.previewUrl,match:t,classes:"menu-item-ellipsis",onclick:(r=e.value,o=e.title,function(){n.fire("selectitem",{title:o,value:r})})})})),n.menu.renderNew(),n.hideMenu(),n.menu.on("cancel",(function(e){e.control.parent()===n.menu&&(e.stopPropagation(),n.focus(),n.hideMenu())})),n.menu.on("select",(function(){n.focus()}));var r=n.layoutRect().w;n.menu.layoutRect({w:r,minW:0,maxW:r}),n.menu.repaint(),n.menu.reflow(),n.menu.show(),n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])}else n.hideMenu()},hideMenu:function(){this.menu&&this.menu.hide()},bindStates:function(){var e=this;e.state.on("change:value",(function(t){e.getEl("inp").value!==t.value&&(e.getEl("inp").value=t.value)})),e.state.on("change:disabled",(function(t){e.getEl("inp").disabled=t.value})),e.state.on("change:statusLevel",(function(t){var n=e.getEl("status"),r=e.classPrefix,o=t.value;Ce.css(n,"display","none"===o?"none":""),Ce.toggleClass(n,r+"i-checkmark","ok"===o),Ce.toggleClass(n,r+"i-warning","warn"===o),Ce.toggleClass(n,r+"i-error","error"===o),e.classes.toggle("has-status","none"!==o),e.repaint()})),Ce.on(e.getEl("status"),"mouseleave",(function(){e.tooltip().hide()})),e.on("cancel",(function(t){e.menu&&e.menu.visible()&&(t.stopPropagation(),e.hideMenu())}));var t=function(e,t){t&&t.items().length>0&&t.items().eq(e)[0].focus()};return e.on("keydown",(function(n){var r=n.keyCode;"INPUT"===n.target.nodeName&&(r===Zt.DOWN?(n.preventDefault(),e.fire("autocomplete"),t(0,e.menu)):r===Zt.UP&&(n.preventDefault(),t(-1,e.menu)))})),e._super()},remove:function(){we(this.getEl("inp")).off(),this.menu&&this.menu.remove(),this._super()}}),tn=en.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",(function(){t.repaintColor(t.value())}))},repaintColor:function(e){var t=this.getEl("open"),n=t?t.getElementsByTagName("i")[0]:null;if(n)try{n.style.background=e}catch(e){}},bindStates:function(){var e=this;return e.state.on("change:value",(function(t){e.state.get("rendered")&&e.repaintColor(t.value)})),e._super()}}),nn=Kt.extend({showPanel:function(){var e=this,t=e.settings;if(e.classes.add("opened"),e.panel)e.panel.show();else{var n=t.panel;n.type&&(n={layout:"grid",items:n}),n.role=n.role||"dialog",n.popover=!0,n.autohide=!0,n.ariaRoot=!0,e.panel=new Et(n).on("hide",(function(){e.classes.remove("opened")})).on("cancel",(function(t){t.stopPropagation(),e.focus(),e.hidePanel()})).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}var r=e.panel.testMoveRel(e.getEl(),t.popoverAlign||(e.isRtl()?["bc-tc","bc-tl","bc-tr"]:["bc-tc","bc-tr","bc-tl","tc-bc","tc-br","tc-bl"]));e.panel.classes.toggle("start","l"===r.substr(-1)),e.panel.classes.toggle("end","r"===r.substr(-1));var o="t"===r.substr(0,1);e.panel.classes.toggle("bottom",!o),e.panel.classes.toggle("top",o),e.panel.moveRel(e.getEl(),r)},hidePanel:function(){this.panel&&this.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",(function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))})),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}}),rn=h.DOM,on=nn.extend({init:function(e){this._super(e),this.classes.add("splitbtn"),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this._id,t=this.classPrefix,n=this.state.get("text"),r=this.settings.icon?t+"ico "+t+"i-"+this.settings.icon:"",o=this.settings.image?" style=\"background-image: url('"+this.settings.image+"')\"":"",i="";return n&&(this.classes.add("btn-has-text"),i='<span class="'+t+'txt">'+this.encode(n)+"</span>"),'<div id="'+e+'" class="'+this.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+o+"></i>":"")+'<span id="'+e+'-preview" class="'+t+'preview"></span>'+i+'</button><button type="button" class="'+t+'open" hidefocus="1" tabindex="-1"> <i class="'+t+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",(function(n){n.aria&&"down"===n.aria.key||n.control!==e||rn.getParent(n.target,"."+e.classPrefix+"open")||(n.stopImmediatePropagation(),t.call(e,n))})),delete e.settings.onclick,e._super()}}),an=tinymce.util.Tools.resolve("tinymce.util.Color"),un=Dt.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){var e,t,n,r,o,i=this,a=i.color();function u(e,t){var n,r,o=Ce.getPos(e);return n=t.pageX-o.x,r=t.pageY-o.y,{x:n=Math.max(0,Math.min(n/e.clientWidth,1)),y:r=Math.max(0,Math.min(r/e.clientHeight,1))}}function s(e,t){var a=(360-e.h)/360;Ce.css(n,{top:100*a+"%"}),t||Ce.css(o,{left:e.s+"%",top:100-e.v+"%"}),r.style.background=an({s:100,v:100,h:e.h}).toHex(),i.color().parse({s:e.s,v:e.v,h:e.h})}function c(t){var n;n=u(r,t),e.s=100*n.x,e.v=100*(1-n.y),s(e),i.fire("change")}function l(n){var r;r=u(t,n),(e=a.toHsv()).h=360*(1-r.y),s(e,!0),i.fire("change")}t=i.getEl("h"),n=i.getEl("hp"),r=i.getEl("sv"),o=i.getEl("svp"),i._repaint=function(){s(e=a.toHsv())},i._super(),i._svdraghelper=new lt(i._id+"-sv",{start:c,drag:c}),i._hdraghelper=new lt(i._id+"-h",{start:l,drag:l}),i._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;if(!arguments.length)return t.color().toHex();t.color().parse(e),t._rendered&&t._repaint()},color:function(){return this._color||(this._color=an()),this._color},renderHtml:function(){var e,t=this._id,n=this.classPrefix,r="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000";return e='<div id="'+t+'-h" class="'+n+'colorpicker-h" style="background: -ms-linear-gradient(top,#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000);background: linear-gradient(to bottom,#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000);">'+function(){var e,t,o,i,a="";for(o="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",e=0,t=(i=r.split(",")).length-1;e<t;e++)a+='<div class="'+n+'colorpicker-h-chunk" style="height:'+100/t+"%;"+o+i[e]+",endColorstr="+i[e+1]+");-ms-"+o+i[e]+",endColorstr="+i[e+1]+')"></div>';return a}()+'<div id="'+t+'-hp" class="'+n+'colorpicker-h-marker"></div></div>','<div id="'+t+'" class="'+this.classes+'"><div id="'+t+'-sv" class="'+n+'colorpicker-sv"><div class="'+n+'colorpicker-overlay1"><div class="'+n+'colorpicker-overlay2"><div id="'+t+'-svp" class="'+n+'colorpicker-selector1"><div class="'+n+'colorpicker-selector2"></div></div></div></div></div>'+e+"</div>"}}),sn=Dt.extend({init:function(e){e=u.extend({height:100,text:"Drop an image here",multiple:!1,accept:null},e),this._super(e),this.classes.add("dropzone"),e.multiple&&this.classes.add("multiple")},renderHtml:function(){var e,t,n=this.settings;return e={id:this._id,hidefocus:"1"},t=Ce.create("div",e,"<span>"+this.translate(n.text)+"</span>"),n.height&&Ce.css(t,"height",n.height+"px"),n.width&&Ce.css(t,"width",n.width+"px"),t.className=this.classes,t.outerHTML},postRender:function(){var e=this,t=function(t){t.preventDefault(),e.classes.toggle("dragenter"),e.getEl().className=e.classes};e._super(),e.$el.on("dragover",(function(e){e.preventDefault()})),e.$el.on("dragenter",t),e.$el.on("dragleave",t),e.$el.on("drop",(function(t){if(t.preventDefault(),!e.state.get("disabled")){var n=function(t){var n=e.settings.accept;if("string"!=typeof n)return t;var r=new RegExp("("+n.split(/\s*,\s*/).join("|")+")$","i");return u.grep(t,(function(e){return r.test(e.name)}))}(t.dataTransfer.files);e.value=function(){return n.length?e.settings.multiple?n:n[0]:null},n.length&&e.fire("change",t)}}))},remove:function(){this.$el.off(),this._super()}}),cn=Dt.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="»"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",(function(e){var n;(n=e.target.getAttribute("data-index"))&&t.fire("select",{value:t.row()[n],index:n})})),t.row(t.settings.row)},focus:function(){return this.getEl().firstChild.focus(),this},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'">'+this._getDataPathHtml(this.state.get("row"))+"</div>"},bindStates:function(){var e=this;return e.state.on("change:row",(function(t){e.innerHtml(e._getDataPathHtml(t.value))})),e._super()},_getDataPathHtml:function(e){var t,n,r=e||[],o="",i=this.classPrefix;for(t=0,n=r.length;t<n;t++)o+=(t>0?'<div class="'+i+'divider" aria-hidden="true"> '+this.settings.delimiter+" </div>":"")+'<div role="button" class="'+i+"path-item"+(t===n-1?" "+i+"last":"")+'" data-index="'+t+'" tabindex="-1" id="'+this._id+"-"+t+'" aria-level="'+(t+1)+'">'+r[t].name+"</div>";return o||(o='<div class="'+i+'path-item"> </div>'),o}}),ln=cn.extend({postRender:function(){var e=this,t=e.settings.editor;function n(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}return!1!==t.settings.elementpath&&(e.on("select",(function(e){t.focus(),t.selection.select(this.row()[e.index].element),t.nodeChanged()})),t.on("nodeChange",(function(r){for(var o=[],i=r.parents,a=i.length;a--;)if(1===i[a].nodeType&&!n(i[a])){var u=t.fire("ResolveName",{name:i[a].nodeName.toLowerCase(),target:i[a]});if(u.isDefaultPrevented()||o.push({name:u.name,element:i[a]}),u.isPropagationStopped())break}e.row(o)}))),e._super()}}),fn=st.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this._layout,t=this.classPrefix;return this.classes.add("formitem"),e.preRender(this),'<div id="'+this._id+'" class="'+this.classes+'" hidefocus="1" tabindex="-1">'+(this.settings.title?'<div id="'+this._id+'-title" class="'+t+'title">'+this.settings.title+"</div>":"")+'<div id="'+this._id+'-body" class="'+this.bodyClasses+'">'+(this.settings.html||"")+e.renderHtml(this)+"</div></div>"}}),dn=st.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:15,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,t=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),t.each((function(t){var n,r=t.settings.label;r&&((n=new fn(u.extend({items:{type:"label",id:t._id+"-l",text:r,flex:0,forId:t._id,disabled:t.disabled()}},e.settings.formItemDefaults))).type="formitem",t.aria("labelledby",t._id+"-l"),void 0===t.settings.flex&&(t.settings.flex=1),e.replace(t,n),n.add(t))}))},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){this._super(),this.fromJSON(this.settings.data)},bindStates:function(){var e=this;function t(){var t,n,r=0,o=[];if(!1!==e.settings.labelGapCalc)for(("children"===e.settings.labelGapCalc?e.find("formitem"):e.items()).filter("formitem").each((function(e){var t=e.items()[0],n=t.getEl().clientWidth;r=n>r?n:r,o.push(t)})),n=e.settings.labelGap||0,t=o.length;t--;)o[t].settings.minWidth=r+n}e._super(),e.on("show",t),t()}}),mn=dn.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this._layout,t=this.classPrefix;return this.preRender(),e.preRender(this),'<fieldset id="'+this._id+'" class="'+this.classes+'" hidefocus="1" tabindex="-1">'+(this.settings.title?'<legend id="'+this._id+'-title" class="'+t+'fieldset-title">'+this.settings.title+"</legend>":"")+'<div id="'+this._id+'-body" class="'+this.bodyClasses+'">'+(this.settings.html||"")+e.renderHtml(this)+"</div></fieldset>"}}),hn=0,gn=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:k(e)}},pn={fromHtml:function(t,n){var r=(n||e.document).createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw e.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return gn(r.childNodes[0])},fromTag:function(t,n){var r=(n||e.document).createElement(t);return gn(r)},fromText:function(t,n){var r=(n||e.document).createTextNode(t);return gn(r)},fromDom:gn,fromPoint:function(e,t,n){var r=e.dom();return A.from(r.elementFromPoint(t,n)).map(gn)}},vn=(e.Node.ATTRIBUTE_NODE,e.Node.CDATA_SECTION_NODE,e.Node.COMMENT_NODE,e.Node.DOCUMENT_NODE),bn=(e.Node.DOCUMENT_TYPE_NODE,e.Node.DOCUMENT_FRAGMENT_NODE,e.Node.ELEMENT_NODE),yn=(e.Node.TEXT_NODE,e.Node.PROCESSING_INSTRUCTION_NODE,e.Node.ENTITY_REFERENCE_NODE,e.Node.ENTITY_NODE,e.Node.NOTATION_NODE,void 0!==e.window?e.window:Function("return this;")(),function(){return wn(0,0)}),wn=function(e,t){return{major:e,minor:t}},xn={nu:wn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?yn():function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return wn(r(1),r(2))}(e,n)},unknown:yn},Cn=function(e,t){return function(){return t===e}},Sn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Cn("Edge",t),isChrome:Cn("Chrome",t),isIE:Cn("IE",t),isOpera:Cn("Opera",t),isFirefox:Cn("Firefox",t),isSafari:Cn("Safari",t)}},En={unknown:function(){return Sn({current:void 0,version:xn.unknown()})},nu:Sn,edge:k("Edge"),chrome:k("Chrome"),ie:k("IE"),opera:k("Opera"),firefox:k("Firefox"),safari:k("Safari")},kn=function(e,t){return function(){return t===e}},Nn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:kn("Windows",t),isiOS:kn("iOS",t),isAndroid:kn("Android",t),isOSX:kn("OSX",t),isLinux:kn("Linux",t),isSolaris:kn("Solaris",t),isFreeBSD:kn("FreeBSD",t)}},Tn={unknown:function(){return Nn({current:void 0,version:xn.unknown()})},nu:Nn,windows:k("Windows"),ios:k("iOS"),android:k("Android"),linux:k("Linux"),osx:k("OSX"),solaris:k("Solaris"),freebsd:k("FreeBSD")},_n=function(e,t){var n=String(t).toLowerCase();return function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n))return A.some(o)}return A.none()}(e,(function(e){return e.search(n)}))},Rn=function(e,t){return _n(e,t).map((function(e){var n=xn.detect(e.versionRegexes,t);return{current:e.name,version:n}}))},On=function(e,t){return _n(e,t).map((function(e){var n=xn.detect(e.versionRegexes,t);return{current:e.name,version:n}}))},An=function(e,t){return-1!==e.indexOf(t)},Dn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Pn=function(e){return function(t){return An(t,e)}},Bn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return An(e,"edge/")&&An(e,"chrome")&&An(e,"safari")&&An(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Dn],search:function(e){return An(e,"chrome")&&!An(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return An(e,"msie")||An(e,"trident")}},{name:"Opera",versionRegexes:[Dn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Pn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Pn("firefox")},{name:"Safari",versionRegexes:[Dn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(An(e,"safari")||An(e,"mobile/"))&&An(e,"applewebkit")}}],In=[{name:"Windows",search:Pn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return An(e,"iphone")||An(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Pn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Pn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Pn("linux"),versionRegexes:[]},{name:"Solaris",search:Pn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Pn("freebsd"),versionRegexes:[]}],Mn={browsers:k(Bn),oses:k(In)},Ln=function(e){var t=Mn.browsers(),n=Mn.oses(),r=Rn(t,e).fold(En.unknown,En.nu),o=On(n,e).fold(Tn.unknown,Tn.nu),i=function(e,t,n){var r=e.isiOS()&&!0===/ipad/i.test(n),o=e.isiOS()&&!r,i=e.isAndroid()&&3===e.version.major,a=e.isAndroid()&&4===e.version.major,u=r||i||a&&!0===/mobile/i.test(n),s=e.isiOS()||e.isAndroid(),c=s&&!u,l=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n);return{isiPad:k(r),isiPhone:k(o),isTablet:k(u),isPhone:k(c),isTouch:k(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:k(l)}}(o,r,e);return{browser:r,os:o,deviceType:i}},Fn=(jt=function(){var t=e.navigator.userAgent;return Ln(t)},Vt=!1,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Vt||(Vt=!0,Ut=jt.apply(null,e)),Ut}),Hn=bn,zn=vn,Wn=function(e){return e.nodeType!==Hn&&e.nodeType!==zn||0===e.childElementCount},jn=(Fn().browser.isIE(),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}("element","offset"),u.trim),Un=function(e){return function(t){if(t&&1===t.nodeType){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}},Vn=Un("true"),qn=Un("false"),$n=function(e,t,n,r,o){return{type:e,title:t,url:n,level:r,attach:o}},Yn=function(e){return e.innerText||e.textContent},Xn=function(e){return e.id?e.id:(t="h",n=(new Date).getTime(),t+"_"+Math.floor(1e9*Math.random())+ ++hn+String(n));var t,n},Kn=function(e){return function(e){return e&&"A"===e.nodeName&&(e.id||e.name)}(e)&&Jn(e)},Gn=function(e){return e&&/^(H[1-6])$/.test(e.nodeName)},Jn=function(e){return function(e){for(;e=e.parentNode;){var t=e.contentEditable;if(t&&"inherit"!==t)return Vn(e)}return!1}(e)&&!qn(e)},Qn=function(e){return Gn(e)&&Jn(e)},Zn=function(e){var t=Xn(e);return $n("header",Yn(e),"#"+t,function(e){return Gn(e)?parseInt(e.nodeName.substr(1),10):0}(e),(function(){e.id=t}))},er=function(e){var t=e.id||e.name,n=Yn(e);return $n("anchor",n||"#"+t,"#"+t,0,E)},tr=function(t){var n,r;return n="h1,h2,h3,h4,h5,h6,a:not([href])",r=t,G(({detect:Fn}.detect().browser.isIE(),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}("element","offset"),function(t,n){return function(t,n){var r=void 0===n?e.document:n.dom();return Wn(r)?[]:G(r.querySelectorAll(t),pn.fromDom)}(n,t)})(pn.fromDom(r),n),(function(e){return e.dom()}))},nr=function(e){return jn(e.title).length>0},rr=function(e){var t=tr(e);return Q(function(e){return G(Q(e,Qn),Zn)}(t).concat(function(e){return G(Q(e,Kn),er)}(t)),nr)},or={},ir=function(e){return{title:e.title,value:{title:{raw:e.title},url:e.url,attach:e.attach}}},ar=function(e,t){return{title:e,value:{title:e,url:t,attach:E}}},ur=function(e,t,n){var r=t in e?e[t]:n;return!1===r?null:r},sr=function(e,t,n,r){var o={title:"-"},i=function(e){var r=e.hasOwnProperty(n)?e[n]:[],o=Q(r,(function(e){return function(e,t){return!K(t,(function(t){return t.url===e}))}(e,t)}));return u.map(o,(function(e){return{title:e,value:{title:e,url:e,attach:E}}}))},a=function(e){return function(e){return u.map(e,ir)}(Q(t,(function(t){return t.type===e})))};return!1===r.typeahead_urls?[]:"file"===n?function(e,t,n){return J(e,(function(e){n=t(n,e)})),n}([cr(e,i(or)),cr(e,a("header")),cr(e,function(){var e=a("anchor"),t=ur(r,"anchor_top","#top"),n=ur(r,"anchor_bottom","#bottom");return null!==t&&e.unshift(ar("<top>",t)),null!==n&&e.push(ar("<bottom>",n)),e}())],(function(e,t){return 0===e.length||0===t.length?e.concat(t):e.concat(o,t)}),[]):cr(e,i(or))},cr=function(e,t){var n=e.toLowerCase(),r=u.grep(t,(function(e){return-1!==e.title.toLowerCase().indexOf(n)}));return 1===r.length&&r[0].title===e?[]:r},lr=function(e,t,n,r){var o=function(o){var i=rr(n),a=sr(o,i,r,t);e.showAutoComplete(a,o)};e.on("autocomplete",(function(){o(e.value())})),e.on("selectitem",(function(t){var n=t.value;e.value(n.url);var o=function(e){var t=e.title;return t.raw?t.raw:t}(n);"image"===r?e.fire("change",{meta:{alt:o,attach:n.attach}}):e.fire("change",{meta:{text:o,attach:n.attach}}),e.focus()})),e.on("click",(function(t){0===e.value().length&&"INPUT"===t.target.nodeName&&o("")})),e.on("PostRender",(function(){e.getRoot().on("submit",(function(t){t.isDefaultPrevented()||function(e,t){var n=or[t];/^https?/.test(e)&&(n?X(n,e).isNone()&&(or[t]=n.slice(0,5).concat(e)):or[t]=[e])}(e.value(),r)}))}))},fr=function(e,t,n){var r=t.filepicker_validator_handler;r&&e.state.on("change:value",(function(t){var o;0!==(o=t.value).length?r({url:o,type:n},(function(t){var n=function(e){var t=e.status,n=e.message;return"valid"===t?{status:"ok",message:n}:"unknown"===t?{status:"warn",message:n}:"invalid"===t?{status:"warn",message:n}:{status:"none",message:""}}(t);e.statusMessage(n.message),e.statusLevel(n.status)})):e.statusLevel("none")}))},dr=en.extend({Statics:{clearHistory:function(){or={}}},init:function(e){var t,n,r,o=this,i=window.tinymce?window.tinymce.activeEditor:a.activeEditor,s=i.settings,c=e.filetype;e.spellcheck=!1,(r=s.file_picker_types||s.file_browser_callback_types)&&(r=u.makeMap(r,/[, ]/)),r&&!r[c]||(!(n=s.file_picker_callback)||r&&!r[c]?!(n=s.file_browser_callback)||r&&!r[c]||(t=function(){n(o.getEl("inp").id,o.value(),c,window)}):t=function(){var e=o.fire("beforecall").meta;e=u.extend({filetype:c},e),n.call(i,(function(e,t){o.value(e).fire("change",{meta:t})}),o.value(),e)}),t&&(e.icon="browse",e.onaction=t),o._super(e),o.classes.add("filepicker"),lr(o,s,i.getBody(),c),fr(o,s,c)}}),mr=Xt.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each((function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()}))}}),hr=Xt.extend({recalc:function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,h,g,p,v,b,y,w,x,C,S,E,k,N,T,_,R,O,A,D,P,B,I,M,L,F=[],H=Math.max,z=Math.min;for(r=e.items().filter(":visible"),o=e.layoutRect(),i=e.paddingBox,a=e.settings,d=e.isRtl()?a.direction||"row-reversed":a.direction,u=a.align,s=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,"row-reversed"!==d&&"column-reverse"!==d||(r=r.set(r.toArray().reverse()),d=d.split("-")[0]),"column"===d?(E="y",C="h",S="minH",k="maxH",T="innerH",N="top",_="deltaH",R="contentH",B="left",D="w",O="x",A="innerW",P="minW",I="right",M="deltaW",L="contentW"):(E="x",C="w",S="minW",k="maxW",T="innerW",N="left",_="deltaW",R="contentW",B="top",D="h",O="y",A="innerH",P="minH",I="bottom",M="deltaH",L="contentH"),f=o[T]-i[N]-i[N],x=l=0,t=0,n=r.length;t<n;t++)h=(m=r[t]).layoutRect(),f-=t<n-1?c:0,(g=m.settings.flex)>0&&(l+=g,h[k]&&F.push(m),h.flex=g),f-=h[S],(p=i[B]+h[P]+i[I])>x&&(x=p);if((y={})[S]=f<0?o[S]-f+o[_]:o[T]-f+o[_],y[P]=x+o[M],y[R]=o[T]-f,y[L]=x,y.minW=z(y.minW,o.maxW),y.minH=z(y.minH,o.maxH),y.minW=H(y.minW,o.startMinWidth),y.minH=H(y.minH,o.startMinHeight),!o.autoResize||y.minW===o.minW&&y.minH===o.minH){for(b=f/l,t=0,n=F.length;t<n;t++)v=(h=(m=F[t]).layoutRect())[k],(p=h[S]+h.flex*b)>v?(f-=h[k]-h[S],l-=h.flex,h.flex=0,h.maxFlexSize=v):h.maxFlexSize=0;for(b=f/l,w=i[N],y={},0===l&&("end"===s?w=f+i[N]:"center"===s?(w=Math.round(o[T]/2-(o[T]-f)/2)+i[N])<0&&(w=i[N]):"justify"===s&&(w=i[N],c=Math.floor(f/(r.length-1)))),y[O]=i[B],t=0,n=r.length;t<n;t++)p=(h=(m=r[t]).layoutRect()).maxFlexSize||h[S],"center"===u?y[O]=Math.round(o[A]/2-h[D]/2):"stretch"===u?(y[D]=H(h[P]||0,o[A]-i[B]-i[I]),y[O]=i[B]):"end"===u&&(y[O]=o[A]-h[D]-i.top),h.flex>0&&(p+=h.flex*b),y[C]=p,y[E]=w,m.layoutRect(y),m.recalc&&m.recalc(),w+=p+c}else if(y.w=y.minW,y.h=y.minH,e.layoutRect(y),this.recalc(e),null===e._lastRect){var W=e.parent();W&&(W._lastRect=null,W.recalc())}}}),gr=Yt.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each((function(e){e.recalc&&e.recalc()}))},isNative:function(){return!0}}),pr=function(t,n){return function(t,n){var r=void 0===n?e.document:n.dom();return Wn(r)?A.none():A.from(r.querySelector(t)).map(pn.fromDom)}(n,t)},vr=function(e,t){return function(){e.execCommand("mceToggleFormat",!1,t)}},br=function(e,t,n){var r=function(e){n(e,t)};e.formatter?e.formatter.formatChanged(t,r):e.on("init",(function(){e.formatter.formatChanged(t,r)}))},yr=function(e,t){return function(n){br(e,t,(function(e){n.control.active(e)}))}},wr=function(e){var t=["alignleft","aligncenter","alignright","alignjustify"],n=[{text:"Left",icon:"alignleft",onclick:vr(e,"alignleft")},{text:"Center",icon:"aligncenter",onclick:vr(e,"aligncenter")},{text:"Right",icon:"alignright",onclick:vr(e,"alignright")},{text:"Justify",icon:"alignjustify",onclick:vr(e,"alignjustify")}];e.addMenuItem("align",{text:"Align",menu:n}),e.addButton("align",{type:"menubutton",icon:"alignleft",menu:n,onShowMenu:function(n){var r=n.control.menu;u.each(t,(function(t,n){r.items().eq(n).each((function(n){return n.active(e.formatter.match(t))}))}))},onPostRender:function(n){var r=n.control;u.each(t,(function(t,n){br(e,t,(function(e){r.icon("alignleft"),e&&r.icon(t)}))}))}}),u.each({alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},(function(t,n){e.addButton(n,{active:!1,tooltip:t[0],cmd:t[1],onPostRender:yr(e,n)})}))},xr=function(e){return e?e.split(",")[0]:""},Cr=function(e,t){return function(){var n=this;n.state.set("value",null),e.on("init nodeChange",(function(r){var o=e.queryCommandValue("FontName"),i=function(e,t){var n,r=t?t.toLowerCase():"";return u.each(e,(function(e){e.value.toLowerCase()===r&&(n=e.value)})),u.each(e,(function(e){n||xr(e.value).toLowerCase()!==xr(r).toLowerCase()||(n=e.value)})),n}(t,o);n.value(i||null),!i&&o&&n.text(xr(o))}))}},Sr=function(e){e.addButton("fontselect",(function(){var t=function(e){var t=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(e.settings.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");return u.map(t,(function(e){return{text:{raw:e[0]},value:e[1],textStyle:-1===e[1].indexOf("dings")?"font-family:"+e[1]:""}}))}(e);return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:t,fixedWidth:!0,onPostRender:Cr(e,t),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}))},Er=function(e){Sr(e)},kr=function(e,t){return/[0-9.]+px$/.test(e)?function(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}(72*parseInt(e,10)/96,t||0)+"pt":e},Nr=function(e,t,n){var r;return u.each(e,(function(e){e.value===n?r=n:e.value===t&&(r=t)})),r},Tr=function(e,t){return function(){var n=this;e.on("init nodeChange",(function(r){var o,i,a,u;if(o=e.queryCommandValue("FontSize"))for(a=3;!u&&a>=0;a--)i=kr(o,a),u=Nr(t,i,o);n.value(u||null),u||n.text(i)}))}},_r=function(e){e.addButton("fontsizeselect",(function(){var t=function(e){var t=e.settings.fontsize_formats||"8pt 10pt 12pt 14pt 18pt 24pt 36pt";return u.map(t.split(" "),(function(e){var t=e,n=e,r=e.split("=");return r.length>1&&(t=r[0],n=r[1]),{text:t,value:n}}))}(e);return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:Tr(e,t),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}))},Rr=function(e){_r(e)},Or=function(e,t){var n=t.length;return u.each(t,(function(t){t.menu&&(t.hidden=0===Or(e,t.menu));var r=t.format;r&&(t.hidden=!e.formatter.canApply(r)),t.hidden&&n--})),n},Ar=function(e,t){var n=t.items().length;return t.items().each((function(t){t.menu&&t.visible(Ar(e,t.menu)>0),!t.menu&&t.settings.menu&&t.visible(Or(e,t.settings.menu)>0);var r=t.settings.format;r&&t.visible(e.formatter.canApply(r)),t.visible()||n--})),n},Dr=function(e){var t=function(e){var t=0,n=[],r=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],o=function(e){var r=[];if(e)return u.each(e,(function(e){var i={text:e.title,icon:e.icon};if(e.items)i.menu=o(e.items);else{var a=e.format||"custom"+t++;e.format||(e.name=a,n.push(e)),i.format=a,i.cmd=e.cmd}r.push(i)})),r};return e.on("init",(function(){u.each(n,(function(t){e.formatter.register(t.name,t)}))})),{type:"menu",items:e.settings.style_formats_merge?e.settings.style_formats?o(r.concat(e.settings.style_formats)):o(r):o(e.settings.style_formats||r),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){if(this.settings.format)return e.formatter.getCssText(this.settings.format)},onPostRender:function(){var t=this;t.parent().on("show",(function(){var n,r;(n=t.settings.format)&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),(r=t.settings.cmd)&&t.active(e.queryCommandState(r))}))},onclick:function(){this.settings.format&&vr(e,this.settings.format)(),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}(e);!function(e,t){e.addMenuItem("formats",{text:"Formats",menu:t})}(e,t),function(e,t){e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:t,onShowMenu:function(){e.settings.style_formats_autohide&&Ar(e,this.menu)}})}(e,t)},Pr=function(e,t,n){return function(){var r=this;e.on("nodeChange",(function(o){var i=e.formatter,a=null;u.each(o.parents,(function(e){if(u.each(t,(function(t){if(n?i.matchNode(e,n,{value:t.value})&&(a=t.value):i.matchNode(e,t.value)&&(a=t.value),a)return!1})),a)return!1})),r.value(a)}))}},Br=function(e,t){return u.map(t,(function(t){return{text:t[0],onclick:vr(e,t[1]),textStyle:function(){return e.formatter.getCssText(t[1])}}}))},Ir=function(e){var t=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");e.addMenuItem("blockformats",{text:"Blocks",menu:Br(e,t)}),e.addButton("formatselect",function(e,t){return function(){var n=[];return u.each(t,(function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})})),{type:"listbox",text:t[0][0],values:n,fixedWidth:!0,onselect:function(t){if(t.control){var n=t.control.value();vr(e,n)()}},onPostRender:Pr(e,n)}}}(e,t))},Mr=function(e,t){var n,r;if("string"==typeof t)r=t.split(" ");else if(u.isArray(t))return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!U(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);Y.apply(t,e[n])}return t}(u.map(t,(function(t){return Mr(e,t)})));return n=u.grep(r,(function(t){return"|"===t||t in e.menuItems})),u.map(n,(function(t){return"|"===t?{text:"-"}:e.menuItems[t]}))},Lr=function(e){return e&&"-"===e.text},Fr=function(e){var t=Q(e,(function(t,n){return!Lr(t)||!Lr(e[n-1])}));return Q(t,(function(e,n){return!Lr(e)||n>0&&n<t.length-1}))},Hr=function(e){var t=e.settings.insert_button_items;return Fr(t?Mr(e,t):function(e,t){var n=[{text:"-"}],r=u.grep(e.menuItems,(function(e){return e.context===t}));return u.each(r,(function(e){"before"===e.separator&&n.push({text:"|"}),e.prependToContext?n.unshift(e):n.push(e),"after"===e.separator&&n.push({text:"|"})})),n}(e,"insert"))},zr=function(e){!function(e){e.addButton("insert",{type:"menubutton",icon:"insert",menu:[],oncreatemenu:function(){this.menu.add(Hr(e)),this.menu.renderNew()}})}(e)},Wr=function(e){!function(e){u.each({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},(function(t,n){e.addButton(n,{active:!1,tooltip:t,onPostRender:yr(e,n),onclick:vr(e,n)})}))}(e),function(e){u.each({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"],removeformat:["Clear formatting","RemoveFormat"],remove:["Remove","Delete"]},(function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}))}(e),function(e){u.each({blockquote:["Blockquote","mceBlockQuote"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"]},(function(t,n){e.addButton(n,{active:!1,tooltip:t[0],cmd:t[1],onPostRender:yr(e,n)})}))}(e)},jr=function(e){Wr(e),function(e){u.each({bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline","Meta+U"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"],newdocument:["New document","mceNewDocument"],cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"]},(function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})})),e.addMenuItem("codeformat",{text:"Code",icon:"code",onclick:vr(e,"code")})}(e)},Ur=function(e,t){return function(){var n=this,r=function(){var n="redo"===t?"hasRedo":"hasUndo";return!!e.undoManager&&e.undoManager[n]()};n.disabled(!r()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(){n.disabled(e.readonly||!r())}))}},Vr=function(e){!function(e){e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:Ur(e,"undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:Ur(e,"redo"),cmd:"redo"})}(e),function(e){e.addButton("undo",{tooltip:"Undo",onPostRender:Ur(e,"undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:Ur(e,"redo"),cmd:"redo"})}(e)},qr=function(e){return function(){var t=this;e.on("VisualAid",(function(e){t.active(e.hasVisual)})),t.active(e.hasVisual)}},$r=function(e){!function(e){e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:qr(e),cmd:"mceToggleVisualAid"})}(e)},Yr={setup:function(t){!function(e){e.rtl&&(ot.rtl=!0)}(t),function(e){e.on("mousedown progressstate",(function(){Et.hideAll()}))}(t),function(t){t.settings.ui_container&&(le.container=pr(pn.fromDom(e.document.body),t.settings.ui_container).fold(k(null),(function(e){return e.dom()})))}(t),Dt.tooltips=!le.iOS,ot.translate=function(e){return a.translate(e)},Ir(t),wr(t),jr(t),Vr(t),Rr(t),Er(t),Dr(t),$r(t),zr(t)}},Xr=Xt.extend({recalc:function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,h,g,p,v,b,y,w,x,C,S,E,k,N,T,_,R=[],O=[];t=e.settings,o=e.items().filter(":visible"),i=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(o.length)),n=Math.ceil(o.length/r),b=t.spacingH||t.spacing||0,y=t.spacingV||t.spacing||0,w=t.alignH||t.align,x=t.alignV||t.align,p=e.paddingBox,_="reverseRows"in t?t.reverseRows:e.isRtl(),w&&"string"==typeof w&&(w=[w]),x&&"string"==typeof x&&(x=[x]);for(f=0;f<r;f++)R.push(0);for(d=0;d<n;d++)O.push(0);for(d=0;d<n;d++)for(f=0;f<r&&(l=o[d*r+f]);f++)E=(c=l.layoutRect()).minW,k=c.minH,R[f]=E>R[f]?E:R[f],O[d]=k>O[d]?k:O[d];for(N=i.innerW-p.left-p.right,C=0,f=0;f<r;f++)C+=R[f]+(f>0?b:0),N-=(f>0?b:0)+R[f];for(T=i.innerH-p.top-p.bottom,S=0,d=0;d<n;d++)S+=O[d]+(d>0?y:0),T-=(d>0?y:0)+O[d];if(C+=p.left+p.right,S+=p.top+p.bottom,(s={}).minW=C+(i.w-i.innerW),s.minH=S+(i.h-i.innerH),s.contentW=s.minW-i.deltaW,s.contentH=s.minH-i.deltaH,s.minW=Math.min(s.minW,i.maxW),s.minH=Math.min(s.minH,i.maxH),s.minW=Math.max(s.minW,i.startMinWidth),s.minH=Math.max(s.minH,i.startMinHeight),!i.autoResize||s.minW===i.minW&&s.minH===i.minH){var A;i.autoResize&&((s=e.layoutRect(s)).contentW=s.minW-i.deltaW,s.contentH=s.minH-i.deltaH),A="start"===t.packV?0:T>0?Math.floor(T/n):0;var D=0,P=t.flexWidths;if(P)for(f=0;f<P.length;f++)D+=P[f];else D=r;var B=N/D;for(f=0;f<r;f++)R[f]+=P?P[f]*B:B;for(h=p.top,d=0;d<n;d++){for(m=p.left,u=O[d]+A,f=0;f<r&&(l=o[_?d*r+r-1-f:d*r+f]);f++)g=l.settings,c=l.layoutRect(),a=Math.max(R[f],c.startMinWidth),c.x=m,c.y=h,"center"===(v=g.alignH||(w?w[f]||w[0]:null))?c.x=m+a/2-c.w/2:"right"===v?c.x=m+a-c.w:"stretch"===v&&(c.w=a),"center"===(v=g.alignV||(x?x[f]||x[0]:null))?c.y=h+u/2-c.h/2:"bottom"===v?c.y=h+u-c.h:"stretch"===v&&(c.h=u),l.layoutRect(c),m+=a+b,l.recalc&&l.recalc();h+=u+y}}else if(s.w=s.minW,s.h=s.minH,e.layoutRect(s),this.recalc(e),null===e._lastRect){var I=e.parent();I&&(I._lastRect=null,I.recalc())}}}),Kr=Dt.extend({renderHtml:function(){return this.classes.add("iframe"),this.canFocus=!1,'<iframe id="'+this._id+'" class="'+this.classes+'" tabindex="-1" src="'+(this.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):S.setTimeout((function(){n.html(e)})),this}}),Gr=Dt.extend({init:function(e){this._super(e),this.classes.add("widget").add("infobox"),this.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this.classPrefix;return'<div id="'+this._id+'" class="'+this.classes+'"><div id="'+this._id+'-body">'+this.encode(this.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+e+"ico "+e+'i-help"></i></button></div></div>'},bindStates:function(){var e=this;return e.state.on("change:text",(function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()})),e.state.on("change:help",(function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()})),e._super()}}),Jr=Dt.extend({init:function(e){this._super(e),this.classes.add("widget").add("label"),this.canFocus=!1,e.multiline&&this.classes.add("autoscroll"),e.strong&&this.classes.add("strong")},initLayoutRect:function(){var e=this._super();return this.settings.multiline&&(Ce.getSize(this.getEl()).width>e.maxW&&(e.minW=e.maxW,this.classes.add("multiline")),this.getEl().style.width=e.minW+"px",e.startMinH=e.h=e.minH=Math.min(e.maxH,Ce.getSize(this.getEl()).height)),e},repaint:function(){return this.settings.multiline||(this.getEl().style.lineHeight=this.layoutRect().h+"px"),this._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e,t,n=this.settings.forId,r=this.settings.html?this.settings.html:this.encode(this.state.get("text"));return!n&&(t=this.settings.forName)&&(e=this.getRoot().find("#"+t)[0])&&(n=e._id),n?'<label id="'+this._id+'" class="'+this.classes+'"'+(n?' for="'+n+'"':"")+">"+r+"</label>":'<span id="'+this._id+'" class="'+this.classes+'">'+r+"</span>"},bindStates:function(){var e=this;return e.state.on("change:text",(function(t){e.innerHtml(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()})),e._super()}}),Qr=st.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){this._super(e),this.classes.add("toolbar")},postRender:function(){return this.items().each((function(e){e.classes.add("toolbar-item")})),this._super()}}),Zr=Qr.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}}),eo=Kt.extend({init:function(e){this._renderOpen=!0,this._super(e),e=this.settings,this.classes.add("menubtn"),e.fixedWidth&&this.classes.add("fixed-width"),this.aria("haspopup",!0),this.state.set("menu",e.menu||this.render())},showMenu:function(e){var t,n=this;if(n.menu&&n.menu.visible()&&!1!==e)return n.hideMenu();n.menu||(t=n.state.get("menu")||[],n.classes.add("opened"),t.length?t={type:"menu",animate:!0,items:t}:(t.type=t.type||"menu",t.animate=!0),t.renderTo?n.menu=t.parent(n).show().renderTo():n.menu=g.create(t).parent(n).renderTo(),n.fire("createmenu"),n.menu.reflow(),n.menu.on("cancel",(function(e){e.control.parent()===n.menu&&(e.stopPropagation(),n.focus(),n.hideMenu())})),n.menu.on("select",(function(){n.focus()})),n.menu.on("show hide",(function(e){"hide"===e.type&&e.control.parent()===n&&n.classes.remove("opened-under"),e.control===n.menu&&(n.activeMenu("show"===e.type),n.classes.toggle("opened","show"===e.type)),n.aria("expanded","show"===e.type)})).fire("show")),n.menu.show(),n.menu.layoutRect({w:n.layoutRect().w}),n.menu.repaint(),n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]);var r=n.menu.layoutRect(),o=n.$el.offset().top+n.layoutRect().h;o>r.y&&o<r.y+r.h&&n.classes.add("opened-under"),n.fire("showmenu")},hideMenu:function(){this.menu&&(this.menu.items().each((function(e){e.hideMenu&&e.hideMenu()})),this.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var t,n=this._id,r=this.classPrefix,o=this.settings.icon,i=this.state.get("text"),a="";return(t=this.settings.image)?(o="none","string"!=typeof t&&(t=e.window.getSelection?t[0]:t[1]),t=" style=\"background-image: url('"+t+"')\""):t="",i&&(this.classes.add("btn-has-text"),a='<span class="'+r+'txt">'+this.encode(i)+"</span>"),o=this.settings.icon?r+"ico "+r+"i-"+o:"",this.aria("role",this.parent()instanceof Zr?"menuitem":"button"),'<div id="'+n+'" class="'+this.classes+'" tabindex="-1" aria-labelledby="'+n+'"><button id="'+n+'-open" role="presentation" type="button" tabindex="-1">'+(o?'<i class="'+o+'"'+t+"></i>":"")+a+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var e=this;return e.on("click",(function(t){t.control===e&&function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}(t.target,e.getEl())&&(e.focus(),e.showMenu(!t.aria),t.aria&&e.menu.items().filter(":visible")[0].focus())})),e.on("mouseenter",(function(t){var n,r=t.control,o=e.parent();r&&o&&r instanceof eo&&r.parent()===o&&(o.items().filter("MenuButton").each((function(e){e.hideMenu&&e!==r&&(e.menu&&e.menu.visible()&&(n=!0),e.hideMenu())})),n&&(r.focus(),r.showMenu()))})),e._super()},bindStates:function(){var e=this;return e.state.on("change:menu",(function(){e.menu&&e.menu.remove(),e.menu=null})),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}}),to=Et.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var t=e.items,n=t.length;n--;)t[n]=u.extend({},e.itemDefaults,t[n]);this._super(e),this.classes.add("menu"),e.animate&&11!==le.ie&&this.classes.add("animate")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){this.hideAll(),this.fire("select")},load:function(){var e,t=this;function n(){t.throbber&&(t.throbber.hide(),t.throbber=null)}t.settings.itemsFactory&&(t.throbber||(t.throbber=new _t(t.getEl("body"),!0),0===t.items().length?(t.throbber.show(),t.fire("loading")):t.throbber.show(100,(function(){t.items().remove(),t.fire("loading")})),t.on("hide close",n)),t.requestTime=e=(new Date).getTime(),t.settings.itemsFactory((function(r){0!==r.length?t.requestTime===e&&(t.getEl().style.width="",t.getEl("body").style.width="",n(),t.items().remove(),t.getEl("body").innerHTML="",t.add(r),t.renderNew(),t.fire("loaded")):t.hide()})))},hideAll:function(){return this.find("menuitem").exec("hideMenu"),this._super()},preRender:function(){var e=this;return e.items().each((function(t){var n=t.settings;if(n.icon||n.image||n.selectable)return e._hasIcons=!0,!1})),e.settings.itemsFactory&&e.on("postrender",(function(){e.settings.itemsFactory&&e.load()})),e.on("show hide",(function(t){t.control===e&&("show"===t.type?S.setTimeout((function(){e.classes.add("in")}),0):e.classes.remove("in"))})),e._super()}}),no=eo.extend({init:function(e){var t,n,r,o,i=this;i._super(e),e=i.settings,i._values=t=e.values,t&&(void 0!==e.value&&function t(o){for(var a=0;a<o.length;a++){if(n=o[a].selected||e.value===o[a].value)return r=r||o[a].text,i.state.set("value",o[a].value),!0;if(o[a].menu&&t(o[a].menu))return!0}}(t),!n&&t.length>0&&(r=t[0].text,i.state.set("value",t[0].value)),i.state.set("menu",t)),i.state.set("text",e.text||r),i.classes.add("listbox"),i.on("select",(function(t){var n=t.control;o&&(t.lastControl=o),e.multiple?n.active(!n.active()):i.value(t.control.value()),o=n}))},value:function(e){if(0===arguments.length)return this.state.get("value");if(void 0===e)return this;function t(n){return K(n,(function(n){return n.menu?t(n.menu):n.value===e}))}return this.settings.values?t(this.settings.values)?this.state.set("value",e):null===e&&this.state.set("value",null):this.state.set("value",e),this},bindStates:function(){var e=this;return e.on("show",(function(t){var n,r;n=t.control,r=e.value(),n instanceof to&&n.items().each((function(e){e.hasMenus()||e.active(e.value()===r)}))})),e.state.on("change:value",(function(t){var n=function e(t,n){var r;if(t)for(var o=0;o<t.length;o++){if(t[o].value===n)return t[o];if(t[o].menu&&(r=e(t[o].menu,n)))return r}}(e.state.get("menu"),t.value);n?e.text(n.text):e.text(e.settings.text)})),e._super()}}),ro=Dt.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t;this._super(e),e=this.settings,this.classes.add("menu-item"),e.menu&&this.classes.add("menu-item-expand"),e.preview&&this.classes.add("menu-item-preview"),"-"!==(t=this.state.get("text"))&&"|"!==t||(this.classes.add("menu-item-sep"),this.aria("role","separator"),this.state.set("text","-")),e.selectable&&(this.aria("role","menuitemcheckbox"),this.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||this.classes.add("menu-item-normal"),this.on("mousedown",(function(e){e.preventDefault()})),e.menu&&!e.ariaHideMenu&&this.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e,t=this,n=t.settings,r=t.parent();if(r.items().each((function(e){e!==t&&e.hideMenu()})),n.menu){(e=t.menu)?e.show():((e=n.menu).length?e={type:"menu",items:e}:e.type=e.type||"menu",r.settings.itemDefaults&&(e.itemDefaults=r.settings.itemDefaults),(e=t.menu=g.create(e).parent(t).renderTo()).reflow(),e.on("cancel",(function(n){n.stopPropagation(),t.focus(),e.hide()})),e.on("show hide",(function(e){e.control.items&&e.control.items().each((function(e){e.active(e.settings.selected)}))})).fire("show"),e.on("hide",(function(n){n.control===e&&t.classes.remove("selected")})),e.submenu=!0),e._parentMenu=r,e.classes.add("menu-sub");var o=e.testMoveRel(t.getEl(),t.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);e.moveRel(t.getEl(),o),e.rel=o,o="menu-sub-"+o,e.classes.remove(e._lastRel).add(o),e._lastRel=o,t.classes.add("selected"),t.aria("expanded",!0)}},hideMenu:function(){return this.menu&&(this.menu.items().each((function(e){e.hideMenu&&e.hideMenu()})),this.menu.hide(),this.aria("expanded",!1)),this},renderHtml:function(){var e,t=this._id,n=this.settings,r=this.classPrefix,o=this.state.get("text"),i=this.settings.icon,a="",u=n.shortcut,s=this.encode(n.url);function c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function l(e){var t=n.match||"";return t?e.replace(new RegExp(c(t),"gi"),(function(e){return"!mce~match["+e+"]mce~match!"})):e}function f(e){return e.replace(new RegExp(c("!mce~match["),"g"),"<b>").replace(new RegExp(c("]mce~match!"),"g"),"</b>")}return i&&this.parent().classes.add("menu-has-icons"),n.image&&(a=" style=\"background-image: url('"+n.image+"')\""),u&&(u=function(e){var t,n,r={};for(r=le.mac?{alt:"&#x2325;",ctrl:"&#x2318;",shift:"&#x21E7;",meta:"&#x2318;"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)(n=r[e[t].toLowerCase()])&&(e[t]=n);return e.join("+")}(u)),i=r+"ico "+r+"i-"+(this.settings.icon||"none"),e="-"!==o?'<i class="'+i+'"'+a+"></i> ":"",o=f(this.encode(l(o))),s=f(this.encode(l(s))),'<div id="'+t+'" class="'+this.classes+'" tabindex="-1">'+e+("-"!==o?'<span id="'+t+'-text" class="'+r+'text">'+o+"</span>":"")+(u?'<div id="'+t+'-shortcut" class="'+r+'menu-shortcut">'+u+"</div>":"")+(n.menu?'<div class="'+r+'caret"></div>':"")+(s?'<div class="'+r+'menu-item-link">'+s+"</div>":"")+"</div>"},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&(r.setAttribute("style",n),e._textStyle=n)}return e.on("mouseenter click",(function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),S.requestAnimationFrame((function(){e.parent().hideAll()}))))})),e._super(),e},hover:function(){return this.parent().items().each((function(e){e.classes.remove("selected")})),this.classes.toggle("selected",!0),this},active:function(e){return function(e,t){var n=e._textStyle;if(n){var r=e.getEl("text");r.setAttribute("style",n),t&&(r.style.color="",r.style.backgroundColor="")}}(this,e),void 0!==e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}}),oo=Qt.extend({Defaults:{classes:"radio",role:"radio"}}),io=Dt.extend({renderHtml:function(){var e=this.classPrefix;return this.classes.add("resizehandle"),"both"===this.settings.direction&&this.classes.add("resizehandle-both"),this.canFocus=!1,'<div id="'+this._id+'" class="'+this.classes+'"><i class="'+e+"ico "+e+'i-resize"></i></div>'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new lt(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!==e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}});function ao(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+e[n]+'">'+e[n]+"</option>";return t}var uo=Dt.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var t=this;t._super(e),t.settings.size&&(t.size=t.settings.size),t.settings.options&&(t._options=t.settings.options),t.on("keydown",(function(e){var n;13===e.keyCode&&(e.preventDefault(),t.parents().reverse().each((function(e){if(e.toJSON)return n=e,!1})),t.fire("submit",{data:n.toJSON()}))}))},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e,t="";return e=ao(this._options),this.size&&(t=' size = "'+this.size+'"'),'<select id="'+this._id+'" class="'+this.classes+'"'+t+">"+e+"</select>"},bindStates:function(){var e=this;return e.state.on("change:options",(function(t){e.getEl().innerHTML=ao(t.value)})),e._super()}});function so(e,t,n){return e<t&&(e=t),e>n&&(e=n),e}function co(e,t,n){e.setAttribute("aria-"+t,n)}function lo(e,t){var n,r,o,i,a;"v"===e.settings.orientation?(o="top",r="height",n="h"):(o="left",r="width",n="w"),a=e.getEl("handle"),i=((e.layoutRect()[n]||100)-Ce.getSize(a)[r])*((t-e._minValue)/(e._maxValue-e._minValue))+"px",a.style[o]=i,a.style.height=e.layoutRect().h+"px",co(a,"valuenow",t),co(a,"valuetext",""+e.settings.previewFilter(t)),co(a,"valuemin",e._minValue),co(a,"valuemax",e._maxValue)}var fo=Dt.extend({init:function(e){e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),this._super(e),this.classes.add("slider"),"v"===e.orientation&&this.classes.add("vertical"),this._minValue=q(e.minValue)?e.minValue:0,this._maxValue=q(e.maxValue)?e.maxValue:100,this._initValue=this.state.get("value")},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div id="'+e+'-handle" class="'+t+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var e,t,n,r,o,i,a=this;e=a._minValue,t=a._maxValue,"v"===a.settings.orientation?(n="screenY",r="top",o="height",i="h"):(n="screenX",r="left",o="width",i="w"),a._super(),function(e,t){function n(n){var r,o;r=a.value(),r=so(r=function(e,t,n){return n*(t-e)-e}(e,t,(r+(o=e))/(t-o)+.05*n),e,t),a.value(r),a.fire("dragstart",{value:r}),a.fire("drag",{value:r}),a.fire("dragend",{value:r})}a.on("keydown",(function(e){switch(e.keyCode){case 37:case 38:n(-1);break;case 39:case 40:n(1)}}))}(e,t),function(e,t,u){var s,c,l,f,d;a._dragHelper=new lt(a._id,{handle:a._id+"-handle",start:function(e){s=e[n],c=parseInt(a.getEl("handle").style[r],10),l=(a.layoutRect()[i]||100)-Ce.getSize(u)[o],a.fire("dragstart",{value:d})},drag:function(o){var i=o[n]-s;f=so(c+i,0,l),u.style[r]=f+"px",d=e+f/l*(t-e),a.value(d),a.tooltip().text(""+a.settings.previewFilter(d)).show().moveRel(u,"bc tc"),a.fire("drag",{value:d})},stop:function(){a.tooltip().hide(),a.fire("dragend",{value:d})}})}(e,t,a.getEl("handle"))},repaint:function(){this._super(),lo(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",(function(t){lo(e,t.value)})),e._super()}}),mo=Dt.extend({renderHtml:function(){return this.classes.add("spacer"),this.canFocus=!1,'<div id="'+this._id+'" class="'+this.classes+'"></div>'}}),ho=eo.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e,t,n=this.getEl(),r=this.layoutRect();return this._super(),e=n.firstChild,t=n.lastChild,we(e).css({width:r.w-Ce.getSize(t).width,height:r.h-2}),we(t).css({height:r.h-2}),this},activeMenu:function(e){we(this.getEl().lastChild).toggleClass(this.classPrefix+"active",e)},renderHtml:function(){var t,n,r=this._id,o=this.classPrefix,i=this.state.get("icon"),a=this.state.get("text"),u=this.settings,s="";return(t=u.image)?(i="none","string"!=typeof t&&(t=e.window.getSelection?t[0]:t[1]),t=" style=\"background-image: url('"+t+"')\""):t="",i=u.icon?o+"ico "+o+"i-"+i:"",a&&(this.classes.add("btn-has-text"),s='<span class="'+o+'txt">'+this.encode(a)+"</span>"),n="boolean"==typeof u.active?' aria-pressed="'+u.active+'"':"",'<div id="'+r+'" class="'+this.classes+'" role="button"'+n+' tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(i?'<i class="'+i+'"'+t+"></i>":"")+s+'</button><button type="button" class="'+o+'open" hidefocus="1" tabindex="-1">'+(this._menuBtnText?(i?" ":"")+this._menuBtnText:"")+' <i class="'+o+'caret"></i></button></div>'},postRender:function(){var e=this.settings.onclick;return this.on("click",(function(t){var n=t.target;if(t.control===this)for(;n;){if(t.aria&&"down"!==t.aria.key||"BUTTON"===n.nodeName&&-1===n.className.indexOf("open"))return t.stopImmediatePropagation(),void(e&&e.call(this,t));n=n.parentNode}})),delete this.settings.onclick,this._super()}}),go=gr.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}}),po=pt.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var t;this.activeTabId&&(t=this.getEl(this.activeTabId),we(t).removeClass(this.classPrefix+"active"),t.setAttribute("aria-selected","false")),this.activeTabId="t"+e,(t=this.getEl("t"+e)).setAttribute("aria-selected","true"),we(t).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each((function(t,n){e!==n&&t.hide()}))},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each((function(t,o){var i=e._id+"-t"+o;t.aria("role","tabpanel"),t.aria("labelledby",i),n+='<div id="'+i+'" class="'+r+'tab" unselectable="on" role="tab" aria-controls="'+t._id+'" aria-selected="false" tabIndex="-1">'+e.encode(t.settings.title)+"</div>"})),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1"><div id="'+e._id+'-head" class="'+r+'tabs" role="tablist">'+n+'</div><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",(function(t){var n=t.target.parentNode;if(n&&n.id===e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]===t.target&&e.activateTab(r)}))},initLayoutRect:function(){var e,t,n;t=(t=Ce.getSize(this.getEl("head")).width)<0?0:t,n=0,this.items().each((function(e){t=Math.max(t,e.layoutRect().minW),n=Math.max(n,e.layoutRect().minH)})),this.items().each((function(e){e.settings.x=0,e.settings.y=0,e.settings.w=t,e.settings.h=n,e.layoutRect({x:0,y:0,w:t,h:n})}));var r=Ce.getSize(this.getEl("head")).height;return this.settings.minWidth=t,this.settings.minHeight=n+r,(e=this._super()).deltaH+=r,e.innerH=e.h-e.deltaH,e}}),vo=Dt.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",(function(e){var n;13===e.keyCode&&(e.preventDefault(),t.parents().reverse().each((function(e){if(e.toJSON)return n=e,!1})),t.fire("submit",{data:n.toJSON()}))})),t.on("keyup",(function(e){t.state.set("value",e.target.value)})))},repaint:function(){var t,n,r,o,i,a=0;t=this.getEl().style,n=this._layoutRect,i=this._lastRepaintRect||{};var u=e.document;return!this.settings.multiline&&u.all&&(!u.documentMode||u.documentMode<=8)&&(t.lineHeight=n.h-a+"px"),o=(r=this.borderBox).left+r.right+8,a=r.top+r.bottom+(this.settings.multiline?8:0),n.x!==i.x&&(t.left=n.x+"px",i.x=n.x),n.y!==i.y&&(t.top=n.y+"px",i.y=n.y),n.w!==i.w&&(t.width=n.w-o+"px",i.w=n.w),n.h!==i.h&&(t.height=n.h-a+"px",i.h=n.h),this._lastRepaintRect=i,this.fire("repaint",{},!1),this},renderHtml:function(){var e,t,n=this.settings;return e={id:this._id,hidefocus:"1"},u.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],(function(t){e[t]=n[t]})),this.disabled()&&(e.disabled="disabled"),n.subtype&&(e.type=n.subtype),(t=Ce.create(n.multiline?"textarea":"input",e)).value=this.state.get("value"),t.className=this.classes.toString(),t.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",(function(t){e.state.set("value",t.target.value),e.fire("change",t)}))},bindStates:function(){var e=this;return e.state.on("change:value",(function(t){e.getEl().value!==t.value&&(e.getEl().value=t.value)})),e.state.on("change:disabled",(function(t){e.getEl().disabled=t.value})),e._super()},remove:function(){this.$el.off(),this._super()}}),bo=function(){return{Selector:We,Collection:Ve,ReflowQueue:Qe,Control:ot,Factory:g,KeyboardNavigation:at,Container:st,DragHelper:lt,Scrollable:gt,Panel:pt,Movable:_e,Resizable:vt,FloatPanel:Et,Window:Wt,MessageBox:qt,Tooltip:At,Widget:Dt,Progress:Pt,Notification:It,Layout:Yt,AbsoluteLayout:Xt,Button:Kt,ButtonGroup:Jt,Checkbox:Qt,ComboBox:en,ColorBox:tn,PanelButton:nn,ColorButton:on,ColorPicker:un,Path:cn,ElementPath:ln,FormItem:fn,Form:dn,FieldSet:mn,FilePicker:dr,FitLayout:mr,FlexLayout:hr,FlowLayout:gr,FormatControls:Yr,GridLayout:Xr,Iframe:Kr,InfoBox:Gr,Label:Jr,Toolbar:Qr,MenuBar:Zr,MenuButton:eo,MenuItem:ro,Throbber:_t,Menu:to,ListBox:no,Radio:oo,ResizeHandle:io,SelectBox:uo,Slider:fo,Spacer:mo,SplitButton:ho,StackLayout:go,TabPanel:po,TextBox:vo,DropZone:sn,BrowseButton:Gt}},yo=function(e){e.ui?u.each(bo(),(function(t,n){e.ui[n]=t})):e.ui=bo()};u.each(bo(),(function(e,t){g.add(t,e)})),yo(window.tinymce?window.tinymce:{}),i.add("modern",(function(e){return Yr.setup(e),$t(e)}))}(window)},330:function(e,t,n){n(604)},331:function(e,t,n){n(605)},332:function(e,t,n){n(606)},333:function(e,t,n){n(607)},334:function(e,t,n){n(608)},335:function(e,t,n){n(609)},336:function(e,t,n){n(610)},337:function(e,t,n){n(611)},338:function(e,t,n){n(612)},339:function(e,t,n){n(613)},360:function(e,t,n){"use strict";(function(t){var r=n(361),o=n(362),i=n(363);e.exports=function(e){var n,u,s=[],c=1;if("string"==typeof e)if(r[e])s=r[e].slice(),u="rgb";else if("transparent"===e)c=0,u="rgb",s=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var l=(m=e.slice(1)).length;c=1,l<=4?(s=[parseInt(m[0]+m[0],16),parseInt(m[1]+m[1],16),parseInt(m[2]+m[2],16)],4===l&&(c=parseInt(m[3]+m[3],16)/255)):(s=[parseInt(m[0]+m[1],16),parseInt(m[2]+m[3],16),parseInt(m[4]+m[5],16)],8===l&&(c=parseInt(m[6]+m[7],16)/255)),s[0]||(s[0]=0),s[1]||(s[1]=0),s[2]||(s[2]=0),u="rgb"}else if(n=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var f=n[1],d="rgb"===f,m=f.replace(/a$/,"");u=m;l="cmyk"===m?4:"gray"===m?1:3;s=n[2].trim().split(/\s*,\s*/).map((function(e,t){if(/%$/.test(e))return t===l?parseFloat(e)/100:"rgb"===m?255*parseFloat(e)/100:parseFloat(e);if("h"===m[t]){if(/deg$/.test(e))return parseFloat(e);if(void 0!==a[e])return a[e]}return parseFloat(e)})),f===m&&s.push(1),c=d?1:void 0===s[l]?1:s[l],s=s.slice(0,l)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(s=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),u=e.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(e))if(o(e)){var h=i(e.r,e.red,e.R,null);null!==h?(u="rgb",s=[h,i(e.g,e.green,e.G),i(e.b,e.blue,e.B)]):(u="hsl",s=[i(e.h,e.hue,e.H),i(e.s,e.saturation,e.S),i(e.l,e.lightness,e.L,e.b,e.brightness)]),c=i(e.a,e.alpha,e.opacity,1),null!=e.opacity&&(c/=100)}else(Array.isArray(e)||t.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(e))&&(s=[e[0],e[1],e[2]],u="rgb",c=4===e.length?e[3]:1);else u="rgb",s=[e>>>16,(65280&e)>>>8,255&e];return{space:u,values:s,alpha:c}};var a={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,n(30))},361:function(e,t,n){"use strict";e.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]}},362:function(e,t,n){"use strict";var r=Object.prototype.toString;e.exports=function(e){var t;return"[object Object]"===r.call(e)&&(null===(t=Object.getPrototypeOf(e))||t===Object.getPrototypeOf({}))}},363:function(e,t){e.exports=function(){for(var e=0;e<arguments.length;e++)if(void 0!==arguments[e])return arguments[e]}},364:function(e,t,n){"use strict";var r=n(365);e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(e){var t,n,r,o,i,a=e[0]/360,u=e[1]/100,s=e[2]/100;if(0===u)return[i=255*s,i,i];t=2*s-(n=s<.5?s*(1+u):s+u-s*u),o=[0,0,0];for(var c=0;c<3;c++)(r=a+1/3*-(c-1))<0?r++:r>1&&r--,i=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,o[c]=255*i;return o}},r.hsl=function(e){var t,n,r=e[0]/255,o=e[1]/255,i=e[2]/255,a=Math.min(r,o,i),u=Math.max(r,o,i),s=u-a;return u===a?t=0:r===u?t=(o-i)/s:o===u?t=2+(i-r)/s:i===u&&(t=4+(r-o)/s),(t=Math.min(60*t,360))<0&&(t+=360),n=(a+u)/2,[t,100*(u===a?0:n<=.5?s/(u+a):s/(2-u-a)),100*n]}},365:function(e,t,n){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},46:function(e,t,n){"use strict";n.r(t);var r="top",o="bottom",i="right",a="left",u=[r,o,i,a],s=u.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),c=[].concat(u,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),l=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function f(e){return e?(e.nodeName||"").toLowerCase():null}function d(e){if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function m(e){return e instanceof d(e).Element||e instanceof Element}function h(e){return e instanceof d(e).HTMLElement||e instanceof HTMLElement}var g={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];h(o)&&f(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});h(r)&&f(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function p(e){return e.split("-")[0]}function v(e){return{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function b(e,t){var n,r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&((n=r)instanceof d(n).ShadowRoot||n instanceof ShadowRoot)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function y(e){return d(e).getComputedStyle(e)}function w(e){return["table","td","th"].indexOf(f(e))>=0}function x(e){return((m(e)?e.ownerDocument:e.document)||window.document).documentElement}function C(e){return"html"===f(e)?e:e.assignedSlot||e.parentNode||e.host||x(e)}function S(e){if(!h(e)||"fixed"===y(e).position)return null;var t=e.offsetParent;if(t){var n=x(t);if("body"===f(t)&&"static"===y(t).position&&"static"!==y(n).position)return n}return t}function E(e){for(var t=d(e),n=S(e);n&&w(n)&&"static"===y(n).position;)n=S(n);return n&&"body"===f(n)&&"static"===y(n).position?t:n||function(e){for(var t=C(e);h(t)&&["html","body"].indexOf(f(t))<0;){var n=y(t);if("none"!==n.transform||"none"!==n.perspective||n.willChange&&"auto"!==n.willChange)return t;t=t.parentNode}return null}(e)||t}function k(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function N(e,t,n){return Math.max(e,Math.min(t,n))}function T(e){return Object.assign(Object.assign({},{top:0,right:0,bottom:0,left:0}),e)}function _(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var R={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,u=e.name,s=n.elements.arrow,c=n.modifiersData.popperOffsets,l=p(n.placement),f=k(l),d=[a,i].indexOf(l)>=0?"height":"width";if(s&&c){var m=n.modifiersData[u+"#persistent"].padding,h=v(s),g="y"===f?r:a,b="y"===f?o:i,y=n.rects.reference[d]+n.rects.reference[f]-c[f]-n.rects.popper[d],w=c[f]-n.rects.reference[f],x=E(s),C=x?"y"===f?x.clientHeight||0:x.clientWidth||0:0,S=y/2-w/2,T=m[g],_=C-h[d]-m[b],R=C/2-h[d]/2+S,O=N(T,R,_),A=f;n.modifiersData[u]=((t={})[A]=O,t.centerOffset=O-R,t)}},effect:function(e){var t=e.state,n=e.options,r=e.name,o=n.element,i=void 0===o?"[data-popper-arrow]":o,a=n.padding,s=void 0===a?0:a;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&b(t.elements.popper,i)&&(t.elements.arrow=i,t.modifiersData[r+"#persistent"]={padding:T("number"!=typeof s?s:_(s,u))})},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},O={top:"auto",right:"auto",bottom:"auto",left:"auto"};function A(e){var t,n=e.popper,u=e.popperRect,s=e.placement,c=e.offsets,l=e.position,f=e.gpuAcceleration,m=e.adaptive,h=e.roundOffsets?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Math.round(t*r)/r||0,y:Math.round(n*r)/r||0}}(c):c,g=h.x,p=void 0===g?0:g,v=h.y,b=void 0===v?0:v,y=c.hasOwnProperty("x"),w=c.hasOwnProperty("y"),C=a,S=r,k=window;if(m){var N=E(n);N===d(n)&&(N=x(n)),s===r&&(S=o,b-=N.clientHeight-u.height,b*=f?1:-1),s===a&&(C=i,p-=N.clientWidth-u.width,p*=f?1:-1)}var T,_=Object.assign({position:l},m&&O);return f?Object.assign(Object.assign({},_),{},((T={})[S]=w?"0":"",T[C]=y?"0":"",T.transform=(k.devicePixelRatio||1)<2?"translate("+p+"px, "+b+"px)":"translate3d("+p+"px, "+b+"px, 0)",T)):Object.assign(Object.assign({},_),{},((t={})[S]=w?b+"px":"",t[C]=y?p+"px":"",t.transform="",t))}var D={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,u=n.roundOffsets,s=void 0===u||u,c={placement:p(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign(Object.assign({},t.styles.popper),A(Object.assign(Object.assign({},c),{},{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign(Object.assign({},t.styles.arrow),A(Object.assign(Object.assign({},c),{},{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-placement":t.placement})},data:{}},P={passive:!0};var B={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,u=void 0===a||a,s=d(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,P)})),u&&s.addEventListener("resize",n.update,P),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,P)})),u&&s.removeEventListener("resize",n.update,P)}},data:{}},I={left:"right",right:"left",bottom:"top",top:"bottom"};function M(e){return e.replace(/left|right|bottom|top/g,(function(e){return I[e]}))}var L={start:"end",end:"start"};function F(e){return e.replace(/start|end/g,(function(e){return L[e]}))}function H(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function z(e){var t=d(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function W(e){return H(x(e)).left+z(e).scrollLeft}function j(e){var t=y(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function U(e,t){void 0===t&&(t=[]);var n=function e(t){return["html","body","#document"].indexOf(f(t))>=0?t.ownerDocument.body:h(t)&&j(t)?t:e(C(t))}(e),r="body"===f(n),o=d(n),i=r?[o].concat(o.visualViewport||[],j(n)?n:[]):n,a=t.concat(i);return r?a:a.concat(U(C(i)))}function V(e){return Object.assign(Object.assign({},e),{},{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function q(e,t){return"viewport"===t?V(function(e){var t=d(e),n=x(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,u=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,u=r.offsetTop)),{width:o,height:i,x:a+W(e),y:u}}(e)):h(t)?function(e){var t=H(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):V(function(e){var t=x(e),n=z(e),r=e.ownerDocument.body,o=Math.max(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),i=Math.max(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+W(e),u=-n.scrollTop;return"rtl"===y(r||t).direction&&(a+=Math.max(t.clientWidth,r?r.clientWidth:0)-o),{width:o,height:i,x:a,y:u}}(x(e)))}function $(e,t,n){var r="clippingParents"===t?function(e){var t=U(C(e)),n=["absolute","fixed"].indexOf(y(e).position)>=0&&h(e)?E(e):e;return m(n)?t.filter((function(e){return m(e)&&b(e,n)&&"body"!==f(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce((function(t,n){var r=q(e,n);return t.top=Math.max(r.top,t.top),t.right=Math.min(r.right,t.right),t.bottom=Math.min(r.bottom,t.bottom),t.left=Math.max(r.left,t.left),t}),q(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Y(e){return e.split("-")[1]}function X(e){var t,n=e.reference,u=e.element,s=e.placement,c=s?p(s):null,l=s?Y(s):null,f=n.x+n.width/2-u.width/2,d=n.y+n.height/2-u.height/2;switch(c){case r:t={x:f,y:n.y-u.height};break;case o:t={x:f,y:n.y+n.height};break;case i:t={x:n.x+n.width,y:d};break;case a:t={x:n.x-u.width,y:d};break;default:t={x:n.x,y:n.y}}var m=c?k(c):null;if(null!=m){var h="y"===m?"height":"width";switch(l){case"start":t[m]=t[m]-(n[h]/2-u[h]/2);break;case"end":t[m]=t[m]+(n[h]/2-u[h]/2)}}return t}function K(e,t){void 0===t&&(t={});var n=t,a=n.placement,s=void 0===a?e.placement:a,c=n.boundary,l=void 0===c?"clippingParents":c,f=n.rootBoundary,d=void 0===f?"viewport":f,h=n.elementContext,g=void 0===h?"popper":h,p=n.altBoundary,v=void 0!==p&&p,b=n.padding,y=void 0===b?0:b,w=T("number"!=typeof y?y:_(y,u)),C="popper"===g?"reference":"popper",S=e.elements.reference,E=e.rects.popper,k=e.elements[v?C:g],N=$(m(k)?k:k.contextElement||x(e.elements.popper),l,d),R=H(S),O=X({reference:R,element:E,strategy:"absolute",placement:s}),A=V(Object.assign(Object.assign({},E),O)),D="popper"===g?A:R,P={top:N.top-D.top+w.top,bottom:D.bottom-N.bottom+w.bottom,left:N.left-D.left+w.left,right:D.right-N.right+w.right},B=e.modifiersData.offset;if("popper"===g&&B){var I=B[s];Object.keys(P).forEach((function(e){var t=[i,o].indexOf(e)>=0?1:-1,n=[r,o].indexOf(e)>=0?"y":"x";P[e]+=I[n]*t}))}return P}var G={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var f=n.mainAxis,d=void 0===f||f,m=n.altAxis,h=void 0===m||m,g=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,E=t.options.placement,k=p(E),N=g||(k===E||!C?[M(E)]:function(e){if("auto"===p(e))return[];var t=M(e);return[F(e),t,F(t)]}(E)),T=[E].concat(N).reduce((function(e,n){return e.concat("auto"===p(n)?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,l=n.flipVariations,f=n.allowedAutoPlacements,d=void 0===f?c:f,m=Y(r),h=m?l?s:s.filter((function(e){return Y(e)===m})):u,g=h.filter((function(e){return d.indexOf(e)>=0}));0===g.length&&(g=h);var v=g.reduce((function(t,n){return t[n]=K(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[p(n)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}(t,{placement:n,boundary:b,rootBoundary:y,padding:v,flipVariations:C,allowedAutoPlacements:S}):n)}),[]),_=t.rects.reference,R=t.rects.popper,O=new Map,A=!0,D=T[0],P=0;P<T.length;P++){var B=T[P],I=p(B),L="start"===Y(B),H=[r,o].indexOf(I)>=0,z=H?"width":"height",W=K(t,{placement:B,boundary:b,rootBoundary:y,altBoundary:w,padding:v}),j=H?L?i:a:L?o:r;_[z]>R[z]&&(j=M(j));var U=M(j),V=[];if(d&&V.push(W[I]<=0),h&&V.push(W[j]<=0,W[U]<=0),V.every((function(e){return e}))){D=B,A=!1;break}O.set(B,V)}if(A)for(var q=function(e){var t=T.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return D=t,"break"},$=C?3:1;$>0;$--){if("break"===q($))break}t.placement!==D&&(t.modifiersData[l]._skip=!0,t.placement=D,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function J(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Q(e){return[r,i,o,a].some((function(t){return e[t]>=0}))}var Z={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=K(t,{elementContext:"reference"}),u=K(t,{altBoundary:!0}),s=J(a,r),c=J(u,o,i),l=Q(s),f=Q(c);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:f},t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-reference-hidden":l,"data-popper-escaped":f})}};var ee={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,o=e.name,u=n.offset,s=void 0===u?[0,0]:u,l=c.reduce((function(e,n){return e[n]=function(e,t,n){var o=p(e),u=[a,r].indexOf(o)>=0?-1:1,s="function"==typeof n?n(Object.assign(Object.assign({},t),{},{placement:e})):n,c=s[0],l=s[1];return c=c||0,l=(l||0)*u,[a,i].indexOf(o)>=0?{x:l,y:c}:{x:c,y:l}}(n,t.rects,s),e}),{}),f=l[t.placement],d=f.x,m=f.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=m),t.modifiersData[o]=l}};var te={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=X({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var ne={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,u=e.name,s=n.mainAxis,c=void 0===s||s,l=n.altAxis,f=void 0!==l&&l,d=n.boundary,m=n.rootBoundary,h=n.altBoundary,g=n.padding,b=n.tether,y=void 0===b||b,w=n.tetherOffset,x=void 0===w?0:w,C=K(t,{boundary:d,rootBoundary:m,padding:g,altBoundary:h}),S=p(t.placement),T=Y(t.placement),_=!T,R=k(S),O="x"===R?"y":"x",A=t.modifiersData.popperOffsets,D=t.rects.reference,P=t.rects.popper,B="function"==typeof x?x(Object.assign(Object.assign({},t.rects),{},{placement:t.placement})):x,I={x:0,y:0};if(A){if(c){var M="y"===R?r:a,L="y"===R?o:i,F="y"===R?"height":"width",H=A[R],z=A[R]+C[M],W=A[R]-C[L],j=y?-P[F]/2:0,U="start"===T?D[F]:P[F],V="start"===T?-P[F]:-D[F],q=t.elements.arrow,$=y&&q?v(q):{width:0,height:0},X=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},G=X[M],J=X[L],Q=N(0,D[F],$[F]),Z=_?D[F]/2-j-Q-G-B:U-Q-G-B,ee=_?-D[F]/2+j+Q+J+B:V+Q+J+B,te=t.elements.arrow&&E(t.elements.arrow),ne=te?"y"===R?te.clientTop||0:te.clientLeft||0:0,re=t.modifiersData.offset?t.modifiersData.offset[t.placement][R]:0,oe=A[R]+Z-re-ne,ie=A[R]+ee-re,ae=N(y?Math.min(z,oe):z,H,y?Math.max(W,ie):W);A[R]=ae,I[R]=ae-H}if(f){var ue="x"===R?r:a,se="x"===R?o:i,ce=A[O],le=N(ce+C[ue],ce,ce-C[se]);A[O]=le,I[O]=le-ce}t.modifiersData[u]=I}},requiresIfExists:["offset"]};function re(e,t,n){void 0===n&&(n=!1);var r,o,i=x(t),a=H(e),u=h(t),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(u||!u&&!n)&&(("body"!==f(t)||j(i))&&(s=(r=t)!==d(r)&&h(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:z(r)),h(t)?((c=H(t)).x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=W(i))),{x:a.left+s.scrollLeft-c.x,y:a.top+s.scrollTop-c.y,width:a.width,height:a.height}}function oe(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(o){n.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var o=t.get(r);o&&e(o)}})),r.push(o)}(e)})),r}var ie={placement:"bottom",modifiers:[],strategy:"absolute"};function ae(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function ue(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?ie:o;return function(e,t,n){void 0===n&&(n=i);var o,a,u={placement:"bottom",orderedModifiers:[],options:Object.assign(Object.assign({},ie),i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},s=[],c=!1,f={state:u,setOptions:function(n){d(),u.options=Object.assign(Object.assign(Object.assign({},i),u.options),n),u.scrollParents={reference:m(e)?U(e):e.contextElement?U(e.contextElement):[],popper:U(t)};var o=function(e){var t=oe(e);return l.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign(Object.assign(Object.assign({},n),t),{},{options:Object.assign(Object.assign({},n.options),t.options),data:Object.assign(Object.assign({},n.data),t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,u.options.modifiers)));return u.orderedModifiers=o.filter((function(e){return e.enabled})),u.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:u,name:t,instance:f,options:r});s.push(i||function(){})}})),f.update()},forceUpdate:function(){if(!c){var e=u.elements,t=e.reference,n=e.popper;if(ae(t,n)){u.rects={reference:re(t,E(n),"fixed"===u.options.strategy),popper:v(n)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach((function(e){return u.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<u.orderedModifiers.length;r++)if(!0!==u.reset){var o=u.orderedModifiers[r],i=o.fn,a=o.options,s=void 0===a?{}:a,l=o.name;"function"==typeof i&&(u=i({state:u,options:s,name:l,instance:f})||u)}else u.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(e){f.forceUpdate(),e(u)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(o())}))}))),a}),destroy:function(){d(),c=!0}};if(!ae(e,t))return f;function d(){s.forEach((function(e){return e()})),s=[]}return f.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),f}}var se=ue(),ce=ue({defaultModifiers:[B,te,D,g,ee,G,ne,R,Z]}),le=ue({defaultModifiers:[B,te,D,g]});n.d(t,"top",(function(){return r})),n.d(t,"bottom",(function(){return o})),n.d(t,"right",(function(){return i})),n.d(t,"left",(function(){return a})),n.d(t,"auto",(function(){return"auto"})),n.d(t,"basePlacements",(function(){return u})),n.d(t,"start",(function(){return"start"})),n.d(t,"end",(function(){return"end"})),n.d(t,"clippingParents",(function(){return"clippingParents"})),n.d(t,"viewport",(function(){return"viewport"})),n.d(t,"popper",(function(){return"popper"})),n.d(t,"reference",(function(){return"reference"})),n.d(t,"variationPlacements",(function(){return s})),n.d(t,"placements",(function(){return c})),n.d(t,"beforeRead",(function(){return"beforeRead"})),n.d(t,"read",(function(){return"read"})),n.d(t,"afterRead",(function(){return"afterRead"})),n.d(t,"beforeMain",(function(){return"beforeMain"})),n.d(t,"main",(function(){return"main"})),n.d(t,"afterMain",(function(){return"afterMain"})),n.d(t,"beforeWrite",(function(){return"beforeWrite"})),n.d(t,"write",(function(){return"write"})),n.d(t,"afterWrite",(function(){return"afterWrite"})),n.d(t,"modifierPhases",(function(){return l})),n.d(t,"applyStyles",(function(){return g})),n.d(t,"arrow",(function(){return R})),n.d(t,"computeStyles",(function(){return D})),n.d(t,"eventListeners",(function(){return B})),n.d(t,"flip",(function(){return G})),n.d(t,"hide",(function(){return Z})),n.d(t,"offset",(function(){return ee})),n.d(t,"popperOffsets",(function(){return te})),n.d(t,"preventOverflow",(function(){return ne})),n.d(t,"popperGenerator",(function(){return ue})),n.d(t,"detectOverflow",(function(){return K})),n.d(t,"createPopperBase",(function(){return se})),n.d(t,"createPopper",(function(){return ce})),n.d(t,"createPopperLite",(function(){return le}))},604:function(e,t){!function(e){"use strict";var t,n,r,o,i,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),s=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),c=tinymce.util.Tools.resolve("tinymce.util.VK"),l=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=function(e){return e&&"BR"===e.nodeName},h=function(e){return e&&3===e.nodeType},g=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},p=function(e){return e&&/^(OL|UL)$/.test(e.nodeName)},v=function(e){return e&&/^(DT|DD)$/.test(e.nodeName)},b=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},y=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},w=m,x=function(e,t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]},C=function(e,t){return e&&e.nodeName in t},S=function(e,t){return!!m(t)&&!(!e.isBlock(t.nextSibling)||m(t.previousSibling))},E=function(e,t,n){var r=e.isEmpty(t);return!(n&&e.select("span[data-mce-type=bookmark]",t).length>0)&&r},k=function(e,t){return e.isChildOf(t,e.getRoot())},N=function(e,t){if(h(e))return{container:e,offset:t};var n=u.getNode(e,t);return h(n)?{container:n,offset:t>=e.childNodes.length?n.data.length:0}:n.previousSibling&&h(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&h(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:e,offset:t}},T=function(e){var t=e.cloneRange(),n=N(e.startContainer,e.startOffset);t.setStart(n.container,n.offset);var r=N(e.endContainer,e.endOffset);return t.setEnd(r.container,r.offset),t},_=d.DOM,R=function(e){var t={},n=function(n){var r,o,i;o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"],1===o.nodeType&&(r=_.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(i=Math.min(i,o.childNodes.length-1),n?o.insertBefore(r,o.childNodes[i]):_.insertAfter(r,o.childNodes[i])):o.appendChild(r),o=r,i=0),t[n?"startContainer":"endContainer"]=o,t[n?"startOffset":"endOffset"]=i};return n(!0),e.collapsed||n(),t},O=function(e){function t(t){var n,r,o;n=o=e[t?"startContainer":"endContainer"],r=e[t?"startOffset":"endOffset"],n&&(1===n.nodeType&&(r=function(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t===e)return n;1===t.nodeType&&"bookmark"===t.getAttribute("data-mce-type")||n++,t=t.nextSibling}return-1}(n),n=n.parentNode,_.remove(o),!n.hasChildNodes()&&_.isBlock(n)&&n.appendChild(_.create("br"))),e[t?"startContainer":"endContainer"]=n,e[t?"startOffset":"endOffset"]=r)}t(!0),t();var n=_.createRng();return n.setStart(e.startContainer,e.startOffset),e.endContainer&&n.setEnd(e.endContainer,e.endOffset),T(n)},A=function(){},D=function(e){return function(){return e}},P=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return!e.apply(null,t)}},B=D(!1),I=D(!0),M=function(){return L},L=function(){var e=function(e){return e.isNone()},t=function(e){return e()},n=function(e){return e},r={fold:function(e,t){return e()},is:B,isSome:B,isNone:I,getOr:n,getOrThunk:t,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:D(null),getOrUndefined:D(void 0),or:n,orThunk:t,map:M,each:A,bind:M,exists:B,forall:I,filter:M,equals:e,equals_:e,toArray:function(){return[]},toString:D("none()")};return Object.freeze&&Object.freeze(r),r}(),F=function(e){var t=D(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:I,isNone:B,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return F(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:L},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(B,(function(t){return n(e,t)}))}};return o},H={some:F,none:M,from:function(e){return null==e?L:F(e)}},z=function(e){return function(t){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(t)===e}},W=z("string"),j=z("array"),U=z("boolean"),V=z("function"),q=z("number"),$=Array.prototype.slice,Y=Array.prototype.push,X=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},K=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)},G=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},J=function(e,t,n){return K(e,(function(e){n=t(n,e)})),n},Q=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n))return H.some(o)}return H.none()},Z=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!j(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);Y.apply(t,e[n])}return t}(X(e,t))},ee=function(e){return 0===e.length?H.none():H.some(e[0])},te=function(e){return 0===e.length?H.none():H.some(e[e.length-1])},ne=(V(Array.from)&&Array.from,void 0!==e.window?e.window:Function("return this;")()),re=function(e,t){return function(e,t){for(var n=null!=t?t:ne,r=0;r<e.length&&null!=n;++r)n=n[e[r]];return n}(e.split("."),t)},oe=function(e,t){var n=function(e,t){return re(e,t)}(e,t);if(null==n)throw new Error(e+" not available on this browser");return n},ie=function(e){return function(e){return oe("HTMLElement",e)}(re("ownerDocument.defaultView",e)).prototype.isPrototypeOf(e)},ae=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),ue=function(e){var t=e.selection.getStart(!0);return e.dom.getParent(t,"OL,UL,DL",ce(e,t))},se=function(e){var t=e.selection.getSelectedBlocks();return f.grep(function(e,t){var n=f.map(t,(function(t){var n=e.dom.getParent(t,"li,dd,dt",ce(e,t));return n||t}));return ae.unique(n)}(e,t),(function(e){return b(e)}))},ce=function(e,t){var n=e.dom.getParents(t,"TD,TH");return n.length>0?n[0]:e.getBody()},le=function(e,t){var n=e.dom.getParents(t,"ol,ul",ce(e,t));return te(n)},fe=function(e,t){var n=X(t,(function(t){return le(e,t).getOr(t)}));return ae.unique(n)},de={isList:function(e){var t=ue(e);return ie(t)},getParentList:ue,getSelectedSubLists:function(e){var t=ue(e),n=e.selection.getSelectedBlocks();return function(e,t){return e&&1===t.length&&t[0]===e}(t,n)?function(e){return f.grep(e.querySelectorAll("ol,ul,dl"),(function(e){return g(e)}))}(t):f.grep(n,(function(e){return g(e)&&t!==e}))},getSelectedListItems:se,getClosestListRootElm:ce,getSelectedDlItems:function(e){return G(se(e),v)},getSelectedListRoots:function(e){var t=function(e){var t=le(e,e.selection.getStart()),n=G(e.selection.getSelectedBlocks(),p);return t.toArray().concat(n)}(e);return fe(e,t)}},me=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:D(e)}},he={fromHtml:function(t,n){var r=(n||e.document).createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw e.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return me(r.childNodes[0])},fromTag:function(t,n){var r=(n||e.document).createElement(t);return me(r)},fromText:function(t,n){var r=(n||e.document).createTextNode(t);return me(r)},fromDom:me,fromPoint:function(e,t,n){var r=e.dom();return H.from(r.elementFromPoint(t,n)).map(me)}},ge=function(e,t,n){return e.isSome()&&t.isSome()?H.some(n(e.getOrDie(),t.getOrDie())):H.none()},pe=Object.keys,ve=function(){return oe("Node")},be=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},ye=function(e,t){return be(e,t,ve().DOCUMENT_POSITION_CONTAINED_BY)},we=function(){return xe(0,0)},xe=function(e,t){return{major:e,minor:t}},Ce={nu:xe,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?we():function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return xe(r(1),r(2))}(e,n)},unknown:we},Se=function(e,t){return function(){return t===e}},Ee=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Se("Edge",t),isChrome:Se("Chrome",t),isIE:Se("IE",t),isOpera:Se("Opera",t),isFirefox:Se("Firefox",t),isSafari:Se("Safari",t)}},ke={unknown:function(){return Ee({current:void 0,version:Ce.unknown()})},nu:Ee,edge:D("Edge"),chrome:D("Chrome"),ie:D("IE"),opera:D("Opera"),firefox:D("Firefox"),safari:D("Safari")},Ne=function(e,t){return function(){return t===e}},Te=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Ne("Windows",t),isiOS:Ne("iOS",t),isAndroid:Ne("Android",t),isOSX:Ne("OSX",t),isLinux:Ne("Linux",t),isSolaris:Ne("Solaris",t),isFreeBSD:Ne("FreeBSD",t)}},_e={unknown:function(){return Te({current:void 0,version:Ce.unknown()})},nu:Te,windows:D("Windows"),ios:D("iOS"),android:D("Android"),linux:D("Linux"),osx:D("OSX"),solaris:D("Solaris"),freebsd:D("FreeBSD")},Re=function(e,t){var n=String(t).toLowerCase();return Q(e,(function(e){return e.search(n)}))},Oe=function(e,t){return Re(e,t).map((function(e){var n=Ce.detect(e.versionRegexes,t);return{current:e.name,version:n}}))},Ae=function(e,t){return Re(e,t).map((function(e){var n=Ce.detect(e.versionRegexes,t);return{current:e.name,version:n}}))},De=function(e,t){return-1!==e.indexOf(t)},Pe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Be=function(e){return function(t){return De(t,e)}},Ie=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return De(e,"edge/")&&De(e,"chrome")&&De(e,"safari")&&De(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Pe],search:function(e){return De(e,"chrome")&&!De(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return De(e,"msie")||De(e,"trident")}},{name:"Opera",versionRegexes:[Pe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Be("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Be("firefox")},{name:"Safari",versionRegexes:[Pe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(De(e,"safari")||De(e,"mobile/"))&&De(e,"applewebkit")}}],Me=[{name:"Windows",search:Be("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return De(e,"iphone")||De(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Be("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Be("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Be("linux"),versionRegexes:[]},{name:"Solaris",search:Be("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Be("freebsd"),versionRegexes:[]}],Le={browsers:D(Ie),oses:D(Me)},Fe=function(e){var t=Le.browsers(),n=Le.oses(),r=Oe(t,e).fold(ke.unknown,ke.nu),o=Ae(n,e).fold(_e.unknown,_e.nu),i=function(e,t,n){var r=e.isiOS()&&!0===/ipad/i.test(n),o=e.isiOS()&&!r,i=e.isAndroid()&&3===e.version.major,a=e.isAndroid()&&4===e.version.major,u=r||i||a&&!0===/mobile/i.test(n),s=e.isiOS()||e.isAndroid(),c=s&&!u,l=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n);return{isiPad:D(r),isiPhone:D(o),isTablet:D(u),isPhone:D(c),isTouch:D(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:D(l)}}(o,r,e);return{browser:r,os:o,deviceType:i}},He={detect:(t=function(){var t=e.navigator.userAgent;return Fe(t)},r=!1,function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return r||(r=!0,n=t.apply(null,e)),n})},ze=(e.Node.ATTRIBUTE_NODE,e.Node.CDATA_SECTION_NODE,e.Node.COMMENT_NODE,e.Node.DOCUMENT_NODE,e.Node.DOCUMENT_TYPE_NODE,e.Node.DOCUMENT_FRAGMENT_NODE,e.Node.ELEMENT_NODE),We=(e.Node.TEXT_NODE,e.Node.PROCESSING_INSTRUCTION_NODE,e.Node.ENTITY_REFERENCE_NODE,e.Node.ENTITY_NODE,e.Node.NOTATION_NODE,ze),je=function(e,t){return e.dom()===t.dom()},Ue=He.detect().browser.isIE()?function(e,t){return ye(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Ve=function(e,t){var n=e.dom();if(n.nodeType!==We)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},qe=function(e){return H.from(e.dom().parentNode).map(he.fromDom)},$e=function(e){return X(e.dom().childNodes,he.fromDom)},Ye=function(e,t){var n=e.dom().childNodes;return H.from(n[t]).map(he.fromDom)},Xe=function(e){return Ye(e,0)},Ke=function(e){return Ye(e,e.dom().childNodes.length-1)},Ge=(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}("element","offset"),function(e,t){qe(e).each((function(n){n.dom().insertBefore(t.dom(),e.dom())}))}),Je=function(e,t){e.dom().appendChild(t.dom())},Qe=function(e,t){K(t,(function(t){Je(e,t)}))},Ze=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},et=function(e){return e.dom().nodeName.toLowerCase()},tt=(o=ze,function(e){return function(e){return e.dom().nodeType}(e)===o}),nt=function(t,n){var r=t.dom();!function(e,t){for(var n=pe(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}}(n,(function(t,n){!function(t,n,r){if(!(W(r)||U(r)||q(r)))throw e.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,r+"")}(r,n,t)}))},rt=function(e){return J(e.dom().attributes,(function(e,t){return e[t.name]=t.value,e}),{})},ot=function(t,n,r){if(!W(r))throw e.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",t),new Error("CSS value must be a string: "+r);(function(e){return void 0!==e.style&&V(e.style.getPropertyValue)})(t)&&t.style.setProperty(n,r)},it=function(e){return function(e,t){return he.fromDom(e.dom().cloneNode(t))}(e,!0)},at=function(e,t){var n=function(e,t){var n=he.fromTag(t),r=rt(e);return nt(n,r),n}(e,t);Ge(e,n);var r=$e(e);return Qe(n,r),Ze(e),n},ut=function(e,t){Je(e.item,t.list)},st=function(e,t){var n={list:he.fromTag(t,e),item:he.fromTag("li",e)};return Je(n.list,n.item),n},ct=function(e,t,n){var r=t.slice(0,n.depth);return te(r).each((function(t){!function(e,t){Je(e.list,t),e.item=t}(t,function(e,t,n){var r=he.fromTag("li",e);return nt(r,t),Qe(r,n),r}(e,n.itemAttributes,n.content)),function(e,t){et(e.list)!==t.listType&&(e.list=at(e.list,t.listType)),nt(e.list,t.listAttributes)}(t,n)})),r},lt=function(e,t,n){var r,o=function(e,t,n){for(var r=[],o=0;o<n;o++)r.push(st(e,t.listType));return r}(e,n,n.depth-t.length);return function(e){for(var t=1;t<e.length;t++)ut(e[t-1],e[t])}(o),function(e,t){for(var n=0;n<e.length-1;n++)r=e[n].item,o="list-style-type",i="none",a=void 0,a=r.dom(),ot(a,o,i);var r,o,i,a;te(e).each((function(e){nt(e.list,t.listAttributes),nt(e.item,t.itemAttributes),Qe(e.item,t.content)}))}(o,n),r=o,ge(te(t),ee(r),ut),t.concat(o)},ft=function(e){return Ve(e,"OL,UL")},dt=function(e){return Xe(e).map(ft).getOr(!1)},mt=function(e){return e.depth>0},ht=function(e){return e.isSelected},gt=function(e){var t=$e(e),n=Ke(e).map(ft).getOr(!1)?t.slice(0,-1):t;return X(n,it)},pt=Object.prototype.hasOwnProperty,vt=(i=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var a in o)pt.call(o,a)&&(n[a]=i(n[a],o[a]))}return n}),bt=function(e){K(e,(function(t,n){(function(e,t){for(var n=e[t].depth,r=t-1;r>=0;r--){if(e[r].depth===n)return H.some(e[r]);if(e[r].depth<n)break}return H.none()})(e,n).each((function(e){var n,r;r=e,(n=t).listType=r.listType,n.listAttributes=vt({},r.listAttributes)}))}))},yt=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return yt(n())}}},wt=function(e,t,n,r){return Xe(r).filter(ft).fold((function(){t.each((function(e){je(e.start,r)&&n.set(!0)}));var o=function(e,t,n){return qe(e).filter(tt).map((function(r){return{depth:t,isSelected:n,content:gt(e),itemAttributes:rt(e),listAttributes:rt(r),listType:et(r)}}))}(r,e,n.get());t.each((function(e){je(e.end,r)&&n.set(!1)}));var i=Ke(r).filter(ft).map((function(r){return xt(e,t,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return xt(e,t,n,r)}))},xt=function(e,t,n,r){return Z($e(r),(function(r){return(ft(r)?xt:wt)(e+1,t,n,r)}))},Ct=tinymce.util.Tools.resolve("tinymce.Env"),St=function(e,t){var n,r,o,i,a=e.dom,u=e.schema.getBlockElements(),s=a.createFragment();if(e.settings.forced_root_block&&(o=e.settings.forced_root_block),o&&((r=a.create(o)).tagName===e.settings.forced_root_block&&a.setAttribs(r,e.settings.forced_root_block_attrs),C(t.firstChild,u)||s.appendChild(r)),t)for(;n=t.firstChild;){var c=n.nodeName;i||"SPAN"===c&&"bookmark"===n.getAttribute("data-mce-type")||(i=!0),C(n,u)?(s.appendChild(n),r=null):o?(r||(r=a.create(o),s.appendChild(r)),r.appendChild(n)):s.appendChild(n)}return e.settings.forced_root_block?i||Ct.ie&&!(Ct.ie>10)||r.appendChild(a.create("br",{"data-mce-bogus":"1"})):s.appendChild(a.create("br")),s},Et=function(t,n){return X(n,(function(n){var r,o,i,a=(r=n.content,i=(o||e.document).createDocumentFragment(),K(r,(function(e){i.appendChild(e.dom())})),he.fromDom(i));return he.fromDom(St(t,a.dom()))}))},kt=function(e,t){return bt(t),function(e,t){var n=J(t,(function(t,n){return n.depth>t.length?lt(e,t,n):ct(e,t,n)}),[]);return ee(n).map((function(e){return e.list}))}(e.contentDocument,t).toArray()},Nt=function(e){var t=X(de.getSelectedListItems(e),he.fromDom);return ge(Q(t,P(dt)),Q(function(e){var t=$.call(e,0);return t.reverse(),t}(t),P(dt)),(function(e,t){return{start:e,end:t}}))},Tt=function(e,t,n){var r=function(e,t){var n=yt(!1);return X(e,(function(e){return{sourceList:e,entries:xt(0,t,n,e)}}))}(t,Nt(e));K(r,(function(t){var r,o;!function(e,t){K(G(e,ht),(function(e){return function(e,t){switch(e){case"Indent":t.depth++;break;case"Outdent":t.depth--;break;case"Flatten":t.depth=0}}(t,e)}))}(t.entries,n),r=t.sourceList,o=function(e,t){return Z(function(e,t){if(0===e.length)return[];for(var n=t(e[0]),r=[],o=[],i=0,a=e.length;i<a;i++){var u=e[i],s=t(u);s!==n&&(r.push(o),o=[]),n=s,o.push(u)}return 0!==o.length&&r.push(o),r}(t,mt),(function(t){return ee(t).map(mt).getOr(!1)?kt(e,t):Et(e,t)}))}(e,t.entries),K(o,(function(e){Ge(r,e)})),Ze(t.sourceList)}))},_t=d.DOM,Rt=function(e,t,n){var r,o,i,a,u,s;for(i=_t.select('span[data-mce-type="bookmark"]',t),u=St(e,n),(r=_t.createRng()).setStartAfter(n),r.setEndAfter(t),a=(o=r.extractContents()).firstChild;a;a=a.firstChild)if("LI"===a.nodeName&&e.dom.isEmpty(a)){_t.remove(a);break}e.dom.isEmpty(o)||_t.insertAfter(o,t),_t.insertAfter(u,t),E(e.dom,n.parentNode)&&(s=n.parentNode,f.each(i,(function(e){s.parentNode.insertBefore(e,n.parentNode)})),_t.remove(s)),_t.remove(n),E(e.dom,t)&&_t.remove(t)},Ot=function(e){Ve(e,"dt")&&at(e,"dd")},At=function(e,t,n){K(n,"Indent"===t?Ot:function(t){return function(e,t){Ve(t,"dd")?at(t,"dt"):Ve(t,"dt")&&qe(t).each((function(n){return Rt(e,n.dom(),t.dom())}))}(e,t)})},Dt=function(e,t){var n=X(de.getSelectedListRoots(e),he.fromDom),r=X(de.getSelectedDlItems(e),he.fromDom),o=!1;if(n.length||r.length){var i=e.selection.getBookmark();Tt(e,n,t),At(e,t,r),e.selection.moveToBookmark(i),e.selection.setRng(T(e.selection.getRng())),e.nodeChanged(),o=!0}return o},Pt=function(e){return Dt(e,"Indent")},Bt=function(e){return Dt(e,"Outdent")},It=function(e){return Dt(e,"Flatten")},Mt=function(e,t){f.each(t,(function(t,n){e.setAttribute(n,t)}))},Lt=function(e,t,n){!function(e,t,n){var r=n["list-style-type"]?n["list-style-type"]:null;e.setStyle(t,"list-style-type",r)}(e,t,n),function(e,t,n){Mt(t,n["list-attributes"]),f.each(e.select("li",t),(function(e){Mt(e,n["list-item-attributes"])}))}(e,t,n)},Ft=function(e,t,n,r){var o,i;for(o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&w(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(x(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},Ht=function(e,t,n){void 0===n&&(n={});var r,o=e.selection.getRng(!0),i="LI",a=de.getClosestListRootElm(e,e.selection.getStart(!0)),u=e.dom;"false"!==u.getContentEditable(e.selection.getNode())&&("DL"===(t=t.toUpperCase())&&(i="DT"),r=R(o),f.each(function(e,t,n){for(var r,o=[],i=e.dom,a=Ft(e,t,!0,n),u=Ft(e,t,!1,n),s=[],c=a;c&&(s.push(c),c!==u);c=c.nextSibling);return f.each(s,(function(t){if(x(e,t))return o.push(t),void(r=null);if(i.isBlock(t)||w(t))return w(t)&&i.remove(t),void(r=null);var a=t.nextSibling;l.isBookmarkNode(t)&&(x(e,a)||!a&&t.parentNode===n)?r=null:(r||(r=i.create("p"),t.parentNode.insertBefore(r,t),o.push(r)),r.appendChild(t))})),o}(e,o,a),(function(r){var o,a;(a=r.previousSibling)&&g(a)&&a.nodeName===t&&function(e,t,n){var r=e.getStyle(t,"list-style-type"),o=n?n["list-style-type"]:"";return r===(o=null===o?"":o)}(u,a,n)?(o=a,r=u.rename(r,i),a.appendChild(r)):(o=u.create(t),r.parentNode.insertBefore(o,r),o.appendChild(r),r=u.rename(r,i)),function(e,t,n){f.each(n,(function(n){var r;return e.setStyle(t,((r={})[n]="",r))}))}(u,r,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),Lt(u,o,n),Wt(e.dom,o)})),e.selection.setRng(O(r)))},zt=function(e,t,n){return function(e,t){return e&&t&&g(e)&&e.nodeName===t.nodeName}(t,n)&&function(e,t,n){return e.getStyle(t,"list-style-type",!0)===e.getStyle(n,"list-style-type",!0)}(e,t,n)&&(r=n,t.className===r.className);var r},Wt=function(e,t){var n,r;if(n=t.nextSibling,zt(e,t,n)){for(;r=n.firstChild;)t.appendChild(r);e.remove(n)}if(n=t.previousSibling,zt(e,t,n)){for(;r=n.lastChild;)t.insertBefore(r,t.firstChild);e.remove(n)}},jt=function(e,t,n,r,o){if(t.nodeName!==r||Ut(o)){var i=R(e.selection.getRng(!0));f.each([t].concat(n),(function(t){!function(e,t,n,r){if(t.nodeName!==n){var o=e.rename(t,n);Lt(e,o,r)}else Lt(e,t,r)}(e.dom,t,r,o)})),e.selection.setRng(O(i))}else It(e)},Ut=function(e){return"list-style-type"in e},Vt={toggleList:function(e,t,n){var r=de.getParentList(e),o=de.getSelectedSubLists(e);n=n||{},r&&o.length>0?jt(e,r,o,t,n):function(e,t,n,r){if(t!==e.getBody())if(t)if(t.nodeName!==n||Ut(r)){var o=R(e.selection.getRng(!0));Lt(e.dom,t,r),Wt(e.dom,e.dom.rename(t,n)),e.selection.setRng(O(o))}else It(e);else Ht(e,n,r)}(e,r,t,n)},mergeWithAdjacentLists:Wt},qt=d.DOM,$t=function(e,t){var n,r=t.parentNode;"LI"===r.nodeName&&r.firstChild===t&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(t),E(e,r)&&qt.remove(r)):qt.setStyle(r,"listStyleType","none")),g(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(t)},Yt=function(e,t){f.each(f.grep(e.select("ol,ul",t)),(function(t){$t(e,t)}))},Xt=function(e,t,n,r){var o,i,a=t.startContainer,c=t.startOffset;if(3===a.nodeType&&(n?c<a.data.length:c>0))return a;for(o=e.schema.getNonEmptyElements(),1===a.nodeType&&(a=u.getNode(a,c)),i=new s(a,r),n&&S(e.dom,a)&&i.next();a=i[n?"next":"prev2"]();){if("LI"===a.nodeName&&!a.hasChildNodes())return a;if(o[a.nodeName])return a;if(3===a.nodeType&&a.data.length>0)return a}},Kt=function(e,t){var n=t.childNodes;return 1===n.length&&!g(n[0])&&e.isBlock(n[0])},Gt=function(e,t,n){var r,o;if(o=Kt(e,n)?n.firstChild:n,function(e,t){Kt(e,t)&&e.remove(t.firstChild,!0)}(e,t),!E(e,t,!0))for(;r=t.firstChild;)o.appendChild(r)},Jt=function(e,t,n){var r,o,i=t.parentNode;if(k(e,t)&&k(e,n)){g(n.lastChild)&&(o=n.lastChild),i===n.lastChild&&w(i.previousSibling)&&e.remove(i.previousSibling),(r=n.lastChild)&&w(r)&&t.hasChildNodes()&&e.remove(r),E(e,n,!0)&&e.$(n).empty(),Gt(e,t,n),o&&n.appendChild(o);var a=Ue(he.fromDom(n),he.fromDom(t))?e.getParents(t,g,n):[];e.remove(t),K(a,(function(t){E(e,t)&&t!==e.getRoot()&&e.remove(t)}))}},Qt=function(e,t,n,r){var o=e.dom;if(o.isEmpty(r))!function(e,t,n){e.dom.$(n).empty(),Jt(e.dom,t,n),e.selection.setCursorLocation(n)}(e,n,r);else{var i=R(t);Jt(o,n,r),e.selection.setRng(O(i))}},Zt=function(e,t){var n,r,o,i=e.dom,a=e.selection,u=a.getStart(),s=de.getClosestListRootElm(e,u),c=i.getParent(a.getStart(),"LI",s);if(c){if((n=c.parentNode)===e.getBody()&&E(i,n))return!0;if(r=T(a.getRng(!0)),(o=i.getParent(Xt(e,r,t,s),"LI",s))&&o!==c)return t?Qt(e,r,o,c):function(e,t,n,r){var o=R(t);Jt(e.dom,n,r);var i=O(o);e.selection.setRng(i)}(e,r,c,o),!0;if(!o&&!t)return It(e),!0}return!1},en=function(e,t){return Zt(e,t)||function(e,t){var n=e.dom,r=e.selection.getStart(),o=de.getClosestListRootElm(e,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var a=T(e.selection.getRng(!0)),u=n.getParent(Xt(e,a,t,o),"LI",o);if(u)return e.undoManager.transact((function(){!function(e,t,n){var r=e.getParent(t.parentNode,e.isBlock,n);e.remove(t),r&&e.isEmpty(r)&&e.remove(r)}(n,i,o),Vt.mergeWithAdjacentLists(n,u.parentNode),e.selection.select(u,!0),e.selection.collapse(t)})),!0}return!1}(e,t)},tn=function(e,t){return e.selection.isCollapsed()?en(e,t):function(e){var t=e.selection.getStart(),n=de.getClosestListRootElm(e,t);return!!(e.dom.getParent(t,"LI,DT,DD",n)||de.getSelectedListItems(e).length>0)&&(e.undoManager.transact((function(){e.execCommand("Delete"),Yt(e.dom,e.getBody())})),!0)}(e)},nn=function(e){e.on("keydown",(function(t){t.keyCode===c.BACKSPACE?tn(e,!1)&&t.preventDefault():t.keyCode===c.DELETE&&tn(e,!0)&&t.preventDefault()}))},rn=tn,on=function(e){return{backspaceDelete:function(t){rn(e,t)}}},an=function(e,t){return function(){var n=e.dom.getParent(e.selection.getStart(),"UL,OL,DL");return n&&n.nodeName===t}},un=function(e){e.on("BeforeExecCommand",(function(t){var n=t.command.toLowerCase();"indent"===n?Pt(e):"outdent"===n&&Bt(e)})),e.addCommand("InsertUnorderedList",(function(t,n){Vt.toggleList(e,"UL",n)})),e.addCommand("InsertOrderedList",(function(t,n){Vt.toggleList(e,"OL",n)})),e.addCommand("InsertDefinitionList",(function(t,n){Vt.toggleList(e,"DL",n)})),e.addCommand("RemoveList",(function(){It(e)})),e.addQueryStateHandler("InsertUnorderedList",an(e,"UL")),e.addQueryStateHandler("InsertOrderedList",an(e,"OL")),e.addQueryStateHandler("InsertDefinitionList",an(e,"DL"))},sn=function(e){return e.getParam("lists_indent_on_tab",!0)},cn=function(e){sn(e)&&function(e){e.on("keydown",(function(t){t.keyCode!==c.TAB||c.metaKeyPressed(t)||e.undoManager.transact((function(){(t.shiftKey?Bt(e):Pt(e))&&t.preventDefault()}))}))}(e),nn(e)},ln=function(e,t){return function(n){var r=n.control;e.on("NodeChange",(function(e){var n=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}(e.parents,y),o=-1!==n?e.parents.slice(0,n):e.parents,i=f.grep(o,g);r.active(i.length>0&&i[0].nodeName===t)}))}},fn=function(e){(function(e,t){var n=e.settings.plugins?e.settings.plugins:"";return-1!==f.inArray(n.split(/[ ,]/),t)})(e,"advlist")||(e.addButton("numlist",{active:!1,title:"Numbered list",cmd:"InsertOrderedList",onPostRender:ln(e,"OL")}),e.addButton("bullist",{active:!1,title:"Bullet list",cmd:"InsertUnorderedList",onPostRender:ln(e,"UL")})),e.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent"})};a.add("lists",(function(e){return cn(e),fn(e),un(e),on(e)}))}(window)},605:function(e,t){!function(e){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(){},r=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e(t.apply(null,n))}},o=function(e){return function(){return e}},i=function(e){return e};function a(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}var u=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return!e.apply(null,t)}},s=o(!1),c=o(!0),l=function(){return f},f=function(){var e=function(e){return e.isNone()},t=function(e){return e()},r=function(e){return e},i={fold:function(e,t){return e()},is:s,isSome:s,isNone:c,getOr:r,getOrThunk:t,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(void 0),or:r,orThunk:t,map:l,each:n,bind:l,exists:s,forall:c,filter:l,equals:e,equals_:e,toArray:function(){return[]},toString:o("none()")};return Object.freeze&&Object.freeze(i),i}(),d=function(e){var t=o(e),n=function(){return i},r=function(t){return t(e)},i={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:c,isNone:s,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return d(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?i:f},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(s,(function(t){return n(e,t)}))}};return i},m={some:d,none:l,from:function(e){return null==e?f:d(e)}},h=function(e){return function(t){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(t)===e}},g=h("string"),p=h("array"),v=h("boolean"),b=h("function"),y=h("number"),w=Array.prototype.slice,x=Array.prototype.indexOf,C=Array.prototype.push,S=function(e,t){return n=e,r=t,x.call(n,r)>-1;var n,r},E=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1},k=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},N=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)},T=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},_=function(e,t,n){return function(e,t){for(var n=e.length-1;n>=0;n--)t(e[n],n)}(e,(function(e){n=t(n,e)})),n},R=function(e,t,n){return N(e,(function(e){n=t(n,e)})),n},O=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n))return m.some(o)}return m.none()},A=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return m.some(n);return m.none()},D=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!p(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);C.apply(t,e[n])}return t},P=function(e,t){var n=k(e,t);return D(n)},B=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n))return!1;return!0},I=function(e){var t=w.call(e,0);return t.reverse(),t},M=(b(Array.from)&&Array.from,Object.keys),L=function(e,t){for(var n=M(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}},F=function(e,t){return H(e,(function(e,n){return{k:n,v:t(e,n)}}))},H=function(e,t){var n={};return L(e,(function(e,r){var o=t(e,r);n[o.k]=o.v})),n},z=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(e.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+t.length+" arguments");var r={};return N(e,(function(e,n){r[e]=o(t[n])})),r}},W=function(e){return e.slice(0).sort()},j=function(e,t){throw new Error("All required keys ("+W(e).join(", ")+") were not specified. Specified keys were: "+W(t).join(", ")+".")},U=function(e){throw new Error("Unsupported keys for object: "+W(e).join(", "))},V=function(e,t){if(!p(t))throw new Error("The "+e+" fields must be an array. Was: "+t+".");N(t,(function(t){if(!g(t))throw new Error("The value "+t+" in the "+e+" fields was not a string.")}))},q=function(e){var t=W(e);O(t,(function(e,n){return n<t.length-1&&e===t[n+1]})).each((function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+t.join(", ")+"].")}))},$=function(e,t){var n=e.concat(t);if(0===n.length)throw new Error("You must specify at least one required or optional field.");return V("required",e),V("optional",t),q(n),function(r){var i=M(r);B(e,(function(e){return S(i,e)}))||j(e,i);var a=T(i,(function(e){return!S(n,e)}));a.length>0&&U(a);var u={};return N(e,(function(e){u[e]=o(r[e])})),N(t,(function(e){u[e]=o(Object.prototype.hasOwnProperty.call(r,e)?m.some(r[e]):m.none())})),u}},Y=(e.Node.ATTRIBUTE_NODE,e.Node.CDATA_SECTION_NODE,e.Node.COMMENT_NODE),X=e.Node.DOCUMENT_NODE,K=(e.Node.DOCUMENT_TYPE_NODE,e.Node.DOCUMENT_FRAGMENT_NODE,e.Node.ELEMENT_NODE),G=e.Node.TEXT_NODE,J=(e.Node.PROCESSING_INSTRUCTION_NODE,e.Node.ENTITY_REFERENCE_NODE,e.Node.ENTITY_NODE,e.Node.NOTATION_NODE,void 0!==e.window?e.window:Function("return this;")()),Q=function(e,t){return function(e,t){for(var n=null!=t?t:J,r=0;r<e.length&&null!=n;++r)n=n[e[r]];return n}(e.split("."),t)},Z=function(e,t){var n=function(e,t){return Q(e,t)}(e,t);if(null==n)throw new Error(e+" not available on this browser");return n},ee=function(e){return e.dom().nodeName.toLowerCase()},te=function(e){return e.dom().nodeType},ne=function(e){return function(t){return te(t)===e}},re=function(e){return te(e)===Y||"#comment"===ee(e)},oe=ne(K),ie=ne(G),ae=function(t,n,r){if(!(g(r)||v(r)||y(r)))throw e.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,r+"")},ue=function(e,t,n){ae(e.dom(),t,n)},se=function(e,t){var n=e.dom();L(t,(function(e,t){ae(n,t,e)}))},ce=function(e,t){var n=e.dom().getAttribute(t);return null===n?void 0:n},le=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},fe=function(e,t){e.dom().removeAttribute(t)},de=function(e){return R(e.dom().attributes,(function(e,t){return e[t.name]=t.value,e}),{})},me=function(e,t){return-1!==e.indexOf(t)},he=function(e){return void 0!==e.style&&b(e.style.getPropertyValue)},ge=function(e){var t,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,t=e.apply(null,r)),t}},pe=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:o(e)}},ve={fromHtml:function(t,n){var r=(n||e.document).createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw e.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return pe(r.childNodes[0])},fromTag:function(t,n){var r=(n||e.document).createElement(t);return pe(r)},fromText:function(t,n){var r=(n||e.document).createTextNode(t);return pe(r)},fromDom:pe,fromPoint:function(e,t,n){var r=e.dom();return m.from(r.elementFromPoint(t,n)).map(pe)}},be=function(e){var t=ie(e)?e.dom().parentNode:e.dom();return null!=t&&t.ownerDocument.body.contains(t)},ye=ge((function(){return we(ve.fromDom(e.document))})),we=function(e){var t=e.dom().body;if(null==t)throw new Error("Body is not available yet");return ve.fromDom(t)},xe=function(t,n,r){if(!g(r))throw e.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",t),new Error("CSS value must be a string: "+r);he(t)&&t.style.setProperty(n,r)},Ce=function(e,t,n){var r=e.dom();xe(r,t,n)},Se=function(e,t){var n=e.dom();L(t,(function(e,t){xe(n,t,e)}))},Ee=function(t,n){var r=t.dom(),o=e.window.getComputedStyle(r).getPropertyValue(n),i=""!==o||be(t)?o:ke(r,n);return null===i?void 0:i},ke=function(e,t){return he(e)?e.style.getPropertyValue(t):""},Ne=function(e,t){var n=e.dom(),r=ke(n,t);return m.from(r).filter((function(e){return e.length>0}))},Te=function(e,t){!function(e,t){he(e)&&e.style.removeProperty(t)}(e.dom(),t),le(e,"style")&&""===ce(e,"style").replace(/^\s+|\s+$/g,"")&&fe(e,"style")},_e=function(){return Z("Node")},Re=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},Oe=function(e,t){return Re(e,t,_e().DOCUMENT_POSITION_CONTAINED_BY)},Ae=function(){return De(0,0)},De=function(e,t){return{major:e,minor:t}},Pe={nu:De,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Ae():function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return De(r(1),r(2))}(e,n)},unknown:Ae},Be=function(e,t){return function(){return t===e}},Ie=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Be("Edge",t),isChrome:Be("Chrome",t),isIE:Be("IE",t),isOpera:Be("Opera",t),isFirefox:Be("Firefox",t),isSafari:Be("Safari",t)}},Me={unknown:function(){return Ie({current:void 0,version:Pe.unknown()})},nu:Ie,edge:o("Edge"),chrome:o("Chrome"),ie:o("IE"),opera:o("Opera"),firefox:o("Firefox"),safari:o("Safari")},Le=function(e,t){return function(){return t===e}},Fe=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Le("Windows",t),isiOS:Le("iOS",t),isAndroid:Le("Android",t),isOSX:Le("OSX",t),isLinux:Le("Linux",t),isSolaris:Le("Solaris",t),isFreeBSD:Le("FreeBSD",t)}},He={unknown:function(){return Fe({current:void 0,version:Pe.unknown()})},nu:Fe,windows:o("Windows"),ios:o("iOS"),android:o("Android"),linux:o("Linux"),osx:o("OSX"),solaris:o("Solaris"),freebsd:o("FreeBSD")},ze=function(e,t){var n=String(t).toLowerCase();return O(e,(function(e){return e.search(n)}))},We=function(e,t){return ze(e,t).map((function(e){var n=Pe.detect(e.versionRegexes,t);return{current:e.name,version:n}}))},je=function(e,t){return ze(e,t).map((function(e){var n=Pe.detect(e.versionRegexes,t);return{current:e.name,version:n}}))},Ue=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ve=function(e){return function(t){return me(t,e)}},qe=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return me(e,"edge/")&&me(e,"chrome")&&me(e,"safari")&&me(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ue],search:function(e){return me(e,"chrome")&&!me(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return me(e,"msie")||me(e,"trident")}},{name:"Opera",versionRegexes:[Ue,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ve("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Ve("firefox")},{name:"Safari",versionRegexes:[Ue,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(me(e,"safari")||me(e,"mobile/"))&&me(e,"applewebkit")}}],$e=[{name:"Windows",search:Ve("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return me(e,"iphone")||me(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ve("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Ve("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ve("linux"),versionRegexes:[]},{name:"Solaris",search:Ve("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ve("freebsd"),versionRegexes:[]}],Ye={browsers:o(qe),oses:o($e)},Xe=function(e){var t=Ye.browsers(),n=Ye.oses(),r=We(t,e).fold(Me.unknown,Me.nu),i=je(n,e).fold(He.unknown,He.nu),a=function(e,t,n){var r=e.isiOS()&&!0===/ipad/i.test(n),i=e.isiOS()&&!r,a=e.isAndroid()&&3===e.version.major,u=e.isAndroid()&&4===e.version.major,s=r||a||u&&!0===/mobile/i.test(n),c=e.isiOS()||e.isAndroid(),l=c&&!s,f=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n);return{isiPad:o(r),isiPhone:o(i),isTablet:o(s),isPhone:o(l),isTouch:o(c),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:o(f)}}(i,r,e);return{browser:r,os:i,deviceType:a}},Ke={detect:ge((function(){var t=e.navigator.userAgent;return Xe(t)}))},Ge=K,Je=X,Qe=function(e,t){var n=e.dom();if(n.nodeType!==Ge)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},Ze=function(e){return e.nodeType!==Ge&&e.nodeType!==Je||0===e.childElementCount},et=function(e,t){return e.dom()===t.dom()},tt=Ke.detect().browser.isIE()?function(e,t){return Oe(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},nt=Qe,rt=function(e){return ve.fromDom(e.dom().ownerDocument)},ot=function(e){return m.from(e.dom().parentNode).map(ve.fromDom)},it=function(e,t){for(var n=b(t)?t:s,r=e.dom(),o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=ve.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o},at=function(e){return m.from(e.dom().previousSibling).map(ve.fromDom)},ut=function(e){return m.from(e.dom().nextSibling).map(ve.fromDom)},st=function(e){return k(e.dom().childNodes,ve.fromDom)},ct=function(e,t){var n=e.dom().childNodes;return m.from(n[t]).map(ve.fromDom)},lt=(z("element","offset"),function(e,t){ot(e).each((function(n){n.dom().insertBefore(t.dom(),e.dom())}))}),ft=function(e,t){ut(e).fold((function(){ot(e).each((function(e){mt(e,t)}))}),(function(e){lt(e,t)}))},dt=function(e,t){(function(e){return ct(e,0)})(e).fold((function(){mt(e,t)}),(function(n){e.dom().insertBefore(t.dom(),n.dom())}))},mt=function(e,t){e.dom().appendChild(t.dom())},ht=function(e,t){lt(e,t),mt(t,e)},gt=function(e,t){N(t,(function(n,r){var o=0===r?e:t[r-1];ft(o,n)}))},pt=function(e,t){N(t,(function(t){mt(e,t)}))},vt=function(e){e.dom().textContent="",N(st(e),(function(e){bt(e)}))},bt=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},yt=function(e){var t,n=st(e);n.length>0&&(t=e,N(n,(function(e){lt(t,e)}))),bt(e)},wt=(z("width","height"),z("width","height"),z("rows","columns")),xt=z("row","column"),Ct=(z("x","y"),z("element","rowspan","colspan")),St=z("element","rowspan","colspan","isNew"),Et=z("element","rowspan","colspan","row","column"),kt=z("element","cells","section"),Nt=z("element","isNew"),Tt=z("element","cells","section","isNew"),_t=z("cells","section"),Rt=z("details","section"),Ot=z("startRow","startCol","finishRow","finishCol"),At=function(e,t){var n=[];return N(st(e),(function(e){t(e)&&(n=n.concat([e])),n=n.concat(At(e,t))})),n},Dt=function(e,t,n){return function(e,t,n){return T(it(e,n),t)}(e,(function(e){return Qe(e,t)}),n)},Pt=function(e,t){return function(e,t){return T(st(e),t)}(e,(function(e){return Qe(e,t)}))},Bt=function(t,n){return function(t,n){var r=void 0===n?e.document:n.dom();return Ze(r)?[]:k(r.querySelectorAll(t),ve.fromDom)}(n,t)};function It(e,t,n,r,o){return e(n,r)?m.some(n):b(o)&&o(n)?m.none():t(n,r,o)}var Mt=function(e,t,n){for(var r=e.dom(),i=b(n)?n:o(!1);r.parentNode;){r=r.parentNode;var a=ve.fromDom(r);if(t(a))return m.some(a);if(i(a))break}return m.none()},Lt=function(e,t,n){return Mt(e,(function(e){return Qe(e,t)}),n)},Ft=function(e,t){return function(e,t){return O(e.dom().childNodes,(function(e){return t(ve.fromDom(e))})).map(ve.fromDom)}(e,(function(e){return Qe(e,t)}))},Ht=function(t,n){return function(t,n){var r=void 0===n?e.document:n.dom();return Ze(r)?m.none():m.from(r.querySelector(t)).map(ve.fromDom)}(n,t)},zt=function(e,t,n){return It(Qe,Lt,e,t,n)},Wt=function(e,t,n){return P(st(e),(function(e){return Qe(e,t)?n(e)?[e]:[]:Wt(e,t,n)}))},jt={firstLayer:function(e,t){return Wt(e,t,o(!0))},filterFirstLayer:Wt},Ut=function(e,t,n){return void 0===n&&(n=s),n(t)?m.none():S(e,ee(t))?m.some(t):Lt(t,e.join(","),(function(e){return Qe(e,"table")||n(e)}))},Vt=function(e,t){return ot(t).map((function(t){return Pt(t,e)}))},qt=(a(Vt,"th,td"),a(Vt,"tr"),function(e,t){return Ut(["td","th"],e,t)}),$t=function(e){return jt.firstLayer(e,"th,td")},Yt=function(e,t){return zt(e,"table",t)},Xt=function(e){return jt.firstLayer(e,"tr")},Kt=function(e){var t=Xt(e);return k(t,(function(e){var t=e,n=ot(t).map((function(e){var t=ee(e);return"tfoot"===t||"thead"===t||"tbody"===t?t:"tbody"})).getOr("tbody"),r=k($t(e),(function(e){var t=le(e,"rowspan")?parseInt(ce(e,"rowspan"),10):1,n=le(e,"colspan")?parseInt(ce(e,"colspan"),10):1;return Ct(e,t,n)}));return kt(t,r,n)}))},Gt=function(e,t){return k(e,(function(e){var n=k($t(e),(function(e){var t=le(e,"rowspan")?parseInt(ce(e,"rowspan"),10):1,n=le(e,"colspan")?parseInt(ce(e,"colspan"),10):1;return Ct(e,t,n)}));return kt(e,n,t.section())}))},Jt=function(e,t){return e+","+t},Qt=function(e,t){var n=P(e.all(),(function(e){return e.cells()}));return T(n,t)},Zt={generate:function(e){var t={},n=[],r=e.length,i=0;N(e,(function(e,r){var o=[];N(e.cells(),(function(e){for(var n=0;void 0!==t[Jt(r,n)];)n++;for(var a=Et(e.element(),e.rowspan(),e.colspan(),r,n),u=0;u<e.colspan();u++)for(var s=0;s<e.rowspan();s++){var c=n+u,l=Jt(r+s,c);t[l]=a,i=Math.max(i,c+1)}o.push(a)})),n.push(kt(e.element(),o,e.section()))}));var a=wt(r,i);return{grid:o(a),access:o(t),all:o(n)}},getAt:function(e,t,n){var r=e.access()[Jt(t,n)];return void 0!==r?m.some(r):m.none()},findItem:function(e,t,n){var r=Qt(e,(function(e){return n(t,e.element())}));return r.length>0?m.some(r[0]):m.none()},filterItems:Qt,justCells:function(e){var t=k(e.all(),(function(e){return e.cells()}));return D(t)}},en=z("minRow","minCol","maxRow","maxCol"),tn=function(e,t,n){var r=e[n].element(),o=ve.fromTag("td");mt(o,ve.fromTag("br")),(t?mt:dt)(r,o)},nn=function(e,t){var n=function(e){return Qe(e.element(),t)},r=Kt(e),o=Zt.generate(r),i=function(e,t){var n=e.grid().columns(),r=e.grid().rows(),o=n,i=0,a=0;return L(e.access(),(function(e){if(t(e)){var n=e.row(),u=n+e.rowspan()-1,s=e.column(),c=s+e.colspan()-1;n<r?r=n:u>i&&(i=u),s<o?o=s:c>a&&(a=c)}})),en(r,o,i,a)}(o,n),a="th:not("+t+"),td:not("+t+")",u=jt.filterFirstLayer(e,"th,td",(function(e){return Qe(e,a)}));return N(u,bt),function(e,t,n,r){for(var o=t.grid().columns(),i=t.grid().rows(),a=0;a<i;a++)for(var u=!1,s=0;s<o;s++)a<n.minRow()||a>n.maxRow()||s<n.minCol()||s>n.maxCol()||(Zt.getAt(t,a,s).filter(r).isNone()?tn(e,u,a):u=!0)}(r,o,i,n),function(e,t){var n=T(jt.firstLayer(e,"tr"),(function(e){return 0===e.dom().childElementCount}));N(n,bt),t.minCol()!==t.maxCol()&&t.minRow()!==t.maxRow()||N(jt.firstLayer(e,"th,td"),(function(e){fe(e,"rowspan"),fe(e,"colspan")})),fe(e,"width"),fe(e,"height"),Te(e,"width"),Te(e,"height")}(e,i),e},rn=function(e,t){var n=function(t){return e(t)?m.from(t.dom().nodeValue):m.none()};return{get:function(r){if(!e(r))throw new Error("Can only get "+t+" value of a "+t+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom().nodeValue=r}}}(ie,"text"),on=function(e){return rn.get(e)},an=function(e){return rn.getOption(e)},un=function(e,t){rn.set(e,t)},sn=function(e){return"img"===ee(e)?1:an(e).fold((function(){return st(e).length}),(function(e){return e.length}))},cn=["img","br"],ln=function(e){return an(e).filter((function(e){return 0!==e.trim().length||e.indexOf(" ")>-1})).isSome()||S(cn,ee(e))},fn=function(e){return t=ln,(n=function(e){for(var r=0;r<e.childNodes.length;r++){var o=ve.fromDom(e.childNodes[r]);if(t(o))return m.some(o);var i=n(e.childNodes[r]);if(i.isSome())return i}return m.none()})(e.dom());var t,n},dn=function(e){return mn(e,ln)},mn=function(e,t){var n=function(e){for(var r=st(e),o=r.length-1;o>=0;o--){var i=r[o];if(t(i))return m.some(i);var a=n(i);if(a.isSome())return a}return m.none()};return n(e)},hn=function(e,t){return ve.fromDom(e.dom().cloneNode(t))},gn=function(e){return hn(e,!1)},pn=function(e){return hn(e,!0)},vn=function(e,t){var n=function(e,t){var n=ve.fromTag(t),r=de(e);return se(n,r),n}(e,t),r=st(pn(e));return pt(n,r),n},bn=function(){var e=ve.fromTag("td");return mt(e,ve.fromTag("br")),e},yn=function(e,t,n){var r=vn(e,t);return L(n,(function(e,t){null===e?fe(r,t):ue(r,t,e)})),r},wn=function(e){return e},xn=function(e){return function(){return ve.fromTag("tr",e.dom())}},Cn=function(e,t,n){return{row:xn(t),cell:function(t){var r,o,i,a,u=rt(t.element()),s=ve.fromTag(ee(t.element()),u.dom()),c=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),l=c.length>0?function(e,t,n){return fn(e).map((function(r){var o=n.join(","),i=Dt(r,o,(function(t){return et(t,e)}));return _(i,(function(e,t){var n=gn(t);return fe(n,"contenteditable"),mt(e,n),n}),t)})).getOr(t)}(t.element(),s,c):s;return mt(l,ve.fromTag("br")),r=t.element(),o=s,i=r.dom(),a=o.dom(),he(i)&&he(a)&&(a.style.cssText=i.style.cssText),Te(s,"height"),1!==t.colspan()&&Te(t.element(),"width"),e(t.element(),s),s},replace:yn,gap:bn}},Sn=function(e){return{row:xn(e),cell:bn,replace:wn,gap:bn}},En=function(e,t){return t.column()>=e.startCol()&&t.column()+t.colspan()-1<=e.finishCol()&&t.row()>=e.startRow()&&t.row()+t.rowspan()-1<=e.finishRow()},kn=function(e,t){var n=t.column(),r=t.column()+t.colspan()-1,o=t.row(),i=t.row()+t.rowspan()-1;return n<=e.finishCol()&&r>=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},Nn=function(e,t){for(var n=!0,r=a(En,t),o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)n=n&&Zt.getAt(e,o,i).exists(r);return n?m.some(t):m.none()},Tn=function(e,t,n){var r=Zt.findItem(e,t,et),o=Zt.findItem(e,n,et);return r.bind((function(e){return o.map((function(t){return n=e,r=t,Ot(Math.min(n.row(),r.row()),Math.min(n.column(),r.column()),Math.max(n.row()+n.rowspan()-1,r.row()+r.rowspan()-1),Math.max(n.column()+n.colspan()-1,r.column()+r.colspan()-1));var n,r}))}))},_n=Tn,Rn=function(e,t,n){return Tn(e,t,n).bind((function(t){return Nn(e,t)}))},On=function(e,t,n,r){return Zt.findItem(e,t,et).bind((function(t){var o=n>0?t.row()+t.rowspan()-1:t.row(),i=r>0?t.column()+t.colspan()-1:t.column();return Zt.getAt(e,o+n,i+r).map((function(e){return e.element()}))}))},An=function(e,t,n){return _n(e,t,n).map((function(t){var n=Zt.filterItems(e,a(kn,t));return k(n,(function(e){return e.element()}))}))},Dn=function(e,t){return Zt.findItem(e,t,(function(e,t){return tt(t,e)})).map((function(e){return e.element()}))},Pn=function(e){var t=Kt(e);return Zt.generate(t)},Bn=function(e,t,n){return Yt(e).bind((function(r){var o=Pn(r);return On(o,e,t,n)}))},In=function(e,t,n){var r=Pn(e);return An(r,t,n)},Mn=function(e,t,n,r,o){var i=Pn(e),a=et(e,n)?m.some(t):Dn(i,t),u=et(e,o)?m.some(r):Dn(i,r);return a.bind((function(e){return u.bind((function(t){return An(i,e,t)}))}))},Ln=function(e,t,n){var r=Pn(e);return Rn(r,t,n)},Fn=["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 Hn(){return{up:o({selector:Lt,closest:zt,predicate:Mt,all:it}),down:o({selector:Bt,predicate:At}),styles:o({get:Ee,getRaw:Ne,set:Ce,remove:Te}),attrs:o({get:ce,set:ue,remove:fe,copyTo:function(e,t){var n=de(e);se(t,n)}}),insert:o({before:lt,after:ft,afterAll:gt,append:mt,appendAll:pt,prepend:dt,wrap:ht}),remove:o({unwrap:yt,remove:bt}),create:o({nu:ve.fromTag,clone:function(e){return ve.fromDom(e.dom().cloneNode(!1))},text:ve.fromText}),query:o({comparePosition:function(e,t){return e.dom().compareDocumentPosition(t.dom())},prevSibling:at,nextSibling:ut}),property:o({children:st,name:ee,parent:ot,document:function(e){return e.dom().ownerDocument},isText:ie,isComment:re,isElement:oe,getText:on,setText:un,isBoundary:function(e){return!!oe(e)&&("body"===ee(e)||S(Fn,ee(e)))},isEmptyTag:function(e){return!!oe(e)&&S(["br","img","hr","input"],ee(e))}}),eq:et,is:nt}}var zn=z("left","right"),Wn=z("first","second","splits"),jn=function(e,t,n){var r=e.property().children(t);return A(r,a(e.eq,n)).map((function(e){return{before:o(r.slice(0,e)),after:o(r.slice(e+1))}}))},Un=function(e,t,n,r){var o=t(e,n);return _(r,(function(n,r){var o=t(e,r);return Vn(e,n,o)}),o)},Vn=function(e,t,n){return t.bind((function(t){return n.filter(a(e.eq,t))}))},qn=function(e,t){return a(e.eq,t)},$n=function(e,t,n,r){void 0===r&&(r=s);var i=[t].concat(e.up().all(t)),a=[n].concat(e.up().all(n)),u=function(e){return A(e,r).fold((function(){return e}),(function(t){return e.slice(0,t+1)}))},c=u(i),l=u(a),f=O(c,(function(t){return E(l,qn(e,t))}));return{firstpath:o(c),secondpath:o(l),shared:o(f)}},Yn={sharedOne:function(e,t,n){return n.length>0?function(e,t,n,r){return r(e,t,n[0],n.slice(1))}(e,t,n,Un):m.none()},subset:function(e,t,n){var r=$n(e,t,n);return r.shared().bind((function(t){return function(e,t,n,r){var o=e.property().children(t);if(e.eq(t,n[0]))return m.some([n[0]]);if(e.eq(t,r[0]))return m.some([r[0]]);var i=function(n){var r=I(n),i=A(r,qn(e,t)).getOr(-1),a=i<r.length-1?r[i+1]:r[i];return A(o,qn(e,a))},a=i(n),u=i(r);return a.bind((function(e){return u.map((function(t){var n=Math.min(e,t),r=Math.max(e,t);return o.slice(n,r+1)}))}))}(e,t,r.firstpath(),r.secondpath())}))},ancestors:$n,breakToLeft:function(e,t,n){return jn(e,t,n).map((function(r){var o=e.create().clone(t);return e.insert().appendAll(o,r.before().concat([n])),e.insert().appendAll(t,r.after()),e.insert().before(t,o),zn(o,t)}))},breakToRight:function(e,t,n){return jn(e,t,n).map((function(n){var r=e.create().clone(t);return e.insert().appendAll(r,n.after()),e.insert().after(t,r),zn(t,r)}))},breakPath:function(e,t,n,r){var o=function(t,i,a){var u=Wn(t,m.none(),a);return n(t)?Wn(t,i,a):e.property().parent(t).bind((function(i){return r(e,i,t).map((function(e){var t=[{first:e.left,second:e.right}],r=n(i)?i:e.left();return o(r,m.some(e.right()),a.concat(t))}))})).getOr(u)};return o(t,m.none(),[])}},Xn=Hn(),Kn=function(e,t){return Yn.sharedOne(Xn,(function(t,n){return e(n)}),t)},Gn=function(e,t,n){return Yn.ancestors(Xn,e,t,n)},Jn={create:$(["boxes","start","finish"],[])},Qn=function(e){return Lt(e,"table")},Zn=function(e,t,n){var r=function(e){return function(t){return void 0!==n&&n(t)||et(t,e)}};return et(e,t)?m.some(Jn.create({boxes:m.some([e]),start:e,finish:t})):Qn(e).bind((function(o){return Qn(t).bind((function(i){if(et(o,i))return m.some(Jn.create({boxes:In(o,e,t),start:e,finish:t}));if(tt(o,i)){var a=(u=Dt(t,"td,th",r(o))).length>0?u[u.length-1]:t;return m.some(Jn.create({boxes:Mn(o,e,o,t,i),start:e,finish:a}))}if(tt(i,o)){var u,s=(u=Dt(e,"td,th",r(i))).length>0?u[u.length-1]:e;return m.some(Jn.create({boxes:Mn(i,e,o,t,i),start:e,finish:s}))}return Gn(e,t).shared().bind((function(a){return zt(a,"table",n).bind((function(n){var a=Dt(t,"td,th",r(n)),u=a.length>0?a[a.length-1]:t,s=Dt(e,"td,th",r(n)),c=s.length>0?s[s.length-1]:e;return m.some(Jn.create({boxes:Mn(n,e,o,t,i),start:c,finish:u}))}))}))}))}))},er=Zn,tr=function(e,t){var n=Bt(e,t);return n.length>0?m.some(n):m.none()},nr=function(e,t,n,r,i){return function(e,t){return O(e,(function(e){return Qe(e,t)}))}(e,i).bind((function(e){return Bn(e,t,n).bind((function(e){return function(e,t){return Lt(e,"table").bind((function(n){return Ht(n,t).bind((function(t){return Zn(t,e).bind((function(e){return e.boxes().map((function(t){return{boxes:o(t),start:o(e.start()),finish:o(e.finish())}}))}))}))}))}(e,r)}))}))},rr=function(e,t,n){return Ht(e,t).bind((function(t){return Ht(e,n).bind((function(e){return Kn(Qn,[t,e]).map((function(n){return{first:o(t),last:o(e),table:o(n)}}))}))}))},or=function(e,t){return tr(e,t)},ir=function(e,t,n){return rr(e,t,n).bind((function(t){var n=function(t){return et(e,t)},r=Lt(t.first(),"thead,tfoot,tbody,table",n),o=Lt(t.last(),"thead,tfoot,tbody,table",n);return r.bind((function(e){return o.bind((function(n){return et(e,n)?Ln(t.table(),t.first(),t.last()):m.none()}))}))}))},ar="data-mce-selected",ur={selected:o(ar),selectedSelector:o("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:o("[data-mce-selected]"),firstSelected:o("data-mce-first-selected"),firstSelectedSelector:o("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:o("data-mce-last-selected"),lastSelectedSelector:o("td[data-mce-last-selected],th[data-mce-last-selected]")},sr=function(t){if(!p(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var n=[],r={};return N(t,(function(o,i){var a=M(o);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],s=o[u];if(void 0!==r[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!p(s))throw new Error("case arguments must be an array");n.push(u),r[u]=function(){var r=arguments.length;if(r!==s.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+s.length+" ("+s+"), got "+r);for(var o=new Array(r),a=0;a<o.length;a++)o[a]=arguments[a];var c=function(e){var t=M(e);if(n.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+n.join(",")+"\nActual: "+t.join(","));if(!B(n,(function(e){return S(t,e)})))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+n.join(", "));return e[u].apply(null,o)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[i];return e.apply(null,o)},match:c,log:function(t){e.console.log(t,{constructors:n,constructor:u,params:o})}}}})),r},cr=sr([{none:[]},{multiple:["elements"]},{single:["selection"]}]),lr={cata:function(e,t,n,r){return e.fold(t,n,r)},none:cr.none,multiple:cr.multiple,single:cr.single},fr=function(e,t){return lr.cata(t.get(),o([]),i,o([e]))},dr=function(e,t){return lr.cata(t.get(),m.none,(function(t,n){return 0===t.length?m.none():ir(e,ur.firstSelectedSelector(),ur.lastSelectedSelector()).bind((function(e){return t.length>1?m.some({bounds:o(e),cells:o(t)}):m.none()}))}),m.none)},mr=function(e,t){var n=fr(e,t);return n.length>0&&B(n,(function(e){return le(e,"rowspan")&&parseInt(ce(e,"rowspan"),10)>1||le(e,"colspan")&&parseInt(ce(e,"colspan"),10)>1}))?m.some(n):m.none()},hr=fr,gr=function(e){return{element:o(e),mergable:m.none,unmergable:m.none,selection:o([e])}},pr=z("element","clipboard","generators"),vr={noMenu:gr,forMenu:function(e,t,n){return{element:o(n),mergable:o(dr(t,e)),unmergable:o(mr(n,e)),selection:o(hr(n,e))}},notCell:function(e){return gr(e)},paste:pr,pasteRows:function(e,t,n,r,i){return{element:o(n),mergable:m.none,unmergable:m.none,selection:o(hr(n,e)),clipboard:o(r),generators:o(i)}}},br=function(t,r,o,i){t.on("BeforeGetContent",(function(e){!0===e.selection&&lr.cata(r.get(),n,(function(n){e.preventDefault(),function(e){return Yt(e[0]).map(pn).map((function(e){return[nn(e,ur.attributeSelector())]}))}(n).each((function(n){e.content="text"===e.format?function(e){return k(e,(function(e){return e.dom().innerText})).join("")}(n):function(e,t){return k(t,(function(t){return e.selection.serializer.serialize(t.dom(),{})})).join("")}(t,n)}))}),n)})),t.on("BeforeSetContent",(function(n){!0===n.selection&&!0===n.paste&&m.from(t.dom.getParent(t.selection.getStart(),"th,td")).each((function(r){var a=ve.fromDom(r);Yt(a).each((function(r){var u,s,c,l=T((u=n.content,(c=(s||e.document).createElement("div")).innerHTML=u,st(ve.fromDom(c))),(function(e){return"meta"!==ee(e)}));if(1===l.length&&"table"===ee(l[0])){n.preventDefault();var f=ve.fromDom(t.getDoc()),d=Sn(f),m=vr.paste(a,l[0],d);o.pasteCells(r,m).each((function(e){t.selection.setRng(e),t.focus(),i.clear(r)}))}}))}))}))};function yr(e,t){var n=function(n){var r=t(n);if(r<=0||null===r){var o=Ee(n,e);return parseFloat(o)||0}return r},r=function(e,t){return R(t,(function(t,n){var r=Ee(e,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?t:t+o}),0)};return{set:function(t,n){if(!y(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);var r=t.dom();he(r)&&(r.style[e]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(e,t,n){var o=r(e,n);return t>o?t-o:0}}}var wr=yr("height",(function(e){var t=e.dom();return be(e)?t.getBoundingClientRect().height:t.offsetHeight})),xr=function(e){return wr.get(e)},Cr=function(e){return wr.getOuter(e)},Sr=yr("width",(function(e){return e.dom().offsetWidth})),Er=function(e){return Sr.get(e)},kr=function(e){return Sr.getOuter(e)},Nr=Ke.detect(),Tr=function(e,t,n){return function(e,t){var n=parseFloat(e);return isNaN(n)?t:n}(Ee(e,t),n)},_r=function(e){return Nr.browser.isIE()||Nr.browser.isEdge()?function(e){var t=Tr(e,"padding-top",0),n=Tr(e,"padding-bottom",0),r=Tr(e,"border-top-width",0),o=Tr(e,"border-bottom-width",0),i=e.dom().getBoundingClientRect().height;return"border-box"===Ee(e,"box-sizing")?i:i-t-n-(r+o)}(e):Tr(e,"height",xr(e))},Rr=/(\d+(\.\d+)?)(\w|%)*/,Or=/(\d+(\.\d+)?)%/,Ar=/(\d+(\.\d+)?)px|em/,Dr=function(e,t){Ce(e,"height",t+"px")},Pr=function(e,t,n,r){var o,i,a=parseInt(e,10);return function(e,t,n){return""===t||!(e.length<t.length)&&e.substr(n,n+t.length)===t}(o=e,i="%",o.length-i.length)&&"table"!==ee(t)?function(e,t,n,r){var o=Yt(e).map((function(e){var r=n(e);return Math.floor(t/100*r)})).getOr(t);return r(e,o),o}(t,a,n,r):a},Br=function(e){var t=function(e){return Ne(e,"height").getOrThunk((function(){return _r(e)+"px"}))}(e);return t?Pr(t,e,xr,Dr):xr(e)},Ir=function(e,t){return le(e,t)?parseInt(ce(e,t),10):1},Mr=function(e){return Ne(e,"width").fold((function(){return m.from(ce(e,"width"))}),(function(e){return m.some(e)}))},Lr=function(e,t){return e/t.pixelWidth()*100},Fr={percentageBasedSizeRegex:o(Or),pixelBasedSizeRegex:o(Ar),setPixelWidth:function(e,t){Ce(e,"width",t+"px")},setPercentageWidth:function(e,t){Ce(e,"width",t+"%")},setHeight:Dr,getPixelWidth:function(e,t){return Mr(e).fold((function(){return Er(e)}),(function(n){return function(e,t,n){var r=Ar.exec(t);if(null!==r)return parseInt(r[1],10);var o=Or.exec(t);return null!==o?function(e,t){return e/100*t.pixelWidth()}(parseFloat(o[1]),n):Er(e)}(e,n,t)}))},getPercentageWidth:function(e,t){return Mr(e).fold((function(){var n=Er(e);return Lr(n,t)}),(function(n){return function(e,t,n){var r=Or.exec(t);if(null!==r)return parseFloat(r[1]);var o=Er(e);return Lr(o,n)}(e,n,t)}))},getGenericWidth:function(e){return Mr(e).bind((function(e){var t=Rr.exec(e);return null!==t?m.some({width:o(parseFloat(t[1])),unit:o(t[3])}):m.none()}))},setGenericWidth:function(e,t,n){Ce(e,"width",t+n)},getHeight:function(e){return function(e,t,n){return n(e)/Ir(e,t)}(e,"rowspan",Br)},getRawWidth:Mr},Hr=function(e,t){Fr.getGenericWidth(e).each((function(n){var r=n.width()/2;Fr.setGenericWidth(e,r,n.unit()),Fr.setGenericWidth(t,r,n.unit())}))},zr=function(e,t){return{left:o(e),top:o(t),translate:function(n,r){return zr(e+n,t+r)}}},Wr=zr,jr=function(e,t){return void 0!==e?e:void 0!==t?t:0},Ur=function(e){var t=e.dom().ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement,i=jr(r.pageYOffset,o.scrollTop),a=jr(r.pageXOffset,o.scrollLeft),u=jr(o.clientTop,n.clientTop),s=jr(o.clientLeft,n.clientLeft);return Vr(e).translate(a-s,i-u)},Vr=function(e){var t=e.dom(),n=t.ownerDocument.body;return n===t?Wr(n.offsetLeft,n.offsetTop):be(e)?function(e){var t=e.getBoundingClientRect();return Wr(t.left,t.top)}(t):Wr(0,0)},qr=z("row","y"),$r=z("col","x"),Yr=function(e){return Ur(e).left()+kr(e)},Xr=function(e){return Ur(e).left()},Kr=function(e,t){return $r(e,Xr(t))},Gr=function(e,t){return $r(e,Yr(t))},Jr=function(e){return Ur(e).top()},Qr=function(e,t){return qr(e,Jr(t))},Zr=function(e,t){return qr(e,Jr(t)+Cr(t))},eo=function(e,t,n){if(0===n.length)return[];var r=k(n.slice(1),(function(t,n){return t.map((function(t){return e(n,t)}))})),o=n[n.length-1].map((function(e){return t(n.length-1,e)}));return r.concat([o])},to={height:{delta:i,positions:function(e){return eo(Qr,Zr,e)},edge:Jr},rtl:{delta:function(e){return-e},edge:Yr,positions:function(e){return eo(Gr,Kr,e)}},ltr:{delta:i,edge:Xr,positions:function(e){return eo(Kr,Gr,e)}}},no={ltr:to.ltr,rtl:to.rtl};function ro(e){var t=function(t){return e(t).isRtl()?no.rtl:no.ltr};return{delta:function(e,n){return t(n).delta(e,n)},edge:function(e){return t(e).edge(e)},positions:function(e,n){return t(n).positions(e,n)}}}var oo=function(e){var t=Kt(e);return Zt.generate(t).grid()},io=function(){return(io=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ao=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},uo=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return m.none()},so=function(e,t,n,r){n===r?fe(e,t):ue(e,t,n)},co=function(e,t){var n=[],r=[],i=function(t,o){t.length>0?function(t,o){var i=Ft(e,o).getOrThunk((function(){var t=ve.fromTag(o,rt(e).dom());return mt(e,t),t}));vt(i);var a=k(t,(function(e){e.isNew()&&n.push(e.element());var t=e.element();return vt(t),N(e.cells(),(function(e){e.isNew()&&r.push(e.element()),so(e.element(),"colspan",e.colspan(),1),so(e.element(),"rowspan",e.rowspan(),1),mt(t,e.element())})),t}));pt(i,a)}(t,o):function(t){Ft(e,t).each(bt)}(o)},a=[],u=[],s=[];return N(t,(function(e){switch(e.section()){case"thead":a.push(e);break;case"tbody":u.push(e);break;case"tfoot":s.push(e)}})),i(a,"thead"),i(u,"tbody"),i(s,"tfoot"),{newRows:o(n),newCells:o(r)}},lo=function(e){return k(e,(function(e){var t=gn(e.element());return N(e.cells(),(function(e){var n=pn(e.element());so(n,"colspan",e.colspan(),1),so(n,"rowspan",e.rowspan(),1),mt(t,n)})),t}))},fo=function(e,t){var n=ce(e,t);return void 0===n||""===n?[]:n.split(" ")},mo=function(e){return void 0!==e.dom().classList},ho=function(e,t){return function(e,t,n){var r=fo(e,t).concat([n]);return ue(e,t,r.join(" ")),!0}(e,"class",t)},go=function(e,t){mo(e)?e.dom().classList.add(t):ho(e,t)},po=function(e,t){return mo(e)&&e.dom().classList.contains(t)},vo=function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n},bo=function(e,t){if(t<0||t>=e.length-1)return m.none();var n=e[t].fold((function(){var n=I(e.slice(0,t));return uo(n,(function(e,t){return e.map((function(e){return{value:e,delta:t+1}}))}))}),(function(e){return m.some({value:e,delta:0})})),r=e[t+1].fold((function(){var n=e.slice(t+1);return uo(n,(function(e,t){return e.map((function(e){return{value:e,delta:t+1}}))}))}),(function(e){return m.some({value:e,delta:1})}));return n.bind((function(e){return r.map((function(t){var n=t.delta+e.delta;return Math.abs(t.value-e.value)/n}))}))},yo=function(e,t,n){var r=e();return O(r,t).orThunk((function(){return m.from(r[0]).orThunk(n)})).map((function(e){return e.element()}))},wo=function(e){var t=e.grid(),n=vo(0,t.columns()),r=vo(0,t.rows());return k(n,(function(t){return yo((function(){return P(r,(function(n){return Zt.getAt(e,n,t).filter((function(e){return e.column()===t})).fold(o([]),(function(e){return[e]}))}))}),(function(e){return 1===e.colspan()}),(function(){return Zt.getAt(e,0,t)}))}))},xo=function(e){var t=e.grid(),n=vo(0,t.rows()),r=vo(0,t.columns());return k(n,(function(t){return yo((function(){return P(r,(function(n){return Zt.getAt(e,t,n).filter((function(e){return e.row()===t})).fold(o([]),(function(e){return[e]}))}))}),(function(e){return 1===e.rowspan()}),(function(){return Zt.getAt(e,t,0)}))}))},Co=function(e){var t=e.replace(/\./g,"-");return{resolve:function(e){return t+"-"+e}}},So=Co("ephox-snooker"),Eo={resolve:So.resolve},ko=function(e,t,n,r,o){var i=ve.fromTag("div");return Se(i,{position:"absolute",left:t-r/2+"px",top:n+"px",height:o+"px",width:r+"px"}),se(i,{"data-column":e,role:"presentation"}),i},No=function(e,t,n,r,o){var i=ve.fromTag("div");return Se(i,{position:"absolute",left:t+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),se(i,{"data-row":e,role:"presentation"}),i},To=Eo.resolve("resizer-bar"),_o=Eo.resolve("resizer-rows"),Ro=Eo.resolve("resizer-cols"),Oo=function(e){var t=Bt(e.parent(),"."+To);N(t,bt)},Ao=function(e,t,n){var r=e.origin();N(t,(function(t,o){t.each((function(t){var o=n(r,t);go(o,To),mt(e.parent(),o)}))}))},Do=function(e,t,n,r,o,i){var a=Ur(t);!function(e,t,n,r){Ao(e,t,(function(e,t){var o=No(t.row(),n.left()-e.left(),t.y()-e.top(),r,7);return go(o,_o),o}))}(e,n.length>0?o.positions(n,t):[],a,kr(t)),function(e,t,n,r){Ao(e,t,(function(e,t){var o=ko(t.col(),t.x()-e.left(),n.top()-e.top(),7,r);return go(o,Ro),o}))}(e,r.length>0?i.positions(r,t):[],a,Cr(t))},Po=function(e,t){var n=Bt(e.parent(),"."+To);N(n,t)},Bo=function(e,t,n,r){Oo(e);var o=Kt(t),i=Zt.generate(o),a=xo(i),u=wo(i);Do(e,t,a,u,n,r)},Io=function(e){Po(e,(function(e){Ce(e,"display","none")}))},Mo=function(e){Po(e,(function(e){Ce(e,"display","block")}))},Lo=Oo,Fo=function(e){return po(e,_o)},Ho=function(e){return po(e,Ro)},zo=function(e,t){return _t(t,e.section())},Wo=function(e,t){return e.cells()[t]},jo={addCell:function(e,t,n){var r=e.cells(),o=r.slice(0,t),i=r.slice(t),a=o.concat([n]).concat(i);return zo(e,a)},setCells:zo,mutateCell:function(e,t,n){e.cells()[t]=n},getCell:Wo,getCellElement:function(e,t){return Wo(e,t).element()},mapCells:function(e,t){var n=e.cells(),r=k(n,t);return _t(r,e.section())},cellLength:function(e){return e.cells().length}},Uo=function(e,t){if(0===e.length)return 0;var n=e[0];return A(e,(function(e){return!t(n.element(),e.element())})).fold((function(){return e.length}),(function(e){return e}))},Vo=function(e,t,n,r){var i=function(e,t){return e[t]}(e,t).cells().slice(n),a=Uo(i,r),u=function(e,t){return k(e,(function(e){return jo.getCell(e,t)}))}(e,n).slice(t),s=Uo(u,r);return{colspan:o(a),rowspan:o(s)}},qo=function(e,t){var n=k(e,(function(e,t){return k(e.cells(),(function(e,t){return!1}))}));return k(e,(function(r,o){var i=P(r.cells(),(function(r,i){if(!1===n[o][i]){var a=Vo(e,o,i,t);return function(e,t,r,o){for(var i=e;i<e+r;i++)for(var a=t;a<t+o;a++)n[i][a]=!0}(o,i,a.rowspan(),a.colspan()),[St(r.element(),a.rowspan(),a.colspan(),r.isNew())]}return[]}));return Rt(i,r.section())}))},$o=function(e,t,n){for(var r=[],o=0;o<e.grid().rows();o++){for(var i=[],a=0;a<e.grid().columns();a++){var u=Zt.getAt(e,o,a).map((function(e){return Nt(e.element(),n)})).getOrThunk((function(){return Nt(t.gap(),!0)}));i.push(u)}var s=_t(i,e.all()[o].section());r.push(s)}return r},Yo=function(e,t){return k(e,(function(e){var n=function(e){return uo(e,(function(e){return ot(e.element()).map((function(e){var t=ot(e).isNone();return Nt(e,t)}))})).getOrThunk((function(){return Nt(t.row(),!0)}))}(e.details());return Tt(n.element(),e.details(),e.section(),n.isNew())}))},Xo=function(e,t){var n=qo(e,et);return Yo(n,t)},Ko=function(e,t){var n=D(k(e.all(),(function(e){return e.cells()})));return O(n,(function(e){return et(t,e.element())}))},Go=function(e,t,n,r,i){return function(a,u,s,c,l){var f=Kt(u),d=Zt.generate(f);return t(d,s).map((function(t){var n=function(e,t){return $o(e,t,!1)}(d,c),r=e(n,t,et,i(c)),a=Xo(r.grid(),c);return{grid:o(a),cursor:r.cursor}})).fold((function(){return m.none()}),(function(e){var t=co(u,e.grid());return n(u,e.grid(),l),r(u),Bo(a,u,to.height,l),m.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})}))}},Jo=function(e,t){return qt(t.element()).bind((function(t){return Ko(e,t)}))},Qo=function(e,t){var n=k(t.selection(),(function(t){return qt(t).bind((function(t){return Ko(e,t)}))})),r=ao(n);return r.length>0?m.some({cells:r,generators:t.generators,clipboard:t.clipboard}):m.none()},Zo=function(e,t){var n=k(t.selection(),(function(t){return qt(t).bind((function(t){return Ko(e,t)}))})),r=ao(n);return r.length>0?m.some(r):m.none()},ei=function(e){return{is:function(t){return e===t},isValue:c,isError:s,getOr:o(e),getOrThunk:o(e),getOrDie:o(e),or:function(t){return ei(e)},orThunk:function(t){return ei(e)},fold:function(t,n){return n(e)},map:function(t){return ei(t(e))},mapError:function(t){return ei(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOption:function(){return m.some(e)}}},ti=function(e){return{is:s,isValue:s,isError:c,getOr:i,getOrThunk:function(e){return e()},getOrDie:function(){return(t=String(e),function(){throw new Error(t)})();var t},or:function(e){return e},orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return ti(e)},mapError:function(t){return ti(t(e))},each:n,bind:function(t){return ti(e)},exists:s,forall:c,toOption:m.none}},ni={value:ei,error:ti,fromOption:function(e,t){return e.fold((function(){return ti(t)}),ei)}},ri=function(e,t){return k(e,(function(){return Nt(t.cell(),!0)}))},oi=function(e,t,n){return e.concat(function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n}(t,(function(t){return jo.setCells(e[e.length-1],ri(e[e.length-1].cells(),n))})))},ii=function(e,t,n){return k(e,(function(e){return jo.setCells(e,e.cells().concat(ri(vo(0,t),n)))}))},ai=function(e,t,n){if(e.row()>=t.length||e.column()>jo.cellLength(t[0]))return ni.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=t.slice(e.row()),i=r[0].cells().slice(e.column()),a=jo.cellLength(n[0]),u=n.length;return ni.value({rowDelta:o(r.length-u),colDelta:o(i.length-a)})},ui=function(e,t){var n=jo.cellLength(e[0]),r=jo.cellLength(t[0]);return{rowDelta:o(0),colDelta:o(n-r)}},si=function(e,t,n){var r=t.colDelta()<0?ii:i;return(t.rowDelta()<0?oi:i)(r(e,Math.abs(t.colDelta()),n),Math.abs(t.rowDelta()),n)},ci=function(e,t,n,r){if(0===e.length)return e;for(var o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)jo.mutateCell(e[o],i,Nt(r(),!1));return e},li=function(e,t,n,r){for(var o=!0,i=0;i<e.length;i++)for(var a=0;a<jo.cellLength(e[0]);a++){var u=n(jo.getCellElement(e[i],a),t);!0===u&&!1===o?jo.mutateCell(e[i],a,Nt(r(),!0)):!0===u&&(o=!1)}return e},fi=function(e,t,n,r){if(t>0&&t<e.length){var o=function(e,t){return R(e,(function(e,n){return E(e,(function(e){return t(e.element(),n.element())}))?e:e.concat([n])}),[])}(e[t-1].cells(),n);N(o,(function(o){for(var i=m.none(),a=function(t){for(var a=function(a){var u=e[t].cells()[a];n(u.element(),o.element())&&(i.isNone()&&(i=m.some(r())),i.each((function(n){jo.mutateCell(e[t],a,Nt(n,!0))})))},u=0;u<jo.cellLength(e[0]);u++)a(u)},u=t;u<e.length;u++)a(u)}))}return e},di=function(e,t,n,r){var o=a(r,jo.getCell(e[t],n).element()),i=e[t];return e.length>1&&jo.cellLength(i)>1&&(n>0&&o(jo.getCellElement(i,n-1))||n<i.cells().length-1&&o(jo.getCellElement(i,n+1))||t>0&&o(jo.getCellElement(e[t-1],n))||t<e.length-1&&o(jo.getCellElement(e[t+1],n)))},mi=function(e,t,n,r,o){return ai(e,t,n).map((function(i){var a=si(t,i,r);return function(e,t,n,r,o){for(var i=e.row(),a=e.column(),u=i+n.length,s=a+jo.cellLength(n[0]),c=i;c<u;c++)for(var l=a;l<s;l++){di(t,c,l,o)&&li(t,jo.getCellElement(t[c],l),o,r.cell);var f=jo.getCellElement(n[c-i],l-a),d=r.replace(f);jo.mutateCell(t[c],l,Nt(d,!0))}return t}(e,a,n,r,o)}))},hi=function(e,t,n,r,o){fi(t,e,o,r.cell);var i=ui(n,t),a=si(n,i,r),u=ui(t,a),s=si(t,u,r);return s.slice(0,e).concat(a).concat(s.slice(e,s.length))},gi=function(e,t,n,r,o){var i=e.slice(0,t),a=e.slice(t),u=jo.mapCells(e[n],(function(n,i){return t>0&&t<e.length&&r(jo.getCellElement(e[t-1],i),jo.getCellElement(e[t],i))?jo.getCell(e[t],i):Nt(o(n.element(),r),!0)}));return i.concat([u]).concat(a)},pi=function(e,t,n,r,o){return k(e,(function(e){var i=t>0&&t<jo.cellLength(e)&&r(jo.getCellElement(e,t-1),jo.getCellElement(e,t))?jo.getCell(e,t):Nt(o(jo.getCellElement(e,n),r),!0);return jo.addCell(e,t,i)}))},vi=function(e,t,n,r,o){var i=n+1;return k(e,(function(e,a){var u=a===t?Nt(o(jo.getCellElement(e,n),r),!0):jo.getCell(e,n);return jo.addCell(e,i,u)}))},bi=function(e,t,n,r,o){var i=t+1,a=e.slice(0,i),u=e.slice(i),s=jo.mapCells(e[t],(function(e,t){return t===n?Nt(o(e.element(),r),!0):e}));return a.concat([s]).concat(u)},yi=function(e,t,n){return e.slice(0,t).concat(e.slice(n+1))},wi=function(e,t,n){var r=k(e,(function(e){var r=e.cells().slice(0,t).concat(e.cells().slice(n+1));return _t(r,e.section())}));return T(r,(function(e){return e.cells().length>0}))},xi=function(e,t,n,r){return k(e,(function(e){return jo.mapCells(e,(function(e){return function(e){return E(t,(function(t){return n(e.element(),t.element())}))}(e)?Nt(r(e.element(),n),!0):e}))}))},Ci=function(e,t,n,r){return void 0!==jo.getCellElement(e[t],n)&&t>0&&r(jo.getCellElement(e[t-1],n),jo.getCellElement(e[t],n))},Si=function(e,t,n){return t>0&&n(jo.getCellElement(e,t-1),jo.getCellElement(e,t))},Ei=function(e,t,n,r){var o=P(e,(function(r,o){return Ci(e,o,t,n)||Si(r,t,n)?[]:[jo.getCell(r,t)]}));return xi(e,o,n,r)},ki=function(e,t,n,r){var o=e[t],i=P(o.cells(),(function(r,i){return Ci(e,t,i,n)||Si(o,i,n)?[]:[r]}));return xi(e,i,n,r)},Ni=sr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Ti=io({},Ni),_i=function(e,t,n,r){var i=e.slice(0),a=function(e,t){return 0===e.length?Ti.none():1===e.length?Ti.only(0):0===t?Ti.left(0,1):t===e.length-1?Ti.right(t-1,t):t>0&&t<e.length-1?Ti.middle(t-1,t,t+1):Ti.none()}(e,t),u=function(e){return k(e,o(0))},s=o(u(i)),c=function(e,t){if(n>=0){var o=Math.max(r.minCellWidth(),i[t]-n);return u(i.slice(0,e)).concat([n,o-i[t]]).concat(u(i.slice(t+1)))}var a=Math.max(r.minCellWidth(),i[e]+n),s=i[e]-a;return u(i.slice(0,e)).concat([a-i[e],s]).concat(u(i.slice(t+1)))},l=c;return a.fold(s,(function(e){return r.singleColumnWidth(i[e],n)}),l,(function(e,t,n){return c(t,n)}),(function(e,t){if(n>=0)return u(i.slice(0,t)).concat([n]);var o=Math.max(r.minCellWidth(),i[t]+n);return u(i.slice(0,t)).concat([o-i[t]])}))},Ri=function(e,t){return le(e,t)&&parseInt(ce(e,t),10)>1},Oi={hasColspan:function(e){return Ri(e,"colspan")},hasRowspan:function(e){return Ri(e,"rowspan")},minWidth:o(10),minHeight:o(10),getInt:function(e,t){return parseInt(Ee(e,t),10)}},Ai=function(e,t,n){return Ne(e,t).fold((function(){return n(e)+"px"}),(function(e){return e}))},Di=function(e,t){return Ai(e,"width",(function(e){return Fr.getPixelWidth(e,t)}))},Pi=function(e){return Ai(e,"height",Fr.getHeight)},Bi=function(e,t,n,r,o){var i=wo(e),a=k(i,(function(e){return e.map(t.edge)}));return k(i,(function(e,t){return e.filter(u(Oi.hasColspan)).fold((function(){var e=bo(a,t);return r(e)}),(function(e){return n(e,o)}))}))},Ii=function(e){return e.map((function(e){return e+"px"})).getOr("")},Mi=function(e,t,n,r){var o=xo(e),i=k(o,(function(e){return e.map(t.edge)}));return k(o,(function(e,t){return e.filter(u(Oi.hasRowspan)).fold((function(){var e=bo(i,t);return r(e)}),(function(e){return n(e)}))}))},Li={getRawWidths:function(e,t,n){return Bi(e,t,Di,Ii,n)},getPixelWidths:function(e,t,n){return Bi(e,t,Fr.getPixelWidth,(function(e){return e.getOrThunk(n.minCellWidth)}),n)},getPercentageWidths:function(e,t,n){return Bi(e,t,Fr.getPercentageWidth,(function(e){return e.fold((function(){return n.minCellWidth()}),(function(e){return e/n.pixelWidth()*100}))}),n)},getPixelHeights:function(e,t){return Mi(e,t,Fr.getHeight,(function(e){return e.getOrThunk(Oi.minHeight)}))},getRawHeights:function(e,t){return Mi(e,t,Pi,Ii)}},Fi=function(e,t,n){for(var r=0,o=e;o<t;o++)r+=void 0!==n[o]?n[o]:0;return r},Hi=function(e,t){var n=Zt.justCells(e);return k(n,(function(e){var n=Fi(e.column(),e.column()+e.colspan(),t);return{element:e.element,width:o(n),colspan:e.colspan}}))},zi=function(e,t){var n=Zt.justCells(e);return k(n,(function(e){var n=Fi(e.row(),e.row()+e.rowspan(),t);return{element:e.element,height:o(n),rowspan:e.rowspan}}))},Wi=function(e,t){return k(e.all(),(function(e,n){return{element:e.element,height:o(t[n])}}))},ji=function(e){var t=i;return{width:o(e),pixelWidth:o(e),getWidths:Li.getPixelWidths,getCellDelta:t,singleColumnWidth:function(e,t){return[Math.max(Oi.minWidth(),e+t)-e]},minCellWidth:Oi.minWidth,setElementWidth:Fr.setPixelWidth,setTableWidth:function(e,t,n){var r=_(t,(function(e,t){return e+t}),0);Fr.setPixelWidth(e,r)}}},Ui=function(e,t){var n=Fr.percentageBasedSizeRegex().exec(t);if(null!==n)return function(e,t){var n=parseFloat(e),r=Er(t);return{width:o(n),pixelWidth:o(r),getWidths:Li.getPercentageWidths,getCellDelta:function(e){return e/r*100},singleColumnWidth:function(e,t){return[100-e]},minCellWidth:function(){return Oi.minWidth()/r*100},setElementWidth:Fr.setPercentageWidth,setTableWidth:function(e,t,r){var o=r/100*n;Fr.setPercentageWidth(e,n+o)}}}(n[1],e);var r=Fr.pixelBasedSizeRegex().exec(t);if(null!==r){var i=parseInt(r[1],10);return ji(i)}var a=Er(e);return ji(a)},Vi=function(e){return Fr.getRawWidth(e).fold((function(){var t=Er(e);return ji(t)}),(function(t){return Ui(e,t)}))},qi=function(e){return Zt.generate(e)},$i=function(e){var t=Kt(e);return qi(t)},Yi=function(e,t,n,r){var o=Vi(e),i=o.getCellDelta(t),a=$i(e),u=o.getWidths(a,r,o),s=_i(u,n,i,o),c=k(s,(function(e,t){return e+u[t]})),l=Hi(a,c);N(l,(function(e){o.setElementWidth(e.element(),e.width())})),n===a.grid().columns()-1&&o.setTableWidth(e,c,i)},Xi=function(e,t,n,r){var o=$i(e),i=Li.getPixelHeights(o,r),a=k(i,(function(e,r){return n===r?Math.max(t+e,Oi.minHeight()):e})),u=zi(o,a),s=Wi(o,a);N(s,(function(e){Fr.setHeight(e.element(),e.height())})),N(u,(function(e){Fr.setHeight(e.element(),e.height())}));var c=_(a,(function(e,t){return e+t}),0);Fr.setHeight(e,c)},Ki=function(e,t,n){var r=Vi(e),o=qi(t),i=r.getWidths(o,n,r),a=Hi(o,i);N(a,(function(e){r.setElementWidth(e.element(),e.width())})),a.length>0&&r.setTableWidth(e,i,r.getCellDelta(0))},Gi=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Gi(n())}}},Ji=function(e,t,n){if(0===t.length)throw new Error("You must specify at least one required field.");return V("required",t),q(t),function(r){var o=M(r);B(t,(function(e){return S(o,e)}))||j(t,o),e(t,o);var i=T(t,(function(e){return!n.validate(r[e],e)}));return i.length>0&&function(e,t){throw new Error("All values need to be of type: "+t+". Keys ("+W(e).join(", ")+") were not.")}(i,n.label),r}},Qi=function(e,t){var n=T(t,(function(t){return!S(e,t)}));n.length>0&&U(n)},Zi=function(e){return function(e,t){return Ji(e,t,{validate:b,label:"function"})}(Qi,e)},ea=Zi(["cell","row","replace","gap"]),ta=function(e){var t=le(e,"colspan")?parseInt(ce(e,"colspan"),10):1,n=le(e,"rowspan")?parseInt(ce(e,"rowspan"),10):1;return{element:o(e),colspan:o(t),rowspan:o(n)}},na=function(e,t){void 0===t&&(t=ta),ea(e);var n=Gi(m.none()),r=function(n){return function(t){return e.cell(t)}(t(n))},o=function(e){var t=r(e);return n.get().isNone()&&n.set(m.some(t)),i=m.some({item:e,replacement:t}),t},i=m.none();return{getOrInit:function(e,t){return i.fold((function(){return o(e)}),(function(n){return t(e,n.item)?n.replacement:o(e)}))},cursor:n.get}},ra=function(e,t){return function(n){var r=Gi(m.none());ea(n);var o=[],i=function(i){var a={scope:e},u=n.replace(i,t,a);return o.push({item:i,sub:u}),r.get().isNone()&&r.set(m.some(u)),u};return{replaceOrInit:function(e,t){return function(e,t){return O(o,(function(n){return t(n.item,e)}))}(e,t).fold((function(){return i(e)}),(function(n){return t(e,n.item)?n.sub:i(e)}))},cursor:r.get}}},oa=function(e){ea(e);var t=Gi(m.none());return{combine:function(n){return t.get().isNone()&&t.set(m.some(n)),function(){var t=e.cell({element:o(n),colspan:o(1),rowspan:o(1)});return Te(t,"width"),Te(n,"width"),t}},cursor:t.get}},ia=["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"],aa=function(e,t){var n=e.property().name(t);return S(ia,n)},ua=function(e,t){return S(["br","img","hr","input"],e.property().name(t))},sa=aa,ca=function(e,t){var n=e.property().name(t);return S(["ol","ul"],n)},la=ua,fa=Hn(),da=function(e){return sa(fa,e)},ma=function(e){return ca(fa,e)},ha=function(e){return la(fa,e)},ga=function(e){var t,n=function(e){return"br"===ee(e)},r=function(e){return dn(e).bind((function(t){var r=ut(t).map((function(e){return!!da(e)||!!ha(e)&&"img"!==ee(e)})).getOr(!1);return ot(t).map((function(o){return!0===r||function(e){return"li"===ee(e)||Mt(e,ma).isSome()}(o)||n(t)||da(o)&&!et(e,o)?[]:[ve.fromTag("br")]}))})).getOr([])},o=0===(t=P(e,(function(e){var t=st(e);return function(e){return B(e,(function(e){return n(e)||ie(e)&&0===on(e).trim().length}))}(t)?[]:t.concat(r(e))}))).length?[ve.fromTag("br")]:t;vt(e[0]),pt(e[0],o)},pa=function(e){0===$t(e).length&&bt(e)},va=z("grid","cursor"),ba=function(e,t,n){return ya(e,t,n).orThunk((function(){return ya(e,0,0)}))},ya=function(e,t,n){return m.from(e[t]).bind((function(e){return m.from(e.cells()[n]).bind((function(e){return m.from(e.element())}))}))},wa=function(e,t,n){return va(e,ya(e,t,n))},xa=function(e){return R(e,(function(e,t){return E(e,(function(e){return e.row()===t.row()}))?e:e.concat([t])}),[]).sort((function(e,t){return e.row()-t.row()}))},Ca=function(e){return R(e,(function(e,t){return E(e,(function(e){return e.column()===t.column()}))?e:e.concat([t])}),[]).sort((function(e,t){return e.column()-t.column()}))},Sa=function(e,t,n){var r=Gt(e,n),o=Zt.generate(r);return $o(o,t,!0)},Ea=Ki,ka={insertRowBefore:Go((function(e,t,n,r){var o=t.row(),i=t.row(),a=gi(e,i,o,n,r.getOrInit);return wa(a,i,t.column())}),Jo,n,n,na),insertRowsBefore:Go((function(e,t,n,r){var o=t[0].row(),i=t[0].row(),a=xa(t),u=R(a,(function(e,t){return gi(e,i,o,n,r.getOrInit)}),e);return wa(u,i,t[0].column())}),Zo,n,n,na),insertRowAfter:Go((function(e,t,n,r){var o=t.row(),i=t.row()+t.rowspan(),a=gi(e,i,o,n,r.getOrInit);return wa(a,i,t.column())}),Jo,n,n,na),insertRowsAfter:Go((function(e,t,n,r){var o=xa(t),i=o[o.length-1].row(),a=o[o.length-1].row()+o[o.length-1].rowspan(),u=R(o,(function(e,t){return gi(e,a,i,n,r.getOrInit)}),e);return wa(u,a,t[0].column())}),Zo,n,n,na),insertColumnBefore:Go((function(e,t,n,r){var o=t.column(),i=t.column(),a=pi(e,i,o,n,r.getOrInit);return wa(a,t.row(),i)}),Jo,Ea,n,na),insertColumnsBefore:Go((function(e,t,n,r){var o=Ca(t),i=o[0].column(),a=o[0].column(),u=R(o,(function(e,t){return pi(e,a,i,n,r.getOrInit)}),e);return wa(u,t[0].row(),a)}),Zo,Ea,n,na),insertColumnAfter:Go((function(e,t,n,r){var o=t.column(),i=t.column()+t.colspan(),a=pi(e,i,o,n,r.getOrInit);return wa(a,t.row(),i)}),Jo,Ea,n,na),insertColumnsAfter:Go((function(e,t,n,r){var o=t[t.length-1].column(),i=t[t.length-1].column()+t[t.length-1].colspan(),a=Ca(t),u=R(a,(function(e,t){return pi(e,i,o,n,r.getOrInit)}),e);return wa(u,t[0].row(),i)}),Zo,Ea,n,na),splitCellIntoColumns:Go((function(e,t,n,r){var o=vi(e,t.row(),t.column(),n,r.getOrInit);return wa(o,t.row(),t.column())}),Jo,Ea,n,na),splitCellIntoRows:Go((function(e,t,n,r){var o=bi(e,t.row(),t.column(),n,r.getOrInit);return wa(o,t.row(),t.column())}),Jo,n,n,na),eraseColumns:Go((function(e,t,n,r){var o=Ca(t),i=wi(e,o[0].column(),o[o.length-1].column()),a=ba(i,t[0].row(),t[0].column());return va(i,a)}),Zo,Ea,pa,na),eraseRows:Go((function(e,t,n,r){var o=xa(t),i=yi(e,o[0].row(),o[o.length-1].row()),a=ba(i,t[0].row(),t[0].column());return va(i,a)}),Zo,n,pa,na),makeColumnHeader:Go((function(e,t,n,r){var o=Ei(e,t.column(),n,r.replaceOrInit);return wa(o,t.row(),t.column())}),Jo,n,n,ra("row","th")),unmakeColumnHeader:Go((function(e,t,n,r){var o=Ei(e,t.column(),n,r.replaceOrInit);return wa(o,t.row(),t.column())}),Jo,n,n,ra(null,"td")),makeRowHeader:Go((function(e,t,n,r){var o=ki(e,t.row(),n,r.replaceOrInit);return wa(o,t.row(),t.column())}),Jo,n,n,ra("col","th")),unmakeRowHeader:Go((function(e,t,n,r){var o=ki(e,t.row(),n,r.replaceOrInit);return wa(o,t.row(),t.column())}),Jo,n,n,ra(null,"td")),mergeCells:Go((function(e,t,n,r){var i=t.cells();ga(i);var a=ci(e,t.bounds(),n,o(i[0]));return va(a,m.from(i[0]))}),(function(e,t){return t.mergable()}),n,n,oa),unmergeCells:Go((function(e,t,n,r){var o=_(t,(function(e,t){return li(e,t,n,r.combine(t))}),e);return va(o,m.from(t[0]))}),(function(e,t){return t.unmergable()}),Ea,n,oa),pasteCells:Go((function(e,t,n,r){var o=function(e,t){var n=Kt(e),r=Zt.generate(n);return $o(r,t,!0)}(t.clipboard(),t.generators()),i=xt(t.row(),t.column());return mi(i,e,o,t.generators(),n).fold((function(){return va(e,m.some(t.element()))}),(function(e){var n=ba(e,t.row(),t.column());return va(e,n)}))}),(function(e,t){return qt(t.element()).bind((function(n){return Ko(e,n).map((function(e){return io(io({},e),{generators:t.generators,clipboard:t.clipboard})}))}))}),Ea,n,na),pasteRowsBefore:Go((function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[0].row(),a=Sa(t.clipboard(),t.generators(),o),u=hi(i,e,a,t.generators(),n),s=ba(u,t.cells[0].row(),t.cells[0].column());return va(u,s)}),Qo,n,n,na),pasteRowsAfter:Go((function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[t.cells.length-1].row()+t.cells[t.cells.length-1].rowspan(),a=Sa(t.clipboard(),t.generators(),o),u=hi(i,e,a,t.generators(),n),s=ba(u,t.cells[0].row(),t.cells[0].column());return va(u,s)}),Qo,n,n,na)},Na=function(e){return ve.fromDom(e.getBody())},Ta=function(e){return e.getBoundingClientRect().width},_a=function(e){return e.getBoundingClientRect().height},Ra=function(e){return function(t){return et(t,Na(e))}},Oa=function(e){return/^[0-9]+$/.test(e)&&(e+="px"),e},Aa=function(e){var t=Bt(e,"td[data-mce-style],th[data-mce-style]");fe(e,"data-mce-style"),N(t,(function(e){fe(e,"data-mce-style")}))},Da={isRtl:o(!1)},Pa={isRtl:o(!0)},Ba=function(e){return"rtl"===function(e){return"rtl"===Ee(e,"direction")?"rtl":"ltr"}(e)?Pa:Da},Ia=["tableprops","tabledelete","|","tableinsertrowbefore","tableinsertrowafter","tabledeleterow","|","tableinsertcolbefore","tableinsertcolafter","tabledeletecol"],Ma={"border-collapse":"collapse",width:"100%"},La={border:"1"},Fa=function(e){return e.getParam("table_default_attributes",La,"object")},Ha=function(e){return e.getParam("table_default_styles",Ma,"object")},za=function(e){return e.getParam("table_cell_advtab",!0,"boolean")},Wa=function(e){return e.getParam("table_row_advtab",!0,"boolean")},ja=function(e){return e.getParam("table_advtab",!0,"boolean")},Ua=function(e){return e.getParam("table_appearance_options",!0,"boolean")},Va=function(e){return e.getParam("table_style_by_css",!1,"boolean")},qa=function(e){return e.getParam("table_cell_class_list",[],"array")},$a=function(e){return e.getParam("table_row_class_list",[],"array")},Ya=function(e){return e.getParam("table_class_list",[],"array")},Xa=function(e){return!1===e.getParam("table_responsive_width")},Ka=function(e,t){return e.fire("newrow",{node:t})},Ga=function(e,t){return e.fire("newcell",{node:t})},Ja=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},Qa=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},Za=function(e,t){var r=function(e){return"table"===ee(Na(e))},o=function(e){var t=e.getParam("table_clone_elements");return g(t)?m.some(t.split(/[ ,]/)):Array.isArray(t)?m.some(t):m.none()}(e),i=function(t,n,r,i){return function(a,u){Aa(a);var s=i(),c=ve.fromDom(e.getDoc()),l=ro(Ba),f=Cn(r,c,o);return n(a)?t(s,a,u,f,l).bind((function(t){return N(t.newRows(),(function(t){Ka(e,t.dom())})),N(t.newCells(),(function(t){Ga(e,t.dom())})),t.cursor().map((function(t){var n=e.dom.createRng();return n.setStart(t.dom(),0),n.setEnd(t.dom(),0),n}))})):m.none()}};return{deleteRow:i(ka.eraseRows,(function(t){var n=oo(t);return!1===r(e)||n.rows()>1}),n,t),deleteColumn:i(ka.eraseColumns,(function(t){var n=oo(t);return!1===r(e)||n.columns()>1}),n,t),insertRowsBefore:i(ka.insertRowsBefore,c,n,t),insertRowsAfter:i(ka.insertRowsAfter,c,n,t),insertColumnsBefore:i(ka.insertColumnsBefore,c,Hr,t),insertColumnsAfter:i(ka.insertColumnsAfter,c,Hr,t),mergeCells:i(ka.mergeCells,c,n,t),unmergeCells:i(ka.unmergeCells,c,n,t),pasteRowsBefore:i(ka.pasteRowsBefore,c,n,t),pasteRowsAfter:i(ka.pasteRowsAfter,c,n,t),pasteCells:i(ka.pasteCells,c,n,t)}},eu=function(e,t,n){var r=Kt(e),o=Zt.generate(r);return Zo(o,t).map((function(e){var t=$o(o,n,!1).slice(e[0].row(),e[e.length-1].row()+e[e.length-1].rowspan()),r=Xo(t,n);return lo(r)}))},tu=tinymce.util.Tools.resolve("tinymce.util.Tools"),nu=function(e,t,n){n&&e.formatter.apply("align"+n,{},t)},ru=function(e,t,n){n&&e.formatter.apply("valign"+n,{},t)},ou=function(e,t){tu.each("left center right".split(" "),(function(n){e.formatter.remove("align"+n,{},t)}))},iu=function(e,t){tu.each("top middle bottom".split(" "),(function(n){e.formatter.remove("valign"+n,{},t)}))},au=function(e,t,n){var r;return r=function(t,r){for(var o=0;o<r.length;o++){var i=e.getStyle(r[o],n);if(void 0===t&&(t=i),t!==i)return""}return t}(r,e.select("td,th",t))},uu=function(e,t){var n=e.dom,r=t.control.rootControl,o=r.toJSON(),i=n.parseStyle(o.style);i["border-style"]=o.borderStyle,i["border-color"]=o.borderColor,i["background-color"]=o.backgroundColor,i.width=o.width?Oa(o.width):"",i.height=o.height?Oa(o.height):"",r.find("#style").value(n.serializeStyle(n.parseStyle(n.serializeStyle(i))))},su=function(e,t){var n=e.dom,r=t.control.rootControl,o=r.toJSON(),i=n.parseStyle(o.style);r.find("#borderStyle").value(i["border-style"]||""),r.find("#borderColor").value(i["border-color"]||""),r.find("#backgroundColor").value(i["background-color"]||""),r.find("#width").value(i.width||""),r.find("#height").value(i.height||"")},cu={createStyleForm:function(e){var t=function(){var t=function(e){return e.getParam("color_picker_callback")}(e);if(t)return function(n){return t.call(e,(function(e){n.control.value(e).fire("change")}),n.control.value())}};return{title:"Advanced",type:"form",defaults:{onchange:a(uu,e)},items:[{label:"Style",name:"style",type:"textbox",onchange:a(su,e)},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border style",type:"listbox",name:"borderStyle",width:90,onselect:a(uu,e),values:[{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"}]},{label:"Border color",type:"colorbox",name:"borderColor",onaction:t()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:t()}]}]}},buildListItems:function(e,t,n){var r=function(e,n){return n=n||[],tu.each(e,(function(e){var o={text:e.text||e.title};e.menu?o.menu=r(e.menu):(o.value=e.value,t&&t(o)),n.push(o)})),n};return r(e,n||[])},updateStyleField:uu,extractAdvancedStyles:function(e,t){var n=e.parseStyle(e.getAttrib(t,"style")),r={};return n["border-style"]&&(r.borderStyle=n["border-style"]),n["border-color"]&&(r.borderColor=n["border-color"]),n["background-color"]&&(r.backgroundColor=n["background-color"]),r.style=e.serializeStyle(n),r},updateAdvancedFields:su,syncAdvancedStyleFields:function(t,n){n.control.rootControl.find("#style")[0].getEl().isEqualNode(e.document.activeElement)?su(t,n):uu(t,n)}},lu=function(e,t,n){var r,o=e.dom;function i(e,n,r){(1===t.length||r)&&o.setAttrib(e,n,r)}function a(e,n,r){(1===t.length||r)&&o.setStyle(e,n,r)}za(e)&&cu.syncAdvancedStyleFields(e,n),r=n.control.rootControl.toJSON(),e.undoManager.transact((function(){tu.each(t,(function(n){var u,s;i(n,"scope",r.scope),1===t.length?i(n,"style",r.style):(u=n,s=r.style,delete u.dataset.mceStyle,u.style.cssText+=";"+s),i(n,"class",r.class),a(n,"width",Oa(r.width)),a(n,"height",Oa(r.height)),r.type&&n.nodeName.toLowerCase()!==r.type&&(n=o.rename(n,r.type)),1===t.length&&(ou(e,n),iu(e,n)),r.align&&nu(e,n,r.align),r.valign&&ru(e,n,r.valign)})),e.focus()}))},fu=function(e){var t,n,r,o=[];if(o=e.dom.select("td[data-mce-selected],th[data-mce-selected]"),t=e.dom.getParent(e.selection.getStart(),"td,th"),!o.length&&t&&o.push(t),t=t||o[0]){n=o.length>1?{width:"",height:"",scope:"",class:"",align:"",valign:"",style:"",type:t.nodeName.toLowerCase()}:function(e,t){var n=e.dom,r={width:n.getStyle(t,"width")||n.getAttrib(t,"width"),height:n.getStyle(t,"height")||n.getAttrib(t,"height"),scope:n.getAttrib(t,"scope"),class:n.getAttrib(t,"class"),type:t.nodeName.toLowerCase(),style:"",align:"",valign:""};return tu.each("left center right".split(" "),(function(n){e.formatter.matchNode(t,"align"+n)&&(r.align=n)})),tu.each("top middle bottom".split(" "),(function(n){e.formatter.matchNode(t,"valign"+n)&&(r.valign=n)})),za(e)&&tu.extend(r,cu.extractAdvancedStyles(n,t)),r}(e,t),qa(e).length>0&&(r={name:"class",type:"listbox",label:"Class",values:cu.buildListItems(qa(e),(function(t){t.value&&(t.textStyle=function(){return e.formatter.getCssText({block:"td",classes:[t.value]})})}))});var i={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width",onchange:a(cu.updateStyleField,e)},{label:"Height",name:"height",onchange:a(cu.updateStyleField,e)},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},r]};za(e)?e.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:n,body:[{title:"General",type:"form",items:i},cu.createStyleForm(e)],onsubmit:a(lu,e,o)}):e.windowManager.open({title:"Cell properties",data:n,body:i,onsubmit:a(lu,e,o)})}};function du(e,t,n,r){var o=e.dom;function i(e,n,r){(1===t.length||r)&&o.setAttrib(e,n,r)}Wa(e)&&cu.syncAdvancedStyleFields(e,r);var a=r.control.rootControl.toJSON();e.undoManager.transact((function(){tu.each(t,(function(r){i(r,"scope",a.scope),i(r,"style",a.style),i(r,"class",a.class),function(e,n,r){(1===t.length||r)&&o.setStyle(e,n,r)}(r,"height",Oa(a.height)),a.type!==r.parentNode.nodeName.toLowerCase()&&function(e,t,n){var r=e.getParent(t,"table"),o=t.parentNode,i=e.select(n,r)[0];i||(i=e.create(n),r.firstChild?"CAPTION"===r.firstChild.nodeName?e.insertAfter(i,r.firstChild):r.insertBefore(i,r.firstChild):r.appendChild(i)),i.appendChild(t),o.hasChildNodes()||e.remove(o)}(e.dom,r,a.type),a.align!==n.align&&(ou(e,r),nu(e,r,a.align))})),e.focus()}))}var mu=function(e){var t,n,r,o,i,u,s=e.dom,c=[];t=s.getParent(e.selection.getStart(),"table"),n=s.getParent(e.selection.getStart(),"td,th"),tu.each(t.rows,(function(e){tu.each(e.cells,(function(t){if(s.getAttrib(t,"data-mce-selected")||t===n)return c.push(e),!1}))})),(r=c[0])&&(i=c.length>1?{height:"",scope:"",style:"",class:"",align:"",type:r.parentNode.nodeName.toLowerCase()}:function(e,t){var n=e.dom,r={height:n.getStyle(t,"height")||n.getAttrib(t,"height"),scope:n.getAttrib(t,"scope"),class:n.getAttrib(t,"class"),align:"",style:"",type:t.parentNode.nodeName.toLowerCase()};return tu.each("left center right".split(" "),(function(n){e.formatter.matchNode(t,"align"+n)&&(r.align=n)})),Wa(e)&&tu.extend(r,cu.extractAdvancedStyles(n,t)),r}(e,r),$a(e).length>0&&(o={name:"class",type:"listbox",label:"Class",values:cu.buildListItems($a(e),(function(t){t.value&&(t.textStyle=function(){return e.formatter.getCssText({block:"tr",classes:[t.value]})})}))}),u={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"Header",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},o]},Wa(e)?e.windowManager.open({title:"Row properties",data:i,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},cu.createStyleForm(e)],onsubmit:a(du,e,c,i)}):e.windowManager.open({title:"Row properties",data:i,body:u,onsubmit:a(du,e,c,i)}))},hu=tinymce.util.Tools.resolve("tinymce.Env"),gu={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},percentages:!0},pu=function(e,t,n,r,o){void 0===o&&(o=gu);var i=ve.fromTag("table");Se(i,o.styles),se(i,o.attributes);var a=ve.fromTag("tbody");mt(i,a);for(var u=[],s=0;s<e;s++){for(var c=ve.fromTag("tr"),l=0;l<t;l++){var f=s<n||l<r?ve.fromTag("th"):ve.fromTag("td");l<r&&ue(f,"scope","row"),s<n&&ue(f,"scope","col"),mt(f,ve.fromTag("br")),o.percentages&&Ce(f,"width",100/t+"%"),mt(c,f)}u.push(c)}return pt(a,u),i},vu=function(e,t){e.selection.select(t.dom(),!0),e.selection.collapse(!0)},bu=function(e,t,n){var r,o=Ha(e),i={styles:o,attributes:Fa(e),percentages:(r=o.width,g(r)&&-1!==r.indexOf("%")&&!Xa(e))},u=pu(n,t,0,0,i);ue(u,"data-mce-id","__mce");var s=function(e){var t=ve.fromTag("div"),n=ve.fromDom(e.dom().cloneNode(!0));return mt(t,n),function(e){return e.dom().innerHTML}(t)}(u);return e.insertContent(s),Ht(Na(e),'table[data-mce-id="__mce"]').map((function(t){return Xa(e)&&Ce(t,"width",Ee(t,"width")),fe(t,"data-mce-id"),function(e,t){N(Bt(t,"tr"),(function(t){Ka(e,t.dom()),N(Bt(t,"th,td"),(function(t){Ga(e,t.dom())}))}))}(e,t),function(e,t){Ht(t,"td,th").each(a(vu,e))}(e,t),t.dom()})).getOr(null)};function yu(e,t,n,r){if("TD"===t.tagName||"TH"===t.tagName)e.setStyle(t,n,r);else if(t.children)for(var o=0;o<t.children.length;o++)yu(e,t.children[o],n,r)}var wu,xu=function(e,t,n){var r,o,i=e.dom;ja(e)&&cu.syncAdvancedStyleFields(e,n),!1===(o=n.control.rootControl.toJSON()).class&&delete o.class,e.undoManager.transact((function(){t||(t=bu(e,o.cols||1,o.rows||1)),function(e,t,n){var r,o=e.dom,i={},a={};if(i.class=n.class,a.height=Oa(n.height),o.getAttrib(t,"width")&&!Va(e)?i.width=(r=n.width)?r.replace(/px$/,""):"":a.width=Oa(n.width),Va(e)?(a["border-width"]=Oa(n.border),a["border-spacing"]=Oa(n.cellspacing),tu.extend(i,{"data-mce-border-color":n.borderColor,"data-mce-cell-padding":n.cellpadding,"data-mce-border":n.border})):tu.extend(i,{border:n.border,cellpadding:n.cellpadding,cellspacing:n.cellspacing}),Va(e)&&t.children)for(var u=0;u<t.children.length;u++)yu(o,t.children[u],{"border-width":Oa(n.border),"border-color":n.borderColor,padding:Oa(n.cellpadding)});n.style?tu.extend(a,o.parseStyle(n.style)):a=tu.extend({},o.parseStyle(o.getAttrib(t,"style")),a),i.style=o.serializeStyle(a),o.setAttribs(t,i)}(e,t,o),(r=i.select("caption",t)[0])&&!o.caption&&i.remove(r),!r&&o.caption&&((r=i.create("caption")).innerHTML=hu.ie?" ":'<br data-mce-bogus="1"/>',t.insertBefore(r,t.firstChild)),ou(e,t),o.align&&nu(e,t,o.align),e.focus(),e.addVisual()}))},Cu=function(e,t){var n,r,o,i,u,s=e.dom,c={};!0===t?(n=s.getParent(e.selection.getStart(),"table"))&&(c=function(e,t){var n=e.dom,r={width:n.getStyle(t,"width")||n.getAttrib(t,"width"),height:n.getStyle(t,"height")||n.getAttrib(t,"height"),cellspacing:n.getStyle(t,"border-spacing")||n.getAttrib(t,"cellspacing"),cellpadding:n.getAttrib(t,"data-mce-cell-padding")||n.getAttrib(t,"cellpadding")||au(e.dom,t,"padding"),border:n.getAttrib(t,"data-mce-border")||n.getAttrib(t,"border")||au(e.dom,t,"border"),borderColor:n.getAttrib(t,"data-mce-border-color"),caption:!!n.select("caption",t)[0],class:n.getAttrib(t,"class")};return tu.each("left center right".split(" "),(function(n){e.formatter.matchNode(t,"align"+n)&&(r.align=n)})),ja(e)&&tu.extend(r,cu.extractAdvancedStyles(n,t)),r}(e,n)):(r={label:"Cols",name:"cols"},o={label:"Rows",name:"rows"}),Ya(e).length>0&&(c.class&&(c.class=c.class.replace(/\s*mce\-item\-table\s*/g,"")),i={name:"class",type:"listbox",label:"Class",values:cu.buildListItems(Ya(e),(function(t){t.value&&(t.textStyle=function(){return e.formatter.getCssText({block:"table",classes:[t.value]})})}))}),u={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:Ua(e)?[r,o,{label:"Width",name:"width",onchange:a(cu.updateStyleField,e)},{label:"Height",name:"height",onchange:a(cu.updateStyleField,e)},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[r,o,{label:"Width",name:"width",onchange:a(cu.updateStyleField,e)},{label:"Height",name:"height",onchange:a(cu.updateStyleField,e)}]},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},i]},ja(e)?e.windowManager.open({title:"Table properties",data:c,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},cu.createStyleForm(e)],onsubmit:a(xu,e,n)}):e.windowManager.open({title:"Table properties",data:c,body:u,onsubmit:a(xu,e,n)})},Su=tu.each,Eu=function(e,t,r,o,i){var s=Ra(e),c=function(t){return function(){return m.from(e.dom.getParent(e.selection.getStart(),t)).map(ve.fromDom)}},l=c("caption"),f=c("th,td"),d=function(e){return Yt(e,s)},h=function(e){return{width:Ta(e.dom()),height:Ta(e.dom())}},g=function(t){f().each((function(n){d(n).each((function(i){var a=vr.forMenu(o,i,n),u=h(i);t(i,a).each((function(t){!function(e,t,n){var r=h(n);t.width===r.width&&t.height===r.height||(Ja(e,n.dom(),t.width,t.height),Qa(e,n.dom(),r.width,r.height))}(e,u,i),e.selection.setRng(t),e.focus(),r.clear(i),Aa(i)}))}))}))},p=function(t){return f().bind((function(t){return d(t).bind((function(r){var i=ve.fromDom(e.getDoc()),a=vr.forMenu(o,r,t),u=Cn(n,i,m.none());return eu(r,a,u)}))}))},v=function(t){i.get().each((function(n){var i=k(n,(function(e){return pn(e)}));f().each((function(n){d(n).each((function(a){var u=ve.fromDom(e.getDoc()),s=Sn(u),c=vr.pasteRows(o,a,n,i,s);t(a,c).each((function(t){e.selection.setRng(t),e.focus(),r.clear(a)}))}))}))}))};Su({mceTableSplitCells:function(){g(t.unmergeCells)},mceTableMergeCells:function(){g(t.mergeCells)},mceTableInsertRowBefore:function(){g(t.insertRowsBefore)},mceTableInsertRowAfter:function(){g(t.insertRowsAfter)},mceTableInsertColBefore:function(){g(t.insertColumnsBefore)},mceTableInsertColAfter:function(){g(t.insertColumnsAfter)},mceTableDeleteCol:function(){g(t.deleteColumn)},mceTableDeleteRow:function(){g(t.deleteRow)},mceTableCutRow:function(e){i.set(p()),g(t.deleteRow)},mceTableCopyRow:function(e){i.set(p())},mceTablePasteRowBefore:function(e){v(t.pasteRowsBefore)},mceTablePasteRowAfter:function(e){v(t.pasteRowsAfter)},mceTableDelete:function(){f().orThunk(l).each((function(t){Yt(t,s).filter(u(s)).each((function(t){var n=ve.fromText("");ft(t,n),bt(t);var r=e.dom.createRng();r.setStart(n.dom(),0),r.setEnd(n.dom(),0),e.selection.setRng(r)}))}))}},(function(t,n){e.addCommand(n,t)})),Su({mceInsertTable:a(Cu,e),mceTableProps:a(Cu,e,!0),mceTableRowProps:a(mu,e),mceTableCellProps:a(fu,e)},(function(t,n){e.addCommand(n,(function(e,n){t(n)}))}))},ku=function(e){var t=m.from(e.dom().documentElement).map(ve.fromDom).getOr(e);return{parent:o(t),view:o(e),origin:o(Wr(0,0))}},Nu=function(e,t){return{parent:o(t),view:o(e),origin:o(Wr(0,0))}},Tu=function(e){var t=z.apply(null,e),n=[];return{bind:function(e){if(void 0===e)throw new Error("Event bind error: undefined handler");n.push(e)},unbind:function(e){n=T(n,(function(t){return t!==e}))},trigger:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.apply(null,e);N(n,(function(e){e(o)}))}}},_u=function(e){return{registry:F(e,(function(e){return{bind:e.bind,unbind:e.unbind}})),trigger:F(e,(function(e){return e.trigger}))}},Ru=function(e,t){return function(n){if(e(n)){var i=ve.fromDom(n.target),a=function(){n.stopPropagation()},u=function(){n.preventDefault()},s=r(u,a),c=function(e,t,n,r,i,a,u){return{target:o(e),x:o(t),y:o(n),stop:r,prevent:i,kill:a,raw:o(u)}}(i,n.clientX,n.clientY,a,u,s,n);t(c)}}},Ou=function(e,t,n,r){return function(e,t,n,r,o){var i=Ru(n,r);return e.dom().addEventListener(t,i,o),{unbind:a(Au,e,t,i,o)}}(e,t,n,r,!1)},Au=function(e,t,n,r){e.dom().removeEventListener(t,n,r)},Du=o(!0),Pu=function(e,t,n){return Ou(e,t,Du,n)},Bu=Object.prototype.hasOwnProperty,Iu=(wu=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Bu.call(o,i)&&(n[i]=wu(n[i],o[i]))}return n}),Mu={resolve:Co("ephox-dragster").resolve},Lu=Zi(["compare","extract","mutate","sink"]),Fu=Zi(["element","start","stop","destroy"]),Hu=Zi(["forceDrop","drop","move","delayDrop"]),zu=Lu({compare:function(e,t){return Wr(t.left()-e.left(),t.top()-e.top())},extract:function(e){return m.some(Wr(e.x(),e.y()))},sink:function(e,t){var n=function(e){var t=Iu({layerClass:Mu.resolve("blocker")},e),n=ve.fromTag("div");return ue(n,"role","presentation"),Se(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),go(n,Mu.resolve("blocker")),go(n,t.layerClass),{element:function(){return n},destroy:function(){bt(n)}}}(t),r=Pu(n.element(),"mousedown",e.forceDrop),o=Pu(n.element(),"mouseup",e.drop),i=Pu(n.element(),"mousemove",e.move),a=Pu(n.element(),"mouseout",e.delayDrop);return Fu({element:n.element,start:function(e){mt(e,n.element())},stop:function(){bt(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),a.unbind(),r.unbind()}})},mutate:function(e,t){e.mutate(t.left(),t.top())}});function Wu(){var e=m.none(),t=_u({move:Tu(["info"])});return{onEvent:function(n,r){r.extract(n).each((function(n){(function(t,n){var r=e.map((function(e){return t.compare(e,n)}));return e=m.some(n),r})(r,n).each((function(e){t.trigger.move(e)}))}))},reset:function(){e=m.none()},events:t.registry}}function ju(){var e={onEvent:n,reset:n},t=Wu(),r=e;return{on:function(){r.reset(),r=t},off:function(){r.reset(),r=e},isOn:function(){return r===t},onEvent:function(e,t){r.onEvent(e,t)},events:t.events}}var Uu=function(t,n,r){var o,i,a,u=!1,s=_u({start:Tu([]),stop:Tu([])}),c=ju(),l=function(){m.stop(),c.isOn()&&(c.off(),s.trigger.stop())},f=(o=l,i=200,a=null,{cancel:function(){null!==a&&(e.clearTimeout(a),a=null)},throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null!==a&&e.clearTimeout(a),a=e.setTimeout((function(){o.apply(null,t),a=null}),i)}});c.events.move.bind((function(e){n.mutate(t,e.info())}));var d=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];u&&e.apply(null,t)}},m=n.sink(Hu({forceDrop:l,drop:d(l),move:d((function(e){f.cancel(),c.onEvent(e,n)})),delayDrop:d(f.throttle)}),r);return{element:m.element,go:function(e){m.start(e),c.on(),s.trigger.start()},on:function(){u=!0},off:function(){u=!1},destroy:function(){m.destroy()},events:s.registry}},Vu=function(e,t){void 0===t&&(t={});var n=void 0!==t.mode?t.mode:zu;return Uu(e,n,t)},qu=function(){var e=_u({drag:Tu(["xDelta","yDelta","target"])}),t=m.none(),n=function(){var e=_u({drag:Tu(["xDelta","yDelta"])});return{mutate:function(t,n){e.trigger.drag(t,n)},events:e.registry}}();return n.events.drag.bind((function(n){t.each((function(t){e.trigger.drag(n.xDelta(),n.yDelta(),t)}))})),{assign:function(e){t=m.some(e)},get:function(){return t},mutate:n.mutate,events:e.registry}},$u=function(e){return"true"===ce(e,"contenteditable")},Yu=Eo.resolve("resizer-bar-dragging"),Xu=function(e,t,n){var r=qu(),o=Vu(r,{}),i=m.none(),u=function(e,t){return m.from(ce(e,t))};r.events.drag.bind((function(e){u(e.target(),"data-row").each((function(t){var n=Oi.getInt(e.target(),"top");Ce(e.target(),"top",n+e.yDelta()+"px")})),u(e.target(),"data-column").each((function(t){var n=Oi.getInt(e.target(),"left");Ce(e.target(),"left",n+e.xDelta()+"px")}))}));var s=function(e,t){return Oi.getInt(e,t)-parseInt(ce(e,"data-initial-"+t),10)};o.events.stop.bind((function(){r.get().each((function(r){i.each((function(o){u(r,"data-row").each((function(e){var t=s(r,"top");fe(r,"data-initial-top"),g.trigger.adjustHeight(o,t,parseInt(e,10))})),u(r,"data-column").each((function(e){var t=s(r,"left");fe(r,"data-initial-left"),g.trigger.adjustWidth(o,t,parseInt(e,10))})),Bo(e,o,n,t)}))}))}));var c=function(t,n){g.trigger.startAdjust(),r.assign(t),ue(t,"data-initial-"+n,parseInt(Ee(t,n),10)),go(t,Yu),Ce(t,"opacity","0.2"),o.go(e.parent())},l=Pu(e.parent(),"mousedown",(function(e){Fo(e.target())&&c(e.target(),"top"),Ho(e.target())&&c(e.target(),"left")})),f=function(t){return et(t,e.view())},d=function(e){return zt(e,"table",f).filter((function(e){return function(e,t){return zt(e,"[contenteditable]",t)}(e,f).exists($u)}))},h=Pu(e.view(),"mouseover",(function(r){d(r.target()).fold((function(){be(r.target())&&Lo(e)}),(function(r){i=m.some(r),Bo(e,r,n,t)}))})),g=_u({adjustHeight:Tu(["table","delta","row"]),adjustWidth:Tu(["table","delta","column"]),startAdjust:Tu([])});return{destroy:function(){l.unbind(),h.unbind(),o.destroy(),Lo(e)},refresh:function(r){Bo(e,r,n,t)},on:o.on,off:o.off,hideBars:a(Io,e),showBars:a(Mo,e),events:g.registry}},Ku=function(e,t){var n=to.height,r=Xu(e,t,n),o=_u({beforeResize:Tu(["table"]),afterResize:Tu(["table"]),startDrag:Tu([])});return r.events.adjustHeight.bind((function(e){o.trigger.beforeResize(e.table());var t=n.delta(e.delta(),e.table());Xi(e.table(),t,e.row(),n),o.trigger.afterResize(e.table())})),r.events.startAdjust.bind((function(e){o.trigger.startDrag()})),r.events.adjustWidth.bind((function(e){o.trigger.beforeResize(e.table());var n=t.delta(e.delta(),e.table());Yi(e.table(),n,e.column(),t),o.trigger.afterResize(e.table())})),{on:r.on,off:r.off,hideBars:r.hideBars,showBars:r.showBars,destroy:r.destroy,events:o.registry}},Gu=function(e,t){return e.inline?Nu(Na(e),function(){var e=ve.fromTag("div");return Se(e,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),mt(ye(),e),e}()):ku(ve.fromDom(e.getDoc()))},Ju=function(e,t){e.inline&&bt(t.parent())},Qu=function(e){var t,n,r=m.none(),o=m.none(),i=m.none(),a=/(\d+(\.\d+)?)%/,u=function(e){return"TABLE"===e.nodeName};return e.on("init",(function(){var t=ro(Ba),n=Gu(e);if(i=m.some(n),function(e){var t=e.getParam("object_resizing",!0);return"table"===t||t}(e)&&function(e){return e.getParam("table_resize_bars",!0,"boolean")}(e)){var a=Ku(n,t);a.on(),a.events.startDrag.bind((function(t){r=m.some(e.selection.getRng())})),a.events.beforeResize.bind((function(t){var n=t.table().dom();Ja(e,n,Ta(n),_a(n))})),a.events.afterResize.bind((function(t){var n=t.table(),o=n.dom();Aa(n),r.each((function(t){e.selection.setRng(t),e.focus()})),Qa(e,o,Ta(o),_a(o)),e.undoManager.add()})),o=m.some(a)}})),e.on("ObjectResizeStart",(function(r){var o,i=r.target;u(i)&&(t=r.width,o=i,n=e.dom.getStyle(o,"width")||e.dom.getAttrib(o,"width"))})),e.on("ObjectResized",(function(r){var o=r.target;if(u(o)){var i=o;if(a.test(n)){var s=parseFloat(a.exec(n)[1]),c=r.width*s/t;e.dom.setStyle(i,"width",c+"%")}else{var l=[];tu.each(i.rows,(function(t){tu.each(t.cells,(function(t){var n=e.dom.getStyle(t,"width",!0);l.push({cell:t,width:n})}))})),tu.each(l,(function(t){e.dom.setStyle(t.cell,"width",t.width),e.dom.setAttrib(t.cell,"width",null)}))}}})),{lazyResize:function(){return o},lazyWire:function(){return i.getOr(ku(ve.fromDom(e.getBody())))},destroy:function(){o.each((function(e){e.destroy()})),i.each((function(t){Ju(e,t)}))}}},Zu=sr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),es=io(io({},Zu),{none:function(e){return void 0===e&&(e=void 0),Zu.none(e)}}),ts=function(e,t){return Yt(e,t).bind((function(t){var n=$t(t);return A(n,(function(t){return et(e,t)})).map((function(e){return{index:o(e),all:o(n)}}))}))},ns=function(e,t){return ts(e,t).fold((function(){return es.none(e)}),(function(t){return t.index()+1<t.all().length?es.middle(e,t.all()[t.index()+1]):es.last(e)}))},rs=function(e,t){return ts(e,t).fold((function(){return es.none()}),(function(t){return t.index()-1>=0?es.middle(e,t.all()[t.index()-1]):es.first(e)}))},os={create:z("start","soffset","finish","foffset")},is=sr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),as={before:is.before,on:is.on,after:is.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(i,i,i)}},us=sr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ss={domRange:us.domRange,relative:us.relative,exact:us.exact,exactFromRange:function(e){return us.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){var t,n=function(e){return e.match({domRange:function(e){return ve.fromDom(e.startContainer)},relative:function(e,t){return as.getStart(e)},exact:function(e,t,n,r){return e}})}(e);return t=n,ve.fromDom(t.dom().ownerDocument.defaultView)},range:os.create},cs=function(e,t){e.selectNodeContents(t.dom())},ls=function(e,t,n){var r,o=e.document.createRange();return r=o,t.fold((function(e){r.setStartBefore(e.dom())}),(function(e,t){r.setStart(e.dom(),t)}),(function(e){r.setStartAfter(e.dom())})),function(e,t){t.fold((function(t){e.setEndBefore(t.dom())}),(function(t,n){e.setEnd(t.dom(),n)}),(function(t){e.setEndAfter(t.dom())}))}(o,n),o},fs=function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom(),n),i.setEnd(r.dom(),o),i},ds=function(e){return{left:o(e.left),top:o(e.top),right:o(e.right),bottom:o(e.bottom),width:o(e.width),height:o(e.height)}},ms=sr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),hs=function(e,t,n){return t(ve.fromDom(n.startContainer),n.startOffset,ve.fromDom(n.endContainer),n.endOffset)},gs=function(e,t){return function(e,t){var n=t.ltr();return n.collapsed?t.rtl().filter((function(e){return!1===e.collapsed})).map((function(e){return ms.rtl(ve.fromDom(e.endContainer),e.endOffset,ve.fromDom(e.startContainer),e.startOffset)})).getOrThunk((function(){return hs(0,ms.ltr,n)})):hs(0,ms.ltr,n)}(0,function(e,t){return t.match({domRange:function(e){return{ltr:o(e),rtl:m.none}},relative:function(t,n){return{ltr:ge((function(){return ls(e,t,n)})),rtl:ge((function(){return m.some(ls(e,n,t))}))}},exact:function(t,n,r,o){return{ltr:ge((function(){return fs(e,t,n,r,o)})),rtl:ge((function(){return m.some(fs(e,r,o,t,n))}))}}})}(e,t))},ps=function(e,t){return gs(e,t).match({ltr:function(t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom(),n),i.setEnd(r.dom(),o),i},rtl:function(t,n,r,o){var i=e.document.createRange();return i.setStart(r.dom(),o),i.setEnd(t.dom(),n),i}})},vs=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},bs=function(e,t,n,r,o){var i=function(n){var r=e.dom().createRange();return r.setStart(t.dom(),n),r.collapse(!0),r},a=on(t).length,u=function(e,t,n,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,a=1;a<o;a++){var u=e(a),s=Math.abs(t-u.left);if(n<=u.bottom){if(n<u.top||s>i)return a-1;i=s}}return 0}((function(e){return i(e).getBoundingClientRect()}),n,r,o.right,a);return i(u)},ys=function(e,t,n,r){return ie(t)?function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getClientRects();return uo(i,(function(e){return vs(e,n,r)?m.some(e):m.none()})).map((function(o){return bs(e,t,n,r,o)}))}(e,t,n,r):function(e,t,n,r){var o=e.dom().createRange(),i=st(t);return uo(i,(function(t){return o.selectNode(t.dom()),vs(o.getBoundingClientRect(),n,r)?ys(e,t,n,r):m.none()}))}(e,t,n,r)},ws=function(e,t){return t-e.left<e.right-t},xs=function(e,t,n){var r=e.dom().createRange();return r.selectNode(t.dom()),r.collapse(n),r},Cs=function(e,t,n){var r=e.dom().createRange();r.selectNode(t.dom());var o=r.getBoundingClientRect(),i=ws(o,n);return(!0===i?fn:dn)(t).map((function(t){return xs(e,t,i)}))},Ss=function(e,t,n){var r=t.dom().getBoundingClientRect(),o=ws(r,n);return m.some(xs(e,t,o))},Es=function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect();return function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),a=Math.max(i.left,Math.min(i.right,n)),u=Math.max(i.top,Math.min(i.bottom,r));return ys(e,t,a,u)}(e,t,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},ks=document.caretPositionFromPoint?function(e,t,n){return m.from(e.dom().caretPositionFromPoint(t,n)).bind((function(t){if(null===t.offsetNode)return m.none();var n=e.dom().createRange();return n.setStart(t.offsetNode,t.offset),n.collapse(),m.some(n)}))}:document.caretRangeFromPoint?function(e,t,n){return m.from(e.dom().caretRangeFromPoint(t,n))}:function(e,t,n){return ve.fromPoint(e,t,n).bind((function(r){var o=function(){return function(e,t,n){return(0===st(t).length?Ss:Cs)(e,t,n)}(e,r,t)};return 0===st(r).length?o():Es(e,r,t,n).orThunk(o)}))},Ns=function(e,t){var n=ee(e);return"input"===n?as.after(e):S(["br","img"],n)?0===t?as.before(e):as.after(e):as.on(e,t)},Ts=function(e,t){var n=e.fold(as.before,Ns,as.after),r=t.fold(as.before,Ns,as.after);return ss.relative(n,r)},_s=function(e,t,n,r){var o=Ns(e,t),i=Ns(n,r);return ss.relative(o,i)},Rs=function(e,t,n,r){var o=function(e,t,n,r){var o=rt(e).dom().createRange();return o.setStart(e.dom(),t),o.setEnd(n.dom(),r),o}(e,t,n,r),i=et(e,n)&&t===r;return o.collapsed&&!i},Os=function(e,t){m.from(e.getSelection()).each((function(e){e.removeAllRanges(),e.addRange(t)}))},As=function(e,t,n,r,o){var i=fs(e,t,n,r,o);Os(e,i)},Ds=function(e,t){return gs(e,t).match({ltr:function(t,n,r,o){As(e,t,n,r,o)},rtl:function(t,n,r,o){var i=e.getSelection();if(i.setBaseAndExtent)i.setBaseAndExtent(t.dom(),n,r.dom(),o);else if(i.extend)try{!function(e,t,n,r,o,i){t.collapse(n.dom(),r),t.extend(o.dom(),i)}(0,i,t,n,r,o)}catch(i){As(e,r,o,t,n)}else As(e,r,o,t,n)}})},Ps=function(e){var t=ss.getWin(e).dom(),n=function(e,n,r,o){return fs(t,e,n,r,o)},r=function(e){return e.match({domRange:function(e){var t=ve.fromDom(e.startContainer),n=ve.fromDom(e.endContainer);return _s(t,e.startOffset,n,e.endOffset)},relative:Ts,exact:_s})}(e);return gs(t,r).match({ltr:n,rtl:n})},Bs=function(e){var t=ve.fromDom(e.anchorNode),n=ve.fromDom(e.focusNode);return Rs(t,e.anchorOffset,n,e.focusOffset)?m.some(os.create(t,e.anchorOffset,n,e.focusOffset)):function(e){if(e.rangeCount>0){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return m.some(os.create(ve.fromDom(t.startContainer),t.startOffset,ve.fromDom(n.endContainer),n.endOffset))}return m.none()}(e)},Is=function(e,t){var n=function(e,t){var n=e.document.createRange();return cs(n,t),n}(e,t);Os(e,n)},Ms=function(e){return function(e){return m.from(e.getSelection()).filter((function(e){return e.rangeCount>0})).bind(Bs)}(e).map((function(e){return ss.exact(e.start(),e.soffset(),e.finish(),e.foffset())}))},Ls=function(e,t){return function(e){var t=e.getClientRects(),n=t.length>0?t[0]:e.getBoundingClientRect();return n.width>0||n.height>0?m.some(n).map(ds):m.none()}(ps(e,t))},Fs=function(e,t,n){return function(e,t,n){var r=ve.fromDom(e.document);return ks(r,t,n).map((function(e){return os.create(ve.fromDom(e.startContainer),e.startOffset,ve.fromDom(e.endContainer),e.endOffset)}))}(e,t,n)},Hs=tinymce.util.Tools.resolve("tinymce.util.VK"),zs=function(e,t,n,r){return Vs(e,t,ns(n),r)},Ws=function(e,t,n,r){return Vs(e,t,rs(n),r)},js=function(e,t){var n=ss.exact(t,0,t,0);return Ps(n)},Us=function(e,t){var n,r=Bt(t,"tr");return(n=r,0===n.length?m.none():m.some(n[n.length-1])).bind((function(e){return Ht(e,"td,th").map((function(e){return js(0,e)}))}))},Vs=function(e,t,n,r,o){return n.fold(m.none,m.none,(function(e,t){return fn(t).map((function(e){return js(0,e)}))}),(function(n){return Yt(n,t).bind((function(t){var o=vr.noMenu(n);return e.undoManager.transact((function(){r.insertRowsAfter(t,o)})),Us(0,t)}))}))},qs=["table","li","dl"],$s=function(e,t,n,r){if(e.keyCode===Hs.TAB){var o=Na(t),i=function(e){var t=ee(e);return et(e,o)||S(qs,t)},a=t.selection.getRng();if(a.collapsed){var u=ve.fromDom(a.startContainer);qt(u,i).each((function(o){e.preventDefault(),(e.shiftKey?Ws:zs)(t,i,o,n,r).each((function(e){t.selection.setRng(e)}))}))}}},Ys={create:z("selection","kill")},Xs=function(e,t,n,r){return{start:o(as.on(e,t)),finish:o(as.on(n,r))}},Ks={convertToRange:function(e,t){var n=ps(e,t);return os.create(ve.fromDom(n.startContainer),n.startOffset,ve.fromDom(n.endContainer),n.endOffset)},makeSitus:Xs},Gs=function(e,t,n,r,o){return et(n,r)?m.none():er(n,r,t).bind((function(t){var r=t.boxes().getOr([]);return r.length>0?(o(e,r,t.start(),t.finish()),m.some(Ys.create(m.some(Ks.makeSitus(n,0,n,sn(n))),!0))):m.none()}))},Js={sync:function(e,t,n,r,o,i,a){return et(n,o)&&r===i?m.none():zt(n,"td,th",t).bind((function(n){return zt(o,"td,th",t).bind((function(r){return Gs(e,t,n,r,a)}))}))},detect:Gs,update:function(e,t,n,r,o){return nr(r,e,t,o.firstSelectedSelector(),o.lastSelectedSelector()).map((function(e){return o.clear(n),o.selectRange(n,e.boxes(),e.start(),e.finish()),e.boxes()}))}},Qs=z("item","mode"),Zs=function(e,t,n,r){return void 0===r&&(r=ec),e.property().parent(t).map((function(e){return Qs(e,r)}))},ec=function(e,t,n,r){return void 0===r&&(r=tc),n.sibling(e,t).map((function(e){return Qs(e,r)}))},tc=function(e,t,n,r){void 0===r&&(r=tc);var o=e.property().children(t);return n.first(o).map((function(e){return Qs(e,r)}))},nc=[{current:Zs,next:ec,fallback:m.none()},{current:ec,next:tc,fallback:m.some(Zs)},{current:tc,next:tc,fallback:m.some(ec)}],rc=function(e,t,n,r,o){return void 0===o&&(o=nc),O(o,(function(e){return e.current===n})).bind((function(n){return n.current(e,t,r,n.next).orThunk((function(){return n.fallback.bind((function(n){return rc(e,t,n,r)}))}))}))},oc=function(){return{sibling:function(e,t){return e.query().prevSibling(t)},first:function(e){return e.length>0?m.some(e[e.length-1]):m.none()}}},ic=function(){return{sibling:function(e,t){return e.query().nextSibling(t)},first:function(e){return e.length>0?m.some(e[0]):m.none()}}},ac=function(e,t,n,r,o,i){return rc(e,t,r,o).bind((function(t){return i(t.item())?m.none():n(t.item())?m.some(t.item()):ac(e,t.item(),n,t.mode(),o,i)}))},uc=function(e){return function(t){return 0===e.property().children(t).length}},sc=function(e,t,n,r){return ac(e,t,n,ec,oc(),r)},cc=function(e,t,n,r){return ac(e,t,n,ec,ic(),r)},lc=Hn(),fc=function(e,t){return function(e,t,n){return sc(e,t,uc(e),n)}(lc,e,t)},dc=function(e,t){return function(e,t,n){return cc(e,t,uc(e),n)}(lc,e,t)},mc=z("element","offset"),hc=(z("element","deltaOffset"),z("element","start","finish"),z("begin","end"),z("element","text"),sr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}])),gc=function(e){return zt(e,"tr")},pc=io(io({},hc),{verify:function(e,t,n,r,o,i,a){return zt(r,"td,th",a).bind((function(n){return zt(t,"td,th",a).map((function(t){return et(n,t)?et(r,n)&&sn(n)===o?i(t):hc.none("in same cell"):Kn(gc,[n,t]).fold((function(){return function(e,t,n){var r=e.getRect(t),o=e.getRect(n);return o.right>r.left&&o.left<r.right}(e,t,n)?hc.success():i(t)}),(function(e){return i(t)}))}))})).getOr(hc.none("default"))},cata:function(e,t,n,r,o){return e.fold(t,n,r,o)}}),vc=(z("ancestor","descendants","element","index"),z("parent","children","element","index")),bc=function(e,t){return A(e,a(et,t))},yc=function(e){return"br"===ee(e)},wc=function(e,t,n){return t(e,n).bind((function(e){return ie(e)&&0===on(e).trim().length?wc(e,t,n):m.some(e)}))},xc=function(e,t,n,r){return function(e,t){return ct(e,t).filter(yc).orThunk((function(){return ct(e,t-1).filter(yc)}))}(t,n).bind((function(t){return r.traverse(t).fold((function(){return wc(t,r.gather,e).map(r.relative)}),(function(e){return function(e){return ot(e).bind((function(t){var n=st(t);return bc(n,e).map((function(r){return vc(t,n,e,r)}))}))}(e).map((function(e){return as.on(e.parent(),e.index())}))}))}))},Cc=function(e,t,n,r){return(yc(t)?function(e,t,n){return n.traverse(t).orThunk((function(){return wc(t,n.gather,e)})).map(n.relative)}(e,t,r):xc(e,t,n,r)).map((function(e){return{start:o(e),finish:o(e)}}))},Sc=function(e){return pc.cata(e,(function(e){return m.none()}),(function(){return m.none()}),(function(e){return m.some(mc(e,0))}),(function(e){return m.some(mc(e,sn(e)))}))},Ec=$(["left","top","right","bottom"],[]),kc={nu:Ec,moveUp:function(e,t){return Ec({left:e.left(),top:e.top()-t,right:e.right(),bottom:e.bottom()-t})},moveDown:function(e,t){return Ec({left:e.left(),top:e.top()+t,right:e.right(),bottom:e.bottom()+t})},moveBottomTo:function(e,t){var n=e.bottom()-e.top();return Ec({left:e.left(),top:t-n,right:e.right(),bottom:t})},moveTopTo:function(e,t){var n=e.bottom()-e.top();return Ec({left:e.left(),top:t,right:e.right(),bottom:t+n})},getTop:function(e){return e.top()},getBottom:function(e){return e.bottom()},translate:function(e,t,n){return Ec({left:e.left()+t,top:e.top()+n,right:e.right()+t,bottom:e.bottom()+n})},toString:function(e){return"("+e.left()+", "+e.top()+") -> ("+e.right()+", "+e.bottom()+")"}},Nc=function(e){return kc.nu({left:e.left,top:e.top,right:e.right,bottom:e.bottom})},Tc=function(e,t){return m.some(e.getRect(t))},_c=function(e,t,n){return oe(t)?Tc(e,t).map(Nc):ie(t)?function(e,t,n){return n>=0&&n<sn(t)?e.getRangedRect(t,n,t,n+1):n>0?e.getRangedRect(t,n-1,t,n):m.none()}(e,t,n).map(Nc):m.none()},Rc=function(e,t){return oe(t)?Tc(e,t).map(Nc):ie(t)?e.getRangedRect(t,0,t,sn(t)).map(Nc):m.none()},Oc=sr([{none:[]},{retry:["caret"]}]),Ac=function(e,t,n){return(r=t,i=da,It((function(e,t){return t(e)}),Mt,r,i,a)).fold(o(!1),(function(t){return Rc(e,t).exists((function(e){return function(e,t){return e.left()<t.left()||Math.abs(t.right()-e.left())<1||e.left()>t.right()}(n,e)}))}));var r,i,a},Dc={point:kc.getTop,adjuster:function(e,t,n,r,o){var i=kc.moveUp(o,5);return Math.abs(n.top()-r.top())<1?Oc.retry(i):n.bottom()<o.top()?Oc.retry(i):n.bottom()===o.top()?Oc.retry(kc.moveUp(o,1)):Ac(e,t,o)?Oc.retry(kc.translate(i,5,0)):Oc.none()},move:kc.moveUp,gather:fc},Pc={point:kc.getBottom,adjuster:function(e,t,n,r,o){var i=kc.moveDown(o,5);return Math.abs(n.bottom()-r.bottom())<1?Oc.retry(i):n.top()>o.bottom()?Oc.retry(i):n.top()===o.bottom()?Oc.retry(kc.moveDown(o,1)):Ac(e,t,o)?Oc.retry(kc.translate(i,5,0)):Oc.none()},move:kc.moveDown,gather:dc},Bc=function(e,t,n,r,o){return 0===o?m.some(r):function(e,t,n){return e.elementFromPoint(t,n).filter((function(e){return"table"===ee(e)})).isSome()}(e,r.left(),t.point(r))?function(e,t,n,r,o){return Bc(e,t,n,t.move(r,5),o)}(e,t,n,r,o-1):e.situsFromPoint(r.left(),t.point(r)).bind((function(i){return i.start().fold(m.none,(function(i){return Rc(e,i).bind((function(a){return t.adjuster(e,i,a,n,r).fold(m.none,(function(r){return Bc(e,t,n,r,o-1)}))})).orThunk((function(){return m.some(r)}))}),m.none)}))},Ic=function(e,t,n){var r=e.move(n,5),o=Bc(t,e,n,r,100).getOr(r);return function(e,t,n){return e.point(t)>n.getInnerHeight()?m.some(e.point(t)-n.getInnerHeight()):e.point(t)<0?m.some(-e.point(t)):m.none()}(e,o,t).fold((function(){return t.situsFromPoint(o.left(),e.point(o))}),(function(n){return t.scrollBy(0,n),t.situsFromPoint(o.left(),e.point(o)-n)}))},Mc={tryUp:a(Ic,Dc),tryDown:a(Ic,Pc),ieTryUp:function(e,t){return e.situsFromPoint(t.left(),t.top()-5)},ieTryDown:function(e,t){return e.situsFromPoint(t.left(),t.bottom()+5)},getJumpSize:o(5)},Lc=Ke.detect(),Fc=function(e,t,n,r,o,i){return 0===i?m.none():Wc(e,t,n,r,o).bind((function(a){var u=e.fromSitus(a),s=pc.verify(e,n,r,u.finish(),u.foffset(),o.failure,t);return pc.cata(s,(function(){return m.none()}),(function(){return m.some(a)}),(function(a){return et(n,a)&&0===r?Hc(e,n,r,kc.moveUp,o):Fc(e,t,a,0,o,i-1)}),(function(a){return et(n,a)&&r===sn(a)?Hc(e,n,r,kc.moveDown,o):Fc(e,t,a,sn(a),o,i-1)}))}))},Hc=function(e,t,n,r,o){return _c(e,t,n).bind((function(t){return zc(e,o,r(t,Mc.getJumpSize()))}))},zc=function(e,t,n){return Lc.browser.isChrome()||Lc.browser.isSafari()||Lc.browser.isFirefox()||Lc.browser.isEdge()?t.otherRetry(e,n):Lc.browser.isIE()?t.ieRetry(e,n):m.none()},Wc=function(e,t,n,r,o){return _c(e,n,r).bind((function(t){return zc(e,o,t)}))},jc=function(e,t,n){return function(e,t,n){return e.getSelection().bind((function(r){return Cc(t,r.finish(),r.foffset(),n).fold((function(){return m.some(mc(r.finish(),r.foffset()))}),(function(o){var i=e.fromSitus(o),a=pc.verify(e,r.finish(),r.foffset(),i.finish(),i.foffset(),n.failure,t);return Sc(a)}))}))}(e,t,n).bind((function(r){return Fc(e,t,r.element(),r.offset(),n,20).map(e.fromSitus)}))},Uc=Ke.detect(),Vc=function(e,t){return Mt(e,(function(e){return ot(e).exists((function(e){return et(e,t)}))}),n).isSome();var n},qc=function(e,t,n,r,i){return zt(r,"td,th",t).bind((function(r){return zt(r,"table",t).bind((function(a){return Vc(i,a)?jc(e,t,n).bind((function(e){return zt(e.finish(),"td,th",t).map((function(t){return{start:o(r),finish:o(t),range:o(e)}}))})):m.none()}))}))},$c=function(e,t,n,r,o,i){return Uc.browser.isIE()?m.none():i(r,t).orThunk((function(){return qc(e,t,n,r,o).map((function(e){var t=e.range();return Ys.create(m.some(Ks.makeSitus(t.start(),t.soffset(),t.finish(),t.foffset())),!0)}))}))},Yc=function(e,t,n,r,o,i,a){return qc(e,n,r,o,i).bind((function(e){return Js.detect(t,n,e.start(),e.finish(),a)}))},Xc=function(e,t){return zt(e,"tr",t).bind((function(e){return zt(e,"table",t).bind((function(n){var r=Bt(n,"tr");return et(e,r[0])?function(e,t,n){return sc(lc,e,t,n)}(n,(function(e){return dn(e).isSome()}),t).map((function(e){var t=sn(e);return Ys.create(m.some(Ks.makeSitus(e,t,e,t)),!0)})):m.none()}))}))},Kc=function(e,t){return zt(e,"tr",t).bind((function(e){return zt(e,"table",t).bind((function(n){var r=Bt(n,"tr");return et(e,r[r.length-1])?function(e,t,n){return cc(lc,e,t,n)}(n,(function(e){return fn(e).isSome()}),t).map((function(e){return Ys.create(m.some(Ks.makeSitus(e,0,e,0)),!0)})):m.none()}))}))},Gc=function(e,t){return zt(e,"td,th",t)},Jc={down:{traverse:ut,gather:dc,relative:as.before,otherRetry:Mc.tryDown,ieRetry:Mc.ieTryDown,failure:pc.failedDown},up:{traverse:at,gather:fc,relative:as.before,otherRetry:Mc.tryUp,ieRetry:Mc.ieTryUp,failure:pc.failedUp}},Qc=function(e){return function(t){return t===e}},Zc=Qc(38),el=Qc(40),tl={ltr:{isBackward:Qc(37),isForward:Qc(39)},rtl:{isBackward:Qc(39),isForward:Qc(37)},isUp:Zc,isDown:el,isNavigation:function(e){return e>=37&&e<=40}},nl=function(e){return{left:e.left(),top:e.top(),right:e.right(),bottom:e.bottom(),width:e.width(),height:e.height()}},rl=(Ke.detect().browser.isSafari(),function(t){return{elementFromPoint:function(e,n){return ve.fromPoint(ve.fromDom(t.document),e,n)},getRect:function(e){return e.dom().getBoundingClientRect()},getRangedRect:function(e,n,r,o){var i=ss.exact(e,n,r,o);return Ls(t,i).map(nl)},getSelection:function(){return Ms(t).map((function(e){return Ks.convertToRange(t,e)}))},fromSitus:function(e){var n=ss.relative(e.start(),e.finish());return Ks.convertToRange(t,n)},situsFromPoint:function(e,n){return Fs(t,e,n).map((function(e){return Xs(e.start(),e.soffset(),e.finish(),e.foffset())}))},clearSelection:function(){!function(e){e.getSelection().removeAllRanges()}(t)},setSelection:function(e){!function(e,t,n,r,o){var i=_s(t,n,r,o);Ds(e,i)}(t,e.start(),e.soffset(),e.finish(),e.foffset())},setRelativeSelection:function(e,n){!function(e,t,n){var r=Ts(t,n);Ds(e,r)}(t,e,n)},selectContents:function(e){Is(t,e)},getInnerHeight:function(){return t.innerHeight},getScrollY:function(){var n,r,o,i;return(n=ve.fromDom(t.document),r=void 0!==n?n.dom():e.document,o=r.body.scrollLeft||r.documentElement.scrollLeft,i=r.body.scrollTop||r.documentElement.scrollTop,Wr(o,i)).top()},scrollBy:function(n,r){!function(t,n,r){(void 0!==r?r.dom():e.document).defaultView.scrollBy(t,n)}(n,r,ve.fromDom(t.document))}}}),ol=z("rows","cols"),il=function(e,t,n,r){var o=function(e,t,n,r){var o=m.none(),i=function(){o=m.none()};return{mousedown:function(e){r.clear(t),o=Gc(e.target(),n)},mouseover:function(i){o.each((function(o){r.clear(t),Gc(i.target(),n).each((function(i){er(o,i,n).each((function(n){var a=n.boxes().getOr([]);(a.length>1||1===a.length&&!et(o,i))&&(r.selectRange(t,a,n.start(),n.finish()),e.selectContents(i))}))}))}))},mouseup:function(e){o.each(i)}}}(rl(e),t,n,r);return{mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},al=function(e,t,n,r){var o=rl(e),i=function(){return r.clear(t),m.none()};return{keydown:function(e,u,s,c,l,f){var d=e.raw(),h=d.which,g=!0===d.shiftKey;return tr(t,r.selectedSelector()).fold((function(){return tl.isDown(h)&&g?a(Yc,o,t,n,Jc.down,c,u,r.selectRange):tl.isUp(h)&&g?a(Yc,o,t,n,Jc.up,c,u,r.selectRange):tl.isDown(h)?a($c,o,n,Jc.down,c,u,Kc):tl.isUp(h)?a($c,o,n,Jc.up,c,u,Xc):m.none}),(function(e){var n=function(n){return function(){return uo(n,(function(n){return Js.update(n.rows(),n.cols(),t,e,r)})).fold((function(){return rr(t,r.firstSelectedSelector(),r.lastSelectedSelector()).map((function(e){var n=tl.isDown(h)||f.isForward(h)?as.after:as.before;return o.setRelativeSelection(as.on(e.first(),0),n(e.table())),r.clear(t),Ys.create(m.none(),!0)}))}),(function(e){return m.some(Ys.create(m.none(),!0))}))}};return tl.isDown(h)&&g?n([ol(1,0)]):tl.isUp(h)&&g?n([ol(-1,0)]):f.isBackward(h)&&g?n([ol(0,-1),ol(-1,0)]):f.isForward(h)&&g?n([ol(0,1),ol(1,0)]):tl.isNavigation(h)&&!1===g?i:m.none}))()},keyup:function(e,o,i,a,u){return tr(t,r.selectedSelector()).fold((function(){var s=e.raw(),c=s.which;return!1==(!0===s.shiftKey)?m.none():tl.isNavigation(c)?Js.sync(t,n,o,i,a,u,r.selectRange):m.none()}),m.none)}}},ul=function(e){var t=function(t){fe(t,e.selected()),fe(t,e.firstSelected()),fe(t,e.lastSelected())},n=function(t){ue(t,e.selected(),"1")},r=function(n){var r=Bt(n,e.selectedSelector());N(r,t)};return{clear:r,selectRange:function(t,o,i,a){r(t),N(o,n),ue(i,e.firstSelected(),"1"),ue(a,e.lastSelected(),"1")},selectedSelector:e.selectedSelector,firstSelectedSelector:e.firstSelectedSelector,lastSelectedSelector:e.lastSelectedSelector}},sl=function(e){return!1===po(ve.fromDom(e.target),"ephox-snooker-resizer-bar")};function cl(e,t){var i=$(["mousedown","mouseover","mouseup","keyup","keydown"],[]),a=m.none(),u=ul(ur);return e.on("init",(function(s){var c=e.getWin(),l=Na(e),f=Ra(e),d=il(c,l,f,u),h=al(c,l,f,u),g=function(t,n){(function(e){return!0===e.raw().shiftKey})(t)&&(n.kill()&&t.kill(),n.selection().each((function(t){var n=ss.relative(t.start(),t.finish()),r=ps(c,n);e.selection.setRng(r)})))},p=function(t){var n=y(t);if(n.raw().shiftKey&&tl.isNavigation(n.raw().which)){var r=e.selection.getRng(),o=ve.fromDom(r.startContainer),i=ve.fromDom(r.endContainer);h.keyup(n,o,r.startOffset,i,r.endOffset).each((function(e){g(n,e)}))}},v=function(n){var r=y(n);t().each((function(e){e.hideBars()}));var o=e.selection.getRng(),i=ve.fromDom(e.selection.getStart()),a=ve.fromDom(o.startContainer),u=ve.fromDom(o.endContainer),s=Ba(i).isRtl()?tl.rtl:tl.ltr;h.keydown(r,a,o.startOffset,u,o.endOffset,s).each((function(e){g(r,e)})),t().each((function(e){e.showBars()}))},b=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},y=function(e){var t=ve.fromDom(e.target),n=function(){e.stopPropagation()},i=function(){e.preventDefault()},a=r(i,n);return{target:o(t),x:o(b(e)?e.x:null),y:o(b(e)?e.y:null),stop:n,prevent:i,kill:a,raw:o(e)}},w=function(e){return 0===e.button},x=function(e){w(e)&&sl(e)&&d.mousedown(y(e))},C=function(e){var t;(void 0===(t=e).buttons||hu.ie&&hu.ie>=12&&0===t.buttons||0!=(1&t.buttons))&&sl(e)&&d.mouseover(y(e))},S=function(e){w(e)&&sl(e)&&d.mouseup(y(e))};e.on("mousedown",x),e.on("mouseover",C),e.on("mouseup",S),e.on("keyup",p),e.on("keydown",v),e.on("nodechange",(function(){var t=e.selection,r=ve.fromDom(t.getStart()),o=ve.fromDom(t.getEnd());Kn(Yt,[r,o]).fold((function(){u.clear(l)}),n)})),a=m.some(i({mousedown:x,mouseover:C,mouseup:S,keyup:p,keydown:v}))})),{clear:u.clear,destroy:function(){a.each((function(e){}))}}}var ll=tu.each,fl=function(e){var t=[];function n(t){return function(){e.execCommand(t)}}ll("inserttable tableprops deletetable | cell row column".split(" "),(function(n){"|"===n?t.push({text:"-"}):t.push(e.menuItems[n])})),e.addButton("table",{type:"menubutton",title:"Table",menu:t}),e.addButton("tableprops",{title:"Table properties",onclick:n("mceTableProps"),icon:"table"}),e.addButton("tabledelete",{title:"Delete table",onclick:n("mceTableDelete")}),e.addButton("tablecellprops",{title:"Cell properties",onclick:n("mceTableCellProps")}),e.addButton("tablemergecells",{title:"Merge cells",onclick:n("mceTableMergeCells")}),e.addButton("tablesplitcells",{title:"Split cell",onclick:n("mceTableSplitCells")}),e.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:n("mceTableInsertRowBefore")}),e.addButton("tableinsertrowafter",{title:"Insert row after",onclick:n("mceTableInsertRowAfter")}),e.addButton("tabledeleterow",{title:"Delete row",onclick:n("mceTableDeleteRow")}),e.addButton("tablerowprops",{title:"Row properties",onclick:n("mceTableRowProps")}),e.addButton("tablecutrow",{title:"Cut row",onclick:n("mceTableCutRow")}),e.addButton("tablecopyrow",{title:"Copy row",onclick:n("mceTableCopyRow")}),e.addButton("tablepasterowbefore",{title:"Paste row before",onclick:n("mceTablePasteRowBefore")}),e.addButton("tablepasterowafter",{title:"Paste row after",onclick:n("mceTablePasteRowAfter")}),e.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:n("mceTableInsertColBefore")}),e.addButton("tableinsertcolafter",{title:"Insert column after",onclick:n("mceTableInsertColAfter")}),e.addButton("tabledeletecol",{title:"Delete column",onclick:n("mceTableDeleteCol")})},dl=function(e){var t=function(e){var t=e.getParam("table_toolbar",Ia);return""===t||!1===t?[]:g(t)?t.split(/[ ,]/):p(t)?t:[]}(e);t.length>0&&e.addContextToolbar((function(t){return e.dom.is(t,"table")&&e.getBody().contains(t)}),t.join(" "))},ml=function(e,t){var n=m.none(),r=[],o=[],i=[],a=[],u=function(e){e.disabled(!0)},s=function(e){e.disabled(!1)},c=function(){var e=this;r.push(e),n.fold((function(){u(e)}),(function(t){s(e)}))},l=function(){var e=this;o.push(e),n.fold((function(){u(e)}),(function(t){s(e)}))};e.on("init",(function(){e.on("nodechange",(function(c){var l=m.from(e.dom.getParent(e.selection.getStart(),"th,td"));(n=l.bind((function(e){var n=ve.fromDom(e);return Yt(n).map((function(e){return vr.forMenu(t,e,n)}))}))).fold((function(){N(r,u),N(o,u),N(i,u),N(a,u)}),(function(e){N(r,s),N(o,s),N(i,(function(t){t.disabled(e.mergable().isNone())})),N(a,(function(t){t.disabled(e.unmergable().isNone())}))}))}))}));var f=function(e,t,n,r){var o,i,a,u,s,c=r.getEl().getElementsByTagName("table")[0],l=r.isRtl()||"tl-tr"===r.parent().rel;for(c.nextSibling.innerHTML=t+1+" x "+(n+1),l&&(t=9-t),i=0;i<10;i++)for(o=0;o<10;o++)u=c.rows[i].childNodes[o].firstChild,s=(l?o>=t:o<=t)&&i<=n,e.dom.toggleClass(u,"mce-active",s),s&&(a=u);return a.parentNode},d=!1===function(e){return e.getParam("table_grid",!0,"boolean")}(e)?{text:"Table",icon:"table",context:"table",onclick:h("mceInsertTable")}:{text:"Table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(t){t.aria&&(this.parent().hideAll(),t.stopImmediatePropagation(),e.execCommand("mceInsertTable"))},onshow:function(){f(e,0,0,this.menu.items()[0])},onhide:function(){var t=this.menu.items()[0].getEl().getElementsByTagName("a");e.dom.removeClass(t,"mce-active"),e.dom.addClass(t[0],"mce-active")},menu:[{type:"container",html:function(){var e="";e='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var t=0;t<10;t++){e+="<tr>";for(var n=0;n<10;n++)e+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*t+n)+'" href="#" data-mce-x="'+n+'" data-mce-y="'+t+'"></a></td>';e+="</tr>"}return e+="</table>",e+='<div class="mce-text-center" role="presentation">1 x 1</div>'}(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(t){var n,r,o=t.target;"A"===o.tagName.toUpperCase()&&(n=parseInt(o.getAttribute("data-mce-x"),10),r=parseInt(o.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"===this.parent().rel)&&(n=9-n),n===this.lastX&&r===this.lastY||(f(e,n,r,t.control),this.lastX=n,this.lastY=r))},onclick:function(t){var n=this;"A"===t.target.tagName.toUpperCase()&&(t.preventDefault(),t.stopPropagation(),n.parent().cancel(),e.undoManager.transact((function(){bu(e,n.lastX+1,n.lastY+1)})),e.addVisual())}}]};function h(t){return function(){e.execCommand(t)}}var g={text:"Table properties",context:"table",onPostRender:c,onclick:h("mceTableProps")},p={text:"Delete table",context:"table",onPostRender:c,cmd:"mceTableDelete"},v={text:"Row",context:"table",menu:[{text:"Insert row before",onclick:h("mceTableInsertRowBefore"),onPostRender:l},{text:"Insert row after",onclick:h("mceTableInsertRowAfter"),onPostRender:l},{text:"Delete row",onclick:h("mceTableDeleteRow"),onPostRender:l},{text:"Row properties",onclick:h("mceTableRowProps"),onPostRender:l},{text:"-"},{text:"Cut row",onclick:h("mceTableCutRow"),onPostRender:l},{text:"Copy row",onclick:h("mceTableCopyRow"),onPostRender:l},{text:"Paste row before",onclick:h("mceTablePasteRowBefore"),onPostRender:l},{text:"Paste row after",onclick:h("mceTablePasteRowAfter"),onPostRender:l}]},b={text:"Column",context:"table",menu:[{text:"Insert column before",onclick:h("mceTableInsertColBefore"),onPostRender:l},{text:"Insert column after",onclick:h("mceTableInsertColAfter"),onPostRender:l},{text:"Delete column",onclick:h("mceTableDeleteCol"),onPostRender:l}]},y={separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:h("mceTableCellProps"),onPostRender:l},{text:"Merge cells",onclick:h("mceTableMergeCells"),onPostRender:function(){var e=this;i.push(e),n.fold((function(){u(e)}),(function(t){e.disabled(t.mergable().isNone())}))}},{text:"Split cell",onclick:h("mceTableSplitCells"),onPostRender:function(){var e=this;a.push(e),n.fold((function(){u(e)}),(function(t){e.disabled(t.unmergable().isNone())}))}}]};e.addMenuItem("inserttable",d),e.addMenuItem("tableprops",g),e.addMenuItem("deletetable",p),e.addMenuItem("row",v),e.addMenuItem("column",b),e.addMenuItem("cell",y)},hl=function(e,t){return{insertTable:function(t,n){return bu(e,t,n)},setClipboardRows:function(e){return function(e,t){var n=k(e,ve.fromDom);t.set(m.from(n))}(e,t)},getClipboardRows:function(){return function(e){return e.get().fold((function(){}),(function(e){return k(e,(function(e){return e.dom()}))}))}(t)}}};t.add("table",(function(e){var t=Qu(e),n=cl(e,t.lazyResize),r=Za(e,t.lazyWire),o=function(e){return{get:function(){var t=Na(e);return or(t,ur.selectedSelector()).fold((function(){return void 0===e.selection.getStart()?lr.none():lr.single(e.selection)}),(function(e){return lr.multiple(e)}))}}}(e),i=Gi(m.none());return Eu(e,r,n,o,i),br(e,o,r,n),ml(e,o),fl(e),dl(e),e.on("PreInit",(function(){e.serializer.addTempAttr(ur.firstSelected()),e.serializer.addTempAttr(ur.lastSelected())})),function(e){return e.getParam("table_tab_navigation",!0,"boolean")}(e)&&e.on("keydown",(function(n){$s(n,e,r,t.lazyWire)})),e.on("remove",(function(){t.destroy(),n.destroy()})),hl(e,i)}))}(window)},606:function(e,t){!function(e){"use strict";var t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(e){return!1!==e.settings.image_dimensions},o=function(e){return!0===e.settings.image_advtab},i=function(e){return e.getParam("image_prepend_url","")},a=function(e){return e.getParam("image_class_list")},u=function(e){return!1!==e.settings.image_description},s=function(e){return!0===e.settings.image_title},c=function(e){return!0===e.settings.image_caption},l=function(e){return e.getParam("image_list",!1)},f=function(e){return e.getParam("images_upload_url",!1)},d=function(e){return e.getParam("images_upload_handler",!1)},m=function(e){return e.getParam("images_upload_url")},h=function(e){return e.getParam("images_upload_handler")},g=function(e){return e.getParam("images_upload_base_path")},p=function(e){return e.getParam("images_upload_credentials")},v=void 0!==e.window?e.window:Function("return this;")(),b=function(e,t){return function(e,t){for(var n=null!=t?t:v,r=0;r<e.length&&null!=n;++r)n=n[e[r]];return n}(e.split("."),t)},y=function(e,t){var n=function(e,t){return b(e,t)}(e,t);if(null==n)throw new Error(e+" not available on this browser");return n},w=tinymce.util.Tools.resolve("tinymce.util.Promise"),x=tinymce.util.Tools.resolve("tinymce.util.Tools"),C=tinymce.util.Tools.resolve("tinymce.util.XHR"),S=function(e,t){return Math.max(parseInt(e,10),parseInt(t,10))},E=function(t,n){var r=e.document.createElement("img");function o(e,t){r.parentNode&&r.parentNode.removeChild(r),n({width:e,height:t})}r.onload=function(){o(S(r.width,r.clientWidth),S(r.height,r.clientHeight))},r.onerror=function(){o(0,0)};var i=r.style;i.visibility="hidden",i.position="fixed",i.bottom=i.left="0px",i.width=i.height="auto",e.document.body.appendChild(r),r.src=t},k=function(e,t,n){return function e(n,r){return r=r||[],x.each(n,(function(n){var o={text:n.text||n.title};n.menu?o.menu=e(n.menu):(o.value=n.value,t(o)),r.push(o)})),r}(e,n||[])},N=function(e){return e&&(e=e.replace(/px$/,"")),e},T=function(e){return e.length>0&&/^[0-9]+$/.test(e)&&(e+="px"),e},_=function(e){if(e.margin){var t=e.margin.split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e},R=function(e,t){var n=l(e);"string"==typeof n?C.send({url:n,success:function(e){t(JSON.parse(e))}}):"function"==typeof n?n(t):t(n)},O=function(e,t,n){function o(){n.onload=n.onerror=null,e.selection&&(e.selection.select(n),e.nodeChanged())}n.onload=function(){t.width||t.height||!r(e)||e.dom.setAttribs(n,{width:n.clientWidth,height:n.clientHeight}),o()},n.onerror=o},A=function(e){return new w((function(t,n){var r=new(y("FileReader"));r.onload=function(){t(r.result)},r.onerror=function(){n(r.error.message)},r.readAsDataURL(e)}))},D=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),P=Object.prototype.hasOwnProperty,B=(t=function(e,t){return t},function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var a in i)P.call(i,a)&&(r[a]=t(r[a],i[a]))}return r}),I=D.DOM,M=function(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?N(e.style.marginLeft):""},L=function(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?N(e.style.marginTop):""},F=function(e){return e.style.borderWidth?N(e.style.borderWidth):""},H=function(e,t){return e.hasAttribute(t)?e.getAttribute(t):""},z=function(e,t){return e.style[t]?e.style[t]:""},W=function(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName},j=function(e,t,n){e.setAttribute(t,n)},U=function(e){W(e)?function(e){var t=e.parentNode;I.insertAfter(e,t),I.remove(t)}(e):function(e){var t=I.create("figure",{class:"image"});I.insertAfter(t,e),t.appendChild(e),t.appendChild(I.create("figcaption",{contentEditable:!0},"Caption")),t.contentEditable="false"}(e)},V=function(e,t){var n=e.getAttribute("style"),r=t(null!==n?n:"");r.length>0?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")},q=function(e,t){return function(e,n,r){e.style[n]?(e.style[n]=T(r),V(e,t)):j(e,n,r)}},$=function(e,t){return e.style[t]?N(e.style[t]):H(e,t)},Y=function(e,t){var n=T(t);e.style.marginLeft=n,e.style.marginRight=n},X=function(e,t){var n=T(t);e.style.marginTop=n,e.style.marginBottom=n},K=function(e,t){var n=T(t);e.style.borderWidth=n},G=function(e,t){e.style.borderStyle=t},J=function(e){return"FIGURE"===e.nodeName},Q=function(t,n){var r=e.document.createElement("img");return j(r,"style",n.style),(M(r)||""!==n.hspace)&&Y(r,n.hspace),(L(r)||""!==n.vspace)&&X(r,n.vspace),(F(r)||""!==n.border)&&K(r,n.border),(function(e){return z(e,"borderStyle")}(r)||""!==n.borderStyle)&&G(r,n.borderStyle),t(r.getAttribute("style"))},Z=function(e,t){return{src:H(t,"src"),alt:H(t,"alt"),title:H(t,"title"),width:$(t,"width"),height:$(t,"height"),class:H(t,"class"),style:e(H(t,"style")),caption:W(t),hspace:M(t),vspace:L(t),border:F(t),borderStyle:z(t,"borderStyle")}},ee=function(e,t,n,r,o){n[r]!==t[r]&&o(e,r,n[r])},te=function(e,t){return function(n,r,o){e(n,o),V(n,t)}},ne=function(e,t,n){var r=Z(e,n);ee(n,r,t,"caption",(function(e,t,n){return U(e)})),ee(n,r,t,"src",j),ee(n,r,t,"alt",j),ee(n,r,t,"title",j),ee(n,r,t,"width",q(0,e)),ee(n,r,t,"height",q(0,e)),ee(n,r,t,"class",j),ee(n,r,t,"style",te((function(e,t){return j(e,"style",t)}),e)),ee(n,r,t,"hspace",te(Y,e)),ee(n,r,t,"vspace",te(X,e)),ee(n,r,t,"border",te(K,e)),ee(n,r,t,"borderStyle",te(G,e))},re=function(e,t){var n=e.dom.styles.parse(t),r=_(n),o=e.dom.styles.parse(e.dom.styles.serialize(r));return e.dom.styles.serialize(o)},oe=function(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return n?e.dom.select("img",n)[0]:t&&("IMG"!==t.nodeName||t.getAttribute("data-mce-object")||t.getAttribute("data-mce-placeholder"))?null:t},ie=function(e,t){var n=e.dom,r=n.getParent(t.parentNode,(function(t){return e.schema.getTextBlockElements()[t.nodeName]}),e.getBody());return r?n.split(r,t):t},ae=function(e){var t=oe(e);return t?Z((function(t){return re(e,t)}),t):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""}},ue=function(t,n){var r=function(t,n){var r=e.document.createElement("img");if(ne(t,B(n,{caption:!1}),r),j(r,"alt",n.alt),n.caption){var o=I.create("figure",{class:"image"});return o.appendChild(r),o.appendChild(I.create("figcaption",{contentEditable:!0},"Caption")),o.contentEditable="false",o}return r}((function(e){return re(t,e)}),n);t.dom.setAttrib(r,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(r.outerHTML);var o=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(o,"data-mce-id",null),J(o)){var i=ie(t,o);t.selection.select(i)}else t.selection.select(o)},se=function(e,t){var n=oe(e);n?t.src?function(e,t){var n=oe(e);if(ne((function(t){return re(e,t)}),t,n),function(e,t){e.dom.setAttrib(t,"src",t.getAttribute("src"))}(e,n),J(n.parentNode)){var r=n.parentNode;ie(e,r),e.selection.select(n.parentNode)}else e.selection.select(n),O(e,t,n)}(e,t):function(e,t){if(t){var n=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(n),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}}(e,n):t.src&&ue(e,t)},ce=function(e){return function(t){var n=e.dom,r=t.control.rootControl;if(o(e)){var i=r.toJSON(),a=n.parseStyle(i.style);r.find("#vspace").value(""),r.find("#hspace").value(""),((a=_(a))["margin-top"]&&a["margin-bottom"]||a["margin-right"]&&a["margin-left"])&&(a["margin-top"]===a["margin-bottom"]?r.find("#vspace").value(N(a["margin-top"])):r.find("#vspace").value(""),a["margin-right"]===a["margin-left"]?r.find("#hspace").value(N(a["margin-right"])):r.find("#hspace").value("")),a["border-width"]?r.find("#border").value(N(a["border-width"])):r.find("#border").value(""),a["border-style"]?r.find("#borderStyle").value(a["border-style"]):r.find("#borderStyle").value(""),r.find("#style").value(n.serializeStyle(n.parseStyle(n.serializeStyle(a))))}}},le=function(e,t){t.find("#style").each((function(n){var r=Q((function(t){return re(e,t)}),B({src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""},t.toJSON()));n.value(r)}))},fe=function(e){return{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:ce(e)},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,defaults:{type:"textbox",maxWidth:50,onchange:function(t){le(e,t.control.rootControl)}},items:[{label:"Vertical space",name:"vspace"},{label:"Border width",name:"border"},{label:"Horizontal space",name:"hspace"},{label:"Border style",type:"listbox",name:"borderStyle",width:90,maxWidth:90,onselect:function(t){le(e,t.control.rootControl)},values:[{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"}]}]}]}},de=function(e,t){e.state.set("oldVal",e.value()),t.state.set("oldVal",t.value())},me=function(e,t){var n=e.find("#width")[0],r=e.find("#height")[0],o=e.find("#constrain")[0];n&&r&&o&&t(n,r,o.checked())},he=function(e,t,n){var r=e.state.get("oldVal"),o=t.state.get("oldVal"),i=e.value(),a=t.value();n&&r&&o&&i&&a&&(i!==r?(a=Math.round(i/r*a),isNaN(a)||t.value(a)):(i=Math.round(a/o*i),isNaN(i)||e.value(i))),de(e,t)},ge=function(e){me(e,he)},pe=function(){var e=function(e){ge(e.control.rootControl)};return{type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:5,onchange:e,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:5,onchange:e,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}},ve=function(e){me(e,de)},be=ge,ye=function(e){e.meta=e.control.rootControl.toJSON()},we=function(e,t){var n=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:function(t){!function(e,t){var n,o,a,u=e.meta||{},s=e.control,c=s.rootControl,l=c.find("#image-list")[0];l&&l.value(t.convertURL(s.value(),"src")),x.each(u,(function(e,t){c.find("#"+t).value(e)})),u.width||u.height||(n=t.convertURL(s.value(),"src"),o=i(t),a=new RegExp("^(?:[a-z]+:)?//","i"),o&&!a.test(n)&&n.substring(0,o.length)!==o&&(n=o+n),s.value(n),E(t.documentBaseURI.toAbsolute(s.value()),(function(e){e.width&&e.height&&r(t)&&(c.find("#width").value(e.width),c.find("#height").value(e.height),ve(c))})))}(t,e)},onbeforecall:ye},t];return u(e)&&n.push({name:"alt",type:"textbox",label:"Image description"}),s(e)&&n.push({name:"title",type:"textbox",label:"Image Title"}),r(e)&&n.push(pe()),a(e)&&n.push({name:"class",type:"listbox",label:"Class",values:k(a(e),(function(t){t.value&&(t.textStyle=function(){return e.formatter.getCssText({inline:"img",classes:[t.value]})})}))}),c(e)&&n.push({name:"caption",type:"checkbox",label:"Caption"}),n},xe=function(e,t){return{title:"General",type:"form",items:we(e,t)}},Ce=we,Se=function(){return y("URL")},Ee=function(e){return Se().createObjectURL(e)},ke=function(e){Se().revokeObjectURL(e)},Ne=tinymce.util.Tools.resolve("tinymce.ui.Factory"),Te=function(){};function _e(t){var n=function(n,r,o,i){var a,u;(a=new(y("XMLHttpRequest"))).open("POST",t.url),a.withCredentials=t.credentials,a.upload.onprogress=function(e){i(e.loaded/e.total*100)},a.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+a.status)},a.onload=function(){var e,n,i;a.status<200||a.status>=300?o("HTTP Error: "+a.status):(e=JSON.parse(a.responseText))&&"string"==typeof e.location?r((n=t.basePath,i=e.location,n?n.replace(/\/$/,"")+"/"+i.replace(/^\//,""):i)):o("Invalid JSON: "+a.responseText)},(u=new e.FormData).append("file",n.blob(),n.filename()),a.send(u)};return t=x.extend({credentials:!1,handler:n},t),{upload:function(e){return t.url||t.handler!==n?function(e,t){return new w((function(n,r){try{t(e,n,r,Te)}catch(e){r(e.message)}}))}(e,t.handler):w.reject("Upload url missing from the settings.")}}}var Re=function(e){return function(t){var n=Ne.get("Throbber"),r=t.control.rootControl,o=new n(r.getEl()),i=t.control.value(),a=Ee(i),u=_e({url:m(e),basePath:g(e),credentials:p(e),handler:h(e)}),s=function(){o.hide(),ke(a)};return o.show(),A(i).then((function(t){var n=e.editorUpload.blobCache.create({blob:i,blobUri:a,name:i.name?i.name.replace(/\.[^\.]+$/,""):null,base64:t.split(",")[1]});return u.upload(n).then((function(e){var t=r.find("#src");return t.value(e),r.find("tabpanel")[0].activateTab(0),t.fire("change"),s(),e}))})).catch((function(t){e.windowManager.alert(t),s()}))}},Oe=function(e){return{title:"Upload",type:"form",layout:"flex",direction:"column",align:"stretch",padding:"20 20 20 20",items:[{type:"container",layout:"flex",direction:"column",align:"center",spacing:10,items:[{text:"Browse for an image",type:"browsebutton",accept:".jpg,.jpeg,.png,.gif",onchange:Re(e)},{text:"OR",type:"label"}]},{text:"Drop an image here",type:"dropzone",accept:".jpg,.jpeg,.png,.gif",height:100,onchange:Re(e)}]}};function Ae(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}var De=function(e,t){var n=t.control.getRoot();be(n),e.undoManager.transact((function(){var t=B(ae(e),n.toJSON());se(e,t)})),e.editorUpload.uploadImagesAuto()};function Pe(e){function t(t){var n,r,i=ae(e);if(t&&(r={type:"listbox",label:"Image list",name:"image-list",values:k(t,(function(t){t.value=e.convertURL(t.value||t.url,"src")}),[{text:"None",value:""}]),value:i.src&&e.convertURL(i.src,"src"),onselect:function(e){var t=n.find("#alt");(!t.value()||e.lastControl&&t.value()===e.lastControl.text())&&t.value(e.control.text()),n.find("#src").value(e.control.value()).fire("change")},onPostRender:function(){r=this}}),o(e)||f(e)||d(e)){var a=[xe(e,r)];o(e)&&a.push(fe(e)),(f(e)||d(e))&&a.push(Oe(e)),n=e.windowManager.open({title:"Insert/edit image",data:i,bodyType:"tabpanel",body:a,onSubmit:Ae(De,e)})}else n=e.windowManager.open({title:"Insert/edit image",data:i,body:Ce(e,r),onSubmit:Ae(De,e)});ve(n)}return{open:function(){R(e,t)}}}var Be=function(e){e.addCommand("mceImage",Pe(e).open)},Ie=function(e){var t=e.attr("class");return t&&/\bimage\b/.test(t)},Me=function(e){return function(t){for(var n,r=t.length,o=function(t){t.attr("contenteditable",e?"true":null)};r--;)n=t[r],Ie(n)&&(n.attr("contenteditable",e?"false":null),x.each(n.getAll("figcaption"),o))}},Le=function(e){e.on("preInit",(function(){e.parser.addNodeFilter("figure",Me(!0)),e.serializer.addNodeFilter("figure",Me(!1))}))},Fe=function(e){e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:Pe(e).open,stateSelector:"img:not([data-mce-object],[data-mce-placeholder]),figure.image"}),e.addMenuItem("image",{icon:"image",text:"Image",onclick:Pe(e).open,context:"insert",prependToContext:!0})};n.add("image",(function(e){Le(e),Fe(e),Be(e)}))}(window)},607:function(e,t){!function(e){"use strict";var t=function(e){var n=e,r=function(){return n};return{get:r,set:function(e){n=e},clone:function(){return t(r())}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=function(){},i=function(e){return function(){return e}};function a(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}var u,s,c,l,f=i(!1),d=i(!0),m=function(){return h},h=(u=function(e){return e.isNone()},l={fold:function(e,t){return e()},is:f,isSome:f,isNone:d,getOr:c=function(e){return e},getOrThunk:s=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:c,orThunk:s,map:m,each:o,bind:m,exists:f,forall:d,filter:m,equals:u,equals_:u,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(l),l),g=function(e){var t=i(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:d,isNone:f,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return g(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:h},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(f,(function(t){return n(e,t)}))}};return o},p={some:g,none:m,from:function(e){return null==e?h:g(e)}};function v(t,n){return w(e.document.createElement("canvas"),t,n)}function b(e){var t=v(e.width,e.height);return y(t).drawImage(e,0,0),t}function y(e){return e.getContext("2d")}function w(e,t,n){return e.width=t,e.height=n,e}function x(e){return e.naturalWidth||e.width}function C(e){return e.naturalHeight||e.height}var S=window.Promise?window.Promise:function(){var t=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,r(a,this),r(u,this))},n=t.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){e.setTimeout(t,1)};function r(e,t){return function(){return e.apply(t,arguments)}}var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e){var t=this;null!==this._state?n((function(){var n=t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void e.reject(t)}e.resolve(r)}else(t._state?e.resolve:e.reject)(t._value)})):this._deferreds.push(e)}function a(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void l(r(t,e),r(a,this),r(u,this))}this._state=!0,this._value=e,s.call(this)}catch(e){u.call(this,e)}}function u(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds;e<t.length;e++){var n=t[e];i.call(this,n)}this._deferreds=[]}function c(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function l(e,t,n){var r=!1;try{e((function(e){r||(r=!0,t(e))}),(function(e){r||(r=!0,n(e))}))}catch(e){if(r)return;r=!0,n(e)}}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new c(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(e,t){if(0===r.length)return e([]);var n=r.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(e){o(i,e)}),t)}r[i]=a,0==--n&&e(r)}catch(e){t(e)}}for(var i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++)o[r].then(t,n)}))},t}();function E(t){var n=t.src;return 0===n.indexOf("data:")?N(n):function(t){return new S((function(n,r){var o=new e.XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){200===this.status&&n(this.response)},o.onerror=function(){var e,t=this;r(0===this.status?((e=new Error("No access to download image")).code=18,e.name="SecurityError",e):new Error("Error "+t.status+" downloading image"))},o.send()}))}(n)}function k(t){return new S((function(n,r){var o=e.URL.createObjectURL(t),i=new e.Image,a=function(){i.removeEventListener("load",u),i.removeEventListener("error",s)};function u(){a(),n(i)}function s(){a(),r("Unable to load data of type "+t.type+": "+o)}i.addEventListener("load",u),i.addEventListener("error",s),i.src=o,i.complete&&u()}))}function N(t){return new S((function(n,r){(function(t){var n=t.split(","),r=/data:([^;]+)/.exec(n[0]);if(!r)return p.none();for(var o=r[1],i=n[1],a=e.atob(i),u=a.length,s=Math.ceil(u/1024),c=new Array(s),l=0;l<s;++l){for(var f=1024*l,d=Math.min(f+1024,u),m=new Array(d-f),h=f,g=0;h<d;++g,++h)m[g]=a[h].charCodeAt(0);c[l]=new Uint8Array(m)}return p.some(new e.Blob(c,{type:o}))})(t).fold((function(){r("uri is not base64: "+t)}),n)}))}function T(t,n,r){return n=n||"image/png",e.HTMLCanvasElement.prototype.toBlob?new S((function(e,o){t.toBlob((function(t){t?e(t):o()}),n,r)})):N(t.toDataURL(n,r))}function _(t){return k(t).then((function(t){!function(t){e.URL.revokeObjectURL(t.src)}(t);var n=v(x(t),C(t));return y(n).drawImage(t,0,0),n}))}function R(e,t,n){var r=t.type;function o(t,n){return e.then((function(e){return function(e,t,n){return t=t||"image/png",e.toDataURL(t,n)}(e,t,n)}))}return{getType:i(r),toBlob:function(){return S.resolve(t)},toDataURL:function(){return n},toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(t,n){return e.then((function(e){return T(e,t,n)}))},toAdjustedDataURL:o,toAdjustedBase64:function(e,t){return o(e,t).then((function(e){return e.split(",")[1]}))},toCanvas:function(){return e.then(b)}}}function O(t){return function(t){return new S((function(n){var r=new e.FileReader;r.onloadend=function(){n(r.result)},r.readAsDataURL(t)}))}(t).then((function(e){return R(_(t),t,e)}))}function A(e,t){return T(e,t).then((function(t){return R(S.resolve(e),t,e.toDataURL())}))}function D(e,t,n){var r="string"==typeof e?parseFloat(e):e;return r>n?r=n:r<t&&(r=t),r}var P=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function B(e,t){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var a=0;a<5;a++)r[a]=t[a+5*i];for(a=0;a<5;a++){n=0;for(var u=0;u<5;u++)n+=e[a+5*u]*r[u];o[a+5*i]=n}}return o}function I(e,t){return t=D(t,0,1),e.map((function(e,n){return n%6==0?e=1-(1-e)*t:e*=t,D(e,0,1)}))}function M(e,t){return e.toCanvas().then((function(n){return function(e,t,n){var r=y(e),o=function(e,t){for(var n,r,o,i,a=e.data,u=t[0],s=t[1],c=t[2],l=t[3],f=t[4],d=t[5],m=t[6],h=t[7],g=t[8],p=t[9],v=t[10],b=t[11],y=t[12],w=t[13],x=t[14],C=t[15],S=t[16],E=t[17],k=t[18],N=t[19],T=0;T<a.length;T+=4)n=a[T],r=a[T+1],o=a[T+2],i=a[T+3],a[T]=n*u+r*s+o*c+i*l+f,a[T+1]=n*d+r*m+o*h+i*g+p,a[T+2]=n*v+r*b+o*y+i*w+x,a[T+3]=n*C+r*S+o*E+i*k+N;return e}(r.getImageData(0,0,e.width,e.height),n);return r.putImageData(o,0,0),A(e,t)}(n,e.getType(),t)}))}function L(e,t){return e.toCanvas().then((function(n){return function(e,t,n){var r=y(e),o=r.getImageData(0,0,e.width,e.height),i=r.getImageData(0,0,e.width,e.height);return i=function(e,t,n){function r(e,t,n){return e>n?e=n:e<t&&(e=t),e}for(var o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),a=e.data,u=t.data,s=e.width,c=e.height,l=0;l<c;l++)for(var f=0;f<s;f++){for(var d=0,m=0,h=0,g=0;g<o;g++)for(var p=0;p<o;p++){var v=r(f+p-i,0,s-1),b=4*(r(l+g-i,0,c-1)*s+v),y=n[g*o+p];d+=a[b]*y,m+=a[b+1]*y,h+=a[b+2]*y}var w=4*(l*s+f);u[w]=r(d,0,255),u[w+1]=r(m,0,255),u[w+2]=r(h,0,255)}return t}(o,i,n),r.putImageData(i,0,0),A(e,t)}(n,e.getType(),t)}))}function F(e){return function(t,n){return t.toCanvas().then((function(r){return function(t,n,r){for(var o=y(t),i=new Array(256),a=0;a<i.length;a++)i[a]=e(a,r);var u=function(e,t){for(var n=e.data,r=0;r<n.length;r+=4)n[r]=t[n[r]],n[r+1]=t[n[r+1]],n[r+2]=t[n[r+2]];return e}(o.getImageData(0,0,t.width,t.height),i);return o.putImageData(u,0,0),A(t,n)}(r,t.getType(),n)}))}}function H(e){return function(t,n){return M(t,e([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))}}function z(e){return function(t){return L(t,e)}}var W,j=(W=[-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],function(e){return M(e,W)}),U=H((function(e,t){return B(e,[1,0,0,0,t=D(255*t,-255,255),0,1,0,0,t,0,0,1,0,t,0,0,0,1,0,0,0,0,0,1])})),V=H((function(e,t){t=D(t,-180,180)/180*Math.PI;var n=Math.cos(t),r=Math.sin(t);return B(e,[.213+.787*n+-.213*r,.715+-.715*n+-.715*r,.072+-.072*n+.928*r,0,0,.213+-.213*n+.143*r,.715+n*(1-.715)+.14*r,.072+-.072*n+-.283*r,0,0,.213+-.213*n+-.787*r,.715+-.715*n+.715*r,.072+.928*n+.072*r,0,0,0,0,0,1,0,0,0,0,0,1])})),q=H((function(e,t){var n=1+((t=D(t,-1,1))>0?3*t:t);return B(e,[.3086*(1-n)+n,.6094*(1-n),.082*(1-n),0,0,.3086*(1-n),.6094*(1-n)+n,.082*(1-n),0,0,.3086*(1-n),.6094*(1-n),.082*(1-n)+n,0,0,0,0,0,1,0,0,0,0,0,1])})),$=H((function(e,t){var n;return t=D(t,-1,1),B(e,[(n=(t*=100)<0?127+t/100*127:127*(n=0==(n=t%1)?P[t]:P[Math.floor(t)]*(1-n)+P[Math.floor(t)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),Y=H((function(e,t){return B(e,I([.33,.34,.33,0,0,.33,.34,.33,0,0,.33,.34,.33,0,0,0,0,0,1,0,0,0,0,0,1],t=D(t,0,1)))})),X=H((function(e,t){return B(e,I([.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0,0,0,0,0,1],t=D(t,0,1)))})),K=function(e,t,n,r){return M(e,function(e,t,n,r){return B(e,[t=D(t,0,2),0,0,0,0,0,n=D(n,0,2),0,0,0,0,0,r=D(r,0,2),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],t,n,r))},G=z([0,-1,0,-1,5,-1,0,-1,0]),J=z([-2,-1,0,-1,1,1,0,1,2]),Q=F((function(e,t){return 255*Math.pow(e/255,1-t)})),Z=F((function(e,t){return 255*(1-Math.exp(-e/255*t))}));function ee(e,t,n){var r=x(e),o=C(e),i=t/r,a=n/o,u=!1;(i<.5||i>2)&&(i=i<.5?.5:2,u=!0),(a<.5||a>2)&&(a=a<.5?.5:2,u=!0);var s=function(e,t,n){return new S((function(r){var o=x(e),i=C(e),a=Math.floor(o*t),u=Math.floor(i*n),s=v(a,u);y(s).drawImage(e,0,0,o,i,0,0,a,u),r(s)}))}(e,i,a);return u?s.then((function(e){return ee(e,t,n)})):s}function te(e,t){return e.toCanvas().then((function(n){return function(e,t,n){var r=v(e.width,e.height),o=y(r),i=0,a=0;return 90!==(n=n<0?360+n:n)&&270!==n||w(r,r.height,r.width),90!==n&&180!==n||(i=r.width),270!==n&&180!==n||(a=r.height),o.translate(i,a),o.rotate(n*Math.PI/180),o.drawImage(e,0,0),A(r,t)}(n,e.getType(),t)}))}function ne(e,t){return e.toCanvas().then((function(n){return function(e,t,n){var r=v(e.width,e.height),o=y(r);return"v"===n?(o.scale(1,-1),o.drawImage(e,0,-r.height)):(o.scale(-1,1),o.drawImage(e,-r.width,0)),A(r,t)}(n,e.getType(),t)}))}function re(e,t,n,r,o){return e.toCanvas().then((function(i){return function(e,t,n,r,o,i){var a=v(o,i);return y(a).drawImage(e,-n,-r),A(a,t)}(i,e.getType(),t,n,r,o)}))}var oe=function(e){return j(e)},ie=function(e){return G(e)},ae=function(e){return J(e)},ue=function(e,t){return Q(e,t)},se=function(e,t){return Z(e,t)},ce=function(e,t,n,r){return K(e,t,n,r)},le=function(e,t){return U(e,t)},fe=function(e,t){return V(e,t)},de=function(e,t){return q(e,t)},me=function(e,t){return $(e,t)},he=function(e,t){return Y(e,t)},ge=function(e,t){return X(e,t)},pe=function(e,t){return ne(e,t)},ve=function(e,t,n,r,o){return re(e,t,n,r,o)},be=function(e,t,n){return function(e,t,n){return e.toCanvas().then((function(r){return ee(r,t,n).then((function(t){return A(t,e.getType())}))}))}(e,t,n)},ye=function(e,t){return te(e,t)},we=function(e){return O(e)},xe=void 0!==e.window?e.window:Function("return this;")(),Ce=function(e,t){return function(e,t){for(var n=null!=t?t:xe,r=0;r<e.length&&null!=n;++r)n=n[e[r]];return n}(e.split("."),t)},Se=function(e,t){var n=function(e,t){return Ce(e,t)}(e,t);if(null==n)throw new Error(e+" not available on this browser");return n},Ee=function(){return Se("URL")},ke=function(e){return Ee().createObjectURL(e)},Ne=function(e){Ee().revokeObjectURL(e)},Te=tinymce.util.Tools.resolve("tinymce.util.Delay"),_e=tinymce.util.Tools.resolve("tinymce.util.Promise"),Re=tinymce.util.Tools.resolve("tinymce.util.URI"),Oe=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Ae=tinymce.util.Tools.resolve("tinymce.ui.Factory"),De=tinymce.util.Tools.resolve("tinymce.geom.Rect"),Pe=function(e){return new _e((function(t){var n=function(){e.removeEventListener("load",n),t(e)};e.complete?t(e):e.addEventListener("load",n)}))},Be=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),Ie=tinymce.util.Tools.resolve("tinymce.util.Observable"),Me=tinymce.util.Tools.resolve("tinymce.util.VK"),Le=0,Fe=function(t){return new(Ae.get("Control").extend({Defaults:{classes:"imagepanel"},selection:function(e){return arguments.length?(this.state.set("rect",e),this):this.state.get("rect")},imageSize:function(){var e=this.state.get("viewRect");return{w:e.w,h:e.h}},toggleCropRect:function(e){this.state.set("cropEnabled",e)},imageSrc:function(t){var n=this,r=new e.Image;r.src=t,Pe(r).then((function(){var t,o,i=n.state.get("viewRect");if((o=n.$el.find("img"))[0])o.replaceWith(r);else{var a=e.document.createElement("div");a.className="mce-imagepanel-bg",n.getEl().appendChild(a),n.getEl().appendChild(r)}t={x:0,y:0,w:r.naturalWidth,h:r.naturalHeight},n.state.set("viewRect",t),n.state.set("rect",De.inflate(t,-20,-20)),i&&i.w===t.w&&i.h===t.h||n.zoomFit(),n.repaintImage(),n.fire("load")}))},zoom:function(e){return arguments.length?(this.state.set("zoom",e),this):this.state.get("zoom")},postRender:function(){return this.imageSrc(this.settings.imageSrc),this._super()},zoomFit:function(){var e,t,n,r,o,i;e=this.$el.find("img"),t=this.getEl().clientWidth,n=this.getEl().clientHeight,r=e[0].naturalWidth,o=e[0].naturalHeight,(i=Math.min((t-10)/r,(n-10)/o))>=1&&(i=1),this.zoom(i)},repaintImage:function(){var e,t,n,r,o,i,a,u,s,c,l;l=this.getEl(),s=this.zoom(),c=this.state.get("rect"),a=this.$el.find("img"),u=this.$el.find(".mce-imagepanel-bg"),o=l.offsetWidth,i=l.offsetHeight,n=a[0].naturalWidth*s,r=a[0].naturalHeight*s,e=Math.max(0,o/2-n/2),t=Math.max(0,i/2-r/2),a.css({left:e,top:t,width:n,height:r}),u.css({left:e,top:t,width:n,height:r}),this.cropRect&&(this.cropRect.setRect({x:c.x*s+e,y:c.y*s+t,w:c.w*s,h:c.h*s}),this.cropRect.setClampRect({x:e,y:t,w:n,h:r}),this.cropRect.setViewPortRect({x:0,y:0,w:o,h:i}))},bindStates:function(){var e=this;function t(t){e.cropRect=function(e,t,n,o,i){var a,u,s,c,l="mce-crid-"+Le++;function f(e,t){return{x:t.x-e.x,y:t.y-e.y,w:t.w,h:t.h}}function d(t,r,o,i){var u,s,c,l,d;u=r.x,s=r.y,c=r.w,l=r.h,u+=o*t.deltaX,s+=i*t.deltaY,(c+=o*t.deltaW)<20&&(c=20),(l+=i*t.deltaH)<20&&(l=20),d=e=De.clamp({x:u,y:s,w:c,h:l},n,"move"===t.name),d=f(n,d),a.fire("updateRect",{rect:d}),g(d)}function m(e){function n(e,t){t.h<0&&(t.h=0),t.w<0&&(t.w=0),Be("#"+l+"-"+e,o).css({left:t.x,top:t.y,width:t.w,height:t.h})}r.each(u,(function(t){Be("#"+l+"-"+t.name,o).css({left:e.w*t.xMul+e.x,top:e.h*t.yMul+e.y})})),n("top",{x:t.x,y:t.y,w:t.w,h:e.y-t.y}),n("right",{x:e.x+e.w,y:e.y,w:t.w-e.x-e.w+t.x,h:e.h}),n("bottom",{x:t.x,y:e.y+e.h,w:t.w,h:t.h-e.y-e.h+t.y}),n("left",{x:t.x,y:e.y,w:e.x-t.x,h:e.h}),n("move",e)}function h(t){m(e=t)}function g(e){var t,r;h((t=n,{x:(r=e).x+t.x,y:r.y+t.y,w:r.w,h:r.h}))}return u=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],c=["top","right","bottom","left"],Be('<div id="'+l+'" class="mce-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(o),r.each(c,(function(e){Be("#"+l,o).append('<div id="'+l+"-"+e+'"class="mce-croprect-block" style="display: none" data-mce-bogus="all">')})),r.each(u,(function(e){Be("#"+l,o).append('<div id="'+l+"-"+e.name+'" class="mce-croprect-handle mce-croprect-handle-'+e.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+e.label+'" aria-grabbed="false">')})),s=r.map(u,(function(t){var n;return new(Ae.get("DragHelper"))(l,{document:o.ownerDocument,handle:l+"-"+t.name,start:function(){n=e},drag:function(e){d(t,n,e.deltaX,e.deltaY)}})})),m(e),Be(o).on("focusin focusout",(function(e){Be(e.target).attr("aria-grabbed","focus"===e.type)})),Be(o).on("keydown",(function(t){var n;function o(e,t,r,o,i){e.stopPropagation(),e.preventDefault(),d(n,r,o,i)}switch(r.each(u,(function(e){if(t.target.id===l+"-"+e.name)return n=e,!1})),t.keyCode){case Me.LEFT:o(t,0,e,-10,0);break;case Me.RIGHT:o(t,0,e,10,0);break;case Me.UP:o(t,0,e,0,-10);break;case Me.DOWN:o(t,0,e,0,10);break;case Me.ENTER:case Me.SPACEBAR:t.preventDefault(),i()}})),a=r.extend({toggleVisibility:function(e){var t;t=r.map(u,(function(e){return"#"+l+"-"+e.name})).concat(r.map(c,(function(e){return"#"+l+"-"+e}))).join(","),e?Be(t,o).show():Be(t,o).hide()},setClampRect:function(t){n=t,m(e)},setRect:h,getInnerRect:function(){return f(n,e)},setInnerRect:g,setViewPortRect:function(n){t=n,m(e)},destroy:function(){r.each(s,(function(e){e.destroy()})),s=[]}},Ie)}(t,e.state.get("viewRect"),e.state.get("viewRect"),e.getEl(),(function(){e.fire("crop")})),e.cropRect.on("updateRect",(function(t){var n=t.rect,r=e.zoom();n={x:Math.round(n.x/r),y:Math.round(n.y/r),w:Math.round(n.w/r),h:Math.round(n.h/r)},e.state.set("rect",n)})),e.on("remove",e.cropRect.destroy)}e.state.on("change:cropEnabled",(function(t){e.cropRect.toggleVisibility(t.value),e.repaintImage()})),e.state.on("change:zoom",(function(){e.repaintImage()})),e.state.on("change:rect",(function(n){var r=n.value;e.cropRect||t(r),e.cropRect.setRect(r)}))}}))(t)};function He(e){return{blob:e,url:ke(e)}}function ze(e){e&&Ne(e.url)}function We(e){r.each(e,ze)}function je(e,t,n,o){var i,a,u,s,c,l,f,d,m,h,g,p,v,b,y,w,x,C,S,E,k,N,T,_,R,O,A,D=function(){var e=[],t=-1;function n(){return t>0}function r(){return-1!==t&&t<e.length-1}return{data:e,add:function(n){var r;return r=e.splice(++t),e.push(n),{state:n,removed:r}},undo:function(){if(n())return e[--t]},redo:function(){if(r())return e[++t]},canUndo:n,canRedo:r}}(),P=function(t){return e.rtl?t.reverse():t};function B(e){var t,n,r,o;t=i.find("#w")[0],n=i.find("#h")[0],r=parseInt(t.value(),10),o=parseInt(n.value(),10),i.find("#constrain")[0].checked()&&_&&R&&r&&o&&("w"===e.control.settings.name?(o=Math.round(r*O),n.value(o)):(r=Math.round(o*A),t.value(r))),_=r,R=o}function I(e){return Math.round(100*e)+"%"}function M(){i.find("#undo").disabled(!D.canUndo()),i.find("#redo").disabled(!D.canRedo()),i.statusbar.find("#save").disabled(!D.canUndo())}function L(){i.find("#undo").disabled(!0),i.find("#redo").disabled(!0)}function F(e){e&&d.imageSrc(e.url)}function H(e){return function(){var t=r.grep(T,(function(t){return t.settings.name!==e}));r.each(t,(function(e){e.hide()})),e.show(),e.focus()}}function z(e){F(s=He(e))}function W(e){F(t=He(e)),We(D.add(t).removed),M()}function j(){var e=d.selection();we(t.blob).then((function(t){ve(t,e.x,e.y,e.w,e.h).then(Y).then((function(e){W(e),V()}))}))}var U=function(e){var n=[].slice.call(arguments,1);return function(){we((s||t).blob).then((function(t){e.apply(this,[t].concat(n)).then(Y).then(z)}))}};function V(){F(t),ze(s),H(a)(),M()}function q(){s?(W(s.blob),V()):function t(n,r){s?r():setTimeout((function(){n-- >0?t(n,r):e.windowManager.alert("Error: failed to apply image operation.")}),10)}(100,q)}function $(e){return Ae.create("Form",{layout:"flex",direction:"row",labelGap:5,border:"0 0 1 0",align:"center",pack:"center",padding:"0 10 0 10",spacing:5,flex:0,minHeight:60,defaults:{classes:"imagetool",type:"button"},items:e})}var Y=function(e){return e.toBlob()};function X(e,n){return $(P([{text:"Back",onclick:V},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:q}])).hide().on("show",(function(){L(),we(t.blob).then((function(e){return n(e)})).then(Y).then((function(e){var t=He(e);F(t),ze(s),s=t}))}))}function K(n,r,o,i,a){return $(P([{text:"Back",onclick:V},{type:"spacer",flex:1},{type:"slider",flex:1,ondragend:function(e){!function(e){we(t.blob).then((function(t){return r(t,e)})).then(Y).then((function(e){var t=He(e);F(t),ze(s),s=t}))}(e.value)},minValue:e.rtl?a:i,maxValue:e.rtl?i:a,value:o,previewFilter:I},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:q}])).hide().on("show",(function(){this.find("slider").value(o),L()}))}c=$(P([{text:"Back",onclick:V},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:j}])).hide().on("show hide",(function(e){d.toggleCropRect("show"===e.type)})).on("show",L),l=$(P([{text:"Back",onclick:V},{type:"spacer",flex:1},{type:"textbox",name:"w",label:"Width",size:4,onkeyup:B},{type:"textbox",name:"h",label:"Height",size:4,onkeyup:B},{type:"checkbox",name:"constrain",text:"Constrain proportions",checked:!0,onchange:function(e){!0===e.control.value()&&(O=R/_,A=_/R)}},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:"submit"}])).hide().on("submit",(function(e){var n=parseInt(i.find("#w").value(),10),r=parseInt(i.find("#h").value(),10);e.preventDefault(),function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=[].slice.call(arguments,1);return function(){we(t.blob).then((function(t){e.apply(this,[t].concat(o)).then(Y).then(W)}))}}(be,n,r)(),V()})).on("show",L),f=$(P([{text:"Back",onclick:V},{type:"spacer",flex:1},{icon:"fliph",tooltip:"Flip horizontally",onclick:U(pe,"h")},{icon:"flipv",tooltip:"Flip vertically",onclick:U(pe,"v")},{icon:"rotateleft",tooltip:"Rotate counterclockwise",onclick:U(ye,-90)},{icon:"rotateright",tooltip:"Rotate clockwise",onclick:U(ye,90)},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:q}])).hide().on("show",L),g=X(0,oe),S=X(0,ie),E=X(0,ae),p=K(0,le,0,-1,1),v=K(0,fe,180,0,360),b=K(0,de,0,-1,1),y=K(0,me,0,-1,1),w=K(0,he,0,0,1),x=K(0,ge,0,0,1),C=function(n,r){function o(){var e,n,o;e=i.find("#r")[0].value(),n=i.find("#g")[0].value(),o=i.find("#b")[0].value(),we(t.blob).then((function(t){return r(t,e,n,o)})).then(Y).then((function(e){var t=He(e);F(t),ze(s),s=t}))}var a=e.rtl?2:0,u=e.rtl?0:2;return $(P([{text:"Back",onclick:V},{type:"spacer",flex:1},{type:"slider",label:"R",name:"r",minValue:a,value:1,maxValue:u,ondragend:o,previewFilter:I},{type:"slider",label:"G",name:"g",minValue:a,value:1,maxValue:u,ondragend:o,previewFilter:I},{type:"slider",label:"B",name:"b",minValue:a,value:1,maxValue:u,ondragend:o,previewFilter:I},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:q}])).hide().on("show",(function(){i.find("#r,#g,#b").value(1),L()}))}(0,ce),k=K(0,ue,0,-1,1),N=K(0,se,1,0,2),u=$(P([{text:"Back",onclick:V},{type:"spacer",flex:1},{text:"hue",icon:"hue",onclick:H(v)},{text:"saturate",icon:"saturate",onclick:H(b)},{text:"sepia",icon:"sepia",onclick:H(x)},{text:"emboss",icon:"emboss",onclick:H(E)},{text:"exposure",icon:"exposure",onclick:H(N)},{type:"spacer",flex:1}])).hide(),a=$(P([{tooltip:"Crop",icon:"crop",onclick:H(c)},{tooltip:"Resize",icon:"resize2",onclick:H(l)},{tooltip:"Orientation",icon:"orientation",onclick:H(f)},{tooltip:"Brightness",icon:"sun",onclick:H(p)},{tooltip:"Sharpen",icon:"sharpen",onclick:H(S)},{tooltip:"Contrast",icon:"contrast",onclick:H(y)},{tooltip:"Color levels",icon:"drop",onclick:H(C)},{tooltip:"Gamma",icon:"gamma",onclick:H(k)},{tooltip:"Invert",icon:"invert",onclick:H(g)}])),d=Fe({flex:1,imageSrc:t.url}),m=Ae.create("Container",{layout:"flex",direction:"column",pack:"start",border:"0 1 0 0",padding:5,spacing:5,items:[{type:"button",icon:"undo",tooltip:"Undo",name:"undo",onclick:function(){F(t=D.undo()),M()}},{type:"button",icon:"redo",tooltip:"Redo",name:"redo",onclick:function(){F(t=D.redo()),M()}},{type:"button",icon:"zoomin",tooltip:"Zoom in",onclick:function(){var e=d.zoom();e<2&&(e+=.1),d.zoom(e)}},{type:"button",icon:"zoomout",tooltip:"Zoom out",onclick:function(){var e=d.zoom();e>.1&&(e-=.1),d.zoom(e)}}]}),h=Ae.create("Container",{type:"container",layout:"flex",direction:"row",align:"stretch",flex:1,items:P([m,d])}),T=[a,c,l,f,u,g,p,v,b,y,w,x,C,S,E,k,N],(i=e.windowManager.open({layout:"flex",direction:"column",align:"stretch",minWidth:Math.min(Oe.DOM.getViewPort().w,800),minHeight:Math.min(Oe.DOM.getViewPort().h,650),title:"Edit image",items:T.concat([h]),buttons:P([{text:"Save",name:"save",subtype:"primary",onclick:function(){n(t.blob),i.close()}},{text:"Cancel",onclick:"close"}])})).on("close",(function(){o(),We(D.data),D=null,s=null})),D.add(t),M(),d.on("load",(function(){_=d.imageSize().w,R=d.imageSize().h,O=R/_,A=_/R,i.find("#w").value(_),i.find("#h").value(R)})),d.on("crop",j)}var Ue,Ve={edit:function(e,t){return new _e((function(n,r){return t.toBlob().then((function(t){je(e,He(t),n,r)}))}))}},qe={getImageSize:function(e){var t,n;function r(e){return/^[0-9\.]+px$/.test(e)}return t=e.style.width,n=e.style.height,t||n?r(t)&&r(n)?{w:parseInt(t,10),h:parseInt(n,10)}:null:(t=e.width,n=e.height,t&&n?{w:parseInt(t,10),h:parseInt(n,10)}:null)},setImageSize:function(e,t){var n,r;t&&(n=e.style.width,r=e.style.height,(n||r)&&(e.style.width=t.w+"px",e.style.height=t.h+"px",e.removeAttribute("data-mce-style")),n=e.width,r=e.height,(n||r)&&(e.setAttribute("width",t.w),e.setAttribute("height",t.h)))},getNaturalImageSize:function(e){return{w:e.naturalWidth,h:e.naturalHeight}}},$e=(Ue="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===Ue}),Ye=(Array.prototype.slice,function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n))return p.some(o)}return p.none()});$e(Array.from)&&Array.from;var Xe=function(e){return null!=e},Ke=function(e,t){var n;return n=t.reduce((function(e,t){return Xe(e)?e[t]:void 0}),e),Xe(n)?n:null},Ge=function(e){return new _e((function(t){var n=new(Se("FileReader"));n.onload=function(e){var n=e.target;t(n.result)},n.readAsText(e)}))},Je=function(e,t,n){return new _e((function(o){var i;(i=new(Se("XMLHttpRequest"))).onreadystatechange=function(){4===i.readyState&&o({status:i.status,blob:this.response})},i.open("GET",e,!0),i.withCredentials=n,r.each(t,(function(e,t){i.setRequestHeader(t,e)})),i.responseType="blob",i.send()}))},Qe=function(e){var t;try{t=JSON.parse(e)}catch(e){}return t},Ze=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],et=[{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."}],tt=function(e){return"ImageProxy HTTP error: "+Ye(Ze,(function(t){return e===t.code})).fold(i("Unknown ImageProxy error"),(function(e){return e.message}))},nt=function(e){var t=tt(e);return _e.reject(t)},rt=function(e){return Ye(et,(function(t){return t.type===e})).fold(i("Unknown service error"),(function(e){return e.message}))},ot=function(e,t){return Ge(t).then((function(e){var t=function(e){var t=Qe(e),n=Ke(t,["error","type"]);return"ImageProxy Service error: "+(n?rt(n):"Invalid JSON in service error message")}(e);return _e.reject(t)}))},it=function(e,t){return 400===(n=e)||403===n||500===n?ot(0,t):nt(e);var n},at=nt,ut=function(e,t){var n={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":t};return Je(function(e,t){var n=-1===e.indexOf("?")?"?":"&";return/[?&]apiKey=/.test(e)||!t?e:e+n+"apiKey="+encodeURIComponent(t)}(e,t),n,!1).then((function(e){return e.status<200||e.status>=300?it(e.status,e.blob):_e.resolve(e.blob)}))},st=function(e,t,n){return t?ut(e,t):function(e,t){return Je(e,{},t).then((function(e){return e.status<200||e.status>=300?at(e.status):_e.resolve(e.blob)}))}(e,n)},ct=0,lt=function(e,t){e.notificationManager.open({text:t,type:"error"})},ft=function(e){return e.selection.getNode()},dt=function(e,t){var n=t.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new Re(n).host===e.documentBaseURI.host},mt=function(e,t){return-1!==r.inArray(function(e){return e.getParam("imagetools_cors_hosts",[],"string[]")}(e),new Re(t.src).host)},ht=function(e,t){var n,o=t.src;return mt(e,t)?st(t.src,null,function(e,t){return-1!==r.inArray(function(e){return e.getParam("imagetools_credentials_hosts",[],"string[]")}(e),new Re(t.src).host)}(e,t)):dt(e,t)?E(t):(o=function(e){return e.getParam("imagetools_proxy")}(e),o+=(-1===o.indexOf("?")?"?":"&")+"url="+encodeURIComponent(t.src),n=function(e){return e.getParam("api_key",e.getParam("imagetools_api_key","","string"),"string")}(e),st(o,n,!1))},gt=function(e){var t;return(t=e.editorUpload.blobCache.getByUri(ft(e).src))?_e.resolve(t.blob()):ht(e,ft(e))},pt=function(e){clearTimeout(e.get())},vt=function(e,t,n,r,o){return t.toBlob().then((function(i){var a,u,s,c,l;return s=e.editorUpload.blobCache,a=(l=ft(e)).src,function(e){return e.getParam("images_reuse_filename",!1,"boolean")}(e)&&((c=s.getByUri(a))?(a=c.uri(),u=c.name()):u=function(e,t){var n=t.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i);return n?e.dom.encode(n[1]):null}(e,a)),c=s.create({id:"imagetools"+ct++,blob:i,base64:t.toBase64(),uri:a,name:u}),s.add(c),e.undoManager.transact((function(){e.$(l).on("load",(function t(){e.$(l).off("load",t),e.nodeChanged(),n?e.editorUpload.uploadImagesAuto():(pt(r),function(e,t){var n=Te.setEditorTimeout(e,(function(){e.editorUpload.uploadImagesAuto()}),function(e){return e.getParam("images_upload_timeout",3e4,"number")}(e));t.set(n)}(e,r))})),o&&e.$(l).attr({width:o.w,height:o.h}),e.$(l).attr({src:c.blobUri()}).removeAttr("data-mce-src")})),c}))},bt=function(e,t,n,r){return function(){return e._scanForImages().then(a(gt,e)).then(we).then(n).then((function(n){return vt(e,n,!1,t,r)}),(function(t){lt(e,t)}))}},yt=function(e,t,n){return function(){var r=qe.getImageSize(ft(e)),o=r?{w:r.h,h:r.w}:null;return bt(e,t,(function(e){return ye(e,n)}),o)()}},wt=function(e,t,n){return function(){return bt(e,t,(function(e){return pe(e,n)}))()}},xt=function(e,t){return function(){var n=ft(e),r=qe.getNaturalImageSize(n),o=function(e){return new _e((function(t){(function(e){return k(e)})(e).then((function(o){var i=qe.getNaturalImageSize(o);r.w===i.w&&r.h===i.h||qe.getImageSize(n)&&qe.setImageSize(n,i),Ne(o.src),t(e)}))}))};gt(e).then(we).then(a((function(e,n){return Ve.edit(e,n).then(o).then(we).then((function(n){return vt(e,n,!0,t)}),(function(){}))}),e),(function(t){lt(e,t)}))}},Ct=function(e,t){return e.dom.is(t,"img:not([data-mce-object],[data-mce-placeholder])")&&(dt(e,t)||mt(e,t)||e.settings.imagetools_proxy)},St=pt,Et=function(e,t){r.each({mceImageRotateLeft:yt(e,t,-90),mceImageRotateRight:yt(e,t,90),mceImageFlipVertical:wt(e,t,"v"),mceImageFlipHorizontal:wt(e,t,"h"),mceEditImage:xt(e,t)},(function(t,n){e.addCommand(n,t)}))},kt=function(e,t,n){e.on("NodeChange",(function(r){var o=n.get();o&&o.src!==r.element.src&&(St(t),e.editorUpload.uploadImagesAuto(),n.set(null)),Ct(e,r.element)&&n.set(r.element)}))},Nt=function(e){e.addButton("rotateleft",{title:"Rotate counterclockwise",cmd:"mceImageRotateLeft"}),e.addButton("rotateright",{title:"Rotate clockwise",cmd:"mceImageRotateRight"}),e.addButton("flipv",{title:"Flip vertically",cmd:"mceImageFlipVertical"}),e.addButton("fliph",{title:"Flip horizontally",cmd:"mceImageFlipHorizontal"}),e.addButton("editimage",{title:"Edit image",cmd:"mceEditImage"}),e.addButton("imageoptions",{title:"Image options",icon:"options",cmd:"mceImage"})},Tt=function(e){e.addContextToolbar(a(Ct,e),function(e){return e.getParam("imagetools_toolbar","rotateleft rotateright | flipv fliph | crop editimage imageoptions")}(e))};n.add("imagetools",(function(e){var n=t(0),r=t(null);Et(e,n),Nt(e),Tt(e),kt(e,n,r)}))}(window)},608:function(e,t){!function(e){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.VK"),r=function(e){return e.target_list},o=function(e){return e.rel_list},i=function(e){return e.link_class_list},a=function(e){return"boolean"==typeof e.link_assume_external_targets&&e.link_assume_external_targets},u=function(e){return"boolean"==typeof e.link_context_toolbar&&e.link_context_toolbar},s=function(e){return e.link_list},c=function(e){return"string"==typeof e.default_link_target},l=function(e){return e.default_link_target},f=r,d=function(e,t){e.settings.target_list=t},m=function(e){return!1!==r(e)},h=o,g=function(e){return void 0!==o(e)},p=i,v=function(e){return void 0!==i(e)},b=function(e){return!1!==e.link_title},y=function(e){return"boolean"==typeof e.allow_unsafe_link_target&&e.allow_unsafe_link_target},w=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),x=tinymce.util.Tools.resolve("tinymce.Env"),C=function(t){if(!x.ie||x.ie>10){var n=e.document.createElement("a");n.target="_blank",n.href=t,n.rel="noreferrer noopener";var r=e.document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,e.window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,n){e.document.body.appendChild(t),t.dispatchEvent(n),e.document.body.removeChild(t)}(n,r)}else{var o=e.window.open("","_blank");if(o){o.opener=null;var i=o.document;i.open(),i.write('<meta http-equiv="refresh" content="0; url='+w.DOM.encode(t)+'">'),i.close()}}},S=tinymce.util.Tools.resolve("tinymce.util.Tools"),E=function(e,t){var n=["noopener"],r=e?e.split(/\s+/):[],o=function(e){return e.filter((function(e){return-1===S.inArray(n,e)}))};return(r=t?function(e){return(e=o(e)).length?e.concat(n):n}(r):o(r)).length?function(e){return S.trim(e.sort().join(" "))}(r):null},k=function(e,t){return t=t||e.selection.getNode(),T(t)?e.dom.select("a[href]",t)[0]:e.dom.getParent(t,"a[href]")},N=function(e){return e&&"A"===e.nodeName&&e.href},T=function(e){return e&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className)},_=function(e,t){var n,r;(r=e.dom.select("img",t)[0])&&(n=e.dom.getParents(r,"a[href]",t)[0])&&(n.parentNode.insertBefore(r,n),e.dom.remove(n))},R=function(e,t,n){var r,o;(o=e.dom.select("img",t)[0])&&(r=e.dom.create("a",n),o.parentNode.insertBefore(r,o),r.appendChild(o))},O=function(e,t){return function(n){e.undoManager.transact((function(){var r=e.selection.getNode(),o=k(e,r),i={href:n.href,target:n.target?n.target:null,rel:n.rel?n.rel:null,class:n.class?n.class:null,title:n.title?n.title:null};g(e.settings)||!1!==y(e.settings)||(i.rel=E(i.rel,"_blank"===i.target)),n.href===t.href&&(t.attach(),t={}),o?(e.focus(),n.hasOwnProperty("text")&&("innerText"in o?o.innerText=n.text:o.textContent=n.text),e.dom.setAttribs(o,i),e.selection.select(o),e.undoManager.add()):T(r)?R(e,r,i):n.hasOwnProperty("text")?e.insertContent(e.dom.createHTML("a",i,e.dom.encode(n.text))):e.execCommand("mceInsertLink",!1,i)}))}},A=function(e){return function(){e.undoManager.transact((function(){var t=e.selection.getNode();T(t)?_(e,t):e.execCommand("unlink")}))}},D=N,P=function(e){return S.grep(e,N).length>0},B=function(e){return!(/</.test(e)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(e)||-1===e.indexOf("href=")))},I=k,M=function(e,t){return function(e){return e.replace(/\uFEFF/g,"")}(t?t.innerText||t.textContent:e.getContent({format:"text"}))},L=E,F=tinymce.util.Tools.resolve("tinymce.util.Delay"),H=tinymce.util.Tools.resolve("tinymce.util.XHR"),z={},W=function(e,t,n){var r=function(e,n){return n=n||[],S.each(e,(function(e){var o={text:e.text||e.title};e.menu?o.menu=r(e.menu):(o.value=e.value,t&&t(o)),n.push(o)})),n};return r(e,n||[])},j=function(e,t,n){var r=e.selection.getRng();F.setEditorTimeout(e,(function(){e.windowManager.confirm(t,(function(t){e.selection.setRng(r),n(t)}))}))},U=function(e,t){var n,r,o,i,u,s,w,x,C,E,k,N={},T=e.selection,_=e.dom,R=function(e){var t=o.find("#text");(!t.value()||e.lastControl&&t.value()===e.lastControl.text())&&t.value(e.control.text()),o.find("#href").value(e.control.value())},D=function(){r||!i||N.text||this.parent().parent().find("#text")[0].value(this.value())};i=B(T.getContent()),n=I(e),N.text=r=M(e.selection,n),N.href=n?_.getAttrib(n,"href"):"",n?N.target=_.getAttrib(n,"target"):c(e.settings)&&(N.target=l(e.settings)),(k=_.getAttrib(n,"rel"))&&(N.rel=k),(k=_.getAttrib(n,"class"))&&(N.class=k),(k=_.getAttrib(n,"title"))&&(N.title=k),i&&(u={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){N.text=this.value()}}),t&&(s={type:"listbox",label:"Link list",values:W(t,(function(t){t.value=e.convertURL(t.value||t.url,"href")}),[{text:"None",value:""}]),onselect:R,value:e.convertURL(N.href,"href"),onPostRender:function(){s=this}}),m(e.settings)&&(void 0===f(e.settings)&&d(e,[{text:"None",value:""},{text:"New window",value:"_blank"}]),x={name:"target",type:"listbox",label:"Target",values:W(f(e.settings))}),g(e.settings)&&(w={name:"rel",type:"listbox",label:"Rel",values:W(h(e.settings),(function(t){!1===y(e.settings)&&(t.value=L(t.value,"_blank"===N.target))}))}),v(e.settings)&&(C={name:"class",type:"listbox",label:"Class",values:W(p(e.settings),(function(t){t.value&&(t.textStyle=function(){return e.formatter.getCssText({inline:"a",classes:[t.value]})})}))}),b(e.settings)&&(E={name:"title",type:"textbox",label:"Title",value:N.title}),o=e.windowManager.open({title:"Insert link",data:N,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:function(t){var n=t.meta||{};s&&s.value(e.convertURL(this.value(),"href")),S.each(t.meta,(function(e,t){var n=o.find("#"+t);"text"===t?0===r.length&&(n.value(e),N.text=e):n.value(e)})),n.attach&&(z={href:this.value(),attach:n.attach}),n.text||D.call(this)},onkeyup:D,onpaste:D,onbeforecall:function(e){e.meta=o.toJSON()}},u,E,function(t){var n=[];if(S.each(e.dom.select("a:not([href])"),(function(e){var r=e.name||e.id;r&&n.push({text:r,value:"#"+r,selected:-1!==t.indexOf("#"+r)})})),n.length)return n.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:n,onselect:R}}(N.href),s,w,x,C],onSubmit:function(t){var n=a(e.settings),o=O(e,z),u=A(e),s=S.extend({},N,t.data),c=s.href;c?(i&&s.text!==r||delete s.text,c.indexOf("@")>0&&-1===c.indexOf("//")&&-1===c.indexOf("mailto:")?j(e,"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",(function(e){e&&(s.href="mailto:"+c),o(s)})):!0===n&&!/^\w+:/i.test(c)||!1===n&&/^\s*www[\.|\d\.]/i.test(c)?j(e,"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",(function(e){e&&(s.href="http://"+c),o(s)})):o(s)):u()}})},V=function(e){!function(e,t){var n=s(e.settings);"string"==typeof n?H.send({url:n,success:function(n){t(e,JSON.parse(n))}}):"function"==typeof n?n((function(n){t(e,n)})):t(e,n)}(e,U)},q=function(e,t){return e.dom.getParent(t,"a[href]")},$=function(e){return q(e,e.selection.getStart())},Y=function(e,t){if(t){var n=function(e){var t=e.getAttribute("data-mce-href");return t||e.getAttribute("href")}(t);if(/^#/.test(n)){var r=e.$(n);r.length&&e.selection.scrollIntoView(r[0],!0)}else C(t.href)}},X=function(e){return function(){V(e)}},K=function(e){return function(){Y(e,$(e))}},G=function(e){return function(t){var n,r,o;return!!(u(e.settings)&&!function(e){var t=e.plugins.contextmenu;return!!t&&t.isContextMenuVisible()}(e)&&D(t)&&3===(o=(r=(n=e.selection).getRng()).startContainer).nodeType&&n.isCollapsed()&&r.startOffset>0&&r.startOffset<o.data.length)}},J=function(e){e.on("click",(function(t){var r=q(e,t.target);r&&n.metaKeyPressed(t)&&(t.preventDefault(),Y(e,r))})),e.on("keydown",(function(t){var n=$(e);n&&13===t.keyCode&&function(e){return!0===e.altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey}(t)&&(t.preventDefault(),Y(e,n))}))},Q=function(e){return function(){var t=this;e.on("nodechange",(function(n){t.active(!e.readonly&&!!I(e,n.element))}))}},Z=function(e){return function(){var t=this,n=function(e){P(e.parents)?t.show():t.hide()};P(e.dom.getParents(e.selection.getStart()))||t.hide(),e.on("nodechange",n),t.on("remove",(function(){e.off("nodechange",n)}))}},ee=function(e){e.addCommand("mceLink",X(e))},te=function(e){e.addShortcut("Meta+K","",X(e))},ne=function(e){e.addButton("link",{active:!1,icon:"link",tooltip:"Insert/edit link",onclick:X(e),onpostrender:Q(e)}),e.addButton("unlink",{active:!1,icon:"unlink",tooltip:"Remove link",onclick:A(e),onpostrender:Q(e)}),e.addContextToolbar&&e.addButton("openlink",{icon:"newtab",tooltip:"Open link",onclick:K(e)})},re=function(e){e.addMenuItem("openlink",{text:"Open link",icon:"newtab",onclick:K(e),onPostRender:Z(e),prependToContext:!0}),e.addMenuItem("link",{icon:"link",text:"Link",shortcut:"Meta+K",onclick:X(e),stateSelector:"a[href]",context:"insert",prependToContext:!0}),e.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onclick:A(e),stateSelector:"a[href]"})},oe=function(e){e.addContextToolbar&&e.addContextToolbar(G(e),"openlink | link unlink")};t.add("link",(function(e){ne(e),re(e),oe(e),J(e),ee(e),te(e)}))}(window)},609:function(e,t){!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),n=function(e){return e.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i)},r=function(e){return e.getParam("default_link_target","")},o=function(e,t){if(t<0&&(t=0),3===e.nodeType){var n=e.data.length;t>n&&(t=n)}return t},i=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)},a=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)},u=function(e,t,o){var u,s,c,l,f,d,m,h,g,p,v=n(e),b=r(e);if("A"!==e.selection.getNode().tagName){if((u=e.selection.getRng(!0).cloneRange()).startOffset<5){if(!(h=u.endContainer.previousSibling)){if(!u.endContainer.firstChild||!u.endContainer.firstChild.nextSibling)return;h=u.endContainer.firstChild.nextSibling}if(g=h.length,i(u,h,g),a(u,h,g),u.endOffset<5)return;s=u.endOffset,l=h}else{if(3!==(l=u.endContainer).nodeType&&l.firstChild){for(;3!==l.nodeType&&l.firstChild;)l=l.firstChild;3===l.nodeType&&(i(u,l,0),a(u,l,l.nodeValue.length))}s=1===u.endOffset?2:u.endOffset-1-t}c=s;do{i(u,l,s>=2?s-2:0),a(u,l,s>=1?s-1:0),s-=1,p=u.toString()}while(" "!==p&&""!==p&&160!==p.charCodeAt(0)&&s-2>=0&&p!==o);!function(e,t){return e===t||" "===e||160===e.charCodeAt(0)}(u.toString(),o)?0===u.startOffset?(i(u,l,0),a(u,l,c)):(i(u,l,s),a(u,l,c)):(i(u,l,s),a(u,l,c),s+=1),"."===(d=u.toString()).charAt(d.length-1)&&a(u,l,c-1),(m=(d=u.toString().trim()).match(v))&&("www."===m[1]?m[1]="http://www.":/@$/.test(m[1])&&!/^mailto:/.test(m[1])&&(m[1]="mailto:"+m[1]),f=e.selection.getBookmark(),e.selection.setRng(u),e.execCommand("createlink",!1,m[1]+m[2]),b&&e.dom.setAttrib(e.selection.getNode(),"target",b),e.selection.moveToBookmark(f),e.nodeChanged())}},s=function(e){var n;e.on("keydown",(function(t){if(13===t.keyCode)return function(e){u(e,-1,"")}(e)})),t.ie?e.on("focus",(function(){if(!n){n=!0;try{e.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}})):(e.on("keypress",(function(t){if(41===t.keyCode)return function(e){u(e,-1,"(")}(e)})),e.on("keyup",(function(t){if(32===t.keyCode)return function(e){u(e,0,"")}(e)})))};e.add("autolink",(function(e){s(e)}))}()},610:function(e,t){!function(){"use strict";var e=function(t){var n=t,r=function(){return n};return{get:r,set:function(e){n=e},clone:function(){return e(r())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return{isContextMenuVisible:function(){return e.get()}}},r=function(e){return e.settings.contextmenu_never_use_native},o=function(e){return e.getParam("contextmenu","link openlink image inserttable | cell row column deletetable")},i=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),a=function(e){return i.DOM.select(e.settings.ui_container)[0]},u=function(e,t){return{x:e,y:t}},s=function(e,t,n){return u(e.x+t,e.y+n)},c=function(e,t){if(e&&"static"!==i.DOM.getStyle(e,"position",!0)){var n=i.DOM.getPos(e),r=n.x-e.scrollLeft,o=n.y-e.scrollTop;return s(t,-r,-o)}return s(t,0,0)},l=function(e,t){if(e.inline)return c(a(e),function(e){return u(e.pageX,e.pageY)}(t));var n,r,o,l=(n=e.getContentAreaContainer(),r=function(e){return u(e.clientX,e.clientY)}(t),o=i.DOM.getPos(n),s(r,o.x,o.y));return c(a(e),l)},f=tinymce.util.Tools.resolve("tinymce.ui.Factory"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=function(e,t,n,r){null===r.get()?r.set(function(e,t){var n,r,i=[];r=o(e),d.each(r.split(/[ ,]/),(function(t){var n=e.menuItems[t];"|"===t&&(n={text:t}),n&&(n.shortcut="",i.push(n))}));for(var u=0;u<i.length;u++)"|"===i[u].text&&(0!==u&&u!==i.length-1||i.splice(u,1));return(n=f.create("menu",{items:i,context:"contextmenu",classes:"contextmenu"})).uiContainer=a(e),n.renderTo(a(e)),n.on("hide",(function(e){e.control===this&&t.set(!1)})),e.on("remove",(function(){n.remove(),n=null})),n}(e,n)):r.get().show(),r.get().moveTo(t.x,t.y),n.set(!0)},h=function(e,t,n){e.on("contextmenu",(function(o){(function(e,t){return t.ctrlKey&&!r(e)})(e,o)||(o.preventDefault(),m(e,l(e,o),t,n))}))};t.add("contextmenu",(function(t){var r=e(null),o=e(!1);return h(t,o,r),n(o)}))}()},611:function(e,t){!function(){"use strict";var e=function(t){var n=t,r=function(){return n};return{get:r,set:function(e){n=e},clone:function(){return e(r())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.Tools");function r(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var o={findAndReplaceDOMText:function(e,t,n,o,i){var a,u,s,c,l,f,d=[],m=0;function h(e,t){if(t=t||0,!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");var n=e.index;if(t>0){var r=e[t];if(!r)throw new Error("Invalid capture group");n+=e[0].indexOf(r),e[0]=r}return[n,n+e[0].length,[e[0]]]}if(s=t.ownerDocument,c=i.getBlockElements(),l=i.getWhiteSpaceElements(),f=i.getShortEndedElements(),u=function e(t){var n;if(3===t.nodeType)return t.data;if(l[t.nodeName]&&!c[t.nodeName])return"";if(n="",r(t))return"\n";if((c[t.nodeName]||f[t.nodeName])&&(n+="\n"),t=t.firstChild)do{n+=e(t)}while(t=t.nextSibling);return n}(t)){if(e.global)for(;a=e.exec(u);)d.push(h(a,o));else a=u.match(e),d.push(h(a,o));return d.length&&(m=d.length,function(e,t,n){var o,i,a,u,s=[],d=0,m=e,h=t.shift(),g=0;e:for(;;){if((c[m.nodeName]||f[m.nodeName]||r(m))&&d++,3===m.nodeType&&(!i&&m.length+d>=h[1]?(i=m,u=h[1]-d):o&&s.push(m),!o&&m.length+d>h[0]&&(o=m,a=h[0]-d),d+=m.length),o&&i){if(m=n({startNode:o,startNodeIndex:a,endNode:i,endNodeIndex:u,innerNodes:s,match:h[2],matchIndex:g}),d-=i.length-u,o=null,i=null,s=[],g++,!(h=t.shift()))break}else if(l[m.nodeName]&&!c[m.nodeName]||!m.firstChild){if(m.nextSibling){m=m.nextSibling;continue}}else if(!r(m)){m=m.firstChild;continue}for(;;){if(m.nextSibling){m=m.nextSibling;break}if(m.parentNode===e)break e;m=m.parentNode}}}(t,d,function(e){var t;if("function"!=typeof e){var n=e.nodeType?e:s.createElement(e);t=function(e,t){var r=n.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(s.createTextNode(e)),r}}else t=e;return function(e){var n,r,o,i=e.startNode,a=e.endNode,u=e.matchIndex;if(i===a){var c=i;o=c.parentNode,e.startNodeIndex>0&&(n=s.createTextNode(c.data.substring(0,e.startNodeIndex)),o.insertBefore(n,c));var l=t(e.match[0],u);return o.insertBefore(l,c),e.endNodeIndex<c.length&&(r=s.createTextNode(c.data.substring(e.endNodeIndex)),o.insertBefore(r,c)),c.parentNode.removeChild(c),l}n=s.createTextNode(i.data.substring(0,e.startNodeIndex)),r=s.createTextNode(a.data.substring(e.endNodeIndex));for(var f=t(i.data.substring(e.startNodeIndex),u),d=0,m=e.innerNodes.length;d<m;++d){var h=e.innerNodes[d],g=t(h.data,u);h.parentNode.replaceChild(g,h)}var p=t(a.data.substring(0,e.endNodeIndex),u);return(o=i.parentNode).insertBefore(n,i),o.insertBefore(f,i),o.removeChild(i),(o=a.parentNode).insertBefore(p,a),o.insertBefore(r,a),o.removeChild(a),p}}(n))),m}}},i=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},a=function(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)},u=function(e,t){var r,o=[];if((r=n.toArray(e.getBody().getElementsByTagName("span"))).length)for(var a=0;a<r.length;a++){var u=i(r[a]);null!==u&&u.length&&u===t.toString()&&o.push(r[a])}return o},s=function(e,t,n){var r=t.get(),o=e.dom;(n=!1!==n)?r++:r--,o.removeClass(u(e,t.get()),"mce-match-marker-selected");var i=u(e,r);return i.length?(o.addClass(u(e,r),"mce-match-marker-selected"),e.selection.scrollIntoView(i[0]),r):-1},c=function(e,t){var n=t.parentNode;e.remove(t),e.isEmpty(n)&&e.remove(n)},l=function(e,t){var n=s(e,t,!0);-1!==n&&t.set(n)},f=function(e,t){var n=s(e,t,!1);-1!==n&&t.set(n)},d=function(e){var t=i(e);return null!==t&&t.length>0},m=function(e,t,r){var o,u,s,c;for(u=n.toArray(e.getBody().getElementsByTagName("span")),o=0;o<u.length;o++){var l=i(u[o]);null!==l&&l.length&&(l===t.get().toString()&&(s||(s=u[o].firstChild),c=u[o].firstChild),a(u[o]))}if(s&&c){var f=e.dom.createRng();return f.setStart(s,0),f.setEnd(c,c.data.length),!1!==r&&e.selection.setRng(f),f}},h=function(e,t){return u(e,t.get()+1).length>0},g=function(e,t){return u(e,t.get()-1).length>0},p={done:m,find:function(e,t,n,r,i){n=(n=n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")).replace(/\s/g,"[^\\S\\r\\n]"),n=i?"\\b"+n+"\\b":n;var a=function(e,t,n){var r,i;return(i=e.dom.create("span",{"data-mce-bogus":1})).className="mce-match-marker",r=e.getBody(),m(e,t,!1),o.findAndReplaceDOMText(n,r,i,!1,e.schema)}(e,t,new RegExp(n,r?"g":"gi"));return a&&(t.set(-1),t.set(s(e,t,!0))),a},next:l,prev:f,replace:function(e,t,r,o,u){var s,m,p,v,b,y,w=t.get();for(o=!1!==o,p=e.getBody(),m=n.grep(n.toArray(p.getElementsByTagName("span")),d),s=0;s<m.length;s++){var x=i(m[s]);if(v=b=parseInt(x,10),u||v===t.get()){for(r.length?(m[s].firstChild.nodeValue=r,a(m[s])):c(e.dom,m[s]);m[++s];){if((v=parseInt(i(m[s]),10))!==b){s--;break}c(e.dom,m[s])}o&&w--}else b>t.get()&&m[s].setAttribute("data-mce-index",b-1)}return t.set(w),o?(y=h(e,t),l(e,t)):(y=g(e,t),f(e,t)),!u&&y},hasNext:h,hasPrev:g},v=function(e,t){return{done:function(n){return p.done(e,t,n)},find:function(n,r,o){return p.find(e,t,n,r,o)},next:function(){return p.next(e,t)},prev:function(){return p.prev(e,t)},replace:function(n,r,o){return p.replace(e,t,n,r,o)}}},b=function(e,t){var r,o={};function i(){u.statusbar.find("#next").disabled(!1===p.hasNext(e,t)),u.statusbar.find("#prev").disabled(!1===p.hasPrev(e,t))}function a(){e.windowManager.alert("Could not find the specified string.",(function(){u.find("#find")[0].focus()}))}e.undoManager.add(),r=n.trim(e.selection.getContent({format:"text"}));var u=e.windowManager.open({layout:"flex",pack:"center",align:"center",onClose:function(){e.focus(),p.done(e,t),e.undoManager.add()},onSubmit:function(n){var r,s,c,l;return n.preventDefault(),s=u.find("#case").checked(),l=u.find("#words").checked(),(c=u.find("#find").value()).length?o.text===c&&o.caseState===s&&o.wholeWord===l?p.hasNext(e,t)?(p.next(e,t),void i()):void a():((r=p.find(e,t,c,s,l))||a(),u.statusbar.items().slice(1).disabled(0===r),i(),void(o={text:c,caseState:s,wholeWord:l})):(p.done(e,t,!1),void u.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",subtype:"primary",onclick:function(){u.submit()}},{text:"Replace",disabled:!0,onclick:function(){p.replace(e,t,u.find("#replace").value())||(u.statusbar.items().slice(1).disabled(!0),t.set(-1),o={})}},{text:"Replace all",disabled:!0,onclick:function(){p.replace(e,t,u.find("#replace").value(),!0,!0),u.statusbar.items().slice(1).disabled(!0),o={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){p.prev(e,t),i()}},{text:"Next",name:"next",disabled:!0,onclick:function(){p.next(e,t),i()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:r},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}})},y=function(e,t){e.addCommand("SearchReplace",(function(){b(e,t)}))},w=function(e,t){return function(){b(e,t)}},x=function(e,t){e.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Meta+F",onclick:w(e,t),separator:"before",context:"edit"}),e.addButton("searchreplace",{tooltip:"Find and replace",onclick:w(e,t)}),e.shortcuts.add("Meta+F","",w(e,t))};t.add("searchreplace",(function(t){var n=e(-1);return y(t,n),x(t,n),v(t,n)}))}()},612:function(e,t){!function(e){"use strict";var t=function(e){var n=e,r=function(){return n};return{get:r,set:function(e){n=e},clone:function(){return t(r())}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return!(!/(^|[ ,])tinymcespellchecker([, ]|$)/.test(t.settings.plugins)||!n.get("tinymcespellchecker")||(void 0!==e.window.console&&e.window.console.log&&e.window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),0))},o=function(e){return e.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")},i=function(e){var t=e.getParam("language","en");return e.getParam("spellchecker_language",t)},a=function(e){return e.getParam("spellchecker_rpc_url")},u=function(e){return e.getParam("spellchecker_callback")},s=function(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`§©«®±¶·¸»¼½¾¿×÷¤”“„    ]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)},c=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=tinymce.util.Tools.resolve("tinymce.util.URI"),f=tinymce.util.Tools.resolve("tinymce.util.XHR"),d=function(e){return e.fire("SpellcheckStart")},m=function(e){return e.fire("SpellcheckEnd")};function h(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var g,p=function(e,t){var n,r,o,i,a,u=[],s=t.dom;function c(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}function l(t){var n=e.getElementsByTagName("*"),r=[];t="number"==typeof t?""+t:null;for(var o=0;o<n.length;o++){var i=n[o],a=i.getAttribute("data-mce-index");null!==a&&a.length&&-1!==i.className.indexOf("mce-spellchecker-word")&&(a!==t&&null!==t||r.push(i))}return r}function f(e){for(var t=u.length;t--;)if(u[t]===e)return t;return-1}function d(e){for(var t=0,n=u.length;t<n&&!1!==e(u[t],t);t++);return this}function m(e){var t,n,r=l(e?f(e):null);for(t=r.length;t--;)(n=r[t]).parentNode.insertBefore(n.firstChild,n),n.parentNode.removeChild(n);return this}function g(e){var n=l(f(e)),r=t.dom.createRng();return r.setStartBefore(n[0]),r.setEndAfter(n[n.length-1]),r}return o=t.schema.getBlockElements(),i=t.schema.getWhiteSpaceElements(),a=t.schema.getShortEndedElements(),{text:r=function e(t){var n;if(3===t.nodeType)return t.data;if(i[t.nodeName]&&!o[t.nodeName])return"";if(h(t))return"\n";if(n="",(o[t.nodeName]||a[t.nodeName])&&(n+="\n"),t=t.firstChild)do{n+=e(t)}while(t=t.nextSibling);return n}(e),matches:u,each:d,filter:function(e){var t=[];return d((function(n,r){e(n,r)&&t.push(n)})),u=t,this},reset:function(){return u.splice(0,u.length),m(),this},matchFromElement:function(e){return u[e.getAttribute("data-mce-index")]},elementFromMatch:function(e){return l(f(e))[0]},find:function(e,t){if(r&&e.global)for(;n=e.exec(r);)u.push(c(n,t));return this},add:function(e,t,n){return u.push({start:e,end:e+t,text:r.substr(e,t),data:n}),this},wrap:function(t){return u.length&&function(e,t,n){var r,u,s,c,l,f=[],d=0,m=e,g=0;(t=t.slice(0)).sort((function(e,t){return e.start-t.start})),l=t.shift();e:for(;;){if((o[m.nodeName]||a[m.nodeName]||h(m))&&d++,3===m.nodeType&&(!u&&m.length+d>=l.end?(u=m,c=l.end-d):r&&f.push(m),!r&&m.length+d>l.start&&(r=m,s=l.start-d),d+=m.length),r&&u){if(m=n({startNode:r,startNodeIndex:s,endNode:u,endNodeIndex:c,innerNodes:f,match:l.text,matchIndex:g}),d-=u.length-c,r=null,u=null,f=[],g++,!(l=t.shift()))break}else if(i[m.nodeName]&&!o[m.nodeName]||!m.firstChild){if(m.nextSibling){m=m.nextSibling;continue}}else if(!h(m)){m=m.firstChild;continue}for(;;){if(m.nextSibling){m=m.nextSibling;break}if(m.parentNode===e)break e;m=m.parentNode}}}(e,u,function(e){function t(t,n){var r=u[n];r.stencil||(r.stencil=e(r));var o=r.stencil.cloneNode(!1);return o.setAttribute("data-mce-index",n),t&&o.appendChild(s.doc.createTextNode(t)),o}return function(e){var n,r,o,i=e.startNode,a=e.endNode,u=e.matchIndex,c=s.doc;if(i===a){var l=i;o=l.parentNode,e.startNodeIndex>0&&(n=c.createTextNode(l.data.substring(0,e.startNodeIndex)),o.insertBefore(n,l));var f=t(e.match,u);return o.insertBefore(f,l),e.endNodeIndex<l.length&&(r=c.createTextNode(l.data.substring(e.endNodeIndex)),o.insertBefore(r,l)),l.parentNode.removeChild(l),f}n=c.createTextNode(i.data.substring(0,e.startNodeIndex)),r=c.createTextNode(a.data.substring(e.endNodeIndex));for(var d=t(i.data.substring(e.startNodeIndex),u),m=0,h=e.innerNodes.length;m<h;++m){var g=e.innerNodes[m],p=t(g.data,u);g.parentNode.replaceChild(p,g)}var v=t(a.data.substring(0,e.endNodeIndex),u);return(o=i.parentNode).insertBefore(n,i),o.insertBefore(d,i),o.removeChild(i),(o=a.parentNode).insertBefore(v,a),o.insertBefore(r,a),o.removeChild(a),v}}(t)),this},unwrap:m,replace:function(e,n){var r=g(e);return r.deleteContents(),n.length>0&&r.insertNode(t.dom.doc.createTextNode(n)),r},rangeFromMatch:g,indexOf:f}},v=function(e,t){if(!t.get()){var n=p(e.getBody(),e);t.set(n)}return t.get()},b=function(e,t,n,r,o,i,s){var d=u(e);(d||function(e,t,n){return function(r,o,i,u){var s={method:r,lang:n.get()},d="";s["addToDictionary"===r?"word":"text"]=o,c.each(s,(function(e,t){d&&(d+="&"),d+=t+"="+encodeURIComponent(e)})),f.send({url:new l(t).toAbsolute(a(e)),type:"post",content_type:"application/x-www-form-urlencoded",data:d,success:function(t){if(t=JSON.parse(t))t.error?u(t.error):i(t);else{var n=e.translate("Server response wasn't proper JSON.");u(n)}},error:function(){var t=e.translate("The spelling service was not found: (")+a(e)+e.translate(")");u(t)}})}}(e,t,n)).call(e.plugins.spellchecker,r,o,i,s)},y=function(e,t,n){e.dom.select("span.mce-spellchecker-word").length||w(e,t,n)},w=function(e,t,n){var r=e.selection.getBookmark();if(v(e,n).reset(),e.selection.moveToBookmark(r),n.set(null),t.get())return t.set(!1),m(e),!0},x=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},C=function(e,t,n,r,o){var i,a;if("string"!=typeof o&&o.words?(a=!!o.dictionary,i=o.words):i=o,e.setProgressState(!1),function(e){for(var t in e)return!1;return!0}(i)){var u=e.translate("No misspellings found.");return e.notificationManager.open({text:u,type:"info"}),void t.set(!1)}r.set({suggestions:i,hasDictionarySupport:a});var c=e.selection.getBookmark();v(e,n).find(s(e)).filter((function(e){return!!i[e.text]})).wrap((function(t){return e.dom.create("span",{class:"mce-spellchecker-word","data-mce-bogus":1,"data-mce-word":t.text})})),e.selection.moveToBookmark(c),t.set(!0),d(e)},S={spellcheck:function(e,t,n,r,o,i){w(e,n,r)||(e.setProgressState(!0),b(e,t,i,"spellcheck",v(e,r).text,(function(t){C(e,n,r,o,t)}),(function(t){e.notificationManager.open({text:t,type:"error"}),e.setProgressState(!1),w(e,n,r)})),e.focus())},checkIfFinished:y,addToDictionary:function(e,t,n,r,o,i,a){e.setProgressState(!0),b(e,t,o,"addToDictionary",i,(function(){e.setProgressState(!1),e.dom.remove(a,!0),y(e,n,r)}),(function(t){e.notificationManager.open({text:t,type:"error"}),e.setProgressState(!1)}))},ignoreWord:function(e,t,n,r,o,i){e.selection.collapse(),i?c.each(e.dom.select("span.mce-spellchecker-word"),(function(t){t.getAttribute("data-mce-word")===r&&e.dom.remove(t,!0)})):e.dom.remove(o,!0),y(e,t,n)},findSpansByIndex:function(e,t){var n,r=[];if((n=c.toArray(e.getBody().getElementsByTagName("span"))).length)for(var o=0;o<n.length;o++){var i=x(n[o]);null!==i&&i.length&&i===t.toString()&&r.push(n[o])}return r},getElmIndex:x,markErrors:C},E=function(e,t,n,r,o,i){return{getTextMatcher:function(){return r.get()},getWordCharPattern:function(){return s(e)},markErrors:function(o){S.markErrors(e,t,r,n,o)},getLanguage:function(){return o.get()}}},k=function(e,t,n,r,o,i){e.addCommand("mceSpellCheck",(function(){S.spellcheck(e,t,n,r,o,i)}))},N=function(e,t,n,r,i,a){var u,s,l=(u=function(e){return c.map(o(e).split(","),(function(e){return{name:(e=e.split("="))[0],value:e[1]}}))}(e),s=[],c.each(u,(function(e){s.push({selectable:!0,text:e.name,data:e.value})})),s),f=function(){S.spellcheck(e,t,n,r,a,i)},d={tooltip:"Spellcheck",onclick:f,onPostRender:function(t){var r=t.control;e.on("SpellcheckStart SpellcheckEnd",(function(){r.active(n.get())}))}};l.length>1&&(d.type="splitbutton",d.menu=l,d.onshow=function(e,t){return function(e){var n=t.get();e.control.items().each((function(e){e.active(e.settings.data===n)}))}}(0,i),d.onselect=function(e){i.set(e.control.settings.data)}),e.addButton("spellchecker",d),e.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:f,selectable:!0,onPostRender:function(){var t=this;t.active(n.get()),e.on("SpellcheckStart SpellcheckEnd",(function(){t.active(n.get())}))}})},T=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),_=tinymce.util.Tools.resolve("tinymce.ui.Factory"),R=function(t,n,r,o,i,a){t.on("click",(function(u){var s=u.target;if("mce-spellchecker-word"===s.className){u.preventDefault();var l=S.findSpansByIndex(t,S.getElmIndex(s));if(l.length>0){var f=t.dom.createRng();f.setStartBefore(l[0]),f.setEndAfter(l[l.length-1]),t.selection.setRng(f),function(t,n,r,o,i,a,u,s){var l=[],f=r.get().suggestions[u];c.each(f,(function(e){l.push({text:e,onclick:function(){t.insertContent(t.dom.encode(e)),t.dom.remove(s),S.checkIfFinished(t,o,i)}})})),l.push({text:"-"}),r.get().hasDictionarySupport&&l.push({text:"Add to Dictionary",onclick:function(){S.addToDictionary(t,n,o,i,a,u,s)}}),l.push.apply(l,[{text:"Ignore",onclick:function(){S.ignoreWord(t,o,i,u,s)}},{text:"Ignore all",onclick:function(){S.ignoreWord(t,o,i,u,s,!0)}}]),(g=_.create("menu",{items:l,context:"contextmenu",onautohide:function(e){-1!==e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){g.remove(),g=null}})).renderTo(e.document.body);var d=T.DOM.getPos(t.getContentAreaContainer()),m=t.dom.getPos(s[0]),h=t.dom.getRoot();"BODY"===h.nodeName?(m.x-=h.ownerDocument.documentElement.scrollLeft||h.scrollLeft,m.y-=h.ownerDocument.documentElement.scrollTop||h.scrollTop):(m.x-=h.scrollLeft,m.y-=h.scrollTop),d.x+=m.x,d.y+=m.y,g.moveTo(d.x,d.y+s[0].offsetHeight)}(t,n,r,o,i,a,s.getAttribute("data-mce-word"),l)}}}))};n.add("spellchecker",(function(e,n){if(!1===r(e)){var o=t(!1),a=t(i(e)),u=t(null),s=t(null);return N(e,n,o,u,a,s),R(e,n,s,o,u,a),k(e,n,o,u,s,a),E(e,o,s,u,a,n)}}))}(window)},613:function(e,t){!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e,t){var n;return e.dom.getParents(e.selection.getStart(),(function(e){var r;(r=e.style["forecolor"===t?"color":"background-color"])&&(n=n||r)})),n},n=function(e){var t,n=[];for(t=0;t<e.length;t+=2)n.push({text:e[t+1],color:"#"+e[t]});return n},r=function(e,t,n){e.undoManager.transact((function(){e.focus(),e.formatter.apply(t,{value:n}),e.nodeChanged()}))},o=function(e,t){e.undoManager.transact((function(){e.focus(),e.formatter.remove(t,{value:null},null,!0),e.nodeChanged()}))},i=function(e){e.addCommand("mceApplyTextcolor",(function(t,n){r(e,t,n)})),e.addCommand("mceRemoveTextcolor",(function(t){o(e,t)}))},a=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],c=function(e){return e.getParam("textcolor_map",s)},l=function(e){return e.getParam("textcolor_rows",5)},f=function(e){return e.getParam("textcolor_cols",8)},d=function(e){return e.getParam("color_picker_callback",null)},m=function(e){return e.getParam("forecolor_map",c(e))},h=function(e){return e.getParam("backcolor_map",c(e))},g=function(e){return e.getParam("forecolor_rows",l(e))},p=function(e){return e.getParam("backcolor_rows",l(e))},v=function(e){return e.getParam("forecolor_cols",f(e))},b=function(e){return e.getParam("backcolor_cols",f(e))},y=d,w=function(e){return"function"==typeof d(e)},x=tinymce.util.Tools.resolve("tinymce.util.I18n"),C=function(e,t,r,o){var i,u,s,c,l,f,d,m=0,h=a.DOM.uniqueId("mcearia"),g=function(e,t){var n="transparent"===e;return'<td class="mce-grid-cell'+(n?" mce-colorbtn-trans":"")+'"><div id="'+h+"-"+m+++'" data-mce-color="'+(e||"")+'" role="option" tabIndex="-1" style="'+(e?"background-color: "+e:"")+'" title="'+x.translate(t)+'">'+(n?"&#215;":"")+"</div></td>"};for((i=n(r)).push({text:x.translate("No color"),color:"transparent"}),s='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',c=i.length-1,f=0;f<t;f++){for(s+="<tr>",l=0;l<e;l++)s+=(d=f*e+l)>c?"<td></td>":g((u=i[d]).color,u.text);s+="</tr>"}if(o){for(s+='<tr><td colspan="'+e+'" class="mce-custom-color-btn"><div id="'+h+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+h+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+x.translate("Custom...")+"</button></div></td></tr>",s+="<tr>",l=0;l<e;l++)s+=g("","Custom color");s+="</tr>"}return s+="</tbody></table>"},S=function(e,t){e.style.background=t,e.setAttribute("data-mce-color",t)},E=function(e){return function(t){var n=t.control;n._color?e.execCommand("mceApplyTextcolor",n.settings.format,n._color):e.execCommand("mceRemoveTextcolor",n.settings.format)}},k=function(e,n){return function(r){var o,i=this.parent(),s=t(e,i.settings.format),c=function(t){e.execCommand("mceApplyTextcolor",i.settings.format,t),i.hidePanel(),i.color(t)};a.DOM.getParent(r.target,".mce-custom-color-btn")&&(i.hidePanel(),y(e).call(e,(function(e){var t,r,o,a=i.panel.getEl().getElementsByTagName("table")[0];for(t=u.map(a.rows[a.rows.length-1].childNodes,(function(e){return e.firstChild})),o=0;o<t.length&&(r=t[o]).getAttribute("data-mce-color");o++);if(o===n)for(o=0;o<n-1;o++)S(t[o],t[o+1].getAttribute("data-mce-color"));S(r,e),c(e)}),s)),(o=r.target.getAttribute("data-mce-color"))?(this.lastId&&a.DOM.get(this.lastId).setAttribute("aria-selected","false"),r.target.setAttribute("aria-selected",!0),this.lastId=r.target.id,"transparent"===o?(e.execCommand("mceRemoveTextcolor",i.settings.format),i.hidePanel(),i.resetColor()):c(o)):null!==o&&i.hidePanel()}},N=function(e,t){return function(){var n=t?v(e):b(e),r=t?g(e):p(e),o=t?m(e):h(e),i=w(e);return C(n,r,o,i)}},T=function(e){e.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:N(e,!0),onclick:k(e,v(e))},onclick:E(e)}),e.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:N(e,!1),onclick:k(e,b(e))},onclick:E(e)})};e.add("textcolor",(function(e){i(e),T(e)}))}()},72:function(e,t,n){"use strict";n.r(t),function(e){var n=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return(function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var o=r[n];e.call(t,o[1],o[0])}},t}())}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,o=void 0!==e&&e.Math===Math?e:"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(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var a=["top","right","bottom","left","width","height","size","weight"],u="undefined"!=typeof MutationObserver,s=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,o=0;function a(){n&&(n=!1,e()),r&&s()}function u(){i(a)}function s(){var e=Date.now();if(n){if(e-o<2)return;r=!0}else n=!0,r=!1,setTimeout(u,t);o=e}return s}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),u?(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)},e.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)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;a.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),c=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},l=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||o},f=v(0,0,0,0);function d(e){return parseFloat(e)||0}function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+d(e["border-"+n+"-width"])}),0)}function h(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return f;var r=l(e).getComputedStyle(e),o=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var o=r[n],i=e["padding-"+o];t[o]=d(i)}return t}(r),i=o.left+o.right,a=o.top+o.bottom,u=d(r.width),s=d(r.height);if("border-box"===r.boxSizing&&(Math.round(u+i)!==t&&(u-=m(r,"left","right")+i),Math.round(s+a)!==n&&(s-=m(r,"top","bottom")+a)),!function(e){return e===l(e).document.documentElement}(e)){var c=Math.round(u+i)-t,h=Math.round(s+a)-n;1!==Math.abs(c)&&(u-=c),1!==Math.abs(h)&&(s-=h)}return v(o.left,o.top,u,s)}var g="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof l(e).SVGGraphicsElement}:function(e){return e instanceof l(e).SVGElement&&"function"==typeof e.getBBox};function p(e){return r?g(e)?function(e){var t=e.getBBox();return v(0,0,t.width,t.height)}(e):h(e):f}function v(e,t,n,r){return{x:e,y:t,width:n,height:r}}var b=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=v(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=p(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),y=function(e,t){var n,r,o,i,a,u,s,l=(r=(n=t).x,o=n.y,i=n.width,a=n.height,u="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(u.prototype),c(s,{x:r,y:o,width:i,height:a,top:o,right:r+i,bottom:a+o,left:r}),s);c(this,{target:e,contentRect:l})},w=function(){function e(e,t,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof l(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new b(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof l(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new y(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),x="undefined"!=typeof WeakMap?new WeakMap:new n,C=function e(t){if(!(this instanceof e))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=s.getInstance(),r=new w(t,n,this);x.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){C.prototype[e]=function(){var t;return(t=x.get(this))[e].apply(t,arguments)}}));var S=void 0!==o.ResizeObserver?o.ResizeObserver:C;t.default=S}.call(this,n(30))},9:function(e,t,n){var r,o;!function(i,a){"use strict";void 0===(o="function"==typeof(r=function(){var e=function(){},t=["trace","debug","info","warn","error"];function n(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function r(t){return"debug"===t&&(t="log"),"undefined"!=typeof console&&(void 0!==console[t]?n(console,t):void 0!==console.log?n(console,"log"):e)}function o(n,r){for(var o=0;o<t.length;o++){var i=t[o];this[i]=o<n?e:this.methodFactory(i,n,r)}this.log=this.debug}function i(e,t,n){return function(){"undefined"!=typeof console&&(o.call(this,t,n),this[e].apply(this,arguments))}}function a(e,t,n){return r(e)||i.apply(this,arguments)}function u(e,n,r){var i,u=this,s="loglevel";function c(){var e;if("undefined"!=typeof window){try{e=window.localStorage[s]}catch(e){}if(void 0===e)try{var t=window.document.cookie,n=t.indexOf(encodeURIComponent(s)+"=");-1!==n&&(e=/^([^;]+)/.exec(t.slice(n))[1])}catch(e){}return void 0===u.levels[e]&&(e=void 0),e}}e&&(s+=":"+e),u.name=e,u.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},u.methodFactory=r||a,u.getLevel=function(){return i},u.setLevel=function(n,r){if("string"==typeof n&&void 0!==u.levels[n.toUpperCase()]&&(n=u.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=u.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(i=n,!1!==r&&function(e){var n=(t[e]||"silent").toUpperCase();if("undefined"!=typeof window){try{return void(window.localStorage[s]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(s)+"="+n+";"}catch(e){}}}(n),o.call(u,n,e),"undefined"==typeof console&&n<u.levels.SILENT)return"No console available for logging"},u.setDefaultLevel=function(e){c()||u.setLevel(e,!1)},u.enableAll=function(e){u.setLevel(u.levels.TRACE,e)},u.disableAll=function(e){u.setLevel(u.levels.SILENT,e)};var l=c();null==l&&(l=null==n?"WARN":n),u.setLevel(l,!1)}var s=new u,c={};s.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=c[e];return t||(t=c[e]=new u(e,s.getLevel(),s.methodFactory)),t};var l="undefined"!=typeof window?window.log:void 0;return s.noConflict=function(){return"undefined"!=typeof window&&window.log===s&&(window.log=l),s},s.getLoggers=function(){return c},s})?r.call(t,n,t,e):r)||(e.exports=o)}()}}]);
//# sourceMappingURL=0.3f76c12ca21b7481b9d4.js.map