tinymce-rails 4.9.11.1 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -6
  3. data/app/assets/source/tinymce/tinymce.js +14735 -15357
  4. data/lib/tinymce/rails/asset_installer/compile.rb +2 -2
  5. data/lib/tinymce/rails/asset_installer.rb +1 -1
  6. data/lib/tinymce/rails/asset_manifest.rb +4 -9
  7. data/lib/tinymce/rails/configuration.rb +2 -2
  8. data/lib/tinymce/rails/configuration_file.rb +3 -4
  9. data/lib/tinymce/rails/engine.rb +1 -5
  10. data/lib/tinymce/rails/helper.rb +1 -1
  11. data/lib/tinymce/rails/version.rb +2 -2
  12. data/vendor/assets/javascripts/tinymce/jquery.tinymce.js +92 -1
  13. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +9 -1
  14. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +9 -1
  15. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +9 -1
  16. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +9 -1
  17. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +9 -1
  18. data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +9 -1
  19. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +9 -1
  20. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +9 -1
  21. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +9 -1
  22. data/vendor/assets/javascripts/tinymce/plugins/colorpicker/plugin.js +9 -1
  23. data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +9 -1
  24. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +9 -1
  25. data/vendor/assets/javascripts/tinymce/plugins/emoticons/js/emojis.js +2 -0
  26. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +9 -1
  27. data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +9 -1
  28. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +9 -1
  29. data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +9 -1
  30. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +9 -1
  31. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +9 -1
  32. data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +9 -1
  33. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +9 -1
  34. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +9 -1
  35. data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +9 -1
  36. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +9 -1
  37. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +9 -1
  38. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +9 -1
  39. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +9 -1
  40. data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +9 -1
  41. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +9 -1
  42. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +9 -1
  43. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +9 -1
  44. data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +9 -1
  45. data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +9 -0
  46. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +9 -1
  47. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +9 -1
  48. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +9 -1
  49. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +9 -1
  50. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +9 -1
  51. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +9 -1
  52. data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +9 -1
  53. data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +9 -1
  54. data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +9 -1
  55. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +9 -1
  56. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +9 -1
  57. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +9 -1
  58. data/vendor/assets/javascripts/tinymce/skins/content/default/content.css +44 -0
  59. data/vendor/assets/javascripts/tinymce/skins/content/default/content.min.css +8 -0
  60. data/vendor/assets/javascripts/tinymce/skins/content/document/content.css +48 -0
  61. data/vendor/assets/javascripts/tinymce/skins/content/document/content.min.css +8 -0
  62. data/vendor/assets/javascripts/tinymce/skins/content/writer/content.css +45 -0
  63. data/vendor/assets/javascripts/tinymce/skins/content/writer/content.min.css +8 -0
  64. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.min.css +8 -0
  65. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.min.css +8 -0
  66. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +8 -0
  67. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.mobile.min.css +2 -0
  68. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.min.css +8 -0
  69. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.min.css +8 -0
  70. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +8 -0
  71. data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +9 -1
  72. data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +9 -0
  73. data/vendor/assets/javascripts/tinymce/tinymce.js +9 -2
  74. metadata +24 -46
  75. data/vendor/assets/config/tinymce-rails.manifest.js +0 -8
  76. data/vendor/assets/javascripts/tinymce/plugins/codesample/css/prism.css +0 -138
  77. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-cool.gif +0 -0
  78. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-cry.gif +0 -0
  79. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-embarassed.gif +0 -0
  80. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
  81. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-frown.gif +0 -0
  82. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-innocent.gif +0 -0
  83. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-kiss.gif +0 -0
  84. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-laughing.gif +0 -0
  85. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
  86. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-sealed.gif +0 -0
  87. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-smile.gif +0 -0
  88. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-surprised.gif +0 -0
  89. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
  90. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-undecided.gif +0 -0
  91. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-wink.gif +0 -0
  92. data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-yell.gif +0 -0
  93. data/vendor/assets/javascripts/tinymce/plugins/help/img/logo.png +0 -0
  94. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/css/visualblocks.css +0 -154
  95. data/vendor/assets/javascripts/tinymce/skins/lightgray/content.inline.min.css +0 -1
  96. data/vendor/assets/javascripts/tinymce/skins/lightgray/content.min.css +0 -1
  97. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
  98. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce-small.svg +0 -63
  99. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  100. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
  101. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
  102. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.svg +0 -132
  103. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
  104. data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
  105. data/vendor/assets/javascripts/tinymce/skins/lightgray/img/anchor.gif +0 -0
  106. data/vendor/assets/javascripts/tinymce/skins/lightgray/img/loader.gif +0 -0
  107. data/vendor/assets/javascripts/tinymce/skins/lightgray/img/object.gif +0 -0
  108. data/vendor/assets/javascripts/tinymce/skins/lightgray/img/trans.gif +0 -0
  109. data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.min.css +0 -1
  110. data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.mobile.min.css +0 -2
  111. data/vendor/assets/javascripts/tinymce/themes/inlite/theme.js +0 -1
  112. data/vendor/assets/javascripts/tinymce/themes/modern/theme.js +0 -1
  113. /data/vendor/assets/javascripts/tinymce/skins/{lightgray → ui/oxide}/content.mobile.min.css +0 -0
  114. /data/vendor/assets/javascripts/tinymce/skins/{lightgray → ui/oxide}/fonts/tinymce-mobile.woff +0 -0
@@ -1 +1,9 @@
1
- !function(p){"use strict";var I=function(){},v=function(t,r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,n))}},A=function(n){return function(){return n}},h=function(n){return n};function l(r){for(var o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=o.concat(n);return r.apply(null,t)}}var n,e,t,r,o,i,u,x=function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return!t.apply(null,n)}},c=function(n){return function(){throw new Error(n)}},a=function(n){return n()},s=A(!1),f=A(!0),d=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e}(n)===e}},y=d("string"),m=d("object"),g=d("array"),b=d("boolean"),w=d("function"),T=d("number"),S=Object.prototype.hasOwnProperty,O=function(u){return function(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];if(0===n.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<n.length;r++){var o=n[r];for(var i in o)S.call(o,i)&&(t[i]=u(t[i],o[i]))}return t}},k=O(function(n,e){return m(n)&&m(e)?k(n,e):e}),C=O(function(n,e){return e}),E=function(){return D},D=(n=function(n){return n.isNone()},r={fold:function(n,e){return n()},is:s,isSome:s,isNone:f,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:A(null),getOrUndefined:A(undefined),or:t,orThunk:e,map:E,each:I,bind:E,exists:s,forall:f,filter:E,equals:n,equals_:n,toArray:function(){return[]},toString:A("none()")},Object.freeze&&Object.freeze(r),r),M=function(t){var n=A(t),e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:f,isNone:s,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return M(n(t))},each:function(n){n(t)},bind:r,exists:r,forall:r,filter:function(n){return n(t)?o:D},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(s,function(n){return e(t,n)})}};return o},F={some:M,none:E,from:function(n){return null===n||n===undefined?D:M(n)}},R=Object.keys,B=function(n,e){for(var t=R(n),r=0,o=t.length;r<o;r++){var i=t[r];e(n[i],i)}},V=function(n,t){return N(n,function(n,e){return{k:e,v:t(n,e)}})},N=function(n,r){var o={};return B(n,function(n,e){var t=r(n,e);o[t.k]=t.v}),o},_=function(n,t){var r=[];return B(n,function(n,e){r.push(t(n,e))}),r},j=A("touchstart"),H=A("touchmove"),z=A("touchend"),L=A("mousedown"),P=A("mousemove"),$=A("mouseup"),W=A("mouseover"),U=A("keydown"),G=A("input"),q=A("change"),Y=A("click"),K=A("transitionend"),X=A("selectstart"),J=function(t){var r,o=!1;return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return o||(o=!0,r=t.apply(null,n)),r}},Q=function(n,e){var t=function(n,e){for(var t=0;t<n.length;t++){var r=n[t];if(r.test(e))return r}return undefined}(n,e);if(!t)return{major:0,minor:0};var r=function(n){return Number(e.replace(t,"$"+n))};return nn(r(1),r(2))},Z=function(){return nn(0,0)},nn=function(n,e){return{major:n,minor:e}},en={nu:nn,detect:function(n,e){var t=String(e).toLowerCase();return 0===n.length?Z():Q(n,t)},unknown:Z},tn="Firefox",rn=function(n,e){return function(){return e===n}},on=function(n){var e=n.current;return{current:e,version:n.version,isEdge:rn("Edge",e),isChrome:rn("Chrome",e),isIE:rn("IE",e),isOpera:rn("Opera",e),isFirefox:rn(tn,e),isSafari:rn("Safari",e)}},un={unknown:function(){return on({current:undefined,version:en.unknown()})},nu:on,edge:A("Edge"),chrome:A("Chrome"),ie:A("IE"),opera:A("Opera"),firefox:A(tn),safari:A("Safari")},cn="Windows",an="Android",sn="Solaris",fn="FreeBSD",ln=function(n,e){return function(){return e===n}},dn=function(n){var e=n.current;return{current:e,version:n.version,isWindows:ln(cn,e),isiOS:ln("iOS",e),isAndroid:ln(an,e),isOSX:ln("OSX",e),isLinux:ln("Linux",e),isSolaris:ln(sn,e),isFreeBSD:ln(fn,e)}},mn={unknown:function(){return dn({current:undefined,version:en.unknown()})},nu:dn,windows:A(cn),ios:A("iOS"),android:A(an),linux:A("Linux"),osx:A("OSX"),solaris:A(sn),freebsd:A(fn)},gn=Array.prototype.slice,pn=Array.prototype.indexOf,vn=Array.prototype.push,hn=function(n,e){return t=n,r=e,-1<pn.call(t,r);var t,r},yn=function(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var i=n[o];r[o]=e(i,o)}return r},bn=function(n,e){for(var t=0,r=n.length;t<r;t++)e(n[t],t)},wn=function(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var i=n[r];e(i,r)&&t.push(i)}return t},xn=function(n,e,t){return function(n,e){for(var t=n.length-1;0<=t;t--)e(n[t],t)}(n,function(n){t=e(t,n)}),t},Tn=function(n,e,t){return bn(n,function(n){t=e(t,n)}),t},Sn=function(n,e){for(var t=0,r=n.length;t<r;t++){var o=n[t];if(e(o,t))return F.some(o)}return F.none()},On=function(n,e){for(var t=0,r=n.length;t<r;t++)if(e(n[t],t))return F.some(t);return F.none()},kn=function(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!g(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);vn.apply(e,n[t])}return e},Cn=function(n,e){var t=yn(n,e);return kn(t)},En=function(n,e){for(var t=0,r=n.length;t<r;++t)if(!0!==e(n[t],t))return!1;return!0},Dn=function(n){var e=gn.call(n,0);return e.reverse(),e},In=function(n){return[n]},An=(w(Array.from)&&Array.from,function(n,e){var t=String(e).toLowerCase();return Sn(n,function(n){return n.search(t)})}),Mn=function(n,t){return An(n,t).map(function(n){var e=en.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Fn=function(n,t){return An(n,t).map(function(n){var e=en.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Rn=function(n,e){return-1!==n.indexOf(e)},Bn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Vn=function(e){return function(n){return Rn(n,e)}},Nn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return Rn(n,"edge/")&&Rn(n,"chrome")&&Rn(n,"safari")&&Rn(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Bn],search:function(n){return Rn(n,"chrome")&&!Rn(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return Rn(n,"msie")||Rn(n,"trident")}},{name:"Opera",versionRegexes:[Bn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Vn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Vn("firefox")},{name:"Safari",versionRegexes:[Bn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(Rn(n,"safari")||Rn(n,"mobile/"))&&Rn(n,"applewebkit")}}],_n=[{name:"Windows",search:Vn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return Rn(n,"iphone")||Rn(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Vn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Vn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Vn("linux"),versionRegexes:[]},{name:"Solaris",search:Vn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Vn("freebsd"),versionRegexes:[]}],jn={browsers:A(Nn),oses:A(_n)},Hn=function(n){var e,t,r,o,i,u,c,a,s,f,l,d=jn.browsers(),m=jn.oses(),g=Mn(d,n).fold(un.unknown,un.nu),p=Fn(m,n).fold(mn.unknown,mn.nu);return{browser:g,os:p,deviceType:(t=g,r=n,o=(e=p).isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,u=e.isAndroid()&&3===e.version.major,c=e.isAndroid()&&4===e.version.major,a=o||u||c&&!0===/mobile/i.test(r),s=e.isiOS()||e.isAndroid(),f=s&&!a,l=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),{isiPad:A(o),isiPhone:A(i),isTablet:A(a),isPhone:A(f),isTouch:A(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:A(l)})}},zn={detect:J(function(){var n=p.navigator.userAgent;return Hn(n)})},Ln={tap:A("alloy.tap")},Pn=A("alloy.focus"),$n=A("alloy.blur.post"),Wn=A("alloy.receive"),Un=A("alloy.execute"),Gn=A("alloy.focus.item"),qn=Ln.tap,Yn=zn.detect().deviceType.isTouch()?Ln.tap:Y,Kn=A("alloy.longpress"),Xn=A("alloy.system.init"),Jn=A("alloy.system.scroll"),Qn=A("alloy.system.attached"),Zn=A("alloy.system.detached"),ne=function(n,e){oe(n,n.element(),e,{})},ee=function(n,e,t){oe(n,n.element(),e,t)},te=function(n){ne(n,Un())},re=function(n,e,t){oe(n,e,t,{})},oe=function(n,e,t,r){var o=k({target:e},r);n.getSystem().triggerEvent(t,e,V(o,A))},ie=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:A(n)}},ue={fromHtml:function(n,e){var t=(e||p.document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw p.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return ie(t.childNodes[0])},fromTag:function(n,e){var t=(e||p.document).createElement(n);return ie(t)},fromText:function(n,e){var t=(e||p.document).createTextNode(n);return ie(t)},fromDom:ie,fromPoint:function(n,e,t){var r=n.dom();return F.from(r.elementFromPoint(e,t)).map(ie)}},ce=(p.Node.ATTRIBUTE_NODE,p.Node.CDATA_SECTION_NODE,p.Node.COMMENT_NODE,p.Node.DOCUMENT_NODE),ae=(p.Node.DOCUMENT_TYPE_NODE,p.Node.DOCUMENT_FRAGMENT_NODE,p.Node.ELEMENT_NODE),se=p.Node.TEXT_NODE,fe=(p.Node.PROCESSING_INSTRUCTION_NODE,p.Node.ENTITY_REFERENCE_NODE,p.Node.ENTITY_NODE,p.Node.NOTATION_NODE,"undefined"!=typeof p.window?p.window:Function("return this;")()),le=function(n,e){return function(n,e){for(var t=e!==undefined&&null!==e?e:fe,r=0;r<n.length&&t!==undefined&&null!==t;++r)t=t[n[r]];return t}(n.split("."),e)},de=function(n,e){var t=le(n,e);if(t===undefined||null===t)throw new Error(n+" not available on this browser");return t},me=function(n){return n.dom().nodeName.toLowerCase()},ge=function(e){return function(n){return n.dom().nodeType===e}},pe=ge(ae),ve=ge(se),he=function(n){var e=ve(n)?n.dom().parentNode:n.dom();return e!==undefined&&null!==e&&e.ownerDocument.body.contains(e)},ye=J(function(){return be(ue.fromDom(p.document))}),be=function(n){var e=n.dom().body;if(null===e||e===undefined)throw new Error("Body is not available yet");return ue.fromDom(e)},we=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(e.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+t.length+" arguments");var r={};return bn(e,function(n,e){r[n]=A(t[e])}),r}},xe=function(n){return n.slice(0).sort()},Te=function(n,e){throw new Error("All required keys ("+xe(n).join(", ")+") were not specified. Specified keys were: "+xe(e).join(", ")+".")},Se=function(n){throw new Error("Unsupported keys for object: "+xe(n).join(", "))},Oe=function(e,n){if(!g(n))throw new Error("The "+e+" fields must be an array. Was: "+n+".");bn(n,function(n){if(!y(n))throw new Error("The value "+n+" in the "+e+" fields was not a string.")})},ke=function(n){var t=xe(n);Sn(t,function(n,e){return e<t.length-1&&n===t[e+1]}).each(function(n){throw new Error("The field: "+n+" occurs more than once in the combined fields: ["+t.join(", ")+"].")})},Ce=function(o,i){var u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return Oe("required",o),Oe("optional",i),ke(u),function(e){var t=R(e);En(o,function(n){return hn(t,n)})||Te(o,t);var n=wn(t,function(n){return!hn(u,n)});0<n.length&&Se(n);var r={};return bn(o,function(n){r[n]=A(e[n])}),bn(i,function(n){r[n]=A(Object.prototype.hasOwnProperty.call(e,n)?F.some(e[n]):F.none())}),r}},Ee=ae,De=ce,Ie=function(n,e){var t=n.dom();if(t.nodeType!==Ee)return!1;var r=t;if(r.matches!==undefined)return r.matches(e);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(e);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(e);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Ae=function(n){return n.nodeType!==Ee&&n.nodeType!==De||0===n.childElementCount},Me=function(n,e){var t=e===undefined?p.document:e.dom();return Ae(t)?[]:yn(t.querySelectorAll(n),ue.fromDom)},Fe=function(n,e){var t=e===undefined?p.document:e.dom();return Ae(t)?F.none():F.from(t.querySelector(n)).map(ue.fromDom)},Re=function(n,e){return n.dom()===e.dom()},Be=(zn.detect().browser.isIE(),function(n){return ue.fromDom(n.dom().ownerDocument)}),Ve=function(n){return ue.fromDom(n.dom().ownerDocument.defaultView)},Ne=function(n){return F.from(n.dom().parentNode).map(ue.fromDom)},_e=function(n){return yn(n.dom().childNodes,ue.fromDom)},je=function(n){return e=0,t=n.dom().childNodes,F.from(t[e]).map(ue.fromDom);var e,t},He=(we("element","offset"),function(e,t){je(e).fold(function(){ze(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})}),ze=function(n,e){n.dom().appendChild(e.dom())},Le=function(e,n){bn(n,function(n){ze(e,n)})},Pe=function(n){n.dom().textContent="",bn(_e(n),function(n){$e(n)})},$e=function(n){var e=n.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},We=function(n){ne(n,Zn());var e=n.components();bn(e,We)},Ue=function(n){var e=n.components();bn(e,Ue),ne(n,Qn())},Ge=function(n,e){qe(n,e,ze)},qe=function(n,e,t){n.getSystem().addToWorld(e),t(n.element(),e.element()),he(n.element())&&Ue(e),n.syncComponents()},Ye=function(n){We(n),$e(n.element()),n.getSystem().removeFromWorld(n)},Ke=function(e){var n=Ne(e.element()).bind(function(n){return e.getSystem().getByDom(n).fold(F.none,F.some)});Ye(e),n.each(function(n){n.syncComponents()})},Xe=function(t){return{is:function(n){return t===n},isValue:f,isError:s,getOr:A(t),getOrThunk:A(t),getOrDie:A(t),or:function(n){return Xe(t)},orThunk:function(n){return Xe(t)},fold:function(n,e){return e(t)},map:function(n){return Xe(n(t))},mapError:function(n){return Xe(t)},each:function(n){n(t)},bind:function(n){return n(t)},exists:function(n){return n(t)},forall:function(n){return n(t)},toOption:function(){return F.some(t)}}},Je=function(t){return{is:s,isValue:s,isError:f,getOr:h,getOrThunk:function(n){return n()},getOrDie:function(){return c(String(t))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return Je(t)},mapError:function(n){return Je(n(t))},each:I,bind:function(n){return Je(t)},exists:s,forall:f,toOption:F.none}},Qe={value:Xe,error:Je,fromOption:function(n,e){return n.fold(function(){return Je(e)},Xe)}},Ze=function(u){if(!g(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var c=[],t={};return bn(u,function(n,r){var e=R(n);if(1!==e.length)throw new Error("one and only one name per case");var o=e[0],i=n[o];if(t[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!g(i))throw new Error("case arguments must be an array");c.push(o),t[o]=function(){var n=arguments.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+n);for(var t=new Array(n),e=0;e<t.length;e++)t[e]=arguments[e];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,t)},match:function(n){var e=R(n);if(c.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+e.join(","));if(!En(c,function(n){return hn(e,n)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+c.join(", "));return n[o].apply(null,t)},log:function(n){p.console.log(n,{constructors:c,constructor:o,params:t})}}}}),t},nt=Ze([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),et=function(n){return nt.defaultedThunk(A(n))},tt=nt.strict,rt=nt.asOption,ot=nt.defaultedThunk,it=nt.mergeWithThunk,ut=(Ze([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n){var e=[],t=[];return bn(n,function(n){n.fold(function(n){e.push(n)},function(n){t.push(n)})}),{errors:e,values:t}}),ct=function(n){return v(Qe.error,kn)(n)},at=function(n,e){var t,r,o=ut(n);return 0<o.errors.length?ct(o.errors):(t=o.values,r=e,Qe.value(k.apply(undefined,[r].concat(t))))},st=function(n){var e=ut(n);return 0<e.errors.length?ct(e.errors):Qe.value(e.values)},ft=function(e){return function(n){return n.hasOwnProperty(e)?F.from(n[e]):F.none()}},lt=function(n,e){return ft(e)(n)},dt=function(n,e){var t={};return t[n]=e,t},mt=function(n,e){return t=n,r={},bn(e,function(n){t[n]!==undefined&&t.hasOwnProperty(n)&&(r[n]=t[n])}),r;var t,r},gt=function(n,e){return t=e,r={},B(n,function(n,e){hn(t,e)||(r[e]=n)}),r;var t,r},pt=function(n){return ft(n)},vt=function(n,e){return t=n,r=e,function(n){return ft(t)(n).getOr(r)};var t,r},ht=function(n,e){return lt(n,e)},yt=function(n,e){return dt(n,e)},bt=function(n){return e={},bn(n,function(n){e[n.key]=n.value}),e;var e},wt=function(n,e){return at(n,e)},xt=function(n,e){return r=e,(t=n).hasOwnProperty(r)&&t[r]!==undefined&&null!==t[r];var t,r},Tt=Ze([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),St=Ze([{field:["name","presence","type"]},{state:["name"]}]),Ot=function(){return de("JSON")},kt=function(n,e,t){return Ot().stringify(n,e,t)},Ct=function(n){return m(n)&&100<R(n).length?" removed due to size":kt(n,null,2)},Et=function(n,e){return Qe.error([{path:n,getErrorInfo:e}])},Dt=Ze([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),It=function(t,r,o){return lt(r,o).fold(function(){return n=o,e=r,Et(t,function(){return'Could not find valid *strict* value for "'+n+'" in '+Ct(e)});var n,e},Qe.value)},At=function(n,e,t){var r=lt(n,e).fold(function(){return t(n)},h);return Qe.value(r)},Mt=function(o,c,n,a){return n.fold(function(i,e,n,t){var r=function(n){return t.extract(o.concat([i]),a,n).map(function(n){return dt(e,a(n))})},u=function(n){return n.fold(function(){var n=dt(e,a(F.none()));return Qe.value(n)},function(n){return t.extract(o.concat([i]),a,n).map(function(n){return dt(e,a(F.some(n)))})})};return n.fold(function(){return It(o,c,i).bind(r)},function(n){return At(c,i,n).bind(r)},function(){return(n=c,e=i,Qe.value(lt(n,e))).bind(u);var n,e},function(n){return(e=c,t=i,r=n,o=lt(e,t).map(function(n){return!0===n?r(e):n}),Qe.value(o)).bind(u);var e,t,r,o},function(n){var e=n(c);return At(c,i,A({})).map(function(n){return k(e,n)}).bind(r)})},function(n,e){var t=e(c);return Qe.value(dt(n,a(t)))})},Ft=function(r){return{extract:function(t,n,e){return r(e,n).fold(function(n){return e=n,Et(t,function(){return e});var e},Qe.value)},toString:function(){return"val"},toDsl:function(){return Tt.itemOf(r)}}},Rt=function(n){var a=Bt(n),s=xn(n,function(e,n){return n.fold(function(n){return k(e,yt(n,!0))},A(e))},{});return{extract:function(n,e,t){var r,o,i,u=b(t)?[]:(o=R(r=t),wn(o,function(n){return xt(r,n)})),c=wn(u,function(n){return!xt(s,n)});return 0===c.length?a.extract(n,e,t):(i=c,Et(n,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:a.toString,toDsl:a.toDsl}},Bt=function(c){return{extract:function(n,e,t){return r=n,o=t,i=e,u=yn(c,function(n){return Mt(r,o,n,i)}),at(u,{});var r,o,i,u},toString:function(){return"obj{\n"+yn(c,function(n){return n.fold(function(n,e,t,r){return n+" -> "+r.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return Tt.objOf(yn(c,function(n){return n.fold(function(n,e,t,r){return St.field(n,t,r)},function(n,e){return St.state(n)})}))}}},Vt=function(t,i){var e=function(n,e){return(o=Ft(t),{extract:function(t,r,n){var e=yn(n,function(n,e){return o.extract(t.concat(["["+e+"]"]),r,n)});return st(e)},toString:function(){return"array("+o.toString()+")"},toDsl:function(){return Tt.arrOf(o)}}).extract(n,h,e);var o};return{extract:function(t,r,o){var n=R(o);return e(t,n).bind(function(n){var e=yn(n,function(n){return Dt.field(n,n,tt(),i)});return Bt(e).extract(t,r,o)})},toString:function(){return"setOf("+i.toString()+")"},toDsl:function(){return Tt.setOf(t,i)}}},Nt=A(Ft(Qe.value)),_t=Dt.state,jt=Dt.field,Ht=function(t,e,r,o,i){return ht(o,i).fold(function(){return n=o,e=i,Et(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Ct(n)});var n,e},function(n){return Bt(n).extract(t.concat(["branch: "+i]),e,r)})},zt=function(o,i){return{extract:function(e,t,r){return ht(r,o).fold(function(){return n=o,Et(e,function(){return'Choice schema did not contain choice key: "'+n+'"'});var n},function(n){return Ht(e,t,r,i,n)})},toString:function(){return"chooseOn("+o+"). Possible values: "+R(i)},toDsl:function(){return Tt.choiceOf(o,i)}}},Lt=Ft(Qe.value),Pt=function(n,e,t,r){return e.extract([n],t,r).fold(function(n){return Qe.error({input:r,errors:n})},Qe.value)},$t=function(n,e,t){return Pt(n,e,A,t)},Wt=function(n){return n.fold(function(n){throw new Error(qt(n))},h)},Ut=function(n,e,t){return Wt(Pt(n,e,h,t))},Gt=function(n,e,t){return Wt($t(n,e,t))},qt=function(n){return"Errors: \n"+(e=n.errors,t=10<e.length?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,yn(t,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()}))+"\n\nInput object: "+Ct(n.input);var e,t},Yt=function(n,e){return zt(n,e)},Kt=A(Lt),Xt=(o=w,i="function",Ft(function(n){var e=typeof n;return o(n)?Qe.value(n):Qe.error("Expected type: "+i+" but got: "+e)})),Jt=function(n){return jt(n,n,tt(),Nt())},Qt=function(n,e){return jt(n,n,tt(),e)},Zt=function(n){return Qt(n,Xt)},nr=function(n,e){return jt(n,n,tt(),Bt(e))},er=function(n){return jt(n,n,rt(),Nt())},tr=function(n,e){return jt(n,n,rt(),Bt(e))},rr=function(n,e){return jt(n,n,rt(),Rt(e))},or=function(n,e){return jt(n,n,et(e),Nt())},ir=function(n,e,t){return jt(n,n,et(e),t)},ur=function(n,e){return _t(n,e)},cr=function(n){if(!xt(n,"can")&&!xt(n,"abort")&&!xt(n,"run"))throw new Error("EventHandler defined by: "+kt(n,null,2)+" does not have can, abort, or run!");return Ut("Extracting event.handler",Rt([or("can",A(!0)),or("abort",A(!1)),or("run",I)]),n)},ar=function(t){var e,r,o,i,n=(e=t,r=function(n){return n.can},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Tn(e,function(n,e){return n&&r(e).apply(undefined,t)},!0)}),u=(o=t,i=function(n){return n.abort},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Tn(o,function(n,e){return n||i(e).apply(undefined,t)},!1)});return cr({can:n,abort:u,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];bn(t,function(n){n.run.apply(undefined,e)})}})},sr=function(n){return bt(n)},fr=function(n,e){return{key:n,value:cr({abort:e})}},lr=function(n,e){return{key:n,value:cr({run:e})}},dr=function(n,e,t){return{key:n,value:cr({run:function(n){e.apply(undefined,[n].concat(t))}})}},mr=function(n){return function(r){return{key:n,value:cr({run:function(n,e){var t;t=e,Re(n.element(),t.event().target())&&r(n,e)}})}}},gr=function(n,e,t){var u,r,o=e.partUids()[t];return r=o,lr(u=n,function(n,i){n.getSystem().getByUid(r).each(function(n){var e,t,r,o;t=(e=n).element(),r=u,o=i,e.getSystem().triggerEvent(r,t,o.event())})})},pr=function(n){return lr(n,function(n,e){e.cut()})},vr=mr(Qn()),hr=mr(Zn()),yr=mr(Xn()),br=(u=Un(),function(n){return lr(u,n)}),wr=function(n){return yn(n,function(n){return r=e="/*",o=(t=n).length-e.length,""!==r&&(t.length<r.length||t.substr(o,o+r.length)!==r)?n:n.substring(0,n.length-"/*".length);var e,t,r,o})},xr=function(n,e){var t=n.toString(),r=t.indexOf(")")+1,o=t.indexOf("("),i=t.substring(o+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:e,parameters:wr(i)}},n},Tr=Ce(["tag"],["classes","attributes","styles","value","innerHtml","domChildren","defChildren"]),Sr=function(n){return{tag:n.tag(),classes:n.classes().getOr([]),attributes:n.attributes().getOr({}),styles:n.styles().getOr({}),value:n.value().getOr("<none>"),innerHtml:n.innerHtml().getOr("<none>"),defChildren:n.defChildren().fold(function(){return"<none>"},function(n){return kt(n,null,2)}),domChildren:n.domChildren().fold(function(){return"<none>"},function(n){return 0===n.length?"0 children, but still specified":String(n.length)})}},Or=Ce([],["classes","attributes","styles","value","innerHtml","defChildren","domChildren"]),kr=function(e,n,t){return n.fold(function(){return t.fold(function(){return{}},function(n){return yt(e,n)})},function(n){return t.fold(function(){return yt(e,n)},function(n){return yt(e,n)})})},Cr=function(t,r,o){return yr(function(n,e){o(n,t,r)})},Er=function(n,e,t,r,o,i){var u,c,a=n,s=tr(e,[(u="config",c=n,jt(u,u,rt(),c))]);return Ar(a,s,e,t,r,o,i)},Dr=function(o,i,u){var n,e,t,r,c,a;return n=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var r=[t].concat(n);return t.config({name:A(o)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+o+". Using API: "+u)},function(n){var e=Array.prototype.slice.call(r,1);return i.apply(undefined,[t,n.config,n.state].concat(e))})},e=u,t=i.toString(),r=t.indexOf(")")+1,c=t.indexOf("("),a=t.substring(c+1,r-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:e,parameters:wr(a.slice(0,1).concat(a.slice(3)))}},n},Ir=function(n){return{key:n,value:undefined}},Ar=function(t,n,r,o,e,i,u){var c=function(n){return xt(n,r)?n[r]():F.none()},a=V(e,function(n,e){return Dr(r,n,e)}),s=V(i,function(n,e){return xr(n,e)}),f=k(s,a,{revoke:l(Ir,r),config:function(n){var e=Gt(r+"-config",t,n);return{key:r,value:{config:e,me:f,configAsRaw:J(function(){return Ut(r+"-config",t,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,t){return c(n).bind(function(e){return ht(o,"exhibit").map(function(n){return n(t,e.config,e.state)})}).getOr(Or({}))},name:function(){return r},handlers:function(n){return c(n).bind(function(e){return ht(o,"events").map(function(n){return n(e.config,e.state)})}).getOr({})}});return f},Mr=function(n,e){return Fr(n,e,{validate:w,label:"function"})},Fr=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return Oe("required",o),ke(o),function(e){var t=R(e);En(o,function(n){return hn(t,n)})||Te(o,t),r(o,t);var n=wn(o,function(n){return!i.validate(e[n],n)});return 0<n.length&&function(n,e){throw new Error("All values need to be of type: "+e+". Keys ("+xe(n).join(", ")+") were not.")}(n,i.label),e}},Rr=function(e,n){var t=wn(n,function(n){return!hn(e,n)});0<t.length&&Se(t)},Br=I,Vr=function(n){return Mr(Rr,n)},Nr={init:function(){return _r({readState:function(){return"No State required"}})}},_r=function(n){return Mr(Br,["readState"])(n),n},jr=function(n){return bt(n)},Hr=Rt([Jt("fields"),Jt("name"),or("active",{}),or("apis",{}),or("state",Nr),or("extra",{})]),zr=function(n){var e,t,r,o,i,u,c,a,s=Ut("Creating behaviour: "+n.name,Hr,n);return e=s.fields,t=s.name,r=s.active,o=s.apis,i=s.extra,u=s.state,c=Rt(e),a=tr(t,[rr("config",e)]),Ar(c,a,t,r,o,i,u)},Lr=Rt([Jt("branchKey"),Jt("branches"),Jt("name"),or("active",{}),or("apis",{}),or("state",Nr),or("extra",{})]),Pr=A(undefined),$r=function(n,e,t){if(!(y(t)||b(t)||T(t)))throw p.console.error("Invalid call to Attr.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")},Wr=function(n,e,t){$r(n.dom(),e,t)},Ur=function(n,e){var t=n.dom();B(e,function(n,e){$r(t,e,n)})},Gr=function(n,e){var t=n.dom().getAttribute(e);return null===t?undefined:t},qr=function(n,e){var t=n.dom();return!(!t||!t.hasAttribute)&&t.hasAttribute(e)},Yr=function(n,e){n.dom().removeAttribute(e)},Kr=function(n,e){var t=Gr(n,e);return t===undefined||""===t?[]:t.split(" ")},Xr=function(n){return n.dom().classList!==undefined},Jr=function(n){return Kr(n,"class")},Qr=function(n,e){return o=e,i=Kr(t=n,r="class").concat([o]),Wr(t,r,i.join(" ")),!0;var t,r,o,i},Zr=function(n,e){return o=e,0<(i=wn(Kr(t=n,r="class"),function(n){return n!==o})).length?Wr(t,r,i.join(" ")):Yr(t,r),!1;var t,r,o,i},no=function(n,e){Xr(n)?n.dom().classList.add(e):Qr(n,e)},eo=function(n,e){var t;Xr(n)?n.dom().classList.remove(e):Zr(n,e),0===(Xr(t=n)?t.dom().classList:Jr(t)).length&&Yr(t,"class")},to=function(n,e){return Xr(n)?n.dom().classList.toggle(e):(r=e,hn(Jr(t=n),r)?Zr(t,r):Qr(t,r));var t,r},ro=function(n,e){return Xr(n)&&n.dom().classList.contains(e)},oo=function(n,e,t){eo(n,t),no(n,e)},io=Object.freeze({toAlpha:function(n,e,t){oo(n.element(),e.alpha(),e.omega())},toOmega:function(n,e,t){oo(n.element(),e.omega(),e.alpha())},isAlpha:function(n,e,t){return ro(n.element(),e.alpha())},isOmega:function(n,e,t){return ro(n.element(),e.omega())},clear:function(n,e,t){eo(n.element(),e.alpha()),eo(n.element(),e.omega())}}),uo=[Jt("alpha"),Jt("omega")],co=zr({fields:uo,name:"swapping",apis:io}),ao=function(n){var e=n,t=function(){return e};return{get:t,set:function(n){e=n},clone:function(){return ao(t())}}};function so(n,e,t,r,o){return n(t,r)?F.some(t):w(o)&&o(t)?F.none():e(t,r,o)}var fo=function(n,e,t){for(var r=n.dom(),o=w(t)?t:A(!1);r.parentNode;){r=r.parentNode;var i=ue.fromDom(r);if(e(i))return F.some(i);if(o(i))break}return F.none()},lo=function(n,e,t){return so(function(n,e){return e(n)},fo,n,e,t)},mo=function(n){n.dom().focus()},go=function(n){n.dom().blur()},po=function(n){var e=n!==undefined?n.dom():p.document;return F.from(e.activeElement).map(ue.fromDom)},vo=function(e){return po(Be(e)).filter(function(n){return e.dom().contains(n.dom())})},ho=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),yo=tinymce.util.Tools.resolve("tinymce.ThemeManager"),bo=function(n){var e=p.document.createElement("a");e.target="_blank",e.href=n.href,e.rel="noreferrer noopener";var t=p.document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,p.window,0,0,0,0,0,!1,!1,!1,!1,0,null),p.document.body.appendChild(e),e.dispatchEvent(t),p.document.body.removeChild(e)},wo={formatChanged:A("formatChanged"),orientationChanged:A("orientationChanged"),dropupDismissed:A("dropupDismissed")},xo=function(n){return n.dom().innerHTML},To=function(n,e){var t,r,o=Be(n).dom(),i=ue.fromDom(o.createDocumentFragment()),u=(t=e,(r=(o||p.document).createElement("div")).innerHTML=t,_e(ue.fromDom(r)));Le(i,u),Pe(n),ze(n,i)},So=function(n){return e=n,t=!1,ue.fromDom(e.dom().cloneNode(t));var e,t},Oo=function(n){var e,t,r,o=So(n);return e=o,t=ue.fromTag("div"),r=ue.fromDom(e.dom().cloneNode(!0)),ze(t,r),xo(t)},ko=function(n){return Oo(n)},Co=Object.freeze({events:function(c){return sr([lr(Wn(),function(o,i){var n,e,u=c.channels(),t=R(u),r=(n=t,(e=i).universal()?n:wn(n,function(n){return hn(e.channels(),n)}));bn(r,function(n){var e=u[n](),t=e.schema(),r=Gt("channel["+n+"] data\nReceiver: "+ko(o.element()),t,i.data());e.onReceive()(o,r)})})])}}),Eo=function(n){for(var e=[],t=function(n){e.push(n)},r=0;r<n.length;r++)n[r].each(t);return e},Do="unknown",Io=[],Ao=["alloy/data/Fields","alloy/debugging/Debugging"],Mo={logEventCut:I,logEventStopped:I,logNoParent:I,logEventNoHandlers:I,logEventResponse:I,write:I},Fo=function(n,e,t){var r,o="*"===Io||hn(Io,n)?(r=[],{logEventCut:function(n,e,t){r.push({outcome:"cut",target:e,purpose:t})},logEventStopped:function(n,e,t){r.push({outcome:"stopped",target:e,purpose:t})},logNoParent:function(n,e,t){r.push({outcome:"no-parent",target:e,purpose:t})},logEventNoHandlers:function(n,e){r.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(n,e,t){r.push({outcome:"response",purpose:t,target:e})},write:function(){hn(["mousemove","mouseover","mouseout",Xn()],n)||p.console.log(n,{event:n,target:e.dom(),sequence:yn(r,function(n){return hn(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+ko(n.target)+")":n.outcome})})}}):Mo,i=t(o);return o.write(),i},Ro=A([Jt("menu"),Jt("selectedMenu")]),Bo=A([Jt("item"),Jt("selectedItem")]),Vo=(A(Rt(Bo().concat(Ro()))),A(Rt(Bo()))),No=nr("initSize",[Jt("numColumns"),Jt("numRows")]),_o=function(n,e,t){var r;return function(){var n=new Error;if(n.stack!==undefined){var e=n.stack.split("\n");Sn(e,function(e){return 0<e.indexOf("alloy")&&!function(n,e){for(var t=0,r=n.length;t<r;t++)if(e(n[t],t))return!0;return!1}(Ao,function(n){return-1<e.indexOf(n)})}).getOr(Do)}}(),jt(e,e,t,(r=function(t){return Qe.value(function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.apply(undefined,n)})},Ft(function(n){return r(n)})))},jo=function(n){return _o(0,n,et(I))},Ho=function(n){return _o(0,n,et(F.none))},zo=function(n){return _o(0,n,tt())},Lo=function(n){return _o(0,n,tt())},Po=function(n,e){return ur(n,A(e))},$o=function(n){return ur(n,h)},Wo=A(No),Uo=[Qt("channels",Vt(Qe.value,Rt([zo("onReceive"),or("schema",Kt())])))],Go=zr({fields:Uo,name:"receiving",active:Co}),qo=function(n,e){var t=Jo(n,e),r=e.aria();r.update()(n,r,t)},Yo=function(n,e,t){to(n.element(),e.toggleClass()),qo(n,e)},Ko=function(n,e,t){no(n.element(),e.toggleClass()),qo(n,e)},Xo=function(n,e,t){eo(n.element(),e.toggleClass()),qo(n,e)},Jo=function(n,e){return ro(n.element(),e.toggleClass())},Qo=function(n,e,t){(e.selected()?Ko:Xo)(n,e,t)},Zo=Object.freeze({onLoad:Qo,toggle:Yo,isOn:Jo,on:Ko,off:Xo}),ni=Object.freeze({exhibit:function(n,e,t){return Or({})},events:function(n,e){var t,r,o,i=(t=n,r=e,o=Yo,br(function(n){o(n,t,r)})),u=Cr(n,e,Qo);return sr(kn([n.toggleOnExecute()?[i]:[],[u]]))}}),ei=function(n,e,t){Wr(n.element(),"aria-expanded",t)},ti=[or("selected",!1),Jt("toggleClass"),or("toggleOnExecute",!0),ir("aria",{mode:"none"},Yt("mode",{pressed:[or("syncWithExpanded",!1),Po("update",function(n,e,t){Wr(n.element(),"aria-pressed",t),e.syncWithExpanded()&&ei(n,e,t)})],checked:[Po("update",function(n,e,t){Wr(n.element(),"aria-checked",t)})],expanded:[Po("update",ei)],selected:[Po("update",function(n,e,t){Wr(n.element(),"aria-selected",t)})],none:[Po("update",I)]}))],ri=zr({fields:ti,name:"toggling",active:ni,apis:Zo}),oi=function(t,r){return Go.config({channels:yt(wo.formatChanged(),{onReceive:function(n,e){e.command===t&&r(n,e.state)}})})},ii=function(n){return Go.config({channels:yt(wo.orientationChanged(),{onReceive:n})})},ui=function(n,e){return{key:n,value:{onReceive:e}}},ci="tinymce-mobile",ai={resolve:function(n){return ci+"-"+n},prefix:A(ci)},si=function(n,e){e.ignore()||(mo(n.element()),e.onFocus()(n))},fi=Object.freeze({focus:si,blur:function(n,e){e.ignore()||go(n.element())},isFocused:function(n){return e=n.element(),t=Be(e).dom(),e.dom()===t.activeElement;var e,t}}),li=Object.freeze({exhibit:function(n,e){return e.ignore()?Or({}):Or({attributes:{tabindex:"-1"}})},events:function(t){return sr([lr(Pn(),function(n,e){si(n,t),e.stop()})])}}),di=[jo("onFocus"),or("ignore",!1)],mi=zr({fields:di,name:"focusing",active:li,apis:fi}),gi=function(n){return n.style!==undefined&&w(n.style.getPropertyValue)},pi=function(n,e,t){if(!y(t))throw p.console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);gi(n)&&n.style.setProperty(e,t)},vi=function(n,e,t){var r=n.dom();pi(r,e,t)},hi=function(n,e){var t=n.dom();B(e,function(n,e){pi(t,e,n)})},yi=function(n,e){var t=n.dom(),r=p.window.getComputedStyle(t).getPropertyValue(e),o=""!==r||he(n)?r:bi(t,e);return null===o?undefined:o},bi=function(n,e){return gi(n)?n.style.getPropertyValue(e):""},wi=function(n,e){var t=n.dom(),r=bi(t,e);return F.from(r).filter(function(n){return 0<n.length})},xi=function(n,e){var t,r,o=n.dom();r=e,gi(t=o)&&t.style.removeProperty(r),qr(n,"style")&&""===Gr(n,"style").replace(/^\s+|\s+$/g,"")&&Yr(n,"style")},Ti=function(n){return n.dom().offsetWidth};function Si(r,o){var n=function(n){var e=o(n);if(e<=0||null===e){var t=yi(n,r);return parseFloat(t)||0}return e},i=function(o,n){return Tn(n,function(n,e){var t=yi(o,e),r=t===undefined?0:parseInt(t,10);return isNaN(r)?n:n+r},0)};return{set:function(n,e){if(!T(e)&&!e.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+e);var t=n.dom();gi(t)&&(t.style[r]=e+"px")},get:n,getOuter:n,aggregate:i,max:function(n,e,t){var r=i(n,t);return r<e?e-r:0}}}var Oi,ki,Ci=Si("height",function(n){var e=n.dom();return he(n)?e.getBoundingClientRect().height:e.offsetHeight}),Ei=function(n){return Ci.get(n)},Di=function(n,e,t){return wn(function(n,e){for(var t=w(e)?e:s,r=n.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=ue.fromDom(i);if(o.push(u),!0===t(u))break;r=i}return o}(n,t),e)},Ii=function(n,e){return wn(Ne(t=n).map(_e).map(function(n){return wn(n,function(n){return!Re(t,n)})}).getOr([]),e);var t},Ai=function(n,e){return Me(e,n)},Mi=function(n){return Fe(n)},Fi=function(n,e,t){return fo(n,function(n){return Ie(n,e)},t)},Ri=function(n,e){return Fe(e,n)},Bi=function(n,e,t){return so(Ie,Fi,n,e,t)},Vi=function(n,e,t){var r=Dn(n.slice(0,e)),o=Dn(n.slice(e+1));return Sn(r.concat(o),t)},Ni=function(n,e,t){var r=Dn(n.slice(0,e));return Sn(r,t)},_i=function(n,e,t){var r=n.slice(0,e),o=n.slice(e+1);return Sn(o.concat(r),t)},ji=function(n,e,t){var r=n.slice(e+1);return Sn(r,t)},Hi=function(t){return function(n){var e=n.raw();return hn(t,e.which)}},zi=function(n){return function(e){return En(n,function(n){return n(e)})}},Li=function(n){return!0===n.raw().shiftKey},Pi=function(n){return!0===n.raw().ctrlKey},$i=x(Li),Wi=function(n,e){return{matches:n,classification:e}},Ui=function(n,e,t,r){var o=n+e;return r<o?t:o<t?r:o},Gi=function(n,e,t){return n<=e?e:t<=n?t:n},qi=function(e,t,n){var r=Ai(e.element(),"."+t.highlightClass());bn(r,function(n){eo(n,t.highlightClass()),e.getSystem().getByDom(n).each(function(n){t.onDehighlight()(e,n)})})},Yi=function(n,e,t,r){var o=Ki(n,e,t,r);qi(n,e),no(r.element(),e.highlightClass()),o||e.onHighlight()(n,r)},Ki=function(n,e,t,r){return ro(r.element(),e.highlightClass())},Xi=function(n,e,t,r){var o=Ai(n.element(),"."+e.itemClass());return F.from(o[r]).fold(function(){return Qe.error("No element found with index "+r)},n.getSystem().getByDom)},Ji=function(e,n,t){return Ri(e.element(),"."+n.itemClass()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Qi=function(e,n,t){var r=Ai(e.element(),"."+n.itemClass());return(0<r.length?F.some(r[r.length-1]):F.none()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Zi=function(t,e,n,r){var o=Ai(t.element(),"."+e.itemClass());return On(o,function(n){return ro(n,e.highlightClass())}).bind(function(n){var e=Ui(n,r,0,o.length-1);return t.getSystem().getByDom(o[e]).toOption()})},nu=Object.freeze({dehighlightAll:qi,dehighlight:function(n,e,t,r){var o=Ki(n,e,t,r);eo(r.element(),e.highlightClass()),o&&e.onDehighlight()(n,r)},highlight:Yi,highlightFirst:function(e,t,r){Ji(e,t).each(function(n){Yi(e,t,r,n)})},highlightLast:function(e,t,r){Qi(e,t).each(function(n){Yi(e,t,r,n)})},highlightAt:function(e,t,r,n){Xi(e,t,r,n).fold(function(n){throw new Error(n)},function(n){Yi(e,t,r,n)})},highlightBy:function(e,t,r,n){var o=Ai(e.element(),"."+t.itemClass()),i=Eo(yn(o,function(n){return e.getSystem().getByDom(n).toOption()}));Sn(i,n).each(function(n){Yi(e,t,r,n)})},isHighlighted:Ki,getHighlighted:function(e,n,t){return Ri(e.element(),"."+n.highlightClass()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},getFirst:Ji,getLast:Qi,getPrevious:function(n,e,t){return Zi(n,e,0,-1)},getNext:function(n,e,t){return Zi(n,e,0,1)}}),eu=[Jt("highlightClass"),Jt("itemClass"),jo("onHighlight"),jo("onDehighlight")],tu=zr({fields:eu,name:"highlighting",apis:nu}),ru=function(){return{get:function(n){return vo(n.element())},set:function(n,e){n.getSystem().triggerFocus(e,n.element())}}},ou=function(n,e,c,t,r,i){var u=function(e,t,r,o){var n,i,u=c(e,t,r,o);return(n=u,i=t.event(),Sn(n,function(n){return n.matches(i)}).map(function(n){return n.classification})).bind(function(n){return n(e,t,r,o)})},o={schema:function(){return n.concat([or("focusManager",ru()),Po("handler",o),Po("state",e)])},processKey:u,toEvents:function(r,o){var n=t(r,o),e=sr(i.map(function(t){return lr(Pn(),function(n,e){t(n,r,o,e),e.stop()})}).toArray().concat([lr(U(),function(n,e){u(n,e,r,o).each(function(n){e.stop()})})]));return k(n,e)},toApis:r};return o},iu=function(n){var e=[er("onEscape"),er("onEnter"),or("selector",'[data-alloy-tabstop="true"]'),or("firstTabstop",0),or("useTabstopAt",A(!0)),er("visibilitySelector")].concat([n]),u=function(n,e){var t=n.visibilitySelector().bind(function(n){return Bi(e,n)}).getOr(e);return 0<Ei(t)},c=function(e,n,t,r,o){return o(n,t,function(n){return u(e=r,t=n)&&e.useTabstopAt()(t);var e,t}).fold(function(){return r.cyclic()?F.some(!0):F.none()},function(n){return r.focusManager().set(e,n),F.some(!0)})},i=function(e,n,t,r){var o,i,u=Ai(e.element(),t.selector());return(o=e,i=t,i.focusManager().get(o).bind(function(n){return Bi(n,i.selector())})).bind(function(n){return On(u,l(Re,n)).bind(function(n){return c(e,u,n,t,r)})})},t=A([Wi(zi([Li,Hi([9])]),function(n,e,t,r){var o=t.cyclic()?Vi:Ni;return i(n,0,t,o)}),Wi(Hi([9]),function(n,e,t,r){var o=t.cyclic()?_i:ji;return i(n,0,t,o)}),Wi(Hi([27]),function(e,t,n,r){return n.onEscape().bind(function(n){return n(e,t)})}),Wi(zi([$i,Hi([13])]),function(e,t,n,r){return n.onEnter().bind(function(n){return n(e,t)})})]),r=A({}),o=A({});return ou(e,Nr.init,t,r,o,F.some(function(e,t){var n,r,o,i;(n=e,r=t,o=Ai(n.element(),r.selector()),i=wn(o,function(n){return u(r,n)}),F.from(i[r.firstTabstop()])).each(function(n){t.focusManager().set(e,n)})}))},uu=iu(ur("cyclic",A(!1))),cu=iu(ur("cyclic",A(!0))),au=function(n){return"input"===me(n)&&"radio"!==Gr(n,"type")||"textarea"===me(n)},su=function(n,e,t){return au(t)&&Hi([32])(e.event())?F.none():(re(n,t,Un()),F.some(!0))},fu=[or("execute",su),or("useSpace",!1),or("useEnter",!0),or("useControlEnter",!1),or("useDown",!1)],lu=function(n,e,t){return t.execute()(n,e,n.element())},du=A({}),mu=A({}),gu=ou(fu,Nr.init,function(n,e,t,r){var o=t.useSpace()&&!au(n.element())?[32]:[],i=t.useEnter()?[13]:[],u=t.useDown()?[40]:[],c=o.concat(i).concat(u);return[Wi(Hi(c),lu)].concat(t.useControlEnter()?[Wi(zi([Pi,Hi([13])]),lu)]:[])},du,mu,F.none()),pu=function(n){var t=ao(F.none());return _r({readState:A({}),setGridSize:function(n,e){t.set(F.some({numRows:A(n),numColumns:A(e)}))},getNumRows:function(){return t.get().map(function(n){return n.numRows()})},getNumColumns:function(){return t.get().map(function(n){return n.numColumns()})}})},vu=Object.freeze({flatgrid:pu,init:function(n){return n.state()(n)}}),hu=function(e,t){return function(n){return"rtl"===yu(n)?t:e}},yu=function(n){return"rtl"===yi(n,"direction")?"rtl":"ltr"},bu=function(i){return function(n,e,t,r){var o=i(n.element());return Su(o,n,e,t,r)}},wu=function(n,e){var t=hu(n,e);return bu(t)},xu=function(n,e){var t=hu(e,n);return bu(t)},Tu=function(o){return function(n,e,t,r){return Su(o,n,e,t,r)}},Su=function(e,t,n,r,o){return r.focusManager().get(t).bind(function(n){return e(t.element(),n,r,o)}).map(function(n){return r.focusManager().set(t,n),!0})},Ou=Tu,ku=Tu,Cu=Tu,Eu=function(n){var e,t=n.dom();return!((e=t).offsetWidth<=0&&e.offsetHeight<=0)},Du=Ce(["index","candidates"],[]),Iu=function(n,e,t){return Au(n,e,t)},Au=function(n,e,t,r){var o,i=l(Re,e),u=Ai(n,t),c=wn(u,Eu);return On(o=c,i).map(function(n){return Du({index:n,candidates:o})})},Mu=function(n,e){return On(n,function(n){return Re(e,n)})},Fu=function(t,n,r,e){return e(Math.floor(n/r),n%r).bind(function(n){var e=n.row()*r+n.column();return 0<=e&&e<t.length?F.some(t[e]):F.none()})},Ru=function(o,n,i,u,c){return Fu(o,n,u,function(n,e){var t=n===i-1?o.length-n*u:u,r=Ui(e,c,0,t-1);return F.some({row:A(n),column:A(r)})})},Bu=function(i,n,u,c,a){return Fu(i,n,c,function(n,e){var t=Ui(n,a,0,u-1),r=t===u-1?i.length-t*c:c,o=Gi(e,0,r-1);return F.some({row:A(t),column:A(o)})})},Vu=[Jt("selector"),or("execute",su),Ho("onEscape"),or("captureTab",!1),Wo()],Nu=function(o){return function(n,e,t,r){return Iu(n,e,t.selector()).bind(function(n){return o(n.candidates(),n.index(),r.getNumRows().getOr(t.initSize().numRows()),r.getNumColumns().getOr(t.initSize().numColumns()))})}},_u=function(n,e,t,r){return t.captureTab()?F.some(!0):F.none()},ju=Nu(function(n,e,t,r){return Ru(n,e,t,r,-1)}),Hu=Nu(function(n,e,t,r){return Ru(n,e,t,r,1)}),zu=Nu(function(n,e,t,r){return Bu(n,e,t,r,-1)}),Lu=Nu(function(n,e,t,r){return Bu(n,e,t,r,1)}),Pu=A([Wi(Hi([37]),wu(ju,Hu)),Wi(Hi([39]),xu(ju,Hu)),Wi(Hi([38]),Ou(zu)),Wi(Hi([40]),ku(Lu)),Wi(zi([Li,Hi([9])]),_u),Wi(zi([$i,Hi([9])]),_u),Wi(Hi([27]),function(n,e,t,r){return t.onEscape()(n,e)}),Wi(Hi([32].concat([13])),function(e,t,r,n){return(o=e,i=r,i.focusManager().get(o).bind(function(n){return Bi(n,i.selector())})).bind(function(n){return r.execute()(e,t,n)});var o,i})]),$u=A({}),Wu=ou(Vu,pu,Pu,$u,{},F.some(function(e,t,n){Ri(e.element(),t.selector()).each(function(n){t.focusManager().set(e,n)})})),Uu=function(n,e,t,o){return Iu(n,t,e).bind(function(n){var e=n.index(),t=n.candidates(),r=Ui(e,o,0,t.length-1);return F.from(t[r])})},Gu=[Jt("selector"),or("getInitial",F.none),or("execute",su),or("executeOnMove",!1),or("allowVertical",!0)],qu=function(e,t,r){return(n=e,o=r,o.focusManager().get(n).bind(function(n){return Bi(n,o.selector())})).bind(function(n){return r.execute()(e,t,n)});var n,o},Yu=function(n,e,t){return Uu(n,t.selector(),e,-1)},Ku=function(n,e,t){return Uu(n,t.selector(),e,1)},Xu=function(r){return function(n,e,t){return r(n,e,t).bind(function(){return t.executeOnMove()?qu(n,e,t):F.some(!0)})}},Ju=A({}),Qu=A({}),Zu=ou(Gu,Nr.init,function(n,e,t,r){var o=[37].concat(t.allowVertical()?[38]:[]),i=[39].concat(t.allowVertical()?[40]:[]);return[Wi(Hi(o),Xu(wu(Yu,Ku))),Wi(Hi(i),Xu(xu(Yu,Ku))),Wi(Hi([13]),qu),Wi(Hi([32]),qu)]},Ju,Qu,F.some(function(e,t){t.getInitial()(e).or(Ri(e.element(),t.selector())).each(function(n){t.focusManager().set(e,n)})})),nc=Ce(["rowIndex","columnIndex","cell"],[]),ec=function(n,e,t){return F.from(n[e]).bind(function(n){return F.from(n[t]).map(function(n){return nc({rowIndex:e,columnIndex:t,cell:n})})})},tc=function(n,e,t,r){var o=n[e].length,i=Ui(t,r,0,o-1);return ec(n,e,i)},rc=function(n,e,t,r){var o=Ui(t,r,0,n.length-1),i=n[o].length,u=Gi(e,0,i-1);return ec(n,o,u)},oc=function(n,e,t,r){var o=n[e].length,i=Gi(t+r,0,o-1);return ec(n,e,i)},ic=function(n,e,t,r){var o=Gi(t+r,0,n.length-1),i=n[o].length,u=Gi(e,0,i-1);return ec(n,o,u)},uc=[nr("selectors",[Jt("row"),Jt("cell")]),or("cycles",!0),or("previousSelector",F.none),or("execute",su)],cc=function(n,e){return function(t,r,i){var u=i.cycles()?n:e;return Bi(r,i.selectors().row()).bind(function(n){var e=Ai(n,i.selectors().cell());return Mu(e,r).bind(function(r){var o=Ai(t,i.selectors().row());return Mu(o,n).bind(function(n){var e,t=(e=i,yn(o,function(n){return Ai(n,e.selectors().cell())}));return u(t,n,r).map(function(n){return n.cell()})})})})}},ac=cc(function(n,e,t){return tc(n,e,t,-1)},function(n,e,t){return oc(n,e,t,-1)}),sc=cc(function(n,e,t){return tc(n,e,t,1)},function(n,e,t){return oc(n,e,t,1)}),fc=cc(function(n,e,t){return rc(n,t,e,-1)},function(n,e,t){return ic(n,t,e,-1)}),lc=cc(function(n,e,t){return rc(n,t,e,1)},function(n,e,t){return ic(n,t,e,1)}),dc=A([Wi(Hi([37]),wu(ac,sc)),Wi(Hi([39]),xu(ac,sc)),Wi(Hi([38]),Ou(fc)),Wi(Hi([40]),ku(lc)),Wi(Hi([32].concat([13])),function(e,t,r){return vo(e.element()).bind(function(n){return r.execute()(e,t,n)})})]),mc=A({}),gc=A({}),pc=ou(uc,Nr.init,dc,mc,gc,F.some(function(e,t){t.previousSelector()(e).orThunk(function(){var n=t.selectors();return Ri(e.element(),n.cell())}).each(function(n){t.focusManager().set(e,n)})})),vc=[Jt("selector"),or("execute",su),or("moveOnTab",!1)],hc=function(e,t,r){return r.focusManager().get(e).bind(function(n){return r.execute()(e,t,n)})},yc=function(n,e,t){return Uu(n,t.selector(),e,-1)},bc=function(n,e,t){return Uu(n,t.selector(),e,1)},wc=A([Wi(Hi([38]),Cu(yc)),Wi(Hi([40]),Cu(bc)),Wi(zi([Li,Hi([9])]),function(n,e,t){return t.moveOnTab()?Cu(yc)(n,e,t):F.none()}),Wi(zi([$i,Hi([9])]),function(n,e,t){return t.moveOnTab()?Cu(bc)(n,e,t):F.none()}),Wi(Hi([13]),hc),Wi(Hi([32]),hc)]),xc=A({}),Tc=A({}),Sc=ou(vc,Nr.init,wc,xc,Tc,F.some(function(e,t){Ri(e.element(),t.selector()).each(function(n){t.focusManager().set(e,n)})})),Oc=[Ho("onSpace"),Ho("onEnter"),Ho("onShiftEnter"),Ho("onLeft"),Ho("onRight"),Ho("onTab"),Ho("onShiftTab"),Ho("onUp"),Ho("onDown"),Ho("onEscape"),er("focusIn")],kc=ou(Oc,Nr.init,function(n,e,t){return[Wi(Hi([32]),t.onSpace()),Wi(zi([$i,Hi([13])]),t.onEnter()),Wi(zi([Li,Hi([13])]),t.onShiftEnter()),Wi(zi([Li,Hi([9])]),t.onShiftTab()),Wi(zi([$i,Hi([9])]),t.onTab()),Wi(Hi([38]),t.onUp()),Wi(Hi([40]),t.onDown()),Wi(Hi([37]),t.onLeft()),Wi(Hi([39]),t.onRight()),Wi(Hi([32]),t.onSpace()),Wi(Hi([27]),t.onEscape())]},function(){return{}},function(){return{}},F.some(function(e,t){return t.focusIn().bind(function(n){return n(e,t)})})),Cc=uu.schema(),Ec=cu.schema(),Dc=Zu.schema(),Ic=Wu.schema(),Ac=pc.schema(),Mc=gu.schema(),Fc=Sc.schema(),Rc=kc.schema(),Bc=(ki=Ut("Creating behaviour: "+(Oi={branchKey:"mode",branches:Object.freeze({acyclic:Cc,cyclic:Ec,flow:Dc,flatgrid:Ic,matrix:Ac,execution:Mc,menu:Fc,special:Rc}),name:"keying",active:{events:function(n,e){return n.handler().toEvents(n,e)}},apis:{focusIn:function(n){n.getSystem().triggerFocus(n.element(),n.element())},setGridSize:function(n,e,t,r,o){xt(t,"setGridSize")?t.setGridSize(r,o):p.console.error("Layout does not support setGridSize")}},state:vu}).name,Lr,Oi),Er(Yt(ki.branchKey,ki.branches),ki.name,ki.active,ki.apis,ki.extra,ki.state)),Vc=function(r,n){return e=r,t={},o=yn(n,function(n){return e=n.name(),t="Cannot configure "+n.name()+" for "+r,jt(e,e,rt(),Ft(function(n){return Qe.error("The field: "+e+" is forbidden. "+t)}));var e,t}).concat([ur("dump",h)]),jt(e,e,et(t),Bt(o));var e,t,o},Nc=function(n){return n.dump()},_c="placeholder",jc=Ze([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Hc=function(n,e,t,r){return t.uiType===_c?(i=t,u=r,(o=n).exists(function(n){return n!==i.owner})?jc.single(!0,A(i)):ht(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+R(u)+"]\nNamespace: "+o.getOr("none")+"\nSpec: "+kt(i,null,2))},function(n){return n.replace()})):jc.single(!1,A(t));var o,i,u},zc=function(i,u,c,a){return Hc(i,0,c,a).fold(function(n,e){var t=e(u,c.config,c.validated),r=ht(t,"components").getOr([]),o=Cn(r,function(n){return zc(i,u,n,a)});return[k(t,{components:o})]},function(n,e){return e(u,c.config,c.validated)})},Lc=function(e,t,n,r){var o,i,u,c=V(r,function(n,e){return r=n,o=!1,{name:A(t=e),required:function(){return r.fold(function(n,e){return n},function(n,e){return n})},used:function(){return o},replace:function(){if(!0===o)throw new Error("Trying to use the same placeholder more than once: "+t);return o=!0,r}};var t,r,o}),a=(o=e,i=t,u=c,Cn(n,function(n){return zc(o,i,n,u)}));return B(c,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+kt(t.components(),null,2))}),a},Pc=jc.single,$c=jc.multiple,Wc=A(_c),Uc=0,Gc=function(n){var e=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++Uc+String(e)},qc=Ze([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Yc=or("factory",{sketch:h}),Kc=or("schema",[]),Xc=Jt("name"),Jc=jt("pname","pname",ot(function(n){return"<alloy."+Gc(n.name)+">"}),Kt()),Qc=or("defaults",A({})),Zc=or("overrides",A({})),na=Bt([Yc,Kc,Xc,Jc,Qc,Zc]),ea=Bt([Yc,Kc,Xc,Jc,Qc,Zc]),ta=Bt([Yc,Kc,Xc,Jt("unit"),Jc,Qc,Zc]),ra=function(n){var e=function(n){return n.name()};return n.fold(e,e,e,e)},oa=function(t,r){return function(n){var e=Gt("Converting part type",r,n);return t(e)}},ia=oa(qc.required,na),ua=oa(qc.optional,ea),ca=oa(qc.group,ta),aa=A("entirety"),sa=function(n,e,t,r){var o=t;return k(e.defaults()(n,t,r),t,{uid:n.partUids()[e.name()]},e.overrides()(n,t,r),{"debug.sketcher":yt("part-"+e.name(),o)})},fa=function(o,n){var i={};return bn(n,function(n){var e;(e=n,e.fold(F.some,F.none,F.some,F.some)).each(function(t){var r=la(o,t.pname());i[t.name()]=function(n){var e=Ut("Part: "+t.name()+" in "+o,Bt(t.schema()),n);return k(r,{config:n,validated:e})}})}),i},la=function(n,e){return{uiType:Wc(),owner:n,name:e}},da=function(n,e,t){return r=e,i={},o={},bn(t,function(n){n.fold(function(r){i[r.pname()]=Pc(!0,function(n,e,t){return r.factory().sketch(sa(n,r,e,t))})},function(n){var e=r.parts()[n.name()]();o[n.name()]=A(sa(r,n,e[aa()]()))},function(r){i[r.pname()]=Pc(!1,function(n,e,t){return r.factory().sketch(sa(n,r,e,t))})},function(o){i[o.pname()]=$c(!0,function(e,n,t){var r=e[o.name()]();return yn(r,function(n){return o.factory().sketch(k(o.defaults()(e,n),n,o.overrides()(e,n)))})})})}),{internals:A(i),externals:A(o)};var r,i,o},ma=function(n,e,t){return Lc(F.some(n),e,e.components(),t)},ga=function(n,e,t){var r=e.partUids()[t];return n.getSystem().getByUid(r).toOption()},pa=function(n,e,t){return ga(n,e,t).getOrDie("Could not find part: "+t)},va=function(e,n){var t=yn(n,ra);return bt(yn(t,function(n){return{key:n,value:e+"-"+n}}))},ha=function(e){return jt("partUids","partUids",it(function(n){return va(n.uid,e)}),Kt())},ya=Gc("alloy-premade"),ba=Gc("api"),wa=function(n){return yt(ya,n)},xa=function(o){return n=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];var r=n.config(ba);return o.apply(undefined,[r].concat([n].concat(e)))},e=o.toString(),t=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,t-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:wr(i.slice(1))}},n;var n,e,t,r,i},Ta=A(ba),Sa=A("alloy-id-"),Oa=A("data-alloy-id"),ka=Sa(),Ca=Oa(),Ea=function(n){var e=pe(n)?Gr(n,Ca):null;return F.from(e)},Da=function(n){return Gc(n)},Ia=function(n,e,t,r,o){var i,u,c=(u=o,(0<(i=r).length?[nr("parts",i)]:[]).concat([Jt("uid"),or("dom",{}),or("components",[]),$o("originalSpec"),or("debug.sketcher",{})]).concat(u));return Gt(n+" [SpecSchema]",Rt(c.concat(e)),t)},Aa=function(n,e,t,r,o){var i=Ma(o),u=Cn(t,function(n){return n.fold(F.none,F.some,F.none,F.none).map(function(n){return nr(n.name(),n.schema().concat([$o(aa())]))}).toArray()}),c=ha(t),a=Ia(n,e,i,u,[c]),s=da(0,a,t),f=ma(n,a,s.internals());return k(r(a,f,i,s.externals()),{"debug.sketcher":yt(n,o)})},Ma=function(n){return k({uid:Da("uid")},n)},Fa=Rt([Jt("name"),Jt("factory"),Jt("configFields"),or("apis",{}),or("extraApis",{})]),Ra=Rt([Jt("name"),Jt("factory"),Jt("configFields"),Jt("partFields"),or("apis",{}),or("extraApis",{})]),Ba=function(n){var c=Ut("Sketcher for "+n.name,Fa,n),e=V(c.apis,xa),t=V(c.extraApis,function(n,e){return xr(n,e)});return k({name:A(c.name),partFields:A([]),configFields:A(c.configFields),sketch:function(n){return e=c.name,t=c.configFields,r=c.factory,i=Ma(o=n),u=Ia(e,t,i,[],[]),k(r(u,i),{"debug.sketcher":yt(e,o)});var e,t,r,o,i,u}},e,t)},Va=function(n){var e=Ut("Sketcher for "+n.name,Ra,n),t=fa(e.name,e.partFields),r=V(e.apis,xa),o=V(e.extraApis,function(n,e){return xr(n,e)});return k({name:A(e.name),partFields:A(e.partFields),configFields:A(e.configFields),sketch:function(n){return Aa(e.name,e.configFields,e.partFields,e.factory,n)},parts:A(t)},r,o)},Na=Ba({name:"Button",factory:function(n){var e,t,r,o=(e=n.action(),t=function(n,e){e.stop(),te(n)},r=zn.detect().deviceType.isTouch()?[lr(qn(),t)]:[lr(Y(),t),lr(L(),function(n,e){e.cut()})],sr(kn([e.map(function(t){return lr(Un(),function(n,e){t(n),e.stop()})}).toArray(),r]))),i=ht(n.dom(),"attributes").bind(pt("type")),u=ht(n.dom(),"tag");return{uid:n.uid(),dom:n.dom(),components:n.components(),events:o,behaviours:k(jr([mi.config({}),Bc.config({mode:"execution",useSpace:!0,useEnter:!0})]),Nc(n.buttonBehaviours())),domModification:{attributes:k(i.fold(function(){return u.is("button")?{type:"button"}:{}},function(n){return{}}),{role:n.role().getOr("button")})},eventOrder:n.eventOrder()}},configFields:[or("uid",undefined),Jt("dom"),or("components",[]),Vc("buttonBehaviours",[mi,Bc]),er("action"),er("role"),or("eventOrder",{})]}),_a=zr({fields:[],name:"unselecting",active:Object.freeze({events:function(n){return sr([fr(X(),A(!0))])},exhibit:function(n,e){return Or({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),ja=function(n){var e,t,r,o=ue.fromHtml(n),i=_e(o),u=(t=(e=o).dom().attributes!==undefined?e.dom().attributes:[],Tn(t,function(n,e){return"class"===e.name?n:k(n,yt(e.name,e.value))},{})),c=(r=o,Array.prototype.slice.call(r.dom().classList,0)),a=0===i.length?{}:{innerHtml:xo(o)};return k({tag:me(o),classes:c,attributes:u},a)},Ha=function(n){var e,o,t=(e=n,o={prefix:ai.prefix()},e.replace(/\$\{([^{}]*)\}/g,function(n,e){var t,r=o[e];return"string"==(t=typeof r)||"number"===t?r.toString():n}));return ja(t)},za=function(n){return{dom:Ha(n)}},La=function(n){return jr([ri.config({toggleClass:ai.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),oi(n,function(n,e){(e?ri.on:ri.off)(n)})])},Pa=function(n,e,t){return Na.sketch({dom:Ha('<span class="${prefix}-toolbar-button ${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:e,buttonBehaviours:k(jr([_a.config({})]),t)})},$a={forToolbar:Pa,forToolbarCommand:function(n,e){return Pa(e,function(){n.execCommand(e)},{})},forToolbarStateAction:function(n,e,t,r){var o=La(t);return Pa(e,r,o)},forToolbarStateCommand:function(n,e){var t=La(e);return Pa(e,function(){n.execCommand(e)},t)}},Wa=function(t,r){return{left:A(t),top:A(r),translate:function(n,e){return Wa(t+n,r+e)}}},Ua=Wa,Ga=function(n,e,t){return Math.max(e,Math.min(t,n))},qa=function(n,e,t,r,o,i,u){var c=t-e;if(r<n.left)return e-1;if(r>n.right)return t+1;var a,s,f,l,d=Math.min(n.right,Math.max(r,n.left))-n.left,m=Ga(d/n.width*c+e,e-1,t+1),g=Math.round(m);return i&&e<=m&&m<=t?(a=m,s=e,f=t,l=o,u.fold(function(){var n=a-s,e=Math.round(n/l)*l;return Ga(s+e,s-1,f+1)},function(n){var e=(a-n)%l,t=Math.round(e/l),r=Math.floor((a-n)/l),o=Math.floor((f-n)/l),i=n+Math.min(o,r+t)*l;return Math.max(n,i)})):g},Ya="slider.change.value",Ka=zn.detect().deviceType.isTouch(),Xa=function(n){return function(n){var e=n.event().raw();if(Ka){var t=e;return t.touches!==undefined&&1===t.touches.length?F.some(t.touches[0]).map(function(n){return Ua(n.clientX,n.clientY)}):F.none()}var r=e;return r.clientX!==undefined?F.some(r).map(function(n){return Ua(n.clientX,n.clientY)}):F.none()}(n).map(function(n){return n.left()})},Ja=function(n,e){ee(n,Ya,{value:e})},Qa=function(i,u,c,n){return Xa(n).map(function(n){var e,t,r,o;return e=i,r=n,o=qa(c,(t=u).min(),t.max(),r,t.stepSize(),t.snapToGrid(),t.snapStart()),Ja(e,o),n})},Za=function(n,e){var t,r,o,i,u=(t=e.value().get(),r=e.min(),o=e.max(),i=e.stepSize(),t<r?t:o<t?o:t===r?r-1:Math.max(r,t-i));Ja(n,u)},ns=function(n,e){var t,r,o,i,u=(t=e.value().get(),r=e.min(),o=e.max(),i=e.stepSize(),o<t?t:t<r?r:t===o?o+1:Math.min(o,t+i));Ja(n,u)},es=zn.detect().deviceType.isTouch(),ts=function(n,r){return ua({name:n+"-edge",overrides:function(n){var e=sr([dr(j(),r,[n])]),t=sr([dr(L(),r,[n]),dr(P(),function(n,e){e.mouseIsDown().get()&&r(n,e)},[n])]);return{events:es?e:t}}})},rs=[ts("left",function(n,e){Ja(n,e.min()-1)}),ts("right",function(n,e){Ja(n,e.max()+1)}),ia({name:"thumb",defaults:A({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:sr([gr(j(),n,"spectrum"),gr(H(),n,"spectrum"),gr(z(),n,"spectrum")])}}}),ia({schema:[ur("mouseIsDown",function(){return ao(!1)})],name:"spectrum",overrides:function(r){var t=function(n,e){var t=n.element().dom().getBoundingClientRect();Qa(n,r,t,e)},n=sr([lr(j(),t),lr(H(),t)]),e=sr([lr(L(),t),lr(P(),function(n,e){r.mouseIsDown().get()&&t(n,e)})]);return{behaviours:jr(es?[]:[Bc.config({mode:"special",onLeft:function(n){return Za(n,r),F.some(!0)},onRight:function(n){return ns(n,r),F.some(!0)}}),mi.config({})]),events:es?n:e}}})],os=function(n,e,t){e.store().manager().onLoad(n,e,t)},is=function(n,e,t){e.store().manager().onUnload(n,e,t)},us=Object.freeze({onLoad:os,onUnload:is,setValue:function(n,e,t,r){e.store().manager().setValue(n,e,t,r)},getValue:function(n,e,t){return e.store().manager().getValue(n,e,t)}}),cs=Object.freeze({events:function(t,r){var n=t.resetOnDom()?[vr(function(n,e){os(n,t,r)}),hr(function(n,e){is(n,t,r)})]:[Cr(t,r,os)];return sr(n)}}),as=function(){var n=ao(null);return _r({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})},ss=function(){var n=ao({});return _r({readState:function(){return{mode:"dataset",dataset:n.get()}},set:n.set,get:n.get})},fs=Object.freeze({memory:as,dataset:ss,manual:function(){return _r({readState:function(){}})},init:function(n){return n.store().manager().state(n)}}),ls=function(n,e,t,r){e.store().getDataKey(),t.set({}),e.store().setData()(n,r),e.onSetValue()(n,r)},ds=[er("initialValue"),Jt("getFallbackEntry"),Jt("getDataKey"),Jt("setData"),Po("manager",{setValue:ls,getValue:function(n,e,t){var r=e.store().getDataKey()(n),o=t.get();return ht(o,r).fold(function(){return e.store().getFallbackEntry()(r)},function(n){return n})},onLoad:function(e,t,r){t.store().initialValue().each(function(n){ls(e,t,r,n)})},onUnload:function(n,e,t){t.set({})},state:ss})],ms=[Jt("getValue"),or("setValue",I),er("initialValue"),Po("manager",{setValue:function(n,e,t,r){e.store().setValue()(n,r),e.onSetValue()(n,r)},getValue:function(n,e,t){return e.store().getValue()(n)},onLoad:function(e,t,n){t.store().initialValue().each(function(n){t.store().setValue()(e,n)})},onUnload:I,state:Nr.init})],gs=[er("initialValue"),Po("manager",{setValue:function(n,e,t,r){t.set(r),e.onSetValue()(n,r)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store().initialValue().each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:as})],ps=[ir("store",{mode:"memory"},Yt("mode",{memory:gs,manual:ms,dataset:ds})),jo("onSetValue"),or("resetOnDom",!1)],vs=zr({fields:ps,name:"representing",active:cs,apis:us,extra:{setValueFrom:function(n,e){var t=vs.getValue(e);vs.setValue(n,t)}},state:fs}),hs=zn.detect().deviceType.isTouch(),ys=[Jt("min"),Jt("max"),or("stepSize",1),or("onChange",I),or("onInit",I),or("onDragStart",I),or("onDragEnd",I),or("snapToGrid",!1),er("snapStart"),Jt("getInitialValue"),Vc("sliderBehaviours",[Bc,vs]),ur("value",function(n){return ao(n.min)})].concat(hs?[]:[ur("mouseIsDown",function(){return ao(!1)})]),bs=Si("width",function(n){return n.dom().offsetWidth}),ws=function(n,e){bs.set(n,e)},xs=function(n){return bs.get(n)},Ts=zn.detect().deviceType.isTouch(),Ss=Va({name:"Slider",configFields:ys,partFields:rs,factory:function(a,n,e,t){var s=a.max()-a.min(),f=function(n){var e=n.element().dom().getBoundingClientRect();return(e.left+e.right)/2},o=function(n){return pa(n,a,"thumb")},i=function(n){var e,t,r,o,i=pa(n,a,"spectrum").element().dom().getBoundingClientRect(),u=n.element().dom().getBoundingClientRect(),c=(e=n,t=i,(o=(r=a).value().get())<r.min()?ga(e,r,"left-edge").fold(function(){return 0},function(n){return f(n)-t.left}):o>r.max()?ga(e,r,"right-edge").fold(function(){return t.width},function(n){return f(n)-t.left}):(r.value().get()-r.min())/s*t.width);return i.left-u.left+c},u=function(n){var e=i(n),t=o(n),r=xs(t.element())/2;vi(t.element(),"left",e-r+"px")},r=function(n,e){var t=a.value().get(),r=o(n);return t!==e||wi(r.element(),"left").isNone()?(a.value().set(e),u(n),a.onChange()(n,r,e),F.some(!0)):F.none()},c=Ts?[lr(j(),function(n,e){a.onDragStart()(n,o(n))}),lr(z(),function(n,e){a.onDragEnd()(n,o(n))})]:[lr(L(),function(n,e){e.stop(),a.onDragStart()(n,o(n)),a.mouseIsDown().set(!0)}),lr($(),function(n,e){a.onDragEnd()(n,o(n)),a.mouseIsDown().set(!1)})];return{uid:a.uid(),dom:a.dom(),components:n,behaviours:k(jr(kn([Ts?[]:[Bc.config({mode:"special",focusIn:function(n){return ga(n,a,"spectrum").map(Bc.focusIn).map(A(!0))}})],[vs.config({store:{mode:"manual",getValue:function(n){return a.value().get()}}})]])),Nc(a.sliderBehaviours())),events:sr([lr(Ya,function(n,e){r(n,e.event().value())}),vr(function(n,e){a.value().set(a.getInitialValue()());var t=o(n);u(n),a.onInit()(n,t,a.value().get())})].concat(c)),apis:{resetToMin:function(n){r(n,a.min())},resetToMax:function(n){r(n,a.max())},refresh:u},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),Os=function(e,t,r){return $a.forToolbar(t,function(){var n=r();e.setContextToolbar([{label:t+" group",items:n}])},{})},ks=function(n){return[(o=n,i=function(n){return n<0?"black":360<n?"white":"hsl("+n+", 100%, 50%)"},Ss.sketch({dom:Ha('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[Ss.parts()["left-edge"](za('<div class="${prefix}-hue-slider-black"></div>')),Ss.parts().spectrum({dom:Ha('<div class="${prefix}-slider-gradient-container"></div>'),components:[za('<div class="${prefix}-slider-gradient"></div>')],behaviours:jr([ri.config({toggleClass:ai.resolve("thumb-active")})])}),Ss.parts()["right-edge"](za('<div class="${prefix}-hue-slider-white"></div>')),Ss.parts().thumb({dom:Ha('<div class="${prefix}-slider-thumb"></div>'),behaviours:jr([ri.config({toggleClass:ai.resolve("thumb-active")})])})],onChange:function(n,e,t){var r=i(t);vi(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){ri.on(e)},onDragEnd:function(n,e){ri.off(e)},onInit:function(n,e,t){var r=i(t);vi(e.element(),"background-color",r)},stepSize:10,min:0,max:360,getInitialValue:o.getInitialValue,sliderBehaviours:jr([ii(Ss.refresh)])}))];var o,i},Cs=function(n,r){var e={onChange:function(n,e,t){r.undoManager.transact(function(){r.formatter.apply("forecolor",{value:t}),r.nodeChanged()})},getInitialValue:function(){return-1}};return Os(n,"color",function(){return ks(e)})},Es=Rt([Jt("getInitialValue"),Jt("onChange"),Jt("category"),Jt("sizes")]),Ds=function(n){var o=Ut("SizeSlider",Es,n);return Ss.sketch({dom:{tag:"div",classes:[ai.resolve("slider-"+o.category+"-size-container"),ai.resolve("slider"),ai.resolve("slider-size-container")]},onChange:function(n,e,t){var r;0<=(r=t)&&r<o.sizes.length&&o.onChange(t)},onDragStart:function(n,e){ri.on(e)},onDragEnd:function(n,e){ri.off(e)},min:0,max:o.sizes.length-1,stepSize:1,getInitialValue:o.getInitialValue,snapToGrid:!0,sliderBehaviours:jr([ii(Ss.refresh)]),components:[Ss.parts().spectrum({dom:Ha('<div class="${prefix}-slider-size-container"></div>'),components:[za('<div class="${prefix}-slider-size-line"></div>')]}),Ss.parts().thumb({dom:Ha('<div class="${prefix}-slider-thumb"></div>'),behaviours:jr([ri.config({toggleClass:ai.resolve("thumb-active")})])})]})},Is=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],As=function(n){var e,t,r=n.selection.getStart(),o=ue.fromDom(r),i=ue.fromDom(n.getBody()),u=(e=function(n){return Re(i,n)},(pe(t=o)?F.some(t):Ne(t).filter(pe)).map(function(n){return lo(n,function(n){return wi(n,"font-size").isSome()},e).bind(function(n){return wi(n,"font-size")}).getOrThunk(function(){return yi(n,"font-size")})}).getOr(""));return Sn(Is,function(n){return u===n}).getOr("medium")},Ms={candidates:A(Is),get:function(n){var e,t=As(n);return(e=t,On(Is,function(n){return n===e})).getOr(2)},apply:function(r,n){var e;(e=n,F.from(Is[e])).each(function(n){var e,t;t=n,As(e=r)!==t&&e.execCommand("fontSize",!1,t)})}},Fs=Ms.candidates(),Rs=function(n){return[za('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),(e=n,Ds({onChange:e.onChange,sizes:Fs,category:"font",getInitialValue:e.getInitialValue})),za('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')];var e},Bs=function(n){var e=n.uid!==undefined&&xt(n,"uid")?n.uid:Da("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).fold(F.none,F.some)},asSpec:function(){return k(n,{uid:e})}}},Vs=window.Promise?window.Promise:function(){var i=function(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(n,r(o,this),r(c,this))},n=i.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){p.setTimeout(n,1)};function r(n,e){return function(){return n.apply(e,arguments)}}var t=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};function u(r){var o=this;null!==this._state?n(function(){var n=o._state?r.onFulfilled:r.onRejected;if(null!==n){var e;try{e=n(o._value)}catch(t){return void r.reject(t)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void f(r(e,n),r(o,this),r(c,this))}this._state=!0,this._value=n,a.call(this)}catch(t){c.call(this,t)}}function c(n){this._state=!1,this._value=n,a.call(this)}function a(){for(var n=0,e=this._deferreds;n<e.length;n++){var t=e[n];u.call(this,t)}this._deferreds=[]}function s(n,e,t,r){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.resolve=t,this.reject=r}function f(n,e,t){var r=!1;try{n(function(n){r||(r=!0,e(n))},function(n){r||(r=!0,t(n))})}catch(o){if(r)return;r=!0,t(o)}}return i.prototype["catch"]=function(n){return this.then(null,n)},i.prototype.then=function(t,r){var o=this;return new i(function(n,e){u.call(o,new s(t,r,n,e))})},i.all=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var a=Array.prototype.slice.call(1===n.length&&t(n[0])?n[0]:n);return new i(function(o,i){if(0===a.length)return o([]);var u=a.length;function c(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void t.call(n,function(n){c(e,n)},i)}a[e]=n,0==--u&&o(a)}catch(r){i(r)}}for(var n=0;n<a.length;n++)c(n,a[n])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(n){n(e)})},i.reject=function(t){return new i(function(n,e){e(t)})},i.race=function(o){return new i(function(n,e){for(var t=0,r=o;t<r.length;t++)r[t].then(n,e)})},i}();function Ns(n){return(t=n,new Vs(function(n){var e=new p.FileReader;e.onloadend=function(){n(e.result)},e.readAsDataURL(t)})).then(function(n){return n.split(",")[1]});var t}var _s,js,Hs,zs,Ls,Ps,$s=function(o,i){var n;(n=i,Ns(n)).then(function(r){o.undoManager.transact(function(){var n=o.editorUpload.blobCache,e=n.create(Gc("mceu"),i,r);n.add(e);var t=o.dom.createHTML("img",{src:e.blobUri()});o.insertContent(t)})})},Ws=function(i){var e=Bs({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:sr([pr(Y()),lr(q(),function(n,e){var t,r,o;(t=e,r=t.event(),o=r.raw().target.files||r.raw().dataTransfer.files,F.from(o[0])).each(function(n){$s(i,n)})})])});return Na.sketch({dom:Ha('<span class="${prefix}-toolbar-button ${prefix}-icon-image ${prefix}-icon"></span>'),components:[e.asSpec()],action:function(n){e.get(n).element().dom().click()}})},Us=function(n){return n.dom().textContent},Gs=function(n){return 0<n.length},qs=function(n){return n===undefined||null===n?"":n},Ys=function(e,t,n){return n.text.filter(Gs).fold(function(){return Gr(n=e,"href")===Us(n)?F.some(t):F.none();var n},F.some)},Ks=function(n){var e=ue.fromDom(n.selection.getStart());return Bi(e,"a")},Xs={getInfo:function(n){return Ks(n).fold(function(){return{url:"",text:n.selection.getContent({format:"text"}),title:"",target:"",link:F.none()}},function(n){return t=Us(e=n),r=Gr(e,"href"),o=Gr(e,"title"),i=Gr(e,"target"),{url:qs(r),text:t!==r?qs(t):"",title:qs(o),target:qs(i),link:F.some(e)};var e,t,r,o,i})},applyInfo:function(o,i){i.url.filter(Gs).fold(function(){var e;e=o,i.link.bind(h).each(function(n){e.execCommand("unlink")})},function(e){var n,t,r=(n=i,(t={}).href=e,n.title.filter(Gs).each(function(n){t.title=n}),n.target.filter(Gs).each(function(n){t.target=n}),t);i.link.bind(h).fold(function(){var n=i.text.filter(Gs).getOr(e);o.insertContent(o.dom.createHTML("a",r,o.dom.encode(n)))},function(t){var n=Ys(t,e,i);Ur(t,r),n.each(function(n){var e;e=n,t.dom().textContent=e})})})},query:Ks},Js=zn.detect(),Qs=function(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)},Zs=function(n,e){(Js.os.isAndroid()?Qs:a)(e,n)},nf=function(n,e){var t,r;return{key:n,value:{config:{},me:(t=n,r=sr(e),zr({fields:[Jt("enabled")],name:t,active:{events:A(r)}})),configAsRaw:A({}),initialConfig:{},state:Nr}}},ef=Object.freeze({getCurrent:function(n,e,t){return e.find()(n)}}),tf=[Jt("find")],rf=zr({fields:tf,name:"composing",apis:ef}),of=Ba({name:"Container",factory:function(n){return{uid:n.uid(),dom:k({tag:"div",attributes:{role:"presentation"}},n.dom()),components:n.components(),behaviours:Nc(n.containerBehaviours()),events:n.events(),domModification:n.domModification(),eventOrder:n.eventOrder()}},configFields:[or("components",[]),Vc("containerBehaviours",[]),or("events",{}),or("domModification",{}),or("eventOrder",{})]}),uf=Ba({name:"DataField",factory:function(t){return{uid:t.uid(),dom:t.dom(),behaviours:k(jr([vs.config({store:{mode:"memory",initialValue:t.getInitialValue()()}}),rf.config({find:F.some})]),Nc(t.dataBehaviours())),events:sr([vr(function(n,e){vs.setValue(n,t.getInitialValue()())})])}},configFields:[Jt("uid"),Jt("dom"),Jt("getInitialValue"),Vc("dataBehaviours",[vs,rf])]}),cf=function(n){return n.dom().value},af=function(n,e){if(e===undefined)throw new Error("Value.set was undefined");n.dom().value=e},sf=A([er("data"),or("inputAttributes",{}),or("inputStyles",{}),or("type","input"),or("tag","input"),or("inputClasses",[]),jo("onSetValue"),or("styles",{}),er("placeholder"),or("eventOrder",{}),Vc("inputBehaviours",[vs,mi]),or("selectOnFocus",!0)]),ff=function(n){return k(jr([vs.config({store:{mode:"manual",initialValue:n.data().getOr(undefined),getValue:function(n){return cf(n.element())},setValue:function(n,e){cf(n.element())!==e&&af(n.element(),e)}},onSetValue:n.onSetValue()})]),(e=n,jr([mi.config({onFocus:!1===e.selectOnFocus()?I:function(n){var e=n.element(),t=cf(e);e.dom().setSelectionRange(0,t.length)}})])),Nc(n.inputBehaviours()));var e},lf=Ba({name:"Input",configFields:sf(),factory:function(n,e){return{uid:n.uid(),dom:(t=n,{tag:t.tag(),attributes:k(bt([{key:"type",value:t.type()}].concat(t.placeholder().map(function(n){return{key:"placeholder",value:n}}).toArray())),t.inputAttributes()),styles:t.inputStyles(),classes:t.inputClasses()}),components:[],behaviours:ff(n),eventOrder:n.eventOrder()};var t}}),df=Object.freeze({exhibit:function(n,e){return Or({attributes:bt([{key:e.tabAttr(),value:"true"}])})}}),mf=[or("tabAttr","data-alloy-tabstop")],gf=zr({fields:mf,name:"tabstopping",active:df}),pf=function(n,e){var t=Bs(lf.sketch({placeholder:e,onSetValue:function(n,e){ne(n,G())},inputBehaviours:jr([rf.config({find:F.some}),gf.config({}),Bc.config({mode:"execution"})]),selectOnFocus:!1})),r=Bs(Na.sketch({dom:Ha('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(n){var e=t.get(n);vs.setValue(e,"")}}));return{name:n,spec:of.sketch({dom:Ha('<div class="${prefix}-input-container"></div>'),components:[t.asSpec(),r.asSpec()],containerBehaviours:jr([ri.config({toggleClass:ai.resolve("input-container-empty")}),rf.config({find:function(n){return F.some(t.get(n))}}),nf("input-clearing",[lr(G(),function(n){var e=t.get(n);(0<vs.getValue(e).length?ri.off:ri.on)(n)})])])})}},vf=["input","button","textarea"],hf=function(n,e,t){e.disabled()&&Sf(n,e)},yf=function(n){return hn(vf,me(n.element()))},bf=function(n){Wr(n.element(),"disabled","disabled")},wf=function(n){Yr(n.element(),"disabled")},xf=function(n){Wr(n.element(),"aria-disabled","true")},Tf=function(n){Wr(n.element(),"aria-disabled","false")},Sf=function(e,n,t){n.disableClass().each(function(n){no(e.element(),n)}),(yf(e)?bf:xf)(e)},Of=function(n){return yf(n)?qr(n.element(),"disabled"):"true"===Gr(n.element(),"aria-disabled")},kf=Object.freeze({enable:function(e,n,t){n.disableClass().each(function(n){eo(e.element(),n)}),(yf(e)?wf:Tf)(e)},disable:Sf,isDisabled:Of,onLoad:hf}),Cf=Object.freeze({exhibit:function(n,e,t){return Or({classes:e.disabled()?e.disableClass().map(In).getOr([]):[]})},events:function(n,e){return sr([fr(Un(),function(n,e){return Of(n)}),Cr(n,e,hf)])}}),Ef=[or("disabled",!1),er("disableClass")],Df=zr({fields:Ef,name:"disabling",active:Cf,apis:kf}),If=[Vc("formBehaviours",[vs])],Af=function(n){return"<alloy.field."+n+">"},Mf=function(o,n,e){return k({"debug.sketcher":{Form:e},uid:o.uid(),dom:o.dom(),components:n,behaviours:k(jr([vs.config({store:{mode:"manual",getValue:function(n){var e,t,r=(e=o,t=n.getSystem(),V(e.partUids(),function(n,e){return A(t.getByUid(n))}));return V(r,function(n,e){return n().bind(rf.getCurrent).map(vs.getValue)})},setValue:function(t,n){B(n,function(e,n){ga(t,o,n).each(function(n){rf.getCurrent(n).each(function(n){vs.setValue(n,e)})})})}}})]),Nc(o.formBehaviours())),apis:{getField:function(n,e){return ga(n,o,e).bind(rf.getCurrent)}}})},Ff=(xa(function(n,e,t){return n.getField(e,t)}),function(n){var i,e=(i=[],{field:function(n,e){return i.push(n),t="form",r=Af(n),o=e,{uiType:Wc(),owner:t,name:r,config:o,validated:{}};var t,r,o},record:function(){return i}}),t=n(e),r=e.record(),o=yn(r,function(n){return ia({name:n,pname:Af(n)})});return Aa("form",If,o,Mf,t)}),Rf=function(){var e=ao(F.none()),t=function(){e.get().each(function(n){n.destroy()})};return{clear:function(){t(),e.set(F.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(F.some(n))},run:function(n){e.get().each(n)}}},Bf=function(){var e=ao(F.none());return{clear:function(){e.set(F.none())},set:function(n){e.set(F.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}},Vf=function(n){return{xValue:n,points:[]}},Nf=function(n,e){if(e===n.xValue)return n;var t=0<e-n.xValue?1:-1,r={direction:t,xValue:e};return{xValue:e,points:(0===n.points.length?[]:n.points[n.points.length-1].direction===t?n.points.slice(0,n.points.length-1):n.points).concat([r])}},_f=function(n){if(0===n.points.length)return 0;var e=n.points[0].direction,t=n.points[n.points.length-1].direction;return-1===e&&-1===t?-1:1===e&&1===t?1:0},jf=function(n){var r="navigateEvent",e=Bt([Jt("fields"),or("maxFieldIndex",n.fields.length-1),Jt("onExecute"),Jt("getInitialValue"),ur("state",function(){return{dialogSwipeState:Bf(),currentScreen:ao(0)}})]),u=Ut("SerialisedDialog",e,n),o=function(e,n,t){return Na.sketch({dom:Ha('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){ee(n,r,{direction:e})},buttonBehaviours:jr([Df.config({disableClass:ai.resolve("toolbar-navigation-disabled"),disabled:!t})])})},i=function(n,o){var i=Ai(n.element(),"."+ai.resolve("serialised-dialog-screen"));Ri(n.element(),"."+ai.resolve("serialised-dialog-chain")).each(function(r){0<=u.state.currentScreen.get()+o&&u.state.currentScreen.get()+o<i.length&&(wi(r,"left").each(function(n){var e=parseInt(n,10),t=xs(i[0]);vi(r,"left",e-o*t+"px")}),u.state.currentScreen.set(u.state.currentScreen.get()+o))})},c=function(r){var n=Ai(r.element(),"input");F.from(n[u.state.currentScreen.get()]).each(function(n){r.getSystem().getByDom(n).each(function(n){var e,t;e=r,t=n.element(),e.getSystem().triggerFocus(t,e.element())})});var e=s.get(r);tu.highlightAt(e,u.state.currentScreen.get())},a=Bs(Ff(function(t){return{dom:Ha('<div class="${prefix}-serialised-dialog"></div>'),components:[of.sketch({dom:Ha('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:yn(u.fields,function(n,e){return e<=u.maxFieldIndex?of.sketch({dom:Ha('<div class="${prefix}-serialised-dialog-screen"></div>'),components:kn([[o(-1,"previous",0<e)],[t.field(n.name,n.spec)],[o(1,"next",e<u.maxFieldIndex)]])}):t.field(n.name,n.spec)})})],formBehaviours:jr([ii(function(n,e){var t;t=e,Ri(n.element(),"."+ai.resolve("serialised-dialog-chain")).each(function(n){vi(n,"left",-u.state.currentScreen.get()*t.width+"px")})}),Bc.config({mode:"special",focusIn:function(n){c(n)},onTab:function(n){return i(n,1),F.some(!0)},onShiftTab:function(n){return i(n,-1),F.some(!0)}}),nf("form-events",[vr(function(e,n){u.state.currentScreen.set(0),u.state.dialogSwipeState.clear();var t=s.get(e);tu.highlightFirst(t),u.getInitialValue(e).each(function(n){vs.setValue(e,n)})}),br(u.onExecute),lr(K(),function(n,e){"left"===e.event().raw().propertyName&&c(n)}),lr(r,function(n,e){var t=e.event().direction();i(n,t)})])])}})),s=Bs({dom:Ha('<div class="${prefix}-dot-container"></div>'),behaviours:jr([tu.config({highlightClass:ai.resolve("dot-active"),itemClass:ai.resolve("dot-item")})]),components:Cn(u.fields,function(n,e){return e<=u.maxFieldIndex?[za('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})});return{dom:Ha('<div class="${prefix}-serializer-wrapper"></div>'),components:[a.asSpec(),s.asSpec()],behaviours:jr([Bc.config({mode:"special",focusIn:function(n){var e=a.get(n);Bc.focusIn(e)}}),nf("serializer-wrapper-events",[lr(j(),function(n,e){var t=e.event();u.state.dialogSwipeState.set(Vf(t.touches[0].clientX))}),lr(H(),function(n,e){var t=e.event();u.state.dialogSwipeState.on(function(n){e.event().prevent(),u.state.dialogSwipeState.set(Nf(n,t.raw().touches[0].clientX))})}),lr(z(),function(r){u.state.dialogSwipeState.on(function(n){var e=a.get(r),t=-1*_f(n);i(e,t)})})])])}},Hf=J(function(t,r){return[{label:"the link group",items:[jf({fields:[pf("url","Type or paste URL"),pf("text","Link text"),pf("title","Link title"),pf("target","Link target"),(n="link",{name:n,spec:uf.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return F.none()}})})],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return F.some(Xs.getInfo(r))},onExecute:function(n){var e=vs.getValue(n);Xs.applyInfo(r,e),t.restoreToolbar(),r.focus()}})]}];var n}),zf=[{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"}]}],Lf=sr([(_s=Pn(),js=function(n,e){var t,r,o=e.event().originator(),i=e.event().target();return r=i,!(Re(t=o,n.element())&&!Re(t,r)&&(p.console.warn(Pn()+" did not get interpreted by the desired target. \nOriginator: "+ko(o)+"\nTarget: "+ko(i)+"\nCheck the "+Pn()+" event handlers"),1))},{key:_s,value:cr({can:js})})]),Pf=Object.freeze({events:Lf}),$f=h,Wf=Vr(["debugInfo","triggerFocus","triggerEvent","triggerEscape","addToWorld","removeFromWorld","addToGui","removeFromGui","build","getByUid","getByDom","broadcast","broadcastOn","isConnected"]),Uf=function(e){var n=function(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+ko(e().element())+" is not in context.")}};return Wf({debugInfo:A("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),isConnected:A(!1)})},Gf=function(n,o){var i={};return B(n,function(n,r){B(n,function(n,e){var t=vt(e,[])(i);i[e]=t.concat([o(r,n)])})}),i},qf=function(n,e){return 1<n.length?Qe.error('Multiple behaviours have tried to change DOM "'+e+'". The guilty behaviours are: '+kt(yn(n,function(n){return n.name()}))+". At this stage, this is not supported. Future releases might provide strategies for resolving this."):0===n.length?Qe.value({}):Qe.value(n[0].modification().fold(function(){return{}},function(n){return yt(e,n)}))},Yf=function(u,c){return Tn(u,function(n,e){var t=e.modification().getOr({});return n.bind(function(i){var n=_(t,function(n,e){return i[e]!==undefined?(t=c,r=e,o=u,Qe.error("Mulitple behaviours have tried to change the _"+r+'_ "'+t+'". The guilty behaviours are: '+kt(Cn(o,function(n){return n.modification().getOr({})[r]!==undefined?[n.name()]:[]}),null,2)+". This is not currently supported.")):Qe.value(yt(e,n));var t,r,o});return wt(n,i)})},Qe.value({})).map(function(n){return yt(c,n)})},Kf={classes:function(n,e){var t=Cn(n,function(n){return n.modification().getOr([])});return Qe.value(yt(e,t))},attributes:Yf,styles:Yf,domChildren:qf,defChildren:qf,innerHtml:qf,value:qf},Xf=function(n,e){return t=l.apply(undefined,[n.handler].concat(e)),r=n.purpose(),{cHandler:t,purpose:A(r)};var t,r},Jf=function(n){return n.cHandler},Qf=function(n,e){return{name:A(n),handler:A(e)}},Zf=function(n,e,t){var r,o,i=k(t,(r=n,o={},bn(e,function(n){o[n.name()]=n.handlers(r)}),o));return Gf(i,Qf)},nl=function(n){var e,i=w(e=n)?{can:A(!0),abort:A(!1),run:e}:e;return function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var o=[n,e].concat(t);i.abort.apply(undefined,o)?e.stop():i.can.apply(undefined,o)&&i.run.apply(undefined,o)}},el=function(n,e,t){var r,o,i=e[t];return i?function(u,c,n,a){var e=n.slice(0);try{var t=e.sort(function(n,e){var t=n[c](),r=e[c](),o=a.indexOf(t),i=a.indexOf(r);if(-1===o)throw new Error("The ordering for "+u+" does not have an entry for "+t+".\nOrder specified: "+kt(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+r+".\nOrder specified: "+kt(a,null,2));return o<i?-1:i<o?1:0});return Qe.value(t)}catch(r){return Qe.error([r])}}("Event: "+t,"name",n,i).map(function(n){var e=yn(n,function(n){return n.handler()});return ar(e)}):(r=t,o=n,Qe.error(["The event ("+r+') 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: '+kt(yn(o,function(n){return n.name()}),null,2)]))},tl=function(n,i){var e=_(n,function(r,o){return(1===r.length?Qe.value(r[0].handler()):el(r,i,o)).map(function(n){var e=nl(n),t=1<r.length?wn(i,function(e){return hn(r,function(n){return n.name()===e})}).join(" > "):r[0].name();return yt(o,{handler:e,purpose:A(t)})})});return wt(e,{})},rl=function(n){return $t("custom.definition",Rt([jt("dom","dom",tt(),Rt([Jt("tag"),or("styles",{}),or("classes",[]),or("attributes",{}),er("value"),er("innerHtml")])),Jt("components"),Jt("uid"),or("events",{}),or("apis",A({})),jt("eventOrder","eventOrder",(e={"alloy.execute":["disabling","alloy.base.behaviour","toggling"],"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"]},nt.mergeWithThunk(A(e))),Kt()),er("domModification"),$o("originalSpec"),or("debug.sketcher","unknown")]),n);var e},ol=function(n){var e,t={tag:n.dom().tag(),classes:n.dom().classes(),attributes:k((e=n,yt(Oa(),e.uid())),n.dom().attributes()),styles:n.dom().styles(),domChildren:yn(n.components(),function(n){return n.element()})};return Tr(k(t,n.dom().innerHtml().map(function(n){return yt("innerHtml",n)}).getOr({}),n.dom().value().map(function(n){return yt("value",n)}).getOr({})))},il=function(e,n){bn(n,function(n){no(e,n)})},ul=function(e,n){bn(n,function(n){eo(e,n)})},cl=function(e){if(e.domChildren().isSome()&&e.defChildren().isSome())throw new Error("Cannot specify children and child specs! Must be one or the other.\nDef: "+(n=Sr(e),kt(n,null,2)));return e.domChildren().fold(function(){var n=e.defChildren().getOr([]);return yn(n,sl)},function(n){return n});var n},al=function(n){var e=ue.fromTag(n.tag());Ur(e,n.attributes().getOr({})),il(e,n.classes().getOr([])),hi(e,n.styles().getOr({})),To(e,n.innerHtml().getOr(""));var t=cl(n);return Le(e,t),n.value().each(function(n){af(e,n)}),e},sl=function(n){var e=Tr(n);return al(e)},fl=function(n,e){return t=n,o=yn(r=e,function(n){return tr(n.name(),[Jt("config"),or("state",Nr)])}),i=$t("component.behaviours",Bt(o),t.behaviours).fold(function(n){throw new Error(qt(n)+"\nComplete spec:\n"+kt(t,null,2))},function(n){return n}),{list:r,data:V(i,function(n){var e=n().map(function(n){return{config:n.config(),state:n.state().init(n.config())}});return function(){return e}})};var t,r,o,i},ll=function(n){var e,t,r=(e=ht(n,"behaviours").getOr({}),t=wn(R(e),function(n){return e[n]!==undefined}),yn(t,function(n){return e[n].me}));return fl(n,r)},dl=Vr(["getSystem","config","hasConfigured","spec","connect","disconnect","element","syncComponents","readState","components","events"]),ml=function(n,e,t){var r,o,i,u,c=ol(n),a=function(e,n,t,r){var o=k({},n);bn(t,function(n){o[n.name()]=n.exhibit(e,r)});var i=Gf(o,function(n,e){return{name:function(){return n},modification:e}}),u=V(i,function(n,e){return Cn(n,function(e){return e.modification().fold(function(){return[]},function(n){return[e]})})}),c=_(u,function(e,t){return ht(Kf,t).fold(function(){return Qe.error("Unknown field type: "+t)},function(n){return n(e,t)})});return wt(c,{}).map(Or)}(t,{"alloy.base.modification":(r=n,r.domModification().fold(function(){return Or({})},Or))},e,c).getOrDie();return i=a,u=k({tag:(o=c).tag(),classes:i.classes().getOr([]).concat(o.classes().getOr([])),attributes:C(o.attributes().getOr({}),i.attributes().getOr({})),styles:C(o.styles().getOr({}),i.styles().getOr({}))},i.innerHtml().or(o.innerHtml()).map(function(n){return yt("innerHtml",n)}).getOr({}),kr("domChildren",i.domChildren(),o.domChildren()),kr("defChildren",i.defChildren(),o.defChildren()),i.value().or(o.value()).map(function(n){return yt("value",n)}).getOr({})),Tr(u)},gl=function(n,e,t){var r,o,i,u,c,a,s={"alloy.base.behaviour":(r=n,r.events())};return(o=t,i=n.eventOrder(),u=e,c=s,a=Zf(o,u,c),tl(a,i)).getOrDie()},pl=function(n){var e,t,r,o,i,u,c,a,s,f,l,d,m,g,p=$f(n),v=(e=p,t=vt("components",[])(e),yn(t,yl)),h=k(Pf,p,yt("components",v));return Qe.value((r=h,i=ao(Uf(o=function(){return g})),u=Wt(rl(k(r,{behaviours:undefined}))),c=ll(r),a=c.list,s=c.data,f=ml(u,a,s),l=al(f),d=gl(u,a,s),m=ao(u.components()),g=dl({getSystem:i.get,config:function(n){if(n===Ta())return u.apis();if(y(n))throw new Error("Invalid input: only API constant is allowed");var e=s;return(w(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+kt(r,null,2))})()},hasConfigured:function(n){return w(s[n.name()])},spec:A(r),readState:function(n){return s[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},connect:function(n){i.set(n)},disconnect:function(){i.set(Uf(o))},element:A(l),syncComponents:function(){var n=_e(l),e=Cn(n,function(n){return i.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});m.set(e)},components:m.get,events:A(d)})))},vl=function(n){var e=ue.fromText(n);return hl({element:e})},hl=function(n){var t=Gt("external.component",Rt([Jt("element"),er("uid")]),n),e=ao(Uf());t.uid().each(function(n){var e;e=t.element(),Wr(e,Ca,n)});var r=dl({getSystem:e.get,config:F.none,hasConfigured:A(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(Uf(function(){return r}))},element:A(t.element()),spec:A(n),readState:A("No state"),syncComponents:I,components:A([]),events:A({})});return wa(r)},yl=function(e){return(n=e,ht(n,ya)).fold(function(){var n=k({uid:Da("")},e);return pl(n).getOrDie()},function(n){return n});var n},bl=wa,wl="alloy.item-hover",xl="alloy.item-focus",Tl=function(n){(vo(n.element()).isNone()||mi.isFocused(n))&&(mi.isFocused(n)||mi.focus(n),ee(n,wl,{item:n}))},Sl=function(n){ee(n,xl,{item:n})},Ol=A(wl),kl=A(xl),Cl=[Jt("data"),Jt("components"),Jt("dom"),er("toggling"),or("itemBehaviours",{}),or("ignoreFocus",!1),or("domModification",{}),Po("builder",function(n){return{dom:k(n.dom(),{attributes:{role:n.toggling().isSome()?"menuitemcheckbox":"menuitem"}}),behaviours:k(jr([n.toggling().fold(ri.revoke,function(n){return ri.config(k({aria:{mode:"checked"}},n))}),mi.config({ignore:n.ignoreFocus(),onFocus:function(n){Sl(n)}}),Bc.config({mode:"execution"}),vs.config({store:{mode:"memory",initialValue:n.data()}})]),n.itemBehaviours()),events:sr([(e=Yn(),r=te,lr(e,function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){r(e,n,t)})})),pr(L()),lr(W(),Tl),lr(Gn(),mi.focus)]),components:n.components(),domModification:n.domModification(),eventOrder:n.eventOrder()};var e,r}),or("eventOrder",{})],El=[Jt("dom"),Jt("components"),Po("builder",function(n){return{dom:n.dom(),components:n.components(),events:sr([(e=Gn(),lr(e,function(n,e){e.stop()}))])};var e})],Dl=A([ia({name:"widget",overrides:function(e){return{behaviours:jr([vs.config({store:{mode:"manual",getValue:function(n){return e.data()},setValue:function(){}}})])}}})]),Il=[Jt("uid"),Jt("data"),Jt("components"),Jt("dom"),or("autofocus",!1),or("domModification",{}),ha(Dl()),Po("builder",function(t){var n=da(0,t,Dl()),e=ma("item-widget",t,n.internals()),r=function(n){return ga(n,t,"widget").map(function(n){return Bc.focusIn(n),n})},o=function(n,e){return au(e.event().target())||t.autofocus()&&e.setSource(n.element()),F.none()};return k({dom:t.dom(),components:e,domModification:t.domModification(),events:sr([br(function(n,e){r(n).each(function(n){e.stop()})}),lr(W(),Tl),lr(Gn(),function(n,e){t.autofocus()?r(n):mi.focus(n)})]),behaviours:jr([vs.config({store:{mode:"memory",initialValue:t.data()}}),mi.config({onFocus:function(n){Sl(n)}}),Bc.config({mode:"special",focusIn:t.autofocus()?function(n){r(n)}:Pr(),onLeft:o,onRight:o,onEscape:function(n,e){return mi.isFocused(n)||t.autofocus()?(t.autofocus()&&e.setSource(n.element()),F.none()):(mi.focus(n),F.some(!0))}})])})})],Al=Yt("type",{widget:Il,item:Cl,separator:El}),Ml=A([ca({factory:{sketch:function(n){var e=Gt("menu.spec item",Al,n);return e.builder()(e)}},name:"items",unit:"item",defaults:function(n,e){var t=Da("");return k({uid:t},e)},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus(),domModification:{classes:[n.markers().item()]}}}})]),Fl=A([Jt("value"),Jt("items"),Jt("dom"),Jt("components"),or("eventOrder",{}),Vc("menuBehaviours",[tu,vs,rf,Bc]),ir("movement",{mode:"menu",moveOnTab:!0},Yt("mode",{grid:[Wo(),Po("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers().item(),initSize:{numColumns:e.initSize().numColumns(),numRows:e.initSize().numRows()},focusManager:n.focusManager()}})],menu:[or("moveOnTab",!0),Po("config",function(n,e){return{mode:"menu",selector:"."+n.markers().item(),moveOnTab:e.moveOnTab(),focusManager:n.focusManager()}})]})),Qt("markers",Vo()),or("fakeFocus",!1),or("focusManager",ru()),jo("onHighlight")]),Rl=A("alloy.menu-focus"),Bl=Va({name:"Menu",configFields:Fl(),partFields:Ml(),factory:function(n,e,t,r){return k({dom:k(n.dom(),{attributes:{role:"menu"}}),uid:n.uid(),behaviours:k(jr([tu.config({highlightClass:n.markers().selectedItem(),itemClass:n.markers().item(),onHighlight:n.onHighlight()}),vs.config({store:{mode:"memory",initialValue:n.value()}}),rf.config({find:F.some}),Bc.config(n.movement().config()(n,n.movement()))]),Nc(n.menuBehaviours())),events:sr([lr(kl(),function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){tu.highlight(e,n),t.stop(),ee(e,Rl(),{menu:e,item:n})})}),lr(Ol(),function(n,e){var t=e.event().item();tu.highlight(n,t)})]),components:e,eventOrder:n.eventOrder()})}}),Vl=function(n,t){var r=Be(t),e=po(r).bind(function(e){var o,i,n=function(n){return Re(e,n)};return n(t)?F.some(t):(o=n,(i=function(n){for(var e=0;e<n.childNodes.length;e++){var t=ue.fromDom(n.childNodes[e]);if(o(t))return F.some(t);var r=i(n.childNodes[e]);if(r.isSome())return r}return F.none()})(t.dom()))}),o=n(t);return e.each(function(e){po(r).filter(function(n){return Re(n,e)}).fold(function(){mo(e)},I)}),o},Nl=function(n,e,t,r){var o=n.getSystem().build(r);qe(n,o,t)},_l=function(n,e){return n.components()},jl=zr({fields:[],name:"replacing",apis:Object.freeze({append:function(n,e,t,r){Nl(n,0,ze,r)},prepend:function(n,e,t,r){Nl(n,0,He,r)},remove:function(n,e,t,r){var o=_l(n);Sn(o,function(n){return Re(r.element(),n.element())}).each(Ke)},set:function(e,n,t,r){var o,i;i=(o=e).components(),bn(i,Ye),Pe(o.element()),o.syncComponents(),Vl(function(){var n=yn(r,e.getSystem().build);bn(n,function(n){Ge(e,n)})},e.element())},contents:_l})}),Hl=function(t,r,o,n){return ht(o,n).bind(function(n){return ht(t,n).bind(function(n){var e=Hl(t,r,o,n);return F.some([n].concat(e))})}).getOr([])},zl=function(n,e){var t={};B(n,function(n,e){bn(n,function(n){t[n]=e})});var r=e,o=N(e,function(n,e){return{k:n,v:e}}),i=V(o,function(n,e){return[e].concat(Hl(t,r,o,e))});return V(t,function(n){return ht(i,n).getOr([n])})},Ll=function(){var i=ao({}),u=ao({}),c=ao({}),a=ao(F.none()),s=ao({}),n=function(n){return ht(u.get(),n)};return{setContents:function(n,e,t,r){a.set(F.some(n)),i.set(t),u.set(e),s.set(r);var o=zl(r,t);c.set(o)},expand:function(t){return ht(i.get(),t).map(function(n){var e=ht(c.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return ht(c.get(),n)},collapse:function(n){return ht(c.get(),n).bind(function(n){return 1<n.length?F.some(n.slice(1)):F.none()})},lookupMenu:n,otherMenus:function(n){var e,t,r=s.get();return e=R(r),t=n,wn(e,function(n){return!hn(t,n)})},getPrimary:function(){return a.get().bind(n)},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),c.set({}),a.set(F.none())},isClear:function(){return a.get().isNone()}}},Pl=A("collapse-item"),$l=Ba({name:"TieredMenu",configFields:[Lo("onExecute"),Lo("onEscape"),zo("onOpenMenu"),zo("onOpenSubmenu"),jo("onCollapseMenu"),or("openImmediately",!0),nr("data",[Jt("primary"),Jt("menus"),Jt("expansions")]),or("fakeFocus",!1),jo("onHighlight"),jo("onHover"),nr("markers",[Jt("backgroundMenu")].concat(Ro()).concat(Bo())),Jt("dom"),or("navigateOnHover",!0),or("stayInDom",!1),Vc("tmenuBehaviours",[Bc,tu,rf,jl]),or("eventOrder",{})],apis:{collapseMenu:function(n,e){n.collapseMenu(e)}},factory:function(u,o){var i=function(r,n){return V(n,function(n,e){var t=Bl.sketch(k(n,{value:e,items:n.items,markers:mt(o.markers,["item","selectedItem"]),fakeFocus:u.fakeFocus(),onHighlight:u.onHighlight(),focusManager:u.fakeFocus()?{get:function(n){return tu.getHighlighted(n).map(function(n){return n.element()})},set:function(e,n){e.getSystem().getByDom(n).fold(I,function(n){tu.highlight(e,n)})}}:ru()}));return r.getSystem().build(t)})},c=Ll(),a=function(n){return vs.getValue(n).value},s=function(n){return V(u.data().menus(),function(n,e){return Cn(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})},f=function(e,n){tu.highlight(e,n),tu.getHighlighted(n).orThunk(function(){return tu.getFirst(n)}).each(function(n){re(e,n.element(),Gn())})},l=function(n,e){return Eo(yn(e,n.lookupMenu))},d=function(r,o,i){return F.from(i[0]).bind(o.lookupMenu).map(function(n){var e=l(o,i.slice(1));bn(e,function(n){no(n.element(),u.markers().backgroundMenu())}),he(n.element())||jl.append(r,bl(n)),ul(n.element(),[u.markers().backgroundMenu()]),f(r,n);var t=l(o,o.otherMenus(i));return bn(t,function(n){ul(n.element(),[u.markers().backgroundMenu()]),u.stayInDom()||jl.remove(r,n)}),n})},m=function(e,t){var n=a(t);return c.expand(n).bind(function(n){return F.from(n[0]).bind(c.lookupMenu).each(function(n){he(n.element())||jl.append(e,bl(n)),u.onOpenSubmenu()(e,t,n),tu.highlightFirst(n)}),d(e,c,n)})},r=function(e,t){var n=a(t);return c.collapse(n).bind(function(n){return d(e,c,n).map(function(n){return u.onCollapseMenu()(e,t,n),n})})},n=function(t){return function(e,n){return Bi(n.getSource(),"."+u.markers().item()).bind(function(n){return e.getSystem().getByDom(n).toOption().bind(function(n){return t(e,n).map(function(){return!0})})})}},e=sr([lr(Rl(),function(n,e){var t=e.event().menu();tu.highlight(n,t)}),br(function(e,n){var t=n.event().target();e.getSystem().getByDom(t).each(function(n){0===a(n).indexOf("collapse-item")&&r(e,n),m(e,n).fold(function(){u.onExecute()(e,n)},function(){})})}),vr(function(e,n){var t,r,o;(t=e,r=i(t,u.data().menus()),o=s(),c.setContents(u.data().primary(),r,u.data().expansions(),o),c.getPrimary()).each(function(n){jl.append(e,bl(n)),u.openImmediately()&&(f(e,n),u.onOpenMenu()(e,n))})})].concat(u.navigateOnHover()?[lr(Ol(),function(n,e){var t,r,o=e.event().item();t=n,r=a(o),c.refresh(r).bind(function(n){return d(t,c,n)}),m(n,o),u.onHover()(n,o)})]:[]));return{uid:u.uid(),dom:u.dom(),behaviours:k(jr([Bc.config({mode:"special",onRight:n(function(n,e){return au(e.element())?F.none():m(n,e)}),onLeft:n(function(n,e){return au(e.element())?F.none():r(n,e)}),onEscape:n(function(n,e){return r(n,e).orThunk(function(){return u.onEscape()(n,e).map(function(){return n})})}),focusIn:function(e,n){c.getPrimary().each(function(n){re(e,n.element(),Gn())})}}),tu.config({highlightClass:u.markers().selectedMenu(),itemClass:u.markers().menu()}),rf.config({find:function(n){return tu.getHighlighted(n)}}),jl.config({})]),Nc(u.tmenuBehaviours())),eventOrder:u.eventOrder(),apis:{collapseMenu:function(e){tu.getHighlighted(e).each(function(n){tu.getHighlighted(n).each(function(n){r(e,n)})})}},events:e}},extraApis:{tieredData:function(n,e,t){return{primary:n,menus:e,expansions:t}},singleData:function(n,e){return{primary:n,menus:yt(n,e),expansions:{}}},collapseItem:function(n){return{value:Gc(Pl()),text:n}}}}),Wl=function(n,e,t,r){return ht(e.routes(),r.start()).map(a).bind(function(n){return ht(n,r.destination()).map(a)})},Ul=function(n,e,t,r){return Wl(0,e,0,r).bind(function(e){return e.transition().map(function(n){return{transition:A(n),route:A(e)}})})},Gl=function(t,r,n){var e,o,i;(e=t,o=r,i=n,ql(e,o).bind(function(n){return Ul(e,o,i,n)})).each(function(n){var e=n.transition();eo(t.element(),e.transitionClass()),Yr(t.element(),r.destinationAttr())})},ql=function(n,e,t){var r=n.element();return qr(r,e.destinationAttr())?F.some({start:A(Gr(n.element(),e.stateAttr())),destination:A(Gr(n.element(),e.destinationAttr()))}):F.none()},Yl=function(n,e,t,r){Gl(n,e,t),qr(n.element(),e.stateAttr())&&Gr(n.element(),e.stateAttr())!==r&&e.onFinish()(n,r),Wr(n.element(),e.stateAttr(),r)},Kl=Object.freeze({findRoute:Wl,disableTransition:Gl,getCurrentRoute:ql,jumpTo:Yl,progressTo:function(t,r,o,i){var n,e;e=r,qr((n=t).element(),e.destinationAttr())&&(Wr(n.element(),e.stateAttr(),Gr(n.element(),e.destinationAttr())),Yr(n.element(),e.destinationAttr()));var u,c,a=(u=r,c=i,{start:A(Gr(t.element(),u.stateAttr())),destination:A(c)});Ul(t,r,o,a).fold(function(){Yl(t,r,o,i)},function(n){Gl(t,r,o);var e=n.transition();no(t.element(),e.transitionClass()),Wr(t.element(),r.destinationAttr(),i)})},getState:function(n,e,t){var r=n.element();return qr(r,e.stateAttr())?F.some(Gr(r,e.stateAttr())):F.none()}}),Xl=Object.freeze({events:function(o,i){return sr([lr(K(),function(t,n){var r=n.event().raw();ql(t,o).each(function(e){Wl(0,o,0,e).each(function(n){n.transition().each(function(n){r.propertyName===n.property()&&(Yl(t,o,i,e.destination()),o.onTransition()(t,e))})})})}),vr(function(n,e){Yl(n,o,i,o.initialState())})])}}),Jl=[or("destinationAttr","data-transitioning-destination"),or("stateAttr","data-transitioning-state"),Jt("initialState"),jo("onTransition"),jo("onFinish"),Qt("routes",Vt(Qe.value,Vt(Qe.value,Rt([rr("transition",[Jt("property"),Jt("transitionClass")])]))))],Ql=zr({fields:Jl,name:"transitioning",active:Xl,apis:Kl,extra:{createRoutes:function(n){var r={};return B(n,function(n,e){var t=e.split("<->");r[t[0]]=yt(t[1],n),r[t[1]]=yt(t[0],n)}),r},createBistate:function(n,e,t){return bt([{key:n,value:yt(e,t)},{key:e,value:yt(n,t)}])},createTristate:function(n,e,t,r){return bt([{key:n,value:bt([{key:e,value:r},{key:t,value:r}])},{key:e,value:bt([{key:n,value:r},{key:t,value:r}])},{key:t,value:bt([{key:n,value:r},{key:e,value:r}])}])}}}),Zl=ai.resolve("scrollable"),nd={register:function(n){no(n,Zl)},deregister:function(n){eo(n,Zl)},scrollable:A(Zl)},ed=function(n){return ht(n,"format").getOr(n.title)},td=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[ai.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:ai.resolve("format-matches"),selected:t},itemBehaviours:jr(o?[]:[oi(n,function(n,e){(e?ri.on:ri.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},rd=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[Na.sketch({dom:{tag:"div",classes:[ai.resolve("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[ai.resolve("styles-collapse-icon")]}},vl(n)]:[vl(n)],action:function(n){if(r){var e=t().get(n);$l.collapseMenu(e)}}}),{dom:{tag:"div",classes:[ai.resolve("styles-menu-items-container")]},components:[Bl.parts().items({})],behaviours:jr([nf("adhoc-scrollable-menu",[vr(function(n,e){vi(n.element(),"overflow-y","auto"),vi(n.element(),"-webkit-overflow-scrolling","touch"),nd.register(n.element())}),hr(function(n){xi(n.element(),"overflow-y"),xi(n.element(),"-webkit-overflow-scrolling"),nd.deregister(n.element())})])])}],items:e,menuBehaviours:jr([Ql.config({initialState:"after",routes:Ql.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},od=function(r){var o,i,n,e,t,u=(o=r.formats,i=function(){return c},n=rd("Styles",[].concat(yn(o.items,function(n){return td(ed(n),n.title,n.isSelected(),n.getPreview(),xt(o.expansions,ed(n)))})),i,!1),e=V(o.menus,function(n,e){var t=yn(n,function(n){return td(ed(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",xt(o.expansions,ed(n)))});return rd(e,t,i,!0)}),t=k(e,yt("styles",n)),{tmenu:$l.tieredData("styles",t,o.expansions)}),c=Bs($l.sketch({dom:{tag:"div",classes:[ai.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=vs.getValue(e);return r.handle(e,t.value),F.none()},onEscape:function(){return F.none()},onOpenMenu:function(n,e){var t=xs(n.element());ws(e.element(),t),Ql.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=xs(n.element()),o=Fi(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();ws(t.element(),r),Ql.progressTo(i,"before"),Ql.jumpTo(t,"after"),Ql.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=Fi(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();Ql.progressTo(o,"after"),Ql.progressTo(t,"current")},navigateOnHover:!1,openImmediately:!0,data:u.tmenu,markers:{backgroundMenu:ai.resolve("styles-background-menu"),menu:ai.resolve("styles-menu"),selectedMenu:ai.resolve("styles-selected-menu"),item:ai.resolve("styles-item"),selectedItem:ai.resolve("styles-selected-item")}}));return c.asSpec()},id=function(n){return xt(n,"items")?(t=k(gt(e=n,["items"]),{menu:!0}),r=ud(e.items),{item:t,menus:k(r.menus,yt(e.title,r.items)),expansions:k(r.expansions,yt(e.title,e.title))}):{item:n,menus:{},expansions:{}};var e,t,r},ud=function(n){return xn(n,function(n,e){var t=id(e);return{menus:k(n.menus,t.menus),items:[t.item].concat(n.items),expansions:k(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},cd={expand:ud},ad=function(u,n){var c=function(n){return function(){return u.formatter.match(n)}},a=function(n){return function(){return u.formatter.getCssText(n)}},e=ht(n,"style_formats").getOr(zf),s=function(n){return yn(n,function(n){if(xt(n,"items")){var e=s(n.items);return k(k(n,{isSelected:A(!1),getPreview:A("")}),{items:e})}return xt(n,"format")?k(i=n,{isSelected:c(i.format),getPreview:a(i.format)}):(r=Gc((t=n).title),o=k(t,{format:r,isSelected:c(r),getPreview:a(r)}),u.formatter.register(r,o),o);var t,r,o,i})};return s(e)},sd=function(t,n,r){var e,o,i,u=(e=t,i=(o=function(n){return Cn(n,function(n){return n.items!==undefined?0<o(n.items).length?[n]:[]:!xt(n,"format")||e.formatter.canApply(n.format)?[n]:[]})})(n),cd.expand(i));return od({formats:u,handle:function(n,e){t.undoManager.transact(function(){ri.isOn(n)?t.formatter.remove(e):t.formatter.apply(e)}),r()}})},fd=["undo","bold","italic","link","image","bullist","styleselect"],ld=function(n){var e=n.replace(/\|/g," ").trim();return 0<e.length?e.split(/\s+/):[]},dd=function(n){return Cn(n,function(n){return g(n)?dd(n):ld(n)})},md=function(n){var e=n.toolbar!==undefined?n.toolbar:fd;return g(e)?dd(e):ld(e)},gd=function(r,o){var n=function(n){return function(){return $a.forToolbarCommand(o,n)}},e=function(n){return function(){return $a.forToolbarStateCommand(o,n)}},t=function(n,e,t){return function(){return $a.forToolbarStateAction(o,n,e,t)}},i=n("undo"),u=n("redo"),c=e("bold"),a=e("italic"),s=e("underline"),f=n("removeformat"),l=t("unlink","link",function(){o.execCommand("unlink",null,!1)}),d=t("unordered-list","ul",function(){o.execCommand("InsertUnorderedList",null,!1)}),m=t("ordered-list","ol",function(){o.execCommand("InsertOrderedList",null,!1)}),g=ad(o,o.settings),p=function(){return sd(o,g,function(){o.fire("scrollIntoView")})},v=function(n,e){return{isSupported:function(){return n.forall(function(n){return xt(o.buttons,n)})},sketch:e}};return{undo:v(F.none(),i),redo:v(F.none(),u),bold:v(F.none(),c),italic:v(F.none(),a),underline:v(F.none(),s),removeformat:v(F.none(),f),link:v(F.none(),function(){return e=r,t=o,$a.forToolbarStateAction(t,"link","link",function(){var n=Hf(e,t);e.setContextToolbar(n),Zs(t,function(){e.focusToolbar()}),Xs.query(t).each(function(n){t.selection.select(n.dom())})});var e,t}),unlink:v(F.none(),l),image:v(F.none(),function(){return Ws(o)}),bullist:v(F.some("bullist"),d),numlist:v(F.some("numlist"),m),fontsizeselect:v(F.none(),function(){return e=o,n={onChange:function(n){Ms.apply(e,n)},getInitialValue:function(){return Ms.get(e)}},Os(r,"font-size",function(){return Rs(n)});var e,n}),forecolor:v(F.none(),function(){return Cs(r,o)}),styleselect:v(F.none(),function(){return $a.forToolbar("style-formats",function(n){o.fire("toReading"),r.dropup().appear(p,ri.on,n)},jr([ri.config({toggleClass:ai.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Go.config({channels:bt([ui(wo.orientationChanged(),ri.off),ui(wo.dropupDismissed(),ri.off)])})]))})}},pd=function(n,t){var e=md(n),r={};return Cn(e,function(n){var e=!xt(r,n)&&xt(t,n)&&t[n].isSupported()?[t[n].sketch()]:[];return r[n]=!0,e})},vd=function(m,g){return function(n){if(m(n)){var e,t,r,o,i,u,c,a=ue.fromDom(n.target),s=function(){n.stopPropagation()},f=function(){n.preventDefault()},l=v(f,s),d=(e=a,t=n.clientX,r=n.clientY,o=s,i=f,u=l,c=n,{target:A(e),x:A(t),y:A(r),stop:o,prevent:i,kill:u,raw:A(c)});g(d)}}},hd=function(n,e,t,r,o){var i=vd(t,r);return n.dom().addEventListener(e,i,o),{unbind:l(yd,n,e,i,o)}},yd=function(n,e,t,r){n.dom().removeEventListener(e,t,r)},bd=A(!0),wd=function(n,e,t){return hd(n,e,bd,t,!1)},xd=function(n,e,t){return hd(n,e,bd,t,!0)},Td=function(n){var e=n.matchMedia("(orientation: portrait)").matches;return{isPortrait:A(e)}},Sd=Td,Od=function(r,e){var n=ue.fromDom(r),o=null,t=wd(n,"orientationchange",function(){clearInterval(o);var n=Td(r);e.onChange(n),i(function(){e.onReady(n)})}),i=function(n){clearInterval(o);var e=r.innerHeight,t=0;o=setInterval(function(){e!==r.innerHeight?(clearInterval(o),n(F.some(r.innerHeight))):20<t&&(clearInterval(o),n(F.none())),t++},50)};return{onAdjustment:i,destroy:function(){t.unbind()}}},kd=function(n){var e=zn.detect().os.isiOS(),t=Td(n).isPortrait();return e&&!t?n.screen.height:n.screen.width},Cd=function(n){var e=n.raw();return e.touches===undefined||1!==e.touches.length?F.none():F.some(e.touches[0])},Ed=function(t){var r,o,i,u=ao(F.none()),c=(r=function(n){u.set(F.none()),t.triggerEvent(Kn(),n)},o=400,i=null,{cancel:function(){null!==i&&(p.clearTimeout(i),i=null)},schedule:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];i=p.setTimeout(function(){r.apply(null,n),i=null},o)}}),a=bt([{key:j(),value:function(t){return Cd(t).each(function(n){c.cancel();var e={x:A(n.clientX),y:A(n.clientY),target:t.target};c.schedule(t),u.set(F.some(e))}),F.none()}},{key:H(),value:function(n){return c.cancel(),Cd(n).each(function(i){u.get().each(function(n){var e,t,r,o;e=i,t=n,r=Math.abs(e.clientX-t.x()),o=Math.abs(e.clientY-t.y()),(5<r||5<o)&&u.set(F.none())})}),F.none()}},{key:z(),value:function(e){return c.cancel(),u.get().filter(function(n){return Re(n.target(),e.target())}).map(function(n){return t.triggerEvent(qn(),e)})}}]);return{fireIfReady:function(e,n){return ht(a,n).bind(function(n){return n(e)})}}},Dd=function(t){var e=Ed({triggerEvent:function(n,e){t.onTapContent(e)}});return{fireTouchstart:function(n){e.fireIfReady(n,"touchstart")},onTouchend:function(){return wd(t.body(),"touchend",function(n){e.fireIfReady(n,"touchend")})},onTouchmove:function(){return wd(t.body(),"touchmove",function(n){e.fireIfReady(n,"touchmove")})}}},Id=6<=zn.detect().os.version.major,Ad=function(r,e,t){var o=Dd(r),i=Be(e),u=function(n){return!Re(n.start(),n.finish())||n.soffset()!==n.foffset()},n=function(){var n=r.doc().dom().hasFocus()&&r.getSelection().exists(u);t.getByDom(e).each(!0===(n||po(i).filter(function(n){return"input"===me(n)}).exists(function(n){return n.dom().selectionStart!==n.dom().selectionEnd}))?ri.on:ri.off)},c=[wd(r.body(),"touchstart",function(n){r.onTouchContent(),o.fireTouchstart(n)}),o.onTouchmove(),o.onTouchend(),wd(e,"touchstart",function(n){r.onTouchToolstrip()}),r.onToReading(function(){go(r.body())}),r.onToEditing(I),r.onScrollToCursor(function(n){n.preventDefault(),r.getCursorBox().each(function(n){var e=r.win(),t=n.top()>e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!==t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0===Id?[]:[wd(ue.fromDom(r.win()),"blur",function(){t.getByDom(e).each(ri.off)}),wd(i,"select",n),wd(r.doc(),"selectionchange",n)]);return{destroy:function(){bn(c,function(n){n.unbind()})}}},Md=function(n,e){var t=parseInt(Gr(n,e),10);return isNaN(t)?0:t},Fd=(Hs=ve,zs="text",{get:function(n){if(!Hs(n))throw new Error("Can only get "+zs+" value of a "+zs+" node");return Ls(n).getOr("")},getOption:Ls=function(n){return Hs(n)?F.from(n.dom().nodeValue):F.none()},set:function(n,e){if(!Hs(n))throw new Error("Can only set raw "+zs+" value of a "+zs+" node");n.dom().nodeValue=e}}),Rd=function(n){return"img"===me(n)?1:(e=n,Fd.getOption(e)).fold(function(){return _e(n).length},function(n){return n.length});var e},Bd={create:we("start","soffset","finish","foffset")},Vd=Ze([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Nd={before:Vd.before,on:Vd.on,after:Vd.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(h,h,h)}},_d=Ze([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),jd={domRange:_d.domRange,relative:_d.relative,exact:_d.exact,exactFromRange:function(n){return _d.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){var e=n.match({domRange:function(n){return ue.fromDom(n.startContainer)},relative:function(n,e){return Nd.getStart(n)},exact:function(n,e,t,r){return n}});return Ve(e)},range:Bd.create},Hd=function(n,e,t){var r,o,i=n.document.createRange();return r=i,e.fold(function(n){r.setStartBefore(n.dom())},function(n,e){r.setStart(n.dom(),e)},function(n){r.setStartAfter(n.dom())}),o=i,t.fold(function(n){o.setEndBefore(n.dom())},function(n,e){o.setEnd(n.dom(),e)},function(n){o.setEndAfter(n.dom())}),i},zd=function(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i},Ld=function(n){return{left:A(n.left),top:A(n.top),right:A(n.right),bottom:A(n.bottom),width:A(n.width),height:A(n.height)}},Pd=Ze([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),$d=function(n,e,t){return e(ue.fromDom(t.startContainer),t.startOffset,ue.fromDom(t.endContainer),t.endOffset)},Wd=function(n,e){var o,t,r,i=(o=n,e.match({domRange:function(n){return{ltr:A(n),rtl:F.none}},relative:function(n,e){return{ltr:J(function(){return Hd(o,n,e)}),rtl:J(function(){return F.some(Hd(o,e,n))})}},exact:function(n,e,t,r){return{ltr:J(function(){return zd(o,n,e,t,r)}),rtl:J(function(){return F.some(zd(o,t,r,n,e))})}}}));return(r=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Pd.rtl(ue.fromDom(n.endContainer),n.endOffset,ue.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return $d(0,Pd.ltr,r)}):$d(0,Pd.ltr,r)},Ud=function(n,e){var t=me(n);return"input"===t?Nd.after(n):hn(["br","img"],t)?0===e?Nd.before(n):Nd.after(n):Nd.on(n,e)},Gd=function(n,e,t,r){var o,i,u,c,a,s=(i=e,u=t,c=r,(a=Be(o=n).dom().createRange()).setStart(o.dom(),i),a.setEnd(u.dom(),c),a),f=Re(n,t)&&e===r;return s.collapsed&&!f},qd=function(n,e,t,r,o){var i,u,c=zd(n,e,t,r,o);i=n,u=c,F.from(i.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(u)})},Yd=function(n,e,t,r,o){var i,u,c,a,l,s=(i=r,u=o,c=Ud(e,t),a=Ud(i,u),jd.relative(c,a));Wd(l=n,s).match({ltr:function(n,e,t,r){qd(l,n,e,t,r)},rtl:function(n,e,t,r){var o,i,u,c,a,s=l.getSelection();if(s.setBaseAndExtent)s.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(s.extend)try{i=n,u=e,c=t,a=r,(o=s).collapse(i.dom(),u),o.extend(c.dom(),a)}catch(f){qd(l,t,r,n,e)}else qd(l,t,r,n,e)}})},Kd=function(n){var e=ue.fromDom(n.anchorNode),t=ue.fromDom(n.focusNode);return Gd(e,n.anchorOffset,t,n.focusOffset)?F.some(Bd.create(e,n.anchorOffset,t,n.focusOffset)):function(n){if(0<n.rangeCount){var e=n.getRangeAt(0),t=n.getRangeAt(n.rangeCount-1);return F.some(Bd.create(ue.fromDom(e.startContainer),e.startOffset,ue.fromDom(t.endContainer),t.endOffset))}return F.none()}(n)},Xd=function(n){return F.from(n.getSelection()).filter(function(n){return 0<n.rangeCount}).bind(Kd)},Jd=function(n,e){var i,t,r,o,u=Wd(i=n,e).match({ltr:function(n,e,t,r){var o=i.document.createRange();return o.setStart(n.dom(),e),o.setEnd(t.dom(),r),o},rtl:function(n,e,t,r){var o=i.document.createRange();return o.setStart(t.dom(),r),o.setEnd(n.dom(),e),o}});return r=(t=u).getClientRects(),0<(o=0<r.length?r[0]:t.getBoundingClientRect()).width||0<o.height?F.some(o).map(Ld):F.none()},Qd=function(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:A(2),height:n.height}},Zd=function(n){return{left:A(n.left),top:A(n.top),right:A(n.right),bottom:A(n.bottom),width:A(n.width),height:A(n.height)}},nm=function(n){var e=n.getSelection();return e!==undefined&&0<e.rangeCount?function(t){if(t.collapsed){var r=ue.fromDom(t.startContainer);return Ne(r).bind(function(n){var e=jd.exact(r,t.startOffset,n,Rd(n));return Jd(t.startContainer.ownerDocument.defaultView,e).map(Qd).map(In)}).getOr([])}return yn(t.getClientRects(),Zd)}(e.getRangeAt(0)):[]},em=function(n){n.focus();var e=ue.fromDom(n.document.body);(po().exists(function(n){return hn(["input","textarea"],me(n))})?function(n){setTimeout(function(){n()},0)}:a)(function(){po().each(go),mo(e)})},tm="data-"+ai.resolve("last-outer-height"),rm=function(n,e){Wr(n,tm,e)},om=function(n){return{top:A(n.top()),bottom:A(n.top()+n.height())}},im=function(n,e){var t=Md(e,tm),r=n.innerHeight;return r<t?F.some(t-r):F.none()},um=function(n,u){var e=ue.fromDom(u.document.body),t=wd(ue.fromDom(n),"resize",function(){im(n,e).each(function(i){var n,e;(n=u,e=nm(n),0<e.length?F.some(e[0]).map(om):F.none()).each(function(n){var e,t,r,o=(e=u,r=i,(t=n).top()>e.innerHeight||t.bottom()>e.innerHeight?Math.min(r,t.bottom()-e.innerHeight+50):0);0!==o&&u.scrollTo(u.pageXOffset,u.pageYOffset+o)})}),rm(e,n.innerHeight)});return rm(e,n.innerHeight),{toEditing:function(){em(u)},destroy:function(){t.unbind()}}},cm=function(n){return F.some(ue.fromDom(n.dom().contentWindow.document.body))},am=function(n){return F.some(ue.fromDom(n.dom().contentWindow.document))},sm=function(n){return F.from(n.dom().contentWindow)},fm=function(n){return sm(n).bind(Xd)},lm=function(n){return n.getFrame()},dm=function(n,t){return function(e){return e[n].getOrThunk(function(){var n=lm(e);return function(){return t(n)}})()}},mm=function(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return wd(e,r,n)}})},gm=function(n){return{left:A(n.left),top:A(n.top),right:A(n.right),bottom:A(n.bottom),width:A(n.width),height:A(n.height)}},pm={getBody:dm("getBody",cm),getDoc:dm("getDoc",am),getWin:dm("getWin",sm),getSelection:dm("getSelection",fm),getFrame:lm,getActiveApi:function(c){var a=lm(c);return cm(a).bind(function(u){return am(a).bind(function(i){return sm(a).map(function(o){var n=ue.fromDom(i.dom().documentElement),e=c.getCursorBox.getOrThunk(function(){return function(){return(n=o,Xd(n).map(function(n){return jd.exact(n.start(),n.soffset(),n.finish(),n.foffset())})).bind(function(n){return Jd(o,n).orThunk(function(){return Xd(o).filter(function(n){return Re(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0<e.width||0<e.height?F.some(e).map(gm):F.none()})})});var n}}),t=c.setSelection.getOrThunk(function(){return function(n,e,t,r){Yd(o,n,e,t,r)}}),r=c.clearSelection.getOrThunk(function(){return function(){o.getSelection().removeAllRanges()}});return{body:A(u),doc:A(i),win:A(o),html:A(n),getSelection:l(fm,a),setSelection:t,clearSelection:r,frame:A(a),onKeyup:mm(c,i,"onKeyup","keyup"),onNodeChanged:mm(c,i,"onNodeChanged","selectionchange"),onDomChanged:c.onDomChanged,onScrollToCursor:c.onScrollToCursor,onScrollToElement:c.onScrollToElement,onToReading:c.onToReading,onToEditing:c.onToEditing,onToolbarScrollStart:c.onToolbarScrollStart,onTouchContent:c.onTouchContent,onTapContent:c.onTapContent,onTouchToolstrip:c.onTouchToolstrip,getCursorBox:e}})})})}},vm="data-ephox-mobile-fullscreen-style",hm="position:absolute!important;",ym="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",bm=zn.detect().os.isAndroid(),wm=function(n,e){var t,r,o,i=function(r){return function(n){var e=Gr(n,"style"),t=e===undefined?"no-styles":e.trim();t!==r&&(Wr(n,vm,t),Wr(n,"style",r))}},u=(t="*",Di(n,function(n){return Ie(n,t)},r)),c=Cn(u,function(n){var e;return e="*",Ii(n,function(n){return Ie(n,e)})}),a=(o=yi(e,"background-color"))!==undefined&&""!==o?"background-color:"+o+"!important":"background-color:rgb(255,255,255)!important;";bn(c,i("display:none!important;")),bn(u,i(hm+ym+a)),i((!0===bm?"":hm)+ym+a)(n)},xm=function(){var n=Me("["+vm+"]");bn(n,function(n){var e=Gr(n,vm);"no-styles"!==e?Wr(n,"style",e):Yr(n,"style"),Yr(n,vm)})},Tm=function(){var e=Mi("head").getOrDie(),n=Mi('meta[name="viewport"]').getOrThunk(function(){var n=ue.fromTag("meta");return Wr(n,"name","viewport"),ze(e,n),n}),t=Gr(n,"content");return{maximize:function(){Wr(n,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){t!==undefined&&null!==t&&0<t.length?Wr(n,"content",t):Wr(n,"content","user-scalable=yes")}}},Sm=function(e,n){var t=Tm(),r=Rf(),o=Rf();return{enter:function(){n.hide(),no(e.container,ai.resolve("fullscreen-maximized")),no(e.container,ai.resolve("android-maximized")),t.maximize(),no(e.body,ai.resolve("android-scroll-reload")),r.set(um(e.win,pm.getWin(e.editor).getOrDie("no"))),pm.getActiveApi(e.editor).each(function(n){wm(e.container,n.body()),o.set(Ad(n,e.toolstrip,e.alloy))})},exit:function(){t.restore(),n.show(),eo(e.container,ai.resolve("fullscreen-maximized")),eo(e.container,ai.resolve("android-maximized")),xm(),eo(e.body,ai.resolve("android-scroll-reload")),o.clear(),r.clear()}}},Om=function(t,r){var o=null;return{cancel:function(){null!==o&&(p.clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==o&&p.clearTimeout(o),o=p.setTimeout(function(){t.apply(null,n),o=null},r)}}},km=function(n,e){var t,r,o,i=Bs(of.sketch({dom:Ha('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:jr([ri.config({toggleClass:ai.resolve("mask-tap-icon-selected"),toggleOnExecute:!1})])})),u=(t=n,r=200,o=null,{cancel:function(){null!==o&&(p.clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null===o&&(o=p.setTimeout(function(){t.apply(null,n),o=null},r))}});return of.sketch({dom:Ha('<div class="${prefix}-disabled-mask"></div>'),components:[of.sketch({dom:Ha('<div class="${prefix}-content-container"></div>'),components:[Na.sketch({dom:Ha('<div class="${prefix}-content-tap-section"></div>'),components:[i.asSpec()],action:function(n){u.throttle()},buttonBehaviours:jr([ri.config({toggleClass:ai.resolve("mask-tap-icon-selected")})])})]})]})},Cm=Bt([nr("editor",[Jt("getFrame"),er("getBody"),er("getDoc"),er("getWin"),er("getSelection"),er("setSelection"),er("clearSelection"),er("cursorSaver"),er("onKeyup"),er("onNodeChanged"),er("getCursorBox"),Jt("onDomChanged"),or("onTouchContent",I),or("onTapContent",I),or("onTouchToolstrip",I),or("onScrollToCursor",A({unbind:I})),or("onScrollToElement",A({unbind:I})),or("onToEditing",A({unbind:I})),or("onToReading",A({unbind:I})),or("onToolbarScrollStart",h)]),Jt("socket"),Jt("toolstrip"),Jt("dropup"),Jt("toolbar"),Jt("container"),Jt("alloy"),ur("win",function(n){return Be(n.socket).dom().defaultView}),ur("body",function(n){return ue.fromDom(n.socket.dom().ownerDocument.body)}),or("translate",h),or("setReadOnly",I),or("readOnlyOnInit",A(!0))]),Em=function(n){var e=Ut("Getting AndroidWebapp schema",Cm,n);vi(e.toolstrip,"width","100%");var t=yl(km(function(){e.setReadOnly(e.readOnlyOnInit()),o.enter()},e.translate));e.alloy.add(t);var r={show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}};ze(e.container,t.element());var o=Sm(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:I,enter:o.enter,exit:o.exit,destroy:I}},Dm=A([or("shell",!0),Vc("toolbarBehaviours",[jl])]),Im=A([ua({name:"groups",overrides:function(n){return{behaviours:jr([jl.config({})])}}})]),Am=Va({name:"Toolbar",configFields:Dm(),partFields:Im(),factory:function(e,n,t,r){var o=function(n){return e.shell()?F.some(n):ga(n,e,"groups")},i=e.shell()?{behaviours:[jl.config({})],components:[]}:{behaviours:[],components:n};return{uid:e.uid(),dom:e.dom(),components:i.components,behaviours:k(jr(i.behaviours),Nc(e.toolbarBehaviours())),apis:{setGroups:function(n,e){o(n).fold(function(){throw p.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(n){jl.set(n,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,e,t){n.setGroups(e,t)}}}),Mm=A([Jt("items"),(Ps=["itemClass"],nr("markers",yn(Ps,Jt))),Vc("tgroupBehaviours",[Bc])]),Fm=A([ca({name:"items",unit:"item",overrides:function(n){return{domModification:{classes:[n.markers().itemClass()]}}}})]),Rm=Va({name:"ToolbarGroup",configFields:Mm(),partFields:Fm(),factory:function(n,e,t,r){return k({dom:{attributes:{role:"toolbar"}}},{uid:n.uid(),dom:n.dom(),components:e,behaviours:k(jr([Bc.config({mode:"flow",selector:"."+n.markers().itemClass()})]),Nc(n.tgroupBehaviours())),"debug.sketcher":t["debug.sketcher"]})}}),Bm="data-"+ai.resolve("horizontal-scroll"),Vm=function(n){return"true"===Gr(n,Bm)?0<(t=n).dom().scrollLeft||function(n){n.dom().scrollLeft=1;var e=0!==n.dom().scrollLeft;return n.dom().scrollLeft=0,e}(t):0<(e=n).dom().scrollTop||function(n){n.dom().scrollTop=1;var e=0!==n.dom().scrollTop;return n.dom().scrollTop=0,e}(e);var e,t},Nm={exclusive:function(n,e){return wd(n,"touchmove",function(n){Bi(n.target(),e).filter(Vm).fold(function(){n.raw().preventDefault()},I)})},markAsHorizontal:function(n){Wr(n,Bm,"true")}};function _m(){var e=function(n){var e=!0===n.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:Ha('<div aria-label="'+n.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:jr([nf("adhoc-scrollable-toolbar",!0===n.scrollable?[yr(function(n,e){vi(n.element(),"overflow-x","auto"),Nm.markAsHorizontal(n.element()),nd.register(n.element())})]:[])]),components:[of.sketch({components:[Rm.parts().items({})]})],markers:{itemClass:ai.resolve("toolbar-group-item")},items:n.items}},t=yl(Am.sketch({dom:Ha('<div class="${prefix}-toolbar"></div>'),components:[Am.parts().groups({})],toolbarBehaviours:jr([ri.config({toggleClass:ai.resolve("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),Bc.config({mode:"cyclic"})]),shell:!0})),n=yl(of.sketch({dom:{classes:[ai.resolve("toolstrip")]},components:[bl(t)],containerBehaviours:jr([ri.config({toggleClass:ai.resolve("android-selection-context-toolbar"),toggleOnExecute:!1})])})),r=function(){Am.setGroups(t,o.get()),ri.off(t)},o=ao([]);return{wrapper:A(n),toolbar:A(t),createGroups:function(n){return yn(n,v(Rm.sketch,e))},setGroups:function(n){o.set(n),r()},setContextToolbar:function(n){ri.on(t),Am.setGroups(t,n)},restoreToolbar:function(){ri.isOn(t)&&r()},refresh:function(){},focus:function(){Bc.focusIn(t)}}}var jm=function(n,e){jl.append(n,bl(e))},Hm=function(n,e){jl.remove(n,e)},zm=function(n){return yl(Na.sketch({dom:Ha('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){n.run(function(n){n.setReadOnly(!1)})}}))},Lm=function(){return yl(of.sketch({dom:Ha('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:jr([jl.config({})])}))},Pm=function(n,e,t,r){(!0===t?co.toAlpha:co.toOmega)(r),(t?jm:Hm)(n,e)},$m=function(e,n){return n.getAnimationRoot().fold(function(){return e.element()},function(n){return n(e)})},Wm=function(n){return n.dimension().property()},Um=function(n,e){return n.dimension().getDimension()(e)},Gm=function(n,e){var t=$m(n,e);ul(t,[e.shrinkingClass(),e.growingClass()])},qm=function(n,e){eo(n.element(),e.openClass()),no(n.element(),e.closedClass()),vi(n.element(),Wm(e),"0px"),Ti(n.element())},Ym=function(n,e){eo(n.element(),e.closedClass()),no(n.element(),e.openClass()),xi(n.element(),Wm(e))},Km=function(n,e,t){t.setCollapsed(),vi(n.element(),Wm(e),Um(e,n.element())),Ti(n.element());var r=$m(n,e);no(r,e.shrinkingClass()),qm(n,e),e.onStartShrink()(n)},Xm=function(n,e,t){var r=function(n,e){Ym(n,e);var t=Um(e,n.element());return qm(n,e),t}(n,e),o=$m(n,e);no(o,e.growingClass()),Ym(n,e),vi(n.element(),Wm(e),r),t.setExpanded(),e.onStartGrow()(n)},Jm=function(n,e,t){var r=$m(n,e);return!0===ro(r,e.growingClass())},Qm=function(n,e,t){var r=$m(n,e);return!0===ro(r,e.shrinkingClass())},Zm=Object.freeze({grow:function(n,e,t){t.isExpanded()||Xm(n,e,t)},shrink:function(n,e,t){t.isExpanded()&&Km(n,e,t)},immediateShrink:function(n,e,t){var r,o;t.isExpanded()&&(r=n,o=e,t.setCollapsed(),vi(r.element(),Wm(o),Um(o,r.element())),Ti(r.element()),Gm(r,o),qm(r,o),o.onStartShrink()(r),o.onShrunk()(r))},hasGrown:function(n,e,t){return t.isExpanded()},hasShrunk:function(n,e,t){return t.isCollapsed()},isGrowing:Jm,isShrinking:Qm,isTransitioning:function(n,e,t){return!0===Jm(n,e)||!0===Qm(n,e)},toggleGrow:function(n,e,t){(t.isExpanded()?Km:Xm)(n,e,t)},disableTransitions:Gm}),ng=Object.freeze({exhibit:function(n,e){var t=e.expanded();return Or(t?{classes:[e.openClass()],styles:{}}:{classes:[e.closedClass()],styles:yt(e.dimension().property(),"0px")})},events:function(t,r){return sr([lr(K(),function(n,e){e.event().raw().propertyName===t.dimension().property()&&(Gm(n,t),r.isExpanded()&&xi(n.element(),t.dimension().property()),(r.isExpanded()?t.onGrown():t.onShrunk())(n))})])}}),eg=[Jt("closedClass"),Jt("openClass"),Jt("shrinkingClass"),Jt("growingClass"),er("getAnimationRoot"),jo("onShrunk"),jo("onStartShrink"),jo("onGrown"),jo("onStartGrow"),or("expanded",!1),Qt("dimension",Yt("property",{width:[Po("property","width"),Po("getDimension",function(n){return xs(n)+"px"})],height:[Po("property","height"),Po("getDimension",function(n){return Ei(n)+"px"})]}))],tg=zr({fields:eg,name:"sliding",active:ng,apis:Zm,state:Object.freeze({init:function(n){var e=ao(n.expanded());return _r({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:l(e.set,!1),setExpanded:l(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),rg=function(e,t){var r=yl(of.sketch({dom:{tag:"div",classes:[ai.resolve("dropup")]},components:[],containerBehaviours:jr([jl.config({}),tg.config({closedClass:ai.resolve("dropup-closed"),openClass:ai.resolve("dropup-open"),shrinkingClass:ai.resolve("dropup-shrinking"),growingClass:ai.resolve("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){e(),t(),jl.set(n,[])},onGrown:function(n){e(),t()}}),ii(function(n,e){o(I)})])})),o=function(n){p.window.requestAnimationFrame(function(){n(),tg.shrink(r)})};return{appear:function(n,e,t){!0===tg.hasShrunk(r)&&!1===tg.isTransitioning(r)&&p.window.requestAnimationFrame(function(){e(t),jl.set(r,[n()]),tg.grow(r)})},disappear:o,component:A(r),element:r.element}},og=zn.detect().browser.isFirefox(),ig=Rt([Zt("triggerEvent"),Zt("broadcastEvent"),or("stopBackspace",!0)]),ug=function(e,n){var t,r,o,i,u=Ut("Getting GUI events settings",ig,n),c=zn.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],a=Ed(u),s=yn(c.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]),function(n){return wd(e,n,function(e){a.fireIfReady(e,n).each(function(n){n&&e.kill()}),u.triggerEvent(n,e)&&e.kill()})}),f=wd(e,"keydown",function(n){var e;u.triggerEvent("keydown",n)?n.kill():!0!==u.stopBackspace||8!==(e=n).raw().which||hn(["input","textarea"],me(e.target()))||n.prevent()}),l=(t=e,r=function(n){u.triggerEvent("focusin",n)&&n.kill()},og?xd(t,"focus",r):wd(t,"focusin",r)),d=(o=e,i=function(n){u.triggerEvent("focusout",n)&&n.kill(),p.setTimeout(function(){u.triggerEvent($n(),n)},0)},og?xd(o,"blur",i):wd(o,"focusout",i)),m=Ve(e),g=wd(m,"scroll",function(n){u.broadcastEvent(Jn(),n)&&n.kill()});return{unbind:function(){bn(s,function(n){n.unbind()}),f.unbind(),l.unbind(),d.unbind(),g.unbind()}}},cg=function(n,e){var t=ht(n,"target").map(function(n){return n()}).getOr(e);return ao(t)},ag=Ze([{stopped:[]},{resume:["element"]},{complete:[]}]),sg=function(n,r,e,t,o,i){var u,c,a,s,f=n(r,t),l=(u=e,c=o,a=ao(!1),s=ao(!1),{stop:function(){a.set(!0)},cut:function(){s.set(!0)},isStopped:a.get,isCut:s.get,event:A(u),setSource:c.set,getSource:c.get});return f.fold(function(){return i.logEventNoHandlers(r,t),ag.complete()},function(e){var t=e.descHandler();return Jf(t)(l),l.isStopped()?(i.logEventStopped(r,e.element(),t.purpose()),ag.stopped()):l.isCut()?(i.logEventCut(r,e.element(),t.purpose()),ag.complete()):Ne(e.element()).fold(function(){return i.logNoParent(r,e.element(),t.purpose()),ag.complete()},function(n){return i.logEventResponse(r,e.element(),t.purpose()),ag.resume(n)})})},fg=function(e,t,r,n,o,i){return sg(e,t,r,n,o,i).fold(function(){return!0},function(n){return fg(e,t,r,n,o,i)},function(){return!1})},lg=function(n,e,t){var r,o,i=(r=e,o=ao(!1),{stop:function(){o.set(!0)},cut:I,isStopped:o.get,isCut:A(!1),event:A(r),setSource:c("Cannot set source of a broadcasted event"),getSource:c("Cannot get source of a broadcasted event")});return bn(n,function(n){var e=n.descHandler();Jf(e)(i)}),i.isStopped()},dg=function(n,e,t,r,o){var i=cg(t,r);return fg(n,e,t,r,i,o)},mg=function(n,e,t){return lo(n,function(n){return e(n).isSome()},t).bind(e)},gg=we("element","descHandler"),pg=function(n,e){return{id:A(n),descHandler:A(e)}};function vg(){var i={};return{registerId:function(r,o,n){B(n,function(n,e){var t=i[e]!==undefined?i[e]:{};t[o]=Xf(n,r),i[e]=t})},unregisterId:function(t){B(i,function(n,e){n.hasOwnProperty(t)&&delete n[t]})},filterByType:function(n){return ht(i,n).map(function(n){return _(n,function(n,e){return pg(e,n)})}).getOr([])},find:function(n,e,t){var o=pt(e)(i);return mg(t,function(n){return t=o,Ea(r=n).fold(function(){return F.none()},function(n){var e=pt(n);return t.bind(e).map(function(n){return gg(r,n)})});var t,r},n)}}}function hg(){var r=vg(),o={},i=function(r){var n=r.element();return Ea(n).fold(function(){return n="uid-",e=r.element(),t=Gc(ka+n),Wr(e,Ca,t),t;var n,e,t},function(n){return n})},u=function(n){Ea(n.element()).each(function(n){o[n]=undefined,r.unregisterId(n)})};return{find:function(n,e,t){return r.find(n,e,t)},filter:function(n){return r.filterByType(n)},register:function(n){var e=i(n);xt(o,e)&&function(n,e){var t=o[e];if(t!==n)throw new Error('The tagId "'+e+'" is already used by: '+ko(t.element())+"\nCannot use it for: "+ko(n.element())+"\nThe conflicting element is"+(he(t.element())?" ":" not ")+"already in the DOM");u(n)}(n,e);var t=[n];r.registerId(t,e,n.events()),o[e]=n},unregister:u,getById:function(n){return pt(n)(o)}}}var yg=function(t){var r=function(e){return Ne(t.element()).fold(function(){return!0},function(n){return Re(e,n)})},o=hg(),s=function(n,e){return o.find(r,n,e)},n=ug(t.element(),{triggerEvent:function(u,c){return Fo(u,c.target(),function(n){return e=s,t=u,o=n,i=(r=c).target(),dg(e,t,r,i,o);var e,t,r,o,i})},broadcastEvent:function(n,e){var t=o.filter(n);return lg(t,e)}}),i=Wf({debugInfo:A("real"),triggerEvent:function(e,t,r){Fo(e,t,function(n){dg(s,e,r,t,n)})},triggerFocus:function(c,a){Ea(c).fold(function(){mo(c)},function(n){Fo(Pn(),c,function(n){var e,t,r,o,i,u;e=s,t=Pn(),r={originator:A(a),kill:I,prevent:I,target:A(c)},i=n,u=cg(r,o=c),sg(e,t,r,o,u,i)})})},triggerEscape:function(n,e){i.triggerEvent("keydown",n.element(),e.event())},getByUid:function(n){return m(n)},getByDom:function(n){return g(n)},build:yl,addToGui:function(n){c(n)},removeFromGui:function(n){a(n)},addToWorld:function(n){e(n)},removeFromWorld:function(n){u(n)},broadcast:function(n){l(n)},broadcastOn:function(n,e){d(n,e)},isConnected:A(!0)}),e=function(n){n.connect(i),ve(n.element())||(o.register(n),bn(n.components(),e),i.triggerEvent(Xn(),n.element(),{target:A(n.element())}))},u=function(n){ve(n.element())||(bn(n.components(),u),o.unregister(n)),n.disconnect()},c=function(n){Ge(t,n)},a=function(n){Ke(n)},f=function(t){var n=o.filter(Wn());bn(n,function(n){var e=n.descHandler();Jf(e)(t)})},l=function(n){f({universal:A(!0),data:A(n)})},d=function(n,e){f({universal:A(!1),channels:A(n),data:A(e)})},m=function(n){return o.getById(n).fold(function(){return Qe.error(new Error('Could not find component with uid: "'+n+'" in system.'))},Qe.value)},g=function(n){var e=Ea(n).getOr("not found");return m(e)};return e(t),{root:A(t),element:t.element,destroy:function(){n.unbind(),$e(t.element())},add:c,remove:a,getByUid:m,getByDom:g,addToWorld:e,removeFromWorld:u,broadcast:l,broadcastOn:d}},bg=A(ai.resolve("readonly-mode")),wg=A(ai.resolve("edit-mode"));function xg(n){var e=yl(of.sketch({dom:{classes:[ai.resolve("outer-container")].concat(n.classes)},containerBehaviours:jr([co.config({alpha:bg(),omega:wg()})])}));return yg(e)}var Tg,Sg,Og,kg,Cg=function(n,e){var t=ue.fromTag("input");hi(t,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),ze(n,t),mo(t),e(t),$e(t)},Eg=function(n){var e=n.getSelection();if(0<e.rangeCount){var t=e.getRangeAt(0),r=n.document.createRange();r.setStart(t.startContainer,t.startOffset),r.setEnd(t.endContainer,t.endOffset),e.removeAllRanges(),e.addRange(r)}},Dg=function(n,e){po().each(function(n){Re(n,e)||go(n)}),n.focus(),mo(ue.fromDom(n.document.body)),Eg(n)},Ig={stubborn:function(n,e,t,r){var o=function(){Dg(e,r)},i=wd(t,"keydown",function(n){hn(["input","textarea"],me(n.target()))||o()});return{toReading:function(){Cg(n,go)},toEditing:o,onToolbarTouch:function(){},destroy:function(){i.unbind()}}},timid:function(n,e,t,r){var o=function(){go(r)};return{toReading:function(){o()},toEditing:function(){Dg(e,r)},onToolbarTouch:function(){o()},destroy:I}}},Ag=function(t,r,o,i,n){var u=function(){r.run(function(n){n.refreshSelection()})},e=function(n,e){var t=n-i.dom().scrollTop;r.run(function(n){n.scrollIntoView(t,t+e)})},c=function(){r.run(function(n){n.clearSelection()})},a=function(){t.getCursorBox().each(function(n){e(n.top(),n.height())}),r.run(function(n){n.syncHeight()})},s=Dd(t),f=Om(a,300),l=[t.onKeyup(function(){c(),f.throttle()}),t.onNodeChanged(u),t.onDomChanged(f.throttle),t.onDomChanged(u),t.onScrollToCursor(function(n){n.preventDefault(),f.throttle()}),t.onScrollToElement(function(n){n.element(),e(r,i)}),t.onToEditing(function(){r.run(function(n){n.toEditing()})}),t.onToReading(function(){r.run(function(n){n.toReading()})}),wd(t.doc(),"touchend",function(n){Re(t.html(),n.target())||Re(t.body(),n.target())}),wd(o,"transitionend",function(n){var e;"height"===n.raw().propertyName&&(e=Ei(o),r.run(function(n){n.setViewportOffset(e)}),u(),a())}),xd(o,"touchstart",function(n){var e;r.run(function(n){n.highlightSelection()}),e=n,r.run(function(n){n.onToolbarTouch(e)}),t.onTouchToolstrip()}),wd(t.body(),"touchstart",function(n){c(),t.onTouchContent(),s.fireTouchstart(n)}),s.onTouchmove(),s.onTouchend(),wd(t.body(),"click",function(n){n.kill()}),wd(o,"touchmove",function(){t.onToolbarScrollStart()})];return{destroy:function(){bn(l,function(n){n.unbind()})}}},Mg={},Fg={exports:Mg};Tg=undefined,Sg=Mg,Og=Fg,kg=undefined,function(n){"object"==typeof Sg&&void 0!==Og?Og.exports=n():"function"==typeof Tg&&Tg.amd?Tg([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function i(u,c,a){function s(e,n){if(!c[e]){if(!u[e]){var t="function"==typeof kg&&kg;if(!n&&t)return t(e,!0);if(f)return f(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var o=c[e]={exports:{}};u[e][0].call(o.exports,function(n){return s(u[e][1][n]||n)},o,o.exports,i,u,c,a)}return c[e].exports}for(var f="function"==typeof kg&&kg,n=0;n<a.length;n++)s(a[n]);return s}({1:[function(n,e,t){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(n){if(r===setTimeout)return setTimeout(n,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(n,0);try{return r(n,0)}catch(e){try{return r.call(null,n,0)}catch(e){return r.call(this,n,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(n){r=u}try{o="function"==typeof clearTimeout?clearTimeout:c}catch(n){o=c}}();var s,f=[],l=!1,d=-1;function m(){l&&s&&(l=!1,s.length?f=s.concat(f):d=-1,f.length&&g())}function g(){if(!l){var n=a(m);l=!0;for(var e=f.length;e;){for(s=f,f=[];++d<e;)s&&s[d].run();d=-1,e=f.length}s=null,l=!1,function(n){if(o===clearTimeout)return clearTimeout(n);if((o===c||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(n);try{o(n)}catch(e){try{return o.call(null,n)}catch(e){return o.call(this,n)}}}(n)}}function p(n,e){this.fun=n,this.array=e}function v(){}i.nextTick=function(n){var e=new Array(arguments.length-1);if(1<arguments.length)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];f.push(new p(n,e)),1!==f.length||l||a(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(n){return[]},i.binding=function(n){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(n){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(n,l,e){(function(t){!function(n){var e=setTimeout;function r(){}function u(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],f(n,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,u._immediateFn(function(){var n=1===r._state?o.onFulfilled:o.onRejected;if(null!==n){var e;try{e=n(r._value)}catch(t){return void c(o.promise,t)}i(o.promise,e)}else(1===r._state?i:c)(o.promise,r._value)})):r._deferreds.push(o)}function i(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if(e instanceof u)return n._state=3,n._value=e,void a(n);if("function"==typeof t)return void f((r=t,o=e,function(){r.apply(o,arguments)}),n)}n._state=1,n._value=e,a(n)}catch(i){c(n,i)}var r,o}function c(n,e){n._state=2,n._value=e,a(n)}function a(n){2===n._state&&0===n._deferreds.length&&u._immediateFn(function(){n._handled||u._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)o(n,n._deferreds[e]);n._deferreds=null}function s(n,e,t){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.promise=t}function f(n,e){var t=!1;try{n(function(n){t||(t=!0,i(e,n))},function(n){t||(t=!0,c(e,n))})}catch(r){if(t)return;t=!0,c(e,r)}}u.prototype["catch"]=function(n){return this.then(null,n)},u.prototype.then=function(n,e){var t=new this.constructor(r);return o(this,new s(n,e,t)),t},u.all=function(n){var a=Array.prototype.slice.call(n);return new u(function(o,i){if(0===a.length)return o([]);var u=a.length;function c(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void t.call(n,function(n){c(e,n)},i)}a[e]=n,0==--u&&o(a)}catch(r){i(r)}}for(var n=0;n<a.length;n++)c(n,a[n])})},u.resolve=function(e){return e&&"object"==typeof e&&e.constructor===u?e:new u(function(n){n(e)})},u.reject=function(t){return new u(function(n,e){e(t)})},u.race=function(o){return new u(function(n,e){for(var t=0,r=o.length;t<r;t++)o[t].then(n,e)})},u._immediateFn="function"==typeof t?function(n){t(n)}:function(n){e(n,0)},u._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},u._setImmediateFn=function(n){u._immediateFn=n},u._setUnhandledRejectionFn=function(n){u._unhandledRejectionFn=n},void 0!==l&&l.exports?l.exports=u:n.Promise||(n.Promise=u)}(this)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(a,n,s){(function(n,e){var r=a("process/browser.js").nextTick,t=Function.prototype.apply,o=Array.prototype.slice,i={},u=0;function c(n,e){this._id=n,this._clearFn=e}s.setTimeout=function(){return new c(t.call(setTimeout,window,arguments),clearTimeout)},s.setInterval=function(){return new c(t.call(setInterval,window,arguments),clearInterval)},s.clearTimeout=s.clearInterval=function(n){n.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},s.enroll=function(n,e){clearTimeout(n._idleTimeoutId),n._idleTimeout=e},s.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},s._unrefActive=s.active=function(n){clearTimeout(n._idleTimeoutId);var e=n._idleTimeout;0<=e&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},e))},s.setImmediate="function"==typeof n?n:function(n){var e=u++,t=!(arguments.length<2)&&o.call(arguments,1);return i[e]=!0,r(function(){i[e]&&(t?n.apply(null,t):n.call(null),s.clearImmediate(e))}),e},s.clearImmediate="function"==typeof e?e:function(n){delete i[n]}}).call(this,a("timers").setImmediate,a("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(n,e,t){var r=n("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});var Rg=Fg.exports.boltExport,Bg=function(n){var t=F.none(),e=[],r=function(n){o()?u(n):e.push(n)},o=function(){return t.isSome()},i=function(n){bn(n,u)},u=function(e){t.each(function(n){p.setTimeout(function(){e(n)},0)})};return n(function(n){t=F.some(n),i(e),e=[]}),{get:r,map:function(t){return Bg(function(e){r(function(n){e(t(n))})})},isReady:o}},Vg={nu:Bg,pure:function(e){return Bg(function(n){n(e)})}},Ng=function(n){p.setTimeout(function(){throw n},0)},_g=function(t){var n=function(n){t().then(n,Ng)};return{map:function(n){return _g(function(){return t().then(n)})},bind:function(e){return _g(function(){return t().then(function(n){return e(n).toPromise()})})},anonBind:function(n){return _g(function(){return t().then(function(){return n.toPromise()})})},toLazy:function(){return Vg.nu(n)},toCached:function(){var n=null;return _g(function(){return null===n&&(n=t()),n})},toPromise:t,get:n}},jg=function(n){return _g(function(){return new Rg(n)})},Hg=function(n){return _g(function(){return Rg.resolve(n)})},zg=function(n,e,t){return Math.abs(n-e)<=t?F.none():n<e?F.some(n+t):F.some(n-t)},Lg=function(){var s=null;return{animate:function(r,o,n,i,e,t){var u=!1,c=function(n){u=!0,e(n)};clearInterval(s);var a=function(n){clearInterval(s),c(n)};s=setInterval(function(){var t=r();zg(t,o,n).fold(function(){clearInterval(s),c(o)},function(n){if(i(n,a),!u){var e=r();(e!==n||Math.abs(e-o)>Math.abs(t-o))&&(clearInterval(s),c(o))}})},t)}}},Pg=function(r,o){return function(n,e){for(var t=0;t<n.length;t++){var r=e(n[t],t);if(r.isSome())return r}return F.none()}([{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(n){return e=r<=n.width&&o<=n.height,t=n.keyboard,e?F.some(t):F.none();var e,t}).getOr({portrait:o/5,landscape:r/4})},$g=function(n){var e,t=Sd(n).isPortrait(),r=Pg((e=n).screen.width,e.screen.height),o=t?r.portrait:r.landscape;return(t?n.screen.height:n.screen.width)-n.innerHeight>o?0:o},Wg=function(n,e){var t=Be(n).dom().defaultView;return Ei(n)+Ei(e)-$g(t)},Ug=Wg,Gg=function(n,e,t){var r=Wg(e,t),o=Ei(e)+Ei(t)-r;vi(n,"padding-bottom",o+"px")},qg=Ze([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Yg="data-"+ai.resolve("position-y-fixed"),Kg="data-"+ai.resolve("y-property"),Xg="data-"+ai.resolve("scrolling"),Jg="data-"+ai.resolve("last-window-height"),Qg=function(n){return Md(n,Yg)},Zg=function(n,e){var t=Gr(n,Kg);return qg.fixed(n,t,e)},np=function(n,e){return qg.scroller(n,e)},ep=function(n){var e=Qg(n);return("true"===Gr(n,Xg)?np:Zg)(n,e)},tp=function(n,e,t){var r=Be(n).dom().defaultView.innerHeight;return Wr(n,Jg,r+"px"),r-e-t},rp=function(n){var e=Ai(n,"["+Yg+"]");return yn(e,ep)},op=function(r,o,i,u){var n,e,t,c,a,s,f,l,d=Be(r).dom().defaultView,m=(l=Gr(f=i,"style"),hi(f,{position:"absolute",top:"0px"}),Wr(f,Yg,"0px"),Wr(f,Kg,"top"),{restore:function(){Wr(f,"style",l||""),Yr(f,Yg),Yr(f,Kg)}}),g=Ei(i),p=Ei(u),v=(c=tp(r,t=g,p),s=Gr(a=r,"style"),nd.register(a),hi(a,{position:"absolute",height:c+"px",width:"100%",top:t+"px"}),Wr(a,Yg,t+"px"),Wr(a,Xg,"true"),Wr(a,Kg,"top"),{restore:function(){nd.deregister(a),Wr(a,"style",s||""),Yr(a,Yg),Yr(a,Xg),Yr(a,Kg)}}),h=(e=Gr(n=u,"style"),hi(n,{position:"absolute",bottom:"0px"}),Wr(n,Yg,"0px"),Wr(n,Kg,"bottom"),{restore:function(){Wr(n,"style",e||""),Yr(n,Yg),Yr(n,Kg)}}),y=!0,b=function(){var n=d.innerHeight;return Md(r,Jg)<n},w=function(){if(y){var n=Ei(i),e=Ei(u),t=tp(r,n,e);Wr(r,Yg,n+"px"),vi(r,"height",t+"px"),Gg(o,r,u)}};return Gg(o,r,u),{setViewportOffset:function(n){Wr(r,Yg,n+"px"),w()},isExpanding:b,isShrinking:x(b),refresh:w,restore:function(){y=!1,m.restore(),v.restore(),h.restore()}}},ip=Qg,up=Lg(),cp="data-"+ai.resolve("last-scroll-top"),ap=function(n){var e=wi(n,"top").getOr("0");return parseInt(e,10)},sp=function(n){return parseInt(n.dom().scrollTop,10)},fp=function(n,e){var t=e+ip(n)+"px";vi(n,"top",t)},lp=function(t,r,o){return jg(function(n){var e=l(sp,t);up.animate(e,r,15,function(n){t.dom().scrollTop=n,vi(t,"top",ap(t)+15+"px")},function(){t.dom().scrollTop=r,vi(t,"top",o+"px"),n(r)},10)})},dp=function(o,i){return jg(function(n){var e=l(sp,o);Wr(o,cp,e());var t=Math.abs(i-e()),r=Math.ceil(t/10);up.animate(e,i,r,function(n,e){Md(o,cp)!==o.dom().scrollTop?e(o.dom().scrollTop):(o.dom().scrollTop=n,Wr(o,cp,n))},function(){o.dom().scrollTop=i,Wr(o,cp,i),n(i)},10)})},mp=function(i,u){return jg(function(n){var e=l(ap,i),t=function(n){vi(i,"top",n+"px")},r=Math.abs(u-e()),o=Math.ceil(r/10);up.animate(e,u,o,t,function(){t(u),n(u)},10)})},gp=function(e,t,r){var o=Be(e).dom().defaultView;return jg(function(n){fp(e,r),fp(t,r),o.scrollTo(0,r),n(r)})},pp=function(n,e,t,r,o){var i=Ug(e,t),u=l(Eg,n);i<r||i<o?dp(e,e.dom().scrollTop-i+o).get(u):r<0&&dp(e,e.dom().scrollTop+r).get(u)},vp=function(u,n){return n(function(r){var o=[],i=0;0===u.length?r([]):bn(u,function(n,e){var t;n.get((t=e,function(n){o[t]=n,++i>=u.length&&r(o)}))})})},hp=function(n,a){return n.fold(function(n,e,t){return vi(n,e,a+(r=t)+"px"),Hg(r);var r},function(n,e){return o=a+(r=e),i=wi(t=n,"top").getOr(r),u=o-parseInt(i,10),c=t.dom().scrollTop+u,lp(t,c,o);var t,r,o,i,u,c})},yp=function(n,e){var t=rp(n),r=yn(t,function(n){return hp(n,e)});return vp(r,jg)},bp=function(e,t,n,r,o,i){var u,c,a=(u=function(n){return gp(e,t,n)},c=ao(Vg.pure({})),{start:function(e){var n=Vg.nu(function(n){return u(e).get(n)});c.set(n)},idle:function(n){c.get().get(function(){n()})}}),s=Om(function(){a.idle(function(){yp(n,r.pageYOffset).get(function(){var n;(n=nm(i),F.from(n[0]).bind(function(n){var e=n.top()-t.dom().scrollTop;return e>r.innerHeight+5||e<-5?F.some({top:A(e),bottom:A(e+n.height())}):F.none()})).each(function(n){t.dom().scrollTop=t.dom().scrollTop+n.top()}),a.start(0),o.refresh()})})},1e3),f=wd(ue.fromDom(r),"scroll",function(){r.pageYOffset<0||s.throttle()});return yp(n,r.pageYOffset).get(h),{unbind:f.unbind}},wp=function(n){var t=n.cWin(),e=n.ceBody(),r=n.socket(),o=n.toolstrip(),i=n.toolbar(),u=n.contentElement(),c=n.keyboardType(),a=n.outerWindow(),s=n.dropup(),f=op(r,e,o,s),l=c(n.outerBody(),t,ye(),u,o,i),d=Od(a,{onChange:I,onReady:f.refresh});d.onAdjustment(function(){f.refresh()});var m=wd(ue.fromDom(a),"resize",function(){f.isExpanding()&&f.refresh()}),g=bp(o,r,n.outerBody(),a,f,t),p=function(t,e){var n=t.document,r=ue.fromTag("div");no(r,ai.resolve("unfocused-selections")),ze(ue.fromDom(n.documentElement),r);var o=wd(r,"touchstart",function(n){n.prevent(),Dg(t,e),u()}),i=function(n){var e=ue.fromTag("span");return il(e,[ai.resolve("layer-editor"),ai.resolve("unfocused-selection")]),hi(e,{left:n.left()+"px",top:n.top()+"px",width:n.width()+"px",height:n.height()+"px"}),e},u=function(){Pe(r)};return{update:function(){u();var n=nm(t),e=yn(n,i);Le(r,e)},isActive:function(){return 0<_e(r).length},destroy:function(){o.unbind(),$e(r)},clear:u}}(t,u),v=function(){p.clear()};return{toEditing:function(){l.toEditing(),v()},toReading:function(){l.toReading()},onToolbarTouch:function(n){l.onToolbarTouch(n)},refreshSelection:function(){p.isActive()&&p.update()},clearSelection:v,highlightSelection:function(){p.update()},scrollIntoView:function(n,e){pp(t,r,s,n,e)},updateToolbarPadding:I,setViewportOffset:function(n){f.setViewportOffset(n),mp(r,n).get(h)},syncHeight:function(){vi(u,"height",u.dom().contentWindow.document.body.scrollHeight+"px")},refreshStructure:f.refresh,destroy:function(){f.restore(),d.destroy(),g.unbind(),m.unbind(),l.destroy(),p.destroy(),Cg(ye(),go)}}},xp=function(r,n){var o=Tm(),i=Bf(),u=Bf(),c=Rf(),a=Rf();return{enter:function(){n.hide();var t=ue.fromDom(p.document);pm.getActiveApi(r.editor).each(function(n){i.set({socketHeight:wi(r.socket,"height"),iframeHeight:wi(n.frame(),"height"),outerScroll:p.document.body.scrollTop}),u.set({exclusives:Nm.exclusive(t,"."+nd.scrollable())}),no(r.container,ai.resolve("fullscreen-maximized")),wm(r.container,n.body()),o.maximize(),vi(r.socket,"overflow","scroll"),vi(r.socket,"-webkit-overflow-scrolling","touch"),mo(n.body());var e=Ce(["cWin","ceBody","socket","toolstrip","toolbar","dropup","contentElement","cursor","keyboardType","isScrolling","outerWindow","outerBody"],[]);c.set(wp(e({cWin:n.win(),ceBody:n.body(),socket:r.socket,toolstrip:r.toolstrip,toolbar:r.toolbar,dropup:r.dropup.element(),contentElement:n.frame(),cursor:I,outerBody:r.body,outerWindow:r.win,keyboardType:Ig.stubborn,isScrolling:function(){return u.get().exists(function(n){return n.socket.isScrolling()})}}))),c.run(function(n){n.syncHeight()}),a.set(Ag(n,c,r.toolstrip,r.socket,r.dropup))})},refreshStructure:function(){c.run(function(n){n.refreshStructure()})},exit:function(){o.restore(),a.clear(),c.clear(),n.show(),i.on(function(n){n.socketHeight.each(function(n){vi(r.socket,"height",n)}),n.iframeHeight.each(function(n){vi(r.editor.getFrame(),"height",n)}),p.document.body.scrollTop=n.scrollTop}),i.clear(),u.on(function(n){n.exclusives.unbind()}),u.clear(),eo(r.container,ai.resolve("fullscreen-maximized")),xm(),nd.deregister(r.toolbar),xi(r.socket,"overflow"),xi(r.socket,"-webkit-overflow-scrolling"),go(r.editor.getFrame()),pm.getActiveApi(r.editor).each(function(n){n.clearSelection()})}}},Tp=function(n){var e=Ut("Getting IosWebapp schema",Cm,n);vi(e.toolstrip,"width","100%"),vi(e.container,"position","relative");var t=yl(km(function(){e.setReadOnly(e.readOnlyOnInit()),r.enter()},e.translate));e.alloy.add(t);var r=xp(e,{show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}});return{setReadOnly:e.setReadOnly,refreshStructure:r.refreshStructure,enter:r.enter,exit:r.exit,destroy:I}},Sp=tinymce.util.Tools.resolve("tinymce.EditorManager"),Op=function(n){var e=ht(n.settings,"skin_url").fold(function(){return Sp.baseURL+"/skins/lightgray"},function(n){return n});return{content:e+"/content.mobile.min.css",ui:e+"/skin.mobile.min.css"}},kp=function(n,e,t){n.system().broadcastOn([wo.formatChanged()],{command:e,state:t})},Cp=function(r,n){var e=R(n.formatter.get());bn(e,function(e){n.formatter.formatChanged(e,function(n){kp(r,e,n)})}),bn(["ul","ol"],function(t){n.selection.selectorChanged(t,function(n,e){kp(r,t,n)})})},Ep=(A(["x-small","small","medium","large","x-large"]),function(n){var e=function(){n._skinLoaded=!0,n.fire("SkinLoaded")};return function(){n.initialized?e():n.on("init",e)}}),Dp=A("toReading"),Ip=A("toEditing");yo.add("mobile",function(D){return{getNotificationManagerImpl:function(){return{open:A({progressBar:{value:I},close:I}),close:I,reposition:I,getArgs:h}},renderUI:function(n){var e=Op(D);0==(!1===D.settings.skin)?(D.contentCSS.push(e.content),ho.DOM.styleSheetLoader.load(e.ui,Ep(D))):Ep(D)();var t,r,o,i,u,c,a,s,f,l,d,m,g,p,v,h,y,b=function(){D.fire("scrollIntoView")},w=ue.fromTag("div"),x=zn.detect().os.isAndroid()?(s=b,f=xg({classes:[ai.resolve("android-container")]}),l=_m(),d=Rf(),m=zm(d),g=Lm(),p=rg(I,s),f.add(l.wrapper()),f.add(g),f.add(p.component()),{system:A(f),element:f.element,init:function(n){d.set(Em(n))},exit:function(){d.run(function(n){n.exit(),jl.remove(g,m)})},setToolbarGroups:function(n){var e=l.createGroups(n);l.setGroups(e)},setContextToolbar:function(n){var e=l.createGroups(n);l.setContextToolbar(e)},focusToolbar:function(){l.focus()},restoreToolbar:function(){l.restoreToolbar()},updateMode:function(n){Pm(g,m,n,f.root())},socket:A(g),dropup:A(p)}):(t=b,r=xg({classes:[ai.resolve("ios-container")]}),o=_m(),i=Rf(),u=zm(i),c=Lm(),a=rg(function(){i.run(function(n){n.refreshStructure()})},t),r.add(o.wrapper()),r.add(c),r.add(a.component()),{system:A(r),element:r.element,init:function(n){i.set(Tp(n))},exit:function(){i.run(function(n){jl.remove(c,u),n.exit()})},setToolbarGroups:function(n){var e=o.createGroups(n);o.setGroups(e)},setContextToolbar:function(n){var e=o.createGroups(n);o.setContextToolbar(e)},focusToolbar:function(){o.focus()},restoreToolbar:function(){o.restoreToolbar()},updateMode:function(n){Pm(c,u,n,r.root())},socket:A(c),dropup:A(a)}),T=ue.fromDom(n.targetNode);we("element","offset"),h=w,(y=v=T,F.from(y.dom().nextSibling).map(ue.fromDom)).fold(function(){Ne(v).each(function(n){ze(n,h)})},function(n){var e,t;t=h,Ne(e=n).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})}),function(n,e){ze(n,e.element());var t=_e(e.element());bn(t,function(n){e.getByDom(n).each(Ue)})}(w,x.system());var S=n.targetNode.ownerDocument.defaultView,O=Od(S,{onChange:function(){x.system().broadcastOn([wo.orientationChanged()],{width:kd(S)})},onReady:I}),k=function(n,e,t,r){!1===r&&D.selection.collapse();var o=C(n,e,t);x.setToolbarGroups(!0===r?o.readOnly:o.main),D.setMode(!0===r?"readonly":"design"),D.fire(!0===r?Dp():Ip()),x.updateMode(r)},C=function(n,e,t){var r=n.get();return{readOnly:r.backToMask.concat(e.get()),main:r.backToMask.concat(t.get())}},E=function(n,e){return D.on(n,e),{unbind:function(){D.off(n)}}};return D.on("init",function(){x.init({editor:{getFrame:function(){return ue.fromDom(D.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:I}},onToReading:function(n){return E(Dp(),n)},onToEditing:function(n){return E(Ip(),n)},onScrollToCursor:function(e){return D.on("scrollIntoView",function(n){e(n)}),{unbind:function(){D.off("scrollIntoView"),O.destroy()}}},onTouchToolstrip:function(){t()},onTouchContent:function(){var n,e=ue.fromDom(D.editorContainer.querySelector("."+ai.resolve("toolbar")));(n=e,vo(n).bind(function(n){return x.system().getByDom(n).toOption()})).each(te),x.restoreToolbar(),t()},onTapContent:function(n){var e=n.target();"img"===me(e)?(D.selection.select(e.dom()),n.kill()):"a"===me(e)&&x.system().getByDom(ue.fromDom(D.editorContainer)).each(function(n){co.isAlpha(n)&&bo(e.dom())})}},container:ue.fromDom(D.editorContainer),socket:ue.fromDom(D.contentAreaContainer),toolstrip:ue.fromDom(D.editorContainer.querySelector("."+ai.resolve("toolstrip"))),toolbar:ue.fromDom(D.editorContainer.querySelector("."+ai.resolve("toolbar"))),dropup:x.dropup(),alloy:x.system(),translate:I,setReadOnly:function(n){k(a,c,u,n)},readOnlyOnInit:function(){return!1}});var t=function(){x.dropup().disappear(function(){x.system().broadcastOn([wo.dropupDismissed()],{})})},n={label:"The first group",scrollable:!1,items:[$a.forToolbar("back",function(){D.selection.collapse(),x.exit()},{})]},e={label:"Back to read only",scrollable:!1,items:[$a.forToolbar("readonly-back",function(){k(a,c,u,!0)},{})]},r=gd(x,D),o=pd(D.settings,r),i={label:"The extra group",scrollable:!1,items:[]},u=ao([{label:"the action group",scrollable:!0,items:o},i]),c=ao([{label:"The read only mode group",scrollable:!0,items:[]},i]),a=ao({backToMask:[n],backToReadOnly:[e]});Cp(x,D)}),D.on("remove",function(){x.exit()}),D.on("detach",function(){var e,n;e=x.system(),n=_e(e.element()),bn(n,function(n){e.getByDom(n).each(We)}),$e(e.element()),x.system().destroy(),$e(w)}),{iframeContainer:x.socket().element().dom(),editorContainer:x.element().dom()}}}})}(window);
1
+ /**
2
+ * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
+ * Licensed under the LGPL or a commercial license.
4
+ * For LGPL see License.txt in the project root for license information.
5
+ * For commercial licenses see https://www.tiny.cloud/
6
+ *
7
+ * Version: 5.0.0-1 (2019-02-04)
8
+ */
9
+ !function(n){"use strict";var y=function(){return(y=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function c(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&(t[r[o]]=n[r[o]])}return t}var z=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e]},v=function(t,r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,n))}},p=function(n){return function(){return n}},b=function(n){return n};function f(r){for(var o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=o.concat(n);return r.apply(null,t)}}var e,t,r,o,i,u,a,x=function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return!t.apply(null,n)}},s=function(n){return function(){throw new Error(n)}},l=function(n){return n()},d=p(!1),h=p(!0),m=d,g=h,w=function(){return M},M=(o={fold:function(n,e){return n()},is:m,isSome:m,isNone:g,getOr:r=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:t,map:w,ap:w,each:function(){},bind:w,flatten:w,exists:m,forall:g,filter:w,equals:e=function(n){return n.isNone()},equals_:e,toArray:function(){return[]},toString:p("none()")},Object.freeze&&Object.freeze(o),o),H=function(t){var n=function(){return t},e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:g,isNone:m,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return H(n(t))},ap:function(n){return n.fold(w,function(n){return H(n(t))})},each:function(n){n(t)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(t)?o:M},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(m,function(n){return e(t,n)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},S={some:H,none:w,from:function(n){return null===n||n===undefined?M:H(n)}},O=Object.keys,T=Object.hasOwnProperty,k=function(n,e){for(var t=O(n),r=0,o=t.length;r<o;r++){var i=t[r];e(n[i],i,n)}},V=function(n,r){return E(n,function(n,e,t){return{k:e,v:r(n,e,t)}})},E=function(r,o){var i={};return k(r,function(n,e){var t=o(n,e,r);i[t.k]=t.v}),i},C=function(n,t){var r=[];return k(n,function(n,e){r.push(t(n,e))}),r},D=function(n,e){return T.call(n,e)},A=p("touchstart"),L=p("touchmove"),I=p("touchend"),B=p("mousedown"),R=p("mousemove"),F=p("mouseup"),N=p("mouseover"),j=p("keydown"),P=p("keyup"),U=p("input"),G=p("change"),$=p("click"),W=p("transitionend"),_=p("selectstart"),q=function(t){var r,o=!1;return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return o||(o=!0,r=t.apply(null,n)),r}},X=function(n,e){var t=function(n,e){for(var t=0;t<n.length;t++){var r=n[t];if(r.test(e))return r}return undefined}(n,e);if(!t)return{major:0,minor:0};var r=function(n){return Number(e.replace(t,"$"+n))};return K(r(1),r(2))},Y=function(){return K(0,0)},K=function(n,e){return{major:n,minor:e}},J={nu:K,detect:function(n,e){var t=String(e).toLowerCase();return 0===n.length?Y():X(n,t)},unknown:Y},Q="Edge",Z="Chrome",nn="Opera",en="Firefox",tn=function(n,e){return function(){return e===n}},rn=function(n){var e=n.current;return{current:e,version:n.version,isEdge:tn(Q,e),isChrome:tn(Z,e),isIE:tn("IE",e),isOpera:tn(nn,e),isFirefox:tn(en,e),isSafari:tn("Safari",e)}},on={unknown:function(){return rn({current:undefined,version:J.unknown()})},nu:rn,edge:p(Q),chrome:p(Z),ie:p("IE"),opera:p(nn),firefox:p(en),safari:p("Safari")},un="Windows",an="Android",cn="Solaris",sn="FreeBSD",ln=function(n,e){return function(){return e===n}},fn=function(n){var e=n.current;return{current:e,version:n.version,isWindows:ln(un,e),isiOS:ln("iOS",e),isAndroid:ln(an,e),isOSX:ln("OSX",e),isLinux:ln("Linux",e),isSolaris:ln(cn,e),isFreeBSD:ln(sn,e)}},dn={unknown:function(){return fn({current:undefined,version:J.unknown()})},nu:fn,windows:p(un),ios:p("iOS"),android:p(an),linux:p("Linux"),osx:p("OSX"),solaris:p(cn),freebsd:p(sn)},hn=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&Array.prototype.isPrototypeOf(n)?"array":"object"===e&&String.prototype.isPrototypeOf(n)?"string":e}(n)===e}},mn=hn("string"),vn=hn("object"),gn=hn("array"),pn=hn("boolean"),bn=hn("function"),yn=hn("number"),zn=(i=Array.prototype.indexOf)===undefined?function(n,e){return En(n,e)}:function(n,e){return i.call(n,e)},wn=function(n,e){return-1<zn(n,e)},xn=function(n,e){return Vn(n,e).isSome()},Mn=function(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var i=n[o];r[o]=e(i,o,n)}return r},Hn=function(n,e){for(var t=0,r=n.length;t<r;t++)e(n[t],t,n)},Sn=function(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var i=n[r];e(i,r,n)&&t.push(i)}return t},On=function(n,e,t){return function(n,e){for(var t=n.length-1;0<=t;t--)e(n[t],t,n)}(n,function(n){t=e(t,n)}),t},Tn=function(n,e,t){return Hn(n,function(n){t=e(t,n)}),t},kn=function(n,e){for(var t=0,r=n.length;t<r;t++){var o=n[t];if(e(o,t,n))return S.some(o)}return S.none()},Vn=function(n,e){for(var t=0,r=n.length;t<r;t++)if(e(n[t],t,n))return S.some(t);return S.none()},En=function(n,e){for(var t=0,r=n.length;t<r;++t)if(n[t]===e)return t;return-1},Cn=Array.prototype.push,Dn=function(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!Array.prototype.isPrototypeOf(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);Cn.apply(e,n[t])}return e},An=function(n,e){var t=Mn(n,e);return Dn(t)},Ln=function(n,e){for(var t=0,r=n.length;t<r;++t)if(!0!==e(n[t],t,n))return!1;return!0},In=Array.prototype.slice,Bn=function(n){var e=In.call(n,0);return e.reverse(),e},Rn=function(n){return[n]},Fn=(bn(Array.from)&&Array.from,function(n,e){var t=String(e).toLowerCase();return kn(n,function(n){return n.search(t)})}),Nn=function(n,t){return Fn(n,t).map(function(n){var e=J.detect(n.versionRegexes,t);return{current:n.name,version:e}})},jn=function(n,t){return Fn(n,t).map(function(n){var e=J.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Pn=function(n,e){return-1!==n.indexOf(e)},Un=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Gn=function(e){return function(n){return Pn(n,e)}},$n=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return Pn(n,"edge/")&&Pn(n,"chrome")&&Pn(n,"safari")&&Pn(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Un],search:function(n){return Pn(n,"chrome")&&!Pn(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return Pn(n,"msie")||Pn(n,"trident")}},{name:"Opera",versionRegexes:[Un,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Gn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Gn("firefox")},{name:"Safari",versionRegexes:[Un,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(Pn(n,"safari")||Pn(n,"mobile/"))&&Pn(n,"applewebkit")}}],Wn=[{name:"Windows",search:Gn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return Pn(n,"iphone")||Pn(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Gn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Gn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Gn("linux"),versionRegexes:[]},{name:"Solaris",search:Gn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Gn("freebsd"),versionRegexes:[]}],_n={browsers:p($n),oses:p(Wn)},qn=function(n){var e,t,r,o,i,u,a,c,s,l,f,d=_n.browsers(),h=_n.oses(),m=Nn(d,n).fold(on.unknown,on.nu),v=jn(h,n).fold(dn.unknown,dn.nu);return{browser:m,os:v,deviceType:(t=m,r=n,o=(e=v).isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,u=e.isAndroid()&&3===e.version.major,a=e.isAndroid()&&4===e.version.major,c=o||u||a&&!0===/mobile/i.test(r),s=e.isiOS()||e.isAndroid(),l=s&&!c,f=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),{isiPad:p(o),isiPhone:p(i),isTablet:p(c),isPhone:p(l),isTouch:p(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:p(f)})}},Xn={detect:q(function(){var n=navigator.userAgent;return qn(n)})},Yn={tap:p("alloy.tap")},Kn=p("alloy.focus"),Jn=p("alloy.blur.post"),Qn=p("alloy.paste.post"),Zn=p("alloy.receive"),ne=p("alloy.execute"),ee=p("alloy.focus.item"),te=Yn.tap,re=Xn.detect().deviceType.isTouch()?Yn.tap:$,oe=p("alloy.longpress"),ie=p("alloy.system.init"),ue=p("alloy.system.attached"),ae=p("alloy.system.detached"),ce=p("alloy.focusmanager.shifted"),se=p("alloy.highlight"),le=p("alloy.dehighlight"),fe=function(n,e){ve(n,n.element(),e,{})},de=function(n,e,t){ve(n,n.element(),e,t)},he=function(n){fe(n,ne())},me=function(n,e,t){ve(n,e,t,{})},ve=function(n,e,t,r){var o=y({target:e},r);n.getSystem().triggerEvent(t,e,V(o,p))},ge=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:p(n)}},pe={fromHtml:function(n,e){var t=(e||document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return ge(t.childNodes[0])},fromTag:function(n,e){var t=(e||document).createElement(n);return ge(t)},fromText:function(n,e){var t=(e||document).createTextNode(n);return ge(t)},fromDom:ge,fromPoint:function(n,e,t){var r=n.dom();return S.from(r.elementFromPoint(e,t)).map(ge)}},be=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE),ye=(Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),ze=Node.TEXT_NODE,we=(Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,function(n){return n.dom().nodeName.toLowerCase()}),xe=function(e){return function(n){return n.dom().nodeType===e}},Me=xe(ye),He=xe(ze),Se=function(n){var e=He(n)?n.dom().parentNode:n.dom();return e!==undefined&&null!==e&&e.ownerDocument.body.contains(e)},Oe=q(function(){return Te(pe.fromDom(document))}),Te=function(n){var e=n.dom().body;if(null===e||e===undefined)throw new Error("Body is not available yet");return pe.fromDom(e)},ke=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(e.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+t.length+" arguments");var r={};return Hn(e,function(n,e){r[n]=p(t[e])}),r}},Ve=function(n){return n.slice(0).sort()},Ee=function(e,n){if(!gn(n))throw new Error("The "+e+" fields must be an array. Was: "+n+".");Hn(n,function(n){if(!mn(n))throw new Error("The value "+n+" in the "+e+" fields was not a string.")})},Ce=function(o,i){var t,u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return Ee("required",o),Ee("optional",i),t=Ve(u),kn(t,function(n,e){return e<t.length-1&&n===t[e+1]}).each(function(n){throw new Error("The field: "+n+" occurs more than once in the combined fields: ["+t.join(", ")+"].")}),function(e){var t=O(e);Ln(o,function(n){return wn(t,n)})||function(n,e){throw new Error("All required keys ("+Ve(n).join(", ")+") were not specified. Specified keys were: "+Ve(e).join(", ")+".")}(o,t);var n=Sn(t,function(n){return!wn(u,n)});0<n.length&&function(n){throw new Error("Unsupported keys for object: "+Ve(n).join(", "))}(n);var r={};return Hn(o,function(n){r[n]=p(e[n])}),Hn(i,function(n){r[n]=p(Object.prototype.hasOwnProperty.call(e,n)?S.some(e[n]):S.none())}),r}},De="undefined"!=typeof window?window:Function("return this;")(),Ae=function(n,e){return function(n,e){for(var t=e!==undefined&&null!==e?e:De,r=0;r<n.length&&t!==undefined&&null!==t;++r)t=t[n[r]];return t}(n.split("."),e)},Le={getOrDie:function(n,e){var t=Ae(n,e);if(t===undefined||null===t)throw n+" not available on this browser";return t}},Ie=ye,Be=be,Re=function(n,e){var t=n.dom();if(t.nodeType!==Ie)return!1;if(t.matches!==undefined)return t.matches(e);if(t.msMatchesSelector!==undefined)return t.msMatchesSelector(e);if(t.webkitMatchesSelector!==undefined)return t.webkitMatchesSelector(e);if(t.mozMatchesSelector!==undefined)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Fe=function(n){return n.nodeType!==Ie&&n.nodeType!==Be||0===n.childElementCount},Ne=function(n,e){var t=e===undefined?document:e.dom();return Fe(t)?[]:Mn(t.querySelectorAll(n),pe.fromDom)},je=function(n,e){var t=e===undefined?document:e.dom();return Fe(t)?S.none():S.from(t.querySelector(n)).map(pe.fromDom)},Pe=function(n,e){return n.dom()===e.dom()},Ue=(Xn.detect().browser.isIE(),function(n){return pe.fromDom(n.dom().ownerDocument)}),Ge=function(n){var e=n.dom();return S.from(e.parentNode).map(pe.fromDom)},$e=function(n){var e=n.dom();return Mn(e.childNodes,pe.fromDom)},We=function(n,e){var t=n.dom().childNodes;return S.from(t[e]).map(pe.fromDom)},_e=(ke("element","offset"),function(e,t){Ge(e).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})}),qe=function(n,e){var t;(t=n.dom(),S.from(t.nextSibling).map(pe.fromDom)).fold(function(){Ge(n).each(function(n){Ye(n,e)})},function(n){_e(n,e)})},Xe=function(e,t){We(e,0).fold(function(){Ye(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})},Ye=function(n,e){n.dom().appendChild(e.dom())},Ke=function(e,n){Hn(n,function(n){Ye(e,n)})},Je=function(n){n.dom().textContent="",Hn($e(n),function(n){Qe(n)})},Qe=function(n){var e=n.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},Ze=function(n){fe(n,ae());var e=n.components();Hn(e,Ze)},nt=function(n){var e=n.components();Hn(e,nt),fe(n,ue())},et=function(n,e){tt(n,e,Ye)},tt=function(n,e,t){n.getSystem().addToWorld(e),t(n.element(),e.element()),Se(n.element())&&nt(e),n.syncComponents()},rt=function(n){Ze(n),Qe(n.element()),n.getSystem().removeFromWorld(n)},ot=function(e){var n=Ge(e.element()).bind(function(n){return e.getSystem().getByDom(n).fold(S.none,S.some)});rt(e),n.each(function(n){n.syncComponents()})},it=function(n,e,t){t(n,e.element());var r=$e(e.element());Hn(r,function(n){e.getByDom(n).each(nt)})},ut=function(t){return{is:function(n){return t===n},isValue:h,isError:d,getOr:p(t),getOrThunk:p(t),getOrDie:p(t),or:function(n){return ut(t)},orThunk:function(n){return ut(t)},fold:function(n,e){return e(t)},map:function(n){return ut(n(t))},mapError:function(n){return ut(t)},each:function(n){n(t)},bind:function(n){return n(t)},exists:function(n){return n(t)},forall:function(n){return n(t)},toOption:function(){return S.some(t)}}},at=function(t){return{is:d,isValue:d,isError:h,getOr:b,getOrThunk:function(n){return n()},getOrDie:function(){return s(String(t))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return at(t)},mapError:function(n){return at(n(t))},each:z,bind:function(n){return at(t)},exists:d,forall:h,toOption:S.none}},ct={value:ut,error:at},st=function(u){if(!gn(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],t={};return Hn(u,function(n,r){var e=O(n);if(1!==e.length)throw new Error("one and only one name per case");var o=e[0],i=n[o];if(t[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!gn(i))throw new Error("case arguments must be an array");a.push(o),t[o]=function(){var n=arguments.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+n);for(var t=new Array(n),e=0;e<t.length;e++)t[e]=arguments[e];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,t)},match:function(n){var e=O(n);if(a.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+e.join(","));if(!Ln(a,function(n){return wn(e,n)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+a.join(", "));return n[o].apply(null,t)},log:function(n){console.log(n,{constructors:a,constructor:o,params:t})}}}}),t},lt=Object.prototype.hasOwnProperty,ft=function(u){return function(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];if(0===n.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<n.length;r++){var o=n[r];for(var i in o)lt.call(o,i)&&(t[i]=u(t[i],o[i]))}return t}},dt=ft(function(n,e){return vn(n)&&vn(e)?dt(n,e):e}),ht=ft(function(n,e){return e}),mt=st([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),vt=function(n){return mt.defaultedThunk(p(n))},gt=mt.strict,pt=mt.asOption,bt=mt.defaultedThunk,yt=(mt.asDefaultedOptionThunk,mt.mergeWithThunk),zt=function(e){return function(n){return D(n,e)?S.from(n[e]):S.none()}},wt=function(n,e){return zt(e)(n)},xt=function(n,e){var t={};return t[n]=e,t},Mt=(st([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n){return zt(n)}),Ht=function(n,e){return t=n,r=e,function(n){return D(n,t)?n[t]:r};var t,r},St=function(n,e){return wt(n,e)},Ot=function(n,e){return xt(n,e)},Tt=function(n){return e={},Hn(n,function(n){e[n.key]=n.value}),e;var e},kt=function(n,e){var t,r,o,i,u,a=(t=[],r=[],Hn(n,function(n){n.fold(function(n){t.push(n)},function(n){r.push(n)})}),{errors:t,values:r});return 0<a.errors.length?(u=a.errors,v(ct.error,Dn)(u)):(i=e,0===(o=a.values).length?ct.value(i):ct.value(dt(i,ht.apply(undefined,o))))},Vt=function(n,e){return D(t=n,r=e)&&t[r]!==undefined&&null!==t[r];var t,r};(a=u||(u={}))[a.Error=0]="Error",a[a.Value=1]="Value";var Et,Ct,Dt=function(n,e,t){return n.stype===u.Error?e(n.serror):t(n.svalue)},At=function(n){return{stype:u.Value,svalue:n}},Lt=function(n){return{stype:u.Error,serror:n}},It=function(n){return n.fold(Lt,At)},Bt=function(n){return Dt(n,ct.error,ct.value)},Rt=At,Ft=function(n){var e=[],t=[];return Hn(n,function(n){Dt(n,function(n){return t.push(n)},function(n){return e.push(n)})}),{values:e,errors:t}},Nt=Lt,jt=function(n,e){return n.stype===u.Value?e(n.svalue):n},Pt=function(n,e){return n.stype===u.Error?e(n.serror):n},Ut=function(n,e){return n.stype===u.Value?{stype:u.Value,svalue:e(n.svalue)}:n},Gt=function(n,e){return n.stype===u.Error?{stype:u.Error,serror:e(n.serror)}:n},$t=function(n){return v(Nt,Dn)(n)},Wt=function(n,e){var t,r,o=Ft(n);return 0<o.errors.length?$t(o.errors):(t=o.values,r=e,0<t.length?Rt(dt(r,ht.apply(undefined,t))):Rt(r))},_t=function(n){var e=Ft(n);return 0<e.errors.length?$t(e.errors):Rt(e.values)},qt=st([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),Xt=st([{field:["name","presence","type"]},{state:["name"]}]),Yt=function(){return Le.getOrDie("JSON")},Kt=function(n,e,t){return Yt().stringify(n,e,t)},Jt=function(n){return vn(n)&&100<O(n).length?" removed due to size":Kt(n,null,2)},Qt=function(n,e){return Nt([{path:n,getErrorInfo:e}])},Zt=st([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),nr=function(t,r,o){return wt(r,o).fold(function(){return n=o,e=r,Qt(t,function(){return'Could not find valid *strict* value for "'+n+'" in '+Jt(e)});var n,e},Rt)},er=function(n,e,t){var r=wt(n,e).fold(function(){return t(n)},b);return Rt(r)},tr=function(a,c,n,s){return n.fold(function(o,t,n,r){var i=function(n){var e=r.extract(a.concat([o]),s,n);return Ut(e,function(n){return xt(t,s(n))})},u=function(n){return n.fold(function(){var n=xt(t,s(S.none()));return Rt(n)},function(n){var e=r.extract(a.concat([o]),s,n);return Ut(e,function(n){return xt(t,s(S.some(n)))})})};return n.fold(function(){return jt(nr(a,c,o),i)},function(n){return jt(er(c,o,n),i)},function(){return jt(Rt(wt(c,o)),u)},function(n){return jt((t=n,r=wt(e=c,o).map(function(n){return!0===n?t(e):n}),Rt(r)),u);var e,t,r},function(n){var e=n(c),t=Ut(er(c,o,p({})),function(n){return dt(e,n)});return jt(t,i)})},function(n,e){var t=e(c);return Rt(xt(n,s(t)))})},rr=function(r){return{extract:function(t,n,e){return Pt(r(e,n),function(n){return e=n,Qt(t,function(){return e});var e})},toString:function(){return"val"},toDsl:function(){return qt.itemOf(r)}}},or=function(n){var c=ir(n),s=On(n,function(e,n){return n.fold(function(n){return dt(e,Ot(n,!0))},p(e))},{});return{extract:function(n,e,t){var r,o,i,u=pn(t)?[]:(o=O(r=t),Sn(o,function(n){return Vt(r,n)})),a=Sn(u,function(n){return!Vt(s,n)});return 0===a.length?c.extract(n,e,t):(i=a,Qt(n,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:c.toString,toDsl:c.toDsl}},ir=function(a){return{extract:function(n,e,t){return r=n,o=t,i=e,u=Mn(a,function(n){return tr(r,o,n,i)}),Wt(u,{});var r,o,i,u},toString:function(){return"obj{\n"+Mn(a,function(n){return n.fold(function(n,e,t,r){return n+" -> "+r.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return qt.objOf(Mn(a,function(n){return n.fold(function(n,e,t,r){return Xt.field(n,t,r)},function(n,e){return Xt.state(n)})}))}}},ur=function(t,i){var u=function(n,e){return(o=rr(t),{extract:function(t,r,n){var e=Mn(n,function(n,e){return o.extract(t.concat(["["+e+"]"]),r,n)});return _t(e)},toString:function(){return"array("+o.toString()+")"},toDsl:function(){return qt.arrOf(o)}}).extract(n,b,e);var o};return{extract:function(t,r,o){var n=O(o),e=u(t,n);return jt(e,function(n){var e=Mn(n,function(n){return Zt.field(n,n,gt(),i)});return ir(e).extract(t,r,o)})},toString:function(){return"setOf("+i.toString()+")"},toDsl:function(){return qt.setOf(t,i)}}},ar=p(rr(Rt)),cr=Zt.state,sr=Zt.field,lr=function(t,e,r,o,i){return St(o,i).fold(function(){return n=o,e=i,Qt(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Jt(n)});var n,e},function(n){return ir(n).extract(t.concat(["branch: "+i]),e,r)})},fr=function(o,i){return{extract:function(e,t,r){return St(r,o).fold(function(){return n=o,Qt(e,function(){return'Choice schema did not contain choice key: "'+n+'"'});var n},function(n){return lr(e,t,r,i,n)})},toString:function(){return"chooseOn("+o+"). Possible values: "+O(i)},toDsl:function(){return qt.choiceOf(o,i)}}},dr=rr(Rt),hr=function(e){return rr(function(n){return e(n).fold(Nt,Rt)})},mr=function(e,n){return ur(function(n){return It(e(n))},n)},vr=function(n,e,t){return Bt((r=n,o=b,i=t,u=e.extract([r],o,i),Gt(u,function(n){return{input:i,errors:n}})));var r,o,i,u},gr=function(n){return n.fold(function(n){throw new Error(br(n))},b)},pr=function(n,e,t){return gr(vr(n,e,t))},br=function(n){return"Errors: \n"+(e=n.errors,t=10<e.length?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,Mn(t,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()}))+"\n\nInput object: "+Jt(n.input);var e,t},yr=function(n,e){return fr(n,e)},zr=p(dr),wr=(Et=bn,Ct="function",rr(function(n){var e=typeof n;return Et(n)?Rt(n):Nt("Expected type: "+Ct+" but got: "+e)})),xr=function(n){return sr(n,n,gt(),ar())},Mr=function(n,e){return sr(n,n,gt(),e)},Hr=function(n,e){return sr(n,n,gt(),ir(e))},Sr=function(n){return sr(n,n,pt(),ar())},Or=function(n,e){return sr(n,n,pt(),ir(e))},Tr=function(n,e){return sr(n,n,pt(),or(e))},kr=function(n,e){return sr(n,n,vt(e),ar())},Vr=function(n,e,t){return sr(n,n,vt(e),t)},Er=function(n,e){return cr(n,e)},Cr=function(n,e){return Pe(n.element(),e.event().target())},Dr=function(n){if(!Vt(n,"can")&&!Vt(n,"abort")&&!Vt(n,"run"))throw new Error("EventHandler defined by: "+Kt(n,null,2)+" does not have can, abort, or run!");return pr("Extracting event.handler",or([kr("can",p(!0)),kr("abort",p(!1)),kr("run",z)]),n)},Ar=function(t){var e,r,o,i,n=(e=t,r=function(n){return n.can},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Tn(e,function(n,e){return n&&r(e).apply(undefined,t)},!0)}),u=(o=t,i=function(n){return n.abort},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Tn(o,function(n,e){return n||i(e).apply(undefined,t)},!1)});return Dr({can:n,abort:u,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];Hn(t,function(n){n.run.apply(undefined,e)})}})};function Lr(n,e,t,r,o){return n(t,r)?S.some(t):bn(o)&&o(t)?S.none():e(t,r,o)}var Ir,Br,Rr,Fr=function(n,e,t){for(var r=n.dom(),o=bn(t)?t:p(!1);r.parentNode;){r=r.parentNode;var i=pe.fromDom(r);if(e(i))return S.some(i);if(o(i))break}return S.none()},Nr=function(n,e,t){return Lr(function(n){return e(n)},Fr,n,e,t)},jr=function(n,r){var o=function(n){for(var e=0;e<n.childNodes.length;e++){if(r(pe.fromDom(n.childNodes[e])))return S.some(pe.fromDom(n.childNodes[e]));var t=o(n.childNodes[e]);if(t.isSome())return t}return S.none()};return o(n.dom())},Pr=function(n,e,t){return Nr(n,function(n){return e(n).isSome()},t).bind(e)},Ur=function(n){return Tt(n)},Gr=function(n,e){return{key:n,value:Dr({abort:e})}},$r=function(n,e){return{key:n,value:Dr({run:e})}},Wr=function(n,e,t){return{key:n,value:Dr({run:function(n){e.apply(undefined,[n].concat(t))}})}},_r=function(n){return function(t){return{key:n,value:Dr({run:function(n,e){Cr(n,e)&&t(n,e)}})}}},qr=function(n,e,t){var u,r,o=e.partUids[t];return r=o,$r(u=n,function(n,i){n.getSystem().getByUid(r).each(function(n){var e,t,r,o;t=(e=n).element(),r=u,o=i,e.getSystem().triggerEvent(r,t,o.event())})})},Xr=function(n){return $r(n,function(n,e){e.cut()})},Yr=_r(ue()),Kr=_r(ae()),Jr=_r(ie()),Qr=(Ir=ne(),function(n){return $r(Ir,n)}),Zr=function(n){return Mn(n,function(n){return r=e="/*",o=(t=n).length-e.length,""!==r&&(t.length<r.length||t.substr(o,o+r.length)!==r)?n:n.substring(0,n.length-"/*".length);var e,t,r,o})},no=function(n,e){var t=n.toString(),r=t.indexOf(")")+1,o=t.indexOf("("),i=t.substring(o+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:e,parameters:Zr(i)}},n},eo=function(n){return{classes:n.classes!==undefined?n.classes:[],attributes:n.attributes!==undefined?n.attributes:{},styles:n.styles!==undefined?n.styles:{}}},to=function(t,r,o){return Jr(function(n,e){o(n,t,r)})},ro=function(n,e,t,r,o,i){var u,a,c=n,s=Or(e,[(u="config",a=n,sr(u,u,pt(),a))]);return uo(c,s,e,t,r,o,i)},oo=function(o,i,u){var n,e,t,r,a,c;return n=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var r=[t].concat(n);return t.config({name:p(o)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+o+". Using API: "+u)},function(n){var e=Array.prototype.slice.call(r,1);return i.apply(undefined,[t,n.config,n.state].concat(e))})},e=u,t=i.toString(),r=t.indexOf(")")+1,a=t.indexOf("("),c=t.substring(a+1,r-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:e,parameters:Zr(c.slice(0,1).concat(c.slice(3)))}},n},io=function(n){return{key:n,value:undefined}},uo=function(t,n,r,o,e,i,u){var a=function(n){return Vt(n,r)?n[r]():S.none()},c=V(e,function(n,e){return oo(r,n,e)}),s=V(i,function(n,e){return no(n,e)}),l=y({},s,c,{revoke:f(io,r),config:function(n){var e=pr(r+"-config",t,n);return{key:r,value:{config:e,me:l,configAsRaw:q(function(){return pr(r+"-config",t,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,t){return a(n).bind(function(e){return St(o,"exhibit").map(function(n){return n(t,e.config,e.state)})}).getOr(eo({}))},name:function(){return r},handlers:function(n){return a(n).map(function(n){return Ht("events",function(n,e){return{}})(o)(n.config,n.state)}).getOr({})}});return l},ao={init:function(){return co({readState:function(){return"No State required"}})}},co=function(n){return n},so=function(n){return Tt(n)},lo=or([xr("fields"),xr("name"),kr("active",{}),kr("apis",{}),kr("state",ao),kr("extra",{})]),fo=function(n){var e,t,r,o,i,u,a,c,s=pr("Creating behaviour: "+n.name,lo,n);return e=s.fields,t=s.name,r=s.active,o=s.apis,i=s.extra,u=s.state,a=or(e),c=Or(t,[Tr("config",e)]),uo(a,c,t,r,o,i,u)},ho=or([xr("branchKey"),xr("branches"),xr("name"),kr("active",{}),kr("apis",{}),kr("state",ao),kr("extra",{})]),mo=p(undefined),vo=function(n,e,t){if(!(mn(t)||pn(t)||yn(t)))throw console.error("Invalid call to Attr.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")},go=function(n,e,t){vo(n.dom(),e,t)},po=function(n,e){var t=n.dom();k(e,function(n,e){vo(t,e,n)})},bo=function(n,e){var t=n.dom().getAttribute(e);return null===t?undefined:t},yo=function(n,e){var t=n.dom();return!(!t||!t.hasAttribute)&&t.hasAttribute(e)},zo=function(n,e){n.dom().removeAttribute(e)},wo=function(n,e){var t=bo(n,e);return t===undefined||""===t?[]:t.split(" ")},xo=function(n){return n.dom().classList!==undefined},Mo=function(n,e){return o=e,i=wo(t=n,r="class").concat([o]),go(t,r,i.join(" ")),!0;var t,r,o,i},Ho=function(n,e){return o=e,0<(i=Sn(wo(t=n,r="class"),function(n){return n!==o})).length?go(t,r,i.join(" ")):zo(t,r),!1;var t,r,o,i},So=function(n,e){xo(n)?n.dom().classList.add(e):Mo(n,e)},Oo=function(n){0===(xo(n)?n.dom().classList:wo(n,"class")).length&&zo(n,"class")},To=function(n,e){xo(n)?n.dom().classList.remove(e):Ho(n,e),Oo(n)},ko=function(n,e){return xo(n)&&n.dom().classList.contains(e)},Vo=function(n,e,t){To(n,t),So(n,e)},Eo=/* */Object.freeze({toAlpha:function(n,e,t){Vo(n.element(),e.alpha,e.omega)},toOmega:function(n,e,t){Vo(n.element(),e.omega,e.alpha)},isAlpha:function(n,e,t){return ko(n.element(),e.alpha)},isOmega:function(n,e,t){return ko(n.element(),e.omega)},clear:function(n,e,t){To(n.element(),e.alpha),To(n.element(),e.omega)}}),Co=[xr("alpha"),xr("omega")],Do=fo({fields:Co,name:"swapping",apis:Eo}),Ao=function(n){var e=n,t=function(){return e};return{get:t,set:function(n){e=n},clone:function(){return Ao(t())}}},Lo=function(n){n.dom().focus()},Io=function(n){n.dom().blur()},Bo=function(n){var e=n!==undefined?n.dom():document;return S.from(e.activeElement).map(pe.fromDom)},Ro=function(e){return Bo(Ue(e)).filter(function(n){return e.dom().contains(n.dom())})},Fo=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),No=tinymce.util.Tools.resolve("tinymce.ThemeManager"),jo=function(n){var e=document.createElement("a");e.target="_blank",e.href=n.href,e.rel="noreferrer noopener";var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)},Po={formatChanged:p("formatChanged"),orientationChanged:p("orientationChanged"),dropupDismissed:p("dropupDismissed")},Uo=function(n){return n.dom().innerHTML},Go=function(n,e){var t,r,o=Ue(n).dom(),i=pe.fromDom(o.createDocumentFragment()),u=(t=e,(r=(o||document).createElement("div")).innerHTML=t,$e(pe.fromDom(r)));Ke(i,u),Je(n),Ye(n,i)},$o=function(n){return e=n,t=!1,pe.fromDom(e.dom().cloneNode(t));var e,t},Wo=function(n){var e,t,r,o=$o(n);return e=o,t=pe.fromTag("div"),r=pe.fromDom(e.dom().cloneNode(!0)),Ye(t,r),Uo(t)},_o=function(n){return Wo(n)},qo=/* */Object.freeze({events:function(a){return Ur([$r(Zn(),function(o,i){var n,e,u=a.channels,t=O(u),r=(n=t,(e=i).universal()?n:Sn(n,function(n){return wn(e.channels(),n)}));Hn(r,function(n){var e=u[n],t=e.schema,r=pr("channel["+n+"] data\nReceiver: "+_o(o.element()),t,i.data());e.onReceive(o,r)})})])}}),Xo=function(n){for(var e=[],t=function(n){e.push(n)},r=0;r<n.length;r++)n[r].each(t);return e},Yo=function(n,e){for(var t=0;t<n.length;t++){var r=e(n[t],t);if(r.isSome())return r}return S.none()},Ko="unknown";(Rr=Br||(Br={}))[Rr.STOP=0]="STOP",Rr[Rr.NORMAL=1]="NORMAL",Rr[Rr.LOGGING=2]="LOGGING";var Jo=Ao({}),Qo=function(e,n,t){var r,o,i,u;switch(St(Jo.get(),e).orThunk(function(){var n=O(Jo.get());return Yo(n,function(n){return-1<e.indexOf(n)?S.some(Jo.get()[n]):S.none()})}).getOr(Br.NORMAL)){case Br.NORMAL:return t(ei());case Br.LOGGING:var a=(r=e,o=n,i=[],u=(new Date).getTime(),{logEventCut:function(n,e,t){i.push({outcome:"cut",target:e,purpose:t})},logEventStopped:function(n,e,t){i.push({outcome:"stopped",target:e,purpose:t})},logNoParent:function(n,e,t){i.push({outcome:"no-parent",target:e,purpose:t})},logEventNoHandlers:function(n,e){i.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(n,e,t){i.push({outcome:"response",purpose:t,target:e})},write:function(){var n=(new Date).getTime();wn(["mousemove","mouseover","mouseout",ie()],r)||console.log(r,{event:r,time:n-u,target:o.dom(),sequence:Mn(i,function(n){return wn(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+_o(n.target)+")":n.outcome})})}}),c=t(a);return a.write(),c;case Br.STOP:return!0}},Zo=["alloy/data/Fields","alloy/debugging/Debugging"],ni=function(n,e,t){return Qo(n,e,t)},ei=p({logEventCut:z,logEventStopped:z,logNoParent:z,logEventNoHandlers:z,logEventResponse:z,write:z}),ti=p([xr("menu"),xr("selectedMenu")]),ri=p([xr("item"),xr("selectedItem")]),oi=(p(ir(ri().concat(ti()))),p(ir(ri()))),ii=Hr("initSize",[xr("numColumns"),xr("numRows")]),ui=function(n,e,t){return function(){var n=new Error;if(n.stack!==undefined){var e=n.stack.split("\n");kn(e,function(e){return 0<e.indexOf("alloy")&&!xn(Zo,function(n){return-1<e.indexOf(n)})}).getOr(Ko)}}(),sr(e,e,t,hr(function(t){return ct.value(function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.apply(undefined,n)})}))},ai=function(n){return ui(0,n,vt(z))},ci=function(n){return ui(0,n,vt(S.none))},si=function(n){return ui(0,n,gt())},li=function(n){return ui(0,n,gt())},fi=function(n,e){return Er(n,p(e))},di=function(n){return Er(n,b)},hi=p(ii),mi=[Mr("channels",mr(ct.value,or([si("onReceive"),kr("schema",zr())])))],vi=fo({fields:mi,name:"receiving",active:qo}),gi=function(n,e,t){var r=e.aria;r.update(n,r,t.get())},pi=function(e,n,t){n.toggleClass.each(function(n){t.get()?So(e.element(),n):To(e.element(),n)})},bi=function(n,e,t){wi(n,e,t,!t.get())},yi=function(n,e,t){t.set(!0),pi(n,e,t),gi(n,e,t)},zi=function(n,e,t){t.set(!1),pi(n,e,t),gi(n,e,t)},wi=function(n,e,t,r){(r?yi:zi)(n,e,t)},xi=function(n,e,t){wi(n,e,t,e.selected)},Mi=/* */Object.freeze({onLoad:xi,toggle:bi,isOn:function(n,e,t){return t.get()},on:yi,off:zi,set:wi}),Hi=/* */Object.freeze({exhibit:function(n,e,t){return eo({})},events:function(n,e){var t,r,o,i=(t=n,r=e,o=bi,Qr(function(n){o(n,t,r)})),u=to(n,e,xi);return Ur(Dn([n.toggleOnExecute?[i]:[],[u]]))}}),Si=/* */Object.freeze({init:function(n){var e=Ao(!1);return{readState:function(){return e.get()},get:function(){return e.get()},set:function(n){return e.set(n)},clear:function(){return e.set(!1)}}}}),Oi=function(n,e,t){go(n.element(),"aria-expanded",t)},Ti=[kr("selected",!1),Sr("toggleClass"),kr("toggleOnExecute",!0),Vr("aria",{mode:"none"},yr("mode",{pressed:[kr("syncWithExpanded",!1),fi("update",function(n,e,t){go(n.element(),"aria-pressed",t),e.syncWithExpanded&&Oi(n,e,t)})],checked:[fi("update",function(n,e,t){go(n.element(),"aria-checked",t)})],expanded:[fi("update",Oi)],selected:[fi("update",function(n,e,t){go(n.element(),"aria-selected",t)})],none:[fi("update",z)]}))],ki=fo({fields:Ti,name:"toggling",active:Hi,apis:Mi,state:Si}),Vi=function(t,r){return vi.config({channels:Ot(Po.formatChanged(),{onReceive:function(n,e){e.command===t&&r(n,e.state)}})})},Ei=function(n){return vi.config({channels:Ot(Po.orientationChanged(),{onReceive:n})})},Ci=function(n,e){return{key:n,value:{onReceive:e}}},Di="tinymce-mobile",Ai={resolve:function(n){return Di+"-"+n},prefix:p(Di)},Li=function(n,e){e.ignore||(Lo(n.element()),e.onFocus(n))},Ii=/* */Object.freeze({focus:Li,blur:function(n,e){e.ignore||Io(n.element())},isFocused:function(n){return e=n.element(),t=Ue(e).dom(),e.dom()===t.activeElement;var e,t}}),Bi=/* */Object.freeze({exhibit:function(n,e){var t=e.ignore?{}:{attributes:{tabindex:"-1"}};return eo(t)},events:function(t){return Ur([$r(Kn(),function(n,e){Li(n,t),e.stop()})].concat(t.stopMousedown?[$r(B(),function(n,e){e.event().prevent()})]:[]))}}),Ri=[ai("onFocus"),kr("stopMousedown",!1),kr("ignore",!1)],Fi=fo({fields:Ri,name:"focusing",active:Bi,apis:Ii}),Ni=function(n){return n.style!==undefined},ji=function(n,e,t){if(!mn(t))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);Ni(n)&&n.style.setProperty(e,t)},Pi=function(n,e,t){var r=n.dom();ji(r,e,t)},Ui=function(n,e){var t=n.dom();k(e,function(n,e){ji(t,e,n)})},Gi=function(n,e){var t=n.dom(),r=window.getComputedStyle(t).getPropertyValue(e),o=""!==r||Se(n)?r:$i(t,e);return null===o?undefined:o},$i=function(n,e){return Ni(n)?n.style.getPropertyValue(e):""},Wi=function(n,e){var t=n.dom(),r=$i(t,e);return S.from(r).filter(function(n){return 0<n.length})},_i=function(n,e){var t,r,o=n.dom();r=e,Ni(t=o)&&t.style.removeProperty(r),yo(n,"style")&&""===bo(n,"style").replace(/^\s+|\s+$/g,"")&&zo(n,"style")},qi=function(n){return n.dom().offsetWidth};function Xi(r,o){var n=function(n){var e=o(n);if(e<=0||null===e){var t=Gi(n,r);return parseFloat(t)||0}return e},i=function(o,n){return Tn(n,function(n,e){var t=Gi(o,e),r=t===undefined?0:parseInt(t,10);return isNaN(r)?n:n+r},0)};return{set:function(n,e){if(!yn(e)&&!e.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+e);var t=n.dom();Ni(t)&&(t.style[r]=e+"px")},get:n,getOuter:n,aggregate:i,max:function(n,e,t){var r=i(n,t);return r<e?e-r:0}}}var Yi,Ki,Ji=Xi("height",function(n){var e=n.dom();return Se(n)?e.getBoundingClientRect().height:e.offsetHeight}),Qi=function(n){return Ji.get(n)},Zi=function(n,e,t){return Sn(function(n,e){for(var t=bn(e)?e:p(!1),r=n.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=pe.fromDom(i);if(o.push(u),!0===t(u))break;r=i}return o}(n,t),e)},nu=function(n,e){return Sn(Ge(t=n).map($e).map(function(n){return Sn(n,function(n){return!Pe(t,n)})}).getOr([]),e);var t},eu=function(n,e){return Ne(e,n)},tu=function(n){return je(n)},ru=function(n,e,t){return Fr(n,function(n){return Re(n,e)},t)},ou=function(n,e){return je(e,n)},iu=function(n,e,t){return Lr(Re,ru,n,e,t)},uu=function(n,e,t){var r=Bn(n.slice(0,e)),o=Bn(n.slice(e+1));return kn(r.concat(o),t)},au=function(n,e,t){var r=Bn(n.slice(0,e));return kn(r,t)},cu=function(n,e,t){var r=n.slice(0,e),o=n.slice(e+1);return kn(o.concat(r),t)},su=function(n,e,t){var r=n.slice(e+1);return kn(r,t)},lu=function(t){return function(n){var e=n.raw();return wn(t,e.which)}},fu=function(n){return function(e){return Ln(n,function(n){return n(e)})}},du=function(n){return!0===n.raw().shiftKey},hu=function(n){return!0===n.raw().ctrlKey},mu=x(du),vu=function(n,e){return{matches:n,classification:e}},gu=function(n,e,t,r){var o=n+e;return r<o?t:o<t?r:o},pu=function(n,e,t){return n<=e?e:t<=n?t:n},bu=function(t,r,n,o){var e=eu(t.element(),"."+r.highlightClass);Hn(e,function(e){xn(o,function(n){return n.element()===e})||(To(e,r.highlightClass),t.getSystem().getByDom(e).each(function(n){r.onDehighlight(t,n),fe(n,le())}))})},yu=function(n,e,t,r){bu(n,e,0,[r]),zu(n,e,t,r)||(So(r.element(),e.highlightClass),e.onHighlight(n,r),fe(r,se()))},zu=function(n,e,t,r){return ko(r.element(),e.highlightClass)},wu=function(n,e,t,r){var o=eu(n.element(),"."+e.itemClass);return S.from(o[r]).fold(function(){return ct.error("No element found with index "+r)},n.getSystem().getByDom)},xu=function(e,n,t){return ou(e.element(),"."+n.itemClass).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Mu=function(e,n,t){var r=eu(e.element(),"."+n.itemClass);return(0<r.length?S.some(r[r.length-1]):S.none()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Hu=function(t,e,n,r){var o=eu(t.element(),"."+e.itemClass);return Vn(o,function(n){return ko(n,e.highlightClass)}).bind(function(n){var e=gu(n,r,0,o.length-1);return t.getSystem().getByDom(o[e]).toOption()})},Su=function(e,n,t){var r=eu(e.element(),"."+n.itemClass);return Xo(Mn(r,function(n){return e.getSystem().getByDom(n).toOption()}))},Ou=/* */Object.freeze({dehighlightAll:function(n,e,t){return bu(n,e,0,[])},dehighlight:function(n,e,t,r){zu(n,e,t,r)&&(To(r.element(),e.highlightClass),e.onDehighlight(n,r),fe(r,le()))},highlight:yu,highlightFirst:function(e,t,r){xu(e,t,r).each(function(n){yu(e,t,r,n)})},highlightLast:function(e,t,r){Mu(e,t,r).each(function(n){yu(e,t,r,n)})},highlightAt:function(e,t,r,n){wu(e,t,r,n).fold(function(n){throw new Error(n)},function(n){yu(e,t,r,n)})},highlightBy:function(e,t,r,n){var o=Su(e,t,r);kn(o,n).each(function(n){yu(e,t,r,n)})},isHighlighted:zu,getHighlighted:function(e,n,t){return ou(e.element(),"."+n.highlightClass).bind(function(n){return e.getSystem().getByDom(n).toOption()})},getFirst:xu,getLast:Mu,getPrevious:function(n,e,t){return Hu(n,e,0,-1)},getNext:function(n,e,t){return Hu(n,e,0,1)},getCandidates:Su}),Tu=[xr("highlightClass"),xr("itemClass"),ai("onHighlight"),ai("onDehighlight")],ku=fo({fields:Tu,name:"highlighting",apis:Ou}),Vu=function(n,e,t){e.exists(function(e){return t.exists(function(n){return Pe(n,e)})})||de(n,ce(),{prevFocus:e,newFocus:t})},Eu=function(){var o=function(n){return Ro(n.element())};return{get:o,set:function(n,e){var t=o(n);n.getSystem().triggerFocus(e,n.element());var r=o(n);Vu(n,t,r)}}};(Ki=Yi||(Yi={})).OnFocusMode="onFocus",Ki.OnEnterOrSpaceMode="onEnterOrSpace",Ki.OnApiMode="onApi";var Cu,Du,Au=function(n,e,t,r,a){var c=function(e,t,n,r,o){var i,u,a=n(e,t,r,o);return(i=a,u=t.event(),kn(i,function(n){return n.matches(u)}).map(function(n){return n.classification})).bind(function(n){return n(e,t,r,o)})},o={schema:function(){return n.concat([kr("focusManager",Eu()),Vr("focusInside","onFocus",hr(function(n){return wn(["onFocus","onEnterOrSpace","onApi"],n)?ct.value(n):ct.error("Invalid value for focusInside")})),fi("handler",o),fi("state",e),fi("sendFocusIn",a)])},processKey:c,toEvents:function(i,u){var n=i.focusInside!==Yi.OnFocusMode?S.none():a(i).map(function(t){return $r(Kn(),function(n,e){t(n,i,u),e.stop()})});return Ur(n.toArray().concat([$r(j(),function(r,o){c(r,o,t,i,u).fold(function(){var e,t,n;e=r,t=o,n=lu([32].concat([13]))(t.event()),i.focusInside===Yi.OnEnterOrSpaceMode&&n&&Cr(e,t)&&a(i).each(function(n){n(e,i,u),t.stop()})},function(n){o.stop()})}),$r(P(),function(n,e){c(n,e,r,i,u).each(function(n){e.stop()})})]))}};return o},Lu=function(n){var e=[Sr("onEscape"),Sr("onEnter"),kr("selector",'[data-alloy-tabstop="true"]'),kr("firstTabstop",0),kr("useTabstopAt",p(!0)),Sr("visibilitySelector")].concat([n]),u=function(n,e){var t=n.visibilitySelector.bind(function(n){return iu(e,n)}).getOr(e);return 0<Qi(t)},t=function(e,t){var n,r,o,i;(n=e,r=t,o=eu(n.element(),r.selector),i=Sn(o,function(n){return u(r,n)}),S.from(i[r.firstTabstop])).each(function(n){t.focusManager.set(e,n)})},a=function(e,n,t,r,o){return o(n,t,function(n){return u(e=r,t=n)&&e.useTabstopAt(t);var e,t}).fold(function(){return r.cyclic?S.some(!0):S.none()},function(n){return r.focusManager.set(e,n),S.some(!0)})},i=function(e,n,t,r){var o,i,u=eu(e.element(),t.selector);return(o=e,i=t,i.focusManager.get(o).bind(function(n){return iu(n,i.selector)})).bind(function(n){return Vn(u,f(Pe,n)).bind(function(n){return a(e,u,n,t,r)})})},r=p([vu(fu([du,lu([9])]),function(n,e,t,r){var o=t.cyclic?uu:au;return i(n,0,t,o)}),vu(lu([9]),function(n,e,t,r){var o=t.cyclic?cu:su;return i(n,0,t,o)}),vu(lu([27]),function(e,t,n,r){return n.onEscape.bind(function(n){return n(e,t)})}),vu(fu([mu,lu([13])]),function(e,t,n,r){return n.onEnter.bind(function(n){return n(e,t)})})]),o=p([]);return Au(e,ao.init,r,o,function(){return S.some(t)})},Iu=Lu(Er("cyclic",p(!1))),Bu=Lu(Er("cyclic",p(!0))),Ru=function(n){return"input"===we(n)&&"radio"!==bo(n,"type")||"textarea"===we(n)},Fu=function(n,e,t){return Ru(t)&&lu([32])(e.event())?S.none():(me(n,t,ne()),S.some(!0))},Nu=function(n,e){return S.some(!0)},ju=[kr("execute",Fu),kr("useSpace",!1),kr("useEnter",!0),kr("useControlEnter",!1),kr("useDown",!1)],Pu=function(n,e,t){return t.execute(n,e,n.element())},Uu=Au(ju,ao.init,function(n,e,t,r){var o=t.useSpace&&!Ru(n.element())?[32]:[],i=t.useEnter?[13]:[],u=t.useDown?[40]:[],a=o.concat(i).concat(u);return[vu(lu(a),Pu)].concat(t.useControlEnter?[vu(fu([hu,lu([13])]),Pu)]:[])},function(n,e,t,r){return t.useSpace&&!Ru(n.element())?[vu(lu([32]),Nu)]:[]},function(){return S.none()}),Gu=function(n){var t=Ao(S.none());return co({readState:function(){return t.get().map(function(n){return{numRows:n.numRows(),numColumns:n.numColumns()}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(n,e){t.set(S.some({numRows:p(n),numColumns:p(e)}))},getNumRows:function(){return t.get().map(function(n){return n.numRows()})},getNumColumns:function(){return t.get().map(function(n){return n.numColumns()})}})},$u=/* */Object.freeze({flatgrid:Gu,init:function(n){return n.state(n)}}),Wu=function(e,t){return function(n){return"rtl"===_u(n)?t:e}},_u=function(n){return"rtl"===Gi(n,"direction")?"rtl":"ltr"},qu=function(i){return function(n,e,t,r){var o=i(n.element());return Ju(o,n,e,t,r)}},Xu=function(n,e){var t=Wu(n,e);return qu(t)},Yu=function(n,e){var t=Wu(e,n);return qu(t)},Ku=function(o){return function(n,e,t,r){return Ju(o,n,e,t,r)}},Ju=function(e,t,n,r,o){return r.focusManager.get(t).bind(function(n){return e(t.element(),n,r,o)}).map(function(n){return r.focusManager.set(t,n),!0})},Qu=Ku,Zu=Ku,na=Ku,ea=function(n){var e,t=n.dom();return!((e=t).offsetWidth<=0&&e.offsetHeight<=0)},ta=Ce(["index","candidates"],[]),ra=function(n,e,t){return oa(n,e,t,ea)},oa=function(n,e,t,r){var o,i=f(Pe,e),u=eu(n,t),a=Sn(u,ea);return Vn(o=a,i).map(function(n){return ta({index:n,candidates:o})})},ia=function(n,e){return Vn(n,function(n){return Pe(e,n)})},ua=function(t,n,r,e){return e(Math.floor(n/r),n%r).bind(function(n){var e=n.row()*r+n.column();return 0<=e&&e<t.length?S.some(t[e]):S.none()})},aa=function(o,n,i,u,a){return ua(o,n,u,function(n,e){var t=n===i-1?o.length-n*u:u,r=gu(e,a,0,t-1);return S.some({row:p(n),column:p(r)})})},ca=function(i,n,u,a,c){return ua(i,n,a,function(n,e){var t=gu(n,c,0,u-1),r=t===u-1?i.length-t*a:a,o=pu(e,0,r-1);return S.some({row:p(t),column:p(o)})})},sa=[xr("selector"),kr("execute",Fu),ci("onEscape"),kr("captureTab",!1),hi()],la=function(e,t,n){ou(e.element(),t.selector).each(function(n){t.focusManager.set(e,n)})},fa=function(o){return function(n,e,t,r){return ra(n,e,t.selector).bind(function(n){return o(n.candidates(),n.index(),r.getNumRows().getOr(t.initSize.numRows),r.getNumColumns().getOr(t.initSize.numColumns))})}},da=function(n,e,t,r){return t.captureTab?S.some(!0):S.none()},ha=fa(function(n,e,t,r){return aa(n,e,t,r,-1)}),ma=fa(function(n,e,t,r){return aa(n,e,t,r,1)}),va=fa(function(n,e,t,r){return ca(n,e,t,r,-1)}),ga=fa(function(n,e,t,r){return ca(n,e,t,r,1)}),pa=p([vu(lu([37]),Xu(ha,ma)),vu(lu([39]),Yu(ha,ma)),vu(lu([38]),Qu(va)),vu(lu([40]),Zu(ga)),vu(fu([du,lu([9])]),da),vu(fu([mu,lu([9])]),da),vu(lu([27]),function(n,e,t,r){return t.onEscape(n,e)}),vu(lu([32].concat([13])),function(e,t,r,n){return(o=e,i=r,i.focusManager.get(o).bind(function(n){return iu(n,i.selector)})).bind(function(n){return r.execute(e,t,n)});var o,i})]),ba=p([vu(lu([32]),Nu)]),ya=Au(sa,Gu,pa,ba,function(){return S.some(la)}),za=function(n,e,t,i){var u=function(n,e,t){var r,o=gu(e,i,0,t.length-1);return o===n?S.none():(r=t[o],"button"===we(r)&&"disabled"===bo(r,"disabled")?u(n,o,t):S.from(t[o]))};return ra(n,t,e).bind(function(n){var e=n.index(),t=n.candidates();return u(e,e,t)})},wa=[xr("selector"),kr("getInitial",S.none),kr("execute",Fu),ci("onEscape"),kr("executeOnMove",!1),kr("allowVertical",!0)],xa=function(e,t,r){return(n=e,o=r,o.focusManager.get(n).bind(function(n){return iu(n,o.selector)})).bind(function(n){return r.execute(e,t,n)});var n,o},Ma=function(e,t){t.getInitial(e).orThunk(function(){return ou(e.element(),t.selector)}).each(function(n){t.focusManager.set(e,n)})},Ha=function(n,e,t){return za(n,t.selector,e,-1)},Sa=function(n,e,t){return za(n,t.selector,e,1)},Oa=function(r){return function(n,e,t){return r(n,e,t).bind(function(){return t.executeOnMove?xa(n,e,t):S.some(!0)})}},Ta=function(n,e,t,r){return t.onEscape(n,e)},ka=p([vu(lu([32]),Nu)]),Va=Au(wa,ao.init,function(n,e,t,r){var o=[37].concat(t.allowVertical?[38]:[]),i=[39].concat(t.allowVertical?[40]:[]);return[vu(lu(o),Oa(Xu(Ha,Sa))),vu(lu(i),Oa(Yu(Ha,Sa))),vu(lu([13]),xa),vu(lu([32]),xa),vu(lu([27]),Ta)]},ka,function(){return S.some(Ma)}),Ea=Ce(["rowIndex","columnIndex","cell"],[]),Ca=function(n,e,t){return S.from(n[e]).bind(function(n){return S.from(n[t]).map(function(n){return Ea({rowIndex:e,columnIndex:t,cell:n})})})},Da=function(n,e,t,r){var o=n[e].length,i=gu(t,r,0,o-1);return Ca(n,e,i)},Aa=function(n,e,t,r){var o=gu(t,r,0,n.length-1),i=n[o].length,u=pu(e,0,i-1);return Ca(n,o,u)},La=function(n,e,t,r){var o=n[e].length,i=pu(t+r,0,o-1);return Ca(n,e,i)},Ia=function(n,e,t,r){var o=pu(t+r,0,n.length-1),i=n[o].length,u=pu(e,0,i-1);return Ca(n,o,u)},Ba=[Hr("selectors",[xr("row"),xr("cell")]),kr("cycles",!0),kr("previousSelector",S.none),kr("execute",Fu)],Ra=function(e,t){t.previousSelector(e).orThunk(function(){var n=t.selectors;return ou(e.element(),n.cell)}).each(function(n){t.focusManager.set(e,n)})},Fa=function(n,e){return function(t,r,i){var u=i.cycles?n:e;return iu(r,i.selectors.row).bind(function(n){var e=eu(n,i.selectors.cell);return ia(e,r).bind(function(r){var o=eu(t,i.selectors.row);return ia(o,n).bind(function(n){var e,t=(e=i,Mn(o,function(n){return eu(n,e.selectors.cell)}));return u(t,n,r).map(function(n){return n.cell()})})})})}},Na=Fa(function(n,e,t){return Da(n,e,t,-1)},function(n,e,t){return La(n,e,t,-1)}),ja=Fa(function(n,e,t){return Da(n,e,t,1)},function(n,e,t){return La(n,e,t,1)}),Pa=Fa(function(n,e,t){return Aa(n,t,e,-1)},function(n,e,t){return Ia(n,t,e,-1)}),Ua=Fa(function(n,e,t){return Aa(n,t,e,1)},function(n,e,t){return Ia(n,t,e,1)}),Ga=p([vu(lu([37]),Xu(Na,ja)),vu(lu([39]),Yu(Na,ja)),vu(lu([38]),Qu(Pa)),vu(lu([40]),Zu(Ua)),vu(lu([32].concat([13])),function(e,t,r){return Ro(e.element()).bind(function(n){return r.execute(e,t,n)})})]),$a=p([vu(lu([32]),Nu)]),Wa=Au(Ba,ao.init,Ga,$a,function(){return S.some(Ra)}),_a=[xr("selector"),kr("execute",Fu),kr("moveOnTab",!1)],qa=function(e,t,r){return r.focusManager.get(e).bind(function(n){return r.execute(e,t,n)})},Xa=function(e,t){ou(e.element(),t.selector).each(function(n){t.focusManager.set(e,n)})},Ya=function(n,e,t){return za(n,t.selector,e,-1)},Ka=function(n,e,t){return za(n,t.selector,e,1)},Ja=p([vu(lu([38]),na(Ya)),vu(lu([40]),na(Ka)),vu(fu([du,lu([9])]),function(n,e,t){return t.moveOnTab?na(Ya)(n,e,t):S.none()}),vu(fu([mu,lu([9])]),function(n,e,t){return t.moveOnTab?na(Ka)(n,e,t):S.none()}),vu(lu([13]),qa),vu(lu([32]),qa)]),Qa=p([vu(lu([32]),Nu)]),Za=Au(_a,ao.init,Ja,Qa,function(){return S.some(Xa)}),nc=[ci("onSpace"),ci("onEnter"),ci("onShiftEnter"),ci("onLeft"),ci("onRight"),ci("onTab"),ci("onShiftTab"),ci("onUp"),ci("onDown"),ci("onEscape"),kr("stopSpaceKeyup",!1),Sr("focusIn")],ec=Au(nc,ao.init,function(n,e,t){return[vu(lu([32]),t.onSpace),vu(fu([mu,lu([13])]),t.onEnter),vu(fu([du,lu([13])]),t.onShiftEnter),vu(fu([du,lu([9])]),t.onShiftTab),vu(fu([mu,lu([9])]),t.onTab),vu(lu([38]),t.onUp),vu(lu([40]),t.onDown),vu(lu([37]),t.onLeft),vu(lu([39]),t.onRight),vu(lu([32]),t.onSpace),vu(lu([27]),t.onEscape)]},function(n,e,t){return t.stopSpaceKeyup?[vu(lu([32]),Nu)]:[]},function(n){return n.focusIn}),tc=Iu.schema(),rc=Bu.schema(),oc=Va.schema(),ic=ya.schema(),uc=Wa.schema(),ac=Uu.schema(),cc=Za.schema(),sc=ec.schema(),lc=(Du=pr("Creating behaviour: "+(Cu={branchKey:"mode",branches:/* */Object.freeze({acyclic:tc,cyclic:rc,flow:oc,flatgrid:ic,matrix:uc,execution:ac,menu:cc,special:sc}),name:"keying",active:{events:function(n,e){return n.handler.toEvents(n,e)}},apis:{focusIn:function(e,t,r){t.sendFocusIn(t).fold(function(){e.getSystem().triggerFocus(e.element(),e.element())},function(n){n(e,t,r)})},setGridSize:function(n,e,t,r,o){Vt(t,"setGridSize")?t.setGridSize(r,o):console.error("Layout does not support setGridSize")}},state:$u}).name,ho,Cu),ro(yr(Du.branchKey,Du.branches),Du.name,Du.active,Du.apis,Du.extra,Du.state)),fc=function(r,n){return e=r,t={},o=Mn(n,function(n){return e=n.name(),t="Cannot configure "+n.name()+" for "+r,sr(e,e,pt(),rr(function(n){return Nt("The field: "+e+" is forbidden. "+t)}));var e,t}).concat([Er("dump",b)]),sr(e,e,vt(t),ir(o));var e,t,o},dc=function(n){return n.dump},hc=function(n,e){return y({},n.dump,so(e))},mc=fc,vc=hc,gc="placeholder",pc=st([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),bc=function(n,e,t,r){return t.uiType===gc?(i=t,u=r,(o=n).exists(function(n){return n!==i.owner})?pc.single(!0,p(i)):St(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+O(u)+"]\nNamespace: "+o.getOr("none")+"\nSpec: "+Kt(i,null,2))},function(n){return n.replace()})):pc.single(!1,p(t));var o,i,u},yc=function(i,u,a,c){return bc(i,0,a,c).fold(function(n,e){var t=e(u,a.config,a.validated),r=St(t,"components").getOr([]),o=An(r,function(n){return yc(i,u,n,c)});return[y({},t,{components:o})]},function(n,e){var t=e(u,a.config,a.validated);return a.validated.preprocess.getOr(b)(t)})},zc=function(e,t,n,r){var o,i,u,a=V(r,function(n,e){return r=n,o=!1,{name:p(t=e),required:function(){return r.fold(function(n,e){return n},function(n,e){return n})},used:function(){return o},replace:function(){if(!0===o)throw new Error("Trying to use the same placeholder more than once: "+t);return o=!0,r}};var t,r,o}),c=(o=e,i=t,u=a,An(n,function(n){return yc(o,i,n,u)}));return k(a,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+Kt(t.components,null,2))}),c},wc=pc.single,xc=pc.multiple,Mc=p(gc),Hc=0,Sc=function(n){var e=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++Hc+String(e)},Oc=st([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Tc=kr("factory",{sketch:b}),kc=kr("schema",[]),Vc=xr("name"),Ec=sr("pname","pname",bt(function(n){return"<alloy."+Sc(n.name)+">"}),zr()),Cc=Er("schema",function(){return[Sr("preprocess")]}),Dc=kr("defaults",p({})),Ac=kr("overrides",p({})),Lc=ir([Tc,kc,Vc,Ec,Dc,Ac]),Ic=ir([Tc,kc,Vc,Ec,Dc,Ac]),Bc=ir([Tc,Cc,Vc,xr("unit"),Ec,Dc,Ac]),Rc=function(n){var e=function(n){return n.name};return n.fold(e,e,e,e)},Fc=function(t,r){return function(n){var e=pr("Converting part type",r,n);return t(e)}},Nc=Fc(Oc.required,Lc),jc=Fc(Oc.optional,Ic),Pc=Fc(Oc.group,Bc),Uc=p("entirety"),Gc=function(n,e,t,r){return dt(e.defaults(n,t,r),t,{uid:n.partUids[e.name]},e.overrides(n,t,r))},$c=function(o,n){var i={};return Hn(n,function(n){var e;(e=n,e.fold(S.some,S.none,S.some,S.some)).each(function(t){var r=Wc(o,t.pname);i[t.name]=function(n){var e=pr("Part: "+t.name+" in "+o,ir(t.schema),n);return y({},r,{config:n,validated:e})}})}),i},Wc=function(n,e){return{uiType:Mc(),owner:n,name:e}},_c=function(n,e,t){return r=e,i={},o={},Hn(t,function(n){n.fold(function(r){i[r.pname]=wc(!0,function(n,e,t){return r.factory.sketch(Gc(n,r,e,t))})},function(n){var e=r.parts[n.name];o[n.name]=p(n.factory.sketch(Gc(r,n,e[Uc()]),e))},function(r){i[r.pname]=wc(!1,function(n,e,t){return r.factory.sketch(Gc(n,r,e,t))})},function(o){i[o.pname]=xc(!0,function(e,n,t){var r=e[o.name];return Mn(r,function(n){return o.factory.sketch(dt(o.defaults(e,n,t),n,o.overrides(e,n)))})})})}),{internals:p(i),externals:p(o)};var r,i,o},qc=function(n,e,t){return zc(S.some(n),e,e.components,t)},Xc=function(n,e,t){var r=e.partUids[t];return n.getSystem().getByUid(r).toOption()},Yc=function(n,e,t){return Xc(n,e,t).getOrDie("Could not find part: "+t)},Kc=function(e,n){var t=Mn(n,Rc);return Tt(Mn(t,function(n){return{key:n,value:e+"-"+n}}))},Jc=function(e){return sr("partUids","partUids",yt(function(n){return Kc(n.uid,e)}),zr())},Qc=Sc("alloy-premade"),Zc=function(n){return Ot(Qc,n)},ns=function(r){return n=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return r.apply(undefined,[n.getApis()].concat([n].concat(e)))},e=r.toString(),t=e.indexOf(")")+1,o=e.indexOf("("),i=e.substring(o+1,t-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Zr(i.slice(1))}},n;var n,e,t,o,i},es=p("alloy-id-"),ts=p("data-alloy-id"),rs=es(),os=ts(),is=function(n,e){Object.defineProperty(n.dom(),os,{value:e,writable:!0})},us=function(n){var e=Me(n)?n.dom()[os]:null;return S.from(e)},as=function(n){return Sc(n)},cs=function(n,e,t,r,o){var i,u,a=(u=o,(0<(i=r).length?[Hr("parts",i)]:[]).concat([xr("uid"),kr("dom",{}),kr("components",[]),di("originalSpec"),kr("debug.sketcher",{})]).concat(u));return pr(n+" [SpecSchema]",or(a.concat(e)),t)},ss=function(n,e,t,r,o){var i=ls(o),u=An(t,function(n){return n.fold(S.none,S.some,S.none,S.none).map(function(n){return Hr(n.name,n.schema.concat([di(Uc())]))}).toArray()}),a=Jc(t),c=cs(n,e,i,u,[a]),s=_c(0,c,t);return r(c,qc(n,c,s.internals()),i,s.externals())},ls=function(n){return n.hasOwnProperty("uid")?n:y({},n,{uid:as("uid")})},fs=or([xr("name"),xr("factory"),xr("configFields"),kr("apis",{}),kr("extraApis",{})]),ds=or([xr("name"),xr("factory"),xr("configFields"),xr("partFields"),kr("apis",{}),kr("extraApis",{})]),hs=function(n){var i=pr("Sketcher for "+n.name,fs,n),e=V(i.apis,ns),t=V(i.extraApis,function(n,e){return no(n,e)});return y({name:p(i.name),partFields:p([]),configFields:p(i.configFields),sketch:function(n){return e=i.name,t=i.configFields,r=i.factory,o=ls(n),r(cs(e,t,o,[],[]),o);var e,t,r,o}},e,t)},ms=function(n){var e=pr("Sketcher for "+n.name,ds,n),t=$c(e.name,e.partFields),r=V(e.apis,ns),o=V(e.extraApis,function(n,e){return no(n,e)});return y({name:p(e.name),partFields:p(e.partFields),configFields:p(e.configFields),sketch:function(n){return ss(e.name,e.configFields,e.partFields,e.factory,n)},parts:p(t)},r,o)},vs=hs({name:"Button",factory:function(n){var e,t,r,o=(e=n.action,t=function(n,e){e.stop(),he(n)},r=Xn.detect().deviceType.isTouch()?[$r(te(),t)]:[$r($(),t),$r(B(),function(n,e){e.cut()})],Ur(Dn([e.map(function(t){return $r(ne(),function(n,e){t(n),e.stop()})}).toArray(),r]))),i=n.dom.tag,u=function(e){return St(n.dom,"attributes").bind(function(n){return St(n,e)})};return{uid:n.uid,dom:n.dom,components:n.components,events:o,behaviours:vc(n.buttonBehaviours,[Fi.config({}),lc.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==i)return{role:u("role").getOr("button")};var n=u("type").getOr("button"),e=u("role").map(function(n){return{role:n}}).getOr({});return y({type:n},e)}()},eventOrder:n.eventOrder}},configFields:[kr("uid",undefined),xr("dom"),kr("components",[]),mc("buttonBehaviours",[Fi,lc]),Sr("action"),Sr("role"),kr("eventOrder",{})]}),gs=fo({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(n){return Ur([Gr(_(),p(!0))])},exhibit:function(n,e){return eo({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),ps=function(n){var e,t,r,o=pe.fromHtml(n),i=$e(o),u=(t=(e=o).dom().attributes!==undefined?e.dom().attributes:[],Tn(t,function(n,e){var t;return"class"===e.name?n:y({},n,((t={})[e.name]=e.value,t))},{})),a=(r=o,Array.prototype.slice.call(r.dom().classList,0)),c=0===i.length?{}:{innerHtml:Uo(o)};return y({tag:we(o),classes:a,attributes:u},c)},bs=function(n){var e,o,t=(e=n,o={prefix:Ai.prefix()},e.replace(/\$\{([^{}]*)\}/g,function(n,e){var t,r=o[e];return"string"==(t=typeof r)||"number"===t?r.toString():n}));return ps(t)},ys=function(n){return{dom:bs(n)}},zs=function(n){return so([ki.config({toggleClass:Ai.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Vi(n,function(n,e){(e?ki.on:ki.off)(n)})])},ws={"accessibility-check":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"align-center":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 0 0 1.4-1V6a1 1 0 0 0-1.4-.9l-12 6a1 1 0 0 0 0 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 0 1 5 18V6a1 1 0 0 1 1.4-.9l12 6a1 1 0 0 1 0 1.8z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 0 0-1 1z" fill-rule="nonzero"/></svg>',"border-width":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',brightness:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',browse:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 0 1-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 0 1-1 .7h-.2a.7.7 0 0 1-.7-1l4-12a1 1 0 1 1 2 0l4 12a.7.7 0 0 1-.8 1h-.2a1 1 0 0 1-1-.7l-.8-2.6zm-.3-1.5l-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 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-6h8a1 1 0 0 1 0 2h-8a1 1 0 0 1 0-2zM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><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" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><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" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><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" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><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" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><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" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',comment:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',contrast:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',cut:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5zm0 4h2v2h-2V9zM9 9h2v2H9V9zm4 4h2v2h-2v-2zm-4 0h2v2H9v-2zm0 4h2v2H9v-2zm4 0h2v2h-2v-2zM9 5h2v2H9V5z" fill-rule="evenodd"/></svg>',duplicate:'<svg width="24" height="24"><g 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"/><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"/></g></svg>',"edit-image":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0 1 19 6zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 0 0 8 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 0 0-4 4.5h2.2zm-3.4 0a12 12 0 0 1 2.8-4 12 12 0 0 0-5 4h2.2z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',fill:'<svg width="24" height="26"><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" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 0 0-2 2v3h2V6h10v3h2V6a2 2 0 0 0-2-2zm2 14h-2v2a2 2 0 0 0 2-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',fullscreen:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',gamma:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',help:'<svg width="24" height="24"><g 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"/><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" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" 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.1zm5-7.5L11 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"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',indeterminate:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 2H5a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3zm-7 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16z"/><path d="M15 12h-3V7a.5.5 0 0 0-1 0v6h4a.5.5 0 0 0 0-1z"/></g></svg>',invert:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',italic:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',line:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2.1 2a2 2 0 1 0 2.7 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-2a2 2 0 1 0-2.6-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 2z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg width="48" height="48"><g 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 6zM11 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 6zM11 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" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 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"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 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"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 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"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15zm0 10v-1.2h1.3V26H15zm0 10v-1.2h1.3V36H15z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 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"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15zm0 10v-1.2h1.3V27H15zm0 10v-1.2h1.3V37H15z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"new-document":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-2v8H5V7h8l-2 2H7v8h8v-4zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"page-break":'<svg width="24" height="24"><g 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-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 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"/></g></svg>',paragraph:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"paste-text":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5L8 20H3v-3l3.5-3.5a2 2 0 0 1 0-3L14 3l1 1-7.3 7.3a1 1 0 0 0 0 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 0 1-2.8 0l-.1-.1z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><g fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="#000" stroke-width="2"><path d="M12 5v14M5 12h14"/></g></svg>',preferences:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5 22.1l-1.2-4.7v-.2a1 1 0 0 1 1-1l5 .4a1 1 0 1 1-.2 2l-2.2-.2a7.8 7.8 0 0 0 8.4.2 7.5 7.5 0 0 0 3.5-6.4 1 1 0 1 1 2 0 9.5 9.5 0 0 1-4.5 8 9.9 9.9 0 0 1-10.2 0l.4 1.4a1 1 0 1 1-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 0 0-9.5-1 7.5 7.5 0 0 0-3.6 7 1 1 0 0 1-2 0 9.5 9.5 0 0 1 4.5-8.6 10 10 0 0 1 10.9.3l-.3-1a1 1 0 0 1 2-.5l1.1 4.8a1 1 0 0 1-1 1.2l-5-.4a1 1 0 0 1-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g 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-7zM8.1 5.1A.5.5 0 1 1 9 6l-3 3A.5.5 0 1 1 5 8l3-3z"/></g></svg>',resize:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g 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"/><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" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',settings:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 0 1 0-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7zM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 0 0-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7z"/></g></svg>',"spell-check":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g 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"/><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"table-cell-properties":'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm10 10h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10 0v3h4v-3h-4zm0-1h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" fill-rule="evenodd"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><path d="M12.5 5.5v6h6v-6h-6zm-1 0h-6v6h6v-6zm1 13h6v-6h-6v6zm-1 0v-6h-6v6h6zm-7-14h15v15h-15v-15z" fill-rule="nonzero"/></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5.5 5.5v13h13v-13h-13zm-1-1h15v15h-15v-15z" opacity=".2"/><path d="M11.5 11.5v-7h1v7h7v1h-7v7h-1v-7h-7v-1h7z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"table-delete-row":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"table-delete-table":'<svg width="24" height="26"><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" fill-rule="evenodd"/></svg>',"table-insert-column-after":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M4 5h16v13H4V5zm10 12v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V6h-4v3h4zm5 8v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V6h-4v3h4z" fill-rule="evenodd"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm6 13h9v-7h-9v7zm4-11h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10-1h4V7h-4v3zM5 15v3h4v-3H5z" fill-rule="evenodd"/></svg>',"table-row-properties":'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm10 10h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm6 3h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" fill-rule="evenodd"/></svg>',"table-split-cells":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M4 5h16v13H4V5zm5 12v-3H5v3h4zm0-4v-3H5v3h4zm5 4v-3h-4v3h4zm0-4v-3h-4v3h4zm5 4v-3h-4v3h4zm0-4v-3h-4v3h4z" fill-rule="evenodd"/></svg>',table:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14zM9 16v-4a5 5 0 1 1 6 0v4h4a2 2 0 0 1 2 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 1 0-3.6 0l.8.6v5h2z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-text-color__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"/></g></svg>',toc:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',upload:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',warning:'<svg width="24" height="24"><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" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><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" fill-rule="nonzero"/></svg>'},xs=function(n,e){var t,r,o=e.ui.registry.getAll().icons;return(t=n,r=o,S.from(r[t]).or(S.from(ws[t]))).fold(function(){return bs('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item ${prefix}-icon-'+n+' ${prefix}-icon"></span>')},function(n){return bs('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item">'+n+"</span>")})},Ms=function(n,e,t,r){return vs.sketch({dom:xs(n,r),action:e,buttonBehaviours:dt(so([gs.config({})]),t)})},Hs={forToolbar:Ms,forToolbarCommand:function(n,e){return Ms(e,function(){n.execCommand(e)},{},n)},forToolbarStateAction:function(n,e,t,r){var o=zs(t);return Ms(e,r,o,n)},forToolbarStateCommand:function(n,e){var t=zs(e);return Ms(e,function(){n.execCommand(e)},t,n)},getToolbarIconButton:xs},Ss=Xn.detect().deviceType.isTouch(),Os=jc({schema:[xr("dom")],name:"label"}),Ts=function(n){return jc({name:n+"-edge",overrides:function(r){return r.model.manager.edgeActions[n].fold(function(){return{}},function(t){var n=Ur([Wr(A(),t,[r])]),e=Ur([Wr(B(),t,[r]),Wr(R(),function(n,e){e.mouseIsDown.get()&&t(n,e)},[r])]);return{events:Ss?n:e}})}})},ks=Ts("top-left"),Vs=Ts("top"),Es=Ts("top-right"),Cs=Ts("right"),Ds=Ts("bottom-right"),As=Ts("bottom"),Ls=Ts("bottom-left"),Is=[Os,Ts("left"),Cs,Vs,As,ks,Es,Ls,Ds,Nc({name:"thumb",defaults:p({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:Ur([qr(A(),n,"spectrum"),qr(L(),n,"spectrum"),qr(I(),n,"spectrum"),qr(B(),n,"spectrum"),qr(R(),n,"spectrum"),qr(F(),n,"spectrum")])}}}),Nc({schema:[Er("mouseIsDown",function(){return Ao(!1)})],name:"spectrum",overrides:function(t){var r=t.model.manager,o=function(e,n){return r.getValueFromEvent(n).map(function(n){return r.setValueFrom(e,t,n)})},n=Ur([$r(A(),o),$r(L(),o)]),e=Ur([$r(B(),o),$r(R(),function(n,e){t.mouseIsDown.get()&&o(n,e)})]);return{behaviours:so(Ss?[]:[lc.config({mode:"special",onLeft:function(n){return r.onLeft(n,t)},onRight:function(n){return r.onRight(n,t)},onUp:function(n){return r.onUp(n,t)},onDown:function(n){return r.onDown(n,t)}}),Fi.config({})]),events:Ss?n:e}}})],Bs=function(n,e,t){e.store.manager.onLoad(n,e,t)},Rs=function(n,e,t){e.store.manager.onUnload(n,e,t)},Fs=/* */Object.freeze({onLoad:Bs,onUnload:Rs,setValue:function(n,e,t,r){e.store.manager.setValue(n,e,t,r)},getValue:function(n,e,t){return e.store.manager.getValue(n,e,t)},getState:function(n,e,t){return t}}),Ns=/* */Object.freeze({events:function(t,r){var n=t.resetOnDom?[Yr(function(n,e){Bs(n,t,r)}),Kr(function(n,e){Rs(n,t,r)})]:[to(t,r,Bs)];return Ur(n)}}),js=function(){var n=Ao(null);return co({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})},Ps=function(){var i=Ao({}),u=Ao({});return co({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return St(i.get(),n).orThunk(function(){return St(u.get(),n)})},update:function(n){var e=i.get(),t=u.get(),r={},o={};Hn(n,function(e){r[e.value]=e,St(e,"meta").each(function(n){St(n,"text").each(function(n){o[n]=e})})}),i.set(y({},e,r)),u.set(y({},t,o))},clear:function(){i.set({}),u.set({})}})},Us=/* */Object.freeze({memory:js,dataset:Ps,manual:function(){return co({readState:function(){}})},init:function(n){return n.store.manager.state(n)}}),Gs=function(n,e,t,r){var o=e.store;t.update([r]),o.setValue(n,r),e.onSetValue(n,r)},$s=[Sr("initialValue"),xr("getFallbackEntry"),xr("getDataKey"),xr("setValue"),fi("manager",{setValue:Gs,getValue:function(n,e,t){var r=e.store,o=r.getDataKey(n);return t.lookup(o).fold(function(){return r.getFallbackEntry(o)},function(n){return n})},onLoad:function(e,t,r){t.store.initialValue.each(function(n){Gs(e,t,r,n)})},onUnload:function(n,e,t){t.clear()},state:Ps})],Ws=[xr("getValue"),kr("setValue",z),Sr("initialValue"),fi("manager",{setValue:function(n,e,t,r){e.store.setValue(n,r),e.onSetValue(n,r)},getValue:function(n,e,t){return e.store.getValue(n)},onLoad:function(e,t,n){t.store.initialValue.each(function(n){t.store.setValue(e,n)})},onUnload:z,state:ao.init})],_s=[Sr("initialValue"),fi("manager",{setValue:function(n,e,t,r){t.set(r),e.onSetValue(n,r)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store.initialValue.each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:js})],qs=[Vr("store",{mode:"memory"},yr("mode",{memory:_s,manual:Ws,dataset:$s})),ai("onSetValue"),kr("resetOnDom",!1)],Xs=fo({fields:qs,name:"representing",active:Ns,apis:Fs,extra:{setValueFrom:function(n,e){var t=Xs.getValue(e);Xs.setValue(n,t)}},state:Us}),Ys=function(t,r){return{left:p(t),top:p(r),translate:function(n,e){return Ys(t+n,r+e)}}},Ks=Ys,Js=Xn.detect().deviceType.isTouch(),Qs=p("slider.change.value"),Zs=function(n){var e=n.event().raw();if(Js){var t=e;return t.touches!==undefined&&1===t.touches.length?S.some(t.touches[0]).map(function(n){return Ks(n.clientX,n.clientY)}):S.none()}var r=e;return r.clientX!==undefined?S.some(r).map(function(n){return Ks(n.clientX,n.clientY)}):S.none()},nl=function(n,e,t,r){return n<e?n:t<n?t:n===e?e-1:Math.max(e,n-r)},el=function(n,e,t,r){return t<n?n:n<e?e:n===t?t+1:Math.min(t,n+r)},tl=function(n,e,t){return Math.max(e,Math.min(t,n))},rl=function(n){var e=n.min,t=n.max,r=n.range,o=n.value,i=n.step,u=n.snap,a=n.snapStart,c=n.rounded,s=n.hasMinEdge,l=n.hasMaxEdge,f=n.minBound,d=n.maxBound,h=n.screenRange,m=s?e-1:e,v=l?t+1:t;if(o<f)return m;if(d<o)return v;var g,p,b,y,z,w,x,M=(z=o,w=f,x=d,Math.min(x,Math.max(z,w))-w),H=tl(M/h*r+e,m,v);return u&&e<=H&&H<=t?(g=H,p=e,b=t,y=i,a.fold(function(){var n=g-p,e=Math.round(n/y)*y;return tl(p+e,p-1,b+1)},function(n){var e=(g-n)%y,t=Math.round(e/y),r=Math.floor((g-n)/y),o=Math.floor((b-n)/y),i=n+Math.min(o,r+t)*y;return Math.max(n,i)})):c?Math.round(H):H},ol=function(n){var e=n.min,t=n.max,r=n.range,o=n.value,i=n.hasMinEdge,u=n.hasMaxEdge,a=n.maxBound,c=n.maxOffset,s=n.centerMinEdge,l=n.centerMaxEdge;return o<e?i?0:s:t<o?u?a:l:(o-e)/r*c},il=Xi("width",function(n){return n.dom().offsetWidth}),ul=function(n,e){il.set(n,e)},al=function(n){return il.get(n)},cl=function(n){return n.model.minX},sl=function(n){return n.model.minY},ll=function(n){return n.model.minX-1},fl=function(n){return n.model.minY-1},dl=function(n){return n.model.maxX},hl=function(n){return n.model.maxY},ml=function(n){return n.model.maxX+1},vl=function(n){return n.model.maxY+1},gl=function(n,e,t){return e(n)-t(n)},pl=function(n){return gl(n,dl,cl)},bl=function(n){return gl(n,hl,sl)},yl=function(n){return pl(n)/2},zl=function(n){return bl(n)/2},wl=function(n){return n.stepSize},xl=function(n){return n.snapToGrid},Ml=function(n){return n.snapStart},Hl=function(n){return n.rounded},Sl=function(n,e){return n[e+"-edge"]!==undefined},Ol=function(n){return Sl(n,"left")},Tl=function(n){return Sl(n,"right")},kl=function(n){return Sl(n,"top")},Vl=function(n){return Sl(n,"bottom")},El=function(n){return n.model.value.get()},Cl=function(n){return{x:p(n)}},Dl=function(n){return{y:p(n)}},Al=function(n,e){return{x:p(n),y:p(e)}},Ll=function(n,e){de(n,Qs(),{value:e})},Il="left",Bl=function(n){return n.element().dom().getBoundingClientRect()},Rl=function(n,e){return n[e]},Fl=function(n){var e=Bl(n);return Rl(e,Il)},Nl=function(n){var e=Bl(n);return Rl(e,"right")},jl=function(n){var e=Bl(n);return Rl(e,"top")},Pl=function(n){var e=Bl(n);return Rl(e,"bottom")},Ul=function(n){var e=Bl(n);return Rl(e,"width")},Gl=function(n){var e=Bl(n);return Rl(e,"height")},$l=function(n,e,t){return(n+e)/2-t},Wl=function(n,e){var t=Bl(n),r=Bl(e),o=Rl(t,Il),i=Rl(t,"right"),u=Rl(r,Il);return $l(o,i,u)},_l=function(n,e){var t=Bl(n),r=Bl(e),o=Rl(t,"top"),i=Rl(t,"bottom"),u=Rl(r,"top");return $l(o,i,u)},ql=function(n,e){de(n,Qs(),{value:e})},Xl=function(n){return{x:p(n)}},Yl=function(n,e,t){var r={min:cl(e),max:dl(e),range:pl(e),value:t,step:wl(e),snap:xl(e),snapStart:Ml(e),rounded:Hl(e),hasMinEdge:Ol(e),hasMaxEdge:Tl(e),minBound:Fl(n),maxBound:Nl(n),screenRange:Ul(n)};return rl(r)},Kl=function(u){return function(n,e){return(t=u,r=n,o=e,i=(0<t?el:nl)(El(o).x(),cl(o),dl(o),wl(o)),ql(r,Xl(i)),S.some(i)).map(function(){return!0});var t,r,o,i}},Jl=function(n,e,t,r,o,i){var u,a,c,s,l,f,d,h,m,v=(a=i,c=t,s=r,l=o,f=Ul(u=e),d=s.bind(function(n){return S.some(Wl(n,u))}).getOr(0),h=l.bind(function(n){return S.some(Wl(n,u))}).getOr(f),m={min:cl(a),max:dl(a),range:pl(a),value:c,hasMinEdge:Ol(a),hasMaxEdge:Tl(a),minBound:Fl(u),minOffset:0,maxBound:Nl(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:h},ol(m));return Fl(e)-Fl(n)+v},Ql=Kl(-1),Zl=Kl(1),nf=S.none,ef=S.none,tf={"top-left":S.none(),top:S.none(),"top-right":S.none(),right:S.some(function(n,e){Ll(n,Cl(ml(e)))}),"bottom-right":S.none(),bottom:S.none(),"bottom-left":S.none(),left:S.some(function(n,e){Ll(n,Cl(ll(e)))})},rf=/* */Object.freeze({setValueFrom:function(n,e,t){var r=Yl(n,e,t),o=Xl(r);return ql(n,o),r},setToMin:function(n,e){var t=cl(e);ql(n,Xl(t))},setToMax:function(n,e){var t=dl(e);ql(n,Xl(t))},findValueOfOffset:Yl,getValueFromEvent:function(n){return Zs(n).map(function(n){return n.left()})},findPositionOfValue:Jl,setPositionFromValue:function(n,e,t,r){var o=El(t),i=Jl(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=al(e.element())/2;Pi(e.element(),"left",i-u+"px")},onLeft:Ql,onRight:Zl,onUp:nf,onDown:ef,edgeActions:tf}),of=function(n,e){de(n,Qs(),{value:e})},uf=function(n){return{y:p(n)}},af=function(n,e,t){var r={min:sl(e),max:hl(e),range:bl(e),value:t,step:wl(e),snap:xl(e),snapStart:Ml(e),rounded:Hl(e),hasMinEdge:kl(e),hasMaxEdge:Vl(e),minBound:jl(n),maxBound:Pl(n),screenRange:Gl(n)};return rl(r)},cf=function(u){return function(n,e){return(t=u,r=n,o=e,i=(0<t?el:nl)(El(o).y(),sl(o),hl(o),wl(o)),of(r,uf(i)),S.some(i)).map(function(){return!0});var t,r,o,i}},sf=function(n,e,t,r,o,i){var u,a,c,s,l,f,d,h,m,v=(a=i,c=t,s=r,l=o,f=Gl(u=e),d=s.bind(function(n){return S.some(_l(n,u))}).getOr(0),h=l.bind(function(n){return S.some(_l(n,u))}).getOr(f),m={min:sl(a),max:hl(a),range:bl(a),value:c,hasMinEdge:kl(a),hasMaxEdge:Vl(a),minBound:jl(u),minOffset:0,maxBound:Pl(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:h},ol(m));return jl(e)-jl(n)+v},lf=S.none,ff=S.none,df=cf(-1),hf=cf(1),mf={"top-left":S.none(),top:S.some(function(n,e){Ll(n,Dl(fl(e)))}),"top-right":S.none(),right:S.none(),"bottom-right":S.none(),bottom:S.some(function(n,e){Ll(n,Dl(vl(e)))}),"bottom-left":S.none(),left:S.none()},vf=/* */Object.freeze({setValueFrom:function(n,e,t){var r=af(n,e,t),o=uf(r);return of(n,o),r},setToMin:function(n,e){var t=sl(e);of(n,uf(t))},setToMax:function(n,e){var t=hl(e);of(n,uf(t))},findValueOfOffset:af,getValueFromEvent:function(n){return Zs(n).map(function(n){return n.top()})},findPositionOfValue:sf,setPositionFromValue:function(n,e,t,r){var o=El(t),i=sf(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),u=Qi(e.element())/2;Pi(e.element(),"top",i-u+"px")},onLeft:lf,onRight:ff,onUp:df,onDown:hf,edgeActions:mf}),gf=function(n,e){de(n,Qs(),{value:e})},pf=function(n,e){return{x:p(n),y:p(e)}},bf=function(s,l){return function(n,e){return(t=s,r=l,o=n,i=e,u=0<t?el:nl,a=r?El(i).x():u(El(i).x(),cl(i),dl(i),wl(i)),c=r?u(El(i).y(),sl(i),hl(i),wl(i)):El(i).y(),gf(o,pf(a,c)),S.some(a)).map(function(){return!0});var t,r,o,i,u,a,c}},yf=bf(-1,!1),zf=bf(1,!1),wf=bf(-1,!0),xf=bf(1,!0),Mf={"top-left":S.some(function(n,e){Ll(n,Al(ll(e),fl(e)))}),top:S.some(function(n,e){Ll(n,Al(yl(e),fl(e)))}),"top-right":S.some(function(n,e){Ll(n,Al(ml(e),fl(e)))}),right:S.some(function(n,e){Ll(n,Al(ml(e),zl(e)))}),"bottom-right":S.some(function(n,e){Ll(n,Al(ml(e),vl(e)))}),bottom:S.some(function(n,e){Ll(n,Al(yl(e),vl(e)))}),"bottom-left":S.some(function(n,e){Ll(n,Al(ll(e),vl(e)))}),left:S.some(function(n,e){Ll(n,Al(ll(e),zl(e)))})},Hf=/* */Object.freeze({setValueFrom:function(n,e,t){var r=Yl(n,e,t.left()),o=af(n,e,t.top()),i=pf(r,o);return gf(n,i),i},setToMin:function(n,e){var t=cl(e),r=sl(e);gf(n,pf(t,r))},setToMax:function(n,e){var t=dl(e),r=hl(e);gf(n,pf(t,r))},getValueFromEvent:function(n){return Zs(n)},setPositionFromValue:function(n,e,t,r){var o=El(t),i=Jl(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=sf(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),a=al(e.element())/2,c=Qi(e.element())/2;Pi(e.element(),"left",i-a+"px"),Pi(e.element(),"top",u-c+"px")},onLeft:yf,onRight:zf,onUp:wf,onDown:xf,edgeActions:Mf}),Sf=Xn.detect().deviceType.isTouch(),Of=[kr("stepSize",1),kr("onChange",z),kr("onChoose",z),kr("onInit",z),kr("onDragStart",z),kr("onDragEnd",z),kr("snapToGrid",!1),kr("rounded",!0),Sr("snapStart"),Mr("model",yr("mode",{x:[kr("minX",0),kr("maxX",100),Er("value",function(n){return Ao(n.mode.minX)}),xr("getInitialValue"),fi("manager",rf)],y:[kr("minY",0),kr("maxY",100),Er("value",function(n){return Ao(n.mode.minY)}),xr("getInitialValue"),fi("manager",vf)],xy:[kr("minX",0),kr("maxX",100),kr("minY",0),kr("maxY",100),Er("value",function(n){return Ao({x:p(n.mode.minX),y:p(n.mode.minY)})}),xr("getInitialValue"),fi("manager",Hf)]})),fc("sliderBehaviours",[lc,Xs])].concat(Sf?[]:[Er("mouseIsDown",function(){return Ao(!1)})]),Tf=Xn.detect().deviceType.isTouch(),kf=ms({name:"Slider",configFields:Of,partFields:Is,factory:function(i,n,e,t){var u=function(n){return Yc(n,i,"thumb")},a=function(n){return Yc(n,i,"spectrum")},r=function(n){return Xc(n,i,"left-edge")},o=function(n){return Xc(n,i,"right-edge")},c=function(n){return Xc(n,i,"top-edge")},s=function(n){return Xc(n,i,"bottom-edge")},l=i.model,f=l.manager,d=function(n,e){f.setPositionFromValue(n,e,i,{getLeftEdge:r,getRightEdge:o,getTopEdge:c,getBottomEdge:s,getSpectrum:a})},h=function(n,e){l.value.set(e);var t=u(n);return d(n,t),i.onChange(n,t,e),S.some(!0)},m=[$r(A(),function(n,e){i.onDragStart(n,u(n))}),$r(I(),function(n,e){i.onDragEnd(n,u(n))})],v=[$r(B(),function(n,e){e.stop(),i.onDragStart(n,u(n)),i.mouseIsDown.set(!0)}),$r(F(),function(n,e){i.onDragEnd(n,u(n))})],g=Tf?m:v;return{uid:i.uid,dom:i.dom,components:n,behaviours:hc(i.sliderBehaviours,Dn([Tf?[]:[lc.config({mode:"special",focusIn:function(n){return Xc(n,i,"spectrum").map(lc.focusIn).map(p(!0))}})],[Xs.config({store:{mode:"manual",getValue:function(n){return l.value.get()}}}),vi.config({channels:{"mouse.released":{onReceive:function(t,n){var e=i.mouseIsDown.get();i.mouseIsDown.set(!1),e&&Xc(t,i,"thumb").each(function(n){var e=l.value.get();i.onChoose(t,n,e)})}}}})]])),events:Ur([$r(Qs(),function(n,e){h(n,e.event().value())}),Yr(function(n,e){var t=l.getInitialValue();l.value.set(t);var r=u(n);d(n,r);var o=a(n);i.onInit(n,r,o,l.value.get())})].concat(g)),apis:{resetToMin:function(n){f.setToMin(n,i)},resetToMax:function(n){f.setToMax(n,i)},changeValue:h,refresh:d},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),Vf=function(e,t,r,n){return Hs.forToolbar(t,function(){var n=r();e.setContextToolbar([{label:t+" group",items:n}])},{},n)},Ef=function(n){return[(o=n,i=function(n){return n<0?"black":360<n?"white":"hsl("+n+", 100%, 50%)"},kf.sketch({dom:bs('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[kf.parts()["left-edge"](ys('<div class="${prefix}-hue-slider-black"></div>')),kf.parts().spectrum({dom:bs('<div class="${prefix}-slider-gradient-container"></div>'),components:[ys('<div class="${prefix}-slider-gradient"></div>')],behaviours:so([ki.config({toggleClass:Ai.resolve("thumb-active")})])}),kf.parts()["right-edge"](ys('<div class="${prefix}-hue-slider-white"></div>')),kf.parts().thumb({dom:bs('<div class="${prefix}-slider-thumb"></div>'),behaviours:so([ki.config({toggleClass:Ai.resolve("thumb-active")})])})],onChange:function(n,e,t){var r=i(t.x());Pi(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){ki.on(e)},onDragEnd:function(n,e){ki.off(e)},onInit:function(n,e,t,r){var o=i(r.x());Pi(e.element(),"background-color",o)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:function(){return o.getInitialValue()}}}},sliderBehaviours:so([Ei(kf.refresh)])}))];var o,i},Cf=function(n,r){var e={onChange:function(n,e,t){r.undoManager.transact(function(){r.formatter.apply("forecolor",{value:t}),r.nodeChanged()})},getInitialValue:function(){return-1}};return Vf(n,"color-levels",function(){return Ef(e)},r)},Df=or([xr("getInitialValue"),xr("onChange"),xr("category"),xr("sizes")]),Af=function(n){var i=pr("SizeSlider",Df,n);return kf.sketch({dom:{tag:"div",classes:[Ai.resolve("slider-"+i.category+"-size-container"),Ai.resolve("slider"),Ai.resolve("slider-size-container")]},onChange:function(n,e,t){var r,o=t.x();0<=(r=o)&&r<i.sizes.length&&i.onChange(o)},onDragStart:function(n,e){ki.on(e)},onDragEnd:function(n,e){ki.off(e)},model:{mode:"x",minX:0,maxX:i.sizes.length-1,getInitialValue:function(){return{x:function(){return i.getInitialValue()}}}},stepSize:1,snapToGrid:!0,sliderBehaviours:so([Ei(kf.refresh)]),components:[kf.parts().spectrum({dom:bs('<div class="${prefix}-slider-size-container"></div>'),components:[ys('<div class="${prefix}-slider-size-line"></div>')]}),kf.parts().thumb({dom:bs('<div class="${prefix}-slider-thumb"></div>'),behaviours:so([ki.config({toggleClass:Ai.resolve("thumb-active")})])})]})},Lf=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],If=function(n){var e,t,r=n.selection.getStart(),o=pe.fromDom(r),i=pe.fromDom(n.getBody()),u=(e=function(n){return Pe(i,n)},(Me(t=o)?S.some(t):Ge(t)).map(function(n){return Nr(n,function(n){return Wi(n,"font-size").isSome()},e).bind(function(n){return Wi(n,"font-size")}).getOrThunk(function(){return Gi(n,"font-size")})}).getOr(""));return kn(Lf,function(n){return u===n}).getOr("medium")},Bf={candidates:p(Lf),get:function(n){var e,t=If(n);return(e=t,Vn(Lf,function(n){return n===e})).getOr(2)},apply:function(r,n){var e;(e=n,S.from(Lf[e])).each(function(n){var e,t;t=n,If(e=r)!==t&&e.execCommand("fontSize",!1,t)})}},Rf=Bf.candidates(),Ff=function(n){return[ys('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),(e=n,Af({onChange:e.onChange,sizes:Rf,category:"font",getInitialValue:e.getInitialValue})),ys('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')];var e},Nf=function(n){var e=function t(n){return n.uid!==undefined}(n)&&Vt(n,"uid")?n.uid:as("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).fold(S.none,S.some)},asSpec:function(){return y({},n,{uid:e})}}};function jf(n,e){return Uf(document.createElement("canvas"),n,e)}function Pf(n){return n.getContext("2d")}function Uf(n,e,t){return n.width=e,n.height=t,n}var Gf={create:jf,clone:function Ip(n){var e;return Pf(e=jf(n.width,n.height)).drawImage(n,0,0),e},resize:Uf,get2dContext:Pf,get3dContext:function Bp(n){var e=null;try{e=n.getContext("webgl")||n.getContext("experimental-webgl")}catch(t){}return e||(e=null),e}},$f={getWidth:function Rp(n){return n.naturalWidth||n.width},getHeight:function Fp(n){return n.naturalHeight||n.height}},Wf=window.Promise?window.Promise:function(){var n=function(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(n,r(o,this),r(u,this))},e=n.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){setTimeout(n,1)};function r(n,e){return function(){n.apply(e,arguments)}}var t=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};function i(r){var o=this;null!==this._state?e(function(){var n=o._state?r.onFulfilled:r.onRejected;if(null!==n){var e;try{e=n(o._value)}catch(t){return void r.reject(t)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void s(r(e,n),r(o,this),r(u,this))}this._state=!0,this._value=n,a.call(this)}catch(t){u.call(this,t)}}function u(n){this._state=!1,this._value=n,a.call(this)}function a(){for(var n=0,e=this._deferreds.length;n<e;n++)i.call(this,this._deferreds[n]);this._deferreds=null}function c(n,e,t,r){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.resolve=t,this.reject=r}function s(n,e,t){var r=!1;try{n(function(n){r||(r=!0,e(n))},function(n){r||(r=!0,t(n))})}catch(o){if(r)return;r=!0,t(o)}}return n.prototype["catch"]=function(n){return this.then(null,n)},n.prototype.then=function(t,r){var o=this;return new n(function(n,e){i.call(o,new c(t,r,n,e))})},n.all=function(){var c=Array.prototype.slice.call(1===arguments.length&&t(arguments[0])?arguments[0]:arguments);return new n(function(o,i){if(0===c.length)return o([]);var u=c.length;function a(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void t.call(n,function(n){a(e,n)},i)}c[e]=n,0==--u&&o(c)}catch(r){i(r)}}for(var n=0;n<c.length;n++)a(n,c[n])})},n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===n?e:new n(function(n){n(e)})},n.reject=function(t){return new n(function(n,e){e(t)})},n.race=function(o){return new n(function(n,e){for(var t=0,r=o.length;t<r;t++)o[t].then(n,e)})},n}();function _f(){return new(Le.getOrDie("FileReader"))}var qf={atob:function(n){return Le.getOrDie("atob")(n)},requestAnimationFrame:function(n){Le.getOrDie("requestAnimationFrame")(n)}};function Xf(a){return new Wf(function(n,e){var t=URL.createObjectURL(a),r=new Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",u)};function i(){o(),n(r)}function u(){o(),e("Unable to load data of type "+a.type+": "+t)}r.addEventListener("load",i),r.addEventListener("error",u),r.src=t,r.complete&&i()})}function Yf(r){return new Wf(function(n,t){var e=new XMLHttpRequest;e.open("GET",r,!0),e.responseType="blob",e.onload=function(){200==this.status&&n(this.response)},e.onerror=function(){var n,e=this;t(0===this.status?((n=new Error("No access to download image")).code=18,n.name="SecurityError",n):new Error("Error "+e.status+" downloading image"))},e.send()})}function Kf(n){var e=n.split(","),t=/data:([^;]+)/.exec(e[0]);if(!t)return S.none();for(var r,o=t[1],i=e[1],u=qf.atob(i),a=u.length,c=Math.ceil(a/1024),s=new Array(c),l=0;l<c;++l){for(var f=1024*l,d=Math.min(f+1024,a),h=new Array(d-f),m=f,v=0;m<d;++v,++m)h[v]=u[m].charCodeAt(0);s[l]=(r=h,new(Le.getOrDie("Uint8Array"))(r))}return S.some(function g(n,e){return new(Le.getOrDie("Blob"))(n,e)}(s,{type:o}))}function Jf(t){return new Wf(function(n,e){Kf(t).fold(function(){e("uri is not base64: "+t)},n)})}function Qf(t){return new Wf(function(n){var e=_f();e.onloadend=function(){n(e.result)},e.readAsDataURL(t)})}var Zf,nd,ed,td={blobToImage:Xf,imageToBlob:function Np(n){var e=n.src;return 0===e.indexOf("data:")?Jf(e):Yf(e)},blobToArrayBuffer:function jp(t){return new Wf(function(n){var e=_f();e.onloadend=function(){n(e.result)},e.readAsArrayBuffer(t)})},blobToDataUri:Qf,blobToBase64:function Pp(n){return Qf(n).then(function(n){return n.split(",")[1]})},dataUriToBlobSync:Kf,canvasToBlob:function Up(n,t,r){return t=t||"image/png",HTMLCanvasElement.prototype.toBlob?new Wf(function(e){n.toBlob(function(n){e(n)},t,r)}):Jf(n.toDataURL(t,r))},canvasToDataURL:function Gp(n,e,t){return e=e||"image/png",n.then(function(n){return n.toDataURL(e,t)})},blobToCanvas:function $p(n){return Xf(n).then(function(n){var e;return function t(n){URL.revokeObjectURL(n.src)}(n),e=Gf.create($f.getWidth(n),$f.getHeight(n)),Gf.get2dContext(e).drawImage(n,0,0),e})},uriToBlob:function Wp(n){return 0===n.indexOf("blob:")?Yf(n):0===n.indexOf("data:")?Jf(n):null}},rd=function(n){return td.blobToBase64(n)},od=function(u){var e=Nf({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:Ur([Xr($()),$r(G(),function(n,e){var t,r,o;(t=e,r=t.event(),o=r.raw().target.files||r.raw().dataTransfer.files,S.from(o[0])).each(function(n){var o,i;o=u,rd(i=n).then(function(r){o.undoManager.transact(function(){var n=o.editorUpload.blobCache,e=n.create(Sc("mceu"),i,r);n.add(e);var t=o.dom.createHTML("img",{src:e.blobUri()});o.insertContent(t)})})})})])});return vs.sketch({dom:Hs.getToolbarIconButton("image",u),components:[e.asSpec()],action:function(n){e.get(n).element().dom().click()}})},id=function(n){return n.dom().textContent},ud=function(n){return 0<n.length},ad=function(n){return n===undefined||null===n?"":n},cd=function(e,t,n){return n.text.toOption().filter(ud).fold(function(){return bo(n=e,"href")===id(n)?S.some(t):S.none();var n},S.some)},sd=function(n){var e=pe.fromDom(n.selection.getStart());return iu(e,"a")},ld={getInfo:function(n){return sd(n).fold(function(){return{url:"",text:n.selection.getContent({format:"text"}),title:"",target:"",link:S.none()}},function(n){return t=id(e=n),r=bo(e,"href"),o=bo(e,"title"),i=bo(e,"target"),{url:ad(r),text:t!==r?ad(t):"",title:ad(o),target:ad(i),link:S.some(e)};var e,t,r,o,i})},applyInfo:function(o,i){i.url.toOption().filter(ud).fold(function(){var e;e=o,i.link.bind(b).each(function(n){e.execCommand("unlink")})},function(e){var n,t,r=(n=i,(t={}).href=e,n.title.toOption().filter(ud).each(function(n){t.title=n}),n.target.toOption().filter(ud).each(function(n){t.target=n}),t);i.link.bind(b).fold(function(){var n=i.text.toOption().filter(ud).getOr(e);o.insertContent(o.dom.createHTML("a",r,o.dom.encode(n)))},function(t){var n=cd(t,e,i);po(t,r),n.each(function(n){var e;e=n,t.dom().textContent=e})})})},query:sd},fd=Xn.detect(),dd=function(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)},hd=function(n,e){(fd.os.isAndroid()?dd:l)(e,n)},md=function(n,e){var t,r;return{key:n,value:{config:{},me:(t=n,r=Ur(e),fo({fields:[xr("enabled")],name:t,active:{events:p(r)}})),configAsRaw:p({}),initialConfig:{},state:ao}}},vd=/* */Object.freeze({getCurrent:function(n,e,t){return e.find(n)}}),gd=[xr("find")],pd=fo({fields:gd,name:"composing",apis:vd}),bd=hs({name:"Container",factory:function(n){var e=n.dom,t=e.attributes,r=c(e,["attributes"]);return{uid:n.uid,dom:y({tag:"div",attributes:y({role:"presentation"},t)},r),components:n.components,behaviours:dc(n.containerBehaviours),events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},configFields:[kr("components",[]),fc("containerBehaviours",[]),kr("events",{}),kr("domModification",{}),kr("eventOrder",{})]}),yd=hs({name:"DataField",factory:function(t){return{uid:t.uid,dom:t.dom,behaviours:vc(t.dataBehaviours,[Xs.config({store:{mode:"memory",initialValue:t.getInitialValue()}}),pd.config({find:S.some})]),events:Ur([Yr(function(n,e){Xs.setValue(n,t.getInitialValue())})])}},configFields:[xr("uid"),xr("dom"),xr("getInitialValue"),mc("dataBehaviours",[Xs,pd])]}),zd=function(n){return n.dom().value},wd=function(n,e){if(e===undefined)throw new Error("Value.set was undefined");n.dom().value=e},xd=p([Sr("data"),kr("inputAttributes",{}),kr("inputStyles",{}),kr("tag","input"),kr("inputClasses",[]),ai("onSetValue"),kr("styles",{}),kr("eventOrder",{}),fc("inputBehaviours",[Xs,Fi]),kr("selectOnFocus",!0)]),Md=function(n){return y({},(e=n,so([Fi.config({onFocus:!1===e.selectOnFocus?z:function(n){var e=n.element(),t=zd(e);e.dom().setSelectionRange(0,t.length)}})])),hc(n.inputBehaviours,[Xs.config({store:{mode:"manual",initialValue:n.data.getOr(undefined),getValue:function(n){return zd(n.element())},setValue:function(n,e){zd(n.element())!==e&&wd(n.element(),e)}},onSetValue:n.onSetValue})]));var e},Hd=hs({name:"Input",configFields:xd(),factory:function(n,e){return{uid:n.uid,dom:(t=n,{tag:t.tag,attributes:y({type:"input"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}),components:[],behaviours:Md(n),eventOrder:n.eventOrder};var t}}),Sd=/* */Object.freeze({exhibit:function(n,e){return eo({attributes:Tt([{key:e.tabAttr,value:"true"}])})}}),Od=[kr("tabAttr","data-alloy-tabstop")],Td=fo({fields:Od,name:"tabstopping",active:Sd}),kd=function(n,e){var t=Nf(Hd.sketch({inputAttributes:{placeholder:e},onSetValue:function(n,e){fe(n,U())},inputBehaviours:so([pd.config({find:S.some}),Td.config({}),lc.config({mode:"execution"})]),selectOnFocus:!1})),r=Nf(vs.sketch({dom:bs('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(n){var e=t.get(n);Xs.setValue(e,"")}}));return{name:n,spec:bd.sketch({dom:bs('<div class="${prefix}-input-container"></div>'),components:[t.asSpec(),r.asSpec()],containerBehaviours:so([ki.config({toggleClass:Ai.resolve("input-container-empty")}),pd.config({find:function(n){return S.some(t.get(n))}}),md("input-clearing",[$r(U(),function(n){var e=t.get(n);(0<Xs.getValue(e).length?ki.off:ki.on)(n)})])])})}},Vd=["input","button","textarea"],Ed=function(n,e,t){e.disabled&&Bd(n,e,t)},Cd=function(n){return wn(Vd,we(n.element()))},Dd=function(n){go(n.element(),"disabled","disabled")},Ad=function(n){zo(n.element(),"disabled")},Ld=function(n){go(n.element(),"aria-disabled","true")},Id=function(n){go(n.element(),"aria-disabled","false")},Bd=function(e,n,t){n.disableClass.each(function(n){So(e.element(),n)}),(Cd(e)?Dd:Ld)(e)},Rd=function(n){return Cd(n)?yo(n.element(),"disabled"):"true"===bo(n.element(),"aria-disabled")},Fd=/* */Object.freeze({enable:function(e,n,t){n.disableClass.each(function(n){To(e.element(),n)}),(Cd(e)?Ad:Id)(e)},disable:Bd,isDisabled:Rd,onLoad:Ed}),Nd=/* */Object.freeze({exhibit:function(n,e,t){return eo({classes:e.disabled?e.disableClass.map(Rn).getOr([]):[]})},events:function(n,e){return Ur([Gr(ne(),function(n,e){return Rd(n)}),to(n,e,Ed)])}}),jd=[kr("disabled",!1),Sr("disableClass")],Pd=fo({fields:jd,name:"disabling",active:Nd,apis:Fd}),Ud=[fc("formBehaviours",[Xs])],Gd=function(n){return"<alloy.field."+n+">"},$d=function(o,n,e){return{uid:o.uid,dom:o.dom,components:n,behaviours:hc(o.formBehaviours,[Xs.config({store:{mode:"manual",getValue:function(n){var e,t,r=(e=o,t=n.getSystem(),V(e.partUids,function(n,e){return p(t.getByUid(n))}));return V(r,function(n,e){return n().bind(function(n){var e,t=pd.getCurrent(n);return e="missing current",t.fold(function(){return ct.error(e)},ct.value)}).map(Xs.getValue)})},setValue:function(t,n){k(n,function(e,n){Xc(t,o,n).each(function(n){pd.getCurrent(n).each(function(n){Xs.setValue(n,e)})})})}}})]),apis:{getField:function(n,e){return Xc(n,o,e).bind(pd.getCurrent)}}}},Wd=(ns(function(n,e,t){return n.getField(e,t)}),function(n){var i,e=(i=[],{field:function(n,e){return i.push(n),t="form",r=Gd(n),o=e,{uiType:Mc(),owner:t,name:r,config:o,validated:{}};var t,r,o},record:function(){return i}}),t=n(e),r=e.record(),o=Mn(r,function(n){return Nc({name:n,pname:Gd(n)})});return ss("form",Ud,o,$d,t)}),_d=function(){var e=Ao(S.none()),t=function(){e.get().each(function(n){n.destroy()})};return{clear:function(){t(),e.set(S.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(S.some(n))},run:function(n){e.get().each(n)}}},qd=function(){var e=Ao(S.none());return{clear:function(){e.set(S.none())},set:function(n){e.set(S.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}},Xd=function(n){return{xValue:n,points:[]}},Yd=function(n,e){if(e===n.xValue)return n;var t=0<e-n.xValue?1:-1,r={direction:t,xValue:e};return{xValue:e,points:(0===n.points.length?[]:n.points[n.points.length-1].direction===t?n.points.slice(0,n.points.length-1):n.points).concat([r])}},Kd=function(n){if(0===n.points.length)return 0;var e=n.points[0].direction,t=n.points[n.points.length-1].direction;return-1===e&&-1===t?-1:1===e&&1===t?1:0},Jd=function(n){var r="navigateEvent",e=ir([xr("fields"),kr("maxFieldIndex",n.fields.length-1),xr("onExecute"),xr("getInitialValue"),Er("state",function(){return{dialogSwipeState:qd(),currentScreen:Ao(0)}})]),u=pr("SerialisedDialog",e,n),o=function(e,n,t){return vs.sketch({dom:bs('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){de(n,r,{direction:e})},buttonBehaviours:so([Pd.config({disableClass:Ai.resolve("toolbar-navigation-disabled"),disabled:!t})])})},i=function(n,o){var i=eu(n.element(),"."+Ai.resolve("serialised-dialog-screen"));ou(n.element(),"."+Ai.resolve("serialised-dialog-chain")).each(function(r){0<=u.state.currentScreen.get()+o&&u.state.currentScreen.get()+o<i.length&&(Wi(r,"left").each(function(n){var e=parseInt(n,10),t=al(i[0]);Pi(r,"left",e-o*t+"px")}),u.state.currentScreen.set(u.state.currentScreen.get()+o))})},a=function(r){var n=eu(r.element(),"input");S.from(n[u.state.currentScreen.get()]).each(function(n){r.getSystem().getByDom(n).each(function(n){var e,t;e=r,t=n.element(),e.getSystem().triggerFocus(t,e.element())})});var e=s.get(r);ku.highlightAt(e,u.state.currentScreen.get())},c=Nf(Wd(function(t){return{dom:bs('<div class="${prefix}-serialised-dialog"></div>'),components:[bd.sketch({dom:bs('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:Mn(u.fields,function(n,e){return e<=u.maxFieldIndex?bd.sketch({dom:bs('<div class="${prefix}-serialised-dialog-screen"></div>'),components:[o(-1,"previous",0<e),t.field(n.name,n.spec),o(1,"next",e<u.maxFieldIndex)]}):t.field(n.name,n.spec)})})],formBehaviours:so([Ei(function(n,e){var t;t=e,ou(n.element(),"."+Ai.resolve("serialised-dialog-chain")).each(function(n){Pi(n,"left",-u.state.currentScreen.get()*t.width+"px")})}),lc.config({mode:"special",focusIn:function(n){a(n)},onTab:function(n){return i(n,1),S.some(!0)},onShiftTab:function(n){return i(n,-1),S.some(!0)}}),md("form-events",[Yr(function(e,n){u.state.currentScreen.set(0),u.state.dialogSwipeState.clear();var t=s.get(e);ku.highlightFirst(t),u.getInitialValue(e).each(function(n){Xs.setValue(e,n)})}),Qr(u.onExecute),$r(W(),function(n,e){"left"===e.event().raw().propertyName&&a(n)}),$r(r,function(n,e){var t=e.event().direction();i(n,t)})])])}})),s=Nf({dom:bs('<div class="${prefix}-dot-container"></div>'),behaviours:so([ku.config({highlightClass:Ai.resolve("dot-active"),itemClass:Ai.resolve("dot-item")})]),components:An(u.fields,function(n,e){return e<=u.maxFieldIndex?[ys('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})});return{dom:bs('<div class="${prefix}-serializer-wrapper"></div>'),components:[c.asSpec(),s.asSpec()],behaviours:so([lc.config({mode:"special",focusIn:function(n){var e=c.get(n);lc.focusIn(e)}}),md("serializer-wrapper-events",[$r(A(),function(n,e){var t=e.event();u.state.dialogSwipeState.set(Xd(t.raw().touches[0].clientX))}),$r(L(),function(n,e){var t=e.event();u.state.dialogSwipeState.on(function(n){e.event().prevent(),u.state.dialogSwipeState.set(Yd(n,t.raw().touches[0].clientX))})}),$r(I(),function(r){u.state.dialogSwipeState.on(function(n){var e=c.get(r),t=-1*Kd(n);i(e,t)})})])])}},Qd=q(function(t,r){return[{label:"the link group",items:[Jd({fields:[kd("url","Type or paste URL"),kd("text","Link text"),kd("title","Link title"),kd("target","Link target"),(n="link",{name:n,spec:yd.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return S.none()}})})],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return S.some(ld.getInfo(r))},onExecute:function(n){var e=Xs.getValue(n);ld.applyInfo(r,e),t.restoreToolbar(),r.focus()}})]}];var n}),Zd=[{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"}]}],nh=Ur([(Zf=Kn(),nd=function(n,e){var t,r,o=e.event().originator(),i=e.event().target();return r=i,!(Pe(t=o,n.element())&&!Pe(t,r)&&(console.warn(Kn()+" did not get interpreted by the desired target. \nOriginator: "+_o(o)+"\nTarget: "+_o(i)+"\nCheck the "+Kn()+" event handlers"),1))},{key:Zf,value:Dr({can:nd})})]),eh=/* */Object.freeze({events:nh}),th=b,rh=function(e){var n=function(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+_o(e().element())+" is not in context.")}};return{debugInfo:p("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),isConnected:p(!1)}},oh=rh(),ih=function(n,o){var i={};return k(n,function(n,r){k(n,function(n,e){var t=Ht(e,[])(i);i[e]=t.concat([o(r,n)])})}),i},uh=function(n,e){return t=f.apply(undefined,[n.handler].concat(e)),r=n.purpose(),{cHandler:t,purpose:p(r)};var t,r},ah=function(n){return n.cHandler},ch=function(n,e){return{name:p(n),handler:p(e)}},sh=function(n,e,t){var r,o,i=y({},t,(r=n,o={},Hn(e,function(n){o[n.name()]=n.handlers(r)}),o));return ih(i,ch)},lh=function(n){var e,i=bn(e=n)?{can:p(!0),abort:p(!1),run:e}:e;return function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var o=[n,e].concat(t);i.abort.apply(undefined,o)?e.stop():i.can.apply(undefined,o)&&i.run.apply(undefined,o)}},fh=function(n,e,t){var r,o,i=e[t];return i?function(u,a,n,c){var e=n.slice(0);try{var t=e.sort(function(n,e){var t=n[a](),r=e[a](),o=c.indexOf(t),i=c.indexOf(r);if(-1===o)throw new Error("The ordering for "+u+" does not have an entry for "+t+".\nOrder specified: "+Kt(c,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+r+".\nOrder specified: "+Kt(c,null,2));return o<i?-1:i<o?1:0});return ct.value(t)}catch(r){return ct.error([r])}}("Event: "+t,"name",n,i).map(function(n){var e=Mn(n,function(n){return n.handler()});return Ar(e)}):(r=t,o=n,ct.error(["The event ("+r+') 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: '+Kt(Mn(o,function(n){return n.name()}),null,2)]))},dh=function(n,i){var e=C(n,function(r,o){return(1===r.length?ct.value(r[0].handler()):fh(r,i,o)).map(function(n){var e=lh(n),t=1<r.length?Sn(i,function(e){return wn(r,function(n){return n.name()===e})}).join(" > "):r[0].name();return Ot(o,{handler:e,purpose:p(t)})})});return kt(e,{})},hh=function(n){return vr("custom.definition",ir([sr("dom","dom",gt(),ir([xr("tag"),kr("styles",{}),kr("classes",[]),kr("attributes",{}),Sr("value"),Sr("innerHtml")])),xr("components"),xr("uid"),kr("events",{}),kr("apis",{}),sr("eventOrder","eventOrder",(e={"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]},mt.mergeWithThunk(p(e))),zr()),Sr("domModification")]),n);var e},mh=function(e,n){Hn(n,function(n){So(e,n)})},vh=function(e,n){Hn(n,function(n){To(e,n)})},gh=function(n,e){return t=n,o=Mn(r=e,function(n){return Or(n.name(),[xr("config"),kr("state",ao)])}),i=vr("component.behaviours",ir(o),t.behaviours).fold(function(n){throw new Error(br(n)+"\nComplete spec:\n"+Kt(t,null,2))},function(n){return n}),{list:r,data:V(i,function(n){var e=n.map(function(n){return{config:n.config,state:n.state.init(n.config)}});return function(){return e}})};var t,r,o,i},ph=function(n){var e,t,r,o=(e=n,t=Ht("behaviours",{})(e),r=Sn(O(t),function(n){return t[n]!==undefined}),Mn(r,function(n){return t[n].me}));return gh(n,o)},bh=function(n,e,t){var r,o,i,u=y({},(r=n).dom,{uid:r.uid,domChildren:Mn(r.components,function(n){return n.element()})}),a=n.domModification.fold(function(){return eo({})},eo),c={"alloy.base.modification":a},s=0<e.length?function(e,n,t,r){var o=y({},n);Hn(t,function(n){o[n.name()]=n.exhibit(e,r)});var i=ih(o,function(n,e){return{name:n,modification:e}}),u=function(n){return On(n,function(n,e){return y({},e.modification,n)},{})},a=On(i.classes,function(n,e){return e.modification.concat(n)},[]),c=u(i.attributes),s=u(i.styles);return eo({classes:a,attributes:c,styles:s})}(t,c,e,u):a;return i=s,y({},o=u,{attributes:y({},o.attributes,i.attributes),styles:y({},o.styles,i.styles),classes:o.classes.concat(i.classes)})},yh=function(n,e,t){var r,o,i,u,a,c,s={"alloy.base.behaviour":(r=n,r.events)};return(o=t,i=n.eventOrder,u=e,a=s,c=sh(o,u,a),dh(c,i)).getOrDie()},zh=function(t){var n=function(){return l},r=Ao(oh),e=gr(hh(t)),o=ph(t),i=o.list,u=o.data,a=function(n){var e=pe.fromTag(n.tag);po(e,n.attributes),mh(e,n.classes),Ui(e,n.styles),n.innerHtml.each(function(n){return Go(e,n)});var t=n.domChildren;return Ke(e,t),n.value.each(function(n){wd(e,n)}),n.uid,is(e,n.uid),e}(bh(e,i,u)),c=yh(e,i,u),s=Ao(e.components),l={getSystem:r.get,config:function(n){var e=u;return(bn(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+Kt(t,null,2))})()},hasConfigured:function(n){return bn(u[n.name()])},spec:p(t),readState:function(n){return u[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},getApis:function(){return e.apis},connect:function(n){r.set(n)},disconnect:function(){r.set(rh(n))},element:p(a),syncComponents:function(){var n=$e(a),e=An(n,function(n){return r.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});s.set(e)},components:s.get,events:p(c)};return l},wh=function(n){var e,t,r=th(n),o=r.events,i=c(r,["events"]),u=(e=i,t=Ht("components",[])(e),Mn(t,Sh)),a=y({},i,{events:y({},eh,o),components:u});return ct.value(zh(a))},xh=function(n){var e=pe.fromText(n);return Mh({element:e})},Mh=function(n){var e=pr("external.component",or([xr("element"),Sr("uid")]),n),t=Ao(rh());e.uid.each(function(n){is(e.element,n)});var r={getSystem:t.get,config:S.none,hasConfigured:p(!1),connect:function(n){t.set(n)},disconnect:function(){t.set(rh(function(){return r}))},getApis:function(){return{}},element:p(e.element),spec:p(n),readState:p("No state"),syncComponents:z,components:p([]),events:p({})};return Zc(r)},Hh=as,Sh=function(e){return(n=e,St(n,Qc)).fold(function(){var n=e.hasOwnProperty("uid")?e:y({uid:Hh("")},e);return wh(n).getOrDie()},function(n){return n});var n},Oh=Zc,Th="alloy.item-hover",kh="alloy.item-focus",Vh=function(n){(Ro(n.element()).isNone()||Fi.isFocused(n))&&(Fi.isFocused(n)||Fi.focus(n),de(n,Th,{item:n}))},Eh=function(n){de(n,kh,{item:n})},Ch=p(Th),Dh=p(kh),Ah=[xr("data"),xr("components"),xr("dom"),kr("hasSubmenu",!1),Sr("toggling"),mc("itemBehaviours",[ki,Fi,lc,Xs]),kr("ignoreFocus",!1),kr("domModification",{}),fi("builder",function(n){return{dom:n.dom,domModification:y({},n.domModification,{attributes:y({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes,{"aria-haspopup":n.hasSubmenu},n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:vc(n.itemBehaviours,[n.toggling.fold(ki.revoke,function(n){return ki.config(y({aria:{mode:"checked"}},n))}),Fi.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){Eh(n)}}),lc.config({mode:"execution"}),Xs.config({store:{mode:"memory",initialValue:n.data}}),md("item-type-events",[$r(re(),he),Xr(B()),$r(N(),Vh),$r(ee(),Fi.focus)])]),components:n.components,eventOrder:n.eventOrder}}),kr("eventOrder",{})],Lh=[xr("dom"),xr("components"),fi("builder",function(n){return{dom:n.dom,components:n.components,events:Ur([(e=ee(),$r(e,function(n,e){e.stop()}))])};var e})],Ih=p([Nc({name:"widget",overrides:function(e){return{behaviours:so([Xs.config({store:{mode:"manual",getValue:function(n){return e.data},setValue:function(){}}})])}}})]),Bh=[xr("uid"),xr("data"),xr("components"),xr("dom"),kr("autofocus",!1),kr("ignoreFocus",!1),mc("widgetBehaviours",[Xs,Fi,lc]),kr("domModification",{}),Jc(Ih()),fi("builder",function(t){var n=_c(0,t,Ih()),e=qc("item-widget",t,n.internals()),r=function(n){return Xc(n,t,"widget").map(function(n){return lc.focusIn(n),n})},o=function(n,e){return Ru(e.event().target())||t.autofocus&&e.setSource(n.element()),S.none()};return{dom:t.dom,components:e,domModification:t.domModification,events:Ur([Qr(function(n,e){r(n).each(function(n){e.stop()})}),$r(N(),Vh),$r(ee(),function(n,e){t.autofocus?r(n):Fi.focus(n)})]),behaviours:vc(t.widgetBehaviours,[Xs.config({store:{mode:"memory",initialValue:t.data}}),Fi.config({ignore:t.ignoreFocus,onFocus:function(n){Eh(n)}}),lc.config({mode:"special",focusIn:t.autofocus?function(n){r(n)}:mo(),onLeft:o,onRight:o,onEscape:function(n,e){return Fi.isFocused(n)||t.autofocus?(t.autofocus&&e.setSource(n.element()),S.none()):(Fi.focus(n),S.some(!0))}})])}})],Rh=yr("type",{widget:Bh,item:Ah,separator:Lh}),Fh=p([Pc({factory:{sketch:function(n){var e=pr("menu.spec item",Rh,n);return e.builder(e)}},name:"items",unit:"item",defaults:function(n,e){return e.hasOwnProperty("uid")?e:y({},e,{uid:as("item")})},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus,domModification:{classes:[n.markers.item]}}}})]),Nh=p([xr("value"),xr("items"),xr("dom"),xr("components"),kr("eventOrder",{}),fc("menuBehaviours",[ku,Xs,pd,lc]),Vr("movement",{mode:"menu",moveOnTab:!0},yr("mode",{grid:[hi(),fi("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:n.focusManager}})],matrix:[fi("config",function(n,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+n.markers.item},focusManager:n.focusManager}}),xr("rowSelector")],menu:[kr("moveOnTab",!0),fi("config",function(n,e){return{mode:"menu",selector:"."+n.markers.item,moveOnTab:e.moveOnTab,focusManager:n.focusManager}})]})),Mr("markers",oi()),kr("fakeFocus",!1),kr("focusManager",Eu()),ai("onHighlight")]),jh=p("alloy.menu-focus"),Ph=ms({name:"Menu",configFields:Nh(),partFields:Fh(),factory:function(n,e,t,r){return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:hc(n.menuBehaviours,[ku.config({highlightClass:n.markers.selectedItem,itemClass:n.markers.item,onHighlight:n.onHighlight}),Xs.config({store:{mode:"memory",initialValue:n.value}}),pd.config({find:S.some}),lc.config(n.movement.config(n,n.movement))]),events:Ur([$r(Dh(),function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){ku.highlight(e,n),t.stop(),de(e,jh(),{menu:e,item:n})})}),$r(Ch(),function(n,e){var t=e.event().item();ku.highlight(n,t)})]),components:e,eventOrder:n.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Uh=function(n,e,t,r){var o=n.getSystem().build(r);tt(n,o,t)},Gh=function(n,e,t,r){var o=$h(n,e);kn(o,function(n){return Pe(r.element(),n.element())}).each(ot)},$h=function(n,e){return n.components()},Wh=function(e,t,n,o,r){var i=$h(e,t);return S.from(i[o]).map(function(n){return Gh(e,t,0,n),r.each(function(n){Uh(e,0,function(n,e){var t,r;r=e,We(t=n,o).fold(function(){Ye(t,r)},function(n){_e(n,r)})},n)}),n})},_h=fo({fields:[],name:"replacing",apis:/* */Object.freeze({append:function(n,e,t,r){Uh(n,0,Ye,r)},prepend:function(n,e,t,r){Uh(n,0,Xe,r)},remove:Gh,replaceAt:Wh,replaceBy:function(e,t,n,r,o){var i=$h(e,t);return Vn(i,r).bind(function(n){return Wh(e,t,0,n,o)})},set:function(e,n,t,r){var o,i,u,a,c,s;i=(o=e).components(),Hn(i,rt),Je(o.element()),o.syncComponents(),u=function(){var n=Mn(r,e.getSystem().build);Hn(n,function(n){et(e,n)})},a=e.element(),c=Ue(a),s=Bo(c).bind(function(e){var n=function(n){return Pe(e,n)};return n(a)?S.some(a):jr(a,n)}),u(a),s.each(function(e){Bo(c).filter(function(n){return Pe(n,e)}).fold(function(){Lo(e)},z)})},contents:$h})}),qh=function(t,r,o,n){return St(o,n).bind(function(n){return St(t,n).bind(function(n){var e=qh(t,r,o,n);return S.some([n].concat(e))})}).getOr([])},Xh=function(n,e){var t={};k(n,function(n,e){Hn(n,function(n){t[n]=e})});var r=e,o=E(e,function(n,e){return{k:n,v:e}}),i=V(o,function(n,e){return[e].concat(qh(t,r,o,e))});return V(t,function(n){return St(i,n).getOr([n])})},Yh=function(){var i=Ao({}),u=Ao({}),a=Ao({}),c=Ao(S.none()),s=Ao({}),e=function(n){return St(u.get(),n)};return{setMenuBuilt:function(n,e){var t;u.set(y({},u.get(),((t={})[n]={type:"prepared",menu:e},t)))},setContents:function(n,e,t,r){c.set(S.some(n)),i.set(t),u.set(e),s.set(r);var o=Xh(r,t);a.set(o)},expand:function(t){return St(i.get(),t).map(function(n){var e=St(a.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return St(a.get(),n)},collapse:function(n){return St(a.get(),n).bind(function(n){return 1<n.length?S.some(n.slice(1)):S.none()})},lookupMenu:e,otherMenus:function(n){var e,t,r=s.get();return e=O(r),t=n,Sn(e,function(n){return!wn(t,n)})},getPrimary:function(){return c.get().bind(function(n){return e(n).bind(function(n){return"prepared"===n.type?S.some(n.menu):S.none()})})},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),a.set({}),c.set(S.none())},isClear:function(){return c.get().isNone()}}},Kh=p("collapse-item"),Jh=hs({name:"TieredMenu",configFields:[li("onExecute"),li("onEscape"),si("onOpenMenu"),si("onOpenSubmenu"),ai("onCollapseMenu"),kr("highlightImmediately",!0),Hr("data",[xr("primary"),xr("menus"),xr("expansions")]),kr("fakeFocus",!1),ai("onHighlight"),ai("onHover"),Hr("markers",[xr("backgroundMenu")].concat(ti()).concat(ri())),xr("dom"),kr("navigateOnHover",!0),kr("stayInDom",!1),fc("tmenuBehaviours",[lc,ku,pd,_h]),kr("eventOrder",{})],apis:{collapseMenu:function(n,e){n.collapseMenu(e)},highlightPrimary:function(n,e){n.highlightPrimary(e)}},factory:function(a,n){var c,e,i=Ao(S.none()),u=function(r,o,n){return V(n,function(n,e){var t=function(){return Ph.sketch(y({dom:n.dom},n,{value:e,items:n.items,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:a.fakeFocus?(o=function(n){return ku.getHighlighted(n).map(function(n){return n.element()})},{get:o,set:function(e,n){var t=o(e);e.getSystem().getByDom(n).fold(z,function(n){ku.highlight(e,n)});var r=o(e);Vu(e,t,r)}}):Eu()}));var o};return e===o?{type:"prepared",menu:r.getSystem().build(t())}:{type:"notbuilt",nbMenu:t}})},s=Yh(),l=function(n){return Xs.getValue(n).value},f=function(n){return V(a.data.menus,function(n,e){return An(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})},d=function(e,n){ku.highlight(e,n),ku.getHighlighted(n).orThunk(function(){return ku.getFirst(n)}).each(function(n){me(e,n.element(),ee())})},h=function(e,n){return Xo(Mn(n,function(n){return e.lookupMenu(n).bind(function(n){return"prepared"===n.type?S.some(n.menu):S.none()})}))},m=function(e,n,t){var r=h(n,n.otherMenus(t));Hn(r,function(n){vh(n.element(),[a.markers.backgroundMenu]),a.stayInDom||_h.remove(e,n)})},v=function(n,r){var o,e=(o=n,i.get().getOrThunk(function(){var t={},n=eu(o.element(),"."+a.markers.item),e=Sn(n,function(n){return"true"===bo(n,"aria-haspopup")});return Hn(e,function(n){o.getSystem().getByDom(n).each(function(n){var e=l(n);t[e]=n})}),i.set(S.some(t)),t}));k(e,function(n,e){var t=wn(r,e);go(n.element(),"aria-expanded",t)})},g=function(r,o,i){return S.from(i[0]).bind(function(n){return o.lookupMenu(n).bind(function(n){if("notbuilt"===n.type)return S.none();var e=n.menu,t=h(o,i.slice(1));return Hn(t,function(n){So(n.element(),a.markers.backgroundMenu)}),Se(e.element())||_h.append(r,Oh(e)),vh(e.element(),[a.markers.backgroundMenu]),d(r,e),m(r,o,i),S.some(e)})})};(e=c||(c={}))[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent";var p=function(o,i,u){void 0===u&&(u=c.HighlightSubmenu);var n=l(i);return s.expand(n).bind(function(r){return v(o,r),S.from(r[0]).bind(function(t){return s.lookupMenu(t).bind(function(n){var e=function(n,e,t){if("notbuilt"!==t.type)return t.menu;var r=n.getSystem().build(t.nbMenu());return s.setMenuBuilt(e,r),r}(o,t,n);return Se(e.element())||_h.append(o,Oh(e)),a.onOpenSubmenu(o,i,e),u===c.HighlightSubmenu?(ku.highlightFirst(e),g(o,s,r)):(ku.dehighlightAll(e),S.some(i))})})})},r=function(e,t){var n=l(t);return s.collapse(n).bind(function(n){return v(e,n),g(e,s,n).map(function(n){return a.onCollapseMenu(e,t,n),n})})},t=function(t){return function(e,n){return iu(n.getSource(),"."+a.markers.item).bind(function(n){return e.getSystem().getByDom(n).toOption().bind(function(n){return t(e,n).map(function(){return!0})})})}},o=Ur([$r(jh(),function(e,n){var t=n.event().menu();ku.highlight(e,t);var r=l(n.event().item());s.refresh(r).each(function(n){return m(e,s,n)})}),Qr(function(e,n){var t=n.event().target();e.getSystem().getByDom(t).each(function(n){0===l(n).indexOf("collapse-item")&&r(e,n),p(e,n,c.HighlightSubmenu).fold(function(){a.onExecute(e,n)},function(){})})}),Yr(function(e,n){var t,r,o;(t=e,r=u(t,a.data.primary,a.data.menus),o=f(t),s.setContents(a.data.primary,r,a.data.expansions,o),s.getPrimary()).each(function(n){_h.append(e,Oh(n)),a.onOpenMenu(e,n),a.highlightImmediately&&d(e,n)})})].concat(a.navigateOnHover?[$r(Ch(),function(n,e){var t,r,o=e.event().item();t=n,r=l(o),s.refresh(r).bind(function(n){return v(t,n),g(t,s,n)}),p(n,o,c.HighlightParent),a.onHover(n,o)})]:[])),b={collapseMenu:function(e){ku.getHighlighted(e).each(function(n){ku.getHighlighted(n).each(function(n){r(e,n)})})},highlightPrimary:function(e){s.getPrimary().each(function(n){d(e,n)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:hc(a.tmenuBehaviours,[lc.config({mode:"special",onRight:t(function(n,e){return Ru(e.element())?S.none():p(n,e,c.HighlightSubmenu)}),onLeft:t(function(n,e){return Ru(e.element())?S.none():r(n,e)}),onEscape:t(function(n,e){return r(n,e).orThunk(function(){return a.onEscape(n,e).map(function(){return n})})}),focusIn:function(e,n){s.getPrimary().each(function(n){me(e,n.element(),ee())})}}),ku.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),pd.config({find:function(n){return ku.getHighlighted(n)}}),_h.config({})]),eventOrder:a.eventOrder,apis:b,events:o}},extraApis:{tieredData:function(n,e,t){return{primary:n,menus:e,expansions:t}},singleData:function(n,e){return{primary:n,menus:Ot(n,e),expansions:{}}},collapseItem:function(n){return{value:Sc(Kh()),meta:{text:n}}}}}),Qh=function(n,e,t,r){return St(e.routes,r.start).bind(function(n){return St(n,r.destination)})},Zh=function(n,e,t,r){return Qh(0,e,0,r).bind(function(e){return e.transition.map(function(n){return{transition:n,route:e}})})},nm=function(t,r,n){var e,o,i;(e=t,o=r,i=n,em(e,o,i).bind(function(n){return Zh(e,o,i,n)})).each(function(n){var e=n.transition;To(t.element(),e.transitionClass),zo(t.element(),r.destinationAttr)})},em=function(n,e,t){var r=n.element();return yo(r,e.destinationAttr)?S.some({start:bo(n.element(),e.stateAttr),destination:bo(n.element(),e.destinationAttr)}):S.none()},tm=function(n,e,t,r){nm(n,e,t),yo(n.element(),e.stateAttr)&&bo(n.element(),e.stateAttr)!==r&&e.onFinish(n,r),go(n.element(),e.stateAttr,r)},rm=/* */Object.freeze({findRoute:Qh,disableTransition:nm,getCurrentRoute:em,jumpTo:tm,progressTo:function(t,r,o,i){var n,e;e=r,yo((n=t).element(),e.destinationAttr)&&(go(n.element(),e.stateAttr,bo(n.element(),e.destinationAttr)),zo(n.element(),e.destinationAttr));var u,a,c=(u=r,a=i,{start:bo(t.element(),u.stateAttr),destination:a});Zh(t,r,o,c).fold(function(){tm(t,r,o,i)},function(n){nm(t,r,o);var e=n.transition;So(t.element(),e.transitionClass),go(t.element(),r.destinationAttr,i)})},getState:function(n,e,t){var r=n.element();return yo(r,e.stateAttr)?S.some(bo(r,e.stateAttr)):S.none()}}),om=/* */Object.freeze({events:function(o,i){return Ur([$r(W(),function(t,n){var r=n.event().raw();em(t,o,i).each(function(e){Qh(0,o,0,e).each(function(n){n.transition.each(function(n){r.propertyName===n.property&&(tm(t,o,i,e.destination),o.onTransition(t,e))})})})}),Yr(function(n,e){tm(n,o,i,o.initialState)})])}}),im=[kr("destinationAttr","data-transitioning-destination"),kr("stateAttr","data-transitioning-state"),xr("initialState"),ai("onTransition"),ai("onFinish"),Mr("routes",mr(ct.value,mr(ct.value,or([Tr("transition",[xr("property"),xr("transitionClass")])]))))],um=fo({fields:im,name:"transitioning",active:om,apis:rm,extra:{createRoutes:function(n){var r={};return k(n,function(n,e){var t=e.split("<->");r[t[0]]=Ot(t[1],n),r[t[1]]=Ot(t[0],n)}),r},createBistate:function(n,e,t){return Tt([{key:n,value:Ot(e,t)},{key:e,value:Ot(n,t)}])},createTristate:function(n,e,t,r){return Tt([{key:n,value:Tt([{key:e,value:r},{key:t,value:r}])},{key:e,value:Tt([{key:n,value:r},{key:t,value:r}])},{key:t,value:Tt([{key:n,value:r},{key:e,value:r}])}])}}}),am=Ai.resolve("scrollable"),cm={register:function(n){So(n,am)},deregister:function(n){To(n,am)},scrollable:p(am)},sm=function(n){return St(n,"format").getOr(n.title)},lm=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[Ai.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:Ai.resolve("format-matches"),selected:t},itemBehaviours:so(o?[]:[Vi(n,function(n,e){(e?ki.on:ki.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},fm=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[vs.sketch({dom:{tag:"div",classes:[Ai.resolve("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[Ai.resolve("styles-collapse-icon")]}},xh(n)]:[xh(n)],action:function(n){if(r){var e=t().get(n);Jh.collapseMenu(e)}}}),{dom:{tag:"div",classes:[Ai.resolve("styles-menu-items-container")]},components:[Ph.parts().items({})],behaviours:so([md("adhoc-scrollable-menu",[Yr(function(n,e){Pi(n.element(),"overflow-y","auto"),Pi(n.element(),"-webkit-overflow-scrolling","touch"),cm.register(n.element())}),Kr(function(n){_i(n.element(),"overflow-y"),_i(n.element(),"-webkit-overflow-scrolling"),cm.deregister(n.element())})])])}],items:e,menuBehaviours:so([um.config({initialState:"after",routes:um.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},dm=function(r){var o,i,n,e,t,u=(o=r.formats,i=function(){return a},n=fm("Styles",[].concat(Mn(o.items,function(n){return lm(sm(n),n.title,n.isSelected(),n.getPreview(),Vt(o.expansions,sm(n)))})),i,!1),e=V(o.menus,function(n,e){var t=Mn(n,function(n){return lm(sm(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",Vt(o.expansions,sm(n)))});return fm(e,t,i,!0)}),t=dt(e,Ot("styles",n)),{tmenu:Jh.tieredData("styles",t,o.expansions)}),a=Nf(Jh.sketch({dom:{tag:"div",classes:[Ai.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=Xs.getValue(e);return r.handle(e,t.value),S.none()},onEscape:function(){return S.none()},onOpenMenu:function(n,e){var t=al(n.element());ul(e.element(),t),um.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=al(n.element()),o=ru(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();ul(t.element(),r),um.progressTo(i,"before"),um.jumpTo(t,"after"),um.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=ru(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();um.progressTo(o,"after"),um.progressTo(t,"current")},navigateOnHover:!1,highlightImmediately:!0,data:u.tmenu,markers:{backgroundMenu:Ai.resolve("styles-background-menu"),menu:Ai.resolve("styles-menu"),selectedMenu:Ai.resolve("styles-selected-menu"),item:Ai.resolve("styles-item"),selectedItem:Ai.resolve("styles-selected-item")}}));return a.asSpec()},hm=function(n){return Vt(n,"items")?(i=dt((st([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),e=o=n,t=["items"],r={},k(e,function(n,e){wn(t,e)||(r[e]=n)}),r),{menu:!0}),u=mm(o.items),{item:i,menus:dt(u.menus,Ot(o.title,u.items)),expansions:dt(u.expansions,Ot(o.title,o.title))}):{item:n,menus:{},expansions:{}};var e,t,r,o,i,u},mm=function(n){return On(n,function(n,e){var t=hm(e);return{menus:dt(n.menus,t.menus),items:[t.item].concat(n.items),expansions:dt(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},vm={expand:mm},gm=function(u,n){var a=function(n){return function(){return u.formatter.match(n)}},c=function(n){return function(){return u.formatter.getCssText(n)}},e=St(n,"style_formats").getOr(Zd),s=function(n){return Mn(n,function(n){if(Vt(n,"items")){var e=s(n.items);return dt(dt(n,{isSelected:p(!1),getPreview:p("")}),{items:e})}return Vt(n,"format")?dt(i=n,{isSelected:a(i.format),getPreview:c(i.format)}):(r=Sc((t=n).title),o=dt(t,{format:r,isSelected:a(r),getPreview:c(r)}),u.formatter.register(r,o),o);var t,r,o,i})};return s(e)},pm=function(t,n,r){var e,o,i,u=(e=t,i=(o=function(n){return An(n,function(n){return n.items===undefined?!Vt(n,"format")||e.formatter.canApply(n.format)?[n]:[]:0<o(n.items).length?[n]:[]})})(n),vm.expand(i));return dm({formats:u,handle:function(n,e){t.undoManager.transact(function(){ki.isOn(n)?t.formatter.remove(e):t.formatter.apply(e)}),r()}})},bm=["undo","bold","italic","link","image","bullist","styleselect"],ym=function(n){var e=n.replace(/\|/g," ").trim();return 0<e.length?e.split(/\s+/):[]},zm=function(n){return An(n,function(n){return gn(n)?zm(n):ym(n)})},wm=function(n){var e=n.toolbar!==undefined?n.toolbar:bm;return gn(e)?zm(e):ym(e)},xm=function(r,o){var n=function(n){return function(){return Hs.forToolbarCommand(o,n)}},e=function(n){return function(){return Hs.forToolbarStateCommand(o,n)}},t=function(n,e,t){return function(){return Hs.forToolbarStateAction(o,n,e,t)}},i=n("undo"),u=n("redo"),a=e("bold"),c=e("italic"),s=e("underline"),l=n("removeformat"),f=t("unlink","link",function(){o.execCommand("unlink",null,!1)}),d=t("unordered-list","ul",function(){o.execCommand("InsertUnorderedList",null,!1)}),h=t("ordered-list","ol",function(){o.execCommand("InsertOrderedList",null,!1)}),m=gm(o,o.settings),v=function(){return pm(o,m,function(){o.fire("scrollIntoView")})},g=function(n,e){return{isSupported:function(){return n.forall(function(n){return Vt(o.buttons,n)})},sketch:e}};return{undo:g(S.none(),i),redo:g(S.none(),u),bold:g(S.none(),a),italic:g(S.none(),c),underline:g(S.none(),s),removeformat:g(S.none(),l),link:g(S.none(),function(){return e=r,t=o,Hs.forToolbarStateAction(t,"link","link",function(){var n=Qd(e,t);e.setContextToolbar(n),hd(t,function(){e.focusToolbar()}),ld.query(t).each(function(n){t.selection.select(n.dom())})});var e,t}),unlink:g(S.none(),f),image:g(S.none(),function(){return od(o)}),bullist:g(S.some("bullist"),d),numlist:g(S.some("numlist"),h),fontsizeselect:g(S.none(),function(){return n={onChange:function(n){Bf.apply(e,n)},getInitialValue:function(){return Bf.get(e)}},Vf(r,"font-size",function(){return Ff(n)},e=o);var e,n}),forecolor:g(S.none(),function(){return Cf(r,o)}),styleselect:g(S.none(),function(){return Hs.forToolbar("style-formats",function(n){o.fire("toReading"),r.dropup().appear(v,ki.on,n)},so([ki.config({toggleClass:Ai.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),vi.config({channels:Tt([Ci(Po.orientationChanged(),ki.off),Ci(Po.dropupDismissed(),ki.off)])})]),o)})}},Mm=function(n,t){var e=wm(n),r={};return An(e,function(n){var e=!Vt(r,n)&&Vt(t,n)&&t[n].isSupported()?[t[n].sketch()]:[];return r[n]=!0,e})},Hm=function(h,m){return function(n){if(h(n)){var e,t,r,o,i,u,a,c=pe.fromDom(n.target),s=function(){n.stopPropagation()},l=function(){n.preventDefault()},f=v(l,s),d=(e=c,t=n.clientX,r=n.clientY,o=s,i=l,u=f,a=n,{target:p(e),x:p(t),y:p(r),stop:o,prevent:i,kill:u,raw:p(a)});m(d)}}},Sm=function(n,e,t,r,o){var i=Hm(t,r);return n.dom().addEventListener(e,i,o),{unbind:f(Om,n,e,i,o)}},Om=function(n,e,t,r){n.dom().removeEventListener(e,t,r)},Tm=p(!0),km=function(n,e,t){return Sm(n,e,Tm,t,!1)},Vm=function(n,e,t){return Sm(n,e,Tm,t,!0)},Em=function(n){var e=n.matchMedia("(orientation: portrait)").matches;return{isPortrait:p(e)}},Cm=Em,Dm=function(r,e){var n=pe.fromDom(r),o=null,t=km(n,"orientationchange",function(){clearInterval(o);var n=Em(r);e.onChange(n),i(function(){e.onReady(n)})}),i=function(n){clearInterval(o);var e=r.innerHeight,t=0;o=setInterval(function(){e!==r.innerHeight?(clearInterval(o),n(S.some(r.innerHeight))):20<t&&(clearInterval(o),n(S.none())),t++},50)};return{onAdjustment:i,destroy:function(){t.unbind()}}},Am=function(n){var e=Xn.detect().os.isiOS(),t=Em(n).isPortrait();return e&&!t?n.screen.height:n.screen.width},Lm=function(n){var e=n.raw();return e.touches===undefined||1!==e.touches.length?S.none():S.some(e.touches[0])},Im=function(t){var u=Ao(S.none()),r=function n(t,r){var o=null;return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},schedule:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];o=setTimeout(function(){t.apply(null,n),o=null},r)}}}(function(n){u.set(S.none()),t.triggerEvent(oe(),n)},400),o=Tt([{key:A(),value:function(t){return Lm(t).each(function(n){r.cancel();var e={x:p(n.clientX),y:p(n.clientY),target:t.target};r.schedule(t),u.set(S.some(e))}),S.none()}},{key:L(),value:function(n){return r.cancel(),Lm(n).each(function(i){u.get().each(function(n){var e,t,r,o;e=i,t=n,r=Math.abs(e.clientX-t.x()),o=Math.abs(e.clientY-t.y()),(5<r||5<o)&&u.set(S.none())})}),S.none()}},{key:I(),value:function(e){return r.cancel(),u.get().filter(function(n){return Pe(n.target(),e.target())}).map(function(n){return t.triggerEvent(te(),e)})}}]);return{fireIfReady:function(e,n){return St(o,n).bind(function(n){return n(e)})}}},Bm=function(t){var e=Im({triggerEvent:function(n,e){t.onTapContent(e)}});return{fireTouchstart:function(n){e.fireIfReady(n,"touchstart")},onTouchend:function(){return km(t.body(),"touchend",function(n){e.fireIfReady(n,"touchend")})},onTouchmove:function(){return km(t.body(),"touchmove",function(n){e.fireIfReady(n,"touchmove")})}}},Rm=6<=Xn.detect().os.version.major,Fm=function(r,e,t){var o=Bm(r),i=Ue(e),u=function(n){return!Pe(n.start(),n.finish())||n.soffset()!==n.foffset()},n=function(){var n=r.doc().dom().hasFocus()&&r.getSelection().exists(u);t.getByDom(e).each(!0===(n||Bo(i).filter(function(n){return"input"===we(n)}).exists(function(n){return n.dom().selectionStart!==n.dom().selectionEnd}))?ki.on:ki.off)},a=[km(r.body(),"touchstart",function(n){r.onTouchContent(),o.fireTouchstart(n)}),o.onTouchmove(),o.onTouchend(),km(e,"touchstart",function(n){r.onTouchToolstrip()}),r.onToReading(function(){Io(r.body())}),r.onToEditing(z),r.onScrollToCursor(function(n){n.preventDefault(),r.getCursorBox().each(function(n){var e=r.win(),t=n.top()>e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!==t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0===Rm?[]:[km(pe.fromDom(r.win()),"blur",function(){t.getByDom(e).each(ki.off)}),km(i,"select",n),km(r.doc(),"selectionchange",n)]);return{destroy:function(){Hn(a,function(n){n.unbind()})}}},Nm=function(n,e){var t=parseInt(bo(n,e),10);return isNaN(t)?0:t},jm=function _p(t,r){var o=function(n){return t(n)?S.from(n.dom().nodeValue):S.none()},n=Xn.detect().browser,e=n.isIE()&&10===n.version.major?function(n){try{return o(n)}catch(e){return S.none()}}:o;return{get:function(n){if(!t(n))throw new Error("Can only get "+r+" value of a "+r+" node");return e(n).getOr("")},getOption:e,set:function(n,e){if(!t(n))throw new Error("Can only set raw "+r+" value of a "+r+" node");n.dom().nodeValue=e}}}(He,"text"),Pm=function(n){return jm.getOption(n)},Um=st([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Gm={before:Um.before,on:Um.on,after:Um.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(b,b,b)}},$m=st([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Wm=ke("start","soffset","finish","foffset"),_m=$m.relative,qm=$m.exact,Xm=function(n,e,t,r){var o,i,u,a,c,s=(i=e,u=t,a=r,(c=Ue(o=n).dom().createRange()).setStart(o.dom(),i),c.setEnd(u.dom(),a),c),l=Pe(n,t)&&e===r;return s.collapsed&&!l},Ym=function(n,e,t){var r,o,i=n.document.createRange();return r=i,e.fold(function(n){r.setStartBefore(n.dom())},function(n,e){r.setStart(n.dom(),e)},function(n){r.setStartAfter(n.dom())}),o=i,t.fold(function(n){o.setEndBefore(n.dom())},function(n,e){o.setEnd(n.dom(),e)},function(n){o.setEndAfter(n.dom())}),i},Km=function(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i},Jm=function(n){return{left:p(n.left),top:p(n.top),right:p(n.right),bottom:p(n.bottom),width:p(n.width),height:p(n.height)}},Qm=st([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Zm=function(n,e,t){return e(pe.fromDom(t.startContainer),t.startOffset,pe.fromDom(t.endContainer),t.endOffset)},nv=function(n,e){var o,t,r,i=(o=n,e.match({domRange:function(n){return{ltr:p(n),rtl:S.none}},relative:function(n,e){return{ltr:q(function(){return Ym(o,n,e)}),rtl:q(function(){return S.some(Ym(o,e,n))})}},exact:function(n,e,t,r){return{ltr:q(function(){return Km(o,n,e,t,r)}),rtl:q(function(){return S.some(Km(o,t,r,n,e))})}}}));return(r=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Qm.rtl(pe.fromDom(n.endContainer),n.endOffset,pe.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Zm(0,Qm.ltr,r)}):Zm(0,Qm.ltr,r)},ev=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(n,e){var t=we(n);return"input"===t?Gm.after(n):wn(["br","img"],t)?0===e?Gm.before(n):Gm.after(n):Gm.on(n,e)}),tv=function(n,e,t,r,o){var i,u,a=Km(n,e,t,r,o);i=n,u=a,S.from(i.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(u)})},rv=function(n,e,t,r,o){var i,u,a,c,f,s=(i=r,u=o,a=ev(e,t),c=ev(i,u),_m(a,c));nv(f=n,s).match({ltr:function(n,e,t,r){tv(f,n,e,t,r)},rtl:function(n,e,t,r){var o,i,u,a,c,s=f.getSelection();if(s.setBaseAndExtent)s.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(s.extend)try{i=n,u=e,a=t,c=r,(o=s).collapse(i.dom(),u),o.extend(a.dom(),c)}catch(l){tv(f,t,r,n,e)}else tv(f,t,r,n,e)}})},ov=function(n){var e=pe.fromDom(n.anchorNode),t=pe.fromDom(n.focusNode);return Xm(e,n.anchorOffset,t,n.focusOffset)?S.some(Wm(pe.fromDom(n.anchorNode),n.anchorOffset,pe.fromDom(n.focusNode),n.focusOffset)):function(n){if(0<n.rangeCount){var e=n.getRangeAt(0),t=n.getRangeAt(n.rangeCount-1);return S.some(Wm(pe.fromDom(e.startContainer),e.startOffset,pe.fromDom(t.endContainer),t.endOffset))}return S.none()}(n)},iv=function(n){return S.from(n.getSelection()).filter(function(n){return 0<n.rangeCount}).bind(ov)},uv=function(n,e){var i,t,r,o,u=nv(i=n,e).match({ltr:function(n,e,t,r){var o=i.document.createRange();return o.setStart(n.dom(),e),o.setEnd(t.dom(),r),o},rtl:function(n,e,t,r){var o=i.document.createRange();return o.setStart(t.dom(),r),o.setEnd(n.dom(),e),o}});return r=(t=u).getClientRects(),0<(o=0<r.length?r[0]:t.getBoundingClientRect()).width||0<o.height?S.some(o).map(Jm):S.none()},av=function(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:p(2),height:n.height}},cv=function(n){return{left:p(n.left),top:p(n.top),right:p(n.right),bottom:p(n.bottom),width:p(n.width),height:p(n.height)}},sv=function(r){if(r.collapsed){var o=pe.fromDom(r.startContainer);return Ge(o).bind(function(n){var e,t=qm(o,r.startOffset,n,"img"===we(e=n)?1:Pm(e).fold(function(){return $e(e).length},function(n){return n.length}));return uv(r.startContainer.ownerDocument.defaultView,t).map(av).map(Rn)}).getOr([])}return Mn(r.getClientRects(),cv)},lv=function(n){var e=n.getSelection();return e!==undefined&&0<e.rangeCount?sv(e.getRangeAt(0)):[]},fv=function(n){n.focus();var e=pe.fromDom(n.document.body);(Bo().exists(function(n){return wn(["input","textarea"],we(n))})?function(n){setTimeout(function(){n()},0)}:l)(function(){Bo().each(Io),Lo(e)})},dv="data-"+Ai.resolve("last-outer-height"),hv=function(n,e){go(n,dv,e)},mv=function(n){return{top:p(n.top()),bottom:p(n.top()+n.height())}},vv=function(n,e){var t=Nm(e,dv),r=n.innerHeight;return r<t?S.some(t-r):S.none()},gv=function(n,u){var e=pe.fromDom(u.document.body),t=km(pe.fromDom(n),"resize",function(){vv(n,e).each(function(i){var n,e;(n=u,e=lv(n),0<e.length?S.some(e[0]).map(mv):S.none()).each(function(n){var e,t,r,o=(e=u,r=i,(t=n).top()>e.innerHeight||t.bottom()>e.innerHeight?Math.min(r,t.bottom()-e.innerHeight+50):0);0!==o&&u.scrollTo(u.pageXOffset,u.pageYOffset+o)})}),hv(e,n.innerHeight)});return hv(e,n.innerHeight),{toEditing:function(){fv(u)},destroy:function(){t.unbind()}}},pv=function(n){return S.some(pe.fromDom(n.dom().contentWindow.document.body))},bv=function(n){return S.some(pe.fromDom(n.dom().contentWindow.document))},yv=function(n){return S.from(n.dom().contentWindow)},zv=function(n){return yv(n).bind(iv)},wv=function(n){return n.getFrame()},xv=function(n,t){return function(e){return e[n].getOrThunk(function(){var n=wv(e);return function(){return t(n)}})()}},Mv=function(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return km(e,r,n)}})},Hv=function(n){return{left:p(n.left),top:p(n.top),right:p(n.right),bottom:p(n.bottom),width:p(n.width),height:p(n.height)}},Sv={getBody:xv("getBody",pv),getDoc:xv("getDoc",bv),getWin:xv("getWin",yv),getSelection:xv("getSelection",zv),getFrame:wv,getActiveApi:function(a){var c=wv(a);return pv(c).bind(function(u){return bv(c).bind(function(i){return yv(c).map(function(o){var n=pe.fromDom(i.dom().documentElement),e=a.getCursorBox.getOrThunk(function(){return function(){return(n=o,iv(n).map(function(n){return qm(n.start(),n.soffset(),n.finish(),n.foffset())})).bind(function(n){return uv(o,n).orThunk(function(){return iv(o).filter(function(n){return Pe(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0<e.width||0<e.height?S.some(e).map(Hv):S.none()})})});var n}}),t=a.setSelection.getOrThunk(function(){return function(n,e,t,r){rv(o,n,e,t,r)}}),r=a.clearSelection.getOrThunk(function(){return function(){o.getSelection().removeAllRanges()}});return{body:p(u),doc:p(i),win:p(o),html:p(n),getSelection:f(zv,c),setSelection:t,clearSelection:r,frame:p(c),onKeyup:Mv(a,i,"onKeyup","keyup"),onNodeChanged:Mv(a,i,"onNodeChanged","selectionchange"),onDomChanged:a.onDomChanged,onScrollToCursor:a.onScrollToCursor,onScrollToElement:a.onScrollToElement,onToReading:a.onToReading,onToEditing:a.onToEditing,onToolbarScrollStart:a.onToolbarScrollStart,onTouchContent:a.onTouchContent,onTapContent:a.onTapContent,onTouchToolstrip:a.onTouchToolstrip,getCursorBox:e}})})})}},Ov="data-ephox-mobile-fullscreen-style",Tv="position:absolute!important;",kv="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;",Vv=Xn.detect().os.isAndroid(),Ev=function(n,e){var t,r,o,i=function(r){return function(n){var e=bo(n,"style"),t=e===undefined?"no-styles":e.trim();t!==r&&(go(n,Ov,t),go(n,"style",r))}},u=(t="*",Zi(n,function(n){return Re(n,t)},r)),a=An(u,function(n){var e;return e="*",nu(n,function(n){return Re(n,e)})}),c=(o=Gi(e,"background-color"))!==undefined&&""!==o?"background-color:"+o+"!important":"background-color:rgb(255,255,255)!important;";Hn(a,i("display:none!important;")),Hn(u,i(Tv+kv+c)),i((!0===Vv?"":Tv)+kv+c)(n)},Cv=function(){var n=Ne("["+Ov+"]");Hn(n,function(n){var e=bo(n,Ov);"no-styles"!==e?go(n,"style",e):zo(n,"style"),zo(n,Ov)})},Dv=function(){var e=tu("head").getOrDie(),n=tu('meta[name="viewport"]').getOrThunk(function(){var n=pe.fromTag("meta");return go(n,"name","viewport"),Ye(e,n),n}),t=bo(n,"content");return{maximize:function(){go(n,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){t!==undefined&&null!==t&&0<t.length?go(n,"content",t):go(n,"content","user-scalable=yes")}}},Av=function(e,n){var t=Dv(),r=_d(),o=_d();return{enter:function(){n.hide(),So(e.container,Ai.resolve("fullscreen-maximized")),So(e.container,Ai.resolve("android-maximized")),t.maximize(),So(e.body,Ai.resolve("android-scroll-reload")),r.set(gv(e.win,Sv.getWin(e.editor).getOrDie("no"))),Sv.getActiveApi(e.editor).each(function(n){Ev(e.container,n.body()),o.set(Fm(n,e.toolstrip,e.alloy))})},exit:function(){t.restore(),n.show(),To(e.container,Ai.resolve("fullscreen-maximized")),To(e.container,Ai.resolve("android-maximized")),Cv(),To(e.body,Ai.resolve("android-scroll-reload")),o.clear(),r.clear()}}},Lv=function(t,r){var o=null;return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==o&&clearTimeout(o),o=setTimeout(function(){t.apply(null,n),o=null},r)}}},Iv=function(n,e){var t,r,o,i=Nf(bd.sketch({dom:bs('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:so([ki.config({toggleClass:Ai.resolve("mask-tap-icon-selected"),toggleOnExecute:!1})])})),u=(t=n,r=200,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null===o&&(o=setTimeout(function(){t.apply(null,n),o=null},r))}});return bd.sketch({dom:bs('<div class="${prefix}-disabled-mask"></div>'),components:[bd.sketch({dom:bs('<div class="${prefix}-content-container"></div>'),components:[vs.sketch({dom:bs('<div class="${prefix}-content-tap-section"></div>'),components:[i.asSpec()],action:function(n){u.throttle()},buttonBehaviours:so([ki.config({toggleClass:Ai.resolve("mask-tap-icon-selected")})])})]})]})},Bv=ir([Hr("editor",[xr("getFrame"),Sr("getBody"),Sr("getDoc"),Sr("getWin"),Sr("getSelection"),Sr("setSelection"),Sr("clearSelection"),Sr("cursorSaver"),Sr("onKeyup"),Sr("onNodeChanged"),Sr("getCursorBox"),xr("onDomChanged"),kr("onTouchContent",z),kr("onTapContent",z),kr("onTouchToolstrip",z),kr("onScrollToCursor",p({unbind:z})),kr("onScrollToElement",p({unbind:z})),kr("onToEditing",p({unbind:z})),kr("onToReading",p({unbind:z})),kr("onToolbarScrollStart",b)]),xr("socket"),xr("toolstrip"),xr("dropup"),xr("toolbar"),xr("container"),xr("alloy"),Er("win",function(n){return Ue(n.socket).dom().defaultView}),Er("body",function(n){return pe.fromDom(n.socket.dom().ownerDocument.body)}),kr("translate",b),kr("setReadOnly",z),kr("readOnlyOnInit",p(!0))]),Rv=function(n){var e=pr("Getting AndroidWebapp schema",Bv,n);Pi(e.toolstrip,"width","100%");var t=Sh(Iv(function(){e.setReadOnly(e.readOnlyOnInit()),o.enter()},e.translate));e.alloy.add(t);var r={show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}};Ye(e.container,t.element());var o=Av(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:z,enter:o.enter,exit:o.exit,destroy:z}},Fv=p([kr("shell",!0),fc("toolbarBehaviours",[_h])]),Nv=p([jc({name:"groups",overrides:function(n){return{behaviours:so([_h.config({})])}}})]),jv=ms({name:"Toolbar",configFields:Fv(),partFields:Nv(),factory:function(e,n,t,r){var o=function(n){return e.shell?S.some(n):Xc(n,e,"groups")},i=e.shell?{behaviours:[_h.config({})],components:[]}:{behaviours:[],components:n};return{uid:e.uid,dom:e.dom,components:i.components,behaviours:hc(e.toolbarBehaviours,i.behaviours),apis:{setGroups:function(n,e){o(n).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(n){_h.set(n,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,e,t){n.setGroups(e,t)}}}),Pv=p([xr("items"),(ed=["itemSelector"],Hr("markers",Mn(ed,xr))),fc("tgroupBehaviours",[lc])]),Uv=p([Pc({name:"items",unit:"item"})]),Gv=ms({name:"ToolbarGroup",configFields:Pv(),partFields:Uv(),factory:function(n,e,t,r){return{uid:n.uid,dom:n.dom,components:e,behaviours:hc(n.tgroupBehaviours,[lc.config({mode:"flow",selector:n.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),$v="data-"+Ai.resolve("horizontal-scroll"),Wv=function(n){return"true"===bo(n,$v)?0<(t=n).dom().scrollLeft||function(n){n.dom().scrollLeft=1;var e=0!==n.dom().scrollLeft;return n.dom().scrollLeft=0,e}(t):0<(e=n).dom().scrollTop||function(n){n.dom().scrollTop=1;var e=0!==n.dom().scrollTop;return n.dom().scrollTop=0,e}(e);var e,t},_v={exclusive:function(n,e){return km(n,"touchmove",function(n){iu(n.target(),e).filter(Wv).fold(function(){n.raw().preventDefault()},z)})},markAsHorizontal:function(n){go(n,$v,"true")}};function qv(){var e=function(n){var e=!0===n.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:bs('<div aria-label="'+n.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:so([md("adhoc-scrollable-toolbar",!0===n.scrollable?[Jr(function(n,e){Pi(n.element(),"overflow-x","auto"),_v.markAsHorizontal(n.element()),cm.register(n.element())})]:[])]),components:[bd.sketch({components:[Gv.parts().items({})]})],markers:{itemSelector:"."+Ai.resolve("toolbar-group-item")},items:n.items}},t=Sh(jv.sketch({dom:bs('<div class="${prefix}-toolbar"></div>'),components:[jv.parts().groups({})],toolbarBehaviours:so([ki.config({toggleClass:Ai.resolve("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),lc.config({mode:"cyclic"})]),shell:!0})),n=Sh(bd.sketch({dom:{classes:[Ai.resolve("toolstrip")]},components:[Oh(t)],containerBehaviours:so([ki.config({toggleClass:Ai.resolve("android-selection-context-toolbar"),toggleOnExecute:!1})])})),r=function(){jv.setGroups(t,o.get()),ki.off(t)},o=Ao([]);return{wrapper:p(n),toolbar:p(t),createGroups:function(n){return Mn(n,v(Gv.sketch,e))},setGroups:function(n){o.set(n),r()},setContextToolbar:function(n){ki.on(t),jv.setGroups(t,n)},restoreToolbar:function(){ki.isOn(t)&&r()},refresh:function(){},focus:function(){lc.focusIn(t)}}}var Xv,Yv=function(n,e){_h.append(n,Oh(e))},Kv=function(n,e){_h.remove(n,e)},Jv=function(n){return Sh(vs.sketch({dom:bs('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){n.run(function(n){n.setReadOnly(!1)})}}))},Qv=function(){return Sh(bd.sketch({dom:bs('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:so([_h.config({})])}))},Zv=function(n,e,t,r){(!0===t?Do.toAlpha:Do.toOmega)(r),(t?Yv:Kv)(n,e)},ng=function(e,n){return n.getAnimationRoot.fold(function(){return e.element()},function(n){return n(e)})},eg=function(n){return n.dimension.property},tg=function(n,e){return n.dimension.getDimension(e)},rg=function(n,e){var t=ng(n,e);vh(t,[e.shrinkingClass,e.growingClass])},og=function(n,e){To(n.element(),e.openClass),So(n.element(),e.closedClass),Pi(n.element(),eg(e),"0px"),qi(n.element())},ig=function(n,e){To(n.element(),e.closedClass),So(n.element(),e.openClass),_i(n.element(),eg(e))},ug=function(n,e,t,r){t.setCollapsed(),Pi(n.element(),eg(e),tg(e,n.element())),qi(n.element()),rg(n,e),og(n,e),e.onStartShrink(n),e.onShrunk(n)},ag=function(n,e,t,r){var o=r.getOrThunk(function(){return tg(e,n.element())});t.setCollapsed(),Pi(n.element(),eg(e),o),qi(n.element());var i=ng(n,e);To(i,e.growingClass),So(i,e.shrinkingClass),og(n,e),e.onStartShrink(n)},cg=function(n,e,t){var r=tg(e,n.element());("0px"===r?ug:ag)(n,e,t,S.some(r))},sg=function(n,e,t){var r=ng(n,e),o=ko(r,e.shrinkingClass),i=tg(e,n.element());ig(n,e);var u=tg(e,n.element());(o?function(){Pi(n.element(),eg(e),i),qi(n.element())}:function(){og(n,e)})(),To(r,e.shrinkingClass),So(r,e.growingClass),ig(n,e),Pi(n.element(),eg(e),u),t.setExpanded(),e.onStartGrow(n)},lg=function(n,e,t){var r=ng(n,e);return!0===ko(r,e.growingClass)},fg=function(n,e,t){var r=ng(n,e);return!0===ko(r,e.shrinkingClass)},dg=/* */Object.freeze({grow:function(n,e,t){t.isExpanded()||sg(n,e,t)},shrink:function(n,e,t){t.isExpanded()&&cg(n,e,t)},immediateShrink:function(n,e,t){t.isExpanded()&&ug(n,e,t,S.none())},hasGrown:function(n,e,t){return t.isExpanded()},hasShrunk:function(n,e,t){return t.isCollapsed()},isGrowing:lg,isShrinking:fg,isTransitioning:function(n,e,t){return!0===lg(n,e)||!0===fg(n,e)},toggleGrow:function(n,e,t){(t.isExpanded()?cg:sg)(n,e,t)},disableTransitions:rg}),hg=/* */Object.freeze({exhibit:function(n,e){var t=e.expanded;return eo(t?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:Ot(e.dimension.property,"0px")})},events:function(t,r){return Ur([(n=W(),e=function(n,e){e.event().raw().propertyName===t.dimension.property&&(rg(n,t),r.isExpanded()&&_i(n.element(),t.dimension.property),(r.isExpanded()?t.onGrown:t.onShrunk)(n))},_r(n)(e))]);var n,e}}),mg=[xr("closedClass"),xr("openClass"),xr("shrinkingClass"),xr("growingClass"),Sr("getAnimationRoot"),ai("onShrunk"),ai("onStartShrink"),ai("onGrown"),ai("onStartGrow"),kr("expanded",!1),Mr("dimension",yr("property",{width:[fi("property","width"),fi("getDimension",function(n){return al(n)+"px"})],height:[fi("property","height"),fi("getDimension",function(n){return Qi(n)+"px"})]}))],vg=fo({fields:mg,name:"sliding",active:hg,apis:dg,state:/* */Object.freeze({init:function(n){var e=Ao(n.expanded);return co({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:f(e.set,!1),setExpanded:f(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),gg=function(e,t){var r=Sh(bd.sketch({dom:{tag:"div",classes:[Ai.resolve("dropup")]},components:[],containerBehaviours:so([_h.config({}),vg.config({closedClass:Ai.resolve("dropup-closed"),openClass:Ai.resolve("dropup-open"),shrinkingClass:Ai.resolve("dropup-shrinking"),growingClass:Ai.resolve("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){e(),t(),_h.set(n,[])},onGrown:function(n){e(),t()}}),Ei(function(n,e){o(z)})])})),o=function(n){window.requestAnimationFrame(function(){n(),vg.shrink(r)})};return{appear:function(n,e,t){!0===vg.hasShrunk(r)&&!1===vg.isTransitioning(r)&&window.requestAnimationFrame(function(){e(t),_h.set(r,[n()]),vg.grow(r)})},disappear:o,component:p(r),element:r.element}},pg=function(n){var e,t;return 8===n.raw().which&&!wn(["input","textarea"],we(n.target()))&&(e=n.target(),!iu(e,'[contenteditable="true"]',t).isSome())},bg=Xn.detect().browser.isFirefox(),yg=or([(Xv="triggerEvent",Mr(Xv,wr)),kr("stopBackspace",!0)]),zg=function(e,n){var t,r,o,i,u=pr("Getting GUI events settings",yg,n),a=Xn.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],c=Im(u),s=Mn(a.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(n){return km(e,n,function(e){c.fireIfReady(e,n).each(function(n){n&&e.kill()}),u.triggerEvent(n,e)&&e.kill()})}),l=Ao(S.none()),f=km(e,"paste",function(e){c.fireIfReady(e,"paste").each(function(n){n&&e.kill()}),u.triggerEvent("paste",e)&&e.kill(),l.set(S.some(setTimeout(function(){u.triggerEvent(Qn(),e)},0)))}),d=km(e,"keydown",function(n){u.triggerEvent("keydown",n)?n.kill():!0===u.stopBackspace&&pg(n)&&n.prevent()}),h=(t=e,r=function(n){u.triggerEvent("focusin",n)&&n.kill()},bg?Vm(t,"focus",r):km(t,"focusin",r)),m=Ao(S.none()),v=(o=e,i=function(n){u.triggerEvent("focusout",n)&&n.kill(),m.set(S.some(setTimeout(function(){u.triggerEvent(Jn(),n)},0)))},bg?Vm(o,"blur",i):km(o,"focusout",i));return{unbind:function(){Hn(s,function(n){n.unbind()}),d.unbind(),h.unbind(),v.unbind(),f.unbind(),l.get().each(clearTimeout),m.get().each(clearTimeout)}}},wg=function(n,e){var t=St(n,"target").map(function(n){return n()}).getOr(e);return Ao(t)},xg=st([{stopped:[]},{resume:["element"]},{complete:[]}]),Mg=function(n,r,e,t,o,i){var u,a,c,s,l=n(r,t),f=(u=e,a=o,c=Ao(!1),s=Ao(!1),{stop:function(){c.set(!0)},cut:function(){s.set(!0)},isStopped:c.get,isCut:s.get,event:p(u),setSource:a.set,getSource:a.get});return l.fold(function(){return i.logEventNoHandlers(r,t),xg.complete()},function(e){var t=e.descHandler();return ah(t)(f),f.isStopped()?(i.logEventStopped(r,e.element(),t.purpose()),xg.stopped()):f.isCut()?(i.logEventCut(r,e.element(),t.purpose()),xg.complete()):Ge(e.element()).fold(function(){return i.logNoParent(r,e.element(),t.purpose()),xg.complete()},function(n){return i.logEventResponse(r,e.element(),t.purpose()),xg.resume(n)})})},Hg=function(e,t,r,n,o,i){return Mg(e,t,r,n,o,i).fold(function(){return!0},function(n){return Hg(e,t,r,n,o,i)},function(){return!1})},Sg=function(n,e,t){var r,o,i=(r=e,o=Ao(!1),{stop:function(){o.set(!0)},cut:z,isStopped:o.get,isCut:p(!1),event:p(r),setSource:s("Cannot set source of a broadcasted event"),getSource:s("Cannot get source of a broadcasted event")});return Hn(n,function(n){var e=n.descHandler();ah(e)(i)}),i.isStopped()},Og=function(n,e,t,r,o){var i=wg(t,r);return Hg(n,e,t,r,i,o)},Tg=ke("element","descHandler"),kg=function(n,e){return{id:p(n),descHandler:p(e)}};function Vg(){var i={};return{registerId:function(r,o,n){k(n,function(n,e){var t=i[e]!==undefined?i[e]:{};t[o]=uh(n,r),i[e]=t})},unregisterId:function(t){k(i,function(n,e){n.hasOwnProperty(t)&&delete n[t]})},filterByType:function(n){return St(i,n).map(function(n){return C(n,function(n,e){return kg(e,n)})}).getOr([])},find:function(n,e,t){var o=Mt(e)(i);return Pr(t,function(n){return t=o,us(r=n).fold(function(){return S.none()},function(n){var e=Mt(n);return t.bind(e).map(function(n){return Tg(r,n)})});var t,r},n)}}}function Eg(){var r=Vg(),o={},i=function(r){var n=r.element();return us(n).fold(function(){return n="uid-",e=r.element(),t=Sc(rs+n),is(e,t),t;var n,e,t},function(n){return n})},u=function(n){us(n.element()).each(function(n){o[n]=undefined,r.unregisterId(n)})};return{find:function(n,e,t){return r.find(n,e,t)},filter:function(n){return r.filterByType(n)},register:function(n){var e=i(n);Vt(o,e)&&function(n,e){var t=o[e];if(t!==n)throw new Error('The tagId "'+e+'" is already used by: '+_o(t.element())+"\nCannot use it for: "+_o(n.element())+"\nThe conflicting element is"+(Se(t.element())?" ":" not ")+"already in the DOM");u(n)}(n,e);var t=[n];r.registerId(t,e,n.events()),o[e]=n},unregister:u,getById:function(n){return Mt(n)(o)}}}var Cg=function(t){var r=function(e){return Ge(t.element()).fold(function(){return!0},function(n){return Pe(e,n)})},o=Eg(),s=function(n,e){return o.find(r,n,e)},n=zg(t.element(),{triggerEvent:function(u,a){return ni(u,a.target(),function(n){return e=s,t=u,o=n,i=(r=a).target(),Og(e,t,r,i,o);var e,t,r,o,i})}}),i={debugInfo:p("real"),triggerEvent:function(e,t,r){ni(e,t,function(n){Og(s,e,r,t,n)})},triggerFocus:function(a,c){us(a).fold(function(){Lo(a)},function(n){ni(Kn(),a,function(n){var e,t,r,o,i,u;e=s,t=Kn(),r={originator:p(c),kill:z,prevent:z,target:p(a)},i=n,u=wg(r,o=a),Mg(e,t,r,o,u,i)})})},triggerEscape:function(n,e){i.triggerEvent("keydown",n.element(),e.event())},getByUid:function(n){return m(n)},getByDom:function(n){return v(n)},build:Sh,addToGui:function(n){a(n)},removeFromGui:function(n){c(n)},addToWorld:function(n){e(n)},removeFromWorld:function(n){u(n)},broadcast:function(n){f(n)},broadcastOn:function(n,e){d(n,e)},broadcastEvent:function(n,e){h(n,e)},isConnected:p(!0)},e=function(n){n.connect(i),He(n.element())||(o.register(n),Hn(n.components(),e),i.triggerEvent(ie(),n.element(),{target:p(n.element())}))},u=function(n){He(n.element())||(Hn(n.components(),u),o.unregister(n)),n.disconnect()},a=function(n){et(t,n)},c=function(n){ot(n)},l=function(t){var n=o.filter(Zn());Hn(n,function(n){var e=n.descHandler();ah(e)(t)})},f=function(n){l({universal:p(!0),data:p(n)})},d=function(n,e){l({universal:p(!1),channels:p(n),data:p(e)})},h=function(n,e){var t=o.filter(n);return Sg(t,e)},m=function(n){return o.getById(n).fold(function(){return ct.error(new Error('Could not find component with uid: "'+n+'" in system.'))},ct.value)},v=function(n){var e=us(n).getOr("not found");return m(e)};return e(t),{root:p(t),element:t.element,destroy:function(){n.unbind(),Qe(t.element())},add:a,remove:c,getByUid:m,getByDom:v,addToWorld:e,removeFromWorld:u,broadcast:f,broadcastOn:d,broadcastEvent:h}},Dg=p(Ai.resolve("readonly-mode")),Ag=p(Ai.resolve("edit-mode"));function Lg(n){var e=Sh(bd.sketch({dom:{classes:[Ai.resolve("outer-container")].concat(n.classes)},containerBehaviours:so([Do.config({alpha:Dg(),omega:Ag()})])}));return Cg(e)}var Ig=function(n,e){var t=pe.fromTag("input");Ui(t,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),Ye(n,t),Lo(t),e(t),Qe(t)},Bg=function(n){var e=n.getSelection();if(0<e.rangeCount){var t=e.getRangeAt(0),r=n.document.createRange();r.setStart(t.startContainer,t.startOffset),r.setEnd(t.endContainer,t.endOffset),e.removeAllRanges(),e.addRange(r)}},Rg=function(n,e){Bo().each(function(n){Pe(n,e)||Io(n)}),n.focus(),Lo(pe.fromDom(n.document.body)),Bg(n)},Fg={stubborn:function(n,e,t,r){var o=function(){Rg(e,r)},i=km(t,"keydown",function(n){wn(["input","textarea"],we(n.target()))||o()});return{toReading:function(){Ig(n,Io)},toEditing:o,onToolbarTouch:function(){},destroy:function(){i.unbind()}}},timid:function(n,e,t,r){var o=function(){Io(r)};return{toReading:function(){o()},toEditing:function(){Rg(e,r)},onToolbarTouch:function(){o()},destroy:z}}},Ng=function(t,r,o,i,n){var u=function(){r.run(function(n){n.refreshSelection()})},e=function(n,e){var t=n-i.dom().scrollTop;r.run(function(n){n.scrollIntoView(t,t+e)})},a=function(){r.run(function(n){n.clearSelection()})},c=function(){t.getCursorBox().each(function(n){e(n.top(),n.height())}),r.run(function(n){n.syncHeight()})},s=Bm(t),l=Lv(c,300),f=[t.onKeyup(function(){a(),l.throttle()}),t.onNodeChanged(u),t.onDomChanged(l.throttle),t.onDomChanged(u),t.onScrollToCursor(function(n){n.preventDefault(),l.throttle()}),t.onScrollToElement(function(n){n.element(),e(r,i)}),t.onToEditing(function(){r.run(function(n){n.toEditing()})}),t.onToReading(function(){r.run(function(n){n.toReading()})}),km(t.doc(),"touchend",function(n){Pe(t.html(),n.target())||Pe(t.body(),n.target())}),km(o,"transitionend",function(n){var e;"height"===n.raw().propertyName&&(e=Qi(o),r.run(function(n){n.setViewportOffset(e)}),u(),c())}),Vm(o,"touchstart",function(n){var e;r.run(function(n){n.highlightSelection()}),e=n,r.run(function(n){n.onToolbarTouch(e)}),t.onTouchToolstrip()}),km(t.body(),"touchstart",function(n){a(),t.onTouchContent(),s.fireTouchstart(n)}),s.onTouchmove(),s.onTouchend(),km(t.body(),"click",function(n){n.kill()}),km(o,"touchmove",function(){t.onToolbarScrollStart()})];return{destroy:function(){Hn(f,function(n){n.unbind()})}}},jg=function(n){var t=S.none(),e=[],r=function(n){o()?u(n):e.push(n)},o=function(){return t.isSome()},i=function(n){Hn(n,u)},u=function(e){t.each(function(n){setTimeout(function(){e(n)},0)})};return n(function(n){t=S.some(n),i(e),e=[]}),{get:r,map:function(t){return jg(function(e){r(function(n){e(t(n))})})},isReady:o}},Pg={nu:jg,pure:function(e){return jg(function(n){n(e)})}},Ug=function(e){var n=function(n){var r;e((r=n,function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=this;setTimeout(function(){r.apply(t,n)},0)}))},t=function(){return Pg.nu(n)};return{map:function(r){return Ug(function(t){n(function(n){var e=r(n);t(e)})})},bind:function(t){return Ug(function(e){n(function(n){t(n).get(e)})})},anonBind:function(t){return Ug(function(e){n(function(n){t.get(e)})})},toLazy:t,toCached:function(){var e=null;return Ug(function(n){null===e&&(e=t()),e.get(n)})},get:n}},Gg={nu:Ug,pure:function(e){return Ug(function(n){n(e)})}},$g=function(n,e,t){return Math.abs(n-e)<=t?S.none():n<e?S.some(n+t):S.some(n-t)},Wg=function(){var s=null;return{animate:function(r,o,n,i,e,t){var u=!1,a=function(n){u=!0,e(n)};clearInterval(s);var c=function(n){clearInterval(s),a(n)};s=setInterval(function(){var t=r();$g(t,o,n).fold(function(){clearInterval(s),a(o)},function(n){if(i(n,c),!u){var e=r();(e!==n||Math.abs(e-o)>Math.abs(t-o))&&(clearInterval(s),a(o))}})},t)}}},_g=function(e,t){return Yo([{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(n){return e<=n.width&&t<=n.height?S.some(n.keyboard):S.none()}).getOr({portrait:t/5,landscape:e/4})},qg=function(n){var e,t=Cm(n).isPortrait(),r=_g((e=n).screen.width,e.screen.height),o=t?r.portrait:r.landscape;return(t?n.screen.height:n.screen.width)-n.innerHeight>o?0:o},Xg=function(n,e){var t=Ue(n).dom().defaultView;return Qi(n)+Qi(e)-qg(t)},Yg=Xg,Kg=function(n,e,t){var r=Xg(e,t),o=Qi(e)+Qi(t)-r;Pi(n,"padding-bottom",o+"px")},Jg=st([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Qg="data-"+Ai.resolve("position-y-fixed"),Zg="data-"+Ai.resolve("y-property"),np="data-"+Ai.resolve("scrolling"),ep="data-"+Ai.resolve("last-window-height"),tp=function(n){return Nm(n,Qg)},rp=function(n,e){var t=bo(n,Zg);return Jg.fixed(n,t,e)},op=function(n,e){return Jg.scroller(n,e)},ip=function(n){var e=tp(n);return("true"===bo(n,np)?op:rp)(n,e)},up=function(n,e,t){var r=Ue(n).dom().defaultView.innerHeight;return go(n,ep,r+"px"),r-e-t},ap=function(n){var e=eu(n,"["+Qg+"]");return Mn(e,ip)},cp=function(r,o,i,u){var n,e,t,a,c,s,l,f,d=Ue(r).dom().defaultView,h=(f=bo(l=i,"style"),Ui(l,{position:"absolute",top:"0px"}),go(l,Qg,"0px"),go(l,Zg,"top"),{restore:function(){go(l,"style",f||""),zo(l,Qg),zo(l,Zg)}}),m=Qi(i),v=Qi(u),g=up(r,m,v),p=(t=m,a=g,s=bo(c=r,"style"),cm.register(c),Ui(c,{position:"absolute",height:a+"px",width:"100%",top:t+"px"}),go(c,Qg,t+"px"),go(c,np,"true"),go(c,Zg,"top"),{restore:function(){cm.deregister(c),go(c,"style",s||""),zo(c,Qg),zo(c,np),zo(c,Zg)}}),b=(e=bo(n=u,"style"),Ui(n,{position:"absolute",bottom:"0px"}),go(n,Qg,"0px"),go(n,Zg,"bottom"),{restore:function(){go(n,"style",e||""),zo(n,Qg),zo(n,Zg)}}),y=!0,z=function(){var n=d.innerHeight;return Nm(r,ep)<n},w=function(){if(y){var n=Qi(i),e=Qi(u),t=up(r,n,e);go(r,Qg,n+"px"),Pi(r,"height",t+"px"),Pi(u,"bottom",-(n+t+e)+"px"),Kg(o,r,u)}};return Kg(o,r,u),{setViewportOffset:function(n){go(r,Qg,n+"px"),w()},isExpanding:z,isShrinking:x(z),refresh:w,restore:function(){y=!1,h.restore(),p.restore(),b.restore()}}},sp=tp,lp=Wg(),fp="data-"+Ai.resolve("last-scroll-top"),dp=function(n){var e=Wi(n,"top").getOr("0");return parseInt(e,10)},hp=function(n){return parseInt(n.dom().scrollTop,10)},mp=function(n,e){var t=e+sp(n)+"px";Pi(n,"top",t)},vp=function(t,r,o){return Gg.nu(function(n){var e=f(hp,t);lp.animate(e,r,15,function(n){t.dom().scrollTop=n,Pi(t,"top",dp(t)+15+"px")},function(){t.dom().scrollTop=r,Pi(t,"top",o+"px"),n(r)},10)})},gp=function(o,i){return Gg.nu(function(n){var e=f(hp,o);go(o,fp,e());var t=Math.abs(i-e()),r=Math.ceil(t/10);lp.animate(e,i,r,function(n,e){Nm(o,fp)!==o.dom().scrollTop?e(o.dom().scrollTop):(o.dom().scrollTop=n,go(o,fp,n))},function(){o.dom().scrollTop=i,go(o,fp,i),n(i)},10)})},pp=function(i,u){return Gg.nu(function(n){var e=f(dp,i),t=function(n){Pi(i,"top",n+"px")},r=Math.abs(u-e()),o=Math.ceil(r/10);lp.animate(e,u,o,t,function(){t(u),n(u)},10)})},bp=function(e,t,r){var o=Ue(e).dom().defaultView;return Gg.nu(function(n){mp(e,r),mp(t,r),o.scrollTo(0,r),n(r)})},yp=function(n,e,t,r,o){var i=Yg(e,t),u=f(Bg,n);i<r||i<o?gp(e,e.dom().scrollTop-i+o).get(u):r<0&&gp(e,e.dom().scrollTop+r).get(u)},zp=function(u,n){return n(function(r){var o=[],i=0;0===u.length?r([]):Hn(u,function(n,e){var t;n.get((t=e,function(n){o[t]=n,++i>=u.length&&r(o)}))})})},wp=function(n,c){return n.fold(function(n,e,t){return Pi(n,e,c+(r=t)+"px"),Gg.pure(r);var r},function(n,e){return o=c+(r=e),i=Wi(t=n,"top").getOr(r),u=o-parseInt(i,10),a=t.dom().scrollTop+u,vp(t,a,o);var t,r,o,i,u,a})},xp=function(n,e){var t=ap(n),r=Mn(t,function(n){return wp(n,e)});return zp(r,Gg.nu)},Mp=function(e,t,n,r,o,i){var u=function s(t){var r=Ao(Pg.pure({}));return{start:function(e){var n=Pg.nu(function(n){return t(e).get(n)});r.set(n)},idle:function(n){r.get().get(function(){n()})}}}(function(n){return bp(e,t,n)}),a=Lv(function(){u.idle(function(){xp(n,r.pageYOffset).get(function(){var n;(n=lv(i),S.from(n[0]).bind(function(n){var e=n.top()-t.dom().scrollTop;return e>r.innerHeight+5||e<-5?S.some({top:p(e),bottom:p(e+n.height())}):S.none()})).each(function(n){t.dom().scrollTop=t.dom().scrollTop+n.top()}),u.start(0),o.refresh()})})},1e3),c=km(pe.fromDom(r),"scroll",function(){r.pageYOffset<0||a.throttle()});return xp(n,r.pageYOffset).get(b),{unbind:c.unbind}},Hp=function(n){var t=n.cWin(),e=n.ceBody(),r=n.socket(),o=n.toolstrip(),i=n.toolbar(),u=n.contentElement(),a=n.keyboardType(),c=n.outerWindow(),s=n.dropup(),l=cp(r,e,o,s),f=a(n.outerBody(),t,Oe(),u,o,i),d=Dm(c,{onChange:z,onReady:l.refresh});d.onAdjustment(function(){l.refresh()});var h=km(pe.fromDom(c),"resize",function(){l.isExpanding()&&l.refresh()}),m=Mp(o,r,n.outerBody(),c,l,t),v=function p(t,e){var n=t.document,r=pe.fromTag("div");So(r,Ai.resolve("unfocused-selections")),Ye(pe.fromDom(n.documentElement),r);var o=km(r,"touchstart",function(n){n.prevent(),Rg(t,e),u()}),i=function(n){var e=pe.fromTag("span");return mh(e,[Ai.resolve("layer-editor"),Ai.resolve("unfocused-selection")]),Ui(e,{left:n.left()+"px",top:n.top()+"px",width:n.width()+"px",height:n.height()+"px"}),e},u=function(){Je(r)};return{update:function(){u();var n=lv(t),e=Mn(n,i);Ke(r,e)},isActive:function(){return 0<$e(r).length},destroy:function(){o.unbind(),Qe(r)},clear:u}}(t,u),g=function(){v.clear()};return{toEditing:function(){f.toEditing(),g()},toReading:function(){f.toReading()},onToolbarTouch:function(n){f.onToolbarTouch(n)},refreshSelection:function(){v.isActive()&&v.update()},clearSelection:g,highlightSelection:function(){v.update()},scrollIntoView:function(n,e){yp(t,r,s,n,e)},updateToolbarPadding:z,setViewportOffset:function(n){l.setViewportOffset(n),pp(r,n).get(b)},syncHeight:function(){Pi(u,"height",u.dom().contentWindow.document.body.scrollHeight+"px")},refreshStructure:l.refresh,destroy:function(){l.restore(),d.destroy(),m.unbind(),h.unbind(),f.destroy(),v.destroy(),Ig(Oe(),Io)}}},Sp=function(r,n){var o=Dv(),i=qd(),u=qd(),a=_d(),c=_d();return{enter:function(){n.hide();var t=pe.fromDom(document);Sv.getActiveApi(r.editor).each(function(n){i.set({socketHeight:Wi(r.socket,"height"),iframeHeight:Wi(n.frame(),"height"),outerScroll:document.body.scrollTop}),u.set({exclusives:_v.exclusive(t,"."+cm.scrollable())}),So(r.container,Ai.resolve("fullscreen-maximized")),Ev(r.container,n.body()),o.maximize(),Pi(r.socket,"overflow","scroll"),Pi(r.socket,"-webkit-overflow-scrolling","touch"),Lo(n.body());var e=Ce(["cWin","ceBody","socket","toolstrip","toolbar","dropup","contentElement","cursor","keyboardType","isScrolling","outerWindow","outerBody"],[]);a.set(Hp(e({cWin:n.win(),ceBody:n.body(),socket:r.socket,toolstrip:r.toolstrip,toolbar:r.toolbar,dropup:r.dropup.element(),contentElement:n.frame(),cursor:z,outerBody:r.body,outerWindow:r.win,keyboardType:Fg.stubborn,isScrolling:function(){return u.get().exists(function(n){return n.socket.isScrolling()})}}))),a.run(function(n){n.syncHeight()}),c.set(Ng(n,a,r.toolstrip,r.socket,r.dropup))})},refreshStructure:function(){a.run(function(n){n.refreshStructure()})},exit:function(){o.restore(),c.clear(),a.clear(),n.show(),i.on(function(n){n.socketHeight.each(function(n){Pi(r.socket,"height",n)}),n.iframeHeight.each(function(n){Pi(r.editor.getFrame(),"height",n)}),document.body.scrollTop=n.scrollTop}),i.clear(),u.on(function(n){n.exclusives.unbind()}),u.clear(),To(r.container,Ai.resolve("fullscreen-maximized")),Cv(),cm.deregister(r.toolbar),_i(r.socket,"overflow"),_i(r.socket,"-webkit-overflow-scrolling"),Io(r.editor.getFrame()),Sv.getActiveApi(r.editor).each(function(n){n.clearSelection()})}}},Op=function(n){var e=pr("Getting IosWebapp schema",Bv,n);Pi(e.toolstrip,"width","100%"),Pi(e.container,"position","relative");var t=Sh(Iv(function(){e.setReadOnly(e.readOnlyOnInit()),r.enter()},e.translate));e.alloy.add(t);var r=Sp(e,{show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}});return{setReadOnly:e.setReadOnly,refreshStructure:r.refreshStructure,enter:r.enter,exit:r.exit,destroy:z}},Tp=tinymce.util.Tools.resolve("tinymce.EditorManager"),kp=function(n){var e=St(n.settings,"skin_url").fold(function(){return Tp.baseURL+"/skins/ui/oxide"},function(n){return n});return{content:e+"/content.mobile.min.css",ui:e+"/skin.mobile.min.css"}},Vp=function(n,e,t){n.system().broadcastOn([Po.formatChanged()],{command:e,state:t})},Ep=function(r,n){var e=O(n.formatter.get());Hn(e,function(e){n.formatter.formatChanged(e,function(n){Vp(r,e,n)})}),Hn(["ul","ol"],function(t){n.selection.selectorChanged(t,function(n,e){Vp(r,t,n)})})},Cp=(p(["x-small","small","medium","large","x-large"]),function(n){var e=function(){n._skinLoaded=!0,n.fire("SkinLoaded")};return function(){n.initialized?e():n.on("init",e)}}),Dp=p("toReading"),Ap=p("toEditing"),Lp=function(v){return{getNotificationManagerImpl:function(){return{open:p({progressBar:{value:z},close:z}),close:z,reposition:z,getArgs:b}},renderUI:function(){var n=v.getElement(),e=kp(v);0==(!1===v.settings.skin)?(v.contentCSS.push(e.content),Fo.DOM.styleSheetLoader.load(e.ui,Cp(v))):Cp(v)();var t,r,o=function(){v.fire("scrollIntoView")},i=pe.fromTag("div"),s=Xn.detect().os.isAndroid()?function h(n){var e=Lg({classes:[Ai.resolve("android-container")]}),t=qv(),r=_d(),o=Jv(r),i=Qv(),u=gg(z,n);return e.add(t.wrapper()),e.add(i),e.add(u.component()),{system:p(e),element:e.element,init:function(n){r.set(Rv(n))},exit:function(){r.run(function(n){n.exit(),_h.remove(i,o)})},setToolbarGroups:function(n){var e=t.createGroups(n);t.setGroups(e)},setContextToolbar:function(n){var e=t.createGroups(n);t.setContextToolbar(e)},focusToolbar:function(){t.focus()},restoreToolbar:function(){t.restoreToolbar()},updateMode:function(n){Zv(i,o,n,e.root())},socket:p(i),dropup:p(u)}}(o):function m(n){var e=Lg({classes:[Ai.resolve("ios-container")]}),t=qv(),r=_d(),o=Jv(r),i=Qv(),u=gg(function(){r.run(function(n){n.refreshStructure()})},n);return e.add(t.wrapper()),e.add(i),e.add(u.component()),{system:p(e),element:e.element,init:function(n){r.set(Op(n))},exit:function(){r.run(function(n){_h.remove(i,o),n.exit()})},setToolbarGroups:function(n){var e=t.createGroups(n);t.setGroups(e)},setContextToolbar:function(n){var e=t.createGroups(n);t.setContextToolbar(e)},focusToolbar:function(){t.focus()},restoreToolbar:function(){t.restoreToolbar()},updateMode:function(n){Zv(i,o,n,e.root())},socket:p(i),dropup:p(u)}}(o),u=pe.fromDom(n);qe(u,i),t=i,r=s.system(),it(t,r,Ye);var a=n.ownerDocument.defaultView,l=Dm(a,{onChange:function(){s.system().broadcastOn([Po.orientationChanged()],{width:Am(a)})},onReady:z}),f=function(n,e,t,r){!1===r&&v.selection.collapse();var o=c(n,e,t);s.setToolbarGroups(!0===r?o.readOnly:o.main),v.setMode(!0===r?"readonly":"design"),v.fire(!0===r?Dp():Ap()),s.updateMode(r)},c=function(n,e,t){var r=n.get();return{readOnly:r.backToMask.concat(e.get()),main:r.backToMask.concat(t.get())}},d=function(n,e){return v.on(n,e),{unbind:function(){v.off(n)}}};return v.on("init",function(){s.init({editor:{getFrame:function(){return pe.fromDom(v.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:z}},onToReading:function(n){return d(Dp(),n)},onToEditing:function(n){return d(Ap(),n)},onScrollToCursor:function(e){return v.on("scrollIntoView",function(n){e(n)}),{unbind:function(){v.off("scrollIntoView"),l.destroy()}}},onTouchToolstrip:function(){t()},onTouchContent:function(){var n,e=pe.fromDom(v.editorContainer.querySelector("."+Ai.resolve("toolbar")));(n=e,Ro(n).bind(function(n){return s.system().getByDom(n).toOption()})).each(he),s.restoreToolbar(),t()},onTapContent:function(n){var e=n.target();"img"===we(e)?(v.selection.select(e.dom()),n.kill()):"a"===we(e)&&s.system().getByDom(pe.fromDom(v.editorContainer)).each(function(n){Do.isAlpha(n)&&jo(e.dom())})}},container:pe.fromDom(v.editorContainer),socket:pe.fromDom(v.contentAreaContainer),toolstrip:pe.fromDom(v.editorContainer.querySelector("."+Ai.resolve("toolstrip"))),toolbar:pe.fromDom(v.editorContainer.querySelector("."+Ai.resolve("toolbar"))),dropup:s.dropup(),alloy:s.system(),translate:z,setReadOnly:function(n){f(c,a,u,n)},readOnlyOnInit:function(){return!1}});var t=function(){s.dropup().disappear(function(){s.system().broadcastOn([Po.dropupDismissed()],{})})},n={label:"The first group",scrollable:!1,items:[Hs.forToolbar("back",function(){v.selection.collapse(),s.exit()},{},v)]},e={label:"Back to read only",scrollable:!1,items:[Hs.forToolbar("readonly-back",function(){f(c,a,u,!0)},{},v)]},r=xm(s,v),o=Mm(v.settings,r),i={label:"The extra group",scrollable:!1,items:[]},u=Ao([{label:"the action group",scrollable:!0,items:o},i]),a=Ao([{label:"The read only mode group",scrollable:!0,items:[]},i]),c=Ao({backToMask:[n],backToReadOnly:[e]});Ep(s,v)}),{iframeContainer:s.socket().element().dom(),editorContainer:s.element().dom()}}}};No.add("mobile",Lp),n.renderMobileTheme=Lp,n["default"]=function qp(){}}({});