/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.5.1 (2020-10-01) */ !function(){"use strict";var $=function(){},i=function(e,o){return function(){for(var t=[],n=0;n "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"}}},fn=function(r){return{extract:function(e,o,t){var n=V(t,function(t,n){return r.extract(e.concat(["["+n+"]"]),o,t)});return tn(n)},toString:function(){return"array("+r.toString()+")"}}},dn=function(a){return{extract:function(t,n,e){for(var o=[],r=0,i=a;r ")+")\n"+t.getErrorInfo()}).join("\n"))+"\n\nInput object: "+nn(t.input);var n,e},Bn=yn,Dn=function(t,n){return yn(t,_t(n,ln))},An=at(xn),Mn=function(e,o){return cn(function(t){var n=typeof t;return e(t)?ht(t):bt("Expected type: "+o+" but got: "+n)})},Fn=Mn(et,"number"),In=Mn(S,"string"),Rn=Mn(C,"boolean"),Vn=Mn(_,"function"),Pn=function(n){var t=function(t,n){for(var e=t.next();!e.done;){if(!n(e.value))return!1;e=t.next()}return!0};if(Object(n)!==n)return!0;switch({}.toString.call(n).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(n).every(function(t){return Pn(n[t])});case"Map":return t(n.keys(),Pn)&&t(n.values(),Pn);case"Set":return t(n.keys(),Pn);default:return!1}},Hn=cn(function(t){return Pn(t)?ht(t):bt("Expected value to be acceptable for sending via postMessage")}),zn=function(n){return kn(function(t){return M(n,t)?it.value(t):it.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})},Nn=function(t){return vn(t,t,Ut(),gn())},Ln=function(t,n){return vn(t,t,Ut(),n)},jn=function(t){return Ln(t,In)},Un=function(t,n){return vn(t,t,Ut(),zn(n))},Wn=function(t){return Ln(t,Vn)},Gn=function(t,n){return vn(t,t,Ut(),ln(n))},Xn=function(t,n){return vn(t,t,Ut(),pn(n))},Yn=function(t,n){return vn(t,t,Ut(),fn(n))},qn=function(t){return vn(t,t,Wt(),gn())},Kn=function(t,n){return vn(t,t,Wt(),n)},Jn=function(t){return Kn(t,Fn)},$n=function(t){return Kn(t,In)},Qn=function(t){return Kn(t,Vn)},Zn=function(t,n){return Kn(t,ln(n))},te=function(t,n){return vn(t,t,jt(n),gn())},ne=function(t,n,e){return vn(t,t,jt(n),e)},ee=function(t,n){return ne(t,n,Fn)},oe=function(t,n){return ne(t,n,In)},re=function(t,n,e){return ne(t,n,zn(e))},ie=function(t,n){return ne(t,n,Rn)},ue=function(t,n){return ne(t,n,Vn)},ae=function(t,n,e){return ne(t,n,ln(e))},ce=function(t,n){return hn(t,n)},se=function(t){var n=t;return{get:function(){return n},set:function(t){n=t}}},le=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:t}},fe={fromHtml:function(t,n){var e=(n||document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1=o.length&&e.substr(r,r+o.length)===o?t.substring(0,t.length-"/*".length):t;var n,e,o,r})},ri=function(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:oi(i)}},t},ii=Xr("alloy-premade"),ui=function(t){return Kt(ii,t)},ai=function(o){return t=function(t){for(var n=[],e=1;e "):o[0].name;return Kt(r,{handler:n,purpose:e})})});return $t(n,{})},yi="alloy.base.behaviour",xi=function(t){var n,e;return On("custom.definition",ln([vn("dom","dom",Ut(),ln([Nn("tag"),te("styles",{}),te("classes",[]),te("attributes",{}),qn("value"),qn("innerHtml")])),Nn("components"),Nn("uid"),te("events",{}),te("apis",{}),vn("eventOrder","eventOrder",((n={})[ko()]=["disabling",yi,"toggling","typeaheadevents"],n[yo()]=[yi,"focusing","keying"],n[Bo()]=[yi,"disabling","toggling","representing"],n[fo()]=[yi,"representing","streaming","invalidating"],n[Ro()]=[yi,"representing","item-events","tooltipping"],n[eo()]=["focusing",yi,"item-type-events"],n[Qe()]=["focusing",yi,"item-type-events"],n[uo()]=["item-type-events","tooltipping"],n[So()]=["receiving","reflecting","tooltipping"],e=n,Lt.mergeWithThunk(at(e))),An()),qn("domModification")]),t)},wi=function(t,n){var e=Pr(t,n);return e===undefined||""===e?[]:e.split(" ")},Si=function(t){return t.dom.classList!==undefined},ki=function(t,n){return r=n,i=wi(e=t,o="class").concat([r]),Vr(e,o,i.join(" ")),!0;var e,o,r,i},Ci=function(t,n){return r=n,0<(i=H(wi(e=t,o="class"),function(t){return t!==r})).length?Vr(e,o,i.join(" ")):Nr(e,o),!1;var e,o,r,i},Oi=function(t,n){Si(t)?t.dom.classList.add(n):ki(t,n)},_i=function(t){0===(Si(t)?t.dom.classList:wi(t,"class")).length&&Nr(t,"class")},Ti=function(t,n){Si(t)?t.dom.classList.remove(n):Ci(t,n),_i(t)},Ei=function(t,n){return Si(t)&&t.dom.classList.contains(n)},Bi=function(n,t){ot(t,function(t){Oi(n,t)})},Di=function(n,t){ot(t,function(t){Ti(n,t)})},Ai=function(t){return t.style!==undefined&&_(t.style.getPropertyValue)},Mi=function(t){return pr(t)},Fi=_(Element.prototype.attachShadow)&&_(Node.prototype.getRootNode),Ii=at(Fi),Ri=Fi?function(t){return fe.fromDom(t.dom.getRootNode())}:vr,Vi=function(t){return Mi(t)?t:fe.fromDom(vr(t).dom.body)},Pi=function(t){return fe.fromDom(t.dom.host)},Hi=function(t){return O(t.dom.shadowRoot)},zi=function(t){var n=mr(t)?t.dom.parentNode:t.dom;if(n===undefined||null===n||null===n.ownerDocument)return!1;var e,o,r,i,u=n.ownerDocument;return r=fe.fromDom(n),i=Ri(r),(Mi(i)?st.some(i):st.none()).fold(function(){return u.body.contains(n)},(e=zi,o=Pi,function(t){return e(o(t))}))},Ni=function(){return Li(fe.fromDom(document))},Li=function(t){var n=t.dom.body;if(null===n||n===undefined)throw new Error("Body is not available yet");return fe.fromDom(n)},ji=function(t,n,e){if(!S(e))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);Ai(t)&&t.style.setProperty(n,e)},Ui=function(t,n){Ai(t)&&t.style.removeProperty(n)},Wi=function(t,n,e){var o=t.dom;ji(o,n,e)},Gi=function(t,n){var e=t.dom;Ot(n,function(t,n){ji(e,n,t)})},Xi=function(t,n){var e=t.dom;Ot(n,function(t,n){t.fold(function(){Ui(e,n)},function(t){ji(e,n,t)})})},Yi=function(t,n){var e=t.dom,o=window.getComputedStyle(e).getPropertyValue(n);return""!==o||zi(t)?o:qi(e,n)},qi=function(t,n){return Ai(t)?t.style.getPropertyValue(n):""},Ki=function(t,n){var e=t.dom,o=qi(e,n);return st.from(o).filter(function(t){return 0"}),An()),ef=ce("schema",function(){return[qn("preprocess")]}),of=te("defaults",at({})),rf=te("overrides",at({})),uf=ln([Ql,Zl,tf,nf,of,rf]),af=ln([Ql,Zl,tf,of,rf]),cf=ln([Ql,Zl,tf,nf,of,rf]),sf=ln([Ql,ef,tf,Nn("unit"),nf,of,rf]),lf=function(t){return t.fold(st.some,st.none,st.some,st.some)},ff=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},df=function(e,o){return function(t){var n=Tn("Converting part type",o,t);return e(n)}},mf=df($l.required,uf),gf=df($l.external,af),pf=df($l.optional,cf),hf=df($l.group,sf),vf=at("entirety"),bf=/* */Object.freeze({__proto__:null,required:mf,external:gf,optional:pf,group:hf,asNamedPart:lf,name:ff,asCommon:function(t){return t.fold(ct,ct,ct,ct)},original:vf}),yf=function(t,n,e,o){return Ht(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},xf=function(r,t){var n={};return ot(t,function(t){lf(t).each(function(e){var o=wf(r,e.pname);n[e.name]=function(t){var n=Tn("Part: "+e.name+" in "+r,ln(e.schema),t);return nt(nt({},o),{config:t,validated:n})}})}),n},wf=function(t,n){return{uiType:Jl(),owner:t,name:n}},Sf=function(t,n,e){return{uiType:Jl(),owner:t,name:n,config:e,validated:{}}},kf=function(t){return U(t,function(t){return t.fold(st.none,st.some,st.none,st.none).map(function(t){return Gn(t.name,t.schema.concat([pa(vf())]))}).toArray()})},Cf=function(t){return V(t,ff)},Of=function(t,n,e){return o=n,i={},r={},ot(e,function(t){t.fold(function(o){i[o.pname]=ql(!0,function(t,n,e){return o.factory.sketch(yf(t,o,n,e))})},function(t){var n=o.parts[t.name];r[t.name]=at(t.factory.sketch(yf(o,t,n[vf()]),n))},function(o){i[o.pname]=ql(!1,function(t,n,e){return o.factory.sketch(yf(t,o,n,e))})},function(r){i[r.pname]=Kl(!0,function(n,t,e){var o=n[r.name];return V(o,function(t){return r.factory.sketch(Ht(r.defaults(n,t,e),t,r.overrides(n,t)))})})})}),{internals:at(i),externals:at(r)};var o,i,r},_f=function(t,n,e){return Yl(st.some(t),n,n.components,e)},Tf=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOptional()},Ef=function(t,n,e){return Tf(t,n,e).getOrDie("Could not find part: "+e)},Bf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return ot(e,function(t){o[t]=at(i.getByUid(r[t]))}),o},Df=function(t,n){var e=t.getSystem();return _t(n.partUids,function(t,n){return at(e.getByUid(t))})},Af=function(t){return kt(t.partUids)},Mf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return ot(e,function(t){o[t]=at(i.getByUid(r[t]).getOrDie())}),o},Ff=function(n,t){var e=Cf(t);return Jt(V(e,function(t){return{key:t,value:n+"-"+t}}))},If=function(n){return vn("partUids","partUids",Xt(function(t){return Ff(t.uid,n)}),An())},Rf=/* */Object.freeze({__proto__:null,generate:xf,generateOne:Sf,schemas:kf,names:Cf,substitutes:Of,components:_f,defaultUids:Ff,defaultUidsSchema:If,getAllParts:Df,getAllPartNames:Af,getPart:Tf,getPartOrDie:Ef,getParts:Bf,getPartsOrDie:Mf}),Vf=function(t,n,e,o,r){var i,u,a=(u=r,(0<(i=o).length?[Gn("parts",i)]:[]).concat([Nn("uid"),te("dom",{}),te("components",[]),pa("originalSpec"),te("debug.sketcher",{})]).concat(u));return Tn(t+" [SpecSchema]",sn(a.concat(n)),e)},Pf=function(t,n,e,o,r){var i=Hf(r),u=kf(e),a=If(e),c=Vf(t,n,i,u,[a]),s=Of(0,c,e);return o(c,_f(t,c,s.internals()),i,s.externals())},Hf=function(t){return Ft(t,"uid")?t:nt(nt({},t),{uid:Zr("uid")})};var zf,Nf,Lf=sn([Nn("name"),Nn("factory"),Nn("configFields"),te("apis",{}),te("extraApis",{})]),jf=sn([Nn("name"),Nn("factory"),Nn("configFields"),Nn("partFields"),te("apis",{}),te("extraApis",{})]),Uf=function(t){var i=Tn("Sketcher for "+t.name,Lf,t),n=_t(i.apis,ai),e=_t(i.extraApis,ri);return nt(nt({name:i.name,configFields:i.configFields,sketch:function(t){return n=i.name,e=i.configFields,o=i.factory,r=Hf(t),o(Vf(n,e,r,[],[]),r);var n,e,o,r}},n),e)},Wf=function(t){var n=Tn("Sketcher for "+t.name,jf,t),e=xf(n.name,n.partFields),o=_t(n.apis,ai),r=_t(n.extraApis,ri);return nt(nt({name:n.name,partFields:n.partFields,configFields:n.configFields,sketch:function(t){return Pf(n.name,n.configFields,n.partFields,n.factory,t)},parts:e},o),r)},Gf=function(t){for(var n=[],e=function(t){n.push(t)},o=0;o',e.getDoc());return Er(t,fe.fromDom(n.extractContents())),n.insertNode(t.dom),xr(t).each(function(t){return t.dom.normalize()}),cs(t,as).map(function(t){var n;e.selection.setCursorLocation(t.dom,"img"===lr(n=t)?1:is(n).fold(function(){return kr(n).length},function(t){return t.length}))}),t})},wp=function(t){return Xu(t,"[data-mce-autocompleter]")},Sp=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},kp=function(t){return""!==t&&-1!==" \xa0\f\n\r\t\x0B".indexOf(t)},Cp=function(t,n){return t.substring(n.length)},Op=function(t,o,r,i){if(void 0===i&&(i=0),!(n=o).collapsed||3!==n.startContainer.nodeType)return st.none();var n,e=t.getParent(o.startContainer,t.isBlock)||t.getRoot();return yp(t,o.startContainer,o.startOffset,function(t,n,e){return function(t,n,e){for(var o=n-1;0<=o;o--){var r=t.charAt(o);if(kp(r))return st.none();if(r===e)break}return st.some(o)}(e,n,r).getOr(n)},e).bind(function(t){var n=o.cloneRange();if(n.setStart(t.container,t.offset),n.setEnd(o.endContainer,o.endOffset),n.collapsed)return st.none();var e=Sp(n);return 0!==e.lastIndexOf(r)||Cp(e,r).length=t.minChars&&t.matches.getOrThunk(function(){return Mp(n.dom)})(e.range,i,e.text)});if(0===u.length)return st.none();var a=Ep.all(V(u,function(n){return n.fetch(e.text,n.maxResults,o).then(function(t){return{matchText:e.text,items:t,columns:n.columns,onAction:n.onAction}})}));return st.some({lookupData:a,context:e})},Rp=ln([jn("type"),$n("text")]),Vp=ln([te("type","autocompleteitem"),te("active",!1),te("disabled",!1),te("meta",{}),jn("value"),$n("text"),$n("icon")]),Pp=ln([jn("type"),jn("ch"),ee("minChars",1),te("columns",1),ee("maxResults",10),Qn("matches"),Wn("fetch"),Wn("onAction")]),Hp=[ie("disabled",!1),$n("tooltip"),$n("icon"),$n("text"),ue("onSetup",function(){return $})],zp=ln([jn("type"),Wn("onAction")].concat(Hp)),Np=function(t){return On("toolbarbutton",zp,t)},Lp=[ie("active",!1)].concat(Hp),jp=ln(Lp.concat([jn("type"),Wn("onAction")])),Up=function(t){return On("ToggleButton",jp,t)},Wp=[ue("predicate",function(){return!1}),re("scope","node",["node","editor"]),re("position","selection",["node","selection","line"])],Gp=Hp.concat([te("type","contextformbutton"),te("primary",!1),Wn("onAction"),ce("original",ct)]),Xp=Lp.concat([te("type","contextformbutton"),te("primary",!1),Wn("onAction"),ce("original",ct)]),Yp=Hp.concat([te("type","contextformbutton")]),qp=Lp.concat([te("type","contextformtogglebutton")]),Kp=Dn("type",{contextformbutton:Gp,contextformtogglebutton:Xp}),Jp=ln([te("type","contextform"),ue("initValue",function(){return""}),$n("label"),Yn("commands",Kp),Kn("launch",Dn("type",{contextformbutton:Yp,contextformtogglebutton:qp}))].concat(Wp)),$p=ln([te("type","contexttoolbar"),jn("items")].concat(Wp)),Qp=function(t){var n,e,o=t.ui.registry.getAll().popups,r=_t(o,function(t){return On("Autocompleter",Pp,t).fold(function(t){throw new Error(En(t))},function(t){return t})}),i=(n=Bt(r,function(t){return t.ch}),e={},ot(n,function(t){e[t]={}}),kt(e)),u=At(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return H(u,function(t){return t.ch===n})}}};(hp=pp=pp||{})[hp.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",hp[hp.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var Zp,th,nh=pp,eh="tox-menu-nav__js",oh="tox-collection__item",rh="tox-swatch",ih={normal:eh,color:rh},uh="tox-collection__item--enabled",ah="tox-collection__item-label",ch="tox-collection__item-caret",sh="tox-collection__item--active",lh=function(t){return Mt(ih,t).getOr(eh)},fh=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:"color"===t?"tox-swatches":"tox-menu",tieredMenu:"tox-tiered-menu"}},dh=function(t){var n=fh(t);return{backgroundMenu:n.backgroundMenu,selectedMenu:n.selectedMenu,menu:n.menu,selectedItem:n.selectedItem,item:lh(t)}},mh=[jg.parts.items({})],gh=function(t,n,e){var o=fh(e);return{dom:{tag:"div",classes:rt([[o.tieredMenu]])},markers:dh(e)}},ph=function(e,o){return function(t){var n=R(t,o);return V(n,function(t){return{dom:e,components:t}})}},hh=function(t,e){var o=[],r=[];return ot(t,function(t,n){e(t,n)?(0o}).getOr(r.length);return st.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return st.none()},Bh=function(t,n){return nc([ag(t,n)])},Dh=function(t){return Bh(Xr("unnamed-events"),t)},Ah=[Nn("lazySink"),Nn("tooltipDom"),te("exclusive",!0),te("tooltipComponents",[]),te("delay",300),re("mode","normal",["normal","follow-highlight"]),te("anchor",function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:at([za,Ha,Ia,Va,Ra,Pa]),onRtl:at([za,Ha,Ia,Va,Ra,Pa])}}}),la("onHide"),la("onShow")],Mh=/* */Object.freeze({__proto__:null,init:function(){var e=se(st.none()),n=se(st.none()),o=function(){e.get().each(function(t){clearTimeout(t)})},t=at("not-implemented");return si({getTooltip:function(){return n.get()},isShowing:function(){return n.get().isSome()},setTooltip:function(t){n.set(st.some(t))},clearTooltip:function(){n.set(st.none())},clearTimer:o,resetTimer:function(t,n){o(),e.set(st.some(setTimeout(function(){t()},n)))},readState:t})}}),Fh=Xr("tooltip.exclusive"),Ih=Xr("tooltip.show"),Rh=Xr("tooltip.hide"),Vh=function(t,n,e){t.getSystem().broadcastOn([Fh],{})},Ph=/* */Object.freeze({__proto__:null,hideAllExclusive:Vh,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&ug.set(t,o)})}}),Hh=oc({fields:Ah,name:"tooltipping",active:/* */Object.freeze({__proto__:null,events:function(r,i){var e=function(n){i.getTooltip().each(function(t){el(t),r.onHide(n,t),i.clearTooltip()}),i.clearTimer()};return Jo(rt([[Zo(Ih,function(o){i.resetTimer(function(){var n,t,e;n=o,i.isShowing()||(Vh(n),t=r.lazySink(n).getOrDie(),e=n.getSystem().build({dom:r.tooltipDom,components:r.tooltipComponents,events:Jo("normal"===r.mode?[Zo(uo(),function(t){Wo(n,Ih)}),Zo(ro(),function(t){Wo(n,Rh)})]:[]),behaviours:nc([ug.config({})])}),i.setTooltip(e),Zs(t,e),r.onShow(n,e),qs.position(t,r.anchor(n),e))},r.delay)}),Zo(Rh,function(t){i.resetTimer(function(){e(t)},r.delay)}),Zo(So(),function(t,n){n.universal||M(n.channels,Fh)&&e(t)}),ar(function(t){e(t)})],"normal"===r.mode?[Zo(ao(),function(t){Wo(t,Ih)}),Zo(xo(),function(t){Wo(t,Rh)}),Zo(uo(),function(t){Wo(t,Ih)}),Zo(ro(),function(t){Wo(t,Rh)})]:[Zo(jo(),function(t,n){Wo(t,Ih)}),Zo(Uo(),function(t){Wo(t,Rh)})]]))}}),state:Mh,apis:Ph}),zh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Nh=tinymce.util.Tools.resolve("tinymce.util.I18n"),Lh=["input","button","textarea","select"],jh=function(t,n,e){(n.disabled()?qh:Kh)(t,n)},Uh=function(t,n){return!0===n.useNative&&M(Lh,lr(t.element))},Wh=function(t){Vr(t.element,"disabled","disabled")},Gh=function(t){Nr(t.element,"disabled")},Xh=function(t){Vr(t.element,"aria-disabled","true")},Yh=function(t){Vr(t.element,"aria-disabled","false")},qh=function(n,t,e){t.disableClass.each(function(t){Oi(n.element,t)}),(Uh(n,t)?Wh:Xh)(n),t.onDisabled(n)},Kh=function(n,t,e){t.disableClass.each(function(t){Ti(n.element,t)}),(Uh(n,t)?Gh:Yh)(n),t.onEnabled(n)},Jh=function(t,n){return Uh(t,n)?zr(t.element,"disabled"):"true"===Pr(t.element,"aria-disabled")},$h=/* */Object.freeze({__proto__:null,enable:Kh,disable:qh,isDisabled:Jh,onLoad:jh,set:function(t,n,e,o){(o?qh:Kh)(t,n)}}),Qh=/* */Object.freeze({__proto__:null,exhibit:function(t,n){return fi({classes:n.disabled()?n.disableClass.toArray():[]})},events:function(e,t){return Jo([$o(ko(),function(t,n){return Jh(t,e)}),Ja(e,t,jh)])}}),Zh=[ue("disabled",c),te("useNative",!0),qn("disableClass"),la("onDisabled"),la("onEnabled")],tv=oc({fields:Zh,name:"disabling",active:Qh,apis:$h}),nv=tinymce.util.Tools.resolve("tinymce.EditorManager"),ev=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},ov=function(t){return t.getParam("width",zh.DOM.getStyle(t.getElement(),"width"))},rv=function(t){return st.from(t.getParam("min_width")).filter(et)},iv=function(t){return st.from(t.getParam("min_height")).filter(et)},uv=function(t){return st.from(t.getParam("max_width")).filter(et)},av=function(t){return st.from(t.getParam("max_height")).filter(et)},cv=function(t){return!1!==t.getParam("menubar",!0,"boolean")},sv=function(t){var n=t.getParam("toolbar",!0),e=!0===n,o=S(n),r=h(n)&&0'+t+""})}return r},Kv=xf(Rg(),Vg()),Jv=function(t){return{value:t}},$v=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Qv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Zv=function(t){return $v.test(t)||Qv.test(t)},tb=function(t){var n={value:t.value.replace($v,function(t,n,e,o){return n+n+e+e+o+o})},e=Qv.exec(n.value);return null===e?["FFFFFF","FF","FF","FF"]:e},nb=function(t){var n=t.toString(16);return 1===n.length?"0"+n:n},eb=function(t){var n=nb(t.red)+nb(t.green)+nb(t.blue);return Jv(n)},ob=Math.min,rb=Math.max,ib=Math.round,ub=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,ab=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,cb=function(t,n,e,o){return{red:t,green:n,blue:e,alpha:o}},sb=function(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255},lb=function(t){var n,e,o,r=(t.hue||0)%360,i=t.saturation/100,u=t.value/100,i=rb(0,ob(i,1)),u=rb(0,ob(u,1));if(0===i)return n=e=o=ib(255*u),cb(n,e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:n=c,e=s,o=0;break;case 1:n=s,e=c,o=0;break;case 2:n=0,e=c,o=s;break;case 3:n=0,e=s,o=c;break;case 4:n=s,e=0,o=c;break;case 5:n=c,e=0,o=s;break;default:n=e=o=0}return n=ib(255*(n+l)),e=ib(255*(e+l)),o=ib(255*(o+l)),cb(n,e,o,1)},fb=function(t){var n=tb(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return cb(e,o,r,1)},db=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return cb(r,i,u,a)},mb=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},gb=cb(255,0,0,1),pb=function(t,n){return t.fire("ResizeContent",n)},hb=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),vb="tinymce-custom-colors";var bb="choiceitem",yb=[{type:bb,text:"Light Green",value:"#BFEDD2"},{type:bb,text:"Light Yellow",value:"#FBEEB8"},{type:bb,text:"Light Red",value:"#F8CAC6"},{type:bb,text:"Light Purple",value:"#ECCAFA"},{type:bb,text:"Light Blue",value:"#C2E0F4"},{type:bb,text:"Green",value:"#2DC26B"},{type:bb,text:"Yellow",value:"#F1C40F"},{type:bb,text:"Red",value:"#E03E2D"},{type:bb,text:"Purple",value:"#B96AD9"},{type:bb,text:"Blue",value:"#3598DB"},{type:bb,text:"Dark Turquoise",value:"#169179"},{type:bb,text:"Orange",value:"#E67E23"},{type:bb,text:"Dark Red",value:"#BA372A"},{type:bb,text:"Dark Purple",value:"#843FA1"},{type:bb,text:"Dark Blue",value:"#236FA1"},{type:bb,text:"Light Gray",value:"#ECF0F1"},{type:bb,text:"Medium Gray",value:"#CED4D9"},{type:bb,text:"Gray",value:"#95A5A6"},{type:bb,text:"Dark Gray",value:"#7E8C8D"},{type:bb,text:"Navy Blue",value:"#34495E"},{type:bb,text:"Black",value:"#000000"},{type:bb,text:"White",value:"#ffffff"}],xb=function(e){void 0===e&&(e=10);var t,n=hb.getItem(vb),o=S(n)?JSON.parse(n):[],r=e-(t=o).length<0?t.slice(0,e):t,i=function(t){r.splice(t,1)};return{add:function(t){var n;(-1===(n=A(r,t))?st.none():st.some(n)).each(i),r.unshift(t),r.length>e&&r.pop(),hb.setItem(vb,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),wb=function(t){return!1!==t.getParam("custom_colors")},Sb=function(t){var n=t.getParam("color_map");return n!==undefined?function(t){var n=[],u=document.createElement("canvas");u.height=1,u.width=1;for(var a=u.getContext("2d"),c=function(t,n){var e=n/255;return("0"+Math.round(t*e+255*(1-e)).toString(16)).slice(-2).toUpperCase()},e=0;e'+e+"":"",r='
'+t.icon+"
",i={_:" "," - ":" ","-":" "},u=e.replace(/\_| \- |\-/g,function(t){return i[t]});return'
'+r+o+"
"}),o="auto"!==a.columns&&1'+t.join("")+""});Ir(t.element,r.join(""))},u=r(function(t,n,e,o){n.stop(),c.isReadOnly()||Go(t,zy,{name:a.name,value:o})}),s=[Zo(uo(),r(function(t,n,e){sc(e)})),Zo(go(),u),Zo(Oo(),u),Zo(ao(),r(function(t,n,e){Gu(t.element,"."+sh).each(function(t){Ti(t,sh)}),Oi(e,sh)})),Zo(co(),r(function(t){Gu(t.element,"."+sh).each(function(t){Ti(t,sh)})})),sr(r(function(t,n,e,o){Go(t,zy,{name:a.name,value:o})}))],l=function(t,n){return V(ss(t.element,".tox-collection__item"),n)},f=Ey.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==a.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:ct},behaviours:nc([tv.config({disabled:c.isReadOnly,onDisabled:function(t){l(t,function(t){Oi(t,"tox-collection__item--state-disabled"),Vr(t,"aria-disabled",!0)})},onEnabled:function(t){l(t,function(t){Ti(t,"tox-collection__item--state-disabled"),Nr(t,"aria-disabled")})}}),_v(),ug.config({}),Vl.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){i(o,t),"auto"===a.columns&&Eh(o,5,"tox-collection__item").each(function(t){var n=t.numRows,e=t.numColumns;ng.setGridSize(o,n,e)}),Wo(o,Wy)}}),Ay.config({}),ng.config((n=a.columns,e="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"===e?".tox-swatches__row":".tox-collection__group",cell:"color"===e?"."+rh:"."+oh}})),ag("collection-events",s)]),eventOrder:((t={})[ko()]=["disabling","alloy.base.behaviour","collection-events"],t)});return My(o,f,["tox-form__group--collection"],[])},Xy=at([qn("data"),te("inputAttributes",{}),te("inputStyles",{}),te("tag","input"),te("inputClasses",[]),la("onSetValue"),te("styles",{}),te("eventOrder",{}),Pl("inputBehaviours",[Vl,dg]),te("selectOnFocus",!0)]),Yy=function(t){return nc([dg.config({onFocus:t.selectOnFocus?function(t){var n=t.element,e=Zi(n);n.dom.setSelectionRange(0,e.length)}:$})])},qy=function(t){return{tag:t.tag,attributes:nt({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Ky=Uf({name:"Input",configFields:Xy(),factory:function(t,n){return{uid:t.uid,dom:qy(t),components:[],behaviours:nt(nt({},Yy(e=t)),zl(e.inputBehaviours,[Vl.config({store:nt(nt({mode:"manual"},e.data.map(function(t){return{initialValue:t}}).getOr({})),{getValue:function(t){return Zi(t.element)},setValue:function(t,n){Zi(t.element)!==n&&tu(t.element,n)}}),onSetValue:e.onSetValue})])),eventOrder:t.eventOrder};var e}}),Jy={},$y={exports:Jy};xy=undefined,wy=Jy,Sy=$y,ky=undefined,function(t){"object"==typeof wy&&void 0!==Sy?Sy.exports=t():"function"==typeof xy&&xy.amd?xy([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function l(i,u,a){function c(n,t){if(!u[n]){if(!i[n]){var e="function"==typeof ky&&ky;if(!t&&e)return e(n,!0);if(s)return s(n,!0);var o=new Error("Cannot find module '"+n+"'");throw o.code="MODULE_NOT_FOUND",o}var r=u[n]={exports:{}};i[n][0].call(r.exports,function(t){return c(i[n][1][t]||t)},r,r.exports,l,i,u,a)}return u[n].exports}for(var s="function"==typeof ky&&ky,t=0;t"},TS=function(o,t){return{uid:o.uid,dom:o.dom,components:t,behaviours:zl(o.formBehaviours,[Vl.config({store:{mode:"manual",getValue:function(t){var n=Df(t,o);return _t(n,function(t,r){return t().bind(function(t){var n,e,o=Kf.getCurrent(t);return n=o,e=new Error("Cannot find a current component to extract the value from for form part '"+r+"': "+jr(t.element)),n.fold(function(){return it.error(e)},it.value)}).map(Vl.getValue)})},setValue:function(e,t){Ot(t,function(n,t){Tf(e,o,t).each(function(t){Kf.getCurrent(t).each(function(t){Vl.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return Tf(t,o,n).bind(Kf.getCurrent)}}}},ES={getField:ai(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n=(e=[],{field:function(t,n){return e.push(t),Sf("form",_S(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=V(r,function(t){return mf({name:t,pname:_S(t)})});return Pf("form",OS,i,TS,o)}},BS=Xr("valid-input"),DS=Xr("invalid-input"),AS=Xr("validating-input"),MS="colorcustom.rgb.",FS=function(d,m,g,p){var h=function(t,n,e,o,r){var i,u,a=d(MS+"range"),c=[Ey.parts.label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),Ey.parts.field({data:r,factory:Ky,inputAttributes:nt({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:nc([(i=n,u=t,hx.config({invalidClass:m("invalid"),notify:{onValidate:function(t){Go(t,AS,{type:i})},onValid:function(t){Go(t,BS,{type:i,value:Vl.getValue(t)})},onInvalid:function(t){Go(t,DS,{type:i,value:Vl.getValue(t)})}},validator:{validate:function(t){var n=Vl.getValue(t),e=u(n)?it.value(!0):it.error(d("aria.input.invalid"));return ux(e)},validateOnLoad:!1}})),Ay.config({})]),onSetValue:function(t){hx.isInvalid(t)&&hx.run(t).get($)}})],s="hex"!==n?[Ey.parts["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}},v=function(t,n){var e=n.red,o=n.green,r=n.blue;Vl.setValue(t,{red:e,green:o,blue:r})},b=sp({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),y=function(t,n){b.getOpt(t).each(function(t){Wi(t.element,"background-color","#"+n.value)})};return Uf({factory:function(){var e={red:se(st.some(255)),green:se(st.some(255)),blue:se(st.some(255)),hex:se(st.some("ffffff"))},o=function(t){return e[t].get()},i=function(t,n){e[t].set(n)},r=function(t){var n=t.red,e=t.green,o=t.blue;i("red",st.some(n)),i("green",st.some(e)),i("blue",st.some(o))},n=function(t,n){var e=n.event;"hex"!==e.type?i(e.type,st.none()):p(t)},u=function(r,t,n){var e=parseInt(n,10);i(t,st.some(e)),o("red").bind(function(e){return o("green").bind(function(n){return o("blue").map(function(t){return cb(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=eb(t),ES.getField(n,"hex").each(function(t){dg.isFocused(t)||Vl.setValue(n,{hex:e.value})}),e);y(r,o)})},a=function(t,n){var e=n.event;"hex"===e.type?function(t,n){g(t);var e=Jv(n);i("hex",st.some(n));var o=fb(e);v(t,o),r(o),Go(t,Lx,{hex:e}),y(t,e)}(t,e.value):u(t,e.type,e.value)},t=function(t){return{label:d(MS+t+".label"),description:d(MS+t+".description")}},c=t("red"),s=t("green"),l=t("blue"),f=t("hex");return Ht(ES.sketch(function(t){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[t.field("red",Ey.sketch(h(sb,"red",c.label,c.description,255))),t.field("green",Ey.sketch(h(sb,"green",s.label,s.description,255))),t.field("blue",Ey.sketch(h(sb,"blue",l.label,l.description,255))),t.field("hex",Ey.sketch(h(Zv,"hex",f.label,f.description,"ffffff"))),b.asSpec()],formBehaviours:nc([hx.config({invalidClass:m("form-invalid")}),ag("rgb-form-events",[Zo(BS,a),Zo(DS,n),Zo(AS,n)])])}}),{apis:{updateHex:function(t,n){var e,o;Vl.setValue(t,{hex:n.value}),e=t,o=fb(n),v(e,o),r(o),y(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})},IS=function(t,o){var r=CS.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=CS.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"'}}),u=function(t,n){var e,o,r=t.width,i=t.height,u=t.getContext("2d");null!==u&&(u.fillStyle=n,u.fillRect(0,0,r,i),(e=u.createLinearGradient(0,0,r,0)).addColorStop(0,"rgba(255,255,255,1)"),e.addColorStop(1,"rgba(255,255,255,0)"),u.fillStyle=e,u.fillRect(0,0,r,i),(o=u.createLinearGradient(0,0,0,i)).addColorStop(0,"rgba(0,0,0,0)"),o.addColorStop(1,"rgba(0,0,0,1)"),u.fillStyle=o,u.fillRect(0,0,r,i))};return Uf({factory:function(t){var n=at({x:0,y:0}),e=nc([Kf.config({find:st.some}),dg.config({})]);return CS.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:n},rounded:!1,components:[r,i],onChange:function(t,n,e){Go(t,Ux,{value:e})},onInit:function(t,n,e,o){u(e.element.dom,mb(gb))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,n,e){var o,r;o=e,r=n.components()[0].element.dom,u(r,mb(o))}},extraApis:{}})},RS=function(f,d){return Uf({name:"ColourPicker",configFields:[Nn("dom"),te("onValidHex",$),te("onInvalidHex",$)],factory:function(t){var a,v,n,e,o,r=FS(f,d,t.onValidHex,t.onInvalidHex),i=IS(0,d),b={paletteRgba:se(gb)},u=sp(i.sketch({})),c=sp(r.sketch({})),s=function(t,e){u.getOpt(t).each(function(t){var n=fb(e);b.paletteRgba.set(n),i.setRgba(t,n)})},l=function(t,n){c.getOpt(t).each(function(t){r.updateHex(t,n)})},y=function(n,e,t){ot(t,function(t){t(n,e)})};return{uid:t.uid,dom:t.dom,components:[u.asSpec(),(n=d,e=CS.parts.spectrum({dom:{tag:"div",classes:[n("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=CS.parts.thumb({dom:{tag:"div",classes:[n("hue-slider-thumb")],attributes:{role:"presentation"}}}),CS.sketch({dom:{tag:"div",classes:[n("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:at({y:0})},components:[e,o],sliderBehaviours:nc([dg.config({})]),onChange:function(t,n,e){Go(t,jx,{value:e})}})),c.asSpec()],behaviours:nc([ag("colour-picker-events",[Zo(Ux,(v=[l],function(t,n){var e,o,r,i,u,a,c,s,l,f=n.event.value,d=b.paletteRgba.get(),m=(i=r=0,u=(e=d).red/255,a=e.green/255,c=e.blue/255,s=Math.min(u,Math.min(a,c)),l=Math.max(u,Math.max(a,c)),s===l?Nx(0,0,100*(i=s)):(r=60*((r=u===s?3:c===s?1:5)-(u===s?a-c:c===s?u-a:c-u)/(l-s)),o=(l-s)/l,i=l,Nx(Math.round(r),Math.round(100*o),Math.round(100*i)))),g=Nx(m.hue,f.x,100-f.y),p=lb(g),h=eb(p);y(t,h,v)})),Zo(jx,(a=[s,l],function(t,n){var e,o,r,i=n.event.value,u=(e=i.y,o=Nx((100-e)/100*360,100,100),r=lb(o),eb(r));y(t,u,a)}))]),Kf.config({find:function(t){return c.getOpt(t)}}),ng.config({mode:"acyclic"})])}}})},VS=function(){return Kf.config({find:st.some})},PS=function(t){return Kf.config({find:t.getOpt})},HS=function(t){return Kf.config({find:function(n){return Cr(n.element,t).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}})},zS={"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"},NS=function(t){return zS[t]},LS=tinymce.util.Tools.resolve("tinymce.Resource"),jS=ln([te("preprocess",ct),te("postprocess",ct)]),US=function(t,n,e){return Vl.config(Ht({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},WS=function(t,n,e){return US(t,function(t){return n(t.element)},function(t,n){return e(t.element,n)})},GS=function(r,t){var i=Tn("RepresentingConfigs.memento processors",jS,t);return Vl.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=Vl.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);Vl.setValue(o,e)}}})},XS=US,YS=function(t){return WS(t,Fr,Ir)},qS=function(t){return Vl.config({store:{mode:"memory",initialValue:t}})},KS=function(r,n){var e=function(t,n){n.stop()},o=function(t){return function(n,e){ot(t,function(t){t(n,e)})}},i=function(t,n){var e;tv.isDisabled(t)||(e=n.event.raw,a(t,e.dataTransfer.files))},u=function(t,n){var e=n.event.raw.target;a(t,e.files)},a=function(t,n){var e,o;Vl.setValue(t,(e=n,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),H(J(e),function(t){return o.test(t.name)}))),Go(t,Vy,{name:r.name})},c=sp({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:nc([ag("input-file-events",[rr(go()),rr(Oo())])])}),t=r.label.map(function(t){return Ry(t,n)}),s=Ey.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:nc([qS([]),VS(),tv.config({}),Cg.config({toggleClass:"dragenter",toggleOnExecute:!1}),ag("dropzone-events",[Zo("dragenter",o([e,Cg.toggle])),Zo("dragleave",o([e,Cg.toggle])),Zo("dragover",e),Zo("drop",o([e,i])),Zo(mo(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:n.translate("Drop an image here")}},cp.sketch({dom:{tag:"button",innerHtml:n.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element.dom.click()},buttonBehaviours:nc([Ay.config({}),Ev(n.isReadOnly),_v()])})]}]}}}});return My(t,s,["tox-form__group--stretched"],[])},JS=Xr("alloy-fake-before-tabstop"),$S=Xr("alloy-fake-after-tabstop"),QS=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:nc([dg.config({ignore:!0}),Ay.config({})])}},ZS=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[QS([JS]),t,QS([$S])],behaviours:nc([HS(1)])}},tk=function(t,n){Go(t,so(),{raw:{which:9,shiftKey:n}})},nk=function(t,n){var e=n.element;Ei(e,JS)?tk(t,!0):Ei(e,$S)&&tk(t,!1)},ek=function(t){return oy(t,["."+JS,"."+$S].join(","),c)},ok=!(ze().browser.isIE()||ze().browser.isEdge()),rk=function(t,n){var o,r,e=ok&&t.sandboxed,i=nt(nt({},t.label.map(function(t){return{title:t}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),u=(o=e,r=se(""),{getValue:function(t){return r.get()},setValue:function(t,n){var e;o?Vr(t.element,"srcdoc",n):(Vr(t.element,"src","javascript:''"),(e=t.element.dom.contentWindow.document).open(),e.write(n),e.close()),r.set(n)}}),a=t.label.map(function(t){return Ry(t,n)}),c=Ey.parts.field({factory:{sketch:function(t){return ZS({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:nc([Ay.config({}),dg.config({}),XS(st.none(),u.getValue,u.setValue)])})}}});return My(a,c,["tox-form__group--stretched"],[])};function ik(t,n){return ck(document.createElement("canvas"),t,n)}function uk(t){var n=ik(t.width,t.height);return ak(n).drawImage(t,0,0),n}function ak(t){return t.getContext("2d")}function ck(t,n,e){return t.width=n,t.height=e,t}function sk(t){return t.naturalWidth||t.width}function lk(t){return t.naturalHeight||t.height}var fk,dk,mk,gk,pk=window.Promise?window.Promise:(fk=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=[],Sk(t,hk(bk,this),hk(yk,this))},dk=window,mk=fk.immediateFn||"function"==typeof dk.setImmediate&&dk.setImmediate||function(t){setTimeout(t,1)},gk=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},fk.prototype["catch"]=function(t){return this.then(null,t)},fk.prototype.then=function(e,o){var r=this;return new fk(function(t,n){vk.call(r,new wk(e,o,t,n))})},fk.all=function(){for(var t=[],n=0;n").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(b.body),KC(b).on("mousemove touchmove",x).on("mouseup touchend",w),m.start(t)})}var nO=0,eO=function(s,e,l,o,r){var t,n="tox-",u="tox-crid-"+nO++,a=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],i=["top","right","bottom","left"],c=function(t,n){return{x:n.x+t.x,y:n.y+t.y,w:n.w,h:n.h}},f=function(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}};function d(t,n,e,o){var r,i=n.x,u=n.y,a=n.w,c=n.h;i+=e*t.deltaX,u+=o*t.deltaY,(a+=e*t.deltaW)<20&&(a=20),(c+=o*t.deltaH)<20&&(c=20),r=s=qC.clamp({x:i,y:u,w:a,h:c},l,"move"===t.name),r=f(l,r),h.fire("updateRect",{rect:r}),p(r)}function m(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),KC("#"+u+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}$C.each(a,function(t){KC("#"+u+"-"+t.name,o).css({left:n.w*t.xMul+n.x,top:n.h*t.yMul+n.y})}),t("top",{x:e.x,y:e.y,w:e.w,h:n.y-e.y}),t("right",{x:n.x+n.w,y:n.y,w:e.w-n.x-n.w+e.x,h:n.h}),t("bottom",{x:e.x,y:n.y+n.h,w:e.w,h:e.h-n.y-n.h+e.y}),t("left",{x:e.x,y:n.y,w:n.x-e.x,h:n.h}),t("move",n)}function g(t){m(s=t)}function p(t){g(c(l,t))}KC('
').appendTo(o),$C.each(i,function(t){KC("#"+u,o).append('