File: D:/HostingSpaces/SBogers10/reiskick.komma.nl/wwwroot/vendor/kms/js/vendor.js
/*! For license information please see vendor.js.LICENSE.txt */
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{1:function(t,e,n){n("5WJX"),n("DWi2"),n("vFQT"),n("Qjfq"),n("ZNhe"),n("hOyB"),n("hVuo"),n("vDqi"),n("EVdn"),n("MIQu"),n("Vn+K"),n("NvoQ"),t.exports=n("7bfH")},"121P":function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)}})?r.apply(e,o):r)||(t.exports=i)},"2SVd":function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},"4tak":function(t,e){!function(t){"use strict";var e,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(t,e){var n,r=t.dom,o=t.selection.getSelectedBlocks();o.length&&(n=r.getAttrib(o[0],"dir"),i.each(o,(function(t){r.getParent(t.parentNode,'*[dir="'+e+'"]',r.getRoot())||r.setAttrib(t,"dir",n!==e?e:null)})),t.nodeChanged())},u=function(){},s=function(t){return function(){return t}},c=s(!1),l=s(!0),f=function(){return d},d=(e=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:l,getOr:r=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:s(null),getOrUndefined:s(void 0),or:r,orThunk:n,map:f,each:u,bind:f,exists:c,forall:l,filter:f,equals:e,equals_:e,toArray:function(){return[]},toString:s("none()")}),m=function(t){var e=s(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:l,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return m(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:d},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return o},h={some:m,none:f,from:function(t){return null==t?d:m(t)}},p=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:s(t)}},g={fromHtml:function(e,n){var r=(n||t.document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||r.childNodes.length>1)throw t.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return p(r.childNodes[0])},fromTag:function(e,n){var r=(n||t.document).createElement(e);return p(r)},fromText:function(e,n){var r=(n||t.document).createTextNode(e);return p(r)},fromDom:p,fromPoint:function(t,e,n){var r=t.dom();return h.from(r.elementFromPoint(e,n)).map(p)}},v=function(t){return function(e){return typeof e===t}}("function"),b=(void 0!==t.window?t.window:Function("return this;")(),function(t){return function(e){return function(t){return t.dom().nodeType}(e)===t}}),y=b(3),x=b(9),w=b(11),C=v(t.Element.prototype.attachShadow)&&v(t.Node.prototype.getRootNode)?function(t){return g.fromDom(t.dom().getRootNode())}:function(t){return x(t)?t:(e=t,g.fromDom(e.dom().ownerDocument));var e},_=function(t){var e=C(t);return w(e)?h.some(e):h.none()},k=function(t){return g.fromDom(t.dom().host)},S=function(t){var e,n,r=y(t)?t.dom().parentNode:t.dom();return null!=r&&null!==r.ownerDocument&&_(g.fromDom(r)).fold((function(){return r.ownerDocument.body.contains(r)}),(e=S,n=k,function(t){return e(n(t))}))},T=function(t,e){return function(t){return void 0!==t.style&&v(t.style.getPropertyValue)}(t)?t.style.getPropertyValue(e):""},D=function(e){return"rtl"===function(e,n){var r=e.dom(),o=t.window.getComputedStyle(r).getPropertyValue(n);return""!==o||S(e)?o:T(r,n)}(e,"direction")?"rtl":"ltr"},O=function(t,e){return function(n){var r=function(t){var r=g.fromDom(t.element);n.setActive(D(r)===e)};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}};o.add("directionality",(function(t){!function(t){t.addCommand("mceDirectionLTR",(function(){a(t,"ltr")})),t.addCommand("mceDirectionRTL",(function(){a(t,"rtl")}))}(t),function(t){t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return t.execCommand("mceDirectionLTR")},onSetup:O(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return t.execCommand("mceDirectionRTL")},onSetup:O(t,"rtl")})}(t)}))}(window)},"5WJX":function(t,e,n){(function(e){!function(n){"use strict";var r=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},o=function(t){return{eq:t}},i=o((function(t,e){return t===e})),a=function(t){return o((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))},u=function(t,e){return function(t,e){return o((function(n,r){return t.eq(e(n),e(r))}))}(a(t),(function(t){return function(t,e){return Array.prototype.slice.call(t).sort(e)}(t,e)}))},s=function(t){return o((function(e,n){var r=Object.keys(e),o=Object.keys(n);if(!u(i).eq(r,o))return!1;for(var a=r.length,s=0;s<a;s++){var c=r[s];if(!t.eq(e[c],n[c]))return!1}return!0}))},c=o((function(t,e){if(t===e)return!0;var n=r(t);return n===r(e)&&(function(t){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(t)}(n)?t===e:"array"===n?a(c).eq(t,e):"object"===n&&s(c).eq(t,e))})),l=function(){},f=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},d=function(t){return function(){return t}},m=function(t){return t};function h(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var p=function(t){return function(e){return!t(e)}},g=function(t){return function(){throw new Error(t)}},v=d(!1),b=d(!0),y=function(){return x},x=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:v,isSome:v,isNone:b,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:n,orThunk:e,map:y,each:l,bind:y,exists:v,forall:b,filter:y,equals:t,equals_:t,toArray:function(){return[]},toString:d("none()")}}(),w=function(t){var e=d(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:b,isNone:v,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:x},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(v,(function(e){return n(t,e)}))}};return o},C={some:w,none:y,from:function(t){return null==t?x:w(t)}},_=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},k=function(t){return function(e){return typeof e===t}},S=function(t){return function(e){return t===e}},T=_("string"),D=_("object"),O=_("array"),E=S(null),N=k("boolean"),A=S(void 0),R=k("function"),B=k("number"),P=Array.prototype.slice,I=Array.prototype.indexOf,M=Array.prototype.push,L=function(t,e){return I.call(t,e)},F=function(t,e){return L(t,e)>-1},H=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},j=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},V=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},z=function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}},U=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},W=function(t,e,n){return z(t,(function(t){n=e(n,t)})),n},q=function(t,e,n){return V(t,(function(t){n=e(n,t)})),n},$=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return C.some(i);if(n(i,r))break}return C.none()}(t,e,v)},Y=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return C.some(n)}return C.none()},G=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!O(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);M.apply(e,t[n])}return e}(j(t,e))},K=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},X=function(t){var e=P.call(t,0);return e.reverse(),e},J=function(t,e){return U(t,(function(t){return!F(e,t)}))},Q=function(t){return 0===t.length?C.none():C.some(t[0])},Z=function(t){return 0===t.length?C.none():C.some(t[t.length-1])},tt=R(Array.from)?Array.from:function(t){return P.call(t)},et=Object.keys,nt=Object.hasOwnProperty,rt=function(t,e){for(var n=et(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},ot=function(t,e){return it(t,(function(t,n){return{k:n,v:e(t,n)}}))},it=function(t,e){var n={};return rt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},at=function(t){return function(e,n){t[n]=e}},ut=function(t,e,n,r){return rt(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},st=function(t,e){var n={},r={};return ut(t,e,at(n),at(r)),{t:n,f:r}},ct=function(t,e){var n={};return ut(t,e,at(n),l),n},lt=function(t){return function(t,e){var n=[];return rt(t,(function(t,r){n.push(e(t,r))})),n}(t,(function(t){return t}))},ft=function(t,e){return dt(t,e)?C.from(t[e]):C.none()},dt=function(t,e){return nt.call(t,e)},mt=Array.isArray,ht=function(t,e,n){var r,o;if(!t)return 0;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return 0}else for(r in t)if(t.hasOwnProperty(r)&&!1===e.call(n,t[r],r,t))return 0;return 1},pt=function(t,e){var n=[];return ht(t,(function(r,o){n.push(e(r,o,t))})),n},gt=function(t,e){var n=[];return ht(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},vt=function(t,e){var n,r;if(t)for(n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},bt=function(t,e,n,r){var o=0;for(arguments.length<3&&(n=t[0]);o<t.length;o++)n=e.call(r,n,t[o],o);return n},yt=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},xt=function(t){return t[t.length-1]},wt=function(){return(wt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Ct(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}var _t=function(){return kt(0,0)},kt=function(t,e){return{major:t,minor:e}},St={nu:kt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?_t():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return kt(r(1),r(2))}(t,n)},unknown:_t},Tt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},Dt={unknown:function(){return Tt({current:void 0,version:St.unknown()})},nu:Tt,edge:d("Edge"),chrome:d("Chrome"),ie:d("IE"),opera:d("Opera"),firefox:d("Firefox"),safari:d("Safari")},Ot=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},Et={unknown:function(){return Ot({current:void 0,version:St.unknown()})},nu:Ot,windows:d("Windows"),ios:d("iOS"),android:d("Android"),linux:d("Linux"),osx:d("OSX"),solaris:d("Solaris"),freebsd:d("FreeBSD"),chromeos:d("ChromeOS")},Nt=function(t,e){var n=String(e).toLowerCase();return $(t,(function(t){return t.search(n)}))},At=function(t,e){return Nt(t,e).map((function(t){var n=St.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},Rt=function(t,e){return Nt(t,e).map((function(t){var n=St.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},Bt=function(t,e){return-1!==t.indexOf(e)},Pt=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,0)},It=function(t){return function(e){return e.replace(t,"")}},Mt=It(/^\s+|\s+$/g),Lt=It(/^\s+/g),Ft=It(/\s+$/g),Ht=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,jt=function(t){return function(e){return Bt(e,t)}},Vt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Bt(t,"edge/")&&Bt(t,"chrome")&&Bt(t,"safari")&&Bt(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ht],search:function(t){return Bt(t,"chrome")&&!Bt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Bt(t,"msie")||Bt(t,"trident")}},{name:"Opera",versionRegexes:[Ht,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:jt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:jt("firefox")},{name:"Safari",versionRegexes:[Ht,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Bt(t,"safari")||Bt(t,"mobile/"))&&Bt(t,"applewebkit")}}],zt=[{name:"Windows",search:jt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Bt(t,"iphone")||Bt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:jt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:jt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:jt("linux"),versionRegexes:[]},{name:"Solaris",search:jt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:jt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:jt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ut={browsers:d(Vt),oses:d(zt)},Wt=function(t,e){var n=Ut.browsers(),r=Ut.oses(),o=At(n,t).fold(Dt.unknown,Dt.nu),i=Rt(r,t).fold(Et.unknown,Et.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),u=a||r("(pointer:coarse)"),s=o||!i&&a&&r("(min-device-width:768px)"),c=i||a&&!s,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!c&&!s&&!l;return{isiPad:d(o),isiPhone:d(i),isTablet:d(s),isPhone:d(c),isTouch:d(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:d(l),isDesktop:d(f)}}(i,o,t,e);return{browser:o,os:i,deviceType:a}},qt=function(t){return n.window.matchMedia(t).matches},$t=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}}((function(){return Wt(n.navigator.userAgent,qt)})),Yt=function(){return $t()},Gt=n.navigator.userAgent,Kt=Yt(),Xt=Kt.browser,Jt=Kt.os,Qt=Kt.deviceType,Zt=/WebKit/.test(Gt)&&!Xt.isEdge(),te="FormData"in n.window&&"FileReader"in n.window&&"URL"in n.window&&!!n.URL.createObjectURL,ee=-1!==Gt.indexOf("Windows Phone"),ne={opera:Xt.isOpera(),webkit:Zt,ie:!(!Xt.isIE()&&!Xt.isEdge())&&Xt.version.major,gecko:Xt.isFirefox(),mac:Jt.isOSX()||Jt.isiOS(),iOS:Qt.isiPad()||Qt.isiPhone(),android:Jt.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:n.window.getSelection&&"Range"in n.window,documentMode:Xt.isIE()?n.document.documentMode||7:10,fileApi:te,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!Xt.isIE(),desktop:Qt.isDesktop(),windowsPhone:ee,browser:{current:Xt.current,version:Xt.version,isChrome:Xt.isChrome,isEdge:Xt.isEdge,isFirefox:Xt.isFirefox,isIE:Xt.isIE,isOpera:Xt.isOpera,isSafari:Xt.isSafari},os:{current:Jt.current,version:Jt.version,isAndroid:Jt.isAndroid,isChromeOS:Jt.isChromeOS,isFreeBSD:Jt.isFreeBSD,isiOS:Jt.isiOS,isLinux:Jt.isLinux,isOSX:Jt.isOSX,isSolaris:Jt.isSolaris,isWindows:Jt.isWindows},deviceType:{isDesktop:Qt.isDesktop,isiPad:Qt.isiPad,isiPhone:Qt.isiPhone,isPhone:Qt.isPhone,isTablet:Qt.isTablet,isTouch:Qt.isTouch,isWebView:Qt.isWebView}},re=/^\s*|\s*$/g,oe=function(t){return null==t?"":(""+t).replace(re,"")},ie=function(t,e){return e?!("array"!==e||!mt(t))||typeof t===e:void 0!==t},ae=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),ht(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;ae(t,e,n,r)})))},ue={trim:oe,isArray:mt,is:ie,toArray:function(t){var e,n,r=t;if(!mt(t))for(r=[],e=0,n=t.length;e<n;e++)r[e]=t[e];return r},makeMap:function(t,e,n){var r;for(e=e||",","string"==typeof(t=t||[])&&(t=t.split(e)),n=n||{},r=t.length;r--;)n[t[r]]={};return n},each:ht,map:pt,grep:gt,inArray:vt,hasOwn:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(o.hasOwnProperty(i)){var a=o[i];void 0!==a&&(t[i]=a)}}return t},create:function(t,e,n){var r,o,i,a=0,u=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],s=this.createNS(t[3].replace(/\.\w+$/,""),n);if(!s[u]){if("static"===t[2])return s[u]=e,void(this.onCreate&&this.onCreate(t[2],t[3],s[u]));e[u]||(e[u]=function(){},a=1),s[u]=e[u],this.extend(s[u].prototype,e),t[5]&&(r=this.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=s[u],s[u]=a?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[u].prototype[u]=s[u],this.each(r,(function(t,e){s[u].prototype[e]=r[e]})),this.each(e,(function(t,e){r[e]?s[u].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==u&&(s[u].prototype[e]=t)}))),this.each(e.static,(function(t,e){s[u][e]=t}))}},walk:ae,createNS:function(t,e){var r,o;for(e=e||n.window,t=t.split("."),r=0;r<t.length;r++)e[o=t[r]]||(e[o]={}),e=e[o];return e},resolve:function(t,e){var r,o;for(e=e||n.window,r=0,o=(t=t.split(".")).length;r<o&&(e=e[t[r]]);r++);return e},explode:function(t,e){return!t||ie(t,"array")?t:pt(t.split(e||","),oe)},_addCacheSuffix:function(t){var e=ne.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},se=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:d(t)}},ce={fromHtml:function(t,e){var r=(e||n.document).createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw n.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return se(r.childNodes[0])},fromTag:function(t,e){var r=(e||n.document).createElement(t);return se(r)},fromText:function(t,e){var r=(e||n.document).createTextNode(t);return se(r)},fromDom:se,fromPoint:function(t,e,n){var r=t.dom();return C.from(r.elementFromPoint(e,n)).map(se)}},le=(void 0!==n.window?n.window:Function("return this;")(),function(t){return t.dom().nodeName.toLowerCase()}),fe=function(t){return t.dom().nodeType},de=function(t){return function(e){return fe(e)===t}},me=de(1),he=de(3),pe=de(9),ge=de(11),ve=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},be=function(t,e){var n=t.dom();if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},ye=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},xe=function(t,e){return t.dom()===e.dom()},we=function(t,e){return r=t.dom(),o=e.dom(),function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(r,o,n.Node.DOCUMENT_POSITION_CONTAINED_BY);var r,o},Ce=function(t,e){return Yt().browser.isIE()?we(t,e):function(t,e){var n=t.dom(),r=e.dom();return n!==r&&n.contains(r)}(t,e)},_e=function(t){return ce.fromDom(t.dom().ownerDocument)},ke=function(t){return pe(t)?t:_e(t)},Se=function(t){return ce.fromDom(t.dom().ownerDocument.defaultView)},Te=function(t){return C.from(t.dom().parentNode).map(ce.fromDom)},De=function(t){return C.from(t.dom().previousSibling).map(ce.fromDom)},Oe=function(t){return C.from(t.dom().nextSibling).map(ce.fromDom)},Ee=function(t){return X(ve(t,De))},Ne=function(t){return ve(t,Oe)},Ae=function(t){return j(t.dom().childNodes,ce.fromDom)},Re=function(t,e){var n=t.dom().childNodes;return C.from(n[e]).map(ce.fromDom)},Be=function(t){return Re(t,0)},Pe=function(t){return Re(t,t.dom().childNodes.length-1)},Ie=function(t){return ge(t)},Me=R(n.Element.prototype.attachShadow)&&R(n.Node.prototype.getRootNode)?function(t){return ce.fromDom(t.dom().getRootNode())}:ke,Le=function(t){return Ie(t)?t:function(t){var e=t.dom().head;if(null==e)throw new Error("Head is not available yet");return ce.fromDom(e)}(ke(t))},Fe=function(t){return ce.fromDom(t.dom().host)},He=function(t,e){Te(t).each((function(n){n.dom().insertBefore(e.dom(),t.dom())}))},je=function(t,e){Oe(t).fold((function(){Te(t).each((function(t){ze(t,e)}))}),(function(t){He(t,e)}))},Ve=function(t,e){Be(t).fold((function(){ze(t,e)}),(function(n){t.dom().insertBefore(e.dom(),n.dom())}))},ze=function(t,e){t.dom().appendChild(e.dom())},Ue=function(t,e){V(e,(function(e){ze(t,e)}))},We=function(t){t.dom().textContent="",V(Ae(t),(function(t){qe(t)}))},qe=function(t){var e=t.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},$e=function(t){var e,n=Ae(t);n.length>0&&(e=t,V(n,(function(t){He(e,t)}))),qe(t)},Ye=function(t){var e,n,r=he(t)?t.dom().parentNode:t.dom();return null!=r&&null!==r.ownerDocument&&function(t){var e=Me(t);return Ie(e)?C.some(e):C.none()}(ce.fromDom(r)).fold((function(){return r.ownerDocument.body.contains(r)}),(e=Ye,n=Fe,function(t){return e(n(t))}))},Ge=function(t,e){return{left:d(t),top:d(e),translate:function(n,r){return Ge(t+n,e+r)}}},Ke=Ge,Xe=function(t,e){return void 0!==t?t:void 0!==e?e:0},Je=function(t){var e=t.dom(),n=e.ownerDocument.body;return n===e?Ke(n.offsetLeft,n.offsetTop):Ye(t)?function(t){var e=t.getBoundingClientRect();return Ke(e.left,e.top)}(e):Ke(0,0)},Qe=function(t){var e=void 0!==t?t.dom():n.document,r=e.body.scrollLeft||e.documentElement.scrollLeft,o=e.body.scrollTop||e.documentElement.scrollTop;return Ke(r,o)},Ze=function(t,e,r){(void 0!==r?r.dom():n.document).defaultView.scrollTo(t,e)},tn=function(t,e){Yt().browser.isSafari()&&R(t.dom().scrollIntoViewIfNeeded)?t.dom().scrollIntoViewIfNeeded(!1):t.dom().scrollIntoView(e)},en=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},nn=function(t){var e=void 0===t?n.window:t,r=e.document,o=Qe(ce.fromDom(r));return function(t){var e=void 0===t?n.window:t;return C.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,r=t.clientHeight;return en(o.left(),o.top(),n,r)}),(function(t){return en(Math.max(t.pageLeft,o.left()),Math.max(t.pageTop,o.top()),t.width,t.height)}))},rn=function(t){return function(e){return!!e&&e.nodeType===t}},on=function(t){return!!t&&!Object.getPrototypeOf(t)},an=rn(1),un=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return F(e,n)}return!1}},sn=function(t,e){var n=e.toLowerCase().split(" ");return function(e){var r;if(an(e))for(r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}},cn=function(t){return function(e){return an(e)&&e.hasAttribute(t)}},ln=function(t){return an(t)&&t.hasAttribute("data-mce-bogus")},fn=function(t){return an(t)&&"TABLE"===t.tagName},dn=function(t){return function(e){if(an(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},mn=un(["textarea","input"]),hn=rn(3),pn=rn(8),gn=rn(9),vn=rn(11),bn=un(["br"]),yn=dn("true"),xn=dn("false"),wn=function(t){return void 0!==t.style&&R(t.style.getPropertyValue)},Cn=function(t,e,r){if(!(T(r)||N(r)||B(r)))throw n.console.error("Invalid call to Attr.set. Key ",e,":: Value ",r,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,r+"")},_n=function(t,e,n){Cn(t.dom(),e,n)},kn=function(t,e){var n=t.dom();rt(e,(function(t,e){Cn(n,e,t)}))},Sn=function(t,e){var n=t.dom().getAttribute(e);return null===n?void 0:n},Tn=function(t,e){t.dom().removeAttribute(e)},Dn=function(t,e){var r=t.dom(),o=n.window.getComputedStyle(r).getPropertyValue(e);return""!==o||Ye(t)?o:On(r,e)},On=function(t,e){return wn(t)?t.style.getPropertyValue(e):""},En=function(t,e){var n=t.dom(),r=On(n,e);return C.from(r).filter((function(t){return t.length>0}))},Nn=Yt().browser,An=function(t){return $(t,me)},Rn=function(t,e){return t.children&&F(t.children,e)},Bn=function(t,e,n){var r,o,i=0,a=0,u=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===Dn(ce.fromDom(t),"position"))return{x:i=(o=e.getBoundingClientRect()).left+(u.documentElement.scrollLeft||t.scrollLeft)-u.documentElement.clientLeft,y:a=o.top+(u.documentElement.scrollTop||t.scrollTop)-u.documentElement.clientTop};for(r=e;r&&r!==n&&r.nodeType&&!Rn(r,n);)i+=r.offsetLeft||0,a+=r.offsetTop||0,r=r.offsetParent;for(r=e.parentNode;r&&r!==n&&r.nodeType&&!Rn(r,n);)i-=r.scrollLeft||0,a-=r.scrollTop||0,r=r.parentNode;a+=function(t){return Nn.isFirefox()&&"table"===le(t)?An(Ae(t)).filter((function(t){return"caption"===le(t)})).bind((function(t){return An(Ne(t)).map((function(e){var n=e.dom().offsetTop,r=t.dom().offsetTop,o=t.dom().offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(ce.fromDom(e))}return{x:i,y:a}},Pn=function(t){var e;return function(n){return(e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,d(!0))).hasOwnProperty(le(n))}},In=Pn(["h1","h2","h3","h4","h5","h6"]),Mn=Pn(["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"]),Ln=function(t){return me(t)&&!Mn(t)},Fn=function(t){return me(t)&&"br"===le(t)},Hn=Pn(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),jn=Pn(["ul","ol","dl"]),Vn=Pn(["li","dd","dt"]),zn=Pn(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),Un=Pn(["thead","tbody","tfoot"]),Wn=Pn(["td","th"]),qn=Pn(["pre","script","textarea","style"]),$n=function(t){return t&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Yn=function(t,e){var n,r=e.childNodes;if(!an(e)||!$n(e)){for(n=r.length-1;n>=0;n--)Yn(t,r[n]);if(!1===gn(e)){if(hn(e)&&e.nodeValue.length>0){var o=ue.trim(e.nodeValue).length;if(t.isBlock(e.parentNode)||o>0)return;if(0===o&&function(t){var e=t.previousSibling&&"SPAN"===t.previousSibling.nodeName,n=t.nextSibling&&"SPAN"===t.nextSibling.nodeName;return e&&n}(e))return}else if(an(e)&&(1===(r=e.childNodes).length&&$n(r[0])&&e.parentNode.insertBefore(r[0],e),r.length||zn(ce.fromDom(e))))return;t.remove(e)}return e}},Gn=ue.makeMap,Kn=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Xn=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Jn=/[<>&\"\']/g,Qn=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Zn={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},tr={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},er={"<":"<",">":">","&":"&",""":'"',"'":"'"},nr=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),tr[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},rr=nr("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),or=function(t,e){return t.replace(e?Kn:Xn,(function(t){return tr[t]||t}))},ir=function(t,e){return t.replace(e?Kn:Xn,(function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":tr[t]||"&#"+t.charCodeAt(0)+";"}))},ar=function(t,e,n){return n=n||rr,t.replace(e?Kn:Xn,(function(t){return tr[t]||n[t]||t}))},ur={encodeRaw:or,encodeAllRaw:function(t){return(""+t).replace(Jn,(function(t){return tr[t]||t}))},encodeNumeric:ir,encodeNamed:ar,getEncodeFunc:function(t,e){var n=nr(e)||rr,r=Gn(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?Kn:Xn,(function(t){return void 0!==tr[t]?tr[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return ar(t,e,n)}:ar:r.numeric?ir:or},decode:function(t){return t.replace(Qn,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):Zn[e]||String.fromCharCode(e):er[t]||rr[t]||function(t){var e=ce.fromTag("div").dom();return e.innerHTML=t,e.textContent||e.innerText||t}(t)}))}},sr={},cr={},lr=ue.makeMap,fr=ue.each,dr=ue.extend,mr=ue.explode,hr=ue.inArray,pr=function(t,e){return(t=ue.trim(t))?t.split(e||" "):[]},gr=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),fr(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?lr(t,/[, ]/):mr(t,/[, ]/)}))),n};function vr(t){var e={},n={},r=[],o={},i={},a=function(e,n,r){var o=t[e];return o?o=lr(o,/[, ]/,lr(o.toUpperCase(),/[, ]/)):(o=sr[e])||(o=lr(n," ",lr(n.toUpperCase()," ")),o=dr(o,r),sr[e]=o),o},u=function(t){var e,n,r,o,i,a,u={},s=function(t,n,r){var o,i,a,s=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};for(n=n||"","string"==typeof(r=r||[])&&(r=pr(r)),o=(t=pr(t)).length;o--;)a={attributes:s(i=pr([e,n].join(" "))),attributesOrder:i,children:s(r,cr)},u[t[o]]=a},c=function(t,e){var n,r,o,i;for(n=(t=pr(t)).length,e=pr(e);n--;)for(r=u[t[n]],o=0,i=e.length;o<i;o++)r.attributes[e[o]]={},r.attributesOrder.push(e[o])};return sr[t]?sr[t]:(e="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==t&&(e+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(e+=" xml:lang",r=[r,a="acronym applet basefont big font strike tt"].join(" "),fr(pr(a),(function(t){s(t,"",r)})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),fr(pr(i),(function(t){s(t,"",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"===t?" 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"===t?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"!==t&&(s("wbr"),s("ruby","",[r,"rt rp"].join(" ")),s("figcaption","",o),s("mark rt rp summary bdi","",r),s("canvas","width height",o),s("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),s("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),s("picture","","img source"),s("source","src srcset type media sizes"),s("track","kind src srclang label default"),s("datalist","",[r,"option"].join(" ")),s("article section nav aside main header footer","",o),s("hgroup","","h1 h2 h3 h4 h5 h6"),s("figure","",[o,"figcaption"].join(" ")),s("time","datetime",r),s("dialog","open",o),s("command","type label icon disabled checked radiogroup command"),s("output","for form name",r),s("progress","value max",r),s("meter","value min max low high optimum",r),s("details","open",[o,"summary"].join(" ")),s("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(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"),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"!==t&&(c("input button select textarea","autofocus"),c("input textarea","placeholder"),c("a","download"),c("link script img","crossorigin"),c("img","loading"),c("iframe","sandbox seamless allowfullscreen loading")),fr(pr("a form meter progress dfn"),(function(t){u[t]&&delete u[t].children[t]})),delete u.caption.children.table,delete u.script,sr[t]=u,u)}((t=t||{}).schema);!1===t.verify_html&&(t.valid_elements="*[*]");var s=gr(t.valid_styles),c=gr(t.invalid_styles,"map"),l=gr(t.valid_classes,"map"),f=a("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=a("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=a("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),h=a("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),p=a("non_empty_elements","td th iframe video audio object script pre code",m),g=a("move_caret_before_on_enter_elements","table",p),v=a("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),b=a("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",v),y=a("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");fr((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){i[t]=new RegExp("</"+t+"[^>]*>","gi")}));var x=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},w=function(t){var n,o,i,a,u,s,c,l,f,d,m,h,p,g,v,b,y,w,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,_=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(t)for(t=pr(t,","),e["@"]&&(b=e["@"].attributes,y=e["@"].attributesOrder),n=0,o=t.length;n<o;n++)if(u=C.exec(t[n])){if(g=u[1],f=u[2],v=u[3],l=u[5],s={attributes:h={},attributesOrder:p=[]},"#"===g&&(s.paddEmpty=!0),"-"===g&&(s.removeEmpty=!0),"!"===u[4]&&(s.removeEmptyAttrs=!0),b&&(rt(b,(function(t,e){h[e]=t})),p.push.apply(p,y)),l)for(i=0,a=(l=pr(l,"|")).length;i<a;i++)if(u=_.exec(l[i])){if(c={},m=u[1],d=u[2].replace(/[\\:]:/g,":"),g=u[3],w=u[4],"!"===m&&(s.attributesRequired=s.attributesRequired||[],s.attributesRequired.push(d),c.required=!0),"-"===m){delete h[d],p.splice(hr(p,d),1);continue}g&&("="===g&&(s.attributesDefault=s.attributesDefault||[],s.attributesDefault.push({name:d,value:w}),c.defaultValue=w),":"===g&&(s.attributesForced=s.attributesForced||[],s.attributesForced.push({name:d,value:w}),c.forcedValue=w),"<"===g&&(c.validValues=lr(w,"?"))),k.test(d)?(s.attributePatterns=s.attributePatterns||[],c.pattern=x(d),s.attributePatterns.push(c)):(h[d]||p.push(d),h[d]=c)}b||"@"!==f||(b=h,y=p),v&&(s.outputName=f,e[v]=s),k.test(f)?(s.pattern=x(f),r.push(s)):e[f]=s}},C=function(t){e={},r=[],w(t),fr(u,(function(t,e){n[e]=t.children}))},_=function(t){var r=/^(~)?(.+)$/;t&&(sr.text_block_elements=sr.block_elements=null,fr(pr(t,","),(function(t){var i=r.exec(t),a="~"===i[1],u=a?"span":"div",s=i[2];if(n[s]=n[u],o[s]=u,a||(b[s.toUpperCase()]={},b[s]={}),!e[s]){var c=e[u];delete(c=dr({},c)).removeEmptyAttrs,delete c.removeEmpty,e[s]=c}fr(n,(function(t,e){t[u]&&(n[e]=t=dr({},n[e]),t[s]=t[u])}))})))},k=function(e){var r=/^([+\-]?)([A-Za-z0-9_\-\.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)\]$/;sr[t.schema]=null,e&&fr(pr(e,","),(function(t){var e,o,i=r.exec(t);i&&(o=i[1],e=o?n[i[2]]:n[i[2]]={"#comment":{}},e=n[i[2]],fr(pr(i[3],"|"),(function(t){"-"===o?delete e[t]:e[t]={}})))}))},S=function(t){var n,o=e[t];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(t))return o};t.valid_elements?C(t.valid_elements):(fr(u,(function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children})),"html5"!==t.schema&&fr(pr("strong/b em/i"),(function(t){t=pr(t,"/"),e[t[1]].outputName=t[0]})),fr(pr("ol ul sub sup blockquote span font a table tbody tr strong em b i"),(function(t){e[t]&&(e[t].removeEmpty=!0)})),fr(pr("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){e[t].paddEmpty=!0})),fr(pr("span"),(function(t){e[t].removeEmptyAttrs=!0}))),_(t.custom_elements),k(t.valid_children),w(t.extended_valid_elements),k("+ol[ul|ol],+ul[ul|ol]"),fr({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(function(t,n){e[n]&&(e[n].parentsRequired=pr(t))})),t.invalid_elements&&fr(mr(t.invalid_elements),(function(t){e[t]&&delete e[t]})),S("span")||w("span[!data-mce-type|*]");return{children:n,elements:e,getValidStyles:function(){return s},getValidClasses:function(){return l},getBlockElements:function(){return b},getInvalidStyles:function(){return c},getShortEndedElements:function(){return m},getTextBlockElements:function(){return v},getTextInlineElements:function(){return y},getBoolAttrs:function(){return h},getElementRule:S,getSelfClosingElements:function(){return d},getNonEmptyElements:function(){return p},getMoveCaretBeforeOnEnterElements:function(){return g},getWhiteSpaceElements:function(){return f},getSpecialElements:function(){return i},isValidChild:function(t,e){var r=n[t.toLowerCase()];return!(!r||!r[e.toLowerCase()])},isValid:function(t,e){var n,r,o=S(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:function(){return o},addValidElements:w,setValidElements:C,addCustomElements:_,addValidChildren:k}}var br,yr,xr,wr,Cr,_r,kr,Sr,Tr,Dr,Or,Er,Nr,Ar,Rr,Br,Pr,Ir=function(t,e,n,r){var o=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},Mr=function(t,e){var n,r,o,i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,a=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,u=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,c={};t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var l="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<l.length;n++)c[l[n]]="\ufeff"+n,c["\ufeff"+n]=l[n];return{toHex:function(t){return t.replace(i,Ir)},parse:function(e){var r,o,l,f,d,m,h,p,g={},v=t.url_converter,b=t.url_converter_scope||this,y=function(t,e,r){var o=g[t+"-top"+e];if(o){var i=g[t+"-right"+e];if(i){var a=g[t+"-bottom"+e];if(a){var u=g[t+"-left"+e];if(u){var s=[o,i,a,u];for(n=s.length-1;n--&&s[n]===s[n+1];);n>-1&&r||(g[t+e]=-1===n?s[0]:s.join(" "),delete g[t+"-top"+e],delete g[t+"-right"+e],delete g[t+"-bottom"+e],delete g[t+"-left"+e])}}}}},x=function(t){var e,n=g[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return g[t]=n[0],!0}},w=function(t){return f=!0,c[t]},C=function(t,e){return f&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return c[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},_=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},k=function(t){return t.replace(/\\[0-9a-f]+/gi,_)},S=function(e,n,r,o,i,a){if(i=i||a)return"'"+(i=C(i)).replace(/\'/g,"\\'")+"'";if(n=C(n||r||o),!t.allow_script_urls){var u=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(u))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(u))return""}return v&&(n=v.call(b,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,w).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,w)}));r=u.exec(e);)if(u.lastIndex=r.index+r[0].length,o=r[1].replace(s,"").toLowerCase(),l=r[2].replace(s,""),o&&l){if(o=k(o),l=k(l),-1!==o.indexOf("\ufeff")||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(l)))continue;"font-weight"===o&&"700"===l?l="bold":"color"!==o&&"background-color"!==o||(l=l.toLowerCase()),l=(l=l.replace(i,Ir)).replace(a,S),g[o]=f?C(l,!0):l}y("border","",!0),y("border","-width"),y("border","-color"),y("border","-style"),y("padding",""),y("margin",""),d="border",h="border-style",p="border-color",x(m="border-width")&&x(h)&&x(p)&&(g[d]=g[m]+" "+g[h]+" "+g[p],delete g[m],delete g[h],delete g[p]),"medium none"===g.border&&delete g.border,"none"===g["border-image"]&&delete g["border-image"]}return g},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var a=0,u=i.length;a<u;a++)e=i[a],(o=t[e])&&(n+=(n.length>0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):rt(t,(function(t,r){!t||o&&!function(t,e){var n=o["*"];return(!n||!n[t])&&!((n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},Lr=/^(?:mouse|contextmenu)|click/,Fr={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1,mozPressure:1},Hr=function(){return!1},jr=function(){return!0},Vr=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},zr=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},Ur=function(t,e){var r,o=e||{};for(r in t)Fr[r]||(o[r]=t[r]);if(o.target||(o.target=o.srcElement||n.document),ne.experimentalShadowDom&&(o.target=function(t,e){if(t.composedPath){var n=t.composedPath();if(n&&n.length>0)return n[0]}return e}(t,o.target)),t&&Lr.test(t.type)&&void 0===t.pageX&&void 0!==t.clientX){var i=o.target.ownerDocument||n.document,a=i.documentElement,u=i.body;o.pageX=t.clientX+(a&&a.scrollLeft||u&&u.scrollLeft||0)-(a&&a.clientLeft||u&&u.clientLeft||0),o.pageY=t.clientY+(a&&a.scrollTop||u&&u.scrollTop||0)-(a&&a.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=jr,t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=jr,t&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=jr,o.stopPropagation()},!1===function(t){return t.isDefaultPrevented===jr||t.isDefaultPrevented===Hr}(o)&&(o.isDefaultPrevented=Hr,o.isPropagationStopped=Hr,o.isImmediatePropagationStopped=Hr),void 0===o.metaKey&&(o.metaKey=!1),o},Wr=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){zr(t,"DOMContentLoaded",i),zr(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o))};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():Vr(t,"DOMContentLoaded",i),Vr(t,"load",i)}},qr=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in n.document.documentElement,this.hasFocusIn="onfocusin"in n.document.documentElement,this.count=1}return t.prototype.bind=function(t,e,r,o){var i,a,u,s,c,l,f,d=this,m=n.window,h=function(t){d.executeHandlers(Ur(t||m.event),i)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[d.expando]?i=t[d.expando]:(i=d.count++,t[d.expando]=i,d.events[i]={}),o=o||t;var p=e.split(" ");for(u=p.length;u--;)l=h,c=f=!1,"DOMContentLoaded"===(s=p[u])&&(s="ready"),d.domLoaded&&"ready"===s&&"complete"===t.readyState?r.call(o,Ur({type:s})):(d.hasMouseEnterLeave||(c=d.mouseEnterLeave[s])&&(l=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=Ur(t||m.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,d.executeHandlers(t,i))}),d.hasFocusIn||"focusin"!==s&&"focusout"!==s||(f=!0,c="focusin"===s?"focus":"blur",l=function(t){(t=Ur(t||m.event)).type="focus"===t.type?"focusin":"focusout",d.executeHandlers(t,i)}),(a=d.events[i][s])?"ready"===s&&d.domLoaded?r(Ur({type:s})):a.push({func:r,scope:o}):(d.events[i][s]=a=[{func:r,scope:o}],a.fakeName=c,a.capture=f,a.nativeHandler=l,"ready"===s?Wr(t,l,d):Vr(t,c||s,l,f)));return t=a=0,r}},t.prototype.unbind=function(t,e,n){var r,o,i,a,u;if(!t||3===t.nodeType||8===t.nodeType)return this;var s=t[this.expando];if(s){if(u=this.events[s],e){var c=e.split(" ");for(o=c.length;o--;)if(r=u[a=c[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var l=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=l,r.fakeName=f,r.capture=d,u[a]=r}n&&0!==r.length||(delete u[a],zr(t,r.fakeName||a,r.nativeHandler,r.capture))}}else rt(u,(function(e,n){zr(t,e.fakeName||n,e.nativeHandler,e.capture)})),u={};for(a in u)if(dt(u,a))return this;delete this.events[s];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=Ur(null,n);o.type=e,o.target=t;do{(r=t[this.expando])&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var a=r[o];if(a&&!1===a.func.call(a.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),$r="sizzle"+-new Date,Yr=n.window.document,Gr=0,Kr=0,Xr=Oo(),Jr=Oo(),Qr=Oo(),Zr=function(t,e){return t===e&&(Dr=!0),0},to={}.hasOwnProperty,eo=[],no=eo.pop,ro=eo.push,oo=eo.push,io=eo.slice,ao=eo.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},uo="[\\x20\\t\\r\\n\\f]",so="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",co="\\["+uo+"*("+so+")(?:"+uo+"*([*^$|!~]?=)"+uo+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+so+"))|)"+uo+"*\\]",lo=":("+so+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+co+")*)|.*)\\)|)",fo=new RegExp("^"+uo+"+|((?:^|[^\\\\])(?:\\\\.)*)"+uo+"+$","g"),mo=new RegExp("^"+uo+"*,"+uo+"*"),ho=new RegExp("^"+uo+"*([>+~]|"+uo+")"+uo+"*"),po=new RegExp("="+uo+"*([^\\]'\"]*?)"+uo+"*\\]","g"),go=new RegExp(lo),vo=new RegExp("^"+so+"$"),bo={ID:new RegExp("^#("+so+")"),CLASS:new RegExp("^\\.("+so+")"),TAG:new RegExp("^("+so+"|[*])"),ATTR:new RegExp("^"+co),PSEUDO:new RegExp("^"+lo),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+uo+"*(even|odd|(([+-]|)(\\d*)n|)"+uo+"*(?:([+-]|)"+uo+"*(\\d+)|))"+uo+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+uo+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+uo+"*((?:-\\d)?\\d*)"+uo+"*\\)|)(?=[^-]|$)","i")},yo=/^(?:input|select|textarea|button)$/i,xo=/^h\d$/i,wo=/^[^{]+\{\s*\[native \w/,Co=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_o=/[+~]/,ko=/'|\\/g,So=new RegExp("\\\\([\\da-f]{1,6}"+uo+"?|("+uo+")|.)","ig"),To=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{oo.apply(eo=io.call(Yr.childNodes),Yr.childNodes),eo[Yr.childNodes.length].nodeType}catch(t){oo={apply:eo.length?function(t,e){ro.apply(t,io.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var Do=function(t,e,n,r){var o,i,a,u,s,c,l,f,d,m;if((e?e.ownerDocument||e:Yr)!==Er&&Or(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(u=(e=e||Er).nodeType)&&9!==u)return[];if(Ar&&!r){if(o=Co.exec(t))if(a=o[1]){if(9===u){if(!(i=e.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(a))&&Pr(e,i)&&i.id===a)return n.push(i),n}else{if(o[2])return oo.apply(n,e.getElementsByTagName(t)),n;if((a=o[3])&&br.getElementsByClassName)return oo.apply(n,e.getElementsByClassName(a)),n}if(br.qsa&&(!Rr||!Rr.test(t))){if(f=l=$r,d=e,m=9===u&&t,1===u&&"object"!==e.nodeName.toLowerCase()){for(c=Cr(t),(l=e.getAttribute("id"))?f=l.replace(ko,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+Po(c[s]);d=_o.test(t)&&Ro(e.parentNode)||e,m=c.join(",")}if(m)try{return oo.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{l||e.removeAttribute("id")}}}return kr(t.replace(fo,"$1"),e,n,r)};function Oo(){var t=[];return function e(n,r){return t.push(n+" ")>yr.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function Eo(t){return t[$r]=!0,t}function No(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||1<<31)-(~t.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function Ao(t){return Eo((function(e){return e=+e,Eo((function(n,r){for(var o,i=t([],n.length,e),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))}))}))}function Ro(t){return t&&void 0!==t.getElementsByTagName&&t}function Bo(){}function Po(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function Io(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Kr++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,a){var u,s,c=[Gr,i];if(a){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,a))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((u=(s=e[$r]||(e[$r]={}))[r])&&u[0]===Gr&&u[1]===i)return c[2]=u[2];if(s[r]=c,c[2]=t(e,n,a))return!0}}}function Mo(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function Lo(t,e,n,r,o){for(var i,a=[],u=0,s=t.length,c=null!=e;u<s;u++)(i=t[u])&&(n&&!n(i,r,o)||(a.push(i),c&&e.push(u)));return a}function Fo(t,e,n,r,o,i){return r&&!r[$r]&&(r=Fo(r)),o&&!o[$r]&&(o=Fo(o,i)),Eo((function(i,a,u,s){var c,l,f,d=[],m=[],h=a.length,p=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)Do(t,e[r],n);return n}(e||"*",u.nodeType?[u]:u,[]),g=!t||!i&&e?p:Lo(p,d,t,u,s),v=n?o||(i?t:h||r)?[]:a:g;if(n&&n(g,v,u,s),r)for(c=Lo(v,m),r(c,[],u,s),l=c.length;l--;)(f=c[l])&&(v[m[l]]=!(g[m[l]]=f));if(i){if(o||t){if(o){for(c=[],l=v.length;l--;)(f=v[l])&&c.push(g[l]=f);o(null,v=[],c,s)}for(l=v.length;l--;)(f=v[l])&&(c=o?ao.call(i,f):d[l])>-1&&(i[c]=!(a[c]=f))}}else v=Lo(v===a?v.splice(h,v.length):v),o?o(null,a,v,s):oo.apply(a,v)}))}function Ho(t){for(var e,n,r,o=t.length,i=yr.relative[t[0].type],a=i||yr.relative[" "],u=i?1:0,s=Io((function(t){return t===e}),a,!0),c=Io((function(t){return ao.call(e,t)>-1}),a,!0),l=[function(t,n,r){return!i&&(r||n!==Sr)||((e=n).nodeType?s(t,n,r):c(t,n,r))}];u<o;u++)if(n=yr.relative[t[u].type])l=[Io(Mo(l),n)];else{if((n=yr.filter[t[u].type].apply(null,t[u].matches))[$r]){for(r=++u;r<o&&!yr.relative[t[r].type];r++);return Fo(u>1&&Mo(l),u>1&&Po(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(fo,"$1"),n,u<r&&Ho(t.slice(u,r)),r<o&&Ho(t=t.slice(r)),r<o&&Po(t))}l.push(n)}return Mo(l)}br=Do.support={},wr=Do.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},Or=Do.setDocument=function(t){var e,n=t?t.ownerDocument||t:Yr,r=n.defaultView;return n!==Er&&9===n.nodeType&&n.documentElement?(Er=n,Nr=n.documentElement,Ar=!wr(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){Or()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){Or()}))),br.attributes=!0,br.getElementsByTagName=!0,br.getElementsByClassName=wo.test(n.getElementsByClassName),br.getById=!0,yr.find.ID=function(t,e){if(void 0!==e.getElementById&&Ar){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},yr.filter.ID=function(t){var e=t.replace(So,To);return function(t){return t.getAttribute("id")===e}},yr.find.TAG=br.getElementsByTagName?function(t,e){if(void 0!==e.getElementsByTagName)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},yr.find.CLASS=br.getElementsByClassName&&function(t,e){if(Ar)return e.getElementsByClassName(t)},Br=[],Rr=[],br.disconnectedMatch=!0,Rr=Rr.length&&new RegExp(Rr.join("|")),Br=Br.length&&new RegExp(Br.join("|")),e=wo.test(Nr.compareDocumentPosition),Pr=e||wo.test(Nr.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Zr=e?function(t,e){if(t===e)return Dr=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!br.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===Yr&&Pr(Yr,t)?-1:e===n||e.ownerDocument===Yr&&Pr(Yr,e)?1:Tr?ao.call(Tr,t)-ao.call(Tr,e):0:4&r?-1:1)}:function(t,e){if(t===e)return Dr=!0,0;var r,o=0,i=t.parentNode,a=e.parentNode,u=[t],s=[e];if(!i||!a)return t===n?-1:e===n?1:i?-1:a?1:Tr?ao.call(Tr,t)-ao.call(Tr,e):0;if(i===a)return No(t,e);for(r=t;r=r.parentNode;)u.unshift(r);for(r=e;r=r.parentNode;)s.unshift(r);for(;u[o]===s[o];)o++;return o?No(u[o],s[o]):u[o]===Yr?-1:s[o]===Yr?1:0},n):Er},Do.matches=function(t,e){return Do(t,null,null,e)},Do.matchesSelector=function(t,e){if((t.ownerDocument||t)!==Er&&Or(t),e=e.replace(po,"='$1']"),br.matchesSelector&&Ar&&(!Br||!Br.test(e))&&(!Rr||!Rr.test(e)))try{var n=(void 0).call(t,e);if(n||br.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return Do(e,Er,null,[t]).length>0},Do.contains=function(t,e){return(t.ownerDocument||t)!==Er&&Or(t),Pr(t,e)},Do.attr=function(t,e){(t.ownerDocument||t)!==Er&&Or(t);var n=yr.attrHandle[e.toLowerCase()],r=n&&to.call(yr.attrHandle,e.toLowerCase())?n(t,e,!Ar):void 0;return void 0!==r?r:br.attributes||!Ar?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},Do.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},Do.uniqueSort=function(t){var e,n=[],r=0,o=0;if(Dr=!br.detectDuplicates,Tr=!br.sortStable&&t.slice(0),t.sort(Zr),Dr){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return Tr=null,t},xr=Do.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=xr(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=xr(e);return n},(yr=Do.selectors={cacheLength:50,createPseudo:Eo,match:bo,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(So,To),t[3]=(t[3]||t[4]||t[5]||"").replace(So,To),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||Do.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&Do.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return bo.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&go.test(n)&&(e=Cr(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(So,To).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Xr[t+" "];return e||(e=new RegExp("(^|"+uo+")"+t+"("+uo+"|$)"))&&Xr(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=Do.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),a="last"!==t.slice(-4),u="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,s){var c,l,f,d,m,h,p=i!==a?"nextSibling":"previousSibling",g=e.parentNode,v=u&&e.nodeName.toLowerCase(),b=!s&&!u;if(g){if(i){for(;p;){for(f=e;f=f[p];)if(u?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;h=p="only"===t&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&b){for(m=(c=(l=g[$r]||(g[$r]={}))[t]||[])[0]===Gr&&c[1],d=c[0]===Gr&&c[2],f=m&&g.childNodes[m];f=++m&&f&&f[p]||(d=m=0)||h.pop();)if(1===f.nodeType&&++d&&f===e){l[t]=[Gr,m,d];break}}else if(b&&(c=(e[$r]||(e[$r]={}))[t])&&c[0]===Gr)d=c[1];else for(;(f=++m&&f&&f[p]||(d=m=0)||h.pop())&&((u?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[$r]||(f[$r]={}))[t]=[Gr,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=yr.pseudos[t]||yr.setFilters[t.toLowerCase()]||Do.error("unsupported pseudo: "+t);return r[$r]?r(e):r.length>1?(n=[t,t,"",e],yr.setFilters.hasOwnProperty(t.toLowerCase())?Eo((function(t,n){for(var o,i=r(t,e),a=i.length;a--;)t[o=ao.call(t,i[a])]=!(n[o]=i[a])})):function(t){return r(t,0,n)}):r}},pseudos:{not:Eo((function(t){var e=[],n=[],r=_r(t.replace(fo,"$1"));return r[$r]?Eo((function(t,e,n,o){for(var i,a=r(t,null,o,[]),u=t.length;u--;)(i=a[u])&&(t[u]=!(e[u]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),!n.pop()}})),has:Eo((function(t){return function(e){return Do(t,e).length>0}})),contains:Eo((function(t){return t=t.replace(So,To),function(e){return(e.textContent||e.innerText||xr(e)).indexOf(t)>-1}})),lang:Eo((function(t){return vo.test(t||"")||Do.error("unsupported lang: "+t),t=t.replace(So,To).toLowerCase(),function(e){var n;do{if(n=Ar?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=n.window.location&&n.window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===Nr},focus:function(t){return t===Er.activeElement&&(!Er.hasFocus||Er.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!yr.pseudos.empty(t)},header:function(t){return xo.test(t.nodeName)},input:function(t){return yo.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:Ao((function(){return[0]})),last:Ao((function(t,e){return[e-1]})),eq:Ao((function(t,e,n){return[n<0?n+e:n]})),even:Ao((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:Ao((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:Ao((function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t})),gt:Ao((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=yr.pseudos.eq,V(["radio","checkbox","file","password","image"],(function(t){yr.pseudos[t]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(t)})),V(["submit","reset"],(function(t){yr.pseudos[t]=function(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}(t)})),Bo.prototype=yr.filters=yr.pseudos,yr.setFilters=new Bo,Cr=Do.tokenize=function(t,e){var n,r,o,i,a,u,s,c=Jr[t+" "];if(c)return e?0:c.slice(0);for(a=t,u=[],s=yr.preFilter;a;){for(i in n&&!(r=mo.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=ho.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(fo," ")}),a=a.slice(n.length)),yr.filter)yr.filter.hasOwnProperty(i)&&(!(r=bo[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 e?a.length:a?Do.error(t):Jr(t,u).slice(0)},_r=Do.compile=function(t,e){var n,r=[],o=[],i=Qr[t+" "];if(!i){for(e||(e=Cr(t)),n=e.length;n--;)(i=Ho(e[n]))[$r]?r.push(i):o.push(i);(i=Qr(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,a,u,s){var c,l,f,d=0,m="0",h=o&&[],p=[],g=Sr,v=o||r&&yr.find.TAG("*",s),b=Gr+=null==g?1:Math.random()||.1,y=v.length;for(s&&(Sr=i!==Er&&i);m!==y&&null!=(c=v[m]);m++){if(r&&c){for(l=0;f=t[l++];)if(f(c,i,a)){u.push(c);break}s&&(Gr=b)}n&&((c=!f&&c)&&d--,o&&h.push(c))}if(d+=m,n&&m!==d){for(l=0;f=e[l++];)f(h,p,i,a);if(o){if(d>0)for(;m--;)h[m]||p[m]||(p[m]=no.call(u));p=Lo(p)}oo.apply(u,p),s&&!o&&p.length>0&&d+e.length>1&&Do.uniqueSort(u)}return s&&(Gr=b,Sr=g),h};return n?Eo(o):o}(o,r))).selector=t}return i},kr=Do.select=function(t,e,n,r){var o,i,a,u,s,c="function"==typeof t&&t,l=!r&&Cr(t=c.selector||t);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(a=i[0]).type&&br.getById&&9===e.nodeType&&Ar&&yr.relative[i[1].type]){if(!(e=(yr.find.ID(a.matches[0].replace(So,To),e)||[])[0]))return n;c&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=bo.needsContext.test(t)?0:i.length;o--&&(a=i[o],!yr.relative[u=a.type]);)if((s=yr.find[u])&&(r=s(a.matches[0].replace(So,To),_o.test(i[0].type)&&Ro(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&Po(i)))return oo.apply(n,r),n;break}}return(c||_r(t,l))(r,e,!Ar,n,_o.test(t)&&Ro(e.parentNode)||e),n},br.sortStable=$r.split("").sort(Zr).join("")===$r,br.detectDuplicates=!!Dr,Or(),br.sortDetached=!0;var jo=n.document,Vo=Array.prototype.push,zo=Array.prototype.slice,Uo=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Wo=qr.Event,qo=ue.makeMap("children,contents,next,prev"),$o=function(t){return void 0!==t},Yo=function(t){return"string"==typeof t},Go=function(t,e){var n,r=(e=e||jo).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},Ko=function(t,e,n,r){var o;if(Yo(e))e=Go(e,ci(t[0]));else if(e.length&&!e.nodeType){if(e=mi.makeArray(e),r)for(o=e.length-1;o>=0;o--)Ko(t,e[o],n,r);else for(o=0;o<e.length;o++)Ko(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},Xo=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},Jo=function(t,e,n){var r,o;return e=mi(e)[0],t.each((function(){n&&r===this.parentNode||(r=this.parentNode,o=e.cloneNode(!1),this.parentNode.insertBefore(o,this)),o.appendChild(this)})),t},Qo=ue.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Zo=ue.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),ti={for:"htmlFor",class:"className",readonly:"readOnly"},ei={float:"cssFloat"},ni={},ri={},oi=function(t,e){return new mi.fn.init(t,e)},ii=/^\s*|\s*$/g,ai=function(t){return null==t?"":(""+t).replace(ii,"")},ui=function(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t},si=function(t,e){var n=[];return ui(t,(function(t,r){e(r,t)&&n.push(r)})),n},ci=function(t){return t?9===t.nodeType?t:t.ownerDocument:jo};oi.fn=oi.prototype={constructor:oi,selector:"",context:null,length:0,init:function(t,e){var r,o;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if(e&&e.nodeType)this.context=e;else{if(e)return mi(t).attr(e);this.context=e=n.document}if(Yo(t)){if(this.selector=t,!(r="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:Uo.exec(t)))return mi(e).find(t);if(r[1])for(o=Go(t,ci(e)).firstChild;o;)Vo.call(this,o),o=o.nextSibling;else{if(!(o=ci(e).getElementById(r[2])))return this;if(o.id!==r[2])return this.find(t);this.length=1,this[0]=o}}else this.add(t,!1);return this},toArray:function(){return ue.toArray(this)},add:function(t,e){var n,r;if(Yo(t))return this.add(mi(t));if(!1!==e)for(n=mi.unique(this.toArray().concat(mi.makeArray(t))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else Vo.apply(this,mi.makeArray(t));return this},attr:function(t,e){var n,r=this;if("object"==typeof t)ui(t,(function(t,e){r.attr(t,e)}));else{if(!$o(e)){if(r[0]&&1===r[0].nodeType){if((n=ni[t])&&n.get)return n.get(r[0],t);if(Zo[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each((function(){var n;if(1===this.nodeType){if((n=ni[t])&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==typeof(t=ti[t]||t))ui(t,(function(t,e){n.prop(t,e)}));else{if(!$o(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))},a=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))};if("object"==typeof t)ui(t,(function(t,e){o.css(t,e)}));else if($o(e))t=i(t),"number"!=typeof e||Qo[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if((r=ri[t])&&r.set)r.set(this,e);else{try{this.style[ei[t]||t]=e}catch(t){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(a(t)):n.removeAttribute(t))}}));else{if(n=o[0],(r=ri[t])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(a(t))}catch(t){return}}return o},remove:function(){for(var t,e=this.length;e--;)t=this[e],Wo.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e;if($o(t)){e=this.length;try{for(;e--;)this[e].innerHTML=t}catch(n){mi(this[e]).empty().append(t)}return this}return this[0]?this[0].innerHTML:""},text:function(t){var e;if($o(t)){for(e=this.length;e--;)"innerText"in this[e]?this[e].innerText=t:this[0].textContent=t;return this}return this[0]?this[0].innerText||this[0].textContent:""},append:function(){return Ko(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return Ko(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){var t=this;return t[0]&&t[0].parentNode?Ko(t,arguments,(function(t){this.parentNode.insertBefore(t,this)})):t},after:function(){var t=this;return t[0]&&t[0].parentNode?Ko(t,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):t},appendTo:function(t){return mi(t).append(this),this},prependTo:function(t){return mi(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return Jo(this,t)},wrapAll:function(t){return Jo(this,t,!0)},wrapInner:function(t){return this.each((function(){mi(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){mi(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),mi(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t||(-1!==t.indexOf(" ")?ui(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o=Xo(r,t);if(o!==e){var i=r.className;o?r.className=ai((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}}))),n},hasClass:function(t){return Xo(this[0],t)},each:function(t){return ui(this,t)},on:function(t,e){return this.each((function(){Wo.bind(this,t,e)}))},off:function(t,e){return this.each((function(){Wo.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"==typeof t?Wo.fire(this,t.type,t):Wo.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new mi(zo.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)mi.find(t,this[e],r);return mi(r)},filter:function(t){return mi("function"==typeof t?si(this.toArray(),(function(e,n){return t(n,e)})):mi.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof mi&&(t=t[0]),this.each((function(n,r){for(;r;){if("string"==typeof t&&mi(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),mi(e)},offset:function(t){var e,n,r,o,i=0,a=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Vo,sort:Array.prototype.sort,splice:Array.prototype.splice},ue.extend(oi,{extend:ue.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:ue.toArray(t);var e},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:ue.isArray,each:ui,trim:ai,grep:si,find:Do,expr:Do.selectors,unique:Do.uniqueSort,text:Do.getText,contains:Do.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return e=1===e.length?mi.find.matchesSelector(e[0],t)?[e[0]]:[]:mi.find.matches(t,e)}});var li=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof mi&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&mi(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},fi=function(t,e,n,r){var o=[];for(r instanceof mi&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&mi(t).is(r))break}o.push(t)}return o},di=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};ui({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return li(t,"parentNode")},next:function(t){return di(t,"nextSibling",1)},prev:function(t){return di(t,"previousSibling",1)},children:function(t){return fi(t.firstChild,"nextSibling",1)},contents:function(t){return ue.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){oi.fn[t]=function(n){var r=[];this.each((function(){var t=e.call(r,this,n,r);t&&(mi.isArray(t)?r.push.apply(r,t):r.push(t))})),this.length>1&&(qo[t]||(r=mi.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=mi(r);return n?o.filter(n):o}})),ui({parentsUntil:function(t,e){return li(t,"parentNode",e)},nextUntil:function(t,e){return fi(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return fi(t,"previousSibling",1,e).slice(1)}},(function(t,e){oi.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(mi.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(o=mi.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=mi(o);return r?i.filter(r):i}})),oi.fn.is=function(t){return!!t&&this.filter(t).length>0},oi.fn.init.prototype=oi.fn,oi.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return mi.extend(n,this),n},oi.attrHooks=ni,oi.cssHooks=ri;var mi=oi,hi=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,a;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(a=o[e];a;a=a[e])if(!a[e])return a;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),pi={},gi={exports:pi};!function(t,n,r,o){!function(o){if("object"==typeof n&&void 0!==r)r.exports=o();else if("function"==typeof t&&t.amd)t([],o);else{("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).EphoxContactWrapper=o()}}((function(){return function t(e,n,r){function i(u,s){if(!n[u]){if(!e[u]){var c="function"==typeof o&&o;if(!s&&c)return c(u,!0);if(a)return a(u,!0);var l=new Error("Cannot find module '"+u+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[u]={exports:{}};e[u][0].call(f.exports,(function(t){return i(e[u][1][t]||t)}),f,f.exports,t,e,n,r)}return n[u].exports}for(var a="function"==typeof o&&o,u=0;u<r.length;u++)i(r[u]);return i}({1:[function(t,e,n){var r,o,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(t){o=u}}();var c,l=[],f=!1,d=-1;function m(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&h())}function h(){if(!f){var t=s(m);f=!0;for(var e=l.length;e;){for(c=l,l=[];++d<e;)c&&c[d].run();d=-1,e=l.length}c=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new p(t,e)),1!==l.length||f||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function a(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void s(e.promise,t)}u(e.promise,r)}else(1===t._state?u:s)(e.promise,t._value)}))):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){s(t,e)}var r,o}function s(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)a(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,u(e,t))}),(function(t){n||(n=!0,s(e,t))}))}catch(t){if(n)return;n=!0,s(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return a(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(t){o(i,t)}),n)}e[i]=a,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,a=Array.prototype.slice,u={},s=0;function c(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new c(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new c(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=s++,r=!(arguments.length<2)&&a.call(arguments,1);return u[e]=!0,o((function(){u[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete u[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(void 0,pi,gi,void 0);var vi,bi=gi.exports.boltExport,yi=function(t){var e=C.none(),r=[],o=function(t){i()?u(t):r.push(t)},i=function(){return e.isSome()},a=function(t){V(t,u)},u=function(t){e.each((function(e){n.setTimeout((function(){t(e)}),0)}))};return t((function(t){i()||(e=C.some(t),a(r),r=[])})),{get:o,map:function(t){return yi((function(e){o((function(n){e(t(n))}))}))},isReady:i}},xi={nu:yi,pure:function(t){return yi((function(e){e(t)}))}},wi=function(t){n.setTimeout((function(){throw t}),0)},Ci=function(t){var e=function(e){t().then(e,wi)};return{map:function(e){return Ci((function(){return t().then(e)}))},bind:function(e){return Ci((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return Ci((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return xi.nu(e)},toCached:function(){var e=null;return Ci((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},_i=function(t){return Ci((function(){return new bi(t)}))},ki=function(t,e){return e((function(e){var n=[],r=0;0===t.length?e([]):V(t,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))}))}))},Si=function(t){return{is:function(e){return t===e},isValue:b,isError:v,getOr:d(t),getOrThunk:d(t),getOrDie:d(t),or:function(e){return Si(t)},orThunk:function(e){return Si(t)},fold:function(e,n){return n(t)},map:function(e){return Si(e(t))},mapError:function(e){return Si(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOption:function(){return C.some(t)}}},Ti=function(t){return{is:v,isValue:v,isError:b,getOr:m,getOrThunk:function(t){return t()},getOrDie:function(){return g(String(t))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Ti(t)},mapError:function(e){return Ti(e(t))},each:l,bind:function(e){return Ti(t)},exists:v,forall:b,toOption:C.none}},Di={value:Si,error:Ti,fromOption:function(t,e){return t.fold((function(){return Ti(e)}),Si)}},Oi=function(t){if(!O(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],r={};return V(t,(function(o,i){var a=et(o);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],s=o[u];if(void 0!==r[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!O(s))throw new Error("case arguments must be an array");e.push(u),r[u]=function(){var r=arguments.length;if(r!==s.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+s.length+" ("+s+"), got "+r);for(var o=new Array(r),a=0;a<o.length;a++)o[a]=arguments[a];var c=function(t){var n=et(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!K(e,(function(t){return F(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,o)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[i];return e.apply(null,o)},match:c,log:function(t){n.console.log(t,{constructors:e,constructor:u,params:o})}}}})),r},Ei=(Oi([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){return t.fold(m,m)}),Ni=window.Promise?window.Promise:function(){function t(t,e){return function(){t.apply(e,arguments)}}var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,t(a,this),t(u,this))},o=r.immediateFn||"function"==typeof n.setImmediate&&n.setImmediate||function(t){n.setTimeout(t,1)};function i(t){var e=this;null!==this._state?o((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function a(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void l(t(n,e),t(a,this),t(u,this))}this._state=!0,this._value=e,s.call(this)}catch(t){u.call(this,t)}}function u(t){this._state=!1,this._value=t,s.call(this)}function s(){for(var t=0,e=this._deferreds.length;t<e;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return r.prototype.catch=function(t){return this.then(null,t)},r.prototype.then=function(t,e){var n=this;return new r((function(r,o){i.call(n,new c(t,e,r,o))}))},r.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new r((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(t){o(i,t)}),n)}t[i]=a,0==--r&&e(t)}catch(t){n(t)}}for(var i=0;i<t.length;i++)o(i,t[i])}))},r.resolve=function(t){return t&&"object"==typeof t&&t.constructor===r?t:new r((function(e){e(t)}))},r.reject=function(t){return new r((function(e,n){n(t)}))},r.race=function(t){return new r((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},r}(),Ai=function(t,e){return"number"!=typeof e&&(e=0),n.setTimeout(t,e)},Ri=function(t,e){return"number"!=typeof e&&(e=1),n.setInterval(t,e)},Bi=function(t,e){var r,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n.clearTimeout(r),r=Ai((function(){t.apply(this,o)}),e)};return o.stop=function(){n.clearTimeout(r)},o},Pi={requestAnimationFrame:function(t,e){vi?vi.then(t):vi=new Ni((function(t){e||(e=n.document.body),function(t,e){var r,o=n.window.requestAnimationFrame,i=["ms","moz","webkit"];for(r=0;r<i.length&&!o;r++)o=n.window[i[r]+"RequestAnimationFrame"];o||(o=function(t){n.window.setTimeout(t,0)}),o(t,e)}(t,e)})).then(t)},setTimeout:Ai,setInterval:Ri,setEditorTimeout:function(t,e,n){return Ai((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,r){var o=Ri((function(){t.removed?n.clearInterval(o):e()}),r);return o},debounce:Bi,throttle:Bi,clearInterval:function(t){return n.clearInterval(t)},clearTimeout:function(t){return n.clearTimeout(t)}};function Ii(t,e){void 0===e&&(e={});var r=0,o={},i=ce.fromDom(t),a=ke(i),u=e.maxLoadTime||5e3,s=function(t){ze(Le(i),t)},c=function(i,c,l){var f,d,m,h=function(t){m.status=t,m.passed=[],m.failed=[],f&&(f.onload=null,f.onerror=null,f=null)},p=function(){for(var t=m.passed,e=t.length;e--;)t[e]();h(2)},g=function(){for(var t=m.failed,e=t.length;e--;)t[e]();h(3)},v=function(t,e){t()||((new Date).getTime()-w<u?Pi.setTimeout(e):g())},b=function(){v((function(){for(var e,n,r=t.styleSheets,o=r.length;o--;)if((n=(e=r[o]).ownerNode?e.ownerNode:e.owningElement)&&n.id===f.id)return p(),!0}),b)},y=function(){v((function(){try{var t=d.sheet.cssRules;return p(),!!t}catch(t){}}),y)};if(i=ue._addCacheSuffix(i),o[i]?m=o[i]:(m={passed:[],failed:[]},o[i]=m),c&&m.passed.push(c),l&&m.failed.push(l),1!==m.status)if(2!==m.status)if(3!==m.status){m.status=1,(f=a.dom().createElement("link")).rel="stylesheet",f.type="text/css",f.id="u"+r++,f.async=!1,f.defer=!1;var x,w=(new Date).getTime();if(e.contentCssCors&&(f.crossOrigin="anonymous"),e.referrerPolicy&&_n(ce.fromDom(f),"referrerpolicy",e.referrerPolicy),!("onload"in f)||(x=n.navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(x[1],10)<536){if(n.navigator.userAgent.indexOf("Firefox")>0)return(d=a.dom().createElement("style")).textContent='@import "'+i+'"',y(),void s(ce.fromDom(d));b()}else f.onload=b,f.onerror=g;s(ce.fromDom(f)),f.href=i}else g();else p()},l=function(t){return _i((function(e){c(t,f(e,d(Di.value(t))),f(e,d(Di.error(t))))}))};return{load:c,loadAll:function(t,e,n){var r;(r=j(t,l),ki(r,_i)).get((function(t){var r=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var a=t[o];(e(a,o)?n:r).push(a)}return{pass:n,fail:r}}(t,(function(t){return t.isValue()}));r.fail.length>0?n(r.fail.map(Ei)):e(r.pass.map(Ei))}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}}var Mi=function(){var t=new WeakMap;return{forElement:function(e,n){var r=Me(e).dom();return C.from(t.get(r)).getOrThunk((function(){var e=Ii(r,n);return t.set(r,e),e}))}}}(),Li=ue.each,Fi=ue.grep,Hi=ne.ie,ji=/^([a-z0-9],?)+$/i,Vi=/^[ \t\r\n]*$/,zi=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},Ui=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o};function Wi(t,e){var r=this;void 0===e&&(e={});var o={},i=n.window,a={},u=0,s=Mi.forElement(ce.fromDom(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),c=[],l=e.schema?e.schema:vr({}),f=Mr({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),d=e.ownEvents?new qr:qr.Event,m=l.getBlockElements(),h=mi.overrideDefaults((function(){return{context:t,element:z.getRoot()}})),p=function(e){return e&&t&&T(e)?t.getElementById(e):e},g=function(t){return h("string"==typeof t?p(t):t)},v=function(t,e,n){var r,o,i=g(t);return i.length&&(o=(r=U[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},b=function(t){var e=p(t);return e?e.attributes:[]},y=function(t,n,r){""===r&&(r=null);var o=g(t),i=o.attr(n);if(o.length){var a=U[n];a&&a.set?a.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},x=function(){return e.root_element||t.body},w=function(e,n){return Bn(t.body,p(e),n)},C=function(t,e,n){var r=g(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})))&&(e=ne.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},_=function(t){var e,n;return t=p(t),e=C(t,"width"),n=C(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},k=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(ji.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return Do(e,i[0].ownerDocument||i[0],null,i).length>0},S=function(t,e,n,r){var o,i=[],a=p(t);for(r=void 0===r,n=n||("BODY"!==x().nodeName?x().parentNode:null),ue.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return k(t,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!e||"function"==typeof e&&e(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},D=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return k(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},O=function(t,e,n){var o,i="string"==typeof t?p(t):t;if(!i)return!1;if(ue.isArray(i)&&(i.length||0===i.length))return o=[],Li(i,(function(t,r){t&&("string"==typeof t&&(t=p(t)),o.push(e.call(n,t,r)))})),o;var a=n||r;return e.call(a,i)},E=function(t,e){g(t).each((function(t,n){Li(e,(function(t,e){y(n,e,t)}))}))},N=function(t,e){var n=g(t);Hi?n.each((function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(t){mi("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},A=function(e,n,r,o,i){return O(e,(function(e){var a="string"==typeof n?t.createElement(n):n;return E(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&N(a,o)),i?a:e.appendChild(a)}))},R=function(e,n,r){return A(t.createElement(e),e,n,r,!0)},B=ur.encodeAllRaw,P=function(t,e){var n=g(t);return e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},I=function(t,e,n){g(t).toggleClass(e,n).each((function(){""===this.className&&mi(this).attr("class",null)}))},M=function(t,e,n){return O(e,(function(e){return ue.is(e,"array")&&(t=t.cloneNode(!0)),n&&Li(Fi(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},L=function(t){if(an(t)){var e="a"===t.nodeName.toLowerCase()&&!v(t,"href")&&v(t,"id");if(v(t,"name")||v(t,"data-mce-bookmark")||e)return!0}return!1},F=function(){return t.createRange()},H=function(n,r,o,a){if(ue.isArray(n)){for(var u=n.length,s=[];u--;)s[u]=H(n[u],r,o,a);return s}return!e.collect||n!==t&&n!==i||c.push([n,r,o,a]),d.bind(n,r,o,a||z)},j=function(e,n,r){var o;if(ue.isArray(e)){o=e.length;for(var a=[];o--;)a[o]=j(e[o],n,r);return a}if(c.length>0&&(e===t||e===i))for(o=c.length;o--;){var u=c[o];e!==u[0]||n&&n!==u[1]||r&&r!==u[2]||d.unbind(u[0],u[1],u[2])}return d.unbind(e,n,r)},V=function(t){if(t&&an(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},z={doc:t,settings:e,win:i,files:a,stdMode:!0,boxModel:!0,styleSheetLoader:s,boundEvents:c,styles:f,schema:l,events:d,isBlock:function(t){if("string"==typeof t)return!!m[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!m[t.nodeName])}return!1},$:h,$$:g,root:null,clone:function(e,n){if(!Hi||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return Li(b(e),(function(t){y(r,t.nodeName,v(e,t.nodeName))})),r},getRoot:x,getViewPort:function(t){var e=nn(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=p(t);var e=w(t),n=_(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:_,getParent:function(t,e,n){var r=S(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:S,get:p,getNext:function(t,e){return D(t,e,"nextSibling")},getPrev:function(t,e){return D(t,e,"previousSibling")},select:function(n,r){return Do(n,p(r)||e.root_element||t,[])},is:k,add:A,create:R,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)e.hasOwnProperty(r)&&null!==e[r]&&void 0!==e[r]&&(o+=" "+r+'="'+B(e[r])+'"');return void 0!==n?o+">"+n+"</"+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:P,setStyle:function(t,n,r){var o=T(n)?g(t).css(n,r):g(t).css(n);e.update_styles&&zi(f,o)},getStyle:C,setStyles:function(t,n){var r=g(t).css(n);e.update_styles&&zi(f,r)},removeAllAttribs:function(t){return O(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},setAttrib:y,setAttribs:E,getAttrib:v,getPos:w,parseStyle:function(t){return f.parse(t)},serializeStyle:function(t,e){return f.serialize(t,e)},addStyle:function(e){var r,i;if(z!==Wi.DOM&&t===n.document){if(o[e])return;o[e]=!0}(i=t.getElementById("mceDefaultStyles"))||((i=t.createElement("style")).id="mceDefaultStyles",i.type="text/css",(r=t.getElementsByTagName("head")[0]).firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(t.createTextNode(e))},loadCSS:function(r){if(z===Wi.DOM||t!==n.document){r||(r="");var o=t.getElementsByTagName("head")[0];Li(r.split(","),(function(t){if(t=ue._addCacheSuffix(t),!a[t]){a[t]=!0;var n=R("link",wt(wt({rel:"stylesheet",type:"text/css",href:t},e.contentCssCors?{crossOrigin:"anonymous"}:{}),e.referrerPolicy?{referrerPolicy:e.referrerPolicy}:{}));o.appendChild(n)}}))}else Wi.DOM.loadCSS(r)},addClass:function(t,e){g(t).addClass(e)},removeClass:function(t,e){I(t,e,!1)},hasClass:function(t,e){return g(t).hasClass(e)},toggleClass:I,show:function(t){g(t).show()},hide:function(t){g(t).hide()},isHidden:function(t){return"none"===g(t).css("display")},uniqueId:function(t){return(t||"mce_")+u++},setHTML:N,getOuterHTML:function(t){var e="string"==typeof t?p(t):t;return an(e)?e.outerHTML:mi("<div></div>").append(mi(e).clone()).html()},setOuterHTML:function(t,e){g(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}P(mi(this).html(e),!0)}))},decode:ur.decode,encode:B,insertAfter:function(t,e){var n=p(e);return O(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:M,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=R(e),Li(b(t),(function(e){y(n,e.nodeName,v(t,e.nodeName))})),M(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return f.toHex(ue.trim(t))},run:O,getAttribs:b,isEmpty:function(t,e){var n,r,o=0;if(L(t))return!1;if(t=t.firstChild){var i=new hi(t,t.parentNode),a=l?l.getWhiteSpaceElements():{};e=e||(l?l.getNonEmptyElements():null);do{if(n=t.nodeType,an(t)){var u=t.getAttribute("data-mce-bogus");if(u){t=i.next("all"===u);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(L(t))return!1}if(8===n)return!1;if(3===n&&!Vi.test(t.nodeValue))return!1;if(3===n&&t.parentNode&&a[t.parentNode.nodeName]&&Vi.test(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:F,nodeIndex:Ui,split:function(t,e,n){var r,o,i,a=F();if(t&&e)return a.setStart(t.parentNode,Ui(t)),a.setEnd(e.parentNode,Ui(e)),r=a.extractContents(),(a=F()).setStart(e.parentNode,Ui(e)+1),a.setEnd(t.parentNode,Ui(t)+1),o=a.extractContents(),(i=t.parentNode).insertBefore(Yn(z,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(Yn(z,o),t),P(t),n||e},bind:H,unbind:j,fire:function(t,e,n){return d.fire(t,e,n)},getContentEditable:V,getContentEditableParent:function(t){for(var e=x(),n=null;t&&t!==e&&null===(n=V(t));t=t.parentNode);return n},destroy:function(){if(c.length>0)for(var t=c.length;t--;){var e=c[t];d.unbind(e[0],e[1],e[2])}Do.setDocument&&Do.setDocument()},isChildOf:function(t,e){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},U=function(t,e,n){var r=e.keep_values,o={set:function(t,r,o){e.url_converter&&(r=e.url_converter.call(e.url_converter_scope||n(),r,o,t[0])),t.attr("data-mce-"+o,r).attr(o,r)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return n=t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(f,e,(function(){return z}));return z}!function(t){t.DOM=t(n.document),t.nodeIndex=Ui}(Wi||(Wi={}));var qi=Wi,$i=qi.DOM,Yi=ue.each,Gi=ue.grep,Ki=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,r){var o,i=$i,a=i.uniqueId();(o=n.document.createElement("script")).id=a,o.type="text/javascript",o.src=ue._addCacheSuffix(t),this.settings.referrerPolicy&&i.setAttrib(o,"referrerpolicy",this.settings.referrerPolicy),o.onload=function(){i.remove(a),o&&(o.onreadystatechange=o.onload=o=null),e()},o.onerror=function(){R(r)?r():void 0!==n.console&&n.console.log&&n.console.log("Failed to load script: "+t)},(n.document.getElementsByTagName("head")[0]||n.document.body).appendChild(o)},t.prototype.isDone=function(t){return 2===this.states[t]},t.prototype.markDone=function(t){this.states[t]=2},t.prototype.add=function(t,e,n,r){void 0===this.states[t]&&(this.queue.push(t),this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],a=function(t,e){Yi(o.scriptLoadedCallbacks[e],(function(e){R(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var u=function(){var e=Gi(t);if(t.length=0,Yi(e,(function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,(function(){o.states[t]=2,o.loading--,a("success",t),u()}),(function(){o.states[t]=3,o.loading--,i.push(t),a("failure",t),u()}))):a("failure",t):a("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,Yi(n,(function(t){0===i.length?R(t.success)&&t.success.call(t.scope):R(t.failure)&&t.failure.call(t.scope,i)}))}};u()},t.ScriptLoader=new t,t}(),Xi=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Ji={},Qi=Xi("en"),Zi=function(){return ft(Ji,Qi.get())},ta={getData:function(){return ot(Ji,(function(t){return wt({},t)}))},setCode:function(t){t&&Qi.set(t)},getCode:function(){return Qi.get()},add:function(t,e){var n=Ji[t];n||(Ji[t]=n={}),rt(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=Zi().getOr({}),r=function(t){return R(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null==t},i=function(t){var e=r(t);return ft(n,e.toLowerCase()).map(r).getOr(e)},a=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(D(e=t)&&dt(e,"raw"))return r(t.raw);if(function(t){return O(t)&&t.length>1}(t)){var u=t.slice(1);return a(i(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return dt(u,e)?r(u[e]):t})))}return a(i(t))},isRtl:function(){return Zi().bind((function(t){return ft(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return dt(Ji,t)}};function ea(){var t=this,e=[],n={},r={},o=[],i=function(t,e){var n=U(o,(function(n){return n.name===t&&n.state===e}));V(n,(function(t){return t.callback()}))},a=function(t){var e;return r[t]&&(e=r[t].dependencies),e||[]},u=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},s=function(t,e,o,c,l){if(!n[t]){var f="string"==typeof e?e:e.prefix+e.resource+e.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=ea.baseURL+"/"+f),n[t]=f.substring(0,f.lastIndexOf("/"));var d=function(){i(t,"loaded"),function(t,e,n,r){var o=a(t);V(o,(function(t){var n=u(e,t);s(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(Ki))}(t,e,o,c)};r[t]?d():Ki.ScriptLoader.add(f,d,c,l)}},c=function(t,e,i){void 0===i&&(i="added"),dt(r,t)&&"added"===i||dt(n,t)&&"loaded"===i?e():o.push({name:t,state:i,callback:e})};return{items:e,urls:n,lookup:r,_listeners:o,get:function(t){if(r[t])return r[t].instance},dependencies:a,requireLangPack:function(t,e){!1!==ea.languageLoad&&c(t,(function(){var r=ta.getCode();!r||e&&-1===(","+(e||"")+",").indexOf(","+r+",")||Ki.ScriptLoader.add(n[t]+"/langs/"+r+".js")}),"loaded")},add:function(t,n,o){var a=n;return e.push(a),r[t]={instance:a,dependencies:o},i(t,"added"),a},remove:function(t){delete n[t],delete r[t]},createUrl:u,addComponents:function(e,n){var r=t.urls[e];V(n,(function(t){Ki.ScriptLoader.add(r+"/"+t)}))},load:s,waitFor:c}}!function(t){t.PluginManager=t(),t.ThemeManager=t()}(ea||(ea={}));var na=ea,ra=function(t,e){var r=null;return{cancel:function(){null!==r&&(n.clearTimeout(r),r=null)},throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null===r&&(r=n.setTimeout((function(){t.apply(null,o),r=null}),e))}}},oa=function(t,e){var r=null;return{cancel:function(){null!==r&&(n.clearTimeout(r),r=null)},throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null!==r&&n.clearTimeout(r),r=n.setTimeout((function(){t.apply(null,o),r=null}),e)}}},ia=function(t,e){var n=Sn(t,e);return void 0===n||""===n?[]:n.split(" ")},aa=function(t){return void 0!==t.dom().classList},ua=function(t,e){return function(t,e,n){var r=ia(t,e).concat([n]);return _n(t,e,r.join(" ")),!0}(t,"class",e)},sa=function(t,e){return function(t,e,n){var r=U(ia(t,e),(function(t){return t!==n}));return r.length>0?_n(t,e,r.join(" ")):Tn(t,e),!1}(t,"class",e)},ca=function(t,e){aa(t)?t.dom().classList.add(e):ua(t,e)},la=function(t){0===(aa(t)?t.dom().classList:function(t){return ia(t,"class")}(t)).length&&Tn(t,"class")},fa=function(t,e){return aa(t)&&t.dom().classList.contains(e)},da=function(t,e){var n=[];return V(Ae(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(da(t,e))})),n},ma=function(t,e){return function(t,e){var r=void 0===e?n.document:e.dom();return ye(r)?[]:j(r.querySelectorAll(t),ce.fromDom)}(e,t)};function ha(t,e,n,r,o){return t(n,r)?C.some(n):R(o)&&o(n)?C.none():e(n,r,o)}var pa=function(t,e,n){for(var r=t.dom(),o=R(n)?n:d(!1);r.parentNode;){r=r.parentNode;var i=ce.fromDom(r);if(e(i))return C.some(i);if(o(i))break}return C.none()},ga=function(t,e,n){return ha((function(t,e){return e(t)}),pa,t,e,n)},va=function(t,e,n){return pa(t,(function(t){return be(t,e)}),n)},ba=function(t,e){return function(t,e){var r=void 0===e?n.document:e.dom();return ye(r)?C.none():C.from(r.querySelector(t)).map(ce.fromDom)}(e,t)},ya=function(t,e,n){return ha((function(t,e){return be(t,e)}),va,t,e,n)},xa=d("mce-annotation"),wa=d("data-mce-annotation"),Ca=d("data-mce-annotation-uid"),_a=function(t,e){var n=t.selection.getRng(),r=ce.fromDom(n.startContainer),o=ce.fromDom(t.getBody()),i=e.fold((function(){return"."+xa()}),(function(t){return"["+wa()+'="'+t+'"]'})),a=Re(r,n.startOffset).getOr(r),u=ya(a,i,(function(t){return xe(t,o)})),s=function(t,e){return function(t,e){var n=t.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(e)}(t,e)?C.some(Sn(t,e)):C.none()};return u.bind((function(e){return s(e,""+Ca()).bind((function(n){return s(e,""+wa()).map((function(e){var r=ka(t,n);return{uid:n,name:e,elements:r}}))}))}))},ka=function(t,e){var n=ce.fromDom(t.getBody());return ma(n,"["+Ca()+'="'+e+'"]')},Sa=function(t,e){var n=Xi({}),r=function(t,e){o(t,(function(t){return e(t),t}))},o=function(t,e){var r=n.get(),o=e(r.hasOwnProperty(t)?r[t]:{listeners:[],previous:Xi(C.none())});r[t]=o,n.set(r)},i=oa((function(){var e,i,a,u=n.get(),s=(e=et(u),(a=P.call(e,0)).sort(i),a);V(s,(function(e){o(e,(function(n){var o=n.previous.get();return _a(t,C.some(e)).fold((function(){o.isSome()&&(!function(t){r(t,(function(e){V(e.listeners,(function(e){return e(!1,t)}))}))}(e),n.previous.set(C.none()))}),(function(t){var e=t.uid,i=t.name,a=t.elements;o.is(e)||(!function(t,e,n){r(t,(function(r){V(r.listeners,(function(r){return r(!0,t,{uid:e,nodes:j(n,(function(t){return t.dom()}))})}))}))}(i,e,a),n.previous.set(C.some(e)))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);t.on("remove",(function(){i.cancel()})),t.on("NodeChange",(function(){i.throttle()}));return{addListener:function(t,e){o(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))}}},Ta=function(t,e){t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){V(t,(function(t){(function(t){return C.from(t.attr(wa())).bind(e.lookup)})(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))},Da=0,Oa=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Da+String(e)},Ea=function(t,e){var r,o,i=_e(t).dom(),a=ce.fromDom(i.createDocumentFragment()),u=(r=e,(o=(i||n.document).createElement("div")).innerHTML=r,Ae(ce.fromDom(o)));Ue(a,u),We(t),ze(t,a)},Na=function(t,e){return ce.fromDom(t.dom().cloneNode(e))},Aa=function(t){return Na(t,!1)},Ra=function(t){return Na(t,!0)},Ba=function(t,e,n){void 0===n&&(n=v);var r=new hi(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!hn(e)&&!n(e));return C.from(e).filter(hn)};return{current:function(){return C.from(r.current()).filter(hn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Pa=function(t,e){var n=e||function(e){return t.isBlock(e)||bn(e)||xn(e)},r=function(t,e,n,o){if(hn(t)){var i=o(t,e,t.data);if(-1!==i)return C.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))};return{backwards:function(t,e,o,i){var a=Ba(t,i,n);return r(t,e,(function(){return a.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},forwards:function(t,e,o,i){var a=Ba(t,i,n);return r(t,e,(function(){return a.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}},Ia=function(t){return"\ufeff"===t},Ma=function(t){return t.replace(/\uFEFF/g,"")},La=an,Fa=hn,Ha=function(t){return Fa(t)&&(t=t.parentNode),La(t)&&t.hasAttribute("data-mce-caret")},ja=function(t){return Fa(t)&&Ia(t.data)},Va=function(t){return Ha(t)||ja(t)},za=function(t){return t.firstChild!==t.lastChild||!bn(t.firstChild)},Ua=function(t){var e=t.container();return!(!t||!hn(e))&&("\ufeff"===e.data.charAt(t.offset())||t.isAtStart()&&ja(e.previousSibling))},Wa=function(t){var e=t.container();return!(!t||!hn(e))&&("\ufeff"===e.data.charAt(t.offset()-1)||t.isAtEnd()&&ja(e.nextSibling))},qa=function(t,e,r){var o,i=e.ownerDocument.createElement(t);i.setAttribute("data-mce-caret",r?"before":"after"),i.setAttribute("data-mce-bogus","all"),i.appendChild(((o=n.document.createElement("br")).setAttribute("data-mce-bogus","1"),o));var a=e.parentNode;return r?a.insertBefore(i,e):e.nextSibling?a.insertBefore(i,e.nextSibling):a.appendChild(i),i},$a=function(t){return Fa(t)&&"\ufeff"===t.data[0]},Ya=function(t){return Fa(t)&&"\ufeff"===t.data[t.data.length-1]},Ga=function(t){return t&&t.hasAttribute("data-mce-caret")?(e=t.getElementsByTagName("br"),n=e[e.length-1],ln(n)&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n},Ka=function(t,e,n){return t.isSome()&&e.isSome()?C.some(n(t.getOrDie(),e.getOrDie())):C.none()},Xa=Math.round,Ja=function(t){return t?{left:Xa(t.left),top:Xa(t.top),bottom:Xa(t.bottom),right:Xa(t.right),width:Xa(t.width),height:Xa(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Qa=function(t,e){return t=Ja(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t},Za=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},tu=function(t,e){return t.bottom-t.height/2<e.top||!(t.top>e.bottom)&&Za(e.top-t.bottom,t,e)},eu=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&Za(e.bottom-t.top,t,e)},nu=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},ru=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},ou=function(t,e){return 1===t.nodeType&&t.hasChildNodes()&&(e>=t.childNodes.length&&(e=t.childNodes.length-1),t=t.childNodes[e]),t},iu=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿-⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),au=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&iu.test(t)},uu=yn,su=xn,cu=bn,lu=hn,fu=un(["script","style","textarea"]),du=un(["img","input","textarea","hr","iframe","video","audio","object"]),mu=un(["table"]),hu=Va,pu=function(t){return!hu(t)&&(lu(t)?!fu(t.parentNode):du(t)||cu(t)||mu(t)||gu(t))},gu=function(t){return!1===function(t){return an(t)&&"true"===t.getAttribute("unselectable")}(t)&&su(t)},vu=function(t,e){return pu(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(gu(t))return!1;if(uu(t))return!0}return!0}(t,e)},bu=an,yu=pu,xu=sn("display","block table"),wu=sn("float","left right"),Cu=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(bu,yu,p(wu)),_u=p(sn("white-space","pre pre-line pre-wrap")),ku=hn,Su=bn,Tu=qi.nodeIndex,Du=ou,Ou=function(t){return"createRange"in t?t.createRange():qi.DOM.createRng()},Eu=function(t){return t&&/[\r\n\t ]/.test(t)},Nu=function(t){return!!t.setStart&&!!t.setEnd},Au=function(t){var e,n=t.startContainer,r=t.startOffset;return!!(Eu(t.toString())&&_u(n.parentNode)&&hn(n)&&(e=n.data,Eu(e[r-1])||Eu(e[r+1])))},Ru=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},Bu=function(t){var e,n=t.getClientRects();return e=n.length>0?Ja(n[0]):Ja(t.getBoundingClientRect()),!Nu(t)&&Su(t)&&Ru(e)?function(t){var e=t.ownerDocument,n=Ou(e),r=e.createTextNode(" "),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=Ja(n.getBoundingClientRect());return o.removeChild(r),i}(t):Ru(e)&&Nu(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&hn(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),Bu(i)}return null}(t):e},Pu=function(t,e){var n=Qa(t,e);return n.width=1,n.right=n.left+1,n},Iu=function(t){var e,n,r=[],o=function(t){var e,n;0!==t.height&&(r.length>0&&(e=t,n=r[r.length-1],e.left===n.left&&e.top===n.top&&e.bottom===n.bottom&&e.right===n.right)||r.push(t))},i=function(t,e){var n=Ou(t.ownerDocument);if(e<t.data.length){if(au(t.data[e]))return r;if(au(t.data[e-1])&&(n.setStart(t,e),n.setEnd(t,e+1),!Au(n)))return o(Pu(Bu(n),!1)),r}e>0&&(n.setStart(t,e-1),n.setEnd(t,e),Au(n)||o(Pu(Bu(n),!1))),e<t.data.length&&(n.setStart(t,e),n.setEnd(t,e+1),Au(n)||o(Pu(Bu(n),!0)))};if(ku(t.container()))return i(t.container(),t.offset()),r;if(bu(t.container()))if(t.isAtEnd())n=Du(t.container(),t.offset()),ku(n)&&i(n,n.data.length),Cu(n)&&!Su(n)&&o(Pu(Bu(n),!1));else{if(n=Du(t.container(),t.offset()),ku(n)&&i(n,0),Cu(n)&&t.isAtEnd())return o(Pu(Bu(n),!1)),r;e=Du(t.container(),t.offset()-1),Cu(e)&&!Su(e)&&(xu(e)||xu(n)||!Cu(n))&&o(Pu(Bu(e),!1)),Cu(n)&&o(Pu(Bu(n),!0))}return r};function Mu(t,e,n){var r=function(){return n||(n=Iu(Mu(t,e))),n};return{container:d(t),offset:d(e),toRange:function(){var n=Ou(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return ku(t),0===e},isAtEnd:function(){return ku(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return Du(t,n?e-1:e)}}}!function(t){t.fromRangeStart=function(e){return t(e.startContainer,e.startOffset)},t.fromRangeEnd=function(e){return t(e.endContainer,e.endOffset)},t.after=function(e){return t(e.parentNode,Tu(e)+1)},t.before=function(e){return t(e.parentNode,Tu(e))},t.isAbove=function(t,e){return Ka(Q(e.getClientRects()),Z(t.getClientRects()),tu).getOr(!1)},t.isBelow=function(t,e){return Ka(Z(e.getClientRects()),Q(t.getClientRects()),eu).getOr(!1)},t.isAtStart=function(t){return!!t&&t.isAtStart()},t.isAtEnd=function(t){return!!t&&t.isAtEnd()},t.isTextPosition=function(t){return!!t&&hn(t.container())},t.isElementPosition=function(e){return!1===t.isTextPosition(e)}}(Mu||(Mu={}));var Lu,Fu=Mu,Hu=function(t,e){hn(e)&&0===e.data.length&&t.remove(e)},ju=function(t,e,n){vn(n)?function(t,e,n){var r=C.from(n.firstChild),o=C.from(n.lastChild);e.insertNode(n),r.each((function(e){return Hu(t,e.previousSibling)})),o.each((function(e){return Hu(t,e.nextSibling)}))}(t,e,n):function(t,e,n){e.insertNode(n),Hu(t,n.previousSibling),Hu(t,n.nextSibling)}(t,e,n)},Vu=hn,zu=ln,Uu=qi.nodeIndex,Wu=function(t){var e=t.parentNode;return zu(e)?Wu(e):e},qu=function(t){return t?bt(t.childNodes,(function(t,e){return zu(e)&&"BR"!==e.nodeName?t=t.concat(qu(e)):t.push(e),t}),[]):[]},$u=function(t){return function(e){return t===e}},Yu=function(t){return(Vu(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=qu(Wu(t)),n=yt(e,$u(t),t),e=e.slice(0,n+1);var r=bt(e,(function(t,n,r){return Vu(n)&&Vu(e[r-1])&&t++,t}),0);return e=gt(e,un([t.nodeName])),(n=yt(e,$u(t),t))-r}(t)+"]"},Gu=function(t,e){var n,r,o,i,a,u=[];return n=e.container(),r=e.offset(),Vu(n)?o=function(t,e){for(;(t=t.previousSibling)&&Vu(t);)e+=t.data.length;return e}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Yu(n)),a=function(t,e,n){var r=[];for(e=e.parentNode;e!==t&&(!n||!n(e));e=e.parentNode)r.push(e);return r}(t,n),a=gt(a,p(ln)),(u=u.concat(pt(a,(function(t){return Yu(t)})))).reverse().join("/")+","+o},Ku=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=bt(o,(function(t,e){return(e=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e))?("text()"===e[1]&&(e[1]="#text"),function(t,e,n){var r=qu(t);return r=gt(r,(function(t,e){return!Vu(t)||!Vu(r[e-1])})),(r=gt(r,un([e])))[n]}(t,e[1],parseInt(e[2],10))):null}),t);return i?Vu(i)?function(t,e){for(var n,r=t,o=0;Vu(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!Vu(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return Vu(t)&&e>t.data.length&&(e=t.data.length),Fu(t,e)}(i,parseInt(n,10)):(n="after"===n?Uu(i)+1:Uu(i),Fu(i.parentNode,n)):null},Xu=xn,Ju=function(t,e,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=t.getRoot();for(hn(a)?s.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&hn(r);r=r.previousSibling)o+=t(r.data).length;return o}(e,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(t.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(t.nodeIndex(a,n));return s},Qu=function(t,e,n){var r=0;return ue.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},Zu=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],an(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(e?r:r-1,o.length-1)])&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r))},ts=function(t){return Zu(t,!0),Zu(t,!1),t},es=function(t,e){var n;if(an(t)&&(t=ou(t,e),Xu(t)))return t;if(Va(t)){if(hn(t)&&Ha(t)&&(t=t.parentNode),n=t.previousSibling,Xu(n))return n;if(n=t.nextSibling,Xu(n))return n}},ns=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Xu(r)||"IMG"===o)return{name:o,index:Qu(n.dom,o,r)};var a=function(t){return es(t.startContainer,t.startOffset)||es(t.endContainer,t.endOffset)}(i);return a?{name:o=a.tagName,index:Qu(n.dom,o,a)}:function(t,e,n,r){var o=e.dom,i={};return i.start=Ju(o,t,n,r,!0),e.isCollapsed()||(i.end=Ju(o,t,n,r,!1)),i}(t,n,e,i)},rs=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,""):t.create("span",r)},os=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),a=t.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:Qu(n,u,a)};var s=ts(r.cloneRange());if(!i){s.collapse(!1);var c=rs(n,o+"_end",e);ju(n,s,c)}(r=ts(r)).collapse(!0);var l=rs(n,o+"_start",e);return ju(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},is=function(t,e,n){return 2===e?ns(Ma,n,t):3===e?function(t){var e=t.getRng();return{start:Gu(t.dom.getRoot(),Fu.fromRangeStart(e)),end:Gu(t.dom.getRoot(),Fu.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):os(t,!1)},as=h(ns,m,!0),us=qi.DOM,ss=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return o.hasOwnProperty(t.id)?o[t.id]:n}return r},cs=function(t){return t.getParam("content_security_policy","")},ls=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},fs=function(t){return t.getParam("forced_root_block_attrs",{})},ds=function(t){return t.getParam("automatic_uploads",!0,"boolean")},ms=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},hs=function(t){return t.getParam("icons","","string")},ps=function(t){return t.getParam("images_upload_url","","string")},gs=function(t){return t.getParam("images_upload_base_path","","string")},vs=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},bs=function(t){return t.getParam("images_upload_handler",null,"function")},ys=function(t){return t.getParam("content_css_cors",!1,"boolean")},xs=function(t){return t.getParam("referrer_policy","","string")},ws=function(t){return t.getParam("language","en","string")},Cs=function(t){return t.getParam("indent_use_margin",!1)},_s=function(t){return t.getParam("object_resizing")},ks=function(t){return t.getParam("event_root")},Ss=function(t){return t.getParam("theme")},Ts=function(t){return t.getParam("validate")},Ds=function(t){return!1!==t.getParam("inline_boundaries")},Os=function(t){return t.getParam("content_css_cors")},Es=function(t){return t.getParam("plugins")},Ns=an,As=hn,Rs=function(t){var e=t.parentNode;e&&e.removeChild(t)},Bs=function(t,e){0===e.length?Rs(t):t.nodeValue=e},Ps=function(t){var e=Ma(t);return{count:t.length-e.length,text:e}},Is=function(t,e){return Hs(t),e},Ms=function(t,e){var n=e.container(),r=function(t,e){var n=L(t,e);return-1===n?C.none():C.some(n)}(tt(n.childNodes),t).map((function(t){return t<e.offset()?Fu(n,e.offset()-1):e})).getOr(e);return Hs(t),r},Ls=function(t,e){return As(t)&&e.container()===t?function(t,e){var n=Ps(t.data.substr(0,e.offset())),r=Ps(t.data.substr(e.offset())),o=n.text+r.text;return o.length>0?(Bs(t,o),Fu(t,e.offset()-n.count)):e}(t,e):Is(t,e)},Fs=function(t,e){return Fu.isTextPosition(e)?Ls(t,e):function(t,e){return e.container()===t.parentNode?Ms(t,e):Is(t,e)}(t,e)},Hs=function(t){if(Ns(t)&&Va(t)&&(za(t)?t.removeAttribute("data-mce-caret"):Rs(t)),As(t)){var e=Ma(function(t){try{return t.nodeValue}catch(t){return""}}(t));Bs(t,e)}},js=Yt().browser,Vs=xn,zs=function(t,e,n){var r,o,i,a,u,s=Qa(e.getBoundingClientRect(),n);return"BODY"===t.tagName?(r=t.ownerDocument.documentElement,o=t.scrollLeft||r.scrollLeft,i=t.scrollTop||r.scrollTop):(u=t.getBoundingClientRect(),o=t.scrollLeft-u.left,i=t.scrollTop-u.top),s.left+=o,s.right+=o,s.top+=i,s.bottom+=i,s.width=1,(a=e.offsetWidth-e.clientWidth)>0&&(n&&(a*=-1),s.left+=a,s.right+=a),s},Us=function(t,e,n,r){var o,i,a=Xi(C.none()),u=ls(t),s=u.length>0?u:"p",c=function(){!function(t){var e,n,r,o,i=ma(ce.fromDom(t),"*[contentEditable=false]");for(r=0;r<i.length;r++)n=(e=i[r].dom()).previousSibling,Ya(n)&&(1===(o=n.data).length?n.parentNode.removeChild(n):n.deleteData(o.length-1,1)),n=e.nextSibling,$a(n)&&(1===(o=n.data).length?n.parentNode.removeChild(n):n.deleteData(0,1))}(e),i&&(Hs(i),i=null),a.get().each((function(t){mi(t.caret).remove(),a.set(C.none())})),o&&(Pi.clearInterval(o),o=null)},l=function(){o=Pi.setInterval((function(){r()?mi("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):mi("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500)};return{show:function(t,r){var o,u,f;if(c(),an(f=r)&&/^(TD|TH)$/i.test(f.tagName))return null;if(!n(r))return i=function(t,e){var n,r=t.ownerDocument.createTextNode("\ufeff"),o=t.parentNode;if(e){if(n=t.previousSibling,Fa(n)){if(Va(n))return n;if(Ya(n))return n.splitText(n.data.length-1)}o.insertBefore(r,t)}else{if(n=t.nextSibling,Fa(n)){if(Va(n))return n;if($a(n))return n.splitText(1),n}t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r)}return r}(r,t),u=r.ownerDocument.createRange(),Vs(i.nextSibling)?(u.setStart(i,0),u.setEnd(i,0)):(u.setStart(i,1),u.setEnd(i,1)),u;i=qa(s,r,t),o=zs(e,r,t),mi(i).css("top",o.top);var d=mi('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(o).appendTo(e)[0];return a.set(C.some({caret:d,element:r,before:t})),a.get().each((function(e){t&&mi(e.caret).addClass("mce-visual-caret-before")})),l(),(u=r.ownerDocument.createRange()).setStart(i,0),u.setEnd(i,0),u},hide:c,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){a.get().each((function(t){var n=zs(e,t.element,t.before);mi(t.caret).css(wt({},n))}))},destroy:function(){return Pi.clearInterval(o)}}},Ws=function(){return js.isIE()||js.isEdge()||js.isFirefox()},qs=function(t){return Vs(t)||fn(t)&&Ws()},$s=xn,Ys=sn("display","block table table-cell table-caption list-item"),Gs=Va,Ks=Ha,Xs=an,Js=pu,Qs=function(t){return t>0},Zs=function(t){return t<0},tc=function(t,e){for(var n;n=t(e);)if(!Ks(n))return n;return null},ec=function(t,e,n,r,o){var i=new hi(t,r);if(Zs(e)){if(($s(t)||Ks(t))&&n(t=tc(i.prev,!0)))return t;for(;t=tc(i.prev,o);)if(n(t))return t}if(Qs(e)){if(($s(t)||Ks(t))&&n(t=tc(i.next,!0)))return t;for(;t=tc(i.next,o);)if(n(t))return t}return null},nc=function(t,e){for(;t&&t!==e;){if(Ys(t))return t;t=t.parentNode}return null},rc=function(t,e,n){return nc(t.container(),n)===nc(e.container(),n)},oc=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return Xs(n)?n.childNodes[r+t]:null},ic=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},ac=function(t,e,n){return nc(e,t)===nc(n,t)},uc=function(t,e,n){var r,o;for(o=t?"previousSibling":"nextSibling";n&&n!==e;){if(r=n[o],Gs(r)&&(r=r[o]),$s(r)){if(ac(e,r,n))return r;break}if(Js(r))break;n=n.parentNode}return null},sc=h(ic,!0),cc=h(ic,!1),lc=function(t,e,n){var r,o,i,a=h(uc,!0,e),u=h(uc,!1,e);o=n.startContainer;var s=n.startOffset;if(Ha(o)){if(Xs(o)||(o=o.parentNode),"before"===(i=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,qs(r)))return sc(r);if("after"===i&&(r=o.previousSibling,qs(r)))return cc(r)}if(!n.collapsed)return n;if(hn(o)){if(Gs(o)){if(1===t){if(r=u(o))return sc(r);if(r=a(o))return cc(r)}if(-1===t){if(r=a(o))return cc(r);if(r=u(o))return sc(r)}return n}if(Ya(o)&&s>=o.data.length-1)return 1===t&&(r=u(o))?sc(r):n;if($a(o)&&s<=1)return-1===t&&(r=a(o))?cc(r):n;if(s===o.data.length)return(r=u(o))?sc(r):n;if(0===s)return(r=a(o))?cc(r):n}return n},fc=function(t,e){return C.from(oc(t?0:-1,e)).filter($s)},dc=function(t,e,n){var r=lc(t,e,n);return-1===t?Mu.fromRangeStart(r):Mu.fromRangeEnd(r)},mc=function(t){return C.from(t.getNode()).map(ce.fromDom)},hc=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},pc=function(t,e){var n=rc(t,e);return!(n||!bn(t.getNode()))||n};!function(t){t[t.Backwards=-1]="Backwards",t[t.Forwards=1]="Forwards"}(Lu||(Lu={}));var gc,vc=xn,bc=hn,yc=an,xc=bn,wc=pu,Cc=function(t){return du(t)||function(t){return!!gu(t)&&!0!==q(tt(t.getElementsByTagName("*")),(function(t,e){return t||uu(e)}),!1)}(t)},_c=vu,kc=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},Sc=function(t,e){if(Qs(t)){if(wc(e.previousSibling)&&!bc(e.previousSibling))return Fu.before(e);if(bc(e))return Fu(e,0)}if(Zs(t)){if(wc(e.nextSibling)&&!bc(e.nextSibling))return Fu.after(e);if(bc(e))return Fu(e,e.data.length)}return Zs(t)?xc(e)?Fu.before(e):Fu.after(e):Fu.before(e)},Tc=function(t,e,n){var r,o,i,a;if(!yc(n)||!e)return null;if(e.isEqual(Fu.after(n))&&n.lastChild){if(a=Fu.after(n.lastChild),Zs(t)&&wc(n.lastChild)&&yc(n.lastChild))return xc(n.lastChild)?Fu.before(n.lastChild):a}else a=e;var u=a.container(),s=a.offset();if(bc(u)){if(Zs(t)&&s>0)return Fu(u,--s);if(Qs(t)&&s<u.length)return Fu(u,++s);r=u}else{if(Zs(t)&&s>0&&(o=kc(u,s-1),wc(o)))return!Cc(o)&&(i=ec(o,t,_c,o))?bc(i)?Fu(i,i.data.length):Fu.after(i):bc(o)?Fu(o,o.data.length):Fu.before(o);if(Qs(t)&&s<u.childNodes.length&&(o=kc(u,s),wc(o)))return xc(o)?function(t,e){var n=e.nextSibling;return n&&wc(n)?bc(n)?Fu(n,0):Fu.before(n):Tc(Lu.Forwards,Fu.after(e),t)}(n,o):!Cc(o)&&(i=ec(o,t,_c,o))?bc(i)?Fu(i,0):Fu.before(i):bc(o)?Fu(o,0):Fu.after(o);r=o||a.getNode()}if((Qs(t)&&a.isAtEnd()||Zs(t)&&a.isAtStart())&&(r=ec(r,t,d(!0),n,!0),_c(r,n)))return Sc(t,r);o=ec(r,t,_c,n);var c=xt(U(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(u,n),vc));return!c||o&&c.contains(o)?o?Sc(t,o):null:a=Qs(t)?Fu.after(c):Fu.before(c)},Dc=function(t){return{next:function(e){return Tc(Lu.Forwards,e,t)},prev:function(e){return Tc(Lu.Backwards,e,t)}}},Oc=function(t){return Fu.isTextPosition(t)?0===t.offset():pu(t.getNode())},Ec=function(t){if(Fu.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return pu(t.getNode(!0))},Nc=function(t,e){return!Fu.isTextPosition(t)&&!Fu.isTextPosition(e)&&t.getNode()===e.getNode(!0)},Ac=function(t,e,n){return t?!Nc(e,n)&&(r=e,!(!Fu.isTextPosition(r)&&bn(r.getNode())))&&Ec(e)&&Oc(n):!Nc(n,e)&&Oc(e)&&Ec(n);var r},Rc=function(t,e,n){var r=Dc(e);return C.from(t?r.next(n):r.prev(n))},Bc=function(t,e,n){return Rc(t,e,n).bind((function(r){return rc(n,r,e)&&Ac(t,n,r)?Rc(t,e,r):C.some(r)}))},Pc=function(t,e,n,r){return Bc(t,e,n).bind((function(n){return r(n)?Pc(t,e,n,r):C.some(n)}))},Ic=function(t,e){var n,r=t?e.firstChild:e.lastChild;return hn(r)?C.some(Fu(r,t?0:r.data.length)):r?pu(r)?C.some(t?Fu.before(r):bn(n=r)?Fu.before(n):Fu.after(n)):function(t,e,n){var r=t?Fu.before(n):Fu.after(n);return Rc(t,e,r)}(t,e,r):C.none()},Mc=h(Rc,!0),Lc=h(Rc,!1),Fc=h(Ic,!0),Hc=h(Ic,!1),jc=function(t){return an(t)&&"_mce_caret"===t.id},Vc=function(t,e){for(;e&&e!==t;){if("_mce_caret"===e.id)return e;e=e.parentNode}return null},zc=function(t,e){return an(e)&&t.isBlock(e)&&!e.innerHTML&&!ne.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},Uc=function(t,e){return Hc(t).fold((function(){return!1}),(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},Wc=function(t,e,n){return!(!function(t){return!1===t.hasChildNodes()}(e)||!Vc(t,e))&&(function(t,e){var n=t.ownerDocument.createTextNode("\ufeff");t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),!0)},qc=function(t,e,n,r){var o,i,a,u,s=n[e?"start":"end"],c=t.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;o>=1;o--){if(u=i.childNodes,Wc(c,i,r))return!0;if(s[o]>u.length-1)return!!Wc(c,i,r)||Uc(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),e?r.setStart(i,a):r.setEnd(i,a)}return!0},$c=function(t){return hn(t)&&t.data.length>0},Yc=function(t,e,n){var r,o,i,a,u,s,c=t.get(n.id+"_"+e),l=n.keep;if(c){if(r=c.parentNode,"start"===e?(l?c.hasChildNodes()?(r=c.firstChild,o=1):$c(c.nextSibling)?(r=c.nextSibling,o=0):$c(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=t.nodeIndex(c)+1):o=t.nodeIndex(c),u=r,s=o):(l?c.hasChildNodes()?(r=c.firstChild,o=1):$c(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=t.nodeIndex(c)):o=t.nodeIndex(c),u=r,s=o),!l){for(a=c.previousSibling,i=c.nextSibling,ue.each(ue.grep(c.childNodes),(function(t){hn(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));c=t.get(n.id+"_"+e);)t.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&hn(a)&&!ne.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),t.remove(i),u=a,s=o)}return C.some(Fu(u,s))}return C.none()},Gc=function(t,e){var n=t.dom;if(e){if(function(t){return ue.isArray(t.start)}(e))return function(t,e){var n=t.createRng();return qc(t,!0,e,n)&&qc(t,!1,e,n)?C.some(n):C.none()}(n,e);if(function(t){return"string"==typeof t.start}(e))return C.some(function(t,e){var n,r=t.createRng();return n=Ku(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=Ku(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r}(n,e));if(function(t){return t.hasOwnProperty("id")}(e))return function(t,e){var n=Yc(t,"start",e),r=Yc(t,"end",e);return Ka(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(zc(t,e.container()),e.offset()),r.setEnd(zc(t,n.container()),n.offset()),r}))}(n,e);if(function(t){return t.hasOwnProperty("name")}(e))return function(t,e){return C.from(t.select(e.name)[e.index]).map((function(e){var n=t.createRng();return n.selectNode(e),n}))}(n,e);if(function(t){return t.hasOwnProperty("rng")}(e))return C.some(e.rng)}return C.none()},Kc=function(t,e,n){return is(t,e,n)},Xc=function(t,e){Gc(t,e).each((function(e){t.setRng(e)}))},Jc=function(t){return an(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Qc=(gc=" ",function(t){return gc===t}),Zc=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},tl=function(t){return!Zc(t)&&!Qc(t)},el=function(t){return!!t.nodeType},nl=function(t,e,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!function(t){return t&&/^(IMG)$/.test(t.nodeName)}(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?(u=i[a],r=new hi(u,t.getParent(u,t.isBlock))):(u=i[i.length-1],(r=new hi(u,t.getParent(u,t.isBlock))).next(!0)),o=r.current();o;o=r.next())if(3===o.nodeType&&!al(o))return n.setStart(o,0),void e.setRng(n)},rl=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(1===t.nodeType||!al(t))return t}},ol=function(t,e){return el(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},il=function(t,e,n){return t.schema.isValidChild(e,n)},al=function(t){return t&&hn(t)&&/^([\t \r\n]+|)$/.test(t.nodeValue)},ul=function(t,e){return"string"!=typeof t?t=t(e):e&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},sl=function(t,e){return e=e||"",t=""+((t=t||"").nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},cl=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},ll=function(t,e,n){return cl(t,t.getStyle(e,n),n)},fl=function(t,e){var n;return t.getParent(e,(function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n})),n},dl=function(t,e,n){return t.getParents(e,n,t.getRoot())},ml=function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return ct(t,(function(t,e){return H(r,(function(t){return t===e}))}))};return H(t.formatter.get(e),(function(e){var r=o(e);return H(t.formatter.get(n),(function(t){var e=o(t);return function(t,e,n){return void 0===n&&(n=c),s(n).eq(t,e)}(r,e)}))}))},hl=Jc,pl=dl,gl=al,vl=ol,bl=function(t,e){for(var n=e;n;){if(an(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},yl=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},xl=function(t,e,n){return yl(t,e,n,(function(t){return Qc(t)||Zc(t)}))},wl=function(t,e,n){return yl(t,e,n,tl)},Cl=function(t,e,n,r,o,i){var a,u=t.getParent(n,t.isBlock)||e,s=function(e,n,r){var i=Pa(t),s=o?i.backwards:i.forwards;return C.from(s(e,n,(function(t,e){return hl(t.parentNode)?-1:(a=t,r(o,t,e))}),u))};return s(n,r,xl).bind((function(t){return i?s(t.container,t.offset+(o?-1:0),wl):C.some(t)})).orThunk((function(){return a?C.some({container:a,offset:o?0:a.length}):C.none()}))},_l=function(t,e,n,r,o){hn(r)&&0===r.nodeValue.length&&r[o]&&(r=r[o]);for(var i=pl(t,r),a=0;a<i.length;a++)for(var u=0;u<e.length;u++){var s=e[u];if((!("collapsed"in s)||s.collapsed===n.collapsed)&&t.is(i[a],s.selector))return i[a]}return r},kl=function(t,e,n,r){var o,i=t.dom,a=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,a)),!o){var u=i.getParent(n,"LI,TD,TH");o=i.getParent(hn(n)?n.parentNode:n,(function(e){return e!==a&&vl(t,e)}),u)}if(o&&e[0].wrapper&&(o=pl(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!sl(o,"br")););return o||n},Sl=function(t,e,n,r,o,i,a){var u,s,c;u=s=a?n:o;var l,f=a?"previousSibling":"nextSibling",d=t.getRoot();if(hn(u)&&!gl(u)&&(a?r>0:i<u.nodeValue.length))return u;for(;;){if(!e[0].block_expand&&t.isBlock(s))return s;for(c=s[f];c;c=c[f])if(!hl(c)&&!gl(c)&&("BR"!==(l=c).nodeName||!l.getAttribute("data-mce-bogus")||l.nextSibling))return s;if(s===d||s.parentNode===d){u=s;break}s=s.parentNode}return u},Tl=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,a=e.endContainer,u=e.endOffset,s=t.dom;(an(o)&&o.hasChildNodes()&&(o=ou(o,i),hn(o)&&(i=0)),an(a)&&a.hasChildNodes()&&(a=ou(a,e.collapsed?u:u-1),hn(a)&&(u=a.nodeValue.length)),o=bl(s,o),a=bl(s,a),(hl(o.parentNode)||hl(o))&&(o=hl(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,hn(o)&&(i=e.collapsed?o.length:0)),(hl(a.parentNode)||hl(a))&&(a=hl(a)?a:a.parentNode,a=e.collapsed?a.nextSibling||a:a.previousSibling||a,hn(a)&&(u=e.collapsed?0:a.length)),e.collapsed)&&(Cl(s,t.getBody(),o,i,!0,r).each((function(t){var e=t.container,n=t.offset;o=e,i=n})),Cl(s,t.getBody(),a,u,!1,r).each((function(t){var e=t.container,n=t.offset;a=e,u=n})));return(n[0].inline||n[0].block_expand)&&(n[0].inline&&hn(o)&&0!==i||(o=Sl(s,n,o,i,a,u,!0)),n[0].inline&&hn(a)&&u!==a.nodeValue.length||(a=Sl(s,n,o,i,a,u,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(o=_l(s,n,e,o,"previousSibling"),a=_l(s,n,e,a,"nextSibling")),(n[0].block||n[0].selector)&&(o=kl(t,n,o,"previousSibling"),a=kl(t,n,a,"nextSibling"),n[0].block&&(s.isBlock(o)||(o=Sl(s,n,o,i,a,u,!0)),s.isBlock(a)||(a=Sl(s,n,o,i,a,u,!1)))),an(o)&&(i=s.nodeIndex(o),o=o.parentNode),an(a)&&(u=s.nodeIndex(a)+1,a=a.parentNode),{startContainer:o,startOffset:i,endContainer:a,endOffset:u}},Dl=function(t,e){var n=t.childNodes;return e>=n.length?e=n.length-1:e<0&&(e=0),n[e]||t},Ol=function(t,e,n){var r=e.startContainer,o=e.startOffset,i=e.endContainer,a=e.endOffset,u=function(t){var e;return 3===(e=t[0]).nodeType&&e===r&&o>=e.nodeValue.length&&t.splice(0,1),e=t[t.length-1],0===a&&t.length>0&&e===i&&3===e.nodeType&&t.splice(t.length-1,1),t},s=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},c=function(t,e){do{if(t.parentNode===e)return t;t=t.parentNode}while(t)},l=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,a=i.parentNode;i&&i!==e;i=a){a=i.parentNode;var c=s(i===t?i:i[o],o);c.length&&(r||c.reverse(),n(u(c)))}};if(1===r.nodeType&&r.hasChildNodes()&&(r=Dl(r,o)),1===i.nodeType&&i.hasChildNodes()&&(i=Dl(i,a-1)),r===i)return n(u([r]));for(var f=t.findCommonAncestor(r,i),d=r;d;d=d.parentNode){if(d===i)return l(r,f,!0);if(d===f)break}for(d=i;d;d=d.parentNode){if(d===r)return l(i,f);if(d===f)break}var m=c(r,f)||r,h=c(i,f)||i;l(r,m,!0);var p=s(m===r?m:m.nextSibling,"nextSibling",h===i?h.nextSibling:h);p.length&&n(u(p)),l(i,h)},El=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},Nl=function(t){return U(function(t){return G(t,(function(t){var e=ru(t);return e?[ce.fromDom(e)]:[]}))}(t),Wn)},Al=function(t,e){var n=ma(e,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:Nl(t)},Rl=function(t){return Al(El(t.selection.getSel()),ce.fromDom(t.getBody()))},Bl=function(t){return Be(t).fold(d([t]),(function(e){return[t].concat(Bl(e))}))},Pl=function(t){return Pe(t).fold(d([t]),(function(e){return"br"===le(e)?De(e).map((function(e){return[t].concat(Pl(e))})).getOr([]):[t].concat(Pl(e))}))},Il=function(t,e){return Ka(function(t){var e=t.startContainer,n=t.startOffset;return hn(e)?0===n?C.some(ce.fromDom(e)):C.none():C.from(e.childNodes[n]).map(ce.fromDom)}(e),function(t){var e=t.endContainer,n=t.endOffset;return hn(e)?n===e.data.length?C.some(ce.fromDom(e)):C.none():C.from(e.childNodes[n-1]).map(ce.fromDom)}(e),(function(e,n){var r=$(Bl(t),h(xe,e)),o=$(Pl(t),h(xe,n));return r.isSome()&&o.isSome()})).getOr(!1)},Ml=function(t,e,n,r){var o=n,i=new hi(n,o),a=t.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==ue.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},Ll=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},Fl=function(t,e){var n=Rl(t);n.length>0?V(n,(function(n){var r=n.dom(),o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},Hl=function(t,e,n){var r=os(t,e);n(r),t.moveToBookmark(r)};var jl=function(t,e){var n=function(e){return t(e)?C.from(e.dom().nodeValue):C.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom().nodeValue=r}}}(he,"text"),Vl=function(t){return jl.get(t)},zl=function(t,e,n,r){return Te(e).fold((function(){return"skipping"}),(function(o){return"br"===r||function(t){return he(t)&&"\ufeff"===Vl(t)}(e)?"valid":function(t){return me(t)&&fa(t,xa())}(e)?"existing":jc(e)?"caret":il(t,n,r)&&il(t,le(o),n)?"valid":"invalid-child"}))},Ul=function(t,e,n,r){var o=e.uid,i=void 0===o?Oa("mce-annotation"):o,a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["uid"]),u=ce.fromTag("span",t);ca(u,xa()),_n(u,""+Ca(),i),_n(u,""+wa(),n);var s=r(i,a),c=s.attributes,l=void 0===c?{}:c,f=s.classes,d=void 0===f?[]:f;return kn(u,l),function(t,e){V(e,(function(e){ca(t,e)}))}(u,d),u},Wl=function(t,e,n,r,o){var i=[],a=Ul(t.getDoc(),o,n,r),u=Xi(C.none()),s=function(){u.set(C.none())},c=function(t){V(t,l)},l=function(e){switch(zl(t,e,"span",le(e))){case"invalid-child":s();var n=Ae(e);c(n),s();break;case"valid":!function(t,e){He(t,e),ze(e,t)}(e,u.get().getOrThunk((function(){var t=Aa(a);return i.push(t),u.set(C.some(t)),t})))}};return Ol(t.dom,e,(function(t){s(),function(t){var e=j(t,ce.fromDom);c(e)}(t)})),i},ql=function(t,e,n,r){t.undoManager.transact((function(){var o=t.selection,i=o.getRng(),a=Rl(t).length>0;if(i.collapsed&&!a&&function(t,e){var n=Tl(t,e,[{inline:!0}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)}(t,i),o.getRng().collapsed&&!a){var u=Ul(t.getDoc(),r,e,n.decorate);Ea(u," "),o.getRng().insertNode(u.dom()),o.select(u.dom())}else Hl(o,!1,(function(){Fl(t,(function(o){Wl(t,o,e,n.decorate,r)}))}))}))},$l=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return e.hasOwnProperty(t)?C.from(e[t]).map((function(t){return t.settings})):C.none()}});Ta(t,n);var r=Sa(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each((function(n){ql(t,e,n,r)}))},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){_a(t,C.some(e)).each((function(t){var e=t.elements;V(e,$e)}))},getAll:function(e){var n=function(t,e){var n=ce.fromDom(t.getBody()),r=ma(n,"["+wa()+'="'+e+'"]'),o={};return V(r,(function(t){var e=Sn(t,Ca()),n=o.hasOwnProperty(e)?o[e]:[];o[e]=n.concat([t])})),o}(t,e);return ot(n,(function(t){return j(t,(function(t){return t.dom()}))}))}}},Yl=/^[ \t\r\n]*$/,Gl={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Kl=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var a=t.parent;a&&a!==e;a=a.parent)if(i=a[o])return i}},Xl=function(t){if(!Yl.test(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},Jl=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},Ql=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,Gl[e]||1);return n&&rt(n,(function(t,e){r.attr(e,t)})),r},t.prototype.replace=function(t){return t.parent&&t.remove(),this.insert(t,this),this.remove(),this},t.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&rt(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=new t(this.name,this.type);if(e=this.attributes){var r=[];r.map={};for(var o=0,i=e.length;o<i;o++){var a=e[o];"id"!==a.name&&(r[r.length]={name:a.name,value:a.value},r.map[a.name]=a.value)}n.attributes=r}return n.value=this.value,n.shortEnded=this.shortEnded,n},t.prototype.wrap=function(t){return this.parent.insert(t,this),t.append(this),this},t.prototype.unwrap=function(){for(var t=this.firstChild;t;){var e=t.next;this.insert(t,this,!0),t=e}this.remove()},t.prototype.remove=function(){var t=this.parent,e=this.next,n=this.prev;return t&&(t.firstChild===this?(t.firstChild=e,e&&(e.prev=null)):n.next=e,t.lastChild===this?(t.lastChild=n,n&&(n.next=null)):e.prev=n,this.parent=this.next=this.prev=null),this},t.prototype.append=function(t){t.parent&&t.remove();var e=this.lastChild;return e?(e.next=t,t.prev=e,this.lastChild=t):this.lastChild=this.firstChild=t,t.parent=this,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=Kl(n,this))n.name===t&&e.push(n);return e},t.prototype.empty=function(){if(this.firstChild){for(var t=[],e=this.firstChild;e;e=Kl(e,this))t.push(e);for(var n=t.length;n--;){(e=t[n]).parent=e.firstChild=e.lastChild=e.next=e.prev=null}}return this.firstChild=this.lastChild=null,this},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this.firstChild;if(Jl(this))return!1;if(r)do{if(1===r.type){if(r.attr("data-mce-bogus"))continue;if(t[r.name])return!1;if(Jl(r))return!1}if(8===r.type)return!1;if(3===r.type&&!Xl(r))return!1;if(3===r.type&&r.parent&&e[r.parent.name]&&Yl.test(r.value))return!1;if(n&&n(r))return!1}while(r=Kl(r,this));return!0},t.prototype.walk=function(t){return Kl(this,null,t)},t}(),Zl=ue.makeMap,tf=function(t){var e=[],n=(t=t||{}).indent,r=Zl(t.indent_before||""),o=Zl(t.indent_after||""),i=ur.getEncodeFunc(t.entity_encoding||"raw",t.entities),a="html"===t.element_format;return{start:function(t,u,s){var c,l,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),u)for(c=0,l=u.length;c<l;c++)f=u[c],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!s||a?">":" />",s&&n&&o[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1]).length>0&&"\n"!==r&&e.push("\n")},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},ef=function(t,e){void 0===e&&(e=vr());var n=tf(t);(t=t||{}).validate=!("validate"in t)||t.validate;return{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{a(t)}while(t=t.next)}};n.reset();var a=function(t){var r,u,s,c,l,f,d,m,h,p=i[t.type];if(p)p(t);else{if(r=t.name,u=t.shortEnded,s=t.attributes,o&&s&&s.length>1&&((f=[]).map={},h=e.getElementRule(t.name))){for(d=0,m=h.attributesOrder.length;d<m;d++)(c=h.attributesOrder[d])in s.map&&(l=s.map[c],f.map[c]=l,f.push({name:c,value:l}));for(d=0,m=s.length;d<m;d++)(c=s[d].name)in f.map||(l=s.map[c],f.map[c]=l,f.push({name:c,value:l}));s=f}if(n.start(t.name,s,u),!u){if(t=t.firstChild)do{a(t)}while(t=t.next);n.end(r)}}};return 1!==r.type||t.inner?i[11](r):a(r),n.getContent()}}},nf=function(t,e){return t.replace(new RegExp(e.prefix+"_[0-9]+","g"),(function(t){return ft(e.uris,t).getOr(t)}))},rf=function(t,e,n){var r,o,i=1,a=t.getShortEndedElements(),u=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;for(u.lastIndex=r=n;o=u.exec(e);){if(r=u.lastIndex,"/"===o[1])i--;else if(!o[1]){if(o[2]in a)continue;i++}if(0===i)break}return r},of=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function af(t,e){void 0===e&&(e=vr());var n=function(){};!1!==(t=t||{}).fix_self_closing&&(t.fix_self_closing=!0);var r=t.comment?t.comment:n,o=t.cdata?t.cdata:n,i=t.text?t.text:n,a=t.start?t.start:n,u=t.end?t.end:n,s=t.pi?t.pi:n,c=t.doctype?t.doctype:n,l=function(n,l){void 0===l&&(l="html");for(var f,d,m,h,p,g,v,b,y,x,w,C,_,k,S,T,D,O,E,N=n.html,A=0,R=[],B=0,P=ur.decode,I=ue.makeMap("src,href,data,background,formaction,poster,xlink:href"),M=/((java|vb)script|mhtml):/i,L="html"===l?0:1,F=function(t){var e,n;for(e=R.length;e--&&R[e].name!==t;);if(e>=0){for(n=R.length-1;n>=e;n--)(t=R[n]).valid&&u(t.name);R.length=e}},H=function(t,e){return i(nf(t,n),e)},j=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),r(nf(e,n)))},V=function(t,e){var n=t||"",r=!Pt(n,"--"),o=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(t.substr(e))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/;a.lastIndex=n;var u=a.exec(t);return u?u.index+u[0].length:r.length}(N,r,e);return t=N.substr(e,o-e),j(r?n+t:t),o+1},z=function(e,r,o,i,a){var u,s;if(o=function(t){return ft(n.uris,t).getOr(t)}((r=r.toLowerCase())in Y?r:P(o||i||a||"")),G&&!b&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(r)){if(!(u=k[r])&&S){for(s=S.length;s--&&!(u=S[s]).pattern.test(r););-1===s&&(u=null)}if(!u)return;if(u.validValues&&!(o in u.validValues))return}if(I[r]&&!t.allow_script_urls){var c=o.replace(/[\s\u0000-\u001F]+/g,"");try{c=decodeURIComponent(c)}catch(t){c=unescape(c)}if(M.test(c))return;if(function(t,e){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?!1===t.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))}(t,c))return}b&&(r in I||0===r.indexOf("on"))||(h.map[r]=o,h.push({name:r,value:o}))},U=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),W=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,q=e.getShortEndedElements(),$=t.self_closing_elements||e.getSelfClosingElements(),Y=e.getBoolAttrs(),G=t.validate,K=t.remove_internals,X=t.fix_self_closing,J=e.getSpecialElements(),Q=N+">";f=U.exec(Q);){var Z=f[0];if(A<f.index&&H(P(N.substr(A,f.index-A))),d=f[7])":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),F(d);else if(d=f[8]){if(f.index+Z.length>N.length){H(P(N.substr(f.index))),A=f.index+Z.length;continue}":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),y=d in q,X&&$[d]&&R.length>0&&R[R.length-1].name===d&&F(d);var tt=of(W,f[9]);if(null!==tt){if("all"===tt){A=rf(e,N,U.lastIndex),U.lastIndex=A;continue}w=!1}if(!G||(x=e.getElementRule(d))){if(w=!0,G&&(k=x.attributes,S=x.attributePatterns),(_=f[9])?((b=-1!==_.indexOf("data-mce-type"))&&K&&(w=!1),(h=[]).map={},_.replace(W,z)):(h=[]).map={},G&&!b){if(T=x.attributesRequired,D=x.attributesDefault,O=x.attributesForced,x.removeEmptyAttrs&&!h.length&&(w=!1),O)for(p=O.length;p--;)v=(C=O[p]).name,"{$uid}"===(E=C.value)&&(E="mce_"+B++),h.map[v]=E,h.push({name:v,value:E});if(D)for(p=D.length;p--;)(v=(C=D[p]).name)in h.map||("{$uid}"===(E=C.value)&&(E="mce_"+B++),h.map[v]=E,h.push({name:v,value:E}));if(T){for(p=T.length;p--&&!(T[p]in h.map););-1===p&&(w=!1)}if(C=h.map["data-mce-bogus"]){if("all"===C){A=rf(e,N,U.lastIndex),U.lastIndex=A;continue}w=!1}}w&&a(d,h,y)}else w=!1;if(m=J[d]){m.lastIndex=A=f.index+Z.length,(f=m.exec(N))?(w&&(g=N.substr(A,f.index-A)),A=f.index+f[0].length):(g=N.substr(A),A=N.length),w&&(g.length>0&&H(g,!0),u(d)),U.lastIndex=A;continue}y||(_&&_.indexOf("/")===_.length-1?w&&u(d):R.push({name:d,valid:w}))}else if(d=f[1])j(d);else if(d=f[2]){if(!(1===L||t.preserve_cdata||R.length>0&&e.isValidChild(R[R.length-1].name,"#cdata"))){A=V("",f.index+2),U.lastIndex=A;continue}o(d)}else if(d=f[3])c(d);else{if((d=f[4])||"<!"===Z){A=V(d,f.index+Z.length),U.lastIndex=A;continue}if(d=f[5]){if(1!==L){A=V("?",f.index+2),U.lastIndex=A;continue}s(d,f[6])}}A=f.index+Z.length}for(A<N.length&&H(P(N.substr(A))),p=R.length-1;p>=0;p--)(d=R[p]).valid&&u(d.name)};return{parse:function(t,e){void 0===e&&(e="html"),l(function(t){for(var e,n=/data:[^;]+;base64,([a-z0-9\+\/=]+)/gi,r=[],o={},i=Oa("img"),a=0,u=0;e=n.exec(t);){var s=e[0],c=i+"_"+u++;o[c]=s,a<e.index&&r.push(t.substr(a,e.index-a)),r.push(c),a=e.index+s.length}return 0===a?{prefix:i,uris:o,html:t}:(a<t.length&&r.push(t.substr(a)),{prefix:i,uris:o,html:r.join("")})}(t),e)}}}!function(t){t.findEndTag=rf}(af||(af={}));var uf,sf,cf,lf=af,ff=function(t,e){var n,r,o,i,a=e,u=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,s=t.schema;a=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")}(t.getTempAttrs(),a);for(var c=s.getShortEndedElements();i=u.exec(a);)r=u.lastIndex,o=i[0].length,n=c[i[1]]?r:lf.findEndTag(s,a,r),a=a.substring(0,r-o)+a.substring(n),u.lastIndex=r-o;return Ma(a)},df=ff,mf=function(t,e,n,r){var o;if(e.format=n,e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),"raw"===e.format)o=ue.trim(df(t.serializer,r.innerHTML));else if("text"===e.format)o=Ma(r.innerText||r.textContent);else{if("tree"===e.format)return t.serializer.serialize(r,e);o=function(t,e){var n=ls(t),r=new RegExp("^(<"+n+"[^>]*>( | |\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,e))}return"text"===e.format||qn(ce.fromDom(r))?e.content=o:e.content=ue.trim(o),e.no_events||t.fire("GetContent",e),e.content},hf=ue.each,pf=function(t){this.compare=function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return hf(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(t.hasOwnProperty(r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(e.hasOwnProperty(r))return!1;return!0};return!!o(r(e),r(n))&&(!!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))&&(!Jc(e)&&!Jc(n)))}},gf=function(t,e,n){return C.from(n.container()).filter(hn).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},vf=h(gf,!0,Zc),bf=h(gf,!1,Zc),yf=function(t){var e=t.container();return hn(e)&&0===e.data.length},xf=function(t,e){return function(n){return C.from(oc(t?0:-1,n)).filter(e).isSome()}},wf=function(t){return"IMG"===t.nodeName&&"block"===Dn(ce.fromDom(t),"display")},Cf=function(t){return xn(t)&&!function(t){return an(t)&&"all"===t.getAttribute("data-mce-bogus")}(t)},_f=xf(!0,wf),kf=xf(!1,wf),Sf=xf(!0,fn),Tf=xf(!1,fn),Df=xf(!0,Cf),Of=xf(!1,Cf),Ef=function(t,e){var n,r,o,i=ce.fromDom(t),a=ce.fromDom(e);return n=a,r="pre,code",o=h(xe,i),va(n,r,o).isSome()},Nf=function(t,e){return pu(e)&&!1===function(t,e){return hn(e)&&/^[ \t\r\n]*$/.test(e.data)&&!1===Ef(t,e)}(t,e)||function(t){return an(t)&&"A"===t.nodeName&&t.hasAttribute("name")}(e)||Af(e)},Af=cn("data-mce-bookmark"),Rf=cn("data-mce-bogus"),Bf=(uf="data-mce-bogus",sf="all",function(t){return an(t)&&t.getAttribute(uf)===sf}),Pf=function(t,e){return void 0===e&&(e=!0),function(t,e){var n,r=0;if(Nf(t,t))return!1;if(!(n=t.firstChild))return!0;var o=new hi(n,t);do{if(e){if(Bf(n)){n=o.next(!0);continue}if(Rf(n)){n=o.next();continue}}if(bn(n))r++,n=o.next();else{if(Nf(t,n))return!1;n=o.next()}}while(n);return r<=1}(t.dom(),e)},If=function(t){var e=ma(t,"br"),n=U(function(t){for(var e=[],n=t.dom();n;)e.push(ce.fromDom(n)),n=n.lastChild;return e}(t).slice(-1),Fn);e.length===n.length&&V(n,qe)},Mf=function(t){We(t),ze(t,ce.fromHtml('<br data-mce-bogus="1">'))},Lf=function(t){Pe(t).each((function(e){De(e).each((function(n){Mn(t)&&Fn(e)&&Mn(n)&&qe(e)}))}))},Ff=function(t,e,n){return Ce(e,t)?function(t,e){for(var n=R(e)?e:v,r=t.dom(),o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=ce.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(t,(function(t){return n(t)||xe(t,e)})).slice(0,-1):[]},Hf=function(t,e){return Ff(t,e,d(!1))},jf=function(t,e){return[t].concat(Hf(t,e))},Vf=function(t,e,n){if(0!==n){var r=t.data.slice(e,e+n),o=e+n>=t.data.length,i=0===e;t.replaceData(e,n,function(t,e,n){return q(t,(function(r,o){return Zc(o)||Qc(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+" "}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(r,i,o))}},zf=function(t,e){var n=t.data.slice(e),r=n.length-Lt(n).length;return Vf(t,e,r)},Uf=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===Fu.isTextPosition(t)&&n===e.parentNode&&r>Fu.before(e).offset()}(e,t)?Fu(e.container(),e.offset()-1):e},Wf=function(t){return pu(t.previousSibling)?C.some((e=t.previousSibling,hn(e)?Fu(e,e.data.length):Fu.after(e))):t.previousSibling?Hc(t.previousSibling):C.none();var e},qf=function(t){return pu(t.nextSibling)?C.some((e=t.nextSibling,hn(e)?Fu(e,0):Fu.before(e))):t.nextSibling?Fc(t.nextSibling):C.none();var e},$f=function(t,e){return Wf(e).orThunk((function(){return qf(e)})).orThunk((function(){return function(t,e){var n=Fu.before(e.previousSibling?e.previousSibling:e.parentNode);return Lc(t,n).fold((function(){return Mc(t,Fu.after(e))}),C.some)}(t,e)}))},Yf=function(t,e){return qf(e).orThunk((function(){return Wf(e)})).orThunk((function(){return function(t,e){return Mc(t,Fu.after(e)).fold((function(){return Lc(t,Fu.before(e))}),C.some)}(t,e)}))},Gf=function(t,e,n){return function(t,e,n){return t?Yf(e,n):$f(e,n)}(t,e,n).map(h(Uf,n))},Kf=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},Xf=function(t,e){return e&&t.schema.getBlockElements().hasOwnProperty(le(e))},Jf=function(t){if(Pf(t)){var e=ce.fromHtml('<br data-mce-bogus="1">');return We(t),ze(t,e),C.some(Fu.before(e.dom()))}return C.none()},Qf=function(t,e,n){var r,o,i,a,u=De(t).filter(he),s=Oe(t).filter(he);return qe(t),(r=u,o=s,i=e,a=function(t,e,r){var o=t.dom(),i=e.dom(),a=o.data.length;return function(t,e,n){var r=Ft(t.data).length;t.appendData(e.data),qe(ce.fromDom(e)),n&&zf(t,r)}(o,i,n),r.container()===i?Fu(o,a):r},r.isSome()&&o.isSome()&&i.isSome()?C.some(a(r.getOrDie(),o.getOrDie(),i.getOrDie())):C.none()).orThunk((function(){return n&&(u.each((function(t){return e=t.dom(),n=t.dom().length,r=e.data.slice(0,n),o=r.length-Ft(r).length,Vf(e,n-o,o);var e,n,r,o})),s.each((function(t){return zf(t.dom(),0)}))),e}))},Zf=function(t,e,n,r){void 0===r&&(r=!0);var o,i=Gf(e,t.getBody(),n.dom()),a=pa(n,h(Xf,t),(o=t.getBody(),function(t){return t.dom()===o})),u=Qf(n,i,function(t,e){return dt(t.schema.getTextInlineElements(),le(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):a.bind(Jf).fold((function(){r&&Kf(t,e,u)}),(function(n){r&&Kf(t,e,C.some(n))}))},td=function(t,e){return{start:t,end:e}},ed=Oi([{removeTable:["element"]},{emptyCells:["cells"]},{deleteCellSelection:["rng","cell"]}]),nd=function(t,e){return ya(ce.fromDom(t),"td,th",e)},rd=function(t,e){return va(t,"table",e)},od=function(t){return!xe(t.start,t.end)},id=function(t,e){return rd(t.start,e).bind((function(n){return rd(t.end,e).bind((function(t){return e=xe(n,t),r=n,e?C.some(r):C.none();var e,r}))}))},ad=function(t){return ma(t,"td,th")},ud=function(t,e){var n=nd(e.startContainer,t),r=nd(e.endContainer,t);return e.collapsed?C.none():Ka(n,r,td).fold((function(){return n.fold((function(){return r.bind((function(e){return rd(e,t).bind((function(t){return Q(ad(t)).map((function(t){return td(t,e)}))}))}))}),(function(e){return rd(e,t).bind((function(t){return Z(ad(t)).map((function(t){return td(e,t)}))}))}))}),(function(e){return sd(t,e)?C.none():function(t,e){return rd(t.start,e).bind((function(e){return Z(ad(e)).map((function(e){return td(t.start,e)}))}))}(e,t)}))},sd=function(t,e){return id(e,t).isSome()},cd=function(t,e,n){return t.filter((function(t){return od(t)&&sd(n,t)})).orThunk((function(){return ud(n,e)})).bind((function(t){return function(t,e){return id(t,e).map((function(e){return function(t,e,n){return{rng:t,table:e,cells:n}}(t,e,ad(e))}))}(t,n)}))},ld=function(t,e){return Y(t,(function(t){return xe(t,e)}))},fd=function(t,e,n){return t.filter((function(t){return function(t,e){return!od(t)&&id(t,e).exists((function(t){var e=t.dom().rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&Il(t.start,e)})).map((function(t){return t.start}))},dd=function(t){return function(t){return Ka(ld(t.cells,t.rng.start),ld(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))}(t).map((function(e){var n=t.cells;return e.length===n.length?ed.removeTable(t.table):ed.emptyCells(e)}))},md=function(t,e){var n=function(t){return function(e){return xe(t,e)}}(t),r=function(t,e){var n=nd(t.startContainer,e),r=nd(t.endContainer,e);return Ka(n,r,td)}(e,n);return fd(r,e,n).map((function(t){return ed.deleteCellSelection(e,t)})).orThunk((function(){return cd(r,e,n).bind(dd)}))},hd=function(t){var e;return(8===fe(e=t)||"#comment"===le(e)?De(t):Pe(t)).bind(hd).orThunk((function(){return C.some(t)}))},pd=function(t,e){return V(e,Mf),t.selection.setCursorLocation(e[0].dom(),0),!0},gd=function(t,e,n){e.deleteContents();var r,o=hd(n).getOr(n),i=ce.fromDom(t.dom.getParent(o.dom(),t.dom.isBlock));if(Pf(i)&&(Mf(i),t.selection.setCursorLocation(i.dom(),0)),!xe(n,i)){var a=Te(i).is(n)?[]:Te(r=i).map(Ae).map((function(t){return U(t,(function(t){return!xe(r,t)}))})).getOr([]);V(a.concat(Ae(n)),(function(t){xe(t,i)||Ce(t,i)||qe(t)}))}return!0},vd=function(t,e){return Zf(t,!1,e),!0},bd=function(t,e,n,r){return xd(e,r).fold((function(){return function(t,e,n){return md(e,n).map((function(e){return e.fold(h(vd,t),h(pd,t),h(gd,t))}))}(t,e,n)}),(function(e){return function(t,e){return wd(t,e)}(t,e)})).getOr(!1)},yd=function(t,e){return $(jf(e,t),Wn)},xd=function(t,e){return $(jf(e,t),(function(t){return"caption"===le(t)}))},wd=function(t,e){return Mf(e),t.selection.setCursorLocation(e.dom(),0),C.some(!0)},Cd=function(t,e,n,r,o){return Bc(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return Fc(t.dom()).bind((function(o){return Hc(t.dom()).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(t,e){return wd(t,e)}(t,r):function(t,e,n){return xd(t,ce.fromDom(n.getNode())).map((function(t){return!1===xe(t,e)}))}(e,r,i)})).or(C.some(!0))},_d=function(t,e,n,r){var o=Fu.fromRangeStart(t.selection.getRng());return yd(n,r).bind((function(r){return Pf(r)?wd(t,r):function(t,e,n,r,o){return Bc(n,t.getBody(),o).bind((function(t){return yd(e,ce.fromDom(t.getNode())).map((function(t){return!1===xe(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)},kd=function(t,e){return t?Sf(e):Tf(e)},Sd=function(t,e,n){var r=ce.fromDom(t.getBody());return xd(r,n).fold((function(){return _d(t,e,r,n)||function(t,e){var n=Fu.fromRangeStart(t.selection.getRng());return kd(e,n)||Rc(e,t.getBody(),n).map((function(t){return kd(e,t)})).getOr(!1)}(t,e)}),(function(n){return function(t,e,n,r){var o=Fu.fromRangeStart(t.selection.getRng());return Pf(r)?wd(t,r):Cd(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},Td=function(t,e){var n=ce.fromDom(t.selection.getStart(!0)),r=Rl(t);return t.selection.isCollapsed()&&0===r.length?Sd(t,e,n):function(t,e){var n=ce.fromDom(t.getBody()),r=t.selection.getRng(),o=Rl(t);return 0!==o.length?pd(t,o):bd(t,n,r,e)}(t,n)},Dd=function(t){var e=Fu.fromRangeStart(t),r=Fu.fromRangeEnd(t),o=t.commonAncestorContainer;return Rc(!1,o,r).map((function(i){return!rc(e,r,o)&&rc(e,i,o)?function(t,e,r,o){var i=n.document.createRange();return i.setStart(t,e),i.setEnd(r,o),i}(e.container(),e.offset(),i.container(),i.offset()):t})).getOr(t)},Od=function(t){return t.collapsed?t:Dd(t)},Ed=function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&function(t){return" "===t.data||bn(t)}(t.firstChild)},Nd=function(t){return t.length>0&&(!(e=t[t.length-1]).firstChild||Ed(e))?t.slice(0,-1):t;var e},Ad=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},Rd=function(t,e){var n=Fu.after(t),r=Dc(e).prev(n);return r?r.toRange():null},Bd=function(t,e,n){var r=t.parentNode;return ue.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=Fu.before(t),r=Dc(e).next(n);return r?r.toRange():null}(t,n)},Pd=function(t,e,n,r){var o,i=function(t,e,n){var r=e.serialize(n);return function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t}(t.createFragment(r))}(e,t,r),a=Ad(e,n.startContainer),u=Nd((o=i.firstChild,ue.grep(o.childNodes,(function(t){return"LI"===t.nodeName})))),s=e.getRoot(),c=function(t){var r=Fu.fromRangeStart(n),o=Dc(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Ad(e,i.getNode())!==a};return c(1)?Bd(a,u,s):c(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),Rd(e[0],n)}(a,u,s,e):function(t,e,n,r){var o=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]}(t,r),i=t.parentNode;return i.insertBefore(o[0],t),ue.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),Rd(e[e.length-1],n)}(a,u,s,n)},Id=un(["td","th"]),Md=function(t,e){var n=t.selection.getRng(),r=n.startContainer,o=n.startOffset;n.collapsed&&function(t,e){return hn(t)&&" "===t.nodeValue[e-1]}(r,o)&&hn(r)&&(r.insertData(o-1," "),r.deleteData(o,1),n.setStart(r,o),n.setEnd(r,o),t.selection.setRng(n)),t.selection.setContent(e)},Ld=function(t){var e=t.dom,n=Od(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,Id);!function(t,e,n){return null!==n&&(n===t.getParent(e.endContainer,Id)&&Il(ce.fromDom(n),e))}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):gd(t,n,ce.fromDom(r))},Fd=function(t,e,n){var r,o,i,a,u,s,c=t.selection,l=t.dom;/^ | $/.test(e)&&(e=function(t,e){var n=t.startContainer,r=t.startOffset,o=function(t){return n[t]&&3===n[t].nodeType};return hn(n)&&(r>0?e=e.replace(/^ /," "):o("previousSibling")||(e=e.replace(/^ /," ")),r<n.length?e=e.replace(/ (<br>|)$/," "):o("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e}(c.getRng(),e));var f=t.parser,d=n.merge,m=ef({validate:Ts(t)},t.schema),h='<span id="mce_marker" data-mce-type="bookmark">​</span>';if(i={content:e,format:"html",selection:!0,paste:n.paste},(i=t.fire("BeforeSetContent",i)).isDefaultPrevented())t.fire("SetContent",{content:i.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=i.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,h);var p=(u=c.getRng()).startContainer||(u.parentElement?u.parentElement():null),g=t.getBody();p===g&&c.isCollapsed()&&l.isBlock(g.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,g.firstChild)&&l.isEmpty(g.firstChild)&&((u=l.createRng()).setStart(g.firstChild,0),u.setEnd(g.firstChild,0),c.setRng(u)),c.isCollapsed()||(Ld(t),e=function(t,e){var n=t.startContainer,r=t.startOffset;return hn(n)&&t.collapsed&&(" "===n.data[r]?(n.deleteData(r,1),/[\u00a0| ]$/.test(e)||(e+=" ")):" "===n.data[r-1]&&(n.deleteData(r-1,1),/[\u00a0| ]$/.test(e)||(e=" "+e))),e}(t.selection.getRng(),e));var v,b={context:(r=c.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},y=f.parse(e,b);if(!0===n.paste&&function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||function(t,e){return t.getBlockElements()[e.name]&&function(t){return t.firstChild&&t.firstChild===t.lastChild}(e)&&function(t){return"br"===t.name||" "===t.value}(e.firstChild)}(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r)&&("ul"===n.name||"ol"===n.name)}(t.schema,y)&&function(t,e){return!!Ad(t,e)}(l,r))return u=Pd(m,l,t.selection.getRng(),y),t.selection.setRng(u),void t.fire("SetContent",i);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(y),"mce_marker"===(s=y.lastChild).attr("id"))for(a=s,s=s.prev;s;s=s.walk(!0))if(3===s.type||!l.isBlock(s.name)){t.schema.isValidChild(s.parent.name,"span")&&s.parent.insert(a,s,"br"===s.name);break}if(t._selectionOverrides.showBlockCaretContainer(r),b.invalid){for(Md(t,h),r=c.getNode(),o=t.getBody(),9===r.nodeType?r=s=o:s=r;s!==o;)r=s,s=s.parentNode;e=r===o?o.innerHTML:l.getOuterHTML(r),e=m.serialize(f.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return m.serialize(y)})))),r===o?l.setHTML(o,e):l.setOuterHTML(r,e)}else!function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):Md(t,e)}}(t,e=m.serialize(y),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=new pf(r);ue.each(r.select("*[data-mce-fragment]"),(function(t){for(var e=t.parentNode;e&&e!==o;e=e.parentNode)n[t.nodeName.toLowerCase()]&&i.compare(e,t)&&r.remove(t,!0)}))}}(t,d),function(t,e){var n,r,o=t.dom,i=t.selection;if(e){t.selection.scrollIntoView(e);var a=function(e){for(var n=t.getBody();e&&e!==n;e=e.parentNode)if("false"===t.dom.getContentEditable(e))return e;return null}(e);if(a)return o.remove(e),void i.select(a);var u=o.createRng(),s=e.previousSibling;s&&3===s.nodeType?(u.setStart(s,s.nodeValue.length),ne.ie||(r=e.nextSibling)&&3===r.nodeType&&(s.appendData(r.data),r.parentNode.removeChild(r))):(u.setStartBefore(e),u.setEndBefore(e));var c=o.getParent(e,o.isBlock);o.remove(e),c&&o.isEmpty(c)&&(t.$(c).empty(),u.setStart(c,0),u.setEnd(c,0),Id(c)||function(t){return!!t.getAttribute("data-mce-fragment")}(c)||!(n=function(e){var n=Fu.fromRangeStart(e);if(n=Dc(t.getBody()).next(n))return n.toRange()}(u))?o.add(c,o.create("br",{"data-mce-bogus":"1"})):(u=n,o.remove(c))),i.setRng(u)}}(t,l.get("mce_marker")),v=t.getBody(),ue.each(v.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){C.from(t.getParent(e,"td,th")).map(ce.fromDom).each(Lf)}(t.dom,t.selection.getStart()),t.fire("SetContent",i),t.addVisual()}},Hd=function(t){var e=Me(t).dom();return t.dom()===e.activeElement},jd=function(t){return void 0===t&&(t=ce.fromDom(n.document)),C.from(t.dom().activeElement).map(ce.fromDom)},Vd=function(t,e,n,r){return{start:d(t),soffset:d(e),finish:d(n),foffset:d(r)}},zd=Oi([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Ud=(zd.before,zd.on,zd.after,function(t){return t.fold(m,m,m)}),Wd=Oi([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),qd={domRange:Wd.domRange,relative:Wd.relative,exact:Wd.exact,exactFromRange:function(t){return Wd.exact(t.start(),t.soffset(),t.finish(),t.foffset())},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return ce.fromDom(t.startContainer)},relative:function(t,e){return Ud(t)},exact:function(t,e,n,r){return t}})}(t);return Se(e)},range:Vd},$d=Yt().browser,Yd=function(t,e){var n=he(e)?Vl(e).length:Ae(e).length+1;return t>n?n:t<0?0:t},Gd=function(t){return qd.range(t.start(),Yd(t.soffset(),t.start()),t.finish(),Yd(t.foffset(),t.finish()))},Kd=function(t,e){return!on(e.dom())&&(Ce(t,e)||xe(t,e))},Xd=function(t){return function(e){return Kd(t,e.start())&&Kd(t,e.finish())}},Jd=function(t){return!0===t.inline||$d.isIE()},Qd=function(t){return qd.range(ce.fromDom(t.startContainer),t.startOffset,ce.fromDom(t.endContainer),t.endOffset)},Zd=function(t){return function(t){var e=t.getSelection();return(e&&0!==e.rangeCount?C.from(e.getRangeAt(0)):C.none()).map(Qd)}(Se(t).dom()).filter(Xd(t))},tm=function(t){var e=n.document.createRange();try{return e.setStart(t.start().dom(),t.soffset()),e.setEnd(t.finish().dom(),t.foffset()),C.some(e)}catch(t){return C.none()}},em=function(t){var e=Jd(t)?Zd(ce.fromDom(t.getBody())):C.none();t.bookmark=e.isSome()?e:t.bookmark},nm=function(t){return(t.bookmark?t.bookmark:C.none()).bind((function(e){return function(t,e){return C.from(e).filter(Xd(t)).map(Gd)}(ce.fromDom(t.getBody()),e)})).bind(tm)},rm={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},om=function(t,e){Yt().browser.isIE()?function(t){t.on("focusout",(function(){em(t)}))}(t):function(t,e){t.on("mouseup touchend",(function(t){e.throttle()}))}(t,e),t.on("keyup NodeChange",(function(e){(function(t){return"nodechange"===t.type&&t.selectionChange})(e)||em(t)}))},im=function(t){var e=ra((function(){em(t)}),0);t.on("init",(function(){t.inline&&function(t,e){var r=function(){e.throttle()};qi.DOM.bind(n.document,"mouseup",r),t.on("remove",(function(){qi.DOM.unbind(n.document,"mouseup",r)}))}(t,e),om(t,e)})),t.on("remove",(function(){e.cancel()}))},am=qi.DOM,um=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t);return null!==am.getParent(e,(function(e){return function(t){return rm.isEditorUIElement(t)}(e)||!!n&&t.dom.is(e,n)}))},sm=function(t,e){var r=e.editor;im(r),r.on("focusin",(function(){var e=t.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),t.setActive(this),t.focusedEditor=this,this.fire("focus",{blurredEditor:e}),this.focus(!0))})),r.on("focusout",(function(){var e=this;Pi.setEditorTimeout(e,(function(){var r=t.focusedEditor;um(e,function(){try{return n.document.activeElement}catch(t){return n.document.body}}())||r!==e||(e.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),cf||(cf=function(e){var r=t.activeEditor,o=e.target;r&&o.ownerDocument===n.document&&(o===n.document.body||um(r,o)||t.focusedEditor!==r||(r.fire("blur",{focusedEditor:null}),t.focusedEditor=null))},am.bind(n.document,"focusin",cf))},cm=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(am.unbind(n.document,"focusin",cf),cf=null)},lm=function(t,e){return function(t){return t.collapsed?C.from(ou(t.startContainer,t.startOffset)).map(ce.fromDom):C.none()}(e).bind((function(e){return Un(e)?C.some(e):!1===Ce(t,e)?C.some(t):C.none()}))},fm=function(t,e){lm(ce.fromDom(t.getBody()),e).bind((function(t){return Fc(t.dom())})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},dm=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},mm=function(t){return Hd(t)||(e=t,jd(Me(e)).filter((function(t){return e.dom().contains(t.dom())}))).isSome();var e},hm=function(t){return t.inline?function(t){var e=t.getBody();return e&&mm(ce.fromDom(e))}(t):function(t){return t.iframeElement&&Hd(ce.fromDom(t.iframeElement))}(t)},pm=function(t){return hm(t)||function(t){return jd().filter((function(e){return n=e.dom(),!(void 0!==(r=n.classList)&&(r.contains("tox-edit-area")||r.contains("tox-edit-area__iframe")||r.contains("mce-content-body")))&&um(t,e.dom());var n,r})).isSome()}(t)},gm=function(t){return t.editorManager.setActive(t)},vm=function(t,e){t.removed||(e?gm(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===hm(t)&&nm(t).each((function(e){t.selection.setRng(e),r=e}));var o=function(t,e){return t.dom.getParent(e,(function(e){return"true"===t.dom.getContentEditable(e)}))}(t,e.getNode());if(t.$.contains(n,o))return dm(o),fm(t,r),void gm(t);t.inline||(ne.opera||dm(n),t.getWin().focus()),(ne.gecko||t.inline)&&(dm(n),fm(t,r)),gm(t)}(t))},bm=function(t,e){e(t),t.firstChild&&bm(t.firstChild,e),t.next&&bm(t.next,e)},ym=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var a in n.firstChild&&bm(n.firstChild,(function(n){V(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),V(e,(function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var u in o)o.hasOwnProperty(u)&&i.push(o[u]);return i}(t,e,n);V(r,(function(t){V(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},xm=function(t){return t instanceof Ql},wm=function(t,e){t.dom.setHTML(t.getBody(),e),function(t){hm(t)&&Fc(t.getBody()).each((function(e){var n=e.getNode(),r=fn(n)?Fc(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},Cm=function(t,e,n){return n.format=n.format?n.format:"html",n.set=!0,n.content=xm(e)?"":e,xm(e)||n.no_events||(t.fire("BeforeSetContent",n),e=n.content),C.from(t.getBody()).fold(d(e),(function(r){return xm(e)?function(t,e,n,r){ym(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=ef({validate:t.validate},t.schema).serialize(n);return r.content=qn(ce.fromDom(e))?o:ue.trim(o),wm(t,r.content),r.no_events||t.fire("SetContent",r),n}(t,r,e,n):function(t,e,n,r){var o,i;return 0===n.length||/^\s+$/.test(n)?(i='<br data-mce-bogus="1">',"TABLE"===e.nodeName?n="<tr><td>"+i+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+i+"</li>"),(o=ls(t))&&t.schema.isValidChild(e.nodeName.toLowerCase(),o.toLowerCase())?(n=i,n=t.dom.createHTML(o,fs(t),n)):n||(n='<br data-mce-bogus="1">'),wm(t,n),t.fire("SetContent",r)):("raw"!==r.format&&(n=ef({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=qn(ce.fromDom(e))?n:ue.trim(n),wm(t,r.content),r.no_events||t.fire("SetContent",r)),r.content}(t,r,e,n)}))},_m=function(t,e){return t.splitText(e)},km=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&hn(e)?n>0&&n<e.nodeValue.length&&(e=(r=_m(e,n)).previousSibling,o>n?(e=r=_m(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(hn(e)&&n>0&&n<e.nodeValue.length&&(e=_m(e,n),n=0),hn(r)&&o>0&&o<r.nodeValue.length&&(o=(r=_m(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}},Sm=sl,Tm=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&t.dom.is(e,r[o].selector))return!0;return!1},Dm=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,(function(e){return!!Tm(t,e,n)||(e.parentNode===o||!!Nm(t,e,n,r,!0))})),Nm(t,e,n,r))},Om=function(t,e,n){return!!Sm(e,n.inline)||(!!Sm(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0))},Em=function(t,e,n,r,o,i){var a,u,s,c=n[r];if(n.onmatch)return n.onmatch(e,n,r);if(c)if(void 0===c.length){for(a in c)if(c.hasOwnProperty(a)){if(u="attributes"===r?t.getAttrib(e,a):ll(t,e,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!Sm(u,cl(t,ul(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?t.getAttrib(e,c[s]):ll(t,e,c[s]))return n;return n},Nm=function(t,e,n,r,o){var i,a,u,s,c=t.formatter.get(n),l=t.dom;if(c&&e)for(a=0;a<c.length;a++)if(i=c[a],Om(t.dom,e,i)&&Em(l,e,i,"attributes",o,r)&&Em(l,e,i,"styles",o,r)){if(s=i.classes)for(u=0;u<s.length;u++)if(!t.dom.hasClass(e,s[u]))return;return i}},Am=function(t,e,n,r){if(r)return Dm(t,r,e,n);if(r=t.selection.getNode(),Dm(t,r,e,n))return!0;var o=t.selection.getStart();return!(o===r||!Dm(t,o,e,n))},Rm=function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,(function(i){for(var a=0;a<e.length;a++){var u=e[a];!o[u]&&Nm(t,i,u,n)&&(o[u]=!0,r.push(u))}}),t.dom.getRoot()),r},Bm=function(t,e){var n,r,o,i,a,u=t.formatter.get(e),s=t.dom;if(u)for(n=t.selection.getStart(),r=dl(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},Pm=function(t,e,n){return q(n,(function(n,r){var o=function(t,e){return H(t.formatter.get(e),(function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return H(["styles","attributes"],(function(n){return ft(t,n).exists((function(t){var n=O(t)?t:lt(t);return H(n,e)}))}))}))}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},Im=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&"\ufeff"!==t.nodeValue||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},Mm=function(t){if(t){var e=new hi(t,t);for(t=e.current();t;t=e.next())if(hn(t))return t}return null},Lm=function(t){var e=ce.fromTag("span");return kn(e,{id:"_mce_caret","data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&ze(e,ce.fromText("\ufeff")),e},Fm=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(Im(e))Zf(t,!1,ce.fromDom(e),n);else{var i=o.getRng(),a=r.getParent(e,r.isBlock),u=i.startContainer,s=i.startOffset,c=i.endContainer,l=i.endOffset,f=function(t){var e=Mm(t);return e&&"\ufeff"===e.nodeValue.charAt(0)&&e.deleteData(0,1),e}(e);r.remove(e,!0),u===f&&s>0&&i.setStart(f,s-1),c===f&&l>0&&i.setEnd(f,l-1),a&&r.isEmpty(a)&&Mf(ce.fromDom(a)),o.setRng(i)}},Hm=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)Fm(t,e,n);else if(!(e=Vc(t.getBody(),o.getStart())))for(;e=r.get("_mce_caret");)Fm(t,e,!1)},jm=function(t,e){return t.appendChild(e),e},Vm=function(t,e){var n=W(t,(function(t,e){return jm(t,e.cloneNode(!1))}),e);return jm(n,n.ownerDocument.createTextNode("\ufeff"))},zm=function(t,e,n,r){var o,i,a,u=t.dom,s=t.selection,c=[],l=s.getRng(),f=l.startContainer,d=l.startOffset;for(i=f,3===f.nodeType&&(d!==f.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(Nm(t,i,e,n,r)){a=i;break}i.nextSibling&&(o=!0),c.push(i),i=i.parentNode}if(a)if(o){var m=s.getBookmark();l.collapse(!0);var p=Tl(t,l,t.formatter.get(e),!0);p=km(p),t.formatter.remove(e,n,p,r),s.moveToBookmark(m)}else{var g=Vc(t.getBody(),a),v=Lm(!1).dom();!function(t,e,n){var r=t.dom,o=r.getParent(n,h(ol,t));o&&r.isEmpty(o)?n.parentNode.replaceChild(e,n):(If(ce.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(e,n):r.insertAfter(e,n))}(t,v,null!==g?g:a);var b=function(t,e,n,r,o,i){var a=t.formatter,u=t.dom,s=U(et(a.get()),(function(t){return"removeformat"!==t&&t!==r})),c=Pm(t,n,s);if(U(c,(function(e){return!ml(t,e,r)})).length>0){var l=n.cloneNode(!1);return u.add(e,l),a.remove(r,o,l,i),u.remove(l),C.some(l)}return C.none()}(t,v,a,e,n,r),y=Vm(c.concat(b.toArray()),v);Fm(t,g,!1),s.setCursorLocation(y,1),u.isEmpty(a)&&u.remove(a)}},Um=function(t){t.on("mouseup keydown",(function(e){!function(t,e){var n=t.selection,r=t.getBody();Hm(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||"\ufeff"!==n.getStart().innerHTML||Hm(t,Vc(r,n.getStart())),37!==e&&39!==e||Hm(t,Vc(r,n.getStart()))}(t,e.keyCode)}))},Wm=function(t,e){return t.schema.getTextInlineElements().hasOwnProperty(le(e))&&!jc(e.dom())&&!ln(e.dom())},qm={},$m=gt,Ym=ht;!function(t,e){qm[t]||(qm[t]=[]),qm[t].push(e)}("pre",(function(t){var e,n=t.selection.getRng(),r=un(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),Ym($m($m(e,r),(function(t){return r(t.previousSibling)&&-1!==vt(e,t.previousSibling)})),(function(t){var e,n;e=t.previousSibling,mi(n=t).remove(),mi(e).append("<br><br>").append(n.childNodes)})))}));var Gm,Km,Xm=/^(src|href|style)$/,Jm=ue.each,Qm=sl,Zm=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},th=function(t,e,n){var r,o;if(r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"],an(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return hn(r)&&n&&o>=r.nodeValue.length&&(r=new hi(r,t.getBody()).next()||r),hn(r)&&!n&&0===o&&(r=new hi(r,t.getBody()).prev()||r),r},eh=function(t,e){var n=e?"firstChild":"lastChild";if(function(t){return/^(TR|TH|TD)$/.test(t.nodeName)}(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},nh=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},rh=function(t,e,n,r,o){var i=ce.fromDom(e),a=ce.fromDom(t.create(r,o)),u=n?Ne(i):Ee(i);return Ue(a,u),n?(He(i,a),Ve(a,i)):(je(i,a),ze(a,i)),a.dom()},oh=function(t,e,n,r){return!(e=rl(e,n,r))||"BR"===e.nodeName||t.isBlock(e)},ih=function(t,e,n,r,o){var i,a=t.dom;if(!function(t,e,n){return!!Qm(e,n.inline)||(!!Qm(e,n.block)||(n.selector?an(e)&&t.is(e,n.selector):void 0))}(a,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return!1;var u=r;if(e.inline&&"all"===e.remove&&O(e.preserve_attributes)){var s=U(a.getAttribs(u),(function(t){return F(e.preserve_attributes,t.name.toLowerCase())}));if(a.removeAllAttribs(u),V(s,(function(t){return a.setAttrib(u,t.name,t.value)})),s.length>0)return t.dom.rename(r,"span"),!0}if("all"!==e.remove){Jm(e.styles,(function(t,r){t=cl(a,ul(t,n),r),"number"==typeof r&&(r=t,o=null),(e.remove_similar||!o||Qm(ll(a,o,r),t))&&a.setStyle(u,r,""),i=!0})),i&&""===a.getAttrib(u,"style")&&(u.removeAttribute("style"),u.removeAttribute("data-mce-style")),Jm(e.attributes,(function(t,r){var i;if(t=ul(t,n),"number"==typeof r&&(r=t,o=null),e.remove_similar||!o||Qm(a.getAttrib(o,r),t)){if("class"===r&&(t=a.getAttrib(u,r))&&(i="",V(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))return void a.setAttrib(u,r,i);"class"===r&&u.removeAttribute("className"),Xm.test(r)&&u.removeAttribute("data-mce-"+r),u.removeAttribute(r)}})),Jm(e.classes,(function(t){t=ul(t,n),o&&!a.hasClass(o,t)||a.removeClass(u,t)}));for(var c=a.getAttribs(u),l=0;l<c.length;l++){var f=c[l].nodeName;if(0!==f.indexOf("_")&&0!==f.indexOf("data-"))return!1}}return"none"!==e.remove?(function(t,e,n){var r,o=e.parentNode,i=t.dom,a=ls(t);n.block&&(a?o===i.getRoot()&&(n.list_block&&Qm(e,n.list_block)||V(tt(e.childNodes),(function(e){il(t,a,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=nh(i,e,a),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=0}))):i.isBlock(e)&&!i.isBlock(o)&&(oh(i,e,!1)||oh(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),oh(i,e,!0)||oh(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),n.selector&&n.inline&&!Qm(n.inline,e)||i.remove(e,!0)}(t,u,e),!0):void 0},ah=function(t,e,n,r,o){var i=t.formatter.get(e),a=i[0],u=!0,s=t.dom,c=t.selection,l=function(r){var u=function(t,e,n,r,o){var i;return V(dl(t.dom,e.parentNode).reverse(),(function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var a=Nm(t,e,n,r,o);a&&!1!==a.split&&(i=e)}})),i}(t,r,e,n,o);return function(t,e,n,r,o,i,a,u){var s,c,l,f=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){s=f.clone(m,!1);for(var h=0;h<e.length;h++)if(ih(t,e[h],u,s,s)){s=0;break}s&&(c&&s.appendChild(c),l||(l=s),c=s)}!i||a.mixed&&f.isBlock(n)||(r=f.split(n,r)),c&&(o.parentNode.insertBefore(c,o),l.appendChild(o))}return r}(t,i,u,r,r,!0,a,n)},f=function(e){var r,o;an(e)&&s.getContentEditable(e)&&(r=u,u="true"===s.getContentEditable(e),o=!0);var c=tt(e.childNodes);if(u&&!o)for(var l=0;l<i.length&&!ih(t,i[l],n,e,e);l++);if(a.deep&&c.length){for(l=0;l<c.length;l++)f(c[l]);o&&(u=r)}},d=function(t){var e=s.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return function(t){return Jc(t)&&an(t)&&("_start"===t.id||"_end"===t.id)}(n)&&(n=n[t?"firstChild":"lastChild"]),hn(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),s.remove(e,!0),n},m=function(e){var n,r,o=Tl(t,e,i,!0);if(a.split){if(o=km(o),(n=th(t,o,!0))!==(r=th(t,o))){if(n=eh(n,!0),r=eh(r,!1),Zm(s,n,r)){var u=C.from(n.firstChild).getOr(n);return l(rh(s,u,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void d(!0)}if(Zm(s,r,n)){u=C.from(r.lastChild).getOr(r);return l(rh(s,u,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void d(!1)}n=nh(s,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=nh(s,r,"span",{id:"_end","data-mce-type":"bookmark"});var c=s.createRng();c.setStartAfter(n),c.setEndBefore(r),Ol(s,c,(function(t){V(t,(function(t){Jc(t)||Jc(t.parentNode)||l(t)}))})),l(n),l(r),n=d(!0),r=d()}else n=r=l(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=s.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=s.nodeIndex(r)+1}Ol(s,o,(function(e){V(e,(function(e){f(e);V(["underline","line-through","overline"],(function(n){an(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&fl(s,e.parentNode)===n&&ih(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))}))}))};if(r)if(el(r)){var h=s.createRng();h.setStartBefore(r),h.setEndAfter(r),m(h)}else m(r);else if("false"!==s.getContentEditable(c.getNode()))c.isCollapsed()&&a.inline&&!Rl(t).length?zm(t,e,n,o):(Hl(c,!0,(function(){Fl(t,m)})),a.inline&&Am(t,e,n,c.getStart())&&nl(s,c,c.getRng()),t.nodeChanged());else{r=c.getNode();for(var p=0;p<i.length&&(!i[p].ceFalseOverride||!ih(t,i[p],n,r,r));p++);}},uh=ue.each,sh=function(t){return an(t)&&!Jc(t)&&!jc(t)&&!ln(t)},ch=function(t,e){var n;for(n=t;n;n=n[e]){if(hn(n)&&0!==n.nodeValue.length)return t;if(an(n)&&!Jc(n))return n}return t},lh=function(t,e,n){var r,o,i=new pf(t);if(e&&n&&(e=ch(e,"previousSibling"),n=ch(n,"nextSibling"),i.compare(e,n))){for(r=e.nextSibling;r&&r!==n;)o=r,r=r.nextSibling,e.appendChild(o);return t.remove(n),ue.each(ue.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},fh=function(t,e,n){uh(t.childNodes,(function(t){sh(t)&&(e(t)&&n(t),t.hasChildNodes()&&fh(t,e,n))}))},dh=function(t,e){return function(n){return!(!n||!ll(t,n,e))}},mh=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),hh(t,r)}},hh=function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)},ph=function(t,e,n,r){uh(e,(function(e){uh(t.dom.select(e.inline,r),(function(r){sh(r)&&ih(t,e,n,r,e.exact?r:null)})),function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";uh(t.select(r,n),(function(n){sh(n)&&uh(e.styles,(function(e,r){t.setStyle(n,r,"")}))}))}}(t.dom,e,r)}))},gh=ue.each,vh=function(t,e,n,r){var o,i=t.formatter.get(e),a=i[0],u=!r&&t.selection.isCollapsed(),s=t.dom,c=t.selection,l=function(t,e){if(e=e||a,t){if(e.onformat&&e.onformat(t,e,n,r),gh(e.styles,(function(e,r){s.setStyle(t,r,ul(e,n))})),e.styles){var o=s.getAttrib(t,"style");o&&s.setAttrib(t,"data-mce-style",o)}gh(e.attributes,(function(e,r){s.setAttrib(t,r,ul(e,n))})),gh(e.classes,(function(e){e=ul(e,n),s.hasClass(t,e)||s.addClass(t,e)}))}},f=function(t,e){var n=!1;return!!a.selector&&(gh(t,(function(t){if(!("collapsed"in t)||t.collapsed===u)return s.is(e,t.selector)&&!jc(e)?(l(e,t),n=!0,!1):void 0})),n)},d=function(r,o,u,s){var c=[],d=!0,m=a.inline||a.block,h=r.create(m);l(h),Ol(r,o,(function(o){var u,p=function(o){var g=!1,v=d,b=o.nodeName.toLowerCase(),y=o.parentNode.nodeName.toLowerCase();if(an(o)&&r.getContentEditable(o)&&(v=d,d="true"===r.getContentEditable(o),g=!0),sl(b,"br"))return u=0,void(a.block&&r.remove(o));if(a.wrapper&&Nm(t,o,e,n))u=0;else{if(d&&!g&&a.block&&!a.wrapper&&ol(t,b)&&il(t,y,m))return o=r.rename(o,m),l(o),c.push(o),void(u=0);if(a.selector){var x=f(i,o);if(!a.inline||x)return void(u=0)}!d||g||!il(t,m,b)||!il(t,y,m)||!s&&3===o.nodeType&&1===o.nodeValue.length&&65279===o.nodeValue.charCodeAt(0)||jc(o)||a.inline&&r.isBlock(o)?(u=0,gh(ue.grep(o.childNodes),p),g&&(d=v),u=0):(u||(u=r.clone(h,!1),o.parentNode.insertBefore(u,o),c.push(u)),u.appendChild(o))}};gh(o,p)})),!0===a.links&&gh(c,(function(t){var e=function(t){"A"===t.nodeName&&l(t,a),gh(ue.grep(t.childNodes),e)};e(t)})),gh(c,(function(o){var u=function(t){var e=!1;return gh(t.childNodes,(function(t){if(function(t){return t&&1===t.nodeType&&!Jc(t)&&!jc(t)&&!ln(t)}(t))return e=t,!1})),e},s=function(t){var e=0;return gh(t.childNodes,(function(t){(function(t){return t&&hn(t)&&0===t.length})(t)||Jc(t)||e++})),e}(o);!(c.length>1)&&r.isBlock(o)||0!==s?(a.inline||a.wrapper)&&(a.exact||1!==s||(o=function(t){var e,n=u(t);return n&&!Jc(n)&&Om(r,n,a)&&(e=r.clone(n,!1),l(e),r.replace(e,t,!0),r.remove(n,!0)),e||t}(o)),ph(t,i,n,o),function(t,e,n,r,o){Nm(t,o.parentNode,n,r)&&ih(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(Nm(t,i,n,r))return ih(t,e,r,o),!0}))}(t,a,e,n,o),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&fh(r,dh(t,"fontSize"),mh(t,"backgroundColor",ul(e.styles.backgroundColor,n)))}(r,a,n,o),function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=fl(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(ue.walk(r,o,"childNodes"),o(r))}(r,a,0,o),function(t,e,n,r){"sub"!==e.inline&&"sup"!==e.inline||(fh(r,dh(t,"fontSize"),mh(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(r,a,0,o),function(t,e,n,r){r&&!1!==e.merge_siblings&&(r=lh(t,rl(r),r),r=lh(t,r,rl(r,!0)))}(r,a,0,o)):r.remove(o,!0)}))};if("false"!==s.getContentEditable(c.getNode())){if(a){if(r)el(r)?f(i,r)||((o=s.createRng()).setStartBefore(r),o.setEndAfter(r),d(s,Tl(t,o,i),0,!0)):d(s,r,0,!0);else if(u&&a.inline&&!Rl(t).length)!function(t,e,n){var r,o,i=t.selection,a=i.getRng(),u=a.startOffset,s=a.startContainer.nodeValue;(r=Vc(t.getBody(),i.getStart()))&&(o=Mm(r));var c,l,f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(s&&u>0&&u<s.length&&f.test(s.charAt(u))&&f.test(s.charAt(u-1))){var d=i.getBookmark();a.collapse(!0);var m=Tl(t,a,t.formatter.get(e));m=km(m),t.formatter.apply(e,n,m),i.moveToBookmark(d)}else r&&"\ufeff"===o.nodeValue||(c=t.getDoc(),l=Lm(!0).dom(),o=(r=c.importNode(l,!0)).firstChild,a.insertNode(r),u=1),t.formatter.apply(e,n,r),i.setCursorLocation(o,u)}(t,e,n);else{var m=c.getNode();t.settings.forced_root_block||!i[0].defaultBlock||s.getParent(m,s.isBlock)||vh(t,i[0].defaultBlock),c.setRng(Od(c.getRng())),Hl(c,!0,(function(e){Fl(t,(function(e,n){var r=n?e:Tl(t,e,i);d(s,r)}))})),nl(s,c,c.getRng()),t.nodeChanged()}!function(t,e){Ym(qm[t],(function(t){t(e)}))}(e,t)}}else{r=c.getNode();for(var h=0,p=i.length;h<p;h++)if(i[h].ceFalseOverride&&s.is(r,i[h].selector))return void l(r,i[h])}},bh=function(t,e){return j(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},yh=function(t,e){var r=(e||n.document).createDocumentFragment();return V(t,(function(t){r.appendChild(t.dom())})),ce.fromDom(r)},xh=function(t,e,n){return{element:d(t),width:d(e),rows:d(n)}},wh=function(t,e){return{element:d(t),cells:d(e)}},Ch=function(t,e){return{x:d(t),y:d(e)}},_h=function(t,e){var n=parseInt(Sn(t,e),10);return isNaN(n)?1:n},kh=function(t,e,n){var r=t.rows();return!!(r[n]?r[n].cells():[])[e]},Sh=function(t){return q(t,(function(t,e){return e.cells().length>t?e.cells().length:t}),0)},Th=function(t,e){for(var n=t.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(xe(o[i],e))return C.some(Ch(i,r));return C.none()},Dh=function(t,e,n,r,o){for(var i=[],a=t.rows(),u=n;u<=o;u++){var s=a[u].cells(),c=e<r?s.slice(e,r+1):s.slice(r,e+1);i.push(wh(a[u].element(),c))}return i},Oh=function(t){var e=xh(Aa(t),0,[]);return V(ma(t,"tr"),(function(t,n){V(ma(t,"td,th"),(function(r,o){!function(t,e,n,r,o){for(var i=_h(o,"rowspan"),a=_h(o,"colspan"),u=t.rows(),s=n;s<n+i;s++){u[s]||(u[s]=wh(Ra(r),[]));for(var c=e;c<e+a;c++){u[s].cells()[c]=s===n&&c===e?o:Aa(o)}}}(e,function(t,e,n){for(;kh(t,e,n);)e++;return e}(e,o,n),n,t,r)}))})),xh(e.element(),Sh(e.rows()),e.rows())},Eh=function(t){return function(t,e){var n=Aa(t.element()),r=ce.fromTag("tbody");return Ue(r,e),ze(n,r),n}(t,function(t){return j(t.rows(),(function(t){var e=j(t.cells(),(function(t){var e=Ra(t);return Tn(e,"colspan"),Tn(e,"rowspan"),e})),n=Aa(t.element());return Ue(n,e),n}))}(t))},Nh=function(t,e,n){return Th(t,e).bind((function(e){return Th(t,n).map((function(n){return function(t,e,n){var r=e.x(),o=e.y(),i=n.x(),a=n.y(),u=o<a?Dh(t,r,o,i,a):Dh(t,r,a,i,o);return xh(t.element(),Sh(u),u)}(t,e,n)}))}))},Ah=function(t,e){return $(t,(function(t){return"li"===le(t)&&Il(t,e)})).fold(d([]),(function(e){return function(t){return $(t,(function(t){return"ul"===le(t)||"ol"===le(t)}))}(t).map((function(t){return[ce.fromTag("li"),ce.fromTag(le(t))]})).getOr([])}))},Rh=function(t,e){var n=ce.fromDom(e.commonAncestorContainer),r=jf(n,t),o=U(r,(function(t){return Ln(t)||In(t)})),i=Ah(r,e),a=o.concat(i.length?i:function(t){return Vn(t)?Te(t).filter(jn).fold(d([]),(function(e){return[t,e]})):jn(t)?[t]:[]}(n));return j(a,Aa)},Bh=function(){return yh([])},Ph=function(t,e){return n=ce.fromDom(e.cloneContents()),r=Rh(t,e),o=q(r,(function(t,e){return ze(e,t),e}),n),r.length>0?yh([o]):o;var n,r,o},Ih=function(t,e){return(n=t,r=e[0],va(r,"table",h(xe,n))).bind((function(t){var n=e[0],r=e[e.length-1],o=Oh(t);return Nh(o,n,r).map((function(t){return yh([Eh(t)])}))})).getOrThunk(Bh);var n,r},Mh=function(t,e){var n=Al(e,t);return n.length>0?Ih(t,n):function(t,e){return e.length>0&&e[0].collapsed?Bh():Ph(t,e[0])}(t,e)},Lh=function(t,e){return e>=0&&e<t.length&&Zc(t.charAt(e))},Fh=function(t){var e=Ma(t.innerText);return ne.browser.isIE()?function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")}(e):e},Hh=function(t,e,n){if(void 0===n&&(n={}),n.get=!0,n.format=e,n.selection=!0,(n=t.fire("BeforeGetContent",n)).isDefaultPrevented())return t.fire("GetContent",n),n.content;if("text"===n.format)return function(t){return C.from(t.selection.getRng()).map((function(e){var n=t.dom.add(t.getBody(),"div",{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),r=Fh(n),o=Ma(n.textContent);if(t.dom.remove(n),Lh(o,0)||Lh(o,o.length-1)){var i=t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock),a=Fh(i),u=a.indexOf(r);return-1!==u?(Lh(a,u-1)?" ":"")+r+(Lh(a,u+r.length)?" ":""):r}return r})).getOr("")}(t);n.getInner=!0;var r=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=bh(t,El(o)),a=e.contextual?Mh(ce.fromDom(t.getBody()),i).dom():n.cloneContents();return a&&r.appendChild(a),t.selection.serializer.serialize(r,e)}(t,n);return"tree"===n.format?r:(n.content=t.selection.isCollapsed()?"":r,t.fire("GetContent",n),n.content)},jh=function(t){return an(t)?t.outerHTML:hn(t)?ur.encodeRaw(t.data,!1):pn(t)?"\x3c!--"+t.data+"--\x3e":""},Vh=function(t,e,r){var o=function(t){var e,r=n.document.createElement("div"),o=n.document.createDocumentFragment();for(t&&(r.innerHTML=t);e=r.firstChild;)o.appendChild(e);return o}(e);if(t.hasChildNodes()&&r<t.childNodes.length){var i=t.childNodes[r];i.parentNode.insertBefore(o,i)}else t.appendChild(o)},zh=function(t,e){var n,r,o,i,a,u,s,c,l,f=j(tt(e.childNodes),jh);return function(t,e){var n=0;V(t,(function(t){0===t[0]?n++:1===t[0]?(Vh(e,t[1],n),n++):2===t[0]&&function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}}(e,n)}))}((r=t,o=(n=f).length+r.length+2,i=new Array(o),a=new Array(o),u=function(t,e,o,i,a){var s=c(t,e,o,i);if(null===s||s.start===e&&s.diag===e-i||s.end===t&&s.diag===t-o)for(var l=t,f=o;l<e||f<i;)l<e&&f<i&&n[l]===r[f]?(a.push([0,n[l]]),++l,++f):e-t>i-o?(a.push([2,n[l]]),++l):(a.push([1,r[f]]),++f);else{u(t,s.start,o,s.start-s.diag,a);for(var d=s.start;d<s.end;++d)a.push([0,n[d]]);u(s.end,e,s.end-s.diag,i,a)}},s=function(t,e,o,i){for(var a=t;a-e<i&&a<o&&n[a]===r[a-e];)++a;return function(t,e,n){return{start:t,end:e,diag:n}}(t,a,e)},c=function(t,e,o,u){var c=e-t,l=u-o;if(0===c||0===l)return null;var f,d,m,h,p,g=c-l,v=l+c,b=(v%2==0?v:v+1)/2;for(i[1+b]=t,a[1+b]=e+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){for(m=d+b,d===-f||d!==f&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,p=(h=i[m])-t+o-d;h<e&&p<u&&n[h]===r[p];)i[m]=++h,++p;if(g%2!=0&&g-f<=d&&d<=g+f&&a[m-g]<=i[m])return s(a[m-g],d+t-o,e,u)}for(d=g-f;d<=g+f;d+=2){for(m=d+b-g,d===g-f||d!==g+f&&a[m+1]<=a[m-1]?a[m]=a[m+1]-1:a[m]=a[m-1],p=(h=a[m]-1)-t+o-d;h>=t&&p>=o&&n[h]===r[p];)a[m]=h--,p--;if(g%2==0&&-f<=d&&d<=f&&a[m]<=i[m+g])return s(a[m],d+t-o,e,u)}}},l=[],u(0,n.length,0,r.length,l),l),e),e},Uh=Xi(C.none()),Wh=function(t){var e,n=(e=t.getBody(),U(j(tt(e.childNodes),jh),(function(t){return t.length>0}))),r=G(n,(function(e){var n=ff(t.serializer,e);return n.length>0?[n]:[]})),o=r.join("");return-1!==o.indexOf("</iframe>")?function(t){return{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}}(r):function(t){return{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}}(o)},qh=function(t,e,n){"fragmented"===e.type?zh(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(n?e.beforeBookmark:e.bookmark)},$h=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},Yh=function(t){var e=ce.fromTag("body",Uh.get().getOrThunk((function(){var t=n.document.implementation.createHTMLDocument("undo");return Uh.set(C.some(t)),t})));return Ea(e,$h(t)),V(ma(e,"*[data-mce-bogus]"),$e),e.dom().innerHTML},Gh=function(t,e){return!(!t||!e)&&(!!function(t,e){return $h(t)===$h(e)}(t,e)||function(t,e){return Yh(t)===Yh(e)}(t,e))},Kh=function(t){return 0===t.get()},Xh=function(t,e,n){Kh(n)&&(t.typing=e)},Jh=function(t,e){t.typing&&(Xh(t,!1,e),t.add())},Qh=function(t){return t instanceof Ql},Zh=function(t,e){ym(t.serializer.getNodeFilters(),t.serializer.getAttributeFilters(),e)},tp=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){Kh(e)&&n.set(C.some(as(t.selection)))}(t,e,n)},addUndoLevel:function(e,n,r,o,i,a){return function(t,e,n,r,o,i,a){var u=Wh(t);if(i=i||{},i=ue.extend(i,u),!1===Kh(r)||t.removed)return null;var s=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:s,originalEvent:a}).isDefaultPrevented())return null;if(s&&Gh(s,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var c=function(t){return t.getParam("custom_undo_redo_levels",0,"number")}(t);if(c&&e.data.length>c){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=as(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:s,originalEvent:a};return t.fire("AddUndo",f),n.get()>0&&(t.setDirty(!0),t.fire("change",f)),i}(t,e,n,r,o,i,a)},undo:function(e,n,r){return function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,Xh(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],qh(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o}(t,e,n,r)},redo:function(e,n){return function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],qh(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r}(t,e,n)},clear:function(e,n){return function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")}(t,e,n)},reset:function(t){return function(t){t.clear(),t.add()}(t)},hasUndo:function(e,n){return function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!Gh(Wh(t),e.data[0])}(t,e,n)},hasRedo:function(t,e){return function(t,e){return e.get()<t.data.length-1&&!t.typing}(t,e)},transact:function(t,e,n){return function(t,e,n){return Jh(t,e),t.beforeChange(),t.ignore(n),t.add()}(t,e,n)},ignore:function(t,e){return function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}}(t,e)},extra:function(e,n,r,o){return function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,a=e.data[n.get()-1];qh(t,a,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}}(t,e,n,r,o)}},formatter:{apply:function(e,n,r){return vh(t,e,n,r)},remove:function(e,n,r,o){return ah(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!Am(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?vh(t,e,n,r):ah(t,e,n,r)}(t,e,n,r)}},editor:{getContent:function(e,n){return function(t,e,n){return C.from(t.getBody()).fold(d("tree"===e.format?new Ql("body",11):""),(function(r){return mf(t,e,n,r)}))}(t,e,n)},setContent:function(e,n){return Cm(t,e,n)},insertContent:function(e,n){return Fd(t,e,n)}},selection:{getContent:function(e,n){return Hh(t,e,n)}},raw:{getModel:function(){return C.none()}}}},ep=function(t){return dt(t.plugins,"rtc")},np=function(t){var e=t;return ft(t.plugins,"rtc").fold((function(){return e.rtcInstance=tp(t),C.none()}),(function(n){return C.some(n.setup().then((function(n){return e.rtcInstance=function(t,e){var n=function(t){return D(t)?t:{}},r=g("Unimplemented feature for rtc");return{undoManager:{beforeChange:l,addUndoLevel:r,undo:function(){return e.undo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},redo:function(){return e.redo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},clear:r,reset:r,hasUndo:function(){return e.hasUndo()},hasRedo:function(){return e.hasRedo()},transact:function(t,n,r){return e.transact(r),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},ignore:r,extra:r},formatter:{apply:function(t,r,o){return e.applyFormat(t,n(r))},remove:function(t,r,o,i){return e.removeFormat(t,n(r))},toggle:function(t,r,o){return e.toggleFormat(t,n(r))}},editor:{getContent:function(n,r){if("html"===r||"tree"===r){var o=e.getContent(),i=ef({inner:!0});return Zh(t,o),"tree"===r?o:i.serialize(o)}return tp(t).editor.getContent(n,r)},setContent:function(n,r){var o=Qh(n)?n:t.parser.parse(n,{isRootContent:!0,insert:!0});return e.setContent(o),n},insertContent:function(n,r){var o=Qh(n)?n:t.parser.parse(n,{insert:!0});e.insertContent(o)}},selection:{getContent:function(n,r){if("html"===n||"tree"===n){var o=e.getSelectedContent(),i=ef({});return Zh(t,o),"tree"===n?o:i.serialize(o)}return tp(t).selection.getContent(n,r)}},raw:{getModel:function(){return C.some(e.getRawModel())}}}}(t,n),n.isRemote})))}))},rp=function(t){return t.rtcInstance?t.rtcInstance:tp(t)},op=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},ip=function(t,e){return void 0===e&&(e={}),function(t,e,n){return rp(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")},ap=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return rp(t).editor.setContent(e,n)}(t,e,n)},up=qi.DOM,sp=function(t){return C.from(t).each((function(t){return t.destroy()}))},cp=function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&up.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){up.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),up.remove(t.getContainer()),sp(e),sp(n),t.destroy()}},lp=function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),sp(n),sp(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),up.unbind(e,"submit reset",t.formEventDelegate))}(t),function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)}(t),t.destroyed=!0):t.remove())},fp=Object.prototype.hasOwnProperty,dp=(Gm=function(t,e){return D(t)&&D(e)?dp(t,e):e},function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)fp.call(o,i)&&(n[i]=Gm(n[i],o[i]))}return n}),mp=Yt().deviceType,hp=mp.isTouch(),pp=mp.isPhone(),gp=mp.isTablet(),vp=["lists","autolink","autosave"],bp={table_grid:!1,object_resizing:!1,resize:!1},yp=function(t){var e=O(t)?t.join(" "):t,n=j(T(e)?e.split(" "):[],Mt);return U(n,(function(t){return t.length>0}))},xp=function(t,e){var n=st(e,(function(e,n){return F(t,n)}));return function(t,e){return{sections:d(t),settings:d(e)}}(n.t,n.f)},wp=function(t,e){return t.sections().hasOwnProperty(e)},Cp=function(t,e){return ft(t,"toolbar_mode").orThunk((function(){return ft(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},_p=function(t,e){var n={resize:!1,toolbar_mode:Cp(t,"scrolling"),toolbar_sticky:!1};return wt(wt(wt({},bp),n),e?{menubar:!1}:{})},kp=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?ue.extend({},t.external_plugins,n):n},Sp=function(t,e,n,r){var o=yp(n.forced_plugins),i=yp(r.plugins),a=function(t,e){return wp(t,e)?t.sections()[e]:{}}(e,"mobile"),u=a.plugins?yp(a.plugins):i,s=function(t,e){return[].concat(yp(t)).concat(yp(e))}(o,t&&function(t,e,n){var r=t.sections();return wp(t,e)&&r[e].theme===n}(e,"mobile","mobile")?U(u,h(F,vp)):t&&wp(e,"mobile")?u:i);return ue.extend(r,{plugins:s.join(" ")})},Tp=function(t,e,n,r,o){var i=t?{mobile:_p(o.mobile||{},e)}:{},a=xp(["mobile"],dp(i,o)),u=ue.extend(n,r,a.settings(),function(t,e){return t&&wp(e,"mobile")}(t,a)?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=r.hasOwnProperty(e)?r[e]:{};return ue.extend({},n,o)}(a,"mobile"):{},{validate:!0,external_plugins:kp(r,a.settings())});return Sp(t,a,r,u)},Dp=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:Cp(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return wt(wt({},i),r?bp:{})}(o,e,n,hp,t);return Tp(pp||gp,pp,i,r,o)},Op=function(t,e,n){return C.from(e.settings[n]).filter(t)},Ep=function(t,e,n,r){var o,i=e in t.settings?t.settings[e]:n;return"hash"===r?function(t){var e={};return"string"==typeof t?V(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),(function(t){var n=t.split("=");n.length>1?e[ue.trim(n[0])]=ue.trim(n[1]):e[ue.trim(n[0])]=ue.trim(n[0])})):e=t,e}(i):"string"===r?Op(T,t,e).getOr(n):"number"===r?Op(B,t,e).getOr(n):"boolean"===r?Op(N,t,e).getOr(n):"object"===r?Op(D,t,e).getOr(n):"array"===r?Op(O,t,e).getOr(n):"string[]"===r?Op((o=T,function(t){return O(t)&&K(t,o)}),t,e).getOr(n):"function"===r?Op(R,t,e).getOr(n):i},Np=(Km={},{add:function(t,e){Km[t]=e},get:function(t){return Km[t]?Km[t]:{icons:{}}},has:function(t){return dt(Km,t)}}),Ap=function(t,e){return e.dom()[t]},Rp=function(t,e){return parseInt(Dn(e,t),10)},Bp=h(Ap,"clientWidth"),Pp=h(Ap,"clientHeight"),Ip=h(Rp,"margin-top"),Mp=h(Rp,"margin-left"),Lp=function(t,e,n){var r,o=ce.fromDom(t.getBody()),i=t.inline?o:(r=o,ce.fromDom(r.dom().ownerDocument.documentElement)),a=function(t,e,n,r){var o=function(t){return t.dom().getBoundingClientRect()}(e);return{x:n-(t?o.left+e.dom().clientLeft+Mp(e):0),y:r-(t?o.top+e.dom().clientTop+Ip(e):0)}}(t.inline,i,e,n);return function(t,e,n){var r=Bp(t),o=Pp(t);return e>=0&&n>=0&&e<=r&&n<=o}(i,a.x,a.y)},Fp=function(t){var e,n=t.inline?t.getBody():t.getContentAreaContainer();return(e=n,C.from(e).map(ce.fromDom)).map((function(t){return Ce(_e(t),t)})).getOr(!1)};function Hp(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},r=function(){e.length>0&&n().reposition(e)},o=function(t){Y(e,(function(e){return e===t})).each((function(t){e.splice(t,1)}))},i=function(i){if(!t.removed&&Fp(t))return $(e,(function(t){return e=n().getArgs(t),r=i,!(e.type!==r.type||e.text!==r.text||e.progressBar||e.timeout||r.progressBar||r.timeout);var e,r})).getOrThunk((function(){t.editorManager.setActive(t);var a=n().open(i,(function(){o(a),r()}));return function(t){e.push(t)}(a),r(),a}))};return function(t){t.on("SkinLoaded",(function(){var e=function(t){return t.getParam("service_message")}(t);e&&i({text:e,type:"warning",timeout:0})})),t.on("ResizeEditor ResizeWindow NodeChange",(function(){Pi.requestAnimationFrame(r)})),t.on("remove",(function(){V(e.slice(),(function(t){n().close(t)}))}))}(t),{open:i,close:function(){C.from(e[0]).each((function(t){n().close(t),o(t),r()}))},getNotifications:function(){return e}}}var jp=na.PluginManager,Vp=na.ThemeManager;var zp=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){return e?e.apply(t,arguments):void 0}},o=function(n){e.push(n),function(e){t.fire("OpenWindow",{dialog:e})}(n)},i=function(n){!function(e){t.fire("CloseWindow",{dialog:e})}(n),0===(e=U(e,(function(t){return t!==n}))).length&&t.focus()},a=function(e){t.editorManager.setActive(t),em(t);var n=e();return o(n),n};return t.on("remove",(function(){V(e,(function(t){n().close(t)}))})),{open:function(t,e){return a((function(){return n().open(t,e,i)}))},openUrl:function(t){return a((function(){return n().openUrl(t,i)}))},alert:function(t,e,o){n().alert(t,r(o||this,e))},confirm:function(t,e,o){n().confirm(t,r(o||this,e))},close:function(){C.from(e[e.length-1]).each((function(t){n().close(t),i(t)}))}}},Up=function(t,e){t.notificationManager.open({type:"error",text:e})},Wp=function(t,e){t._skinLoaded?Up(t,e):t.on("SkinLoaded",(function(){Up(t,e)}))},qp=function(t,e,r){!function(t,e,n){t.fire(e,n)}(t,e,{message:r}),n.console.error(r)},$p=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},Yp=function(t,e,n){qp(t,"PluginLoadError",$p("plugin",e,n))},Gp=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var o=n.window.console;o&&(o.error?o.error.apply(o,Ct([t],e)):o.log.apply(o,Ct([t],e)))},Kp=function(t){var e=function(t){var e=t.getParam("content_css");return T(e)?j(e.split(","),Mt):O(e)?e:!1===e||t.inline?[]:["default"]}(t),n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return j(e,(function(e){return function(t){return/^[a-z0-9\-]+$/i.test(t)}(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)}))};var Xp=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Dn(n,t);return parseFloat(o)||0}return r},r=function(t,e){return q(e,(function(e,n){var r=Dn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!B(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom();wn(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}("height",(function(t){var e=t.dom();return Ye(t)?e.getBoundingClientRect().height:e.offsetHeight})),Jp=function(t,e){return t.view(e).fold(d([]),(function(e){var n=t.owner(e),r=Jp(t,n);return[e].concat(r)}))},Qp=Object.freeze({__proto__:null,view:function(t){return(t.dom()===n.document?C.none():C.from(t.dom().defaultView.frameElement)).map(ce.fromDom)},owner:function(t){return _e(t)}}),Zp=function(t){var e=ce.fromDom(n.document),r=Qe(e),o=function(t,e){var n=e.owner(t);return Jp(e,n)}(t,Qp),i=Je(t),a=W(o,(function(t,e){var n=Je(e);return{left:t.left+n.left(),top:t.top+n.top()}}),{left:0,top:0});return Ke(a.left+i.left()+r.left(),a.top+i.top()+r.top())},tg=function(t){return"textarea"===le(t)},eg=function(t,e){var n=function(t){var e=t.dom().ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom())return Ke(n.offsetLeft,n.offsetTop);var i=Xe(r.pageYOffset,o.scrollTop),a=Xe(r.pageXOffset,o.scrollLeft),u=Xe(o.clientTop,n.clientTop),s=Xe(o.clientLeft,n.clientLeft);return Je(t).translate(a-s,i-u)}(t),r=function(t){return Xp.get(t)}(t);return{element:t,bottom:n.top()+r,height:r,pos:n,cleanup:e}},ng=function(t,e){var n=function(t,e){var n=Ae(t);if(0===n.length||tg(t))return{element:t,offset:e};if(e<n.length&&!tg(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return tg(r)?{element:t,offset:e}:"img"===le(r)?{element:r,offset:1}:he(r)?{element:r,offset:Vl(r).length}:{element:r,offset:Ae(r).length}}(t,e),r=ce.fromHtml('<span data-mce-bogus="all">\ufeff</span>');return He(n.element,r),eg(r,(function(){return qe(r)}))},rg=function(t,e,n,r){ug(t,(function(o,i){return ig(t,e,n,r)}),n)},og=function(t,e,n,r,o){var i={elm:r.element.dom(),alignToTop:o};(function(t,e){return t.fire("ScrollIntoView",e).isDefaultPrevented()})(t,i)||(n(e,Qe(e).top(),r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},ig=function(t,e,n,r){var o=ce.fromDom(t.getBody()),i=ce.fromDom(t.getDoc());o.dom().offsetWidth;var a=ng(ce.fromDom(n.startContainer),n.startOffset);og(t,i,e,a,r),a.cleanup()},ag=function(t,e,n,r){var o=ce.fromDom(t.getDoc());og(t,o,n,function(t){return eg(ce.fromDom(t),l)}(e),r)},ug=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;e(ce.fromDom(r),ce.fromDom(i));var u=t.dom.createRng();u.setStart(r,o),u.setEnd(i,a),t.selection.setRng(n)},sg=function(t,e,n,r){var o=t.pos;if(n)Ze(o.left(),o.top(),r);else{var i=o.top()-e+t.height;Ze(o.left(),i,r)}},cg=function(t,e,n,r,o){var i=n+e,a=r.pos.top(),u=r.bottom,s=u-a>=n;if(a<e)sg(r,n,!1!==o,t);else if(a>i){sg(r,n,s?!1!==o:!0===o,t)}else u>i&&!s&&sg(r,n,!0===o,t)},lg=function(t,e,n,r){var o=t.dom().defaultView.innerHeight;cg(t,e,o,n,r)},fg=function(t,e,r,o){var i=t.dom().defaultView.innerHeight;cg(t,e,i,r,o);var a=Zp(r.element),u=nn(n.window);a.top()<u.y?tn(r.element,!1!==o):a.top()>u.bottom&&tn(r.element,!0===o)},dg=function(t,e,n){return rg(t,lg,e,n)},mg=function(t,e,n){return ag(t,e,lg,n)},hg=function(t,e,n){return rg(t,fg,e,n)},pg=function(t,e,n){return ag(t,e,fg,n)},gg=function(t,e,n){(t.inline?dg:hg)(t,e,n)},vg=function(t){return yn(t)||xn(t)},bg=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=ue.toArray(i.getClientRects())).sort((function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-(n=Math.abs(Math.max(n.top-e,n.bottom-e)))}))).length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return function(t,e){var n=t&&t.parentElement?t.parentElement():null;return xn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,vg))?null:t}(r,n.body)}return r},yg=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,a=n?e.startOffset:e.endOffset;return C.from(i).map(ce.fromDom).map((function(t){return r&&e.collapsed?t:Re(t,o(t,a)).getOr(t)})).bind((function(t){return me(t)?C.some(t):Te(t).filter(me)})).map((function(t){return t.dom()})).getOr(t)},xg=function(t,e,n){return yg(t,e,!0,n,(function(t,e){return Math.min(t.dom().childNodes.length,e)}))},wg=function(t,e,n){return yg(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},Cg=function(t,e){for(var n=t;t&&hn(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},_g=function(t,e){return void 0===e&&(e={}),function(t,e,n){return op(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)},kg=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},Sg=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},Tg=function(t,e,n){return Sg(t,e,(function(t){return t.nodeName===n}))},Dg=function(t){return t&&"TABLE"===t.nodeName},Og=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},Eg=function(t,e){return Va(t)&&!1===Sg(t,e,jc)},Ng=function(t,e,n){for(var r=new hi(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(bn(e))return!0},Ag=function(t,e,n,r,o){var i,a,u=t.getRoot(),s=t.schema.getNonEmptyElements(),c=t.getParent(o.parentNode,t.isBlock)||u;if(r&&bn(o)&&e&&t.isEmpty(c))return C.some(Mu(o.parentNode,t.nodeIndex(o)));for(var l=new hi(o,c);a=l[r?"prev":"next"]();){if("false"===t.getContentEditableParent(a)||Eg(a,u))return C.none();if(hn(a)&&a.nodeValue.length>0)return!1===Tg(a,u,"A")?C.some(Mu(a,r?a.nodeValue.length:0)):C.none();if(t.isBlock(a)||s[a.nodeName.toLowerCase()])return C.none();i=a}return n&&i?C.some(Mu(i,0)):C.none()},Rg=function(t,e,n,r){var o,i,a,u,s=t.getRoot(),c=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var l=an(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(u=n,Va(o))return C.none();if(an(o)&&i>o.childNodes.length-1&&(u=!1),gn(o)&&(o=s,i=0),o===s){if(u&&(a=o.childNodes[i>0?i-1:0])){if(Va(a))return C.none();if(f[a.nodeName]||Dg(a))return C.none()}if(o.hasChildNodes()){if(i=Math.min(!u&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=hn(o)&&l?o.data.length:0,!e&&o===s.lastChild&&Dg(o))return C.none();if(function(t,e){for(;e&&e!==t;){if(xn(e))return!0;e=e.parentNode}return!1}(s,o)||Va(o))return C.none();if(o.hasChildNodes()&&!1===Dg(o)){a=o;var d=new hi(o,s);do{if(xn(a)||Va(a)){c=!1;break}if(hn(a)&&a.nodeValue.length>0){i=u?0:a.nodeValue.length,o=a,c=!0;break}if(f[a.nodeName.toLowerCase()]&&!Og(a)){i=t.nodeIndex(a),o=a.parentNode,u||i++,c=!0;break}}while(a=u?d.next():d.prev())}}}return e&&(hn(o)&&0===i&&Ag(t,l,e,!0,o).each((function(t){o=t.container(),i=t.offset(),c=!0})),an(o)&&((a=o.childNodes[i])||(a=o.childNodes[i-1]),!a||!bn(a)||function(t,e){return t.previousSibling&&t.previousSibling.nodeName===e}(a,"A")||Ng(t,a,!1)||Ng(t,a,!0)||Ag(t,l,e,!0,a).each((function(t){o=t.container(),i=t.offset(),c=!0})))),u&&!e&&hn(o)&&i===o.nodeValue.length&&Ag(t,l,e,!1,o).each((function(t){o=t.container(),i=t.offset(),c=!0})),c?C.some(Mu(o,i)):C.none()},Bg=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=Mu.fromRangeStart(e);return Rg(t,n,!0,r).each((function(t){n&&Mu.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||Rg(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),kg(e,r)?C.none():C.some(r)},Pg=function(t){return 0===t.dom().length?(qe(t),C.none()):C.some(t)},Ig=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return wt(wt({format:"html"},t),{set:!0,selection:!0,content:e})}(n,e);if(r.no_events||!(r=t.fire("BeforeSetContent",r)).isDefaultPrevented()){n.content=function(t,e){if("raw"!==e.format){var n=t.parser.parse(e.content,wt({isRootContent:!0,forced_root_block:!1},e));return ef({validate:t.validate},t.schema).serialize(n)}return e.content}(t,r);var o=t.selection.getRng();!function(t,e){var n=C.from(e.firstChild).map(ce.fromDom),r=C.from(e.lastChild).map(ce.fromDom);t.deleteContents(),t.insertNode(e);var o=n.bind(De).filter(he).bind(Pg),i=r.bind(Oe).filter(he).bind(Pg);Ka(o,n.filter(he),(function(t,e){!function(t,e){t.insertData(0,e)}(e.dom(),t.dom().data),qe(t)})),Ka(i,r.filter(he),(function(e,n){var r=n.dom().length;n.dom().appendData(e.dom().data),t.setEnd(n.dom(),r),qe(e)})),t.collapse(!1)}(o,o.createContextualFragment(n.content)),t.selection.setRng(o),gg(t,o),r.no_events||t.fire("SetContent",r)}else t.fire("SetContent",r)};function Mg(t){return{getBookmark:h(Kc,t),moveToBookmark:h(Xc,t)}}!function(t){t.isBookmarkNode=Jc}(Mg||(Mg={}));var Lg=Mg,Fg=function(t,e,n){if(n.collapsed)return!1;if(ne.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(an(r))return H(r.getClientRects(),(function(n){return nu(n,t,e)}))}return H(n.getClientRects(),(function(n){return nu(n,t,e)}))},Hg={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||this.metaKeyPressed(t)},metaKeyPressed:function(t){return ne.mac?t.metaKey:t.ctrlKey&&!t.altKey}},jg=xn,Vg=yn,zg=function(t,e){var r,o,i,a,u,s,c,l,f,d,m,h,p,g,v=e.dom,b=ue.each,y=e.getDoc(),x=n.document,w=Math.abs,C=Math.round,_=e.getBody(),k={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},S=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},T=function(t){var n=t.target;(function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return S(t.target)&&!Fg(n.clientX,n.clientY,e)}return S(t.target)&&!Fg(t.clientX,t.clientY,e)})(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},D=function(t){return e.dom.is(t,"figure.image")?t.querySelector("img"):t},O=function(t){var n=_s(e);return!1!==n&&!ne.iOS&&("string"!=typeof n&&(n="table,img,figure.image,div"),"false"!==t.getAttribute("data-mce-resize")&&(t!==e.getBody()&&be(ce.fromDom(t),n)))},E=function(t,e,n){v.setStyles(D(t),{width:e,height:n})},N=function(t){var n,b,y,x;n=t.screenX-u,b=t.screenY-s,m=n*a[2]+c,h=b*a[3]+l,m=m<5?5:m,h=h<5?5:h,(S(r)&&!1!==function(t){return t.getParam("resize_img_proportional",!0,"boolean")}(e)?!Hg.modifierPressed(t):Hg.modifierPressed(t))&&(w(n)>w(b)?(h=C(m*f),m=C(h/f)):(m=C(h/f),h=C(m*f))),E(o,m,h),y=(y=a.startPos.x+n)>0?y:0,x=(x=a.startPos.y+b)>0?x:0,v.setStyles(i,{left:y,top:x,display:"block"}),i.innerHTML=m+" × "+h,a[2]<0&&o.clientWidth<=m&&v.setStyle(o,"left",void 0+(c-m)),a[3]<0&&o.clientHeight<=h&&v.setStyle(o,"top",void 0+(l-h)),(n=_.scrollWidth-p)+(b=_.scrollHeight-g)!==0&&v.setStyles(i,{left:y-n,top:x-b}),d||(!function(t,e,n,r){t.fire("ObjectResizeStart",{target:e,width:n,height:r})}(e,r,c,l),d=!0)},A=function(){var t=d;d=!1;var n=function(t,n){n&&(r.style[t]||!e.schema.isValid(r.nodeName.toLowerCase(),t)?v.setStyle(D(r),t,n):v.setAttrib(D(r),t,""+n))};t&&(n("width",m),n("height",h)),v.unbind(y,"mousemove",N),v.unbind(y,"mouseup",A),x!==y&&(v.unbind(x,"mousemove",N),v.unbind(x,"mouseup",A)),v.remove(o),v.remove(i),R(r),t&&(!function(t,e,n,r){t.fire("ObjectResized",{target:e,width:n,height:r})}(e,r,m,h),v.setAttrib(r,"style",v.getAttrib(r,"style"))),e.nodeChanged()},R=function(t){B(),M();var n=v.getPos(t,_),d=n.x,w=n.y,C=t.getBoundingClientRect(),S=C.width||C.right-C.left,T=C.height||C.bottom-C.top;r!==t&&(r=t,m=h=0);var R=e.fire("ObjectSelected",{target:t});O(t)&&!R.isDefaultPrevented()?b(k,(function(t,e){var n;(n=v.get("mceResizeHandle"+e))&&v.remove(n),n=v.add(_,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===ne.ie&&(n.contentEditable=!1),v.bind(n,"mousedown",(function(e){e.stopImmediatePropagation(),e.preventDefault(),function(e){u=e.screenX,s=e.screenY,c=D(r).clientWidth,l=D(r).clientHeight,f=l/c,a=t,t.startPos={x:S*t[0]+d,y:T*t[1]+w},p=_.scrollWidth,g=_.scrollHeight,o=r.cloneNode(!0),v.addClass(o,"mce-clonedresizable"),v.setAttrib(o,"data-mce-bogus","all"),o.contentEditable=!1,o.unSelectabe=!0,v.setStyles(o,{left:d,top:w,margin:0}),E(o,S,T),o.removeAttribute("data-mce-selected"),_.appendChild(o),v.bind(y,"mousemove",N),v.bind(y,"mouseup",A),x!==y&&(v.bind(x,"mousemove",N),v.bind(x,"mouseup",A)),i=v.add(_,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},c+" × "+l)}(e)})),t.elm=n,v.setStyles(n,{left:S*t[0]+d-n.offsetWidth/2,top:T*t[1]+w-n.offsetHeight/2})})):B(),r.setAttribute("data-mce-selected","1")},B=function(){M(),r&&r.removeAttribute("data-mce-selected"),rt(k,(function(t,e){var n=v.get("mceResizeHandle"+e);n&&(v.unbind(n),v.remove(n))}))},P=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};d||e.removed||(b(v.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute("data-mce-selected")})),r="mousedown"===n.type?n.target:t.getNode(),o(r=v.$(r).closest("table,img,figure.image,hr")[0],_)&&(L(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?R(r):B())},I=function(t){return jg(function(t,e){for(;e&&e!==t;){if(Vg(e)||jg(e))return e;e=e.parentNode}return null}(e.getBody(),t))},M=function(){rt(k,(function(t){t.elm&&(v.unbind(t.elm),delete t.elm)}))},L=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(t){}};e.on("init",(function(){if(L(),ne.browser.isIE()||ne.browser.isEdge()){e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;d||!/^(TABLE|IMG|HR)$/.test(r)||I(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())}));var t=function(t){var n=function(t){Pi.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(I(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};v.bind(_,"mscontrolselect",t),e.on("remove",(function(){return v.unbind(_,"mscontrolselect",t)}))}var n=Pi.throttle((function(t){e.composing||P(t)}));e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",n),e.on("keyup compositionend",(function(t){r&&"TABLE"===r.nodeName&&n(t)})),e.on("hide blur",B),e.on("contextmenu longpress",T,!0)})),e.on("remove",M);return{isResizable:O,showResizeRect:R,hideResizeRect:B,updateResizeRect:P,destroy:function(){r=o=null}}},Ug=function(t,e,n){if(t&&t.hasOwnProperty(e)){var r=U(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}};var Wg=function(t){return!!t.select},qg=function(t){return!(!t||!t.ownerDocument)&&Ce(ce.fromDom(t.ownerDocument),ce.fromDom(t))},$g=function(t,e,n,r){var o,i,a=function(t,e){var n,r;return{selectorChangedWithUnbind:function(o,i){return n||(n={},r={},e.on("NodeChange",(function(e){var o=e.element,i=t.getParents(o,null,t.getRoot()),a={};ue.each(n,(function(e,n){ue.each(i,(function(o){if(t.is(o,n))return r[n]||(ue.each(e,(function(t){t(!0,{node:o,selector:n,parents:i})})),r[n]=e),a[n]=e,!1}))})),ue.each(r,(function(t,e){a[e]||(delete r[e],ue.each(t,(function(t){t(!1,{node:o,selector:e,parents:i})})))}))}))),n[o]||(n[o]=[]),n[o].push(i),{unbind:function(){Ug(n,o,i),Ug(r,o,i)}}}}}(t,r).selectorChangedWithUnbind,u=function(t,e){return Ig(r,t,e)},s=function(t){var e=l();e.collapse(!!t),f(e)},c=function(){return e.getSelection?e.getSelection():e.document.selection},l=function(){var n,a,u,s=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}};if(!e)return null;var l=e.document;if(null==l)return null;if(void 0!==r.bookmark&&!1===hm(r)){var f=nm(r);if(f.isSome())return f.map((function(t){return bh(r,[t])[0]})).getOr(l.createRange())}try{(n=c())&&!on(n.anchorNode)&&(a=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():l.createRange())}catch(t){}return(a=bh(r,[a])[0])||(a=l.createRange?l.createRange():l.body.createTextRange()),a.setStart&&9===a.startContainer.nodeType&&a.collapsed&&(u=t.getRoot(),a.setStart(u,0),a.setEnd(u,0)),o&&i&&(0===s(a.START_TO_START,a,o)&&0===s(a.END_TO_END,a,o)?a=i:(o=null,i=null)),a},f=function(t,e){var n;if(function(t){return!!t&&(!!Wg(t)||qg(t.startContainer)&&qg(t.endContainer))}(t)){var a=Wg(t)?t:null;if(a){i=null;try{a.select()}catch(t){}}else{var u=c();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,u){i=t;try{u.removeAllRanges(),u.addRange(t)}catch(t){}!1===e&&u.extend&&(u.collapse(t.endContainer,t.endOffset),u.extend(t.startContainer,t.startOffset)),o=u.rangeCount>0?u.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!u.setBaseAndExtent||ne.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(u.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),u.anchorNode===t.startContainer&&u.focusNode===t.endContainer||u.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},d=function(){var e=c();if(!e||!e.anchorNode||!e.focusNode)return!0;var n=t.createRng();n.setStart(e.anchorNode,e.anchorOffset),n.collapse(!0);var r=t.createRng();return r.setStart(e.focusNode,e.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0},m={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:s,setCursorLocation:function(e,n){var o=t.createRng();e?(o.setStart(e,n),o.setEnd(e,n),f(o),s(!1)):(Ml(t,o,r.getBody(),!0),f(o))},getContent:function(t){return _g(r,t)},setContent:u,getBookmark:function(t,e){return h.getBookmark(t,e)},moveToBookmark:function(t){return h.moveToBookmark(t)},select:function(e,n){return function(t,e,n){return C.from(e).map((function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(Ml(t,o,e,!0),Ml(t,o,e,!1)),o}))}(t,e,n).each(f),e},isCollapsed:function(){var t=l(),e=c();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:d,setNode:function(e){return u(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,a=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Cg(r.nextSibling,!0):r.parentNode,o=0===a?Cg(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),l())},getSel:c,setRng:f,getRng:l,getStart:function(t){return xg(r.getBody(),l(),t)},getEnd:function(t){return wg(r.getBody(),l(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],a=t.getRoot();if(n=t.getParent(n||xg(a,e,e.collapsed),t.isBlock),r=t.getParent(r||wg(a,e,e.collapsed),t.isBlock),n&&n!==a&&i.push(n),n&&r&&n!==r){o=n;for(var u=new hi(n,a);(o=u.next())&&o!==r;)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==a&&i.push(r),i}(t,l(),e,n)},normalize:function(){var e=l(),n=c();if(!(El(n).length>1)&&Ll(r)){var o=Bg(t,e);return o.each((function(t){f(t,d())})),o.getOr(e)}return e},selectorChanged:function(t,e){return a(t,e),m},selectorChangedWithUnbind:a,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){return function(t,e,n){(t.inline?mg:pg)(t,e,n)}(r,t,e)},placeCaretAt:function(t,e){return f(bg(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=l();return t.collapsed?Fu.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,p.destroy()}},h=Lg(m),p=zg(m,r);return m.bookmarkManager=h,m.controlSelection=p,m},Yg=function(t,e,n){t.addNodeFilter("font",(function(t){V(t,(function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),a=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),a&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),function(t,e){V(e,(function(e){t.attr(e,null)}))}(t,["color","face","size"])}))}))},Gg=function(t,e){var n=Mr();e.convert_fonts_to_spans&&Yg(t,n,ue.explode(e.font_size_legacy_values)),function(t,e){t.addNodeFilter("strike",(function(t){V(t,(function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))}))}))}(t,n)},Kg=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},Xg=function(t,e){var r;try{r=n.atob(e)}catch(t){return C.none()}for(var o=new Uint8Array(r.length),i=0;i<o.length;i++)o[i]=r.charCodeAt(i);return C.some(new n.Blob([o],{type:t}))},Jg=function(t){return 0===t.indexOf("blob:")?function(t){return new Ni((function(e,r){var o=function(){r("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var i=new n.XMLHttpRequest;i.open("GET",t,!0),i.responseType="blob",i.onload=function(){200===this.status?e(this.response):o()},i.onerror=o,i.send()}catch(t){o()}}))}(t):0===t.indexOf("data:")?(e=t,new Ni((function(t){var r=Kg(e),o=r.type,i=r.data;Xg(o,i).fold((function(){return t(new n.Blob([]))}),t)}))):null;var e},Qg=0,Zg=function(t){return(t||"blobid")+Qg++},tv=function(t,e,r,o){var i,a;if(0!==e.src.indexOf("blob:")){var u=Kg(e.src),s=u.data,c=u.type;i=s,(a=t.getByData(i,c))?r({image:e,blobInfo:a}):Jg(e.src).then((function(n){a=t.create(Zg(),n,i),t.add(a),r({image:e,blobInfo:a})}),(function(t){o(t)}))}else(a=t.getByUri(e.src))?r({image:e,blobInfo:a}):Jg(e.src).then((function(o){(function(t){return new Ni((function(e){var r=new n.FileReader;r.onloadend=function(){e(r.result)},r.readAsDataURL(t)}))})(o).then((function(n){i=Kg(n).data,a=t.create(Zg(),o,i),t.add(a),r({image:e,blobInfo:a})}))}),(function(t){o(t)}))};function ev(t,e){var n={};return{findAll:function(r,o){o||(o=d(!0));var i=U(function(t){return t?tt(t.getElementsByTagName("img")):[]}(r),(function(e){var n=e.src;return!!ne.fileApi&&(!e.hasAttribute("data-mce-bogus")&&(!e.hasAttribute("data-mce-placeholder")&&(!(!n||n===ne.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e)))))})),a=j(i,(function(t){if(void 0!==n[t.src])return new Ni((function(e){n[t.src].then((function(n){if("string"==typeof n)return n;e({image:t,blobInfo:n.blobInfo})}))}));var r=new Ni((function(n,r){tv(e,t,n,r)})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r,r}));return Ni.all(a)}}}var nv=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new Ql("br",1)).shortEnded=!0:r.empty().append(new Ql("#text",3)).value=" "},rv=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},ov=function(t,e,n,r){return r.isEmpty(e,n,(function(e){return function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty}(t,e)}))},iv=function(t,e){var r=e.blob_cache,o=function(t){var o=t.attr("src");(function(t){return t.attr("src")===ne.transparentSrc||t.attr("data-mce-placeholder")})(t)||function(t){return t.attr("data-mce-bogus")}(t)||function(t){var e=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(t);return e?C.some({type:e[1],data:decodeURIComponent(e[2])}):C.none()}(o).filter((function(){return function(t,e){if(e.images_dataimg_filter){var r=new n.Image;return r.src=t.attr("src"),rt(t.attributes.map,(function(t,e){r.setAttribute(e,t)})),e.images_dataimg_filter(r)}return!0}(t,e)})).bind((function(t){var e=t.type,n=t.data;return C.from(r.getByData(n,e)).orThunk((function(){return Xg(e,n).map((function(t){var e=r.create(Zg(),t,n);return r.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))};r&&t.addAttributeFilter("src",(function(t){return V(t,o)}))},av=ue.makeMap,uv=ue.each,sv=ue.explode,cv=ue.extend,lv=function(t,e){void 0===e&&(e=vr());var n={},r=[],o={},i={};(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var a=function(t){var e,a,u;(a=t.name)in n&&((u=o[a])?u.push(t):o[a]=[t]),e=r.length;for(;e--;)(a=r[e].name)in t.attributes.map&&((u=i[a])?u.push(t):i[a]=[t]);return t},u={schema:e,addAttributeFilter:function(t,e){uv(sv(t),(function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){uv(sv(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},getNodeFilters:function(){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:a,parse:function(u,s){var c,l,f,d,m,h,p,g,v,b=[];s=s||{},o={},i={};var y=cv(av("script,style,head,html,body,title,meta,param"),e.getBlockElements()),x=e.getNonEmptyElements(),w=e.children,C=t.validate,_=function(t){return!1===t?"":!0===t?"p":t}("forced_root_block"in s?s.forced_root_block:t.forced_root_block),k=e.getWhiteSpaceElements(),S=/^[ \t\r\n]+/,T=/[ \t\r\n]+$/,D=/[ \t\r\n]+/g,O=/^[ \t\r\n]+$/;g=k.hasOwnProperty(s.context)||k.hasOwnProperty(t.root_name);var E=function(t,e){var r,i=new Ql(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i},N=function(t){var n,r,o,i,a=e.getBlockElements();for(n=t.prev;n&&3===n.type;){if((o=n.value.replace(T,"")).length>0)return void(n.value=o);if(r=n.next){if(3===r.type&&r.value.length){n=n.prev;continue}if(!a[r.name]&&"script"!==r.name&&"style"!==r.name){n=n.prev;continue}}i=n.prev,n.remove(),n=i}},A=lf({validate:C,allow_html_data_urls:t.allow_html_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e,n={};for(e in t)"li"!==e&&"p"!==e&&(n[e]=t[e]);return n}(e.getSelfClosingElements()),cdata:function(t){v.append(E("#cdata",4)).value=t},text:function(t,e){var n;g||(t=t.replace(D," "),function(t,e){return t&&(e[t.name]||"br"===t.name)}(v.lastChild,y)&&(t=t.replace(S,""))),0!==t.length&&((n=E("#text",3)).raw=!!e,v.append(n).value=t)},comment:function(t){v.append(E("#comment",8)).value=t},pi:function(t,e){v.append(E(t,7)).value=e,N(v)},doctype:function(t){v.append(E("#doctype",10)).value=t,N(v)},start:function(t,n,o){var a,u,s,c,l=C?e.getElementRule(t):{};if(l){for((a=E(l.outputName||t,1)).attributes=n,a.shortEnded=o,v.append(a),(c=w[v.name])&&w[a.name]&&!c[a.name]&&b.push(a),u=r.length;u--;)(s=r[u].name)in n.map&&((h=i[s])?h.push(a):i[s]=[a]);y[t]&&N(a),o||(v=a),!g&&k[t]&&(g=!0)}},end:function(n){var r,o,i,a,u=C?e.getElementRule(n):{};if(u){if(y[n]&&!g){if((r=v.firstChild)&&3===r.type)if((o=r.value.replace(S,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||O.test(o))&&(r.remove(),r=i),r=i;if((r=v.lastChild)&&3===r.type)if((o=r.value.replace(T,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||O.test(o))&&(r.remove(),r=i),r=i}if(g&&k[n]&&(g=!1),u.removeEmpty&&ov(e,x,k,v))return a=v.parent,y[v.name]?v.empty().remove():v.unwrap(),void(v=a);u.paddEmpty&&(function(t){return rv(t,"#text")&&" "===t.firstChild.value}(v)||ov(e,x,k,v))&&nv(t,s,y,v),v=v.parent}}},e),R=v=new Ql(s.context||t.root_name,11);if(A.parse(u,s.format),C&&b.length&&(s.context?s.invalid=!0:function(t){var n,r,o,i,u,s,c,l,f,d,m,h=av("tr,td,th,tbody,thead,tfoot,table"),p=e.getNonEmptyElements(),g=e.getWhiteSpaceElements(),v=e.getTextBlockElements(),b=e.getSpecialElements();for(n=0;n<t.length;n++)if((r=t[n]).parent&&!r.fixed)if(v[r.name]&&"li"===r.parent.name){for(d=r.next;d&&v[d.name];)d.name="li",d.fixed=!0,r.parent.insert(d,r.parent),d=d.next;r.unwrap(r)}else{for(i=[r],o=r.parent;o&&!e.isValidChild(o.name,r.name)&&!h[o.name];o=o.parent)i.push(o);if(o&&i.length>1){for(i.reverse(),u=s=a(i[0].clone()),f=0;f<i.length-1;f++){for(e.isValidChild(s.name,i[f].name)?(c=a(i[f].clone()),s.append(c)):c=s,l=i[f].firstChild;l&&l!==i[f+1];)m=l.next,c.append(l),l=m;s=c}ov(e,p,g,u)?o.insert(r,i[0],!0):(o.insert(u,i[0],!0),o.insert(r,u)),o=i[0],(ov(e,p,g,o)||rv(o,"br"))&&o.empty().remove()}else if(r.parent){if("li"===r.name){if((d=r.prev)&&("ul"===d.name||"ul"===d.name)){d.append(r);continue}if((d=r.next)&&("ul"===d.name||"ul"===d.name)){d.insert(r,d.firstChild,!0);continue}r.wrap(a(new Ql("ul",1)));continue}e.isValidChild(r.parent.name,"div")&&e.isValidChild("div",r.name)?r.wrap(a(new Ql("div",1))):b[r.name]?r.empty().remove():r.unwrap()}}}(b)),_&&("body"===R.name||s.isRootContent)&&function(){var n,r,o=R.firstChild,i=function(t){t&&((o=t.firstChild)&&3===o.type&&(o.value=o.value.replace(S,"")),(o=t.lastChild)&&3===o.type&&(o.value=o.value.replace(T,"")))};if(e.isValidChild(R.name,_.toLowerCase())){for(;o;)n=o.next,3===o.type||1===o.type&&"p"!==o.name&&!y[o.name]&&!o.attr("data-mce-type")?(r||((r=E(_,1)).attr(t.forced_root_block_attrs),R.insert(r,o)),r.append(o)):(i(r),r=null),o=n;i(r)}}(),!s.invalid){for(p in o)if(o.hasOwnProperty(p)){for(h=n[p],d=(c=o[p]).length;d--;)c[d].parent||c.splice(d,1);for(l=0,f=h.length;l<f;l++)h[l](c,p,s)}for(l=0,f=r.length;l<f;l++)if((h=r[l]).name in i){for(d=(c=i[h.name]).length;d--;)c[d].parent||c.splice(d,1);for(d=0,m=h.callbacks.length;d<m;d++)h.callbacks[d](c,h.name,s)}}return R}};return function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,r,o){var i,a,u,s,c,l,f,d,m=t.length,h=ue.extend({},n.getBlockElements()),p=n.getNonEmptyElements(),g=n.getWhiteSpaceElements();for(h.body=1,i=0;i<m;i++)if(u=(a=t[i]).parent,h[a.parent.name]&&a===u.lastChild){for(c=a.prev;c;){if("span"!==(l=c.name)||"bookmark"!==c.attr("data-mce-type")){if("br"!==l)break;if("br"===l){a=null;break}}c=c.prev}a&&(a.remove(),ov(n,p,g,u)&&(f=n.getElementRule(u.name))&&(f.removeEmpty?u.remove():f.paddEmpty&&nv(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 Ql("#text",3)).value=" ",a.replace(d))}})),t.addAttributeFilter("href",(function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(n=i.attr("rel"),r=void 0,r=n?ue.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(t){return t.split(" ").filter((function(t){return t.length>0})).concat(["noopener"]).sort().join(" ")}(r)))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){for(var e,n,r=t.length;r--;)if("ul"===(n=(e=t[r]).parent).name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new Ql("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){for(var e,r,o,i,a,u,s,c=t.length,l=n.getValidClasses();c--;){for(r=(e=t[c]).attr("class").split(" "),a="",o=0;o<r.length;o++)i=r[o],s=!1,(u=l["*"])&&u[i]&&(s=!0),u=l[e.name],!s&&u&&u[i]&&(s=!0),s&&(a&&(a+=" "),a+=i);a.length||(a=null),e.attr("class",a)}})),iv(t,e)}(u,t),function(t,e){e.inline_styles&&Gg(t,e)}(u,t),u},fv=function(t,e,r){return function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events}(t,r)?function(t,e,r){var o,i,a=t.dom;e=e.cloneNode(!0);var u=n.document.implementation;return u.createHTMLDocument&&(o=u.createHTMLDocument(""),ue.each("BODY"===e.nodeName?e.childNodes:[e],(function(t){o.body.appendChild(o.importNode(t,!0))})),e="BODY"!==e.nodeName?o.body.firstChild:o.body,i=a.doc,a.doc=o),function(t,e){t.fire("PreProcess",e)}(t,wt(wt({},r),{node:e})),i&&(a.doc=i),e}(t,e,r):e},dv=function(t,e,n){-1===ue.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),e.push(n))},mv=function(t,e,n,r,o){return function(t,e,n){return!e.no_events&&t?function(t,e){return t.fire("PostProcess",e)}(t,wt(wt({},e),{content:n})).content:n}(t,o,function(t,e,n){return ef(t,e).serialize(n)}(e,n,r))},hv=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:qi.DOM,o=e&&e.schema?e.schema:vr(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=lv(t,o);!function(t,e,n){t.addAttributeFilter("data-mce-tabindex",(function(t,e){for(var n,r=t.length;r--;)(n=t[r]).attr("tabindex",n.attr("data-mce-tabindex")),n.attr(e,null)})),t.addAttributeFilter("src,href,style",(function(t,r){for(var o,i,a=t.length,u="data-mce-"+r,s=e.url_converter,c=e.url_converter_scope;a--;)void 0!==(i=(o=t[a]).attr(u))?(o.attr(r,i.length>0?i:null),o.attr(u,null)):(i=o.attr(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))})),t.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)(n=(e=t[r]).attr("class"))&&(n=e.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),e.attr("class",n.length>0?n:null))})),t.addAttributeFilter("data-mce-type",(function(t,e,n){for(var r,o=t.length;o--;){if("bookmark"===(r=t[o]).attr("data-mce-type")&&!n.cleanup)C.from(r.firstChild).exists((function(t){return!Ia(t.value)}))?r.unwrap():r.remove()}})),t.addNodeFilter("noscript",(function(t){for(var e,n=t.length;n--;)(e=t[n].firstChild)&&(e.value=ur.decode(e.value))})),t.addNodeFilter("script,style",(function(t,n){for(var r,o,i,a=t.length,u=function(t){return t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};a--;)o=(r=t[a]).firstChild?r.firstChild.value:"","script"===n?((i=r.attr("type"))&&r.attr("type","mce-no/type"===i?null:i.replace(/^mce\-/,"")),"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="// <![CDATA[\n"+u(o)+"\n// ]]>")):"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="\x3c!--\n"+u(o)+"\n--\x3e")})),t.addNodeFilter("#comment",(function(t){for(var r,o=t.length;o--;)r=t[o],e.preserve_cdata&&0===r.value.indexOf("[CDATA[")?(r.name="#cdata",r.type=4,r.value=n.decode(r.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===r.value.indexOf("mce:protected ")&&(r.name="#text",r.type=3,r.raw=!0,r.value=unescape(r.value).substr(14))})),t.addNodeFilter("xml:namespace,input",(function(t,e){for(var n,r=t.length;r--;)7===(n=t[r]).type?n.remove():1===n.type&&("input"!==e||n.attr("type")||n.attr("type","text"))})),t.addAttributeFilter("data-mce-type",(function(e){V(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)}))}(i,t,r);return{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,a){void 0===a&&(a={});var u=wt({format:"html"},a),s=fv(e,n,u),c=function(t,e,n){var r=Ma(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||qn(ce.fromDom(e))?r:ue.trim(r)}(r,s,u),l=function(t,e,n){var r=n.selection?wt({forced_root_block:!1},n):n,o=t.parse(e,r);return function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}}(o),o}(i,c,u);return"tree"===u.format?l:mv(e,t,o,l,u)},addRules:function(t){o.addValidElements(t)},setRules:function(t){o.setValidElements(t)},addTempAttr:h(dv,i,n),getTempAttrs:function(){return n},getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},pv=function(t,e){var n=hv(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}};function gv(t,e){var r={},o=function(t,r,o,i){var a=new n.XMLHttpRequest;a.open("POST",e.url),a.withCredentials=e.credentials,a.upload.onprogress=function(t){i(t.loaded/t.total*100)},a.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+a.status)},a.onload=function(){if(a.status<200||a.status>=300)o("HTTP Error: "+a.status);else{var t,n,i=JSON.parse(a.responseText);if(i&&"string"==typeof i.location)r((t=e.basePath,n=i.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n));else o("Invalid JSON: "+a.responseText)}};var u=new n.FormData;u.append("file",t.blob(),t.filename()),a.send(u)},i=function(t,e){return{url:e,blobInfo:t,status:!0}},a=function(t,e){return{url:"",blobInfo:t,status:!1,error:e}},u=function(t,e){ue.each(r[t],(function(t){t(e)})),delete r[t]},s=function(n,o){return n=ue.grep(n,(function(e){return!t.isUploaded(e.blobUri())})),Ni.all(ue.map(n,(function(n){return t.isPending(n.blobUri())?function(t){var e=t.blobUri();return new Ni((function(t){r[e]=r[e]||[],r[e].push(t)}))}(n):function(e,n,r){return t.markPending(e.blobUri()),new Ni((function(o){var s,c=function(){};try{var l=function(){s&&(s.close(),c)};n(e,(function(n){l(),t.markUploaded(e.blobUri(),n),u(e.blobUri(),i(e,n)),o(i(e,n))}),(function(n){l(),t.removeFailed(e.blobUri()),u(e.blobUri(),a(e,n)),o(a(e,n))}),(function(t){t<0||t>100||(s||(s=r()),s.progressBar.value(t))}))}catch(t){o(a(e,t.message))}}))}(n,e.handler,o)})))};return!1===R(e.handler)&&(e.handler=o),{upload:function(t,n){return e.url||e.handler!==o?s(t,n):new Ni((function(t){t([])}))}}}var vv=0,bv=function(t){return t+vv+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e},yv=function(t){var e,r,o,i,a,u=function(){var t=[],e=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e,r=t.id||bv("blobid"),o=t.name||r;return{id:d(r),name:d(o),filename:d(o+"."+(e=t.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[e.toLowerCase()]||"dat")),blob:d(t.blob),base64:d(t.base64),blobUri:d(t.blobUri||n.URL.createObjectURL(t.blob)),uri:d(t.uri)}},r=function(e){return $(t,e).getOrUndefined()},o=function(t){return r((function(e){return e.id()===t}))};return{create:function(t,n,r,o){if(T(t))return e({id:t,name:o,blob:n,base64:r});if(D(t))return e(t);throw new Error("Unknown input type")},add:function(e){o(e.id())||t.push(e)},get:o,getByUri:function(t){return r((function(e){return e.blobUri()===t}))},getByData:function(t,e){return r((function(n){return n.base64()===t&&n.blob().type===e}))},findFirst:r,removeByUri:function(e){t=U(t,(function(t){return t.blobUri()!==e||(n.URL.revokeObjectURL(t.blobUri()),!1)}))},destroy:function(){V(t,(function(t){n.URL.revokeObjectURL(t.blobUri())})),t=[]}}}(),s=(o={},i=function(t,e){return{status:t,resultUri:e}},{hasBlobUri:a=function(t){return t in o},getResultUri:function(t){var e=o[t];return e?e.resultUri:null},isPending:function(t){return!!a(t)&&1===o[t].status},isUploaded:function(t){return!!a(t)&&2===o[t].status},markPending:function(t){o[t]=i(1,null)},markUploaded:function(t,e){o[t]=i(2,e)},removeFailed:function(t){delete o[t]},destroy:function(){o={}}}),c=[],l=function(e){return function(n){return t.selection?e(n):[]}},f=function(t,e,n){var r=0;do{-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},m=function(t,e,n){return t=f(t,'src="'+e+'"','src="'+n+'"'),t=f(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},h=function(e,n){V(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=j(t.fragments,(function(t){return m(t,e,n)})):t.content=m(t.content,e,n)}))},p=function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},g=function(n){return e||(e=gv(s,{url:ps(t),basePath:gs(t),credentials:vs(t),handler:bs(t)})),y().then(l((function(r){var o=j(r,(function(t){return t.blobInfo}));return e.upload(o,p).then(l((function(e){var o=j(e,(function(e,n){var o=r[n].blobInfo,i=r[n].image;return e.status&&function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(u.removeByUri(i.src),function(e,n){var r,o=t.convertURL(n,"src");h(e.src,n),t.$(e).attr({src:ms(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})}(i,e.url)):e.error&&function(t,e){Wp(t,ta.translate(["Failed to upload image: {0}",e]))}(t,e.error),{element:i,status:e.status,uploadUri:e.url,blobInfo:o}}));return n&&n(o),o})))})))},v=function(e){if(ds(t))return g(e)},b=function(e){return!1!==K(c,(function(t){return t(e)}))&&(0!==e.getAttribute("src").indexOf("data:")||function(t){return t.getParam("images_dataimg_filter",d(!0),"function")}(t)(e))},y=function(){return r||(r=ev(s,u)),r.findAll(t.getBody(),b).then(l((function(e){return e=U(e,(function(e){return"string"!=typeof e||(Wp(t,e),!1)})),V(e,(function(t){h(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},x=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var r=s.getResultUri(n);if(r)return'src="'+r+'"';var o=u.getByUri(n);return o||(o=q(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null)),o?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':e}))};return t.on("SetContent",(function(){ds(t)?v():y()})),t.on("RawSaveContent",(function(t){t.content=x(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||(t.content=x(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){V(t,(function(t){var e=t.attr("src");if(!u.getByUri(e)){var n=s.getResultUri(e);n&&t.attr("src",n)}}))}))})),{blobCache:u,addFilter:function(t){c.push(t)},uploadImages:g,uploadImagesAuto:v,scanForImages:y,destroy:function(){u.destroy(),s.destroy(),r=e=null}}},xv=function(t,e,n,r){var o=et(n.get()),i={},a={},u=U(dl(t.dom,e),(function(t){return 1===t.nodeType&&!t.getAttribute("data-mce-bogus")}));rt(r,(function(e,n){ue.each(u,(function(r){return t.formatter.matchNode(r,n,{},e.similar)?(-1===o.indexOf(n)&&(V(e.callbacks,(function(t){t(!0,{node:r,format:n,parents:u})})),i[n]=e.callbacks),a[n]=e.callbacks,!1):!Tm(t,r,n)&&void 0}))}));var s=wv(n.get(),a,e,u);n.set(wt(wt({},i),s))},wv=function(t,e,n,r){return st(t,(function(t,o){return!!dt(e,o)||(V(t,(function(t){t(!1,{node:n,format:o,parents:r})})),!1)})).t},Cv=function(t,e,n,r,o){return null===e.get()&&function(t,e){var n=Xi({});t.set({}),e.on("NodeChange",(function(r){xv(e,r.element,n,t.get())}))}(e,t),function(t,e,n,r){var o=t.get();V(e.split(","),(function(t){o[t]||(o[t]={similar:r,callbacks:[]}),o[t].callbacks.push(n)})),t.set(o)}(e,n,r,o),{unbind:function(){return function(t,e,n){var r=t.get();V(e.split(","),(function(t){r[t].callbacks=U(r[t].callbacks,(function(t){return t!==n})),0===r[t].callbacks.length&&delete r[t]})),t.set(r)}(e,n,r)}}};function _v(t){var e={},n=function(t,r){t&&("string"!=typeof t?ue.each(t,(function(t,e){n(e,t)})):(O(r)||(r=[r]),ue.each(r,(function(t){void 0===t.deep&&(t.deep=!t.selector),void 0===t.split&&(t.split=!t.selector||t.inline),void 0===t.remove&&t.selector&&!t.inline&&(t.remove="none"),t.selector&&t.inline&&(t.mixed=!0,t.block_expand=!0),"string"==typeof t.classes&&(t.classes=t.classes.split(/\s+/))})),e[t]=r))};return n(function(t){var e={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",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",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,n,r){ue.each(r,(function(n,r){t.setAttrib(e,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 ue.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),(function(t){e[t]={block:t,remove:"all"}})),e}(t.dom)),n(function(t){return t.getParam("formats")}(t)),{get:function(t){return t?e[t]:e},has:function(t){return dt(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}}var kv,Sv=ue.each,Tv=qi.DOM,Dv=function(t,e){var n,r,o,i=e&&e.schema||vr({}),a=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=Tv.create(r.name);return function(t,e){e.classes.length&&Tv.addClass(t,e.classes.join(" ")),Tv.setAttribs(t,e.attrs)}(e,r),e},u=function(t,e,n){var r,o,s=e.length>0&&e[0],c=s&&s.name,l=function(t,e){var n="string"!=typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==ue.inArray(o,e)?e:o[0])}(t,c);if(l)c===l?(o=e[0],e=e.slice(1)):o=l;else if(s)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=a(o)).appendChild(t),n&&(r||(r=Tv.create("div")).appendChild(t),ue.each(n,(function(e){var n=a(e);r.insertBefore(n,t)}))),u(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=a(r),(o=Tv.create("div")).appendChild(u(n,t.slice(1),r.siblings)),o):""},Ov=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=ue.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==ue.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var a=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);a&&(n.attrs[a[1]]=a[2])}return""}))),n.name=e||"div",n},Ev=function(t,e){var n,r,o,i="",a=function(t){var e=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return T(e)?e:""}(t);if(""===a)return"";var u=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var s=ft(e,"preview");if(s.is(!1))return"";a=s.getOr(a)}n=e.block||e.inline||"span";var c,l=(c=e.selector)&&"string"==typeof c?(c=(c=c.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),ue.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=ue.map(t.split(/(?:~\+|~|\+)/),Ov),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[];l.length?(l[0].name||(l[0].name=n),n=e.selector,r=Dv(l,t)):r=Dv([n],t);var f=Tv.select(n,r)[0]||r.firstChild;return Sv(e.styles,(function(t,e){(t=u(t))&&Tv.setStyle(f,e,t)})),Sv(e.attributes,(function(t,e){(t=u(t))&&Tv.setAttrib(f,e,t)})),Sv(e.classes,(function(t){t=u(t),Tv.hasClass(f,t)||Tv.addClass(f,t)})),t.fire("PreviewFormats"),Tv.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=Tv.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Sv(a.split(" "),(function(e){var n=Tv.getStyle(f,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Tv.getStyle(t.getBody(),e,!0),"#ffffff"===Tv.toHex(n).toLowerCase())||"color"===e&&"#000000"===Tv.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),Tv.remove(r),i},Nv=function(t){var e=_v(t),n=Xi(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),Um(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){op(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){op(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){op(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:h(Am,t),matchAll:h(Rm,t),matchNode:h(Nm,t),canApply:h(Bm,t),formatChanged:h(Cv,t,n),getCssText:h(Ev,t)}},Av=function(t){var e=Xi(C.none()),n=Xi(0),r=Xi(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){op(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,a){return function(t,e,n,r,o,i,a){return op(t).undoManager.addUndoLevel(e,n,r,o,i,a)}(t,o,r,n,e,i,a)},undo:function(){return function(t,e,n,r){return op(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return op(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){op(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){op(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return op(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return op(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return op(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){op(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){op(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return ep(t)||function(t,e,n){var r=Xi(!1),o=function(t){Xh(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command.toLowerCase();"undo"!==r&&"redo"!==r&&"mcerepaint"!==r&&(Jh(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command.toLowerCase();"undo"!==e&&"redo"!==e&&"mcerepaint"!==e&&o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===Gh(Wh(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var a=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||a||(e.beforeChange(),Xh(e,!0,n),e.add({},t),r.set(!0))}})),t.on("mousedown",(function(t){e.typing&&o(t)}));t.on("input",(function(t){t.inputType&&("insertReplacementText"===t.inputType||function(t){return"insertText"===t.inputType&&null===t.data}(t)||function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType}(t))&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))}(t,o,n),function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")}(t),o},Rv=[9,27,Hg.HOME,Hg.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Hg.DOWN,Hg.UP,Hg.LEFT,Hg.RIGHT].concat(ne.browser.isFirefox()?[224]:[]),Bv=function(t){return"keydown"===t.type||"keyup"===t.type},Pv=function(t){var e=t.keyCode;return e===Hg.BACKSPACE||e===Hg.DELETE},Iv=function(t){var e=t.dom,n=ls(t),r=function(t){return t.getParam("placeholder",us.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function(i,a){if(!function(t){if(Bv(t)){var e=t.keyCode;return!Pv(t)&&(Hg.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||F(Rv,e))}return!1}(i)){var u=t.getBody(),s=!function(t){return Bv(t)&&!(Pv(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(Pf(ce.fromDom(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(e,u,n);(""!==e.getAttrib(u,"data-mce-placeholder")!==s||a)&&(e.setAttrib(u,"data-mce-placeholder",s?r:null),e.setAttrib(u,"aria-placeholder",s?r:null),function(t,e){t.fire("PlaceholderToggle",{state:e})}(t,s),t.on(s?"keydown":"keyup",o),t.off(s?"keyup":"keydown",o))}};r&&t.on("init",(function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",(function(e){return Pi.setEditorTimeout(t,(function(){return o(e)}))}))}))},Mv=function(t){return void 0===t.touches||1!==t.touches.length?C.none():C.some(t.touches[0])},Lv=function(t){var e=Xi(C.none()),n=Xi(!1),r=oa((function(e){t.fire("longpress",wt(wt({},e),{type:"longpress"})),n.set(!0)}),400);t.on("touchstart",(function(t){Mv(t).each((function(o){r.cancel();var i={x:d(o.clientX),y:d(o.clientY),target:d(t.target)};r.throttle(t),n.set(!1),e.set(C.some(i))}))}),!0),t.on("touchmove",(function(o){r.cancel(),Mv(o).each((function(r){e.get().each((function(o){(function(t,e){var n=Math.abs(t.clientX-e.x()),r=Math.abs(t.clientY-e.y());return n>5||r>5})(r,o)&&(e.set(C.none()),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target().isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",wt(wt({},o),{type:"tap"}))}))}),!0)},Fv=function(t,e){return t.hasOwnProperty(e.nodeName)},Hv=function(t,e){return!!hn(e)||!!an(e)&&(!Fv(t,e)&&!Jc(e))},jv=function(t,e){if(hn(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||Fv(t,e.nextSibling)))return!0}return!1},Vv=function(t){var e,n,r,o=t.dom,i=t.selection,a=t.schema,u=a.getBlockElements(),s=i.getStart(),c=t.getBody(),l=ls(t);if(s&&an(s)&&l){var f=c.nodeName.toLowerCase();if(a.isValidChild(f,l.toLowerCase())&&!function(t,e,n){return H(Hf(ce.fromDom(n),ce.fromDom(e)),(function(e){return Fv(t,e.dom())}))}(u,c,s)){var d=i.getRng(),m=d.startContainer,h=d.startOffset,p=d.endContainer,g=d.endOffset,v=hm(t);for(s=c.firstChild;s;)if(Hv(u,s)){if(jv(u,s)){n=s,s=s.nextSibling,o.remove(n);continue}e||(e=o.create(l,fs(t)),s.parentNode.insertBefore(e,s),r=!0),n=s,s=s.nextSibling,e.appendChild(n)}else e=null,s=s.nextSibling;r&&v&&(d.setStart(m,h),d.setEnd(p,g),i.setRng(d),t.nodeChanged())}}},zv=function(t,e,n){var r=t?1:-1;return e.setRng(Fu(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0},Uv=function(t,e){var n=e.selection.getRng(),r=t?Fu.fromRangeEnd(n):Fu.fromRangeStart(n);return!!function(t){return R(t.selection.getSel().modify)}(e)&&(t&&Ua(r)?zv(!0,e.selection,r):!(t||!Wa(r))&&zv(!1,e.selection,r))},Wv=hn,qv=function(t){return Wv(t)&&"\ufeff"===t.data[0]},$v=function(t){return Wv(t)&&"\ufeff"===t.data[t.data.length-1]},Yv=function(t){return t.ownerDocument.createTextNode("\ufeff")},Gv=function(t,e){return t?function(t){if(Wv(t.previousSibling))return $v(t.previousSibling)||t.previousSibling.appendData("\ufeff"),t.previousSibling;if(Wv(t))return qv(t)||t.insertData(0,"\ufeff"),t;var e=Yv(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if(Wv(t.nextSibling))return qv(t.nextSibling)||t.nextSibling.insertData(0,"\ufeff"),t.nextSibling;if(Wv(t))return $v(t)||t.appendData("\ufeff"),t;var e=Yv(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},Kv=h(Gv,!0),Xv=h(Gv,!1),Jv=function(t,e){return hn(t.container())?Gv(e,t.container()):Gv(e,t.getNode())},Qv=function(t,e){var n=e.get();return n&&t.container()===n&&ja(n)},Zv=function(t,e){return e.fold((function(e){Hs(t.get());var n=Kv(e);return t.set(n),C.some(Fu(n,n.length-1))}),(function(e){return Fc(e).map((function(e){if(Qv(e,t))return Fu(t.get(),1);Hs(t.get());var n=Jv(e,!0);return t.set(n),Fu(n,1)}))}),(function(e){return Hc(e).map((function(e){if(Qv(e,t))return Fu(t.get(),t.get().length-1);Hs(t.get());var n=Jv(e,!1);return t.set(n),Fu(n,n.length-1)}))}),(function(e){Hs(t.get());var n=Xv(e);return t.set(n),C.some(Fu(n,1))}))},tb=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,eb=function(t,e){return be(ce.fromDom(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},nb=function(t){return"rtl"===qi.DOM.getStyle(t,"direction",!0)||(e=t.textContent,tb.test(e));var e},rb=function(t,e,n){var r=function(t,e,n){return U(qi.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return C.from(r[r.length-1])},ob=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?ja(n)?hn(n.nextSibling)?Fu(n.nextSibling,0):Fu.after(n):Ua(e)?Fu(n,r+1):e:ja(n)?hn(n.previousSibling)?Fu(n.previousSibling,n.previousSibling.data.length):Fu.before(n):Wa(e)?Fu(n,r-1):e},ib=h(ob,!0),ab=h(ob,!1),ub=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return C.none()},sb=Oi([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),cb=function(t,e){var n=nc(e,t);return n||t},lb=function(t,e,n){var r=ib(n),o=cb(e,r.container());return rb(t,o,r).fold((function(){return Mc(o,r).bind(h(rb,t,o)).map((function(t){return sb.before(t)}))}),C.none)},fb=function(t,e){return null===Vc(t,e)},db=function(t,e,n){return rb(t,e,n).filter(h(fb,e))},mb=function(t,e,n){var r=ab(n);return db(t,e,r).bind((function(t){return Lc(t,r).isNone()?C.some(sb.start(t)):C.none()}))},hb=function(t,e,n){var r=ib(n);return db(t,e,r).bind((function(t){return Mc(t,r).isNone()?C.some(sb.end(t)):C.none()}))},pb=function(t,e,n){var r=ab(n),o=cb(e,r.container());return rb(t,o,r).fold((function(){return Lc(o,r).bind(h(rb,t,o)).map((function(t){return sb.after(t)}))}),C.none)},gb=function(t){return!1===nb(bb(t))},vb=function(t,e,n){return ub([lb,mb,hb,pb],[t,e,n]).filter(gb)},bb=function(t){return t.fold(m,m,m,m)},yb=function(t){return t.fold(d("before"),d("start"),d("end"),d("after"))},xb=function(t){return t.fold(sb.before,sb.before,sb.after,sb.after)},wb=function(t){return t.fold(sb.start,sb.start,sb.end,sb.end)},Cb=function(t,e,n,r,o,i){return Ka(rb(e,n,r),rb(e,n,o),(function(e,r){return e!==r&&function(t,e,n){var r=nc(e,t),o=nc(n,t);return r&&r===o}(n,e,r)?sb.after(t?e:r):i})).getOr(i)},_b=function(t,e){return t.fold(d(!0),(function(t){return r=e,!(yb(n=t)===yb(r)&&bb(n)===bb(r));var n,r}))},kb=function(t,e){return t?e.fold(f(C.some,sb.start),C.none,f(C.some,sb.after),C.none):e.fold(C.none,f(C.some,sb.before),C.none,f(C.some,sb.end))},Sb=function(t,e,n,r){var o=ob(t,r),i=vb(e,n,o);return vb(e,n,o).bind(h(kb,t)).orThunk((function(){return function(t,e,n,r,o){var i=ob(t,o);return Rc(t,n,i).map(h(ob,t)).fold((function(){return r.map(xb)}),(function(o){return vb(e,n,o).map(h(Cb,t,e,n,i,o)).filter(h(_b,r))})).filter(gb)}(t,e,n,i,r)}))},Tb=(h(Sb,!1),h(Sb,!0),function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)}),Db=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},Ob=function(t,e,n){return Zv(e,n).map((function(e){return Tb(t,e),n}))},Eb=function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=Fu.fromRangeStart(t.selection.getRng());Fu.isTextPosition(n)&&!1===function(t){return Ua(t)||Wa(t)}(n)&&(Tb(t,Fs(e.get(),n)),e.set(null))}},Nb=function(t,e,n){return function(){return!!Ds(t)&&function(t,e,n){var r=t.getBody(),o=Fu.fromRangeStart(t.selection.getRng()),i=h(eb,t);return Sb(n,i,r,o).bind((function(n){return Ob(t,e,n)}))}(t,e,n).isSome()}},Ab=function(t,e,n){return function(){return!!Ds(e)&&Uv(t,e)}},Rb=function(t){var e=Xi(null),n=h(eb,t);return t.on("NodeChange",(function(r){!Ds(t)||ne.browser.isIE()&&r.initial||(function(t,e,n){var r=j(ma(ce.fromDom(e.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom()})),o=U(r,t),i=U(n,t);V(J(o,i),h(Db,!1)),V(J(i,o),h(Db,!0))}(n,t.dom,r.parents),Eb(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=U(r,t);V(o,(function(r){var o=Fu.fromRangeStart(e.selection.getRng());vb(t,e.getBody(),o).bind((function(t){return Ob(e,n,t)}))}))}}(n,t,e,r.parents))})),e},Bb=h(Ab,!0),Pb=h(Ab,!1);!function(t){t[t.Br=0]="Br",t[t.Block=1]="Block",t[t.Wrap=2]="Wrap",t[t.Eol=3]="Eol"}(kv||(kv={}));var Ib,Mb=function(t,e){return t===Lu.Backwards?X(e):e},Lb=function(t,e,n){return t===Lu.Forwards?e.next(n):e.prev(n)},Fb=function(t,e,n,r){return bn(r.getNode(e===Lu.Forwards))?kv.Br:!1===rc(n,r)?kv.Block:kv.Wrap},Hb=function(t,e,n,r){for(var o,i=Dc(n),a=r,u=[];a&&(o=Lb(e,i,a));){if(bn(o.getNode(!1)))return e===Lu.Forwards?{positions:Mb(e,u).concat([o]),breakType:kv.Br,breakAt:C.some(o)}:{positions:Mb(e,u),breakType:kv.Br,breakAt:C.some(o)};if(o.isVisible()){if(t(a,o)){var s=Fb(0,e,a,o);return{positions:Mb(e,u),breakType:s,breakAt:C.some(o)}}u.push(o),a=o}else a=o}return{positions:Mb(e,u),breakType:kv.Eol,breakAt:C.none()}},jb=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===Lu.Backwards?o.concat(r):[r].concat(o)})).getOr([])},Vb=function(t,e){return q(t,(function(t,n){return t.fold((function(){return C.some(n)}),(function(r){return Ka(Q(r.getClientRects()),Q(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r})).or(t)}))}),C.none())},zb=function(t,e){return Q(e.getClientRects()).bind((function(e){return Vb(t,e.left)}))},Ub=h(Hb,Mu.isAbove,-1),Wb=h(Hb,Mu.isBelow,1),qb=h(jb,-1,Ub),$b=h(jb,1,Wb),Yb=function(t){var e=function(e){return j(e,(function(e){return(e=Ja(e)).node=t,e}))};if(an(t))return e(t.getClientRects());if(hn(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},Gb=function(t){return G(t,Yb)};!function(t){t[t.Up=-1]="Up",t[t.Down=1]="Down"}(Ib||(Ib={}));var Kb,Xb,Jb=function(t,e,n,r,o,i){var a=0,u=[],s=function(r){var i,s,l;for(l=Gb([r]),-1===t&&(l=l.reverse()),i=0;i<l.length;i++)if(s=l[i],!n(s,c)){if(u.length>0&&e(s,xt(u))&&a++,s.line=a,o(s))return!0;u.push(s)}},c=xt(i.getClientRects());if(!c)return u;var l=i.getNode();return s(l),function(t,e,n,r){for(;r=ec(r,t,vu,e);)if(n(r))return}(t,r,s,l),u},Qb=h(Jb,Ib.Up,tu,eu),Zb=h(Jb,Ib.Down,eu,tu),ty=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},ey=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},ny=xn,ry=ec,oy=function(t,e){return Math.abs(t.left-e)},iy=function(t,e){return Math.abs(t.right-e)},ay=function(t,e){return t>=e.left&&t<=e.right},uy=function(t,e){return t>=e.top&&t<=e.bottom},sy=function(t,e){return bt(t,(function(t,n){var r=Math.min(oy(t,e),iy(t,e)),o=Math.min(oy(n,e),iy(n,e));return ay(e,n)?n:ay(e,t)?t:o===r&&ny(n.node)||o<r?n:t}))},cy=function(t,e,n,r,o){var i=ry(r,t,vu,e,!o);do{if(!i||n(i))return}while(i=ry(i,t,vu,e))},ly=function(t,e,n){var r=Gb(function(t){return U(tt(t.getElementsByTagName("*")),qs)}(t)),o=U(r,h(uy,n)),i=sy(o,e);if(i){var a=!fn(i.node);if((i=sy(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=U(Gb([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),cy(Ib.Up,t,h(o,tu),e.node,n),cy(Ib.Down,t,h(o,eu),e.node,n),r}(t,i,a),e))&&qs(i.node))return function(t,e){return{node:t.node,before:oy(t,e)<iy(t,e)}}(i,e)}return null},fy=yn,dy=xn,my=function(t,e,n,r,o){return e._selectionOverrides.showCaret(t,n,r,o)},hy=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?null:function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e)},py=function(t,e,n){var r=lc(1,t.getBody(),e),o=Fu.fromRangeStart(r),i=o.getNode();if(dy(i))return my(1,t,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(dy(a))return my(1,t,a,!1,!1);var u=t.dom.getParent(o.getNode(),(function(t){return dy(t)||fy(t)}));return dy(u)?my(1,t,u,!1,n):null},gy=function(t,e,n){if(!e||!e.collapsed)return e;var r=py(t,e,n);return r||e},vy=xn,by=ru,yy=function(t,e,n,r){var o=t===Lu.Forwards,i=o?Df:Of;if(!r.collapsed){var a=by(r);if(vy(a))return my(t,e,a,t===Lu.Backwards,!0)}var u=function(t){return Ha(t.startContainer)}(r),s=dc(t,e.getBody(),r);if(i(s))return hy(e,s.getNode(!o));var c=ob(o,n(s));if(!c)return u?r:null;if(i(c))return my(t,e,c.getNode(!o),o,!0);var l=n(c);return l&&i(l)&&pc(c,l)?my(t,e,l.getNode(!o),o,!0):u?gy(e,c.toRange(),!0):null},xy=function(t,e,n,r){var o,i,a,u;u=by(r);var s=dc(t,e.getBody(),r),c=n(e.getBody(),ty(1),s),l=U(c,ey(1)),f=xt(s.getClientRects());if((Df(s)||Sf(s))&&(u=s.getNode()),(Of(s)||Tf(s))&&(u=s.getNode(!0)),!f)return null;var d=f.left;if((o=sy(l,d))&&vy(o.node))return i=Math.abs(d-o.left),a=Math.abs(d-o.right),my(t,e,o.node,i<a,!0);if(u){var m=function(t,e,n,r){var o,i,a,u,s,c=Dc(e),l=[],f=0,d=function(t){return xt(t.getClientRects())};1===t?(o=c.next,i=eu,a=tu,u=Fu.after(r)):(o=c.prev,i=tu,a=eu,u=Fu.before(r));var m=d(u);do{if(u.isVisible()&&!a(s=d(u),m)){if(l.length>0&&i(s,xt(l))&&f++,(s=Ja(s)).position=u,s.line=f,n(s))return l;l.push(s)}}while(u=o(u));return l}(t,e.getBody(),ty(1),u);if(o=sy(U(m,ey(1)),d))return gy(e,o.position.toRange(),!0);if(o=xt(U(m,ey(0))))return gy(e,o.position.toRange(),!0)}},wy=function(t,e,n){var r,o,i=Dc(t.getBody()),a=h(hc,i.next),u=h(hc,i.prev);if(n.collapsed&&function(t){return""!==ls(t)}(t)){if(!(r=t.dom.getParent(n.startContainer,"PRE")))return;(1===e?a(Fu.fromRangeStart(n)):u(Fu.fromRangeStart(n)))||(o=function(t){var e=t.dom.create(ls(t));return(!ne.ie||ne.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e}(t),1===e?t.$(r).after(o):t.$(r).before(o),t.selection.select(o,!0),t.selection.collapse())}},Cy=function(t,e){return function(){var n=function(t,e){var n,r=Dc(t.getBody()),o=h(hc,r.next),i=h(hc,r.prev),a=e?Lu.Forwards:Lu.Backwards,u=e?o:i,s=t.selection.getRng();return(n=yy(a,t,u,s))?n:(n=wy(t,a,s))||null}(t,e);return!!n&&(t.selection.setRng(n),!0)}},_y=function(t,e){return function(){var n=function(t,e){var n,r=e?1:-1,o=e?Zb:Qb,i=t.selection.getRng();return(n=xy(r,t,o,i))?n:(n=wy(t,r,i))||null}(t,e);return!!n&&(t.selection.setRng(n),!0)}},ky=function(t,e){return function(){var n=e?Fu.fromRangeEnd(t.selection.getRng()):Fu.fromRangeStart(t.selection.getRng()),r=e?Wb(t.getBody(),n):Ub(t.getBody(),n);return(e?Z(r.positions):Q(r.positions)).filter(function(t){return function(e){return t?Of(e):Df(e)}}(e)).fold(d(!1),(function(e){return t.selection.setRng(e.toRange()),!0}))}},Sy=function(t,e,n,r,o){var i=ma(ce.fromDom(n),"td,th,caption").map((function(t){return t.dom()}));return function(t,e,n){return q(t,(function(t,r){return t.fold((function(){return C.some(r)}),(function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return C.some(i<o?r:t)}))}),C.none())}(U(function(t,e){return G(e,(function(e){var n=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+2*e,bottom:t.bottom+2*e,width:t.width+e,height:t.height+e}}(Ja(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]}))}(t,i),(function(t){return e(t,o)})),r,o).map((function(t){return t.cell}))},Ty=h(Sy,(function(t){return t.bottom}),(function(t,e){return t.y<e})),Dy=h(Sy,(function(t){return t.top}),(function(t,e){return t.y>e})),Oy=function(t,e){return Q(e.getClientRects()).bind((function(e){return Ty(t,e.left,e.top)})).bind((function(t){return zb(Hc(n=t).map((function(t){return Ub(n,t).positions.concat(t)})).getOr([]),e);var n}))},Ey=function(t,e){return Z(e.getClientRects()).bind((function(e){return Dy(t,e.left,e.top)})).bind((function(t){return zb(Fc(n=t).map((function(t){return[t].concat(Wb(n,t).positions)})).getOr([]),e);var n}))},Ny=function(t,e){t.selection.setRng(e),gg(t,e)},Ay=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===kv.Wrap&&0===t.positions.length}(r)||!bn(n.getNode())&&function(t){return t.breakType===kv.Br&&1===t.positions.length}(r)?!function(t,e,n){return n.breakAt.map((function(n){return t(e,n).breakAt.isSome()})).getOr(!1)}(t,e,r):r.breakAt.isNone()},Ry=h(Ay,Ub),By=h(Ay,Wb),Py=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;if(Ws()&&function(t,e,n){var r=Fu.fromRangeStart(e);return Ic(!t,n).map((function(t){return t.isEqual(r)})).getOr(!1)}(e,o,n)){var a=my(i,t,n,!e,!0);return Ny(t,a),!0}return!1},Iy=function(t,e){var n=e.getNode(t);return an(n)&&"TABLE"===n.nodeName?C.some(n):C.none()},My=function(t,e,n){var r=Iy(!!e,n),o=!1===e;r.fold((function(){return Ny(t,n.toRange())}),(function(r){return Ic(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return Ny(t,n.toRange())}),(function(o){return function(t,e,n,r){var o=ls(e);o?e.undoManager.transact((function(){var r=ce.fromTag(o);kn(r,fs(e)),ze(r,ce.fromTag("br")),t?je(ce.fromDom(n),r):He(ce.fromDom(n),r);var i=e.dom.createRng();i.setStart(r.dom(),0),i.setEnd(r.dom(),0),Ny(e,i)})):Ny(e,r.toRange())}(e,t,r,n)}))}))},Ly=function(t,e,n,r){var o=t.selection.getRng(),i=Fu.fromRangeStart(o),a=t.getBody();if(!e&&Ry(r,i)){var u=function(t,e,n){return Oy(e,n).orThunk((function(){return Q(n.getClientRects()).bind((function(n){return Vb(qb(t,Fu.before(e)),n.left)}))})).getOr(Fu.before(e))}(a,n,i);return My(t,e,u),!0}if(e&&By(r,i)){u=function(t,e,n){return Ey(e,n).orThunk((function(){return Q(n.getClientRects()).bind((function(n){return Vb($b(t,Fu.after(e)),n.left)}))})).getOr(Fu.after(e))}(a,n,i);return My(t,e,u),!0}return!1},Fy=function(t,e){return function(){return C.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(n){return C.from(t.dom.getParent(n,"table")).map((function(n){return Py(t,e,n)}))})).getOr(!1)}},Hy=function(t,e){return function(){return C.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(n){return C.from(t.dom.getParent(n,"table")).map((function(r){return Ly(t,e,r,n)}))})).getOr(!1)}},jy=function(t){return F(["figcaption"],le(t))},Vy=function(t){var e=n.document.createRange();return e.setStartBefore(t.dom()),e.setEndBefore(t.dom()),e},zy=function(t,e,n){n?ze(t,e):Ve(t,e)},Uy=function(t,e,n,r){return""===e?function(t,e){var n=ce.fromTag("br");return zy(t,n,e),Vy(n)}(t,r):function(t,e,n,r){var o=ce.fromTag(n),i=ce.fromTag("br");return kn(o,r),ze(o,i),zy(t,o,e),Vy(i)}(t,r,e,n)},Wy=function(t,e,n){return e?function(t,e){return Wb(t,e).breakAt.isNone()}(t.dom(),n):function(t,e){return Ub(t,e).breakAt.isNone()}(t.dom(),n)},qy=function(t,e){var n=ce.fromDom(t.getBody()),r=Fu.fromRangeStart(t.selection.getRng()),o=ls(t),i=fs(t);return function(t,e){var n=h(xe,e);return ga(ce.fromDom(t.container()),Mn,n).filter(jy)}(r,n).exists((function(){if(Wy(n,e,r)){var a=Uy(n,o,i,e);return t.selection.setRng(a),!0}return!1}))},$y=function(t,e){return function(){return!!t.selection.isCollapsed()&&qy(t,e)}},Yy=function(t,e){return G(function(t){return j(t,(function(t){return wt({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:l},t)}))}(t),(function(t){return function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey}(t,e)?[t]:[]}))},Gy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},Ky=function(t,e){return $(Yy(t,e),(function(t){return t.action()}))},Xy=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=Yt().os;Ky([{keyCode:Hg.RIGHT,action:Cy(t,!0)},{keyCode:Hg.LEFT,action:Cy(t,!1)},{keyCode:Hg.UP,action:_y(t,!1)},{keyCode:Hg.DOWN,action:_y(t,!0)},{keyCode:Hg.RIGHT,action:Fy(t,!0)},{keyCode:Hg.LEFT,action:Fy(t,!1)},{keyCode:Hg.UP,action:Hy(t,!1)},{keyCode:Hg.DOWN,action:Hy(t,!0)},{keyCode:Hg.RIGHT,action:Nb(t,e,!0)},{keyCode:Hg.LEFT,action:Nb(t,e,!1)},{keyCode:Hg.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:Bb(t,e)},{keyCode:Hg.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:Pb(t,e)},{keyCode:Hg.UP,action:$y(t,!1)},{keyCode:Hg.DOWN,action:$y(t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},Jy=function(t,e){return Ce(t,e)?ga(e,(function(t){return Hn(t)||Vn(t)}),function(t){return function(e){return xe(t,ce.fromDom(e.dom().parentNode))}}(t)):C.none()},Qy=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)}(t))},Zy=function(t,e){return{from:t,to:e}},tx=function(t,e){var n=ce.fromDom(t),r=ce.fromDom(e.container());return Jy(n,r).map((function(t){return function(t,e){return{block:t,position:e}}(t,e)}))},ex=function(t,e,n){var r=tx(t,Fu.fromRangeStart(n)),o=r.bind((function(n){return Rc(e,t,n.position).bind((function(n){return tx(t,n).map((function(n){return function(t,e,n){return bn(n.position.getNode())&&!1===Pf(n.block)?Ic(!1,n.block.dom()).bind((function(r){return r.isEqual(n.position)?Rc(e,t,r).bind((function(e){return tx(t,e)})):C.some(n)})).getOr(n):n}(t,e,n)}))}))}));return Ka(r,o,Zy).filter((function(t){return function(t){return!1===xe(t.from.block,t.to.block)}(t)&&function(t){return Te(t.from.block).bind((function(e){return Te(t.to.block).filter((function(t){return xe(e,t)}))})).isSome()}(t)&&function(t){return!1===xn(t.from.block.dom())&&!1===xn(t.to.block.dom())}(t)}))},nx=function(t){var e=Ae(t);return Y(e,Mn).fold((function(){return e}),(function(t){return e.slice(0,t)}))},rx=function(t){var e=nx(t);return V(e,qe),e},ox=function(t,e){var n=jf(e,t);return $(n.reverse(),(function(t){return Pf(t)})).each(qe)},ix=function(t,e,n,r){if(Pf(n))return Mf(n),Fc(n.dom());0===U(Ee(r),(function(t){return!Pf(t)})).length&&Pf(e)&&He(r,ce.fromTag("br"));var o=Lc(n.dom(),Fu.before(r.dom()));return V(rx(e),(function(t){He(r,t)})),ox(t,e),o},ax=function(t,e,n){if(Pf(n))return qe(n),Pf(e)&&Mf(e),Fc(e.dom());var r=Hc(n.dom());return V(rx(e),(function(t){ze(n,t)})),ox(t,e),r},ux=function(t,e){return Ce(e,t)?function(t,e){var n=jf(e,t);return C.from(n[n.length-1])}(e,t):C.none()},sx=function(t,e){Ic(t,e.dom()).map((function(t){return t.getNode()})).map(ce.fromDom).filter(Fn).each(qe)},cx=function(t,e,n){return sx(!0,e),sx(!1,n),ux(e,n).fold(h(ax,t,e,n),h(ix,t,e,n))},lx=function(t,e,n,r){return e?cx(t,r,n):cx(t,n,r)},fx=function(t,e){var n=ce.fromDom(t.getBody()),r=function(t,e,n){return n.collapsed?ex(t,e,n):C.none()}(n.dom(),e,t.selection.getRng()).bind((function(t){return lx(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},dx=function(t,e){var n=ce.fromDom(e),r=h(xe,t);return pa(n,Wn,r).isSome()},mx=function(t,e){var n=Lc(t.dom(),Fu.fromRangeStart(e)).isNone(),r=Mc(t.dom(),Fu.fromRangeEnd(e)).isNone();return!function(t,e){return dx(t,e.startContainer)||dx(t,e.endContainer)}(t,e)&&n&&r},hx=function(t){var e=ce.fromDom(t.getBody()),n=t.selection.getRng();return mx(e,n)?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return Ka(Jy(t,ce.fromDom(n.startContainer)),Jy(t,ce.fromDom(n.endContainer)),(function(r,o){return!1===xe(r,o)&&(n.deleteContents(),lx(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)}(e,t.selection)},px=function(t,e){return!t.selection.isCollapsed()&&hx(t)},gx=function(t){return mc(t).exists(Fn)},vx=function(t,e,n){var r=U(jf(ce.fromDom(n.container()),e),Mn),o=Q(r).getOr(e);return Rc(t,o.dom(),n).filter(gx)},bx=function(t,e){return mc(e).exists(Fn)||vx(!0,t,e).isSome()},yx=function(t,e){return function(t){return C.from(t.getNode(!0)).map(ce.fromDom)}(e).exists(Fn)||vx(!1,t,e).isSome()},xx=h(vx,!1),wx=h(vx,!0),Cx=Oi([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),_x=function(t,e,n,r){var o=r.getNode(!1===e);return Jy(ce.fromDom(t),ce.fromDom(n.getNode())).map((function(t){return Pf(t)?Cx.remove(t.dom()):Cx.moveToElement(o)})).orThunk((function(){return C.some(Cx.moveToElement(o))}))},kx=function(t,e,n){return Rc(e,t,n).bind((function(r){return o=r.getNode(),Wn(ce.fromDom(o))||Vn(ce.fromDom(o))||function(t,e,n,r){var o=function(e){return Ln(ce.fromDom(e))&&!rc(n,r,t)};return fc(!e,n).fold((function(){return fc(e,r).fold(d(!1),o)}),o)}(t,e,n,r)?C.none():e&&xn(r.getNode())||!1===e&&xn(r.getNode(!0))?_x(t,e,n,r):e&&Of(n)||!1===e&&Df(n)?C.some(Cx.moveToPosition(r)):C.none();var o}))},Sx=function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return an(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&xn(e.nextSibling)?C.some(Cx.moveToElement(e.nextSibling)):!1===t&&xn(e.previousSibling)?C.some(Cx.moveToElement(e.previousSibling)):C.none()}(e,n.getNode(!1===e)).fold((function(){return kx(t,e,n)}),C.some):kx(t,e,n).bind((function(e){return function(t,e,n){return n.fold((function(t){return C.some(Cx.remove(t))}),(function(t){return C.some(Cx.moveToElement(t))}),(function(n){return rc(e,n,t)?C.none():C.some(Cx.moveToPosition(n))}))}(t,n,e)}))},Tx=function(t,e){return C.from(Ex(t.getBody(),e))},Dx=function(t,e){var n=t.selection.getNode();return Tx(t,n).filter(xn).fold((function(){return function(t,e,n){var r=lc(e?1:-1,t,n),o=Fu.fromRangeStart(r),i=ce.fromDom(t);return!1===e&&Of(o)?C.some(Cx.remove(o.getNode(!0))):e&&Df(o)?C.some(Cx.remove(o.getNode())):!1===e&&Df(o)&&yx(i,o)?xx(i,o).map((function(t){return Cx.remove(t.getNode())})):e&&Of(o)&&bx(i,o)?wx(i,o).map((function(t){return Cx.remove(t.getNode())})):Sx(t,e,o)}(t.getBody(),e,t.selection.getRng()).map((function(n){return n.fold(function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),Zf(t,e,ce.fromDom(n)),!0}}(t,e),function(t,e){return function(n){var r=e?Fu.before(n):Fu.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))})).getOr(!1)}),(function(){return!0}))},Ox=function(t,e){var n=t.selection.getNode();return!!xn(n)&&Tx(t,n.parentNode).filter(xn).fold((function(){var n;return n=ce.fromDom(t.getBody()),V(ma(n,".mce-offscreen-selection"),qe),Zf(t,e,ce.fromDom(t.selection.getNode())),Qy(t),!0}),(function(){return!0}))},Ex=function(t,e){for(;e&&e!==t;){if(yn(e)||xn(e))return e;e=e.parentNode}return null},Nx=function(t){var e,n=Ex(t.getBody(),t.selection.getNode());return yn(n)&&t.dom.isBlock(n)&&t.dom.isEmpty(n)&&(e=t.dom.create("br",{"data-mce-bogus":"1"}),t.dom.setHTML(n,""),n.appendChild(e),t.selection.setRng(Fu.before(e).toRange())),!0},Ax=function(t,e){return t.selection.isCollapsed()?Dx(t,e):Ox(t,e)},Rx=function(t,e,n,r,o,i){var a=my(r,t,i.getNode(!o),o,!0);if(e.collapsed){var u=e.cloneRange();o?u.setEnd(a.startContainer,a.startOffset):u.setStart(a.endContainer,a.endOffset),u.deleteContents()}else e.deleteContents();return t.selection.setRng(a),function(t,e){hn(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},Bx=function(t,e){return function(t,e){var n=t.selection.getRng();if(!hn(n.commonAncestorContainer))return!1;var r=e?Lu.Forwards:Lu.Backwards,o=Dc(t.getBody()),i=h(hc,o.next),a=h(hc,o.prev),u=e?i:a,s=e?Df:Of,c=dc(r,t.getBody(),n),l=ob(e,u(c));if(!l||!pc(c,l))return!1;if(s(l))return Rx(t,n,c.getNode(),r,e,l);var f=u(l);return!!(f&&s(f)&&pc(l,f))&&Rx(t,n,c.getNode(),r,e,f)}(t,e)},Px=function(t,e){return function(n){return Zv(e,n).map((function(e){return Tb(t,e),!0})).getOr(!1)}},Ix=function(t,e,r,o){var i=t.getBody(),a=h(eb,t);t.undoManager.ignore((function(){t.selection.setRng(function(t,e){var r=n.document.createRange();return r.setStart(t.container(),t.offset()),r.setEnd(e.container(),e.offset()),r}(r,o)),t.execCommand("Delete"),vb(a,i,Fu.fromRangeStart(t.selection.getRng())).map(wb).map(Px(t,e))})),t.nodeChanged()},Mx=function(t,e,n,r){var o=function(t,e){var n=nc(e,t);return n||t}(t.getBody(),r.container()),i=h(eb,t),a=vb(i,o,r);return a.bind((function(t){return n?t.fold(d(C.some(wb(t))),C.none,d(C.some(xb(t))),C.none):t.fold(C.none,d(C.some(xb(t))),C.none,d(C.some(wb(t))))})).map(Px(t,e)).getOrThunk((function(){var u=Bc(n,o,r),s=u.bind((function(t){return vb(i,o,t)}));return a.isSome()&&s.isSome()?rb(i,o,r).map((function(e){return!!function(t){return Ka(Fc(t),Hc(t),(function(e,n){var r=ob(!0,e),o=ob(!1,n);return Mc(t,r).map((function(t){return t.isEqual(o)})).getOr(!0)})).getOr(!0)}(e)&&(Zf(t,n,ce.fromDom(e)),!0)})).getOr(!1):s.bind((function(o){return u.map((function(o){return n?Ix(t,e,r,o):Ix(t,e,o,r),!0}))})).getOr(!1)}))},Lx=function(t,e,n){if(t.selection.isCollapsed()&&Ds(t)){var r=Fu.fromRangeStart(t.selection.getRng());return Mx(t,e,n,r)}return!1},Fx=function(t){return 1===Ae(t).length},Hx=function(t,e,n,r){var o=h(Wm,e),i=j(U(r,o),(function(t){return t.dom()}));if(0===i.length)Zf(e,t,n);else{var a=function(t,e){var n=Lm(!1),r=Vm(e,n.dom());return He(ce.fromDom(t),n),qe(ce.fromDom(t)),Fu(r,0)}(n.dom(),i);e.selection.setRng(a.toRange())}},jx=function(t,e){var n=ce.fromDom(t.getBody()),r=ce.fromDom(t.selection.getStart()),o=U(function(t,e){var n=jf(e,t);return Y(n,Mn).fold(d(n),(function(t){return n.slice(0,t)}))}(n,r),Fx);return Z(o).map((function(n){var r,i=Fu.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return Ka(Fc(n),Hc(n),(function(r,o){var i=ob(!0,r),a=ob(!1,o),u=ob(!1,e);return t?Mc(n,u).map((function(t){return t.isEqual(a)&&e.isEqual(i)})).getOr(!1):Lc(n,u).map((function(t){return t.isEqual(i)&&e.isEqual(a)})).getOr(!1)})).getOr(!0)}(e,i,n.dom())||(r=n,jc(r.dom())&&Im(r.dom())))&&(Hx(e,t,n,o),!0)})).getOr(!1)},Vx=function(t,e){return!!t.selection.isCollapsed()&&jx(t,e)},zx=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=Fu.fromRangeStart(t.selection.getRng());return Rc(e,t.getBody(),n).filter((function(t){return e?_f(t):kf(t)})).bind((function(t){return C.from(oc(e?0:-1,t))})).map((function(e){return t.selection.select(e),!0})).getOr(!1)}(t,e)},Ux=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},Wx=function(t,e){return(t||"table"===le(e)?"margin":"padding")+("rtl"===Dn(e,"direction")?"-right":"-left")},qx=function(t){var e=Yx(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return K(e,(function(e){var n=Wx(Cs(t),e),r=En(e,n).map(Ux).getOr(0);return"false"!==t.dom.getContentEditable(e.dom())&&r>0}))}(t,e))},$x=function(t){return jn(t)||Vn(t)},Yx=function(t){return U(j(t.selection.getSelectedBlocks(),ce.fromDom),(function(t){return!$x(t)&&!function(t){return Te(t).map($x).getOr(!1)}(t)&&ga(t,(function(t){return yn(t.dom())||xn(t.dom())})).exists((function(t){return yn(t.dom())}))}))},Gx=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=function(t){return t.getParam("indentation","40px","string")}(t),a=/[a-z%]+$/i.exec(i)[0],u=parseInt(i,10),s=Cs(t),c=ls(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==c||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),V(Yx(t),(function(t){!function(t,e,n,r,o,i){var a=Wx(n,ce.fromDom(i));if("outdent"===e){var u=Math.max(0,Ux(i.style[a])-r);t.setStyle(i,a,u?u+o:"")}else{u=Ux(i.style[a])+r+o;t.setStyle(i,a,u)}}(n,e,s,u,a,t.dom())}))},Kx=function(t,e,n){return Pc(t,e,n,yf)},Xx=function(t,e){return $(jf(ce.fromDom(e.container()),t),Mn)},Jx=function(t,e,n){return Kx(t,e.dom(),n).forall((function(t){return Xx(e,n).fold((function(){return!1===rc(t,n,e.dom())}),(function(r){return!1===rc(t,n,e.dom())&&Ce(r,ce.fromDom(t.container()))}))}))},Qx=function(t,e,n){return Xx(e,n).fold((function(){return Kx(t,e.dom(),n).forall((function(t){return!1===rc(t,n,e.dom())}))}),(function(e){return Kx(t,e.dom(),n).isNone()}))},Zx=h(Qx,!1),tw=h(Qx,!0),ew=h(Jx,!1),nw=h(Jx,!0),rw=function(t,e,n){if(t.selection.isCollapsed()&&qx(t)){var r=t.dom,o=t.selection.getRng(),i=Fu.fromRangeStart(o),a=r.getParent(o.startContainer,r.isBlock);if(null!==a&&Zx(ce.fromDom(a),i))return Gx(t,"outdent"),!0}return!1},ow=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){Ky([{keyCode:Hg.BACKSPACE,action:Gy(rw,t,!1)},{keyCode:Hg.BACKSPACE,action:Gy(Ax,t,!1)},{keyCode:Hg.DELETE,action:Gy(Ax,t,!0)},{keyCode:Hg.BACKSPACE,action:Gy(Bx,t,!1)},{keyCode:Hg.DELETE,action:Gy(Bx,t,!0)},{keyCode:Hg.BACKSPACE,action:Gy(Lx,t,e,!1)},{keyCode:Hg.DELETE,action:Gy(Lx,t,e,!0)},{keyCode:Hg.BACKSPACE,action:Gy(Td,t,!1)},{keyCode:Hg.DELETE,action:Gy(Td,t,!0)},{keyCode:Hg.BACKSPACE,action:Gy(zx,t,!1)},{keyCode:Hg.DELETE,action:Gy(zx,t,!0)},{keyCode:Hg.BACKSPACE,action:Gy(px,t,!1)},{keyCode:Hg.DELETE,action:Gy(px,t,!0)},{keyCode:Hg.BACKSPACE,action:Gy(fx,t,!1)},{keyCode:Hg.DELETE,action:Gy(fx,t,!0)},{keyCode:Hg.BACKSPACE,action:Gy(Vx,t,!1)},{keyCode:Hg.DELETE,action:Gy(Vx,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ky([{keyCode:Hg.BACKSPACE,action:Gy(Nx,t)},{keyCode:Hg.DELETE,action:Gy(Nx,t)}],e)}(t,e)}))},iw=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var a=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild);a&&/^(UL|OL|DL)$/.test(a.nodeName)&&e.insertBefore(o.doc.createTextNode(" "),e.firstChild)}var u=o.createRng();if(e.normalize(),e.hasChildNodes()){for(var s=new hi(e,e);n=s.current();){if(hn(n)){u.setStart(n,0),u.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}r=n,n=s.next()}n||(u.setStart(r,0),u.setEnd(r,0))}else bn(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(u.setStartBefore(e),u.setEndBefore(e)):(u.setStartAfter(e),u.setEndAfter(e)):(u.setStart(e,0),u.setEnd(e,0));t.selection.setRng(u),gg(t,u)}},aw=function(t){return C.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},uw=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},sw=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},cw=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},lw=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!an(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},fw=function(t,e,n,r,o){var i=t.dom,a=t.selection.getRng();if(n!==t.getBody()){var u;sw(u=n)&&sw(u.parentNode)&&(o="LI");var s=o?e(o):i.create("BR");if(lw(n,r,!0)&&lw(n,r,!1))uw(n,"LI")?i.insertAfter(s,cw(n)):i.replace(s,n);else if(lw(n,r,!0))uw(n,"LI")?(i.insertAfter(s,cw(n)),s.appendChild(i.doc.createTextNode(" ")),s.appendChild(n)):n.parentNode.insertBefore(s,n);else if(lw(n,r,!1))i.insertAfter(s,cw(n));else{n=cw(n);var c=a.cloneRange();c.setStartAfter(r),c.setEndAfter(n);var l=c.extractContents();"LI"===o&&function(t,e){return t.firstChild&&t.firstChild.nodeName===e}(l,"LI")?(s=l.firstChild,i.insertAfter(l,n)):(i.insertAfter(l,n),i.insertAfter(s,n))}i.remove(r),iw(t,s)}},dw=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},mw=function(t){t.innerHTML='<br data-mce-bogus="1">'},hw=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},pw=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},gw=function(t,e,n){return!1===hn(e)?n:t?1===n&&"\ufeff"===e.data.charAt(n-1)?0:n:n===e.data.length-1&&"\ufeff"===e.data.charAt(n)?e.data.length:n},vw=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},bw=function(t,e,n){C.from(n.style).map(t.dom.parseStyle).each((function(n){var r=function(t){var e={},n=t.dom();if(wn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e}(ce.fromDom(e)),o=wt(wt({},r),n);t.dom.setStyles(e,o)}));var r=C.from(n.class).map((function(t){return t.split(/\s+/)})),o=C.from(e.className).map((function(t){return U(t.split(/\s+/),(function(t){return""!==t}))}));Ka(r,o,(function(n,r){var o=U(r,(function(t){return!F(n,t)})),i=Ct(n,o);t.dom.setAttrib(e,"class",i.join(" "))}));var i=["style","class"],a=ct(n,(function(t,e){return!F(i,e)}));t.dom.setAttribs(e,a)},yw=function(t,e){var n=ls(t);if(n&&n.toLowerCase()===e.tagName.toLowerCase()){var r=fs(t);bw(t,e,r)}},xw=function(t,e){var n,r,o,i,a,u,s,c,l,f,d=t.dom,m=t.schema,h=m.getNonEmptyElements(),p=t.selection.getRng(),g=function(e){var n,o,a,u=r,s=m.getTextInlineElements();if(a=n=e||"TABLE"===c||"HR"===c?d.create(e||l):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(s[u.nodeName]){if(jc(u)||Jc(u))continue;o=u.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(a=o,n.appendChild(o))}}while((u=u.parentNode)&&u!==w);return yw(t,n),mw(a),n},v=function(t){var e,n,a=gw(t,r,o);if(hn(r)&&(t?a>0:a<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&an(r)&&r===i.firstChild)return!0;if(hw(r,"TABLE")||hw(r,"HR"))return f&&!t||!f&&t;var u=new hi(r,i);for(hn(r)&&(t&&0===a?u.prev():t||a!==r.nodeValue.length||u.next());e=u.current();){if(an(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),h[n]&&"br"!==n))return!1}else if(hn(e)&&!/^[ \t\r\n]*$/.test(e.nodeValue))return!1;t?u.prev():u.next()}return!0},b=function(){a=/^(H[1-6]|PRE|FIGURE)$/.test(c)&&"HGROUP"!==C?g(l):g(),function(t){return t.getParam("end_container_on_empty_block",!1)}(t)&&pw(d,s)&&d.isEmpty(i)?a=d.split(s,i):d.insertAfter(a,i),iw(t,a)};Bg(d,p).each((function(t){p.setStart(t.startContainer,t.startOffset),p.setEnd(t.endContainer,t.endOffset)})),r=p.startContainer,o=p.startOffset,l=ls(t);var y=!(!e||!e.shiftKey),x=!(!e||!e.ctrlKey);an(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&hn(r)?r.nodeValue.length:0);var w=vw(d,r);if(w){(l&&!y||!l&&y)&&(r=function(t,e,n,r,o){var i,a,u,s,c,l,f=e||"P",d=t.dom,m=vw(d,r);if(!(a=d.getParent(r,d.isBlock))||!pw(d,a)){if(l=(a=a||m)===t.getBody()||function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)}(a)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=d.create(f),yw(t,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&&t.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),yw(t,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}(t,l,p,r,o)),i=d.getParent(r,d.isBlock),s=i?d.getParent(i.parentNode,d.isBlock):null,c=i?i.nodeName.toUpperCase():"";var C=s?s.nodeName.toUpperCase():"";"LI"!==C||x||(i=s,s=s.parentNode,c=C),/^(LI|DT|DD)$/.test(c)&&d.isEmpty(i)?fw(t,g,s,i,l):l&&i===t.getBody()||(l=l||"P",Ha(i)?(a=Ga(i),d.isEmpty(i)&&mw(i),yw(t,a),iw(t,a)):v()?b():v(!0)?(a=i.parentNode.insertBefore(g(),i),iw(t,hw(i,"HR")?a:i)):((n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,gw(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,gw(!1,t.endContainer,t.endOffset)),e}(p).cloneRange()).setEndAfter(i),function(t){V(da(ce.fromDom(t),he),(function(t){var e=t.dom();e.nodeValue=Ma(e.nodeValue)}))}(u=n.extractContents()),function(t){do{hn(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)}(u),a=u.firstChild,d.insertAfter(u,i),function(t,e,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;an(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)(!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||dw(t,o))&&t.remove(o)}}(d,h,a),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(d,i),d.isEmpty(i)&&mw(i),a.normalize(),d.isEmpty(a)?(d.remove(a),b()):(yw(t,a),iw(t,a))),d.setAttrib(a,"id",""),t.fire("NewBlock",{newBlock:a}))}},ww=function(t,e,n){var r=t.create("span",{}," ");n.parentNode.insertBefore(r,n),e.scrollIntoView(r),t.remove(r)},Cw=function(t,e,n,r){var o=t.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),e.setRng(o)},_w=function(t,e){var n,r,o=t.selection,i=t.dom,a=o.getRng();Bg(i,a).each((function(t){a.setStart(t.startContainer,t.startOffset),a.setEnd(t.endContainer,t.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=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(t,e,n){for(var r,o=new hi(e,n),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(t.schema,s,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),ju(i,a,n),ww(i,o,n),Cw(i,o,n,r),t.undoManager.add()},kw=function(t,e){var n=ce.fromTag("br");He(ce.fromDom(e),n),t.undoManager.add()},Sw=function(t,e){Tw(t.getBody(),e)||je(ce.fromDom(e),ce.fromTag("br"));var n=ce.fromTag("br");je(ce.fromDom(e),n),ww(t.dom,t.selection,n.dom()),Cw(t.dom,t.selection,n.dom(),!1),t.undoManager.add()},Tw=function(t,e){return n=Fu.after(e),!!bn(n.getNode())||Mc(t,Fu.after(e)).map((function(t){return bn(t.getNode())})).getOr(!1);var n},Dw=function(t){return t&&"A"===t.nodeName&&"href"in t},Ow=function(t){return t.fold(d(!1),Dw,Dw,d(!1))},Ew=function(t,e){e.fold(l,h(kw,t),h(Sw,t),l)},Nw=function(t,e){var n=function(t){var e=h(eb,t),n=Fu.fromRangeStart(t.selection.getRng());return vb(e,t.getBody(),n).filter(Ow)}(t);n.isSome()?n.each(h(Ew,t)):_w(t,e)},Aw=function(t,e){return aw(t).filter((function(t){return e.length>0&&be(ce.fromDom(t),e)})).isSome()},Rw=Oi([{br:[]},{block:[]},{none:[]}]),Bw=function(t,e){return function(t){return Aw(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},Pw=function(t){return function(e,n){return""===ls(e)===t}},Iw=function(t){return function(e,n){return function(t){return aw(t).filter((function(t){return Vn(ce.fromDom(t))})).isSome()}(e)===t}},Mw=function(t,e){return function(n,r){return function(t){return aw(t).fold(d(""),(function(t){return t.nodeName.toUpperCase()}))}(n)===t.toUpperCase()===e}},Lw=function(t){return Mw("pre",t)},Fw=function(t){return function(e,n){return function(t){return t.getParam("br_in_pre",!0)}(e)===t}},Hw=function(t,e){return function(t){return Aw(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},jw=function(t,e){return e},Vw=function(t){var e=ls(t),n=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},zw=function(t,e){return function(n,r){return q(t,(function(t,e){return t&&e(n,r)}),!0)?C.some(e):C.none()}},Uw=function(t,e){(function(t,e){return ub([zw([Bw],Rw.none()),zw([Mw("summary",!0)],Rw.br()),zw([Lw(!0),Fw(!1),jw],Rw.br()),zw([Lw(!0),Fw(!1)],Rw.block()),zw([Lw(!0),Fw(!0),jw],Rw.block()),zw([Lw(!0),Fw(!0)],Rw.br()),zw([Iw(!0),jw],Rw.br()),zw([Iw(!0)],Rw.block()),zw([Pw(!0),jw,Vw],Rw.block()),zw([Pw(!0)],Rw.br()),zw([Hw],Rw.br()),zw([Pw(!1),jw],Rw.br()),zw([Vw],Rw.block())],[t,!(!e||!e.shiftKey)]).getOr(Rw.none())})(t,e).fold((function(){Nw(t,e)}),(function(){xw(t,e)}),l)},Ww=function(t){t.on("keydown",(function(e){e.keyCode===Hg.ENTER&&function(t,e){var n;e.isDefaultPrevented()||(e.preventDefault(),(n=t.undoManager).typing&&(n.typing=!1,n.add()),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),Uw(t,e)})))}(t,e)}))},qw=function(t,e){var n=e.container(),r=e.offset();return hn(n)?(n.insertData(r,t),C.some(Mu(n,r+t.length))):mc(e).map((function(n){var r=ce.fromText(t);return e.isAtEnd()?je(n,r):He(n,r),Mu(r.dom(),t.length)}))},$w=h(qw," "),Yw=h(qw," "),Gw=function(t){return Mu.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},Kw=function(t,e){var n=U(jf(ce.fromDom(e.container()),t),Mn);return Q(n).getOr(t)},Xw=function(t,e){return Gw(e)?bf(e):bf(e)||Lc(Kw(t,e).dom(),e).exists(bf)},Jw=function(t,e){return Gw(e)?vf(e):vf(e)||Mc(Kw(t,e).dom(),e).exists(vf)},Qw=function(t){return mc(t).bind((function(t){return ga(t,me)})).exists((function(t){return function(t){return F(["pre","pre-wrap"],t)}(Dn(t,"white-space"))}))},Zw=function(t,e){return function(t,e){return Lc(t.dom(),e).isNone()}(t,e)||function(t,e){return Mc(t.dom(),e).isNone()}(t,e)||Zx(t,e)||tw(t,e)||yx(t,e)||bx(t,e)},tC=function(t,e){var n=function(t){var e=t.container(),n=t.offset();return hn(e)&&n<e.data.length?Mu(e,n+1):t}(e);return!Qw(n)&&(tw(t,n)||nw(t,n)||bx(t,n)||Jw(t,n))},eC=function(t,e){return function(t,e){return!Qw(e)&&(Zx(t,e)||ew(t,e)||yx(t,e)||Xw(t,e))}(t,e)||tC(t,e)},nC=function(t,e){return Qc(t.charAt(e))},rC=function(t){var e=t.container();return hn(e)&&Bt(e.data," ")},oC=function(t){var e=t.data,n=function(t){var e=t.split("");return j(e,(function(t,n){return Qc(t)&&n>0&&n<e.length-1&&tl(e[n-1])&&tl(e[n+1])?" ":t})).join("")}(e);return n!==e&&(t.data=n,!0)},iC=function(t,e){return C.some(e).filter(rC).bind((function(e){var n=e.container();return function(t,e){var n=e.data,r=Mu(e,0);return!(!nC(n,0)||eC(t,r))&&(e.data=" "+n.slice(1),!0)}(t,n)||oC(n)||function(t,e){var n=e.data,r=Mu(e,n.length-1);return!(!nC(n,n.length-1)||eC(t,r))&&(e.data=n.slice(0,-1)+" ",!0)}(t,n)?C.some(e):C.none()}))},aC=function(t){var e=ce.fromDom(t.getBody());t.selection.isCollapsed()&&iC(e,Mu.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},uC=function(t,e){return function(n){return function(t,e){return!Qw(e)&&(Zw(t,e)||Xw(t,e)||Jw(t,e))}(t,n)?$w(e):Yw(e)}},sC=function(t){var e=Fu.fromRangeStart(t.selection.getRng()),n=ce.fromDom(t.getBody());if(t.selection.isCollapsed()){var r=h(eb,t),o=Fu.fromRangeStart(t.selection.getRng());return vb(r,t.getBody(),o).bind(function(t){return function(e){return e.fold((function(e){return Lc(t.dom(),Fu.before(e))}),(function(t){return Fc(t)}),(function(t){return Hc(t)}),(function(e){return Mc(t.dom(),Fu.after(e))}))}}(n)).bind(uC(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},cC=function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ky([{keyCode:Hg.SPACEBAR,action:Gy(sC,t)}],e).each((function(t){e.preventDefault()}))}(t,e)}))},lC=function(t,e){e.hasAttribute("data-mce-caret")&&(Ga(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},fC=function(t,e){var n=function(t){return ba(ce.fromDom(t.getBody()),"*[data-mce-caret]").fold(d(null),(function(t){return t.dom()}))}(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void lC(t,n)):void(za(n)&&(lC(t,n),t.undoManager.add()))},dC=Yt().browser,mC=function(t){!function(t){var e=ra((function(){t.composing||aC(t)}),0);dC.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))}(t),t.on("input",(function(e){!1===e.isComposing&&aC(t)}))},hC=function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){Ky([{keyCode:Hg.END,action:ky(t,!0)},{keyCode:Hg.HOME,action:ky(t,!1)}],e).each((function(t){e.preventDefault()}))}(t,e)}))},pC=function(t){var e=Rb(t);!function(t){t.on("keyup compositionstart",h(fC,t))}(t),Xy(t,e),ow(t,e),Ww(t),cC(t),mC(t),hC(t)},gC=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&kg(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!ne.range&&t.selection.isCollapsed()||Ll(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&Ll(t)&&("IMG"===t.selection.getNode().nodeName?Pi.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){if(t===r)return!0;n.push(t)})),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),vC=function(t){!function(t){t.on("click",(function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}))}(t),function(t){t.parser.addNodeFilter("details",(function(t){V(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),t.serializer.addNodeFilter("details",(function(t){V(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",T(e)?e:null),t.attr("data-mce-open",null)}))}))}(t)},bC=function(t){return an(t)&&Hn(ce.fromDom(t))},yC=function(t){t.on("click",(function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=Mu.fromRangeStart(e),r=Mu.fromRangeEnd(e);if(Mu.isElementPosition(n)){var o=n.container();bC(o)&&Fc(o).each((function(t){return e.setStart(t.container(),t.offset())}))}if(Mu.isElementPosition(r)){o=n.container();bC(o)&&Hc(o).each((function(t){return e.setEnd(t.container(),t.offset())}))}t.selection.setRng(Od(e))}(t)}))},xC=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},wC=function(t,e){return function(t,e,n){return{pageX:n.left-t.left+e.left,pageY:n.top-t.top+e.top}}(function(t){return t.inline?xC(t.getBody()):{left:0,top:0}}(t),function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}}(t),function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=xC(t.getContentAreaContainer()),r=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o}(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}}(t,e))},CC=xn,_C=yn,kC=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},SC=function(t,e){return function(n){if(function(t){return 0===t.button}(n)){var r=$(e.dom.getParents(n.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(CC,_C)).getOr(null);if(u=e.getBody(),CC(s=r)&&s!==u){var o=e.dom.getPos(r),i=e.getBody(),a=e.getDoc().documentElement;t.element=r,t.screenX=n.screenX,t.screenY=n.screenY,t.maxX=(e.inline?i.scrollWidth:a.offsetWidth)-2,t.maxY=(e.inline?i.scrollHeight:a.offsetHeight)-2,t.relX=n.pageX-o.x,t.relY=n.pageY-o.y,t.width=r.offsetWidth,t.height=r.offsetHeight,t.ghost=function(t,e,n,r){var o=e.cloneNode(!0);t.dom.setStyles(o,{width:n,height:r}),t.dom.setAttrib(o,"data-mce-selected",null);var i=t.dom.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return t.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),t.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(e,r,t.width,t.height)}}var u,s}},TC=function(t,e){return function(n){if(t.dragging&&function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!CC(e)}(e,(u=e.selection,3===(s=u.getSel().getRangeAt(0).startContainer).nodeType?s.parentNode:s),t.element)){var r=(i=t.element,(a=i.cloneNode(!0)).removeAttribute("data-mce-selected"),a),o=e.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});o.isDefaultPrevented()||(r=o.targetClone,e.undoManager.transact((function(){kC(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()})))}var i,a,u,s;DC(t)}},DC=function(t){t.dragging=!1,t.element=null,kC(t.ghost)},OC=function(t){var e={},r=qi.DOM,o=n.document,i=SC(e,t),a=function(t,e){var n=Pi.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return function(r){var o,i,a=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(function(t){return t.element}(t)&&!t.dragging&&a>10){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var u=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}}(t,wC(e,r));o=t.ghost,i=e.getBody(),o.parentNode!==i&&i.appendChild(o),function(t,e,n,r,o,i){var a=0,u=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(a=e.pageX+n-o),e.pageY+r>i&&(u=e.pageY+r-i),t.style.width=n-a+"px",t.style.height=r-u+"px"}(t.ghost,u,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}}(e,t),u=TC(e,t),s=function(t,e){return function(){t.dragging&&e.fire("dragend"),DC(t)}}(e,t);t.on("mousedown",i),t.on("mousemove",a),t.on("mouseup",u),r.bind(o,"mousemove",a),r.bind(o,"mouseup",s),t.on("remove",(function(){r.unbind(o,"mousemove",a),r.unbind(o,"mouseup",s)}))},EC=function(t){OC(t),function(t){t.on("drop",(function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(CC(n)||CC(t.dom.getContentEditableParent(n)))&&e.preventDefault()}))}(t),function(t){return t.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var e=function(t){if(!t.defaultPrevented){var e=t.dataTransfer;e&&(F(e.types,"Files")||e.files.length>0)&&t.preventDefault()}},r=function(n){um(t,n.target)&&e(n)},o=function(){var o=qi.DOM,i=t.dom,a=n.document,u=t.inline?t.getBody():t.getDoc(),s=["drop","dragover"];V(s,(function(t){o.bind(a,t,r),i.bind(u,t,e)})),t.on("remove",(function(){V(s,(function(t){o.unbind(a,t,r),i.unbind(u,t,e)}))}))};t.on("init",(function(){Pi.setEditorTimeout(t,o,0)}))}(t)},NC=yn,AC=xn,RC=function(t,e){for(var n=t.getBody();e&&e!==n;){if(NC(e)||AC(e))return e;e=e.parentNode}return null},BC=function(t){var e,r=t.getBody(),o=Us(t,r,(function(e){return t.dom.isBlock(e)}),(function(){return hm(t)})),i="sel-"+t.dom.uniqueId(),a=function(e){e&&t.selection.setRng(e)},u=function(){return t.selection.getRng()},s=function(e,n,r,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:n,direction:e,before:r}).isDefaultPrevented()?null:(i&&t.selection.scrollIntoView(n,-1===e),o.show(r,n))},c=function(t){return Va(t)||$a(t)||Ya(t)},l=function(t){return c(t.startContainer)||c(t.endContainer)},f=function(e){var n=t.schema.getShortEndedElements(),r=t.dom.createRng(),o=e.startContainer,i=e.startOffset,a=e.endContainer,u=e.endOffset;return dt(n,o.nodeName.toLowerCase())?0===i?r.setStartBefore(o):r.setStartAfter(o):r.setStart(o,i),dt(n,a.nodeName.toLowerCase())?0===u?r.setEndBefore(a):r.setEndAfter(a):r.setEnd(a,u),r},d=function(n,o){var a,u,c,f,d,m,p,g=t.$,v=t.dom;if(!n)return null;if(n.collapsed){if(!l(n))if(!1===o){if(d=dc(-1,r,n),qs(d.getNode(!0)))return s(-1,d.getNode(!0),!1,!1);if(qs(d.getNode()))return s(-1,d.getNode(),!d.isAtEnd(),!1)}else{if(d=dc(1,r,n),qs(d.getNode()))return s(1,d.getNode(),!d.isAtEnd(),!1);if(qs(d.getNode(!0)))return s(1,d.getNode(!0),!1,!1)}return null}c=n.startContainer,f=n.startOffset;var b=n.endOffset;if(3===c.nodeType&&0===f&&AC(c.parentNode)&&(c=c.parentNode,f=v.nodeIndex(c),c=c.parentNode),1!==c.nodeType)return null;if(b===f+1&&c===n.endContainer&&(a=c.childNodes[f]),!AC(a))return null;m=p=a.cloneNode(!0);var y=t.fire("ObjectSelected",{target:a,targetClone:m});if(y.isDefaultPrevented())return null;u=ba(ce.fromDom(t.getBody()),"#"+i).fold((function(){return g([])}),(function(t){return g([t.dom()])})),m=y.targetClone,0===u.length&&(u=g('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",i)).appendTo(t.getBody()),n=t.dom.createRng(),m===p&&ne.ie?(u.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(m),n.setStartAfter(u[0].firstChild.firstChild),n.setEndAfter(m)):(u.empty().append(" ").append(m).append(" "),n.setStart(u[0].firstChild,1),n.setEnd(u[0].lastChild,0)),u.css({top:v.getPos(a,t.getBody()).y}),u[0].focus();var x=t.selection.getSel();x.removeAllRanges(),x.addRange(n);var w=ce.fromDom(a);return V(ma(ce.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){xe(w,t)||Tn(t,"data-mce-selected")})),t.dom.getAttrib(a,"data-mce-selected")||a.setAttribute("data-mce-selected","1"),e=a,h(),n},m=function(){e&&(e.removeAttribute("data-mce-selected"),ba(ce.fromDom(t.getBody()),"#"+i).each(qe),e=null),ba(ce.fromDom(t.getBody()),"#"+i).each(qe),e=null},h=function(){o.hide()};return ne.ceFalse&&function(){t.on("mouseup",(function(e){var n=u();n.collapsed&&Lp(t,e.clientX,e.clientY)&&a(py(t,n,!1))})),t.on("click",(function(e){var n=RC(t,e.target);n&&(AC(n)&&(e.preventDefault(),t.focus()),NC(n)&&t.dom.isChildOf(n,t.selection.getNode())&&m())})),t.on("blur NewBlock",(function(){m()})),t.on("ResizeWindow FullscreenStateChanged",(function(){return o.reposition()}));var c=function(e,n){var r,o,i=t.dom.getParent(e,t.dom.isBlock),a=t.dom.getParent(n,t.dom.isBlock);return!(!i||!t.dom.isChildOf(i,a)||!1!==AC(RC(t,i)))||i&&(r=i,o=a,!(t.dom.getParent(r,t.dom.isBlock)===t.dom.getParent(o,t.dom.isBlock)))&&function(t){var e=Dc(t);if(!t.firstChild)return!1;var n=Fu.before(t.firstChild),r=e.next(n);return r&&!Df(r)&&!Of(r)}(i)};!function(t){t.on("tap",(function(e){var n=RC(t,e.target);AC(n)&&(e.preventDefault(),d(hy(t,n)))}),!0)}(t),t.on("mousedown",(function(e){var n=e.target;if((n===r||"HTML"===n.nodeName||t.dom.isChildOf(n,r))&&!1!==Lp(t,e.clientX,e.clientY)){var o=RC(t,n);if(o)AC(o)?(e.preventDefault(),d(hy(t,o))):(m(),NC(o)&&e.shiftKey||Fg(e.clientX,e.clientY,t.selection.getRng())||(h(),t.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===qs(n)){m(),h();var i=ly(r,e.clientX,e.clientY);if(i&&!c(e.target,i.node)){e.preventDefault();var u=s(1,i.node,i.before,!1);t.getBody().focus(),a(u)}}}})),t.on("keypress",(function(e){Hg.modifierPressed(e)||(e.keyCode,AC(t.selection.getNode())&&e.preventDefault())})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=f(t.range);var e=d(t.range,t.forward);e&&(t.range=e)}));t.on("AfterSetSelectionRange",(function(e){var n,r=e.range;l(r)||"mcepastebin"===r.startContainer.parentNode.id||h(),n=r.startContainer.parentNode,t.dom.hasClass(n,"mce-offscreen-selection")||m()})),t.on("copy",(function(e){var n,r=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!ne.ie){var o=(n=t.dom.get(i))?n.getElementsByTagName("*")[0]:n;o&&(e.preventDefault(),r.clearData(),r.setData("text/html",o.outerHTML),r.setData("text/plain",o.outerText))}})),EC(t),function(t){var e=ra((function(){if(!t.removed&&t.getBody().contains(n.document.activeElement)&&t.selection.getRng().collapsed){var e=gy(t,t.selection.getRng(),!1);t.selection.setRng(e)}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t)}(),{showCaret:s,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Ga(e),a(u()),t.selection.scrollIntoView(e))},hideFakeCaret:h,destroy:function(){o.destroy(),e=null}}},PC=function(t){var e,r,o,i=ue.each,a=Hg.BACKSPACE,u=Hg.DELETE,s=t.dom,c=t.selection,l=t.parser,f=ne.gecko,d=ne.ie,m=ne.webkit,h=d?"Text":"URL",p=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},g=function(t){return t.isDefaultPrevented()},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},b=function(){t.on("keydown",(function(t){if(!g(t)&&t.keyCode===a&&c.isCollapsed()&&0===c.getRng().startOffset){var e=c.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},y=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(ne.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))};return t.on("keydown",(function(e){var n,r;if(!g(e)&&e.keyCode===Hg.BACKSPACE){var o=(n=c.getRng()).startContainer,i=n.startOffset,a=s.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==a;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=s.createRng()).setStart(o,0),n.setEnd(o,0),c.setRng(n))}}})),e=function(t){var e=s.create("body"),n=t.cloneContents();return e.appendChild(n),c.serializer.serialize(e,{format:"html"})},t.on("keydown",(function(n){var r,o,i=n.keyCode;if(!g(n)&&(i===u||i===a)){if(r=t.selection.isCollapsed(),o=t.getBody(),r&&!s.isEmpty(o))return;if(!r&&!function(n){var r=e(n),o=s.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),o.firstChild&&s.isBlock(o.firstChild)?t.selection.setCursorLocation(o.firstChild,0):t.selection.setCursorLocation(o,0),t.nodeChanged()}})),ne.windowsPhone||t.on("keyup focusin mouseup",(function(t){Hg.modifierPressed(t)||c.normalize()}),!0),m&&(t.inline||s.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=c.getRng(),t.getBody().focus(),"mousedown"===e.type){if(Va(n.startContainer))return;c.placeCaretAt(e.clientX,e.clientY)}else c.setRng(n)})),t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==s.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&s.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),c.select(n))})),ls(t)&&t.on("init",(function(){p("DefaultParagraphSeparator",ls(t))})),t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))})),b(),l.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),ne.iOS?(t.inline||t.on("keydown",(function(){n.document.activeElement===n.document.body&&t.getWin().focus()})),y(),t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):v()),ne.ie>=11&&(y(),b()),ne.ie&&(v(),p("AutoUrlDetect",!1),t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&c.select(e.target),(n=t.selection.getContent()).length>0&&(r="data:text/mce-internal,"+escape(t.id)+","+escape(n),e.dataTransfer.setData(h,r)))}(e)})),t.on("drop",(function(e){if(!g(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(h))&&e.indexOf("data:text/mce-internal,")>=0?(e=e.substr("data:text/mce-internal,".length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=bg(e.x,e.y,t.getDoc());c.setRng(r),o=n.html,i=!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):t.execCommand("mceInsertContent",!1,o)}}var o,i}))),f&&(t.on("keydown",(function(e){if(!g(e)&&e.keyCode===a){if(!t.getBody().getElementsByTagName("hr").length)return;if(c.isCollapsed()&&0===c.getRng().startOffset){var n=c.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return s.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(s.remove(r),e.preventDefault())}}})),n.Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!g(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),Pi.setEditorTimeout(t,(function(){n.focus()}))}})),r=function(){var e=s.getAttribs(c.getStart().cloneNode(!1));return function(){var n=c.getStart();n!==t.getBody()&&(s.setAttrib(n,"style",null),i(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},o=function(){return!c.isCollapsed()&&s.getParent(c.getStart(),s.isBlock)!==s.getParent(c.getEnd(),s.isBlock)},t.on("keypress",(function(e){var n;if(!g(e)&&(8===e.keyCode||46===e.keyCode)&&o())return n=r(),t.getDoc().execCommand("delete",!1,null),n(),e.preventDefault(),!1})),s.bind(t.getDoc(),"cut",(function(e){var n;!g(e)&&o()&&(n=r(),Pi.setEditorTimeout(t,(function(){n()})))})),function(t){return t.getParam("readonly")}(t)||t.on("BeforeExecCommand mousedown",(function(){p("StyleWithCSS",!1),p("enableInlineTableEditing",!1),_s(t)||p("enableObjectResizing",!1)})),t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||i(s.select("a"),(function(t){var e=t.parentNode,n=s.getRoot();if(e.lastChild===t){for(;e&&!s.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}s.add(e,"br",{"data-mce-bogus":1})}}))})),t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),ne.mac&&t.on("keydown",(function(e){!Hg.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))})),b()),{refreshContentEditable:function(){},isHidden:function(){if(!f||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},IC=qi.DOM,MC=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},LC=function(t){return ct(t,(function(t){return!1===A(t)}))},FC=function(t){var e=t.settings,n=t.editorUpload.blobCache;return LC({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:MC(t),validate:!0,blob_cache:n,images_dataimg_filter:e.images_dataimg_filter})},HC=function(t){var e=t.dom.getRoot();t.inline||Ll(t)&&t.selection.getStart(!0)!==e||Fc(e).each((function(e){var n=e.getNode(),r=fn(n)?Fc(n).getOr(e):e;ne.browser.isIE()?function(t,e){var n=ce.fromDom(t.getBody()),r=(Jd(t)?C.from(e):C.none()).map(Qd).filter(Xd(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},jC=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),HC(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&Pi.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},VC=function(t,e){var n=t.settings,r=t.getDoc(),o=t.getBody();n.browser_spellcheck||n.gecko_spellcheck||(r.body.spellcheck=!1,IC.setAttrib(o,"spellcheck","false")),t.quirks=PC(t),function(t){t.fire("PostRender")}(t);var i=function(t){return t.getParam("directionality",ta.isRtl()?"rtl":void 0)}(t);if(void 0!==i&&(o.dir=i),n.protect&&t.on("BeforeSetContent",(function(t){ue.each(n.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),!1===e&&t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type})),t.contentStyles.length>0){var a="";ue.each(t.contentStyles,(function(t){a+=t+"\r\n"})),t.dom.addStyle(a)}(function(t){return t.inline?IC.styleSheetLoader:t.dom.styleSheetLoader})(t).loadAll(t.contentCSS,(function(e){jC(t)}),(function(e){jC(t)})),n.content_style&&function(t,e){var n=ce.fromDom(t.getDoc().head),r=ce.fromTag("style");_n(r,"type","text/css"),ze(r,ce.fromText(e)),ze(n,r)}(t,n.content_style)},zC=function(t,e){var r=t.settings,o=t.getElement(),i=t.getDoc();r.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(i.open(),i.write(t.iframeHTML),i.close()),t.inline&&(IC.addClass(o,"mce-content-body"),t.contentDocument=i=n.document,t.contentWindow=n.window,t.bodyElement=o,t.contentAreaContainer=o);var a=t.getBody();a.disabled=!0,t.readonly=!!r.readonly,t.readonly||(t.inline&&"static"===IC.getStyle(a,"position",!0)&&(a.style.position="relative"),a.contentEditable=t.getParam("content_editable_state",!0)),a.disabled=!1,t.editorUpload=yv(t),t.schema=vr(r),t.dom=qi(i,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:r.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:ys(t),referrerPolicy:xs(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=lv(FC(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,a=t.dom,u="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(u)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(u,o),r.attr(n,o)):"tabindex"===n?(r.attr(u,o),r.attr(n,null)):r.attr(u,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Ql("br",1)).shortEnded=!0)}})),e}(t),t.serializer=pv(function(t){var e=t.settings;return wt(wt({},FC(t)),LC({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before,block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements}))}(t),t),t.selection=$g(t.dom,t.getWin(),t.serializer,t),t.annotator=$l(t),t.formatter=Nv(t),t.undoManager=Av(t),t._nodeChangeDispatcher=new gC(t),t._selectionOverrides=BC(t),Lv(t),vC(t),ep(t)||yC(t),function(t){ep(t)||pC(t)}(t),function(t){ls(t)&&t.on("NodeChange",h(Vv,t))}(t),Iv(t),function(t){t.fire("PreInit")}(t),np(t).fold((function(){VC(t,!1)}),(function(e){t.setProgressState(!0),e.then((function(e){t.setProgressState(!1),VC(t,e)}))}))},UC=qi.DOM,WC=function(t){var e=function(t){return t.getParam("doctype","<!DOCTYPE html>")}(t)+"<html><head>";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(t){return ss(t,"body_id","tinymce")}(t),r=function(t){return ss(t,"body_class","")}(t);return cs(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+cs(t)+'" />'),e+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'"><br></body></html>'},qC=function(t,e){var r=t.editorManager.translate("Rich Text Area. Press ALT-0 for help."),o=function(t,e,n,r){var o=ce.fromTag("iframe");return kn(o,r),kn(o,{id:t+"_ifr",frameBorder:"0",allowTransparency:"true",title:e}),ca(o,"tox-edit-area__iframe"),o}(t.id,r,e.height,function(t){return t.getParam("iframe_attrs",{})}(t)).dom();o.onload=function(){o.onload=null,t.fire("load")};var i=function(t,e){if(n.document.domain!==n.window.location.hostname&&ne.browser.isIE()){var r=bv("mce");t[r]=function(){zC(t)};var o='javascript:(function(){document.open();document.domain="'+n.document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+r+"(true);})()";return UC.setAttrib(e,"src",o),!0}return!1}(t,o);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=o,t.iframeHTML=WC(t),UC.add(e.iframeContainer,o),i},$C=qi.DOM,YC=function(t,e,n){var r=jp.get(n),o=jp.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=ue.trim(n),r&&-1===ue.inArray(e,n)){if(ue.each(jp.dependencies(n),(function(n){YC(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(e){!function(t,e,n){var r=ta.translate(["Failed to initialize plugin: {0}",e]);Gp(r,n),Wp(t,r)}(t,n,e)}}},GC=function(t){return t.replace(/^\-/,"")},KC=function(t){return{editorContainer:t,iframeContainer:t}},XC=function(t){var e=t.getElement();return t.inline?KC(null):function(t){var e=$C.create("div");return $C.insertAfter(e,t),KC(e)}(e)},JC=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,T(Ss(t))?function(t){return t.theme.renderUI()}(t):R(Ss(t))?function(t){var e=t.getElement(),n=Ss(t)(t,e);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:e.offsetHeight,n}(t):XC(t)},QC=function(t){t.fire("ScriptsLoaded"),function(t){var e=ue.trim(hs(t)),n=t.ui.registry.getAll().icons,r=wt(wt({},Np.get("default").icons),Np.get(e).icons);rt(r,(function(e,r){dt(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=Ss(t);if(T(e)){t.settings.theme=GC(e);var n=Vp.get(e);t.theme=new n(t,Vp.urls[e]),t.theme.init&&t.theme.init(t,Vp.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];ue.each(Es(t).split(/[ ,]/),(function(n){YC(t,e,GC(n))}))}(t);var e=JC(t);return t.editorContainer=e.editorContainer?e.editorContainer:null,function(t){t.contentCSS=t.contentCSS.concat(Kp(t))}(t),t.inline?zC(t):function(t,e){var n=qC(t,e);e.editorContainer&&(UC.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=UC.isHidden(e.editorContainer)),t.getElement().style.display="none",UC.setAttrib(t.id,"aria-hidden","true"),n||zC(t)}(t,e)},ZC=qi.DOM,t_=function(t){return"-"===t.charAt(0)},e_=function(t,e){var n=ws(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===ta.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,l,void 0,(function(){!function(t,e,n){qp(t,"LanguageLoadError",$p("language",e,n))}(e,o,n)}))}},n_=function(t,e,n){return C.from(e).filter((function(t){return t.length>0&&!Np.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:C.some(e)}}))},r_=function(t,e,n){var r=n_(e,"default",n),o=function(t){return C.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:C.none()}}))}(e).orThunk((function(){return n_(e,hs(e),"")}));V(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([r,o]),(function(n){t.add(n.url,l,void 0,(function(){!function(t,e,n){qp(t,"IconsLoadError",$p("icons",e,n))}(e,n.url,n.name.getOrUndefined())}))}))},o_=function(t,e){var n=Ki.ScriptLoader;!function(t,e,n,r){var o=Ss(e);if(T(o)){if(!t_(o)&&!Vp.urls.hasOwnProperty(o)){var i=function(t){return t.getParam("theme_url")}(e);i?Vp.load(o,e.documentBaseURI.toAbsolute(i)):Vp.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue((function(){Vp.waitFor(o,r)}))}else r()}(n,t,e,(function(){e_(n,t),r_(n,t,e),function(t,e){ue.each(function(t){return t.getParam("external_plugins")}(t),(function(e,n){jp.load(n,e,l,void 0,(function(){Yp(t,e,n)})),t.settings.plugins+=" "+n})),ue.each(Es(t).split(/[ ,]/),(function(n){if((n=ue.trim(n))&&!jp.urls[n])if(t_(n)){n=n.substr(1,n.length);var r=jp.dependencies(n);ue.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=jp.createUrl(r,n);jp.load(o.resource,o,l,void 0,(function(){Yp(t,o.prefix+o.resource+o.suffix,o.resource)}))}))}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};jp.load(n,o,l,void 0,(function(){Yp(t,o.prefix+o.resource+o.suffix,n)}))}}))}(t,e),n.loadQueue((function(){t.removed||QC(t)}),t,(function(){t.removed||QC(t)}))}))},i_=function(t){var e=t.id;ta.setCode(ws(t));var r=function(){ZC.unbind(n.window,"ready",r),t.render()};if(qr.Event.domLoaded){if(t.getElement()&&ne.contentEditable){var o=ce.fromDom(t.getElement()),i=function(t){return q(t.dom().attributes,(function(t,e){return t[e.name]=e.value,t}),{})}(o);t.on("remove",(function(){z(o.dom().attributes,(function(t){return Tn(o,t.name)})),kn(o,i)})),t.ui.styleSheetLoader=function(t,e){return Mi.forElement(t,{contentCssCors:Os(e),referrerPolicy:xs(e)})}(o,t),!function(t){return t.getParam("inline")}(t)?(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden"):t.inline=!0;var a=t.getElement().form||ZC.getParent(e,"form");a&&(t.formElement=a,function(t){return t.getParam("hidden_input")}(t)&&!mn(t.getElement())&&(ZC.insertAfter(ZC.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},ZC.bind(a,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!function(t){return t.getParam("submit_patch")}(t)||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),a._mceOldSubmit(a)})),t.windowManager=zp(t),t.notificationManager=Hp(t),function(t){return"xml"===t.getParam("encoding")}(t)&&t.on("GetContent",(function(t){t.save&&(t.content=ZC.encode(t.content))})),function(t){return t.getParam("add_form_submit_trigger")}(t)&&t.on("submit",(function(){t.initialized&&t.save()})),function(t){return t.getParam("add_unload_trigger")}(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),o_(t,t.suffix)}}else ZC.bind(n.window,"ready",r)},a_=function(t){return R(t)?t:d(!1)},u_=function(t,e,n){var r=e(t),o=a_(n);return r.orThunk((function(){return o(t)?C.none():function(t,e,n){for(var r=t.dom(),o=a_(n);r.parentNode;){r=r.parentNode;var i=ce.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return C.none()}(t,e,o)}))},s_={"font-size":"size","font-family":"face"},c_=function(t,e,n){var r=function(e){return En(e,t).orThunk((function(){return"font"===le(e)?ft(s_,t).bind((function(t){return n=e,r=t,C.from(Sn(n,r));var n,r})):C.none()}))};return u_(ce.fromDom(n),(function(t){return r(t)}),(function(t){return xe(ce.fromDom(e),t)}))},l_=function(t){return function(e,n){return C.from(n).map(ce.fromDom).filter(me).bind((function(n){return c_(t,e,n.dom()).or(function(t,e){return C.from(qi.DOM.getStyle(e,t,!0))}(t,n.dom()))})).getOr("")}},f_=l_("font-size"),d_=f((function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),l_("font-family")),m_=function(t){return Fc(t.getBody()).map((function(t){var e=t.container();return hn(e)?e.parentNode:e}))},h_=function(t){return C.from(t.selection.getRng()).bind((function(e){return function(t,e){return t.startContainer===e&&0===t.startOffset}(e,t.getBody())?C.none():C.from(t.selection.getStart(!0))}))},p_=function(t,e){if(/^[0-9\.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=function(t){return ue.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return ue.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},g_=function(t){var e=t.split(/\s*,\s*/);return j(e,(function(t){return-1===t.indexOf(" ")||Pt(t,'"')||Pt(t,"'")?t:"'"+t+"'"})).join(",")},v_=function(t,e){var n=function(t){var e;return"string"!=typeof t?(e=ue.extend({paste:t.paste,data:{paste:t.paste}},t),{content:t.content,details:e}):{content:t,details:{}}}(e);!function(t,e,n){rp(t).editor.insertContent(e,n)}(t,n.content,n.details)},b_=function(t,e){t.getDoc().execCommand(e,!1,null)},y_=ue.each,x_=ue.map,w_=ue.inArray,C_=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,a=this;if(!a.editor.removed){var u;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(u=a.editor,nm(u).each((function(t){u.selection.setRng(t)}))):a.editor.focus(),(r=a.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var s=t.toLowerCase();if(o=a.commands.exec[s])return o(s,e,n),a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(y_(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1})),i)return i;if(a.editor.theme&&a.editor.theme.execCommand&&a.editor.theme.execCommand(t,e,n))return a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=a.editor.getDoc().execCommand(t,e,n)}catch(t){}return!!i&&(a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},t.prototype.addCommands=function(t,e){var n=this;e=e||"exec",y_(t,(function(t,r){y_(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,a){return e.call(n||r.editor,o,i,a)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e?{value:e}:void 0),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(t){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");ne.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),y_("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,r)},FontName:function(e,n,r){!function(t,e){var n=p_(t,e);t.formatter.toggle("fontname",{value:g_(n)}),t.nodeChanged()}(t,r)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:p_(t,e)}),t.nodeChanged()}(t,r)},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){v_(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){Uw(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){Gx(t,e)},mceRepaint:function(){},InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),yn);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},delete:function(){!function(t){rw(t)||Ax(t,!1)||Bx(t,!1)||Lx(t,!1)||fx(t,!1)||Td(t)||px(t)||Vx(t,!1)||(b_(t,"Delete"),Qy(t))}(t)},forwardDelete:function(){!function(t){Ax(t,!0)||Bx(t,!0)||Lx(t,!0)||fx(t,!0)||Td(t)||px(t)||Vx(t,!0)||b_(t,"ForwardDelete")}(t)},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return Nw(t,r),!0}});var n=function(e){return function(){var n=t.selection.isCollapsed()?[t.dom.getParent(t.selection.getNode(),t.dom.isBlock)]:t.selection.getSelectedBlocks(),r=x_(n,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==w_(r,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return qx(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return function(t){return h_(t).fold((function(){return m_(t).map((function(e){return d_(t.getBody(),e)})).getOr("")}),(function(e){return d_(t.getBody(),e)}))}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return h_(t).fold((function(){return m_(t).map((function(e){return f_(t.getBody(),e)})).getOr("")}),(function(e){return f_(t.getBody(),e)}))}(t)}),this)},t}(),__=function(t,e,n){fa(t,e)&&!1===n?function(t,e){aa(t)?t.dom().classList.remove(e):sa(t,e);la(t)}(t,e):n&&ca(t,e)},k_=function(t,e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},S_=function(t,e){t.dom().contentEditable=e?"true":"false"},T_=function(t,e){var n=ce.fromDom(t.getBody());__(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){C.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,S_(n,!1),V(ma(n,'*[contenteditable="true"]'),(function(t){_n(t,"data-mce-contenteditable","true"),S_(t,!1)}))):(t.readonly=!1,S_(n,!0),function(t){V(ma(t,'*[data-mce-contenteditable="true"]'),(function(t){Tn(t,"data-mce-contenteditable"),S_(t,!0)}))}(n),k_(t,"StyleWithCSS",!1),k_(t,"enableInlineTableEditing",!1),k_(t,"enableObjectResizing",!1),pm(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},D_=function(t){return t.readonly},O_=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){D_(t)&&V(e,(function(t){t.attr("data-mce-contenteditable",t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter("data-mce-contenteditable",(function(e){D_(t)&&V(e,(function(t){t.attr("contenteditable",t.attr("data-mce-contenteditable"))}))})),t.serializer.addTempAttr("data-mce-contenteditable")},E_=ue.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),N_=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||v}return t.isNative=function(t){return!!E_[t.toLowerCase()]},t.prototype.fire=function(t,e){t=t.toLowerCase(),(e=e||{}).type=t,e.target||(e.target=this.scope),e.preventDefault||(e.preventDefault=function(){e.isDefaultPrevented=b},e.stopPropagation=function(){e.isPropagationStopped=b},e.stopImmediatePropagation=function(){e.isImmediatePropagationStopped=b},e.isDefaultPrevented=v,e.isPropagationStopped=v,e.isImmediatePropagationStopped=v),this.settings.beforeFire&&this.settings.beforeFire(e);var n=this.bindings[t];if(n)for(var r=0,o=n.length;r<o;r++){var i=n[r];if(i.once&&this.off(t,i.func),e.isImmediatePropagationStopped())return e.stopPropagation(),e;if(!1===i.func.call(this.scope,e))return e.preventDefault(),e}return e},t.prototype.on=function(t,e,n,r){var o,i,a;if(!1===e&&(e=v),e){var u={func:e};for(r&&ue.extend(u,r),a=(i=t.toLowerCase().split(" ")).length;a--;)t=i[a],(o=this.bindings[t])||(o=this.bindings[t]=[],this.toggleEvent(t,!0)),n?o.unshift(u):o.push(u)}return this},t.prototype.off=function(t,e){var n,r,o,i,a=this;if(t)for(n=(o=t.toLowerCase().split(" ")).length;n--;){if(t=o[n],r=this.bindings[t],!t)return rt(this.bindings,(function(t,e){a.toggleEvent(e,!1),delete a.bindings[e]})),this;if(r){if(e)for(i=r.length;i--;)r[i].func===e&&(r=r.slice(0,i).concat(r.slice(i+1)),this.bindings[t]=r);else r.length=0;r.length||(this.toggleEvent(t,!1),delete this.bindings[t])}}else rt(this.bindings,(function(t,e){a.toggleEvent(e,!1)})),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),A_=function(t){return t._eventDispatcher||(t._eventDispatcher=new N_({scope:t,toggleEvent:function(e,n){N_.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},R_={fire:function(t,e,n){if(this.removed&&"remove"!==t&&"detach"!==t)return e;var r=A_(this).fire(t,e);if(!1!==n&&this.parent)for(var o=this.parent();o&&!r.isPropagationStopped();)o.fire(t,r,!1),o=o.parent();return r},on:function(t,e,n){return A_(this).on(t,e,n)},off:function(t,e){return A_(this).off(t,e)},once:function(t,e){return A_(this).once(t,e)},hasEventListeners:function(t){return A_(this).has(t)}},B_=qi.DOM,P_=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=ks(t);return n?(t.eventRoot||(t.eventRoot=B_.select(n)[0]),t.eventRoot):t.getBody()},I_=function(t,e,n){!function(t){return!t.hidden&&!D_(t)}(t)?D_(t)&&function(t,e){var n=e.target;(function(t){return"click"===t.type})(e)&&!Hg.metaKeyPressed(e)&&function(t,e){return null!==t.dom.getParent(e,"a")}(t,n)&&e.preventDefault()}(t,n):t.fire(e,n)},M_=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=P_(t,e);if(ks(t)){if(Kb||(Kb={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||Kb&&(rt(Kb,(function(e,n){t.dom.unbind(P_(t,n))})),Kb=null)}))),Kb[e])return;n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var a=o[i].getBody();(a===r||B_.isChildOf(r,a))&&I_(o[i],e,n)}},Kb[e]=n,B_.bind(r,e,n)}else n=function(n){I_(t,e,n)},B_.bind(r,e,n),t.delegates[e]=n}},L_=wt(wt({},R_),{bindPendingEventDelegates:function(){var t=this;ue.each(t._pendingNativeEvents,(function(e){M_(t,e)}))},toggleNativeEvent:function(t,e){"focus"!==t&&"blur"!==t&&(e?this.initialized?M_(this,t):this._pendingNativeEvents?this._pendingNativeEvents.push(t):this._pendingNativeEvents=[t]:this.initialized&&(this.dom.unbind(P_(this,t),t,this.delegates[t]),delete this.delegates[t]))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(rt(t.delegates,(function(e,n){t.dom.unbind(P_(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),F_=["design","readonly"],H_=function(t,e,r,o){var i=r[e.get()],a=r[o];try{a.activate()}catch(t){return void n.console.error("problem while activating editor mode "+o+":",t)}i.deactivate(),i.editorReadOnly!==a.editorReadOnly&&T_(t,a.editorReadOnly),e.set(o),function(t,e){t.fire("SwitchMode",{mode:e})}(t,o)},j_=function(t){var e=Xi("design"),r=Xi({design:{activate:l,deactivate:l,editorReadOnly:!1},readonly:{activate:l,deactivate:l,editorReadOnly:!0}});return function(t){t.serializer?O_(t):t.on("PreInit",(function(){O_(t)}))}(t),function(t){t.on("ShowCaret",(function(e){D_(t)&&e.preventDefault()})),t.on("ObjectSelected",(function(e){D_(t)&&e.preventDefault()}))}(t),{isReadOnly:function(){return D_(t)},set:function(n){return function(t,e,n,r){if(r!==n.get()){if(!dt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?H_(t,n,e,r):t.on("init",(function(){return H_(t,n,e,r)}))}}(t,r.get(),e,n)},get:function(){return e.get()},register:function(t,e){r.set(function(t,e,r){var o;if(F(F_,e))throw new Error("Cannot override default mode "+e);return wt(wt({},t),((o={})[e]=wt(wt({},r),{deactivate:function(){try{r.deactivate()}catch(t){n.console.error("problem while deactivating editor mode "+e+":",t)}}}),o))}(r.get(),t,e))}}},V_=ue.each,z_=ue.explode,U_={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},W_=ue.makeMap("alt,ctrl,shift,meta,access"),q_=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(V_(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}return t.prototype.add=function(t,e,n,r){var o=this,i=n;return"string"==typeof i?n=function(){o.editor.execCommand(i,!1,null)}:ue.isArray(i)&&(n=function(){o.editor.execCommand(i[0],i[1],i[2])}),V_(z_(ue.trim(t)),(function(t){var i=o.createShortcut(t,e,n,r);o.shortcuts[i.id]=i})),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.parseShortcut=function(t){var e,n={};V_(z_(t.toLowerCase(),"+"),(function(t){t in W_?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=U_[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in W_)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,ne.mac?n.ctrl=!0:n.shift=!0),n.meta&&(ne.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},t.prototype.createShortcut=function(t,e,n,r){var o=ue.map(z_(t,">"),this.parseShortcut);return o[o.length-1]=ue.extend(o[o.length-1],{func:n,scope:r||this.editor}),ue.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&(e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&(e.alt===t.altKey&&e.shift===t.shiftKey&&(!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0))))},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),$_=function(){var t=function(){var t={},e={},n={},r={},o={},i={},a={},u=function(t,e){return function(n,r){return t[n.toLowerCase()]=wt(wt({},r),{type:e})}};return{addButton:u(t,"button"),addGroupToolbarButton:u(t,"grouptoolbarbutton"),addToggleButton:u(t,"togglebutton"),addMenuButton:u(t,"menubutton"),addSplitButton:u(t,"splitbutton"),addMenuItem:u(e,"menuitem"),addNestedMenuItem:u(e,"nestedmenuitem"),addToggleMenuItem:u(e,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:function(t,e){return r[t.toLowerCase()]=e},getAll:function(){return{buttons:t,menuItems:e,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}}}();return{addAutocompleter:t.addAutocompleter,addButton:t.addButton,addContextForm:t.addContextForm,addContextMenu:t.addContextMenu,addContextToolbar:t.addContextToolbar,addIcon:t.addIcon,addMenuButton:t.addMenuButton,addMenuItem:t.addMenuItem,addNestedMenuItem:t.addNestedMenuItem,addSidebar:t.addSidebar,addSplitButton:t.addSplitButton,addToggleButton:t.addToggleButton,addGroupToolbarButton:t.addGroupToolbarButton,addToggleMenuItem:t.addToggleMenuItem,getAll:t.getAll}},Y_=ue.each,G_=ue.trim,K_="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),X_={ftp:21,http:80,https:443,mailto:25},J_=function(){function t(e,r){e=G_(e),this.settings=r||{};var o=this.settings.base_uri,i=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))i.source=e;else{var a=0===e.indexOf("//");if(0!==e.indexOf("/")||a||(e=(o&&o.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var u=this.settings.base_uri?this.settings.base_uri.path:new t(n.document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+i.toAbsPath(u,e);else{var s=/([^#?]*)([#?]?.*)/.exec(e);e=(o&&o.protocol||"http")+"://mce_host"+i.toAbsPath(u,s[1])+s[2]}}e=e.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);Y_(K_,(function(t,e){var n=c[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),i[t]=n})),o&&(i.protocol||(i.protocol=o.protocol),i.userInfo||(i.userInfo=o.userInfo),i.port||"mce_host"!==i.host||(i.port=o.port),i.host&&"mce_host"!==i.host||(i.host=o.host),i.source=""),a&&(i.protocol="")}}return t.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=X_[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",a=t.substring(0,t.lastIndexOf("/")).split("/"),u=e.split("/");if(a.length>=u.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||a[n]!==u[n]){o=n+1;break}if(a.length<u.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return e;for(n=0,r=a.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=u.length;n<r;n++)i+=n!==o-1?"/"+u[n]:u[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],a=/\/$/.test(e)?"/":"",u=t.split("/"),s=e.split("/");for(Y_(u,(function(t){t&&i.push(t)})),u=i,n=s.length-1,i=[];n>=0;n--)0!==s[n].length&&"."!==s[n]&&(".."!==s[n]?o>0?o--:i.push(s[n]):o++);return 0!==(r=(n=u.length-o)<=0?X(i).join("/"):u.slice(0,n).join("/")+"/"+X(i).join("/")).indexOf("/")&&(r="/"+r),a&&r.lastIndexOf("/")!==r.length-1&&(r+=a),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),Q_=qi.DOM,Z_=ue.extend,tk=ue.each,ek=ue.resolve,nk=ne.ie,rk=function(){function t(t,e,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,Z_(this,L_),this.settings=Dp(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(Ki.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),qi.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),na.languageLoad=this.settings.language_load,na.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new J_(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new q_(this),this.editorCommands=new C_(this),this.settings.cache_suffix&&(ne.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:$_(),styleSheetLoader:void 0};var o=j_(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=mi.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))}return t.prototype.render=function(){i_(this)},t.prototype.focus=function(t){vm(this,t)},t.prototype.hasFocus=function(){return hm(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this,i=o.settings[t];if(i)return o.callbackLookup&&(r=o.callbackLookup[t])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?ek(r):0,i=ek(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return ta.translate(t)},t.prototype.getParam=function(t,e,n){return Ep(this,t,e,n)},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable="true":(Q_.show(this.getContainer()),Q_.hide(this.id)),this.load(),this.fire("show"))},t.prototype.hide=function(){var t=this.getDoc();this.hidden||(nk&&t&&!this.inline&&t.execCommand("SelectAll"),this.save(),this.inline?(this.getBody().contentEditable="false",this===this.editorManager.focusedEditor&&(this.editorManager.focusedEditor=null)):(Q_.hide(this.getContainer()),Q_.setStyle(this.id,"display",this.orgDisplay)),this.hidden=!0,this.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this.getElement();if(this.removed)return"";if(n){(t=t||{}).load=!0;var r=mn(n)?n.value:n.innerHTML;return e=this.setContent(r,t),t.element=n,t.no_events||this.fire("LoadContent",t),t.element=n=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,mn(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=Q_.getParent(r.id,"form"))&&tk(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return ap(this,t,e)},t.prototype.getContent=function(t){return ip(this,t)},t.prototype.insertContent=function(t,e){e&&(t=Z_({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?ap(this,this.startContent,{format:"raw"}):ap(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){return this.container||(this.container=Q_.get(this.editorContainer||this.id+"_parent")),this.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=Q_.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t;return this.contentWindow||(t=this.iframeElement)&&(this.contentWindow=t.contentWindow),this.contentWindow},t.prototype.getDoc=function(){var t;return this.contentDocument||(t=this.getWin())&&(this.contentDocument=t.document),this.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",t,n,!0,e):!r.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:r.relative_urls?this.documentBaseURI.toRelative(t):t=this.documentBaseURI.toAbsolute(t,r.remove_script_host)},t.prototype.addVisual=function(t){var e,n=this,r=n.settings,o=n.dom;t=t||n.getBody(),void 0===n.hasVisual&&(n.hasVisual=r.visual),tk(o.select("table,a",t),(function(t){var i;switch(t.nodeName){case"TABLE":return e=r.visual_table_class||"mce-item-table",void((i=o.getAttrib(t,"border"))&&"0"!==i||!n.hasVisual?o.removeClass(t,e):o.addClass(t,e));case"A":return void(o.getAttrib(t,"href")||(i=o.getAttrib(t,"name")||t.id,e=r.visual_anchor_class||"mce-item-anchor",i&&n.hasVisual?o.addClass(t,e):o.removeClass(t,e)))}})),n.fire("VisualAid",{element:t,hasVisual:n.hasVisual})},t.prototype.remove=function(){cp(this)},t.prototype.destroy=function(t){lp(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),ok=qi.DOM,ik=ue.explode,ak=ue.each,uk=ue.extend,sk=0,ck=!1,lk=[],fk=[],dk=function(t){var e=t.type;ak(gk.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}}))},mk=function(t){t!==ck&&(t?mi(window).on("resize scroll",dk):mi(window).off("resize scroll",dk),ck=t)},hk=function(t){var e=fk;delete lk[t.id];for(var n=0;n<lk.length;n++)if(lk[n]===t){lk.splice(n,1);break}return fk=U(fk,(function(e){return t!==e})),gk.activeEditor===t&&(gk.activeEditor=fk.length>0?fk[0]:null),gk.focusedEditor===t&&(gk.focusedEditor=null),e.length!==fk.length},pk="CSS1Compat"!==n.document.compatMode,gk=wt(wt({},R_),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:mi,majorVersion:"5",minorVersion:"4.1",releaseDate:"2020-07-08",editors:lk,i18n:ta,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,r="";e=J_.getDocumentBaseUrl(n.document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)t=i.base||i.baseURL,r=i.suffix;else{for(var a=n.document.getElementsByTagName("script"),u=0;u<a.length;u++){var s;if(""!==(s=a[u].src||"")){var c=s.substring(s.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(s)){-1!==c.indexOf(".min")&&(r=".min"),t=s.substring(0,s.lastIndexOf("/"));break}}}if(!t&&n.document.currentScript)-1!==(s=n.document.currentScript.src).indexOf(".min")&&(r=".min"),t=s.substring(0,s.lastIndexOf("/"))}this.baseURL=new J_(e).toAbsolute(t),this.documentBaseURL=e,this.baseURI=new J_(this.baseURL),this.suffix=r,(o=this).on("AddEditor",h(sm,o)),o.on("RemoveEditor",h(cm,o))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&rt(r,(function(t,e){na.PluginManager.urls[e]=t}))},init:function(t){var e,r=this,o=ue.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),i=function(t){var e=t.id;return e||(e=ft(t,"name").filter((function(t){return!ok.get(t)})).getOrThunk(ok.uniqueId),t.setAttribute("id",e)),e},a=function(t,e){return e.constructor===RegExp?e.test(t.className):ok.hasClass(t,e)},u=function(t){e=t},s=function(){var e,c=0,l=[],f=function(t,n,o){var i=new rk(t,n,r);l.push(i),i.on("init",(function(){++c===e.length&&u(l)})),i.targetElm=i.targetElm||o,i.render()};ok.unbind(window,"ready",s),function(e){var n=t[e];if(n)n.apply(r,Array.prototype.slice.call(arguments,2))}("onpageload"),e=mi.unique(function(t){var e=[];if(ne.browser.isIE()&&ne.browser.version.major<11)return Gp("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(pk)return Gp("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return ak(t.types,(function(t){e=e.concat(ok.select(t.selector))})),e;if(t.selector)return ok.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var r=t.elements||"";r.length>0&&ak(ik(r),(function(t){var r=ok.get(t);r?e.push(r):ak(n.document.forms,(function(n){ak(n.elements,(function(n){n.name===t&&(t="mce_editor_"+sk++,ok.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":ak(ok.select("textarea"),(function(n){t.editor_deselector&&a(n,t.editor_deselector)||t.editor_selector&&!a(n,t.editor_selector)||e.push(n)}))}return e}(t)),t.types?ak(t.types,(function(n){ue.each(e,(function(e){return!ok.is(e,n.selector)||(f(i(e),uk({},t,n),e),!1)}))})):(ue.each(e,(function(t){var e;(e=r.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(hk(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)})),0===(e=ue.grep(e,(function(t){return!r.get(t.id)}))).length?u([]):ak(e,(function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in o}(t,e)?f(i(e),t,e):Gp("Could not initialize inline editor on invalid inline target element",e)})))};return r.settings=t,ok.bind(window,"ready",s),new Ni((function(t){e?t(e):u=function(e){t(e)}}))},get:function(t){return 0===arguments.length?fk.slice(0):T(t)?$(fk,(function(e){return e.id===t})).getOr(null):B(t)&&fk[t]?fk[t]:null},add:function(t){var e=this;return lk[t.id]===t||(null===e.get(t.id)&&("length"!==t.id&&(lk[t.id]=t),lk.push(t),fk.push(t)),mk(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),Xb||(Xb=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Xb))),t},createEditor:function(t,e){return this.add(new rk(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!T(t))return n=t,E(r.get(n.id))?null:(hk(n)&&r.fire("RemoveEditor",{editor:n}),0===fk.length&&window.removeEventListener("beforeunload",Xb),n.remove(),mk(fk.length>0),n);ak(ok.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=fk.length-1;e>=0;e--)r.remove(fk[e])},execCommand:function(t,e,n){var r=this.get(n);switch(t){case"mceAddEditor":return this.get(n)||new rk(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(t,e,n)},triggerSave:function(){ak(fk,(function(t){t.save()}))},addI18n:function(t,e){ta.add(t,e)},translate:function(t){return ta.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new J_(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new J_(this.baseURL)}});function vk(t){return{walk:function(e,n){return Ol(t,e,n)},split:km,normalize:function(e){return Bg(t,e).fold(d(!1),(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))}}}gk.setup(),function(t){t.compareRanges=kg,t.getCaretRangeFromPoint=bg,t.getSelectedNode=ru,t.getNode=ou}(vk||(vk={}));var bk,yk,xk,wk,Ck=vk,_k=(bk={},yk={},{load:function(t,e){var r='Script at URL "'+e+'" failed to load',o='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==bk[t])return bk[t];var i=new Ni((function(i,a){var u=function(t,e,r){void 0===r&&(r=1e3);var o=!1,i=null,a=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];o||(o=!0,null!==i&&(n.clearTimeout(i),i=null),t.apply(null,e))}},u=a(t),s=a(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];o||null!==i||(i=n.setTimeout((function(){return s.apply(null,t)}),r))},resolve:u,reject:s}}(i,a);yk[t]=u.resolve,Ki.ScriptLoader.loadScript(e,(function(){return u.start(o)}),(function(){return u.reject(r)}))}));return bk[t]=i,i},add:function(t,e){void 0!==yk[t]&&(yk[t](e),delete yk[t]),bk[t]=Ni.resolve(e)}}),kk=Math.min,Sk=Math.max,Tk=Math.round,Dk=function(t,e,n){var r=e.x,o=e.y,i=t.w,a=t.h,u=e.w,s=e.h;return"b"===(n=(n||"").split(""))[0]&&(o+=s),"r"===n[1]&&(r+=u),"c"===n[0]&&(o+=Tk(s/2)),"c"===n[1]&&(r+=Tk(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=Tk(a/2)),"c"===n[4]&&(r-=Tk(i/2)),Ok(r,o,i,a)},Ok=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},Ek={inflate:function(t,e,n){return Ok(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:Dk,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if((o=Dk(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=Sk(t.x,e.x),r=Sk(t.y,e.y),o=kk(t.x+t.w,e.x+e.w),i=kk(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:Ok(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,a=t.y+t.h,u=e.x+e.w,s=e.y+e.h,c=Sk(0,e.x-r),l=Sk(0,e.y-o),f=Sk(0,i-u),d=Sk(0,a-s);return r+=c,o+=l,n&&(i+=c,a+=l,r-=f,o-=d),Ok(r,o,(i-=f)-r,(a-=d)-o)},create:Ok,fromClientRect:function(t){return Ok(t.left,t.top,t.width,t.height)}},Nk=ue.each,Ak=ue.extend,Rk=function(){};Rk.extend=xk=function(t){var e=this.prototype,n=function(){var t,e,n,r=this;if(!wk&&(r.init&&r.init.apply(r,arguments),e=r.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(r,arguments)},r=function(){return this};wk=!0;var o=new this;return wk=!1,t.Mixins&&(Nk(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),e.Mixins&&(t.Mixins=e.Mixins.concat(t.Mixins))),t.Methods&&Nk(t.Methods.split(","),(function(e){t[e]=r})),t.Properties&&Nk(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){return void 0!==t?(this[n]=t,this):this[n]}})),t.Statics&&Nk(t.Statics,(function(t,e){n[e]=t})),t.Defaults&&e.Defaults&&(t.Defaults=Ak({},e.Defaults,t.Defaults)),rt(t,(function(t,n){"function"==typeof t&&e[n]?o[n]=function(t,n){return function(){var r=this,o=r._super;r._super=e[t];var i=n.apply(r,arguments);return r._super=o,i}}(n,t):o[n]=t})),n.prototype=o,n.constructor=n,n.extend=xk,n};var Bk,Pk=Math.min,Ik=Math.max,Mk=Math.round,Lk={serialize:function(t){var e=JSON.stringify(t);return T(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},parse:function(t){try{return JSON.parse(t)}catch(t){}}},Fk={callbacks:{},count:0,send:function(t){var e=this,n=qi.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},Hk=wt(wt({},R_),{send:function(t){var e,r=0,o=function(){!t.async||4===e.readyState||r++>1e4?(t.success&&r<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,r>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):Pi.setTimeout(o,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",Hk.fire("beforeInitialize",{settings:t}),e=new n.XMLHttpRequest){if(e.overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&ue.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=Hk.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return o();Pi.setTimeout(o,10)}}}),jk=ue.extend,Vk=function(){function t(t){this.settings=jk({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=jk(this.settings,t);r.success=function(t,o){void 0===(t=Lk.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=Lk.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",Hk.send(r)},t}();try{var zk="__storage_test__";(Bk=n.window.localStorage).setItem(zk,zk),Bk.removeItem(zk)}catch(t){Bk=function(){var t={},e=[],n={getItem:function(e){var n=t[e];return n||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter((function(t){return t===n})),delete t[n]},clear:function(){e=[],t={}},length:0};return Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n}()}var Uk={geom:{Rect:Ek},util:{Promise:Ni,Delay:Pi,Tools:ue,VK:Hg,URI:J_,Class:Rk,EventDispatcher:N_,Observable:R_,I18n:ta,XHR:Hk,JSON:Lk,JSONRequest:Vk,JSONP:Fk,LocalStorage:Bk,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=Ik(0,Pk(e,1)),i=Ik(0,Pk(i,1)),0!==e){var a=t/60,u=i*e,s=u*(1-Math.abs(a%2-1)),c=i-u;switch(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=Mk(255*(n+c)),r=Mk(255*(r+c)),o=Mk(255*(o+c))}else n=r=o=Mk(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return function(t,e,n){var r,o;o=0;var i=Pk(t/=255,Pk(e/=255,n/=255)),a=Ik(t,Ik(e,n));return i===a?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,o=a,{h:Mk(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(a-i))),s:Mk(100*r),v:Mk(100*o)})}(n,r,o)},e.toHex=function(){var t=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e}},dom:{EventUtils:qr,Sizzle:Do,DomQuery:mi,TreeWalker:hi,TextSeeker:Pa,DOMUtils:qi,ScriptLoader:Ki,RangeUtils:Ck,Serializer:pv,StyleSheetLoader:Ii,ControlSelection:zg,BookmarkManager:Lg,Selection:$g,Event:qr.Event},html:{Styles:Mr,Entities:ur,Node:Ql,Schema:vr,SaxParser:lf,DomParser:lv,Writer:tf,Serializer:ef},Env:ne,AddOnManager:na,Annotator:$l,Formatter:Nv,UndoManager:Av,EditorCommands:C_,WindowManager:zp,NotificationManager:Hp,EditorObservable:L_,Shortcuts:q_,Editor:rk,FocusManager:rm,EditorManager:gk,DOM:qi.DOM,ScriptLoader:Ki.ScriptLoader,PluginManager:na.PluginManager,ThemeManager:na.ThemeManager,IconManager:Np,Resource:_k,trim:ue.trim,isArray:ue.isArray,is:ue.is,toArray:ue.toArray,makeMap:ue.makeMap,each:ue.each,map:ue.map,grep:ue.grep,inArray:ue.inArray,extend:ue.extend,create:ue.create,walk:ue.walk,createNS:ue.createNS,resolve:ue.resolve,explode:ue.explode,_addCacheSuffix:ue._addCacheSuffix,isOpera:ne.opera,isWebKit:ne.webkit,isIE:ne.ie,isGecko:ne.gecko,isMac:ne.mac},Wk=ue.extend(gk,Uk);!function(t){window.tinymce=t,window.tinyMCE=t}(Wk),function(e){try{t.exports=e}catch(t){}}(Wk)}(window)}).call(this,n("yLpj"))},"5oMp":function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},"7bfH":function(t,e,n){var r,o,i;o=[n("EVdn"),n("wCe6"),n("GC/X"),n("N6cA"),n("vBzC"),n("r15H"),n("Jchv"),n("y6ec"),n("Qwlt"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){return t.widget("ui.selectmenu",[t.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=t()},_drawButton:function(){var e,n=this,r=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=t("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),e=t("<span>").appendTo(this.button),this._addClass(e,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(r).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",(function(){n._rendered||n._refreshMenu()}))},_drawMenu:function(){var e=this;this.menu=t("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=t("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,n){t.preventDefault(),e._setSelection(),e._select(n.item.data("ui-selectmenu-item"),t)},focus:function(t,n){var r=n.item.data("ui-selectmenu-item");null!=e.focusIndex&&r.index!==e.focusIndex&&(e._trigger("focus",t,{item:r}),e.isOpen||e._select(r,t)),e.focusIndex=r.index,e.button.attr("aria-activedescendant",e.menuItems.eq(r.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t,e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(t.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(e){var n=t("<span>");return this._setText(n,e.label),this._addClass(n,"ui-selectmenu-text"),n},_renderMenu:function(e,n){var r=this,o="";t.each(n,(function(n,i){var a;i.optgroup!==o&&(a=t("<li>",{text:i.optgroup}),r._addClass(a,"ui-selectmenu-optgroup","ui-menu-divider"+(i.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),a.appendTo(e),o=i.optgroup),r._renderItemData(e,i)}))},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(e,n){var r=t("<li>"),o=t("<div>",{title:n.element.attr("title")});return n.disabled&&this._addClass(r,null,"ui-state-disabled"),this._setText(o,n.label),r.append(o).appendTo(e)},_setText:function(t,e){e?t.text(e):t.html(" ")},_move:function(t,e){var n,r,o=".ui-menu-item";this.isOpen?n=this.menuItems.eq(this.focusIndex).parent("li"):(n=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),o+=":not(.ui-state-disabled)"),(r="first"===t||"last"===t?n["first"===t?"prevAll":"nextAll"](o).eq(-1):n[t+"All"](o).eq(0)).length&&this.menuInstance.focus(e,r)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?((t=window.getSelection()).removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(e){this.isOpen&&(t(e.target).closest(".ui-selectmenu-menu, #"+t.ui.escapeSelector(this.ids.button)).length||this.close(e))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection()).rangeCount&&(this.range=t.getRangeAt(0)):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(e){var n=!0;switch(e.keyCode){case t.ui.keyCode.TAB:case t.ui.keyCode.ESCAPE:this.close(e),n=!1;break;case t.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(e);break;case t.ui.keyCode.UP:e.altKey?this._toggle(e):this._move("prev",e);break;case t.ui.keyCode.DOWN:e.altKey?this._toggle(e):this._move("next",e);break;case t.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(e):this._toggle(e);break;case t.ui.keyCode.LEFT:this._move("prev",e);break;case t.ui.keyCode.RIGHT:this._move("next",e);break;case t.ui.keyCode.HOME:case t.ui.keyCode.PAGE_UP:this._move("first",e);break;case t.ui.keyCode.END:case t.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e),n=!1}n&&e.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var n=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==n&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){var e=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(t,e){if("icons"===t){var n=this.button.find("span.ui-icon");this._removeClass(n,null,this.options.icons.button)._addClass(n,null,e.button)}this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;!1!==t?(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t)):this.button.css("width","")},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(e){var n=this,r=[];e.each((function(e,o){r.push(n._parseOption(t(o),e))})),this.items=r},_parseOption:function(t,e){var n=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:n.attr("label")||"",disabled:n.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}])})?r.apply(e,o):r)||(t.exports=i)},"7x9u":function(t,e){!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){var e=function(t){return t.getContent({source_view:!0})}(t);t.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){!function(t,e){t.focus(),t.undoManager.transact((function(){t.setContent(e)})),t.selection.setCursorLocation(),t.nodeChanged()}(t,e.getData().code),e.close()}})};t.add("code",(function(t){return function(t){t.addCommand("mceCodeEditor",(function(){e(t)}))}(t),function(t){t.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return e(t)}}),t.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return e(t)}})}(t),{}}))}()},"8Iik":function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.fn.scrollParent=function(e){var n=this.css("position"),r="absolute"===n,o=e?/(auto|scroll|hidden)/:/(auto|scroll)/,i=this.parents().filter((function(){var e=t(this);return(!r||"static"!==e.css("position"))&&o.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))})).eq(0);return"fixed"!==n&&i.length?i:t(this[0].ownerDocument||document)}})?r.apply(e,o):r)||(t.exports=i)},"8oxB":function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,c=[],l=!1,f=-1;function d(){l&&s&&(l=!1,s.length?c=s.concat(c):f=-1,c.length&&m())}function m(){if(!l){var t=u(d);l=!0;for(var e=c.length;e;){for(s=c,c=[];++f<e;)s&&s[f].run();f=-1,e=c.length}s=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new h(t,e)),1!==c.length||l||u(m)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},"9/yf":function(t,e,n){var r,o,i;o=[n("EVdn"),n("wCe6"),n("vBzC"),n("Jchv"),n("yw1R"),n("Qwlt"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){return t.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,n,r,o=this.element[0].nodeName.toLowerCase(),i="textarea"===o,a="input"===o;this.isMultiLine=i||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[i||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(o){if(this.element.prop("readOnly"))return e=!0,r=!0,void(n=!0);e=!1,r=!1,n=!1;var i=t.ui.keyCode;switch(o.keyCode){case i.PAGE_UP:e=!0,this._move("previousPage",o);break;case i.PAGE_DOWN:e=!0,this._move("nextPage",o);break;case i.UP:e=!0,this._keyEvent("previous",o);break;case i.DOWN:e=!0,this._keyEvent("next",o);break;case i.ENTER:this.menu.active&&(e=!0,o.preventDefault(),this.menu.select(o));break;case i.TAB:this.menu.active&&this.menu.select(o);break;case i.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(o),o.preventDefault());break;default:n=!0,this._searchTimeout(o)}},keypress:function(r){if(e)return e=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||r.preventDefault());if(!n){var o=t.ui.keyCode;switch(r.keyCode){case o.PAGE_UP:this._move("previousPage",r);break;case o.PAGE_DOWN:this._move("nextPage",r);break;case o.UP:this._keyEvent("previous",r);break;case o.DOWN:this._keyEvent("next",r)}}},input:function(t){if(r)return r=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),this._change(t))}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay((function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")}))},menufocus:function(e,n){var r,o;if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",(function(){t(e.target).trigger(e.originalEvent)}));o=n.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:o})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(o.value),(r=n.item.attr("aria-label")||o.value)&&t.trim(r).length&&(this.liveRegion.children().hide(),t("<div>").text(r).appendTo(this.liveRegion))},menuselect:function(e,n){var r=n.item.data("ui-autocomplete-item"),o=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=o,this._delay((function(){this.previous=o,this.selectedItem=r}))),!1!==this._trigger("select",e,{item:r})&&this._value(r.value),this.term=this._value(),this.close(e),this.selectedItem=r}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var n=this.menu.element[0];return e.target===this.element[0]||e.target===n||t.contains(n,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,n,r=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(n,r){r(t.ui.autocomplete.filter(e,n.term))}):"string"==typeof this.options.source?(n=this.options.source,this.source=function(e,o){r.xhr&&r.xhr.abort(),r.xhr=t.ajax({url:n,data:e,dataType:"json",success:function(t){o(t)},error:function(){o([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay((function(){var e=this.term===this._value(),n=this.menu.element.is(":visible"),r=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;e&&(!e||n||r)||(this.selectedItem=null,this.search(null,t))}),this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy((function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")}),this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,(function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})}))},_suggest:function(e){var n=this.menu.element.empty();this._renderMenu(n,e),this.isNewMenu=!0,this.menu.refresh(),n.show(),this._resizeMenu(),n.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,n){var r=this;t.each(n,(function(t,n){r._renderItemData(e,n)}))},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,n){return t("<li>").append(t("<div>").text(n.label)).appendTo(e)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,n){var r=new RegExp(t.ui.autocomplete.escapeRegex(n),"i");return t.grep(e,(function(t){return r.test(t.label||t.value||t)}))}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var n;this._superApply(arguments),this.options.disabled||this.cancelSearch||(n=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(n).appendTo(this.liveRegion))}}),t.ui.autocomplete})?r.apply(e,o):r)||(t.exports=i)},"9rSQ":function(t,e,n){"use strict";var r=n("xTJ+");function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=o},Aw8l:function(t,e,n){(function(t){!function(e){"use strict";var n=function(){},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},o=function(t){return function(){return t}},i=function(t){return t};function a(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var u=function(t){return function(e){return!t(e)}},s=function(t){return function(){throw new Error(t)}},c=o(!1),l=o(!0),f=tinymce.util.Tools.resolve("tinymce.ThemeManager"),d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function m(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function h(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}var p,g=function(){return v},v=function(){var t=function(t){return t.isNone()},e=function(t){return t()},r=function(t){return t};return{fold:function(t,e){return t()},is:c,isSome:c,isNone:l,getOr:r,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(void 0),or:r,orThunk:e,map:g,each:n,bind:g,exists:c,forall:l,filter:g,equals:t,equals_:t,toArray:function(){return[]},toString:o("none()")}}(),b=function(t){var e=o(t),n=function(){return i},r=function(e){return e(t)},i={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:l,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return b(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?i:v},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return i},y={some:b,none:g,from:function(t){return null==t?v:b(t)}},x=function(t){return function(e){return function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(e)===t}},w=function(t){return function(e){return typeof e===t}},C=x("string"),_=x("object"),k=x("array"),S=w("boolean"),T=function(t){return function(e){return t===e}}(void 0),D=function(t){return!function(t){return null==t}(t)},O=w("function"),E=w("number"),N=function(t,e){if(k(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},A=Array.prototype.slice,R=Array.prototype.indexOf,B=Array.prototype.push,P=function(t,e){return R.call(t,e)},I=function(t,e){return P(t,e)>-1},M=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},L=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},F=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=A.call(t,r,r+e);n.push(o)}return n},H=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},j=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},V=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var a=t[o];(e(a,o)?n:r).push(a)}return{pass:n,fail:r}},z=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},U=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}}(t,(function(t){n=e(n,t)})),n},W=function(t,e,n){return j(t,(function(t){n=e(n,t)})),n},q=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return y.some(i);if(n(i,r))break}return y.none()}(t,e,c)},$=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return y.some(n)}return y.none()},Y=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!k(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);B.apply(e,t[n])}return e},G=function(t,e){return Y(H(t,e))},K=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},X=function(t){var e=A.call(t,0);return e.reverse(),e},J=function(t,e){return z(t,(function(t){return!I(e,t)}))},Q=function(t,e){var n=A.call(t,0);return n.sort(e),n},Z=function(t){return 0===t.length?y.none():y.some(t[0])},tt=function(t){return 0===t.length?y.none():y.some(t[t.length-1])},et=O(Array.from)?Array.from:function(t){return A.call(t)},nt=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return y.none()},rt=function(t){return{is:function(e){return t===e},isValue:l,isError:c,getOr:o(t),getOrThunk:o(t),getOrDie:o(t),or:function(e){return rt(t)},orThunk:function(e){return rt(t)},fold:function(e,n){return n(t)},map:function(e){return rt(e(t))},mapError:function(e){return rt(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOption:function(){return y.some(t)}}},ot=function(t){return{is:c,isValue:c,isError:l,getOr:i,getOrThunk:function(t){return t()},getOrDie:function(){return s(String(t))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return ot(t)},mapError:function(e){return ot(e(t))},each:n,bind:function(e){return ot(t)},exists:c,forall:l,toOption:y.none}},it={value:rt,error:ot,fromOption:function(t,e){return t.fold((function(){return ot(e)}),rt)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(p||(p={}));var at=function(t,e,n){return t.stype===p.Error?e(t.serror):n(t.svalue)},ut=function(t){return{stype:p.Value,svalue:t}},st=function(t){return{stype:p.Error,serror:t}},ct=function(t){return t.fold(st,ut)},lt=function(t){return at(t,it.error,it.value)},ft=ut,dt=function(t){var e=[],n=[];return j(t,(function(t){at(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},mt=st,ht=function(t,e){return t.stype===p.Value?e(t.svalue):t},pt=function(t,e){return t.stype===p.Error?e(t.serror):t},gt=function(t,e){return t.stype===p.Value?{stype:p.Value,svalue:e(t.svalue)}:t},vt=function(t,e){return t.stype===p.Error?{stype:p.Error,serror:e(t.serror)}:t},bt=Object.keys,yt=Object.hasOwnProperty,xt=function(t,e){for(var n=bt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},wt=function(t,e){return Ct(t,(function(t,n){return{k:n,v:e(t,n)}}))},Ct=function(t,e){var n={};return xt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},_t=function(t,e){var r={};return function(t,e,n,r){xt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(r),n),r},kt=function(t,e){var n=[];return xt(t,(function(t,r){n.push(e(t,r))})),n},St=function(t,e){for(var n=bt(t),r=0,o=n.length;r<o;r++){var i=n[r],a=t[i];if(e(a,i,t))return y.some(a)}return y.none()},Tt=function(t){return kt(t,(function(t){return t}))},Dt=function(t,e){return Ot(t,e)?y.from(t[e]):y.none()},Ot=function(t,e){return yt.call(t,e)},Et=function(t,e){return Ot(t,e)&&void 0!==t[e]&&null!==t[e]},Nt=function(t){if(!k(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var n=[],r={};return j(t,(function(o,i){var a=bt(o);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],s=o[u];if(void 0!==r[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!k(s))throw new Error("case arguments must be an array");n.push(u),r[u]=function(){var r=arguments.length;if(r!==s.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+s.length+" ("+s+"), got "+r);for(var o=new Array(r),a=0;a<o.length;a++)o[a]=arguments[a];var c=function(t){var e=bt(t);if(n.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+n.join(",")+"\nActual: "+e.join(","));if(!K(n,(function(t){return I(e,t)})))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+n.join(", "));return t[u].apply(null,o)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[i];return e.apply(null,o)},match:c,log:function(t){e.console.log(t,{constructors:n,constructor:u,params:o})}}}})),r},At=Object.prototype.hasOwnProperty,Rt=function(t){return function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var a in i)At.call(i,a)&&(r[a]=t(r[a],i[a]))}return r}},Bt=Rt((function(t,e){return _(t)&&_(e)?Bt(t,e):e})),Pt=Rt((function(t,e){return e})),It=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Mt=Nt([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Lt=function(t){return Mt.defaultedThunk(o(t))},Ft=function(t){return Mt.mergeWithThunk(o(t))},Ht=Mt.strict,jt=Mt.asOption,Vt=Mt.defaultedThunk,zt=(Mt.asDefaultedOptionThunk,Mt.mergeWithThunk),Ut=function(t,e){var n;return(n={})[t]=e,n},Wt=(Nt([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t,e){return function(t,e){var n={};return xt(t,(function(t,r){I(e,r)||(n[r]=t)})),n}(t,e)}),qt=function(t,e){return Ut(t,e)},$t=function(t){return function(t){var e={};return j(t,(function(t){e[t.key]=t.value})),e}(t)},Yt=function(t,e){var n,r=function(t){var e=[],n=[];return j(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}(t);return r.errors.length>0?(n=r.errors,it.error(Y(n))):function(t,e){return 0===t.length?it.value(e):it.value(Bt(e,Pt.apply(void 0,t)))}(r.values,e)},Gt=function(t){return r(mt,Y)(t)},Kt=function(t,e){var n=dt(t);return n.errors.length>0?Gt(n.errors):function(t,e){return t.length>0?ft(Bt(e,Pt.apply(void 0,t))):ft(e)}(n.values,e)},Xt=function(t){var e=dt(t);return e.errors.length>0?Gt(e.errors):ft(e.values)},Jt=function(t){return _(t)&&bt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},Qt=function(t,e){return mt([{path:t,getErrorInfo:e}])},Zt=Nt([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),te=function(t,e,n){return Dt(e,n).fold((function(){return function(t,e,n){return Qt(t,(function(){return'Could not find valid *strict* value for "'+e+'" in '+Jt(n)}))}(t,n,e)}),ft)},ee=function(t,e,n){var r=Dt(t,e).fold((function(){return n(t)}),i);return ft(r)},ne=function(t,e,n,r){return n.fold((function(n,i,a,u){var s=function(e){var o=u.extract(t.concat([n]),r,e);return gt(o,(function(t){return Ut(i,r(t))}))},c=function(e){return e.fold((function(){var t=Ut(i,r(y.none()));return ft(t)}),(function(e){var o=u.extract(t.concat([n]),r,e);return gt(o,(function(t){return Ut(i,r(y.some(t)))}))}))};return a.fold((function(){return ht(te(t,e,n),s)}),(function(t){return ht(ee(e,n,t),s)}),(function(){return ht(function(t,e){return ft(Dt(t,e))}(e,n),c)}),(function(t){return ht(function(t,e,n){var r=Dt(t,e).map((function(e){return!0===e?n(t):e}));return ft(r)}(e,n,t),c)}),(function(t){var r=t(e),i=gt(ee(e,n,o({})),(function(t){return Bt(r,t)}));return ht(i,s)}))}),(function(t,n){var o=n(e);return ft(Ut(t,r(o)))}))},re=function(t){return{extract:function(e,n,r){return pt(t(r,n),(function(t){return function(t,e){return Qt(t,(function(){return e}))}(e,t)}))},toString:function(){return"val"}}},oe=function(t){return bt(_t(t,(function(t){return null!=t})))},ie=function(t){var e=ae(t),n=U(t,(function(t,e){return e.fold((function(e){return Bt(t,qt(e,!0))}),o(t))}),{});return{extract:function(t,r,o){var i=S(o)?[]:oe(o),a=z(i,(function(t){return!Et(n,t)}));return 0===a.length?e.extract(t,r,o):function(t,e){return Qt(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,a)},toString:e.toString}},ae=function(t){return{extract:function(e,n,r){return function(t,e,n,r){var o=H(n,(function(n){return ne(t,e,n,r)}));return Kt(o,{})}(e,r,t,n)},toString:function(){return"obj{\n"+H(t,(function(t){return t.fold((function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},ue=function(t){return{extract:function(e,n,r){var o=H(r,(function(r,o){return t.extract(e.concat(["["+o+"]"]),n,r)}));return Xt(o)},toString:function(){return"array("+t.toString()+")"}}},se=function(t,e){return{extract:function(n,r,o){var a=bt(o),u=function(e,n){return ue(re(t)).extract(e,i,n)}(n,a);return ht(u,(function(t){var i=H(t,(function(t){return Zt.field(t,t,Ht(),e)}));return ae(i).extract(n,r,o)}))},toString:function(){return"setOf("+e.toString()+")"}}},ce=o(re(ft)),le=r(ue,ae),fe=Zt.state,de=Zt.field,me=function(t,e,n,r,o){return Dt(r,o).fold((function(){return function(t,e,n){return Qt(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Jt(e)}))}(t,r,o)}),(function(r){return r.extract(t.concat(["branch: "+o]),e,n)}))},he=function(t,e){return{extract:function(n,r,o){return Dt(o,t).fold((function(){return function(t,e){return Qt(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return me(n,r,o,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+bt(e)}}},pe=re(ft),ge=function(t){return le(t)},ve=function(t){return{extract:function(e,n,r){return t().extract(e,n,r)},toString:function(){return t().toString()}}},be=function(t){return re((function(e){return t(e).fold(mt,ft)}))},ye=function(t,e){return se((function(e){return ct(t(e))}),e)},xe=function(t,e,n){return lt(function(t,e,n,r){var o=e.extract([t],n,r);return vt(o,(function(t){return{input:r,errors:t}}))}(t,e,i,n))},we=function(t){return t.fold((function(t){throw new Error(_e(t))}),i)},Ce=function(t,e,n){return we(xe(t,e,n))},_e=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,H(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+Jt(t.input);var e,n},ke=function(t,e){return he(t,e)},Se=function(t,e){return he(t,wt(e,ae))},Te=o(pe),De=function(t,e){return re((function(n){var r=typeof n;return t(n)?ft(n):mt("Expected type: "+e+" but got: "+r)}))},Oe=De(E,"number"),Ee=De(C,"string"),Ne=De(S,"boolean"),Ae=De(O,"function"),Re=function(t){var e=function(t,e){for(var n=t.next();!n.done;){if(!e(n.value))return!1;n=t.next()}return!0};if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every((function(e){return Re(t[e])}));case"Map":return e(t.keys(),Re)&&e(t.values(),Re);case"Set":return e(t.keys(),Re);default:return!1}},Be=re((function(t){return Re(t)?ft(t):mt("Expected value to be acceptable for sending via postMessage")})),Pe=function(t){return be((function(e){return I(t,e)?it.value(e):it.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},Ie=function(t){return de(t,t,Ht(),ce())},Me=function(t,e){return de(t,t,Ht(),e)},Le=function(t){return Me(t,Oe)},Fe=function(t){return Me(t,Ee)},He=function(t,e){return de(t,t,Ht(),Pe(e))},je=function(t){return Me(t,Ae)},Ve=function(t,e){return de(t,t,Ht(),ae(e))},ze=function(t,e){return de(t,t,Ht(),le(e))},Ue=function(t,e){return de(t,t,Ht(),ue(e))},We=function(t){return de(t,t,jt(),ce())},qe=function(t,e){return de(t,t,jt(),e)},$e=function(t){return qe(t,Oe)},Ye=function(t){return qe(t,Ee)},Ge=function(t){return qe(t,Ae)},Ke=function(t,e){return qe(t,ae(e))},Xe=function(t,e){return de(t,t,Lt(e),ce())},Je=function(t,e,n){return de(t,t,Lt(e),n)},Qe=function(t,e){return Je(t,e,Oe)},Ze=function(t,e){return Je(t,e,Ee)},tn=function(t,e,n){return Je(t,e,Pe(n))},en=function(t,e){return Je(t,e,Ne)},nn=function(t,e){return Je(t,e,Ae)},rn=function(t,e,n){return Je(t,e,ae(n))},on=function(t,e){return fe(t,e)},an=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},un=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:o(t)}},sn={fromHtml:function(t,n){var r=(n||e.document).createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw e.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return un(r.childNodes[0])},fromTag:function(t,n){var r=(n||e.document).createElement(t);return un(r)},fromText:function(t,n){var r=(n||e.document).createTextNode(t);return un(r)},fromDom:un,fromPoint:function(t,e,n){var r=t.dom();return y.from(r.elementFromPoint(e,n)).map(un)}},cn=function(){return ln(0,0)},ln=function(t,e){return{major:t,minor:e}},fn={nu:ln,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?cn():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return ln(r(1),r(2))}(t,n)},unknown:cn},dn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},mn={unknown:function(){return dn({current:void 0,version:fn.unknown()})},nu:dn,edge:o("Edge"),chrome:o("Chrome"),ie:o("IE"),opera:o("Opera"),firefox:o("Firefox"),safari:o("Safari")},hn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},pn={unknown:function(){return hn({current:void 0,version:fn.unknown()})},nu:hn,windows:o("Windows"),ios:o("iOS"),android:o("Android"),linux:o("Linux"),osx:o("OSX"),solaris:o("Solaris"),freebsd:o("FreeBSD"),chromeos:o("ChromeOS")},gn=function(t,e){var n=String(e).toLowerCase();return q(t,(function(t){return t.search(n)}))},vn=function(t,e){return gn(t,e).map((function(t){var n=fn.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},bn=function(t,e){return gn(t,e).map((function(t){var n=fn.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},yn=function(t,e){return-1!==t.indexOf(e)},xn=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),wn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Cn=function(t){return function(e){return yn(e,t)}},_n=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return yn(t,"edge/")&&yn(t,"chrome")&&yn(t,"safari")&&yn(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,wn],search:function(t){return yn(t,"chrome")&&!yn(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return yn(t,"msie")||yn(t,"trident")}},{name:"Opera",versionRegexes:[wn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Cn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Cn("firefox")},{name:"Safari",versionRegexes:[wn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(yn(t,"safari")||yn(t,"mobile/"))&&yn(t,"applewebkit")}}],kn=[{name:"Windows",search:Cn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return yn(t,"iphone")||yn(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Cn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Cn("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Cn("linux"),versionRegexes:[]},{name:"Solaris",search:Cn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Cn("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Cn("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Sn={browsers:o(_n),oses:o(kn)},Tn=function(t,e){var n=Sn.browsers(),r=Sn.oses(),i=vn(n,t).fold(mn.unknown,mn.nu),a=bn(r,t).fold(pn.unknown,pn.nu),u=function(t,e,n,r){var i=t.isiOS()&&!0===/ipad/i.test(n),a=t.isiOS()&&!i,u=t.isiOS()||t.isAndroid(),s=u||r("(pointer:coarse)"),c=i||!a&&u&&r("(min-device-width:768px)"),l=a||u&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!c&&!f;return{isiPad:o(i),isiPhone:o(a),isTablet:o(c),isPhone:o(l),isTouch:o(s),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:o(f),isDesktop:o(d)}}(a,i,t,e);return{browser:i,os:a,deviceType:u}},Dn=function(t){return e.window.matchMedia(t).matches},On=It((function(){return Tn(e.navigator.userAgent,Dn)})),En=function(){return On()},Nn=function(t,e){var n=t.dom();if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},An=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Rn=function(t,e){return t.dom()===e.dom()},Bn=function(t,n){return function(t,n){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,n,e.Node.DOCUMENT_POSITION_CONTAINED_BY)}(t.dom(),n.dom())},Pn=function(t,e){return En().browser.isIE()?Bn(t,e):function(t,e){var n=t.dom(),r=e.dom();return n!==r&&n.contains(r)}(t,e)},In=function(t){return O(t)?t:o(!1)},Mn=function(t,e,n){for(var r=t.dom(),o=In(n);r.parentNode;){r=r.parentNode;var i=sn.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return y.none()},Ln=function(t,e,n){var r=e(t),o=In(n);return r.orThunk((function(){return o(t)?y.none():Mn(t,e,o)}))},Fn=function(t,e){return Rn(t.element(),e.event().target())},Hn=function(t){if(!Et(t,"can")&&!Et(t,"abort")&&!Et(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return Ce("Extracting event.handler",ie([Xe("can",o(!0)),Xe("abort",o(!1)),Xe("run",n)]),t)},jn=function(t){var e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return W(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),n=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return W(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort}));return Hn({can:e,abort:n,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];j(t,(function(t){t.run.apply(void 0,e)}))}})},Vn=o("touchstart"),zn=o("touchmove"),Un=o("touchend"),Wn=o("touchcancel"),qn=o("mousedown"),$n=o("mousemove"),Yn=o("mouseout"),Gn=o("mouseup"),Kn=o("mouseover"),Xn=o("focusin"),Jn=o("focusout"),Qn=o("keydown"),Zn=o("keyup"),tr=o("input"),er=o("change"),nr=o("click"),rr=o("transitionend"),or=o("selectstart"),ir={tap:o("alloy.tap")},ar=o("alloy.focus"),ur=o("alloy.blur.post"),sr=o("alloy.paste.post"),cr=o("alloy.receive"),lr=o("alloy.execute"),fr=o("alloy.focus.item"),dr=ir.tap,mr=o("alloy.longpress"),hr=o("alloy.sandbox.close"),pr=o("alloy.typeahead.cancel"),gr=o("alloy.system.init"),vr=o("alloy.system.touchmove"),br=o("alloy.system.touchend"),yr=o("alloy.system.scroll"),xr=o("alloy.system.resize"),wr=o("alloy.system.attached"),Cr=o("alloy.system.detached"),_r=o("alloy.system.dismissRequested"),kr=o("alloy.system.repositionRequested"),Sr=o("alloy.focusmanager.shifted"),Tr=o("alloy.slotcontainer.visibility"),Dr=o("alloy.change.tab"),Or=o("alloy.dismiss.tab"),Er=o("alloy.highlight"),Nr=o("alloy.dehighlight"),Ar=function(t,e){Ir(t,t.element(),e,{})},Rr=function(t,e,n){Ir(t,t.element(),e,n)},Br=function(t){Ar(t,lr())},Pr=function(t,e,n){Ir(t,e,n,{})},Ir=function(t,e,n,r){var i=d({target:e},r);t.getSystem().triggerEvent(n,e,wt(i,o))},Mr=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event())},Lr=function(t){return $t(t)},Fr=function(t,e){return{key:t,value:Hn({abort:e})}},Hr=function(t){return{key:t,value:Hn({run:function(t,e){e.event().prevent()}})}},jr=function(t,e){return{key:t,value:Hn({run:e})}},Vr=function(t,e,n){return{key:t,value:Hn({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},zr=function(t){return function(e){return{key:t,value:Hn({run:function(t,n){Fn(t,n)&&e(t,n)}})}}},Ur=function(t,e,n){return function(t,e){return jr(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){Mr(e,e.element(),t,r)}))}))}(t,e.partUids[n])},Wr=function(t,e){return jr(t,(function(t,n){var r=n.event(),i=t.getSystem().getByDom(r.target()).fold((function(){return Ln(r.target(),(function(e){return t.getSystem().getByDom(e).toOption()}),o(!1)).getOr(t)}),(function(t){return t}));e(t,i,n)}))},qr=function(t){return jr(t,(function(t,e){e.cut()}))},$r=function(t){return jr(t,(function(t,e){e.stop()}))},Yr=function(t,e){return zr(t)(e)},Gr=zr(wr()),Kr=zr(Cr()),Xr=zr(gr()),Jr=function(t){return function(e){return jr(t,e)}}(lr()),Qr=(void 0!==e.window?e.window:Function("return this;")(),function(t){return t.dom().nodeName.toLowerCase()}),Zr=function(t){return function(e){return function(t){return t.dom().nodeType}(e)===t}},to=Zr(1),eo=Zr(3),no=Zr(9),ro=Zr(11),oo=function(t){return sn.fromDom(t.dom().ownerDocument)},io=function(t){return no(t)?t:oo(t)},ao=function(t){return sn.fromDom(t.dom().ownerDocument.documentElement)},uo=function(t){return sn.fromDom(t.dom().ownerDocument.defaultView)},so=function(t){return y.from(t.dom().parentNode).map(sn.fromDom)},co=function(t){return y.from(t.dom().offsetParent).map(sn.fromDom)},lo=function(t){return H(t.dom().childNodes,sn.fromDom)},fo=function(t,e){var n=t.dom().childNodes;return y.from(n[e]).map(sn.fromDom)},mo=function(t,e){so(t).each((function(n){n.dom().insertBefore(e.dom(),t.dom())}))},ho=function(t,e){(function(t){return y.from(t.dom().nextSibling).map(sn.fromDom)})(t).fold((function(){so(t).each((function(t){go(t,e)}))}),(function(t){mo(t,e)}))},po=function(t,e){(function(t){return fo(t,0)})(t).fold((function(){go(t,e)}),(function(n){t.dom().insertBefore(e.dom(),n.dom())}))},go=function(t,e){t.dom().appendChild(e.dom())},vo=function(t,e){j(e,(function(e){go(t,e)}))},bo=function(t){t.dom().textContent="",j(lo(t),(function(t){yo(t)}))},yo=function(t){var e=t.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},xo=function(t){var e,n=lo(t);n.length>0&&(e=t,j(n,(function(t){mo(e,t)}))),yo(t)},wo=function(t){return t.dom().innerHTML},Co=function(t,n){var r,o,i=oo(t).dom(),a=sn.fromDom(i.createDocumentFragment()),u=(r=n,(o=(i||e.document).createElement("div")).innerHTML=r,lo(sn.fromDom(o)));vo(a,u),bo(t),go(t,a)},_o=function(t,n,r){if(!(C(r)||S(r)||E(r)))throw e.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,r+"")},ko=function(t,e,n){_o(t.dom(),e,n)},So=function(t,e){var n=t.dom().getAttribute(e);return null===n?void 0:n},To=function(t,e){return y.from(So(t,e))},Do=function(t,e){var n=t.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Oo=function(t,e){t.dom().removeAttribute(e)},Eo=function(t){return function(t,e){return sn.fromDom(t.dom().cloneNode(e))}(t,!1)},No=function(t){return function(t){var e=sn.fromTag("div"),n=sn.fromDom(t.dom().cloneNode(!0));return go(e,n),wo(e)}(Eo(t))},Ao=function(t){return No(t)},Ro=Lr([function(t,e){return{key:t,value:Hn({can:e})}}(ar(),(function(t,n){var r=n.event().originator(),o=n.event().target();return!function(t,e,n){return Rn(e,t.element())&&!Rn(e,n)}(t,r,o)||(e.console.warn(ar()+" did not get interpreted by the desired target. \nOriginator: "+Ao(r)+"\nTarget: "+Ao(o)+"\nCheck the "+ar()+" event handlers"),!1)}))]),Bo=Object.freeze({__proto__:null,events:Ro}),Po=0,Io=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Po+String(e)},Mo=o("alloy-id-"),Lo=o("data-alloy-id"),Fo=Mo(),Ho=Lo(),jo=function(t,e){Object.defineProperty(t.dom(),Ho,{value:e,writable:!0})},Vo=function(t){var e=to(t)?t.dom()[Ho]:null;return y.from(e)},zo=function(t){return Io(t)},Uo=i,Wo=function(t){var e=function(e){return function(){throw new Error("The component must be in a context to send: "+e+(t?"\n"+Ao(t().element())+" is not in context.":""))}};return{debugInfo:o("fake"),triggerEvent:e("triggerEvent"),triggerFocus:e("triggerFocus"),triggerEscape:e("triggerEscape"),build:e("build"),addToWorld:e("addToWorld"),removeFromWorld:e("removeFromWorld"),addToGui:e("addToGui"),removeFromGui:e("removeFromGui"),getByUid:e("getByUid"),getByDom:e("getByDom"),broadcast:e("broadcast"),broadcastOn:e("broadcastOn"),broadcastEvent:e("broadcastEvent"),isConnected:o(!1)}},qo=Wo(),$o=function(t){return H(t,(function(t){return function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,t.length-e.length)}(t,"/*")?t.substring(0,t.length-"/*".length):t}))},Yo=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:$o(i)}},t},Go=Io("alloy-premade"),Ko=function(t){return qt(Go,t)},Xo=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:$o(i.slice(1))}},t}((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,h([e.getApis(),e],n))}),t)},Jo={init:function(){return Qo({readState:function(){return"No State required"}})}},Qo=function(t){return t},Zo=function(t,e){var n={};return xt(t,(function(t,r){xt(t,(function(t,o){var i=Dt(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},ti=function(t){return{classes:void 0!==t.classes?t.classes:[],attributes:void 0!==t.attributes?t.attributes:{},styles:void 0!==t.styles?t.styles:{}}},ei=function(t,e){return n=a.apply(void 0,[t.handler].concat(e)),r=t.purpose(),{cHandler:n,purpose:o(r)};var n,r},ni=function(t){return t.cHandler},ri=function(t,e){return{name:o(t),handler:o(e)}},oi=function(t,e,n){var r=d(d({},n),function(t,e){var n={};return j(t,(function(t){n[t.name()]=t.handlers(e)})),n}(e,t));return Zo(r,ri)},ii=function(t){var e=function(t){return O(t)?{can:o(!0),abort:o(!1),run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}},ai=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=Q(n,(function(n,o){var i=n[e](),a=o[e](),u=r.indexOf(i),s=r.indexOf(a);if(-1===u)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===s)throw new Error("The ordering for "+t+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(r,null,2));return u<s?-1:s<u?1:0}));return it.value(o)}catch(t){return it.error([t])}}("Event: "+n,"name",t,r).map((function(t){var e=H(t,(function(t){return t.handler()}));return jn(e)})):function(t,e){return it.error(["The event ("+t+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(H(e,(function(t){return t.name()})),null,2)])}(n,t)},ui=function(t,e){var n=kt(t,(function(t,n){return(1===t.length?it.value(t[0].handler()):ai(t,e,n)).map((function(r){var i=ii(r),a=t.length>1?z(e[n],(function(e){return M(t,(function(t){return t.name()===e}))})).join(" > "):t[0].name();return qt(n,function(t,e){return{handler:t,purpose:o(e)}}(i,a))}))}));return Yt(n,{})},si=function(t){return t.events},ci=function(t,e){var n=So(t,e);return void 0===n||""===n?[]:n.split(" ")},li=function(t){return void 0!==t.dom().classList},fi=function(t,e){return function(t,e,n){var r=ci(t,e).concat([n]);return ko(t,e,r.join(" ")),!0}(t,"class",e)},di=function(t,e){return function(t,e,n){var r=z(ci(t,e),(function(t){return t!==n}));return r.length>0?ko(t,e,r.join(" ")):Oo(t,e),!1}(t,"class",e)},mi=function(t,e){li(t)?t.dom().classList.add(e):fi(t,e)},hi=function(t){0===(li(t)?t.dom().classList:function(t){return ci(t,"class")}(t)).length&&Oo(t,"class")},pi=function(t,e){li(t)?t.dom().classList.remove(e):di(t,e);hi(t)},gi=function(t,e){return li(t)&&t.dom().classList.contains(e)},vi=function(t,e){j(e,(function(e){mi(t,e)}))},bi=function(t,e){j(e,(function(e){pi(t,e)}))},yi=function(t){return void 0!==t.style&&O(t.style.getPropertyValue)},xi=function(t){return ro(t)},wi=O(e.Element.prototype.attachShadow)&&O(e.Node.prototype.getRootNode),Ci=o(wi),_i=wi?function(t){return sn.fromDom(t.dom().getRootNode())}:io,ki=function(t){return sn.fromDom(t.dom().host)},Si=function(t){return D(t.dom().shadowRoot)},Ti=function(t){var e,n,r=eo(t)?t.dom().parentNode:t.dom();return null!=r&&null!==r.ownerDocument&&function(t){var e=_i(t);return xi(e)?y.some(e):y.none()}(sn.fromDom(r)).fold((function(){return r.ownerDocument.body.contains(r)}),(e=Ti,n=ki,function(t){return e(n(t))}))},Di=function(){return Oi(sn.fromDom(e.document))},Oi=function(t){var e=t.dom().body;if(null==e)throw new Error("Body is not available yet");return sn.fromDom(e)},Ei=function(t,n,r){if(!C(r))throw e.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",t),new Error("CSS value must be a string: "+r);yi(t)&&t.style.setProperty(n,r)},Ni=function(t,e){yi(t)&&t.style.removeProperty(e)},Ai=function(t,e,n){var r=t.dom();Ei(r,e,n)},Ri=function(t,e){var n=t.dom();xt(e,(function(t,e){Ei(n,e,t)}))},Bi=function(t,e){var n=t.dom();xt(e,(function(t,e){t.fold((function(){Ni(n,e)}),(function(t){Ei(n,e,t)}))}))},Pi=function(t,n){var r=t.dom(),o=e.window.getComputedStyle(r).getPropertyValue(n);return""!==o||Ti(t)?o:Ii(r,n)},Ii=function(t,e){return yi(t)?t.style.getPropertyValue(e):""},Mi=function(t,e){var n=t.dom(),r=Ii(n,e);return y.from(r).filter((function(t){return t.length>0}))},Li=function(t){var e={},n=t.dom();if(yi(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},Fi=function(t,e,n){var r=sn.fromTag(t);return Ai(r,e,n),Mi(r,e).isSome()},Hi=function(t,e){var n=t.dom();Ni(n,e),To(t,"style").map(xn).is("")&&Oo(t,"style")},ji=function(t){return t.dom().offsetWidth},Vi=function(t){return t.dom().value},zi=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom().value=e},Ui=function(t){var e=sn.fromTag(t.tag);!function(t,e){var n=t.dom();xt(e,(function(t,e){_o(n,e,t)}))}(e,t.attributes),vi(e,t.classes),Ri(e,t.styles),t.innerHtml.each((function(t){return Co(e,t)}));var n=t.domChildren;return vo(e,n),t.value.each((function(t){zi(e,t)})),t.uid,jo(e,t.uid),e},Wi=function(t,e){return function(t,e){var n=H(e,(function(t){return Ke(t.name(),[Ie("config"),Xe("state",Jo)])})),r=xe("component.behaviours",ae(n),t.behaviours).fold((function(e){throw new Error(_e(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),(function(t){return t}));return{list:e,data:wt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return function(){return e}}))}}(t,e)},qi=function(t){var e=function(t){var e=Dt(t,"behaviours").getOr({}),n=z(bt(e),(function(t){return void 0!==e[t]}));return H(n,(function(t){return e[t].me}))}(t);return Wi(t,e)},$i=function(t,e,n){var r,o,i,a=d(d({},(r=t).dom),{uid:r.uid,domChildren:H(r.components,(function(t){return t.element()}))}),u=function(t){return t.domModification.fold((function(){return ti({})}),ti)}(t),s={"alloy.base.modification":u},c=e.length>0?function(t,e,n,r){var o=d({},e);j(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=Zo(o,(function(t,e){return{name:t,modification:e}})),a=function(t){return U(t,(function(t,e){return d(d({},e.modification),t)}),{})},u=U(i.classes,(function(t,e){return e.modification.concat(t)}),[]),s=a(i.attributes),c=a(i.styles);return ti({classes:u,attributes:s,styles:c})}(n,s,e,a):u;return i=c,d(d({},o=a),{attributes:d(d({},o.attributes),i.attributes),styles:d(d({},o.styles),i.styles),classes:o.classes.concat(i.classes)})},Yi=function(t,e,n){var r={"alloy.base.behaviour":si(t)};return function(t,e,n,r){var o=oi(t,n,r);return ui(o,e)}(n,t.eventOrder,e,r).getOrDie()},Gi=function(t){var e=function(){return d},n=an(qo),r=we(function(t){return xe("custom.definition",ae([de("dom","dom",Ht(),ae([Ie("tag"),Xe("styles",{}),Xe("classes",[]),Xe("attributes",{}),We("value"),We("innerHtml")])),Ie("components"),Ie("uid"),Xe("events",{}),Xe("apis",{}),de("eventOrder","eventOrder",Ft({"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],touchstart:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"],"alloy.receive":["receiving","reflecting","tooltipping"]}),Te()),We("domModification")]),t)}(t)),i=qi(t),a=function(t){return t.list}(i),u=function(t){return t.data}(i),s=$i(r,a,u),c=Ui(s),l=Yi(r,a,u),f=an(r.components),d={getSystem:n.get,config:function(e){var n=u;return(O(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return O(u[t.name()])},spec:o(t),readState:function(t){return u[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(Wo(e))},element:o(c),syncComponents:function(){var t=lo(c),e=G(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),(function(t){return[t]}))}));f.set(e)},components:f.get,events:o(l)};return d},Ki=function(t){var e=Uo(t),n=e.events,r=m(e,["events"]),o=function(t){var e=Dt(t,"components").getOr([]);return H(e,Zi)}(r),i=d(d({},r),{events:d(d({},Bo),n),components:o});return it.value(Gi(i))},Xi=function(t){var e=sn.fromText(t);return Ji({element:e})},Ji=function(t){var e=Ce("external.component",ie([Ie("element"),We("uid")]),t),r=an(Wo());e.uid.each((function(t){jo(e.element,t)}));var i={getSystem:r.get,config:y.none,hasConfigured:o(!1),connect:function(t){r.set(t)},disconnect:function(){r.set(Wo((function(){return i})))},getApis:function(){return{}},element:o(e.element),spec:o(t),readState:o("No state"),syncComponents:n,components:o([]),events:o({})};return Ko(i)},Qi=zo,Zi=function(t){return function(t){return Dt(t,Go)}(t).fold((function(){var e=t.hasOwnProperty("uid")?t:d({uid:Qi("")},t);return Ki(e).getOrDie()}),(function(t){return t}))},ta=Ko;function ea(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Pi(n,t);return parseFloat(o)||0}return r},r=function(t,e){return W(e,(function(e,n){var r=Pi(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!E(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom();yi(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}var na=ea("height",(function(t){var e=t.dom();return Ti(t)?e.getBoundingClientRect().height:e.offsetHeight})),ra=function(t){return na.get(t)},oa=function(t){return na.getOuter(t)},ia=function(t,e){return{left:o(t),top:o(e),translate:function(n,r){return ia(t+n,e+r)}}},aa=ia,ua=function(t,e){return void 0!==t?t:void 0!==e?e:0},sa=function(t){var e=t.dom().ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom())return aa(n.offsetLeft,n.offsetTop);var i=ua(r.pageYOffset,o.scrollTop),a=ua(r.pageXOffset,o.scrollLeft),u=ua(o.clientTop,n.clientTop),s=ua(o.clientLeft,n.clientLeft);return ca(t).translate(a-s,i-u)},ca=function(t){var e=t.dom(),n=e.ownerDocument.body;return n===e?aa(n.offsetLeft,n.offsetTop):Ti(t)?function(t){var e=t.getBoundingClientRect();return aa(e.left,e.top)}(e):aa(0,0)},la=ea("width",(function(t){return t.dom().offsetWidth})),fa=function(t){return la.get(t)},da=function(t){return la.getOuter(t)},ma=function(t){var e=sn.fromDom(function(t){if(Ci()&&D(t.target)){var e=sn.fromDom(t.target);if(to(e)&&Si(sn.fromDom(t.target))){var n=t;if(n.composed&&n.composedPath){var r=n.composedPath();if(r)return Z(r)}}}return y.from(t.target)}(t).getOr(t.target)),n=function(){return t.stopPropagation()},i=function(){return t.preventDefault()},a=r(i,n);return function(t,e,n,r,i,a,u){return{target:o(t),x:o(e),y:o(n),stop:r,prevent:i,kill:a,raw:o(u)}}(e,t.clientX,t.clientY,n,i,a,t)},ha=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(ma(n))}}(n,r);return t.dom().addEventListener(e,i,o),{unbind:a(pa,t,e,i,o)}},pa=function(t,e,n,r){t.dom().removeEventListener(e,n,r)},ga=function(t){var n=void 0!==t?t.dom():e.document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return aa(r,o)},va=function(t,n,r){(void 0!==r?r.dom():e.document).defaultView.scrollTo(t,n)},ba=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},ya=function(t){var n=void 0===t?e.window:t,r=n.document,o=ga(sn.fromDom(r));return function(t){var n=void 0===t?e.window:t;return y.from(n.visualViewport)}(n).fold((function(){var t=n.document.documentElement,e=t.clientWidth,r=t.clientHeight;return ba(o.left(),o.top(),e,r)}),(function(t){return ba(Math.max(t.pageLeft,o.left()),Math.max(t.pageTop,o.top()),t.width,t.height)}))},xa=function(t,e){return t.view(e).fold(o([]),(function(e){var n=t.owner(e),r=xa(t,n);return[e].concat(r)}))},wa=Object.freeze({__proto__:null,view:function(t){return(t.dom()===e.document?y.none():y.from(t.dom().defaultView.frameElement)).map(sn.fromDom)},owner:function(t){return oo(t)}}),Ca=function(t){var n=sn.fromDom(e.document),r=ga(n);return function(t,e){var n=e.owner(t),r=xa(e,n);return y.some(r)}(t,wa).fold(a(sa,t),(function(e){var n=ca(t),o=U(e,(function(t,e){var n=ca(e);return{left:t.left+n.left(),top:t.top+n.top()}}),{left:0,top:0});return aa(o.left+n.left()+r.left(),o.top+n.top()+r.top())}))},_a=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},ka=function(t){var e=sa(t),n=da(t),r=oa(t);return _a(e.left(),e.top(),n,r)},Sa=function(t){var e=Ca(t),n=da(t),r=oa(t);return _a(e.left(),e.top(),n,r)},Ta=function(){return ya(e.window)};function Da(t,e,n,r,o){return t(n,r)?y.some(n):O(o)&&o(n)?y.none():e(n,r,o)}var Oa,Ea=function(t,e,n){for(var r=t.dom(),i=O(n)?n:o(!1);r.parentNode;){r=r.parentNode;var a=sn.fromDom(r);if(e(a))return y.some(a);if(i(a))break}return y.none()},Na=function(t,e,n){return Da((function(t,e){return e(t)}),Ea,t,e,n)},Aa=function(t,e,n){return Na(t,e,n).isSome()},Ra=function(t,e,n){return Ea(t,(function(t){return Nn(t,e)}),n)},Ba=function(t,n){return function(t,n){var r=void 0===n?e.document:n.dom();return An(r)?y.none():y.from(r.querySelector(t)).map(sn.fromDom)}(n,t)},Pa=function(t,e,n){return Da((function(t,e){return Nn(t,e)}),Ra,t,e,n)},Ia=function(){var t=Io("aria-owns");return{id:t,link:function(e){ko(e,"aria-owns",t)},unlink:function(t){Oo(t,"aria-owns")}}},Ma=function(t,e){return function(t){return Na(t,(function(t){if(!to(t))return!1;var e=So(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1})).bind((function(t){var e=So(t,"id"),n=oo(t);return Ba(n,'[aria-owns="'+e+'"]')}))}(e).exists((function(e){return La(t,e)}))},La=function(t,e){return Aa(e,(function(e){return Rn(e,t.element())}),o(!1))||Ma(t,e)};!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(Oa||(Oa={}));var Fa,Ha=an({}),ja=function(t,n,r){switch(Dt(Ha.get(),t).orThunk((function(){var e=bt(Ha.get());return nt(e,(function(e){return t.indexOf(e)>-1?y.some(Ha.get()[e]):y.none()}))})).getOr(Oa.NORMAL)){case Oa.NORMAL:return r(Ua());case Oa.LOGGING:var o=function(t,n){var r=[],o=(new Date).getTime();return{logEventCut:function(t,e,n){r.push({outcome:"cut",target:e,purpose:n})},logEventStopped:function(t,e,n){r.push({outcome:"stopped",target:e,purpose:n})},logNoParent:function(t,e,n){r.push({outcome:"no-parent",target:e,purpose:n})},logEventNoHandlers:function(t,e){r.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,n){r.push({outcome:"response",purpose:n,target:e})},write:function(){var i=(new Date).getTime();I(["mousemove","mouseover","mouseout",gr()],t)||e.console.log(t,{event:t,time:i-o,target:n.dom(),sequence:H(r,(function(t){return I(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Ao(t.target)+")":t.outcome}))})}}}(t,n),i=r(o);return o.write(),i;case Oa.STOP:return!0}},Va=["alloy/data/Fields","alloy/debugging/Debugging"],za=function(t,e,n){return ja(t,e,n)},Ua=o({logEventCut:n,logEventStopped:n,logNoParent:n,logEventNoHandlers:n,logEventResponse:n,write:n}),Wa=o([Ie("menu"),Ie("selectedMenu")]),qa=o([Ie("item"),Ie("selectedItem")]),$a=(o(ae(qa().concat(Wa()))),o(ae(qa()))),Ya=Ve("initSize",[Ie("numColumns"),Ie("numRows")]),Ga=function(){return Ve("markers",[Ie("backgroundMenu")].concat(Wa()).concat(qa()))},Ka=function(t){return Ve("markers",H(t,Ie))},Xa=function(t,e,n){!function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return q(e,(function(t){return t.indexOf("alloy")>0&&!M(Va,(function(e){return t.indexOf(e)>-1}))})).getOr("unknown")}}();return de(e,e,n,be((function(t){return it.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},Ja=function(t){return Xa(0,t,Lt(n))},Qa=function(t){return Xa(0,t,Lt(y.none))},Za=function(t){return Xa(0,t,Ht())},tu=function(t){return Xa(0,t,Ht())},eu=function(t,e){return on(t,o(e))},nu=function(t){return on(t,i)},ru=o(Ya),ou=function(t,e,n,r,i,a){return{x:o(t),y:o(e),bubble:o(n),direction:o(r),boundsRestriction:o(i),label:o(a)}},iu=Nt([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),au=iu.southeast,uu=iu.southwest,su=iu.northeast,cu=iu.northwest,lu=iu.south,fu=iu.north,du=iu.east,mu=iu.west,hu=function(t,e){return function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(["left","right","top","bottom"],(function(n){return Dt(e,n).map((function(e){return function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(t,e)}))}))},pu=function(t){return t.x},gu=function(t,e){return t.x+t.width/2-e.width/2},vu=function(t,e){return t.x+t.width-e.width},bu=function(t,e){return t.y-e.height},yu=function(t){return t.y+t.height},xu=function(t,e){return t.y+t.height/2-e.height/2},wu=function(t,e,n){return ou(pu(t),yu(t),n.southeast(),au(),hu(t,{left:1,top:3}),"layout-se")},Cu=function(t,e,n){return ou(vu(t,e),yu(t),n.southwest(),uu(),hu(t,{right:0,top:3}),"layout-sw")},_u=function(t,e,n){return ou(pu(t),bu(t,e),n.northeast(),su(),hu(t,{left:1,bottom:2}),"layout-ne")},ku=function(t,e,n){return ou(vu(t,e),bu(t,e),n.northwest(),cu(),hu(t,{right:0,bottom:2}),"layout-nw")},Su=function(t,e,n){return ou(gu(t,e),bu(t,e),n.north(),fu(),hu(t,{bottom:2}),"layout-n")},Tu=function(t,e,n){return ou(gu(t,e),yu(t),n.south(),lu(),hu(t,{top:3}),"layout-s")},Du=function(t,e,n){return ou(function(t){return t.x+t.width}(t),xu(t,e),n.east(),du(),hu(t,{left:0}),"layout-e")},Ou=function(t,e,n){return ou(function(t,e){return t.x-e.width}(t,e),xu(t,e),n.west(),mu(),hu(t,{right:1}),"layout-w")},Eu=function(){return[wu,Cu,_u,ku,Tu,Su,Du,Ou]},Nu=function(){return[Cu,wu,ku,_u,Tu,Su,Du,Ou]},Au=function(){return[_u,ku,wu,Cu,Su,Tu]},Ru=function(){return[wu,Cu,_u,ku,Tu,Su]},Bu=function(){return[Cu,wu,ku,_u,Tu,Su]},Pu=function(t,e,n){return Xr((function(r,o){n(r,t,e)}))},Iu=function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),a=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:$o(a.slice(0,1).concat(a.slice(3)))}},t}((function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var u=[r].concat(i);return r.config({name:o(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(u,1);return e.apply(void 0,[r,t.config,t.state].concat(n))}))}),n,e)},Mu=function(t){return{key:t,value:void 0}},Lu=function(t,e,n,r,o,i,u){var s=function(t){return Et(t,n)?t[n]():y.none()},c=wt(o,(function(t,e){return Iu(n,t,e)})),l=wt(i,(function(t,e){return Yo(t,e)})),f=d(d(d({},l),c),{revoke:a(Mu,n),config:function(e){var r=Ce(n+"-config",t,e);return{key:n,value:{config:r,me:f,configAsRaw:It((function(){return Ce(n+"-config",t,e)})),initialConfig:e,state:u}}},schema:function(){return e},exhibit:function(t,e){return s(t).bind((function(t){return Dt(r,"exhibit").map((function(n){return n(e,t.config,t.state)}))})).getOr(ti({}))},name:function(){return n},handlers:function(t){return s(t).map((function(t){return Dt(r,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return f},Fu=function(t){return $t(t)},Hu=ie([Ie("fields"),Ie("name"),Xe("active",{}),Xe("apis",{}),Xe("state",Jo),Xe("extra",{})]),ju=function(t){var e=Ce("Creating behaviour: "+t.name,Hu,t);return function(t,e,n,r,o,i){var a,u,s=ie(t),c=Ke(e,[(a="config",u=t,qe(a,ie(u)))]);return Lu(s,c,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},Vu=ie([Ie("branchKey"),Ie("branches"),Ie("name"),Xe("active",{}),Xe("apis",{}),Xe("state",Jo),Xe("extra",{})]),zu=function(t){var e=Ce("Creating behaviour: "+t.name,Vu,t);return function(t,e,n,r,o,i){var a=t,u=Ke(e,[qe("config",t)]);return Lu(a,u,e,n,r,o,i)}(Se(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},Uu=o(void 0),Wu=Object.freeze({__proto__:null,events:function(t){return Lr([jr(cr(),(function(e,n){var r=t.channels,o=bt(r),i=n,a=function(t,e){return e.universal()?t:z(t,(function(t){return I(e.channels(),t)}))}(o,i);j(a,(function(t){var n=r[t],o=n.schema,a=Ce("channel["+t+"] data\nReceiver: "+Ao(e.element()),o,i.data());n.onReceive(e,a)}))}))])}}),qu=[Me("channels",ye(it.value,ie([Za("onReceive"),Xe("schema",Te())])))],$u=ju({fields:qu,name:"receiving",active:Wu}),Yu=Object.freeze({__proto__:null,exhibit:function(t,e){return ti({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),Gu=function(t){return t.dom().focus()},Ku=function(t){return void 0===t&&(t=sn.fromDom(e.document)),y.from(t.dom().activeElement).map(sn.fromDom)},Xu=function(t){return Ku(_i(t)).filter((function(e){return t.dom().contains(e.dom())}))},Ju=function(t,e){var r=oo(e),o=Ku(r).bind((function(t){var n,r,o=function(e){return Rn(t,e)};return o(e)?y.some(e):(n=o,(r=function(t){for(var e=0;e<t.childNodes.length;e++){var o=sn.fromDom(t.childNodes[e]);if(n(o))return y.some(o);var i=r(t.childNodes[e]);if(i.isSome())return i}return y.none()})(e.dom()))})),i=t(e);return o.each((function(t){Ku(r).filter((function(e){return Rn(e,t)})).fold((function(){Gu(t)}),n)})),i},Qu=function(t,e,n,r,i){return{position:o(t),left:o(e),top:o(n),right:o(r),bottom:o(i)}},Zu=function(t,e){var n=function(t){return t+"px"};Bi(t,{position:y.some(e.position()),left:e.left().map(n),top:e.top().map(n),right:e.right().map(n),bottom:e.bottom().map(n)})},ts=Nt([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),es=function(t,e,n,r,o,i){var a=e.x-n,u=e.y-r,s=o-(a+e.width),c=i-(u+e.height),l=y.some(a),f=y.some(u),d=y.some(s),m=y.some(c),h=y.none();return function(t,e,n,r,o,i,a,u,s){return t.fold(e,n,r,o,i,a,u,s)}(e.direction,(function(){return Qu(t,l,f,h,h)}),(function(){return Qu(t,h,f,d,h)}),(function(){return Qu(t,l,h,h,m)}),(function(){return Qu(t,h,h,d,m)}),(function(){return Qu(t,l,f,h,h)}),(function(){return Qu(t,l,h,h,m)}),(function(){return Qu(t,l,f,h,h)}),(function(){return Qu(t,h,f,d,h)}))},ns=function(t,e){var n=a(Ca,e),r=t.fold(n,n,(function(){var t=ga();return Ca(e).translate(-t.left(),-t.top())})),o=da(e),i=oa(e);return _a(r.left(),r.top(),o,i)},rs=function(t,e){return e.fold((function(){return t.fold(Ta,Ta,_a)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=os(t,n.x,n.y);return _a(r.left(),r.top(),n.width,n.height)}))}))},os=function(t,e,n){var r=aa(e,n);return t.fold(o(r),o(r),(function(){var t=ga();return r.translate(-t.left(),-t.top())}))},is=(ts.none,ts.relative),as=ts.fixed,us=function(t,e){return function(t,e){return{anchorBox:o(t),origin:o(e)}}(t,e)},ss=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},cs=function(t,e,n){return Math.min(Math.max(t,e),n)},ls=Nt([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),fs=function(t,e,n,r){var a=t.x(),u=t.y(),s=t.bubble().offset(),c=s.left(),l=s.top(),f=function(t,e,n){var r=function(t,r){var o="top"===t||"bottom"===t?n.top():n.left();return Dt(e,t).bind(i).bind((function(e){return"left"===t||"top"===t?e>=r?y.some(e):y.none():e<=r?y.some(e):y.none()})).map((function(t){return t+o})).getOr(r)},o=r("left",t.x),a=r("top",t.y),u=r("right",t.right),s=r("bottom",t.bottom);return _a(o,a,u-o,s-a)}(r,t.boundsRestriction(),s),d=f.y,m=f.bottom,h=f.x,p=f.right,g=u+l,v=function(t,e,n,r,o){var i=o.x,a=o.y,u=o.width,s=o.height,c=t>=i,l=e>=a,f=c&&l,d=t+n<=i+u&&e+r<=a+s,m=Math.abs(Math.min(n,c?i+u-t:i-(t+n))),h=Math.abs(Math.min(r,l?a+s-e:a-(e+r))),p=Math.max(o.x,o.right-n),g=Math.max(o.y,o.bottom-r);return{originInBounds:f,sizeInBounds:d,limitX:cs(t,o.x,p),limitY:cs(e,o.y,g),deltaW:m,deltaH:h}}(a+c,g,e,n,f),b=v.originInBounds,x=v.sizeInBounds,w=v.limitX,C=v.limitY,_=v.deltaW,k=v.deltaH,S=o(C+k-d),T=o(m-C),D=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)}(t.direction(),T,T,S),O=o(w+_-h),E=o(p-w),N={x:w,y:C,width:_,height:k,maxHeight:D,maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t.direction(),E,E,O),direction:t.direction(),classes:{on:t.bubble().classesOn(),off:t.bubble().classesOff()},label:t.label(),candidateYforTest:g};return b&&x?ls.fit(N):ls.nofit(N,_,k)},ds=function(t,e,n,r){Hi(e,"max-height"),Hi(e,"max-width");var o,u={width:da(o=e),height:oa(o)};return function(t,e,n,r,o){var u=n.width,s=n.height,c=function(t,i,a,c){var l=t(e,n,r);return fs(l,u,s,o).fold(ls.fit,(function(t,e,n){return n>c||e>a?ls.nofit(t,e,n):ls.nofit(i,a,c)}))};return W(t,(function(t,e){var n=a(c,e);return t.fold(ls.fit,n)}),ls.nofit({x:e.x,y:e.y,width:n.width,height:n.height,maxHeight:n.height,maxWidth:n.width,direction:au(),classes:{on:[],off:[]},label:"none",candidateYforTest:e.y},-1,-1)).fold(i,i)}(r.preference,t,u,n,r.bounds)},ms=function(t,e,n){Zu(t,function(t,e){return t.fold((function(){return Qu("absolute",y.some(e.x),y.some(e.y),y.none(),y.none())}),(function(t,n,r,o){return es("absolute",e,t,n,r,o)}),(function(t,n,r,o){return es("fixed",e,t,n,r,o)}))}(n.origin,e))},hs=function(t,e){!function(t,e){var n=na.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Ai(t,"max-height",n+"px")}(t,Math.floor(e))},ps=o((function(t,e){hs(t,e),Ri(t,{"overflow-x":"hidden","overflow-y":"auto"})})),gs=o((function(t,e){hs(t,e)})),vs=function(t,e,n){return void 0===t[e]?n:t[e]},bs=function(t,e,n,r){var o=ds(t,e,n,r);ms(e,o,r),function(t,e){var n=e.classes;bi(t,n.off),vi(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r)},ys=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],xs=function(t,e,n){var r=function(t){return Dt(n,t).getOr([])},o=function(t,e,n){var o=J(ys,n);return{offset:function(){return aa(t,e)},classesOn:function(){return G(n,r)},classesOff:function(){return G(o,r)}}};return{southeast:function(){return o(-t,e,["top","alignLeft"])},southwest:function(){return o(t,e,["top","alignRight"])},south:function(){return o(-t/2,e,["top","alignCentre"])},northeast:function(){return o(-t,-e,["bottom","alignLeft"])},northwest:function(){return o(t,-e,["bottom","alignRight"])},north:function(){return o(-t/2,-e,["bottom","alignCentre"])},east:function(){return o(t,-e/2,["valignCentre","left"])},west:function(){return o(-t,-e/2,["valignCentre","right"])},innerNorthwest:function(){return o(-t,e,["top","alignRight"])},innerNortheast:function(){return o(t,e,["top","alignLeft"])},innerNorth:function(){return o(-t/2,e,["top","alignCentre"])},innerSouthwest:function(){return o(-t,-e,["bottom","alignRight"])},innerSoutheast:function(){return o(t,-e,["bottom","alignLeft"])},innerSouth:function(){return o(-t/2,-e,["bottom","alignCentre"])},innerWest:function(){return o(t,-e/2,["valignCentre","right"])},innerEast:function(){return o(-t,-e/2,["valignCentre","left"])}}},ws=function(){return xs(0,0,{})},Cs=function(t,e){return function(n){return"rtl"===_s(n)?e:t}},_s=function(t){return"rtl"===Pi(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(Fa||(Fa={}));var ks="data-alloy-vertical-dir",Ss=function(t){return Aa(t,(function(t){return to(t)&&So(t,ks)===Fa.BottomToTop}))},Ts=function(){return Ke("layouts",[Ie("onLtr"),Ie("onRtl"),We("onBottomLtr"),We("onBottomRtl")])},Ds=function(t,e,n,r,o,i,a){var u=a.map(Ss).getOr(!1),s=e.layouts.map((function(e){return e.onLtr(t)})),c=e.layouts.map((function(e){return e.onRtl(t)})),l=u?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(s).getOr(o):s.getOr(n),f=u?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(c).getOr(i):c.getOr(r);return Cs(l,f)(t)},Os=[Ie("hotspot"),We("bubble"),Xe("overrides",{}),Ts(),eu("placement",(function(t,e,n){var r=e.hotspot,o=ns(n,r.element()),i=Ds(t.element(),e,Ru(),Bu(),Au(),[ku,_u,Cu,wu,Su,Tu],y.some(e.hotspot.element()));return y.some({anchorBox:o,bubble:e.bubble.getOr(ws()),overrides:e.overrides,layouts:i,placer:y.none()})}))],Es=[Ie("x"),Ie("y"),Xe("height",0),Xe("width",0),Xe("bubble",ws()),Xe("overrides",{}),Ts(),eu("placement",(function(t,e,n){var r=os(n,e.x,e.y),o=_a(r.left(),r.top(),e.width,e.height),i=Ds(t.element(),e,Eu(),Nu(),Eu(),Nu(),y.none());return y.some({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:y.none()})}))],Ns=function(t,e,n,r){return{start:o(t),soffset:o(e),finish:o(n),foffset:o(r)}},As=Nt([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Rs=(As.before,As.on,As.after,function(t){return t.fold(i,i,i)}),Bs=Nt([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ps={domRange:Bs.domRange,relative:Bs.relative,exact:Bs.exact,exactFromRange:function(t){return Bs.exact(t.start(),t.soffset(),t.finish(),t.foffset())},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return sn.fromDom(t.startContainer)},relative:function(t,e){return Rs(t)},exact:function(t,e,n,r){return t}})}(t);return uo(e)},range:Ns},Is=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom())}),(function(t,e){r.setStart(t.dom(),e)}),(function(t){r.setStartAfter(t.dom())})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom())}),(function(e,n){t.setEnd(e.dom(),n)}),(function(e){t.setEndAfter(e.dom())}))}(o,n),o},Ms=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom(),n),i.setEnd(r.dom(),o),i},Ls=function(t){return{left:o(t.left),top:o(t.top),right:o(t.right),bottom:o(t.bottom),width:o(t.width),height:o(t.height)}},Fs=Nt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Hs=function(t,e,n){return e(sn.fromDom(n.startContainer),n.startOffset,sn.fromDom(n.endContainer),n.endOffset)},js=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return Fs.rtl(sn.fromDom(t.endContainer),t.endOffset,sn.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Hs(0,Fs.ltr,n)})):Hs(0,Fs.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:o(t),rtl:y.none}},relative:function(e,n){return{ltr:It((function(){return Is(t,e,n)})),rtl:It((function(){return y.some(Is(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:It((function(){return Ms(t,e,n,r,o)})),rtl:It((function(){return y.some(Ms(t,r,o,e,n))}))}}})}(t,e))};Fs.ltr,Fs.rtl;var Vs=function(t,e){var n=function(e){return t(e)?y.from(e.dom().nodeValue):y.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom().nodeValue=r}}}(eo,"text"),zs=function(t){return Vs.getOption(t)},Us=["img","br"],Ws=function(t){return zs(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||I(Us,Qr(t))},qs=function(t,e){var n=function(t){for(var r=lo(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return y.some(i);var a=n(i);if(a.isSome())return a}return y.none()};return n(t)},$s=function(t,n){return function(t,n){var r=void 0===n?e.document:n.dom();return An(r)?[]:H(r.querySelectorAll(t),sn.fromDom)}(n,t)},Ys=function(t,e,n,r){var o=function(t,e,n,r){var o=oo(t).dom().createRange();return o.setStart(t.dom(),e),o.setEnd(n.dom(),r),o}(t,e,n,r),i=Rn(t,n)&&e===r;return o.collapsed&&!i},Gs=function(t){var e=sn.fromDom(t.anchorNode),n=sn.fromDom(t.focusNode);return Ys(e,t.anchorOffset,n,t.focusOffset)?y.some(Ns(e,t.anchorOffset,n,t.focusOffset)):function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return y.some(Ns(sn.fromDom(e.startContainer),e.startOffset,sn.fromDom(n.endContainer),n.endOffset))}return y.none()}(t)},Ks=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?y.some(n).map(Ls):y.none()}(function(t,e){return js(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom(),n),i.setEnd(r.dom(),o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom(),o),i.setEnd(e.dom(),n),i}})}(t,e))},Xs=function(t,e){return{element:t,offset:e}},Js=function(t,e){var n=lo(t);if(0===n.length)return Xs(t,e);if(e<n.length)return Xs(n[e],0);var r=n[n.length-1],o=eo(r)?function(t){return Vs.get(t)}(r).length:lo(r).length;return Xs(r,o)},Qs=Nt([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Zs=function(t){return t.fold(i,(function(t,e,n){return t.translate(-e,-n)}))},tc=function(t){return t.fold(i,i)},ec=function(t){return W(t,(function(t,e){return t.translate(e.left(),e.top())}),aa(0,0))},nc=function(t){var e=H(t,tc);return ec(e)},rc=Qs.screen,oc=Qs.absolute,ic=function(t,e,n){var r=oo(t.element()),o=ga(r),i=function(t,e,n){var r=uo(n.root).dom();return y.from(r.frameElement).map(sn.fromDom).filter((function(e){var n=oo(e),r=oo(t.element());return Rn(n,r)})).map(sa)}(t,0,n).getOr(o);return oc(i,o.left(),o.top())},ac=function(t,e,n,r){var o=t,i=e,a=n,u=r;t<0&&(o=0,a=n+t),e<0&&(i=0,u=r+e);var s=rc(aa(o,i));return y.some(function(t,e,n){return{point:t,width:e,height:n}}(s,a,u))},uc=function(t,e,n,r,o){return t.map((function(t){var i,a,u,s=[e,t.point],c=(i=function(){return nc(s)},a=function(){return nc(s)},u=function(){return function(t){var e=H(t,Zs);return ec(e)}(s)},r.fold(i,a,u)),l=function(t,e,n,r){return{x:t,y:e,width:n,height:r}}(c.left(),c.top(),t.width,t.height),f=n.showAbove?Au():Ru(),d=(n.showAbove,Bu()),m=Ds(o,n,f,d,f,d,y.none());return{anchorBox:l,bubble:n.bubble.getOr(ws()),overrides:n.overrides,layouts:m,placer:y.none()}}))},sc=function(t,e){return eo(t)?function(t,e){return{element:t,offset:e}}(t,e):Js(t,e)},cc=function(t,e){return e.getSelection.getOrThunk((function(){return function(){return function(t){return y.from(t.getSelection()).filter((function(t){return t.rangeCount>0})).bind(Gs)}(t)}}))().map((function(t){var e=sc(t.start(),t.soffset()),n=sc(t.finish(),t.foffset());return Ps.range(e.element,e.offset,n.element,n.offset)}))},lc=[We("getSelection"),Ie("root"),We("bubble"),Ts(),Xe("overrides",{}),Xe("showAbove",!1),eu("placement",(function(t,e,n){var r=uo(e.root).dom(),o=ic(t,0,e),i=cc(r,e).bind((function(t){return Ks(r,Ps.exactFromRange(t)).orThunk((function(){var e=sn.fromText("\ufeff");return mo(t.start(),e),Ks(r,Ps.exact(e,0,e,1)).map((function(t){return yo(e),t}))})).bind((function(t){return ac(t.left(),t.top(),t.width(),t.height())}))})),a=cc(r,e).bind((function(t){return to(t.start())?y.some(t.start()):so(t.start())})).getOr(t.element());return uc(i,o,e,n,a)}))],fc=[Ie("node"),Ie("root"),We("bubble"),Ts(),Xe("overrides",{}),Xe("showAbove",!1),eu("placement",(function(t,e,n){var r=ic(t,0,e);return e.node.bind((function(o){var i=o.dom().getBoundingClientRect(),a=ac(i.left,i.top,i.width,i.height),u=e.node.getOr(t.element());return uc(a,r,e,n,u)}))}))],dc=function(t){return t.x+t.width},mc=function(t,e){return t.x-e.width},hc=function(t,e){return t.y-e.height+t.height},pc=function(t){return t.y},gc=function(t,e,n){return ou(dc(t),pc(t),n.southeast(),au(),hu(t,{left:0,top:2}),"link-layout-se")},vc=function(t,e,n){return ou(mc(t,e),pc(t),n.southwest(),uu(),hu(t,{right:1,top:2}),"link-layout-sw")},bc=function(t,e,n){return ou(dc(t),hc(t,e),n.northeast(),su(),hu(t,{left:0,bottom:3}),"link-layout-ne")},yc=function(t,e,n){return ou(mc(t,e),hc(t,e),n.northwest(),cu(),hu(t,{right:1,bottom:3}),"link-layout-nw")},xc=function(){return[gc,vc,bc,yc]},wc=function(){return[vc,gc,yc,bc]},Cc=[Ie("item"),Ts(),Xe("overrides",{}),eu("placement",(function(t,e,n){var r=ns(n,e.item.element()),o=Ds(t.element(),e,xc(),wc(),xc(),wc(),y.none());return y.some({anchorBox:r,bubble:ws(),overrides:e.overrides,layouts:o,placer:y.none()})}))],_c=Se("anchor",{selection:lc,node:fc,hotspot:Os,submenu:Cc,makeshift:Es}),kc=function(t,e,r,o,i){!function(t,e,r,o,i,a){var u=vs(a,"maxHeightFunction",ps()),s=vs(a,"maxWidthFunction",n),c=t.anchorBox(),l=t.origin(),f={bounds:rs(l,i),origin:l,preference:o,maxHeightFunction:u,maxWidthFunction:s};bs(c,e,r,f)}(us(r.anchorBox,e),i.element(),r.bubble,r.layouts,o,r.overrides)},Sc=function(t,e,n,r,o,i){var a=i.map(ka);return Tc(t,e,n,r,o,a)},Tc=function(t,n,r,i,a,u){var s=Ce("positioning anchor.info",_c,i);Ju((function(){Ai(a.element(),"position","fixed");var r=Mi(a.element(),"visibility");Ai(a.element(),"visibility","hidden");var i,c=n.useFixed()?(i=e.document.documentElement,as(0,0,i.clientWidth,i.clientHeight)):function(t){var e=sa(t.element()),n=t.element().dom().getBoundingClientRect();return is(e.left(),e.top(),n.width,n.height)}(t),l=s.placement,f=u.map(o).or(n.getBounds);l(t,s,c).each((function(e){e.placer.getOr(kc)(t,c,e,f,a)})),r.fold((function(){Hi(a.element(),"visibility")}),(function(t){Ai(a.element(),"visibility",t)})),Mi(a.element(),"left").isNone()&&Mi(a.element(),"top").isNone()&&Mi(a.element(),"right").isNone()&&Mi(a.element(),"bottom").isNone()&&Mi(a.element(),"position").is("fixed")&&Hi(a.element(),"position")}),a.element())},Dc=Object.freeze({__proto__:null,position:function(t,e,n,r,o){Sc(t,e,n,r,o,y.none())},positionWithin:Sc,positionWithinBounds:Tc,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"}}),Oc=[Xe("useFixed",c),We("getBounds")],Ec=ju({fields:Oc,name:"positioning",active:Yu,apis:Dc}),Nc=function(t){Ar(t,Cr());var e=t.components();j(e,Nc)},Ac=function(t){var e=t.components();j(e,Ac),Ar(t,wr())},Rc=function(t,e){go(t.element(),e.element())},Bc=function(t,e){var n=t.components();!function(t){j(t.components(),(function(t){return yo(t.element())})),bo(t.element()),t.syncComponents()}(t);var r=J(n,e);j(r,(function(e){Nc(e),t.getSystem().removeFromWorld(e)})),j(e,(function(e){e.getSystem().isConnected()?Rc(t,e):(t.getSystem().addToWorld(e),Rc(t,e),Ti(t.element())&&Ac(e)),t.syncComponents()}))},Pc=function(t,e){Ic(t,e,go)},Ic=function(t,e,n){t.getSystem().addToWorld(e),n(t.element(),e.element()),Ti(t.element())&&Ac(e),t.syncComponents()},Mc=function(t){Nc(t),yo(t.element()),t.getSystem().removeFromWorld(t)},Lc=function(t){var e=so(t.element()).bind((function(e){return t.getSystem().getByDom(e).toOption()}));Mc(t),e.each((function(t){t.syncComponents()}))},Fc=function(t){var e=t.components();j(e,Mc),bo(t.element()),t.syncComponents()},Hc=function(t,e){jc(t,e,go)},jc=function(t,e,n){n(t,e.element());var r=lo(e.element());j(r,(function(t){e.getByDom(t).each(Ac)}))},Vc=function(t){var e=lo(t.element());j(e,(function(e){t.getByDom(e).each(Nc)})),yo(t.element())},zc=function(t,e,n,r){n.get().each((function(e){Fc(t)}));var o=e.getAttachPoint(t);Pc(o,t);var i=t.getSystem().build(r);return Pc(t,i),n.set(i),i},Uc=function(t,e,n,r){var o=zc(t,e,n,r);return e.onOpen(t,o),o},Wc=function(t,e,n){n.get().each((function(r){Fc(t),Lc(t),e.onClose(t,r),n.clear()}))},qc=function(t,e,n){return n.isOpen()},$c=function(t,e,n){var r=e.getAttachPoint(t);Ai(t.element(),"position",Ec.getMode(r)),function(t,e,n,r){Mi(t.element(),e).fold((function(){Oo(t.element(),n)}),(function(e){ko(t.element(),n,e)})),Ai(t.element(),e,r)}(t,"visibility",e.cloakVisibilityAttr,"hidden")},Yc=function(t,e,n){(function(t){return M(["top","left","right","bottom"],(function(e){return Mi(t,e).isSome()}))})(t.element())||Hi(t.element(),"position"),function(t,e,n){To(t.element(),n).fold((function(){return Hi(t.element(),e)}),(function(n){return Ai(t.element(),e,n)}))}(t,"visibility",e.cloakVisibilityAttr)},Gc=Object.freeze({__proto__:null,cloak:$c,decloak:Yc,open:Uc,openWhileCloaked:function(t,e,n,r,o){$c(t,e),Uc(t,e,n,r),o(),Yc(t,e)},close:Wc,isOpen:qc,isPartOf:function(t,e,n,r){return qc(0,0,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map((function(){return zc(t,e,n,r)}))}}),Kc=Object.freeze({__proto__:null,events:function(t,e){return Lr([jr(hr(),(function(n,r){Wc(n,t,e)}))])}}),Xc=[Ja("onOpen"),Ja("onClose"),Ie("isPartOf"),Ie("getAttachPoint"),Xe("cloakVisibilityAttr","data-precloak-visibility")],Jc=ju({fields:Xc,name:"sandboxing",active:Kc,apis:Gc,state:Object.freeze({__proto__:null,init:function(){var t=an(y.none()),e=o("not-implemented");return Qo({readState:e,isOpen:function(){return t.get().isSome()},clear:function(){t.set(y.none())},set:function(e){t.set(y.some(e))},get:function(){return t.get()}})}})}),Qc=o("dismiss.popups"),Zc=o("reposition.popups"),tl=o("mouse.released"),el=ie([Xe("isExtraPart",o(!1)),Ke("fireEventInstead",[Xe("event",_r())])]),nl=function(t){var e,n=Ce("Dismissal",el,t);return(e={})[Qc()]={schema:ie([Ie("target")]),onReceive:function(t,e){Jc.isOpen(t)&&(Jc.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold((function(){return Jc.close(t)}),(function(e){return Ar(t,e.event)})))}},e},rl=ie([Ke("fireEventInstead",[Xe("event",kr())]),je("doReposition")]),ol=function(t){var e,n=Ce("Reposition",rl,t);return(e={})[Zc()]={onReceive:function(t){Jc.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return Ar(t,e.event)}))}},e},il=function(t,e,n){e.store.manager.onLoad(t,e,n)},al=function(t,e,n){e.store.manager.onUnload(t,e,n)},ul=Object.freeze({__proto__:null,onLoad:il,onUnload:al,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),sl=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[Gr((function(n,r){il(n,t,e)})),Kr((function(n,r){al(n,t,e)}))]:[Pu(t,e,il)];return Lr(n)}}),cl=function(){var t=an(null);return Qo({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},ll=function(){var t=an({}),e=an({});return Qo({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return Dt(t.get(),n).orThunk((function(){return Dt(e.get(),n)}))},update:function(n){var r=t.get(),o=e.get(),i={},a={};j(n,(function(t){i[t.value]=t,Dt(t,"meta").each((function(e){Dt(e,"text").each((function(e){a[e]=t}))}))})),t.set(d(d({},r),i)),e.set(d(d({},o),a))},clear:function(){t.set({}),e.set({})}})},fl=Object.freeze({__proto__:null,memory:cl,dataset:ll,manual:function(){return Qo({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),dl=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},ml=[We("initialValue"),Ie("getFallbackEntry"),Ie("getDataKey"),Ie("setValue"),eu("manager",{setValue:dl,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).fold((function(){return r.getFallbackEntry(o)}),(function(t){return t}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){dl(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:ll})],hl=[Ie("getValue"),Xe("setValue",n),We("initialValue"),eu("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:n,state:Jo.init})],pl=[We("initialValue"),eu("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:cl})],gl=[Je("store",{mode:"memory"},Se("mode",{memory:pl,manual:hl,dataset:ml})),Ja("onSetValue"),Xe("resetOnDom",!1)],vl=ju({fields:gl,name:"representing",active:sl,apis:ul,extra:{setValueFrom:function(t,e){var n=vl.getValue(e);vl.setValue(t,n)}},state:fl}),bl=function(t,e){return rn(t,{},H(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,de(n,n,jt(),re((function(t){return mt("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([on("dump",i)]))},yl=function(t){return t.dump},xl=function(t,e){return d(d({},t.dump),Fu(e))},wl=bl,Cl=xl,_l=Nt([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),kl=function(t){return Ot(t,"uiType")},Sl=function(t,e,n,r){return kl(n)&&"placeholder"===n.uiType?function(t,e,n,r){return t.exists((function(t){return t!==n.owner}))?_l.single(!0,o(n)):Dt(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+bt(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,r):_l.single(!1,o(n))},Tl=function(t,e,n,r){return Sl(t,0,n,r).fold((function(o,i){var a=kl(n)?i(e,n.config,n.validated):i(e),u=Dt(a,"components").getOr([]),s=G(u,(function(n){return Tl(t,e,n,r)}));return[d(d({},a),{components:s})]}),(function(t,r){if(kl(n)){var o=r(e,n.config,n.validated);return n.validated.preprocess.getOr(i)(o)}return r(e)}))},Dl=function(t,e,n,r){var i=wt(r,(function(t,e){return r=t,i=!1,{name:o(n=e),required:function(){return r.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return i},replace:function(){if(i)throw new Error("Trying to use the same placeholder more than once: "+n);return i=!0,r}};var n,r,i})),a=function(t,e,n,r){return G(n,(function(n){return Tl(t,e,n,r)}))}(t,e,n,i);return xt(i,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),a},Ol=_l.single,El=_l.multiple,Nl=o("placeholder"),Al=Nt([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Rl=Xe("factory",{sketch:i}),Bl=Xe("schema",[]),Pl=Ie("name"),Il=de("pname","pname",Vt((function(t){return"<alloy."+Io(t.name)+">"})),Te()),Ml=on("schema",(function(){return[We("preprocess")]})),Ll=Xe("defaults",o({})),Fl=Xe("overrides",o({})),Hl=ae([Rl,Bl,Pl,Il,Ll,Fl]),jl=ae([Rl,Bl,Pl,Ll,Fl]),Vl=ae([Rl,Bl,Pl,Il,Ll,Fl]),zl=ae([Rl,Ml,Pl,Ie("unit"),Il,Ll,Fl]),Ul=function(t){return t.fold(y.some,y.none,y.some,y.some)},Wl=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},ql=function(t,e){return function(n){var r=Ce("Converting part type",e,n);return t(r)}},$l=ql(Al.required,Hl),Yl=ql(Al.external,jl),Gl=ql(Al.optional,Vl),Kl=ql(Al.group,zl),Xl=o("entirety"),Jl=Object.freeze({__proto__:null,required:$l,external:Yl,optional:Gl,group:Kl,asNamedPart:Ul,name:Wl,asCommon:function(t){return t.fold(i,i,i,i)},original:Xl}),Ql=function(t,e,n,r){return Bt(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},Zl=function(t,e){var n={};return j(e,(function(e){Ul(e).each((function(e){var r=tf(t,e.pname);n[e.name]=function(n){var o=Ce("Part: "+e.name+" in "+t,ae(e.schema),n);return d(d({},r),{config:n,validated:o})}}))})),n},tf=function(t,e){return{uiType:Nl(),owner:t,name:e}},ef=function(t,e,n){return{uiType:Nl(),owner:t,name:e,config:n,validated:{}}},nf=function(t){return G(t,(function(t){return t.fold(y.none,y.some,y.none,y.none).map((function(t){return Ve(t.name,t.schema.concat([nu(Xl())]))})).toArray()}))},rf=function(t){return H(t,Wl)},of=function(t,e,n){return function(t,e,n){var r={},i={};return j(n,(function(t){t.fold((function(t){r[t.pname]=Ol(!0,(function(e,n,r){return t.factory.sketch(Ql(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];i[t.name]=o(t.factory.sketch(Ql(e,t,n[Xl()]),n))}),(function(t){r[t.pname]=Ol(!1,(function(e,n,r){return t.factory.sketch(Ql(e,t,n,r))}))}),(function(t){r[t.pname]=El(!0,(function(e,n,r){var o=e[t.name];return H(o,(function(n){return t.factory.sketch(Bt(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:o(r),externals:o(i)}}(0,e,n)},af=function(t,e,n){return Dl(y.some(t),e,e.components,n)},uf=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOption()},sf=function(t,e,n){return uf(t,e,n).getOrDie("Could not find part: "+n)},cf=function(t,e,n){var r={},i=e.partUids,a=t.getSystem();return j(n,(function(t){r[t]=o(a.getByUid(i[t]))})),r},lf=function(t,e){var n=t.getSystem();return wt(e.partUids,(function(t,e){return o(n.getByUid(t))}))},ff=function(t){return bt(t.partUids)},df=function(t,e,n){var r={},i=e.partUids,a=t.getSystem();return j(n,(function(t){r[t]=o(a.getByUid(i[t]).getOrDie())})),r},mf=function(t,e){var n=rf(e);return $t(H(n,(function(e){return{key:e,value:t+"-"+e}})))},hf=function(t){return de("partUids","partUids",zt((function(e){return mf(e.uid,t)})),Te())},pf=Object.freeze({__proto__:null,generate:Zl,generateOne:ef,schemas:nf,names:rf,substitutes:of,components:af,defaultUids:mf,defaultUidsSchema:hf,getAllParts:lf,getAllPartNames:ff,getPart:uf,getPartOrDie:sf,getParts:cf,getPartsOrDie:df}),gf=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[Ve("parts",t)]:[]).concat([Ie("uid"),Xe("dom",{}),Xe("components",[]),nu("originalSpec"),Xe("debug.sketcher",{})]).concat(e)}(r,o);return Ce(t+" [SpecSchema]",ie(i.concat(e)),n)},vf=function(t,e,n,r,o){var i=bf(o),a=nf(n),u=hf(n),s=gf(t,e,i,a,[u]),c=of(0,s,n);return r(s,af(t,s,c.internals()),i,c.externals())},bf=function(t){return function(t){return Ot(t,"uid")}(t)?t:d(d({},t),{uid:zo("uid")})};var yf,xf=ie([Ie("name"),Ie("factory"),Ie("configFields"),Xe("apis",{}),Xe("extraApis",{})]),wf=ie([Ie("name"),Ie("factory"),Ie("configFields"),Ie("partFields"),Xe("apis",{}),Xe("extraApis",{})]),Cf=function(t){var e=Ce("Sketcher for "+t.name,xf,t),n=wt(e.apis,Xo),r=wt(e.extraApis,(function(t,e){return Yo(t,e)}));return d(d({name:o(e.name),configFields:o(e.configFields),sketch:function(t){return function(t,e,n,r){var o=bf(r);return n(gf(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},_f=function(t){var e=Ce("Sketcher for "+t.name,wf,t),n=Zl(e.name,e.partFields),r=wt(e.apis,Xo),i=wt(e.extraApis,(function(t,e){return Yo(t,e)}));return d(d({name:o(e.name),partFields:o(e.partFields),configFields:o(e.configFields),sketch:function(t){return vf(e.name,e.configFields,e.partFields,e.factory,t)},parts:o(n)},r),i)},kf=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},Sf=function(t){return"input"===Qr(t)&&"radio"!==So(t,"type")||"textarea"===Qr(t)},Tf=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),Df=[Ie("find")],Of=ju({fields:Df,name:"composing",apis:Tf}),Ef=function(t,e,n,r){var o=$s(t.element(),"."+e.highlightClass);j(o,(function(n){M(r,(function(t){return t.element()===n}))||(pi(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Ar(n,Nr())})))}))},Nf=function(t,e,n,r){Ef(t,e,0,[r]),Af(t,e,n,r)||(mi(r.element(),e.highlightClass),e.onHighlight(t,r),Ar(r,Er()))},Af=function(t,e,n,r){return gi(r.element(),e.highlightClass)},Rf=function(t,e,n,r){var o=$s(t.element(),"."+e.itemClass);return y.from(o[r]).fold((function(){return it.error("No element found with index "+r)}),t.getSystem().getByDom)},Bf=function(t,e,n){return Ba(t.element(),"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOption()}))},Pf=function(t,e,n){var r=$s(t.element(),"."+e.itemClass);return(r.length>0?y.some(r[r.length-1]):y.none()).bind((function(e){return t.getSystem().getByDom(e).toOption()}))},If=function(t,e,n,r){var o=$s(t.element(),"."+e.itemClass);return $(o,(function(t){return gi(t,e.highlightClass)})).bind((function(e){var n=ss(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOption()}))},Mf=function(t,e,n){var r=$s(t.element(),"."+e.itemClass);return kf(H(r,(function(e){return t.getSystem().getByDom(e).toOption()})))},Lf=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return Ef(t,e,0,[])},dehighlight:function(t,e,n,r){Af(t,e,n,r)&&(pi(r.element(),e.highlightClass),e.onDehighlight(t,r),Ar(r,Nr()))},highlight:Nf,highlightFirst:function(t,e,n){Bf(t,e).each((function(r){Nf(t,e,n,r)}))},highlightLast:function(t,e,n){Pf(t,e).each((function(r){Nf(t,e,n,r)}))},highlightAt:function(t,e,n,r){Rf(t,e,n,r).fold((function(t){throw new Error(t)}),(function(r){Nf(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=Mf(t,e);q(o,r).each((function(r){Nf(t,e,n,r)}))},isHighlighted:Af,getHighlighted:function(t,e,n){return Ba(t.element(),"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOption()}))},getFirst:Bf,getLast:Pf,getPrevious:function(t,e,n){return If(t,e,0,-1)},getNext:function(t,e,n){return If(t,e,0,1)},getCandidates:Mf}),Ff=[Ie("highlightClass"),Ie("itemClass"),Ja("onHighlight"),Ja("onDehighlight")],Hf=ju({fields:Ff,name:"highlighting",apis:Lf}),jf=function(t,e,n){var r=X(t.slice(0,e)),o=X(t.slice(e+1));return q(r.concat(o),n)},Vf=function(t,e,n){var r=X(t.slice(0,e));return q(r,n)},zf=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return q(o.concat(r),n)},Uf=function(t,e,n){var r=t.slice(e+1);return q(r,n)},Wf=function(t){return function(e){var n=e.raw();return I(t,n.which)}},qf=function(t){return function(e){return K(t,(function(t){return t(e)}))}},$f=function(t){return!0===t.raw().shiftKey},Yf=function(t){return!0===t.raw().ctrlKey},Gf=u($f),Kf=function(t,e){return{matches:t,classification:e}},Xf=function(t,e,n){e.exists((function(t){return n.exists((function(e){return Rn(e,t)}))}))||Rr(t,Sr(),{prevFocus:e,newFocus:n})},Jf=function(){var t=function(t){return Xu(t.element())};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element());var o=t(e);Xf(e,r,o)}}},Qf=function(){var t=function(t){return Hf.getHighlighted(t).map((function(t){return t.element()}))};return{get:t,set:function(e,r){var o=t(e);e.getSystem().getByDom(r).fold(n,(function(t){Hf.highlight(e,t)}));var i=t(e);Xf(e,o,i)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(yf||(yf={}));var Zf,td=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,a,u=n(t,e,r,o);return(i=u,a=e.event(),q(i,(function(t){return t.matches(a)})).map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},a={schema:function(){return t.concat([Xe("focusManager",Jf()),Je("focusInside","onFocus",be((function(t){return I(["onFocus","onEnterOrSpace","onApi"],t)?it.value(t):it.error("Invalid value for focusInside")}))),eu("handler",a),eu("state",e),eu("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var a=t.focusInside!==yf.OnFocusMode?y.none():o(t).map((function(n){return jr(ar(),(function(r,o){n(r,t,e),o.stop()}))})),u=[jr(Qn(),(function(r,a){i(r,a,n,t,e).fold((function(){!function(n,r){var i=Wf([32].concat([13]))(r.event());t.focusInside===yf.OnEnterOrSpaceMode&&i&&Fn(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,a)}),(function(t){a.stop()}))})),jr(Zn(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return Lr(a.toArray().concat(u))}};return a},ed=function(t){var e=[We("onEscape"),We("onEnter"),Xe("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Xe("firstTabstop",0),Xe("useTabstopAt",o(!0)),We("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return Pa(e,t)})).getOr(e);return ra(n)>0},r=function(t,e,r){(function(t,e){var r=$s(t.element(),e.selector),o=z(r,(function(t){return n(e,t)}));return y.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},i=function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?y.some(!0):y.none()}),(function(e){return o.focusManager.set(t,e),y.some(!0)}))},u=function(t,e,n,r){var o=$s(t.element(),n.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return Pa(t,e.selector)}))}(t,n).bind((function(e){return $(o,a(Rn,e)).bind((function(e){return i(t,o,e,n,r)}))}))},s=o([Kf(qf([$f,Wf([9])]),(function(t,e,n){var r=n.cyclic?jf:Vf;return u(t,0,n,r)})),Kf(Wf([9]),(function(t,e,n){var r=n.cyclic?zf:Uf;return u(t,0,n,r)})),Kf(Wf([27]),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),Kf(qf([Gf,Wf([13])]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),c=o([]);return td(e,Jo.init,s,c,(function(){return y.some(r)}))},nd=ed(on("cyclic",o(!1))),rd=ed(on("cyclic",o(!0))),od=function(t,e,n){return Sf(n)&&Wf([32])(e.event())?y.none():function(t,e,n){return Pr(t,n,lr()),y.some(!0)}(t,0,n)},id=function(t,e){return y.some(!0)},ad=[Xe("execute",od),Xe("useSpace",!1),Xe("useEnter",!0),Xe("useControlEnter",!1),Xe("useDown",!1)],ud=function(t,e,n){return n.execute(t,e,t.element())},sd=td(ad,Jo.init,(function(t,e,n,r){var o=n.useSpace&&!Sf(t.element())?[32]:[],i=n.useEnter?[13]:[],a=n.useDown?[40]:[],u=o.concat(i).concat(a);return[Kf(Wf(u),ud)].concat(n.useControlEnter?[Kf(qf([Yf,Wf([13])]),ud)]:[])}),(function(t,e,n,r){return n.useSpace&&!Sf(t.element())?[Kf(Wf([32]),id)]:[]}),(function(){return y.none()})),cd=function(){var t=an(y.none());return Qo({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set(y.some({numRows:e,numColumns:n}))},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},ld=Object.freeze({__proto__:null,flatgrid:cd,init:function(t){return t.state(t)}}),fd=function(t){return function(e,n,r,o){var i=t(e.element());return pd(i,e,n,r,o)}},dd=function(t,e){var n=Cs(t,e);return fd(n)},md=function(t,e){var n=Cs(e,t);return fd(n)},hd=function(t){return function(e,n,r,o){return pd(t,e,n,r,o)}},pd=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element(),n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},gd=hd,vd=hd,bd=hd,yd=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom())},xd=function(t,e,n){var r=$s(t,n);return function(t,e){return $(t,e).map((function(e){return{index:o(e),candidates:o(t)}}))}(z(r,yd),(function(t){return Rn(t,e)}))},wd=function(t,e){return $(t,(function(t){return Rn(e,t)}))},Cd=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row()*n+e.column();return r>=0&&r<t.length?y.some(t[r]):y.none()}))},_d=function(t,e,n,r,i){return Cd(t,e,r,(function(e,a){var u=e===n-1?t.length-e*r:r,s=ss(a,i,0,u-1);return y.some({row:o(e),column:o(s)})}))},kd=function(t,e,n,r,i){return Cd(t,e,r,(function(e,a){var u=ss(e,i,0,n-1),s=u===n-1?t.length-u*r:r,c=cs(a,0,s-1);return y.some({row:o(u),column:o(c)})}))},Sd=[Ie("selector"),Xe("execute",od),Qa("onEscape"),Xe("captureTab",!1),ru()],Td=function(t,e,n){Ba(t.element(),e.selector).each((function(n){e.focusManager.set(t,n)}))},Dd=function(t){return function(e,n,r,o){return xd(e,n,r.selector).bind((function(e){return t(e.candidates(),e.index(),o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},Od=function(t,e,n){return n.captureTab?y.some(!0):y.none()},Ed=Dd((function(t,e,n,r){return _d(t,e,n,r,-1)})),Nd=Dd((function(t,e,n,r){return _d(t,e,n,r,1)})),Ad=Dd((function(t,e,n,r){return kd(t,e,n,r,-1)})),Rd=Dd((function(t,e,n,r){return kd(t,e,n,r,1)})),Bd=o([Kf(Wf([37]),dd(Ed,Nd)),Kf(Wf([39]),md(Ed,Nd)),Kf(Wf([38]),gd(Ad)),Kf(Wf([40]),vd(Rd)),Kf(qf([$f,Wf([9])]),Od),Kf(qf([Gf,Wf([9])]),Od),Kf(Wf([27]),(function(t,e,n){return n.onEscape(t,e)})),Kf(Wf([32].concat([13])),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return Pa(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),Pd=o([Kf(Wf([32]),id)]),Id=td(Sd,cd,Bd,Pd,(function(){return y.some(Td)})),Md=function(t,e,n,r){var o=function(t,e,n){var i,a=ss(e,r,0,n.length-1);return a===t?y.none():(i=n[a],"button"===Qr(i)&&"disabled"===So(i,"disabled")?o(t,a,n):y.from(n[a]))};return xd(t,n,e).bind((function(t){var e=t.index(),n=t.candidates();return o(e,e,n)}))},Ld=[Ie("selector"),Xe("getInitial",y.none),Xe("execute",od),Qa("onEscape"),Xe("executeOnMove",!1),Xe("allowVertical",!0)],Fd=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return Pa(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},Hd=function(t,e,n){e.getInitial(t).orThunk((function(){return Ba(t.element(),e.selector)})).each((function(n){e.focusManager.set(t,n)}))},jd=function(t,e,n){return Md(t,n.selector,e,-1)},Vd=function(t,e,n){return Md(t,n.selector,e,1)},zd=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?Fd(e,n,r):y.some(!0)}))}},Ud=function(t,e,n){return n.onEscape(t,e)},Wd=o([Kf(Wf([32]),id)]),qd=td(Ld,Jo.init,(function(t,e,n,r){var o=[37].concat(n.allowVertical?[38]:[]),i=[39].concat(n.allowVertical?[40]:[]);return[Kf(Wf(o),zd(dd(jd,Vd))),Kf(Wf(i),zd(md(jd,Vd))),Kf(Wf([13]),Fd),Kf(Wf([32]),Fd),Kf(Wf([27]),Ud)]}),Wd,(function(){return y.some(Hd)})),$d=function(t,e,n){return y.from(t[e]).bind((function(t){return y.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},Yd=function(t,e,n,r){var o=t[e].length,i=ss(n,r,0,o-1);return $d(t,e,i)},Gd=function(t,e,n,r){var o=ss(n,r,0,t.length-1),i=t[o].length,a=cs(e,0,i-1);return $d(t,o,a)},Kd=function(t,e,n,r){var o=t[e].length,i=cs(n+r,0,o-1);return $d(t,e,i)},Xd=function(t,e,n,r){var o=cs(n+r,0,t.length-1),i=t[o].length,a=cs(e,0,i-1);return $d(t,o,a)},Jd=[Ve("selectors",[Ie("row"),Ie("cell")]),Xe("cycles",!0),Xe("previousSelector",y.none),Xe("execute",od)],Qd=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return Ba(t.element(),n.cell)})).each((function(n){e.focusManager.set(t,n)}))},Zd=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return Pa(r,o.selectors.row).bind((function(t){var e=$s(t,o.selectors.cell);return wd(e,r).bind((function(e){var r=$s(n,o.selectors.row);return wd(r,t).bind((function(t){var n=function(t,e){return H(t,(function(t){return $s(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},tm=Zd((function(t,e,n){return Yd(t,e,n,-1)}),(function(t,e,n){return Kd(t,e,n,-1)})),em=Zd((function(t,e,n){return Yd(t,e,n,1)}),(function(t,e,n){return Kd(t,e,n,1)})),nm=Zd((function(t,e,n){return Gd(t,n,e,-1)}),(function(t,e,n){return Xd(t,n,e,-1)})),rm=Zd((function(t,e,n){return Gd(t,n,e,1)}),(function(t,e,n){return Xd(t,n,e,1)})),om=o([Kf(Wf([37]),dd(tm,em)),Kf(Wf([39]),md(tm,em)),Kf(Wf([38]),gd(nm)),Kf(Wf([40]),vd(rm)),Kf(Wf([32].concat([13])),(function(t,e,n){return Xu(t.element()).bind((function(r){return n.execute(t,e,r)}))}))]),im=o([Kf(Wf([32]),id)]),am=td(Jd,Jo.init,om,im,(function(){return y.some(Qd)})),um=[Ie("selector"),Xe("execute",od),Xe("moveOnTab",!1)],sm=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},cm=function(t,e,n){Ba(t.element(),e.selector).each((function(n){e.focusManager.set(t,n)}))},lm=function(t,e,n){return Md(t,n.selector,e,-1)},fm=function(t,e,n){return Md(t,n.selector,e,1)},dm=o([Kf(Wf([38]),bd(lm)),Kf(Wf([40]),bd(fm)),Kf(qf([$f,Wf([9])]),(function(t,e,n,r){return n.moveOnTab?bd(lm)(t,e,n,r):y.none()})),Kf(qf([Gf,Wf([9])]),(function(t,e,n,r){return n.moveOnTab?bd(fm)(t,e,n,r):y.none()})),Kf(Wf([13]),sm),Kf(Wf([32]),sm)]),mm=o([Kf(Wf([32]),id)]),hm=td(um,Jo.init,dm,mm,(function(){return y.some(cm)})),pm=[Qa("onSpace"),Qa("onEnter"),Qa("onShiftEnter"),Qa("onLeft"),Qa("onRight"),Qa("onTab"),Qa("onShiftTab"),Qa("onUp"),Qa("onDown"),Qa("onEscape"),Xe("stopSpaceKeyup",!1),We("focusIn")],gm=td(pm,Jo.init,(function(t,e,n){return[Kf(Wf([32]),n.onSpace),Kf(qf([Gf,Wf([13])]),n.onEnter),Kf(qf([$f,Wf([13])]),n.onShiftEnter),Kf(qf([$f,Wf([9])]),n.onShiftTab),Kf(qf([Gf,Wf([9])]),n.onTab),Kf(Wf([38]),n.onUp),Kf(Wf([40]),n.onDown),Kf(Wf([37]),n.onLeft),Kf(Wf([39]),n.onRight),Kf(Wf([32]),n.onSpace),Kf(Wf([27]),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[Kf(Wf([32]),id)]:[]}),(function(t){return t.focusIn})),vm=nd.schema(),bm=rd.schema(),ym=qd.schema(),xm=Id.schema(),wm=am.schema(),Cm=sd.schema(),_m=hm.schema(),km=gm.schema(),Sm=zu({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:vm,cyclic:bm,flow:ym,flatgrid:xm,matrix:wm,execution:Cm,menu:_m,special:km}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element(),t.element())}),(function(r){r(t,e,n)}))},setGridSize:function(t,n,r,o,i){!function(t){return Et(t,"setGridSize")}(r)?e.console.error("Layout does not support setGridSize"):r.setGridSize(o,i)}},state:ld}),Tm=function(t,e,n,r){var o=t.getSystem().build(r);Ic(t,o,n)},Dm=function(t,e,n,r){var o=Om(t);q(o,(function(t){return Rn(r.element(),t.element())})).each(Lc)},Om=function(t,e){return t.components()},Em=function(t,e,n,r,o){var i=Om(t);return y.from(i[r]).map((function(e){return Dm(t,0,0,e),o.each((function(e){Tm(t,0,(function(t,e){!function(t,e,n){fo(t,n).fold((function(){go(t,e)}),(function(t){mo(t,e)}))}(t,e,r)}),e)})),e}))},Nm=ju({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){Tm(t,0,go,r)},prepend:function(t,e,n,r){Tm(t,0,po,r)},remove:Dm,replaceAt:Em,replaceBy:function(t,e,n,r,o){var i=Om(t);return $(i,r).bind((function(e){return Em(t,0,0,e,o)}))},set:function(t,e,n,r){Ju((function(){var e=H(r,t.getSystem().build);Bc(t,e)}),t.element())},contents:Om})}),Am=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=Lr(e);return ju({fields:[Ie("enabled")],name:t,active:{events:o(n)}})}(t,e),configAsRaw:o({}),initialConfig:{},state:Jo}}},Rm=function(t,e){e.ignore||(Gu(t.element()),e.onFocus(t))},Bm=Object.freeze({__proto__:null,focus:Rm,blur:function(t,e){e.ignore||function(t){t.dom().blur()}(t.element())},isFocused:function(t){return function(t){var e=_i(t).dom();return t.dom()===e.activeElement}(t.element())}}),Pm=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return ti(n)},events:function(t){return Lr([jr(ar(),(function(e,n){Rm(e,t),n.stop()}))].concat(t.stopMousedown?[jr(qn(),(function(t,e){e.event().prevent()}))]:[]))}}),Im=[Ja("onFocus"),Xe("stopMousedown",!1),Xe("ignore",!1)],Mm=ju({fields:Im,name:"focusing",active:Pm,apis:Bm}),Lm=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},Fm=function(t,e,n){e.toggleClass.each((function(e){n.get()?mi(t.element(),e):pi(t.element(),e)}))},Hm=function(t,e,n){zm(t,e,n,!n.get())},jm=function(t,e,n){n.set(!0),Fm(t,e,n),Lm(t,e,n)},Vm=function(t,e,n){n.set(!1),Fm(t,e,n),Lm(t,e,n)},zm=function(t,e,n,r){(r?jm:Vm)(t,e,n)},Um=function(t,e,n){zm(t,e,n,e.selected)},Wm=Object.freeze({__proto__:null,onLoad:Um,toggle:Hm,isOn:function(t,e,n){return n.get()},on:jm,off:Vm,set:zm}),qm=Object.freeze({__proto__:null,exhibit:function(){return ti({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=Hm,Jr((function(t){o(t,n,r)}))),a=Pu(t,e,Um);return Lr(Y([t.toggleOnExecute?[i]:[],[a]]))}}),$m=function(t,e,n){ko(t.element(),"aria-expanded",n)},Ym=[Xe("selected",!1),We("toggleClass"),Xe("toggleOnExecute",!0),Je("aria",{mode:"none"},Se("mode",{pressed:[Xe("syncWithExpanded",!1),eu("update",(function(t,e,n){ko(t.element(),"aria-pressed",n),e.syncWithExpanded&&$m(t,e,n)}))],checked:[eu("update",(function(t,e,n){ko(t.element(),"aria-checked",n)}))],expanded:[eu("update",$m)],selected:[eu("update",(function(t,e,n){ko(t.element(),"aria-selected",n)}))],none:[eu("update",n)]}))],Gm=ju({fields:Ym,name:"toggling",active:qm,apis:Wm,state:(Zf=!1,{init:function(){var t=an(Zf);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(Zf)},readState:function(){return t.get()}}}})}),Km=function(){var t=function(t,e){e.stop(),Br(t)};return[jr(nr(),t),jr(dr(),t),qr(Vn()),qr(qn())]},Xm=function(t){return Lr(Y([t.map((function(t){return Jr((function(e,n){t(e),n.stop()}))})).toArray(),Km()]))},Jm=function(t){(Xu(t.element()).isNone()||Mm.isFocused(t))&&(Mm.isFocused(t)||Mm.focus(t),Rr(t,"alloy.item-hover",{item:t}))},Qm=function(t){Rr(t,"alloy.item-focus",{item:t})},Zm=o("alloy.item-hover"),th=o("alloy.item-focus"),eh=[Ie("data"),Ie("components"),Ie("dom"),Xe("hasSubmenu",!1),We("toggling"),wl("itemBehaviours",[Gm,Mm,Sm,vl]),Xe("ignoreFocus",!1),Xe("domModification",{}),eu("builder",(function(t){return{dom:t.dom,domModification:d(d({},t.domModification),{attributes:d(d(d({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Cl(t.itemBehaviours,[t.toggling.fold(Gm.revoke,(function(t){return Gm.config(d({aria:{mode:"checked"}},t))})),Mm.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Qm(t)}}),Sm.config({mode:"execution"}),vl.config({store:{mode:"memory",initialValue:t.data}}),Am("item-type-events",h(Km(),[jr(Kn(),Jm),jr(fr(),Mm.focus)]))]),components:t.components,eventOrder:t.eventOrder}})),Xe("eventOrder",{})],nh=[Ie("dom"),Ie("components"),eu("builder",(function(t){return{dom:t.dom,components:t.components,events:Lr([$r(fr())])}}))],rh=o([$l({name:"widget",overrides:function(t){return{behaviours:Fu([vl.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:function(){}}})])}}})]),oh=[Ie("uid"),Ie("data"),Ie("components"),Ie("dom"),Xe("autofocus",!1),Xe("ignoreFocus",!1),wl("widgetBehaviours",[vl,Mm,Sm]),Xe("domModification",{}),hf(rh()),eu("builder",(function(t){var e=of(0,t,rh()),n=af("item-widget",t,e.internals()),r=function(e){return uf(e,t,"widget").map((function(t){return Sm.focusIn(t),t}))},o=function(e,n){return Sf(n.event().target())?y.none():t.autofocus?(n.setSource(e.element()),y.none()):y.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:Lr([Jr((function(t,e){r(t).each((function(t){e.stop()}))})),jr(Kn(),Jm),jr(fr(),(function(e,n){t.autofocus?r(e):Mm.focus(e)}))]),behaviours:Cl(t.widgetBehaviours,[vl.config({store:{mode:"memory",initialValue:t.data}}),Mm.config({ignore:t.ignoreFocus,onFocus:function(t){Qm(t)}}),Sm.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:Uu(),onLeft:o,onRight:o,onEscape:function(e,n){return Mm.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element()),y.none()):y.none():(Mm.focus(e),y.some(!0))}})])}}))],ih=Se("type",{widget:oh,item:eh,separator:nh}),ah=o([Kl({factory:{sketch:function(t){var e=Ce("menu.spec item",ih,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return e.hasOwnProperty("uid")?e:d(d({},e),{uid:zo("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),uh=o([Ie("value"),Ie("items"),Ie("dom"),Ie("components"),Xe("eventOrder",{}),bl("menuBehaviours",[Hf,vl,Of,Sm]),Je("movement",{mode:"menu",moveOnTab:!0},Se("mode",{grid:[ru(),eu("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[eu("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),Ie("rowSelector")],menu:[Xe("moveOnTab",!0),eu("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Me("markers",$a()),Xe("fakeFocus",!1),Xe("focusManager",Jf()),Ja("onHighlight")]),sh=o("alloy.menu-focus"),ch=_f({name:"Menu",configFields:uh(),partFields:ah(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:xl(t.menuBehaviours,[Hf.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),vl.config({store:{mode:"memory",initialValue:t.value}}),Of.config({find:y.some}),Sm.config(t.movement.config(t,t.movement))]),events:Lr([jr(th(),(function(t,e){var n=e.event();t.getSystem().getByDom(n.target()).each((function(n){Hf.highlight(t,n),e.stop(),Rr(t,sh(),{menu:t,item:n})}))})),jr(Zm(),(function(t,e){var n=e.event().item();Hf.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),lh=function(t,e,n,r){return Dt(n,r).bind((function(r){return Dt(t,r).bind((function(r){var o=lh(t,e,n,r);return y.some([r].concat(o))}))})).getOr([])},fh=function(t,e){var n={};xt(t,(function(t,e){j(t,(function(t){n[t]=e}))}));var r=e,o=Ct(e,(function(t,e){return{k:t,v:e}})),i=wt(o,(function(t,e){return[e].concat(lh(n,r,o,e))}));return wt(n,(function(t){return Dt(i,t).getOr([t])}))},dh=function(t){return"prepared"===t.type?y.some(t.menu):y.none()},mh={init:function(){var t=an({}),e=an({}),n=an({}),r=an(y.none()),o=an({}),i=function(e,n,r){return a(e).bind((function(o){return function(e){return St(t.get(),(function(t,n){return t===e}))}(e).bind((function(t){return n(t).map((function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}}))}))}))},a=function(t){return u(t).bind(dh)},u=function(t){return Dt(e.get(),t)},s=function(e){return Dt(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(d(d({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,a,u,s){r.set(y.some(i)),t.set(u),e.set(a),o.set(s);var c=fh(s,u);n.set(c)},expand:function(e){return Dt(t.get(),e).map((function(t){var r=Dt(n.get(),e).getOr([]);return[t].concat(r)}))},refresh:function(t){return Dt(n.get(),t)},collapse:function(t){return Dt(n.get(),t).bind((function(t){return t.length>1?y.some(t.slice(1)):y.none()}))},lookupMenu:u,lookupItem:s,otherMenus:function(t){var e=o.get();return J(bt(e),t)},getPrimary:function(){return r.get().bind(a)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.set(y.none())},isClear:function(){return r.get().isNone()},getTriggeringPath:function(t,e){var o=z(s(t).toArray(),(function(t){return a(t).isSome()}));return Dt(n.get(),t).bind((function(t){var n=X(o.concat(t));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return y.none();e.push(r.getOrDie())}return y.some(e)}(G(n,(function(t,o){return i(t,e,n.slice(0,o+1)).fold((function(){return r.get().is(t)?[]:[y.none()]}),(function(t){return[y.some(t)]}))})))}))}}},extractPreparedMenu:dh},hh=o("collapse-item"),ph=Cf({name:"TieredMenu",configFields:[tu("onExecute"),tu("onEscape"),Za("onOpenMenu"),Za("onOpenSubmenu"),Ja("onRepositionMenu"),Ja("onCollapseMenu"),Xe("highlightImmediately",!0),Ve("data",[Ie("primary"),Ie("menus"),Ie("expansions")]),Xe("fakeFocus",!1),Ja("onHighlight"),Ja("onHover"),Ga(),Ie("dom"),Xe("navigateOnHover",!0),Xe("stayInDom",!1),bl("tmenuBehaviours",[Sm,Hf,Of,Nm]),Xe("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r=an(y.none()),o=mh.init(),i=function(e){var n=function(e,n,r){return wt(r,(function(r,o){var i=function(){return ch.sketch(d(d({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?Qf():Jf()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))}(e,t.data.primary,t.data.menus),r=u();return o.setContents(t.data.primary,n,t.data.expansions,r),o.getPrimary()},a=function(t){return vl.getValue(t).value},u=function(e){return wt(t.data.menus,(function(t,e){return G(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},s=function(t,e){Hf.highlight(t,e),Hf.getHighlighted(e).orThunk((function(){return Hf.getFirst(e)})).each((function(e){Pr(t,e.element(),fr())}))},c=function(t,e){return kf(H(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?y.some(t.menu):y.none()}))})))},l=function(e,n,r){var o=c(n,n.otherMenus(r));j(o,(function(n){bi(n.element(),[t.markers.backgroundMenu]),t.stayInDom||Nm.remove(e,n)}))},f=function(e,n){var o=function(e){return r.get().getOrThunk((function(){var n={},o=$s(e.element(),"."+t.markers.item),i=z(o,(function(t){return"true"===So(t,"aria-haspopup")}));return j(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=a(t);n[e]=t}))})),r.set(y.some(n)),n}))}(e);xt(o,(function(t,e){var r=I(n,e);ko(t.element(),"aria-expanded",r)}))},m=function(e,n,r){return y.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return y.none();var i=o.menu,a=c(n,r.slice(1));return j(a,(function(e){mi(e.element(),t.markers.backgroundMenu)})),Ti(i.element())||Nm.append(e,ta(i)),bi(i.element(),[t.markers.backgroundMenu]),s(e,i),l(e,n,r),y.some(i)}))}))};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(n||(n={}));var h=function(e,r,i){void 0===i&&(i=n.HighlightSubmenu);var u=a(r);return o.expand(u).bind((function(a){return f(e,a),y.from(a[0]).bind((function(u){return o.lookupMenu(u).bind((function(s){var c=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return o.setMenuBuilt(e,r),r}return n.menu}(e,u,s);return Ti(c.element())||Nm.append(e,ta(c)),t.onOpenSubmenu(e,r,c,X(a)),i===n.HighlightSubmenu?(Hf.highlightFirst(c),m(e,o,a)):(Hf.dehighlightAll(c),y.some(r))}))}))}))},p=function(e,n){var r=a(n);return o.collapse(r).bind((function(r){return f(e,r),m(e,o,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},g=function(e){return function(n,r){return Pa(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOption().bind((function(t){return e(n,t).map((function(){return!0}))}))}))}},v=Lr([jr(sh(),(function(t,e){var n=e.event().item();o.lookupItem(a(n)).each((function(){var n=e.event().menu();Hf.highlight(t,n);var r=a(e.event().item());o.refresh(r).each((function(e){return l(t,o,e)}))}))})),Jr((function(e,r){var o=r.event().target();e.getSystem().getByDom(o).each((function(r){0===a(r).indexOf("collapse-item")&&p(e,r),h(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),(function(){}))}))})),Gr((function(e,n){i(e).each((function(n){Nm.append(e,ta(n)),t.onOpenMenu(e,n),t.highlightImmediately&&s(e,n)}))}))].concat(t.navigateOnHover?[jr(Zm(),(function(e,r){var i=r.event().item();!function(t,e){var n=a(e);o.refresh(n).bind((function(e){return f(t,e),m(t,o,e)}))}(e,i),h(e,i,n.HighlightParent),t.onHover(e,i)}))]:[])),b=function(t){return Hf.getHighlighted(t).bind(Hf.getHighlighted)},x={collapseMenu:function(t){b(t).each((function(e){p(t,e)}))},highlightPrimary:function(t){o.getPrimary().each((function(e){s(t,e)}))},repositionMenus:function(e){o.getPrimary().bind((function(t){return b(e).bind((function(t){var e=a(t),n=Tt(o.getMenus()),r=kf(H(n,mh.extractPreparedMenu));return o.getTriggeringPath(e,(function(t){return function(t,e,n){return nt(e,(function(t){if(!t.getSystem().isConnected())return y.none();var e=Hf.getCandidates(t);return q(e,(function(t){return a(t)===n}))}))}(0,r,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))})).fold((function(){(function(t){return y.from(t.components()[0]).filter((function(t){return"menu"===So(t.element(),"role")}))})(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:xl(t.tmenuBehaviours,[Sm.config({mode:"special",onRight:g((function(t,e){return Sf(e.element())?y.none():h(t,e,n.HighlightSubmenu)})),onLeft:g((function(t,e){return Sf(e.element())?y.none():p(t,e)})),onEscape:g((function(e,n){return p(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))})),focusIn:function(t,e){o.getPrimary().each((function(e){Pr(t,e.element(),fr())}))}}),Hf.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),Of.config({find:function(t){return Hf.getHighlighted(t)}}),Nm.config({})]),eventOrder:t.eventOrder,apis:x,events:v}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:qt(t,e),expansions:{}}},collapseItem:function(t){return{value:Io(hh()),meta:{text:t}}}}}),gh=Cf({name:"InlineView",configFields:[Ie("lazySink"),Ja("onShow"),Ja("onHide"),Ge("onEscape"),bl("inlineBehaviours",[Jc,vl,$u]),Ke("fireDismissalEventInstead",[Xe("event",_r())]),Ke("fireRepositionEventInstead",[Xe("event",kr())]),Xe("getRelated",y.none),Xe("isExtraPart",c),Xe("eventOrder",y.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,(function(){return o.map((function(t){return ka(t)}))}))},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();Jc.openWhileCloaked(e,r,(function(){return Ec.positionWithinBounds(i,n,e,o())})),vl.setValue(e,y.some({mode:"position",anchor:n,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},a="horizontal"===r.type?{layouts:{onLtr:function(){return Ru()},onRtl:function(){return Bu()}}}:{},u=function(t){return function(t){return 2===t.length}(t)?a:{}};return ph.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return Jc.close(e),t.onEscape.map((function(t){return t(e)})),y.some(!0)},onExecute:function(){return y.some(!0)},onOpenMenu:function(t,e){Ec.positionWithinBounds(i().getOrDie(),n,e,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Ec.position(o,d({anchor:"submenu",item:e},u(r)),n)},onRepositionMenu:function(t,e,r){var a=i().getOrDie();Ec.positionWithinBounds(a,n,e,o()),j(r,(function(t){var e=u(t.triggeringPath);Ec.position(a,d({anchor:"submenu",item:t.triggeringItem},e),t.triggeredMenu)}))}})}(t,e,n,r,o);Jc.open(e,i),vl.setValue(e,y.some({mode:"menu",menu:i}))},i=function(e){Jc.isOpen(e)&&vl.getValue(e).each((function(n){switch(n.mode){case"menu":Jc.getState(e).each((function(t){ph.repositionMenus(t)}));break;case"position":var r=t.lazySink(e).getOrDie();Ec.positionWithinBounds(r,n.anchor,e,n.getBounds())}}))},a={setContent:function(t,e){Jc.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,y.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,(function(){return y.none()}))},showMenuWithinBounds:o,hide:function(t){Jc.isOpen(t)&&(vl.setValue(t,y.none()),Jc.close(t))},getContent:function(t){return Jc.getState(t)},reposition:i,isOpen:Jc.isOpen};return{uid:t.uid,dom:t.dom,behaviours:xl(t.inlineBehaviours,[Jc.config({isPartOf:function(e,n,r){return La(n,r)||function(e,n){return t.getRelated(e).exists((function(t){return La(t,n)}))}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),vl.config({store:{mode:"memory",initialValue:y.none()}}),$u.config({channels:d(d({},nl(d({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),ol(d(d({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:a}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),vh=function(t){return t.x},bh=function(t,e){return t.x+t.width/2-e.width/2},yh=function(t,e){return t.x+t.width-e.width},xh=function(t){return t.y},wh=function(t,e){return t.y+t.height-e.height},Ch=function(t,e,n){return ou(yh(t,e),wh(t,e),n.innerSoutheast(),cu(),hu(t,{right:0,bottom:3}),"layout-inner-se")},_h=function(t,e,n){return ou(vh(t),wh(t,e),n.innerSouthwest(),su(),hu(t,{left:1,bottom:3}),"layout-inner-sw")},kh=function(t,e,n){return ou(yh(t,e),xh(t),n.innerNortheast(),uu(),hu(t,{right:0,top:2}),"layout-inner-ne")},Sh=function(t,e,n){return ou(vh(t),xh(t),n.innerNorthwest(),au(),hu(t,{left:1,top:2}),"layout-inner-nw")},Th=function(t,e,n){return ou(bh(t,e),xh(t),n.innerNorth(),lu(),hu(t,{top:2}),"layout-inner-n")},Dh=function(t,e,n){return ou(bh(t,e),wh(t,e),n.innerSouth(),fu(),hu(t,{bottom:3}),"layout-inner-s")},Oh=tinymce.util.Tools.resolve("tinymce.util.Delay"),Eh=Cf({name:"Button",factory:function(t){var e=Xm(t.action),n=t.dom.tag,r=function(e){return Dt(t.dom,"attributes").bind((function(t){return Dt(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:Cl(t.buttonBehaviours,[Mm.config({}),Sm.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return d({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[Xe("uid",void 0),Ie("dom"),Xe("components",[]),wl("buttonBehaviours",[Mm,Sm]),We("action"),We("role"),Xe("eventOrder",{})]}),Nh=function(t){var e=function(t){return void 0!==t.uid}(t)&&Et(t,"uid")?t.uid:zo("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOption()},asSpec:function(){return d(d({},t),{uid:e})}}},Ah=function(t){return y.from(t()["temporary-placeholder"]).getOr("!not found!")},Rh=function(t,e){return y.from(e()[t.toLowerCase()]).getOrThunk((function(){return Ah(e)}))},Bh=function(t,e){return nt(t,(function(t){return y.from(e()[t.toLowerCase()])})).getOrThunk((function(){return Ah(e)}))},Ph={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Ih=Cf({name:"Notification",factory:function(t){var e=Nh({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:Fu([Nm.config({})])}),n=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},r=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},o=Nh({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:Fu([Nm.config({})])}),i={updateProgress:function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each((function(t){Nm.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},r(e)])}))},updateText:function(t,n){if(t.getSystem().isConnected()){var r=e.get(t);Nm.set(r,[Xi(n)])}}},a=Y([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return y.from(Ph[t])})).toArray()]);return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:Bh(a,t.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:Fu([Nm.config({})])}].concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[Eh.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:Rh("close",t.iconProvider),attributes:{"aria-label":t.translationProvider("Close")}}}],action:function(e){t.onAction(e)}})]:[]),apis:i}},configFields:[We("level"),Ie("progress"),Ie("icon"),Ie("onAction"),Ie("text"),Ie("iconProvider"),Ie("translationProvider"),en("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function Mh(t,e,n){var r=e.backstage;return{open:function(t,o){var i=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),a=function(){o(),gh.hide(s)},u=Zi(Ih.sketch({text:t.text,level:I(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:y.from(t.icon),closeButton:!i,onAction:a,iconProvider:r.shared.providers.icons,translationProvider:r.shared.providers.translate})),s=Zi(gh.sketch(d({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:e.backstage.shared.getSink,fireDismissalEventInstead:{}},r.shared.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return n.add(s),t.timeout>0&&Oh.setTimeout((function(){a()}),t.timeout),{close:a,moveTo:function(t,e){gh.showAt(s,{anchor:"makeshift",x:t,y:e},ta(u))},moveRel:function(t,n){if("banner"!==n){var r=function(t){switch(t){case"bc-bc":return Dh;case"tc-tc":return Th;case"tc-bc":return Su;case"bc-tc":default:return Tu}}(n),o={anchor:"node",root:Di(),node:y.some(sn.fromDom(t)),layouts:{onRtl:function(){return[r]},onLtr:function(){return[r]}}};gh.showAt(s,o,ta(u))}else gh.showAt(s,e.backstage.shared.anchors.banner(),ta(u))},text:function(t){Ih.updateText(u,t)},settings:t,getEl:function(){return u.element().dom()},progressBar:{value:function(t){Ih.updateProgress(u,t)}}}},close:function(t){t.close()},reposition:function(t){!function(t){j(t,(function(t){return t.moveTo(0,0)}))}(t),function(t){t.length>0&&(Z(t).each((function(t){return t.moveRel(null,"banner")})),j(t,(function(e,n){n>0&&e.moveRel(t[n-1].getEl(),"bc-tc")})))}(t)},getArgs:function(t){return t.settings}}}var Lh,Fh=function(t,n){var r=null;return{cancel:function(){null!==r&&(e.clearTimeout(r),r=null)},throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null!==r&&e.clearTimeout(r),r=e.setTimeout((function(){t.apply(null,o),r=null}),n)}}},Hh=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),jh=function(t,e,n,r,o){var i=Hh(t,(function(e){return function(t,e){return t.isBlock(e)||I(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)}));return y.from(i.backwards(e,n,r,o))},Vh=function(t,e){return zh(sn.fromDom(t.selection.getNode())).getOrThunk((function(){var n=sn.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return go(n,sn.fromDom(e.extractContents())),e.insertNode(n.dom()),so(n).each((function(t){return t.dom().normalize()})),function(t){return qs(t,Ws)}(n).map((function(e){t.selection.setCursorLocation(e.dom(),function(t){return"img"===Qr(t)?1:zs(t).fold((function(){return lo(t).length}),(function(t){return t.length}))}(e))})),n}))},zh=function(t){return Pa(t,"[data-mce-autocompleter]")},Uh=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Wh=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},qh=function(t,e){return t.substring(e.length)},$h=function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return y.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return jh(t,e.startContainer,e.startOffset,(function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(Wh(o))return y.none();if(o===n)break}return y.some(r)}(r,e,n).getOr(e)}),i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return y.none();var i=Uh(o);return 0!==i.lastIndexOf(n)||qh(i,n).length<r?y.none():y.some({text:qh(i,n),range:o,triggerChar:n})}))},Yh=function(t,e,n,r){return void 0===r&&(r=0),zh(sn.fromDom(e.startContainer)).fold((function(){return $h(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom());var o=Uh(r);return y.some({range:r,text:qh(o,n),triggerChar:n})}))},Gh=function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){Rr(t,Qn(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(Hf.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(Br),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(Hf.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&zh(sn.fromDom(e.element)).isNone()&&t.cancelIfNecessary()}))},Kh=tinymce.util.Tools.resolve("tinymce.util.Promise"),Xh=function(t,e){return{container:t,offset:e}},Jh=function(t){if(function(t){return t.nodeType===e.Node.TEXT_NODE}(t))return Xh(t,t.data.length);var n=t.childNodes;return n.length>0?Jh(n[n.length-1]):Xh(t,n.length)},Qh=function(t,n){var r=t.childNodes;return r.length>0&&n<r.length?Qh(r[n],0):r.length>0&&function(t){return t.nodeType===e.Node.ELEMENT_NODE}(t)&&r.length===n?Jh(r[r.length-1]):Xh(t,n)},Zh=function(t){return function(e){var n=Qh(e.startContainer,e.startOffset);return!function(t,e){return jh(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!Wh(e)})).isSome()}(t,n)}},tp=function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return nt(n.triggerChars,(function(n){return Yh(t,e,n)}))}(t.dom,r,n).bind((function(n){return ep(t,e,n)}))},ep=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,a=z(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return Zh(t.dom)}))(n.range,i,n.text)}));if(0===a.length)return y.none();var u=Kh.all(H(a,(function(t){return t.fetch(n.text,t.maxResults,r).then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction}}))})));return y.some({lookupData:u,context:n})},np=ae([Fe("type"),Ye("text")]),rp=ae([on("type",(function(){return"autocompleteitem"})),on("active",(function(){return!1})),on("disabled",(function(){return!1})),Xe("meta",{}),Fe("value"),Ye("text"),Ye("icon")]),op=ae([Fe("type"),Fe("ch"),Qe("minChars",1),Xe("columns",1),Qe("maxResults",10),Ge("matches"),je("fetch"),je("onAction")]),ip=function(t){var e=t.ui.registry.getAll().popups,n=wt(e,(function(t){return(e=t,xe("Autocompleter",op,e)).fold((function(t){throw new Error(_e(t))}),(function(t){return t}));var e})),r=function(t){var e={};return j(t,(function(t){e[t]={}})),bt(e)}(kt(n,(function(t){return t.ch}))),o=Tt(n);return{dataset:n,triggerChars:r,lookupByChar:function(t){return z(o,(function(e){return e.ch===t}))}}};!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Lh||(Lh={}));var ap,up=Lh,sp="tox-menu-nav__js",cp="tox-collection__item",lp={normal:sp,color:"tox-swatch"},fp="tox-collection__item-label",dp="tox-collection__item--active",mp=function(t){return Dt(lp,t).getOr(sp)},hp=function(t){return"color"===t?"tox-swatches":"tox-menu"},pp=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:hp(t),tieredMenu:"tox-tiered-menu"}},gp=function(t){var e=pp(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:mp(t)}},vp=function(t,e,n){var r=pp(n);return{tag:"div",classes:Y([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},bp=[ch.parts().items({})],yp=function(t,e,n){var r=pp(n);return{dom:{tag:"div",classes:Y([[r.tieredMenu]])},markers:gp(n)}},xp=function(t,e){return function(n){var r=F(n,e);return H(r,(function(e){return{dom:t,components:e}}))}},wp=function(t,e){var n=[],r=[];return j(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Ot(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),H(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},Cp=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[ch.parts().items({preprocess:function(n){return"auto"!==t&&t>1?xp({tag:"div",classes:["tox-collection__group"]},t)(n):wp(n,(function(t,n){return"separator"===e[n].type}))}})]}},_p=function(t){return M(t,(function(t){return"icon"in t&&void 0!==t.icon}))},kp=function(t){return e.console.error(_e(t)),e.console.log(t),y.none()},Sp=function(t,e,n,r,o){var i,a=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[ch.parts().items({preprocess:function(t){return wp(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:a.dom,components:a.components,items:n}},Tp=function(t,e,n,r,o){var a;return"color"===o?{value:t,dom:(a=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[ch.parts().items({preprocess:"auto"!==t?xp({tag:"div",classes:["tox-swatches__row"]},t):i})]}]}}(r)).dom,components:a.components,items:n}:"normal"===o&&"auto"===r?{value:t,dom:(a=Cp(r,n)).dom,components:a.components,items:n}:"normal"===o&&1===r?{value:t,dom:(a=Cp(1,n)).dom,components:a.components,items:n}:"normal"===o?{value:t,dom:(a=Cp(r,n)).dom,components:a.components,items:n}:"listpreview"===o&&"auto"!==r?{value:t,dom:(a=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[ch.parts().items({preprocess:xp({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:a.components,items:n}:{value:t,dom:vp(e,r,o),components:bp,items:n}},Dp=[en("disabled",!1),Ye("text"),Ye("shortcut"),de("value","value",Vt((function(){return Io("menuitem-value")})),Te()),Xe("meta",{})],Op=ae([Fe("type"),en("active",!1),Ye("icon")].concat(Dp)),Ep=ae([Fe("type"),He("fancytype",["inserttable","colorswatch"]),nn("onAction",n)]),Np=ae([Fe("type"),nn("onSetup",(function(){return n})),nn("onAction",n),Ye("icon")].concat(Dp)),Ap=ae([Fe("type"),je("getSubmenuItems"),nn("onSetup",(function(){return n})),Ye("icon")].concat(Dp)),Rp=ae([Fe("type"),Ye("icon"),en("active",!1),nn("onSetup",(function(){return n})),je("onAction")].concat(Dp)),Bp=function(t,e,n){var r=$s(t.element(),"."+n);if(r.length>0){var o=$(r,(function(t){var n=t.dom().getBoundingClientRect().top,o=r[0].dom().getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return y.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return y.none()},Pp=function(t,e){return Fu([Am(t,e)])},Ip=function(t){return Pp(Io("unnamed-events"),t)},Mp=[Ie("lazySink"),Ie("tooltipDom"),Xe("exclusive",!0),Xe("tooltipComponents",[]),Xe("delay",300),tn("mode","normal",["normal","follow-highlight"]),Xe("anchor",(function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:o([Tu,Su,wu,_u,Cu,ku]),onRtl:o([Tu,Su,wu,_u,Cu,ku])}}})),Ja("onHide"),Ja("onShow")],Lp=Object.freeze({__proto__:null,init:function(){var t=an(y.none()),n=an(y.none()),r=function(){t.get().each((function(t){e.clearTimeout(t)}))},i=o("not-implemented");return Qo({getTooltip:function(){return n.get()},isShowing:function(){return n.get().isSome()},setTooltip:function(t){n.set(y.some(t))},clearTooltip:function(){n.set(y.none())},clearTimer:r,resetTimer:function(n,o){r(),t.set(y.some(e.setTimeout((function(){n()}),o)))},readState:i})}}),Fp=Io("tooltip.exclusive"),Hp=Io("tooltip.show"),jp=Io("tooltip.hide"),Vp=function(t,e,n){t.getSystem().broadcastOn([Fp],{})},zp=Object.freeze({__proto__:null,hideAllExclusive:Vp,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&Nm.set(t,r)}))}}),Up=ju({fields:Mp,name:"tooltipping",active:Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){Lc(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return Lr(Y([[jr(Hp,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){Vp(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:Lr("normal"===t.mode?[jr(Kn(),(function(t){Ar(n,Hp)})),jr(Yn(),(function(t){Ar(n,jp)}))]:[]),behaviours:Fu([Nm.config({})])});e.setTooltip(o),Pc(r,o),t.onShow(n,o),Ec.position(r,t.anchor(n),o)}}(n)}),t.delay)})),jr(jp,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),jr(cr(),(function(t,e){I(e.channels(),Fp)&&n(t)})),Kr((function(t){n(t)}))],"normal"===t.mode?[jr(Xn(),(function(t){Ar(t,Hp)})),jr(ur(),(function(t){Ar(t,jp)})),jr(Kn(),(function(t){Ar(t,Hp)})),jr(Yn(),(function(t){Ar(t,jp)}))]:[jr(Er(),(function(t,e){Ar(t,Hp)})),jr(Nr(),(function(t){Ar(t,jp)}))]]))}}),state:Lp,apis:zp}),Wp=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),qp=tinymce.util.Tools.resolve("tinymce.util.I18n"),$p=["input","button","textarea","select"],Yp=function(t,e,n){(e.disabled()?Zp:tg)(t,e,n)},Gp=function(t,e){return!0===e.useNative&&I($p,Qr(t.element()))},Kp=function(t){ko(t.element(),"disabled","disabled")},Xp=function(t){Oo(t.element(),"disabled")},Jp=function(t){ko(t.element(),"aria-disabled","true")},Qp=function(t){ko(t.element(),"aria-disabled","false")},Zp=function(t,e,n){e.disableClass.each((function(e){mi(t.element(),e)})),(Gp(t,e)?Kp:Jp)(t),e.onDisabled(t)},tg=function(t,e,n){e.disableClass.each((function(e){pi(t.element(),e)})),(Gp(t,e)?Xp:Qp)(t),e.onEnabled(t)},eg=function(t,e){return Gp(t,e)?function(t){return Do(t.element(),"disabled")}(t):function(t){return"true"===So(t.element(),"aria-disabled")}(t)},ng=Object.freeze({__proto__:null,enable:tg,disable:Zp,isDisabled:eg,onLoad:Yp,set:function(t,e,n,r){(r?Zp:tg)(t,e,n)}}),rg=Object.freeze({__proto__:null,exhibit:function(t,e){return ti({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return Lr([Fr(lr(),(function(e,n){return eg(e,t)})),Pu(t,e,Yp)])}}),og=[nn("disabled",c),Xe("useNative",!0),We("disableClass"),Ja("onDisabled"),Ja("onEnabled")],ig=ju({fields:og,name:"disabling",active:rg,apis:ng}),ag=tinymce.util.Tools.resolve("tinymce.EditorManager"),ug=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},sg=function(t){return t.getParam("width",Wp.DOM.getStyle(t.getElement(),"width"))},cg=function(t){return y.from(t.getParam("min_width")).filter(E)},lg=function(t){return y.from(t.getParam("min_height")).filter(E)},fg=function(t){return y.from(t.getParam("max_width")).filter(E)},dg=function(t){return y.from(t.getParam("max_height")).filter(E)},mg=function(t){return!1!==t.getParam("menubar",!0,"boolean")},hg=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=C(e),o=k(e)&&e.length>0;return!gg(t)&&(o||r||n)},pg=function(t){var e=L(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=z(e,(function(t){return"string"==typeof t}));return n.length>0?y.some(n):y.none()},gg=function(t){return pg(t).fold((function(){return t.getParam("toolbar",[],"string[]").length>0}),(function(){return!0}))};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(ap||(ap={}));var vg,bg=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(vg||(vg={}));var yg,xg=function(t){return t.getParam("toolbar_location",vg.auto,"string")},wg=function(t){return xg(t)===vg.bottom},Cg=function(t){var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);return e.length>0&&t.inline?Ba(Di(),e):y.none()},_g=function(t){return t.inline&&Cg(t).isSome()},kg=function(t){return t.inline&&!mg(t)&&!hg(t)&&!gg(t)},Sg=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!_g(t)&&!kg(t)},Tg=function(t){var e=t.getParam("menu");return e?wt(e,(function(t){return d(d({},t),{items:t.items})})):{}},Dg=function(t){return t.getParam("menubar")},Og=function(t){return t.getParam("anchor_top","#top","string")},Eg=function(t){return t.getParam("anchor_bottom","#bottom","string")},Ng=ae([(yg="readonly",Me(yg,Ne))]),Ag=function(t,e){var n=t.outerContainer.element();e&&(t.mothership.broadcastOn([Qc()],{target:n}),t.uiMothership.broadcastOn([Qc()],{target:n})),t.mothership.broadcastOn(["silver.readonly"],{readonly:e}),t.uiMothership.broadcastOn(["silver.readonly"],{readonly:e})},Rg=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&Ag(e,!0)})),t.on("SwitchMode",(function(){return Ag(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},Bg=function(){var t;return $u.config({channels:(t={},t["silver.readonly"]={schema:Ng,onReceive:function(t,e){ig.set(t,e.readonly)}},t)})},Pg=function(t){return ig.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},Ig=function(t){return ig.config({disabled:t})},Mg=function(t){return ig.config({disabled:t,disableClass:"tox-tbtn--disabled"})},Lg=function(t){return ig.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Fg=function(t,e){var n=t.getApi(e);return function(t){t(n)}},Hg=function(t,e){return Gr((function(n){Fg(t,n)((function(n){var r=t.onSetup(n);null!=r&&e.set(r)}))}))},jg=function(t,e){return Kr((function(n){return Fg(t,n)(e.get())}))},Vg=function(t,e){return Jr((function(n,r){Fg(t,n)(t.onAction),t.triggersSubmenu||e!==up.CLOSE_ON_EXECUTE||(Ar(n,hr()),r.stop())}))},zg={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},Ug=function(t){return G(t,(function(t){return t.toArray()}))},Wg=function(t,e,r,o){var i=an(n);return{type:"item",dom:e.dom,components:Ug(e.optComponents),data:t.data,eventOrder:zg,hasSubmenu:t.triggersSubmenu,itemBehaviours:Fu([Am("item-events",[Vg(t,r),Hg(t,i),jg(t,i)]),Pg((function(){return t.disabled||o.isReadOnly()})),Bg(),Nm.config({})].concat(t.itemBehaviours))}},qg=function(t){return{value:t.value,meta:d({text:t.text.getOr("")},t.meta)}},$g=tinymce.util.Tools.resolve("tinymce.Env"),Yg=function(t){var e=$g.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=H(n,(function(t){var n=t.toLowerCase().trim();return Ot(e,n)?e[n]:t}));return $g.mac?r.join(""):r.join("+")},Gg=function(t){return{dom:{tag:"div",classes:["tox-collection__item-icon"],innerHtml:t}}},Kg=function(t){return{dom:{tag:"div",classes:[fp]},components:[Xi(qp.translate(t))]}},Xg=function(t,e){return{dom:{tag:"div",classes:[fp]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Xi(qp.translate(e))]}]}},Jg=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:Yg(t)}}},Qg=function(t){return{dom:{tag:"div",classes:["tox-collection__item-checkmark"],innerHtml:Rh("checkmark",t)}}},Zg=function(t,e,n,r,o){var i=n?e.or(y.some("")).map(Gg):y.none(),a=t.checkMark,u=t.ariaLabel.map((function(t){return{attributes:{title:qp.translate(t)}}})).getOr({});return{dom:d({tag:"div",classes:[sp,cp].concat(o?["tox-collection__item-icon-rtl"]:[])},u),optComponents:[i,t.htmlContent.fold((function(){return t.textContent.map(r)}),(function(t){return y.some(function(t){return{dom:{tag:"div",classes:[fp],innerHtml:t}}}(t))})),t.shortcutContent.map(Jg),a,t.caret]}},tv=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],ev=["list-bull-circle","list-bull-default","list-bull-square"],nv=function(t,e,n,r){void 0===r&&(r=y.none());var o,i=qp.isRtl()&&t.iconContent.exists((function(t){return I(ev,t)})),u=(o=t.iconContent,o.map((function(t){return qp.isRtl()&&I(tv,t)?t+"-rtl":t}))).map((function(t){return function(t,e,n){return y.from(e()[t.toLowerCase()]).or(n).getOrThunk((function(){return Ah(e)}))}(t,e.icons,r)})),s=y.from(t.meta).fold((function(){return Kg}),(function(t){return Ot(t,"style")?a(Xg,t.style):Kg}));return"color"===t.presets?function(t,e,n,r){var o,i;return{dom:(o=n.getOr(""),i={tag:"div",attributes:t.map((function(t){return{title:r.translate(t)}})).getOr({}),classes:["tox-swatch"]},d(d({},i),"custom"===e?{tag:"button",classes:h(i.classes,["tox-swatches__picker-btn"]),innerHtml:o}:"remove"===e?{classes:h(i.classes,["tox-swatch--remove"]),innerHtml:o}:{attributes:d(d({},i.attributes),{"data-mce-color":e}),styles:{"background-color":e}})),optComponents:[]}}(t.ariaLabel,t.value,u,e):Zg(t,u,n,s,i)},rv=function(t,e){return Dt(t,"tooltipWorker").map((function(t){return[Up.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:gs}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){Up.setComponents(e,[Ji({element:sn.fromDom(t)})])}))}})]})).getOr([])},ov=function(t,e){var n=function(t){return Wp.DOM.encode(t)}(qp.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return n},iv=o(Zl("item-widget",rh())),av=Io("cell-over"),uv=Io("cell-execute"),sv=function(t,e,n){var r,o=function(n){return Rr(n,uv,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return Zi({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:Fu([Am("insert-table-picker-cell",[jr(Kn(),Mm.focus),jr(lr(),o),jr(nr(),i),jr(dr(),i)]),Gm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Mm.config({onFocus:function(n){return Rr(n,av,{row:t,col:e})}})])})},cv=function(t){return G(t,(function(t){return H(t,ta)}))},lv=function(t,e){return Xi(e+1+"x"+(t+1))},fv=function(t){return{value:t}},dv=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,mv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,hv=function(t){return dv.test(t)||mv.test(t)},pv=function(t){var e=function(t){return{value:t.value.replace(dv,(function(t,e,n,r){return e+e+n+n+r+r}))}}(t),n=mv.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},gv=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e},vv=function(t){var e=gv(t.red)+gv(t.green)+gv(t.blue);return fv(e)},bv=Math.min,yv=Math.max,xv=Math.round,wv=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Cv=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,_v=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},kv=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},Sv=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,a=t.value/100;if(i=yv(0,bv(i,1)),a=yv(0,bv(a,1)),0===i)return e=n=r=xv(255*a),_v(e,n,r,1);var u=o/60,s=a*i,c=s*(1-Math.abs(u%2-1)),l=a-s;switch(Math.floor(u)){case 0:e=s,n=c,r=0;break;case 1:e=c,n=s,r=0;break;case 2:e=0,n=s,r=c;break;case 3:e=0,n=c,r=s;break;case 4:e=c,n=0,r=s;break;case 5:e=s,n=0,r=c;break;default:e=n=r=0}return e=xv(255*(e+l)),n=xv(255*(n+l)),r=xv(255*(r+l)),_v(e,n,r,1)},Tv=function(t){var e=pv(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return _v(n,r,o,1)},Dv=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),a=parseInt(n,10),u=parseFloat(r);return _v(o,i,a,u)},Ov=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},Ev=_v(255,0,0,1),Nv=function(t,e){return t.fire("ResizeContent",e)},Av=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");var Rv="choiceitem",Bv=[{type:Rv,text:"Light Green",value:"#BFEDD2"},{type:Rv,text:"Light Yellow",value:"#FBEEB8"},{type:Rv,text:"Light Red",value:"#F8CAC6"},{type:Rv,text:"Light Purple",value:"#ECCAFA"},{type:Rv,text:"Light Blue",value:"#C2E0F4"},{type:Rv,text:"Green",value:"#2DC26B"},{type:Rv,text:"Yellow",value:"#F1C40F"},{type:Rv,text:"Red",value:"#E03E2D"},{type:Rv,text:"Purple",value:"#B96AD9"},{type:Rv,text:"Blue",value:"#3598DB"},{type:Rv,text:"Dark Turquoise",value:"#169179"},{type:Rv,text:"Orange",value:"#E67E23"},{type:Rv,text:"Dark Red",value:"#BA372A"},{type:Rv,text:"Dark Purple",value:"#843FA1"},{type:Rv,text:"Dark Blue",value:"#236FA1"},{type:Rv,text:"Light Gray",value:"#ECF0F1"},{type:Rv,text:"Medium Gray",value:"#CED4D9"},{type:Rv,text:"Gray",value:"#95A5A6"},{type:Rv,text:"Dark Gray",value:"#7E8C8D"},{type:Rv,text:"Navy Blue",value:"#34495E"},{type:Rv,text:"Black",value:"#000000"},{type:Rv,text:"White",value:"#ffffff"}],Pv=function(t){void 0===t&&(t=10);var e,n=Av.getItem("tinymce-custom-colors"),r=C(n)?JSON.parse(n):[],o=t-(e=r).length<0?e.slice(0,t):e,i=function(t){o.splice(t,1)};return{add:function(e){(function(t,e){var n=P(t,e);return-1===n?y.none():y.some(n)})(o,e).each(i),o.unshift(e),o.length>t&&o.pop(),Av.setItem("tinymce-custom-colors",JSON.stringify(o))},state:function(){return o.slice(0)}}}(10),Iv=function(t){return!1!==t.getParam("custom_colors")},Mv=function(t){var n=function(t){return t.getParam("color_map")}(t);return void 0!==n?function(t){var n=[],r=e.document.createElement("canvas");r.height=1,r.width=1;for(var o=r.getContext("2d"),i=function(t,e){var n=e/255;return("0"+Math.round(t*n+255*(1-n)).toString(16)).slice(-2).toUpperCase()},a=function(t){if(/^[0-9A-Fa-f]{6}$/.test(t))return"#"+t.toUpperCase();o.clearRect(0,0,r.width,r.height),o.fillStyle="#FFFFFF",o.fillStyle=t,o.fillRect(0,0,1,1);var e=o.getImageData(0,0,1,1).data,n=e[0],a=e[1],u=e[2],s=e[3];return"#"+i(n,s)+i(a,s)+i(u,s)},u=0;u<t.length;u+=2)n.push({text:t[u+1],value:a(t[u]),type:"choiceitem"});return n}(n):Bv},Lv=function(t){Pv.add(t)},Fv=function(t){return function(t,e){return t.getParam("color_cols",e,"number")}(t,function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))}(Mv(t).length))},Hv=function(t,e,n,r){"custom"===n?qv(t)((function(n){n.each((function(n){Lv(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},jv=function(t,e){return t.concat(H(Pv.state(),(function(t){return{type:Rv,text:t,value:t}})).concat(function(t){var e={type:"choiceitem",text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[e,{type:"choiceitem",text:"Custom color",icon:"color-picker",value:"custom"}]:[e]}(e)))},Vv=function(t,e){return function(n){n(jv(t,e))}},zv=function(t,e,n){var r,o;r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",o=n,t.setIconFill(r,o),t.setIconStroke(r,o)},Uv=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return y.from(function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),n}(t,n)).bind((function(t){return function(t){if("transparent"===t)return y.some(_v(0,0,0,0));var e=wv.exec(t);if(null!==e)return y.some(Dv(e[1],e[2],e[3],"1"));var n=Cv.exec(t);return null!==n?y.some(Dv(n[1],n[2],n[3],n[4])):y.none()}(t).map((function(t){var n=vv(t).value;return yn(e.toLowerCase(),n)}))})).getOr(!1)},columns:Fv(t),fetch:Vv(Mv(t),Iv(t)),onAction:function(e){null!==o.get()&&Hv(t,n,o.get(),(function(){}))},onItemAction:function(r,i){Hv(t,n,i,(function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})}))},onSetup:function(n){null!==o.get()&&zv(n,e,o.get());var r=function(t){t.name===e&&zv(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},Wv=function(t,e,r,o){t.ui.registry.addNestedMenuItem(e,{text:o,icon:"forecolor"===e?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(e){Hv(t,r,e.value,n)}}]}})},qv=function(t){return function(e,n){var r={colorpicker:n},o=function(t){return function(e){var n=e.getData();t(y.from(n.colorpicker)),e.close()}}(e);t.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onAction:function(t,e){"hex-valid"===e.name&&(e.value?t.enable("ok"):t.disable("ok"))},onSubmit:o,onClose:function(){},onCancel:function(){e(y.none())}})}},$v=function(t,e,n,r,o,i,a,u){var s=_p(e),c=Yv(e,n,r,"color"!==o?"normal":"color",i,a,u);return Tp(t,s,c,r,o)},Yv=function(t,e,n,r,o,i,a){return kf(H(t,(function(u){return"choiceitem"===u.type?(s=u,xe("choicemenuitem",Op,s)).fold(kp,(function(s){return y.some(function(t,e,n,r,o,i,a,u){void 0===u&&(u=!0);var s=nv({presets:n,textContent:e?t.text:y.none(),htmlContent:y.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:y.none(),checkMark:e?y.some(Qg(a.icons)):y.none(),caret:y.none(),value:t.value},a,u);return Bt(Wg({data:qg(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return ig.isDisabled(t)},setDisabled:function(e){return ig.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),function(){}},triggersSubmenu:!1,itemBehaviours:[]},s,i,a),{toggling:{toggleClass:"tox-collection__item--enabled",toggleOnExecute:!1,selected:t.active}})}(s,1===n,r,e,i(u.value),o,a,_p(t)))})):y.none();var s})))},Gv=function(t,e){var n=gp(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}};var Kv,Xv={inserttable:function(t){var e=Io("size-label"),n=function(t,e,n){for(var r=[],o=0;o<e;o++){for(var i=[],a=0;a<n;a++)i.push(sv(o,a,t));r.push(i)}return r}(e,10,10),r=Nh({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[Xi("0x0")],behaviours:Fu([Nm.config({})])});return{type:"widget",data:{value:Io("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[iv().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:cv(n).concat(r.asSpec()),behaviours:Fu([Am("insert-table-picker",[Wr(av,(function(t,e,o){var i=o.event().row(),a=o.event().col();!function(t,e,n,r,o){for(var i=0;i<r;i++)for(var a=0;a<o;a++)Gm.set(t[i][a],i<=e&&a<=n)}(n,i,a,10,10),Nm.set(r.get(t),[lv(i,a)])})),Wr(uv,(function(e,n,r){t.onAction({numRows:r.event().row()+1,numColumns:r.event().col()+1}),Ar(e,hr())}))]),Sm.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=jv(e.colorinput.getColors(),e.colorinput.hasCustomColors()),r=e.colorinput.getColorCols(),o=$v(Io("menu-value"),n,(function(e){t.onAction({value:e})}),r,"color",up.CLOSE_ON_EXECUTE,(function(){return!1}),e.shared.providers),i=d(d({},o),{markers:gp("color"),movement:Gv(r,"color")});return{type:"widget",data:{value:Io("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[iv().widget(ch.sketch(i))]}}},Jv=function(t,e,n,r,o,i,a,u){void 0===u&&(u=!0);var s=nv({presets:r,textContent:y.none(),htmlContent:n?t.text.map((function(t){return ov(t,e)})):y.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:y.none(),checkMark:y.none(),caret:y.none(),value:t.value},a.providers,u,t.icon);return Wg({data:qg(t),disabled:t.disabled,getApi:function(){return{}},onAction:function(e){return o(t.value,t.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:rv(t.meta,a)},s,i,a.providers)},Qv=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:d({tag:"div",classes:[cp,"tox-collection__group-heading"]},e),components:[]}},Zv=function(t,e,n,r){void 0===r&&(r=!0);var o=nv({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:y.none(),ariaLabel:t.text,caret:y.none(),checkMark:y.none(),shortcutContent:t.shortcut},n,r);return Wg({data:qg(t),getApi:function(t){return{isDisabled:function(){return ig.isDisabled(t)},setDisabled:function(e){return ig.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)},tb=function(t,e,r,o,i){void 0===o&&(o=!0),void 0===i&&(i=!1);var a,u=i?(a=r.icons,{dom:{tag:"div",classes:["tox-collection__item-caret"],innerHtml:Rh("chevron-down",a)}}):function(t){return{dom:{tag:"div",classes:["tox-collection__item-caret"],innerHtml:Rh("chevron-right",t)}}}(r.icons),s=nv({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:y.none(),ariaLabel:t.text,caret:y.some(u),checkMark:y.none(),shortcutContent:t.shortcut},r,o);return Wg({data:qg(t),getApi:function(t){return{isDisabled:function(){return ig.isDisabled(t)},setDisabled:function(e){return ig.set(t,e)}}},disabled:t.disabled,onAction:n,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},s,e,r)},eb=function(t,e,n,r){void 0===r&&(r=!0);var o=nv({iconContent:t.icon,textContent:t.text,htmlContent:y.none(),ariaLabel:t.text,checkMark:y.some(Qg(n.icons)),caret:y.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return Bt(Wg({data:qg(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return ig.isDisabled(t)},setDisabled:function(e){return ig.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:"tox-collection__item--enabled",toggleOnExecute:!1,selected:t.active}})},nb=function(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?y.some(t[e]):y.none()}(Xv,t.fancytype).map((function(n){return n(t,e)}))};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(Kv||(Kv={}));var rb=function(t,n,r,o,i){var a,u=r.shared.providers,s=function(t){return i?d(d({},t),{shortcut:y.none(),icon:t.text.isSome()?y.none():t.icon}):t};switch(t.type){case"menuitem":return(a=t,xe("menuitem",Np,a)).fold(kp,(function(t){return y.some(Zv(s(t),n,u,o))}));case"nestedmenuitem":return function(t){return xe("nestedmenuitem",Ap,t)}(t).fold(kp,(function(t){return y.some(tb(s(t),n,u,o,i))}));case"togglemenuitem":return function(t){return xe("togglemenuitem",Rp,t)}(t).fold(kp,(function(t){return y.some(eb(s(t),n,u,o))}));case"separator":return function(t){return xe("separatormenuitem",np,t)}(t).fold(kp,(function(t){return y.some(Qv(t))}));case"fancymenuitem":return function(t){return xe("fancymenuitem",Ep,t)}(t).fold(kp,(function(t){return nb(s(t),r)}));default:return e.console.error("Unknown item in general menu",t),y.none()}},ob=function(t,e,n,r,o,i){var a=1===r,u=!a||_p(t);return kf(H(t,(function(t){return"separator"===t.type?(r=t,xe("Autocompleter.Separator",np,r)).fold(kp,(function(t){return y.some(Qv(t))})):function(t){return xe("Autocompleter.Item",rp,t)}(t).fold(kp,(function(t){return y.some(Jv(t,e,a,"normal",n,o,i,u))}));var r})))},ib=function(t,e,n,r,o){var i=_p(e),a=kf(H(e,(function(t){var e=function(t){return rb(t,n,r,function(t){return o?!t.hasOwnProperty("text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(d(d({},t),{disabled:!0})):e(t)})));return(o?Sp:Tp)(t,i,a,1,"normal")},ab=function(t){return ph.singleData(t.value,t)},ub=function(t,n){var r=an(y.none()),o=an(!1),i=Zi(gh.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:Fu([Am("dismissAutocompleter",[jr(_r(),(function(){return s()}))])]),lazySink:n.getSink})),a=function(){return r.get().isSome()},u=function(){a()&&gh.hide(i)},s=function(){if(a()){var e=r.get().map((function(t){return t.element}));zh(e.getOr(sn.fromDom(t.selection.getNode()))).each(xo),u(),r.set(y.none()),o.set(!1)}},c=It((function(){return ip(t)})),l=function(e,n,r,o){e.matchLength=n.text.length;var a=nt(r,(function(t){return y.from(t.columns)})).getOr(1);gh.showAt(i,{anchor:"node",root:sn.fromDom(t.getBody()),node:y.from(e.element)},ch.sketch(function(t,e,n,r){var o=n===Kv.ContentFocus?Qf():Jf(),i=Gv(e,r),a=gp(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:a.selectedItem,item:a.item},movement:i,fakeFocus:n===Kv.ContentFocus,focusManager:o,menuBehaviours:Ip("auto"!==e?[]:[Gr((function(t,e){Bp(t,4,a.item).each((function(e){var n=e.numColumns,r=e.numRows;Sm.setGridSize(t,r,n)}))}))])}}(Tp("autocompleter-value",!0,o,a,"normal"),a,Kv.ContentFocus,"normal"))),gh.getContent(i).each(Hf.highlightFirst)},f=function(i){(function(e){return r.get().map((function(n){return Yh(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return ep(t,c,n,e)}))})).getOrThunk((function(){return tp(t,c)}))})(i).fold(s,(function(i){!function(e){if(!a()){var n=Vh(t,e.range);r.set(y.some({triggerChar:e.triggerChar,element:n,matchLength:e.text.length})),o.set(!1)}}(i.context),i.lookupData.then((function(a){r.get().map((function(r){var c,d,m,h=i.context;if(r.triggerChar===h.triggerChar){var p=(c=h.triggerChar,m=nt(d=a,(function(t){return y.from(t.columns)})).getOr(1),G(d,(function(r){var i=r.items;return ob(i,r.matchText,(function(n,i){var a=t.selection.getRng();Yh(t.dom,a,c).fold((function(){return e.console.error("Lost context. Cursor probably moved")}),(function(t){var e=t.range,a={hide:function(){s()},reload:function(t){u(),f(t)}};o.set(!0),r.onAction(a,e,n,i),o.set(!1)}))}),m,up.BUBBLE_TO_SANDBOX,n)})));p.length>0?l(r,h,a,p):h.text.length-r.matchLength>=10?s():u()}}))}))}))},d={onKeypress:Fh((function(t){27!==t.which&&f()}),50),cancelIfNecessary:s,isMenuOpen:function(){return gh.isOpen(i)},isActive:a,isProcessingAction:o.get,getView:function(){return gh.getContent(i)}};Gh(d,t)},sb=o(!0),cb=function(t,e,n){return function(t,e,n,r){return ha(t,e,n,r,!1)}(t,e,sb,n)},lb=function(t,e,n){return function(t,e,n,r){return ha(t,e,n,r,!0)}(t,e,sb,n)},fb=ma,db=function(t,e,n){return Pa(t,e,n).isSome()};function mb(t,n){var r=null;return{cancel:function(){null!==r&&(e.clearTimeout(r),r=null)},schedule:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r=e.setTimeout((function(){t.apply(null,o),r=null}),n)}}}var hb=function(t){var e=t.raw();return void 0===e.touches||1!==e.touches.length?y.none():y.some(e.touches[0])},pb=function(t){var e=an(y.none()),n=an(!1),r=mb((function(e){t.triggerEvent(mr(),e),n.set(!0)}),400),o=$t([{key:Vn(),value:function(t){return hb(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target()};r.schedule(t),n.set(!1),e.set(y.some(i))})),y.none()}},{key:zn(),value:function(t){return r.cancel(),hb(t).each((function(t){e.get().each((function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.set(y.none())}))})),y.none()}},{key:Un(),value:function(o){r.cancel();return e.get().filter((function(t){return Rn(t.target,o.target())})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(dr(),o)}))}}]);return{fireIfReady:function(t,e){return Dt(o,e).bind((function(e){return e(t)}))}}},gb=function(){return En().browser.isFirefox()},vb=ie([je("triggerEvent"),Xe("stopBackspace",!0)]),bb=function(t,n){var r=Ce("Getting GUI events settings",vb,n),o=pb(r),i=H(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return cb(t,e,(function(t){o.fireIfReady(t,e).each((function(e){e&&t.kill()})),r.triggerEvent(e,t)&&t.kill()}))})),a=an(y.none()),u=cb(t,"paste",(function(t){o.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),r.triggerEvent("paste",t)&&t.kill(),a.set(y.some(e.setTimeout((function(){r.triggerEvent(sr(),t)}),0)))})),s=cb(t,"keydown",(function(t){r.triggerEvent("keydown",t)?t.kill():!0===r.stopBackspace&&function(t){return 8===t.raw().which&&!I(["input","textarea"],Qr(t.target()))&&!db(t.target(),'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return gb()?lb(t,"focus",e):cb(t,"focusin",e)}(t,(function(t){r.triggerEvent("focusin",t)&&t.kill()})),l=an(y.none()),f=function(t,e){return gb()?lb(t,"blur",e):cb(t,"focusout",e)}(t,(function(t){r.triggerEvent("focusout",t)&&t.kill(),l.set(y.some(e.setTimeout((function(){r.triggerEvent(ur(),t)}),0)))}));return{unbind:function(){j(i,(function(t){t.unbind()})),s.unbind(),c.unbind(),f.unbind(),u.unbind(),a.get().each(e.clearTimeout),l.get().each(e.clearTimeout)}}},yb=function(t,e){var n=Dt(t,"target").map((function(t){return t()})).getOr(e);return an(n)},xb=Nt([{stopped:[]},{resume:["element"]},{complete:[]}]),wb=function(t,e,n,r,i,a){var u=t(e,r),s=function(t,e){var n=an(!1),r=an(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:o(t),setSource:e.set,getSource:e.get}}(n,i);return u.fold((function(){return a.logEventNoHandlers(e,r),xb.complete()}),(function(t){var n=t.descHandler;return ni(n)(s),s.isStopped()?(a.logEventStopped(e,t.element,n.purpose()),xb.stopped()):s.isCut()?(a.logEventCut(e,t.element,n.purpose()),xb.complete()):so(t.element).fold((function(){return a.logNoParent(e,t.element,n.purpose()),xb.complete()}),(function(r){return a.logEventResponse(e,t.element,n.purpose()),xb.resume(r)}))}))},Cb=function(t,e,n,r,o,i){return wb(t,e,n,r,o,i).fold((function(){return!0}),(function(r){return Cb(t,e,n,r,o,i)}),(function(){return!1}))},_b=function(t,e,r){var i=function(t){var e=an(!1);return{stop:function(){e.set(!0)},cut:n,isStopped:e.get,isCut:o(!1),event:o(t),setSource:s("Cannot set source of a broadcasted event"),getSource:s("Cannot get source of a broadcasted event")}}(e);return j(t,(function(t){var e=t.descHandler();ni(e)(i)})),i.isStopped()},kb=function(t,e,n,r,o){var i=yb(n,r);return Cb(t,e,n,r,i,o)};function Sb(){var t={};return{registerId:function(e,n,r){xt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=ei(r,e),t[o]=i}))},unregisterId:function(e){xt(t,(function(t,n){t.hasOwnProperty(e)&&delete t[e]}))},filterByType:function(e){return Dt(t,e).map((function(t){return kt(t,(function(t,e){return function(t,e){return{id:o(t),descHandler:o(e)}}(e,t)}))})).getOr([])},find:function(e,n,r){var o=Dt(t,n);return Ln(r,(function(t){return function(t,e){return Vo(e).fold((function(){return y.none()}),(function(n){return t.bind((function(t){return Dt(t,n)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}))}(o,t)}),e)}}}function Tb(){var t=Sb(),e={},n=function(t){var e=t.element();return Vo(e).fold((function(){return function(t,e){var n=Io(Fo+t);return jo(e,n),n}("uid-",t.element())}),(function(t){return t}))},r=function(n){Vo(n.element()).each((function(n){delete e[n],t.unregisterId(n)}))};return{find:function(e,n,r){return t.find(e,n,r)},filter:function(e){return t.filterByType(e)},register:function(o){var i=n(o);Et(e,i)&&function(t,n){var o=e[n];if(o!==t)throw new Error('The tagId "'+n+'" is already used by: '+Ao(o.element())+"\nCannot use it for: "+Ao(t.element())+"\nThe conflicting element is"+(Ti(o.element())?" ":" not ")+"already in the DOM");r(t)}(o,i);var a=[o];t.registerId(a,i,o.events()),e[i]=o},unregister:r,getById:function(t){return Dt(e,t)}}}var Db=Cf({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=m(e,["attributes"]);return{uid:t.uid,dom:d({tag:"div",attributes:d({role:"presentation"},n)},r),components:t.components,behaviours:yl(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[Xe("components",[]),bl("containerBehaviours",[]),Xe("events",{}),Xe("domModification",{}),Xe("eventOrder",{})]}),Ob=function(t){var e=function(e){return so(t.element()).fold((function(){return!0}),(function(t){return Rn(e,t)}))},r=Tb(),i=function(t,n){return r.find(e,t,n)},a=bb(t.element(),{triggerEvent:function(t,e){return za(t,e.target(),(function(n){return function(t,e,n,r){var o=n.target();return kb(t,e,n,o,r)}(i,t,e,n)}))}}),u={debugInfo:o("real"),triggerEvent:function(t,e,n){za(t,e,(function(r){return kb(i,t,n,e,r)}))},triggerFocus:function(t,e){Vo(t).fold((function(){Gu(t)}),(function(r){za(ar(),t,(function(r){return function(t,e,n,r,o){var i=yb(n,r);wb(t,e,n,r,i,o)}(i,ar(),{originator:o(e),kill:n,prevent:n,target:o(t)},t,r),!1}))}))},triggerEscape:function(t,e){u.triggerEvent("keydown",t.element(),e.event())},getByUid:function(t){return g(t)},getByDom:function(t){return v(t)},build:Zi,addToGui:function(t){l(t)},removeFromGui:function(t){f(t)},addToWorld:function(t){s(t)},removeFromWorld:function(t){c(t)},broadcast:function(t){m(t)},broadcastOn:function(t,e){h(t,e)},broadcastEvent:function(t,e){p(t,e)},isConnected:o(!0)},s=function(t){t.connect(u),eo(t.element())||(r.register(t),j(t.components(),s),u.triggerEvent(gr(),t.element(),{target:o(t.element())}))},c=function(t){eo(t.element())||(j(t.components(),c),r.unregister(t)),t.disconnect()},l=function(e){Pc(t,e)},f=function(t){Lc(t)},d=function(t){var e=r.filter(cr());j(e,(function(e){var n=e.descHandler();ni(n)(t)}))},m=function(t){d({universal:o(!0),data:o(t)})},h=function(t,e){d({universal:o(!1),channels:o(t),data:o(e)})},p=function(t,e){var n=r.filter(t);return _b(n,e)},g=function(t){return r.getById(t).fold((function(){return it.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),it.value)},v=function(t){var e=Vo(t).getOr("not found");return g(e)};return s(t),{root:o(t),element:t.element,destroy:function(){a.unbind(),yo(t.element())},add:l,remove:f,getByUid:g,getByDom:v,addToWorld:s,removeFromWorld:c,broadcast:m,broadcastOn:h,broadcastEvent:p}},Eb=o([Xe("prefix","form-field"),bl("fieldBehaviours",[Of,vl])]),Nb=o([Gl({schema:[Ie("dom")],name:"label"}),Gl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ie("text")],name:"aria-descriptor"}),$l({factory:{sketch:function(t){var e=Wt(t,["factory"]);return t.factory.sketch(e)}},schema:[Ie("factory")],name:"field"})]),Ab=_f({name:"FormField",configFields:Eb(),partFields:Nb(),factory:function(t,e,n,r){var o=xl(t.fieldBehaviours,[Of.config({find:function(e){return uf(e,t,"field")}}),vl.config({store:{mode:"manual",getValue:function(t){return Of.getCurrent(t).bind(vl.getValue)},setValue:function(t,e){Of.getCurrent(t).each((function(t){vl.setValue(t,e)}))}}})]),i=Lr([Gr((function(e,n){var r=cf(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=Io(t.prefix);r.label().each((function(t){ko(t.element(),"for",n),ko(e.element(),"id",n)})),r["aria-descriptor"]().each((function(n){var r=Io(t.prefix);ko(n.element(),"id",r),ko(e.element(),"aria-describedby",r)}))}))}))]),a={getField:function(e){return uf(e,t,"field")},getLabel:function(e){return uf(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:a}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),Rb=Object.freeze({__proto__:null,exhibit:function(t,e){return ti({attributes:$t([{key:e.tabAttr,value:"true"}])})}}),Bb=[Xe("tabAttr","data-alloy-tabstop")],Pb=ju({fields:Bb,name:"tabstopping",active:Rb}),Ib=function(t,e,n,r){var o=Mb(t,e,n,r);return Ab.sketch(o)},Mb=function(t,e,n,r){return{dom:Lb(n),components:t.toArray().concat([e]),fieldBehaviours:Fu(r)}},Lb=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},Fb=function(t,e){return Ab.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},Hb=Io("form-component-change"),jb=Io("form-close"),Vb=Io("form-cancel"),zb=Io("form-action"),Ub=Io("form-submit"),Wb=Io("form-block"),qb=Io("form-unblock"),$b=Io("form-tabchange"),Yb=Io("form-resize"),Gb=function(t,e){var n,r,o=t.label.map((function(t){return Fb(t,e)})),a=function(t){return function(e,n){Pa(n.event().target(),"[data-collection-item-value]").each((function(r){t(e,n,r,So(r,"data-collection-item-value"))}))}},u=a((function(n,r,o,i){r.stop(),e.isReadOnly()||Rr(n,zb,{name:t.name,value:i})})),s=[jr(Kn(),a((function(t,e,n){Gu(n)}))),jr(nr(),u),jr(dr(),u),jr(Xn(),a((function(t,e,n){Ba(t.element(),"."+dp).each((function(t){pi(t,dp)})),mi(n,dp)}))),jr(Jn(),a((function(t){Ba(t.element(),"."+dp).each((function(t){pi(t,dp)}))}))),Jr(a((function(e,n,r,o){Rr(e,zb,{name:t.name,value:o})})))],c=function(t,e){return H($s(t.element(),".tox-collection__item"),e)},l=Ab.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:i},behaviours:Fu([ig.config({disabled:e.isReadOnly,onDisabled:function(t){c(t,(function(t){mi(t,"tox-collection__item--state-disabled"),ko(t,"aria-disabled",!0)}))},onEnabled:function(t){c(t,(function(t){pi(t,"tox-collection__item--state-disabled"),Oo(t,"aria-disabled")}))}}),Bg(),Nm.config({}),vl.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=H(r,(function(n){var r,o=qp.translate(n.text),i=1===t.columns?'<div class="tox-collection__item-label">'+o+"</div>":"",a='<div class="tox-collection__item-icon">'+n.icon+"</div>",u={_:" "," - ":" ","-":" "},s=o.replace(/\_| \- |\-/g,(function(t){return u[t]}));return'<div class="tox-collection__item'+(e.isReadOnly()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+(('"'===(r=n.value)?""":r)+'" title="')+s+'" aria-label="'+s+'">'+a+i+"</div>"})),i=t.columns>1&&"auto"!==t.columns?F(o,t.columns):[o],a=H(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));Co(n.element(),a.join(""))}(n,r),"auto"===t.columns&&Bp(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;Sm.setGridSize(n,e,r)})),Ar(n,Yb)}}),Pb.config({}),Sm.config((n=t.columns,r="normal",1===n?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===n?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===r?".tox-swatches__row":".tox-collection__group",cell:"color"===r?".tox-swatch":"."+cp}})),Am("collection-events",s)]),eventOrder:{"alloy.execute":["disabling","alloy.base.behaviour","collection-events"]}});return Ib(o,l,["tox-form__group--collection"],[])},Kb=o([We("data"),Xe("inputAttributes",{}),Xe("inputStyles",{}),Xe("tag","input"),Xe("inputClasses",[]),Ja("onSetValue"),Xe("styles",{}),Xe("eventOrder",{}),bl("inputBehaviours",[vl,Mm]),Xe("selectOnFocus",!0)]),Xb=function(t){return Fu([Mm.config({onFocus:t.selectOnFocus?function(t){var e=t.element(),n=Vi(e);e.dom().setSelectionRange(0,n.length)}:n})])},Jb=function(t){return d(d({},Xb(t)),xl(t.inputBehaviours,[vl.config({store:d(d({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return Vi(t.element())},setValue:function(t,e){Vi(t.element())!==e&&zi(t.element(),e)}}),onSetValue:t.onSetValue})]))},Qb=function(t){return{tag:t.tag,attributes:d({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Zb=Cf({name:"Input",configFields:Kb(),factory:function(t,e){return{uid:t.uid,dom:Qb(t),components:[],behaviours:Jb(t),eventOrder:t.eventOrder}}}),ty={},ey={exports:ty};!function(e,n,r,o){!function(o){if("object"==typeof n&&void 0!==r)r.exports=o();else if("function"==typeof e&&e.amd)e([],o);else{("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).EphoxContactWrapper=o()}}((function(){return function t(e,n,r){function i(u,s){if(!n[u]){if(!e[u]){var c="function"==typeof o&&o;if(!s&&c)return c(u,!0);if(a)return a(u,!0);var l=new Error("Cannot find module '"+u+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[u]={exports:{}};e[u][0].call(f.exports,(function(t){return i(e[u][1][t]||t)}),f,f.exports,t,e,n,r)}return n[u].exports}for(var a="function"==typeof o&&o,u=0;u<r.length;u++)i(r[u]);return i}({1:[function(t,e,n){var r,o,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(t){o=u}}();var c,l=[],f=!1,d=-1;function m(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&h())}function h(){if(!f){var t=s(m);f=!0;for(var e=l.length;e;){for(c=l,l=[];++d<e;)c&&c[d].run();d=-1,e=l.length}c=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new p(t,e)),1!==l.length||f||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function a(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void s(e.promise,t)}u(e.promise,r)}else(1===t._state?u:s)(e.promise,t._value)}))):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){s(t,e)}var r,o}function s(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)a(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,u(e,t))}),(function(t){n||(n=!0,s(e,t))}))}catch(t){if(n)return;n=!0,s(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return a(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(t){o(i,t)}),n)}e[i]=a,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,a=Array.prototype.slice,u={},s=0;function c(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new c(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new c(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=s++,r=!(arguments.length<2)&&a.call(arguments,1);return u[e]=!0,o((function(){u[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete u[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(void 0,ty,ey,void 0);var ny,ry=ey.exports.boltExport,oy=function(t){var n=y.none(),r=[],o=function(t){i()?u(t):r.push(t)},i=function(){return n.isSome()},a=function(t){j(t,u)},u=function(t){n.each((function(n){e.setTimeout((function(){t(n)}),0)}))};return t((function(t){i()||(n=y.some(t),a(r),r=[])})),{get:o,map:function(t){return oy((function(e){o((function(n){e(t(n))}))}))},isReady:i}},iy={nu:oy,pure:function(t){return oy((function(e){e(t)}))}},ay=function(t){e.setTimeout((function(){throw t}),0)},uy=function(t){var e=function(e){t().then(e,ay)};return{map:function(e){return uy((function(){return t().then(e)}))},bind:function(e){return uy((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return uy((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return iy.nu(e)},toCached:function(){var e=null;return uy((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},sy=function(t){return uy((function(){return new ry(t)}))},cy=function(t){return uy((function(){return ry.resolve(t)}))},ly=["input","textarea"],fy=function(t){var e=Qr(t);return I(ly,e)},dy=function(t,e){var n=e.getRoot(t).getOr(t.element());pi(n,e.invalidClass),e.notify.each((function(e){fy(t.element())&&ko(t.element(),"aria-invalid",!1),e.getContainer(t).each((function(t){Co(t,e.validHtml)})),e.onValid(t)}))},my=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element());mi(o,e.invalidClass),e.notify.each((function(e){fy(t.element())&&ko(t.element(),"aria-invalid",!0),e.getContainer(t).each((function(t){Co(t,r)})),e.onInvalid(t,r)}))},hy=function(t,e,n){return e.validator.fold((function(){return cy(it.value(!0))}),(function(e){return e.validate(t)}))},py=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),hy(t,e).map((function(n){return t.getSystem().isConnected()?n.fold((function(n){return my(t,e,0,n),it.error(n)}),(function(n){return dy(t,e),it.value(n)})):it.error("No longer in system")}))},gy=Object.freeze({__proto__:null,markValid:dy,markInvalid:my,query:hy,run:py,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element());return gi(n,e.invalidClass)}}),vy=Object.freeze({__proto__:null,events:function(t,e){return t.validator.map((function(e){return Lr([jr(e.onEvent,(function(e){py(e,t).get(i)}))].concat(e.validateOnLoad?[Gr((function(e){py(e,t).get(n)}))]:[]))})).getOr({})}}),by=[Ie("invalidClass"),Xe("getRoot",y.none),Ke("notify",[Xe("aria","alert"),Xe("getContainer",y.none),Xe("validHtml",""),Ja("onValid"),Ja("onInvalid"),Ja("onValidate")]),Ke("validator",[Ie("validate"),Xe("onEvent","input"),Xe("validateOnLoad",!0)])],yy=ju({fields:by,name:"invalidating",active:vy,apis:gy,extra:{validation:function(t){return function(e){var n=vl.getValue(e);return cy(t(n))}}}}),xy=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),wy=[Me("others",ye(it.value,Te()))],Cy=ju({fields:wy,name:"coupling",apis:xy,state:Object.freeze({__proto__:null,init:function(){var t={},e=o({});return Qo({readState:e,getOrCreate:function(e,n,r){var o=bt(n.others);if(o)return Dt(t,r).getOrThunk((function(){var o=Dt(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})}),_y=o("sink"),ky=o(Gl({name:_y(),overrides:o({dom:{tag:"div"},behaviours:Fu([Ec.config({useFixed:l})]),events:Lr([qr(Qn()),qr(qn()),qr(nr())])})}));!function(t){t[t.HighlightFirst=0]="HighlightFirst",t[t.HighlightNone=1]="HighlightNone"}(ny||(ny={}));var Sy=function(t,e){var n=t.getHotspot(e).getOr(e),r=t.getAnchorOverrides();return t.layouts.fold((function(){return{anchor:"hotspot",hotspot:n,overrides:r}}),(function(t){return{anchor:"hotspot",hotspot:n,overrides:r,layouts:t}}))},Ty=function(t,e,n,r,o,i,a){return function(t,e,n,r,o,i,a){var u=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),s=Ny(r,t);return u.map((function(t){return t.bind((function(t){return y.from(ph.sketch(d(d({},i.menu()),{uid:zo(""),data:t,highlightImmediately:a===ny.HighlightFirst,onOpenMenu:function(t,e){var r=s().getOrDie();Ec.position(r,n,e),Jc.decloak(o)},onOpenSubmenu:function(t,e,n){var r=s().getOrDie();Ec.position(r,{anchor:"submenu",item:e},n),Jc.decloak(o)},onRepositionMenu:function(t,e,r){var o=s().getOrDie();Ec.position(o,n,e),j(r,(function(t){Ec.position(o,{anchor:"submenu",item:t.triggeringItem},t.triggeredMenu)}))},onEscape:function(){return Mm.focus(r),Jc.close(o),y.some(!0)}})))}))}))}(t,e,Sy(t,n),n,r,o,a).map((function(t){return t.fold((function(){Jc.isOpen(r)&&Jc.close(r)}),(function(t){Jc.cloak(r),Jc.open(r,t),i(r)})),r}))},Dy=function(t,e,n,r,o,i,a){return Jc.close(r),cy(r)},Oy=function(t,e,n,r,o,i){var a=Cy.getCoupled(n,"sandbox");return(Jc.isOpen(a)?Dy:Ty)(t,e,n,a,r,o,i)},Ey=function(t,e,n){var r=Of.getCurrent(e).getOr(e),o=fa(t.element());n?Ai(r.element(),"min-width",o+"px"):function(t,e){la.set(t,e)}(r.element(),o)},Ny=function(t,e){return t.getSystem().getByUid(e.uid+"-"+_y()).map((function(t){return function(){return it.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return it.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},Ay=function(t){Jc.getState(t).each((function(t){ph.repositionMenus(t)}))},Ry=function(t,e,n){var r=Ia(),o=Ny(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:Cl(t.sandboxBehaviours,[vl.config({store:{mode:"memory",initialValue:e}}),Jc.config({onOpen:function(o,i){var a=Sy(t,e);r.link(e.element()),t.matchWidth&&Ey(a.hotspot,i,t.useMinWidth),t.onOpen(a,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element()),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return La(n,r)||La(e,r)},getAttachPoint:function(){return o().getOrDie()}}),Of.config({find:function(t){return Jc.getState(t).bind((function(t){return Of.getCurrent(t)}))}}),$u.config({channels:d(d({},nl({isExtraPart:c})),ol({doReposition:Ay}))})])}},By=function(t){var e=Cy.getCoupled(t,"sandbox");Ay(e)},Py=function(){return[Xe("sandboxClasses",[]),wl("sandboxBehaviours",[Of,$u,Jc,vl])]},Iy=o([Ie("dom"),Ie("fetch"),Ja("onOpen"),Qa("onExecute"),Xe("getHotspot",y.some),Xe("getAnchorOverrides",o({})),Ts(),bl("dropdownBehaviours",[Gm,Cy,Sm,Mm]),Ie("toggleClass"),Xe("eventOrder",{}),We("lazySink"),Xe("matchWidth",!1),Xe("useMinWidth",!1),We("role")].concat(Py())),My=o([Yl({schema:[Ga()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),ky()]),Ly=_f({name:"Dropdown",configFields:Iy(),partFields:My(),factory:function(t,e,r,o){var i,a,u=function(t){Jc.getState(t).each((function(t){ph.highlightPrimary(t)}))},s={expand:function(e){Gm.isOn(e)||Oy(t,(function(t){return t}),e,o,n,ny.HighlightNone).get(n)},open:function(e){Gm.isOn(e)||Oy(t,(function(t){return t}),e,o,n,ny.HighlightFirst).get(n)},isOpen:Gm.isOn,close:function(e){Gm.isOn(e)&&Oy(t,(function(t){return t}),e,o,n,ny.HighlightFirst).get(n)},repositionMenus:function(t){Gm.isOn(t)&&By(t)}},c=function(t,e){return Br(t),y.some(!0)};return{uid:t.uid,dom:t.dom,components:e,behaviours:xl(t.dropdownBehaviours,[Gm.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),Cy.config({others:{sandbox:function(e){return Ry(t,e,{onOpen:function(){Gm.on(e)},onClose:function(){Gm.off(e)}})}}}),Sm.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,e){if(Ly.isOpen(t)){var n=Cy.getCoupled(t,"sandbox");u(n)}else Ly.open(t);return y.some(!0)},onEscape:function(t,e){return Ly.isOpen(t)?(Ly.close(t),y.some(!0)):y.none()}}),Mm.config({})]),events:Xm(y.some((function(e){Oy(t,(function(t){return t}),e,o,u,ny.HighlightFirst).get(n)}))),eventOrder:d(d({},t.eventOrder),(i={},i[lr()]=["disabling","toggling","alloy.base.behaviour"],i)),apis:s,domModification:{attributes:d(d({"aria-haspopup":"true"},t.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===t.dom.tag?{type:(a="type",Dt(t.dom,"attributes").bind((function(t){return Dt(t,a)}))).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),Fy=Object.freeze({__proto__:null,events:function(){return Lr([Fr(or(),o(!0))])},exhibit:function(){return ti({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),Hy=ju({fields:[],name:"unselecting",active:Fy}),jy=Io("color-input-change"),Vy=Io("color-swatch-change"),zy=Io("color-picker-cancel"),Uy=function(t,e,n){var r=Ab.parts().field({factory:Zb,inputClasses:["tox-textfield"],onSetValue:function(t){return yy.run(t).get((function(){}))},inputBehaviours:Fu([ig.config({disabled:e.providers.isReadOnly}),Bg(),Pb.config({}),yy.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return so(t.element())},notify:{onValid:function(t){var e=vl.getValue(t);Rr(t,jy,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=vl.getValue(t);if(0===e.length)return cy(it.value(!0));var n=sn.fromTag("span");Ai(n,"background-color",e);var r=Mi(n,"background-color").fold((function(){return it.error("blah")}),(function(t){return it.value(e)}));return cy(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return Fb(t,e.providers)})),i=function(t,e){Rr(t,Vy,{value:e})},a=Nh(function(t,e){return Ly.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:Fu([Ig(e.providers.isReadOnly),Bg(),Hy.config({}),Pb.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return sy((function(e){return t.fetch(e)})).map((function(r){return y.from(ab(Bt($v(Io("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,up.CLOSE_ON_EXECUTE,(function(){return!1}),e.providers),{movement:Gv(t.columns,t.presets)})))}))},parts:{menu:yp(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[Cu,wu,Tu]},onLtr:function(){return[wu,Cu,Tu]}},components:[],fetch:Vv(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){a.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return Ar(t,zy)}),(function(e){i(t,e),Lv(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))}},e));return Ab.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,a.asSpec()]}]),fieldBehaviours:Fu([Am("form-field-events",[jr(jy,(function(e,n){a.getOpt(e).each((function(t){Ai(t.element(),"background-color",n.event().color())})),Rr(e,Hb,{name:t.name})})),jr(Vy,(function(t,e){Ab.getField(t).each((function(n){vl.setValue(n,e.event().value()),Of.getCurrent(t).each(Mm.focus)}))})),jr(zy,(function(t,e){Ab.getField(t).each((function(e){Of.getCurrent(t).each(Mm.focus)}))}))])])})},Wy=function(t,e,n){return{hue:t,saturation:e,value:n}},qy=Io("rgb-hex-update"),$y=Io("slider-update"),Yy=Io("palette-update"),Gy=Gl({schema:[Ie("dom")],name:"label"}),Ky=function(t){return Gl({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:Lr([Vr(Vn(),(function(e,n,r){return t(e,r)}),[e]),Vr(qn(),(function(e,n,r){return t(e,r)}),[e]),Vr($n(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},Xy=Ky("top-left"),Jy=Ky("top"),Qy=Ky("top-right"),Zy=Ky("right"),tx=Ky("bottom-right"),ex=Ky("bottom"),nx=Ky("bottom-left"),rx=[Gy,Ky("left"),Zy,Jy,ex,Xy,Qy,nx,tx,$l({name:"thumb",defaults:o({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Lr([Ur(Vn(),t,"spectrum"),Ur(zn(),t,"spectrum"),Ur(Un(),t,"spectrum"),Ur(qn(),t,"spectrum"),Ur($n(),t,"spectrum"),Ur(Gn(),t,"spectrum")])}}}),$l({schema:[on("mouseIsDown",(function(){return an(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:Fu([Sm.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),Mm.config({})]),events:Lr([jr(Vn(),n),jr(zn(),n),jr(qn(),n),jr($n(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}})],ox=o("slider.change.value"),ix=function(t){var e=t.event().raw();if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?y.some(n.touches[0]).map((function(t){return aa(t.clientX,t.clientY)})):y.none()}var r=e;return void 0!==r.clientX?y.some(r).map((function(t){return aa(t.clientX,t.clientY)})):y.none()},ax=function(t){return t.model.minX},ux=function(t){return t.model.minY},sx=function(t){return t.model.minX-1},cx=function(t){return t.model.minY-1},lx=function(t){return t.model.maxX},fx=function(t){return t.model.maxY},dx=function(t){return t.model.maxX+1},mx=function(t){return t.model.maxY+1},hx=function(t,e,n){return e(t)-n(t)},px=function(t){return hx(t,lx,ax)},gx=function(t){return hx(t,fx,ux)},vx=function(t){return px(t)/2},bx=function(t){return gx(t)/2},yx=function(t){return t.stepSize},xx=function(t){return t.snapToGrid},wx=function(t){return t.snapStart},Cx=function(t){return t.rounded},_x=function(t,e){return void 0!==t[e+"-edge"]},kx=function(t){return _x(t,"left")},Sx=function(t){return _x(t,"right")},Tx=function(t){return _x(t,"top")},Dx=function(t){return _x(t,"bottom")},Ox=function(t){return t.model.value.get()},Ex=function(t){return{x:o(t)}},Nx=function(t){return{y:o(t)}},Ax=function(t,e){return{x:o(t),y:o(e)}},Rx=function(t,e){Rr(t,ox(),{value:e})},Bx=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},Px=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},Ix=function(t,e,n){return Math.max(e,Math.min(n,t))},Mx=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,a=t.snap,u=t.snapStart,s=t.rounded,c=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,h=c?e-1:e,p=l?n+1:n;if(o<f)return h;if(o>d)return p;var g=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=Ix(g/m*r+e,h,p);return a&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return Ix(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),a=Math.floor((t-e)/r),u=Math.floor((n-e)/r),s=e+Math.min(u,a+i)*r;return Math.max(e,s)}))}(v,e,n,i,u):s?Math.round(v):v},Lx=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,a=t.hasMaxEdge,u=t.maxBound,s=t.maxOffset,c=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:c:o>n?a?u:l:(o-e)/r*s},Fx=function(t){return t.element().dom().getBoundingClientRect()},Hx=function(t,e){return t[e]},jx=function(t){var e=Fx(t);return Hx(e,"left")},Vx=function(t){var e=Fx(t);return Hx(e,"right")},zx=function(t){var e=Fx(t);return Hx(e,"top")},Ux=function(t){var e=Fx(t);return Hx(e,"bottom")},Wx=function(t){var e=Fx(t);return Hx(e,"width")},qx=function(t){var e=Fx(t);return Hx(e,"height")},$x=function(t,e,n){return(t+e)/2-n},Yx=function(t,e){var n=Fx(t),r=Fx(e),o=Hx(n,"left"),i=Hx(n,"right"),a=Hx(r,"left");return $x(o,i,a)},Gx=function(t,e){var n=Fx(t),r=Fx(e),o=Hx(n,"top"),i=Hx(n,"bottom"),a=Hx(r,"top");return $x(o,i,a)},Kx=function(t,e){Rr(t,ox(),{value:e})},Xx=function(t){return{x:o(t)}},Jx=function(t,e,n){var r={min:ax(e),max:lx(e),range:px(e),value:n,step:yx(e),snap:xx(e),snapStart:wx(e),rounded:Cx(e),hasMinEdge:kx(e),hasMaxEdge:Sx(e),minBound:jx(t),maxBound:Vx(t),screenRange:Wx(t)};return Mx(r)},Qx=function(t){return function(e,n){return function(t,e,n){var r=(t>0?Px:Bx)(Ox(n).x(),ax(n),lx(n),yx(n));return Kx(e,Xx(r)),y.some(r)}(t,e,n).map((function(){return!0}))}},Zx=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=Wx(t),a=r.bind((function(e){return y.some(Yx(e,t))})).getOr(0),u=o.bind((function(e){return y.some(Yx(e,t))})).getOr(i),s={min:ax(e),max:lx(e),range:px(e),value:n,hasMinEdge:kx(e),hasMaxEdge:Sx(e),minBound:jx(t),minOffset:0,maxBound:Vx(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return Lx(s)}(e,i,n,r,o);return jx(e)-jx(t)+a},tw=Qx(-1),ew=Qx(1),nw=y.none,rw=y.none,ow={"top-left":y.none(),top:y.none(),"top-right":y.none(),right:y.some((function(t,e){Rx(t,Ex(dx(e)))})),"bottom-right":y.none(),bottom:y.none(),"bottom-left":y.none(),left:y.some((function(t,e){Rx(t,Ex(sx(e)))}))},iw=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=Jx(t,e,n),o=Xx(r);return Kx(t,o),r},setToMin:function(t,e){var n=ax(e);Kx(t,Xx(n))},setToMax:function(t,e){var n=lx(e);Kx(t,Xx(n))},findValueOfOffset:Jx,getValueFromEvent:function(t){return ix(t).map((function(t){return t.left()}))},findPositionOfValue:Zx,setPositionFromValue:function(t,e,n,r){var o=Ox(n),i=Zx(t,r.getSpectrum(t),o.x(),r.getLeftEdge(t),r.getRightEdge(t),n),a=fa(e.element())/2;Ai(e.element(),"left",i-a+"px")},onLeft:tw,onRight:ew,onUp:nw,onDown:rw,edgeActions:ow}),aw=function(t,e){Rr(t,ox(),{value:e})},uw=function(t){return{y:o(t)}},sw=function(t,e,n){var r={min:ux(e),max:fx(e),range:gx(e),value:n,step:yx(e),snap:xx(e),snapStart:wx(e),rounded:Cx(e),hasMinEdge:Tx(e),hasMaxEdge:Dx(e),minBound:zx(t),maxBound:Ux(t),screenRange:qx(t)};return Mx(r)},cw=function(t){return function(e,n){return function(t,e,n){var r=(t>0?Px:Bx)(Ox(n).y(),ux(n),fx(n),yx(n));return aw(e,uw(r)),y.some(r)}(t,e,n).map((function(){return!0}))}},lw=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=qx(t),a=r.bind((function(e){return y.some(Gx(e,t))})).getOr(0),u=o.bind((function(e){return y.some(Gx(e,t))})).getOr(i),s={min:ux(e),max:fx(e),range:gx(e),value:n,hasMinEdge:Tx(e),hasMaxEdge:Dx(e),minBound:zx(t),minOffset:0,maxBound:Ux(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return Lx(s)}(e,i,n,r,o);return zx(e)-zx(t)+a},fw=y.none,dw=y.none,mw=cw(-1),hw=cw(1),pw={"top-left":y.none(),top:y.some((function(t,e){Rx(t,Nx(cx(e)))})),"top-right":y.none(),right:y.none(),"bottom-right":y.none(),bottom:y.some((function(t,e){Rx(t,Nx(mx(e)))})),"bottom-left":y.none(),left:y.none()},gw=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=sw(t,e,n),o=uw(r);return aw(t,o),r},setToMin:function(t,e){var n=ux(e);aw(t,uw(n))},setToMax:function(t,e){var n=fx(e);aw(t,uw(n))},findValueOfOffset:sw,getValueFromEvent:function(t){return ix(t).map((function(t){return t.top()}))},findPositionOfValue:lw,setPositionFromValue:function(t,e,n,r){var o=Ox(n),i=lw(t,r.getSpectrum(t),o.y(),r.getTopEdge(t),r.getBottomEdge(t),n),a=ra(e.element())/2;Ai(e.element(),"top",i-a+"px")},onLeft:fw,onRight:dw,onUp:mw,onDown:hw,edgeActions:pw}),vw=function(t,e){Rr(t,ox(),{value:e})},bw=function(t,e){return{x:o(t),y:o(e)}},yw=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?Px:Bx,i=e?Ox(r).x():o(Ox(r).x(),ax(r),lx(r),yx(r)),a=e?o(Ox(r).y(),ux(r),fx(r),yx(r)):Ox(r).y();return vw(n,bw(i,a)),y.some(i)}(t,e,n,r).map((function(){return!0}))}},xw=yw(-1,!1),ww=yw(1,!1),Cw=yw(-1,!0),_w=yw(1,!0),kw={"top-left":y.some((function(t,e){Rx(t,Ax(sx(e),cx(e)))})),top:y.some((function(t,e){Rx(t,Ax(vx(e),cx(e)))})),"top-right":y.some((function(t,e){Rx(t,Ax(dx(e),cx(e)))})),right:y.some((function(t,e){Rx(t,Ax(dx(e),bx(e)))})),"bottom-right":y.some((function(t,e){Rx(t,Ax(dx(e),mx(e)))})),bottom:y.some((function(t,e){Rx(t,Ax(vx(e),mx(e)))})),"bottom-left":y.some((function(t,e){Rx(t,Ax(sx(e),mx(e)))})),left:y.some((function(t,e){Rx(t,Ax(sx(e),bx(e)))}))},Sw=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=Jx(t,e,n.left()),o=sw(t,e,n.top()),i=bw(r,o);return vw(t,i),i},setToMin:function(t,e){var n=ax(e),r=ux(e);vw(t,bw(n,r))},setToMax:function(t,e){var n=lx(e),r=fx(e);vw(t,bw(n,r))},getValueFromEvent:function(t){return ix(t)},setPositionFromValue:function(t,e,n,r){var o=Ox(n),i=Zx(t,r.getSpectrum(t),o.x(),r.getLeftEdge(t),r.getRightEdge(t),n),a=lw(t,r.getSpectrum(t),o.y(),r.getTopEdge(t),r.getBottomEdge(t),n),u=fa(e.element())/2,s=ra(e.element())/2;Ai(e.element(),"left",i-u+"px"),Ai(e.element(),"top",a-s+"px")},onLeft:xw,onRight:ww,onUp:Cw,onDown:_w,edgeActions:kw}),Tw=_f({name:"Slider",configFields:[Xe("stepSize",1),Xe("onChange",n),Xe("onChoose",n),Xe("onInit",n),Xe("onDragStart",n),Xe("onDragEnd",n),Xe("snapToGrid",!1),Xe("rounded",!0),We("snapStart"),Me("model",Se("mode",{x:[Xe("minX",0),Xe("maxX",100),on("value",(function(t){return an(t.mode.minX)})),Ie("getInitialValue"),eu("manager",iw)],y:[Xe("minY",0),Xe("maxY",100),on("value",(function(t){return an(t.mode.minY)})),Ie("getInitialValue"),eu("manager",gw)],xy:[Xe("minX",0),Xe("maxX",100),Xe("minY",0),Xe("maxY",100),on("value",(function(t){return an({x:o(t.mode.minX),y:o(t.mode.minY)})})),Ie("getInitialValue"),eu("manager",Sw)]})),bl("sliderBehaviours",[Sm,vl]),on("mouseIsDown",(function(){return an(!1)}))],partFields:rx,factory:function(t,e,n,r){var i,a=function(e){return sf(e,t,"thumb")},u=function(e){return sf(e,t,"spectrum")},s=function(e){return uf(e,t,"left-edge")},c=function(e){return uf(e,t,"right-edge")},l=function(e){return uf(e,t,"top-edge")},f=function(e){return uf(e,t,"bottom-edge")},d=t.model,m=d.manager,h=function(e,n){m.setPositionFromValue(e,n,t,{getLeftEdge:s,getRightEdge:c,getTopEdge:l,getBottomEdge:f,getSpectrum:u})},p=function(e,n){d.value.set(n);var r=a(e);return h(e,r),t.onChange(e,r,n),y.some(!0)},g=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&uf(e,t,"thumb").each((function(n){var r=d.value.get();t.onChoose(e,n,r)}))},v=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,a(e))},b=function(e,n){n.stop(),t.onDragEnd(e,a(e)),g(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:xl(t.sliderBehaviours,[Sm.config({mode:"special",focusIn:function(e){return uf(e,t,"spectrum").map(Sm.focusIn).map(o(!0))}}),vl.config({store:{mode:"manual",getValue:function(t){return d.value.get()}}}),$u.config({channels:(i={},i[tl()]={onReceive:g},i)})]),events:Lr([jr(ox(),(function(t,e){p(t,e.event().value())})),Gr((function(e,n){var r=d.getInitialValue();d.value.set(r);var o=a(e);h(e,o);var i=u(e);t.onInit(e,o,i,d.value.get())})),jr(Vn(),v),jr(Un(),b),jr(qn(),v),jr(Gn(),b)]),apis:{resetToMin:function(e){m.setToMin(e,t)},resetToMax:function(e){m.setToMax(e,t)},changeValue:p,refresh:h},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),Dw=function(t,e){var n=Tw.parts().spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=Tw.parts().thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return Tw.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:o({y:o(0)})},components:[n,r],sliderBehaviours:Fu([Mm.config({})]),onChange:function(t,e,n){Rr(t,$y,{value:n})}})},Ow=[bl("formBehaviours",[vl])],Ew=function(t){return"<alloy.field."+t+">"},Nw=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:xl(t.formBehaviours,[vl.config({store:{mode:"manual",getValue:function(e){var n=lf(e,t);return wt(n,(function(t,e){return t().bind((function(t){var n,r,o=Of.getCurrent(t);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Ao(t.element())),n.fold((function(){return it.error(r)}),it.value)})).map(vl.getValue)}))},setValue:function(e,n){xt(n,(function(n,r){uf(e,t,r).each((function(t){Of.getCurrent(t).each((function(t){vl.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return uf(e,t,n).bind(Of.getCurrent)}}}},Aw={getField:Xo((function(t,e,n){return t.getField(e,n)})),sketch:function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),ef("form",Ew(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=H(r,(function(t){return $l({name:t,pname:Ew(t)})}));return vf("form",Ow,o,Nw,n)}},Rw=Io("valid-input"),Bw=Io("invalid-input"),Pw=Io("validating-input"),Iw=function(t,e,r,o){var i=function(n,r){return yy.config({invalidClass:e("invalid"),notify:{onValidate:function(t){Rr(t,Pw,{type:n})},onValid:function(t){Rr(t,Rw,{type:n,value:vl.getValue(t)})},onInvalid:function(t){Rr(t,Bw,{type:n,value:vl.getValue(t)})}},validator:{validate:function(e){var n=vl.getValue(e),o=r(n)?it.value(!0):it.error(t("aria.input.invalid"));return cy(o)},validateOnLoad:!1}})},a=function(r,o,a,u,s){var c=t("colorcustom.rgb.range"),l=[Ab.parts().label({dom:{tag:"label",innerHtml:a,attributes:{"aria-label":u}}}),Ab.parts().field({data:s,factory:Zb,inputAttributes:d({type:"text"},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:Fu([i(o,r),Pb.config({})]),onSetValue:function(t){yy.isInvalid(t)&&yy.run(t).get(n)}})],f="hex"!==o?[Ab.parts()["aria-descriptor"]({text:c})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:l.concat(f)}},u=function(t,e){var n=e.red,r=e.green,o=e.blue;vl.setValue(t,{red:n,green:r,blue:o})},s=Nh({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),c=function(t,e){s.getOpt(t).each((function(t){Ai(t.element(),"background-color","#"+e.value)}))};return Cf({factory:function(){var n={red:an(y.some(255)),green:an(y.some(255)),blue:an(y.some(255)),hex:an(y.some("ffffff"))},i=function(t){return n[t].get()},l=function(t,e){n[t].set(e)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",y.some(e)),l("green",y.some(n)),l("blue",y.some(r))},d=function(t,e){var n=e.event();"hex"!==n.type()?l(n.type(),y.none()):o(t)},m=function(t,e,n){var r=parseInt(n,10);l(e,y.some(r)),i("red").bind((function(t){return i("green").bind((function(e){return i("blue").map((function(n){return _v(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=vv(e);return Aw.getField(t,"hex").each((function(e){Mm.isFocused(e)||vl.setValue(t,{hex:n.value})})),n}(t,e);c(t,n)}))},h=function(t,e){var n=e.event();!function(t){return"hex"===t.type()}(n)?m(t,n.type(),n.value()):function(t,e){r(t);var n=fv(e);l("hex",y.some(e));var o=Tv(n);u(t,o),f(o),Rr(t,qy,{hex:n}),c(t,n)}(t,n.value())},p=function(e){return{label:t("colorcustom.rgb."+e+".label"),description:t("colorcustom.rgb."+e+".description")}},g=p("red"),v=p("green"),b=p("blue"),x=p("hex");return Bt(Aw.sketch((function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",Ab.sketch(a(kv,"red",g.label,g.description,255))),n.field("green",Ab.sketch(a(kv,"green",v.label,v.description,255))),n.field("blue",Ab.sketch(a(kv,"blue",b.label,b.description,255))),n.field("hex",Ab.sketch(a(hv,"hex",x.label,x.description,"ffffff"))),s.asSpec()],formBehaviours:Fu([yy.config({invalidClass:e("form-invalid")}),Am("rgb-form-events",[jr(Rw,h),jr(Bw,d),jr(Pw,d)])])}})),{apis:{updateHex:function(t,e){vl.setValue(t,{hex:e.value}),function(t,e){var n=Tv(e);u(t,n),f(n)}(t,e),c(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},Mw=function(t,e){var n=Tw.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=Tw.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),i=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var a=o.createLinearGradient(0,0,0,r);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=a,o.fillRect(0,0,n,r)}};return Cf({factory:function(t){var a=o({x:o(0),y:o(0)}),u=Fu([Of.config({find:y.some}),Mm.config({})]);return Tw.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:a},rounded:!1,components:[n,r],onChange:function(t,e,n){Rr(t,Yy,{value:n})},onInit:function(t,e,n,r){i(n.element().dom(),Ov(Ev))},sliderBehaviours:u})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,e,n){!function(t,e){var n=t.components()[0].element().dom();i(n,Ov(e))}(e,n)}},extraApis:{}})},Lw=function(t,e){return Cf({name:"ColourPicker",configFields:[Ie("dom"),Xe("onValidHex",n),Xe("onInvalidHex",n)],factory:function(n){var r,o=Iw(t,e,n.onValidHex,n.onInvalidHex),i=Mw(0,e),a={paletteRgba:an(Ev)},u=Nh(i.sketch({})),s=Nh(o.sketch({})),c=function(t,e){u.getOpt(t).each((function(t){var n=Tv(e);a.paletteRgba.set(n),i.setRgba(t,n)}))},l=function(t,e){s.getOpt(t).each((function(t){o.updateHex(t,e)}))},f=function(t,e,n){j(n,(function(n){n(t,e)}))};return{uid:n.uid,dom:n.dom,components:[u.asSpec(),Dw(0,e),s.asSpec()],behaviours:Fu([Am("colour-picker-events",[jr(Yy,(r=[l],function(t,e){var n=e.event().value(),o=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,a=t.blue/255,u=Math.min(o,Math.min(i,a)),s=Math.max(o,Math.max(i,a));return u===s?Wy(0,0,100*(r=u)):(n=60*((n=o===u?3:a===u?1:5)-(o===u?i-a:a===u?o-i:a-o)/(s-u)),e=(s-u)/s,r=s,Wy(Math.round(n),Math.round(100*e),Math.round(100*r)))}(a.paletteRgba.get()),i=Wy(o.hue,n.x(),100-n.y()),u=Sv(i),s=vv(u);f(t,s,r)})),jr($y,function(){var t=[c,l];return function(e,n){var r=function(t){var e=Wy((100-t)/100*360,100,100),n=Sv(e);return vv(n)}(n.event().value().y());f(e,r,t)}}())]),Of.config({find:function(t){return s.getOpt(t)}}),Sm.config({mode:"acyclic"})])}}})},Fw=function(){return Of.config({find:y.some})},Hw=function(t){return Of.config({find:t.getOpt})},jw=function(t){return Of.config({find:function(e){return fo(e.element(),t).bind((function(t){return e.getSystem().getByDom(t).toOption()}))}})},Vw={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},zw=function(t){return function(t){return Vw[t]}(t)},Uw=tinymce.util.Tools.resolve("tinymce.Resource"),Ww=ae([Xe("preprocess",i),Xe("postprocess",i)]),qw=function(t,e,n){return vl.config(Bt({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},$w=function(t,e,n){return qw(t,(function(t){return e(t.element())}),(function(t,e){return n(t.element(),e)}))},Yw=function(t,e){var n=Ce("RepresentingConfigs.memento processors",Ww,e);return vl.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=vl.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);vl.setValue(i,o)}}})},Gw=qw,Kw=function(t){return $w(t,wo,Co)},Xw=function(t){return vl.config({store:{mode:"memory",initialValue:t}})},Jw=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){j(t,(function(t){t(e,n)}))}},o=function(t,e){if(!ig.isDisabled(t)){var n=e.event().raw();a(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event().raw().target.files;a(t,n)},a=function(e,n){vl.setValue(e,function(t){var e=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i");return z(et(t),(function(t){return e.test(t.name)}))}(n)),Rr(e,Hb,{name:t.name})},u=Nh({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Fu([Am("input-file-events",[qr(nr()),qr(dr())])])}),s=t.label.map((function(t){return Fb(t,e)})),c=Ab.parts().field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Fu([Xw([]),Fw(),ig.config({}),Gm.config({toggleClass:"dragenter",toggleOnExecute:!1}),Am("dropzone-events",[jr("dragenter",r([n,Gm.toggle])),jr("dragleave",r([n,Gm.toggle])),jr("dragover",n),jr("drop",r([n,o])),jr(er(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Eh.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[u.asSpec()],action:function(t){u.get(t).element().dom().click()},buttonBehaviours:Fu([Pb.config({}),Ig(e.isReadOnly),Bg()])})]}]}}}});return Ib(s,c,["tox-form__group--stretched"],[])},Qw=Io("alloy-fake-before-tabstop"),Zw=Io("alloy-fake-after-tabstop"),tC=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:Fu([Mm.config({ignore:!0}),Pb.config({})])}},eC=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[tC([Qw]),t,tC([Zw])],behaviours:Fu([jw(1)])}},nC=function(t,e){Rr(t,Qn(),{raw:{which:9,shiftKey:e}})},rC=function(t,e){var n=e.element();gi(n,Qw)?nC(t,!0):gi(n,Zw)&&nC(t,!1)},oC=function(t){return db(t,["."+Qw,"."+Zw].join(","),o(!1))},iC=!(En().browser.isIE()||En().browser.isEdge()),aC=function(t,e){var n=iC&&t.sandboxed,r=d(d({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=an("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)ko(n.element(),"srcdoc",r);else{ko(n.element(),"src","javascript:''");var o=n.element().dom().contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map((function(t){return Fb(t,e)})),a=Ab.parts().field({factory:{sketch:function(t){return eC({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:Fu([Pb.config({}),Mm.config({}),Gw(y.none(),o.getValue,o.setValue)])})}}});return Ib(i,a,["tox-form__group--stretched"],[])};function uC(t,n){return lC(e.document.createElement("canvas"),t,n)}function sC(t){var e=uC(t.width,t.height);return cC(e).drawImage(t,0,0),e}function cC(t){return t.getContext("2d")}function lC(t,e,n){return t.width=e,t.height=n,t}function fC(t){return t.naturalWidth||t.width}function dC(t){return t.naturalHeight||t.height}var mC=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(a,this),r(u,this))},n=t.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){e.setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function a(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(a,this),r(u,this))}this._state=!0,this._value=t,s.call(this)}catch(t){u.call(this,t)}}function u(t){this._state=!1,this._value=t,s.call(this)}function s(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new c(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);var n=r.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(t){o(i,t)}),e)}r[i]=a,0==--n&&t(r)}catch(t){e(t)}}for(var i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++){o[r].then(t,n)}}))},t}();function hC(t){return new mC((function(n,r){(function(t){var n=t.split(","),r=/data:([^;]+)/.exec(n[0]);if(!r)return y.none();for(var o=r[1],i=n[1],a=e.atob(i),u=a.length,s=Math.ceil(u/1024),c=new Array(s),l=0;l<s;++l){for(var f=1024*l,d=Math.min(f+1024,u),m=new Array(d-f),h=f,p=0;h<d;++p,++h)m[p]=a[h].charCodeAt(0);c[l]=new Uint8Array(m)}return y.some(new e.Blob(c,{type:o}))})(t).fold((function(){r("uri is not base64: "+t)}),n)}))}function pC(t,n,r){return n=n||"image/png",e.HTMLCanvasElement.prototype.toBlob?new mC((function(e,o){t.toBlob((function(t){t?e(t):o()}),n,r)})):hC(t.toDataURL(n,r))}function gC(t){return function(t){return new mC((function(n,r){var o=e.URL.createObjectURL(t),i=new e.Image,a=function(){i.removeEventListener("load",u),i.removeEventListener("error",s)};function u(){a(),n(i)}function s(){a(),r("Unable to load data of type "+t.type+": "+o)}i.addEventListener("load",u),i.addEventListener("error",s),i.src=o,i.complete&&u()}))}(t).then((function(t){!function(t){e.URL.revokeObjectURL(t.src)}(t);var n=uC(fC(t),dC(t));return cC(n).drawImage(t,0,0),n}))}function vC(t,e,n){var r=e.type;function i(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))}return{getType:o(r),toBlob:function(){return mC.resolve(e)},toDataURL:o(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return pC(t,e,n)}))},toAdjustedDataURL:i,toAdjustedBase64:function(t,e){return i(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(sC)}}}function bC(t){return function(t){return new mC((function(n){var r=new e.FileReader;r.onloadend=function(){n(r.result)},r.readAsDataURL(t)}))}(t).then((function(e){return vC(gC(t),t,e)}))}function yC(t,e){return pC(t,e).then((function(e){return vC(mC.resolve(t),e,t.toDataURL())}))}function xC(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r}var wC=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function CC(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var a=0;a<5;a++)r[a]=e[a+5*i];for(a=0;a<5;a++){n=0;for(var u=0;u<5;u++)n+=t[a+5*u]*r[u];o[a+5*i]=n}}return o}function _C(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=cC(t);var o=function(t,e){for(var n,r,o,i,a=t.data,u=e[0],s=e[1],c=e[2],l=e[3],f=e[4],d=e[5],m=e[6],h=e[7],p=e[8],g=e[9],v=e[10],b=e[11],y=e[12],x=e[13],w=e[14],C=e[15],_=e[16],k=e[17],S=e[18],T=e[19],D=0;D<a.length;D+=4)n=a[D],r=a[D+1],o=a[D+2],i=a[D+3],a[D]=n*u+r*s+o*c+i*l+f,a[D+1]=n*d+r*m+o*h+i*p+g,a[D+2]=n*v+r*b+o*y+i*x+w,a[D+3]=n*C+r*_+o*k+i*S+T;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),yC(t,e)}(n,t.getType(),e)}))}function kC(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=cC(t);var o=r.getImageData(0,0,t.width,t.height),i=r.getImageData(0,0,t.width,t.height);return i=function(t,e,n){function r(t,e,n){return t>n?t=n:t<e&&(t=e),t}for(var o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),a=t.data,u=e.data,s=t.width,c=t.height,l=0;l<c;l++)for(var f=0;f<s;f++){for(var d=0,m=0,h=0,p=0;p<o;p++)for(var g=0;g<o;g++){var v=r(f+g-i,0,s-1),b=4*(r(l+p-i,0,c-1)*s+v),y=n[p*o+g];d+=a[b]*y,m+=a[b+1]*y,h+=a[b+2]*y}var x=4*(l*s+f);u[x]=r(d,0,255),u[x+1]=r(m,0,255),u[x+2]=r(h,0,255)}return e}(o,i,n),r.putImageData(i,0,0),yC(t,e)}(n,t.getType(),e)}))}function SC(t){return function(e,n){return _C(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}}var TC,DC,OC=function(t){return function(e){return _C(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),EC=SC((function(t,e){return CC(t,[1,0,0,0,e=xC(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])})),NC=SC((function(t,e){var n;return e=xC(e,-1,1),CC(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0===(n=e%1)?wC[e]:wC[Math.floor(e)]*(1-n)+wC[Math.floor(e)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),AC=function(t,e,n,r){return _C(t,function(t,e,n,r){return CC(t,[e=xC(e,0,2),0,0,0,0,0,n=xC(n,0,2),0,0,0,0,0,r=xC(r,0,2),0,0,0,0,0,1,0,0,0,0,0,1])}([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],e,n,r))},RC=(TC=[0,-1,0,-1,5,-1,0,-1,0],function(t){return kC(t,TC)}),BC=(DC=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){for(var r=cC(t),o=new Array(256),i=0;i<o.length;i++)o[i]=DC(i,n);var a=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(a,0,0),yC(t,e)}(n,t.getType(),e)}))});function PC(t,e,n){var r=fC(t),o=dC(t),i=e/r,a=n/o,u=!1;(i<.5||i>2)&&(i=i<.5?.5:2,u=!0),(a<.5||a>2)&&(a=a<.5?.5:2,u=!0);var s=function(t,e,n){return new mC((function(r){var o=fC(t),i=dC(t),a=Math.floor(o*e),u=Math.floor(i*n),s=uC(a,u);cC(s).drawImage(t,0,0,o,i,0,0,a,u),r(s)}))}(t,i,a);return u?s.then((function(t){return PC(t,e,n)})):s}function IC(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=uC(t.width,t.height),o=cC(r),i=0,a=0;90!==(n=n<0?360+n:n)&&270!==n||lC(r,r.height,r.width);90!==n&&180!==n||(i=r.width);270!==n&&180!==n||(a=r.height);return o.translate(i,a),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),yC(r,e)}(n,t.getType(),e)}))}function MC(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=uC(t.width,t.height),o=cC(r);"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0));return yC(r,e)}(n,t.getType(),e)}))}function LC(t,e,n,r,o){return t.toCanvas().then((function(i){return function(t,e,n,r,o,i){var a=uC(o,i);return cC(a).drawImage(t,-n,-r),yC(a,e)}(i,t.getType(),e,n,r,o)}))}var FC=function(t){return OC(t)},HC=function(t){return RC(t)},jC=function(t,e){return BC(t,e)},VC=function(t,e){return EC(t,e)},zC=function(t,e){return NC(t,e)},UC=function(t,e){return MC(t,e)},WC=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return PC(r,e,n).then((function(e){return yC(e,t.getType())}))}))}(t,e,n)},qC=function(t,e){return IC(t,e)},$C=function(t,e){return d({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},e)},YC=function(t,e){return $C(Rh(t,e),{})},GC=function(t,e){return $C(Rh(t,e),{behaviours:Fu([Nm.config({})])})},KC=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:Fu([Nm.config({})])}},XC=Io("toolbar.button.execute"),JC={"alloy.execute":["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},QC=Io("update-menu-text"),ZC=Io("update-menu-icon"),t_=function(t,e,r){var o=an(n),i=t.text.map((function(t){return Nh(KC(t,e,r.providers))})),a=t.icon.map((function(t){return Nh(GC(t,r.providers.icons))})),u=function(t,e){var n=vl.getValue(t);return Mm.focus(n),Rr(n,"keydown",{raw:e.event().raw()}),Ly.close(n),y.some(!0)},s=t.role.fold((function(){return{}}),(function(t){return{role:t}})),c=t.tooltip.fold((function(){return{}}),(function(t){var e=r.providers.translate(t);return{title:e,"aria-label":e}}));return Nh(Ly.sketch(d(d({},s),{dom:{tag:"button",classes:[e,e+"--select"].concat(H(t.classes,(function(t){return e+"--"+t}))),attributes:d({},c)},components:Ug([a.map((function(t){return t.asSpec()})),i.map((function(t){return t.asSpec()})),y.some({dom:{tag:"div",classes:[e+"__select-chevron"],innerHtml:Rh("chevron-down",r.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:Fu(h(t.dropdownBehaviours,[Ig((function(){return t.disabled||r.providers.isReadOnly()})),Bg(),Hy.config({}),Nm.config({}),Am("dropdown-events",[Hg(t,o),jg(t,o)]),Am("menubutton-update-display-text",[jr(QC,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){Nm.set(t,[Xi(r.providers.translate(e.event().text()))])}))})),jr(ZC,(function(t,e){a.bind((function(e){return e.getOpt(t)})).each((function(t){Nm.set(t,[GC(e.event().icon(),r.providers.icons)])}))}))])])),eventOrder:Bt(JC,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:Fu([Sm.config({mode:"special",onLeft:u,onRight:u})]),lazySink:r.getSink,toggleClass:e+"--active",parts:{menu:yp(0,t.columns,t.presets)},fetch:function(){return sy(t.fetch)}}))).asSpec()},e_=function(t){return"separator"===t.type},n_={type:"separator"},r_=function(t,e){var n=W(t,(function(t,n){return function(t){return C(t)}(n)?""===n?t:"|"===n?t.length>0&&!e_(t[t.length-1])?t.concat([n_]):t:Ot(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&e_(n[n.length-1])&&n.pop(),n},o_=function(t,e){return function(t){return Ot(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=i_(n,e);return{item:t,menus:Bt(r.menus,qt(t.value,r.items)),expansions:Bt(r.expansions,qt(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}},i_=function(t,e){var n=r_(C(t)?t.split(" "):t,e);return U(n,(function(t,n){var r=function(t){if(e_(t))return t;var e=Dt(t,"value").getOrThunk((function(){return Io("generated-menu-item")}));return Bt({value:e},t)}(n),o=o_(r,e);return{menus:Bt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:Bt(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},a_=function(t,e,n,r){var o=Io("primary-menu"),i=i_(t,n.shared.providers.menuItems());if(0===i.items.length)return y.none();var a=ib(o,i.items,e,n,r),u=wt(i.menus,(function(t,r){return ib(r,t,e,n,!1)})),s=Bt(u,qt(o,a));return y.from(ph.tieredData(o,s,i.expansions))},u_=function(t){return{isDisabled:function(){return ig.isDisabled(t)},setDisabled:function(e){return ig.set(t,e)},setActive:function(e){var n=t.element();e?(mi(n,"tox-tbtn--enabled"),ko(n,"aria-pressed",!0)):(pi(n,"tox-tbtn--enabled"),Oo(n,"aria-pressed"))},isActive:function(){return gi(t.element(),"tox-tbtn--enabled")}}},s_=function(t,e,n,r){return t_({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e){t.fetch((function(t){e(a_(t,up.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:u_,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Pb.config({})]},e,n.shared)},c_=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){Gu(e.element()),Rr(e,zb,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(H(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return d(d({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},l_=function(t,e,n,r,o,i){void 0===n&&(n=[]);var a=e.fold((function(){return{}}),(function(t){return{action:t}})),u=d({buttonBehaviours:Fu([Ig((function(){return t.disabled||i.isReadOnly()})),Bg(),Pb.config({}),Am("button press",[Hr("click"),Hr("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},a),s=Bt(u,{dom:r});return Bt(s,{components:o})},f_=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({})},i=t.icon.map((function(t){return YC(t,n.icons)})),a=Ug([i]);return l_(t,e,r,o,a,n)},d_=function(t,e,n,r){void 0===r&&(r=[]);var o=f_(t,y.some(e),n,r);return Eh.sketch(o)},m_=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),a=t.icon?t.icon.map((function(t){return YC(t,n.icons)})):y.none(),u=a.isSome()?Ug([a]):[],s=a.isSome()?{}:{innerHtml:i},c=h(t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],a.isSome()?["tox-button--icon"]:[],t.borderless?["tox-button--naked"]:[],o),l=d(d({tag:"button",classes:c},s),{attributes:{title:i}});return l_(t,e,r,l,u,n)},h_=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=m_(t,y.some(e),n,r,o);return Eh.sketch(i)},p_=function(t,n){return function(r){"custom"===n?Rr(r,zb,{name:t,value:{}}):"submit"===n?Ar(r,Ub):"cancel"===n?Ar(r,Vb):e.console.error("Unknown button type: ",n)}},g_=function(t,r,o){if(function(t,e){return"menu"===e}(0,r)){var i=t,a=d(d({},t),{onSetup:function(e){return e.setDisabled(t.disabled),n},fetch:c_(i.items,(function(){return u}),o)}),u=Nh(s_(a,"tox-tbtn",o,y.none()));return u.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,r)){var s=p_(t.name,r),c=d(d({},t),{borderless:!1});return h_(c,s,o.shared.providers,[])}e.console.error("Unknown footer button type: ",r)},v_=function(t,e){var n,r,o=p_(t.name,"custom");return n=y.none(),r=Ab.parts().field(d({factory:Eh},m_(t,y.some(o),e,[Xw(""),Fw()]))),Ib(n,r,[],[])},b_=o([Xe("field1Name","field1"),Xe("field2Name","field2"),Za("onLockedChange"),Ka(["lockClass"]),Xe("locked",!1),wl("coupledFieldBehaviours",[Of,vl])]),y_=function(t,e){return $l({factory:Ab,name:t,overrides:function(t){return{fieldBehaviours:Fu([Am("coupled-input-behaviour",[jr(tr(),(function(n){(function(t,e,n){return uf(t,e,n).bind(Of.getCurrent)})(n,t,e).each((function(e){uf(n,t,"lock").each((function(r){Gm.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},x_=o([y_("field1","field2"),y_("field2","field1"),$l({factory:Eh,schema:[Ie("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:Fu([Gm.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),w_=_f({name:"FormCoupledInputs",configFields:b_(),partFields:x_(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Cl(t.coupledFieldBehaviours,[Of.config({find:y.some}),vl.config({store:{mode:"manual",getValue:function(e){var n,r=df(e,t,["field1","field2"]);return(n={})[t.field1Name]=vl.getValue(r.field1()),n[t.field2Name]=vl.getValue(r.field2()),n},setValue:function(e,n){var r=df(e,t,["field1","field2"]);Et(n,t.field1Name)&&vl.setValue(r.field1(),n[t.field1Name]),Et(n,t.field2Name)&&vl.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return uf(e,t,"field1")},getField2:function(e){return uf(e,t,"field2")},getLock:function(e){return uf(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),C_=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return it.value({value:n,unit:r})}return it.error(t)},__=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Object.prototype.hasOwnProperty.call(n,t)};return t.unit===e?y.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?y.some(t.value):y.some(t.value/n[t.unit]*n[e]):y.none()},k_=function(t){return y.none()},S_=function(t,e){var n,r,o,i=C_(t).toOption(),a=C_(e).toOption();return(n=i,r=a,o=function(t,e){return __(t,e.unit).map((function(t){return e.value/t})).map((function(t){return function(t,e){return function(n){return __(n,e).map((function(n){return{value:n*t,unit:e}}))}}(t,e.unit)})).getOr(k_)},n.isSome()&&r.isSome()?y.some(o(n.getOrDie(),r.getOrDie())):y.none()).getOr(k_)},T_=function(t,e){var n=k_,r=Io("ratio-event"),o=w_.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:Rh("lock",e.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:Rh("unlock",e.icons)}}],buttonBehaviours:Fu([ig.config({disabled:function(){return t.disabled||e.isReadOnly()}}),Bg(),Pb.config({})])}),i=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},a=function(n){return Ab.parts().field({factory:Zb,inputClasses:["tox-textfield"],inputBehaviours:Fu([ig.config({disabled:function(){return t.disabled||e.isReadOnly()}}),Bg(),Pb.config({}),Am("size-input-events",[jr(Xn(),(function(t,e){Rr(t,r,{isField1:n})})),jr(er(),(function(e,n){Rr(e,Hb,{name:t.name})}))])]),selectOnFocus:!1})},u=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=w_.parts().field1(i([Ab.parts().label(u("Width")),a(!0)])),c=w_.parts().field2(i([Ab.parts().label(u("Height")),a(!1)]));return w_.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,c,i([u(" "),o])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){C_(vl.getValue(t)).each((function(t){n(t).each((function(t){vl.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))}))}))},coupledFieldBehaviours:Fu([ig.config({disabled:function(){return t.disabled||e.isReadOnly()},onDisabled:function(t){w_.getField1(t).bind(Ab.getField).each(ig.disable),w_.getField2(t).bind(Ab.getField).each(ig.disable),w_.getLock(t).each(ig.disable)},onEnabled:function(t){w_.getField1(t).bind(Ab.getField).each(ig.enable),w_.getField2(t).bind(Ab.getField).each(ig.enable),w_.getLock(t).each(ig.enable)}}),Bg(),Am("size-input-events2",[jr(r,(function(t,e){var r=e.event().isField1(),o=r?w_.getField1(t):w_.getField2(t),i=r?w_.getField2(t):w_.getField1(t),a=o.map(vl.getValue).getOr(""),u=i.map(vl.getValue).getOr("");n=S_(a,u)}))])])})},D_={undo:o(Io("undo")),redo:o(Io("redo")),zoom:o(Io("zoom")),back:o(Io("back")),apply:o(Io("apply")),swap:o(Io("swap")),transform:o(Io("transform")),tempTransform:o(Io("temp-transform")),transformApply:o(Io("transform-apply"))},O_=o("save-state"),E_=o("disable"),N_=o("enable"),A_={formActionEvent:zb,saveState:O_,disable:E_,enable:N_},R_=function(t,e){var r=function(t,n,r,o){return Nh(h_({name:t,text:t,disabled:r,primary:o,icon:y.none(),borderless:!1},n,e))},i=function(t,n,r,o){return Nh(d_({name:t,icon:y.some(t),tooltip:y.some(n),disabled:o,primary:!1,borderless:!1},r,e))},a=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(ig)&&ig.disable(n)}))},u=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(ig)&&ig.enable(n)}))},s={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},c=n,l=function(t,e,n){Rr(t,e,n)},f=function(t){return Ar(t,A_.disable())},d=function(t){return Ar(t,A_.enable())},m=function(t,e){f(t),l(t,D_.transform(),{transform:e}),d(t)},h=function(t){return function(){et.getOpt(t).each((function(t){Nm.set(t,[Z])}))}},p=function(t,e){f(t),l(t,D_.transformApply(),{transform:e,swap:h(t)}),d(t)},g=function(){return r("Back",(function(t){return l(t,D_.back(),{swap:h(t)})}),!1,!1)},v=function(){return Nh({dom:{tag:"div",classes:["tox-spacer"]},behaviours:Fu([ig.config({})])})},b=function(){return r("Apply",(function(t){return l(t,D_.apply(),{swap:h(t)})}),!0,!0)},x=function(){return function(e){var n=t.getRect();return function(t,e,n,r,o){return LC(t,e,n,r,o)}(e,n.x,n.y,n.w,n.h)}},w=[g(),v(),r("Apply",(function(e){var n=x();p(e,n),t.hideCrop()}),!1,!0)],C=Db.sketch({dom:s,components:w.map((function(t){return t.asSpec()})),containerBehaviours:Fu([Am("image-tools-crop-buttons-events",[jr(A_.disable(),(function(t,e){a(w,t)})),jr(A_.enable(),(function(t,e){u(w,t)}))])])}),_=Nh(T_({name:"size",label:y.none(),constrain:!0,disabled:!1},e)),k=[g(),v(),_,v(),r("Apply",(function(t){_.getOpt(t).each((function(e){var n=vl.getValue(e),r=function(t,e){return function(n){return WC(n,t,e)}}(parseInt(n.width,10),parseInt(n.height,10));p(t,r)}))}),!1,!0)],S=Db.sketch({dom:s,components:k.map((function(t){return t.asSpec()})),containerBehaviours:Fu([Am("image-tools-resize-buttons-events",[jr(A_.disable(),(function(t,e){a(k,t)})),jr(A_.enable(),(function(t,e){u(k,t)}))])])}),T=function(t,e){return function(n){return t(n,e)}},D=T(UC,"h"),O=T(UC,"v"),E=T(qC,-90),N=T(qC,90),A=function(t,e){!function(t,e){f(t),l(t,D_.tempTransform(),{transform:e}),d(t)}(t,e)},R=[g(),v(),i("flip-horizontally","Flip horizontally",(function(t){A(t,D)}),!1),i("flip-vertically","Flip vertically",(function(t){A(t,O)}),!1),i("rotate-left","Rotate counterclockwise",(function(t){A(t,E)}),!1),i("rotate-right","Rotate clockwise",(function(t){A(t,N)}),!1),v(),b()],B=Db.sketch({dom:s,components:R.map((function(t){return t.asSpec()})),containerBehaviours:Fu([Am("image-tools-fliprotate-buttons-events",[jr(A_.disable(),(function(t,e){a(R,t)})),jr(A_.enable(),(function(t,e){u(R,t)}))])])}),P=function(t,n,r,i,a){var u=Tw.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),s=Tw.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=Tw.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Nh(Tw.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:a,getInitialValue:o({x:o(i)})},components:[u,s,c],sliderBehaviours:Fu([Mm.config({})]),onChoose:n}))},I=function(t,e,n,r,o){return P(t,(function(t,n,r){var o=T(e,r.x()/100);m(t,o)}),n,r,o)},M=function(t,e,n,r,o){var i=function(t,e,n,r,o){return[g(),I(t,e,n,r,o),b()]}(t,e,n,r,o);return Db.sketch({dom:s,components:i.map((function(t){return t.asSpec()})),containerBehaviours:Fu([Am("image-tools-filter-panel-buttons-events",[jr(A_.disable(),(function(t,e){a(i,t)})),jr(A_.enable(),(function(t,e){u(i,t)}))])])})},L=[g(),v(),b()],F=Db.sketch({dom:s,components:L.map((function(t){return t.asSpec()}))}),H=M("Brightness",VC,-100,0,100),j=M("Contrast",zC,-100,0,100),V=M("Gamma",jC,-100,0,100),z=function(t,e,n){return function(r){return function(t,e,n,r){return AC(t,e,n,r)}(r,t,e,n)}},U=function(t){return P(t,(function(t,e,n){var r=W.getOpt(t),o=$.getOpt(t),i=q.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=vl.getValue(e).x()/100,i=vl.getValue(r).x()/100,a=vl.getValue(n).x()/100,u=z(o,i,a);m(t,u)}))}))}))}),0,100,200)},W=U("R"),q=U("G"),$=U("B"),Y=[g(),W,q,$,b()],G=Db.sketch({dom:s,components:Y.map((function(t){return t.asSpec()}))}),K=function(t,e,n){return function(r){l(r,D_.swap(),{transform:e,swap:function(){et.getOpt(r).each((function(e){Nm.set(e,[t]),n(e)}))}})}},X=y.some(HC),J=y.some(FC),Q=[i("crop","Crop",K(C,y.none(),(function(e){t.showCrop()})),!1),i("resize","Resize",K(S,y.none(),(function(e){_.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;vl.setValue(e,{width:r,height:o})}))})),!1),i("orientation","Orientation",K(B,y.none(),c),!1),i("brightness","Brightness",K(H,y.none(),c),!1),i("sharpen","Sharpen",K(F,X,c),!1),i("contrast","Contrast",K(j,y.none(),c),!1),i("color-levels","Color levels",K(G,y.none(),c),!1),i("gamma","Gamma",K(V,y.none(),c),!1),i("invert","Invert",K(F,J,c),!1)],Z=Db.sketch({dom:s,components:Q.map((function(t){return t.asSpec()}))}),tt=Db.sketch({dom:{tag:"div"},components:[Z],containerBehaviours:Fu([Nm.config({})])}),et=Nh(tt);return{memContainer:et,getApplyButton:function(t){return et.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))}}},B_=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),P_=tinymce.util.Tools.resolve("tinymce.geom.Rect"),I_=tinymce.util.Tools.resolve("tinymce.util.Observable"),M_=tinymce.util.Tools.resolve("tinymce.util.Tools"),L_=tinymce.util.Tools.resolve("tinymce.util.VK");function F_(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]}function H_(t,n){var r,o,i,a,u=n.document||e.document;n=n||{};var s=u.getElementById(n.handle||t),c=function(t){if(F_(t),t.button!==o)return l(t);t.deltaX=t.screenX-i,t.deltaY=t.screenY-a,t.preventDefault(),n.drag(t)},l=function(t){F_(t),B_(u).off("mousemove touchmove",c).off("mouseup touchend",l),r.remove(),n.stop&&n.stop(t)};this.destroy=function(){B_(s).off()},B_(s).on("mousedown touchstart",(function(t){var f,d=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),a=e(n.offsetWidth,r.offsetWidth),u=e(n.scrollHeight,r.scrollHeight),s=e(n.clientHeight,r.clientHeight);return{width:o<a?i:o,height:u<e(n.offsetHeight,r.offsetHeight)?s:u}}(u);F_(t),t.preventDefault(),o=t.button;var m=s;i=t.screenX,a=t.screenY,f=e.window.getComputedStyle?e.window.getComputedStyle(m,null).getPropertyValue("cursor"):m.runtimeStyle.cursor,r=B_("<div></div>").css({position:"absolute",top:0,left:0,width:d.width,height:d.height,zIndex:2147483647,opacity:1e-4,cursor:f}).appendTo(u.body),B_(u).on("mousemove touchmove",c).on("mouseup touchend",l),n.start(t)}))}var j_=0,V_=function(t,e,n,r,o){var i,a="tox-crid-"+j_++,u=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],s=["top","right","bottom","left"],c=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}};function l(e,r,o,i){var a,u,s,l,f;a=r.x,u=r.y,s=r.w,l=r.h,a+=o*e.deltaX,u+=i*e.deltaY,(s+=o*e.deltaW)<20&&(s=20),(l+=i*e.deltaH)<20&&(l=20),f=t=P_.clamp({x:a,y:u,w:s,h:l},n,"move"===e.name),f=c(n,f),h.fire("updateRect",{rect:f}),m(f)}function f(t){function n(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),B_("#"+a+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})}M_.each(u,(function(e){B_("#"+a+"-"+e.name,r).css({left:t.w*e.xMul+t.x,top:t.h*e.yMul+t.y})})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)}function d(e){f(t=e)}function m(t){var e,r;d((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))}B_('<div id="'+a+'" class="tox-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),M_.each(s,(function(t){B_("#"+a,r).append('<div id="'+a+"-"+t+'"class="tox-croprect-block" style="display: none" data-mce-bogus="all">')})),M_.each(u,(function(t){B_("#"+a,r).append('<div id="'+a+"-"+t.name+'" class="tox-croprect-handle tox-croprect-handle-'+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')})),i=M_.map(u,(function(e){var n;return new H_(a,{document:r.ownerDocument,handle:a+"-"+e.name,start:function(){n=t},drag:function(t){l(e,n,t.deltaX,t.deltaY)}})})),f(t),B_(r).on("focusin focusout",(function(t){B_(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")})),B_(r).on("keydown",(function(e){var n;function r(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),l(n,r,o,i)}switch(M_.each(u,(function(t){if(e.target.id===a+"-"+t.name)return n=t,!1})),e.keyCode){case L_.LEFT:r(e,0,t,-10,0);break;case L_.RIGHT:r(e,0,t,10,0);break;case L_.UP:r(e,0,t,0,-10);break;case L_.DOWN:r(e,0,t,0,10);break;case L_.ENTER:case L_.SPACEBAR:e.preventDefault(),o()}}));var h=M_.extend({toggleVisibility:function(t){var e=M_.map(u,(function(t){return"#"+a+"-"+t.name})).concat(M_.map(s,(function(t){return"#"+a+"-"+t}))).join(",");t?B_(e,r).show():B_(e,r).hide()},setClampRect:function(e){n=e,f(t)},setRect:d,getInnerRect:function(){return c(n,t)},setInnerRect:m,setViewPortRect:function(n){e=n,f(t)},destroy:function(){M_.each(i,(function(t){t.destroy()})),i=[]}},I_);return h},z_=function(t){var e=Nh({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=an(1),r=an(y.none()),o=an({x:0,y:0,w:1,h:1}),i=an({x:0,y:0,w:1,h:1}),a=function(t,i){c.getOpt(t).each((function(t){var a=n.get(),u=fa(t.element()),s=ra(t.element()),c=i.dom().naturalWidth*a,l=i.dom().naturalHeight*a,f=Math.max(0,u/2-c/2),d=Math.max(0,s/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:c.toString()+"px",height:l.toString()+"px",position:"absolute"};Ri(i,m),e.getOpt(t).each((function(t){Ri(t.element(),m)})),r.get().each((function(t){var e=o.get();t.setRect({x:e.x*a+f,y:e.y*a+d,w:e.w*a,h:e.h*a}),t.setClampRect({x:f,y:d,w:c,h:l}),t.setViewPortRect({x:0,y:0,w:u,h:s})}))}))},u=function(t,e){var r,u=sn.fromTag("img");return ko(u,"src",e),(r=u.dom(),new Kh((function(t){var e=function(){r.removeEventListener("load",e),t(r)};r.complete?t(r):r.addEventListener("load",e)}))).then((function(){return c.getOpt(t).map((function(t){var e=Ji({element:u});Nm.replaceAt(t,1,y.some(e));var r=i.get(),s={x:0,y:0,w:u.dom().naturalWidth,h:u.dom().naturalHeight};i.set(s);var l=P_.inflate(s,-20,-20);return o.set(l),r.w===s.w&&r.h===s.h||function(t,e){c.getOpt(t).each((function(t){var r=fa(t.element()),o=ra(t.element()),i=e.dom().naturalWidth,a=e.dom().naturalHeight,u=Math.min(r/i,o/a);u>=1?n.set(1):n.set(u)}))}(t,u),a(t,u),u}))}))},s=Db.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:Fu([Am("image-panel-crop-events",[Gr((function(t){c.getOpt(t).each((function(t){var e=t.element().dom(),i=V_({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,(function(){}));i.toggleVisibility(!1),i.on("updateRect",(function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)})),r.set(y.some(i))}))}))])])}],containerBehaviours:Fu([Nm.config({}),Am("image-panel-events",[Gr((function(e){u(e,t)}))])])}),c=Nh(s);return{memContainer:c,updateSrc:u,zoom:function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),c.getOpt(t).each((function(t){var e=t.components()[1].element();a(t,e)}))},showCrop:function(){r.get().each((function(t){t.toggleVisibility(!0)}))},hideCrop:function(){r.get().each((function(t){t.toggleVisibility(!1)}))},getRect:function(){return o.get()},getMeasurements:function(){var t=i.get();return{width:t.w,height:t.h}}}},U_=function(t,e,n,r,o){return d_({name:t,icon:y.some(e),disabled:n,tooltip:y.some(t),primary:!1,borderless:!1},r,o)},W_=function(t,e){e?ig.enable(t):ig.disable(t)};var q_,$_,Y_=function(t){var n=an(t),r=an(y.none()),o=function(){var t=[],e=-1;function n(){return e>0}function r(){return-1!==e&&e<t.length-1}return{data:t,add:function(n){var r=t.splice(++e);return t.push(n),{state:n,removed:r}},undo:function(){if(n())return t[--e]},redo:function(){if(r())return t[++e]},canUndo:n,canRedo:r}}();o.add(t);var i=function(t){n.set(t)},a=function(t){return{blob:t,url:e.URL.createObjectURL(t)}},u=function(t){e.URL.revokeObjectURL(t.url)},s=function(){r.get().each(u),r.set(y.none())},c=function(t){var e=a(t);i(e);var n,r=o.add(e).removed;return n=r,M_.each(n,u),e.url};return{getBlobState:function(){return n.get()},setBlobState:i,addBlobState:c,getTempState:function(){return r.get().fold((function(){return n.get()}),(function(t){return t}))},updateTempState:function(t){var e=a(t);return s(),r.set(y.some(e)),e.url},addTempState:function(t){var e=a(t);return r.set(y.some(e)),e.url},applyTempState:function(t){return r.get().fold((function(){}),(function(e){c(e.blob),t()}))},destroyTempState:s,undo:function(){var t=o.undo();return i(t),t.url},redo:function(){var t=o.redo();return i(t),t.url},getHistoryStates:function(){return{undoEnabled:o.canUndo(),redoEnabled:o.canRedo()}}}},G_=function(t,r){var o=Y_(t.currentState),i=function(t){var e=o.getHistoryStates();h.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),Rr(t,A_.formActionEvent,{name:A_.saveState(),value:e.undoEnabled})},a=function(t){return t.toBlob()},u=function(t){Rr(t,A_.formActionEvent,{name:A_.disable(),value:{}})},s=function(t){p.getApplyButton(t).each((function(t){ig.enable(t)})),Rr(t,A_.formActionEvent,{name:A_.enable(),value:{}})},c=function(t,e){return u(t),m.updateSrc(t,e)},l=function(t,n,r,o,l){return u(t),function(t){return bC(t)}(n).then(r).then(a).then(o).then((function(e){return c(t,e).then((function(e){return i(t),l(),s(t),e}))})).catch((function(n){return e.console.log(n),s(t),n}))},f=function(t,e,n){var r=o.getBlobState().blob;l(t,r,e,(function(t){return o.updateTempState(t)}),n)},d=function(t){var e=o.getBlobState().url;return o.destroyTempState(),i(t),e},m=z_(t.currentState.url),h=function(t){var e=Nh(U_("Undo","undo",!0,(function(t){Rr(t,D_.undo(),{direction:1})}),t)),n=Nh(U_("Redo","redo",!0,(function(t){Rr(t,D_.redo(),{direction:1})}),t));return{container:Db.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),U_("Zoom in","zoom-in",!1,(function(t){Rr(t,D_.zoom(),{direction:1})}),t),U_("Zoom out","zoom-out",!1,(function(t){Rr(t,D_.zoom(),{direction:-1})}),t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each((function(t){W_(t,r)})),n.getOpt(t).each((function(t){W_(t,o)}))}}}(r),p=R_(m,r);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[p.memContainer.asSpec(),m.memContainer.asSpec(),h.container],behaviours:Fu([vl.config({store:{mode:"manual",getValue:function(){return o.getBlobState()}}}),Am("image-tools-events",[jr(D_.undo(),(function(t,e){var n=o.undo();c(t,n).then((function(e){s(t),i(t)}))})),jr(D_.redo(),(function(t,e){var n=o.redo();c(t,n).then((function(e){s(t),i(t)}))})),jr(D_.zoom(),(function(t,e){var n=e.event().direction();m.zoom(t,n)})),jr(D_.back(),(function(t,e){!function(t){var e=d(t);c(t,e).then((function(e){s(t)}))}(t),e.event().swap()(),m.hideCrop()})),jr(D_.apply(),(function(t,e){o.applyTempState((function(){d(t),e.event().swap()()}))})),jr(D_.transform(),(function(t,e){return f(t,e.event().transform(),n)})),jr(D_.tempTransform(),(function(t,e){return function(t,e){var r=o.getTempState().blob;l(t,r,e,(function(t){return o.addTempState(t)}),n)}(t,e.event().transform())})),jr(D_.transformApply(),(function(t,e){return function(t,e,n){var r=o.getBlobState().blob;l(t,r,e,(function(e){var n=o.addBlobState(e);return d(t),n}),n)}(t,e.event().transform(),e.event().swap())})),jr(D_.swap(),(function(t,e){!function(t){h.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event().transform(),r=e.event().swap();n.fold((function(){r()}),(function(e){f(t,e,r)}))}))]),Fw()])}},K_=Cf({name:"HtmlSelect",configFields:[Ie("options"),bl("selectBehaviours",[Mm,vl]),Xe("selectClasses",[]),Xe("selectAttributes",{}),We("data")],factory:function(t,e){var n=H(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return qt("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:xl(t.selectBehaviours,[Mm.config({}),vl.config({store:d({mode:"manual",getValue:function(t){return Vi(t.element())},setValue:function(e,n){q(t.options,(function(t){return t.value===n})).isSome()&&zi(e.element(),n)}},r)})])}}}),X_=function(t,e){var n=t.label.map((function(t){return Fb(t,e)})),r=[ig.config({disabled:function(){return t.disabled||e.isReadOnly()}}),Bg(),Sm.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Ar(t,Ub),y.some(!0)}}),Am("textfield-change",[jr(tr(),(function(e,n){Rr(e,Hb,{name:t.name})})),jr(sr(),(function(e,n){Rr(e,Hb,{name:t.name})}))]),Pb.config({})],i=t.validation.map((function(t){return yy.config({getRoot:function(t){return so(t.element())},invalidClass:"tox-invalid",validator:{validate:function(e){var n=vl.getValue(e),r=t.validator(n);return cy(!0===r?it.value(n):it.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),a=t.placeholder.fold(o({}),(function(t){return{placeholder:e.translate(t)}})),u=t.inputMode.fold(o({}),(function(t){return{inputmode:t}})),s=d(d({},a),u),c=Ab.parts().field({tag:!0===t.multiline?"textarea":"input",inputAttributes:s,inputClasses:[t.classname],inputBehaviours:Fu(Y([r,i])),selectOnFocus:!1,factory:Zb}),l=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),f=[ig.config({disabled:function(){return t.disabled||e.isReadOnly()},onDisabled:function(t){Ab.getField(t).each(ig.disable)},onEnabled:function(t){Ab.getField(t).each(ig.enable)}}),Bg()];return Ib(n,c,l,f)},J_=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return Lr([jr(t.event,n),Kr((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[jr(t,(function(){return e.cancel()}))]})).getOr([])))}}),Q_=function(t){var e=an(null);return Qo({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},Z_=Object.freeze({__proto__:null,throttle:Q_,init:function(t){return t.stream.streams.state(t)}}),tk=[Me("stream",Se("mode",{throttle:[Ie("delay"),Xe("stopEvent",!0),eu("streams",{setup:function(t,e){var n=t.stream,r=Fh(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:Q_})]})),Xe("event","input"),We("cancelEvent"),Za("onStream")],ek=ju({fields:tk,name:"streaming",active:J_,state:Z_}),nk=function(t,e,n){var r=vl.getValue(n);vl.setValue(e,r),ok(e)},rk=function(t,e){var n=t.element(),r=Vi(n),o=n.dom();"number"!==So(n,"type")&&e(o,r)},ok=function(t){rk(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},ik=function(t,e,n){if(t.selectsOver){var r=vl.getValue(e),o=t.getDisplayText(r),i=vl.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?y.some((function(){nk(0,e,n),function(t,e){rk(t,(function(t,n){return t.setSelectionRange(e,n.length)}))}(e,o.length)})):y.none()}return y.none()},ak=o("alloy.typeahead.itemexecute"),uk=o([We("lazySink"),Ie("fetch"),Xe("minChars",5),Xe("responseTime",1e3),Ja("onOpen"),Xe("getHotspot",y.some),Xe("getAnchorOverrides",o({})),Xe("layouts",y.none()),Xe("eventOrder",{}),rn("model",{},[Xe("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),Xe("selectsOver",!0),Xe("populateFromBrowse",!0)]),Ja("onSetValue"),Qa("onExecute"),Ja("onItemExecute"),Xe("inputClasses",[]),Xe("inputAttributes",{}),Xe("inputStyles",{}),Xe("matchWidth",!0),Xe("useMinWidth",!1),Xe("dismissOnBlur",!0),Ka(["openClass"]),We("initialData"),bl("typeaheadBehaviours",[Mm,vl,ek,Sm,Gm,Cy]),on("previewing",(function(){return an(!0)}))].concat(Kb()).concat(Py())),sk=o([Yl({schema:[Ga()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){ik(t.model,r,n).fold((function(){return Hf.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&nk(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOption().map((function(t){return Rr(t,ak(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&nk(t.model,e,n)}))}}}})]),ck=_f({name:"Typeahead",configFields:uk(),partFields:sk(),factory:function(t,e,r,o){var i=function(e,r,i){t.previewing.set(!1);var a=Cy.getCoupled(e,"sandbox");if(Jc.isOpen(a))Of.getCurrent(a).each((function(t){Hf.getHighlighted(t).fold((function(){i(t)}),(function(){Mr(a,t.element(),"keydown",r)}))}));else{Ty(t,u(e),e,a,o,(function(t){Of.getCurrent(t).each(i)}),ny.HighlightFirst).get(n)}},a=Xb(t),u=function(t){return function(e){return e.map((function(e){var n=Tt(e.menus),r=G(n,(function(t){return z(t.items,(function(t){return"item"===t.type}))}));return vl.getState(t).update(H(r,(function(t){return t.data}))),e}))}},s=[Mm.config({}),vl.config({onSetValue:t.onSetValue,store:d({mode:"dataset",getDataKey:function(t){return Vi(t.element())},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){zi(e.element(),t.model.getDisplayText(n))}},t.initialData.map((function(t){return qt("initialValue",t)})).getOr({}))}),ek.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,r){var i=Cy.getCoupled(e,"sandbox");if(Mm.isFocused(e)&&Vi(e.element()).length>=t.minChars){var a=Of.getCurrent(i).bind((function(t){return Hf.getHighlighted(t).map(vl.getValue)}));t.previewing.set(!0);Ty(t,u(e),e,i,o,(function(e){Of.getCurrent(i).each((function(e){a.fold((function(){t.model.selectsOver&&Hf.highlightFirst(e)}),(function(t){Hf.highlightBy(e,(function(e){return vl.getValue(e).value===t.value})),Hf.getHighlighted(e).orThunk((function(){return Hf.highlightFirst(e),y.none()}))}))}))}),ny.HighlightFirst).get(n)}},cancelEvent:pr()}),Sm.config({mode:"special",onDown:function(t,e){return i(t,e,Hf.highlightFirst),y.some(!0)},onEscape:function(t){var e=Cy.getCoupled(t,"sandbox");return Jc.isOpen(e)?(Jc.close(e),y.some(!0)):y.none()},onUp:function(t,e){return i(t,e,Hf.highlightLast),y.some(!0)},onEnter:function(e){var n=Cy.getCoupled(e,"sandbox"),r=Jc.isOpen(n);if(r&&!t.previewing.get())return Of.getCurrent(n).bind((function(t){return Hf.getHighlighted(t)})).map((function(t){return Rr(e,ak(),{item:t}),!0}));var o=vl.getValue(e);return Ar(e,pr()),t.onExecute(n,e,o),r&&Jc.close(n),y.some(!0)}}),Gm.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),Cy.config({others:{sandbox:function(e){return Ry(t,e,{onOpen:function(){return Gm.on(e)},onClose:function(){return Gm.off(e)}})}}}),Am("typeaheadevents",[Jr((function(e){var r=n;Oy(t,u(e),e,o,r,ny.HighlightFirst).get(n)})),jr(ak(),(function(e,n){var r=Cy.getCoupled(e,"sandbox");nk(t.model,e,n.event().item()),Ar(e,pr()),t.onItemExecute(e,r,n.event().item(),vl.getValue(e)),Jc.close(r),ok(e)}))].concat(t.dismissOnBlur?[jr(ur(),(function(t){var e=Cy.getCoupled(t,"sandbox");Xu(e.element()).isNone()&&Jc.close(e)}))]:[]))];return{uid:t.uid,dom:Qb(Bt(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:d(d({},a),xl(t.typeaheadBehaviours,s)),eventOrder:t.eventOrder}}}),lk=function(t){return d(d({},t),{toCached:function(){return lk(t.toCached())},bindFuture:function(e){return lk(t.bind((function(t){return t.fold((function(t){return cy(it.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return lk(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return lk(t.map((function(t){return t.map(e)})))},mapError:function(e){return lk(t.map((function(t){return t.mapError(e)})))},foldResult:function(e,n){return t.map((function(t){return t.fold(e,n)}))},withTimeout:function(n,r){return lk(sy((function(o){var i=!1,a=e.setTimeout((function(){i=!0,o(it.error(r()))}),n);t.get((function(t){i||(e.clearTimeout(a),o(t))}))})))}})},fk=function(t){return lk(sy(t))},dk=fk,mk={type:"separator"},hk=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},pk=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:function(){}}},gk=function(t,e){return function(t){return H(t,hk)}(function(t,e){return z(e,(function(e){return e.type===t}))}(t,e))},vk=function(t){return gk("header",t.targets)},bk=function(t){return gk("anchor",t.targets)},yk=function(t){return y.from(t.anchorTop).map((function(t){return pk("<top>",t)})).toArray()},xk=function(t){return y.from(t.anchorBottom).map((function(t){return pk("<bottom>",t)})).toArray()},wk=function(t,e){var n=t.toLowerCase();return z(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return yn(e.toLowerCase(),n)||yn(t.value.toLowerCase(),n)}))},Ck=function(t,e,n){var r=vl.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=wk(o,function(t){return H(t,(function(t){return pk(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,wk(o,vk(e)),wk(o,Y([yk(e),bk(e),xk(e)]))],W(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(mk,e)}),[])):i}))},_k=Io("aria-invalid"),kk=function(t){return function(e,n,r){return Dt(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},Sk={bar:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:H(t.items,e.interpreter)}}(t,e.shared)})),collection:kk((function(t,e){return Gb(t,e.shared.providers)})),alertbanner:kk((function(t,e){return function(t,e){return Db.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Eh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Rh(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Rr(e,zb,{name:"alert-banner",value:t.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:kk((function(t,e){return function(t,e){return X_({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:y.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:kk((function(t,e){return function(t,e){return X_({name:t.name,multiline:!0,label:t.label,inputMode:y.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:y.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:kk((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=H(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:Fu([Fw(),Nm.config({}),Kw(y.none()),Sm.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:function(t){return function(e,n,r){var o=Bt(n,{source:"dynamic"});return kk(t)(e,o,r)}}((function(t,e){return aC(t,e.shared.providers)})),button:kk((function(t,e){return v_(t,e.shared.providers)})),checkbox:kk((function(t,e){return function(t,e){var n=vl.config({store:{mode:"manual",getValue:function(t){return t.element().dom().checked},setValue:function(t,e){t.element().dom().checked=e}}}),r=function(t){return t.element().dom().click(),y.some(!0)},o=Ab.parts().field({factory:{sketch:i},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:Fu([Fw(),ig.config({disabled:function(){return t.disabled||e.isReadOnly()}}),Pb.config({}),Mm.config({}),n,Sm.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),Am("checkbox-events",[jr(er(),(function(e,n){Rr(e,Hb,{name:t.name})}))])])}),a=Ab.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:Fu([Hy.config({})])}),u=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:Rh("checked"===t?"selected":"unselected",e.icons)}}},s=Nh({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[u("checked"),u("unchecked")]});return Ab.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,s.asSpec(),a],fieldBehaviours:Fu([ig.config({disabled:function(){return t.disabled||e.isReadOnly()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){Ab.getField(t).each(ig.disable)},onEnabled:function(t){Ab.getField(t).each(ig.enable)}}),Bg()])})}(t,e.shared.providers)})),colorinput:kk((function(t,e){return Uy(t,e.shared,e.colorinput)})),colorpicker:kk((function(t){var n=function(t){return"tox-"+t},r=Lw(zw,n),o=Nh(r.sketch({dom:{tag:"div",classes:[n("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Rr(t,zb,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Rr(t,zb,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[o.asSpec()],behaviours:Fu([vl.config({store:{mode:"manual",getValue:function(t){var e=o.get(t);return Of.getCurrent(e).bind((function(t){return vl.getValue(t).hex})).map((function(t){return"#"+t})).getOr("")},setValue:function(t,n){var r=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n),i=o.get(t);Of.getCurrent(i).fold((function(){e.console.log("Can not find form")}),(function(t){vl.setValue(t,{hex:y.from(r[1]).getOr("")}),Aw.getField(t,"hex").each((function(t){Ar(t,tr())}))}))}}}),Fw()])}})),dropzone:kk((function(t,e){return Jw(t,e.shared.providers)})),grid:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:H(t.items,e.interpreter)}}(t,e.shared)})),selectbox:kk((function(t,e){return function(t,e){var n=H(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return Fb(t,e)})),o=Ab.parts().field({dom:{},selectAttributes:{size:t.size},options:n,factory:K_,selectBehaviours:Fu([ig.config({disabled:function(){return t.disabled||e.isReadOnly()}}),Pb.config({}),Am("selectbox-change",[jr(er(),(function(e,n){Rr(e,Hb,{name:t.name})}))])])}),i=t.size>1?y.none():y.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:Rh("chevron-down",e.icons)}}),a={dom:{tag:"div",classes:["tox-selectfield"]},components:Y([[o],i.toArray()])};return Ab.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Y([r.toArray(),[a]]),fieldBehaviours:Fu([ig.config({disabled:function(){return t.disabled||e.isReadOnly()},onDisabled:function(t){Ab.getField(t).each(ig.disable)},onEnabled:function(t){Ab.getField(t).each(ig.enable)}}),Bg()])})}(t,e.shared.providers)})),sizeinput:kk((function(t,e){return T_(t,e.shared.providers)})),urlinput:kk((function(t,e){return function(t,e,r){var o,i=e.shared.providers,a=function(e){var n=vl.getValue(e);r.addToHistory(n.value,t.filetype)},u=Ab.parts().field({factory:ck,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":_k,type:"url"},minChars:0,responseTime:0,fetch:function(n){var o=Ck(t.filetype,n,r),i=a_(o,up.BUBBLE_TO_SANDBOX,e,!1);return cy(i)},getHotspot:function(t){return h.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(yy)&&yy.run(t).get(n)},typeaheadBehaviours:Fu(Y([r.getValidationHandler().map((function(e){return yy.config({getRoot:function(t){return so(t.element())},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){c.getOpt(t).each((function(t){ko(t.element(),"title",i.translate(e))}))}},validator:{validate:function(n){var r=vl.getValue(n);return dk((function(n){e({type:t.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=it.error(t.message);n(e)}else{var r=it.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[ig.config({disabled:function(){return t.disabled||i.isReadOnly()}}),Pb.config({}),Am("urlinput-events",Y(["file"===t.filetype?[jr(tr(),(function(e){Rr(e,Hb,{name:t.name})}))]:[],[jr(er(),(function(e){Rr(e,Hb,{name:t.name}),a(e)})),jr(sr(),(function(e){Rr(e,Hb,{name:t.name}),a(e)}))]]))]])),eventOrder:(o={},o[tr()]=["streaming","urlinput-events","invalidating"],o),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:yp(0,0,"normal")},onExecute:function(t,e,n){Rr(e,Ub,{})},onItemExecute:function(e,n,r,o){a(e),Rr(e,Hb,{name:t.name})}}),s=t.label.map((function(t){return Fb(t,i)})),c=Nh(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],innerHtml:Rh(n,i.icons),attributes:d({title:i.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))}}}("invalid",y.some(_k),"warning")),l=Nh({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),f=r.getUrlPicker(t.filetype),m=Io("browser.url.event"),h=Nh({dom:{tag:"div",classes:["tox-control-wrap"]},components:[u,l.asSpec()],behaviours:Fu([ig.config({disabled:function(){return t.disabled||i.isReadOnly()}})])}),p=Nh(h_({name:t.name,icon:y.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return Ar(t,m)}),i,[],["tox-browse-url"]));return Ab.sketch({dom:Lb([]),components:s.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:Y([[h.asSpec()],f.map((function(){return p.asSpec()})).toArray()])}]),fieldBehaviours:Fu([ig.config({disabled:function(){return t.disabled||i.isReadOnly()},onDisabled:function(t){Ab.getField(t).each(ig.disable),p.getOpt(t).each(ig.disable)},onEnabled:function(t){Ab.getField(t).each(ig.enable),p.getOpt(t).each(ig.enable)}}),Bg(),Am("url-input-events",[jr(m,(function(e){Of.getCurrent(e).each((function(n){var r=vl.getValue(n),o=d({fieldname:t.name},r);f.each((function(r){r(o).get((function(r){vl.setValue(n,r),Rr(e,Hb,{name:t.name})}))}))}))}))])])})}(t,e,e.urlinput)})),customeditor:kk((function(t){var e=an(y.none()),n=Nh({dom:{tag:t.tag}}),r=an(y.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Fu([Am("editor-foo-events",[Gr((function(o){n.getOpt(o).each((function(n){(!function(t){return Object.prototype.hasOwnProperty.call(t,"init")}(t)?Uw.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element().dom(),t.settings)})):t.init(n.element().dom())).then((function(t){r.get().each((function(e){t.setValue(e)})),r.set(y.none()),e.set(y.some(t))}))}))}))]),vl.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(y.some(n))}),(function(t){return t.setValue(n)}))}}}),Fw()]),components:[n.asSpec()]}})),htmlpanel:kk((function(t){return"presentation"===t.presets?Db.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):Db.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:Fu([Pb.config({}),Mm.config({})])})})),imagetools:kk((function(t,e){return G_(t,e.shared.providers)})),table:kk((function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},a=function(t){return{dom:{tag:"tr"},components:H(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:H(r,o)}]}),(n=t.cells,{dom:{tag:"tbody"},components:H(n,a)})],behaviours:Fu([Pb.config({}),Mm.config({})])}}(t,e.shared.providers)})),panel:kk((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:H(t.items,e.shared.interpreter)}}(t,e)}))},Tk={field:function(t,e){return e}},Dk=function(t,e,n){var r=Bt(n,{shared:{interpreter:function(e){return Ok(t,e,r)}}});return Ok(t,e,r)},Ok=function(t,n,r){return Dt(Sk,n.type).fold((function(){return e.console.error('Unknown factory type "'+n.type+'", defaulting to container: ',n),n}),(function(e){return e(t,n,r)}))},Ek={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},Nk=function(t,e,n){var r=xs(-12,12,Ek),o={maxHeightFunction:gs()};return function(){return n()?{anchor:"node",root:Oi(oo(t())),node:y.from(t()),bubble:r,layouts:{onRtl:function(){return[Sh]},onLtr:function(){return[kh]}},overrides:o}:{anchor:"hotspot",hotspot:e(),bubble:r,layouts:{onRtl:function(){return[wu]},onLtr:function(){return[Cu]}},overrides:o}}},Ak=function(t,e,n){return function(){return n()?{anchor:"node",root:Oi(oo(t())),node:y.from(t()),layouts:{onRtl:function(){return[Th]},onLtr:function(){return[Th]}}}:{anchor:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[Tu]},onLtr:function(){return[Tu]}}}}},Rk=function(t,e){return function(){return{anchor:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return y.some(Ps.range(sn.fromDom(e.startContainer),e.startOffset,sn.fromDom(e.endContainer),e.endOffset))}}}},Bk=function(t){return function(e){return{anchor:"node",root:t(),node:e}}},Pk=function(t,e,n){var r=_g(t),o=function(){return sn.fromDom(t.getBody())},i=function(){return sn.fromDom(t.getContentAreaContainer())},a=function(){return r||!n()};return{inlineDialog:Nk(i,e,a),banner:Ak(i,e,a),cursor:Rk(t,o),node:Bk(o)}},Ik=function(t){return function(e,n){qv(t)(e,n)}},Mk=function(t){return function(){return Iv(t)}},Lk=function(t){return function(){return Mv(t)}},Fk=function(t){return function(){return Fv(t)}},Hk=function(t){return{colorPicker:Ik(t),hasCustomColors:Mk(t),getColors:Lk(t),getColorCols:Fk(t)}},jk=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},Vk=function(t){return{isDraggableModal:jk(t)}},zk=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],Uk=function(t){return W(t,(function(t,e){if(Ot(e,"items")){var n=Uk(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(function(t){return Ot(t,"inline")}(e)||function(t){return Ot(t,"block")}(e)||function(t){return Ot(t,"selector")}(e)){var r="custom-"+e.title.toLowerCase();return{customFormats:t.customFormats.concat([{name:r,format:e}]),formats:t.formats.concat([{title:e.title,format:r,icon:e.icon}])}}return d(d({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},Wk=function(t){return function(t){return y.from(t.getParam("style_formats")).filter(k)}(t).map((function(e){var n=function(t,e){var n=Uk(e),r=function(e){j(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?zk.concat(n):n})).getOr(zk)},qk=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Bt(t,r)},$k=function(t,e,n,r){var o=function(e){return H(e,(function(e){var i=bt(e);if(Et(e,"items")){var a=o(e.items);return Bt(function(t){return Bt(t,{type:"submenu"})}(e),{getStyleItems:function(){return a}})}return Et(e,"format")?function(t){return qk(t,n,r)}(e):1===i.length&&I(i,"title")?Bt(e,{type:"separator"}):function(e){var o=Io(e.title),i={type:"formatter",format:o,isSelected:n(o),getStylePreview:r(o)},a=Bt(e,i);return t.formatter.register(o,a),a}(e)}))};return o(e)},Yk=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?y.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):y.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?G(e,r):[t.format]},o=an([]),i=an([]),a=an([]),u=an([]),s=an(!1);t.on("PreInit",(function(a){var u=Wk(t),s=$k(t,u,e,n);o.set(s),i.set(G(s,r))})),t.on("addStyleModifications",(function(o){var i=$k(t,o.items,e,n);a.set(i),s.set(o.replace),u.set(G(i,r))}));return{getData:function(){var t=s.get()?[]:o.get(),e=a.get();return t.concat(e)},getFlattenedKeys:function(){var t=s.get()?[]:i.get(),e=u.get();return t.concat(e)}}},Gk=M_.trim,Kk=function(t){return function(e){if(e&&1===e.nodeType){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Xk=Kk("true"),Jk=Kk("false"),Qk=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},Zk=function(t){return t.innerText||t.textContent},tS=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&nS(t)},eS=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},nS=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return Xk(t)}return!1}(t)&&!Jk(t)},rS=function(t){return eS(t)&&nS(t)},oS=function(t){var e=function(t){return t.id?t.id:Io("h")}(t);return Qk("header",Zk(t),"#"+e,function(t){return eS(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},iS=function(t){var e=t.id||t.name,r=Zk(t);return Qk("anchor",r||"#"+e,"#"+e,0,n)},aS=function(t){var e,n;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,H($s(sn.fromDom(n),e),(function(t){return t.dom()}))},uS=function(t){return Gk(t.title).length>0},sS=function(t){var e=aS(t);return z(function(t){return H(z(t,rS),oS)}(e).concat(function(t){return H(z(t,tS),iS)}(e)),uS)},cS="tinymce-url-history",lS=function(t){return C(t)&&/^https?/.test(t)},fS=function(t){return _(t)&&St(t,(function(t){return!(k(e=t)&&e.length<=5&&K(e,lS));var e})).isNone()},dS=function(){var t,n=Av.getItem(cS);if(null===n)return{};try{t=JSON.parse(n)}catch(t){if(t instanceof SyntaxError)return e.console.log("Local storage "+cS+" was not valid JSON",t),{};throw t}return fS(t)?t:(e.console.log("Local storage "+cS+" was not valid format",t),{})},mS=function(t){var e=dS();return Object.prototype.hasOwnProperty.call(e,t)?e[t]:[]},hS=function(t,e){if(lS(t)){var n=dS(),r=Object.prototype.hasOwnProperty.call(n,e)?n[e]:[],o=z(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!fS(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));Av.setItem(cS,JSON.stringify(t))}(n)}},pS=function(t){return!!t},gS=function(t){return wt(M_.makeMap(t,/[, ]/),pS)},vS=function(t){return y.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(O)},bS=function(t,e){var n=function(t){var e=y.some(function(t){return t.getParam("file_picker_types")}(t)).filter(pS),n=y.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(pS),r=e.or(n).map(gS);return vS(t).fold((function(){return!1}),(function(t){return r.fold((function(){return!0}),(function(t){return bt(t).length>0&&t}))}))}(t);return S(n)?n?vS(t):y.none():n[e]?vS(t):y.none()},yS=function(t){return{getHistory:mS,addToHistory:hS,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?y.none():y.some({targets:sS(t.getBody()),anchorTop:Og(t),anchorBottom:Eg(t)})}(t)},getValidationHandler:function(){return function(t){return y.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return bS(t,e).map((function(n){return function(r){return sy((function(o){var i=d({filetype:e,fieldname:r.fieldname},y.from(r.meta).getOr({}));n.call(t,(function(t,e){if(!C(t))throw new Error("Expected value to be string");if(void 0!==e&&!_(e))throw new Error("Expected meta to be a object");o({value:t,meta:e})}),r.value,i)}))}}))}(t,e)}}},xS=function(t,e,n){var r=an(!1),o=function(t){var e=an(wg(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:qp.translate,isReadOnly:function(){return e.mode.isReadOnly()}},interpreter:function(t){return function(t,e){return Ok(Tk,t,e)}(t,i)},anchors:Pk(e,n,o.isPositionedAtTop),header:o,getSink:function(){return it.value(t)}},urlinput:yS(e),styleselect:Yk(e),colorinput:Hk(e),dialog:Vk(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},wS=o((function(t,e){!function(t,e){var n=la.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Ai(t,"max-width",n+"px")}(t,Math.floor(e))})),CS=o([Ie("items"),Ka(["itemSelector"]),bl("tgroupBehaviours",[Sm])]),_S=o([Kl({name:"items",unit:"item"})]),kS=_f({name:"ToolbarGroup",configFields:CS(),partFields:_S(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:xl(t.tgroupBehaviours,[Sm.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),SS=o([Ie("dom"),Xe("shell",!0),bl("toolbarBehaviours",[Nm])]),TS=o([Gl({name:"groups",overrides:function(){return{behaviours:Fu([Nm.config({})])}}})]),DS=_f({name:"Toolbar",configFields:SS(),partFields:TS(),factory:function(t,n,r,o){var i=function(e){return t.shell?y.some(e):uf(e,t,"groups")},a=t.shell?{behaviours:[Nm.config({})],components:[]}:{behaviours:[],components:n};return{uid:t.uid,dom:t.dom,components:a.components,behaviours:xl(t.toolbarBehaviours,a.behaviours),apis:{setGroups:function(t,n){i(t).fold((function(){throw e.console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(function(t){Nm.set(t,n)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),OS=function(t,e,n){return{within:o(t),extra:o(e),withinWidth:o(n)}},ES=function(t,e,n){var r,i=(r=function(t,e){var r=n(t);return y.some({element:o(t),start:o(e),finish:o(e+r),width:o(r)})},W(t,(function(t,e){return r(e,t.len).fold(o(t),(function(e){return{len:e.finish(),list:t.list.concat([e])}}))}),{len:0,list:[]}).list),a=z(i,(function(t){return t.finish()<=e})),u=U(a,(function(t,e){return t+e.width()}),0),s=i.slice(a.length);return{within:o(a),extra:o(s),withinWidth:o(u)}},NS=function(t){return H(t,(function(t){return t.element()}))},AS=function(t,e,n,r){var o=function(t,e,n){var r=ES(e,t,n);return 0===r.extra().length?y.some(r):y.none()}(t,e,n).getOrThunk((function(){return ES(e,t-n(r),n)})),i=o.within(),a=o.extra(),u=o.withinWidth();return 1===a.length&&a[0].width()<=n(r)?function(t,e,n){var r=NS(t.concat(e));return OS(r,[],n)}(i,a,u):a.length>=1?function(t,e,n,r){var o=NS(t).concat([n]);return OS(o,NS(e),r)}(i,a,r,u):function(t,e,n){return OS(NS(t),[],n)}(i,0,u)},RS=function(t,e){var n=H(e,(function(t){return ta(t)}));DS.setGroups(t,n)},BS=function(t,e,n){var r=sf(t,e,"primary"),o=Cy.getCoupled(t,"overflowGroup");Ai(r.element(),"visibility","hidden");var i=e.builtGroups.get().concat([o]),a=nt(i,(function(t){return Xu(t.element()).bind((function(e){return t.getSystem().getByDom(e).toOption()}))}));n([]),RS(r,i);var u=fa(r.element()),s=AS(u,e.builtGroups.get(),(function(t){return fa(t.element())}),o);0===s.extra().length?(Nm.remove(r,o),n([])):(RS(r,s.within()),n(s.extra())),Hi(r.element(),"visibility"),ji(r.element()),a.each(Mm.focus)},PS=o([bl("splitToolbarBehaviours",[Cy]),on("builtGroups",(function(){return an([])}))]),IS=o([Ka(["overflowToggledClass"]),Ge("getOverflowBounds"),Ie("lazySink"),on("overflowGroups",(function(){return an([])}))].concat(PS())),MS=o([$l({factory:DS,schema:SS(),name:"primary"}),Yl({schema:SS(),name:"overflow"}),Yl({name:"overflow-button"}),Yl({name:"overflow-group"})]),LS=o([Ka(["toggledClass"]),Ie("lazySink"),je("fetch"),Ge("getBounds"),Ke("fireDismissalEventInstead",[Xe("event",_r())]),Ts()]),FS=o([Yl({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:Fu([Gm.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Yl({factory:DS,schema:SS(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:Fu([Sm.config({mode:"cyclic",onEscape:function(e){return uf(e,t,"button").each(Mm.focus),y.none()}})])}}})]),HS=function(t,e){var n=Cy.getCoupled(t,"toolbarSandbox");Jc.isOpen(n)?Jc.close(n):Jc.open(n,e.toolbar())},jS=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Ec.positionWithinBounds(i,{anchor:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:wS()}},e,o)},VS=function(t,e,n,r,o){DS.setGroups(e,o),jS(t,e,n,r),Gm.on(t)},zS=_f({name:"FloatingToolbarButton",factory:function(t,e,n,r){return d(d({},Eh.sketch(d(d({},r.button()),{action:function(t){HS(t,r)},buttonBehaviours:Cl({dump:r.button().buttonBehaviours},[Cy.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=Ia();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:Fu([Sm.config({mode:"special",onEscape:function(t){return Jc.close(t),y.some(!0)}}),Jc.config({onOpen:function(o,i){n.fetch().get((function(o){VS(t,i,n,e.layouts,o),r.link(t.element()),Sm.focusIn(i)}))},onClose:function(){Gm.off(t),Mm.focus(t),r.unlink(t.element())},isPartOf:function(e,n,r){return La(n,r)||La(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),$u.config({channels:d(d({},nl(d({isExtraPart:c},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),ol({doReposition:function(){Jc.getState(Cy.getCoupled(t,"toolbarSandbox")).each((function(r){jS(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){Jc.getState(Cy.getCoupled(e,"toolbarSandbox")).each((function(o){VS(e,o,t,n.layouts,r)}))},reposition:function(e){Jc.getState(Cy.getCoupled(e,"toolbarSandbox")).each((function(r){jS(e,r,t,n.layouts)}))},toggle:function(t){HS(t,r)},getToolbar:function(t){return Jc.getState(Cy.getCoupled(t,"toolbarSandbox"))}}})},configFields:LS(),partFields:FS(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)}}}),US=function(t){return H(t,(function(t){return ta(t)}))},WS=function(t,e,n){BS(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){zS.setGroups(t,US(r))}))}))},qS=_f({name:"SplitFloatingToolbar",configFields:IS(),partFields:MS(),factory:function(t,e,n,r){var o=Nh(zS.sketch({fetch:function(){return sy((function(e){e(US(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[Cu,wu]},onRtl:function(){return[wu,Cu]},onBottomLtr:function(){return[ku,_u]},onBottomRtl:function(){return[_u,ku]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:xl(t.splitToolbarBehaviours,[Cy.config({others:{overflowGroup:function(){return kS.sketch(d(d({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(H(n,e.getSystem().build)),WS(e,o,t)},refresh:function(e){return WS(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){zS.toggle(t)}))},reposition:function(t){o.getOpt(t).each((function(t){zS.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind((function(t){return zS.getToolbar(t)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),$S=function(t,e){return e.getAnimationRoot.fold((function(){return t.element()}),(function(e){return e(t)}))},YS=function(t){return t.dimension.property},GS=function(t,e){return t.dimension.getDimension(e)},KS=function(t,e){var n=$S(t,e);bi(n,[e.shrinkingClass,e.growingClass])},XS=function(t,e){pi(t.element(),e.openClass),mi(t.element(),e.closedClass),Ai(t.element(),YS(e),"0px"),ji(t.element())},JS=function(t,e){pi(t.element(),e.closedClass),mi(t.element(),e.openClass),Hi(t.element(),YS(e))},QS=function(t,e,n,r){n.setCollapsed(),Ai(t.element(),YS(e),GS(e,t.element())),ji(t.element()),KS(t,e),XS(t,e),e.onStartShrink(t),e.onShrunk(t)},ZS=function(t,e,n,r){var o=r.getOrThunk((function(){return GS(e,t.element())}));n.setCollapsed(),Ai(t.element(),YS(e),o),ji(t.element());var i=$S(t,e);pi(i,e.growingClass),mi(i,e.shrinkingClass),XS(t,e),e.onStartShrink(t)},tT=function(t,e,n){var r=GS(e,t.element());("0px"===r?QS:ZS)(t,e,n,y.some(r))},eT=function(t,e,n){var r=$S(t,e),o=gi(r,e.shrinkingClass),i=GS(e,t.element());JS(t,e);var a=GS(e,t.element());(o?function(){Ai(t.element(),YS(e),i),ji(t.element())}:function(){XS(t,e)})(),pi(r,e.shrinkingClass),mi(r,e.growingClass),JS(t,e),Ai(t.element(),YS(e),a),n.setExpanded(),e.onStartGrow(t)},nT=function(t,e,n){var r=$S(t,e);return!0===gi(r,e.growingClass)},rT=function(t,e,n){var r=$S(t,e);return!0===gi(r,e.shrinkingClass)},oT=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){Hi(t.element(),YS(e));var r=GS(e,t.element());Ai(t.element(),YS(e),r)}},grow:function(t,e,n){n.isExpanded()||eT(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&tT(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&QS(t,e,n,y.none())},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:nT,isShrinking:rT,isTransitioning:function(t,e,n){return!0===nT(t,e)||!0===rT(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?tT:eT)(t,e,n)},disableTransitions:KS}),iT=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return ti(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:qt(e.dimension.property,"0px")})},events:function(t,e){return Lr([Yr(rr(),(function(n,r){r.event().raw().propertyName===t.dimension.property&&(KS(n,t),e.isExpanded()&&Hi(n.element(),t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),aT=[Ie("closedClass"),Ie("openClass"),Ie("shrinkingClass"),Ie("growingClass"),We("getAnimationRoot"),Ja("onShrunk"),Ja("onStartShrink"),Ja("onGrown"),Ja("onStartGrow"),Xe("expanded",!1),Me("dimension",Se("property",{width:[eu("property","width"),eu("getDimension",(function(t){return fa(t)+"px"}))],height:[eu("property","height"),eu("getDimension",(function(t){return ra(t)+"px"}))]}))],uT=ju({fields:aT,name:"sliding",active:iT,apis:oT,state:Object.freeze({__proto__:null,init:function(t){var e=an(t.expanded);return Qo({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:a(e.set,!1),setExpanded:a(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),sT=o([Ka(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ja("onOpened"),Ja("onClosed")].concat(PS())),cT=o([$l({factory:DS,schema:SS(),name:"primary"}),$l({factory:DS,schema:SS(),name:"overflow",overrides:function(t){return{toolbarBehaviours:Fu([uT.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){uf(e,t,"overflow-button").each((function(t){Gm.off(t),Mm.focus(t)})),t.onClosed(e)},onGrown:function(e){Sm.focusIn(e),t.onOpened(e)},onStartGrow:function(e){uf(e,t,"overflow-button").each(Gm.on)}}),Sm.config({mode:"acyclic",onEscape:function(e){return uf(e,t,"overflow-button").each(Mm.focus),y.some(!0)}})])}}}),Yl({name:"overflow-button",overrides:function(t){return{buttonBehaviours:Fu([Gm.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Yl({name:"overflow-group"})]),lT=function(t,e){uf(t,e,"overflow").each((function(n){BS(t,e,(function(t){var e=H(t,(function(t){return ta(t)}));DS.setGroups(n,e)})),uf(t,e,"overflow-button").each((function(t){uT.hasGrown(n)&&Gm.on(t)})),uT.refresh(n)}))},fT=_f({name:"SplitSlidingToolbar",configFields:sT(),partFields:cT(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:xl(t.splitToolbarBehaviours,[Cy.config({others:{overflowGroup:function(t){return kS.sketch(d(d({},r["overflow-group"]()),{items:[Eh.sketch(d(d({},r["overflow-button"]()),{action:function(e){Ar(t,"alloy.toolbar.toggle")}}))]}))}}}),Am("toolbar-toggle-events",[jr("alloy.toolbar.toggle",(function(e){uf(e,t,"overflow").each((function(n){lT(e,t),uT.toggleGrow(n)}))}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=H(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),lT(e,t)},refresh:function(e){return lT(e,t)},toggle:function(e){return function(t,e){uf(t,e,"overflow").each((function(n){lT(t,e),uT.toggleGrow(n)}))}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)}}}),dT=o(Io("toolbar-height-change")),mT=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:d({tag:"div",classes:["tox-toolbar__group"]},e),components:[kS.parts().items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:Fu([Pb.config({}),Mm.config({})])}},hT=function(t){return kS.sketch(mT(t))},pT=function(t,e){var n=Gr((function(e){var n=H(t.initGroups,hT);DS.setGroups(e,n)}));return Fu([Lg(t.providers.isReadOnly),Bg(),Sm.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Am("toolbar-events",[n])])},gT=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":mT({title:y.none(),items:[]}),"overflow-button":f_({name:"more",icon:y.some("more-drawer"),disabled:!1,tooltip:y.some("More..."),primary:!1,borderless:!1},y.none(),t.providers)},splitToolbarBehaviours:pT(t,e)}},vT=function(t){var e=gT(t),n=qS.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return qS.sketch(d(d({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element(),n=Sa(e),r=ao(e),o=Sa(r),i=Math.max(r.dom().scrollHeight,o.height);return _a(n.x+4,o.y,n.width-8,i)},parts:d(d({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},bT=function(t){var e=fT.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=fT.parts().overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=gT(t);return fT.sketch(d(d({},r),{components:[e,n],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([dT()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([dT()],{type:"closed"})}}))},yT=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return DS.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===ap.scrolling?["tox-toolbar--scrolling"]:[])},components:[DS.parts().groups({})],toolbarBehaviours:pT(t,e)})},xT=[en("disabled",!1),Ye("tooltip"),Ye("icon"),Ye("text"),nn("onSetup",(function(){return n}))],wT=ae([Fe("type"),je("onAction")].concat(xT)),CT=function(t){return xe("toolbarbutton",wT,t)},_T=[Ye("text"),Ye("tooltip"),Ye("icon"),je("fetch"),nn("onSetup",(function(){return n}))],kT=ae(h([Fe("type")],_T)),ST=function(t){return xe("menubutton",kT,t)},TT=ae([Fe("type"),Ye("tooltip"),Ye("icon"),Ye("text"),Ge("select"),je("fetch"),nn("onSetup",(function(){return n})),tn("presets","normal",["normal","color","listpreview"]),Xe("columns",1),je("onAction"),je("onItemAction")]),DT=[en("active",!1)].concat(xT),OT=ae(DT.concat([Fe("type"),je("onAction")])),ET=function(t){return xe("ToggleButton",OT,t)},NT=ae([Fe("type"),Me("items",(q_=[ge([Fe("name"),Ue("items",Ee)]),Ee],{extract:function(t,e,n){for(var r=[],o=0,i=q_;o<i.length;o++){var a=i[o].extract(t,e,n);if(a.stype===p.Value)return a;r.push(a)}return Xt(r)},toString:function(){return"oneOf("+H(q_,(function(t){return t.toString()})).join(", ")+")"}}))].concat(xT)),AT=[nn("predicate",(function(){return!1})),tn("scope","node",["node","editor"]),tn("position","selection",["node","selection","line"])],RT=xT.concat([Xe("type","contextformbutton"),Xe("primary",!1),je("onAction"),on("original",i)]),BT=DT.concat([Xe("type","contextformbutton"),Xe("primary",!1),je("onAction"),on("original",i)]),PT=xT.concat([Xe("type","contextformbutton")]),IT=DT.concat([Xe("type","contextformtogglebutton")]),MT=Se("type",{contextformbutton:RT,contextformtogglebutton:BT}),LT=ae([Xe("type","contextform"),nn("initValue",(function(){return""})),Ye("label"),Ue("commands",MT),qe("launch",Se("type",{contextformbutton:PT,contextformtogglebutton:IT}))].concat(AT)),FT=ae([Xe("type","contexttoolbar"),Fe("items")].concat(AT)),HT=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),jT=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=H(o,n.getSystem().build);Bc(n,i)}))};return Lr([jr(cr(),(function(e,r){var o=r,i=t.channel;I(o.channels(),i)&&n(e,o.data())})),Gr((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),VT=Object.freeze({__proto__:null,init:function(){var t=an(y.none());return{readState:function(){return t.get().fold((function(){return"none"}),(function(t){return t}))},get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(y.none())}}}}),zT=[Ie("channel"),We("renderComponents"),We("updateState"),We("initialData")],UT=ju({fields:zT,name:"reflecting",active:jT,apis:HT,state:VT}),WT=o([Ie("toggleClass"),Ie("fetch"),Za("onExecute"),Xe("getHotspot",y.some),Xe("getAnchorOverrides",o({})),Ts(),Za("onItemExecute"),We("lazySink"),Ie("dom"),Ja("onOpen"),bl("splitDropdownBehaviours",[Cy,Sm,Mm]),Xe("matchWidth",!1),Xe("useMinWidth",!1),Xe("eventOrder",{}),We("role")].concat(Py())),qT=$l({factory:Eh,schema:[Ie("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:Fu([Mm.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(Br)},buttonBehaviours:Fu([Gm.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),$T=$l({factory:Eh,schema:[Ie("dom")],name:"button",defaults:function(){return{buttonBehaviours:Fu([Mm.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),YT=o([qT,$T,Gl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ie("text")],name:"aria-descriptor"}),Yl({schema:[Ga()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),ky()]),GT=_f({name:"SplitDropdown",configFields:WT(),partFields:YT(),factory:function(t,e,r,o){var i=function(t){Of.getCurrent(t).each((function(t){Hf.highlightFirst(t),Sm.focusIn(t)}))},a=function(e){Oy(t,(function(t){return t}),e,o,i,ny.HighlightFirst).get(n)},u=function(e){var n=sf(e,t,"button");return Br(n),y.some(!0)},s=d(d({},Lr([Gr((function(e,n){uf(e,t,"aria-descriptor").each((function(t){var n=Io("aria");ko(t.element(),"id",n),ko(e.element(),"aria-describedby",n)}))}))])),Xm(y.some(a))),c={repositionMenus:function(t){Gm.isOn(t)&&By(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:c,eventOrder:d(d({},t.eventOrder),{"alloy.execute":["disabling","toggling","alloy.base.behaviour"]}),events:s,behaviours:xl(t.splitDropdownBehaviours,[Cy.config({others:{sandbox:function(e){var n=sf(e,t,"arrow");return Ry(t,e,{onOpen:function(){Gm.on(n),Gm.on(e)},onClose:function(){Gm.off(n),Gm.off(e)}})}}}),Sm.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return a(t),y.some(!0)}}),Mm.config({}),Gm.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),KT=function(t){return{isDisabled:function(){return ig.isDisabled(t)},setDisabled:function(e){return ig.set(t,e)}}},XT=function(t){return{setActive:function(e){Gm.set(t,e)},isActive:function(){return Gm.isOn(t)},isDisabled:function(){return ig.isDisabled(t)},setDisabled:function(e){return ig.set(t,e)}}},JT=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},QT=Io("focus-button"),ZT=["checklist","ordered-list"],tD=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],eD=function(t,e,n,r,o,i){var a,u=function(t){return qp.isRtl()&&I(ZT,t)?t+"-rtl":t},s=qp.isRtl()&&t.exists((function(t){return I(tD,t)}));return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(s?["tox-tbtn__icon-rtl"]:[]),attributes:JT(n,i)},components:Ug([t.map((function(t){return YC(u(t),i.icons)})),e.map((function(t){return KC(t,"tox-tbtn",i)}))]),eventOrder:(a={},a[qn()]=["focusing","alloy.base.behaviour","common-button-display-events"],a),buttonBehaviours:Fu([Lg(i.isReadOnly),Bg(),Am("common-button-display-events",[jr(qn(),(function(t,e){e.event().prevent(),Ar(t,QT)}))])].concat(r.map((function(n){return UT.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return Ug([t.icon.map((function(t){return YC(u(t),i.icons)})),t.text.map((function(t){return KC(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},nD=function(t,e,r){var o,i=an(n),a=eD(t.icon,t.text,t.tooltip,y.none(),y.none(),r);return Eh.sketch({dom:a.dom,components:a.components,eventOrder:JC,buttonBehaviours:Fu([Am("toolbar-button-events",[(o={onAction:t.onAction,getApi:e.getApi},Jr((function(t,e){Fg(o,t)((function(e){Rr(t,XC,{buttonApi:e}),o.onAction(e)}))}))),Hg(e,i),jg(e,i)]),Lg((function(){return t.disabled||r.isReadOnly()})),Bg()].concat(e.toolbarButtonBehaviours))})},rD=function(t,e,n){return nD(t,{toolbarButtonBehaviours:[].concat(n.length>0?[Am("toolbarButtonWith",n)]:[]),getApi:KT,onSetup:t.onSetup},e)},oD=function(t,e,n){return Bt(nD(t,{toolbarButtonBehaviours:[Nm.config({}),Gm.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[Am("toolbarToggleButtonWith",n)]:[]),getApi:XT,onSetup:t.onSetup},e))},iD=function(t,e,n){return function(r){return sy((function(t){return e.fetch(t)})).map((function(o){return y.from(ab(Bt($v(Io("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,up.CLOSE_ON_EXECUTE,e.select.getOr((function(){return!1})),n),{movement:Gv(e.columns,e.presets),menuBehaviours:Ip("auto"!==e.columns?[]:[Gr((function(t,n){Bp(t,4,mp(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;Sm.setGridSize(t,n,r)}))}))])})))}))}},aD=function(t,e){return jr(XC,(function(n,r){var o=function(t){return{hide:function(){return Ar(t,hr())},getValue:function(){return vl.getValue(t)}}}(t.get(n));e.onAction(o,r.event().buttonApi())}))},uD=function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original,o=(r.primary,m(r,["primary"])),i=we(ET(d(d({},o),{type:"togglebutton",onAction:function(){}})));return oD(i,n.backstage.shared.providers,[aD(t,e)])}(t,e,r):function(t,e,n){var r=e.original,o=(r.primary,m(r,["primary"])),i=we(CT(d(d({},o),{type:"button",onAction:function(){}})));return rD(i,n.backstage.shared.providers,[aD(t,e)])}(t,e,r)},sD=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=Nh(Zb.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:Fu([Sm.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return Br(t),!0}))},onLeft:function(t,e){return e.cut(),y.none()},onRight:function(t,e){return e.cut(),y.none()}})])})),o=function(t,e,n){var r=H(e,(function(e){return Nh(uD(t,e,n))}));return{asSpecs:function(){return H(r,(function(t){return t.asSpec()}))},findPrimary:function(t){return nt(e,(function(e,n){return e.primary?y.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(u(ig.isDisabled)):y.none()}))}}}(r,t.commands,e);return[{title:y.none(),items:[r.asSpec()]},{title:y.none(),items:o.asSpecs()}]},cD=sD,lD=function(t,n){var r=ya(e.window),o=ka(sn.fromDom(t.getContentAreaContainer())),i=mg(t)||hg(t)||gg(t),a=function(t,e){var n=Math.max(e.x,t.x),r=t.right-n,o=e.width-(n-e.x);return{x:n,width:Math.min(r,o)}}(o,r),u=a.x,s=a.width;if(t.inline&&!i)return _a(u,r.y,s,r.height);var c=function(t,e,n,r){var o=sn.fromDom(t.getContainer()),i=Ba(o,".tox-editor-header").getOr(o),a=ka(i),u=a.y>=e.bottom,s=r&&!u;if(t.inline&&s)return{y:Math.max(a.bottom,n.y),bottom:n.bottom};if(t.inline&&!s)return{y:n.y,bottom:Math.min(a.y,n.bottom)};var c=ka(o);return s?{y:Math.max(a.bottom,n.y),bottom:Math.min(c.bottom,n.bottom)}:{y:Math.max(c.y,n.y),bottom:Math.min(a.y,n.bottom)}}(t,o,r,n.header.isPositionedAtTop()),l=c.y,f=c.bottom;return _a(u,l,s,f-l)},fD=function(t,e){var n=z(e,(function(e){return e.predicate(t.dom())})),r=V(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},dD=function(t,e,n){var r=fD(t,e);if(r.contextForms.length>0)return y.some({elem:t,toolbars:[r.contextForms[0]]});var o=fD(t,n);if(o.contextForms.length>0)return y.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return M(t,(function(t){return t.position===e}))},n=function(e){return z(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),a=H(n("selection"),(function(t){return d(d({},t),{position:"node"})}));return i.concat(a)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return y.some({elem:t,toolbars:i})}return y.none()},mD=function(t,e,n){return t(e)?y.none():Mn(e,(function(t){var e=fD(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return q(t,(function(t){return t.position===e}))};return e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position})).fold((function(){return[]}),(function(e){return z(t,(function(t){return t.position===e}))}))}(r);return i.length>0?y.some({elem:t,toolbars:i}):y.none()}),t)},hD=function(t,e){var n={},r=[],o=[],i={},a={},u=function(t,u){var s=we(xe("ContextForm",LT,u));n[t]=s,s.launch.map((function(n){i["form:"+t]=d(d({},u.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(s)}})})),"editor"===s.scope?o.push(s):r.push(s),a[t]=s},s=function(t,e){var n;(n=e,xe("ContextToolbar",FT,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),a[t]=n}))},c=bt(t);return j(c,(function(e){var n=t[e];"contextform"===n.type?u(e,n):"contexttoolbar"===n.type&&s(e,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:a,formNavigators:i}},pD=Io("forward-slide"),gD=Io("backward-slide"),vD=Io("change-slide-event"),bD=function(t,e,n){var r=function(t,r,i,a){var u=e.shared.providers.translate(t.title);if("separator"===t.type)return y.some({type:"separator",text:u});if("submenu"===t.type){var s=G(t.getStyleItems(),(function(t){return o(t,r,a)}));return 0===r&&s.length<=0?y.none():y.some({type:"nestedmenuitem",text:u,disabled:s.length<=0,getSubmenuItems:function(){return G(t.getStyleItems(),(function(t){return o(t,r,a)}))}})}return y.some(d({type:"togglemenuitem",text:u,icon:t.icon,active:t.isSelected(a),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return G(t,(function(t){return o(t,r,e)}))};return{validateItems:i,getFetch:function(t,e){return function(n){var r=e(),o=i(r);n(a_(o,up.CLOSE_ON_EXECUTE,t,!1))}}}},yD=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return H(r.data,(function(t){return qk(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:bD(0,e,n),getStyleItems:o}},xD=function(t,e,r){var o=yD(0,e,r),i=o.items,a=o.getStyleItems;return t_({text:r.icon.isSome()?y.none():y.some(""),icon:r.icon,tooltip:y.from(r.tooltip),role:y.none(),fetch:i.getFetch(e,a),onSetup:function(e){return r.setInitialValue.each((function(t){return t(e.getComponent())})),r.nodeChangeHandler.map((function(n){var r=n(e.getComponent());return t.on("NodeChange",r),function(){t.off("NodeChange",r)}})).getOr(n)},getApi:function(t){return{getComponent:function(){return t}}},columns:1,presets:"normal",classes:r.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}($_||($_={}));var wD,CD=function(t,e,n,r){return{type:"basic",data:function(t){return H(t,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}}))}(function(t,e){return e===$_.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r))}},_D=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],kD=function(t){var e=function(e){var n=q(_D,(function(e){return t.formatter.match(e.format)})).fold((function(){return"left"}),(function(t){return t.title.toLowerCase()}));Rr(e,ZC,{icon:"align-"+n})},n=y.some((function(t){return function(){return e(t)}})),r=y.some((function(t){return e(t)})),i={type:"basic",data:_D};return{tooltip:"Align",icon:y.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:o(y.none()),getPreviewFor:function(t){return function(){return y.none()}},onAction:function(e){return function(){return q(_D,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},setInitialValue:r,nodeChangeHandler:n,dataset:i,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},SD=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],TD=function(t){var e=t.split(/\s*,\s*/);return H(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},DD=function(t){var e=function(){var e=function(t){return t?TD(t)[0]:""},n=t.queryCommandValue("FontName"),r=i.data,o=n?n.toLowerCase():"";return{matchOpt:q(r,(function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()})).orThunk((function(){return function(t){var e;return 0===t.indexOf("-apple-system")&&(e=TD(t.toLowerCase()),K(SD,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(o)?y.from({title:"System Font",format:o}):y.none()})),font:n}},n=function(t){var n=e(),r=n.matchOpt,o=n.font,i=r.fold((function(){return o}),(function(t){return t.title}));Rr(t,QC,{text:i})},r=y.some((function(t){return function(){return n(t)}})),o=y.some((function(t){return n(t)})),i=CD(t,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",$_.SemiColon);return{tooltip:"Fonts",icon:y.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getCurrentValue:function(){return e().matchOpt},getPreviewFor:function(t){return function(){return y.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},setInitialValue:o,nodeChangeHandler:r,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},OD={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},ED=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":t},ND=function(t){var e=function(){var e=y.none(),n=u.data,r=t.queryCommandValue("FontSize");if(r)for(var o=function(t){var o=ED(r,t),i=function(t){return Dt(OD,t).getOr("")}(o);e=q(n,(function(t){return t.format===r||t.format===o||t.format===i}))},i=3;e.isNone()&&i>=0;i--)o(i);return{matchOpt:e,size:r}},n=o(o(y.none())),r=function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold((function(){return o}),(function(t){return t.title}));Rr(t,QC,{text:i})},i=y.some((function(t){return function(){return r(t)}})),a=y.some((function(t){return r(t)})),u=CD(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",$_.Space);return{tooltip:"Font sizes",icon:y.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},setInitialValue:a,nodeChangeHandler:i,dataset:u,shouldHide:!1,isInvalid:function(){return!1}}},AD=function(t,e,n){var r=e();return nt(n,(function(e){return q(r,(function(n){return t.formatter.matchNode(e,n.format)}))})).orThunk((function(){return t.formatter.match("p")?y.some({title:"Paragraph",format:"p"}):y.none()}))},RD=function(t){var e=t.selection.getStart(!0)||t.getBody();return t.dom.getParents(e,(function(){return!0}),t.getBody())},BD=function(t,e){return function(n){var r=an(y.none()),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive).unbind;r.set(y.some(o))};return t.initialized?o():t.on("init",o),function(){return r.get().each((function(t){return t()}))}}},PD=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},ID=function(t){var e=function(e,n){var r=AD(t,(function(){return i.data}),e).fold((function(){return"Paragraph"}),(function(t){return t.title}));Rr(n,QC,{text:r})},n=y.some((function(t){return function(n){return e(n.parents,t)}})),r=y.some((function(n){var r=RD(t);e(r,n)})),i=CD(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",$_.SemiColon);return{tooltip:"Blocks",icon:y.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:o(y.none()),getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return y.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:PD(t),setInitialValue:r,nodeChangeHandler:n,dataset:i,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},MD=function(t,e){var n=function(e,n){var r=function(t){var e=t.items;return void 0!==e&&e.length>0?G(e,r):[{title:t.title,format:t.format}]},o=G(Wk(t),r),i=AD(t,(function(){return o}),e).fold((function(){return"Paragraph"}),(function(t){return t.title}));Rr(n,QC,{text:i})},r=y.some((function(t){return function(e){return n(e.parents,t)}})),i=y.some((function(e){var r=RD(t);n(r,e)}));return{tooltip:"Formats",icon:y.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:o(y.none()),getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?y.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):y.none()}},onAction:PD(t),setInitialValue:i,nodeChangeHandler:r,shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},LD=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],FD=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return _e(t)})).getOrDie();return e(i,r,o)}},HD={button:FD(CT,(function(t,e){return n=t,r=e.backstage.shared.providers,rD(n,r,[]);var n,r})),togglebutton:FD(ET,(function(t,e){return n=t,r=e.backstage.shared.providers,oD(n,r,[]);var n,r})),menubutton:FD(ST,(function(t,e){return s_(t,"tox-tbtn",e.backstage,y.none())})),splitbutton:FD((function(t){return xe("SplitButton",TT,t)}),(function(t,e){return function(t,e){var r,o=Io("channel-update-split-dropdown-display"),i=function(t){return{isDisabled:function(){return ig.isDisabled(t)},setDisabled:function(e){return ig.set(t,e)},setIconFill:function(e,n){Ba(t.element(),'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){ko(t,"fill",n)}))},setIconStroke:function(e,n){Ba(t.element(),'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){ko(t,"stroke",n)}))},setActive:function(e){ko(t.element(),"aria-pressed",e),Ba(t.element(),"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return Gm.set(t,e)}))}))},isActive:function(){return Ba(t.element(),"span").exists((function(e){return t.getSystem().getByDom(e).exists(Gm.isOn)}))}}},a=an(n),u={getApi:i,onSetup:t.onSetup};return GT.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:d({"aria-pressed":!1},JT(t.tooltip,e.providers))},onExecute:function(e){t.onAction(i(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:Fu([Mg(e.providers.isReadOnly),Bg(),Am("split-dropdown-events",[jr(QT,Mm.focus),Hg(u,a),jg(u,a)]),Hy.config({})]),eventOrder:(r={},r[wr()]=["alloy.base.behaviour","split-dropdown-events"],r),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:iD(i,t,e.providers),parts:{menu:yp(0,t.columns,t.presets)},components:[GT.parts().button(eD(t.icon,t.text,y.none(),y.some(o),y.some([Gm.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),GT.parts().arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Rh("chevron-down",e.providers.icons)},buttonBehaviours:Fu([Mg(e.providers.isReadOnly),Bg()])}),GT.parts()["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})}(t,e.backstage.shared)})),grouptoolbarbutton:FD((function(t){return xe("GroupToolbarButton",NT,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[ks]=e.backstage.shared.header.isPositionedAtTop()?Fa.TopToBottom:Fa.BottomToTop,r);switch(bg(n)){case ap.floating:return function(t,e,n,r){var o=e.shared;return zS.sketch({lazySink:o.getSink,fetch:function(){return sy((function(e){e(H(n(t.items),hT))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:eD(t.icon,t.text,t.tooltip,y.none(),y.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return UD(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,y.none())}),i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return function(t,e){var n=d({type:"advanced"},e.styleselect);return xD(t,e,MD(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return xD(t,e,ND(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return xD(t,e,DD(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return xD(t,e,ID(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return xD(t,e,kD(t))}(t,e.backstage)}},jD={styleselect:HD.styleSelectButton,fontsizeselect:HD.fontsizeSelectButton,fontselect:HD.fontSelectButton,formatselect:HD.formatButton,align:HD.alignMenuButton},VD=function(t){var n,r=t.toolbar,o=t.buttons;return!1===r?[]:void 0===r||!0===r?function(t){var e=H(LD,(function(e){var n=z(e.items,(function(e){return Ot(t,e)||Ot(jD,e)}));return{name:e.name,items:n}}));return z(e,(function(t){return t.items.length>0}))}(o):C(r)?(n=r.split("|"),H(n,(function(t){return{items:t.trim().split(" ")}}))):function(t){return N(t,(function(t){return Ot(t,"name")&&Ot(t,"items")}))}(r)?r:(e.console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},zD=function(t,n,r,o,i,a){return Dt(n,r.toLowerCase()).orThunk((function(){return a.bind((function(t){return nt(t,(function(t){return Dt(n,t+r.toLowerCase())}))}))})).fold((function(){return Dt(jD,r.toLowerCase()).map((function(e){return e(t,i)})).orThunk((function(){return y.none()}))}),(function(n){return"grouptoolbarbutton"!==n.type||o?function(t,n,r){return Dt(HD,t.type).fold((function(){return e.console.error("skipping button defined by",t),y.none()}),(function(e){return y.some(e(t,n,r))}))}(n,i,t):(e.console.warn("Ignoring the '"+r+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),y.none())}))},UD=function(t,e,n,r){var o=VD(e),i=H(o,(function(o){var i=G(o.items,(function(o){return 0===o.trim().length?[]:zD(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:y.from(t.translate(o.name)),items:i}}));return z(i,(function(t){return t.items.length>0}))},WD={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},qD={maxHeightFunction:gs(),maxWidthFunction:wS()},$D={onLtr:function(){return[Su,Tu,_u,wu,ku,Cu,Th,Dh,kh,Ch,Sh,_h]},onRtl:function(){return[Su,Tu,ku,Cu,_u,wu,Th,Dh,Sh,_h,kh,Ch]}},YD={onLtr:function(){return[Tu,wu,Cu,_u,ku,Su,Th,Dh,kh,Ch,Sh,_h]},onRtl:function(){return[Tu,Cu,wu,ku,_u,Su,Th,Dh,Sh,_h,kh,Ch]}},GD=function(t,e,n,r){var o,i,a=En().deviceType.isTouch,u=Zi((o={sink:n,onEscape:function(){return t.focus(),y.some(!0)}},i=an([]),gh.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),gh.getContent(t).each((function(t){Hi(t.element(),"visibility")})),pi(t.element(),"tox-pop--resizing"),Hi(t.element(),"width")},inlineBehaviours:Fu([Am("context-toolbar-events",[Yr(rr(),(function(t,e){pi(t.element(),"tox-pop--resizing"),Hi(t.element(),"width")})),jr(vD,(function(t,e){Hi(t.element(),"width");var n=fa(t.element());gh.setContent(t,e.event().contents()),mi(t.element(),"tox-pop--resizing");var r=fa(t.element());Ai(t.element(),"width",n+"px"),gh.getContent(t).each((function(n){e.event().focus().bind((function(e){return Gu(e),Xu(t.element())})).orThunk((function(){return Sm.focusIn(n),Ku()}))})),Oh.setTimeout((function(){Ai(t.element(),"width",r+"px")}),0)})),jr(pD,(function(t,e){gh.getContent(t).each((function(t){i.set(i.get().concat([{bar:t,focus:Ku()}]))})),Rr(t,vD,{contents:e.event().forwardContents(),focus:y.none()})})),jr(gD,(function(t,e){tt(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),Rr(t,vD,{contents:ta(e.bar),focus:e.focus})}))}))]),Sm.config({mode:"special",onEscape:function(t){return tt(i.get()).fold((function(){return o.onEscape()}),(function(e){return Ar(t,gD),y.some(!0)}))}})]),lazySink:function(){return it.value(o.sink)}}))),s=function(){return lD(t,r.backstage.shared)},c=function(){if(a()&&r.backstage.isContextMenuOpen())return!0;var e,n,o,i,u,c,l=(e=h.get().map((function(t){return t.getBoundingClientRect()})).getOrThunk((function(){return t.selection.getRng().getBoundingClientRect()})),n=t.inline?ga().top():Sa(sn.fromDom(t.getBody())).y,{y:e.top+n,bottom:e.bottom+n}),f=s();return o=l.y,i=l.bottom,u=f.y,c=f.bottom,!(Math.max(o,u)<=Math.min(i,c))},l=function(){gh.hide(u)},f=function(){m.get().each((function(t){var e=u.element();Hi(e,"display"),c()?Ai(e,"display","none"):Ec.positionWithinBounds(n,t,u,y.some(s()))}))},m=an(y.none()),h=an(y.none()),p=an(null),g=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:Fu([Sm.config({mode:"acyclic"}),Am("pop-dialog-wrap-events",[Gr((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return Sm.focusIn(e)}))})),Kr((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},v=It((function(){return hD(e,(function(t){var e=b([t]);Rr(u,pD,{forwardContents:g(e)})}))})),b=function(e){var n=t.ui.registry.getAll().buttons,o=v(),i=d(d({},n),o.formNavigators),a=bg(t)===ap.scrolling?ap.scrolling:ap.default,u=Y(H(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return UD(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,y.some(["form:"]))}(i,e):function(t,e){return cD(t,e)}(e,r.backstage.shared.providers)})));return yT({type:a,uid:Io("context-toolbar"),initGroups:u,onEscape:y.none,cyclicKeying:!0,providers:r.backstage.shared.providers})};t.on("contexttoolbar-show",(function(e){var n=v();Dt(n.lookupTable,e.toolbarKey).each((function(n){w([n],e.target===t?y.none():y.some(e)),gh.getContent(u).each(Sm.focusIn)}))}));var x=function(t,e){var n="node"===t?r.backstage.shared.anchors.node(e):r.backstage.shared.anchors.cursor();return Bt(n,function(t,e){return"line"===t?{bubble:xs(12,0,WD),layouts:{onLtr:function(){return[Du]},onRtl:function(){return[Ou]}},overrides:qD}:{bubble:xs(0,12,WD),layouts:e?YD:$D,overrides:qD}}(t,a()))},w=function(t,e){if(_(),!a()||!r.backstage.isContextMenuOpen()){var n=b(t),o=e.map(sn.fromDom),i=x(t[0].position,o);m.set(y.some(i)),h.set(e);var l=u.element();Hi(l,"display"),gh.showWithinBounds(u,i,g(n),(function(){return y.some(s())})),c()&&Ai(l,"display","none")}},C=function(){t.hasFocus()&&function(t,e){var n=sn.fromDom(e.getBody()),r=function(t){return Rn(t,n)},o=sn.fromDom(e.selection.getNode());return function(t){return!r(t)&&!Pn(n,t)}(o)?y.none():dD(o,t.inNodeScope,t.inEditorScope).orThunk((function(){return mD(r,o,t)}))}(v(),t).fold((function(){m.set(y.none()),gh.hide(u)}),(function(t){w(t.toolbars,y.some(t.elem.dom()))}))},_=function(){var t=p.get();null!==t&&(Oh.clearTimeout(t),p.set(null))},k=function(t){_(),p.set(t)};t.on("init",(function(){t.on("contexttoolbar-hide",l),t.on("ScrollContent ScrollWindow longpress",f),t.on("click keyup focus SetContent ObjectResized ResizeEditor",(function(){k(Oh.setEditorTimeout(t,C,0))})),t.on("focusout",(function(e){Oh.setEditorTimeout(t,(function(){Xu(n.element()).isNone()&&Xu(u.element()).isNone()&&(m.set(y.none()),gh.hide(u))}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&(m.set(y.none()),gh.hide(u))})),t.on("NodeChange",(function(e){Xu(u.element()).fold((function(){k(Oh.setEditorTimeout(t,C,0))}),(function(t){}))}))}))},KD=pf,XD=Jl,JD=o([Xe("shell",!1),Ie("makeItem"),Xe("setupItem",n),wl("listBehaviours",[Nm])]),QD=Gl({name:"items",overrides:function(){return{behaviours:Fu([Nm.config({})])}}}),ZD=o([QD]),tO=o("CustomList"),eO=_f({name:tO(),configFields:JD(),partFields:ZD(),factory:function(t,n,r,o){var i=t.shell?{behaviours:[Nm.config({})],components:[]}:{behaviours:[],components:n},a=function(e){return t.shell?y.some(e):uf(e,t,"items")};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:xl(t.listBehaviours,i.behaviours),apis:{setItems:function(n,r){a(n).fold((function(){throw e.console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(function(e){var o=Nm.contents(e),i=r.length,a=i-o.length,u=a>0?L(a,(function(){return t.makeItem()})):[],s=o.slice(i);j(s,(function(t){return Nm.remove(e,t)})),j(u,(function(t){return Nm.append(e,t)}));var c=Nm.contents(e);j(c,(function(e,o){t.setupItem(n,e,r[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),nO=function(t){return(Mi(t,"position").is("fixed")?y.none():co(t)).orThunk((function(){var e=sn.fromTag("span");return so(t).bind((function(t){go(t,e);var n=co(e);return yo(e),n}))}))},rO=function(t){return nO(t).map(sa).getOrThunk((function(){return aa(0,0)}))},oO=Nt([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),iO=function(t,e){var n=t.element();mi(n,e.transitionClass),pi(n,e.fadeOutClass),mi(n,e.fadeInClass),e.onShow(t)},aO=function(t,e){var n=t.element();mi(n,e.transitionClass),pi(n,e.fadeInClass),mi(n,e.fadeOutClass),e.onHide(t)},uO=function(t,e,n){return K(t,(function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}}))},sO=function(t,e){return e.getInitialPosition().map((function(e){return _a(e.bounds.x,e.bounds.y,fa(t),ra(t))}))},cO=function(t,e,n){return n.getInitialPosition().bind((function(r){switch(n.setInitialPosition(y.none()),r.position){case"static":return y.some(oO.static());case"absolute":var o=nO(t).map(ka).getOrThunk((function(){return ka(Di())}));return y.some(oO.absolute(Qu("absolute",Dt(r.style,"left").map((function(t){return e.x-o.x})),Dt(r.style,"top").map((function(t){return e.y-o.y})),Dt(r.style,"right").map((function(t){return o.right-e.right})),Dt(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return y.none()}}))},lO=function(t,e,n){var r=ka(t);if(uO(n.getModes(),r,e))return y.none();!function(t,e,n){n.setInitialPosition(y.some({style:Li(t),position:Pi(t,"position")||"static",bounds:e}))}(t,r,n);var o=Ta(),i=r.x-o.x,a=e.y-o.y,u=o.bottom-e.bottom,s=r.y<=e.y;return y.some(oO.fixed(Qu("fixed",y.some(i),s?y.some(a):y.none(),y.none(),s?y.none():y.some(u))))},fO=function(t,e,n){var r=t.element();return Mi(r,"position").is("fixed")?function(t,e,n){return sO(t,n).filter((function(t){return uO(n.getModes(),t,e)})).bind((function(e){return cO(t,e,n)}))}(r,e,n):lO(r,e,n)},dO=function(t,e){j(["left","right","top","bottom","position"],(function(e){return Hi(t.element(),e)})),e.onUndocked(t)},mO=function(t,e,n){Zu(t.element(),n),("fixed"===n.position()?e.onDocked:e.onUndocked)(t)},hO=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var a=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);a!==n.isVisible()&&(n.setVisible(a),o&&!a?(vi(t.element(),[e.fadeOutClass]),e.onHide(t)):(a?iO:aO)(t,e))}))}))},pO=function(t,e,r){var o=t.element();r.setDocked(!1),function(t,e){var n=t.element();return sO(n,e).bind((function(t){return cO(n,t,e)}))}(t,r).each((function(r){r.fold((function(){return dO(t,e)}),(function(n){return mO(t,e,n)}),n)})),r.setVisible(!0),e.contextual.each((function(e){bi(o,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),gO(t,e,r)},gO=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&hO(t,e,n,r),fO(t,r,n).each((function(i){n.setDocked(!o),i.fold((function(){return dO(t,e)}),(function(n){return mO(t,e,n)}),(function(o){hO(t,e,n,r,!0),mO(t,e,o)}))}))}(t,e,n)},vO=function(t,e,n){n.isDocked()&&pO(t,e,n)},bO=Object.freeze({__proto__:null,refresh:gO,reset:vO,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),yO=Object.freeze({__proto__:null,events:function(t,e){return Lr([Yr(rr(),(function(n,r){t.contextual.each((function(t){gi(n.element(),t.transitionClass)&&(bi(n.element(),[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n));r.stop()}))})),jr(yr(),(function(n,r){gO(n,t,e)})),jr(xr(),(function(n,r){vO(n,t,e)}))])}}),xO=[Ke("contextual",[Fe("fadeInClass"),Fe("fadeOutClass"),Fe("transitionClass"),je("lazyContext"),Ja("onShow"),Ja("onShown"),Ja("onHide"),Ja("onHidden")]),nn("lazyViewport",Ta),function(t,e,n){return Je(t,e,ue(n))}("modes",["top","bottom"],Ee),Ja("onDocked"),Ja("onUndocked")],wO=Object.freeze({__proto__:null,init:function(t){var e=an(!1),n=an(!0),r=an(y.none()),o=an(t.modes);return Qo({isDocked:e.get,setDocked:e.set,getInitialPosition:r.get,setInitialPosition:r.set,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}}),CO=ju({fields:xO,name:"docking",active:yO,apis:bO,state:wO}),_O={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},kO=function(t){var e=t.element();so(e).each((function(n){var r="padding-"+CO.getModes(t)[0];if(CO.isDocked(t)){var o=fa(n);Ai(e,"width",o+"px"),Ai(n,r,function(t){return oa(t)+(parseInt(Pi(t,"margin-top"),10)||0)+(parseInt(Pi(t,"margin-bottom"),10)||0)}(e)+"px")}else Hi(e,"width"),Hi(n,r)}))},SO=function(t,e){e?(pi(t,_O.fadeOutClass),vi(t,[_O.transitionClass,_O.fadeInClass])):(pi(t,_O.fadeInClass),vi(t,[_O.fadeOutClass,_O.transitionClass]))},TO=function(t,e){var n=sn.fromDom(t.getContainer());e?(mi(n,"tox-tinymce--toolbar-sticky-on"),pi(n,"tox-tinymce--toolbar-sticky-off")):(mi(n,"tox-tinymce--toolbar-sticky-off"),pi(n,"tox-tinymce--toolbar-sticky-on"))},DO=function(t,e){var n,r=an(y.none()),o=e.getSink,i=function(t){o().each((function(e){return t(e.element())}))},a=function(e){t.inline||kO(e),TO(t,CO.isDocked(e)),e.getSystem().broadcastOn([Zc()],{}),o().each((function(t){return t.getSystem().broadcastOn([Zc()],{})}))},u=t.inline?[]:[$u.config({channels:(n={},n[dT()]={onReceive:kO},n)})];return h([Mm.config({}),CO.config({contextual:d({lazyContext:function(e){var n,r,o=oa(e.element()),i=t.inline?t.getContentAreaContainer():t.getContainer(),a=ka(sn.fromDom(i)),u=a.height-o,s=a.y+(n=e,r="top",I(CO.getModes(n),r)?0:o);return y.some(_a(a.x,s,a.width,u))},onShow:function(){i((function(t){return SO(t,!0)}))},onShown:function(t){i((function(t){return bi(t,[_O.transitionClass,_O.fadeInClass])})),r.get().each((function(e){var n,o,i;n=t.element(),i=oo(o=e),Ku(i).filter((function(t){return!Rn(o,t)})).filter((function(t){return Rn(t,sn.fromDom(i.dom().body))||Pn(n,t)})).each((function(){return Gu(o)})),r.set(y.none())}))},onHide:function(t){r.set(function(t,e){return Xu(t).orThunk((function(){return e().toOption().bind((function(t){return Xu(t.element())}))}))}(t.element(),o)),i((function(t){return SO(t,!1)}))},onHidden:function(){i((function(t){return bi(t,[_O.transitionClass])}))}},_O),modes:[e.header.getDockingMode()],onDocked:a,onUndocked:a})],u)},OO=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(CO.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(kO)})),t.on("SkinLoaded",(function(){n().each((function(t){CO.isDocked(t)?CO.reset(t):CO.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(CO.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){CO.refresh(e);var n=e.element();yd(n)&&function(t,e){var n=oo(e),r=n.dom().defaultView.innerHeight,o=ga(n),i=sn.fromDom(t.elm),a=Sa(i),u=ra(i),s=a.y,c=s+u,l=sa(e),f=ra(e),d=l.top(),m=d+f,h=Math.abs(d-o.top())<2,p=Math.abs(m-(o.top()+r))<2;if(h&&s<m)va(o.left(),s-f,n);else if(p&&c>d){var g=s-r+u+f;va(o.left(),g,n)}}(t,n)}))})),t.on("PostRender",(function(){TO(t,!1)}))},isDocked:function(t){return t().map(CO.isDocked).getOr(!1)},getBehaviours:DO}),EO=n,NO=c,AO=o([]),RO=Object.freeze({__proto__:null,setup:EO,isDocked:NO,getBehaviours:AO}),BO=Cf({factory:function(t,e){var n={focus:Sm.focusIn,setMenus:function(t,n){var r=H(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=ST(n).mapError((function(t){return _e(t)})).getOrDie();return s_(r,"tox-mbtn",e.backstage,y.some("menuitem"))}));Nm.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:Fu([Nm.config({}),Am("menubar-events",[Gr((function(e){t.onSetup(e)})),jr(Kn(),(function(t,e){Ba(t.element(),".tox-mbtn--active").each((function(n){Pa(e.event().target(),".tox-mbtn").each((function(e){Rn(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){Ly.expand(t),Ly.close(n),Mm.focus(t)}))}))}))}))})),jr(Sr(),(function(t,e){e.event().prevFocus().bind((function(e){return t.getSystem().getByDom(e).toOption()})).each((function(n){e.event().newFocus().bind((function(e){return t.getSystem().getByDom(e).toOption()})).each((function(t){Ly.isOpen(n)&&(Ly.expand(t),Ly.close(n))}))}))}))]),Sm.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),y.some(!0)}}),Pb.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Ie("dom"),Ie("uid"),Ie("onEscape"),Ie("backstage"),Xe("onSetup",n)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),PO=[bl("slotBehaviours",[])],IO=function(t){return"<alloy.field."+t+">"},MO=function(t,e){var n,r=function(e){return ff(t)},o=function(e,n){return function(r,o){return uf(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==So(t.element(),"aria-hidden")},a=o(i,!1),u=o((function(t,e){if(i(t)){var n=t.element();Ai(n,"display","none"),ko(n,"aria-hidden","true"),Rr(t,Tr(),{name:e,visible:!1})}})),s=(n=u,function(t,e){j(e,(function(e){return n(t,e)}))}),c=o((function(t,e){if(!i(t)){var n=t.element();Hi(n,"display"),Oo(n,"aria-hidden"),Rr(t,Tr(),{name:e,visible:!0})}})),l={getSlotNames:r,getSlot:function(e,n){return uf(e,t,n)},isShowing:a,hideSlot:u,hideAllSlots:function(t){return s(t,r())},showSlot:c};return{uid:t.uid,dom:t.dom,components:e,behaviours:yl(t.slotBehaviours),apis:l}},LO=wt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return Xo(t)})),FO=d(d({},LO),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),ef("container",IO(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=H(r,(function(t){return $l({name:t,pname:IO(t)})}));return vf("container",PO,o,MO,n)}}),HO=ae([Ye("icon"),Ye("tooltip"),nn("onShow",n),nn("onHide",n),nn("onSetup",(function(){return n}))]),jO=function(t){return{element:function(){return t.element().dom()}}},VO=function(t,e){var r=H(bt(e),(function(t){var n=e[t],r=we(function(t){return xe("sidebar",HO,t)}(n));return{name:t,getApi:jO,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return H(r,(function(e){var o=an(n);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Ip([Hg(e,o),jg(e,o),jr(Tr(),(function(t,e){var n=e.event();q(r,(function(t){return t.name===n.name()})).each((function(e){(n.visible()?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},zO=function(t){return FO.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:VO(e,t),slotBehaviours:Ip([Gr((function(t){return FO.hideAllSlots(t)}))])}}))},UO=function(t){return Of.getCurrent(t).bind((function(t){return uT.isGrowing(t)||uT.hasGrown(t)?Of.getCurrent(t).bind((function(t){return q(FO.getSlotNames(t),(function(e){return FO.isShowing(t,e)}))})):y.none()}))},WO=Io("FixSizeEvent"),qO=Io("AutoSizeEvent"),$O=function(t){var e=sn.fromHtml(t),n=lo(e),r=function(t){var e=void 0!==t.dom().attributes?t.dom().attributes:[];return W(e,(function(t,e){var n;return"class"===e.name?t:d(d({},t),((n={})[e.name]=e.value,n))}),{})}(e),o=function(t){return Array.prototype.slice.call(t.dom().classList,0)}(e),i=0===n.length?{}:{innerHtml:wo(e)};return d({tag:Qr(e),classes:o,attributes:r},i)},YO=function(t){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:$O('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:Fu([Sm.config({mode:"special",onTab:function(){return y.some(!0)},onShiftTab:function(){return y.some(!0)}}),Mm.config({})])}},GO=function(t,e,n){var r=an(!1),o=an(y.none()),i=function(t){t!==r.get()&&(!function(t,e,n){var r=t.element();!0===e?(Nm.set(t,[YO(n)]),Hi(r,"display"),Oo(r,"aria-hidden")):(Nm.set(t,[]),Ai(r,"display","none"),ko(r,"aria-hidden","true"))}(e(),t,n.providers),r.set(t))};t.on("ProgressState",(function(e){if(o.get().each(Oh.clearTimeout),E(e.time)){var n=Oh.setEditorTimeout(t,(function(){return i(e.state)}),e.time);o.set(y.some(n))}else i(e.state),o.set(y.none())}))},KO=XD.optional({factory:BO,name:"menubar",schema:[Ie("backstage")]}),XO=XD.optional({factory:{sketch:function(t){return eO.sketch({uid:t.uid,dom:t.dom,listBehaviours:Fu([Sm.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return yT({type:t.type,uid:Io("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return y.none()}})},setupItem:function(t,e,n,r){DS.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Ie("dom"),Ie("onEscape")]}),JO=XD.optional({factory:{sketch:function(t){return function(t){return t.type===ap.sliding?bT:t.type===ap.floating?vT:yT}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),y.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[Ie("dom"),Ie("onEscape"),Ie("getSink")]}),QO=XD.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?DO:AO;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:Fu(n(e,t.sharedBackstage))}}},name:"header",schema:[Ie("dom")]}),ZO=XD.optional({name:"socket",schema:[Ie("dom")]}),tE=XD.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:Fu([Pb.config({}),Mm.config({}),uT.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){Of.getCurrent(t).each(FO.hideAllSlots),Ar(t,qO)},onGrown:function(t){Ar(t,qO)},onStartGrow:function(t){Rr(t,WO,{width:Mi(t.element(),"width").getOr("")})},onStartShrink:function(t){Rr(t,WO,{width:fa(t.element())+"px"})}}),Nm.config({}),Of.config({find:function(t){var e=Nm.contents(t);return Z(e)}})])}],behaviours:Fu([jw(0),Am("sidebar-sliding-events",[jr(WO,(function(t,e){Ai(t.element(),"width",e.event().width())})),jr(qO,(function(t,e){Hi(t.element(),"width")}))])])}}},name:"sidebar",schema:[Ie("dom")]}),eE=XD.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:Fu([Nm.config({})]),components:[]}}},name:"throbber",schema:[Ie("dom")]}),nE=_f({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return KD.getPart(e,t,"socket")},setSidebar:function(e,n){KD.getPart(e,t,"sidebar").each((function(t){return function(t,e){Of.getCurrent(t).each((function(t){return Nm.set(t,[zO(e)])}))}(t,n)}))},toggleSidebar:function(e,n){KD.getPart(e,t,"sidebar").each((function(t){return function(t,e){Of.getCurrent(t).each((function(t){Of.getCurrent(t).each((function(n){uT.hasGrown(t)?FO.isShowing(n,e)?uT.shrink(t):(FO.hideAllSlots(n),FO.showSlot(n,e)):(FO.hideAllSlots(n),FO.showSlot(n,e),uT.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return KD.getPart(e,t,"sidebar").bind(UO).getOrNull()},getHeader:function(e){return KD.getPart(e,t,"header")},getToolbar:function(e){return KD.getPart(e,t,"toolbar")},setToolbar:function(e,n){KD.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){KD.getPart(e,t,"multiple-toolbar").each((function(t){eO.setItems(t,n)}))},refreshToolbar:function(e){KD.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},getThrobber:function(e){return KD.getPart(e,t,"throbber")},focusToolbar:function(e){KD.getPart(e,t,"toolbar").orThunk((function(){return KD.getPart(e,t,"multiple-toolbar")})).each((function(t){Sm.focusIn(t)}))},setMenubar:function(e,n){KD.getPart(e,t,"menubar").each((function(t){BO.setMenus(t,n)}))},focusMenubar:function(e){KD.getPart(e,t,"menubar").each((function(t){BO.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[Ie("dom"),Ie("behaviours")],partFields:[QO,KO,JO,XO,ZO,tE,eE],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=H(n,(function(t){return hT(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=H(n,(function(t){return H(t,hT)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),rE={file:{title:"File",items:"newdocument restoredraft | preview | print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},oE=function(t){return"string"==typeof t?t.split(" "):t},iE=function(t,e){var n=d(d({},rE),e.menus),r=bt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?oE("file edit view insert format tools table help"):oE(!1===e.menubar?"":e.menubar),i=z(o,(function(t){return r&&e.menus.hasOwnProperty(t)&&e.menus[t].hasOwnProperty("items")||rE.hasOwnProperty(t)})),a=H(i,(function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return G(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||M(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:oE(o.items)},e,t)}));return z(a,(function(t){return t.getItems().length>0&&M(t.getItems(),(function(t){return"separator"!==t.type}))}))},aE=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},uE=function(t,e){var n,r=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):ag.baseURL+"/skins/ui/"+r}return n}(e);r&&(n=r+"/skin.min.css",e.contentCSS.push(r+(t?"/content.inline":"/content")+".min.css")),!1===function(t){return!1===t.getParam("skin")}(e)&&n?e.ui.styleSheetLoader.load(n,aE(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:e})}}(e,"Skin could not be loaded")):aE(e)()},sE=a(uE,!1),cE=a(uE,!0),lE=function(t,e,n,r){var o=e.outerContainer,i=n.toolbar,a=n.buttons;if(N(i,C)){var u=i.map((function(e){var o={toolbar:e,buttons:a,allowToolbarGroups:n.allowToolbarGroups};return UD(t,o,{backstage:r},y.none())}));nE.setToolbars(o,u)}else nE.setToolbar(o,UD(t,n,{backstage:r},y.none()))},fE=Wp.DOM,dE=En(),mE=dE.os.isiOS()&&dE.os.version.major<=12,hE=Object.freeze({__proto__:null,render:function(t,n,r,o,i){var a=an(0);sE(t);var u,s=sn.fromDom(i.targetNode),c=(u=_i(s),xi(u)?u:sn.fromDom(io(u).dom().body));!function(t,e){jc(t,e,ho)}(s,n.mothership),Hc(c,n.uiMothership),t.on("PostRender",(function(){lE(t,n,r,o),a.set(t.getWin().innerWidth),nE.setMenubar(n.outerContainer,iE(t,r)),nE.setSidebar(n.outerContainer,r.sidebar),function(t){var e=t.getWin(),n=t.getDoc().documentElement,r=an(aa(e.innerWidth,e.innerHeight)),o=an(aa(n.offsetWidth,n.offsetHeight)),i=function(n){var o=r.get();o.left()===e.innerWidth&&o.top()===e.innerHeight||(r.set(aa(e.innerWidth,e.innerHeight)),Nv(t,n))},a=function(e){var n=t.getDoc().documentElement,r=o.get();r.left()===n.offsetWidth&&r.top()===n.offsetHeight||(o.set(aa(n.offsetWidth,n.offsetHeight)),Nv(t,e))},u=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};fE.bind(e,"resize",i),fE.bind(e,"scroll",u);var s=lb(sn.fromDom(t.getBody()),"load",a);t.on("NodeChange",a),t.on("remove",(function(){s.unbind(),fE.unbind(e,"resize",i),fE.unbind(e,"scroll",u)}))}(t)}));var l,f,d,m=nE.getSocket(n.outerContainer).getOrDie("Could not find expected socket element");if(!0===mE){Ri(m.element(),{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var h=(l=function(){t.fire("ScrollContent")},f=20,d=null,{cancel:function(){null!==d&&(e.clearTimeout(d),d=null)},throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null===d&&(d=e.setTimeout((function(){l.apply(null,t),d=null}),f))}});cb(m.element(),"scroll",h.throttle)}Rg(t,n),t.addCommand("ToggleSidebar",(function(e,r){nE.toggleSidebar(n.outerContainer,r),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return nE.whichSidebar(n.outerContainer)}));var p=bg(t);return p!==ap.sliding&&p!==ap.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var e=t.getWin().innerWidth;e!==a.get()&&(nE.refreshToolbar(n.outerContainer),a.set(e))})),{iframeContainer:m.element().dom(),editorContainer:n.outerContainer.element().dom()}}}),pE=function(){return function(t){var e=an(y.none()),n=function(){e.get().each(t)};return{clear:function(){n(),e.set(y.none())},isSet:function(){return e.get().isSome()},set:function(t){n(),e.set(y.some(t))}}}((function(t){t.unbind()}))},gE=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?y.some(parseInt(""+t,10)):y.none()},vE=function(t){return E(t)?t+"px":t},bE=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},yE=function(t){return function(t){var e=ug(t),n=lg(t),r=dg(t);return gE(e).map((function(t){return bE(t,n,r)}))}(t).getOr(ug(t))},xE=function(t){var e=sg(t),n=cg(t),r=fg(t);return gE(e).map((function(t){return bE(t,n,r)}))},wE=function(t,e,n,r,o){var i=n.uiMothership,a=n.outerContainer,u=Wp.DOM,s=_g(t),c=Sg(t),l=fg(t).or(xE(t)),f=r.shared.header,d=f.isPositionedAtTop,m=bg(t),h=m===ap.sliding||m===ap.floating,p=an(!1),g=function(){return p.get()&&!t.removed},v=function(t){return h?t.fold((function(){return 0}),(function(t){return t.components().length>1?ra(t.components()[1].element()):0})):0},b=function(){i.broadcastOn([Zc()],{})},y=function(t){if(void 0===t&&(t=!1),g()){var n;if(s||(n=l.getOrThunk((function(){var t=gE(Pi(Di(),"margin-left")).getOr(0);return fa(Di())-sa(e).left()+t})),Ai(o.get().element(),"max-width",n+"px")),h&&nE.refreshToolbar(a),s||function(){var t=nE.getToolbar(a),n=v(t),r=ka(e),i=d()?Math.max(r.y-ra(o.get().element())+n,0):r.bottom;Ri(a.element(),{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),c){var r=o.get();t?CO.reset(r):CO.refresh(r)}b()}},x=function(n){if(void 0===n&&(n=!0),!s&&c&&g()){var r=f.getDockingMode(),i=function(n){switch(xg(t)){case vg.auto:var r=nE.getToolbar(a),o=v(r),i=ra(n.element())-o,u=ka(e);if(u.y>i)return"top";var s=ao(e),c=Math.max(s.dom().scrollHeight,ra(s));return u.bottom<c-i||Ta().bottom<u.bottom-i?"bottom":"top";case vg.bottom:return"bottom";case vg.top:default:return"top"}}(o.get());i!==r&&(!function(t){var e=o.get();CO.setModes(e,[t]),f.setDockingMode(t);var n=d()?Fa.TopToBottom:Fa.BottomToTop;ko(e.element(),ks,n)}(i),n&&y(!0))}};return{isVisible:g,isPositionedAtTop:d,show:function(){p.set(!0),Ai(a.element(),"display","flex"),u.addClass(t.getBody(),"mce-edit-focus"),Hi(i.element(),"display"),x(!1),y()},hide:function(){p.set(!1),n.outerContainer&&(Ai(a.element(),"display","none"),u.removeClass(t.getBody(),"mce-edit-focus")),Ai(i.element(),"display","none")},update:y,updateMode:x,repositionPopups:b}},CE=function(t,e){var n=ka(t);return{pos:e?n.y:n.bottom,bounds:n}},_E=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,a=e.uiMothership,u=e.outerContainer,s=an(null),c=sn.fromDom(o.targetNode),l=wE(t,c,e,r,s);cE(t);var f=function(){if(s.get())l.show();else{s.set(nE.getHeader(u).getOrDie());var o=function(t){return Cg(t).getOr(Di())}(t);Hc(o,i),Hc(o,a),lE(t,e,n,r),nE.setMenubar(u,iE(t,n)),l.show(),function(t,e,n){var r=an(CE(e,n.isPositionedAtTop())),o=function(o){var i=CE(e,n.isPositionedAtTop()),a=i.pos,u=i.bounds,s=r.get(),c=s.pos,l=s.bounds,f=u.height!==l.height||u.width!==l.width;r.set({pos:a,bounds:u}),f&&Nv(t,o),n.isVisible()&&(c!==a?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};t.on("activate",n.show),t.on("deactivate",n.hide),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){Oh.requestAnimationFrame((function(){return o(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var i=pE();i.set(lb(sn.fromDom(t.getBody()),"load",o)),t.on("remove",(function(){i.clear()}))}(t,c,l),t.nodeChanged()}};return t.on("focus",f),t.on("blur hide",l.hide),t.on("init",(function(){t.hasFocus()&&f()})),Rg(t,e),{editorContainer:u.element().dom()}}}),kE=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},SE=function(t){!function(t){M_.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:BD(t,e.name),onAction:kE(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:BD(t,n),onAction:kE(t,n)})}}(t),function(t){M_.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)}})}))}(t),function(t){M_.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)},onSetup:BD(t,e.name)})}))}(t)},TE=function(t){SE(t),function(t){M_.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:function(){return t.execCommand(e.action)}})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:kE(t,"code")})}(t)},DE=function(t,e,n){var r=function(){return!!e.undoManager&&e.undoManager[n]()},o=function(){t.setDisabled(e.mode.isReadOnly()||!r())};return t.setDisabled(!r()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o),function(){return e.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o)}},OE=function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(e){return DE(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(e){return DE(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(e){return DE(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(e){return DE(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t)},EE=function(t,e){!function(t,e){var n=yD(0,e,kD(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=yD(0,e,DD(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=d({type:"advanced"},e.styleselect),r=yD(0,e,MD(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=yD(0,e,ID(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=yD(0,e,ND(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)},NE=function(t,e){!function(t){M_.each([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,onAction:function(){return t.execCommand(e.cmd)},icon:e.icon,onSetup:BD(t,e.name)})}));var e="alignnone",n="No alignment",r="JustifyNone",o="align-none";t.ui.registry.addButton(e,{tooltip:n,onAction:function(){return t.execCommand(r)},icon:o})}(t),TE(t),EE(t,e),OE(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",(function(e,n){!function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))}(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){!function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))}(t,e)}))}(t);var e=an(null),n=an(null);Uv(t,"forecolor","forecolor","Text color",e),Uv(t,"backcolor","hilitecolor","Background color",n),Wv(t,"forecolor","forecolor","Text color"),Wv(t,"backcolor","hilitecolor","Background color")}(t),function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return t.execCommand("mceToggleVisualAid")}})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(e){return function(t,e){t.setActive(e.hasVisual);var n=function(e){t.setActive(e.hasVisual)};return e.on("VisualAid",n),function(){return e.off("VisualAid",n)}}(e,t)},onAction:function(){t.execCommand("mceToggleVisualAid")}})}(t)}(t),function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(e){return function(t,e){t.setDisabled(!e.queryCommandState("outdent"));var n=function(){t.setDisabled(!e.queryCommandState("outdent"))};return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}(e,t)},onAction:function(){return t.execCommand("outdent")}}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return t.execCommand("indent")}})}(t)}(t)},AE=function(t,e){return{anchor:"makeshift",x:t,y:e}},RE=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},BE=function(t,e){var n=Wp.DOM.getPos(t);return function(t,e,n){return AE(t.x+e,t.y+n)}(e,n.x,n.y)},PE=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(RE(t)){var e=t.touches[0];return AE(e.pageX,e.pageY)}return AE(t.pageX,t.pageY)}(e):BE(t.getContentAreaContainer(),function(t){if(RE(t)){var e=t.touches[0];return AE(e.clientX,e.clientY)}return AE(t.clientX,t.clientY)}(e)):IE(t)},IE=function(t){return{anchor:"selection",root:sn.fromDom(t.selection.getNode())}},ME=function(t){return{anchor:"node",node:y.some(sn.fromDom(t.selection.getNode())),root:sn.fromDom(t.getBody())}},LE=function(t,e,n,r,o,i){var a=n(),u=function(t,e,n){return n?ME(t):PE(t,e)}(t,e,i);a_(a,up.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),gh.showMenuAt(o,u,{menu:{markers:gp("normal")},data:t})}))},FE={onLtr:function(){return[Tu,wu,Cu,_u,ku,Su,Th,Dh,kh,Ch,Sh,_h]},onRtl:function(){return[Tu,Cu,wu,ku,_u,Su,Th,Dh,Sh,_h,kh,Ch]}},HE={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},jE=function(t,e,n,r,o,i,a){var u=function(t,e,n){var r=e?ME(t):PE(t,n);return d({bubble:xs(0,12,HE),layouts:FE,overrides:{maxWidthFunction:wS(),maxHeightFunction:gs()}},r)}(t,i,e);a_(n,up.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),gh.showMenuWithinBounds(o,u,{menu:{markers:gp("normal"),highlightImmediately:a},data:n,type:"horizontal"},(function(){return y.some(lD(t,r.shared))})),t.fire("contexttoolbar-hide")}))},VE=function(t,e,n,r,o,i){var a=En(),u=a.os.isiOS(),s=a.os.isOSX(),c=a.os.isAndroid(),l=a.deviceType.isTouch(),f=function(){var a=n();jE(t,e,a,r,o,i,!(c||u||s&&l))};if(!s&&!u||i)c&&!i&&t.selection.setCursorLocation(e.target,0),f();else{var d=function(){!function(t){var e=t.selection.getRng(),n=function(){Oh.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),f()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return Ks(t.getWin(),Ps.domRange(o)).exists((function(t){return t.left()<=r.clientX&&t.right()>=r.clientX&&t.top()<=r.clientY&&t.bottom()>=r.clientY}))}(t,e)?(t.once("selectionchange",d),t.once("touchend",(function(){return t.off("selectionchange",d)}))):d()}},zE=function(t){return"string"==typeof t?t.split(/[ ,]/):t},UE=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},WE=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return y.from(t.getParam(e)).map(zE).getOrThunk((function(){return z(zE(n),(function(t){return Ot(r,t)}))}))}(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},qE=function(t){return C(t)?"|"===t:"separator"===t.type},$E={type:"separator"},YE=function(t){if(C(t))return t;switch(t.type){case"separator":return $E;case"submenu":return{type:"nestedmenuitem",text:t.text,icon:t.icon,getSubmenuItems:function(){var e=t.getSubmenuItems();return C(e)?e:H(e,YE)}};default:return{type:"menuitem",text:t.text,icon:t.icon,onAction:(e=t.onAction,function(){return e()})}}var e},GE=function(t,e){if(0===e.length)return t;var n=tt(t).filter((function(t){return!qE(t)})).fold((function(){return[]}),(function(t){return[$E]}));return t.concat(n).concat(e).concat([$E])},KE=function(t,e,n){var r=En().deviceType.isTouch,o=Zi(gh.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:Fu([Am("dismissContextMenu",[jr(_r(),(function(e,n){Jc.close(e),t.focus()}))])])})),i=function(t){return gh.hide(o)},a=function(e){if(UE(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!UE(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var i=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)}(t,e);(r()?VE:LE)(t,e,(function(){var n=i?t.selection.getStart(!0):e.target,r=t.ui.registry.getAll(),o=WE(t);return function(t,e,n){var r=W(e,(function(e,r){if(Ot(t,r)){var o=t[r].update(n);if(C(o))return GE(e,o.split(" "));if(o.length>0){var i=H(o,YE);return GE(e,i)}return e}return e.concat([r])}),[]);return r.length>0&&qE(r[r.length-1])&&r.pop(),r}(r.contextMenus,o,n)}),n,o,i)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");t.on(e,i),t.on("longpress contextmenu",a)}))},XE=Nt([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),JE=function(t){return function(e){return e.translate(-t.left(),-t.top())}},QE=function(t){return function(e){return e.translate(t.left(),t.top())}},ZE=function(t){return function(e,n){return W(t,(function(t,e){return e(t)}),aa(e,n))}},tN=function(t,e,n){return t.fold(ZE([QE(n),JE(e)]),ZE([JE(e)]),ZE([]))},eN=function(t,e,n){return t.fold(ZE([QE(n)]),ZE([]),ZE([QE(e)]))},nN=function(t,e,n){return t.fold(ZE([]),ZE([JE(n)]),ZE([QE(e),JE(n)]))},rN=function(t,e,n){var r=t.fold((function(t,e){return{position:y.some("absolute"),left:y.some(t+"px"),top:y.some(e+"px")}}),(function(t,e){return{position:y.some("absolute"),left:y.some(t-n.left()+"px"),top:y.some(e-n.top()+"px")}}),(function(t,e){return{position:y.some("fixed"),left:y.some(t+"px"),top:y.some(e+"px")}}));return d({right:y.none(),bottom:y.none()},r)},oN=function(t,e,n,r){var o=function(t,o){return function(i,a){var u=t(e,n,r);return o(i.getOr(u.left()),a.getOr(u.top()))}};return t.fold(o(nN,iN),o(eN,aN),o(tN,uN))},iN=XE.offset,aN=XE.absolute,uN=XE.fixed,sN=function(t,e){var n=So(t,e);return T(n)?NaN:parseInt(n,10)},cN=function(t,e,n,r){return function(t,e){var n=t.element(),r=sN(n,e.leftAttr),o=sN(n,e.topAttr);return isNaN(r)||isNaN(o)?y.none():y.some(aa(r,o))}(t,e).fold((function(){return n}),(function(t){return uN(t.left()+r.left(),t.top()+r.top())}))},lN=function(t,e,n,r,o,i){var a=cN(t,e,n,r),u=e.mustSnap?mN(t,e,a,o,i):hN(t,e,a,o,i),s=tN(a,o,i);return function(t,e,n){var r=t.element();ko(r,e.leftAttr,n.left()+"px"),ko(r,e.topAttr,n.top()+"px")}(t,e,s),u.fold((function(){return{coord:uN(s.left(),s.top()),extra:y.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},fN=function(t,e){!function(t,e){var n=t.element();Oo(n,e.leftAttr),Oo(n,e.topAttr)}(t,e)},dN=function(t,e,n,r){return nt(t,(function(t){var o=t.sensor;return function(t,e,n,r,o,i){var a=eN(t,o,i),u=eN(e,o,i);return Math.abs(a.left()-u.left())<=n&&Math.abs(a.top()-u.top())<=r}(e,o,t.range.left(),t.range.top(),n,r)?y.some({output:oN(t.output,e,n,r),extra:t.extra}):y.none()}))},mN=function(t,e,n,r,o){var i=e.getSnapPoints(t);return dN(i,n,r,o).orThunk((function(){return W(i,(function(t,e){var i=e.sensor,a=function(t,e,n,r,o,i){var a=eN(t,o,i),u=eN(e,o,i),s=Math.abs(a.left()-u.left()),c=Math.abs(a.top()-u.top());return aa(s,c)}(n,i,e.range.left(),e.range.top(),r,o);return t.deltas.fold((function(){return{deltas:y.some(a),snap:y.some(e)}}),(function(n){return(a.left()+a.top())/2<=(n.left()+n.top())/2?{deltas:y.some(a),snap:y.some(e)}:t}))}),{deltas:y.none(),snap:y.none()}).snap.map((function(t){return{output:oN(t.output,n,r,o),extra:t.extra}}))}))},hN=function(t,e,n,r,o){var i=e.getSnapPoints(t);return dN(i,n,r,o)},pN=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element());if(e.repositionTarget){var i=oo(t.element()),a=ga(i),u=rO(o),s=function(t,e,n){return{coord:oN(t.output,t.output,e,n),extra:t.extra}}(r,a,u),c=rN(s.coord,0,u);Bi(o,c)}}}),gN=function(t,e){t.getSystem().addToGui(e),function(t){so(t.element()).filter(to).each((function(e){Mi(e,"z-index").each((function(t){ko(e,"data-initial-z-index",t)})),Ai(e,"z-index",Pi(t.element(),"z-index"))}))}(e)},vN=function(t){!function(t){so(t.element()).filter(to).each((function(t){To(t,"data-initial-z-index").fold((function(){return Hi(t,"z-index")}),(function(e){return Ai(t,"z-index",e)})),Oo(t,"data-initial-z-index")}))}(t),t.getSystem().removeFromGui(t)},bN=function(t,e,n){return t.getSystem().build(Db.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},yN=Ke("snaps",[Ie("getSnapPoints"),Ja("onSensor"),Ie("leftAttr"),Ie("topAttr"),Xe("lazyViewport",Ta),Xe("mustSnap",!1)]),xN=[Xe("useFixed",c),Ie("blockerClass"),Xe("getTarget",i),Xe("onDrag",n),Xe("repositionTarget",!0),Xe("onDrop",n),nn("getBounds",Ta),yN],wN=function(t){return(e=Mi(t,"left"),n=Mi(t,"top"),r=Mi(t,"position"),o=function(t,e,n){return("fixed"===n?uN:iN)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?y.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):y.none()).getOrThunk((function(){var e=sa(t);return aN(e.left(),e.top())}));var e,n,r,o},CN=function(t,e,n,r,o,i,a){return function(t,e,n,r,o){var i=o.bounds,a=eN(e,n,r),u=cs(a.left(),i.x,i.x+i.width-o.width),s=cs(a.top(),i.y,i.y+i.height-o.height),c=aN(u,s);return e.fold((function(){var t=nN(c,n,r);return iN(t.left(),t.top())}),(function(){return c}),(function(){var t=tN(c,n,r);return uN(t.left(),t.top())}))}(0,e.fold((function(){var t,e,a,u=(t=n,e=i.left(),a=i.top(),t.fold((function(t,n){return iN(t+e,n+a)}),(function(t,n){return aN(t+e,n+a)}),(function(t,n){return uN(t+e,n+a)}))),s=tN(u,r,o);return uN(s.left(),s.top())}),(function(e){var a=lN(t,e,n,i,r,o);return a.extra.each((function(n){e.onSensor(t,n)})),a.coord})),r,o,a)},_N=function(t,e){return{bounds:t.getBounds(),height:oa(e.element()),width:da(e.element())}},kN=function(t,e,n,r,o){var i=n.update(r,o),a=n.getStartData().getOrThunk((function(){return _N(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element());if(e.repositionTarget){var i=oo(t.element()),a=ga(i),u=rO(o),s=wN(o),c=CN(t,e.snaps,s,a,u,r,n),l=rN(c,0,u);Bi(o,l)}e.onDrag(t,o,r)}(t,e,a,n)}))},SN=function(t,e,n,r){e.each(vN),n.snaps.each((function(e){fN(t,e)}));var o=n.getTarget(t.element());r.reset(),n.onDrop(t,o)},TN=function(t){return function(e,n){var r=function(t){n.setStartData(_N(e,t))};return Lr(h([jr(yr(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r)))}},DN=Object.freeze({__proto__:null,getData:function(t){return y.from(aa(t.x(),t.y()))},getDelta:function(t,e){return aa(e.left()-t.left(),e.top()-t.top())}}),ON=function(t,e,n){return[jr(qn(),(function(r,o){if(0===o.event().raw().button){o.stop();var i=function(){return SN(r,y.some(s),t,e)},a=mb(i,200),u={drop:i,delayDrop:a.schedule,forceDrop:i,move:function(n){a.cancel(),kN(r,t,e,DN,n)}},s=bN(r,t.blockerClass,function(t){return Lr([jr(qn(),t.forceDrop),jr(Gn(),t.drop),jr($n(),(function(e,n){t.move(n.event())})),jr(Yn(),t.delayDrop)])}(u));n(r),gN(r,s)}}))]},EN=h(xN,[eu("dragger",{handlers:TN(ON)})]),NN=Object.freeze({__proto__:null,getData:function(t){var e=t.raw().touches;return 1===e.length?function(t){var e=t[0];return y.some(aa(e.clientX,e.clientY))}(e):y.none()},getDelta:function(t,e){return aa(e.left()-t.left(),e.top()-t.top())}}),AN=function(t,e,n){var r=an(y.none());return[jr(Vn(),(function(o,i){i.stop();var a=function(){SN(o,r.get(),t,e),r.set(y.none())},u={drop:a,delayDrop:function(){},forceDrop:a,move:function(n){kN(o,t,e,NN,n)}},s=bN(o,t.blockerClass,function(t){return Lr([jr(Vn(),t.forceDrop),jr(Un(),t.drop),jr(Wn(),t.drop),jr(zn(),(function(e,n){t.move(n.event())}))])}(u));r.set(y.some(s));n(o),gN(o,s)})),jr(zn(),(function(n,r){r.stop(),kN(n,t,e,NN,r.event())})),jr(Un(),(function(n,o){o.stop(),SN(n,r.get(),t,e),r.set(y.none())})),jr(Wn(),(function(n){SN(n,r.get(),t,e),r.set(y.none())}))]},RN=EN,BN=h(xN,[eu("dragger",{handlers:TN(AN)})]),PN=h(xN,[eu("dragger",{handlers:TN((function(t,e,n){return h(ON(t,e,n),AN(t,e,n))}))})]),IN=zu({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:RN,touch:BN,mouseOrTouch:PN}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:y.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=y.none(),e=y.none(),n=o({});return Qo({readState:n,reset:function(){t=y.none(),e=y.none()},update:function(e,n){return e.getData(n).bind((function(n){return function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=y.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=y.some(t)}})}}),apis:pN}),MN=function(t,e,n,r,o,i){return t.fold((function(){return IN.snap({sensor:aN(n-20,r-20),range:aa(o,i),output:aN(y.some(n),y.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,a=t.element().dom().getBoundingClientRect();return IN.snap({sensor:aN(o,i),range:aa(40,40),output:aN(y.some(n-a.width/2),y.some(r-a.height/2)),extra:{td:e}})}))},LN=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists((function(t){return Rn(t,e)}))})(e.get(),o)||(e.set(y.some(o)),n(o))},mustSnap:!0}},FN=function(t){return Nh(Eh.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:Fu([IN.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),Hy.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},HN=function(t,e){var n=an([]),r=an([]),o=an(!1),i=an(y.none()),a=an(y.none()),u=function(t){var n=Sa(t);return MN(f.getOpt(e),t,n.x,n.y,n.width,n.height)},s=function(t){var n=Sa(t);return MN(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},c=LN((function(){return H(n.get(),(function(t){return u(t)}))}),i,(function(e){a.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),l=LN((function(){return H(r.get(),(function(t){return s(t)}))}),a,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),f=FN(c),d=FN(l),m=Zi(f.asSpec()),h=Zi(d.asSpec()),p=function(e,n,r,o){var i=r(n);IN.snapTo(e,i);!function(e,n,r,o){var i=n.dom().getBoundingClientRect();Hi(e.element(),"display");var a=uo(sn.fromDom(t.getBody())).dom().innerHeight,u=r(i),s=o(i,a);(u||s)&&Ai(e.element(),"display","none")}(e,n,(function(t){return t[o]<0}),(function(t,e){return t[o]>e}))},g=function(t){return p(m,t,u,"top")},v=function(t){return p(h,t,s,"bottom")};En().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(Pc(e,m),Pc(e,h),o.set(!0)),i.set(y.some(t.start)),a.set(y.some(t.finish)),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),g(t.start),v(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(g),a.get().each(v)})),t.on("TableSelectionClear",(function(){o.get()&&(Lc(m),Lc(h),o.set(!1)),i.set(y.none()),a.set(y.none())})))};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(wD||(wD={}));var jN=function(t,e,n){var r=sn.fromDom(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=bE(r+e.top(),lg(t),dg(t)),n===wD.Both&&(i.width=bE(o+e.left(),cg(t),fg(t))),i}(t,e,n,ra(r),fa(r));xt(o,(function(t,e){return Ai(r,e,vE(t))})),function(t){t.fire("ResizeEditor")}(t)},VN=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},zN=function(t,e,n){e.delimiter||(e.delimiter="»");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Fu([Sm.config({mode:"flow",selector:"div[role=button]"}),ig.config({disabled:n.isReadOnly}),Bg(),Pb.config({}),Nm.config({}),Am("elementPathEvents",[Gr((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return Sm.focusIn(r)})),t.on("NodeChange",(function(o){var i,a,u=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!VN(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);u.length>0?Nm.set(r,(i=H(u||[],(function(e,r){return Eh.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:Fu([Ig(n.isReadOnly),Bg()])})})),a={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},W(i.slice(1),(function(t,e){var n=t;return n.push(a),n.push(e),n}),[i[0]]))):Nm.set(r,[])}))}))])]),components:[]}},UN=function(t,e){var n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(zN(t,{},e)),yn(t.getParam("plugins","","string"),"wordcount")&&r.push(function(t,e){var n=function(t,n,r){return Nm.set(t,[Xi(e.translate(["{0} "+r,n[r]]))])};return Eh.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Fu([Ig(e.isReadOnly),Bg(),Pb.config({}),Nm.config({}),vl.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Am("wordcount-events",[Jr((function(t){var e=vl.getValue(t),r="words"===e.mode?"characters":"words";vl.setValue(t,{mode:r,count:e.count}),n(t,e.count,r)})),Gr((function(e){t.on("wordCountUpdate",(function(t){var r=vl.getValue(e).mode;vl.setValue(e,{mode:r,count:t.wordCount}),n(e,t.wordCount,r)}))}))])]),eventOrder:{"alloy.execute":["disabling","alloy.base.behaviour","wordcount-events"]}})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=qp.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var r=n(),o=function(t){var e=!yn(t.getParam("plugins","","string"),"autoresize"),n=t.getParam("resize",e);return!1===n?wD.None:"both"===n?wD.Both:wD.Vertical}(t);return o!==wD.None&&r.push(function(n){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize"),"aria-hidden":"true"},innerHtml:Rh("resize-handle",e.icons)},behaviours:Fu([IN.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){jN(t,o,n)},blockerClass:"tox-blocker"})])}}(o)),r}()}},WN=function(t){var n,r=t.inline,o=r?_E:hE,i=Sg(t)?OO:RO,a=y.none(),u=En(),s=u.browser.isIE()?["tox-platform-ie"]:[],c=u.deviceType.isTouch()?["tox-platform-touch"]:[],l=wg(t),f=qp.isRtl()?{attributes:{dir:"rtl"}}:{},m={attributes:(n={},n[ks]=l?Fa.BottomToTop:Fa.TopToBottom,n)},h=function(){return a.bind(nE.getHeader)},p=Zi({dom:d({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(s).concat(c)},f),behaviours:Fu([Ec.config({useFixed:function(){return i.isDocked(h)}})])}),g=function(){return it.value(p)},v=Nh({dom:{tag:"div",classes:["tox-anchorbar"]}}),b=function(){return a.bind((function(t){return nE.getThrobber(t)})).getOrDie("Could not find throbber element")},x=xS(p,t,(function(){return a.bind((function(t){return v.getOpt(t)})).getOrDie("Could not find a anchor bar element")})),w=nE.parts().menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:x,onEscape:function(){t.focus()}}),C=bg(t),_=nE.parts().toolbar(d({dom:{tag:"div",classes:["tox-toolbar"]},getSink:g,providers:x.shared.providers,onEscape:function(){t.focus()},type:C,lazyToolbar:function(){return a.bind((function(t){return nE.getToolbar(t)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return h().getOrDie("Could not find header element")}},m)),k=nE.parts()["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:x.shared.providers,onEscape:function(){},type:C}),S=nE.parts().socket({dom:{tag:"div",classes:["tox-edit-area"]}}),T=nE.parts().sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),D=nE.parts().throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:x}),O=t.getParam("statusbar",!0,"boolean")&&!r?y.some(UN(t,x.shared.providers)):y.none(),E={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[S,T]},N=gg(t),A=hg(t),R=mg(t),B=nE.parts().header({dom:d({tag:"div",classes:["tox-editor-header"]},m),components:Y([R?[w]:[],N?[k]:A?[_]:[],_g(t)?[]:[v.asSpec()]]),sticky:Sg(t),editor:t,sharedBackstage:x.shared}),P=Y([l?[]:[B],r?[]:[E],l?[B]:[]]),I=Y([[{dom:{tag:"div",classes:["tox-editor-container"]},components:P}],r?[]:O.toArray(),[D]]),M=kg(t),L=d(d({role:"application"},qp.isRtl()?{dir:"rtl"}:{}),M?{"aria-hidden":"true"}:{}),F=Zi(nE.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(r?["tox-tinymce-inline"]:[]).concat(l?["tox-tinymce--toolbar-bottom"]:[]).concat(c).concat(s),styles:d({visibility:"hidden"},M?{opacity:"0",border:"0"}:{}),attributes:L},components:I,behaviours:Fu([Sm.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a"})])}));a=y.some(F),t.shortcuts.add("alt+F9","focus menubar",(function(){nE.focusMenubar(F)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){nE.focusToolbar(F)}));var H=Ob(F),V=Ob(p);!function(t,n,r){var o=function(t,e){j([n,r],(function(n){n.broadcastEvent(t,e)}))},i=function(t,e){j([n,r],(function(n){n.broadcastOn([t],e)}))},a=function(t){return i(Qc(),{target:t.target()})},u=cb(sn.fromDom(e.document),"touchstart",a),s=cb(sn.fromDom(e.document),"touchmove",(function(t){return o(vr(),t)})),c=cb(sn.fromDom(e.document),"touchend",(function(t){return o(br(),t)})),l=cb(sn.fromDom(e.document),"mousedown",a),f=cb(sn.fromDom(e.document),"mouseup",(function(t){0===t.raw().button&&i(tl(),{target:t.target()})})),d=function(t){return i(Qc(),{target:sn.fromDom(t.target)})},m=function(t){0===t.button&&i(tl(),{target:sn.fromDom(t.target)})},h=function(t){return o(yr(),fb(t))},p=function(t){i(Zc(),{}),o(xr(),fb(t))},g=function(){return i(Zc(),{})};t.on("PostRender",(function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("ScrollWindow",h),t.on("ResizeWindow",p),t.on("ResizeEditor",g)})),t.on("remove",(function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("ScrollWindow",h),t.off("ResizeWindow",p),t.off("ResizeEditor",g),l.unbind(),u.unbind(),s.unbind(),c.unbind(),f.unbind()})),t.on("detach",(function(){Vc(n),Vc(r),n.destroy(),r.destroy()}))}(t,H,V);var z=function(){var e=vE(yE(t)),n=vE(function(t){return xE(t).getOr(sg(t))}(t));return t.inline||(Fi("div","width",n)&&Ai(F.element(),"width",n),Fi("div","height",e)?Ai(F.element(),"height",e):Ai(F.element(),"height","200px")),e};return{mothership:H,uiMothership:V,backstage:x,renderUI:function(){i.setup(t,x.shared,h),NE(t,x),KE(t,g,x),function(t){var e=t.ui.registry.getAll().sidebars;j(bt(e),(function(n){var r=e[n],o=function(){return y.from(t.queryCommandValue("ToggleSidebar")).is(n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))}(t),GO(t,b,x.shared),wt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,a=e.contextToolbars,u=e.sidebars,s=pg(t),c={menuItems:r,menus:Tg(t),menubar:Dg(t),toolbar:s.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:C===ap.floating,buttons:n,sidebar:u};GD(t,a,p,{backstage:x}),HN(t,p);var l=t.getElement(),f=z(),d={mothership:H,uiMothership:V,outerContainer:F},m={targetNode:l,height:f};return o.render(t,d,c,x,m)},getUi:function(){return{channels:{broadcastAll:V.broadcast,broadcastOn:V.broadcastOn,register:function(){}}}}}},qN=o([Ie("lazySink"),We("dragBlockClass"),nn("getBounds",Ta),Xe("useTabstopAt",o(!0)),Xe("eventOrder",{}),bl("modalBehaviours",[Sm]),Qa("onExecute"),tu("onEscape")]),$N={sketch:i},YN=o([Gl({name:"draghandle",overrides:function(t,e){return{behaviours:Fu([IN.config({mode:"mouse",getTarget:function(t){return Ra(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),$l({schema:[Ie("dom")],name:"title"}),$l({factory:$N,schema:[Ie("dom")],name:"close"}),$l({factory:$N,schema:[Ie("dom")],name:"body"}),Gl({factory:$N,schema:[Ie("dom")],name:"footer"}),Yl({factory:{sketch:function(t,e){return d(d({},t),{dom:e.dom,components:e.components})}},schema:[Xe("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Xe("components",[])],name:"blocker"})]),GN=_f({name:"ModalDialog",configFields:qN(),partFields:YN(),factory:function(t,e,n,r){var o=Io("alloy.dialog.busy"),a=Io("alloy.dialog.idle"),u=Fu([Sm.config({mode:"special",onTab:function(){return y.some(!0)},onShiftTab:function(){return y.some(!0)}}),Mm.config({})]),s=Io("modal-events"),c=d(d({},t.eventOrder),{"alloy.system.attached":[s].concat(t.eventOrder["alloy.system.attached"]||[])});return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){var n=t.lazySink(e).getOrDie(),i=an(y.none()),s=r.blocker(),c=n.getSystem().build(d(d({},s),{components:s.components.concat([ta(e)]),behaviours:Fu([Mm.config({}),Am("dialog-blocker-events",[Yr(Xn(),(function(){Sm.focusIn(e)})),jr(a,(function(t,n){Do(e.element(),"aria-busy")&&(Oo(e.element(),"aria-busy"),i.get().each((function(t){return Nm.remove(e,t)})))})),jr(o,(function(t,n){ko(e.element(),"aria-busy","true");var r=n.event().getBusySpec();i.get().each((function(t){Nm.remove(e,t)}));var o=r(e,u),a=t.getSystem().build(o);i.set(y.some(a)),Nm.append(e,ta(a)),a.hasConfigured(Sm)&&Sm.focusIn(a)}))])])}));Pc(n,c),Sm.focusIn(e)},hide:function(t){so(t.element()).each((function(e){t.getSystem().getByDom(e).each((function(t){Lc(t)}))}))},getBody:function(e){return sf(e,t,"body")},getFooter:function(e){return sf(e,t,"footer")},setIdle:function(t){Ar(t,a)},setBusy:function(t,e){Rr(t,o,{getBusySpec:e})}},eventOrder:c,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:xl(t.modalBehaviours,[Nm.config({}),Sm.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),Am(s,[Gr((function(e){var n,r,o,a,u,s;n=e.element(),r=sf(e,t,"title").element(),o=y.from(So(n,"id")).fold((function(){var t=Io("dialog-label");return ko(r,"id",t),t}),i),ko(n,"aria-labelledby",o),a=e.element(),u=sf(e,t,"body").element(),s=y.from(So(a,"id")).fold((function(){var t=Io("dialog-describe");return ko(u,"id",t),t}),i),ko(a,"aria-describedby",s)}))])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),KN=ae([Fe("type"),Fe("name")].concat(Dp)),XN=Ne,JN=[de("name","name",Vt((function(){return Io("button-name")})),Ee),Ye("icon"),tn("align","end",["start","end"]),en("primary",!1),en("disabled",!1)],QN=h(JN,[Fe("text")]),ZN=h([He("type",["submit","cancel","custom"])],QN),tA=h([He("type",["menu"]),Ye("text"),Ye("tooltip"),Ye("icon"),Ue("items",KN)],JN),eA=Se("type",{submit:ZN,cancel:ZN,custom:ZN,menu:tA}),nA=[Fe("type"),Fe("text"),He("level",["info","warn","error","success"]),Fe("icon"),Xe("url","")],rA=ae(nA),oA=[Fe("type"),Fe("text"),en("disabled",!1),en("primary",!1),de("name","name",Vt((function(){return Io("button-name")})),Ee),Ye("icon"),en("borderless",!1)],iA=ae(oA),aA=[Fe("type"),Fe("name"),Fe("label"),en("disabled",!1)],uA=ae(aA),sA=Ne,cA=[Fe("type"),Fe("name")],lA=cA.concat([Ye("label")]),fA=ae(lA),dA=Ee,mA=ae(lA),hA=Ee,pA=ae(lA),gA=ue(pe),vA=function(t){return[Fe("type"),Le("columns"),t]},bA=lA.concat([en("sandboxed",!0)]),yA=ae(bA),xA=Ee,wA=lA.concat([Ye("inputMode"),Ye("placeholder"),en("maximized",!1),en("disabled",!1)]),CA=ae(wA),_A=Ee,kA=lA.concat([ze("items",[Fe("text"),Fe("value")]),Qe("size",1),en("disabled",!1)]),SA=ae(kA),TA=Ee,DA=lA.concat([en("constrain",!0),en("disabled",!1)]),OA=ae(DA),EA=ae([Fe("width"),Fe("height")]),NA=lA.concat([Ye("placeholder"),en("maximized",!1),en("disabled",!1)]),AA=ae(NA),RA=Ee,BA=lA.concat([tn("filetype","file",["image","media","file"]),Xe("disabled",!1)]),PA=ae(BA),IA=ae([Fe("value"),Xe("meta",{})]),MA=cA.concat([Ze("tag","textarea"),Fe("scriptId"),Fe("scriptUrl"),function(t,e){return Je(t,e,Be)}("settings",void 0)]),LA=cA.concat([Ze("tag","textarea"),je("init")]),FA=be((function(t){return xe("customeditor.old",ie(LA),t).orThunk((function(){return xe("customeditor.new",ie(MA),t)}))})),HA=Ee,jA=[Fe("type"),Fe("html"),tn("presets","presentation",["presentation","document"])],VA=ae(jA),zA=lA.concat([Me("currentState",ae([Ie("blob"),Fe("url")]))]),UA=ae(zA),WA=lA.concat([Xe("columns","auto")]),qA=ae(WA),$A=ge([Fe("value"),Fe("text"),Fe("icon")]),YA=function(t){return[Fe("type"),Fe("label"),t]},GA=[Fe("type"),Ue("header",Ee),Ue("cells",ue(Ee))],KA=ae(GA),XA=function(t){return de("items","items",Ht(),ue(be((function(e){return xe("Checking item of "+t,JA,e).fold((function(t){return it.error(_e(t))}),(function(t){return it.value(t)}))}))))},JA=ve((function(){return ke("type",{alertbanner:rA,bar:ae((t=XA("bar"),[Fe("type"),t])),button:iA,checkbox:uA,colorinput:fA,colorpicker:mA,dropzone:pA,grid:ae(vA(XA("grid"))),iframe:yA,input:CA,selectbox:SA,sizeinput:OA,textarea:AA,urlinput:PA,customeditor:FA,htmlpanel:VA,imagetools:UA,collection:qA,label:ae(YA(XA("label"))),table:KA,panel:ZA});var t})),QA=[Fe("type"),Xe("classes",[]),Ue("items",JA)],ZA=ae(QA),tR=[de("name","name",Vt((function(){return Io("tab-name")})),Ee),Fe("title"),Ue("items",JA)],eR=[Fe("type"),ze("tabs",tR)],nR=ae(eR),rR=QN,oR=eA,iR=ae([Fe("title"),Me("body",ke("type",{panel:ZA,tabpanel:nR})),Ze("size","normal"),Ue("buttons",oR),Xe("initialData",{}),nn("onAction",n),nn("onChange",n),nn("onSubmit",n),nn("onClose",n),nn("onCancel",n),Xe("onTabChange",n)]),aR=function(t){return _(t)?[t].concat(G(Tt(t),aR)):k(t)?G(t,aR):[]},uR=function(t){return C(t.type)&&C(t.name)},sR={checkbox:sA,colorinput:dA,colorpicker:hA,dropzone:gA,input:_A,iframe:xA,sizeinput:EA,selectbox:TA,size:EA,textarea:RA,urlinput:IA,customeditor:HA,collection:$A,togglemenuitem:XN},cR=function(t){var e=function(t){return z(aR(t),uR)}(t),n=G(e,(function(t){return function(t){return y.from(sR[t.type])}(t).fold((function(){return[]}),(function(e){return[Me(t.name,e)]}))}));return ae(n)},lR=ae(h([He("type",["cancel","custom"])],rR)),fR=ae([Fe("title"),Fe("url"),$e("height"),$e("width"),function(t,e){return qe(t,ue(e))}("buttons",lR),nn("onAction",n),nn("onCancel",n),nn("onClose",n),nn("onMessage",n)]),dR=function(t){return{internalDialog:we(xe("dialog",iR,t)),dataValidator:cR(t),initialData:t.initialData}},mR={open:function(t,e){var n=dR(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(we(xe("dialog",fR,e)))},redial:function(t){return dR(t)}},hR=function(t){var e=[],n={};return xt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?it.error(e):it.value(n)},pR=function(t,n){var r=Nh(Aw.sketch((function(e){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:H(t.items,(function(t){return Dk(e,t,n)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[r.asSpec()]}],behaviours:Fu([Sm.config({mode:"acyclic",useTabstopAt:u(oC)}),Hw(r),Yw(r,{postprocess:function(t){return hR(t).fold((function(t){return e.console.error(t),{}}),(function(t){return t}))}})])}},gR=Cf({name:"TabButton",configFields:[Xe("uid",void 0),Ie("value"),de("dom","dom",zt((function(){return{attributes:{role:"tab",id:Io("aria"),"aria-selected":"false"}}})),Te()),We("action"),Xe("domModification",{}),bl("tabButtonBehaviours",[Mm,Sm,vl]),Ie("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Xm(t.action),behaviours:xl(t.tabButtonBehaviours,[Mm.config({}),Sm.config({mode:"execution",useSpace:!0,useEnter:!0}),vl.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),vR=o([Ie("tabs"),Ie("dom"),Xe("clickToDismiss",!1),bl("tabbarBehaviours",[Hf,Sm]),Ka(["tabClass","selectedClass"])]),bR=Kl({factory:gR,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){Hf.dehighlight(t,e),Rr(t,Or(),{tabbar:t,button:e})},r=function(t,e){Hf.highlight(t,e),Rr(t,Dr(),{tabbar:t,button:e})};return{action:function(o){var i=o.getSystem().getByUid(t.uid).getOrDie(),a=Hf.isHighlighted(i,o);(a&&t.clickToDismiss?e:a?n:r)(i,o)},domModification:{classes:[t.markers.tabClass]}}}}),yR=o([bR]),xR=_f({name:"Tabbar",configFields:vR(),partFields:yR(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:xl(t.tabbarBehaviours,[Hf.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){ko(e.element(),"aria-selected","true")},onDehighlight:function(t,e){ko(e.element(),"aria-selected","false")}}),Sm.config({mode:"flow",getInitial:function(t){return Hf.getHighlighted(t).map((function(t){return t.element()}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),wR=Cf({name:"Tabview",configFields:[bl("tabviewBehaviours",[Nm])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:xl(t.tabviewBehaviours,[Nm.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),CR=o([Xe("selectFirst",!0),Ja("onChangeTab"),Ja("onDismissTab"),Xe("tabs",[]),bl("tabSectionBehaviours",[])]),_R=$l({factory:xR,schema:[Ie("dom"),Ve("markers",[Ie("tabClass"),Ie("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),kR=$l({factory:wR,name:"tabview"}),SR=o([_R,kR]),TR=_f({name:"TabSection",configFields:CR(),partFields:SR(),factory:function(t,e,n,r){var o=function(e,n){uf(e,t,"tabbar").each((function(t){n(t).each(Br)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:yl(t.tabSectionBehaviours),events:Lr(Y([t.selectFirst?[Gr((function(t,e){o(t,Hf.getFirst)}))]:[],[jr(Dr(),(function(e,n){!function(e){var n=vl.getValue(e);uf(e,t,"tabview").each((function(r){q(t.tabs,(function(t){return t.value===n})).each((function(n){var o=n.view();To(e.element(),"id").each((function(t){ko(r.element(),"aria-labelledby",t)})),Nm.set(r,o),t.onChangeTab(r,e,o)}))}))}(n.event().button())})),jr(Or(),(function(e,n){var r=n.event().button();t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return uf(e,t,"tabview").map((function(t){return Nm.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=Hf.getCandidates(t);return q(n,(function(t){return vl.getValue(t)===e})).filter((function(e){return!Hf.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),DR=function(t,e){Ai(t,"height",e+"px"),En().browser.isIE()?Hi(t,"flex-basis"):Ai(t,"flex-basis",e+"px")},OR=function(t,n,r){Ra(t,'[role="dialog"]').each((function(t){Ba(t,'[role="tablist"]').each((function(o){r.get().map((function(r){return Ai(n,"height","0"),Ai(n,"flex-basis","0"),Math.min(r,function(t,n,r){var o,i=ao(t).dom(),a=Ra(t,".tox-dialog-wrap").getOr(t);o="fixed"===Pi(a,"position")?Math.max(i.clientHeight,e.window.innerHeight):Math.max(i.offsetHeight,i.scrollHeight);var u=ra(n),s=n.dom().offsetLeft>=r.dom().offsetLeft+fa(r)?Math.max(ra(r),u):u,c=parseInt(Pi(t,"margin-top"),10)||0,l=parseInt(Pi(t,"margin-bottom"),10)||0;return o-(ra(t)+c+l-s)}(t,n,o))})).each((function(t){DR(n,t)}))}))}))},ER=function(t){return Ba(t,'[role="tabpanel"]')},NR=function(t){var e;return{smartTabHeight:(e=an(y.none()),{extraEvents:[Gr((function(n){var r=n.element();ER(r).each((function(o){Ai(o,"visibility","hidden"),n.getSystem().getByDom(o).toOption().each((function(n){var r=function(t){return Z(Q(t,(function(t,e){return t>e?-1:t<e?1:0})))}(function(t,e,n){return H(t,(function(r,o){Nm.set(n,t[o].view());var i=e.dom().getBoundingClientRect();return Nm.set(n,[]),i.height}))}(t,o,n));e.set(r)})),OR(r,o,e),Hi(o,"visibility"),function(t,e){Z(t).each((function(t){return TR.showTab(e,t.value)}))}(t,n),Oh.requestAnimationFrame((function(){OR(r,o,e)}))}))})),jr(xr(),(function(t){var n=t.element();ER(n).each((function(t){OR(n,t,e)}))})),jr(Yb,(function(t,n){var r=t.element();ER(r).each((function(t){var n=Ku();Ai(t,"visibility","hidden");var o=Mi(t,"height").map((function(t){return parseInt(t,10)}));Hi(t,"height"),Hi(t,"flex-basis");var i=t.dom().getBoundingClientRect().height;o.forall((function(t){return i>t}))?(e.set(y.from(i)),OR(r,t,e)):o.each((function(e){DR(t,e)})),Hi(t,"visibility"),n.each(Gu)}))}))],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},AR=function(t,e){var n=an({}),r=function(t){var e=vl.getValue(t),r=hR(e).getOr({}),o=n.get(),i=Bt(o,r);n.set(i)},o=function(t){var e=n.get();vl.setValue(t,e)},i=an(null),a=H(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[Aw.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:H(t.items,(function(t){return Dk(n,t,e)})),formBehaviours:Fu([Sm.config({mode:"acyclic",useTabstopAt:u(oC)}),Am("TabView.form.events",[Gr(o),Kr(r)]),$u.config({channels:$t([{key:"send-data-to-section",value:{onReceive:r}},{key:"send-data-to-view",value:{onReceive:o}}])})])}}))]}}})),s=NR(a).smartTabHeight;return TR.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=vl.getValue(e);Rr(t,$b,{name:r,oldName:i.get()}),i.set(r)},tabs:a,components:[TR.parts().tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[xR.parts().tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:Fu([Pb.config({})])}),TR.parts().tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:s.selectFirst,tabSectionBehaviours:Fu([Am("tabpanel",s.extraEvents),Sm.config({mode:"acyclic"}),Of.config({find:function(t){return Z(TR.getViewItems(t))}}),vl.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn(["send-data-to-section"],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn(["send-data-to-view"],{})}}})])})},RR=Io("update-dialog"),BR=Io("update-title"),PR=Io("update-body"),IR=Io("update-footer"),MR=Io("body-send-message"),LR=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:d(d({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:Fu([jw(0),UT.config({channel:PR,updateState:function(t,e){return y.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[AR(t.body,n)];default:return[pR(t.body,n)]}},initialData:t})])}},FR=$g.deviceType.isTouch(),HR=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},jR=function(t,e){return GN.parts().close(Eh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:Fu([Pb.config({})])}))},VR=function(){return GN.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},zR=function(t,e){return GN.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:$O("<p>"+e.translate(t)+"</p>")}]}]})},UR=function(t){return GN.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},WR=function(t,e){return[Db.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Db.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},qR=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return GN.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),y.some(!0)},useTabstopAt:function(t){return!oC(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:d({position:"relative"},t.extraStyles)},components:h([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:$O('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:FR?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:Fu(h([Mm.config({}),Am("dialog-events",t.dialogEvents.concat([Yr(Xn(),(function(t,e){Sm.focusIn(t)}))])),Am("scroll-lock",[Gr((function(){mi(Di(),i)})),Kr((function(){pi(Di(),i)}))])],t.extraBehaviours)),eventOrder:d((e={},e[lr()]=["dialog-events"],e[wr()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[Cr()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},$R=function(t){return Eh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M17.953 7.453L13.422 12l4.531 4.547-1.406 1.406L12 13.422l-4.547 4.531-1.406-1.406L10.578 12 6.047 7.453l1.406-1.406L12 10.578l4.547-4.531z" fill-rule="evenodd"></path></svg>'}}],action:function(t){Ar(t,Vb)}})},YR=function(t,e,n){var r=function(t){return[Xi(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:d({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:Fu([UT.config({channel:BR,renderComponents:r})])}},GR=function(){return{dom:$O('<div class="tox-dialog__draghandle"></div>')}},KR=function(t,e){return function(t,e){var n=GN.parts().title(YR(t,y.none(),e)),r=GN.parts().draghandle(GR()),o=GN.parts().close($R(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return Db.sketch({dom:$O('<div class="tox-dialog__header"></div>'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},XR=function(t,e){return{onClose:function(){return e.closeWindow()},onBlock:function(e){GN.setBusy(t(),(function(t,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":e.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:n,components:[{dom:$O('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}))},onUnblock:function(){GN.setIdle(t())}}},JR=function(t,e,n,r){var o;return Zi(qR(d(d({},t),{lazySink:r.shared.getSink,extraBehaviours:h([UT.config({channel:RR,updateState:function(t,e){return y.some(e)},initialData:e}),Xw({})],t.extraBehaviours),onEscape:function(t){Ar(t,Vb)},dialogEvents:n,eventOrder:(o={},o[cr()]=["reflecting","receiving"],o[wr()]=["scroll-lock","reflecting","messages","dialog-events","alloy.base.behaviour"],o[Cr()]=["alloy.base.behaviour","dialog-events","messages","reflecting","scroll-lock"],o)})))},QR=function(t){return H(t,(function(t){return"menu"===t.type?function(t){var e=H(t.items,(function(t){var e=an(!1);return d(d({},t),{storage:e})}));return d(d({},t),{items:e})}(t):t}))},ZR=function(t){return W(t,(function(t,e){return"menu"===e.type?W(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},tB=function(t,e){return[Wr(Xn(),rC),t(jb,(function(t,n){e.onClose(),n.onClose()})),t(Vb,(function(t,e,n,r){e.onCancel(t),Ar(r,jb)})),jr(qb,(function(t,n){return e.onUnblock()})),jr(Wb,(function(t,n){return e.onBlock(n.event())}))]},eB=function(t,e){var n=function(e,n){return jr(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event(),e)}))}))},r=function(t,e){UT.getState(t).get().each((function(n){e(n,t)}))};return h(tB(n,e),[n(zb,(function(t,e,n){e.onAction(t,{name:n.name()})}))])},nB=function(t,e,n){var r=function(e,n){return jr(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event(),e)}))}))},o=function(t,e){UT.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return h(tB(r,e),[r(Ub,(function(t,e){return e.onSubmit(t)})),r(Hb,(function(t,e,n){e.onChange(t,{name:n.name()})})),r(zb,(function(t,e,r,o){var i=function(){return Sm.focusIn(o)},a=function(t){return Do(t,"disabled")||To(t,"aria-disabled").exists((function(t){return"true"===t}))},u=Ku();e.onAction(t,{name:r.name(),value:r.value()}),Ku().fold(i,(function(t){a(t)||u.exists((function(e){return Pn(t,e)&&a(e)}))?i():n().toOption().filter((function(e){return!Pn(e.element(),t)})).each(i)}))})),r($b,(function(t,e,n){e.onTabChange(t,{newTabName:n.name(),oldTabName:n.oldName()})})),Kr((function(e){var n=t();vl.setValue(e,n.getData())}))])},rB=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=V(n,(function(t){return"start"===t.align})),o=function(t,e){return Db.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:H(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},oB=function(t,e){return{dom:$O('<div class="tox-dialog__footer"></div>'),components:[],behaviours:Fu([UT.config({channel:IR,initialData:t,updateState:function(t,n){var r=H(n.buttons,(function(t){var n=Nh(function(t,e){return g_(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return y.some({lookupByName:function(t,e){return function(t,e,n){return q(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:rB})])}},iB=function(t,e){return GN.parts().footer(oB(t,e))},aB=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=Of.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return Aw.getField(n,e).fold((function(){var r=t.getFooter();return UT.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return y.some(t)}))}return y.none()},uB=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},o={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=vl.getValue(r),i=wt(n,(function(t){return t.get()}));return d(d({},o),i)},setData:function(e){r((function(r){var i=o.getData(),a=d(d({},i),e),u=function(t,e){var n=t.getRoot();return UT.getState(n).get().map((function(t){return we(xe("data",t.dataValidator,e))})).getOr(e)}(t,a),s=t.getFormWrapper();vl.setValue(s,u),xt(n,(function(t,e){Ot(a,e)&&t.set(a[e])}))}))},disable:function(e){aB(t,e).each(ig.disable)},enable:function(e){aB(t,e).each(ig.enable)},focus:function(e){aB(t,e).each(Mm.focus)},block:function(t){if(!C(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){Rr(e,Wb,{message:t})}))},unblock:function(){r((function(t){Ar(t,qb)}))},showTab:function(e){r((function(n){var r=t.getBody();UT.getState(r).get().exists((function(t){return t.isTabPanel()}))&&Of.getCurrent(r).each((function(t){TR.showTab(t,e)}))}))},redial:function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([RR],r),n.getSystem().broadcastOn([BR],r.internalDialog),n.getSystem().broadcastOn([PR],r.internalDialog),n.getSystem().broadcastOn([IR],r.internalDialog),o.setData(r.initialData)}))},close:function(){r((function(t){Ar(t,jb)}))}};return o},sB=function(t,e,n){var r=KR(t.internalDialog.title,n),o=function(t,e){var n=LR(t,y.none(),e,!1);return GN.parts().body(n)}({body:t.internalDialog.body},n),i=QR(t.internalDialog.buttons),a=ZR(i),u=iB({buttons:i},n),s=nB((function(){return d}),XR((function(){return f}),e),n.shared.getSink),c="normal"!==t.internalDialog.size?"large"===t.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],l={header:r,body:o,footer:y.some(u),extraClasses:c,extraBehaviours:[],extraStyles:{}},f=JR(l,t,s,n),d=uB({getRoot:function(){return f},getBody:function(){return GN.getBody(f)},getFooter:function(){return GN.getFooter(f)},getFormWrapper:function(){var t=GN.getBody(f);return Of.getCurrent(t).getOr(t)}},e.redial,a);return{dialog:f,instanceApi:d}},cB=function(t,e,n,r){var o,i,a,u,s,c=Io("dialog-label"),l=Io("dialog-content"),f=Nh((a={title:t.internalDialog.title,draggable:!0},u=c,s=n.shared.providers,Db.sketch({dom:$O('<div class="tox-dialog__header"></div>'),components:[YR(a,y.some(u),s),GR(),$R(s)],containerBehaviours:Fu([IN.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Pa(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=Nh(function(t,e,n,r){return LR(t,y.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=QR(t.internalDialog.buttons),h=ZR(m),p=Nh(function(t,e){return oB(t,e)}({buttons:m},n)),g=nB((function(){return b}),{onBlock:function(){},onUnblock:function(){},onClose:function(){return e.closeWindow()}},n.shared.getSink),v=Zi({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=c,o["aria-describedby"]=""+l,o)},eventOrder:(i={},i[cr()]=[UT.name(),$u.name()],i[lr()]=["execute-on-form"],i[wr()]=["reflecting","execute-on-form"],i),behaviours:Fu([Sm.config({mode:"cyclic",onEscape:function(t){return Ar(t,jb),y.some(!0)},useTabstopAt:function(t){return!oC(t)&&("button"!==Qr(t)||"disabled"!==So(t,"disabled"))}}),UT.config({channel:RR,updateState:function(t,e){return y.some(e)},initialData:t}),Mm.config({}),Am("execute-on-form",g.concat([Yr(Xn(),(function(t,e){Sm.focusIn(t)}))])),Xw({})]),components:[f.asSpec(),d.asSpec(),p.asSpec()]}),b=uB({getRoot:function(){return v},getFooter:function(){return p.get(v)},getBody:function(){return d.get(v)},getFormWrapper:function(){var t=d.get(v);return Of.getCurrent(t).getOr(t)}},e.redial,h);return{dialog:v,instanceApi:b}},lB=tinymce.util.Tools.resolve("tinymce.util.URI"),fB=["insertContent","setContent","execCommand","close","block","unblock"],dB=function(t){return _(t)&&-1!==fB.indexOf(t.mceAction)},mB=function(t,n,r,o){var i,a,s,c=KR(t.title,o),l=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[eC({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:Fu([Pb.config({}),Mm.config({})])})]}],behaviours:Fu([Sm.config({mode:"acyclic",useTabstopAt:u(oC)})])};return GN.parts().body(e)}(t),f=t.buttons.bind((function(t){return 0===t.length?y.none():y.some(iB({buttons:t},o))})),m=eB((function(){return k}),XR((function(){return w}),n)),h=d(d({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),p=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],g=new lB(t.url,{base_uri:new lB(e.window.location.href)}),v=g.protocol+"://"+g.host+(g.port?":"+g.port:""),b=an(y.none()),x=[Am("messages",[Gr((function(){var n=cb(sn.fromDom(e.window),"message",(function(e){if(g.isSameOrigin(new lB(e.raw().origin))){var n=e.raw().data;dB(n)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!S(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(r,k,n):function(t){return!dB(t)&&_(t)&&Ot(t,"mceAction")}(n)&&t.onMessage(k,n)}}));b.set(y.some(n))})),Kr((function(){b.get().each((function(t){return t.unbind()}))}))]),$u.config({channels:(i={},i[MR]={onReceive:function(t,e){Ba(t.element(),"iframe").each((function(t){t.dom().contentWindow.postMessage(e,v)}))}},i)})],w=JR({header:c,body:l,footer:f,extraClasses:p,extraBehaviours:x,extraStyles:h},t,m,o),k=(a=w,s=function(t){a.getSystem().isConnected()&&t(a)},{block:function(t){if(!C(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");s((function(e){Rr(e,Wb,{message:t})}))},unblock:function(){s((function(t){Ar(t,qb)}))},close:function(){s((function(t){Ar(t,jb)}))},sendMessage:function(t){s((function(e){e.getSystem().broadcastOn([MR],t)}))}});return{dialog:w,instanceApi:k}},hB=function(t,e,n){return e&&n?[]:[CO.config({contextual:{lazyContext:function(){return y.some(ka(sn.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},pB=function(t){var e=t.backstage,n=t.editor,r=Sg(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){GN.hide(s),r()},i=Nh(g_({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:y.none()},"cancel",t.backstage)),a=VR(),u=jR(o,e.providers),s=Zi(qR({lazySink:function(){return e.getSink()},header:HR(a,u),body:zR(n,e.providers),footer:y.some(UR(WR([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[jr(Vb,o)],eventOrder:{}}));GN.show(s);var c=i.get(s);Mm.focus(c)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){GN.hide(c),r(t)},i=Nh(g_({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:y.none()},"submit",t.backstage)),a=g_({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:y.none()},"cancel",t.backstage),u=VR(),s=jR((function(){return o(!1)}),e.providers),c=Zi(qR({lazySink:function(){return e.getSink()},header:HR(u,s),body:zR(n,e.providers),footer:y.some(UR(WR([],[a,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[jr(Vb,(function(){return o(!1)})),jr(Ub,(function(){return o(!0)}))],eventOrder:{}}));GN.show(c);var l=i.get(c);Mm.focus(l)}}}(t),a=function(t,r){return mR.openUrl((function(t){var o=mB(t,{closeWindow:function(){GN.hide(o.dialog),r(o.instanceApi)}},n,e);return GN.show(o.dialog),o.instanceApi}),t)},u=function(t,n){return mR.open((function(t,r,o){var i=r,a=sB({dataValidator:o,initialData:i,internalDialog:t},{redial:mR.redial,closeWindow:function(){GN.hide(a.dialog),n(a.instanceApi)}},e);return GN.show(a.dialog),a.instanceApi.setData(i),a.instanceApi}),t)},s=function(t,o,i,a){return mR.open((function(t,u,s){var c,l=we(xe("data",s,u)),f=(c=an(y.none()),{clear:function(){c.set(y.none())},set:function(t){c.set(y.some(t))},isSet:function(){return c.get().isSome()},on:function(t){c.get().each(t)}}),m=e.shared.header.isPositionedAtTop(),p=function(){return f.on((function(t){gh.reposition(t),CO.refresh(t)}))},g=cB({dataValidator:s,initialData:l,internalDialog:t},{redial:mR.redial,closeWindow:function(){f.on(gh.hide),n.off("ResizeEditor",p),f.clear(),i(g.instanceApi)}},e,a),v=Zi(gh.sketch(d(d({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},m?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:Fu(h([Am("window-manager-inline-events",[jr(_r(),(function(t,e){Ar(g.dialog,Vb)}))])],hB(n,r,m))),isExtraPart:function(t,e){return function(t){return db(t,".tox-alert-dialog")||db(t,".tox-confirm-dialog")}(e)}})));return f.set(v),gh.showWithin(v,o,ta(g.dialog),y.some(Di())),r&&m||(CO.refresh(v),n.on("ResizeEditor",p)),g.instanceApi.setData(l),Sm.focusIn(g.dialog),g.instanceApi}),t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?s(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?s(t,e.shared.anchors.cursor(),r,n.ariaAttrs):u(t,r)},openUrl:function(t,e){return a(t,e)},alert:function(t,e){o.open(t,(function(){e()}))},close:function(t){t.close()},confirm:function(t,e){i.open(t,(function(t){e(t)}))}}};f.add("silver",(function(t){var e=WN(t),n=e.uiMothership,r=e.backstage,i=e.renderUI,a=e.getUi;ub(t,r.shared);var u=pB({editor:t,backstage:r});return{renderUI:i,getWindowManagerImpl:o(u),getNotificationManagerImpl:function(){return Mh(0,{backstage:r},n)},ui:a()}}))}(window)}).call(this,n("yLpj"))},CgaS:function(t,e,n){"use strict";var r=n("xTJ+"),o=n("MLWZ"),i=n("9rSQ"),a=n("UnBK"),u=n("SntB");function s(t){this.defaults=t,this.interceptors={request:new i,response:new i}}s.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=u(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[a,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)n=n.then(e.shift(),e.shift());return n},s.prototype.getUri=function(t){return t=u(this.defaults,t),o(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(t){s.prototype[t]=function(e,n){return this.request(r.merge(n||{},{method:t,url:e}))}})),r.forEach(["post","put","patch"],(function(t){s.prototype[t]=function(e,n,o){return this.request(r.merge(o||{},{method:t,url:e,data:n}))}})),t.exports=s},CumE:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo((function(e){return function(n){return!!t.data(n,e)}})):function(e,n,r){return!!t.data(e,r[3])}})})?r.apply(e,o):r)||(t.exports=i)},DWi2:function(t,e,n){n("Aw8l")},DfZB:function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},EVdn:function(t,e,n){var r;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(n,o){"use strict";var i=[],a=Object.getPrototypeOf,u=i.slice,s=i.flat?function(t){return i.flat.call(t)}:function(t){return i.concat.apply([],t)},c=i.push,l=i.indexOf,f={},d=f.toString,m=f.hasOwnProperty,h=m.toString,p=h.call(Object),g={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},b=function(t){return null!=t&&t===t.window},y=n.document,x={type:!0,src:!0,nonce:!0,noModule:!0};function w(t,e,n){var r,o,i=(n=n||y).createElement("script");if(i.text=t,e)for(r in x)(o=e[r]||e.getAttribute&&e.getAttribute(r))&&i.setAttribute(r,o);n.head.appendChild(i).parentNode.removeChild(i)}function C(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?f[d.call(t)]||"object":typeof t}var _=function(t,e){return new _.fn.init(t,e)};function k(t){var e=!!t&&"length"in t&&t.length,n=C(t);return!v(t)&&!b(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}_.fn=_.prototype={jquery:"3.5.1",constructor:_,length:0,toArray:function(){return u.call(this)},get:function(t){return null==t?u.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=_.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return _.each(this,t)},map:function(t){return this.pushStack(_.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(_.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(_.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:c,sort:i.sort,splice:i.splice},_.extend=_.fn.extend=function(){var t,e,n,r,o,i,a=arguments[0]||{},u=1,s=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[u]||{},u++),"object"==typeof a||v(a)||(a={}),u===s&&(a=this,u--);u<s;u++)if(null!=(t=arguments[u]))for(e in t)r=t[e],"__proto__"!==e&&a!==r&&(c&&r&&(_.isPlainObject(r)||(o=Array.isArray(r)))?(n=a[e],i=o&&!Array.isArray(n)?[]:o||_.isPlainObject(n)?n:{},o=!1,a[e]=_.extend(c,i,r)):void 0!==r&&(a[e]=r));return a},_.extend({expando:"jQuery"+("3.5.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==d.call(t))&&(!(e=a(t))||"function"==typeof(n=m.call(e,"constructor")&&e.constructor)&&h.call(n)===p)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){w(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,r=0;if(k(t))for(n=t.length;r<n&&!1!==e.call(t[r],r,t[r]);r++);else for(r in t)if(!1===e.call(t[r],r,t[r]))break;return t},makeArray:function(t,e){var n=e||[];return null!=t&&(k(Object(t))?_.merge(n,"string"==typeof t?[t]:t):c.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:l.call(e,t,n)},merge:function(t,e){for(var n=+e.length,r=0,o=t.length;r<n;r++)t[o++]=e[r];return t.length=o,t},grep:function(t,e,n){for(var r=[],o=0,i=t.length,a=!n;o<i;o++)!e(t[o],o)!==a&&r.push(t[o]);return r},map:function(t,e,n){var r,o,i=0,a=[];if(k(t))for(r=t.length;i<r;i++)null!=(o=e(t[i],i,n))&&a.push(o);else for(i in t)null!=(o=e(t[i],i,n))&&a.push(o);return s(a)},guid:1,support:g}),"function"==typeof Symbol&&(_.fn[Symbol.iterator]=i[Symbol.iterator]),_.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){f["[object "+e+"]"]=e.toLowerCase()}));var S=function(t){var e,n,r,o,i,a,u,s,c,l,f,d,m,h,p,g,v,b,y,x="sizzle"+1*new Date,w=t.document,C=0,_=0,k=st(),S=st(),T=st(),D=st(),O=function(t,e){return t===e&&(f=!0),0},E={}.hasOwnProperty,N=[],A=N.pop,R=N.push,B=N.push,P=N.slice,I=function(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",H="\\["+L+"*("+F+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+L+"*\\]",j=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+H+")*)|.*)\\)|)",V=new RegExp(L+"+","g"),z=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),U=new RegExp("^"+L+"*,"+L+"*"),W=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),q=new RegExp(L+"|>"),$=new RegExp(j),Y=new RegExp("^"+F+"$"),G={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+H),PSEUDO:new RegExp("^"+j),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ot=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},it=function(){d()},at=xt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{B.apply(N=P.call(w.childNodes),w.childNodes),N[w.childNodes.length].nodeType}catch(t){B={apply:N.length?function(t,e){R.apply(t,P.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function ut(t,e,r,o){var i,u,c,l,f,h,v,b=e&&e.ownerDocument,w=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return r;if(!o&&(d(e),e=e||m,p)){if(11!==w&&(f=Z.exec(t)))if(i=f[1]){if(9===w){if(!(c=e.getElementById(i)))return r;if(c.id===i)return r.push(c),r}else if(b&&(c=b.getElementById(i))&&y(e,c)&&c.id===i)return r.push(c),r}else{if(f[2])return B.apply(r,e.getElementsByTagName(t)),r;if((i=f[3])&&n.getElementsByClassName&&e.getElementsByClassName)return B.apply(r,e.getElementsByClassName(i)),r}if(n.qsa&&!D[t+" "]&&(!g||!g.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(v=t,b=e,1===w&&(q.test(t)||W.test(t))){for((b=tt.test(t)&&vt(e.parentNode)||e)===e&&n.scope||((l=e.getAttribute("id"))?l=l.replace(rt,ot):e.setAttribute("id",l=x)),u=(h=a(t)).length;u--;)h[u]=(l?"#"+l:":scope")+" "+yt(h[u]);v=h.join(",")}try{return B.apply(r,b.querySelectorAll(v)),r}catch(e){D(t,!0)}finally{l===x&&e.removeAttribute("id")}}}return s(t.replace(z,"$1"),e,r,o)}function st(){var t=[];return function e(n,o){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=o}}function ct(t){return t[x]=!0,t}function lt(t){var e=m.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ft(t,e){for(var n=t.split("|"),o=n.length;o--;)r.attrHandle[n[o]]=e}function dt(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function mt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ht(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function pt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function gt(t){return ct((function(e){return e=+e,ct((function(n,r){for(var o,i=t([],n.length,e),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))}))}))}function vt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=ut.support={},i=ut.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!K.test(e||n&&n.nodeName||"HTML")},d=ut.setDocument=function(t){var e,o,a=t?t.ownerDocument||t:w;return a!=m&&9===a.nodeType&&a.documentElement?(h=(m=a).documentElement,p=!i(m),w!=m&&(o=m.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",it,!1):o.attachEvent&&o.attachEvent("onunload",it)),n.scope=lt((function(t){return h.appendChild(t).appendChild(m.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=lt((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=lt((function(t){return t.appendChild(m.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=Q.test(m.getElementsByClassName),n.getById=lt((function(t){return h.appendChild(t).id=x,!m.getElementsByName||!m.getElementsByName(x).length})),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&p){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&p){var n,r,o,i=e.getElementById(t);if(i){if((n=i.getAttributeNode("id"))&&n.value===t)return[i];for(o=e.getElementsByName(t),r=0;i=o[r++];)if((n=i.getAttributeNode("id"))&&n.value===t)return[i]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&p)return e.getElementsByClassName(t)},v=[],g=[],(n.qsa=Q.test(m.querySelectorAll))&&(lt((function(t){var e;h.appendChild(t).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+L+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+L+"*(?:value|"+M+")"),t.querySelectorAll("[id~="+x+"-]").length||g.push("~="),(e=m.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||g.push("\\["+L+"*name"+L+"*="+L+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]"),t.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),lt((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=m.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+L+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),h.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Q.test(b=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&<((function(t){n.disconnectedMatch=b.call(t,"*"),b.call(t,"[s!='']:x"),v.push("!=",j)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),e=Q.test(h.compareDocumentPosition),y=e||Q.test(h.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},O=e?function(t,e){if(t===e)return f=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t==m||t.ownerDocument==w&&y(w,t)?-1:e==m||e.ownerDocument==w&&y(w,e)?1:l?I(l,t)-I(l,e):0:4&r?-1:1)}:function(t,e){if(t===e)return f=!0,0;var n,r=0,o=t.parentNode,i=e.parentNode,a=[t],u=[e];if(!o||!i)return t==m?-1:e==m?1:o?-1:i?1:l?I(l,t)-I(l,e):0;if(o===i)return dt(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?dt(a[r],u[r]):a[r]==w?-1:u[r]==w?1:0},m):m},ut.matches=function(t,e){return ut(t,null,null,e)},ut.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&p&&!D[e+" "]&&(!v||!v.test(e))&&(!g||!g.test(e)))try{var r=b.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){D(e,!0)}return ut(e,m,null,[t]).length>0},ut.contains=function(t,e){return(t.ownerDocument||t)!=m&&d(t),y(t,e)},ut.attr=function(t,e){(t.ownerDocument||t)!=m&&d(t);var o=r.attrHandle[e.toLowerCase()],i=o&&E.call(r.attrHandle,e.toLowerCase())?o(t,e,!p):void 0;return void 0!==i?i:n.attributes||!p?t.getAttribute(e):(i=t.getAttributeNode(e))&&i.specified?i.value:null},ut.escape=function(t){return(t+"").replace(rt,ot)},ut.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ut.uniqueSort=function(t){var e,r=[],o=0,i=0;if(f=!n.detectDuplicates,l=!n.sortStable&&t.slice(0),t.sort(O),f){for(;e=t[i++];)e===t[i]&&(o=r.push(i));for(;o--;)t.splice(r[o],1)}return l=null,t},o=ut.getText=function(t){var e,n="",r=0,i=t.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=o(t)}else if(3===i||4===i)return t.nodeValue}else for(;e=t[r++];)n+=o(e);return n},(r=ut.selectors={cacheLength:50,createPseudo:ct,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ut.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ut.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&$.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=k[t+" "];return e||(e=new RegExp("(^|"+L+")"+t+"("+L+"|$)"))&&k(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=ut.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o.replace(V," ")+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),a="last"!==t.slice(-4),u="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,s){var c,l,f,d,m,h,p=i!==a?"nextSibling":"previousSibling",g=e.parentNode,v=u&&e.nodeName.toLowerCase(),b=!s&&!u,y=!1;if(g){if(i){for(;p;){for(d=e;d=d[p];)if(u?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=p="only"===t&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&b){for(y=(m=(c=(l=(f=(d=g)[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]||[])[0]===C&&c[1])&&c[2],d=m&&g.childNodes[m];d=++m&&d&&d[p]||(y=m=0)||h.pop();)if(1===d.nodeType&&++y&&d===e){l[t]=[C,m,y];break}}else if(b&&(y=m=(c=(l=(f=(d=e)[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]||[])[0]===C&&c[1]),!1===y)for(;(d=++m&&d&&d[p]||(y=m=0)||h.pop())&&((u?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++y||(b&&((l=(f=d[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]=[C,y]),d!==e)););return(y-=o)===r||y%r==0&&y/r>=0}}},PSEUDO:function(t,e){var n,o=r.pseudos[t]||r.setFilters[t.toLowerCase()]||ut.error("unsupported pseudo: "+t);return o[x]?o(e):o.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?ct((function(t,n){for(var r,i=o(t,e),a=i.length;a--;)t[r=I(t,i[a])]=!(n[r]=i[a])})):function(t){return o(t,0,n)}):o}},pseudos:{not:ct((function(t){var e=[],n=[],r=u(t.replace(z,"$1"));return r[x]?ct((function(t,e,n,o){for(var i,a=r(t,null,o,[]),u=t.length;u--;)(i=a[u])&&(t[u]=!(e[u]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}})),has:ct((function(t){return function(e){return ut(t,e).length>0}})),contains:ct((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||o(e)).indexOf(t)>-1}})),lang:ct((function(t){return Y.test(t||"")||ut.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=p?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===h},focus:function(t){return t===m.activeElement&&(!m.hasFocus||m.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:pt(!1),disabled:pt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return J.test(t.nodeName)},input:function(t){return X.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:gt((function(){return[0]})),last:gt((function(t,e){return[e-1]})),eq:gt((function(t,e,n){return[n<0?n+e:n]})),even:gt((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:gt((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:gt((function(t,e,n){for(var r=n<0?n+e:n>e?e:n;--r>=0;)t.push(r);return t})),gt:gt((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[e]=mt(e);for(e in{submit:!0,reset:!0})r.pseudos[e]=ht(e);function bt(){}function yt(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function xt(t,e,n){var r=e.dir,o=e.next,i=o||r,a=n&&"parentNode"===i,u=_++;return e.first?function(e,n,o){for(;e=e[r];)if(1===e.nodeType||a)return t(e,n,o);return!1}:function(e,n,s){var c,l,f,d=[C,u];if(s){for(;e=e[r];)if((1===e.nodeType||a)&&t(e,n,s))return!0}else for(;e=e[r];)if(1===e.nodeType||a)if(l=(f=e[x]||(e[x]={}))[e.uniqueID]||(f[e.uniqueID]={}),o&&o===e.nodeName.toLowerCase())e=e[r]||e;else{if((c=l[i])&&c[0]===C&&c[1]===u)return d[2]=c[2];if(l[i]=d,d[2]=t(e,n,s))return!0}return!1}}function wt(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function Ct(t,e,n,r,o){for(var i,a=[],u=0,s=t.length,c=null!=e;u<s;u++)(i=t[u])&&(n&&!n(i,r,o)||(a.push(i),c&&e.push(u)));return a}function _t(t,e,n,r,o,i){return r&&!r[x]&&(r=_t(r)),o&&!o[x]&&(o=_t(o,i)),ct((function(i,a,u,s){var c,l,f,d=[],m=[],h=a.length,p=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)ut(t,e[r],n);return n}(e||"*",u.nodeType?[u]:u,[]),g=!t||!i&&e?p:Ct(p,d,t,u,s),v=n?o||(i?t:h||r)?[]:a:g;if(n&&n(g,v,u,s),r)for(c=Ct(v,m),r(c,[],u,s),l=c.length;l--;)(f=c[l])&&(v[m[l]]=!(g[m[l]]=f));if(i){if(o||t){if(o){for(c=[],l=v.length;l--;)(f=v[l])&&c.push(g[l]=f);o(null,v=[],c,s)}for(l=v.length;l--;)(f=v[l])&&(c=o?I(i,f):d[l])>-1&&(i[c]=!(a[c]=f))}}else v=Ct(v===a?v.splice(h,v.length):v),o?o(null,a,v,s):B.apply(a,v)}))}function kt(t){for(var e,n,o,i=t.length,a=r.relative[t[0].type],u=a||r.relative[" "],s=a?1:0,l=xt((function(t){return t===e}),u,!0),f=xt((function(t){return I(e,t)>-1}),u,!0),d=[function(t,n,r){var o=!a&&(r||n!==c)||((e=n).nodeType?l(t,n,r):f(t,n,r));return e=null,o}];s<i;s++)if(n=r.relative[t[s].type])d=[xt(wt(d),n)];else{if((n=r.filter[t[s].type].apply(null,t[s].matches))[x]){for(o=++s;o<i&&!r.relative[t[o].type];o++);return _t(s>1&&wt(d),s>1&&yt(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(z,"$1"),n,s<o&&kt(t.slice(s,o)),o<i&&kt(t=t.slice(o)),o<i&&yt(t))}d.push(n)}return wt(d)}return bt.prototype=r.filters=r.pseudos,r.setFilters=new bt,a=ut.tokenize=function(t,e){var n,o,i,a,u,s,c,l=S[t+" "];if(l)return e?0:l.slice(0);for(u=t,s=[],c=r.preFilter;u;){for(a in n&&!(o=U.exec(u))||(o&&(u=u.slice(o[0].length)||u),s.push(i=[])),n=!1,(o=W.exec(u))&&(n=o.shift(),i.push({value:n,type:o[0].replace(z," ")}),u=u.slice(n.length)),r.filter)!(o=G[a].exec(u))||c[a]&&!(o=c[a](o))||(n=o.shift(),i.push({value:n,type:a,matches:o}),u=u.slice(n.length));if(!n)break}return e?u.length:u?ut.error(t):S(t,s).slice(0)},u=ut.compile=function(t,e){var n,o=[],i=[],u=T[t+" "];if(!u){for(e||(e=a(t)),n=e.length;n--;)(u=kt(e[n]))[x]?o.push(u):i.push(u);(u=T(t,function(t,e){var n=e.length>0,o=t.length>0,i=function(i,a,u,s,l){var f,h,g,v=0,b="0",y=i&&[],x=[],w=c,_=i||o&&r.find.TAG("*",l),k=C+=null==w?1:Math.random()||.1,S=_.length;for(l&&(c=a==m||a||l);b!==S&&null!=(f=_[b]);b++){if(o&&f){for(h=0,a||f.ownerDocument==m||(d(f),u=!p);g=t[h++];)if(g(f,a||m,u)){s.push(f);break}l&&(C=k)}n&&((f=!g&&f)&&v--,i&&y.push(f))}if(v+=b,n&&b!==v){for(h=0;g=e[h++];)g(y,x,a,u);if(i){if(v>0)for(;b--;)y[b]||x[b]||(x[b]=A.call(s));x=Ct(x)}B.apply(s,x),l&&!i&&x.length>0&&v+e.length>1&&ut.uniqueSort(s)}return l&&(C=k,c=w),y};return n?ct(i):i}(i,o))).selector=t}return u},s=ut.select=function(t,e,n,o){var i,s,c,l,f,d="function"==typeof t&&t,m=!o&&a(t=d.selector||t);if(n=n||[],1===m.length){if((s=m[0]=m[0].slice(0)).length>2&&"ID"===(c=s[0]).type&&9===e.nodeType&&p&&r.relative[s[1].type]){if(!(e=(r.find.ID(c.matches[0].replace(et,nt),e)||[])[0]))return n;d&&(e=e.parentNode),t=t.slice(s.shift().value.length)}for(i=G.needsContext.test(t)?0:s.length;i--&&(c=s[i],!r.relative[l=c.type]);)if((f=r.find[l])&&(o=f(c.matches[0].replace(et,nt),tt.test(s[0].type)&&vt(e.parentNode)||e))){if(s.splice(i,1),!(t=o.length&&yt(s)))return B.apply(n,o),n;break}}return(d||u(t,m))(o,e,!p,n,!e||tt.test(t)&&vt(e.parentNode)||e),n},n.sortStable=x.split("").sort(O).join("")===x,n.detectDuplicates=!!f,d(),n.sortDetached=lt((function(t){return 1&t.compareDocumentPosition(m.createElement("fieldset"))})),lt((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||ft("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&<((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ft("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),lt((function(t){return null==t.getAttribute("disabled")}))||ft(M,(function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null})),ut}(n);_.find=S,_.expr=S.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=S.uniqueSort,_.text=S.getText,_.isXMLDoc=S.isXML,_.contains=S.contains,_.escapeSelector=S.escape;var T=function(t,e,n){for(var r=[],o=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(o&&_(t).is(n))break;r.push(t)}return r},D=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},O=_.expr.match.needsContext;function E(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(t,e,n){return v(e)?_.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?_.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?_.grep(t,(function(t){return l.call(e,t)>-1!==n})):_.filter(e,t,n)}_.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?_.find.matchesSelector(r,t)?[r]:[]:_.find.matches(t,_.grep(e,(function(t){return 1===t.nodeType})))},_.fn.extend({find:function(t){var e,n,r=this.length,o=this;if("string"!=typeof t)return this.pushStack(_(t).filter((function(){for(e=0;e<r;e++)if(_.contains(o[e],this))return!0})));for(n=this.pushStack([]),e=0;e<r;e++)_.find(t,o[e],n);return r>1?_.uniqueSort(n):n},filter:function(t){return this.pushStack(A(this,t||[],!1))},not:function(t){return this.pushStack(A(this,t||[],!0))},is:function(t){return!!A(this,"string"==typeof t&&O.test(t)?_(t):t||[],!1).length}});var R,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(t,e,n){var r,o;if(!t)return this;if(n=n||R,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:B.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof _?e[0]:e,_.merge(this,_.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:y,!0)),N.test(r[1])&&_.isPlainObject(e))for(r in e)v(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(o=y.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==n.ready?n.ready(t):t(_):_.makeArray(t,this)}).prototype=_.fn,R=_(y);var P=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};function M(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}_.fn.extend({has:function(t){var e=_(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(_.contains(this,e[t]))return!0}))},closest:function(t,e){var n,r=0,o=this.length,i=[],a="string"!=typeof t&&_(t);if(!O.test(t))for(;r<o;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&_.find.matchesSelector(n,t))){i.push(n);break}return this.pushStack(i.length>1?_.uniqueSort(i):i)},index:function(t){return t?"string"==typeof t?l.call(_(t),this[0]):l.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),_.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return T(t,"parentNode")},parentsUntil:function(t,e,n){return T(t,"parentNode",n)},next:function(t){return M(t,"nextSibling")},prev:function(t){return M(t,"previousSibling")},nextAll:function(t){return T(t,"nextSibling")},prevAll:function(t){return T(t,"previousSibling")},nextUntil:function(t,e,n){return T(t,"nextSibling",n)},prevUntil:function(t,e,n){return T(t,"previousSibling",n)},siblings:function(t){return D((t.parentNode||{}).firstChild,t)},children:function(t){return D(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(E(t,"template")&&(t=t.content||t),_.merge([],t.childNodes))}},(function(t,e){_.fn[t]=function(n,r){var o=_.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=_.filter(r,o)),this.length>1&&(I[t]||_.uniqueSort(o),P.test(t)&&o.reverse()),this.pushStack(o)}}));var L=/[^\x20\t\r\n\f]+/g;function F(t){return t}function H(t){throw t}function j(t,e,n,r){var o;try{t&&v(o=t.promise)?o.call(t).done(e).fail(n):t&&v(o=t.then)?o.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}_.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return _.each(t.match(L)||[],(function(t,n){e[n]=!0})),e}(t):_.extend({},t);var e,n,r,o,i=[],a=[],u=-1,s=function(){for(o=o||t.once,r=e=!0;a.length;u=-1)for(n=a.shift();++u<i.length;)!1===i[u].apply(n[0],n[1])&&t.stopOnFalse&&(u=i.length,n=!1);t.memory||(n=!1),e=!1,o&&(i=n?[]:"")},c={add:function(){return i&&(n&&!e&&(u=i.length-1,a.push(n)),function e(n){_.each(n,(function(n,r){v(r)?t.unique&&c.has(r)||i.push(r):r&&r.length&&"string"!==C(r)&&e(r)}))}(arguments),n&&!e&&s()),this},remove:function(){return _.each(arguments,(function(t,e){for(var n;(n=_.inArray(e,i,n))>-1;)i.splice(n,1),n<=u&&u--})),this},has:function(t){return t?_.inArray(t,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=a=[],n||e||(i=n=""),this},locked:function(){return!!o},fireWith:function(t,n){return o||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||s()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},_.extend({Deferred:function(t){var e=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],r="pending",o={state:function(){return r},always:function(){return i.done(arguments).fail(arguments),this},catch:function(t){return o.then(null,t)},pipe:function(){var t=arguments;return _.Deferred((function(n){_.each(e,(function(e,r){var o=v(t[r[4]])&&t[r[4]];i[r[1]]((function(){var t=o&&o.apply(this,arguments);t&&v(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,o?[t]:arguments)}))})),t=null})).promise()},then:function(t,r,o){var i=0;function a(t,e,r,o){return function(){var u=this,s=arguments,c=function(){var n,c;if(!(t<i)){if((n=r.apply(u,s))===e.promise())throw new TypeError("Thenable self-resolution");c=n&&("object"==typeof n||"function"==typeof n)&&n.then,v(c)?o?c.call(n,a(i,e,F,o),a(i,e,H,o)):(i++,c.call(n,a(i,e,F,o),a(i,e,H,o),a(i,e,F,e.notifyWith))):(r!==F&&(u=void 0,s=[n]),(o||e.resolveWith)(u,s))}},l=o?c:function(){try{c()}catch(n){_.Deferred.exceptionHook&&_.Deferred.exceptionHook(n,l.stackTrace),t+1>=i&&(r!==H&&(u=void 0,s=[n]),e.rejectWith(u,s))}};t?l():(_.Deferred.getStackHook&&(l.stackTrace=_.Deferred.getStackHook()),n.setTimeout(l))}}return _.Deferred((function(n){e[0][3].add(a(0,n,v(o)?o:F,n.notifyWith)),e[1][3].add(a(0,n,v(t)?t:F)),e[2][3].add(a(0,n,v(r)?r:H))})).promise()},promise:function(t){return null!=t?_.extend(t,o):o}},i={};return _.each(e,(function(t,n){var a=n[2],u=n[5];o[n[1]]=a.add,u&&a.add((function(){r=u}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(n[3].fire),i[n[0]]=function(){return i[n[0]+"With"](this===i?void 0:this,arguments),this},i[n[0]+"With"]=a.fireWith})),o.promise(i),t&&t.call(i,i),i},when:function(t){var e=arguments.length,n=e,r=Array(n),o=u.call(arguments),i=_.Deferred(),a=function(t){return function(n){r[t]=this,o[t]=arguments.length>1?u.call(arguments):n,--e||i.resolveWith(r,o)}};if(e<=1&&(j(t,i.done(a(n)).resolve,i.reject,!e),"pending"===i.state()||v(o[n]&&o[n].then)))return i.then();for(;n--;)j(o[n],a(n),i.reject);return i.promise()}});var V=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&V.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},_.readyException=function(t){n.setTimeout((function(){throw t}))};var z=_.Deferred();function U(){y.removeEventListener("DOMContentLoaded",U),n.removeEventListener("load",U),_.ready()}_.fn.ready=function(t){return z.then(t).catch((function(t){_.readyException(t)})),this},_.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==t&&--_.readyWait>0||z.resolveWith(y,[_]))}}),_.ready.then=z.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?n.setTimeout(_.ready):(y.addEventListener("DOMContentLoaded",U),n.addEventListener("load",U));var W=function(t,e,n,r,o,i,a){var u=0,s=t.length,c=null==n;if("object"===C(n))for(u in o=!0,n)W(t,e,u,n[u],!0,i,a);else if(void 0!==r&&(o=!0,v(r)||(a=!0),c&&(a?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(_(t),n)})),e))for(;u<s;u++)e(t[u],n,a?r:r.call(t[u],u,e(t[u],n)));return o?t:c?e.call(t):s?e(t[0],n):i},q=/^-ms-/,$=/-([a-z])/g;function Y(t,e){return e.toUpperCase()}function G(t){return t.replace(q,"ms-").replace($,Y)}var K=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function X(){this.expando=_.expando+X.uid++}X.uid=1,X.prototype={cache:function(t){var e=t[this.expando];return e||(e={},K(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var r,o=this.cache(t);if("string"==typeof e)o[G(e)]=n;else for(r in e)o[G(r)]=e[r];return o},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][G(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r=t[this.expando];if(void 0!==r){if(void 0!==e){n=(e=Array.isArray(e)?e.map(G):(e=G(e))in r?[e]:e.match(L)||[]).length;for(;n--;)delete r[e[n]]}(void 0===e||_.isEmptyObject(r))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!_.isEmptyObject(e)}};var J=new X,Q=new X,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,tt=/[A-Z]/g;function et(t,e,n){var r;if(void 0===n&&1===t.nodeType)if(r="data-"+e.replace(tt,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(r))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:Z.test(t)?JSON.parse(t):t)}(n)}catch(t){}Q.set(t,e,n)}else n=void 0;return n}_.extend({hasData:function(t){return Q.hasData(t)||J.hasData(t)},data:function(t,e,n){return Q.access(t,e,n)},removeData:function(t,e){Q.remove(t,e)},_data:function(t,e,n){return J.access(t,e,n)},_removeData:function(t,e){J.remove(t,e)}}),_.fn.extend({data:function(t,e){var n,r,o,i=this[0],a=i&&i.attributes;if(void 0===t){if(this.length&&(o=Q.get(i),1===i.nodeType&&!J.get(i,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=G(r.slice(5)),et(i,r,o[r]));J.set(i,"hasDataAttrs",!0)}return o}return"object"==typeof t?this.each((function(){Q.set(this,t)})):W(this,(function(e){var n;if(i&&void 0===e)return void 0!==(n=Q.get(i,t))||void 0!==(n=et(i,t))?n:void 0;this.each((function(){Q.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){Q.remove(this,t)}))}}),_.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=J.get(t,e),n&&(!r||Array.isArray(n)?r=J.access(t,e,_.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=_.queue(t,e),r=n.length,o=n.shift(),i=_._queueHooks(t,e);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===e&&n.unshift("inprogress"),delete i.stop,o.call(t,(function(){_.dequeue(t,e)}),i)),!r&&i&&i.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return J.get(t,n)||J.access(t,n,{empty:_.Callbacks("once memory").add((function(){J.remove(t,[e+"queue",n])}))})}}),_.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?_.queue(this[0],t):void 0===e?this:this.each((function(){var n=_.queue(this,t,e);_._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&_.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){_.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,o=_.Deferred(),i=this,a=this.length,u=function(){--r||o.resolveWith(i,[i])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)(n=J.get(i[a],t+"queueHooks"))&&n.empty&&(r++,n.empty.add(u));return u(),o.promise(e)}});var nt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,rt=new RegExp("^(?:([+-])=|)("+nt+")([a-z%]*)$","i"),ot=["Top","Right","Bottom","Left"],it=y.documentElement,at=function(t){return _.contains(t.ownerDocument,t)},ut={composed:!0};it.getRootNode&&(at=function(t){return _.contains(t.ownerDocument,t)||t.getRootNode(ut)===t.ownerDocument});var st=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&at(t)&&"none"===_.css(t,"display")};function ct(t,e,n,r){var o,i,a=20,u=r?function(){return r.cur()}:function(){return _.css(t,e,"")},s=u(),c=n&&n[3]||(_.cssNumber[e]?"":"px"),l=t.nodeType&&(_.cssNumber[e]||"px"!==c&&+s)&&rt.exec(_.css(t,e));if(l&&l[3]!==c){for(s/=2,c=c||l[3],l=+s||1;a--;)_.style(t,e,l+c),(1-i)*(1-(i=u()/s||.5))<=0&&(a=0),l/=i;l*=2,_.style(t,e,l+c),n=n||[]}return n&&(l=+l||+s||0,o=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=l,r.end=o)),o}var lt={};function ft(t){var e,n=t.ownerDocument,r=t.nodeName,o=lt[r];return o||(e=n.body.appendChild(n.createElement(r)),o=_.css(e,"display"),e.parentNode.removeChild(e),"none"===o&&(o="block"),lt[r]=o,o)}function dt(t,e){for(var n,r,o=[],i=0,a=t.length;i<a;i++)(r=t[i]).style&&(n=r.style.display,e?("none"===n&&(o[i]=J.get(r,"display")||null,o[i]||(r.style.display="")),""===r.style.display&&st(r)&&(o[i]=ft(r))):"none"!==n&&(o[i]="none",J.set(r,"display",n)));for(i=0;i<a;i++)null!=o[i]&&(t[i].style.display=o[i]);return t}_.fn.extend({show:function(){return dt(this,!0)},hide:function(){return dt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){st(this)?_(this).show():_(this).hide()}))}});var mt,ht,pt=/^(?:checkbox|radio)$/i,gt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,vt=/^$|^module$|\/(?:java|ecma)script/i;mt=y.createDocumentFragment().appendChild(y.createElement("div")),(ht=y.createElement("input")).setAttribute("type","radio"),ht.setAttribute("checked","checked"),ht.setAttribute("name","t"),mt.appendChild(ht),g.checkClone=mt.cloneNode(!0).cloneNode(!0).lastChild.checked,mt.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!mt.cloneNode(!0).lastChild.defaultValue,mt.innerHTML="<option></option>",g.option=!!mt.lastChild;var bt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function yt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&E(t,e)?_.merge([t],n):n}function xt(t,e){for(var n=0,r=t.length;n<r;n++)J.set(t[n],"globalEval",!e||J.get(e[n],"globalEval"))}bt.tbody=bt.tfoot=bt.colgroup=bt.caption=bt.thead,bt.th=bt.td,g.option||(bt.optgroup=bt.option=[1,"<select multiple='multiple'>","</select>"]);var wt=/<|&#?\w+;/;function Ct(t,e,n,r,o){for(var i,a,u,s,c,l,f=e.createDocumentFragment(),d=[],m=0,h=t.length;m<h;m++)if((i=t[m])||0===i)if("object"===C(i))_.merge(d,i.nodeType?[i]:i);else if(wt.test(i)){for(a=a||f.appendChild(e.createElement("div")),u=(gt.exec(i)||["",""])[1].toLowerCase(),s=bt[u]||bt._default,a.innerHTML=s[1]+_.htmlPrefilter(i)+s[2],l=s[0];l--;)a=a.lastChild;_.merge(d,a.childNodes),(a=f.firstChild).textContent=""}else d.push(e.createTextNode(i));for(f.textContent="",m=0;i=d[m++];)if(r&&_.inArray(i,r)>-1)o&&o.push(i);else if(c=at(i),a=yt(f.appendChild(i),"script"),c&&xt(a),n)for(l=0;i=a[l++];)vt.test(i.type||"")&&n.push(i);return f}var _t=/^key/,kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,St=/^([^.]*)(?:\.(.+)|)/;function Tt(){return!0}function Dt(){return!1}function Ot(t,e){return t===function(){try{return y.activeElement}catch(t){}}()==("focus"===e)}function Et(t,e,n,r,o,i){var a,u;if("object"==typeof e){for(u in"string"!=typeof n&&(r=r||n,n=void 0),e)Et(t,u,n,r,e[u],i);return t}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=Dt;else if(!o)return t;return 1===i&&(a=o,(o=function(t){return _().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=_.guid++)),t.each((function(){_.event.add(this,e,o,r,n)}))}function Nt(t,e,n){n?(J.set(t,e,!1),_.event.add(t,e,{namespace:!1,handler:function(t){var r,o,i=J.get(this,e);if(1&t.isTrigger&&this[e]){if(i.length)(_.event.special[e]||{}).delegateType&&t.stopPropagation();else if(i=u.call(arguments),J.set(this,e,i),r=n(this,e),this[e](),i!==(o=J.get(this,e))||r?J.set(this,e,!1):o={},i!==o)return t.stopImmediatePropagation(),t.preventDefault(),o.value}else i.length&&(J.set(this,e,{value:_.event.trigger(_.extend(i[0],_.Event.prototype),i.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===J.get(t,e)&&_.event.add(t,e,Tt)}_.event={global:{},add:function(t,e,n,r,o){var i,a,u,s,c,l,f,d,m,h,p,g=J.get(t);if(K(t))for(n.handler&&(n=(i=n).handler,o=i.selector),o&&_.find.matchesSelector(it,o),n.guid||(n.guid=_.guid++),(s=g.events)||(s=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(e){return void 0!==_&&_.event.triggered!==e.type?_.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(L)||[""]).length;c--;)m=p=(u=St.exec(e[c])||[])[1],h=(u[2]||"").split(".").sort(),m&&(f=_.event.special[m]||{},m=(o?f.delegateType:f.bindType)||m,f=_.event.special[m]||{},l=_.extend({type:m,origType:p,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&_.expr.match.needsContext.test(o),namespace:h.join(".")},i),(d=s[m])||((d=s[m]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(m,a)),f.add&&(f.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),o?d.splice(d.delegateCount++,0,l):d.push(l),_.event.global[m]=!0)},remove:function(t,e,n,r,o){var i,a,u,s,c,l,f,d,m,h,p,g=J.hasData(t)&&J.get(t);if(g&&(s=g.events)){for(c=(e=(e||"").match(L)||[""]).length;c--;)if(m=p=(u=St.exec(e[c])||[])[1],h=(u[2]||"").split(".").sort(),m){for(f=_.event.special[m]||{},d=s[m=(r?f.delegateType:f.bindType)||m]||[],u=u[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=d.length;i--;)l=d[i],!o&&p!==l.origType||n&&n.guid!==l.guid||u&&!u.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(d.splice(i,1),l.selector&&d.delegateCount--,f.remove&&f.remove.call(t,l));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(t,h,g.handle)||_.removeEvent(t,m,g.handle),delete s[m])}else for(m in s)_.event.remove(t,m+e[c],n,r,!0);_.isEmptyObject(s)&&J.remove(t,"handle events")}},dispatch:function(t){var e,n,r,o,i,a,u=new Array(arguments.length),s=_.event.fix(t),c=(J.get(this,"events")||Object.create(null))[s.type]||[],l=_.event.special[s.type]||{};for(u[0]=s,e=1;e<arguments.length;e++)u[e]=arguments[e];if(s.delegateTarget=this,!l.preDispatch||!1!==l.preDispatch.call(this,s)){for(a=_.event.handlers.call(this,s,c),e=0;(o=a[e++])&&!s.isPropagationStopped();)for(s.currentTarget=o.elem,n=0;(i=o.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!1!==i.namespace&&!s.rnamespace.test(i.namespace)||(s.handleObj=i,s.data=i.data,void 0!==(r=((_.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,s),s.result}},handlers:function(t,e){var n,r,o,i,a,u=[],s=e.delegateCount,c=t.target;if(s&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(i=[],a={},n=0;n<s;n++)void 0===a[o=(r=e[n]).selector+" "]&&(a[o]=r.needsContext?_(o,this).index(c)>-1:_.find(o,this,null,[c]).length),a[o]&&i.push(r);i.length&&u.push({elem:c,handlers:i})}return c=this,s<e.length&&u.push({elem:c,handlers:e.slice(s)}),u},addProp:function(t,e){Object.defineProperty(_.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[_.expando]?t:new _.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return pt.test(e.type)&&e.click&&E(e,"input")&&Nt(e,"click",Tt),!1},trigger:function(t){var e=this||t;return pt.test(e.type)&&e.click&&E(e,"input")&&Nt(e,"click"),!0},_default:function(t){var e=t.target;return pt.test(e.type)&&e.click&&E(e,"input")&&J.get(e,"click")||E(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},_.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},_.Event=function(t,e){if(!(this instanceof _.Event))return new _.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Tt:Dt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&_.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[_.expando]=!0},_.Event.prototype={constructor:_.Event,isDefaultPrevented:Dt,isPropagationStopped:Dt,isImmediatePropagationStopped:Dt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Tt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Tt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Tt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},_.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(t){var e=t.button;return null==t.which&&_t.test(t.type)?null!=t.charCode?t.charCode:t.keyCode:!t.which&&void 0!==e&&kt.test(t.type)?1&e?1:2&e?3:4&e?2:0:t.which}},_.event.addProp),_.each({focus:"focusin",blur:"focusout"},(function(t,e){_.event.special[t]={setup:function(){return Nt(this,t,Ot),!1},trigger:function(){return Nt(this,t),!0},delegateType:e}})),_.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){_.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=this,o=t.relatedTarget,i=t.handleObj;return o&&(o===r||_.contains(r,o))||(t.type=i.origType,n=i.handler.apply(this,arguments),t.type=e),n}}})),_.fn.extend({on:function(t,e,n,r){return Et(this,t,e,n,r)},one:function(t,e,n,r){return Et(this,t,e,n,r,1)},off:function(t,e,n){var r,o;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,_(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof t){for(o in t)this.off(o,e,t[o]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=Dt),this.each((function(){_.event.remove(this,t,n,e)}))}});var At=/<script|<style|<link/i,Rt=/checked\s*(?:[^=]|=\s*.checked.)/i,Bt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Pt(t,e){return E(t,"table")&&E(11!==e.nodeType?e:e.firstChild,"tr")&&_(t).children("tbody")[0]||t}function It(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Mt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Lt(t,e){var n,r,o,i,a,u;if(1===e.nodeType){if(J.hasData(t)&&(u=J.get(t).events))for(o in J.remove(e,"handle events"),u)for(n=0,r=u[o].length;n<r;n++)_.event.add(e,o,u[o][n]);Q.hasData(t)&&(i=Q.access(t),a=_.extend({},i),Q.set(e,a))}}function Ft(t,e){var n=e.nodeName.toLowerCase();"input"===n&&pt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function Ht(t,e,n,r){e=s(e);var o,i,a,u,c,l,f=0,d=t.length,m=d-1,h=e[0],p=v(h);if(p||d>1&&"string"==typeof h&&!g.checkClone&&Rt.test(h))return t.each((function(o){var i=t.eq(o);p&&(e[0]=h.call(this,o,i.html())),Ht(i,e,n,r)}));if(d&&(i=(o=Ct(e,t[0].ownerDocument,!1,t,r)).firstChild,1===o.childNodes.length&&(o=i),i||r)){for(u=(a=_.map(yt(o,"script"),It)).length;f<d;f++)c=o,f!==m&&(c=_.clone(c,!0,!0),u&&_.merge(a,yt(c,"script"))),n.call(t[f],c,f);if(u)for(l=a[a.length-1].ownerDocument,_.map(a,Mt),f=0;f<u;f++)c=a[f],vt.test(c.type||"")&&!J.access(c,"globalEval")&&_.contains(l,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?_._evalUrl&&!c.noModule&&_._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},l):w(c.textContent.replace(Bt,""),c,l))}return t}function jt(t,e,n){for(var r,o=e?_.filter(e,t):t,i=0;null!=(r=o[i]);i++)n||1!==r.nodeType||_.cleanData(yt(r)),r.parentNode&&(n&&at(r)&&xt(yt(r,"script")),r.parentNode.removeChild(r));return t}_.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var r,o,i,a,u=t.cloneNode(!0),s=at(t);if(!(g.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||_.isXMLDoc(t)))for(a=yt(u),r=0,o=(i=yt(t)).length;r<o;r++)Ft(i[r],a[r]);if(e)if(n)for(i=i||yt(t),a=a||yt(u),r=0,o=i.length;r<o;r++)Lt(i[r],a[r]);else Lt(t,u);return(a=yt(u,"script")).length>0&&xt(a,!s&&yt(t,"script")),u},cleanData:function(t){for(var e,n,r,o=_.event.special,i=0;void 0!==(n=t[i]);i++)if(K(n)){if(e=n[J.expando]){if(e.events)for(r in e.events)o[r]?_.event.remove(n,r):_.removeEvent(n,r,e.handle);n[J.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),_.fn.extend({detach:function(t){return jt(this,t,!0)},remove:function(t){return jt(this,t)},text:function(t){return W(this,(function(t){return void 0===t?_.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Ht(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Pt(this,t).appendChild(t)}))},prepend:function(){return Ht(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Pt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Ht(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Ht(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(_.cleanData(yt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return _.clone(this,t,e)}))},html:function(t){return W(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!At.test(t)&&!bt[(gt.exec(t)||["",""])[1].toLowerCase()]){t=_.htmlPrefilter(t);try{for(;n<r;n++)1===(e=this[n]||{}).nodeType&&(_.cleanData(yt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Ht(this,arguments,(function(e){var n=this.parentNode;_.inArray(this,t)<0&&(_.cleanData(yt(this)),n&&n.replaceChild(e,this))}),t)}}),_.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){_.fn[t]=function(t){for(var n,r=[],o=_(t),i=o.length-1,a=0;a<=i;a++)n=a===i?this:this.clone(!0),_(o[a])[e](n),c.apply(r,n.get());return this.pushStack(r)}}));var Vt=new RegExp("^("+nt+")(?!px)[a-z%]+$","i"),zt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=n),e.getComputedStyle(t)},Ut=function(t,e,n){var r,o,i={};for(o in e)i[o]=t.style[o],t.style[o]=e[o];for(o in r=n.call(t),e)t.style[o]=i[o];return r},Wt=new RegExp(ot.join("|"),"i");function qt(t,e,n){var r,o,i,a,u=t.style;return(n=n||zt(t))&&(""!==(a=n.getPropertyValue(e)||n[e])||at(t)||(a=_.style(t,e)),!g.pixelBoxStyles()&&Vt.test(a)&&Wt.test(e)&&(r=u.width,o=u.minWidth,i=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=o,u.maxWidth=i)),void 0!==a?a+"":a}function $t(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(l){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",it.appendChild(c).appendChild(l);var t=n.getComputedStyle(l);r="1%"!==t.top,s=12===e(t.marginLeft),l.style.right="60%",a=36===e(t.right),o=36===e(t.width),l.style.position="absolute",i=12===e(l.offsetWidth/3),it.removeChild(c),l=null}}function e(t){return Math.round(parseFloat(t))}var r,o,i,a,u,s,c=y.createElement("div"),l=y.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===l.style.backgroundClip,_.extend(g,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),s},scrollboxSize:function(){return t(),i},reliableTrDimensions:function(){var t,e,r,o;return null==u&&(t=y.createElement("table"),e=y.createElement("tr"),r=y.createElement("div"),t.style.cssText="position:absolute;left:-11111px",e.style.height="1px",r.style.height="9px",it.appendChild(t).appendChild(e).appendChild(r),o=n.getComputedStyle(e),u=parseInt(o.height)>3,it.removeChild(t)),u}}))}();var Yt=["Webkit","Moz","ms"],Gt=y.createElement("div").style,Kt={};function Xt(t){var e=_.cssProps[t]||Kt[t];return e||(t in Gt?t:Kt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Yt.length;n--;)if((t=Yt[n]+e)in Gt)return t}(t)||t)}var Jt=/^(none|table(?!-c[ea]).+)/,Qt=/^--/,Zt={position:"absolute",visibility:"hidden",display:"block"},te={letterSpacing:"0",fontWeight:"400"};function ee(t,e,n){var r=rt.exec(e);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):e}function ne(t,e,n,r,o,i){var a="width"===e?1:0,u=0,s=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(s+=_.css(t,n+ot[a],!0,o)),r?("content"===n&&(s-=_.css(t,"padding"+ot[a],!0,o)),"margin"!==n&&(s-=_.css(t,"border"+ot[a]+"Width",!0,o))):(s+=_.css(t,"padding"+ot[a],!0,o),"padding"!==n?s+=_.css(t,"border"+ot[a]+"Width",!0,o):u+=_.css(t,"border"+ot[a]+"Width",!0,o));return!r&&i>=0&&(s+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-i-s-u-.5))||0),s}function re(t,e,n){var r=zt(t),o=(!g.boxSizingReliable()||n)&&"border-box"===_.css(t,"boxSizing",!1,r),i=o,a=qt(t,e,r),u="offset"+e[0].toUpperCase()+e.slice(1);if(Vt.test(a)){if(!n)return a;a="auto"}return(!g.boxSizingReliable()&&o||!g.reliableTrDimensions()&&E(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===_.css(t,"display",!1,r))&&t.getClientRects().length&&(o="border-box"===_.css(t,"boxSizing",!1,r),(i=u in t)&&(a=t[u])),(a=parseFloat(a)||0)+ne(t,e,n||(o?"border":"content"),i,r,a)+"px"}function oe(t,e,n,r,o){return new oe.prototype.init(t,e,n,r,o)}_.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=qt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,i,a,u=G(e),s=Qt.test(e),c=t.style;if(s||(e=Xt(u)),a=_.cssHooks[e]||_.cssHooks[u],void 0===n)return a&&"get"in a&&void 0!==(o=a.get(t,!1,r))?o:c[e];"string"===(i=typeof n)&&(o=rt.exec(n))&&o[1]&&(n=ct(t,e,o),i="number"),null!=n&&n==n&&("number"!==i||s||(n+=o&&o[3]||(_.cssNumber[u]?"":"px")),g.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(s?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,r){var o,i,a,u=G(e);return Qt.test(e)||(e=Xt(u)),(a=_.cssHooks[e]||_.cssHooks[u])&&"get"in a&&(o=a.get(t,!0,n)),void 0===o&&(o=qt(t,e,r)),"normal"===o&&e in te&&(o=te[e]),""===n||n?(i=parseFloat(o),!0===n||isFinite(i)?i||0:o):o}}),_.each(["height","width"],(function(t,e){_.cssHooks[e]={get:function(t,n,r){if(n)return!Jt.test(_.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?re(t,e,r):Ut(t,Zt,(function(){return re(t,e,r)}))},set:function(t,n,r){var o,i=zt(t),a=!g.scrollboxSize()&&"absolute"===i.position,u=(a||r)&&"border-box"===_.css(t,"boxSizing",!1,i),s=r?ne(t,e,r,u,i):0;return u&&a&&(s-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(i[e])-ne(t,e,"border",!1,i)-.5)),s&&(o=rt.exec(n))&&"px"!==(o[3]||"px")&&(t.style[e]=n,n=_.css(t,e)),ee(0,n,s)}}})),_.cssHooks.marginLeft=$t(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(qt(t,"marginLeft"))||t.getBoundingClientRect().left-Ut(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),_.each({margin:"",padding:"",border:"Width"},(function(t,e){_.cssHooks[t+e]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];r<4;r++)o[t+ot[r]+e]=i[r]||i[r-2]||i[0];return o}},"margin"!==t&&(_.cssHooks[t+e].set=ee)})),_.fn.extend({css:function(t,e){return W(this,(function(t,e,n){var r,o,i={},a=0;if(Array.isArray(e)){for(r=zt(t),o=e.length;a<o;a++)i[e[a]]=_.css(t,e[a],!1,r);return i}return void 0!==n?_.style(t,e,n):_.css(t,e)}),t,e,arguments.length>1)}}),_.Tween=oe,oe.prototype={constructor:oe,init:function(t,e,n,r,o,i){this.elem=t,this.prop=n,this.easing=o||_.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=i||(_.cssNumber[n]?"":"px")},cur:function(){var t=oe.propHooks[this.prop];return t&&t.get?t.get(this):oe.propHooks._default.get(this)},run:function(t){var e,n=oe.propHooks[this.prop];return this.options.duration?this.pos=e=_.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):oe.propHooks._default.set(this),this}},oe.prototype.init.prototype=oe.prototype,oe.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=_.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){_.fx.step[t.prop]?_.fx.step[t.prop](t):1!==t.elem.nodeType||!_.cssHooks[t.prop]&&null==t.elem.style[Xt(t.prop)]?t.elem[t.prop]=t.now:_.style(t.elem,t.prop,t.now+t.unit)}}},oe.propHooks.scrollTop=oe.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},_.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},_.fx=oe.prototype.init,_.fx.step={};var ie,ae,ue=/^(?:toggle|show|hide)$/,se=/queueHooks$/;function ce(){ae&&(!1===y.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ce):n.setTimeout(ce,_.fx.interval),_.fx.tick())}function le(){return n.setTimeout((function(){ie=void 0})),ie=Date.now()}function fe(t,e){var n,r=0,o={height:t};for(e=e?1:0;r<4;r+=2-e)o["margin"+(n=ot[r])]=o["padding"+n]=t;return e&&(o.opacity=o.width=t),o}function de(t,e,n){for(var r,o=(me.tweeners[e]||[]).concat(me.tweeners["*"]),i=0,a=o.length;i<a;i++)if(r=o[i].call(n,e,t))return r}function me(t,e,n){var r,o,i=0,a=me.prefilters.length,u=_.Deferred().always((function(){delete s.elem})),s=function(){if(o)return!1;for(var e=ie||le(),n=Math.max(0,c.startTime+c.duration-e),r=1-(n/c.duration||0),i=0,a=c.tweens.length;i<a;i++)c.tweens[i].run(r);return u.notifyWith(t,[c,r,n]),r<1&&a?n:(a||u.notifyWith(t,[c,1,0]),u.resolveWith(t,[c]),!1)},c=u.promise({elem:t,props:_.extend({},e),opts:_.extend(!0,{specialEasing:{},easing:_.easing._default},n),originalProperties:e,originalOptions:n,startTime:ie||le(),duration:n.duration,tweens:[],createTween:function(e,n){var r=_.Tween(t,c.opts,e,n,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(r),r},stop:function(e){var n=0,r=e?c.tweens.length:0;if(o)return this;for(o=!0;n<r;n++)c.tweens[n].run(1);return e?(u.notifyWith(t,[c,1,0]),u.resolveWith(t,[c,e])):u.rejectWith(t,[c,e]),this}}),l=c.props;for(!function(t,e){var n,r,o,i,a;for(n in t)if(o=e[r=G(n)],i=t[n],Array.isArray(i)&&(o=i[1],i=t[n]=i[0]),n!==r&&(t[r]=i,delete t[n]),(a=_.cssHooks[r])&&"expand"in a)for(n in i=a.expand(i),delete t[r],i)n in t||(t[n]=i[n],e[n]=o);else e[r]=o}(l,c.opts.specialEasing);i<a;i++)if(r=me.prefilters[i].call(c,t,l,c.opts))return v(r.stop)&&(_._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return _.map(l,de,c),v(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),_.fx.timer(_.extend(s,{elem:t,anim:c,queue:c.opts.queue})),c}_.Animation=_.extend(me,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return ct(n.elem,t,rt.exec(e),n),n}]},tweener:function(t,e){v(t)?(e=t,t=["*"]):t=t.match(L);for(var n,r=0,o=t.length;r<o;r++)n=t[r],me.tweeners[n]=me.tweeners[n]||[],me.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var r,o,i,a,u,s,c,l,f="width"in e||"height"in e,d=this,m={},h=t.style,p=t.nodeType&&st(t),g=J.get(t,"fxshow");for(r in n.queue||(null==(a=_._queueHooks(t,"fx")).unqueued&&(a.unqueued=0,u=a.empty.fire,a.empty.fire=function(){a.unqueued||u()}),a.unqueued++,d.always((function(){d.always((function(){a.unqueued--,_.queue(t,"fx").length||a.empty.fire()}))}))),e)if(o=e[r],ue.test(o)){if(delete e[r],i=i||"toggle"===o,o===(p?"hide":"show")){if("show"!==o||!g||void 0===g[r])continue;p=!0}m[r]=g&&g[r]||_.style(t,r)}if((s=!_.isEmptyObject(e))||!_.isEmptyObject(m))for(r in f&&1===t.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(c=g&&g.display)&&(c=J.get(t,"display")),"none"===(l=_.css(t,"display"))&&(c?l=c:(dt([t],!0),c=t.style.display||c,l=_.css(t,"display"),dt([t]))),("inline"===l||"inline-block"===l&&null!=c)&&"none"===_.css(t,"float")&&(s||(d.done((function(){h.display=c})),null==c&&(l=h.display,c="none"===l?"":l)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",d.always((function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}))),s=!1,m)s||(g?"hidden"in g&&(p=g.hidden):g=J.access(t,"fxshow",{display:c}),i&&(g.hidden=!p),p&&dt([t],!0),d.done((function(){for(r in p||dt([t]),J.remove(t,"fxshow"),m)_.style(t,r,m[r])}))),s=de(p?g[r]:0,r,d),r in g||(g[r]=s.start,p&&(s.end=s.start,s.start=0))}],prefilter:function(t,e){e?me.prefilters.unshift(t):me.prefilters.push(t)}}),_.speed=function(t,e,n){var r=t&&"object"==typeof t?_.extend({},t):{complete:n||!n&&e||v(t)&&t,duration:t,easing:n&&e||e&&!v(e)&&e};return _.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in _.fx.speeds?r.duration=_.fx.speeds[r.duration]:r.duration=_.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&_.dequeue(this,r.queue)},r},_.fn.extend({fadeTo:function(t,e,n,r){return this.filter(st).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var o=_.isEmptyObject(t),i=_.speed(e,n,r),a=function(){var e=me(this,_.extend({},t),i);(o||J.get(this,"finish"))&&e.stop(!0)};return a.finish=a,o||!1===i.queue?this.each(a):this.queue(i.queue,a)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,o=null!=t&&t+"queueHooks",i=_.timers,a=J.get(this);if(o)a[o]&&a[o].stop&&r(a[o]);else for(o in a)a[o]&&a[o].stop&&se.test(o)&&r(a[o]);for(o=i.length;o--;)i[o].elem!==this||null!=t&&i[o].queue!==t||(i[o].anim.stop(n),e=!1,i.splice(o,1));!e&&n||_.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=J.get(this),r=n[t+"queue"],o=n[t+"queueHooks"],i=_.timers,a=r?r.length:0;for(n.finish=!0,_.queue(this,t,[]),o&&o.stop&&o.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===t&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<a;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish}))}}),_.each(["toggle","show","hide"],(function(t,e){var n=_.fn[e];_.fn[e]=function(t,r,o){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(fe(e,!0),t,r,o)}})),_.each({slideDown:fe("show"),slideUp:fe("hide"),slideToggle:fe("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){_.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}})),_.timers=[],_.fx.tick=function(){var t,e=0,n=_.timers;for(ie=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||_.fx.stop(),ie=void 0},_.fx.timer=function(t){_.timers.push(t),_.fx.start()},_.fx.interval=13,_.fx.start=function(){ae||(ae=!0,ce())},_.fx.stop=function(){ae=null},_.fx.speeds={slow:600,fast:200,_default:400},_.fn.delay=function(t,e){return t=_.fx&&_.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,r){var o=n.setTimeout(e,t);r.stop=function(){n.clearTimeout(o)}}))},function(){var t=y.createElement("input"),e=y.createElement("select").appendChild(y.createElement("option"));t.type="checkbox",g.checkOn=""!==t.value,g.optSelected=e.selected,(t=y.createElement("input")).value="t",t.type="radio",g.radioValue="t"===t.value}();var he,pe=_.expr.attrHandle;_.fn.extend({attr:function(t,e){return W(this,_.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){_.removeAttr(this,t)}))}}),_.extend({attr:function(t,e,n){var r,o,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===t.getAttribute?_.prop(t,e,n):(1===i&&_.isXMLDoc(t)||(o=_.attrHooks[e.toLowerCase()]||(_.expr.match.bool.test(e)?he:void 0)),void 0!==n?null===n?void _.removeAttr(t,e):o&&"set"in o&&void 0!==(r=o.set(t,n,e))?r:(t.setAttribute(e,n+""),n):o&&"get"in o&&null!==(r=o.get(t,e))?r:null==(r=_.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&E(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,o=e&&e.match(L);if(o&&1===t.nodeType)for(;n=o[r++];)t.removeAttribute(n)}}),he={set:function(t,e,n){return!1===e?_.removeAttr(t,n):t.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=pe[e]||_.find.attr;pe[e]=function(t,e,r){var o,i,a=e.toLowerCase();return r||(i=pe[a],pe[a]=o,o=null!=n(t,e,r)?a:null,pe[a]=i),o}}));var ge=/^(?:input|select|textarea|button)$/i,ve=/^(?:a|area)$/i;function be(t){return(t.match(L)||[]).join(" ")}function ye(t){return t.getAttribute&&t.getAttribute("class")||""}function xe(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(L)||[]}_.fn.extend({prop:function(t,e){return W(this,_.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[_.propFix[t]||t]}))}}),_.extend({prop:function(t,e,n){var r,o,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&_.isXMLDoc(t)||(e=_.propFix[e]||e,o=_.propHooks[e]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(t,n,e))?r:t[e]=n:o&&"get"in o&&null!==(r=o.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=_.find.attr(t,"tabindex");return e?parseInt(e,10):ge.test(t.nodeName)||ve.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(_.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){_.propFix[this.toLowerCase()]=this})),_.fn.extend({addClass:function(t){var e,n,r,o,i,a,u,s=0;if(v(t))return this.each((function(e){_(this).addClass(t.call(this,e,ye(this)))}));if((e=xe(t)).length)for(;n=this[s++];)if(o=ye(n),r=1===n.nodeType&&" "+be(o)+" "){for(a=0;i=e[a++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");o!==(u=be(r))&&n.setAttribute("class",u)}return this},removeClass:function(t){var e,n,r,o,i,a,u,s=0;if(v(t))return this.each((function(e){_(this).removeClass(t.call(this,e,ye(this)))}));if(!arguments.length)return this.attr("class","");if((e=xe(t)).length)for(;n=this[s++];)if(o=ye(n),r=1===n.nodeType&&" "+be(o)+" "){for(a=0;i=e[a++];)for(;r.indexOf(" "+i+" ")>-1;)r=r.replace(" "+i+" "," ");o!==(u=be(r))&&n.setAttribute("class",u)}return this},toggleClass:function(t,e){var n=typeof t,r="string"===n||Array.isArray(t);return"boolean"==typeof e&&r?e?this.addClass(t):this.removeClass(t):v(t)?this.each((function(n){_(this).toggleClass(t.call(this,n,ye(this),e),e)})):this.each((function(){var e,o,i,a;if(r)for(o=0,i=_(this),a=xe(t);e=a[o++];)i.hasClass(e)?i.removeClass(e):i.addClass(e);else void 0!==t&&"boolean"!==n||((e=ye(this))&&J.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":J.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+be(ye(n))+" ").indexOf(e)>-1)return!0;return!1}});var we=/\r/g;_.fn.extend({val:function(t){var e,n,r,o=this[0];return arguments.length?(r=v(t),this.each((function(n){var o;1===this.nodeType&&(null==(o=r?t.call(this,n,_(this).val()):t)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=_.map(o,(function(t){return null==t?"":t+""}))),(e=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))}))):o?(e=_.valHooks[o.type]||_.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(we,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(t){var e=_.find.attr(t,"value");return null!=e?e:be(_.text(t))}},select:{get:function(t){var e,n,r,o=t.options,i=t.selectedIndex,a="select-one"===t.type,u=a?null:[],s=a?i+1:o.length;for(r=i<0?s:a?i:0;r<s;r++)if(((n=o[r]).selected||r===i)&&!n.disabled&&(!n.parentNode.disabled||!E(n.parentNode,"optgroup"))){if(e=_(n).val(),a)return e;u.push(e)}return u},set:function(t,e){for(var n,r,o=t.options,i=_.makeArray(e),a=o.length;a--;)((r=o[a]).selected=_.inArray(_.valHooks.option.get(r),i)>-1)&&(n=!0);return n||(t.selectedIndex=-1),i}}}}),_.each(["radio","checkbox"],(function(){_.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=_.inArray(_(t).val(),e)>-1}},g.checkOn||(_.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),g.focusin="onfocusin"in n;var Ce=/^(?:focusinfocus|focusoutblur)$/,_e=function(t){t.stopPropagation()};_.extend(_.event,{trigger:function(t,e,r,o){var i,a,u,s,c,l,f,d,h=[r||y],p=m.call(t,"type")?t.type:t,g=m.call(t,"namespace")?t.namespace.split("."):[];if(a=d=u=r=r||y,3!==r.nodeType&&8!==r.nodeType&&!Ce.test(p+_.event.triggered)&&(p.indexOf(".")>-1&&(g=p.split("."),p=g.shift(),g.sort()),c=p.indexOf(":")<0&&"on"+p,(t=t[_.expando]?t:new _.Event(p,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),e=null==e?[t]:_.makeArray(e,[t]),f=_.event.special[p]||{},o||!f.trigger||!1!==f.trigger.apply(r,e))){if(!o&&!f.noBubble&&!b(r)){for(s=f.delegateType||p,Ce.test(s+p)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(r.ownerDocument||y)&&h.push(u.defaultView||u.parentWindow||n)}for(i=0;(a=h[i++])&&!t.isPropagationStopped();)d=a,t.type=i>1?s:f.bindType||p,(l=(J.get(a,"events")||Object.create(null))[t.type]&&J.get(a,"handle"))&&l.apply(a,e),(l=c&&a[c])&&l.apply&&K(a)&&(t.result=l.apply(a,e),!1===t.result&&t.preventDefault());return t.type=p,o||t.isDefaultPrevented()||f._default&&!1!==f._default.apply(h.pop(),e)||!K(r)||c&&v(r[p])&&!b(r)&&((u=r[c])&&(r[c]=null),_.event.triggered=p,t.isPropagationStopped()&&d.addEventListener(p,_e),r[p](),t.isPropagationStopped()&&d.removeEventListener(p,_e),_.event.triggered=void 0,u&&(r[c]=u)),t.result}},simulate:function(t,e,n){var r=_.extend(new _.Event,n,{type:t,isSimulated:!0});_.event.trigger(r,null,e)}}),_.fn.extend({trigger:function(t,e){return this.each((function(){_.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return _.event.trigger(t,e,n,!0)}}),g.focusin||_.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){_.event.simulate(e,t.target,_.event.fix(t))};_.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,o=J.access(r,e);o||r.addEventListener(t,n,!0),J.access(r,e,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,o=J.access(r,e)-1;o?J.access(r,e,o):(r.removeEventListener(t,n,!0),J.remove(r,e))}}}));var ke=n.location,Se={guid:Date.now()},Te=/\?/;_.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||_.error("Invalid XML: "+t),e};var De=/\[\]$/,Oe=/\r?\n/g,Ee=/^(?:submit|button|image|reset|file)$/i,Ne=/^(?:input|select|textarea|keygen)/i;function Ae(t,e,n,r){var o;if(Array.isArray(e))_.each(e,(function(e,o){n||De.test(t)?r(t,o):Ae(t+"["+("object"==typeof o&&null!=o?e:"")+"]",o,n,r)}));else if(n||"object"!==C(e))r(t,e);else for(o in e)Ae(t+"["+o+"]",e[o],n,r)}_.param=function(t,e){var n,r=[],o=function(t,e){var n=v(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!_.isPlainObject(t))_.each(t,(function(){o(this.name,this.value)}));else for(n in t)Ae(n,t[n],e,o);return r.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=_.prop(this,"elements");return t?_.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!_(this).is(":disabled")&&Ne.test(this.nodeName)&&!Ee.test(t)&&(this.checked||!pt.test(t))})).map((function(t,e){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,(function(t){return{name:e.name,value:t.replace(Oe,"\r\n")}})):{name:e.name,value:n.replace(Oe,"\r\n")}})).get()}});var Re=/%20/g,Be=/#.*$/,Pe=/([?&])_=[^&]*/,Ie=/^(.*?):[ \t]*([^\r\n]*)$/gm,Me=/^(?:GET|HEAD)$/,Le=/^\/\//,Fe={},He={},je="*/".concat("*"),Ve=y.createElement("a");function ze(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,o=0,i=e.toLowerCase().match(L)||[];if(v(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Ue(t,e,n,r){var o={},i=t===He;function a(u){var s;return o[u]=!0,_.each(t[u]||[],(function(t,u){var c=u(e,n,r);return"string"!=typeof c||i||o[c]?i?!(s=c):void 0:(e.dataTypes.unshift(c),a(c),!1)})),s}return a(e.dataTypes[0])||!o["*"]&&a("*")}function We(t,e){var n,r,o=_.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((o[n]?t:r||(r={}))[n]=e[n]);return r&&_.extend(!0,t,r),t}Ve.href=ke.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ke.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ke.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":je,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?We(We(t,_.ajaxSettings),e):We(_.ajaxSettings,t)},ajaxPrefilter:ze(Fe),ajaxTransport:ze(He),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,o,i,a,u,s,c,l,f,d,m=_.ajaxSetup({},e),h=m.context||m,p=m.context&&(h.nodeType||h.jquery)?_(h):_.event,g=_.Deferred(),v=_.Callbacks("once memory"),b=m.statusCode||{},x={},w={},C="canceled",k={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=Ie.exec(i);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?i:null},setRequestHeader:function(t,e){return null==c&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,x[t]=e),this},overrideMimeType:function(t){return null==c&&(m.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)k.always(t[k.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||C;return r&&r.abort(e),S(0,e),this}};if(g.promise(k),m.url=((t||m.url||ke.href)+"").replace(Le,ke.protocol+"//"),m.type=e.method||e.type||m.method||m.type,m.dataTypes=(m.dataType||"*").toLowerCase().match(L)||[""],null==m.crossDomain){s=y.createElement("a");try{s.href=m.url,s.href=s.href,m.crossDomain=Ve.protocol+"//"+Ve.host!=s.protocol+"//"+s.host}catch(t){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=_.param(m.data,m.traditional)),Ue(Fe,m,e,k),c)return k;for(f in(l=_.event&&m.global)&&0==_.active++&&_.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!Me.test(m.type),o=m.url.replace(Be,""),m.hasContent?m.data&&m.processData&&0===(m.contentType||"").indexOf("application/x-www-form-urlencoded")&&(m.data=m.data.replace(Re,"+")):(d=m.url.slice(o.length),m.data&&(m.processData||"string"==typeof m.data)&&(o+=(Te.test(o)?"&":"?")+m.data,delete m.data),!1===m.cache&&(o=o.replace(Pe,"$1"),d=(Te.test(o)?"&":"?")+"_="+Se.guid+++d),m.url=o+d),m.ifModified&&(_.lastModified[o]&&k.setRequestHeader("If-Modified-Since",_.lastModified[o]),_.etag[o]&&k.setRequestHeader("If-None-Match",_.etag[o])),(m.data&&m.hasContent&&!1!==m.contentType||e.contentType)&&k.setRequestHeader("Content-Type",m.contentType),k.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+je+"; q=0.01":""):m.accepts["*"]),m.headers)k.setRequestHeader(f,m.headers[f]);if(m.beforeSend&&(!1===m.beforeSend.call(h,k,m)||c))return k.abort();if(C="abort",v.add(m.complete),k.done(m.success),k.fail(m.error),r=Ue(He,m,e,k)){if(k.readyState=1,l&&p.trigger("ajaxSend",[k,m]),c)return k;m.async&&m.timeout>0&&(u=n.setTimeout((function(){k.abort("timeout")}),m.timeout));try{c=!1,r.send(x,S)}catch(t){if(c)throw t;S(-1,t)}}else S(-1,"No Transport");function S(t,e,a,s){var f,d,y,x,w,C=e;c||(c=!0,u&&n.clearTimeout(u),r=void 0,i=s||"",k.readyState=t>0?4:0,f=t>=200&&t<300||304===t,a&&(x=function(t,e,n){for(var r,o,i,a,u=t.contents,s=t.dataTypes;"*"===s[0];)s.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(o in u)if(u[o]&&u[o].test(r)){s.unshift(o);break}if(s[0]in n)i=s[0];else{for(o in n){if(!s[0]||t.converters[o+" "+s[0]]){i=o;break}a||(a=o)}i=i||a}if(i)return i!==s[0]&&s.unshift(i),n[i]}(m,k,a)),!f&&_.inArray("script",m.dataTypes)>-1&&(m.converters["text script"]=function(){}),x=function(t,e,n,r){var o,i,a,u,s,c={},l=t.dataTypes.slice();if(l[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];for(i=l.shift();i;)if(t.responseFields[i]&&(n[t.responseFields[i]]=e),!s&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),s=i,i=l.shift())if("*"===i)i=s;else if("*"!==s&&s!==i){if(!(a=c[s+" "+i]||c["* "+i]))for(o in c)if((u=o.split(" "))[1]===i&&(a=c[s+" "+u[0]]||c["* "+u[0]])){!0===a?a=c[o]:!0!==c[o]&&(i=u[0],l.unshift(u[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+s+" to "+i}}}return{state:"success",data:e}}(m,x,k,f),f?(m.ifModified&&((w=k.getResponseHeader("Last-Modified"))&&(_.lastModified[o]=w),(w=k.getResponseHeader("etag"))&&(_.etag[o]=w)),204===t||"HEAD"===m.type?C="nocontent":304===t?C="notmodified":(C=x.state,d=x.data,f=!(y=x.error))):(y=C,!t&&C||(C="error",t<0&&(t=0))),k.status=t,k.statusText=(e||C)+"",f?g.resolveWith(h,[d,C,k]):g.rejectWith(h,[k,C,y]),k.statusCode(b),b=void 0,l&&p.trigger(f?"ajaxSuccess":"ajaxError",[k,m,f?d:y]),v.fireWith(h,[k,C]),l&&(p.trigger("ajaxComplete",[k,m]),--_.active||_.event.trigger("ajaxStop")))}return k},getJSON:function(t,e,n){return _.get(t,e,n,"json")},getScript:function(t,e){return _.get(t,void 0,e,"script")}}),_.each(["get","post"],(function(t,e){_[e]=function(t,n,r,o){return v(n)&&(o=o||r,r=n,n=void 0),_.ajax(_.extend({url:t,type:e,dataType:o,data:n,success:r},_.isPlainObject(t)&&t))}})),_.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),_._evalUrl=function(t,e,n){return _.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){_.globalEval(t,e,n)}})},_.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=_(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){_(this).wrapInner(t.call(this,e))})):this.each((function(){var e=_(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(n){_(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){_(this).replaceWith(this.childNodes)})),this}}),_.expr.pseudos.hidden=function(t){return!_.expr.pseudos.visible(t)},_.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var qe={0:200,1223:204},$e=_.ajaxSettings.xhr();g.cors=!!$e&&"withCredentials"in $e,g.ajax=$e=!!$e,_.ajaxTransport((function(t){var e,r;if(g.cors||$e&&!t.crossDomain)return{send:function(o,i){var a,u=t.xhr();if(u.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)u[a]=t.xhrFields[a];for(a in t.mimeType&&u.overrideMimeType&&u.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)u.setRequestHeader(a,o[a]);e=function(t){return function(){e&&(e=r=u.onload=u.onerror=u.onabort=u.ontimeout=u.onreadystatechange=null,"abort"===t?u.abort():"error"===t?"number"!=typeof u.status?i(0,"error"):i(u.status,u.statusText):i(qe[u.status]||u.status,u.statusText,"text"!==(u.responseType||"text")||"string"!=typeof u.responseText?{binary:u.response}:{text:u.responseText},u.getAllResponseHeaders()))}},u.onload=e(),r=u.onerror=u.ontimeout=e("error"),void 0!==u.onabort?u.onabort=r:u.onreadystatechange=function(){4===u.readyState&&n.setTimeout((function(){e&&r()}))},e=e("abort");try{u.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),_.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return _.globalEval(t),t}}}),_.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),_.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,o){e=_("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&o("error"===t.type?404:200,t.type)}),y.head.appendChild(e[0])},abort:function(){n&&n()}}}));var Ye,Ge=[],Ke=/(=)\?(?=&|$)|\?\?/;_.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ge.pop()||_.expando+"_"+Se.guid++;return this[t]=!0,t}}),_.ajaxPrefilter("json jsonp",(function(t,e,r){var o,i,a,u=!1!==t.jsonp&&(Ke.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ke.test(t.data)&&"data");if(u||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,u?t[u]=t[u].replace(Ke,"$1"+o):!1!==t.jsonp&&(t.url+=(Te.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return a||_.error(o+" was not called"),a[0]},t.dataTypes[0]="json",i=n[o],n[o]=function(){a=arguments},r.always((function(){void 0===i?_(n).removeProp(o):n[o]=i,t[o]&&(t.jsonpCallback=e.jsonpCallback,Ge.push(o)),a&&v(i)&&i(a[0]),a=i=void 0})),"script"})),g.createHTMLDocument=((Ye=y.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ye.childNodes.length),_.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(g.createHTMLDocument?((r=(e=y.implementation.createHTMLDocument("")).createElement("base")).href=y.location.href,e.head.appendChild(r)):e=y),i=!n&&[],(o=N.exec(t))?[e.createElement(o[1])]:(o=Ct([t],e,i),i&&i.length&&_(i).remove(),_.merge([],o.childNodes)));var r,o,i},_.fn.load=function(t,e,n){var r,o,i,a=this,u=t.indexOf(" ");return u>-1&&(r=be(t.slice(u)),t=t.slice(0,u)),v(e)?(n=e,e=void 0):e&&"object"==typeof e&&(o="POST"),a.length>0&&_.ajax({url:t,type:o||"GET",dataType:"html",data:e}).done((function(t){i=arguments,a.html(r?_("<div>").append(_.parseHTML(t)).find(r):t)})).always(n&&function(t,e){a.each((function(){n.apply(this,i||[t.responseText,e,t])}))}),this},_.expr.pseudos.animated=function(t){return _.grep(_.timers,(function(e){return t===e.elem})).length},_.offset={setOffset:function(t,e,n){var r,o,i,a,u,s,c=_.css(t,"position"),l=_(t),f={};"static"===c&&(t.style.position="relative"),u=l.offset(),i=_.css(t,"top"),s=_.css(t,"left"),("absolute"===c||"fixed"===c)&&(i+s).indexOf("auto")>-1?(a=(r=l.position()).top,o=r.left):(a=parseFloat(i)||0,o=parseFloat(s)||0),v(e)&&(e=e.call(t,n,_.extend({},u))),null!=e.top&&(f.top=e.top-u.top+a),null!=e.left&&(f.left=e.left-u.left+o),"using"in e?e.using.call(t,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),l.css(f))}},_.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){_.offset.setOffset(this,t,e)}));var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,r=this[0],o={top:0,left:0};if("fixed"===_.css(r,"position"))e=r.getBoundingClientRect();else{for(e=this.offset(),n=r.ownerDocument,t=r.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===_.css(t,"position");)t=t.parentNode;t&&t!==r&&1===t.nodeType&&((o=_(t).offset()).top+=_.css(t,"borderTopWidth",!0),o.left+=_.css(t,"borderLeftWidth",!0))}return{top:e.top-o.top-_.css(r,"marginTop",!0),left:e.left-o.left-_.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===_.css(t,"position");)t=t.offsetParent;return t||it}))}}),_.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;_.fn[t]=function(r){return W(this,(function(t,r,o){var i;if(b(t)?i=t:9===t.nodeType&&(i=t.defaultView),void 0===o)return i?i[e]:t[r];i?i.scrollTo(n?i.pageXOffset:o,n?o:i.pageYOffset):t[r]=o}),t,r,arguments.length)}})),_.each(["top","left"],(function(t,e){_.cssHooks[e]=$t(g.pixelPosition,(function(t,n){if(n)return n=qt(t,e),Vt.test(n)?_(t).position()[e]+"px":n}))})),_.each({Height:"height",Width:"width"},(function(t,e){_.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,r){_.fn[r]=function(o,i){var a=arguments.length&&(n||"boolean"!=typeof o),u=n||(!0===o||!0===i?"margin":"border");return W(this,(function(e,n,o){var i;return b(e)?0===r.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(i=e.documentElement,Math.max(e.body["scroll"+t],i["scroll"+t],e.body["offset"+t],i["offset"+t],i["client"+t])):void 0===o?_.css(e,n,u):_.style(e,n,o,u)}),e,a?o:void 0,a)}}))})),_.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){_.fn[e]=function(t){return this.on(e,t)}})),_.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),_.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){_.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var Xe=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;_.proxy=function(t,e){var n,r,o;if("string"==typeof e&&(n=t[e],e=t,t=n),v(t))return r=u.call(arguments,2),(o=function(){return t.apply(e||this,r.concat(u.call(arguments)))}).guid=t.guid=t.guid||_.guid++,o},_.holdReady=function(t){t?_.readyWait++:_.ready(!0)},_.isArray=Array.isArray,_.parseJSON=JSON.parse,_.nodeName=E,_.isFunction=v,_.isWindow=b,_.camelCase=G,_.type=C,_.now=Date.now,_.isNumeric=function(t){var e=_.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},_.trim=function(t){return null==t?"":(t+"").replace(Xe,"")},void 0===(r=function(){return _}.apply(e,[]))||(t.exports=r);var Je=n.jQuery,Qe=n.$;return _.noConflict=function(t){return n.$===_&&(n.$=Qe),t&&n.jQuery===_&&(n.jQuery=Je),_},void 0===o&&(n.jQuery=n.$=_),_}))},"GC/X":function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.ui.escapeSelector=(e=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,function(t){return t.replace(e,"\\$1")});var e})?r.apply(e,o):r)||(t.exports=i)},HSsa:function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},JAFY:function(t,e){!function(t){"use strict";var e,n,r,o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(){},u=function(t){return function(){return t}},s=function(t){return function(e){return!t(e)}},c=u(!1),l=u(!0),f=function(){return d},d=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:c,isSome:c,isNone:l,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:n,orThunk:e,map:f,each:a,bind:f,exists:c,forall:l,filter:f,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}}(),m=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:l,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return m(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:d},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return o},h={some:m,none:f,from:function(t){return null==t?d:m(t)}},p=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},g=function(t){return function(e){return typeof e===t}},v=p("string"),b=p("array"),y=g("boolean"),x=g("function"),w=g("number"),C=Array.prototype.slice,_=Array.prototype.push,k=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},S=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},T=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},D=function(t,e,n){return S(t,(function(t){n=e(n,t)})),n},O=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return h.some(i);if(n(i,r))break}return h.none()},E=function(t,e){return O(t,e,c)},N=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!b(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);_.apply(e,t[n])}return e}(k(t,e))},A=function(t){var e=C.call(t,0);return e.reverse(),e},R=function(t){return 0===t.length?h.none():h.some(t[0])},B=function(t){return 0===t.length?h.none():h.some(t[t.length-1])},P=function(){return(P=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},I=function(){return M(0,0)},M=function(t,e){return{major:t,minor:e}},L={nu:M,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?I():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return M(r(1),r(2))}(t,n)},unknown:I},F=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},H={unknown:function(){return F({current:void 0,version:L.unknown()})},nu:F,edge:u("Edge"),chrome:u("Chrome"),ie:u("IE"),opera:u("Opera"),firefox:u("Firefox"),safari:u("Safari")},j=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},V={unknown:function(){return j({current:void 0,version:L.unknown()})},nu:j,windows:u("Windows"),ios:u("iOS"),android:u("Android"),linux:u("Linux"),osx:u("OSX"),solaris:u("Solaris"),freebsd:u("FreeBSD"),chromeos:u("ChromeOS")},z=function(t,e){var n=String(e).toLowerCase();return E(t,(function(t){return t.search(n)}))},U=function(t,e){return z(t,e).map((function(t){var n=L.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},W=function(t,e){return z(t,e).map((function(t){var n=L.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},q=function(t,e){return-1!==t.indexOf(e)},$=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Y=function(t){return function(e){return q(e,t)}},G=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return q(t,"edge/")&&q(t,"chrome")&&q(t,"safari")&&q(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,$],search:function(t){return q(t,"chrome")&&!q(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return q(t,"msie")||q(t,"trident")}},{name:"Opera",versionRegexes:[$,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Y("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Y("firefox")},{name:"Safari",versionRegexes:[$,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(q(t,"safari")||q(t,"mobile/"))&&q(t,"applewebkit")}}],K=[{name:"Windows",search:Y("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return q(t,"iphone")||q(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Y("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Y("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Y("linux"),versionRegexes:[]},{name:"Solaris",search:Y("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Y("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Y("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],X={browsers:u(G),oses:u(K)},J=function(t,e){var n=X.browsers(),r=X.oses(),o=U(n,t).fold(H.unknown,H.nu),i=W(r,t).fold(V.unknown,V.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),s=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),l=i||a&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!c&&!f;return{isiPad:u(o),isiPhone:u(i),isTablet:u(c),isPhone:u(l),isTouch:u(s),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:u(f),isDesktop:u(d)}}(i,o,t,e);return{browser:o,os:i,deviceType:a}},Q=function(e){return t.window.matchMedia(e).matches},Z=(e=function(){return J(t.navigator.userAgent,Q)},r=!1,function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return r||(r=!0,n=e.apply(null,t)),n}),tt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:u(t)}},et={fromHtml:function(e,n){var r=(n||t.document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||r.childNodes.length>1)throw t.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return tt(r.childNodes[0])},fromTag:function(e,n){var r=(n||t.document).createElement(e);return tt(r)},fromText:function(e,n){var r=(n||t.document).createTextNode(e);return tt(r)},fromDom:tt,fromPoint:function(t,e,n){var r=t.dom();return h.from(r.elementFromPoint(e,n)).map(tt)}},nt=function(t,e){return t.dom()===e.dom()},rt=function(e,n){return r=e.dom(),o=n.dom(),function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(r,o,t.Node.DOCUMENT_POSITION_CONTAINED_BY);var r,o},ot=function(t,e){return Z().browser.isIE()?rt(t,e):function(t,e){var n=t.dom(),r=e.dom();return n!==r&&n.contains(r)}(t,e)},it=function(t,e){var n=t.dom();if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},at=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),ut=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),st=tinymce.util.Tools.resolve("tinymce.util.VK"),ct=function(t,e,n){return t.isSome()&&e.isSome()?h.some(n(t.getOrDie(),e.getOrDie())):h.none()},lt=(void 0!==t.window?t.window:Function("return this;")(),function(t){return t.dom().nodeName.toLowerCase()}),ft=(o=1,function(t){return function(t){return t.dom().nodeType}(t)===o}),dt=function(t){return h.from(t.dom().parentNode).map(et.fromDom)},mt=function(t){return k(t.dom().childNodes,et.fromDom)},ht=function(t,e){var n=t.dom().childNodes;return h.from(n[e]).map(et.fromDom)},pt=function(t){return ht(t,0)},gt=function(t){return ht(t,t.dom().childNodes.length-1)},vt=function(t,e){dt(t).each((function(n){n.dom().insertBefore(e.dom(),t.dom())}))},bt=function(t,e){t.dom().appendChild(e.dom())},yt=function(t,e){S(e,(function(e){bt(t,e)}))},xt=function(t){var e=t.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},wt=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},Ct=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),_t=tinymce.util.Tools.resolve("tinymce.util.Tools"),kt=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},St=function(t){return function(e){return e&&t.test(e.nodeName)}},Tt=function(t){return t&&3===t.nodeType},Dt=St(/^(OL|UL|DL)$/),Ot=St(/^(OL|UL)$/),Et=kt("ol"),Nt=St(/^(LI|DT|DD)$/),At=St(/^(DT|DD)$/),Rt=St(/^(TH|TD)$/),Bt=kt("br"),Pt=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},It=function(t,e){return t&&t.nodeName in e},Mt=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},Lt=function(t,e){return t.isChildOf(e,t.getRoot())},Ft=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",Vt(t,n))},Ht=function(t){var e=Ft(t),n=t.selection.getSelectedBlocks();return function(t,e){return t&&1===e.length&&e[0]===t}(e,n)?function(t){return _t.grep(t.querySelectorAll("ol,ul,dl"),(function(t){return Dt(t)}))}(e):_t.grep(n,(function(t){return Dt(t)&&e!==t}))},jt=function(t){var e=t.selection.getSelectedBlocks();return _t.grep(function(t,e){var n=_t.map(e,(function(e){var n=t.dom.getParent(e,"li,dd,dt",Vt(t,e));return n||e}));return Ct.unique(n)}(t,e),(function(t){return Nt(t)}))},Vt=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},zt=function(t,e){var n=t.dom.getParents(e,"ol,ul",Vt(t,e));return B(n)},Ut=function(t){var e=function(t){var e=zt(t,t.selection.getStart()),n=T(t.selection.getSelectedBlocks(),Ot);return e.toArray().concat(n)}(t);return Wt(t,e)},Wt=function(t,e){var n=k(e,(function(e){return zt(t,e).getOr(e)}));return Ct.unique(n)},qt=function(t,e){var n,r,o,i=t.dom,a=t.schema.getBlockElements(),u=i.createFragment(),s=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e}(t);if(s&&((r=i.create(s)).tagName===s.toUpperCase()&&i.setAttribs(r,function(t){return t.getParam("forced_root_block_attrs",{})}(t)),It(e.firstChild,a)||u.appendChild(r)),e)for(;n=e.firstChild;){var c=n.nodeName;o||"SPAN"===c&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),It(n,a)?(u.appendChild(n),r=null):s?(r||(r=i.create(s),u.appendChild(r)),r.appendChild(n)):u.appendChild(n)}return s?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):u.appendChild(i.create("br")),u},$t=Object.keys,Yt=function(t,e){for(var n=$t(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Gt=function(t,e){var n={};return function(t,e,n,r){Yt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),a),n},Kt=function(e,n){var r=e.dom();Yt(n,(function(e,n){!function(e,n,r){if(!(v(r)||y(r)||w(r)))throw t.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,r+"")}(r,n,e)}))},Xt=function(t){return D(t.dom().attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Jt=(x(t.Element.prototype.attachShadow)&&x(t.Node.prototype.getRootNode),function(e,n,r){if(!v(r))throw t.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",e),new Error("CSS value must be a string: "+r);(function(t){return void 0!==t.style&&x(t.style.getPropertyValue)})(e)&&e.style.setProperty(n,r)}),Qt=function(t){return function(t,e){return et.fromDom(t.dom().cloneNode(e))}(t,!0)},Zt=function(t,e){var n=function(t,e){var n=et.fromTag(e),r=Xt(t);return Kt(n,r),n}(t,e);vt(t,n);var r=mt(t);return yt(n,r),xt(t),n},te=function(t,e){bt(t.item,e.list)},ee=function(t,e){var n={list:et.fromTag(e,t),item:et.fromTag("li",t)};return bt(n.list,n.item),n},ne=function(t,e,n){var r=e.slice(0,n.depth);return B(r).each((function(e){!function(t,e){bt(t.list,e),t.item=e}(e,function(t,e,n){var r=et.fromTag("li",t);return Kt(r,e),yt(r,n),r}(t,n.itemAttributes,n.content)),function(t,e){lt(t.list)!==e.listType&&(t.list=Zt(t.list,e.listType)),Kt(t.list,e.listAttributes)}(e,n)})),r},re=function(t,e,n){var r,o=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(ee(t,e.listType));return r}(t,n,n.depth-e.length);return function(t){for(var e=1;e<t.length;e++)te(t[e-1],t[e])}(o),function(t,e){for(var n=0;n<t.length-1;n++)r=t[n].item,o="list-style-type",i="none",a=void 0,a=r.dom(),Jt(a,o,i);var r,o,i,a;B(t).each((function(t){Kt(t.list,e.listAttributes),Kt(t.item,e.itemAttributes),yt(t.item,e.content)}))}(o,n),r=o,ct(B(e),R(r),te),e.concat(o)},oe=function(t){return it(t,"OL,UL")},ie=function(t){return pt(t).map(oe).getOr(!1)},ae=function(t){return t.depth>0},ue=function(t){return t.isSelected},se=function(t){var e=mt(t),n=gt(t).map(oe).getOr(!1)?e.slice(0,-1):e;return k(n,Qt)},ce=function(t){return S(t,(function(e,n){(function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return O(A(t.slice(0,e)),r,o).orThunk((function(){return O(t.slice(e+1),r,o)}))})(t,n).fold((function(){e.dirty&&function(t){t.listAttributes=Gt(t.listAttributes,(function(t,e){return"start"!==e}))}(e)}),(function(t){return r=t,(n=e).listType=r.listType,void(n.listAttributes=P({},r.listAttributes));var n,r}))})),t},le=function(t,e,n,r){return pt(r).filter(oe).fold((function(){e.each((function(t){nt(t.start,r)&&n.set(!0)}));var o=function(t,e,n){return dt(t).filter(ft).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:se(t),itemAttributes:Xt(t),listAttributes:Xt(r),listType:lt(r)}}))}(r,t,n.get());e.each((function(t){nt(t.end,r)&&n.set(!1)}));var i=gt(r).filter(oe).map((function(r){return fe(t,e,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return fe(t,e,n,r)}))},fe=function(t,e,n,r){return N(mt(r),(function(r){return(oe(r)?fe:le)(t+1,e,n,r)}))},de=function(e,n){var r=ce(n);return k(r,(function(n){var r,o,i,a=(r=n.content,i=(o||t.document).createDocumentFragment(),S(r,(function(t){i.appendChild(t.dom())})),et.fromDom(i));return et.fromDom(qt(e,a.dom()))}))},me=function(t,e){var n=ce(e);return function(t,e){var n=D(e,(function(e,n){return n.depth>e.length?re(t,e,n):ne(t,e,n)}),[]);return R(n).map((function(t){return t.list}))}(t.contentDocument,n).toArray()},he=function(t,e,n){var r=function(t,e){var n,r=(n=!1,{get:function(){return n},set:function(t){n=t}});return k(t,(function(t){return{sourceList:t,entries:fe(0,e,r,t)}}))}(e,function(t){var e=k(jt(t),et.fromDom);return ct(E(e,s(ie)),E(A(e),s(ie)),(function(t,e){return{start:t,end:e}}))}(t));S(r,(function(e){!function(t,e){S(T(t,ue),(function(t){return function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0}(e,t)}))}(e.entries,n);var r,o=function(t,e){return N(function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,a=t.length;i<a;i++){var u=t[i],s=e(u);s!==n&&(r.push(o),o=[]),n=s,o.push(u)}return 0!==o.length&&r.push(o),r}(e,ae),(function(e){return R(e).map(ae).getOr(!1)?me(t,e):de(t,e)}))}(t,e.entries);S(o,(function(e){wt(t,"Indent"===n?"IndentList":"OutdentList",e.dom())})),r=e.sourceList,S(o,(function(t){vt(r,t)})),xt(e.sourceList)}))},pe=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),ge=pe.DOM,ve=function(t,e){it(e,"dd")?Zt(e,"dt"):it(e,"dt")&&dt(e).each((function(n){return function(t,e,n){var r=ge.select('span[data-mce-type="bookmark"]',e),o=qt(t,n),i=ge.createRng();i.setStartAfter(n),i.setEndAfter(e);for(var a,u=i.extractContents(),s=u.firstChild;s;s=s.firstChild)if("LI"===s.nodeName&&t.dom.isEmpty(s)){ge.remove(s);break}t.dom.isEmpty(u)||ge.insertAfter(u,e),ge.insertAfter(o,e),Mt(t.dom,n.parentNode)&&(a=n.parentNode,_t.each(r,(function(t){a.parentNode.insertBefore(t,n.parentNode)})),ge.remove(a)),ge.remove(n),Mt(t.dom,e)&&ge.remove(e)}(t,n.dom(),e.dom())}))},be=function(t){it(t,"dt")&&Zt(t,"dd")},ye=function(t,e){if(Tt(t))return{container:t,offset:e};var n=at.getNode(t,e);return Tt(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&Tt(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&Tt(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},xe=function(t){var e=t.cloneRange(),n=ye(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=ye(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},we=function(t,e){var n=k(Ut(t),et.fromDom),r=k(function(t){return T(jt(t),At)}(t),et.fromDom),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();he(t,n,e),function(t,e,n){S(n,"Indent"===e?be:function(e){return ve(t,e)})}(t,e,r),t.selection.moveToBookmark(i),t.selection.setRng(xe(t.selection.getRng())),t.nodeChanged(),o=!0}return o},Ce=function(t){return we(t,"Indent")},_e=function(t){return we(t,"Outdent")},ke=function(t){return we(t,"Flatten")},Se=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Te=pe.DOM,De=function(t){var e={},n=function(n){var r,o,i;o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1===o.nodeType&&(r=Te.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(i=Math.min(i,o.childNodes.length-1),n?o.insertBefore(r,o.childNodes[i]):Te.insertAfter(r,o.childNodes[i])):o.appendChild(r),o=r,i=0),e[n?"startContainer":"endContainer"]=o,e[n?"startOffset":"endOffset"]=i};return n(!0),t.collapsed||n(),e},Oe=function(t){function e(e){var n,r,o;n=o=t[e?"startContainer":"endContainer"],r=t[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(r=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(n),n=n.parentNode,Te.remove(o),!n.hasChildNodes()&&Te.isBlock(n)&&n.appendChild(Te.create("br"))),t[e?"startContainer":"endContainer"]=n,t[e?"startOffset":"endOffset"]=r)}e(!0),e();var n=Te.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),xe(n)},Ee=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Ne=function(t){return/\btox\-/.test(t.className)},Ae=function(t,e,n){return function(){var r=function(t){var r=O(t.parents,Dt,Rt).filter((function(t){return t.nodeName===e&&!Ne(t)})).isSome();n(r)};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}},Re=function(t,e){_t.each(e,(function(e,n){t.setAttribute(n,e)}))},Be=function(t,e,n){!function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)}(t,e,n),function(t,e,n){Re(e,n["list-attributes"]),_t.each(t.select("li",e),(function(t){Re(t,n["list-item-attributes"])}))}(t,e,n)},Pe=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&Bt(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Pt(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},Ie=function(t,e,n){void 0===n&&(n={});var r=t.selection.getRng(),o="LI",i=Vt(t,t.selection.getStart(!0)),a=t.dom;if("false"!==a.getContentEditable(t.selection.getNode())){"DL"===(e=e.toUpperCase())&&(o="DT");var u=De(r);_t.each(function(t,e,n){for(var r,o=[],i=t.dom,a=Pe(t,e,!0,n),u=Pe(t,e,!1,n),s=[],c=a;c&&(s.push(c),c!==u);c=c.nextSibling);return _t.each(s,(function(e){if(Pt(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||Bt(e))return Bt(e)&&i.remove(e),void(r=null);var a=e.nextSibling;Se.isBookmarkNode(e)&&(Pt(t,a)||!a&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))})),o}(t,r,i),(function(r){var i,u=r.previousSibling;u&&Dt(u)&&u.nodeName===e&&function(t,e,n){var r=t.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return r===(o=null===o?"":o)}(a,u,n)?(i=u,r=a.rename(r,o),u.appendChild(r)):(i=a.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=a.rename(r,o)),function(t,e,n){_t.each(n,(function(n){var r;return t.setStyle(e,((r={})[n]="",r))}))}(a,r,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),Be(a,i,n),Le(t.dom,i)})),t.selection.setRng(Oe(u))}},Me=function(t,e,n){return function(t,e){return t&&e&&Dt(t)&&t.nodeName===e.nodeName}(e,n)&&function(t,e,n){return t.getStyle(e,"list-style-type",!0)===t.getStyle(n,"list-style-type",!0)}(t,e,n)&&(r=n,e.className===r.className);var r},Le=function(t,e){var n,r;if(n=e.nextSibling,Me(t,e,n)){for(;r=n.firstChild;)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,Me(t,e,n)){for(;r=n.lastChild;)e.insertBefore(r,e.firstChild);t.remove(n)}},Fe=function(t,e,n,r,o){if(e.nodeName!==r||He(o)){var i=De(t.selection.getRng(!0));_t.each([e].concat(n),(function(e){!function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);Be(t.dom,o,r),wt(t,Ee(n),o)}else Be(t.dom,e,r),wt(t,Ee(n),e)}(t,e,r,o)})),t.selection.setRng(Oe(i))}else ke(t)},He=function(t){return"list-style-type"in t},je=function(t,e,n){var r=Ft(t),o=Ht(t);n=n||{},r&&o.length>0?Fe(t,r,o,e,n):function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||He(r)||Ne(e)){var o=De(t.selection.getRng(!0));Be(t.dom,e,r);var i=t.dom.rename(e,n);Le(t.dom,i),t.selection.setRng(Oe(o)),wt(t,Ee(n),i)}else ke(t);else Ie(t,n,r),wt(t,Ee(n),e)}(t,r,e,n)},Ve=pe.DOM,ze=function(t,e){_t.each(_t.grep(t.select("ol,ul",e)),(function(e){!function(t,e){var n,r=e.parentNode;"LI"===r.nodeName&&r.firstChild===e&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(e),Mt(t,r)&&Ve.remove(r)):Ve.setStyle(r,"listStyleType","none")),Dt(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(e)}(t,e)}))},Ue=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(Tt(o)&&(n?i<o.data.length:i>0))return o;var a=t.schema.getNonEmptyElements();1===o.nodeType&&(o=at.getNode(o,i));var u=new ut(o,r);for(n&&function(t,e){return!!Bt(e)&&!(!t.isBlock(e.nextSibling)||Bt(e.previousSibling))}(t.dom,o)&&u.next();o=u[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(a[o.nodeName])return o;if(Tt(o)&&o.data.length>0)return o}},We=function(t,e){var n=e.childNodes;return 1===n.length&&!Dt(n[0])&&t.isBlock(n[0])},qe=function(t,e,n){var r,o=We(t,n)?n.firstChild:n;if(function(t,e){We(t,e)&&t.remove(e.firstChild,!0)}(t,e),!Mt(t,e,!0))for(;r=e.firstChild;)o.appendChild(r)},$e=function(t,e,n){var r,o=e.parentNode;if(Lt(t,e)&&Lt(t,n)){Dt(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Bt(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&Bt(i)&&e.hasChildNodes()&&t.remove(i),Mt(t,n,!0)&&t.$(n).empty(),qe(t,e,n),r&&n.appendChild(r);var a=ot(et.fromDom(n),et.fromDom(e))?t.getParents(e,Dt,n):[];t.remove(e),S(a,(function(e){Mt(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},Ye=function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))!function(t,e,n){t.dom.$(n).empty(),$e(t.dom,e,n),t.selection.setCursorLocation(n)}(t,n,r);else{var i=De(e);$e(o,n,r),t.selection.setRng(Oe(i))}},Ge=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=Vt(t,o),a=n.getParent(r.getStart(),"LI",i);if(a){var u=a.parentNode;if(u===t.getBody()&&Mt(n,u))return!0;var s=xe(r.getRng()),c=n.getParent(Ue(t,s,e,i),"LI",i);if(c&&c!==a)return t.undoManager.transact((function(){var n;e?Ye(t,s,c,a):(n=a).parentNode.firstChild===n?_e(t):function(t,e,n,r){var o=De(e);$e(t.dom,n,r);var i=Oe(o);t.selection.setRng(i)}(t,s,a,c)})),!0;if(!c&&!e&&0===s.startOffset&&0===s.endOffset)return t.undoManager.transact((function(){ke(t)})),!0}return!1},Ke=function(t,e){return Ge(t,e)||function(t,e){var n=t.dom,r=t.selection.getStart(),o=Vt(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var a=xe(t.selection.getRng()),u=n.getParent(Ue(t,a,e,o),"LI",o);if(u)return t.undoManager.transact((function(){!function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)}(n,i,o),Le(n,u.parentNode),t.selection.select(u,!0),t.selection.collapse(e)})),!0}return!1}(t,e)},Xe=function(t,e){return t.selection.isCollapsed()?Ke(t,e):function(t){var e=t.selection.getStart(),n=Vt(t,e);return!!(t.dom.getParent(e,"LI,DT,DD",n)||jt(t).length>0)&&(t.undoManager.transact((function(){t.execCommand("Delete"),ze(t.dom,t.getBody())})),!0)}(t)},Je=function(t){var e=t.dom,n=Ft(t);Et(n)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:e.getAttrib(n,"start")||"1"},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(n){var r=n.getData();t.undoManager.transact((function(){e.setAttrib(Ft(t),"start","1"===r.start?"":r.start)})),n.close()}})},Qe=function(t,e){return function(){var n=t.dom.getParent(t.selection.getStart(),"UL,OL,DL");return n&&n.nodeName===e}},Ze=function(t){(function(t){return t.getParam("lists_indent_on_tab",!0)})(t)&&function(t){t.on("keydown",(function(e){e.keyCode!==st.TAB||st.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?_e(t):Ce(t))&&e.preventDefault()}))}))}(t),function(t){t.on("keydown",(function(e){e.keyCode===st.BACKSPACE?Xe(t,!1)&&e.preventDefault():e.keyCode===st.DELETE&&Xe(t,!0)&&e.preventDefault()}))}(t)};i.add("lists",(function(t){return!1===function(t){return!(!/(^|[ ,])rtc([, ]|$)/.test(t.getParam("plugins","","string"))||!i.get("rtc"))}(t)&&(Ze(t),function(t){t.on("BeforeExecCommand",(function(e){var n=e.command.toLowerCase();"indent"===n?Ce(t):"outdent"===n&&_e(t)})),t.addCommand("InsertUnorderedList",(function(e,n){je(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){je(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){je(t,"DL",n)})),t.addCommand("RemoveList",(function(){ke(t)})),t.addCommand("mceListProps",(function(){Je(t)})),t.addQueryStateHandler("InsertUnorderedList",Qe(t,"UL")),t.addQueryStateHandler("InsertOrderedList",Qe(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",Qe(t,"DL"))}(t)),function(t){var e=function(e){return function(){return t.execCommand(e)}};(function(t,e){var n=t.getParam("plugins","","string");return-1!==_t.inArray(n.split(/[ ,]/),e)})(t,"advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return Ae(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return Ae(t,"UL",e.setActive)}}))}(t),function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return Je(t)},onSetup:function(e){return Ae(t,"OL",(function(t){return e.setDisabled(!t)}))}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=Ft(t,e);return Et(n)?["listprops"]:[]}})}(t),function(t){return{backspaceDelete:function(e){Xe(t,e)}}}(t)}))}(window)},JEQr:function(t,e,n){"use strict";(function(e){var r=n("xTJ+"),o=n("yK9s"),i={"Content-Type":"application/x-www-form-urlencoded"};function a(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var u,s={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e))&&(u=n("tQ2B")),u),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(a(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(a(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(t){s.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){s.headers[t]=r.merge(i)})),t.exports=s}).call(this,n("8oxB"))},Jchv:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return function(){var e,n=Math.max,r=Math.abs,o=/left|center|right/,i=/top|center|bottom/,a=/[\+\-]\d+(\.[\d]+)?%?/,u=/^\w+/,s=/%$/,c=t.fn.position;function l(t,e,n){return[parseFloat(t[0])*(s.test(t[0])?e/100:1),parseFloat(t[1])*(s.test(t[1])?n/100:1)]}function f(e,n){return parseInt(t.css(e,n),10)||0}function d(e){var n=e[0];return 9===n.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(n)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.position={scrollbarWidth:function(){if(void 0!==e)return e;var n,r,o=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),i=o.children()[0];return t("body").append(o),n=i.offsetWidth,o.css("overflow","scroll"),n===(r=i.offsetWidth)&&(r=o[0].clientWidth),o.remove(),e=n-r},getScrollInfo:function(e){var n=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),r=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),o="scroll"===n||"auto"===n&&e.width<e.element[0].scrollWidth;return{width:"scroll"===r||"auto"===r&&e.height<e.element[0].scrollHeight?t.position.scrollbarWidth():0,height:o?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var n=t(e||window),r=t.isWindow(n[0]),o=!!n[0]&&9===n[0].nodeType;return{element:n,isWindow:r,isDocument:o,offset:r||o?{left:0,top:0}:t(e).offset(),scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:n.outerWidth(),height:n.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return c.apply(this,arguments);e=t.extend({},e);var s,m,h,p,g,v,b=t(e.of),y=t.position.getWithinInfo(e.within),x=t.position.getScrollInfo(y),w=(e.collision||"flip").split(" "),C={};return v=d(b),b[0].preventDefault&&(e.at="left top"),m=v.width,h=v.height,p=v.offset,g=t.extend({},p),t.each(["my","at"],(function(){var t,n,r=(e[this]||"").split(" ");1===r.length&&(r=o.test(r[0])?r.concat(["center"]):i.test(r[0])?["center"].concat(r):["center","center"]),r[0]=o.test(r[0])?r[0]:"center",r[1]=i.test(r[1])?r[1]:"center",t=a.exec(r[0]),n=a.exec(r[1]),C[this]=[t?t[0]:0,n?n[0]:0],e[this]=[u.exec(r[0])[0],u.exec(r[1])[0]]})),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?g.left+=m:"center"===e.at[0]&&(g.left+=m/2),"bottom"===e.at[1]?g.top+=h:"center"===e.at[1]&&(g.top+=h/2),s=l(C.at,m,h),g.left+=s[0],g.top+=s[1],this.each((function(){var o,i,a=t(this),u=a.outerWidth(),c=a.outerHeight(),d=f(this,"marginLeft"),v=f(this,"marginTop"),_=u+d+f(this,"marginRight")+x.width,k=c+v+f(this,"marginBottom")+x.height,S=t.extend({},g),T=l(C.my,a.outerWidth(),a.outerHeight());"right"===e.my[0]?S.left-=u:"center"===e.my[0]&&(S.left-=u/2),"bottom"===e.my[1]?S.top-=c:"center"===e.my[1]&&(S.top-=c/2),S.left+=T[0],S.top+=T[1],o={marginLeft:d,marginTop:v},t.each(["left","top"],(function(n,r){t.ui.position[w[n]]&&t.ui.position[w[n]][r](S,{targetWidth:m,targetHeight:h,elemWidth:u,elemHeight:c,collisionPosition:o,collisionWidth:_,collisionHeight:k,offset:[s[0]+T[0],s[1]+T[1]],my:e.my,at:e.at,within:y,elem:a})})),e.using&&(i=function(t){var o=p.left-S.left,i=o+m-u,s=p.top-S.top,l=s+h-c,f={target:{element:b,left:p.left,top:p.top,width:m,height:h},element:{element:a,left:S.left,top:S.top,width:u,height:c},horizontal:i<0?"left":o>0?"right":"center",vertical:l<0?"top":s>0?"bottom":"middle"};m<u&&r(o+i)<m&&(f.horizontal="center"),h<c&&r(s+l)<h&&(f.vertical="middle"),n(r(o),r(i))>n(r(s),r(l))?f.important="horizontal":f.important="vertical",e.using.call(this,t,f)}),a.offset(t.extend(S,{using:i}))}))},t.ui.position={fit:{left:function(t,e){var r,o=e.within,i=o.isWindow?o.scrollLeft:o.offset.left,a=o.width,u=t.left-e.collisionPosition.marginLeft,s=i-u,c=u+e.collisionWidth-a-i;e.collisionWidth>a?s>0&&c<=0?(r=t.left+s+e.collisionWidth-a-i,t.left+=s-r):t.left=c>0&&s<=0?i:s>c?i+a-e.collisionWidth:i:s>0?t.left+=s:c>0?t.left-=c:t.left=n(t.left-u,t.left)},top:function(t,e){var r,o=e.within,i=o.isWindow?o.scrollTop:o.offset.top,a=e.within.height,u=t.top-e.collisionPosition.marginTop,s=i-u,c=u+e.collisionHeight-a-i;e.collisionHeight>a?s>0&&c<=0?(r=t.top+s+e.collisionHeight-a-i,t.top+=s-r):t.top=c>0&&s<=0?i:s>c?i+a-e.collisionHeight:i:s>0?t.top+=s:c>0?t.top-=c:t.top=n(t.top-u,t.top)}},flip:{left:function(t,e){var n,o,i=e.within,a=i.offset.left+i.scrollLeft,u=i.width,s=i.isWindow?i.scrollLeft:i.offset.left,c=t.left-e.collisionPosition.marginLeft,l=c-s,f=c+e.collisionWidth-u-s,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,m="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,h=-2*e.offset[0];l<0?((n=t.left+d+m+h+e.collisionWidth-u-a)<0||n<r(l))&&(t.left+=d+m+h):f>0&&((o=t.left-e.collisionPosition.marginLeft+d+m+h-s)>0||r(o)<f)&&(t.left+=d+m+h)},top:function(t,e){var n,o,i=e.within,a=i.offset.top+i.scrollTop,u=i.height,s=i.isWindow?i.scrollTop:i.offset.top,c=t.top-e.collisionPosition.marginTop,l=c-s,f=c+e.collisionHeight-u-s,d="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,m="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,h=-2*e.offset[1];l<0?((o=t.top+d+m+h+e.collisionHeight-u-a)<0||o<r(l))&&(t.top+=d+m+h):f>0&&((n=t.top-e.collisionPosition.marginTop+d+m+h-s)>0||r(n)<f)&&(t.top+=d+m+h)}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position})?r.apply(e,o):r)||(t.exports=i)},LYNF:function(t,e,n){"use strict";var r=n("OH9c");t.exports=function(t,e,n,o,i){var a=new Error(t);return r(a,e,n,o,i)}},Lmem:function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},MIQu:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){var e,n=0,r=Array.prototype.slice;return t.cleanData=(e=t.cleanData,function(n){var r,o,i;for(i=0;null!=(o=n[i]);i++)try{(r=t._data(o,"events"))&&r.remove&&t(o).triggerHandler("remove")}catch(t){}e(n)}),t.widget=function(e,n,r){var o,i,a,u={},s=e.split(".")[0],c=s+"-"+(e=e.split(".")[1]);return r||(r=n,n=t.Widget),t.isArray(r)&&(r=t.extend.apply(null,[{}].concat(r))),t.expr[":"][c.toLowerCase()]=function(e){return!!t.data(e,c)},t[s]=t[s]||{},o=t[s][e],i=t[s][e]=function(t,e){if(!this._createWidget)return new i(t,e);arguments.length&&this._createWidget(t,e)},t.extend(i,o,{version:r.version,_proto:t.extend({},r),_childConstructors:[]}),(a=new n).options=t.widget.extend({},a.options),t.each(r,(function(e,r){t.isFunction(r)?u[e]=function(){function t(){return n.prototype[e].apply(this,arguments)}function o(t){return n.prototype[e].apply(this,t)}return function(){var e,n=this._super,i=this._superApply;return this._super=t,this._superApply=o,e=r.apply(this,arguments),this._super=n,this._superApply=i,e}}():u[e]=r})),i.prototype=t.widget.extend(a,{widgetEventPrefix:o&&a.widgetEventPrefix||e},u,{constructor:i,namespace:s,widgetName:e,widgetFullName:c}),o?(t.each(o._childConstructors,(function(e,n){var r=n.prototype;t.widget(r.namespace+"."+r.widgetName,i,n._proto)})),delete o._childConstructors):n._childConstructors.push(i),t.widget.bridge(e,i),i},t.widget.extend=function(e){for(var n,o,i=r.call(arguments,1),a=0,u=i.length;a<u;a++)for(n in i[a])o=i[a][n],i[a].hasOwnProperty(n)&&void 0!==o&&(t.isPlainObject(o)?e[n]=t.isPlainObject(e[n])?t.widget.extend({},e[n],o):t.widget.extend({},o):e[n]=o);return e},t.widget.bridge=function(e,n){var o=n.prototype.widgetFullName||e;t.fn[e]=function(i){var a="string"==typeof i,u=r.call(arguments,1),s=this;return a?this.length||"instance"!==i?this.each((function(){var n,r=t.data(this,o);return"instance"===i?(s=r,!1):r?t.isFunction(r[i])&&"_"!==i.charAt(0)?(n=r[i].apply(r,u))!==r&&void 0!==n?(s=n&&n.jquery?s.pushStack(n.get()):n,!1):void 0:t.error("no such method '"+i+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+i+"'")})):s=void 0:(u.length&&(i=t.widget.extend.apply(null,[i].concat(u))),this.each((function(){var e=t.data(this,o);e?(e.option(i||{}),e._init&&e._init()):t.data(this,o,new n(i,this))}))),s}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,r){r=t(r||this.defaultElement||this)[0],this.element=t(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},r!==this&&(t.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===r&&this.destroy()}}),this.document=t(r.style?r.ownerDocument:r.document||r),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,(function(t,n){e._removeClass(n,t)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,n){var r,o,i,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},r=e.split("."),e=r.shift(),r.length){for(o=a[e]=t.widget.extend({},this.options[e]),i=0;i<r.length-1;i++)o[r[i]]=o[r[i]]||{},o=o[r[i]];if(e=r.pop(),1===arguments.length)return void 0===o[e]?null:o[e];o[e]=n}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=n}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var n,r,o;for(n in e)o=this.classesElementLookup[n],e[n]!==this.options.classes[n]&&o&&o.length&&(r=t(o.get()),this._removeClass(o,n),r.addClass(this._classes({element:r,keys:n,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){var n=[],r=this;function o(o,i){var a,u;for(u=0;u<o.length;u++)a=r.classesElementLookup[o[u]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),r.classesElementLookup[o[u]]=a,n.push(o[u]),i&&e.classes[o[u]]&&n.push(e.classes[o[u]])}return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&o(e.keys.match(/\S+/g)||[],!0),e.extra&&o(e.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(e){var n=this;t.each(n.classesElementLookup,(function(r,o){-1!==t.inArray(e.target,o)&&(n.classesElementLookup[r]=t(o.not(e.target).get()))}))},_removeClass:function(t,e,n){return this._toggleClass(t,e,n,!1)},_addClass:function(t,e,n){return this._toggleClass(t,e,n,!0)},_toggleClass:function(t,e,n,r){r="boolean"==typeof r?r:n;var o="string"==typeof t||null===t,i={extra:o?e:n,keys:o?t:e,element:o?this.element:t,add:r};return i.element.toggleClass(this._classes(i),r),this},_on:function(e,n,r){var o,i=this;"boolean"!=typeof e&&(r=n,n=e,e=!1),r?(n=o=t(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,o=this.widget()),t.each(r,(function(r,a){function u(){if(e||!0!==i.options.disabled&&!t(this).hasClass("ui-state-disabled"))return("string"==typeof a?i[a]:a).apply(i,arguments)}"string"!=typeof a&&(u.guid=a.guid=a.guid||u.guid||t.guid++);var s=r.match(/^([\w:-]*)\s*(.*)$/),c=s[1]+i.eventNamespace,l=s[2];l?o.on(c,l,u):n.on(c,u)}))},_off:function(e,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(n).off(n),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){var n=this;return setTimeout((function(){return("string"==typeof t?n[t]:t).apply(n,arguments)}),e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,n,r){var o,i,a=this.options[e];if(r=r||{},(n=t.Event(n)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),n.target=this.element[0],i=n.originalEvent)for(o in i)o in n||(n[o]=i[o]);return this.element.trigger(n,r),!(t.isFunction(a)&&!1===a.apply(this.element[0],[n].concat(r))||n.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},(function(e,n){t.Widget.prototype["_"+e]=function(r,o,i){var a;"string"==typeof o&&(o={effect:o});var u=o?!0===o||"number"==typeof o?n:o.effect||n:e;"number"==typeof(o=o||{})&&(o={duration:o}),a=!t.isEmptyObject(o),o.complete=i,o.delay&&r.delay(o.delay),a&&t.effects&&t.effects.effect[u]?r[e](o):u!==e&&r[u]?r[u](o.duration,o.easing,i):r.queue((function(n){t(this)[e](),i&&i.call(r[0]),n()}))}})),t.widget})?r.apply(e,o):r)||(t.exports=i)},MLWZ:function(t,e,n){"use strict";var r=n("xTJ+");function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var a=[];r.forEach(e,(function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),a.push(o(e)+"="+o(t))})))})),i=a.join("&")}if(i){var u=t.indexOf("#");-1!==u&&(t=t.slice(0,u)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},N6cA:function(t,e,n){var r,o,i;o=[n("EVdn"),n("121P"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout((function(){var n=e.data("ui-form-reset-instances");t.each(n,(function(){this.refresh()}))}))},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}}})?r.apply(e,o):r)||(t.exports=i)},NHgk:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase())})?r.apply(e,o):r)||(t.exports=i)},NvoQ:function(t,e,n){var r,o,i;o=[n("EVdn"),n("iGnl"),n("CumE"),n("NHgk"),n("8Iik"),n("Qwlt"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){return t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,n){return t>=e&&t<e+n},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,(function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")}))},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,n){var r=null,o=!1,i=this;return!(this.reverting||this.options.disabled||"static"===this.options.type||(this._refreshItems(e),t(e.target).parents().each((function(){if(t.data(this,i.widgetName+"-item")===i)return r=t(this),!1})),t.data(e.target,i.widgetName+"-item")===i&&(r=t(e.target)),!r||this.options.handle&&!n&&(t(this.options.handle,r).find("*").addBack().each((function(){this===e.target&&(o=!0)})),!o)||(this.currentItem=r,this._removeCurrentsFromItems(),0)))},_mouseStart:function(e,n,r){var o,i,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(i=this.document.find("body"),this.storedCursor=i.css("cursor"),i.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(i)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!r)for(o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var n,r,o,i,a=this.options,u=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?u=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(u=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?u=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(u=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),!1!==u&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),n=this.items.length-1;n>=0;n--)if(o=(r=this.items[n]).item[0],(i=this._intersectsWithPointer(r))&&r.instance===this.currentContainer&&!(o===this.currentItem[0]||this.placeholder[1===i?"next":"prev"]()[0]===o||t.contains(this.placeholder[0],o)||"semi-dynamic"===this.options.type&&t.contains(this.element[0],o))){if(this.direction=1===i?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(r))break;this._rearrange(e,r),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,n){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var r=this,o=this.placeholder.offset(),i=this.options.axis,a={};i&&"x"!==i||(a.left=o.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),i&&"y"!==i||(a.top=o.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,(function(){r._clear(e)}))}else this._clear(e,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var n=this._getItemsAsjQuery(e&&e.connected),r=[];return e=e||{},t(n).each((function(){var n=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);n&&r.push((e.key||n[1]+"[]")+"="+(e.key&&e.expression?n[1]:n[2]))})),!r.length&&e.key&&r.push(e.key+"="),r.join("&")},toArray:function(e){var n=this._getItemsAsjQuery(e&&e.connected),r=[];return e=e||{},n.each((function(){r.push(t(e.item||this).attr(e.attribute||"id")||"")})),r},_intersectsWith:function(t){var e=this.positionAbs.left,n=e+this.helperProportions.width,r=this.positionAbs.top,o=r+this.helperProportions.height,i=t.left,a=i+t.width,u=t.top,s=u+t.height,c=this.offset.click.top,l=this.offset.click.left,f="x"===this.options.axis||r+c>u&&r+c<s,d="y"===this.options.axis||e+l>i&&e+l<a,m=f&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?m:i<e+this.helperProportions.width/2&&n-this.helperProportions.width/2<a&&u<r+this.helperProportions.height/2&&o-this.helperProportions.height/2<s},_intersectsWithPointer:function(t){var e,n,r="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),o="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!r||!o)&&(e=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection(),this.floating?"right"===n||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),n=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),r=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&n||"left"===o&&!n:r&&("down"===r&&e||"up"===r&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var n,r,o,i,a=[],u=[],s=this._connectWith();if(s&&e)for(n=s.length-1;n>=0;n--)for(r=(o=t(s[n],this.document[0])).length-1;r>=0;r--)(i=t.data(o[r],this.widgetFullName))&&i!==this&&!i.options.disabled&&u.push([t.isFunction(i.options.items)?i.options.items.call(i.element):t(i.options.items,i.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),i]);function c(){a.push(this)}for(u.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),n=u.length-1;n>=0;n--)u[n][0].each(c);return t(a)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,(function(t){for(var n=0;n<e.length;n++)if(e[n]===t.item[0])return!1;return!0}))},_refreshItems:function(e){this.items=[],this.containers=[this];var n,r,o,i,a,u,s,c,l=this.items,f=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(n=d.length-1;n>=0;n--)for(r=(o=t(d[n],this.document[0])).length-1;r>=0;r--)(i=t.data(o[r],this.widgetFullName))&&i!==this&&!i.options.disabled&&(f.push([t.isFunction(i.options.items)?i.options.items.call(i.element[0],e,{item:this.currentItem}):t(i.options.items,i.element),i]),this.containers.push(i));for(n=f.length-1;n>=0;n--)for(a=f[n][1],r=0,c=(u=f[n][0]).length;r<c;r++)(s=t(u[r])).data(this.widgetName+"-item",a),l.push({item:s,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){var n,r,o,i;for(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),n=this.items.length-1;n>=0;n--)(r=this.items[n]).instance!==this.currentContainer&&this.currentContainer&&r.item[0]!==this.currentItem[0]||(o=this.options.toleranceElement?t(this.options.toleranceElement,r.item):r.item,e||(r.width=o.outerWidth(),r.height=o.outerHeight()),i=o.offset(),r.left=i.left,r.top=i.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--)i=this.containers[n].element.offset(),this.containers[n].containerCache.left=i.left,this.containers[n].containerCache.top=i.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight();return this},_createPlaceholder:function(e){var n,r=(e=e||this).options;r.placeholder&&r.placeholder.constructor!==String||(n=r.placeholder,r.placeholder={element:function(){var r=e.currentItem[0].nodeName.toLowerCase(),o=t("<"+r+">",e.document[0]);return e._addClass(o,"ui-sortable-placeholder",n||e.currentItem[0].className)._removeClass(o,"ui-sortable-helper"),"tbody"===r?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(o)):"tr"===r?e._createTrPlaceholder(e.currentItem,o):"img"===r&&o.attr("src",e.currentItem.attr("src")),n||o.css("visibility","hidden"),o},update:function(t,o){n&&!r.forcePlaceholderSize||(o.height()||o.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),o.width()||o.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(r.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),r.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,n){var r=this;e.children().each((function(){t("<td> </td>",r.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}))},_contactContainers:function(e){var n,r,o,i,a,u,s,c,l,f,d=null,m=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(d&&t.contains(this.containers[n].element[0],d.element[0]))continue;d=this.containers[n],m=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",e,this._uiHash(this)),this.containers[n].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[m].containerCache.over||(this.containers[m]._trigger("over",e,this._uiHash(this)),this.containers[m].containerCache.over=1);else{for(o=1e4,i=null,a=(l=d.floating||this._isFloating(this.currentItem))?"left":"top",u=l?"width":"height",f=l?"pageX":"pageY",r=this.items.length-1;r>=0;r--)t.contains(this.containers[m].element[0],this.items[r].item[0])&&this.items[r].item[0]!==this.currentItem[0]&&(s=this.items[r].item.offset()[a],c=!1,e[f]-s>this.items[r][u]/2&&(c=!0),Math.abs(e[f]-s)<o&&(o=Math.abs(e[f]-s),i=this.items[r],this.direction=c?"up":"down"));if(!i&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[m])return void(this.currentContainer.containerCache.over||(this.containers[m]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1));i?this._rearrange(e,i,null,!0):this._rearrange(e,null,this.containers[m].element,!0),this._trigger("change",e,this._uiHash()),this.containers[m]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[m],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[m]._trigger("over",e,this._uiHash(this)),this.containers[m].containerCache.over=1}},_createHelper:function(e){var n=this.options,r=t.isFunction(n.helper)?t(n.helper.apply(this.element[0],[e,this.currentItem])):"clone"===n.helper?this.currentItem.clone():this.currentItem;return r.parents("body").length||t("parent"!==n.appendTo?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),r[0].style.width&&!n.forceHelperSize||r.width(this.currentItem.width()),r[0].style.height&&!n.forceHelperSize||r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,n,r,o=this.options;"parent"===o.containment&&(o.containment=this.helper[0].parentNode),"document"!==o.containment&&"window"!==o.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===o.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===o.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(o.containment)||(e=t(o.containment)[0],n=t(o.containment).offset(),r="hidden"!==t(e).css("overflow"),this.containment=[n.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,n.left+(r?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(r?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,n){n||(n=this.position);var r="absolute"===e?1:-1,o="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(o[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():i?0:o.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():i?0:o.scrollLeft())*r}},_generatePosition:function(e){var n,r,o=this.options,i=e.pageX,a=e.pageY,u="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(u[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),o.grid&&(n=this.originalPageY+Math.round((a-this.originalPageY)/o.grid[1])*o.grid[1],a=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-o.grid[1]:n+o.grid[1]:n,r=this.originalPageX+Math.round((i-this.originalPageX)/o.grid[0])*o.grid[0],i=this.containment?r-this.offset.click.left>=this.containment[0]&&r-this.offset.click.left<=this.containment[2]?r:r-this.offset.click.left>=this.containment[0]?r-o.grid[0]:r+o.grid[0]:r)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():s?0:u.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():s?0:u.scrollLeft())}},_rearrange:function(t,e,n,r){n?n[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay((function(){o===this.counter&&this.refreshPositions(!r)}))},_clear:function(t,e){this.reverting=!1;var n,r=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(n in this._storedCSS)"auto"!==this._storedCSS[n]&&"static"!==this._storedCSS[n]||(this._storedCSS[n]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function o(t,e,n){return function(r){n._trigger(t,r,e._uiHash(e))}}for(this.fromOutside&&!e&&r.push((function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))})),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||r.push((function(t){this._trigger("update",t,this._uiHash())})),this!==this.currentContainer&&(e||(r.push((function(t){this._trigger("remove",t,this._uiHash())})),r.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),r.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),n=this.containers.length-1;n>=0;n--)e||r.push(o("deactivate",this,this.containers[n])),this.containers[n].containerCache.over&&(r.push(o("out",this,this.containers[n])),this.containers[n].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(n=0;n<r.length;n++)r[n].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===t.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(e){var n=e||this;return{helper:n.helper,placeholder:n.placeholder||t([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:e?e.element:null}}})})?r.apply(e,o):r)||(t.exports=i)},OH9c:function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},OTTw:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},Qjfq:function(t,e,n){n("vn/0")},Qwlt:function(t,e,n){var r,o,i;o=[n("EVdn")],void 0===(i="function"==typeof(r=function(t){return t.ui=t.ui||{},t.ui.version="1.12.1"})?r.apply(e,o):r)||(t.exports=i)},"Rn+g":function(t,e,n){"use strict";var r=n("LYNF");t.exports=function(t,e,n){var o=n.config.validateStatus;!o||o(n.status)?t(n):e(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},SntB:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=function(t,e){e=e||{};var n={},o=["url","method","params","data"],i=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(o,(function(t){void 0!==e[t]&&(n[t]=e[t])})),r.forEach(i,(function(o){r.isObject(e[o])?n[o]=r.deepMerge(t[o],e[o]):void 0!==e[o]?n[o]=e[o]:r.isObject(t[o])?n[o]=r.deepMerge(t[o]):void 0!==t[o]&&(n[o]=t[o])})),r.forEach(a,(function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])}));var u=o.concat(i).concat(a),s=Object.keys(e).filter((function(t){return-1===u.indexOf(t)}));return r.forEach(s,(function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])})),n}},UTCq:function(t,e,n){var r,o,i;o=[n("EVdn"),n("GC/X"),n("N6cA"),n("r15H"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){return t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,n,r=this,o=this._super()||{};return this._readType(),n=this.element.labels(),this.label=t(n[n.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each((function(){r.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML})),this.originalLabel&&(o.label=this.originalLabel),null!=(e=this.element[0].disabled)&&(o.disabled=e),o},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e=this.element[0].name,n="input[name='"+t.ui.escapeSelector(e)+"']";return e?(this.form.length?t(this.form[0].elements).filter(n):t(n).filter((function(){return 0===t(this).form().length}))).not(this.element):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each((function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")}))},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(e){var n="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(n+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):n+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",n),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio})?r.apply(e,o):r)||(t.exports=i)},UnBK:function(t,e,n){"use strict";var r=n("xTJ+"),o=n("xAGQ"),i=n("Lmem"),a=n("JEQr");function u(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return u(t),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||a.adapter)(t).then((function(e){return u(t),e.data=o(e.data,e.headers,t.transformResponse),e}),(function(e){return i(e)||(u(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},"Vn+K":function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt"),n("vBzC")],void 0===(i="function"==typeof(r=function(t){var e;function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=r(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function r(e){var n="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",n,(function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")})).on("mouseover",n,o)}function o(){t.datepicker._isDisabledDatepicker(e.inline?e.dpDiv.parent()[0]:e.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function i(e,n){for(var r in t.extend(e,n),n)null==n[r]&&(e[r]=n[r]);return e}return t.extend(t.ui,{datepicker:{version:"1.12.1"}}),t.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return i(this._defaults,t||{}),this},_attachDatepicker:function(e,n){var r,o,i;o="div"===(r=e.nodeName.toLowerCase())||"span"===r,e.id||(this.uuid+=1,e.id="dp"+this.uuid),(i=this._newInst(t(e),o)).settings=t.extend({},n||{}),"input"===r?this._connectDatepicker(e,i):o&&this._inlineDatepicker(e,i)},_newInst:function(e,n){return{id:e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:n,dpDiv:n?r(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,n){var r=t(e);n.append=t([]),n.trigger=t([]),r.hasClass(this.markerClassName)||(this._attachments(r,n),r.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(n),t.data(e,"datepicker",n),n.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,n){var r,o,i,a=this._get(n,"appendText"),u=this._get(n,"isRTL");n.append&&n.append.remove(),a&&(n.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[u?"before":"after"](n.append)),e.off("focus",this._showDatepicker),n.trigger&&n.trigger.remove(),"focus"!==(r=this._get(n,"showOn"))&&"both"!==r||e.on("focus",this._showDatepicker),"button"!==r&&"both"!==r||(o=this._get(n,"buttonText"),i=this._get(n,"buttonImage"),n.trigger=t(this._get(n,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:i,alt:o,title:o}):t("<button type='button'></button>").addClass(this._triggerClass).html(i?t("<img/>").attr({src:i,alt:o,title:o}):o)),e[u?"before":"after"](n.trigger),n.trigger.on("click",(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1})))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,n,r,o,i=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(n=0,r=0,o=0;o<t.length;o++)t[o].length>n&&(n=t[o].length,r=o);return r},i.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),i.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-i.getDay())),t.input.attr("size",this._formatDate(t,i).length)}},_inlineDatepicker:function(e,n){var r=t(e);r.hasClass(this.markerClassName)||(r.addClass(this.markerClassName).append(n.dpDiv),t.data(e,"datepicker",n),this._setDate(n,this._getDefaultDate(n),!0),this._updateDatepicker(n),this._updateAlternate(n),n.settings.disabled&&this._disableDatepicker(e),n.dpDiv.css("display","block"))},_dialogDatepicker:function(e,n,r,o,a){var u,s,c,l,f,d=this._dialogInst;return d||(this.uuid+=1,u="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+u+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),(d=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},t.data(this._dialogInput[0],"datepicker",d)),i(d.settings,o||{}),n=n&&n.constructor===Date?this._formatDate(d,n):n,this._dialogInput.val(n),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(s=document.documentElement.clientWidth,c=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,f=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[s/2-100+l,c/2-150+f]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=r,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(n){var r,o=t(n),i=t.data(n,"datepicker");o.hasClass(this.markerClassName)&&(r=n.nodeName.toLowerCase(),t.removeData(n,"datepicker"),"input"===r?(i.append.remove(),i.trigger.remove(),o.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==r&&"span"!==r||o.removeClass(this.markerClassName).empty(),e===i&&(e=null))},_enableDatepicker:function(e){var n,r,o=t(e),i=t.data(e,"datepicker");o.hasClass(this.markerClassName)&&("input"===(n=e.nodeName.toLowerCase())?(e.disabled=!1,i.trigger.filter("button").each((function(){this.disabled=!1})).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==n&&"span"!==n||((r=o.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,(function(t){return t===e?null:t})))},_disableDatepicker:function(e){var n,r,o=t(e),i=t.data(e,"datepicker");o.hasClass(this.markerClassName)&&("input"===(n=e.nodeName.toLowerCase())?(e.disabled=!0,i.trigger.filter("button").each((function(){this.disabled=!0})).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==n&&"span"!==n||((r=o.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,(function(t){return t===e?null:t})),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,n,r){var o,a,u,s,c=this._getInst(e);if(2===arguments.length&&"string"==typeof n)return"defaults"===n?t.extend({},t.datepicker._defaults):c?"all"===n?t.extend({},c.settings):this._get(c,n):null;o=n||{},"string"==typeof n&&((o={})[n]=r),c&&(this._curInst===c&&this._hideDatepicker(),a=this._getDateDatepicker(e,!0),u=this._getMinMaxDate(c,"min"),s=this._getMinMaxDate(c,"max"),i(c.settings,o),null!==u&&void 0!==o.dateFormat&&void 0===o.minDate&&(c.settings.minDate=this._formatDate(c,u)),null!==s&&void 0!==o.dateFormat&&void 0===o.maxDate&&(c.settings.maxDate=this._formatDate(c,s)),"disabled"in o&&(o.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),c),this._autoSize(c),this._setDate(c,a),this._updateAlternate(c),this._updateDatepicker(c))},_changeDatepicker:function(t,e,n){this._optionDatepicker(t,e,n)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var n=this._getInst(t);n&&(this._setDate(n,e),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(t,e){var n=this._getInst(t);return n&&!n.inline&&this._setDateFromField(n,e),n?this._getDate(n):null},_doKeyDown:function(e){var n,r,o,i=t.datepicker._getInst(e.target),a=!0,u=i.dpDiv.is(".ui-datepicker-rtl");if(i._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return(o=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",i.dpDiv))[0]&&t.datepicker._selectDay(e.target,i.selectedMonth,i.selectedYear,o[0]),(n=t.datepicker._get(i,"onSelect"))?(r=t.datepicker._formatDate(i),n.apply(i.input?i.input[0]:null,[r,i])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(i,"stepBigMonths"):-t.datepicker._get(i,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(i,"stepBigMonths"):+t.datepicker._get(i,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,u?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(i,"stepBigMonths"):-t.datepicker._get(i,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,u?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(i,"stepBigMonths"):+t.datepicker._get(i,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var n,r,o=t.datepicker._getInst(e.target);if(t.datepicker._get(o,"constrainInput"))return n=t.datepicker._possibleChars(t.datepicker._get(o,"dateFormat")),r=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||r<" "||!n||n.indexOf(r)>-1},_doKeyUp:function(e){var n=t.datepicker._getInst(e.target);if(n.input.val()!==n.lastVal)try{t.datepicker.parseDate(t.datepicker._get(n,"dateFormat"),n.input?n.input.val():null,t.datepicker._getFormatConfig(n))&&(t.datepicker._setDateFromField(n),t.datepicker._updateAlternate(n),t.datepicker._updateDatepicker(n))}catch(t){}return!0},_showDatepicker:function(e){var n,r,o,a,u,s,c;"input"!==(e=e.target||e).nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),t.datepicker._isDisabledDatepicker(e)||t.datepicker._lastInput===e||(n=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==n&&(t.datepicker._curInst.dpDiv.stop(!0,!0),n&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),!1!==(o=(r=t.datepicker._get(n,"beforeShow"))?r.apply(e,[e,n]):{})&&(i(n.settings,o),n.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(n),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),a=!1,t(e).parents().each((function(){return!(a|="fixed"===t(this).css("position"))})),u={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(n),u=t.datepicker._checkOffset(n,u,a),n.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":a?"fixed":"absolute",display:"none",left:u.left+"px",top:u.top+"px"}),n.inline||(s=t.datepicker._get(n,"showAnim"),c=t.datepicker._get(n,"duration"),n.dpDiv.css("z-index",function(t){for(var e,n;t.length&&t[0]!==document;){if(("absolute"===(e=t.css("position"))||"relative"===e||"fixed"===e)&&(n=parseInt(t.css("zIndex"),10),!isNaN(n)&&0!==n))return n;t=t.parent()}return 0}(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[s]?n.dpDiv.show(s,t.datepicker._get(n,"showOptions"),c):n.dpDiv[s||"show"](s?c:null),t.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),t.datepicker._curInst=n)))},_updateDatepicker:function(n){this.maxRows=4,e=n,n.dpDiv.empty().append(this._generateHTML(n)),this._attachHandlers(n);var r,i=this._getNumberOfMonths(n),a=i[1],u=n.dpDiv.find("."+this._dayOverClass+" a");u.length>0&&o.apply(u.get(0)),n.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),a>1&&n.dpDiv.addClass("ui-datepicker-multi-"+a).css("width",17*a+"em"),n.dpDiv[(1!==i[0]||1!==i[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),n.dpDiv[(this._get(n,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),n===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),n.yearshtml&&(r=n.yearshtml,setTimeout((function(){r===n.yearshtml&&n.yearshtml&&n.dpDiv.find("select.ui-datepicker-year:first").replaceWith(n.yearshtml),r=n.yearshtml=null}),0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,n,r){var o=e.dpDiv.outerWidth(),i=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,u=e.input?e.input.outerHeight():0,s=document.documentElement.clientWidth+(r?0:t(document).scrollLeft()),c=document.documentElement.clientHeight+(r?0:t(document).scrollTop());return n.left-=this._get(e,"isRTL")?o-a:0,n.left-=r&&n.left===e.input.offset().left?t(document).scrollLeft():0,n.top-=r&&n.top===e.input.offset().top+u?t(document).scrollTop():0,n.left-=Math.min(n.left,n.left+o>s&&s>o?Math.abs(n.left+o-s):0),n.top-=Math.min(n.top,n.top+i>c&&c>i?Math.abs(i+u):0),n},_findPos:function(e){for(var n,r=this._getInst(e),o=this._get(r,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[o?"previousSibling":"nextSibling"];return[(n=t(e).offset()).left,n.top]},_hideDatepicker:function(e){var n,r,o,i,a=this._curInst;!a||e&&a!==t.data(e,"datepicker")||this._datepickerShowing&&(n=this._get(a,"showAnim"),r=this._get(a,"duration"),o=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[n]||t.effects[n])?a.dpDiv.hide(n,t.datepicker._get(a,"showOptions"),r,o):a.dpDiv["slideDown"===n?"slideUp":"fadeIn"===n?"fadeOut":"hide"](n?r:null,o),n||o(),this._datepickerShowing=!1,(i=this._get(a,"onClose"))&&i.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var n=t(e.target),r=t.datepicker._getInst(n[0]);(n[0].id===t.datepicker._mainDivId||0!==n.parents("#"+t.datepicker._mainDivId).length||n.hasClass(t.datepicker.markerClassName)||n.closest("."+t.datepicker._triggerClass).length||!t.datepicker._datepickerShowing||t.datepicker._inDialog&&t.blockUI)&&(!n.hasClass(t.datepicker.markerClassName)||t.datepicker._curInst===r)||t.datepicker._hideDatepicker()}},_adjustDate:function(e,n,r){var o=t(e),i=this._getInst(o[0]);this._isDisabledDatepicker(o[0])||(this._adjustInstDate(i,n+("M"===r?this._get(i,"showCurrentAtPos"):0),r),this._updateDatepicker(i))},_gotoToday:function(e){var n,r=t(e),o=this._getInst(r[0]);this._get(o,"gotoCurrent")&&o.currentDay?(o.selectedDay=o.currentDay,o.drawMonth=o.selectedMonth=o.currentMonth,o.drawYear=o.selectedYear=o.currentYear):(n=new Date,o.selectedDay=n.getDate(),o.drawMonth=o.selectedMonth=n.getMonth(),o.drawYear=o.selectedYear=n.getFullYear()),this._notifyChange(o),this._adjustDate(r)},_selectMonthYear:function(e,n,r){var o=t(e),i=this._getInst(o[0]);i["selected"+("M"===r?"Month":"Year")]=i["draw"+("M"===r?"Month":"Year")]=parseInt(n.options[n.selectedIndex].value,10),this._notifyChange(i),this._adjustDate(o)},_selectDay:function(e,n,r,o){var i,a=t(e);t(o).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||((i=this._getInst(a[0])).selectedDay=i.currentDay=t("a",o).html(),i.selectedMonth=i.currentMonth=n,i.selectedYear=i.currentYear=r,this._selectDate(e,this._formatDate(i,i.currentDay,i.currentMonth,i.currentYear)))},_clearDate:function(e){var n=t(e);this._selectDate(n,"")},_selectDate:function(e,n){var r,o=t(e),i=this._getInst(o[0]);n=null!=n?n:this._formatDate(i),i.input&&i.input.val(n),this._updateAlternate(i),(r=this._get(i,"onSelect"))?r.apply(i.input?i.input[0]:null,[n,i]):i.input&&i.input.trigger("change"),i.inline?this._updateDatepicker(i):(this._hideDatepicker(),this._lastInput=i.input[0],"object"!=typeof i.input[0]&&i.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var n,r,o,i=this._get(e,"altField");i&&(n=this._get(e,"altFormat")||this._get(e,"dateFormat"),r=this._getDate(e),o=this.formatDate(n,r,this._getFormatConfig(e)),t(i).val(o))},noWeekends:function(t){var e=t.getDay();return[e>0&&e<6,""]},iso8601Week:function(t){var e,n=new Date(t.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),e=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((e-n)/864e5)/7)+1},parseDate:function(e,n,r){if(null==e||null==n)throw"Invalid arguments";if(""===(n="object"==typeof n?n.toString():n+""))return null;var o,i,a,u,s=0,c=(r?r.shortYearCutoff:null)||this._defaults.shortYearCutoff,l="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),f=(r?r.dayNamesShort:null)||this._defaults.dayNamesShort,d=(r?r.dayNames:null)||this._defaults.dayNames,m=(r?r.monthNamesShort:null)||this._defaults.monthNamesShort,h=(r?r.monthNames:null)||this._defaults.monthNames,p=-1,g=-1,v=-1,b=-1,y=!1,x=function(t){var n=o+1<e.length&&e.charAt(o+1)===t;return n&&o++,n},w=function(t){var e=x(t),r="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,o=new RegExp("^\\d{"+("y"===t?r:1)+","+r+"}"),i=n.substring(s).match(o);if(!i)throw"Missing number at position "+s;return s+=i[0].length,parseInt(i[0],10)},C=function(e,r,o){var i=-1,a=t.map(x(e)?o:r,(function(t,e){return[[e,t]]})).sort((function(t,e){return-(t[1].length-e[1].length)}));if(t.each(a,(function(t,e){var r=e[1];if(n.substr(s,r.length).toLowerCase()===r.toLowerCase())return i=e[0],s+=r.length,!1})),-1!==i)return i+1;throw"Unknown name at position "+s},_=function(){if(n.charAt(s)!==e.charAt(o))throw"Unexpected literal at position "+s;s++};for(o=0;o<e.length;o++)if(y)"'"!==e.charAt(o)||x("'")?_():y=!1;else switch(e.charAt(o)){case"d":v=w("d");break;case"D":C("D",f,d);break;case"o":b=w("o");break;case"m":g=w("m");break;case"M":g=C("M",m,h);break;case"y":p=w("y");break;case"@":p=(u=new Date(w("@"))).getFullYear(),g=u.getMonth()+1,v=u.getDate();break;case"!":p=(u=new Date((w("!")-this._ticksTo1970)/1e4)).getFullYear(),g=u.getMonth()+1,v=u.getDate();break;case"'":x("'")?_():y=!0;break;default:_()}if(s<n.length&&(a=n.substr(s),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===p?p=(new Date).getFullYear():p<100&&(p+=(new Date).getFullYear()-(new Date).getFullYear()%100+(p<=l?0:-100)),b>-1)for(g=1,v=b;!(v<=(i=this._getDaysInMonth(p,g-1)));)g++,v-=i;if((u=this._daylightSavingAdjust(new Date(p,g-1,v))).getFullYear()!==p||u.getMonth()+1!==g||u.getDate()!==v)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(t,e,n){if(!e)return"";var r,o=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,i=(n?n.dayNames:null)||this._defaults.dayNames,a=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,s=function(e){var n=r+1<t.length&&t.charAt(r+1)===e;return n&&r++,n},c=function(t,e,n){var r=""+e;if(s(t))for(;r.length<n;)r="0"+r;return r},l=function(t,e,n,r){return s(t)?r[e]:n[e]},f="",d=!1;if(e)for(r=0;r<t.length;r++)if(d)"'"!==t.charAt(r)||s("'")?f+=t.charAt(r):d=!1;else switch(t.charAt(r)){case"d":f+=c("d",e.getDate(),2);break;case"D":f+=l("D",e.getDay(),o,i);break;case"o":f+=c("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":f+=c("m",e.getMonth()+1,2);break;case"M":f+=l("M",e.getMonth(),a,u);break;case"y":f+=s("y")?e.getFullYear():(e.getFullYear()%100<10?"0":"")+e.getFullYear()%100;break;case"@":f+=e.getTime();break;case"!":f+=1e4*e.getTime()+this._ticksTo1970;break;case"'":s("'")?f+="'":d=!0;break;default:f+=t.charAt(r)}return f},_possibleChars:function(t){var e,n="",r=!1,o=function(n){var r=e+1<t.length&&t.charAt(e+1)===n;return r&&e++,r};for(e=0;e<t.length;e++)if(r)"'"!==t.charAt(e)||o("'")?n+=t.charAt(e):r=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":n+="0123456789";break;case"D":case"M":return null;case"'":o("'")?n+="'":r=!0;break;default:n+=t.charAt(e)}return n},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var n=this._get(t,"dateFormat"),r=t.lastVal=t.input?t.input.val():null,o=this._getDefaultDate(t),i=o,a=this._getFormatConfig(t);try{i=this.parseDate(n,r,a)||o}catch(t){r=e?"":r}t.selectedDay=i.getDate(),t.drawMonth=t.selectedMonth=i.getMonth(),t.drawYear=t.selectedYear=i.getFullYear(),t.currentDay=r?i.getDate():0,t.currentMonth=r?i.getMonth():0,t.currentYear=r?i.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,n,r){var o=null==n||""===n?r:"string"==typeof n?function(n){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),n,t.datepicker._getFormatConfig(e))}catch(t){}for(var r=(n.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=r.getFullYear(),i=r.getMonth(),a=r.getDate(),u=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,s=u.exec(n);s;){switch(s[2]||"d"){case"d":case"D":a+=parseInt(s[1],10);break;case"w":case"W":a+=7*parseInt(s[1],10);break;case"m":case"M":i+=parseInt(s[1],10),a=Math.min(a,t.datepicker._getDaysInMonth(o,i));break;case"y":case"Y":o+=parseInt(s[1],10),a=Math.min(a,t.datepicker._getDaysInMonth(o,i))}s=u.exec(n)}return new Date(o,i,a)}(n):"number"==typeof n?isNaN(n)?r:function(t){var e=new Date;return e.setDate(e.getDate()+t),e}(n):new Date(n.getTime());return(o=o&&"Invalid Date"===o.toString()?r:o)&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,n){var r=!e,o=t.selectedMonth,i=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),o===t.selectedMonth&&i===t.selectedYear||n||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(r?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(e){var n=this._get(e,"stepMonths"),r="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map((function(){var e={prev:function(){t.datepicker._adjustDate(r,-n,"M")},next:function(){t.datepicker._adjustDate(r,+n,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(r)},selectDay:function(){return t.datepicker._selectDay(r,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(r,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(r,this,"Y"),!1}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])}))},_generateHTML:function(t){var e,n,r,o,i,a,u,s,c,l,f,d,m,h,p,g,v,b,y,x,w,C,_,k,S,T,D,O,E,N,A,R,B,P,I,M,L,F,H,j=new Date,V=this._daylightSavingAdjust(new Date(j.getFullYear(),j.getMonth(),j.getDate())),z=this._get(t,"isRTL"),U=this._get(t,"showButtonPanel"),W=this._get(t,"hideIfNoPrevNext"),q=this._get(t,"navigationAsDateFormat"),$=this._getNumberOfMonths(t),Y=this._get(t,"showCurrentAtPos"),G=this._get(t,"stepMonths"),K=1!==$[0]||1!==$[1],X=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),J=this._getMinMaxDate(t,"min"),Q=this._getMinMaxDate(t,"max"),Z=t.drawMonth-Y,tt=t.drawYear;if(Z<0&&(Z+=12,tt--),Q)for(e=this._daylightSavingAdjust(new Date(Q.getFullYear(),Q.getMonth()-$[0]*$[1]+1,Q.getDate())),e=J&&e<J?J:e;this._daylightSavingAdjust(new Date(tt,Z,1))>e;)--Z<0&&(Z=11,tt--);for(t.drawMonth=Z,t.drawYear=tt,n=this._get(t,"prevText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(tt,Z-G,1)),this._getFormatConfig(t)):n,r=this._canAdjustMonth(t,-1,tt,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(z?"e":"w")+"'>"+n+"</span></a>":W?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(z?"e":"w")+"'>"+n+"</span></a>",o=this._get(t,"nextText"),o=q?this.formatDate(o,this._daylightSavingAdjust(new Date(tt,Z+G,1)),this._getFormatConfig(t)):o,i=this._canAdjustMonth(t,1,tt,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+o+"'><span class='ui-icon ui-icon-circle-triangle-"+(z?"w":"e")+"'>"+o+"</span></a>":W?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+o+"'><span class='ui-icon ui-icon-circle-triangle-"+(z?"w":"e")+"'>"+o+"</span></a>",a=this._get(t,"currentText"),u=this._get(t,"gotoCurrent")&&t.currentDay?X:V,a=q?this.formatDate(a,u,this._getFormatConfig(t)):a,s=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",c=U?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(z?s:"")+(this._isInRange(t,u)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(z?"":s)+"</div>":"",l=parseInt(this._get(t,"firstDay"),10),l=isNaN(l)?0:l,f=this._get(t,"showWeek"),d=this._get(t,"dayNames"),m=this._get(t,"dayNamesMin"),h=this._get(t,"monthNames"),p=this._get(t,"monthNamesShort"),g=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),b=this._get(t,"selectOtherMonths"),y=this._getDefaultDate(t),x="",C=0;C<$[0];C++){for(_="",this.maxRows=4,k=0;k<$[1];k++){if(S=this._daylightSavingAdjust(new Date(tt,Z,t.selectedDay)),T=" ui-corner-all",D="",K){if(D+="<div class='ui-datepicker-group",$[1]>1)switch(k){case 0:D+=" ui-datepicker-group-first",T=" ui-corner-"+(z?"right":"left");break;case $[1]-1:D+=" ui-datepicker-group-last",T=" ui-corner-"+(z?"left":"right");break;default:D+=" ui-datepicker-group-middle",T=""}D+="'>"}for(D+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+T+"'>"+(/all|left/.test(T)&&0===C?z?i:r:"")+(/all|right/.test(T)&&0===C?z?r:i:"")+this._generateMonthYearHeader(t,Z,tt,J,Q,C>0||k>0,h,p)+"</div><table class='ui-datepicker-calendar'><thead><tr>",O=f?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;w<7;w++)O+="<th scope='col'"+((w+l+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+d[E=(w+l)%7]+"'>"+m[E]+"</span></th>";for(D+=O+"</tr></thead><tbody>",N=this._getDaysInMonth(tt,Z),tt===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,N)),A=(this._getFirstDayOfMonth(tt,Z)-l+7)%7,R=Math.ceil((A+N)/7),B=K&&this.maxRows>R?this.maxRows:R,this.maxRows=B,P=this._daylightSavingAdjust(new Date(tt,Z,1-A)),I=0;I<B;I++){for(D+="<tr>",M=f?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(P)+"</td>":"",w=0;w<7;w++)L=g?g.apply(t.input?t.input[0]:null,[P]):[!0,""],H=(F=P.getMonth()!==Z)&&!b||!L[0]||J&&P<J||Q&&P>Q,M+="<td class='"+((w+l+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(P.getTime()===S.getTime()&&Z===t.selectedMonth&&t._keyEvent||y.getTime()===P.getTime()&&y.getTime()===S.getTime()?" "+this._dayOverClass:"")+(H?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!v?"":" "+L[1]+(P.getTime()===X.getTime()?" "+this._currentClass:"")+(P.getTime()===V.getTime()?" ui-datepicker-today":""))+"'"+(F&&!v||!L[2]?"":" title='"+L[2].replace(/'/g,"'")+"'")+(H?"":" data-handler='selectDay' data-event='click' data-month='"+P.getMonth()+"' data-year='"+P.getFullYear()+"'")+">"+(F&&!v?" ":H?"<span class='ui-state-default'>"+P.getDate()+"</span>":"<a class='ui-state-default"+(P.getTime()===V.getTime()?" ui-state-highlight":"")+(P.getTime()===X.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+P.getDate()+"</a>")+"</td>",P.setDate(P.getDate()+1),P=this._daylightSavingAdjust(P);D+=M+"</tr>"}++Z>11&&(Z=0,tt++),_+=D+="</tbody></table>"+(K?"</div>"+($[0]>0&&k===$[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}x+=_}return x+=c,t._keyEvent=!1,x},_generateMonthYearHeader:function(t,e,n,r,o,i,a,u){var s,c,l,f,d,m,h,p,g=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),b=this._get(t,"showMonthAfterYear"),y="<div class='ui-datepicker-title'>",x="";if(i||!g)x+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(s=r&&r.getFullYear()===n,c=o&&o.getFullYear()===n,x+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",l=0;l<12;l++)(!s||l>=r.getMonth())&&(!c||l<=o.getMonth())&&(x+="<option value='"+l+"'"+(l===e?" selected='selected'":"")+">"+u[l]+"</option>");x+="</select>"}if(b||(y+=x+(!i&&g&&v?"":" ")),!t.yearshtml)if(t.yearshtml="",i||!v)y+="<span class='ui-datepicker-year'>"+n+"</span>";else{for(f=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),h=(m=function(t){var e=t.match(/c[+\-].*/)?n+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e})(f[0]),p=Math.max(h,m(f[1]||"")),h=r?Math.max(h,r.getFullYear()):h,p=o?Math.min(p,o.getFullYear()):p,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";h<=p;h++)t.yearshtml+="<option value='"+h+"'"+(h===n?" selected='selected'":"")+">"+h+"</option>";t.yearshtml+="</select>",y+=t.yearshtml,t.yearshtml=null}return y+=this._get(t,"yearSuffix"),b&&(y+=(!i&&g&&v?"":" ")+x),y+="</div>"},_adjustInstDate:function(t,e,n){var r=t.selectedYear+("Y"===n?e:0),o=t.selectedMonth+("M"===n?e:0),i=Math.min(t.selectedDay,this._getDaysInMonth(r,o))+("D"===n?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(r,o,i)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),"M"!==n&&"Y"!==n||this._notifyChange(t)},_restrictMinMax:function(t,e){var n=this._getMinMaxDate(t,"min"),r=this._getMinMaxDate(t,"max"),o=n&&e<n?n:e;return r&&o>r?r:o},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,n,r){var o=this._getNumberOfMonths(t),i=this._daylightSavingAdjust(new Date(n,r+(e<0?e:o[0]*o[1]),1));return e<0&&i.setDate(this._getDaysInMonth(i.getFullYear(),i.getMonth())),this._isInRange(t,i)},_isInRange:function(t,e){var n,r,o=this._getMinMaxDate(t,"min"),i=this._getMinMaxDate(t,"max"),a=null,u=null,s=this._get(t,"yearRange");return s&&(n=s.split(":"),r=(new Date).getFullYear(),a=parseInt(n[0],10),u=parseInt(n[1],10),n[0].match(/[+\-].*/)&&(a+=r),n[1].match(/[+\-].*/)&&(u+=r)),(!o||e.getTime()>=o.getTime())&&(!i||e.getTime()<=i.getTime())&&(!a||e.getFullYear()>=a)&&(!u||e.getFullYear()<=u)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,n,r){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var o=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(r,n,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),o,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).on("mousedown",t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var n=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(n)):this.each((function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(n)):t.datepicker._attachDatepicker(this,e)})):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(n))},t.datepicker=new n,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.12.1",t.datepicker})?r.apply(e,o):r)||(t.exports=i)},Y7JG:function(t,e,n){var r,o,i;o=[n("EVdn"),n("b1uY"),n("Qwlt"),n("vBzC"),n("yw1R"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}return t.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),n=this.element;return t.each(["min","max","step"],(function(t,r){var o=n.attr(r);null!=o&&o.length&&(e[r]=o)})),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay((function(){this.spinning&&this._stop(t)}),100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){var n;function r(){this.element[0]===t.ui.safeActiveElement(this.document[0])||(this.element.trigger("focus"),this.previous=n,this._delay((function(){this.previous=n})))}n=this.element[0]===t.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),e.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay((function(){delete this.cancelBlur,r.call(this)})),!1!==this._start(e)&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){if(t(e.currentTarget).hasClass("ui-state-active"))return!1!==this._start(e)&&void this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(e){var n=this.options,r=t.ui.keyCode;switch(e.keyCode){case r.UP:return this._repeat(null,1,e),!0;case r.DOWN:return this._repeat(null,-1,e),!0;case r.PAGE_UP:return this._repeat(null,n.page,e),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,e),!0}return!1},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t)||(this.counter||(this.counter=1),this.spinning=!0,0))},_repeat:function(t,e,n){t=t||500,clearTimeout(this.timer),this.timer=this._delay((function(){this._repeat(40,e,n)}),t),this._spin(e*this.options.step,n)},_spin:function(t,e){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:n})||(this._value(n),this.counter++)},_increment:function(e){var n=this.options.incremental;return n?t.isFunction(n)?n(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),n=e.indexOf(".");return-1===n?0:e.length-n-1},_adjustValue:function(t){var e,n,r=this.options;return n=t-(e=null!==r.min?r.min:0),t=e+(n=Math.round(n/r.step)*r.step),t=parseFloat(t.toFixed(this._precision())),null!==r.max&&t>r.max?r.max:null!==r.min&&t<r.min?r.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var n,r,o;if("culture"===t||"numberFormat"===t)return n=this._parse(this.element.val()),this.options[t]=e,void this.element.val(this._format(n));"max"!==t&&"min"!==t&&"step"!==t||"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(r=this.buttons.first().find(".ui-icon"),this._removeClass(r,null,this.options.icons.up),this._addClass(r,null,e.up),o=this.buttons.last().find(".ui-icon"),this._removeClass(o,null,this.options.icons.down),this._addClass(o,null,e.down)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:e((function(t){this._super(t)})),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null!==t&&t===this._adjustValue(t)},_value:function(t,e){var n;""!==t&&null!==(n=this._parse(t))&&(e||(n=this._adjustValue(n)),t=this._format(n)),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e((function(t){this._stepUp(t)})),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e((function(t){this._stepDown(t)})),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e((function(t){this._stepUp((t||1)*this.options.page)})),pageDown:e((function(t){this._stepDown((t||1)*this.options.page)})),value:function(t){if(!arguments.length)return this._parse(this.element.val());e(this._value).call(this,t)},widget:function(){return this.uiSpinner}}),!1!==t.uiBackCompat&&t.widget("ui.spinner",t.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),t.ui.spinner})?r.apply(e,o):r)||(t.exports=i)},ZNhe:function(t,e,n){n("7x9u")},b1uY:function(t,e,n){var r,o,i;o=[n("EVdn"),n("u1Bl"),n("UTCq"),n("vBzC"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){var e;return t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,n){var r="iconPosition"!==e,o=r?this.options.iconPosition:n,i="top"===o||"bottom"===o;this.icon?r&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),r&&this._addClass(this.icon,null,n),this._attachIcon(o),i?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(o))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,n=void 0===t.icon?this.options.icon:t.icon;e||n||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==t.uiBackCompat&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"!==t?("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",e)}}),t.fn.button=(e=t.fn.button,function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),t.ui.button})?r.apply(e,o):r)||(t.exports=i)},endd:function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},eqyj:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,i,a){var u=[];u.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),!0===a&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},"fE+E":function(t,e){!function(t){"use strict";var e,n,r,o,i=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},a=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},s=function(t,e){t.addCommand("mceTogglePlainTextPaste",(function(){!function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),u(t,!1)):(e.pasteFormat.set("text"),u(t,!0)),t.focus()}(t,e)})),t.addCommand("mceInsertClipboardContent",(function(t,n){n.content&&e.pasteHtml(n.content,n.internal),n.text&&e.pasteText(n.text)}))},c=function(){},l=function(t){return function(){return t}},f=l(!1),d=l(!0),m=function(){return h},h=(e=function(t){return t.isNone()},{fold:function(t,e){return t()},is:f,isSome:f,isNone:d,getOr:r=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:r,orThunk:n,map:m,each:c,bind:m,exists:f,forall:d,filter:m,equals:e,equals_:e,toArray:function(){return[]},toString:l("none()")}),p=function(t){var e=l(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:d,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return p(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:h},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(f,(function(e){return n(t,e)}))}};return o},g={some:p,none:m,from:function(t){return null==t?h:p(t)}},v=(o="function",function(t){return typeof t===o}),b=Array.prototype.slice,y=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},x=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},w=v(Array.from)?Array.from:function(t){return b.call(t)},C=tinymce.util.Tools.resolve("tinymce.Env"),_=tinymce.util.Tools.resolve("tinymce.util.Delay"),k=tinymce.util.Tools.resolve("tinymce.util.Promise"),S=tinymce.util.Tools.resolve("tinymce.util.Tools"),T=tinymce.util.Tools.resolve("tinymce.util.VK"),D=function(t){return-1!==t.indexOf("\x3c!-- x-tinymce/html --\x3e")},O=tinymce.util.Tools.resolve("tinymce.html.Entities"),E=function(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+O.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",a=S.map(r,(function(t){return t.split(/\n/).join("<br />")}));return 1===a.length?a[0]:S.map(a,(function(t){return o+t+i})).join("")},N=tinymce.util.Tools.resolve("tinymce.html.DomParser"),A=tinymce.util.Tools.resolve("tinymce.html.Serializer"),R=tinymce.util.Tools.resolve("tinymce.html.Node"),B=tinymce.util.Tools.resolve("tinymce.html.Schema"),P=function(t){return t.getParam("paste_data_images",!1)},I=function(t){return t.getParam("paste_merge_formats",!0)},M=function(t){return t.getParam("paste_retain_style_properties")},L=function(t){return t.getParam("validate")},F=function(t){return t.getParam("allow_html_data_urls",!1,"boolean")},H=function(t){return t.getParam("paste_data_images",!1,"boolean")};function j(t,e){return S.each(e,(function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])})),t}function V(t){return t=j(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(t,e,n){return e||n?" ":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])}var z=function(){return-1!==t.navigator.userAgent.indexOf(" Edge/")};function U(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)}function W(t){var e;return t=t.replace(/^[\u00a0 ]+/,""),S.each([/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],(function(n){if(n.test(t))return e=!0,!1})),e}function q(t){var e,n,r=1;function o(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)do{e+=o(t)}while(t=t.next);return e}function i(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!i(t,e))return!1}while(t=t.next);return!0}function a(t,o,a){var u=t._listLevel||r;u!==r&&(u<r?e&&(e=e.parent.parent):(n=e,e=null)),e&&e.name===o?e.append(t):(n=n||e,e=new R(o,1),a>1&&e.attr("start",""+a),t.wrap(e)),t.name="li",u>r&&n&&n.lastChild.append(e),r=u,function t(e){if(e._listIgnore)e.remove();else if(e=e.firstChild)do{t(e)}while(e=e.next)}(t),i(t,/^\u00a0+/),i(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),i(t,/^\u00a0+/)}for(var u=[],s=t.firstChild;null!=s;)if(u.push(s),null!==(s=s.walk()))for(;void 0!==s&&s.parent!==t;)s=s.walk();for(var c=0;c<u.length;c++)if("p"===(t=u[c]).name&&t.firstChild){var l=o(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(l)){a(t,"ul");continue}if(W(l)){var f=/([0-9]+)\./.exec(l),d=1;f&&(d=parseInt(f[1],10)),a(t,"ol",d);continue}if(t._listLevel){a(t,"ul",1);continue}e=null}else n=e,e=null}function $(t,e,n,r){var o,i={},a=t.dom.parseStyle(r);return S.each(a,(function(a,u){switch(u){case"mso-list":(o=/\w+ \w+([0-9]+)/i.exec(r))&&(n._listLevel=parseInt(o[1],10)),/Ignore/i.test(a)&&n.firstChild&&(n._listIgnore=!0,n.firstChild._listIgnore=!0);break;case"horiz-align":u="text-align";break;case"vert-align":u="vertical-align";break;case"font-color":case"mso-foreground":u="color";break;case"mso-background":case"mso-highlight":u="background";break;case"font-weight":case"font-style":return void("normal"!==a&&(i[u]=a));case"mso-element":if(/^(comment|comment-list)$/i.test(a))return void n.remove()}0!==u.indexOf("mso-comment")?0!==u.indexOf("mso-")&&("all"===M(t)||e&&e[u])&&(i[u]=a):n.remove()})),/(bold)/i.test(i["font-weight"])&&(delete i["font-weight"],n.wrap(new R("b",1))),/(italic)/i.test(i["font-style"])&&(delete i["font-style"],n.wrap(new R("i",1))),(i=t.dom.serializeStyle(i,n.name))||null}var Y,G,K=function(t,e){return function(t){return t.getParam("paste_enable_default_filters",!0)}(t)?function(t,e){var n,r=M(t);r&&(n=S.makeMap(r.split(/[, ]/))),e=j(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi," "],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return e.length>0?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join(" "):""}]]);var o=function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")}(t),i=B({valid_elements:o,valid_children:"-li[p]"});S.each(i.elements,(function(t){t.attributes.class||(t.attributes.class={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))}));var a=N({},i);a.addAttributeFilter("style",(function(e){for(var r,o=e.length;o--;)(r=e[o]).attr("style",$(t,n,r,r.attr("style"))),"span"===r.name&&r.parent&&!r.attributes.length&&r.unwrap()})),a.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)})),a.addNodeFilter("del",(function(t){for(var e=t.length;e--;)t[e].remove()})),a.addNodeFilter("a",(function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()}));var u=a.parse(e);return function(t){return t.getParam("paste_convert_word_fake_lists",!0)}(t)&&q(u),e=A({validate:L(t)},i).serialize(u)}(t,e):e},X=function(t,e){return{content:t,cancelled:e}},J=function(t,e,n,r){var o=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})}(t,e,n,r),i=function(t,e){var n=N({},t.schema);n.addNodeFilter("meta",(function(t){S.each(t,(function(t){return t.remove()}))}));var r=n.parse(e,{forced_root_block:!1,isRootContent:!0});return A({validate:L(t)},t.schema).serialize(r)}(t,o.content);return t.hasEventListeners("PastePostProcess")&&!o.isDefaultPrevented()?function(t,e,n,r){var o=t.dom.create("div",{style:"display:none"},e),i=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})}(t,o,n,r);return X(i.node.innerHTML,i.isDefaultPrevented())}(t,i,n,r):X(i,o.isDefaultPrevented())},Q=function(t,e){return t.insertContent(e,{merge:I(t),paste:!0}),!0},Z=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},tt=function(t){return Z(t)&&/.(gif|jpe?g|png)$/.test(t)},et=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!Z(e))&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.execCommand("mceInsertLink",!1,e)})),!0}(t,e,n)},nt=function(t,e,n){return!!tt(e)&&function(t,e,n){return t.undoManager.extra((function(){n(t,e)}),(function(){t.insertContent('<img src="'+e+'">')})),!0}(t,e,n)},rt=function(t,e,n){n||!1===function(t){return t.getParam("smart_paste",!0)}(t)?Q(t,e):function(t,e){S.each([et,nt,Q],(function(n){return!0!==n(t,e,Q)}))}(t,e)},ot=function(t){return"\n"===t||"\r"===t},it=function(t){return function(t,e,n){return x(t,(function(t){n=e(n,t)})),n}(t,(function(e,n){return function(t){return-1!==" \f\t\v".indexOf(t)}(n)||" "===n?e.pcIsSpace||""===e.str||e.str.length===t.length-1||function(t,e){return e<t.length&&e>=0&&ot(t[e])}(t,e.str.length+1)?{pcIsSpace:!1,str:e.str+" "}:{pcIsSpace:!0,str:e.str+" "}:{pcIsSpace:ot(n),str:e.str+n}}),{pcIsSpace:!1,str:""}).str},at=function(t,e,n,r){var o=function(t,e,n){var r=U(e),o=r?K(t,e):e;return J(t,o,n,r)}(t,e,n);!1===o.cancelled&&rt(t,o.content,r)},ut=function(t,e,n){var r=n||D(e);at(t,function(t){return t.replace("\x3c!-- x-tinymce/html --\x3e","")}(e),r,!1)},st=function(t,e){var n=t.dom.encode(e).replace(/\r\n/g,"\n"),r=function(t,e,n){return e?E(t,!0===e?"p":e,n):function(t){return t.replace(/\r?\n/g,"<br>")}(t)}(it(n),function(t){return t.getParam("forced_root_block")}(t),function(t){return t.getParam("forced_root_block_attrs")}(t));at(t,r,!1,!0)},ct=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&n.length>0&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(t){e[o]=""}}}return e},lt=function(t,e){return e in t&&t[e].length>0},ft=function(t){return lt(t,"text/html")||lt(t,"text/plain")},dt=(Y="mceclip",G=0,function(){return Y+G++}),mt=function(e,n){var r,o,i=(r=n.uri,(o=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(r))?{type:o[1],data:decodeURIComponent(o[2])}:{type:null,data:null}),a=i.data,u=i.type,s=dt(),c=function(t){return t.getParam("images_reuse_filename")}(e)&&n.blob.name?function(t,e){var n=e.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i);return n?t.dom.encode(n[1]):null}(e,n.blob.name):s,l=new t.Image;if(l.src=n.uri,function(t,e){var n=function(t){return t.getParam("images_dataimg_filter")}(t);return!n||n(e)}(e,l)){var f=e.editorUpload.blobCache,d=void 0,m=f.getByData(a,u);m?d=m:(d=f.create(s,n.blob,a,c),f.add(d)),ut(e,'<img src="'+d.blobUri()+'">',!1)}else ut(e,'<img src="'+n.uri+'">',!1)},ht=function(t,e,n){var r,o="paste"===e.type?e.clipboardData:e.dataTransfer;if(H(t)&&o){var i=function(t){var e=t.items?y(w(t.items),(function(t){return t.getAsFile()})):[],n=t.files?w(t.files):[];return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(e.length>0?e:n,(function(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)}))}(o);if(i.length>0)return e.preventDefault(),(r=i,k.all(y(r,(function(t){return new k((function(e){var n=t.getAsFile?t.getAsFile():t,r=new window.FileReader;r.onload=function(){e({blob:n,uri:r.result})},r.readAsDataURL(n)}))})))).then((function(e){n&&t.selection.setRng(n),x(e,(function(e){mt(t,e)}))})),!0}return!1},pt=function(t){return T.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},gt=function(e,n,r){var o,a,u=(o=i(g.none()),{clear:function(){o.set(g.none())},set:function(t){o.set(g.some(t))},isSet:function(){return o.get().isSome()},on:function(t){o.get().each(t)}});function s(t,r,o,i){var a;lt(t,"text/html")?a=t["text/html"]:(a=n.getHtml(),i=i||D(a),n.isDefaultContent(a)&&(o=!0)),a=V(a),n.remove();var u=!1===i&&!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(a),s=tt(a);(!a.length||u&&!s)&&(o=!0),(o||s)&&(a=lt(t,"text/plain")&&u?t["text/plain"]:function(t){var e=B(),n=N({},e),r="",o=e.getShortEndedElements(),i=S.makeMap("script noscript style textarea video audio iframe object"," "),a=e.getBlockElements();return t=j(t,[/<!\[[^\]]+\]>/g]),function t(e){var n=e.name,u=e;if("br"!==n){if("wbr"!==n)if(o[n]&&(r+=" "),i[n])r+=" ";else{if(3===e.type&&(r+=e.value),!e.shortEnded&&(e=e.firstChild))do{t(e)}while(e=e.next);a[n]&&u.next&&(r+="\n","p"===n&&(r+="\n"))}}else r+="\n"}(n.parse(t)),r}(a)),n.isDefaultContent(a)?r||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):o?st(e,a):ut(e,a,i)}e.on("keydown",(function(r){function o(t){pt(t)&&!t.isDefaultPrevented()&&n.remove()}if(pt(r)&&!r.isDefaultPrevented()){if((a=r.shiftKey&&86===r.keyCode)&&C.webkit&&-1!==t.navigator.userAgent.indexOf("Version/"))return;if(r.stopImmediatePropagation(),u.set(r),window.setTimeout((function(){u.clear()}),100),C.ie&&a)return r.preventDefault(),void function(t,e){t.fire("paste",{ieFake:e})}(e,!0);n.remove(),n.create(),e.once("keyup",o),e.once("paste",(function(){e.off("keyup",o)}))}}));e.on("paste",(function(o){var i=u.isSet(),c=function(t,e){var n=ct(e.clipboardData||t.getDoc().dataTransfer);return z()?S.extend(n,{"text/html":""}):n}(e,o),l="text"===r.get()||a,f=lt(c,"x-tinymce/html");a=!1,o.isDefaultPrevented()||function(e){var n=e.clipboardData;return-1!==t.navigator.userAgent.indexOf("Android")&&n&&n.items&&0===n.items.length}(o)?n.remove():ft(c)||!ht(e,o,n.getLastRng()||e.selection.getRng())?(i||o.preventDefault(),!C.ie||i&&!o.ieFake||lt(c,"text/html")||(n.create(),e.dom.bind(n.getEl(),"paste",(function(t){t.stopPropagation()})),e.getDoc().execCommand("Paste",!1,null),c["text/html"]=n.getHtml()),lt(c,"text/html")?(o.preventDefault(),f||(f=D(c["text/html"])),s(c,i,l,f)):_.setEditorTimeout(e,(function(){s(c,i,l,f)}),0)):n.remove()}))},vt=function(e){return C.ie&&e.inline?t.document.body:e.getBody()},bt=function(t,e,n){(function(t){return vt(t)!==t.getBody()})(t)&&t.dom.bind(e,"paste keyup",(function(e){wt(t,n)||t.fire("paste")}))},yt=function(t){return t.dom.get("mcepastebin")},xt=function(t,e){return e===t},wt=function(t,e){var n,r=yt(t);return(n=r)&&"mcepastebin"===n.id&&xt(e,r.innerHTML)},Ct=function(t){var e=i(null);return{create:function(){return function(t,e,n){var r=t.dom,o=t.getBody();e.set(t.selection.getRng());var i=t.dom.add(vt(t),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n);(C.ie||C.gecko)&&r.setStyle(i,"left","rtl"===r.getStyle(o,"direction",!0)?65535:-65535),r.bind(i,"beforedeactivate focusin focusout",(function(t){t.stopPropagation()})),bt(t,i,n),i.focus(),t.selection.select(i,!0)}(t,e,"%MCEPASTEBIN%")},remove:function(){return function(t,e){if(yt(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return yt(t)},getHtml:function(){return function(t){var e=function(e,n){e.appendChild(n),t.dom.remove(n,!0)},n=S.grep(vt(t).childNodes,(function(t){return"mcepastebin"===t.id})),r=n.shift();S.each(n,(function(t){e(r,t)}));for(var o=t.dom.select("div[id=mcepastebin]",r),i=o.length-1;i>=0;i--){var a=t.dom.create("div");r.insertBefore(a,o[i]),e(a,o[i])}return r?r.innerHTML:""}(t)},getLastRng:function(){return function(t){return t.get()}(e)},isDefault:function(){return wt(t,"%MCEPASTEBIN%")},isDefaultContent:function(t){return xt("%MCEPASTEBIN%",t)}}},_t=function(t,e){var n=Ct(t);return t.on("PreInit",(function(){return function(t,e,n){var r;gt(t,e,n),t.parser.addNodeFilter("img",(function(e,n,o){var i=function(t){t.attr("data-mce-object")||r===C.transparentSrc||t.remove()},a=function(t){return 0===t.indexOf("webkit-fake-url")},u=function(t){return 0===t.indexOf("data:")};if(!H(t)&&function(t){return t.data&&!0===t.data.paste}(o))for(var s=e.length;s--;)(r=e[s].attr("src"))&&(a(r)||!F(t)&&u(r))&&i(e[s])}))}(t,n,e)})),{pasteFormat:e,pasteHtml:function(e,n){return ut(t,e,n)},pasteText:function(e){return st(t,e)},pasteImageData:function(e,n){return ht(t,e,n)},getDataTransferItems:ct,hasHtmlOrText:ft,hasContentType:lt}},kt=function(t,e,n){if(!function(t){return!1===C.iOS&&void 0!==t&&"function"==typeof t.setData&&!0!==z()}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData("x-tinymce/html",e),!0}catch(t){return!1}},St=function(t,e,n,r){kt(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)},Tt=function(t){return function(e,n){var r=function(t){return"\x3c!-- x-tinymce/html --\x3e"+t}(e),o=t.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),i=t.dom.create("div",{contenteditable:"true"},r);t.dom.setStyles(o,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),o.appendChild(i),t.dom.add(t.getBody(),o);var a=t.selection.getRng();i.focus();var u=t.dom.createRng();u.selectNodeContents(i),t.selection.setRng(u),_.setTimeout((function(){t.selection.setRng(a),o.parentNode.removeChild(o),n()}),0)}},Dt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},Ot=function(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)},Et=function(t){t.on("cut",function(t){return function(e){Ot(t)&&St(e,Dt(t),Tt(t),(function(){if(C.browser.isChrome()){var e=t.selection.getRng();_.setEditorTimeout(t,(function(){t.selection.setRng(e),t.execCommand("Delete")}),0)}else t.execCommand("Delete")}))}}(t)),t.on("copy",function(t){return function(e){Ot(t)&&St(e,Dt(t),Tt(t),(function(){}))}}(t))},Nt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),At=function(t,e){return Nt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},Rt=function(t,e){t.focus(),t.selection.setRng(e)};function Bt(t,e){t.on("PastePreProcess",(function(n){n.content=e(t,n.content,n.internal,n.wordContent)}))}function Pt(t,e){if(!U(e))return e;var n=[];return S.each(t.schema.getBlockElements(),(function(t,e){n.push(e)})),e=j(e,[[new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g"),"$1"]]),e=j(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function It(t,e,n,r){if(r||n)return e;var o,i=function(t){return t.getParam("paste_webkit_styles")}(t);if(!1===function(t){return t.getParam("paste_remove_styles_if_webkit",!0)}(t)||"all"===i)return e;if(i&&(o=i.split(/[, ]/)),o){var a=t.dom,u=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(function(t,e,n,r){var i=a.parseStyle(a.decode(n)),s={};if("none"===o)return e+r;for(var c=0;c<o.length;c++){var l=i[o[c]],f=a.getStyle(u,o[c],!0);/color/.test(o[c])&&(l=a.toHex(l),f=a.toHex(f)),f!==l&&(s[o[c]]=l)}return(s=a.serializeStyle(s,"span"))?e+' style="'+s+'"'+r:e+r}))}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(function(t,e,n,r){return e+' style="'+n+'"'+r}))}function Mt(t,e){t.$("a",e).find("font,u").each((function(e,n){t.dom.remove(n,!0)}))}var Lt=function(t,e){return function(n){n.setActive("text"===e.pasteFormat.get());var r=function(t){return n.setActive(t.state)};return t.on("PastePlainTextToggle",r),function(){return t.off("PastePlainTextToggle",r)}}};a.add("paste",(function(e){if(!1===function(e){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(e.getParam("plugins"))||!a.get("powerpaste")||(void 0!==t.window.console&&t.window.console.log&&t.window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))}(e)){var n=i(!1),r=i(function(t){return t.getParam("paste_as_text",!1)}(e)?"text":"html"),o=_t(e,r),u=function(t){C.webkit&&Bt(t,It),C.ie&&(Bt(t,Pt),function(t,e){t.on("PastePostProcess",(function(n){e(t,n.node)}))}(t,Mt))}(e);return function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Lt(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Lt(t,e)})}(e,o),s(e,o),function(t){var e=t.plugins.paste,n=function(t){return t.getParam("paste_preprocess")}(t);n&&t.on("PastePreProcess",(function(t){n.call(e,e,t)}));var r=function(t){return t.getParam("paste_postprocess")}(t);r&&t.on("PastePostProcess",(function(t){r.call(e,e,t)}))}(e),Et(e),function(t,e,n){(function(t){return t.getParam("paste_block_drop",!1)})(t)&&t.on("dragend dragover draggesture dragdrop drop drag",(function(t){t.preventDefault(),t.stopPropagation()})),P(t)||t.on("drop",(function(t){var e=t.dataTransfer;e&&e.files&&e.files.length>0&&t.preventDefault()})),t.on("drop",(function(r){var o=At(t,r);if(!r.isDefaultPrevented()&&!n.get()){var i,a=e.getDataTransferItems(r.dataTransfer),u=e.hasContentType(a,"x-tinymce/html");if((e.hasHtmlOrText(a)&&(!(i=a["text/plain"])||0!==i.indexOf("file://"))||!e.pasteImageData(r,o))&&o&&function(t){return t.getParam("paste_filter_drop",!0)}(t)){var s=a["mce-internal"]||a["text/html"]||a["text/plain"];s&&(r.preventDefault(),_.setEditorTimeout(t,(function(){t.undoManager.transact((function(){a["mce-internal"]&&t.execCommand("Delete"),Rt(t,o),s=V(s),a["text/html"]?e.pasteHtml(s,u):e.pasteText(s)}))})))}}})),t.on("dragstart",(function(t){n.set(!0)})),t.on("dragover dragend",(function(e){P(t)&&!1===n.get()&&(e.preventDefault(),Rt(t,At(t,e))),"dragend"===e.type&&n.set(!1)}))}(e,o,n),function(t,e){return{clipboard:t,quirks:e}}(o,u)}}))}(window)},g7np:function(t,e,n){"use strict";var r=n("2SVd"),o=n("5oMp");t.exports=function(t,e){return t&&!r(e)?o(t,e):e}},hOyB:function(t,e,n){n("JAFY")},hVuo:function(t,e,n){n("4tak")},iGnl:function(t,e,n){var r,o,i;o=[n("EVdn"),n("NHgk"),n("Qwlt"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){var e=!1;return t(document).on("mouseup",(function(){e=!1})),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,(function(t){return e._mouseDown(t)})).on("click."+this.widgetName,(function(n){if(!0===t.data(n.target,e.widgetName+".preventClickEvent"))return t.removeData(n.target,e.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1})),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(n){if(!e){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(n),this._mouseDownEvent=n;var r=this,o=1===n.which,i=!("string"!=typeof this.options.cancel||!n.target.nodeName)&&t(n.target).closest(this.options.cancel).length;return!(o&&!i&&this._mouseCapture(n)&&(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout((function(){r.mouseDelayMet=!0}),this.options.delay)),this._mouseDistanceMet(n)&&this._mouseDelayMet(n)&&(this._mouseStarted=!1!==this._mouseStart(n),!this._mouseStarted)?(n.preventDefault(),0):(!0===t.data(n.target,this.widgetName+".preventClickEvent")&&t.removeData(n.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return r._mouseMove(t)},this._mouseUpDelegate=function(t){return r._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),n.preventDefault(),e=!0,0)))}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(n){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,n.target===this._mouseDownEvent.target&&t.data(n.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(n)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,e=!1,n.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})?r.apply(e,o):r)||(t.exports=i)},"jfS+":function(t,e,n){"use strict";var r=n("endd");function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new r(t),e(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o((function(e){t=e})),cancel:t}},t.exports=o},r15H:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt"),n("GC/X")],void 0===(i="function"==typeof(r=function(t){return t.fn.labels=function(){var e,n,r,o,i;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(o=this.eq(0).parents("label"),(r=this.attr("id"))&&(i=(e=this.eq(0).parents().last()).add(e.length?e.siblings():this.siblings()),n="label[for='"+t.ui.escapeSelector(r)+"']",o=o.add(i.find(n).addBack(n))),this.pushStack(o))}})?r.apply(e,o):r)||(t.exports=i)},tQ2B:function(t,e,n){"use strict";var r=n("xTJ+"),o=n("Rn+g"),i=n("MLWZ"),a=n("g7np"),u=n("w0Vi"),s=n("OTTw"),c=n("LYNF");t.exports=function(t){return new Promise((function(e,l){var f=t.data,d=t.headers;r.isFormData(f)&&delete d["Content-Type"];var m=new XMLHttpRequest;if(t.auth){var h=t.auth.username||"",p=t.auth.password||"";d.Authorization="Basic "+btoa(h+":"+p)}var g=a(t.baseURL,t.url);if(m.open(t.method.toUpperCase(),i(g,t.params,t.paramsSerializer),!0),m.timeout=t.timeout,m.onreadystatechange=function(){if(m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in m?u(m.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:t,request:m};o(e,l,r),m=null}},m.onabort=function(){m&&(l(c("Request aborted",t,"ECONNABORTED",m)),m=null)},m.onerror=function(){l(c("Network Error",t,null,m)),m=null},m.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),l(c(e,t,"ECONNABORTED",m)),m=null},r.isStandardBrowserEnv()){var v=n("eqyj"),b=(t.withCredentials||s(g))&&t.xsrfCookieName?v.read(t.xsrfCookieName):void 0;b&&(d[t.xsrfHeaderName]=b)}if("setRequestHeader"in m&&r.forEach(d,(function(t,e){void 0===f&&"content-type"===e.toLowerCase()?delete d[e]:m.setRequestHeader(e,t)})),r.isUndefined(t.withCredentials)||(m.withCredentials=!!t.withCredentials),t.responseType)try{m.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&m.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&m.upload&&m.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){m&&(m.abort(),l(t),m=null)})),void 0===f&&(f=null),m.send(f)}))}},u1Bl:function(t,e,n){var r,o,i;o=[n("EVdn"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){var e=/ui-corner-([a-z]){2,6}/g;return t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,n=[];t.each(this.options.items,(function(r,o){var i,a={};if(o)return"controlgroupLabel"===r?((i=e.element.find(o)).each((function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")})),e._addClass(i,null,"ui-widget ui-widget-content ui-state-default"),void(n=n.concat(i.get()))):void(t.fn[r]&&(a=e["_"+r+"Options"]?e["_"+r+"Options"]("middle"):{classes:{}},e.element.find(o).each((function(){var o=t(this),i=o[r]("instance"),u=t.widget.extend({},a);if("button"!==r||!o.parent(".ui-spinner").length){i||(i=o[r]()[r]("instance")),i&&(u.classes=e._resolveClassesValues(u.classes,i)),o[r](u);var s=o[r]("widget");t.data(s[0],"ui-controlgroup-data",i||o[r]("instance")),n.push(s[0])}}))))})),this.childWidgets=t(t.unique(n)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each((function(){var n=t(this).data("ui-controlgroup-data");n&&n[e]&&n[e]()}))},_updateCornerClass:function(t,e){var n=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,n)},_buildSimpleOptions:function(t,e){var n="vertical"===this.options.direction,r={classes:{}};return r.classes[e]={middle:"",first:"ui-corner-"+(n?"top":"left"),last:"ui-corner-"+(n?"bottom":"right"),only:"ui-corner-all"}[t],r},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:!!e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(n,r){var o={};return t.each(n,(function(i){var a=r.options.classes[i]||"";a=t.trim(a.replace(e,"")),o[i]=(a+" "+n[i]).replace(/\s+/g," ")})),o},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var e,n=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],(function(t,r){var o=e[r]().data("ui-controlgroup-data");if(o&&n["_"+o.widgetName+"Options"]){var i=n["_"+o.widgetName+"Options"](1===e.length?"only":r);i.classes=n._resolveClassesValues(i.classes,o),o.element[o.widgetName](i)}else n._updateCornerClass(e[r](),r)})),this._callChildMethod("refresh"))}})})?r.apply(e,o):r)||(t.exports=i)},vBzC:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}})?r.apply(e,o):r)||(t.exports=i)},vDqi:function(t,e,n){t.exports=n("zuR4")},vFQT:function(t,e,n){n("fE+E")},"vn/0":function(t,e){!function(t){"use strict";var e,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.util.VK"),o=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},i=function(t){return function(e){return typeof e===t}},a=o("string"),u=o("array"),s=(e=null,function(t){return e===t}),c=i("boolean"),l=i("function"),f=function(t){var e=t.getParam("link_assume_external_targets",!1);return c(e)&&e?1:!a(e)||"http"!==e&&"https"!==e?0:e},d=function(t){return t.getParam("default_link_target")},m=function(t){return t.getParam("target_list",!0)},h=function(t){return t.getParam("rel_list",[],"array")},p=function(t){return t.getParam("link_title",!0,"boolean")},g=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},v=function(t){return t.getParam("link_default_protocol","http","string")},b=function(){},y=function(t){return function(){return t}},x=y(!1),w=y(!0),C=function(){return _},_=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:x,isSome:x,isNone:w,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:y(null),getOrUndefined:y(void 0),or:n,orThunk:e,map:C,each:b,bind:C,exists:x,forall:w,filter:C,equals:t,equals_:t,toArray:function(){return[]},toString:y("none()")}}(),k=function(t){var e=y(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:w,isNone:x,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return k(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:_},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(x,(function(e){return n(t,e)}))}};return o},S={some:k,none:C,from:function(t){return null==t?_:k(t)}},T=Array.prototype.indexOf,D=Array.prototype.push,O=function(t,e){return function(t,e){return T.call(t,e)}(t,e)>-1},E=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!u(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);D.apply(e,t[n])}return e},N=function(t,e){return E(function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t,e))},A=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return S.none()},R=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},B=tinymce.util.Tools.resolve("tinymce.util.Tools"),P=function(t){return a(t.value)?t.value:""},I=function(t){return void 0===t&&(t=P),function(e){return S.from(e).map((function(e){return function(t,e){var n=[];return B.each(t,(function(t){var r=a(t.text)?t.text:a(t.title)?t.title:"";if(void 0!==t.menu);else{var o=e(t);n.push({text:r,value:o})}})),n}(e,t)}))}},M={sanitize:function(t){return I(P)(t)},sanitizeWith:I,createUi:function(t,e){return function(n){return{name:t,type:"selectbox",label:e,items:n}}},getValue:P},L=function(){return(L=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},F=Object.keys,H=function(t,e,n,r){return function(t,e){for(var n=F(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},j=function(t){return!(!/(^|[ ,])rtc([, ]|$)/.test(t.getParam("plugins","","string"))||!n.get("rtc"))},V=function(t){return/^\w+:/i.test(t)},z=function(t){var e=t.getAttribute("data-mce-href");return e||t.getAttribute("href")},U=function(t,e){var n=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter((function(t){return-1===B.inArray(n,t)}))},i=e?function(t){return(t=o(t)).length>0?t.concat(n):n}(r):o(r);return i.length>0?function(t){return B.trim(t.sort().join(" "))}(i):""},W=function(t,e){return e=e||t.selection.getNode(),K(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},q=function(t,e){return function(t){return t.replace(/\uFEFF/g,"")}(e?e.innerText||e.textContent:t.getContent({format:"text"}))},$=function(t){return t&&"A"===t.nodeName&&!!z(t)},Y=function(t){return B.grep(t,$).length>0},G=function(t){return!(/</.test(t)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(t)||-1===t.indexOf("href=")))},K=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},X=function(t,e){var n=L({},e);if(!(h(t).length>0)&&!1===g(t)){var r=U(n.rel,"_blank"===n.target);n.rel=r||null}return S.from(n.target).isNone()&&!1===m(t)&&(n.target=d(t)),n.href=function(t,e){return"http"!==e&&"https"!==e||V(t)?t:e+"://"+t}(n.href,f(t)),n},J=function(t,e,n){var r=t.selection.getNode(),o=W(t,r),i=X(t,function(t){return function(t,e,n){return function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}}(t,(function(t){n=e(n,t)})),n}(["title","rel","class","target"],(function(e,n){return t[n].each((function(t){e[n]=t.length>0?t:null})),e}),{href:t.href})}(n));t.undoManager.transact((function(){n.href===e.href&&e.attach(),o?(t.focus(),function(t,e,n,r){n.each((function(t){e.hasOwnProperty("innerText")?e.innerText=t:e.textContent=t})),t.dom.setAttribs(e,r),t.selection.select(e)}(t,o,n.text,i)):function(t,e,n,r){K(e)?nt(t,e,r):n.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))}))}(t,r,n.text,i)}))},Q=function(t){var e=t.class,n=t.href,r=t.rel,o=t.target,i=t.text,a=t.title;return function(t,e){var n,r={};return H(t,e,(n=r,function(t,e){n[e]=t}),b),r}({class:e.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:a.getOrNull()},(function(t,e){return!1===s(t)}))},Z=function(t,e,n){j(t)?t.execCommand("createlink",!1,Q(n)):J(t,e,n)},tt=function(t){j(t)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var e=t.selection.getNode();if(K(e))et(t,e);else{var n=t.dom.getParent(e,"a[href]",t.getBody());n&&t.dom.remove(n,!0)}t.focus()}))}(t)},et=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},nt=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},rt=function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?function(t,e){return A(e,(function(e){return S.some(e).filter((function(e){return e.value===t}))}))}(o,n).map((function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:b}},text:i?t:e.text}})):S.none()},ot=function(t,e){var n,r,o=(n=t.text,r=n,{get:function(){return r},set:function(t){r=t}}),i=function(t,n){var r,i,a=(r=e,i=n.name,"link"===i?r.catalogs.link:"anchor"===i?r.catalogs.anchor:S.none()).getOr([]);return rt(o.get(),n.name,a,t)};return{onChange:function(t,e){return"url"===e.name?function(t){if(o.get().length<=0){var e=void 0!==t.url.meta.text?t.url.meta.text:t.url.value,n=void 0!==t.url.meta.title?t.url.meta.title:"";return S.some({text:e,title:n})}return S.none()}(t()):O(["anchor","link"],e.name)?i(t(),e):"text"===e.name?(o.set(t().text),S.none()):S.none()}}},it=tinymce.util.Tools.resolve("tinymce.util.Delay"),at=tinymce.util.Tools.resolve("tinymce.util.Promise"),ut=function(t){var e=t.href;return e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:")?S.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return L(L({},t),{href:"mailto:"+e})}}):S.none()},st=function(t,e){return function(n){var r=n.href;return 1===t&&!V(r)||0===t&&/^\s*www[\.|\d\.]/i.test(r)?S.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+e+":// prefix?",preprocess:function(t){return L(L({},t),{href:e+"://"+r})}}):S.none()}},ct=function(t,e){return A([ut,st(f(t),v(t))],(function(t){return t(e)})).fold((function(){return at.resolve(e)}),(function(n){return new at((function(r){!function(t,e,n){var r=t.selection.getRng();it.setEditorTimeout(t,(function(){t.windowManager.confirm(e,(function(e){t.selection.setRng(r),n(e)}))}))}(t,n.message,(function(t){r(t?n.preprocess(e):e)}))}))}))},lt=function(t){var e=t.dom.select("a:not([href])"),n=N(e,(function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]}));return n.length>0?S.some([{text:"None",value:""}].concat(n)):S.none()},ft=function(t){var e=function(t){return t.getParam("link_class_list",[],"array")}(t);return e.length>0?M.sanitize(e):S.none()},dt=tinymce.util.Tools.resolve("tinymce.util.XHR"),mt=function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=function(t){return t.getParam("link_list")}(t);return new at((function(t){a(n)?dt.send({url:n,success:function(e){return t(function(t){try{return S.some(JSON.parse(t))}catch(t){return S.none()}}(e))},error:function(e){return t(S.none())}}):l(n)?n((function(e){return t(S.some(e))})):t(S.from(n))})).then((function(t){return t.bind(M.sanitizeWith(e)).map((function(t){return t.length>0?[{text:"None",value:""}].concat(t):t}))}))},ht=function(t,e){var n=h(t);if(n.length>0){var r=e.is("_blank");return(!1===g(t)?M.sanitizeWith((function(t){return U(M.getValue(t),r)})):M.sanitize)(n)}return S.none()},pt=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],gt=function(t){var e=m(t);return u(e)?M.sanitize(e).orThunk((function(){return S.some(pt)})):!1===e?S.none():S.some(pt)},vt=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?S.some(r):S.none()},bt=function(t,e){return mt(t).then((function(n){var r=function(t,e){var n=t.dom,r=G(t.selection.getContent())?S.some(q(t.selection,e)):S.none(),o=e?S.some(n.getAttrib(e,"href")):S.none(),i=e?S.from(n.getAttrib(e,"target")):S.none(),a=vt(n,e,"rel"),u=vt(n,e,"class");return{url:o,text:r,title:vt(n,e,"title"),target:i,rel:a,linkClass:u}}(t,e);return{anchor:r,catalogs:{targets:gt(t),rels:ht(t,r.target),classes:ft(t),anchor:lt(t),link:n},optNode:S.from(e),flags:{titleEnabled:p(t)}}}))},yt=function(t){(function(t){var e=W(t);return bt(t,e)})(t).then((function(e){var n=function(t,e){return function(n){var r=n.getData();if(!r.url.value)return tt(t),void n.close();var o=function(t){return S.from(r[t]).filter((function(n){return!e.anchor[t].is(n)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},a={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:function(){}};ct(t,i).then((function(e){Z(t,a,e)})),n.close()}}(t,e);return function(t,e,n){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,e){return{url:{value:t.anchor.url.getOr(""),meta:{attach:function(){},text:t.anchor.url.fold((function(){return""}),(function(){return t.anchor.text.getOr("")})),original:{value:t.anchor.url.getOr("")}}},text:t.anchor.text.getOr(""),title:t.anchor.title.getOr(""),anchor:t.anchor.url.getOr(""),link:t.anchor.url.getOr(""),rel:t.anchor.rel.getOr(""),target:t.anchor.target.or(e).getOr(""),linkClass:t.anchor.linkClass.getOr("")}}(t,S.from(d(n))),a=ot(i,t),u=t.catalogs;return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:E([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,R([u.anchor.map(M.createUi("anchor","Anchors")),u.rels.map(M.createUi("rel","Rel")),u.targets.map(M.createUi("target","Open link in...")),u.link.map(M.createUi("link","Link list")),u.classes.map(M.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,e){var n=e.name;a.onChange(t.getData,{name:n}).each((function(e){t.setData(e)}))},onSubmit:e}}(e,n,t)})).then((function(e){t.windowManager.open(e)}))},xt=function(e){var n=t.document.createElement("a");n.target="_blank",n.href=e,n.rel="noreferrer noopener";var r=t.document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,t.window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(e,n){t.document.body.appendChild(e),e.dispatchEvent(n),t.document.body.removeChild(e)}(n,r)},wt=function(t,e){return t.dom.getParent(e,"a[href]")},Ct=function(t){return wt(t,t.selection.getStart())},_t=function(t,e){if(e){var n=z(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else xt(e.href)}},kt=function(t){return function(){yt(t)}},St=function(t){return function(){_t(t,Ct(t))}},Tt=function(t){return function(e){var n=function(n){return e.setActive(!t.mode.isReadOnly()&&!!W(t,n.element))};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}},Dt=function(t){return function(e){var n=t.dom.getParents(t.selection.getStart());e.setDisabled(!Y(n));var r=function(t){return e.setDisabled(!Y(t.parents))};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}};n.add("link",(function(t){!function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:kt(t),onSetup:Tt(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:St(t),onSetup:Dt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return tt(t)},onSetup:Dt(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:St(t),onSetup:Dt(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:kt(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return tt(t)},onSetup:Dt(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(e){return Y(t.dom.getParents(e,"a"))?"link unlink openlink":"link"}})}(t),function(t){var e=function(e){var n=t.selection.getNode();return e.setDisabled(!W(t,n)),function(){}};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Tt(t)},label:"Link",predicate:function(e){return!!W(t,e)&&function(t){return t.getParam("link_context_toolbar",!1,"boolean")}(t)},initValue:function(){var e=W(t);return e?z(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!W(t,n)),Tt(t)(e)},onAction:function(e){var n=W(t),r=e.getValue();if(n)t.undoManager.transact((function(){t.dom.setAttrib(n,"href",r),function(t){t.selection.collapse(!1)}(t),e.hide()}));else{var o={href:r,attach:function(){}},i=G(t.selection.getContent())?S.some(q(t.selection,n)).filter((function(t){return t.length>0})).or(S.from(r)):S.none();Z(t,o,{href:r,text:i,title:S.none(),rel:S.none(),target:S.none(),class:S.none()}),e.hide()}}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:e,onAction:function(e){tt(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:e,onAction:function(e){St(t)(),e.hide()}}]})}(t),function(t){t.on("click",(function(e){var n=wt(t,e.target);n&&r.metaKeyPressed(e)&&(e.preventDefault(),_t(t,n))})),t.on("keydown",(function(e){var n=Ct(t);n&&13===e.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(e)&&(e.preventDefault(),_t(t,n))}))}(t),function(t){t.addCommand("mceLink",(function(){!function(t){return t.getParam("link_quicklink",!1,"boolean")}(t)?kt(t)():t.fire("contexttoolbar-show",{toolbarKey:"quicklink"})}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}(window)},w0Vi:function(t,e,n){"use strict";var r=n("xTJ+"),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,a={};return t?(r.forEach(t.split("\n"),(function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(a[e]&&o.indexOf(e)>=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}})),a):a}},wCe6:function(t,e,n){var r,o,i;o=[n("EVdn"),n("vBzC"),n("Jchv"),n("yw1R"),n("y6ec"),n("Qwlt"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){return t.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var n=t(e.target),r=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&n.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),n.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&r.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var n=t(e.target).closest(".ui-menu-item"),r=t(e.currentTarget);n[0]===r[0]&&(this._removeClass(r.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,r))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var n=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,n)},blur:function(e){this._delay((function(){!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]))&&this.collapseAll(e)}))},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),e.children().each((function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()}))},_keydown:function(e){var n,r,o,i,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,r=this.previousFilter||"",i=!1,o=e.keyCode>=96&&e.keyCode<=105?(e.keyCode-96).toString():String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),o===r?i=!0:o=r+o,n=this._filterMenuItems(o),(n=i&&-1!==n.index(this.active.next())?this.active.nextAll(".ui-menu-item"):n).length||(o=String.fromCharCode(e.keyCode),n=this._filterMenuItems(o)),n.length?(this.focus(e,n),this.previousFilter=o,this.filterTimer=this._delay((function(){delete this.previousFilter}),1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,n,r,o,i=this,a=this.options.icons.submenu,u=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),n=u.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each((function(){var e=t(this),n=e.prev(),r=t("<span>").data("ui-menu-submenu-caret",!0);i._addClass(r,"ui-menu-icon","ui-icon "+a),n.attr("aria-haspopup","true").prepend(r),e.attr("aria-labelledby",n.attr("id"))})),this._addClass(n,"ui-menu","ui-widget ui-widget-content ui-front"),(e=u.add(this.element).find(this.options.items)).not(".ui-menu-item").each((function(){var e=t(this);i._isDivider(e)&&i._addClass(e,"ui-menu-divider","ui-widget-content")})),o=(r=e.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(r,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),e.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var n=this.element.find(".ui-menu-icon");this._removeClass(n,null,this.options.icons.submenu)._addClass(n,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var n,r,o;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),r=this.active.children(".ui-menu-item-wrapper"),this._addClass(r,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),o=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(o,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay((function(){this._close()}),this.delay),(n=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(n),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var n,r,o,i,a,u;this._hasScroll()&&(n=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,o=e.offset().top-this.activeMenu.offset().top-n-r,i=this.activeMenu.scrollTop(),a=this.activeMenu.height(),u=e.outerHeight(),o<0?this.activeMenu.scrollTop(i+o):o+u>a&&this.activeMenu.scrollTop(i+o-a+u))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay((function(){this._close(),this._open(t)}),this.delay))},_open:function(e){var n=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(e,n){clearTimeout(this.timer),this.timer=this._delay((function(){var r=n?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(e),this._removeClass(r.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=r}),this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay((function(){this.focus(t,e)})))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,n){var r;this.active&&(r="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),r&&r.length&&this.active||(r=this.activeMenu.find(this.options.items)[e]()),this.focus(n,r)},nextPage:function(e){var n,r,o;this.active?this.isLastItem()||(this._hasScroll()?(r=this.active.offset().top,o=this.element.height(),this.active.nextAll(".ui-menu-item").each((function(){return(n=t(this)).offset().top-r-o<0})),this.focus(e,n)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())):this.next(e)},previousPage:function(e){var n,r,o;this.active?this.isFirstItem()||(this._hasScroll()?(r=this.active.offset().top,o=this.element.height(),this.active.prevAll(".ui-menu-item").each((function(){return(n=t(this)).offset().top-r+o>0})),this.focus(e,n)):this.focus(e,this.activeMenu.find(this.options.items).first())):this.next(e)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,n)},_filterMenuItems:function(e){var n=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),r=new RegExp("^"+n,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter((function(){return r.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))}))}})})?r.apply(e,o):r)||(t.exports=i)},xAGQ:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=function(t,e,n){return r.forEach(n,(function(n){t=n(t,e)})),t}},"xTJ+":function(t,e,n){"use strict";var r=n("HSsa"),o=Object.prototype.toString;function i(t){return"[object Array]"===o.call(t)}function a(t){return void 0===t}function u(t){return null!==t&&"object"==typeof t}function s(t){return"[object Function]"===o.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),i(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:i,isArrayBuffer:function(t){return"[object ArrayBuffer]"===o.call(t)},isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:u,isUndefined:a,isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:s,isStream:function(t){return u(t)&&s(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]="object"==typeof n?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,(function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},y6ec:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.fn.extend({uniqueId:(e=0,function(){return this.each((function(){this.id||(this.id="ui-id-"+ ++e)}))}),removeUniqueId:function(){return this.each((function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")}))}});var e})?r.apply(e,o):r)||(t.exports=i)},yK9s:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},yLpj:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},yw1R:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(n){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e}})?r.apply(e,o):r)||(t.exports=i)},zuR4:function(t,e,n){"use strict";var r=n("xTJ+"),o=n("HSsa"),i=n("CgaS"),a=n("SntB");function u(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var s=u(n("JEQr"));s.Axios=i,s.create=function(t){return u(a(s.defaults,t))},s.Cancel=n("endd"),s.CancelToken=n("jfS+"),s.isCancel=n("Lmem"),s.all=function(t){return Promise.all(t)},s.spread=n("DfZB"),t.exports=s,t.exports.default=s}}]);