mirror of
https://github.com/documize/community.git
synced 2025-07-30 10:39:44 +02:00
2 lines
No EOL
333 KiB
JavaScript
2 lines
No EOL
333 KiB
JavaScript
// 4.7.4 (2017-12-05)
|
|
!function(){"use strict";function e(){function e(n,r){return t.push(n+" ")>xe.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function t(e){return e[Me]=!0,e}function n(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||We)-(~e.sourceIndex||We);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function r(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function o(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function i(e){return t(function(n){return n=+n,t(function(t,r){for(var o,i=e([],t.length,n),a=i.length;a--;)t[o=i[a]]&&(t[o]=!(r[o]=t[o]))})})}function a(e){return e&&typeof e.getElementsByTagName!==$e&&e}function u(){}function s(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function c(e,t,n){var r=t.dir,o=n&&"parentNode"===r,i=Ue++;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=[ze,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(s=t[Me]||(t[Me]={}),(u=s[r])&&u[0]===ze&&u[1]===i)return c[2]=u[2];if(s[r]=c,c[2]=e(t,n,a))return!0}}}function l(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 f(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 d(e,n,r,o,i,a){return o&&!o[Me]&&(o=d(o)),i&&!i[Me]&&(i=d(i,a)),t(function(t,a,u,s){var c,l,d,m=[],h=[],p=a.length,g=t||function(e,t,n){for(var r=0,o=t.length;r<o;r++)bt(e,t[r],n);return n}(n||"*",u.nodeType?[u]:u,[]),v=!e||!t&&n?g:f(g,m,e,u,s),y=r?i||(t?e:p||o)?[]:a:v;if(r&&r(v,y,u,s),o)for(c=f(y,h),o(c,[],u,s),l=c.length;l--;)(d=c[l])&&(y[h[l]]=!(v[h[l]]=d));if(t){if(i||e){if(i){for(c=[],l=y.length;l--;)(d=y[l])&&c.push(v[l]=d);i(null,y=[],c,s)}for(l=y.length;l--;)(d=y[l])&&(c=i?Ze.call(t,d):m[l])>-1&&(t[c]=!(a[c]=d))}}else y=f(y===a?y.splice(p,y.length):y),i?i(null,a,y,s):Je.apply(a,y)})}function m(e){for(var t,n,r,o=e.length,i=xe.relative[e[0].type],a=i||xe.relative[" "],u=i?1:0,f=c(function(e){return e===t},a,!0),h=c(function(e){return Ze.call(t,e)>-1},a,!0),p=[function(e,n,r){return!i&&(r||n!==Te)||((t=n).nodeType?f(e,n,r):h(e,n,r))}];u<o;u++)if(n=xe.relative[e[u].type])p=[c(l(p),n)];else{if((n=xe.filter[e[u].type].apply(null,e[u].matches))[Me]){for(r=++u;r<o&&!xe.relative[e[r].type];r++);return d(u>1&&l(p),u>1&&s(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(ot,"$1"),n,u<r&&m(e.slice(u,r)),r<o&&m(e=e.slice(r)),r<o&&s(e))}p.push(n)}return l(p)}var h,p,g,v,y,b,C,x,w,N,S,E,k=function(e){return function(){return e}},T={noop:function(){},noarg:function(e){return function(){return e()}},compose:function(e,t){return function(){return e(t.apply(null,arguments))}},constant:k,identity:function(e){return e},tripleEquals:function(e,t){return e===t},curry:function(e){for(var t=new Array(arguments.length-1),n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}},not:function(e){return function(){return!e.apply(null,arguments)}},die:function(e){return function(){throw new Error(e)}},apply:function(e){return e()},call:function(e){e()},never:k(!1),always:k(!0)},A=T.never,_=T.always,R=function(){return B},B=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:A,isSome:A,isNone:_,getOr:n,getOrThunk:t,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},or:n,orThunk:t,map:R,ap:R,each:function(){},bind:R,flatten:R,exists:A,forall:_,filter:R,equals:e,equals_:e,toArray:function(){return[]},toString:T.constant("none()")};return Object.freeze&&Object.freeze(r),r}(),D=function(e){var t=function(){return e},n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:_,isNone:A,getOr:t,getOrThunk:t,getOrDie:t,or:n,orThunk:n,map:function(t){return D(t(e))},ap:function(t){return t.fold(R,function(t){return D(t(e))})},each:function(t){t(e)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(e)?o:B},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(A,function(t){return n(e,t)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},O={some:D,none:R,from:function(e){return null===e||e===undefined?B:D(e)}},P=function(){var e=Array.prototype.indexOf;return e===undefined?function(e,t){return V(e,t)}:function(t,n){return e.call(t,n)}}(),I=function(e,t){return P(e,t)>-1},L=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},M=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n,e)}},F=function(e,t){for(var n=e.length-1;n>=0;n--){t(e[n],n,e)}},z=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},U=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n,e))return O.some(n)}return O.none()},V=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},H=Array.prototype.push,q=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);H.apply(t,e[n])}return t},j=function(e,t){for(var n=0,r=e.length;n<r;++n){if(!0!==t(e[n],n,e))return!1}return!0},$=Array.prototype.slice,W={map:L,each:M,eachr:F,partition:function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o,e)?n:r).push(a)}return{pass:n,fail:r}},filter:z,groupBy: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},indexOf:function(e,t){var n=P(e,t);return-1===n?O.none():O.some(n)},foldr:function(e,t,n){return F(e,function(e){n=t(n,e)}),n},foldl:function(e,t,n){return M(e,function(e){n=t(n,e)}),n},find:function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return O.some(o)}return O.none()},findIndex:U,flatten:q,bind:function(e,t){var n=L(e,t);return q(n)},forall:j,exists:function(e,t){return U(e,t).isSome()},contains:I,equal:function(e,t){return e.length===t.length&&j(e,function(e,n){return e===t[n]})},reverse:function(e){var t=$.call(e,0);return t.reverse(),t},chunk:function(e,t){for(var n=[],r=0;r<e.length;r+=t){var o=e.slice(r,r+t);n.push(o)}return n},difference:function(e,t){return z(e,function(e){return!I(t,e)})},mapToObject: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},pure:function(e){return[e]},sort:function(e,t){var n=$.call(e,0);return n.sort(t),n},range:function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n},head:function(e){return 0===e.length?O.none():O.some(e[0])},last:function(e){return 0===e.length?O.none():O.some(e[e.length-1])}},K="undefined"!=typeof window?window:Function("return this;")(),X=function(e,t){for(var n=t!==undefined&&null!==t?t:K,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n},Y=function(e,t){var n=e.split(".");return X(n,t)},G=function(e,t){var n=function(e,t){return Y(e,t)}(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n},J=function(){return G("URL")},Q=function(e){return J().createObjectURL(e)},Z=function(e){J().revokeObjectURL(e)},ee=navigator,te=ee.userAgent,ne=function(e){return"matchMedia"in window&&matchMedia(e).matches};x=/Android/.test(te),p=(p=!(h=/WebKit/.test(te))&&/MSIE/gi.test(te)&&/Explorer/gi.test(ee.appName))&&/MSIE (\w+)\./.exec(te)[1],g=-1!==te.indexOf("Trident/")&&(-1!==te.indexOf("rv:")||-1!==ee.appName.indexOf("Netscape"))&&11,v=-1!==te.indexOf("Edge/")&&!p&&!g&&12,p=p||g||v,y=!h&&!g&&/Gecko/.test(te),b=-1!==te.indexOf("Mac"),C=/(iPad|iPhone)/.test(te),w="FormData"in window&&"FileReader"in window&&"URL"in window&&!!Q,N=ne("only screen and (max-device-width: 480px)")&&(x||C),S=ne("only screen and (min-width: 800px)")&&(x||C),E=-1!==te.indexOf("Windows Phone"),v&&(h=!1);var re,oe={opera:!1,webkit:h,ie:p,gecko:y,mac:b,iOS:C,android:x,contentEditable:!C||w||parseInt(te.match(/AppleWebKit\/(\d*)/)[1],10)>=534,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==p,range:window.getSelection&&"Range"in window,documentMode:p&&!v?document.documentMode||7:10,fileApi:w,ceFalse:!1===p||p>8,cacheSuffix:"",container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===p||p>11,desktop:!N&&!S,windowsPhone:E},ie=window.Promise?window.Promise:function(){function e(e,t){return function(){e.apply(t,arguments)}}function t(e){var t=this;null!==this._state?s(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(o){return void e.reject(o)}e.resolve(r)}else(t._state?e.resolve:e.reject)(t._value)}):this._deferreds.push(e)}function n(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var a=t.then;if("function"==typeof a)return void i(e(a,t),e(n,this),e(r,this))}this._state=!0,this._value=t,o.call(this)}catch(u){r.call(this,u)}}function r(e){this._state=!1,this._value=e,o.call(this)}function o(){for(var e=0,n=this._deferreds.length;e<n;e++)t.call(this,this._deferreds[e]);this._deferreds=null}function i(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},u=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=[],i(t,e(n,this),e(r,this))},s=u.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)};return u.prototype["catch"]=function(e){return this.then(null,e)},u.prototype.then=function(e,n){var r=this;return new u(function(o,i){t.call(r,new function(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}(e,n,o,i))})},u.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&a(arguments[0])?arguments[0]:arguments);return new u(function(t,n){function r(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){r(i,e)},n)}e[i]=a,0==--o&&t(e)}catch(s){n(s)}}if(0===e.length)return t([]);for(var o=e.length,i=0;i<e.length;i++)r(i,e[i])})},u.resolve=function(e){return e&&"object"==typeof e&&e.constructor===u?e:new u(function(t){t(e)})},u.reject=function(e){return new u(function(t,n){n(e)})},u.race=function(e){return new u(function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)})},u}(),ae=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},ue=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},se=function(e,t){var n,r;return r=function(){var r=arguments;clearTimeout(n),n=ae(function(){e.apply(this,r)},t)},r.stop=function(){clearTimeout(n)},r},ce={requestAnimationFrame:function(e,t){re?re.then(e):re=new ie(function(e){t||(t=document.body),function(e,t){var n,r=window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=window[o[n]+"RequestAnimationFrame"];r||(r=function(e){window.setTimeout(e,0)}),r(e,t)}(e,t)}).then(e)},setTimeout:ae,setInterval:ue,setEditorTimeout:function(e,t,n){return ae(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r;return r=ue(function(){e.removed?clearInterval(r):t()},n)},debounce:se,throttle:se,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},le=/^(?:mouse|contextmenu)|click/,fe={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},de=function(){return!1},me=function(){return!0},he=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},pe=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},ge=function(e,t){var n,r=t||{};for(n in e)fe[n]||(r[n]=e[n]);if(r.target||(r.target=r.srcElement||document),oe.experimentalShadowDom&&(r.target=function(e,t){var n,r=t;return(n=e.path)&&n.length>0&&(r=n[0]),e.deepPath&&(n=e.deepPath())&&n.length>0&&(r=n[0]),r}(e,r.target)),e&&le.test(e.type)&&e.pageX===undefined&&e.clientX!==undefined){var o=r.target.ownerDocument||document,i=o.documentElement,a=o.body;r.pageX=e.clientX+(i&&i.scrollLeft||a&&a.scrollLeft||0)-(i&&i.clientLeft||a&&a.clientLeft||0),r.pageY=e.clientY+(i&&i.scrollTop||a&&a.scrollTop||0)-(i&&i.clientTop||a&&a.clientTop||0)}return r.preventDefault=function(){r.isDefaultPrevented=me,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},r.stopPropagation=function(){r.isPropagationStopped=me,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=me,r.stopPropagation()},!1===function(e){return e.isDefaultPrevented===me||e.isDefaultPrevented===de}(r)&&(r.isDefaultPrevented=de,r.isPropagationStopped=de,r.isImmediatePropagationStopped=de),"undefined"==typeof r.metaKey&&(r.metaKey=!1),r},ve=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()&&(pe(r,"readystatechange",u),a())},s=function(){try{r.documentElement.doScroll("left")}catch(e){return void ce.setTimeout(s)}a()};!r.addEventListener||oe.ie&&oe.ie<11?(he(r,"readystatechange",u),r.documentElement.doScroll&&e.self===e.top&&s()):i()?a():he(e,"DOMContentLoaded",a),he(e,"load",a)}},ye=function(){var e,t,n,r,o,i=this,a={};t="mce-data-"+(+new Date).toString(32),r="onmouseenter"in document.documentElement,n="onfocusin"in document.documentElement,o={mouseenter:"mouseover",mouseleave:"mouseout"},e=1,i.domLoaded=!1,i.events=a;var u=function(e,t){var n,r,o,i,u=a[t];if(n=u&&u[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};i.bind=function(s,c,l,f){var d,m,h,p,g,v,y,b=window,C=function(e){u(ge(e||b.event),d)};if(s&&3!==s.nodeType&&8!==s.nodeType){for(s[t]?d=s[t]:(d=e++,s[t]=d,a[d]={}),f=f||s,h=(c=c.split(" ")).length;h--;)v=C,g=y=!1,"DOMContentLoaded"===(p=c[h])&&(p="ready"),i.domLoaded&&"ready"===p&&"complete"===s.readyState?l.call(f,ge({type:p})):(r||(g=o[p])&&(v=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=ge(e||b.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,u(e,d))}),n||"focusin"!==p&&"focusout"!==p||(y=!0,g="focusin"===p?"focus":"blur",v=function(e){(e=ge(e||b.event)).type="focus"===e.type?"focusin":"focusout",u(e,d)}),(m=a[d][p])?"ready"===p&&i.domLoaded?l({type:p}):m.push({func:l,scope:f}):(a[d][p]=m=[{func:l,scope:f}],m.fakeName=g,m.capture=y,m.nativeHandler=v,"ready"===p?ve(s,v,i):he(s,g||p,v,y)));return s=m=0,l}},i.unbind=function(e,n,r){var o,u,s,c,l,f;if(!e||3===e.nodeType||8===e.nodeType)return i;if(o=e[t]){if(f=a[o],n){for(s=(n=n.split(" ")).length;s--;)if(l=n[s],u=f[l]){if(r)for(c=u.length;c--;)if(u[c].func===r){var d=u.nativeHandler,m=u.fakeName,h=u.capture;(u=u.slice(0,c).concat(u.slice(c+1))).nativeHandler=d,u.fakeName=m,u.capture=h,f[l]=u}r&&0!==u.length||(delete f[l],pe(e,u.fakeName||l,u.nativeHandler,u.capture))}}else{for(l in f)u=f[l],pe(e,u.fakeName||l,u.nativeHandler,u.capture);f={}}for(l in f)return i;delete a[o];try{delete e[t]}catch(p){e[t]=null}}return i},i.fire=function(e,n,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return i;(r=ge(null,r)).type=n,r.target=e;do{(o=e[t])&&u(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow}while(e&&!r.isPropagationStopped());return i},i.clean=function(e){var n,r,o=i.unbind;if(!e||3===e.nodeType||8===e.nodeType)return i;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 i},i.destroy=function(){a={}},i.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}};(ye.Event=new ye).bind(window,"ready",function(){});var be,Ce,xe,we,Ne,Se,Ee,ke,Te,Ae,_e,Re,Be,De,Oe,Pe,Ie,Le,Me="sizzle"+-new Date,Fe=window.document,ze=0,Ue=0,Ve=e(),He=e(),qe=e(),je=function(e,t){return e===t&&(_e=!0),0},$e=typeof undefined,We=1<<31,Ke={}.hasOwnProperty,Xe=[],Ye=Xe.pop,Ge=Xe.push,Je=Xe.push,Qe=Xe.slice,Ze=Xe.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},et="[\\x20\\t\\r\\n\\f]",tt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",nt="\\["+et+"*("+tt+")(?:"+et+"*([*^$|!~]?=)"+et+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+tt+"))|)"+et+"*\\]",rt=":("+tt+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+nt+")*)|.*)\\)|)",ot=new RegExp("^"+et+"+|((?:^|[^\\\\])(?:\\\\.)*)"+et+"+$","g"),it=new RegExp("^"+et+"*,"+et+"*"),at=new RegExp("^"+et+"*([>+~]|"+et+")"+et+"*"),ut=new RegExp("="+et+"*([^\\]'\"]*?)"+et+"*\\]","g"),st=new RegExp(rt),ct=new RegExp("^"+tt+"$"),lt={ID:new RegExp("^#("+tt+")"),CLASS:new RegExp("^\\.("+tt+")"),TAG:new RegExp("^("+tt+"|[*])"),ATTR:new RegExp("^"+nt),PSEUDO:new RegExp("^"+rt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+et+"*(even|odd|(([+-]|)(\\d*)n|)"+et+"*(?:([+-]|)"+et+"*(\\d+)|))"+et+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+et+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+et+"*((?:-\\d)?\\d*)"+et+"*\\)|)(?=[^-]|$)","i")},ft=/^(?:input|select|textarea|button)$/i,dt=/^h\d$/i,mt=/^[^{]+\{\s*\[native \w/,ht=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,pt=/[+~]/,gt=/'|\\/g,vt=new RegExp("\\\\([\\da-f]{1,6}"+et+"?|("+et+")|.)","ig"),yt=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{Je.apply(Xe=Qe.call(Fe.childNodes),Fe.childNodes),Xe[Fe.childNodes.length].nodeType}catch(Gb){Je={apply:Xe.length?function(e,t){Ge.apply(e,Qe.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var bt=function(e,t,n,r){var o,i,u,c,l,f,d,m,h,p;if((t?t.ownerDocument||t:Fe)!==Be&&Re(t),t=t||Be,n=n||[],!e||"string"!=typeof e)return n;if(1!==(c=t.nodeType)&&9!==c)return[];if(Oe&&!r){if(o=ht.exec(e))if(u=o[1]){if(9===c){if(!(i=t.getElementById(u))||!i.parentNode)return n;if(i.id===u)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(u))&&Le(t,i)&&i.id===u)return n.push(i),n}else{if(o[2])return Je.apply(n,t.getElementsByTagName(e)),n;if((u=o[3])&&Ce.getElementsByClassName)return Je.apply(n,t.getElementsByClassName(u)),n}if(Ce.qsa&&(!Pe||!Pe.test(e))){if(m=d=Me,h=t,p=9===c&&e,1===c&&"object"!==t.nodeName.toLowerCase()){for(f=Se(e),(d=t.getAttribute("id"))?m=d.replace(gt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",l=f.length;l--;)f[l]=m+s(f[l]);h=pt.test(e)&&a(t.parentNode)||t,p=f.join(",")}if(p)try{return Je.apply(n,h.querySelectorAll(p)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return ke(e.replace(ot,"$1"),t,n,r)};Ce=bt.support={},Ne=bt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Re=bt.setDocument=function(e){var t,r=e?e.ownerDocument||e:Fe,o=r.defaultView;return r!==Be&&9===r.nodeType&&r.documentElement?(Be=r,De=r.documentElement,Oe=!Ne(r),o&&o!==function(e){try{return e.top}catch(t){}return null}(o)&&(o.addEventListener?o.addEventListener("unload",function(){Re()},!1):o.attachEvent&&o.attachEvent("onunload",function(){Re()})),Ce.attributes=!0,Ce.getElementsByTagName=!0,Ce.getElementsByClassName=mt.test(r.getElementsByClassName),Ce.getById=!0,xe.find.ID=function(e,t){if(typeof t.getElementById!==$e&&Oe){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},xe.filter.ID=function(e){var t=e.replace(vt,yt);return function(e){return e.getAttribute("id")===t}},xe.find.TAG=Ce.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==$e)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},xe.find.CLASS=Ce.getElementsByClassName&&function(e,t){if(Oe)return t.getElementsByClassName(e)},Ie=[],Pe=[],Ce.disconnectedMatch=!0,Pe=Pe.length&&new RegExp(Pe.join("|")),Ie=Ie.length&&new RegExp(Ie.join("|")),t=mt.test(De.compareDocumentPosition),Le=t||mt.test(De.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},je=t?function(e,t){if(e===t)return _e=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!Ce.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===Fe&&Le(Fe,e)?-1:t===r||t.ownerDocument===Fe&&Le(Fe,t)?1:Ae?Ze.call(Ae,e)-Ze.call(Ae,t):0:4&n?-1:1)}:function(e,t){if(e===t)return _e=!0,0;var o,i=0,a=e.parentNode,u=t.parentNode,s=[e],c=[t];if(!a||!u)return e===r?-1:t===r?1:a?-1:u?1:Ae?Ze.call(Ae,e)-Ze.call(Ae,t):0;if(a===u)return n(e,t);for(o=e;o=o.parentNode;)s.unshift(o);for(o=t;o=o.parentNode;)c.unshift(o);for(;s[i]===c[i];)i++;return i?n(s[i],c[i]):s[i]===Fe?-1:c[i]===Fe?1:0},r):Be},bt.matches=function(e,t){return bt(e,null,null,t)},bt.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Be&&Re(e),t=t.replace(ut,"='$1']"),Ce.matchesSelector&&Oe&&(!Ie||!Ie.test(t))&&(!Pe||!Pe.test(t)))try{var n=(void 0).call(e,t);if(n||Ce.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(Gb){}return bt(t,Be,null,[e]).length>0},bt.contains=function(e,t){return(e.ownerDocument||e)!==Be&&Re(e),Le(e,t)},bt.attr=function(e,t){(e.ownerDocument||e)!==Be&&Re(e);var n=xe.attrHandle[t.toLowerCase()],r=n&&Ke.call(xe.attrHandle,t.toLowerCase())?n(e,t,!Oe):undefined;return r!==undefined?r:Ce.attributes||!Oe?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},bt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},bt.uniqueSort=function(e){var t,n=[],r=0,o=0;if(_e=!Ce.detectDuplicates,Ae=!Ce.sortStable&&e.slice(0),e.sort(je),_e){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return Ae=null,e},we=bt.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+=we(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=we(t);return n},(xe=bt.selectors={cacheLength:50,createPseudo:t,match:lt,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(vt,yt),e[3]=(e[3]||e[4]||e[5]||"").replace(vt,yt),"~="===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]||bt.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]&&bt.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return lt.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&st.test(n)&&(t=Se(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(vt,yt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Ve[e+" "];return t||(t=new RegExp("(^|"+et+")"+e+"("+et+"|$)"))&&Ve(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==$e&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var o=bt.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,p=i!==a?"nextSibling":"previousSibling",g=t.parentNode,v=u&&t.nodeName.toLowerCase(),y=!s&&!u;if(g){if(i){for(;p;){for(f=t;f=f[p];)if(u?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;h=p="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(m=(c=(l=g[Me]||(g[Me]={}))[e]||[])[0]===ze&&c[1],d=c[0]===ze&&c[2],f=m&&g.childNodes[m];f=++m&&f&&f[p]||(d=m=0)||h.pop();)if(1===f.nodeType&&++d&&f===t){l[e]=[ze,m,d];break}}else if(y&&(c=(t[Me]||(t[Me]={}))[e])&&c[0]===ze)d=c[1];else for(;(f=++m&&f&&f[p]||(d=m=0)||h.pop())&&((u?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(y&&((f[Me]||(f[Me]={}))[e]=[ze,d]),f!==t)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(e,n){var r,o=xe.pseudos[e]||xe.setFilters[e.toLowerCase()]||bt.error("unsupported pseudo: "+e);return o[Me]?o(n):o.length>1?(r=[e,e,"",n],xe.setFilters.hasOwnProperty(e.toLowerCase())?t(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)e[r=Ze.call(e,i[a])]=!(t[r]=i[a])}):function(e){return o(e,0,r)}):o}},pseudos:{not:t(function(e){var n=[],r=[],o=Ee(e.replace(ot,"$1"));return o[Me]?t(function(e,t,n,r){for(var i,a=o(e,null,r,[]),u=e.length;u--;)(i=a[u])&&(e[u]=!(t[u]=i))}):function(e,t,i){return n[0]=e,o(n,null,i,r),!r.pop()}}),has:t(function(e){return function(t){return bt(e,t).length>0}}),contains:t(function(e){return e=e.replace(vt,yt),function(t){return(t.textContent||t.innerText||we(t)).indexOf(e)>-1}}),lang:t(function(e){return ct.test(e||"")||bt.error("unsupported lang: "+e),e=e.replace(vt,yt).toLowerCase(),function(t){var n;do{if(n=Oe?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=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===De},focus:function(e){return e===Be.activeElement&&(!Be.hasFocus||Be.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!xe.pseudos.empty(e)},header:function(e){return dt.test(e.nodeName)},input:function(e){return ft.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:i(function(){return[0]}),last:i(function(e,t){return[t-1]}),eq:i(function(e,t,n){return[n<0?n+t:n]}),even:i(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:i(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:i(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:i(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=xe.pseudos.eq;for(be in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})xe.pseudos[be]=r(be);for(be in{submit:!0,reset:!0})xe.pseudos[be]=o(be);u.prototype=xe.filters=xe.pseudos,xe.setFilters=new u,Se=bt.tokenize=function(e,t){var n,r,o,i,a,u,s,c=He[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=xe.preFilter;a;){n&&!(r=it.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=at.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(ot," ")}),a=a.slice(n.length));for(i in xe.filter)!(r=lt[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?bt.error(e):He(e,u).slice(0)},Ee=bt.compile=function(e,n){var r,o=[],i=[],a=qe[e+" "];if(!a){for(n||(n=Se(e)),r=n.length;r--;)(a=m(n[r]))[Me]?o.push(a):i.push(a);(a=qe(e,function(e,n){var r=n.length>0,o=e.length>0,i=function(t,i,a,u,s){var c,l,d,m=0,h="0",p=t&&[],g=[],v=Te,y=t||o&&xe.find.TAG("*",s),b=ze+=null==v?1:Math.random()||.1,C=y.length;for(s&&(Te=i!==Be&&i);h!==C&&null!=(c=y[h]);h++){if(o&&c){for(l=0;d=e[l++];)if(d(c,i,a)){u.push(c);break}s&&(ze=b)}r&&((c=!d&&c)&&m--,t&&p.push(c))}if(m+=h,r&&h!==m){for(l=0;d=n[l++];)d(p,g,i,a);if(t){if(m>0)for(;h--;)p[h]||g[h]||(g[h]=Ye.call(u));g=f(g)}Je.apply(u,g),s&&!t&&g.length>0&&m+n.length>1&&bt.uniqueSort(u)}return s&&(ze=b,Te=v),p};return r?t(i):i}(i,o))).selector=e}return a},ke=bt.select=function(e,t,n,r){var o,i,u,c,l,f="function"==typeof e&&e,d=!r&&Se(e=f.selector||e);if(n=n||[],1===d.length){if((i=d[0]=d[0].slice(0)).length>2&&"ID"===(u=i[0]).type&&Ce.getById&&9===t.nodeType&&Oe&&xe.relative[i[1].type]){if(!(t=(xe.find.ID(u.matches[0].replace(vt,yt),t)||[])[0]))return n;f&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=lt.needsContext.test(e)?0:i.length;o--&&(u=i[o],!xe.relative[c=u.type]);)if((l=xe.find[c])&&(r=l(u.matches[0].replace(vt,yt),pt.test(i[0].type)&&a(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&s(i)))return Je.apply(n,r),n;break}}return(f||Ee(e,d))(r,t,!Oe,n,pt.test(e)&&a(t.parentNode)||t),n},Ce.sortStable=Me.split("").sort(je).join("")===Me,Ce.detectDuplicates=!!_e,Re(),Ce.sortDetached=!0;var Ct=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},xt=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,e.length!==undefined){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},wt=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},Nt={isArray:Ct,toArray:function(e){var t,n,r=e;if(!Ct(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:xt,map:function(e,t){var n=[];return xt(e,function(r,o){n.push(t(r,o,e))}),n},filter:function(e,t){var n=[];return xt(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:wt,find:function(e,t,n){var r=wt(e,t,n);return-1!==r?e[r]:undefined},last:function(e){return e[e.length-1]}},St=/^\s*|\s*$/g,Et=function(e){return null===e||e===undefined?"":(""+e).replace(St,"")},kt=function(e,t){return t?!("array"!==t||!Nt.isArray(e))||typeof e===t:e!==undefined},Tt=function(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),Nt.each(e,function(e,o){if(!1===t.call(r,e,o,n))return!1;Tt(e,t,n,r)}))},At={trim:Et,isArray:Nt.isArray,is:kt,toArray:Nt.toArray,makeMap:function(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:Nt.each,map:Nt.map,grep:Nt.filter,inArray:Nt.indexOf,hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o,i,a,u,s=arguments;for(o=1,i=s.length;o<i;o++){t=s[o];for(a in t)t.hasOwnProperty(a)&&(u=t[a])!==undefined&&(e[a]=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:Tt,createNS:function(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||kt(e,"array")?e:Nt.map(e.split(t||","),Et)},_addCacheSuffix:function(e){var t=oe.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},_t=document,Rt=Array.prototype.push,Bt=Array.prototype.slice,Dt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Ot=ye.Event,Pt=At.makeMap("children,contents,next,prev"),It=function(e){return void 0!==e},Lt=function(e){return"string"==typeof e},Mt=function(e,t){var n,r,o;for(o=(t=t||_t).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},Ft=function(e,t,n,r){var o;if(Lt(t))t=Mt(t,Qt(e[0]));else if(t.length&&!t.nodeType){if(t=Kt.makeArray(t),r)for(o=t.length-1;o>=0;o--)Ft(e,t[o],n,r);else for(o=0;o<t.length;o++)Ft(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},zt=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},Ut=function(e,t,n){var r,o;return t=Kt(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},Vt=At.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Ht=At.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),qt={"for":"htmlFor","class":"className",readonly:"readOnly"},jt={"float":"cssFloat"},$t={},Wt={},Kt=function(e,t){return new Kt.fn.init(e,t)},Xt=/^\s*|\s*$/g,Yt=function(e){return null===e||e===undefined?"":(""+e).replace(Xt,"")},Gt=function(e,t){var n,r,o,i;if(e)if((n=e.length)===undefined){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},Jt=function(e,t){var n=[];return Gt(e,function(e,r){t(r,e)&&n.push(r)}),n},Qt=function(e){return e?9===e.nodeType?e:e.ownerDocument:_t};Kt.fn=Kt.prototype={constructor:Kt,selector:"",context:null,length:0,init:function(e,t){var n,r;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 Kt(e).attr(t);this.context=t=document}if(Lt(e)){if(this.selector=e,!(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Dt.exec(e)))return Kt(t).find(e);if(n[1])for(r=Mt(e,Qt(t)).firstChild;r;)Rt.call(this,r),r=r.nextSibling;else{if(!(r=Qt(t).getElementById(n[2])))return this;if(r.id!==n[2])return this.find(e);this.length=1,this[0]=r}}else this.add(e,!1);return this},toArray:function(){return At.toArray(this)},add:function(e,t){var n,r;if(Lt(e))return this.add(Kt(e));if(!1!==t)for(n=Kt.unique(this.toArray().concat(Kt.makeArray(e))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else Rt.apply(this,Kt.makeArray(e));return this},attr:function(e,t){var n,r=this;if("object"==typeof e)Gt(e,function(e,t){r.attr(e,t)});else{if(!It(t)){if(r[0]&&1===r[0].nodeType){if((n=$t[e])&&n.get)return n.get(r[0],e);if(Ht[e])return r.prop(e)?e:undefined;null===(t=r[0].getAttribute(e,2))&&(t=undefined)}return t}this.each(function(){var n;if(1===this.nodeType){if((n=$t[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=qt[e]||e))Gt(e,function(e,t){n.prop(e,t)});else{if(!It(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)Gt(e,function(e,t){o.css(e,t)});else if(It(t))e=i(e),"number"!=typeof t||Vt[e]||(t=t.toString()+"px"),o.each(function(){var n=this.style;if((r=Wt[e])&&r.set)r.set(this,t);else{try{this.style[jt[e]||e]=t}catch(o){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(a(e)):n.removeAttribute(e))}});else{if(n=o[0],(r=Wt[e])&&r.get)return r.get(n);if(n.ownerDocument.defaultView)try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(a(e))}catch(u){return undefined}else if(n.currentStyle)return n.currentStyle[i(e)]}return o},remove:function(){for(var e,t=this.length;t--;)e=this[t],Ot.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(It(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e}catch(r){Kt(n[t]).empty().append(e)}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t;if(It(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 Ft(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return Ft(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?Ft(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?Ft(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return Kt(e).append(this),this},prependTo:function(e){return Kt(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return Ut(this,e)},wrapAll:function(e){return Ut(this,e,!0)},wrapInner:function(e){return this.each(function(){Kt(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){Kt(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),Kt(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(" ")?Gt(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(n,r){var o,i;(i=zt(r,e))!==t&&(o=r.className,i?r.className=Yt((" "+o+" ").replace(" "+e+" "," ")):r.className+=o?" "+e:e)}),n)},hasClass:function(e){return zt(this[0],e)},each:function(e){return Gt(this,e)},on:function(e,t){return this.each(function(){Ot.bind(this,e,t)})},off:function(e,t){return this.each(function(){Ot.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?Ot.fire(this,e.type,e):Ot.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new Kt(Bt.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++)Kt.find(e,this[t],r);return Kt(r)},filter:function(e){return Kt("function"==typeof e?Jt(this.toArray(),function(t,n){return e(n,t)}):Kt.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof Kt&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&Kt(r).is(e)){t.push(r);break}if(r===e){t.push(r);break}r=r.parentNode}}),Kt(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:Rt,sort:[].sort,splice:[].splice},At.extend(Kt,{extend:At.extend,makeArray:function(e){return function(e){return e&&e===e.window}(e)||e.nodeType?[e]:At.toArray(e)},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:At.isArray,each:Gt,trim:Yt,grep:Jt,find:bt,expr:bt.selectors,unique:bt.uniqueSort,text:bt.getText,contains:bt.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?Kt.find.matchesSelector(t[0],e)?[t[0]]:[]:Kt.find.matches(e,t)}});var Zt=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof Kt&&(n=n[0]);o&&9!==o.nodeType;){if(n!==undefined){if(o===n)break;if("string"==typeof n&&Kt(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},en=function(e,t,n,r){var o=[];for(r instanceof Kt&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(r!==undefined){if(e===r)break;if("string"==typeof r&&Kt(e).is(r))break}o.push(e)}return o},tn=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};Gt({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Zt(e,"parentNode")},next:function(e){return tn(e,"nextSibling",1)},prev:function(e){return tn(e,"previousSibling",1)},children:function(e){return en(e.firstChild,"nextSibling",1)},contents:function(e){return At.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){Kt.fn[e]=function(n){var r=[];return this.each(function(){var e=t.call(r,this,n,r);e&&(Kt.isArray(e)?r.push.apply(r,e):r.push(e))}),this.length>1&&(Pt[e]||(r=Kt.unique(r)),0===e.indexOf("parents")&&(r=r.reverse())),r=Kt(r),n?r.filter(n):r}}),Gt({parentsUntil:function(e,t){return Zt(e,"parentNode",t)},nextUntil:function(e,t){return en(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return en(e,"previousSibling",1,t).slice(1)}},function(e,t){Kt.fn[e]=function(n,r){var o=[];return this.each(function(){var e=t.call(o,this,n,o);e&&(Kt.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=Kt.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse())),o=Kt(o),r?o.filter(r):o}}),Kt.fn.is=function(e){return!!e&&this.filter(e).length>0},Kt.fn.init.prototype=Kt.fn,Kt.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 Kt.extend(n,this),n};var nn=function(e,t,n){Gt(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})};oe.ie&&oe.ie<8&&(nn($t,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?undefined:t},size:function(e){var t=e.size;return 20===t?undefined:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?undefined:t}}),nn($t,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),oe.ie&&oe.ie<9&&(jt["float"]="styleFloat",nn(Wt,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),Kt.attrHooks=$t,Kt.cssHooks=Wt;var rn,on,an,un=function(e){var t,n=!1;return function(){return n||(n=!0,t=e.apply(null,arguments)),t}},sn=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return ln(r(1),r(2))},cn=function(){return ln(0,0)},ln=function(e,t){return{major:e,minor:t}},fn={nu:ln,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?cn():sn(e,n)},unknown:cn},dn=function(e,t){return function(){return t===e}},mn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:dn("Edge",t),isChrome:dn("Chrome",t),isIE:dn("IE",t),isOpera:dn("Opera",t),isFirefox:dn("Firefox",t),isSafari:dn("Safari",t)}},hn={unknown:function(){return mn({current:undefined,version:fn.unknown()})},nu:mn,edge:T.constant("Edge"),chrome:T.constant("Chrome"),ie:T.constant("IE"),opera:T.constant("Opera"),firefox:T.constant("Firefox"),safari:T.constant("Safari")},pn=function(e,t){return function(){return t===e}},gn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:pn("Windows",t),isiOS:pn("iOS",t),isAndroid:pn("Android",t),isOSX:pn("OSX",t),isLinux:pn("Linux",t),isSolaris:pn("Solaris",t),isFreeBSD:pn("FreeBSD",t)}},vn={unknown:function(){return gn({current:undefined,version:fn.unknown()})},nu:gn,windows:T.constant("Windows"),ios:T.constant("iOS"),android:T.constant("Android"),linux:T.constant("Linux"),osx:T.constant("OSX"),solaris:T.constant("Solaris"),freebsd:T.constant("FreeBSD")},yn=function(e,t){var n=String(t).toLowerCase();return W.find(e,function(e){return e.search(n)})},bn=function(e,t){return yn(e,t).map(function(e){var n=fn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Cn=function(e,t){return yn(e,t).map(function(e){var n=fn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},xn=function(e,t){return-1!==e.indexOf(t)},wn=function(e){return e.replace(/^\s+|\s+$/g,"")},Nn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Sn=function(e){return function(t){return xn(t,e)}},En=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return xn(e,"edge/")&&xn(e,"chrome")&&xn(e,"safari")&&xn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Nn],search:function(e){return xn(e,"chrome")&&!xn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return xn(e,"msie")||xn(e,"trident")}},{name:"Opera",versionRegexes:[Nn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Sn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Sn("firefox")},{name:"Safari",versionRegexes:[Nn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(xn(e,"safari")||xn(e,"mobile/"))&&xn(e,"applewebkit")}}],kn=[{name:"Windows",search:Sn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return xn(e,"iphone")||xn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Sn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Sn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Sn("linux"),versionRegexes:[]},{name:"Solaris",search:Sn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Sn("freebsd"),versionRegexes:[]}],Tn={browsers:T.constant(En),oses:T.constant(kn)},An=function(e){var t=Tn.browsers(),n=Tn.oses(),r=bn(t,e).fold(hn.unknown,hn.nu),o=Cn(n,e).fold(vn.unknown,vn.nu);return{browser:r,os:o,deviceType: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:T.constant(r),isiPhone:T.constant(o),isTablet:T.constant(u),isPhone:T.constant(c),isTouch:T.constant(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:T.constant(l)}}(o,r,e)}},_n={detect:un(function(){var e=navigator.userAgent;return An(e)})},Rn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:T.constant(e)}},Bn={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return Rn(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return Rn(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return Rn(n)},fromDom:Rn,fromPoint:function(e,t,n){return O.from(e.dom().elementFromPoint(t,n)).map(Rn)}},Dn=8,On=9,Pn=1,In=3,Ln=function(e){return e.dom().nodeName.toLowerCase()},Mn=function(e){return e.dom().nodeType},Fn=function(e){return function(t){return Mn(t)===e}},zn=Fn(Pn),Un=Fn(In),Vn=Fn(On),Hn={name:Ln,type:Mn,value:function(e){return e.dom().nodeValue},isElement:zn,isText:Un,isDocument:Vn,isComment:function(e){return Mn(e)===Dn||"#comment"===Ln(e)}},qn=function(e){return function(t){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(t)===e}},jn={isString:qn("string"),isObject:qn("object"),isArray:qn("array"),isNull:qn("null"),isBoolean:qn("boolean"),isUndefined:qn("undefined"),isFunction:qn("function"),isNumber:qn("number")},$n=function(){var e=Object.keys;return e===undefined?function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}:e}(),Wn=function(e,t){for(var n=$n(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},Kn=function(e,t){var n={};return Wn(e,function(r,o){var i=t(r,o,e);n[i.k]=i.v}),n},Xn=function(e,t){var n=[];return Wn(e,function(e,r){n.push(t(e,r))}),n},Yn=function(e){return Xn(e,function(e){return e})},Gn={bifilter:function(e,t){var n={},r={};return Wn(e,function(e,o){(t(e,o)?n:r)[o]=e}),{t:n,f:r}},each:Wn,map:function(e,t){return Kn(e,function(e,n,r){return{k:n,v:t(e,n,r)}})},mapToArray:Xn,tupleMap:Kn,find:function(e,t){for(var n=$n(e),r=0,o=n.length;r<o;r++){var i=n[r],a=e[i];if(t(a,i,e))return O.some(a)}return O.none()},keys:$n,values:Yn,size:function(e){return Yn(e).length}},Jn=function(e,t,n){if(!(jn.isString(n)||jn.isBoolean(n)||jn.isNumber(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},Qn=function(e,t,n){Jn(e.dom(),t,n)},Zn=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},er=Qn,tr=function(e,t){var n=e.dom();Gn.each(t,function(e,t){Jn(n,t,e)})},nr=Zn,rr=function(e,t){e.dom().removeAttribute(t)},or=un(function(){return ir(Bn.fromDom(document))}),ir=function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return Bn.fromDom(t)},ar={body:or,getBody:ir,inBody:function(e){var t=Hn.isText(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}},ur=function(e){return e.style!==undefined},sr=function(e,t,n){if(!jn.isString(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);ur(e)&&e.style.setProperty(t,n)},cr=function(e,t){return ur(e)?e.style.getPropertyValue(t):""},lr=function(e,t){var n=e.dom();Gn.each(t,function(e,t){sr(n,t,e)})},fr=function(e,t){var n=e.dom(),r=window.getComputedStyle(n).getPropertyValue(t),o=""!==r||ar.inBody(e)?r:cr(n,t);return null===o?undefined:o},dr=function(){var e=arguments;return function(){for(var t=new Array(arguments.length),n=0;n<t.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 W.each(e,function(e,n){r[e]=T.constant(t[n])}),r}},mr=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},hr=function(){return G("Node")},pr=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},gr=function(e,t){return pr(e,t,hr().DOCUMENT_POSITION_CONTAINED_BY)},vr=Pn,yr=On,br=function(e){return e.nodeType!==vr&&e.nodeType!==yr||0===e.childElementCount},Cr=function(e,t){var n=t===undefined?document:t.dom();return br(n)?[]:W.map(n.querySelectorAll(e),Bn.fromDom)},xr=function(e,t){var n=e.dom();if(n.nodeType!==vr)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},wr=function(e,t){var n=t===undefined?document:t.dom();return br(n)?O.none():O.from(n.querySelector(e)).map(Bn.fromDom)},Nr=function(e,t){return e.dom()===t.dom()},Sr=_n.detect().browser.isIE()?function(e,t){return gr(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Er={eq:Nr,isEqualNode:function(e,t){return e.dom().isEqualNode(t.dom())},member:function(e,t){return W.exists(t,T.curry(Nr,e))},contains:Sr,is:xr},kr=function(e){return Bn.fromDom(e.dom().ownerDocument)},Tr=function(e){var t=e.dom();return O.from(t.parentNode).map(Bn.fromDom)},Ar=function(e){var t=e.dom();return O.from(t.previousSibling).map(Bn.fromDom)},_r=function(e){var t=e.dom();return O.from(t.nextSibling).map(Bn.fromDom)},Rr=function(e){var t=e.dom();return W.map(t.childNodes,Bn.fromDom)},Br=function(e,t){var n=e.dom().childNodes;return O.from(n[t]).map(Bn.fromDom)},Dr=dr("element","offset"),Or={owner:kr,defaultView:function(e){var t=e.dom().ownerDocument.defaultView;return Bn.fromDom(t)},documentElement:function(e){var t=kr(e);return Bn.fromDom(t.dom().documentElement)},parent:Tr,findIndex:function(e){return Tr(e).bind(function(t){var n=Rr(t);return W.findIndex(n,function(t){return Er.eq(e,t)})})},parents:function(e,t){for(var n=jn.isFunction(t)?t:T.constant(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=Bn.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o},siblings:function(e){return Tr(e).map(Rr).map(function(t){return W.filter(t,function(t){return!Er.eq(e,t)})}).getOr([])},prevSibling:Ar,offsetParent:function(e){var t=e.dom();return O.from(t.offsetParent).map(Bn.fromDom)},prevSiblings:function(e){return W.reverse(mr(e,Ar))},nextSibling:_r,nextSiblings:function(e){return mr(e,_r)},children:Rr,child:Br,firstChild:function(e){return Br(e,0)},lastChild:function(e){return Br(e,e.dom().childNodes.length-1)},childNodesCount:function(e){return e.dom().childNodes.length},hasChildNodes:function(e){return e.dom().hasChildNodes()},leaf:function(e,t){var n=Rr(e);return n.length>0&&t<n.length?Dr(n[t],0):Dr(e,t)}},Pr=_n.detect().browser,Ir=function(e){return W.find(e,Hn.isElement)},Lr=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"===fr(Bn.fromDom(e),"position"))return o=t.getBoundingClientRect(),i=o.left+(u.documentElement.scrollLeft||e.scrollLeft)-u.documentElement.clientLeft,a=o.top+(u.documentElement.scrollTop||e.scrollTop)-u.documentElement.clientTop,{x:i,y:a};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 Pr.isFirefox()&&"table"===Hn.name(e)?Ir(Or.children(e)).filter(function(e){return"caption"===Hn.name(e)}).bind(function(e){return Ir(Or.nextSiblings(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}(Bn.fromDom(t))}return{x:i,y:a}},Mr=function(e){var t=O.none(),n=[],r=function(e){o()?a(e):n.push(e)},o=function(){return t.isSome()},i=function(e){W.each(e,a)},a=function(e){t.each(function(t){setTimeout(function(){e(t)},0)})};return e(function(e){t=O.some(e),i(n),n=[]}),{get:r,map:function(e){return Mr(function(t){r(function(n){t(e(n))})})},isReady:o}},Fr={nu:Mr,pure:function(e){return Mr(function(t){t(e)})}},zr=function(e){return function(){var t=Array.prototype.slice.call(arguments),n=this;setTimeout(function(){e.apply(n,t)},0)}},Ur=function(e){var t=function(t){e(zr(t))};return{map:function(e){return Ur(function(n){t(function(t){var r=e(t);n(r)})})},bind:function(e){return Ur(function(n){t(function(t){e(t).get(n)})})},anonBind:function(e){return Ur(function(n){t(function(t){e.get(n)})})},toLazy:function(){return Fr.nu(t)},get:t}},Vr={nu:Ur,pure:function(e){return Ur(function(t){t(e)})}},Hr=function(e,t){return t(function(t){var n=[],r=0;0===e.length?t([]):W.each(e,function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=e.length&&t(n)}}(i))})})},qr=function(e){return Hr(e,Vr.nu)},jr=qr,$r=function(e){return{is:function(t){return e===t},isValue:T.constant(!0),isError:T.constant(!1),getOr:T.constant(e),getOrThunk:T.constant(e),getOrDie:T.constant(e),or:function(t){return $r(e)},orThunk:function(t){return $r(e)},fold:function(t,n){return n(e)},map:function(t){return $r(t(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 O.some(e)}}},Wr=function(e){return{is:T.constant(!1),isValue:T.constant(!1),isError:T.constant(!0),getOr:T.identity,getOrThunk:function(e){return e()},getOrDie:function(){return T.die(e)()},or:function(e){return e},orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return Wr(e)},each:T.noop,bind:function(t){return Wr(e)},exists:T.constant(!1),forall:T.constant(!0),toOption:O.none}},Kr={value:$r,error:Wr},Xr=function(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)}},Yr=function(e){var t;return function(n){return(t=t||W.mapToObject(e,T.constant(!0))).hasOwnProperty(Hn.name(n))}},Gr=Yr(["h1","h2","h3","h4","h5","h6"]),Jr=Yr(["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"]),Qr={isBlock:Jr,isInline:function(e){return Hn.isElement(e)&&!Jr(e)},isHeading:Gr,isTextBlock:Yr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),isList:Yr(["ul","ol","dl"]),isListItem:Yr(["li","dd","dt"]),isVoid:Yr(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),isTableSection:Yr(["thead","tbody","tfoot"]),isTableCell:Yr(["td","th"]),isBr:function(e){return Hn.isElement(e)&&"br"===Hn.name(e)}},Zr=function(e){return function(t){return!!t&&t.nodeType===e}},eo=Zr(1),to=function(e){return e=e.toLowerCase().split(" "),function(t){var n,r;if(t&&t.nodeType)for(r=t.nodeName.toLowerCase(),n=0;n<e.length;n++)if(r===e[n])return!0;return!1}},no=function(e){return function(t){if(eo(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}},ro={isText:Zr(3),isElement:eo,isComment:Zr(8),isDocument:Zr(9),isBr:to("br"),isContentEditableTrue:no("true"),isContentEditableFalse:no("false"),matchNodeNames:to,hasPropValue:function(e,t){return function(n){return eo(n)&&n[e]===t}},hasAttribute:function(e,t){return function(t){return eo(t)&&t.hasAttribute(e)}},hasAttributeValue:function(e,t){return function(n){return eo(n)&&n.getAttribute(e)===t}},matchStyleValues:function(e,t){return t=t.toLowerCase().split(" "),function(n){var r;if(eo(n))for(r=0;r<t.length;r++)if(n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(e)===t[r])return!0;return!1}},isBogus:function(e){return eo(e)&&e.hasAttribute("data-mce-bogus")}},oo=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},io=function(e,t){var n,r=t.childNodes;if(!ro.isElement(t)||!oo(t)){for(n=r.length-1;n>=0;n--)io(e,r[n]);if(!1===ro.isDocument(t)){if(ro.isText(t)&&t.nodeValue.length>0){var o=At.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||Qr.isVoid(Bn.fromDom(t))))return;e.remove(t)}return t}},ao={trimNode:io},uo=At.makeMap,so=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,co=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,lo=/[<>&\"\']/g,fo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,mo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};on={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},an={"<":"<",">":">","&":"&",""":'"',"'":"'"};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)),on[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};rn=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 po={encodeRaw:function(e,t){return e.replace(t?so:co,function(e){return on[e]||e})},encodeAllRaw:function(e){return(""+e).replace(lo,function(e){return on[e]||e})},encodeNumeric:function(e,t){return e.replace(t?so:co,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":on[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||rn,e.replace(t?so:co,function(e){return on[e]||n[e]||e})},getEncodeFunc:function(e,t){t=ho(t)||rn;return(e=uo(e.replace(/\+/g,","))).named&&e.numeric?function(e,n){return e.replace(n?so:co,function(e){return on[e]!==undefined?on[e]:t[e]!==undefined?t[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:e.named?t?function(e,n){return po.encodeNamed(e,n,t)}:po.encodeNamed:e.numeric?po.encodeNumeric:po.encodeRaw},decode:function(e){return e.replace(fo,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))):mo[t]||String.fromCharCode(t):an[e]||rn[e]||function(e){var t;return t=Bn.fromTag("div").dom(),t.innerHTML=e,t.textContent||t.innerText||e}(e)})}},go={},vo={},yo=At.makeMap,bo=At.each,Co=At.extend,xo=At.explode,wo=At.inArray,No=function(e,t){return(e=At.trim(e))?e.split(t||" "):[]},So=function(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),bo(e,function(e,r){n[r]=n[r.toUpperCase()]="map"===t?yo(e,/[, ]/):xo(e,/[, ]/)})),n},Eo=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,h={},p={},g={},v=[],y={},b={},C=function(t,n,r){var o=e[t];return o?o=yo(o,/[, ]/,yo(o.toUpperCase(),/[, ]/)):(o=go[t])||(o=yo(n," ",yo(n.toUpperCase()," ")),o=Co(o,r),go[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(r=r||[],n=n||"","string"==typeof r&&(r=No(r)),o=(e=No(e)).length;o--;)a={attributes:s(i=No([t,n].join(" "))),attributesOrder:i,children:s(r,vo)},u[e[o]]=a},c=function(e,t){var n,r,o,i;for(n=(e=No(e)).length,t=No(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 go[e]?go[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 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(" "),bo(No(a),function(e){s(e,"",r)}),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),bo(No(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 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")),bo(No("a form meter progress dfn"),function(e){u[e]&&delete u[e].children[e]}),delete u.caption.children.table,delete u.script,go[e]=u,u)}((e=e||{}).schema),!1===e.verify_html&&(e.valid_elements="*[*]"),t=So(e.valid_styles),n=So(e.invalid_styles,"map"),s=So(e.valid_classes,"map"),o=C("whitespace_elements","pre script noscript style textarea video audio iframe object code"),i=C("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=C("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),u=C("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),l=C("non_empty_elements","td th iframe video audio object script pre code",a),f=C("move_caret_before_on_enter_elements","table",l),d=C("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),c=C("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",d),m=C("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),bo((e.special||"script noscript noframes noembed title style textarea xmp").split(" "),function(e){b[e]=new RegExp("</"+e+"[^>]*>","gi")});var x=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},w=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,h,g,y,b,C,w,N=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,E=/[*?+]/;if(e)for(e=No(e,","),p["@"]&&(y=p["@"].attributes,b=p["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=N.exec(e[t])){if(h=i[1],c=i[2],g=i[3],s=i[5],d={},m=[],a={attributes:d,attributesOrder:m},"#"===h&&(a.paddEmpty=!0),"-"===h&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),y){for(C in y)d[C]=y[C];m.push.apply(m,b)}if(s)for(r=0,o=(s=No(s,"|")).length;r<o;r++)if(i=S.exec(s[r])){if(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),h=i[3],w=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"===f){delete d[l],m.splice(wo(m,l),1);continue}h&&("="===h&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:w}),u.defaultValue=w),":"===h&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:w}),u.forcedValue=w),"<"===h&&(u.validValues=yo(w,"?"))),E.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=x(l),a.attributePatterns.push(u)):(d[l]||m.push(l),d[l]=u)}y||"@"!==c||(y=d,b=m),g&&(a.outputName=c,p[g]=a),E.test(c)?(a.pattern=x(c),v.push(a)):p[c]=a}},N=function(e){p={},v=[],w(e),bo(r,function(e,t){g[t]=e.children})},S=function(e){var t=/^(~)?(.+)$/;e&&(go.text_block_elements=go.block_elements=null,bo(No(e,","),function(e){var n=t.exec(e),r="~"===n[1],o=r?"span":"div",i=n[2];if(g[i]=g[o],y[i]=o,r||(c[i.toUpperCase()]={},c[i]={}),!p[i]){var a=p[o];delete(a=Co({},a)).removeEmptyAttrs,delete a.removeEmpty,p[i]=a}bo(g,function(e,t){e[o]&&(g[t]=e=Co({},g[t]),e[i]=e[o])})}))},E=function(t){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;go[e.schema]=null,t&&bo(No(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]],bo(No(o[3],"|"),function(e){"-"===r?delete t[e]:t[e]={}}))})},k=function(e){var t,n=p[e];if(n)return n;for(t=v.length;t--;)if((n=v[t]).pattern.test(e))return n};return e.valid_elements?N(e.valid_elements):(bo(r,function(e,t){p[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},g[t]=e.children}),"html5"!==e.schema&&bo(No("strong/b em/i"),function(e){e=No(e,"/"),p[e[1]].outputName=e[0]}),bo(No("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){p[e]&&(p[e].removeEmpty=!0)}),bo(No("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){p[e].paddEmpty=!0}),bo(No("span"),function(e){p[e].removeEmptyAttrs=!0})),S(e.custom_elements),E(e.valid_children),w(e.extended_valid_elements),E("+ol[ul|ol],+ul[ul|ol]"),bo({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){p[t]&&(p[t].parentsRequired=No(e))}),e.invalid_elements&&bo(xo(e.invalid_elements),function(e){p[e]&&delete p[e]}),k("span")||w("span[!data-mce-type|*]"),h.children=g,h.getValidStyles=function(){return t},h.getInvalidStyles=function(){return n},h.getValidClasses=function(){return s},h.getBoolAttrs=function(){return u},h.getBlockElements=function(){return c},h.getTextBlockElements=function(){return d},h.getTextInlineElements=function(){return m},h.getShortEndedElements=function(){return a},h.getSelfClosingElements=function(){return i},h.getNonEmptyElements=function(){return l},h.getMoveCaretBeforeOnEnterElements=function(){return f},h.getWhiteSpaceElements=function(){return o},h.getSpecialElements=function(){return b},h.isValidChild=function(e,t){var n=g[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},h.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},h.getElementRule=k,h.getCustomElements=function(){return y},h.addValidElements=w,h.setValidElements=N,h.addCustomElements=S,h.addValidChildren=E,h.elements=p,h},ko=function(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];var f=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)};return{toHex:function(e){return e.replace(a,f)},parse:function(t){var r,o,i,d,m={},h=e.url_converter,p=e.url_converter_scope||this,g=function(e,t,r){var o,i,a,u;if((o=m[e+"-top"+t])&&(i=m[e+"-right"+t])&&(a=m[e+"-bottom"+t])&&(u=m[e+"-left"+t])){var s=[o,i,a,u];for(n=s.length-1;n--&&s[n]===s[n+1];);n>-1&&r||(m[e+t]=-1===n?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}},v=function(e){var t,n=m[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return m[e]=n[0],!0}},y=function(e){return d=!0,l[e]},b=function(e,t){return d&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return l[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},C=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},x=function(e){return e.replace(/\\[0-9a-f]+/gi,C)},w=function(t,n,r,o,i,a){if(i=i||a)return"'"+(i=b(i)).replace(/\'/g,"\\'")+"'";if(n=b(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 h&&(n=h.call(p,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(t){for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,y).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,y)});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=x(o),i=x(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,f)).replace(u,w),m[o]=d?b(i,!0):i}g("border","",!0),g("border","-width"),g("border","-color"),g("border","-style"),g("padding",""),g("margin",""),function(e,t,n,r){v(t)&&v(n)&&v(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},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}}},To=At.each,Ao=At.is,_o=At.grep,Ro=oe.ie,Bo=/^([a-z0-9],?)+$/i,Do=/^[ \t\r\n]*$/,Oo=function(e,t){var n=t.attr("style");(n=e.serializeStyle(e.parseStyle(n),t[0].nodeName))||(n=null),t.attr("data-mce-style",n)},Po=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},Io=function(e,t){var n,r=this;r.doc=e,r.win=window,r.files={},r.counter=0,r.stdMode=!Ro||e.documentMode>=8,r.boxModel=!Ro||"CSS1Compat"===e.compatMode||r.stdMode,r.styleSheetLoader=function(e,t){var n,r=0,o={};n=(t=t||{}).maxLoadTime||5e3;var i=function(t){e.getElementsByTagName("head")[0].appendChild(t)},a=function(t,a,u){var s,c,l,f,d=function(){for(var e=f.passed,t=e.length;t--;)e[t]();f.status=2,f.passed=[],f.failed=[]},m=function(){for(var e=f.failed,t=e.length;t--;)e[t]();f.status=3,f.passed=[],f.failed=[]},h=function(e,t){e()||((new Date).getTime()-l<n?ce.setTimeout(t):m())},p=function(){h(function(){for(var t,n,r=e.styleSheets,o=r.length;o--;)if(t=r[o],(n=t.ownerNode?t.ownerNode:t.owningElement)&&n.id===s.id)return d(),!0},p)},g=function(){h(function(){try{var e=c.sheet.cssRules;return d(),!!e}catch(t){}},g)};if(t=At._addCacheSuffix(t),o[t]?f=o[t]:(f={passed:[],failed:[]},o[t]=f),a&&f.passed.push(a),u&&f.failed.push(u),1!==f.status)if(2!==f.status)if(3!==f.status){if(f.status=1,s=e.createElement("link"),s.rel="stylesheet",s.type="text/css",s.id="u"+r++,s.async=!1,s.defer=!1,l=(new Date).getTime(),"onload"in s&&!function(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&parseInt(e[1],10)<536)}())s.onload=p,s.onerror=m;else{if(navigator.userAgent.indexOf("Firefox")>0)return c=e.createElement("style"),c.textContent='@import "'+t+'"',g(),void i(c);p()}i(s),s.href=t}else m();else d()},u=function(e){return Vr.nu(function(t){a(e,T.compose(t,T.constant(Kr.value(e))),T.compose(t,T.constant(Kr.error(e))))})},s=function(e){return e.fold(T.identity,T.identity)};return{load:a,loadAll:function(e,t,n){jr(W.map(e,u)).get(function(e){var r=W.partition(e,function(e){return e.isValue()});r.fail.length>0?n(r.fail.map(s)):t(r.pass.map(s))})}}}(e),r.boundEvents=[],r.settings=t=t||{},r.schema=t.schema?t.schema:Eo({}),r.styles=ko({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),r.fixDoc(e),r.events=t.ownEvents?new ye(t.proxy):ye.Event,r.attrHooks=function(e,t){var n,r={},o=t.keep_values;return n={set:function(n,r,o){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||e,r,o,n[0])),n.attr("data-mce-"+o,r).attr(o,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},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.serializeStyle(e.parseStyle(n),t[0].nodeName)}}},o&&(r.href=r.src=n),r}(r,t),n=r.schema.getBlockElements(),r.$=Kt.overrideDefaults(function(){return{context:e,element:r.getRoot()}}),r.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!n[e.nodeName]):!!n[e]}};Io.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){},clone:function(e,t){var n,r,o=this;return!Ro||1!==e.nodeType||t?e.cloneNode(t):(r=o.doc,t?n.firstChild:(n=r.createElement(e.nodeName),To(o.getAttribs(e),function(t){o.setAttrib(n,t.nodeName,o.getAttrib(e,t.nodeName))}),n))},getRoot:function(){return this.settings.root_element||this.doc.body},getViewPort:function(e){var t,n;return e=e||this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t,n;return e=this.get(e),t=this.getPos(e),n=this.getSize(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:function(e){var t,n;return e=this.get(e),t=this.getStyle(e,"width"),n=this.getStyle(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}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,t,n,r){var o,i=this,a=[];for(e=i.get(e),r=r===undefined,n=n||("BODY"!==i.getRoot().nodeName?i.getRoot().parentNode:null),Ao(t,"string")&&(o=t,t="*"===t?function(e){return 1===e.nodeType}:function(e){return i.is(e,o)});e&&e!==n&&e.nodeType&&9!==e.nodeType;){if(!t||t(e)){if(!r)return e;a.push(e)}e=e.parentNode}return r?a:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,(e=this.doc.getElementById(e))&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(e,t){return bt(e,this.get(t)||this.settings.root_element||this.doc,[])},is:function(e,t){var n;if(!e)return!1;if(e.length===undefined){if("*"===t)return 1===e.nodeType;if(Bo.test(t)){for(t=t.toLowerCase().split(/,/),e=e.nodeName.toLowerCase(),n=t.length-1;n>=0;n--)if(t[n]===e)return!0;return!1}}if(e.nodeType&&1!==e.nodeType)return!1;var r=e.nodeType?[e]:e;return bt(t,r[0].ownerDocument||r[0],null,r).length>0},add:function(e,t,n,r,o){var i=this;return this.run(e,function(e){var a;return a=Ao(t,"string")?i.doc.createElement(t):t,i.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):i.setHTML(a,r)),o?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r,o="";o+="<"+e;for(r in t)t.hasOwnProperty(r)&&null!==t[r]&&"undefined"!=typeof t[r]&&(o+=" "+r+'="'+this.encode(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n,r,o=this.doc;for(r=o.createElement("div"),t=o.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t},remove:function(e,t){return e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&Oo(this,e)},getStyle:function(e,t,n){return e=this.$$(e),n?e.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=oe.ie&&oe.ie<12?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[t]:undefined)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&Oo(this,e)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r,o,i=this.settings;""===n&&(n=null),r=(e=this.$$(e)).attr(t),e.length&&((o=this.attrHooks[t])&&o.set?o.set(e,n,t):e.attr(t,n),r!==n&&i.onSetAttrib&&i.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){To(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r,o;return(e=this.$$(e)).length&&(o=(r=this.attrHooks[t])&&r.get?r.get(e,t):e.attr(t)),void 0===o&&(o=n||""),o},getPos:function(e,t){return Lr(this.doc.body,this.get(e),t)},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t,n,r=this.doc;if(this!==Io.DOM&&r===document){var o=Io.DOM.addedStyles;if((o=o||[])[e])return;o[e]=!0,Io.DOM.addedStyles=o}(n=r.getElementById("mceDefaultStyles"))||((n=r.createElement("style")).id="mceDefaultStyles",n.type="text/css",(t=r.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(r.createTextNode(e))},loadCSS:function(e){var t,n=this,r=n.doc;n===Io.DOM||r!==document?(e||(e=""),t=r.getElementsByTagName("head")[0],To(e.split(","),function(e){var o;e=At._addCacheSuffix(e),n.files[e]||(n.files[e]=!0,o=n.create("link",{rel:"stylesheet",href:e}),Ro&&r.documentMode&&r.recalc&&(o.onload=function(){r.recalc&&r.recalc(),o.onload=null}),t.appendChild(o))})):Io.DOM.loadCSS(e)},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,n){this.$$(e).toggleClass(t,n).each(function(){""===this.className&&Kt(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"===this.$$(e).css("display")},uniqueId:function(e){return(e||"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),Ro?e.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(r){Kt("<div></div>").html("<br>"+t).contents().slice(1).appendTo(n)}return t}}):e.html(t)},getOuterHTML:function(e){return 1===(e=this.get(e)).nodeType&&"outerHTML"in e?e.outerHTML:Kt("<div></div>").append(Kt(e).clone()).html()},setOuterHTML:function(e,t){var n=this;n.$$(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}n.remove(Kt(this).html(t),!0)})},decode:po.decode,encode:po.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,(r=t.nextSibling)?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){return this.run(t,function(t){return Ao(t,"array")&&(e=e.cloneNode(!0)),n&&To(_o(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n,r=this;return e.nodeName!==t.toUpperCase()&&(n=r.create(t),To(r.getAttribs(e),function(t){r.setAttrib(n,t.nodeName,r.getAttrib(e,t.nodeName))}),r.replace(n,e,1)),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 this.styles.toHex(At.trim(e))},run:function(e,t,n){var r,o=this;return"string"==typeof e&&(e=o.get(e)),!!e&&(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(r=[],To(e,function(e,i){e&&("string"==typeof e&&(e=o.get(e)),r.push(t.call(n,e,i)))}),r))},getAttribs:function(e){var t;if(!(e=this.get(e)))return[];if(Ro){if(t=[],"OBJECT"===e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});return e.cloneNode(!1).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n,r,o,i,a,u,s=0;if(e=e.firstChild){a=new Xr(e,e.parentNode),t=t||(this.schema?this.schema.getNonEmptyElements():null),i=this.schema?this.schema.getWhiteSpaceElements():{};do{if(1===(o=e.nodeType)){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=this.getAttribs(e)).length;n--;)if("name"===(u=r[n].nodeName)||"data-mce-bookmark"===u)return!1}if(8===o)return!1;if(3===o&&!Do.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&Do.test(e.nodeValue))return!1;e=a.next()}while(e)}return s<=1},createRng:function(){return this.doc.createRange()},nodeIndex:Po,split:function(e,t,n){var r,o,i,a=this.createRng();if(e&&t)return a.setStart(e.parentNode,this.nodeIndex(e)),a.setEnd(t.parentNode,this.nodeIndex(t)),r=a.extractContents(),(a=this.createRng()).setStart(t.parentNode,this.nodeIndex(t)+1),a.setEnd(e.parentNode,this.nodeIndex(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(ao.trimNode(this,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(ao.trimNode(this,o),e),this.remove(e),n||t},bind:function(e,t,n,r){if(At.isArray(e)){for(var o=e.length;o--;)e[o]=this.bind(e[o],t,n,r);return e}return!this.settings.collect||e!==this.doc&&e!==this.win||this.boundEvents.push([e,t,n,r]),this.events.bind(e,t,n,r||this)},unbind:function(e,t,n){var r;if(At.isArray(e)){for(r=e.length;r--;)e[r]=this.unbind(e[r],t,n);return e}if(this.boundEvents&&(e===this.doc||e===this.win))for(r=this.boundEvents.length;r--;){var o=this.boundEvents[r];e!==o[0]||t&&t!==o[1]||n&&n!==o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1===e.nodeType?(t=e.getAttribute("data-mce-contenteditable"))&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null:null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&null===(n=this.getContentEditable(e));e=e.parentNode);return n},destroy:function(){if(this.boundEvents){for(var e=this.boundEvents.length;e--;){var t=this.boundEvents[e];this.events.unbind(t[0],t[1],t[2])}this.boundEvents=null}bt.setDocument&&bt.setDocument(),this.win=this.doc=this.root=this.events=this.frag=null},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},_findSib:function(e,t,n){var r=this,o=t;if(e)for("string"==typeof o&&(o=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(o(e))return e;return null}},Io.DOM=new Io(document),Io.nodeIndex=Po;var Lo=Io.DOM,Mo=At.each,Fo=At.grep,zo=function(e){return"function"==typeof e},Uo=function(){var e={},t=[],n={},r=[],o=0;this.isDone=function(t){return 2===e[t]},this.markDone=function(t){e[t]=2},this.add=this.load=function(r,o,i,a){e[r]===undefined&&(t.push(r),e[r]=0),o&&(n[r]||(n[r]=[]),n[r].push({success:o,failure:a,scope:i||this}))},this.remove=function(t){delete e[t],delete n[t]},this.loadQueue=function(e,n,r){this.loadScripts(t,e,n,r)},this.loadScripts=function(t,i,a,u){var s,c=[],l=function(e,t){Mo(n[t],function(t){zo(t[e])&&t[e].call(t.scope)}),n[t]=undefined};r.push({success:i,failure:u,scope:a||this}),(s=function(){var n=Fo(t);if(t.length=0,Mo(n,function(t){2!==e[t]?3!==e[t]?1!==e[t]&&(e[t]=1,o++,function(e,t,n){var r,o,i=Lo,a=function(){i.remove(o),r&&(r.onreadystatechange=r.onload=r=null),t()};o=i.uniqueId(),(r=document.createElement("script")).id=o,r.type="text/javascript",r.src=At._addCacheSuffix(e),"onreadystatechange"in r?r.onreadystatechange=function(){/loaded|complete/.test(r.readyState)&&a()}:r.onload=a,r.onerror=function(){zo(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+e)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)}(t,function(){e[t]=2,o--,l("success",t),s()},function(){e[t]=3,o--,c.push(t),l("failure",t),s()})):l("failure",t):l("success",t)}),!o){var i=r.slice(0);r.length=0,Mo(i,function(e){0===c.length?zo(e.success)&&e.success.call(e.scope):zo(e.failure)&&e.failure.call(e.scope,c)})}})()}};Uo.ScriptLoader=new Uo;var Vo=At.each,Ho=function(){this.items=[],this.urls={},this.lookup={},this._listeners=[]};Ho.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:undefined},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(e,t){var n=Ho.language;if(n&&!1!==Ho.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;Uo.ScriptLoader.add(this.urls[e]+"/langs/"+n+".js")}},add:function(e,t,n){this.items.push(t),this.lookup[e]={instance:t,dependencies:n};var r=W.partition(this._listeners,function(t){return t.name===e});return this._listeners=r.fail,Vo(r.pass,function(e){e.callback()}),t},remove:function(e){delete this.urls[e],delete this.lookup[e]},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(e,t){var n=this.urls[e];Vo(t,function(e){Uo.ScriptLoader.add(n+"/"+e)})},load:function(e,t,n,r,o){var i=this,a=t,u=function(){var o=i.dependencies(e);Vo(o,function(e){var n=i.createUrl(t,e);i.load(n.resource,n,undefined,undefined)}),n&&(r?n.call(r):n.call(Uo))};i.urls[e]||("object"==typeof t&&(a=t.prefix+t.resource+t.suffix),0!==a.indexOf("/")&&-1===a.indexOf("://")&&(a=Ho.baseURL+"/"+a),i.urls[e]=a.substring(0,a.lastIndexOf("/")),i.lookup[e]?u():Uo.ScriptLoader.add(a,u,r,o))},waitFor:function(e,t){this.lookup.hasOwnProperty(e)?t():this._listeners.push({name:e,callback:t})}},Ho.PluginManager=new Ho,Ho.ThemeManager=new Ho;var qo=function(e){return"\ufeff"===e},jo="\ufeff",$o=function(e){return e.replace(new RegExp("\ufeff","g"),"")},Wo=ro.isElement,Ko=ro.isText,Xo=function(e){return Ko(e)&&(e=e.parentNode),Wo(e)&&e.hasAttribute("data-mce-caret")},Yo=function(e){return Ko(e)&&qo(e.data)},Go=function(e){return Xo(e)||Yo(e)},Jo=function(e){return Ko(e)&&e.data[0]===jo},Qo=function(e){return Ko(e)&&e.data[e.data.length-1]===jo},Zo={isCaretContainer:Go,isCaretContainerBlock:Xo,isCaretContainerInline:Yo,showCaretContainerBlock:function(e){return e&&e.hasAttribute("data-mce-caret")?(function(e){var t=e.getElementsByTagName("br"),n=t[t.length-1];ro.isBogus(n)&&n.parentNode.removeChild(n)}(e),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null},insertInline:function(e,t){var n,r,o,i;if(n=e.ownerDocument,o=n.createTextNode(jo),i=e.parentNode,t){if(r=e.previousSibling,Ko(r)){if(Go(r))return r;if(Qo(r))return r.splitText(r.data.length-1)}i.insertBefore(o,e)}else{if(r=e.nextSibling,Ko(r)){if(Go(r))return r;if(Jo(r))return r.splitText(1),r}e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o)}return o},prependInline:function(e){if(ro.isText(e)){var t=e.data;return t.length>0&&t.charAt(0)!==jo&&e.insertData(0,jo),e}return null},appendInline:function(e){if(ro.isText(e)){var t=e.data;return t.length>0&&t.charAt(t.length-1)!==jo&&e.insertData(t.length,jo),e}return null},isBeforeInline:function(e){return e&&ro.isText(e.container())&&e.container().data.charAt(e.offset())===jo},isAfterInline:function(e){return e&&ro.isText(e.container())&&e.container().data.charAt(e.offset()-1)===jo},insertBlock:function(e,t,n){var r,o,i;return r=t.ownerDocument,(o=r.createElement(e)).setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(function(){var e=document.createElement("br");return e.setAttribute("data-mce-bogus","1"),e}()),i=t.parentNode,n?i.insertBefore(o,t):t.nextSibling?i.insertBefore(o,t.nextSibling):i.appendChild(o),o},hasContent:function(e){return e.firstChild!==e.lastChild||!ro.isBr(e.firstChild)},startsWithCaretContainer:Jo,endsWithCaretContainer:Qo},ei=ro.isContentEditableTrue,ti=ro.isContentEditableFalse,ni=ro.isBr,ri=ro.isText,oi=ro.matchNodeNames("script style textarea"),ii=ro.matchNodeNames("img input textarea hr iframe video audio object"),ai=ro.matchNodeNames("table"),ui=Zo.isCaretContainer,si=function(e){return!ui(e)&&(ri(e)?!oi(e.parentNode):ii(e)||ni(e)||ai(e)||ti(e))},ci=function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(ti(e))return!1;if(ei(e))return!0}return!0},li=si,fi=function(e){return ii(e)||function(e){return!!ti(e)&&!0!==Nt.reduce(e.getElementsByTagName("*"),function(e,t){return e||ei(t)},!1)}(e)},di=function(e,t){return si(e)&&ci(e,t)},mi=Math.round,hi=function(e){return e?{left:mi(e.left),top:mi(e.top),bottom:mi(e.bottom),right:mi(e.right),width:mi(e.width),height:mi(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},pi=function(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2},gi=function(e,t){return e.bottom-e.height/2<t.top||!(e.top>t.bottom)&&pi(t.top-e.bottom,e,t)},vi=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&pi(t.bottom-e.top,e,t)},yi=hi,bi=function(e,t){return e=hi(e),t?e.right=e.left:(e.left=e.left+e.width,e.right=e.left),e.width=0,e},Ci=function(e,t){return e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right},xi=gi,wi=vi,Ni=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},Si=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},Ei=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},ki=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]"),Ti=function(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&ki.test(e)},Ai=[].slice,_i=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Ai.call(arguments);return r.length-1>=e.length?e.apply(this,r.slice(1)):function(){var e=r.concat([].slice.call(arguments));return _i.apply(this,e)}},Ri={constant:function(e){return function(){return e}},negate:function(e){return function(t){return!e(t)}},and:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ai.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},or:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ai.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}},curry:_i,compose:function(e,t){return function(n){return e(t(n))}},noop:function(){}},Bi=ro.isElement,Di=li,Oi=ro.matchStyleValues("display","block table"),Pi=ro.matchStyleValues("float","left right"),Ii=Ri.and(Bi,Di,Ri.negate(Pi)),Li=Ri.negate(ro.matchStyleValues("white-space","pre pre-line pre-wrap")),Mi=ro.isText,Fi=ro.isBr,zi=Io.nodeIndex,Ui=Ei,Vi=function(e){return"createRange"in e?e.createRange():Io.DOM.createRng()},Hi=function(e){return e&&/[\r\n\t ]/.test(e)},qi=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(Hi(e.toString())&&Li(n.parentNode)&&(t=n.data,Hi(t[r-1])||Hi(t[r+1])))},ji=function(e){var t,n,r=[],o=function(e){var t,n;return n=e.getClientRects(),t=n.length>0?yi(n[0]):yi(e.getBoundingClientRect()),Fi(e)&&0===t.left?function(e){var t,n=e.ownerDocument,r=Vi(n),o=n.createTextNode("\xa0"),i=e.parentNode;return i.insertBefore(o,e),r.setStart(o,0),r.setEnd(o,1),t=yi(r.getBoundingClientRect()),i.removeChild(o),t}(e):t},i=function(e,t){return e=bi(e,t),e.width=1,e.right=e.left+1,e},a=function(e){0!==e.height&&(r.length>0&&Ci(e,r[r.length-1])||r.push(e))},u=function(e,t){var n=Vi(e.ownerDocument);if(t<e.data.length){if(Ti(e.data[t]))return r;if(Ti(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!qi(n)))return a(i(o(n),!1)),r}t>0&&(n.setStart(e,t-1),n.setEnd(e,t),qi(n)||a(i(o(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),qi(n)||a(i(o(n),!0)))};if(Mi(e.container()))return u(e.container(),e.offset()),r;if(Bi(e.container()))if(e.isAtEnd())n=Ui(e.container(),e.offset()),Mi(n)&&u(n,n.data.length),Ii(n)&&!Fi(n)&&a(i(o(n),!1));else{if(n=Ui(e.container(),e.offset()),Mi(n)&&u(n,0),Ii(n)&&e.isAtEnd())return a(i(o(n),!1)),r;t=Ui(e.container(),e.offset()-1),Ii(t)&&!Fi(t)&&(Oi(t)||Oi(n)||!Ii(n))&&a(i(o(t),!1)),Ii(n)&&a(i(o(n),!0))}return r},$i=function(e,t,n){var r=function(){return n||(n=ji(new $i(e,t))),n};return{container:Ri.constant(e),offset:Ri.constant(t),toRange:function(){var n;return(n=Vi(e.ownerDocument)).setStart(e,t),n.setEnd(e,t),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return Mi(e),0===t},isAtEnd:function(){return Mi(e)?t>=e.data.length:t>=e.childNodes.length},isEqual:function(n){return n&&e===n.container()&&t===n.offset()},getNode:function(n){return Ui(e,n?t-1:t)}}};$i.fromRangeStart=function(e){return new $i(e.startContainer,e.startOffset)},$i.fromRangeEnd=function(e){return new $i(e.endContainer,e.endOffset)},$i.after=function(e){return new $i(e.parentNode,zi(e)+1)},$i.before=function(e){return new $i(e.parentNode,zi(e))},$i.isAtStart=function(e){return!!e&&e.isAtStart()},$i.isAtEnd=function(e){return!!e&&e.isAtEnd()},$i.isTextPosition=function(e){return!!e&&ro.isText(e.container())};var Wi=ro.isContentEditableTrue,Ki=ro.isContentEditableFalse,Xi=ro.matchStyleValues("display","block table table-cell table-caption list-item"),Yi=Zo.isCaretContainer,Gi=Zo.isCaretContainerBlock,Ji=Ri.curry,Qi=ro.isElement,Zi=li,ea=function(e){return e>0},ta=function(e){return e<0},na=function(e,t){for(var n;n=e(t);)if(!Gi(n))return n;return null},ra=function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode)if(Wi(e))return e;return t},oa=function(e,t){for(;e&&e!==t;){if(Xi(e))return e;e=e.parentNode}return null},ia=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},aa=function(e,t,n){return oa(t,e)===oa(n,e)},ua=function(e,t,n){var r,o;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],Yi(r)&&(r=r[o]),Ki(r)){if(aa(t,r,n))return r;break}if(Zi(r))break;n=n.parentNode}return null},sa=Ji(ia,!0),ca=Ji(ia,!1),la=function(e,t){return Ki(function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),Qi(n)?n.childNodes[r+e]:null):null}(e,t))},fa={isForwards:ea,isBackwards:ta,findNode:function(e,t,n,r,o){var i=new Xr(e,r);if(ta(t)){if((Ki(e)||Gi(e))&&(e=na(i.prev,!0),n(e)))return e;for(;e=na(i.prev,o);)if(n(e))return e}if(ea(t)){if((Ki(e)||Gi(e))&&(e=na(i.next,!0),n(e)))return e;for(;e=na(i.next,o);)if(n(e))return e}return null},getEditingHost:ra,getParentBlock:oa,isInSameBlock:function(e,t,n){return oa(e.container(),n)===oa(t.container(),n)},isInSameEditingHost:function(e,t,n){return ra(e.container(),n)===ra(t.container(),n)},isBeforeContentEditableFalse:Ji(la,0),isAfterContentEditableFalse:Ji(la,-1),normalizeRange:function(e,t,n){var r,o,i,a,u=Ji(ua,!0,t),s=Ji(ua,!1,t);if(o=n.startContainer,i=n.startOffset,Zo.isCaretContainerBlock(o)){if(Qi(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,Ki(r)))return sa(r);if("after"===a&&(r=o.previousSibling,Ki(r)))return ca(r)}if(!n.collapsed)return n;if(ro.isText(o)){if(Yi(o)){if(1===e){if(r=s(o))return sa(r);if(r=u(o))return ca(r)}if(-1===e){if(r=u(o))return ca(r);if(r=s(o))return sa(r)}return n}if(Zo.endsWithCaretContainer(o)&&i>=o.data.length-1)return 1===e&&(r=s(o))?sa(r):n;if(Zo.startsWithCaretContainer(o)&&i<=1)return-1===e&&(r=u(o))?ca(r):n;if(i===o.data.length)return(r=s(o))?sa(r):n;if(0===i)return(r=u(o))?ca(r):n}return n}},da=ro.isContentEditableFalse,ma=ro.isText,ha=ro.isElement,pa=ro.isBr,ga=fa.isForwards,va=fa.isBackwards,ya=li,ba=fi,Ca=di,xa=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},wa=function(e,t){if(ga(e)){if(ya(t.previousSibling)&&!ma(t.previousSibling))return $i.before(t);if(ma(t))return $i(t,0)}if(va(e)){if(ya(t.nextSibling)&&!ma(t.nextSibling))return $i.after(t);if(ma(t))return $i(t,t.data.length)}return va(e)?pa(t)?$i.before(t):$i.after(t):$i.before(t)},Na=function(e,t,n){var r,o,i,a,u,s,c;if(!ha(n)||!t)return null;if(t.isEqual($i.after(n))&&n.lastChild){if(c=$i.after(n.lastChild),va(e)&&ya(n.lastChild)&&ha(n.lastChild))return pa(n.lastChild)?$i.before(n.lastChild):c}else c=t;if(r=c.container(),o=c.offset(),ma(r)){if(va(e)&&o>0)return $i(r,--o);if(ga(e)&&o<r.length)return $i(r,++o);i=r}else{if(va(e)&&o>0&&(a=xa(r,o-1),ya(a)))return!ba(a)&&(u=fa.findNode(a,e,Ca,a))?ma(u)?$i(u,u.data.length):$i.after(u):ma(a)?$i(a,a.data.length):$i.before(a);if(ga(e)&&o<r.childNodes.length&&(a=xa(r,o),ya(a)))return function(e,t){var n;return!!ro.isBr(e)&&!!(n=Na(1,$i.after(e),t))&&!fa.isInSameBlock($i.before(e),$i.before(n),t)}(a,n)?Na(e,$i.after(a),n):!ba(a)&&(u=fa.findNode(a,e,Ca,a))?ma(u)?$i(u,0):$i.before(u):ma(a)?$i(a,0):$i.after(a);i=c.getNode()}return(ga(e)&&c.isAtEnd()||va(e)&&c.isAtStart())&&(i=fa.findNode(i,e,Ri.constant(!0),n,!0),Ca(i,n))?wa(e,i):(a=fa.findNode(i,e,Ca,n),!(s=Nt.last(Nt.filter(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(r,n),da)))||a&&s.contains(a)?a?wa(e,a):null:c=ga(e)?$i.after(s):$i.before(s))},Sa=function(e){return{next:function(t){return Na(1,t,e)},prev:function(t){return Na(-1,t,e)}}},Ea=function(e){return At.grep(e.childNodes,function(e){return"LI"===e.nodeName})},ka=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&function(e){return"\xa0"===e.data||ro.isBr(e)}(e.firstChild)},Ta=function(e){return e.length>0&&function(e){return!e.firstChild||ka(e)}(e[e.length-1])?e.slice(0,-1):e},Aa=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},_a=function(e,t){var n=$i.after(e),r=Sa(t).prev(n);return r?r.toRange():null},Ra=function(e,t,n){var r=e.parentNode;return At.each(t,function(t){r.insertBefore(t,e)}),function(e,t){var n=$i.before(e),r=Sa(t).next(n);return r?r.toRange():null}(e,n)},Ba=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||"\xa0"===e.value}(t.firstChild)}(e,t))}(e,r)&&(r=r.prev),!(!n||n!==r||"ul"!==n.name&&"ol"!==n.name)},Da=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=Aa(t,n.startContainer),a=Ta(Ea(o.firstChild)),u=t.getRoot(),s=function(e){var r=$i.fromRangeStart(n),o=Sa(t.getRoot()),a=1===e?o.prev(r):o.next(r);return!a||Aa(t,a.getNode())!==i};return s(1)?Ra(i,a,u):s(2)?function(e,t,n,r){return r.insertAfter(t.reverse(),e),_a(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),At.each(t,function(t){i.insertBefore(t,e)}),i.insertBefore(o[1],e),i.removeChild(e),_a(t[t.length-1],n)}(i,a,u,n)},Oa=function(e,t){return!!Aa(e,t)},Pa=ro.isText,Ia=ro.isBogus,La=Io.nodeIndex,Ma=function(e){var t=e.parentNode;return Ia(t)?Ma(t):t},Fa=function(e){return e?Nt.reduce(e.childNodes,function(e,t){return Ia(t)&&"BR"!==t.nodeName?e=e.concat(Fa(t)):e.push(t),e},[]):[]},za=function(e){return function(t){return e===t}},Ua=function(e){return(Pa(e)?"text()":e.nodeName.toLowerCase())+"["+function(e){var t,n,r;return t=Fa(Ma(e)),n=Nt.findIndex(t,za(e),e),t=t.slice(0,n+1),r=Nt.reduce(t,function(e,n,r){return Pa(n)&&Pa(t[r-1])&&e++,e},0),t=Nt.filter(t,ro.matchNodeNames(e.nodeName)),(n=Nt.findIndex(t,za(e),e))-r}(e)+"]"},Va=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),Pa(n)?o=function(e,t){for(;(e=e.previousSibling)&&Pa(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(Ua(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=Nt.filter(a,Ri.negate(ro.isBogus)),(u=u.concat(Nt.map(a,function(e){return Ua(e)}))).reverse().join("/")+","+o},Ha=function(e,t){var n,r,o;return t?(n=t.split(","),t=n[0].split("/"),o=n.length>1?n[1]:"before",(r=Nt.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),function(e,t,n){var r=Fa(e);return r=Nt.filter(r,function(e,t){return!Pa(e)||!Pa(r[t-1])}),(r=Nt.filter(r,ro.matchNodeNames(t)))[n]}(e,t[1],parseInt(t[2],10))):null},e))?Pa(r)?function(e,t){for(var n,r=e,o=0;Pa(r);){if(n=r.data.length,t>=o&&t<=o+n){e=r,t-=o;break}if(!Pa(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return t>e.data.length&&(t=e.data.length),new $i(e,t)}(r,parseInt(o,10)):(o="after"===o?La(r)+1:La(r),new $i(r.parentNode,o)):null):null},qa=ro.isContentEditableFalse,ja=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},$a=function(e){ro.isText(e)&&0===e.data.length&&e.parentNode.removeChild(e)},Wa=function(e,t,n){var r=0;return At.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},Ka=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))},Xa=function(e){return Ka(e,!0),Ka(e,!1),e},Ya=function(e,t){var n;if(ro.isElement(e)&&(e=Ei(e,t),qa(e)))return e;if(Zo.isCaretContainer(e)){if(ro.isText(e)&&Zo.isCaretContainerBlock(e)&&(e=e.parentNode),n=e.previousSibling,qa(n))return n;if(n=e.nextSibling,qa(n))return n}},Ga=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();return qa(r)||"IMG"===o?{name:o,index:Wa(n.dom,o,r)}:(r=function(e){return Ya(e.startContainer,e.startOffset)||Ya(e.endContainer,e.endOffset)}(i))?(o=r.tagName,{name:o,index:Wa(n.dom,o,r)}):function(e,t,n,r){var o=t.dom,i={};return i.start=ja(o,e,n,r,!0),t.isCollapsed()||(i.end=ja(o,e,n,r,!1)),i}(e,n,t,i)},Ja={getBookmark:function(e,t,n){return 2===t?Ga($o,n,e):3===t?function(e){var t=e.getRng();return{start:Va(e.dom.getRoot(),$i.fromRangeStart(t)),end:Va(e.dom.getRoot(),$i.fromRangeEnd(t))}}(e):t?function(e){return{rng:e.getRng()}}(e):function(e){var t=e.dom,n=e.getRng(),r=t.uniqueId(),o=e.isCollapsed(),i="overflow:hidden;line-height:0px",a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:Wa(t,u,a)};var s=Xa(n.cloneRange());if(!o){s.collapse(!1);var c=t.create("span",{"data-mce-type":"bookmark",id:r+"_end",style:i},"");s.insertNode(c),$a(c.nextSibling)}(n=Xa(n)).collapse(!0);var l=t.create("span",{"data-mce-type":"bookmark",id:r+"_start",style:i},"");return n.insertNode(l),$a(l.previousSibling),e.moveToBookmark({id:r,keep:1}),{id:r}}(e)},getUndoBookmark:T.curry(Ga,T.identity,!0)},Qa=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return O.none();n.push(o.getOrDie())}return O.some(t.apply(null,n))},Za=function(e,t){return!e.isBlock(t)||t.innerHTML||oe.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t},eu=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,s[o]>u.length-1)return;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},tu=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,l?(r=c.firstChild,o=1):o=e.nodeIndex(c),u=r,s=o,!l){for(a=c.previousSibling,i=c.nextSibling,At.each(At.grep(c.childNodes),function(e){ro.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});c=e.get(n.id+"_"+t);)e.remove(c,1);a&&i&&a.nodeType===i.nodeType&&ro.isText(a)&&!oe.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return O.some($i(u,s))}return O.none()},nu=function(e,t){var n=e.dom;if(t){if(At.isArray(t.start))return function(e,t){var n=e.createRng();return eu(e,!0,t,n)&&eu(e,!1,t,n)?O.some(n):O.none()}(n,t);if("string"==typeof t.start)return O.some(function(e,t){var n,r;return n=e.createRng(),r=Ha(e.getRoot(),t.start),n.setStart(r.container(),r.offset()),r=Ha(e.getRoot(),t.end),n.setEnd(r.container(),r.offset()),n}(n,t));if(t.id)return function(e,t){var n=tu(e,"start",t),r=tu(e,"end",t);return Qa([n,function(e,t){return e.isSome()?e:t}(r,n)],function(t,n){var r=e.createRng();return r.setStart(Za(e,t.container()),t.offset()),r.setEnd(Za(e,n.container()),n.offset()),r})}(n,t);if(t.name)return function(e,t){return O.from(e.select(t.name)[t.index]).map(function(t){var n=e.createRng();return n.selectNode(t),n})}(n,t);if(t.rng)return O.some(t.rng)}return O.none()},ru=function(e,t,n){return Ja.getBookmark(e,t,n)},ou=function(e,t){nu(e,t).each(function(t){e.setRng(t)})},iu=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},au=At.each,uu=function(e){this.compare=function(t,n){if(t.nodeName!==n.nodeName)return!1;var r=function(t){var n={};return au(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")))&&(!iu(t)&&!iu(n)))}},su=function(e,t){Or.parent(e).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})},cu=function(e,t){e.dom().appendChild(t.dom())},lu={before:su,after:function(e,t){Or.nextSibling(e).fold(function(){Or.parent(e).each(function(e){cu(e,t)})},function(e){su(e,t)})},prepend:function(e,t){Or.firstChild(e).fold(function(){cu(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})},append:cu,appendAt:function(e,t,n){Or.child(e,n).fold(function(){cu(e,t)},function(e){su(e,t)})},wrap:function(e,t){su(e,t),cu(t,e)}},fu=function(e,t){W.each(t,function(t){lu.before(e,t)})},du=function(e,t){W.each(t,function(t){lu.append(e,t)})},mu=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},hu={empty:function(e){e.dom().textContent="",W.each(Or.children(e),function(e){mu(e)})},remove:mu,unwrap:function(e){var t=Or.children(e);t.length>0&&fu(e,t),mu(e)}},pu=function(e,t){var n=function(t){return e(t)?O.from(t.dom().nodeValue):O.none()},r=_n.detect().browser,o=r.isIE()&&10===r.version.major?function(e){try{return n(e)}catch(Gb){return O.none()}}:n;return{get:function(n){if(!e(n))throw new Error("Can only get "+t+" value of a "+t+" node");return o(n).getOr("")},getOption:o,set:function(n,r){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom().nodeValue=r}}}(Hn.isText,"text"),gu=function(e){return pu.get(e)},vu=function(e,t){return Cr(t,e)},yu=function(e){var t=vu(e,"br"),n=W.filter(function(e){for(var t=[],n=e.dom();n;)t.push(Bn.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),Qr.isBr);t.length===n.length&&W.each(n,hu.remove)},bu=function(e){hu.empty(e),lu.append(e,Bn.fromHtml('<br data-mce-bogus="1">'))},Cu=function(e){Or.lastChild(e).each(function(t){Or.prevSibling(t).each(function(n){Qr.isBlock(e)&&Qr.isBr(t)&&Qr.isBlock(n)&&hu.remove(t)})})},xu=At.makeMap,wu=function(e){var t,n,r,o,i,a=[];return e=e||{},t=e.indent,n=xu(e.indent_before||""),r=xu(e.indent_after||""),o=po.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$/,"")}}},Nu=function(e,t){var n={},r=wu(e);return e=e||{},e.validate=!("validate"in e)||e.validate,n.schema=t=t||Eo(),n.writer=r,n.serialize=function(n){var o,i;i=e.validate,o={3:function(e){r.text(e.value,e.raw)},8:function(e){r.comment(e.value)},7:function(e){r.pi(e.name,e.value)},10:function(e){r.doctype(e.value)},4:function(e){r.cdata(e.value)},11:function(e){if(e=e.firstChild)do{a(e)}while(e=e.next)}},r.reset();var a=function(e){var n,u,s,c,l,f,d,m,h,p=o[e.type];if(p)p(e);else{if(n=e.name,u=e.shortEnded,s=e.attributes,i&&s&&s.length>1&&(f=[],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(r.start(e.name,s,u),!u){if(e=e.firstChild)do{a(e)}while(e=e.next);r.end(n)}}};return 1!==n.type||e.inner?o[11](n):a(n),r.getContent()},n},Su=function(e){return $i.isTextPosition(e)?0===e.offset():li(e.getNode())},Eu=function(e){return $i.isTextPosition(e)?e.offset()===e.container().data.length:li(e.getNode(!0))},ku=function(e,t){return!$i.isTextPosition(e)&&!$i.isTextPosition(t)&&e.getNode()===t.getNode(!0)},Tu=function(e,t,n){return e?!ku(t,n)&&!function(e){return!$i.isTextPosition(e)&&ro.isBr(e.getNode())}(t)&&Eu(t)&&Su(n):!ku(n,t)&&Su(t)&&Eu(n)},Au=function(e,t,n){var r=Sa(t);return O.from(e?r.next(n):r.prev(n))},_u=function(e,t){var n=e?t.firstChild:t.lastChild;return ro.isText(n)?O.some(new $i(n,e?0:n.data.length)):n?li(n)?O.some(e?$i.before(n):function(e){return ro.isBr(e)?$i.before(e):$i.after(e)}(n)):function(e,t,n){var r=e?$i.before(n):$i.after(n);return Au(e,t,r)}(e,t,n):O.none()},Ru={fromPosition:Au,nextPosition:T.curry(Au,!0),prevPosition:T.curry(Au,!1),navigate:function(e,t,n){return Au(e,t,n).bind(function(r){return fa.isInSameBlock(n,r,t)&&Tu(e,n,r)?Au(e,t,r):O.some(r)})},positionIn:_u,firstPositionIn:T.curry(_u,!0),lastPositionIn:T.curry(_u,!1)},Bu=function(e){var t=$i.fromRangeStart(e),n=$i.fromRangeEnd(e),r=e.commonAncestorContainer;return Ru.fromPosition(!1,r,n).map(function(o){return!fa.isInSameBlock(t,n,r)&&fa.isInSameBlock(t,o,r)?function(e,t,n,r){var o=document.createRange();return o.setStart(e,t),o.setEnd(n,r),o}(t.container(),t.offset(),o.container(),o.offset()):e}).getOr(e)},Du=function(e){return function(e){return e.collapsed?e:Bu(e)}(e)},Ou=ro.matchNodeNames("td th"),Pu=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,h,p=e.schema.getTextInlineElements(),g=e.selection,v=e.dom;if(/^ | $/.test(t)&&(t=function(e){var t,n,r;t=g.getRng(!0),n=t.startContainer,r=t.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(r>0?e=e.replace(/^ /," "):o("previousSibling")||(e=e.replace(/^ /," ")),r<n.length?e=e.replace(/ (<br>|)$/," "):o("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e}(t)),r=e.parser,h=n.merge,o=Nu({validate:e.settings.validate},e.schema),m='<span id="mce_marker" data-mce-type="bookmark">​</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\}/,m);var y=(l=g.getRng()).startContainer||(l.parentElement?l.parentElement():null),b=e.getBody();y===b&&g.isCollapsed()&&v.isBlock(b.firstChild)&&function(t){return t&&!e.schema.getShortEndedElements()[t.nodeName]}(b.firstChild)&&v.isEmpty(b.firstChild)&&((l=v.createRng()).setStart(b.firstChild,0),l.setEnd(b.firstChild,0),g.setRng(l)),g.isCollapsed()||(e.selection.setRng(Du(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),function(){var e,n,r;n=(e=g.getRng(!0)).startContainer,r=e.startOffset,3===n.nodeType&&e.collapsed&&("\xa0"===n.data[r]?(n.deleteData(r,1),/[\u00a0| ]$/.test(t)||(t+=" ")):"\xa0"===n.data[r-1]&&(n.deleteData(r-1,1),/[\u00a0| ]$/.test(t)||(t=" "+t)))}());var C={context:(i=g.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,C),!0===n.paste&&Ba(e.schema,u)&&Oa(v,i))return l=Da(o,v,e.selection.getRng(!0),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||!v.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),C.invalid){for(g.setContent(m),i=g.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)i=f,f=f.parentNode;t=i===a?a.innerHTML:v.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?v.setHTML(a,t):v.setOuterHTML(i,t)}else t=o.serialize(u),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):e.selection.setContent(t)}}(e,t,i);!function(){if(h){var t=e.getBody(),n=new uu(v);At.each(v.select("*[data-mce-fragment]"),function(e){for(var r=e.parentNode;r&&r!==t;r=r.parentNode)p[e.nodeName.toLowerCase()]&&n.compare(r,e)&&v.remove(e,!0)})}}(),function(t){var n,r,o;if(t){if(g.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 v.remove(t),void g.select(n);l=v.createRng(),(f=t.previousSibling)&&3===f.nodeType?(l.setStart(f,f.nodeValue.length),oe.ie||(d=t.nextSibling)&&3===d.nodeType&&(f.appendData(d.data),d.parentNode.removeChild(d))):(l.setStartBefore(t),l.setEndBefore(t)),r=v.getParent(t,v.isBlock),v.remove(t),r&&v.isEmpty(r)&&(e.$(r).empty(),l.setStart(r,0),l.setEnd(r,0),Ou(r)||function(e){return!!e.getAttribute("data-mce-fragment")}(r)||!(o=function(t){var n=$i.fromRangeStart(t);if(n=Sa(e.getBody()).next(n))return n.toRange()}(l))?v.add(r,v.create("br",{"data-mce-bogus":"1"})):(l=o,v.remove(r))),g.setRng(l)}}(v.get("mce_marker")),function(e){At.each(e.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")})}(e.getBody()),function(e,t){O.from(e.getParent(t,"td,th")).map(Bn.fromDom).each(Cu)}(e.dom,e.selection.getStart()),e.fire("SetContent",s),e.addVisual()}},Iu=function(e,t){var n=function(e){var t;return"string"!=typeof e?(t=At.extend({paste:e.paste,data:{paste:e.paste}},e),{content:e.content,details:t}):{content:e,details:{}}}(t);Pu(e,n.content,n.details)},Lu=function(e,t,n,r,o){return e(n,r)?O.some(n):jn.isFunction(o)&&o(n)?O.none():t(n,r,o)},Mu=function(e,t,n){for(var r=e.dom(),o=jn.isFunction(n)?n:T.constant(!1);r.parentNode;){r=r.parentNode;var i=Bn.fromDom(r);if(t(i))return O.some(i);if(o(i))break}return O.none()},Fu=function(e,t){return W.find(e.dom().childNodes,T.compose(t,Bn.fromDom)).map(Bn.fromDom)},zu=function(e,t){var n=function(e){for(var r=0;r<e.childNodes.length;r++){if(t(Bn.fromDom(e.childNodes[r])))return O.some(Bn.fromDom(e.childNodes[r]));var o=n(e.childNodes[r]);if(o.isSome())return o}return O.none()};return n(e.dom())},Uu={first:function(e){return zu(ar.body(),e)},ancestor:Mu,closest:function(e,t,n){return Lu(function(e){return t(e)},Mu,e,t,n)},sibling:function(e,t){var n=e.dom();return n.parentNode?Fu(Bn.fromDom(n.parentNode),function(n){return!Er.eq(e,n)&&t(n)}):O.none()},child:Fu,descendant:zu},Vu=dr("sections","settings"),Hu=_n.detect().deviceType.isTouch(),qu=["lists","autolink","autosave"],ju={theme:"mobile"},$u=function(e){var t=jn.isArray(e)?e.join(" "):e,n=W.map(jn.isString(t)?t.split(" "):[],wn);return W.filter(n,function(e){return e.length>0})},Wu=function(e,t){return e.sections().hasOwnProperty(t)},Ku=function(e,t,n,r){var o=$u(n.forced_plugins),i=$u(r.plugins),a=function(e,t){return[].concat($u(e)).concat($u(t))}(o,e&&Wu(t,"mobile")?function(e){return W.filter(e,T.curry(W.contains,qu))}(i):i);return At.extend(r,{plugins:a.join(" ")})},Xu=function(e,t,n,r){var o=function(e,t){var n=Gn.bifilter(t,function(t,n){return W.contains(e,n)});return Vu(n.t,n.f)}(["mobile"],r),i=At.extend(t,n,o.settings(),function(e,t){var n=t.settings().inline;return e&&Wu(t,"mobile")&&!n}(e,o)?function(e,t,n){var r=e.sections(),o=r.hasOwnProperty(t)?r[t]:{};return At.extend({},n,o)}(o,"mobile",ju):{},{validate:!0,content_editable:o.settings().inline,external_plugins:function(e,t){var n=t.external_plugins?t.external_plugins:{};return e&&e.external_plugins?At.extend({},e.external_plugins,n):n}(n,o.settings())});return Ku(e,o,n,i)},Yu={getEditorSettings: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,padd_empty_editor:!0,render_ui:!0,indentation:"30px",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,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,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 Xu(Hu,i,r,o)},get:function(e,t){return O.from(e.settings[t])},getString:T.curry(function(e,t,n){return O.from(t.settings[n]).filter(e)},jn.isString),combineSettings:Xu},Gu=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Ju=function(e){return Gu.test(e)},Qu=function(e,t){var n=t.container(),r=t.offset();return e?Zo.isCaretContainerInline(n)?ro.isText(n.nextSibling)?new $i(n.nextSibling,0):$i.after(n):Zo.isBeforeInline(t)?new $i(n,r+1):t:Zo.isCaretContainerInline(n)?ro.isText(n.previousSibling)?new $i(n.previousSibling,n.previousSibling.data.length):$i.before(n):Zo.isAfterInline(t)?new $i(n,r-1):t},Zu={isInlineTarget:function(e,t){var n=Yu.getString(e,"inline_boundaries_selector").getOr("a[href],code");return xr(Bn.fromDom(t),n)},findRootInline:function(e,t,n){var r=function(e,t,n){return W.filter(Io.DOM.getParents(n.container(),"*",t),e)}(e,t,n);return O.from(r[r.length-1])},isRtl:function(e){return"rtl"===Io.DOM.getStyle(e,"direction",!0)||Ju(e.textContent)},isAtZwsp:function(e){return Zo.isBeforeInline(e)||Zo.isAfterInline(e)},normalizePosition:Qu,normalizeForwards:T.curry(Qu,!0),normalizeBackwards:T.curry(Qu,!1),hasSameParentBlock:function(e,t,n){var r=fa.getParentBlock(t,e),o=fa.getParentBlock(n,e);return r&&r===o}},es=function(e,t){return Er.contains(e,t)?Uu.closest(t,function(e){return Qr.isTextBlock(e)||Qr.isListItem(e)},function(e){return function(t){return Er.eq(e,Bn.fromDom(t.dom().parentNode))}}(e)):O.none()},ts=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))},ns=function(e,t,n){return Qa([Ru.firstPositionIn(n),Ru.lastPositionIn(n)],function(r,o){var i=Zu.normalizePosition(!0,r),a=Zu.normalizePosition(!1,o),u=Zu.normalizePosition(!1,t);return e?Ru.nextPosition(n,u).map(function(e){return e.isEqual(a)&&t.isEqual(i)}).getOr(!1):Ru.prevPosition(n,u).map(function(e){return e.isEqual(i)&&t.isEqual(a)}).getOr(!1)}).getOr(!0)},rs=function(e,t,n){return Uu.ancestor(e,function(e){return xr(e,t)},n)},os=rs,is=function(e,t){return wr(t,e)},as=function(e,t,n){return Lu(xr,rs,e,t,n)},us=function(e,t,n){return os(e,t,n).isSome()},ss=function(e,t){return ro.isText(t)&&/^[ \t\r\n]*$/.test(t.data)&&!1===function(e,t){var n=Bn.fromDom(e),r=Bn.fromDom(t);return us(r,"pre,code",T.curry(Er.eq,n))}(e,t)},cs=function(e,t){return li(t)&&!1===ss(e,t)||function(e){return ro.isElement(e)&&"A"===e.nodeName&&e.hasAttribute("name")}(t)||ls(t)},ls=ro.hasAttribute("data-mce-bookmark"),fs=ro.hasAttribute("data-mce-bogus"),ds=ro.hasAttributeValue("data-mce-bogus","all"),ms=function(e){return function(e){var t,n,r=0;if(cs(e,e))return!1;if(!(n=e.firstChild))return!0;t=new Xr(n,e);do{if(ds(n))n=t.next(!0);else if(fs(n))n=t.next();else if(ro.isBr(n))r++,n=t.next();else{if(cs(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},hs=dr("block","position"),ps=dr("from","to"),gs=function(e,t){var n=Bn.fromDom(e),r=Bn.fromDom(t.container());return es(n,r).map(function(e){return hs(e,t)})},vs=function(e,t,n){var r=gs(e,$i.fromRangeStart(n)),o=r.bind(function(n){return Ru.fromPosition(t,e,n.position()).bind(function(n){return gs(e,n).map(function(n){return function(e,t,n){return ro.isBr(n.position().getNode())&&!1===ms(n.block())?Ru.positionIn(!1,n.block().dom()).bind(function(r){return r.isEqual(n.position())?Ru.fromPosition(t,e,r).bind(function(t){return gs(e,t)}):O.some(n)}).getOr(n):n}(e,t,n)})})});return Qa([r,o],ps).filter(function(e){return function(e){return!1===Er.eq(e.from().block(),e.to().block())}(e)&&function(e){return Or.parent(e.from().block()).bind(function(t){return Or.parent(e.to().block()).filter(function(e){return Er.eq(t,e)})}).isSome()}(e)&&function(e){return!1===ro.isContentEditableFalse(e.from().block())&&!1===ro.isContentEditableFalse(e.to().block())}(e)})},ys=function(e,t,n){return n.collapsed?vs(e,t,n):O.none()},bs=function(e,t,n){return Er.contains(t,e)?function(e){return e.slice(0,-1)}(Or.parents(e,function(e){return n(e)||Er.eq(e,t)})):[]},Cs=function(e,t){return bs(e,t,T.constant(!1))},xs=Cs,ws=function(e,t){return[e].concat(Cs(e,t))},Ns=function(e){var t=function(e){var t=Or.children(e);return W.findIndex(t,Qr.isBlock).fold(function(){return t},function(e){return t.slice(0,e)})}(e);return W.each(t,function(e){hu.remove(e)}),t},Ss=function(e,t){Ru.positionIn(e,t.dom()).each(function(e){var t=e.getNode();ro.isBr(t)&&hu.remove(Bn.fromDom(t))})},Es=function(e,t){var n=ws(t,e);return W.find(n.reverse(),ms).each(hu.remove)},ks=function(e,t){return Er.contains(t,e)?Or.parent(e).bind(function(n){return Er.eq(n,t)?O.some(e):function(e,t){var n=Or.parents(t,function(t){return Er.eq(t,e)});return O.from(n[n.length-2])}(t,e)}):O.none()},Ts=function(e,t,n){if(ms(n))return hu.remove(n),ms(t)&&bu(t),Ru.firstPositionIn(t.dom());Ss(!0,t),Ss(!1,n);var r=Ns(t);return ks(t,n).fold(function(){Es(e,t);var o=Ru.lastPositionIn(n.dom());return W.each(r,function(e){lu.append(n,e)}),o},function(o){var i=Ru.prevPosition(n.dom(),$i.before(o.dom()));return W.each(r,function(e){lu.before(o,e)}),Es(e,t),i})},As=function(e,t,n,r){return t?Ts(e,r,n):Ts(e,n,r)},_s=function(e,t){var n,r=Bn.fromDom(e.getBody());return(n=ys(r.dom(),t,e.selection.getRng()).bind(function(e){return As(r,t,e.from().block(),e.to().block())})).each(function(t){e.selection.setRng(t.toRange())}),n.isSome()},Rs=function(e,t){var n=Bn.fromDom(t),r=T.curry(Er.eq,e);return Uu.ancestor(n,Qr.isTableCell,r).isSome()},Bs=function(e,t){var n=Ru.prevPosition(e.dom(),$i.fromRangeStart(t)).isNone(),r=Ru.nextPosition(e.dom(),$i.fromRangeEnd(t)).isNone();return!function(e,t){return Rs(e,t.startContainer)||Rs(e,t.endContainer)}(e,t)&&n&&r},Ds=function(e){var t=Bn.fromDom(e.getBody()),n=e.selection.getRng();return Bs(t,n)?function(e){return e.setContent(""),e.selection.setCursorLocation(),!0}(e):function(e,t){var n=t.getRng();return Qa([es(e,Bn.fromDom(n.startContainer)),es(e,Bn.fromDom(n.endContainer))],function(r,o){return!1===Er.eq(r,o)&&(n.deleteContents(),As(e,!0,r,o).each(function(e){t.setRng(e.toRange())}),!0)}).getOr(!1)}(t,e.selection)},Os=function(e,t){return!e.selection.isCollapsed()&&Ds(e)},Ps=function(e){if(!jn.isArray(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=[],n={};return W.each(e,function(r,o){var i=Gn.keys(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=r[a];if(n[a]!==undefined)throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!jn.isArray(u))throw new Error("case arguments must be an array");t.push(a),n[a]=function(){var n=arguments.length;if(n!==u.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+u.length+" ("+u+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];return{fold:function(){if(arguments.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+arguments.length);return arguments[o].apply(null,r)},match:function(e){var n=Gn.keys(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!W.forall(t,function(e){return W.contains(n,e)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,r)},log:function(e){console.log(e,{constructors:t,constructor:a,params:r})}}}}),n},Is=Ps([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Ls=function(e,t,n,r){var o=r.getNode(!1===t);return es(Bn.fromDom(e),Bn.fromDom(n.getNode())).map(function(e){return ms(e)?Is.remove(e.dom()):Is.moveToElement(o)}).orThunk(function(){return O.some(Is.moveToElement(o))})},Ms=function(e,t,n){return Ru.fromPosition(t,e,n).bind(function(r){return t&&ro.isContentEditableFalse(r.getNode())?Ls(e,t,n,r):!1===t&&ro.isContentEditableFalse(r.getNode(!0))?Ls(e,t,n,r):t&&fa.isAfterContentEditableFalse(n)?O.some(Is.moveToPosition(r)):!1===t&&fa.isBeforeContentEditableFalse(n)?O.some(Is.moveToPosition(r)):O.none()})},Fs=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)?O.some(Is.moveToElement(t.nextSibling)):!1===e&&ro.isContentEditableFalse(t.previousSibling)?O.some(Is.moveToElement(t.previousSibling)):O.none()}(t,n.getNode(!1===t)).fold(function(){return Ms(e,t,n)},O.some):Ms(e,t,n).bind(function(t){return function(e,t,n){return n.fold(function(e){return O.some(Is.remove(e))},function(e){return O.some(Is.moveToElement(e))},function(n){return fa.isInSameBlock(t,n,e)?O.none():O.some(Is.moveToPosition(n))})}(e,n,t)})},zs=function(e,t,n){var r=fa.normalizeRange(t?1:-1,e,n),o=$i.fromRangeStart(r);return!1===t&&fa.isAfterContentEditableFalse(o)?O.some(Is.remove(o.getNode(!0))):t&&fa.isBeforeContentEditableFalse(o)?O.some(Is.remove(o.getNode())):Fs(e,t,o)},Us=function(e,t){return function(e,t){var n=e.container(),r=e.offset();return!1===$i.isTextPosition(e)&&n===t.parentNode&&r>$i.before(t).offset()}(t,e)?new $i(t.container(),t.offset()-1):t},Vs=function(e){return li(e.previousSibling)?O.some(function(e){return ro.isText(e)?new $i(e,e.data.length):$i.after(e)}(e.previousSibling)):e.previousSibling?Ru.lastPositionIn(e.previousSibling):O.none()},Hs=function(e){return li(e.nextSibling)?O.some(function(e){return ro.isText(e)?new $i(e,0):$i.before(e)}(e.nextSibling)):e.nextSibling?Ru.firstPositionIn(e.nextSibling):O.none()},qs=function(e,t){return Vs(t).orThunk(function(){return Hs(t)}).orThunk(function(){return function(e,t){var n=$i.before(t.previousSibling?t.previousSibling:t.parentNode);return Ru.prevPosition(e,n).fold(function(){return Ru.nextPosition(e,$i.after(t))},O.some)}(e,t)})},js=function(e,t){return Hs(t).orThunk(function(){return Vs(t)}).orThunk(function(){return function(e,t){return Ru.nextPosition(e,$i.after(t)).fold(function(){return Ru.prevPosition(e,$i.before(t))},O.some)}(e,t)})},$s=function(e,t,n){return function(e,t,n){return e?js(t,n):qs(t,n)}(e,t,n).map(T.curry(Us,n))},Ws=function(e,t,n){n.fold(function(){e.focus()},function(n){e.selection.setRng(n.toRange(),t)})},Ks=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(Hn.name(t))},Xs=function(e){if(ms(e)){var t=Bn.fromHtml('<br data-mce-bogus="1">');return hu.empty(e),lu.append(e,t),O.some($i.before(t.dom()))}return O.none()},Ys=function(e,t,n){var r=$s(t,e.getBody(),n.dom()),o=Uu.ancestor(n,T.curry(Ks,e),function(e){return function(t){return t.dom()===e}}(e.getBody())),i=function(e,t){return Qa([Or.prevSibling(e),Or.nextSibling(e),t],function(t,n,r){var o,i=t.dom(),a=n.dom();return ro.isText(i)&&ro.isText(a)?(o=i.data.length,i.appendData(a.data),hu.remove(n),hu.remove(e),r.container()===a?new $i(i,o):r):(hu.remove(e),r)}).orThunk(function(){return hu.remove(e),t})}(n,r);e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):o.bind(Xs).fold(function(){Ws(e,t,i)},function(n){Ws(e,t,O.some(n))})},Gs=function(e,t){return zs(e.getBody(),t,e.selection.getRng()).map(function(n){return n.fold(function(e,t){return function(n){return e._selectionOverrides.hideFakeCaret(),Ys(e,t,Bn.fromDom(n)),!0}}(e,t),function(e,t){return function(n){var r=t?$i.before(n):$i.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)},Js=function(e,t){var n=e.selection.getNode();return!!ro.isContentEditableFalse(n)&&(function(e){W.each(vu(e,".mce-offscreen-selection"),hu.remove)}(Bn.fromDom(e.getBody())),Ys(e,t,Bn.fromDom(e.selection.getNode())),ts(e),!0)},Qs=function(e,t){return e.selection.isCollapsed()?Gs(e,t):Js(e,t)},Zs=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($i.before(t).toRange())),!0},ec=ro.isText,tc=function(e){return ec(e)&&e.data[0]===jo},nc=function(e){return ec(e)&&e.data[e.data.length-1]===jo},rc=function(e){return e.ownerDocument.createTextNode(jo)},oc=function(e,t){return e?function(e){if(ec(e.previousSibling))return nc(e.previousSibling)?e.previousSibling:(e.previousSibling.appendData(jo),e.previousSibling);if(ec(e))return tc(e)?e:(e.insertData(0,jo),e);var t=rc(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(ec(e.nextSibling))return tc(e.nextSibling)?e.nextSibling:(e.nextSibling.insertData(0,jo),e.nextSibling);if(ec(e))return nc(e)?e:(e.appendData(jo),e);var t=rc(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},ic={insertInline:oc,insertInlineBefore:T.curry(oc,!0),insertInlineAfter:T.curry(oc,!1)},ac=ro.isElement,uc=ro.isText,sc=function(e){var t=e.parentNode;t&&t.removeChild(e)},cc=function(e,t){0===t.length?sc(e):e.nodeValue=t},lc=function(e){var t=$o(e);return{count:e.length-t.length,text:t}},fc=function(e,t){return hc(e),t},dc=function(e,t){return t.container()===e?function(e,t){var n=lc(e.data.substr(0,t.offset())),r=lc(e.data.substr(t.offset())),o=n.text+r.text;return o.length>0?(cc(e,o),new $i(e,t.offset()-n.count)):t}(e,t):fc(e,t)},mc=function(e,t){return t.container()===e.parentNode?function(e,t){var n=t.container(),r=W.indexOf(n.childNodes,e).map(function(e){return e<t.offset()?new $i(n,t.offset()-1):t}).getOr(t);return hc(e),r}(e,t):fc(e,t)},hc=function(e){if(ac(e)&&Zo.isCaretContainer(e)&&(Zo.hasContent(e)?e.removeAttribute("data-mce-caret"):sc(e)),uc(e)){var t=$o(function(e){try{return e.nodeValue}catch(t){return""}}(e));cc(e,t)}},pc={removeAndReposition:function(e,t){return $i.isTextPosition(t)?dc(e,t):mc(e,t)},remove:hc},gc=function(e,t){return ro.isText(e.container())?ic.insertInline(t,e.container()):ic.insertInline(t,e.getNode())},vc=function(e,t){var n=t.get();return n&&e.container()===n&&Zo.isCaretContainerInline(n)},yc=function(e,t){return t.fold(function(t){pc.remove(e.get());var n=ic.insertInlineBefore(t);return e.set(n),O.some(new $i(n,n.length-1))},function(t){return Ru.firstPositionIn(t).map(function(t){if(vc(t,e))return new $i(e.get(),1);pc.remove(e.get());var n=gc(t,!0);return e.set(n),new $i(n,1)})},function(t){return Ru.lastPositionIn(t).map(function(t){if(vc(t,e))return new $i(e.get(),e.get().length-1);pc.remove(e.get());var n=gc(t,!1);return e.set(n),new $i(n,n.length-1)})},function(t){pc.remove(e.get());var n=ic.insertInlineAfter(t);return e.set(n),O.some(new $i(n,1))})},bc=function(e){return e&&/^(IMG)$/.test(e.nodeName)},Cc=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},xc=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},wc={isInlineBlock:bc,moveStart:function(e,t,n){var r,o,i,a=n.startContainer,u=n.startOffset;if((n.startContainer!==n.endContainer||!bc(n.startContainer.childNodes[n.startOffset]))&&(3===a.nodeType&&u>=a.nodeValue.length&&(u=e.nodeIndex(a),a=a.parentNode),1===a.nodeType))for(u<(i=a.childNodes).length?(a=i[u],r=new Xr(a,e.getParent(a,e.isBlock))):(a=i[i.length-1],(r=new Xr(a,e.getParent(a,e.isBlock))).next(!0)),o=r.current();o;o=r.next())if(3===o.nodeType&&!Cc(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||!Cc(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:Cc,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 e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},normalizeStyleValue:xc,getStyle:function(e,t,n){return xc(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())}},Nc=iu,Sc=wc.getParents,Ec=wc.isWhiteSpaceNode,kc=wc.isTextBlock,Tc=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}},Ac=function(e){return"BR"===e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling},_c=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},Rc=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("\xa0",r))?o:i)||t||o++:(o=a.indexOf(" ",r),i=a.indexOf("\xa0",r),o=-1!==o&&(-1===i||o<i)?o:i),o},Bc=function(e,t,n,r,o,i){var a,u,s,c;if(3===n.nodeType){if(-1!==(s=Rc(o,i,n,r)))return{container:n,offset:s};c=n}for(a=new Xr(n,e.getParent(n,e.isBlock)||t);u=a[o?"prev":"next"]();)if(3===u.nodeType){if(c=u,-1!==(s=Rc(o,i,u)))return{container:u,offset:s}}else if(e.isBlock(u))break;if(c)return r=o?0:c.length,{container:c,offset:r}},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=Sc(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},Oc=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&&kc(e,t)},u)}if(o&&t[0].wrapper&&(o=Sc(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!wc.isEq(o,"br")););return o||n},Pc=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&&!Ec(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(!Nc(c)&&!Ec(c)&&!Ac(c))return s;if(s===f||s.parentNode===f){u=s;break}s=s.parentNode}return u},Ic=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=Ei(i,a)).nodeType&&(a=0),1===u.nodeType&&u.hasChildNodes()&&3===(u=Ei(u,t.collapsed?s:s-1)).nodeType&&(s=u.nodeValue.length),i=_c(c,i),u=_c(c,u),(Nc(i.parentNode)||Nc(i))&&3===(i=(i=Nc(i)?i:i.parentNode).nextSibling||i).nodeType&&(a=0),(Nc(u.parentNode)||Nc(u))&&3===(u=(u=Nc(u)?u:u.parentNode).previousSibling||u).nodeType&&(s=u.length),n[0].inline&&(t.collapsed&&((o=Bc(c,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=Bc(c,e.getBody(),u,s,!1,r))&&(u=o.container,s=o.offset)),u=r?u:function(e,t){var n=Tc(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=Tc(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=Pc(c,n,i,a,u,s,!0)),n[0].inline&&3===u.nodeType&&s!==u.nodeValue.length||(u=Pc(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=Oc(e,n,i,"previousSibling"),u=Oc(e,n,u,"nextSibling"),n[0].block&&(c.isBlock(i)||(i=Pc(c,n,i,a,u,s,!0)),c.isBlock(u)||(u=Pc(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}},Lc=wc.isEq,Mc=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},Fc=function(e,t,n,r){var o=e.dom.getRoot();return t!==o&&(t=e.dom.getParent(t,function(t){return!!Mc(e,t,n)||(t.parentNode===o||!!Vc(e,t,n,r,!0))}),Vc(e,t,n,r))},zc=function(e,t,n){return!!Lc(t,n.inline)||(!!Lc(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0))},Uc=function(e,t,n,r,o,i){var a,u,s,c=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(c)if("undefined"==typeof c.length){for(a in c)if(c.hasOwnProperty(a)){if(u="attributes"===r?e.getAttrib(t,a):wc.getStyle(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!Lc(u,wc.normalizeStyleValue(e,wc.replaceVars(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?e.getAttrib(t,c[s]):wc.getStyle(e,t,c[s]))return n;return n},Vc=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],zc(e.dom,t,i)&&Uc(l,t,i,"attributes",o,r)&&Uc(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}},Hc={matchNode:Vc,matchName:zc,match:function(e,t,n,r){var o;return r?Fc(e,r,t,n):(r=e.selection.getNode(),!!Fc(e,r,t,n)||!((o=e.selection.getStart())===r||!Fc(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]&&Vc(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=wc.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:Mc},qc=function(e,t){return e.splitText(t)},jc=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=qc(t,n)).previousSibling,o>n?(t=r=qc(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(ro.isText(t)&&n>0&&n<t.nodeValue.length&&(t=qc(t,n),n=0),ro.isText(r)&&o>0&&o<r.nodeValue.length&&(o=(r=qc(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},$c=jo,Wc="_mce_caret",Kc=function(e){return 1===e.nodeType&&e.id===Wc},Xc=function(e){return function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==$c||e.childNodes.length>1)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length>0},Yc=function(e){var t;if(e)for(e=(t=new Xr(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},Gc=function(e){var t=Bn.fromTag("span");return tr(t,{id:Wc,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&lu.append(t,Bn.fromText($c)),t},Jc=function(e,t){for(;t&&t!==e;){if(t.id===Wc)return t;t=t.parentNode}return null},Qc=function(e,t,n,r){var o,i,a;o=t.getRng(!0),i=e.getParent(n,e.isBlock),Xc(n)?(!1!==r&&(o.setStartBefore(n),o.setEndBefore(n)),e.remove(n)):(a=function(e){var t=Yc(e);return t&&t.nodeValue.charAt(0)===$c&&t.deleteData(0,1),t}(n),o.startContainer===a&&o.startOffset>0&&o.setStart(a,o.startOffset-1),o.endContainer===a&&o.endOffset>0&&o.setEnd(a,o.endOffset-1),e.remove(n,!0)),i&&e.isEmpty(i)&&bu(Bn.fromDom(i)),t.setRng(o)},Zc=function(e,t,n,r,o){if(r)Qc(t,n,r,o);else if(!(r=Jc(e,n.getStart())))for(;r=t.get(Wc);)Qc(t,n,r,!1)},el=function(e,t,n){var r=e.dom,o=r.getParent(n,Ri.curry(wc.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(yu(Bn.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},tl=function(e,t){return e.appendChild(t),t},nl=function(e,t){var n=W.foldr(e,function(e,t){return tl(e,t.cloneNode(!1))},t);return tl(n,n.ownerDocument.createTextNode($c))},rl=function(e){var t=e.dom,n=e.selection,r=e.getBody();e.on("mouseup keydown",function(e){!function(e,t,n,r){Zc(e,t,n,null,!1),8===r&&n.isCollapsed()&&n.getStart().innerHTML===$c&&Zc(e,t,n,Jc(e,n.getStart())),37!==r&&39!==r||Zc(e,t,n,Jc(e,n.getStart()))}(r,t,n,e.keyCode)})},ol=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=Jc(e.getBody(),c.getStart()))&&(i=Yc(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=Ic(e,r,e.formatter.get(t)),r=jc(r),e.formatter.apply(t,n,r),c.moveToBookmark(u)):(o&&i.nodeValue===$c?e.formatter.apply(t,n,o):(i=(o=function(e,t){return e.importNode(t,!0)}(e.getDoc(),Gc(!0).dom())).firstChild,r.insertNode(o),a=1,e.formatter.apply(t,n,o)),c.setCursorLocation(i,a))},il=function(e,t,n,r){var o,i,a,u,s,c,l,f=e.dom,d=e.selection,m=d.getRng(!0),h=[];for(o=m.startContainer,i=m.startOffset,s=o,3===o.nodeType&&(i!==o.nodeValue.length&&(u=!0),s=s.parentNode);s;){if(Hc.matchNode(e,s,t,n,r)){c=s;break}s.nextSibling&&(u=!0),h.push(s),s=s.parentNode}if(c)if(u)a=d.getBookmark(),m.collapse(!0),m=Ic(e,m,e.formatter.get(t),!0),m=jc(m),e.formatter.remove(t,n,m),d.moveToBookmark(a);else{l=Jc(e.getBody(),c);var p=Gc(!1).dom(),g=nl(h,p);el(e,p,l||c),Qc(f,d,l,!1),d.setCursorLocation(g,1),f.isEmpty(c)&&f.remove(c)}},al=Kc,ul=Jc,sl=function(e,t){var n=Gc(!1),r=nl(t,n.dom());return lu.before(Bn.fromDom(e),n),hu.remove(Bn.fromDom(e)),$i(r,0)},cl=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(Hn.name(t))&&!Kc(t.dom())&&!ro.isBogus(t.dom())},ll=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return O.none()},fl=Ps([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),dl=function(e,t){var n=fa.getParentBlock(t,e);return n||e},ml=function(e,t,n){var r=Zu.normalizeForwards(n),o=dl(t,r.container());return Zu.findRootInline(e,o,r).fold(function(){return Ru.nextPosition(o,r).bind(T.curry(Zu.findRootInline,e,o)).map(function(e){return fl.before(e)})},O.none)},hl=function(e,t){return null===ul(e,t)},pl=function(e,t,n){return Zu.findRootInline(e,t,n).filter(T.curry(hl,t))},gl=function(e,t,n){var r=Zu.normalizeBackwards(n);return pl(e,t,r).bind(function(e){return Ru.prevPosition(e,r).isNone()?O.some(fl.start(e)):O.none()})},vl=function(e,t,n){var r=Zu.normalizeForwards(n);return pl(e,t,r).bind(function(e){return Ru.nextPosition(e,r).isNone()?O.some(fl.end(e)):O.none()})},yl=function(e,t,n){var r=Zu.normalizeBackwards(n),o=dl(t,r.container());return Zu.findRootInline(e,o,r).fold(function(){return Ru.prevPosition(o,r).bind(T.curry(Zu.findRootInline,e,o)).map(function(e){return fl.after(e)})},O.none)},bl=function(e){return!1===Zu.isRtl(xl(e))},Cl=function(e,t,n){return ll([ml,gl,vl,yl],[e,t,n]).filter(bl)},xl=function(e){return e.fold(T.identity,T.identity,T.identity,T.identity)},wl=function(e){return e.fold(T.constant("before"),T.constant("start"),T.constant("end"),T.constant("after"))},Nl=function(e){return e.fold(fl.before,fl.before,fl.after,fl.after)},Sl=function(e,t,n,r,o,i){return Qa([Zu.findRootInline(t,n,r),Zu.findRootInline(t,n,o)],function(t,r){return t!==r&&Zu.hasSameParentBlock(n,t,r)?fl.after(e?t:r):i}).getOr(i)},El=function(e,t){return e.fold(T.constant(!0),function(e){return!function(e,t){return wl(e)===wl(t)&&xl(e)===xl(t)}(e,t)})},kl=function(e,t){return e?t.fold(T.compose(O.some,fl.start),O.none,T.compose(O.some,fl.after),O.none):t.fold(O.none,T.compose(O.some,fl.before),O.none,T.compose(O.some,fl.end))},Tl=function(e,t,n,r){var o=Zu.normalizePosition(e,r),i=Cl(t,n,o);return Cl(t,n,o).bind(T.curry(kl,e)).orThunk(function(){return function(e,t,n,r,o){var i=Zu.normalizePosition(e,o);return Ru.fromPosition(e,n,i).map(T.curry(Zu.normalizePosition,e)).fold(function(){return r.map(Nl)},function(o){return Cl(t,n,o).map(T.curry(Sl,e,t,n,i,o)).filter(T.curry(El,r))}).filter(bl)}(e,t,n,i,r)})},Al=Cl,_l=Tl,Rl=(T.curry(Tl,!1),T.curry(Tl,!0),Nl),Bl=function(e){return e.fold(fl.start,fl.start,fl.end,fl.end)},Dl=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Dl(n())}}},Ol=function(e){return jn.isFunction(e.selection.getSel().modify)},Pl=function(e,t,n){var r=e?1:-1;return t.setRng($i(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},Il=function(e,t){var n=t.selection.getRng(),r=e?$i.fromRangeEnd(n):$i.fromRangeStart(n);return!!Ol(t)&&(e&&Zo.isBeforeInline(r)?Pl(!0,t.selection,r):!(e||!Zo.isAfterInline(r))&&Pl(!1,t.selection,r))},Ll=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},Ml=function(e){return!1!==e.settings.inline_boundaries},Fl=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},zl=function(e,t,n){return yc(t,n).map(function(t){return Ll(e,t),n})},Ul=function(e,t,n){return function(){return!!Ml(t)&&Il(e,t)}},Vl={move:function(e,t,n){return function(){return!!Ml(e)&&function(e,t,n){var r=e.getBody(),o=$i.fromRangeStart(e.selection.getRng()),i=T.curry(Zu.isInlineTarget,e);return _l(n,i,r,o).bind(function(n){return zl(e,t,n)})}(e,t,n).isSome()}},moveNextWord:T.curry(Ul,!0),movePrevWord:T.curry(Ul,!1),setupSelectedState:function(e){var t=new Dl(null),n=T.curry(Zu.isInlineTarget,e);return e.on("NodeChange",function(r){Ml(e)&&(function(e,t,n){var r=W.filter(t.select('*[data-mce-selected="inline-boundary"]'),e),o=W.filter(n,e);W.each(W.difference(r,o),T.curry(Fl,!1)),W.each(W.difference(o,r),T.curry(Fl,!0))}(n,e.dom,r.parents),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=$i.fromRangeStart(e.selection.getRng());$i.isTextPosition(n)&&!1===Zu.isAtZwsp(n)&&(Ll(e,pc.removeAndReposition(t.get(),n)),t.set(null))}}(e,t),function(e,t,n,r){if(t.selection.isCollapsed()){var o=W.filter(r,e);W.each(o,function(r){var o=$i.fromRangeStart(t.selection.getRng());Al(e,t.getBody(),o).bind(function(e){return zl(t,n,e)})})}}(n,e,t,r.parents))}),t},setCaretPosition:Ll},Hl=function(e,t){return function(n){return yc(t,n).map(function(t){return Vl.setCaretPosition(e,t),!0}).getOr(!1)}},ql=function(e,t,n,r){var o=e.getBody(),i=T.curry(Zu.isInlineTarget,e);e.undoManager.ignore(function(){e.selection.setRng(function(e,t){var n=document.createRange();return n.setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n}(n,r)),e.execCommand("Delete"),Al(i,o,$i.fromRangeStart(e.selection.getRng())).map(Bl).map(Hl(e,t))}),e.nodeChanged()},jl=function(e,t,n,r){var o=function(e,t){var n=fa.getParentBlock(t,e);return n||e}(e.getBody(),r.container()),i=T.curry(Zu.isInlineTarget,e),a=Al(i,o,r);return a.bind(function(e){return n?e.fold(T.constant(O.some(Bl(e))),O.none,T.constant(O.some(Rl(e))),O.none):e.fold(O.none,T.constant(O.some(Rl(e))),O.none,T.constant(O.some(Bl(e))))}).map(Hl(e,t)).getOrThunk(function(){var u=Ru.navigate(n,o,r),s=u.bind(function(e){return Al(i,o,e)});return a.isSome()&&s.isSome()?Zu.findRootInline(i,o,r).map(function(t){return!!function(e){return Qa([Ru.firstPositionIn(e),Ru.lastPositionIn(e)],function(t,n){var r=Zu.normalizePosition(!0,t),o=Zu.normalizePosition(!1,n);return Ru.nextPosition(e,r).map(function(e){return e.isEqual(o)}).getOr(!0)}).getOr(!0)}(t)&&(Ys(e,n,Bn.fromDom(t)),!0)}).getOr(!1):s.bind(function(o){return u.map(function(o){return n?ql(e,t,r,o):ql(e,t,o,r),!0})}).getOr(!1)})},$l=function(e,t,n){if(e.selection.isCollapsed()&&function(e){return!1!==e.settings.inline_boundaries}(e)){var r=$i.fromRangeStart(e.selection.getRng());return jl(e,t,n,r)}return!1},Wl=dr("start","end"),Kl=dr("rng","table","cells"),Xl=Ps([{removeTable:["element"]},{emptyCells:["cells"]}]),Yl=function(e,t){return as(Bn.fromDom(e),"td,th",t)},Gl=function(e,t){return os(e,"table",t)},Jl=function(e){return!1===Er.eq(e.start(),e.end())},Ql=function(e,t){return function(e,t){return Gl(e.start(),t).bind(function(n){return Gl(e.end(),t).bind(function(e){return Er.eq(n,e)?O.some(n):O.none()})})}(e,t).bind(function(t){var n=vu(t,"td,th");return Kl(e,t,n)})},Zl=function(e,t){var n=T.curry(Er.eq,e);return function(e,t){return Qa([Yl(e.startContainer,t),Yl(e.endContainer,t)],Wl).filter(Jl)}(t,n).map(function(e){return Ql(e,n)})},ef=function(e,t){return W.findIndex(e,function(e){return Er.eq(e,t)})},tf=function(e){return function(e){return Qa([ef(e.cells(),e.rng().start()),ef(e.cells(),e.rng().end())],function(t,n){return e.cells().slice(t,n+1)})}(e).bind(function(t){var n=e.cells();return t.length===n.length?Xl.removeTable(e.table()):Xl.emptyCells(t)})},nf=function(e,t){return Zl(e,t).map(tf)},rf=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},of=rf,af=function(e){return W.bind(e,function(e){var t=Si(e);return t?[Bn.fromDom(t)]:[]})},uf=function(e){return rf(e).length>1},sf=function(e){return W.filter(af(e),Qr.isTableCell)},cf=function(e){return vu(e,"td[data-mce-selected],th[data-mce-selected]")},lf=function(e,t){var n=cf(t),r=sf(e);return n.length>0?n:r},ff=lf,df=function(e){return lf(of(e.selection.getSel()),Bn.fromDom(e.getBody()))},mf=function(e,t){return W.each(t,bu),e.selection.setCursorLocation(t[0].dom(),0),!0},hf=function(e,t){return Ys(e,!1,t),!0},pf=function(e,t,n,r){return vf(t,r).fold(function(){return function(e,t,n){return nf(t,n).map(function(t){return t.fold(T.curry(hf,e),T.curry(mf,e))})}(e,t,n)},function(t){return function(e,t){return yf(e,t)}(e,t)}).getOr(!1)},gf=function(e,t){return W.find(ws(t,e),Qr.isTableCell)},vf=function(e,t){return W.find(ws(t,e),function(e){return"caption"===Hn.name(e)})},yf=function(e,t){return bu(t),e.selection.setCursorLocation(t.dom(),0),O.some(!0)},bf=function(e,t,n,r,o){return Ru.navigate(n,e.getBody(),o).bind(function(i){return function(e,t,n,r){return Ru.firstPositionIn(e.dom()).bind(function(o){return Ru.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 yf(e,t)}(e,r):function(e,t,n){return vf(e,Bn.fromDom(n.getNode())).map(function(e){return!1===Er.eq(e,t)})}(t,r,i)}).or(O.some(!0))},Cf=function(e,t,n,r){var o=$i.fromRangeStart(e.selection.getRng());return gf(n,r).bind(function(r){return ms(r)?yf(e,r):function(e,t,n,r,o){return Ru.navigate(n,e.getBody(),o).bind(function(e){return gf(t,Bn.fromDom(e.getNode())).map(function(e){return!1===Er.eq(e,r)})})}(e,n,t,r,o)})},xf=function(e,t,n){var r=Bn.fromDom(e.getBody());return vf(r,n).fold(function(){return Cf(e,t,r,n)},function(n){return function(e,t,n,r){var o=$i.fromRangeStart(e.selection.getRng());return ms(r)?yf(e,r):bf(e,n,t,r,o)}(e,t,r,n)}).getOr(!1)},wf=function(e,t){var n=Bn.fromDom(e.selection.getStart(!0));return e.selection.isCollapsed()?xf(e,t,n):function(e,t){var n=Bn.fromDom(e.getBody()),r=e.selection.getRng(),o=df(e);return 0!==o.length?mf(e,o):pf(e,n,r,t)}(e,n)},Nf=function(e,t){e.getDoc().execCommand(t,!1,null)},Sf=function(e){Qs(e,!1)||$l(e,!1)||_s(e,!1)||wf(e)||Os(e,!1)||(Nf(e,"Delete"),ts(e))},Ef=function(e){Qs(e,!0)||$l(e,!0)||_s(e,!0)||wf(e)||Os(e,!0)||Nf(e,"ForwardDelete")},kf=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},Tf=dr("container","offset"),Af=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)},_f=function(e,t,n){return Af(e,t,function(e){return e.nodeName===n})},Rf=function(e){return e&&"TABLE"===e.nodeName},Bf=function(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)},Df=function(e,t){return Zo.isCaretContainer(e)&&!1===Af(e,t,al)},Of=function(e,t,n){for(var r=new Xr(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(ro.isBr(t))return!0},Pf=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 O.some(Tf(o.parentNode,e.nodeIndex(o)));for(i=new Xr(o,u);s=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(s)||Df(s,c))return O.none();if(ro.isText(s)&&s.nodeValue.length>0)return!1===_f(s,c,"A")?O.some(Tf(s,r?s.nodeValue.length:0)):O.none();if(e.isBlock(s)||l[s.nodeName.toLowerCase()])return O.none();a=s}return n&&a?O.some(Tf(a,0)):O.none()},If=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,Zo.isCaretContainer(o))return O.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(Zo.isCaretContainer(u))return O.none();if(s[u.nodeName]||Rf(u))return O.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&&Rf(o))return O.none();if(function(e,t){for(;t&&t!==e;){if(ro.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(f,o)||Zo.isCaretContainer(o))return O.none();if(o.hasChildNodes()&&!1===Rf(o)){u=o,a=new Xr(o,f);do{if(ro.isContentEditableFalse(u)||Zo.isCaretContainer(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()]&&!Bf(u)){i=e.nodeIndex(u),o=u.parentNode,"IMG"!==u.nodeName&&"PRE"!==u.nodeName||c||i++,d=!0;break}}while(u=c?a.next():a.prev())}}}return t&&(ro.isText(o)&&0===i&&Pf(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")||Of(e,u,!1)||Of(e,u,!0)||Pf(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&&Pf(e,l,t,!1,o).each(function(e){o=e.container(),i=e.offset(),d=!0}),d?O.some(Tf(o,i)):O.none()},Lf=function(e,t){var n=t.collapsed,r=t.cloneRange();return If(e,n,!0,r).each(function(e){r.setStart(e.container(),e.offset())}),n||If(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),kf(t,r)?O.none():O.some(r)},Mf=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},Ff=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)},zf=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng(!0);Lf(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 Xr(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"),a.insertNode(n),Mf(i,o,n),Ff(i,o,n,r),e.undoManager.add()},Uf=function(e,t){var n=Bn.fromTag("br");lu.before(Bn.fromDom(t),n),e.undoManager.add()},Vf=function(e,t){Hf(e.getBody(),t)||lu.after(Bn.fromDom(t),Bn.fromTag("br"));var n=Bn.fromTag("br");lu.after(Bn.fromDom(t),n),Mf(e.dom,e.selection,n.dom()),Ff(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},Hf=function(e,t){return!!function(e){return ro.isBr(e.getNode())}($i.after(t))||Ru.nextPosition(e,$i.after(t)).map(function(e){return ro.isBr(e.getNode())}).getOr(!1)},qf=function(e){return e&&"A"===e.nodeName&&"href"in e},jf=function(e){return e.fold(T.constant(!1),qf,qf,T.constant(!1))},$f=function(e,t){t.fold(T.noop,T.curry(Uf,e),T.curry(Vf,e),T.noop)},Wf=function(e,t){var n=function(e){var t=T.curry(Zu.isInlineTarget,e),n=$i.fromRangeStart(e.selection.getRng());return Al(t,e.getBody(),n).filter(jf)}(e);n.isSome()?n.each(T.curry($f,e)):zf(e,t)},Kf=Ps([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Xf=(Kf.before,Kf.on,Kf.after,function(e){return e.fold(T.identity,T.identity,T.identity)}),Yf=Ps([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Gf=dr("start","soffset","finish","foffset"),Jf={domRange:Yf.domRange,relative:Yf.relative,exact:Yf.exact,exactFromRange:function(e){return Yf.exact(e.start(),e.soffset(),e.finish(),e.foffset())},range:Gf,getWin:function(e){var t=function(e){return e.match({domRange:function(e){return Bn.fromDom(e.startContainer)},relative:function(e,t){return Xf(e)},exact:function(e,t,n,r){return e}})}(e);return Or.defaultView(t)}},Qf=_n.detect().browser,Zf=function(e,t){var n=Hn.isText(t)?gu(t).length:Or.children(t).length+1;return e>n?n:e<0?0:e},ed=function(e){return Jf.range(e.start(),Zf(e.soffset(),e.start()),e.finish(),Zf(e.foffset(),e.finish()))},td=function(e,t){return Er.contains(e,t)||Er.eq(e,t)},nd=function(e){return function(t){return td(e,t.start())&&td(e,t.finish())}},rd=function(e){return!0===e.inline||Qf.isIE()},od=function(e){return Jf.range(Bn.fromDom(e.startContainer),e.startOffset,Bn.fromDom(e.endContainer),e.endOffset)},id=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?O.from(t.getRangeAt(0)):O.none()).map(od)},ad=function(e){var t=Or.defaultView(e);return id(t.dom()).filter(nd(e))},ud=function(e,t){return O.from(t).filter(nd(e)).map(ed)},sd=function(e){var t=document.createRange();return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),O.some(t)},cd=function(e){return(e.bookmark?e.bookmark:O.none()).bind(T.curry(ud,Bn.fromDom(e.getBody()))).bind(sd)},ld=function(e){var t=rd(e)?ad(Bn.fromDom(e.getBody())):O.none();e.bookmark=t.isSome()?t:e.bookmark},fd=function(e){cd(e).each(function(t){e.selection.setRng(t)})},dd=cd,md=At.each,hd=At.extend,pd=At.map,gd=At.inArray,vd=At.explode,yd=function(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(r){}return!1}},s=function(e,t){t=t||"exec",md(e,function(e,n){md(n.toLowerCase().split(","),function(n){i[t][n]=e})})};hd(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?fd(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(md(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(c){}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(r){}}},queryCommandSupported:function(t){if(t=t.toLowerCase(),i.exec[t])return!0;try{return e.getDoc().queryCommandSupported(t)}catch(n){}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:function(t,n,r){t=t.toLowerCase(),i.value[t]=function(){return n.call(r||e)}},hasCustomCommand:function(e){return e=e.toLowerCase(),!!i.exec[e]}});var c=function(t,n,r){return n===undefined&&(n=!1),r===undefined&&(r=null),e.getDoc().execCommand(t,n,r)},l=function(e){return r.match(e)},f=function(t,n){r.toggle(t,n?{value:n}:undefined),e.nodeChanged()},d=function(e){o=n.getBookmark(e)},m=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{c(t)}catch(i){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.");oe.mac&&(o=o.replace(/Ctrl\+/g,"\u2318+")),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"),md("left,center,right,justify".split(","),function(e){t!==e&&r.remove("align"+e)}),"none"!==t&&f("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var r,o;c(e),(r=t.getParent(n.getNode(),"ol,ul"))&&(o=r.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(o.nodeName)&&(d(),t.split(o,r),m()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){f(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){f(e,n)},FontSize:function(e,t,n){var r,o;n>=1&&n<=7&&(o=vd(a.font_size_style_values),n=(r=vd(a.font_size_classes))?r[n-1]||n:o[n-1]||n),f(e,n)},RemoveFormat:function(e){r.remove(e)},mceBlockQuote:function(){f("blockquote")},FormatBlock:function(e,t,n){return f(n||"p")},mceCleanup:function(){var t=n.getBookmark();e.setContent(e.getContent({cleanup:!0}),{cleanup:!0}),n.moveToBookmark(t)},mceRemoveNode:function(t,r,o){var i=o||n.getNode();i!==e.getBody()&&(d(),e.dom.remove(i,!0),m())},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){Iu(e,r)},mceInsertRawHTML:function(t,r,o){n.setContent("tiny_mce_marker"),e.setContent(e.getContent().replace(/tiny_mce_marker/g,function(){return o}))},mceToggleFormat:function(e,t,n){f(n)},mceSetContent:function(t,n,r){e.setContent(r)},"Indent,Outdent":function(o){var i,s,l;i=a.indentation,s=/[a-z%]+$/i.exec(i),i=parseInt(i,10),u("InsertUnorderedList")||u("InsertOrderedList")?c(o):(a.forced_root_block||t.getParent(n.getNode(),t.isBlock)||r.apply("div"),md(n.getSelectedBlocks(),function(n){if("false"!==t.getContentEditable(n)&&"LI"!==n.nodeName){var r=e.getParam("indent_use_margin",!1)?"margin":"padding";r="TABLE"===n.nodeName?"margin":r,r+="rtl"===t.getStyle(n,"direction",!0)?"Right":"Left","outdent"===o?(l=Math.max(0,parseInt(n.style[r]||0,10)-i),t.setStyle(n,r,l?l+s:"")):(l=parseInt(n.style[r]||0,10)+i+s,t.setStyle(n,r,l))}}))},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(){Sf(e)},forwardDelete:function(){Ef(e)},mceNewDocument:function(){e.setContent("")},InsertLineBreak:function(t,n,r){return Wf(e,r),!0}}),s({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var o="align"+e.substring(7),i=n.isCollapsed()?[t.getParent(n.getNode(),t.isBlock)]:n.getSelectedBlocks(),a=pd(i,function(e){return!!r.matchNode(e,o)});return-1!==gd(a,!0)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return l(e)},mceBlockQuote:function(){return l("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({"FontSize,FontName":function(e){var r,o=0;return(r=t.getParent(n.getNode(),"span"))&&(o="fontsize"===e?r.style.fontSize:r.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),o}},"value"),s({Undo:function(){e.undoManager.undo()},Redo:function(){e.undoManager.redo()}})},bd=At.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"," "),Cd=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&&At.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||{},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)}};Cd.isNative=function(e){return!!bd[e.toLowerCase()]};var xd,wd=function(e){return e._eventDispatcher||(e._eventDispatcher=new Cd({scope:e,toggleEvent:function(t,n){Cd.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,n)}})),e._eventDispatcher},Nd={fire:function(e,t,n){if(this.removed&&"remove"!==e)return t;if(t=wd(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 wd(this).on(e,t,n)},off:function(e,t){return wd(this).off(e,t)},once:function(e,t){return wd(this).once(e,t)},hasEventListeners:function(e){return wd(this).has(e)}},Sd=Io.DOM,Ed=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=Sd.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},kd=function(e,t){var n,r,o=function(e){return!e.hidden&&!e.readonly};if(e.delegates||(e.delegates={}),!e.delegates[t]&&!e.removed)if(n=Ed(e,t),e.settings.event_root){if(xd||(xd={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&xd){for(t in xd)e.dom.unbind(Ed(e,t));xd=null}})),xd[t])return;r=function(n){for(var r=n.target,i=e.editorManager.get(),a=i.length;a--;){var u=i[a].getBody();(u===r||Sd.isChildOf(r,u))&&o(i[a])&&i[a].fire(t,n)}},xd[t]=r,Sd.bind(n,t,r)}else r=function(n){o(e)&&e.fire(t,n)},Sd.bind(n,t,r),e.delegates[t]=r},Td={bindPendingEventDelegates:function(){var e=this;At.each(e._pendingNativeEvents,function(t){kd(e,t)})},toggleNativeEvent:function(e,t){"focus"!==e&&"blur"!==e&&(t?this.initialized?kd(this,e):this._pendingNativeEvents?this._pendingNativeEvents.push(e):this._pendingNativeEvents=[e]:this.initialized&&(this.dom.unbind(Ed(this,e),e,this.delegates[e]),delete this.delegates[e]))},unbindAllNativeEvents:function(){var e;if(this.delegates){for(e in this.delegates)this.dom.unbind(Ed(this,e),e,this.delegates[e]);delete this.delegates}this.inline||(this.getBody().onload=null,this.dom.unbind(this.getWin()),this.dom.unbind(this.getDoc())),this.dom.unbind(this.getBody()),this.dom.unbind(this.getContainer())}},Ad=Td=At.extend({},Nd,Td),_d=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},Rd=function(e,t){e._clickBlocker&&(e._clickBlocker.unbind(),e._clickBlocker=null),t?(e._clickBlocker=function(e){var t,n;return t=e.getBody(),n=function(t){e.dom.getParents(t.target,"a").length>0&&t.preventDefault()},e.dom.bind(t,"click",n),{unbind:function(){e.dom.unbind(t,"click",n)}}}(e),e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable=!1):(e.readonly=!1,e.getBody().contentEditable=!0,_d(e,"StyleWithCSS",!1),_d(e,"enableInlineTableEditing",!1),_d(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},Bd=function(e,t){var n=e.readonly?"readonly":"design";t!==n&&(e.initialized?Rd(e,"readonly"===t):e.on("init",function(){Rd(e,"readonly"===t)}),e.fire("SwitchMode",{mode:t}))},Dd=At.each,Od=At.explode,Pd={f9:120,f10:121,f11:122},Id=At.makeMap("alt,ctrl,shift,meta,access"),Ld=function(e){var t={},n=[],r=function(e){var t,n,r={};Dd(Od(e,"+"),function(e){e in Id?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=Pd[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode];for(n in Id)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,oe.mac?r.ctrl=!0:r.shift=!0),r.meta&&(oe.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},o=function(t,n,o,i){var a;return a=At.map(Od(t,">"),r),a[a.length-1]=At.extend(a[a.length-1],{func:o,scope:i||e}),At.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()||(Dd(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)}:At.isArray(u)&&(i=function(){e.execCommand(u[0],u[1],u[2])}),Dd(Od(At.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)}},Md=At.each,Fd=function(e){return e.replace(/<!--|-->/g,"")},zd=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},Ud=function(e,t){var n=this;e=e||{},n.schema=t=t||Eo(),!1!==e.fix_self_closing&&(e.fix_self_closing=!0),Md("comment cdata text start end pi doctype".split(" "),function(t){t&&(n[t]=e[t]||function(){})}),n.parse=function(n){var r,o,i,a,u,s,c,l,f,d,m,h,p,g,v,y,b,C,x,w,N,S,E,k,T,A,_,R,B,D=this,O=0,P=[],I=0,L=po.decode,M=At.makeMap("src,href,data,background,formaction,poster"),F=/((java|vb)script|mhtml):/i,z=/^data:/i,U=function(e){var t,n;for(t=P.length;t--&&P[t].name!==e;);if(t>=0){for(n=P.length-1;n>=t;n--)(e=P[n]).valid&&D.end(e.name);P.length=t}},V=function(t,n,r,o,i){var u,s;if(n=n.toLowerCase(),r=n in m?n:L(r||o||i||""),p&&!l&&!1===function(e){return 0===e.indexOf("data-")||0===e.indexOf("aria-")}(n)){if(!(u=C[n])&&x){for(s=x.length;s--&&!(u=x[s]).pattern.test(n););-1===s&&(u=null)}if(!u)return;if(u.validValues&&!(r in u.validValues))return}if(M[n]&&!e.allow_script_urls){var c=r.replace(/[\s\u0000-\u001F]+/g,"");try{c=decodeURIComponent(c)}catch(f){c=unescape(c)}if(F.test(c))return;if(!e.allow_html_data_urls&&z.test(c)&&!/^data:image\//i.test(c))return}l&&(n in M||0===n.indexOf("on"))||(a.map[n]=r,a.push({name:n,value:r}))};for(T=new RegExp("<(?:(?:!--([\\w\\W]*?)--\x3e)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),A=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,d=t.getShortEndedElements(),k=e.self_closing_elements||t.getSelfClosingElements(),m=t.getBoolAttrs(),p=e.validate,f=e.remove_internals,B=e.fix_self_closing,_=t.getSpecialElements(),E=n+">";r=T.exec(E);){if(O<r.index&&D.text(L(n.substr(O,r.index-O))),o=r[6])":"===(o=o.toLowerCase()).charAt(0)&&(o=o.substr(1)),U(o);else if(o=r[7]){if(r.index+r[0].length>n.length){D.text(L(n.substr(r.index))),O=r.index+r[0].length;continue}if(":"===(o=o.toLowerCase()).charAt(0)&&(o=o.substr(1)),h=o in d,B&&k[o]&&P.length>0&&P[P.length-1].name===o&&U(o),!p||(g=t.getElementRule(o))){if(v=!0,p&&(C=g.attributes,x=g.attributePatterns),(b=r[8])?((l=-1!==b.indexOf("data-mce-type"))&&f&&(v=!1),(a=[]).map={},b.replace(A,V)):(a=[]).map={},p&&!l){if(w=g.attributesRequired,N=g.attributesDefault,S=g.attributesForced,g.removeEmptyAttrs&&!a.length&&(v=!1),S)for(u=S.length;u--;)c=(y=S[u]).name,"{$uid}"===(R=y.value)&&(R="mce_"+I++),a.map[c]=R,a.push({name:c,value:R});if(N)for(u=N.length;u--;)(c=(y=N[u]).name)in a.map||("{$uid}"===(R=y.value)&&(R="mce_"+I++),a.map[c]=R,a.push({name:c,value:R}));if(w){for(u=w.length;u--&&!(w[u]in a.map););-1===u&&(v=!1)}if(y=a.map["data-mce-bogus"]){if("all"===y){O=zd(t,n,T.lastIndex),T.lastIndex=O;continue}v=!1}}v&&D.start(o,a,h)}else v=!1;if(i=_[o]){i.lastIndex=O=r.index+r[0].length,(r=i.exec(n))?(v&&(s=n.substr(O,r.index-O)),O=r.index+r[0].length):(s=n.substr(O),O=n.length),v&&(s.length>0&&D.text(s,!0),D.end(o)),T.lastIndex=O;continue}h||(b&&b.indexOf("/")===b.length-1?v&&D.end(o):P.push({name:o,valid:v}))}else(o=r[1])?(">"===o.charAt(0)&&(o=" "+o),e.allow_conditional_comments||"[if"!==o.substr(0,3).toLowerCase()||(o=" "+o),D.comment(o)):(o=r[2])?D.cdata(Fd(o)):(o=r[3])?D.doctype(o):(o=r[4])&&D.pi(o,r[5]);O=r.index+r[0].length}for(O<n.length&&D.text(L(n.substr(O))),u=P.length-1;u>=0;u--)(o=P[u]).valid&&D.end(o.name)}};Ud.findEndTag=zd;var Vd=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:Ud.findEndTag(c,u,r),u=u.substring(0,r-o)+u.substring(n),s.lastIndex=r-o;return u},Hd=function(e,t){return $o(Vd(e,t))},qd=Vd,jd=function(e){var t=e!==undefined?e.dom():document;return O.from(t.activeElement).map(Bn.fromDom)},$d=function(e){var t=Or.owner(e).dom();return e.dom()===t.activeElement},Wd=function(e){return jd(Or.owner(e)).filter(function(t){return e.dom().contains(t.dom())})},Kd=function(e,t){return function(e){return e.collapsed?O.from(Ei(e.startContainer,e.startOffset)).map(Bn.fromDom):O.none()}(t).bind(function(t){return Qr.isTableSection(t)?O.some(t):!1===Er.contains(e,t)?O.some(e):O.none()})},Xd=function(e,t){Kd(Bn.fromDom(e.getBody()),t).bind(function(e){return Ru.firstPositionIn(e.dom())}).fold(function(){e.selection.normalize()},function(t){e.selection.setRng(t.toRange())})},Yd=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},Gd=function(e){var t=e.getBody();return t&&function(e){return $d(e)||Wd(e).isSome()}(Bn.fromDom(t))},Jd=function(e){return e.inline?Gd(e):function(e){return e.iframeElement&&$d(Bn.fromDom(e.iframeElement))}(e)},Qd=function(e){e.editorManager.setActive(e)},Zd=function(e,t){e.removed||(t?Qd(e):function(e){var t,n=e.selection,r=e.settings.content_editable,o=e.getBody(),i=n.getRng();if(e.quirks.refreshContentEditable(),t=function(e,t){return e.dom.getParent(t,function(t){return"true"===e.dom.getContentEditable(t)})}(e,n.getNode()),e.$.contains(o,t))return Yd(t),Xd(e,i),void Qd(e);e.bookmark!==undefined&&!1===Jd(e)&&dd(e).each(function(t){e.selection.setRng(t),i=t}),r||(oe.opera||Yd(o),e.getWin().focus()),(oe.gecko||r)&&(Yd(o),Xd(e,i)),Qd(e)}(e))},em=Jd,tm=function(e,t){return t.dom()[e]},nm=function(e,t){return parseInt(fr(t,e),10)},rm=T.curry(tm,"clientWidth"),om=T.curry(tm,"clientHeight"),im=T.curry(nm,"margin-top"),am=T.curry(nm,"margin-left"),um=function(e,t,n){var r=Bn.fromDom(e.getBody()),o=e.inline?r:Or.documentElement(r),i=function(e,t,n,r){var o=function(e){return e.dom().getBoundingClientRect()}(t);return{x:n-(e?o.left+t.dom().clientLeft+am(t):0),y:r-(e?o.top+t.dom().clientTop+im(t):0)}}(e.inline,o,t,n);return function(e,t,n){var r=rm(e),o=om(e);return t>=0&&n>=0&&t<=r&&n<=o}(o,i.x,i.y)},sm=function(e){return function(e){return O.from(e).map(Bn.fromDom)}(e.inline?e.getBody():e.getContentAreaContainer()).map(function(e){return Er.contains(Or.owner(e),e)}).getOr(!1)},cm=function(e){var t=[],n=function(){var t=e.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():function(){var e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:e,close:e,reposition:e,getArgs:e}}()},r=function(){t.length>0&&n().reposition(t)},o=function(e){W.findIndex(t,function(t){return t===e}).each(function(e){t.splice(e,1)})},i=function(i){if(!e.removed&&sm(e))return W.find(t,function(e){return function(e,t){return!(e.type!==t.type||e.text!==t.text||e.progressBar||e.timeout||t.progressBar||t.timeout)}(n().getArgs(e),i)}).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(){ce.requestAnimationFrame(r)}),e.on("remove",function(){W.each(t,function(e){n().close(e)})})}(e),{open:i,close:function(){O.from(t[0]).each(function(e){n().close(e),o(e),r()})},getNotifications:function(){return t}}},lm=function(e){var t=[],n=function(){var t=e.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():function(){var e=function(){throw new Error("Theme did not provide a WindowManager implementation.")};return{open:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}}()},r=function(e,t){return function(){return t?t.apply(e,arguments):undefined}},o=function(n){t.push(n),function(t){e.fire("OpenWindow",{win:t})}(n)},i=function(n){W.findIndex(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 O.from(t[t.length-1])};return e.on("remove",function(){W.each(t.slice(0),function(e){n().close(e)})}),{windows:t,open:function(t,r){e.editorManager.setActive(e),ld(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}}},fm=Ho.PluginManager,dm=function(e,t){var n=function(e,t){for(var n in fm.urls)if(fm.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?"Failed to load plugin: "+n+" from url "+t:"Failed to load plugin url: "+t},mm=function(e,t){e.notificationManager.open({type:"error",text:t})},hm=function(e,t){e._skinLoaded?mm(e,t):e.on("SkinLoaded",function(){mm(e,t)})},pm=function(e,t){hm(e,dm(e,t))},gm=function(e,t){hm(e,"Failed to upload image: "+t)},vm=hm,ym=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,arguments):r.log.apply(r,arguments))},bm=Ho.PluginManager,Cm=Ho.ThemeManager,xm=function(){return new(G("XMLHttpRequest"))},wm=function(e,t){var n={},r=function(e,n,r,o){var i,a;(i=new xm).open("POST",t.url),i.withCredentials=t.credentials,i.upload.onprogress=function(e){o(e.loaded/e.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e;i.status<200||i.status>=300?r("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?n(function(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t}(t.basePath,e.location)):r("Invalid JSON: "+i.responseText)},(a=new FormData).append("file",e.blob(),e.filename()),i.send(a)},o=function(e,t){return{url:t,blobInfo:e,status:!0}},i=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},a=function(e,t){At.each(n[e],function(e){e(t)}),delete n[e]},u=function(r,u){return r=At.grep(r,function(t){return!e.isUploaded(t.blobUri())}),ie.all(At.map(r,function(r){return e.isPending(r.blobUri())?function(e){var t=e.blobUri();return new ie(function(e){n[t]=n[t]||[],n[t].push(e)})}(r):function(t,n,r){return e.markPending(t.blobUri()),new ie(function(u){var s;try{var c=function(){s&&s.close()};n(t,function(n){c(),e.markUploaded(t.blobUri(),n),a(t.blobUri(),o(t,n)),u(o(t,n))},function(n){c(),e.removeFailed(t.blobUri()),a(t.blobUri(),i(t,n)),u(i(t,n))},function(e){e<0||e>100||(s||(s=r()),s.progressBar.value(e))})}catch(l){u(i(t,l.message))}})}(r,t.handler,u)}))};return t=At.extend({credentials:!1,handler:r},t),{upload:function(e,n){return!t.url&&function(e){return e===r}(t.handler)?new ie(function(e){e([])}):u(e,n)}}},Nm=function(e,t){return new(G("Blob"))(e,t)},Sm=function(e){return G("atob")(e)},Em=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},km=function(e){return new ie(function(t){var n,r,o;e=Em(e);try{n=Sm(e.data)}catch(Gb){return void t(new Nm([]))}for(r=new function(e){return new(G("Uint8Array"))(e)}(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);t(new Nm([r],{type:e.type}))})},Tm=function(e){return 0===e.indexOf("blob:")?function(e){return new ie(function(t,n){var r=function(){n("Cannot convert "+e+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new xm;o.open("GET",e,!0),o.responseType="blob",o.onload=function(){200===this.status?t(this.response):r()},o.onerror=r,o.send()}catch(i){r()}})}(e):0===e.indexOf("data:")?km(e):null},Am=function(e){return new ie(function(t){var n=new function(){return new(G("FileReader"))};n.onloadend=function(){t(n.result)},n.readAsDataURL(e)})},_m=Em,Rm=0,Bm=function(e){return(e||"blobid")+Rm++},Dm=function(e,t){var n={};return{findAll:function(r,o){var i,a;return o||(o=Ri.constant(!0)),i=Nt.filter(function(e){return e?e.getElementsByTagName("img"):[]}(r),function(t){var n=t.src;return!!oe.fileApi&&!t.hasAttribute("data-mce-bogus")&&!t.hasAttribute("data-mce-placeholder")&&!(!n||n===oe.transparentSrc)&&(0===n.indexOf("blob:")?!e.isUploaded(n):0===n.indexOf("data:")&&o(t))}),a=Nt.map(i,function(e){var r;return n[e.src]?new ie(function(t){n[e.src].then(function(n){if("string"==typeof n)return n;t({image:e,blobInfo:n.blobInfo})})}):(r=new ie(function(n,r){!function(e,t,n,r){var o,i;0!==t.src.indexOf("blob:")?(o=_m(t.src).data,(i=e.findFirst(function(e){return e.base64()===o}))?n({image:t,blobInfo:i}):Tm(t.src).then(function(r){i=e.create(Bm(),r,o),e.add(i),n({image:t,blobInfo:i})},function(e){r(e)})):(i=e.getByUri(t.src))?n({image:t,blobInfo:i}):Tm(t.src).then(function(r){Am(r).then(function(a){o=_m(a).data,i=e.create(Bm(),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}),n[e.src]=r,r)}),ie.all(a)}}},Om=0,Pm=function(e){return e+Om+++function(){var e=function(){return Math.round(4294967295*Math.random()).toString(36)};return"s"+(new Date).getTime().toString(36)+e()+e()+e()}()},Im=function(e){var t,n,r=function(){var e=[],t=Ri.constant,n=function(e){var 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 n=e.id||Pm("blobid"),r=e.name||n,{id:t(n),name:t(r),filename:t(r+"."+function(e){return{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[e.toLowerCase()]||"dat"}(e.blob.type)),blob:t(e.blob),base64:t(e.base64),blobUri:t(e.blobUri||Q(e.blob)),uri:t(e.uri)}},r=function(e){return o(function(t){return t.id()===e})},o=function(t){return Nt.filter(e,t)[0]};return{create:function(e,t,r,o){return n("object"==typeof e?e:{id:e,name:o,blob:t,base64:r})},add:function(t){r(t.id())||e.push(t)},get:r,getByUri:function(e){return o(function(t){return t.blobUri()===e})},findFirst:o,removeByUri:function(t){e=Nt.filter(e,function(e){return e.blobUri()!==t||(Z(e.blobUri()),!1)})},destroy:function(){Nt.each(e,function(e){Z(e.blobUri())}),e=[]}}}(),o=e.settings,i=function(){var e={},t=function(e,t){return{status:e,resultUri:t}},n=function(t){return t in e};return{hasBlobUri:n,getResultUri:function(t){var n=e[t];return n?n.resultUri:null},isPending:function(t){return!!n(t)&&1===e[t].status},isUploaded:function(t){return!!n(t)&&2===e[t].status},markPending:function(n){e[n]=t(1,null)},markUploaded:function(n,r){e[n]=t(2,r)},removeFailed:function(t){delete e[t]},destroy:function(){e={}}}}(),a=function(t){return function(n){return e.selection?t(n):[]}},u=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},s=function(e,t,n){return e=u(e,'src="'+t+'"','src="'+n+'"'),e=u(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},c=function(t,n){Nt.each(e.undoManager.data,function(e){"fragmented"===e.type?e.fragments=Nt.map(e.fragments,function(e){return s(e,t,n)}):e.content=s(e.content,t,n)})},l=function(){return e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},f=function(t,n){r.removeByUri(t.src),c(t.src,n),e.$(t).attr({src:o.images_reuse_filename?n+"?"+(new Date).getTime():n,"data-mce-src":e.convertURL(n,"src")})},d=function(n){return t||(t=wm(i,{url:o.images_upload_url,basePath:o.images_upload_base_path,credentials:o.images_upload_credentials,handler:o.images_upload_handler})),p().then(a(function(r){var o;return o=Nt.map(r,function(e){return e.blobInfo}),t.upload(o,l).then(a(function(t){var o=Nt.map(t,function(t,n){var o=r[n].image;return t.status&&!1!==e.settings.images_replace_blob_uris?f(o,t.url):t.error&&gm(e,t.error),{element:o,status:t.status}});return n&&n(o),o}))}))},m=function(e){if(!1!==o.automatic_uploads)return d(e)},h=function(e){return!o.images_dataimg_filter||o.images_dataimg_filter(e)},p=function(){return n||(n=Dm(i,r)),n.findAll(e.getBody(),h).then(a(function(t){return t=Nt.filter(t,function(t){return"string"!=typeof t||(vm(e,t),!1)}),Nt.each(t,function(e){c(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),t}))},g=function(t){return t.replace(/src="(blob:[^"]+)"/g,function(t,n){var o=i.getResultUri(n);if(o)return'src="'+o+'"';var a=r.getByUri(n);return a||(a=Nt.reduce(e.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null)),a?'src="data:'+a.blob().type+";base64,"+a.base64()+'"':t})};return e.on("setContent",function(){!1!==e.settings.automatic_uploads?m():p()}),e.on("RawSaveContent",function(e){e.content=g(e.content)}),e.on("getContent",function(e){e.source_view||"raw"===e.format||(e.content=g(e.content))}),e.on("PostRender",function(){e.parser.addNodeFilter("img",function(e){Nt.each(e,function(e){var t=e.attr("src");if(!r.getByUri(t)){var n=i.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:r,uploadImages:d,uploadImagesAuto:m,scanForImages:p,destroy:function(){r.destroy(),i.destroy(),n=t=null}}},Lm=function(e,t){return e.hasOwnProperty(t.nodeName)},Mm=function(e,t){return!!ro.isText(t)||!!ro.isElement(t)&&(!Lm(e,t)&&!iu(t))},Fm=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.dom,h=e.selection,p=e.schema,g=p.getBlockElements(),v=h.getStart(),y=e.getBody();if(f=d.forced_root_block,v&&ro.isElement(v)&&f&&(l=y.nodeName.toLowerCase(),p.isValidChild(l,f.toLowerCase())&&!function(e,t,n){return W.exists(xs(Bn.fromDom(n),Bn.fromDom(t)),function(t){return Lm(e,t.dom())})}(g,y,v))){for(n=(t=h.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=em(e),v=y.firstChild;v;)if(Mm(g,v)){if(ro.isText(v)&&0===v.nodeValue.length){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())}},zm=function(e){e.settings.forced_root_block&&e.on("NodeChange",T.curry(Fm,e))},Um=function(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&&kf(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||!oe.range&&e.selection.isCollapsed()||!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()||("IMG"===e.selection.getNode().nodeName?ce.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))}},Vm=function(e){var t,n,r,o;return o=e.getBoundingClientRect(),t=e.ownerDocument,n=t.documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},Hm=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?Vm(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=Vm(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))},qm=ro.isContentEditableFalse,jm=ro.isContentEditableTrue,$m=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},Wm=function(e,t){return function(n){if(function(e){return 0===e.button}(n)){var r=Nt.find(t.dom.getParents(n.target),Ri.or(qm,jm));if(function(e,t){return qm(t)&&t!==e}(t.getBody(),r)){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)}}}},Km=function(e,t){return function(n){if(e.dragging&&function(e,t,n){return t!==n&&!e.dom.isChildOf(t,n)&&!qm(t)}(t,function(e){var t=e.getSel().getRangeAt(0).startContainer;return 3===t.nodeType?t.parentNode:t}(t.selection),e.element)){var r=function(e){var t=e.cloneNode(!0);return t.removeAttribute("data-mce-selected"),t}(e.element),o=t.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});o.isDefaultPrevented()||(r=o.targetClone,t.undoManager.transact(function(){$m(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret()}))}Xm(e)}},Xm=function(e){e.dragging=!1,e.element=null,$m(e.ghost)},Ym=function(e){var t,n,r,o,i,a,u={};t=Io.DOM,a=document,n=Wm(u,e),r=function(e,t){var n=ce.throttle(function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n)},0);return function(r){var o=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(function(e){return e.element}(e)&&!e.dragging&&o>10){if(t.fire("dragstart",{target:e.element}).isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){var i=function(e,t){return{pageX:t.pageX-e.relX,pageY:t.pageY+5}}(e,Hm(t,r));!function(e,t){e.parentNode!==t&&t.appendChild(e)}(e.ghost,t.getBody()),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,i,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY)}}}(u,e),o=Km(u,e),i=function(e,t){return function(){Xm(e),e.dragging&&t.fire("dragend")}}(u,e),e.on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},Gm=function(e){Ym(e),function(e){e.on("drop",function(t){var n="undefined"!=typeof t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(qm(n)||qm(e.dom.getContentEditableParent(n)))&&t.preventDefault()})}(e)},Jm=ro.isContentEditableFalse,Qm=function(e,t){var n,r,o=null,i=function(){!function(){var t,n,r,o,i;for(t=Kt("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,Zo.endsWithCaretContainer(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,Zo.startsWithCaretContainer(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(),r&&(pc.remove(r),r=null),o&&(o.remove(),o=null),clearInterval(n)},a=function(){n=ce.setInterval(function(){e.ownerDocument.activeElement===e?Kt("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):Kt("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")},500)};return{show:function(n,u){var s,c;return i(),function(e){return e&&/^(TD|TH)$/i.test(e.nodeName)}(u)?null:t(u)?(r=Zo.insertBlock("p",u,n),s=function(t,n){var r,o,i,a,u,s=bi(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}(u,n),Kt(r).css("top",s.top),o=Kt('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(s).appendTo(e),n&&o.addClass("mce-visual-caret-before"),a(),(c=u.ownerDocument.createRange()).setStart(r,0),c.setEnd(r,0),c):(r=Zo.insertInline(u,n),c=u.ownerDocument.createRange(),Jm(r.nextSibling)?(c.setStart(r,0),c.setEnd(r,0)):(c.setStart(r,1),c.setEnd(r,1)),c)},hide:i,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;}"},destroy:function(){ce.clearInterval(n)}}},Zm=function(e){var t=function(t){return Nt.map(t,function(t){return t=yi(t),t.node=e,t})};if(Nt.isArray(e))return Nt.reduce(e,function(e,t){return e.concat(Zm(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())}},eh={getClientRects:Zm},th=ro.isContentEditableFalse,nh=fa.findNode,rh=Ri.curry,oh=function(e,t){return Math.abs(e.left-t)},ih=function(e,t){return Math.abs(e.right-t)},ah=function(e,t){var n=function(e,t){return e>=t.left&&e<=t.right};return Nt.reduce(e,function(e,r){var o,i;return o=Math.min(oh(e,t),ih(e,t)),i=Math.min(oh(r,t),ih(r,t)),n(t,r)?r:n(t,e)?e:i===o&&th(r.node)?r:i<o?r:e})},uh=function(e,t,n,r){for(;r=nh(r,e,di,t);)if(n(r))return},sh=function(e,t){var n=[],r=function(e,r){var o;return o=Nt.filter(eh.getClientRects(r),function(n){return!e(n,t)}),n=n.concat(o),0===o.length};return n.push(t),uh(-1,e,rh(r,xi),t.node),uh(1,e,rh(r,wi),t.node),n},ch=ah,lh=function(e,t,n){var r,o;return r=eh.getClientRects(function(e){return Nt.filter(Nt.toArray(e.getElementsByTagName("*")),th)}(e)),r=Nt.filter(r,function(e){return n>=e.top&&n<=e.bottom}),(o=ah(r,t))&&(o=ah(sh(e,o),t))&&th(o.node)?function(e,t){return{node:e.node,before:oh(e,t)<ih(e,t)}}(o,t):null},fh=function(e,t,n){return!n.collapsed&&W.foldl(n.getClientRects(),function(n,r){return n||Ni(r,e,t)},!1)},dh=function(e,t){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){var r=arguments;null===n&&(n=setTimeout(function(){e.apply(null,r),n=null,r=null},t))}}},mh=ro.isContentEditableTrue,hh=ro.isContentEditableFalse,ph=function(e,t,n,r){return t._selectionOverrides.showCaret(e,n,r)},gh=function(e,t){var n,r;return t=fa.normalizeRange(1,e.getBody(),t),n=$i.fromRangeStart(t),hh(n.getNode())?ph(1,e,n.getNode(),!n.isAtEnd()):hh(n.getNode(!0))?ph(1,e,n.getNode(!0),!1):(r=e.dom.getParent(n.getNode(),Ri.or(hh,mh)),hh(r)?ph(1,e,r,!1):null)},vh=ph,yh=function(e,t){return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:function(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}(t)},bh=gh,Ch=function(e,t){return t&&t.collapsed?gh(e,t)||t:t},xh=function(e){var t=dh(function(){if(!e.removed){var t=Ch(e,e.selection.getRng());e.selection.setRng(t)}},0);e.on("focus",function(){t.throttle()}),e.on("blur",function(){t.cancel()})},wh={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return oe.mac?e.metaKey:e.ctrlKey&&!e.altKey}},Nh=ro.isContentEditableTrue,Sh=ro.isContentEditableFalse,Eh=fa.isAfterContentEditableFalse,kh=fa.isBeforeContentEditableFalse,Th=function(e){var t,n=e.getBody(),r=Qm(e.getBody(),function(t){return e.dom.isBlock(t)}),o="sel-"+e.dom.uniqueId(),i=function(t){t&&e.selection.setRng(t)},a=function(){return e.selection.getRng()},u=function(t,n){e.selection.scrollIntoView(t,n)},s=function(t,n,o){return e.fire("ShowCaret",{target:n,direction:t,before:o}).isDefaultPrevented()?null:(u(n,-1===t),r.show(o,n))},c=function(e,t){return t=fa.normalizeRange(e,n,t),-1===e?$i.fromRangeStart(t):$i.fromRangeEnd(t)},l=function(e){return Zo.isCaretContainer(e)||Zo.startsWithCaretContainer(e)||Zo.endsWithCaretContainer(e)},f=function(e){return l(e.startContainer)||l(e.endContainer)},d=function(n,r){var i,a,u,l,d,m,p,g,v,y,b=e.$,C=e.dom;if(!n)return null;if(n.collapsed){if(!f(n))if(!1===r){if(g=c(-1,n),Sh(g.getNode(!0)))return s(-1,g.getNode(!0),!1);if(Sh(g.getNode()))return s(-1,g.getNode(),!g.isAtEnd())}else{if(g=c(1,n),Sh(g.getNode()))return s(1,g.getNode(),!g.isAtEnd());if(Sh(g.getNode(!0)))return s(1,g.getNode(!0),!1)}return null}return l=n.startContainer,d=n.startOffset,m=n.endOffset,3===l.nodeType&&0===d&&Sh(l.parentNode)&&(l=l.parentNode,d=C.nodeIndex(l),l=l.parentNode),1!==l.nodeType?null:(m===d+1&&(i=l.childNodes[d]),Sh(i)?(v=y=i.cloneNode(!0),(p=e.fire("ObjectSelected",{target:i,targetClone:v})).isDefaultPrevented()?null:(a=is(Bn.fromDom(e.getBody()),"#"+o).fold(function(){return b([])},function(e){return b([e.dom()])}),v=p.targetClone,0===a.length&&(a=b('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",o)).appendTo(e.getBody()),n=e.dom.createRng(),v===y&&oe.ie?(a.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(v),n.setStartAfter(a[0].firstChild.firstChild),n.setEndAfter(v)):(a.empty().append("\xa0").append(v).append("\xa0"),n.setStart(a[0].firstChild,1),n.setEnd(a[0].lastChild,0)),a.css({top:C.getPos(i,e.getBody()).y}),a[0].focus(),(u=e.selection.getSel()).removeAllRanges(),u.addRange(n),W.each(vu(Bn.fromDom(e.getBody()),"*[data-mce-selected]"),function(e){rr(e,"data-mce-selected")}),i.setAttribute("data-mce-selected",1),t=i,h(),n)):null)},m=function(){t&&(t.removeAttribute("data-mce-selected"),is(Bn.fromDom(e.getBody()),"#"+o).each(hu.remove),t=null)},h=function(){r.hide()};return oe.ceFalse&&(function(){var r=function(t){for(var n=e.getBody();t&&t!==n;){if(Nh(t)||Sh(t))return t;t=t.parentNode}return null};e.on("mouseup",function(t){var n=a();n.collapsed&&um(e,t.clientX,t.clientY)&&i(bh(e,n))}),e.on("click",function(t){var n;(n=r(t.target))&&(Sh(n)&&(t.preventDefault(),e.focus()),Nh(n)&&e.dom.isChildOf(n,e.selection.getNode())&&m())}),e.on("blur NewBlock",function(){m()});var u=function(t,n){var r=e.dom.getParent(t,e.dom.isBlock),o=e.dom.getParent(n,e.dom.isBlock);return r&&!function(t,n){return e.dom.getParent(t,e.dom.isBlock)===e.dom.getParent(n,e.dom.isBlock)}(r,o)&&function(e){var t=Sa(e);if(!e.firstChild)return!1;var n=$i.before(e.firstChild),r=t.next(n);return r&&!kh(r)&&!Eh(r)}(r)};!function(e){var t=!1;e.on("touchstart",function(){t=!1}),e.on("touchmove",function(){t=!0}),e.on("touchend",function(n){var o=r(n.target);Sh(o)&&(t||(n.preventDefault(),d(yh(e,o))))})}(e),e.on("mousedown",function(t){var o;if(!1!==um(e,t.clientX,t.clientY))if(o=r(t.target))Sh(o)?(t.preventDefault(),d(yh(e,o))):(m(),Nh(o)&&t.shiftKey||fh(t.clientX,t.clientY,e.selection.getRng())||e.selection.placeCaretAt(t.clientX,t.clientY));else{m(),h();var a=lh(n,t.clientX,t.clientY);a&&(u(t.target,a.node)||(t.preventDefault(),e.getBody().focus(),i(s(1,a.node,a.before))))}}),e.on("keypress",function(t){wh.modifierPressed(t)||(t.keyCode,Sh(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){var t;(t=d(e.range,e.forward))&&(e.range=t)}),e.on("AfterSetSelectionRange",function(t){var n=t.range;f(n)||h(),function(t){return e.dom.hasClass(t,"mce-offscreen-selection")}(n.startContainer.parentNode)||m()}),e.on("copy",function(t){var n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!oe.ie){var r=function(){var t=e.dom.get(o);return t?t.getElementsByTagName("*")[0]:t}();r&&(t.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),Gm(e),xh(e)}(),function(){var t=e.contentStyles,n=".mce-content-body";t.push(r.getCss()),t.push(n+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+n+" *[contentEditable=false] {cursor: default;}"+n+" *[contentEditable=true] {cursor: text;}")}()),{showCaret:s,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Zo.showCaretContainerBlock(e),i(a()),u(e[0]))},hideFakeCaret:h,destroy:function(){r.destroy(),t=null}}},Ah=0,_h=2,Rh=1,Bh=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=c-l,d=l+c,m=(d%2==0?d:d+1)/2;r[1+m]=n,o[1+m]=i+1;var h,p,g,v,y;for(h=0;h<=m;++h){for(p=-h;p<=h;p+=2){for(g=p+m,p===-h||p!==h&&r[g-1]<r[g+1]?r[g]=r[g+1]:r[g]=r[g-1]+1,y=(v=r[g])-n+u-p;v<i&&y<s&&e[v]===t[y];)r[g]=++v,++y;if(f%2!=0&&f-h<=p&&p<=f+h&&o[g-f]<=r[g])return a(o[g-f],p+n-u,i,s)}for(p=f-h;p<=f+h;p+=2){for(g=p+m-f,p===f-h||p!==f+h&&o[g+1]<=o[g-1]?o[g]=o[g+1]-1:o[g]=o[g-1],y=(v=o[g]-1)-n+u-p;v>=n&&y>=u&&e[v]===t[y];)o[g]=v--,y--;if(f%2==0&&-h<=p&&p<=h&&o[g]<=r[g+f])return a(o[g],p+n-u,i,s)}}},s=[];return i(0,e.length,0,t.length,s),s},Dh=function(e){return 1===e.nodeType?e.outerHTML:3===e.nodeType?po.encodeRaw(e.data,!1):8===e.nodeType?"\x3c!--"+e.data+"--\x3e":""},Oh=function(e,t,n){var r=function(e){var t,n,r;for(r=document.createElement("div"),t=document.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o)}else e.appendChild(r)},Ph=function(e){return Nt.filter(Nt.map(e.childNodes,Dh),function(e){return e.length>0})},Ih=function(e,t){var n=Nt.map(t.childNodes,Dh);return function(e,t){var n=0;Nt.each(e,function(e){e[0]===Ah?n++:e[0]===Rh?(Oh(t,e[1],n),n++):e[0]===_h&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(t,n)})}(Bh(n,e),t),t},Lh=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},Mh=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},Fh=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},zh=function(e){var t,n,r;return t=Ph(e.getBody()),r=W.bind(t,function(t){var n=qd(e.serializer,t);return n.length>0?[n]:[]}),n=r.join(""),function(e){return-1!==e.indexOf("</iframe>")}(n)?Lh(r):Mh(n)},Uh=function(e,t,n){"fragmented"===t.type?Ih(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},Vh=function(e,t){return!!e&&!!t&&Fh(e)===Fh(t)},Hh=function(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===Vh(zh(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.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=Ja.getUndoBookmark(e.selection))},add:function(n,r){var a,s,l,f=e.settings;if(l=zh(e),n=n||{},n=At.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&&Vh(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=Ja.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],Uh(e,t,!0),c(!0),e.fire("undo",{level:t})),t},redo:function(){var t;return o<i.length-1&&(t=i[++o],Uh(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]&&!Vh(zh(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],Uh(e,a,!0),r.transact(n)&&(i[o-1].beforeBookmark=u))}}},qh={},jh=Nt.filter,$h=Nt.each;!function(e,t){var n=qh[e];n||(qh[e]=n=[]),qh[e].push(t)}("pre",function(e){var t,n,r=e.selection.getRng();t=ro.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),$h(jh(jh(n,t),function(e){return t(e.previousSibling)&&-1!==Nt.indexOf(n,e.previousSibling)}),function(e){!function(e,t){Kt(t).remove(),Kt(e).append("<br><br>").append(t.childNodes)}(e.previousSibling,e)}))});var Wh=function(e,t){$h(qh[e],function(e){e(t)})},Kh=At.each,Xh=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)Kh(c,function(e){n([e])});else{var h=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},p=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},g=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},v=function(e,t,r){var o=r?"nextSibling":"previousSibling";for(u=(a=e).parentNode;a&&a!==t;a=u)u=a.parentNode,(s=p(a===e?a:a[o],o)).length&&(r||s.reverse(),n(h(s)))};if(1===l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[f]),1===d.nodeType&&d.hasChildNodes()&&(d=function(e,t){var n=e.childNodes;return--t>n.length-1?t=n.length-1:t<0&&(t=0),n[t]||e}(d,m)),l===d)return n(h([l]));for(r=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return v(l,r,!0);if(a===r)break}for(a=d;a;a=a.parentNode){if(a===l)return v(d,r);if(a===r)break}o=g(l,r)||l,i=g(d,r)||d,v(l,o,!0),(s=p(o===l?o:o.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&n(h(s)),v(d,i)}},Yh=/^(src|href|style)$/,Gh=At.each,Jh=wc.isEq,Qh=function(e){return/^(TH|TD)$/.test(e.nodeName)},Zh=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 Xr(r,e.getBody()).next()||r),ro.isText(r)&&!n&&0===o&&(r=new Xr(r,e.getBody()).prev()||r),r},ep=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},tp=function(e,t,n,r){return!(t=wc.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},np=function(e,t,n,r,o){var i,a,u,s=e.dom;if(!function(e,t,n){return!!Jh(t,n.inline)||!!Jh(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(Gh(t.styles,function(e,i){e=wc.normalizeStyleValue(s,wc.replaceVars(e,n),i),"number"==typeof i&&(i=e,o=0),(t.remove_similar||!o||Jh(wc.getStyle(s,o,i),e))&&s.setStyle(r,i,""),u=1}),u&&""===s.getAttrib(r,"style")&&(r.removeAttribute("style"),r.removeAttribute("data-mce-style")),Gh(t.attributes,function(e,t){var i;if(e=wc.replaceVars(e,n),"number"==typeof t&&(t=e,o=0),!o||Jh(s.getAttrib(o,t),e)){if("class"===t&&(e=s.getAttrib(r,t))&&(i="",Gh(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"),Yh.test(t)&&r.removeAttribute("data-mce-"+t),r.removeAttribute(t)}}),Gh(t.classes,function(e){e=wc.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&&Jh(t,n.list_block)||Gh(At.grep(t.childNodes),function(t){wc.isValid(e,a,t.nodeName.toLowerCase())?r?r.appendChild(t):(r=ep(i,t,a),i.setAttribs(r,e.settings.forced_root_block_attrs)):r=0})):i.isBlock(t)&&!i.isBlock(o)&&(tp(i,t,!1)||tp(i,t.firstChild,!0,1)||t.insertBefore(i.create("br"),t.firstChild),tp(i,t,!0)||tp(i,t.lastChild,!1,1)||t.appendChild(i.create("br")))),n.selector&&n.inline&&!Jh(n.inline,t)||i.remove(t,1)}(e,r,t),!0):void 0},rp=np,op=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 Gh(wc.getParents(e.dom,t.parentNode).reverse(),function(t){var a;i||"_start"===t.id||"_end"===t.id||(a=Hc.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(np(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=At.grep(t.childNodes),c&&!f)for(o=0,i=u.length;o<i&&!np(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 iu(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},p=function(t){var n,r,o=t.commonAncestorContainer;if(t=Ic(e,t,u,!0),s.split){if(n=Zh(e,t,!0),r=Zh(e,t),n!==r){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)&&Qh(r)&&r.firstChild&&(r=r.firstChild||r),l.isChildOf(n,r)&&n!==r&&!l.isBlock(r)&&!Qh(n)&&!Qh(r))return n=ep(l,n,"span",{id:"_start","data-mce-type":"bookmark"}),d(n),void(n=h(!0));n=ep(l,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=ep(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}Xh(l,t,function(t){Gh(t,function(t){m(t),ro.isElement(t)&&"underline"===e.dom.getStyle(t,"text-decoration")&&t.parentNode&&"underline"===wc.getTextDecoration(l,t.parentNode)&&np(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,t)})})};if(r)r.nodeType?((a=l.createRng()).setStartBefore(r),a.setEndAfter(r),p(a)):p(r);else if("false"!==l.getContentEditable(f.getNode()))f.isCollapsed()&&s.inline&&!l.select("td[data-mce-selected],th[data-mce-selected]").length?il(e,t,n,o):(i=f.getBookmark(),p(f.getRng(!0)),f.moveToBookmark(i),s.inline&&Hc.match(e,t,n,f.getStart())&&wc.moveStart(l,f,f.getRng(!0)),e.nodeChanged());else{r=f.getNode();for(var g=0,v=u.length;g<v&&(!u[g].ceFalseOverride||!np(e,u[g],n,r,r));g++);}},ip=At.each,ap=function(e){return e&&1===e.nodeType&&!iu(e)&&!al(e)&&!ro.isBogus(e)},up=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&&!iu(n))return n}return e},sp=function(e,t,n){var r,o,i=new uu(e);if(t&&n&&(t=up(t,"previousSibling"),n=up(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),At.each(At.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},cp=function(e,t,n){ip(e.childNodes,function(e){ap(e)&&(t(e)&&n(e),e.hasChildNodes()&&cp(e,t,n))})},lp=function(e,t){return T.curry(function(t,n){return!(!n||!wc.getStyle(e,n,t))},t)},fp=function(e,t,n){return T.curry(function(t,n,r){e.setStyle(r,t,n),""===r.getAttribute("style")&&r.removeAttribute("style"),dp(e,r)},t,n)},dp=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},mp=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=wc.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))},hp=function(e,t,n,r){ip(t,function(t){ip(e.dom.select(t.inline,r),function(r){ap(r)&&rp(e,t,n,r,t.exact?r:null)}),function(e,t,n){if(t.clear_child_styles){var r=t.links?"*:not(a)":"*";ip(e.select(r,n),function(n){ap(n)&&ip(t.styles,function(t,r){e.setStyle(n,r,"")})})}}(e.dom,t,r)})},pp=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&(At.walk(r,T.curry(mp,e),"childNodes"),mp(e,r))},gp=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&cp(r,lp(e,"fontSize"),fp(e,"backgroundColor",wc.replaceVars(t.styles.backgroundColor,n)))},vp=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(cp(r,lp(e,"fontSize"),fp(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},yp=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=sp(e,wc.getNonWhiteSpaceSibling(r),r),r=sp(e,r,wc.getNonWhiteSpaceSibling(r,!0)))},bp=function(e,t,n,r,o){Hc.matchNode(e,o.parentNode,n,r)&&rp(e,t,r,o)||t.merge_with_parents&&e.dom.getParent(o.parentNode,function(i){if(Hc.matchNode(e,i,n,r))return rp(e,t,r,o),!0})},Cp=At.each,xp=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),Cp(t.styles,function(t,r){c.setStyle(e,r,wc.replaceVars(t,n))}),t.styles){var o=c.getAttrib(e,"style");o&&e.setAttribute("data-mce-style",o)}Cp(t.attributes,function(t,r){c.setAttrib(e,r,wc.replaceVars(t,n))}),Cp(t.classes,function(t){t=wc.replaceVars(t,n),c.hasClass(e,t)||c.addClass(e,t)})}},d=function(e,t){var n=!1;return!!u.selector&&(Cp(e,function(e){if(!("collapsed"in e&&e.collapsed!==s))return c.is(t,e.selector)&&!al(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),Xh(r,o,function(o){var i,p=function(o){var g,v,y,b;if(b=h,g=o.nodeName.toLowerCase(),v=o.parentNode.nodeName.toLowerCase(),1===o.nodeType&&r.getContentEditable(o)&&(b=h,h="true"===r.getContentEditable(o),y=!0),wc.isEq(g,"br"))return i=0,void(u.block&&r.remove(o));if(u.wrapper&&Hc.matchNode(e,o,t,n))i=0;else{if(h&&!y&&u.block&&!u.wrapper&&wc.isTextBlock(e,g)&&wc.isValid(e,v,c))return o=r.rename(o,c),f(o),m.push(o),void(i=0);if(u.selector){var C=d(a,o);if(!u.inline||C)return void(i=0)}!h||y||!wc.isValid(e,c,g)||!wc.isValid(e,v,c)||!s&&3===o.nodeType&&1===o.nodeValue.length&&65279===o.nodeValue.charCodeAt(0)||al(o)||u.inline&&r.isBlock(o)?(i=0,Cp(At.grep(o.childNodes),p),y&&(h=b),i=0):(i||(i=r.clone(l,!1),o.parentNode.insertBefore(i,o),m.push(i)),i.appendChild(o))}};Cp(o,p)}),!0===u.links&&Cp(m,function(e){var t=function(e){"A"===e.nodeName&&f(e,u),Cp(At.grep(e.childNodes),t)};t(e)}),Cp(m,function(o){var i,s=function(e){var t=!1;return Cp(e.childNodes,function(e){if(function(e){return e&&1===e.nodeType&&!iu(e)&&!al(e)&&!ro.isBogus(e)}(e))return t=e,!1}),t};i=function(e){var t=0;return Cp(e.childNodes,function(e){wc.isWhiteSpaceNode(e)||iu(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))&&!iu(t)&&Hc.matchName(r,t,u)&&(n=r.clone(t,!1),f(n),r.replace(n,e,!0),r.remove(t,1)),n||e}(o)),hp(e,a,n,o),bp(e,u,t,n,o),gp(r,u,n,o),vp(r,u,n,o),yp(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,Ic(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)ol(e,t,n);else{var h=e.selection.getNode();e.settings.forced_root_block||!a[0].defaultBlock||c.getParent(h,c.isBlock)||xp(e,a[0].defaultBlock),e.selection.setRng(Du(e.selection.getRng())),o=l.getBookmark(),m(c,Ic(e,l.getRng(!0),a)),u.styles&&pp(c,u,n,h),l.moveToBookmark(o),wc.moveStart(c,l,l.getRng(!0)),e.nodeChanged()}Wh(t,e)}}else{r=l.getNode();for(var p=0,g=a.length;p<g;p++)if(a[p].ceFalseOverride&&c.is(r,a[p].selector))return void f(r,a[p])}},wp={applyFormat:xp},Np=At.each,Sp=function(e,t,n,r,o){null===t.get()&&function(e,t){var n={};e.set({}),t.on("NodeChange",function(r){var o=wc.getParents(t.dom,r.element),i={};o=At.grep(o,function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")}),Np(e.get(),function(e,r){Np(o,function(a){return t.formatter.matchNode(a,r,{},e.similar)?(n[r]||(Np(e,function(e){e(!0,{node:a,format:r,parents:o})}),n[r]=e),i[r]=e,!1):!Hc.matchesUnInheritedFormatSelector(t,a,r)&&void 0})}),Np(n,function(e,t){i[t]||(delete n[t],Np(e,function(e){e(!1,{node:r.element,format:t,parents:o})}))})})}(t,e),function(e,t,n,r){var o=e.get();Np(t.split(","),function(e){o[e]||(o[e]=[],o[e].similar=r),o[e].push(n)}),e.set(o)}(t,n,r,o)},Ep=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",styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",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){At.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 At.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},kp=At.each,Tp=Io.DOM,Ap=function(e,t){var n,r,o,i=t&&t.schema||Eo({}),a=function(e){var t;return r="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=Tp.create(r.name),function(e,t){t.classes.length&&Tp.addClass(e,t.classes.join(" ")),Tp.setAttribs(e,t.attrs)}(t,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!==At.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=Tp.create("div")).appendChild(e),At.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=Tp.create("div")).appendChild(u(n,e.slice(1),r.siblings)),o):""},_p=function(e){var t,n={classes:[],attrs:{}};return"*"!==(e=n.selector=At.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!==At.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},Rp=function(e){return e&&"string"==typeof e?(e=e.split(/\s*,\s*/)[0],e=e.replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),At.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=At.map(e.split(/(?:~\+|~|\+)/),_p),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},Bp=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=Rp(t.selector)).length?(i[0].name||(i[0].name=n),n=t.selector,r=Ap(i,e)):r=Ap([n],e),o=Tp.select(n,r)[0]||r.firstChild,kp(t.styles,function(e,t){(e=c(e))&&Tp.setStyle(o,t,e)}),kp(t.attributes,function(e,t){(e=c(e))&&Tp.setAttrib(o,t,e)}),kp(t.classes,function(e){e=c(e),Tp.hasClass(o,e)||Tp.addClass(o,e)}),e.fire("PreviewFormats"),Tp.setStyles(r,{position:"absolute",left:-65535}),e.getBody().appendChild(r),a=Tp.getStyle(e.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,kp(u.split(" "),function(t){var n=Tp.getStyle(o,t,!0);if(!("background-color"===t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Tp.getStyle(e.getBody(),t,!0),"#ffffff"===Tp.toHex(n).toLowerCase())||"color"===t&&"#000000"===Tp.toHex(n).toLowerCase())){if("font-size"===t&&/em|%$/.test(n)){if(0===a)return;n=(n=parseFloat(n)/(/%$/.test(n)?100:1))*a+"px"}"border"===t&&n&&(s+="padding:0 2px;"),s+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),Tp.remove(r),s)},Dp=function(e,t,n,r,o){var i=t.get(n);!Hc.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?wp.applyFormat(e,n,r,o):op(e,n,r,o)},Op=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"])},Pp=function(e){var t=function(e){var t={},n=function(e,r){e&&("string"!=typeof e?At.each(e,function(e,t){n(t,e)}):(r=r.length?r:[r],At.each(r,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selector),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),t[e]=r))};return n(Ep(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=Dl(null);return Op(e),rl(e),{get:t.get,register:t.register,unregister:t.unregister,apply:T.curry(wp.applyFormat,e),remove:T.curry(op,e),toggle:T.curry(Dp,e,t),match:T.curry(Hc.match,e),matchAll:T.curry(Hc.matchAll,e),matchNode:T.curry(Hc.matchNode,e),canApply:T.curry(Hc.canApply,e),formatChanged:T.curry(Sp,e,n),getCssText:T.curry(Bp,e)}},Ip=function(e){return function(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<t.length;o++){var i=t[o];for(var a in i)i.hasOwnProperty(a)&&(r[a]=e(r[a],i[a]))}return r}},Lp=Ip(function(e,t){return jn.isObject(e)&&jn.isObject(t)?Lp(e,t):t}),Mp=Ip(function(e,t){return t}),Fp={deepMerge:Lp,merge:Mp},zp=function(e,t){return e.fire("PreProcess",t)},Up=function(e,t){return e.fire("PostProcess",t)},Vp=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--;)(i=(o=e[a]).attributes.map[u])!==undefined?(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||r.remove()}),e.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=po.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){W.each(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)})},Hp=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())},qp=function(e,t,n){return function(e,t){return e&&e.hasEventListeners("PreProcess")&&!t.no_events}(e,n)?function(e,t,n){var r,o,i,a=e.dom;return t=t.cloneNode(!0),(r=document.implementation).createHTMLDocument&&(o=r.createHTMLDocument(""),At.each("BODY"===t.nodeName?t.childNodes:[t],function(e){o.body.appendChild(o.importNode(e,!0))}),t="BODY"!==t.nodeName?o.body.firstChild:o.body,i=a.doc,a.doc=o),zp(e,Fp.merge(n,{node:t})),i&&(a.doc=i),t}(e,t,n):t},jp=function(e,t,n){e.addNodeFilter("font",function(e){W.each(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){W.each(t,function(t){e.attr(t,null)})}(e,["color","face","size"])})})},$p=function(e,t){var n=ko();t.convert_fonts_to_spans&&jp(e,n,At.explode(t.font_size_legacy_values)),function(e,t){e.addNodeFilter("strike",function(e){W.each(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)},Wp=function(e,t){t.inline_styles&&$p(e,t)},Kp=/^[ \t\r\n]*$/,Xp={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Yp=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}},Gp=function(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})};Gp.prototype={replace:function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},attr:function(e,t){var n,r;if("string"!=typeof e){for(r in e)this.attr(r,e[r]);return this}if(n=this.attributes){if(t!==undefined){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]}},clone:function(){var e,t,n,r,o,i=new Gp(this.name,this.type);if(n=this.attributes){for((o=[]).map={},e=0,t=n.length;e<t;e++)"id"!==(r=n[e]).name&&(o[o.length]={name:r.name,value:r.value},o.map[r.name]=r.value);i.attributes=o}return i.value=this.value,i.shortEnded=this.shortEnded,i},wrap:function(e){return this.parent.insert(e,this),e.append(this),this},unwrap:function(){var e,t;for(e=this.firstChild;e;)t=e.next,this.insert(e,this,!0),e=t;this.remove()},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},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},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},getAll:function(e){var t,n=[];for(t=this.firstChild;t;t=Yp(t,this))t.name===e&&n.push(t);return n},empty:function(){var e,t,n;if(this.firstChild){for(e=[],n=this.firstChild;n;n=Yp(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},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&&!Kp.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&Kp.test(i.value))return!1;if(n&&n(i))return!1}while(i=Yp(i,this));return!0},walk:function(e){return Yp(this,null,e)}},Gp.create=function(e,t){var n,r;if(n=new Gp(e,Xp[e]||1),t)for(r in t)n.attr(r,t[r]);return n};var Jp=At.makeMap,Qp=At.each,Zp=At.explode,eg=At.extend,tg=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new Gp("br","1")).shortEnded=!0:r.empty().append(new Gp("#text","3")).value="\xa0"},ng=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},rg=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)})},og=function(e,t){var n={},r={},o=[],i={},a={};(e=e||{}).validate=!("validate"in e)||e.validate,e.root_name=e.root_name||"body",n.schema=t=t||Eo();return n.filterNode=function(e){var t,n,u;n in r&&((u=i[n])?u.push(e):i[n]=[e]),t=o.length;for(;t--;)(n=o[t].name)in e.attributes.map&&((u=a[n])?u.push(e):a[n]=[e]);return e},n.addNodeFilter=function(e,t){Qp(Zp(e),function(e){var n=r[e];n||(r[e]=n=[]),n.push(t)})},n.addAttributeFilter=function(e,t){Qp(Zp(e),function(e){var n;for(n=0;n<o.length;n++)if(o[n].name===e)return void o[n].callbacks.push(t);o.push({name:e,callbacks:[t]})})},n.parse=function(u,s){var c,l,f,d,m,h,p,g,v,y,b,C,x,w,N,S,E,k,T,A,_,R=[];s=s||{},i={},a={},C=eg(Jp("script,style,head,html,body,title,meta,param"),t.getBlockElements()),A=t.getNonEmptyElements(),T=t.children,b=e.validate,_="forced_root_block"in s?s.forced_root_block:e.forced_root_block,k=t.getWhiteSpaceElements(),x=/^[ \t\r\n]+/,N=/[ \t\r\n]+$/,S=/[ \t\r\n]+/g,E=/^[ \t\r\n]+$/;var B=function(e,t){var n,o=new Gp(e,t);return e in r&&((n=i[e])?n.push(o):i[e]=[o]),o},D=function(e){var n,r,o,i,a=t.getBlockElements();for(n=e.prev;n&&3===n.type;){if((o=n.value.replace(N,"")).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}};if(c=new Ud({validate:b,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){f.append(B("#cdata",4)).value=e},text:function(e,t){var n;w||(e=e.replace(S," "),f.lastChild&&C[f.lastChild.name]&&(e=e.replace(x,""))),0!==e.length&&((n=B("#text",3)).raw=!!t,f.append(n).value=e)},comment:function(e){f.append(B("#comment",8)).value=e},pi:function(e,t){f.append(B(e,7)).value=t,D(f)},doctype:function(e){f.append(B("#doctype",10)).value=e,D(f)},start:function(e,n,r){var i,u,s,c,l;if(s=b?t.getElementRule(e):{}){for((i=B(s.outputName||e,1)).attributes=n,i.shortEnded=r,f.append(i),(l=T[f.name])&&T[i.name]&&!l[i.name]&&R.push(i),u=o.length;u--;)(c=o[u].name)in n.map&&((v=a[c])?v.push(i):a[c]=[i]);C[e]&&D(i),r||(f=i),!w&&k[e]&&(w=!0)}},end:function(n){var r,o,i,a,u;if(o=b?t.getElementRule(n):{}){if(C[n]&&!w){if((r=f.firstChild)&&3===r.type)if((i=r.value.replace(x,"")).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||E.test(i))&&(r.remove(),r=a),r=a;if((r=f.lastChild)&&3===r.type)if((i=r.value.replace(N,"")).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||E.test(i))&&(r.remove(),r=a),r=a}if(w&&k[n]&&(w=!1),o.removeEmpty&&rg(t,A,k,f)&&!f.attributes.map.name&&!f.attributes.map.id)return u=f.parent,C[f.name]?f.empty().remove():f.unwrap(),void(f=u);o.paddEmpty&&(function(e){return ng(e,"#text")&&"\xa0"===e.firstChild.value}(f)||rg(t,A,k,f))&&tg(e,s,C,f),f=f.parent}}},t),l=f=new Gp(s.context||e.root_name,11),c.parse(u),b&&R.length&&(s.context?s.invalid=!0:function(e){var r,o,i,a,u,s,c,l,f,d,m,h,p,g,v,y;for(h=Jp("tr,td,th,tbody,thead,tfoot,table"),d=t.getNonEmptyElements(),m=t.getWhiteSpaceElements(),p=t.getTextBlockElements(),g=t.getSpecialElements(),r=0;r<e.length;r++)if((o=e[r]).parent&&!o.fixed)if(p[o.name]&&"li"===o.parent.name){for(v=o.next;v&&p[v.name];)v.name="li",v.fixed=!0,o.parent.insert(v,o.parent),v=v.next;o.unwrap(o)}else{for(a=[o],i=o.parent;i&&!t.isValidChild(i.name,o.name)&&!h[i.name];i=i.parent)a.push(i);if(i&&a.length>1){for(a.reverse(),u=s=n.filterNode(a[0].clone()),f=0;f<a.length-1;f++){for(t.isValidChild(s.name,a[f].name)?(c=n.filterNode(a[f].clone()),s.append(c)):c=s,l=a[f].firstChild;l&&l!==a[f+1];)y=l.next,c.append(l),l=y;s=c}rg(t,d,m,u)?i.insert(o,a[0],!0):(i.insert(u,a[0],!0),i.insert(o,u)),i=a[0],(rg(t,d,m,i)||ng(i,"br"))&&i.empty().remove()}else if(o.parent){if("li"===o.name){if((v=o.prev)&&("ul"===v.name||"ul"===v.name)){v.append(o);continue}if((v=o.next)&&("ul"===v.name||"ul"===v.name)){v.insert(o,v.firstChild,!0);continue}o.wrap(n.filterNode(new Gp("ul",1)));continue}t.isValidChild(o.parent.name,"div")&&t.isValidChild("div",o.name)?o.wrap(n.filterNode(new Gp("div",1))):g[o.name]?o.empty().remove():o.unwrap()}}}(R)),_&&("body"===l.name||s.isRootContent)&&function(){var n,r,o=l.firstChild,i=function(e){e&&((o=e.firstChild)&&3===o.type&&(o.value=o.value.replace(x,"")),(o=e.lastChild)&&3===o.type&&(o.value=o.value.replace(N,"")))};if(t.isValidChild(l.name,_.toLowerCase())){for(;o;)n=o.next,3===o.type||1===o.type&&"p"!==o.name&&!C[o.name]&&!o.attr("data-mce-type")?r?r.append(o):((r=B(_,1)).attr(e.forced_root_block_attrs),l.insert(r,o),r.append(o)):(i(r),r=null),o=n;i(r)}}(),!s.invalid){for(y in i){for(v=r[y],p=(d=i[y]).length;p--;)d[p].parent||d.splice(p,1);for(m=0,h=v.length;m<h;m++)v[m](d,y,s)}for(m=0,h=o.length;m<h;m++)if((v=o[m]).name in a){for(p=(d=a[v.name]).length;p--;)d[p].parent||d.splice(p,1);for(p=0,g=v.callbacks.length;p<g;p++)v.callbacks[p](d,v.name,s)}}return l},e.remove_trailing_brs&&n.addNodeFilter("br",function(n,r,o){var i,a,u,s,c,l,f,d,m=n.length,h=eg({},t.getBlockElements()),p=t.getNonEmptyElements(),g=t.getNonEmptyElements();for(h.body=1,i=0;i<m;i++)if(a=n[i],u=a.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(),rg(t,p,g,u)&&(f=t.getElementRule(u.name))&&(f.removeEmpty?u.remove():f.paddEmpty&&tg(e,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!==e.padd_empty_with_br&&((d=new Gp("#text",3)).value="\xa0",a.replace(d))}}),n.addAttributeFilter("href",function(t){var n,r=t.length,o=function(e){var t=e?At.trim(e):"";return/\b(noopener)\b/g.test(t)?t:function(e){return e.split(" ").filter(function(e){return e.length>0}).concat(["noopener"]).sort().join(" ")}(t)};if(!e.allow_unsafe_link_target)for(;r--;)"a"===(n=t[r]).name&&"_blank"===n.attr("target")&&n.attr("rel",o(n.attr("rel")))}),e.allow_html_in_named_anchor||n.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)}}),e.fix_list_elements&&n.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if(t=e[r],"ul"===(n=t.parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new Gp("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),e.validate&&t.getValidClasses()&&n.addAttributeFilter("class",function(e){for(var n,r,o,i,a,u,s,c=e.length,l=t.getValidClasses();c--;){for(r=(n=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[n.name],!s&&u&&u[i]&&(s=!0),s&&(a&&(a+=" "),a+=i);a.length||(a=null),n.attr("class",a)}}),Wp(n,e),n},ig=function(e,t,n){-1===At.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},ag=function(e,t,n,r,o){return function(e,t,n){if(!t.no_events&&e)return Up(e,Fp.merge(t,{content:n})).content;return n}(e,o,function(e,t,n){return Nu(e,t).serialize(n)}(t,n,r))},ug=function(e,t){var n,r,o,i=["data-mce-selected"];n=t&&t.dom?t.dom:Io.DOM,r=t&&t.schema?t.schema:Eo(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs=!("remove_trailing_brs"in e)||e.remove_trailing_brs,o=og(e,r),Vp(o,e,n);return{schema:r,addNodeFilter:o.addNodeFilter,addAttributeFilter:o.addAttributeFilter,serialize:function(i,a){var u=Fp.merge({format:"html"},a||{}),s=qp(t,i,u),c=function(e,t,n){var r=$o(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection?r:At.trim(r)}(n,s,u),l=function(e,t,n,r){var o=r.selection?Fp.merge({forced_root_block:!1},r):r,i=e.parse(n,o);return Hp(i),i}(o,0,c,u);return"tree"===u.format?l:ag(t,e,r,l,u)},addRules:function(e){r.addValidElements(e)},setRules:function(e){r.setValidElements(e)},addTempAttr:T.curry(ig,o,i),getTempAttrs:function(){return i}}},sg=function(e,t){var n=ug(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}},cg=function(e,t){t.hasAttribute("data-mce-caret")&&(Zo.showCaretContainerBlock(t),function(e){e.selection.setRng(e.selection.getRng())}(e),e.selection.scrollIntoView(t))},lg=function(e,t){var n=function(e){return is(Bn.fromDom(e.getBody()),"*[data-mce-caret]").fold(T.constant(null),function(e){return e.dom()})}(e);if(n)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void cg(e,n)):void(Zo.hasContent(n)&&cg(e,n))},fg=function(e){e.on("keyup compositionstart",T.curry(lg,e))},dg=function(e){return{getBookmark:T.curry(ru,e),moveToBookmark:T.curry(ou,e)}};dg.isBookmarkNode=iu;var mg=ro.isContentEditableFalse,hg=ro.isContentEditableTrue,pg=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,h,p,g,v,y,b=t.dom,C=At.each,x=t.getDoc(),w=document,N=Math.abs,S=Math.round,E=t.getBody();i={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var k=".mce-content-body";t.contentStyles.push(k+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: content-box;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+k+" .mce-resizehandle:hover {background: #000}"+k+" img[data-mce-selected],"+k+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+k+" .mce-clonedresizable {position: absolute;"+(oe.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+k+" .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 T=function(e){return e&&("IMG"===e.nodeName||t.dom.is(e,"figure.image"))},A=function(e){var n=e.target;(function(e,t){return T(e.target)&&!fh(e.clientX,e.clientY,t)})(e,t.selection.getRng())&&!e.isDefaultPrevented()&&(e.preventDefault(),t.selection.select(n))},_=function(e){return t.dom.is(e,"figure.image")?e.querySelector("img"):e},R=function(e){var n=t.settings.object_resizing;return!1!==n&&!oe.iOS&&("string"!=typeof n&&(n="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&(e!==t.getBody()&&xr(Bn.fromDom(e),n)))},B=function(e){var i,C,x,w;i=e.screenX-u,C=e.screenY-s,p=i*a[2]+f,g=C*a[3]+d,p=p<5?5:p,g=g<5?5:g,(T(n)&&!1!==t.settings.resize_img_proportional?!wh.modifierPressed(e):wh.modifierPressed(e)||T(n)&&a[2]*a[3]!=0)&&(N(i)>N(C)?(g=S(p*m),p=S(g/m)):(p=S(g/m),g=S(p*m))),b.setStyles(_(r),{width:p,height:g}),x=a.startPos.x+i,w=a.startPos.y+C,x=x>0?x:0,w=w>0?w:0,b.setStyles(o,{left:x,top:w,display:"block"}),o.innerHTML=p+" × "+g,a[2]<0&&r.clientWidth<=p&&b.setStyle(r,"left",c+(f-p)),a[3]<0&&r.clientHeight<=g&&b.setStyle(r,"top",l+(d-g)),(i=E.scrollWidth-v)+(C=E.scrollHeight-y)!==0&&b.setStyles(o,{left:x-i,top:w-C}),h||(t.fire("ObjectResizeStart",{target:n,width:f,height:d}),h=!0)},D=function(){h=!1;var e=function(e,r){r&&(n.style[e]||!t.schema.isValid(n.nodeName.toLowerCase(),e)?b.setStyle(_(n),e,r):b.setAttrib(_(n),e,r))};e("width",p),e("height",g),b.unbind(x,"mousemove",B),b.unbind(x,"mouseup",D),w!==x&&(b.unbind(w,"mousemove",B),b.unbind(w,"mouseup",D)),b.remove(r),b.remove(o),O(n),t.fire("ObjectResized",{target:n,width:p,height:g}),b.setAttrib(n,"style",b.getAttrib(n,"style")),t.nodeChanged()},O=function(e){var h,N,S,k,T;P(),M(),h=b.getPos(e,E),c=h.x,l=h.y,T=e.getBoundingClientRect(),N=T.width||T.right-T.left,S=T.height||T.bottom-T.top,n!==e&&(n=e,p=g=0),k=t.fire("ObjectSelected",{target:e}),R(e)&&!k.isDefaultPrevented()?C(i,function(e,t){var i;(i=b.get("mceResizeHandle"+t))&&b.remove(i),i=b.add(E,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),oe.ie&&(i.contentEditable=!1),b.bind(i,"mousedown",function(t){t.stopImmediatePropagation(),t.preventDefault(),function(t){u=t.screenX,s=t.screenY,f=_(n).clientWidth,d=_(n).clientHeight,m=d/f,a=e,e.startPos={x:N*e[0]+c,y:S*e[1]+l},v=E.scrollWidth,y=E.scrollHeight,r=n.cloneNode(!0),b.addClass(r,"mce-clonedresizable"),b.setAttrib(r,"data-mce-bogus","all"),r.contentEditable=!1,r.unSelectabe=!0,b.setStyles(r,{left:c,top:l,margin:0}),r.removeAttribute("data-mce-selected"),E.appendChild(r),b.bind(x,"mousemove",B),b.bind(x,"mouseup",D),w!==x&&(b.bind(w,"mousemove",B),b.bind(w,"mouseup",D)),o=b.add(E,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},f+" × "+d)}(t)}),e.elm=i,b.setStyles(i,{left:N*e[0]+c-i.offsetWidth/2,top:S*e[1]+l-i.offsetHeight/2})}):P(),n.setAttribute("data-mce-selected","1")},P=function(){var e,t;M(),n&&n.removeAttribute("data-mce-selected");for(e in i)(t=b.get("mceResizeHandle"+e))&&(b.unbind(t),b.remove(t))},I=function(n){var r,o,i=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};h||t.removed||(C(b.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),o="mousedown"===n.type?n.target:e.getNode(),i(o=b.$(o).closest("table,img,figure.image,hr")[0],E)&&(F(),r=e.getStart(!0),i(r,o)&&i(e.getEnd(!0),o))?O(o):P())},L=function(e){return mg(function(e,t){for(;t&&t!==e;){if(hg(t)||mg(t))return t;t=t.parentNode}return null}(t.getBody(),e))},M=function(){for(var e in i){var t=i[e];t.elm&&(b.unbind(t.elm),delete t.elm)}},F=function(){try{t.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};t.on("init",function(){F(),oe.ie&&oe.ie>=11&&(t.on("mousedown click",function(e){var n=e.target,r=n.nodeName;h||!/^(TABLE|IMG|HR)$/.test(r)||L(n)||(2!==e.button&&t.selection.select(n,"TABLE"===r),"mousedown"===e.type&&t.nodeChanged())}),t.dom.bind(E,"mscontrolselect",function(e){var n=function(e){ce.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=ce.throttle(function(e){t.composing||I(e)});t.on("nodechange ResizeEditor ResizeWindow drop",e),t.on("keyup compositionend",function(t){n&&"TABLE"===n.nodeName&&e(t)}),t.on("hide blur",P),t.on("contextmenu",A)}),t.on("remove",M);return{isResizable:R,showResizeRect:O,hideResizeRect:P,updateResizeRect:I,destroy:function(){n=r=null}}},gg=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}},vg=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=gg(t).y-gg(l).y+c,a=l.clientHeight,i=l.scrollTop,void((r<i||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)}},yg=function(e){return ro.isContentEditableTrue(e)||ro.isContentEditableFalse(e)},bg=function(e,t,n){var r,o;if(n.caretPositionFromPoint)(o=n.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(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(i){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=At.toArray(o.getClientRects()),(i=i.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)),e-n})).length>0){t=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,t),o.collapse(!0),o}catch(a){}}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,yg))?null:e}(r,n.body)}return r},Cg=function(e,t){return W.map(t,function(t){var n=e.fire("GetSelectionRange",{range:t});return n.range!==t?n.range:t})},xg=function(e,t){return Bn.fromDom(e.dom().cloneNode(t))},wg=function(e){return xg(e,!0)},Ng=function(e){return xg(e,!1)},Sg=wg,Eg=function(e,t){var n=(t||document).createDocumentFragment();return W.each(e,function(e){n.appendChild(e.dom())}),Bn.fromDom(n)},kg=function(e){return Or.firstChild(e).fold(T.constant([e]),function(t){return[e].concat(kg(t))})},Tg=function(e){return Or.lastChild(e).fold(T.constant([e]),function(t){return"br"===Hn.name(t)?Or.prevSibling(t).map(function(t){return[e].concat(Tg(t))}).getOr([]):[e].concat(Tg(t))})},Ag=function(e,t){return Qa([function(e){var t=e.startContainer,n=e.startOffset;return ro.isText(t)?0===n?O.some(Bn.fromDom(t)):O.none():O.from(t.childNodes[n]).map(Bn.fromDom)}(t),function(e){var t=e.endContainer,n=e.endOffset;return ro.isText(t)?n===t.data.length?O.some(Bn.fromDom(t)):O.none():O.from(t.childNodes[n-1]).map(Bn.fromDom)}(t)],function(t,n){var r=W.find(kg(e),T.curry(Er.eq,t)),o=W.find(Tg(e),T.curry(Er.eq,n));return r.isSome()&&o.isSome()}).getOr(!1)},_g=dr("element","width","rows"),Rg=dr("element","cells"),Bg=dr("x","y"),Dg=function(e,t){var n=parseInt(nr(e,t),10);return isNaN(n)?1:n},Og=function(e,t,n){var r=e.rows();return!!(r[n]?r[n].cells():[])[t]},Pg=function(e){return W.foldl(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},Ig=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(Er.eq(o[i],t))return O.some(Bg(i,r));return O.none()},Lg=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(Rg(a[u].element(),c))}return i},Mg=function(e){var t=_g(Ng(e),0,[]);return W.each(vu(e,"tr"),function(e,n){W.each(vu(e,"td,th"),function(r,o){!function(e,t,n,r,o){for(var i=Dg(o,"rowspan"),a=Dg(o,"colspan"),u=e.rows(),s=n;s<n+i;s++){u[s]||(u[s]=Rg(Sg(r),[]));for(var c=t;c<t+a;c++)u[s].cells()[c]=s===n&&c===t?o:Ng(o)}}(t,function(e,t,n){for(;Og(e,t,n);)t++;return t}(t,o,n),n,e,r)})}),_g(t.element(),Pg(t.rows()),t.rows())},Fg=function(e){return function(e,t){var n=Ng(e.element()),r=Bn.fromTag("tbody");return du(r,t),lu.append(n,r),n}(e,function(e){return W.map(e.rows(),function(e){var t=W.map(e.cells(),function(e){var t=Sg(e);return rr(t,"colspan"),rr(t,"rowspan"),t}),n=Ng(e.element());return du(n,t),n})}(e))},zg=function(e,t,n){return Ig(e,t).bind(function(t){return Ig(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?Lg(e,r,o,i,a):Lg(e,r,a,i,o);return _g(e.element(),Pg(u),u)}(e,t,n)})})},Ug=function(e,t){return W.find(e,function(e){return"li"===Hn.name(e)&&Ag(e,t)}).fold(T.constant([]),function(t){return function(e){return W.find(e,function(e){return"ul"===Hn.name(e)||"ol"===Hn.name(e)})}(e).map(function(e){return[Bn.fromTag("li"),Bn.fromTag(Hn.name(e))]}).getOr([])})},Vg=function(e,t){var n=Bn.fromDom(t.commonAncestorContainer),r=ws(n,e),o=W.filter(r,function(e){return Qr.isInline(e)||Qr.isHeading(e)}),i=Ug(r,t),a=o.concat(i.length?i:function(e){return Qr.isListItem(e)?Or.parent(e).filter(Qr.isList).fold(T.constant([]),function(t){return[e,t]}):Qr.isList(e)?[e]:[]}(n));return W.map(a,Ng)},Hg=function(){return Eg([])},qg=function(e,t){return function(e,t){var n=W.foldl(t,function(e,t){return lu.append(t,e),t},e);return t.length>0?Eg([n]):n}(Bn.fromDom(t.cloneContents()),Vg(e,t))},jg=function(e,t){return function(e,t){return os(t,"table",T.curry(Er.eq,e))}(e,t[0]).bind(function(e){var n=t[0],r=t[t.length-1],o=Mg(e);return zg(o,n,r).map(function(e){return Eg([Fg(e)])})}).getOrThunk(Hg)},$g=function(e,t){var n=ff(t,e);return n.length>0?jg(e,n):function(e,t){return t.length>0&&t[0].collapsed?Hg():qg(e,t[0])}(e,t)},Wg=function(e,t){var n,r=e.selection.getRng(),o=e.dom.create("body"),i=e.selection.getSel(),a=Cg(e,of(i));if(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 e.selection.isCollapsed()?"":$o(r.text||(i.toString?i.toString():""));r.cloneContents?(n=t.contextual?$g(Bn.fromDom(e.getBody()),a).dom():r.cloneContents())&&o.appendChild(n):r.item!==undefined||r.htmlText!==undefined?(o.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),o.removeChild(o.firstChild)):o.innerHTML=r.toString(),t.getInner=!0;var u=e.selection.serializer.serialize(o,t);return"tree"===t.format?u:(t.content=e.selection.isCollapsed()?"":u,e.fire("GetContent",t),t.content)},Kg=function(e,t,n){var r,o,i,a=e.selection.getRng(),u=e.getDoc();if(n=n||{format:"html"},n.set=!0,n.selection=!0,n.content=t,n.no_events||!(n=e.fire("BeforeSetContent",n)).isDefaultPrevented()){if(t=n.content,a.insertNode){t+='<span id="__caret">_</span>',a.startContainer===u&&a.endContainer===u?u.body.innerHTML=t:(a.deleteContents(),0===u.body.childNodes.length?u.body.innerHTML=t:a.createContextualFragment?a.insertNode(a.createContextualFragment(t)):(o=u.createDocumentFragment(),i=u.createElement("div"),o.appendChild(i),i.outerHTML=t,a.insertNode(o))),r=e.dom.get("__caret"),(a=u.createRange()).setStartBefore(r),a.setEndBefore(r),e.selection.setRng(a),e.dom.remove("__caret");try{e.selection.setRng(a)}catch(s){}}else a.item&&(u.execCommand("Delete",!1,null),a=e.getRng()),/^\s+/.test(t)?(a.pasteHTML('<span id="__mce_tmp">_</span>'+t),e.dom.remove("__mce_tmp")):a.pasteHTML(t);n.no_events||e.fire("SetContent",n)}else e.fire("SetContent",n)},Xg=At.each,Yg=At.trim,Gg=function(e){return!(!e||!e.ownerDocument)&&Er.contains(Bn.fromDom(e.ownerDocument),Bn.fromDom(e))},Jg=function(e,t,n,r){this.dom=e,this.win=t,this.serializer=n,this.editor=r,this.bookmarkManager=new dg(this),this.controlSelection=pg(this,r)};Jg.prototype={setCursorLocation:function(e,t){var n=this.dom.createRng();e?(n.setStart(e,t),n.setEnd(e,t),this.setRng(n),this.collapse(!1)):(this._moveEndPoint(n,this.editor.getBody(),!0),this.setRng(n))},getContent:function(e){return Wg(this.editor,e)},setContent:function(e,t){Kg(this.editor,e,t)},getStart:function(e){var t,n=this.getRng();return 1===(t=n.startContainer).nodeType&&t.hasChildNodes()&&(e&&n.collapsed||(t=t.childNodes[Math.min(t.childNodes.length-1,n.startOffset)])),t&&3===t.nodeType?t.parentNode:t},getEnd:function(e){var t,n,r=this.getRng();return t=r.endContainer,n=r.endOffset,1===t.nodeType&&t.hasChildNodes()&&(e&&r.collapsed||(t=t.childNodes[n>0?n-1:n])),t&&3===t.nodeType?t.parentNode:t},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n,r=this.dom,o=r.createRng();return e&&(n=r.nodeIndex(e),o.setStart(e.parentNode,n),o.setEnd(e.parentNode,n+1),t&&(this._moveEndPoint(o,e,!0),this._moveEndPoint(o,e)),this.setRng(o)),e},isCollapsed:function(){var e=this.getRng(),t=this.getSel();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},collapse:function(e){var t=this.getRng();t.collapse(!!e),this.setRng(t)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){var t,n,r,o,i=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!this.win)return null;if(void 0===(o=this.win.document)||null===o)return null;if(this.editor.bookmark!==undefined&&!1===em(this.editor)){var a=dd(this.editor);if(a.isSome())return a.getOr(o.createRange())}try{(t=this.getSel())&&(n=t.rangeCount>0?t.getRangeAt(0):t.createRange?t.createRange():o.createRange())}catch(u){}return(n=Cg(this.editor,[n])[0])||(n=o.createRange?o.createRange():o.body.createTextRange()),n.setStart&&9===n.startContainer.nodeType&&n.collapsed&&(r=this.dom.getRoot(),n.setStart(r,0),n.setEnd(r,0)),this.selectedRange&&this.explicitRange&&(0===i(n.START_TO_START,n,this.selectedRange)&&0===i(n.END_TO_END,n,this.selectedRange)?n=this.explicitRange:(this.selectedRange=null,this.explicitRange=null)),n},setRng:function(e,t){var n,r,o;if(function(e){return!!e&&(!!e.select||Gg(e.startContainer)&&Gg(e.endContainer))}(e))if(e.select){this.explicitRange=null;try{e.select()}catch(i){}}else{if(n=this.getSel(),o=this.editor.fire("SetSelectionRange",{range:e,forward:t}),e=o.range,n){this.explicitRange=e;try{n.removeAllRanges(),n.addRange(e)}catch(i){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),this.selectedRange=n.rangeCount>0?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExtent||oe.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(r=e.startContainer.childNodes[e.startOffset])&&"IMG"===r.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(r,0,r,1)),this.editor.fire("AfterSetSelectionRange",{range:e,forward:t})}},setNode:function(e){return this.setContent(this.dom.getOuterHTML(e)),e},getNode:function(){var e,t,n,r,o,i=this.getRng(),a=this.dom.getRoot(),u=function(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n};return i?(t=i.startContainer,n=i.endContainer,r=i.startOffset,o=i.endOffset,e=i.commonAncestorContainer,!i.collapsed&&(t===n&&o-r<2&&t.hasChildNodes()&&(e=t.childNodes[r]),3===t.nodeType&&3===n.nodeType&&(t=t.length===r?u(t.nextSibling,!0):t.parentNode,n=0===o?u(n.previousSibling,!1):n.parentNode,t&&t===n))?t:e&&3===e.nodeType?e.parentNode:e):a},getSelectedBlocks:function(e,t){var n,r,o=this.dom,i=[];if(r=o.getRoot(),e=o.getParent(e||this.getStart(),o.isBlock),t=o.getParent(t||this.getEnd(),o.isBlock),e&&e!==r&&i.push(e),e&&t&&e!==t){n=e;for(var a=new Xr(e,r);(n=a.next())&&n!==t;)o.isBlock(n)&&i.push(n)}return t&&e!==t&&t!==r&&i.push(t),i},isForward:function(){var e,t,n=this.dom,r=this.getSel();return!(r&&r.anchorNode&&r.focusNode)||((e=n.createRng()).setStart(r.anchorNode,r.anchorOffset),e.collapse(!0),(t=n.createRng()).setStart(r.focusNode,r.focusOffset),t.collapse(!0),e.compareBoundaryPoints(e.START_TO_START,t)<=0)},normalize:function(){var e=this,t=e.getRng();if(!uf(e.getSel())){var n=Lf(e.dom,t);return n.each(function(t){e.setRng(t,e.isForward())}),n.getOr(t)}return t},selectorChanged:function(e,t){var n,r=this;return r.selectorChangedData||(r.selectorChangedData={},n={},r.editor.on("NodeChange",function(e){var t=e.element,o=r.dom,i=o.getParents(t,null,o.getRoot()),a={};Xg(r.selectorChangedData,function(e,t){Xg(i,function(r){if(o.is(r,t))return n[t]||(Xg(e,function(e){e(!0,{node:r,selector:t,parents:i})}),n[t]=e),a[t]=e,!1})}),Xg(n,function(e,r){a[r]||(delete n[r],Xg(e,function(e){e(!1,{node:t,selector:r,parents:i})}))})})),r.selectorChangedData[e]||(r.selectorChangedData[e]=[]),r.selectorChangedData[e].push(t),r},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!==t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){vg(this.editor,e,t)},placeCaretAt:function(e,t){this.setRng(bg(e,t,this.editor.getDoc()))},_moveEndPoint:function(e,t,n){var r=t,o=new Xr(t,r),i=this.dom.schema.getNonEmptyElements();do{if(3===t.nodeType&&0!==Yg(t.nodeValue).length)return void(n?e.setStart(t,0):e.setEnd(t,t.nodeValue.length));if(i[t.nodeName]&&!/^(TD|TH)$/.test(t.nodeName))return void(n?e.setStartBefore(t):"BR"===t.nodeName?e.setEndBefore(t):e.setEndAfter(t));if(oe.ie&&oe.ie<11&&this.dom.isBlock(t)&&this.dom.isEmpty(t))return void(n?e.setStart(t,0):e.setEnd(t,0))}while(t=n?o.next():o.prev());"BODY"===r.nodeName&&(n?e.setStart(r,0):e.setEnd(r,r.childNodes.length))},getBoundingClientRect:function(){var e=this.getRng();return e.collapsed?$i.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){this.win=null,this.controlSelection.destroy()}};var Qg=Ri.curry,Zg=function(e,t,n,r,o,i){var a,u,s=0,c=[],l=function(r){var i,a,l;for(l=eh.getClientRects(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,Nt.last(c))&&s++,a.line=s,o(a))return!0;c.push(a)}};return(u=Nt.last(i.getClientRects()))?(a=i.getNode(),l(a),function(e,t,n,r){for(;r=fa.findNode(r,e,di,t);)if(n(r))return}(e,r,l,a),c):c},ev={upUntil:Qg(Zg,-1,xi,wi),downUntil:Qg(Zg,1,wi,xi),positionsUntil:function(e,t,n,r){var o,i,a,u,s,c,l=Sa(t),f=[],d=0,m=function(e){return Nt.last(e.getClientRects())};1===e?(o=l.next,i=wi,a=xi,u=$i.after(r)):(o=l.prev,i=xi,a=wi,u=$i.before(r)),c=m(u);do{if(u.isVisible()&&(s=m(u),!a(s,c))){if(f.length>0&&i(s,Nt.last(f))&&d++,s=yi(s),s.position=u,s.line=d,n(s))return f;f.push(s)}}while(u=o(u));return f},isAboveLine:Qg(function(e,t){return t.line>e}),isLine:Qg(function(e,t){return t.line===e})},tv=ro.isContentEditableFalse,nv=Si,rv=fa.isAfterContentEditableFalse,ov=fa.isBeforeContentEditableFalse,iv=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},av=function(e,t,n){return n=fa.normalizeRange(e,t,n),-1===e?$i.fromRangeStart(n):$i.fromRangeEnd(n)},uv=function(e,t,n,r,o){var i,a,u,s;return!o.collapsed&&(i=nv(o),tv(i))?vh(e,t,i,-1===e):(s=function(e){return Zo.isCaretContainerBlock(e.startContainer)}(o),a=av(e,t.getBody(),o),r(a)?yh(t,a.getNode(-1===e)):(a=n(a))?r(a)?vh(e,t,a.getNode(-1===e),1===e):(u=n(a),r(u)&&function(e,t){var n=fa.isInSameBlock(e,t);return!(n||!ro.isBr(e.getNode()))||n}(a,u)?vh(e,t,u.getNode(-1===e),1===e):s?Ch(t,a.toRange()):null):s?o:null)},sv=function(e,t,n){var r,o,i=Sa(e.getBody()),a=Ri.curry(iv,i.next),u=Ri.curry(iv,i.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?a($i.fromRangeStart(n)):u($i.fromRangeStart(n)))||(o=function(e){var t=e.dom.create(e.settings.forced_root_block);return(!oe.ie||oe.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())}},cv=function(e,t){var n,r=t?1:-1,o=t?ev.downUntil:ev.upUntil,i=e.selection.getRng();return(n=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=nv(r),o=av(e,t.getBody(),r),i=n(t.getBody(),ev.isAboveLine(1),o),a=Nt.filter(i,ev.isLine(1)),s=Nt.last(o.getClientRects()),ov(o)&&(d=o.getNode()),rv(o)&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=ch(a,c))&&tv(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),vh(e,t,u.node,l<f);if(d){var m=ev.positionsUntil(e,t.getBody(),ev.isAboveLine(1),d);if(u=ch(Nt.filter(m,ev.isLine(1)),c))return Ch(t,u.position.toRange());if(u=Nt.last(Nt.filter(m,ev.isLine(0))))return Ch(t,u.position.toRange())}}(r,e,o,i))?n:(n=sv(e,r,i))||null},lv=function(e,t){return function(){var n=function(e,t){var n,r=Sa(e.getBody()),o=Ri.curry(iv,r.next),i=Ri.curry(iv,r.prev),a=t?1:-1,u=t?o:i,s=t?ov:rv,c=e.selection.getRng();return(n=uv(a,e,u,s,c))?n:(n=sv(e,a,c))||null}(e,t);return!!n&&(e.selection.setRng(n),!0)}},fv=function(e,t){return function(){var n=cv(e,t);return!!n&&(e.selection.setRng(n),!0)}},dv=function(e,t){return W.bind(function(e){return W.map(e,function(e){return Fp.merge({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:T.noop},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]:[]})},mv=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)}},hv=function(e,t){return W.find(dv(e,t),function(e){return e.action()})},pv=function(e,t){e.on("keydown",function(n){!1===n.isDefaultPrevented()&&function(e,t,n){var r=_n.detect().os;hv([{keyCode:wh.RIGHT,action:lv(e,!0)},{keyCode:wh.LEFT,action:lv(e,!1)},{keyCode:wh.UP,action:fv(e,!1)},{keyCode:wh.DOWN,action:fv(e,!0)},{keyCode:wh.RIGHT,action:Vl.move(e,t,!0)},{keyCode:wh.LEFT,action:Vl.move(e,t,!1)},{keyCode:wh.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:Vl.moveNextWord(e,t)},{keyCode:wh.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:Vl.movePrevWord(e,t)}],n).each(function(e){n.preventDefault()})}(e,t,n)})},gv=function(e){return 1===Or.children(e).length},vv=function(e,t){var n=Bn.fromDom(e.getBody()),r=Bn.fromDom(e.selection.getStart()),o=W.filter(function(e,t){var n=ws(t,e);return W.findIndex(n,Qr.isBlock).fold(T.constant(n),function(e){return n.slice(0,e)})}(n,r),gv);return W.last(o).map(function(n){var r=$i.fromRangeStart(e.selection.getRng());return!!ns(t,r,n.dom())&&(function(e,t,n,r){var o=T.curry(cl,t),i=W.map(W.filter(r,o),function(e){return e.dom()});if(0===i.length)Ys(t,e,n);else{var a=sl(n.dom(),i);t.selection.setRng(a.toRange())}}(t,e,n,o),!0)}).getOr(!1)},yv=function(e,t){return!!e.selection.isCollapsed()&&vv(e,t)},bv=function(e,t){e.on("keydown",function(n){!1===n.isDefaultPrevented()&&function(e,t,n){hv([{keyCode:wh.BACKSPACE,action:mv(Qs,e,!1)},{keyCode:wh.DELETE,action:mv(Qs,e,!0)},{keyCode:wh.BACKSPACE,action:mv($l,e,t,!1)},{keyCode:wh.DELETE,action:mv($l,e,t,!0)},{keyCode:wh.BACKSPACE,action:mv(Os,e,!1)},{keyCode:wh.DELETE,action:mv(Os,e,!0)},{keyCode:wh.BACKSPACE,action:mv(_s,e,!1)},{keyCode:wh.DELETE,action:mv(_s,e,!0)},{keyCode:wh.BACKSPACE,action:mv(wf,e,!1)},{keyCode:wh.DELETE,action:mv(wf,e,!0)},{keyCode:wh.BACKSPACE,action:mv(yv,e,!1)},{keyCode:wh.DELETE,action:mv(yv,e,!0)}],n).each(function(e){n.preventDefault()})}(e,t,n)}),e.on("keyup",function(t){!1===t.isDefaultPrevented()&&function(e,t){hv([{keyCode:wh.BACKSPACE,action:mv(Zs,e)},{keyCode:wh.DELETE,action:mv(Zs,e)}],t)}(e,t)})},Cv=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},xv=function(e){return e.getParam("iframe_attrs",{})},wv=function(e){return e.getParam("doctype","<!DOCTYPE html>")},Nv=function(e){return e.getParam("document_base_url","")},Sv=function(e){return Cv(e,"body_id","tinymce")},Ev=function(e){return Cv(e,"body_class","")},kv=function(e){return e.getParam("content_security_policy","")},Tv=function(e){return e.getParam("br_in_pre",!0)},Av=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},_v=function(e){return e.getParam("forced_root_block_attrs",{})},Rv=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},Bv=function(e){return e.getParam("no_newline_selector","")},Dv=function(e){return e.getParam("keep_styles",!0)},Ov=function(e){return e.getParam("end_container_on_empty_block",!1)},Pv=function(e){return O.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},Iv=function(e,t){var n,r,o,i=t,a=e.dom,u=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var s=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);s&&/^(UL|OL|DL)$/.test(s.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(o=a.createRng(),t.normalize(),t.hasChildNodes()){for(n=new Xr(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)}},Lv=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},Mv=Pv,Fv=function(e){return Pv(e).fold(T.constant(""),function(e){return e.nodeName.toUpperCase()})},zv=function(e){return Pv(e).filter(function(e){return Qr.isListItem(Bn.fromDom(e))}).isSome()},Uv=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},Vv=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},Hv=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},qv=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!ro.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},jv=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){(function(e){return Vv(e)&&Vv(e.parentNode)})(n)&&(o="LI");var u=o?t(o):i.create("BR");if(qv(n,r,!0)&&qv(n,r,!1))Uv(n,"LI")?i.insertAfter(u,Hv(n)):i.replace(u,n);else if(qv(n,r,!0))Uv(n,"LI")?(i.insertAfter(u,Hv(n)),u.appendChild(i.doc.createTextNode(" ")),u.appendChild(n)):n.parentNode.insertBefore(u,n);else if(qv(n,r,!1))i.insertAfter(u,Hv(n));else{n=Hv(n);var s=a.cloneRange();s.setStartAfter(r),s.setEndAfter(n);var c=s.extractContents();"LI"===o&&function(e,t){return e.firstChild&&e.firstChild.nodeName===t}(c,"LI")?(u=c.firstChild,i.insertAfter(c,n)):(i.insertAfter(c,n),i.insertAfter(u,n))}i.remove(r),Iv(e,u)}},$v=function(e){return e&&"A"===e.nodeName&&0===At.trim($o(e.innerText||e.textContent)).length},Wv=function(e){e.innerHTML='<br data-mce-bogus="1">'},Kv=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},Xv=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)},Yv=function(e,t,n){return!1===ro.isText(t)?n:e?1===n&&t.data.charAt(n-1)===jo?0:n:n===t.data.length-1&&t.data.charAt(n)===jo?t.data.length:n},Gv=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},Jv=function(e,t){var n=Av(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&e.dom.setAttribs(t,_v(e))},Qv=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,h,p=e.dom,g=e.schema,v=g.getNonEmptyElements(),y=e.selection.getRng(),b=function(t){var n,i,u,s=o,c=g.getTextInlineElements();if(t||"TABLE"===f||"HR"===f?(n=p.create(t||m),Jv(e,n)):n=a.cloneNode(!1),u=n,!1===Dv(e))p.setAttrib(n,"style",null),p.setAttrib(n,"class",null);else do{if(c[s.nodeName]){if(al(s))continue;i=s.cloneNode(!1),p.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(u=i,n.appendChild(i))}}while((s=s.parentNode)&&s!==r);return Wv(u),n},C=function(e){var t,n,r,u;if(u=Yv(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(Kv(o,"TABLE")||Kv(o,"HR"))return h&&!e||!h&&e;for(t=new Xr(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?b(m):b(),Ov(e)&&Xv(p,l)&&p.isEmpty(a)?s=p.split(l,a):p.insertAfter(s,a),Iv(e,s)};Lf(p,y).each(function(e){y.setStart(e.startContainer,e.startOffset),y.setEnd(e.endContainer,e.endOffset)}),o=y.startContainer,i=y.startOffset,m=Av(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=Gv(p,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=Gv(d,r);if(!(a=d.getParent(r,d.isBlock))||!Xv(d,a)){if(a=a||m,l=a===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),Jv(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),Jv(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,y,o,i)),a=p.getParent(o,p.isBlock),l=a?p.getParent(a.parentNode,p.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)&&p.isEmpty(a)?jv(e,b,l,a,m):m&&a===e.getBody()||(m=m||"P",Zo.isCaretContainerBlock(a)?(s=Zo.showCaretContainerBlock(a),p.isEmpty(a)&&Wv(a),Iv(e,s)):C()?x():C(!0)?(s=a.parentNode.insertBefore(b(),a),Iv(e,Kv(a,"HR")?s:a)):((n=function(e){var t=e.cloneRange();return t.setStart(e.startContainer,Yv(!0,e.startContainer,e.startOffset)),t.setEnd(e.endContainer,Yv(!1,e.endContainer,e.endOffset)),t}(y).cloneRange()).setEndAfter(a),function(e){do{ro.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild}while(e)}(c=n.extractContents()),s=c.firstChild,p.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):$v(o)&&e.remove(o)}}(p,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")}(p,a),p.isEmpty(a)&&Wv(a),s.normalize(),p.isEmpty(s)?(p.remove(s),x()):Iv(e,s)),p.setAttrib(s,"id",""),e.fire("NewBlock",{newBlock:s})))},Zv=function(e,t){return Mv(e).filter(function(e){return t.length>0&&xr(Bn.fromDom(e),t)}).isSome()},ey=function(e){return Zv(e,Rv(e))},ty=function(e){return Zv(e,Bv(e))},ny=Ps([{br:[]},{block:[]},{none:[]}]),ry=function(e,t){return ty(e)},oy=function(e){return function(t,n){return""===Av(t)===e}},iy=function(e){return function(t,n){return zv(t)===e}},ay=function(e){return function(t,n){return"PRE"===Fv(t)===e}},uy=function(e){return function(t,n){return Tv(t)===e}},sy=function(e,t){return ey(e)},cy=function(e,t){return t},ly=function(e){var t=Av(e),n=Lv(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},fy=function(e,t){return function(n,r){return W.foldl(e,function(e,t){return e&&t(n,r)},!0)?O.some(t):O.none()}},dy=function(e,t){return ll([fy([ry],ny.none()),fy([ay(!0),uy(!1),cy],ny.br()),fy([ay(!0),uy(!1)],ny.block()),fy([ay(!0),uy(!0),cy],ny.block()),fy([ay(!0),uy(!0)],ny.br()),fy([iy(!0),cy],ny.br()),fy([iy(!0)],ny.block()),fy([oy(!0),cy,ly],ny.block()),fy([oy(!0)],ny.br()),fy([sy],ny.br()),fy([oy(!1),cy],ny.br()),fy([ly],ny.block())],[e,t.shiftKey]).getOr(ny.none())},my=function(e,t){dy(e,t).fold(function(){Wf(e,t)},function(){Qv(e,t)},T.noop)},hy=function(e){e.on("keydown",function(t){t.keyCode===wh.ENTER&&function(e,t){t.isDefaultPrevented()||(t.preventDefault(),function(e){e.typing&&(e.typing=!1,e.add())}(e.undoManager),e.undoManager.transact(function(){!1===e.selection.isCollapsed()&&e.execCommand("Delete"),my(e,t)}))}(e,t)})},py=function(e,t,n){return!!function(e,t){return gy(e)&&ro.isText(t.container())}(n,t)&&(function(e,t){var n=t.container(),r=t.offset();n.insertData(r,"\xa0"),e.selection.setCursorLocation(n,r+1)}(e,t),!0)},gy=function(e){return e.fold(T.constant(!1),T.constant(!0),T.constant(!0),T.constant(!1))},vy=function(e){return!!e.selection.isCollapsed()&&function(e){var t=T.curry(Zu.isInlineTarget,e),n=$i.fromRangeStart(e.selection.getRng());return Al(t,e.getBody(),n).map(T.curry(py,e,n)).getOr(!1)}(e)},yy=function(e){e.on("keydown",function(t){!1===t.isDefaultPrevented()&&function(e,t){hv([{keyCode:wh.SPACEBAR,action:mv(vy,e)}],t).each(function(e){t.preventDefault()})}(e,t)})},by=function(e){var t=Vl.setupSelectedState(e);pv(e,t),bv(e,t),hy(e),yy(e)},Cy=function(e){var t=At.each,n=wh.BACKSPACE,r=wh.DELETE,o=e.dom,i=e.selection,a=e.settings,u=e.parser,s=oe.gecko,c=oe.ie,l=oe.webkit,f="data:text/mce-internal,",d=c?"Text":"URL",m=function(t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},h=function(e){return e.isDefaultPrevented()},p=function(){e.shortcuts.add("meta+a",null,"SelectAll")},g=function(){e.on("keydown",function(e){if(!h(e)&&e.keyCode===n&&i.isCollapsed()&&0===i.getRng(!0).startOffset){var t=i.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},v=function(){e.inline||(e.contentStyles.push("body {min-height: 150px}"),e.on("click",function(t){var n;if("HTML"===t.target.nodeName){if(oe.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,a,u,s;if(!h(t)&&t.keyCode===wh.BACKSPACE&&(n=i.getRng(),r=n.startContainer,a=n.startOffset,u=o.getRoot(),s=r,n.collapsed&&0===a)){for(;s&&s.parentNode&&s.parentNode.firstChild===s&&s.parentNode!==u;)s=s.parentNode;"BLOCKQUOTE"===s.tagName&&(e.formatter.toggle("blockquote",null,s),(n=o.createRng()).setStart(r,0),n.setEnd(r,0),i.setRng(n))}}),function(){var t=function(e){var t=o.create("body"),n=e.cloneContents();return t.appendChild(n),i.serializer.serialize(t,{format:"html"})};e.on("keydown",function(i){var a,u,s=i.keyCode;if(!h(i)&&(s===r||s===n)){if(a=e.selection.isCollapsed(),u=e.getBody(),a&&!o.isEmpty(u))return;if(!a&&!function(n){var r=t(n),i=o.createRng();return i.selectNode(e.getBody()),r===t(i)}(e.selection.getRng()))return;i.preventDefault(),e.setContent(""),u.firstChild&&o.isBlock(u.firstChild)?e.selection.setCursorLocation(u.firstChild,0):e.selection.setCursorLocation(u,0),e.nodeChanged()}})}(),oe.windowsPhone||e.on("keyup focusin mouseup",function(e){wh.modifierPressed(e)||i.normalize()},!0),l&&(e.settings.content_editable||o.bind(e.getDoc(),"mousedown mouseup",function(t){var n;if(t.target===e.getDoc().documentElement)if(n=i.getRng(),e.getBody().focus(),"mousedown"===t.type){if(Zo.isCaretContainer(n.startContainer))return;i.placeCaretAt(t.clientX,t.clientY)}else i.setRng(n)}),e.on("click",function(t){var n=t.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==o.getContentEditableParent(n)&&(t.preventDefault(),e.selection.select(n),e.nodeChanged()),"A"===n.nodeName&&o.hasClass(n,"mce-item-anchor")&&(t.preventDefault(),i.select(n))}),a.forced_root_block&&e.on("init",function(){m("DefaultParagraphSeparator",a.forced_root_block)}),e.on("init",function(){e.dom.bind(e.getBody(),"submit",function(e){e.preventDefault()})}),g(),u.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),oe.iOS?(e.inline||e.on("keydown",function(){document.activeElement===document.body&&e.getWin().focus()}),v(),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}")):p()),oe.ie>=11&&(v(),g()),oe.ie&&(p(),m("AutoUrlDetect",!1),e.on("dragstart",function(t){!function(t){var n,r;t.dataTransfer&&(e.selection.isCollapsed()&&"IMG"===t.target.tagName&&i.select(t.target),(n=e.selection.getContent()).length>0&&(r=f+escape(e.id)+","+escape(n),t.dataTransfer.setData(d,r)))}(t)}),e.on("drop",function(t){if(!h(t)){var n=function(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(d))&&t.indexOf(f)>=0?(t=t.substr(f.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}(t);if(n&&n.id!==e.id){t.preventDefault();var r=bg(t.x,t.y,e.getDoc());i.setRng(r),function(t,n){e.queryCommandSupported("mceInsertClipboardContent")?e.execCommand("mceInsertClipboardContent",!1,{content:t,internal:n}):e.execCommand("mceInsertContent",!1,t)}(n.html,!0)}}})),s&&(e.on("keydown",function(t){if(!h(t)&&t.keyCode===n){if(!e.getBody().getElementsByTagName("hr").length)return;if(i.isCollapsed()&&0===i.getRng(!0).startOffset){var r=i.getNode(),a=r.previousSibling;if("HR"===r.nodeName)return o.remove(r),void t.preventDefault();a&&a.nodeName&&"hr"===a.nodeName.toLowerCase()&&(o.remove(a),t.preventDefault())}}}),Range.prototype.getClientRects||e.on("mousedown",function(t){if(!h(t)&&"HTML"===t.target.nodeName){var n=e.getBody();n.blur(),ce.setEditorTimeout(e,function(){n.focus()})}}),function(){var n=function(){var n=o.getAttribs(i.getStart().cloneNode(!1));return function(){var r=i.getStart();r!==e.getBody()&&(o.setAttrib(r,"style",null),t(n,function(e){r.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!i.isCollapsed()&&o.getParent(i.getStart(),o.isBlock)!==o.getParent(i.getEnd(),o.isBlock)};e.on("keypress",function(t){var o;if(!h(t)&&(8===t.keyCode||46===t.keyCode)&&r())return o=n(),e.getDoc().execCommand("delete",!1,null),o(),t.preventDefault(),!1}),o.bind(e.getDoc(),"cut",function(t){var o;!h(t)&&r()&&(o=n(),ce.setEditorTimeout(e,function(){o()}))})}(),a.readonly||e.on("BeforeExecCommand MouseDown",function(){m("StyleWithCSS",!1),m("enableInlineTableEditing",!1),a.object_resizing||m("enableObjectResizing",!1)}),e.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||t(o.select("a"),function(e){var t=e.parentNode,n=o.getRoot();if(t.lastChild===e){for(;t&&!o.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}o.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}"),oe.mac&&e.on("keydown",function(t){!wh.metaKeyPressed(t)||t.shiftKey||37!==t.keyCode&&39!==t.keyCode||(t.preventDefault(),e.selection.getSel().modify("move",37===t.keyCode?"backward":"forward","lineboundary"))}),g()),{refreshContentEditable:function(){},isHidden:function(){var t;return!s||e.removed?0:!(t=e.selection.getSel())||!t.rangeCount||0===t.rangeCount}}},xy=Io.DOM,wy=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&&ce.setEditorTimeout(e,function(){var t;(t=!0===e.settings.auto_focus?e:e.editorManager.get(e.settings.auto_focus)).destroyed||t.focus()},100)}(e)},Ny=function(e,t){var n,r,o=e.settings,i=e.getElement(),a=e.getDoc();o.inline||(e.getElement().style.visibility=e.orgVisibility),t||o.content_editable||(a.open(),a.write(e.iframeHTML),a.close()),o.content_editable&&(e.on("remove",function(){var e=this.getBody();xy.removeClass(e,"mce-content-body"),xy.removeClass(e,"mce-edit-focus"),xy.setAttrib(e,"contentEditable",null)}),xy.addClass(i,"mce-content-body"),e.contentDocument=a=o.content_document||document,e.contentWindow=o.content_window||window,e.bodyElement=i,o.content_document=o.content_window=null,o.root_name=i.nodeName.toLowerCase()),(n=e.getBody()).disabled=!0,e.readonly=o.readonly,e.readonly||(e.inline&&"static"===xy.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=e.getParam("content_editable_state",!0)),n.disabled=!1,e.editorUpload=Im(e),e.schema=Eo(o),e.dom=new Io(a,{keep_values:!0,url_converter:e.convertURL,url_converter_scope:e,hex_colors:o.force_hex_style_colors,class_filter:o.class_filter,update_styles:!0,root_element:e.inline?e.getBody():null,collect:o.content_editable,schema:e.schema,onSetAttrib:function(t){e.fire("SetAttrib",t)}}),e.parser=function(e){var t=og(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(r=t[a],o=r.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 Gp("br",1)).shortEnded=!0)}),t}(e),e.serializer=sg(o,e),e.selection=new Jg(e.dom,e.getWin(),e.serializer,e),e.formatter=Pp(e),e.undoManager=Hh(e),e._nodeChangeDispatcher=new Um(e),e._selectionOverrides=Th(e),fg(e),by(e),zm(e),e.fire("PreInit"),o.browser_spellcheck||o.gecko_spellcheck||(a.body.spellcheck=!1,xy.setAttrib(n,"spellcheck","false")),e.quirks=Cy(e),e.fire("PostRender"),o.directionality&&(n.dir=o.directionality),o.nowrap&&(n.style.whiteSpace="nowrap"),o.protect&&e.on("BeforeSetContent",function(e){At.each(o.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())}),o.padd_empty_editor&&e.on("PostProcess",function(e){e.content=e.content.replace(/^(<p[^>]*>( | |\s|\u00a0|<br \/>|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")}),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&&(r="",At.each(e.contentStyles,function(e){r+=e+"\r\n"}),e.dom.addStyle(r)),function(e){return e.inline?xy.styleSheetLoader:e.dom.styleSheetLoader}(e).loadAll(e.contentCSS,function(t){wy(e)},function(t){wy(e)}),o.content_style&&function(e,t){var n=Bn.fromDom(e.getDoc().head),r=Bn.fromTag("style");er(r,"type","text/css"),lu.append(r,Bn.fromText(t)),lu.append(n,r)}(e,o.content_style)},Sy=Io.DOM,Ey=function(e,t){var n=e.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),r=function(e,t,n,r){var o=Bn.fromTag("iframe");return tr(o,r),tr(o,{id:e+"_ifr",frameBorder:"0",allowTransparency:"true",title:t}),lr(o,{width:"100%",height:function(e){var t="number"==typeof e?e+"px":e;return t||""}(n),display:"block"}),o}(e.id,n,t.height,xv(e)).dom();r.onload=function(){r.onload=null,e.fire("load")};var o=function(e,t){if(document.domain!==window.location.hostname&&oe.ie&&oe.ie<12){var n=Pm("mce");e[n]=function(){Ny(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return Sy.setAttrib(t,"src",r),!0}return!1}(e,r);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=r,e.iframeHTML=function(e){var t,n,r;return r=wv(e)+"<html><head>",Nv(e)!==e.documentBaseUrl&&(r+='<base href="'+e.documentBaseURI.getURI()+'" />'),r+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',t=Sv(e),n=Ev(e),kv(e)&&(r+='<meta http-equiv="Content-Security-Policy" content="'+kv(e)+'" />'),r+='</head><body id="'+t+'" class="mce-content-body '+n+'" data-id="'+e.id+'"><br></body></html>'}(e),Sy.add(t.iframeContainer,r),o},ky=function(e,t){var n=Ey(e,t);t.editorContainer&&(Sy.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=Sy.isHidden(t.editorContainer)),e.getElement().style.display="none",Sy.setAttrib(e.id,"aria-hidden",!0),n||Ny(e)},Ty=Io.DOM,Ay=function(e,t,n){var r,o,i=bm.get(n);if(r=bm.urls[n]||e.documentBaseUrl.replace(/\/$/,""),n=At.trim(n),i&&-1===At.inArray(t,n)){if(At.each(bm.dependencies(n),function(n){Ay(e,t,n)}),e.plugins[n])return;o=new i(e,r,e.$),e.plugins[n]=o,o.init&&(o.init(e,r),t.push(n))}},_y=function(e){return e.replace(/^\-/,"")},Ry=function(e){return{editorContainer:e,iframeContainer:e}},By=function(e){var t=e.getElement();return e.inline?Ry(null):function(e){var t=Ty.create("div");return Ty.insertAfter(t,e),Ry(t)}(t)},Dy=function(e){var t=e.settings,n=e.getElement();return e.orgDisplay=n.style.display,jn.isString(t.theme)?function(e){var t,n,r,o,i,a=e.settings,u=e.getElement();return t=a.width||Ty.getStyle(u,"width")||"100%",n=a.height||Ty.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):jn.isFunction(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):By(e)},Oy=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||Ty.getAttrib(r,"aria-label",e.getLang("aria.rich_text_area")),e.fire("ScriptsLoaded"),function(e){var t,n=e.settings.theme;jn.isString(n)?(e.settings.theme=_y(n),t=Cm.get(n),e.theme=new t(e,Cm.urls[n]),e.theme.init&&e.theme.init(e,Cm.urls[n]||e.documentBaseUrl.replace(/\/$/,""),e.$)):e.theme={}}(e),function(e){var t=[];At.each(e.settings.plugins.split(/[ ,]/),function(n){Ay(e,t,_y(n))})}(e),t=Dy(e),e.editorContainer=t.editorContainer?t.editorContainer:null,n.content_css&&At.each(At.explode(n.content_css),function(t){e.contentCSS.push(e.documentBaseURI.toAbsolute(t))}),n.content_editable?Ny(e):ky(e,t)},Py=Io.DOM,Iy=function(e){return"-"===e.charAt(0)},Ly=function(e,t){var n=Uo.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(jn.isString(i)){if(!Iy(i)&&!Cm.urls.hasOwnProperty(i)){var a=o.theme_url;a?Cm.load(i,t.documentBaseURI.toAbsolute(a)):Cm.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){Cm.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){At.isArray(e.plugins)&&(e.plugins=e.plugins.join(" ")),At.each(e.external_plugins,function(t,n){bm.load(n,t),e.plugins+=" "+n}),At.each(e.plugins.split(/[ ,]/),function(e){if((e=At.trim(e))&&!bm.urls[e])if(Iy(e)){e=e.substr(1,e.length);var n=bm.dependencies(e);At.each(n,function(e){var n={prefix:"plugins/",resource:e,suffix:"/plugin"+t+".js"};e=bm.createUrl(n,e),bm.load(e.resource,e)})}else bm.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+t+".js"})})}(e.settings,t),n.loadQueue(function(){e.removed||Oy(e)},e,function(t){pm(e,t[0]),e.removed||Oy(e)})})},My=function(e){var t=e.settings,n=e.id,r=function(){Py.unbind(window,"ready",r),e.render()};if(ye.Event.domLoaded){if(e.getElement()&&oe.contentEditable){t.inline?e.inline=!0:(e.orgVisibility=e.getElement().style.visibility,e.getElement().style.visibility="hidden");var o=e.getElement().form||Py.getParent(n,"form");o&&(e.formElement=o,t.hidden_input&&!/TEXTAREA|INPUT/i.test(e.getElement().nodeName)&&(Py.insertAfter(Py.create("input",{type:"hidden",name:n}),n),e.hasHiddenInput=!0),e.formEventDelegate=function(t){e.fire(t.type,t)},Py.bind(o,"submit reset",e.formEventDelegate),e.on("reset",function(){e.setContent(e.startContent,{format:"raw"})}),!t.submit_patch||o.submit.nodeType||o.submit.length||o._mceOldSubmit||(o._mceOldSubmit=o.submit,o.submit=function(){return e.editorManager.triggerSave(),e.setDirty(!1),o._mceOldSubmit(o)})),e.windowManager=lm(e),e.notificationManager=cm(e),"xml"===t.encoding&&e.on("GetContent",function(e){e.save&&(e.content=Py.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),Ly(e,e.suffix)}}else Py.bind(window,"ready",r)},Fy=function(e,t,n){var r=e.sidebars?e.sidebars:[];r.push({name:t,settings:n}),e.sidebars=r},zy=At.each,Uy=At.trim,Vy="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Hy={ftp:21,http:80,https:443,mailto:25},qy=function(e,t){var n,r,o=this;if(e=Uy(e),t=o.settings=t||{},n=t.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))o.source=e;else{var i=0===e.indexOf("//");0!==e.indexOf("/")||i||(e=(n?n.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(r=t.base_uri?t.base_uri.path:new qy(document.location.href).directory,""==t.base_uri.protocol?e="//mce_host"+o.toAbsPath(r,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(n&&n.protocol||"http")+"://mce_host"+o.toAbsPath(r,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),zy(Vy,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),o[t]=r}),n&&(o.protocol||(o.protocol=n.protocol),o.userInfo||(o.userInfo=n.userInfo),o.port||"mce_host"!==o.host||(o.port=n.port),o.host&&"mce_host"!==o.host||(o.host=n.host),o.source=""),i&&(o.protocol="")}};qy.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 qy(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 qy(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=Hy[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.substring(0,e.lastIndexOf("/")),e=e.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("/"),zy(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 n=e.length-i,0!==(o=n<=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}},qy.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},qy.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 jy=Io.DOM,$y=At.extend,Wy=At.each,Ky=At.trim,Xy=At.resolve,Yy=oe.ie,Gy=function(e,t,n){var r,o,i=this;r=i.documentBaseUrl=n.documentBaseURL,o=n.baseURI,t=Yu.getEditorSettings(i,e,r,n.defaultSettings,t),i.settings=t,Ho.language=t.language||"en",Ho.languageLoad=t.language_load,Ho.baseURL=n.baseURL,i.id=e,i.setDirty(!1),i.plugins={},i.documentBaseURI=new qy(t.document_base_url,{base_uri:o}),i.baseURI=o,i.contentCSS=[],i.contentStyles=[],i.shortcuts=new Ld(i),i.loadedCSS={},i.editorCommands=new yd(i),i.suffix=n.suffix,i.editorManager=n,i.inline=t.inline,i.buttons={},i.menuItems={},t.cache_suffix&&(oe.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(oe.overrideViewPort=!1),n.fire("SetupEditor",i),i.execCallback("setup",i),i.$=Kt.overrideDefaults(function(){return{context:i.inline?i.getBody():i.getDoc(),element:i.getBody()}})};$y(Gy.prototype={render:function(){My(this)},focus:function(e){Zd(this,e)},execCallback:function(e){var t,n=this.settings[e];if(n)return this.callbackLookup&&(t=this.callbackLookup[e])&&(n=t.func,t=t.scope),"string"==typeof n&&(t=(t=n.replace(/\.\w+$/,""))?Xy(t):0,n=Xy(n),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:n,scope:t}),n.apply(t||this,Array.prototype.slice.call(arguments,1))},translate:function(e){if(e&&At.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]||(t!==undefined?t:"{#"+e+"}")},getParam:function(e,t,n){var r,o=e in this.settings?this.settings[e]:t;return"hash"===n?(r={},"string"==typeof o?Wy(o.indexOf("=")>0?o.split(/[;,](?![^=;,]*(?:[;,]|$))/):o.split(","),function(e){(e=e.split("=")).length>1?r[Ky(e[0])]=Ky(e[1]):r[Ky(e[0])]=Ky(e)}):r=o,r):o},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&&"undefined"==typeof t.active&&(t.active=!1),t.text||t.icon||(t.icon=e),n.buttons=n.buttons,t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addSidebar:function(e,t){return Fy(this,e,t)},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems,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:Pm("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:(jy.show(this.getContainer()),jy.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this.getDoc();this.hidden||(Yy&&e&&!this.inline&&e.execCommand("SelectAll"),this.save(),this.inline?(this.getBody().contentEditable=!1,this===this.editorManager.focusedEditor&&(this.editorManager.focusedEditor=null)):(jy.hide(this.getContainer()),jy.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||{},e.load=!0,t=this.setContent(n.value!==undefined?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return e=e||{},e.save=!0,e.element=o,t=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:(r.inline||(o.innerHTML=t),(n=jy.getParent(r.id,"form"))&&Wy(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){var n,r,o=this.getBody();return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||this.fire("BeforeSetContent",t),0===(e=t.content).length||/^\s+$/.test(e)?(r=Yy&&Yy<11?"":'<br data-mce-bogus="1">',"TABLE"===o.nodeName?e="<tr><td>"+r+"</td></tr>":/^(UL|OL)$/.test(o.nodeName)&&(e="<li>"+r+"</li>"),(n=this.settings.forced_root_block)&&this.schema.isValidChild(o.nodeName.toLowerCase(),n.toLowerCase())?(e=r,e=this.dom.createHTML(n,this.settings.forced_root_block_attrs,e)):Yy||e||(e='<br data-mce-bogus="1">'),this.dom.setHTML(o,e),this.fire("SetContent",t)):("raw"!==t.format&&(e=Nu({validate:this.validate},this.schema).serialize(this.parser.parse(e,{isRootContent:!0,insert:!0}))),t.content=Ky(e),this.dom.setHTML(o,t.content),t.no_events||this.fire("SetContent",t)),t.content},getContent:function(e){var t,n=this.getBody();if(this.removed)return"";if(e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||this.fire("BeforeGetContent",e),"raw"===e.format)t=At.trim(Hd(this.serializer,n.innerHTML));else if("text"===e.format)t=n.innerText||n.textContent;else{if("tree"===e.format)return this.serializer.serialize(n,e);t=this.serializer.serialize(n,e)}return"text"!==e.format?e.content=Ky(t):e.content=t,e.no_events||this.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=$y({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){Bd(this,e)},getContainer:function(){return this.container||(this.container=jy.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=jy.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(),n.hasVisual===undefined&&(n.hasVisual=r.visual),Wy(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",!1)||(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(){this.removed||(this.save(),this.removed=1,this.unbindAllNativeEvents(),this.hasHiddenInput&&jy.remove(this.getElement().nextSibling),this.inline||(Yy&&Yy<10&&this.getDoc().execCommand("SelectAll",!1,null),jy.setStyle(this.id,"display",this.orgDisplay),this.getBody().onload=null),this.fire("remove"),this.editorManager.remove(this),jy.remove(this.getContainer()),this._selectionOverrides.destroy(),this.editorUpload.destroy(),this.destroy())},destroy:function(e){var t;this.destroyed||(e||this.removed?(e||(this.editorManager.off("beforeunload",this._beforeUnload),this.theme&&this.theme.destroy&&this.theme.destroy(),this.selection.destroy(),this.dom.destroy()),(t=this.formElement)&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,t._mceOldSubmit=null),jy.unbind(t,"submit reset",this.formEventDelegate)),this.contentAreaContainer=this.formElement=this.container=this.editorContainer=null,this.bodyElement=this.contentDocument=this.contentWindow=null,this.iframeElement=this.targetElm=null,this.selection&&(this.selection=this.selection.win=this.selection.dom=this.selection.dom.doc=null),this.destroyed=1):this.remove())},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},Ad);var Jy,Qy,Zy,eb={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("mce-")}},tb=function(e,t){var n=_n.detect().browser;n.isIE()||n.isEdge()?function(e){e.on("focusout",function(){ld(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)||ld(e)})},nb=function(e){var t=dh(function(){ld(e)},0);e.inline&&function(e,t){var n=function(){t.throttle()};Io.DOM.bind(document,"mouseup",n),e.on("remove",function(){Io.DOM.unbind(document,"mouseup",n)})}(e,t),e.on("init",function(){tb(e,t)}),e.on("remove",function(){t.cancel()})},rb=Io.DOM,ob=function(e){return eb.isEditorUIElement(e)},ib=function(e,t){var n=e?e.settings.custom_ui_selector:"";return null!==rb.getParent(t,function(t){return ob(t)||!!n&&e.dom.is(t,n)})},ab=function(e,t){var n=t.editor;nb(n),n.on("focusin",function(){var t=e.focusedEditor;t!==n&&(t&&t.fire("blur",{focusedEditor:n}),e.setActive(n),e.focusedEditor=n,n.fire("focus",{blurredEditor:t}),n.focus(!0))}),n.on("focusout",function(){ce.setEditorTimeout(n,function(){var t=e.focusedEditor;ib(n,function(){try{return document.activeElement}catch(e){return document.body}}())||t!==n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null)})}),Jy||(Jy=function(t){var n,r=e.activeEditor;n=t.target,r&&n.ownerDocument===document&&(n===document.body||ib(r,n)||e.focusedEditor!==r||(r.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},rb.bind(document,"focusin",Jy))},ub=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(rb.unbind(document,"focusin",Jy),Jy=null)},sb=function(e){e.on("AddEditor",T.curry(ab,e)),e.on("RemoveEditor",T.curry(ub,e))},cb={},lb="en",fb={setCode:function(e){e&&(lb=e,this.rtl=!!this.data[e]&&"rtl"===this.data[e]._dir)},getCode:function(){return lb},rtl:!1,add:function(e,t){var n=cb[e];n||(cb[e]=n={});for(var r in t)n[r]=t[r];this.setCode(e)},translate:function(e){var t=cb[lb]||{},n=function(e){return At.is(e,"function")?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||At.is(e,"undefined")},o=function(e){return e=n(e),At.hasOwn(t,e)?n(t[e]):e};if(r(e))return"";if(At.is(e,"object")&&At.hasOwn(e,"raw"))return n(e.raw);if(At.is(e,"array")){var i=e.slice(1);e=o(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return At.hasOwn(i,t)?n(i[t]):e})}return o(e).replace(/{context:\w+}$/,"")},data:cb},db=Io.DOM,mb=At.explode,hb=At.each,pb=At.extend,gb=0,vb=!1,yb=[],bb=[],Cb=function(e){hb(Zy.get(),function(t){"scroll"===e.type?t.fire("ScrollWindow",e):t.fire("ResizeWindow",e)})},xb=function(e){e!==vb&&(e?Kt(window).on("resize scroll",Cb):Kt(window).off("resize scroll",Cb),vb=e)},wb=function(e){var t=bb;delete yb[e.id];for(var n=0;n<yb.length;n++)if(yb[n]===e){yb.splice(n,1);break}return bb=W.filter(bb,function(t){return e!==t}),Zy.activeEditor===e&&(Zy.activeEditor=bb.length>0?bb[0]:null),Zy.focusedEditor===e&&(Zy.focusedEditor=null),t.length!==bb.length};pb(Zy={defaultSettings:{},$:Kt,majorVersion:"4",minorVersion:"7.4",releaseDate:"2017-12-05",editors:yb,i18n:fb,activeEditor:null,settings:{},setup:function(){var e,t,n,r,o="";if(t=qy.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),n=window.tinymce||window.tinyMCEPreInit)e=n.base||n.baseURL,o=n.suffix;else{for(var i=document.getElementsByTagName("script"),a=0;a<i.length;a++){var u=(r=i[a].src).substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==u.indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/"));break}}!e&&document.currentScript&&(-1!==(r=document.currentScript.src).indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/")))}this.baseURL=new qy(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new qy(this.baseURL),this.suffix=o,sb(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new qy(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new qy(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n),this.defaultSettings=e;var r=e.plugin_base_urls;for(var o in r)Ho.PluginManager.urls[o]=r[o]},init:function(e){var t,n,r=this;n=At.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 o=function(e){var t=e.id;return t||(t=(t=e.name)&&!db.get(t)?e.name:db.uniqueId(),e.setAttribute("id",t)),t},i=function(e,t){return t.constructor===RegExp?t.test(e.className):db.hasClass(e,t)},a=function(e){t=e},u=function(){var t,s=0,c=[],l=function(e,n,o){var i=new Gy(e,n,r);c.push(i),i.on("init",function(){++s===t.length&&a(c)}),i.targetElm=i.targetElm||o,i.render()};db.unbind(window,"ready",u),function(t){var n=e[t];if(n)n.apply(r,Array.prototype.slice.call(arguments,2))}("onpageload"),t=Kt.unique(function(e){var t,n=[];if(oe.ie&&oe.ie<11)return ym("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 hb(e.types,function(e){n=n.concat(db.select(e.selector))}),n;if(e.selector)return db.select(e.selector);if(e.target)return[e.target];switch(e.mode){case"exact":(t=e.elements||"").length>0&&hb(mb(t),function(e){var t;(t=db.get(e))?n.push(t):hb(document.forms,function(t){hb(t.elements,function(t){t.name===e&&(e="mce_editor_"+gb++,db.setAttrib(t,"id",e),n.push(t))})})});break;case"textareas":case"specific_textareas":hb(db.select("textarea"),function(t){e.editor_deselector&&i(t,e.editor_deselector)||e.editor_selector&&!i(t,e.editor_selector)||n.push(t)})}return n}(e)),e.types?hb(e.types,function(n){At.each(t,function(t){return!db.is(t,n.selector)||(l(o(t),pb({},e,n),t),!1)})}):(At.each(t,function(e){!function(e){e&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(wb(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)}(r.get(e.id))}),0===(t=At.grep(t,function(e){return!r.get(e.id)})).length?a([]):hb(t,function(t){!function(e,t){return e.inline&&t.tagName.toLowerCase()in n}(e,t)?l(o(t),e,t):ym("Could not initialize inline editor on invalid inline target element",t)}))};return r.settings=e,db.bind(window,"ready",u),new ie(function(e){t?e(t):a=function(t){e(t)}})},get:function(e){return 0===arguments.length?bb.slice(0):jn.isString(e)?W.find(bb,function(t){return t.id===e}).getOr(null):jn.isNumber(e)&&bb[e]?bb[e]:null},add:function(e){var t=this;return yb[e.id]===e?e:(null===t.get(e.id)&&(function(e){return"length"!==e}(e.id)&&(yb[e.id]=e),yb.push(e),bb.push(e)),xb(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),Qy||(Qy=function(){t.fire("BeforeUnload")},db.bind(window,"beforeunload",Qy)),e)},createEditor:function(e,t){return this.add(new Gy(e,t,this))},remove:function(e){var t,n,r=this;if(e)return jn.isString(e)?(e=e.selector||e,void hb(db.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})):(n=e,jn.isNull(r.get(n.id))?null:(wb(n)&&r.fire("RemoveEditor",{editor:n}),0===bb.length&&db.unbind(window,"beforeunload",Qy),n.remove(),xb(bb.length>0),n));for(t=bb.length-1;t>=0;t--)r.remove(bb[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new Gy(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(){hb(bb,function(e){e.save()})},addI18n:function(e,t){fb.add(e,t)},translate:function(e){return fb.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}},Nd),Zy.setup();var Nb=Zy,Sb=function(e){return{walk:function(t,n){return Xh(e,t,n)},split:jc,normalize:function(t){return Lf(e,t).fold(T.constant(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}};Sb.compareRanges=kf,Sb.getCaretRangeFromPoint=bg,Sb.getSelectedNode=Si,Sb.getNode=Ei;var Eb,kb,Tb=Math.min,Ab=Math.max,_b=Math.round,Rb=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+=_b(s/2)),"c"===n[1]&&(r+=_b(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=_b(a/2)),"c"===n[4]&&(r-=_b(i/2)),Bb(r,o,i,a)},Bb=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},Db={inflate:function(e,t,n){return Bb(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:Rb,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=Rb(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=Ab(e.x,t.x),r=Ab(e.y,t.y),o=Tb(e.x+e.w,t.x+t.w),i=Tb(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:Bb(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=Ab(0,t.x-u),o=Ab(0,t.y-s),i=Ab(0,c-f),a=Ab(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),c-=i,l-=a,Bb(u,s,c-u,l-s)},create:Bb,fromClientRect:function(e){return Bb(e.left,e.top,e.width,e.height)}},Ob={},Pb={add:function(e,t){Ob[e.toLowerCase()]=t},has:function(e){return!!Ob[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=Ob.hasOwnProperty(t)?Ob[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=Ob[e]))throw new Error("Could not find control by type: "+e);return n=new n(t),n.type=e,n}},Ib=At.each,Lb=At.extend,Mb=function(){};Mb.extend=Eb=function(e){var t,n,r,o=this.prototype,i=function(){var e,t,n;if(!kb&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(e,t){return function(){var n,r=this._super;return this._super=o[e],n=t.apply(this,arguments),this._super=r,n}};kb=!0,t=new this,kb=!1,e.Mixins&&(Ib(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&&Ib(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&Ib(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){return e!==undefined?(this[n]=e,this):this[n]}}),e.Statics&&Ib(e.Statics,function(e,t){i[t]=e}),e.Defaults&&o.Defaults&&(e.Defaults=Lb({},o.Defaults,e.Defaults));for(n in 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=Eb,i};var Fb=Math.min,zb=Math.max,Ub=Math.round,Vb=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?",":"")+Vb(e[n],t);return r+"]"}r="{";for(i in e)e.hasOwnProperty(i)&&(r+="function"!=typeof e[i]?(r.length>1?","+t:t)+i+t+":"+Vb(e[i],t):"");return r+"}"}return""+e},Hb={serialize:Vb,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}},qb={callbacks:{},count:0,send:function(e){var t=this,n=Io.DOM,r=e.count!==undefined?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++}},jb={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||"",jb.fire("beforeInitialize",{settings:e}),t=new xm){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&&At.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=jb.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};At.extend(jb,Nd);var $b=At.extend,Wb=function(e){this.settings=$b({},e),this.count=0};Wb.sendRPC=function(e){return(new Wb).send(e)},Wb.prototype={send:function(e){var t=e.error,n=e.success;(e=$b(this.settings,e)).success=function(r,o){void 0===(r=Hb.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=Hb.serialize({id:e.id||"c"+this.count++,method:e.method,params:e.params}),e.content_type="application/json",jb.send(e)}};var Kb=window.localStorage,Xb=Nb,Yb={geom:{Rect:Db},util:{Promise:ie,Delay:ce,Tools:At,VK:wh,URI:qy,Class:Mb,EventDispatcher:Cd,Observable:Nd,I18n:fb,XHR:jb,JSON:Hb,JSONRequest:Wb,JSONP:qb,LocalStorage:Kb,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=zb(0,Fb(t,1)),i=zb(0,Fb(i,1)),0!==t){switch(a=e/60,u=i*t,s=u*(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=Ub(255*(n+c)),r=Ub(255*(r+c)),o=Ub(255*(o+c))}else n=r=o=Ub(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,u,s;return r=0,o=0,i=0,e/=255,t/=255,n/=255,u=Fb(e,Fb(t,n)),s=zb(e,zb(t,n)),u===s?(i=u,{h:0,s:0,v:100*i}):(a=e===u?t-n:n===u?e-t:n-e,r=e===u?3:n===u?1:5,r=60*(r-a/(s-u)),o=(s-u)/s,i=s,{h:Ub(r),s:Ub(100*o),v:Ub(100*i)})}(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:ye,Sizzle:bt,DomQuery:Kt,TreeWalker:Xr,DOMUtils:Io,ScriptLoader:Uo,RangeUtils:Sb,Serializer:sg,ControlSelection:pg,BookmarkManager:dg,Selection:Jg,Event:ye.Event},html:{Styles:ko,Entities:po,Node:Gp,Schema:Eo,SaxParser:Ud,DomParser:og,Writer:wu,Serializer:Nu},ui:{Factory:Pb},Env:oe,AddOnManager:Ho,Formatter:Pp,UndoManager:Hh,EditorCommands:yd,WindowManager:lm,NotificationManager:cm,EditorObservable:Ad,Shortcuts:Ld,Editor:Gy,FocusManager:eb,EditorManager:Nb,DOM:Io.DOM,ScriptLoader:Uo.ScriptLoader,PluginManager:Ho.PluginManager,ThemeManager:Ho.ThemeManager,trim:At.trim,isArray:At.isArray,is:At.is,toArray:At.toArray,makeMap:At.makeMap,each:At.each,map:At.map,grep:At.grep,inArray:At.inArray,extend:At.extend,create:At.create,walk:At.walk,createNS:At.createNS,resolve:At.resolve,explode:At.explode,_addCacheSuffix:At._addCacheSuffix,isOpera:oe.opera,isWebKit:oe.webkit,isIE:oe.ie,isGecko:oe.gecko,isMac:oe.mac};!function(e){window.tinymce=e,window.tinyMCE=e}(Xb=At.extend(Xb,Yb))}(); |