forked from extern/egroupware
16fe435de4
- Fix language setting - Update TinyMCE
1 line
451 KiB
JavaScript
1 line
451 KiB
JavaScript
!function(){"use strict";var e,t,n,o,r,c,i,N=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},h=function(n,o){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(o.apply(null,arguments))}},U=function(e){return function(){return e}},b=function(e){return e},f=function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var a=new Array(arguments.length-1),n=1;n<arguments.length;n++)a[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),o=0;o<n.length;o++)n[o]=arguments[o];var r=a.concat(n);return i.apply(null,r)}},k=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,arguments)}},a=function(e){return function(){throw new Error(e)}},u=function(e){return e()},s=U(!1),l=U(!0),d=s,m=l,g=function(){return v},v=(o={fold:function(e,t){return e()},is:d,isSome:d,isNone:m,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:g,ap:g,each:function(){},bind:g,flatten:g,exists:d,forall:m,filter:g,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:U("none()")},Object.freeze&&Object.freeze(o),o),p=function(n){var e=function(){return n},t=function(){return r},o=function(e){return e(n)},r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:m,isNone:d,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return p(e(n))},ap:function(e){return e.fold(g,function(e){return p(e(n))})},each:function(e){e(n)},bind:o,flatten:e,exists:o,forall:o,filter:function(e){return e(n)?r:v},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(d,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},P={some:p,none:g,from:function(e){return null===e||e===undefined?v:p(e)}},y=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},x=y("string"),w=y("object"),S=y("array"),C=y("boolean"),z=y("function"),O=y("number"),T=(r=Array.prototype.indexOf)===undefined?function(e,t){return _(e,t)}:function(e,t){return r.call(e,t)},M=function(e,t){return-1<T(e,t)},H=function(e,t){return I(e,t).isSome()},E=function(e,t){for(var n=[],o=0;o<e.length;o+=t){var r=e.slice(o,o+t);n.push(r)}return n},V=function(e,t){for(var n=e.length,o=new Array(n),r=0;r<n;r++){var i=e[r];o[r]=t(i,r,e)}return o},A=function(e,t){for(var n=0,o=e.length;n<o;n++)t(e[n],n,e)},B=function(e,t){for(var n=[],o=0,r=e.length;o<r;o++){var i=e[o];t(i,o,e)&&n.push(i)}return n},D=function(e,t,n){return function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){n=t(n,e)}),n},R=function(e,t,n){return A(e,function(e){n=t(n,e)}),n},F=function(e,t){for(var n=0,o=e.length;n<o;n++){var r=e[n];if(t(r,n,e))return P.some(r)}return P.none()},I=function(e,t){for(var n=0,o=e.length;n<o;n++)if(t(e[n],n,e))return P.some(n);return P.none()},_=function(e,t){for(var n=0,o=e.length;n<o;++n)if(e[n]===t)return n;return-1},L=Array.prototype.push,j=function(e){for(var t=[],n=0,o=e.length;n<o;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);L.apply(t,e[n])}return t},W=function(e,t){var n=V(e,t);return j(n)},G=function(e,t){for(var n=0,o=e.length;n<o;++n)if(!0!==t(e[n],n,e))return!1;return!0},X=Array.prototype.slice,Y=function(e){var t=X.call(e,0);return t.reverse(),t},$=function(e,t){return B(e,function(e){return!M(t,e)})},q=function(e){return[e]},K=function(e){return 0===e.length?P.none():P.some(e[0])},J=function(e){return 0===e.length?P.none():P.some(e[e.length-1])},Q=z(Array.from)?Array.from:function(e){return X.call(e)},Z=Object.prototype.hasOwnProperty,ee=function(a){return function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},o=0;o<e.length;o++){var r=e[o];for(var i in r)Z.call(r,i)&&(n[i]=a(n[i],r[i]))}return n}},te=ee(function(e,t){return w(e)&&w(t)?te(e,t):t}),ne=ee(function(e,t){return t}),oe=function(n){return{is:function(e){return n===e},isValue:l,isError:s,getOr:U(n),getOrThunk:U(n),getOrDie:U(n),or:function(e){return oe(n)},orThunk:function(e){return oe(n)},fold:function(e,t){return t(n)},map:function(e){return oe(e(n))},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return P.some(n)}}},re=function(n){return{is:s,isValue:s,isError:l,getOr:b,getOrThunk:function(e){return e()},getOrDie:function(){return a(String(n))()},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return re(n)},each:N,bind:function(e){return re(n)},exists:s,forall:l,toOption:P.none}},ie={value:oe,error:re},ae=Object.keys,ue=Object.hasOwnProperty,ce=function(e,t){for(var n=ae(e),o=0,r=n.length;o<r;o++){var i=n[o];t(e[i],i,e)}},se=function(e,o){return le(e,function(e,t,n){return{k:t,v:o(e,t,n)}})},le=function(o,r){var i={};return ce(o,function(e,t){var n=r(e,t,o);i[n.k]=n.v}),i},fe=function(e,n){var o=[];return ce(e,function(e,t){o.push(n(e,t))}),o},de=function(e){return fe(e,function(e){return e})},me=function(e,t){return ue.call(e,t)},ge=function(a){if(!S(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return A(a,function(e,o){var t=ae(e);if(1!==t.length)throw new Error("one and only one name per case");var r=t[0],i=e[r];if(n[r]!==undefined)throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!S(i))throw new Error("case arguments must be an array");u.push(r),n[r]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+arguments.length);return arguments[o].apply(null,n)},match:function(e){var t=ae(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!G(u,function(e){return M(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+u.join(", "));return e[r].apply(null,n)},log:function(e){console.log(e,{constructors:u,constructor:r,params:n})}}}}),n},he=(ge([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(e){var t=[],n=[];return A(e,function(e){e.fold(function(e){t.push(e)},function(e){n.push(e)})}),{errors:t,values:n}}),ve=function(e){return h(ie.error,j)(e)},pe=function(e,t){var n,o,r=he(e);return 0<r.errors.length?ve(r.errors):(n=r.values,o=t,ie.value(te.apply(undefined,[o].concat(n))))},be=function(e){var t=he(e);return 0<t.errors.length?ve(t.errors):ie.value(t.values)},ye=function(t){return function(e){return e.hasOwnProperty(t)?P.from(e[t]):P.none()}},xe=function(e,t){return ye(t)(e)},we=function(e,t){var n={};return n[e]=t,n},ke=function(e,t){return n=e,o={},A(t,function(e){n[e]!==undefined&&n.hasOwnProperty(e)&&(o[e]=n[e])}),o;var n,o},Se=function(e,t){return n=t,o={},ce(e,function(e,t){M(n,t)||(o[t]=e)}),o;var n,o},Ce=function(e){return ye(e)},ze=function(e,t){return n=e,o=t,function(e){return ye(n)(e).getOr(o)};var n,o},Oe=function(e,t){return xe(e,t)},Te=function(e,t){return we(e,t)},Me=function(e){return t={},A(e,function(e){t[e.key]=e.value}),t;var t},He=function(e,t){return pe(e,t)},Ee=function(e,t){return o=t,(n=e).hasOwnProperty(o)&&n[o]!==undefined&&null!==n[o];var n,o},Ve=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Ve(n())}}},Ae=function(e){for(var t=[],n=function(e){t.push(e)},o=0;o<e.length;o++)e[o].each(n);return t},Be=function(e,t){for(var n=0;n<e.length;n++){var o=t(e[n],n);if(o.isSome())return o}return P.none()},De=U("contextmenu"),Re=U("touchstart"),Fe=U("touchmove"),Ie=U("touchend"),_e=U("gesturestart"),Le=U("mousedown"),Ne=U("mousemove"),Pe=U("mouseout"),je=U("mouseup"),Ue=U("mouseover"),We=U("focusin"),Ge=U("focusout"),Xe=U("keydown"),Ye=U("keyup"),$e=U("input"),qe=U("change"),Ke=U("click"),Je=U("transitionend"),Qe=U("selectstart"),Ze=U("paste"),et=function(n){var o,r=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r||(r=!0,o=n.apply(null,e)),o}},tt=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var o=e[n];if(o.test(t))return o}return undefined}(e,t);if(!n)return{major:0,minor:0};var o=function(e){return Number(t.replace(n,"$"+e))};return ot(o(1),o(2))},nt=function(){return ot(0,0)},ot=function(e,t){return{major:e,minor:t}},rt={nu:ot,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?nt():tt(e,n)},unknown:nt},it="Firefox",at=function(e,t){return function(){return t===e}},ut=function(e){var t=e.current;return{current:t,version:e.version,isEdge:at("Edge",t),isChrome:at("Chrome",t),isIE:at("IE",t),isOpera:at("Opera",t),isFirefox:at(it,t),isSafari:at("Safari",t)}},ct={unknown:function(){return ut({current:undefined,version:rt.unknown()})},nu:ut,edge:U("Edge"),chrome:U("Chrome"),ie:U("IE"),opera:U("Opera"),firefox:U(it),safari:U("Safari")},st="Windows",lt="Android",ft="Solaris",dt="FreeBSD",mt=function(e,t){return function(){return t===e}},gt=function(e){var t=e.current;return{current:t,version:e.version,isWindows:mt(st,t),isiOS:mt("iOS",t),isAndroid:mt(lt,t),isOSX:mt("OSX",t),isLinux:mt("Linux",t),isSolaris:mt(ft,t),isFreeBSD:mt(dt,t)}},ht={unknown:function(){return gt({current:undefined,version:rt.unknown()})},nu:gt,windows:U(st),ios:U("iOS"),android:U(lt),linux:U("Linux"),osx:U("OSX"),solaris:U(ft),freebsd:U(dt)},vt=function(e,t){var n=String(t).toLowerCase();return F(e,function(e){return e.search(n)})},pt=function(e,n){return vt(e,n).map(function(e){var t=rt.detect(e.versionRegexes,n);return{current:e.name,version:t}})},bt=function(e,n){return vt(e,n).map(function(e){var t=rt.detect(e.versionRegexes,n);return{current:e.name,version:t}})},yt=function(e,t){return-1!==e.indexOf(t)},xt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,wt=function(t){return function(e){return yt(e,t)}},kt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return yt(e,"edge/")&&yt(e,"chrome")&&yt(e,"safari")&&yt(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,xt],search:function(e){return yt(e,"chrome")&&!yt(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return yt(e,"msie")||yt(e,"trident")}},{name:"Opera",versionRegexes:[xt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:wt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:wt("firefox")},{name:"Safari",versionRegexes:[xt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(yt(e,"safari")||yt(e,"mobile/"))&&yt(e,"applewebkit")}}],St=[{name:"Windows",search:wt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return yt(e,"iphone")||yt(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:wt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:wt("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:wt("linux"),versionRegexes:[]},{name:"Solaris",search:wt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:wt("freebsd"),versionRegexes:[]}],Ct={browsers:U(kt),oses:U(St)},zt=function(e){var t,n,o,r,i,a,u,c,s,l,f,d=Ct.browsers(),m=Ct.oses(),g=pt(d,e).fold(ct.unknown,ct.nu),h=bt(m,e).fold(ht.unknown,ht.nu);return{browser:g,os:h,deviceType:(n=g,o=e,r=(t=h).isiOS()&&!0===/ipad/i.test(o),i=t.isiOS()&&!r,a=t.isAndroid()&&3===t.version.major,u=t.isAndroid()&&4===t.version.major,c=r||a||u&&!0===/mobile/i.test(o),s=t.isiOS()||t.isAndroid(),l=s&&!c,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(o),{isiPad:U(r),isiPhone:U(i),isTablet:U(c),isPhone:U(l),isTouch:U(s),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:U(f)})}},Ot={detect:et(function(){var e=navigator.userAgent;return zt(e)})},Tt={tap:U("alloy.tap")},Mt=U("alloy.focus"),Ht=U("alloy.blur.post"),Et=U("alloy.receive"),Vt=U("alloy.execute"),At=U("alloy.focus.item"),Bt=Tt.tap,Dt=Ot.detect().deviceType.isTouch()?Tt.tap:Ke,Rt=U("alloy.longpress"),Ft=U("alloy.sandbox.close"),It=U("alloy.typeahead.cancel"),_t=U("alloy.system.init"),Lt=U("alloy.system.scroll"),Nt=U("alloy.system.attached"),Pt=U("alloy.system.detached"),jt=U("alloy.system.dismissRequested"),Ut=U("alloy.focusmanager.shifted"),Wt=U("alloy.slotcontainer.visibility"),Gt=U("alloy.change.tab"),Xt=U("alloy.dismiss.tab"),Yt=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:U(e)}},$t={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return Yt(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return Yt(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return Yt(n)},fromDom:Yt,fromPoint:function(e,t,n){var o=e.dom();return P.from(o.elementFromPoint(t,n)).map(Yt)}},qt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var o={};return A(t,function(e,t){o[e]=U(n[t])}),o}},Kt=function(e){return e.slice(0).sort()},Jt=function(e,t){throw new Error("All required keys ("+Kt(e).join(", ")+") were not specified. Specified keys were: "+Kt(t).join(", ")+".")},Qt=function(e){throw new Error("Unsupported keys for object: "+Kt(e).join(", "))},Zt=function(t,e){if(!S(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");A(e,function(e){if(!x(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})},en=function(e){var n=Kt(e);F(n,function(e,t){return t<n.length-1&&e===n[t+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})},tn=function(r,i){var a=r.concat(i);if(0===a.length)throw new Error("You must specify at least one required or optional field.");return Zt("required",r),Zt("optional",i),en(a),function(t){var n=ae(t);G(r,function(e){return M(n,e)})||Jt(r,n);var e=B(n,function(e){return!M(a,e)});0<e.length&&Qt(e);var o={};return A(r,function(e){o[e]=U(t[e])}),A(i,function(e){o[e]=U(Object.prototype.hasOwnProperty.call(t,e)?P.some(t[e]):P.none())}),o}},nn=function(e,t){for(var n=[],o=function(e){return n.push(e),t(e)},r=t(e);(r=r.bind(o)).isSome(););return n},on="undefined"!=typeof window?window:Function("return this;")(),rn=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:on,o=0;o<e.length&&n!==undefined&&null!==n;++o)n=n[e[o]];return n}(e.split("."),t)},an={getOrDie:function(e,t){var n=rn(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n}},un={ATTRIBUTE:Node.ATTRIBUTE_NODE,CDATA_SECTION:Node.CDATA_SECTION_NODE,COMMENT:Node.COMMENT_NODE,DOCUMENT:Node.DOCUMENT_NODE,DOCUMENT_TYPE:Node.DOCUMENT_TYPE_NODE,DOCUMENT_FRAGMENT:Node.DOCUMENT_FRAGMENT_NODE,ELEMENT:Node.ELEMENT_NODE,TEXT:Node.TEXT_NODE,PROCESSING_INSTRUCTION:Node.PROCESSING_INSTRUCTION_NODE,ENTITY_REFERENCE:Node.ENTITY_REFERENCE_NODE,ENTITY:Node.ENTITY_NODE,NOTATION:Node.NOTATION_NODE},cn=un.ELEMENT,sn=un.DOCUMENT,ln=function(e){return e.nodeType!==cn&&e.nodeType!==sn||0===e.childElementCount},fn={all:function(e,t){var n=t===undefined?document:t.dom();return ln(n)?[]:V(n.querySelectorAll(e),$t.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==cn)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return ln(n)?P.none():P.from(n.querySelector(e)).map($t.fromDom)}},dn=function(e,t){return e.dom()===t.dom()},mn=(Ot.detect().browser.isIE(),dn),gn=function(e){var t=e.dom();return P.from(t.parentNode).map($t.fromDom)},hn=function(e){var t=e.dom();return P.from(t.previousSibling).map($t.fromDom)},vn=function(e){var t=e.dom();return P.from(t.nextSibling).map($t.fromDom)},pn=function(e){var t=e.dom();return V(t.childNodes,$t.fromDom)},bn=function(e,t){var n=e.dom().childNodes;return P.from(n[t]).map($t.fromDom)},yn=qt("element","offset"),xn={owner:function(e){return $t.fromDom(e.dom().ownerDocument)},defaultView:function(e){var t=e.dom().ownerDocument.defaultView;return $t.fromDom(t)},documentElement:function(e){return $t.fromDom(e.dom().ownerDocument.documentElement)},parent:gn,findIndex:function(n){return gn(n).bind(function(e){var t=pn(e);return I(t,function(e){return mn(n,e)})})},parents:function(e,t){for(var n=z(t)?t:U(!1),o=e.dom(),r=[];null!==o.parentNode&&o.parentNode!==undefined;){var i=o.parentNode,a=$t.fromDom(i);if(r.push(a),!0===n(a))break;o=i}return r},siblings:function(t){return gn(t).map(pn).map(function(e){return B(e,function(e){return!mn(t,e)})}).getOr([])},prevSibling:hn,offsetParent:function(e){var t=e.dom();return P.from(t.offsetParent).map($t.fromDom)},prevSiblings:function(e){return Y(nn(e,hn))},nextSibling:vn,nextSiblings:function(e){return nn(e,vn)},children:pn,child:bn,firstChild:function(e){return bn(e,0)},lastChild:function(e){return bn(e,e.dom().childNodes.length-1)},childNodesCount:function(e){return e.dom().childNodes.length},hasChildNodes:function(e){return e.dom().hasChildNodes()},leaf:function(e,t){var n=pn(e);return 0<n.length&&t<n.length?yn(n[t],0):yn(e,t)}},wn=function(e,t){var n=(t||document).createElement("div");return n.innerHTML=e,xn.children($t.fromDom(n))},kn=function(t,n){xn.parent(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},Sn=function(e,t){e.dom().appendChild(t.dom())},Cn={before:kn,after:function(e,t){xn.nextSibling(e).fold(function(){xn.parent(e).each(function(e){Sn(e,t)})},function(e){kn(e,t)})},prepend:function(t,n){xn.firstChild(t).fold(function(){Sn(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},append:Sn,appendAt:function(e,t,n){xn.child(e,n).fold(function(){Sn(e,t)},function(e){kn(e,t)})},wrap:function(e,t){kn(e,t),Sn(t,e)}},zn=function(t,e){A(e,function(e){Cn.before(t,e)})},On=function(t,e){A(e,function(e){Cn.append(t,e)})},Tn=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Mn={empty:function(e){e.dom().textContent="",A(xn.children(e),function(e){Tn(e)})},remove:Tn,unwrap:function(e){var t=xn.children(e);0<t.length&&zn(e,t),Tn(e)}},Hn=function(e){return e.dom().innerHTML},En=Hn,Vn=function(e,t){var n=xn.owner(e).dom(),o=$t.fromDom(n.createDocumentFragment()),r=wn(t,n);On(o,r),Mn.empty(e),Cn.append(e,o)},An=function(e){var t=$t.fromTag("div"),n=$t.fromDom(e.dom().cloneNode(!0));return Cn.append(t,n),Hn(t)},Bn=function(e){return e.dom().nodeName.toLowerCase()},Dn=function(e){return e.dom().nodeType},Rn=function(t){return function(e){return Dn(e)===t}},Fn=Rn(un.ELEMENT),In=Rn(un.TEXT),_n=Rn(un.DOCUMENT),Ln={name:Bn,type:Dn,value:function(e){return e.dom().nodeValue},isElement:Fn,isText:In,isDocument:_n,isComment:function(e){return Dn(e)===un.COMMENT||"#comment"===Bn(e)}},Nn=function(e,t,n){if(!(x(n)||C(n)||O(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},Pn=function(e,t,n){Nn(e.dom(),t,n)},jn=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},Un=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},Wn={clone:function(e){return R(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},set:Pn,setAll:function(e,t){var n=e.dom();ce(t,function(e,t){Nn(n,t,e)})},get:jn,has:Un,remove:function(e,t){e.dom().removeAttribute(t)},hasNone:function(e){var t=e.dom().attributes;return t===undefined||null===t||0===t.length},transfer:function(r,i,e){Ln.isElement(r)&&Ln.isElement(i)&&A(e,function(e){var t,n,o;n=i,Un(t=r,o=e)&&!Un(n,o)&&Pn(n,o,jn(t,o))})}},Gn=function(e,t){return $t.fromDom(e.dom().cloneNode(t))},Xn=function(e){return Gn(e,!1)},Yn=function(e){return t=Xn(e),An(t);var t},$n="unknown",qn="__CHROME_INSPECTOR_CONNECTION_TO_ALLOY__";(i=c||(c={}))[i.STOP=0]="STOP",i[i.NORMAL=1]="NORMAL",i[i.LOGGING=2]="LOGGING";var Kn=Ve({}),Jn=function(t,e,n){var o,r,i;switch(Oe(Kn.get(),t).orThunk(function(){var e=ae(Kn.get());return Be(e,function(e){return-1<t.indexOf(e)?P.some(Kn.get()[e]):P.none()})}).getOr(c.NORMAL)){case c.NORMAL:return n(no());case c.LOGGING:var a=(o=t,r=e,i=[],{logEventCut:function(e,t,n){i.push({outcome:"cut",target:t,purpose:n})},logEventStopped:function(e,t,n){i.push({outcome:"stopped",target:t,purpose:n})},logNoParent:function(e,t,n){i.push({outcome:"no-parent",target:t,purpose:n})},logEventNoHandlers:function(e,t){i.push({outcome:"no-handlers-left",target:t})},logEventResponse:function(e,t,n){i.push({outcome:"response",purpose:n,target:t})},write:function(){M(["mousemove","mouseover","mouseout",_t()],o)||console.log(o,{event:o,target:r.dom(),sequence:V(i,function(e){return M(["cut","stopped","response"],e.outcome)?"{"+e.purpose+"} "+e.outcome+" at ("+Yn(e.target)+")":e.outcome})})}}),u=n(a);return a.write(),u;case c.STOP:return!0}},Qn=["alloy/data/Fields","alloy/debugging/Debugging"],Zn=function(e,t,n){return Jn(e,t,n)},eo=function(){if(window[qn]!==undefined)return window[qn];var t=function(e,t){var n=Kn.get();n[e]=t,Kn.set(n)};return window[qn]={systems:{},lookup:function(t){var n=window[qn].systems,e=ae(n);return Be(e,function(e){return n[e].getByUid(t).toOption().map(function(e){return Te(Yn(e.element()),(t=function(n){var e=n.spec();return{"(original.spec)":e,"(dom.ref)":n.element().dom(),"(element)":Yn(n.element()),"(initComponents)":V(e.components!==undefined?e.components:[],t),"(components)":V(n.components(),t),"(bound.events)":fe(n.events(),function(e,t){return[t]}).join(", "),"(behaviours)":e.behaviours!==undefined?se(e.behaviours,function(e,t){return e===undefined?"--revoked--":{config:e.configAsRaw(),"original-config":e.initialConfig,state:n.readState(t)}}):"none"}})(e));var t})}).orThunk(function(){return P.some({error:"Systems ("+e.join(", ")+") did not contain uid: "+t})})},events:{setToNormal:function(e){t(e,c.NORMAL)},setToLogging:function(e){t(e,c.LOGGING)},setToStop:function(e){t(e,c.STOP)}}},window[qn]},to=function(e,t){eo().systems[e]=t},no=U({logEventCut:N,logEventStopped:N,logNoParent:N,logEventNoHandlers:N,logEventResponse:N,write:N}),oo=0,ro=function(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++oo+String(t)},io=tinymce.util.Tools.resolve("tinymce.ThemeManager"),ao=function(e,t){lo(e,e.element(),t,{})},uo=function(e,t,n){lo(e,e.element(),t,n)},co=function(e){ao(e,Vt())},so=function(e,t,n){lo(e,t,n,{})},lo=function(e,t,n,o){var r=te({target:t},o);e.getSystem().triggerEvent(n,t,se(r,U))},fo=function(e,t,n,o){e.getSystem().triggerEvent(n,t,o.event())},mo=et(function(){return go($t.fromDom(document))}),go=function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return $t.fromDom(t)},ho={body:mo,getBody:go,inBody:function(e){var t=Ln.isText(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}},vo=function(e){ao(e,Pt());var t=e.components();A(t,vo)},po=function(e){var t=e.components();A(t,po),ao(e,Nt())},bo=function(e,t){yo(e,t,Cn.append)},yo=function(e,t,n){e.getSystem().addToWorld(t),n(e.element(),t.element()),ho.inBody(e.element())&&po(t),e.syncComponents()},xo=function(e){vo(e),Mn.remove(e.element()),e.getSystem().removeFromWorld(e)},wo=function(t){var e=xn.parent(t.element()).bind(function(e){return t.getSystem().getByDom(e).fold(P.none,P.some)});xo(t),e.each(function(e){e.syncComponents()})},ko=function(e){var t=e.components();A(t,xo),Mn.empty(e.element()),e.syncComponents()},So=function(e,t){Co(e,t,Cn.append)},Co=function(e,t,n){n(e,t.element());var o=xn.children(t.element());A(o,function(e){t.getByDom(e).each(po)})},zo=function(t){var e=xn.children(t.element());A(e,function(e){t.getByDom(e).each(vo)}),Mn.remove(t.element())},Oo=ge([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),To=function(e){return Oo.defaultedThunk(U(e))},Mo=Oo.strict,Ho=Oo.asOption,Eo=Oo.defaultedThunk,Vo=(Oo.asDefaultedOptionThunk,Oo.mergeWithThunk),Ao=ge([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),Bo=ge([{field:["name","presence","type"]},{state:["name"]}]),Do=function(){return an.getOrDie("JSON")},Ro=function(e,t,n){return Do().stringify(e,t,n)},Fo=function(e){return w(e)&&100<ae(e).length?" removed due to size":Ro(e,null,2)},Io=function(e,t){return ie.error([{path:e,getErrorInfo:t}])},_o=ge([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Lo=function(n,o,r){return xe(o,r).fold(function(){return e=r,t=o,Io(n,function(){return'Could not find valid *strict* value for "'+e+'" in '+Fo(t)});var e,t},ie.value)},No=function(e,t,n){var o=xe(e,t).fold(function(){return n(e)},b);return ie.value(o)},Po=function(r,u,e,c){return e.fold(function(i,t,e,n){var o=function(e){return n.extract(r.concat([i]),c,e).map(function(e){return we(t,c(e))})},a=function(e){return e.fold(function(){var e=we(t,c(P.none()));return ie.value(e)},function(e){return n.extract(r.concat([i]),c,e).map(function(e){return we(t,c(P.some(e)))})})};return e.fold(function(){return Lo(r,u,i).bind(o)},function(e){return No(u,i,e).bind(o)},function(){return(e=u,t=i,ie.value(xe(e,t))).bind(a);var e,t},function(e){return(t=u,n=i,o=e,r=xe(t,n).map(function(e){return!0===e?o(t):e}),ie.value(r)).bind(a);var t,n,o,r},function(e){var t=e(u);return No(u,i,U({})).map(function(e){return te(t,e)}).bind(o)})},function(e,t){var n=t(u);return ie.value(we(e,c(n)))})},jo=function(o){return{extract:function(n,e,t){return o(t,e).fold(function(e){return t=e,Io(n,function(){return t});var t},ie.value)},toString:function(){return"val"},toDsl:function(){return Ao.itemOf(o)}}},Uo=function(e){var c=Wo(e),s=D(e,function(t,e){return e.fold(function(e){return te(t,Te(e,!0))},U(t))},{});return{extract:function(e,t,n){var o,r,i,a=C(n)?[]:(r=ae(o=n),B(r,function(e){return Ee(o,e)})),u=B(a,function(e){return!Ee(s,e)});return 0===u.length?c.extract(e,t,n):(i=u,Io(e,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:c.toString,toDsl:c.toDsl}},Wo=function(u){return{extract:function(e,t,n){return o=e,r=n,i=t,a=V(u,function(e){return Po(o,r,e,i)}),pe(a,{});var o,r,i,a},toString:function(){return"obj{\n"+V(u,function(e){return e.fold(function(e,t,n,o){return e+" -> "+o.toString()},function(e,t){return"state("+e+")"})}).join("\n")+"}"},toDsl:function(){return Ao.objOf(V(u,function(e){return e.fold(function(e,t,n,o){return Bo.field(e,n,o)},function(e,t){return Bo.state(e)})}))}}},Go=function(r){return{extract:function(n,o,e){var t=V(e,function(e,t){return r.extract(n.concat(["["+t+"]"]),o,e)});return be(t)},toString:function(){return"array("+r.toString()+")"},toDsl:function(){return Ao.arrOf(r)}}},Xo=function(a,u){return{extract:function(n,o,r){var e,t,i=ae(r);return(e=n,t=i,Go(jo(a)).extract(e,b,t)).bind(function(e){var t=V(e,function(e){return _o.field(e,e,Mo(),u)});return Wo(t).extract(n,o,r)})},toString:function(){return"setOf("+u.toString()+")"},toDsl:function(){return Ao.setOf(a,u)}}},Yo=U(jo(ie.value)),$o=h(Go,Wo),qo=_o.state,Ko=_o.field,Jo=function(n,t,o,r,i){return Oe(r,i).fold(function(){return e=r,t=i,Io(n,function(){return'The chosen schema: "'+t+'" did not exist in branches: '+Fo(e)});var e,t},function(e){return Wo(e).extract(n.concat(["branch: "+i]),t,o)})},Qo=function(r,i){return{extract:function(t,n,o){return Oe(o,r).fold(function(){return e=r,Io(t,function(){return'Choice schema did not contain choice key: "'+e+'"'});var e},function(e){return Jo(t,n,o,i,e)})},toString:function(){return"chooseOn("+r+"). Possible values: "+ae(i)},toDsl:function(){return Ao.choiceOf(r,i)}}},Zo=jo(ie.value),er=function(t){return jo(function(e){return t(e)})},tr=function(e,t,n,o){return t.extract([e],n,o).fold(function(e){return ie.error({input:o,errors:e})},ie.value)},nr=function(e,t,n){return tr(e,t,U,n)},or=function(e,t,n){return tr(e,t,b,n)},rr=function(e){return e.fold(function(e){throw new Error(ur(e))},b)},ir=function(e,t,n){return rr(or(e,t,n))},ar=function(e,t,n){return rr(nr(e,t,n))},ur=function(e){return"Errors: \n"+(t=e.errors,n=10<t.length?t.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):t,V(n,function(e){return"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()}))+"\n\nInput object: "+Fo(e.input);var t,n},cr=function(e,t){return Qo(e,t)},sr=U(Zo),lr=function(n,o){return jo(function(e){var t=typeof e;return n(e)?ie.value(e):ie.error("Expected type: "+o+" but got: "+t)})},fr=lr(O,"number"),dr=lr(x,"string"),mr=lr(C,"boolean"),gr=lr(z,"function"),hr=function(e){return Ko(e,e,Mo(),Yo())},vr=function(e,t){return Ko(e,e,Mo(),t)},pr=function(e){return vr(e,dr)},br=function(e){return vr(e,gr)},yr=function(e,t){return Ko(e,e,Mo(),Wo(t))},xr=function(e,t){return Ko(e,e,Mo(),$o(t))},wr=function(e,t){return Ko(e,e,Mo(),Go(t))},kr=function(e){return Ko(e,e,Ho(),Yo())},Sr=function(e,t){return Ko(e,e,Ho(),t)},Cr=function(e){return Sr(e,dr)},zr=function(e,t){return Ko(e,e,Ho(),Wo(t))},Or=function(e,t){return Ko(e,e,Ho(),Uo(t))},Tr=function(e,t){return Ko(e,e,To(t),Yo())},Mr=function(e,t,n){return Ko(e,e,To(t),n)},Hr=function(e,t){return Mr(e,t,fr)},Er=function(e,t){return Mr(e,t,dr)},Vr=function(e,t){return Mr(e,t,mr)},Ar=function(e,t){return Mr(e,t,gr)},Br=function(e,t,n){return Ko(e,e,To(t),Wo(n))},Dr=function(e,t){return qo(e,t)},Rr=function(e){if(!Ee(e,"can")&&!Ee(e,"abort")&&!Ee(e,"run"))throw new Error("EventHandler defined by: "+Ro(e,null,2)+" does not have can, abort, or run!");return ir("Extracting event.handler",Uo([Tr("can",U(!0)),Tr("abort",U(!1)),Tr("run",N)]),e)},Fr=function(n){var t,o,r,i,e=(t=n,o=function(e){return e.can},function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return R(t,function(e,t){return e&&o(t).apply(undefined,n)},!0)}),a=(r=n,i=function(e){return e.abort},function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return R(r,function(e,t){return e||i(t).apply(undefined,n)},!1)});return Rr({can:e,abort:a,run:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];A(n,function(e){e.run.apply(undefined,t)})}})};function Ir(e,t,n,o,r){return e(n,o)?P.some(n):z(r)&&r(n)?P.none():t(n,o,r)}var _r,Lr=function(e,t,n){for(var o=e.dom(),r=z(n)?n:U(!1);o.parentNode;){o=o.parentNode;var i=$t.fromDom(o);if(t(i))return P.some(i);if(r(i))break}return P.none()},Nr=function(e,t){return F(e.dom().childNodes,h(t,$t.fromDom)).map($t.fromDom)},Pr=function(e,o){var r=function(e){for(var t=0;t<e.childNodes.length;t++){if(o($t.fromDom(e.childNodes[t])))return P.some($t.fromDom(e.childNodes[t]));var n=r(e.childNodes[t]);if(n.isSome())return n}return P.none()};return r(e.dom())},jr={first:function(e){return Pr(ho.body(),e)},ancestor:Lr,closest:function(e,t,n){return Ir(function(e){return t(e)},Lr,e,t,n)},sibling:function(t,n){var e=t.dom();return e.parentNode?Nr($t.fromDom(e.parentNode),function(e){return!mn(t,e)&&n(e)}):P.none()},child:Nr,descendant:Pr},Ur=function(e,t,n){return jr.closest(e,function(e){return t(e).isSome()},n).bind(t)},Wr=function(e){return Me(e)},Gr=function(e,t){return{key:e,value:Rr({abort:t})}},Xr=function(e){return{key:e,value:Rr({run:function(e,t){t.event().prevent()}})}},Yr=function(e,t){return{key:e,value:Rr({run:t})}},$r=function(e,t,n){return{key:e,value:Rr({run:function(e){t.apply(undefined,[e].concat(n))}})}},qr=function(e){return function(o){return{key:e,value:Rr({run:function(e,t){var n;n=t,mn(e.element(),n.event().target())&&o(e,t)}})}}},Kr=function(e,t,n){var o,r,i=t.partUids()[n];return r=i,Yr(o=e,function(e,t){e.getSystem().getByUid(r).each(function(e){fo(e,e.element(),o,t)})})},Jr=function(e,r){return Yr(e,function(t,e){var n=e.event(),o=t.getSystem().getByDom(n.target()).fold(function(){return Ur(n.target(),function(e){return t.getSystem().getByDom(e).toOption()},U(!1)).getOr(t)},function(e){return e});r(t,o,e)})},Qr=function(e){return Yr(e,function(e,t){t.cut()})},Zr=function(e){return Yr(e,function(e,t){t.stop()})},ei=function(e,t){return qr(e)(t)},ti=qr(Nt()),ni=qr(Pt()),oi=qr(_t()),ri=(_r=Vt(),function(e){return Yr(_r,e)}),ii=function(e){return V(e,function(e){return o=t="/*",r=(n=e).length-t.length,""!==o&&(n.length<o.length||n.substr(r,r+o.length)!==o)?e:e.substring(0,e.length-"/*".length);var t,n,o,r})},ai=function(e,t){var n=e.toString(),o=n.indexOf(")")+1,r=n.indexOf("("),i=n.substring(r+1,o-1).split(/,\s*/);return e.toFunctionAnnotation=function(){return{name:t,parameters:ii(i)}},e},ui=tn(["tag","uid"],["classes","attributes","styles","value","innerHtml","domChildren","defChildren"]),ci=function(e){return{uid:e.uid(),tag:e.tag(),classes:e.classes().getOr([]),attributes:e.attributes().getOr({}),styles:e.styles().getOr({}),value:e.value().getOr("<none>"),innerHtml:e.innerHtml().getOr("<none>"),defChildren:e.defChildren().fold(function(){return["<none>"]},function(e){return[Ro(e,null,2)]}),domChildren:e.domChildren().fold(function(){return"<none>"},function(e){return 0===e.length?"0 children, but still specified":String(e.length)})}},si=tn([],["classes","attributes","styles","value","innerHtml","defChildren","domChildren"]),li=function(t,e,n){return e.fold(function(){return n.fold(function(){return{}},function(e){return Te(t,e)})},function(e){return n.fold(function(){return Te(t,e)},function(e){return Te(t,e)})})},fi=function(n,o,r){return oi(function(e,t){r(e,n,o)})},di=function(r,i,a){var e,t,n,o,u,c;return e=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];var o=[n].concat(e);return n.config({name:U(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+a)},function(e){var t=Array.prototype.slice.call(o,1);return i.apply(undefined,[n,e.config,e.state].concat(t))})},t=a,n=i.toString(),o=n.indexOf(")")+1,u=n.indexOf("("),c=n.substring(u+1,o-1).split(/,\s*/),e.toFunctionAnnotation=function(){return{name:t,parameters:ii(c.slice(0,1).concat(c.slice(3)))}},e},mi=function(e){return{key:e,value:undefined}},gi=function(n,e,o,r,t,i,a){var u=function(e){return Ee(e,o)?e[o]():P.none()},c=se(t,function(e,t){return di(o,e,t)}),s=se(i,function(e,t){return ai(e,t)}),l=te(s,c,{revoke:f(mi,o),config:function(e){var t=ar(o+"-config",n,e);return{key:o,value:{config:t,me:l,configAsRaw:et(function(){return ir(o+"-config",n,e)}),initialConfig:e,state:a}}},schema:function(){return e},exhibit:function(e,n){return u(e).bind(function(t){return Oe(r,"exhibit").map(function(e){return e(n,t.config,t.state)})}).getOr(si({}))},name:function(){return o},handlers:function(e){return u(e).bind(function(t){return Oe(r,"events").map(function(e){return e(t.config,t.state)})}).getOr({})}});return l},hi=function(e,t){return vi(e,t,{validate:z,label:"function"})},vi=function(o,r,i){if(0===r.length)throw new Error("You must specify at least one required field.");return Zt("required",r),en(r),function(t){var n=ae(t);G(r,function(e){return M(n,e)})||Jt(r,n),o(r,n);var e=B(r,function(e){return!i.validate(t[e],e)});return 0<e.length&&function(e,t){throw new Error("All values need to be of type: "+t+". Keys ("+Kt(e).join(", ")+") were not.")}(e,i.label),t}},pi=function(t,e){var n=B(e,function(e){return!M(t,e)});0<n.length&&Qt(n)},bi=N,yi=function(e){return hi(pi,e)},xi={init:function(){return wi({readState:function(){return"No State required"}})}},wi=function(e){return hi(bi,["readState"])(e),e},ki=function(e){return Me(e)},Si=Uo([hr("fields"),hr("name"),Tr("active",{}),Tr("apis",{}),Tr("state",xi),Tr("extra",{})]),Ci=function(e){var t,n,o,r,i,a,u,c,s=ir("Creating behaviour: "+e.name,Si,e);return t=s.fields,n=s.name,o=s.active,r=s.apis,i=s.extra,a=s.state,u=Uo(t),c=zr(n,[Or("config",t)]),gi(u,c,n,o,r,i,a)},zi=Uo([hr("branchKey"),hr("branches"),hr("name"),Tr("active",{}),Tr("apis",{}),Tr("state",xi),Tr("extra",{})]),Oi=function(e){var t,n,o,r,i,a,u,c,s=ir("Creating behaviour: "+e.name,zi,e);return t=cr(s.branchKey,s.branches),n=s.name,o=s.active,r=s.apis,i=s.extra,a=s.state,c=zr(n,[Sr("config",u=t)]),gi(u,c,n,o,r,i,a)},Ti=U(undefined);function Mi(e,t,n){var o=n||!1,r=function(){t(),o=!0},i=function(){e(),o=!1};return{on:r,off:i,toggle:function(){(o?i:r)()},isOn:function(){return o}}}var Hi=function(e,t){var n=Wn.get(e,t);return n===undefined||""===n?[]:n.split(" ")},Ei=Hi,Vi=function(e,t,n){var o=Hi(e,t).concat([n]);return Wn.set(e,t,o.join(" ")),!0},Ai=function(e,t,n){var o=B(Hi(e,t),function(e){return e!==n});return 0<o.length?Wn.set(e,t,o.join(" ")):Wn.remove(e,t),!1},Bi=function(e){return Ei(e,"class")},Di=function(e,t){return Vi(e,"class",t)},Ri=function(e,t){return Ai(e,"class",t)},Fi=Bi,Ii=Di,_i=Ri,Li=function(e,t){return M(Bi(e),t)?Ri(e,t):Di(e,t)},Ni=function(e){return e.dom().classList!==undefined},Pi=function(e,t){return Ni(e)&&e.dom().classList.contains(t)},ji={add:function(e,t){Ni(e)?e.dom().classList.add(t):Ii(e,t)},remove:function(e,t){var n;Ni(e)?e.dom().classList.remove(t):_i(e,t),0===(Ni(n=e)?n.dom().classList:Fi(n)).length&&Wn.remove(n,"class")},toggle:function(e,t){return Ni(e)?e.dom().classList.toggle(t):Li(e,t)},toggler:function(e,t){var n=Ni(e),o=e.dom().classList;return Mi(function(){n?o.remove(t):_i(e,t)},function(){n?o.add(t):Ii(e,t)},Pi(e,t))},has:Pi},Ui=function(e,t,n){ji.remove(e,n),ji.add(e,t)},Wi=Object.freeze({toAlpha:function(e,t,n){Ui(e.element(),t.alpha(),t.omega())},toOmega:function(e,t,n){Ui(e.element(),t.omega(),t.alpha())},isAlpha:function(e,t,n){return ji.has(e.element(),t.alpha())},isOmega:function(e,t,n){return ji.has(e.element(),t.omega())},clear:function(e,t,n){ji.remove(e.element(),t.alpha()),ji.remove(e.element(),t.omega())}}),Gi=[hr("alpha"),hr("omega")],Xi=Ci({fields:Gi,name:"swapping",apis:Wi}),Yi=function(e,t,n){return jr.closest(e,t,n).isSome()},$i=function(e){e.dom().focus()},qi=function(e){var t=e!==undefined?e.dom():document;return P.from(t.activeElement).map($t.fromDom)},Ki=function(e){var t=xn.owner(e).dom();return e.dom()===t.activeElement},Ji=$i,Qi=function(e){e.dom().blur()},Zi=qi,ea=function(t){return qi(xn.owner(t)).filter(function(e){return t.dom().contains(e.dom())})},ta=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),na=function(e){var t=document.createElement("a");t.target="_blank",t.href=e.href,t.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),document.body.appendChild(t),t.dispatchEvent(n),document.body.removeChild(t)},oa={formatChanged:U("formatChanged"),orientationChanged:U("orientationChanged"),dropupDismissed:U("dropupDismissed")},ra=Object.freeze({events:function(u){return Wr([Yr(Et(),function(r,i){var e,t,a=u.channels(),n=ae(a),o=(e=n,(t=i).universal()?e:B(e,function(e){return M(t.channels(),e)}));A(o,function(e){var t=a[e](),n=t.schema(),o=ar("channel["+e+"] data\nReceiver: "+Yn(r.element()),n,i.data());t.onReceive()(r,o)})})])}}),ia=U([hr("menu"),hr("selectedMenu")]),aa=U([hr("item"),hr("selectedItem")]),ua=(U(Uo(aa().concat(ia()))),U(Uo(aa()))),ca=yr("initSize",[hr("numColumns"),hr("numRows")]),sa=function(){return vr("markers",ua())},la=function(){return yr("markers",[hr("backgroundMenu")].concat(ia()).concat(aa()))},fa=function(e){return yr("markers",V(e,hr))},da=function(e,t,n){return function(){var e=new Error;if(e.stack!==undefined){var t=e.stack.split("\n");F(t,function(t){return 0<t.indexOf("alloy")&&!H(Qn,function(e){return-1<t.indexOf(e)})}).getOr($n)}}(),Ko(t,t,n,er(function(n){return ie.value(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.apply(undefined,e)})}))},ma=function(e){return da(0,e,To(N))},ga=function(e){return da(0,e,To(P.none))},ha=function(e){return da(0,e,Mo())},va=function(e){return da(0,e,Mo())},pa=function(e,t){return Dr(e,U(t))},ba=function(e){return Dr(e,b)},ya=U(ca),xa=[vr("channels",Xo(ie.value,Uo([ha("onReceive"),Tr("schema",sr())])))],wa=Ci({fields:xa,name:"receiving",active:ra}),ka=function(e,t){var n=Ta(e,t),o=t.aria();o.update()(e,o,n)},Sa=function(e,t,n){ji.toggle(e.element(),t.toggleClass()),ka(e,t)},Ca=function(e,t,n){ji.add(e.element(),t.toggleClass()),ka(e,t)},za=function(e,t,n){ji.remove(e.element(),t.toggleClass()),ka(e,t)},Oa=function(e,t,n,o){(o?Ca:za)(e,t,n)},Ta=function(e,t){return ji.has(e.element(),t.toggleClass())},Ma=function(e,t,n){Oa(e,t,n,t.selected())},Ha=Object.freeze({onLoad:Ma,toggle:Sa,isOn:Ta,on:Ca,off:za,set:Oa}),Ea=Object.freeze({exhibit:function(e,t,n){return si({})},events:function(e,t){var n,o,r,i=(n=e,o=t,r=Sa,ri(function(e){r(e,n,o)})),a=fi(e,t,Ma);return Wr(j([e.toggleOnExecute()?[i]:[],[a]]))}}),Va=function(e,t,n){Wn.set(e.element(),"aria-expanded",n)},Aa=[Tr("selected",!1),hr("toggleClass"),Tr("toggleOnExecute",!0),Mr("aria",{mode:"none"},cr("mode",{pressed:[Tr("syncWithExpanded",!1),pa("update",function(e,t,n){Wn.set(e.element(),"aria-pressed",n),t.syncWithExpanded()&&Va(e,t,n)})],checked:[pa("update",function(e,t,n){Wn.set(e.element(),"aria-checked",n)})],expanded:[pa("update",Va)],selected:[pa("update",function(e,t,n){Wn.set(e.element(),"aria-selected",n)})],none:[pa("update",N)]}))],Ba=Ci({fields:Aa,name:"toggling",active:Ea,apis:Ha}),Da=function(n,o){return wa.config({channels:Te(oa.formatChanged(),{onReceive:function(e,t){t.command===n&&o(e,t.state)}})})},Ra=function(e){return wa.config({channels:Te(oa.orientationChanged(),{onReceive:e})})},Fa=function(e,t){return{key:e,value:{onReceive:t}}},Ia="tinymce-mobile",_a={resolve:function(e){return Ia+"-"+e},prefix:U(Ia)},La=function(e){var t=function(e,t){t.stop(),co(e)},n=Ot.detect().deviceType.isTouch()?[Yr(Bt(),t)]:[Yr(Ke(),t),Yr(Le(),function(e,t){t.cut()})];return Wr(j([e.map(function(n){return Yr(Vt(),function(e,t){n(e),t.stop()})}).toArray(),n]))},Na=function(e,t){t.ignore()||(Ji(e.element()),t.onFocus()(e))},Pa=Object.freeze({focus:Na,blur:function(e,t){t.ignore()||Qi(e.element())},isFocused:function(e){return Ki(e.element())}}),ja=Object.freeze({exhibit:function(e,t){var n=t.ignore()?{}:{attributes:{tabindex:"-1"}};return si(n)},events:function(n){return Wr([Yr(Mt(),function(e,t){Na(e,n),t.stop()})].concat(n.stopMousedown()?[Yr(Le(),function(e,t){t.event().prevent()})]:[]))}}),Ua=[ma("onFocus"),Tr("stopMousedown",!1),Tr("ignore",!1)],Wa=Ci({fields:Ua,name:"focusing",active:ja,apis:Pa}),Ga=function(e){return e.style!==undefined},Xa=function(e,t,n){if(!x(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Ga(e)&&e.style.setProperty(t,n)},Ya=function(e,t){Ga(e)&&e.style.removeProperty(t)},$a=function(e,t,n){var o=e.dom();Xa(o,t,n)},qa=function(e,t){return Ga(e)?e.style.getPropertyValue(t):""},Ka=function(e,t){var n=e.dom(),o=qa(n,t);return P.from(o).filter(function(e){return 0<e.length})},Ja={copy:function(e,t){var n=e.dom(),o=t.dom();Ga(n)&&Ga(o)&&(o.style.cssText=n.style.cssText)},set:$a,preserve:function(e,t){var n=Wn.get(e,"style"),o=t(e);return(n===undefined?Wn.remove:Wn.set)(e,"style",n),o},setAll:function(e,t){var n=e.dom();ce(t,function(e,t){Xa(n,t,e)})},setOptions:function(e,t){var n=e.dom();ce(t,function(e,t){e.fold(function(){Ya(n,t)},function(e){Xa(n,t,e)})})},remove:function(e,t){var n=e.dom();Ya(n,t),Wn.has(e,"style")&&""===Wn.get(e,"style").replace(/^\s+|\s+$/g,"")&&Wn.remove(e,"style")},get:function(e,t){var n=e.dom(),o=window.getComputedStyle(n).getPropertyValue(t),r=""!==o||ho.inBody(e)?o:qa(n,t);return null===r?undefined:r},getRaw:Ka,getAllRaw:function(e){var t={},n=e.dom();if(Ga(n))for(var o=0;o<n.style.length;o++){var r=n.style.item(o);t[r]=n.style[r]}return t},isValidValue:function(e,t,n){var o=$t.fromTag(e);return $a(o,t,n),Ka(o,t).isSome()},reflow:function(e){return e.dom().offsetWidth},transfer:function(o,r,e){Ln.isElement(o)&&Ln.isElement(r)&&A(e,function(e){var t,n;t=r,Ka(o,n=e).each(function(e){Ka(t,n).isNone()&&$a(t,n,e)})})}};function Qa(o,r){var e=function(e){var t=r(e);if(t<=0||null===t){var n=Ja.get(e,o);return parseFloat(n)||0}return t},i=function(r,e){return R(e,function(e,t){var n=Ja.get(r,t),o=n===undefined?0:parseInt(n,10);return isNaN(o)?e:e+o},0)};return{set:function(e,t){if(!O(t)&&!t.match(/^[0-9]+$/))throw o+".set accepts only positive integer values. Value was "+t;var n=e.dom();Ga(n)&&(n.style[o]=t+"px")},get:e,getOuter:e,aggregate:i,max:function(e,t,n){var o=i(e,n);return o<t?t-o:0}}}var Za=Qa("height",function(e){var t=e.dom();return ho.inBody(e)?t.getBoundingClientRect().height:t.offsetHeight}),eu=function(e){return Za.get(e)},tu=function(e){return Za.getOuter(e)},nu=function(e,t){var n=Za.max(e,t,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Ja.set(e,"max-height",n+"px")},ou=function(e,t,n){return B(xn.parents(e,n),t)},ru=function(e,t){return B(xn.siblings(e),t)},iu=function(e){return fn.all(e)},au=function(e,t,n){return ou(e,function(e){return fn.is(e,t)},n)},uu=function(e,t){return ru(e,function(e){return fn.is(e,t)})},cu=function(e,t){return fn.all(t,e)},su=function(e,t,n){return jr.ancestor(e,function(e){return fn.is(e,t)},n)},lu=function(e){return fn.one(e)},fu=su,du=function(e,t){return fn.one(t,e)},mu=function(e,t,n){return Ir(fn.is,su,e,t,n)},gu=function(e,t,n){var o=Y(e.slice(0,t)),r=Y(e.slice(t+1));return F(o.concat(r),n)},hu=function(e,t,n){var o=Y(e.slice(0,t));return F(o,n)},vu=function(e,t,n){var o=e.slice(0,t),r=e.slice(t+1);return F(r.concat(o),n)},pu=function(e,t,n){var o=e.slice(t+1);return F(o,n)},bu=function(n){return function(e){var t=e.raw();return M(n,t.which)}},yu=function(e){return function(t){return G(e,function(e){return e(t)})}},xu=function(e){return!0===e.raw().shiftKey},wu=function(e){return!0===e.raw().ctrlKey},ku=k(xu),Su=function(e,t){return{matches:e,classification:t}},Cu=function(e,t,n,o){var r=e+t;return o<r?n:r<n?o:r},zu=function(e,t,n){return e<=t?t:n<=e?n:e},Ou=function(t,n,e){var o=cu(t.element(),"."+n.highlightClass());A(o,function(e){ji.remove(e,n.highlightClass()),t.getSystem().getByDom(e).each(function(e){n.onDehighlight()(t,e)})})},Tu=function(e,t,n,o){var r=Mu(e,t,n,o);Ou(e,t),ji.add(o.element(),t.highlightClass()),r||t.onHighlight()(e,o)},Mu=function(e,t,n,o){return ji.has(o.element(),t.highlightClass())},Hu=function(e,t,n,o){var r=cu(e.element(),"."+t.itemClass());return P.from(r[o]).fold(function(){return ie.error("No element found with index "+o)},e.getSystem().getByDom)},Eu=function(t,e,n){return du(t.element(),"."+e.itemClass()).bind(function(e){return t.getSystem().getByDom(e).toOption()})},Vu=function(t,e,n){var o=cu(t.element(),"."+e.itemClass());return(0<o.length?P.some(o[o.length-1]):P.none()).bind(function(e){return t.getSystem().getByDom(e).toOption()})},Au=function(n,t,e,o){var r=cu(n.element(),"."+t.itemClass());return I(r,function(e){return ji.has(e,t.highlightClass())}).bind(function(e){var t=Cu(e,o,0,r.length-1);return n.getSystem().getByDom(r[t]).toOption()})},Bu=function(t,e,n){var o=cu(t.element(),"."+e.itemClass());return Ae(V(o,function(e){return t.getSystem().getByDom(e).toOption()}))},Du=Object.freeze({dehighlightAll:Ou,dehighlight:function(e,t,n,o){var r=Mu(e,t,n,o);ji.remove(o.element(),t.highlightClass()),r&&t.onDehighlight()(e,o)},highlight:Tu,highlightFirst:function(t,n,o){Eu(t,n,o).each(function(e){Tu(t,n,o,e)})},highlightLast:function(t,n,o){Vu(t,n,o).each(function(e){Tu(t,n,o,e)})},highlightAt:function(t,n,o,e){Hu(t,n,o,e).fold(function(e){throw new Error(e)},function(e){Tu(t,n,o,e)})},highlightBy:function(t,n,o,e){var r=Bu(t,n,o);F(r,e).each(function(e){Tu(t,n,o,e)})},isHighlighted:Mu,getHighlighted:function(t,e,n){return du(t.element(),"."+e.highlightClass()).bind(function(e){return t.getSystem().getByDom(e).toOption()})},getFirst:Eu,getLast:Vu,getPrevious:function(e,t,n){return Au(e,t,0,-1)},getNext:function(e,t,n){return Au(e,t,0,1)},getCandidates:Bu}),Ru=[hr("highlightClass"),hr("itemClass"),ma("onHighlight"),ma("onDehighlight")],Fu=Ci({fields:Ru,name:"highlighting",apis:Du}),Iu=function(e,t,n){t.exists(function(t){return n.exists(function(e){return mn(e,t)})})||uo(e,Ut(),{prevFocus:t,newFocus:n})},_u=function(){var r=function(e){return ea(e.element())};return{get:r,set:function(e,t){var n=r(e);e.getSystem().triggerFocus(t,e.element());var o=r(e);Iu(e,n,o)}}},Lu=function(){var r=function(e){return Fu.getHighlighted(e).map(function(e){return e.element()})};return{get:r,set:function(t,e){var n=r(t);t.getSystem().getByDom(e).fold(N,function(e){Fu.highlight(t,e)});var o=r(t);Iu(t,n,o)}}},Nu=function(e,t,n,i,a){var u=function(t,n,e,o,r){var i,a,u=e(t,n,o,r);return(i=u,a=n.event(),F(i,function(e){return e.matches(a)}).map(function(e){return e.classification})).bind(function(e){return e(t,n,o,r)})},o={schema:function(){return e.concat([Tr("focusManager",_u()),pa("handler",o),pa("state",t)])},processKey:u,toEvents:function(o,r){return Wr(a.map(function(n){return Yr(Mt(),function(e,t){n(e,o,r,t),t.stop()})}).toArray().concat([Yr(Xe(),function(e,t){u(e,t,n,o,r).each(function(e){t.stop()})}),Yr(Ye(),function(e,t){u(e,t,i,o,r).each(function(e){t.stop()})})]))}};return o},Pu=function(e){var t=[kr("onEscape"),kr("onEnter"),Tr("selector",'[data-alloy-tabstop="true"]'),Tr("firstTabstop",0),Tr("useTabstopAt",U(!0)),kr("visibilitySelector")].concat([e]),a=function(e,t){var n=e.visibilitySelector().bind(function(e){return mu(t,e)}).getOr(t);return 0<eu(n)},u=function(t,e,n,o,r){return r(e,n,function(e){return a(t=o,n=e)&&t.useTabstopAt()(n);var t,n}).fold(function(){return o.cyclic()?P.some(!0):P.none()},function(e){return o.focusManager().set(t,e),P.some(!0)})},i=function(t,e,n,o){var r,i,a=cu(t.element(),n.selector());return(r=t,i=n,i.focusManager().get(r).bind(function(e){return mu(e,i.selector())})).bind(function(e){return I(a,f(mn,e)).bind(function(e){return u(t,a,e,n,o)})})},n=U([Su(yu([xu,bu([9])]),function(e,t,n,o){var r=n.cyclic()?gu:hu;return i(e,0,n,r)}),Su(bu([9]),function(e,t,n,o){var r=n.cyclic()?vu:pu;return i(e,0,n,r)}),Su(bu([27]),function(t,n,e,o){return e.onEscape().bind(function(e){return e(t,n)})}),Su(yu([ku,bu([13])]),function(t,n,e,o){return e.onEnter().bind(function(e){return e(t,n)})})]),o=U([]);return Nu(t,xi.init,n,o,P.some(function(t,n){var e,o,r,i;(e=t,o=n,r=cu(e.element(),o.selector()),i=B(r,function(e){return a(o,e)}),P.from(i[o.firstTabstop()])).each(function(e){n.focusManager().set(t,e)})}))},ju=Pu(Dr("cyclic",U(!1))),Uu=Pu(Dr("cyclic",U(!0))),Wu=function(e){return"input"===Ln.name(e)&&"radio"!==Wn.get(e,"type")||"textarea"===Ln.name(e)},Gu=function(e,t,n){return Wu(n)&&bu([32])(t.event())?P.none():(so(e,n,Vt()),P.some(!0))},Xu=function(e,t){return P.some(!0)},Yu=[Tr("execute",Gu),Tr("useSpace",!1),Tr("useEnter",!0),Tr("useControlEnter",!1),Tr("useDown",!1)],$u=function(e,t,n){return n.execute()(e,t,e.element())},qu=Nu(Yu,xi.init,function(e,t,n,o){var r=n.useSpace()&&!Wu(e.element())?[32]:[],i=n.useEnter()?[13]:[],a=n.useDown()?[40]:[],u=r.concat(i).concat(a);return[Su(bu(u),$u)].concat(n.useControlEnter()?[Su(yu([wu,bu([13])]),$u)]:[])},function(e,t,n,o){return n.useSpace()&&!Wu(e.element())?[Su(bu([32]),Xu)]:[]},P.none()),Ku=function(e){var n=Ve(P.none());return wi({readState:function(){return n.get().map(function(e){return{numRows:e.numRows(),numColumns:e.numColumns()}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,t){n.set(P.some({numRows:U(e),numColumns:U(t)}))},getNumRows:function(){return n.get().map(function(e){return e.numRows()})},getNumColumns:function(){return n.get().map(function(e){return e.numColumns()})}})},Ju=Object.freeze({flatgrid:Ku,init:function(e){return e.state()(e)}}),Qu=function(e){return"rtl"===Ja.get(e,"direction")?"rtl":"ltr"},Zu=function(t,n){return function(e){return"rtl"===Qu(e)?n:t}},ec=function(i){return function(e,t,n,o){var r=i(e.element());return rc(r,e,t,n,o)}},tc=function(e,t){var n=Zu(e,t);return ec(n)},nc=function(e,t){var n=Zu(t,e);return ec(n)},oc=function(r){return function(e,t,n,o){return rc(r,e,t,n,o)}},rc=function(t,n,e,o,r){return o.focusManager().get(n).bind(function(e){return t(n.element(),e,o,r)}).map(function(e){return o.focusManager().set(n,e),!0})},ic=oc,ac=oc,uc=oc,cc=function(e){var t,n=e.dom();return!((t=n).offsetWidth<=0&&t.offsetHeight<=0)},sc=tn(["index","candidates"],[]),lc=function(e,t,n){return fc(e,t,n,cc)},fc=function(e,t,n,o){var r,i=f(mn,t),a=cu(e,n),u=B(a,cc);return I(r=u,i).map(function(e){return sc({index:e,candidates:r})})},dc=function(e,t){return I(e,function(e){return mn(t,e)})},mc=function(n,e,o,t){return t(Math.floor(e/o),e%o).bind(function(e){var t=e.row()*o+e.column();return 0<=t&&t<n.length?P.some(n[t]):P.none()})},gc=function(r,e,i,a,u){return mc(r,e,a,function(e,t){var n=e===i-1?r.length-e*a:a,o=Cu(t,u,0,n-1);return P.some({row:U(e),column:U(o)})})},hc=function(i,e,a,u,c){return mc(i,e,u,function(e,t){var n=Cu(e,c,0,a-1),o=n===a-1?i.length-n*u:u,r=zu(t,0,o-1);return P.some({row:U(n),column:U(r)})})},vc=[hr("selector"),Tr("execute",Gu),ga("onEscape"),Tr("captureTab",!1),ya()],pc=function(r){return function(e,t,n,o){return lc(e,t,n.selector()).bind(function(e){return r(e.candidates(),e.index(),o.getNumRows().getOr(n.initSize().numRows()),o.getNumColumns().getOr(n.initSize().numColumns()))})}},bc=function(e,t,n,o){return n.captureTab()?P.some(!0):P.none()},yc=pc(function(e,t,n,o){return gc(e,t,n,o,-1)}),xc=pc(function(e,t,n,o){return gc(e,t,n,o,1)}),wc=pc(function(e,t,n,o){return hc(e,t,n,o,-1)}),kc=pc(function(e,t,n,o){return hc(e,t,n,o,1)}),Sc=U([Su(bu([37]),tc(yc,xc)),Su(bu([39]),nc(yc,xc)),Su(bu([38]),ic(wc)),Su(bu([40]),ac(kc)),Su(yu([xu,bu([9])]),bc),Su(yu([ku,bu([9])]),bc),Su(bu([27]),function(e,t,n,o){return n.onEscape()(e,t)}),Su(bu([32].concat([13])),function(t,n,o,e){return(r=t,i=o,i.focusManager().get(r).bind(function(e){return mu(e,i.selector())})).bind(function(e){return o.execute()(t,n,e)});var r,i})]),Cc=U([Su(bu([32]),Xu)]),zc=Nu(vc,Ku,Sc,Cc,P.some(function(t,n,e){du(t.element(),n.selector()).each(function(e){n.focusManager().set(t,e)})})),Oc=function(e,t,n,i){var a=function(e,t,n){var o,r=Cu(t,i,0,n.length-1);return r===e?P.none():(o=n[r],"button"===Ln.name(o)&&"disabled"===Wn.get(o,"disabled")?a(e,r,n):P.from(n[r]))};return lc(e,n,t).bind(function(e){var t=e.index(),n=e.candidates();return a(t,t,n)})},Tc=[hr("selector"),Tr("getInitial",P.none),Tr("execute",Gu),ga("onEscape"),Tr("executeOnMove",!1),Tr("allowVertical",!0)],Mc=function(t,n,o){return(e=t,r=o,r.focusManager().get(e).bind(function(e){return mu(e,r.selector())})).bind(function(e){return o.execute()(t,n,e)});var e,r},Hc=function(e,t,n){return Oc(e,n.selector(),t,-1)},Ec=function(e,t,n){return Oc(e,n.selector(),t,1)},Vc=function(o){return function(e,t,n){return o(e,t,n).bind(function(){return n.executeOnMove()?Mc(e,t,n):P.some(!0)})}},Ac=function(e,t,n,o){return n.onEscape()(e,t)},Bc=U([Su(bu([32]),Xu)]),Dc=Nu(Tc,xi.init,function(e,t,n,o){var r=[37].concat(n.allowVertical()?[38]:[]),i=[39].concat(n.allowVertical()?[40]:[]);return[Su(bu(r),Vc(tc(Hc,Ec))),Su(bu(i),Vc(nc(Hc,Ec))),Su(bu([13]),Mc),Su(bu([32]),Mc),Su(bu([27]),Ac)]},Bc,P.some(function(t,n){n.getInitial()(t).or(du(t.element(),n.selector())).each(function(e){n.focusManager().set(t,e)})})),Rc=tn(["rowIndex","columnIndex","cell"],[]),Fc=function(e,t,n){return P.from(e[t]).bind(function(e){return P.from(e[n]).map(function(e){return Rc({rowIndex:t,columnIndex:n,cell:e})})})},Ic=function(e,t,n,o){var r=e[t].length,i=Cu(n,o,0,r-1);return Fc(e,t,i)},_c=function(e,t,n,o){var r=Cu(n,o,0,e.length-1),i=e[r].length,a=zu(t,0,i-1);return Fc(e,r,a)},Lc=function(e,t,n,o){var r=e[t].length,i=zu(n+o,0,r-1);return Fc(e,t,i)},Nc=function(e,t,n,o){var r=zu(n+o,0,e.length-1),i=e[r].length,a=zu(t,0,i-1);return Fc(e,r,a)},Pc=[yr("selectors",[hr("row"),hr("cell")]),Tr("cycles",!0),Tr("previousSelector",P.none),Tr("execute",Gu)],jc=function(e,t){return function(n,o,i){var a=i.cycles()?e:t;return mu(o,i.selectors().row()).bind(function(e){var t=cu(e,i.selectors().cell());return dc(t,o).bind(function(o){var r=cu(n,i.selectors().row());return dc(r,e).bind(function(e){var t,n=(t=i,V(r,function(e){return cu(e,t.selectors().cell())}));return a(n,e,o).map(function(e){return e.cell()})})})})}},Uc=jc(function(e,t,n){return Ic(e,t,n,-1)},function(e,t,n){return Lc(e,t,n,-1)}),Wc=jc(function(e,t,n){return Ic(e,t,n,1)},function(e,t,n){return Lc(e,t,n,1)}),Gc=jc(function(e,t,n){return _c(e,n,t,-1)},function(e,t,n){return Nc(e,n,t,-1)}),Xc=jc(function(e,t,n){return _c(e,n,t,1)},function(e,t,n){return Nc(e,n,t,1)}),Yc=U([Su(bu([37]),tc(Uc,Wc)),Su(bu([39]),nc(Uc,Wc)),Su(bu([38]),ic(Gc)),Su(bu([40]),ac(Xc)),Su(bu([32].concat([13])),function(t,n,o){return ea(t.element()).bind(function(e){return o.execute()(t,n,e)})})]),$c=U([Su(bu([32]),Xu)]),qc=Nu(Pc,xi.init,Yc,$c,P.some(function(t,n){n.previousSelector()(t).orThunk(function(){var e=n.selectors();return du(t.element(),e.cell())}).each(function(e){n.focusManager().set(t,e)})})),Kc=[hr("selector"),Tr("execute",Gu),Tr("moveOnTab",!1)],Jc=function(t,n,o){return o.focusManager().get(t).bind(function(e){return o.execute()(t,n,e)})},Qc=function(e,t,n){return Oc(e,n.selector(),t,-1)},Zc=function(e,t,n){return Oc(e,n.selector(),t,1)},es=U([Su(bu([38]),uc(Qc)),Su(bu([40]),uc(Zc)),Su(yu([xu,bu([9])]),function(e,t,n){return n.moveOnTab()?uc(Qc)(e,t,n):P.none()}),Su(yu([ku,bu([9])]),function(e,t,n){return n.moveOnTab()?uc(Zc)(e,t,n):P.none()}),Su(bu([13]),Jc),Su(bu([32]),Jc)]),ts=U([Su(bu([32]),Xu)]),ns=Nu(Kc,xi.init,es,ts,P.some(function(t,n){du(t.element(),n.selector()).each(function(e){n.focusManager().set(t,e)})})),os=[ga("onSpace"),ga("onEnter"),ga("onShiftEnter"),ga("onLeft"),ga("onRight"),ga("onTab"),ga("onShiftTab"),ga("onUp"),ga("onDown"),ga("onEscape"),Tr("stopSpaceKeyup",!1),kr("focusIn")],rs=Nu(os,xi.init,function(e,t,n){return[Su(bu([32]),n.onSpace()),Su(yu([ku,bu([13])]),n.onEnter()),Su(yu([xu,bu([13])]),n.onShiftEnter()),Su(yu([xu,bu([9])]),n.onShiftTab()),Su(yu([ku,bu([9])]),n.onTab()),Su(bu([38]),n.onUp()),Su(bu([40]),n.onDown()),Su(bu([37]),n.onLeft()),Su(bu([39]),n.onRight()),Su(bu([32]),n.onSpace()),Su(bu([27]),n.onEscape())]},function(e,t,n){return n.stopSpaceKeyup()?[Su(bu([32]),Xu)]:[]},P.some(function(t,n){return n.focusIn().bind(function(e){return e(t,n)})})),is=ju.schema(),as=Uu.schema(),us=Dc.schema(),cs=zc.schema(),ss=qc.schema(),ls=qu.schema(),fs=ns.schema(),ds=rs.schema(),ms=Oi({branchKey:"mode",branches:Object.freeze({acyclic:is,cyclic:as,flow:us,flatgrid:cs,matrix:ss,execution:ls,menu:fs,special:ds}),name:"keying",active:{events:function(e,t){return e.handler().toEvents(e,t)}},apis:{focusIn:function(e){e.getSystem().triggerFocus(e.element(),e.element())},setGridSize:function(e,t,n,o,r){Ee(n,"setGridSize")?n.setGridSize(o,r):console.error("Layout does not support setGridSize")}},state:Ju}),gs=function(o,e){return Br(o,{},V(e,function(e){return t=e.name(),n="Cannot configure "+e.name()+" for "+o,Ko(t,t,Ho(),jo(function(e){return ie.error("The field: "+t+" is forbidden. "+n)}));var t,n}).concat([Dr("dump",b)]))},hs=function(e){return e.dump()},vs=gs,ps=hs,bs="placeholder",ys=ge([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),xs=function(e,t,n,o){return n.uiType===bs?(i=n,a=o,(r=e).exists(function(e){return e!==i.owner})?ys.single(!0,U(i)):Oe(a,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+ae(a)+"]\nNamespace: "+r.getOr("none")+"\nSpec: "+Ro(i,null,2))},function(e){return e.replace()})):ys.single(!1,U(n));var r,i,a},ws=function(i,a,u,c){return xs(i,0,u,c).fold(function(e,t){var n=t(a,u.config,u.validated),o=Oe(n,"components").getOr([]),r=W(o,function(e){return ws(i,a,e,c)});return[te(n,{components:r})]},function(e,t){var n=t(a,u.config,u.validated);return u.validated.preprocess.getOr(b)(n)})},ks=function(t,n,e,o){var r,i,a,u=se(o,function(e,t){return o=e,r=!1,{name:U(n=t),required:function(){return o.fold(function(e,t){return e},function(e,t){return e})},used:function(){return r},replace:function(){if(!0===r)throw new Error("Trying to use the same placeholder more than once: "+n);return r=!0,o}};var n,o,r}),c=(r=t,i=n,a=u,W(e,function(e){return ws(r,i,e,a)}));return ce(u,function(e){if(!1===e.used()&&e.required())throw new Error("Placeholder: "+e.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+Ro(n.components(),null,2))}),c},Ss=ys.single,Cs=ys.multiple,zs=U(bs),Os=ge([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Ts=Tr("factory",{sketch:b}),Ms=Tr("schema",[]),Hs=hr("name"),Es=Ko("pname","pname",Eo(function(e){return"<alloy."+ro(e.name)+">"}),sr()),Vs=Dr("schema",function(){return[kr("preprocess")]}),As=Tr("defaults",U({})),Bs=Tr("overrides",U({})),Ds=Wo([Ts,Ms,Hs,Es,As,Bs]),Rs=Wo([Ts,Ms,Hs,As,Bs]),Fs=Wo([Ts,Ms,Hs,Es,As,Bs]),Is=Wo([Ts,Vs,Hs,hr("unit"),Es,As,Bs]),_s=function(e){return e.fold(P.some,P.none,P.some,P.some)},Ls=function(e){var t=function(e){return e.name()};return e.fold(t,t,t,t)},Ns=function(n,o){return function(e){var t=ar("Converting part type",o,e);return n(t)}},Ps=Ns(Os.required,Ds),js=Ns(Os.external,Rs),Us=Ns(Os.optional,Fs),Ws=Ns(Os.group,Is),Gs=U("entirety"),Xs=Object.freeze({required:Ps,external:js,optional:Us,group:Ws,asNamedPart:_s,name:Ls,asCommon:function(e){return e.fold(b,b,b,b)},original:Gs}),Ys=function(e,t,n,o){var r=n;return te(t.defaults()(e,n,o),n,{uid:e.partUids()[t.name()]},t.overrides()(e,n,o),{"debug.sketcher":Te("part-"+t.name(),r)})},$s=function(r,e){var t={};return A(e,function(e){_s(e).each(function(n){var o=qs(r,n.pname());t[n.name()]=function(e){var t=ir("Part: "+n.name()+" in "+r,Wo(n.schema()),e);return te(o,{config:e,validated:t})}})}),t},qs=function(e,t){return{uiType:zs(),owner:e,name:t}},Ks=function(e,t,n){return{uiType:zs(),owner:e,name:t,config:n,validated:{}}},Js=function(e){return W(e,function(e){return e.fold(P.none,P.some,P.none,P.none).map(function(e){return yr(e.name(),e.schema().concat([ba(Gs())]))}).toArray()})},Qs=function(e){return V(e,Ls)},Zs=function(e,t,n){return o=t,i={},r={},A(n,function(e){e.fold(function(o){i[o.pname()]=Ss(!0,function(e,t,n){return o.factory().sketch(Ys(e,o,t,n))})},function(e){var t=o.parts()[e.name()]();r[e.name()]=U(e.factory().sketch(Ys(o,e,t[Gs()]()),t))},function(o){i[o.pname()]=Ss(!1,function(e,t,n){return o.factory().sketch(Ys(e,o,t,n))})},function(r){i[r.pname()]=Cs(!0,function(t,e,n){var o=t[r.name()]();return V(o,function(e){return r.factory().sketch(te(r.defaults()(t,e),e,r.overrides()(t,e)))})})})}),{internals:U(i),externals:U(r)};var o,i,r},el=function(e,t,n){return ks(P.some(e),t,t.components(),n)},tl=function(e,t,n){var o=t.partUids()[n];return e.getSystem().getByUid(o).toOption()},nl=function(e,t,n){return tl(e,t,n).getOrDie("Could not find part: "+n)},ol=function(e,t,n){var o={},r=t.partUids(),i=e.getSystem();return A(n,function(e){o[e]=i.getByUid(r[e])}),se(o,U)},rl=function(e,t){var n=e.getSystem();return se(t.partUids(),function(e,t){return U(n.getByUid(e))})},il=function(e){return ae(e.partUids())},al=function(e,t,n){var o={},r=t.partUids(),i=e.getSystem();return A(n,function(e){o[e]=i.getByUid(r[e]).getOrDie()}),se(o,U)},ul=function(t,e){var n=Qs(e);return Me(V(n,function(e){return{key:e,value:t+"-"+e}}))},cl=function(t){return Ko("partUids","partUids",Vo(function(e){return ul(e.uid,t)}),sr())},sl=Object.freeze({generate:$s,generateOne:Ks,schemas:Js,names:Qs,substitutes:Zs,components:el,defaultUids:ul,defaultUidsSchema:cl,getAllParts:rl,getAllPartNames:il,getPart:tl,getPartOrDie:nl,getParts:ol,getPartsOrDie:al}),ll=ro("alloy-premade"),fl=ro("api"),dl=function(e){return Te(ll,e)},ml=function(r){return e=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=e.config(fl);return r.apply(undefined,[o].concat([e].concat(t)))},t=r.toString(),n=t.indexOf(")")+1,o=t.indexOf("("),i=t.substring(o+1,n-1).split(/,\s*/),e.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ii(i.slice(1))}},e;var e,t,n,o,i},gl=U(fl),hl=U("alloy-id-"),vl=U("data-alloy-id"),pl=hl(),bl=vl(),yl=function(e,t){Object.defineProperty(e.dom(),bl,{value:t,writable:!0})},xl=function(e){var t=Ln.isElement(e)?e.dom()[bl]:null;return P.from(t)},wl=function(e){return ro(e)},kl=function(e,t,n,o,r){var i,a,u=(a=r,(0<(i=o).length?[yr("parts",i)]:[]).concat([hr("uid"),Tr("dom",{}),Tr("components",[]),ba("originalSpec"),Tr("debug.sketcher",{})]).concat(a));return ar(e+" [SpecSchema]",Uo(u.concat(t)),n)},Sl=function(e,t,n,o,r){var i=Cl(r),a=Js(n),u=cl(n),c=kl(e,t,i,a,[u]),s=Zs(0,c,n),l=el(e,c,s.internals());return te(o(c,l,i,s.externals()),{"debug.sketcher":Te(e,r)})},Cl=function(e){return te({uid:wl("uid")},e)},zl=Uo([hr("name"),hr("factory"),hr("configFields"),Tr("apis",{}),Tr("extraApis",{})]),Ol=Uo([hr("name"),hr("factory"),hr("configFields"),hr("partFields"),Tr("apis",{}),Tr("extraApis",{})]),Tl=function(e){var u=ir("Sketcher for "+e.name,zl,e),t=se(u.apis,ml),n=se(u.extraApis,function(e,t){return ai(e,t)});return te({name:U(u.name),partFields:U([]),configFields:U(u.configFields),sketch:function(e){return t=u.name,n=u.configFields,o=u.factory,i=Cl(r=e),a=kl(t,n,i,[],[]),te(o(a,i),{"debug.sketcher":Te(t,r)});var t,n,o,r,i,a}},t,n)},Ml=function(e){var t=ir("Sketcher for "+e.name,Ol,e),n=$s(t.name,t.partFields),o=se(t.apis,ml),r=se(t.extraApis,function(e,t){return ai(e,t)});return te({name:U(t.name),partFields:U(t.partFields),configFields:U(t.configFields),sketch:function(e){return Sl(t.name,t.configFields,t.partFields,t.factory,e)},parts:U(n)},o,r)},Hl=Tl({name:"Button",factory:function(e){var t=La(e.action()),n=Oe(e.dom(),"attributes").bind(Ce("type")),o=Oe(e.dom(),"tag");return{uid:e.uid(),dom:e.dom(),components:e.components(),events:t,behaviours:te(ki([Wa.config({}),ms.config({mode:"execution",useSpace:!0,useEnter:!0})]),hs(e.buttonBehaviours())),domModification:{attributes:te(n.fold(function(){return o.is("button")?{type:"button"}:{}},function(e){return{}}),{role:e.role().getOr("button")})},eventOrder:e.eventOrder()}},configFields:[Tr("uid",undefined),hr("dom"),Tr("components",[]),gs("buttonBehaviours",[Wa,ms]),kr("action"),kr("role"),Tr("eventOrder",{})]}),El=Object.freeze({events:function(e){return Wr([Gr(Qe(),U(!0))])},exhibit:function(e,t){return si({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),Vl=Ci({fields:[],name:"unselecting",active:El}),Al=function(e){var t,n,o,r=$t.fromHtml(e),i=xn.children(r),a=(n=(t=r).dom().attributes!==undefined?t.dom().attributes:[],R(n,function(e,t){return"class"===t.name?e:te(e,Te(t.name,t.value))},{})),u=(o=r,Array.prototype.slice.call(o.dom().classList,0)),c=0===i.length?{}:{innerHtml:En(r)};return te({tag:Ln.name(r),classes:u,attributes:a},c)},Bl=function(e){var t,r,n=(t=e,r={prefix:_a.prefix()},t.replace(/\$\{([^{}]*)\}/g,function(e,t){var n,o=r[t];return"string"==(n=typeof o)||"number"===n?o.toString():e}));return Al(n)},Dl=function(e){return{dom:Bl(e)}},Rl=function(e){return ki([Ba.config({toggleClass:_a.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Da(e,function(e,t){(t?Ba.on:Ba.off)(e)})])},Fl=function(e,t,n){return Hl.sketch({dom:Bl('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item ${prefix}-icon-'+e+' ${prefix}-icon"></span>'),action:t,buttonBehaviours:te(ki([Vl.config({})]),n)})},Il={forToolbar:Fl,forToolbarCommand:function(e,t){return Fl(t,function(){e.execCommand(t)},{})},forToolbarStateAction:function(e,t,n,o){var r=Rl(n);return Fl(t,o,r)},forToolbarStateCommand:function(e,t){var n=Rl(t);return Fl(t,function(){e.execCommand(t)},n)}},_l=Ot.detect().deviceType.isTouch(),Ll=function(e){return Us({name:e+"-edge",overrides:function(o){return o.model().manager().edgeActions()[e].fold(function(){return{}},function(n){var e=Wr([$r(Re(),n,[o])]),t=Wr([$r(Le(),n,[o]),$r(Ne(),function(e,t){t.mouseIsDown().get()&&n(e,t)},[o])]);return{events:_l?e:t}})}})},Nl=Ll("top-left"),Pl=Ll("top"),jl=Ll("top-right"),Ul=Ll("right"),Wl=Ll("bottom-right"),Gl=Ll("bottom"),Xl=Ll("bottom-left"),Yl=[Ll("left"),Ul,Pl,Gl,Nl,jl,Xl,Wl,Ps({name:"thumb",defaults:U({dom:{styles:{position:"absolute"}}}),overrides:function(e){return{events:Wr([Kr(Re(),e,"spectrum"),Kr(Fe(),e,"spectrum"),Kr(Ie(),e,"spectrum"),Kr(Le(),e,"spectrum"),Kr(Ne(),e,"spectrum"),Kr(je(),e,"spectrum")])}}}),Ps({schema:[Dr("mouseIsDown",function(){return Ve(!1)})],name:"spectrum",overrides:function(n){var o=n.model().manager(),r=function(t,e){return o.getValueFromEvent(e).map(function(e){return o.setValueFrom(t,n,e)})},e=Wr([Yr(Re(),r),Yr(Fe(),r)]),t=Wr([Yr(Le(),r),Yr(Ne(),function(e,t){n.mouseIsDown().get()&&r(e,t)})]);return{behaviours:ki(_l?[]:[ms.config({mode:"special",onLeft:function(e){return o.onLeft(e,n)},onRight:function(e){return o.onRight(e,n)},onUp:function(e){return o.onUp(e,n)},onDown:function(e){return o.onDown(e,n)}}),Wa.config({})]),events:_l?e:t}}})],$l=function(e,t,n){t.store().manager().onLoad(e,t,n)},ql=function(e,t,n){t.store().manager().onUnload(e,t,n)},Kl=Object.freeze({onLoad:$l,onUnload:ql,setValue:function(e,t,n,o){t.store().manager().setValue(e,t,n,o)},getValue:function(e,t,n){return t.store().manager().getValue(e,t,n)},getState:function(e,t,n){return n}}),Jl=Object.freeze({events:function(n,o){var e=n.resetOnDom()?[ti(function(e,t){$l(e,n,o)}),ni(function(e,t){ql(e,n,o)})]:[fi(n,o,$l)];return Wr(e)}}),Ql=function(){var e=Ve(null);return wi({set:e.set,get:e.get,isNotSet:function(){return null===e.get()},clear:function(){e.set(null)},readState:function(){return{mode:"memory",value:e.get()}}})},Zl=function(){var i=Ve({}),a=Ve({});return wi({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:a.get()}},lookup:function(e){return Oe(i.get(),e).orThunk(function(){return Oe(a.get(),e)})},update:function(e){var t=i.get(),n=a.get(),o={},r={};A(e,function(t){o[t.value]=t,Oe(t,"meta").each(function(e){Oe(e,"text").each(function(e){r[e]=t})})}),i.set(te(t,o)),a.set(te(n,r))},clear:function(){i.set({}),a.set({})}})},ef=Object.freeze({memory:Ql,dataset:Zl,manual:function(){return wi({readState:function(){}})},init:function(e){return e.store().manager().state(e)}}),tf=function(e,t,n,o){var r=t.store();n.update([o]),r.setValue()(e,o),t.onSetValue()(e,o)},nf=[kr("initialValue"),hr("getFallbackEntry"),hr("getDataKey"),hr("setValue"),pa("manager",{setValue:tf,getValue:function(e,t,n){var o=t.store(),r=o.getDataKey()(e);return n.lookup(r).fold(function(){return o.getFallbackEntry()(r)},function(e){return e})},onLoad:function(t,n,o){n.store().initialValue().each(function(e){tf(t,n,o,e)})},onUnload:function(e,t,n){n.clear()},state:Zl})],of=[hr("getValue"),Tr("setValue",N),kr("initialValue"),pa("manager",{setValue:function(e,t,n,o){t.store().setValue()(e,o),t.onSetValue()(e,o)},getValue:function(e,t,n){return t.store().getValue()(e)},onLoad:function(t,n,e){n.store().initialValue().each(function(e){n.store().setValue()(t,e)})},onUnload:N,state:xi.init})],rf=[kr("initialValue"),pa("manager",{setValue:function(e,t,n,o){n.set(o),t.onSetValue()(e,o)},getValue:function(e,t,n){return n.get()},onLoad:function(e,t,n){t.store().initialValue().each(function(e){n.isNotSet()&&n.set(e)})},onUnload:function(e,t,n){n.clear()},state:Ql})],af=[Mr("store",{mode:"memory"},cr("mode",{memory:rf,manual:of,dataset:nf})),ma("onSetValue"),Tr("resetOnDom",!1)],uf=Ci({fields:af,name:"representing",active:Jl,apis:Kl,extra:{setValueFrom:function(e,t){var n=uf.getValue(t);uf.setValue(e,n)}},state:ef}),cf=function(n,o){return{left:U(n),top:U(o),translate:function(e,t){return cf(n+e,o+t)}}},sf=cf,lf=Ot.detect().deviceType.isTouch(),ff=U("slider.change.value"),df=function(e){var t=e.event().raw();if(lf){var n=t;return n.touches!==undefined&&1===n.touches.length?P.some(n.touches[0]).map(function(e){return sf(e.clientX,e.clientY)}):P.none()}var o=t;return o.clientX!==undefined?P.some(o).map(function(e){return sf(e.clientX,e.clientY)}):P.none()},mf=function(e,t,n,o){return e<t?e:n<e?n:e===t?t-1:Math.max(t,e-o)},gf=function(e,t,n,o){return n<e?e:e<t?t:e===n?n+1:Math.min(n,e+o)},hf=function(e,t,n){return Math.max(t,Math.min(n,e))},vf=function(e){var t=e.min,n=e.max,o=e.range,r=e.value,i=e.step,a=e.snap,u=e.snapStart,c=e.rounded,s=e.hasMinEdge,l=e.hasMaxEdge,f=e.minBound,d=e.maxBound,m=e.screenRange,g=s?t-1:t,h=l?n+1:n;if(r<f)return g;if(d<r)return h;var v,p,b,y,x,w,k,S=(x=r,w=f,k=d,Math.min(k,Math.max(x,w))-w),C=hf(S/m*o+t,g,h);return a&&t<=C&&C<=n?(v=C,p=t,b=n,y=i,u.fold(function(){var e=v-p,t=Math.round(e/y)*y;return hf(p+t,p-1,b+1)},function(e){var t=(v-e)%y,n=Math.round(t/y),o=Math.floor((v-e)/y),r=Math.floor((b-e)/y),i=e+Math.min(r,o+n)*y;return Math.max(e,i)})):c?Math.round(C):C},pf=function(e){var t=e.min,n=e.max,o=e.range,r=e.value,i=e.hasMinEdge,a=e.hasMaxEdge,u=e.maxBound,c=e.maxOffset,s=e.centerMinEdge,l=e.centerMaxEdge;return r<t?i?0:s:n<r?a?u:l:(r-t)/o*c},bf=Qa("width",function(e){return e.dom().offsetWidth}),yf=function(e,t){bf.set(e,t)},xf=function(e){return bf.get(e)},wf=function(e){return bf.getOuter(e)},kf=function(e){return e.model().minX()},Sf=function(e){return e.model().minY()},Cf=function(e){return e.model().minX()-1},zf=function(e){return e.model().minY()-1},Of=function(e){return e.model().maxX()},Tf=function(e){return e.model().maxY()},Mf=function(e){return e.model().maxX()+1},Hf=function(e){return e.model().maxY()+1},Ef=function(e,t,n){return t(e)-n(e)},Vf=function(e){return Ef(e,Of,kf)},Af=function(e){return Ef(e,Tf,Sf)},Bf=function(e){return Vf(e)/2},Df=function(e){return Af(e)/2},Rf=function(e){return e.stepSize()},Ff=function(e){return e.snapToGrid()},If=function(e){return e.snapStart()},_f=function(e){return e.rounded()},Lf=function(e,t){return e[t+"-edge"]!==undefined},Nf=function(e){return Lf(e,"left")},Pf=function(e){return Lf(e,"right")},jf=function(e){return Lf(e,"top")},Uf=function(e){return Lf(e,"bottom")},Wf=function(e){return e.model().value().get()},Gf=function(e){return{x:U(e)}},Xf=function(e){return{y:U(e)}},Yf=function(e,t){return{x:U(e),y:U(t)}},$f=function(e,t){uo(e,ff(),{value:t})},qf="left",Kf=function(e){return e.element().dom().getBoundingClientRect()},Jf=function(e,t){return e[t]},Qf=function(e){var t=Kf(e);return Jf(t,qf)},Zf=function(e){var t=Kf(e);return Jf(t,"right")},ed=function(e){var t=Kf(e);return Jf(t,"top")},td=function(e){var t=Kf(e);return Jf(t,"bottom")},nd=function(e){var t=Kf(e);return Jf(t,"width")},od=function(e){var t=Kf(e);return Jf(t,"height")},rd=function(e,t,n){return(e+t)/2-n},id=function(e,t){var n=Kf(e),o=Kf(t),r=Jf(n,qf),i=Jf(n,"right"),a=Jf(o,qf);return rd(r,i,a)},ad=function(e,t){var n=Kf(e),o=Kf(t),r=Jf(n,"top"),i=Jf(n,"bottom"),a=Jf(o,"top");return rd(r,i,a)},ud=function(e,t){uo(e,ff(),{value:t})},cd=function(e){return{x:U(e)}},sd=function(e,t,n){var o={min:kf(t),max:Of(t),range:Vf(t),value:n,step:Rf(t),snap:Ff(t),snapStart:If(t),rounded:_f(t),hasMinEdge:Nf(t),hasMaxEdge:Pf(t),minBound:Qf(e),maxBound:Zf(e),screenRange:nd(e)};return vf(o)},ld=function(a){return function(e,t){return(n=a,o=e,r=t,i=(0<n?gf:mf)(Wf(r).x(),kf(r),Of(r),Rf(r)),ud(o,cd(i)),P.some(i)).map(function(){return!0});var n,o,r,i}},fd=function(e,t,n,o,r,i){var a,u,c,s,l,f,d,m,g,h=(u=i,c=n,s=o,l=r,f=nd(a=t),d=s.bind(function(e){return P.some(id(e,a))}).getOr(0),m=l.bind(function(e){return P.some(id(e,a))}).getOr(f),g={min:kf(u),max:Of(u),range:Vf(u),value:c,hasMinEdge:Nf(u),hasMaxEdge:Pf(u),minBound:Qf(a),minOffset:0,maxBound:Zf(a),maxOffset:f,centerMinEdge:d,centerMaxEdge:m},pf(g));return Qf(t)-Qf(e)+h},dd=ld(-1),md=ld(1),gd=P.none,hd=P.none,vd=U({"top-left":P.none(),top:P.none(),"top-right":P.none(),right:P.some(function(e,t){$f(e,Gf(Mf(t)))}),"bottom-right":P.none(),bottom:P.none(),"bottom-left":P.none(),left:P.some(function(e,t){$f(e,Gf(Cf(t)))})}),pd=Object.freeze({setValueFrom:function(e,t,n){var o=sd(e,t,n),r=cd(o);return ud(e,r),o},setToMin:function(e,t){var n=kf(t);ud(e,cd(n))},setToMax:function(e,t){var n=Of(t);ud(e,cd(n))},findValueOfOffset:sd,getValueFromEvent:function(e){return df(e).map(function(e){return e.left()})},findPositionOfValue:fd,setPositionFromValue:function(e,t,n,o){var r=Wf(n),i=fd(e,o.getSpectrum(e),r.x(),o.getLeftEdge(e),o.getRightEdge(e),n),a=xf(t.element())/2;Ja.set(t.element(),"left",i-a+"px")},onLeft:dd,onRight:md,onUp:gd,onDown:hd,edgeActions:vd}),bd=function(e,t){uo(e,ff(),{value:t})},yd=function(e){return{y:U(e)}},xd=function(e,t,n){var o={min:Sf(t),max:Tf(t),range:Af(t),value:n,step:Rf(t),snap:Ff(t),snapStart:If(t),rounded:_f(t),hasMinEdge:jf(t),hasMaxEdge:Uf(t),minBound:ed(e),maxBound:td(e),screenRange:od(e)};return vf(o)},wd=function(a){return function(e,t){return(n=a,o=e,r=t,i=(0<n?gf:mf)(Wf(r).y(),Sf(r),Tf(r),Rf(r)),bd(o,yd(i)),P.some(i)).map(function(){return!0});var n,o,r,i}},kd=function(e,t,n,o,r,i){var a,u,c,s,l,f,d,m,g,h=(u=i,c=n,s=o,l=r,f=od(a=t),d=s.bind(function(e){return P.some(ad(e,a))}).getOr(0),m=l.bind(function(e){return P.some(ad(e,a))}).getOr(f),g={min:Sf(u),max:Tf(u),range:Af(u),value:c,hasMinEdge:jf(u),hasMaxEdge:Uf(u),minBound:ed(a),minOffset:0,maxBound:td(a),maxOffset:f,centerMinEdge:d,centerMaxEdge:m},pf(g));return ed(t)-ed(e)+h},Sd=P.none,Cd=P.none,zd=wd(-1),Od=wd(1),Td=U({"top-left":P.none(),top:P.some(function(e,t){$f(e,Xf(zf(t)))}),"top-right":P.none(),right:P.none(),"bottom-right":P.none(),bottom:P.some(function(e,t){$f(e,Xf(Hf(t)))}),"bottom-left":P.none(),left:P.none()}),Md=Object.freeze({setValueFrom:function(e,t,n){var o=xd(e,t,n),r=yd(o);return bd(e,r),o},setToMin:function(e,t){var n=Sf(t);bd(e,yd(n))},setToMax:function(e,t){var n=Tf(t);bd(e,yd(n))},findValueOfOffset:xd,getValueFromEvent:function(e){return df(e).map(function(e){return e.top()})},findPositionOfValue:kd,setPositionFromValue:function(e,t,n,o){var r=Wf(n),i=kd(e,o.getSpectrum(e),r.y(),o.getTopEdge(e),o.getBottomEdge(e),n),a=eu(t.element())/2;Ja.set(t.element(),"top",i-a+"px")},onLeft:Sd,onRight:Cd,onUp:zd,onDown:Od,edgeActions:Td}),Hd=function(e,t){uo(e,ff(),{value:t})},Ed=function(e,t){return{x:U(e),y:U(t)}},Vd=function(s,l){return function(e,t){return(n=s,o=l,r=e,i=t,a=0<n?gf:mf,u=o?Wf(i).x():a(Wf(i).x(),kf(i),Of(i),Rf(i)),c=o?a(Wf(i).y(),Sf(i),Tf(i),Rf(i)):Wf(i).y(),Hd(r,Ed(u,c)),P.some(u)).map(function(){return!0});var n,o,r,i,a,u,c}},Ad=Vd(-1,!1),Bd=Vd(1,!1),Dd=Vd(-1,!0),Rd=Vd(1,!0),Fd=U({"top-left":P.some(function(e,t){$f(e,Yf(Cf(t),zf(t)))}),top:P.some(function(e,t){$f(e,Yf(Bf(t),zf(t)))}),"top-right":P.some(function(e,t){$f(e,Yf(Mf(t),zf(t)))}),right:P.some(function(e,t){$f(e,Yf(Mf(t),Df(t)))}),"bottom-right":P.some(function(e,t){$f(e,Yf(Mf(t),Hf(t)))}),bottom:P.some(function(e,t){$f(e,Yf(Bf(t),Hf(t)))}),"bottom-left":P.some(function(e,t){$f(e,Yf(Cf(t),Hf(t)))}),left:P.some(function(e,t){$f(e,Yf(Cf(t),Df(t)))})}),Id=Object.freeze({setValueFrom:function(e,t,n){var o=sd(e,t,n.left()),r=xd(e,t,n.top()),i=Ed(o,r);return Hd(e,i),i},setToMin:function(e,t){var n=kf(t),o=Sf(t);Hd(e,Ed(n,o))},setToMax:function(e,t){var n=Of(t),o=Tf(t);Hd(e,Ed(n,o))},getValueFromEvent:function(e){return df(e)},setPositionFromValue:function(e,t,n,o){var r=Wf(n),i=fd(e,o.getSpectrum(e),r.x(),o.getLeftEdge(e),o.getRightEdge(e),n),a=kd(e,o.getSpectrum(e),r.y(),o.getTopEdge(e),o.getBottomEdge(e),n),u=xf(t.element())/2,c=eu(t.element())/2;Ja.set(t.element(),"left",i-u+"px"),Ja.set(t.element(),"top",a-c+"px")},onLeft:Ad,onRight:Bd,onUp:Dd,onDown:Rd,edgeActions:Fd}),_d=Ot.detect().deviceType.isTouch(),Ld=[Tr("stepSize",1),Tr("onChange",N),Tr("onChoose",N),Tr("onInit",N),Tr("onDragStart",N),Tr("onDragEnd",N),Tr("snapToGrid",!1),Tr("rounded",!0),kr("snapStart"),vr("model",cr("mode",{x:[Tr("minX",0),Tr("maxX",100),Dr("value",function(e){return Ve(e.mode.minX)}),hr("getInitialValue"),pa("manager",pd)],y:[Tr("minY",0),Tr("maxY",100),Dr("value",function(e){return Ve(e.mode.minY)}),hr("getInitialValue"),pa("manager",Md)],xy:[Tr("minX",0),Tr("maxX",100),Tr("minY",0),Tr("maxY",100),Dr("value",function(e){return Ve({x:U(e.mode.minX),y:U(e.mode.minY)})}),hr("getInitialValue"),pa("manager",Id)]})),gs("sliderBehaviours",[ms,uf])].concat(_d?[]:[Dr("mouseIsDown",function(){return Ve(!1)})]),Nd=Ot.detect().deviceType.isTouch(),Pd=Ml({name:"Slider",configFields:Ld,partFields:Yl,factory:function(i,e,t,n){var a=function(e){return nl(e,i,"thumb")},u=function(e){return nl(e,i,"spectrum")},o=function(e){return tl(e,i,"left-edge")},r=function(e){return tl(e,i,"right-edge")},c=function(e){return tl(e,i,"top-edge")},s=function(e){return tl(e,i,"bottom-edge")},l=i.model(),f=l.manager(),d=function(e,t){f.setPositionFromValue(e,t,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:u})},m=function(e,t){l.value().set(t);var n=a(e);return d(e,n),i.onChange()(e,n,t),P.some(!0)},g=[Yr(Re(),function(e,t){i.onDragStart()(e,a(e))}),Yr(Ie(),function(e,t){i.onDragEnd()(e,a(e))})],h=[Yr(Le(),function(e,t){t.stop(),i.onDragStart()(e,a(e)),i.mouseIsDown().set(!0)}),Yr(je(),function(e,t){i.onDragEnd()(e,a(e))})],v=Nd?g:h;return{uid:i.uid(),dom:i.dom(),components:e,behaviours:te(ki(j([Nd?[]:[ms.config({mode:"special",focusIn:function(e){return tl(e,i,"spectrum").map(ms.focusIn).map(U(!0))}})],[uf.config({store:{mode:"manual",getValue:function(e){return l.value().get()}}}),wa.config({channels:{"mouse.released":{onReceive:function(n,e){var t=i.mouseIsDown().get();i.mouseIsDown().set(!1),t&&tl(n,i,"thumb").each(function(e){var t=l.value().get();i.onChoose()(n,e,t)})}}}})]])),hs(i.sliderBehaviours())),events:Wr([Yr(ff(),function(e,t){m(e,t.event().value())}),ti(function(e,t){var n=l.getInitialValue();l.value().set(n());var o=a(e);d(e,o);var r=u(e);i.onInit()(e,o,r,l.value().get())})].concat(v)),apis:{resetToMin:function(e){f.setToMin(e,i)},resetToMax:function(e){f.setToMax(e,i)},changeValue:m,refresh:d},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(e,t){e.resetToMin(t)},resetToMax:function(e,t){e.resetToMax(t)},refresh:function(e,t){e.refresh(t)}}}),jd=function(t,n,o){return Il.forToolbar(n,function(){var e=o();t.setContextToolbar([{label:n+" group",items:e}])},{})},Ud=function(e){return[(r=e,i=function(e){return e<0?"black":360<e?"white":"hsl("+e+", 100%, 50%)"},Pd.sketch({dom:Bl('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[Pd.parts()["left-edge"](Dl('<div class="${prefix}-hue-slider-black"></div>')),Pd.parts().spectrum({dom:Bl('<div class="${prefix}-slider-gradient-container"></div>'),components:[Dl('<div class="${prefix}-slider-gradient"></div>')],behaviours:ki([Ba.config({toggleClass:_a.resolve("thumb-active")})])}),Pd.parts()["right-edge"](Dl('<div class="${prefix}-hue-slider-white"></div>')),Pd.parts().thumb({dom:Bl('<div class="${prefix}-slider-thumb"></div>'),behaviours:ki([Ba.config({toggleClass:_a.resolve("thumb-active")})])})],onChange:function(e,t,n){var o=i(n.x());Ja.set(t.element(),"background-color",o),r.onChange(e,t,o)},onDragStart:function(e,t){Ba.on(t)},onDragEnd:function(e,t){Ba.off(t)},onInit:function(e,t,n,o){var r=i(o.x());Ja.set(t.element(),"background-color",r)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:function(){return r.getInitialValue()}}}},sliderBehaviours:ki([Ra(Pd.refresh)])}))];var r,i},Wd=function(e,o){var t={onChange:function(e,t,n){o.undoManager.transact(function(){o.formatter.apply("forecolor",{value:n}),o.nodeChanged()})},getInitialValue:function(){return-1}};return jd(e,"color",function(){return Ud(t)})},Gd=Uo([hr("getInitialValue"),hr("onChange"),hr("category"),hr("sizes")]),Xd=function(e){var i=ir("SizeSlider",Gd,e);return Pd.sketch({dom:{tag:"div",classes:[_a.resolve("slider-"+i.category+"-size-container"),_a.resolve("slider"),_a.resolve("slider-size-container")]},onChange:function(e,t,n){var o,r=n.x();0<=(o=r)&&o<i.sizes.length&&i.onChange(r)},onDragStart:function(e,t){Ba.on(t)},onDragEnd:function(e,t){Ba.off(t)},model:{mode:"x",minX:0,maxX:i.sizes.length-1,getInitialValue:function(){return{x:function(){return i.getInitialValue()}}}},stepSize:1,snapToGrid:!0,sliderBehaviours:ki([Ra(Pd.refresh)]),components:[Pd.parts().spectrum({dom:Bl('<div class="${prefix}-slider-size-container"></div>'),components:[Dl('<div class="${prefix}-slider-size-line"></div>')]}),Pd.parts().thumb({dom:Bl('<div class="${prefix}-slider-thumb"></div>'),behaviours:ki([Ba.config({toggleClass:_a.resolve("thumb-active")})])})]})},Yd=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],$d=function(e){var t,n,o=e.selection.getStart(),r=$t.fromDom(o),i=$t.fromDom(e.getBody()),a=(t=function(e){return mn(i,e)},n=r,(Ln.isElement(n)?P.some(n):xn.parent(n)).map(function(e){return jr.closest(e,function(e){return Ja.getRaw(e,"font-size").isSome()},t).bind(function(e){return Ja.getRaw(e,"font-size")}).getOrThunk(function(){return Ja.get(e,"font-size")})}).getOr(""));return F(Yd,function(e){return a===e}).getOr("medium")},qd={candidates:U(Yd),get:function(e){var t,n=$d(e);return(t=n,I(Yd,function(e){return e===t})).getOr(2)},apply:function(o,e){var t;(t=e,P.from(Yd[t])).each(function(e){var t,n;n=e,$d(t=o)!==n&&t.execCommand("fontSize",!1,n)})}},Kd=qd.candidates(),Jd=function(e){return[Dl('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),(t=e,Xd({onChange:t.onChange,sizes:Kd,category:"font",getInitialValue:t.getInitialValue})),Dl('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')];var t},Qd=function(e){var t=function n(e){return e.uid!==undefined}(e)&&Ee(e,"uid")?e.uid:wl("memento");return{get:function(e){return e.getSystem().getByUid(t).getOrDie()},getOpt:function(e){return e.getSystem().getByUid(t).fold(P.none,P.some)},asSpec:function(){return te(e,{uid:t})}}};function Zd(e,t){return tm(document.createElement("canvas"),e,t)}function em(e){return e.getContext("2d")}function tm(e,t,n){return e.width=t,e.height=n,e}var nm={create:Zd,clone:function IB(e){var t;return em(t=Zd(e.width,e.height)).drawImage(e,0,0),t},resize:tm,get2dContext:em,get3dContext:function _B(e){var t=null;try{t=e.getContext("webgl")||e.getContext("experimental-webgl")}catch(n){}return t||(t=null),t}},om={getWidth:function LB(e){return e.naturalWidth||e.width},getHeight:function NB(e){return e.naturalHeight||e.height}},rm=window.Promise?window.Promise:function(){var e=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=[],s(e,o(r,this),o(a,this))},t=e.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(e){setTimeout(e,1)};function o(e,t){return function(){e.apply(t,arguments)}}var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(o){var r=this;null!==this._state?t(function(){var e=r._state?o.onFulfilled:o.onRejected;if(null!==e){var t;try{t=e(r._value)}catch(n){return void o.reject(n)}o.resolve(t)}else(r._state?o.resolve:o.reject)(r._value)}):this._deferreds.push(o)}function r(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void s(o(t,e),o(r,this),o(a,this))}this._state=!0,this._value=e,u.call(this)}catch(n){a.call(this,n)}}function a(e){this._state=!1,this._value=e,u.call(this)}function u(){for(var e=0,t=this._deferreds.length;e<t;e++)i.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=o}function s(e,t,n){var o=!1;try{e(function(e){o||(o=!0,t(e))},function(e){o||(o=!0,n(e))})}catch(r){if(o)return;o=!0,n(r)}}return e.prototype["catch"]=function(e){return this.then(null,e)},e.prototype.then=function(n,o){var r=this;return new e(function(e,t){i.call(r,new c(n,o,e,t))})},e.all=function(){var c=Array.prototype.slice.call(1===arguments.length&&n(arguments[0])?arguments[0]:arguments);return new e(function(r,i){if(0===c.length)return r([]);var a=c.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}c[t]=e,0==--a&&r(c)}catch(o){i(o)}}for(var e=0;e<c.length;e++)u(e,c[e])})},e.resolve=function(t){return t&&"object"==typeof t&&t.constructor===e?t:new e(function(e){e(t)})},e.reject=function(n){return new e(function(e,t){t(n)})},e.race=function(r){return new e(function(e,t){for(var n=0,o=r.length;n<o;n++)r[n].then(e,t)})},e}();function im(){return new(an.getOrDie("FileReader"))}var am={atob:function(e){return an.getOrDie("atob")(e)},requestAnimationFrame:function(e){an.getOrDie("requestAnimationFrame")(e)}};function um(u){return new rm(function(e,t){var n=URL.createObjectURL(u),o=new Image,r=function(){o.removeEventListener("load",i),o.removeEventListener("error",a)};function i(){r(),e(o)}function a(){r(),t("Unable to load data of type "+u.type+": "+n)}o.addEventListener("load",i),o.addEventListener("error",a),o.src=n,o.complete&&i()})}function cm(o){return new rm(function(e,n){var t=new XMLHttpRequest;t.open("GET",o,!0),t.responseType="blob",t.onload=function(){200==this.status&&e(this.response)},t.onerror=function(){var e,t=this;n(0===this.status?((e=new Error("No access to download image")).code=18,e.name="SecurityError",e):new Error("Error "+t.status+" downloading image"))},t.send()})}function sm(e){var t=e.split(","),n=/data:([^;]+)/.exec(t[0]);if(!n)return P.none();for(var o,r=n[1],i=t[1],a=am.atob(i),u=a.length,c=Math.ceil(u/1024),s=new Array(c),l=0;l<c;++l){for(var f=1024*l,d=Math.min(f+1024,u),m=new Array(d-f),g=f,h=0;g<d;++h,++g)m[h]=a[g].charCodeAt(0);s[l]=(o=m,new(an.getOrDie("Uint8Array"))(o))}return P.some(function v(e,t){return new(an.getOrDie("Blob"))(e,t)}(s,{type:r}))}function lm(n){return new rm(function(e,t){sm(n).fold(function(){t("uri is not base64: "+n)},e)})}function fm(n){return new rm(function(e){var t=im();t.onloadend=function(){e(t.result)},t.readAsDataURL(n)})}var dm,mm,gm={blobToImage:um,imageToBlob:function PB(e){var t=e.src;return 0===t.indexOf("data:")?lm(t):cm(t)},blobToArrayBuffer:function jB(n){return new rm(function(e){var t=im();t.onloadend=function(){e(t.result)},t.readAsArrayBuffer(n)})},blobToDataUri:fm,blobToBase64:function UB(e){return fm(e).then(function(e){return e.split(",")[1]})},dataUriToBlobSync:sm,canvasToBlob:function WB(e,n,o){return n=n||"image/png",HTMLCanvasElement.prototype.toBlob?new rm(function(t){e.toBlob(function(e){t(e)},n,o)}):lm(e.toDataURL(n,o))},canvasToDataURL:function GB(e,t,n){return t=t||"image/png",e.then(function(e){return e.toDataURL(t,n)})},blobToCanvas:function XB(e){return um(e).then(function(e){var t;return function n(e){URL.revokeObjectURL(e.src)}(e),t=nm.create(om.getWidth(e),om.getHeight(e)),nm.get2dContext(t).drawImage(e,0,0),t})},uriToBlob:function YB(e){return 0===e.indexOf("blob:")?cm(e):0===e.indexOf("data:")?lm(e):null}},hm=function(e){return gm.blobToBase64(e)},vm=function(a){var t=Qd({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:Wr([Qr(Ke()),Yr(qe(),function(e,t){var n,o,r;(n=t,o=n.event(),r=o.raw().target.files||o.raw().dataTransfer.files,P.from(r[0])).each(function(e){var r,i;r=a,hm(i=e).then(function(o){r.undoManager.transact(function(){var e=r.editorUpload.blobCache,t=e.create(ro("mceu"),i,o);e.add(t);var n=r.dom.createHTML("img",{src:t.blobUri()});r.insertContent(n)})})})})])});return Hl.sketch({dom:Bl('<span class="${prefix}-toolbar-button ${prefix}-icon-image ${prefix}-icon"></span>'),components:[t.asSpec()],action:function(e){t.get(e).element().dom().click()}})},pm=function(e){return e.dom().textContent},bm=function(e,t){e.dom().textContent=t},ym=function(e){return 0<e.length},xm=function(e){return e===undefined||null===e?"":e},wm=function(t,n,e){return e.text.toOption().filter(ym).fold(function(){return Wn.get(e=t,"href")===pm(e)?P.some(n):P.none();var e},P.some)},km=function(e){var t=$t.fromDom(e.selection.getStart());return mu(t,"a")},Sm={getInfo:function(e){return km(e).fold(function(){return{url:"",text:e.selection.getContent({format:"text"}),title:"",target:"",link:P.none()}},function(e){return n=pm(t=e),o=Wn.get(t,"href"),r=Wn.get(t,"title"),i=Wn.get(t,"target"),{url:xm(o),text:n!==o?xm(n):"",title:xm(r),target:xm(i),link:P.some(t)};var t,n,o,r,i})},applyInfo:function(r,i){i.url.toOption().filter(ym).fold(function(){var t;t=r,i.link.bind(b).each(function(e){t.execCommand("unlink")})},function(n){var e,t,o=(e=i,(t={}).href=n,e.title.toOption().filter(ym).each(function(e){t.title=e}),e.target.toOption().filter(ym).each(function(e){t.target=e}),t);i.link.bind(b).fold(function(){var e=i.text.toOption().filter(ym).getOr(n);r.insertContent(r.dom.createHTML("a",o,r.dom.encode(e)))},function(t){var e=wm(t,n,i);Wn.setAll(t,o),e.each(function(e){bm(t,e)})})})},query:km},Cm=Ot.detect(),zm=function(e,t){var n=t.selection.getRng();e(),t.selection.setRng(n)},Om=function(e,t){(Cm.os.isAndroid()?zm:u)(t,e)},Tm=function(e,t){var n,o;return{key:e,value:{config:{},me:(n=e,o=Wr(t),Ci({fields:[hr("enabled")],name:n,active:{events:U(o)}})),configAsRaw:U({}),initialConfig:{},state:xi}}},Mm=Object.freeze({getCurrent:function(e,t,n){return t.find()(e)}}),Hm=[hr("find")],Em=Ci({fields:Hm,name:"composing",apis:Mm}),Vm=Tl({name:"Container",factory:function(e){return{uid:e.uid(),dom:te({tag:"div",attributes:{role:"presentation"}},e.dom()),components:e.components(),behaviours:hs(e.containerBehaviours()),events:e.events(),domModification:e.domModification(),eventOrder:e.eventOrder()}},configFields:[Tr("components",[]),gs("containerBehaviours",[]),Tr("events",{}),Tr("domModification",{}),Tr("eventOrder",{})]}),Am=Tl({name:"DataField",factory:function(n){return{uid:n.uid(),dom:n.dom(),behaviours:te(ki([uf.config({store:{mode:"memory",initialValue:n.getInitialValue()()}}),Em.config({find:P.some})]),hs(n.dataBehaviours())),events:Wr([ti(function(e,t){uf.setValue(e,n.getInitialValue()())})])}},configFields:[hr("uid"),hr("dom"),hr("getInitialValue"),gs("dataBehaviours",[uf,Em])]}),Bm=function(e,t){if(t===undefined)throw new Error("Value.set was undefined");e.dom().value=t},Dm=function(e){return e.dom().value},Rm=U([kr("data"),Tr("inputAttributes",{}),Tr("inputStyles",{}),Tr("tag","input"),Tr("inputClasses",[]),ma("onSetValue"),Tr("styles",{}),Tr("eventOrder",{}),gs("inputBehaviours",[uf,Wa]),Tr("selectOnFocus",!0)]),Fm=function(e){return ki([Wa.config({onFocus:!1===e.selectOnFocus()?N:function(e){var t=e.element(),n=Dm(t);t.dom().setSelectionRange(0,n.length)}})])},Im=function(e){return{tag:e.tag(),attributes:te({type:"input"},e.inputAttributes()),styles:e.inputStyles(),classes:e.inputClasses()}},_m=Tl({name:"Input",configFields:Rm(),factory:function(e,t){return{uid:e.uid(),dom:Im(e),components:[],behaviours:(n=e,te(ki([uf.config({store:{mode:"manual",initialValue:n.data().getOr(undefined),getValue:function(e){return Dm(e.element())},setValue:function(e,t){Dm(e.element())!==t&&Bm(e.element(),t)}},onSetValue:n.onSetValue()})]),Fm(n),hs(n.inputBehaviours()))),eventOrder:e.eventOrder()};var n}}),Lm=Object.freeze({exhibit:function(e,t){return si({attributes:Me([{key:t.tabAttr(),value:"true"}])})}}),Nm=[Tr("tabAttr","data-alloy-tabstop")],Pm=Ci({fields:Nm,name:"tabstopping",active:Lm}),jm=function(e,t){var n=Qd(_m.sketch({inputAttributes:{placeholder:t},onSetValue:function(e,t){ao(e,$e())},inputBehaviours:ki([Em.config({find:P.some}),Pm.config({}),ms.config({mode:"execution"})]),selectOnFocus:!1})),o=Qd(Hl.sketch({dom:Bl('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(e){var t=n.get(e);uf.setValue(t,"")}}));return{name:e,spec:Vm.sketch({dom:Bl('<div class="${prefix}-input-container"></div>'),components:[n.asSpec(),o.asSpec()],containerBehaviours:ki([Ba.config({toggleClass:_a.resolve("input-container-empty")}),Em.config({find:function(e){return P.some(n.get(e))}}),Tm("input-clearing",[Yr($e(),function(e){var t=n.get(e);(0<uf.getValue(t).length?Ba.off:Ba.on)(e)})])])})}},Um=["input","button","textarea"],Wm=function(e,t,n){t.disabled()&&Km(e,t,n)},Gm=function(e){return M(Um,Ln.name(e.element()))},Xm=function(e){Wn.set(e.element(),"disabled","disabled")},Ym=function(e){Wn.remove(e.element(),"disabled")},$m=function(e){Wn.set(e.element(),"aria-disabled","true")},qm=function(e){Wn.set(e.element(),"aria-disabled","false")},Km=function(t,e,n){e.disableClass().each(function(e){ji.add(t.element(),e)}),(Gm(t)?Xm:$m)(t)},Jm=function(e){return Gm(e)?Wn.has(e.element(),"disabled"):"true"===Wn.get(e.element(),"aria-disabled")},Qm=Object.freeze({enable:function(t,e,n){e.disableClass().each(function(e){ji.remove(t.element(),e)}),(Gm(t)?Ym:qm)(t)},disable:Km,isDisabled:Jm,onLoad:Wm}),Zm=Object.freeze({exhibit:function(e,t,n){return si({classes:t.disabled()?t.disableClass().map(q).getOr([]):[]})},events:function(e,t){return Wr([Gr(Vt(),function(e,t){return Jm(e)}),fi(e,t,Wm)])}}),eg=[Tr("disabled",!1),kr("disableClass")],tg=Ci({fields:eg,name:"disabling",active:Zm,apis:Qm}),ng=[gs("formBehaviours",[uf])],og=function(e){return"<alloy.field."+e+">"},rg=function(o,e,t){return te({"debug.sketcher":{Form:t},uid:o.uid(),dom:o.dom(),components:e,behaviours:te(ki([uf.config({store:{mode:"manual",getValue:function(e){var t=rl(e,o);return se(t,function(e,t){return e().bind(function(e){var t,n=Em.getCurrent(e);return t="missing current",n.fold(function(){return ie.error(t)},ie.value)}).map(uf.getValue)})},setValue:function(n,e){ce(e,function(t,e){tl(n,o,e).each(function(e){Em.getCurrent(e).each(function(e){uf.setValue(e,t)})})})}}})]),hs(o.formBehaviours())),apis:{getField:function(e,t){return tl(e,o,t).bind(Em.getCurrent)}}})},ig={getField:ml(function(e,t,n){return e.getField(t,n)}),sketch:function(e){var n,t=(n=[],{field:function(e,t){return n.push(e),Ks("form",og(e),t)},record:function(){return n}}),o=e(t),r=t.record(),i=V(r,function(e){return Ps({name:e,pname:og(e)})});return Sl("form",ng,i,rg,o)}},ag=function(){var t=Ve(P.none()),n=function(){t.get().each(function(e){e.destroy()})};return{clear:function(){n(),t.set(P.none())},isSet:function(){return t.get().isSome()},set:function(e){n(),t.set(P.some(e))},run:function(e){t.get().each(e)}}},ug=function(){var t=Ve(P.none());return{clear:function(){t.set(P.none())},set:function(e){t.set(P.some(e))},isSet:function(){return t.get().isSome()},on:function(e){t.get().each(e)}}},cg=function(e){return{xValue:e,points:[]}},sg=function(e,t){if(t===e.xValue)return e;var n=0<t-e.xValue?1:-1,o={direction:n,xValue:t};return{xValue:t,points:(0===e.points.length?[]:e.points[e.points.length-1].direction===n?e.points.slice(0,e.points.length-1):e.points).concat([o])}},lg=function(e){if(0===e.points.length)return 0;var t=e.points[0].direction,n=e.points[e.points.length-1].direction;return-1===t&&-1===n?-1:1===t&&1===n?1:0},fg=function(e){var o="navigateEvent",t=Wo([hr("fields"),Tr("maxFieldIndex",e.fields.length-1),hr("onExecute"),hr("getInitialValue"),Dr("state",function(){return{dialogSwipeState:ug(),currentScreen:Ve(0)}})]),a=ir("SerialisedDialog",t,e),r=function(t,e,n){return Hl.sketch({dom:Bl('<span class="${prefix}-icon-'+e+' ${prefix}-icon"></span>'),action:function(e){uo(e,o,{direction:t})},buttonBehaviours:ki([tg.config({disableClass:_a.resolve("toolbar-navigation-disabled"),disabled:!n})])})},i=function(e,r){var i=cu(e.element(),"."+_a.resolve("serialised-dialog-screen"));du(e.element(),"."+_a.resolve("serialised-dialog-chain")).each(function(o){0<=a.state.currentScreen.get()+r&&a.state.currentScreen.get()+r<i.length&&(Ja.getRaw(o,"left").each(function(e){var t=parseInt(e,10),n=xf(i[0]);Ja.set(o,"left",t-r*n+"px")}),a.state.currentScreen.set(a.state.currentScreen.get()+r))})},u=function(o){var e=cu(o.element(),"input");P.from(e[a.state.currentScreen.get()]).each(function(e){o.getSystem().getByDom(e).each(function(e){var t,n;t=o,n=e.element(),t.getSystem().triggerFocus(n,t.element())})});var t=s.get(o);Fu.highlightAt(t,a.state.currentScreen.get())},c=Qd(ig.sketch(function(n){return{dom:Bl('<div class="${prefix}-serialised-dialog"></div>'),components:[Vm.sketch({dom:Bl('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:V(a.fields,function(e,t){return t<=a.maxFieldIndex?Vm.sketch({dom:Bl('<div class="${prefix}-serialised-dialog-screen"></div>'),components:[r(-1,"previous",0<t),n.field(e.name,e.spec),r(1,"next",t<a.maxFieldIndex)]}):n.field(e.name,e.spec)})})],formBehaviours:ki([Ra(function(e,t){var n;n=t,du(e.element(),"."+_a.resolve("serialised-dialog-chain")).each(function(e){Ja.set(e,"left",-a.state.currentScreen.get()*n.width+"px")})}),ms.config({mode:"special",focusIn:function(e){u(e)},onTab:function(e){return i(e,1),P.some(!0)},onShiftTab:function(e){return i(e,-1),P.some(!0)}}),Tm("form-events",[ti(function(t,e){a.state.currentScreen.set(0),a.state.dialogSwipeState.clear();var n=s.get(t);Fu.highlightFirst(n),a.getInitialValue(t).each(function(e){uf.setValue(t,e)})}),ri(a.onExecute),Yr(Je(),function(e,t){"left"===t.event().raw().propertyName&&u(e)}),Yr(o,function(e,t){var n=t.event().direction();i(e,n)})])])}})),s=Qd({dom:Bl('<div class="${prefix}-dot-container"></div>'),behaviours:ki([Fu.config({highlightClass:_a.resolve("dot-active"),itemClass:_a.resolve("dot-item")})]),components:W(a.fields,function(e,t){return t<=a.maxFieldIndex?[Dl('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})});return{dom:Bl('<div class="${prefix}-serializer-wrapper"></div>'),components:[c.asSpec(),s.asSpec()],behaviours:ki([ms.config({mode:"special",focusIn:function(e){var t=c.get(e);ms.focusIn(t)}}),Tm("serializer-wrapper-events",[Yr(Re(),function(e,t){var n=t.event();a.state.dialogSwipeState.set(cg(n.raw().touches[0].clientX))}),Yr(Fe(),function(e,t){var n=t.event();a.state.dialogSwipeState.on(function(e){t.event().prevent(),a.state.dialogSwipeState.set(sg(e,n.raw().touches[0].clientX))})}),Yr(Ie(),function(o){a.state.dialogSwipeState.on(function(e){var t=c.get(o),n=-1*lg(e);i(t,n)})})])])}},dg=et(function(n,o){return[{label:"the link group",items:[fg({fields:[jm("url","Type or paste URL"),jm("text","Link text"),jm("title","Link title"),jm("target","Link target"),(e="link",{name:e,spec:Am.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return P.none()}})})],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return P.some(Sm.getInfo(o))},onExecute:function(e){var t=uf.getValue(e);Sm.applyInfo(o,t),n.restoreToolbar(),o.focus()}})]}];var e}),mg=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],gg=Wr([(dm=Mt(),mm=function(e,t){var n,o,r=t.event().originator(),i=t.event().target();return o=i,!(mn(n=r,e.element())&&!mn(n,o)&&(console.warn(Mt()+" did not get interpreted by the desired target. \nOriginator: "+Yn(r)+"\nTarget: "+Yn(i)+"\nCheck the "+Mt()+" event handlers"),1))},{key:dm,value:Rr({can:mm})})]),hg=Object.freeze({events:gg}),vg=b,pg=yi(["debugInfo","triggerFocus","triggerEvent","triggerEscape","addToWorld","removeFromWorld","addToGui","removeFromGui","build","getByUid","getByDom","broadcast","broadcastOn","isConnected"]),bg=function(t){var e=function(e){return function(){throw new Error("The component must be in a context to send: "+e+"\n"+Yn(t().element())+" is not in context.")}};return pg({debugInfo:U("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"),isConnected:U(!1)})},yg=function(e,r){var i={};return ce(e,function(e,o){ce(e,function(e,t){var n=ze(t,[])(i);i[t]=n.concat([r(o,e)])})}),i},xg=function(e,t){return 1<e.length?ie.error('Multiple behaviours have tried to change DOM "'+t+'". The guilty behaviours are: '+Ro(V(e,function(e){return e.name()}))+". At this stage, this is not supported. Future releases might provide strategies for resolving this."):0===e.length?ie.value({}):ie.value(e[0].modification().fold(function(){return{}},function(e){return Te(t,e)}))},wg=function(a,u){return R(a,function(e,t){var n=t.modification().getOr({});return e.bind(function(i){var e=fe(n,function(e,t){return i[t]!==undefined?(n=u,o=t,r=a,ie.error("Mulitple behaviours have tried to change the _"+o+'_ "'+n+'". The guilty behaviours are: '+Ro(W(r,function(e){return e.modification().getOr({})[o]!==undefined?[e.name()]:[]}),null,2)+". This is not currently supported.")):ie.value(Te(t,e));var n,o,r});return He(e,i)})},ie.value({})).map(function(e){return Te(u,e)})},kg={classes:function(e,t){var n=W(e,function(e){return e.modification().getOr([])});return ie.value(Te(t,n))},attributes:wg,styles:wg,domChildren:xg,defChildren:xg,innerHtml:xg,value:xg},Sg=function(e,t){return n=f.apply(undefined,[e.handler].concat(t)),o=e.purpose(),{cHandler:n,purpose:U(o)};var n,o},Cg=function(e){return e.cHandler},zg=function(e,t){return{name:U(e),handler:U(t)}},Og=function(e,t,n){var o,r,i=te(n,(o=e,r={},A(t,function(e){r[e.name()]=e.handlers(o)}),r));return yg(i,zg)},Tg=function(e){var t,i=z(t=e)?{can:U(!0),abort:U(!1),run:t}:t;return function(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=[e,t].concat(n);i.abort.apply(undefined,r)?t.stop():i.can.apply(undefined,r)&&i.run.apply(undefined,r)}},Mg=function(e,t,n){var o,r,i=t[n];return i?function(a,u,e,c){var t=e.slice(0);try{var n=t.sort(function(e,t){var n=e[u](),o=t[u](),r=c.indexOf(n),i=c.indexOf(o);if(-1===r)throw new Error("The ordering for "+a+" does not have an entry for "+n+".\nOrder specified: "+Ro(c,null,2));if(-1===i)throw new Error("The ordering for "+a+" does not have an entry for "+o+".\nOrder specified: "+Ro(c,null,2));return r<i?-1:i<r?1:0});return ie.value(n)}catch(o){return ie.error([o])}}("Event: "+n,"name",e,i).map(function(e){var t=V(e,function(e){return e.handler()});return Fr(t)}):(o=n,r=e,ie.error(["The event ("+o+') 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: '+Ro(V(r,function(e){return e.name()}),null,2)]))},Hg=function(e,i){var t=fe(e,function(o,r){return(1===o.length?ie.value(o[0].handler()):Mg(o,i,r)).map(function(e){var t=Tg(e),n=1<o.length?B(i,function(t){return M(o,function(e){return e.name()===t})}).join(" > "):o[0].name();return Te(r,{handler:t,purpose:U(n)})})});return He(t,{})},Eg=function(e){return nr("custom.definition",Uo([Ko("dom","dom",Mo(),Uo([hr("tag"),Tr("styles",{}),Tr("classes",[]),Tr("attributes",{}),kr("value"),kr("innerHtml")])),hr("components"),hr("uid"),Tr("events",{}),Tr("apis",U({})),Ko("eventOrder","eventOrder",(t={"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"],mousedown:["focusing","alloy.base.behaviour","item-type-events"]},Oo.mergeWithThunk(U(t))),sr()),kr("domModification"),ba("originalSpec"),Tr("debug.sketcher","unknown")]),e);var t},Vg=function(t,e){A(e,function(e){ji.add(t,e)})},Ag=function(t,e){A(e,function(e){ji.remove(t,e)})},Bg=function(t){if(t.domChildren().isSome()&&t.defChildren().isSome())throw new Error("Cannot specify children and child specs! Must be one or the other.\nDef: "+(e=ci(t),Ro(e,null,2)));return t.domChildren().fold(function(){var e=t.defChildren().getOr([]);return V(e,Rg)},function(e){return e});var e},Dg=function(e){var t=$t.fromTag(e.tag());Wn.setAll(t,e.attributes().getOr({})),Vg(t,e.classes().getOr([])),Ja.setAll(t,e.styles().getOr({})),Vn(t,e.innerHtml().getOr(""));var n=Bg(e);return On(t,n),e.value().each(function(e){Bm(t,e)}),yl(t,e.uid()),t},Rg=function(e){var t=ui(e);return Dg(t)},Fg=function(e,t){return n=e,r=V(o=t,function(e){return zr(e.name(),[hr("config"),Tr("state",xi)])}),i=nr("component.behaviours",Wo(r),n.behaviours).fold(function(e){throw new Error(ur(e)+"\nComplete spec:\n"+Ro(n,null,2))},function(e){return e}),{list:o,data:se(i,function(e){var t=e().map(function(e){return{config:e.config(),state:e.state().init(e.config())}});return function(){return t}})};var n,o,r,i},Ig=function(e){var t,n,o=(t=Oe(e,"behaviours").getOr({}),n=B(ae(t),function(e){return t[e]!==undefined}),V(n,function(e){return t[e].me}));return Fg(e,o)},_g=yi(["getSystem","config","hasConfigured","spec","connect","disconnect","element","syncComponents","readState","components","events"]),Lg=function(e,t,n){var o,r,i,a,u,c,s=(r={uid:(o=e).uid(),tag:o.dom().tag(),classes:o.dom().classes(),attributes:o.dom().attributes(),styles:o.dom().styles(),domChildren:V(o.components(),function(e){return e.element()})},ui(te(r,o.dom().innerHtml().map(function(e){return Te("innerHtml",e)}).getOr({}),o.dom().value().map(function(e){return Te("value",e)}).getOr({})))),l=function(t,e,n,o){var r=te({},e);A(n,function(e){r[e.name()]=e.exhibit(t,o)});var i=yg(r,function(e,t){return{name:function(){return e},modification:t}}),a=se(i,function(e,t){return W(e,function(t){return t.modification().fold(function(){return[]},function(e){return[t]})})}),u=fe(a,function(t,n){return Oe(kg,n).fold(function(){return ie.error("Unknown field type: "+n)},function(e){return e(t,n)})});return He(u,{}).map(si)}(n,{"alloy.base.modification":(i=e,i.domModification().fold(function(){return si({})},si))},t,s).getOrDie();return u=l,c=te({uid:(a=s).uid(),tag:a.tag(),classes:u.classes().getOr([]).concat(a.classes().getOr([])),attributes:ne(a.attributes().getOr({}),u.attributes().getOr({})),styles:ne(a.styles().getOr({}),u.styles().getOr({}))},u.innerHtml().or(a.innerHtml()).map(function(e){return Te("innerHtml",e)}).getOr({}),li("domChildren",u.domChildren(),a.domChildren()),li("defChildren",u.defChildren(),a.defChildren()),u.value().or(a.value()).map(function(e){return Te("value",e)}).getOr({})),ui(c)},Ng=function(e,t,n){var o,r,i,a,u,c,s={"alloy.base.behaviour":(o=e,o.events())};return(r=n,i=e.eventOrder(),a=t,u=s,c=Og(r,a,u),Hg(c,i)).getOrDie()},Pg=function(e){var t,n,o,r,i,a,u,c,s,l,f,d,m,g,h=vg(e),v=(t=h,n=ze("components",[])(t),V(n,Wg)),p=te(hg,h,Te("components",v));return ie.value((o=p,i=Ve(bg(r=function(){return g})),a=rr(Eg(te(o,{behaviours:undefined}))),u=Ig(o),c=u.list,s=u.data,l=Lg(a,c,s),f=Dg(l),d=Ng(a,c,s),m=Ve(a.components()),g=_g({getSystem:i.get,config:function(e){if(e===gl())return a.apis();if(x(e))throw new Error("Invalid input: only API constant is allowed");var t=s;return(z(t[e.name()])?t[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+Ro(o,null,2))})()},hasConfigured:function(e){return z(s[e.name()])},spec:U(o),readState:function(e){return s[e]().map(function(e){return e.state.readState()}).getOr("not enabled")},connect:function(e){i.set(e)},disconnect:function(){i.set(bg(r))},element:U(f),syncComponents:function(){var e=xn.children(f),t=W(e,function(e){return i.get().getByDom(e).fold(function(){return[]},function(e){return[e]})});m.set(t)},components:m.get,events:U(d)})))},jg=function(e){var t=$t.fromText(e);return Ug({element:t})},Ug=function(e){var t=ar("external.component",Uo([hr("element"),kr("uid")]),e),n=Ve(bg());t.uid().each(function(e){yl(t.element(),e)});var o=_g({getSystem:n.get,config:P.none,hasConfigured:U(!1),connect:function(e){n.set(e)},disconnect:function(){n.set(bg(function(){return o}))},element:U(t.element()),spec:U(e),readState:U("No state"),syncComponents:N,components:U([]),events:U({})});return dl(o)},Wg=function(t){return(e=t,Oe(e,ll)).fold(function(){var e=te({uid:wl("")},t);return Pg(e).getOrDie()},function(e){return e});var e},Gg=dl,Xg="alloy.item-hover",Yg="alloy.item-focus",$g=function(e){(ea(e.element()).isNone()||Wa.isFocused(e))&&(Wa.isFocused(e)||Wa.focus(e),uo(e,Xg,{item:e}))},qg=function(e){uo(e,Yg,{item:e})},Kg=U(Xg),Jg=U(Yg),Qg=[hr("data"),hr("components"),hr("dom"),kr("toggling"),vs("itemBehaviours",[Ba,Wa,ms,uf]),Tr("ignoreFocus",!1),Tr("domModification",{}),pa("builder",function(e){return{dom:te(e.dom(),{attributes:{role:e.toggling().isSome()?"menuitemcheckbox":"menuitem"}}),behaviours:te(ki([e.toggling().fold(Ba.revoke,function(e){return Ba.config(te({aria:{mode:"checked"}},e))}),Wa.config({ignore:e.ignoreFocus(),stopMousedown:e.ignoreFocus(),onFocus:function(e){qg(e)}}),ms.config({mode:"execution"}),uf.config({store:{mode:"memory",initialValue:e.data()}}),Tm("item-type-events",[Yr(Dt(),co),Qr(Le()),Yr(Ue(),$g),Yr(At(),Wa.focus)])]),ps(e.itemBehaviours())),components:e.components(),domModification:e.domModification(),eventOrder:e.eventOrder()}}),Tr("eventOrder",{})],Zg=[hr("dom"),hr("components"),pa("builder",function(e){return{dom:e.dom(),components:e.components(),events:Wr([Zr(At())])}})],eh=U([Ps({name:"widget",overrides:function(t){return{behaviours:ki([uf.config({store:{mode:"manual",getValue:function(e){return t.data()},setValue:function(){}}})])}}})]),th=[hr("uid"),hr("data"),hr("components"),hr("dom"),Tr("autofocus",!1),Tr("ignoreFocus",!1),vs("widgetBehaviours",[uf,Wa,ms]),Tr("domModification",{}),cl(eh()),pa("builder",function(n){var e=Zs(0,n,eh()),t=el("item-widget",n,e.internals()),o=function(e){return tl(e,n,"widget").map(function(e){return ms.focusIn(e),e})},r=function(e,t){return Wu(t.event().target())||n.autofocus()&&t.setSource(e.element()),P.none()};return te({dom:n.dom(),components:t,domModification:n.domModification(),events:Wr([ri(function(e,t){o(e).each(function(e){t.stop()})}),Yr(Ue(),$g),Yr(At(),function(e,t){n.autofocus()?o(e):Wa.focus(e)})]),behaviours:te(ki([uf.config({store:{mode:"memory",initialValue:n.data()}}),Wa.config({ignore:n.ignoreFocus(),onFocus:function(e){qg(e)}}),ms.config({mode:"special",focusIn:n.autofocus()?function(e){o(e)}:Ti(),onLeft:r,onRight:r,onEscape:function(e,t){return Wa.isFocused(e)||n.autofocus()?(n.autofocus()&&t.setSource(e.element()),P.none()):(Wa.focus(e),P.some(!0))}})]),ps(n.widgetBehaviours()))})})],nh=cr("type",{widget:th,item:Qg,separator:Zg}),oh=U([Ws({factory:{sketch:function(e){var t=ar("menu.spec item",nh,e);return t.builder()(t)}},name:"items",unit:"item",defaults:function(e,t){var n=wl("");return te({uid:n},t)},overrides:function(e,t){return{type:t.type,ignoreFocus:e.fakeFocus(),domModification:{classes:[e.markers().item()]}}}})]),rh=U([hr("value"),hr("items"),hr("dom"),hr("components"),Tr("eventOrder",{}),gs("menuBehaviours",[Fu,uf,Em,ms]),Mr("movement",{mode:"menu",moveOnTab:!0},cr("mode",{grid:[ya(),pa("config",function(e,t){return{mode:"flatgrid",selector:"."+e.markers().item(),initSize:{numColumns:t.initSize().numColumns(),numRows:t.initSize().numRows()},focusManager:e.focusManager()}})],matrix:[pa("config",function(e,t){return{mode:"matrix",selectors:{row:t.rowSelector(),cell:"."+e.markers().item()},focusManager:e.focusManager()}}),hr("rowSelector")],menu:[Tr("moveOnTab",!0),pa("config",function(e,t){return{mode:"menu",selector:"."+e.markers().item(),moveOnTab:t.moveOnTab(),focusManager:e.focusManager()}})]})),sa(),Tr("fakeFocus",!1),Tr("focusManager",_u()),ma("onHighlight")]),ih=U("alloy.menu-focus"),ah=Ml({name:"Menu",configFields:rh(),partFields:oh(),factory:function(e,t,n,o){return te({dom:te(e.dom(),{attributes:{role:"menu"}}),uid:e.uid(),behaviours:te(ki([Fu.config({highlightClass:e.markers().selectedItem(),itemClass:e.markers().item(),onHighlight:e.onHighlight()}),uf.config({store:{mode:"memory",initialValue:e.value()}}),Em.config({find:P.some}),ms.config(e.movement().config()(e,e.movement()))]),hs(e.menuBehaviours())),events:Wr([Yr(Jg(),function(t,n){var e=n.event();t.getSystem().getByDom(e.target()).each(function(e){Fu.highlight(t,e),n.stop(),uo(t,ih(),{menu:t,item:e})})}),Yr(Kg(),function(e,t){var n=t.event().item();Fu.highlight(e,n)})]),components:t,eventOrder:e.eventOrder()})}}),uh=function(e,t,n,o){var r=e.getSystem().build(o);yo(e,r,n)},ch=function(e,t,n,o){var r=sh(e,t);F(r,function(e){return mn(o.element(),e.element())}).each(wo)},sh=function(e,t){return e.components()},lh=function(t,n,e,o,r){var i=sh(t,n);return P.from(i[o]).map(function(e){return ch(t,n,0,e),r.each(function(e){uh(t,0,function(e,t){Cn.appendAt(e,t,o)},e)}),e})},fh=Object.freeze({append:function(e,t,n,o){uh(e,0,Cn.append,o)},prepend:function(e,t,n,o){uh(e,0,Cn.prepend,o)},remove:ch,replaceAt:lh,replaceBy:function(t,n,e,o,r){var i=sh(t,n);return I(i,o).bind(function(e){return lh(t,n,0,e,r)})},set:function(t,e,n,o){var r,i,a,u;ko(t),r=function(){var e=V(o,t.getSystem().build);A(e,function(e){bo(t,e)})},i=t.element(),a=xn.owner(i),u=Zi(a).bind(function(t){var e=function(e){return mn(t,e)};return e(i)?P.some(i):jr.descendant(i,e)}),r(i),u.each(function(t){Zi(a).filter(function(e){return mn(e,t)}).fold(function(){Ji(t)},N)})},contents:sh}),dh=Ci({fields:[],name:"replacing",apis:fh}),mh=function(n,o,r,e){return Oe(r,e).bind(function(e){return Oe(n,e).bind(function(e){var t=mh(n,o,r,e);return P.some([e].concat(t))})}).getOr([])},gh=function(e,t){var n={};ce(e,function(e,t){A(e,function(e){n[e]=t})});var o=t,r=le(t,function(e,t){return{k:e,v:t}}),i=se(r,function(e,t){return[t].concat(mh(n,o,r,t))});return se(n,function(e){return Oe(i,e).getOr([e])})},hh=function(){var i=Ve({}),a=Ve({}),u=Ve({}),c=Ve(P.none()),s=Ve({}),e=function(e){return Oe(a.get(),e)};return{setContents:function(e,t,n,o){c.set(P.some(e)),i.set(n),a.set(t),s.set(o);var r=gh(o,n);u.set(r)},expand:function(n){return Oe(i.get(),n).map(function(e){var t=Oe(u.get(),n).getOr([]);return[e].concat(t)})},refresh:function(e){return Oe(u.get(),e)},collapse:function(e){return Oe(u.get(),e).bind(function(e){return 1<e.length?P.some(e.slice(1)):P.none()})},lookupMenu:e,otherMenus:function(e){var t=s.get();return $(ae(t),e)},getPrimary:function(){return c.get().bind(e)},getMenus:function(){return a.get()},clear:function(){i.set({}),a.set({}),u.set({}),c.set(P.none())},isClear:function(){return c.get().isNone()}}},vh=U("collapse-item"),ph=Tl({name:"TieredMenu",configFields:[va("onExecute"),va("onEscape"),ha("onOpenMenu"),ha("onOpenSubmenu"),ma("onCollapseMenu"),Tr("highlightImmediately",!0),yr("data",[hr("primary"),hr("menus"),hr("expansions")]),Tr("fakeFocus",!1),ma("onHighlight"),ma("onHover"),la(),hr("dom"),Tr("navigateOnHover",!0),Tr("stayInDom",!1),gs("tmenuBehaviours",[ms,Fu,Em,dh]),Tr("eventOrder",{})],apis:{collapseMenu:function(e,t){e.collapseMenu(t)},highlightPrimary:function(e,t){e.highlightPrimary(t)}},factory:function(i,a){var u,e,c=hh(),n=function(e){var o,t,n=(o=e,t=i.data().menus(),se(t,function(e,t){var n=ah.sketch(te(e,{value:t,items:e.items,markers:ke(a.markers,["item","selectedItem"]),fakeFocus:i.fakeFocus(),onHighlight:i.onHighlight(),focusManager:i.fakeFocus()?Lu():_u()}));return o.getSystem().build(n)})),r=l(e);return c.setContents(i.data().primary(),n,i.data().expansions(),r),c.getPrimary()},s=function(e){return uf.getValue(e).value},l=function(e){return se(i.data().menus(),function(e,t){return W(e.items,function(e){return"separator"===e.type?[]:[e.data.value]})})},f=function(t,e){Fu.highlight(t,e),Fu.getHighlighted(e).orThunk(function(){return Fu.getFirst(e)}).each(function(e){so(t,e.element(),At())})},d=function(e,t){return Ae(V(t,e.lookupMenu))},m=function(t,e,n){var o=d(e,e.otherMenus(n));A(o,function(e){Ag(e.element(),[i.markers().backgroundMenu()]),i.stayInDom()||dh.remove(t,e)})},g=function(n,o,r){return P.from(r[0]).bind(o.lookupMenu).map(function(e){var t=d(o,r.slice(1));return A(t,function(e){ji.add(e.element(),i.markers().backgroundMenu())}),ho.inBody(e.element())||dh.append(n,Gg(e)),Ag(e.element(),[i.markers().backgroundMenu()]),f(n,e),m(n,o,r),e})};(e=u||(u={}))[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent";var h=function(n,o,r){void 0===r&&(r=u.HighlightSubmenu);var e=s(o);return c.expand(e).bind(function(t){return P.from(t[0]).bind(c.lookupMenu).bind(function(e){return ho.inBody(e.element())||dh.append(n,Gg(e)),i.onOpenSubmenu()(n,o,e),r===u.HighlightSubmenu?(Fu.highlightFirst(e),g(n,c,t)):(Fu.dehighlightAll(e),P.some(o))})})},o=function(t,n){var e=s(n);return c.collapse(e).bind(function(e){return g(t,c,e).map(function(e){return i.onCollapseMenu()(t,n,e),e})})},t=function(n){return function(t,e){return mu(e.getSource(),"."+i.markers().item()).bind(function(e){return t.getSystem().getByDom(e).toOption().bind(function(e){return n(t,e).map(function(){return!0})})})}},r=Wr([Yr(ih(),function(t,e){var n=e.event().menu();Fu.highlight(t,n);var o=s(e.event().item());c.refresh(o).each(function(e){return m(t,c,e)})}),ri(function(t,e){var n=e.event().target();t.getSystem().getByDom(n).each(function(e){0===s(e).indexOf("collapse-item")&&o(t,e),h(t,e,u.HighlightSubmenu).fold(function(){i.onExecute()(t,e)},function(){})})}),ti(function(t,e){n(t).each(function(e){dh.append(t,Gg(e)),i.onOpenMenu()(t,e),i.highlightImmediately()&&f(t,e)})})].concat(i.navigateOnHover()?[Yr(Kg(),function(e,t){var n,o,r=t.event().item();n=e,o=s(r),c.refresh(o).bind(function(e){return g(n,c,e)}),h(e,r,u.HighlightParent),i.onHover()(e,r)})]:[])),v={collapseMenu:function(t){Fu.getHighlighted(t).each(function(e){Fu.getHighlighted(e).each(function(e){o(t,e)})})},highlightPrimary:function(t){c.getPrimary().each(function(e){f(t,e)})}};return{uid:i.uid(),dom:i.dom(),behaviours:te(ki([ms.config({mode:"special",onRight:t(function(e,t){return Wu(t.element())?P.none():h(e,t,u.HighlightSubmenu)}),onLeft:t(function(e,t){return Wu(t.element())?P.none():o(e,t)}),onEscape:t(function(e,t){return o(e,t).orThunk(function(){return i.onEscape()(e,t).map(function(){return e})})}),focusIn:function(t,e){c.getPrimary().each(function(e){so(t,e.element(),At())})}}),Fu.config({highlightClass:i.markers().selectedMenu(),itemClass:i.markers().menu()}),Em.config({find:function(e){return Fu.getHighlighted(e)}}),dh.config({})]),hs(i.tmenuBehaviours())),eventOrder:i.eventOrder(),apis:v,events:r}},extraApis:{tieredData:function(e,t,n){return{primary:e,menus:t,expansions:n}},singleData:function(e,t){return{primary:e,menus:Te(e,t),expansions:{}}},collapseItem:function(e){return{value:ro(vh()),meta:{text:e}}}}}),bh=function(e,t,n,o){return Oe(t.routes(),o.start()).map(u).bind(function(e){return Oe(e,o.destination()).map(u)})},yh=function(e,t,n,o){return bh(0,t,0,o).bind(function(t){return t.transition().map(function(e){return{transition:U(e),route:U(t)}})})},xh=function(n,o,e){var t,r,i;(t=n,r=o,i=e,wh(t,r,i).bind(function(e){return yh(t,r,i,e)})).each(function(e){var t=e.transition();ji.remove(n.element(),t.transitionClass()),Wn.remove(n.element(),o.destinationAttr())})},wh=function(e,t,n){var o=e.element();return Wn.has(o,t.destinationAttr())?P.some({start:U(Wn.get(e.element(),t.stateAttr())),destination:U(Wn.get(e.element(),t.destinationAttr()))}):P.none()},kh=function(e,t,n,o){xh(e,t,n),Wn.has(e.element(),t.stateAttr())&&Wn.get(e.element(),t.stateAttr())!==o&&t.onFinish()(e,o),Wn.set(e.element(),t.stateAttr(),o)},Sh=Object.freeze({findRoute:bh,disableTransition:xh,getCurrentRoute:wh,jumpTo:kh,progressTo:function(n,o,r,i){var e,t;t=o,Wn.has((e=n).element(),t.destinationAttr())&&(Wn.set(e.element(),t.stateAttr(),Wn.get(e.element(),t.destinationAttr())),Wn.remove(e.element(),t.destinationAttr()));var a,u,c=(a=o,u=i,{start:U(Wn.get(n.element(),a.stateAttr())),destination:U(u)});yh(n,o,r,c).fold(function(){kh(n,o,r,i)},function(e){xh(n,o,r);var t=e.transition();ji.add(n.element(),t.transitionClass()),Wn.set(n.element(),o.destinationAttr(),i)})},getState:function(e,t,n){var o=e.element();return Wn.has(o,t.stateAttr())?P.some(Wn.get(o,t.stateAttr())):P.none()}}),Ch=Object.freeze({events:function(r,i){return Wr([Yr(Je(),function(n,e){var o=e.event().raw();wh(n,r,i).each(function(t){bh(0,r,0,t).each(function(e){e.transition().each(function(e){o.propertyName===e.property()&&(kh(n,r,i,t.destination()),r.onTransition()(n,t))})})})}),ti(function(e,t){kh(e,r,i,r.initialState())})])}}),zh=[Tr("destinationAttr","data-transitioning-destination"),Tr("stateAttr","data-transitioning-state"),hr("initialState"),ma("onTransition"),ma("onFinish"),vr("routes",Xo(ie.value,Xo(ie.value,Uo([Or("transition",[hr("property"),hr("transitionClass")])]))))],Oh=Ci({fields:zh,name:"transitioning",active:Ch,apis:Sh,extra:{createRoutes:function(e){var o={};return ce(e,function(e,t){var n=t.split("<->");o[n[0]]=Te(n[1],e),o[n[1]]=Te(n[0],e)}),o},createBistate:function(e,t,n){return Me([{key:e,value:Te(t,n)},{key:t,value:Te(e,n)}])},createTristate:function(e,t,n,o){return Me([{key:e,value:Me([{key:t,value:o},{key:n,value:o}])},{key:t,value:Me([{key:e,value:o},{key:n,value:o}])},{key:n,value:Me([{key:e,value:o},{key:t,value:o}])}])}}}),Th=_a.resolve("scrollable"),Mh={register:function(e){ji.add(e,Th)},deregister:function(e){ji.remove(e,Th)},scrollable:U(Th)},Hh=function(e){return Oe(e,"format").getOr(e.title)},Eh=function(e,t,n,o,r){return{data:{value:e,text:t},type:"item",dom:{tag:"div",classes:r?[_a.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:_a.resolve("format-matches"),selected:n},itemBehaviours:ki(r?[]:[Da(e,function(e,t){(t?Ba.on:Ba.off)(e)})]),components:[{dom:{tag:"div",attributes:{style:o},innerHtml:t}}]}},Vh=function(e,t,n,o){return{value:e,dom:{tag:"div"},components:[Hl.sketch({dom:{tag:"div",classes:[_a.resolve("styles-collapser")]},components:o?[{dom:{tag:"span",classes:[_a.resolve("styles-collapse-icon")]}},jg(e)]:[jg(e)],action:function(e){if(o){var t=n().get(e);ph.collapseMenu(t)}}}),{dom:{tag:"div",classes:[_a.resolve("styles-menu-items-container")]},components:[ah.parts().items({})],behaviours:ki([Tm("adhoc-scrollable-menu",[ti(function(e,t){Ja.set(e.element(),"overflow-y","auto"),Ja.set(e.element(),"-webkit-overflow-scrolling","touch"),Mh.register(e.element())}),ni(function(e){Ja.remove(e.element(),"overflow-y"),Ja.remove(e.element(),"-webkit-overflow-scrolling"),Mh.deregister(e.element())})])])}],items:t,menuBehaviours:ki([Oh.config({initialState:"after",routes:Oh.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},Ah=function(o){var r,i,e,t,n,a=(r=o.formats,i=function(){return u},e=Vh("Styles",[].concat(V(r.items,function(e){return Eh(Hh(e),e.title,e.isSelected(),e.getPreview(),Ee(r.expansions,Hh(e)))})),i,!1),t=se(r.menus,function(e,t){var n=V(e,function(e){return Eh(Hh(e),e.title,e.isSelected!==undefined&&e.isSelected(),e.getPreview!==undefined?e.getPreview():"",Ee(r.expansions,Hh(e)))});return Vh(t,n,i,!0)}),n=te(t,Te("styles",e)),{tmenu:ph.tieredData("styles",n,r.expansions)}),u=Qd(ph.sketch({dom:{tag:"div",classes:[_a.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(e,t){var n=uf.getValue(t);return o.handle(t,n.value),P.none()},onEscape:function(){return P.none()},onOpenMenu:function(e,t){var n=xf(e.element());yf(t.element(),n),Oh.jumpTo(t,"current")},onOpenSubmenu:function(e,t,n){var o=xf(e.element()),r=fu(t.element(),'[role="menu"]').getOrDie("hacky"),i=e.getSystem().getByDom(r).getOrDie();yf(n.element(),o),Oh.progressTo(i,"before"),Oh.jumpTo(n,"after"),Oh.progressTo(n,"current")},onCollapseMenu:function(e,t,n){var o=fu(t.element(),'[role="menu"]').getOrDie("hacky"),r=e.getSystem().getByDom(o).getOrDie();Oh.progressTo(r,"after"),Oh.progressTo(n,"current")},navigateOnHover:!1,highlightImmediately:!0,data:a.tmenu,markers:{backgroundMenu:_a.resolve("styles-background-menu"),menu:_a.resolve("styles-menu"),selectedMenu:_a.resolve("styles-selected-menu"),item:_a.resolve("styles-item"),selectedItem:_a.resolve("styles-selected-item")}}));return u.asSpec()},Bh=function(e){return Ee(e,"items")?(n=te(Se(t=e,["items"]),{menu:!0}),o=Dh(t.items),{item:n,menus:te(o.menus,Te(t.title,o.items)),expansions:te(o.expansions,Te(t.title,t.title))}):{item:e,menus:{},expansions:{}};var t,n,o},Dh=function(e){return D(e,function(e,t){var n=Bh(t);return{menus:te(e.menus,n.menus),items:[n.item].concat(e.items),expansions:te(e.expansions,n.expansions)}},{menus:{},expansions:{},items:[]})},Rh={expand:Dh},Fh=function(a,e){var u=function(e){return function(){return a.formatter.match(e)}},c=function(e){return function(){return a.formatter.getCssText(e)}},t=Oe(e,"style_formats").getOr(mg),s=function(e){return V(e,function(e){if(Ee(e,"items")){var t=s(e.items);return te(te(e,{isSelected:U(!1),getPreview:U("")}),{items:t})}return Ee(e,"format")?te(i=e,{isSelected:u(i.format),getPreview:c(i.format)}):(o=ro((n=e).title),r=te(n,{format:o,isSelected:u(o),getPreview:c(o)}),a.formatter.register(o,r),r);var n,o,r,i})};return s(t)},Ih=function(n,e,o){var t,r,i,a=(t=n,i=(r=function(e){return W(e,function(e){return e.items===undefined?!Ee(e,"format")||t.formatter.canApply(e.format)?[e]:[]:0<r(e.items).length?[e]:[]})})(e),Rh.expand(i));return Ah({formats:a,handle:function(e,t){n.undoManager.transact(function(){Ba.isOn(e)?n.formatter.remove(t):n.formatter.apply(t)}),o()}})},_h=["undo","bold","italic","link","image","bullist","styleselect"],Lh=function(e){var t=e.replace(/\|/g," ").trim();return 0<t.length?t.split(/\s+/):[]},Nh=function(e){return W(e,function(e){return S(e)?Nh(e):Lh(e)})},Ph=function(e){var t=e.toolbar!==undefined?e.toolbar:_h;return S(t)?Nh(t):Lh(t)},jh=function(o,r){var e=function(e){return function(){return Il.forToolbarCommand(r,e)}},t=function(e){return function(){return Il.forToolbarStateCommand(r,e)}},n=function(e,t,n){return function(){return Il.forToolbarStateAction(r,e,t,n)}},i=e("undo"),a=e("redo"),u=t("bold"),c=t("italic"),s=t("underline"),l=e("removeformat"),f=n("unlink","link",function(){r.execCommand("unlink",null,!1)}),d=n("unordered-list","ul",function(){r.execCommand("InsertUnorderedList",null,!1)}),m=n("ordered-list","ol",function(){r.execCommand("InsertOrderedList",null,!1)}),g=Fh(r,r.settings),h=function(){return Ih(r,g,function(){r.fire("scrollIntoView")})},v=function(e,t){return{isSupported:function(){return e.forall(function(e){return Ee(r.buttons,e)})},sketch:t}};return{undo:v(P.none(),i),redo:v(P.none(),a),bold:v(P.none(),u),italic:v(P.none(),c),underline:v(P.none(),s),removeformat:v(P.none(),l),link:v(P.none(),function(){return t=o,n=r,Il.forToolbarStateAction(n,"link","link",function(){var e=dg(t,n);t.setContextToolbar(e),Om(n,function(){t.focusToolbar()}),Sm.query(n).each(function(e){n.selection.select(e.dom())})});var t,n}),unlink:v(P.none(),f),image:v(P.none(),function(){return vm(r)}),bullist:v(P.some("bullist"),d),numlist:v(P.some("numlist"),m),fontsizeselect:v(P.none(),function(){return t=r,e={onChange:function(e){qd.apply(t,e)},getInitialValue:function(){return qd.get(t)}},jd(o,"font-size",function(){return Jd(e)});var t,e}),forecolor:v(P.none(),function(){return Wd(o,r)}),styleselect:v(P.none(),function(){return Il.forToolbar("style-formats",function(e){r.fire("toReading"),o.dropup().appear(h,Ba.on,e)},ki([Ba.config({toggleClass:_a.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),wa.config({channels:Me([Fa(oa.orientationChanged(),Ba.off),Fa(oa.dropupDismissed(),Ba.off)])})]))})}},Uh=function(e,n){var t=Ph(e),o={};return W(t,function(e){var t=!Ee(o,e)&&Ee(n,e)&&n[e].isSupported()?[n[e].sketch()]:[];return o[e]=!0,t})},Wh=function(m,g){return function(e){if(m(e)){var t,n,o,r,i,a,u,c=$t.fromDom(e.target),s=function(){e.stopPropagation()},l=function(){e.preventDefault()},f=h(l,s),d=(t=c,n=e.clientX,o=e.clientY,r=s,i=l,a=f,u=e,{target:U(t),x:U(n),y:U(o),stop:r,prevent:i,kill:a,raw:U(u)});g(d)}}},Gh=function(e,t,n,o,r){var i=Wh(n,o);return e.dom().addEventListener(t,i,r),{unbind:f(Xh,e,t,i,r)}},Xh=function(e,t,n,o){e.dom().removeEventListener(t,n,o)},Yh=function(e,t,n,o){return Gh(e,t,n,o,!1)},$h=function(e,t,n,o){return Gh(e,t,n,o,!0)},qh=U(!0),Kh=function(e,t,n){return Yh(e,t,qh,n)},Jh=function(e,t,n){return $h(e,t,qh,n)},Qh=function(e){var t=e.matchMedia("(orientation: portrait)").matches;return{isPortrait:U(t)}},Zh=Qh,ev=function(o,t){var e=$t.fromDom(o),r=null,n=Kh(e,"orientationchange",function(){clearInterval(r);var e=Qh(o);t.onChange(e),i(function(){t.onReady(e)})}),i=function(e){clearInterval(r);var t=o.innerHeight,n=0;r=setInterval(function(){t!==o.innerHeight?(clearInterval(r),e(P.some(o.innerHeight))):20<n&&(clearInterval(r),e(P.none())),n++},50)};return{onAdjustment:i,destroy:function(){n.unbind()}}},tv=function(e){var t=Ot.detect().os.isiOS(),n=Qh(e).isPortrait();return t&&!n?e.screen.height:e.screen.width};function nv(n,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},schedule:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r=setTimeout(function(){n.apply(null,e),r=null},o)}}}var ov=function(e){var t=e.raw();return t.touches===undefined||1!==t.touches.length?P.none():P.some(t.touches[0])},rv=function(n){var a=Ve(P.none()),o=nv(function(e){a.set(P.none()),n.triggerEvent(Rt(),e)},400),r=Me([{key:Re(),value:function(n){return ov(n).each(function(e){o.cancel();var t={x:U(e.clientX),y:U(e.clientY),target:n.target};o.schedule(n),a.set(P.some(t))}),P.none()}},{key:Fe(),value:function(e){return o.cancel(),ov(e).each(function(i){a.get().each(function(e){var t,n,o,r;t=i,n=e,o=Math.abs(t.clientX-n.x()),r=Math.abs(t.clientY-n.y()),(5<o||5<r)&&a.set(P.none())})}),P.none()}},{key:Ie(),value:function(t){return o.cancel(),a.get().filter(function(e){return mn(e.target(),t.target())}).map(function(e){return n.triggerEvent(Bt(),t)})}}]);return{fireIfReady:function(t,e){return Oe(r,e).bind(function(e){return e(t)})}}},iv=function(n){var t=rv({triggerEvent:function(e,t){n.onTapContent(t)}});return{fireTouchstart:function(e){t.fireIfReady(e,"touchstart")},onTouchend:function(){return Kh(n.body(),"touchend",function(e){t.fireIfReady(e,"touchend")})},onTouchmove:function(){return Kh(n.body(),"touchmove",function(e){t.fireIfReady(e,"touchmove")})}}},av=6<=Ot.detect().os.version.major,uv=function(o,t,n){var r=iv(o),i=xn.owner(t),a=function(e){return!mn(e.start(),e.finish())||e.soffset()!==e.foffset()},e=function(){var e=o.doc().dom().hasFocus()&&o.getSelection().exists(a);n.getByDom(t).each(!0===(e||Zi(i).filter(function(e){return"input"===Ln.name(e)}).exists(function(e){return e.dom().selectionStart!==e.dom().selectionEnd}))?Ba.on:Ba.off)},u=[Kh(o.body(),"touchstart",function(e){o.onTouchContent(),r.fireTouchstart(e)}),r.onTouchmove(),r.onTouchend(),Kh(t,"touchstart",function(e){o.onTouchToolstrip()}),o.onToReading(function(){Qi(o.body())}),o.onToEditing(N),o.onScrollToCursor(function(e){e.preventDefault(),o.getCursorBox().each(function(e){var t=o.win(),n=e.top()>t.innerHeight||e.bottom()>t.innerHeight?e.bottom()-t.innerHeight+50:0;0!==n&&t.scrollTo(t.pageXOffset,t.pageYOffset+n)})})].concat(!0===av?[]:[Kh($t.fromDom(o.win()),"blur",function(){n.getByDom(t).each(Ba.off)}),Kh(i,"select",e),Kh(o.doc(),"selectionchange",e)]);return{destroy:function(){A(u,function(e){e.unbind()})}}},cv=function(e,t){var n=parseInt(Wn.get(e,t),10);return isNaN(n)?0:n},sv=function $B(n,o){var r=function(e){return n(e)?P.from(e.dom().nodeValue):P.none()},e=Ot.detect().browser,t=e.isIE()&&10===e.version.major?function(e){try{return r(e)}catch(t){return P.none()}}:r;return{get:function(e){if(!n(e))throw new Error("Can only get "+o+" value of a "+o+" node");return t(e).getOr("")},getOption:t,set:function(e,t){if(!n(e))throw new Error("Can only set raw "+o+" value of a "+o+" node");e.dom().nodeValue=t}}}(Ln.isText,"text"),lv=function(e){return sv.get(e)},fv=function(e){return sv.getOption(e)},dv=function(e){return"img"===Ln.name(e)?1:fv(e).fold(function(){return xn.children(e).length},function(e){return e.length})},mv=dv,gv=ge([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),hv={before:gv.before,on:gv.on,after:gv.after,cata:function(e,t,n,o){return e.fold(t,n,o)},getStart:function(e){return e.fold(b,b,b)}},vv=ge([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),pv=qt("start","soffset","finish","foffset"),bv={domRange:vv.domRange,relative:vv.relative,exact:vv.exact,exactFromRange:function(e){return vv.exact(e.start(),e.soffset(),e.finish(),e.foffset())},range:pv,getWin:function(e){var t=e.match({domRange:function(e){return $t.fromDom(e.startContainer)},relative:function(e,t){return hv.getStart(e)},exact:function(e,t,n,o){return e}});return xn.defaultView(t)}},yv=function(e,t,n,o){var r=xn.owner(e).dom().createRange();return r.setStart(e.dom(),t),r.setEnd(n.dom(),o),r},xv=function(e,t,n,o){var r=yv(e,t,n,o),i=mn(e,n)&&t===o;return r.collapsed&&!i},wv=function(e,t){e.selectNodeContents(t.dom())},kv=function(e){e.deleteContents()},Sv=function(e){return{left:U(e.left),top:U(e.top),right:U(e.right),bottom:U(e.bottom),width:U(e.width),height:U(e.height)}},Cv={create:function(e){return e.document.createRange()},replaceWith:function(e,t){kv(e),e.insertNode(t.dom())},selectNodeContents:function(e,t){var n=e.document.createRange();return wv(n,t),n},selectNodeContentsUsing:wv,relativeToNative:function(e,t,n){var o,r,i=e.document.createRange();return o=i,t.fold(function(e){o.setStartBefore(e.dom())},function(e,t){o.setStart(e.dom(),t)},function(e){o.setStartAfter(e.dom())}),r=i,n.fold(function(e){r.setEndBefore(e.dom())},function(e,t){r.setEnd(e.dom(),t)},function(e){r.setEndAfter(e.dom())}),i},exactToNative:function(e,t,n,o,r){var i=e.document.createRange();return i.setStart(t.dom(),n),i.setEnd(o.dom(),r),i},deleteContents:kv,cloneFragment:function(e){var t=e.cloneContents();return $t.fromDom(t)},getFirstRect:function(e){var t=e.getClientRects(),n=0<t.length?t[0]:e.getBoundingClientRect();return 0<n.width||0<n.height?P.some(n).map(Sv):P.none()},getBounds:function(e){var t=e.getBoundingClientRect();return 0<t.width||0<t.height?P.some(t).map(Sv):P.none()},isWithin:function(e,t){return t.compareBoundaryPoints(e.END_TO_START,e)<1&&-1<t.compareBoundaryPoints(e.START_TO_END,e)},toString:function(e){return e.toString()}},zv=ge([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ov=function(e,t,n){return t($t.fromDom(n.startContainer),n.startOffset,$t.fromDom(n.endContainer),n.endOffset)},Tv=function(e,t){var r,n,o,i=(r=e,t.match({domRange:function(e){return{ltr:U(e),rtl:P.none}},relative:function(e,t){return{ltr:et(function(){return Cv.relativeToNative(r,e,t)}),rtl:et(function(){return P.some(Cv.relativeToNative(r,t,e))})}},exact:function(e,t,n,o){return{ltr:et(function(){return Cv.exactToNative(r,e,t,n,o)}),rtl:et(function(){return P.some(Cv.exactToNative(r,n,o,e,t))})}}}));return(o=(n=i).ltr()).collapsed?n.rtl().filter(function(e){return!1===e.collapsed}).map(function(e){return zv.rtl($t.fromDom(e.endContainer),e.endOffset,$t.fromDom(e.startContainer),e.startOffset)}).getOrThunk(function(){return Ov(0,zv.ltr,o)}):Ov(0,zv.ltr,o)},Mv=(zv.ltr,zv.rtl,Tv),Hv=function(i,e){return Tv(i,e).match({ltr:function(e,t,n,o){var r=i.document.createRange();return r.setStart(e.dom(),t),r.setEnd(n.dom(),o),r},rtl:function(e,t,n,o){var r=i.document.createRange();return r.setStart(n.dom(),o),r.setEnd(e.dom(),t),r}})},Ev=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(e,t){var n=Ln.name(e);return"input"===n?hv.after(e):M(["br","img"],n)?0===t?hv.before(e):hv.after(e):hv.on(e,t)}),Vv=function(e,t,n,o){var r=Ev(e,t),i=Ev(n,o);return bv.relative(r,i)},Av=Vv,Bv=function(e,t){P.from(e.getSelection()).each(function(e){e.removeAllRanges(),e.addRange(t)})},Dv=function(e,t,n,o,r){var i=Cv.exactToNative(e,t,n,o,r);Bv(e,i)},Rv=function(f,e){return Mv(f,e).match({ltr:function(e,t,n,o){Dv(f,e,t,n,o)},rtl:function(e,t,n,o){var r,i,a,u,c,s=f.getSelection();if(s.setBaseAndExtent)s.setBaseAndExtent(e.dom(),t,n.dom(),o);else if(s.extend)try{i=e,a=t,u=n,c=o,(r=s).collapse(i.dom(),a),r.extend(u.dom(),c)}catch(l){Dv(f,n,o,e,t)}else Dv(f,n,o,e,t)}})},Fv=function(e){var t=$t.fromDom(e.anchorNode),n=$t.fromDom(e.focusNode);return xv(t,e.anchorOffset,n,e.focusOffset)?P.some(bv.range($t.fromDom(e.anchorNode),e.anchorOffset,$t.fromDom(e.focusNode),e.focusOffset)):function(e){if(0<e.rangeCount){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return P.some(bv.range($t.fromDom(t.startContainer),t.startOffset,$t.fromDom(n.endContainer),n.endOffset))}return P.none()}(e)},Iv=function(e){return P.from(e.getSelection()).filter(function(e){return 0<e.rangeCount}).bind(Fv)},_v=function(e,t,n,o,r){var i=Av(t,n,o,r);Rv(e,i)},Lv=Iv,Nv=function(e){return Iv(e).map(function(e){return bv.exact(e.start(),e.soffset(),e.finish(),e.foffset())})},Pv=function(e){e.getSelection().removeAllRanges()},jv=function(e,t){var n=Hv(e,t);return Cv.getFirstRect(n)},Uv=function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:U(2),height:e.height}},Wv=function(e){return{left:U(e.left),top:U(e.top),right:U(e.right),bottom:U(e.bottom),width:U(e.width),height:U(e.height)}},Gv=function(e){var t=e.getSelection();return t!==undefined&&0<t.rangeCount?function(n){if(n.collapsed){var o=$t.fromDom(n.startContainer);return xn.parent(o).bind(function(e){var t=bv.exact(o,n.startOffset,e,mv(e));return jv(n.startContainer.ownerDocument.defaultView,t).map(Uv).map(q)}).getOr([])}return V(n.getClientRects(),Wv)}(t.getRangeAt(0)):[]},Xv=function(e){e.focus();var t=$t.fromDom(e.document.body);(Zi().exists(function(e){return M(["input","textarea"],Ln.name(e))})?function(e){setTimeout(function(){e()},0)}:u)(function(){Zi().each(Qi),Ji(t)})},Yv="data-"+_a.resolve("last-outer-height"),$v=function(e,t){Wn.set(e,Yv,t)},qv=function(e){return{top:U(e.top()),bottom:U(e.top()+e.height())}},Kv=function(e,t){var n=cv(t,Yv),o=e.innerHeight;return o<n?P.some(n-o):P.none()},Jv=function(e,a){var t=$t.fromDom(a.document.body),n=Kh($t.fromDom(e),"resize",function(){Kv(e,t).each(function(i){var e,t;(e=a,t=Gv(e),0<t.length?P.some(t[0]).map(qv):P.none()).each(function(e){var t,n,o,r=(t=a,o=i,(n=e).top()>t.innerHeight||n.bottom()>t.innerHeight?Math.min(o,n.bottom()-t.innerHeight+50):0);0!==r&&a.scrollTo(a.pageXOffset,a.pageYOffset+r)})}),$v(t,e.innerHeight)});return $v(t,e.innerHeight),{toEditing:function(){Xv(a)},destroy:function(){n.unbind()}}},Qv=function(e){return P.some($t.fromDom(e.dom().contentWindow.document.body))},Zv=function(e){return P.some($t.fromDom(e.dom().contentWindow.document))},ep=function(e){return P.from(e.dom().contentWindow)},tp=function(e){return ep(e).bind(Lv)},np=function(e){return e.getFrame()},op=function(e,n){return function(t){return t[e].getOrThunk(function(){var e=np(t);return function(){return n(e)}})()}},rp=function(e,t,n,o){return e[n].getOrThunk(function(){return function(e){return Kh(t,o,e)}})},ip=function(e){return{left:U(e.left),top:U(e.top),right:U(e.right),bottom:U(e.bottom),width:U(e.width),height:U(e.height)}},ap={getBody:op("getBody",Qv),getDoc:op("getDoc",Zv),getWin:op("getWin",ep),getSelection:op("getSelection",tp),getFrame:np,getActiveApi:function(u){var c=np(u);return Qv(c).bind(function(a){return Zv(c).bind(function(i){return ep(c).map(function(r){var e=$t.fromDom(i.dom().documentElement),t=u.getCursorBox.getOrThunk(function(){return function(){return Nv(r).bind(function(e){return jv(r,e).orThunk(function(){return Lv(r).filter(function(e){return mn(e.start(),e.finish())&&e.soffset()===e.foffset()}).bind(function(e){var t=e.start().dom().getBoundingClientRect();return 0<t.width||0<t.height?P.some(t).map(ip):P.none()})})})}}),n=u.setSelection.getOrThunk(function(){return function(e,t,n,o){_v(r,e,t,n,o)}}),o=u.clearSelection.getOrThunk(function(){return function(){Pv(r)}});return{body:U(a),doc:U(i),win:U(r),html:U(e),getSelection:f(tp,c),setSelection:n,clearSelection:o,frame:U(c),onKeyup:rp(u,i,"onKeyup","keyup"),onNodeChanged:rp(u,i,"onNodeChanged","selectionchange"),onDomChanged:u.onDomChanged,onScrollToCursor:u.onScrollToCursor,onScrollToElement:u.onScrollToElement,onToReading:u.onToReading,onToEditing:u.onToEditing,onToolbarScrollStart:u.onToolbarScrollStart,onTouchContent:u.onTouchContent,onTapContent:u.onTapContent,onTouchToolstrip:u.onTouchToolstrip,getCursorBox:t}})})})}},up="data-ephox-mobile-fullscreen-style",cp="position:absolute!important;",sp="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;",lp=Ot.detect().os.isAndroid(),fp=function(e,t){var n,o,r=function(o){return function(e){var t=Wn.get(e,"style"),n=t===undefined?"no-styles":t.trim();n!==o&&(Wn.set(e,up,n),Wn.set(e,"style",o))}},i=au(e,"*"),a=W(i,function(e){return uu(e,"*")}),u=(n=t,(o=Ja.get(n,"background-color"))!==undefined&&""!==o?"background-color:"+o+"!important":"background-color:rgb(255,255,255)!important;");A(a,r("display:none!important;")),A(i,r(cp+sp+u)),r((!0===lp?"":cp)+sp+u)(e)},dp=function(){var e=iu("["+up+"]");A(e,function(e){var t=Wn.get(e,up);"no-styles"!==t?Wn.set(e,"style",t):Wn.remove(e,"style"),Wn.remove(e,up)})},mp=function(){var t=lu("head").getOrDie(),e=lu('meta[name="viewport"]').getOrThunk(function(){var e=$t.fromTag("meta");return Wn.set(e,"name","viewport"),Cn.append(t,e),e}),n=Wn.get(e,"content");return{maximize:function(){Wn.set(e,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){n!==undefined&&null!==n&&0<n.length?Wn.set(e,"content",n):Wn.set(e,"content","user-scalable=yes")}}},gp=function(t,e){var n=mp(),o=ag(),r=ag();return{enter:function(){e.hide(),ji.add(t.container,_a.resolve("fullscreen-maximized")),ji.add(t.container,_a.resolve("android-maximized")),n.maximize(),ji.add(t.body,_a.resolve("android-scroll-reload")),o.set(Jv(t.win,ap.getWin(t.editor).getOrDie("no"))),ap.getActiveApi(t.editor).each(function(e){fp(t.container,e.body()),r.set(uv(e,t.toolstrip,t.alloy))})},exit:function(){n.restore(),e.show(),ji.remove(t.container,_a.resolve("fullscreen-maximized")),ji.remove(t.container,_a.resolve("android-maximized")),dp(),ji.remove(t.body,_a.resolve("android-scroll-reload")),r.clear(),o.clear()}}},hp=function(n,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==r&&clearTimeout(r),r=setTimeout(function(){n.apply(null,e),r=null},o)}}},vp=function(e,t){var n,o,r,i=Qd(Vm.sketch({dom:Bl('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:ki([Ba.config({toggleClass:_a.resolve("mask-tap-icon-selected"),toggleOnExecute:!1})])})),a=(n=e,o=200,r=null,{cancel:function(){null!==r&&(clearTimeout(r),r=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null===r&&(r=setTimeout(function(){n.apply(null,e),r=null},o))}});return Vm.sketch({dom:Bl('<div class="${prefix}-disabled-mask"></div>'),components:[Vm.sketch({dom:Bl('<div class="${prefix}-content-container"></div>'),components:[Hl.sketch({dom:Bl('<div class="${prefix}-content-tap-section"></div>'),components:[i.asSpec()],action:function(e){a.throttle()},buttonBehaviours:ki([Ba.config({toggleClass:_a.resolve("mask-tap-icon-selected")})])})]})]})},pp=Wo([yr("editor",[hr("getFrame"),kr("getBody"),kr("getDoc"),kr("getWin"),kr("getSelection"),kr("setSelection"),kr("clearSelection"),kr("cursorSaver"),kr("onKeyup"),kr("onNodeChanged"),kr("getCursorBox"),hr("onDomChanged"),Tr("onTouchContent",N),Tr("onTapContent",N),Tr("onTouchToolstrip",N),Tr("onScrollToCursor",U({unbind:N})),Tr("onScrollToElement",U({unbind:N})),Tr("onToEditing",U({unbind:N})),Tr("onToReading",U({unbind:N})),Tr("onToolbarScrollStart",b)]),hr("socket"),hr("toolstrip"),hr("dropup"),hr("toolbar"),hr("container"),hr("alloy"),Dr("win",function(e){return xn.owner(e.socket).dom().defaultView}),Dr("body",function(e){return $t.fromDom(e.socket.dom().ownerDocument.body)}),Tr("translate",b),Tr("setReadOnly",N),Tr("readOnlyOnInit",U(!0))]),bp=function(e){var t=ir("Getting AndroidWebapp schema",pp,e);Ja.set(t.toolstrip,"width","100%");var n=Wg(vp(function(){t.setReadOnly(t.readOnlyOnInit()),r.enter()},t.translate));t.alloy.add(n);var o={show:function(){t.alloy.add(n)},hide:function(){t.alloy.remove(n)}};Cn.append(t.container,n.element());var r=gp(t,o);return{setReadOnly:t.setReadOnly,refreshStructure:N,enter:r.enter,exit:r.exit,destroy:N}},yp=U([Tr("shell",!0),gs("toolbarBehaviours",[dh])]),xp=U([Us({name:"groups",overrides:function(e){return{behaviours:ki([dh.config({})])}}})]),wp=Ml({name:"Toolbar",configFields:yp(),partFields:xp(),factory:function(t,e,n,o){var r=function(e){return t.shell()?P.some(e):tl(e,t,"groups")},i=t.shell()?{behaviours:[dh.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid(),dom:t.dom(),components:i.components,behaviours:te(ki(i.behaviours),hs(t.toolbarBehaviours())),apis:{setGroups:function(e,t){r(e).fold(function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(e){dh.set(e,t)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(e,t,n){e.setGroups(t,n)}}}),kp=U([hr("items"),fa(["itemSelector"]),gs("tgroupBehaviours",[ms])]),Sp=U([Ws({name:"items",unit:"item"})]),Cp=Ml({name:"ToolbarGroup",configFields:kp(),partFields:Sp(),factory:function(e,t,n,o){return te({dom:{attributes:{role:"toolbar"}}},{uid:e.uid(),dom:e.dom(),components:t,behaviours:te(ki([ms.config({mode:"flow",selector:e.markers().itemSelector()})]),hs(e.tgroupBehaviours())),"debug.sketcher":n["debug.sketcher"]})}}),zp="data-"+_a.resolve("horizontal-scroll"),Op=function(e){return"true"===Wn.get(e,zp)?0<(n=e).dom().scrollLeft||function(e){e.dom().scrollLeft=1;var t=0!==e.dom().scrollLeft;return e.dom().scrollLeft=0,t}(n):0<(t=e).dom().scrollTop||function(e){e.dom().scrollTop=1;var t=0!==e.dom().scrollTop;return e.dom().scrollTop=0,t}(t);var t,n},Tp={exclusive:function(e,t){return Kh(e,"touchmove",function(e){mu(e.target(),t).filter(Op).fold(function(){e.raw().preventDefault()},N)})},markAsHorizontal:function(e){Wn.set(e,zp,"true")}};function Mp(){var t=function(e){var t=!0===e.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:Bl('<div aria-label="'+e.label+'" class="${prefix}-toolbar-group '+t+'"></div>'),tgroupBehaviours:ki([Tm("adhoc-scrollable-toolbar",!0===e.scrollable?[oi(function(e,t){Ja.set(e.element(),"overflow-x","auto"),Tp.markAsHorizontal(e.element()),Mh.register(e.element())})]:[])]),components:[Vm.sketch({components:[Cp.parts().items({})]})],markers:{itemSelector:"."+_a.resolve("toolbar-group-item")},items:e.items}},n=Wg(wp.sketch({dom:Bl('<div class="${prefix}-toolbar"></div>'),components:[wp.parts().groups({})],toolbarBehaviours:ki([Ba.config({toggleClass:_a.resolve("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),ms.config({mode:"cyclic"})]),shell:!0})),e=Wg(Vm.sketch({dom:{classes:[_a.resolve("toolstrip")]},components:[Gg(n)],containerBehaviours:ki([Ba.config({toggleClass:_a.resolve("android-selection-context-toolbar"),toggleOnExecute:!1})])})),o=function(){wp.setGroups(n,r.get()),Ba.off(n)},r=Ve([]);return{wrapper:U(e),toolbar:U(n),createGroups:function(e){return V(e,h(Cp.sketch,t))},setGroups:function(e){r.set(e),o()},setContextToolbar:function(e){Ba.on(n),wp.setGroups(n,e)},restoreToolbar:function(){Ba.isOn(n)&&o()},refresh:function(){},focus:function(){ms.focusIn(n)}}}var Hp=function(e,t){dh.append(e,Gg(t))},Ep=function(e,t){dh.remove(e,t)},Vp=function(e){return Wg(Hl.sketch({dom:Bl('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){e.run(function(e){e.setReadOnly(!1)})}}))},Ap=function(){return Wg(Vm.sketch({dom:Bl('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:ki([dh.config({})])}))},Bp=function(e,t,n,o){(!0===n?Xi.toAlpha:Xi.toOmega)(o),(n?Hp:Ep)(e,t)},Dp=function(t,e){return e.getAnimationRoot().fold(function(){return t.element()},function(e){return e(t)})},Rp=function(e){return e.dimension().property()},Fp=function(e,t){return e.dimension().getDimension()(t)},Ip=function(e,t){var n=Dp(e,t);Ag(n,[t.shrinkingClass(),t.growingClass()])},_p=function(e,t){ji.remove(e.element(),t.openClass()),ji.add(e.element(),t.closedClass()),Ja.set(e.element(),Rp(t),"0px"),Ja.reflow(e.element())},Lp=function(e,t){ji.remove(e.element(),t.closedClass()),ji.add(e.element(),t.openClass()),Ja.remove(e.element(),Rp(t))},Np=function(e,t,n,o){n.setCollapsed(),Ja.set(e.element(),Rp(t),Fp(t,e.element())),Ja.reflow(e.element()),Ip(e,t),_p(e,t),t.onStartShrink()(e),t.onShrunk()(e)},Pp=function(e,t,n,o){var r=o.getOrThunk(function(){return Fp(t,e.element())});n.setCollapsed(),Ja.set(e.element(),Rp(t),r),Ja.reflow(e.element());var i=Dp(e,t);ji.add(i,t.shrinkingClass()),_p(e,t),t.onStartShrink()(e)},jp=function(e,t,n){var o=Fp(t,e.element());("0px"===o?Np:Pp)(e,t,n,P.some(o))},Up=function(e,t,n){Lp(e,t);var o=Fp(t,e.element());_p(e,t);var r=Dp(e,t);ji.add(r,t.growingClass()),Lp(e,t),Ja.set(e.element(),Rp(t),o),n.setExpanded(),t.onStartGrow()(e)},Wp=function(e,t,n){var o=Dp(e,t);return!0===ji.has(o,t.growingClass())},Gp=function(e,t,n){var o=Dp(e,t);return!0===ji.has(o,t.shrinkingClass())},Xp=Object.freeze({grow:function(e,t,n){n.isExpanded()||Up(e,t,n)},shrink:function(e,t,n){n.isExpanded()&&jp(e,t,n)},immediateShrink:function(e,t,n){n.isExpanded()&&Np(e,t,n,P.none())},hasGrown:function(e,t,n){return n.isExpanded()},hasShrunk:function(e,t,n){return n.isCollapsed()},isGrowing:Wp,isShrinking:Gp,isTransitioning:function(e,t,n){return!0===Wp(e,t)||!0===Gp(e,t)},toggleGrow:function(e,t,n){(n.isExpanded()?jp:Up)(e,t,n)},disableTransitions:Ip}),Yp=Object.freeze({exhibit:function(e,t){var n=t.expanded();return si(n?{classes:[t.openClass()],styles:{}}:{classes:[t.closedClass()],styles:Te(t.dimension().property(),"0px")})},events:function(n,o){return Wr([ei(Je(),function(e,t){t.event().raw().propertyName===n.dimension().property()&&(Ip(e,n),o.isExpanded()&&Ja.remove(e.element(),n.dimension().property()),(o.isExpanded()?n.onGrown():n.onShrunk())(e))})])}}),$p=[hr("closedClass"),hr("openClass"),hr("shrinkingClass"),hr("growingClass"),kr("getAnimationRoot"),ma("onShrunk"),ma("onStartShrink"),ma("onGrown"),ma("onStartGrow"),Tr("expanded",!1),vr("dimension",cr("property",{width:[pa("property","width"),pa("getDimension",function(e){return xf(e)+"px"})],height:[pa("property","height"),pa("getDimension",function(e){return eu(e)+"px"})]}))],qp=Object.freeze({init:function(e){var t=Ve(e.expanded());return wi({isExpanded:function(){return!0===t.get()},isCollapsed:function(){return!1===t.get()},setCollapsed:f(t.set,!1),setExpanded:f(t.set,!0),readState:function(){return"expanded: "+t.get()}})}}),Kp=Ci({fields:$p,name:"sliding",active:Yp,apis:Xp,state:qp}),Jp=function(t,n){var o=Wg(Vm.sketch({dom:{tag:"div",classes:[_a.resolve("dropup")]},components:[],containerBehaviours:ki([dh.config({}),Kp.config({closedClass:_a.resolve("dropup-closed"),openClass:_a.resolve("dropup-open"),shrinkingClass:_a.resolve("dropup-shrinking"),growingClass:_a.resolve("dropup-growing"),dimension:{property:"height"},onShrunk:function(e){t(),n(),dh.set(e,[])},onGrown:function(e){t(),n()}}),Ra(function(e,t){r(N)})])})),r=function(e){window.requestAnimationFrame(function(){e(),Kp.shrink(o)})};return{appear:function(e,t,n){!0===Kp.hasShrunk(o)&&!1===Kp.isTransitioning(o)&&window.requestAnimationFrame(function(){t(n),dh.set(o,[e()]),Kp.grow(o)})},disappear:r,component:U(o),element:o.element}},Qp=function(e,t,n){return mu(e,t,n).isSome()},Zp=Ot.detect().browser.isFirefox(),eb=Uo([br("triggerEvent"),br("broadcastEvent"),Tr("stopBackspace",!0)]),tb=function(t,e){var n,o,r,i,a=ir("Getting GUI events settings",eb,e),u=Ot.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],c=rv(a),s=V(u.concat(["selectstart","input","contextmenu","change","paste","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(e){return Kh(t,e,function(t){c.fireIfReady(t,e).each(function(e){e&&t.kill()}),a.triggerEvent(e,t)&&t.kill()})}),l=Kh(t,"keydown",function(e){var t;a.triggerEvent("keydown",e)?e.kill():!0!==a.stopBackspace||8!==(t=e).raw().which||M(["input","textarea"],Ln.name(t.target()))||Qp(t.target(),'[contenteditable="true"]')||e.prevent()}),f=(n=t,o=function(e){a.triggerEvent("focusin",e)&&e.kill()},Zp?Jh(n,"focus",o):Kh(n,"focusin",o)),d=(r=t,i=function(e){a.triggerEvent("focusout",e)&&e.kill(),setTimeout(function(){a.triggerEvent(Ht(),e)},0)},Zp?Jh(r,"blur",i):Kh(r,"focusout",i)),m=xn.defaultView(t),g=Kh(m,"scroll",function(e){a.broadcastEvent(Lt(),e)&&e.kill()});return{unbind:function(){A(s,function(e){e.unbind()}),l.unbind(),f.unbind(),d.unbind(),g.unbind()}}},nb=function(e,t){var n=Oe(e,"target").map(function(e){return e()}).getOr(t);return Ve(n)},ob=ge([{stopped:[]},{resume:["element"]},{complete:[]}]),rb=function(e,o,t,n,r,i){var a,u,c,s,l=e(o,n),f=(a=t,u=r,c=Ve(!1),s=Ve(!1),{stop:function(){c.set(!0)},cut:function(){s.set(!0)},isStopped:c.get,isCut:s.get,event:U(a),setSource:u.set,getSource:u.get});return l.fold(function(){return i.logEventNoHandlers(o,n),ob.complete()},function(t){var n=t.descHandler();return Cg(n)(f),f.isStopped()?(i.logEventStopped(o,t.element(),n.purpose()),ob.stopped()):f.isCut()?(i.logEventCut(o,t.element(),n.purpose()),ob.complete()):xn.parent(t.element()).fold(function(){return i.logNoParent(o,t.element(),n.purpose()),ob.complete()},function(e){return i.logEventResponse(o,t.element(),n.purpose()),ob.resume(e)})})},ib=function(t,n,o,e,r,i){return rb(t,n,o,e,r,i).fold(function(){return!0},function(e){return ib(t,n,o,e,r,i)},function(){return!1})},ab=function(e,t,n){var o,r,i=(o=t,r=Ve(!1),{stop:function(){r.set(!0)},cut:N,isStopped:r.get,isCut:U(!1),event:U(o),setSource:a("Cannot set source of a broadcasted event"),getSource:a("Cannot get source of a broadcasted event")});return A(e,function(e){var t=e.descHandler();Cg(t)(i)}),i.isStopped()},ub=function(e,t,n,o,r){var i=nb(n,o);return ib(e,t,n,o,i,r)},cb=qt("element","descHandler"),sb=function(e,t){return{id:U(e),descHandler:U(t)}};function lb(){var i={};return{registerId:function(o,r,e){ce(e,function(e,t){var n=i[t]!==undefined?i[t]:{};n[r]=Sg(e,o),i[t]=n})},unregisterId:function(n){ce(i,function(e,t){e.hasOwnProperty(n)&&delete e[n]})},filterByType:function(e){return Oe(i,e).map(function(e){return fe(e,function(e,t){return sb(t,e)})}).getOr([])},find:function(e,t,n){var r=Ce(t)(i);return Ur(n,function(e){return n=r,xl(o=e).fold(function(){return P.none()},function(e){var t=Ce(e);return n.bind(t).map(function(e){return cb(o,e)})});var n,o},e)}}}function fb(){var o=lb(),r={},i=function(o){var e=o.element();return xl(e).fold(function(){return e="uid-",t=o.element(),n=ro(pl+e),yl(t,n),n;var e,t,n},function(e){return e})},a=function(e){xl(e.element()).each(function(e){r[e]=undefined,o.unregisterId(e)})};return{find:function(e,t,n){return o.find(e,t,n)},filter:function(e){return o.filterByType(e)},register:function(e){var t=i(e);Ee(r,t)&&function(e,t){var n=r[t];if(n!==e)throw new Error('The tagId "'+t+'" is already used by: '+Yn(n.element())+"\nCannot use it for: "+Yn(e.element())+"\nThe conflicting element is"+(ho.inBody(n.element())?" ":" not ")+"already in the DOM");a(e)}(e,t);var n=[e];o.registerId(n,t,e.events()),r[t]=e},unregister:a,getById:function(e){return Ce(e)(r)}}}var db=function(n){var o=function(t){return xn.parent(n.element()).fold(function(){return!0},function(e){return mn(t,e)})},r=fb(),s=function(e,t){return r.find(o,e,t)},e=tb(n.element(),{triggerEvent:function(a,u){return Zn(a,u.target(),function(e){return t=s,n=a,r=e,i=(o=u).target(),ub(t,n,o,i,r);var t,n,o,r,i})},broadcastEvent:function(e,t){var n=r.filter(e);return ab(n,t)}}),i=pg({debugInfo:U("real"),triggerEvent:function(t,n,o){Zn(t,n,function(e){ub(s,t,o,n,e)})},triggerFocus:function(u,c){xl(u).fold(function(){Ji(u)},function(e){Zn(Mt(),u,function(e){var t,n,o,r,i,a;t=s,n=Mt(),o={originator:U(c),kill:N,prevent:N,target:U(u)},i=e,a=nb(o,r=u),rb(t,n,o,r,a,i)})})},triggerEscape:function(e,t){i.triggerEvent("keydown",e.element(),t.event())},getByUid:function(e){return m(e)},getByDom:function(e){return g(e)},build:Wg,addToGui:function(e){u(e)},removeFromGui:function(e){c(e)},addToWorld:function(e){t(e)},removeFromWorld:function(e){a(e)},broadcast:function(e){f(e)},broadcastOn:function(e,t){d(e,t)},isConnected:U(!0)}),t=function(e){e.connect(i),Ln.isText(e.element())||(r.register(e),A(e.components(),t),i.triggerEvent(_t(),e.element(),{target:U(e.element())}))},a=function(e){Ln.isText(e.element())||(A(e.components(),a),r.unregister(e)),e.disconnect()},u=function(e){bo(n,e)},c=function(e){wo(e)},l=function(n){var e=r.filter(Et());A(e,function(e){var t=e.descHandler();Cg(t)(n)})},f=function(e){l({universal:U(!0),data:U(e)})},d=function(e,t){l({universal:U(!1),channels:U(e),data:U(t)})},m=function(e){return r.getById(e).fold(function(){return ie.error(new Error('Could not find component with uid: "'+e+'" in system.'))},ie.value)},g=function(e){var t=xl(e).getOr("not found");return m(t)};return t(n),{root:U(n),element:n.element,destroy:function(){e.unbind(),Mn.remove(n.element())},add:u,remove:c,getByUid:m,getByDom:g,addToWorld:t,removeFromWorld:a,broadcast:f,broadcastOn:d}},mb=U(_a.resolve("readonly-mode")),gb=U(_a.resolve("edit-mode"));function hb(e){var t=Wg(Vm.sketch({dom:{classes:[_a.resolve("outer-container")].concat(e.classes)},containerBehaviours:ki([Xi.config({alpha:mb(),omega:gb()})])}));return db(t)}var vb=function(e,t){var n=$t.fromTag("input");Ja.setAll(n,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),Cn.append(e,n),Ji(n),t(n),Mn.remove(n)},pb=function(e){var t=e.getSelection();if(0<t.rangeCount){var n=t.getRangeAt(0),o=e.document.createRange();o.setStart(n.startContainer,n.startOffset),o.setEnd(n.endContainer,n.endOffset),t.removeAllRanges(),t.addRange(o)}},bb=function(e,t){Zi().each(function(e){mn(e,t)||Qi(e)}),e.focus(),Ji($t.fromDom(e.document.body)),pb(e)},yb={stubborn:function(e,t,n,o){var r=function(){bb(t,o)},i=Kh(n,"keydown",function(e){M(["input","textarea"],Ln.name(e.target()))||r()});return{toReading:function(){vb(e,Qi)},toEditing:r,onToolbarTouch:function(){},destroy:function(){i.unbind()}}},timid:function(e,t,n,o){var r=function(){Qi(o)};return{toReading:function(){r()},toEditing:function(){bb(t,o)},onToolbarTouch:function(){r()},destroy:N}}},xb=function(n,o,r,i,e){var a=function(){o.run(function(e){e.refreshSelection()})},t=function(e,t){var n=e-i.dom().scrollTop;o.run(function(e){e.scrollIntoView(n,n+t)})},u=function(){o.run(function(e){e.clearSelection()})},c=function(){n.getCursorBox().each(function(e){t(e.top(),e.height())}),o.run(function(e){e.syncHeight()})},s=iv(n),l=hp(c,300),f=[n.onKeyup(function(){u(),l.throttle()}),n.onNodeChanged(a),n.onDomChanged(l.throttle),n.onDomChanged(a),n.onScrollToCursor(function(e){e.preventDefault(),l.throttle()}),n.onScrollToElement(function(e){e.element(),t(o,i)}),n.onToEditing(function(){o.run(function(e){e.toEditing()})}),n.onToReading(function(){o.run(function(e){e.toReading()})}),Kh(n.doc(),"touchend",function(e){mn(n.html(),e.target())||mn(n.body(),e.target())}),Kh(r,"transitionend",function(e){var t;"height"===e.raw().propertyName&&(t=eu(r),o.run(function(e){e.setViewportOffset(t)}),a(),c())}),Jh(r,"touchstart",function(e){var t;o.run(function(e){e.highlightSelection()}),t=e,o.run(function(e){e.onToolbarTouch(t)}),n.onTouchToolstrip()}),Kh(n.body(),"touchstart",function(e){u(),n.onTouchContent(),s.fireTouchstart(e)}),s.onTouchmove(),s.onTouchend(),Kh(n.body(),"click",function(e){e.kill()}),Kh(r,"touchmove",function(){n.onToolbarScrollStart()})];return{destroy:function(){A(f,function(e){e.unbind()})}}},wb=function(e){var n=P.none(),t=[],o=function(e){r()?a(e):t.push(e)},r=function(){return n.isSome()},i=function(e){A(e,a)},a=function(t){n.each(function(e){setTimeout(function(){t(e)},0)})};return e(function(e){n=P.some(e),i(t),t=[]}),{get:o,map:function(n){return wb(function(t){o(function(e){t(n(e))})})},isReady:r}},kb={nu:wb,pure:function(t){return wb(function(e){e(t)})}},Sb=function(t){var e=function(e){var o;t((o=e,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this;setTimeout(function(){o.apply(n,e)},0)}))},n=function(){return kb.nu(e)};return{map:function(o){return Sb(function(n){e(function(e){var t=o(e);n(t)})})},bind:function(n){return Sb(function(t){e(function(e){n(e).get(t)})})},anonBind:function(n){return Sb(function(t){e(function(e){n.get(t)})})},toLazy:n,toCached:function(){var t=null;return Sb(function(e){null===t&&(t=n()),t.get(e)})},get:e}},Cb={nu:Sb,pure:function(t){return Sb(function(e){e(t)})}},zb=function(e,t,n){return Math.abs(e-t)<=n?P.none():e<t?P.some(e+n):P.some(e-n)},Ob=function(){var s=null;return{animate:function(o,r,e,i,t,n){var a=!1,u=function(e){a=!0,t(e)};clearInterval(s);var c=function(e){clearInterval(s),u(e)};s=setInterval(function(){var n=o();zb(n,r,e).fold(function(){clearInterval(s),u(r)},function(e){if(i(e,c),!a){var t=o();(t!==e||Math.abs(t-r)>Math.abs(n-r))&&(clearInterval(s),u(r))}})},n)}}},Tb=function(t,n){return Be([{width:320,height:480,keyboard:{portrait:300,landscape:240}},{width:320,height:568,keyboard:{portrait:300,landscape:240}},{width:375,height:667,keyboard:{portrait:305,landscape:240}},{width:414,height:736,keyboard:{portrait:320,landscape:240}},{width:768,height:1024,keyboard:{portrait:320,landscape:400}},{width:1024,height:1366,keyboard:{portrait:380,landscape:460}}],function(e){return t<=e.width&&n<=e.height?P.some(e.keyboard):P.none()}).getOr({portrait:n/5,landscape:t/4})},Mb=function(e){var t,n=Zh(e).isPortrait(),o=Tb((t=e).screen.width,t.screen.height),r=n?o.portrait:o.landscape;return(n?e.screen.height:e.screen.width)-e.innerHeight>r?0:r},Hb=function(e,t){var n=xn.owner(e).dom().defaultView;return eu(e)+eu(t)-Mb(n)},Eb=Hb,Vb=function(e,t,n){var o=Hb(t,n),r=eu(t)+eu(n)-o;Ja.set(e,"padding-bottom",r+"px")},Ab=ge([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Bb="data-"+_a.resolve("position-y-fixed"),Db="data-"+_a.resolve("y-property"),Rb="data-"+_a.resolve("scrolling"),Fb="data-"+_a.resolve("last-window-height"),Ib=function(e){return cv(e,Bb)},_b=function(e,t){var n=Wn.get(e,Db);return Ab.fixed(e,n,t)},Lb=function(e,t){return Ab.scroller(e,t)},Nb=function(e){var t=Ib(e);return("true"===Wn.get(e,Rb)?Lb:_b)(e,t)},Pb=function(e,t,n){var o=xn.owner(e).dom().defaultView.innerHeight;return Wn.set(e,Fb,o+"px"),o-t-n},jb=function(e){var t=cu(e,"["+Bb+"]");return V(t,Nb)},Ub=function(o,r,i,a){var e,t,n,u,c,s,l,f,d=xn.owner(o).dom().defaultView,m=(f=Wn.get(l=i,"style"),Ja.setAll(l,{position:"absolute",top:"0px"}),Wn.set(l,Bb,"0px"),Wn.set(l,Db,"top"),{restore:function(){Wn.set(l,"style",f||""),Wn.remove(l,Bb),Wn.remove(l,Db)}}),g=eu(i),h=eu(a),v=Pb(o,g,h),p=(n=g,u=v,s=Wn.get(c=o,"style"),Mh.register(c),Ja.setAll(c,{position:"absolute",height:u+"px",width:"100%",top:n+"px"}),Wn.set(c,Bb,n+"px"),Wn.set(c,Rb,"true"),Wn.set(c,Db,"top"),{restore:function(){Mh.deregister(c),Wn.set(c,"style",s||""),Wn.remove(c,Bb),Wn.remove(c,Rb),Wn.remove(c,Db)}}),b=(t=Wn.get(e=a,"style"),Ja.setAll(e,{position:"absolute",bottom:"0px"}),Wn.set(e,Bb,"0px"),Wn.set(e,Db,"bottom"),{restore:function(){Wn.set(e,"style",t||""),Wn.remove(e,Bb),Wn.remove(e,Db)}}),y=!0,x=function(){var e=d.innerHeight;return cv(o,Fb)<e},w=function(){if(y){var e=eu(i),t=eu(a),n=Pb(o,e,t);Wn.set(o,Bb,e+"px"),Ja.set(o,"height",n+"px"),Ja.set(a,"bottom",-(e+n+t)+"px"),Vb(r,o,a)}};return Vb(r,o,a),{setViewportOffset:function(e){Wn.set(o,Bb,e+"px"),w()},isExpanding:x,isShrinking:k(x),refresh:w,restore:function(){y=!1,m.restore(),p.restore(),b.restore()}}},Wb=Ib,Gb=Ob(),Xb="data-"+_a.resolve("last-scroll-top"),Yb=function(e){var t=Ja.getRaw(e,"top").getOr("0");return parseInt(t,10)},$b=function(e){return parseInt(e.dom().scrollTop,10)},qb=function(e,t){var n=t+Wb(e)+"px";Ja.set(e,"top",n)},Kb=function(n,o,r){return Cb.nu(function(e){var t=f($b,n);Gb.animate(t,o,15,function(e){n.dom().scrollTop=e,Ja.set(n,"top",Yb(n)+15+"px")},function(){n.dom().scrollTop=o,Ja.set(n,"top",r+"px"),e(o)},10)})},Jb=function(r,i){return Cb.nu(function(e){var t=f($b,r);Wn.set(r,Xb,t());var n=Math.abs(i-t()),o=Math.ceil(n/10);Gb.animate(t,i,o,function(e,t){cv(r,Xb)!==r.dom().scrollTop?t(r.dom().scrollTop):(r.dom().scrollTop=e,Wn.set(r,Xb,e))},function(){r.dom().scrollTop=i,Wn.set(r,Xb,i),e(i)},10)})},Qb=function(i,a){return Cb.nu(function(e){var t=f(Yb,i),n=function(e){Ja.set(i,"top",e+"px")},o=Math.abs(a-t()),r=Math.ceil(o/10);Gb.animate(t,a,r,n,function(){n(a),e(a)},10)})},Zb=function(t,n,o){var r=xn.owner(t).dom().defaultView;return Cb.nu(function(e){qb(t,o),qb(n,o),r.scrollTo(0,o),e(o)})},ey=function(e,t,n,o,r){var i=Eb(t,n),a=f(pb,e);i<o||i<r?Jb(t,t.dom().scrollTop-i+r).get(a):o<0&&Jb(t,t.dom().scrollTop+o).get(a)},ty=function(a,e){return e(function(o){var r=[],i=0;0===a.length?o([]):A(a,function(e,t){var n;e.get((n=t,function(e){r[n]=e,++i>=a.length&&o(r)}))})})},ny=function(e,c){return e.fold(function(e,t,n){return o=e,r=t,a=c+(i=n),Ja.set(o,r,a+"px"),Cb.pure(i);var o,r,i,a},function(e,t){return n=e,r=c+(o=t),i=Ja.getRaw(n,"top").getOr(o),a=r-parseInt(i,10),u=n.dom().scrollTop+a,Kb(n,u,r);var n,o,r,i,a,u})},oy=function(e,t){var n=jb(e),o=V(n,function(e){return ny(e,t)});return ty(o,Cb.nu)},ry=function(t,n,e,o,r,i){var a=function s(n){var o=Ve(kb.pure({}));return{start:function(t){var e=kb.nu(function(e){return n(t).get(e)});o.set(e)},idle:function(e){o.get().get(function(){e()})}}}(function(e){return Zb(t,n,e)}),u=hp(function(){a.idle(function(){oy(e,o.pageYOffset).get(function(){var e;(e=Gv(i),P.from(e[0]).bind(function(e){var t=e.top()-n.dom().scrollTop;return t>o.innerHeight+5||t<-5?P.some({top:U(t),bottom:U(t+e.height())}):P.none()})).each(function(e){n.dom().scrollTop=n.dom().scrollTop+e.top()}),a.start(0),r.refresh()})})},1e3),c=Kh($t.fromDom(o),"scroll",function(){o.pageYOffset<0||u.throttle()});return oy(e,o.pageYOffset).get(b),{unbind:c.unbind}},iy=function(e){var n=e.cWin(),t=e.ceBody(),o=e.socket(),r=e.toolstrip(),i=e.toolbar(),a=e.contentElement(),u=e.keyboardType(),c=e.outerWindow(),s=e.dropup(),l=Ub(o,t,r,s),f=u(e.outerBody(),n,ho.body(),a,r,i),d=ev(c,{onChange:N,onReady:l.refresh});d.onAdjustment(function(){l.refresh()});var m=Kh($t.fromDom(c),"resize",function(){l.isExpanding()&&l.refresh()}),g=ry(r,o,e.outerBody(),c,l,n),h=function p(n,t){var e=n.document,o=$t.fromTag("div");ji.add(o,_a.resolve("unfocused-selections")),Cn.append($t.fromDom(e.documentElement),o);var r=Kh(o,"touchstart",function(e){e.prevent(),bb(n,t),a()}),i=function(e){var t=$t.fromTag("span");return Vg(t,[_a.resolve("layer-editor"),_a.resolve("unfocused-selection")]),Ja.setAll(t,{left:e.left()+"px",top:e.top()+"px",width:e.width()+"px",height:e.height()+"px"}),t},a=function(){Mn.empty(o)};return{update:function(){a();var e=Gv(n),t=V(e,i);On(o,t)},isActive:function(){return 0<xn.children(o).length},destroy:function(){r.unbind(),Mn.remove(o)},clear:a}}(n,a),v=function(){h.clear()};return{toEditing:function(){f.toEditing(),v()},toReading:function(){f.toReading()},onToolbarTouch:function(e){f.onToolbarTouch(e)},refreshSelection:function(){h.isActive()&&h.update()},clearSelection:v,highlightSelection:function(){h.update()},scrollIntoView:function(e,t){ey(n,o,s,e,t)},updateToolbarPadding:N,setViewportOffset:function(e){l.setViewportOffset(e),Qb(o,e).get(b)},syncHeight:function(){Ja.set(a,"height",a.dom().contentWindow.document.body.scrollHeight+"px")},refreshStructure:l.refresh,destroy:function(){l.restore(),d.destroy(),g.unbind(),m.unbind(),f.destroy(),h.destroy(),vb(ho.body(),Qi)}}},ay=function(o,e){var r=mp(),i=ug(),a=ug(),u=ag(),c=ag();return{enter:function(){e.hide();var n=$t.fromDom(document);ap.getActiveApi(o.editor).each(function(e){i.set({socketHeight:Ja.getRaw(o.socket,"height"),iframeHeight:Ja.getRaw(e.frame(),"height"),outerScroll:document.body.scrollTop}),a.set({exclusives:Tp.exclusive(n,"."+Mh.scrollable())}),ji.add(o.container,_a.resolve("fullscreen-maximized")),fp(o.container,e.body()),r.maximize(),Ja.set(o.socket,"overflow","scroll"),Ja.set(o.socket,"-webkit-overflow-scrolling","touch"),Ji(e.body());var t=tn(["cWin","ceBody","socket","toolstrip","toolbar","dropup","contentElement","cursor","keyboardType","isScrolling","outerWindow","outerBody"],[]);u.set(iy(t({cWin:e.win(),ceBody:e.body(),socket:o.socket,toolstrip:o.toolstrip,toolbar:o.toolbar,dropup:o.dropup.element(),contentElement:e.frame(),cursor:N,outerBody:o.body,outerWindow:o.win,keyboardType:yb.stubborn,isScrolling:function(){return a.get().exists(function(e){return e.socket.isScrolling()})}}))),u.run(function(e){e.syncHeight()}),c.set(xb(e,u,o.toolstrip,o.socket,o.dropup))})},refreshStructure:function(){u.run(function(e){e.refreshStructure()})},exit:function(){r.restore(),c.clear(),u.clear(),e.show(),i.on(function(e){e.socketHeight.each(function(e){Ja.set(o.socket,"height",e)}),e.iframeHeight.each(function(e){Ja.set(o.editor.getFrame(),"height",e)}),document.body.scrollTop=e.scrollTop}),i.clear(),a.on(function(e){e.exclusives.unbind()}),a.clear(),ji.remove(o.container,_a.resolve("fullscreen-maximized")),dp(),Mh.deregister(o.toolbar),Ja.remove(o.socket,"overflow"),Ja.remove(o.socket,"-webkit-overflow-scrolling"),Qi(o.editor.getFrame()),ap.getActiveApi(o.editor).each(function(e){e.clearSelection()})}}},uy=function(e){var t=ir("Getting IosWebapp schema",pp,e);Ja.set(t.toolstrip,"width","100%"),Ja.set(t.container,"position","relative");var n=Wg(vp(function(){t.setReadOnly(t.readOnlyOnInit()),o.enter()},t.translate));t.alloy.add(n);var o=ay(t,{show:function(){t.alloy.add(n)},hide:function(){t.alloy.remove(n)}});return{setReadOnly:t.setReadOnly,refreshStructure:o.refreshStructure,enter:o.enter,exit:o.exit,destroy:N}},cy=tinymce.util.Tools.resolve("tinymce.EditorManager"),sy=function(e){var t=Oe(e.settings,"skin_url").fold(function(){return cy.baseURL+"/skins/oxide"},function(e){return e});return{content:t+"/content.mobile.min.css",ui:t+"/skin.mobile.min.css"}},ly=function(e,t,n){e.system().broadcastOn([oa.formatChanged()],{command:t,state:n})},fy=function(o,e){var t=ae(e.formatter.get());A(t,function(t){e.formatter.formatChanged(t,function(e){ly(o,t,e)})}),A(["ul","ol"],function(n){e.selection.selectorChanged(n,function(e,t){ly(o,n,e)})})},dy=(U(["x-small","small","medium","large","x-large"]),function(e){var t=function(){e._skinLoaded=!0,e.fire("SkinLoaded")};return function(){e.initialized?t():e.on("init",t)}}),my=U("toReading"),gy=U("toEditing"),hy=function(m){return{getNotificationManagerImpl:function(){return{open:b,close:N,reposition:N,getArgs:b}},renderUI:function(){var e=m.getElement(),t=sy(m);0==(!1===m.settings.skin)?(m.contentCSS.push(t.content),ta.DOM.styleSheetLoader.load(t.ui,dy(m))):dy(m)();var n=function(){m.fire("scrollIntoView")},o=$t.fromTag("div"),s=Ot.detect().os.isAndroid()?function u(e){var t=hb({classes:[_a.resolve("android-container")]}),n=Mp(),o=ag(),r=Vp(o),i=Ap(),a=Jp(N,e);return t.add(n.wrapper()),t.add(i),t.add(a.component()),{system:U(t),element:t.element,init:function(e){o.set(bp(e))},exit:function(){o.run(function(e){e.exit(),dh.remove(i,r)})},setToolbarGroups:function(e){var t=n.createGroups(e);n.setGroups(t)},setContextToolbar:function(e){var t=n.createGroups(e);n.setContextToolbar(t)},focusToolbar:function(){n.focus()},restoreToolbar:function(){n.restoreToolbar()},updateMode:function(e){Bp(i,r,e,t.root())},socket:U(i),dropup:U(a)}}(n):function c(e){var t=hb({classes:[_a.resolve("ios-container")]}),n=Mp(),o=ag(),r=Vp(o),i=Ap(),a=Jp(function(){o.run(function(e){e.refreshStructure()})},e);return t.add(n.wrapper()),t.add(i),t.add(a.component()),{system:U(t),element:t.element,init:function(e){o.set(uy(e))},exit:function(){o.run(function(e){dh.remove(i,r),e.exit()})},setToolbarGroups:function(e){var t=n.createGroups(e);n.setGroups(t)},setContextToolbar:function(e){var t=n.createGroups(e);n.setContextToolbar(t)},focusToolbar:function(){n.focus()},restoreToolbar:function(){n.restoreToolbar()},updateMode:function(e){Bp(i,r,e,t.root())},socket:U(i),dropup:U(a)}}(n),r=$t.fromDom(e);Cn.after(r,o),So(o,s.system());var i=e.ownerDocument.defaultView,l=ev(i,{onChange:function(){s.system().broadcastOn([oa.orientationChanged()],{width:tv(i)})},onReady:N}),f=function(e,t,n,o){!1===o&&m.selection.collapse();var r=a(e,t,n);s.setToolbarGroups(!0===o?r.readOnly:r.main),m.setMode(!0===o?"readonly":"design"),m.fire(!0===o?my():gy()),s.updateMode(o)},a=function(e,t,n){var o=e.get(),r={readOnly:o.backToMask.concat(t.get()),main:o.backToMask.concat(n.get())};return r},d=function(e,t){return m.on(e,t),{unbind:function(){m.off(e)}}};return m.on("init",function(){s.init({editor:{getFrame:function(){return $t.fromDom(m.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:N}},onToReading:function(e){return d(my(),e)},onToEditing:function(e){return d(gy(),e)},onScrollToCursor:function(t){return m.on("scrollIntoView",function(e){t(e)}),{unbind:function(){m.off("scrollIntoView"),l.destroy()}}},onTouchToolstrip:function(){n()},onTouchContent:function(){var e,t=$t.fromDom(m.editorContainer.querySelector("."+_a.resolve("toolbar")));(e=t,ea(e).bind(function(e){return s.system().getByDom(e).toOption()})).each(co),s.restoreToolbar(),n()},onTapContent:function(e){var t=e.target();"img"===Ln.name(t)?(m.selection.select(t.dom()),e.kill()):"a"===Ln.name(t)&&s.system().getByDom($t.fromDom(m.editorContainer)).each(function(e){Xi.isAlpha(e)&&na(t.dom())})}},container:$t.fromDom(m.editorContainer),socket:$t.fromDom(m.contentAreaContainer),toolstrip:$t.fromDom(m.editorContainer.querySelector("."+_a.resolve("toolstrip"))),toolbar:$t.fromDom(m.editorContainer.querySelector("."+_a.resolve("toolbar"))),dropup:s.dropup(),alloy:s.system(),translate:N,setReadOnly:function(e){f(c,u,a,e)},readOnlyOnInit:function(){return!1}});var n=function(){s.dropup().disappear(function(){s.system().broadcastOn([oa.dropupDismissed()],{})})},e={label:"The first group",scrollable:!1,items:[Il.forToolbar("back",function(){m.selection.collapse(),s.exit()},{})]},t={label:"Back to read only",scrollable:!1,items:[Il.forToolbar("readonly-back",function(){f(c,u,a,!0)},{})]},o=jh(s,m),r=Uh(m.settings,o),i={label:"The extra group",scrollable:!1,items:[]},a=Ve([{label:"the action group",scrollable:!0,items:r},i]),u=Ve([{label:"The read only mode group",scrollable:!0,items:[]},i]),c=Ve({backToMask:[e],backToReadOnly:[t]});fy(s,m)}),{iframeContainer:s.socket().element().dom(),editorContainer:s.element().dom()}}}};io.add("mobile",hy);var vy=function(t,e){return(n=e,jr.closest(n,function(e){if(!Ln.isElement(e))return!1;var t=Wn.get(e,"id");return t!==undefined&&-1<t.indexOf("aria-owns")}).bind(function(e){var t=Wn.get(e,"id"),n=xn.owner(e);return du(n,'[aria-owns="'+t+'"]')})).exists(function(e){return py(t,e)});var n},py=function(t,e){return Yi(e,function(e){return mn(e,t.element())},U(!1))||vy(t,e)},by=Object.freeze({exhibit:function(e,t){return si({classes:[],styles:t.useFixed()?{}:{position:"relative"}})}}),yy=function(e,t){var n=t||$t.fromDom(document.documentElement);return jr.ancestor(e,f(mn,n)).isSome()},xy=function(e){var t=e.dom();return t===t.window&&e instanceof Window?e:Ln.isDocument(e)?t.defaultView||t.parentWindow:null},wy=function(e,t){return e!==undefined?e:t!==undefined?t:0},ky=function(e){var t,n=e.dom(),o=n.ownerDocument,r=o.body,i=$t.fromDom(o.documentElement);return r===n?sf(r.offsetLeft,r.offsetTop):yy(e,i)?(t=n.getBoundingClientRect(),sf(t.left,t.top)):sf(0,0)},Sy={absolute:function(e){var t=e.dom().ownerDocument,n=t.body,o=xy($t.fromDom(t)),r=t.documentElement,i=wy(o.pageYOffset,r.scrollTop),a=wy(o.pageXOffset,r.scrollLeft),u=wy(r.clientTop,n.clientTop),c=wy(r.clientLeft,n.clientLeft);return ky(e).translate(a-c,i-u)},relative:function(e){var t=e.dom();return sf(t.offsetLeft,t.offsetTop)},viewport:ky},Cy=(Ot.detect().browser.isSafari(),function(e){var t=e!==undefined?e.dom():document,n=t.body.scrollLeft||t.documentElement.scrollLeft,o=t.body.scrollTop||t.documentElement.scrollTop;return sf(n,o)}),zy=Cy,Oy=tn(["x","y","width","height","maxHeight","direction","classes","label","candidateYforTest"],[]),Ty=qt("position","left","top","right","bottom"),My=ge([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Hy=My.southeast,Ey=My.southwest,Vy=My.northeast,Ay=My.northwest,By=My.south,Dy=My.north,Ry=My.east,Fy=My.west,Iy=qt("point","width","height"),_y=qt("x","y","width","height"),Ly=function(e,t,n,o){return{x:U(e),y:U(t),width:U(n),height:U(o),right:U(e+n),bottom:U(t+o)}},Ny=function(e){var t=Sy.absolute(e),n=wf(e),o=tu(e);return Ly(t.left(),t.top(),n,o)},Py=function(o,e){return o.view(e).fold(U([]),function(e){var t=o.owner(e),n=Py(o,t);return[e].concat(n)})},jy=Object.freeze({view:function(e){return(e.dom()===document?P.none():P.from(e.dom().defaultView.frameElement)).map($t.fromDom)},owner:function(e){return xn.owner(e)}}),Uy=function(o){var e,t,n,r,i=$t.fromDom(document),a=zy(i);return(e=o,n=(t=jy).owner(e),r=Py(t,n),P.some(r)).fold(f(Sy.absolute,o),function(e){var t=Sy.viewport(o),n=D(e,function(e,t){var n=Sy.viewport(t);return{left:e.left+n.left(),top:e.top+n.top()}},{left:0,top:0});return sf(n.left+t.left()+a.left(),n.top+t.top()+a.top())})},Wy=function(){var e=window.innerWidth,t=window.innerHeight,n=$t.fromDom(document),o=zy(n);return Ly(o.left(),o.top(),e,t)},Gy=ge([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Xy=function(e,t,n,o,r,i){var a,u,c,s,l,f,d,m,g,h=t.x()-n,v=t.y()-o,p=r-(h+t.width()),b=i-(v+t.height()),y=P.some(h),x=P.some(v),w=P.some(p),k=P.some(b),S=P.none();return a=t.direction(),u=function(){return Ty(e,y,x,S,S)},c=function(){return Ty(e,S,x,w,S)},s=function(){return Ty(e,y,S,S,k)},l=function(){return Ty(e,S,S,w,k)},f=function(){return Ty(e,y,x,S,S)},d=function(){return Ty(e,y,S,S,k)},m=function(){return Ty(e,y,x,S,S)},g=function(){return Ty(e,S,x,w,S)},a.fold(u,c,s,l,f,d,m,g)},Yy=function(e,t){var n=f(Uy,t),o=e.fold(n,n,function(){var e=zy();return Uy(t).translate(-e.left(),-e.top())}),r=wf(t),i=tu(t);return Ly(o.left(),o.top(),r,i)},$y=(Gy.none,Gy.relative),qy=Gy.fixed,Ky=qt("anchorBox","origin"),Jy=ge([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),Qy=function(e,I,_,L,N){var P=_.width(),j=_.height(),o=function(e,o,r,i){var t,n,a,u,c,s,l,f,d,m,g,h,v,p,b,y,x,w,k,S,C,z,O,T,M,H,E,V,A,B,D,R,F=e(I,_,L);return(n=P,a=j,u=N,d=(t=F).x(),m=t.y(),g=t.bubble().offset().left(),h=t.bubble().offset().top(),v=u.x(),p=u.y(),b=u.width(),y=u.height(),S=p<=(w=m+h),C=(k=v<=(x=d+g))&&S,z=x+n<=v+b&&w+a<=p+y,O=k?Math.min(n,v+b-x):Math.abs(v-(x+n)),T=S?Math.min(a,p+y-w):Math.abs(p-(w+a)),M=u.width()-n,H=Math.max(0,x),E=Math.min(H,M),A=U((V=S?w:w+(a-T))+T-p),B=U(p+y-V),c=t.direction(),l=s=B,f=A,D=c.fold(s,s,f,f,s,f,l,l),R=Oy({x:E,y:V,width:O,height:T,maxHeight:D,direction:t.direction(),classes:{on:t.bubble().classesOn(),off:t.bubble().classesOff()},label:t.label(),candidateYforTest:w}),C&&z?Jy.fit(R):Jy.nofit(R,O,T)).fold(Jy.fit,function(e,t,n){return i<n||r<t?Jy.nofit(e,t,n):Jy.nofit(o,r,i)})};return R(e,function(e,t){var n=f(o,t);return e.fold(Jy.fit,n)},Jy.nofit(Oy({x:I.x(),y:I.y(),width:_.width(),height:_.height(),maxHeight:_.height(),direction:Hy(),classes:[],label:"none",candidateYforTest:I.y()}),-1,-1)).fold(b,b)},Zy=function(e,t,n,o){Ja.remove(t,"max-height");var r,i={width:U(wf(r=t)),height:U(tu(r))};return Qy(o.preference(),e,i,n,o.bounds())},ex=function(e,t,n){var o,r,i=function(e){return e+"px"},a=(o=n.origin(),r=t,o.fold(function(){return Ty("absolute",P.some(r.x()),P.some(r.y()),P.none(),P.none())},function(e,t,n,o){return Xy("absolute",r,e,t,n,o)},function(e,t,n,o){return Xy("fixed",r,e,t,n,o)}));Ja.setOptions(e,{position:P.some(a.position()),left:a.left().map(i),top:a.top().map(i),right:a.right().map(i),bottom:a.bottom().map(i)})},tx=function(e,t){nu(e,Math.floor(t))},nx=U(function(e,t){tx(e,t),Ja.setAll(e,{"overflow-x":"hidden","overflow-y":"auto"})}),ox=U(function(e,t){tx(e,t)}),rx=tn(["bounds","origin","preference","maxHeightFunction"],[]),ix=function(e,t,n,o,r,i){var a,u,c,s,l,f=(a=i,u="maxHeightFunction",c=nx(),a[u]===undefined?c:a[u]),d=e.anchorBox(),m=e.origin(),g=rx({bounds:(s=m,l=r,l.fold(function(){return s.fold(Wy,Wy,Ly)},function(e){return s.fold(e,e,Ly)})),origin:m,preference:o,maxHeightFunction:f});ax(d,t,n,g)},ax=function(e,t,n,o){var r,i,a,u,c=Zy(e,t,n,o);ex(t,c,o),r=t,i=c.classes(),Ag(r,i.off),Vg(r,i.on),a=t,u=c,o.maxHeightFunction()(a,u.maxHeight())},ux=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],cx=function(e,t,n){var r=function(e){return Oe(n,e).getOr([])},o=function(e,t,n){var o=$(ux,n);return{offset:function(){return sf(e,t)},classesOn:function(){return W(n,r)},classesOff:function(){return W(o,r)}}};return{southeast:function(){return o(-e,t,["top","alignLeft"])},southwest:function(){return o(e,t,["top","alignRight"])},south:function(){return o(-e/2,t,["top","alignCentre"])},northeast:function(){return o(-e,-t,["bottom","alignLeft"])},northwest:function(){return o(e,-t,["bottom","alignRight"])},north:function(){return o(-e/2,-t,["bottom","alignCentre"])},east:function(){return o(e,-t/2,["valignCentre","left"])},west:function(){return o(-e,-t/2,["valignCentre","right"])}}},sx=function(){return cx(0,0,{})},lx=qt("x","y","bubble","direction","label"),fx=function(e){return e.x()},dx=function(e,t){return e.x()+e.width()/2-t.width()/2},mx=function(e,t){return e.x()+e.width()-t.width()},gx=function(e,t){return e.y()-t.height()},hx=function(e){return e.y()+e.height()},vx=function(e,t){return e.y()+e.height()/2-t.height()/2},px=function(e,t,n){return lx(fx(e),hx(e),n.southeast(),Hy(),"layout-se")},bx=function(e,t,n){return lx(mx(e,t),hx(e),n.southwest(),Ey(),"layout-sw")},yx=function(e,t,n){return lx(fx(e),gx(e,t),n.northeast(),Vy(),"layout-ne")},xx=function(e,t,n){return lx(mx(e,t),gx(e,t),n.northwest(),Ay(),"layout-nw")},wx=function(e,t,n){return lx(dx(e,t),gx(e,t),n.north(),Dy(),"layout-n")},kx=function(e,t,n){return lx(dx(e,t),hx(e),n.south(),By(),"layout-s")},Sx=function(e,t,n){return lx((o=e).x()+o.width(),vx(e,t),n.east(),Ry(),"layout-e");var o},Cx=function(e,t,n){return lx((o=t,e.x()-o.width()),vx(e,t),n.west(),Fy(),"layout-w");var o},zx=function(){return[px,bx,yx,xx,kx,wx,Sx,Cx]},Ox=function(){return[bx,px,xx,yx,kx,wx,Sx,Cx]},Tx=yi(["anchorBox","bubble","overrides","layouts","placer"]),Mx=function(){return zr("layouts",[hr("onLtr"),hr("onRtl")])},Hx=function(t,e,n,o){var r=e.layouts().map(function(e){return e.onLtr()(t)}).getOr(n),i=e.layouts().map(function(e){return e.onRtl()(t)}).getOr(o);return Zu(r,i)(t)},Ex=[hr("hotspot"),Mx(),pa("placement",function(e,t,n){var o=t.hotspot(),r=Yy(n,o.element()),i=Hx(e.element(),t,zx(),Ox());return P.some(Tx({anchorBox:U(r),bubble:U(sx()),overrides:U({}),layouts:U(i),placer:P.none}))})],Vx=[hr("x"),hr("y"),Tr("height",0),Tr("width",0),Tr("bubble",sx()),Mx(),pa("placement",function(e,t,n){var o=Ly(t.x(),t.y(),t.width(),t.height()),r=Hx(e.element(),t,zx(),Ox());return P.some(Tx({anchorBox:U(o),bubble:t.bubble,overrides:U({}),layouts:U(r),placer:P.none}))})],Ax=qt("element","offset"),Bx=ge([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Dx=function(e){return e.fold(function(e){return e},function(e,t,n){return e.translate(-t,-n)})},Rx=function(e){return e.fold(function(e){return e},function(e,t,n){return e})},Fx=function(e){return R(e,function(e,t){return e.translate(t.left(),t.top())},sf(0,0))},Ix=function(e){var t=V(e,Rx);return Fx(t)},_x=Bx.screen,Lx=Bx.absolute,Nx=function(e,t,n){var o,r,i,a=xn.owner(e.element()),u=zy(a),c=(o=e,r=n,i=xn.defaultView(r.root()).dom(),P.from(i.frameElement).map($t.fromDom).filter(function(e){var t=xn.owner(e),n=xn.owner(o.element());return mn(t,n)}).map(Sy.absolute)).getOr(u);return Lx(c,u.left(),u.top())},Px=function(e,t,n,o){var r=e,i=t,a=n,u=o;e<0&&(r=0,a=n+e),t<0&&(i=0,u=o+t);var c=_x(sf(r,i));return P.some(Iy(c,a,u))},jx=function(e,c,s,l,f){return e.map(function(e){var t,n,o,r=[c,e.point()],i=(t=function(){return Ix(r)},n=function(){return Ix(r)},o=function(){return e=V(r,Dx),Fx(e);var e},l.fold(t,n,o)),a=_y(i.left(),i.top(),e.width(),e.height()),u=Hx(f,s,s.showAbove()?[yx,xx,px,bx,wx,kx]:[px,bx,yx,xx,kx,kx],s.showAbove()?[xx,yx,bx,px,wx,kx]:[bx,px,xx,yx,kx,wx]);return Tx({anchorBox:U(a),bubble:U(s.bubble().getOr(sx())),overrides:s.overrides,layouts:U(u),placer:P.none})})},Ux=qt("element","offset"),Wx=function(e,t){return Ln.isText(e)?Ux(e,t):function(e,t){var n=xn.children(e);if(0===n.length)return Ax(e,t);if(t<n.length)return Ax(n[t],0);var o=n[n.length-1],r=Ln.isText(o)?lv(o).length:xn.children(o).length;return Ax(o,r)}(e,t)},Gx=function(e,t){return t.getSelection().getOrThunk(function(){return function(){return Lv(e)}})().map(function(e){var t=Wx(e.start(),e.soffset()),n=Wx(e.finish(),e.foffset());return bv.range(t.element(),t.offset(),n.element(),n.offset())})},Xx=[kr("getSelection"),hr("root"),kr("bubble"),Mx(),Tr("overrides",{}),Tr("showAbove",!1),pa("placement",function(e,t,n){var o=xn.defaultView(t.root()).dom(),r=Nx(e,0,t),i=Gx(o,t).bind(function(e){return jv(o,bv.exactFromRange(e)).orThunk(function(){var t=$t.fromText("\ufeff");return Cn.before(e.start(),t),jv(o,bv.exact(t,0,t,1)).map(function(e){return Mn.remove(t),e})}).bind(function(e){return Px(e.left(),e.top(),e.width(),e.height())})}),a=Gx(o,t).bind(function(e){return Ln.isElement(e.start())?P.some(e.start()):xn.parent(e.start())}).getOr(e.element());return jx(i,r,t,n,a)})],Yx=[hr("node"),hr("root"),kr("bubble"),Mx(),Tr("overrides",{}),Tr("showAbove",!1),pa("placement",function(r,i,a){var u=Nx(r,0,i);return i.node().bind(function(e){var t=e.dom().getBoundingClientRect(),n=Px(t.left,t.top,t.width,t.height),o=i.node().getOr(r.element());return jx(n,u,i,a,o)})})],$x=function(e){return e.x()+e.width()},qx=function(e,t){return e.x()-t.width()},Kx=function(e,t){return e.y()-t.height()+e.height()},Jx=function(e){return e.y()},Qx=function(e,t,n){return lx($x(e),Jx(e),n.southeast(),Hy(),"link-layout-se")},Zx=function(e,t,n){return lx(qx(e,t),Jx(e),n.southwest(),Ey(),"link-layout-sw")},ew=function(e,t,n){return lx($x(e),Kx(e,t),n.northeast(),Vy(),"link-layout-ne")},tw=function(e,t,n){return lx(qx(e,t),Kx(e,t),n.northwest(),Ay(),"link-layout-nw")},nw=[hr("item"),Mx(),pa("placement",function(e,t,n){var o=Yy(n,t.item().element()),r=Hx(e.element(),t,[Qx,Zx,ew,tw],[Zx,Qx,tw,ew]);return P.some(Tx({anchorBox:U(o),bubble:U(sx()),overrides:U({}),layouts:U(r),placer:P.none}))})],ow=cr("anchor",{selection:Xx,node:Yx,hotspot:Ex,submenu:nw,makeshift:Vx}),rw=function(e,t,n,o,r){var i,a=(i=n.anchorBox(),Ky(i,t));ix(a,r.element(),n.bubble(),n.layouts(),o,n.overrides())},iw=function(t,e,n,o,r,i){var a=ar("positioning anchor.info",ow,o);Ja.set(r.element(),"position","fixed");var u=Ja.getRaw(r.element(),"visibility");Ja.set(r.element(),"visibility","hidden");var c,s,l,f=e.useFixed()?qy(0,0,window.innerWidth,window.innerHeight):(c=t,s=Sy.absolute(c.element()),l=c.element().dom().getBoundingClientRect(),$y(s.left(),s.top(),l.width,l.height)),d=a.placement(),m=i.map(function(e){return function(){return Ny(e)}}).or(e.getBounds());d(t,a,f).each(function(e){e.placer().getOr(rw)(t,f,e,m,r)}),u.fold(function(){Ja.remove(r.element(),"visibility")},function(e){Ja.set(r.element(),"visibility",e)}),Ja.getRaw(r.element(),"left").isNone()&&Ja.getRaw(r.element(),"top").isNone()&&Ja.getRaw(r.element(),"right").isNone()&&Ja.getRaw(r.element(),"bottom").isNone()&&Ja.getRaw(r.element(),"position").is("fixed")&&Ja.remove(r.element(),"position")},aw=Object.freeze({position:function(e,t,n,o,r){var i=P.none();iw(e,t,n,o,r,i)},positionWithin:iw,getMode:function(e,t,n){return t.useFixed()?"fixed":"absolute"}}),uw=[Tr("useFixed",!1),kr("getBounds")],cw=Ci({fields:uw,name:"positioning",active:by,apis:aw}),sw=function(e,t,n,o){var r=function(t,e,n,o){n.get().each(function(e){ko(t)});var r=e.getAttachPoint()();bo(r,t);var i=t.getSystem().build(o);return bo(t,i),n.set(i),i}(e,t,n,o);return t.onOpen()(e,r),r},lw=function(t,n,o){o.get().each(function(e){ko(t),wo(t),n.onClose()(t,e),o.clear()})},fw=function(e,t,n){return n.isOpen()},dw=function(e,t,n){var o,r,i,a,u=t.getAttachPoint()();Ja.set(e.element(),"position",cw.getMode(u)),o=e,r="visibility",i=t.cloakVisibilityAttr(),a="hidden",Ja.getRaw(o.element(),r).fold(function(){Wn.remove(o.element(),i)},function(e){Wn.set(o.element(),i,e)}),Ja.set(o.element(),r,a)},mw=function(e,t,n){var o;o=e.element(),H(["top","left","right","bottom"],function(e){return Ja.getRaw(o,e).isSome()})||Ja.remove(e.element(),"position"),function(e,t,n){if(Wn.has(e.element(),n)){var o=Wn.get(e.element(),n);Ja.set(e.element(),t,o)}else Ja.remove(e.element(),t)}(e,"visibility",t.cloakVisibilityAttr())},gw=Object.freeze({cloak:dw,decloak:mw,open:sw,openWhileCloaked:function(e,t,n,o,r){dw(e,t,n),sw(e,t,n,o),r(),mw(e,t,n)},close:lw,isOpen:fw,isPartOf:function(t,n,e,o){return fw(0,0,e)&&e.get().exists(function(e){return n.isPartOf()(t,e,o)})},getState:function(e,t,n){return n.get()}}),hw=Object.freeze({events:function(n,o){return Wr([Yr(Ft(),function(e,t){lw(e,n,o)})])}}),vw=[ma("onOpen"),ma("onClose"),hr("isPartOf"),hr("getAttachPoint"),Tr("cloakVisibilityAttr","data-precloak-visibility")],pw=Object.freeze({init:function(){var t=Ve(P.none()),e=U("not-implemented");return wi({readState:e,isOpen:function(){return t.get().isSome()},clear:function(){t.set(P.none())},set:function(e){t.set(P.some(e))},get:function(e){return t.get()}})}}),bw=Ci({fields:vw,name:"sandboxing",active:hw,apis:gw,state:pw}),yw=U("dismiss.popups"),xw=U("mouse.released"),ww=Uo([Tr("isExtraPart",U(!1)),zr("fireEventInstead",[Tr("event",jt())])]),kw=function(e){var t=Sw(e);return wa.config(t)},Sw=function(e){var n=ir("Dismissal",ww,e);return{channels:Te(yw(),{schema:Uo([hr("target")]),onReceive:function(t,e){bw.isOpen(t)&&(bw.isPartOf(t,e.target())||n.isExtraPart(t,e.target())||n.fireEventInstead.fold(function(){return bw.close(t)},function(e){return ao(t,e.event)}))}})}},Cw=Tl({name:"InlineView",configFields:[hr("lazySink"),ma("onShow"),ma("onHide"),gs("inlineBehaviours",[bw,wa]),zr("fireDismissalEventInstead",[Tr("event",jt())]),Tr("getRelated",P.none),Tr("eventOrder",P.none)],factory:function(u,e){var r=function(e,t,n,o){var r=u.lazySink()().getOrDie();bw.openWhileCloaked(e,n,function(){return cw.positionWithin(r,t,e,o)}),u.onShow()(e)},t={setContent:function(e,t){bw.open(e,t)},showAt:function(e,t,n){var o=P.none();r(e,t,n,o)},showWithin:r,showMenuAt:function(e,t,n){var r,o,i,a=(r=u.lazySink(),o=t,i=n,ph.sketch({dom:{tag:"div"},data:i.data,markers:i.menu.markers,onEscape:function(){return P.some(!0)},onExecute:function(){return P.some(!0)},onOpenMenu:function(e,t){cw.position(r().getOrDie(),o,t)},onOpenSubmenu:function(e,t,n){var o=r().getOrDie();cw.position(o,{anchor:"submenu",item:t},n)}}));bw.open(e,a),u.onShow()(e)},hide:function(e){bw.close(e),u.onHide()(e)},getContent:function(e){return bw.getState(e)},isOpen:bw.isOpen};return te({uid:u.uid(),dom:u.dom(),behaviours:te(ki([bw.config({isPartOf:function(e,t,n){return py(t,n)||(o=e,r=n,u.getRelated()(o).exists(function(e){return py(e,r)}));var o,r},getAttachPoint:function(){return u.lazySink()().getOrDie()}}),kw(te({isExtraPart:U(!1)},u.fireDismissalEventInstead().map(function(e){return{fireEventInstead:{event:e.event()}}}).getOr({})))]),hs(u.inlineBehaviours())),eventOrder:u.eventOrder(),apis:t})},apis:{showAt:function(e,t,n,o){e.showAt(t,n,o)},showWithin:function(e,t,n,o,r){e.showWithin(t,n,o,r)},showMenuAt:function(e,t,n,o){e.showMenuAt(t,n,o)},hide:function(e,t){e.hide(t)},isOpen:function(e,t){return e.isOpen(t)},getContent:function(e,t){return e.getContent(t)},setContent:function(e,t,n){e.setContent(t,n)}}}),zw={"icon-accessibility-check":'<svg width="24" height="24"><g id="icon-accessibility-check" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 2a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5c0-.6-.4-1-1-1a1 1 0 0 0-1 1v5c0 .6-.4 1-1 1a1 1 0 0 1-1-1V9H4a1 1 0 1 1 0-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-align-center":'<svg width="24" height="24"><g id="icon-align-center" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" id="shape"/></g></svg>',"icon-align-justify":'<svg width="24" height="24"><g id="icon-align-justify" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" id="shape"/></g></svg>',"icon-align-left":'<svg width="24" height="24"><g id="icon-align-left" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" id="shape"/></g></svg>',"icon-align-none":'<svg width="24" height="24"><g id="icon-align-none" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14.2 5L13 7H5a1 1 0 1 1 0-2h9.2zm4 0h.8a1 1 0 0 1 0 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 0 1 0-2h6.8zm4 0H19a1 1 0 0 1 0 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 0 1 0-2h4.4zm4 0H19a1 1 0 0 1 0 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 0 1 0-2h2zm4 0h8a1 1 0 0 1 0 2H9.8l1.2-2zm5.2-13.5l1.3.7-9.7 16.3-1.3-.7 9.7-16.3z" id="shape"/></g></svg>',"icon-align-right":'<svg width="24" height="24"><g id="icon-align-right" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" id="shape"/></g></svg>',"icon-background-color":'<svg width="24" height="24"><g id="icon-background-color" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle" opacity=".1" d="M3 3h18v16H3z"/><path id="color" d="M3 19h18v3H3z"/><path d="M8.7 17h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z" id="shape"/></g></svg>',"icon-bold":'<svg width="24" height="24"><g id="icon-bold" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 0 1-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4z" id="B"/></g></svg>',"icon-bookmark":'<svg width="24" height="24"><g id="icon-bookmark" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 0 0-1 1z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-border-width":'<svg width="24" height="24"><g id="icon-border-width" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 14.8h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2zm-.5 3.7h15c.3 0 .5.2.5.5s-.2.5-.5.5h-15a.5.5 0 1 1 0-1zm.5-8.3h14c.6 0 1 .4 1 1v1c0 .5-.4 1-1 1H5a1 1 0 0 1-1-1v-1c0-.6.4-1 1-1zm0-5.7h14c.6 0 1 .4 1 1v2c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-2c0-.6.4-1 1-1z" id="shape"/></g></svg>',"icon-brightness":'<svg width="24" height="24"><g id="icon-brightness" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 0 1-.7-.3A1 1 0 0 1 11 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-1a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H5a1 1 0 0 1-.7-.3A1 1 0 0 1 4 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7zm10 3.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 0 1-.8.3 1 1 0 0 1-.6-.3l-.8-.7a1 1 0 0 1-.3-.8c0-.2.1-.5.3-.7a1 1 0 0 1 1.4 0zm-10-7l-.7-.8a1 1 0 0 1-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.8-.3zm10 0a1 1 0 0 1-.8.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 0 1 0 1.4l-.8.8a1 1 0 0 1-.6.3 1 1 0 0 1-.8-.3 1 1 0 0 1-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 0 1 3.7 2.4 4 4 0 0 1 0 3.2A4 4 0 0 1 12 16a4 4 0 0 1-3.7-2.4 4 4 0 0 1 0-3.2A4 4 0 0 1 12 8zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7z" id="shape"/></g></svg>',"icon-browse":'<svg width="24" height="24"><g id="icon-browse" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 1 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1-1.4 1.4L13 13.4V20a1 1 0 0 1-2 0v-6.6z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-cancel":'<svg width="24" height="24"><g id="icon-cancel" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 4.6a7.4 7.4 0 1 1 0 14.8 7.4 7.4 0 0 1 0-14.8zM12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-character-count":'<svg width="24" height="24"><g id="icon-character-count" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 11.5h16v1H4v-1zm4.8-6.8V10H7.7V5.8h-1v-1h2zM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1zM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 0 1-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 0 0-.5-.1 1 1 0 0 0-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 0 0-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 0 0 1.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 0 0-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 0 0-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 0 1-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 0 1-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1z" id="shape"/></g></svg>',"icon-checkmark":'<svg width="24" height="24"><g id="icon-checkmark" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18.2 5.4a1 1 0 0 1 1.6 1.2l-8 12a1 1 0 0 1-1.5.1l-5-5a1 1 0 1 1 1.4-1.4l4.1 4.1 7.4-11z" id="Shape-Copy" fill-rule="nonzero"/></g></svg>',"icon-chevron-down":'<svg width="10" height="10"><g id="icon-chevron-down" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-chevron-left":'<svg width="10" height="10"><g id="icon-chevron-left" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7.8 1.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 0 1 0-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-chevron-right":'<svg width="10" height="10"><g id="icon-chevron-right" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M2.2 1.3a.8.8 0 0 1 0-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 0 1 0-1.1L6 5 2.2 1.3z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-chevron-up":'<svg width="10" height="10"><g id="icon-chevron-up" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 0 1 0-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-close":'<svg width="24" height="24"><g id="icon-close" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M17.3 8.2L13.4 12l3.9 3.8a1 1 0 0 1-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 0 1-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 0 1 1.5-1.5l3.8 3.9 3.8-3.9a1 1 0 0 1 1.5 1.5z" id="shape"/></g></svg>',"icon-code-sample":'<svg width="24" height="26"><g id="icon-code-sample" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7.1 11a2.8 2.8 0 0 1-.8 2 2.8 2.8 0 0 1 .8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 0 1-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 0 1 .8-2 2.8 2.8 0 0 1-.8-2zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2zM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 0 1-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 0 1-.5-.5V17a3 3 0 0 0 1-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5z" id="shape"/></g></svg>',"icon-color-levels":'<svg width="24" height="24"><g id="icon-color-levels" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M17.5 11.4A9 9 0 0 1 18 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 0 1-3.7 3 5.7 5.7 0 0 1-3.2 0A5.9 5.9 0 0 1 7.6 18a6.2 6.2 0 0 1-1.4-2.6 6.7 6.7 0 0 1 0-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 0 1 2.3-4A20 20 0 0 1 12 4a26.4 26.4 0 0 1 3.2 3.4 18.2 18.2 0 0 1 2.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 0 0-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 0 1-1.3 3 5.3 5.3 0 0 1-2.3 1.5 4.9 4.9 0 0 1-2 .1 4.3 4.3 0 0 0 2.4.8 4 4 0 0 0 2-.6 4 4 0 0 0 1.5-1.5z" id="shape"/></g></svg>',"icon-color-picker":'<svg width="24" height="24"><g id="icon-color-picker" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 3a9 9 0 0 0 0 18 1.5 1.5 0 0 0 1.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 0 0 5-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm3-4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm3 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-color-swatch":'<svg width="24" height="24"><g id="icon-color-swatch" stroke="none" stroke-width="1" fill-rule="evenodd"><rect id="Rectangle" x="3" y="3" width="18" height="18" rx="1"/></g></svg>',"icon-comment":'<svg width="24" height="24"><g id="icon-comment" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-contrast":'<svg width="24" height="24"><g id="icon-contrast" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4zm-6 8a6 6 0 0 0 6 6V6a6 6 0 0 0-6 6z" id="shape"/></g></svg>',"icon-copy":'<svg width="24" height="24"><g id="icon-copy" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 3H6a2 2 0 0 0-2 2v11h2V5h10V3zm1 4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7zm0 12V9h-7v10h7z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-crop":'<svg width="24" height="24"><g id="icon-crop" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-2H7V9H5a1 1 0 1 1 0-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3zM9 9v5l5-5H9zm1 6h5v-5l-5 5z" id="shape"/></g></svg>',"icon-cut":'<svg width="24" height="24"><g id="icon-cut" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 0 1 0 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8zm-8.5 2.2l.1-.4v-.3-.4a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2 1.6 1.6 0 0 0-.8 0 2.6 2.6 0 0 0-.8.3 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3 2.8 2.8 0 0 0 1-1zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4zm5.4 4l.2-.5v-.4-.3a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3 1.5 1.5 0 0 0-.8 0 1 1 0 0 0-.4.2 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4l.3.4.3.4a2.8 2.8 0 0 0 .8.5l.4.1h.7l.5-.2z" id="shape"/></g></svg>',"icon-document-properties":'<svg width="24" height="24"><g id="icon-document-properties" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-drag":'<svg width="24" height="24"><g id="icon-drag" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M13 5h2v2h-2V5zm0 4h2v2h-2V9zM9 9h2v2H9V9zm4 4h2v2h-2v-2zm-4 0h2v2H9v-2zm0 4h2v2H9v-2zm4 0h2v2h-2v-2zM9 5h2v2H9V5z" id="shape"/></g></svg>',"icon-duplicate":'<svg width="24" height="24"><g id="icon-duplicate" stroke="none" stroke-width="1" fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10zm3 8h-2V9h-7v10h9a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7a2 2 0 0 1 2 2v2z" id="Combined-Shape"/><path d="M17 14h1a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1h-1a1 1 0 0 1 0-2h1v-1a1 1 0 0 1 2 0v1z" id="Combined-Shape"/></g></svg>',"icon-edit-image":'<svg width="24" height="24"><g id="icon-edit-image" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 16h2V7a2 2 0 0 0-2-2H7v2h11v9zM6 17h15a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1H6a2 2 0 0 1-2-2V7H3a1 1 0 1 1 0-2h1V4a1 1 0 1 1 2 0v13zm3-5.3l1.3 2 3-4.7 3.7 6H7l2-3.3z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-embed":'<svg width="24" height="24"><g id="icon-embed" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 0 1 0 .8l-5.6 4A.5.5 0 0 1 9 16V8a.5.5 0 0 1 .8-.4z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-emoji":'<svg width="24" height="24"><g id="icon-emoji" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5zM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-fill":'<svg width="24" height="26"><g id="icon-fill" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16.6 12l-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 0 0 2.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.3-2-3.5-2-3.5z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-flip-horizontally":'<svg width="24" height="24"><g id="icon-flip-horizontally" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 0 0-2 2zm14-2v2h2a2 2 0 0 0-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 0 0 2-2h-2v2z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-flip-vertically":'<svg width="24" height="24"><g id="icon-flip-vertically" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 0 0-2 2zm14-2v2h2a2 2 0 0 0-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 0 0 2-2h-2v2z" id="Shape" fill-rule="nonzero" transform="rotate(90 12 12)"/></g></svg>',"icon-format-painter":'<svg width="24" height="24"><g id="icon-format-painter" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 0 0-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-fullscreen":'<svg width="24" height="24"><g id="icon-fullscreen" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 1 1 0-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 1 1-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 1 1 1.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 1 1 0-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 1 1 0 1.7H5a.9.9 0 0 1-.9-.9v-4.4a.9.9 0 1 1 1.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 0 1-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 0 1 0 1.8H7l3 2.9-1.3 1.2z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-gamma":'<svg width="24" height="24"><g id="icon-gamma" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 0 0-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 0 1 .6.5l.1.3a8.5 8.5 0 0 1 .3.6l1.9 4.6 2-5.2a1 1 0 0 1 1-.6.5.5 0 0 1 .5.6L13 14v2.8a.7.7 0 0 1-1.4 0z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-help":'<svg width="24" height="24"><g id="icon-help" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 0 0-6 9 6.3 6.3 0 0 0 1.4 2l1 1a6.3 6.3 0 0 0 3.6 1 6.5 6.5 0 0 0 6-9 6.3 6.3 0 0 0-1.4-2l-1-1a6.3 6.3 0 0 0-3.6-1zM12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4z" id="shape"/><path d="M9.6 9.7a.7.7 0 0 1-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 0 0-.8.8.8.8 0 0 1-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8z" id="Path-2" fill-rule="nonzero"/><circle id="Oval" cx="12" cy="16" r="1"/></g></svg>',"icon-highlight-bg-color":'<svg width="24" height="24"><g id="icon-highlight-bg-color" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="color" d="M3 18h18v3H3z"/><path d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zM12.8 9.2L11 7.4l3-2.9a2 2 0 0 1 2.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-home":'<svg width="24" height="24"><g id="icon-home" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Shape" fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></g></svg>',"icon-horizontal-rule":'<svg width="24" height="24"><g id="icon-horizontal-rule" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="shape" d="M4 11h16v2H4z"/></g></svg>',"icon-image-options":'<svg width="24" height="24"><g id="icon-image-options" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-image":'<svg width="24" height="24"><g id="icon-image" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 15.7l3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7zM5 18V19h3l2.8-2.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-indent":'<svg width="24" height="24"><g id="icon-indent" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6z" id="Combined-Shape"/></g></svg>',"icon-indeterminate":'<svg width="24" height="24"><g id="icon-indeterminate" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9 11a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2H9z" id="Combined-Shape"/></g></svg>',"icon-info":'<svg width="24" height="24"><g id="icon-info" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4zm-1 3v2h2V7h-2zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4z" id="shape"/></g></svg>',"icon-insert-character":'<svg width="24" height="24"><g id="icon-insert-character" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5z" id="shape"/></g></svg>',"icon-insert-time":'<svg width="24" height="24"><g id="icon-insert-time" stroke="none" stroke-width="1" fill-rule="evenodd"><g id="clock" transform="translate(2 2)" fill-rule="nonzero"><path d="M17 0H3a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V3a3 3 0 0 0-3-3zm-7 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16z" id="Shape"/><path d="M13 10h-3V5a.5.5 0 0 0-1 0v6h4a.5.5 0 0 0 0-1z" id="Shape"/></g></g></svg>',"icon-invert":'<svg width="24" height="24"><g id="icon-invert" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 19.3L16.5 18a5.8 5.8 0 0 1-3.1 1.9 6.1 6.1 0 0 1-5.5-1.6A5.8 5.8 0 0 1 6 14v-.3l.1-1.2A13.9 13.9 0 0 1 7.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 0 0 .2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 0 0-3-4.2L12 6a26.1 26.1 0 0 0-2.2 2.5l-1-1a20.9 20.9 0 0 1 2.9-3.3L12 4l1 .8a22.2 22.2 0 0 1 4 5.4c.6 1.2 1 2.4 1 3.6z" id="shape"/></g></svg>',"icon-italic":'<svg width="24" height="24"><g id="icon-italic" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8z" id="I"/></g></svg>',"icon-line":'<svg width="24" height="24"><g id="icon-line" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1zM4 18h16v2H4v-2z" id="shape"/></g></svg>',"icon-link":'<svg width="24" height="24"><g id="icon-link" stroke="none" stroke-width="1" fill-rule="evenodd"><g id="link" transform="translate(3 3)" fill-rule="nonzero"><path d="M3.2 9.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4A1 1 0 1 1 11.4 8a2.9 2.9 0 0 1 0 4L6.6 17a3.9 3.9 0 0 1-5.5-5.5l2-2zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L8 7.3a1 1 0 0 0 0 1.4A1 1 0 1 1 6.6 10a2.9 2.9 0 0 1 0-4L11.4 1a3.9 3.9 0 0 1 5.5 5.5l-2 2z" id="Shape"/></g></g></svg>',"icon-list-bull-circle":'<svg width="48" height="48"><g id="icon-list-bull-circle" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M11 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" id="Oval" fill-rule="nonzero"/><path d="M11 26a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" id="Oval-Copy" fill-rule="nonzero"/><path d="M11 36a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" id="Oval-Copy-2" fill-rule="nonzero"/><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/></g></svg>',"icon-list-bull-default":'<svg width="48" height="48"><g id="icon-list-bull-default" stroke="none" stroke-width="1" fill-rule="evenodd"><circle id="Oval" cx="11" cy="14" r="3"/><circle id="Oval-Copy" cx="11" cy="24" r="3"/><circle id="Oval-Copy-2" cx="11" cy="34" r="3"/><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/></g></svg>',"icon-list-bull-square":'<svg width="48" height="48"><g id="icon-list-bull-square" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle" d="M8 11h6v6H8z"/><path id="Rectangle-Copy" d="M8 21h6v6H8z"/><path id="Rectangle-Copy-2" d="M8 31h6v6H8z"/><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/></g></svg>',"icon-list-num-default":'<svg width="48" height="48"><g id="icon-list-num-default" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z" id="1.-2.-3."/></g></svg>',"icon-list-num-lower-alpha":'<svg width="48" height="48"><g id="icon-list-num-lower-alpha" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z" id="a.-b.-c."/></g></svg>',"icon-list-num-lower-greek":'<svg width="48" height="48"><g id="icon-list-num-lower-greek" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3zM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z" id="\u03b1.-\u03b2.-\u0194."/></g></svg>',"icon-list-num-lower-roman":'<svg width="48" height="48"><g id="icon-list-num-lower-roman" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15zm0 10v-1.2h1.3V26H15zm0 10v-1.2h1.3V36H15z" id=".-.-."/><path id="Rectangle" fill-rule="nonzero" d="M12 21h1.5v5H12z"/><path id="Rectangle-Copy-6" fill-rule="nonzero" d="M12 31h1.5v5H12z"/><path id="Rectangle-Copy-2" fill-rule="nonzero" d="M9 21h1.5v5H9z"/><path id="Rectangle-Copy-7" fill-rule="nonzero" d="M9 31h1.5v5H9z"/><path id="Rectangle-Copy-10" fill-rule="nonzero" d="M6 31h1.5v5H6z"/><path id="Rectangle-Copy-4" fill-rule="nonzero" d="M12 11h1.5v5H12z"/><path id="Rectangle-Copy" fill-rule="nonzero" d="M12 19h1.5v1H12z"/><path id="Rectangle-Copy-8" fill-rule="nonzero" d="M12 29h1.5v1H12z"/><path id="Rectangle-Copy-3" fill-rule="nonzero" d="M9 19h1.5v1H9z"/><path id="Rectangle-Copy-9" fill-rule="nonzero" d="M9 29h1.5v1H9z"/><path id="Rectangle-Copy-11" fill-rule="nonzero" d="M6 29h1.5v1H6z"/><path id="Rectangle-Copy-5" fill-rule="nonzero" d="M12 9h1.5v1H12z"/></g></svg>',"icon-list-num-upper-alpha":'<svg width="48" height="48"><g id="icon-list-num-upper-alpha" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/><path d="M12.6 17l-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3zM11 12.3l-.7 2.3h1.6l-.8-2.3zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z" id="A.-B.-C."/></g></svg>',"icon-list-num-upper-roman":'<svg width="48" height="48"><g id="icon-list-num-upper-roman" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle-2" opacity=".2" d="M18 12h22v4H18z"/><path id="Rectangle-2-Copy" opacity=".2" d="M18 22h22v4H18z"/><path id="Rectangle-2-Copy-2" opacity=".2" d="M18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15zm0 10v-1.2h1.3V27H15zm0 10v-1.2h1.3V37H15z" id=".-.-."/><path id="Rectangle" fill-rule="nonzero" d="M12 20h1.5v7H12z"/><path id="Rectangle-Copy-6" fill-rule="nonzero" d="M12 30h1.5v7H12z"/><path id="Rectangle-Copy-2" fill-rule="nonzero" d="M9 20h1.5v7H9z"/><path id="Rectangle-Copy-7" fill-rule="nonzero" d="M9 30h1.5v7H9z"/><path id="Rectangle-Copy-10" fill-rule="nonzero" d="M6 30h1.5v7H6z"/><path id="Rectangle-Copy-4" fill-rule="nonzero" d="M12 10h1.5v7H12z"/></g></svg>',"icon-lock":'<svg width="24" height="24"><g id="icon-lock" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3zM10 8v3h4V8a1 1 0 0 0-.3-.7A1 1 0 0 0 13 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7z" id="shape"/></g></svg>',"icon-ltr":'<svg width="24" height="24"><g id="icon-ltr" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M11 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 7.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6z" id="shape"/></g></svg>',"icon-new-document":'<svg width="24" height="24"><g id="icon-new-document" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-new-tab":'<svg width="24" height="24"><g id="icon-new-tab" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M15 13l2-2v8H5V7h8l-2 2H7v8h8v-4zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19z" id="shape"/></g></svg>',"icon-non-breaking":'<svg width="24" height="24"><g id="icon-non-breaking" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M11 11H8a1 1 0 1 1 0-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-3zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1z" id="shape"/></g></svg>',"icon-notice":'<svg width="24" height="24"><g id="icon-notice" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" id="shape"/></g></svg>',"icon-ordered-list":'<svg width="24" height="24"><g id="icon-ordered-list" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2H4.5a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 0 1 0-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 1 1 0-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 1 1 0-1H6c.6 0 1 .4 1 1z" id="shape"/></g></svg>',"icon-orientation":'<svg width="24" height="24"><g id="icon-orientation" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7.3 6.4L1 13l6.4 6.5 6.5-6.5-6.5-6.5zM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7zM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 0 1 0-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 1 1-4.3 16.9l1.5-1.5A7 7 0 1 0 13 6h-1z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-outdent":'<svg width="24" height="24"><g id="icon-outdent" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2zm1.6-3.8a1 1 0 0 1-1.2 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 0 1 1.2 1.6L6.8 12l1.8 1.2z" id="Combined-Shape"/></g></svg>',"icon-page-break":'<svg width="24" height="24"><g id="icon-page-break" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 0 1 0-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2z" id="shape"/><path d="M7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1z" id="Combined-Shape"/><path d="M6 22a1 1 0 0 1-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5H7v5c0 .6-.4 1-1 1z" id="Combined-Shape-Copy"/></g></svg>',"icon-paragraph":'<svg width="24" height="24"><g id="icon-paragraph" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5z" id="shape"/></g></svg>',"icon-paste-text":'<svg width="24" height="24"><g id="icon-paste-text" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-paste":'<svg width="24" height="24"><g id="icon-paste" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-plus":'<svg width="24" height="24"><g id="icon-plus" stroke="#000" stroke-width="2" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5v14M5 12h14" id="Shape"/></g></svg>',"icon-preferences":'<svg width="24" height="24"><g id="icon-preferences" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 0 1-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 0 1-1.4 0l-1.5-1.2a6.2 6.2 0 0 1-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 0 1-1-.9l-.2-1.9a5.8 5.8 0 0 1-1.5-.6l-1.5 1.2a1 1 0 0 1-1.4 0l-.7-.7a1 1 0 0 1 0-1.4l1.2-1.5a6.2 6.2 0 0 1-.6-1.5l-1.9-.2a1 1 0 0 1-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 0 1 .6-1.5L5.2 7.3a1 1 0 0 1 0-1.4l.7-.7a1 1 0 0 1 1.4 0l1.5 1.2a6.2 6.2 0 0 1 1.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 0 1 1.5.6l1.5-1.2a1 1 0 0 1 1.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 0 1 .6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" id="Combined-Shape"/></g></svg>',"icon-preview":'<svg width="24" height="24"><g id="icon-preview" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 0 0 2.1-2.8 15.7 15.7 0 0 0-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 0 0-6.7 3.2A16.2 16.2 0 0 0 3.2 12c0 .2.2.3.3.5zm-2.4-1l.7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 0 1 2.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 0 1-2.8-3.7 1 1 0 0 1 0-1zm12-3.3a2 2 0 1 0 2.7 2.6 4 4 0 1 1-2.6-2.6z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-print":'<svg width="24" height="24"><g id="icon-print" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 8H6a3 3 0 0 0-3 3v6h2v3h14v-3h2v-6a3 3 0 0 0-3-3zm-1 10H7v-4h10v4zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5zm.5-8H6v2h12V5z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-quote":'<svg width="24" height="24"><g id="icon-quote" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-redo":'<svg width="24" height="24"><g id="icon-redo" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 1 1-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-reload":'<svg width="24" height="24"><g id="icon-reload" stroke="none" stroke-width="1" fill-rule="evenodd"><g id="Group" transform="rotate(-45 13.2 13.2)" fill-rule="nonzero"><path d="M19.8 13.7l-2.4-4.2-.2-.2a1 1 0 0 0-1.5 0l-3.2 4a1 1 0 1 0 1.5 1.2l1.5-1.7a7.8 7.8 0 0 1-5.8 6c-2.5.6-5.1-.1-7-2a1 1 0 1 0-1.4 1.4 9.5 9.5 0 0 0 8.9 2.5 9.9 9.9 0 0 0 7.2-7.2l.7 1.2a1 1 0 1 0 1.7-1z" id="Shape" transform="matrix(-1 0 0 1 21 0)"/><path d="M13 9.4a1 1 0 0 0-1.4.1l-1.8 2a8 8 0 0 1 6-7.4c2.8-.5 5.6.4 7.5 2.4a1 1 0 0 0 1.5-1.3 9.5 9.5 0 0 0-9.3-3 10 10 0 0 0-7.5 8l-.6-1a1 1 0 0 0-1.7 1l2.6 4.3a1 1 0 0 0 1.6.1l3.2-3.8c.4-.4.3-1-.1-1.4z" id="Shape" transform="matrix(-1 0 0 1 30.6 0)"/></g></g></svg>',"icon-remove-formatting":'<svg width="24" height="24"><g id="icon-remove-formatting" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8zM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1z" id="shape"/></g></svg>',"icon-remove":'<svg width="24" height="24"><g id="icon-remove" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 7h3a1 1 0 0 1 0 2h-1v9a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V9H5a1 1 0 1 1 0-2h3V6a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 0 0-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4zm4 0a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-resize-handle":'<svg width="10" height="10"><g id="icon-resize-handle" stroke="none" stroke-width="1" fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 1 1 9 2l-7 7A.5.5 0 1 1 1 8l7-7z" id="Line"/><path d="M8.1 5.1A.5.5 0 1 1 9 6l-3 3A.5.5 0 1 1 5 8l3-3z" id="Line-2"/></g></svg>',"icon-resize":'<svg width="24" height="24"><g id="icon-resize" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-6a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3A1 1 0 0 1 4 11V5z" id="shape"/></g></svg>',"icon-restore-draft":'<svg width="24" height="24"><g id="icon-restore-draft" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1z" id="shape"/><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-rotate-left":'<svg width="24" height="24"><g id="icon-rotate-left" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-rotate-right":'<svg width="24" height="24"><g id="icon-rotate-right" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M20 8V5a1 1 0 0 1 2 0v6c0 .6-.4 1-1 1h-6a1 1 0 0 1 0-2h4.3L16 7A7.2 7.2 0 0 0 7.7 6a7 7 0 0 0 3 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 0 1 1.4 1.5A9.2 9.2 0 0 1 2.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-rtl":'<svg width="24" height="24"><g id="icon-rtl" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 4.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L8 5zm12 11.2a1 1 0 1 1-1 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 1 1 1 1.6L18.4 15l1.8 1.2z" id="shape"/></g></svg>',"icon-save":'<svg width="24" height="24"><g id="icon-save" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 16h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 1 0-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 1 0-1.4-1.4L13 11.6V4a1 1 0 0 0-2 0v7.6z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-search":'<svg width="24" height="24"><g id="icon-search" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-select-all":'<svg width="24" height="24"><g id="icon-select-all" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M3 5h2V3a2 2 0 0 0-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 0 0-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 0 0 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2zM7 17h10V7H7v10zm2-8h6v6H9V9z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-selected":'<svg width="24" height="24"><g id="icon-selected" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zm-2.4-6.1L7 12.3a.7.7 0 0 0-1 1L9.6 17 18 8.6a.7.7 0 0 0 0-1 .7.7 0 0 0-1 0l-7.4 7.3z" id="Combined-Shape"/></g></svg>',"icon-settings":'<svg width="24" height="24"><g id="icon-settings" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V8H5a1 1 0 1 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6zM8 8h2V6H8v2zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V13H5a1 1 0 0 1 0-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6zM14 13h2v-2h-2v2zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V18H5a1 1 0 0 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6zM8 18h2v-2H8v2z" id="shape"/></g></svg>',"icon-sharpen":'<svg width="24" height="24"><g id="icon-sharpen" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2z" id="shape"/></g></svg>',"icon-sourcecode":'<svg width="24" height="24"><g id="icon-sourcecode" stroke="none" stroke-width="1" fill-rule="nonzero"><path d="M10.7 9.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2l-4.1 4.4c-.3.3-.8.3-1.2 0l-4.2-4.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L7 13l3.7-3.8z" id="Shape" transform="rotate(90 7 12)"/><path d="M20.7 9.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2l-4.1 4.4c-.3.3-.8.3-1.2 0l-4.2-4.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L17 13l3.7-3.8z" id="Shape-Copy" transform="matrix(0 1 1 0 5 -5)"/></g></svg>',"icon-spell-check":'<svg width="24" height="24"><g id="icon-spell-check" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6zm0-3v2h2V5H6zm13 0h-3v5h3v1h-3a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12z" id="shape"/></g></svg>',"icon-strike-through":'<svg width="24" height="24"><g id="icon-strike-through" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1z" id="s"/><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2z" id="Rectangle" fill-rule="nonzero"/></g></svg>',"icon-subscript":'<svg width="24" height="24"><g id="icon-subscript" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M10.4 10l4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10zM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 0 0-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 0 1-1.3 1.3l-.6.6h2.6V19z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-superscript":'<svg width="24" height="24"><g id="icon-superscript" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M15 9.4L10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-table-cell-properties":'<svg width="24" height="24"><g id="icon-table-cell-properties" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v14H4V5zm10 10h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10 0v3h4v-3h-4zm0-1h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" id="shape"/></g></svg>',"icon-table-cell-select-all":'<svg width="24" height="24"><g id="icon-table-cell-select-all" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12.5 5.5v6h6v-6h-6zm-1 0h-6v6h6v-6zm1 13h6v-6h-6v6zm-1 0v-6h-6v6h6zm-7-14h15v15h-15v-15z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-table-cell-select-inner":'<svg width="24" height="24"><g id="icon-table-cell-select-inner" stroke="none" stroke-width="1" fill-rule="nonzero"><path d="M5.5 5.5v13h13v-13h-13zm-1-1h15v15h-15v-15z" id="Rectangle-5-Copy" opacity=".2"/><path d="M11.5 11.5v-7h1v7h7v1h-7v7h-1v-7h-7v-1h7z" id="Combined-Shape"/></g></svg>',"icon-table-delete-column":'<svg width="24" height="24"><g id="icon-table-delete-column" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M9 11.2l1 1v.2l-1 1v-2.2zm5 1l1-1v2.2l-1-1v-.2zM20 5v14H4V5h16zm-1 2h-4v.8l-.2-.2-.8.8V7h-4v1.4l-.8-.8-.2.2V7H5v11h4v-1.8l.5.5.5-.4V18h4v-1.8l.8.8.2-.3V18h4V7zm-3.9 3.4l-1.8 1.9 1.8 1.9c.4.3.4.9 0 1.2-.3.3-.8.3-1.2 0L12 13.5l-1.8 1.9a.8.8 0 0 1-1.2 0 .9.9 0 0 1 0-1.2l1.8-1.9-1.9-2a.9.9 0 0 1 1.2-1.2l2 2 1.8-1.8c.3-.4.9-.4 1.2 0a.8.8 0 0 1 0 1.1z" id="shape"/></g></svg>',"icon-table-delete-row":'<svg width="24" height="24"><g id="icon-table-delete-row" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16.7 8.8l1.1 1.2-2.4 2.5L18 15l-1.2 1.2-2.5-2.5-2.4 2.5-1.3-1.2 2.5-2.5-2.5-2.5 1.2-1.3 2.6 2.6 2.4-2.5zM4 5h16v14H4V5zm15 5V7H5v3h4.8l1 1H5v3h5.8l-1 1H5v3h14v-3h-.4l-1-1H19v-3h-1.3l1-1h.3z" id="shape"/></g></svg>',"icon-table-delete-table":'<svg width="24" height="26"><g id="icon-table-delete-table" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 6h16v14H4V6zm1 2v11h14V8H5zm11.7 8.7l-1.5 1.5L12 15l-3.3 3.2-1.4-1.5 3.2-3.2-3.3-3.2 1.5-1.5L12 12l3.2-3.2 1.5 1.5-3.2 3.2 3.2 3.2z" id="shape"/></g></svg>',"icon-table-insert-column-after":'<svg width="24" height="24"><g id="icon-table-insert-column-after" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14.3 9c.4 0 .7.3.7.6v2.2h2.1c.4 0 .7.3.7.7 0 .4-.3.7-.7.7H15v2.2c0 .3-.3.6-.7.6a.7.7 0 0 1-.6-.6v-2.2h-2.2a.7.7 0 0 1 0-1.4h2.2V9.6c0-.3.3-.6.6-.6zM4 5h16v14H4V5zm5 13v-3H5v3h4zm0-4v-3H5v3h4zm0-4V7H5v3h4zm10 8V7h-9v11h9z" id="shape"/></g></svg>',"icon-table-insert-column-before":'<svg width="24" height="24"><g id="icon-table-insert-column-before" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M9.7 16a.7.7 0 0 1-.7-.6v-2.2H6.9a.7.7 0 0 1 0-1.4H9V9.6c0-.3.3-.6.7-.6.3 0 .6.3.6.6v2.2h2.2c.4 0 .8.3.8.7 0 .4-.4.7-.8.7h-2.2v2.2c0 .3-.3.6-.6.6zM4 5h16v14H4V5zm10 13V7H5v11h9zm5 0v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V7h-4v3h4z" id="shape"/></g></svg>',"icon-table-insert-row-above":'<svg width="24" height="24"><g id="icon-table-insert-row-above" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M14.8 10.5c0 .3-.2.5-.5.5h-1.8v1.8c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.6V11H9.7a.5.5 0 0 1 0-1h1.8V8.3c0-.3.2-.6.5-.6s.5.3.5.6V10h1.8c.3 0 .5.2.5.5zM4 5h16v14H4V5zm5 13v-3H5v3h4zm5 0v-3h-4v3h4zm5 0v-3h-4v3h4zm0-4V7H5v7h14z" id="shape"/></g></svg>',"icon-table-insert-row-after":'<svg width="24" height="24"><g id="icon-table-insert-row-after" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M9.2 14.5c0-.3.2-.5.5-.5h1.8v-1.8c0-.3.2-.5.5-.5s.5.2.5.6V14h1.8c.3 0 .5.2.5.5s-.2.5-.5.5h-1.8v1.7c0 .3-.2.6-.5.6a.5.5 0 0 1-.5-.6V15H9.7a.5.5 0 0 1-.5-.5zM4 5h16v14H4V5zm6 2v3h4V7h-4zM5 7v3h4V7H5zm14 11v-7H5v7h14zm0-8V7h-4v3h4z" id="shape"/></g></svg>',"icon-table-left-header":'<svg width="24" height="24"><g id="icon-table-left-header" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v13H4V5zm10 12v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V6h-4v3h4zm5 8v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V6h-4v3h4z" id="shape"/></g></svg>',"icon-table-merge-cells":'<svg width="24" height="24"><g id="icon-table-merge-cells" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v14H4V5zm6 13h9v-7h-9v7zm4-11h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10-1h4V7h-4v3zM5 15v3h4v-3H5z" id="shape"/></g></svg>',"icon-table-row-properties":'<svg width="24" height="24"><g id="icon-table-row-properties" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v14H4V5zm10 10h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm6 3h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" id="shape"/></g></svg>',"icon-table-split-cells":'<svg width="24" height="24"><g id="icon-table-split-cells" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v14H4V5zm6 2v3h4V7h-4zM9 18v-3H5v3h4zm0-4v-3H5v3h4zm0-4V7H5v3h4zm10 8v-7h-9v7h9zm0-8V7h-4v3h4zm-3.5 4.5l1.5 1.6c.3.2.3.7 0 1-.2.2-.7.2-1 0l-1.5-1.6-1.6 1.5c-.2.3-.7.3-1 0a.7.7 0 0 1 0-1l1.6-1.5-1.5-1.6a.7.7 0 0 1 1-1l1.5 1.6 1.6-1.5c.2-.3.7-.3 1 0 .2.2.2.7 0 1l-1.6 1.5z" id="shape"/></g></svg>',"icon-table-top-header":'<svg width="24" height="24"><g id="icon-table-top-header" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v13H4V5zm5 12v-3H5v3h4zm0-4v-3H5v3h4zm5 4v-3h-4v3h4zm0-4v-3h-4v3h4zm5 4v-3h-4v3h4zm0-4v-3h-4v3h4z" id="shape"/></g></svg>',"icon-table":'<svg width="24" height="24"><g id="icon-table" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M4 5h16v14H4V5zm6 9h4v-3h-4v3zm4 1h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10 0v3h4v-3h-4zm0-1h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" id="shape"/></g></svg>',"icon-template":'<svg width="24" height="24"><g id="icon-template" stroke="none" stroke-width="1" fill-rule="evenodd"><g id="stamp" transform="translate(3 3)" fill-rule="nonzero"><path d="M16 16v-1H2v1h14zM6 13V9a5 5 0 1 1 6 0v4h4a2 2 0 0 1 2 2v3H0v-3c0-1.1.9-2 2-2h4zm4 0V8l.8-.6a3 3 0 1 0-3.6 0L8 8v5h2z" id="Shape"/></g></g></svg>',"icon-temporary-placeholder":'<svg width="24" height="24"><g id="icon-temporary-placeholder" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M20.5 2.5c-.8 0-1.5.7-1.5 1.5a1.5 1.5 0 0 1-3 0 3 3 0 0 0-6 0v2H8.5c-.3 0-.5.2-.5.5v1a8 8 0 1 0 6 0v-1c0-.3-.2-.5-.5-.5H11V4a2 2 0 0 1 4 0 2.5 2.5 0 0 0 5 0c0-.3.2-.5.5-.5a.5.5 0 0 0 0-1zM8.1 10.9a5 5 0 0 0-1.2 7 .5.5 0 0 1-.8.5 6 6 0 0 1 1.5-8.3.5.5 0 1 1 .5.8z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-text-color":'<svg width="24" height="24"><g id="icon-text-color" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z" id="shape"/></g></svg>',"icon-toc":'<svg width="24" height="24"><g id="icon-toc" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2z" id="shape"/></g></svg>',"icon-translate":'<svg width="24" height="24"><g id="icon-translate" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 0 1 0-1l3.1-3A12.4 12.4 0 0 1 6.7 9H8a10.1 10.1 0 0 0 1.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 1 1 0-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 0 1-1 2.4 13.5 13.5 0 0 1-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 0 1-.4.7 1 1 0 0 1-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 0 1-1 .7.5.5 0 0 1-.4-.7l2.7-7.4a1 1 0 1 1 2 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" id="shape"/></g></svg>',"icon-underline":'<svg width="24" height="24"><g id="icon-underline" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 0 1-.4 1.8l-1 1.4a5.3 5.3 0 0 1-5.5 1 5 5 0 0 1-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 0 1-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 0 0 2.2.8 3.4 3.4 0 0 0 2.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1zM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2z" id="shape"/></g></svg>',"icon-undo":'<svg width="24" height="24"><g id="icon-undo" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-unlink":'<svg width="24" height="24"><g id="icon-unlink" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2zm11.6-.6a1 1 0 0 1-1.4-1.4l2.1-2a2 2 0 1 0-2.7-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2zM7.6 6.3a.8.8 0 0 1-1 1.1L3.3 4.2a.7.7 0 1 1 1-1l3.2 3.1zM5.1 8.6a.8.8 0 0 1 0 1.5H3a.8.8 0 0 1 0-1.5H5zm5-3.5a.8.8 0 0 1-1.5 0V3a.8.8 0 0 1 1.5 0V5zm6 11.8a.8.8 0 0 1 1-1l3.2 3.2a.8.8 0 0 1-1 1L16 17zm-2.2 2a.8.8 0 0 1 1.5 0V21a.8.8 0 0 1-1.5 0V19zm5-3.5a.7.7 0 1 1 0-1.5H21a.8.8 0 0 1 0 1.5H19z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-unlock":'<svg width="24" height="24"><g id="icon-unlock" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 0 0-.3-.7A1 1 0 0 0 16 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" id="shape"/></g></svg>',"icon-unordered-list":'<svg width="24" height="24"><g id="icon-unordered-list" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" id="shape"/></g></svg>',"icon-unselected":'<svg width="24" height="24"><g id="icon-unselected" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zm0-1a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" id="Combined-Shape"/></g></svg>',"icon-upload":'<svg width="24" height="24"><g id="icon-upload" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M18 19v-2a1 1 0 0 1 2 0v3c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-3a1 1 0 0 1 2 0v2h12zM11 6.4L8.7 8.7a1 1 0 0 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 1 1-1.4 1.4L13 6.4V16a1 1 0 0 1-2 0V6.4z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-user":'<svg width="24" height="24"><g id="icon-user" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M12 24a12 12 0 1 1 0-24 12 12 0 0 1 0 24zm-8.7-5.3a11 11 0 0 0 17.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7zM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13z" id="Shape" fill-rule="nonzero"/></g></svg>',"icon-warning":'<svg width="24" height="24"><g id="icon-warning" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6zM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7l.3 4h1.4z" id="shape"/></g></svg>',"icon-zoom-in":'<svg width="24" height="24"><g id="icon-zoom-in" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm-1-9a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0V8zm-2 4a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>',"icon-zoom-out":'<svg width="24" height="24"><g id="icon-zoom-out" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm-3-5a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8z" id="Combined-Shape" fill-rule="nonzero"/></g></svg>'},Ow=function(e,t){return P.from(zw[e]).getOrThunk(t)},Tw=function(e,t){return P.from(t()[e]).getOrThunk(function(){return Ow(e,function(){return"!not found!"})})},Mw=function(e,t,n){return P.from(t()[e]).getOrThunk(function(){return Ow(e,n)})},Hw={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Ew=Tl({name:"Notification",factory:function(t){var e,n,o,r=Qd({dom:{tag:"p",innerHtml:t.text()},behaviours:ki([dh.config({})])}),i=function(e){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+e+"%"}}}},a=function(e){return{dom:{tag:"div",classes:["tox-text"],innerHtml:e+"%"}}},u=Qd({dom:{tag:"div",classes:t.progress()?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[i(0)]},a(0)],behaviours:ki([dh.config({})])}),c={updateProgress:function(e,t){e.getSystem().isConnected()&&u.getOpt(e).each(function(e){dh.set(e,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[i(t)]},a(t)])})},updateText:function(e,t){if(e.getSystem().isConnected()){var n=r.get(e);dh.set(n,[jg(t)])}}},s=V(j([t.icon().toArray(),t.level().toArray(),t.level().bind(function(e){return P.from(Hw[e])}).toArray()]),function(e){return"icon-"+e});return{uid:t.uid(),dom:{tag:"div",attributes:{role:"alert"},classes:t.level().map(function(e){return["tox-notification","tox-notification--in","tox-notification--"+e]}).getOr(["tox-notification","tox-notification--in"])},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:(e=s,n=t.iconProvider(),o=function(){return e=function(){return""},Be(s,function(e){return P.from(zw[e])}).getOrThunk(e);var e},Be(e,function(e){return P.from(n()[e])}).getOrThunk(o))}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[r.asSpec()],behaviours:ki([dh.config({})])}].concat(t.progress()?[u.asSpec()]:[]).concat(Hl.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:Tw("icon-close",t.iconProvider())}}],action:function(e){t.onAction()(e)}})),apis:c}},configFields:[kr("level"),hr("progress"),hr("icon"),hr("onAction"),hr("text"),hr("iconProvider")],apis:{updateProgress:function(e,t,n){e.updateProgress(t,n)},updateText:function(e,t,n){e.updateText(t,n)}}});function Vw(r,i,a){var u=i.backstage;return{open:function(e,t){var n=function(){t(),Cw.hide(r)},o=Wg(Ew.sketch({text:e.text,level:M(["success","error","warning","info"],e.type)?e.type:undefined,progress:!0===e.progressBar,icon:P.from(e.icon),onAction:n,iconProvider:u.shared.providers.icons})),r=Wg(Cw.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:i.backstage.shared.getSink,fireDismissalEventInstead:{}}));return a.add(r),e.timeout&&setTimeout(function(){n()},e.timeout),{close:n,moveTo:function(e,t){Cw.showAt(r,{anchor:"makeshift",x:e,y:t},Gg(o))},moveRel:function(e,t){Cw.showAt(r,i.backstage.shared.anchors.banner(),Gg(o))},text:function(e){Ew.updateText(o,e)},settings:e,getEl:function(){},progressBar:{value:function(e){Ew.updateProgress(o,e)}}}},close:function(e){e.close()},reposition:function(e){A(e,function(e){e.moveTo(0,0)}),function(n){if(0<n.length){var e=n.slice(0,1)[0],t=(o=r).inline?o.getElement():o.getContentAreaContainer();e.moveRel(t,"tc-tc"),A(n,function(e,t){0<t&&e.moveRel(n[t-1].getEl(),"bc-tc")})}var o}(e)},getArgs:function(e){return e.settings}}}var Aw,Bw,Dw=/[\u00a0 \t\r\n]/,Rw=function(n,e,t,o,r){return(i=n).collapsed&&3===i.startContainer.nodeType?function(e,t,n,o){var r;for(r=t-1;0<=r;r--){if(Dw.test(e.charAt(r)))return P.none();if(e.charAt(r)===n)break}return-1===r||t-r<o?P.none():P.some(e.substring(r+1,t))}(t,o,e,r).map(function(e){var t=n.cloneRange();return t.setStart(n.startContainer,n.startOffset-e.length-1),t.setEnd(n.startContainer,n.startOffset),{text:e,rng:t}}):P.none();var i},Fw=function(n,e){e.on("keypress",n.onKeypressThrottle);var o=function(e,t){uo(e,Xe(),{raw:t})};e.on("keydown",function(t){var e=function(){return n.getView().bind(Fu.getHighlighted)};n.isActive()&&(8===t.which&&n.onKeypressThrottle(t),27===t.which?n.closeIfNecessary():32===t.which?n.closeIfNecessary():13===t.which?(e().each(co),t.preventDefault()):40===t.which?(e().fold(function(){n.getView().each(Fu.highlightFirst)},function(e){o(e,t)}),t.preventDefault()):37!==t.which&&38!==t.which&&39!==t.which||e().each(function(e){o(e,t),t.preventDefault()}))})},Iw=tinymce.util.Tools.resolve("tinymce.util.Promise"),_w=function(e,t){var n,o,r,i=t(),a=e.selection.getRng(),u=a.startContainer.nodeValue;return(n=a,o=u,r=i,Be(r.triggerChars,function(t){return Rw(n,t,o,n.startOffset,0).map(function(e){return{range:e.rng,text:e.text,triggerChar:t}})})).map(function(e){var t=i.lookupByChar(e.triggerChar);return{lookupData:Iw.all(V(t,function(t){return t.fetch(e.text,t.maxResults).then(function(e){return{items:e,columns:t.columns,onAction:t.onAction}})})),triggerChar:e.triggerChar,range:e.range}})},Lw=Wo([Dr("type",function(){return"autocompleteitem"}),Dr("active",function(){return!1}),Dr("disabled",function(){return!1}),Tr("meta",{}),pr("value"),Cr("text"),Cr("icon")]),Nw=Wo([pr("type"),pr("ch"),Tr("columns",1),Hr("maxResults",10),br("fetch"),br("onAction")]),Pw=function(e){var t,n,o=e.ui.registry.getAll().popups,r=se(o,function(e){return(t=e,or("Autocompleter",Nw,t)).fold(function(e){throw new Error(ur(e))},function(e){return e});var t}),i=(t=fe(r,function(e){return e.ch}),n={},A(t,function(e){n[e]={}}),ae(n)),a=de(r);return{dataset:r,triggerChars:i,lookupByChar:function(t){return B(a,function(e){return e.ch===t})}}},jw="tox-menu-nav__js",Uw="tox-collection__item",Ww="tox-swatch",Gw={normal:jw,color:Ww},Xw="tox-collection__item--enabled",Yw="tox-collection__item-icon",$w="tox-collection__item-label",qw="tox-collection__item--active",Kw=function(e){return Oe(Gw,e).getOr(jw)},Jw=tinymce.util.Tools.resolve("tinymce.Env"),Qw=tinymce.util.Tools.resolve("tinymce.util.I18n"),Zw=function(e){return{dom:{tag:"span",classes:[Yw],innerHtml:e}}},ek=function(e){return{dom:{tag:"span",classes:[$w]},components:[jg(Qw.translate(e))]}},tk=function(e){return{dom:{tag:"span",classes:["tox-collection__item-accessory"],innerHtml:(t=e,n=Jw.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},o=t.split("+"),V(o,function(e){var t=e.toLowerCase();return me(n,t)?n[t]:e}).join("+"))}};var t,n,o},nk=function(e){return{dom:{tag:"span",classes:[Yw,"tox-collection__item-checkmark"],innerHtml:Tw("icon-checkmark",e)}}},ok=function(e,t){var n,o,r,i,a,u,c,s=e.iconContent.map(function(e){return Mw("icon-"+e,t.icons,U(e))});return"color"===e.presets?(a=e.value,{dom:(u=Ww,c=s.getOr(""),Al("custom"===a?'<button class="'+u+' tox-swatches__picker-btn">'+c+"</button>":"remove"===a?'<div class="'+u+' tox-swatch--remove">'+c+"</div>":'<div class="'+u+'" style="background-color: '+a+'" data-mce-color="'+a+'"></div>')),optComponents:[]}):(o=s,r=(n=e).checkMark.orThunk(function(){return o.or(P.some("")).map(Zw)}),i=n.ariaLabel.map(function(e){return{attributes:{title:Qw.translate(e)}}}).getOr({}),{dom:ne({tag:"div",classes:[jw,Uw]},i),optComponents:[r,n.textContent.map(ek),n.shortcutContent.map(tk),n.caret]})},rk=function(e){return tg.config({disabled:e,disableClass:"tox-collection__item--state-disabled"})},ik=function(e){return tg.config({disabled:e})},ak=function(e,t){var n=e.getApi(t);return function(e){e(n)}},uk=function(n,o){return ti(function(e){ak(n,e)(function(e){var t=n.onSetup(e);null!==t&&t!==undefined&&o.set(t)})})},ck=function(t,n){return ni(function(e){return ak(t,e)(n.get())})},sk={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},lk=function(e){return W(e,function(e){return e.toArray()})},fk=function(e,t,n){var o,r,i=Ve(N);return{type:"item",dom:t.dom,components:lk(t.optComponents),data:e.data,eventOrder:sk,itemBehaviours:ki([Tm("item-events",[(o=e,r=n,ri(function(e,t){ak(o,e)(o.onAction),o.triggersSubmenu||r!==Aw.CLOSE_ON_EXECUTE||(ao(e,Ft()),t.stop())})),uk(e,i),ck(e,i)]),rk(e.disabled),dh.config({})].concat(e.itemBehaviours))}},dk=function(e){return{value:e.value,meta:ne({text:e.text.getOr("")},e.meta)}},mk=U($s("item-widget",eh())),gk=ro("cell-over"),hk=ro("cell-execute"),vk=function(t,n,e){var o,r=function(e){return uo(e,hk,{row:t,col:n})};return Wg({dom:{tag:"div",attributes:(o={role:"button"},o["aria-labelledby"]=e,o)},behaviours:ki([Tm("insert-table-picker-cell",[Yr(Ue(),Wa.focus),Yr(Vt(),r),Yr(Ke(),r)]),Ba.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Wa.config({onFocus:function(e){return uo(e,gk,{row:t,col:n})}})])})},pk={inserttable:function qB(o){var e,t=ro("size-label"),u=function(e,t,n){for(var o=[],r=0;r<t;r++){for(var i=[],a=0;a<n;a++)i.push(vk(r,a,e));o.push(i)}return o}(t,10,10),c=Qd({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:t}},components:[jg("0x0")],behaviours:ki([dh.config({})])});return{type:"widget",data:{value:ro("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[mk().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:(e=u,W(e,function(e){return V(e,Gg)})).concat(c.asSpec()),behaviours:ki([Tm("insert-table-picker",[Jr(gk,function(e,t,n){var o,r,i=n.event().row(),a=n.event().col();!function(e,t,n,o,r){for(var i=0;i<o;i++)for(var a=0;a<r;a++)Ba.set(e[i][a],i<=t&&a<=n)}(u,i,a,10,10),dh.set(c.get(e),[(o=i,r=a,jg(r+1+"x"+(o+1)))])}),Jr(hk,function(e,t,n){o.onAction({numRows:n.event().row()+1,numColumns:n.event().col()+1}),ao(e,Ft())})]),ms.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}}},bk=function(e,a,t){return{dom:{tag:"div",classes:[jw,Uw]},optComponents:[P.some(t),e.map(function(e){return t=a.tag,n=a.styleAttr,o="span",r=[$w],i=[{dom:{tag:t,attributes:{style:n}},components:[jg(e)]}],{dom:{tag:o,classes:r},components:i};var t,n,o,r,i})]}};(Bw=Aw||(Aw={}))[Bw.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",Bw[Bw.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var yk,xk,wk,kk,Sk=function(t,e,n,o,r,i,a){var u=ok({presets:n,textContent:e?t.text:P.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:P.none(),checkMark:P.none(),caret:P.none(),value:t.value},a);return te(fk({data:dk(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Ba.set(t,e)},isActive:function(){return Ba.isOn(t)},isDisabled:function(){return tg.isDisabled(t)},setDisabled:function(e){return e?tg.disable(t):tg.enable(t)}}},onAction:function(e){return o(t.value)},onSetup:function(e){return e.setActive(r),function(){}},triggersSubmenu:!1,itemBehaviours:[]},u,i),{toggling:{toggleClass:Xw,toggleOnExecute:!1,selected:t.active}})},Ck=function(t,e,n,o,r,i){var a=ok({presets:n,textContent:e?t.text:P.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:P.none(),checkMark:P.none(),caret:P.none(),value:t.value},i);return fk({data:dk(t),disabled:t.disabled,getApi:function(){return{}},onAction:function(e){return o(t.value,t.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:[]},a,r)},zk=function(e){return{type:"separator",dom:{tag:"div",classes:["tox-collection__separator"],innerHtml:e.text.getOr("")},components:[]}},Ok=function(e,t,n){var o="togglemenuitem"===e.type&&e.active?nk(n.icons):Zw(""),r=bk(e.text,e.meta,o);return te(fk({data:dk(e),disabled:e.disabled,getApi:function(){return 10},onAction:e.onAction,onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:[]},r,t),"togglemenuitem"===e.type?{toggling:{toggleClass:Xw,toggleOnExecute:!1,selected:e.active}}:{})},Tk=function(e,t,n){var o,r=e.hasSubmenu?P.some((o=n.icons,{dom:{tag:"span",classes:["tox-collection__item-caret"],innerHtml:Tw("icon-chevron-right",o)}})):P.none(),i=ok({presets:"normal",iconContent:e.icon,textContent:e.text,ariaLabel:e.text,caret:r,checkMark:P.none(),shortcutContent:e.shortcut},n);return fk({data:dk(e),getApi:function(t){return{isDisabled:function(){return tg.isDisabled(t)},setDisabled:function(e){return e?tg.disable(t):tg.enable(t)}}},disabled:e.disabled,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:e.hasSubmenu,itemBehaviours:[]},i,t)},Mk=function(e,t,n){var o=ok({iconContent:P.none(),textContent:e.text,ariaLabel:e.text,checkMark:P.some(nk(n.icons)),caret:P.none(),shortcutContent:e.shortcut,presets:"normal"},n);return te(fk({data:dk(e),disabled:e.disabled,getApi:function(t){return{setActive:function(e){Ba.set(t,e)},isActive:function(){return Ba.isOn(t)},isDisabled:function(){return tg.isDisabled(t)},setDisabled:function(e){return e?tg.disable(t):tg.enable(t)}}},onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,t),{toggling:{toggleClass:Xw,toggleOnExecute:!1,selected:e.active}})},Hk=function(t){return(e=pk,n=t.fancytype,Object.prototype.hasOwnProperty.call(e,n)?P.some(e[n]):P.none()).map(function(e){return e(t)});var e,n},Ek=[Vr("disabled",!1),Cr("text"),Cr("shortcut"),Ko("value","value",Eo(function(){return ro("menuitem-value")}),sr()),Tr("meta",{})],Vk=Wo([pr("type"),Dr("hasSubmenu",function(e){return Ee(e,"getSubmenuItems")}),Ar("onSetup",function(){return N}),Ar("onAction",N),Cr("icon")].concat(Ek)),Ak=function(e){return or("menuitem",Vk,e)},Bk=Wo([pr("type"),Vr("active",!1),Ar("onSetup",function(){return N}),br("onAction")].concat(Ek)),Dk=function(e){return or("togglemenuitem",Bk,e)},Rk=Wo([pr("type"),Vr("active",!1),Cr("icon")].concat(Ek)),Fk=Wo([pr("type"),Cr("text")]),Ik=Wo([pr("type"),(yk="fancytype",xk=["inserttable"],Ko(yk,yk,Mo(),er(function(e){return M(xk,e)?ie.value(e):ie.error('Value was: "'+e+'". Must be one of ['+V(xk,function(e){return'"'+e+'"'}).join(", ")+"]")}))),Ar("onAction",N)]),_k=function(e,o,t){var r=cu(e.element(),"."+t);if(0<r.length){var n=I(r,function(e){var t=e.dom().getBoundingClientRect().top,n=r[0].dom().getBoundingClientRect().top;return Math.abs(t-n)>o}).getOr(r.length);return P.some({numColumns:n,numRows:Math.ceil(r.length/n)})}return P.none()},Lk=function(e,t){return ki([Tm(e,t)])},Nk=function(e){return Lk(ro("unnamed-events"),e)},Pk=function(e){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:(t=e,"color"===t?"tox-swatches":"tox-menu"),tieredMenu:"tox-tiered-menu"};var t},jk=function(e){var t=Pk(e);return{backgroundMenu:t.backgroundMenu,selectedMenu:t.selectedMenu,menu:t.menu,selectedItem:t.selectedItem,item:Kw(e)}},Uk=[ah.parts().items({})],Wk=function(e,t,n){var o=Pk(n);return{dom:{tag:"div",classes:j([[o.tieredMenu]])},markers:jk(n)}},Gk=function(e,t){var n=jk(t);return 1===e?{mode:"menu",moveOnTab:!0}:"auto"===e?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===t?"tox-swatches__row":"tox-collection__group")}},Xk=function(n,o){return function(e){var t=E(e,o);return V(t,function(e){return{dom:n,components:e}})}},Yk=function(t,i){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[ah.parts().items({preprocess:function(e){return"auto"!==t&&1<t?Xk({tag:"div",classes:["tox-collection__group"]},t)(e):(n=function(e,t){return"separator"===i[t].type},o=[],r=[],A(e,function(e,t){n(e,t)?(0<r.length&&o.push(r),r=[]):r.push(e)}),0<r.length&&o.push(r),V(o,function(e){return{dom:{tag:"div",classes:["tox-collection__group"]},components:e}}));var n,o,r}})]}};(kk=wk||(wk={}))[kk.ContentFocus=0]="ContentFocus",kk[kk.UiFocus=1]="UiFocus";var $k,qk,Kk=function(e){return console.error(ur(e)),console.log(e),P.none()},Jk=function(e){return e.icon!==undefined},Qk=function(e){return H(e,Jk)},Zk=function(e,t,n){switch(e.type){case"menuitem":return Ak(e).fold(Kk,function(e){return P.some(Tk(e,t,n))});case"styleitem":return"menuitem"===e.item.type?Ak(e.item).fold(Kk,function(e){return P.some(Ok(e,t,n))}):"togglemenuitem"===e.item.type?Dk(e.item).fold(Kk,function(e){return P.some(Ok(e,t,n))}):(console.error("Unsupported style item delegate",e.item),P.none());case"togglemenuitem":return Dk(e).fold(Kk,function(e){return P.some(Mk(e,t,n))});case"separator":return(r=e,or("separatormenuitem",Fk,r)).fold(Kk,function(e){return P.some(zk(e))});case"fancymenuitem":return(o=e,or("fancymenuitem",Ik,o)).fold(Kk,function(e){return Hk(e)});default:return console.error("Unknown item in general menu",e),P.none()}var o,r},eS=function(e,t,n,o,r){var i,a,u,c,s,l,f;return"color"===r?{value:e,dom:(i=o,f={dom:{tag:"div",classes:["tox-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[ah.parts().items({preprocess:"auto"!==i?Xk({tag:"div",classes:["tox-swatches__row"]},i):b})]}]}).dom,components:f.components,items:n}:"normal"===r&&"auto"===o?{value:e,dom:(f=Yk(o,n)).dom,components:f.components,items:n}:"normal"===r&&1===o?{value:e,dom:(f=Yk(1,n)).dom,components:f.components,items:n}:"normal"===r?{value:e,dom:(f=Yk(o,n)).dom,components:f.components,items:n}:"toolbar"!==r||"auto"===o?{value:e,dom:(u=t,c=o,s=r,l=Pk(s),{tag:"div",classes:j([[l.menu,"tox-menu-"+c+"-column"],u?[l.hasIcons]:[]])}),components:Uk,items:n}:{value:e,dom:(a=o,f={dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[ah.parts().items({preprocess:Xk({tag:"div",classes:["tox-collection__group"]},a)})]}).dom,components:f.components,items:n}},tS=function(e,n,o,r,i,a,u){return Ae(V(e,function(t){return"choiceitem"===t.type?(e=t,or("choicemenuitem",Rk,e)).fold(Kk,function(e){return P.some(Sk(e,1===o,r,n,a(t.value),i,u))}):P.none();var e}))},nS=function(e,n,o,r,i){return Ae(V(e,function(e){return(t=e,or("Autocompleter.Item",Lw,t)).fold(Kk,function(e){return P.some(Ck(e,1===o,"normal",n,r,i))});var t}))},oS=function(e,t,n,o,r,i,a,u){var c=Qk(t),s=tS(t,n,o,"color"!==r?"normal":"color",i,a,u);return eS(e,c,s,o,r)},rS=function(e,t,n,o){var r=Qk(t),i=Ae(V(t,function(e){return Zk(e,n,o)}));return eS(e,r,i,1,"normal")},iS=function(e){return ph.singleData(e.value,e)},aS=function(g,h){var v=Wg(Cw.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],lazySink:h.getSink})),e=function(){return Cw.isOpen(v)},p=function(){e()&&Cw.hide(v)},t=et(function(){return Pw(g)}),n={onKeypressThrottle:hp(function(e){(" "===e.key?P.none():_w(g,t)).fold(p,function(m){m.lookupData.then(function(e){var t,n,o,r,i,a,u,c,s,l,f=(t=m.triggerChar,o=Be(n=e,function(e){return P.from(e.columns)}).getOr(1),W(n,function(i){var e=i.items;return nS(e,function(o,r){var e=g.selection.getRng();Rw(e,t,e.startContainer.data,e.startOffset,0).fold(function(){return console.error("Lost context. Cursor probably moved")},function(e){var t=e.rng,n={hide:p};i.onAction(n,t,o,r)})},o,Aw.BUBBLE_TO_SANDBOX,h.providers)})),d=Be(e,function(e){return P.from(e.columns)}).getOr(1);Cw.showAt(v,{anchor:"selection",root:$t.fromDom(g.getBody()),getSelection:function(){return P.some({start:function(){return $t.fromDom(m.range.startContainer)},soffset:function(){return m.range.startOffset},finish:function(){return $t.fromDom(m.range.endContainer)},foffset:function(){return m.range.endOffset}})}},ah.sketch((r=eS("autocompleter-value",!0,f,d,"normal"),i=d,a=wk.ContentFocus,u="normal",c=a===wk.ContentFocus?Lu():_u(),s=Gk(i,u),l=jk(u),{dom:r.dom,components:r.components,items:r.items,value:r.value,markers:{selectedItem:l.selectedItem,item:l.item},movement:s,fakeFocus:a===wk.ContentFocus,focusManager:c,menuBehaviours:Nk("auto"!==i?[]:[ti(function(o,e){_k(o,4,l.item).each(function(e){var t=e.numColumns,n=e.numRows;ms.setGridSize(o,n,t)})})])}))),Cw.getContent(v).each(Fu.highlightFirst)})})},50).throttle,closeIfNecessary:p,isActive:e,getView:function(){return Cw.getContent(v)}};Fw(n,g)},uS=function(e){return P.from(e.settings.min_width).filter(O)},cS=function(e){return P.from(e.settings.min_height).filter(O)},sS=ro("form-component-change"),lS=ro("form-close"),fS=ro("form-cancel"),dS=ro("form-action"),mS=ro("form-submit"),gS=ro("form-block"),hS=ro("form-unblock"),vS=ro("form-tabchange"),pS=ro("form-resize"),bS=U([Tr("prefix","form-field"),gs("fieldBehaviours",[Em,uf])]),yS=U([Us({schema:[hr("dom")],name:"label"}),Us({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}}}},schema:[hr("text")],name:"aria-descriptor"}),Ps({factory:{sketch:function(e){var t=Se(e,["factory"]);return e.factory.sketch(t)}},schema:[hr("factory")],name:"field"})]),xS=Ml({name:"FormField",configFields:bS(),partFields:yS(),factory:function(r,e,t,n){var o=te(ki([Em.config({find:function(e){return tl(e,r,"field")}}),uf.config({store:{mode:"manual",getValue:function(e){return Em.getCurrent(e).bind(uf.getValue)},setValue:function(e,t){Em.getCurrent(e).each(function(e){uf.setValue(e,t)})}}})]),hs(r.fieldBehaviours())),i=Wr([ti(function(e,t){var o=ol(e,r,["label","field","aria-descriptor"]);o.field().each(function(n){var t=ro(r.prefix());o.label().each(function(e){Wn.set(e.element(),"for",t),Wn.set(n.element(),"id",t)}),o["aria-descriptor"]().each(function(e){var t=ro(r.prefix());Wn.set(e.element(),"id",t),Wn.set(n.element(),"aria-labelledby",t)})})})]),a={getField:function(e){return tl(e,r,"field")},getLabel:function(e){return tl(e,r,"label")}};return{uid:r.uid(),dom:r.dom(),components:e,behaviours:o,events:i,apis:a}},apis:{getField:function(e,t){return e.getField(t)},getLabel:function(e,t){return e.getLabel(t)}}}),wS=Object.freeze({getCoupled:function(e,t,n,o){return n.getOrCreate(e,t,o)}}),kS=[vr("others",Xo(ie.value,sr()))],SS=Object.freeze({init:function(e){var i={},t=U({});return wi({readState:t,getOrCreate:function(n,o,r){var e=ae(o.others());if(e)return Oe(i,r).getOrThunk(function(){var e=Oe(o.others(),r).getOrDie("No information found for coupled component: "+r)()(n),t=n.getSystem().build(e);return i[r]=t});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+Ro(e,null,2))}})}}),CS=Ci({fields:kS,name:"coupling",apis:wS,state:SS}),zS=Object.freeze({events:function(e,t){var n=e.stream().streams().setup(e,t);return Wr([Yr(e.event(),n),ni(function(){return t.cancel()})].concat(e.cancelEvent().map(function(e){return[Yr(e,function(){return t.cancel()})]}).getOr([])))}}),OS=function(e){var t=Ve(null);return wi({readState:function(){return{timer:null!==t.get()?"set":"unset"}},setTimer:function(e){t.set(e)},cancel:function(){var e=t.get();null!==e&&e.cancel()}})},TS=Object.freeze({throttle:OS,init:function(e){return e.stream().streams().state(e)}}),MS=[vr("stream",cr("mode",{throttle:[hr("delay"),Tr("stopEvent",!0),pa("streams",{setup:function(e,t){var n=e.stream(),o=hp(e.onStream(),n.delay());return t.setTimer(o),function(e,t){o.throttle(e,t),n.stopEvent()&&t.stop()}},state:OS})]})),Tr("event","input"),kr("cancelEvent"),ha("onStream")],HS=Ci({fields:MS,name:"streaming",active:zS,state:TS}),ES=U("sink"),VS=U(Us({name:ES(),overrides:U({dom:{tag:"div"},behaviours:ki([cw.config({useFixed:!0})]),events:Wr([Qr(Xe()),Qr(Le()),Qr(Ke())])})}));(qk=$k||($k={}))[qk.HighlightFirst=0]="HighlightFirst",qk[qk.HighlightNone=1]="HighlightNone";var AS=function(e,t){var n=e.getHotspot()(t).getOr(t);return e.layouts().fold(function(){return{anchor:"hotspot",hotspot:n}},function(e){return{anchor:"hotspot",hotspot:n,layouts:e}})},BS=function(e,t,n,o,r,i,a){var u,c,s,l,f,d,m,g,h,v,p=AS(e,n);return(c=p,l=o,f=r,d=a,m=t,g=s=n,h=(u=e).fetch()(g).map(m),v=FS(s,u),h.map(function(e){return ph.sketch(te(f.menu(),{uid:wl(""),data:e,highlightImmediately:d===$k.HighlightFirst,onOpenMenu:function(e,t){var n=v().getOrDie();cw.position(n,c,t),bw.decloak(l)},onOpenSubmenu:function(e,t,n){var o=v().getOrDie();cw.position(o,{anchor:"submenu",item:t},n),bw.decloak(l)},onEscape:function(){return Wa.focus(s),bw.close(l),P.some(!0)}}))})).map(function(e){return bw.cloak(o),bw.open(o,e),i(o),o})},DS=function(e,t,n,o,r,i,a){return bw.close(o),Cb.pure(o)},RS=function(e,t,n,o,r,i){var a=CS.getCoupled(n,"sandbox");return(bw.isOpen(a)?DS:BS)(e,t,n,a,o,r,i)},FS=function(e,t){return e.getSystem().getByUid(t.uid()+"-"+ES()).map(function(e){return U(ie.value(e))}).getOrThunk(function(){return t.lazySink().fold(function(){return U(ie.error(new Error("No internal sink is specified, nor could an external sink be found")))},b)})},IS=function(c,s,l){var t,f=(t=ro("aria-owns"),{id:U(t),link:function(e){Wn.set(e,"aria-owns",t)},unlink:function(e){Wn.remove(e,"aria-owns")}}),e=FS(s,c);return{dom:{tag:"div",classes:c.sandboxClasses(),attributes:{id:f.id()}},behaviours:te(ki([uf.config({store:{mode:"memory",initialValue:s}}),bw.config({onOpen:function(e,t){var n,o,r,i,a,u=AS(c,s);f.link(s.element()),c.matchWidth()&&(n=u.hotspot,o=t,r=c.useMinWidth(),i=Em.getCurrent(o).getOr(o),a=xf(n.element()),r?Ja.set(i.element(),"min-width",a+"px"):yf(i.element(),a)),c.onOpen()(u,e,t),l!==undefined&&l.onOpen!==undefined&&l.onOpen(e,t)},onClose:function(e,t){f.unlink(s.element()),l!==undefined&&l.onClose!==undefined&&l.onClose(e,t)},isPartOf:function(e,t,n){return py(t,n)||py(s,n)},getAttachPoint:function(){return e().getOrDie()}}),Em.config({find:function(e){return bw.getState(e).bind(function(e){return Em.getCurrent(e)})}}),kw({isExtraPart:U(!1)})]),ps(c.sandboxBehaviours()))}},_S=function(e,t,n){var o=uf.getValue(n);uf.setValue(t,o),NS(t)},LS=function(e,t){var n=e.element(),o=Dm(n),r=n.dom();"number"!==Wn.get(n,"type")&&t(r,o)},NS=function(e){LS(e,function(e,t){return e.setSelectionRange(t.length,t.length)})},PS=function(e,t,o){if(e.selectsOver()){var n=uf.getValue(t),r=e.getDisplayText()(n),i=uf.getValue(o);return 0===e.getDisplayText()(i).indexOf(r)?P.some(function(){var e,n;_S(0,t,o),e=t,n=r.length,LS(e,function(e,t){return e.setSelectionRange(n,t.length)})}):P.none()}return P.none()},jS=U("alloy.typeahead.itemexecute"),US=function(){return[Tr("sandboxClasses",[]),vs("sandboxBehaviours",[Em,wa,bw,uf])]},WS=U([kr("lazySink"),hr("fetch"),Tr("minChars",5),Tr("responseTime",1e3),ma("onOpen"),Tr("getHotspot",P.some),Tr("layouts",P.none()),Tr("eventOrder",{}),Br("model",{},[Tr("getDisplayText",function(e){return e.meta!==undefined&&e.meta.text!==undefined?e.meta.text:e.value}),Tr("selectsOver",!0),Tr("populateFromBrowse",!0)]),ga("onExecute"),ma("onItemExecute"),Tr("inputClasses",[]),Tr("inputAttributes",{}),Tr("inputStyles",{}),Tr("matchWidth",!0),Tr("useMinWidth",!1),Tr("dismissOnBlur",!0),fa(["openClass"]),kr("initialData"),gs("typeaheadBehaviours",[Wa,uf,HS,ms,Ba,CS]),Dr("previewing",function(){return Ve(!0)})].concat(Rm()).concat(US())),GS=U([js({schema:[la()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(t,n){o.previewing().get()?t.getSystem().getByUid(o.uid()).each(function(e){PS(o.model(),e,n).fold(function(){return Fu.dehighlight(t,n)},function(e){return e()})}):t.getSystem().getByUid(o.uid()).each(function(e){o.model().populateFromBrowse()&&_S(o.model(),e,n)}),o.previewing().set(!1)},onExecute:function(e,t){return e.getSystem().getByUid(o.uid()).toOption().map(function(e){return uo(e,jS(),{item:t}),!0})},onHover:function(e,t){o.previewing().set(!1),e.getSystem().getByUid(o.uid()).each(function(e){o.model().populateFromBrowse()&&_S(o.model(),e,t)})}}}})]),XS=Ml({name:"Typeahead",configFields:WS(),partFields:GS(),factory:function(r,e,t,i){var n=function(e,t,n){r.previewing().set(!1);var o=CS.getCoupled(e,"sandbox");bw.isOpen(o)?Em.getCurrent(o).each(function(e){Fu.getHighlighted(e).fold(function(){n(e)},function(){fo(o,e.element(),"keydown",t)})}):BS(r,a(e),e,o,i,function(e){Em.getCurrent(e).each(n)},$k.HighlightFirst).get(N)},o=Fm(r),a=function(o){return function(e){var t=de(e.menus),n=W(t,function(e){return B(e.items,function(e){return"item"===e.type})});return uf.getState(o).update(V(n,function(e){return e.data})),e}},u=ki([Wa.config({}),uf.config({store:te({mode:"dataset",getDataKey:function(e){return Dm(e.element())},getFallbackEntry:function(e){return{value:e,meta:{}}},setValue:function(e,t){Bm(e.element(),r.model().getDisplayText()(t))}},r.initialData().map(function(e){return Te("initialValue",e)}).getOr({}))}),HS.config({stream:{mode:"throttle",delay:r.responseTime(),stopEvent:!1},onStream:function(e,t){var n=CS.getCoupled(e,"sandbox");if(Wa.isFocused(e)&&Dm(e.element()).length>=r.minChars()){var o=Em.getCurrent(n).bind(function(e){return Fu.getHighlighted(e).map(uf.getValue)});r.previewing().set(!0),BS(r,a(e),e,n,i,function(e){Em.getCurrent(n).each(function(e){o.fold(function(){r.model().selectsOver()&&Fu.highlightFirst(e)},function(t){Fu.highlightBy(e,function(e){return uf.getValue(e).value===t.value}),Fu.getHighlighted(e).orThunk(function(){return Fu.highlightFirst(e),P.none()})})})},$k.HighlightFirst).get(N)}},cancelEvent:It()}),ms.config({mode:"special",onDown:function(e,t){return n(e,t,Fu.highlightFirst),P.some(!0)},onEscape:function(e){var t=CS.getCoupled(e,"sandbox");return bw.isOpen(t)?(bw.close(t),P.some(!0)):P.none()},onUp:function(e,t){return n(e,t,Fu.highlightLast),P.some(!0)},onEnter:function(t){var e=CS.getCoupled(t,"sandbox"),n=bw.isOpen(e);if(n&&!r.previewing().get())return Em.getCurrent(e).bind(function(e){return Fu.getHighlighted(e)}).map(function(e){return uo(t,jS(),{item:e}),!0});var o=uf.getValue(t);return ao(t,It()),r.onExecute()(e,t,o),n&&bw.close(e),P.some(!0)}}),Ba.config({toggleClass:r.markers().openClass(),aria:{mode:"pressed",syncWithExpanded:!0}}),CS.config({others:{sandbox:function(e){return IS(r,e,{onOpen:b,onClose:b})}}}),Tm("typeaheadevents",[ri(function(e){var t=N;RS(r,a(e),e,i,t,$k.HighlightFirst).get(N)}),Yr(jS(),function(e,t){var n=CS.getCoupled(e,"sandbox");_S(r.model(),e,t.event().item()),ao(e,It()),r.onItemExecute()(e,n,t.event().item(),uf.getValue(e)),bw.close(n),NS(e)})].concat(r.dismissOnBlur()?[Yr(Ht(),function(e){var t=CS.getCoupled(e,"sandbox");ea(t.element()).isNone()&&bw.close(t)})]:[]))]);return{uid:r.uid(),dom:Im(r),behaviours:te(o,u,hs(r.typeaheadBehaviours())),eventOrder:r.eventOrder()}}}),YS=function(e,t,n){var o=qS(e,t,n);return xS.sketch(o)},$S=function(e,t){return YS(e,t,[])},qS=function(e,t,n){return e.each(function(e){console.log(e.config.dom),console.trace()}),{dom:KS(n),components:e.toArray().concat([t])}},KS=function(e){return{tag:"div",classes:["tox-form__group"].concat(e)}},JS=function(e,t){return xS.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(e)}})},QS=function(e){return Ee(e,"getSubmenuItems")?(n=(t=e).getSubmenuItems(),o=ZS(n),{item:t,menus:te(o.menus,Te(t.value,o.items)),expansions:te(o.expansions,Te(t.value,t.value))}):{item:e,menus:{},expansions:{}};var t,n,o},ZS=function(e){return D(e,function(e,t){var n=Oe(t,"value").getOrThunk(function(){return ro("generated-menu-item")}),o=te({value:n},t),r=QS(o);return{menus:te(e.menus,r.menus),items:[r.item].concat(e.items),expansions:te(e.expansions,r.expansions)}},{menus:{},expansions:{},items:[]})},eC=function(e,n,o){var t=ro("primary-menu"),r=ZS(e),i=rS(t,r.items,n,o),a=se(r.menus,function(e,t){return rS(t,e,n,o)}),u=te(a,Te(t,i));return ph.tieredData(t,u,r.expansions)},tC=Ot.detect().browser.isFirefox(),nC={position:"absolute",left:"-9999px"},oC=function(e,t,n){var o,r,i,a=function(e,t){var n=$t.fromTag("span",e.dom());Wn.set(n,"role","presentation");var o=$t.fromText(t,e.dom());return Cn.append(n,o),n}(xn.owner(t),n);tC&&(o=t,r=a,i=ro("ephox-alloy-aria-voice"),Wn.set(r,"id",i),Wn.set(o,"aria-describedby",i)),Wn.setAll(a,e(n)),Ja.setAll(a,nC),Cn.append(t,a),setTimeout(function(){Wn.remove(a,"aria-live"),Mn.remove(a)},1e3)},rC=function(e){return{"aria-live":"assertive","aria-atomic":"true",role:"alert"}},iC=["input","textarea"],aC=function(e){var t=Ln.name(e);return M(iC,t)},uC=function(e,t){var n=t.getRoot()(e).getOr(e.element());ji.remove(n,t.invalidClass()),t.notify().each(function(t){aC(e.element())&&Wn.remove(n,"title"),t.getContainer()(e).each(function(e){Vn(e,t.validHtml())}),t.onValid()(e)})},cC=function(n,e,t,o){var r=e.getRoot()(n).getOr(n.element());ji.add(r,e.invalidClass()),e.notify().each(function(e){var t;aC(n.element())&&Wn.set(n.element(),"title",o),t=ho.body(),oC(rC,t,o),e.getContainer()(n).each(function(e){Vn(e,o)}),e.onInvalid()(n,o)})},sC=function(t,e,n){return e.validator().fold(function(){return Cb.pure(ie.value(!0))},function(e){return e.validate()(t)})},lC=function(t,n,e){return n.notify().each(function(e){e.onValidate()(t)}),sC(t,n).map(function(e){return t.getSystem().isConnected()?e.fold(function(e){return cC(t,n,0,e),ie.error(e)},function(e){return uC(t,n),ie.value(e)}):ie.error("No longer in system")})},fC=Object.freeze({markValid:uC,markInvalid:cC,query:sC,run:lC,isInvalid:function(e,t){var n=t.getRoot()(e).getOr(e.element());return ji.has(n,t.invalidClass())}}),dC=Object.freeze({events:function(t,e){return t.validator().map(function(e){return Wr([Yr(e.onEvent(),function(e){lC(e,t).get(b)})].concat(e.validateOnLoad()?[ti(function(e){lC(e,t).get(N)})]:[]))}).getOr({})}}),mC=[hr("invalidClass"),Tr("getRoot",P.none),zr("notify",[Tr("aria","alert"),Tr("getContainer",P.none),Tr("validHtml",""),ma("onValid"),ma("onInvalid"),ma("onValidate")]),zr("validator",[hr("validate"),Tr("onEvent","input"),Tr("validateOnLoad",!0)])],gC=Ci({fields:mC,name:"invalidating",active:dC,apis:fC,extra:{validation:function(n){return function(e){var t=uf.getValue(e);return Cb.pure(n(t))}}}}),hC=function(e,t){return e.getParam("color_cols",t)},vC=function(e){return!1!==e.getParam("custom_colors")},pC=function(e){return e.getParam("color_map")},bC="choiceitem",yC=Ve([{type:bC,text:"Black",value:"#1abc9c"},{type:bC,text:"Black",value:"#2ecc71"},{type:bC,text:"Black",value:"#3498db"},{type:bC,text:"Black",value:"#9b59b6"},{type:bC,text:"Black",value:"#34495e"},{type:bC,text:"Black",value:"#16a085"},{type:bC,text:"Black",value:"#27ae60"},{type:bC,text:"Black",value:"#2980b9"},{type:bC,text:"Black",value:"#8e44ad"},{type:bC,text:"Black",value:"#2c3e50"},{type:bC,text:"Black",value:"#f1c40f"},{type:bC,text:"Black",value:"#e67e22"},{type:bC,text:"Black",value:"#e74c3c"},{type:bC,text:"Black",value:"#ecf0f1"},{type:bC,text:"Black",value:"#95a5a6"},{type:bC,text:"Black",value:"#f39c12"},{type:bC,text:"Black",value:"#d35400"},{type:bC,text:"Black",value:"#c0392b"},{type:bC,text:"Black",value:"#bdc3c7"},{type:bC,text:"Black",value:"#7f8c8d"},{type:bC,text:"Black",value:"#000000"},{type:bC,text:"Black",value:"#ffffff"}]),xC=function(e){var t,n=[];for(t=0;t<e.length;t+=2)n.push({text:e[t+1],value:"#"+e[t],type:"choiceitem"});return n},wC=function(e){return Math.ceil(Math.sqrt(e))},kC=function(e){var t=yC.get(),n=wC(t.length);return hC(e,n)},SC=function(e){return"remove"===e?'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M25 5L5 25" stroke-width="1.5" fill="none"></path></svg>':"custom"===e?"color-picker":'<div style="width: 24px; height: 24px; background-color: '+e+';"></div>'},CC=function(t,n,e,o,r){"custom"===o?MC(t)(function(e){OC(e),t.execCommand("mceApplyTextcolor",n,e),r(e)},"#000000"):"remove"===o?(r(""),t.execCommand("mceRemoveTextcolor",n)):(r(o),t.execCommand("mceApplyTextcolor",n,o))},zC=function(i){return function(e){var t,n,o,r;e(yC.get().concat((t=i,o={type:n="choiceitem",text:"Remove",icon:SC("remove"),value:"remove"},r={type:n,text:"Custom",icon:SC("custom"),value:"custom"},t?[o,r]:[o])))}},OC=function(e){yC.set(yC.get().concat([{type:"choiceitem",text:e,value:e}]))},TC=function(t,r,n,e){var i;t.ui.registry.addSplitButton(r,(i=Ve(null),{type:"splitbutton",tooltip:e,presets:"color",icon:"forecolor"===r?"text-color":"background-color",select:function(){return!1},columns:kC(t),fetch:zC(vC(t)),onAction:function(e){null!==i.get()&&CC(t,n,0,i.get(),function(){})},onItemAction:function(o,e){CC(t,n,0,e,function(e){var t,n;i.set(e),t="forecolor"===r?"color":"Rectangle",n=e,o.setIconFill(t,n),o.setIconStroke(t,n)})}}))},MC=function(r){return function(e,t){var n,o=(n=e,function(e){var t=e.getData();n(t.colorpicker),e.close()});r.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"submit",name:"ok",text:"Ok",primary:!0},{type:"cancel",name:"cancel",text:"Cancel"}],initialData:{colorpicker:t},onAction:function(e,t){"hex-valid"===t.name&&(t.value?e.enable("ok"):e.disable("ok"))},onSubmit:o,onClose:function(){r.focus()}})}},HC={register:function(e){var i,t=pC(e);t!==undefined&&yC.set(xC(t)),(i=e).addCommand("mceApplyTextcolor",function(e,t){var n,o,r;o=e,r=t,(n=i).undoManager.transact(function(){n.focus(),n.formatter.apply(o,{value:r}),n.nodeChanged()})}),i.addCommand("mceRemoveTextcolor",function(e){var t,n;n=e,(t=i).undoManager.transact(function(){t.focus(),t.formatter.remove(n,{value:null},null,!0),t.nodeChanged()})}),TC(e,"forecolor","forecolor","Color"),TC(e,"backcolor","hilitecolor","Background Color")},addColor:OC,getFetch:zC,colorPickerDialog:MC,getCurrentColor:function(e,n){var o;return e.dom.getParents(e.selection.getStart(),function(e){var t;(t=e.style["forecolor"===n?"color":"background-color"])&&(o=o||t)}),o},mapColors:xC,getColorCols:kC,calcCols:wC},EC=U([hr("dom"),hr("fetch"),ma("onOpen"),ga("onExecute"),Tr("getHotspot",P.some),Tr("layouts",P.none()),gs("dropdownBehaviours",[Ba,CS,ms,Wa]),hr("toggleClass"),Tr("eventOrder",{}),kr("lazySink"),Tr("matchWidth",!1),Tr("useMinWidth",!1),kr("role")].concat(US())),VC=U([js({schema:[la()],name:"menu",defaults:function(e){return{onExecute:e.onExecute()}}}),VS()]),AC=Ml({name:"Dropdown",configFields:EC(),partFields:VC(),factory:function(t,e,n,o){var r=function(e){bw.getState(e).each(function(e){ph.highlightPrimary(e)})},i={expand:function(e){Ba.isOn(e)||RS(t,function(e){return e},e,o,N,$k.HighlightNone).get(N)},open:function(e){Ba.isOn(e)||RS(t,function(e){return e},e,o,N,$k.HighlightFirst).get(N)},isOpen:Ba.isOn,close:function(e){Ba.isOn(e)&&RS(t,function(e){return e},e,o,N,$k.HighlightFirst).get(N)}},a=function(e,t){return co(e),P.some(!0)};return te({events:La(P.some(function(e){RS(t,function(e){return e},e,o,r,$k.HighlightFirst).get(N)}))},{uid:t.uid(),dom:t.dom(),components:e,behaviours:te(ki([Ba.config({toggleClass:t.toggleClass(),aria:{mode:"pressed",syncWithExpanded:!0}}),CS.config({others:{sandbox:function(e){return IS(t,e,{onOpen:function(){Ba.on(e)},onClose:function(){Ba.off(e)}})}}}),ms.config({mode:"special",onSpace:a,onEnter:a,onDown:function(e,t){if(AC.isOpen(e)){var n=CS.getCoupled(e,"sandbox");r(n)}else AC.open(e);return P.some(!0)},onEscape:function(e,t){return AC.isOpen(e)?(AC.close(e),P.some(!0)):P.none()}}),Wa.config({})]),hs(t.dropdownBehaviours())),eventOrder:te(t.eventOrder(),{"alloy.execute":["toggling","alloy.base.behaviour"]}),apis:i},{dom:{attributes:{role:t.role().getOr("button"),"aria-haspopup":"true"}}})},apis:{open:function(e,t){return e.open(t)},expand:function(e,t){return e.expand(t)},close:function(e,t){return e.close(t)},isOpen:function(e,t){return e.isOpen(t)}}}),BC=ro("color-change"),DC=ro("hex-change"),RC=function(e,t,o){var n,r,i=xS.parts().field({factory:_m,inputClasses:["tox-textfield"],onSetValue:function(e){return gC.run(e).get(function(){})},inputBehaviours:ki([Pm.config({}),gC.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(e){return xn.parent(e.element())},notify:{onValid:function(e){var t=uf.getValue(e);uo(e,BC,{color:t})}},validator:{validateOnLoad:!1,validate:function(e){var t=uf.getValue(e);if(0===t.length)return Cb.pure(ie.value(!0));var n=$t.fromTag("span");Ja.set(n,"background-color",t);var o=Ja.getRaw(n,"background-color").fold(function(){return ie.error("blah")},function(e){return ie.value(t)});return Cb.pure(o)}}})])}),a=e.label.map(function(e){return JS(e,t.providers)}),u=function(e,t){uo(e,DC,{value:t})},c=Qd((n={dom:{tag:"span"},layouts:P.some({onRtl:function(){return[px]},onLtr:function(){return[bx]}}),components:[],fetch:HC.getFetch(o.hasCustomColors()),onItemAction:function(n){t.getSink().each(function(e){c.getOpt(e).each(function(t){"custom"===n?o.colorPicker(function(e){u(t,e),HC.addColor(e)},"#ffffff"):u(t,"remove"===n?"":n)})})}},r=t,AC.sketch({dom:n.dom,components:n.components,toggleClass:"mce-active",dropdownBehaviours:ki([Vl.config({}),Pm.config({})]),layouts:n.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:r.getSink,fetch:function(){return Cb.nu(function(e){return n.fetch(e)}).map(function(e){return iS(te(oS(ro("menu-value"),e,function(e){n.onItemAction(e)},5,"color",Aw.CLOSE_ON_EXECUTE,function(){return!1},r.providers),{movement:Gk(5,"color")}))})},parts:{menu:Wk(0,0,"color")}})));return xS.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:a.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[i,c.asSpec()]}]),fieldBehaviours:ki([Tm("form-field-events",[Yr(BC,function(e,t){c.getOpt(e).each(function(e){Ja.set(e.element(),"background-color",t.event().color())})}),Yr(DC,function(t,n){xS.getField(t).each(function(e){uf.setValue(e,n.event().value()),Em.getCurrent(t).each(Wa.focus)})})])])})},FC=function(e){return{value:U(e)}},IC=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,_C=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,LC=function(e){return IC.test(e)||_C.test(e)},NC=function(e){var t,n=(t=e.value().replace(IC,function(e,t,n,o){return t+t+n+n+o+o}),{value:U(t)});return _C.exec(n.value())},PC=function(e){var t=e.toString(16);return 1==t.length?"0"+t:t},jC=function(e){var t=PC(e.red())+PC(e.green())+PC(e.blue());return FC(t)},UC=Math.min,WC=Math.max,GC=Math.round,XC=function(e,t,n,o){return{red:U(e),green:U(t),blue:U(n),alpha:U(o)}},YC=function(e){var t=parseInt(e,10);return t.toString()===e&&0<=t&&t<=255},$C=function(e){var t,n,o,r,i,a,u,c,s,l;if(i=(e.hue()||0)%360,a=e.saturation()/100,u=e.value()/100,a=WC(0,UC(a,1)),u=WC(0,UC(u,1)),0===a)return c=s=l=GC(255*u),XC(c,s,l,1);switch(t=i/60,o=(n=u*a)*(1-Math.abs(t%2-1)),r=u-n,Math.floor(t)){case 0:c=n,s=o,l=0;break;case 1:c=o,s=n,l=0;break;case 2:c=0,s=n,l=o;break;case 3:c=0,s=o,l=n;break;case 4:c=o,s=0,l=n;break;case 5:c=n,s=0,l=o;break;default:c=s=l=0}return c=GC(255*(c+r)),s=GC(255*(s+r)),l=GC(255*(l+r)),XC(c,s,l,1)},qC=function(e){var t=NC(e),n=parseInt(t[1],16),o=parseInt(t[2],16),r=parseInt(t[3],16);return XC(n,o,r,1)},KC=function(e){return"rgba("+e.red()+","+e.green()+","+e.blue()+","+e.alpha()+")"},JC=U(XC(255,0,0,1)),QC=U(ro("rgb-hex-update")),ZC=U(ro("slider-update")),ez=U(ro("palette-update")),tz=function(e,o){var r=Pd.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=Pd.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"<div class="+o("sv-palette-inner-thumb")+' role="presentation"></div>'}}),a=function(e,t){var n=e.width,o=e.height,r=e.getContext("2d");r.fillStyle=t,r.fillRect(0,0,n,o);var i=r.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,n,o);var a=r.createLinearGradient(0,0,0,o);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=a,r.fillRect(0,0,n,o)};return Tl({factory:function(e){var t=U({x:U(0),y:U(0)}),n=ki([Em.config({find:P.some}),Wa.config({})]);return Pd.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:t},rounded:!1,components:[r,i],onChange:function(e,t,n){uo(e,ez(),{value:n})},onInit:function(e,t,n,o){a(n.element().dom(),KC(JC()))},sliderBehaviours:n})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(e,t,n){var o,r;o=n,r=t.components()[0].element().dom(),a(r,KC(o))}},extraApis:{}})},nz=function(e,t){var n=Pd.parts().spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=Pd.parts().thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return Pd.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:U({y:U(0)})},components:[n,o],sliderBehaviours:ki([Wa.config({})]),onChange:function(e,t,n){uo(e,ZC(),{value:n})}})},oz=ro("valid-input"),rz=ro("invalid-input"),iz=ro("validating-input"),az="colorcustom.rgb.",uz=function(m,g,h,v){var p=function(e,t,n,o,r){var i,a,u=m(az+"range"),c=[xS.parts().label({dom:{tag:"label",innerHtml:n,attributes:{"aria-label":o}}}),xS.parts().field({data:r,factory:_m,inputAttributes:{type:"text"},inputClasses:[g("textfield")],inputBehaviours:ki([(i=t,a=e,gC.config({invalidClass:g("invalid"),notify:{onValidate:function(e){uo(e,iz,{type:i})},onValid:function(e){uo(e,oz,{type:i,value:uf.getValue(e)})},onInvalid:function(e){uo(e,rz,{type:i,value:uf.getValue(e)})}},validator:{validate:function(e){var t=uf.getValue(e),n=a(t)?ie.value(!0):ie.error(m("aria.input.invalid"));return Cb.pure(n)},validateOnLoad:!1}})),Pm.config({})]),onSetValue:function(e){gC.isInvalid(e)&&gC.run(e).get(N)}})],s="hex"!==t?[xS.parts()["aria-descriptor"]({text:u})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}},b=function(e,t){var n=t.red(),o=t.green(),r=t.blue();uf.setValue(e,{red:n,green:o,blue:r})},y=Qd({dom:{tag:"div",classes:[g("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),x=function(e,t){y.getOpt(e).each(function(e){Ja.set(e.element(),"background-color","#"+t.value())})};return Tl({factory:function(e){var n={red:U(Ve(P.some(255))),green:U(Ve(P.some(255))),blue:U(Ve(P.some(255))),hex:U(Ve(P.some("ffffff")))},o=function(e){return n[e]().get()},i=function(e,t){n[e]().set(t)},r=function(e){var t=e.red(),n=e.green(),o=e.blue();i("red",P.some(t)),i("green",P.some(n)),i("blue",P.some(o))},t=function(e,t){var n=t.event();"hex"!==n.type()?i(n.type(),P.none()):v(e)},a=function(r,e,t){var n=parseInt(t,10);i(e,P.some(n)),o("red").bind(function(n){return o("green").bind(function(t){return o("blue").map(function(e){return XC(n,t,e,1)})})}).each(function(e){var t,n,o=(t=r,n=jC(e),ig.getField(t,"hex").each(function(e){Wa.isFocused(e)||uf.setValue(t,{hex:n.value()})}),n);x(r,o)})},u=function(e,t){var n=t.event();"hex"===n.type()?function(e,t){h(e);var n=FC(t);i("hex",P.some(t));var o=qC(n);b(e,o),r(o),uo(e,QC(),{hex:n}),x(e,n)}(e,n.value()):a(e,n.type(),n.value())},c=function(e){return{label:m(az+e+".label"),description:m(az+e+".description")}},s=c("red"),l=c("green"),f=c("blue"),d=c("hex");return te(ig.sketch(function(e){return{dom:{tag:"form",classes:[g("rgb-form")],attributes:{"aria-label":m("aria.color.picker")}},components:[e.field("red",xS.sketch(p(YC,"red",s.label,s.description,255))),e.field("green",xS.sketch(p(YC,"green",l.label,l.description,255))),e.field("blue",xS.sketch(p(YC,"blue",f.label,f.description,255))),e.field("hex",xS.sketch(p(LC,"hex",d.label,d.description,"ffffff"))),y.asSpec()],formBehaviours:ki([gC.config({invalidClass:g("form-invalid")}),Tm("rgb-form-events",[Yr(oz,u),Yr(rz,t),Yr(iz,t)])])}}),{apis:{updateHex:function(e,t){var n,o;uf.setValue(e,{hex:t.value()}),n=e,o=qC(t),b(n,o),r(o),x(e,t)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(e,t,n){e.updateHex(t,n)}},extraApis:{}})},cz=function(e,t,n){return{hue:U(e),saturation:U(t),value:U(n)}},sz=function(c,s){return Tl({name:"ColourPicker",configFields:[Tr("onValidHex",N),Tr("onInvalidHex",N),Cr("formChangeEvent")],factory:function(e){var u,p,n=uz(c,s,e.onValidHex(),e.onInvalidHex()),o=tz(c,s),b={paletteRgba:U(Ve(JC()))},t=Qd(o.sketch({})),r=Qd(n.sketch({})),i=function(e,n){t.getOpt(e).each(function(e){var t=qC(n);b.paletteRgba().set(t),o.setRgba(e,t)})},a=function(e,t){r.getOpt(e).each(function(e){n.updateHex(e,t)})},y=function(t,n,e){A(e,function(e){e(t,n)})};return{uid:e.uid(),dom:e.dom(),components:[t.asSpec(),nz(c,s),r.asSpec()],behaviours:ki([Tm("colour-picker-events",[Yr(ez(),(p=[a],function(e,t){var n,o,r,i,a,u,c,s,l,f=t.event().value(),d=b.paletteRgba().get(),m=(c=a=0,o=(n=d).red()/255,r=n.green()/255,i=n.blue()/255,(s=Math.min(o,Math.min(r,i)))===(l=Math.max(o,Math.max(r,i)))?cz(0,0,100*(c=s)):(a=60*((a=o===s?3:i===s?1:5)-(o===s?r-i:i===s?o-r:i-o)/(l-s)),u=(l-s)/l,c=l,cz(Math.round(a),Math.round(100*u),Math.round(100*c)))),g=cz(m.hue(),f.x(),100-f.y()),h=$C(g),v=jC(h);y(e,v,p)})),Yr(ZC(),(u=[i,a],function(e,t){var n,o,r,i=t.event().value(),a=(n=i.y(),o=cz(360*(100-n/100),100,100),r=$C(o),jC(r));y(e,a,u)}))]),Em.config({find:function(e){return r.getOpt(e)}}),ms.config({mode:"acyclic"})])}}})},lz=function(){return Em.config({find:P.some})},fz=function(e){return Em.config({find:e.getOpt})},dz=function(e){return Em.config({find:function(t){return xn.child(t.element(),e).bind(function(e){return t.getSystem().getByDom(e).toOption()})}})},mz={"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"},gz=function(e){return mz[e]},hz=Wo([Tr("preprocess",b),Tr("postprocess",b)]),vz=function(e,t,n){return uf.config(te({store:{mode:"manual",getValue:t,setValue:n}},e.map(function(e){return{store:{initialValue:e}}}).getOr({})))},pz=function(e,t,n){return vz(e,function(e){return t(e.element())},function(e,t){return n(e.element(),t)})},bz=function(r,e){var i=ir("RepresentingConfigs.memento processors",hz,e);return uf.config({store:{mode:"manual",getValue:function(e){var t=r.get(e),n=uf.getValue(t);return i.postprocess(n)},setValue:function(e,t){var n=i.preprocess(t),o=r.get(e);uf.setValue(o,n)}}})},yz=vz,xz=function(e){return pz(e,En,Vn)},wz=function(e){return uf.config({store:{mode:"memory",initialValue:e}})},kz=function(r,t){var n=function(e,t){t.stop()},o=function(e){return function(t,n){A(e,function(e){e(t,n)})}},i=function(e,t){if(!tg.isDisabled(e)){var n=t.event().raw();u(e,n.dataTransfer.files)}},a=function(e,t){var n=t.event().raw().target.files;u(e,n)},u=function(e,t){var n,o;uf.setValue(e,(n=t,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),B(Q(n),function(e){return o.test(e.name)}))),uo(e,sS,{name:r.name})},c=Qd({dom:{tag:"input",attributes:{type:"file",multiple:"multiple"},styles:{display:"none"}},behaviours:ki([Tm("input-file-events",[Qr(Ke())])])}),e=r.label.map(function(e){return JS(e,t)}),s=xS.parts().field({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ki([wz([]),lz(),tg.config({}),Ba.config({toggleClass:"dragenter",toggleOnExecute:!1}),Tm("dropzone-events",[Yr("dragenter",o([n,Ba.toggle])),Yr("dragleave",o([n,Ba.toggle])),Yr("dragover",n),Yr("drop",o([n,i])),Yr(qe(),a)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:"Drop Image Here"}},Hl.sketch({dom:{tag:"button",innerHtml:"Browse",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(e){c.get(e).element().dom().click()},buttonBehaviours:ki([Pm.config({})])})]}]}}}}),l=r.flex?["tox-form__group--stretched"]:[];return YS(e,s,l)},Sz=ro("alloy-fake-before-tabstop"),Cz=ro("alloy-fake-after-tabstop"),zz=function(e){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:e},behaviours:ki([Pm.config({})])}},Oz=function(e,t){uo(e,Xe(),{raw:{which:9,shiftKey:t}})},Tz=function(e){return Qp(e,["."+Sz,"."+Cz].join(","),U(!1))},Mz=function(e,t){var n=t.element();ji.has(n,Sz)?Oz(e,!0):ji.has(n,Cz)&&Oz(e,!1)},Hz=function(e){return{dom:{tag:"div",classes:["tox-navobj"]},components:[zz([Sz]),e,zz([Cz])],behaviours:ki([dz(1)])}},Ez=!Ot.detect().browser.isIE(),Vz=function(e,t){var o,r,n=Ez&&e.sandboxed,i=n?{sandbox:"allow-scripts"}:{},a=(o=n,r=Ve(""),{getValue:function(e){return r.get()},setValue:function(e,t){if(o)Wn.set(e.element(),"src","data:text/html;charset=utf-8,"+encodeURIComponent(t));else{Wn.set(e.element(),"src","javascript:''");var n=e.element().dom().contentWindow.document;n.open(),n.write(t),n.close()}r.set(t)}}),u=e.label.map(function(e){return JS(e,t)}),c=xS.parts().field({factory:{sketch:function(e){return Hz({uid:e.uid,dom:{tag:"iframe",attributes:te(i)},behaviours:ki([Pm.config({}),Wa.config({}),yz(P.none(),a.getValue,a.setValue)])})}}}),s=e.flex?["tox-form__group--stretched"]:[];return YS(u,c,s)};function Az(e,t,n){var o=t.type;function r(t,n){return e.then(function(e){return gm.canvasToDataURL(e,t,n)})}return{getType:U(o),toBlob:function i(){return rm.resolve(t)},toDataURL:function a(){return n},toBase64:function u(){return n.split(",")[1]},toAdjustedBlob:function c(t,n){return e.then(function(e){return gm.canvasToBlob(e,t,n)})},toAdjustedDataURL:r,toAdjustedBase64:function s(e,t){return r(e,t).then(function(e){return e.split(",")[1]})},toCanvas:function l(){return e.then(nm.clone)}}}function Bz(t){return gm.blobToDataUri(t).then(function(e){return Az(gm.blobToCanvas(t),t,e)})}var Dz={fromBlob:Bz,fromCanvas:function KB(t,e){return gm.canvasToBlob(t,e).then(function(e){return Az(rm.resolve(t),e,t.toDataURL())})},fromImage:function JB(e){return gm.imageToBlob(e).then(function(e){return Bz(e)})},fromBlobAndUrlSync:function(e,t){return Az(gm.blobToCanvas(e),e,t)}},Rz=function(e){return Dz.fromBlob(e)};function Fz(e,t,n){return n<(e=parseFloat(e))?e=n:e<t&&(e=t),e}var Iz=[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 _z(e,t){var n,o,r,i,a=[],u=new Array(10);for(n=0;n<5;n++){for(o=0;o<5;o++)a[o]=t[o+5*n];for(o=0;o<5;o++){for(r=i=0;r<5;r++)i+=e[o+5*r]*a[r];u[o+5*n]=i}}return u}function Lz(e,n){return n=Fz(n,0,1),e.map(function(e,t){return t%6==0?e=1-(1-e)*n:e*=n,Fz(e,0,1)})}var Nz={identity:function QB(){return[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]},adjust:Lz,multiply:_z,adjustContrast:function ZB(e,t){var n;return t=Fz(t,-1,1),_z(e,[(n=(t*=100)<0?127+t/100*127:127*(n=0==(n=t%1)?Iz[t]:Iz[Math.floor(t)]*(1-n)+Iz[Math.floor(t)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])},adjustBrightness:function eD(e,t){return _z(e,[1,0,0,0,t=Fz(255*t,-255,255),0,1,0,0,t,0,0,1,0,t,0,0,0,1,0,0,0,0,0,1])},adjustSaturation:function tD(e,t){var n;return _z(e,[.3086*(1-(n=1+(0<(t=Fz(t,-1,1))?3*t:t)))+n,.6094*(1-n),.082*(1-n),0,0,.3086*(1-n),.6094*(1-n)+n,.082*(1-n),0,0,.3086*(1-n),.6094*(1-n),.082*(1-n)+n,0,0,0,0,0,1,0,0,0,0,0,1])},adjustHue:function nD(e,t){var n,o;return t=Fz(t,-180,180)/180*Math.PI,_z(e,[.213+.787*(n=Math.cos(t))+-.213*(o=Math.sin(t)),.715+-.715*n+-.715*o,.072+-.072*n+.928*o,0,0,.213+-.213*n+.143*o,.715+n*(1-.715)+.14*o,.072+-.072*n+-.283*o,0,0,.213+-.213*n+-.787*o,.715+-.715*n+.715*o,.072+.928*n+.072*o,0,0,0,0,0,1,0,0,0,0,0,1])},adjustColors:function oD(e,t,n,o){return _z(e,[t=Fz(t,0,2),0,0,0,0,0,n=Fz(n,0,2),0,0,0,0,0,o=Fz(o,0,2),0,0,0,0,0,1,0,0,0,0,0,1])},adjustSepia:function rD(e,t){return _z(e,Lz([.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0,0,0,0,0,1],t=Fz(t,0,1)))},adjustGrayscale:function iD(e,t){return _z(e,Lz([.33,.34,.33,0,0,.33,.34,.33,0,0,.33,.34,.33,0,0,0,0,0,1,0,0,0,0,0,1],t=Fz(t,0,1)))}};function Pz(t,n){return t.toCanvas().then(function(e){return function i(e,t,n){var o,r=nm.get2dContext(e);return o=function M(e,t){var n,o,r,i,a,u=e.data,c=t[0],s=t[1],l=t[2],f=t[3],d=t[4],m=t[5],g=t[6],h=t[7],v=t[8],p=t[9],b=t[10],y=t[11],x=t[12],w=t[13],k=t[14],S=t[15],C=t[16],z=t[17],O=t[18],T=t[19];for(a=0;a<u.length;a+=4)n=u[a],o=u[a+1],r=u[a+2],i=u[a+3],u[a]=n*c+o*s+r*l+i*f+d,u[a+1]=n*m+o*g+r*h+i*v+p,u[a+2]=n*b+o*y+r*x+i*w+k,u[a+3]=n*S+o*C+r*z+i*O+T;return e}(r.getImageData(0,0,e.width,e.height),n),r.putImageData(o,0,0),Dz.fromCanvas(e,t)}(e,t.getType(),n)})}function jz(t,n){return t.toCanvas().then(function(e){return function a(e,t,n){var o,r,i=nm.get2dContext(e);return o=i.getImageData(0,0,e.width,e.height),r=i.getImageData(0,0,e.width,e.height),r=function w(e,t,n){var o,r,i,a,u,c,s,l,f,d,m,g,h,v,p,b,y;function x(e,t,n){return n<e?e=n:e<t&&(e=t),e}for(i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=e.data,r=t.data,b=e.width,y=e.height,c=0;c<y;c++)for(u=0;u<b;u++){for(s=l=f=0,m=0;m<i;m++)for(d=0;d<i;d++)g=x(u+d-a,0,b-1),h=x(c+m-a,0,y-1),v=4*(h*b+g),p=n[m*i+d],s+=o[v]*p,l+=o[v+1]*p,f+=o[v+2]*p;r[v=4*(c*b+u)]=x(s,0,255),r[v+1]=x(l,0,255),r[v+2]=x(f,0,255)}return t}(o,r,n),i.putImageData(r,0,0),Dz.fromCanvas(e,t)}(e,t.getType(),n)})}function Uz(c){return function(t,n){return t.toCanvas().then(function(e){return function(e,t,n){var o,r,i=nm.get2dContext(e),a=new Array(256);for(r=0;r<a.length;r++)a[r]=c(r,n);return o=function u(e,t){var n,o=e.data;for(n=0;n<o.length;n+=4)o[n]=t[o[n]],o[n+1]=t[o[n+1]],o[n+2]=t[o[n+2]];return e}(i.getImageData(0,0,e.width,e.height),a),i.putImageData(o,0,0),Dz.fromCanvas(e,t)}(e,t.getType(),n)})}}function Wz(n){return function(e,t){return Pz(e,n(Nz.identity(),t))}}function Gz(t){return function(e){return jz(e,t)}}var Xz={invert:function aD(t){return function(e){return Pz(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0]),brightness:Wz(Nz.adjustBrightness),hue:Wz(Nz.adjustHue),saturate:Wz(Nz.adjustSaturation),contrast:Wz(Nz.adjustContrast),grayscale:Wz(Nz.adjustGrayscale),sepia:Wz(Nz.adjustSepia),colorize:function(e,t,n,o){return Pz(e,Nz.adjustColors(Nz.identity(),t,n,o))},sharpen:Gz([0,-1,0,-1,5,-1,0,-1,0]),emboss:Gz([-2,-1,0,-1,1,1,0,1,2]),gamma:Uz(function(e,t){return 255*Math.pow(e/255,1-t)}),exposure:Uz(function(e,t){return 255*(1-Math.exp(-e/255*t))}),colorFilter:Pz,convoluteFilter:jz},Yz={scale:function uD(e,t,n){var o=om.getWidth(e),r=om.getHeight(e),i=t/o,a=n/r,u=!1;(i<.5||2<i)&&(i=i<.5?.5:2,u=!0),(a<.5||2<a)&&(a=a<.5?.5:2,u=!0);var c=function l(u,c,s){return new rm(function(e){var t=om.getWidth(u),n=om.getHeight(u),o=Math.floor(t*c),r=Math.floor(n*s),i=nm.create(o,r),a=nm.get2dContext(i);a.drawImage(u,0,0,t,n,0,0,o,r),e(i)})}(e,i,a);return u?c.then(function(e){return uD(e,t,n)}):c}},$z={rotate:function cD(t,n){return t.toCanvas().then(function(e){return function u(e,t,n){var o=nm.create(e.width,e.height),r=nm.get2dContext(o),i=0,a=0;return 90!=(n=n<0?360+n:n)&&270!=n||nm.resize(o,o.height,o.width),90!=n&&180!=n||(i=o.width),270!=n&&180!=n||(a=o.height),r.translate(i,a),r.rotate(n*Math.PI/180),r.drawImage(e,0,0),Dz.fromCanvas(o,t)}(e,t.getType(),n)})},flip:function sD(t,n){return t.toCanvas().then(function(e){return function i(e,t,n){var o=nm.create(e.width,e.height),r=nm.get2dContext(o);return"v"==n?(r.scale(1,-1),r.drawImage(e,0,-o.height)):(r.scale(-1,1),r.drawImage(e,-o.width,0)),Dz.fromCanvas(o,t)}(e,t.getType(),n)})},crop:function lD(t,n,o,r,i){return t.toCanvas().then(function(e){return function u(e,t,n,o,r,i){var a=nm.create(r,i);return nm.get2dContext(a).drawImage(e,-n,-o),Dz.fromCanvas(a,t)}(e,t.getType(),n,o,r,i)})},resize:function fD(t,n,o){return t.toCanvas().then(function(e){return Yz.scale(e,n,o).then(function(e){return Dz.fromCanvas(e,t.getType())})})}},qz=(function(){function e(e){this.littleEndian=!1,this._dv=new DataView(e)}e.prototype.readByteAt=function(e){return this._dv.getUint8(e)},e.prototype.read=function(e,t){if(e+t>this.length())return null;for(var n=this.littleEndian?0:-8*(t-1),o=0,r=0;o<t;o++)r|=this.readByteAt(e+o)<<Math.abs(n+8*o);return r},e.prototype.BYTE=function(e){return this.read(e,1)},e.prototype.SHORT=function(e){return this.read(e,2)},e.prototype.LONG=function(e){return this.read(e,4)},e.prototype.SLONG=function(e){var t=this.read(e,4);return 2147483647<t?t-4294967296:t},e.prototype.CHAR=function(e){return String.fromCharCode(this.read(e,1))},e.prototype.STRING=function(e,t){return this.asArray("CHAR",e,t).join("")},e.prototype.SEGMENT=function(e,t){var n=this._dv.buffer;switch(arguments.length){case 2:return n.slice(e,e+t);case 1:return n.slice(e);default:return n}},e.prototype.asArray=function(e,t,n){for(var o=[],r=0;r<n;r++)o[r]=this[e](t+r);return o},e.prototype.length=function(){return this._dv?this._dv.byteLength:0}}(),function(e,t){return $z.rotate(e,t)}),Kz=function(e){return Xz.invert(e)},Jz=function(e){return Xz.sharpen(e)},Qz=function(e,t){return Xz.brightness(e,t)},Zz=function(e,t){return Xz.contrast(e,t)},eO=function(e,t,n,o){return Xz.colorize(e,t,n,o)},tO=function(e,t){return Xz.gamma(e,t)},nO=function(e,t){return $z.flip(e,t)},oO=function(e,t,n,o,r){return $z.crop(e,t,n,o,r)},rO=function(e,t,n){return $z.resize(e,t,n)},iO=qz,aO=function(e,t){return{dom:{tag:"span",innerHtml:Mw("icon-"+e,t,U(e)),classes:["tox-tbtn__icon-wrap"]}}},uO=function(e,t,n){return{dom:{tag:"span",innerHtml:n.translate(e),classes:[t+"__select-label"]},behaviours:ki([dh.config({})])}},cO=function(e,t,n,o,r){void 0===n&&(n=[]);var i={buttonBehaviours:ki([ik(e.disabled),Pm.config({}),Tm("button press",[Xr("click"),Xr("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},action:t},a=te(i,{dom:o}),u=te(a,{components:r});return Hl.sketch(u)},sO=function(e,t,n,o){void 0===o&&(o=[]);var r={tag:"button",classes:["tox-tbtn"],attributes:e.tooltip.map(function(e){return{"aria-label":n.translate(e),title:n.translate(e)}}).getOr({})},i=e.icon.map(function(e){return aO(e,n.icons)}),a=lk([i]);return cO(e,t,o,r,a)},lO=function(e,t,n,o){void 0===o&&(o=[]);var r=n.translate(e.text),i={tag:"button",classes:e.primary?["tox-button"]:["tox-button","tox-button--secondary"],innerHtml:r,attributes:{title:r}};return cO(e,t,o,i,[])},fO=function(t,n){return function(e){"custom"===n?uo(e,dS,{name:t,value:{}}):"submit"===n?ao(e,mS):"cancel"===n?ao(e,fS):console.error("Unknown button type: ",n)}},dO=function(e,t,n){var o=fO(e.name,t);return lO(e,o,n,[])},mO=U([Tr("field1Name","field1"),Tr("field2Name","field2"),ha("onLockedChange"),fa(["lockClass"]),Tr("locked",!1),vs("coupledFieldBehaviours",[Em,uf])]),gO=function(e,i){return Ps({factory:xS,name:e,overrides:function(r){return{fieldBehaviours:ki([Tm("coupled-input-behaviour",[Yr($e(),function(n){var e,t,o;(e=n,t=r,o=i,tl(e,t,o).bind(Em.getCurrent)).each(function(t){tl(n,r,"lock").each(function(e){Ba.isOn(e)&&r.onLockedChange()(n,t,e)})})})])])}}})},hO=U([gO("field1","field2"),gO("field2","field1"),Ps({factory:Hl,schema:[hr("dom")],name:"lock",overrides:function(e){return{buttonBehaviours:ki([Ba.config({selected:e.locked(),toggleClass:e.markers().lockClass(),aria:{mode:"pressed"}})])}}})]),vO=Ml({name:"FormCoupledInputs",configFields:mO(),partFields:hO(),factory:function(o,e,t,n){return{uid:o.uid(),dom:o.dom(),components:e,behaviours:te(ki([Em.config({find:P.some}),uf.config({store:{mode:"manual",getValue:function(e){var t,n=al(e,o,["field1","field2"]);return(t={})[o.field1Name()]=uf.getValue(n.field1()),t[o.field2Name()]=uf.getValue(n.field2()),t},setValue:function(e,t){var n=al(e,o,["field1","field2"]);Ee(t,o.field1Name())&&uf.setValue(n.field1(),t[o.field1Name()]),Ee(t,o.field2Name())&&uf.setValue(n.field2(),t[o.field2Name()])}}})]),ps(o.coupledFieldBehaviours())),apis:{getField1:function(e){return tl(e,o,"field1")},getField2:function(e){return tl(e,o,"field2")},getLock:function(e){return tl(e,o,"lock")}}}},apis:{getField1:function(e,t){return e.getField1(t)},getField2:function(e,t){return e.getField2(t)},getLock:function(e,t){return e.getLock(t)}}}),pO=function(e){var t=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(e);if(null===t)return ie.error(e);var n=parseFloat(t[1]),o=t[2];return ie.value({value:n,unit:o})},bO=function(e,t){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,"in":1},o=function(e){return Object.prototype.hasOwnProperty.call(n,e)};return e.unit===t?P.some(e.value):o(e.unit)&&o(t)?n[e.unit]===n[t]?P.some(e.value):P.some(e.value/n[e.unit]*n[t]):P.none()},yO=function(e){return P.none()},xO=function(e,t){return function(e,t){for(var n=[],o=0;o<e.length;o++){var r=e[o];if(!r.isSome())return P.none();n.push(r.getOrDie())}return P.some(t.apply(null,n))}([pO(e).toOption(),pO(t).toOption()],function(e,o){return bO(e,o.unit).map(function(e){return o.value/e}).map(function(e){return t=e,n=o.unit,function(e){return bO(e,n).map(function(e){return{value:e*t,unit:n}})};var t,n}).getOr(yO)}).getOr(yO)},wO=function(o,e){var u=yO,r=ro("ratio-event"),t=function(n){var e=xS.parts().field({factory:_m,inputClasses:["tox-textfield"],inputBehaviours:ki([Pm.config({}),Tm("size-input-events",[Yr(We(),function(e,t){uo(e,r,{isField1:n.isField1})}),Yr(qe(),function(e,t){uo(e,sS,{name:o.name})})])])}),t=xS.parts()["aria-descriptor"]({text:n.label});return{dom:{tag:"div"},components:[t,e]}},n=vO.parts().field1(t({label:"Width",isField1:!0})),i=vO.parts().field2(t({label:"Height",isField1:!1})),a=vO.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:Tw("icon-lock",e.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:Tw("icon-unlock",e.icons)}}],buttonBehaviours:ki([Pm.config({})])});return vO.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate("Dimensions")}},{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[n,{dom:{tag:"span",innerHtml:"\xd7"}},i,a]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(e,i,t){pO(uf.getValue(e)).each(function(e){u(e).each(function(e){var t,n,o,r;uf.setValue(i,(o={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,"in":4,"%":4},-1!==(r=(t=e).value.toFixed((n=t.unit)in o?o[n]:1)).indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit))})})},coupledFieldBehaviours:ki([Tm("size-input-events2",[Yr(r,function(e,t){var n=t.event().isField1(),o=n?vO.getField1(e):vO.getField2(e),r=n?vO.getField2(e):vO.getField1(e),i=o.map(uf.getValue).getOr(""),a=r.map(uf.getValue).getOr("");u=xO(i,a)})])])})},kO={undo:U(ro("undo")),redo:U(ro("redo")),zoom:U(ro("zoom")),back:U(ro("back")),apply:U(ro("apply")),swap:U(ro("swap")),transform:U(ro("transform")),tempTransform:U(ro("temp-transform")),transformApply:U(ro("transform-apply"))},SO=U("save-state"),CO=U("disable"),zO=U("enable"),OO={formActionEvent:dS,saveState:SO,disable:CO,enable:zO},TO=function(r,i){var e=function(e,t,n,o){return lO({name:e,text:e,disabled:n,primary:o},t,i)},t=function(e,t,n,o){return sO({name:e,icon:P.some(e),tooltip:P.some(t),disabled:o},n,i)},c={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},n=P.none(),o=N,a=function(e,t,n){uo(e,t,n)},f=function(e,t){a(e,kO.transform(),{transform:t})},u=function(e,t){a(e,kO.tempTransform(),{transform:t})},s=function(e){return function(){L.getOpt(e).each(function(e){dh.set(e,[I])})}},l=function(e,t){a(e,kO.transformApply(),{transform:t,swap:s(e)})},d=function(){return e("Back",function(e){return a(e,kO.back(),{swap:s(e)})},!1,!1)},m=function(){return e("Apply",function(e){return a(e,kO.apply(),{swap:s(e)})},!0,!0)},g=Vm.sketch({dom:c,components:[d(),{dom:{tag:"div",classes:["tox-spacer"]}},e("Apply",function(e){l(e,function(e){var t=r.getRect();return oO(e,t.x,t.y,t.w,t.h)}),r.hideCrop()},!1,!0)]}),h=Qd(wO({name:"size",label:n,colspan:n,type:"sizeinput",constrain:!0},i)),v=Vm.sketch({dom:c,components:[d(),{dom:{tag:"div",classes:["tox-spacer"]}},h.asSpec(),{dom:{tag:"div",classes:["tox-spacer"]}},e("Apply",function(u){h.getOpt(u).each(function(e){var t,n,o=uf.getValue(e),r=parseInt(o.width,10),i=parseInt(o.height,10),a=(t=r,n=i,function(e){return rO(e,t,n)});l(u,a)})},!1,!0)]}),p=function(t,n){return function(e){return t(e,n)}},b=p(nO,"h"),y=p(nO,"v"),x=p(iO,-90),w=p(iO,90),k=Vm.sketch({dom:c,components:[d(),{dom:{tag:"div",classes:["tox-spacer"]}},t("flip-horizontally","Flip horizontally",function(e){u(e,b)},!1),t("flip-vertically","Flip vertically",function(e){u(e,y)},!1),t("rotate-left","Rotate counterclockwise",function(e){u(e,x)},!1),t("rotate-right","Rotate clockwise",function(e){u(e,w)},!1),{dom:{tag:"div",classes:["tox-spacer"]}},m()]}),S=function(e,t,n,o){var r=Pd.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),i=Pd.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Pd.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:t,maxX:o,getInitialValue:U({x:U(n)})},components:[r,i],sliderBehaviours:ki([Wa.config({})]),onChoose:e})},C=function(e,t,n,o){return Vm.sketch({dom:c,components:[d(),(r=e,i=t,a=n,u=o,S(function(e,t,n){var o=p(r,n.x()/100);f(e,o)},i,a,u)),m()]});var r,i,a,u},z=Vm.sketch({dom:c,components:[d(),{dom:{tag:"div",classes:["tox-spacer"]}},m()]}),O=C(Qz,-100,0,100),T=C(Zz,-100,0,100),M=C(tO,-100,0,100),H=function(){return S(function(l,e,t){var n=E.getOpt(l),o=A.getOpt(l),r=V.getOpt(l);n.each(function(s){o.each(function(c){r.each(function(e){var t,n,o,r=uf.getValue(s).x()/100,i=uf.getValue(e).x()/100,a=uf.getValue(c).x()/100,u=(t=r,n=i,o=a,function(e){return eO(e,t,n,o)});f(l,u)})})})},0,100,200)},E=Qd(H()),V=Qd(H()),A=Qd(H()),B=Vm.sketch({dom:c,components:[d(),E.asSpec(),V.asSpec(),A.asSpec(),m()]}),D=function(t,n,o){return function(e){a(e,kO.swap(),{transform:n,swap:function(){L.getOpt(e).each(function(e){dh.set(e,[t]),o(e)})}})}},R=P.some(Jz),F=P.some(Kz),I=Vm.sketch({dom:c,components:[t("crop","Crop",D(g,n,function(e){r.showCrop()}),!1),t("resize","Resize",D(v,n,function(e){h.getOpt(e).each(function(e){var t=r.getMeasurements(),n=t.width,o=t.height;uf.setValue(e,{width:n,height:o})})}),!1),t("orientation","Orientation",D(k,n,o),!1),t("brightness","Brightness",D(O,n,o),!1),t("sharpen","Sharpen",D(z,R,o),!1),t("contrast","Contrast",D(T,n,o),!1),t("color-levels","Color levels",D(B,n,o),!1),t("gamma","Gamma",D(M,n,o),!1),t("invert","Invert",D(z,F,o),!1)]}),_=Vm.sketch({dom:{tag:"div"},components:[I],containerBehaviours:ki([dh.config({})])}),L=Qd(_);return{memContainer:L,getApplyButton:function(e){return L.getOpt(e).map(function(e){var t=e.components()[0];return t.components()[t.components().length-1]})}}},MO=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),HO=tinymce.util.Tools.resolve("tinymce.geom.Rect"),EO=tinymce.util.Tools.resolve("tinymce.util.Observable"),VO=tinymce.util.Tools.resolve("tinymce.util.Tools"),AO=tinymce.util.Tools.resolve("tinymce.util.VK");function BO(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}function DO(e,r){var i,a,t,u,c,l,f,d=r.document||document;r=r||{};var m=d.getElementById(r.handle||e);t=function(e){var t,n,o=function s(e){var t,n,o,r,i,a,u,c=Math.max;return t=e.documentElement,n=e.body,o=c(t.scrollWidth,n.scrollWidth),r=c(t.clientWidth,n.clientWidth),i=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),u=c(t.clientHeight,n.clientHeight),{width:o<i?r:o,height:a<c(t.offsetHeight,n.offsetHeight)?u:a}}(d);BO(e),e.preventDefault(),a=e.button,t=m,l=e.screenX,f=e.screenY,n=window.getComputedStyle?window.getComputedStyle(t,null).getPropertyValue("cursor"):t.runtimeStyle.cursor,i=MO("<div></div>").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:n}).appendTo(d.body),MO(d).on("mousemove touchmove",c).on("mouseup touchend",u),r.start(e)},c=function(e){if(BO(e),e.button!==a)return u(e);e.deltaX=e.screenX-l,e.deltaY=e.screenY-f,e.preventDefault(),r.drag(e)},u=function(e){BO(e),MO(d).off("mousemove touchmove",c).off("mouseup touchend",u),i.remove(),r.stop&&r.stop(e)},this.destroy=function(){MO(m).off()},MO(m).on("mousedown touchstart",t)}var RO,FO,IO,_O=0,LO=function(t){var l=Qd({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),f=Ve(1),d=Ve(P.none()),m=Ve({x:0,y:0,w:1,h:1}),c=Ve({x:0,y:0,w:1,h:1}),s=function(e,s){g.getOpt(e).each(function(e){var n=f.get(),o=xf(e.element()),r=eu(e.element()),i=s.dom().naturalWidth*n,a=s.dom().naturalHeight*n,u=Math.max(0,o/2-i/2),c=Math.max(0,r/2-a/2),t={left:u.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:a.toString()+"px",position:"absolute"};Ja.setAll(s,t),l.getOpt(e).each(function(e){Ja.setAll(e.element(),t)}),d.get().each(function(e){var t=m.get();e.setRect({x:t.x*n+u,y:t.y*n+c,w:t.w*n,h:t.h*n}),e.setClampRect({x:u,y:c,w:i,h:a}),e.setViewPortRect({x:0,y:0,w:o,h:r})})})},n=function(e,t){var n,u=$t.fromTag("img");return Wn.set(u,"src",t),(n=u.dom(),new Iw(function(e){var t=function(){n.removeEventListener("load",t),e(n)};n.complete?e(n):n.addEventListener("load",t)})).then(function(){return g.getOpt(e).map(function(e){var t=Ug({element:u});dh.replaceAt(e,1,P.some(t));var n=c.get(),o={x:0,y:0,w:u.dom().naturalWidth,h:u.dom().naturalHeight};c.set(o);var r,a,i=HO.inflate(o,-20,-20);return m.set(i),n.w===o.w&&n.h===o.h||(r=e,a=u,g.getOpt(r).each(function(e){var t=xf(e.element()),n=eu(e.element()),o=a.dom().naturalWidth,r=a.dom().naturalHeight,i=Math.min(t/o,n/r);1<=i?f.set(1):f.set(i)})),s(e,u),u})})},e=Vm.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[l.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:ki([Tm("image-panel-crop-events",[ti(function(e){g.getOpt(e).each(function(e){var t=function k(s,n,l,o,r){var f,a,t,i,u="tox-",c="tox-crid-"+_O++;function d(e,t){return{x:t.x-e.x,y:t.y-e.y,w:t.w,h:t.h}}function m(e,t,n,o){var r,i,a,u,c;r=t.x,i=t.y,a=t.w,u=t.h,r+=n*e.deltaX,i+=o*e.deltaY,(a+=n*e.deltaW)<20&&(a=20),(u+=o*e.deltaH)<20&&(u=20),c=s=HO.clamp({x:r,y:i,w:a,h:u},l,"move"===e.name),c=d(l,c),f.fire("updateRect",{rect:c}),v(c)}function g(t){function e(e,t){t.h<0&&(t.h=0),t.w<0&&(t.w=0),MO("#"+c+"-"+e,o).css({left:t.x,top:t.y,width:t.w,height:t.h})}VO.each(a,function(e){MO("#"+c+"-"+e.name,o).css({left:t.w*e.xMul+t.x,top:t.h*e.yMul+t.y})}),e("top",{x:n.x,y:n.y,w:n.w,h:t.y-n.y}),e("right",{x:t.x+t.w,y:t.y,w:n.w-t.x-t.w+n.x,h:t.h}),e("bottom",{x:n.x,y:t.y+t.h,w:n.w,h:n.h-t.y-t.h+n.y}),e("left",{x:n.x,y:t.y,w:t.x-n.x,h:t.h}),e("move",t)}function h(e){g(s=e)}function v(e){h(function n(e,t){return{x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}}(l,e))}return 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"],function p(){MO('<div id="'+c+'" class="'+u+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(o),VO.each(i,function(e){MO("#"+c,o).append('<div id="'+c+"-"+e+'"class="'+u+'croprect-block" style="display: none" data-mce-bogus="all">')}),VO.each(a,function(e){MO("#"+c,o).append('<div id="'+c+"-"+e.name+'" class="'+u+"croprect-handle "+u+"croprect-handle-"+e.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+e.label+'" aria-grabbed="false">')}),t=VO.map(a,function e(t){var n;return new DO(c,{document:o.ownerDocument,handle:c+"-"+t.name,start:function(){n=s},drag:function(e){m(t,n,e.deltaX,e.deltaY)}})}),g(s),MO(o).on("focusin focusout",function(e){MO(e.target).attr("aria-grabbed","focus"===e.type)}),MO(o).on("keydown",function(t){var i;function e(e,t,n,o,r){e.stopPropagation(),e.preventDefault(),m(i,n,o,r)}switch(VO.each(a,function(e){if(t.target.id===c+"-"+e.name)return i=e,!1}),t.keyCode){case AO.LEFT:e(t,0,s,-10,0);break;case AO.RIGHT:e(t,0,s,10,0);break;case AO.UP:e(t,0,s,0,-10);break;case AO.DOWN:e(t,0,s,0,10);break;case AO.ENTER:case AO.SPACEBAR:t.preventDefault(),r()}})}(),f=VO.extend({toggleVisibility:function b(e){var t;t=VO.map(a,function(e){return"#"+c+"-"+e.name}).concat(VO.map(i,function(e){return"#"+c+"-"+e})).join(","),e?MO(t,o).show():MO(t,o).hide()},setClampRect:function y(e){l=e,g(s)},setRect:h,getInnerRect:function e(){return d(l,s)},setInnerRect:v,setViewPortRect:function x(e){n=e,g(s)},destroy:function w(){VO.each(t,function(e){e.destroy()}),t=[]}},EO)}({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.element().dom(),function(){});t.toggleVisibility(!1),t.on("updateRect",function(e){var t=e.rect,n=f.get(),o={x:Math.round(t.x/n),y:Math.round(t.y/n),w:Math.round(t.w/n),h:Math.round(t.h/n)};m.set(o)}),d.set(P.some(t))})})])])}],containerBehaviours:ki([dh.config({}),Tm("image-panel-events",[ti(function(e){n(e,t)})])])}),g=Qd(e);return{memContainer:g,updateSrc:n,zoom:function(e,t){var n=f.get(),o=0<t?Math.min(2,n+.1):Math.max(.1,n-.1);f.set(o),g.getOpt(e).each(function(e){var t=e.components()[1].element();s(e,t)})},showCrop:function(){d.get().each(function(e){e.toggleVisibility(!0)})},hideCrop:function(){d.get().each(function(e){e.toggleVisibility(!1)})},getRect:function(){return m.get()},getMeasurements:function(){var e=c.get();return{width:e.w,height:e.h}}}},NO=function(e,t,n,o,r){return sO({name:e,icon:P.some(t),disabled:n,tooltip:P.some(e)},o,r)},PO=function(e,t){t?tg.enable(e):tg.disable(e)},jO=function(){return an.getOrDie("URL")},UO=function(e){return jO().createObjectURL(e)},WO=function(e){jO().revokeObjectURL(e)},GO=function(e){var t=Ve(e),n=Ve(P.none()),r=function s(){var n=[],o=-1;function e(){return 0<o}function t(){return-1!==o&&o<n.length-1}return{data:n,add:function r(e){var t;return t=n.splice(++o),n.push(e),{state:e,removed:t}},undo:function i(){if(e())return n[--o]},redo:function a(){if(t())return n[++o]},canUndo:e,canRedo:t}}();r.add(e);var i=function(e){t.set(e)},a=function(e){return{blob:e,url:UO(e)}},u=function(e){WO(e.url)},o=function(){n.get().each(u),n.set(P.none())},c=function(e){var t=a(e);i(t);var n,o=r.add(t).removed;return n=o,VO.each(n,u),t.url};return{getBlobState:function(){return t.get()},setBlobState:i,addBlobState:c,getTempState:function(){return n.get().fold(function(){return t.get()},function(e){return e})},updateTempState:function(e){var t=a(e);return o(),n.set(P.some(t)),t.url},addTempState:function(e){var t=a(e);return n.set(P.some(t)),t.url},applyTempState:function(t){return n.get().fold(function(){},function(e){c(e.blob),t()})},destroyTempState:o,undo:function(){var e=r.undo();return i(e),e.url},redo:function(){var e=r.redo();return i(e),e.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}},XO=function(e,t){var n,o,r,a=GO(e.currentState),i=function(e){var t=a.getHistoryStates();h.updateButtonUndoStates(e,t.undoEnabled,t.redoEnabled),uo(e,OO.formActionEvent,{name:OO.saveState(),value:t.undoEnabled})},u=function(e){return e.toBlob()},c=function(e){uo(e,OO.formActionEvent,{name:OO.disable(),value:{}})},s=function(e){v.getApplyButton(e).each(function(e){tg.enable(e)}),uo(e,OO.formActionEvent,{name:OO.enable(),value:{}})},l=function(e,t){return c(e),g.updateSrc(e,t)},f=function(t,e,n,o,r){return c(t),Rz(e).then(n).then(u).then(o).then(function(e){return l(t,e).then(function(e){return i(t),r(),s(t),e})})["catch"](function(e){console.log(e),s(t)})},d=function(e,t,n){var o=a.getBlobState().blob;f(e,o,t,function(e){return a.updateTempState(e)},n)},m=function(e){var t=a.getBlobState().url;return a.destroyTempState(),i(e),t},g=LO(e.currentState.url),h=(o=Qd(NO("Undo","undo",!0,function(e){uo(e,kO.undo(),{direction:1})},n=t)),r=Qd(NO("Redo","redo",!0,function(e){uo(e,kO.redo(),{direction:1})},n)),{container:Vm.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[o.asSpec(),r.asSpec(),NO("Zoom in","zoom-in",!1,function(e){uo(e,kO.zoom(),{direction:1})},n),NO("Zoom out","zoom-out",!1,function(e){uo(e,kO.zoom(),{direction:-1})},n)]}),updateButtonUndoStates:function(e,t,n){o.getOpt(e).each(function(e){PO(e,t)}),r.getOpt(e).each(function(e){PO(e,n)})}}),v=TO(g,t);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[v.memContainer.asSpec(),g.memContainer.asSpec(),h.container],behaviours:ki([uf.config({store:{mode:"manual",getValue:function(){return a.getBlobState()}}}),Tm("image-tools-events",[Yr(kO.undo(),function(t,e){var n=a.undo();l(t,n).then(function(e){s(t),i(t)})}),Yr(kO.redo(),function(t,e){var n=a.redo();l(t,n).then(function(e){s(t),i(t)})}),Yr(kO.zoom(),function(e,t){var n=t.event().direction();g.zoom(e,n)}),Yr(kO.back(),function(e,t){var n,o;o=m(n=e),l(n,o).then(function(e){s(n)}),t.event().swap()(),g.hideCrop()}),Yr(kO.apply(),function(e,t){a.applyTempState(function(){m(e),t.event().swap()()})}),Yr(kO.transform(),function(e,t){return d(e,t.event().transform(),N)}),Yr(kO.tempTransform(),function(e,t){return n=e,o=t.event().transform(),r=a.getTempState().blob,void f(n,r,o,function(e){return a.addTempState(e)},N);var n,o,r}),Yr(kO.transformApply(),function(e,t){return n=e,o=t.event().transform(),r=t.event().swap(),i=a.getBlobState().blob,void f(n,i,o,function(e){var t=a.addBlobState(e);return m(n),t},r);var n,o,r,i}),Yr(kO.swap(),function(t,e){var n;n=t,h.updateButtonUndoStates(n,!1,!1);var o=e.event().transform(),r=e.event().swap();o.fold(function(){r()},function(e){d(t,e,r)})})]),lz()])}},YO=Tl({name:"HtmlSelect",configFields:[hr("options"),gs("selectBehaviours",[Wa,uf]),Tr("selectClasses",[]),Tr("selectAttributes",{}),kr("data")],factory:function(n,e){var t=V(n.options(),function(e){return{dom:{tag:"option",value:e.value,innerHtml:e.text}}}),o=n.data().map(function(e){return Te("initialValue",e)}).getOr({});return te({uid:n.uid(),dom:{tag:"select",classes:n.selectClasses(),attributes:n.selectAttributes()},components:t,behaviours:te(ki([Wa.config({}),uf.config({store:te({mode:"manual",getValue:function(e){return Dm(e.element())},setValue:function(e,t){F(n.options(),function(e){return e.value===t}).isSome()&&Bm(e.element(),t)}},o)})]),hs(n.selectBehaviours()))})}}),$O=function(n,t){var e=n.label.map(function(e){return JS(e,t)}),o=[ms.config({mode:"execution",useEnter:!0!==n.multiline,useControlEnter:!0===n.multiline,execute:function(e){return ao(e,mS),P.some(!0)}}),Tm("textfield-change",[Yr($e(),function(e,t){uo(e,sS,{name:n.name})}),Yr(Ze(),function(e,t){uo(e,sS,{name:n.name})})]),Pm.config({})],r=n.validation.map(function(o){return gC.config({getRoot:function(e){return xn.parent(e.element())},invalidClass:"tox-invalid",validator:{validate:function(e){var t=uf.getValue(e),n=o.validator(t);return Cb.pure(!0===n?ie.value(t):ie.error(n))},validateOnLoad:o.validateOnLoad}})}).toArray(),i=xS.parts().field({tag:!0===n.multiline?"textarea":"input",inputAttributes:{},inputClasses:[n.classname],inputBehaviours:ki(j([o,r])),factory:_m}),a=n.flex?["tox-form__group--stretched"]:[];return YS(e,i,a)},qO=undefined&&undefined.__assign||function(){return(qO=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},KO=function(i){return qO({},i,{toCached:function(){return KO(i.toCached())},bindFuture:function(t){return KO(i.bind(function(e){return e.fold(function(e){return Cb.pure(ie.error(e))},function(e){return t(e)})}))},bindResult:function(t){return KO(i.map(function(e){return e.bind(t)}))},mapResult:function(t){return KO(i.map(function(e){return e.map(t)}))},foldResult:function(t,n){return i.map(function(e){return e.fold(t,n)})},withTimeout:function(e,r){return KO(Cb.nu(function(t){var n=!1,o=window.setTimeout(function(){n=!0,t(ie.error(r()))},e);i.get(function(e){n||(window.clearTimeout(o),t(e))})}))}})},JO=function(e){return KO(Cb.nu(e))},QO=JO,ZO={type:"separator"},eT=function(e){return{type:"menuitem",value:e.url,text:e.title,meta:{attach:e.attach},onAction:function(){}}},tT=function(e,t){return{type:"menuitem",value:t,text:e,meta:{attach:N},onAction:function(){}}},nT=function(e,t){return o=e,n=B(t,function(e){return e.type===o}),V(n,eT);var n,o},oT=function(e,t){var n=e.toLowerCase();return B(t,function(e){return-1!==(e.meta!==undefined&&e.meta.text!==undefined?e.meta.text:e.value).toLowerCase().indexOf(n)})},rT=function(c,e,s){var t=uf.getValue(e),l=t.meta.text!==undefined?t.meta.text:t.value;return s.getLinkInformation().fold(function(){return[]},function(e){var t,n,o,r,i,a,u=oT(l,(t=s.getHistory(c),V(t,function(e){return tT(e,e)})));return"file"===c?(n=[u,oT(l,(a=e,nT("header",a.targets))),j([(i=e,i.anchorTop.map(function(e){return tT("<top>",e)}).toArray()),oT(l,(r=e,nT("anchor",r.targets))),(o=e,o.anchorBottom.map(function(e){return tT("<bottom>",e)}).toArray())])],R(n,function(e,t){return 0===e.length||0===t.length?e.concat(t):e.concat(ZO,t)},[])):u})},iT=function(i,a,o){var e,r=function(e){var t=uf.getValue(e);o.addToHistory(t.value,i.filetype)},t=xS.parts().field({factory:XS,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],minChars:0,responseTime:0,fetch:function(e){var t=rT(i.filetype,e,o),n=eC(t,Aw.BUBBLE_TO_SANDBOX,a.providers);return Cb.pure(n)},getHotspot:function(e){return f.getOpt(e)},typeaheadBehaviours:ki(j([o.getValidationHandler().map(function(o){return gC.config({getRoot:function(e){return xn.parent(e.element())},invalidClass:"tox-status-invalid",notify:{},validator:{validate:function(t){var n=uf.getValue(t);return QO(function(e){o({type:i.filetype,url:n.value},function(n){f.getOpt(t).each(function(e){var t=function(e,t,n){(n?ji.add:ji.remove)(e.element(),t)};t(e,"tox-status-valid","valid"===n.status),t(e,"tox-status-unknown","unknown"===n.status)}),e(("invalid"===n.status?ie.error:ie.value)(n.message))})})}}})}).toArray(),[Pm.config({}),Tm("urlinput-events",j(["file"===i.filetype?[Yr($e(),function(e){uo(e,sS,{name:i.name})})]:[],[Yr(qe(),function(e){uo(e,sS,{name:i.name}),r(e)})]]))]])),eventOrder:(e={},e[$e()]=["streaming","urlinput-events","invalidating"],e),model:{getDisplayText:function(e){return e.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"dog"},lazySink:a.getSink,parts:{menu:Wk(0,0,"normal")},onExecute:function(e,t,n){uo(t,mS,{})},onItemExecute:function(e,t,n,o){r(e),uo(e,sS,{name:i.name})}}),n=i.label.map(function(e){return JS(e,a.providers)}),u=function(e,t,n){return void 0===t&&(t=e),void 0===n&&(n=e),{dom:{tag:"span",classes:["tox-icon","tox-status-icon__"+e],innerHtml:Tw("icon-"+t,a.providers.icons),attributes:{title:a.providers.translate(n)}}}},c=Qd({dom:{tag:"span",classes:["tox-status"]},components:[u("checkmark","checkmark","valid"),u("warning"),u("error","warning")]}),s=o.getUrlPicker(i.filetype),l=ro("browser.url.event"),f=Qd({dom:{tag:"div",classes:["tox-input-wrap"]},components:[t,c.asSpec()]});return xS.sketch({dom:KS([]),components:n.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:j([[f.asSpec()],s.map(function(){return e=i.label,t=l,n="tox-browse-url",o="icon-browse",r=a.providers,Hl.sketch({dom:{tag:"button",classes:["tox-tbtn",n],innerHtml:Tw(o,r.icons),attributes:{title:r.translate(e.getOr(""))}},action:function(e){ao(e,t)}});var e,t,n,o,r}).toArray()])}]),fieldBehaviours:ki([Tm("url-input-events",[Yr(l,function(o){Em.getCurrent(o).each(function(t){var n=uf.getValue(t);s.each(function(e){e(n).get(function(e){uf.setValue(t,e),uo(o,sS,{name:i.name})})})})})])])})},aT=function(a,t){var e,n,o=a.label.map(function(e){return JS(e,t)}),r=function(n){return function(t,e){mu(e.event().target(),"[data-collection-item-value]").each(function(e){n(t,e,Wn.get(e,"data-collection-item-value"))})}},i=[Yr(Ue(),r(function(e,t){Ji(t)})),Yr(Ke(),r(function(e,t,n){uo(e,dS,{name:a.name,value:n})})),Yr(We(),r(function(e,t,n){du(e.element(),"."+qw).each(function(e){ji.remove(e,qw)}),ji.add(t,qw)})),Yr(Ge(),r(function(e,t,n){du(e.element(),"."+qw).each(function(e){ji.remove(e,qw)})})),ri(r(function(e,t,n){uo(e,dS,{name:a.name,value:n})}))],u=xS.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==a.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:b},behaviours:ki([dh.config({}),uf.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,e){var t,n,r,i;t=o,n=V(e,function(e){var t,n=1===a.columns?e.text.map(function(e){return'<span class="tox-collection__item-label">'+e+"</span>"}).getOr(""):"",o=e.icon.map(function(e){return'<span class="tox-collection__item-icon">'+e+"</span>"}).getOr("");return'<div class="tox-collection__item" tabindex="-1" data-collection-item-value="'+('"'===(t=e.value)?""":t)+'">'+o+n+"</div>"}),r=1<a.columns&&"auto"!==a.columns?E(n,a.columns):[n],i=V(r,function(e){return'<div class="tox-collection__group">'+e.join("")+"</div>"}),Vn(t.element(),i.join("")),"auto"===a.columns&&_k(o,5,"tox-collection__item").each(function(e){var t=e.numRows,n=e.numColumns;ms.setGridSize(o,t,n)}),ao(o,pS)}}),Pm.config({}),ms.config((e=a.columns,n="normal",1===e?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===e?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===n?".tox-swatches__row":".tox-collection__group",cell:"color"===n?"."+Ww:"."+Uw}})),Tm("collection-events",i)])});return YS(o,u,["tox-form__group--collection"])},uT=function(r){return function(t,n,o){return Oe(n,"name").fold(function(){return r(n,o)},function(e){return t.field(e,r(n,o))})}},cT={collection:uT(function(e,t){return aT(e,t.shared.providers)}),alloy:uT(b),alertbanner:uT(function(e,t){return n=e,o=t.shared.providers,Vm.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+n.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:Tw("icon-"+n.icon,o.icons)}},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:n.text}},Hl.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"],innerHtml:Tw("icon-close",o.icons)},action:function(e){uo(e,dS,{name:"alert-banner",value:n.url})}})]});var n,o}),input:uT(function(e,t){return n=e,o=t.shared.providers,$O({name:n.name,multiline:!1,label:n.label,flex:!1,classname:"tox-textfield",validation:P.none()},o);var n,o}),textarea:uT(function(e,t){return n=e,o=t.shared.providers,$O({name:n.name,multiline:!0,label:n.label,flex:n.flex,classname:"tox-textarea",validation:P.none()},o);var n,o}),listbox:uT(function(e,t){return n=e,o=t.shared.providers,r=JS(n.label,o),i=xS.parts().field({factory:YO,dom:{classes:["mce-select-field"]},selectBehaviours:ki([Pm.config({})]),options:n.values,data:n.initialValue.getOr(undefined)}),$S(P.some(r),i);var n,o,r,i}),label:uT(function(e){return{dom:{tag:"label",innerHtml:e.label,classes:["tox-label"]},components:e.items,behaviours:ki([lz(),dh.config({}),xz(P.none()),ms.config({mode:"acyclic"})])}}),iframe:(RO=function(e,t){return Vz(e,t.shared.providers)},function(e,t,n){var o=te(t,{source:"dynamic"});return uT(RO)(e,o,n)}),autocomplete:uT(function(e,t){return r=e,i=t.shared,n=JS(r.label.getOr("?"),i.providers),o=xS.parts().field({factory:XS,dismissOnBlur:!1,inputClasses:["tox-textfield"],minChars:1,fetch:function(e){var t=uf.getValue(e),n=r.getItems(t),o=eC(n,Aw.BUBBLE_TO_SANDBOX,i.providers);return Cb.pure(o)},markers:{openClass:"dog"},lazySink:i.getSink,parts:{menu:Wk(0,0,"normal")}}),$S(P.some(n),o);var r,i,n,o}),button:uT(function(e,t){return n=e,o=t.shared.providers,r=fO(n.name,"custom"),lO(n,r,o,[wz(""),lz()]);var n,o,r}),checkbox:uT(function(e,t){return n=e,o=t.shared.providers,r=uf.config({store:{mode:"manual",getValue:function(e){var t=e.element().dom();return t.indeterminate?"indeterminate":t.checked?"checked":"unchecked"},setValue:function(e,t){var n=e.element().dom();switch(t){case"indeterminate":n.indeterminate=!0;break;case"checked":n.checked=!0,n.indeterminate=!1;break;default:n.checked=!1,n.indeterminate=!1}}}}),i=function(e){return e.element().dom().click(),P.some(!0)},a=xS.parts().field({factory:{sketch:b},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:ki([lz(),Pm.config({}),Wa.config({}),r,ms.config({mode:"special",onEnter:i,onSpace:i}),Tm("checkbox-events",[Yr(qe(),function(e,t){uo(e,sS,{name:n.name})})])])}),u=xS.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:n.label},behaviours:ki([Vl.config({})])}),s=Qd({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[(c=function(e){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+e],innerHtml:Tw("icon-"+("checked"===e?"selected":"unchecked"===e?"unselected":"indeterminate"),o.icons)}}})("checked"),c("unchecked"),c("indeterminate")]}),xS.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[a,s.asSpec(),u]});var n,o,r,i,a,u,c,s}),colorinput:uT(function(e,t){return RC(e,t.shared,t.colorinput)}),colorpicker:uT(function(e){var t=function(e){return"tox-"+e},n=sz(gz,t),r=Qd(n.sketch({dom:{tag:"div",classes:[t("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(e){uo(e,dS,{name:"hex-valid",value:!0})},onInvalidHex:function(e){uo(e,dS,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:ki([uf.config({store:{mode:"manual",getValue:function(e){var t=r.get(e);return Em.getCurrent(t).bind(function(e){return uf.getValue(e).hex}).map(function(e){return"#"+e}).getOr("")},setValue:function(e,t){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(t),o=r.get(e);Em.getCurrent(o).fold(function(){console.log("Can not find form")},function(e){uf.setValue(e,{hex:P.from(n[1]).getOr("")}),ig.getField(e,"hex").each(function(e){ao(e,$e())})})}}}),lz()])}}),dropzone:uT(function(e,t){return kz(e,t.shared.providers)}),grid:uT(function(e,t){return n=e,o=t.shared,{dom:{tag:"div",classes:["tox-form","tox-form--"+n.columns+"col"]},components:V(n.items,o.interpreter)};var n,o}),selectbox:uT(function(e,t){return n=e,o=t.shared.providers,r=n.label.map(function(e){return JS(e,o)}),i=xS.parts().field({dom:{},selectAttributes:{size:n.size},options:n.items,factory:YO,selectBehaviours:ki([Pm.config({}),Tm("selectbox-change",[Yr(qe(),function(e,t){uo(e,sS,{name:n.name})})])])}),a=1<n.size?P.none():P.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:Tw("icon-chevron-down",o.icons)}}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:j([[i],a.toArray()])},xS.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:j([r.toArray(),[u]])});var n,o,r,i,a,u}),sizeinput:uT(function(e,t){return wO(e,t.shared.providers)}),urlinput:uT(function(e,t){return iT(e,t.shared,t.urlinput)}),customeditor:uT(function(t){var n=Ve(P.none()),o=Qd({dom:{tag:t.tag}}),r=Ve(P.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:ki([Tm("editor-foo-events",[ti(function(e){o.getOpt(e).each(function(e){t.init(e.element().dom()).then(function(t){r.get().each(function(e){t.setValue(e)}),r.set(P.none()),n.set(P.some(t))})})})]),uf.config({store:{mode:"manual",getValue:function(){return n.get().fold(function(){return r.get().getOr("")},function(e){return e.getValue()})},setValue:function(e,t){n.get().fold(function(){r.set(P.some(t))},function(e){return e.setValue(t)})}}}),lz()]),components:[o.asSpec()]}}),htmlpanel:uT(function(e){return Vm.sketch({dom:{tag:"div",innerHtml:e.html}})}),imagetools:uT(function(e,t){return XO(e,t.shared.providers)})},sT={field:function(e,t){return t}},lT=function(t,e,n){var o=te(n,{shared:{interpreter:function(e){return fT(t,e,o)}}});return fT(t,e,o)},fT=function(t,n,o){return Oe(cT,n.type).fold(function(){return console.error('Unknown factory type "'+n.type+'", defaulting to container: ',n),n},function(e){return e(t,n,o)})},dT=sl,mT=Xs,gT=ro("toolbar.button.execute"),hT={"alloy.execute":["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},vT=ro("update-menu-text"),pT=function(e,t,o){var r=e.text.map(function(e){return Qd(uO(e,t,o.providers))}),n=function(e,t){var n=uf.getValue(e);return Wa.focus(n),uo(n,"keydown",{raw:t.event().raw()}),P.some(!0)};return Qd(AC.sketch({role:e.role,dom:{tag:"button",classes:[t,t+"--select"].concat(V(e.classes,function(e){return t+"--"+e}))},components:lk([e.icon.map(function(e){return aO(e,o.providers.icons)}),r.map(function(e){return e.asSpec()}),P.some({dom:{tag:"div",classes:[t+"__select-chevron"],innerHtml:Tw("icon-chevron-down",o.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:ki([Vl.config({}),dh.config({}),Tm("menubutton-update-display-text",[ti(e.onAttach),ni(e.onDetach),Yr(vT,function(t,n){r.bind(function(e){return e.getOpt(t)}).each(function(e){dh.set(e,[jg(o.providers.translate(n.event().text()))])})})])]),eventOrder:te(hT,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:ki([ms.config({mode:"special",onLeft:n,onRight:n})]),lazySink:o.getSink,toggleClass:t+"--active",parts:{menu:Wk(0,e.columns,e.presets)},fetch:function(){return Cb.nu(e.fetch)}})).asSpec()},bT=function(e,t,n){var o={type:"formatter",isSelected:t(e.format),getStylePreview:n(e.format)};return te(e,o)},yT=function(s,e,l,f){var d=function(e){return V(e,function(e){var t,n,o,r,i,a,u=ae(e);if(Ee(e,"items")){var c=d(e.items);return te((i=e,a={type:"submenu",isSelected:U(!1),getStylePreview:function(){return P.none()}},te(i,a)),{getStyleItems:function(){return c}})}return Ee(e,"format")?bT(e,l,f):1===u.length&&M(u,"title")?te(e,{type:"separator"}):(n=ro((t=e).title),o={type:"formatter",format:n,isSelected:l(n),getStylePreview:f(n)},r=te(t,o),s.formatter.register(n,r),r)})};return d(e)},xT=function(e,t,n,o){var r,i,a,u,c,s,l="basic"===n.type?function(){return V(n.data,function(e){return bT(e,o.isSelectedFor,o.getPreviewFor)})}:n.getData;return{items:(r=e,i=t,a=o,u=function(t,n,e){var o=i.shared.providers.translate(t.title);return"separator"===t.type?{type:"separator",text:o}:"submenu"===t.type?{type:"menuitem",text:o,disabled:e,getSubmenuItems:function(){return W(t.getStyleItems(),function(e){return c(e,n)})}}:t.getStylePreview().fold(function(){return{type:"togglemenuitem",text:o,active:t.isSelected(),disabled:!1,onAction:a.onAction(t)}},function(e){return{type:"styleitem",item:{type:"togglemenuitem",text:o,disabled:!1,active:t.isSelected(),onAction:a.onAction(t),meta:e}}})},c=function(e,t){var n="formatter"===e.type&&!r.formatter.canApply(e.format);return 0===t?n?[]:[u(e,t,!1)]:[u(e,t,n)]},s=function(e){return W(e,function(e){return c(e,1)})},{validateItems:s,getFetch:function(o,r){return function(e){var t=r(),n=s(t);e(eC(n,Aw.CLOSE_ON_EXECUTE,o.shared.providers))}}}),getStyleItems:l}},wT=function(n,e,t,o){var r=xT(n,e,t,o),i=r.items,a=r.getStyleItems;return pT({text:P.some(""),icon:P.none(),role:"button",fetch:i.getFetch(e,a),onAttach:o.nodeChangeHandler.map(function(t){return function(e){return n.on("nodeChange",t(e))}}).getOr(function(){}),onDetach:o.nodeChangeHandler.map(function(t){return function(e){return n.off("nodeChange",t(e))}}).getOr(function(){}),columns:1,presets:"normal",classes:["bespoke"]},"tox-tbtn",e.shared)},kT=function(n,e,t){var o=t.parents,r=e();return Be(o,function(t){return F(r,function(e){return n.formatter.matchNode(t,e.format)})}).orThunk(function(){return n.formatter.match("p")?P.some({title:"Paragraph",format:"p"}):P.none()})};(IO=FO||(FO={}))[IO.SemiColon=0]="SemiColon",IO[IO.Space=1]="Space";var ST,CT,zT,OT,TT,MT,HT=function(e,t,n,o){var r,i,a=Oe(e.settings,t).getOr(n);return{type:"basic",data:(i=a,r=o===FO.SemiColon?i.replace(/;$/,"").split(";"):i.split(" "),V(r,function(e){var t=e,n=e,o=e.split("=");return 1<o.length&&(t=o[0],n=o[1]),{title:t,format:n}}))}},ET=function(n){var e=P.some(function(t){return function(e){kT(n,function(){return o.data},e).map(function(e){return e.title}).each(function(e){uo(t,vT,{text:e})})}}),o=HT(n,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",FO.SemiColon);return{isSelectedFor:function(e){return function(){return n.formatter.match(e)}},getPreviewFor:function(t){return function(){var e=n.formatter.get(t);return P.some({tag:0<e.length&&(e[0].inline||e[0].block)||"div",styleAttr:n.formatter.getCssText(t)})}},onAction:function(e){return function(){n.undoManager.transact(function(){n.focus(),n.formatter.match(e.format)?n.formatter.remove(e.format):n.formatter.apply(e.format)})}},nodeChangeHandler:e,dataset:o}},VT=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strike-through",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}]}],AT=function(e){return V(e,function(e){return n=e,Object.prototype.hasOwnProperty.call(n,"items")?{title:e.title,items:AT(e.items)}:(t=e,Object.prototype.hasOwnProperty.call(t,"block")?{title:e.title,format:e.block}:e);var t,n})},BT=function(e){return(t=e,Oe(t.settings,"style_formats")).map(AT).getOr(VT);var t},DT=function(r){return{isSelectedFor:function(e){return function(){return r.formatter.match(e)}},getPreviewFor:function(t){return function(){var e=r.formatter.get(t);return e!==undefined?P.some({tag:0<e.length&&(e[0].inline||e[0].block)||"div",styleAttr:r.formatter.getCssText(t)}):P.none()}},onAction:function(e){return function(){r.undoManager.transact(function(){r.focus(),r.formatter.match(e.format)?r.formatter.remove(e.format):r.formatter.apply(e.format)})}},nodeChangeHandler:P.some(function(t){var n=function(e){var t=e.items;return t!==undefined&&0<t.length?W(t,n):[{title:e.title,format:e.format}]},o=W(BT(r),n);return function(e){kT(r,function(){return o},e).map(function(e){return e.title}).each(function(e){uo(t,vT,{text:e})})}})}},RT=function(r){var o=function(){var n=function(e){return e?e.split(",")[0]:""},e=r.queryCommandValue("FontName"),t=i.data,o=e?e.toLowerCase():"";return F(t,function(e){var t=e.format;return t.toLowerCase()===o||n(t).toLowerCase()===n(o).toLowerCase()})},e=P.some(function(n){return function(){var e=r.queryCommandValue("FontName"),t=o().fold(function(){return e},function(e){return e.title});uo(n,vT,{text:t})}}),i=HT(r,"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",FO.SemiColon);return{isSelectedFor:function(t){return function(){return o().exists(function(e){return e.format===t})}},getPreviewFor:function(e){return function(){return P.some({tag:"div",styleAttr:-1===e.indexOf("dings")?"font-family:"+e:""})}},onAction:function(e){return function(){r.undoManager.transact(function(){r.focus(),r.execCommand("FontName",!1,e.format)})}},nodeChangeHandler:e,dataset:i}},FT=function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,o=t||0,r=Math.pow(10,o),Math.round(n*r)/r+"pt"):e;var n,o,r},IT=function(i){var a=function(){var n=P.none(),o=u.data,r=i.queryCommandValue("FontSize");if(r)for(var e=function(e){var t=FT(r,e);n=F(o,function(e){return e.format===r||e.format===t})},t=3;n.isNone()&&0<=t;t--)e(t);return{matchOpt:n,px:r}},e=P.some(function(r){return function(){var e=a(),t=e.matchOpt,n=e.px,o=t.fold(function(){return n},function(e){return e.title});uo(r,vT,{text:o})}}),u=HT(i,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",FO.Space);return{isSelectedFor:function(t){return function(){return a().matchOpt.exists(function(e){return e.format===t})}},getPreviewFor:function(){return function(){return P.none()}},onAction:function(e){return function(){i.undoManager.transact(function(){i.focus(),i.execCommand("FontSize",!1,e.format)})}},nodeChangeHandler:e,dataset:u}},_T={file:{title:"File",items:"newdocument restoredraft | preview | print"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen"},insert:{title:"Insert",items:"image link media template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code"},table:{title:"Table",items:"inserttable tableprops deletetable row column cell"},help:{title:"Help",items:"help"}},LT=function(e,t,n,o){return pT({text:e.text,icon:e.icon,role:o,fetch:function(t){e.fetch(function(e){t(eC(e,Aw.CLOSE_ON_EXECUTE,n.providers))})},onAttach:function(){},onDetach:function(){},columns:1,presets:"normal",classes:[]},t,n)},NT={formats:function(e,t){var n=t.styleselect,o=xT(e,t,n,DT(e));return{type:"menuitem",text:"Formats",getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}}},blockformats:function(e,t){var n=ET(e),o=xT(e,t,n.dataset,n);return{type:"menuitem",text:"Blocks",getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}}},fontformats:function(e,t){var n=RT(e),o=xT(e,t,n.dataset,n);return{type:"menuitem",text:t.shared.providers.translate("Fonts"),getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}}},fontsizes:function(e,t){var n=IT(e),o=xT(e,t,n.dataset,n);return{type:"menuitem",text:"Font Sizes",getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}}}},PT=function(e){return"string"==typeof e?e.split(" "):e},jT=function(a,u,c){var s=ne(_T,u.menus),t=0<ae(u.menus).length,e=u.menubar===undefined||!0===u.menubar?PT("file edit view insert format tools table"):PT(!1===u.menubar?"":u.menubar),n=B(e,function(e){return t&&u.menus.hasOwnProperty(e)&&u.menus[e].hasOwnProperty("items")||_T.hasOwnProperty(e)}),o=V(n,function(e){var t,n,o,r,i=s[e];return t={title:i.title,items:PT(i.items)},n=u,o=a,r=c,{text:t.title,getItems:function(){return W(t.items,function(e){return 0===e.trim().length?[]:"separator"===e||"|"===e?[{type:"separator"}]:n.menuItems[e]?[n.menuItems[e]]:NT[e]?[NT[e](o,r)]:[]})}}});return B(o,function(e){return 0<e.getItems().length})},UT=Tl({factory:function(o,e){var t={focus:ms.focusIn,setMenus:function(e,t){var n=V(t,function(t){var e={text:P.some(t.text),icon:P.none(),fetch:function(e){e(t.getItems())}};return LT(e,"tox-mbtn",{getSink:o.getSink(),providers:o.providers()},"menuitem")});dh.set(e,n)}};return{uid:o.uid(),dom:o.dom(),components:[],behaviours:ki([dh.config({}),Tm("menubar-events",[ti(function(e){o.onSetup()(e)}),Yr(Ue(),function(n,e){du(n.element(),".tox-mbtn--active").each(function(t){mu(e.event().target(),".tox-mbtn").each(function(e){mn(t,e)||n.getSystem().getByDom(t).each(function(t){n.getSystem().getByDom(e).each(function(e){AC.expand(e),AC.close(t),Wa.focus(e)})})})})}),Yr(Ut(),function(n,e){e.event().prevFocus().bind(function(e){return n.getSystem().getByDom(e).toOption()}).each(function(t){e.event().newFocus().bind(function(e){return n.getSystem().getByDom(e).toOption()}).each(function(e){AC.isOpen(t)&&(AC.expand(e),AC.close(t))})})})]),ms.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return o.onEscape()(e),P.some(!0)}})]),apis:t,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[hr("dom"),hr("uid"),hr("onEscape"),hr("getSink"),hr("providers"),Tr("onSetup",N)],apis:{focus:function(e,t){e.focus(t)},setMenus:function(e,t,n){e.setMenus(t,n)}}}),WT=function(n,t){return xn.offsetParent(n).orThunk(function(){var e=$t.fromTag("span");Cn.before(n,e);var t=xn.offsetParent(e);return Mn.remove(e),t}).map(function(e){return Sy.absolute(e).translate(-t.left(),-t.top())}).getOrThunk(function(){return sf(0,0)})},GT=ge([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),XT=function(t){return function(e){return e.translate(-t.left(),-t.top())}},YT=function(t){return function(e){return e.translate(t.left(),t.top())}},$T=function(n){return function(e,t){return R(n,function(e,t){return t(e)},sf(e,t))}},qT=function(e,t,n){return e.fold($T([YT(n),XT(t)]),$T([XT(t)]),$T([]))},KT=function(e,t,n){return e.fold($T([YT(n)]),$T([]),$T([YT(t)]))},JT=function(e,t,n){return e.fold($T([]),$T([XT(n)]),$T([YT(t),XT(n)]))},QT=function(e,t,n){return e.fold(function(e,t){return{position:"absolute",left:e+"px",top:t+"px"}},function(e,t){return{position:"absolute",left:e-n.left()+"px",top:t-n.top()+"px"}},function(e,t){return{position:"fixed",left:e+"px",top:t+"px"}})},ZT=GT.offset,eM=GT.absolute,tM=GT.fixed,nM=function(e,t){ji.add(e.element(),t.transitionClass()),ji.remove(e.element(),t.fadeOutClass()),ji.add(e.element(),t.fadeInClass())},oM=function(e,t){ji.add(e.element(),t.transitionClass()),ji.remove(e.element(),t.fadeInClass()),ji.add(e.element(),t.fadeOutClass())},rM=function(e,t){return e.y()>=t.y()&&e.bottom()<=t.bottom()},iM=function(e,t){return Wn.has(e,t)?P.some(parseInt(Wn.get(e,t),10)):P.none()},aM=function(o,r,i){return(a=o,e=r,t=a.element(),iM(t,e.leftAttr()).bind(function(o){return iM(t,e.topAttr()).map(function(e){var t=xf(a.element()),n=eu(a.element());return Ly(o,e,t,n)})})).bind(function(e){return rM(e,i)?(t=r,n=o.element(),Wn.remove(n,t.leftAttr()),Wn.remove(n,t.topAttr()),P.some(eM(e.x(),e.y()))):P.none();var t,n});var a,e,t},uM=function(e,t,n,o,r){var i=Sy.absolute(e.element()),a=Ly(i.left(),i.top(),xf(e.element()),eu(e.element()));if(rM(a,n))return P.none();u=e,c=t,s=i.left(),l=i.top(),f=u.element(),Wn.set(f,c.leftAttr(),s),Wn.set(f,c.topAttr(),l);var u,c,s,l,f,d=eM(i.left(),i.top()),m=qT(d,o,r),g=eM(n.x(),n.y()),h=qT(g,o,r),v=a.y()<=n.y()?h.top():h.top()+n.height()-a.height();return P.some(tM(m.left(),v))},cM=function(i,e,t){var a=e.lazyViewport()(i);e.contextual().each(function(r){r.lazyContext()(i).each(function(e){var t,n,o=Ny(e);n=a,((t=o).y()<n.bottom()&&t.bottom()>n.y()?nM:oM)(i,r)})});var n,o,r,u,c,s=xn.owner(i.element()),l=zy(s),f=WT(i.element(),l);(n=i,o=e,r=a,u=l,c=f,Ja.getRaw(n.element(),"position").is("fixed")?aM(n,o,r):uM(n,o,r,u,c)).each(function(e){var t=QT(e,0,f);Ja.setAll(i.element(),t)})},sM=Object.freeze({refresh:cM}),lM=Object.freeze({events:function(o,e){return Wr([Yr(Je(),function(t,n){o.contextual().each(function(e){mn(t.element(),n.event().target())&&(ji.remove(t.element(),e.transitionClass()),n.stop())})}),Yr(Lt(),function(e,t){cM(e,o)})])}}),fM=[zr("contextual",[hr("fadeInClass"),hr("fadeOutClass"),hr("transitionClass"),hr("lazyContext")]),Tr("lazyViewport",function(e){var t=zy();return Ly(t.left(),t.top(),window.innerWidth,window.innerHeight)}),hr("leftAttr"),hr("topAttr")],dM=Ci({fields:fM,name:"docking",active:lM,apis:sM}),mM="data-initial-z-index",gM=function(e,t){var n;e.getSystem().addToGui(t),n=t,xn.parent(n.element()).each(function(t){Ja.getRaw(t,"z-index").each(function(e){Wn.set(t,mM,e)}),Ja.set(t,"z-index",Ja.get(n.element(),"z-index"))})},hM=function(e){var t;t=e,xn.parent(t.element()).each(function(e){var t=Wn.get(e,mM);Wn.has(e,mM)?Ja.set(e,"z-index",t):Ja.remove(e,"z-index"),Wn.remove(e,mM)}),e.getSystem().removeFromGui(e)},vM=function(e,t,n,o){return(r=e,i=t,a=r.element(),u=parseInt(Wn.get(a,i.leftAttr()),10),c=parseInt(Wn.get(a,i.topAttr()),10),isNaN(u)||isNaN(c)?P.none():P.some(sf(u,c))).fold(function(){return n},function(e){return tM(e.left()+o.left(),e.top()+o.top())});var r,i,a,u,c},pM=function(e,t,n,o,r,i){var a,u,c,s=vM(e,t,n,o),l=yM(e,t,s,r,i),f=qT(s,r,i);return a=t,u=f,c=e.element(),Wn.set(c,a.leftAttr(),u.left()+"px"),Wn.set(c,a.topAttr(),u.top()+"px"),l.fold(function(){return{coord:tM(f.left(),f.top()),extra:P.none()}},function(e){return{coord:e.output(),extra:e.extra()}})},bM=function(e,t){var n,o;n=t,o=e.element(),Wn.remove(o,n.leftAttr()),Wn.remove(o,n.topAttr())},yM=function(e,t,h,v,p){var n=t.getSnapPoints()(e);return Be(n,function(e){var t,n,o,r,i,a,u,c,s,l,f,d,m,g=e.sensor();return t=h,n=g,o=e.range().left(),r=e.range().top(),u=KT(t,i=v,a=p),c=KT(n,i,a),Math.abs(u.left()-c.left())<=o&&Math.abs(u.top()-c.top())<=r?P.some({output:U((s=e.output(),l=h,f=v,d=p,m=function(o,r){return function(e,t){var n=o(l,f,d);return r(e.getOr(n.left()),t.getOr(n.top()))}},s.fold(m(JT,GT.offset),m(KT,GT.absolute),m(qT,GT.fixed)))),extra:e.extra}):P.none()})},xM=function(n,e,i,a,u,c){return e.fold(function(){var e,n,o,t=(e=i,n=c.left(),o=c.top(),e.fold(function(e,t){return GT.offset(e+n,t+o)},function(e,t){return GT.absolute(e+n,t+o)},function(e,t){return GT.fixed(e+n,t+o)})),r=qT(t,a,u);return tM(r.left(),r.top())},function(t){var e=pM(n,t,i,c,a,u);return e.extra.each(function(e){t.onSensor()(n,e)}),e.coord})},wM=function(e,t,n){var o,r=t.getTarget()(e.element());if(t.repositionTarget()){var i=xn.owner(e.element()),a=zy(i),u=WT(r,a),c=(o=r,Ja.getRaw(o,"left").bind(function(n){return Ja.getRaw(o,"top").bind(function(t){return Ja.getRaw(o,"position").map(function(e){return("fixed"===e?tM:ZT)(parseInt(n,10),parseInt(t,10))})})}).getOrThunk(function(){var e=Sy.absolute(o);return eM(e.left(),e.top())})),s=xM(e,t.snaps(),c,a,u,n),l=QT(s,0,u);Ja.setAll(r,l)}t.onDrag()(e,r,n)},kM=zr("snaps",[hr("getSnapPoints"),ma("onSensor"),hr("leftAttr"),hr("topAttr"),Tr("lazyViewport",function(){var e=zy();return{x:e.left,y:e.top,width:U(window.innerWidth),height:U(window.innerHeight),bottom:U(e.top()+window.innerHeight),right:U(e.left()+window.innerWidth)}})]),SM=Object.freeze({getData:function(e){return P.from(sf(e.x(),e.y()))},getDelta:function(e,t){return sf(t.left()-e.left(),t.top()-e.top())}}),CM=[Tr("useFixed",!1),hr("blockerClass"),Tr("getTarget",b),Tr("onDrag",N),Tr("repositionTarget",!0),ma("onDrop"),kM,pa("dragger",{handlers:function(u,c){return Wr([Yr(Le(),function(t,e){if(0===e.event().raw().button){e.stop();var n,o={drop:function(){i()},delayDrop:function(){a.schedule()},forceDrop:function(){i()},move:function(e){a.cancel(),c.update(SM,e).each(function(e){wM(t,u,e)})}},r=t.getSystem().build(Vm.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[u.blockerClass()]},events:(n=o,Wr([Yr(Le(),n.forceDrop),Yr(je(),n.drop),Yr(Ne(),function(e,t){n.move(t.event())}),Yr(Pe(),n.delayDrop)]))})),i=function(){hM(r),u.snaps().each(function(e){bM(t,e)});var e=u.getTarget()(t.element());u.onDrop()(t,e)},a=nv(i,200);c.reset(),gM(t,r)}})])}})],zM=Object.freeze({getData:function(e){var t,n=e.raw().touches;return 1===n.length?(t=n[0],P.some(sf(t.clientX,t.clientY))):P.none()},getDelta:function(e,t){return sf(t.left()-e.left(),t.top()-e.top())}}),OM=CM,TM=[Tr("useFixed",!1),Tr("getTarget",b),Tr("onDrag",N),Tr("repositionTarget",!0),Tr("onDrop",N),kM,pa("dragger",{handlers:function(o,r){return Wr([Zr(Re()),Yr(Fe(),function(t,e){e.stop(),r.update(zM,e.event()).each(function(e){wM(t,o,e)})}),Yr(Ie(),function(t,e){o.snaps().each(function(e){bM(t,e)});var n=o.getTarget()(t.element());r.reset(),o.onDrop()(t,n)})])}})],MM=Object.freeze({mouse:OM,touch:TM}),HM=Object.freeze({init:function(){var i=P.none(),e=U({});return wi({readState:e,reset:function(){i=P.none()},update:function(r,e){return r.getData(e).bind(function(e){return t=r,n=e,o=i.map(function(e){return t.getDelta(e,n)}),i=P.some(n),o;var t,n,o})}})}}),EM=Oi({branchKey:"mode",branches:MM,name:"dragging",active:{events:function(e,t){return e.dragger().handlers(e,t)}},extra:{snap:tn(["sensor","range","output"],["extra"])},state:HM}),VM={getData:function(e){var t=e.raw().touches;if(t.length<2)return P.none();var n=Math.abs(t[0].clientX-t[1].clientX),o=Math.abs(t[0].clientY-t[1].clientY),r=Math.sqrt(Math.pow(n,2)+Math.pow(o,2));return P.some({deltaX:U(n),deltaY:U(o),deltaDistance:U(r)})},getDelta:function(e,t){var n=t.deltaX()-e.deltaX(),o=t.deltaY()-e.deltaY(),r=t.deltaDistance()-e.deltaDistance();return{deltaX:U(n),deltaY:U(o),deltaDistance:U(r)}}},AM=Object.freeze({events:function(i,t){return Wr([Xr(_e()),Yr(Fe(),function(r,e){e.stop(),t.update(VM,e.event()).each(function(e){var t=0<e.deltaDistance()?1:-1,n=t*Math.abs(e.deltaX()),o=t*Math.abs(e.deltaY());(1===t?i.onPunch():i.onPinch())(r.element(),n,o)})}),Yr(Ie(),t.reset)])}}),BM=[hr("onPinch"),hr("onPunch")],DM=(Ci({fields:BM,name:"pinching",active:AM,state:HM}),Object.freeze({getState:function(e,t,n){return n}})),RM=Object.freeze({events:function(r,i){var o=function(n,o){r.updateState().each(function(e){var t=e(n,o);i.set(t)}),r.renderComponents().each(function(e){var t=e(o,i.get());ko(n),A(t,function(e){bo(n,n.getSystem().build(e))})})};return Wr([Yr(Et(),function(e,t){var n=r.channel();M(t.channels(),n)&&o(e,t.data())}),ti(function(t,e){r.initialData().each(function(e){o(t,e)})})])}}),FM=Object.freeze({init:function(e){var t=Ve(P.none());return{readState:function(){return t.get().getOr("none")},get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(P.none())}}}}),IM=[hr("channel"),kr("renderComponents"),kr("updateState"),kr("initialData")],_M=Ci({fields:IM,name:"reflecting",active:RM,apis:DM,state:FM}),LM=[hr("lazySink"),hr("tooltipDom"),Tr("exclusive",!0),Tr("tooltipComponents",[]),Tr("delay",300)],NM=Object.freeze({init:function(){var n=Ve(P.none()),t=Ve(P.none()),o=function(){n.get().each(function(e){clearTimeout(e)})},e=U("not-implemented");return wi({getTooltip:function(){return t.get()},isShowing:function(){return t.get().isSome()},setTooltip:function(e){t.set(P.some(e))},clearTooltip:function(){t.set(P.none())},clearTimer:o,resetTimer:function(e,t){o(),n.set(P.some(setTimeout(function(){e()},t)))},readState:e})}}),PM=ro("tooltip.exclusive"),jM=ro("tooltip.show"),UM=ro("tooltip.hide"),WM=function(e,t,n){e.getSystem().broadcastOn([PM],{})},GM=Object.freeze({hideAllExclusive:WM}),XM=Object.freeze({events:function(o,r){var n=function(){r.getTooltip().each(function(e){wo(e),r.clearTooltip()}),r.clearTimer()};return Wr([Yr(Et(),function(e,t){M(t.channels(),PM)&&n()}),Yr(We(),function(e){ao(e,jM)}),Yr(Ht(),function(e){ao(e,UM)}),Yr(jM,function(e){r.resetTimer(function(){!function(t){if(!r.isShowing()){WM(t);var e=o.lazySink()(t).getOrDie(),n=t.getSystem().build({dom:o.tooltipDom(),components:o.tooltipComponents(),events:Wr([Yr(Ue(),function(e){ao(t,jM)}),Yr(Pe(),function(e){ao(t,UM)})])});r.setTooltip(n),bo(e,n),cw.position(e,{anchor:"hotspot",hotspot:t,layouts:{onLtr:U([kx,wx,px,yx,bx,xx]),onRtl:U([kx,wx,px,yx,bx,xx])}},n)}}(e)},o.delay())}),Yr(UM,function(e){r.resetTimer(function(){n()},o.delay())}),Yr(Ue(),function(e){ao(e,jM)}),Yr(Pe(),function(e){ao(e,UM)}),ni(function(e){n()})])}}),YM=(Ci({fields:LM,name:"tooltipping",active:XM,state:NM,apis:GM}),ro("dom-data"),Uo([hr("root"),xr("dispatchers",[hr("getTarget"),hr("alloyConfig")]),Tr("insertion",function(e,t){Cn.append(e,t.element())})]),U([fa(["closedClass","openClass","shrinkingClass","growingClass","expandedClass","collapsedClass"]),ma("onShrunk"),ma("onGrown"),gs("expandableBehaviours",[uf])])),$M=U([Ps({schema:[hr("dom")],name:"minimal"}),Ps({schema:[hr("dom")],name:"extra",overrides:function(o){return{behaviours:ki([Kp.config({dimension:{property:"height"},closedClass:o.markers().closedClass(),openClass:o.markers().openClass(),shrinkingClass:o.markers().shrinkingClass(),growingClass:o.markers().growingClass(),expanded:!0,onStartShrink:function(n){ea(n.element()).each(function(e){var t=n.getSystem().getByUid(o.uid()).getOrDie();ms.focusIn(t)}),n.getSystem().getByUid(o.uid()).each(function(e){ji.remove(e.element(),o.markers().expandedClass()),ji.add(e.element(),o.markers().collapsedClass())})},onStartGrow:function(e){e.getSystem().getByUid(o.uid()).each(function(e){ji.add(e.element(),o.markers().expandedClass()),ji.remove(e.element(),o.markers().collapsedClass())})},onShrunk:function(e){o.onShrunk()(e)},onGrown:function(e){o.onGrown()(e)},getAnimationRoot:function(e){return e.getSystem().getByUid(o.uid()).getOrDie().element()}})])}}}),Ps({factory:Hl,schema:[hr("dom")],name:"expander",overrides:function(e){return{action:(t=e,n=Kp.toggleGrow,function(e){tl(e,t,"extra").each(n)})};var t,n}}),Ps({schema:[hr("dom")],name:"controls"})]),qM=function(t,n){return function(e){tl(e,t,"extra").each(n)}},KM=(Ml({name:"ExpandableForm",configFields:YM(),partFields:$M(),factory:function(n,e,t,o){var r=function(e){return al(e,n,["minimal","extra"])};return{uid:n.uid(),dom:n.dom(),components:e,behaviours:te(ki([uf.config({store:{mode:"manual",getValue:function(e){var t=r(e),n=uf.getValue(t.minimal()),o=uf.getValue(t.extra());return te(n,o)},setValue:function(e,t){var n=r(e);uf.setValue(n.minimal(),t),uf.setValue(n.extra(),t)}}})]),hs(n.expandableBehaviours())),apis:{toggleForm:qM(n,Kp.toggleGrow),collapseForm:qM(n,Kp.shrink),collapseFormImmediately:qM(n,Kp.immediateShrink),expandForm:qM(n,Kp.grow),getField:function(e,t){return tl(e,n,"minimal").bind(function(e){return ig.getField(e,t)}).orThunk(function(){return tl(e,n,"extra").bind(function(e){return ig.getField(e,t)})})}}}},apis:{getField:function(e,t,n){return e.getField(t,n)},toggleForm:function(e,t){e.toggleForm(t)},collapseForm:function(e,t){e.collapseForm(t)},collapseFormImmediately:function(e,t){e.collapseFormImmediately(t)},expandForm:function(e,t){e.expandForm(t)}}}),U([hr("choices"),gs("chooserBehaviours",[ms,Fu,Em,uf]),fa(["choiceClass","selectedClass"])])),JM=U([Ps({name:"legend",defaults:function(e){return{dom:{tag:"legend"}}}}),Ws({factory:{sketch:function(e){return Se(e,["value"])}},name:"choices",unit:"choice",overrides:function(e,t){return{dom:{attributes:{role:"radio"}},behaviours:ki([uf.config({store:{mode:"memory",initialValue:t.value}}),Wa.config({})]),domModification:{classes:[e.markers().choiceClass()]},events:La(P.none())}}})]),QM=(Ml({name:"FormChooser",configFields:KM(),partFields:JM(),factory:function(a,e,t,n){return{uid:a.uid(),dom:a.dom(),components:e,behaviours:te(ki([ms.config({mode:"flow",selector:"."+a.markers().choiceClass(),executeOnMove:!0,getInitial:function(e){return Fu.getHighlighted(e).map(function(e){return e.element()})},execute:function(t,e,n){return t.getSystem().getByDom(n).map(function(e){return Fu.highlight(t,e),!0}).toOption().map(function(e){return!0})}}),Fu.config({itemClass:a.markers().choiceClass(),highlightClass:a.markers().selectedClass(),onHighlight:function(e,t){Wn.set(t.element(),"aria-checked","true")},onDehighlight:function(e,t){Wn.set(t.element(),"aria-checked","false")}}),Em.config({find:P.some}),uf.config({store:{mode:"manual",setValue:function(t,e){var n,o,r,i;(n=t,o=e,r=cu(n.element(),"."+a.markers().choiceClass()),i=V(r,function(e){return n.getSystem().getByDom(e).getOrDie()}),F(i,function(e){return uf.getValue(e)===o})).each(function(e){Fu.highlight(t,e)})},getValue:function(e){return Fu.getHighlighted(e).map(uf.getValue)}}})]),hs(a.chooserBehaviours())),events:Wr([Jr(Vt(),Fu.highlight),ti(Fu.highlightFirst)])}}}),function(e,t){var n=P.from(Wn.get(e,"id")).fold(function(){var e=ro("dialog-label");return Wn.set(t,"id",e),e},b);Wn.set(e,"aria-labelledby",n)}),ZM=U([hr("lazySink"),kr("dragBlockClass"),Tr("useTabstopAt",U(!0)),Tr("eventOrder",{}),gs("modalBehaviours",[ms]),ga("onExecute"),va("onEscape")]),eH={sketch:b},tH=U([Us({name:"draghandle",overrides:function(e,t){return{behaviours:ki([EM.config({mode:"mouse",getTarget:function(e){return fu(e,'[role="dialog"]').getOr(e)},blockerClass:e.dragBlockClass().getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+Ro(t,null,2)).message)})])}}}),Ps({schema:[hr("dom")],name:"title"}),Ps({factory:eH,schema:[hr("dom")],name:"close"}),Ps({factory:eH,schema:[hr("dom")],name:"body"}),Ps({factory:eH,schema:[hr("dom")],name:"footer"}),js({factory:{sketch:function(e,t){return ne(e,{dom:t.dom(),components:t.components()})}},schema:[Tr("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Tr("components",[])],name:"blocker"})]),nH=undefined&&undefined.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},oH=Ml({name:"ModalDialog",configFields:ZM(),partFields:tH(),factory:function(o,e,t,r){var u=ro("alloy.dialog.busy"),c=ro("alloy.dialog.idle"),s=ki([ms.config({mode:"special",focusIn:P.some,onTab:function(){return P.some(!0)},onShiftTab:function(){return P.some(!0)}}),Wa.config({})]),n=ro("modal-events"),i=nH({},o.eventOrder(),{"alloy.system.attached":[n].concat(o.eventOrder()["alloy.system.attached"]||[])});return{uid:o.uid(),dom:te({attributes:{role:"dialog"}},o.dom()),components:e,apis:{show:function(i){var e=o.lazySink()().getOrDie(),a=Ve(P.none()),t=r.blocker(),n=e.getSystem().build(te(t,{components:t.components.concat([Gg(i)]),behaviours:ki([Tm("dialog-blocker-events",[Yr(c,function(e,t){Wn.has(i.element(),"aria-busy")&&(Wn.remove(i.element(),"aria-busy"),a.get().each(function(e){return dh.remove(i,e)}))}),Yr(u,function(e,t){Wn.set(i.element(),"aria-busy","true");var n=t.event().getBusySpec();a.get().each(function(e){dh.remove(i,e)});var o=n(i,s),r=e.getSystem().build(o);a.set(P.some(r)),dh.append(i,Gg(r)),r.hasConfigured(ms)&&ms.focusIn(r)})])])}));bo(e,n),ms.focusIn(i)},hide:function(t){xn.parent(t.element()).each(function(e){t.getSystem().getByDom(e).each(function(e){wo(e)})})},getBody:function(e){return nl(e,o,"body")},getFooter:function(e){return nl(e,o,"footer")},setIdle:function(e){ao(e,c)},setBusy:function(e,t){uo(e,u,{getBusySpec:t})}},eventOrder:i,behaviours:te(ki([dh.config({}),ms.config({mode:"cyclic",onEnter:o.onExecute(),onEscape:o.onEscape(),useTabstopAt:o.useTabstopAt()}),Tm(n,[ti(function(e){QM(e.element(),nl(e,o,"title").element())})])]),hs(o.modalBehaviours()))}},apis:{show:function(e,t){e.show(t)},hide:function(e,t){e.hide(t)},getBody:function(e,t){return e.getBody(t)},getFooter:function(e,t){return e.getFooter(t)},setBusy:function(e,t,n){e.setBusy(t,n)},setIdle:function(e,t){e.setIdle(t)}}}),rH=U([hr("toggleClass"),hr("fetch"),ha("onExecute"),Tr("getHotspot",P.some),Tr("layouts",P.none()),ha("onItemExecute"),kr("lazySink"),hr("dom"),ma("onOpen"),gs("splitDropdownBehaviours",[CS,ms,Wa]),Tr("matchWidth",!1),Tr("useMinWidth",!1)].concat(US())),iH=Ps({factory:Hl,schema:[hr("dom")],name:"arrow",defaults:function(e){return{dom:{attributes:{role:"button","aria-haspopup":!0}},buttonBehaviours:ki([Wa.revoke()])}},overrides:function(t){return{action:function(e){e.getSystem().getByUid(t.uid()).each(co)},buttonBehaviours:ki([Ba.config({toggleOnExecute:!1,toggleClass:t.toggleClass(),aria:{mode:"pressed"}})])}}}),aH=Ps({factory:Hl,schema:[hr("dom")],name:"button",defaults:function(e){return{dom:{attributes:{role:"button"}},buttonBehaviours:ki([Wa.revoke()])}},overrides:function(n){return{action:function(t){t.getSystem().getByUid(n.uid()).each(function(e){n.onExecute()(e,t)})}}}}),uH=U([iH,aH,js({schema:[la()],name:"menu",defaults:function(o){return{onExecute:function(t,n){t.getSystem().getByUid(o.uid()).each(function(e){o.onItemExecute()(e,t,n)})}}}}),VS()]),cH=Ml({name:"SplitDropdown",configFields:rH(),partFields:uH(),factory:function(n,e,t,o){var r=function(e){Em.getCurrent(e).each(function(e){Fu.highlightFirst(e),ms.focusIn(e)})},i=function(e){RS(n,function(e){return e},e,o,r,$k.HighlightFirst).get(N)},a=function(e){var t=nl(e,n,"button");return co(t),P.some(!0)},u=La(P.some(i));return te({uid:n.uid(),dom:n.dom(),components:e,eventOrder:{"alloy.execute":["toggling","alloy.base.behaviour"]},events:u,behaviours:te(ki([CS.config({others:{sandbox:function(e){var t=nl(e,n,"arrow");return IS(n,e,{onOpen:function(){Ba.on(t)},onClose:function(){Ba.off(t)}})}}}),ms.config({mode:"special",onSpace:a,onEnter:a,onDown:function(e){return i(e),P.some(!0)}}),Wa.config({})]),hs(n.splitDropdownBehaviours()))},{dom:{attributes:{role:"presentation"}}})}}),sH=qt("within","extra","withinWidth"),lH=function(e,t,o){var n,r=(n=function(e,t){var n=o(e);return P.some({element:U(e),start:U(t),finish:U(t+n),width:U(n)})},R(e,function(t,e){return n(e,t.len).fold(U(t),function(e){return{len:e.finish(),list:t.list.concat([e])}})},{len:0,list:[]}).list),i=B(r,function(e){return e.finish()<=t}),a=D(i,function(e,t){return e+t.width()},0),u=r.slice(i.length);return{within:U(i),extra:U(u),withinWidth:U(a)}},fH=function(e){return V(e,function(e){return e.element()})},dH=function(e,t,n,o){var r,i,a,u,c,s,l,f,d,m,g,h,v=(r=e,i=t,a=n,u=lH(i,r,a),0===u.extra().length?P.some(u):P.none()).getOrThunk(function(){return lH(t,e-n(o),n)}),p=v.within(),b=v.extra(),y=v.withinWidth();return 1===b.length&&b[0].width()<=n(o)?(m=b,g=y,h=fH(p.concat(m)),sH(h,[],g)):1<=b.length?(s=b,l=o,f=y,d=fH(p).concat([l]),sH(d,fH(s),f)):(c=y,sH(fH(p),[],c))},mH=U([fa(["closedClass","openClass","shrinkingClass","growingClass"]),gs("splitToolbarBehaviours",[]),Dr("builtGroups",function(){return Ve([])})]),gH=[hr("dom")],hH=U([Ps({factory:wp,schema:gH,name:"primary"}),Ps({factory:wp,schema:gH,name:"overflow",overrides:function(e){return{toolbarBehaviours:ki([Kp.config({dimension:{property:"height"},closedClass:e.markers().closedClass(),openClass:e.markers().openClass(),shrinkingClass:e.markers().shrinkingClass(),growingClass:e.markers().growingClass()})])}}}),js({name:"overflow-button"}),js({name:"overflow-group"})]),vH=function(e,t){var n=V(t,function(e){return Gg(e)});wp.setGroups(e,n)},pH=function(e,t,n){var o=al(e,t,["primary","overflow"]),r=o.primary(),i=o.overflow();Ja.set(r.element(),"visibility","hidden"),wp.setGroups(i,[]);var a=t.builtGroups().get(),u=Cp.sketch(te(n["overflow-group"](),{items:[Hl.sketch(te(n["overflow-button"](),{action:function(e){Kp.toggleGrow(o.overflow())}}))]})),c=e.getSystem().build(u);vH(r,a.concat([c]));var s=xf(r.element()),l=dH(s,a,function(e){return xf(e.element())},c);0===l.extra().length?(dh.remove(r,c),wp.setGroups(i,[])):(vH(r,l.within()),vH(i,l.extra())),Ja.remove(r.element(),"visibility"),Ja.reflow(r.element())},bH=(Ml({name:"SplitToolbar",configFields:mH(),partFields:hH(),factory:function(o,e,t,r){return te({dom:{attributes:{role:"group"}}},{uid:o.uid(),dom:o.dom(),components:e,behaviours:hs(o.splitToolbarBehaviours()),apis:{setGroups:function(e,t){var n;n=V(t,e.getSystem().build),o.builtGroups().set(n),pH(e,o,r)},refresh:function(e){pH(e,o,r)}}})},apis:{setGroups:function(e,t,n){e.setGroups(t,n)},refresh:function(e,t){e.refresh(t)}}}),Tl({name:"TabButton",configFields:[Tr("uid",undefined),hr("value"),Ko("dom","dom",Vo(function(e){return{attributes:{role:"tab",id:ro("aria"),"aria-selected":"false"}}}),sr()),kr("action"),Tr("domModification",{}),gs("tabButtonBehaviours",[Wa,ms,uf]),hr("view")],factory:function(e,t){return{uid:e.uid(),dom:e.dom(),components:e.components(),events:La(e.action()),behaviours:te(ki([Wa.config({}),ms.config({mode:"execution",useSpace:!0,useEnter:!0}),uf.config({store:{mode:"memory",initialValue:e.value()}})]),hs(e.tabButtonBehaviours())),domModification:e.domModification()}}})),yH=U([hr("tabs"),hr("dom"),Tr("clickToDismiss",!1),gs("tabbarBehaviours",[Fu,ms]),fa(["tabClass","selectedClass"])]),xH=Ws({factory:bH,name:"tabs",unit:"tab",overrides:function(o,e){var r=function(e,t){Fu.dehighlight(e,t),uo(e,Xt(),{tabbar:e,button:t})},i=function(e,t){Fu.highlight(e,t),uo(e,Gt(),{tabbar:e,button:t})};return{action:function(e){var t=e.getSystem().getByUid(o.uid()).getOrDie(),n=Fu.isHighlighted(t,e);(n&&o.clickToDismiss()?r:n?N:i)(t,e)},domModification:{classes:[o.markers().tabClass()]}}}}),wH=U([xH]),kH=Ml({name:"Tabbar",configFields:yH(),partFields:wH(),factory:function(e,t,n,o){return{uid:e.uid(),dom:te({tag:"div",attributes:{role:"tablist"}},e.dom()),components:t,"debug.sketcher":"Tabbar",behaviours:te(ki([Fu.config({highlightClass:e.markers().selectedClass(),itemClass:e.markers().tabClass(),onHighlight:function(e,t){Wn.set(t.element(),"aria-selected","true")},onDehighlight:function(e,t){Wn.set(t.element(),"aria-selected","false")}}),ms.config({mode:"flow",getInitial:function(e){return Fu.getHighlighted(e).map(function(e){return e.element()})},selector:"."+e.markers().tabClass(),executeOnMove:!0})]),hs(e.tabbarBehaviours()))}}}),SH=Tl({name:"Tabview",configFields:[gs("tabviewBehaviours",[dh])],factory:function(e,t){return{uid:e.uid(),dom:te({tag:"div",attributes:{role:"tabpanel"}},e.dom()),behaviours:te(ki([dh.config({})]),hs(e.tabviewBehaviours()))}}}),CH=U([Tr("selectFirst",!0),ma("onChangeTab"),ma("onDismissTab"),Tr("tabs",[]),gs("tabSectionBehaviours",[])]),zH=Ps({factory:kH,schema:[hr("dom"),yr("markers",[hr("tabClass"),hr("selectedClass")])],name:"tabbar",defaults:function(e){return{tabs:e.tabs()}}}),OH=Ps({factory:SH,name:"tabview"}),TH=U([zH,OH]),MH=Ml({name:"TabSection",configFields:CH(),partFields:TH(),factory:function(i,e,t,n){var o=function(e,t){tl(e,i,"tabbar").each(function(e){t(e).each(co)})};return{uid:i.uid(),dom:i.dom(),components:e,behaviours:hs(i.tabSectionBehaviours()),events:Wr(j([i.selectFirst()?[ti(function(e,t){o(e,Fu.getFirst)})]:[],[Yr(Gt(),function(e,t){var o,r,n=t.event().button();o=n,r=uf.getValue(o),tl(o,i,"tabview").each(function(n){F(i.tabs(),function(e){return e.value===r}).each(function(e){var t=e.view();Wn.set(n.element(),"aria-labelledby",Wn.get(o.element(),"id")),dh.set(n,t),i.onChangeTab()(n,o,t)})})}),Yr(Xt(),function(e,t){var n=t.event().button();i.onDismissTab()(e,n)})]])),apis:{getViewItems:function(e){return tl(e,i,"tabview").map(function(e){return dh.contents(e)}).getOr([])},showTab:function(e,n){o(e,function(t){var e=Fu.getCandidates(t);return F(e,function(e){return uf.getValue(e)===n}).filter(function(e){return!Fu.isHighlighted(t,e)})})}}}},apis:{getViewItems:function(e,t){return e.getViewItems(t)},showTab:function(e,t,n){e.showTab(t,n)}}}),HH=function(t,n,o){var e,r,i,a=xn.owner(t.element());return(e=a,r=n,i=o,P.from(e.dom().elementFromPoint(r,i)).map($t.fromDom)).filter(function(e){return t.element().dom().contains(e.dom())}).filter(function(e){return(Ln.isText(e)?xn.parent(e):P.some(e)).exists(function(e){var t=e.dom().getBoundingClientRect();return n>=t.left&&n<=t.right&&o>=t.top&&o<=t.bottom})})},EH=U([hr("dom"),hr("fetch"),ma("onOpen"),ga("onExecute"),ma("onTap"),ma("onHoverOn"),ma("onHoverOff"),ma("onMiss"),gs("touchmenuBehaviours",[Ba,Vl,CS]),hr("toggleClass"),kr("lazySink"),kr("role"),Tr("eventOrder",{}),Tr("matchWidth",!0),Tr("useMinWidth",!1),ma("onClosed"),kr("menuTransition"),Tr("getAnchor",function(e){var t=Sy.absolute(e.element()),n=xf(e.element()),o=eu(e.element());return{anchor:"makeshift",x:t.left()+n/2,y:t.top()+o/2,layouts:{onLtr:function(){return[kx,wx]},onRtl:function(){return[kx,wx]}}}})].concat(US())),VH=U([js({schema:[sa()],name:"menu"}),js({schema:[hr("dom")],name:"view"}),VS()]),AH=(Ml({name:"TouchMenu",configFields:EH(),partFields:VH(),factory:function(i,e,t,a){var r=function(e){var t=CS.getCoupled(e,"sandbox");return bw.getState(t)},n=Ve(!1),u=function(e){!1===n.get()&&c(e)},c=function(e){i.onHoverOn()(e),n.set(!0)},s=function(e){!0===n.get()&&(i.onHoverOff()(e),n.set(!1))};return te({uid:i.uid(),dom:i.dom(),components:e,behaviours:te(ki([Ba.config({toggleClass:i.toggleClass(),aria:{mode:"pressed",syncWithExpanded:!0}}),Vl.config({}),CS.config({others:{sandbox:function(o){return Cw.sketch(te(a.view(),{lazySink:FS(o,i),inlineBehaviours:ki([Tm("execute-for-menu",[ri(function(t,e){var n=e.event().target();t.getSystem().getByDom(n).each(function(e){i.onExecute()(o,t,e,uf.getValue(e))})})]),Oh.config({initialState:"closed",destinationAttr:"data-longpress-destination",stateAttr:"data-longpress-state",routes:Oh.createBistate("open","closed",i.menuTransition().map(function(e){return Te("transition",e)}).getOr({})),onFinish:function(e,t){"closed"===t&&(Cw.hide(e),i.onClosed()(o,e))}})]),onShow:function(e){Oh.progressTo(e,"open")}}))}}})]),hs(i.touchmenuBehaviours())),events:Wr([Gr(De(),U(!0)),Yr(Re(),function(e,t){Ba.on(e)}),Yr(Bt(),function(e,t){i.onTap()(e)}),Yr(Rt(),function(r,e){i.fetch()(r).get(function(e){c(r);var t=ah.sketch(te(a.menu(),{items:e})),n=CS.getCoupled(r,"sandbox"),o=i.getAnchor()(r);Cw.showAt(n,o,t)})}),Yr(Fe(),function(t,n){var o=n.event().raw().touches[0];r(t).each(function(e){HH(e,o.clientX,o.clientY).fold(function(){Fu.dehighlightAll(e),Zi().each(Qi),HH(t,o.clientX,o.clientY).fold(U(s),U(u))(t)},function(e){lo(t,e,Ue(),{x:o.clientX,y:o.clientY}),s(t)}),n.stop()})}),Yr(Ie(),function(e,t){r(e).each(function(e){Fu.getHighlighted(e).each(co)});var n=CS.getCoupled(e,"sandbox");Oh.progressTo(n,"closed"),Ba.off(e)}),ni(function(e,t){var n=CS.getCoupled(e,"sandbox");Cw.hide(n)})]),eventOrder:te(i.eventOrder(),{"alloy.execute":["toggling","alloy.base.behaviour"]})},{dom:{attributes:{role:i.role().getOr("button")}}})}}),"container"),BH=[gs("slotBehaviours",[])],DH=function(e){return"<alloy.field."+e+">"},RH=function(r,e,t){var n,o=function(e){return il(r)},i=function(n,o){return void 0===o&&(o=undefined),function(e,t){return tl(e,r,t).map(function(e){return n(e,t)}).getOr(o)}},a=function(e,t){return"true"!==Wn.get(e.element(),"aria-hidden")},u=i(a,!1),c=i(function(e,t){if(a(e)){var n=e.element();Ja.set(n,"display","none"),Wn.set(n,"aria-hidden","true"),uo(e,Wt(),{name:t,visible:!1})}}),s=(n=c,function(t,e){A(e,function(e){return n(t,e)})}),l=i(function(e,t){if(!a(e)){var n=e.element();Ja.remove(n,"display"),Wn.remove(n,"aria-hidden"),uo(e,Wt(),{name:t,visible:!0})}}),f={getSlotNames:o,getSlot:function(e,t){return tl(e,r,t)},isShowing:u,hideSlot:c,hideAllSlots:function(e){return s(e,o())},showSlot:l};return{"debug.sketcher":{SlotContainer:t},uid:r.uid(),dom:r.dom(),components:e,behaviours:hs(r.slotBehaviours()),apis:f}},FH=se({getSlotNames:function(e,t){return e.getSlotNames(t)},getSlot:function(e,t,n){return e.getSlot(t,n)},isShowing:function(e,t,n){return e.isShowing(t,n)},hideSlot:function(e,t,n){return e.hideSlot(t,n)},hideAllSlots:function(e,t){return e.hideAllSlots(t)},showSlot:function(e,t,n){return e.showSlot(t,n)}},ml),IH=te(FH,{sketch:function(e){var n,t=(n=[],{slot:function(e,t){return n.push(e),Ks(AH,DH(e),t)},record:function(){return n}}),o=e(t),r=t.record(),i=V(r,function(e){return Ps({name:e,pname:DH(e)})});return Sl(AH,BH,i,RH,o)}}),_H=function(e){return{element:function(){return e.element().dom()}}},LH=function(t){return IH.sketch(function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:(o=e,i=t,V(i,function(e){var t=e.name,n=e.settings;return o.slot(t,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Nk([ti(function(e){n.onrender&&n.onrender(_H(e))}),Yr(Wt(),function(o,e){var r=e.event();F(i,function(e){return e.name===r.name()}).each(function(e){var t=e.settings,n=r.visible()?t.onshow:t.onhide;n&&n(_H(o))})})])})})),slotBehaviours:Nk([ti(function(e){return IH.hideAllSlots(e)})])};var o,i})},NH=ro("FixSizeEvent"),PH=ro("AutoSizeEvent"),jH={setSidebar:function(e,t){Em.getCurrent(e).each(function(e){return dh.set(e,[LH(t)])})},toggleSidebar:function(e,n){Em.getCurrent(e).each(function(t){Em.getCurrent(t).each(function(e){Kp.hasGrown(t)?IH.isShowing(e,n)?Kp.shrink(t):(IH.hideAllSlots(e),IH.showSlot(e,n)):(IH.hideAllSlots(e),IH.showSlot(e,n),Kp.grow(t))})})},whichSidebar:function(e){return Em.getCurrent(e).bind(function(e){return Kp.isGrowing(e)||Kp.hasGrown(e)?Em.getCurrent(e).bind(function(t){return F(IH.getSlotNames(t),function(e){return IH.isShowing(t,e)})}):P.none()})},renderSidebar:function(e){return{uid:e.uid,dom:{tag:"div",classes:["tox-sidebar"]},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:ki([Kp.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(e){Em.getCurrent(e).each(IH.hideAllSlots),ao(e,PH)},onGrown:function(e){ao(e,PH)},onStartGrow:function(e){uo(e,NH,{width:Ja.getRaw(e.element(),"width").getOr("")})},onStartShrink:function(e){uo(e,NH,{width:xf(e.element())+"px"})}}),dh.config({}),Em.config({find:function(e){var t=dh.contents(e);return K(t)}})])}],behaviours:ki([dz(0),Tm("sidebar-sliding-events",[Yr(NH,function(e,t){Ja.set(e.element(),"width",t.event().width())}),Yr(PH,function(e,t){Ja.remove(e.element(),"width")})])])}}},UH=function(e){return Cp.sketch({dom:{tag:"div",classes:["tox-toolbar__group"]},components:[Cp.parts().items({})],items:e.items,markers:{itemSelector:".tox-tbtn, .tox-split-button, .tox-toolbar-nav-js"},tgroupBehaviours:ki([Pm.config({})])})},WH=function(n){return wp.sketch({uid:n.uid,dom:{tag:"div",classes:["tox-toolbar"]},components:[wp.parts().groups({})],toolbarBehaviours:ki([ms.config({mode:"cyclic",onEscape:n.onEscape}),Tm("toolbar-events",[ti(function(e){var t=V(n.initGroups,UH);wp.setGroups(e,t)})])])})},GH=mT.optional({factory:UT,name:"menubar",schema:[hr("dom"),hr("getSink")]}),XH=mT.optional({factory:{sketch:function(e){return WH({uid:e.uid,onEscape:function(){return e.onEscape(),P.some(!0)},initGroups:[]})}},name:"toolbar",schema:[hr("dom"),hr("onEscape")]}),YH=mT.optional({name:"socket",schema:[hr("dom")]}),$H=mT.optional({factory:{sketch:jH.renderSidebar},name:"sidebar",schema:[hr("dom")]}),qH=Ml({name:"OuterContainer",factory:function(n,e,t){var o={getSocket:function(e){return dT.getPart(e,n,"socket")},setSidebar:function(e,t){dT.getPart(e,n,"sidebar").each(function(e){return jH.setSidebar(e,t)})},toggleSidebar:function(e,t){dT.getPart(e,n,"sidebar").each(function(e){return jH.toggleSidebar(e,t)})},whichSidebar:function(e){return dT.getPart(e,n,"sidebar").bind(jH.whichSidebar).getOrNull()},getToolbar:function(e){return dT.getPart(e,n,"toolbar")},setToolbar:function(e,t){dT.getPart(e,n,"toolbar").each(function(e){wp.setGroups(e,t)})},focusToolbar:function(e){dT.getPart(e,n,"toolbar").each(function(e){ms.focusIn(e)})},setMenubar:function(e,t){dT.getPart(e,n,"menubar").each(function(e){UT.setMenus(e,t)})},focusMenubar:function(e){dT.getPart(e,n,"menubar").each(function(e){UT.focus(e)})}};return{uid:n.uid(),dom:n.dom(),components:e,apis:o,behaviours:n.behaviours()}},configFields:[hr("dom"),hr("behaviours")],partFields:[GH,XH,YH,$H],apis:{getSocket:function(e,t){return e.getSocket(t)},setSidebar:function(e,t,n){e.setSidebar(t,n)},toggleSidebar:function(e,t,n){e.toggleSidebar(t,n)},whichSidebar:function(e,t){return e.whichSidebar(t)},getToolbar:function(e,t){return e.getToolbar(t)},setToolbar:function(e,t,n){var o=V(n,function(e){return UH({items:e})});e.setToolbar(t,o)},setMenubar:function(e,t,n){e.setMenubar(t,n)},focusMenubar:function(e,t){e.focusMenubar(t)},focusToolbar:function(e,t){e.focusToolbar(t)}}}),KH=navigator,JH=KH.userAgent,QH=function(e){return"matchMedia"in window&&matchMedia(e).matches};/Android/.test(JH),CT=(CT=!(ST=/WebKit/.test(JH))&&/MSIE/gi.test(JH)&&/Explorer/gi.test(KH.appName))&&/MSIE (\w+)\./.exec(JH)[1],zT=-1!==JH.indexOf("Trident/")&&(-1!==JH.indexOf("rv:")||-1!==KH.appName.indexOf("Netscape"))&&11,OT=-1!==JH.indexOf("Edge/")&&!CT&&!zT&&12,CT=CT||zT||OT,!ST&&!zT&&/Gecko/.test(JH),JH.indexOf("Mac"),TT=/(iPad|iPhone)/.test(JH),MT="FormData"in window&&"FileReader"in window&&"URL"in window&&!!UO,QH("only screen and (max-device-width: 480px)"),QH("only screen and (min-width: 800px)"),JH.indexOf("Windows Phone"),OT&&(ST=!1),!TT||MT||parseInt(JH.match(/AppleWebKit\/(\d*)/)[1],10),window.getSelection&&window,CT&&!OT&&document.documentMode;var ZH,eE,tE,nE=Array.isArray,oE=function(e,t,n){var o,r;if(!e)return 0;if(n=n||e,e.length!==undefined){for(o=0,r=e.length;o<r;o++)if(!1===t.call(n,e[o],o,e))return 0}else for(o in e)if(e.hasOwnProperty(o)&&!1===t.call(n,e[o],o,e))return 0;return 1},rE=function(e,t,n){var o,r;for(o=0,r=e.length;o<r;o++)if(t.call(n,e[o],o,e))return o;return-1},iE={isArray:nE,toArray:function(e){var t,n,o=e;if(!nE(e))for(o=[],t=0,n=e.length;t<n;t++)o[t]=e[t];return o},each:oE,map:function(n,o){var r=[];return oE(n,function(e,t){r.push(o(e,t,n))}),r},filter:function(n,o){var r=[];return oE(n,function(e,t){o&&!o(e,t,n)||r.push(e)}),r},indexOf:function(e,t){var n,o;if(e)for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},reduce:function(e,t,n,o){var r=0;for(arguments.length<3&&(n=e[0]);r<e.length;r++)n=t.call(o,n,e[r],r);return n},findIndex:rE,find:function(e,t,n){var o=rE(e,t,n);return-1!==o?e[o]:undefined},last:function(e){return e[e.length-1]}},aE=function(e,t){return t?!("array"!==t||!iE.isArray(e))||typeof e===t:e!==undefined},uE=(iE.isArray,aE),cE=(iE.toArray,function(e,t,n){var o;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},o=e.length;o--;)n[e[o]]={};return n}),sE=(iE.each,iE.map,iE.filter,iE.indexOf,function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}),lE=function(e,t){for(var n,o,r,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var u,c=arguments;for(n=1,o=c.length;n<o;n++)for(r in t=c[n])t.hasOwnProperty(r)&&(u=t[r])!==undefined&&(e[r]=u);return e},fE=VO.trim,dE=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}},mE=dE("true"),gE=dE("false"),hE=function(e,t,n,o,r){return{type:e,title:t,url:n,level:o,attach:r}},vE=function(e){return e.innerText||e.textContent},pE=function(e){return(t=e)&&"A"===t.nodeName&&(t.id||t.name)!==undefined&&yE(e);var t},bE=function(e){return e&&/^(H[1-6])$/.test(e.nodeName)},yE=function(e){return function(e){for(;e=e.parentNode;){var t=e.contentEditable;if(t&&"inherit"!==t)return mE(e)}return!1}(e)&&!gE(e)},xE=function(e){return bE(e)&&yE(e)},wE=function(e){var t,n,o=(t=e).id?t.id:ro("h");return hE("header",vE(e),"#"+o,bE(n=e)?parseInt(n.nodeName.substr(1),10):0,function(){e.id=o})},kE=function(e){var t=e.id||e.name,n=vE(e);return hE("anchor",n||"#"+t,"#"+t,0,N)},SE=function(e){var t,n;return t="h1,h2,h3,h4,h5,h6,a:not([href])",n=e,V(cu($t.fromDom(n),t),function(e){return e.dom()})},CE=function(e){return 0<fE(e.title).length},zE=function(e){var t,n=SE(e);return B((t=n,V(B(t,xE),wE)).concat(V(B(n,pE),kE)),CE)},OE="tinymce-url-history",TE=function(e){return x(e)&&/^https?/.test(e)},ME=function(e){return w(e)&&function(e,t){for(var n=ae(e),o=0,r=n.length;o<r;o++){var i=n[o],a=e[i];if(t(a,i,e))return P.some(a)}return P.none()}(e,function(e){return!(S(t=e)&&t.length<=5&&G(t,TE));var t}).isNone()},HE=function(){var e,t=localStorage.getItem(OE);if(null===t)return{};try{e=JSON.parse(t)}catch(n){if(n instanceof SyntaxError)return console.log("Local storage "+OE+" was not valid JSON",n),{};throw n}return ME(e)?e:(console.log("Local storage "+OE+" was not valid format",e),{})},EE=function(e){var t=HE();return Object.prototype.hasOwnProperty.call(t,e)?t[e]:[]},VE=function(t,e){if(TE(t)){var n=HE(),o=Object.prototype.hasOwnProperty.call(n,e)?n[e]:[],r=B(o,function(e){return e!==t});n[e]=[t].concat(r).slice(0,5),function(e){if(!ME(e))throw new Error("Bad format for history:\n"+JSON.stringify(e));localStorage.setItem(OE,JSON.stringify(e))}(n)}},AE=Object.prototype.hasOwnProperty,BE=function(e){return!!e},DE=function(e){return se(cE(e,/[, ]/),BE)},RE=function(e,t){return AE.call(e,t)?P.some(e[t]):P.none()},FE=function(e,t,n){var o=RE(e,t).getOr(n);return x(o)?P.some(o):P.none()},IE=function(u){return function(r){return(e=u.settings,t=r,n=P.some(e.file_picker_types).filter(BE),o=P.some(e.file_browser_callback_types).filter(BE),i=n.or(o).map(DE).fold(function(){return!0},function(e){return RE(e,t).getOr(!1)}),a=P.some(e.file_picker_callback).filter(z),i?a:P.none()).map(function(o){return function(t){return Cb.nu(function(n){var e=lE({filetype:r},P.from(t.meta).getOr({}));o.call(u,function(e,t){if(!x(e))throw new Error("Expected value to be string");if(t!==undefined&&!w(t))throw new Error("Expected meta to be a object");n({value:e,meta:t})},t.value,e)})}});var e,t,n,o,i,a}},_E=function(e){return{getHistory:EE,addToHistory:VE,getLinkInformation:(n=e,function(){return!1===n.settings.typeahead_urls?P.none():P.some({targets:zE(n.getBody()),anchorTop:FE(n.settings,"anchor_top","#top"),anchorBottom:FE(n.settings,"anchor_bottom","#bottom")})}),getValidationHandler:(t=e,function(){var e=t.settings.filepicker_validator_handler;return z(e)?P.some(e):P.none()}),getUrlPicker:IE(e)};var t,n},LE=function(e){return{colorPicker:(n=e,function(e,t){HC.colorPickerDialog(n)(e,t)}),hasCustomColors:(t=e,function(){return vC(t)})};var t,n},NE=function(e,t,n){var o,r,i,a,u,c,s,l,f,d={shared:{providers:{icons:function(){return n.ui.registry.getAll().icons},translate:Qw.translate},interpreter:function(e){return fT(sT,e,d)},anchors:{toolbar:function(){return{anchor:"hotspot",hotspot:qH.getToolbar(e).getOrDie("Could not find a toolbar element"),layouts:{onRtl:function(){return[px]},onLtr:function(){return[bx]}}}},banner:function(){return{anchor:"hotspot",hotspot:qH.getToolbar(e).getOrDie("Could not find a toolbar element"),layouts:{onRtl:function(){return[kx]},onLtr:function(){return[kx]}}}},cursor:function(){return{anchor:"selection",root:$t.fromDom(n.getBody()),getSelection:function(){var e=n.selection.getRng();return P.some(bv.range($t.fromDom(e.startContainer),e.startOffset,$t.fromDom(e.endContainer),e.endOffset))}}},node:function(e){return{anchor:"node",root:$t.fromDom(n.getBody()),node:e}}},getSink:function(){return ie.value(t)}},urlinput:_E(n),styleselect:(o=n,r=function(e){return function(){return o.formatter.match(e)}},i=function(t){return function(){var e=o.formatter.get(t);return e!==undefined?P.some({tag:0<e.length&&(e[0].inline||e[0].block)||"div",styleAttr:o.formatter.getCssText(t)}):P.none()}},a=function(e){var t=e.items;return t!==undefined&&0<t.length?W(t,a):[e.format]},u=Ve([]),c=Ve([]),s=Ve([]),l=Ve([]),f=Ve(!1),o.on("init",function(){var e=BT(o),t=yT(o,e,r,i);u.set(t),c.set(W(t,a))}),o.on("addStyleModifications",function(e){var t=yT(o,e.items,r,i);s.set(t),f.set(e.replace),l.set(W(t,a))}),{getData:function(){var e=f.get()?[]:u.get(),t=s.get();return e.concat(t)},getFlattenedKeys:function(){var e=f.get()?[]:c.get(),t=l.get();return e.concat(t)}}),colorinput:LE(n)};return d},PE=tinymce.util.Tools.resolve("tinymce.util.Delay"),jE=[Vr("disabled",!1),Cr("tooltip"),Cr("icon"),Cr("text"),Ar("onSetup",function(){return N})],UE=Wo([pr("type"),br("onAction")].concat(jE)),WE=function(e){return or("toolbarbutton",UE,e)},GE=Wo([pr("type"),Cr("tooltip"),Cr("icon"),Cr("text"),br("fetch"),Ar("onSetup",function(){return N})]),XE=Wo([pr("type"),Cr("tooltip"),Cr("icon"),Cr("text"),(ZH="select",Sr(ZH,gr)),br("fetch"),Ar("onSetup",function(){return N}),Er("presets","normal"),Tr("columns",1),br("onAction"),br("onItemAction")]),YE=[Vr("active",!1)].concat(jE),$E=Wo(YE.concat([pr("type"),br("onAction")])),qE=function(e){return or("ToggleButton",$E,e)},KE=[Ar("predicate",function(){return!1}),Tr("scope","node"),Tr("position","selection")],JE=jE.concat([Tr("type","contextformbutton"),Tr("primary",!1),br("onAction"),Dr("original",b)]),QE=YE.concat([Tr("type","contextformbutton"),Tr("primary",!1),br("onAction"),Dr("original",b)]),ZE=jE.concat([Tr("type","contextformbutton")]),eV=YE.concat([Tr("type","contextformtogglebutton")]),tV=cr("type",{contextformbutton:JE,contextformtogglebutton:QE}),nV=Wo([Tr("type","contextform"),Ar("initValue",function(){return""}),Cr("label"),wr("commands",tV),Sr("launch",cr("type",{contextformbutton:ZE,contextformtogglebutton:eV}))].concat(KE)),oV=Wo([Tr("type","contexttoolbar"),wr("items",dr)].concat(KE)),rV=function(t){return{isDisabled:function(){return tg.isDisabled(t)},setDisabled:function(e){return e?tg.disable(t):tg.enable(t)}}},iV=function(t){return{setActive:function(e){Ba.set(t,e)},isActive:function(){return Ba.isOn(t)},isDisabled:function(){return tg.isDisabled(t)},setDisabled:function(e){return e?tg.disable(t):tg.enable(t)}}},aV=ro("focus-button"),uV=function(t,n,e,o,r){var i,a=e.map(function(e){return{"aria-label":r.translate(e),title:r.translate(e)}}).getOr({});return{dom:{tag:"button",classes:["tox-tbtn"].concat(n.isSome()?["tox-tbtn--select"]:[]),attributes:a},components:lk([t.map(function(e){return aO(e,r.icons)}),n.map(function(e){return uO(e,"tox-tbtn",r)})]),eventOrder:(i={},i[Le()]=["focusing","alloy.base.behaviour","common-button-display-events"],i),buttonBehaviours:ki([Tm("common-button-display-events",[Yr(Le(),function(e,t){t.event().prevent(),ao(e,aV)})])].concat(o.map(function(e){return _M.config({channel:e,initialData:{icon:t,text:n},renderComponents:function(e,t){return lk([e.icon.map(function(e){return aO(e,r.icons)}),e.text.map(function(e){return uO(e,"tox-tbtn",r)})])}})}).toArray()))}},cV=function(e,t,n){var o,r=Ve(N),i=uV(e.icon,e.text,e.tooltip,P.none(),n);return Hl.sketch({dom:i.dom,components:i.components,eventOrder:hT,buttonBehaviours:ki([Tm("toolbar-button-events",[(o={onAction:e.onAction,getApi:t.getApi},ri(function(t,e){ak(o,t)(function(e){uo(t,gT,{buttonApi:e}),o.onAction(e)})})),uk(t,r),ck(t,r)]),ik(e.disabled)].concat(t.toolbarButtonBehaviours))})},sV=function(e,t,n){return cV(e,{toolbarButtonBehaviours:[].concat(0<n.length?[Tm("toolbarButtonWith",n)]:[]),getApi:rV,onSetup:e.onSetup},t)},lV=function(e,t,n){return te(cV(e,{toolbarButtonBehaviours:[dh.config({}),Ba.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<n.length?[Tm("toolbarToggleButtonWith",n)]:[]),getApi:iV,onSetup:e.onSetup},t))},fV=function(t,e){var n,r,o,i=ro("channel-update-split-dropdown-display"),a=function(n){return{isDisabled:function(){return!0},setDisabled:function(){},setIconFill:function(e,t){du(n.element(),'svg path[id="'+e+'"], rect[id="'+e+'"]').each(function(e){Wn.set(e,"fill",t)})},setIconStroke:function(e,t){du(n.element(),'svg path[id="'+e+'"], rect[id="'+e+'"]').each(function(e){Wn.set(e,"stroke",t)})},setActive:function(e){Ba.set(n,e)},isActive:function(){return Ba.isOn(n)}}},u=Ve(N),c={getApi:a,onSetup:t.onSetup};return cH.sketch({dom:{tag:"div",classes:["tox-split-button"]},onExecute:function(e){t.onAction(a(e))},onItemExecute:function(e,t,n){},splitDropdownBehaviours:ki([Ba.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1}),Tm("split-dropdown-events",[Yr(aV,Wa.focus),uk(c,u),ck(c,u)])]),toggleClass:"mce-active",lazySink:e.getSink,fetch:(n=a,r=t,o=e.providers,function(t){return Cb.nu(function(e){return r.fetch(e)}).map(function(e){return iS(te(oS(ro("menu-value"),e,function(e){r.onItemAction(n(t),e)},r.columns,r.presets,Aw.CLOSE_ON_EXECUTE,r.select.getOr(function(){return!1}),o),{movement:Gk(r.columns,r.presets),menuBehaviours:Nk("auto"!==r.columns?[]:[ti(function(o,e){_k(o,4,Kw(r.presets)).each(function(e){var t=e.numRows,n=e.numColumns;ms.setGridSize(o,t,n)})})])}))})}),parts:{menu:Wk(0,t.columns,t.presets)},components:[cH.parts().button(uV(t.icon,t.text,t.tooltip,P.some(i),e.providers)),cH.parts().arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Mw("icon-chevron-down",e.providers.icons,U(""))}})]})},dV=undefined&&undefined.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},mV=undefined&&undefined.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n},gV=function(i,a){return Yr(gT,function(e,t){var n,o=i.get(e),r=(n=o,{hide:function(){return ao(n,Ft())},getValue:function(){return uf.getValue(n)}});a.onAction(r,t.event().buttonApi())})},hV=function(e,t,n){var o,r,i,a,u,c,s,l,f,d,m,g,h={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===t.type?(s=e,f=h,(d=(l=t).original).primary,m=mV(d,["primary"]),g=rr(qE(dV({},m,{type:"togglebutton",onAction:function(){}}))),lV(g,f.backstage.shared.providers,[gV(s,l)])):(o=e,i=h,(a=(r=t).original).primary,u=mV(a,["primary"]),c=rr(WE(dV({},u,{type:"button",onAction:function(){}}))),sV(c,i.backstage.shared.providers,[gV(o,r)]))},vV=function(e,t){var n,o,r,i,a=ro("context-form-field"),u=e.label.map(function(e){return{dom:{tag:"label",classes:["tox-toolbar-label"],attributes:{"for":a},innerHtml:e}}}),c=e.label.fold(function(){return{}},function(e){return{id:a}}),s=Qd(_m.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:e.initValue(),inputAttributes:c,selectOnFocus:!0,inputBehaviours:ki([ms.config({mode:"special",onEnter:function(e){return l.findPrimary(e).map(function(e){return co(e),!0})},onLeft:function(e,t){return t.cut(),P.none()},onRight:function(e,t){return t.cut(),P.none()}})])})),l=(n=s,o=e.commands,r=t,i=V(o,function(e){return Qd(hV(n,e,r))}),{asSpecs:function(){return V(i,function(e){return e.asSpec()})},findPrimary:function(n){return Be(o,function(e,t){return e.primary?P.from(i[t]).bind(function(e){return e.getOpt(n)}).filter(k(tg.isDisabled)):P.none()})}});return WH({uid:ro("context-toolbar"),initGroups:[{items:u.toArray().concat([s.asSpec()])},{items:l.asSpecs()}],onEscape:P.none})},pV=ro("forward-slide"),bV=ro("backward-slide"),yV=ro("change-slide-event"),xV="tox-pop--resizing",wV=function(e,t,n){for(var o=e.dom(),r=z(n)?n:U(!1);o.parentNode;){o=o.parentNode;var i=$t.fromDom(o),a=t(i);if(a.isSome())return a;if(r(i))break}return P.none()},kV=wV,SV=function(t,e){return Be(e,function(e){return e.predicate(t.dom())?P.some({toolbarApi:e,elem:t}):P.none()})},CV=function(t,n){var e=function(e){return e.dom()===n.getBody()},o=$t.fromDom(n.selection.getNode());return SV(o,t.inNodeScope).orThunk(function(){return SV(o,t.inEditorScope).orThunk(function(){return kV(o,function(e){return SV(e,t.inNodeScope)},e)})})},zV=undefined&&undefined.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},OV=function(n,r){var e={},i=[],a=[],u={},c={},o=function(t,n){var o=rr(or("ContextForm",nV,n));(e[t]=o).launch.map(function(e){u["form:"+t]=zV({},n.launch,{type:"contextformtogglebutton"===e.type?"togglebutton":"button",onAction:function(){r(o)}})}),"editor"===o.scope?a.push(o):i.push(o),c[t]=o},s=function(e,t){var n,o=(n=t,or("ContextToolbar",oV,n)).getOrDie();"editor"===t.scope?a.push(o):i.push(o),c[e]=o},t=ae(n);return A(t,function(e){var t=n[e];"contextform"===t.type?o(e,t):"contexttoolbar"===t.type&&s(e,t)}),{forms:e,inNodeScope:i,inEditorScope:a,lookupTable:c,formNavigators:u}},TV=[{title:"Left",icon:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}],MV=function(n,o){var e=P.some(function(t){return function(){var e=F(TV,function(e){return n.formatter.match(e.format)}).fold(function(){return"Align"},function(e){return e.title});uo(t,vT,{text:o.shared.providers.translate(e)})}}),t={type:"basic",data:TV};return wT(n,o,t,{isSelectedFor:function(e){return function(){return n.formatter.match(e)}},getPreviewFor:function(e){return function(){return P.none()}},onAction:function(e){return function(){n.undoManager.transact(function(){n.focus(),n.formatter.match(e.format)?n.formatter.remove(e.format):n.formatter.apply(e.format)})}},nodeChangeHandler:e})},HV=function(o,r){return function(e,t){var n=o(e).fold(h(ie.error,ur),ie.value).getOrDie();return r(n,t)}},EV={button:HV(WE,function(e,t){return n=e,o=t.backstage.shared.providers,sV(n,o,[]);var n,o}),togglebutton:HV(qE,function(e,t){return n=e,o=t.backstage.shared.providers,lV(n,o,[]);var n,o}),menubutton:HV(function(e){return or("menubutton",GE,e)},function(e,t){return LT(e,"tox-tbtn",t.backstage.shared,"button")}),splitbutton:HV(function(e){return or("SplitButton",XE,e)},function(e,t){return fV(e,t.backstage.shared)}),styleSelectButton:function(e,t){return n=e,o=t.backstage,r=o.styleselect,wT(n,o,r,DT(n));var n,o,r},fontsizeSelectButton:function(e,t){return n=e,o=t.backstage,r=IT(n),wT(n,o,r.dataset,r);var n,o,r},fontSelectButton:function(e,t){return n=e,o=t.backstage,r=RT(n),wT(n,o,r.dataset,r);var n,o,r},formatButton:function(e,t){return n=e,o=t.backstage,r=ET(n),wT(n,o,r.dataset,r);var n,o,r},alignMenuButton:function(e,t){return MV(e,t.backstage)}},VV={styleselect:EV.styleSelectButton,fontsizeselect:EV.fontsizeSelectButton,fontselect:EV.fontSelectButton,formatselect:EV.formatButton,align:EV.alignMenuButton},AV=function(t,n,o){var e=(!1===n.toolbar?"":n.toolbar===undefined||!0===n.toolbar?"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image":n.toolbar).split("|"),r=V(e,function(e){return e.trim().split(" ")});return V(r,function(e){return W(e,function(e){return 0===e.trim().length?[]:Oe(n.buttons,e.toLowerCase()).fold(function(){return Oe(VV,e.toLowerCase()).map(function(e){return e(t,o)}).orThunk(function(){return console.error("No representation for toolbarItem: "+e),P.none()})},function(e){return n=o,Oe(EV,(t=e).type).fold(function(){return console.error("skipping button defined by",t),P.none()},function(e){return P.some(e(t,n))});var t,n}).toArray()})})},BV=function(i,e,a,c){var n,o,s=Wg((n={sink:a,onEscape:function(){return i.focus(),P.some(!0)}},o=Ve([]),Cw.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(e){o.set([]),Cw.getContent(e).each(function(e){Ja.remove(e.element(),"visibility")}),ji.remove(e.element(),xV),Ja.remove(e.element(),"width")},inlineBehaviours:ki([Tm("context-toolbar-events",[ei(Je(),function(e,t){Cw.getContent(e).each(function(e){}),ji.remove(e.element(),xV),Ja.remove(e.element(),"width")}),Yr(yV,function(t,n){Ja.remove(t.element(),"width");var e=xf(t.element());Cw.setContent(t,n.event().contents()),ji.add(t.element(),xV);var o=xf(t.element());Ja.set(t.element(),"width",e+"px"),Cw.getContent(t).each(function(e){n.event().focus().bind(function(e){return Ji(e),ea(t.element())}).orThunk(function(){return ms.focusIn(e),Zi()})}),setTimeout(function(){Ja.set(t.element(),"width",o+"px")},0)}),Yr(pV,function(e,t){Cw.getContent(e).each(function(e){o.set(o.get().concat([{bar:e,focus:Zi()}]))}),uo(e,yV,{contents:t.event().forwardContents(),focus:P.none()})}),Yr(bV,function(t,e){J(o.get()).each(function(e){o.set(o.get().slice(0,o.get().length-1)),uo(t,yV,{contents:Gg(e.bar),focus:e.focus})})})]),ms.config({mode:"special",onEscape:function(t){return J(o.get()).fold(function(){return n.onEscape()},function(e){return ao(t,bV),P.some(!0)})}})]),lazySink:function(){return ie.value(n.sink)}}))),l=function(){return P.some($t.fromDom(i.contentAreaContainer))};i.on("init",function(){var e=i.getBody().ownerDocument.defaultView;Kh($t.fromDom(e),"scroll",function(){f.get().each(function(e){var t=d.get().getOr(i.selection.getNode()).getBoundingClientRect(),n=i.contentAreaContainer.getBoundingClientRect(),o=t.bottom<0,r=t.top>n.height;o||r?Ja.set(s.element(),"display","none"):(Ja.remove(s.element(),"display"),cw.positionWithin(a,e,s,l()))})})});var f=Ve(P.none()),d=Ve(P.none()),r=Ve(null),m=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:ki([ms.config({mode:"acyclic"}),Tm("pop-dialog-wrap-events",[ti(function(e){i.shortcuts.add("ctrl+F9","focus statusbar",function(){return ms.focusIn(e)})}),ni(function(e){i.shortcuts.remove("ctrl+F9")})])])}},u=et(function(){return OV(e,function(e){var t=g(e);uo(s,pV,{forwardContents:m(t)})})}),g=function(e){var t,n,o=i.ui.registry.getAll().buttons,r=u();return"contexttoolbar"===e.type?(t=ne(o,r.formNavigators),n=AV(i,{buttons:t,toolbar:e.items.join(" ")},c),WH({uid:ro("context-toolbar"),initGroups:V(n,function(e){return{items:e}}),onEscape:P.none})):vV(e,c.backstage.shared.providers)};i.on("contexttoolbar-show",function(t){var e=u();Oe(e.lookupTable,t.toolbarKey).each(function(e){b(e,t.target===i?P.none():P.some(t)),Cw.getContent(s).each(ms.focusIn)})});var t={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"]},h={maxHeightFunction:ox()},v={bubble:cx(12,0,t),layouts:{onLtr:function(){return[Sx]},onRtl:function(){return[Cx]}},overrides:h},p={bubble:cx(0,12,t),layouts:{onLtr:function(){return[wx,kx,yx,px,xx,bx]},onRtl:function(){return[wx,kx,xx,bx,yx,px]}},overrides:h},b=function(e,t){x();var n,o,r,i=g(e),a=t.map($t.fromDom),u=(n=e.position,o=a,r="node"===n?c.backstage.shared.anchors.node(o):c.backstage.shared.anchors.cursor(),te(r,"line"===n?v:p));f.set(P.some(u)),d.set(t),Cw.showWithin(s,u,m(i),l()),Ja.remove(s.element(),"display")},y=function(){var e=u();CV(e,i).fold(function(){f.set(P.none()),Cw.hide(s)},function(e){b(e.toolbarApi,P.some(e.elem.dom()))})},x=function(){var e=r.get();null!==e&&(clearTimeout(e),r.set(null))};i.on("click keyup setContent ObjectResized nodeChange ResizeEditor",function(e){var t;t=PE.setEditorTimeout(i,y,0),x(),r.set(t)})},DV=function(e,n,o){var t=Kh($t.fromDom(document),"mousedown",function(t){A([n,o],function(e){e.broadcastOn([yw()],{target:t.target()})})}),r=Kh($t.fromDom(document),"touchstart",function(t){A([n,o],function(e){e.broadcastOn([yw()],{target:t.target()})})}),i=Kh($t.fromDom(document),"mouseup",function(t){0===t.raw().button&&A([n,o],function(e){e.broadcastOn([xw()],{target:t.target()})})}),a=function(t){A([n,o],function(e){e.broadcastOn([yw()],{target:$t.fromDom(t.target)})})};e.on("mousedown",a),e.on("touchstart",a);var u=function(t){0===t.button&&A([n,o],function(e){e.broadcastOn([xw()],{target:$t.fromDom(t.target)})})};e.on("mouseup",u),e.on("remove",function(){e.off("mousedown",a),e.off("touchstart",a),e.off("mouseup",u),zo(n),zo(o),n.destroy(),o.destroy(),t.unbind(),r.unbind(),i.unbind()})},RV=function(e){return e.fire("SkinLoaded")},FV=function(e){return e.fire("ResizeEditor")},IV=function(e){var t=function(){e._skinLoaded=!0,RV(e)};return function(){e.initialized?t():e.on("init",t)}},_V=function(e,t){var n,o=function(e){var t=e.settings,n=t.skin,o=t.skin_url;if(!1!==n){var r=n||"oxide";o=o?e.documentBaseURI.toAbsolute(o):cy.baseURL+"/skins/"+r}return o}(t);o&&(n=o+"/skin.min.css",t.contentCSS.push(o+(e?"/content.inline":"/content")+".min.css")),0==(!1===t.settings.skin)&&n?ta.DOM.styleSheetLoader.load(n,IV(t)):IV(t)()},LV=f(_V,!1),NV=f(_V,!0),PV={render:function(n,o,e,t,r){var i,a;LV(n),i=$t.fromDom(r.targetNode),a=o.mothership,Co(i,a,Cn.after),So(ho.body(),o.uiMothership),n.on("init",function(){qH.setToolbar(o.outerContainer,AV(n,e,{backstage:t})),qH.setMenubar(o.outerContainer,jT(n,e,t)),qH.setSidebar(o.outerContainer,n.sidebars||[])});var u=qH.getSocket(o.outerContainer).getOrDie("Could not find expected socket element");return n.addCommand("ToggleSidebar",function(e,t){qH.toggleSidebar(o.outerContainer,t),n.fire("ToggleSidebar")}),n.addQueryValueHandler("ToggleSidebar",function(){return qH.whichSidebar(o.outerContainer)}),{iframeContainer:u.element().dom(),editorContainer:o.outerContainer.element().dom()}},getBehaviours:function(e){return[]}},jV={render:function(e,t,n,o,r){NV(e);var i=t.outerContainer,a=ta.DOM;So(ho.body(),t.mothership),So(ho.body(),t.uiMothership);var u=function(){Ja.setAll(i.element(),{position:"absolute",top:Sy.absolute($t.fromDom(e.getBody())).top()-eu(i.element())+"px",left:Sy.absolute($t.fromDom(e.getBody())).left()+"px"})};return e.on("init",function(){qH.setToolbar(t.outerContainer,AV(e,n,{backstage:o})),qH.setMenubar(t.outerContainer,jT(e,n,o)),u()}),e.on("ResizeWindow",u),e.on("activate focus",function(){Ja.set(t.outerContainer.element(),"display","flex"),a.addClass(e.getBody(),"mce-edit-focus"),u(),dM.refresh(i)}),e.on("deactivate blur hide",function(){t.outerContainer&&(Ja.set(t.outerContainer.element(),"display","none"),a.removeClass(e.getBody(),"mce-edit-focus"))}),{editorContainer:t.outerContainer.element().dom()}},getBehaviours:function(t){return[dM.config({leftAttr:"data-dock-left",topAttr:"data-dock-top",contextual:{lazyContext:function(e){return P.from(t).map(function(e){return $t.fromDom(e.getBody())})},fadeInClass:"tox-toolbar-dock-fadein",fadeOutClass:"tox-toolbar-dock-fadeout",transitionClass:"tox-toolbar-dock-transition"}})]}},UV=function(e,t){return{anchor:"makeshift",x:e,y:t}},WV=function(e,t){var n,o,r,i=ta.DOM.getPos(e);return n=t,o=i.x,r=i.y,UV(n.x+o,n.y+r)},GV=function(e,t){return"contextmenu"===t.type?e.inline?UV((o=t).pageX,o.pageY):WV(e.getContentAreaContainer(),UV((n=t).clientX,n.clientY)):XV(e);var n,o},XV=function(e){return{anchor:"selection",root:$t.fromDom(e.selection.getNode())}},YV=function(e){return e.settings.contextmenu_never_use_native||!1},$V=function(e){var t,n=e.getParam("contextmenu","link image imagetools table spellchecker");return"string"==typeof(t=n)?t.split(/[ ,]/):t},qV={type:"separator"},KV=function(e){switch(e.type){case"separator":return qV;case"submenu":return{type:"menuitem",text:e.text,icon:e.icon,getSubmenuItems:function(){return V(e.getSubmenuItems(),KV)}};default:return{type:"menuitem",text:e.text,icon:e.icon,onAction:(n=e.onAction,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n()})}}var n},JV=function(c,e,s){var l=Wg(Cw.sketch({dom:{tag:"div"},lazySink:e}));c.on("contextmenu",function(e){if(t=c,!e.ctrlKey||YV(t)){var t,n=GV(c,e),o=c.ui.registry.getAll(),r=$V(c),i=c.selection.getStart(!0),a=function u(r,n,e,i){var t=W(e,function(e){if(r.hasOwnProperty(e)){var t=r[e].update(i);if(0<t.length){var n=V(t,function(e){return x(e)?e:KV(e)}),o=["|"];return o.concat(n).concat(o)}return[]}return[e]}),o=R(t,function(e,t){return x(t)?n.hasOwnProperty(t)?e.concat([n[t]]):"|"===t&&0<e.length&&"separator"!==e[e.length-1].type?e.concat([qV]):e:e.concat([t])},[]);return 0<o.length&&"separator"===o[o.length-1].type&&o.pop(),o}(o.contextMenus,o.menuItems,r,i);0<a.length&&(e.preventDefault(),Cw.showMenuAt(l,n,{menu:{markers:jk("normal")},data:eC(a,Aw.CLOSE_ON_EXECUTE,s.providers)}))}})},QV=function(e){return/^[0-9\.]+(|px)$/i.test(""+e)?P.some(parseInt(e,10)):P.none()},ZV=function(e){return O(e)?e+"px":e},eA={},tA="en",nA=function(e){var t,n,o=eA[tA]||{},r=function(e){return uE(e,"function")?Object.prototype.toString.call(e):i(e)?"":""+e},i=function(e){return""===e||null===e||e===undefined},a=function(e){var t=r(e),n=t.toLowerCase();return sE(o,n)?r(o[n]):t},u=function(e){return e.replace(/{context:\w+}$/,"")},c=function(e){return e};if(i(e))return c("");if(w(t=e)&&me(t,"raw"))return c(r(e.raw));if(S(n=e)&&1<n.length){var s=e.slice(1);return c(u(a(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return sE(s,t)?r(s[t]):e})))}return c(u(a(e)))},oA=function(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1},rA=function(i,a){return a.delimiter||(a.delimiter="\xbb"),{dom:{tag:"div",classes:["tox-statusbar__path"]},behaviours:ki([ms.config({mode:"flow",selector:"div[role=button]"}),Pm.config({}),dh.config({}),Tm("elementPathEvents",[ti(function(r,e){i.on("nodeChange",function(e){var t,o,n=function(e){for(var t=[],n=e.length;0<n--;){var o=e[n];if(1===o.nodeType&&!oA(o)){var r=i.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(r.isDefaultPrevented()||t.push({name:r.name,element:o}),r.isPropagationStopped())break}}return t}(e.parents);0<n.length&&dh.set(r,(t=V(n||[],function(t,e){return Hl.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":e,"tab-index":-1,"aria-level":e+1},innerHtml:t.name},action:function(e){i.focus(),i.selection.select(t.element),i.nodeChanged()}})}),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+a.delimiter+" "}},R(t.slice(1),function(e,t){var n=e;return n.push(o),n.push(t),n},[t[0]])))})})])]),components:[]}};(tE=eE||(eE={}))[tE.None=0]="None",tE[tE.Both=1]="Both",tE[tE.Vertical=2]="Vertical";var iA,aA,uA=function(e,t,n,o){var r=e+t,i=n.filter(function(e){return r<e}),a=o.filter(function(e){return e<r});return i.or(a).getOr(r)},cA=function(e,t,n,o,r){var i,a,u={};return u.height=uA(o,t.top(),cS(e),(i=e,P.from(i.getParam("max_height")).filter(O))),n===eE.Both&&(u.width=uA(r,t.left(),uS(e),(a=e,P.from(a.getParam("max_width")).filter(O)))),u},sA=function(s){var e,t,n,o,r=function(c){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],innerHtml:Ow("icon-resize-handle",function(){return""})},behaviours:ki([EM.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,t,n){var o,r,i,a,u;o=s,r=n,i=c,a=$t.fromDom(o.getContainer()),u=cA(o,r,i,o.getContainer().scrollHeight,xf(a)),ce(u,function(e,t){return Ja.set(a,t,e+"px")}),FV(o)},blockerClass:"tox-blocker"})])}};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(o=[],s.getParam("elementpath",!0,"boolean")&&o.push(rA(s,{})),yt(s.settings.plugins,"wordcount")&&o.push({dom:{tag:"span",classes:["tox-statusbar__wordcount"]},components:[],behaviours:ki([dh.config({}),Tm("wordcount-events",[ti(function(t){s.on("wordCountUpdate",function(e){dh.set(t,[jg(e.wordCountText)])})})])])}),s.getParam("branding",!0,"boolean")&&o.push({dom:{tag:"span",classes:["tox-statusbar__branding"],styles:{"float":"right"},innerHtml:nA(["Powered by {0}",'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" role="presentation" tabindex="-1">tinymce</a>'])},behaviours:ki([Pm.config({}),Wa.config({})])}),t=0<o.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:o,behaviours:ki([ms.config({mode:"cyclic"}),Tm("statusbar-events",[ti(function(e){s.shortcuts.add("alt+F11","focus statusbar",function(){return ms.focusIn(e)})})])])}]:[],n=!1===(e=s.getParam("resize",!0))?eE.None:"both"===e?eE.Both:eE.Vertical,n!==eE.None&&t.push(r(n)),t)}},lA=function(s){var e=s.getParam("inline",!1,"boolean"),l=e?jV:PV,f=Wg({dom:Al('<div class="tox tox-silver-sink tox-tinymce-aux"></div>'),behaviours:ki([cw.config({useFixed:!1})])}),d=function(){return ie.value(f)},t=qH.parts().menubar({dom:{tag:"div",classes:["tox-menubar"]},getSink:d,providers:{icons:function(){return s.ui.registry.getAll().icons},translate:Qw.translate},onEscape:function(){s.focus()}}),n=qH.parts().toolbar({dom:{tag:"div",classes:["tox-toolbar"]},onEscape:function(){s.focus()}}),o=qH.parts().socket({dom:{tag:"div",classes:["tox-edit-area"]}}),r=qH.parts().sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),i=s.getParam("statusbar",!0,"boolean")&&!e?P.some(sA(s)):P.none(),a={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[o,r]},u=!1!==s.getParam("toolbar",!0,"boolean"),c=!1!==s.getParam("menubar",!0,"boolean"),m=j([c?[t]:[],u?[n]:[],e?[]:[a]]),g=j([[{dom:{tag:"div",classes:["tox-editor-container"]},components:m}],e?[]:i.toArray()]),h=Wg(qH.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(e?["tox-tinymce-inline"]:[]),styles:{visibility:"hidden"}},components:g,behaviours:ki(l.getBehaviours(s))}));s.shortcuts.add("alt+F10","focus toolbar",function(){qH.focusToolbar(h)});var v=db(h),p=db(f),b=NE(h,f,s);DV(s,v,p);var y=function(e){var t,n,o,r=s.settings,i=ta.DOM;t=r.width||i.getStyle(e,"width")||"100%",n=(o=s).getParam("height",Math.max(o.getElement().offsetHeight,200),"number");var a=cS(s),u=uS(s);return t=QV(t).bind(function(t){return u.map(function(e){return Math.max(t,e)})}).getOr(t),n=QV(n).bind(function(t){return a.map(function(e){return Math.max(t,e)})}).getOr(n),t&&Ja.set(h.element(),"width",ZV(t)),!s.inline&&n&&Ja.set(h.element(),"height",ZV(n)),n};return{mothership:v,uiMothership:p,backstage:b,renderUI:function(){JV(s,d,b.shared);var e=s.ui.registry.getAll(),t=e.buttons,n=e.menuItems,o=e.contextToolbars,r={menuItems:n,buttons:t,menus:s.settings.menu?se(s.settings.menu,function(e){return ne(e,{items:e.items})}):{},menubar:s.settings.menubar,toolbar:s.settings.toolbar,sidebar:s.sidebars?s.sidebars:[]};BV(s,o,f,{backstage:b});var i=s.getElement(),a=y(i),u={mothership:v,uiMothership:p,outerContainer:h},c={targetNode:i,height:a};return l.render(s,u,r,b,c)},getUi:function(){return{channels:{broadcastAll:p.broadcast,broadcastOn:p.broadcastOn,register:function(){}}}}}},fA=function(e,t){return function(){e.execCommand("mceToggleFormat",!1,t)}},dA=function(n){var e=[{type:"menuitem",text:"Left",icon:"align-left",onAction:fA(n,"alignleft")},{type:"menuitem",text:"Center",icon:"align-center",onAction:fA(n,"aligncenter")},{type:"menuitem",text:"Right",icon:"align-right",onAction:fA(n,"alignright")},{type:"menuitem",text:"Justify",icon:"align-justify",onAction:fA(n,"alignjustify")}];n.ui.registry.addMenuItem("align",{text:"Align",icon:"align-left",hasSubmenu:!0,getSubmenuItems:function(){return e}});var t=function(t){return function(e){n.formatter?n.formatter.formatChanged(t.name,e.setActive):n.on("init",function(){n.formatter.formatChanged(t.name,e.setActive)})}};VO.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){n.ui.registry.addToggleButton(e.name,{tooltip:e.text,onAction:function(){return n.execCommand(e.cmd)},icon:e.icon,onSetup:t(e)})});var o={name:"alignnone",text:"No alignment",cmd:"JustifyNone",icon:"align-justify"};n.ui.registry.addButton(o.name,{tooltip:o.text,onAction:function(){return n.execCommand(o.cmd)},icon:o.icon,onSetup:t(o)})},mA=function(e,t){return function(){e.execCommand("mceToggleFormat",!1,t)}},gA=function(i,a){return function(t){var e,n,o,r;return n=a,o=function(e){t.setActive(e)},r=function(e){o(e,n)},(e=i).formatter?e.formatter.formatChanged(n,r):e.on("init",function(){e.formatter.formatChanged(n,r)}),function(){}}},hA=function(e){var t,n,o;t=e,VO.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){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:gA(t,e.name),onAction:mA(t,e.name)})}),n=e,VO.each([{name:"outdent",text:"Decrease indent",action:"Outdent",icon:"outdent"},{name:"indent",text:"Increase indent",action:"Indent",icon:"indent"},{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){n.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return n.execCommand(e.action)}})}),o=e,VO.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(e){o.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return o.execCommand(e.action)},onSetup:gA(o,e.name)})})},vA=function(e){var t;hA(e),t=e,VO.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:mA(t,"code")})},pA=function(e,t,n){var o=function(){return!!t.undoManager&&t.undoManager[n]()},r=function(){e.setDisabled(t.readonly||!o())};return e.setDisabled(!o()),t.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r),function(){return t.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r)}},bA=function(e){var t,n;(t=e).ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(e){return pA(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 pA(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}}),(n=e).ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(e){return pA(e,n,"hasUndo")},onAction:function(){return n.execCommand("undo")}}),n.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(e){return pA(e,n,"hasRedo")},onAction:function(){return n.execCommand("redo")}})},yA=function(e){var t,n;(t=e).ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return t.execCommand("mceToggleVisualAid")}}),(n=e).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,n)},onAction:function(){n.execCommand("mceToggleVisualAid")}})},xA=function(e){dA(e),vA(e),bA(e),HC.register(e),yA(e)},wA=[pr("type"),pr("text"),Ko("level","level",Mo(),er(function(e){return M(["info","warn","error","success"],e)?ie.value(e):ie.error('Unsupported level: "'+e+'", choose one of "info", "warn", "error", "success".')})),pr("icon"),Tr("url","")],kA=[pr("type"),pr("text"),Vr("primary",!1),Ko("name","name",Eo(function(){return ro("button-name")}),dr)],SA=[pr("type"),pr("name"),pr("label")],CA=["checked","unchecked","indeterminate"],zA=er(function(e){return M(CA,e)?ie.value(e):ie.error('Checkbox data: can only be a string of either "'+CA.join('" | "')+'" ')}),OA=[pr("type"),pr("name"),Cr("label")],TA=OA,MA=dr,HA=OA,EA=dr,VA=OA.concat([Tr("flex",!1)]),AA=Go(Zo),BA=[pr("type"),(iA="columns",vr(iA,fr)),Ko("items","items",Mo(),Go(er(function(e){return or("Checking item of grid",QA,e).fold(function(e){return ie.error(ur(e))},function(e){return ie.value(e)})})))],DA=OA.concat([Vr("sandboxed",!0),Vr("flex",!1)]),RA=dr,FA=OA,IA=dr,_A=OA.concat([xr("items",[pr("text"),pr("value")]),Hr("size",1)]),LA=dr,NA=OA.concat([Vr("constrain",!0)]),PA=Wo([pr("width"),pr("height")]),jA=OA.concat([Tr("flex",!1)]),UA=dr,WA=OA.concat([Tr("filetype","file")]),GA=Wo([pr("value"),Tr("meta",{})]),XA=OA.concat([pr("type"),Er("tag","textarea"),br("init")]),YA=dr,$A=[pr("type"),pr("html")],qA=OA.concat([hr("currentState")]),KA=OA.concat([Tr("columns",1)]),JA=(aA=[pr("value"),Cr("text"),Cr("icon")],$o(aA)),QA=cr("type",{alertbanner:wA,button:kA,checkbox:SA,colorinput:TA,colorpicker:HA,dropzone:VA,grid:BA,iframe:DA,input:FA,selectbox:_A,sizeinput:NA,textarea:jA,urlinput:WA,customeditor:XA,htmlpanel:$A,imagetools:qA,collection:KA}),ZA=[pr("type"),wr("items",QA)],eB=[pr("title"),wr("items",QA)],tB=[pr("type"),xr("tabs",eB)],nB=Wo([pr("type"),Ko("name","name",Eo(function(){return ro("button-name")}),dr),pr("text"),Er("align","end"),Vr("primary",!1),Vr("disabled",!1)]),oB=Wo([pr("title"),vr("body",cr("type",{panel:ZA,tabpanel:tB})),Er("size","normal"),wr("buttons",nB),Tr("initialData",{}),Ar("onAction",N),Ar("onChange",N),Ar("onSubmit",N),Ar("onClose",N),Ar("onCancel",N),Tr("onTabChange",N),kr("readyWhen")]),rB=function(e){return w(e)?[e].concat(W(de(e),rB)):S(e)?W(e,rB):[]},iB=function(e){return x(e.type)&&x(e.name)},aB={checkbox:zA,colorinput:MA,colorpicker:EA,dropzone:AA,input:IA,iframe:RA,sizeinput:PA,selectbox:LA,size:PA,textarea:UA,urlinput:GA,customeditor:YA,collection:JA},uB=function(e){var t=W(B(rB(e),iB),function(t){return(e=t,P.from(aB[e.type])).fold(function(){return[]},function(e){return[vr(t.name,e)]});var e});return Wo(t)},cB=function(e){return{internalDialog:rr(or("dialog",oB,e)),dataValidator:uB(e),initialData:e.initialData}},sB={open:function(e,t){var n=cB(t);return e(n.internalDialog,n.initialData,n.dataValidator)},redial:function(e){return cB(e)}},lB=ro("update-dialog"),fB=ro("update-title"),dB=ro("update-body"),mB=ro("update-footer"),gB=function(e){var n=[],o={};return ce(e,function(e,t){e.fold(function(){n.push(t)},function(e){o[t]=e})}),0<n.length?ie.error(n):ie.value(o)},hB=function(e){return K((t=e,n=function(e,t){return t<e?-1:e<t?1:0},(o=X.call(t,0)).sort(n),o));var t,n,o},vB=function(a){return{smartTabHeight:{extraEvents:[ti(function(e){du(e.element(),'[role="tabpanel"]').each(function(n){var t;Ja.set(n,"visibility","hidden"),e.getSystem().getByDom(n).toOption().bind(function(e){var o,r,i,t=(r=n,i=e,V(o=a,function(e,t){dh.set(i,o[t].view());var n=r.dom().getBoundingClientRect();return dh.set(i,[]),n.height}));return hB(t)}).each(function(e){Ja.set(n,"height",e+"px")}),Ja.remove(n,"visibility"),t=e,K(a).each(function(e){return MH.showTab(t,e.value)})})}),Yr(pS,function(e,t){du(e.element(),'[role="tabpanel"]').each(function(t){Ja.set(t,"visibility","hidden");var e=Ja.getRaw(t,"height").map(function(e){return parseInt(e,10)});Ja.remove(t,"height");var n=t.dom().getBoundingClientRect().height;e.forall(function(e){return e<n})?Ja.set(t,"height",n+"px"):e.each(function(e){Ja.set(t,"height",e+"px")}),Ja.remove(t,"visibility")})})],selectFirst:!1},naiveTabHeight:{extraEvents:[],selectFirst:!0}}},pB="send-data-to-section",bB="send-data-to-view",yB=function(e,d){return{dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[],behaviours:ki([dz(0),_M.config({channel:dB,updateState:function(e,t){return P.some({isTabPanel:function(){return"tabpanel"===t.body.type}})},renderComponents:function(e){switch(e.body.type){case"tabpanel":return[(r={tabs:e.body.tabs},i=d,a=Ve({}),u=function(e){var t=uf.getValue(e),n=gB(t).getOr({}),o=a.get(),r=te(o,n);a.set(r)},c=function(e){var t=a.get();uf.setValue(e,t)},s=Ve(null),l=V(r.tabs,function(e){return{value:e.title,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:i.shared.providers.translate(e.title)},view:function(){return[ig.sketch(function(t){return{dom:{tag:"div",classes:["tox-form"]},components:V(e.items,function(e){return lT(t,e,i)}),formBehaviours:ki([ms.config({mode:"acyclic",useTabstopAt:k(Tz)}),Tm("TabView.form.events",[ti(c),ni(u)]),wa.config({channels:Me([{key:pB,value:{onReceive:u}},{key:bB,value:{onReceive:c}}])})])}})]}}}),f=vB(l).smartTabHeight,MH.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(e,t,n){var o=uf.getValue(t);uo(e,vS,{title:o,oldTitle:s.get()}),s.set(o)},tabs:l,components:[MH.parts().tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[kH.parts().tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:ki([Pm.config({})])}),MH.parts().tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:f.selectFirst,tabSectionBehaviours:ki([Tm("tabpanel",f.extraEvents),ms.config({mode:"acyclic"}),Em.config({find:function(e){return K(MH.getViewItems(e))}}),uf.config({store:{mode:"manual",getValue:function(e){return e.getSystem().broadcastOn([pB],{}),a.get()},setValue:function(e,t){a.set(t),e.getSystem().broadcastOn([bB],{})}}})])}))];default:return[(n={items:e.body.items},o=d,t=Qd(ig.sketch(function(t){return{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:V(n.items,function(e){return lT(t,e,o)})}})),{dom:{tag:"div",classes:["tox-dialog__body"]},components:[t.asSpec()],behaviours:ki([ms.config({mode:"acyclic",useTabstopAt:k(Tz)}),fz(t),bz(t,{postprocess:function(e){return gB(e).fold(function(e){return console.error(e),{}},function(e){return e})}})])})]}var n,o,t,r,i,a,u,c,s,l,f},initialData:e})])}},xB=function(o,n){var e=function(e,r){return Yr(e,function(n,o){t(n,function(e,t){r(e,o.event(),n)})})},t=function(t,n){_M.getState(t).get().each(function(e){n(e.internalDialog,t)})};return[Jr(We(),Mz),e(mS,function(e){return e.onSubmit(o())}),e(sS,function(e,t){e.onChange(o(),{name:t.name()})}),e(dS,function(e,t){e.onAction(o(),{name:t.name(),value:t.value()})}),e(vS,function(e,t){e.onTabChange(o(),t.title())}),e(lS,function(e){n.onClose(),e.onClose()}),e(fS,function(e,t,n){e.onCancel(o()),ao(n,lS)}),ni(function(e){var t=o();uf.setValue(e,t.getData())}),Yr(hS,function(e,t){return n.onUnblock()}),Yr(gS,function(e,t){return n.onBlock(t.event())})]},wB=function(e,t){var n=function(e,t){for(var n=[],o=[],r=0,i=e.length;r<i;r++){var a=e[r];(t(a,r,e)?n:o).push(a)}return{pass:n,fail:o}}(t.map(function(e){return e.footerButtons}).getOr([]),function(e){return"start"===e.align}),o=function(e,t){return Vm.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+e]},components:V(t,function(e){return e.memento.asSpec()})})};return[o("start",n.pass),o("end",n.fail)]},kB=function(e,i){return{dom:Al('<div class="tox-dialog__footer"></div>'),components:[],behaviours:ki([_M.config({channel:mB,initialData:e,updateState:function(e,t){var r=V(t.buttons,function(e){var t,n,o=Qd((n=i,dO(t=e,t.type,n)));return{name:e.name,align:e.align,memento:o}});return P.some({lookupByName:function(e,t){return n=e,o=t,F(r,function(e){return e.name===o}).bind(function(e){return e.memento.getOpt(n)});var n,o},footerButtons:r})},renderComponents:wB})])}},SB=undefined&&undefined.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},CB=function(e){return Hl.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close"),title:e.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(e){ao(e,fS)}})},zB=function(e,t){var n=function(e){return[jg(e.title)]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:SB({},t.map(function(e){return{id:e}}).getOr({}))},components:n(e),behaviours:ki([_M.config({channel:fB,renderComponents:n})])}},OB=function(t,n){if(t.getRoot().getSystem().isConnected()){var o=Em.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return ig.getField(o,n).fold(function(){var e=t.getFooter();return _M.getState(e).get().bind(function(e){return e.lookupByName(o,n)})},function(e){return P.some(e)})}return P.none()},TB=function(c,o){var e=function(e){var t=c.getRoot();t.getSystem().isConnected()&&e(t)},s={getData:function(){var e=c.getRoot(),t=e.getSystem().isConnected()?c.getFormWrapper():e;return uf.getValue(t)},setData:function(u){e(function(e){var t,n,o=s.getData(),r=ne(o,u),i=(t=r,n=c.getRoot(),_M.getState(n).get().map(function(e){return rr(or("data",e.dataValidator,t))}).getOr(t)),a=c.getFormWrapper();uf.setValue(a,i)})},disable:function(e){OB(c,e).each(tg.disable)},enable:function(e){OB(c,e).each(tg.enable)},focus:function(e){OB(c,e).each(Wa.focus)},block:function(t){e(function(e){uo(e,gS,{message:t})})},unblock:function(){e(function(e){ao(e,hS)})},showTab:function(n){e(function(e){var t=c.getBody();_M.getState(t).get().exists(function(e){return e.isTabPanel()})&&Em.getCurrent(t).each(function(e){MH.showTab(e,n)})})},redial:function(n){e(function(e){var t=o(n);e.getSystem().broadcastOn([lB],t),e.getSystem().broadcastOn([fB],t.internalDialog),e.getSystem().broadcastOn([dB],t.internalDialog),e.getSystem().broadcastOn([mB],t.internalDialog),s.setData(t.initialData)})},close:function(){e(function(e){ao(e,lS)})}};return s},MB=function(e,t,n){var o,r,i,a,u,c,s,l,f,d,m,g=(r={title:n.shared.providers.translate(e.internalDialog.title),draggable:!0},i=n.shared.providers,a=oH.parts().title(zB(r,P.none())),u=oH.parts().draghandle({dom:Al('<div class="tox-dialog__draghandle"></div>')}),c=oH.parts().close(CB(i)),s=[a].concat(r.draggable?[u]:[]).concat([c]),Vm.sketch({dom:Al('<div class="tox-dialog__header"></div>'),components:s})),h=(l={body:e.internalDialog.body},f=n,oH.parts().body(yB(l,f))),v=(d={buttons:e.internalDialog.buttons},m=n.shared.providers,oH.parts().footer(kB(d,m))),p=xB(function(){return x},{onClose:function(){return t.closeWindow()},onBlock:function(n){oH.setBusy(y,function(e,t){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:t,components:[{dom:Al('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}})},onUnblock:function(){oH.setIdle(y)}}),b="normal"!==e.internalDialog.size?"large"===e.internalDialog.size?"tox-dialog--width-lg":"tox-dialog--width-md":[],y=Wg(oH.sketch({lazySink:n.shared.getSink,onEscape:function(e){return ao(e,fS),P.some(!0)},useTabstopAt:function(e){return!Tz(e)&&("button"!==Ln.name(e)||"disabled"!==Wn.get(e,"disabled"))},modalBehaviours:ki([_M.config({channel:lB,updateState:function(e,t){return P.some(t)},initialData:e}),Wa.config({}),Tm("execute-on-form",p.concat([ei(We(),function(e,t){ms.focusIn(e)})])),wz({})]),eventOrder:(o={},o[Vt()]=["execute-on-form"],o[Nt()]=["reflecting","execute-on-form"],o),dom:{tag:"div",classes:["tox-dialog"].concat(b),styles:{position:"relative"}},components:[g,h,v],dragBlockClass:"tox-dialog-wrap",parts:{blocker:{dom:Al('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}}})),x=TB({getRoot:function(){return y},getBody:function(){return oH.getBody(y)},getFooter:function(){return oH.getFooter(y)},getFormWrapper:function(){var e=oH.getBody(y);return Em.getCurrent(e).getOr(e)}},t.redial);return{dialog:y,instanceApi:x}},HB=function(e,t,n){var o,r,i,a,u,c,s,l,f=ro("dialog-label"),d=Qd((i={title:e.internalDialog.title,draggable:!0},a=f,u=n.shared.providers,Vm.sketch({dom:Al('<div class="tox-dialog__header"></div>'),components:[zB(i,P.some(a)),CB(u)],containerBehaviours:ki([EM.config({mode:"mouse",blockerClass:"blocker",getTarget:function(e){return mu(e,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),m=Qd((c={body:e.internalDialog.body},yB(c,n))),g=Qd((s={buttons:e.internalDialog.buttons},l=n.shared.providers,kB(s,l))),h=xB(function(){return p},{onBlock:function(){},onUnblock:function(){},onClose:function(){return t.closeWindow()}}),v=Wg({dom:{tag:"div",classes:["tox-dialog"],attributes:(o={role:"dialog"},o["aria-labelledby"]=f,o)},eventOrder:(r={},r[Et()]=[_M.name(),wa.name()],r[Vt()]=["execute-on-form"],r[Nt()]=["reflecting","execute-on-form"],r),behaviours:ki([ms.config({mode:"cyclic",onEscape:function(e){return ao(e,lS),P.some(!0)},useTabstopAt:function(e){return!Tz(e)&&("button"!==Ln.name(e)||"disabled"!==Wn.get(e,"disabled"))}}),_M.config({channel:lB,updateState:function(e,t){return P.some(t)},initialData:e}),Tm("execute-on-form",h),wz({})]),components:[d.asSpec(),m.asSpec(),g.asSpec()]}),p=TB({getRoot:function(){return v},getFooter:function(){return g.get(v)},getBody:function(){return m.get(v)},getFormWrapper:function(){var e=m.get(v);return Em.getCurrent(e).getOr(e)}},t.redial);return{dialog:v,instanceApi:p}},EB=function(e){return oH.parts().close(Hl.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":"Close"}},action:e,buttonBehaviours:ki([Pm.config({})])}))},VB=function(){return oH.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},AB=function(e,t){return oH.parts().body({dom:{tag:"div",classes:["tox-dialog__body","todo-tox-fit"]},components:[{dom:Al("<p>"+t.translate(e)+"</p>")}]})},BB=function(e){return oH.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:e})},DB=function(e,t){return[Vm.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:e}),Vm.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})]},RB=function(n){return oH.sketch({lazySink:n.lazySink,onEscape:function(){return n.onCancel(),P.some(!0)},dom:{tag:"div",classes:["tox-dialog"].concat(n.extraClasses)},components:[{dom:{tag:"div",classes:["tox-dialog__header"]},components:[n.partSpecs.title,n.partSpecs.close]},n.partSpecs.body,n.partSpecs.footer],parts:{blocker:{dom:Al('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}},modalBehaviours:ki([Tm("basic-dialog-events",[Yr(fS,function(e,t){n.onCancel()}),Yr(mS,function(e,t){n.onSubmit()})])])})},FB=function(c){var a,u,o=(a=c.backstage.shared,{open:function(e,t){var n=function(e){oH.hide(e),t()},o=Qd(dO({name:"close-alert",text:"Ok",primary:!0},"cancel",a.providers)),r=Wg(RB({lazySink:function(){return a.getSink()},partSpecs:{title:VB(),close:EB(function(){n(r)}),body:AB(e,a.providers),footer:BB(DB([],[o.asSpec()]))},onCancel:function(){return n(r)},onSubmit:N,extraClasses:["tox-alert-dialog"]}));oH.show(r);var i=o.get(r);Wa.focus(i)}}),r=(u=c.backstage.shared,{open:function(e,n){var t=function(e,t){oH.hide(e),n(t)},o=Qd(dO({name:"yes",text:"Yes",primary:!0},"submit",u.providers)),r=dO({name:"no",text:"No",primary:!0},"cancel",u.providers),i=Wg(RB({lazySink:function(){return u.getSink()},partSpecs:{title:VB(),close:EB(function(){t(i,!1)}),body:AB(e,u.providers),footer:BB(DB([],[o.asSpec(),r]))},onCancel:function(){return t(i,!1)},onSubmit:function(){return t(i,!0)},extraClasses:["tox-confirm-dialog"]}));oH.show(i);var a=o.get(i);Wa.focus(a)}}),i=function(e,i){return sB.open(function(e,t,n){var o=t,r=MB({dataValidator:n,initialData:o,internalDialog:e},{redial:sB.redial,closeWindow:function(){oH.hide(r.dialog),i(r.instanceApi)}},c.backstage);return oH.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},e)},s=function(e,a,u){return sB.open(function(e,t,n){var o=rr(or("data",n,t)),r=HB({dataValidator:n,initialData:o,internalDialog:e},{redial:sB.redial,closeWindow:function(){Cw.hide(i),u(r.instanceApi)}},c.backstage),i=Wg(Cw.sketch({lazySink:c.backstage.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},inlineBehaviours:ki([Tm("window-manager-inline-events",[Yr(jt(),function(e,t){ao(r.dialog,fS)})])])}));return Cw.showAt(i,a,Gg(r.dialog)),r.instanceApi.setData(o),ms.focusIn(r.dialog),r.instanceApi},e)};return{open:function(e,t,n){return t!==undefined&&"toolbar"===t.inline?s(e,c.backstage.shared.anchors.toolbar(),n):t!==undefined&&"cursor"===t.inline?s(e,c.backstage.shared.anchors.cursor(),n):i(e,n)},openInlineDialog:s,alert:function(e,t,n){o.open(e,function(){n(),t()})},close:function(e){e.close()},confirm:function(e,t,n){r.open(e,function(e){n(),t(e)})}}};io.add("silver",function(o){if(Ot.detect().deviceType.isTouch()&&!o.getParam("inline",!1,"boolean"))return hy(o);var e=lA(o),t=e.mothership,n=e.uiMothership,r=e.backstage,i=e.renderUI,a=e.getUi;xA(o),to(ro("silver-demo"),t),to(ro("silver-ui-demo"),n),aS(o,r.shared);var u=FB({backstage:r});return{renderUI:i,getWindowManagerImpl:function(){var e,t=(e=o.windowManager.windows,P.from(e[e.length-1])).fold(function(){return{getParams:N,setParams:N}},function(e){return{getParams:e.getData,setParams:e.setData}}),n={getWindows:function(){return o.windowManager.windows},windows:o.windowManager.windows};return ne(u,t,n)},getNotificationManagerImpl:function(){return Vw(o,{backstage:r},n)},ui:a()}}),function dD(){}}(); |