tinymce-rails 5.1.4.1 → 5.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/source/tinymce/tinymce.js +4 -4
  3. data/lib/tinymce/rails/version.rb +2 -2
  4. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -1
  5. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -1
  6. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -1
  7. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +1 -1
  8. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
  9. data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +1 -1
  10. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +2 -2
  11. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
  12. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +1 -1
  13. data/vendor/assets/javascripts/tinymce/plugins/colorpicker/plugin.js +1 -1
  14. data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +1 -1
  15. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -1
  16. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +1 -1
  17. data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +1 -1
  18. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +1 -1
  19. data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +1 -1
  20. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +1 -1
  21. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -1
  22. data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +1 -1
  23. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
  24. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -1
  25. data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +1 -1
  26. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +1 -1
  27. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +1 -1
  28. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +1 -1
  29. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -1
  30. data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +1 -1
  31. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
  32. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +2 -2
  33. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
  34. data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +1 -1
  35. data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +1 -1
  36. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -1
  37. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +1 -1
  38. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +1 -1
  39. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +1 -1
  40. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +1 -1
  41. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +1 -1
  42. data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +1 -1
  43. data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +1 -1
  44. data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +1 -1
  45. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -1
  46. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
  47. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -1
  48. data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +2 -2
  49. data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -2
  50. data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
  51. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 81e10d65a812a1ffe49d6a57fb3f33750af536de27b2e024e2f79d8a3a2d6d26
4
- data.tar.gz: 414b4fb9c10e3d439dda80aec2d4c5225cad7555423522ac7c7a409abc2c66d4
3
+ metadata.gz: 203779fa7ed0935f03b670b710ad5fb44c95c2f66a23c82fad393841ee68e53f
4
+ data.tar.gz: ef77eae72fc9c2e5d1a094c1354fdaaf62c0cf077d9985839f0eb2009c7a5d77
5
5
  SHA512:
6
- metadata.gz: 0012e4c528ee5df331e0e43c77d813e86e82676ce995dc89c7bb593fb695c966d827574a139c800a98f6b356cf1a1db386fbb74a02e9eaa32847815e4de534a3
7
- data.tar.gz: abd3e72d7dec991483951eaecfb952a993093c6aaa9b3eaa103f681bb8c6af8644a3132a5a297b68a5a515c1d8f0ac11c4a2edaf4c60a9b704df84bb06b2686e
6
+ metadata.gz: be254e259a159526a5381e11fa4880e890df0ed2a6e374c82f410440373179be5780a6db5edacec944b5c8186d48850ac3ffc962c538c280d5f485e7bc8d2a62
7
+ data.tar.gz: 3941072580e700cee867ac176fa1f22eda9e87093d0725d7dd769b025117bb2e23a5f88d12b7427b83f7d8efc741c22e58a1367c12bd39a1452973eb960a33de
@@ -4,7 +4,7 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  (function (domGlobals) {
10
10
  'use strict';
@@ -14600,7 +14600,7 @@
14600
14600
  if (blockCaretContainer.hasAttribute('data-mce-caret')) {
14601
14601
  showCaretContainerBlock(blockCaretContainer);
14602
14602
  setRange(getRange());
14603
- editor.selection.scrollIntoView(blockCaretContainer[0]);
14603
+ editor.selection.scrollIntoView(blockCaretContainer);
14604
14604
  }
14605
14605
  };
14606
14606
  var registerEvents = function () {
@@ -27171,8 +27171,8 @@
27171
27171
  suffix: null,
27172
27172
  $: DomQuery,
27173
27173
  majorVersion: '5',
27174
- minorVersion: '1.4',
27175
- releaseDate: '2019-12-11',
27174
+ minorVersion: '1.5',
27175
+ releaseDate: '2019-12-19',
27176
27176
  editors: legacyEditors,
27177
27177
  i18n: I18n,
27178
27178
  activeEditor: null,
@@ -1,6 +1,6 @@
1
1
  module TinyMCE
2
2
  module Rails
3
- VERSION = "5.1.4.1"
4
- TINYMCE_VERSION = "5.1.4"
3
+ VERSION = "5.1.5"
4
+ TINYMCE_VERSION = "5.1.5"
5
5
  end
6
6
  end
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function n(){}function o(n){return function(){return n}}function t(){return d}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(n,t,e){var r="UL"===t?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===e?null:{"list-style-type":e})},i=function(e){e.addCommand("ApplyUnorderedListStyle",function(n,t){l(e,"UL",t["list-style-type"])}),e.addCommand("ApplyOrderedListStyle",function(n,t){l(e,"OL",t["list-style-type"])})},c=function(n){var t=n.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return t?t.split(/[ ,]/):[]},s=function(n){var t=n.getParam("advlist_bullet_styles","default,circle,square");return t?t.split(/[ ,]/):[]},f=o(!1),a=o(!0),d=(e={fold:function(n,t){return n()},is:f,isSome:f,isNone:a,getOr:m,getOrThunk:p,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:m,orThunk:p,map:t,each:n,bind:t,exists:f,forall:a,filter:t,equals:g,equals_:g,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(e),e);function g(n){return n.isNone()}function p(n){return n()}function m(n){return n}function y(n,t,e){var r=function(n,t){for(var e=0;e<n.length;e++){if(t(n[e]))return e}return-1}(t.parents,L),i=-1!==r?t.parents.slice(0,r):t.parents,o=u.grep(i,N(n));return 0<o.length&&o[0].nodeName===e}function O(n,t,e,r,i,o){0<o.length?function(e,n,t,r,i,o){e.ui.registry.addSplitButton(n,{tooltip:t,icon:"OL"===i?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(n){n(u.map(o,function(n){return{type:"choiceitem",value:"default"===n?"":n,icon:"list-"+("OL"===i?"num":"bull")+"-"+("disc"===n||"decimal"===n?"default":n),text:function(n){return n.replace(/\-/g," ").replace(/\b\w/g,function(n){return n.toUpperCase()})}(n)}}))},onAction:function(){return e.execCommand(r)},onItemAction:function(n,t){l(e,i,t)},select:function(t){return S(e).map(function(n){return t===n}).getOr(!1)},onSetup:function(t){function n(n){t.setActive(y(e,n,i))}return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}})}(n,t,e,r,i,o):function(e,n,t,r,i){e.ui.registry.addToggleButton(n,{active:!1,tooltip:t,icon:"OL"===i?"ordered-list":"unordered-list",onSetup:function(t){function n(n){t.setActive(y(e,n,i))}return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}},onAction:function(){return e.execCommand(r)}})}(n,t,e,r,i)}var v=function(e){function n(){return i}function t(n){return n(e)}var r=o(e),i={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:a,isNone:f,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return v(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?i:d},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(f,function(n){return t(e,n)})}};return i},h=function(n){return null===n||n===undefined?d:v(n)},L=function(n){return n&&/^(TH|TD)$/.test(n.nodeName)},N=function(t){return function(n){return n&&/^(OL|UL|DL)$/.test(n.nodeName)&&function(n,t){return n.$.contains(n.getBody(),t)}(t,n)}},S=function(n){var t=n.dom.getParent(n.selection.getNode(),"ol,ul"),e=n.dom.getStyle(t,"listStyleType");return h(e)},T=function(n){O(n,"numlist","Numbered list","InsertOrderedList","OL",c(n)),O(n,"bullist","Bullet list","InsertUnorderedList","UL",s(n))};!function b(){r.add("advlist",function(n){var t,e,r;e="lists",r=(t=n).settings.plugins?t.settings.plugins:"",-1!==u.inArray(r.split(/[ ,]/),e)&&(T(n),i(n))})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function e(o){return function(t){for(var e=0;e<t.length;e++)(n=t[e]).attr("href")||!n.attr("id")&&!n.attr("name")||n.firstChild||t[e].attr("contenteditable",o);var n}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)},o=function(t){var e=t.selection.getNode();return"A"===e.tagName&&""===t.dom.getAttrib(e,"href")?e.getAttribute("id")||e.getAttribute("name"):""},r=function(t,e){var n=t.selection.getNode();"A"===n.tagName&&""===t.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=e,t.undoManager.add()):(t.focus(),t.selection.collapse(!0),t.execCommand("mceInsertContent",!1,t.dom.createHTML("a",{id:e})))},a=function(e){var t=o(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:function(t){!function(t,e){return n(e)?(r(t,e),!1):(t.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!0)}(e,t.getData().id)&&t.close()}})},i=function(t){t.addCommand("mceAnchor",function(){a(t)})},c=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("a",e("false")),t.serializer.addNodeFilter("a",e(null))})},d=function(e){e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return e.execCommand("mceAnchor")},onSetup:function(t){return e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return e.execCommand("mceAnchor")}})};!function u(){t.add("anchor",function(t){c(t),i(t),d(t)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function i(t,e){if(e<0&&(e=0),3===t.nodeType){var n=t.data.length;n<e&&(e=n)}return e}function C(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setStart(e,i(e,n)):t.setStartBefore(e)}function m(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setEnd(e,i(e,n)):t.setEndAfter(e)}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),y=function(t){return t.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i)},k=function(t){return t.getParam("default_link_target",!1)},r=function(t,e,n){var i,o,r,f,a,s,d,c,l,u,g=y(t),h=k(t);if("A"!==t.selection.getNode().tagName){if((i=t.selection.getRng(!0).cloneRange()).startOffset<5){if(!(c=i.endContainer.previousSibling)){if(!i.endContainer.firstChild||!i.endContainer.firstChild.nextSibling)return;c=i.endContainer.firstChild.nextSibling}if(l=c.length,C(i,c,l),m(i,c,l),i.endOffset<5)return;o=i.endOffset,f=c}else{if(3!==(f=i.endContainer).nodeType&&f.firstChild){for(;3!==f.nodeType&&f.firstChild;)f=f.firstChild;3===f.nodeType&&(C(i,f,0),m(i,f,f.nodeValue.length))}o=1===i.endOffset?2:i.endOffset-1-e}for(r=o;C(i,f,2<=o?o-2:0),m(i,f,1<=o?o-1:0),o-=1," "!==(u=i.toString())&&""!==u&&160!==u.charCodeAt(0)&&0<=o-2&&u!==n;);!function(t,e){return t===e||" "===t||160===t.charCodeAt(0)}(i.toString(),n)?(0===i.startOffset?C(i,f,0):C(i,f,o),m(i,f,r)):(C(i,f,o),m(i,f,r),o+=1),"."===(s=i.toString()).charAt(s.length-1)&&m(i,f,r-1),(d=(s=i.toString().trim()).match(g))&&("www."===d[1]?d[1]="http://www.":/@$/.test(d[1])&&!/^mailto:/.test(d[1])&&(d[1]="mailto:"+d[1]),a=t.selection.getBookmark(),t.selection.setRng(i),t.execCommand("createlink",!1,d[1]+d[2]),!1!==h&&t.dom.setAttrib(t.selection.getNode(),"target",h),t.selection.moveToBookmark(a),t.nodeChanged())}},e=function(e){var n;e.on("keydown",function(t){if(13===t.keyCode)return function(t){r(t,-1,"")}(e)}),o.browser.isIE()?e.on("focus",function(){if(!n){n=!0;try{e.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}}):(e.on("keypress",function(t){if(41===t.keyCode)return function(t){r(t,-1,"(")}(e)}),e.on("keyup",function(t){if(32===t.keyCode)return function(t){r(t,0,"")}(e)}))};!function n(){t.add("autolink",function(t){e(t)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function d(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))}function h(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o}var i=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return i(t())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),p=function(e){return e.fire("ResizeEditor")},y=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},z=function(e){return e.getParam("max_height",0,"number")},n=function(e){return e.getParam("autoresize_overflow_padding",1,"number")},b=function(e){return e.getParam("autoresize_bottom_margin",50,"number")},o=function(e){return e.getParam("autoresize_on_init",!0,"boolean")},u=function(e,t,n,i,o){r.setEditorTimeout(e,function(){C(e,t),n--?u(e,t,n,i,o):o&&o()},i)},C=function(e,t){var n,i,o,r=e.dom,u=e.getDoc();if(u)if(function(e){return e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()}(e))d(e,!0);else{var s=u.documentElement,a=b(e);i=y(e);var f=h(r,s,"margin-top",!0),c=h(r,s,"margin-bottom",!0);(o=s.offsetHeight+f+c+a)<0&&(o=0);var g=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;o+g>y(e)&&(i=o+g);var l=z(e);if(l&&l<i?(i=l,d(e,!0)):d(e,!1),i!==t.get()){if(n=i-t.get(),r.setStyle(e.getContainer(),"height",i+"px"),t.set(i),p(e),v.browser.isSafari()&&v.mac){var m=e.getWin();m.scrollTo(m.pageXOffset,m.pageYOffset)}e.hasFocus()&&e.selection.scrollIntoView(e.selection.getNode()),v.webkit&&n<0&&C(e,t)}}},s={setup:function(t,e){t.on("init",function(){var e=n(t);t.dom.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),t.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(){C(t,e)}),o(t)&&t.on("init",function(){u(t,e,20,100,function(){u(t,e,5,1e3)})})},resize:C},a=function(e,t){e.addCommand("mceAutoResize",function(){s.resize(e,t)})};!function t(){e.add("autoresize",function(e){if(e.settings.hasOwnProperty("resize")||(e.settings.resize=!1),!e.inline){var t=i(0);a(e,t),s.setup(e,t)}})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(n){"use strict";function r(t,e){var n=t||e,r=/^(\d+)([ms]?)$/.exec(""+n);return(r[2]?{s:1e3,m:6e4}[r[2]]:1)*parseInt(n,10)}function o(t){var e=t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-");return e=(e=(e=(e=e.replace(/\{path\}/g,n.document.location.pathname)).replace(/\{query\}/g,n.document.location.search)).replace(/\{hash\}/g,n.document.location.hash)).replace(/\{id\}/g,t.id)}function a(t,e){var n=t.settings.forced_root_block;return""===(e=d.trim(void 0===e?t.getBody().innerHTML:e))||new RegExp("^<"+n+"[^>]*>((\xa0|&nbsp;|[ \t]|<br[^>]*>)+?|)</"+n+">|<br>$","i").test(e)}function i(t){var e=parseInt(v.getItem(o(t)+"time"),10)||0;return!((new Date).getTime()-e>function(t){return r(t.settings.autosave_retention,"20m")}(t))||(g(t,!1),!1)}function u(t){var e=o(t);!a(t)&&t.isDirty()&&(v.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),v.setItem(e+"time",(new Date).getTime().toString()),function(t){t.fire("StoreDraft")}(t))}function s(t){var e=o(t);i(t)&&(t.setContent(v.getItem(e+"draft"),{format:"raw"}),function(t){t.fire("RestoreDraft")}(t))}function c(t,e){var n=function(t){return r(t.settings.autosave_interval,"30s")}(t);e.get()||(m.setInterval(function(){t.removed||u(t)},n),e.set(!0))}function f(t){t.undoManager.transact(function(){s(t),g(t)}),t.focus()}var l=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return l(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=tinymce.util.Tools.resolve("tinymce.util.Delay"),v=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=function(t,e){var n=o(t);v.removeItem(n+"draft"),v.removeItem(n+"time"),!1!==e&&function(t){t.fire("RemoveDraft")}(t)};function y(r){for(var o=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=o.concat(t);return r.apply(null,n)}}function p(n,t){return function(t){t.setDisabled(!i(n));function e(){return t.setDisabled(!i(n))}return n.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return n.off("StoreDraft RestoreDraft RemoveDraft",e)}}}var D=tinymce.util.Tools.resolve("tinymce.EditorManager");!function e(){t.add("autosave",function(t){var e=l(!1);return function(t){t.editorManager.on("BeforeUnload",function(t){var e;d.each(D.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&function(t){return t.getParam("autosave_ask_before_unload",!0)}(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e&&(t.preventDefault(),t.returnValue=e)})}(t),function(t,e){c(t,e),t.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){f(t)},onSetup:p(t)}),t.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){f(t)},onSetup:p(t)})}(t,e),t.on("init",function(){(function(t){return t.getParam("autosave_restore_when_empty",!1)})(t)&&t.dom.isEmpty(t.getBody())&&s(t)}),function(t){return{hasDraft:y(i,t),storeDraft:y(u,t),restoreDraft:y(s,t),removeDraft:y(g,t),isEmpty:y(a,t)}}(t)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(t){t=e.trim(t);function o(o,e){t=t.replace(o,e)}return o(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),o(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),o(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),o(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),o(/<font>(.*?)<\/font>/gi,"$1"),o(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),o(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),o(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),o(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),o(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),o(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),o(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),o(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),o(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),o(/<\/(strong|b)>/gi,"[/b]"),o(/<(strong|b)>/gi,"[b]"),o(/<\/(em|i)>/gi,"[/i]"),o(/<(em|i)>/gi,"[i]"),o(/<\/u>/gi,"[/u]"),o(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),o(/<u>/gi,"[u]"),o(/<blockquote[^>]*>/gi,"[quote]"),o(/<\/blockquote>/gi,"[/quote]"),o(/<br \/>/gi,"\n"),o(/<br\/>/gi,"\n"),o(/<br>/gi,"\n"),o(/<p>/gi,""),o(/<\/p>/gi,"\n"),o(/&nbsp;|\u00a0/gi," "),o(/&quot;/gi,'"'),o(/&lt;/gi,"<"),o(/&gt;/gi,">"),o(/&amp;/gi,"&"),t},i=function(t){t=e.trim(t);function o(o,e){t=t.replace(o,e)}return o(/\n/gi,"<br />"),o(/\[b\]/gi,"<strong>"),o(/\[\/b\]/gi,"</strong>"),o(/\[i\]/gi,"<em>"),o(/\[\/i\]/gi,"</em>"),o(/\[u\]/gi,"<u>"),o(/\[\/u\]/gi,"</u>"),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),o(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),o(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),o(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),t};!function n(){o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=i(o.content)}),o.on("PostProcess",function(o){o.set&&(o.content=i(o.content)),o.get&&(o.content=t(o.content))})})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
- !function(c){"use strict";function n(){}function i(n){return function(){return n}}function e(){return m}var r,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(n,e){return n.fire("insertCustomChar",{chr:e})},u=function(n,e){var r=a(n,e).chr;n.execCommand("mceInsertContent",!1,r)},o=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=function(n){return n.settings.charmap},l=function(n){return n.settings.charmap_append},f=i(!1),g=i(!0),m=(r={fold:function(n,e){return n()},is:f,isSome:f,isNone:g,getOr:p,getOrThunk:d,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:p,orThunk:d,map:e,each:n,bind:e,exists:f,forall:g,filter:e,equals:h,equals_:h,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(r),r);function h(n){return n.isNone()}function d(n){return n()}function p(n){return n}function y(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}}function w(n,e){for(var r=n.length,t=new Array(r),a=0;a<r;a++){var i=n[a];t[a]=e(i,a)}return t}function b(n,e){return function(n){for(var e=[],r=0,t=n.length;r<t;++r){if(!O(n[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+n);S.apply(e,n[r])}return e}(w(n,e))}function v(n){return T(n)?[].concat(function(n){return o.grep(n,function(n){return T(n)&&2===n.length})}(n)):"function"==typeof n?n():[]}function k(n,e){return-1!==n.indexOf(e)}var C=function(r){function n(){return a}function e(n){return n(r)}var t=i(r),a={fold:function(n,e){return e(r)},is:function(n){return r===n},isSome:g,isNone:f,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(n){return C(n(r))},each:function(n){n(r)},bind:e,exists:e,forall:e,filter:function(n){return n(r)?a:m},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(n){return n.is(r)},equals_:function(n,e){return n.fold(f,function(n){return e(r,n)})}};return a},A={some:C,none:e,from:function(n){return null===n||n===undefined?m:C(n)}},O=y("array"),x=y("function"),q=Array.prototype.slice,S=Array.prototype.push,T=(x(Array.from)&&Array.from,o.isArray),E="User Defined",z=function(n){var e=function(n,e){var r=s(n);r&&(e=[{name:E,characters:v(r)}]);var t=l(n);if(t){var a=o.grep(e,function(n){return n.name===E});return a.length?(a[0].characters=[].concat(a[0].characters).concat(v(t)),e):[].concat(e).concat({name:E,characters:v(t)})}return e}(n,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[402,"function / florin"],[8747,"integral"],[8721,"n-ary sumation"],[8734,"infinity"],[8730,"square root"],[8764,"similar to"],[8773,"approximately equal to"],[8776,"almost equal to"],[8800,"not equal to"],[8801,"identical to"],[8712,"element of"],[8713,"not an element of"],[8715,"contains as member"],[8719,"n-ary product"],[8743,"logical and"],[8744,"logical or"],[172,"not sign"],[8745,"intersection"],[8746,"union"],[8706,"partial differential"],[8704,"for all"],[8707,"there exists"],[8709,"diameter"],[8711,"backward difference"],[8727,"asterisk operator"],[8733,"proportional to"],[8736,"angle"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Symbols",characters:[[8501,"alef symbol"],[982,"pi symbol"],[8476,"real part symbol"],[978,"upsilon - hook symbol"],[8472,"Weierstrass p"],[8465,"imaginary part"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8629,"carriage return"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8756,"therefore"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8853,"circled plus"],[8855,"circled times"],[8869,"perpendicular"],[8901,"dot operator"],[8968,"left ceiling"],[8969,"right ceiling"],[8970,"left floor"],[8971,"right floor"],[9001,"left-pointing angle bracket"],[9002,"right-pointing angle bracket"],[9674,"lozenge"],[9824,"black spade suit"],[9827,"black club suit"],[9829,"black heart suit"],[9830,"black diamond suit"],[8194,"en space"],[8195,"em space"],[8201,"thin space"],[8204,"zero width non-joiner"],[8205,"zero width joiner"],[8206,"left-to-right mark"],[8207,"right-to-left mark"]]}]);return 1<e.length?[{name:"All",characters:b(e,function(n){return n.characters})}].concat(e):e},N=function(e){return{getCharMap:function(){return z(e)},insertChar:function(n){u(e,n)}}},U=function(n){function e(){return r}var r=n;return{get:e,set:function(n){r=n},clone:function(){return U(e())}}},D=function(n,e){var r=[],t=e.toLowerCase();return function(n,e){for(var r=0,t=n.length;r<t;r++){e(n[r],r)}}(n.characters,function(n){!function(n,e,r){return!!k(String.fromCharCode(n).toLowerCase(),r)||(k(e.toLowerCase(),r)||k(e.toLowerCase().replace(/\s+/g,""),r))}(n[0],n[1],t)||r.push(n)}),w(r,function(n){return{text:n[1],value:String.fromCharCode(n[0]),icon:String.fromCharCode(n[0])}})},I="pattern",P=function(r,n){function e(){return[{label:"Search",type:"input",name:I},{type:"collection",name:"results"}]}function t(r,t){(function(n,e){for(var r=0,t=n.length;r<t;r++){var a=n[r];if(e(a,r))return A.some(a)}return A.none()})(n,function(n){return n.name===a.get()}).each(function(n){var e=D(n,t);r.setData({results:e})})}var a=1===n.length?U(E):U("All"),i=function(r,t){var a=null;return{cancel:function(){null!==a&&(c.clearTimeout(a),a=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==a&&c.clearTimeout(a),a=c.setTimeout(function(){r.apply(null,n),a=null},t)}}}(function(n){var e=n.getData().pattern;t(n,e)},40),o={title:"Special Character",size:"normal",body:1===n.length?{type:"panel",items:e()}:{type:"tabpanel",tabs:w(n,function(n){return{title:n.name,name:n.name,items:e()}})},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{pattern:"",results:D(n[0],"")},onAction:function(n,e){"results"===e.name&&(u(r,e.value),n.close())},onTabChange:function(n,e){a.set(e.newTabName),i.throttle(n)},onChange:function(n,e){e.name===I&&i.throttle(n)}};r.windowManager.open(o)},j=function(n,e){n.addCommand("mceShowCharmap",function(){P(n,e)})},L=tinymce.util.Tools.resolve("tinymce.util.Promise"),M=function(n){n.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:function(){return n.execCommand("mceShowCharmap")}}),n.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:function(){return n.execCommand("mceShowCharmap")}})};!function R(){t.add("charmap",function(n){var e=z(n);return j(n,e),M(n),function(t,a){t.ui.registry.addAutocompleter("charmap",{ch:":",columns:"auto",minChars:2,fetch:function(r,n){return new L(function(n,e){n(D(a,r))})},onAction:function(n,e,r){t.selection.setRng(e),t.insertContent(r),n.hide()}})}(n,e[0]),N(n)})}()}(window);
9
+ !function(c){"use strict";function n(){}function i(n){return function(){return n}}function e(){return m}var r,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(n,e){return n.fire("insertCustomChar",{chr:e})},u=function(n,e){var r=a(n,e).chr;n.execCommand("mceInsertContent",!1,r)},o=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=function(n){return n.settings.charmap},l=function(n){return n.settings.charmap_append},f=i(!1),g=i(!0),m=(r={fold:function(n,e){return n()},is:f,isSome:f,isNone:g,getOr:p,getOrThunk:d,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:p,orThunk:d,map:e,each:n,bind:e,exists:f,forall:g,filter:e,equals:h,equals_:h,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(r),r);function h(n){return n.isNone()}function d(n){return n()}function p(n){return n}function y(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}}function w(n,e){for(var r=n.length,t=new Array(r),a=0;a<r;a++){var i=n[a];t[a]=e(i,a)}return t}function b(n,e){return function(n){for(var e=[],r=0,t=n.length;r<t;++r){if(!O(n[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+n);S.apply(e,n[r])}return e}(w(n,e))}function v(n){return T(n)?[].concat(function(n){return o.grep(n,function(n){return T(n)&&2===n.length})}(n)):"function"==typeof n?n():[]}function k(n,e){return-1!==n.indexOf(e)}var C=function(r){function n(){return a}function e(n){return n(r)}var t=i(r),a={fold:function(n,e){return e(r)},is:function(n){return r===n},isSome:g,isNone:f,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(n){return C(n(r))},each:function(n){n(r)},bind:e,exists:e,forall:e,filter:function(n){return n(r)?a:m},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(n){return n.is(r)},equals_:function(n,e){return n.fold(f,function(n){return e(r,n)})}};return a},A={some:C,none:e,from:function(n){return null===n||n===undefined?m:C(n)}},O=y("array"),x=y("function"),q=Array.prototype.slice,S=Array.prototype.push,T=(x(Array.from)&&Array.from,o.isArray),E="User Defined",z=function(n){var e=function(n,e){var r=s(n);r&&(e=[{name:E,characters:v(r)}]);var t=l(n);if(t){var a=o.grep(e,function(n){return n.name===E});return a.length?(a[0].characters=[].concat(a[0].characters).concat(v(t)),e):[].concat(e).concat({name:E,characters:v(t)})}return e}(n,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[402,"function / florin"],[8747,"integral"],[8721,"n-ary sumation"],[8734,"infinity"],[8730,"square root"],[8764,"similar to"],[8773,"approximately equal to"],[8776,"almost equal to"],[8800,"not equal to"],[8801,"identical to"],[8712,"element of"],[8713,"not an element of"],[8715,"contains as member"],[8719,"n-ary product"],[8743,"logical and"],[8744,"logical or"],[172,"not sign"],[8745,"intersection"],[8746,"union"],[8706,"partial differential"],[8704,"for all"],[8707,"there exists"],[8709,"diameter"],[8711,"backward difference"],[8727,"asterisk operator"],[8733,"proportional to"],[8736,"angle"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Symbols",characters:[[8501,"alef symbol"],[982,"pi symbol"],[8476,"real part symbol"],[978,"upsilon - hook symbol"],[8472,"Weierstrass p"],[8465,"imaginary part"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8629,"carriage return"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8756,"therefore"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8853,"circled plus"],[8855,"circled times"],[8869,"perpendicular"],[8901,"dot operator"],[8968,"left ceiling"],[8969,"right ceiling"],[8970,"left floor"],[8971,"right floor"],[9001,"left-pointing angle bracket"],[9002,"right-pointing angle bracket"],[9674,"lozenge"],[9824,"black spade suit"],[9827,"black club suit"],[9829,"black heart suit"],[9830,"black diamond suit"],[8194,"en space"],[8195,"em space"],[8201,"thin space"],[8204,"zero width non-joiner"],[8205,"zero width joiner"],[8206,"left-to-right mark"],[8207,"right-to-left mark"]]}]);return 1<e.length?[{name:"All",characters:b(e,function(n){return n.characters})}].concat(e):e},N=function(e){return{getCharMap:function(){return z(e)},insertChar:function(n){u(e,n)}}},U=function(n){function e(){return r}var r=n;return{get:e,set:function(n){r=n},clone:function(){return U(e())}}},D=function(n,e){var r=[],t=e.toLowerCase();return function(n,e){for(var r=0,t=n.length;r<t;r++){e(n[r],r)}}(n.characters,function(n){!function(n,e,r){return!!k(String.fromCharCode(n).toLowerCase(),r)||(k(e.toLowerCase(),r)||k(e.toLowerCase().replace(/\s+/g,""),r))}(n[0],n[1],t)||r.push(n)}),w(r,function(n){return{text:n[1],value:String.fromCharCode(n[0]),icon:String.fromCharCode(n[0])}})},I="pattern",P=function(r,n){function e(){return[{label:"Search",type:"input",name:I},{type:"collection",name:"results"}]}function t(r,t){(function(n,e){for(var r=0,t=n.length;r<t;r++){var a=n[r];if(e(a,r))return A.some(a)}return A.none()})(n,function(n){return n.name===a.get()}).each(function(n){var e=D(n,t);r.setData({results:e})})}var a=1===n.length?U(E):U("All"),i=function(r,t){var a=null;return{cancel:function(){null!==a&&(c.clearTimeout(a),a=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==a&&c.clearTimeout(a),a=c.setTimeout(function(){r.apply(null,n),a=null},t)}}}(function(n){var e=n.getData().pattern;t(n,e)},40),o={title:"Special Character",size:"normal",body:1===n.length?{type:"panel",items:e()}:{type:"tabpanel",tabs:w(n,function(n){return{title:n.name,name:n.name,items:e()}})},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{pattern:"",results:D(n[0],"")},onAction:function(n,e){"results"===e.name&&(u(r,e.value),n.close())},onTabChange:function(n,e){a.set(e.newTabName),i.throttle(n)},onChange:function(n,e){e.name===I&&i.throttle(n)}};r.windowManager.open(o).focus(I)},j=function(n,e){n.addCommand("mceShowCharmap",function(){P(n,e)})},L=tinymce.util.Tools.resolve("tinymce.util.Promise"),M=function(n){n.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:function(){return n.execCommand("mceShowCharmap")}}),n.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:function(){return n.execCommand("mceShowCharmap")}})};!function R(){t.add("charmap",function(n){var e=z(n);return j(n,e),M(n),function(t,a){t.ui.registry.addAutocompleter("charmap",{ch:":",columns:"auto",minChars:2,fetch:function(r,n){return new L(function(n,e){n(D(a,r))})},onAction:function(n,e,r){t.selection.setRng(e),t.insertContent(r),n.hide()}})}(n,e[0]),N(n)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e,n){e.focus(),e.undoManager.transact(function(){e.setContent(n)}),e.selection.setCursorLocation(),e.nodeChanged()},o=function(e){return e.getContent({source_view:!0})},n=function(n){var e=o(n);n.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){t(n,e.getData().code),e.close()}})},c=function(e){e.addCommand("mceCodeEditor",function(){n(e)})},i=function(e){e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return n(e)}}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return n(e)}})};!function u(){e.add("code",function(e){return c(e),i(e),{}})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(c){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t={},n=t,g=void 0!==t?t:"undefined"!=typeof WorkerGlobalScope&&c.self instanceof WorkerGlobalScope?c.self:{},i=function(){var u=/\blang(?:uage)?-(?!\*)(\w+)\b/i,S=g.Prism={util:{encode:function(e){return e instanceof s?new s(e.type,S.util.encode(e.content),e.alias):"Array"===S.util.type(e)?e.map(S.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){switch(S.util.type(e)){case"Object":var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=S.util.clone(e[n]));return t;case"Array":return e.map&&e.map(function(e){return S.util.clone(e)})}return e}},languages:{extend:function(e,t){var n=S.util.clone(S.languages[e]);for(var a in t)n[a]=t[a];return n},insertBefore:function(n,e,t,a){var r=(a=a||S.languages)[n];if(2===arguments.length){for(var i in t=e)t.hasOwnProperty(i)&&(r[i]=t[i]);return r}var o={};for(var s in r)if(r.hasOwnProperty(s)){if(s===e)for(var i in t)t.hasOwnProperty(i)&&(o[i]=t[i]);o[s]=r[s]}return S.languages.DFS(S.languages,function(e,t){t===a[n]&&e!==n&&(this[e]=o)}),a[n]=o},DFS:function(e,t,n){for(var a in e)e.hasOwnProperty(a)&&(t.call(e,a,e[a],n||a),"Object"===S.util.type(e[a])?S.languages.DFS(e[a],t):"Array"===S.util.type(e[a])&&S.languages.DFS(e[a],t,a))}},plugins:{},highlightAll:function(e,t){for(var n=c.document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),a=0,r=void 0;r=n[a++];)S.highlightElement(r,!0===e,t)},highlightElement:function(e,t,n){for(var a,r,i=e;i&&!u.test(i.className);)i=i.parentNode;i&&(a=(i.className.match(u)||[,""])[1],r=S.languages[a]),e.className=e.className.replace(u,"").replace(/\s+/g," ")+" language-"+a,i=e.parentNode,/pre/i.test(i.nodeName)&&(i.className=i.className.replace(u,"").replace(/\s+/g," ")+" language-"+a);var o=e.textContent,s={element:e,language:a,grammar:r,code:o};if(o&&r)if(S.hooks.run("before-highlight",s),t&&g.Worker){var l=new c.Worker(S.filename);l.onmessage=function(e){s.highlightedCode=e.data,S.hooks.run("before-insert",s),s.element.innerHTML=s.highlightedCode,n&&n.call(s.element),S.hooks.run("after-highlight",s),S.hooks.run("complete",s)},l.postMessage(JSON.stringify({language:s.language,code:s.code,immediateClose:!0}))}else s.highlightedCode=S.highlight(s.code,s.grammar,s.language),S.hooks.run("before-insert",s),s.element.innerHTML=s.highlightedCode,n&&n.call(e),S.hooks.run("after-highlight",s),S.hooks.run("complete",s);else S.hooks.run("complete",s)},highlight:function(e,t,n){var a=S.tokenize(e,t);return s.stringify(S.util.encode(a),n)},tokenize:function(e,t,n){var a=S.Token,r=[e],i=t.rest;if(i){for(var o in i)t[o]=i[o];delete t.rest}e:for(var o in t)if(t.hasOwnProperty(o)&&t[o]){var s=t[o];s="Array"===S.util.type(s)?s:[s];for(var l=0;l<s.length;++l){var u=s[l],c=u.inside,g=!!u.lookbehind,d=0,p=u.alias;u=u.pattern||u;for(var f=0;f<r.length;f++){var h=r[f];if(r.length>e.length)break e;if(!(h instanceof a)){u.lastIndex=0;var m=u.exec(h);if(m){g&&(d=m[1].length);var b=m.index-1+d,y=b+(m=m[0].slice(d)).length,v=h.slice(0,b+1),k=h.slice(y+1),w=[f,1];v&&w.push(v);var x=new a(o,c?S.tokenize(m,c):m,p);w.push(x),k&&w.push(k),Array.prototype.splice.apply(r,w)}}}}}return r},hooks:{all:{},add:function(e,t){var n=S.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=S.hooks.all[e];if(n&&n.length)for(var a=0,r=void 0;r=n[a++];)r(t)}}},s=S.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(s.stringify=function(t,n,e){if("string"==typeof t)return t;if("Array"===S.util.type(t))return t.map(function(e){return s.stringify(e,n,t)}).join("");var a={type:t.type,content:s.stringify(t.content,n,e),tag:"span",classes:["token",t.type],attributes:{},language:n,parent:e};if("comment"===a.type&&(a.attributes.spellcheck="true"),t.alias){var r="Array"===S.util.type(t.alias)?t.alias:[t.alias];Array.prototype.push.apply(a.classes,r)}S.hooks.run("wrap",a);var i="";for(var o in a.attributes)i+=(i?" ":"")+o+'="'+(a.attributes[o]||"")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'" '+i+">"+a.content+"</"+a.tag+">"},!g.document)return g.addEventListener&&g.addEventListener("message",function(e){var t=JSON.parse(e.data),n=t.language,a=t.code,r=t.immediateClose;g.postMessage(S.highlight(a,S.languages[n],n)),r&&g.close()},!1),g.Prism}();void 0!==n&&(n.Prism=i),i.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},i.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),i.languages.xml=i.languages.markup,i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},i.languages.css.atrule.inside.rest=i.util.clone(i.languages.css),i.languages.markup&&(i.languages.insertBefore("markup","tag",{style:{pattern:/<style[\w\W]*?>[\w\W]*?<\/style>/i,inside:{tag:{pattern:/<style[\w\W]*?>|<\/style>/i,inside:i.languages.markup.tag.inside},rest:i.languages.css},alias:"language-css"}}),i.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:i.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:i.languages.css}},alias:"language-css"}},i.languages.markup.tag)),i.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},i.languages.javascript=i.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),i.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),i.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:i.languages.javascript}},string:/[\s\S]+/}}}),i.languages.markup&&i.languages.insertBefore("markup","tag",{script:{pattern:/<script[\w\W]*?>[\w\W]*?<\/script>/i,inside:{tag:{pattern:/<script[\w\W]*?>|<\/script>/i,inside:i.languages.markup.tag.inside},rest:i.languages.javascript},alias:"language-javascript"}}),i.languages.js=i.languages.javascript,i.languages.c=i.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),i.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0}}}}),delete i.languages.c["class-name"],delete i.languages.c["boolean"],i.languages.csharp=i.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+)\b/i}),i.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0}}),i.languages.cpp=i.languages.extend("c",{keyword:/\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,"boolean":/\b(true|false)\b/,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),i.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}),i.languages.java=i.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}}),i.languages.php=i.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0}}),i.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),i.languages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),i.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),i.languages.markup&&(i.hooks.add("before-highlight",function(t){"php"===t.language&&(t.tokenStack=[],t.backupCode=t.code,t.code=t.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(e){return t.tokenStack.push(e),"{{{PHP"+t.tokenStack.length+"}}}"}))}),i.hooks.add("before-insert",function(e){"php"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),i.hooks.add("after-highlight",function(e){if("php"===e.language){for(var t=0,n=void 0;n=e.tokenStack[t];t++)e.highlightedCode=e.highlightedCode.replace("{{{PHP"+(t+1)+"}}}",i.highlight(n,e.grammar,"php").replace(/\$/g,"$$$$"));e.element.innerHTML=e.highlightedCode}}),i.hooks.add("wrap",function(e){"php"===e.language&&"markup"===e.type&&(e.content=e.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'<span class="token php">$1</span>'))}),i.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:i.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})),i.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:/"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,"boolean":/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/},function(e){e.languages.ruby=e.languages.extend("clike",{comment:/#(?!\{[^\r\n]*?\}).*/,keyword:/\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/});var t={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.util.clone(e.languages.ruby)}};e.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,inside:{interpolation:t}},{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}],variable:/[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,symbol:/:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.insertBefore("ruby","number",{builtin:/\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,inside:{interpolation:t}},{pattern:/("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,inside:{interpolation:t}}]}(i);function a(){}function o(e){return function(){return e}}function s(){return f}var l,u={isCodeSample:function B(e){return e&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-")},trimArg:function M(n){return function(e,t){return n(t)}}},d=o(!1),p=o(!0),f=(l={fold:function(e,t){return e()},is:d,isSome:d,isNone:p,getOr:b,getOrThunk:m,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:b,orThunk:m,map:s,each:a,bind:s,exists:d,forall:p,filter:s,equals:h,equals_:h,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(l),l);function h(e){return e.isNone()}function m(e){return e()}function b(e){return e}function y(e){var t=e.selection?e.selection.getNode():null;return u.isCodeSample(t)?w.some(t):w.none()}var v,k=function(n){function e(){return r}function t(e){return e(n)}var a=o(n),r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:p,isNone:d,getOr:a,getOrThunk:a,getOrDie:a,getOrNull:a,getOrUndefined:a,or:e,orThunk:e,map:function(e){return k(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?r:f},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(d,function(e){return t(n,e)})}};return r},w={some:k,none:s,from:function(e){return null===e||e===undefined?f:k(e)}},x=y,S=function(t,n,a){t.undoManager.transact(function(){var e=y(t);return a=r.DOM.encode(a),e.fold(function(){t.insertContent('<pre id="__new" class="language-'+n+'">'+a+"</pre>"),t.selection.select(t.$("#__new").removeAttr("id")[0])},function(e){t.dom.setAttrib(e,"class","language-"+n),e.innerHTML=a,i.highlightElement(e),t.selection.select(e)})})},A=function(e){return y(e).fold(function(){return""},function(e){return e.textContent})},C=function(e){return e.settings.codesample_languages},_=function(e){var t=C(e);return t||[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}]},N=function(e,n){return x(e).fold(function(){return n},function(e){var t=e.className.match(/language-(\w+)/);return t?t[1]:n})},O=(v="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===v}),z=Array.prototype.slice,P=(O(Array.from)&&Array.from,function(n){var e=_(n),t=function(e){return 0===e.length?w.none():w.some(e[0])}(e).fold(function(){return""},function(e){return e.value}),a=N(n,t),r=A(n);n.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"selectbox",name:"language",label:"Language",items:e},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:a,code:r},onSubmit:function(e){var t=e.getData();S(n,t.language,t.code),e.close()}})}),W=function(t){t.addCommand("codesample",function(){var e=t.selection.getNode();t.selection.isCollapsed()||u.isCodeSample(e)?P(t):t.formatter.toggle("code")})},j=function(n){var r=n.$;n.on("PreProcess",function(e){r("pre[contenteditable=false]",e.node).filter(u.trimArg(u.isCodeSample)).each(function(e,t){var n=r(t),a=t.textContent;n.attr("class",r.trim(n.attr("class"))),n.removeAttr("contentEditable"),n.empty().append(r("<code></code>").each(function(){this.textContent=a}))})}),n.on("SetContent",function(){var e=r("pre").filter(u.trimArg(u.isCodeSample)).filter(function(e,t){return"false"!==t.contentEditable});e.length&&n.undoManager.transact(function(){e.each(function(e,t){r(t).find("br").each(function(e,t){t.parentNode.replaceChild(n.getDoc().createTextNode("\n"),t)}),t.contentEditable="false",t.innerHTML=n.dom.encode(t.textContent),i.highlightElement(t),t.className=r.trim(t.className)})})})},T=function(n){n.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:function(){return P(n)},onSetup:function(e){function t(){e.setActive(function(e){var t=e.selection.getStart();return e.dom.is(t,"pre.language-markup")}(n))}return n.on("NodeChange",t),function(){return n.off("NodeChange",t)}}}),n.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:function(){return P(n)}})};!function F(){e.add("codesample",function(t){j(t),T(t),W(t),t.on("dblclick",function(e){u.isCodeSample(e.target)&&P(t)})})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("colorpicker",function(){o.console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(n){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager");!function e(){o.add("contextmenu",function(){n.console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(i){"use strict";function n(){}function u(n){return function(){return n}}function t(){return a}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=function(n,t){var e,r=n.dom,o=n.selection.getSelectedBlocks();o.length&&(e=r.getAttrib(o[0],"dir"),c.each(o,function(n){r.getParent(n.parentNode,'*[dir="'+t+'"]',r.getRoot())||r.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},d=function(n){n.addCommand("mceDirectionLTR",function(){o(n,"ltr")}),n.addCommand("mceDirectionRTL",function(){o(n,"rtl")})},f=u(!1),l=u(!0),a=(e={fold:function(n,t){return n()},is:f,isSome:f,isNone:l,getOr:s,getOrThunk:N,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:s,orThunk:N,map:t,each:n,bind:t,exists:f,forall:l,filter:t,equals:m,equals_:m,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(e),e);function m(n){return n.isNone()}function N(n){return n()}function s(n){return n}function g(n,t){var e=n.dom(),r=i.window.getComputedStyle(e).getPropertyValue(t),o=""!==r||function(n){var t=A(n)?n.dom().parentNode:n.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}(n)?r:w(e,t);return null===o?undefined:o}function T(t,r){return function(e){function n(n){var t=p.fromDom(n.element);e.setActive(function(n){return"rtl"===g(n,"direction")?"rtl":"ltr"}(t)===r)}return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}}var E,O,y=function(e){function n(){return o}function t(n){return n(e)}var r=u(e),o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:l,isNone:f,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return y(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?o:a},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(f,function(n){return t(e,n)})}};return o},D=function(n){return null===n||n===undefined?a:y(n)},h=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:u(n)}},p={fromHtml:function(n,t){var e=(t||i.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw i.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return h(e.childNodes[0])},fromTag:function(n,t){var e=(t||i.document).createElement(n);return h(e)},fromText:function(n,t){var e=(t||i.document).createTextNode(n);return h(e)},fromDom:h,fromPoint:function(n,t,e){var r=n.dom();return D(r.elementFromPoint(t,e)).map(h)}},_=(E="function",function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"==t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t}(n)===E}),v=Array.prototype.slice,C=(_(Array.from)&&Array.from,i.Node.ATTRIBUTE_NODE,i.Node.CDATA_SECTION_NODE,i.Node.COMMENT_NODE,i.Node.DOCUMENT_NODE,i.Node.DOCUMENT_TYPE_NODE,i.Node.DOCUMENT_FRAGMENT_NODE,i.Node.ELEMENT_NODE,i.Node.TEXT_NODE),A=(i.Node.PROCESSING_INSTRUCTION_NODE,i.Node.ENTITY_REFERENCE_NODE,i.Node.ENTITY_NODE,i.Node.NOTATION_NODE,"undefined"!=typeof i.window?i.window:Function("return this;")(),O=C,function(n){return function(n){return n.dom().nodeType}(n)===O}),w=function(n,t){return function(n){return n.style!==undefined&&_(n.style.getPropertyValue)}(n)?n.style.getPropertyValue(t):""},S=function(n){n.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return n.execCommand("mceDirectionLTR")},onSetup:T(n,"ltr")}),n.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return n.execCommand("mceDirectionRTL")},onSetup:T(n,"rtl")})};!function R(){r.add("directionality",function(n){d(n),S(n)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(l){"use strict";function n(){}function i(n){return function(){return n}}function t(){return a}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=i(!1),u=i(!0),a=(e={fold:function(n,t){return n()},is:c,isSome:c,isNone:u,getOr:f,getOrThunk:s,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:f,orThunk:s,map:t,each:n,bind:t,exists:c,forall:u,filter:t,equals:o,equals_:o,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(e),e);function o(n){return n.isNone()}function s(n){return n()}function f(n){return n}function m(n,t){return-1!==n.indexOf(t)}function g(n,t){return m(n.title.toLowerCase(),t)||function(n,t){for(var e=0,r=n.length;e<r;e++){if(t(n[e],e))return!0}return!1}(n.keywords,function(n){return m(n.toLowerCase(),t)})}function d(n,t,e){for(var r=[],o=t.toLowerCase(),i=e.fold(function(){return c},function(t){return function(n){return t<=n}}),u=0;u<n.length&&(0!==t.length&&!g(n[u],o)||(r.push({value:n[u]["char"],text:n[u].title,icon:n[u]["char"]}),!i(r.length)));u++);return r}function y(n,t){for(var e=P(n),r=0,o=e.length;r<o;r++){var i=e[r];t(n[i],i)}}function p(n,t){return function(n,t){return D.call(n,t)}(n,t)?n[t]:t}function v(n){return function(n,e){return S(n,function(n,t){return{k:t,v:e(n,t)}})}(q(n),function(n){return _({keywords:[],category:"user"},n)})}function h(e,o,n){var r=k(A.none()),u=k(A.none());e.on("init",function(){x.load(n,o).then(function(n){var t=v(e);!function(n){var o={},i=[];y(n,function(n,t){var e={title:t,keywords:n.keywords,"char":n["char"],category:p(I,n.category)},r=o[e.category]!==undefined?o[e.category]:[];o[e.category]=r.concat([e]),i.push(e)}),r.set(A.some(o)),u.set(A.some(i))}(_(n,t))},function(n){l.console.log("Failed to load emoticons: "+n),r.set(A.some({})),u.set(A.some([]))})});var i=function(){return u.get().getOr([])},c=function(){return r.get().isSome()&&u.get().isSome()};return{listCategories:function(){return[z].concat(P(r.get().getOr({})))},hasLoaded:c,waitForLoad:function(){return c()?N.resolve(!0):new N(function(n,t){var e=15,r=L.setInterval(function(){c()?(L.clearInterval(r),n(!0)):--e<0&&(l.console.log("Could not load emojis from url: "+o),L.clearInterval(r),t(!1))},100)})},listAll:i,listCategory:function(t){return t===z?i():r.get().bind(function(n){return A.from(n[t])}).getOr([])}}}var b,w,O=function(e){function n(){return o}function t(n){return n(e)}var r=i(e),o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:u,isNone:c,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return O(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?o:a},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(c,function(n){return t(e,n)})}};return o},A={some:O,none:t,from:function(n){return null===n||n===undefined?a:O(n)}},j=(b="function",function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"==t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t}(n)===b}),C=Array.prototype.slice,k=(j(Array.from)&&Array.from,function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return k(t())}}}),T=Object.prototype.hasOwnProperty,_=(w=function(n,t){return t},function(){for(var n=new Array(arguments.length),t=0;t<n.length;t++)n[t]=arguments[t];if(0===n.length)throw new Error("Can't merge zero objects");for(var e={},r=0;r<n.length;r++){var o=n[r];for(var i in o)T.call(o,i)&&(e[i]=w(e[i],o[i]))}return e}),P=Object.keys,D=Object.hasOwnProperty,S=function(n,r){var o={};return y(n,function(n,t){var e=r(n,t);o[e.k]=e.v}),o},x=tinymce.util.Tools.resolve("tinymce.Resource"),L=tinymce.util.Tools.resolve("tinymce.util.Delay"),N=tinymce.util.Tools.resolve("tinymce.util.Promise"),E=function(n,t){return n.getParam("emoticons_database_url",t+"/js/emojis"+n.suffix+".js")},F=function(n){return n.getParam("emoticons_database_id","tinymce.plugins.emoticons","string")},q=function(n){return n.getParam("emoticons_append",{},"object")},z="All",I={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"},M="pattern",U=function(e,i){function n(){return{title:"Emoticons",size:"normal",body:{type:"tabpanel",tabs:function(n,t){for(var e=n.length,r=new Array(e),o=0;o<e;o++){var i=n[o];r[o]=t(i,o)}return r}(i.listCategories(),function(n){return{title:n,name:n,items:[o,c]}})},initialData:t,onTabChange:function(n,t){u.set(t.newTabName),r.throttle(n)},onChange:r.throttle,onAction:function(n,t){"results"===t.name&&(function(n,t){n.insertContent(t)}(e,t.value),n.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}}var t={pattern:"",results:d(i.listAll(),"",A.some(300))},u=k(z),r=function(e,r){var o=null;return{cancel:function(){null!==o&&(l.clearTimeout(o),o=null)},throttle:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];null!==o&&l.clearTimeout(o),o=l.setTimeout(function(){e.apply(null,n),o=null},r)}}}(function(n){!function(n){var t=n.getData(),e=u.get(),r=i.listCategory(e),o=d(r,t[M],e===z?A.some(300):A.none());n.setData({results:o})}(n)},200),o={label:"Search",type:"input",name:M},c={type:"collection",name:"results"},a=e.windowManager.open(n());a.focus(M),i.hasLoaded()||(a.block("Loading emoticons..."),i.waitForLoad().then(function(){a.redial(n()),r.throttle(a),a.focus(M),a.unblock()})["catch"](function(n){a.redial({title:"Emoticons",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"<p>Could not load emoticons</p>"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),a.focus(M),a.unblock()}))},R=function(n,t){function e(){return U(n,t)}n.ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:e}),n.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:e})};!function B(){r.add("emoticons",function(n,t){var e=E(n,t),r=F(n),o=h(n,e,r);R(n,o),function(r,o){r.ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(t,e){return o.waitForLoad().then(function(){var n=o.listAll();return d(n,t,A.some(e))})},onAction:function(n,t,e){r.selection.setRng(t),r.insertContent(e),n.hide()}})}(n,o)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(m){"use strict";function f(t){return e({validate:!1,root_name:"#document"}).parse(t)}function g(t){return t.replace(/<\/?[A-Z]+/g,function(t){return t.toLowerCase()})}var o,i=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return i(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=tinymce.util.Tools.resolve("tinymce.html.DomParser"),h=tinymce.util.Tools.resolve("tinymce.html.Node"),y=tinymce.util.Tools.resolve("tinymce.html.Serializer"),v=function(t){return t.getParam("fullpage_hide_in_source_view")},r=function(t){return t.getParam("fullpage_default_xml_pi")},a=function(t){return t.getParam("fullpage_default_encoding")},c=function(t){return t.getParam("fullpage_default_font_family")},u=function(t){return t.getParam("fullpage_default_font_size")},s=function(t){return t.getParam("fullpage_default_text_color")},d=function(t){return t.getParam("fullpage_default_title")},_=function(t){return t.getParam("fullpage_default_doctype","<!DOCTYPE html>")},b=f,n=function(t,e){var n,i,l=f(e),r={};function o(t,e){return t.attr(e)||""}return r.fontface=c(t),r.fontsize=u(t),7===(n=l.firstChild).type&&(r.xml_pi=!0,(i=/encoding="([^"]+)"/.exec(n.value))&&(r.docencoding=i[1])),(n=l.getAll("#doctype")[0])&&(r.doctype="<!DOCTYPE"+n.value+">"),(n=l.getAll("title")[0])&&n.firstChild&&(r.title=n.firstChild.value),p.each(l.getAll("meta"),function(t){var e,n=t.attr("name"),i=t.attr("http-equiv");n?r[n.toLowerCase()]=t.attr("content"):"Content-Type"===i&&(e=/charset\s*=\s*(.*)\s*/gi.exec(t.attr("content")))&&(r.docencoding=e[1])}),(n=l.getAll("html")[0])&&(r.langcode=o(n,"lang")||o(n,"xml:lang")),r.stylesheets=[],p.each(l.getAll("link"),function(t){"stylesheet"===t.attr("rel")&&r.stylesheets.push(t.attr("href"))}),(n=l.getAll("body")[0])&&(r.langdir=o(n,"dir"),r.style=o(n,"style"),r.visited_color=o(n,"vlink"),r.link_color=o(n,"link"),r.active_color=o(n,"alink")),r},x=function(t,r,e){var o,n,i,a,l,c=t.dom;function u(t,e,n){t.attr(e,n||undefined)}function s(t){n.firstChild?n.insert(t,n.firstChild):n.append(t)}o=f(e),(n=o.getAll("head")[0])||(a=o.getAll("html")[0],n=new h("head",1),a.firstChild?a.insert(n,a.firstChild,!0):a.append(n)),a=o.firstChild,r.xml_pi?(l='version="1.0"',r.docencoding&&(l+=' encoding="'+r.docencoding+'"'),7!==a.type&&(a=new h("xml",7),o.insert(a,o.firstChild,!0)),a.value=l):a&&7===a.type&&a.remove(),a=o.getAll("#doctype")[0],r.doctype?(a||(a=new h("#doctype",10),r.xml_pi?o.insert(a,o.firstChild):s(a)),a.value=r.doctype.substring(9,r.doctype.length-1)):a&&a.remove(),a=null,p.each(o.getAll("meta"),function(t){"Content-Type"===t.attr("http-equiv")&&(a=t)}),r.docencoding?(a||((a=new h("meta",1)).attr("http-equiv","Content-Type"),a.shortEnded=!0,s(a)),a.attr("content","text/html; charset="+r.docencoding)):a&&a.remove(),a=o.getAll("title")[0],r.title?(a?a.empty():s(a=new h("title",1)),a.append(new h("#text",3)).value=r.title):a&&a.remove(),p.each("keywords,description,author,copyright,robots".split(","),function(t){var e,n,i=o.getAll("meta"),l=r[t];for(e=0;e<i.length;e++)if((n=i[e]).attr("name")===t)return void(l?n.attr("content",l):n.remove());l&&((a=new h("meta",1)).attr("name",t),a.attr("content",l),a.shortEnded=!0,s(a))});var d={};return p.each(o.getAll("link"),function(t){"stylesheet"===t.attr("rel")&&(d[t.attr("href")]=t)}),p.each(r.stylesheets,function(t){d[t]||((a=new h("link",1)).attr({rel:"stylesheet",text:"text/css",href:t}),a.shortEnded=!0,s(a)),delete d[t]}),p.each(d,function(t){t.remove()}),(a=o.getAll("body")[0])&&(u(a,"dir",r.langdir),u(a,"style",r.style),u(a,"vlink",r.visited_color),u(a,"link",r.link_color),u(a,"alink",r.active_color),c.setAttribs(t.getBody(),{style:r.style,dir:r.dir,vLink:r.visited_color,link:r.link_color,aLink:r.active_color})),(a=o.getAll("html")[0])&&(u(a,"lang",r.langcode),u(a,"xml:lang",r.langcode)),n.firstChild||n.remove(),(i=y({validate:!1,indent:!0,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(o)).substring(0,i.indexOf("</body>"))},C=Object.prototype.hasOwnProperty,k=(o=function(t,e){return e},function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},i=0;i<t.length;i++){var l=t[i];for(var r in l)C.call(l,r)&&(n[r]=o(n[r],l[r]))}return n}),l=function(i,l){var r=n(i,l.get()),t=k({title:"",keywords:"",description:"",robots:"",author:"",docencoding:""},r);i.windowManager.open({title:"Metadata and Document Properties",size:"normal",body:{type:"panel",items:[{name:"title",type:"input",label:"Title"},{name:"keywords",type:"input",label:"Keywords"},{name:"description",type:"input",label:"Description"},{name:"robots",type:"input",label:"Robots"},{name:"author",type:"input",label:"Author"},{name:"docencoding",type:"input",label:"Encoding"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:t,onSubmit:function(t){var e=t.getData(),n=x(i,p.extend(r,e),l.get());l.set(n),t.close()}})},w=function(t,e){t.addCommand("mceFullPageProperties",function(){l(t,e)})},A=function(t,e){return p.each(t,function(t){e=e.replace(t,function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"})}),e},P=function(t){return t.replace(/<!--mce:protected ([\s\S]*?)-->/g,function(t,e){return unescape(e)})},T=p.each,O=function(t){var e,n="",i="";if(r(t)){var l=a(t);n+='<?xml version="1.0" encoding="'+(l||"ISO-8859-1")+'" ?>\n'}return n+=_(t),n+="\n<html>\n<head>\n",(e=d(t))&&(n+="<title>"+e+"</title>\n"),(e=a(t))&&(n+='<meta http-equiv="Content-Type" content="text/html; charset='+e+'" />\n'),(e=c(t))&&(i+="font-family: "+e+";"),(e=u(t))&&(i+="font-size: "+e+";"),(e=s(t))&&(i+="color: "+e+";"),n+="</head>\n<body"+(i?' style="'+i+'"':"")+">\n"},D=function(e,n,i){e.on("BeforeSetContent",function(t){!function(t,e,n,i){var l,r,o,a,c="",u=t.dom;if(!(i.selection||(o=A(t.settings.protect,i.content),"raw"===i.format&&e.get()||i.source_view&&v(t)))){0!==o.length||i.source_view||(o=p.trim(e.get())+"\n"+p.trim(o)+"\n"+p.trim(n.get())),-1!==(l=(o=o.replace(/<(\/?)BODY/gi,"<$1body")).indexOf("<body"))?(l=o.indexOf(">",l),e.set(g(o.substring(0,l+1))),-1===(r=o.indexOf("</body",l))&&(r=o.length),i.content=p.trim(o.substring(l+1,r)),n.set(g(o.substring(r)))):(e.set(O(t)),n.set("\n</body>\n</html>")),a=b(e.get()),T(a.getAll("style"),function(t){t.firstChild&&(c+=t.firstChild.value)});var s=a.getAll("body")[0];s&&u.setAttribs(t.getBody(),{style:s.attr("style")||"",dir:s.attr("dir")||"",vLink:s.attr("vlink")||"",link:s.attr("link")||"",aLink:s.attr("alink")||""}),u.remove("fullpage_styles");var d=t.getDoc().getElementsByTagName("head")[0];if(c)u.add(d,"style",{id:"fullpage_styles"}).appendChild(m.document.createTextNode(c));var f={};p.each(d.getElementsByTagName("link"),function(t){"stylesheet"===t.rel&&t.getAttribute("data-mce-fullpage")&&(f[t.href]=t)}),p.each(a.getAll("link"),function(t){var e=t.attr("href");if(!e)return!0;f[e]||"stylesheet"!==t.attr("rel")||u.add(d,"link",{rel:"stylesheet",text:"text/css",href:e,"data-mce-fullpage":"1"}),delete f[e]}),p.each(f,function(t){t.parentNode.removeChild(t)})}}(e,n,i,t)}),e.on("GetContent",function(t){!function(t,e,n,i){i.selection||i.source_view&&v(t)||(i.content=P(p.trim(e)+"\n"+p.trim(i.content)+"\n"+p.trim(n)))}(e,n.get(),i.get(),t)})},E=function(t){t.ui.registry.addButton("fullpage",{tooltip:"Metadata and document properties",icon:"document-properties",onAction:function(){t.execCommand("mceFullPageProperties")}}),t.ui.registry.addMenuItem("fullpage",{text:"Metadata and document properties",icon:"document-properties",onAction:function(){t.execCommand("mceFullPageProperties")}})};!function z(){t.add("fullpage",function(t){var e=i(""),n=i("");w(t,e),E(t),D(t,e,n)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(l){"use strict";function e(){}function m(e){return function(){return e}}function n(){return s}var r,t=function(e){function n(){return r}var r=e;return{get:n,set:function(e){r=e},clone:function(){return t(n())}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e){return{isFullscreen:function(){return null!==e.get()}}},c=m(!1),u=m(!0),s=(r={fold:function(e,n){return e()},is:c,isSome:c,isNone:u,getOr:d,getOrThunk:a,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(undefined),or:d,orThunk:a,map:n,each:e,bind:n,exists:c,forall:u,filter:n,equals:f,equals_:f,toArray:function(){return[]},toString:m("none()")},Object.freeze&&Object.freeze(r),r);function f(e){return e.isNone()}function a(e){return e()}function d(e){return e}function h(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}}function v(e,n){for(var r=e.length,t=new Array(r),o=0;o<r;o++){var i=e[o];t[o]=n(i,o)}return t}function g(e,n){for(var r=0,t=e.length;r<t;r++){n(e[r],r)}}function p(e,n){for(var r=[],t=0,o=e.length;t<o;t++){var i=e[t];n(i,t)&&r.push(i)}return r}function w(e,n){return function(e){for(var n=[],r=0,t=e.length;r<t;++r){if(!Y(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);Q.apply(n,e[r])}return n}(v(e,n))}function y(e,n){return-1!==e.indexOf(n)}function S(e){return e.style!==undefined&&$(e.style.getPropertyValue)}function E(e,n,r){!function(e,n,r){if(!(X(r)||G(r)||K(r)))throw l.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,r+"")}(e.dom(),n,r)}function O(e,n){var r=e.dom().getAttribute(n);return null===r?undefined:r}function N(e,n){e.dom().removeAttribute(n)}function T(e,n){var r=e.dom();!function(e,n){for(var r=Z(e),t=0,o=r.length;t<o;t++){var i=r[t];n(e[i],i)}}(n,function(e,n){!function(e,n,r){if(!X(r))throw l.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",e),new Error("CSS value must be a string: "+r);S(e)&&e.style.setProperty(n,r)}(r,n,e)})}function x(e,n){var r=e.dom(),t=l.window.getComputedStyle(r).getPropertyValue(n),o=""!==t||function(e){var n=ie(e)?e.dom().parentNode:e.dom();return n!==undefined&&null!==n&&n.ownerDocument.body.contains(n)}(e)?t:ue(r,n);return null===o?undefined:o}function b(e,n){var r=function(e,n){for(var r=0;r<e.length;r++){var t=e[r];if(t.test(n))return t}return undefined}(e,n);if(!r)return{major:0,minor:0};function t(e){return Number(n.replace(r,"$"+e))}return se(t(1),t(2))}function C(e,n){return function(){return n===e}}function D(e,n){return function(){return n===e}}function A(e,n){var r=String(n).toLowerCase();return function(e,n){for(var r=0,t=e.length;r<t;r++){var o=e[r];if(n(o,r))return z.some(o)}return z.none()}(e,function(e){return e.search(r)})}function M(n){return function(e){return y(e,n)}}function _(){return xe.get()}function k(e,n,r){return 0!=(e.compareDocumentPosition(n)&r)}function F(e,n){var r=e.dom();if(r.nodeType!==Ce)return!1;var t=r;if(t.matches!==undefined)return t.matches(n);if(t.msMatchesSelector!==undefined)return t.msMatchesSelector(n);if(t.webkitMatchesSelector!==undefined)return t.webkitMatchesSelector(n);if(t.mozMatchesSelector!==undefined)return t.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}function R(e,n){var r=n===undefined?l.document:n.dom();return function(e){return e.nodeType!==Ce&&e.nodeType!==De||0===e.childElementCount}(r)?[]:v(r.querySelectorAll(e),ne.fromDom)}function L(n){return function(e){return z.from(e.dom().parentNode).map(ne.fromDom)}(n).map(Ae).map(function(e){return p(e,function(e){return!function(e,n){return e.dom()===n.dom()}(n,e)})}).getOr([])}function I(e,n,r,t){return{x:m(e),y:m(n),width:m(r),height:m(t),right:m(e+r),bottom:m(n+t)}}function P(e){var n=e===undefined?l.window:e,r=n.document,t=function(e){var n=e!==undefined?e.dom():l.document,r=n.body.scrollLeft||n.documentElement.scrollLeft,t=n.body.scrollTop||n.documentElement.scrollTop;return _e(r,t)}(ne.fromDom(r)),o=n.visualViewport;if(o!==undefined)return I(Math.max(o.pageLeft,t.left()),Math.max(o.pageTop,t.top()),o.width,o.height);var i=r.documentElement,u=i.clientWidth,c=i.clientHeight;return I(t.left(),t.top(),u,c)}function H(e,n,r){return p(function(e,n){for(var r=$(n)?n:c,t=e.dom(),o=[];null!==t.parentNode&&t.parentNode!==undefined;){var i=t.parentNode,u=ne.fromDom(i);if(o.push(u),!0===r(u))break;t=i}return o}(e,r),n)}function U(e,n){return function(e,n){return p(L(e),n)}(e,function(e){return F(e,n)})}function W(r,t){return function(n){n.setActive(null!==t.get());function e(e){return n.setActive(e.state)}return r.on("FullscreenStateChanged",e),function(){return r.off("FullscreenStateChanged",e)}}}var B,V,j,q=function(r){function e(){return o}function n(e){return e(r)}var t=m(r),o={fold:function(e,n){return n(r)},is:function(e){return r===e},isSome:u,isNone:c,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(e){return q(e(r))},each:function(e){e(r)},bind:n,exists:n,forall:n,filter:function(e){return e(r)?o:s},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(e){return e.is(r)},equals_:function(e,n){return e.fold(c,function(e){return n(r,e)})}};return o},z={some:q,none:n,from:function(e){return null===e||e===undefined?s:q(e)}},X=h("string"),Y=h("array"),G=h("boolean"),$=h("function"),K=h("number"),J=Array.prototype.slice,Q=Array.prototype.push,Z=($(Array.from)&&Array.from,Object.keys),ee=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:m(e)}},ne={fromHtml:function(e,n){var r=(n||l.document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||1<r.childNodes.length)throw l.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return ee(r.childNodes[0])},fromTag:function(e,n){var r=(n||l.document).createElement(e);return ee(r)},fromText:function(e,n){var r=(n||l.document).createTextNode(e);return ee(r)},fromDom:ee,fromPoint:function(e,n,r){var t=e.dom();return z.from(t.elementFromPoint(n,r)).map(ee)}},re=(l.Node.ATTRIBUTE_NODE,l.Node.CDATA_SECTION_NODE,l.Node.COMMENT_NODE,l.Node.DOCUMENT_NODE),te=(l.Node.DOCUMENT_TYPE_NODE,l.Node.DOCUMENT_FRAGMENT_NODE,l.Node.ELEMENT_NODE),oe=l.Node.TEXT_NODE,ie=(l.Node.PROCESSING_INSTRUCTION_NODE,l.Node.ENTITY_REFERENCE_NODE,l.Node.ENTITY_NODE,l.Node.NOTATION_NODE,"undefined"!=typeof l.window?l.window:Function("return this;")(),B=oe,function(e){return function(e){return e.dom().nodeType}(e)===B}),ue=function(e,n){return S(e)?e.style.getPropertyValue(n):""},ce=function(){return se(0,0)},se=function(e,n){return{major:e,minor:n}},fe={nu:se,detect:function(e,n){var r=String(n).toLowerCase();return 0===e.length?ce():b(e,r)},unknown:ce},ae="Firefox",de=function(e){var n=e.current;return{current:n,version:e.version,isEdge:C("Edge",n),isChrome:C("Chrome",n),isIE:C("IE",n),isOpera:C("Opera",n),isFirefox:C(ae,n),isSafari:C("Safari",n)}},le={unknown:function(){return de({current:undefined,version:fe.unknown()})},nu:de,edge:m("Edge"),chrome:m("Chrome"),ie:m("IE"),opera:m("Opera"),firefox:m(ae),safari:m("Safari")},me="Windows",he="Android",ve="Solaris",ge="FreeBSD",pe=function(e){var n=e.current;return{current:n,version:e.version,isWindows:D(me,n),isiOS:D("iOS",n),isAndroid:D(he,n),isOSX:D("OSX",n),isLinux:D("Linux",n),isSolaris:D(ve,n),isFreeBSD:D(ge,n)}},we={unknown:function(){return pe({current:undefined,version:fe.unknown()})},nu:pe,windows:m(me),ios:m("iOS"),android:m(he),linux:m("Linux"),osx:m("OSX"),solaris:m(ve),freebsd:m(ge)},ye=function(e,r){return A(e,r).map(function(e){var n=fe.detect(e.versionRegexes,r);return{current:e.name,version:n}})},Se=function(e,r){return A(e,r).map(function(e){var n=fe.detect(e.versionRegexes,r);return{current:e.name,version:n}})},Ee=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Oe=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return y(e,"edge/")&&y(e,"chrome")&&y(e,"safari")&&y(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ee],search:function(e){return y(e,"chrome")&&!y(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return y(e,"msie")||y(e,"trident")}},{name:"Opera",versionRegexes:[Ee,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:M("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:M("firefox")},{name:"Safari",versionRegexes:[Ee,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(y(e,"safari")||y(e,"mobile/"))&&y(e,"applewebkit")}}],Ne=[{name:"Windows",search:M("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return y(e,"iphone")||y(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:M("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:M("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:M("linux"),versionRegexes:[]},{name:"Solaris",search:M("sunos"),versionRegexes:[]},{name:"FreeBSD",search:M("freebsd"),versionRegexes:[]}],Te={browsers:m(Oe),oses:m(Ne)},xe=t(function(e,n){var r=Te.browsers(),t=Te.oses(),o=ye(r,e).fold(le.unknown,le.nu),i=Se(t,e).fold(we.unknown,we.nu);return{browser:o,os:i,deviceType:function(e,n,r,t){var o=e.isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,u=e.isiOS()||e.isAndroid(),c=u||t("(pointer:coarse)"),s=o||!i&&u&&t("(min-device-width:768px)"),f=i||u&&!s,a=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),d=!f&&!s&&!a;return{isiPad:m(o),isiPhone:m(i),isTablet:m(s),isPhone:m(f),isTouch:m(c),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:m(a),isDesktop:m(d)}}(i,o,e,n)}}(l.navigator.userAgent,function(e){return l.window.matchMedia(e).matches})),be=function(e,n){return k(e,n,l.Node.DOCUMENT_POSITION_CONTAINED_BY)},Ce=te,De=re,Ae=(_().browser.isIE(),function(e){return v(e.dom().childNodes,ne.fromDom)}),Me=(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]}("element","offset"),function(r,t){return{left:m(r),top:m(t),translate:function(e,n){return Me(r+e,t+n)}}}),_e=Me,ke=(_().browser.isSafari(),function(e,n){e.fire("FullscreenStateChanged",{state:n})}),Fe=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Re=tinymce.util.Tools.resolve("tinymce.Env"),Le=tinymce.util.Tools.resolve("tinymce.util.Delay"),Ie="data-ephox-mobile-fullscreen-style",Pe="position:absolute!important;",He="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",Ue=Re.os.isAndroid(),We=function(e,n){function r(t){return function(e){var n=O(e,"style"),r=n===undefined?"no-styles":n.trim();r!==t&&(E(e,Ie,r),E(e,"style",t))}}var t=function(e,n,r){return H(e,function(e){return F(e,n)},r)}(e,"*"),o=w(t,function(e){return U(e,"*:not(.tox-silver-sink)")}),i=function(e){var n=x(e,"background-color");return n!==undefined&&""!==n?"background-color:"+n+"!important":"background-color:rgb(255,255,255)!important;"}(n);g(o,r("display:none!important;")),g(t,r(Pe+He+i)),r((!0===Ue?"":Pe)+He+i)(e)},Be=function(){var e=function(e){return R(e)}("["+Ie+"]");g(e,function(e){var n=O(e,Ie);"no-styles"!==n?E(e,"style",n):N(e,"style"),N(e,Ie)})},Ve=Fe.DOM,je=l.window.visualViewport,qe=je===undefined?{bind:e,unbind:e}:(V=function(){var n=t(z.none());return{clear:function(){n.set(z.none())},set:function(e){n.set(z.some(e))},isSet:function(){return n.get().isSome()},on:function(e){n.get().each(e)}}}(),j=Le.throttle(function(){l.document.body.scrollTop=0,l.document.documentElement.scrollTop=0,l.window.requestAnimationFrame(function(){V.on(function(e){return T(e,{top:je.offsetTop+"px",left:je.offsetLeft+"px",height:je.height+"px",width:je.width+"px"})})})},50),{bind:function(e){V.set(e),j(),je.addEventListener("resize",j),je.addEventListener("scroll",j)},unbind:function(){V.on(function(){je.removeEventListener("scroll",j),je.removeEventListener("resize",j)}),V.clear()}}),ze=function(e,n){var r,t,o,i=l.document.body,u=l.document.documentElement;t=e.getContainer();var c=ne.fromDom(t),s=n.get(),f=ne.fromDom(e.getBody()),a=Re.deviceType.isTouch();if(r=t.style,o=e.getContentAreaContainer().firstChild.style,s)o.width=s.iframeWidth,o.height=s.iframeHeight,r.width=s.containerWidth,r.height=s.containerHeight,r.top=s.containerTop,r.left=s.containerLeft,a&&Be(),Ve.removeClass(i,"tox-fullscreen"),Ve.removeClass(u,"tox-fullscreen"),Ve.removeClass(t,"tox-fullscreen"),function(e){l.window.scrollTo(e.x,e.y)}(s.scrollPos),n.set(null),ke(e,!1),qe.unbind(),e.off("remove",qe.unbind);else{var d={scrollPos:function(){var e=P(l.window);return{x:e.x(),y:e.y()}}(),containerWidth:r.width,containerHeight:r.height,containerTop:r.top,containerLeft:r.left,iframeWidth:o.width,iframeHeight:o.height};a&&We(c,f),o.width=o.height="100%",r.width=r.height="",Ve.addClass(i,"tox-fullscreen"),Ve.addClass(u,"tox-fullscreen"),Ve.addClass(t,"tox-fullscreen"),qe.bind(c),e.on("remove",qe.unbind),n.set(d),ke(e,!0)}},Xe=function(e,n){e.addCommand("mceFullScreen",function(){ze(e,n)})},Ye=function(e,n){e.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Meta+Shift+F",onAction:function(){return e.execCommand("mceFullScreen")},onSetup:W(e,n)}),e.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:function(){return e.execCommand("mceFullScreen")},onSetup:W(e,n)})};!function Ge(){o.add("fullscreen",function(e){var n=t(null);return e.settings.inline||(Xe(e,n),Ye(e,n),e.addShortcut("Meta+Shift+F","","mceFullScreen")),i(n)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function e(){}function r(e){return function(){return e}}var a=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return a(t())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){e.addCommand("mceHelp",t)},s=function(e,t){e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:t}),e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:t})},c=function(){return(c=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function l(o){for(var a=[],e=1;e<arguments.length;e++)a[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.concat(e);return o.apply(null,n)}}function n(){return m}var o,u=r(!1),h=r(!0),m=(o={fold:function(e,t){return e()},is:u,isSome:u,isNone:h,getOr:f,getOrThunk:d,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:r(null),getOrUndefined:r(undefined),or:f,orThunk:d,map:n,each:e,bind:n,exists:u,forall:h,filter:n,equals:p,equals_:p,toArray:function(){return[]},toString:r("none()")},Object.freeze&&Object.freeze(o),o);function p(e){return e.isNone()}function d(e){return e()}function f(e){return e}function g(e,t){return O.call(e,t)}function b(e,t){return-1<g(e,t)}function y(e,t){for(var n=e.length,o=new Array(n),a=0;a<n;a++){var r=e[a];o[a]=t(r,a)}return o}function k(e,o){return e.replace(/\$\{([^{}]*)\}/g,function(e,t){var n=o[t];return function(e){var t=typeof e;return"string"==t||"number"==t}(n)?n.toString():e})}function v(e){var t=F(e);return function(e,t){var n=g(e,t);return-1===n?x.none():x.some(n)}(t,"versions").each(function(e){t.splice(e,1),t.push("versions")}),{tabs:e,names:t}}function w(e,t){var n,o=H(),a=B(),r=D(e),i=L(),s=c(((n={})[o.name]=o,n[a.name]=a,n[r.name]=r,n[i.name]=i,n),t.get());return function(e){return x.from(e.getParam("help_tabs"))}(e).fold(function(){return v(s)},function(e){return function(e,t){var n={},o=y(e,function(e){return"string"==typeof e?(E(t,e)&&(n[e]=t[e]),e):(n[e.name]=e).name});return{tabs:n,names:o}}(e,s)})}function A(a,r){return function(){var e=w(a,r),t=e.tabs,n=e.names,o={type:"tabpanel",tabs:function(e){for(var t=[],n=function(e){t.push(e)},o=0;o<e.length;o++)e[o].each(n);return t}(y(n,function(e){return function(e,t){return E(e,t)?x.from(e[t]):x.none()}(t,e)}))};a.windowManager.open({title:"Help",size:"medium",body:o,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})}}var C,T=function(n){function e(){return a}function t(e){return e(n)}var o=r(n),a={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:h,isNone:u,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:e,orThunk:e,map:function(e){return T(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?a:m},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(u,function(e){return t(n,e)})}};return a},x={some:T,none:n,from:function(e){return null===e||e===undefined?m:T(e)}},P=(C="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===C}),M=Array.prototype.slice,O=Array.prototype.indexOf,F=(P(Array.from)&&Array.from,Object.keys),S=Object.hasOwnProperty,E=function(e,t){return S.call(e,t)},I=[{shortcuts:["Meta + B"],action:"Bold"},{shortcuts:["Meta + I"],action:"Italic"},{shortcuts:["Meta + U"],action:"Underline"},{shortcuts:["Meta + A"],action:"Select all"},{shortcuts:["Meta + Y","Meta + Shift + Z"],action:"Redo"},{shortcuts:["Meta + Z"],action:"Undo"},{shortcuts:["Access + 1"],action:"Header 1"},{shortcuts:["Access + 2"],action:"Header 2"},{shortcuts:["Access + 3"],action:"Header 3"},{shortcuts:["Access + 4"],action:"Header 4"},{shortcuts:["Access + 5"],action:"Header 5"},{shortcuts:["Access + 6"],action:"Header 6"},{shortcuts:["Access + 7"],action:"Paragraph"},{shortcuts:["Access + 8"],action:"Div"},{shortcuts:["Access + 9"],action:"Address"},{shortcuts:["Alt + 0"],action:"Open help dialog"},{shortcuts:["Alt + F9"],action:"Focus to menubar"},{shortcuts:["Alt + F10"],action:"Focus to toolbar"},{shortcuts:["Alt + F11"],action:"Focus to element path"},{shortcuts:["Ctrl + F9"],action:"Focus to contextual toolbar"},{shortcuts:["Shift + Enter"],action:"Open popup menu for split buttons"},{shortcuts:["Meta + K"],action:"Insert link (if link plugin activated)"},{shortcuts:["Meta + S"],action:"Save (if save plugin activated)"},{shortcuts:["Meta + F"],action:"Find (if searchreplace plugin activated)"},{shortcuts:["Meta + Shift + F"],action:"Switch to or from fullscreen mode"}],_=tinymce.util.Tools.resolve("tinymce.Env"),j=function(e){var n=_.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl ",access:"Shift + Alt "},t=e.split("+"),o=y(t,function(e){var t=e.toLowerCase().trim();return E(n,t)?n[t]:e});return _.mac?o.join("").replace(/\s/,""):o.join("+")},H=function(){return{name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:y(I,function(e){var t=y(e.shortcuts,j).join(" or ");return[e.action,t]})}]}},U=tinymce.util.Tools.resolve("tinymce.util.I18n"),W=[{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"bbcode",name:"BBCode"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullpage",name:"Full Page"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"hr",name:"Horizontal Rule"},{key:"image",name:"Image"},{key:"imagetools",name:"Image Tools"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"legacyoutput",name:"Legacy Output"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"noneditable",name:"Noneditable"},{key:"pagebreak",name:"Page Break"},{key:"paste",name:"Paste"},{key:"preview",name:"Preview"},{key:"print",name:"Print"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"spellchecker",name:"Spell Checker"},{key:"tabfocus",name:"Tab Focus"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"textpattern",name:"Text Pattern"},{key:"toc",name:"Table of Contents"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"},{key:"advcode",name:"Advanced Code Editor*"},{key:"formatpainter",name:"Format Painter*"},{key:"powerpaste",name:"PowerPaste*"},{key:"tinydrive",name:"Tiny Drive*"},{key:"tinymcespellchecker",name:"Spell Checker Pro*"},{key:"a11ychecker",name:"Accessibility Checker*"},{key:"linkchecker",name:"Link Checker*"},{key:"mentions",name:"Mentions*"},{key:"mediaembed",name:"Enhanced Media Embed*"},{key:"checklist",name:"Checklist*"},{key:"casechange",name:"Case Change*"},{key:"permanentpen",name:"Permanent Pen*"},{key:"pageembed",name:"Page Embed*"},{key:"tinycomments",name:"Tiny Comments*"},{key:"advtable",name:"Advanced Tables*"},{key:"autocorrect",name:"Autocorrect*"}],D=function(e){function r(t,n){return function(e,t){for(var n=0,o=e.length;n<o;n++){var a=e[n];if(t(a,n))return x.some(a)}return x.none()}(W,function(e){return e.key===n}).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?o(e()):n},function(e){return o({name:e.name,url:"https://www.tiny.cloud/docs/plugins/"+e.key})})}var t,n,o=l(k,'<a href="${url}" target="_blank" rel="noopener">${name}</a>');return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[(n=e,null==n?"":'<div data-mce-tabstop="1" tabindex="-1">'+function(t){var e=function(e){var t=F(e.plugins);return e.settings.forced_plugins===undefined?t:function(e,t){for(var n=[],o=0,a=e.length;o<a;o++){var r=e[o];t(r,o)&&n.push(r)}return n}(t,function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}}(l(b,e.settings.forced_plugins)))}(t),n=y(e,function(e){return"<li>"+r(t,e)+"</li>"}),o=n.length,a=n.join("");return"<p><b>"+U.translate(["Plugins installed ({0}):",o])+"</b></p><ul>"+a+"</ul>"}(n)+"</div>"),(t=y(["Accessibility Checker","Advanced Code Editor","Advanced Tables","Case Change","Checklist","Tiny Comments","Tiny Drive","Enhanced Media Embed","Format Painter","Link Checker","Mentions","MoxieManager","Page Embed","Permanent Pen","PowerPaste","Spell Checker Pro"],function(e){return"<li>"+U.translate(e)+"</li>"}).join(""),'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+U.translate("Premium plugins:")+"</b></p><ul>"+t+'<li style="list-style: none; margin-top: 1em;"><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">'+U.translate("Learn more...")+"</a></li></ul></div>")].join("")}]}},N=tinymce.util.Tools.resolve("tinymce.EditorManager"),L=function(){var e,t,n='<a href="https://www.tinymce.com/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+(e=N.majorVersion,t=N.minorVersion,0===e.indexOf("@")?"X.X.X":e+"."+t)+"</a>";return{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"<p>"+U.translate(["You are using {0}",n])+"</p>",presets:"document"}]}},B=function(){return{name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",presets:"document",html:"<h1>Editor UI keyboard navigation</h1>\n\n<h2>Activating keyboard navigation</h2>\n\n<p>The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:</p>\n<ul>\n <li>Focus the menubar: Alt + F9 (Windows) or &#x2325;F9 (MacOS)</li>\n <li>Focus the toolbar: Alt + F10 (Windows) or &#x2325;F10 (MacOS)</li>\n <li>Focus the footer: Alt + F11 (Windows) or &#x2325;F11 (MacOS)</li>\n</ul>\n\n<p>Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline. </p>\n\n<h2>Moving between UI sections</h2>\n\n<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>\n<ul>\n <li>the menubar</li>\n <li>each group of the toolbar </li>\n <li>the sidebar</li>\n <li>the element path in the footer </li>\n <li>the wordcount toggle button in the footer </li>\n <li>the branding link in the footer </li>\n</ul>\n\n<p>Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.</p>\n\n<h2>Moving within UI sections</h2>\n\n<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>\n<ul>\n <li>moving between menus in the menubar</li>\n <li>moving between buttons in a toolbar group</li>\n <li>moving between items in the element path</li>\n</ul>\n\n<p>In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group. </p>\n\n<h1>Executing buttons</h1>\n\n<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>\n\n<h1>Opening, navigating and closing menus</h1>\n\n<p>When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.</p>\n\n<p>To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.</p>\n\n<h1>Context toolbars and menus</h1>\n\n<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or &#x2303;F9 (MacOS).</p>\n\n<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>\n\n<h1>Dialog navigation</h1>\n\n<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>\n\n<p>When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.</p>\n\n<p>When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.</p>"}]}};!function z(){t.add("help",function(e){var t=a({}),n=function(n){return{addTab:function(e){var t=n.get();t[e.name]=e,n.set(t)}}}(t),o=A(e,t);return s(e,o),i(e,o),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),n})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")})},t=function(n){n.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}}),n.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}})};!function e(){n.add("hr",function(n){o(n),t(n)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(s){"use strict";function o(){}function a(t){return function(){return t}}function t(t){return t}function e(){return l}var n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=a(!1),c=a(!0),l=(n={fold:function(t,e){return t()},is:u,isSome:u,isNone:c,getOr:d,getOrThunk:f,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:d,orThunk:f,map:e,each:o,bind:e,exists:u,forall:c,filter:e,equals:i,equals_:i,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(n),n);function i(t){return t.isNone()}function f(t){return t()}function d(t){return t}function m(e){return function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===e}}function v(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!U(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e}var p,g,h,y,b=function(n){function t(){return i}function e(t){return t(n)}var r=a(n),i={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:c,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return b(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?i:l},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(u,function(t){return e(n,t)})}};return i},w={some:b,none:e,from:function(t){return null===t||t===undefined?l:b(t)}},T=m("string"),_=m("object"),U=m("array"),x=m("boolean"),A=m("function"),I=Array.prototype.slice,S=Array.prototype.push,D=(A(Array.from)&&Array.from,function(){return(D=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)}),O={},C={exports:O};p=undefined,g=O,h=C,y=undefined,function(t){"object"==typeof g&&void 0!==h?h.exports=t():"function"==typeof p&&p.amd?p([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function s(o,a,u){function c(e,t){if(!a[e]){if(!o[e]){var n="function"==typeof y&&y;if(!t&&n)return n(e,!0);if(l)return l(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var i=a[e]={exports:{}};o[e][0].call(i.exports,function(t){return c(o[e][1][t]||t)},i,i.exports,s,o,a,u)}return a[e].exports}for(var l="function"==typeof y&&y,t=0;t<u.length;t++)c(u[t]);return c}({1:[function(t,e,n){var r,i,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{i="function"==typeof clearTimeout?clearTimeout:u}catch(t){i=u}}();var l,s=[],f=!1,d=-1;function m(){f&&l&&(f=!1,l.length?s=l.concat(s):d=-1,s.length&&p())}function p(){if(!f){var t=c(m);f=!0;for(var e=s.length;e;){for(l=s,s=[];++d<e;)l&&l[d].run();d=-1,e=s.length}l=null,f=!1,function n(t){if(i===clearTimeout)return clearTimeout(t);if((i===u||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function h(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new g(t,e)),1!==s.length||f||c(p)},g.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],2:[function(t,f,e){(function(e){function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],s(t,this)}function i(r,i){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,o._immediateFn(function(){var t=1===r._state?i.onFulfilled:i.onRejected;if(null!==t){var e;try{e=t(r._value)}catch(n){return void u(i.promise,n)}a(i.promise,e)}else(1===r._state?a:u)(i.promise,r._value)})):r._deferreds.push(i)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void s(function r(t,e){return function(){t.apply(e,arguments)}}(n,e),t)}t._state=1,t._value=e,c(t)}catch(i){u(t,i)}}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn(function(){t._handled||o._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function s(t,e){var n=!1;try{t(function(t){n||(n=!0,a(e,t))},function(t){n||(n=!0,u(e,t))})}catch(r){if(n)return;n=!0,u(e,r)}}var t,n;t=this,n=setTimeout,o.prototype["catch"]=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new l(t,e,n)),n},o.all=function(t){var c=Array.prototype.slice.call(t);return new o(function(i,o){if(0===c.length)return i([]);var a=c.length;function u(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){u(e,t)},o)}c[e]=t,0==--a&&i(c)}catch(r){o(r)}}for(var t=0;t<c.length;t++)u(t,c[t])})},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o(function(t){t(e)})},o.reject=function(n){return new o(function(t,e){e(n)})},o.race=function(i){return new o(function(t,e){for(var n=0,r=i.length;n<r;n++)i[n].then(t,e)})},o._immediateFn="function"==typeof e?function(t){e(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},void 0!==f&&f.exports?f.exports=o:t.Promise||(t.Promise=o)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(c,t,l){(function(t,e){var r=c("process/browser.js").nextTick,n=Function.prototype.apply,i=Array.prototype.slice,o={},a=0;function u(t,e){this._id=t,this._clearFn=e}l.setTimeout=function(){return new u(n.call(setTimeout,window,arguments),clearTimeout)},l.setInterval=function(){return new u(n.call(setInterval,window,arguments),clearInterval)},l.clearTimeout=l.clearInterval=function(t){t.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},l.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},l.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},l._unrefActive=l.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},l.setImmediate="function"==typeof t?t:function(t){var e=a++,n=!(arguments.length<2)&&i.call(arguments,1);return o[e]=!0,r(function(){o[e]&&(n?t.apply(null,n):t.call(null),l.clearImmediate(e))}),e},l.clearImmediate="function"==typeof e?e:function(t){delete o[t]}}).call(this,c("timers").setImmediate,c("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),i="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:i.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});function P(t){s.setTimeout(function(){throw t},0)}function E(t){return vt(mt(t))}function L(a){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var i=t[r];for(var o in i)wt.call(i,o)&&(n[o]=a(n[o],i[o]))}return n}}function N(t){var e=t.imageList.map(function(t){return{name:"images",type:"selectbox",label:"Image list",items:t}}),n=t.classList.map(function(t){return{name:"classes",type:"selectbox",label:"Class",items:t}});return v([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],e.toArray(),t.hasDescription?[{name:"alt",type:"input",label:"Image description"}]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{type:"grid",columns:2,items:v([n.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]])}function j(t,e){return Math.max(parseInt(t,10),parseInt(e,10))}function R(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?Et(t.style.marginLeft):""}function F(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?Et(t.style.marginTop):""}function k(t){return t.style.borderWidth?Et(t.style.borderWidth):""}function z(t,e){return t.hasAttribute(e)?t.getAttribute(e):""}function M(t,e){return t.style[e]?t.style[e]:""}function H(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName}function B(t,e,n){t.setAttribute(e,n)}function G(t){H(t)?function(t){var e=t.parentNode;zt.insertAfter(t,e),zt.remove(e)}(t):function(t){var e=zt.create("figure",{"class":"image"});zt.insertAfter(e,t),e.appendChild(t),e.appendChild(zt.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"}(t)}function W(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");0<r.length?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")}function q(t,r){return function(t,e,n){t.style[e]?(t.style[e]=Lt(n),W(t,r)):B(t,e,n)}}function $(t,e){return t.style[e]?Et(t.style[e]):z(t,e)}function J(t,e){var n=Lt(e);t.style.marginLeft=n,t.style.marginRight=n}function V(t,e){var n=Lt(e);t.style.marginTop=n,t.style.marginBottom=n}function X(t,e){var n=Lt(e);t.style.borderWidth=n}function Z(t,e){t.style.borderStyle=e}function K(t){return"FIGURE"===t.nodeName}function Q(t,e){var n=s.document.createElement("img");return B(n,"style",e.style),!R(n)&&""===e.hspace||J(n,e.hspace),!F(n)&&""===e.vspace||V(n,e.vspace),!k(n)&&""===e.border||X(n,e.border),!function(t){return M(t,"borderStyle")}(n)&&""===e.borderStyle||Z(n,e.borderStyle),t(n.getAttribute("style"))}function Y(t,e){return{src:z(e,"src"),alt:z(e,"alt"),title:z(e,"title"),width:$(e,"width"),height:$(e,"height"),"class":z(e,"class"),style:t(z(e,"style")),caption:H(e),hspace:R(e),vspace:F(e),border:k(e),borderStyle:M(e,"borderStyle")}}function tt(t,e,n,r,i){n[r]!==e[r]&&i(t,r,n[r])}function et(r,i){return function(t,e,n){r(t,n),W(t,i)}}function nt(t,e){var n=t.dom.styles.parse(e),r=Nt(n),i=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(i)}function rt(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||kt(e))?null:e}function it(e,t){var n=e.dom,r=n.getParent(t.parentNode,function(t){return e.schema.getTextBlockElements()[t.nodeName]},e.getBody());return r?n.split(r,t):t}function ot(e,t){var n=function(t,e){var n=s.document.createElement("img");if(Mt(t,_t(e,{caption:!1}),n),B(n,"alt",e.alt),e.caption){var r=zt.create("figure",{"class":"image"});return r.appendChild(n),r.appendChild(zt.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}(function(t){return nt(e,t)},t);e.dom.setAttrib(n,"data-mce-id","__mcenew"),e.focus(),e.selection.setContent(n.outerHTML);var r=e.dom.select('*[data-mce-id="__mcenew"]')[0];if(e.dom.setAttrib(r,"data-mce-id",null),K(r)){var i=it(e,r);e.selection.select(i)}else e.selection.select(r)}function at(t,e){var n=rt(t);n?e.src?function(e,t){var n=rt(e);if(Mt(function(t){return nt(e,t)},t,n),function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))}(e,n),K(n.parentNode)){var r=n.parentNode;it(e,r),e.selection.select(n.parentNode)}else e.selection.select(n),Rt(e,t,n)}(t,e):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,n):e.src&&ot(t,e)}function ut(t){return T(t.value)?t.value:""}function ct(e){return void 0===e&&(e=ut),function(t){return t?w.from(t).map(function(t){return Bt(t,e)}):w.none()}}var lt=C.exports.boltExport,st=function(t){var n=w.none(),e=[],r=function(t){i()?a(t):e.push(t)},i=function(){return n.isSome()},o=function(t){!function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}}(t,a)},a=function(e){n.each(function(t){s.setTimeout(function(){e(t)},0)})};return t(function(t){n=w.some(t),o(e),e=[]}),{get:r,map:function(n){return st(function(e){r(function(t){e(n(t))})})},isReady:i}},ft={nu:st,pure:function(e){return st(function(t){t(e)})}},dt=function(n){function t(t){n().then(t,P)}return{map:function(t){return dt(function(){return n().then(t)})},bind:function(e){return dt(function(){return n().then(function(t){return e(t).toPromise()})})},anonBind:function(t){return dt(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return ft.nu(t)},toCached:function(){var t=null;return dt(function(){return null===t&&(t=n()),t})},toPromise:n,get:t}},mt=function(t){return dt(function(){return new lt(t)})},pt=function(t){return dt(function(){return lt.resolve(t)})},gt=function(n){return{is:function(t){return n===t},isValue:c,isError:u,getOr:a(n),getOrThunk:a(n),getOrDie:a(n),or:function(t){return gt(n)},orThunk:function(t){return gt(n)},fold:function(t,e){return e(n)},map:function(t){return gt(t(n))},mapError:function(t){return gt(n)},each:function(t){t(n)},bind:function(t){return t(n)},exists:function(t){return t(n)},forall:function(t){return t(n)},toOption:function(){return w.some(n)}}},ht=function(n){return{is:u,isValue:u,isError:c,getOr:t,getOrThunk:function(t){return t()},getOrDie:function(){return function(t){return function(){throw new Error(t)}}(String(n))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,e){return t(n)},map:function(t){return ht(n)},mapError:function(t){return ht(t(n))},each:o,bind:function(t){return ht(n)},exists:u,forall:c,toOption:w.none}},yt={value:gt,error:ht,fromOption:function(t,e){return t.fold(function(){return ht(e)},gt)}},vt=function(o){return D(D({},o),{toCached:function(){return vt(o.toCached())},bindFuture:function(e){return vt(o.bind(function(t){return t.fold(function(t){return pt(yt.error(t))},function(t){return e(t)})}))},bindResult:function(e){return vt(o.map(function(t){return t.bind(e)}))},mapResult:function(e){return vt(o.map(function(t){return t.map(e)}))},mapError:function(e){return vt(o.map(function(t){return t.mapError(e)}))},foldResult:function(e,n){return o.map(function(t){return t.fold(e,n)})},withTimeout:function(t,i){return vt(mt(function(e){var n=!1,r=s.setTimeout(function(){n=!0,e(yt.error(i()))},t);o.get(function(t){n||(s.clearTimeout(r),e(t))})}))}})},bt=E,wt=Object.prototype.hasOwnProperty,Tt=L(function(t,e){return _(t)&&_(e)?Tt(t,e):e}),_t=L(function(t,e){return e}),Ut=function(t){return{title:"General",name:"general",items:N(t)}},xt=N,At=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),It=tinymce.util.Tools.resolve("tinymce.util.Promise"),St=tinymce.util.Tools.resolve("tinymce.util.XHR"),Dt=function(t){return t.getParam("images_upload_url","","string")},Ot=function(t){return t.getParam("images_upload_handler",undefined,"function")},Ct={hasDimensions:function(t){return t.getParam("image_dimensions",!0,"boolean")},hasUploadTab:function(t){return t.getParam("image_uploadtab",!0,"boolean")},hasAdvTab:function(t){return t.getParam("image_advtab",!1,"boolean")},getPrependUrl:function(t){return t.getParam("image_prepend_url","","string")},getClassList:function(t){return t.getParam("image_class_list")},hasDescription:function(t){return t.getParam("image_description",!0,"boolean")},hasImageTitle:function(t){return t.getParam("image_title",!1,"boolean")},hasImageCaption:function(t){return t.getParam("image_caption",!1,"boolean")},getImageList:function(t){return t.getParam("image_list",!1)},hasUploadUrl:function(t){return!!Dt(t)},hasUploadHandler:function(t){return!!Ot(t)},getUploadUrl:Dt,getUploadHandler:Ot,getUploadBasePath:function(t){return t.getParam("images_upload_base_path",undefined,"string")},getUploadCredentials:function(t){return t.getParam("images_upload_credentials",!1,"boolean")}},Pt=function(t,e){function n(t){r.parentNode&&r.parentNode.removeChild(r),e(t)}var r=s.document.createElement("img");r.onload=function(){var t={width:j(r.width,r.clientWidth),height:j(r.height,r.clientHeight)};n(yt.value(t))},r.onerror=function(){n(yt.error("Failed to get image dimensions for: "+t))};var i=r.style;i.visibility="hidden",i.position="fixed",i.bottom=i.left="0px",i.width=i.height="auto",s.document.body.appendChild(r),r.src=t},Et=function(t){return t=t&&t.replace(/px$/,"")},Lt=function(t){return 0<t.length&&/^[0-9]+$/.test(t)&&(t+="px"),t},Nt=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},jt=function(t,e){var n=Ct.getImageList(t);"string"==typeof n?St.send({url:n,success:function(t){e(JSON.parse(t))}}):"function"==typeof n?n(e):e(n)},Rt=function(t,e,n){function r(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())}n.onload=function(){e.width||e.height||!Ct.hasDimensions(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r},Ft=function(r){return new It(function(t,e){var n=new s.FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(r)})},kt=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},zt=At.DOM,Mt=function(t,e,n){var r=Y(t,n);tt(n,r,e,"caption",function(t,e,n){return G(t)}),tt(n,r,e,"src",B),tt(n,r,e,"alt",B),tt(n,r,e,"title",B),tt(n,r,e,"width",q(0,t)),tt(n,r,e,"height",q(0,t)),tt(n,r,e,"class",B),tt(n,r,e,"style",et(function(t,e){return B(t,"style",e)},t)),tt(n,r,e,"hspace",et(J,t)),tt(n,r,e,"vspace",et(V,t)),tt(n,r,e,"border",et(X,t)),tt(n,r,e,"borderStyle",et(Z,t))},Ht=tinymce.util.Tools.resolve("tinymce.util.Tools"),Bt=function(t,i){var o=[];return Ht.each(t,function(t){var e=T(t.text)?t.text:T(t.title)?t.title:"";if(t.menu!==undefined){var n=Bt(t.menu,i);o.push({text:e,items:n})}else{var r=i(t);o.push({text:e,value:r})}}),o},Gt=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return w.none()}(t,function(t){return function(t){return Object.prototype.hasOwnProperty.call(t,"items")}(t)?Gt(t.items,e):t.value===e?w.some(t):w.none()})},Wt=ct,qt=function(t){return ct(ut)(t)},$t=function(t,e){return t.bind(function(t){return Gt(t,e)})};function Jt(a){function e(t,e,n,r){var i,o;(i=new s.XMLHttpRequest).open("POST",a.url),i.withCredentials=a.credentials,i.upload.onprogress=function(t){r(t.loaded/t.total*100)},i.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var t;i.status<200||300<=i.status?n("HTTP Error: "+i.status):(t=JSON.parse(i.responseText))&&"string"==typeof t.location?e(function(t,e){return t?t.replace(/\/$/,"")+"/"+e.replace(/^\//,""):e}(a.basePath,t.location)):n("Invalid JSON: "+i.responseText)},(o=new s.FormData).append("file",t.blob(),t.filename()),i.send(o)}return a=Ht.extend({credentials:!1,handler:e},a),{upload:function(t){return!a.url&&function(t){return t===e}(a.handler)?It.reject("Upload url missing from the settings."):function(r,i){return new It(function(t,e){try{i(r,t,e,o)}catch(n){e(n.message)}})}(t,a.handler)}}}function Vt(n){var r=Wt(function(t){return n.convertURL(t.value||t.url,"src")}),t=mt(function(e){jt(n,function(t){e(r(t).map(function(t){return v([[{text:"None",value:""}],t])}))})}),e=qt(Ct.getClassList(n)),i=Ct.hasAdvTab(n),o=Ct.hasUploadTab(n),a=Ct.hasUploadUrl(n),u=Ct.hasUploadHandler(n),c=function(e){var t=rt(e);return t?Y(function(t){return nt(e,t)},t):{src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""}}(n),l=Ct.hasDescription(n),s=Ct.hasImageTitle(n),f=Ct.hasDimensions(n),d=Ct.hasImageCaption(n),m=Ct.getUploadUrl(n),p=Ct.getUploadBasePath(n),g=Ct.getUploadCredentials(n),h=Ct.getUploadHandler(n),y=w.some(Ct.getPrependUrl(n)).filter(function(t){return T(t)&&0<t.length});return t.map(function(t){return{image:c,imageList:t,classList:e,hasAdvTab:i,hasUploadTab:o,hasUploadUrl:a,hasUploadHandler:u,hasDescription:l,hasImageTitle:s,hasDimensions:f,hasImageCaption:d,url:m,basePath:p,credentials:g,handler:h,prependURL:y}})}function Xt(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t["class"],caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[]}}function Zt(t){return{src:t.src.value,alt:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,"class":t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle}}function Kt(t,e){var n=e.getData();(function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?w.none():t.prependURL.bind(function(t){return e.substring(0,t.length)!==t?w.some(t+e):w.none()})})(t,n.src.value).each(function(t){e.setData({src:{value:t,meta:n.src.meta}})})}function Qt(t,e){var n=e.getData(),r=n.src.meta;if(r!==undefined){var i=Tt({},n);!function(t,e,n){t.hasDescription&&T(n.alt)&&(e.alt=n.alt),t.hasImageTitle&&T(n.title)&&(e.title=n.title),t.hasDimensions&&(T(n.width)&&(e.dimensions.width=n.width),T(n.height)&&(e.dimensions.height=n.height)),T(n["class"])&&$t(t.classList,n["class"]).each(function(t){e.classes=t.value}),t.hasImageCaption&&x(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(T(n.vspace)&&(e.vspace=n.vspace),T(n.border)&&(e.border=n.border),T(n.hspace)&&(e.hspace=n.hspace),T(n.borderstyle)&&(e.borderstyle=n.borderstyle))}(t,i,r),e.setData(i)}}function Yt(t,e,n,r){Kt(e,r),Qt(e,r),function(t,e,n,r){var i=r.getData(),o=i.src.value,a=i.src.meta||{};a.width||a.height||!e.hasDimensions||t.imageSize(o).get(function(t){t.each(function(t){n.open&&r.setData({dimensions:t})})})}(t,e,n,r),function(t,e,n){var r=n.getData(),i=$t(t.imageList,r.src.value);e.prevImage=i,n.setData({images:i.map(function(t){return t.value}).getOr("")})}(e,n,r)}function te(t,e,n){var r=Nt(t(n.style)),i=Tt({},n);return i.vspace=function(t){return t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"]?Et(String(t["margin-top"])):""}(r),i.hspace=function(t){return t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"]?Et(String(t["margin-right"])):""}(r),i.border=function(t){return t["border-width"]?Et(String(t["border-width"])):""}(r),i.borderstyle=function(t){return t["border-style"]?String(t["border-style"]):""}(r),i.style=function(t,e,n){return e(t(e(n)))}(t,e,r),i}function ee(a,u,c,l){var t=l.getData();l.block("Uploading image"),function(t){return 0===t.length?w.none():w.some(t[0])}(t.fileinput).fold(function(){l.unblock()},function(n){function r(){l.unblock(),s.URL.revokeObjectURL(i)}var i=s.URL.createObjectURL(n),o=Jt({url:u.url,basePath:u.basePath,credentials:u.credentials,handler:u.handler});Ft(n).then(function(t){var e=a.createBlobCache(n,i,t);o.upload(e).then(function(t){l.setData({src:{value:t,meta:{}}}),l.showTab("general"),Yt(a,u,c,l),r()})["catch"](function(t){r(),a.alertErr(l,t)})})})}function ne(n,r,i){return function(t,e){"src"===e.name?Yt(n,r,i,t):"images"===e.name?function(t,e,n,r){var i=r.getData(),o=$t(e.imageList,i.images);o.each(function(t){""===i.alt||n.prevImage.map(function(t){return t.text===i.alt}).getOr(!1)?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})}),n.prevImage=o,Yt(t,e,n,r)}(n,r,i,t):"alt"===e.name?i.prevAlt=t.getData().alt:"style"===e.name?function(t,e){var n=e.getData(),r=te(t.parseStyle,t.serializeStyle,n);e.setData(r)}(n,t):"vspace"===e.name||"hspace"===e.name||"border"===e.name||"borderstyle"===e.name?function(t,e,n){var r=Tt(Xt(e.image),n.getData()),i=Q(t.normalizeCss,Zt(r));n.setData({style:i})}(n,r,t):"fileinput"===e.name&&ee(n,r,i,t)}}function re(n){return function(t){var e=function(t){return{prevImage:$t(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}}(t);return{title:"Insert/Edit Image",size:"normal",body:function(t){return t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler?{type:"tabpanel",tabs:v([[Ut(t)],t.hasAdvTab?[ae(t)]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[ue(t)]:[]])}:{type:"panel",items:xt(t)}}(t),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Xt(t.image),onSubmit:n.onSubmit(t),onChange:ne(n,t,e),onClose:function(t){return function(){t.open=!1}}(e)}}}function ie(e){var t={onSubmit:function(r){return function(n){return function(t){var e=Tt(Xt(n.image),t.getData());r.undoManager.transact(function(){at(r,Zt(e))}),r.editorUpload.uploadImagesAuto(),t.close()}}}(e),imageSize:function(e){return function(t){return bt(function(n){Pt(e.documentBaseURI.toAbsolute(t),function(t){var e=t.map(function(t){return{width:String(t.width),height:String(t.height)}});n(e)})})}}(e),createBlobCache:function(r){return function(t,e,n){return r.editorUpload.blobCache.create({blob:t,blobUri:e,name:t.name?t.name.replace(/\.[^\.]+$/,""):null,base64:n.split(",")[1]})}}(e),alertErr:function(n){return function(t,e){n.windowManager.alert(e,t.close)}}(e),normalizeCss:function(e){return function(t){return nt(e,t)}}(e),parseStyle:function(e){return function(t){return e.dom.parseStyle(t)}}(e),serializeStyle:function(n){return function(t,e){return n.dom.serializeStyle(t,e)}}(e)};return{open:function(){return Vt(e).map(re(t)).get(function(t){e.windowManager.open(t)})}}}function oe(o){return function(t){for(var e,n=t.length,r=function(t){t.attr("contenteditable",o?"true":null)};n--;){var i=t[n];void 0,(e=i.attr("class"))&&/\bimage\b/.test(e)&&(i.attr("contenteditable",o?"false":null),Ht.each(i.getAll("figcaption"),r))}}}var ae=function(t){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"selectbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},ue=function(t){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}},ce=function(t){t.addCommand("mceImage",ie(t).open)},le=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("figure",oe(!0)),t.serializer.addNodeFilter("figure",oe(!1))})},se=function(e){e.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ie(e).open,onSetup:function(t){return e.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",t.setActive).unbind}}),e.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:ie(e).open}),e.ui.registry.addContextMenu("image",{update:function(t){return K(t)||function(t){return"IMG"===t.nodeName}(t)&&!kt(t)?["image"]:[]}})};!function fe(){r.add("image",function(t){le(t),se(t),ce(t)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(v){"use strict";function e(){}function n(){return c}var t,r=function(e){function n(){return t}var t=e;return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(e){return function(){return e}},u=d(!1),a=d(!0),c=(t={fold:function(e,n){return e()},is:u,isSome:u,isNone:a,getOr:l,getOrThunk:f,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(undefined),or:l,orThunk:f,map:n,each:e,bind:n,exists:u,forall:a,filter:n,equals:s,equals_:s,toArray:function(){return[]},toString:d("none()")},Object.freeze&&Object.freeze(t),t);function s(e){return e.isNone()}function f(e){return e()}function l(e){return e}var m=function(t){function e(){return o}function n(e){return e(t)}var r=d(t),o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:a,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return m(e(t))},each:function(e){e(t)},bind:n,exists:n,forall:n,filter:function(e){return e(t)?o:c},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,function(e){return n(t,e)})}};return o},p={some:m,none:n,from:function(e){return null===e||e===undefined?c:m(e)}};function h(e,n){return y(v.document.createElement("canvas"),e,n)}function g(e){var n=h(e.width,e.height);return w(n).drawImage(e,0,0),n}function w(e){return e.getContext("2d")}function y(e,n,t){return e.width=n,e.height=t,e}var b,E,O=window.Promise?window.Promise:(b=T.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(e){v.setTimeout(e,1)},E=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},T.prototype["catch"]=function(e){return this.then(null,e)},T.prototype.then=function(t,r){var o=this;return new T(function(e,n){N.call(o,new R(t,r,e,n))})},T.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var c=Array.prototype.slice.call(1===e.length&&E(e[0])?e[0]:e);return new T(function(o,i){if(0===c.length)return o([]);var u=c.length;function a(n,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void t.call(e,function(e){a(n,e)},i)}c[n]=e,0==--u&&o(c)}catch(r){i(r)}}for(var e=0;e<c.length;e++)a(e,c[e])})},T.resolve=function(n){return n&&"object"==typeof n&&n.constructor===T?n:new T(function(e){e(n)})},T.reject=function(t){return new T(function(e,n){n(t)})},T.race=function(o){return new T(function(e,n){for(var t=0,r=o;t<r.length;t++)r[t].then(e,n)})},T);function T(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],A(e,I(S,this),I(_,this))}function I(e,n){return function(){return e.apply(n,arguments)}}function N(r){var o=this;null!==this._state?b(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var n;try{n=e(o._value)}catch(t){return void r.reject(t)}r.resolve(n)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function S(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void A(I(n,e),I(S,this),I(_,this))}this._state=!0,this._value=e,x.call(this)}catch(t){_.call(this,t)}}function _(e){this._state=!1,this._value=e,x.call(this)}function x(){for(var e=0,n=this._deferreds;e<n.length;e++){var t=n[e];N.call(this,t)}this._deferreds=[]}function R(e,n,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.resolve=t,this.reject=r}function A(e,n,t){var r=!1;try{e(function(e){r||(r=!0,n(e))},function(e){r||(r=!0,t(e))})}catch(o){if(r)return;r=!0,t(o)}}function C(e){var n=e.src;return 0===n.indexOf("data:")?U(n):function t(r){return new O(function(e,t){var n=new v.XMLHttpRequest;n.open("GET",r,!0),n.responseType="blob",n.onload=function(){200===this.status&&e(this.response)},n.onerror=function(){var e,n=this;t(0===this.status?((e=new Error("No access to download image")).code=18,e.name="SecurityError",e):new Error("Error "+n.status+" downloading image"))},n.send()})}(n)}function D(a){return new O(function(e,n){var t=v.URL.createObjectURL(a),r=new v.Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",u)};function i(){o(),e(r)}function u(){o(),n("Unable to load data of type "+a.type+": "+t)}r.addEventListener("load",i),r.addEventListener("error",u),r.src=t,r.complete&&i()})}function U(t){return new O(function(e,n){(function g(e){var n=e.split(","),t=/data:([^;]+)/.exec(n[0]);if(!t)return p.none();for(var r=t[1],o=n[1],i=v.atob(o),u=i.length,a=Math.ceil(u/1024),c=new Array(a),s=0;s<a;++s){for(var f=1024*s,l=Math.min(1024+f,u),d=new Array(l-f),m=f,h=0;m<l;++h,++m)d[h]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return p.some(new v.Blob(c,{type:r}))})(t).fold(function(){n("uri is not base64: "+t)},e)})}function L(e,r,o){return r=r||"image/png",v.HTMLCanvasElement.prototype.toBlob?new O(function(n,t){e.toBlob(function(e){e?n(e):t()},r,o)}):U(e.toDataURL(r,o))}function k(e){return D(e).then(function(e){!function t(e){v.URL.revokeObjectURL(e.src)}(e);var n=h(function r(e){return e.naturalWidth||e.width}(e),function o(e){return e.naturalHeight||e.height}(e));return w(n).drawImage(e,0,0),n})}function j(e,n,t){var r=n.type;function o(n,t){return e.then(function(e){return function r(e,n,t){return n=n||"image/png",e.toDataURL(n,t)}(e,n,t)})}return{getType:d(r),toBlob:function i(){return O.resolve(n)},toDataURL:function u(){return t},toBase64:function a(){return t.split(",")[1]},toAdjustedBlob:function c(n,t){return e.then(function(e){return L(e,n,t)})},toAdjustedDataURL:o,toAdjustedBase64:function s(e,n){return o(e,n).then(function(e){return e.split(",")[1]})},toCanvas:function f(){return e.then(g)}}}function P(n){return function e(t){return new O(function(e){var n=new v.FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)})}(n).then(function(e){return j(k(n),n,e)})}function M(n,e){return L(n,e).then(function(e){return j(O.resolve(n),e,n.toDataURL())})}function B(n,t){return n.toCanvas().then(function(e){return function a(e,n,t){var r=h(e.width,e.height),o=w(r),i=0,u=0;90!==(t=t<0?360+t:t)&&270!==t||y(r,r.height,r.width);90!==t&&180!==t||(i=r.width);270!==t&&180!==t||(u=r.height);return o.translate(i,u),o.rotate(t*Math.PI/180),o.drawImage(e,0,0),M(r,n)}(e,n.getType(),t)})}function F(n,t){return n.toCanvas().then(function(e){return function i(e,n,t){var r=h(e.width,e.height),o=w(r);"v"===t?(o.scale(1,-1),o.drawImage(e,0,-r.height)):(o.scale(-1,1),o.drawImage(e,-r.width,0));return M(r,n)}(e,n.getType(),t)})}function z(e){return P(e)}var H=tinymce.util.Tools.resolve("tinymce.util.Delay"),q=tinymce.util.Tools.resolve("tinymce.util.Promise"),$=tinymce.util.Tools.resolve("tinymce.util.URI");function X(e,n){for(var t=0,r=e.length;t<r;t++){var o=e[t];if(n(o,t))return p.some(o)}return p.none()}function W(e){return null!==e&&e!==undefined}function G(n){return"ImageProxy HTTP error: "+X(ue,function(e){return n===e.code}).fold(d("Unknown ImageProxy error"),function(e){return e.message})}function Y(e){var n=G(e);return q.reject(n)}function V(n){return X(ae,function(e){return e.type===n}).fold(d("Unknown service error"),function(e){return e.message})}function J(e,n){return re(n).then(function(e){var n=function(e){var n=ie(e),t=te(n,["error","type"]);return"ImageProxy Service error: "+(t?V(t):"Invalid JSON in service error message")}(e);return q.reject(n)})}function K(e,n){var t={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":n};return oe(function(e,n){var t=-1===e.indexOf("?")?"?":"&";return/[?&]apiKey=/.test(e)||!n?e:e+t+"apiKey="+encodeURIComponent(n)}(e,n),t,!1).then(function(e){return e.status<200||300<=e.status?ce(e.status,e.blob):q.resolve(e.blob)})}var Q,Z={getImageSize:function wn(e){var n,t;function r(e){return/^[0-9\.]+px$/.test(e)}return n=e.style.width,t=e.style.height,n||t?r(n)&&r(t)?{w:parseInt(n,10),h:parseInt(t,10)}:null:(n=e.width,t=e.height,n&&t?{w:parseInt(n,10),h:parseInt(t,10)}:null)},setImageSize:function yn(e,n){var t,r;n&&(t=e.style.width,r=e.style.height,(t||r)&&(e.style.width=n.w+"px",e.style.height=n.h+"px",e.removeAttribute("data-mce-style")),t=e.width,r=e.height,(t||r)&&(e.setAttribute("width",n.w),e.setAttribute("height",n.h)))},getNaturalImageSize:function bn(e){return{w:e.naturalWidth,h:e.naturalHeight}}},ee=(Q="function",function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===Q}),ne=Array.prototype.slice,te=(ee(Array.from)&&Array.from,function(e,n){var t;return t=n.reduce(function(e,n){return W(e)?e[n]:undefined},e),W(t)?t:null}),re=function(n){return new q(function(t){var e=new v.FileReader;e.onload=function(e){var n=e.target;t(n.result)},e.readAsText(n)})},oe=function(n,r,o){return new q(function(e){var t;(t=new v.XMLHttpRequest).onreadystatechange=function(){4===t.readyState&&e({status:t.status,blob:this.response})},t.open("GET",n,!0),t.withCredentials=o,i.each(r,function(e,n){t.setRequestHeader(n,e)}),t.responseType="blob",t.send()})},ie=function(e){var n;try{n=JSON.parse(e)}catch(t){}return n},ue=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],ae=[{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],ce=function(e,n){return function(e){return 400===e||403===e||500===e}(e)?J(0,n):Y(e)},se=Y;function fe(e,n,t){return n?K(e,n):function r(e,n){return oe(e,{},n).then(function(e){return e.status<200||300<=e.status?se(e.status):q.resolve(e.blob)})}(e,t)}function le(e,n,t){return 0!=(e.compareDocumentPosition(n)&t)}function de(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};function r(e){return Number(n.replace(t,"$"+e))}return Ce(r(1),r(2))}function me(e,n){return function(){return n===e}}function he(e,n){return function(){return n===e}}function ge(e,n){var t=String(n).toLowerCase();return X(e,function(e){return e.search(t)})}function ve(e,n){return-1!==e.indexOf(n)}function pe(n){return function(e){return ve(e,n)}}function we(e,n){return function(e,n){return X(e.dom().childNodes,function(e){return n(Je.fromDom(e))}).map(Je.fromDom)}(e,function(e){return function(e,n){var t=e.dom();if(t.nodeType!==Qe)return!1;var r=t;if(r.matches!==undefined)return r.matches(n);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(n);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(n);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}(e,n)})}function ye(e){return we(Je.fromDom(e),"img")}function be(e,n){return e.dom.is(n,"figure")}function Ee(e,n){e.notificationManager.open({text:n,type:"error"})}function Oe(e){var n=e.selection.getNode();return be(e,n)?ye(n):p.some(Je.fromDom(n))}function Te(e,n){var t,r=n.src;return nn(e,n)?fe(n.src,null,function(e,n){return-1!==i.inArray(function(e){return e.getParam("imagetools_credentials_hosts",[],"string[]")}(e),new $(n.src).host)}(e,n)):en(e,n)?function(e){return C(e)}(n):(r=function(e){return e.getParam("imagetools_proxy")}(e),r+=(-1===r.indexOf("?")?"?":"&")+"url="+encodeURIComponent(n.src),t=function(e){return e.getParam("api_key",e.getParam("imagetools_api_key","","string"),"string")}(e),fe(r,t,!1))}function Ie(e,n){return function(e){return p.from(e.getParam("imagetools_fetch_image",null,"function"))}(e).fold(function(){return Te(e,n)},function(e){return e(n)})}function Ne(e,n){var t;return(t=e.editorUpload.blobCache.getByUri(n.src))?q.resolve(t.blob()):Ie(e,n)}function Se(e){H.clearTimeout(e.get())}function _e(i,u,a,c,s,f){return u.toBlob().then(function(e){var n,t,r,o;return r=i.editorUpload.blobCache,n=s.src,function(e){return e.getParam("images_reuse_filename",!1,"boolean")}(i)&&(t=(o=r.getByUri(n))?(n=o.uri(),o.name()):function(e,n){var t=n.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i);return t?e.dom.encode(t[1]):null}(i,n)),o=r.create({id:"imagetools"+Ze++,blob:e,base64:u.toBase64(),uri:n,name:t}),r.add(o),i.undoManager.transact(function(){i.$(s).on("load",function e(){i.$(s).off("load",e),i.nodeChanged(),a?i.editorUpload.uploadImagesAuto():(Se(c),function(e,n){var t=H.setEditorTimeout(e,function(){e.editorUpload.uploadImagesAuto()},function(e){return e.getParam("images_upload_timeout",3e4,"number")}(e));n.set(t)}(i,c))}),f&&i.$(s).attr({width:f.w,height:f.h}),i.$(s).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})}function xe(t,r,e,o){return function(){return Oe(t).fold(function(){Ee(t,"Could not find selected image")},function(n){return t._scanForImages().then(function(){return Ne(t,n.dom())}).then(z).then(e).then(function(e){return _e(t,e,!1,r,n.dom(),o)},function(e){Ee(t,e)})})}}var Re=function(e,n){return le(e,n,v.Node.DOCUMENT_POSITION_CONTAINED_BY)},Ae=function(){return Ce(0,0)},Ce=function(e,n){return{major:e,minor:n}},De={nu:Ce,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?Ae():de(e,t)},unknown:Ae},Ue="Firefox",Le=function(e){var n=e.current;return{current:n,version:e.version,isEdge:me("Edge",n),isChrome:me("Chrome",n),isIE:me("IE",n),isOpera:me("Opera",n),isFirefox:me(Ue,n),isSafari:me("Safari",n)}},ke={unknown:function(){return Le({current:undefined,version:De.unknown()})},nu:Le,edge:d("Edge"),chrome:d("Chrome"),ie:d("IE"),opera:d("Opera"),firefox:d(Ue),safari:d("Safari")},je="Windows",Pe="Android",Me="Solaris",Be="FreeBSD",Fe=function(e){var n=e.current;return{current:n,version:e.version,isWindows:he(je,n),isiOS:he("iOS",n),isAndroid:he(Pe,n),isOSX:he("OSX",n),isLinux:he("Linux",n),isSolaris:he(Me,n),isFreeBSD:he(Be,n)}},ze={unknown:function(){return Fe({current:undefined,version:De.unknown()})},nu:Fe,windows:d(je),ios:d("iOS"),android:d(Pe),linux:d("Linux"),osx:d("OSX"),solaris:d(Me),freebsd:d(Be)},He=function(e,t){return ge(e,t).map(function(e){var n=De.detect(e.versionRegexes,t);return{current:e.name,version:n}})},qe=function(e,t){return ge(e,t).map(function(e){var n=De.detect(e.versionRegexes,t);return{current:e.name,version:n}})},$e=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Xe=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return ve(e,"edge/")&&ve(e,"chrome")&&ve(e,"safari")&&ve(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,$e],search:function(e){return ve(e,"chrome")&&!ve(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return ve(e,"msie")||ve(e,"trident")}},{name:"Opera",versionRegexes:[$e,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:pe("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:pe("firefox")},{name:"Safari",versionRegexes:[$e,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(ve(e,"safari")||ve(e,"mobile/"))&&ve(e,"applewebkit")}}],We=[{name:"Windows",search:pe("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return ve(e,"iphone")||ve(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:pe("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:pe("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:pe("linux"),versionRegexes:[]},{name:"Solaris",search:pe("sunos"),versionRegexes:[]},{name:"FreeBSD",search:pe("freebsd"),versionRegexes:[]}],Ge={browsers:d(Xe),oses:d(We)},Ye=r(function(e,n){var t=Ge.browsers(),r=Ge.oses(),o=He(t,e).fold(ke.unknown,ke.nu),i=qe(r,e).fold(ze.unknown,ze.nu);return{browser:o,os:i,deviceType:function(e,n,t,r){var o=e.isiOS()&&!0===/ipad/i.test(t),i=e.isiOS()&&!o,u=e.isiOS()||e.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,f=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(t),l=!s&&!c&&!f;return{isiPad:d(o),isiPhone:d(i),isTablet:d(c),isPhone:d(s),isTouch:d(a),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:d(f),isDesktop:d(l)}}(i,o,e,n)}}(v.navigator.userAgent,function(e){return v.window.matchMedia(e).matches})),Ve=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:d(e)}},Je={fromHtml:function(e,n){var t=(n||v.document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw v.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Ve(t.childNodes[0])},fromTag:function(e,n){var t=(n||v.document).createElement(e);return Ve(t)},fromText:function(e,n){var t=(n||v.document).createTextNode(e);return Ve(t)},fromDom:Ve,fromPoint:function(e,n,t){var r=e.dom();return p.from(r.elementFromPoint(n,t)).map(Ve)}},Ke=(v.Node.ATTRIBUTE_NODE,v.Node.CDATA_SECTION_NODE,v.Node.COMMENT_NODE,v.Node.DOCUMENT_NODE,v.Node.DOCUMENT_TYPE_NODE,v.Node.DOCUMENT_FRAGMENT_NODE,v.Node.ELEMENT_NODE),Qe=(v.Node.TEXT_NODE,v.Node.PROCESSING_INSTRUCTION_NODE,v.Node.ENTITY_REFERENCE_NODE,v.Node.ENTITY_NODE,v.Node.NOTATION_NODE,Ke),Ze=(Ye.get().browser.isIE(),"undefined"!=typeof v.window?v.window:Function("return this;")(),0),en=function(e,n){var t=n.src;return 0===t.indexOf("data:")||0===t.indexOf("blob:")||new $(t).host===e.documentBaseURI.host},nn=function(e,n){return-1!==i.inArray(function(e){return e.getParam("imagetools_cors_hosts",[],"string[]")}(e),new $(n.src).host)},tn=function(n,t,r){return function(){var e=Oe(n).fold(function(){return null},function(e){var n=Z.getImageSize(e.dom());return n?{w:n.h,h:n.w}:null});return xe(n,t,function(e){return function(e,n){return B(e,n)}(e,r)},e)()}},rn=function(e,n,t){return function(){return xe(e,n,function(e){return function(e,n){return F(e,n)}(e,t)})()}},on=function(n,e){function t(e){return function(e){return n.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")}(e)&&(en(n,e)||nn(n,e)||n.settings.imagetools_proxy)}return be(n,e)?ye(e).map(function(e){return t(e.dom())?p.some(e.dom()):p.none()}):t(e)?p.some(e):p.none()},un=Se,an=Ne,cn=Oe,sn=function(n,t,r,o,i){return new q(function(e){(function(e){return D(e)})(i).then(function(e){var n=Z.getNaturalImageSize(e);return o.w===n.w&&o.h===n.h||Z.getImageSize(r)&&Z.setImageSize(r,n),v.URL.revokeObjectURL(e.src),i}).then(z).then(function(e){return _e(n,e,!0,t,r)},function(){})})},fn=d("save-state"),ln=d("disable"),dn=d("enable"),mn=function(i,u){return function(){var r=cn(i),o=r.map(function(e){return Z.getNaturalImageSize(e.dom())});cn(i).each(function(n){on(i,n.dom()).each(function(e){an(i,n.dom()).then(function(e){var n=function(e){return{blob:e,url:v.URL.createObjectURL(e)}}(e);i.windowManager.open(function(e){return{title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:e}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(e){var t=e.getData().imagetools.blob;r.each(function(n){o.each(function(e){sn(i,u,n.dom(),e,t)})}),e.close()},onCancel:function(){},onAction:function(e,n){switch(n.name){case fn():n.value?e.enable("save"):e.disable("save");break;case ln():e.disable("save"),e.disable("cancel");break;case dn():e.enable("cancel")}}}}(n))})})})}},hn=function(t,e){i.each({mceImageRotateLeft:tn(t,e,-90),mceImageRotateRight:tn(t,e,90),mceImageFlipVertical:rn(t,e,"v"),mceImageFlipHorizontal:rn(t,e,"h"),mceEditImage:mn(t,e)},function(e,n){t.addCommand(n,e)})},gn=function(t,r,o){t.on("NodeChange",function(e){var n=o.get();n&&n.src!==e.element.src&&(un(r),t.editorUpload.uploadImagesAuto(),o.set(null)),on(t,e.element).each(o.set)})},vn=function(r){function n(e){return function(){return r.execCommand(e)}}r.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft")}),r.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight")}),r.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical")}),r.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal")}),r.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:function(t){function e(){cn(r).each(function(e){var n=on(r,e.dom()).isNone();t.setDisabled(n)})}return r.on("NodeChange",e),function(){r.off("NodeChange",e)}}}),r.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image-options",onAction:n("mceImage")}),r.ui.registry.addContextMenu("imagetools",{update:function(e){return on(r,e).fold(function(){return[]},function(e){return[{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}]})}})},pn=function(n){n.ui.registry.addContextToolbar("imagetools",{items:function(e){return e.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")}(n),predicate:function(e){return on(n,e).isSome()},position:"node",scope:"node"})};!function En(){o.add("imagetools",function(e){var n=r(0),t=r(null);hn(e,n),vn(e),pn(e),gn(e,n,t)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function t(){}function n(t){return function(){return t}}function e(){return h}var r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.EditorManager"),l=tinymce.util.Tools.resolve("tinymce.Env"),m=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(t){return t.getParam("importcss_merge_classes")},i=function(t){return t.getParam("importcss_exclusive")},p=function(t){return t.getParam("importcss_selector_converter")},g=function(t){return t.getParam("importcss_selector_filter")},y=function(t){return t.getParam("importcss_groups")},v=function(t){return t.getParam("importcss_append")},d=function(t){return t.getParam("importcss_file_filter")},u=n(!1),s=n(!0),h=(r={fold:function(t,n){return t()},is:u,isSome:u,isNone:s,getOr:O,getOrThunk:x,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:n(null),getOrUndefined:n(undefined),or:O,orThunk:x,map:e,each:t,bind:e,exists:u,forall:s,filter:e,equals:_,equals_:_,toArray:function(){return[]},toString:n("none()")},Object.freeze&&Object.freeze(r),r);function _(t){return t.isNone()}function x(t){return t()}function O(t){return t}function T(n){return function(t){return function(t){if(null===t)return"null";var n=typeof t;return"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n}(t)===n}}function b(t,n){return function(t){for(var n=[],e=0,r=t.length;e<r;++e){if(!w(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);M.apply(n,t[e])}return n}(function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var i=t[o];r[o]=n(i,o)}return r}(t,n))}function k(n){return"string"==typeof n?function(t){return-1!==t.indexOf(n)}:n instanceof RegExp?function(t){return n.test(t)}:n}function S(i,t,u){var c=[],e={};function s(t,n){var e,r=t.href;if((r=function(t){var n=l.cacheSuffix;return"string"==typeof t&&(t=t.replace("?"+n,"").replace("&"+n,"")),t}(r))&&u(r,n)&&!function(t,n){var e=t.settings,r=!1!==e.skin&&(e.skin||"oxide");if(r){var o=e.skin_url?t.documentBaseURI.toAbsolute(e.skin_url):f.baseURL+"/skins/ui/"+r,i=f.baseURL+"/skins/content/";return n===o+"/content"+(t.inline?".inline":"")+".min.css"||-1!==n.indexOf(i)}return!1}(i,r)){m.each(t.imports,function(t){s(t,!0)});try{e=t.cssRules||t.rules}catch(o){}m.each(e,function(t){t.styleSheet?s(t.styleSheet,!0):t.selectorText&&m.each(t.selectorText.split(","),function(t){c.push(m.trim(t))})})}}m.each(i.contentCSS,function(t){e[t]=!0}),u=u||function(t,n){return n||e[t]};try{m.each(t.styleSheets,function(t){s(t)})}catch(n){}return c}function A(t,n){var e,r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(n);if(r){var o=r[1],i=r[2].substr(1).split(".").join(" "),u=m.makeMap("a,img");return r[1]?(e={title:n},t.schema.getTextBlockElements()[o]?e.block=o:t.schema.getBlockElements()[o]||u[o.toLowerCase()]?e.selector=o:e.inline=o):r[2]&&(e={inline:"span",title:n.substr(1),classes:i}),!1!==c(t)?e.classes=i:e.attributes={"class":i},e}}function P(t,n){return null===n||!1!==i(t)}var w=T("array"),E=T("function"),I=Array.prototype.slice,M=Array.prototype.push,j=(E(Array.from)&&Array.from,A),D=function(s){s.on("init",function(t){function r(t,n){if(function(t,n,e,r){return!(P(t,e)?n in r:n in e.selectors)}(s,t,n,i)){!function(t,n,e,r){P(t,e)?r[n]=!0:e.selectors[n]=!0}(s,t,n,i);var e=function(t,n,e,r){return(r&&r.selector_converter?r.selector_converter:p(t)?p(t):function(){return A(t,e)}).call(n,e,r)}(s,s.plugins.importcss,t,n);if(e){var r=e.name||a.DOM.uniqueId();return s.formatter.register(r,e),m.extend({},{title:e.title,format:r})}}return null}var o=function(){var n=[],e=[],r={};return{addItemToGroup:function(t,n){r[t]?r[t].push(n):(e.push(t),r[t]=[n])},addItem:function(t){n.push(t)},toFormats:function(){return b(e,function(t){var n=r[t];return 0===n.length?[]:[{title:t,items:n}]}).concat(n)}}}(),i={},u=k(g(s)),c=function(t){return m.map(t,function(t){return m.extend({},t,{original:t,selectors:{},filter:k(t.filter),item:{text:t.title,menu:[]}})})}(y(s));m.each(S(s,s.getDoc(),k(d(s))),function(e){if(-1===e.indexOf(".mce-")&&(!u||u(e))){var t=function(t,n){return m.grep(t,function(t){return!t.filter||t.filter(n)})}(c,e);if(0<t.length)m.each(t,function(t){var n=r(e,t);n&&o.addItemToGroup(t.title,n)});else{var n=r(e,null);n&&o.addItem(n)}}});var n=o.toFormats();s.fire("addStyleModifications",{items:n,replace:!v(s)})})},R=function(n){return{convertSelectorToFormat:function(t){return j(n,t)}}};!function U(){o.add("importcss",function(t){return D(t),R(t)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function n(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))}function r(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])}function a(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}function i(e,t,n){return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",a(n.getMonth()+1,2))).replace("%d",a(n.getDate(),2))).replace("%H",""+a(n.getHours(),2))).replace("%M",""+a(n.getMinutes(),2))).replace("%S",""+a(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(f[n.getMonth()]))).replace("%b",""+e.translate(d[n.getMonth()]))).replace("%A",""+e.translate(s[n.getDay()]))).replace("%a",""+e.translate(l[n.getDay()]))).replace("%%","%")}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d"))},o=n,u=r,c=function(e){var t=r(e);return 0<t.length?t[0]:n(e)},m=function(e){return e.getParam("insertdatetime_element",!1)},l="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),s="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),d="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),f="January February March April May June July August September October November December".split(" "),p=function(e,t){if(m(e)){var n=i(e,t),r=void 0;r=/%[HMSIp]/.test(t)?i(e,"%Y-%m-%dT%H:%M"):i(e,"%Y-%m-%d");var a=e.dom.getParent(e.selection.getStart(),"time");a?function(e,t,n,r){var a=e.dom.create("time",{datetime:n},r);t.parentNode.insertBefore(a,t),e.dom.remove(t),e.selection.select(a,!0),e.selection.collapse(!1)}(e,a,r,n):e.insertContent('<time datetime="'+r+'">'+n+"</time>")}else e.insertContent(i(e,t))},g=i,y=function(e){e.addCommand("mceInsertDate",function(){p(e,t(e))}),e.addCommand("mceInsertTime",function(){p(e,o(e))})},M=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return S(t())}}},v=function(n){var t=u(n),r=S(c(n));n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===r.get()},fetch:function(e){e(M.map(t,function(e){return{type:"choiceitem",text:g(n,e),value:e}}))},onAction:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];p(n,r.get())},onItemAction:function(e,t){r.set(t),p(n,t)}});n.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return M.map(t,function(e){return{type:"menuitem",text:g(n,e),onAction:function(e){return function(){r.set(e),p(n,e)}}(e)}})}})};!function h(){e.add("insertdatetime",function(e){y(e),v(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(e){return e.getParam("font_formats")},i=function(e){return e.getParam("fontsize_formats")},n=function(e,t){e.settings.fontsize_formats=t},l=function(e,t){e.settings.font_formats=t},s=function(e){return e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")},r=function(e,t){e.settings.inline_styles=t},o=function(e){!function(e){r(e,!1),i(e)||n(e,"8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t(e)||l(e,"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats")}(e),e.on("PreInit",function(){return function(e){var t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=a.explode(s(e)),n=e.schema;e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return a.inArray(i,e.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),a.each("b,i,u,strike".split(","),function(e){n.addValidElements(e+"[*]")}),n.getElementRule("font")||n.addValidElements("font[face|size|color|style]"),a.each(t.split(","),function(e){var t=n.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})}(e)})};!function c(){e.add("legacyoutput",function(e){o(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(c){"use strict";function n(t){return function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"==t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t}(n)===t}}function u(){}function i(n){return function(){return n}}function t(){return A}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),a=n("string"),f=n("array"),l=n("boolean"),s=n("function"),d=function(n){var t=n.getParam("link_assume_external_targets",!1);return l(t)&&t?1:!a(t)||"http"!==t&&"https"!==t?0:t},m=function(n){return n.getParam("link_context_toolbar",!1,"boolean")},h=function(n){return n.getParam("link_list")},p=function(n){return n.getParam("default_link_target")},g=function(n){return n.getParam("target_list",!0)},v=function(n){return n.getParam("rel_list",[],"array")},y=function(n){return n.getParam("link_class_list",[],"array")},w=function(n){return n.getParam("link_title",!0,"boolean")},x=function(n){return n.getParam("allow_unsafe_link_target",!1,"boolean")},k=function(n){return n.getParam("link_quicklink",!1,"boolean")},b=function(n){var t=c.document.createElement("a");t.target="_blank",t.href=n,t.rel="noreferrer noopener";var e=c.document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,c.window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(n,t){c.document.body.appendChild(n),n.dispatchEvent(t),c.document.body.removeChild(n)}(t,e)},_=function(){return(_=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)},T=i(!1),O=i(!0),A=(e={fold:function(n,t){return n()},is:T,isSome:T,isNone:O,getOr:N,getOrThunk:P,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:N,orThunk:P,map:t,each:u,bind:t,exists:T,forall:O,filter:t,equals:C,equals_:C,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(e),e);function C(n){return n.isNone()}function P(n){return n()}function N(n){return n}function E(n,t){return-1<function(n,t){return Q.call(n,t)}(n,t)}function I(n,t){for(var e=0,r=n.length;e<r;e++){t(n[e],e)}}function S(n){for(var t=[],e=0,r=n.length;e<r;++e){if(!f(n[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+n);Y.apply(t,n[e])}return t}function j(n,t){var e=function(n,t){for(var e=n.length,r=new Array(e),o=0;o<e;o++){var i=n[o];r[o]=t(i,o)}return r}(n,t);return S(e)}function F(n){return/^\w+:/i.test(n)}function L(n,t){var e,r,o=["noopener"],i=n?n.split(/\s+/):[],u=function(n){return n.filter(function(n){return-1===Z.inArray(o,n)})},c=t?0<(e=u(e=i)).length?e.concat(o):o:u(i);return 0<c.length?(r=c,Z.trim(r.sort().join(" "))):""}function R(n,t){return t=t||n.selection.getNode(),nn(t)?n.dom.select("a[href]",t)[0]:n.dom.getParent(t,"a[href]")}function D(n){return n&&"A"===n.nodeName&&!!n.href}function U(n){return function(n,t,e){return I(n,function(n){e=t(e,n)}),e}(["title","rel","class","target"],function(t,e){return n[e].each(function(n){t[e]=0<n.length?n:null}),t},{href:n.href})}function M(n,t){var e=_({},t);if(!(0<v(n).length)&&!1===x(n)){var r=L(e.rel,"_blank"===e.target);e.rel=r||null}return J.from(e.target).isNone()&&!1===g(n)&&(e.target=p(n)),e.href=function(n,t){return"http"!==t&&"https"!==t||F(n)?n:t+"://"+n}(e.href,d(n)),e}function z(n,t){for(var e=0;e<n.length;e++){var r=t(n[e],e);if(r.isSome())return r}return J.none()}function q(n){return a(n.value)?n.value:""}function K(t){return void 0===t&&(t=q),function(n){return J.from(n).map(function(n){return function(n,r){var o=[];return Z.each(n,function(n){var t=a(n.text)?n.text:a(n.title)?n.title:"";if(n.menu!==undefined);else{var e=r(n);o.push({text:t,value:e})}}),o}(n,t)})}}function B(t,n,e,r){var o=r[n],i=0<t.length;return o!==undefined?function(t,n){return z(n,function(n){return J.some(n).filter(function(n){return n.value===t})})}(o,e).map(function(n){return{url:{value:n.value,meta:{text:i?t:n.text,attach:u}},text:i?t:n.text}}):J.none()}var V,W,H,$,G=function(e){function n(){return o}function t(n){return n(e)}var r=i(e),o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:O,isNone:T,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return G(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?o:A},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(T,function(n){return t(e,n)})}};return o},J={some:G,none:t,from:function(n){return null===n||n===undefined?A:G(n)}},X=Array.prototype.slice,Q=Array.prototype.indexOf,Y=Array.prototype.push,Z=(s(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.Tools")),nn=function(n){return n&&"FIGURE"===n.nodeName&&/\bimage\b/i.test(n.className)},tn=function(n,t){var e=n.dom.select("img",t)[0];if(e){var r=n.dom.getParents(e,"a[href]",t)[0];r&&(r.parentNode.insertBefore(e,r),n.dom.remove(r))}},en=function(n,t,e){var r=n.dom.select("img",t)[0];if(r){var o=n.dom.create("a",e);r.parentNode.insertBefore(o,r),o.appendChild(r)}},rn=function(n,t,e){var r=n.selection.getNode(),o=R(n,r),i=M(n,U(e));n.undoManager.transact(function(){e.href===t.href&&t.attach(),o?(n.focus(),function(n,t,e,r){e.each(function(n){t.hasOwnProperty("innerText")?t.innerText=n:t.textContent=n}),n.dom.setAttribs(t,r),n.selection.select(t)}(n,o,e.text,i)):function(t,n,e,r){nn(n)?en(t,n,r):e.fold(function(){t.execCommand("mceInsertLink",!1,r)},function(n){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(n)))})}(n,r,e.text,i)})},on=function(e){e.undoManager.transact(function(){var n=e.selection.getNode();if(nn(n))tn(e,n);else{var t=e.dom.getParent(n,"a[href]",e.getBody());t&&e.dom.remove(t,!0)}e.focus()})},un=function(n){return 0<Z.grep(n,D).length},cn=function(n){var t=n.getAttribute("data-mce-href");return t||n.getAttribute("href")},an=function(n){return!(/</.test(n)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(n)||-1===n.indexOf("href=")))},fn=R,ln=function(n,t){return function(n){return n.replace(/\uFEFF/g,"")}(t?t.innerText||t.textContent:n.getContent({format:"text"}))},sn=L,dn=F,mn={sanitize:function(n){return K(q)(n)},sanitizeWith:K,createUi:function(t,e){return function(n){return{name:t,type:"selectbox",label:e,items:n}}},getValue:q},hn=function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return hn(t())}}},pn=function(n,r){function e(n,t){var e=function(n,t){return"link"===t?n.catalogs.link:"anchor"===t?n.catalogs.anchor:J.none()}(r,t.name).getOr([]);return B(o.get(),t.name,e,n)}var o=hn(n.text);return{onChange:function(n,t){return"url"===t.name?function(n){if(o.get().length<=0){var t=n.url.meta.text!==undefined?n.url.meta.text:n.url.value;return J.some({text:t})}return J.none()}(n()):E(["anchor","link"],t.name)?e(n(),t):("text"===t.name&&o.set(n().text),J.none())}}},gn={},vn={exports:gn};V=undefined,W=gn,H=vn,$=undefined,function(n){"object"==typeof W&&void 0!==H?H.exports=n():"function"==typeof V&&V.amd?V([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function l(i,u,c){function a(t,n){if(!u[t]){if(!i[t]){var e="function"==typeof $&&$;if(!n&&e)return e(t,!0);if(f)return f(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[t]={exports:{}};i[t][0].call(o.exports,function(n){return a(i[t][1][n]||n)},o,o.exports,l,i,u,c)}return u[t].exports}for(var f="function"==typeof $&&$,n=0;n<c.length;n++)a(c[n]);return a}({1:[function(n,t,e){var r,o,i=t.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(t){try{return r.call(null,n,0)}catch(t){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 f,l=[],s=!1,d=-1;function m(){s&&f&&(s=!1,f.length?l=f.concat(l):d=-1,l.length&&h())}function h(){if(!s){var n=a(m);s=!0;for(var t=l.length;t;){for(f=l,l=[];++d<t;)f&&f[d].run();d=-1,t=l.length}f=null,s=!1,function e(n){if(o===clearTimeout)return clearTimeout(n);if((o===c||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(n);try{return o(n)}catch(t){try{return o.call(null,n)}catch(t){return o.call(this,n)}}}(n)}}function p(n,t){this.fun=n,this.array=t}function g(){}i.nextTick=function(n){var t=new Array(arguments.length-1);if(1<arguments.length)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];l.push(new p(n,t)),1!==l.length||s||a(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(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,s,t){(function(t){function r(){}function i(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=[],l(n,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,i._immediateFn(function(){var n=1===r._state?o.onFulfilled:o.onRejected;if(null!==n){var t;try{t=n(r._value)}catch(e){return void c(o.promise,e)}u(o.promise,t)}else(1===r._state?u:c)(o.promise,r._value)})):r._deferreds.push(o)}function u(n,t){try{if(t===n)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if(t instanceof i)return n._state=3,n._value=t,void a(n);if("function"==typeof e)return void l(function r(n,t){return function(){n.apply(t,arguments)}}(e,t),n)}n._state=1,n._value=t,a(n)}catch(o){c(n,o)}}function c(n,t){n._state=2,n._value=t,a(n)}function a(n){2===n._state&&0===n._deferreds.length&&i._immediateFn(function(){n._handled||i._unhandledRejectionFn(n._value)});for(var t=0,e=n._deferreds.length;t<e;t++)o(n,n._deferreds[t]);n._deferreds=null}function f(n,t,e){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.promise=e}function l(n,t){var e=!1;try{n(function(n){e||(e=!0,u(t,n))},function(n){e||(e=!0,c(t,n))})}catch(r){if(e)return;e=!0,c(t,r)}}var n,e;n=this,e=setTimeout,i.prototype["catch"]=function(n){return this.then(null,n)},i.prototype.then=function(n,t){var e=new this.constructor(r);return o(this,new f(n,t,e)),e},i.all=function(n){var a=Array.prototype.slice.call(n);return new i(function(o,i){if(0===a.length)return o([]);var u=a.length;function c(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void e.call(n,function(n){c(t,n)},i)}a[t]=n,0==--u&&o(a)}catch(r){i(r)}}for(var n=0;n<a.length;n++)c(n,a[n])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(n){n(t)})},i.reject=function(e){return new i(function(n,t){t(e)})},i.race=function(o){return new i(function(n,t){for(var e=0,r=o.length;e<r;e++)o[e].then(n,t)})},i._immediateFn="function"==typeof t?function(n){t(n)}:function(n){e(n,0)},i._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},i._setImmediateFn=function(n){i._immediateFn=n},i._setUnhandledRejectionFn=function(n){i._unhandledRejectionFn=n},void 0!==s&&s.exports?s.exports=i:n.Promise||(n.Promise=i)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(a,n,f){(function(n,t){var r=a("process/browser.js").nextTick,e=Function.prototype.apply,o=Array.prototype.slice,i={},u=0;function c(n,t){this._id=n,this._clearFn=t}f.setTimeout=function(){return new c(e.call(setTimeout,window,arguments),clearTimeout)},f.setInterval=function(){return new c(e.call(setInterval,window,arguments),clearInterval)},f.clearTimeout=f.clearInterval=function(n){n.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},f.enroll=function(n,t){clearTimeout(n._idleTimeoutId),n._idleTimeout=t},f.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},f._unrefActive=f.active=function(n){clearTimeout(n._idleTimeoutId);var t=n._idleTimeout;0<=t&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},t))},f.setImmediate="function"==typeof n?n:function(n){var t=u++,e=!(arguments.length<2)&&o.call(arguments,1);return i[t]=!0,r(function(){i[t]&&(e?n.apply(null,e):n.call(null),f.clearImmediate(t))}),t},f.clearImmediate="function"==typeof t?t:function(n){delete i[n]}}).call(this,a("timers").setImmediate,a("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(n,t,e){var r=n("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();t.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});function yn(n){c.setTimeout(function(){throw n},0)}function wn(n){var t=n.href;return 0<t.indexOf("@")&&-1===t.indexOf("//")&&-1===t.indexOf("mailto:")?J.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(n){return _(_({},n),{href:"mailto:"+t})}}):J.none()}function xn(n,t,e){var r=n.getAttrib(t,e);return null!==r&&0<r.length?J.some(r):J.none()}function kn(n,t){return n.dom.getParent(t,"a[href]")}function bn(n){return kn(n,n.selection.getStart())}function _n(n,t){if(t){var e=cn(t);if(/^#/.test(e)){var r=n.$(e);r.length&&n.selection.scrollIntoView(r[0],!0)}else b(t.href)}}var Tn=vn.exports.boltExport,On=function(n){var e=J.none(),t=[],r=function(n){o()?u(n):t.push(n)},o=function(){return e.isSome()},i=function(n){I(n,u)},u=function(t){e.each(function(n){c.setTimeout(function(){t(n)},0)})};return n(function(n){e=J.some(n),i(t),t=[]}),{get:r,map:function(e){return On(function(t){r(function(n){t(e(n))})})},isReady:o}},An={nu:On,pure:function(t){return On(function(n){n(t)})}},Cn=function(e){function n(n){e().then(n,yn)}return{map:function(n){return Cn(function(){return e().then(n)})},bind:function(t){return Cn(function(){return e().then(function(n){return t(n).toPromise()})})},anonBind:function(n){return Cn(function(){return e().then(function(){return n.toPromise()})})},toLazy:function(){return An.nu(n)},toCached:function(){var n=null;return Cn(function(){return null===n&&(n=e()),n})},toPromise:e,get:n}},Pn=function(n){return Cn(function(){return new Tn(n)})},Nn=function(n){return Cn(function(){return Tn.resolve(n)})},En=tinymce.util.Tools.resolve("tinymce.util.Delay"),In=function(n,t,r){return z([wn,function(e){return function(n){var t=n.href;return 1===e&&!dn(t)||0===e&&/^\s*www[\.|\d\.]/i.test(t)?J.some({message:"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",preprocess:function(n){return _(_({},n),{href:"http://"+t})}}):J.none()}}(t)],function(n){return n(r)}).fold(function(){return Nn(r)},function(e){return Pn(function(t){!function(t,n,e){var r=t.selection.getRng();En.setEditorTimeout(t,function(){t.windowManager.confirm(n,function(n){t.selection.setRng(r),e(n)})})}(n,e.message,function(n){t(n?e.preprocess(r):r)})})})},Sn=function(n){var t=n.dom.select("a:not([href])"),e=j(t,function(n){var t=n.name||n.id;return t?[{text:t,value:"#"+t}]:[]});return 0<e.length?J.some([{text:"None",value:""}].concat(e)):J.none()},jn=function(n){var t=y(n);return 0<t.length?mn.sanitize(t):J.none()},Fn=tinymce.util.Tools.resolve("tinymce.util.XHR"),Ln=function(t){function e(n){return t.convertURL(n.value||n.url,"href")}var n=h(t);return Pn(function(t){a(n)?Fn.send({url:n,success:function(n){return t(function(n){try{return J.some(JSON.parse(n))}catch(t){return J.none()}}(n))},error:function(n){return t(J.none())}}):s(n)?n(function(n){return t(J.some(n))}):t(J.from(n))}).map(function(n){return n.bind(mn.sanitizeWith(e)).map(function(n){return 0<n.length?[{text:"None",value:""}].concat(n):n})})},Rn=function(n,t){var e=v(n);if(0<e.length){var r=t.is("_blank");return(!1===x(n)?mn.sanitizeWith(function(n){return sn(mn.getValue(n),r)}):mn.sanitize)(e)}return J.none()},Dn=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Un=function(n){var t=g(n);return f(t)?mn.sanitize(t).orThunk(function(){return J.some(Dn)}):!1===t?J.none():J.some(Dn)},Mn=function(e,r){return Ln(e).map(function(n){var t=function(n,t){var e=n.dom,r=an(n.selection.getContent())?J.some(ln(n.selection,t)):J.none(),o=t?J.some(e.getAttrib(t,"href")):J.none(),i=t?J.from(e.getAttrib(t,"target")):J.none(),u=xn(e,t,"rel"),c=xn(e,t,"class");return{url:o,text:r,title:xn(e,t,"title"),target:i,rel:u,linkClass:c}}(e,r);return{anchor:t,catalogs:{targets:Un(e),rels:Rn(e,t.target),classes:jn(e),anchor:Sn(e),link:n},optNode:J.from(r),flags:{titleEnabled:w(e)}}})},zn=function(t){(function(n){var t=fn(n);return Mn(n,t)})(t).map(function(n){return function(n,t,e){var r=n.anchor.text.map(function(){return{name:"text",type:"input",label:"Text to display"}}).toArray(),o=n.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(n,t){return{url:{value:n.anchor.url.getOr(""),meta:{attach:function(){},text:n.anchor.url.fold(function(){return""},function(){return n.anchor.text.getOr("")}),original:{value:n.anchor.url.getOr("")}}},text:n.anchor.text.getOr(""),title:n.anchor.title.getOr(""),anchor:n.anchor.url.getOr(""),link:n.anchor.url.getOr(""),rel:n.anchor.rel.getOr(""),target:n.anchor.target.or(t).getOr(""),linkClass:n.anchor.linkClass.getOr("")}}(n,J.from(p(e))),u=pn(i,n),c=n.catalogs;return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:S([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,function(n){for(var t=[],e=function(n){t.push(n)},r=0;r<n.length;r++)n[r].each(e);return t}([c.anchor.map(mn.createUi("anchor","Anchors")),c.rels.map(mn.createUi("rel","Rel")),c.targets.map(mn.createUi("target","Open link in...")),c.link.map(mn.createUi("link","Link list")),c.classes.map(mn.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,n){var e=n.name;u.onChange(t.getData,{name:e}).each(function(n){t.setData(n)})},onSubmit:t}}(n,function(i,u,c){return function(n){var e=n.getData();if(!e.url.value)return on(i),void n.close();function t(t){return J.from(e[t]).filter(function(n){return!u.anchor[t].is(n)})}var r={href:e.url.value,text:t("text"),target:t("target"),rel:t("rel"),"class":t("linkClass"),title:t("title")},o={href:e.url.value,attach:e.url.meta!==undefined&&e.url.meta.attach?e.url.meta.attach:function(){}};In(i,c,r).get(function(n){rn(i,o,n)}),n.close()}}(t,n,d(t)),t)}).get(function(n){t.windowManager.open(n)})},qn=function(n){return function(){zn(n)}},Kn=function(n){return function(){_n(n,bn(n))}},Bn=function(e){e.on("click",function(n){var t=kn(e,n.target);t&&o.metaKeyPressed(n)&&(n.preventDefault(),_n(e,t))}),e.on("keydown",function(n){var t=bn(e);t&&13===n.keyCode&&function(n){return!0===n.altKey&&!1===n.shiftKey&&!1===n.ctrlKey&&!1===n.metaKey}(n)&&(n.preventDefault(),_n(e,t))})},Vn=function(e){return function(t){function n(n){return t.setActive(!e.readonly&&!!fn(e,n.element))}return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}},Wn=function(e){return function(t){t.setDisabled(!un(e.dom.getParents(e.selection.getStart())));function n(n){return t.setDisabled(!un(n.parents))}return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}},Hn=function(n){n.addCommand("mceLink",function(){k(n)?n.fire("contexttoolbar-show",{toolbarKey:"quicklink"}):qn(n)()})},$n=function(n){n.addShortcut("Meta+K","",function(){n.execCommand("mceLink")})},Gn=function(n){n.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:qn(n),onSetup:Vn(n)}),n.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Kn(n),onSetup:Wn(n)}),n.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return on(n)},onSetup:Wn(n)})},Jn=function(n){n.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Kn(n),onSetup:Wn(n)}),n.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:qn(n)}),n.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return on(n)},onSetup:Wn(n)})},Xn=function(t){t.ui.registry.addContextMenu("link",{update:function(n){return un(t.dom.getParents(n,"a"))?"link unlink openlink":"link"}})},Qn=function(i){function n(n){var t=i.selection.getNode();return n.setDisabled(!fn(i,t)),function(){}}i.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Vn(i)},label:"Link",predicate:function(n){return!!fn(i,n)&&m(i)},initValue:function(){var n=fn(i);return n?cn(n):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(n){var t=i.selection.getNode();return n.setActive(!!fn(i,t)),Vn(i)(n)},onAction:function(n){var t=fn(i),e=n.getValue();if(t)i.dom.setAttrib(t,"href",e),function(n){n.selection.collapse(!1)}(i),n.hide();else{var r={href:e,attach:function(){}},o=an(i.selection.getContent())?J.some(ln(i.selection,t)).filter(function(n){return 0<n.length}).or(J.from(e)):J.none();rn(i,r,{href:e,text:o,title:J.none(),rel:J.none(),target:J.none(),"class":J.none()}),n.hide()}}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:function(n){on(i),n.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:function(n){Kn(i)(),n.hide()}}]})};!function Yn(){r.add("link",function(n){Gn(n),Jn(n),Xn(n),Qn(n),Bn(n),Hn(n),$n(n)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(r){"use strict";function e(){}function l(e){return function(){return e}}function t(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return!t.apply(null,e)}}function n(){return a}var o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=l(!1),s=l(!0),a=(o={fold:function(e,n){return e()},is:u,isSome:u,isNone:s,getOr:d,getOrThunk:f,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(undefined),or:d,orThunk:f,map:n,each:e,bind:n,exists:u,forall:s,filter:n,equals:c,equals_:c,toArray:function(){return[]},toString:l("none()")},Object.freeze&&Object.freeze(o),o);function c(e){return e.isNone()}function f(e){return e()}function d(e){return e}function m(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}}function g(e,n){for(var t=e.length,r=new Array(t),o=0;o<t;o++){var i=e[o];r[o]=n(i,o)}return r}function p(e,n){for(var t=0,r=e.length;t<r;t++){n(e[t],t)}}function v(e,n){for(var t=[],r=0,o=e.length;r<o;r++){var i=e[r];n(i,r)&&t.push(i)}return t}function h(e,n,t){return p(e,function(e){t=n(t,e)}),t}function N(e,n){for(var t=0,r=e.length;t<r;t++){var o=e[t];if(n(o,t))return $e.some(o)}return $e.none()}function y(e,n){return function(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!We(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);Qe.apply(n,e[t])}return n}(g(e,n))}function S(e){return 0===e.length?$e.none():$e.some(e[0])}function O(e){return 0===e.length?$e.none():$e.some(e[e.length-1])}function C(e,n,t){return 0!=(e.compareDocumentPosition(n)&t)}function b(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};function r(e){return Number(n.replace(t,"$"+e))}return Ze(r(1),r(2))}function L(e,n){return function(){return n===e}}function T(e,n){return function(){return n===e}}function D(e,n){var t=String(n).toLowerCase();return N(e,function(e){return e.search(t)})}function E(e,n){return-1!==e.indexOf(n)}function w(n){return function(e){return E(e,n)}}function k(e,n){return e.dom()===n.dom()}function A(e,n,t){return e.isSome()&&n.isSome()?$e.some(t(e.getOrDie(),n.getOrDie())):$e.none()}function x(e){return $e.from(e.dom().parentNode).map(bn.fromDom)}function R(e){return g(e.dom().childNodes,bn.fromDom)}function I(e,n){var t=e.dom().childNodes;return $e.from(t[n]).map(bn.fromDom)}function _(e){return I(e,0)}function B(e){return I(e,e.dom().childNodes.length-1)}function P(n,t){x(n).each(function(e){e.dom().insertBefore(t.dom(),n.dom())})}function M(e,n){e.dom().appendChild(n.dom())}function U(n,e){p(e,function(e){M(n,e)})}function F(e){var n=e.dom();null!==n.parentNode&&n.parentNode.removeChild(n)}function j(e,n,t){return e.fire("ListMutation",{action:n,element:t})}function H(e,n){return function(e,n){for(var t=n!==undefined&&null!==n?n:Rn,r=0;r<e.length&&t!==undefined&&null!==t;++r)t=t[e[r]];return t}(e.split("."),n)}function $(e){return e&&"BR"===e.nodeName}function q(e){var n=e.selection.getStart(!0);return e.dom.getParent(n,"OL,UL,DL",Yn(e,n))}function W(e){var n=e.selection.getSelectedBlocks();return Pn.grep(function(t,e){var n=Pn.map(e,function(e){var n=t.dom.getParent(e,"li,dd,dt",Yn(t,e));return n||e});return Bn.unique(n)}(e,n),function(e){return Hn(e)})}function V(e,n){var t=e.dom.getParents(n,"ol,ul",Yn(e,n));return O(t)}function z(e,n){var t,r,o,i,u=e.dom,s=e.schema.getBlockElements(),a=u.createFragment();if(e.settings.forced_root_block&&(o=e.settings.forced_root_block),o&&((r=u.create(o)).tagName===e.settings.forced_root_block&&u.setAttribs(r,e.settings.forced_root_block_attrs),zn(n.firstChild,s)||a.appendChild(r)),n)for(;t=n.firstChild;){var c=t.nodeName;i||"SPAN"===c&&"bookmark"===t.getAttribute("data-mce-type")||(i=!0),zn(t,s)?(a.appendChild(t),r=null):o?(r||(r=u.create(o),a.appendChild(r)),r.appendChild(t)):a.appendChild(t)}return e.settings.forced_root_block?i||r.appendChild(u.create("br",{"data-mce-bogus":"1"})):a.appendChild(u.create("br")),a}function K(e){return e.dom().nodeName.toLowerCase()}function X(e,n){var t=e.dom();!function(e,n){for(var t=xn(e),r=0,o=t.length;r<o;r++){var i=t[r];n(e[i],i)}}(n,function(e,n){!function(e,n,t){if(!(qe(t)||Ve(t)||Ke(t)))throw r.console.error("Invalid call to Attr.set. Key ",n,":: Value ",t,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,t+"")}(t,n,e)})}function Q(e){return h(e.dom().attributes,function(e,n){return e[n.name]=n.value,e},{})}function Y(e,n,t){if(!qe(t))throw r.console.error("Invalid call to CSS.set. Property ",n,":: Value ",t,":: Element ",e),new Error("CSS value must be a string: "+t);!function(e){return e.style!==undefined&&ze(e.style.getPropertyValue)}(e)||e.style.setProperty(n,t)}function G(e){return function(e,n){return bn.fromDom(e.dom().cloneNode(n))}(e,!0)}function J(e,n){var t=function(e,n){var t=bn.fromTag(n),r=Q(e);return X(t,r),t}(e,n);P(e,t);var r=R(e);return U(t,r),F(e),t}function Z(e,n){M(e.item,n.list)}function ee(n,e,t){var r=e.slice(0,t.depth);return O(r).each(function(e){!function(e,n){M(e.list,n),e.item=n}(e,function(e,n,t){var r=bn.fromTag("li",e);return X(r,n),U(r,t),r}(n,t.itemAttributes,t.content)),function(e,n){K(e.list)!==n.listType&&(e.list=J(e.list,n.listType)),X(e.list,n.listAttributes)}(e,t)}),r}function ne(e,n,t){var r=function(e,n,t){for(var r,o,i,u=[],s=0;s<t;s++)u.push((r=e,o=n.listType,void 0,i={list:bn.fromTag(o,r),item:bn.fromTag("li",r)},M(i.list,i.item),i));return u}(e,t,t.depth-n.length);return function(e){for(var n=1;n<e.length;n++)Z(e[n-1],e[n])}(r),function(e,n){for(var t=0;t<e.length-1;t++)r=e[t].item,o="list-style-type",i="none",void 0,u=r.dom(),Y(u,o,i);var r,o,i,u;O(e).each(function(e){X(e.list,n.listAttributes),X(e.item,n.itemAttributes),U(e.item,n.content)})}(r,t),function(e,n){A(O(e),S(n),Z)}(n,r),n.concat(r)}function te(e){return En(e,"OL,UL")}function re(e){return _(e).map(te).getOr(!1)}function oe(e){return 0<e.depth}function ie(e){return e.isSelected}function ue(e){var n=R(e),t=function(e){return B(e).map(te).getOr(!1)}(e)?n.slice(0,-1):n;return g(t,G)}function se(t){p(t,function(n,e){(function(e,n){for(var t=e[n].depth,r=n-1;0<=r;r--){if(e[r].depth===t)return $e.some(e[r]);if(e[r].depth<t)break}return $e.none()})(t,e).each(function(e){!function(e,n){e.listType=n.listType,e.listAttributes=nt({},n.listAttributes)}(n,e)})})}function ae(t,r,o,i){return _(i).filter(te).fold(function(){r.each(function(e){k(e.start,i)&&o.set(!0)});var e=function(n,t,r){return x(n).filter(Zn).map(function(e){return{depth:t,isSelected:r,content:ue(n),itemAttributes:Q(n),listAttributes:Q(e),listType:K(e)}})}(i,t,o.get());r.each(function(e){k(e.end,i)&&o.set(!1)});var n=B(i).filter(te).map(function(e){return tt(t,r,o,e)}).getOr([]);return e.toArray().concat(n)},function(e){return tt(t,r,o,e)})}function ce(t,e){return g(e,function(e){var n=function(e,n){var t=(n||r.document).createDocumentFragment();return p(e,function(e){t.appendChild(e.dom())}),bn.fromDom(t)}(e.content);return bn.fromDom(z(t,n.dom()))})}function fe(e,n){return se(n),function(t,e){var n=h(e,function(e,n){return n.depth>e.length?ne(t,e,n):ee(t,e,n)},[]);return S(n).map(function(e){return e.list})}(e.contentDocument,n).toArray()}function de(e){var n=g(Jn.getSelectedListItems(e),bn.fromDom);return A(N(n,t(re)),N(function(e){var n=Xe.call(e,0);return n.reverse(),n}(n),t(re)),function(e,n){return{start:e,end:n}})}function le(t,e,r){var n=function(e,n){var t=Ge(!1);return g(e,function(e){return{sourceList:e,entries:tt(0,n,t,e)}})}(e,de(t));p(n,function(e){!function(e,n){p(v(e,ie),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}(n,e)})}(e.entries,r);var n=function(n,e){return y(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i<u;i++){var s=e[i],a=n(s);a!==t&&(r.push(o),o=[]),t=a,o.push(s)}return 0!==o.length&&r.push(o),r}(e,oe),function(e){return S(e).map(oe).getOr(!1)?fe(n,e):ce(n,e)})}(t,e.entries);p(n,function(e){j(t,"Indent"===r?"IndentList":"OutdentList",e.dom())}),function(n,e){p(e,function(e){P(n,e)})}(e.sourceList,n),F(e.sourceList)})}function me(e){En(e,"dt")&&J(e,"dd")}function ge(n,e,t){p(t,"Indent"===e?me:function(e){return function(n,t){En(t,"dd")?J(t,"dt"):En(t,"dt")&&x(t).each(function(e){return it(n,e.dom(),t.dom())})}(n,e)})}function pe(e,n){if(Mn(e))return{container:e,offset:n};var t=wn.getNode(e,n);return Mn(t)?{container:t,offset:n>=e.childNodes.length?t.data.length:0}:t.previousSibling&&Mn(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&Mn(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}}function ve(e,n){var t=g(Jn.getSelectedListRoots(e),bn.fromDom),r=g(Jn.getSelectedDlItems(e),bn.fromDom),o=!1;if(t.length||r.length){var i=e.selection.getBookmark();le(e,t,n),ge(e,n,r),e.selection.moveToBookmark(i),e.selection.setRng(ut(e.selection.getRng())),e.nodeChanged(),o=!0}return o}function he(e){return ve(e,"Indent")}function Ne(e){return ve(e,"Outdent")}function ye(e){return ve(e,"Flatten")}function Se(e){return/\btox\-/.test(e.className)}function Oe(e){switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}}function Ce(t,e){Pn.each(e,function(e,n){t.setAttribute(n,e)})}function be(e,n,t){!function(e,n,t){var r=t["list-style-type"]?t["list-style-type"]:null;e.setStyle(n,"list-style-type",r)}(e,n,t),function(e,n,t){Ce(n,t["list-attributes"]),Pn.each(e.select("li",n),function(e){Ce(e,t["list-item-attributes"])})}(e,n,t)}function Le(e,n,t,r){var o,i;for(o=n[t?"startContainer":"endContainer"],i=n[t?"startOffset":"endOffset"],1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!t&&qn(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Vn(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o}function Te(r,o,i){void 0===i&&(i={});var e,n=r.selection.getRng(!0),u="LI",t=Jn.getClosestListRootElm(r,r.selection.getStart(!0)),s=r.dom;"false"!==s.getContentEditable(r.selection.getNode())&&("DL"===(o=o.toUpperCase())&&(u="DT"),e=ct(n),Pn.each(function(t,e,r){for(var o,i=[],u=t.dom,n=Le(t,e,!0,r),s=Le(t,e,!1,r),a=[],c=n;c&&(a.push(c),c!==s);c=c.nextSibling);return Pn.each(a,function(e){if(Vn(t,e))return i.push(e),void(o=null);if(u.isBlock(e)||qn(e))return qn(e)&&u.remove(e),void(o=null);var n=e.nextSibling;st.isBookmarkNode(e)&&(Vn(t,n)||!n&&e.parentNode===r)?o=null:(o||(o=u.create("p"),e.parentNode.insertBefore(o,e),i.push(o)),o.appendChild(e))}),i}(r,n,t),function(e){var n,t;(t=e.previousSibling)&&Un(t)&&t.nodeName===o&&function(e,n,t){var r=e.getStyle(n,"list-style-type"),o=t?t["list-style-type"]:"";return r===(o=null===o?"":o)}(s,t,i)?(n=t,e=s.rename(e,u),t.appendChild(e)):(n=s.create(o),e.parentNode.insertBefore(n,e),n.appendChild(e),e=s.rename(e,u)),function(t,r,e){Pn.each(e,function(e){var n;return t.setStyle(r,((n={})[e]="",n))})}(s,e,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),be(s,n,i),dt(r.dom,n)}),r.selection.setRng(ft(e)))}function De(e,n,t){return function(e,n){return e&&n&&Un(e)&&e.nodeName===n.nodeName}(n,t)&&function(e,n,t){return e.getStyle(n,"list-style-type",!0)===e.getStyle(t,"list-style-type",!0)}(e,n,t)&&function(e,n){return e.className===n.className}(n,t)}function Ee(n,e,t,r,o){if(e.nodeName!==r||lt(o)){var i=ct(n.selection.getRng(!0));Pn.each([e].concat(t),function(e){!function(e,n,t,r){if(n.nodeName!==t){var o=e.dom.rename(n,t);be(e.dom,o,r),j(e,Oe(t),o)}else be(e.dom,n,r),j(e,Oe(t),n)}(n,e,r,o)}),n.selection.setRng(ft(i))}else ye(n)}function we(e,n){var t,r=n.parentNode;"LI"===r.nodeName&&r.firstChild===n&&((t=r.previousSibling)&&"LI"===t.nodeName?(t.appendChild(n),Xn(e,r)&&gt.remove(r)):gt.setStyle(r,"listStyleType","none")),Un(r)&&(t=r.previousSibling)&&"LI"===t.nodeName&&t.appendChild(n)}function ke(e,n,t,r){var o=n.startContainer,i=n.startOffset;if(Mn(o)&&(t?i<o.data.length:0<i))return o;var u=e.schema.getNonEmptyElements();1===o.nodeType&&(o=wn.getNode(o,i));var s=new kn(o,r);for(t&&Kn(e.dom,o)&&s.next();o=s[t?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(Mn(o)&&0<o.data.length)return o}}function Ae(e,n){var t=n.childNodes;return 1===t.length&&!Un(t[0])&&e.isBlock(t[0])}function xe(e,n,t){var r,o;if(o=Ae(e,t)?t.firstChild:t,function(e,n){Ae(e,n)&&e.remove(n.firstChild,!0)}(e,n),!Xn(e,n,!0))for(;r=n.firstChild;)o.appendChild(r)}function Re(n,e,t){var r,o,i=e.parentNode;if(Qn(n,e)&&Qn(n,t)){Un(t.lastChild)&&(o=t.lastChild),i===t.lastChild&&qn(i.previousSibling)&&n.remove(i.previousSibling),(r=t.lastChild)&&qn(r)&&e.hasChildNodes()&&n.remove(r),Xn(n,t,!0)&&n.$(t).empty(),xe(n,e,t),o&&t.appendChild(o);var u=Dn(bn.fromDom(t),bn.fromDom(e))?n.getParents(e,Un,t):[];n.remove(e),p(u,function(e){Xn(n,e)&&e!==n.getRoot()&&n.remove(e)})}}function Ie(e,n,t,r){var o=e.dom;if(o.isEmpty(r))!function(e,n,t){e.dom.$(t).empty(),Re(e.dom,n,t),e.selection.setCursorLocation(t)}(e,t,r);else{var i=ct(n);Re(o,t,r),e.selection.setRng(ft(i))}}function _e(e,n){var t=e.dom,r=e.selection,o=r.getStart(),i=Jn.getClosestListRootElm(e,o),u=t.getParent(r.getStart(),"LI",i);if(u){var s=u.parentNode;if(s===e.getBody()&&Xn(t,s))return!0;var a=ut(r.getRng()),c=t.getParent(ke(e,a,n,i),"LI",i);if(c&&c!==u)return e.undoManager.transact(function(){n?Ie(e,a,c,u):Wn(u)?Ne(e):function(e,n,t,r){var o=ct(n);Re(e.dom,t,r);var i=ft(o);e.selection.setRng(i)}(e,a,u,c)}),!0;if(!c&&!n&&0===a.startOffset&&0===a.endOffset)return e.undoManager.transact(function(){ye(e)}),!0}return!1}function Be(e,n){return _e(e,n)||function(e,n){var t=e.dom,r=e.selection.getStart(),o=Jn.getClosestListRootElm(e,r),i=t.getParent(r,t.isBlock,o);if(i&&t.isEmpty(i)){var u=ut(e.selection.getRng()),s=t.getParent(ke(e,u,n,o),"LI",o);if(s)return e.undoManager.transact(function(){!function(e,n,t){var r=e.getParent(n.parentNode,e.isBlock,t);e.remove(n),r&&e.isEmpty(r)&&e.remove(r)}(t,i,o),mt.mergeWithAdjacentLists(t,s.parentNode),e.selection.select(s,!0),e.selection.collapse(n)}),!0}return!1}(e,n)}function Pe(e,n){return e.selection.isCollapsed()?Be(e,n):function(e){var n=e.selection.getStart(),t=Jn.getClosestListRootElm(e,n);return!!(e.dom.getParent(n,"LI,DT,DD",t)||0<Jn.getSelectedListItems(e).length)&&(e.undoManager.transact(function(){e.execCommand("Delete"),pt(e.dom,e.getBody())}),!0)}(e)}function Me(n,t){return function(){var e=n.dom.getParent(n.selection.getStart(),"UL,OL,DL");return e&&e.nodeName===t}}function Ue(n,i){return function(o){function e(e){var n=function(e,n){for(var t=0;t<e.length;t++){if(n(e[t]))return t}return-1}(e.parents,$n),t=-1!==n?e.parents.slice(0,n):e.parents,r=Pn.grep(t,Un);o.setActive(0<r.length&&r[0].nodeName===i&&!Se(r[0]))}return n.on("NodeChange",e),function(){return n.off("NodeChange",e)}}}var Fe,je,He=function(t){function e(){return o}function n(e){return e(t)}var r=l(t),o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return He(e(t))},each:function(e){e(t)},bind:n,exists:n,forall:n,filter:function(e){return e(t)?o:a},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,function(e){return n(t,e)})}};return o},$e={some:He,none:n,from:function(e){return null===e||e===undefined?a:He(e)}},qe=m("string"),We=m("array"),Ve=m("boolean"),ze=m("function"),Ke=m("number"),Xe=Array.prototype.slice,Qe=Array.prototype.push,Ye=(ze(Array.from)&&Array.from,function(e,n){return C(e,n,r.Node.DOCUMENT_POSITION_CONTAINED_BY)}),Ge=function(e){function n(){return t}var t=e;return{get:n,set:function(e){t=e},clone:function(){return Ge(n())}}},Je=function(){return Ze(0,0)},Ze=function(e,n){return{major:e,minor:n}},en={nu:Ze,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?Je():b(e,t)},unknown:Je},nn="Edge",tn="Chrome",rn="Opera",on="Firefox",un="Safari",sn=function(e){var n=e.current;return{current:n,version:e.version,isEdge:L(nn,n),isChrome:L(tn,n),isIE:L("IE",n),isOpera:L(rn,n),isFirefox:L(on,n),isSafari:L(un,n)}},an={unknown:function(){return sn({current:undefined,version:en.unknown()})},nu:sn,edge:l(nn),chrome:l(tn),ie:l("IE"),opera:l(rn),firefox:l(on),safari:l(un)},cn="Windows",fn="Android",dn="Solaris",ln="FreeBSD",mn=function(e){var n=e.current;return{current:n,version:e.version,isWindows:T(cn,n),isiOS:T("iOS",n),isAndroid:T(fn,n),isOSX:T("OSX",n),isLinux:T("Linux",n),isSolaris:T(dn,n),isFreeBSD:T(ln,n)}},gn={unknown:function(){return mn({current:undefined,version:en.unknown()})},nu:mn,windows:l(cn),ios:l("iOS"),android:l(fn),linux:l("Linux"),osx:l("OSX"),solaris:l(dn),freebsd:l(ln)},pn=function(e,t){return D(e,t).map(function(e){var n=en.detect(e.versionRegexes,t);return{current:e.name,version:n}})},vn=function(e,t){return D(e,t).map(function(e){var n=en.detect(e.versionRegexes,t);return{current:e.name,version:n}})},hn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Nn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return E(e,"edge/")&&E(e,"chrome")&&E(e,"safari")&&E(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,hn],search:function(e){return E(e,"chrome")&&!E(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return E(e,"msie")||E(e,"trident")}},{name:"Opera",versionRegexes:[hn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:w("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:w("firefox")},{name:"Safari",versionRegexes:[hn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(E(e,"safari")||E(e,"mobile/"))&&E(e,"applewebkit")}}],yn=[{name:"Windows",search:w("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return E(e,"iphone")||E(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:w("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:w("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:w("linux"),versionRegexes:[]},{name:"Solaris",search:w("sunos"),versionRegexes:[]},{name:"FreeBSD",search:w("freebsd"),versionRegexes:[]}],Sn={browsers:l(Nn),oses:l(yn)},On=Ge(function(e,n){var t=Sn.browsers(),r=Sn.oses(),o=pn(t,e).fold(an.unknown,an.nu),i=vn(r,e).fold(gn.unknown,gn.nu);return{browser:o,os:i,deviceType:function(e,n,t,r){var o=e.isiOS()&&!0===/ipad/i.test(t),i=e.isiOS()&&!o,u=e.isiOS()||e.isAndroid(),s=u||r("(pointer:coarse)"),a=o||!i&&u&&r("(min-device-width:768px)"),c=i||u&&!a,f=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(t),d=!c&&!a&&!f;return{isiPad:l(o),isiPhone:l(i),isTablet:l(a),isPhone:l(c),isTouch:l(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:l(f),isDesktop:l(d)}}(i,o,e,n)}}(r.navigator.userAgent,function(e){return r.window.matchMedia(e).matches})),Cn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:l(e)}},bn={fromHtml:function(e,n){var t=(n||r.document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw r.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Cn(t.childNodes[0])},fromTag:function(e,n){var t=(n||r.document).createElement(e);return Cn(t)},fromText:function(e,n){var t=(n||r.document).createTextNode(e);return Cn(t)},fromDom:Cn,fromPoint:function(e,n,t){var r=e.dom();return $e.from(r.elementFromPoint(n,t)).map(Cn)}},Ln=(r.Node.ATTRIBUTE_NODE,r.Node.CDATA_SECTION_NODE,r.Node.COMMENT_NODE,r.Node.DOCUMENT_NODE,r.Node.DOCUMENT_TYPE_NODE,r.Node.DOCUMENT_FRAGMENT_NODE,r.Node.ELEMENT_NODE),Tn=(r.Node.TEXT_NODE,r.Node.PROCESSING_INSTRUCTION_NODE,r.Node.ENTITY_REFERENCE_NODE,r.Node.ENTITY_NODE,r.Node.NOTATION_NODE,Ln),Dn=On.get().browser.isIE()?function(e,n){return Ye(e.dom(),n.dom())}:function(e,n){var t=e.dom(),r=n.dom();return t!==r&&t.contains(r)},En=function(e,n){var t=e.dom();if(t.nodeType!==Tn)return!1;var r=t;if(r.matches!==undefined)return r.matches(n);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(n);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(n);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},wn=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),kn=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),An=tinymce.util.Tools.resolve("tinymce.util.VK"),xn=Object.keys,Rn=(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]}("element","offset"),"undefined"!=typeof r.window?r.window:Function("return this;")()),In=function(e,n){var t=function(e,n){return H(e,n)}(e,n);if(t===undefined||null===t)throw new Error(e+" not available on this browser");return t},_n=function(e){return function(e){return In("HTMLElement",e)}(H("ownerDocument.defaultView",e)).prototype.isPrototypeOf(e)},Bn=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),Pn=tinymce.util.Tools.resolve("tinymce.util.Tools"),Mn=function(e){return e&&3===e.nodeType},Un=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},Fn=function(e){return e&&/^(OL|UL)$/.test(e.nodeName)},jn=function(e){return e&&/^(DT|DD)$/.test(e.nodeName)},Hn=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},$n=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},qn=$,Wn=function(e){return e.parentNode.firstChild===e},Vn=function(e,n){return n&&!!e.schema.getTextBlockElements()[n.nodeName]},zn=function(e,n){return e&&e.nodeName in n},Kn=function(e,n){return!!$(n)&&!(!e.isBlock(n.nextSibling)||$(n.previousSibling))},Xn=function(e,n,t){var r=e.isEmpty(n);return!(t&&0<e.select("span[data-mce-type=bookmark]",n).length)&&r},Qn=function(e,n){return e.isChildOf(n,e.getRoot())},Yn=function(e,n){var t=e.dom.getParents(n,"TD,TH");return 0<t.length?t[0]:e.getBody()},Gn=function(n,e){var t=g(e,function(e){return V(n,e).getOr(e)});return Bn.unique(t)},Jn={isList:function(e){var n=q(e);return _n(n)},getParentList:q,getSelectedSubLists:function(e){var n=q(e),t=e.selection.getSelectedBlocks();return function(e,n){return e&&1===n.length&&n[0]===e}(n,t)?function(e){return Pn.grep(e.querySelectorAll("ol,ul,dl"),function(e){return Un(e)})}(n):Pn.grep(t,function(e){return Un(e)&&n!==e})},getSelectedListItems:W,getClosestListRootElm:Yn,getSelectedDlItems:function(e){return v(W(e),jn)},getSelectedListRoots:function(e){var n=function(e){var n=V(e,e.selection.getStart()),t=v(e.selection.getSelectedBlocks(),Fn);return n.toArray().concat(t)}(e);return Gn(e,n)}},Zn=(Fe=Ln,function(e){return function(e){return e.dom().nodeType}(e)===Fe}),et=Object.prototype.hasOwnProperty,nt=(je=function(e,n){return n},function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<e.length;r++){var o=e[r];for(var i in o)et.call(o,i)&&(t[i]=je(t[i],o[i]))}return t}),tt=function(n,t,r,e){return y(R(e),function(e){return(te(e)?tt:ae)(n+1,t,r,e)})},rt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),ot=rt.DOM,it=function(e,n,t){var r,o,i,u,s,a;for(i=ot.select('span[data-mce-type="bookmark"]',n),s=z(e,t),(r=ot.createRng()).setStartAfter(t),r.setEndAfter(n),u=(o=r.extractContents()).firstChild;u;u=u.firstChild)if("LI"===u.nodeName&&e.dom.isEmpty(u)){ot.remove(u);break}e.dom.isEmpty(o)||ot.insertAfter(o,n),ot.insertAfter(s,n),Xn(e.dom,t.parentNode)&&(a=t.parentNode,Pn.each(i,function(e){a.parentNode.insertBefore(e,t.parentNode)}),ot.remove(a)),ot.remove(t),Xn(e.dom,n)&&ot.remove(n)},ut=function(e){var n=e.cloneRange(),t=pe(e.startContainer,e.startOffset);n.setStart(t.container,t.offset);var r=pe(e.endContainer,e.endOffset);return n.setEnd(r.container,r.offset),n},st=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),at=rt.DOM,ct=function(o){function e(e){var n,t,r;t=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"],1===t.nodeType&&(n=at.create("span",{"data-mce-type":"bookmark"}),t.hasChildNodes()?(r=Math.min(r,t.childNodes.length-1),e?t.insertBefore(n,t.childNodes[r]):at.insertAfter(n,t.childNodes[r])):t.appendChild(n),t=n,r=0),i[e?"startContainer":"endContainer"]=t,i[e?"startOffset":"endOffset"]=r}var i={};return e(!0),o.collapsed||e(),i},ft=function(o){function e(e){var n,t,r;n=r=o[e?"startContainer":"endContainer"],t=o[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(t=function(e){for(var n=e.parentNode.firstChild,t=0;n;){if(n===e)return t;1===n.nodeType&&"bookmark"===n.getAttribute("data-mce-type")||t++,n=n.nextSibling}return-1}(n),n=n.parentNode,at.remove(r),!n.hasChildNodes()&&at.isBlock(n)&&n.appendChild(at.create("br"))),o[e?"startContainer":"endContainer"]=n,o[e?"startOffset":"endOffset"]=t)}e(!0),e();var n=at.createRng();return n.setStart(o.startContainer,o.startOffset),o.endContainer&&n.setEnd(o.endContainer,o.endOffset),ut(n)},dt=function(e,n){var t,r;if(t=n.nextSibling,De(e,n,t)){for(;r=t.firstChild;)n.appendChild(r);e.remove(t)}if(t=n.previousSibling,De(e,n,t)){for(;r=t.lastChild;)n.insertBefore(r,n.firstChild);e.remove(t)}},lt=function(e){return"list-style-type"in e},mt={toggleList:function(e,n,t){var r=Jn.getParentList(e),o=Jn.getSelectedSubLists(e);t=t||{},r&&0<o.length?Ee(e,r,o,n,t):function(e,n,t,r){if(n!==e.getBody())if(n)if(n.nodeName!==t||lt(r)||Se(n)){var o=ct(e.selection.getRng(!0));be(e.dom,n,r);var i=e.dom.rename(n,t);dt(e.dom,i),e.selection.setRng(ft(o)),j(e,Oe(t),i)}else ye(e);else Te(e,t,r),j(e,Oe(t),n)}(e,r,n,t)},mergeWithAdjacentLists:dt},gt=rt.DOM,pt=function(n,e){Pn.each(Pn.grep(n.select("ol,ul",e)),function(e){we(n,e)})},vt=function(n){n.on("keydown",function(e){e.keyCode===An.BACKSPACE?Pe(n,!1)&&e.preventDefault():e.keyCode===An.DELETE&&Pe(n,!0)&&e.preventDefault()})},ht=Pe,Nt=function(n){return{backspaceDelete:function(e){ht(n,e)}}},yt=function(t){t.on("BeforeExecCommand",function(e){var n=e.command.toLowerCase();"indent"===n?he(t):"outdent"===n&&Ne(t)}),t.addCommand("InsertUnorderedList",function(e,n){mt.toggleList(t,"UL",n)}),t.addCommand("InsertOrderedList",function(e,n){mt.toggleList(t,"OL",n)}),t.addCommand("InsertDefinitionList",function(e,n){mt.toggleList(t,"DL",n)}),t.addCommand("RemoveList",function(){ye(t)}),t.addQueryStateHandler("InsertUnorderedList",Me(t,"UL")),t.addQueryStateHandler("InsertOrderedList",Me(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",Me(t,"DL"))},St=function(e){return e.getParam("lists_indent_on_tab",!0)},Ot=function(e){St(e)&&function(n){n.on("keydown",function(e){e.keyCode!==An.TAB||An.metaKeyPressed(e)||n.undoManager.transact(function(){(e.shiftKey?Ne(n):he(n))&&e.preventDefault()})})}(e),vt(e)},Ct=function(n){function e(e){return function(){return n.execCommand(e)}}var t,r,o;r="advlist",o=(t=n).settings.plugins?t.settings.plugins:"",-1===Pn.inArray(o.split(/[ ,]/),r)&&(n.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:Ue(n,"OL")}),n.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:Ue(n,"UL")}))};!function bt(){i.add("lists",function(e){return Ot(e),Ct(e),yt(e),Nt(e)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function e(){}function o(e){return function(){return e}}function t(){return u}var r,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=function(){return(d=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},a=o(!1),c=o(!0),u=(r={fold:function(e,t){return e()},is:a,isSome:a,isNone:c,getOr:l,getOrThunk:s,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:l,orThunk:s,map:t,each:e,bind:t,exists:a,forall:c,filter:t,equals:i,equals_:i,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(r),r);function i(e){return e.isNone()}function s(e){return e()}function l(e){return e}function m(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===t}}function f(e,t){for(var r=0,n=e.length;r<n;r++){t(e[r],r)}}function h(e,t){return G(e,t)?E(e[t]):D()}function p(t){return function(e){return e?function(e){return e.replace(/px$/,"")}(e.style[t]):""}}function g(r){return function(e,t){e&&(e.style[r]=function(e){return/^[0-9.]+$/.test(e)?e+"px":e}(t))}}function v(e,t){if(e)for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r].filter))return e[r]}function b(e){return ae.getAttrib(e,"data-ephox-embed-iri")}function w(e,t){return function(e){var t=ae.createFragment(e);return""!==b(t.firstChild)}(t)?function(e){var t=ae.createFragment(e).firstChild;return{type:"ephox-embed-iri",source1:b(t),source2:"",poster:"",width:oe.getMaxWidth(t),height:oe.getMaxHeight(t)}}(t):function(n,e){var i={};return ne({validate:!1,allow_conditional_comments:!0,start:function(e,t){if(i.source1||"param"!==e||(i.source1=t.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(i.type||(i.type=e),i=re.extend(t.map,i)),"script"===e){var r=v(n,t.map.src);if(!r)return;i={type:"script",source1:t.map.src,width:String(r.width),height:String(r.height)}}"source"===e&&(i.source1?i.source2||(i.source2=t.map.src):i.source1=t.map.src),"img"!==e||i.poster||(i.poster=t.map.src)}}).parse(e),i.source1=i.source1||i.src||i.data,i.source2=i.source2||"",i.poster=i.poster||"",i}(e,t)}function y(e,t){var r,n,i,o;for(r in t)if(i=""+t[r],e.map[r])for(n=e.length;n--;)(o=e[n]).name===r&&(i?(e.map[r]=i,o.value=i):(delete e.map[r],e.splice(n,1)));else i&&(e.push({name:r,value:i}),e.map[r]=i)}function x(e,t){var r=me.createFragment(e).firstChild;return oe.setMaxWidth(r,t.width),oe.setMaxHeight(r,t.height),function(e){var t=se();return ne(t).parse(e),t.getContent()}(r.outerHTML)}function j(r,e){var n=re.extend({},e);if(!n.source1&&(re.extend(n,w(J(r),n.embed)),!n.source1))return"";n.source2||(n.source2=""),n.poster||(n.poster=""),n.source1=r.convertURL(n.source1,"source"),n.source2=r.convertURL(n.source2,"source"),n.source1mime=ue(n.source1),n.source2mime=ue(n.source2),n.poster=r.convertURL(n.poster,"poster");var t=function(t){var e=fe.filter(function(e){return e.regex.test(t)});return 0<e.length?re.extend({},e[0],{url:function(e,t){for(var r=e.regex.exec(t),n=e.url,i=function(e){n=n.replace("$"+e,function(){return r[e]?r[e]:""})},o=0;o<r.length;o++)i(o);return n.replace(/\?$/,"")}(e[0],t)}):null}(n.source1);if(t&&(n.source1=t.url,n.type=t.type,n.allowFullscreen=t.allowFullscreen,n.width=n.width||String(t.w),n.height=n.height||String(t.h)),n.embed)return de(n.embed,n,!0);var i=v(J(r),n.source1);i&&(n.type="script",n.width=String(i.width),n.height=String(i.height));var o=K(r),a=Q(r);return n.width=n.width||"300",n.height=n.height||"150",re.each(n,function(e,t){n[t]=r.dom.encode(""+e)}),"iframe"===n.type?function(e){var t=e.allowFullscreen?' allowFullscreen="1"':"";return'<iframe src="'+e.source1+'" width="'+e.width+'" height="'+e.height+'"'+t+"></iframe>"}(n):"application/x-shockwave-flash"===n.source1mime?function(e){var t='<object data="'+e.source1+'" width="'+e.width+'" height="'+e.height+'" type="application/x-shockwave-flash">';return e.poster&&(t+='<img src="'+e.poster+'" width="'+e.width+'" height="'+e.height+'" />'),t+="</object>"}(n):-1!==n.source1mime.indexOf("audio")?function(e,t){return t?t(e):'<audio controls="controls" src="'+e.source1+'">'+(e.source2?'\n<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</audio>"}(n,o):"script"===n.type?function(e){return'<script src="'+e.source1+'"><\/script>'}(n):function(e,t){return t?t(e):'<video width="'+e.width+'" height="'+e.height+'"'+(e.poster?' poster="'+e.poster+'"':"")+' controls="controls">\n<source src="'+e.source1+'"'+(e.source1mime?' type="'+e.source1mime+'"':"")+" />\n"+(e.source2?'<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</video>"}(n,a)}function O(t){return function(e){return j(t,e)}}function A(e){var r=q(e,{source1:e.source1.value,source2:h(e,"source2").bind(function(e){return h(e,"value")}).getOr(""),poster:h(e,"poster").bind(function(e){return h(e,"value")}).getOr("")});return h(e,"dimensions").each(function(e){f(["width","height"],function(t){h(e,t).each(function(e){return r[t]=e})})}),r}function S(e){var n=q(e,{source1:{value:h(e,"source1").getOr("")},source2:{value:h(e,"source2").getOr("")},poster:{value:h(e,"poster").getOr("")}});return f(["width","height"],function(r){h(e,r).each(function(e){var t=n.dimensions||{};t[r]=e,n.dimensions=t})}),n}function _(r){return function(e){var t=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";r.notificationManager.open({type:"error",text:t})}}function C(e,t){return w(J(e),t)}function M(i,o){return function(e){if(N(e.url)&&0<e.url.trim().length){var t=e.html,r=C(o,t),n=d(d({},r),{source1:e.url,embed:t});i.setData(S(n))}}}function F(e,t){var r=e.dom.select("img[data-mce-object]");e.insertContent(t),function(e,t){for(var r=e.dom.select("img[data-mce-object]"),n=0;n<t.length;n++)for(var i=r.length-1;0<=i;i--)t[n]===r[i]&&r.splice(i,1);e.selection.select(r[0])}(e,r),e.nodeChanged()}function P(e,t){var r,n=t.name;return(r=new ye("img",1)).shortEnded=!0,Oe(e,t,r),r.attr({width:t.attr("width")||"300",height:t.attr("height")||("audio"===n?"30":"150"),style:t.attr("style"),src:xe.transparentSrc,"data-mce-object":n,"class":"mce-object mce-object-"+n}),r}function k(e,t){var r,n,i,o=t.name;return(r=new ye("span",1)).attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":o,"class":"mce-preview-object mce-object-"+o}),Oe(e,t,r),(n=new ye(o,1)).attr({src:t.attr("src"),allowfullscreen:t.attr("allowfullscreen"),style:t.attr("style"),"class":t.attr("class"),width:t.attr("width"),height:t.attr("height"),frameborder:"0"}),(i=new ye("span",1)).attr("class","mce-shim"),r.append(n),r.append(i),r}function T(e){for(;e=e.parent;)if(e.attr("data-ephox-embed-iri")||(void 0,(t=e.attr("class"))&&/\btiny-pageembed\b/.test(t)))return!0;var t;return!1}var $,z=function(r){function e(){return i}function t(e){return e(r)}var n=o(r),i={fold:function(e,t){return t(r)},is:function(e){return r===e},isSome:c,isNone:a,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(e){return z(e(r))},each:function(e){e(r)},bind:t,exists:t,forall:t,filter:function(e){return e(r)?i:u},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(e){return e.is(r)},equals_:function(e,t){return e.fold(a,function(e){return t(r,e)})}};return i},D=t,E=function(e){return null===e||e===undefined?u:z(e)},N=m("string"),U=m("array"),R=m("function"),L=Array.prototype.slice,W=Array.prototype.push,H=(R(Array.from)&&Array.from,function(e){function t(){return r}var r=e;return{get:t,set:function(e){r=e},clone:function(){return H(t())}}}),I=Object.prototype.hasOwnProperty,q=($=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},n=0;n<e.length;n++){var i=e[n];for(var o in i)I.call(i,o)&&(r[o]=$(r[o],i[o]))}return r}),B=Object.hasOwnProperty,G=function(e,t){return B.call(e,t)},J=function(e){return e.getParam("media_scripts")},K=function(e){return e.getParam("audio_template_callback")},Q=function(e){return e.getParam("video_template_callback")},V=function(e){return e.getParam("media_live_embeds",!0)},X=function(e){return e.getParam("media_filter_html",!0)},Y=function(e){return e.getParam("media_url_resolver")},Z=function(e){return e.getParam("media_alt_source",!0)},ee=function(e){return e.getParam("media_poster",!0)},te=function(e){return e.getParam("media_dimensions",!0)},re=tinymce.util.Tools.resolve("tinymce.util.Tools"),ne=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),ie=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),oe={getMaxWidth:p("maxWidth"),getMaxHeight:p("maxHeight"),setMaxWidth:g("maxWidth"),setMaxHeight:g("maxHeight")},ae=ie.DOM,ce=tinymce.util.Tools.resolve("tinymce.util.Promise"),ue=function(e){var t={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[e.toLowerCase().split(".").pop()];return t||""},se=tinymce.util.Tools.resolve("tinymce.html.Writer"),le=tinymce.util.Tools.resolve("tinymce.html.Schema"),me=ie.DOM,de=function(e,t,r){return function(e){var t=me.createFragment(e);return""!==me.getAttrib(t.firstChild,"data-ephox-embed-iri")}(e)?x(e,t):function(e,i,o){var a,c=se(),u=0;return ne({validate:!1,allow_conditional_comments:!0,comment:function(e){c.comment(e)},cdata:function(e){c.cdata(e)},text:function(e,t){c.text(e,t)},start:function(e,t,r){switch(e){case"video":case"object":case"embed":case"img":case"iframe":i.height!==undefined&&i.width!==undefined&&y(t,{width:i.width,height:i.height})}if(o)switch(e){case"video":y(t,{poster:i.poster,src:""}),i.source2&&y(t,{src:""});break;case"iframe":y(t,{src:i.source1});break;case"source":if(++u<=2&&(y(t,{src:i["source"+u],type:i["source"+u+"mime"]}),!i["source"+u]))return;break;case"img":if(!i.poster)return;a=!0}c.start(e,t,r)},end:function(e){if("video"===e&&o)for(var t=1;t<=2;t++)if(i["source"+t]){var r=[];r.map={},u<t&&(y(r,{src:i["source"+t],type:i["source"+t+"mime"]}),c.start("source",r,!0))}if(i.poster&&"object"===e&&o&&!a){var n=[];n.map={},y(n,{src:i.poster,width:i.width,height:i.height}),c.start("img",n,!0)}c.end(e)}},le({})).parse(e),c.getContent()}(e,t,r)},fe=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&amp;byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],he={},pe=function(e,t){var r=Y(e);return r?function(n,i,o){return new ce(function(t,e){function r(e){return e.html&&(he[n.source1]=e),t({url:n.source1,html:e.html?e.html:i(n)})}he[n.source1]?r(he[n.source1]):o({url:n.source1},r,e)})}(t,O(e),r):function(t,r){return new ce(function(e){e({html:r(t),url:t.source1})})}(t,O(e))},ge=function(e){return he.hasOwnProperty(e)},ve=function(n){function i(e){return A(e.getData())}var e=function(e){var t=e.selection.getNode(),r=function(e){return e.getAttribute("data-mce-object")||e.getAttribute("data-ephox-embed-iri")}(t)?e.serializer.serialize(t,{selection:!0}):"";return q({embed:r},w(J(e),r))}(n),r=H(e),t=S(e),o={title:"General",name:"general",items:function(e){for(var t=[],r=0,n=e.length;r<n;++r){if(!U(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);W.apply(t,e[r])}return t}([[{name:"source1",type:"urlinput",filetype:"media",label:"Source"}],te(n)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[]])},a={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},c=[];Z(n)&&c.push({name:"source2",type:"urlinput",filetype:"media",label:"Alternative source URL"}),ee(n)&&c.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var u={title:"Advanced",name:"advanced",items:c},s=[o,a];0<c.length&&s.push(u);var l={type:"tabpanel",tabs:s},m=n.windowManager.open({title:"Insert/Edit Media",size:"normal",body:l,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var t=i(e);!function(e,t,r){t.embed=de(t.embed,t),t.embed&&(e.source1===t.source1||ge(t.source1))?F(r,t.embed):pe(r,t).then(function(e){F(r,e.html)})["catch"](_(r))}(r.get(),t,n),e.close()},onChange:function(e,t){switch(t.name){case"source1":!function(e,t){var r=i(t);e.source1!==r.source1&&(M(m,n)({url:r.source1,html:""}),pe(n,r).then(M(m,n))["catch"](_(n)))}(r.get(),e);break;case"embed":!function(e){var t=A(e.getData()),r=C(n,t.embed);e.setData(S(r))}(e);break;case"dimensions":case"poster":!function(e){var t=i(e),r=j(n,t);e.setData(S(d(d({},t),{embed:r})))}(e)}r.set(i(e))},initialData:t})},be=function(e){return{showDialog:function(){ve(e)}}},we=function(e){e.addCommand("mceMedia",function(){ve(e)})},ye=tinymce.util.Tools.resolve("tinymce.html.Node"),xe=tinymce.util.Tools.resolve("tinymce.Env"),je=function(i,e){if(!1===X(i))return e;var o,a=se();return ne({validate:!1,allow_conditional_comments:!1,comment:function(e){a.comment(e)},cdata:function(e){a.cdata(e)},text:function(e,t){a.text(e,t)},start:function(e,t,r){if(o=!0,"script"!==e&&"noscript"!==e){for(var n=0;n<t.length;n++){if(0===t[n].name.indexOf("on"))return;"style"===t[n].name&&(t[n].value=i.dom.serializeStyle(i.dom.parseStyle(t[n].value),e))}a.start(e,t,r),o=!1}},end:function(e){o||a.end(e)}},le({})).parse(e),a.getContent()},Oe=function(e,t,r){var n,i,o,a,c;for(a=(o=t.attributes).length;a--;)n=o[a].name,i=o[a].value,"width"!==n&&"height"!==n&&"style"!==n&&("data"!==n&&"src"!==n||(i=e.convertURL(i,n)),r.attr("data-mce-p-"+n,i));(c=t.firstChild&&t.firstChild.value)&&(r.attr("data-mce-html",escape(je(e,c))),r.firstChild=null)},Ae=function(i){return function(e){for(var t,r,n=e.length;n--;)(t=e[n]).parent&&(t.parent.attr("data-mce-object")||"script"===t.name&&!(r=v(J(i),t.attr("src")))||(r&&(r.width&&t.attr("width",r.width.toString()),r.height&&t.attr("height",r.height.toString())),"iframe"===t.name&&V(i)&&xe.ceFalse?T(t)||t.replace(k(i,t)):T(t)||t.replace(P(i,t))))}},Se=function(d){d.on("preInit",function(){var t=d.schema.getSpecialElements();re.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")});var r=d.schema.getBoolAttrs();re.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){r[e]={}}),d.parser.addNodeFilter("iframe,video,audio,object,embed,script",Ae(d)),d.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var r,n,i,o,a,c,u,s,l=e.length;l--;)if((r=e[l]).parent){for(u=r.attr(t),n=new ye(u,1),"audio"!==u&&"script"!==u&&((s=r.attr("class"))&&-1!==s.indexOf("mce-preview-object")?n.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):n.attr({width:r.attr("width"),height:r.attr("height")})),n.attr({style:r.attr("style")}),i=(o=r.attributes).length;i--;){var m=o[i].name;0===m.indexOf("data-mce-p-")&&n.attr(m.substr(11),o[i].value)}"script"===u&&n.attr("type","text/javascript"),(a=r.attr("data-mce-html"))&&((c=new ye("#text",3)).raw=!0,c.value=je(d,unescape(a)),n.append(c)),r.replace(n)}})}),d.on("SetContent",function(){d.$("span.mce-preview-object").each(function(e,t){var r=d.$(t);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')})})},_e=function(e){e.on("ResolveName",function(e){var t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)})},Ce=function(t){t.on("click keyup touchend",function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")}),t.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");"audio"!==t&&"script"!==t||e.preventDefault()}),t.on("ObjectResized",function(e){var t,r=e.target;r.getAttribute("data-mce-object")&&(t=r.getAttribute("data-mce-html"))&&(t=unescape(t),r.setAttribute("data-mce-html",escape(de(t,{width:String(e.width),height:String(e.height)}))))})},Me=function(e){e.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:function(){e.execCommand("mceMedia")},onSetup:function(t,r){return function(e){return t.selection.selectorChangedWithUnbind(r.join(","),e.setActive).unbind}}(e,["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"])}),e.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:function(){e.execCommand("mceMedia")}})};!function Fe(){n.add("media",function(e){return we(e),Me(e),_e(e),Se(e),Ce(e),be(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function o(n,e){for(var t="",o=0;o<e;o++)t+=n;return t}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n){var e=n.getParam("nonbreaking_force_tab",0);return"boolean"==typeof e?!0===e?3:0:e},a=function(n){return n.getParam("nonbreaking_wrap",!0,"boolean")},r=function(n,e){var t=a(n)||n.plugins.visualchars?'<span class="'+(function(n){return!!n.plugins.visualchars&&n.plugins.visualchars.isEnabled()}(n)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap")+'" contenteditable="false">'+o("&nbsp;",e)+"</span>":o("&nbsp;",e);n.undoManager.transact(function(){return n.insertContent(t)})},e=function(n){n.addCommand("mceNonBreaking",function(){r(n,1)})},c=tinymce.util.Tools.resolve("tinymce.util.VK"),t=function(e){var t=i(e);0<t&&e.on("keydown",function(n){if(n.keyCode===c.TAB&&!n.isDefaultPrevented()){if(n.shiftKey)return;n.preventDefault(),n.stopImmediatePropagation(),r(e,t)}})},u=function(n){n.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:function(){return n.execCommand("mceNonBreaking")}}),n.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:function(){return n.execCommand("mceNonBreaking")}})};!function s(){n.add("nonbreaking",function(n){e(n),u(n),t(n)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function c(n){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(n)}}function l(i,o,c){return function(t){var n=arguments,e=n[n.length-2],r=0<e?o.charAt(e-1):"";if('"'===r)return t;if(">"===r){var a=o.lastIndexOf("<",e);if(-1!==a)if(-1!==o.substring(a,e).indexOf('contenteditable="false"'))return t}return'<span class="'+c+'" data-mce-content="'+i.dom.encode(n[0])+'">'+i.dom.encode("string"==typeof n[1]?n[1]:n[0])+"</span>"}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},s=function(t){return t.getParam("noneditable_editable_class","mceEditable")},d=function(t){var n=t.getParam("noneditable_regexp",[]);return n&&n.constructor===RegExp?[n]:n},n=function(n){var t,e,r="contenteditable";t=" "+u.trim(s(n))+" ",e=" "+u.trim(f(n))+" ";var a=c(t),i=c(e),o=d(n);n.on("PreInit",function(){0<o.length&&n.on("BeforeSetContent",function(t){!function(t,n,e){var r=n.length,a=e.content;if("raw"!==e.format){for(;r--;)a=a.replace(n[r],l(t,a,f(t)));e.content=a}}(n,o,t)}),n.parser.addAttributeFilter("class",function(t){for(var n,e=t.length;e--;)n=t[e],a(n)?n.attr(r,"true"):i(n)&&n.attr(r,"false")}),n.serializer.addAttributeFilter(r,function(t){for(var n,e=t.length;e--;)n=t[e],(a(n)||i(n))&&(0<o.length&&n.attr("data-mce-content")?(n.name="#text",n.type=3,n.raw=!0,n.value=n.attr("data-mce-content")):n.attr(r,null))})})};!function e(){t.add("noneditable",function(t){n(t)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function e(){return"mce-pagebreak"}function a(){return'<img src="'+t.transparentSrc+'" class="mce-pagebreak" data-mce-resize="false" data-mce-placeholder />'}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),r=function(e){return e.getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e")},i=function(e){return e.getParam("pagebreak_split_block",!1)},o=function(o){var c=r(o),n=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi");o.on("BeforeSetContent",function(e){e.content=e.content.replace(n,a())}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var n,a,t=e.length;t--;)if((a=(n=e[t]).attr("class"))&&-1!==a.indexOf("mce-pagebreak")){var r=n.parent;if(o.schema.getBlockElements()[r.name]&&i(o)){r.type=3,r.value=c,r.raw=!0,n.remove();continue}n.type=3,n.value=c,n.raw=!0}})})},c=a,u=e,g=function(e){e.addCommand("mcePageBreak",function(){e.settings.pagebreak_split_block?e.insertContent("<p>"+c()+"</p>"):e.insertContent(c())})},m=function(n){n.on("ResolveName",function(e){"IMG"===e.target.nodeName&&n.dom.hasClass(e.target,u())&&(e.name="pagebreak")})},s=function(e){e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:function(){return e.execCommand("mcePageBreak")}}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:function(){return e.execCommand("mcePageBreak")}})};!function l(){n.add("pagebreak",function(e){g(e),s(e),o(e),m(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
- !function(f){"use strict";function t(){}function i(t){return function(){return t}}function e(){return v}var n,d=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return d(e())}}},r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(t){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(t.settings.plugins)||!r.get("powerpaste"))&&("undefined"!=typeof f.window.console&&f.window.console.log&&f.window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0)},a=function(t,e){return{clipboard:t,quirks:e}},s=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})},c=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})},o=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},m=function(t,e){return t.fire("paste",{ieFake:e})},l=function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),o(t,!1)):(e.pasteFormat.set("text"),o(t,!0)),t.focus()},p=function(t,n){t.addCommand("mceTogglePlainTextPaste",function(){l(t,n)}),t.addCommand("mceInsertClipboardContent",function(t,e){e.content&&n.pasteHtml(e.content,e.internal),e.text&&n.pasteText(e.text)})},g=i(!1),h=i(!0),v=(n={fold:function(t,e){return t()},is:g,isSome:g,isNone:h,getOr:w,getOrThunk:b,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:w,orThunk:b,map:e,each:t,bind:e,exists:g,forall:h,filter:e,equals:y,equals_:y,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(n),n);function y(t){return t.isNone()}function b(t){return t()}function w(t){return t}function x(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}function _(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}}var P,T,D,C,k,F=function(n){function t(){return o}function e(t){return t(n)}var r=i(n),o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:h,isNone:g,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return F(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?o:v},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(g,function(t){return e(n,t)})}};return o},S={some:F,none:e,from:function(t){return null===t||t===undefined?v:F(t)}},E=(P="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===P}),I=Array.prototype.slice,R=E(Array.from)?Array.from:function(t){return I.call(t)},O={},A={exports:O};T=undefined,D=O,C=A,k=undefined,function(t){"object"==typeof D&&void 0!==C?C.exports=t():"function"==typeof T&&T.amd?T([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function l(i,u,a){function s(e,t){if(!u[e]){if(!i[e]){var n="function"==typeof k&&k;if(!t&&n)return n(e,!0);if(c)return c(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[e]={exports:{}};i[e][0].call(o.exports,function(t){return s(i[e][1][t]||t)},o,o.exports,l,i,u,a)}return u[e].exports}for(var c="function"==typeof k&&k,t=0;t<a.length;t++)s(a[t]);return s}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var c,l=[],f=!1,d=-1;function m(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&p())}function p(){if(!f){var t=s(m);f=!0;for(var e=l.length;e;){for(c=l,l=[];++d<e;)c&&c[d].run();d=-1,e=l.length}c=null,f=!1,function n(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{return o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function h(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new g(t,e)),1!==l.length||f||s(p)},g.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=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,f,e){(function(e){function r(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],l(t,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,i._immediateFn(function(){var t=1===r._state?o.onFulfilled:o.onRejected;if(null!==t){var e;try{e=t(r._value)}catch(n){return void a(o.promise,n)}u(o.promise,e)}else(1===r._state?u:a)(o.promise,r._value)})):r._deferreds.push(o)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l(function r(t,e){return function(){t.apply(e,arguments)}}(n,e),t)}t._state=1,t._value=e,s(t)}catch(o){a(t,o)}}function a(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)o(t,t._deferreds[e]);t._deferreds=null}function c(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t(function(t){n||(n=!0,u(e,t))},function(t){n||(n=!0,a(e,t))})}catch(r){if(n)return;n=!0,a(e,r)}}var t,n;t=this,n=setTimeout,i.prototype["catch"]=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(r);return o(this,new c(t,e,n)),n},i.all=function(t){var s=Array.prototype.slice.call(t);return new i(function(o,i){if(0===s.length)return o([]);var u=s.length;function a(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){a(e,t)},i)}s[e]=t,0==--u&&o(s)}catch(r){i(r)}}for(var t=0;t<s.length;t++)a(t,s[t])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(n){return new i(function(t,e){e(n)})},i.race=function(o){return new i(function(t,e){for(var n=0,r=o.length;n<r;n++)o[n].then(t,e)})},i._immediateFn="function"==typeof e?function(t){e(t)}:function(t){n(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==f&&f.exports?f.exports=i:t.Promise||(t.Promise=i)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(s,t,c){(function(t,e){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,o=Array.prototype.slice,i={},u=0;function a(t,e){this._id=t,this._clearFn=e}c.setTimeout=function(){return new a(n.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new a(n.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(t){t.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},c.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},c._unrefActive=c.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},c.setImmediate="function"==typeof t?t:function(t){var e=u++,n=!(arguments.length<2)&&o.call(arguments,1);return i[e]=!0,r(function(){i[e]&&(n?t.apply(null,n):t.call(null),c.clearImmediate(e))}),e},c.clearImmediate="function"==typeof e?e:function(t){delete i[t]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});function j(t){f.setTimeout(function(){throw t},0)}function M(i,t){return t(function(n){var r=[],o=0;0===i.length?n([]):_(i,function(t,e){t.get(function(e){return function(t){r[e]=t,++o>=i.length&&n(r)}}(e))})})}function L(t,e){return function(t){return M(t,z)}(x(t,e))}function N(t){return t.replace(/\r?\n/g,"<br>")}function B(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+et.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",u=q.map(r,function(t){return t.split(/\n/).join("<br />")});return 1===u.length?u[0]:q.map(u,function(t){return o+t+i}).join("")}var H=A.exports.boltExport,$=function(t){var n=S.none(),e=[],r=function(t){o()?u(t):e.push(t)},o=function(){return n.isSome()},i=function(t){_(t,u)},u=function(e){n.each(function(t){f.setTimeout(function(){e(t)},0)})};return t(function(t){n=S.some(t),i(e),e=[]}),{get:r,map:function(n){return $(function(e){r(function(t){e(n(t))})})},isReady:o}},W={nu:$,pure:function(e){return $(function(t){t(e)})}},U=function(n){function t(t){n().then(t,j)}return{map:function(t){return U(function(){return n().then(t)})},bind:function(e){return U(function(){return n().then(function(t){return e(t).toPromise()})})},anonBind:function(t){return U(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return W.nu(t)},toCached:function(){var t=null;return U(function(){return null===t&&(t=n()),t})},toPromise:n,get:t}},z=function(t){return U(function(){return new H(t)})},V=tinymce.util.Tools.resolve("tinymce.Env"),K=tinymce.util.Tools.resolve("tinymce.util.Delay"),q=tinymce.util.Tools.resolve("tinymce.util.Tools"),G=tinymce.util.Tools.resolve("tinymce.util.VK"),X="x-tinymce/html",Y="\x3c!-- "+X+" --\x3e",Z=function(t){return Y+t},J=function(t){return t.replace(Y,"")},Q=function(t){return-1!==t.indexOf(Y)},tt=function(){return X},et=tinymce.util.Tools.resolve("tinymce.html.Entities"),nt=function(t){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(t)},rt=function(t,e,n){return e?B(t,!0===e?"p":e,n):N(t)},ot=tinymce.util.Tools.resolve("tinymce.html.DomParser"),it=tinymce.util.Tools.resolve("tinymce.html.Serializer"),ut=tinymce.util.Tools.resolve("tinymce.html.Node"),at=tinymce.util.Tools.resolve("tinymce.html.Schema"),st={shouldBlockDrop:function(t){return t.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(t){return t.getParam("paste_data_images",!1)},shouldFilterDrop:function(t){return t.getParam("paste_filter_drop",!0)},getPreProcess:function(t){return t.getParam("paste_preprocess")},getPostProcess:function(t){return t.getParam("paste_postprocess")},getWebkitStyles:function(t){return t.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(t){return t.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(t){return t.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(t){return t.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(t){return t.getParam("paste_as_text",!1)},getRetainStyleProps:function(t){return t.getParam("paste_retain_style_properties")},getWordValidElements:function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(t){return t.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(t){return t.getParam("paste_enable_default_filters",!0)}};function ct(e,t){return q.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var lt={filter:ct,innerText:function ae(t){var e=at(),n=ot({},e),r="",o=e.getShortEndedElements(),i=q.makeMap("script noscript style textarea video audio iframe object"," "),u=e.getBlockElements();return t=ct(t,[/<!\[[^\]]+\]>/g]),function a(t){var e=t.name,n=t;if("br"!==e){if("wbr"!==e)if(o[e]&&(r+=" "),i[e])r+=" ";else{if(3===t.type&&(r+=t.value),!t.shortEnded&&(t=t.firstChild))for(;a(t),t=t.next;);u[e]&&n.next&&(r+="\n","p"===e&&(r+="\n"))}}else r+="\n"}(n.parse(t)),r},trimHtml:function se(t){return t=ct(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function r(t,e,n){return e||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function ce(t){var e=0;return function(){return t+e++}},isMsEdge:function(){return-1!==f.navigator.userAgent.indexOf(" Edge/")}};function ft(e){var n,t;return t=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],e=e.replace(/^[\u00a0 ]+/,""),q.each(t,function(t){if(t.test(e))return!(n=!0)}),n}function dt(t){var i,u,a=1;function n(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)for(;e+=n(t),t=t.next;);return e}function s(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!s(t,e))return!1}while(t=t.next);return!0}function e(t,e,n){var r=t._listLevel||a;r!==a&&(i=r<a?i&&i.parent.parent:(u=i,null)),i&&i.name===e?i.append(t):(u=u||i,i=new ut(e,1),1<n&&i.attr("start",""+n),t.wrap(i)),t.name="li",a<r&&u&&u.lastChild.append(i),a=r,function o(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)for(;o(t),t=t.next;);}(t),s(t,/^\u00a0+/),s(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),s(t,/^\u00a0+/)}for(var r=[],o=t.firstChild;null!=o;)if(r.push(o),null!==(o=o.walk()))for(;void 0!==o&&o.parent!==t;)o=o.walk();for(var c=0;c<r.length;c++)if("p"===(t=r[c]).name&&t.firstChild){var l=n(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(l)){e(t,"ul");continue}if(ft(l)){var f=/([0-9]+)\./.exec(l),d=1;f&&(d=parseInt(f[1],10)),e(t,"ol",d);continue}if(t._listLevel){e(t,"ul",1);continue}i=null}else u=i,i=null}function mt(n,r,o,i){var u,a={},t=n.dom.parseStyle(i);return q.each(t,function(t,e){switch(e){case"mso-list":(u=/\w+ \w+([0-9]+)/i.exec(i))&&(o._listLevel=parseInt(u[1],10)),/Ignore/i.test(t)&&o.firstChild&&(o._listIgnore=!0,o.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":return void("normal"!==t&&(a[e]=t));case"mso-element":if(/^(comment|comment-list)$/i.test(t))return void o.remove()}0!==e.indexOf("mso-comment")?0!==e.indexOf("mso-")&&("all"===st.getRetainStyleProps(n)||r&&r[e])&&(a[e]=t):o.remove()}),/(bold)/i.test(a["font-weight"])&&(delete a["font-weight"],o.wrap(new ut("b",1))),/(italic)/i.test(a["font-style"])&&(delete a["font-style"],o.wrap(new ut("i",1))),(a=n.dom.serializeStyle(a,o.name))||null}function pt(t,e){return{content:t,cancelled:e}}function gt(t,e,n,r){var o=s(t,e,n,r),i=function(t,e){var n=ot({},t.schema);n.addNodeFilter("meta",function(t){q.each(t,function(t){return t.remove()})});var r=n.parse(e,{forced_root_block:!1,isRootContent:!0});return it({validate:t.settings.validate},t.schema).serialize(r)}(t,o.content);return t.hasEventListeners("PastePostProcess")&&!o.isDefaultPrevented()?function(t,e,n,r){var o=t.dom.create("div",{style:"display:none"},e),i=c(t,o,n,r);return pt(i.node.innerHTML,i.isDefaultPrevented())}(t,i,n,r):pt(i,o.isDefaultPrevented())}function ht(t,e){return t.insertContent(e,{merge:st.shouldMergeFormats(t),paste:!0}),!0}function vt(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)}function yt(t){return vt(t)&&/.(gif|jpe?g|png)$/.test(t)}function bt(t,e,n){return!(!1!==t.selection.isCollapsed()||!vt(e))&&function(t,e,n){return t.undoManager.extra(function(){n(t,e)},function(){t.execCommand("mceInsertLink",!1,e)}),!0}(t,e,n)}function wt(t,e,n){return!!yt(e)&&function(t,e,n){return t.undoManager.extra(function(){n(t,e)},function(){t.insertContent('<img src="'+e+'">')}),!0}(t,e,n)}function xt(t){return"\n"===t||"\r"===t}function _t(n){return function(t,e,n){return _(t,function(t){n=e(n,t)}),n}(n,function(t,e){return function(t){return-1!==" \f\t\x0B".indexOf(t)}(e)||"\xa0"===e?t.pcIsSpace||""===t.str||t.str.length===n.length-1||function(t,e){return e<t.length&&0<=e&&xt(t[e])}(n,t.str.length+1)?{pcIsSpace:!1,str:t.str+"\xa0"}:{pcIsSpace:!0,str:t.str+" "}:{pcIsSpace:xt(e),str:t.str+e}},{pcIsSpace:!1,str:""}).str}function Pt(t,e,n){var r=n||Q(e),o=Vt(t,J(e),r);!1===o.cancelled&&Kt(t,o.content)}function Tt(t,e){var n=t.dom.encode(e).replace(/\r\n/g,"\n"),r=_t(n),o=rt(r,t.settings.forced_root_block,t.settings.forced_root_block_attrs);Pt(t,o,!1)}function Dt(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&0<n.length&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(i){e[o]=""}}}return e}function Ct(t,e){return e in t&&0<t[e].length}function kt(t){return Ct(t,"text/html")||Ct(t,"text/plain")}function Ft(e,t,n){var r=function(t){return"paste"===t.type}(t)?t.clipboardData:t.dataTransfer;if(e.settings.paste_data_images&&r){var o=function(t){var e=t.items?x(R(t.items),function(t){return t.getAsFile()}):[],n=t.files?R(t.files):[];return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(0<e.length?e:n,function(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)})}(r);if(0<o.length)return t.preventDefault(),function(t){return L(t,function(r){return z(function(t){var e=r.getAsFile?r.getAsFile():r,n=new window.FileReader;n.onload=function(){t({blob:e,uri:n.result})},n.readAsDataURL(e)})})}(o).get(function(t){n&&e.selection.setRng(n),_(t,function(t){!function(t,e){var n=function(t){var e;return-1!==(e=t.indexOf(","))?t.substr(e+1):null}(e.uri),r=qt(),o=t.settings.images_reuse_filename&&e.blob.name?function(t,e){var n=e.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i);return n?t.dom.encode(n[1]):null}(t,e.blob.name):r,i=new f.Image;if(i.src=e.uri,function(t,e){return!t.images_dataimg_filter||t.images_dataimg_filter(e)}(t.settings,i)){var u,a=t.editorUpload.blobCache,s=void 0;(u=a.findFirst(function(t){return t.base64()===n}))?s=u:(s=a.create(r,e.blob,n,o),a.add(s)),Pt(t,'<img src="'+s.blobUri()+'">',!1)}else Pt(t,'<img src="'+e.uri+'">',!1)}(e,t)})}),!0}return!1}function St(t){return G.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode}function Et(u,a,i){var s,c=function(){var e=d(S.none());return{clear:function(){e.set(S.none())},set:function(t){e.set(S.some(t))},isSet:function(){return e.get().isSome()},on:function(t){e.get().each(t)}}}();function l(t,e,n,r){var o,i;Ct(t,"text/html")?o=t["text/html"]:(o=a.getHtml(),r=r||Q(o),a.isDefaultContent(o)&&(n=!0)),o=lt.trimHtml(o),a.remove(),i=!1===r&&nt(o),o.length&&!i||(n=!0),n&&(o=Ct(t,"text/plain")&&i?t["text/plain"]:lt.innerText(o)),a.isDefaultContent(o)?e||u.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?Tt(u,o):Pt(u,o,r)}u.on("keydown",function(t){function e(t){St(t)&&!t.isDefaultPrevented()&&a.remove()}if(St(t)&&!t.isDefaultPrevented()){if((s=t.shiftKey&&86===t.keyCode)&&V.webkit&&-1!==f.navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),c.set(t),window.setTimeout(function(){c.clear()},100),V.ie&&s)return t.preventDefault(),void m(u,!0);a.remove(),a.create(),u.once("keyup",e),u.once("paste",function(){u.off("keyup",e)})}}),u.on("paste",function(t){var e=c.isSet(),n=function(t,e){var n=Dt(e.clipboardData||t.getDoc().dataTransfer);return lt.isMsEdge()?q.extend(n,{"text/html":""}):n}(u,t),r="text"===i.get()||s,o=Ct(n,tt());s=!1,t.isDefaultPrevented()||function(t){var e=t.clipboardData;return-1!==f.navigator.userAgent.indexOf("Android")&&e&&e.items&&0===e.items.length}(t)?a.remove():kt(n)||!Ft(u,t,a.getLastRng()||u.selection.getRng())?(e||t.preventDefault(),!V.ie||e&&!t.ieFake||Ct(n,"text/html")||(a.create(),u.dom.bind(a.getEl(),"paste",function(t){t.stopPropagation()}),u.getDoc().execCommand("Paste",!1,null),n["text/html"]=a.getHtml()),Ct(n,"text/html")?(t.preventDefault(),o=o||Q(n["text/html"]),l(n,e,r,o)):K.setEditorTimeout(u,function(){l(n,e,r,o)},0)):a.remove()})}function It(t){return V.ie&&t.inline?f.document.body:t.getBody()}function Rt(e,t,n){!function(t){return It(t)!==t.getBody()}(e)||e.dom.bind(t,"paste keyup",function(t){Xt(e,n)||e.fire("paste")})}function Ot(t,e){return e===t}function At(t){var e=d(null),n="%MCEPASTEBIN%";return{create:function(){return function(t,e,n){var r,o=t.dom,i=t.getBody();e.set(t.selection.getRng()),r=t.dom.add(It(t),"div",{id:"mcepastebin","class":"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n),(V.ie||V.gecko)&&o.setStyle(r,"left","rtl"===o.getStyle(i,"direction",!0)?65535:-65535),o.bind(r,"beforedeactivate focusin focusout",function(t){t.stopPropagation()}),Rt(t,r,n),r.focus(),t.selection.select(r,!0)}(t,e,n)},remove:function(){return function(t,e){if(Gt(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return Gt(t)},getHtml:function(){return function(n){function e(t,e){t.appendChild(e),n.dom.remove(e,!0)}var r,t,o,i,u;for(t=q.grep(It(n).childNodes,function(t){return"mcepastebin"===t.id}),r=t.shift(),q.each(t,function(t){e(r,t)}),o=(i=n.dom.select("div[id=mcepastebin]",r)).length-1;0<=o;o--)u=n.dom.create("div"),r.insertBefore(u,i[o]),e(u,i[o]);return r?r.innerHTML:""}(t)},getLastRng:function(){return function(t){return t.get()}(e)},isDefault:function(){return Xt(t,n)},isDefaultContent:function(t){return Ot(n,t)}}}function jt(n,t){var e=At(n);return n.on("PreInit",function(){return function(u,t,e){var a;Et(u,t,e),u.parser.addNodeFilter("img",function(t,e,n){function r(t){t.attr("data-mce-object")||a===V.transparentSrc||t.remove()}var o;if(!u.settings.paste_data_images&&((o=n).data&&!0===o.data.paste))for(var i=t.length;i--;)(a=t[i].attr("src"))&&(0===a.indexOf("webkit-fake-url")?r(t[i]):u.settings.allow_html_data_urls||0!==a.indexOf("data:")||r(t[i]))})}(n,e,t)}),{pasteFormat:t,pasteHtml:function(t,e){return Pt(n,t,e)},pasteText:function(t){return Tt(n,t)},pasteImageData:function(t,e){return Ft(n,t,e)},getDataTransferItems:Dt,hasHtmlOrText:kt,hasContentType:Ct}}function Mt(){}function Lt(t,e,n){if(!function(t){return!1===V.iOS&&t!==undefined&&"function"==typeof t.setData&&!0!==lt.isMsEdge()}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(tt(),e),!0}catch(r){return!1}}function Nt(t,e,n,r){Lt(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)}function Bt(a){return function(t,e){var n=Z(t),r=a.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=a.dom.create("div",{contenteditable:"true"},n);a.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(o),a.dom.add(a.getBody(),r);var i=a.selection.getRng();o.focus();var u=a.dom.createRng();u.selectNodeContents(o),a.selection.setRng(u),K.setTimeout(function(){a.selection.setRng(i),r.parentNode.removeChild(r),e()},0)}}function Ht(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}}function $t(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)}function Wt(t,e){return Zt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())}function Ut(t,e){t.focus(),t.selection.setRng(e)}var zt={preProcess:function(t,e){return st.shouldUseDefaultFilters(t)?function(r,t){var e,o;(e=st.getRetainStyleProps(r))&&(o=q.makeMap(e.split(/[, ]/))),t=lt.filter(t,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return 0<e.length?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join("\xa0"):""}]]);var n=st.getWordValidElements(r),i=at({valid_elements:n,valid_children:"-li[p]"});q.each(i.elements,function(t){t.attributes["class"]||(t.attributes["class"]={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))});var u=ot({},i);u.addAttributeFilter("style",function(t){for(var e,n=t.length;n--;)(e=t[n]).attr("style",mt(r,o,e,e.attr("style"))),"span"===e.name&&e.parent&&!e.attributes.length&&e.unwrap()}),u.addAttributeFilter("class",function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)}),u.addNodeFilter("del",function(t){for(var e=t.length;e--;)t[e].remove()}),u.addNodeFilter("a",function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=(n=n.split("#")[1])&&"#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()});var a=u.parse(t);return st.shouldConvertWordFakeLists(r)&&dt(a),t=it({validate:r.settings.validate},i).serialize(a)}(t,e):e},isWordContent:function le(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)}},Vt=function(t,e,n){var r=zt.isWordContent(e),o=r?zt.preProcess(t,e):e;return gt(t,o,n,r)},Kt=function(t,e){!1===st.isSmartPasteEnabled(t)?ht(t,e):function(e,n){q.each([bt,wt,ht],function(t){return!0!==t(e,n,ht)})}(t,e)},qt=lt.createIdGenerator("mceclip"),Gt=function(t){return t.dom.get("mcepastebin")},Xt=function(t,e){var n=Gt(t);return function(t){return t&&"mcepastebin"===t.id}(n)&&Ot(e,n.innerHTML)},Yt=function(t){t.on("cut",function(e){return function(t){$t(e)&&Nt(t,Ht(e),Bt(e),function(){if(V.browser.isChrome()){var t=e.selection.getRng();K.setEditorTimeout(e,function(){e.selection.setRng(t),e.execCommand("Delete")},0)}else e.execCommand("Delete")})}}(t)),t.on("copy",function(e){return function(t){$t(e)&&Nt(t,Ht(e),Bt(e),Mt)}}(t))},Zt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Jt=function(i,u,a){st.shouldBlockDrop(i)&&i.on("dragend dragover draggesture dragdrop drop drag",function(t){t.preventDefault(),t.stopPropagation()}),st.shouldPasteDataImages(i)||i.on("drop",function(t){var e=t.dataTransfer;e&&e.files&&0<e.files.length&&t.preventDefault()}),i.on("drop",function(t){var e,n;if(n=Wt(i,t),!t.isDefaultPrevented()&&!a.get()){e=u.getDataTransferItems(t.dataTransfer);var r=u.hasContentType(e,tt());if((u.hasHtmlOrText(e)&&!function(t){var e=t["text/plain"];return!!e&&0===e.indexOf("file://")}(e)||!u.pasteImageData(t,n))&&n&&st.shouldFilterDrop(i)){var o=e["mce-internal"]||e["text/html"]||e["text/plain"];o&&(t.preventDefault(),K.setEditorTimeout(i,function(){i.undoManager.transact(function(){e["mce-internal"]&&i.execCommand("Delete"),Ut(i,n),o=lt.trimHtml(o),e["text/html"]?u.pasteHtml(o,r):u.pasteText(o)})}))}}}),i.on("dragstart",function(t){a.set(!0)}),i.on("dragover dragend",function(t){st.shouldPasteDataImages(i)&&!1===a.get()&&(t.preventDefault(),Ut(i,Wt(i,t))),"dragend"===t.type&&a.set(!1)})},Qt=function(t){var e=t.plugins.paste,n=st.getPreProcess(t);n&&t.on("PastePreProcess",function(t){n.call(e,e,t)});var r=st.getPostProcess(t);r&&t.on("PastePostProcess",function(t){r.call(e,e,t)})};function te(e,n){e.on("PastePreProcess",function(t){t.content=n(e,t.content,t.internal,t.wordContent)})}function ee(t,e){if(!zt.isWordContent(e))return e;var n=[];q.each(t.schema.getBlockElements(),function(t,e){n.push(e)});var r=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return e=lt.filter(e,[[r,"$1"]]),e=lt.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function ne(t,e,n,r){if(r||n)return e;var c,o=st.getWebkitStyles(t);if(!1===st.shouldRemoveWebKitStyles(t)||"all"===o)return e;if(o&&(c=o.split(/[, ]/)),c){var l=t.dom,f=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(t,e,n,r){var o=l.parseStyle(l.decode(n)),i={};if("none"===c)return e+r;for(var u=0;u<c.length;u++){var a=o[c[u]],s=l.getStyle(f,c[u],!0);/color/.test(c[u])&&(a=l.toHex(a),s=l.toHex(s)),s!==a&&(i[c[u]]=a)}return(i=l.serializeStyle(i,"span"))?e+' style="'+i+'"'+r:e+r})}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(t,e,n,r){return e+' style="'+n+'"'+r})}function re(n,t){n.$("a",t).find("font,u").each(function(t,e){n.dom.remove(e,!0)})}function oe(n,r){return function(e){e.setActive("text"===r.pasteFormat.get());function t(t){return e.setActive(t.state)}return n.on("PastePlainTextToggle",t),function(){return n.off("PastePlainTextToggle",t)}}}var ie=function(t){V.webkit&&te(t,ne),V.ie&&(te(t,ee),function r(e,n){e.on("PastePostProcess",function(t){n(e,t.node)})}(t,re))},ue=function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:oe(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:oe(t,e)})};!function fe(){r.add("paste",function(t){if(!1===u(t)){var e=d(!1),n=d(st.isPasteAsTextEnabled(t)?"text":"html"),r=jt(t,n),o=ie(t);return ue(t,r),p(t,r),Qt(t),Yt(t),Jt(t,r,e),a(r,o)}})}()}(window);
9
+ !function(f){"use strict";function t(){}function i(t){return function(){return t}}function e(){return v}var n,d=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return d(e())}}},r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(t){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(t.settings.plugins)||!r.get("powerpaste"))&&("undefined"!=typeof f.window.console&&f.window.console.log&&f.window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0)},a=function(t,e){return{clipboard:t,quirks:e}},s=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})},c=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})},o=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},m=function(t,e){return t.fire("paste",{ieFake:e})},l=function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),o(t,!1)):(e.pasteFormat.set("text"),o(t,!0)),t.focus()},p=function(t,n){t.addCommand("mceTogglePlainTextPaste",function(){l(t,n)}),t.addCommand("mceInsertClipboardContent",function(t,e){e.content&&n.pasteHtml(e.content,e.internal),e.text&&n.pasteText(e.text)})},g=i(!1),h=i(!0),v=(n={fold:function(t,e){return t()},is:g,isSome:g,isNone:h,getOr:w,getOrThunk:b,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:w,orThunk:b,map:e,each:t,bind:e,exists:g,forall:h,filter:e,equals:y,equals_:y,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(n),n);function y(t){return t.isNone()}function b(t){return t()}function w(t){return t}function x(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}function _(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}}var P,T,D,C,k,F=function(n){function t(){return o}function e(t){return t(n)}var r=i(n),o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:h,isNone:g,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return F(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?o:v},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(g,function(t){return e(n,t)})}};return o},S={some:F,none:e,from:function(t){return null===t||t===undefined?v:F(t)}},E=(P="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===P}),I=Array.prototype.slice,R=E(Array.from)?Array.from:function(t){return I.call(t)},O={},A={exports:O};T=undefined,D=O,C=A,k=undefined,function(t){"object"==typeof D&&void 0!==C?C.exports=t():"function"==typeof T&&T.amd?T([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function l(i,u,a){function s(e,t){if(!u[e]){if(!i[e]){var n="function"==typeof k&&k;if(!t&&n)return n(e,!0);if(c)return c(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[e]={exports:{}};i[e][0].call(o.exports,function(t){return s(i[e][1][t]||t)},o,o.exports,l,i,u,a)}return u[e].exports}for(var c="function"==typeof k&&k,t=0;t<a.length;t++)s(a[t]);return s}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var c,l=[],f=!1,d=-1;function m(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&p())}function p(){if(!f){var t=s(m);f=!0;for(var e=l.length;e;){for(c=l,l=[];++d<e;)c&&c[d].run();d=-1,e=l.length}c=null,f=!1,function n(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{return o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function h(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new g(t,e)),1!==l.length||f||s(p)},g.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=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,f,e){(function(e){function r(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],l(t,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,i._immediateFn(function(){var t=1===r._state?o.onFulfilled:o.onRejected;if(null!==t){var e;try{e=t(r._value)}catch(n){return void a(o.promise,n)}u(o.promise,e)}else(1===r._state?u:a)(o.promise,r._value)})):r._deferreds.push(o)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l(function r(t,e){return function(){t.apply(e,arguments)}}(n,e),t)}t._state=1,t._value=e,s(t)}catch(o){a(t,o)}}function a(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)o(t,t._deferreds[e]);t._deferreds=null}function c(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t(function(t){n||(n=!0,u(e,t))},function(t){n||(n=!0,a(e,t))})}catch(r){if(n)return;n=!0,a(e,r)}}var t,n;t=this,n=setTimeout,i.prototype["catch"]=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(r);return o(this,new c(t,e,n)),n},i.all=function(t){var s=Array.prototype.slice.call(t);return new i(function(o,i){if(0===s.length)return o([]);var u=s.length;function a(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){a(e,t)},i)}s[e]=t,0==--u&&o(s)}catch(r){i(r)}}for(var t=0;t<s.length;t++)a(t,s[t])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(n){return new i(function(t,e){e(n)})},i.race=function(o){return new i(function(t,e){for(var n=0,r=o.length;n<r;n++)o[n].then(t,e)})},i._immediateFn="function"==typeof e?function(t){e(t)}:function(t){n(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==f&&f.exports?f.exports=i:t.Promise||(t.Promise=i)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(s,t,c){(function(t,e){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,o=Array.prototype.slice,i={},u=0;function a(t,e){this._id=t,this._clearFn=e}c.setTimeout=function(){return new a(n.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new a(n.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(t){t.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},c.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},c._unrefActive=c.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},c.setImmediate="function"==typeof t?t:function(t){var e=u++,n=!(arguments.length<2)&&o.call(arguments,1);return i[e]=!0,r(function(){i[e]&&(n?t.apply(null,n):t.call(null),c.clearImmediate(e))}),e},c.clearImmediate="function"==typeof e?e:function(t){delete i[t]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});function j(t){f.setTimeout(function(){throw t},0)}function M(i,t){return t(function(n){var r=[],o=0;0===i.length?n([]):_(i,function(t,e){t.get(function(e){return function(t){r[e]=t,++o>=i.length&&n(r)}}(e))})})}function L(t,e){return function(t){return M(t,z)}(x(t,e))}function N(t){return t.replace(/\r?\n/g,"<br>")}function B(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+et.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",u=q.map(r,function(t){return t.split(/\n/).join("<br />")});return 1===u.length?u[0]:q.map(u,function(t){return o+t+i}).join("")}var H=A.exports.boltExport,$=function(t){var n=S.none(),e=[],r=function(t){o()?u(t):e.push(t)},o=function(){return n.isSome()},i=function(t){_(t,u)},u=function(e){n.each(function(t){f.setTimeout(function(){e(t)},0)})};return t(function(t){n=S.some(t),i(e),e=[]}),{get:r,map:function(n){return $(function(e){r(function(t){e(n(t))})})},isReady:o}},W={nu:$,pure:function(e){return $(function(t){t(e)})}},U=function(n){function t(t){n().then(t,j)}return{map:function(t){return U(function(){return n().then(t)})},bind:function(e){return U(function(){return n().then(function(t){return e(t).toPromise()})})},anonBind:function(t){return U(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return W.nu(t)},toCached:function(){var t=null;return U(function(){return null===t&&(t=n()),t})},toPromise:n,get:t}},z=function(t){return U(function(){return new H(t)})},V=tinymce.util.Tools.resolve("tinymce.Env"),K=tinymce.util.Tools.resolve("tinymce.util.Delay"),q=tinymce.util.Tools.resolve("tinymce.util.Tools"),G=tinymce.util.Tools.resolve("tinymce.util.VK"),X="x-tinymce/html",Y="\x3c!-- "+X+" --\x3e",Z=function(t){return Y+t},J=function(t){return t.replace(Y,"")},Q=function(t){return-1!==t.indexOf(Y)},tt=function(){return X},et=tinymce.util.Tools.resolve("tinymce.html.Entities"),nt=function(t){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(t)},rt=function(t,e,n){return e?B(t,!0===e?"p":e,n):N(t)},ot=tinymce.util.Tools.resolve("tinymce.html.DomParser"),it=tinymce.util.Tools.resolve("tinymce.html.Serializer"),ut=tinymce.util.Tools.resolve("tinymce.html.Node"),at=tinymce.util.Tools.resolve("tinymce.html.Schema"),st={shouldBlockDrop:function(t){return t.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(t){return t.getParam("paste_data_images",!1)},shouldFilterDrop:function(t){return t.getParam("paste_filter_drop",!0)},getPreProcess:function(t){return t.getParam("paste_preprocess")},getPostProcess:function(t){return t.getParam("paste_postprocess")},getWebkitStyles:function(t){return t.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(t){return t.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(t){return t.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(t){return t.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(t){return t.getParam("paste_as_text",!1)},getRetainStyleProps:function(t){return t.getParam("paste_retain_style_properties")},getWordValidElements:function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(t){return t.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(t){return t.getParam("paste_enable_default_filters",!0)}};function ct(e,t){return q.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var lt={filter:ct,innerText:function se(t){var e=at(),n=ot({},e),r="",o=e.getShortEndedElements(),i=q.makeMap("script noscript style textarea video audio iframe object"," "),u=e.getBlockElements();return t=ct(t,[/<!\[[^\]]+\]>/g]),function a(t){var e=t.name,n=t;if("br"!==e){if("wbr"!==e)if(o[e]&&(r+=" "),i[e])r+=" ";else{if(3===t.type&&(r+=t.value),!t.shortEnded&&(t=t.firstChild))for(;a(t),t=t.next;);u[e]&&n.next&&(r+="\n","p"===e&&(r+="\n"))}}else r+="\n"}(n.parse(t)),r},trimHtml:function ce(t){return t=ct(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function r(t,e,n){return e||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function le(t){var e=0;return function(){return t+e++}},isMsEdge:function(){return-1!==f.navigator.userAgent.indexOf(" Edge/")}};function ft(e){var n,t;return t=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],e=e.replace(/^[\u00a0 ]+/,""),q.each(t,function(t){if(t.test(e))return!(n=!0)}),n}function dt(t){var i,u,a=1;function n(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)for(;e+=n(t),t=t.next;);return e}function s(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!s(t,e))return!1}while(t=t.next);return!0}function e(t,e,n){var r=t._listLevel||a;r!==a&&(i=r<a?i&&i.parent.parent:(u=i,null)),i&&i.name===e?i.append(t):(u=u||i,i=new ut(e,1),1<n&&i.attr("start",""+n),t.wrap(i)),t.name="li",a<r&&u&&u.lastChild.append(i),a=r,function o(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)for(;o(t),t=t.next;);}(t),s(t,/^\u00a0+/),s(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),s(t,/^\u00a0+/)}for(var r=[],o=t.firstChild;null!=o;)if(r.push(o),null!==(o=o.walk()))for(;void 0!==o&&o.parent!==t;)o=o.walk();for(var c=0;c<r.length;c++)if("p"===(t=r[c]).name&&t.firstChild){var l=n(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(l)){e(t,"ul");continue}if(ft(l)){var f=/([0-9]+)\./.exec(l),d=1;f&&(d=parseInt(f[1],10)),e(t,"ol",d);continue}if(t._listLevel){e(t,"ul",1);continue}i=null}else u=i,i=null}function mt(n,r,o,i){var u,a={},t=n.dom.parseStyle(i);return q.each(t,function(t,e){switch(e){case"mso-list":(u=/\w+ \w+([0-9]+)/i.exec(i))&&(o._listLevel=parseInt(u[1],10)),/Ignore/i.test(t)&&o.firstChild&&(o._listIgnore=!0,o.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":return void("normal"!==t&&(a[e]=t));case"mso-element":if(/^(comment|comment-list)$/i.test(t))return void o.remove()}0!==e.indexOf("mso-comment")?0!==e.indexOf("mso-")&&("all"===st.getRetainStyleProps(n)||r&&r[e])&&(a[e]=t):o.remove()}),/(bold)/i.test(a["font-weight"])&&(delete a["font-weight"],o.wrap(new ut("b",1))),/(italic)/i.test(a["font-style"])&&(delete a["font-style"],o.wrap(new ut("i",1))),(a=n.dom.serializeStyle(a,o.name))||null}function pt(t,e){return{content:t,cancelled:e}}function gt(t,e,n,r){var o=s(t,e,n,r),i=function(t,e){var n=ot({},t.schema);n.addNodeFilter("meta",function(t){q.each(t,function(t){return t.remove()})});var r=n.parse(e,{forced_root_block:!1,isRootContent:!0});return it({validate:t.settings.validate},t.schema).serialize(r)}(t,o.content);return t.hasEventListeners("PastePostProcess")&&!o.isDefaultPrevented()?function(t,e,n,r){var o=t.dom.create("div",{style:"display:none"},e),i=c(t,o,n,r);return pt(i.node.innerHTML,i.isDefaultPrevented())}(t,i,n,r):pt(i,o.isDefaultPrevented())}function ht(t,e){return t.insertContent(e,{merge:st.shouldMergeFormats(t),paste:!0}),!0}function vt(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)}function yt(t){return vt(t)&&/.(gif|jpe?g|png)$/.test(t)}function bt(t,e,n){return!(!1!==t.selection.isCollapsed()||!vt(e))&&function(t,e,n){return t.undoManager.extra(function(){n(t,e)},function(){t.execCommand("mceInsertLink",!1,e)}),!0}(t,e,n)}function wt(t,e,n){return!!yt(e)&&function(t,e,n){return t.undoManager.extra(function(){n(t,e)},function(){t.insertContent('<img src="'+e+'">')}),!0}(t,e,n)}function xt(t){return"\n"===t||"\r"===t}function _t(n){return function(t,e,n){return _(t,function(t){n=e(n,t)}),n}(n,function(t,e){return function(t){return-1!==" \f\t\x0B".indexOf(t)}(e)||"\xa0"===e?t.pcIsSpace||""===t.str||t.str.length===n.length-1||function(t,e){return e<t.length&&0<=e&&xt(t[e])}(n,t.str.length+1)?{pcIsSpace:!1,str:t.str+"\xa0"}:{pcIsSpace:!0,str:t.str+" "}:{pcIsSpace:xt(e),str:t.str+e}},{pcIsSpace:!1,str:""}).str}function Pt(t,e,n,r){var o=Vt(t,e,n);!1===o.cancelled&&qt(t,o.content,r)}function Tt(t,e,n){var r=n||Q(e);Pt(t,J(e),r,!1)}function Dt(t,e){var n=t.dom.encode(e).replace(/\r\n/g,"\n"),r=_t(n),o=rt(r,t.settings.forced_root_block,t.settings.forced_root_block_attrs);Pt(t,o,!1,!0)}function Ct(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&0<n.length&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(i){e[o]=""}}}return e}function kt(t,e){return e in t&&0<t[e].length}function Ft(t){return kt(t,"text/html")||kt(t,"text/plain")}function St(e,t,n){var r=function(t){return"paste"===t.type}(t)?t.clipboardData:t.dataTransfer;if(e.settings.paste_data_images&&r){var o=function(t){var e=t.items?x(R(t.items),function(t){return t.getAsFile()}):[],n=t.files?R(t.files):[];return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(0<e.length?e:n,function(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)})}(r);if(0<o.length)return t.preventDefault(),function(t){return L(t,function(r){return z(function(t){var e=r.getAsFile?r.getAsFile():r,n=new window.FileReader;n.onload=function(){t({blob:e,uri:n.result})},n.readAsDataURL(e)})})}(o).get(function(t){n&&e.selection.setRng(n),_(t,function(t){!function(t,e){var n=function(t){var e;return-1!==(e=t.indexOf(","))?t.substr(e+1):null}(e.uri),r=Gt(),o=t.settings.images_reuse_filename&&e.blob.name?function(t,e){var n=e.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i);return n?t.dom.encode(n[1]):null}(t,e.blob.name):r,i=new f.Image;if(i.src=e.uri,function(t,e){return!t.images_dataimg_filter||t.images_dataimg_filter(e)}(t.settings,i)){var u,a=t.editorUpload.blobCache,s=void 0;(u=a.findFirst(function(t){return t.base64()===n}))?s=u:(s=a.create(r,e.blob,n,o),a.add(s)),Tt(t,'<img src="'+s.blobUri()+'">',!1)}else Tt(t,'<img src="'+e.uri+'">',!1)}(e,t)})}),!0}return!1}function Et(t){return G.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode}function It(a,s,i){var u,c=function(){var e=d(S.none());return{clear:function(){e.set(S.none())},set:function(t){e.set(S.some(t))},isSet:function(){return e.get().isSome()},on:function(t){e.get().each(t)}}}();function l(t,e,n,r){var o,i,u;kt(t,"text/html")?o=t["text/html"]:(o=s.getHtml(),r=r||Q(o),s.isDefaultContent(o)&&(n=!0)),o=lt.trimHtml(o),s.remove(),i=!1===r&&nt(o),u=Kt(o),o.length&&(!i||u)||(n=!0),(n||u)&&(o=kt(t,"text/plain")&&i?t["text/plain"]:lt.innerText(o)),s.isDefaultContent(o)?e||a.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?Dt(a,o):Tt(a,o,r)}a.on("keydown",function(t){function e(t){Et(t)&&!t.isDefaultPrevented()&&s.remove()}if(Et(t)&&!t.isDefaultPrevented()){if((u=t.shiftKey&&86===t.keyCode)&&V.webkit&&-1!==f.navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),c.set(t),window.setTimeout(function(){c.clear()},100),V.ie&&u)return t.preventDefault(),void m(a,!0);s.remove(),s.create(),a.once("keyup",e),a.once("paste",function(){a.off("keyup",e)})}}),a.on("paste",function(t){var e=c.isSet(),n=function(t,e){var n=Ct(e.clipboardData||t.getDoc().dataTransfer);return lt.isMsEdge()?q.extend(n,{"text/html":""}):n}(a,t),r="text"===i.get()||u,o=kt(n,tt());u=!1,t.isDefaultPrevented()||function(t){var e=t.clipboardData;return-1!==f.navigator.userAgent.indexOf("Android")&&e&&e.items&&0===e.items.length}(t)?s.remove():Ft(n)||!St(a,t,s.getLastRng()||a.selection.getRng())?(e||t.preventDefault(),!V.ie||e&&!t.ieFake||kt(n,"text/html")||(s.create(),a.dom.bind(s.getEl(),"paste",function(t){t.stopPropagation()}),a.getDoc().execCommand("Paste",!1,null),n["text/html"]=s.getHtml()),kt(n,"text/html")?(t.preventDefault(),o=o||Q(n["text/html"]),l(n,e,r,o)):K.setEditorTimeout(a,function(){l(n,e,r,o)},0)):s.remove()})}function Rt(t){return V.ie&&t.inline?f.document.body:t.getBody()}function Ot(e,t,n){!function(t){return Rt(t)!==t.getBody()}(e)||e.dom.bind(t,"paste keyup",function(t){Yt(e,n)||e.fire("paste")})}function At(t,e){return e===t}function jt(t){var e=d(null),n="%MCEPASTEBIN%";return{create:function(){return function(t,e,n){var r,o=t.dom,i=t.getBody();e.set(t.selection.getRng()),r=t.dom.add(Rt(t),"div",{id:"mcepastebin","class":"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n),(V.ie||V.gecko)&&o.setStyle(r,"left","rtl"===o.getStyle(i,"direction",!0)?65535:-65535),o.bind(r,"beforedeactivate focusin focusout",function(t){t.stopPropagation()}),Ot(t,r,n),r.focus(),t.selection.select(r,!0)}(t,e,n)},remove:function(){return function(t,e){if(Xt(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return Xt(t)},getHtml:function(){return function(n){function e(t,e){t.appendChild(e),n.dom.remove(e,!0)}var r,t,o,i,u;for(t=q.grep(Rt(n).childNodes,function(t){return"mcepastebin"===t.id}),r=t.shift(),q.each(t,function(t){e(r,t)}),o=(i=n.dom.select("div[id=mcepastebin]",r)).length-1;0<=o;o--)u=n.dom.create("div"),r.insertBefore(u,i[o]),e(u,i[o]);return r?r.innerHTML:""}(t)},getLastRng:function(){return function(t){return t.get()}(e)},isDefault:function(){return Yt(t,n)},isDefaultContent:function(t){return At(n,t)}}}function Mt(n,t){var e=jt(n);return n.on("PreInit",function(){return function(u,t,e){var a;It(u,t,e),u.parser.addNodeFilter("img",function(t,e,n){function r(t){t.attr("data-mce-object")||a===V.transparentSrc||t.remove()}var o;if(!u.settings.paste_data_images&&((o=n).data&&!0===o.data.paste))for(var i=t.length;i--;)(a=t[i].attr("src"))&&(0===a.indexOf("webkit-fake-url")?r(t[i]):u.settings.allow_html_data_urls||0!==a.indexOf("data:")||r(t[i]))})}(n,e,t)}),{pasteFormat:t,pasteHtml:function(t,e){return Tt(n,t,e)},pasteText:function(t){return Dt(n,t)},pasteImageData:function(t,e){return St(n,t,e)},getDataTransferItems:Ct,hasHtmlOrText:Ft,hasContentType:kt}}function Lt(t,e,n){if(!function(t){return!1===V.iOS&&t!==undefined&&"function"==typeof t.setData&&!0!==lt.isMsEdge()}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(tt(),e),!0}catch(r){return!1}}function Nt(t,e,n,r){Lt(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)}function Bt(a){return function(t,e){var n=Z(t),r=a.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=a.dom.create("div",{contenteditable:"true"},n);a.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(o),a.dom.add(a.getBody(),r);var i=a.selection.getRng();o.focus();var u=a.dom.createRng();u.selectNodeContents(o),a.selection.setRng(u),K.setTimeout(function(){a.selection.setRng(i),r.parentNode.removeChild(r),e()},0)}}function Ht(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}}function $t(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)}function Wt(t,e){return Jt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())}function Ut(t,e){t.focus(),t.selection.setRng(e)}var zt={preProcess:function(t,e){return st.shouldUseDefaultFilters(t)?function(r,t){var e,o;(e=st.getRetainStyleProps(r))&&(o=q.makeMap(e.split(/[, ]/))),t=lt.filter(t,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return 0<e.length?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join("\xa0"):""}]]);var n=st.getWordValidElements(r),i=at({valid_elements:n,valid_children:"-li[p]"});q.each(i.elements,function(t){t.attributes["class"]||(t.attributes["class"]={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))});var u=ot({},i);u.addAttributeFilter("style",function(t){for(var e,n=t.length;n--;)(e=t[n]).attr("style",mt(r,o,e,e.attr("style"))),"span"===e.name&&e.parent&&!e.attributes.length&&e.unwrap()}),u.addAttributeFilter("class",function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)}),u.addNodeFilter("del",function(t){for(var e=t.length;e--;)t[e].remove()}),u.addNodeFilter("a",function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=(n=n.split("#")[1])&&"#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()});var a=u.parse(t);return st.shouldConvertWordFakeLists(r)&&dt(a),t=it({validate:r.settings.validate},i).serialize(a)}(t,e):e},isWordContent:function fe(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)}},Vt=function(t,e,n){var r=zt.isWordContent(e),o=r?zt.preProcess(t,e):e;return gt(t,o,n,r)},Kt=yt,qt=function(t,e,n){n||!1===st.isSmartPasteEnabled(t)?ht(t,e):function(e,n){q.each([bt,wt,ht],function(t){return!0!==t(e,n,ht)})}(t,e)},Gt=lt.createIdGenerator("mceclip"),Xt=function(t){return t.dom.get("mcepastebin")},Yt=function(t,e){var n=Xt(t);return function(t){return t&&"mcepastebin"===t.id}(n)&&At(e,n.innerHTML)},Zt=function(t){t.on("cut",function(e){return function(t){$t(e)&&Nt(t,Ht(e),Bt(e),function(){if(V.browser.isChrome()){var t=e.selection.getRng();K.setEditorTimeout(e,function(){e.selection.setRng(t),e.execCommand("Delete")},0)}else e.execCommand("Delete")})}}(t)),t.on("copy",function(e){return function(t){$t(e)&&Nt(t,Ht(e),Bt(e),function(){})}}(t))},Jt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Qt=function(i,u,a){st.shouldBlockDrop(i)&&i.on("dragend dragover draggesture dragdrop drop drag",function(t){t.preventDefault(),t.stopPropagation()}),st.shouldPasteDataImages(i)||i.on("drop",function(t){var e=t.dataTransfer;e&&e.files&&0<e.files.length&&t.preventDefault()}),i.on("drop",function(t){var e,n;if(n=Wt(i,t),!t.isDefaultPrevented()&&!a.get()){e=u.getDataTransferItems(t.dataTransfer);var r=u.hasContentType(e,tt());if((u.hasHtmlOrText(e)&&!function(t){var e=t["text/plain"];return!!e&&0===e.indexOf("file://")}(e)||!u.pasteImageData(t,n))&&n&&st.shouldFilterDrop(i)){var o=e["mce-internal"]||e["text/html"]||e["text/plain"];o&&(t.preventDefault(),K.setEditorTimeout(i,function(){i.undoManager.transact(function(){e["mce-internal"]&&i.execCommand("Delete"),Ut(i,n),o=lt.trimHtml(o),e["text/html"]?u.pasteHtml(o,r):u.pasteText(o)})}))}}}),i.on("dragstart",function(t){a.set(!0)}),i.on("dragover dragend",function(t){st.shouldPasteDataImages(i)&&!1===a.get()&&(t.preventDefault(),Ut(i,Wt(i,t))),"dragend"===t.type&&a.set(!1)})},te=function(t){var e=t.plugins.paste,n=st.getPreProcess(t);n&&t.on("PastePreProcess",function(t){n.call(e,e,t)});var r=st.getPostProcess(t);r&&t.on("PastePostProcess",function(t){r.call(e,e,t)})};function ee(e,n){e.on("PastePreProcess",function(t){t.content=n(e,t.content,t.internal,t.wordContent)})}function ne(t,e){if(!zt.isWordContent(e))return e;var n=[];q.each(t.schema.getBlockElements(),function(t,e){n.push(e)});var r=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return e=lt.filter(e,[[r,"$1"]]),e=lt.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function re(t,e,n,r){if(r||n)return e;var c,o=st.getWebkitStyles(t);if(!1===st.shouldRemoveWebKitStyles(t)||"all"===o)return e;if(o&&(c=o.split(/[, ]/)),c){var l=t.dom,f=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(t,e,n,r){var o=l.parseStyle(l.decode(n)),i={};if("none"===c)return e+r;for(var u=0;u<c.length;u++){var a=o[c[u]],s=l.getStyle(f,c[u],!0);/color/.test(c[u])&&(a=l.toHex(a),s=l.toHex(s)),s!==a&&(i[c[u]]=a)}return(i=l.serializeStyle(i,"span"))?e+' style="'+i+'"'+r:e+r})}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(t,e,n,r){return e+' style="'+n+'"'+r})}function oe(n,t){n.$("a",t).find("font,u").each(function(t,e){n.dom.remove(e,!0)})}function ie(n,r){return function(e){e.setActive("text"===r.pasteFormat.get());function t(t){return e.setActive(t.state)}return n.on("PastePlainTextToggle",t),function(){return n.off("PastePlainTextToggle",t)}}}var ue=function(t){V.webkit&&ee(t,re),V.ie&&(ee(t,ne),function r(e,n){e.on("PastePostProcess",function(t){n(e,t.node)})}(t,oe))},ae=function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:ie(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:ie(t,e)})};!function de(){r.add("paste",function(t){if(!1===u(t)){var e=d(!1),n=d(st.isPasteAsTextEnabled(t)?"text":"html"),r=Mt(t,n),o=ue(t);return ae(t,r),p(t,r),te(t),Zt(t),Qt(t,r,e),a(r,o)}})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=function(e){return e.getParam("content_style","")},u=function(e){return e.getParam("content_css_cors",!1,"boolean")},y=tinymce.util.Tools.resolve("tinymce.Env"),n=function(t){var n="",i=t.dom.encode,e=m(t);n+='<base href="'+i(t.documentBaseURI.getURI())+'">',e&&(n+='<style type="text/css">'+e+"</style>");var o=u(t)?' crossorigin="anonymous"':"";l.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+i(t.documentBaseURI.toAbsolute(e))+'"'+o+">"});var r=t.settings.body_id||"tinymce";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_id","","hash"))[t.id]||r);var a=t.settings.body_class||"";-1!==a.indexOf("=")&&(a=(a=t.getParam("body_class","","hash"))[t.id]||"");var c='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(y.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",s=t.getBody().dir,d=s?' dir="'+i(s)+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(r)+'" class="mce-content-body '+i(a)+'"'+d+">"+t.getContent()+c+"</body></html>"},t=function(e){e.addCommand("mcePreview",function(){!function(e){var t=n(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:t}}).focus("close")}(e)})},i=function(e){e.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:function(){return e.execCommand("mcePreview")}}),e.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:function(){return e.execCommand("mcePreview")}})};!function o(){e.add("preview",function(e){t(e),i(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),i=function(n){n.addCommand("mcePrint",function(){t.browser.isIE()?n.getDoc().execCommand("print",!1,null):n.getWin().print()})},e=function(n){n.ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:function(){return n.execCommand("mcePrint")}}),n.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:function(){return n.execCommand("mcePrint")}})};!function o(){n.add("print",function(n){i(n),e(n),n.addShortcut("Meta+P","","mcePrint")})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(u){"use strict";function e(){}function l(e){return function(){return e}}function n(){return p}var r,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=0,o=function(e,n,r){e.plugins.table?e.plugins.table.insertTable(n,r):function(r,t,o){r.undoManager.transact(function(){var e,n;r.insertContent(function(e,n){var r,t,o;for(o='<table data-mce-id="mce" style="width: 100%">',o+="<tbody>",t=0;t<n;t++){for(o+="<tr>",r=0;r<e;r++)o+="<td><br></td>";o+="</tr>"}return o+="</tbody>",o+="</table>"}(t,o)),(e=function(e){return e.dom.select("*[data-mce-id]")[0]}(r)).removeAttribute("data-mce-id"),n=r.dom.select("td,th",e),r.selection.setCursorLocation(n[0],0)})}(e,n,r)},c=function(e,n,r){var t,o;o=(t=e.editorUpload.blobCache).create(function(e){var n=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++i+String(n)}("mceu"),r,n),t.add(o),e.insertContent(e.dom.createHTML("img",{src:o.blobUri()}))},s=tinymce.util.Tools.resolve("tinymce.util.Promise"),a=function(r){return new s(function(e){var n=new u.FileReader;n.onloadend=function(){e(n.result.split(",")[1])},n.readAsDataURL(r)})},f=tinymce.util.Tools.resolve("tinymce.Env"),d=tinymce.util.Tools.resolve("tinymce.util.Delay"),m=function(i){return new s(function(r){var t=u.document.createElement("input");t.type="file",t.style.position="fixed",t.style.left="0",t.style.top="0",t.style.opacity="0.001",u.document.body.appendChild(t);t.addEventListener("change",function(e){r(Array.prototype.slice.call(e.target.files))});var o=function(e){function n(){r([]),t.parentNode.removeChild(t)}f.os.isAndroid()&&"remove"!==e.type?d.setEditorTimeout(i,n,0):n(),i.off("focusin remove",o)};i.on("focusin remove",o),t.click()})},g=function(r){r.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:function(){m(r).then(function(e){if(0<e.length){var n=e[0];a(n).then(function(e){c(r,e,n)})}})}}),r.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:function(){o(r,2,2)}})},v=l(!1),h=l(!0),p=(r={fold:function(e,n){return e()},is:v,isSome:v,isNone:h,getOr:b,getOrThunk:O,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(undefined),or:b,orThunk:O,map:n,each:e,bind:n,exists:v,forall:h,filter:n,equals:N,equals_:N,toArray:function(){return[]},toString:l("none()")},Object.freeze&&Object.freeze(r),r);function N(e){return e.isNone()}function O(e){return e()}function b(e){return e}function E(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}}var w=function(r){function e(){return o}function n(e){return e(r)}var t=l(r),o={fold:function(e,n){return n(r)},is:function(e){return r===e},isSome:h,isNone:v,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(e){return w(e(r))},each:function(e){e(r)},bind:n,exists:n,forall:n,filter:function(e){return e(r)?o:p},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(e){return e.is(r)},equals_:function(e,n){return e.fold(v,function(e){return n(r,e)})}};return o},T={some:w,none:n,from:function(e){return null===e||e===undefined?p:w(e)}},y=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:l(e)}},S={fromHtml:function(e,n){var r=(n||u.document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||1<r.childNodes.length)throw u.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return y(r.childNodes[0])},fromTag:function(e,n){var r=(n||u.document).createElement(e);return y(r)},fromText:function(e,n){var r=(n||u.document).createTextNode(e);return y(r)},fromDom:y,fromPoint:function(e,n,r){var t=e.dom();return T.from(t.elementFromPoint(n,r)).map(y)}},x=(u.Node.ATTRIBUTE_NODE,u.Node.CDATA_SECTION_NODE,u.Node.COMMENT_NODE,u.Node.DOCUMENT_NODE,u.Node.DOCUMENT_TYPE_NODE,u.Node.DOCUMENT_FRAGMENT_NODE,u.Node.ELEMENT_NODE),D=(u.Node.TEXT_NODE,u.Node.PROCESSING_INSTRUCTION_NODE,u.Node.ENTITY_REFERENCE_NODE,u.Node.ENTITY_NODE,u.Node.NOTATION_NODE,"undefined"!=typeof u.window?u.window:Function("return this;")(),E("string")),k=E("object"),_=E("array"),C=E("boolean"),A=E("undefined"),M=E("function"),R=Array.prototype.slice;M(Array.from)&&Array.from;function I(e,n,r,t,o){return e(r,t)?T.some(r):M(o)&&o(r)?T.none():n(r,t,o)}function q(e,n,r){return 0!=(e.compareDocumentPosition(n)&r)}function L(e,n){var r=function(e,n){for(var r=0;r<e.length;r++){var t=e[r];if(t.test(n))return t}return undefined}(e,n);if(!r)return{major:0,minor:0};function t(e){return Number(n.replace(r,"$"+e))}return V(t(1),t(2))}function P(e,n){return function(){return n===e}}function F(e,n){return function(){return n===e}}function U(e,n){var r=String(n).toLowerCase();return function(e,n){for(var r=0,t=e.length;r<t;r++){var o=e[r];if(n(o,r))return T.some(o)}return T.none()}(e,function(e){return e.search(r)})}function B(e,n){return-1!==e.indexOf(n)}function j(n){return function(e){return B(e,n)}}function H(e,n){var r=e.dom();if(r.nodeType!==me)return!1;var t=r;if(t.matches!==undefined)return t.matches(n);if(t.msMatchesSelector!==undefined)return t.msMatchesSelector(n);if(t.webkitMatchesSelector!==undefined)return t.webkitMatchesSelector(n);if(t.mozMatchesSelector!==undefined)return t.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}function X(e,n,r){for(var t=e.dom(),o=M(r)?r:l(!1);t.parentNode;){t=t.parentNode;var i=S.fromDom(t);if(n(i))return T.some(i);if(o(i))break}return T.none()}function z(e,n,r){return X(e,function(e){return H(e,n)},r)}var G,W=function(e,n){return q(e,n,u.Node.DOCUMENT_POSITION_CONTAINED_BY)},Y=function(e){function n(){return r}var r=e;return{get:n,set:function(e){r=e},clone:function(){return Y(n())}}},$=function(){return V(0,0)},V=function(e,n){return{major:e,minor:n}},J={nu:V,detect:function(e,n){var r=String(n).toLowerCase();return 0===e.length?$():L(e,r)},unknown:$},K="Firefox",Q=function(e){var n=e.current;return{current:n,version:e.version,isEdge:P("Edge",n),isChrome:P("Chrome",n),isIE:P("IE",n),isOpera:P("Opera",n),isFirefox:P(K,n),isSafari:P("Safari",n)}},Z={unknown:function(){return Q({current:undefined,version:J.unknown()})},nu:Q,edge:l("Edge"),chrome:l("Chrome"),ie:l("IE"),opera:l("Opera"),firefox:l(K),safari:l("Safari")},ee="Windows",ne="Android",re="Solaris",te="FreeBSD",oe=function(e){var n=e.current;return{current:n,version:e.version,isWindows:F(ee,n),isiOS:F("iOS",n),isAndroid:F(ne,n),isOSX:F("OSX",n),isLinux:F("Linux",n),isSolaris:F(re,n),isFreeBSD:F(te,n)}},ie={unknown:function(){return oe({current:undefined,version:J.unknown()})},nu:oe,windows:l(ee),ios:l("iOS"),android:l(ne),linux:l("Linux"),osx:l("OSX"),solaris:l(re),freebsd:l(te)},ue=function(e,r){return U(e,r).map(function(e){var n=J.detect(e.versionRegexes,r);return{current:e.name,version:n}})},ce=function(e,r){return U(e,r).map(function(e){var n=J.detect(e.versionRegexes,r);return{current:e.name,version:n}})},se=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ae=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return B(e,"edge/")&&B(e,"chrome")&&B(e,"safari")&&B(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,se],search:function(e){return B(e,"chrome")&&!B(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return B(e,"msie")||B(e,"trident")}},{name:"Opera",versionRegexes:[se,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:j("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:j("firefox")},{name:"Safari",versionRegexes:[se,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(B(e,"safari")||B(e,"mobile/"))&&B(e,"applewebkit")}}],fe=[{name:"Windows",search:j("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return B(e,"iphone")||B(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:j("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:j("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:j("linux"),versionRegexes:[]},{name:"Solaris",search:j("sunos"),versionRegexes:[]},{name:"FreeBSD",search:j("freebsd"),versionRegexes:[]}],de={browsers:l(ae),oses:l(fe)},le=Y(function(e,n){var r=de.browsers(),t=de.oses(),o=ue(r,e).fold(Z.unknown,Z.nu),i=ce(t,e).fold(ie.unknown,ie.nu);return{browser:o,os:i,deviceType:function(e,n,r,t){var o=e.isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,u=e.isiOS()||e.isAndroid(),c=u||t("(pointer:coarse)"),s=o||!i&&u&&t("(min-device-width:768px)"),a=i||u&&!s,f=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),d=!a&&!s&&!f;return{isiPad:l(o),isiPhone:l(i),isTablet:l(s),isPhone:l(a),isTouch:l(c),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:l(f),isDesktop:l(d)}}(i,o,e,n)}}(u.navigator.userAgent,function(e){return u.window.matchMedia(e).matches})),me=x,ge=(le.get().browser.isIE(),{getToolbarItemsOr:(G=D,function(e,n,r){return function(e,n){if(!n(e))throw new Error("Default value doesn't match requested type.")}(r,G),function(e,n){if(_(e)||k(e))throw new Error("expected a string but found: "+e);return A(e)?n:C(e)?!1===e?"":n:e}(e.getParam(n,r),r)})}),ve=function(e){return ge.getToolbarItemsOr(e,"quickbars_selection_toolbar","bold italic | quicklink h2 h3 blockquote")},he=function(e){return ge.getToolbarItemsOr(e,"quickbars_insert_toolbar","quickimage quicktable")},pe=function(o){var e=he(o);0<e.trim().length&&o.ui.registry.addContextToolbar("quickblock",{predicate:function(e){function n(e){return e.dom()===o.getBody()}var r=S.fromDom(e),t=o.schema.getTextBlockElements();return function(e,n,r){return I(H,z,e,n,r)}(r,"table",n).fold(function(){return function(e,n,r){return I(function(e,n){return n(e)},X,e,n,r)}(r,function(e){return function(e){return e.dom().nodeName.toLowerCase()}(e)in t&&o.dom.isEmpty(e.dom())},n).isSome()},function(){return!1})},items:e,position:"line",scope:"editor"})},Ne=function(n){n.ui.registry.addContextToolbar("imageselection",{predicate:function(e){return"IMG"===e.nodeName||"FIGURE"===e.nodeName&&/image/i.test(e.className)},items:"alignleft aligncenter alignright",position:"node"});var e=ve(n);0<e.trim().length&&n.ui.registry.addContextToolbar("textselection",{predicate:function(e){return!n.selection.isCollapsed()},items:e,position:"selection"})};!function Oe(){t.add("quickbars",function(e){g(e),pe(e),Ne(e)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function t(n,e){n.notificationManager.open({text:e,type:"error"})}function e(t){return function(n){function e(){n.setDisabled(a(t)&&!t.isDirty())}return t.on("NodeChange dirty",e),function(){return t.off("NodeChange dirty",e)}}}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(n){return n.getParam("save_enablewhendirty",!0)},c=function(n){return!!n.getParam("save_onsavecallback")},r=function(n){return!!n.getParam("save_oncancelcallback")},u=function(n){var e;if(e=o.DOM.getParent(n.id,"form"),!a(n)||n.isDirty()){if(n.save(),c(n))return n.execCallback("save_onsavecallback",n),void n.nodeChanged();e?(n.setDirty(!1),e.onsubmit&&!e.onsubmit()||("function"==typeof e.submit?e.submit():t(n,"Error: Form submit field collision.")),n.nodeChanged()):t(n,"Error: No form element found.")}},l=function(n){var e=i.trim(n.startContent);r(n)?n.execCallback("save_oncancelcallback",n):n.resetContent(e)},s=function(n){n.addCommand("mceSave",function(){u(n)}),n.addCommand("mceCancel",function(){l(n)})},d=function(n){n.ui.registry.addButton("save",{icon:"save",tooltip:"Save",disabled:!0,onAction:function(){return n.execCommand("mceSave")},onSetup:e(n)}),n.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return n.execCommand("mceCancel")},onSetup:e(n)}),n.addShortcut("Meta+S","","mceSave")};!function m(){n.add("save",function(n){d(n),s(n)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";var l=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return l(t())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=function(){return(g=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},p=tinymce.util.Tools.resolve("tinymce.util.Tools");function x(e){return e&&1===e.nodeType&&"false"===e.contentEditable}function h(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t}function v(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function c(e,t){var n,r=[];if((n=p.toArray(e.getBody().getElementsByTagName("span"))).length)for(var o=0;o<n.length;o++){var a=h(n[o]);null!==a&&a.length&&a===t.toString()&&r.push(n[o])}return r}function u(e,t,n){var r=t.get(),o=r.index,a=e.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,a.removeClass(c(e,r.index),"mce-match-marker-selected");var i=c(e,o);return i.length?(a.addClass(c(e,o),"mce-match-marker-selected"),e.selection.scrollIntoView(i[0]),o):-1}function y(e,t){var n=t.parentNode;e.remove(t),e.isEmpty(n)&&e.remove(n)}function f(e,t,n,r,o){var a=function(e,t){var n=e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n]");return t?"\\b"+n+"\\b":n}(n,o),i=function(e,t,n){var r,o;return(o=e.dom.create("span",{"data-mce-bogus":1})).className="mce-match-marker",r=e.getBody(),C(e,t,!1),d.findAndReplaceDOMText(n,r,o,!1,e.schema)}(e,t,new RegExp(a,r?"g":"gi"));if(i){var c=u(e,t,!0);t.set({index:c,count:i,text:n,matchCase:r,wholeWord:o})}return i}function b(e,t){var n=u(e,t,!0);t.set(g(g({},t.get()),{index:n}))}function N(e,t){var n=u(e,t,!1);t.set(g(g({},t.get()),{index:n}))}function w(e){var t=h(e);return null!==t&&0<t.length}function m(e,t,n,r,o){var a,i,c,u,d,s=t.get(),l=s.index,f=l;for(r=!1!==r,c=e.getBody(),i=p.grep(p.toArray(c.getElementsByTagName("span")),w),a=0;a<i.length;a++){var m=h(i[a]);if(u=d=parseInt(m,10),o||u===s.index){for(n.length?(i[a].firstChild.nodeValue=n,v(i[a])):y(e.dom,i[a]);i[++a];){if((u=parseInt(h(i[a]),10))!==d){a--;break}y(e.dom,i[a])}r&&f--}else l<d&&i[a].setAttribute("data-mce-index",String(d-1))}return t.set(g(g({},s),{count:o?0:s.count-1,index:f})),r?b(e,t):N(e,t),!o&&0<t.get().count}function t(){}function a(e){return function(){return e}}function n(){return T}var r,d={findAndReplaceDOMText:function W(e,t,n,r,o){var a,i,h,f,m,g,c=[],u=0;function d(e,t){if(t=t||0,!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");var n=e.index;if(0<t){var r=e[t];if(!r)throw new Error("Invalid capture group");n+=e[0].indexOf(r),e[0]=r}return[n,n+e[0].length,[e[0]]]}if(h=t.ownerDocument,f=o.getBlockElements(),m=o.getWhiteSpaceElements(),g=o.getShortEndedElements(),i=function s(e){var t;if(3===e.nodeType)return e.data;if(m[e.nodeName]&&!f[e.nodeName])return"";if(t="",x(e))return"\n";if((f[e.nodeName]||g[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=s(e),e=e.nextSibling;);return t}(t)){if(e.global)for(;a=e.exec(i);)c.push(d(a,r));else a=i.match(e),c.push(d(a,r));return c.length&&(u=c.length,function p(e,t,n){var r,o,a,i,c=[],u=0,d=e,s=t.shift(),l=0;e:for(;;){if((f[d.nodeName]||g[d.nodeName]||x(d))&&u++,3===d.nodeType&&(!o&&d.length+u>=s[1]?(o=d,i=s[1]-u):r&&c.push(d),!r&&d.length+u>s[0]&&(r=d,a=s[0]-u),u+=d.length),r&&o){if(d=n({startNode:r,startNodeIndex:a,endNode:o,endNodeIndex:i,innerNodes:c,match:s[2],matchIndex:l}),u-=o.length-i,o=r=null,c=[],l++,!(s=t.shift()))break}else if(m[d.nodeName]&&!f[d.nodeName]||!d.firstChild){if(d.nextSibling){d=d.nextSibling;continue}}else if(!x(d)){d=d.firstChild;continue}for(;;){if(d.nextSibling){d=d.nextSibling;break}if(d.parentNode===e)break e;d=d.parentNode}}}(t,c,function l(e){var p;if("function"!=typeof e){var r=e.nodeType?e:h.createElement(e);p=function(e,t){var n=r.cloneNode(!1);return n.setAttribute("data-mce-index",t),e&&n.appendChild(h.createTextNode(e)),n}}else p=e;return function(e){var t,n,r,o=e.startNode,a=e.endNode,i=e.matchIndex;if(o===a){var c=o;r=c.parentNode,0<e.startNodeIndex&&(t=h.createTextNode(c.data.substring(0,e.startNodeIndex)),r.insertBefore(t,c));var u=p(e.match[0],i);return r.insertBefore(u,c),e.endNodeIndex<c.length&&(n=h.createTextNode(c.data.substring(e.endNodeIndex)),r.insertBefore(n,c)),c.parentNode.removeChild(c),u}t=h.createTextNode(o.data.substring(0,e.startNodeIndex)),n=h.createTextNode(a.data.substring(e.endNodeIndex));for(var d=p(o.data.substring(e.startNodeIndex),i),s=0,l=e.innerNodes.length;s<l;++s){var f=e.innerNodes[s],m=p(f.data,i);f.parentNode.replaceChild(m,f)}var g=p(a.data.substring(0,e.endNodeIndex),i);return(r=o.parentNode).insertBefore(t,o),r.insertBefore(d,o),r.removeChild(o),(r=a.parentNode).insertBefore(g,a),r.insertBefore(n,a),r.removeChild(a),g}}(n))),u}}},C=function(e,t,n){var r,o,a,i,c=t.get();for(o=p.toArray(e.getBody().getElementsByTagName("span")),r=0;r<o.length;r++){var u=h(o[r]);null!==u&&u.length&&(u===c.index.toString()&&(a=a||o[r].firstChild,i=o[r].firstChild),v(o[r]))}if(t.set(g(g({},c),{index:-1,count:0,text:""})),a&&i){var d=e.dom.createRng();return d.setStart(a,0),d.setEnd(i,i.data.length),!1!==n&&e.selection.setRng(d),d}},o=function(r,o){return{done:function(e){return C(r,o,e)},find:function(e,t,n){return f(r,o,e,t,n)},next:function(){return b(r,o)},prev:function(){return N(r,o)},replace:function(e,t,n){return m(r,o,e,t,n)}}},i=a(!1),s=a(!0),T=(r={fold:function(e,t){return e()},is:i,isSome:i,isNone:s,getOr:A,getOrThunk:O,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:A,orThunk:O,map:n,each:t,bind:n,exists:i,forall:s,filter:n,equals:S,equals_:S,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(r),r);function S(e){return e.isNone()}function O(e){return e()}function A(e){return e}function k(e,t){return function(){F(e,t)}}var B,I=function(n){function e(){return o}function t(e){return e(n)}var r=a(n),o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:s,isNone:i,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return I(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:T},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(i,function(e){return t(n,e)})}};return o},E={some:I,none:n,from:function(e){return null===e||e===undefined?T:I(e)}},M=(B="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===B}),D=Array.prototype.slice,R=(M(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.Env")),F=function(a,i){var e=function(){var t=l(E.none());return{clear:function(){t.set(E.none())},set:function(e){t.set(E.some(e))},isSet:function(){return t.get().isSome()},on:function(e){t.get().each(e)}}}();a.undoManager.add();var t=p.trim(a.selection.getContent({format:"text"}));function c(e){(function(e,t){return 1<t.get().count}(0,i)?e.enable:e.disable)("next"),(function(e,t){return 1<t.get().count}(0,i)?e.enable:e.disable)("prev")}function u(e,t){!function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}}(["replace","replaceall","prev","next"],t?e.disable:e.enable)}function r(e,t){R.browser.isSafari()&&R.deviceType.isTouch()&&("find"===t||"replace"===t||"replaceall"===t)&&e.focus(t)}function d(e){C(a,i,!1),u(e,!0),c(e)}function o(e){var t=e.getData(),n=i.get();if(t.findtext.length){if(n.text===t.findtext&&n.matchCase===t.matchcase&&n.wholeWord===t.wholewords)b(a,i);else{var r=f(a,i,t.findtext,t.matchcase,t.wholewords);r<=0&&!function o(e){a.windowManager.alert("Could not find the specified string.",function(){e.focus("findtext")})}(e),u(e,0===r)}c(e)}else d(e)}var n=i.get(),s={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace All",disabled:!0}],initialData:{findtext:t,replacetext:"",wholewords:n.wholeWord,matchcase:n.matchCase},onChange:function(e,t){"findtext"===t.name&&0<i.get().count&&d(e)},onAction:function(e,t){var n=e.getData();switch(t.name){case"find":o(e);break;case"replace":m(a,i,n.replacetext)?c(e):d(e);break;case"replaceall":m(a,i,n.replacetext,!0,!0),d(e);break;case"prev":N(a,i),c(e);break;case"next":b(a,i),c(e);break;case"matchcase":case"wholewords":!function(e){var t=e.getData(),n=i.get();i.set(g(g({},n),{matchCase:t.matchcase,wholeWord:t.wholewords}))}(e),d(e)}r(e,t.name)},onSubmit:function(e){o(e),r(e,"find")},onClose:function(){a.focus(),C(a,i),a.undoManager.add()}};e.set(a.windowManager.open(s,{inline:"toolbar"}))},j=function(e,t){e.addCommand("SearchReplace",function(){F(e,t)})},P=function(e,t){e.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:k(e,t),icon:"search"}),e.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:k(e,t),icon:"search"}),e.shortcuts.add("Meta+F","",k(e,t))};!function z(){e.add("searchreplace",function(e){var t=l({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1});return j(e,t),P(e,t),o(e,t)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(t){"use strict";var a=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return a(t())}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(e){return!(!/(^|[ ,])tinymcespellchecker([, ]|$)/.test(e.settings.plugins)||!n.get("tinymcespellchecker"))&&("undefined"!=typeof t.window.console&&t.window.console.log&&t.window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),!0)},l=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=tinymce.util.Tools.resolve("tinymce.util.URI"),d=tinymce.util.Tools.resolve("tinymce.util.XHR"),f=function(e){return e.fire("SpellcheckStart")},o=function(e){return e.fire("SpellcheckEnd")},g=function(e){return e.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv")},s=function(e){var t=e.getParam("language","en");return e.getParam("spellchecker_language",t)},h=function(e){return e.getParam("spellchecker_rpc_url")},p=function(e){return e.getParam("spellchecker_callback")},m=function(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)};function b(e){return e&&1===e.nodeType&&"false"===e.contentEditable}function r(a,r){var n,o,g,h,p,i=[],v=r.dom;function c(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}function s(e){var t=a.getElementsByTagName("*"),n=[];e="number"==typeof e?""+e:null;for(var r=0;r<t.length;r++){var o=t[r],i=o.getAttribute("data-mce-index");null!==i&&i.length&&-1!==o.className.indexOf("mce-spellchecker-word")&&(i!==e&&null!==e||n.push(o))}return n}function u(e){for(var t=i.length;t--;)if(i[t]===e)return t;return-1}function e(e){for(var t=0,n=i.length;t<n&&!1!==e(i[t],t);t++);return this}function t(e){var t,n,r=s(e?u(e):null);for(t=r.length;t--;)(n=r[t]).parentNode.insertBefore(n.firstChild,n),n.parentNode.removeChild(n);return this}function l(e){var t=s(u(e)),n=r.dom.createRng();return n.setStartBefore(t[0]),n.setEndAfter(t[t.length-1]),n}return g=r.schema.getBlockElements(),h=r.schema.getWhiteSpaceElements(),p=r.schema.getShortEndedElements(),{text:o=function d(e){var t;if(3===e.nodeType)return e.data;if(h[e.nodeName]&&!g[e.nodeName])return"";if(b(e))return"\n";if(t="",(g[e.nodeName]||p[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=d(e),e=e.nextSibling;);return t}(a),matches:i,each:e,filter:function f(n){var r=[];return e(function(e,t){n(e,t)&&r.push(e)}),i=r,this},reset:function m(){return i.splice(0,i.length),t(),this},matchFromElement:function x(e){return i[e.getAttribute("data-mce-index")]},elementFromMatch:function k(e){return s(u(e))[0]},find:function N(e,t){if(o&&e.global)for(;n=e.exec(o);)i.push(c(n,t));return this},add:function y(e,t,n){return i.push({start:e,end:e+t,text:o.substr(e,t),data:n}),this},wrap:function S(e){return i.length&&function f(e,t,n){var r,o,i,a,c,s=[],u=0,l=e,d=0;(t=t.slice(0)).sort(function(e,t){return e.start-t.start}),c=t.shift();e:for(;;){if((g[l.nodeName]||p[l.nodeName]||b(l))&&u++,3===l.nodeType&&(!o&&l.length+u>=c.end?(o=l,a=c.end-u):r&&s.push(l),!r&&l.length+u>c.start&&(r=l,i=c.start-u),u+=l.length),r&&o){if(l=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:a,innerNodes:s,match:c.text,matchIndex:d}),u-=o.length-a,o=r=null,s=[],d++,!(c=t.shift()))break}else if(h[l.nodeName]&&!g[l.nodeName]||!l.firstChild){if(l.nextSibling){l=l.nextSibling;continue}}else if(!b(l)){l=l.firstChild;continue}for(;;){if(l.nextSibling){l=l.nextSibling;break}if(l.parentNode===e)break e;l=l.parentNode}}}(a,i,function t(o){function m(e,t){var n=i[t];n.stencil||(n.stencil=o(n));var r=n.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(v.doc.createTextNode(e)),r}return function(e){var t,n,r,o=e.startNode,i=e.endNode,a=e.matchIndex,c=v.doc;if(o===i){var s=o;r=s.parentNode,0<e.startNodeIndex&&(t=c.createTextNode(s.data.substring(0,e.startNodeIndex)),r.insertBefore(t,s));var u=m(e.match,a);return r.insertBefore(u,s),e.endNodeIndex<s.length&&(n=c.createTextNode(s.data.substring(e.endNodeIndex)),r.insertBefore(n,s)),s.parentNode.removeChild(s),u}t=c.createTextNode(o.data.substring(0,e.startNodeIndex)),n=c.createTextNode(i.data.substring(e.endNodeIndex));for(var l=m(o.data.substring(e.startNodeIndex),a),d=0,f=e.innerNodes.length;d<f;++d){var g=e.innerNodes[d],h=m(g.data,a);g.parentNode.replaceChild(h,g)}var p=m(i.data.substring(0,e.endNodeIndex),a);return(r=o.parentNode).insertBefore(t,o),r.insertBefore(l,o),r.removeChild(o),(r=i.parentNode).insertBefore(p,i),r.insertBefore(n,i),r.removeChild(i),p}}(e)),this},unwrap:t,replace:function w(e,t){var n=l(e);return n.deleteContents(),0<t.length&&n.insertNode(r.dom.doc.createTextNode(t)),n},rangeFromMatch:l,indexOf:u}}function v(e,t){if(!t.get()){var n=r(e.getBody(),e);t.set(n)}return t.get()}function x(e,t,n,r,o,i,a){var c=p(e);(c||function(a,c,s){return function(e,t,r,o){var n={method:e,lang:s.get()},i="";n["addToDictionary"===e?"word":"text"]=t,l.each(n,function(e,t){i&&(i+="&"),i+=t+"="+encodeURIComponent(e)}),d.send({url:new u(c).toAbsolute(h(a)),type:"post",content_type:"application/x-www-form-urlencoded",data:i,success:function(e){var t=JSON.parse(e);if(t)t.error?o(t.error):r(t);else{var n=a.translate("Server response wasn't proper JSON.");o(n)}},error:function(){var e=a.translate("The spelling service was not found: (")+h(a)+a.translate(")");o(e)}})}}(e,t,n)).call(e.plugins.spellchecker,r,o,i,a)}function k(e,t,n){e.dom.select("span.mce-spellchecker-word").length||y(e,t,n)}function N(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t}var y=function(e,t,n){var r=e.selection.getBookmark();if(v(e,n).reset(),e.selection.moveToBookmark(r),n.set(null),t.get())return t.set(!1),o(e),!0},S=function(t,e,n,r,o){var i=!!o.dictionary,a=o.words;if(t.setProgressState(!1),function(e){for(var t in e)return!1;return!0}(a)){var c=t.translate("No misspellings found.");return t.notificationManager.open({text:c,type:"info"}),void e.set(!1)}r.set({suggestions:a,hasDictionarySupport:i});var s=t.selection.getBookmark();v(t,n).find(m(t)).filter(function(e){return!!a[e.text]}).wrap(function(e){return t.dom.create("span",{"class":"mce-spellchecker-word","aria-invalid":"spelling","data-mce-bogus":1,"data-mce-word":e.text})}),t.selection.moveToBookmark(s),e.set(!0),f(t)},w={spellcheck:function(t,e,n,r,o,i){if(!y(t,n,r)){t.setProgressState(!0),x(t,e,i,"spellcheck",v(t,r).text,function(e){S(t,n,r,o,e)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1),y(t,n,r)}),t.focus()}},checkIfFinished:k,addToDictionary:function(t,e,n,r,o,i,a){t.setProgressState(!0),x(t,e,o,"addToDictionary",i,function(){t.setProgressState(!1),t.dom.remove(a,!0),k(t,n,r)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1)})},ignoreWord:function(t,e,n,r,o,i){t.selection.collapse(),i?l.each(t.dom.select("span.mce-spellchecker-word"),function(e){e.getAttribute("data-mce-word")===r&&t.dom.remove(e,!0)}):t.dom.remove(o,!0),k(t,e,n)},findSpansByIndex:function(e,t){var n,r=[];if((n=l.toArray(e.getBody().getElementsByTagName("span"))).length)for(var o=0;o<n.length;o++){var i=N(n[o]);null!==i&&i.length&&i===t.toString()&&r.push(n[o])}return r},getElmIndex:N,markErrors:S},T=function(t,n,r,o,e,i){return{getTextMatcher:function(){return o.get()},getWordCharPattern:function(){return m(t)},markErrors:function(e){w.markErrors(t,n,o,r,e)},getLanguage:function(){return e.get()}}},I=function(e,t,n,r,o,i){e.addCommand("mceSpellCheck",function(){w.spellcheck(e,t,n,r,o,i)})},B=function(){return(B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},A="SpellcheckStart SpellcheckEnd",E=function(n,e,r,t,o,i){function a(){w.spellcheck(n,e,r,t,i,o)}var c=function(e,t){var n=[];return l.each(t,function(e){n.push({selectable:!0,text:e.name,data:e.value})}),n}(0,function(e){return l.map(g(e).split(","),function(e){return{name:(e=e.split("="))[0],value:e[1]}})}(n)),s={tooltip:"Spellcheck",onAction:a,icon:"spell-check",onSetup:function(e){function t(){e.setActive(r.get())}return n.on(A,t),function(){n.off(A,t)}}},u=B(B({},s),{type:"splitbutton",select:function(e){return e===o.get()},fetch:function(e){e(l.map(c,function(e){return{type:"choiceitem",value:e.data,text:e.text}}))},onItemAction:function(e,t){o.set(t)}});1<c.length?n.ui.registry.addSplitButton("spellchecker",u):n.ui.registry.addToggleButton("spellchecker",s),n.ui.registry.addToggleMenuItem("spellchecker",{text:"Spellcheck",onSetup:function(e){e.setActive(r.get());function t(){e.setActive(r.get())}return n.on(A,t),function(){n.off(A,t)}},onAction:a})},C=function(o,i,a,c,s,u){o.ui.registry.addContextMenu("spellchecker",{update:function(e){var t=e;if("mce-spellchecker-word"!==t.className)return[];var n=w.findSpansByIndex(o,w.getElmIndex(t));if(0<n.length){var r=o.dom.createRng();return r.setStartBefore(n[0]),r.setEndAfter(n[n.length-1]),o.selection.setRng(r),function(t,e,n,r,o,i,a,c){var s=[],u=n.get().suggestions[a];return l.each(u,function(e){s.push({text:e,onAction:function(){t.insertContent(t.dom.encode(e)),t.dom.remove(c),w.checkIfFinished(t,r,o)}})}),n.get().hasDictionarySupport&&(s.push({type:"separator"}),s.push({text:"Add to dictionary",onAction:function(){w.addToDictionary(t,e,r,o,i,a,c)}})),s.push.apply(s,[{type:"separator"},{text:"Ignore",onAction:function(){w.ignoreWord(t,r,o,a,c)}},{text:"Ignore all",onAction:function(){w.ignoreWord(t,r,o,a,c,!0)}}]),s}(o,i,a,c,s,u,t.getAttribute("data-mce-word"),n)}}})};!function e(){n.add("spellchecker",function(e,t){if(!1===c(e)){var n=a(!1),r=a(s(e)),o=a(null),i=a(null);return E(e,t,n,o,r,i),C(e,t,i,n,o,r),I(e,t,n,o,i,r),T(e,n,i,o,r,t)}})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(c){"use strict";function t(e){e.keyCode!==d.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.VK"),m=function(e){return e.getParam("tab_focus",function(e){return e.getParam("tabfocus_elements",":prev,:next")}(e))},v=n.DOM,i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==d.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=f.explode(m(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):v.get(e[0]):":next"===e[1]?u(1):v.get(e[1]))){var t=s.get(o.id||o.name);o.id&&t?t.focus():y.setTimeout(function(){a.webkit||c.window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&s.get(n.id)&&-1!==e.tabIndex&&function t(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&t(e.parentNode)}(e)}if(o=v.select(":input:enabled,*[tabindex]:not(iframe)"),f.each(o,function(e,t){if(e.id===r.id)return i=t,!1}),0<e){for(l=i+1;l<o.length;l++)if(t(o[l]))return o[l]}else for(l=i-1;0<=l;l--)if(t(o[l]))return o[l];return null}}r.on("init",function(){r.inline&&v.setAttrib(r.getBody(),"tabIndex",null),r.on("keyup",t),a.gecko?r.on("keypress keydown",e):r.on("keydown",e)})};!function o(){e.add("tabfocus",function(e){i(e)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(f){"use strict";function o(e){return e}var R=function(e){function n(){return t}var t=e;return{get:n,set:function(e){t=e},clone:function(){return R(n())}}},T=function(){},O=function(t,r){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t(r.apply(null,e))}},D=function(e){return function(){return e}};function b(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=o.concat(e);return r.apply(null,t)}}function d(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return!t.apply(null,e)}}function e(){return u}var n,s=D(!1),i=D(!0),u=(n={fold:function(e,n){return e()},is:s,isSome:s,isNone:i,getOr:c,getOrThunk:r,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:D(null),getOrUndefined:D(undefined),or:c,orThunk:r,map:e,each:T,bind:e,exists:s,forall:i,filter:e,equals:t,equals_:t,toArray:function(){return[]},toString:D("none()")},Object.freeze&&Object.freeze(n),n);function t(e){return e.isNone()}function r(e){return e()}function c(e){return e}function a(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}}function l(e,n){return-1<function(e,n){return Ue.call(e,n)}(e,n)}function m(e,n){for(var t=0,r=e.length;t<r;t++){if(n(e[t],t))return!0}return!1}function g(e,n){for(var t=e.length,r=new Array(t),o=0;o<t;o++){var i=e[o];r[o]=n(i,o)}return r}function p(e,n){for(var t=0,r=e.length;t<r;t++){n(e[t],t)}}function h(e,n){for(var t=[],r=0,o=e.length;r<o;r++){var i=e[r];n(i,r)&&t.push(i)}return t}function v(e,n,t){return function(e,n){for(var t=e.length-1;0<=t;t--){n(e[t],t)}}(e,function(e){t=n(t,e)}),t}function w(e,n,t){return p(e,function(e){t=n(t,e)}),t}function y(e,n){for(var t=0,r=e.length;t<r;t++){var o=e[t];if(n(o,t))return Me.some(o)}return Me.none()}function C(e,n){for(var t=0,r=e.length;t<r;t++){if(n(e[t],t))return Me.some(t)}return Me.none()}function S(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!Le(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);qe.apply(n,e[t])}return n}function x(e,n){var t=g(e,n);return S(t)}function A(e,n){for(var t=0,r=e.length;t<r;++t){if(!0!==n(e[t],t))return!1}return!0}function E(e){var n=Fe.call(e,0);return n.reverse(),n}function N(e,n){for(var t=Ve(e),r=0,o=t.length;r<o;r++){var i=t[r];n(e[i],i)}}function k(e,t){return Ye(e,function(e,n){return{k:n,v:t(e,n)}})}function I(e,n){return Ke(e,n)?Me.from(e[n]):Me.none()}function B(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(n.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+n.length+']", got '+t.length+" arguments");var r={};return p(n,function(e,n){r[e]=D(t[n])}),r}}function P(e){return e.slice(0).sort()}function M(e,n){throw new Error("All required keys ("+P(e).join(", ")+") were not specified. Specified keys were: "+P(n).join(", ")+".")}function W(e){throw new Error("Unsupported keys for object: "+P(e).join(", "))}function _(n,e){if(!Le(e))throw new Error("The "+n+" fields must be an array. Was: "+e+".");p(e,function(e){if(!_e(e))throw new Error("The value "+e+" in the "+n+" fields was not a string.")})}function L(e){var t=P(e);y(t,function(e,n){return n<t.length-1&&e===t[n+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+t.join(", ")+"].")})}function j(e){return e.dom().nodeType}function z(n){return function(e){return j(e)===n}}function H(e){return j(e)===$e||"#comment"===en(e)}function F(e,n,t){if(!(_e(t)||je(t)||He(t)))throw f.console.error("Invalid call to Attr.set. Key ",n,":: Value ",t,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,t+"")}function U(e,n,t){F(e.dom(),n,t)}function q(e,n){var t=e.dom();N(n,function(e,n){F(t,n,e)})}function V(e,n){var t=e.dom().getAttribute(n);return null===t?undefined:t}function G(e,n){var t=e.dom();return!(!t||!t.hasAttribute)&&t.hasAttribute(n)}function Y(e,n){e.dom().removeAttribute(n)}function K(e){return w(e.dom().attributes,function(e,n){return e[n.name]=n.value,e},{})}function X(e,n,t){return""===n||!(e.length<n.length)&&e.substr(t,t+n.length)===n}function $(e,n){return-1!==e.indexOf(n)}function J(e,n){return X(e,n,0)}function Q(e){return e.style!==undefined&&ze(e.style.getPropertyValue)}function Z(t){var r,o=!1;return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return o||(o=!0,r=t.apply(null,e)),r}}function ee(e){var n=tn(e)?e.dom().parentNode:e.dom();return n!==undefined&&null!==n&&n.ownerDocument.body.contains(n)}function ne(e,n,t){if(!_e(t))throw f.console.error("Invalid call to CSS.set. Property ",n,":: Value ",t,":: Element ",e),new Error("CSS value must be a string: "+t);Q(e)&&e.style.setProperty(n,t)}function te(e,n,t){var r=e.dom();ne(r,n,t)}function re(e,n){var t=e.dom();N(n,function(e,n){ne(t,n,e)})}function oe(e,n){var t=e.dom(),r=f.window.getComputedStyle(t).getPropertyValue(n),o=""!==r||ee(e)?r:an(t,n);return null===o?undefined:o}function ie(e,n){var t=e.dom(),r=an(t,n);return Me.from(r).filter(function(e){return 0<e.length})}function ue(e,n){!function(e,n){Q(e)&&e.style.removeProperty(n)}(e.dom(),n),G(e,"style")&&""===function(e){return e.replace(/^\s+|\s+$/g,"")}(V(e,"style"))&&Y(e,"style")}function ce(e,n,t){return 0!=(e.compareDocumentPosition(n)&t)}function ae(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};function r(e){return Number(n.replace(t,"$"+e))}return dn(r(1),r(2))}function le(e,n){return function(){return n===e}}function fe(e,n){return function(){return n===e}}function se(e,n){var t=String(n).toLowerCase();return y(e,function(e){return e.search(t)})}function de(n){return function(e){return $(e,n)}}function me(){return En.get()}function ge(e,n){var t=e.dom();if(t.nodeType!==Nn)return!1;var r=t;if(r.matches!==undefined)return r.matches(n);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(n);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(n);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}function pe(e){return e.nodeType!==Nn&&e.nodeType!==kn||0===e.childElementCount}function he(e){return on.fromDom(e.dom().ownerDocument)}function ve(e){return Me.from(e.dom().parentNode).map(on.fromDom)}function be(e,n){for(var t=ze(n)?n:s,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=on.fromDom(i);if(o.push(u),!0===t(u))break;r=i}return o}function we(e){return Me.from(e.dom().previousSibling).map(on.fromDom)}function ye(e){return Me.from(e.dom().nextSibling).map(on.fromDom)}function Ce(e){return g(e.dom().childNodes,on.fromDom)}function Se(e,n){var t=e.dom().childNodes;return Me.from(t[n]).map(on.fromDom)}function xe(n,t){ve(n).each(function(e){e.dom().insertBefore(t.dom(),n.dom())})}function Re(e,n){ye(e).fold(function(){ve(e).each(function(e){Mn(e,n)})},function(e){xe(e,n)})}function Te(n,t){(function(e){return Se(e,0)})(n).fold(function(){Mn(n,t)},function(e){n.dom().insertBefore(t.dom(),e.dom())})}function Oe(e,n){xe(e,n),Mn(n,e)}function De(r,o){p(o,function(e,n){var t=0===n?r:o[n-1];Re(t,e)})}function Ae(n,e){p(e,function(e){Mn(n,e)})}function Ee(e){e.dom().textContent="",p(Ce(e),function(e){Wn(e)})}function Ne(e){var n=Ce(e);0<n.length&&function(n,e){p(e,function(e){xe(n,e)})}(e,n),Wn(e)}function ke(e,n,t){return function(e,n,t){return h(be(e,t),n)}(e,function(e){return ge(e,n)},t)}function Ie(e,n){return function(e,n){return h(Ce(e),n)}(e,function(e){return ge(e,n)})}function Be(e,n){return function(e,n){var t=n===undefined?f.document:n.dom();return pe(t)?[]:g(t.querySelectorAll(e),on.fromDom)}(n,e)}var Pe=function(t){function e(){return o}function n(e){return e(t)}var r=D(t),o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:i,isNone:s,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return Pe(e(t))},each:function(e){e(t)},bind:n,exists:n,forall:n,filter:function(e){return e(t)?o:u},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(s,function(e){return n(t,e)})}};return o},Me={some:Pe,none:e,from:function(e){return null===e||e===undefined?u:Pe(e)}},We=tinymce.util.Tools.resolve("tinymce.PluginManager"),_e=a("string"),Le=a("array"),je=a("boolean"),ze=a("function"),He=a("number"),Fe=Array.prototype.slice,Ue=Array.prototype.indexOf,qe=Array.prototype.push,Ve=(ze(Array.from)&&Array.from,Object.keys),Ge=Object.hasOwnProperty,Ye=function(e,r){var o={};return N(e,function(e,n){var t=r(e,n);o[t.k]=t.v}),o},Ke=function(e,n){return Ge.call(e,n)},Xe=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 _("required",o),_("optional",i),L(u),function(n){var t=Ve(n);A(o,function(e){return l(t,e)})||M(o,t);var e=h(t,function(e){return!l(u,e)});0<e.length&&W(e);var r={};return p(o,function(e){r[e]=D(n[e])}),p(i,function(e){r[e]=D(Object.prototype.hasOwnProperty.call(n,e)?Me.some(n[e]):Me.none())}),r}},$e=(f.Node.ATTRIBUTE_NODE,f.Node.CDATA_SECTION_NODE,f.Node.COMMENT_NODE),Je=f.Node.DOCUMENT_NODE,Qe=(f.Node.DOCUMENT_TYPE_NODE,f.Node.DOCUMENT_FRAGMENT_NODE,f.Node.ELEMENT_NODE),Ze=f.Node.TEXT_NODE,en=(f.Node.PROCESSING_INSTRUCTION_NODE,f.Node.ENTITY_REFERENCE_NODE,f.Node.ENTITY_NODE,f.Node.NOTATION_NODE,"undefined"!=typeof f.window?f.window:Function("return this;")(),function(e){return e.dom().nodeName.toLowerCase()}),nn=z(Qe),tn=z(Ze),rn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:D(e)}},on={fromHtml:function(e,n){var t=(n||f.document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw f.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return rn(t.childNodes[0])},fromTag:function(e,n){var t=(n||f.document).createElement(e);return rn(t)},fromText:function(e,n){var t=(n||f.document).createTextNode(e);return rn(t)},fromDom:rn,fromPoint:function(e,n,t){var r=e.dom();return Me.from(r.elementFromPoint(n,t)).map(rn)}},un=Z(function(){return cn(on.fromDom(f.document))}),cn=function(e){var n=e.dom().body;if(null===n||n===undefined)throw new Error("Body is not available yet");return on.fromDom(n)},an=function(e,n){return Q(e)?e.style.getPropertyValue(n):""},ln=function(e,n){return ce(e,n,f.Node.DOCUMENT_POSITION_CONTAINED_BY)},fn=function(){return(fn=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},sn=function(){return dn(0,0)},dn=function(e,n){return{major:e,minor:n}},mn={nu:dn,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?sn():ae(e,t)},unknown:sn},gn="Firefox",pn=function(e){var n=e.current;return{current:n,version:e.version,isEdge:le("Edge",n),isChrome:le("Chrome",n),isIE:le("IE",n),isOpera:le("Opera",n),isFirefox:le(gn,n),isSafari:le("Safari",n)}},hn={unknown:function(){return pn({current:undefined,version:mn.unknown()})},nu:pn,edge:D("Edge"),chrome:D("Chrome"),ie:D("IE"),opera:D("Opera"),firefox:D(gn),safari:D("Safari")},vn="Windows",bn="Android",wn="Solaris",yn="FreeBSD",Cn=function(e){var n=e.current;return{current:n,version:e.version,isWindows:fe(vn,n),isiOS:fe("iOS",n),isAndroid:fe(bn,n),isOSX:fe("OSX",n),isLinux:fe("Linux",n),isSolaris:fe(wn,n),isFreeBSD:fe(yn,n)}},Sn={unknown:function(){return Cn({current:undefined,version:mn.unknown()})},nu:Cn,windows:D(vn),ios:D("iOS"),android:D(bn),linux:D("Linux"),osx:D("OSX"),solaris:D(wn),freebsd:D(yn)},xn=function(e,t){return se(e,t).map(function(e){var n=mn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Rn=function(e,t){return se(e,t).map(function(e){var n=mn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Tn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,On=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return $(e,"edge/")&&$(e,"chrome")&&$(e,"safari")&&$(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Tn],search:function(e){return $(e,"chrome")&&!$(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return $(e,"msie")||$(e,"trident")}},{name:"Opera",versionRegexes:[Tn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:de("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:de("firefox")},{name:"Safari",versionRegexes:[Tn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return($(e,"safari")||$(e,"mobile/"))&&$(e,"applewebkit")}}],Dn=[{name:"Windows",search:de("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return $(e,"iphone")||$(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:de("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:de("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:de("linux"),versionRegexes:[]},{name:"Solaris",search:de("sunos"),versionRegexes:[]},{name:"FreeBSD",search:de("freebsd"),versionRegexes:[]}],An={browsers:D(On),oses:D(Dn)},En=R(function(e,n){var t=An.browsers(),r=An.oses(),o=xn(t,e).fold(hn.unknown,hn.nu),i=Rn(r,e).fold(Sn.unknown,Sn.nu);return{browser:o,os:i,deviceType:function(e,n,t,r){var o=e.isiOS()&&!0===/ipad/i.test(t),i=e.isiOS()&&!o,u=e.isiOS()||e.isAndroid(),c=u||r("(pointer:coarse)"),a=o||!i&&u&&r("(min-device-width:768px)"),l=i||u&&!a,f=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(t),s=!l&&!a&&!f;return{isiPad:D(o),isiPhone:D(i),isTablet:D(a),isPhone:D(l),isTouch:D(c),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:D(f),isDesktop:D(s)}}(i,o,e,n)}}(f.navigator.userAgent,function(e){return f.window.matchMedia(e).matches})),Nn=Qe,kn=Je,In=function(e,n){return e.dom()===n.dom()},Bn=me().browser.isIE()?function(e,n){return ln(e.dom(),n.dom())}:function(e,n){var t=e.dom(),r=n.dom();return t!==r&&t.contains(r)},Pn=ge,Mn=(B("element","offset"),function(e,n){e.dom().appendChild(n.dom())}),Wn=function(e){var n=e.dom();null!==n.parentNode&&n.parentNode.removeChild(n)},_n=(B("width","height"),B("width","height"),B("rows","columns")),Ln=B("row","column"),jn=(B("x","y"),B("element","rowspan","colspan")),zn=B("element","rowspan","colspan","isNew"),Hn=B("element","rowspan","colspan","row","column"),Fn=B("element","cells","section"),Un=B("element","isNew"),qn=B("element","cells","section","isNew"),Vn=B("cells","section"),Gn=B("details","section"),Yn=B("startRow","startCol","finishRow","finishCol"),Kn=function(e,n){var t=[];return p(Ce(e),function(e){n(e)&&(t=t.concat([e])),t=t.concat(Kn(e,n))}),t};function Xn(e,n,t,r,o){return e(t,r)?Me.some(t):ze(o)&&o(t)?Me.none():n(t,r,o)}function $n(e,n,t){for(var r=e.dom(),o=ze(t)?t:D(!1);r.parentNode;){r=r.parentNode;var i=on.fromDom(r);if(n(i))return Me.some(i);if(o(i))break}return Me.none()}function Jn(e,n,t){return $n(e,function(e){return ge(e,n)},t)}function Qn(e,n){return function(e,n){return y(e.dom().childNodes,function(e){return n(on.fromDom(e))}).map(on.fromDom)}(e,function(e){return ge(e,n)})}function Zn(e,n){return function(e,n){var t=n===undefined?f.document:n.dom();return pe(t)?Me.none():Me.from(t.querySelector(e)).map(on.fromDom)}(n,e)}function et(e,n,t){return Xn(ge,Jn,e,n,t)}function nt(e,n,t){return void 0===t&&(t=s),t(n)?Me.none():l(e,en(n))?Me.some(n):Jn(n,e.join(","),function(e){return ge(e,"table")||t(e)})}function tt(n,e){return ve(e).map(function(e){return Ie(e,n)})}function rt(e,n){return parseInt(V(e,n),10)}function ot(e,n){return e+","+n}var it=function(e,n,t){return x(Ce(e),function(e){return ge(e,n)?t(e)?[e]:[]:it(e,n,t)})},ut={firstLayer:function(e,n){return it(e,n,D(!0))},filterFirstLayer:it},ct=b(tt,"th,td"),at=b(tt,"tr"),lt={cell:function(e,n){return nt(["td","th"],e,n)},firstCell:function(e){return Zn(e,"th,td")},cells:function(e){return ut.firstLayer(e,"th,td")},neighbourCells:ct,table:function(e,n){return et(e,"table",n)},row:function(e,n){return nt(["tr"],e,n)},rows:function(e){return ut.firstLayer(e,"tr")},notCell:function(e,n){return nt(["caption","tr","tbody","tfoot","thead"],e,n)},neighbourRows:at,attr:rt,grid:function(e,n,t){var r=rt(e,n),o=rt(e,t);return _n(r,o)}},ft=function(e){var n=lt.rows(e);return g(n,function(e){var n=e,t=ve(n).map(function(e){var n=en(e);return"tfoot"===n||"thead"===n||"tbody"===n?n:"tbody"}).getOr("tbody"),r=g(lt.cells(e),function(e){var n=G(e,"rowspan")?parseInt(V(e,"rowspan"),10):1,t=G(e,"colspan")?parseInt(V(e,"colspan"),10):1;return jn(e,n,t)});return Fn(n,r,t)})},st=function(e,t){return g(e,function(e){var n=g(lt.cells(e),function(e){var n=G(e,"rowspan")?parseInt(V(e,"rowspan"),10):1,t=G(e,"colspan")?parseInt(V(e,"colspan"),10):1;return jn(e,n,t)});return Fn(e,n,t.section())})},dt=function(e,n){var t=x(e.all(),function(e){return e.cells()});return h(t,n)},mt={generate:function(e){var l={},n=[],t=e.length,f=0;p(e,function(e,c){var a=[];p(e.cells(),function(e){for(var n=0;l[ot(c,n)]!==undefined;)n++;for(var t=Hn(e.element(),e.rowspan(),e.colspan(),c,n),r=0;r<e.colspan();r++)for(var o=0;o<e.rowspan();o++){var i=n+r,u=ot(c+o,i);l[u]=t,f=Math.max(f,i+1)}a.push(t)}),n.push(Fn(e.element(),a,e.section()))});var r=_n(t,f);return{grid:D(r),access:D(l),all:D(n)}},getAt:function(e,n,t){var r=e.access()[ot(n,t)];return r!==undefined?Me.some(r):Me.none()},findItem:function(e,n,t){var r=dt(e,function(e){return t(n,e.element())});return 0<r.length?Me.some(r[0]):Me.none()},filterItems:dt,justCells:function(e){var n=g(e.all(),function(e){return e.cells()});return S(n)}},gt=B("minRow","minCol","maxRow","maxCol"),pt=function(e,n){function t(e){return ge(e.element(),n)}var r=ft(e),o=mt.generate(r),i=function(e,i){var n=e.grid().columns(),u=e.grid().rows(),c=n,a=0,l=0;return N(e.access(),function(e){if(i(e)){var n=e.row(),t=n+e.rowspan()-1,r=e.column(),o=r+e.colspan()-1;n<u?u=n:a<t&&(a=t),r<c?c=r:l<o&&(l=o)}}),gt(u,c,a,l)}(o,t),u="th:not("+n+"),td:not("+n+")",c=ut.filterFirstLayer(e,"th,td",function(e){return ge(e,u)});return p(c,Wn),function(e,n,t,r){for(var o,i,u,c=n.grid().columns(),a=n.grid().rows(),l=0;l<a;l++)for(var f=!1,s=0;s<c;s++){if(!(l<t.minRow()||l>t.maxRow()||s<t.minCol()||s>t.maxCol()))mt.getAt(n,l,s).filter(r).isNone()?(o=f,void 0,i=e[l].element(),u=on.fromTag("td"),Mn(u,on.fromTag("br")),(o?Mn:Te)(i,u)):f=!0}}(r,o,i,t),function(e,n){var t=h(ut.firstLayer(e,"tr"),function(e){return 0===e.dom().childElementCount});p(t,Wn),n.minCol()!==n.maxCol()&&n.minRow()!==n.maxRow()||p(ut.firstLayer(e,"th,td"),function(e){Y(e,"rowspan"),Y(e,"colspan")}),Y(e,"width"),Y(e,"height"),ue(e,"width"),ue(e,"height")}(e,i),e};function ht(e){return Bt.get(e)}function vt(e){return Bt.getOption(e)}function bt(e,n){Bt.set(e,n)}function wt(e){return"img"===en(e)?1:vt(e).fold(function(){return Ce(e).length},function(e){return e.length})}function yt(e){return function(e){return vt(e).filter(function(e){return 0!==e.trim().length||-1<e.indexOf("\xa0")}).isSome()}(e)||l(Pt,en(e))}function Ct(e){return function(e,o){var i=function(e){for(var n=0;n<e.childNodes.length;n++){var t=on.fromDom(e.childNodes[n]);if(o(t))return Me.some(t);var r=i(e.childNodes[n]);if(r.isSome())return r}return Me.none()};return i(e.dom())}(e,yt)}function St(e){return Mt(e,yt)}function xt(e,n){return on.fromDom(e.dom().cloneNode(n))}function Rt(e){return xt(e,!1)}function Tt(e){return xt(e,!0)}function Ot(e,n){var t=function(e,n){var t=on.fromTag(n),r=K(e);return q(t,r),t}(e,n),r=Ce(Tt(e));return Ae(t,r),t}function Dt(){var e=on.fromTag("td");return Mn(e,on.fromTag("br")),e}function At(e,n,t){var r=Ot(e,n);return N(t,function(e,n){null===e?Y(r,n):U(r,n,e)}),r}function Et(e){return e}function Nt(e){return function(){return on.fromTag("tr",e.dom())}}function kt(e,n){return n.column()>=e.startCol()&&n.column()+n.colspan()-1<=e.finishCol()&&n.row()>=e.startRow()&&n.row()+n.rowspan()-1<=e.finishRow()}function It(e,n,t){var r=mt.findItem(e,n,In),o=mt.findItem(e,t,In);return r.bind(function(n){return o.map(function(e){return function(e,n){return Yn(Math.min(e.row(),n.row()),Math.min(e.column(),n.column()),Math.max(e.row()+e.rowspan()-1,n.row()+n.rowspan()-1),Math.max(e.column()+e.colspan()-1,n.column()+n.colspan()-1))}(n,e)})})}var Bt=function Qf(t,r){var n=function(e){return t(e)?Me.from(e.dom().nodeValue):Me.none()};return{get:function(e){if(!t(e))throw new Error("Can only get "+r+" value of a "+r+" node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw "+r+" value of a "+r+" node");e.dom().nodeValue=n}}}(tn,"text"),Pt=["img","br"],Mt=function(e,i){var u=function(e){for(var n=Ce(e),t=n.length-1;0<=t;t--){var r=n[t];if(i(r))return Me.some(r);var o=u(r);if(o.isSome())return o}return Me.none()};return u(e)},Wt={cellOperations:function(i,e,u){return{row:Nt(e),cell:function(e){var n=he(e.element()),t=on.fromTag(en(e.element()),n.dom()),r=u.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),o=0<r.length?function(r,o,i){return Ct(r).map(function(e){var n=i.join(","),t=ke(e,n,function(e){return In(e,r)});return v(t,function(e,n){var t=Rt(n);return Y(t,"contenteditable"),Mn(e,t),t},o)}).getOr(o)}(e.element(),t,r):t;return Mn(o,on.fromTag("br")),function(e,n){var t=e.dom(),r=n.dom();Q(t)&&Q(r)&&(r.style.cssText=t.style.cssText)}(e.element(),t),ue(t,"height"),1!==e.colspan()&&ue(e.element(),"width"),i(e.element(),t),t},replace:At,gap:Dt}},paste:function(e){return{row:Nt(e),cell:Dt,replace:Et,gap:Dt}}},_t=function(e,n){var t=n.column(),r=n.column()+n.colspan()-1,o=n.row(),i=n.row()+n.rowspan()-1;return t<=e.finishCol()&&r>=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},Lt=function(e,n){for(var t=!0,r=b(kt,n),o=n.startRow();o<=n.finishRow();o++)for(var i=n.startCol();i<=n.finishCol();i++)t=t&&mt.getAt(e,o,i).exists(r);return t?Me.some(n):Me.none()},jt=It,zt=function(n,e,t){return It(n,e,t).bind(function(e){return Lt(n,e)})},Ht=function(r,e,o,i){return mt.findItem(r,e,In).bind(function(e){var n=0<o?e.row()+e.rowspan()-1:e.row(),t=0<i?e.column()+e.colspan()-1:e.column();return mt.getAt(r,n+o,t+i).map(function(e){return e.element()})})},Ft=function(t,e,n){return jt(t,e,n).map(function(e){var n=mt.filterItems(t,b(_t,e));return g(n,function(e){return e.element()})})},Ut=function(e,n){return mt.findItem(e,n,function(e,n){return Bn(n,e)}).map(function(e){return e.element()})},qt=function(e){var n=ft(e);return mt.generate(n)},Vt=function(t,r,o){return lt.table(t).bind(function(e){var n=qt(e);return Ht(n,t,r,o)})},Gt=function(e,n,t){var r=qt(e);return Ft(r,n,t)},Yt=function(e,n,t,r,o){var i=qt(e),u=In(e,t)?Me.some(n):Ut(i,n),c=In(e,o)?Me.some(r):Ut(i,r);return u.bind(function(n){return c.bind(function(e){return Ft(i,n,e)})})},Kt=function(e,n,t){var r=qt(e);return zt(r,n,t)},Xt=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function $t(){return{up:D({selector:Jn,closest:et,predicate:$n,all:be}),down:D({selector:Be,predicate:Kn}),styles:D({get:oe,getRaw:ie,set:te,remove:ue}),attrs:D({get:V,set:U,remove:Y,copyTo:function(e,n){var t=K(e);q(n,t)}}),insert:D({before:xe,after:Re,afterAll:De,append:Mn,appendAll:Ae,prepend:Te,wrap:Oe}),remove:D({unwrap:Ne,remove:Wn}),create:D({nu:on.fromTag,clone:function(e){return on.fromDom(e.dom().cloneNode(!1))},text:on.fromText}),query:D({comparePosition:function(e,n){return e.dom().compareDocumentPosition(n.dom())},prevSibling:we,nextSibling:ye}),property:D({children:Ce,name:en,parent:ve,document:function(e){return e.dom().ownerDocument},isText:tn,isComment:H,isElement:nn,getText:ht,setText:bt,isBoundary:function(e){return!!nn(e)&&("body"===en(e)||l(Xt,en(e)))},isEmptyTag:function(e){return!!nn(e)&&l(["br","img","hr","input"],en(e))}}),eq:In,is:Pn}}function Jt(e,n,t){var r=e.property().children(n);return C(r,b(e.eq,t)).map(function(e){return{before:D(r.slice(0,e)),after:D(r.slice(e+1))}})}function Qt(e,n){return b(e.eq,n)}function Zt(n,e,t,r){function o(n){return C(n,r).fold(function(){return n},function(e){return n.slice(0,e+1)})}void 0===r&&(r=s);var i=[e].concat(n.up().all(e)),u=[t].concat(n.up().all(t)),c=o(i),a=o(u),l=y(c,function(e){return m(a,Qt(n,e))});return{firstpath:D(c),secondpath:D(a),shared:D(l)}}function er(e){return Jn(e,"table")}function nr(c,a,r){function l(n){return function(e){return r!==undefined&&r(e)||In(e,n)}}return In(c,a)?Me.some(sr.create({boxes:Me.some([c]),start:c,finish:a})):er(c).bind(function(u){return er(a).bind(function(i){if(In(u,i))return Me.some(sr.create({boxes:Gt(u,c,a),start:c,finish:a}));if(Bn(u,i)){var e=0<(n=ke(a,"td,th",l(u))).length?n[n.length-1]:a;return Me.some(sr.create({boxes:Yt(u,c,u,a,i),start:c,finish:e}))}if(Bn(i,u)){var n,t=0<(n=ke(c,"td,th",l(i))).length?n[n.length-1]:c;return Me.some(sr.create({boxes:Yt(i,c,u,a,i),start:c,finish:t}))}return fr.ancestors(c,a).shared().bind(function(e){return et(e,"table",r).bind(function(e){var n=ke(a,"td,th",l(e)),t=0<n.length?n[n.length-1]:a,r=ke(c,"td,th",l(e)),o=0<r.length?r[r.length-1]:c;return Me.some(sr.create({boxes:Yt(e,c,u,a,i),start:o,finish:t}))})})})})}function tr(e,n){return Rr.cata(n.get(),D([]),o,D([e]))}function rr(e){return{element:D(e),mergable:Me.none,unmergable:Me.none,selection:D([e])}}var or=B("left","right"),ir=B("first","second","splits"),ur=function(r,o,e,n){var t=o(r,e);return v(n,function(e,n){var t=o(r,n);return cr(r,e,t)},t)},cr=function(n,e,t){return e.bind(function(e){return t.filter(b(n.eq,e))})},ar={sharedOne:function(e,n,t){return 0<t.length?function(e,n,t,r){return r(e,n,t[0],t.slice(1))}(e,n,t,ur):Me.none()},subset:function(n,e,t){var r=Zt(n,e,t);return r.shared().bind(function(e){return function(o,i,e,n){var u=o.property().children(i);if(o.eq(i,e[0]))return Me.some([e[0]]);if(o.eq(i,n[0]))return Me.some([n[0]]);function t(e){var n=E(e),t=C(n,Qt(o,i)).getOr(-1),r=t<n.length-1?n[t+1]:n[t];return C(u,Qt(o,r))}var r=t(e),c=t(n);return r.bind(function(r){return c.map(function(e){var n=Math.min(r,e),t=Math.max(r,e);return u.slice(n,t+1)})})}(n,e,r.firstpath(),r.secondpath())})},ancestors:Zt,breakToLeft:function(t,r,o){return Jt(t,r,o).map(function(e){var n=t.create().clone(r);return t.insert().appendAll(n,e.before().concat([o])),t.insert().appendAll(r,e.after()),t.insert().before(r,n),or(n,r)})},breakToRight:function(t,r,e){return Jt(t,r,e).map(function(e){var n=t.create().clone(r);return t.insert().appendAll(n,e.after()),t.insert().after(r,n),or(r,n)})},breakPath:function(i,e,u,c){var a=function(e,n,o){var t=ir(e,Me.none(),o);return u(e)?ir(e,n,o):i.property().parent(e).bind(function(r){return c(i,r,e).map(function(e){var n=[{first:e.left,second:e.right}],t=u(r)?r:e.left();return a(t,Me.some(e.right()),o.concat(n))})}).getOr(t)};return a(e,Me.none(),[])}},lr=$t(),fr={sharedOne:function(t,e){return ar.sharedOne(lr,function(e,n){return t(n)},e)},subset:function(e,n){return ar.subset(lr,e,n)},ancestors:function(e,n,t){return ar.ancestors(lr,e,n,t)},breakToLeft:function(e,n){return ar.breakToLeft(lr,e,n)},breakToRight:function(e,n){return ar.breakToRight(lr,e,n)},breakPath:function(e,n,r){return ar.breakPath(lr,e,n,function(e,n,t){return r(n,t)})}},sr={create:Xe(["boxes","start","finish"],[])},dr=nr,mr=function(e,n){var t=Be(e,n);return 0<t.length?Me.some(t):Me.none()},gr=function(e,n,t,r,o){return function(e,n){return y(e,function(e){return ge(e,n)})}(e,o).bind(function(e){return Vt(e,n,t).bind(function(e){return function(n,t){return Jn(n,"table").bind(function(e){return Zn(e,t).bind(function(e){return nr(e,n).bind(function(n){return n.boxes().map(function(e){return{boxes:D(e),start:D(n.start()),finish:D(n.finish())}})})})})}(e,r)})})},pr=function(e,n,r){return Zn(e,n).bind(function(t){return Zn(e,r).bind(function(n){return fr.sharedOne(er,[t,n]).map(function(e){return{first:D(t),last:D(n),table:D(e)}})})})},hr=function(e,n){return mr(e,n)},vr=function(o,e,n){return pr(o,e,n).bind(function(t){function e(e){return In(o,e)}var n=Jn(t.first(),"thead,tfoot,tbody,table",e),r=Jn(t.last(),"thead,tfoot,tbody,table",e);return n.bind(function(n){return r.bind(function(e){return In(n,e)?Kt(t.table(),t.first(),t.last()):Me.none()})})})},br="data-mce-selected",wr="data-mce-first-selected",yr="data-mce-last-selected",Cr={selected:D(br),selectedSelector:D("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:D("[data-mce-selected]"),firstSelected:D(wr),firstSelectedSelector:D("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:D(yr),lastSelectedSelector:D("td[data-mce-last-selected],th[data-mce-last-selected]")},Sr=function(u){if(!Le(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 p(u,function(e,r){var n=Ve(e);if(1!==n.length)throw new Error("one and only one name per case");var o=n[0],i=e[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(!Le(i))throw new Error("case arguments must be an array");c.push(o),t[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var t=new Array(e),n=0;n<t.length;n++)t[n]=arguments[n];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(e){var n=Ve(e);if(c.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+n.join(","));if(!A(c,function(e){return l(n,e)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+c.join(", "));return e[o].apply(null,t)},log:function(e){f.console.log(e,{constructors:c,constructor:o,params:t})}}}}),t},xr=Sr([{none:[]},{multiple:["elements"]},{single:["selection"]}]),Rr={cata:function(e,n,t,r){return e.fold(n,t,r)},none:xr.none,multiple:xr.multiple,single:xr.single},Tr=function(t,e){return Rr.cata(e.get(),Me.none,function(n,e){return 0===n.length?Me.none():vr(t,Cr.firstSelectedSelector(),Cr.lastSelectedSelector()).bind(function(e){return 1<n.length?Me.some({bounds:D(e),cells:D(n)}):Me.none()})},Me.none)},Or=function(e,n){var t=tr(e,n);return 0<t.length&&A(t,function(e){return G(e,"rowspan")&&1<parseInt(V(e,"rowspan"),10)||G(e,"colspan")&&1<parseInt(V(e,"colspan"),10)})?Me.some(t):Me.none()},Dr=tr,Ar=B("element","clipboard","generators"),Er={noMenu:rr,forMenu:function(e,n,t){return{element:D(t),mergable:D(Tr(n,e)),unmergable:D(Or(t,e)),selection:D(Dr(t,e))}},notCell:function(e){return rr(e)},paste:Ar,pasteRows:function(e,n,t,r,o){return{element:D(t),mergable:Me.none,unmergable:Me.none,selection:D(Dr(t,e)),clipboard:D(r),generators:D(o)}}},Nr={registerEvents:function(c,e,a,l){c.on("BeforeGetContent",function(n){!0===n.selection&&Rr.cata(e.get(),T,function(e){n.preventDefault(),function(e){return lt.table(e[0]).map(Tt).map(function(e){return[pt(e,Cr.attributeSelector())]})}(e).each(function(e){n.content="text"===n.format?function(e){return g(e,function(e){return e.dom().innerText}).join("")}(e):function(n,e){return g(e,function(e){return n.selection.serializer.serialize(e.dom(),{})}).join("")}(c,e)})},T)}),c.on("BeforeSetContent",function(u){!0===u.selection&&!0===u.paste&&Me.from(c.dom.getParent(c.selection.getStart(),"th,td")).each(function(e){var i=on.fromDom(e);lt.table(i).each(function(n){var e=h(function(e,n){var t=(n||f.document).createElement("div");return t.innerHTML=e,Ce(on.fromDom(t))}(u.content),function(e){return"meta"!==en(e)});if(1===e.length&&"table"===en(e[0])){u.preventDefault();var t=on.fromDom(c.getDoc()),r=Wt.paste(t),o=Er.paste(i,e[0],r);a.pasteCells(n,o).each(function(e){c.selection.setRng(e),c.focus(),l.clear(n)})}})})})}};function kr(r,o){function e(e){var n=o(e);if(n<=0||null===n){var t=oe(e,r);return parseFloat(t)||0}return n}function i(o,e){return w(e,function(e,n){var t=oe(o,n),r=t===undefined?0:parseInt(t,10);return isNaN(r)?e:e+r},0)}return{set:function(e,n){if(!He(n)&&!n.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+n);var t=e.dom();Q(t)&&(t.style[r]=n+"px")},get:e,getOuter:e,aggregate:i,max:function(e,n,t){var r=i(e,t);return r<n?n-r:0}}}function Ir(e){return Qr.get(e)}function Br(e){return Qr.getOuter(e)}function Pr(e){return Zr.get(e)}function Mr(e){return Zr.getOuter(e)}function Wr(e,n,t){return function(e,n){var t=parseFloat(e);return isNaN(t)?n:t}(oe(e,n),t)}function _r(e,n){te(e,"height",n+"px")}function Lr(e,n,t,r){var o=parseInt(e,10);return function(e,n){return X(e,n,e.length-n.length)}(e,"%")&&"table"!==en(n)?function(e,t,r,n){var o=lt.table(e).map(function(e){var n=r(e);return Math.floor(t/100*n)}).getOr(t);return n(e,o),o}(n,o,t,r):o}function jr(e){var n=function(e){return ie(e,"height").getOrThunk(function(){return no(e)+"px"})}(e);return n?Lr(n,e,Ir,_r):Ir(e)}function zr(e){return ie(e,"width").fold(function(){return Me.from(V(e,"width"))},function(e){return Me.some(e)})}function Hr(e,n){return e/n.pixelWidth()*100}function Fr(e,n){return e!==undefined?e:n!==undefined?n:0}function Ur(e){var n=e.dom().ownerDocument,t=n.body,r=n.defaultView,o=n.documentElement;if(t===e.dom())return lo(t.offsetLeft,t.offsetTop);var i=Fr(r.pageYOffset,o.scrollTop),u=Fr(r.pageXOffset,o.scrollLeft),c=Fr(o.clientTop,t.clientTop),a=Fr(o.clientLeft,t.clientLeft);return fo(e).translate(u-a,i-c)}function qr(e){return Ur(e).left()+Mr(e)}function Vr(e){return Ur(e).left()}function Gr(e,n){return mo(e,Vr(n))}function Yr(e,n){return mo(e,qr(n))}function Kr(e){return Ur(e).top()}function Xr(e,n){return so(e,Kr(n))}function $r(e,n){return so(e,Kr(n)+Br(n))}function Jr(t,n,r){if(0===r.length)return[];var e=g(r.slice(1),function(e,n){return e.map(function(e){return t(n,e)})}),o=r[r.length-1].map(function(e){return n(r.length-1,e)});return e.concat([o])}var Qr=kr("height",function(e){var n=e.dom();return ee(e)?n.getBoundingClientRect().height:n.offsetHeight}),Zr=kr("width",function(e){return e.dom().offsetWidth}),eo=me(),no=function(e){return eo.browser.isIE()||eo.browser.isEdge()?function(e){var n=Wr(e,"padding-top",0),t=Wr(e,"padding-bottom",0),r=Wr(e,"border-top-width",0),o=Wr(e,"border-bottom-width",0),i=e.dom().getBoundingClientRect().height;return"border-box"===oe(e,"box-sizing")?i:i-n-t-(r+o)}(e):Wr(e,"height",Ir(e))},to=/(\d+(\.\d+)?)(\w|%)*/,ro=/(\d+(\.\d+)?)%/,oo=/(\d+(\.\d+)?)px|em/,io=function(e,n){return G(e,n)?parseInt(V(e,n),10):1},uo={percentageBasedSizeRegex:D(ro),pixelBasedSizeRegex:D(oo),setPixelWidth:function(e,n){te(e,"width",n+"px")},setPercentageWidth:function(e,n){te(e,"width",n+"%")},setHeight:_r,getPixelWidth:function(n,t){return zr(n).fold(function(){return Pr(n)},function(e){return function(e,n,t){var r=oo.exec(n);if(null!==r)return parseInt(r[1],10);var o=ro.exec(n);return null===o?Pr(e):function(e,n){return e/100*n.pixelWidth()}(parseFloat(o[1]),t)}(n,e,t)})},getPercentageWidth:function(n,t){return zr(n).fold(function(){var e=Pr(n);return Hr(e,t)},function(e){return function(e,n,t){var r=ro.exec(n);if(null!==r)return parseFloat(r[1]);var o=Pr(e);return Hr(o,t)}(n,e,t)})},getGenericWidth:function(e){return zr(e).bind(function(e){var n=to.exec(e);return null!==n?Me.some({width:D(parseFloat(n[1])),unit:D(n[3])}):Me.none()})},setGenericWidth:function(e,n,t){te(e,"width",n+t)},getHeight:function(e){return function(e,n,t){return t(e)/io(e,n)}(e,"rowspan",jr)},getRawWidth:zr},co=function(t,r){uo.getGenericWidth(t).each(function(e){var n=e.width()/2;uo.setGenericWidth(t,n,e.unit()),uo.setGenericWidth(r,n,e.unit())})},ao=function(t,r){return{left:D(t),top:D(r),translate:function(e,n){return ao(t+e,r+n)}}},lo=ao,fo=function(e){var n=e.dom(),t=n.ownerDocument.body;return t===n?lo(t.offsetLeft,t.offsetTop):ee(e)?function(e){var n=e.getBoundingClientRect();return lo(n.left,n.top)}(n):lo(0,0)},so=B("row","y"),mo=B("col","x"),go={height:{delta:o,positions:function(e){return Jr(Xr,$r,e)},edge:Kr},rtl:{delta:function(e){return-e},edge:qr,positions:function(e){return Jr(Yr,Gr,e)}},ltr:{delta:o,edge:Vr,positions:function(e){return Jr(Gr,Yr,e)}}},po={ltr:go.ltr,rtl:go.rtl};function ho(n){function t(e){return n(e).isRtl()?po.rtl:po.ltr}return{delta:function(e,n){return t(n).delta(e,n)},edge:function(e){return t(e).edge(e)},positions:function(e,n){return t(n).positions(e,n)}}}function vo(e){for(var n=[],t=function(e){n.push(e)},r=0;r<e.length;r++)e[r].each(t);return n}function bo(e,n){for(var t=0;t<e.length;t++){var r=n(e[t],t);if(r.isSome())return r}return Me.none()}function wo(e,n,t,r){t===r?Y(e,n):U(e,n,t)}function yo(e,n){var t=V(e,n);return t===undefined||""===t?[]:t.split(" ")}function Co(e){return e.dom().classList!==undefined}function So(e,n){return function(e,n,t){var r=yo(e,n).concat([t]);return U(e,n,r.join(" ")),!0}(e,"class",n)}function xo(e,n){return function(e,n,t){var r=h(yo(e,n),function(e){return e!==t});return 0<r.length?U(e,n,r.join(" ")):Y(e,n),!1}(e,"class",n)}function Ro(e,n){Co(e)?e.dom().classList.add(n):So(e,n)}function To(e){0===(Co(e)?e.dom().classList:function(e){return yo(e,"class")}(e)).length&&Y(e,"class")}function Oo(e,n){return Co(e)&&e.dom().classList.contains(n)}function Do(e,n){for(var t=[],r=e;r<n;r++)t.push(r);return t}function Ao(n,t){if(t<0||t>=n.length-1)return Me.none();var e=n[t].fold(function(){var e=E(n.slice(0,t));return bo(e,function(e,n){return e.map(function(e){return{value:e,delta:n+1}})})},function(e){return Me.some({value:e,delta:0})}),r=n[t+1].fold(function(){var e=n.slice(t+1);return bo(e,function(e,n){return e.map(function(e){return{value:e,delta:n+1}})})},function(e){return Me.some({value:e,delta:1})});return e.bind(function(t){return r.map(function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n})})}function Eo(e){var n=e.replace(/\./g,"-");return{resolve:function(e){return n+"-"+e}}}function No(e){var n=Be(e.parent(),"."+iu);p(n,Wn)}function ko(t,e,r){var o=t.origin();p(e,function(e,n){e.each(function(e){var n=r(o,e);Ro(n,iu),Mn(t.parent(),n)})})}function Io(e,n,t,r,o,i){var u=Ur(n);!function(e,n,r,o){ko(e,n,function(e,n){var t=ou(n.row(),r.left()-e.left(),n.y()-e.top(),o,7);return Ro(t,uu),t})}(e,0<t.length?o.positions(t,n):[],u,Mr(n)),function(e,n,r,o){ko(e,n,function(e,n){var t=ru(n.col(),n.x()-e.left(),r.top()-e.top(),7,o);return Ro(t,cu),t})}(e,0<r.length?i.positions(r,n):[],u,Br(n))}function Bo(e,n){var t=Be(e.parent(),"."+iu);p(t,n)}function Po(e,n){return e.cells()[n]}function Mo(e,n){if(0===e.length)return 0;var t=e[0];return C(e,function(e){return!n(t.element(),e.element())}).fold(function(){return e.length},function(e){return e})}function Wo(e,t){return g(e,function(e){var n=function(e){return bo(e,function(e){return ve(e.element()).map(function(e){var n=ve(e).isNone();return Un(e,n)})}).getOrThunk(function(){return Un(t.row(),!0)})}(e.details());return qn(n.element(),e.details(),e.section(),n.isNew())})}function _o(e,n){var t=vu(e,In);return Wo(t,n)}function Lo(e,n){var t=S(g(e.all(),function(e){return e.cells()}));return y(t,function(e){return In(n,e.element())})}function jo(c,a,l,f,s){return function(t,r,e,o,i){var n=ft(r),u=mt.generate(n);return a(u,e).map(function(e){var n=function(e,n){return bu(e,n,!1)}(u,o),t=c(n,e,In,s(o)),r=_o(t.grid(),o);return{grid:D(r),cursor:t.cursor}}).fold(function(){return Me.none()},function(e){var n=Ji(r,e.grid());return l(r,e.grid(),i),f(r),au(t,r,go.height,i),Me.some({cursor:e.cursor,newRows:n.newRows,newCells:n.newCells})})}}function zo(n,e){return lt.cell(e.element()).bind(function(e){return Lo(n,e)})}function Ho(n,e){var t=g(e.selection(),function(e){return lt.cell(e).bind(function(e){return Lo(n,e)})}),r=vo(t);return 0<r.length?Me.some({cells:r,generators:e.generators,clipboard:e.clipboard}):Me.none()}function Fo(n,e){var t=g(e.selection(),function(e){return lt.cell(e).bind(function(e){return Lo(n,e)})}),r=vo(t);return 0<r.length?Me.some(r):Me.none()}function Uo(e,n){return g(e,function(){return Un(n.cell(),!0)})}function qo(n,e,t){return n.concat(function(e,n){for(var t=[],r=0;r<e;r++)t.push(n(r));return t}(e,function(e){return pu.setCells(n[n.length-1],Uo(n[n.length-1].cells(),t))}))}function Vo(e,n,t){return g(e,function(e){return pu.setCells(e,e.cells().concat(Uo(Do(0,n),t)))})}function Go(e,t,r,n){return g(e,function(e){return pu.mapCells(e,function(e){return function(n){return m(t,function(e){return r(n.element(),e.element())})}(e)?Un(n(e.element(),r),!0):e})})}function Yo(e,n,t,r){return pu.getCellElement(e[n],t)!==undefined&&0<n&&r(pu.getCellElement(e[n-1],t),pu.getCellElement(e[n],t))}function Ko(e,n,t){return 0<n&&t(pu.getCellElement(e,n-1),pu.getCellElement(e,n))}function Xo(e,n){return G(e,n)&&1<parseInt(V(e,n),10)}function $o(e,n,t){return ie(e,n).fold(function(){return t(e)+"px"},function(e){return e})}function Jo(e,n){return $o(e,"width",function(e){return uo.getPixelWidth(e,n)})}function Qo(e){return $o(e,"height",uo.getHeight)}function Zo(e,n,t,r,o){var i=eu(e),u=g(i,function(e){return e.map(n.edge)});return g(i,function(e,n){return e.filter(d(Hu.hasColspan)).fold(function(){var e=Ao(u,n);return r(e)},function(e){return t(e,o)})})}function ei(e){return e.map(function(e){return e+"px"}).getOr("")}function ni(e,n,t,r){var o=nu(e),i=g(o,function(e){return e.map(n.edge)});return g(o,function(e,n){return e.filter(d(Hu.hasRowspan)).fold(function(){var e=Ao(i,n);return r(e)},function(e){return t(e)})})}function ti(e,n,t){for(var r=0,o=e;o<n;o++)r+=t[o]!==undefined?t[o]:0;return r}function ri(e){var n=o;return{width:D(e),pixelWidth:D(e),getWidths:Fu.getPixelWidths,getCellDelta:n,singleColumnWidth:function(e,n){return[Math.max(Hu.minWidth(),e+n)-e]},minCellWidth:Hu.minWidth,setElementWidth:uo.setPixelWidth,setTableWidth:function(e,n,t){var r=v(n,function(e,n){return e+n},0);uo.setPixelWidth(e,r)}}}function oi(e,n){var t=uo.percentageBasedSizeRegex().exec(n);if(null!==t)return function(e,n){var o=parseFloat(e),t=Pr(n);return{width:D(o),pixelWidth:D(t),getWidths:Fu.getPercentageWidths,getCellDelta:function(e){return e/t*100},singleColumnWidth:function(e,n){return[100-e]},minCellWidth:function(){return Hu.minWidth()/t*100},setElementWidth:uo.setPercentageWidth,setTableWidth:function(e,n,t){var r=t/100*o;uo.setPercentageWidth(e,o+r)}}}(t[1],e);var r=uo.pixelBasedSizeRegex().exec(n);if(null!==r){var o=parseInt(r[1],10);return ri(o)}var i=Pr(e);return ri(i)}function ii(e){return mt.generate(e)}function ui(e){var n=ft(e);return ii(n)}function ci(n,e){var t=h(e,function(e){return!l(n,e)});0<t.length&&W(t)}function ai(e){return function(e,n){return $u(e,n,{validate:ze,label:"function"})}(ci,e)}function li(e){var n=G(e,"colspan")?parseInt(V(e,"colspan"),10):1,t=G(e,"rowspan")?parseInt(V(e,"rowspan"),10):1;return{element:D(e),colspan:D(n),rowspan:D(t)}}function fi(e,n){var t=e.property().name(n);return l(nc,t)}function si(e,n){return l(["br","img","hr","input"],e.property().name(n))}function di(e){0===lt.cells(e).length&&Wn(e)}function mi(e,n,t){return sc(e,n,t).orThunk(function(){return sc(e,0,0)})}function gi(e,n,t){return fc(e,sc(e,n,t))}function pi(e){return w(e,function(e,n){return m(e,function(e){return e.row()===n.row()})?e:e.concat([n])},[]).sort(function(e,n){return e.row()-n.row()})}function hi(e){return w(e,function(e,n){return m(e,function(e){return e.column()===n.column()})?e:e.concat([n])},[]).sort(function(e,n){return e.column()-n.column()})}function vi(e,n,t){var r=st(e,t),o=mt.generate(r);return bu(o,n,!0)}function bi(e){return e.getBoundingClientRect().width}function wi(e){return e.getBoundingClientRect().height}function yi(e){return/^[0-9]+$/.test(e)&&(e+="px"),e}function Ci(e){var n=Be(e,"td[data-mce-style],th[data-mce-style]");Y(e,"data-mce-style"),p(n,function(e){Y(e,"data-mce-style")})}function Si(e){return e.getParam("table_default_attributes",yc,"object")}function xi(e){return e.getParam("table_default_styles",wc,"object")}function Ri(e){return e.getParam("table_cell_advtab",!0,"boolean")}function Ti(e){return e.getParam("table_row_advtab",!0,"boolean")}function Oi(e){return e.getParam("table_advtab",!0,"boolean")}function Di(e){return e.getParam("table_style_by_css",!1,"boolean")}function Ai(e){return e.getParam("table_class_list",[],"array")}function Ei(e){return!1===e.getParam("table_responsive_width")}function Ni(e,n){return e.fire("newrow",{node:n})}function ki(e,n){return e.fire("newcell",{node:n})}function Ii(e,n,t,r){e.fire("ObjectResizeStart",{target:n,width:t,height:r})}function Bi(e,n,t,r){e.fire("ObjectResized",{target:n,width:t,height:r})}function Pi(n,e){function t(e){return J(e,"rgb")?n.toHex(e):e}return{borderwidth:ie(on.fromDom(e),"border-width").getOr(""),borderstyle:ie(on.fromDom(e),"border-style").getOr(""),bordercolor:ie(on.fromDom(e),"border-color").map(t).getOr(""),backgroundcolor:ie(on.fromDom(e),"background-color").map(t).getOr("")}}function Mi(e,n,t,r,o){var i={};return Dc.each(e.split(" "),function(e){r.formatter.matchNode(o,n+e)&&(i[t]=e)}),i[t]||(i[t]=""),i}function Wi(e,n){e.setAttrib("scope",n.scope),e.setAttrib("class",n["class"]),e.setStyle("width",yi(n.width)),e.setStyle("height",yi(n.height))}function _i(e,n){e.setStyle("background-color",n.backgroundcolor),e.setStyle("border-color",n.bordercolor),e.setStyle("border-style",n.borderstyle),e.setStyle("border-width",yi(n.borderwidth))}function Li(e,n,t){var r=e.dom,o=t.celltype&&n[0].nodeName.toLowerCase()!==t.celltype?r.rename(n[0],t.celltype):n[0],i=qc.normal(r,o);Wi(i,t),Ri(e)&&_i(i,t),Nc(e,o),kc(e,o),t.halign&&Ac(e,o,t.halign),t.valign&&Ec(e,o,t.valign)}function ji(t,e,r){var o=t.dom;Dc.each(e,function(e){r.celltype&&e.nodeName.toLowerCase()!==r.celltype&&(e=o.rename(e,r.celltype));var n=qc.ifTruthy(o,e);Wi(n,r),Ri(t)&&_i(n,r),r.halign&&Ac(t,e,r.halign),r.valign&&Ec(t,e,r.valign)})}function zi(e,n,t){var r=t.getData();t.close(),e.undoManager.transact(function(){(1===n.length?Li:ji)(e,n,r),e.focus()})}function Hi(t,e,r,n){var o=t.dom,i=n.getData();n.close();var u=1===e.length?qc.normal:qc.ifTruthy;t.undoManager.transact(function(){Dc.each(e,function(e){i.type!==e.parentNode.nodeName.toLowerCase()&&function(e,n,t){var r=e.getParent(n,"table"),o=n.parentNode,i=e.select(t,r)[0];i||(i=e.create(t),r.firstChild?"CAPTION"===r.firstChild.nodeName?e.insertAfter(i,r.firstChild):r.insertBefore(i,r.firstChild):r.appendChild(i)),i.appendChild(n),o.hasChildNodes()||e.remove(o)}(t.dom,e,i.type);var n=u(o,e);n.setAttrib("scope",i.scope),n.setAttrib("class",i["class"]),n.setStyle("height",yi(i.height)),Ti(t)&&function(e,n){e.setStyle("background-color",n.backgroundcolor),e.setStyle("border-color",n.bordercolor),e.setStyle("border-style",n.borderstyle)}(n,i),i.align!==r.align&&(Nc(t,e),Ac(t,e,i.align))}),t.focus()})}function Fi(e,n,t,r,o){void 0===o&&(o=Qc);var i=on.fromTag("table");re(i,o.styles),q(i,o.attributes);var u=on.fromTag("tbody");Mn(i,u);for(var c=[],a=0;a<e;a++){for(var l=on.fromTag("tr"),f=0;f<n;f++){var s=a<t||f<r?on.fromTag("th"):on.fromTag("td");f<r&&U(s,"scope","row"),a<t&&U(s,"scope","col"),Mn(s,on.fromTag("br")),o.percentages&&te(s,"width",100/n+"%"),Mn(l,s)}c.push(l)}return Ae(u,c),i}function Ui(e,n){e.selection.select(n.dom(),!0),e.selection.collapse(!0)}function qi(t,r,e){var o,i=t.dom,u=e.getData();e.close(),""===u["class"]&&delete u["class"],t.undoManager.transact(function(){if(!r){var e=parseInt(u.cols,10)||1,n=parseInt(u.rows,10)||1;r=Zc(t,e,n)}!function(e,n,t){var r=e.dom,o={},i={};if(o["class"]=t["class"],i.height=yi(t.height),r.getAttrib(n,"width")&&!Di(e)?o.width=function(e){return e?e.replace(/px$/,""):""}(t.width):i.width=yi(t.width),Di(e)?(i["border-width"]=yi(t.border),i["border-spacing"]=yi(t.cellspacing)):(o.border=t.border,o.cellpadding=t.cellpadding,o.cellspacing=t.cellspacing),Di(e)&&n.children)for(var u=0;u<n.children.length;u++)na(r,n.children[u],{"border-width":yi(t.border),padding:yi(t.cellpadding)}),Oi(e)&&na(r,n.children[u],{"border-color":t.bordercolor});Oi(e)&&(i["background-color"]=t.backgroundcolor,i["border-color"]=t.bordercolor,i["border-style"]=t.borderstyle),o.style=r.serializeStyle($c(xi(e),i)),r.setAttribs(n,$c(Si(e),o))}(t,r,u),(o=i.select("caption",r)[0])&&!u.caption&&i.remove(o),!o&&u.caption&&((o=i.create("caption")).innerHTML=Jc.ie?"\xa0":'<br data-mce-bogus="1"/>',r.insertBefore(o,r.firstChild)),""===u.align?Nc(t,r):Ac(t,r,u.align),t.focus(),t.addVisual()})}function Vi(n){return function(e){return Me.from(e.dom.getParent(e.selection.getStart(),n)).map(on.fromDom)}}function Gi(e){function n(){e.stopPropagation()}function t(){e.preventDefault()}var r=on.fromDom(e.target),o=O(t,n);return function(e,n,t,r,o,i,u){return{target:D(e),x:D(n),y:D(t),stop:r,prevent:o,kill:i,raw:D(u)}}(r,e.clientX,e.clientY,n,t,o,e)}function Yi(e,n,t,r,o){var i=function(n,t){return function(e){n(e)&&t(Gi(e))}}(t,r);return e.dom().addEventListener(n,i,o),{unbind:b(sa,e,n,i,o)}}function Ki(e,n,t){return function(e,n,t,r){return Yi(e,n,t,r,!1)}(e,n,da,t)}var Xi,$i=function(e){var n=ft(e);return mt.generate(n).grid()},Ji=function(o,e){function n(e,n){0<e.length?function(e,n){var t=Qn(o,n).getOrThunk(function(){var e=on.fromTag(n,he(o).dom());return Mn(o,e),e});Ee(t);var r=g(e,function(e){e.isNew()&&i.push(e.element());var n=e.element();return Ee(n),p(e.cells(),function(e){e.isNew()&&u.push(e.element()),wo(e.element(),"colspan",e.colspan(),1),wo(e.element(),"rowspan",e.rowspan(),1),Mn(n,e.element())}),n});Ae(t,r)}(e,n):function(e){Qn(o,e).each(Wn)}(n)}var i=[],u=[],t=[],r=[],c=[];return p(e,function(e){switch(e.section()){case"thead":t.push(e);break;case"tbody":r.push(e);break;case"tfoot":c.push(e)}}),n(t,"thead"),n(r,"tbody"),n(c,"tfoot"),{newRows:D(i),newCells:D(u)}},Qi=function(e){return g(e,function(e){var t=Rt(e.element());return p(e.cells(),function(e){var n=Tt(e.element());wo(n,"colspan",e.colspan(),1),wo(n,"rowspan",e.rowspan(),1),Mn(t,n)}),t})},Zi=function(e,n,t){var r=e();return y(r,n).orThunk(function(){return Me.from(r[0]).orThunk(t)}).map(function(e){return e.element()})},eu=function(t){var e=t.grid(),n=Do(0,e.columns()),r=Do(0,e.rows());return g(n,function(n){return Zi(function(){return x(r,function(e){return mt.getAt(t,e,n).filter(function(e){return e.column()===n}).fold(D([]),function(e){return[e]})})},function(e){return 1===e.colspan()},function(){return mt.getAt(t,0,n)})})},nu=function(t){var e=t.grid(),n=Do(0,e.rows()),r=Do(0,e.columns());return g(n,function(n){return Zi(function(){return x(r,function(e){return mt.getAt(t,n,e).filter(function(e){return e.row()===n}).fold(D([]),function(e){return[e]})})},function(e){return 1===e.rowspan()},function(){return mt.getAt(t,n,0)})})},tu={resolve:Eo("ephox-snooker").resolve},ru=function(e,n,t,r,o){var i=on.fromTag("div");return re(i,{position:"absolute",left:n-r/2+"px",top:t+"px",height:o+"px",width:r+"px"}),q(i,{"data-column":e,role:"presentation"}),i},ou=function(e,n,t,r,o){var i=on.fromTag("div");return re(i,{position:"absolute",left:n+"px",top:t-o/2+"px",height:o+"px",width:r+"px"}),q(i,{"data-row":e,role:"presentation"}),i},iu=tu.resolve("resizer-bar"),uu=tu.resolve("resizer-rows"),cu=tu.resolve("resizer-cols"),au=function(e,n,t,r){No(e);var o=ft(n),i=mt.generate(o),u=nu(i),c=eu(i);Io(e,n,u,c,t,r)},lu=function(e){Bo(e,function(e){te(e,"display","none")})},fu=function(e){Bo(e,function(e){te(e,"display","block")})},su=No,du=function(e){return Oo(e,uu)},mu=function(e){return Oo(e,cu)},gu=function(e,n){return Vn(n,e.section())},pu={addCell:function(e,n,t){var r=e.cells(),o=r.slice(0,n),i=r.slice(n),u=o.concat([t]).concat(i);return gu(e,u)},setCells:gu,mutateCell:function(e,n,t){e.cells()[n]=t},getCell:Po,getCellElement:function(e,n){return Po(e,n).element()},mapCells:function(e,n){var t=e.cells(),r=g(t,n);return Vn(r,e.section())},cellLength:function(e){return e.cells().length}},hu=function(e,n,t,r){var o=function(e,n){return e[n]}(e,n).cells().slice(t),i=Mo(o,r),u=function(e,n){return g(e,function(e){return pu.getCell(e,n)})}(e,t).slice(n),c=Mo(u,r);return{colspan:D(i),rowspan:D(c)}},vu=function(o,i){var u=g(o,function(e,n){return g(e.cells(),function(e,n){return!1})});return g(o,function(e,r){var n=x(e.cells(),function(e,n){if(!1!==u[r][n])return[];var t=hu(o,r,n,i);return function(e,n,t,r){for(var o=e;o<e+t;o++)for(var i=n;i<n+r;i++)u[o][i]=!0}(r,n,t.rowspan(),t.colspan()),[zn(e.element(),t.rowspan(),t.colspan(),e.isNew())]});return Gn(n,e.section())})},bu=function(e,n,t){for(var r=[],o=0;o<e.grid().rows();o++){for(var i=[],u=0;u<e.grid().columns();u++){var c=mt.getAt(e,o,u).map(function(e){return Un(e.element(),t)}).getOrThunk(function(){return Un(n.gap(),!0)});i.push(c)}var a=Vn(i,e.all()[o].section());r.push(a)}return r},wu=function(t){return{is:function(e){return t===e},isValue:i,isError:s,getOr:D(t),getOrThunk:D(t),getOrDie:D(t),or:function(e){return wu(t)},orThunk:function(e){return wu(t)},fold:function(e,n){return n(t)},map:function(e){return wu(e(t))},mapError:function(e){return wu(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOption:function(){return Me.some(t)}}},yu=function(t){return{is:s,isValue:s,isError:i,getOr:o,getOrThunk:function(e){return e()},getOrDie:function(){return function(e){return function(){throw new Error(e)}}(String(t))()},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,n){return e(t)},map:function(e){return yu(t)},mapError:function(e){return yu(e(t))},each:T,bind:function(e){return yu(t)},exists:s,forall:i,toOption:Me.none}},Cu={value:wu,error:yu,fromOption:function(e,n){return e.fold(function(){return yu(n)},wu)}},Su=function(e,n,t){if(e.row()>=n.length||e.column()>pu.cellLength(n[0]))return Cu.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=n.slice(e.row()),o=r[0].cells().slice(e.column()),i=pu.cellLength(t[0]),u=t.length;return Cu.value({rowDelta:D(r.length-u),colDelta:D(o.length-i)})},xu=function(e,n){var t=pu.cellLength(e[0]),r=pu.cellLength(n[0]);return{rowDelta:D(0),colDelta:D(t-r)}},Ru=function(e,n,t){var r=n.colDelta()<0?Vo:o;return(n.rowDelta()<0?qo:o)(r(e,Math.abs(n.colDelta()),t),Math.abs(n.rowDelta()),t)},Tu=function(e,n,t,r){if(0===e.length)return e;for(var o=n.startRow();o<=n.finishRow();o++)for(var i=n.startCol();i<=n.finishCol();i++)pu.mutateCell(e[o],i,Un(r(),!1));return e},Ou=function(e,n,t,r){for(var o=!0,i=0;i<e.length;i++)for(var u=0;u<pu.cellLength(e[0]);u++){var c=t(pu.getCellElement(e[i],u),n);!0===c&&!1===o?pu.mutateCell(e[i],u,Un(r(),!0)):!0===c&&(o=!1)}return e},Du=function(i,t,u,c){if(0<t&&t<i.length){var e=function(e,t){return w(e,function(e,n){return m(e,function(e){return t(e.element(),n.element())})?e:e.concat([n])},[])}(i[t-1].cells(),u);p(e,function(r){for(var o=Me.none(),e=function(t){for(var e=function(n){var e=i[t].cells()[n];u(e.element(),r.element())&&(o.isNone()&&(o=Me.some(c())),o.each(function(e){pu.mutateCell(i[t],n,Un(e,!0))}))},n=0;n<pu.cellLength(i[0]);n++)e(n)},n=t;n<i.length;n++)e(n)})}return i},Au=function(t,r,o,i,u){return Su(t,r,o).map(function(e){var n=Ru(r,e,i);return function(e,n,t,r,o){for(var i,u,c,a,l,f=e.row(),s=e.column(),d=f+t.length,m=s+pu.cellLength(t[0]),g=f;g<d;g++)for(var p=s;p<m;p++){i=n,u=g,c=p,l=a=void 0,a=b(o,pu.getCell(i[u],c).element()),l=i[u],1<i.length&&1<pu.cellLength(l)&&(0<c&&a(pu.getCellElement(l,c-1))||c<l.cells().length-1&&a(pu.getCellElement(l,c+1))||0<u&&a(pu.getCellElement(i[u-1],c))||u<i.length-1&&a(pu.getCellElement(i[u+1],c)))&&Ou(n,pu.getCellElement(n[g],p),o,r.cell);var h=pu.getCellElement(t[g-f],p-s),v=r.replace(h);pu.mutateCell(n[g],p,Un(v,!0))}return n}(t,n,o,i,u)})},Eu=function(e,n,t,r,o){Du(n,e,o,r.cell);var i=xu(t,n),u=Ru(t,i,r),c=xu(n,u),a=Ru(n,c,r);return a.slice(0,e).concat(u).concat(a.slice(e,a.length))},Nu=function(t,r,e,o,i){var n=t.slice(0,r),u=t.slice(r),c=pu.mapCells(t[e],function(e,n){return 0<r&&r<t.length&&o(pu.getCellElement(t[r-1],n),pu.getCellElement(t[r],n))?pu.getCell(t[r],n):Un(i(e.element(),o),!0)});return n.concat([c]).concat(u)},ku=function(e,t,r,o,i){return g(e,function(e){var n=0<t&&t<pu.cellLength(e)&&o(pu.getCellElement(e,t-1),pu.getCellElement(e,t))?pu.getCell(e,t):Un(i(pu.getCellElement(e,r),o),!0);return pu.addCell(e,t,n)})},Iu=function(e,r,o,i,u){var c=o+1;return g(e,function(e,n){var t=n===r?Un(u(pu.getCellElement(e,o),i),!0):pu.getCell(e,o);return pu.addCell(e,c,t)})},Bu=function(e,n,t,r,o){var i=n+1,u=e.slice(0,i),c=e.slice(i),a=pu.mapCells(e[n],function(e,n){return n===t?Un(o(e.element(),r),!0):e});return u.concat([a]).concat(c)},Pu=function(e,n,t){return e.slice(0,n).concat(e.slice(t+1))},Mu=function(e,t,r){var n=g(e,function(e){var n=e.cells().slice(0,t).concat(e.cells().slice(r+1));return Vn(n,e.section())});return h(n,function(e){return 0<e.cells().length})},Wu=function(t,r,o,e){var n=x(t,function(e,n){return Yo(t,n,r,o)||Ko(e,r,o)?[]:[pu.getCell(e,r)]});return Go(t,n,o,e)},_u=function(t,r,o,e){var i=t[r],n=x(i.cells(),function(e,n){return Yo(t,r,n,o)||Ko(i,n,o)?[]:[e]});return Go(t,n,o,e)},Lu=Sr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),ju=fn({},Lu),zu=function(e,n,i,u){function c(e){return g(e,D(0))}function r(e,n){if(0<=i){var t=Math.max(u.minCellWidth(),a[n]-i);return c(a.slice(0,e)).concat([i,t-a[n]]).concat(c(a.slice(n+1)))}var r=Math.max(u.minCellWidth(),a[e]+i),o=a[e]-r;return c(a.slice(0,e)).concat([r-a[e],o]).concat(c(a.slice(n+1)))}var a=e.slice(0),t=function(e,n){return 0===e.length?ju.none():1===e.length?ju.only(0):0===n?ju.left(0,1):n===e.length-1?ju.right(n-1,n):0<n&&n<e.length-1?ju.middle(n-1,n,n+1):ju.none()}(e,n),o=D(c(a)),l=r;return t.fold(o,function(e){return u.singleColumnWidth(a[e],i)},l,function(e,n,t){return r(n,t)},function(e,n){if(0<=i)return c(a.slice(0,n)).concat([i]);var t=Math.max(u.minCellWidth(),a[n]+i);return c(a.slice(0,n)).concat([t-a[n]])})},Hu={hasColspan:function(e){return Xo(e,"colspan")},hasRowspan:function(e){return Xo(e,"rowspan")},minWidth:D(10),minHeight:D(10),getInt:function(e,n){return parseInt(oe(e,n),10)}},Fu={getRawWidths:function(e,n,t){return Zo(e,n,Jo,ei,t)},getPixelWidths:function(e,n,t){return Zo(e,n,uo.getPixelWidth,function(e){return e.getOrThunk(t.minCellWidth)},t)},getPercentageWidths:function(e,n,t){return Zo(e,n,uo.getPercentageWidth,function(e){return e.fold(function(){return t.minCellWidth()},function(e){return e/t.pixelWidth()*100})},t)},getPixelHeights:function(e,n){return ni(e,n,uo.getHeight,function(e){return e.getOrThunk(Hu.minHeight)})},getRawHeights:function(e,n){return ni(e,n,Qo,ei)}},Uu=function(e,t){var n=mt.justCells(e);return g(n,function(e){var n=ti(e.column(),e.column()+e.colspan(),t);return{element:e.element,width:D(n),colspan:e.colspan}})},qu=function(e,t){var n=mt.justCells(e);return g(n,function(e){var n=ti(e.row(),e.row()+e.rowspan(),t);return{element:e.element,height:D(n),rowspan:e.rowspan}})},Vu=function(e,t){return g(e.all(),function(e,n){return{element:e.element,height:D(t[n])}})},Gu=function(n){return uo.getRawWidth(n).fold(function(){var e=Pr(n);return ri(e)},function(e){return oi(n,e)})},Yu=function(e,n,t,r){var o=Gu(e),i=o.getCellDelta(n),u=ui(e),c=o.getWidths(u,r,o),a=zu(c,t,i,o),l=g(a,function(e,n){return e+c[n]}),f=Uu(u,l);p(f,function(e){o.setElementWidth(e.element(),e.width())}),t===u.grid().columns()-1&&o.setTableWidth(e,l,i)},Ku=function(e,t,r,n){var o=ui(e),i=Fu.getPixelHeights(o,n),u=g(i,function(e,n){return r===n?Math.max(t+e,Hu.minHeight()):e}),c=qu(o,u),a=Vu(o,u);p(a,function(e){uo.setHeight(e.element(),e.height())}),p(c,function(e){uo.setHeight(e.element(),e.height())});var l=function(e){return v(e,function(e,n){return e+n},0)}(u);uo.setHeight(e,l)},Xu=function(e,n,t){var r=Gu(e),o=ii(n),i=r.getWidths(o,t,r),u=Uu(o,i);p(u,function(e){r.setElementWidth(e.element(),e.width())}),0<u.length&&r.setTableWidth(e,i,r.getCellDelta(0))},$u=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return _("required",o),L(o),function(n){var t=Ve(n);A(o,function(e){return l(t,e)})||M(o,t),r(o,t);var e=h(o,function(e){return!i.validate(n[e],e)});return 0<e.length&&function(e,n){throw new Error("All values need to be of type: "+n+". Keys ("+P(e).join(", ")+") were not.")}(e,i.label),n}},Ju=ai(["cell","row","replace","gap"]),Qu=function(n,t){void 0===t&&(t=li),Ju(n);function r(e){return function(e){return n.cell(e)}(t(e))}function o(e){var n=r(e);return i.get().isNone()&&i.set(Me.some(n)),u=Me.some({item:e,replacement:n}),n}var i=R(Me.none()),u=Me.none();return{getOrInit:function(n,t){return u.fold(function(){return o(n)},function(e){return t(n,e.item)?e.replacement:o(n)})},cursor:i.get}},Zu=function(c,a){return function(r){var o=R(Me.none());Ju(r);function i(e){var n={scope:c},t=r.replace(e,a,n);return u.push({item:e,sub:t}),o.get().isNone()&&o.set(Me.some(t)),t}var u=[];return{replaceOrInit:function(n,t){return function(n,t){return y(u,function(e){return t(e.item,n)})}(n,t).fold(function(){return i(n)},function(e){return t(n,e.item)?e.sub:i(n)})},cursor:o.get}}},ec=function(t){Ju(t);var e=R(Me.none());return{combine:function(n){return e.get().isNone()&&e.set(Me.some(n)),function(){var e=t.cell({element:D(n),colspan:D(1),rowspan:D(1)});return ue(e,"width"),ue(n,"width"),e}},cursor:e.get}},nc=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],tc=fi,rc=function(e,n){var t=e.property().name(n);return l(["ol","ul"],t)},oc=si,ic=$t(),uc=function(e){return tc(ic,e)},cc=function(e){return rc(ic,e)},ac=function(e){return oc(ic,e)},lc=function(e){function o(e){return"br"===en(e)}function t(r){return St(r).bind(function(n){var t=function(e){return ye(e).map(function(e){return!!uc(e)||!!ac(e)&&"img"!==en(e)}).getOr(!1)}(n);return ve(n).map(function(e){return!0===t||function(e){return"li"===en(e)||$n(e,cc).isSome()}(e)||o(n)||uc(e)&&!In(r,e)?[]:[on.fromTag("br")]})}).getOr([])}var n,r=0===(n=x(e,function(e){var n=Ce(e);return function(e){return A(e,function(e){return o(e)||tn(e)&&0===ht(e).trim().length})}(n)?[]:n.concat(t(e))})).length?[on.fromTag("br")]:n;Ee(e[0]),Ae(e[0],r)},fc=B("grid","cursor"),sc=function(e,n,t){return Me.from(e[n]).bind(function(e){return Me.from(e.cells()[t]).bind(function(e){return Me.from(e.element())})})},dc=Xu,mc={insertRowBefore:jo(function(e,n,t,r){var o=n.row(),i=n.row(),u=Nu(e,i,o,t,r.getOrInit);return gi(u,i,n.column())},zo,T,T,Qu),insertRowsBefore:jo(function(e,n,t,r){var o=n[0].row(),i=n[0].row(),u=pi(n),c=w(u,function(e,n){return Nu(e,i,o,t,r.getOrInit)},e);return gi(c,i,n[0].column())},Fo,T,T,Qu),insertRowAfter:jo(function(e,n,t,r){var o=n.row(),i=n.row()+n.rowspan(),u=Nu(e,i,o,t,r.getOrInit);return gi(u,i,n.column())},zo,T,T,Qu),insertRowsAfter:jo(function(e,n,t,r){var o=pi(n),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),c=w(o,function(e,n){return Nu(e,u,i,t,r.getOrInit)},e);return gi(c,u,n[0].column())},Fo,T,T,Qu),insertColumnBefore:jo(function(e,n,t,r){var o=n.column(),i=n.column(),u=ku(e,i,o,t,r.getOrInit);return gi(u,n.row(),i)},zo,dc,T,Qu),insertColumnsBefore:jo(function(e,n,t,r){var o=hi(n),i=o[0].column(),u=o[0].column(),c=w(o,function(e,n){return ku(e,u,i,t,r.getOrInit)},e);return gi(c,n[0].row(),u)},Fo,dc,T,Qu),insertColumnAfter:jo(function(e,n,t,r){var o=n.column(),i=n.column()+n.colspan(),u=ku(e,i,o,t,r.getOrInit);return gi(u,n.row(),i)},zo,dc,T,Qu),insertColumnsAfter:jo(function(e,n,t,r){var o=n[n.length-1].column(),i=n[n.length-1].column()+n[n.length-1].colspan(),u=hi(n),c=w(u,function(e,n){return ku(e,i,o,t,r.getOrInit)},e);return gi(c,n[0].row(),i)},Fo,dc,T,Qu),splitCellIntoColumns:jo(function(e,n,t,r){var o=Iu(e,n.row(),n.column(),t,r.getOrInit);return gi(o,n.row(),n.column())},zo,dc,T,Qu),splitCellIntoRows:jo(function(e,n,t,r){var o=Bu(e,n.row(),n.column(),t,r.getOrInit);return gi(o,n.row(),n.column())},zo,T,T,Qu),eraseColumns:jo(function(e,n,t,r){var o=hi(n),i=Mu(e,o[0].column(),o[o.length-1].column()),u=mi(i,n[0].row(),n[0].column());return fc(i,u)},Fo,dc,di,Qu),eraseRows:jo(function(e,n,t,r){var o=pi(n),i=Pu(e,o[0].row(),o[o.length-1].row()),u=mi(i,n[0].row(),n[0].column());return fc(i,u)},Fo,T,di,Qu),makeColumnHeader:jo(function(e,n,t,r){var o=Wu(e,n.column(),t,r.replaceOrInit);return gi(o,n.row(),n.column())},zo,T,T,Zu("row","th")),unmakeColumnHeader:jo(function(e,n,t,r){var o=Wu(e,n.column(),t,r.replaceOrInit);return gi(o,n.row(),n.column())},zo,T,T,Zu(null,"td")),makeRowHeader:jo(function(e,n,t,r){var o=_u(e,n.row(),t,r.replaceOrInit);return gi(o,n.row(),n.column())},zo,T,T,Zu("col","th")),unmakeRowHeader:jo(function(e,n,t,r){var o=_u(e,n.row(),t,r.replaceOrInit);return gi(o,n.row(),n.column())},zo,T,T,Zu(null,"td")),mergeCells:jo(function(e,n,t,r){var o=n.cells();lc(o);var i=Tu(e,n.bounds(),t,D(o[0]));return fc(i,Me.from(o[0]))},function(e,n){return n.mergable()},T,T,ec),unmergeCells:jo(function(e,n,t,r){var o=v(n,function(e,n){return Ou(e,n,t,r.combine(n))},e);return fc(o,Me.from(n[0]))},function(e,n){return n.unmergable()},dc,T,ec),pasteCells:jo(function(e,t,n,r){var o,i,u,c,a=(o=t.clipboard(),i=t.generators(),u=ft(o),c=mt.generate(u),bu(c,i,!0)),l=Ln(t.row(),t.column());return Au(l,e,a,t.generators(),n).fold(function(){return fc(e,Me.some(t.element()))},function(e){var n=mi(e,t.row(),t.column());return fc(e,n)})},function(n,t){return lt.cell(t.element()).bind(function(e){return Lo(n,e).map(function(e){return fn(fn({},e),{generators:t.generators,clipboard:t.clipboard})})})},dc,T,Qu),pasteRowsBefore:jo(function(e,n,t,r){var o=e[n.cells[0].row()],i=n.cells[0].row(),u=vi(n.clipboard(),n.generators(),o),c=Eu(i,e,u,n.generators(),t),a=mi(c,n.cells[0].row(),n.cells[0].column());return fc(c,a)},Ho,T,T,Qu),pasteRowsAfter:jo(function(e,n,t,r){var o=e[n.cells[0].row()],i=n.cells[n.cells.length-1].row()+n.cells[n.cells.length-1].rowspan(),u=vi(n.clipboard(),n.generators(),o),c=Eu(i,e,u,n.generators(),t),a=mi(c,n.cells[0].row(),n.cells[0].column());return fc(c,a)},Ho,T,T,Qu)},gc=function(e){return on.fromDom(e.getBody())},pc=function(n){return function(e){return In(e,gc(n))}},hc={isRtl:D(!1)},vc={isRtl:D(!0)},bc={directionAt:function(e){return"rtl"===function(e){return"rtl"===oe(e,"direction")?"rtl":"ltr"}(e)?vc:hc}},wc={"border-collapse":"collapse",width:"100%"},yc={border:"1"},Cc=function(e){return e.getParam("table_tab_navigation",!0,"boolean")},Sc=function(e){var n=e.getParam("table_clone_elements");return _e(n)?Me.some(n.split(/[ ,]/)):Array.isArray(n)?Me.some(n):Me.none()},xc=function(e,n,t,r,o){e.fire("TableSelectionChange",{cells:n,start:t,finish:r,otherCells:o})},Rc=function(e){e.fire("TableSelectionClear")},Tc=function(f,e){function t(e){return"table"===en(gc(e))}function n(u,c,a,l){return function(e,n){Ci(e);var t=l(),r=on.fromDom(f.getDoc()),o=ho(bc.directionAt),i=Wt.cellOperations(a,r,s);return c(e)?u(t,e,n,i,o).bind(function(e){return p(e.newRows(),function(e){Ni(f,e.dom())}),p(e.newCells(),function(e){ki(f,e.dom())}),e.cursor().map(function(e){var n=f.dom.createRng();return n.setStart(e.dom(),0),n.setEnd(e.dom(),0),n})}):Me.none()}}var s=Sc(f);return{deleteRow:n(mc.eraseRows,function(e){var n=$i(e);return!1===t(f)||1<n.rows()},T,e),deleteColumn:n(mc.eraseColumns,function(e){var n=$i(e);return!1===t(f)||1<n.columns()},T,e),insertRowsBefore:n(mc.insertRowsBefore,i,T,e),insertRowsAfter:n(mc.insertRowsAfter,i,T,e),insertColumnsBefore:n(mc.insertColumnsBefore,i,co,e),insertColumnsAfter:n(mc.insertColumnsAfter,i,co,e),mergeCells:n(mc.mergeCells,i,T,e),unmergeCells:n(mc.unmergeCells,i,T,e),pasteRowsBefore:n(mc.pasteRowsBefore,i,T,e),pasteRowsAfter:n(mc.pasteRowsAfter,i,T,e),pasteCells:n(mc.pasteCells,i,T,e)}},Oc=function(e,n,r){var t=ft(e),o=mt.generate(t);return Fo(o,n).map(function(e){var n=bu(o,r,!1).slice(e[0].row(),e[e.length-1].row()+e[e.length-1].rowspan()),t=_o(n,r);return Qi(t)})},Dc=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ac=function(e,n,t){t&&e.formatter.apply("align"+t,{},n)},Ec=function(e,n,t){t&&e.formatter.apply("valign"+t,{},n)},Nc=function(n,t){Dc.each("left center right".split(" "),function(e){n.formatter.remove("align"+e,{},t)})},kc=function(n,t){Dc.each("top middle bottom".split(" "),function(e){n.formatter.remove("valign"+e,{},t)})},Ic=function(o,e,i){var n;return n=function(e,n){for(var t=0;t<n.length;t++){var r=o.getStyle(n[t],i);if(void 0===e&&(e=r),e!==r)return""}return e}(n,o.select("td,th",e))},Bc=b(Mi,"left center right"),Pc=b(Mi,"top middle bottom"),Mc=function(e,r,n){var o=function(e,t){return t=t||[],Dc.each(e,function(e){var n={text:e.text||e.title};e.menu?n.menu=o(e.menu):(n.value=e.value,r&&r(n)),t.push(n)}),t};return o(e,n||[])},Wc=function(e){var o=e[0],n=e.slice(1),t=Ve(o);return p(n,function(e){p(t,function(r){N(e,function(e,n){var t=o[r];""!==t&&r===n&&t!==e&&(o[r]="")})})}),o},_c=function(e){var n=[{name:"borderstyle",type:"selectbox",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===e?[{name:"borderwidth",type:"input",label:"Border width"}].concat(n):n}},Lc=function(e,n,t){var r,o,i,u=e.dom;return fn(fn({width:u.getStyle(n,"width")||u.getAttrib(n,"width"),height:u.getStyle(n,"height")||u.getAttrib(n,"height"),cellspacing:u.getStyle(n,"border-spacing")||u.getAttrib(n,"cellspacing"),cellpadding:u.getAttrib(n,"cellpadding")||Ic(e.dom,n,"padding"),border:(r=u,o=n,i=ie(on.fromDom(o),"border-width"),Di(e)&&i.isSome()?i.getOr(""):r.getAttrib(o,"border")||Ic(e.dom,o,"border-width")||Ic(e.dom,o,"border")),caption:!!u.select("caption",n)[0],"class":u.getAttrib(n,"class","")},Bc("align","align",e,n)),t?Pi(u,n):{})},jc=function(e,n,t){var r=e.dom;return fn(fn({height:r.getStyle(n,"height")||r.getAttrib(n,"height"),scope:r.getAttrib(n,"scope"),"class":r.getAttrib(n,"class",""),align:"",type:n.parentNode.nodeName.toLowerCase()},Bc("align","align",e,n)),t?Pi(r,n):{})},zc=function(e,n,t){var r=e.dom;return fn(fn(fn({width:r.getStyle(n,"width")||r.getAttrib(n,"width"),height:r.getStyle(n,"height")||r.getAttrib(n,"height"),scope:r.getAttrib(n,"scope"),celltype:n.nodeName.toLowerCase(),"class":r.getAttrib(n,"class","")},Bc("align","halign",e,n)),Pc("valign","valign",e,n)),t?Pi(r,n):{})},Hc=function(e,n){var t,r,o,i,u=xi(e),c=Si(e),a=e.dom,l=n?(t=a,r=I(u,"border-style").getOr(""),o=I(u,"border-color").getOr(""),i=I(u,"background-color").getOr(""),{borderstyle:r,bordercolor:f(o),backgroundcolor:f(i)}):{};function f(e){return J(e,"rgb")?t.toHex(e):e}var s,d,m;return fn(fn(fn(fn(fn(fn({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,"class":"",align:"",border:""}),u),c),l),(m=u["border-width"],Di(e)&&m?{border:m}:I(c,"border").fold(function(){return{}},function(e){return{border:e}}))),(s=I(u,"border-spacing").or(I(c,"cellspacing")).fold(function(){return{}},function(e){return{cellspacing:e}}),d=I(u,"border-padding").or(I(c,"cellpadding")).fold(function(){return{}},function(e){return{cellpadding:e}}),fn(fn({},s),d)))},Fc=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"selectbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"selectbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"selectbox",label:"H Align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"selectbox",label:"V Align",items:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}],Uc=function(e){return function(n){var e=function(e){return e.getParam("table_cell_class_list",[],"array")}(n),t=Mc(e,function(e){e.value&&(e.textStyle=function(){return n.formatter.getCssText({block:"tr",classes:[e.value]})})});return 0<e.length?Me.some({name:"class",type:"selectbox",label:"Class",items:t}):Me.none()}(e).fold(function(){return Fc},function(e){return Fc.concat(e)})},qc={normal:function(t,r){return{setAttrib:function(e,n){t.setAttrib(r,e,n)},setStyle:function(e,n){t.setStyle(r,e,n)}}},ifTruthy:function(t,r){return{setAttrib:function(e,n){n&&t.setAttrib(r,e,n)},setStyle:function(e,n){n&&t.setStyle(r,e,n)}}}},Vc=function(n){var e,t=[];if(t=n.dom.select("td[data-mce-selected],th[data-mce-selected]"),e=n.dom.getParent(n.selection.getStart(),"td,th"),!t.length&&e&&t.push(e),e=e||t[0]){var r=Dc.map(t,function(e){return zc(n,e,Ri(n))}),o=Wc(r),i={type:"tabpanel",tabs:[{title:"General",name:"general",items:Uc(n)},_c("cell")]},u={type:"panel",items:[{type:"grid",columns:2,items:Uc(n)}]};n.windowManager.open({title:"Cell Properties",size:"normal",body:Ri(n)?i:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:b(zi,n,t)})}},Gc=[{type:"selectbox",name:"type",label:"Row type",items:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"selectbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Yc=function(e){return function(n){var e=function(e){return e.getParam("table_row_class_list",[],"array")}(n),t=Mc(e,function(e){e.value&&(e.textStyle=function(){return n.formatter.getCssText({block:"tr",classes:[e.value]})})});return 0<e.length?Me.some({name:"class",type:"selectbox",label:"Class",items:t}):Me.none()}(e).fold(function(){return Gc},function(e){return Gc.concat(e)})},Kc=function(n){var e,t,r=n.dom,o=[];if((e=r.getParent(n.selection.getStart(),"table"))&&(t=r.getParent(n.selection.getStart(),"td,th"),Dc.each(e.rows,function(n){Dc.each(n.cells,function(e){if((r.getAttrib(e,"data-mce-selected")||e===t)&&o.indexOf(n)<0)return o.push(n),!1})}),o[0])){var i=Dc.map(o,function(e){return jc(n,e,Ti(n))}),u=Wc(i),c={type:"tabpanel",tabs:[{title:"General",name:"general",items:Yc(n)},_c("row")]},a={type:"panel",items:[{type:"grid",columns:2,items:Yc(n)}]};n.windowManager.open({title:"Row Properties",size:"normal",body:Ti(n)?c:a,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:u,onSubmit:b(Hi,n,o,u)})}},Xc=Object.prototype.hasOwnProperty,$c=(Xi=function(e,n){return n},function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Xc.call(o,i)&&(t[i]=Xi(t[i],o[i]))}return t}),Jc=tinymce.util.Tools.resolve("tinymce.Env"),Qc={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},percentages:!0},Zc=function(n,e,t){var r=xi(n),o={styles:r,attributes:Si(n),percentages:function(e){return _e(e)&&-1!==e.indexOf("%")}(r.width)&&!Ei(n)},i=Fi(t,e,0,0,o);U(i,"data-mce-id","__mce");var u=function(e){var n=on.fromTag("div"),t=on.fromDom(e.dom().cloneNode(!0));return Mn(n,t),function(e){return e.dom().innerHTML}(n)}(i);return n.insertContent(u),Zn(gc(n),'table[data-mce-id="__mce"]').map(function(e){return Ei(n)&&te(e,"width",oe(e,"width")),Y(e,"data-mce-id"),function(n,e){p(Be(e,"tr"),function(e){Ni(n,e.dom()),p(Be(e,"th,td"),function(e){ki(n,e.dom())})})}(n,e),function(e,n){Zn(n,"td,th").each(b(Ui,e))}(n,e),e.dom()}).getOr(null)},ea=function(n,e,t){var r=t?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=function(e){return e.getParam("table_appearance_options",!0,"boolean")}(n)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],i=e?[{type:"selectbox",name:"class",label:"Class",items:Mc(Ai(n),function(e){e.value&&(e.textStyle=function(){return n.formatter.getCssText({block:"table",classes:[e.value]})})})}]:[];return r.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(o).concat([{type:"selectbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(i)},na=function(e,n,t,r){if("TD"===n.tagName||"TH"===n.tagName)_e(t)?e.setStyle(n,t,r):e.setStyle(n,t);else if(n.children)for(var o=0;o<n.children.length;o++)na(e,n.children[o],t,r)},ta=function(e,n){var t,r=e.dom,o=Hc(e,Oi(e));!1===n?(t=r.getParent(e.selection.getStart(),"table"))?o=Lc(e,t,Oi(e)):Oi(e)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""):(o.cols="1",o.rows="1",Oi(e)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=0<Ai(e).length;i&&o["class"]&&(o["class"]=o["class"].replace(/\s*mce\-item\-table\s*/g,""));var u={type:"grid",columns:2,items:ea(e,i,n)},c=Oi(e)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[u]},_c("table")]}:{type:"panel",items:[u]};e.windowManager.open({title:"Table Properties",size:"normal",body:c,onSubmit:b(qi,e,t),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},ra=Vi("th,td"),oa=Vi("th,td,caption"),ia=Dc.each,ua={registerCommands:function(c,n,a,l,t){function f(e){return lt.table(e,s)}function i(e){return{width:bi(e.dom()),height:bi(e.dom())}}function r(o){ra(c).each(function(r){f(r).each(function(n){var e=Er.forMenu(l,n,r),t=i(n);o(n,e).each(function(e){!function(e,n,t){var r=i(t);n.width===r.width&&n.height===r.height||(Ii(e,t.dom(),n.width,n.height),Bi(e,t.dom(),r.width,r.height))}(c,t,n),c.selection.setRng(e),c.focus(),a.clear(n),Ci(n)})})})}function o(e){return ra(c).map(function(o){return f(o).bind(function(e){var n=on.fromDom(c.getDoc()),t=Er.forMenu(l,e,o),r=Wt.cellOperations(T,n,Me.none());return Oc(e,t,r)})})}function u(u){t.get().each(function(e){var i=g(e,function(e){return Tt(e)});ra(c).each(function(o){f(o).each(function(n){var e=on.fromDom(c.getDoc()),t=Wt.paste(e),r=Er.pasteRows(l,n,o,i,t);u(n,r).each(function(e){c.selection.setRng(e),c.focus(),a.clear(n)})})})})}var s=pc(c);ia({mceTableSplitCells:function(){r(n.unmergeCells)},mceTableMergeCells:function(){r(n.mergeCells)},mceTableInsertRowBefore:function(){r(n.insertRowsBefore)},mceTableInsertRowAfter:function(){r(n.insertRowsAfter)},mceTableInsertColBefore:function(){r(n.insertColumnsBefore)},mceTableInsertColAfter:function(){r(n.insertColumnsAfter)},mceTableDeleteCol:function(){r(n.deleteColumn)},mceTableDeleteRow:function(){r(n.deleteRow)},mceTableCutRow:function(e){o().each(function(e){t.set(e),r(n.deleteRow)})},mceTableCopyRow:function(e){o().each(function(e){t.set(e)})},mceTablePasteRowBefore:function(e){u(n.pasteRowsBefore)},mceTablePasteRowAfter:function(e){u(n.pasteRowsAfter)},mceTableDelete:function(){oa(c).each(function(e){lt.table(e,s).filter(d(s)).each(function(e){var n=on.fromText("");if(Re(e,n),Wn(e),c.dom.isEmpty(c.getBody()))c.setContent(""),c.selection.setCursorLocation();else{var t=c.dom.createRng();t.setStart(n.dom(),0),t.setEnd(n.dom(),0),c.selection.setRng(t),c.nodeChanged()}})})}},function(e,n){c.addCommand(n,e)}),ia({mceInsertTable:b(ta,c,!0),mceTableProps:b(ta,c,!1),mceTableRowProps:b(Kc,c),mceTableCellProps:b(Vc,c)},function(e,n){c.addCommand(n,function(){e()})})}},ca=function(e){var n=Me.from(e.dom().documentElement).map(on.fromDom).getOr(e);return{parent:D(n),view:D(e),origin:D(lo(0,0))}},aa=function(e,n){return{parent:D(n),view:D(e),origin:D(lo(0,0))}},la=function(e){var r=B.apply(null,e),o=[];return{bind:function(e){if(e===undefined)throw new Error("Event bind error: undefined handler");o.push(e)},unbind:function(n){o=h(o,function(e){return e!==n})},trigger:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=r.apply(null,e);p(o,function(e){e(t)})}}},fa={create:function(e){return{registry:k(e,function(e){return{bind:e.bind,unbind:e.unbind}}),trigger:k(e,function(e){return e.trigger})}}},sa=function(e,n,t,r){e.dom().removeEventListener(n,t,r)},da=D(!0),ma={resolve:Eo("ephox-dragster").resolve},ga=ai(["compare","extract","mutate","sink"]),pa=ai(["element","start","stop","destroy"]),ha=ai(["forceDrop","drop","move","delayDrop"]),va=ga({compare:function(e,n){return lo(n.left()-e.left(),n.top()-e.top())},extract:function(e){return Me.some(lo(e.x(),e.y()))},sink:function(e,n){var t=function(e){var n=$c({layerClass:ma.resolve("blocker")},e),t=on.fromTag("div");U(t,"role","presentation"),re(t,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Ro(t,ma.resolve("blocker")),Ro(t,n.layerClass);return{element:function(){return t},destroy:function(){Wn(t)}}}(n),r=Ki(t.element(),"mousedown",e.forceDrop),o=Ki(t.element(),"mouseup",e.drop),i=Ki(t.element(),"mousemove",e.move),u=Ki(t.element(),"mouseout",e.delayDrop);return pa({element:t.element,start:function(e){Mn(e,t.element())},stop:function(){Wn(t.element())},destroy:function(){t.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(e,n){e.mutate(n.left(),n.top())}});function ba(){var r=Me.none(),t=fa.create({move:la(["info"])});return{onEvent:function(e,n){n.extract(e).each(function(e){(function(n,t){var e=r.map(function(e){return n.compare(e,t)});return r=Me.some(t),e})(n,e).each(function(e){t.trigger.move(e)})})},reset:function(){r=Me.none()},events:t.registry}}function wa(){var e=function r(){return{onEvent:T,reset:T}}(),n=ba(),t=e;return{on:function(){t.reset(),t=n},off:function(){t.reset(),t=e},isOn:function(){return t===n},onEvent:function(e,n){t.onEvent(e,n)},events:n.events}}function ya(){var t=fa.create({drag:la(["xDelta","yDelta","target"])}),r=Me.none(),e=function(){var t=fa.create({drag:la(["xDelta","yDelta"])});return{mutate:function(e,n){t.trigger.drag(e,n)},events:t.registry}}();return e.events.drag.bind(function(n){r.each(function(e){t.trigger.drag(n.xDelta(),n.yDelta(),e)})}),{assign:function(e){r=Me.some(e)},get:function(){return r},mutate:e.mutate,events:t.registry}}function Ca(e){return"true"===V(e,"contenteditable")}function Sa(o,n,i){function e(e,n){return Me.from(V(e,n))}var t=ya(),r=vl(t,{}),u=Me.none();function c(e,n){return Hu.getInt(e,n)-parseInt(V(e,"data-initial-"+n),10)}function a(e,n){m.trigger.startAdjust(),t.assign(e),U(e,"data-initial-"+n,parseInt(oe(e,n),10)),Ro(e,bl),te(e,"opacity","0.2"),r.go(o.parent())}function l(e){return In(e,o.view())}function f(e){return et(e,"table",l).filter(function(e){return function(e,n){return et(e,"[contenteditable]",n)}(e,l).exists(Ca)})}t.events.drag.bind(function(t){e(t.target(),"data-row").each(function(e){var n=Hu.getInt(t.target(),"top");te(t.target(),"top",n+t.yDelta()+"px")}),e(t.target(),"data-column").each(function(e){var n=Hu.getInt(t.target(),"left");te(t.target(),"left",n+t.xDelta()+"px")})}),r.events.stop.bind(function(){t.get().each(function(r){u.each(function(t){e(r,"data-row").each(function(e){var n=c(r,"top");Y(r,"data-initial-top"),m.trigger.adjustHeight(t,n,parseInt(e,10))}),e(r,"data-column").each(function(e){var n=c(r,"left");Y(r,"data-initial-left"),m.trigger.adjustWidth(t,n,parseInt(e,10))}),au(o,t,i,n)})})});var s=Ki(o.parent(),"mousedown",function(e){du(e.target())&&a(e.target(),"top"),mu(e.target())&&a(e.target(),"left")}),d=Ki(o.view(),"mouseover",function(e){f(e.target()).fold(function(){ee(e.target())&&su(o)},function(e){u=Me.some(e),au(o,e,i,n)})}),m=fa.create({adjustHeight:la(["table","delta","row"]),adjustWidth:la(["table","delta","column"]),startAdjust:la([])});return{destroy:function(){s.unbind(),d.unbind(),r.destroy(),su(o)},refresh:function(e){au(o,e,i,n)},on:r.on,off:r.off,hideBars:b(lu,o),showBars:b(fu,o),events:m.registry}}function xa(e,n){return bi(e.dom())/bi(n.dom())*100+"%"}function Ra(t,e){return lt.table(t,e).bind(function(e){var n=lt.cells(e);return C(n,function(e){return In(t,e)}).map(function(e){return{index:D(e),all:D(n)}})})}function Ta(e,n,t){var r=e.document.createRange();return function(t,e){e.fold(function(e){t.setStartBefore(e.dom())},function(e,n){t.setStart(e.dom(),n)},function(e){t.setStartAfter(e.dom())})}(r,n),function(t,e){e.fold(function(e){t.setEndBefore(e.dom())},function(e,n){t.setEnd(e.dom(),n)},function(e){t.setEndAfter(e.dom())})}(r,t),r}function Oa(e,n,t,r,o){var i=e.document.createRange();return i.setStart(n.dom(),t),i.setEnd(r.dom(),o),i}function Da(e){return{left:D(e.left),top:D(e.top),right:D(e.right),bottom:D(e.bottom),width:D(e.width),height:D(e.height)}}function Aa(e,n,t){return n(on.fromDom(t.startContainer),t.startOffset,on.fromDom(t.endContainer),t.endOffset)}function Ea(e,n){return function(e,n){var t=n.ltr();return t.collapsed?n.rtl().filter(function(e){return!1===e.collapsed}).map(function(e){return Bl.rtl(on.fromDom(e.endContainer),e.endOffset,on.fromDom(e.startContainer),e.startOffset)}).getOrThunk(function(){return Aa(0,Bl.ltr,t)}):Aa(0,Bl.ltr,t)}(0,function(o,e){return e.match({domRange:function(e){return{ltr:D(e),rtl:Me.none}},relative:function(e,n){return{ltr:Z(function(){return Ta(o,e,n)}),rtl:Z(function(){return Me.some(Ta(o,n,e))})}},exact:function(e,n,t,r){return{ltr:Z(function(){return Oa(o,e,n,t,r)}),rtl:Z(function(){return Me.some(Oa(o,t,r,e,n))})}}})}(e,n))}function Na(e,n,t){return n>=e.left&&n<=e.right&&t>=e.top&&t<=e.bottom}function ka(t,r,e,n,o){function i(e){var n=t.dom().createRange();return n.setStart(r.dom(),e),n.collapse(!0),n}var u=ht(r).length,c=function(e,n,t,r,o){if(0===o)return 0;if(n===r)return o-1;for(var i=r,u=1;u<o;u++){var c=e(u),a=Math.abs(n-c.left);if(t<=c.bottom){if(t<c.top||i<a)return u-1;i=a}}return 0}(function(e){return i(e).getBoundingClientRect()},e,n,o.right,u);return i(c)}function Ia(e,n){return n-e.left<e.right-n}function Ba(e,n,t){var r=e.dom().createRange();return r.selectNode(n.dom()),r.collapse(t),r}function Pa(n,e,t){var r=n.dom().createRange();r.selectNode(e.dom());var o=r.getBoundingClientRect(),i=Ia(o,t);return(!0===i?Ct:St)(e).map(function(e){return Ba(n,e,i)})}function Ma(e,n,t){var r=n.dom().getBoundingClientRect(),o=Ia(r,t);return Me.some(Ba(e,n,o))}function Wa(e,n,t,r){var o=e.dom().createRange();o.selectNode(n.dom());var i=o.getBoundingClientRect();return function(e,n,t,r){var o=e.dom().createRange();o.selectNode(n.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,t)),c=Math.max(i.top,Math.min(i.bottom,r));return Ml(e,n,u,c)}(e,n,Math.max(i.left,Math.min(i.right,t)),Math.max(i.top,Math.min(i.bottom,r)))}function _a(e,n){var t=en(e);return"input"===t?El.after(e):l(["br","img"],t)?0===n?El.before(e):El.after(e):El.on(e,n)}function La(e,n){var t=e.fold(El.before,_a,El.after),r=n.fold(El.before,_a,El.after);return kl.relative(t,r)}function ja(e,n,t,r){var o=_a(e,n),i=_a(t,r);return kl.relative(o,i)}function za(e,n,t,r){var o=function(e,n,t,r){var o=he(e).dom().createRange();return o.setStart(e.dom(),n),o.setEnd(t.dom(),r),o}(e,n,t,r),i=In(e,t)&&n===r;return o.collapsed&&!i}function Ha(e,n){Me.from(e.getSelection()).each(function(e){e.removeAllRanges(),e.addRange(n)})}function Fa(e,n,t,r,o){var i=Oa(e,n,t,r,o);Ha(e,i)}function Ua(u,e){return Ea(u,e).match({ltr:function(e,n,t,r){Fa(u,e,n,t,r)},rtl:function(e,n,t,r){var o=u.getSelection();if(o.setBaseAndExtent)o.setBaseAndExtent(e.dom(),n,t.dom(),r);else if(o.extend)try{!function(e,n,t,r,o,i){n.collapse(t.dom(),r),n.extend(o.dom(),i)}(0,o,e,n,t,r)}catch(i){Fa(u,t,r,e,n)}else Fa(u,t,r,e,n)}})}function qa(e,n,t,r,o){var i=ja(n,t,r,o);Ua(e,i)}function Va(e,n,t){var r=La(n,t);Ua(e,r)}function Ga(e){function n(e,n,t,r){return Oa(o,e,n,t,r)}var o=kl.getWin(e).dom(),t=function(e){return e.match({domRange:function(e){var n=on.fromDom(e.startContainer),t=on.fromDom(e.endContainer);return ja(n,e.startOffset,t,e.endOffset)},relative:La,exact:ja})}(e);return Ea(o,t).match({ltr:n,rtl:n})}function Ya(e){var n=on.fromDom(e.anchorNode),t=on.fromDom(e.focusNode);return za(n,e.anchorOffset,t,e.focusOffset)?Me.some(Dl.create(n,e.anchorOffset,t,e.focusOffset)):function(e){if(0<e.rangeCount){var n=e.getRangeAt(0),t=e.getRangeAt(e.rangeCount-1);return Me.some(Dl.create(on.fromDom(n.startContainer),n.startOffset,on.fromDom(t.endContainer),t.endOffset))}return Me.none()}(e)}function Ka(e,n){var t=function(e,n){var t=e.document.createRange();return Il(t,n),t}(e,n);Ha(e,t)}function Xa(e){return function(e){return Me.from(e.getSelection()).filter(function(e){return 0<e.rangeCount}).bind(Ya)}(e).map(function(e){return kl.exact(e.start(),e.soffset(),e.finish(),e.foffset())})}function $a(e,n){return function(e){var n=e.getClientRects(),t=0<n.length?n[0]:e.getBoundingClientRect();return 0<t.width||0<t.height?Me.some(t).map(Da):Me.none()}(Pl(e,n))}function Ja(e,n,t){return function(e,n,t){var r=on.fromDom(e.document);return Wl(r,n,t).map(function(e){return Dl.create(on.fromDom(e.startContainer),e.startOffset,on.fromDom(e.endContainer),e.endOffset)})}(e,n,t)}function Qa(e,n,t,r){return Ll(e,n,Tl(t),r)}function Za(e,n,t,r){return Ll(e,n,Ol(t),r)}function el(e,n){var t=kl.exact(n,0,n,0);return Ga(t)}function nl(e,n){return function(e){return 0===e.length?Me.none():Me.some(e[e.length-1])}(Be(n,"tr")).bind(function(e){return Zn(e,"td,th").map(function(e){return el(0,e)})})}function tl(e,n,t,r){return void 0===r&&(r=Yl),e.property().parent(n).map(function(e){return Gl(e,r)})}function rl(n){return function(e){return 0===n.property().children(e).length}}function ol(e,n){return function(e,n,t){return ef(e,n,rl(e),t)}(tf,e,n)}function il(e,n){return function(e,n,t){return nf(e,n,rl(e),t)}(tf,e,n)}function ul(e){return et(e,"tr")}function cl(e){return"br"===en(e)}function al(n,e,t,r){return function(e,n){return Se(e,n).filter(cl).orThunk(function(){return Se(e,n-1).filter(cl)})}(e,t).bind(function(e){return r.traverse(e).fold(function(){return lf(e,r.gather,n).map(r.relative)},function(e){return function(r){return ve(r).bind(function(n){var t=Ce(n);return af(t,r).map(function(e){return cf(n,t,r,e)})})}(e).map(function(e){return El.on(e.parent(),e.index())})})})}function ll(e){return mf.nu({left:e.left,top:e.top,right:e.right,bottom:e.bottom})}function fl(e,n){return Me.some(e.getRect(n))}function sl(n,e,t){return function(e,n,t){return Xn(function(e,n){return n(e)},$n,e,n,t)}(e,uc).fold(D(!1),function(e){return pf(n,e).exists(function(e){return function(e,n){return e.left()<n.left()||Math.abs(n.right()-e.left())<1||e.left()>n.right()}(t,e)})})}function dl(n,t,e){var r=n.move(e,5),o=wf(t,n,e,r,100).getOr(r);return function(e,n,t){return e.point(n)>t.getInnerHeight()?Me.some(e.point(n)-t.getInnerHeight()):e.point(n)<0?Me.some(-e.point(n)):Me.none()}(n,o,t).fold(function(){return t.situsFromPoint(o.left(),n.point(o))},function(e){return t.scrollBy(0,e),t.situsFromPoint(o.left(),n.point(o)-e)})}function ml(e,n){return function(e,n,t){return $n(e,n,t).isSome()}(e,function(e){return ve(e).exists(function(e){return In(e,n)})})}function gl(n,r,o,e,i){return et(e,"td,th",r).bind(function(t){return et(t,"table",r).bind(function(e){return ml(i,e)?Of(n,r,o).bind(function(n){return et(n.finish(),"td,th",r).map(function(e){return{start:D(t),finish:D(e),range:D(n)}})}):Me.none()})})}function pl(e,n){return et(e,"td,th",n)}var hl=function(n,t,e){function r(){l.stop(),u.isOn()&&(u.off(),i.trigger.stop())}var o=!1,i=fa.create({start:la([]),stop:la([])}),u=wa(),c=function(t,r){var o=null;return{cancel:function(){null!==o&&(f.clearTimeout(o),o=null)},throttle:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];null!==o&&f.clearTimeout(o),o=f.setTimeout(function(){t.apply(null,e),o=null},r)}}}(r,200);u.events.move.bind(function(e){t.mutate(n,e.info())});function a(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];o&&t.apply(null,e)}}var l=t.sink(ha({forceDrop:r,drop:a(r),move:a(function(e){c.cancel(),u.onEvent(e,t)}),delayDrop:a(c.throttle)}),e);return{element:l.element,go:function(e){l.start(e),u.on(),i.trigger.start()},on:function(){o=!0},off:function(){o=!1},destroy:function(){l.destroy()},events:i.registry}},vl=function(e,n){void 0===n&&(n={});var t=n.mode!==undefined?n.mode:va;return hl(e,t,n)},bl=tu.resolve("resizer-bar-dragging"),wl=function(e,t){var r=go.height,n=Sa(e,t,r),o=fa.create({beforeResize:la(["table"]),afterResize:la(["table"]),startDrag:la([])});return n.events.adjustHeight.bind(function(e){o.trigger.beforeResize(e.table());var n=r.delta(e.delta(),e.table());Ku(e.table(),n,e.row(),r),o.trigger.afterResize(e.table())}),n.events.startAdjust.bind(function(e){o.trigger.startDrag()}),n.events.adjustWidth.bind(function(e){o.trigger.beforeResize(e.table());var n=t.delta(e.delta(),e.table());Yu(e.table(),n,e.column(),t),o.trigger.afterResize(e.table())}),{on:n.on,off:n.off,hideBars:n.hideBars,showBars:n.showBars,destroy:n.destroy,events:o.registry}},yl=function(e,n){return e.inline?aa(gc(e),function(){var e=on.fromTag("div");return re(e,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Mn(un(),e),e}()):ca(on.fromDom(e.getDoc()))},Cl=function(e,n){e.inline&&Wn(n.parent())},Sl=function(u){function c(e){return"TABLE"===e.nodeName}function r(e){var n=u.dom.getStyle(e,"width")||u.dom.getAttrib(e,"width");return Me.from(n).filter(function(e){return 0<e.length})}function e(){return i}var a,l,o=Me.none(),i=Me.none(),f=Me.none(),s=/(\d+(\.\d+)?)%/;return u.on("init",function(){var e=ho(bc.directionAt),n=yl(u);if(f=Me.some(n),function(e){var n=e.getParam("object_resizing",!0);return _e(n)?"table"===n:n}(u)&&function(e){return e.getParam("table_resize_bars",!0,"boolean")}(u)){var t=wl(n,e);t.on(),t.events.startDrag.bind(function(e){o=Me.some(u.selection.getRng())}),t.events.beforeResize.bind(function(e){var n=e.table().dom();Ii(u,n,bi(n),wi(n))}),t.events.afterResize.bind(function(e){var n=e.table(),t=n.dom();Ci(n),o.each(function(e){u.selection.setRng(e),u.focus()}),Bi(u,t,bi(t),wi(t)),u.undoManager.add()}),i=Me.some(t)}}),u.on("ObjectResizeStart",function(e){var n=e.target;if(c(n)){var t=r(n).map(function(e){return s.test(e)}).getOr(!1);t&&Ei(u)?function(e){te(on.fromDom(e),"width",bi(e).toString()+"px")}(n):!t&&function(e){return!0===e.getParam("table_responsive_width")}(u)&&function(e){var n=on.fromDom(e);ve(n).map(function(e){return xa(n,e)}).each(function(e){te(n,"width",e),p(Be(n,"tr"),function(n){p(Ce(n),function(e){te(e,"width",xa(e,n))})})})}(n),a=e.width,l=r(n).getOr("")}}),u.on("ObjectResized",function(e){var n=e.target;if(c(n)){var t=n;if(s.test(l)){var r=parseFloat(s.exec(l)[1]),o=e.width*r/a;u.dom.setStyle(t,"width",o+"%")}else{var i=[];Dc.each(t.rows,function(e){Dc.each(e.cells,function(e){var n=u.dom.getStyle(e,"width",!0);i.push({cell:e,width:n})})}),Dc.each(i,function(e){u.dom.setStyle(e.cell,"width",e.width),u.dom.setAttrib(e.cell,"width",null)})}}}),u.on("SwitchMode",function(){e().each(function(e){u.readonly?e.hideBars():e.showBars()})}),{lazyResize:e,lazyWire:function(){return f.getOr(ca(on.fromDom(u.getBody())))},destroy:function(){i.each(function(e){e.destroy()}),f.each(function(e){Cl(u,e)})}}},xl=Sr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),Rl=fn(fn({},xl),{none:function(e){return void 0===e&&(e=undefined),xl.none(e)}}),Tl=function(n,e){return Ra(n,e).fold(function(){return Rl.none(n)},function(e){return e.index()+1<e.all().length?Rl.middle(n,e.all()[e.index()+1]):Rl.last(n)})},Ol=function(n,e){return Ra(n,e).fold(function(){return Rl.none()},function(e){return 0<=e.index()-1?Rl.middle(n,e.all()[e.index()-1]):Rl.first(n)})},Dl={create:B("start","soffset","finish","foffset")},Al=Sr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),El={before:Al.before,on:Al.on,after:Al.after,cata:function(e,n,t,r){return e.fold(n,t,r)},getStart:function(e){return e.fold(o,o,o)}},Nl=Sr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),kl={domRange:Nl.domRange,relative:Nl.relative,exact:Nl.exact,exactFromRange:function(e){return Nl.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){return function(e){return on.fromDom(e.dom().ownerDocument.defaultView)}(function(e){return e.match({domRange:function(e){return on.fromDom(e.startContainer)},relative:function(e,n){return El.getStart(e)},exact:function(e,n,t,r){return e}})}(e))},range:Dl.create},Il=function(e,n){e.selectNodeContents(n.dom())},Bl=Sr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Pl=function(i,e){return Ea(i,e).match({ltr:function(e,n,t,r){var o=i.document.createRange();return o.setStart(e.dom(),n),o.setEnd(t.dom(),r),o},rtl:function(e,n,t,r){var o=i.document.createRange();return o.setStart(t.dom(),r),o.setEnd(e.dom(),n),o}})},Ml=function(e,n,t,r){return tn(n)?function(n,t,r,o){var e=n.dom().createRange();e.selectNode(t.dom());var i=e.getClientRects();return bo(i,function(e){return Na(e,r,o)?Me.some(e):Me.none()}).map(function(e){return ka(n,t,r,o,e)})}(e,n,t,r):function(n,e,t,r){var o=n.dom().createRange(),i=Ce(e);return bo(i,function(e){return o.selectNode(e.dom()),Na(o.getBoundingClientRect(),t,r)?Ml(n,e,t,r):Me.none()})}(e,n,t,r)},Wl=document.caretPositionFromPoint?function(t,e,n){return Me.from(t.dom().caretPositionFromPoint(e,n)).bind(function(e){if(null===e.offsetNode)return Me.none();var n=t.dom().createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),Me.some(n)})}:document.caretRangeFromPoint?function(e,n,t){return Me.from(e.dom().caretRangeFromPoint(n,t))}:function(t,r,o){return on.fromPoint(t,r,o).bind(function(e){function n(){return function(e,n,t){return(0===Ce(n).length?Ma:Pa)(e,n,t)}(t,e,r)}return 0===Ce(e).length?n():Wa(t,e,r,o).orThunk(n)})},_l=tinymce.util.Tools.resolve("tinymce.util.VK"),Ll=function(r,e,n,o,t){return n.fold(Me.none,Me.none,function(e,n){return Ct(n).map(function(e){return el(0,e)})},function(t){return lt.table(t,e).bind(function(e){var n=Er.noMenu(t);return r.undoManager.transact(function(){o.insertRowsAfter(e,n)}),nl(0,e)})})},jl=["table","li","dl"],zl={handle:function(n,t,r,o){if(n.keyCode===_l.TAB){var i=gc(t),u=function(e){var n=en(e);return In(e,i)||l(jl,n)},e=t.selection.getRng();if(e.collapsed){var c=on.fromDom(e.startContainer);lt.cell(c,u).each(function(e){n.preventDefault(),(n.shiftKey?Za:Qa)(t,u,e,r,o).each(function(e){t.selection.setRng(e)})})}}}},Hl={create:B("selection","kill")},Fl=function(e,n,t,r){return{start:D(El.on(e,n)),finish:D(El.on(t,r))}},Ul={convertToRange:function(e,n){var t=Pl(e,n);return Dl.create(on.fromDom(t.startContainer),t.startOffset,on.fromDom(t.endContainer),t.endOffset)},makeSitus:Fl},ql=function(t,e,r,n,o){return In(r,n)?Me.none():dr(r,n,e).bind(function(e){var n=e.boxes().getOr([]);return 0<n.length?(o(t,n,e.start(),e.finish()),Me.some(Hl.create(Me.some(Ul.makeSitus(r,0,r,wt(r))),!0))):Me.none()})},Vl={sync:function(t,r,e,n,o,i,u){return In(e,o)&&n===i?Me.none():et(e,"td,th",r).bind(function(n){return et(o,"td,th",r).bind(function(e){return ql(t,r,n,e,u)})})},detect:ql,update:function(e,n,t,r,o){return gr(r,e,n,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(e){return o.clearBeforeUpdate(t),o.selectRange(t,e.boxes(),e.start(),e.finish()),e.boxes()})}},Gl=B("item","mode"),Yl=function(e,n,t,r){return void 0===r&&(r=Kl),t.sibling(e,n).map(function(e){return Gl(e,r)})},Kl=function(e,n,t,r){void 0===r&&(r=Kl);var o=e.property().children(n);return t.first(o).map(function(e){return Gl(e,r)})},Xl=[{current:tl,next:Yl,fallback:Me.none()},{current:Yl,next:Kl,fallback:Me.some(tl)},{current:Kl,next:Kl,fallback:Me.some(Yl)}],$l=function(n,t,r,o,e){return void 0===e&&(e=Xl),y(e,function(e){return e.current===r}).bind(function(e){return e.current(n,t,o,e.next).orThunk(function(){return e.fallback.bind(function(e){return $l(n,t,e,o)})})})},Jl=function(){return{sibling:function(e,n){return e.query().prevSibling(n)},first:function(e){return 0<e.length?Me.some(e[e.length-1]):Me.none()}}},Ql=function(){return{sibling:function(e,n){return e.query().nextSibling(n)},first:function(e){return 0<e.length?Me.some(e[0]):Me.none()}}},Zl=function(n,e,t,r,o,i){return $l(n,e,r,o).bind(function(e){return i(e.item())?Me.none():t(e.item())?Me.some(e.item()):Zl(n,e.item(),t,e.mode(),o,i)})},ef=function(e,n,t,r){return Zl(e,n,t,Yl,Jl(),r)},nf=function(e,n,t,r){return Zl(e,n,t,Yl,Ql(),r)},tf=$t(),rf=B("element","offset"),of=(B("element","deltaOffset"),B("element","start","finish"),B("begin","end"),B("element","text"),Sr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}])),uf=fn(fn({},of),{verify:function(t,n,e,r,o,i,u){return et(r,"td,th",u).bind(function(e){return et(n,"td,th",u).map(function(n){return In(e,n)?In(r,e)&&wt(e)===o?i(n):of.none("in same cell"):fr.sharedOne(ul,[e,n]).fold(function(){return function(e,n,t){var r=e.getRect(n),o=e.getRect(t);return o.right>r.left&&o.left<r.right}(t,n,e)?of.success():i(n)},function(e){return i(n)})})}).getOr(of.none("default"))},cata:function(e,n,t,r,o){return e.fold(n,t,r,o)}}),cf=(B("ancestor","descendants","element","index"),B("parent","children","element","index")),af=function(e,n){return C(e,b(In,n))},lf=function(e,n,t){return n(e,t).bind(function(e){return tn(e)&&0===ht(e).trim().length?lf(e,n,t):Me.some(e)})},ff=function(e,n,t,r){return(cl(n)?function(e,n,t){return t.traverse(n).orThunk(function(){return lf(n,t.gather,e)}).map(t.relative)}(e,n,r):al(e,n,t,r)).map(function(e){return{start:D(e),finish:D(e)}})},sf=function(e){return uf.cata(e,function(e){return Me.none()},function(){return Me.none()},function(e){return Me.some(rf(e,0))},function(e){return Me.some(rf(e,wt(e)))})},df=Xe(["left","top","right","bottom"],[]),mf={nu:df,moveUp:function(e,n){return df({left:e.left(),top:e.top()-n,right:e.right(),bottom:e.bottom()-n})},moveDown:function(e,n){return df({left:e.left(),top:e.top()+n,right:e.right(),bottom:e.bottom()+n})},moveBottomTo:function(e,n){var t=e.bottom()-e.top();return df({left:e.left(),top:n-t,right:e.right(),bottom:n})},moveTopTo:function(e,n){var t=e.bottom()-e.top();return df({left:e.left(),top:n,right:e.right(),bottom:n+t})},getTop:function(e){return e.top()},getBottom:function(e){return e.bottom()},translate:function(e,n,t){return df({left:e.left()+n,top:e.top()+t,right:e.right()+n,bottom:e.bottom()+t})},toString:function(e){return"("+e.left()+", "+e.top()+") -> ("+e.right()+", "+e.bottom()+")"}},gf=function(e,n,t){return nn(n)?fl(e,n).map(ll):tn(n)?function(e,n,t){return 0<=t&&t<wt(n)?e.getRangedRect(n,t,n,t+1):0<t?e.getRangedRect(n,t-1,n,t):Me.none()}(e,n,t).map(ll):Me.none()},pf=function(e,n){return nn(n)?fl(e,n).map(ll):tn(n)?e.getRangedRect(n,0,n,wt(n)).map(ll):Me.none()},hf=Sr([{none:[]},{retry:["caret"]}]),vf={point:mf.getTop,adjuster:function(e,n,t,r,o){var i=mf.moveUp(o,5);return Math.abs(t.top()-r.top())<1?hf.retry(i):t.bottom()<o.top()?hf.retry(i):t.bottom()===o.top()?hf.retry(mf.moveUp(o,1)):sl(e,n,o)?hf.retry(mf.translate(i,5,0)):hf.none()},move:mf.moveUp,gather:ol},bf={point:mf.getBottom,adjuster:function(e,n,t,r,o){var i=mf.moveDown(o,5);return Math.abs(t.bottom()-r.bottom())<1?hf.retry(i):t.top()>o.bottom()?hf.retry(i):t.top()===o.bottom()?hf.retry(mf.moveDown(o,1)):sl(e,n,o)?hf.retry(mf.translate(i,5,0)):hf.none()},move:mf.moveDown,gather:il},wf=function(t,r,o,i,u){return 0===u?Me.some(i):function(e,n,t){return e.elementFromPoint(n,t).filter(function(e){return"table"===en(e)}).isSome()}(t,i.left(),r.point(i))?function(e,n,t,r,o){return wf(e,n,t,n.move(r,5),o)}(t,r,o,i,u-1):t.situsFromPoint(i.left(),r.point(i)).bind(function(e){return e.start().fold(Me.none,function(n){return pf(t,n).bind(function(e){return r.adjuster(t,n,e,o,i).fold(Me.none,function(e){return wf(t,r,o,e,u-1)})}).orThunk(function(){return Me.some(i)})},Me.none)})},yf={tryUp:b(dl,vf),tryDown:b(dl,bf),ieTryUp:function(e,n){return e.situsFromPoint(n.left(),n.top()-5)},ieTryDown:function(e,n){return e.situsFromPoint(n.left(),n.bottom()+5)},getJumpSize:D(5)},Cf=me(),Sf=function(r,o,i,u,c,a){return 0===a?Me.none():Tf(r,o,i,u,c).bind(function(e){var n=r.fromSitus(e),t=uf.verify(r,i,u,n.finish(),n.foffset(),c.failure,o);return uf.cata(t,function(){return Me.none()},function(){return Me.some(e)},function(e){return In(i,e)&&0===u?xf(r,i,u,mf.moveUp,c):Sf(r,o,e,0,c,a-1)},function(e){return In(i,e)&&u===wt(e)?xf(r,i,u,mf.moveDown,c):Sf(r,o,e,wt(e),c,a-1)})})},xf=function(n,e,t,r,o){return gf(n,e,t).bind(function(e){return Rf(n,o,r(e,yf.getJumpSize()))})},Rf=function(e,n,t){return Cf.browser.isChrome()||Cf.browser.isSafari()||Cf.browser.isFirefox()||Cf.browser.isEdge()?n.otherRetry(e,t):Cf.browser.isIE()?n.ieRetry(e,t):Me.none()},Tf=function(n,e,t,r,o){return gf(n,t,r).bind(function(e){return Rf(n,o,e)})},Of=function(n,t,r){return function(o,i,u){return o.getSelection().bind(function(r){return ff(i,r.finish(),r.foffset(),u).fold(function(){return Me.some(rf(r.finish(),r.foffset()))},function(e){var n=o.fromSitus(e),t=uf.verify(o,r.finish(),r.foffset(),n.finish(),n.foffset(),u.failure,i);return sf(t)})})}(n,t,r).bind(function(e){return Sf(n,t,e.element(),e.offset(),r,20).map(n.fromSitus)})},Df=me(),Af=function(e,n,t,r,o,i){return Df.browser.isIE()?Me.none():i(r,n).orThunk(function(){return gl(e,n,t,r,o).map(function(e){var n=e.range();return Hl.create(Me.some(Ul.makeSitus(n.start(),n.soffset(),n.finish(),n.foffset())),!0)})})},Ef=function(e,n,t,r,o,i,u){return gl(e,t,r,o,i).bind(function(e){return Vl.detect(n,t,e.start(),e.finish(),u)})},Nf=function(e,r){return et(e,"tr",r).bind(function(t){return et(t,"table",r).bind(function(e){var n=Be(e,"tr");return In(t,n[0])?function(e,n,t){return ef(tf,e,n,t)}(e,function(e){return St(e).isSome()},r).map(function(e){var n=wt(e);return Hl.create(Me.some(Ul.makeSitus(e,n,e,n)),!0)}):Me.none()})})},kf=function(e,r){return et(e,"tr",r).bind(function(t){return et(t,"table",r).bind(function(e){var n=Be(e,"tr");return In(t,n[n.length-1])?function(e,n,t){return nf(tf,e,n,t)}(e,function(e){return Ct(e).isSome()},r).map(function(e){return Hl.create(Me.some(Ul.makeSitus(e,0,e,0)),!0)}):Me.none()})})};function If(n){return function(e){return e===n}}function Bf(c){return{elementFromPoint:function(e,n){return on.fromPoint(on.fromDom(c.document),e,n)},getRect:function(e){return e.dom().getBoundingClientRect()},getRangedRect:function(e,n,t,r){var o=kl.exact(e,n,t,r);return $a(c,o).map(jf)},getSelection:function(){return Xa(c).map(function(e){return Ul.convertToRange(c,e)})},fromSitus:function(e){var n=kl.relative(e.start(),e.finish());return Ul.convertToRange(c,n)},situsFromPoint:function(e,n){return Ja(c,e,n).map(function(e){return Fl(e.start(),e.soffset(),e.finish(),e.foffset())})},clearSelection:function(){!function(e){e.getSelection().removeAllRanges()}(c)},collapseSelection:function(u){void 0===u&&(u=!1),Xa(c).each(function(e){return e.fold(function(e){return e.collapse(u)},function(e,n){var t=u?e:n;Va(c,t,t)},function(e,n,t,r){var o=u?e:t,i=u?n:r;qa(c,o,i,o,i)})})},setSelection:function(e){qa(c,e.start(),e.soffset(),e.finish(),e.foffset())},setRelativeSelection:function(e,n){Va(c,e,n)},selectContents:function(e){Ka(c,e)},getInnerHeight:function(){return c.innerHeight},getScrollY:function(){return function(e){var n=e!==undefined?e.dom():f.document,t=n.body.scrollLeft||n.documentElement.scrollLeft,r=n.body.scrollTop||n.documentElement.scrollTop;return lo(t,r)}(on.fromDom(c.document)).top()},scrollBy:function(e,n){!function(e,n,t){(t!==undefined?t.dom():f.document).defaultView.scrollBy(e,n)}(e,n,on.fromDom(c.document))}}}function Pf(n,e){p(e,function(e){!function(e,n){Co(e)?e.dom().classList.remove(n):xo(e,n);To(e)}(n,e)})}var Mf={down:{traverse:ye,gather:il,relative:El.before,otherRetry:yf.tryDown,ieRetry:yf.ieTryDown,failure:uf.failedDown},up:{traverse:we,gather:ol,relative:El.before,otherRetry:yf.tryUp,ieRetry:yf.ieTryUp,failure:uf.failedUp}},Wf=If(38),_f=If(40),Lf={ltr:{isBackward:If(37),isForward:If(39)},rtl:{isBackward:If(39),isForward:If(37)},isUp:Wf,isDown:_f,isNavigation:function(e){return 37<=e&&e<=40}},jf=function(e){return{left:e.left(),top:e.top(),right:e.right(),bottom:e.bottom(),width:e.width(),height:e.height()}},zf=(me().browser.isSafari(),B("rows","cols")),Hf={mouse:function(e,n,t,r){var o=function c(o,i,n,u){function t(){r=Me.none()}var r=Me.none();return{mousedown:function(e){u.clear(i),r=pl(e.target(),n)},mouseover:function(e){r.each(function(r){u.clearBeforeUpdate(i),pl(e.target(),n).each(function(t){dr(r,t,n).each(function(e){var n=e.boxes().getOr([]);(1<n.length||1===n.length&&!In(r,t))&&(u.selectRange(i,n,e.start(),e.finish()),o.selectContents(t))})})})},mouseup:function(e){r.each(t)}}}(Bf(e),n,t,r);return{mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},keyboard:function(e,l,f,s){function d(){return s.clear(l),Me.none()}var m=Bf(e);return{keydown:function(e,n,t,r,o,i){var u=e.raw(),c=u.which,a=!0===u.shiftKey;return mr(l,s.selectedSelector()).fold(function(){return Lf.isDown(c)&&a?b(Ef,m,l,f,Mf.down,r,n,s.selectRange):Lf.isUp(c)&&a?b(Ef,m,l,f,Mf.up,r,n,s.selectRange):Lf.isDown(c)?b(Af,m,f,Mf.down,r,n,kf):Lf.isUp(c)?b(Af,m,f,Mf.up,r,n,Nf):Me.none},function(n){function e(e){return function(){return bo(e,function(e){return Vl.update(e.rows(),e.cols(),l,n,s)}).fold(function(){return pr(l,s.firstSelectedSelector(),s.lastSelectedSelector()).map(function(e){var n=Lf.isDown(c)||i.isForward(c)?El.after:El.before;return m.setRelativeSelection(El.on(e.first(),0),n(e.table())),s.clear(l),Hl.create(Me.none(),!0)})},function(e){return Me.some(Hl.create(Me.none(),!0))})}}return Lf.isDown(c)&&a?e([zf(1,0)]):Lf.isUp(c)&&a?e([zf(-1,0)]):i.isBackward(c)&&a?e([zf(0,-1),zf(-1,0)]):i.isForward(c)&&a?e([zf(0,1),zf(1,0)]):Lf.isNavigation(c)&&!1==a?d:Me.none})()},keyup:function(t,r,o,i,u){return mr(l,s.selectedSelector()).fold(function(){var e=t.raw(),n=e.which;return!1==(!0===e.shiftKey)?Me.none():Lf.isNavigation(n)?Vl.sync(l,f,r,o,i,u,s.selectRange):Me.none()},Me.none)}}},external:function(e,r,n,o){var i=Bf(e);return function(e,t){o.clearBeforeUpdate(r),dr(e,t,n).each(function(e){var n=e.boxes().getOr([]);o.selectRange(r,n,e.start(),e.finish()),i.selectContents(t),i.collapseSelection()})}}},Ff={byClass:function(o){function i(e){var n=Be(e,o.selectedSelector());p(n,t)}var u=function(n){return function(e){Ro(e,n)}}(o.selected()),t=function(n){return function(e){Pf(e,n)}}([o.selected(),o.lastSelected(),o.firstSelected()]);return{clearBeforeUpdate:i,clear:i,selectRange:function(e,n,t,r){i(e),p(n,u),Ro(t,o.firstSelected()),Ro(r,o.lastSelected())},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}},byAttr:function(o,i,n){function t(e){Y(e,o.selected()),Y(e,o.firstSelected()),Y(e,o.lastSelected())}function u(e){U(e,o.selected(),"1")}function c(e){r(e),n()}var r=function(e){var n=Be(e,o.selectedSelector());p(n,t)};return{clearBeforeUpdate:r,clear:c,selectRange:function(e,n,t,r){c(e),p(n,u),U(t,o.firstSelected(),"1"),U(r,o.lastSelected(),"1"),i(n,t,r)},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}}},Uf={getOtherCells:function(e,n,t){var r=ft(e),o=mt.generate(r);return Fo(o,n).map(function(e){var n=bu(o,t,!1);return{upOrLeftCells:function(e,t,n){var r=e.slice(0,t[t.length-1].row()+1),o=_o(r,n);return x(o,function(e){var n=e.cells().slice(0,t[t.length-1].column()+1);return g(n,function(e){return e.element()})})}(n,e,t),downOrRightCells:function(e,t,n){var r=e.slice(t[0].row()+t[0].rowspan()-1,e.length),o=_o(r,n);return x(o,function(e){var n=e.cells().slice(t[0].column()+t[0].colspan()-1,+e.cells().length);return g(n,function(e){return e.element()})})}(n,e,t)}})}},qf=function(e){return!1===Oo(on.fromDom(e.target),"ephox-snooker-resizer-bar")};function Vf(w,y,e){var C=Xe(["mousedown","mouseover","mouseup","keyup","keydown"],[]),S=Me.none(),a=Sc(w),x=Ff.byAttr(Cr,function(i,u,c){e.targets().each(function(o){lt.table(u).each(function(e){var n=on.fromDom(w.getDoc()),t=Wt.cellOperations(T,n,a),r=Uf.getOtherCells(e,o,t);xc(w,i,u,c,r)})})},function(){Rc(w)});w.on("init",function(e){var r=w.getWin(),o=gc(w),n=pc(w),t=Hf.mouse(r,o,n,x),c=Hf.keyboard(r,o,n,x),i=Hf.external(r,o,n,x);w.on("TableSelectorChange",function(e){i(e.start,e.finish)});function a(e,n){!function(e){return!0===e.raw().shiftKey}(e)||(n.kill()&&e.kill(),n.selection().each(function(e){var n=kl.relative(e.start(),e.finish()),t=Pl(r,n);w.selection.setRng(t)}))}function u(e){var n=v(e);if(n.raw().shiftKey&&Lf.isNavigation(n.raw().which)){var t=w.selection.getRng(),r=on.fromDom(t.startContainer),o=on.fromDom(t.endContainer);c.keyup(n,r,t.startOffset,o,t.endOffset).each(function(e){a(n,e)})}}function l(e){var n=v(e);y().each(function(e){e.hideBars()});var t=w.selection.getRng(),r=on.fromDom(w.selection.getStart()),o=on.fromDom(t.startContainer),i=on.fromDom(t.endContainer),u=bc.directionAt(r).isRtl()?Lf.rtl:Lf.ltr;c.keydown(n,o,t.startOffset,i,t.endOffset,u).each(function(e){a(n,e)}),y().each(function(e){e.showBars()})}function f(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")}function s(e){return 0===e.button}function d(e){s(e)&&qf(e)&&t.mousedown(v(e))}function m(e){(function(e){return e.buttons===undefined||0!=(1&e.buttons)})(e)&&qf(e)&&t.mouseover(v(e))}function g(e){s(e)&&qf(e)&&t.mouseup(v(e))}var p,h,v=function(e){function n(){e.stopPropagation()}function t(){e.preventDefault()}var r=on.fromDom(e.target),o=O(t,n);return{target:D(r),x:D(f(e)?e.x:null),y:D(f(e)?e.y:null),stop:n,prevent:t,kill:o,raw:D(e)}},b=(p=R(on.fromDom(o)),h=R(0),{touchEnd:function(e){var n=on.fromDom(e.target);if("td"===en(n)||"th"===en(n)){var t=p.get(),r=h.get();In(t,n)&&e.timeStamp-r<300&&(e.preventDefault(),i(n,n))}p.set(n),h.set(e.timeStamp)}});w.on("mousedown",d),w.on("mouseover",m),w.on("mouseup",g),w.on("touchend",b.touchEnd),w.on("keyup",u),w.on("keydown",l),w.on("NodeChange",function(){var e=w.selection,n=on.fromDom(e.getStart()),t=on.fromDom(e.getEnd());fr.sharedOne(lt.table,[n,t]).fold(function(){x.clear(o)},T)}),S=Me.some(C({mousedown:d,mouseover:m,mouseup:g,keyup:u,keydown:l}))});return{clear:x.clear,destroy:function(){S.each(function(e){})}}}var Gf=function(n){return{get:function(){var e=gc(n);return hr(e,Cr.selectedSelector()).fold(function(){return n.selection.getStart()===undefined?Rr.none():Rr.single(n.selection)},function(e){return Rr.multiple(e)})}}},Yf=function(e,t){function n(){return oa(e).bind(function(n){return lt.table(n).map(function(e){return"caption"===en(n)?Er.notCell(n):Er.forMenu(t,e,n)})})}function r(){i.set(Z(n)()),p(u.get(),function(e){return e()})}function o(n,t){function r(){return i.get().fold(function(){n.setDisabled(!0)},function(e){n.setDisabled(t(e))})}return r(),u.set(u.get().concat([r])),function(){u.set(h(u.get(),function(e){return e!==r}))}}var i=R(Me.none()),u=R([]);return e.on("NodeChange TableSelectorChange",r),{onSetupTable:function(e){return o(e,function(e){return!1})},onSetupCellOrRow:function(e){return o(e,function(e){return"caption"===en(e.element())})},onSetupMergeable:function(e){return o(e,function(e){return e.mergable().isNone()})},onSetupUnmergeable:function(e){return o(e,function(e){return e.unmergable().isNone()})},resetTargets:r,targets:function(){return i.get()}}},Kf={addButtons:function(n,e){n.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(e){return e("inserttable | cell row column | advtablesort | tableprops deletetable")}});function t(e){return function(){return n.execCommand(e)}}n.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:t("mceTableProps"),icon:"table",onSetup:e.onSetupTable}),n.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:t("mceTableDelete"),icon:"table-delete-table",onSetup:e.onSetupTable}),n.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:t("mceTableCellProps"),icon:"table-cell-properties",onSetup:e.onSetupCellOrRow}),n.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:t("mceTableMergeCells"),icon:"table-merge-cells",onSetup:e.onSetupMergeable}),n.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:t("mceTableSplitCells"),icon:"table-split-cells",onSetup:e.onSetupUnmergeable}),n.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:t("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:e.onSetupCellOrRow}),n.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:t("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:e.onSetupCellOrRow}),n.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:t("mceTableDeleteRow"),icon:"table-delete-row",onSetup:e.onSetupCellOrRow}),n.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:t("mceTableRowProps"),icon:"table-row-properties",onSetup:e.onSetupCellOrRow}),n.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:t("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:e.onSetupCellOrRow}),n.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:t("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:e.onSetupCellOrRow}),n.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:t("mceTableDeleteCol"),icon:"table-delete-column",onSetup:e.onSetupCellOrRow}),n.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",onAction:t("mceTableCutRow"),icon:"temporary-placeholder",onSetup:e.onSetupCellOrRow}),n.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",onAction:t("mceTableCopyRow"),icon:"temporary-placeholder",onSetup:e.onSetupCellOrRow}),n.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",onAction:t("mceTablePasteRowBefore"),icon:"temporary-placeholder",onSetup:e.onSetupCellOrRow}),n.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",onAction:t("mceTablePasteRowAfter"),icon:"temporary-placeholder",onSetup:e.onSetupCellOrRow}),n.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:t("mceInsertTable"),icon:"table"})},addToolbars:function(n){var e=function(e){return e.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")}(n);0<e.length&&n.ui.registry.addContextToolbar("table",{predicate:function(e){return n.dom.is(e,"table")&&n.getBody().contains(e)},items:e,scope:"node",position:"node"})}},Xf={addMenuItems:function(r,e){function n(e){return function(){return r.execCommand(e)}}function t(e){var n=e.numRows,t=e.numColumns;r.undoManager.transact(function(){Zc(r,t,n)}),r.addVisual()}var o={text:"Table properties",onSetup:e.onSetupTable,onAction:n("mceTableProps")},i={text:"Delete table",icon:"table-delete-table",onSetup:e.onSetupTable,onAction:n("mceTableDelete")},u=[{type:"menuitem",text:"Insert row before",icon:"table-insert-row-above",onAction:n("mceTableInsertRowBefore"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Insert row after",icon:"table-insert-row-after",onAction:n("mceTableInsertRowAfter"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Delete row",icon:"table-delete-row",onAction:n("mceTableDeleteRow"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Row properties",icon:"table-row-properties",onAction:n("mceTableRowProps"),onSetup:e.onSetupCellOrRow},{type:"separator"},{type:"menuitem",text:"Cut row",onAction:n("mceTableCutRow"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Copy row",onAction:n("mceTableCopyRow"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Paste row before",onAction:n("mceTablePasteRowBefore"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Paste row after",onAction:n("mceTablePasteRowAfter"),onSetup:e.onSetupCellOrRow}],c={type:"nestedmenuitem",text:"Row",getSubmenuItems:function(){return u}},a=[{type:"menuitem",text:"Insert column before",icon:"table-insert-column-before",onAction:n("mceTableInsertColBefore"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Insert column after",icon:"table-insert-column-after",onAction:n("mceTableInsertColAfter"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Delete column",icon:"table-delete-column",onAction:n("mceTableDeleteCol"),onSetup:e.onSetupCellOrRow}],l={type:"nestedmenuitem",text:"Column",getSubmenuItems:function(){return a}},f=[{type:"menuitem",text:"Cell properties",icon:"table-cell-properties",onAction:n("mceTableCellProps"),onSetup:e.onSetupCellOrRow},{type:"menuitem",text:"Merge cells",icon:"table-merge-cells",onAction:n("mceTableMergeCells"),onSetup:e.onSetupMergeable},{type:"menuitem",text:"Split cell",icon:"table-split-cells",onAction:n("mceTableSplitCells"),onSetup:e.onSetupUnmergeable}],s={type:"nestedmenuitem",text:"Cell",getSubmenuItems:function(){return f}};!1===function(e){return e.getParam("table_grid",!0,"boolean")}(r)?r.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:n("mceInsertTable")}):r.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:t}]}}),r.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:n("mceInsertTable")}),r.ui.registry.addMenuItem("tableprops",o),r.ui.registry.addMenuItem("deletetable",i),r.ui.registry.addNestedMenuItem("row",c),r.ui.registry.addNestedMenuItem("column",l),r.ui.registry.addNestedMenuItem("cell",s),r.ui.registry.addContextMenu("table",{update:function(){return e.resetTargets(),e.targets().fold(function(){return""},function(e){return"caption"===en(e.element())?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"})}})}},$f=function(t,n,e,r){return{insertTable:function(e,n){return Zc(t,e,n)},setClipboardRows:function(e){return function(e,n){var t=g(e,on.fromDom);n.set(Me.from(t))}(e,n)},getClipboardRows:function(){return function(e){return e.get().fold(function(){},function(e){return g(e,function(e){return e.dom()})})}(n)},resizeHandler:e,selectionTargets:r}};function Jf(n){var e=Gf(n),t=Yf(n,e),r=Sl(n),o=Vf(n,r.lazyResize,t),i=Tc(n,r.lazyWire),u=R(Me.none());return ua.registerCommands(n,i,o,e,u),Nr.registerEvents(n,e,i,o),Xf.addMenuItems(n,t),Kf.addButtons(n,t),Kf.addToolbars(n),n.on("PreInit",function(){n.serializer.addTempAttr(Cr.firstSelected()),n.serializer.addTempAttr(Cr.lastSelected())}),Cc(n)&&n.on("keydown",function(e){zl.handle(e,n,i,r.lazyWire)}),n.on("remove",function(){r.destroy(),o.destroy()}),$f(n,u,r,t)}!function Zf(){We.add("table",Jf)}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function e(){}function a(e){return function(){return e}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager");function c(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}function i(n,e){return p.each(e,function(e,t){"function"==typeof e&&(e=e(t)),n=n.replace(new RegExp("\\{\\$"+t+"\\}","g"),e)}),n}function l(e,t){var r=e.dom,o=h(e);p.each(r.select("*",t),function(n){p.each(o,function(e,t){r.hasClass(n,t)&&"function"==typeof o[t]&&o[t](n)})})}function s(e,t){return new RegExp("\\b"+t+"\\b","g").test(e.className)}function n(){return w}var r,u=a(!1),f=a(!0),p=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=tinymce.util.Tools.resolve("tinymce.util.XHR"),m=function(e){return e.getParam("template_cdate_classes","cdate")},d=function(e){return e.getParam("template_mdate_classes","mdate")},g=function(e){return e.getParam("template_selected_content_classes","selcontent")},y=function(e){return e.getParam("template_preview_replace_values")},h=function(e){return e.getParam("template_replace_values")},v=function(e){return e.templates},b=function(e){return e.getParam("template_cdate_format",e.translate("%Y-%m-%d"))},O=function(e){return e.getParam("template_mdate_format",e.translate("%Y-%m-%d"))},T=function(e,t,n){var r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),a="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),u="January February March April May June July August September October November December".split(" ");return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",c(n.getMonth()+1,2))).replace("%d",c(n.getDate(),2))).replace("%H",""+c(n.getHours(),2))).replace("%M",""+c(n.getMinutes(),2))).replace("%S",""+c(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(u[n.getMonth()]))).replace("%b",""+e.translate(a[n.getMonth()]))).replace("%A",""+e.translate(o[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")},M=function(t,n){return function(){var e=v(t);"function"!=typeof e?"string"==typeof e?o.send({url:e,success:function(e){n(JSON.parse(e))}}):n(e):e(n)}},S=i,_=l,x=function(t,e,n){var r,o,a=t.dom,u=t.selection.getContent();n=i(n,h(t)),r=a.create("div",null,n),(o=a.select(".mceTmpl",r))&&0<o.length&&(r=a.create("div",null)).appendChild(o[0].cloneNode(!0)),p.each(a.select("*",r),function(e){s(e,m(t).replace(/\s+/g,"|"))&&(e.innerHTML=T(t,b(t))),s(e,d(t).replace(/\s+/g,"|"))&&(e.innerHTML=T(t,O(t))),s(e,g(t).replace(/\s+/g,"|"))&&(e.innerHTML=u)}),l(t,r),t.execCommand("mceInsertContent",!1,r.innerHTML),t.addVisual()},P=function(e){e.addCommand("mceInsertTemplate",function t(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}(x,e))},A=function(r){r.on("PreProcess",function(e){var t=r.dom,n=O(r);p.each(t.select("div",e.node),function(e){t.hasClass(e,"mceTmpl")&&(p.each(t.select("*",e),function(e){t.hasClass(e,r.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(e.innerHTML=T(r,n))}),_(r,e))})})},w=(r={fold:function(e,t){return e()},is:u,isSome:u,isNone:f,getOr:N,getOrThunk:C,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:N,orThunk:C,map:n,each:e,bind:n,exists:u,forall:f,filter:n,equals:D,equals_:D,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(r),r);function D(e){return e.isNone()}function C(e){return e()}function N(e){return e}function H(e){return e.replace(/["'<>&]/g,function(e){return function(e,t){return B(e,t)?L.from(e[t]):L.none()}(E,e).getOr(e)})}function k(t){return function(e){R(t,e)}}var I,J=function(n){function e(){return o}function t(e){return e(n)}var r=a(n),o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:f,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return J(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:w},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(u,function(e){return t(n,e)})}};return o},L={some:J,none:n,from:function(e){return null===e||e===undefined?w:J(e)}},Y=(I="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===I}),j=Array.prototype.slice,q=(Y(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.Promise")),F=Object.hasOwnProperty,B=function(e,t){return F.call(e,t)},E={'"':"&quot;","<":"&lt;",">":"&gt;","&":"&amp;","'":"&#039;"},R=function(i,t){function e(e){return function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var a=e[o];r[o]=t(a,o)}return r}(e,function(e){return{text:e.text,value:e.text}})}function a(e,t){return function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n))return L.some(o)}return L.none()}(e,function(e){return e.text===t})}function l(e){return new q(function(t,n){e.value.url.fold(function(){return t(e.value.content.getOr(""))},function(e){return o.send({url:e,success:function(e){t(e)},error:function(e){n(e)}})})})}(function(){if(t&&0!==t.length)return L.from(p.map(t,function(e,t){function n(e){return e.url!==undefined}return{selected:0===t,text:e.title,value:{url:n(e)?L.from(e.url):L.none(),content:n(e)?L.none():L.from(e.content),description:e.description}}}));var e=i.translate("No templates defined.");return i.notificationManager.open({text:e,type:"info"}),L.none()})().each(function(n){function u(e,t){return{title:"Insert Template",size:"large",body:{type:"panel",items:e},initialData:t,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(n){return function(t){var e=t.getData();a(n,e.template).each(function(e){l(e).then(function(e){x(i,!1,e),t.close()})})}}(n),onChange:function(r,o){return function(n,e){if("template"===e.name){var t=n.getData().template;a(r,t).each(function(t){n.block("Loading..."),l(t).then(function(e){o(n,t,e),n.unblock()})})}}}(n,r)}}var c=e(n),r=function(e,t,n){var r=function(t,e){if(-1===e.indexOf("<html>")){var n="";p.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+t.documentBaseURI.toAbsolute(e)+'">'});var r=t.settings.body_class||"";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_class","","hash"))[t.id]||"");var o=t.dom.encode,a=t.getBody().dir,u=a?' dir="'+o(a)+'"':"";e="<!DOCTYPE html><html><head>"+n+'</head><body class="'+o(r)+'"'+u+">"+e+"</body></html>"}return S(e,y(t))}(i,n),o=[{type:"selectbox",name:"template",label:"Templates",items:c},{type:"htmlpanel",html:'<p aria-live="polite">'+H(t.value.description)+"</p>"},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1}],a={template:t.text,preview:r};e.unblock(),e.redial(u(o,a)),e.focus("template")},t=i.windowManager.open(u([],{template:"",preview:""}));t.block("Loading..."),l(n[0]).then(function(e){r(t,n[0],e)})})},z=function(e){e.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:M(e.settings,k(e))}),e.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:M(e.settings,k(e))})};!function U(){t.add("template",function(e){z(e),P(e),A(e)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("textcolor",function(){o.console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(f){"use strict";var r=function(t){function n(){return e}var e=t;return{get:n,set:function(t){e=t},clone:function(){return r(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){return(u=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function n(){}function a(t){return function(){return t}}function o(t){return t}function e(){return l}var i,c=a(!1),s=a(!0),l=(i={fold:function(t,n){return t()},is:c,isSome:c,isNone:s,getOr:g,getOrThunk:m,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:g,orThunk:m,map:e,each:n,bind:e,exists:c,forall:s,filter:e,equals:d,equals_:d,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(i),i);function d(t){return t.isNone()}function m(t){return t()}function g(t){return t}function p(n){return function(t){return function(t){if(null===t)return"null";var n=typeof t;return"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n}(t)===n}}function h(t,n){return-1<function(t,n){return lt.call(t,n)}(t,n)}function v(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var a=t[o];r[o]=n(a,o)}return r}function y(t,n){for(var e=0,r=t.length;e<r;e++){n(t[e],e)}}function b(t,n){for(var e=[],r=0,o=t.length;r<o;r++){var a=t[r];n(a,r)&&e.push(a)}return e}function k(t,n,e){return function(t,n){for(var e=t.length-1;0<=e;e--){n(t[e],e)}}(t,function(t){e=n(e,t)}),e}function O(t,n){for(var e=0,r=t.length;e<r;++e){if(!0!==n(t[e],e))return!1}return!0}function w(t){var n=[],e=[];return y(t,function(t){t.fold(function(t){n.push(t)},function(t){e.push(t)})}),{errors:n,values:e}}function x(t){return"inline-command"===t.type||"inline-format"===t.type}function C(t){return"block-command"===t.type||"block-format"===t.type}function E(t){return function(t,n){var e=st.call(t,0);return e.sort(n),e}(t,function(t,n){return t.start.length===n.start.length?0:t.start.length>n.start.length?-1:1})}function T(o){function a(t){return yt.error({message:t,pattern:o})}function t(t,n,e){if(o.format===undefined)return o.cmd!==undefined?it(o.cmd)?yt.value(e(o.cmd,o.value)):a(t+" pattern has non-string `cmd` parameter"):a(t+" pattern is missing both `format` and `cmd` parameters");var r=void 0;if(ft(o.format)){if(!O(o.format,it))return a(t+" pattern has non-string items in the `format` array");r=o.format}else{if(!it(o.format))return a(t+" pattern has non-string `format` parameter");r=[o.format]}return yt.value(n(r))}if(!ut(o))return a("Raw pattern is not an object");if(!it(o.start))return a("Raw pattern is missing `start` parameter");if(o.end===undefined)return o.replacement!==undefined?it(o.replacement)?0===o.start.length?a("Replacement pattern has empty `start` parameter"):yt.value({type:"inline-command",start:"",end:o.start,cmd:"mceInsertContent",value:o.replacement}):a("Replacement pattern has non-string `replacement` parameter"):0===o.start.length?a("Block pattern has empty `start` parameter"):t("Block",function(t){return{type:"block-format",start:o.start,format:t[0]}},function(t,n){return{type:"block-command",start:o.start,cmd:t,value:n}});if(!it(o.end))return a("Inline pattern has non-string `end` parameter");if(0===o.start.length&&0===o.end.length)return a("Inline pattern has empty `start` and `end` parameters");var e=o.start,r=o.end;return 0===r.length&&(r=e,e=""),t("Inline",function(t){return{type:"inline-format",start:e,end:r,format:t}},function(t,n){return{type:"inline-command",start:e,end:r,cmd:t,value:n}})}function R(t){return"block-command"===t.type?{start:t.start,cmd:t.cmd,value:t.value}:"block-format"===t.type?{start:t.start,format:t.format}:"inline-command"===t.type?"mceInsertContent"===t.cmd&&""===t.start?{start:t.end,replacement:t.value}:{start:t.start,end:t.end,cmd:t.cmd,value:t.value}:"inline-format"===t.type?{start:t.start,end:t.end,format:1===t.format.length?t.format[0]:t.format}:void 0}function N(t){return{inlinePatterns:b(t,x),blockPatterns:E(b(t,C))}}function P(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=kt.console;e&&(e.error?e.error.apply(e,t):e.log.apply(e,t))}function S(t){var n=function(t,n){return gt(t,n)?at.from(t[n]):at.none()}(t,"textpattern_patterns").getOr(Ot);if(!ft(n))return P("The setting textpattern_patterns should be an array"),{inlinePatterns:[],blockPatterns:[]};var e=w(v(n,T));return y(e.errors,function(t){return P(t.message,t.pattern)}),N(e.values)}function M(t){var n=t.getParam("forced_root_block","p");return!1===n?"":!0===n?"p":n}function A(t){return t.nodeType===f.Node.TEXT_NODE}function j(t,n,e,r){void 0===r&&(r=!0);var o=n.startContainer.parentNode,a=n.endContainer.parentNode;n.deleteContents(),r&&!e(n.startContainer)&&(A(n.startContainer)&&0===n.startContainer.data.length&&t.remove(n.startContainer),A(n.endContainer)&&0===n.endContainer.data.length&&t.remove(n.endContainer),Tt(t,o,e),o!==a&&Tt(t,a,e))}function B(t,n){var e=n.get(t);return ft(e)&&function(t){return 0===t.length?at.none():at.some(t[0])}(e).exists(function(t){return gt(t,"block")})}function D(t){return 0===t.start.length}function I(t,n){var e=at.from(t.dom.getParent(n.startContainer,t.dom.isBlock));return""===M(t)?e.orThunk(function(){return at.some(t.getBody())}):e}function _(t,n){return{element:t,offset:n}}function U(t,n){function e(t){for(var n=r[t]();n&&n.nodeType!==f.Node.TEXT_NODE;)n=r[t]();return n&&n.nodeType===f.Node.TEXT_NODE?at.some(n):at.none()}var r=new Et(t,n);return{next:function(){return e("next")},prev:function(){return e("prev")},prev2:function(){return e("prev2")}}}function q(t,n,e){return A(t)&&0<=n?at.some(_(t,n)):U(t,e).prev().map(function(t){return _(t,t.data.length)})}function L(t,n,e){if(A(n)&&(e<0||e>n.data.length))return[];for(var r=[e],o=n;o!==t&&o.parentNode;){for(var a=o.parentNode,i=0;i<a.childNodes.length;i++)if(a.childNodes[i]===o){r.push(i);break}o=a}return o===t?r.reverse():[]}function V(t,n,e,r,o){return{start:L(t,n,e),end:L(t,r,o)}}function W(t,n){var e=n.slice(),r=e.pop();return function(t,n,e){return y(t,function(t){e=n(e,t)}),e}(e,function(t,n){return t.bind(function(t){return at.from(t.childNodes[n])})},at.some(t)).bind(function(t){return A(t)&&0<=r&&t.data.length,at.some({node:t,offset:r})})}function X(n,e){return W(n,e.start).bind(function(t){var o=t.node,a=t.offset;return W(n,e.end).map(function(t){var n=t.node,e=t.offset,r=f.document.createRange();return r.setStart(o,a),r.setEnd(n,e),r})})}function z(r,o,t){U(o,o).next().each(function(e){Nt(e,t.start.length,o).each(function(t){var n=r.createRng();n.setStart(e,0),n.setEnd(t.element,t.offset),j(r,n,function(t){return t===o})})})}function F(t,n){var e=n.replace("\xa0"," ");return function(t,n){for(var e=0,r=t.length;e<r;e++){var o=t[e];if(n(o,e))return at.some(o)}return at.none()}(t,function(t){return 0===n.indexOf(t.start)||0===e.indexOf(t.start)})}function G(n,t){if(0!==t.length){var e=n.selection.getBookmark();y(t,function(t){return function(n,t){var e=n.dom,r=t.pattern,o=X(e.getRoot(),t.range).getOrDie("Unable to resolve path range");return I(n,o).each(function(t){"block-format"===r.type?B(r.format,n.formatter)&&n.undoManager.transact(function(){z(n.dom,t,r),n.formatter.apply(r.format)}):"block-command"===r.type&&n.undoManager.transact(function(){z(n.dom,t,r),n.execCommand(r.cmd,!1,r.value)})}),!0}(n,t)}),n.selection.moveToBookmark(e)}}function H(t,n){return t.create("span",{"data-mce-type":"bookmark",id:n})}function J(t,n){var e=t.createRng();return e.setStartAfter(n.start),e.setEndBefore(n.end),e}function K(t,n,e){var r=X(t.getRoot(),e).getOrDie("Unable to resolve path range"),o=r.startContainer,a=r.endContainer,i=0===r.endOffset?a:a.splitText(r.endOffset),u=0===r.startOffset?o:o.splitText(r.startOffset);return{prefix:n,end:i.parentNode.insertBefore(H(t,n+"-end"),i),start:u.parentNode.insertBefore(H(t,n+"-start"),u)}}function Q(t,n,e){Tt(t,t.get(n.prefix+"-end"),e),Tt(t,t.get(n.prefix+"-start"),e)}function Y(t,e,n,r,o,a){if(void 0===a&&(a=!1),0!==e.start.length||a)return q(n,r,o).bind(function(n){return function(t,n,e,r,o){var a=new Et(n,o);return Mt(t,n,at.some(e),r,a.prev,at.none())}(t,n.element,n.offset,function(f,c,s){return function(e,r,t,n){if(r===c)return e.abort();var o=t.substring(0,n.getOr(t.length)),a=o.lastIndexOf(s.charAt(s.length-1)),i=o.lastIndexOf(s);if(-1===i)return-1!==a?Rt(r,a+1-s.length,c).fold(function(){return e.kontinue()},function(t){var n=f.createRng();return n.setStart(t.element,t.offset),n.setEnd(r,a+1),n.toString()===s?e.finish(n):e.kontinue()}):e.kontinue();var u=f.createRng();return u.setStart(r,i),u.setEnd(r,i+s.length),e.finish(u)}}(t,o,e.start),o).fold(at.none,at.none,at.some).bind(function(t){if(a){if(t.endContainer===n.element&&t.endOffset===n.offset)return at.none();if(0===n.offset&&t.endContainer.textContent.length===t.endOffset)return at.none()}return at.some(t)})});var i=t.createRng();return i.setStart(n,r),i.setEnd(n,r),at.some(i)}function Z(a,i,u){var f=a.dom,c=f.getRoot(),s=u.pattern,l=u.position.element,d=u.position.offset;return Rt(l,d-u.pattern.end.length,i).bind(function(t){var e=V(c,t.element,t.offset,l,d);if(D(s))return at.some({matches:[{pattern:s,startRng:e,endRng:e}],position:t});var n=jt(a,u.remainingPatterns,t.element,t.offset,i),r=n.getOr({matches:[],position:t}),o=r.position;return Y(f,s,o.element,o.offset,i,n.isNone()).map(function(t){var n=function(t,n){return V(t,n.startContainer,n.startOffset,n.endContainer,n.endOffset)}(c,t);return{matches:r.matches.concat([{pattern:s,startRng:n,endRng:e}]),position:_(t.startContainer,t.startOffset)}})})}function $(n,t,e){n.selection.setRng(e),"inline-format"===t.type?y(t.format,function(t){n.formatter.apply(t)}):n.execCommand(t.cmd,!1,t.value)}function tt(o,t){var a=function(t){var n=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++At+String(n)}("mce_textpattern"),i=k(t,function(t,n){var e=K(o,a+"_end"+t.length,n.endRng);return t.concat([u(u({},n),{endMarker:e})])},[]);return k(i,function(t,n){var e=i.length-t.length-1,r=D(n.pattern)?n.endMarker:K(o,a+"_start"+e,n.startRng);return t.concat([u(u({},n),{startMarker:r})])},[])}function nt(e,r,o){var a=e.selection.getRng();return!1===a.collapsed?[]:I(e,a).bind(function(t){var n=a.startOffset-(o?1:0);return jt(e,r,a.startContainer,n,t)}).fold(function(){return[]},function(t){return t.matches})}function et(r,t){if(0!==t.length){var o=r.dom,n=r.selection.getBookmark(),e=tt(o,t);y(e,function(t){function n(t){return t===e}var e=o.getParent(t.startMarker.start,o.isBlock);D(t.pattern)?function(t,n,e,r){var o=J(t.dom,e);j(t.dom,o,r),$(t,n,o)}(r,t.pattern,t.endMarker,n):function(t,n,e,r,o){var a=t.dom,i=J(a,r),u=J(a,e);j(a,u,o),j(a,i,o);var f={prefix:e.prefix,start:e.end,end:r.start},c=J(a,f);$(t,n,c)}(r,t.pattern,t.startMarker,t.endMarker,n),Q(o,t.endMarker,n),Q(o,t.startMarker,n)}),r.selection.moveToBookmark(n)}}function rt(t,n,e){for(var r=0;r<t.length;r++)if(e(t[r],n))return!0}var ot=function(e){function t(){return o}function n(t){return t(e)}var r=a(e),o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:s,isNone:c,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return ot(t(e))},each:function(t){t(e)},bind:n,exists:n,forall:n,filter:function(t){return t(e)?o:l},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(c,function(t){return n(e,t)})}};return o},at={some:ot,none:e,from:function(t){return null===t||t===undefined?l:ot(t)}},it=p("string"),ut=p("object"),ft=p("array"),ct=p("function"),st=Array.prototype.slice,lt=Array.prototype.indexOf,dt=(ct(Array.from)&&Array.from,Object.keys),mt=Object.hasOwnProperty,gt=function(t,n){return mt.call(t,n)},pt=function(i){if(!ft(i))throw new Error("cases must be an array");if(0===i.length)throw new Error("there must be at least one case");var u=[],e={};return y(i,function(t,r){var n=dt(t);if(1!==n.length)throw new Error("one and only one name per case");var o=n[0],a=t[o];if(e[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!ft(a))throw new Error("case arguments must be an array");u.push(o),e[o]=function(){var t=arguments.length;if(t!==a.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+a.length+" ("+a+"), got "+t);for(var e=new Array(t),n=0;n<e.length;n++)e[n]=arguments[n];return{fold:function(){if(arguments.length!==i.length)throw new Error("Wrong number of arguments to fold. Expected "+i.length+", got "+arguments.length);return arguments[r].apply(null,e)},match:function(t){var n=dt(t);if(u.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+n.join(","));if(!O(u,function(t){return h(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+u.join(", "));return t[o].apply(null,e)},log:function(t){f.console.log(t,{constructors:u,constructor:o,params:e})}}}}),e},ht=(pt([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(e){return{is:function(t){return e===t},isValue:s,isError:c,getOr:a(e),getOrThunk:a(e),getOrDie:a(e),or:function(t){return ht(e)},orThunk:function(t){return ht(e)},fold:function(t,n){return n(e)},map:function(t){return ht(t(e))},mapError:function(t){return ht(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOption:function(){return at.some(e)}}}),vt=function(e){return{is:c,isValue:c,isError:s,getOr:o,getOrThunk:function(t){return t()},getOrDie:function(){return function(t){return function(){throw new Error(t)}}(String(e))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return vt(e)},mapError:function(t){return vt(t(e))},each:n,bind:function(t){return vt(e)},exists:c,forall:s,toOption:at.none}},yt={value:ht,error:vt,fromOption:function(t,n){return t.fold(function(){return vt(n)},ht)}},bt=function(r){return{setPatterns:function(t){var n=w(v(t,T));if(0<n.errors.length){var e=n.errors[0];throw new Error(e.message+":\n"+JSON.stringify(e.pattern,null,2))}r.set(N(n.values))},getPatterns:function(){return function f(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var a=arguments[n],i=0,u=a.length;i<u;i++,o++)r[o]=a[i];return r}(v(r.get().inlinePatterns,R),v(r.get().blockPatterns,R))}}},kt="undefined"!=typeof f.window?f.window:Function("return this;")(),Ot=[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],wt=tinymce.util.Tools.resolve("tinymce.util.Delay"),xt=tinymce.util.Tools.resolve("tinymce.util.VK"),Ct=tinymce.util.Tools.resolve("tinymce.util.Tools"),Et=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Tt=function(t,n,e){if(n&&t.isEmpty(n)&&!e(n)){var r=n.parentNode;t.remove(n),Tt(t,r,e)}},Rt=function(t,e,r){if(!A(t))return at.none();var n=t.textContent;return 0<=e&&e<=n.length?at.some(_(t,e)):U(t,r).prev().bind(function(t){var n=t.textContent;return Rt(t,e+n.length,r)})},Nt=function(t,n,e){if(!A(t))return at.none();var r=t.textContent;return n<=r.length?at.some(_(t,n)):U(t,e).next().bind(function(t){return Nt(t,n-r.length,e)})},Pt=pt([{aborted:[]},{edge:["element"]},{success:["info"]}]),St=pt([{abort:[]},{kontinue:[]},{finish:["info"]}]),Mt=function(n,e,t,r,o,a){function i(){return a.fold(Pt.aborted,Pt.edge)}function u(){var t=o();return t?Mt(n,t,at.none(),r,o,at.some(e)):i()}if(function(t,n){return t.isBlock(n)||h(["BR","IMG","HR","INPUT"],n.nodeName)||"false"===t.getContentEditable(n)}(n,e))return i();if(A(e)){var f=e.textContent;return r(St,e,f,t).fold(Pt.aborted,function(){return u()},Pt.success)}return u()},At=0,jt=function(c,s,l,d,m){var g=c.dom;return q(l,d,g.getRoot()).bind(function(t){var n=g.createRng();n.setStart(m,0),n.setEnd(l,d);for(var e,r,o=n.toString(),a=0;a<s.length;a++){var i=s[a];if(e=o,r=i.end,function(t,n,e){return""===n||!(t.length<n.length)&&t.substr(e,e+n.length)===n}(e,r,e.length-r.length)){var u=s.slice();u.splice(a,1);var f=Z(c,m,{pattern:i,remainingPatterns:u,position:t});if(f.isSome())return f}}return at.none()})},Bt=function(e,t){if(!e.selection.isCollapsed())return!1;var r=nt(e,t.inlinePatterns,!1),o=function(r,t){var o=r.dom,n=r.selection.getRng();return I(r,n).filter(function(t){var n=M(r),e=""===n&&o.is(t,"body")||o.is(t,n);return null!==t&&e}).bind(function(n){var e=n.textContent;return F(t,e).map(function(t){return Ct.trim(e).length===t.start.length?[]:[{pattern:t,range:V(o.getRoot(),n,0,n,0)}]})}).getOr([])}(e,t.blockPatterns);return(0<o.length||0<r.length)&&(e.undoManager.add(),e.undoManager.extra(function(){e.execCommand("mceInsertNewLine")},function(){e.insertContent("\ufeff"),et(e,r),G(e,o);var t=e.selection.getRng(),n=q(t.startContainer,t.startOffset,e.dom.getRoot());e.execCommand("mceInsertNewLine"),n.each(function(t){"\ufeff"===t.element.data.charAt(t.offset-1)&&(t.element.deleteData(t.offset-1,1),Tt(e.dom,t.element.parentNode,function(t){return t===e.dom.getRoot()}))})}),!0)},Dt=function(t,n){var e=nt(t,n.inlinePatterns,!0);0<e.length&&t.undoManager.transact(function(){et(t,e)})},It=function(t,n){return rt(t,n,function(t,n){return t.charCodeAt(0)===n.charCode})},_t=function(t,n){return rt(t,n,function(t,n){return t===n.keyCode&&!1===xt.modifierPressed(n)})},Ut=function(n,e){var r=[",",".",";",":","!","?"],o=[32];n.on("keydown",function(t){13!==t.keyCode||xt.modifierPressed(t)||Bt(n,e.get())&&t.preventDefault()},!0),n.on("keyup",function(t){_t(o,t)&&Dt(n,e.get())}),n.on("keypress",function(t){It(r,t)&&wt.setEditorTimeout(n,function(){Dt(n,e.get())})})};!function qt(){t.add("textpattern",function(t){var n=r(S(t.settings));return Ut(t,n),bt(n)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function e(n){return function(t){function e(){return t.setDisabled(n.readonly||!v.hasHeaders(n))}return e(),n.on("LoadContent SetContent change",e),function(){return n.on("LoadContent SetContent change",e)}}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),l=tinymce.util.Tools.resolve("tinymce.util.I18n"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(t){return t.getParam("toc_class","mce-toc")},d=function(t){var e=t.getParam("toc_header","h2");return/^h[1-6]$/.test(e)?e:"h2"},a=function(t){var e=parseInt(t.getParam("toc_depth","3"),10);return 1<=e&&e<=9?e:3},s=function(e){var n=0;return function(){var t=(new Date).getTime().toString(32);return e+t+(n++).toString(32)}}("mcetoc_"),f=function f(t){var e,n=[];for(e=1;e<=t;e++)n.push("h"+e);return n.join(",")},m=function(n){var o=c(n),t=d(n),e=f(a(n)),r=n.$(e);return r.length&&/^h[1-9]$/i.test(t)&&(r=r.filter(function(t,e){return!n.dom.hasClass(e.parentNode,o)})),i.map(r,function(t){return{id:t.id?t.id:s(),level:parseInt(t.nodeName.replace(/^H/i,""),10),title:n.$.text(t),element:t}})},o=function(t){var e,n,o,r,i="",c=m(t),a=function(t){var e,n=9;for(e=0;e<t.length;e++)if(t[e].level<n&&(n=t[e].level),1===n)return n;return n}(c)-1;if(!c.length)return"";for(i+=function(t,e){var n="</"+t+">";return"<"+t+' contenteditable="true">'+u.DOM.encode(e)+n}(d(t),l.translate("Table of Contents")),e=0;e<c.length;e++){if((o=c[e]).element.id=o.id,r=c[e+1]&&c[e+1].level,a===o.level)i+="<li>";else for(n=a;n<o.level;n++)i+="<ul><li>";if(i+='<a href="#'+o.id+'">'+o.title+"</a>",r!==o.level&&r)for(n=o.level;r<n;n--)i+="</li></ul><li>";else i+="</li>",r||(i+="</ul>");a=o.level}return i},r=function(t){var e=c(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(o(t))})},v={hasHeaders:function(t){return 0<m(t).length},insertToc:function(t){var e=c(t),n=t.$("."+e);!function(t,e){return!e.length||0<t.dom.getParents(e[0],".mce-offscreen-selection").length}(t,n)?r(t):t.insertContent(function(t){var e=o(t);return'<div class="'+t.dom.encode(c(t))+'" contenteditable="false">'+e+"</div>"}(t))},updateToc:r},n=function(t){t.addCommand("mceInsertToc",function(){v.insertToc(t)}),t.addCommand("mceUpdateToc",function(){v.updateToc(t)})},g=function(t){var n=t.$,o=c(t);t.on("PreProcess",function(t){var e=n("."+o,t.node);e.length&&(e.removeAttr("contentEditable"),e.find("[contenteditable]").removeAttr("contentEditable"))}),t.on("SetContent",function(){var t=n("."+o);t.length&&(t.attr("contentEditable",!1),t.children(":first-child").attr("contentEditable",!0))})},h=function(t){t.ui.registry.addButton("toc",{icon:"toc",tooltip:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:e(t)}),t.ui.registry.addButton("tocupdate",{icon:"reload",tooltip:"Update",onAction:function(){return t.execCommand("mceUpdateToc")}}),t.ui.registry.addMenuItem("toc",{icon:"toc",text:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:e(t)}),t.ui.registry.addContextToolbar("toc",{items:"tocupdate",predicate:function(e){return function(t){return t&&e.dom.is(t,"."+c(e))&&e.getBody().contains(t)}}(t),scope:"node",position:"node"})};!function p(){t.add("toc",function(t){n(t),h(t),g(t)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function n(n,e){return function(o){o.setActive(e.get());function t(t){return o.setActive(t.state)}return n.on("VisualBlocks",t),function(){return n.off("VisualBlocks",t)}}}var e=function(t){function o(){return n}var n=t;return{get:o,set:function(t){n=t},clone:function(){return e(o())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t,o){t.fire("VisualBlocks",{state:o})},u=function(t,o,n){t.dom.toggleClass(t.getBody(),"mce-visualblocks"),n.set(!n.get()),i(t,n.get())},c=function(t,o,n){t.addCommand("mceVisualBlocks",function(){u(t,o,n)})},s=function(t){return t.getParam("visualblocks_default_state",!1,"boolean")},l=function(o,t,n){o.on("PreviewFormats AfterPreviewFormats",function(t){n.get()&&o.dom.toggleClass(o.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)}),o.on("init",function(){s(o)&&u(o,t,n)}),o.on("remove",function(){o.dom.removeClass(o.getBody(),"mce-visualblocks")})},r=function(t,o){t.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:n(t,o)}),t.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:n(t,o)})};!function o(){t.add("visualblocks",function(t,o){var n=e(!1);c(t,o,n),r(t,n),l(t,o,n)})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(r){"use strict";function n(){}function u(n){return function(){return n}}function e(){return l}var t,o=function(n){function e(){return t}var t=n;return{get:e,set:function(n){t=n},clone:function(){return o(e())}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(n){return{isEnabled:function(){return n.get()}}},a=function(n,e){return n.fire("VisualChars",{state:e})},f=u(!1),s=u(!0),l=(t={fold:function(n,e){return n()},is:f,isSome:f,isNone:s,getOr:g,getOrThunk:m,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:g,orThunk:m,map:e,each:n,bind:e,exists:f,forall:s,filter:e,equals:d,equals_:d,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(t),t);function d(n){return n.isNone()}function m(n){return n()}function g(n){return n}function N(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}}function v(n,e){for(var t=0,r=n.length;t<r;t++){e(n[t],t)}}function h(n){return n.dom().nodeValue}function p(n,e,t){!function(n,e,t){if(!(L(t)||P(t)||R(t)))throw r.console.error("Invalid call to Attr.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")}(n.dom(),e,t)}function E(n,e){n.dom().removeAttribute(e)}function T(n,e){var t=function(n,e){var t=n.dom().getAttribute(e);return null===t?undefined:t}(n,e);return t===undefined||""===t?[]:t.split(" ")}function O(n){return n.dom().classList!==undefined}function y(n,e){return function(n,e,t){var r=T(n,e).concat([t]);return p(n,e,r.join(" ")),!0}(n,"class",e)}function b(n,e){return function(n,e,t){var r=function(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var u=n[r];e(u,r)&&t.push(u)}return t}(T(n,e),function(n){return n!==t});return 0<r.length?p(n,e,r.join(" ")):E(n,e),!1}(n,"class",e)}function D(n){0===(O(n)?n.dom().classList:function(n){return T(n,"class")}(n)).length&&E(n,"class")}function C(n,e){var t,r="";for(t in n)r+=t;return new RegExp("["+r+"]",e?"g":"")}function A(n){var e,t="";for(e in n)t&&(t+=","),t+="span.mce-"+n[e];return t}function _(n){return"span"===n.nodeName.toLowerCase()&&n.classList.contains("mce-nbsp-wrap")}function w(u,n){var e=W.filterDescendants(F.fromDom(n),W.isMatch);v(e,function(n){var e=n.dom().parentNode;if(_(e))!function(n,e){O(n)?n.dom().classList.add(e):y(n,e)}(F.fromDom(e),H.nbspClass);else{for(var t=W.replaceWithSpans(u.dom.encode(h(n))),r=u.dom.create("div",null,t),o=void 0;o=r.lastChild;)u.dom.insertAfter(o,n.dom());u.dom.remove(n.dom())}})}function M(e,n){var t=e.dom.select(H.selector,n);v(t,function(n){_(n)?function(n,e){O(n)?n.dom().classList.remove(e):b(n,e);D(n)}(F.fromDom(n),H.nbspClass):e.dom.remove(n,!0)})}function S(t,r){return function(e){e.setActive(r.get());function n(n){return e.setActive(n.state)}return t.on("VisualChars",n),function(){return t.off("VisualChars",n)}}}var k,x=function(t){function n(){return o}function e(n){return n(t)}var r=u(t),o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:s,isNone:f,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return x(n(t))},each:function(n){n(t)},bind:e,exists:e,forall:e,filter:function(n){return n(t)?o:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(f,function(n){return e(t,n)})}};return o},I=function(n){return null===n||n===undefined?l:x(n)},L=N("string"),P=N("boolean"),B=N("function"),R=N("number"),V=Array.prototype.slice,U=(B(Array.from)&&Array.from,r.Node.ATTRIBUTE_NODE,r.Node.CDATA_SECTION_NODE,r.Node.COMMENT_NODE,r.Node.DOCUMENT_NODE,r.Node.DOCUMENT_TYPE_NODE,r.Node.DOCUMENT_FRAGMENT_NODE,r.Node.ELEMENT_NODE,r.Node.TEXT_NODE),j=(r.Node.PROCESSING_INSTRUCTION_NODE,r.Node.ENTITY_REFERENCE_NODE,r.Node.ENTITY_NODE,r.Node.NOTATION_NODE,"undefined"!=typeof r.window?r.window:Function("return this;")(),k=U,function(n){return function(n){return n.dom().nodeType}(n)===k}),q=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:u(n)}},F={fromHtml:function(n,e){var t=(e||r.document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw r.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return q(t.childNodes[0])},fromTag:function(n,e){var t=(e||r.document).createElement(n);return q(t)},fromText:function(n,e){var t=(e||r.document).createTextNode(n);return q(t)},fromDom:q,fromPoint:function(n,e,t){var r=n.dom();return I(r.elementFromPoint(e,t)).map(q)}},G={"\xa0":"nbsp","\xad":"shy"},H={charMap:G,regExp:C(G),regExpGlobal:C(G,!0),selector:A(G),nbspClass:"mce-nbsp",charMapToRegExp:C,charMapToSelector:A},Y=function(n){return'<span data-mce-bogus="1" class="mce-'+H.charMap[n]+'">'+n+"</span>"},z=function(n,e){var t=[],r=function(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var u=n[o];r[o]=e(u,o)}return r}(n.dom().childNodes,F.fromDom);return v(r,function(n){e(n)&&(t=t.concat([n])),t=t.concat(z(n,e))}),t},W={isMatch:function(n){var e=h(n);return j(n)&&e!==undefined&&H.regExp.test(e)},filterDescendants:z,findParentElm:function(n,e){for(;n.parentNode;){if(n.parentNode===e)return n;n=n.parentNode}},replaceWithSpans:function(n){return n.replace(H.regExpGlobal,Y)}},K=w,X=M,J=function(n){var e=n.getBody(),t=n.selection.getBookmark(),r=W.findParentElm(n.selection.getNode(),e);r=r!==undefined?r:e,M(n,r),w(n,r),n.selection.moveToBookmark(t)},Q=function(n,e){var t,r=n.getBody(),o=n.selection;e.set(!e.get()),a(n,e.get()),t=o.getBookmark(),!0===e.get()?K(n,r):X(n,r),o.moveToBookmark(t)},Z=function(n,e){n.addCommand("mceVisualChars",function(){Q(n,e)})},$=tinymce.util.Tools.resolve("tinymce.util.Delay"),nn=function(e,t){var r=$.debounce(function(){J(e)},300);!1!==e.settings.forced_root_block&&e.on("keydown",function(n){!0===t.get()&&(13===n.keyCode?J(e):r())})},en=function(n){return n.getParam("visualchars_default_state",!1)},tn=function(e,t){e.on("init",function(){var n=!en(e);t.set(n),Q(e,t)})};!function rn(){i.add("visualchars",function(n){var e=o(!1);return Z(n,e),function(n,e){n.ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"visualchars",onAction:function(){return n.execCommand("mceVisualChars")},onSetup:S(n,e)}),n.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",onAction:function(){return n.execCommand("mceVisualChars")},onSetup:S(n,e)})}(n,e),nn(n,e),tn(n,e),c(e)})}()}(window);
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
9
  !function(){"use strict";function t(){}function n(t){return function(){return t}}function r(t){return t}function e(){return U}var o,u=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=n(!1),c=n(!0),a=function(){return(a=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},f="[-'\\.\u2018\u2019\u2024\ufe52\uff07\uff0e]",s="[:\xb7\xb7\u05f4\u2027\ufe13\ufe55\uff1a]",l="[\xb1+*/,;;\u0589\u060c\u060d\u066c\u07f8\u2044\ufe10\ufe14\ufe50\ufe54\uff0c\uff1b]",g="[0-9\u0660-\u0669\u066b\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9]",p="\\r",d="\\n",h="[\x0B\f\x85\u2028\u2029]",y="[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f\u109a-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b6-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u192b\u1930-\u193b\u19b0-\u19c0\u19c8\u19c9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f\u1b00-\u1b04\u1b34-\u1b44\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1baa\u1be6-\u1bf3\u1c24-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe3-\uabea\uabec\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]",C="[\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200e\u200f\u202a-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb]",v="[\u3031-\u3035\u309b\u309c\u30a0-\u30fa\u30fc-\u30ff\u31f0-\u31ff\u32d0-\u32fe\u3300-\u3357\uff66-\uff9d]",w="[=_\u203f\u2040\u2054\ufe33\ufe34\ufe4d-\ufe4f\uff3f\u2200-\u22ff<>]",m="[!-#%-*,-\\/:;?@\\[-\\]_{}\xa1\xab\xb7\xbb\xbf;\xb7\u055a-\u055f\u0589\u058a\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1361-\u1368\u1400\u166d\u166e\u169b\u169c\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d\u207e\u208d\u208e\u3008\u3009\u2768-\u2775\u27c5\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc\u29fd\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e2e\u2e30\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030\u303d\u30a0\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb\ufd3e\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a\uff1b\uff1f\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]",b=0,E=1,S=2,x=3,W=4,R=5,O=6,A=7,j=8,D=9,T=10,k=11,P=12,B=13,F=[new RegExp("[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24b6-\u24e9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]"),new RegExp(f),new RegExp(s),new RegExp(l),new RegExp(g),new RegExp(p),new RegExp(d),new RegExp(h),new RegExp(y),new RegExp(C),new RegExp(v),new RegExp(w),new RegExp("@")],N=new RegExp("^"+m+"$"),U=(o={fold:function(t,n){return t()},is:i,isSome:i,isNone:c,getOr:M,getOrThunk:z,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:n(null),getOrUndefined:n(undefined),or:M,orThunk:z,map:e,each:t,bind:e,exists:i,forall:c,filter:e,equals:_,equals_:_,toArray:function(){return[]},toString:n("none()")},Object.freeze&&Object.freeze(o),o);function _(t){return t.isNone()}function z(t){return t()}function M(t){return t}function q(t){for(var n=ot,e=rt.length,r=0;r<e;++r){var o=rt[r];if(o&&o.test(t)){n=r;break}}return n}function $(t){return function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var u=t[o];r[o]=n(u,o)}return r}(t,function(e){var r={};return function(t){if(r[t])return r[t];var n=e(t);return r[t]=n}}(q))}function I(t,n){var e=function(t,n){var e;for(e=n;e<t.length&&!ut.test(t[e]);e++);return e}(t,n+1);return"://"===t.slice(n+1,e).join("").substr(0,3)?e:n}function Z(t,n){for(var e,r=n.getBlockElements(),o=n.getShortEndedElements(),u=[],i="",c=new at(t,t);t=c.next();)3===t.nodeType?i+=t.data:(r[(e=t).nodeName]||o[e.nodeName])&&i.length&&(u.push(i),i="");return i.length&&u.push(i),u}function G(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length}function H(t,n){var e=Z(t,n).join("\n");return ct(e.split(""),r).length}function J(t,n){var e=Z(t,n).join("");return G(e)}function K(t,n){var e=Z(t,n).join("").replace(/\s/g,"");return G(e)}function L(t,n){return function(){return n(t.getBody(),t.schema)}}function Q(t,n){return function(){return n(t.selection.getRng().cloneContents(),t.schema)}}function V(t){return L(t,H)}function X(t,n){!function(t,n){t.fire("wordCountUpdate",{wordCount:{words:n.body.getWordCount(),characters:n.body.getCharacterCount(),charactersWithoutSpaces:n.body.getCharacterCountWithoutSpaces()}})}(t,n)}function Y(t,n){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(n.body.getWordCount()),String(n.selection.getWordCount())],["Characters (no spaces)",String(n.body.getCharacterCountWithoutSpaces()),String(n.selection.getCharacterCountWithoutSpaces())],["Characters",String(n.body.getCharacterCount()),String(n.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})}var tt,nt=(tt="function",function(t){return function(t){if(null===t)return"null";var n=typeof t;return"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n}(t)===tt}),et=Array.prototype.slice,rt=(nt(Array.from)&&Array.from,F),ot=B,ut=/^\s+$/,it=N,ct=function(t,n,e){e=a(a({},{includeWhitespace:!1,includePunctuation:!1}),e);for(var r=[],o=[],u=0;u<t.length;u++){var i=n(t[u]);"\ufeff"!==i&&(r.push(t[u]),o.push(i))}return function(t,n,e,r){for(var o,u,i,c,a,f,s,l=[],g=[],p=0;p<e.length;++p)if(g.push(t[p]),a=c=void 0,f=(u=e)[i=p],s=u[i+1],!(i<0||i>u.length-1&&0!==i||f===b&&s===b||(a=u[i+2],f===b&&(s===S||s===E||s===P)&&a===b||(c=u[i-1],(f===S||f===E||s===P)&&s===b&&c===b||!(f!==W&&f!==b||s!==W&&s!==b)||(f===x||f===E)&&s===W&&c===W||f===W&&(s===x||s===E)&&a===W||f===j||f===D||c===j||c===D||s===j||s===D||f===R&&s===O||f!==A&&f!==R&&f!==O&&s!==A&&s!==R&&s!==O&&(f===T&&s===T||s===k&&(f===b||f===W||f===T||f===k)||f===k&&(s===b||s===W||s===T)||f===P))))){var d=n[p];if((r.includeWhitespace||!ut.test(d))&&(r.includePunctuation||!it.test(d))){var h=p-g.length+1,y=p+1,C=n.slice(h,y).join("");if("http"===(o=C)||"https"===o){var v=I(n,p),w=t.slice(y,v);Array.prototype.push.apply(g,w),p=v}l.push(g)}g=[]}return l}(r,o,$(o),e)},at=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),ft=tinymce.util.Tools.resolve("tinymce.util.Delay");!function st(e){void 0===e&&(e=300),u.add("wordcount",function(t){var n=function(t){return{body:{getWordCount:V(t),getCharacterCount:L(t,J),getCharacterCountWithoutSpaces:L(t,K)},selection:{getWordCount:Q(t,H),getCharacterCount:Q(t,J),getCharacterCountWithoutSpaces:Q(t,K)},getCount:V(t)}}(t);return function(t,n){t.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:function(){return Y(t,n)}}),t.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:function(){return Y(t,n)}})}(t,n),function(t,n,e){var r=ft.debounce(function(){return X(t,n)},e);t.on("init",function(){X(t,n),ft.setEditorTimeout(t,function(){t.on("SetContent BeforeAddUndo Undo Redo keyup",r)},0)})}(t,n,e),n})}()}();
@@ -4,6 +4,6 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.1.4 (2019-12-11)
7
+ * Version: 5.1.5 (2019-12-19)
8
8
  */
9
- !function(d){"use strict";var x=function(){return(x=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 u(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&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]])}return t}function w(){}function y(n){return n}var i=function(t,r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,n))}},v=function(n){return function(){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)}}function m(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return!t.apply(null,n)}}function o(n){return function(){throw new Error(n)}}function t(n){return n()}function n(){return f}var e,c=v(!1),a=v(!0),f=(e={fold:function(n,e){return n()},is:c,isSome:c,isNone:a,getOr:g,getOrThunk:s,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:v(null),getOrUndefined:v(undefined),or:g,orThunk:s,map:n,each:w,bind:n,exists:c,forall:a,filter:n,equals:r,equals_:r,toArray:function(){return[]},toString:v("none()")},Object.freeze&&Object.freeze(e),e);function r(n){return n.isNone()}function s(n){return n()}function g(n){return n}function S(n,t){return jn(n,function(n,e){return{k:e,v:t(n,e)}})}function p(n,e){return Vn.call(n,e)}function h(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};function r(n){return Number(e.replace(t,"$"+n))}return zn(r(1),r(2))}function b(n,e){return function(){return e===n}}function T(n,e){return function(){return e===n}}function O(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}}function k(n,e){return-1<function(n,e){return se.call(n,e)}(n,e)}function E(n,e){for(var t=0,r=n.length;t<r;t++){if(e(n[t],t))return!0}return!1}function C(n,e){for(var t=0,r=n.length;t<r;t++){e(n[t],t)}}function D(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}function M(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}function I(n,e,t){return C(n,function(n){t=e(t,n)}),t}function R(n,e){for(var t=0,r=n.length;t<r;t++){var o=n[t];if(e(o,t))return Fn.some(o)}return Fn.none()}function A(n,e){for(var t=0,r=n.length;t<r;t++){if(e(n[t],t))return Fn.some(t)}return Fn.none()}function F(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!ie(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);le.apply(e,n[t])}return e}function B(n,e){var t=de(n,e);return F(t)}function V(n,e){for(var t=0,r=n.length;t<r;++t){if(!0!==e(n[t],t))return!1}return!0}function N(n){var e=fe.call(n,0);return e.reverse(),e}function j(n,e){return D(n,function(n){return!k(e,n)})}function _(n){return[n]}function P(n,e){var t=String(e).toLowerCase();return R(n,function(n){return n.search(t)})}function H(n,e){return-1!==n.indexOf(e)}function z(e){return function(n){return H(n,e)}}function L(){return be.get()}function G(n,e){Ye(n,n.element(),e,{})}function U(n,e,t){Ye(n,n.element(),e,t)}function $(n){G(n,Pe())}function W(n,e,t){Ye(n,e,t,{})}function X(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}}function q(n){return n.dom().nodeName.toLowerCase()}function Y(e){return function(n){return function(n){return n.dom().nodeType}(n)===e}}function K(n){var e=tt(n)?n.dom().parentNode:n.dom();return e!==undefined&&null!==e&&e.ownerDocument.body.contains(e)}function J(){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 C(e,function(n,e){r[n]=v(t[e])}),r}}function Q(n){return n.slice(0).sort()}function Z(e,n){if(!ie(n))throw new Error("The "+e+" fields must be an array. Was: "+n+".");C(n,function(n){if(!re(n))throw new Error("The value "+n+" in the "+e+" fields was not a string.")})}function nn(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 Z("required",o),Z("optional",i),function(n){var t=Q(n);R(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(", ")+"].")})}(u),function(e){var t=Bn(e);V(o,function(n){return k(t,n)})||function(n,e){throw new Error("All required keys ("+Q(n).join(", ")+") were not specified. Specified keys were: "+Q(e).join(", ")+".")}(o,t);var n=D(t,function(n){return!k(u,n)});0<n.length&&function(n){throw new Error("Unsupported keys for object: "+Q(n).join(", "))}(n);var r={};return C(o,function(n){r[n]=v(e[n])}),C(i,function(n){r[n]=v(Object.prototype.hasOwnProperty.call(e,n)?Fn.some(e[n]):Fn.none())}),r}}function en(n,e,t){return 0!=(n.compareDocumentPosition(e)&t)}function tn(n,e){var t=n.dom();if(t.nodeType!==ut)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")}function rn(n){return n.nodeType!==ut&&n.nodeType!==ct||0===n.childElementCount}function on(n,e){var t=e===undefined?d.document:e.dom();return rn(t)?[]:de(t.querySelectorAll(n),Je.fromDom)}function un(n,e){var t=e===undefined?d.document:e.dom();return rn(t)?Fn.none():Fn.from(t.querySelector(n)).map(Je.fromDom)}function cn(n,e){return n.dom()===e.dom()}function an(n){return Je.fromDom(n.dom().ownerDocument)}function fn(n){return Fn.from(n.dom().parentNode).map(Je.fromDom)}function sn(n,e){var t=n.dom().childNodes;return Fn.from(t[e]).map(Je.fromDom)}function ln(e,t){fn(e).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})}function dn(n,e){(function(n){return Fn.from(n.dom().nextSibling).map(Je.fromDom)})(n).fold(function(){fn(n).each(function(n){ft(n,e)})},function(n){ln(n,e)})}function mn(e,t){(function(n){return sn(n,0)})(e).fold(function(){ft(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})}function gn(e,n){C(n,function(n){ft(e,n)})}function pn(n){n.dom().textContent="",C(at(n),function(n){st(n)})}function hn(n,e){ft(n.element(),e.element())}function vn(e,n){var t=e.components();!function(n){C(n.components(),function(n){return st(n.element())}),pn(n.element()),n.syncComponents()}(e);var r=j(t,n);C(r,function(n){lt(n),e.getSystem().removeFromWorld(n)}),C(n,function(n){n.getSystem().isConnected()?hn(e,n):(e.getSystem().addToWorld(n),hn(e,n),K(e.element())&&dt(n)),e.syncComponents()})}function yn(e){var n=fn(e.element()).bind(function(n){return e.getSystem().getByDom(n).toOption()});!function(n){lt(n),st(n.element()),n.getSystem().removeFromWorld(n)}(e),n.each(function(n){n.syncComponents()})}function bn(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)bt.call(o,i)&&(t[i]=u(t[i],o[i]))}return t}}function xn(n){return St.defaultedThunk(v(n))}function wn(e){return function(n){return p(n,e)?Fn.from(n[e]):Fn.none()}}function Sn(n,e){return wn(e)(n)}function Tn(n,e){var t={};return t[n]=e,t}function On(n,e){return function(n,t){var r={};return Nn(n,function(n,e){k(t,e)||(r[e]=n)}),r}(n,e)}function kn(n,e){return function(e,t){return function(n){return p(n,e)?n[e]:t}}(n,e)}function En(n,e){return Tn(n,e)}function Cn(n){return function(n){var e={};return C(n,function(n){e[n.key]=n.value}),e}(n)}function Dn(n,e){var t=function(n){var e=[],t=[];return C(n,function(n){n.fold(function(n){e.push(n)},function(n){t.push(n)})}),{errors:e,values:t}}(n);return 0<t.errors.length?function(n){return vt.error(F(n))}(t.errors):function(n,e){return 0===n.length?vt.value(e):vt.value(xt(e,wt.apply(undefined,n)))}(t.values,e)}function Mn(n,e){return function(n,e){return p(n,e)&&n[e]!==undefined&&null!==n[e]}(n,e)}var In,Rn,An=function(t){function n(){return o}function e(n){return n(t)}var r=v(t),o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:a,isNone:c,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return An(n(t))},each:function(n){n(t)},bind:e,exists:e,forall:e,filter:function(n){return n(t)?o:f},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(c,function(n){return e(t,n)})}};return o},Fn={some:An,none:n,from:function(n){return null===n||n===undefined?f:An(n)}},Bn=Object.keys,Vn=Object.hasOwnProperty,Nn=function(n,e){for(var t=Bn(n),r=0,o=t.length;r<o;r++){var i=t[r];e(n[i],i)}},jn=function(n,r){var o={};return Nn(n,function(n,e){var t=r(n,e);o[t.k]=t.v}),o},_n=function(n,t){var r=[];return Nn(n,function(n,e){r.push(t(n,e))}),r},Pn=function(n){function e(){return t}var t=n;return{get:e,set:function(n){t=n},clone:function(){return Pn(e())}}},Hn=function(){return zn(0,0)},zn=function(n,e){return{major:n,minor:e}},Ln={nu:zn,detect:function(n,e){var t=String(e).toLowerCase();return 0===n.length?Hn():h(n,t)},unknown:Hn},Gn="Edge",Un="Chrome",$n="Opera",Wn="Firefox",Xn="Safari",qn=function(n){var e=n.current;return{current:e,version:n.version,isEdge:b(Gn,e),isChrome:b(Un,e),isIE:b("IE",e),isOpera:b($n,e),isFirefox:b(Wn,e),isSafari:b(Xn,e)}},Yn={unknown:function(){return qn({current:undefined,version:Ln.unknown()})},nu:qn,edge:v(Gn),chrome:v(Un),ie:v("IE"),opera:v($n),firefox:v(Wn),safari:v(Xn)},Kn="Windows",Jn="Android",Qn="Linux",Zn="Solaris",ne="FreeBSD",ee=function(n){var e=n.current;return{current:e,version:n.version,isWindows:T(Kn,e),isiOS:T("iOS",e),isAndroid:T(Jn,e),isOSX:T("OSX",e),isLinux:T(Qn,e),isSolaris:T(Zn,e),isFreeBSD:T(ne,e)}},te={unknown:function(){return ee({current:undefined,version:Ln.unknown()})},nu:ee,windows:v(Kn),ios:v("iOS"),android:v(Jn),linux:v(Qn),osx:v("OSX"),solaris:v(Zn),freebsd:v(ne)},re=O("string"),oe=O("object"),ie=O("array"),ue=O("boolean"),ce=O("function"),ae=O("number"),fe=Array.prototype.slice,se=Array.prototype.indexOf,le=Array.prototype.push,de=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},me=(ce(Array.from)&&Array.from,function(n,t){return P(n,t).map(function(n){var e=Ln.detect(n.versionRegexes,t);return{current:n.name,version:e}})}),ge=function(n,t){return P(n,t).map(function(n){var e=Ln.detect(n.versionRegexes,t);return{current:n.name,version:e}})},pe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,he=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return H(n,"edge/")&&H(n,"chrome")&&H(n,"safari")&&H(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,pe],search:function(n){return H(n,"chrome")&&!H(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return H(n,"msie")||H(n,"trident")}},{name:"Opera",versionRegexes:[pe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:z("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:z("firefox")},{name:"Safari",versionRegexes:[pe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(H(n,"safari")||H(n,"mobile/"))&&H(n,"applewebkit")}}],ve=[{name:"Windows",search:z("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return H(n,"iphone")||H(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:z("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:z("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:z("linux"),versionRegexes:[]},{name:"Solaris",search:z("sunos"),versionRegexes:[]},{name:"FreeBSD",search:z("freebsd"),versionRegexes:[]}],ye={browsers:v(he),oses:v(ve)},be=Pn(function(n,e){var t=ye.browsers(),r=ye.oses(),o=me(t,n).fold(Yn.unknown,Yn.nu),i=ge(r,n).fold(te.unknown,te.nu);return{browser:o,os:i,deviceType:function(n,e,t,r){var o=n.isiOS()&&!0===/ipad/i.test(t),i=n.isiOS()&&!o,u=n.isiOS()||n.isAndroid(),c=u||r("(pointer:coarse)"),a=o||!i&&u&&r("(min-device-width:768px)"),f=i||u&&!a,s=e.isSafari()&&n.isiOS()&&!1===/safari/i.test(t),l=!f&&!a&&!s;return{isiPad:v(o),isiPhone:v(i),isTablet:v(a),isPhone:v(f),isTouch:v(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:v(s),isDesktop:v(l)}}(i,o,n,e)}}(d.navigator.userAgent,function(n){return d.window.matchMedia(n).matches})),xe=v("touchstart"),we=v("touchmove"),Se=v("touchend"),Te=v("mousedown"),Oe=v("mousemove"),ke=v("mouseup"),Ee=v("mouseover"),Ce=v("keydown"),De=v("keyup"),Me=v("input"),Ie=v("change"),Re=v("click"),Ae=v("transitionend"),Fe=v("selectstart"),Be={tap:v("alloy.tap")},Ve=v("alloy.focus"),Ne=v("alloy.blur.post"),je=v("alloy.paste.post"),_e=v("alloy.receive"),Pe=v("alloy.execute"),He=v("alloy.focus.item"),ze=Be.tap,Le=v("alloy.longpress"),Ge=v("alloy.system.init"),Ue=v("alloy.system.attached"),$e=v("alloy.system.detached"),We=v("alloy.focusmanager.shifted"),Xe=v("alloy.highlight"),qe=v("alloy.dehighlight"),Ye=function(n,e,t,r){var o=x({target:e},r);n.getSystem().triggerEvent(t,e,S(o,v))},Ke=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:v(n)}},Je={fromHtml:function(n,e){var t=(e||d.document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw d.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return Ke(t.childNodes[0])},fromTag:function(n,e){var t=(e||d.document).createElement(n);return Ke(t)},fromText:function(n,e){var t=(e||d.document).createTextNode(n);return Ke(t)},fromDom:Ke,fromPoint:function(n,e,t){var r=n.dom();return Fn.from(r.elementFromPoint(e,t)).map(Ke)}},Qe=(d.Node.ATTRIBUTE_NODE,d.Node.CDATA_SECTION_NODE,d.Node.COMMENT_NODE,d.Node.DOCUMENT_NODE),Ze=(d.Node.DOCUMENT_TYPE_NODE,d.Node.DOCUMENT_FRAGMENT_NODE,d.Node.ELEMENT_NODE),nt=d.Node.TEXT_NODE,et=(d.Node.PROCESSING_INSTRUCTION_NODE,d.Node.ENTITY_REFERENCE_NODE,d.Node.ENTITY_NODE,d.Node.NOTATION_NODE,"undefined"!=typeof d.window?d.window:Function("return this;")(),Y(Ze)),tt=Y(nt),rt=X(function(){return ot(Je.fromDom(d.document))}),ot=function(n){var e=n.dom().body;if(null===e||e===undefined)throw new Error("Body is not available yet");return Je.fromDom(e)},it=function(n,e){return en(n,e,d.Node.DOCUMENT_POSITION_CONTAINED_BY)},ut=Ze,ct=Qe,at=(L().browser.isIE(),function(n){return de(n.dom().childNodes,Je.fromDom)}),ft=(J("element","offset"),function(n,e){n.dom().appendChild(e.dom())}),st=function(n){var e=n.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},lt=function(n){G(n,$e());var e=n.components();C(e,lt)},dt=function(n){var e=n.components();C(e,dt),G(n,Ue())},mt=function(n,e,t){n.getSystem().addToWorld(e),t(n.element(),e.element()),K(n.element())&&dt(e),n.syncComponents()},gt=function(n,e,t){t(n,e.element());var r=at(e.element());C(r,function(n){e.getByDom(n).each(dt)})},pt=function(t){return{is:function(n){return t===n},isValue:a,isError:c,getOr:v(t),getOrThunk:v(t),getOrDie:v(t),or:function(n){return pt(t)},orThunk:function(n){return pt(t)},fold:function(n,e){return e(t)},map:function(n){return pt(n(t))},mapError:function(n){return pt(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 Fn.some(t)}}},ht=function(t){return{is:c,isValue:c,isError:a,getOr:y,getOrThunk:function(n){return n()},getOrDie:function(){return o(String(t))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return ht(t)},mapError:function(n){return ht(n(t))},each:w,bind:function(n){return ht(t)},exists:c,forall:a,toOption:Fn.none}},vt={value:pt,error:ht,fromOption:function(n,e){return n.fold(function(){return ht(e)},pt)}},yt=function(u){if(!ie(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 C(u,function(n,r){var e=Bn(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(!ie(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=Bn(n);if(c.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+e.join(","));if(!V(c,function(n){return k(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){d.console.log(n,{constructors:c,constructor:o,params:t})}}}}),t},bt=Object.prototype.hasOwnProperty,xt=bn(function(n,e){return oe(n)&&oe(e)?xt(n,e):e}),wt=bn(function(n,e){return e}),St=yt([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Tt=St.strict,Ot=St.asOption,kt=St.defaultedThunk,Et=St.mergeWithThunk,Ct=(yt([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n){return wn(n)}),Dt=function(n,e){return Sn(n,e)};(Rn=In=In||{})[Rn.Error=0]="Error",Rn[Rn.Value=1]="Value";function Mt(n,e,t){return n.stype===In.Error?e(n.serror):t(n.svalue)}function It(n){return{stype:In.Value,svalue:n}}function Rt(n){return{stype:In.Error,serror:n}}function At(n){return i(gr,F)(n)}function Ft(n){return oe(n)&&100<Bn(n).length?" removed due to size":JSON.stringify(n,null,2)}function Bt(n,e){return gr([{path:n,getErrorInfo:e}])}function Vt(n,e,t){return Sn(e,t).fold(function(){return function(n,e,t){return Bt(n,function(){return'Could not find valid *strict* value for "'+e+'" in '+Ft(t)})}(n,t,e)},dr)}function Nt(n,e,t){var r=Sn(n,e).fold(function(){return t(n)},y);return dr(r)}function jt(u,c,n,a){return n.fold(function(r,t,n,o){function i(n){var e=o.extract(u.concat([r]),a,n);return vr(e,function(n){return Tn(t,a(n))})}function e(n){return n.fold(function(){var n=Tn(t,a(Fn.none()));return dr(n)},function(n){var e=o.extract(u.concat([r]),a,n);return vr(e,function(n){return Tn(t,a(Fn.some(n)))})})}return n.fold(function(){return pr(Vt(u,c,r),i)},function(n){return pr(Nt(c,r,n),i)},function(){return pr(function(n,e){return dr(Sn(n,e))}(c,r),e)},function(n){return pr(function(e,n,t){var r=Sn(e,n).map(function(n){return!0===n?t(e):n});return dr(r)}(c,r,n),e)},function(n){var e=n(c),t=vr(Nt(c,r,v({})),function(n){return xt(e,n)});return pr(t,i)})},function(n,e){var t=e(c);return dr(Tn(n,a(t)))})}function _t(r){return{extract:function(e,n,t){return hr(r(t,n),function(n){return function(n,e){return Bt(n,function(){return e})}(e,n)})},toString:function(){return"val"},toDsl:function(){return wr.itemOf(r)}}}function Pt(n){var i=Or(n),u=M(n,function(e,n){return n.fold(function(n){return xt(e,En(n,!0))},v(e))},{});return{extract:function(n,e,t){var r=ue(t)?[]:function(e){var n=Bn(e);return D(n,function(n){return Mn(e,n)})}(t),o=D(r,function(n){return!Mn(u,n)});return 0===o.length?i.extract(n,e,t):function(n,e){return Bt(n,function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"})}(n,o)},toString:i.toString,toDsl:i.toDsl}}function Ht(t,i){function u(n,e){return function(o){return{extract:function(t,r,n){var e=de(n,function(n,e){return o.extract(t.concat(["["+e+"]"]),r,n)});return xr(e)},toString:function(){return"array("+o.toString()+")"},toDsl:function(){return wr.arrOf(o)}}}(_t(t)).extract(n,y,e)}return{extract:function(t,r,o){var n=Bn(o),e=u(t,n);return pr(e,function(n){var e=de(n,function(n){return Tr.field(n,n,Tt(),i)});return Or(e).extract(t,r,o)})},toString:function(){return"setOf("+i.toString()+")"},toDsl:function(){return wr.setOf(t,i)}}}function zt(e,t,r,n,o){return Dt(n,o).fold(function(){return function(n,e,t){return Bt(n,function(){return'The chosen schema: "'+t+'" did not exist in branches: '+Ft(e)})}(e,n,o)},function(n){return n.extract(e.concat(["branch: "+o]),t,r)})}function Lt(n,o){return{extract:function(e,t,r){return Dt(r,n).fold(function(){return function(n,e){return Bt(n,function(){return'Choice schema did not contain choice key: "'+e+'"'})}(e,n)},function(n){return zt(e,t,r,o,n)})},toString:function(){return"chooseOn("+n+"). Possible values: "+Bn(o)},toDsl:function(){return wr.choiceOf(n,o)}}}function Gt(e){return _t(function(n){return e(n).fold(gr,dr)})}function Ut(e,n){return Ht(function(n){return sr(e(n))},n)}function $t(n,e,t){return lr(function(n,e,t,r){var o=e.extract([n],t,r);return yr(o,function(n){return{input:r,errors:n}})}(n,e,y,t))}function Wt(n){return n.fold(function(n){throw new Error(Mr(n))},y)}function Xt(n,e,t){return Wt($t(n,e,t))}function qt(n,e){return Lt(n,S(e,Or))}function Yt(n){return Cr(n,n,Tt(),kr())}function Kt(n,e){return Cr(n,n,Tt(),e)}function Jt(n,e){return Cr(n,n,Tt(),Or(e))}function Qt(n){return Cr(n,n,Ot(),kr())}function Zt(n,e){return Cr(n,n,Ot(),e)}function nr(n,e){return Zt(n,Or(e))}function er(n,e){return Zt(n,Pt(e))}function tr(n,e){return Cr(n,n,xn(e),kr())}function rr(n,e,t){return Cr(n,n,xn(e),t)}function or(n,e){return Er(n,e)}function ir(n,e){return cn(n.element(),e.event().target())}function ur(n){if(!Mn(n,"can")&&!Mn(n,"abort")&&!Mn(n,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(n,null,2)+" does not have can, abort, or run!");return Xt("Extracting event.handler",Pt([tr("can",v(!0)),tr("abort",v(!1)),tr("run",w)]),n)}function cr(t){var n=function(e,r){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return I(e,function(n,e){return n&&r(e).apply(undefined,t)},!0)}}(t,function(n){return n.can}),e=function(e,r){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return I(e,function(n,e){return n||r(e).apply(undefined,t)},!1)}}(t,function(n){return n.abort});return ur({can:n,abort:e,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];C(t,function(n){n.run.apply(undefined,e)})}})}var ar,fr,sr=function(n){return n.fold(Rt,It)},lr=function(n){return Mt(n,vt.error,vt.value)},dr=It,mr=function(n){var e=[],t=[];return C(n,function(n){Mt(n,function(n){return t.push(n)},function(n){return e.push(n)})}),{values:e,errors:t}},gr=Rt,pr=function(n,e){return n.stype===In.Value?e(n.svalue):n},hr=function(n,e){return n.stype===In.Error?e(n.serror):n},vr=function(n,e){return n.stype===In.Value?{stype:In.Value,svalue:e(n.svalue)}:n},yr=function(n,e){return n.stype===In.Error?{stype:In.Error,serror:e(n.serror)}:n},br=function(n,e){var t=mr(n);return 0<t.errors.length?At(t.errors):function(n,e){return 0<n.length?dr(xt(e,wt.apply(undefined,n))):dr(e)}(t.values,e)},xr=function(n){var e=mr(n);return 0<e.errors.length?At(e.errors):dr(e.values)},wr=yt([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),Sr=yt([{field:["name","presence","type"]},{state:["name"]}]),Tr=yt([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Or=function(r){return{extract:function(n,e,t){return function(e,t,n,r){var o=de(n,function(n){return jt(e,t,n,r)});return br(o,{})}(n,t,r,e)},toString:function(){return"obj{\n"+de(r,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 wr.objOf(de(r,function(n){return n.fold(function(n,e,t,r){return Sr.field(n,t,r)},function(n,e){return Sr.state(n)})}))}}},kr=v(_t(dr)),Er=Tr.state,Cr=Tr.field,Dr=_t(dr),Mr=function(n){return"Errors: \n"+function(n){var e=10<n.length?n.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):n;return de(e,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()})}(n.errors)+"\n\nInput object: "+Ft(n.input)},Ir=v(Dr),Rr=(ar=ce,fr="function",_t(function(n){var e=typeof n;return ar(n)?dr(n):gr("Expected type: "+fr+" but got: "+e)}));function Ar(n,e,t,r,o){return n(t,r)?Fn.some(t):ce(o)&&o(t)?Fn.none():e(t,r,o)}function Fr(n,e,t){for(var r=n.dom(),o=ce(t)?t:v(!1);r.parentNode;){r=r.parentNode;var i=Je.fromDom(r);if(e(i))return Fn.some(i);if(o(i))break}return Fn.none()}function Br(n,e,t){return Ar(function(n,e){return e(n)},Fr,n,e,t)}function Vr(n,o){var i=function(n){for(var e=0;e<n.childNodes.length;e++){var t=Je.fromDom(n.childNodes[e]);if(o(t))return Fn.some(t);var r=i(n.childNodes[e]);if(r.isSome())return r}return Fn.none()};return i(n.dom())}function Nr(n){return Cn(n)}function jr(n,e){return{key:n,value:ur({abort:e})}}function _r(n,e){return{key:n,value:ur({run:e})}}function Pr(n,e,t){return{key:n,value:ur({run:function(n){e.apply(undefined,[n].concat(t))}})}}function Hr(n){return function(t){return{key:n,value:ur({run:function(n,e){ir(n,e)&&t(n,e)}})}}}function zr(n,e,t){return function(t,r){return _r(t,function(n,e){n.getSystem().getByUid(r).each(function(n){!function(n,e,t,r){n.getSystem().triggerEvent(t,e,r.event())}(n,n.element(),t,e)})})}(n,e.partUids[t])}function Lr(n){return _r(n,function(n,e){e.cut()})}function Gr(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:Io(i)}},n}function Ur(n){return{classes:n.classes!==undefined?n.classes:[],attributes:n.attributes!==undefined?n.attributes:{},styles:n.styles!==undefined?n.styles:{}}}function $r(t,r,o){return Do(function(n,e){o(n,t,r)})}function Wr(o,i,u){return function(n,e,t){var r=t.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:e,parameters:Io(u.slice(0,1).concat(u.slice(3)))}},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:v(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))})},u,i)}function Xr(n){return{key:n,value:undefined}}function qr(n){var e=Xt("Creating behaviour: "+n.name,Vo,n);return function(n,e,t,r,o,i){var u=Pt(n),c=nr(e,[er("config",n)]);return Ro(u,c,e,t,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)}function Yr(n,e,t){if(!(re(t)||ue(t)||ae(t)))throw d.console.error("Invalid call to Attr.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")}function Kr(n,e,t){Yr(n.dom(),e,t)}function Jr(n,e){var t=n.dom();Nn(e,function(n,e){Yr(t,e,n)})}function Qr(n,e){var t=n.dom().getAttribute(e);return null===t?undefined:t}function Zr(n,e){var t=n.dom();return!(!t||!t.hasAttribute)&&t.hasAttribute(e)}function no(n,e){n.dom().removeAttribute(e)}function eo(n,e){var t=Qr(n,e);return t===undefined||""===t?[]:t.split(" ")}function to(n){return n.dom().classList!==undefined}function ro(n,e){return function(n,e,t){var r=eo(n,e).concat([t]);return Kr(n,e,r.join(" ")),!0}(n,"class",e)}function oo(n,e){return function(n,e,t){var r=D(eo(n,e),function(n){return n!==t});return 0<r.length?Kr(n,e,r.join(" ")):no(n,e),!1}(n,"class",e)}function io(n,e){to(n)?n.dom().classList.add(e):ro(n,e)}function uo(n){0===(to(n)?n.dom().classList:function(n){return eo(n,"class")}(n)).length&&no(n,"class")}function co(n,e){to(n)?n.dom().classList.remove(e):oo(n,e),uo(n)}function ao(n,e){return to(n)&&n.dom().classList.contains(e)}function fo(n,e,t){co(n,t),io(n,e)}function so(n){n.dom().focus()}function lo(n){n.dom().blur()}function mo(n){var e=n!==undefined?n.dom():d.document;return Fn.from(e.activeElement).map(Je.fromDom)}function go(e){return mo(an(e)).filter(function(n){return e.dom().contains(n.dom())})}function po(n){return n.dom().innerHTML}function ho(n,e){var t=an(n).dom(),r=Je.fromDom(t.createDocumentFragment()),o=function(n,e){var t=(e||d.document).createElement("div");return t.innerHTML=n,at(Je.fromDom(t))}(e,t);gn(r,o),pn(n),ft(n,r)}function vo(n){return function(n,e){return Je.fromDom(n.dom().cloneNode(e))}(n,!1)}function yo(n){return function(n){var e=Je.fromTag("div"),t=Je.fromDom(n.dom().cloneNode(!0));return ft(e,t),po(e)}(vo(n))}function bo(n){return yo(n)}function xo(n){for(var e=[],t=function(n){e.push(n)},r=0;r<n.length;r++)n[r].each(t);return e}function wo(n,e){for(var t=0;t<n.length;t++){var r=e(n[t],t);if(r.isSome())return r}return Fn.none()}var So,To,Oo,ko=function(n,e,t){return Br(n,function(n){return e(n).isSome()},t).bind(e)},Eo=Hr(Ue()),Co=Hr($e()),Do=Hr(Ge()),Mo=(So=Pe(),function(n){return _r(So,n)}),Io=function(n){return de(n,function(n){return function(n,e){return function(n,e,t){return""===e||!(n.length<e.length)&&n.substr(t,t+e.length)===e}(n,e,n.length-e.length)}(n,"/*")?n.substring(0,n.length-"/*".length):n})},Ro=function(t,n,r,o,e,i,u){function c(n){return Mn(n,r)?n[r]():Fn.none()}var a=S(e,function(n,e){return Wr(r,n,e)}),f=S(i,function(n,e){return Gr(n,e)}),s=x(x(x({},f),a),{revoke:l(Xr,r),config:function(n){var e=Xt(r+"-config",t,n);return{key:r,value:{config:e,me:s,configAsRaw:X(function(){return Xt(r+"-config",t,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,t){return c(n).bind(function(e){return Dt(o,"exhibit").map(function(n){return n(t,e.config,e.state)})}).getOr(Ur({}))},name:function(){return r},handlers:function(n){return c(n).map(function(n){return kn("events",function(n,e){return{}})(o)(n.config,n.state)}).getOr({})}});return s},Ao={init:function(){return Fo({readState:function(){return"No State required"}})}},Fo=function(n){return n},Bo=function(n){return Cn(n)},Vo=Pt([Yt("fields"),Yt("name"),tr("active",{}),tr("apis",{}),tr("state",Ao),tr("extra",{})]),No=Pt([Yt("branchKey"),Yt("branches"),Yt("name"),tr("active",{}),tr("apis",{}),tr("state",Ao),tr("extra",{})]),jo=v(undefined),_o=/* */Object.freeze({toAlpha:function(n,e,t){fo(n.element(),e.alpha,e.omega)},toOmega:function(n,e,t){fo(n.element(),e.omega,e.alpha)},isAlpha:function(n,e,t){return ao(n.element(),e.alpha)},isOmega:function(n,e,t){return ao(n.element(),e.omega)},clear:function(n,e,t){co(n.element(),e.alpha),co(n.element(),e.omega)}}),Po=[Yt("alpha"),Yt("omega")],Ho=qr({fields:Po,name:"swapping",apis:_o}),zo=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Lo=tinymce.util.Tools.resolve("tinymce.ThemeManager"),Go=function(n){var e=d.document.createElement("a");e.target="_blank",e.href=n.href,e.rel="noreferrer noopener";var t=d.document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,d.window,0,0,0,0,0,!1,!1,!1,!1,0,null),d.document.body.appendChild(e),e.dispatchEvent(t),d.document.body.removeChild(e)},Uo={formatChanged:v("formatChanged"),orientationChanged:v("orientationChanged"),dropupDismissed:v("dropupDismissed")},$o=/* */Object.freeze({events:function(e){return Nr([_r(_e(),function(o,i){var u=e.channels,n=function(n,e){return e.universal()?n:D(n,function(n){return k(e.channels(),n)})}(Bn(u),i);C(n,function(n){var e=u[n],t=e.schema,r=Xt("channel["+n+"] data\nReceiver: "+bo(o.element()),t,i.data());e.onReceive(o,r)})})])}}),Wo="unknown";(Oo=To=To||{})[Oo.STOP=0]="STOP",Oo[Oo.NORMAL=1]="NORMAL",Oo[Oo.LOGGING=2]="LOGGING";function Xo(e,n,t){switch(Dt(yi.get(),e).orThunk(function(){var n=Bn(yi.get());return wo(n,function(n){return-1<e.indexOf(n)?Fn.some(yi.get()[n]):Fn.none()})}).getOr(To.NORMAL)){case To.NORMAL:return t(xi());case To.LOGGING:var r=function(e,t){var r=[],o=(new Date).getTime();return{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(){var n=(new Date).getTime();k(["mousemove","mouseover","mouseout",Ge()],e)||d.console.log(e,{event:e,time:n-o,target:t.dom(),sequence:de(r,function(n){return k(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+bo(n.target)+")":n.outcome})})}}}(e,n),o=t(r);return r.write(),o;case To.STOP:return!0}}function qo(n,e,t){return Xo(n,e,t)}function Yo(n,e,t){return function(){var n=new Error;if(n.stack===undefined)return;var e=n.stack.split("\n");R(e,function(e){return 0<e.indexOf("alloy")&&!E(bi,function(n){return-1<e.indexOf(n)})}).getOr(Wo)}(),Cr(e,e,t,Gt(function(t){return vt.value(function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.apply(undefined,n)})}))}function Ko(n){return Yo(0,n,xn(w))}function Jo(n){return Yo(0,n,xn(Fn.none))}function Qo(n){return Yo(0,n,Tt())}function Zo(n){return Yo(0,n,Tt())}function ni(n,e){return or(n,v(e))}function ei(n){return or(n,y)}function ti(n,e,t){var r=e.aria;r.update(n,r,t.get())}function ri(e,n,t){n.toggleClass.each(function(n){t.get()?io(e.element(),n):co(e.element(),n)})}function oi(n,e,t){Di(n,e,t,!t.get())}function ii(n,e,t){t.set(!0),ri(n,e,t),ti(n,e,t)}function ui(n,e,t){t.set(!1),ri(n,e,t),ti(n,e,t)}function ci(n,e,t){Di(n,e,t,e.selected)}function ai(){return[_r(L().deviceType.isTouch()?Be.tap():Re(),function(n,e){e.stop(),$(n)}),Lr(L().deviceType.isTouch()?xe():Te())]}function fi(n,e){e.ignore||(so(n.element()),e.onFocus(n))}function si(n){return n.style!==undefined&&ce(n.style.getPropertyValue)}function li(n,e,t){if(!re(t))throw d.console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);si(n)&&n.style.setProperty(e,t)}function di(n,e){var t=n.dom();Nn(e,function(n,e){li(t,e,n)})}function mi(n,e){var t=n.dom(),r=d.window.getComputedStyle(t).getPropertyValue(e),o=""!==r||K(n)?r:Ui(t,e);return null===o?undefined:o}function gi(n,e){var t=n.dom(),r=Ui(t,e);return Fn.from(r).filter(function(n){return 0<n.length})}function pi(n,e){!function(n,e){si(n)&&n.style.removeProperty(e)}(n.dom(),e),Zr(n,"style")&&""===function(n){return n.replace(/^\s+|\s+$/g,"")}(Qr(n,"style"))&&no(n,"style")}function hi(n){return n.dom().offsetWidth}var vi,yi=Pn({}),bi=["alloy/data/Fields","alloy/debugging/Debugging"],xi=v({logEventCut:w,logEventStopped:w,logNoParent:w,logEventNoHandlers:w,logEventResponse:w,write:w}),wi=v([Yt("menu"),Yt("selectedMenu")]),Si=v([Yt("item"),Yt("selectedItem")]),Ti=(v(Or(Si().concat(wi()))),v(Or(Si()))),Oi=Jt("initSize",[Yt("numColumns"),Yt("numRows")]),ki=v(Oi),Ei=[Kt("channels",Ut(vt.value,Pt([Qo("onReceive"),tr("schema",Ir())])))],Ci=qr({fields:Ei,name:"receiving",active:$o}),Di=function(n,e,t,r){(r?ii:ui)(n,e,t)},Mi=/* */Object.freeze({onLoad:ci,toggle:oi,isOn:function(n,e,t){return t.get()},on:ii,off:ui,set:Di}),Ii=/* */Object.freeze({exhibit:function(n,e,t){return Ur({})},events:function(n,e){var t=function(e,t,r){return Mo(function(n){r(n,e,t)})}(n,e,oi),r=$r(n,e,ci);return Nr(F([n.toggleOnExecute?[t]:[],[r]]))}}),Ri=function(n,e,t){Kr(n.element(),"aria-expanded",t)},Ai=[tr("selected",!1),Qt("toggleClass"),tr("toggleOnExecute",!0),rr("aria",{mode:"none"},qt("mode",{pressed:[tr("syncWithExpanded",!1),ni("update",function(n,e,t){Kr(n.element(),"aria-pressed",t),e.syncWithExpanded&&Ri(n,e,t)})],checked:[ni("update",function(n,e,t){Kr(n.element(),"aria-checked",t)})],expanded:[ni("update",Ri)],selected:[ni("update",function(n,e,t){Kr(n.element(),"aria-selected",t)})],none:[ni("update",w)]}))],Fi=qr({fields:Ai,name:"toggling",active:Ii,apis:Mi,state:(vi=!1,{init:function(){var e=Pn(vi);return{get:function(){return e.get()},set:function(n){return e.set(n)},clear:function(){return e.set(vi)},readState:function(){return e.get()}}}})}),Bi=function(t,r){return Ci.config({channels:En(Uo.formatChanged(),{onReceive:function(n,e){e.command===t&&r(n,e.state)}})})},Vi=function(n){return Ci.config({channels:En(Uo.orientationChanged(),{onReceive:n})})},Ni=function(n,e){return{key:n,value:{onReceive:e}}},ji="tinymce-mobile",_i={resolve:function(n){return ji+"-"+n},prefix:v(ji)},Pi=/* */Object.freeze({focus:fi,blur:function(n,e){e.ignore||lo(n.element())},isFocused:function(n){return function(n){var e=an(n).dom();return n.dom()===e.activeElement}(n.element())}}),Hi=/* */Object.freeze({exhibit:function(n,e){var t=e.ignore?{}:{attributes:{tabindex:"-1"}};return Ur(t)},events:function(t){return Nr([_r(Ve(),function(n,e){fi(n,t),e.stop()})].concat(t.stopMousedown?[_r(Te(),function(n,e){e.event().prevent()})]:[]))}}),zi=[Ko("onFocus"),tr("stopMousedown",!1),tr("ignore",!1)],Li=qr({fields:zi,name:"focusing",active:Hi,apis:Pi}),Gi=function(n,e,t){var r=n.dom();li(r,e,t)},Ui=function(n,e){return si(n)?n.style.getPropertyValue(e):""};function $i(r,o){function n(n){var e=o(n);if(e<=0||null===e){var t=mi(n,r);return parseFloat(t)||0}return e}function i(o,n){return I(n,function(n,e){var t=mi(o,e),r=t===undefined?0:parseInt(t,10);return isNaN(r)?n:n+r},0)}return{set:function(n,e){if(!ae(e)&&!e.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+e);var t=n.dom();si(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}}}function Wi(n){return yu.get(n)}function Xi(n,e,t){return D(function(n,e){for(var t=ce(e)?e:c,r=n.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=Je.fromDom(i);if(o.push(u),!0===t(u))break;r=i}return o}(n,t),e)}function qi(n,e){return D(function(e){return fn(e).map(at).map(function(n){return D(n,function(n){return!cn(e,n)})}).getOr([])}(n),e)}function Yi(n,e){return on(e,n)}function Ki(n){return un(n)}function Ji(n,e,t){return Fr(n,function(n){return tn(n,e)},t)}function Qi(n,e){return un(e,n)}function Zi(n,e,t){return Ar(tn,Ji,n,e,t)}function nu(n,e,t){var r=N(n.slice(0,e)),o=N(n.slice(e+1));return R(r.concat(o),t)}function eu(n,e,t){var r=N(n.slice(0,e));return R(r,t)}function tu(n,e,t){var r=n.slice(0,e),o=n.slice(e+1);return R(o.concat(r),t)}function ru(n,e,t){var r=n.slice(e+1);return R(r,t)}function ou(t){return function(n){var e=n.raw();return k(t,e.which)}}function iu(n){return function(e){return V(n,function(n){return n(e)})}}function uu(n){return!0===n.raw().shiftKey}function cu(n){return!0===n.raw().ctrlKey}function au(n,e){return{matches:n,classification:e}}function fu(n,e,t,r){var o=n+e;return r<o?t:o<t?r:o}function su(n,e,t){return n<=e?e:t<=n?t:n}function lu(t,r,n,o){var e=Yi(t.element(),"."+r.highlightClass);C(e,function(e){E(o,function(n){return n.element()===e})||(co(e,r.highlightClass),t.getSystem().getByDom(e).each(function(n){r.onDehighlight(t,n),G(n,qe())}))})}function du(n,e,t,r){lu(n,e,0,[r]),xu(n,e,t,r)||(io(r.element(),e.highlightClass),e.onHighlight(n,r),G(r,Xe()))}function mu(t,e,n,r){var o=Yi(t.element(),"."+e.itemClass);return A(o,function(n){return ao(n,e.highlightClass)}).bind(function(n){var e=fu(n,r,0,o.length-1);return t.getSystem().getByDom(o[e]).toOption()})}function gu(n,e,t){e.exists(function(e){return t.exists(function(n){return cn(n,e)})})||U(n,We(),{prevFocus:e,newFocus:t})}function pu(){function o(n){return go(n.element())}return{get:o,set:function(n,e){var t=o(n);n.getSystem().triggerFocus(e,n.element());var r=o(n);gu(n,t,r)}}}var hu,vu,yu=$i("height",function(n){var e=n.dom();return K(n)?e.getBoundingClientRect().height:e.offsetHeight}),bu=m(uu),xu=function(n,e,t,r){return ao(r.element(),e.highlightClass)},wu=function(n,e,t,r){var o=Yi(n.element(),"."+e.itemClass);return Fn.from(o[r]).fold(function(){return vt.error("No element found with index "+r)},n.getSystem().getByDom)},Su=function(e,n,t){return Qi(e.element(),"."+n.itemClass).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Tu=function(e,n,t){var r=Yi(e.element(),"."+n.itemClass);return(0<r.length?Fn.some(r[r.length-1]):Fn.none()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Ou=function(e,n,t){var r=Yi(e.element(),"."+n.itemClass);return xo(de(r,function(n){return e.getSystem().getByDom(n).toOption()}))},ku=/* */Object.freeze({dehighlightAll:function(n,e,t){return lu(n,e,0,[])},dehighlight:function(n,e,t,r){xu(n,e,t,r)&&(co(r.element(),e.highlightClass),e.onDehighlight(n,r),G(r,qe()))},highlight:du,highlightFirst:function(e,t,r){Su(e,t).each(function(n){du(e,t,r,n)})},highlightLast:function(e,t,r){Tu(e,t).each(function(n){du(e,t,r,n)})},highlightAt:function(e,t,r,n){wu(e,t,r,n).fold(function(n){throw new Error(n)},function(n){du(e,t,r,n)})},highlightBy:function(e,t,r,n){var o=Ou(e,t);R(o,n).each(function(n){du(e,t,r,n)})},isHighlighted:xu,getHighlighted:function(e,n,t){return Qi(e.element(),"."+n.highlightClass).bind(function(n){return e.getSystem().getByDom(n).toOption()})},getFirst:Su,getLast:Tu,getPrevious:function(n,e,t){return mu(n,e,0,-1)},getNext:function(n,e,t){return mu(n,e,0,1)},getCandidates:Ou}),Eu=[Yt("highlightClass"),Yt("itemClass"),Ko("onHighlight"),Ko("onDehighlight")],Cu=qr({fields:Eu,name:"highlighting",apis:ku});(vu=hu=hu||{}).OnFocusMode="onFocus",vu.OnEnterOrSpaceMode="onEnterOrSpace",vu.OnApiMode="onApi";function Du(n,e,t,i,u){function c(e,t,n,r,o){return function(n,e){return R(n,function(n){return n.matches(e)}).map(function(n){return n.classification})}(n(e,t,r,o),t.event()).bind(function(n){return n(e,t,r,o)})}var r={schema:function(){return n.concat([tr("focusManager",pu()),rr("focusInside","onFocus",Gt(function(n){return k(["onFocus","onEnterOrSpace","onApi"],n)?vt.value(n):vt.error("Invalid value for focusInside")})),ni("handler",r),ni("state",e),ni("sendFocusIn",u)])},processKey:c,toEvents:function(r,o){var n=r.focusInside!==hu.OnFocusMode?Fn.none():u(r).map(function(t){return _r(Ve(),function(n,e){t(n,r,o),e.stop()})});return Nr(n.toArray().concat([_r(Ce(),function(n,e){c(n,e,t,r,o).fold(function(){!function(e,t){var n=ou([32].concat([13]))(t.event());r.focusInside===hu.OnEnterOrSpaceMode&&n&&ir(e,t)&&u(r).each(function(n){n(e,r,o),t.stop()})}(n,e)},function(n){e.stop()})}),_r(De(),function(n,e){c(n,e,i,r,o).each(function(n){e.stop()})})]))}};return r}function Mu(n){function i(n,e){var t=n.visibilitySelector.bind(function(n){return Zi(e,n)}).getOr(e);return 0<Wi(t)}function e(e,t){(function(n,e){var t=Yi(n.element(),e.selector),r=D(t,function(n){return i(e,n)});return Fn.from(r[e.firstTabstop])})(e,t).each(function(n){t.focusManager.set(e,n)})}function u(e,n,t,r,o){return o(n,t,function(n){return function(n,e){return i(n,e)&&n.useTabstopAt(e)}(r,n)}).fold(function(){return r.cyclic?Fn.some(!0):Fn.none()},function(n){return r.focusManager.set(e,n),Fn.some(!0)})}function c(e,n,t,r){var o=Yi(e.element(),t.selector);return function(n,e){return e.focusManager.get(n).bind(function(n){return Zi(n,e.selector)})}(e,t).bind(function(n){return A(o,l(cn,n)).bind(function(n){return u(e,o,n,t,r)})})}var t=[Qt("onEscape"),Qt("onEnter"),tr("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),tr("firstTabstop",0),tr("useTabstopAt",v(!0)),Qt("visibilitySelector")].concat([n]),r=v([au(iu([uu,ou([9])]),function(n,e,t,r){var o=t.cyclic?nu:eu;return c(n,0,t,o)}),au(ou([9]),function(n,e,t,r){var o=t.cyclic?tu:ru;return c(n,0,t,o)}),au(ou([27]),function(e,t,n,r){return n.onEscape.bind(function(n){return n(e,t)})}),au(iu([bu,ou([13])]),function(e,t,n,r){return n.onEnter.bind(function(n){return n(e,t)})})]),o=v([]);return Du(t,Ao.init,r,o,function(){return Fn.some(e)})}function Iu(n){return"input"===q(n)&&"radio"!==Qr(n,"type")||"textarea"===q(n)}function Ru(n,e,t){return Iu(t)&&ou([32])(e.event())?Fn.none():function(n,e,t){return W(n,t,Pe()),Fn.some(!0)}(n,0,t)}function Au(n,e){return Fn.some(!0)}function Fu(n,e,t){return t.execute(n,e,n.element())}function Bu(n){var t=Pn(Fn.none());return Fo({readState:function(){return t.get().map(function(n){return{numRows:n.numRows(),numColumns:n.numColumns()}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(n,e){t.set(Fn.some({numRows:v(n),numColumns:v(e)}))},getNumRows:function(){return t.get().map(function(n){return n.numRows()})},getNumColumns:function(){return t.get().map(function(n){return n.numColumns()})}})}function Vu(e,t){return function(n){return"rtl"===Yc(n)?t:e}}function Nu(i){return function(n,e,t,r){var o=i(n.element());return Kc(o,n,e,t,r)}}function ju(n,e){var t=Vu(n,e);return Nu(t)}function _u(n,e){var t=Vu(e,n);return Nu(t)}function Pu(o){return function(n,e,t,r){return Kc(o,n,e,t,r)}}function Hu(n){return!function(n){return n.offsetWidth<=0&&n.offsetHeight<=0}(n.dom())}function zu(n,e,t){var r=l(cn,e),o=Yi(n,t);return function(e,n){return A(e,n).map(function(n){return na({index:n,candidates:e})})}(D(o,Hu),r)}function Lu(n,e){return A(n,function(n){return cn(e,n)})}function Gu(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?Fn.some(t[e]):Fn.none()})}function Uu(o,n,i,u,c){return Gu(o,n,u,function(n,e){var t=n===i-1?o.length-n*u:u,r=fu(e,c,0,t-1);return Fn.some({row:v(n),column:v(r)})})}function $u(i,n,u,c,a){return Gu(i,n,c,function(n,e){var t=fu(n,a,0,u-1),r=t===u-1?i.length-t*c:c,o=su(e,0,r-1);return Fn.some({row:v(t),column:v(o)})})}function Wu(e,t,n){Qi(e.element(),t.selector).each(function(n){t.focusManager.set(e,n)})}function Xu(o){return function(n,e,t,r){return zu(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))})}}function qu(n,e,t,r){return t.captureTab?Fn.some(!0):Fn.none()}function Yu(n,e,t,o){var i=function(n,e,t){var r=fu(e,o,0,t.length-1);return r===n?Fn.none():function(n){return"button"===q(n)&&"disabled"===Qr(n,"disabled")}(t[r])?i(n,r,t):Fn.from(t[r])};return zu(n,t,e).bind(function(n){var e=n.index(),t=n.candidates();return i(e,e,t)})}function Ku(e,t,r){return function(n,e){return e.focusManager.get(n).bind(function(n){return Zi(n,e.selector)})}(e,r).bind(function(n){return r.execute(e,t,n)})}function Ju(e,t){t.getInitial(e).orThunk(function(){return Qi(e.element(),t.selector)}).each(function(n){t.focusManager.set(e,n)})}function Qu(n,e,t){return Yu(n,t.selector,e,-1)}function Zu(n,e,t){return Yu(n,t.selector,e,1)}function nc(r){return function(n,e,t){return r(n,e,t).bind(function(){return t.executeOnMove?Ku(n,e,t):Fn.some(!0)})}}function ec(n,e,t,r){return t.onEscape(n,e)}function tc(n,e,t){return Fn.from(n[e]).bind(function(n){return Fn.from(n[t]).map(function(n){return da({rowIndex:e,columnIndex:t,cell:n})})})}function rc(n,e,t,r){var o=n[e].length,i=fu(t,r,0,o-1);return tc(n,e,i)}function oc(n,e,t,r){var o=fu(t,r,0,n.length-1),i=n[o].length,u=su(e,0,i-1);return tc(n,o,u)}function ic(n,e,t,r){var o=n[e].length,i=su(t+r,0,o-1);return tc(n,e,i)}function uc(n,e,t,r){var o=su(t+r,0,n.length-1),i=n[o].length,u=su(e,0,i-1);return tc(n,o,u)}function cc(e,t){t.previousSelector(e).orThunk(function(){var n=t.selectors;return Qi(e.element(),n.cell)}).each(function(n){t.focusManager.set(e,n)})}function ac(n,e){return function(o,t,i){var u=i.cycles?n:e;return Zi(t,i.selectors.row).bind(function(n){var e=Yi(n,i.selectors.cell);return Lu(e,t).bind(function(t){var r=Yi(o,i.selectors.row);return Lu(r,n).bind(function(n){var e=function(n,e){return de(n,function(n){return Yi(n,e.selectors.cell)})}(r,i);return u(e,n,t).map(function(n){return n.cell()})})})})}}function fc(e,t,r){return r.focusManager.get(e).bind(function(n){return r.execute(e,t,n)})}function sc(e,t){Qi(e.element(),t.selector).each(function(n){t.focusManager.set(e,n)})}function lc(n,e,t){return Yu(n,t.selector,e,-1)}function dc(n,e,t){return Yu(n,t.selector,e,1)}function mc(e,n){return function(n,e,t){return rr(n,e,Or(t))}(e,{},de(n,function(n){return function(e,t){return Cr(e,e,Ot(),_t(function(n){return gr("The field: "+e+" is forbidden. "+t)}))}(n.name(),"Cannot configure "+n.name()+" for "+e)}).concat([or("dump",y)]))}function gc(n){return n.dump}function pc(n,e){return x(x({},n.dump),Bo(e))}function hc(n,e,t,r){return t.uiType===_a?function(n,e,t,r){return n.exists(function(n){return n!==t.owner})?Pa.single(!0,v(t)):Dt(r,t.name).fold(function(){throw new Error("Unknown placeholder component: "+t.name+"\nKnown: ["+Bn(r)+"]\nNamespace: "+n.getOr("none")+"\nSpec: "+JSON.stringify(t,null,2))},function(n){return n.replace()})}(n,0,t,r):Pa.single(!1,v(t))}function vc(e,t,n,r){var o=S(r,function(n,e){return function(n,e){var t=!1;return{name:v(n),required:function(){return e.fold(function(n,e){return n},function(n,e){return n})},used:function(){return t},replace:function(){if(!0===t)throw new Error("Trying to use the same placeholder more than once: "+n);return t=!0,e}}}(e,n)}),i=function(e,t,n,r){return B(n,function(n){return Ha(e,t,n,r)})}(e,t,n,o);return Nn(o,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: "+JSON.stringify(t.components,null,2))}),i}function yc(n){var e=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++Ua+String(e)}function bc(n){function e(n){return n.name}return n.fold(e,e,e,e)}function xc(t,r){return function(n){var e=Xt("Converting part type",r,n);return t(e)}}function wc(n,e,t,r){return xt(e.defaults(n,t,r),t,{uid:n.partUids[e.name]},e.overrides(n,t,r))}function Sc(o,n){var e={};return C(n,function(n){(function(n){return n.fold(Fn.some,Fn.none,Fn.some,Fn.some)})(n).each(function(t){var r=cf(o,t.pname);e[t.name]=function(n){var e=Xt("Part: "+t.name+" in "+o,Or(t.schema),n);return x(x({},r),{config:n,validated:e})}})}),e}function Tc(n,e,t){return function(n,t,e){var i={},r={};return C(e,function(n){n.fold(function(r){i[r.pname]=za(!0,function(n,e,t){return r.factory.sketch(wc(n,r,e,t))})},function(n){var e=t.parts[n.name];r[n.name]=v(n.factory.sketch(wc(t,n,e[uf()]),e))},function(r){i[r.pname]=za(!1,function(n,e,t){return r.factory.sketch(wc(n,r,e,t))})},function(o){i[o.pname]=La(!0,function(e,n,t){var r=e[o.name];return de(r,function(n){return o.factory.sketch(xt(o.defaults(e,n,t),n,o.overrides(e,n)))})})})}),{internals:v(i),externals:v(r)}}(0,e,t)}function Oc(n,e,t){return vc(Fn.some(n),e,e.components,t)}function kc(n,e,t){var r=e.partUids[t];return n.getSystem().getByUid(r).toOption()}function Ec(n,e,t){return kc(n,e,t).getOrDie("Could not find part: "+t)}function Cc(e,n){var t=function(n){return de(n,bc)}(n);return Cn(de(t,function(n){return{key:n,value:e+"-"+n}}))}function Dc(e){return Cr("partUids","partUids",Et(function(n){return Cc(n.uid,e)}),Ir())}function Mc(n){return En(af,n)}function Ic(r){return function(n,e){var t=e.toString(),r=t.indexOf(")")+1,o=t.indexOf("("),i=t.substring(o+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Io(i.slice(1))}},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)))},r)}function Rc(n){return yc(n)}function Ac(n,e,t,r,o){var i=function(n,e){return(0<n.length?[Jt("parts",n)]:[]).concat([Yt("uid"),tr("dom",{}),tr("components",[]),ei("originalSpec"),tr("debug.sketcher",{})]).concat(e)}(r,o);return Xt(n+" [SpecSchema]",Pt(i.concat(e)),t)}function Fc(n,e,t,r,o){var i=pf(o),u=function(n){return B(n,function(n){return n.fold(Fn.none,Fn.some,Fn.none,Fn.none).map(function(n){return Jt(n.name,n.schema.concat([ei(uf())]))}).toArray()})}(t),c=Dc(t),a=Ac(n,e,i,u,[c]),f=Tc(0,a,t);return r(a,Oc(n,a,f.internals()),i,f.externals())}var Bc,Vc,Nc,jc,_c,Pc,Hc,zc,Lc,Gc,Uc=Mu(or("cyclic",v(!1))),$c=Mu(or("cyclic",v(!0))),Wc=[tr("execute",Ru),tr("useSpace",!1),tr("useEnter",!0),tr("useControlEnter",!1),tr("useDown",!1)],Xc=Du(Wc,Ao.init,function(n,e,t,r){var o=t.useSpace&&!Iu(n.element())?[32]:[],i=t.useEnter?[13]:[],u=t.useDown?[40]:[],c=o.concat(i).concat(u);return[au(ou(c),Fu)].concat(t.useControlEnter?[au(iu([cu,ou([13])]),Fu)]:[])},function(n,e,t,r){return t.useSpace&&!Iu(n.element())?[au(ou([32]),Au)]:[]},function(){return Fn.none()}),qc=/* */Object.freeze({flatgrid:Bu,init:function(n){return n.state(n)}}),Yc=function(n){return"rtl"===mi(n,"direction")?"rtl":"ltr"},Kc=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})},Jc=Pu,Qc=Pu,Zc=Pu,na=nn(["index","candidates"],[]),ea=[Yt("selector"),tr("execute",Ru),Jo("onEscape"),tr("captureTab",!1),ki()],ta=Xu(function(n,e,t,r){return Uu(n,e,t,r,-1)}),ra=Xu(function(n,e,t,r){return Uu(n,e,t,r,1)}),oa=Xu(function(n,e,t,r){return $u(n,e,t,r,-1)}),ia=Xu(function(n,e,t,r){return $u(n,e,t,r,1)}),ua=v([au(ou([37]),ju(ta,ra)),au(ou([39]),_u(ta,ra)),au(ou([38]),Jc(oa)),au(ou([40]),Qc(ia)),au(iu([uu,ou([9])]),qu),au(iu([bu,ou([9])]),qu),au(ou([27]),function(n,e,t,r){return t.onEscape(n,e)}),au(ou([32].concat([13])),function(e,t,r,n){return function(n,e){return e.focusManager.get(n).bind(function(n){return Zi(n,e.selector)})}(e,r).bind(function(n){return r.execute(e,t,n)})})]),ca=v([au(ou([32]),Au)]),aa=Du(ea,Bu,ua,ca,function(){return Fn.some(Wu)}),fa=[Yt("selector"),tr("getInitial",Fn.none),tr("execute",Ru),Jo("onEscape"),tr("executeOnMove",!1),tr("allowVertical",!0)],sa=v([au(ou([32]),Au)]),la=Du(fa,Ao.init,function(n,e,t,r){var o=[37].concat(t.allowVertical?[38]:[]),i=[39].concat(t.allowVertical?[40]:[]);return[au(ou(o),nc(ju(Qu,Zu))),au(ou(i),nc(_u(Qu,Zu))),au(ou([13]),Ku),au(ou([32]),Ku),au(ou([27]),ec)]},sa,function(){return Fn.some(Ju)}),da=nn(["rowIndex","columnIndex","cell"],[]),ma=[Jt("selectors",[Yt("row"),Yt("cell")]),tr("cycles",!0),tr("previousSelector",Fn.none),tr("execute",Ru)],ga=ac(function(n,e,t){return rc(n,e,t,-1)},function(n,e,t){return ic(n,e,t,-1)}),pa=ac(function(n,e,t){return rc(n,e,t,1)},function(n,e,t){return ic(n,e,t,1)}),ha=ac(function(n,e,t){return oc(n,t,e,-1)},function(n,e,t){return uc(n,t,e,-1)}),va=ac(function(n,e,t){return oc(n,t,e,1)},function(n,e,t){return uc(n,t,e,1)}),ya=v([au(ou([37]),ju(ga,pa)),au(ou([39]),_u(ga,pa)),au(ou([38]),Jc(ha)),au(ou([40]),Qc(va)),au(ou([32].concat([13])),function(e,t,r){return go(e.element()).bind(function(n){return r.execute(e,t,n)})})]),ba=v([au(ou([32]),Au)]),xa=Du(ma,Ao.init,ya,ba,function(){return Fn.some(cc)}),wa=[Yt("selector"),tr("execute",Ru),tr("moveOnTab",!1)],Sa=v([au(ou([38]),Zc(lc)),au(ou([40]),Zc(dc)),au(iu([uu,ou([9])]),function(n,e,t){return t.moveOnTab?Zc(lc)(n,e,t):Fn.none()}),au(iu([bu,ou([9])]),function(n,e,t){return t.moveOnTab?Zc(dc)(n,e,t):Fn.none()}),au(ou([13]),fc),au(ou([32]),fc)]),Ta=v([au(ou([32]),Au)]),Oa=Du(wa,Ao.init,Sa,Ta,function(){return Fn.some(sc)}),ka=[Jo("onSpace"),Jo("onEnter"),Jo("onShiftEnter"),Jo("onLeft"),Jo("onRight"),Jo("onTab"),Jo("onShiftTab"),Jo("onUp"),Jo("onDown"),Jo("onEscape"),tr("stopSpaceKeyup",!1),Qt("focusIn")],Ea=Du(ka,Ao.init,function(n,e,t){return[au(ou([32]),t.onSpace),au(iu([bu,ou([13])]),t.onEnter),au(iu([uu,ou([13])]),t.onShiftEnter),au(iu([uu,ou([9])]),t.onShiftTab),au(iu([bu,ou([9])]),t.onTab),au(ou([38]),t.onUp),au(ou([40]),t.onDown),au(ou([37]),t.onLeft),au(ou([39]),t.onRight),au(ou([32]),t.onSpace),au(ou([27]),t.onEscape)]},function(n,e,t){return t.stopSpaceKeyup?[au(ou([32]),Au)]:[]},function(n){return n.focusIn}),Ca=Uc.schema(),Da=$c.schema(),Ma=la.schema(),Ia=aa.schema(),Ra=xa.schema(),Aa=Xc.schema(),Fa=Oa.schema(),Ba=Ea.schema(),Va=(Gc=Xt("Creating behaviour: "+(Lc={branchKey:"mode",branches:/* */Object.freeze({acyclic:Ca,cyclic:Da,flow:Ma,flatgrid:Ia,matrix:Ra,execution:Aa,menu:Fa,special:Ba}),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){Mn(t,"setGridSize")?t.setGridSize(r,o):d.console.error("Layout does not support setGridSize")}},state:qc}).name,No,Lc),Bc=qt(Gc.branchKey,Gc.branches),Vc=Gc.name,Nc=Gc.active,jc=Gc.apis,_c=Gc.extra,Pc=Gc.state,zc=nr(Vc,[Zt("config",Hc=Bc)]),Ro(Hc,zc,Vc,Nc,jc,_c,Pc)),Na=mc,ja=pc,_a="placeholder",Pa=yt([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Ha=function(i,u,c,a){return hc(i,0,c,a).fold(function(n,e){var t=e(u,c.config,c.validated),r=Dt(t,"components").getOr([]),o=B(r,function(n){return Ha(i,u,n,a)});return[x(x({},t),{components:o})]},function(n,e){var t=e(u,c.config,c.validated);return c.validated.preprocess.getOr(y)(t)})},za=Pa.single,La=Pa.multiple,Ga=v(_a),Ua=0,$a=yt([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Wa=tr("factory",{sketch:y}),Xa=tr("schema",[]),qa=Yt("name"),Ya=Cr("pname","pname",kt(function(n){return"<alloy."+yc(n.name)+">"}),Ir()),Ka=or("schema",function(){return[Qt("preprocess")]}),Ja=tr("defaults",v({})),Qa=tr("overrides",v({})),Za=Or([Wa,Xa,qa,Ya,Ja,Qa]),nf=Or([Wa,Xa,qa,Ya,Ja,Qa]),ef=Or([Wa,Ka,qa,Yt("unit"),Ya,Ja,Qa]),tf=xc($a.required,Za),rf=xc($a.optional,nf),of=xc($a.group,ef),uf=v("entirety"),cf=function(n,e){return{uiType:Ga(),owner:n,name:e}},af=yc("alloy-premade"),ff=v("alloy-id-"),sf=v("data-alloy-id"),lf=ff(),df=sf(),mf=function(n,e){Object.defineProperty(n.dom(),df,{value:e,writable:!0})},gf=function(n){var e=et(n)?n.dom()[df]:null;return Fn.from(e)},pf=function(n){return n.hasOwnProperty("uid")?n:x(x({},n),{uid:Rc("uid")})};function hf(n){var e=Xt("Sketcher for "+n.name,Hs,n),t=S(e.apis,Ic),r=S(e.extraApis,function(n,e){return Gr(n,e)});return x(x({name:v(e.name),partFields:v([]),configFields:v(e.configFields),sketch:function(n){return function(n,e,t,r){var o=pf(r);return t(Ac(n,e,o,[],[]),o)}(e.name,e.configFields,e.factory,n)}},t),r)}function vf(n){var e=Xt("Sketcher for "+n.name,zs,n),t=Sc(e.name,e.partFields),r=S(e.apis,Ic),o=S(e.extraApis,function(n,e){return Gr(n,e)});return x(x({name:v(e.name),partFields:v(e.partFields),configFields:v(e.configFields),sketch:function(n){return Fc(e.name,e.configFields,e.partFields,e.factory,n)},parts:v(t)},r),o)}function yf(n){var e=Je.fromHtml(n),t=at(e),r=function(n){var e=n.dom().attributes!==undefined?n.dom().attributes:[];return I(e,function(n,e){var t;return"class"===e.name?n:x(x({},n),((t={})[e.name]=e.value,t))},{})}(e),o=function(n){return Array.prototype.slice.call(n.dom().classList,0)}(e),i=0===t.length?{}:{innerHtml:po(e)};return x({tag:q(e),classes:o,attributes:r},i)}function bf(n){return{dom:Us(n)}}function xf(n){return Bo([Fi.config({toggleClass:_i.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Bi(n,function(n,e){(e?Fi.on:Fi.off)(n)})])}function wf(n,e){var t=e.ui.registry.getAll().icons;return Fn.from(t[n]).fold(function(){return Us('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item ${prefix}-icon-'+n+' ${prefix}-icon"></span>')},function(n){return Us('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item">'+n+"</span>")})}function Sf(n){return rf({name:n+"-edge",overrides:function(r){return r.model.manager.edgeActions[n].fold(function(){return{}},function(t){var n=Nr([Pr(xe(),t,[r])]),e=Nr([Pr(Te(),t,[r]),Pr(Oe(),function(n,e){e.mouseIsDown.get()&&t(n,e)},[r])]);return{events:Xs?n:e}})}})}function Tf(n,e,t){e.store.manager.onLoad(n,e,t)}function Of(n,e,t){e.store.manager.onUnload(n,e,t)}function kf(){var n=Pn(null);return Fo({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()}}})}function Ef(){var i=Pn({}),u=Pn({});return Fo({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return Dt(i.get(),n).orThunk(function(){return Dt(u.get(),n)})},update:function(n){var e=i.get(),t=u.get(),r={},o={};C(n,function(e){r[e.value]=e,Dt(e,"meta").each(function(n){Dt(n,"text").each(function(n){o[n]=e})})}),i.set(x(x({},e),r)),u.set(x(x({},t),o))},clear:function(){i.set({}),u.set({})}})}function Cf(n,e,t,r){var o=e.store;t.update([r]),o.setValue(n,r),e.onSetValue(n,r)}function Df(n,e){ll.set(n,e)}function Mf(n){return ll.get(n)}function If(n){var e=n.event().raw();if(gl){var t=e;return t.touches!==undefined&&1===t.touches.length?Fn.some(t.touches[0]).map(function(n){return ml(n.clientX,n.clientY)}):Fn.none()}var r=e;return r.clientX!==undefined?Fn.some(r).map(function(n){return ml(n.clientX,n.clientY)}):Fn.none()}function Rf(n){return n.model.minX}function Af(n){return n.model.minY}function Ff(n){return n.model.minX-1}function Bf(n){return n.model.minY-1}function Vf(n){return n.model.maxX}function Nf(n){return n.model.maxY}function jf(n){return n.model.maxX+1}function _f(n){return n.model.maxY+1}function Pf(n,e,t){return e(n)-t(n)}function Hf(n){return Pf(n,Vf,Rf)}function zf(n){return Pf(n,Nf,Af)}function Lf(n){return Hf(n)/2}function Gf(n){return zf(n)/2}function Uf(n){return n.stepSize}function $f(n){return n.snapToGrid}function Wf(n){return n.snapStart}function Xf(n){return n.rounded}function qf(n,e){return n[e+"-edge"]!==undefined}function Yf(n){return qf(n,"left")}function Kf(n){return qf(n,"right")}function Jf(n){return qf(n,"top")}function Qf(n){return qf(n,"bottom")}function Zf(n){return n.model.value.get()}function ns(n){return{x:v(n)}}function es(n){return{y:v(n)}}function ts(n,e){return{x:v(n),y:v(e)}}function rs(n,e){U(n,pl(),{value:e})}function os(n,e,t,r){return n<e?n:t<n?t:n===e?e-1:Math.max(e,n-r)}function is(n,e,t,r){return t<n?n:n<e?e:n===t?t+1:Math.min(t,n+r)}function us(n,e,t){return Math.max(e,Math.min(t,n))}function cs(n){var e=n.min,t=n.max,r=n.range,o=n.value,i=n.step,u=n.snap,c=n.snapStart,a=n.rounded,f=n.hasMinEdge,s=n.hasMaxEdge,l=n.minBound,d=n.maxBound,m=n.screenRange,g=f?e-1:e,p=s?t+1:t;if(o<l)return g;if(d<o)return p;var h=function(n,e,t){return Math.min(t,Math.max(n,e))-e}(o,l,d),v=us(h/m*r+e,g,p);return u&&e<=v&&v<=t?function(u,t,c,a,n){return n.fold(function(){var n=u-t,e=Math.round(n/a)*a;return us(t+e,t-1,c+1)},function(n){var e=(u-n)%a,t=Math.round(e/a),r=Math.floor((u-n)/a),o=Math.floor((c-n)/a),i=n+Math.min(o,r+t)*a;return Math.max(n,i)})}(v,e,t,i,c):a?Math.round(v):v}function as(n){var e=n.min,t=n.max,r=n.range,o=n.value,i=n.hasMinEdge,u=n.hasMaxEdge,c=n.maxBound,a=n.maxOffset,f=n.centerMinEdge,s=n.centerMaxEdge;return o<e?i?0:f:t<o?u?c:s:(o-e)/r*a}function fs(n){return n.element().dom().getBoundingClientRect()}function ss(n,e){return n[e]}function ls(n){var e=fs(n);return ss(e,hl)}function ds(n){var e=fs(n);return ss(e,"right")}function ms(n){var e=fs(n);return ss(e,"top")}function gs(n){var e=fs(n);return ss(e,"bottom")}function ps(n){var e=fs(n);return ss(e,"width")}function hs(n){var e=fs(n);return ss(e,"height")}function vs(n,e,t){return(n+e)/2-t}function ys(n,e){var t=fs(n),r=fs(e),o=ss(t,hl),i=ss(t,"right"),u=ss(r,hl);return vs(o,i,u)}function bs(n,e){var t=fs(n),r=fs(e),o=ss(t,"top"),i=ss(t,"bottom"),u=ss(r,"top");return vs(o,i,u)}function xs(n,e){U(n,pl(),{value:e})}function ws(n){return{x:v(n)}}function Ss(n,e,t){var r={min:Rf(e),max:Vf(e),range:Hf(e),value:t,step:Uf(e),snap:$f(e),snapStart:Wf(e),rounded:Xf(e),hasMinEdge:Yf(e),hasMaxEdge:Kf(e),minBound:ls(n),maxBound:ds(n),screenRange:ps(n)};return cs(r)}function Ts(t){return function(n,e){return function(n,e,t){var r=(0<n?is:os)(Zf(t).x(),Rf(t),Vf(t),Uf(t));return xs(e,ws(r)),Fn.some(r)}(t,n,e).map(function(){return!0})}}function Os(n,e,t,r,o,i){var u=function(e,n,t,r,o){var i=ps(e),u=r.bind(function(n){return Fn.some(ys(n,e))}).getOr(0),c=o.bind(function(n){return Fn.some(ys(n,e))}).getOr(i),a={min:Rf(n),max:Vf(n),range:Hf(n),value:t,hasMinEdge:Yf(n),hasMaxEdge:Kf(n),minBound:ls(e),minOffset:0,maxBound:ds(e),maxOffset:i,centerMinEdge:u,centerMaxEdge:c};return as(a)}(e,i,t,r,o);return ls(e)-ls(n)+u}function ks(n,e){U(n,pl(),{value:e})}function Es(n){return{y:v(n)}}function Cs(n,e,t){var r={min:Af(e),max:Nf(e),range:zf(e),value:t,step:Uf(e),snap:$f(e),snapStart:Wf(e),rounded:Xf(e),hasMinEdge:Jf(e),hasMaxEdge:Qf(e),minBound:ms(n),maxBound:gs(n),screenRange:hs(n)};return cs(r)}function Ds(t){return function(n,e){return function(n,e,t){var r=(0<n?is:os)(Zf(t).y(),Af(t),Nf(t),Uf(t));return ks(e,Es(r)),Fn.some(r)}(t,n,e).map(function(){return!0})}}function Ms(n,e,t,r,o,i){var u=function(e,n,t,r,o){var i=hs(e),u=r.bind(function(n){return Fn.some(bs(n,e))}).getOr(0),c=o.bind(function(n){return Fn.some(bs(n,e))}).getOr(i),a={min:Af(n),max:Nf(n),range:zf(n),value:t,hasMinEdge:Jf(n),hasMaxEdge:Qf(n),minBound:ms(e),minOffset:0,maxBound:gs(e),maxOffset:i,centerMinEdge:u,centerMaxEdge:c};return as(a)}(e,i,t,r,o);return ms(e)-ms(n)+u}function Is(n,e){U(n,pl(),{value:e})}function Rs(n,e){return{x:v(n),y:v(e)}}function As(t,r){return function(n,e){return function(n,e,t,r){var o=0<n?is:os,i=e?Zf(r).x():o(Zf(r).x(),Rf(r),Vf(r),Uf(r)),u=e?o(Zf(r).y(),Af(r),Nf(r),Uf(r)):Zf(r).y();return Is(t,Rs(i,u)),Fn.some(i)}(t,r,n,e).map(function(){return!0})}}function Fs(e,t,r,n){return Ws.forToolbar(t,function(){var n=r();e.setContextToolbar([{label:t+" group",items:n}])},{},n)}function Bs(n){return[function(o){function i(n){return n<0?"black":360<n?"white":"hsl("+n+", 100%, 50%)"}return _l.sketch({dom:Us('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[_l.parts()["left-edge"](bf('<div class="${prefix}-hue-slider-black"></div>')),_l.parts().spectrum({dom:Us('<div class="${prefix}-slider-gradient-container"></div>'),components:[bf('<div class="${prefix}-slider-gradient"></div>')],behaviours:Bo([Fi.config({toggleClass:_i.resolve("thumb-active")})])}),_l.parts()["right-edge"](bf('<div class="${prefix}-hue-slider-white"></div>')),_l.parts().thumb({dom:Us('<div class="${prefix}-slider-thumb"></div>'),behaviours:Bo([Fi.config({toggleClass:_i.resolve("thumb-active")})])})],onChange:function(n,e,t){var r=i(t.x());Gi(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){Fi.on(e)},onDragEnd:function(n,e){Fi.off(e)},onInit:function(n,e,t,r){var o=i(r.x());Gi(e.element(),"background-color",o)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:function(){return o.getInitialValue()}}}},sliderBehaviours:Bo([Vi(_l.refresh)])})}(n)]}function Vs(n){var e=n.selection.getStart(),t=Je.fromDom(e),r=Je.fromDom(n.getBody()),o=function(e,n){return(et(n)?Fn.some(n):fn(n).filter(et)).map(function(n){return Br(n,function(n){return gi(n,"font-size").isSome()},e).bind(function(n){return gi(n,"font-size")}).getOrThunk(function(){return mi(n,"font-size")})}).getOr("")}(function(n){return cn(r,n)},t);return R(Ll,function(n){return o===n}).getOr("medium")}function Ns(n){return[bf('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),function(n){return zl({onChange:n.onChange,sizes:Ul,category:"font",getInitialValue:n.getInitialValue})}(n),bf('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')]}function js(n){var e=function t(n){return n.uid!==undefined}(n)&&Mn(n,"uid")?n.uid:Rc("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).toOption()},asSpec:function(){return x(x({},n),{uid:e})}}}var _s,Ps,Hs=Pt([Yt("name"),Yt("factory"),Yt("configFields"),tr("apis",{}),tr("extraApis",{})]),zs=Pt([Yt("name"),Yt("factory"),Yt("configFields"),Yt("partFields"),tr("apis",{}),tr("extraApis",{})]),Ls=hf({name:"Button",factory:function(n){function t(e){return Dt(n.dom,"attributes").bind(function(n){return Dt(n,e)})}var e=function(n){return Nr(F([n.map(function(t){return Mo(function(n,e){t(n),e.stop()})}).toArray(),ai()]))}(n.action),r=n.dom.tag;return{uid:n.uid,dom:n.dom,components:n.components,events:e,behaviours:ja(n.buttonBehaviours,[Li.config({}),Va.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==r)return{role:t("role").getOr("button")};var n=t("type").getOr("button"),e=t("role").map(function(n){return{role:n}}).getOr({});return x({type:n},e)}()},eventOrder:n.eventOrder}},configFields:[tr("uid",undefined),Yt("dom"),tr("components",[]),Na("buttonBehaviours",[Li,Va]),Qt("action"),Qt("role"),tr("eventOrder",{})]}),Gs=qr({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(n){return Nr([jr(Fe(),v(!0))])},exhibit:function(n,e){return Ur({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Us=function(n){var e=function(n,r){return n.replace(/\$\{([^{}]*)\}/g,function(n,e){var t=r[e];return function(n){var e=typeof n;return"string"==e||"number"==e}(t)?t.toString():n})}(n,{prefix:_i.prefix()});return yf(e)},$s=function(n,e,t,r){return Ls.sketch({dom:wf(n,r),action:e,buttonBehaviours:xt(Bo([Gs.config({})]),t)})},Ws={forToolbar:$s,forToolbarCommand:function(n,e){return $s(e,function(){n.execCommand(e)},{},n)},forToolbarStateAction:function(n,e,t,r){var o=xf(t);return $s(e,r,o,n)},forToolbarStateCommand:function(n,e){var t=xf(e);return $s(e,function(){n.execCommand(e)},t,n)},getToolbarIconButton:wf},Xs=L().deviceType.isTouch(),qs=rf({schema:[Yt("dom")],name:"label"}),Ys=Sf("top-left"),Ks=Sf("top"),Js=Sf("top-right"),Qs=Sf("right"),Zs=Sf("bottom-right"),nl=Sf("bottom"),el=Sf("bottom-left"),tl=[qs,Sf("left"),Qs,Ks,nl,Ys,Js,el,Zs,tf({name:"thumb",defaults:v({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:Nr([zr(xe(),n,"spectrum"),zr(we(),n,"spectrum"),zr(Se(),n,"spectrum"),zr(Te(),n,"spectrum"),zr(Oe(),n,"spectrum"),zr(ke(),n,"spectrum")])}}}),tf({schema:[or("mouseIsDown",function(){return Pn(!1)})],name:"spectrum",overrides:function(t){function r(e,n){return o.getValueFromEvent(n).map(function(n){return o.setValueFrom(e,t,n)})}var o=t.model.manager,n=Nr([_r(xe(),r),_r(we(),r)]),e=Nr([_r(Te(),r),_r(Oe(),function(n,e){t.mouseIsDown.get()&&r(n,e)})]);return{behaviours:Bo(Xs?[]:[Va.config({mode:"special",onLeft:function(n){return o.onLeft(n,t)},onRight:function(n){return o.onRight(n,t)},onUp:function(n){return o.onUp(n,t)},onDown:function(n){return o.onDown(n,t)}}),Li.config({})]),events:Xs?n:e}}})],rl=/* */Object.freeze({onLoad:Tf,onUnload:Of,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}}),ol=/* */Object.freeze({events:function(t,r){var n=t.resetOnDom?[Eo(function(n,e){Tf(n,t,r)}),Co(function(n,e){Of(n,t,r)})]:[$r(t,r,Tf)];return Nr(n)}}),il=/* */Object.freeze({memory:kf,dataset:Ef,manual:function(){return Fo({readState:function(){}})},init:function(n){return n.store.manager.state(n)}}),ul=[Qt("initialValue"),Yt("getFallbackEntry"),Yt("getDataKey"),Yt("setValue"),ni("manager",{setValue:Cf,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){Cf(e,t,r,n)})},onUnload:function(n,e,t){t.clear()},state:Ef})],cl=[Yt("getValue"),tr("setValue",w),Qt("initialValue"),ni("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:w,state:Ao.init})],al=[Qt("initialValue"),ni("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:kf})],fl=[rr("store",{mode:"memory"},qt("mode",{memory:al,manual:cl,dataset:ul})),Ko("onSetValue"),tr("resetOnDom",!1)],sl=qr({fields:fl,name:"representing",active:ol,apis:rl,extra:{setValueFrom:function(n,e){var t=sl.getValue(e);sl.setValue(n,t)}},state:il}),ll=$i("width",function(n){return n.dom().offsetWidth}),dl=function(t,r){return{left:v(t),top:v(r),translate:function(n,e){return dl(t+n,r+e)}}},ml=dl,gl=L().deviceType.isTouch(),pl=v("slider.change.value"),hl="left",vl=Ts(-1),yl=Ts(1),bl=Fn.none,xl=Fn.none,wl={"top-left":Fn.none(),top:Fn.none(),"top-right":Fn.none(),right:Fn.some(function(n,e){rs(n,ns(jf(e)))}),"bottom-right":Fn.none(),bottom:Fn.none(),"bottom-left":Fn.none(),left:Fn.some(function(n,e){rs(n,ns(Ff(e)))})},Sl=/* */Object.freeze({setValueFrom:function(n,e,t){var r=Ss(n,e,t),o=ws(r);return xs(n,o),r},setToMin:function(n,e){var t=Rf(e);xs(n,ws(t))},setToMax:function(n,e){var t=Vf(e);xs(n,ws(t))},findValueOfOffset:Ss,getValueFromEvent:function(n){return If(n).map(function(n){return n.left()})},findPositionOfValue:Os,setPositionFromValue:function(n,e,t,r){var o=Zf(t),i=Os(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=Mf(e.element())/2;Gi(e.element(),"left",i-u+"px")},onLeft:vl,onRight:yl,onUp:bl,onDown:xl,edgeActions:wl}),Tl=Fn.none,Ol=Fn.none,kl=Ds(-1),El=Ds(1),Cl={"top-left":Fn.none(),top:Fn.some(function(n,e){rs(n,es(Bf(e)))}),"top-right":Fn.none(),right:Fn.none(),"bottom-right":Fn.none(),bottom:Fn.some(function(n,e){rs(n,es(_f(e)))}),"bottom-left":Fn.none(),left:Fn.none()},Dl=/* */Object.freeze({setValueFrom:function(n,e,t){var r=Cs(n,e,t),o=Es(r);return ks(n,o),r},setToMin:function(n,e){var t=Af(e);ks(n,Es(t))},setToMax:function(n,e){var t=Nf(e);ks(n,Es(t))},findValueOfOffset:Cs,getValueFromEvent:function(n){return If(n).map(function(n){return n.top()})},findPositionOfValue:Ms,setPositionFromValue:function(n,e,t,r){var o=Zf(t),i=Ms(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),u=Wi(e.element())/2;Gi(e.element(),"top",i-u+"px")},onLeft:Tl,onRight:Ol,onUp:kl,onDown:El,edgeActions:Cl}),Ml=As(-1,!1),Il=As(1,!1),Rl=As(-1,!0),Al=As(1,!0),Fl={"top-left":Fn.some(function(n,e){rs(n,ts(Ff(e),Bf(e)))}),top:Fn.some(function(n,e){rs(n,ts(Lf(e),Bf(e)))}),"top-right":Fn.some(function(n,e){rs(n,ts(jf(e),Bf(e)))}),right:Fn.some(function(n,e){rs(n,ts(jf(e),Gf(e)))}),"bottom-right":Fn.some(function(n,e){rs(n,ts(jf(e),_f(e)))}),bottom:Fn.some(function(n,e){rs(n,ts(Lf(e),_f(e)))}),"bottom-left":Fn.some(function(n,e){rs(n,ts(Ff(e),_f(e)))}),left:Fn.some(function(n,e){rs(n,ts(Ff(e),Gf(e)))})},Bl=/* */Object.freeze({setValueFrom:function(n,e,t){var r=Ss(n,e,t.left()),o=Cs(n,e,t.top()),i=Rs(r,o);return Is(n,i),i},setToMin:function(n,e){var t=Rf(e),r=Af(e);Is(n,Rs(t,r))},setToMax:function(n,e){var t=Vf(e),r=Nf(e);Is(n,Rs(t,r))},getValueFromEvent:function(n){return If(n)},setPositionFromValue:function(n,e,t,r){var o=Zf(t),i=Os(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=Ms(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),c=Mf(e.element())/2,a=Wi(e.element())/2;Gi(e.element(),"left",i-c+"px"),Gi(e.element(),"top",u-a+"px")},onLeft:Ml,onRight:Il,onUp:Rl,onDown:Al,edgeActions:Fl}),Vl=L().deviceType.isTouch(),Nl=[tr("stepSize",1),tr("onChange",w),tr("onChoose",w),tr("onInit",w),tr("onDragStart",w),tr("onDragEnd",w),tr("snapToGrid",!1),tr("rounded",!0),Qt("snapStart"),Kt("model",qt("mode",{x:[tr("minX",0),tr("maxX",100),or("value",function(n){return Pn(n.mode.minX)}),Yt("getInitialValue"),ni("manager",Sl)],y:[tr("minY",0),tr("maxY",100),or("value",function(n){return Pn(n.mode.minY)}),Yt("getInitialValue"),ni("manager",Dl)],xy:[tr("minX",0),tr("maxX",100),tr("minY",0),tr("maxY",100),or("value",function(n){return Pn({x:v(n.mode.minX),y:v(n.mode.minY)})}),Yt("getInitialValue"),ni("manager",Bl)]})),mc("sliderBehaviours",[Va,sl])].concat(Vl?[]:[or("mouseIsDown",function(){return Pn(!1)})]),jl=L().deviceType.isTouch(),_l=vf({name:"Slider",configFields:Nl,partFields:tl,factory:function(i,n,e,t){function u(n){return Ec(n,i,"thumb")}function c(n){return Ec(n,i,"spectrum")}function r(n){return kc(n,i,"left-edge")}function o(n){return kc(n,i,"right-edge")}function a(n){return kc(n,i,"top-edge")}function f(n){return kc(n,i,"bottom-edge")}function s(n,e){m.setPositionFromValue(n,e,i,{getLeftEdge:r,getRightEdge:o,getTopEdge:a,getBottomEdge:f,getSpectrum:c})}function l(n,e){d.value.set(e);var t=u(n);return s(n,t),i.onChange(n,t,e),Fn.some(!0)}var d=i.model,m=d.manager,g=[_r(xe(),function(n,e){i.onDragStart(n,u(n))}),_r(Se(),function(n,e){i.onDragEnd(n,u(n))})],p=[_r(Te(),function(n,e){e.stop(),i.onDragStart(n,u(n)),i.mouseIsDown.set(!0)}),_r(ke(),function(n,e){i.onDragEnd(n,u(n))})],h=jl?g:p;return{uid:i.uid,dom:i.dom,components:n,behaviours:pc(i.sliderBehaviours,F([jl?[]:[Va.config({mode:"special",focusIn:function(n){return kc(n,i,"spectrum").map(Va.focusIn).map(v(!0))}})],[sl.config({store:{mode:"manual",getValue:function(n){return d.value.get()}}}),Ci.config({channels:{"mouse.released":{onReceive:function(t,n){function e(){kc(t,i,"thumb").each(function(n){var e=d.value.get();i.onChoose(t,n,e)})}if(jl)e();else{var r=i.mouseIsDown.get();i.mouseIsDown.set(!1),r&&e()}}}}})]])),events:Nr([_r(pl(),function(n,e){l(n,e.event().value())}),Eo(function(n,e){var t=d.getInitialValue();d.value.set(t);var r=u(n);s(n,r);var o=c(n);i.onInit(n,r,o,d.value.get())})].concat(h)),apis:{resetToMin:function(n){m.setToMin(n,i)},resetToMax:function(n){m.setToMax(n,i)},changeValue:l,refresh:s},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)}}}),Pl=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 Fs(n,"color-levels",function(){return Bs(e)},r)},Hl=Pt([Yt("getInitialValue"),Yt("onChange"),Yt("category"),Yt("sizes")]),zl=function(n){var o=Xt("SizeSlider",Hl,n);return _l.sketch({dom:{tag:"div",classes:[_i.resolve("slider-"+o.category+"-size-container"),_i.resolve("slider"),_i.resolve("slider-size-container")]},onChange:function(n,e,t){var r=t.x();!function(n){return 0<=n&&n<o.sizes.length}(r)||o.onChange(r)},onDragStart:function(n,e){Fi.on(e)},onDragEnd:function(n,e){Fi.off(e)},model:{mode:"x",minX:0,maxX:o.sizes.length-1,getInitialValue:function(){return{x:function(){return o.getInitialValue()}}}},stepSize:1,snapToGrid:!0,sliderBehaviours:Bo([Vi(_l.refresh)]),components:[_l.parts().spectrum({dom:Us('<div class="${prefix}-slider-size-container"></div>'),components:[bf('<div class="${prefix}-slider-size-line"></div>')]}),_l.parts().thumb({dom:Us('<div class="${prefix}-slider-thumb"></div>'),behaviours:Bo([Fi.config({toggleClass:_i.resolve("thumb-active")})])})]})},Ll=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Gl={candidates:v(Ll),get:function(n){return function(e){return A(Ll,function(n){return n===e})}(Vs(n)).getOr(2)},apply:function(e,n){(function(n){return Fn.from(Ll[n])})(n).each(function(n){!function(n,e){Vs(n)!==e&&n.execCommand("fontSize",!1,e)}(e,n)})}},Ul=Gl.candidates(),$l=window.Promise?window.Promise:(_s=Wl.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){d.setTimeout(n,1)},Ps=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},Wl.prototype["catch"]=function(n){return this.then(null,n)},Wl.prototype.then=function(t,r){var o=this;return new Wl(function(n,e){ql.call(o,new Ql(t,r,n,e))})},Wl.all=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var a=Array.prototype.slice.call(1===n.length&&Ps(n[0])?n[0]:n);return new Wl(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])})},Wl.resolve=function(e){return e&&"object"==typeof e&&e.constructor===Wl?e:new Wl(function(n){n(e)})},Wl.reject=function(t){return new Wl(function(n,e){e(t)})},Wl.race=function(o){return new Wl(function(n,e){for(var t=0,r=o;t<r.length;t++)r[t].then(n,e)})},Wl);function Wl(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=[],Zl(n,Xl(Yl,this),Xl(Kl,this))}function Xl(n,e){return function(){return n.apply(e,arguments)}}function ql(r){var o=this;null!==this._state?_s(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 Yl(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 Zl(Xl(e,n),Xl(Yl,this),Xl(Kl,this))}this._state=!0,this._value=n,Jl.call(this)}catch(t){Kl.call(this,t)}}function Kl(n){this._state=!1,this._value=n,Jl.call(this)}function Jl(){for(var n=0,e=this._deferreds;n<e.length;n++){var t=e[n];ql.call(this,t)}this._deferreds=[]}function Ql(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 Zl(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)}}function nd(n){return function e(t){return new $l(function(n){var e=new d.FileReader;e.onloadend=function(){n(e.result)},e.readAsDataURL(t)})}(n).then(function(n){return n.split(",")[1]})}function ed(o,i){(function(n){return nd(n)})(i).then(function(r){o.undoManager.transact(function(){var n=o.editorUpload.blobCache,e=n.create(yc("mceu"),i,r);n.add(e);var t=o.dom.createHTML("img",{src:e.blobUri()});o.insertContent(t)})})}function td(t){var e=js({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:Nr([Lr(Re()),_r(Ie(),function(n,e){(function(n){var e=n.event(),t=e.raw().target.files||e.raw().dataTransfer.files;return Fn.from(t[0])})(e).each(function(n){ed(t,n)})})])});return Ls.sketch({dom:Ws.getToolbarIconButton("image",t),components:[e.asSpec()],action:function(n){e.get(n).element().dom().click()}})}function rd(n){return n.dom().textContent}function od(n){return 0<n.length}function id(n){return n===undefined||null===n?"":n}function ud(n,e,t){return t.text.toOption().filter(od).fold(function(){return function(n){return Qr(n,"href")===rd(n)}(n)?Fn.some(e):Fn.none()},Fn.some)}function cd(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)}function ad(n){return n.dom().value}function fd(n,e){if(e===undefined)throw new Error("Value.set was undefined");n.dom().value=e}function sd(n){return x(x({},function(n){return Bo([Li.config({onFocus:!1===n.selectOnFocus?w:function(n){var e=n.element(),t=ad(e);e.dom().setSelectionRange(0,t.length)}})])}(n)),pc(n.inputBehaviours,[sl.config({store:{mode:"manual",initialValue:n.data.getOr(undefined),getValue:function(n){return ad(n.element())},setValue:function(n,e){ad(n.element())!==e&&fd(n.element(),e)}},onSetValue:n.onSetValue})]))}function ld(n,e){var t=js(ym.sketch({inputAttributes:{placeholder:Sm.translate(e)},onSetValue:function(n,e){G(n,Me())},inputBehaviours:Bo([gm.config({find:Fn.some}),wm.config({}),Va.config({mode:"execution"})]),selectOnFocus:!1})),r=js(Ls.sketch({dom:Us('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(n){var e=t.get(n);sl.setValue(e,"")}}));return{name:n,spec:pm.sketch({dom:Us('<div class="${prefix}-input-container"></div>'),components:[t.asSpec(),r.asSpec()],containerBehaviours:Bo([Fi.config({toggleClass:_i.resolve("input-container-empty")}),gm.config({find:function(n){return Fn.some(t.get(n))}}),lm("input-clearing",[_r(Me(),function(n){var e=t.get(n);(0<sl.getValue(e).length?Fi.off:Fi.on)(n)})])])})}}function dd(n,e,t){e.disabled&&Om(n,e)}function md(n,e){return!0===e.useNative&&k(Tm,q(n.element()))}function gd(n){Kr(n.element(),"disabled","disabled")}function pd(n){no(n.element(),"disabled")}function hd(n){Kr(n.element(),"aria-disabled","true")}function vd(n){Kr(n.element(),"aria-disabled","false")}function yd(e,n,t){n.disableClass.each(function(n){co(e.element(),n)}),(md(e,n)?pd:vd)(e),n.onEnabled(e)}function bd(n,e){return md(n,e)?function(n){return Zr(n.element(),"disabled")}(n):function(n){return"true"===Qr(n.element(),"aria-disabled")}(n)}function xd(n){return"<alloy.field."+n+">"}function wd(){function e(){t.get().each(function(n){n.destroy()})}var t=Pn(Fn.none());return{clear:function(){e(),t.set(Fn.none())},isSet:function(){return t.get().isSome()},set:function(n){e(),t.set(Fn.some(n))},run:function(n){t.get().each(n)}}}function Sd(){var e=Pn(Fn.none());return{clear:function(){e.set(Fn.none())},set:function(n){e.set(Fn.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}}function Td(n){function r(e,n,t){return Ls.sketch({dom:Us('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){U(n,u,{direction:e})},buttonBehaviours:Bo([Dm.config({disableClass:_i.resolve("toolbar-navigation-disabled"),disabled:!t})])})}function o(n,o){var i=Yi(n.element(),"."+_i.resolve("serialised-dialog-screen"));Qi(n.element(),"."+_i.resolve("serialised-dialog-chain")).each(function(r){0<=c.state.currentScreen.get()+o&&c.state.currentScreen.get()+o<i.length&&(gi(r,"left").each(function(n){var e=parseInt(n,10),t=Mf(i[0]);Gi(r,"left",e-o*t+"px")}),c.state.currentScreen.set(c.state.currentScreen.get()+o))})}function i(e){var n=Yi(e.element(),"input");Fn.from(n[c.state.currentScreen.get()]).each(function(n){e.getSystem().getByDom(n).each(function(n){!function(n,e){n.getSystem().triggerFocus(e,n.element())}(e,n.element())})});var t=f.get(e);Cu.highlightAt(t,c.state.currentScreen.get())}var u="navigateEvent",e=Or([Yt("fields"),tr("maxFieldIndex",n.fields.length-1),Yt("onExecute"),Yt("getInitialValue"),or("state",function(){return{dialogSwipeState:Sd(),currentScreen:Pn(0)}})]),c=Xt("SerialisedDialog",e,n),a=js(Rm(function(t){return{dom:Us('<div class="${prefix}-serialised-dialog"></div>'),components:[pm.sketch({dom:Us('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:de(c.fields,function(n,e){return e<=c.maxFieldIndex?pm.sketch({dom:Us('<div class="${prefix}-serialised-dialog-screen"></div>'),components:[r(-1,"previous",0<e),t.field(n.name,n.spec),r(1,"next",e<c.maxFieldIndex)]}):t.field(n.name,n.spec)})})],formBehaviours:Bo([Vi(function(n,e){!function(n,e){Qi(n.element(),"."+_i.resolve("serialised-dialog-chain")).each(function(n){Gi(n,"left",-c.state.currentScreen.get()*e.width+"px")})}(n,e)}),Va.config({mode:"special",focusIn:function(n){i(n)},onTab:function(n){return o(n,1),Fn.some(!0)},onShiftTab:function(n){return o(n,-1),Fn.some(!0)}}),lm("form-events",[Eo(function(e,n){c.state.currentScreen.set(0),c.state.dialogSwipeState.clear();var t=f.get(e);Cu.highlightFirst(t),c.getInitialValue(e).each(function(n){sl.setValue(e,n)})}),Mo(c.onExecute),_r(Ae(),function(n,e){"left"===e.event().raw().propertyName&&i(n)}),_r(u,function(n,e){var t=e.event().direction();o(n,t)})])])}})),f=js({dom:Us('<div class="${prefix}-dot-container"></div>'),behaviours:Bo([Cu.config({highlightClass:_i.resolve("dot-active"),itemClass:_i.resolve("dot-item")})]),components:B(c.fields,function(n,e){return e<=c.maxFieldIndex?[bf('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})});return{dom:Us('<div class="${prefix}-serializer-wrapper"></div>'),components:[a.asSpec(),f.asSpec()],behaviours:Bo([Va.config({mode:"special",focusIn:function(n){var e=a.get(n);Va.focusIn(e)}}),lm("serializer-wrapper-events",[_r(xe(),function(n,e){var t=e.event();c.state.dialogSwipeState.set(Am(t.raw().touches[0].clientX))}),_r(we(),function(n,e){var t=e.event();c.state.dialogSwipeState.on(function(n){e.event().prevent(),c.state.dialogSwipeState.set(Fm(n,t.raw().touches[0].clientX))})}),_r(Se(),function(r){c.state.dialogSwipeState.on(function(n){var e=a.get(r),t=-1*Bm(n);o(e,t)})})])])}}function Od(e){function n(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+bo(e().element())+" is not in context.")}}return{debugInfo:v("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:v(!1)}}function kd(n,o){var i={};return Nn(n,function(n,r){Nn(n,function(n,e){var t=kn(e,[])(i);i[e]=t.concat([o(r,n)])})}),i}function Ed(n){return n.cHandler}function Cd(n,e){return{name:v(n),handler:v(e)}}function Dd(n,e,t){var r=x(x({},t),function(n,e){var t={};return C(n,function(n){t[n.name()]=n.handlers(e)}),t}(e,n));return kd(r,Cd)}function Md(n){var i=function(n){return ce(n)?{can:v(!0),abort:v(!1),run:n}:n}(n);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)}}function Id(n,e,t){var r=e[t];return r?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: "+JSON.stringify(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+r+".\nOrder specified: "+JSON.stringify(a,null,2));return o<i?-1:i<o?1:0});return vt.value(t)}catch(r){return vt.error([r])}}("Event: "+t,"name",n,r).map(function(n){var e=de(n,function(n){return n.handler()});return cr(e)}):function(n,e){return vt.error(["The event ("+n+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(de(e,function(n){return n.name()}),null,2)])}(t,n)}function Rd(n){return $t("custom.definition",Or([Cr("dom","dom",Tt(),Or([Yt("tag"),tr("styles",{}),tr("classes",[]),tr("attributes",{}),Qt("value"),Qt("innerHtml")])),Yt("components"),Yt("uid"),tr("events",{}),tr("apis",{}),Cr("eventOrder","eventOrder",function(n){return St.mergeWithThunk(v(n))}({"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],touchstart:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]}),Ir()),Qt("domModification")]),n)}function Ad(e,n){C(n,function(n){io(e,n)})}function Fd(e,n){C(n,function(n){co(e,n)})}function Bd(n,e){return function(e,n){var t=de(n,function(n){return nr(n.name(),[Yt("config"),tr("state",Ao)])}),r=$t("component.behaviours",Or(t),e.behaviours).fold(function(n){throw new Error(Mr(n)+"\nComplete spec:\n"+JSON.stringify(e,null,2))},function(n){return n});return{list:n,data:S(r,function(n){var e=n.map(function(n){return{config:n.config,state:n.state.init(n.config)}});return function(){return e}})}}(n,e)}function Vd(n){var e=function(n){var e=kn("behaviours",{})(n),t=D(Bn(e),function(n){return e[n]!==undefined});return de(t,function(n){return e[n].me})}(n);return Bd(n,e)}function Nd(n,e,t){var r=function(n){return x(x({},n.dom),{uid:n.uid,domChildren:de(n.components,function(n){return n.element()})})}(n),o=function(n){return n.domModification.fold(function(){return Ur({})},Ur)}(n),i={"alloy.base.modification":o};return function(n,e){return x(x({},n),{attributes:x(x({},n.attributes),e.attributes),styles:x(x({},n.styles),e.styles),classes:n.classes.concat(e.classes)})}(r,0<e.length?function(e,n,t,r){var o=x({},n);C(t,function(n){o[n.name()]=n.exhibit(e,r)});function i(n){return M(n,function(n,e){return x(x({},e.modification),n)},{})}var u=kd(o,function(n,e){return{name:n,modification:e}}),c=M(u.classes,function(n,e){return e.modification.concat(n)},[]),a=i(u.attributes),f=i(u.styles);return Ur({classes:c,attributes:a,styles:f})}(t,i,e,r):o)}function jd(n,e,t){var r={"alloy.base.behaviour":function(n){return n.events}(n)};return function(n,e,t,r){var o=Dd(n,t,r);return Lm(o,e)}(t,n.eventOrder,e,r).getOrDie()}function _d(t){function n(){return s}var r=Pn(Hm),e=Wt(Rd(t)),o=Vd(t),i=function(n){return n.list}(o),u=function(n){return n.data}(o),c=function(n){var e=Je.fromTag(n.tag);Jr(e,n.attributes),Ad(e,n.classes),di(e,n.styles),n.innerHtml.each(function(n){return ho(e,n)});var t=n.domChildren;return gn(e,t),n.value.each(function(n){fd(e,n)}),n.uid,mf(e,n.uid),e}(Nd(e,i,u)),a=jd(e,i,u),f=Pn(e.components),s={getSystem:r.get,config:function(n){var e=u;return(ce(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(n){return ce(u[n.name()])},spec:v(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(Od(n))},element:v(c),syncComponents:function(){var n=at(c),e=B(n,function(n){return r.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});f.set(e)},components:f.get,events:v(a)};return s}function Pd(n){var e=Pm(n),t=e.events,r=u(e,["events"]),o=function(n){var e=kn("components",[])(n);return de(e,$m)}(r),i=x(x({},r),{events:x(x({},_m),t),components:o});return vt.value(_d(i))}function Hd(n){var e=Je.fromText(n);return Gm({element:e})}function zd(n){(go(n.element()).isNone()||Li.isFocused(n))&&(Li.isFocused(n)||Li.focus(n),U(n,Xm,{item:n}))}function Ld(n){U(n,qm,{item:n})}function Gd(n,e,t,r){var o=n.getSystem().build(r);mt(n,o,t)}function Ud(n,e,t,r){var o=ug(n);R(o,function(n){return cn(r.element(),n.element())}).each(yn)}function $d(e,n,t,r,o){var i=ug(e);return Fn.from(i[r]).map(function(n){return Ud(e,0,0,n),o.each(function(n){Gd(e,0,function(n,e){!function(n,e,t){sn(n,t).fold(function(){ft(n,e)},function(n){ln(n,e)})}(n,e,r)},n)}),n})}function Wd(n,e){var t={};Nn(n,function(n,e){C(n,function(n){t[n]=e})});var r=e,o=function(n){return jn(n,function(n,e){return{k:n,v:e}})}(e),i=S(o,function(n,e){return[e].concat(ag(t,r,o,e))});return S(t,function(n){return Dt(i,n).getOr([n])})}function Xd(n,e,t,r){return Dt(e.routes,r.start).bind(function(n){return Dt(n,r.destination)})}function qd(t,r,n){(function(e,t,r){return gg(e,t).bind(function(n){return mg(e,t,r,n)})})(t,r,n).each(function(n){var e=n.transition;co(t.element(),e.transitionClass),no(t.element(),r.destinationAttr)})}function Yd(n,e,t,r){qd(n,e,t),Zr(n.element(),e.stateAttr)&&Qr(n.element(),e.stateAttr)!==r&&e.onFinish(n,r),Kr(n.element(),e.stateAttr,r)}function Kd(n){return Dt(n,"format").getOr(n.title)}function Jd(n){return Mn(n,"items")?function(n){var e=xt(On(n,["items"]),{menu:!0}),t=Og(n.items);return{item:e,menus:xt(t.menus,En(n.title,t.items)),expansions:xt(t.expansions,En(n.title,n.title))}}(n):{item:n,menus:{},expansions:{}}}function Qd(n){var e=n.replace(/\|/g," ").trim();return 0<e.length?e.split(/\s+/):[]}function Zd(n){var e=n.toolbar!==undefined?n.toolbar:Dg;return ie(e)?Mg(e):Qd(e)}function nm(n){function e(){n.stopPropagation()}function t(){n.preventDefault()}var r=Je.fromDom(n.target),o=i(t,e);return function(n,e,t,r,o,i,u){return{target:v(n),x:v(e),y:v(t),stop:r,prevent:o,kill:i,raw:v(u)}}(r,n.clientX,n.clientY,e,t,o,n)}function em(n,e,t,r,o){var i=function(e,t){return function(n){e(n)&&t(nm(n))}}(t,r);return n.dom().addEventListener(e,i,o),{unbind:l(Ag,n,e,i,o)}}function tm(n,e,t){return function(n,e,t,r){return em(n,e,t,r,!1)}(n,e,Fg,t)}function rm(n,e,t){return function(n,e,t,r){return em(n,e,t,r,!0)}(n,e,Fg,t)}function om(n){var e=n.matchMedia("(orientation: portrait)").matches;return{isPortrait:v(e)}}var im,um,cm=function(n){var e=Je.fromDom(n.selection.getStart());return Zi(e,"a")},am={getInfo:function(n){return cm(n).fold(function(){return function(n){return{url:"",text:n.selection.getContent({format:"text"}),title:"",target:"",link:Fn.none()}}(n)},function(n){return function(n){var e=rd(n),t=Qr(n,"href"),r=Qr(n,"title"),o=Qr(n,"target");return{url:id(t),text:e!==t?id(e):"",title:id(r),target:id(o),link:Fn.some(n)}}(n)})},applyInfo:function(e,o){o.url.toOption().filter(od).fold(function(){!function(e,n){n.link.bind(y).each(function(n){e.execCommand("unlink")})}(e,o)},function(t){var r=function(n,e){var t={};return t.href=n,e.title.toOption().filter(od).each(function(n){t.title=n}),e.target.toOption().filter(od).each(function(n){t.target=n}),t}(t,o);o.link.bind(y).fold(function(){var n=o.text.toOption().filter(od).getOr(t);e.insertContent(e.dom.createHTML("a",r,e.dom.encode(n)))},function(e){var n=ud(e,t,o);Jr(e,r),n.each(function(n){!function(n,e){n.dom().textContent=e}(e,n)})})})},query:cm},fm=L(),sm=function(n,e){(fm.os.isAndroid()?cd:t)(e,n)},lm=function(n,e){return{key:n,value:{config:{},me:function(n,e){var t=Nr(e);return qr({fields:[Yt("enabled")],name:n,active:{events:v(t)}})}(n,e),configAsRaw:v({}),initialConfig:{},state:Ao}}},dm=/* */Object.freeze({getCurrent:function(n,e,t){return e.find(n)}}),mm=[Yt("find")],gm=qr({fields:mm,name:"composing",apis:dm}),pm=hf({name:"Container",factory:function(n){var e=n.dom,t=e.attributes,r=u(e,["attributes"]);return{uid:n.uid,dom:x({tag:"div",attributes:x({role:"presentation"},t)},r),components:n.components,behaviours:gc(n.containerBehaviours),events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},configFields:[tr("components",[]),mc("containerBehaviours",[]),tr("events",{}),tr("domModification",{}),tr("eventOrder",{})]}),hm=hf({name:"DataField",factory:function(t){return{uid:t.uid,dom:t.dom,behaviours:ja(t.dataBehaviours,[sl.config({store:{mode:"memory",initialValue:t.getInitialValue()}}),gm.config({find:Fn.some})]),events:Nr([Eo(function(n,e){sl.setValue(n,t.getInitialValue())})])}},configFields:[Yt("uid"),Yt("dom"),Yt("getInitialValue"),Na("dataBehaviours",[sl,gm])]}),vm=v([Qt("data"),tr("inputAttributes",{}),tr("inputStyles",{}),tr("tag","input"),tr("inputClasses",[]),Ko("onSetValue"),tr("styles",{}),tr("eventOrder",{}),mc("inputBehaviours",[sl,Li]),tr("selectOnFocus",!0)]),ym=hf({name:"Input",configFields:vm(),factory:function(n,e){return{uid:n.uid,dom:function(n){return{tag:n.tag,attributes:x({type:"text"},n.inputAttributes),styles:n.inputStyles,classes:n.inputClasses}}(n),components:[],behaviours:sd(n),eventOrder:n.eventOrder}}}),bm=/* */Object.freeze({exhibit:function(n,e){return Ur({attributes:Cn([{key:e.tabAttr,value:"true"}])})}}),xm=[tr("tabAttr","data-alloy-tabstop")],wm=qr({fields:xm,name:"tabstopping",active:bm}),Sm=tinymce.util.Tools.resolve("tinymce.util.I18n"),Tm=["input","button","textarea","select"],Om=function(e,n,t){n.disableClass.each(function(n){io(e.element(),n)}),(md(e,n)?gd:hd)(e),n.onDisabled(e)},km=/* */Object.freeze({enable:yd,disable:Om,isDisabled:bd,onLoad:dd,set:function(n,e,t,r){(r?Om:yd)(n,e,t)}}),Em=/* */Object.freeze({exhibit:function(n,e,t){return Ur({classes:e.disabled?e.disableClass.map(_).getOr([]):[]})},events:function(t,n){return Nr([jr(Pe(),function(n,e){return bd(n,t)}),$r(t,n,dd)])}}),Cm=[tr("disabled",!1),tr("useNative",!0),Qt("disableClass"),Ko("onDisabled"),Ko("onEnabled")],Dm=qr({fields:Cm,name:"disabling",active:Em,apis:km}),Mm=[mc("formBehaviours",[sl])],Im=function(r,n,e){return{uid:r.uid,dom:r.dom,components:n,behaviours:pc(r.formBehaviours,[sl.config({store:{mode:"manual",getValue:function(n){var e=function(n,e){var t=n.getSystem();return S(e.partUids,function(n,e){return v(t.getByUid(n))})}(n,r);return S(e,function(n,e){return n().bind(function(n){return function(n,e){return n.fold(function(){return vt.error(e)},vt.value)}(gm.getCurrent(n),"missing current")}).map(sl.getValue)})},setValue:function(t,n){Nn(n,function(e,n){kc(t,r,n).each(function(n){gm.getCurrent(n).each(function(n){sl.setValue(n,e)})})})}}})]),apis:{getField:function(n,e){return kc(n,r,e).bind(gm.getCurrent)}}}},Rm=(Ic(function(n,e,t){return n.getField(e,t)}),function(n){var t,e=(t=[],{field:function(n,e){return t.push(n),function(n,e,t){return{uiType:Ga(),owner:n,name:e,config:t,validated:{}}}("form",xd(n),e)},record:function(){return t}}),r=n(e),o=e.record(),i=de(o,function(n){return tf({name:n,pname:xd(n)})});return Fc("form",Mm,i,Im,r)}),Am=function(n){return{xValue:n,points:[]}},Fm=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])}},Bm=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},Vm=X(function(t,r){return[{label:"the link group",items:[Td({fields:[ld("url","Type or paste URL"),ld("text","Link text"),ld("title","Link title"),ld("target","Link target"),function(n){return{name:n,spec:hm.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return Fn.none()}})}}("link")],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return Fn.some(am.getInfo(r))},onExecute:function(n){var e=sl.getValue(n);am.applyInfo(r,e),t.restoreToolbar(),r.focus()}})]}]}),Nm=[{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"}]}],jm=Nr([(im=Ve(),um=function(n,e){var t=e.event().originator(),r=e.event().target();return!function(n,e,t){return cn(e,n.element())&&!cn(e,t)}(n,t,r)||(d.console.warn(Ve()+" did not get interpreted by the desired target. \nOriginator: "+bo(t)+"\nTarget: "+bo(r)+"\nCheck the "+Ve()+" event handlers"),!1)},{key:im,value:ur({can:um})})]),_m=/* */Object.freeze({events:jm}),Pm=y,Hm=Od(),zm=function(n,e){return function(n,e){return{cHandler:n,purpose:v(e)}}(l.apply(undefined,[n.handler].concat(e)),n.purpose())},Lm=function(n,i){var e=_n(n,function(r,o){return(1===r.length?vt.value(r[0].handler()):Id(r,i,o)).map(function(n){var e=Md(n),t=1<r.length?D(i[o],function(e){return E(r,function(n){return n.name()===e})}).join(" > "):r[0].name();return En(o,function(n,e){return{handler:n,purpose:v(e)}}(e,t))})});return Dn(e,{})},Gm=function(n){var e=Xt("external.component",Pt([Yt("element"),Qt("uid")]),n),t=Pn(Od());e.uid.each(function(n){mf(e.element,n)});var r={getSystem:t.get,config:Fn.none,hasConfigured:v(!1),connect:function(n){t.set(n)},disconnect:function(){t.set(Od(function(){return r}))},getApis:function(){return{}},element:v(e.element),spec:v(n),readState:v("No state"),syncComponents:w,components:v([]),events:v({})};return Mc(r)},Um=Rc,$m=function(e){return function(n){return Dt(n,af)}(e).fold(function(){var n=e.hasOwnProperty("uid")?e:x({uid:Um("")},e);return Pd(n).getOrDie()},function(n){return n})},Wm=Mc,Xm="alloy.item-hover",qm="alloy.item-focus",Ym=v(Xm),Km=v(qm),Jm=[Yt("data"),Yt("components"),Yt("dom"),tr("hasSubmenu",!1),Qt("toggling"),Na("itemBehaviours",[Fi,Li,Va,sl]),tr("ignoreFocus",!1),tr("domModification",{}),ni("builder",function(n){return{dom:n.dom,domModification:x(x({},n.domModification),{attributes:x(x(x({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes),{"aria-haspopup":n.hasSubmenu}),n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:ja(n.itemBehaviours,[n.toggling.fold(Fi.revoke,function(n){return Fi.config(x({aria:{mode:"checked"}},n))}),Li.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){Ld(n)}}),Va.config({mode:"execution"}),sl.config({store:{mode:"memory",initialValue:n.data}}),lm("item-type-events",function a(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;var r=Array(n),o=0;for(e=0;e<t;e++)for(var i=arguments[e],u=0,c=i.length;u<c;u++,o++)r[o]=i[u];return r}(ai(),[_r(Ee(),zd),_r(He(),Li.focus)]))]),components:n.components,eventOrder:n.eventOrder}}),tr("eventOrder",{})],Qm=[Yt("dom"),Yt("components"),ni("builder",function(n){return{dom:n.dom,components:n.components,events:Nr([function(n){return _r(n,function(n,e){e.stop()})}(He())])}})],Zm=v([tf({name:"widget",overrides:function(e){return{behaviours:Bo([sl.config({store:{mode:"manual",getValue:function(n){return e.data},setValue:function(){}}})])}}})]),ng=[Yt("uid"),Yt("data"),Yt("components"),Yt("dom"),tr("autofocus",!1),tr("ignoreFocus",!1),Na("widgetBehaviours",[sl,Li,Va]),tr("domModification",{}),Dc(Zm()),ni("builder",function(t){function r(n){return kc(n,t,"widget").map(function(n){return Va.focusIn(n),n})}function n(n,e){return Iu(e.event().target())||t.autofocus&&e.setSource(n.element()),Fn.none()}var e=Tc(0,t,Zm()),o=Oc("item-widget",t,e.internals());return{dom:t.dom,components:o,domModification:t.domModification,events:Nr([Mo(function(n,e){r(n).each(function(n){e.stop()})}),_r(Ee(),zd),_r(He(),function(n,e){t.autofocus?r(n):Li.focus(n)})]),behaviours:ja(t.widgetBehaviours,[sl.config({store:{mode:"memory",initialValue:t.data}}),Li.config({ignore:t.ignoreFocus,onFocus:function(n){Ld(n)}}),Va.config({mode:"special",focusIn:t.autofocus?function(n){r(n)}:jo(),onLeft:n,onRight:n,onEscape:function(n,e){return Li.isFocused(n)||t.autofocus?(t.autofocus&&e.setSource(n.element()),Fn.none()):(Li.focus(n),Fn.some(!0))}})])}})],eg=qt("type",{widget:ng,item:Jm,separator:Qm}),tg=v([of({factory:{sketch:function(n){var e=Xt("menu.spec item",eg,n);return e.builder(e)}},name:"items",unit:"item",defaults:function(n,e){return e.hasOwnProperty("uid")?e:x(x({},e),{uid:Rc("item")})},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus,domModification:{classes:[n.markers.item]}}}})]),rg=v([Yt("value"),Yt("items"),Yt("dom"),Yt("components"),tr("eventOrder",{}),mc("menuBehaviours",[Cu,sl,gm,Va]),rr("movement",{mode:"menu",moveOnTab:!0},qt("mode",{grid:[ki(),ni("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:n.focusManager}})],matrix:[ni("config",function(n,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+n.markers.item},focusManager:n.focusManager}}),Yt("rowSelector")],menu:[tr("moveOnTab",!0),ni("config",function(n,e){return{mode:"menu",selector:"."+n.markers.item,moveOnTab:e.moveOnTab,focusManager:n.focusManager}})]})),Kt("markers",Ti()),tr("fakeFocus",!1),tr("focusManager",pu()),Ko("onHighlight")]),og=v("alloy.menu-focus"),ig=vf({name:"Menu",configFields:rg(),partFields:tg(),factory:function(n,e,t,r){return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:pc(n.menuBehaviours,[Cu.config({highlightClass:n.markers.selectedItem,itemClass:n.markers.item,onHighlight:n.onHighlight}),sl.config({store:{mode:"memory",initialValue:n.value}}),gm.config({find:Fn.some}),Va.config(n.movement.config(n,n.movement))]),events:Nr([_r(Km(),function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){Cu.highlight(e,n),t.stop(),U(e,og(),{menu:e,item:n})})}),_r(Ym(),function(n,e){var t=e.event().item();Cu.highlight(n,t)})]),components:e,eventOrder:n.eventOrder,domModification:{attributes:{role:"menu"}}}}}),ug=function(n,e){return n.components()},cg=qr({fields:[],name:"replacing",apis:/* */Object.freeze({append:function(n,e,t,r){Gd(n,0,ft,r)},prepend:function(n,e,t,r){Gd(n,0,mn,r)},remove:Ud,replaceAt:$d,replaceBy:function(e,n,t,r,o){var i=ug(e);return A(i,r).bind(function(n){return $d(e,0,0,n,o)})},set:function(e,n,t,r){!function(n,t){var r=an(t),e=mo(r).bind(function(e){function n(n){return cn(e,n)}return n(t)?Fn.some(t):Vr(t,n)}),o=n(t);e.each(function(e){mo(r).filter(function(n){return cn(n,e)}).fold(function(){so(e)},w)})}(function(){var n=de(r,e.getSystem().build);vn(e,n)},e.element())},contents:ug})}),ag=function(t,r,o,n){return Dt(o,n).bind(function(n){return Dt(t,n).bind(function(n){var e=ag(t,r,o,n);return Fn.some([n].concat(e))})}).getOr([])},fg=function(n){return"prepared"===n.type?Fn.some(n.menu):Fn.none()},sg={init:function(){function o(t){return function(n,e){for(var t=Bn(n),r=0,o=t.length;r<o;r++){var i=t[r],u=n[i];if(e(u,i,n))return Fn.some(u)}return Fn.none()}(i.get(),function(n,e){return n===t})}var i=Pn({}),u=Pn({}),c=Pn({}),a=Pn(Fn.none()),f=Pn({}),s=function(n){return e(n).bind(fg)},e=function(n){return Dt(u.get(),n)},t=function(n){return Dt(i.get(),n)};return{setMenuBuilt:function(n,e){var t;u.set(x(x({},u.get()),((t={})[n]={type:"prepared",menu:e},t)))},setContents:function(n,e,t,r){a.set(Fn.some(n)),i.set(t),u.set(e),f.set(r);var o=Wd(r,t);c.set(o)},expand:function(t){return Dt(i.get(),t).map(function(n){var e=Dt(c.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return Dt(c.get(),n)},collapse:function(n){return Dt(c.get(),n).bind(function(n){return 1<n.length?Fn.some(n.slice(1)):Fn.none()})},lookupMenu:e,lookupItem:t,otherMenus:function(n){var e=f.get();return j(Bn(e),n)},getPrimary:function(){return a.get().bind(s)},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),c.set({}),a.set(Fn.none())},isClear:function(){return a.get().isNone()},getTriggeringPath:function(n,r){var e=D(t(n).toArray(),function(n){return s(n).isSome()});return Dt(c.get(),n).bind(function(n){var t=N(e.concat(n));return function(n){for(var e=[],t=0;t<n.length;t++){var r=n[t];if(!r.isSome())return Fn.none();e.push(r.getOrDie())}return Fn.some(e)}(B(t,function(n,e){return function(n,t,r){return s(n).bind(function(e){return o(n).bind(function(n){return t(n).map(function(n){return{triggeredMenu:e,triggeringItem:n,triggeringPath:r}})})})}(n,r,t.slice(0,e+1)).fold(function(){return a.get().is(n)?[]:[Fn.none()]},function(n){return[Fn.some(n)]})}))})}}},extractPreparedMenu:fg},lg=v("collapse-item"),dg=hf({name:"TieredMenu",configFields:[Zo("onExecute"),Zo("onEscape"),Qo("onOpenMenu"),Qo("onOpenSubmenu"),Qo("onRepositionMenu"),Ko("onCollapseMenu"),tr("highlightImmediately",!0),Jt("data",[Yt("primary"),Yt("menus"),Yt("expansions")]),tr("fakeFocus",!1),Ko("onHighlight"),Ko("onHover"),Jt("markers",[Yt("backgroundMenu")].concat(wi()).concat(Si())),Yt("dom"),tr("navigateOnHover",!0),tr("stayInDom",!1),mc("tmenuBehaviours",[Va,Cu,gm,cg]),tr("eventOrder",{})],apis:{collapseMenu:function(n,e){n.collapseMenu(e)},highlightPrimary:function(n,e){n.highlightPrimary(e)},repositionMenus:function(n,e){n.repositionMenus(e)}},factory:function(c,n){function r(r,o,n){return S(n,function(n,e){function t(){return ig.sketch(x(x({dom:n.dom},n),{value:e,items:n.items,markers:c.markers,fakeFocus:c.fakeFocus,onHighlight:c.onHighlight,focusManager:c.fakeFocus?function(){function o(n){return Cu.getHighlighted(n).map(function(n){return n.element()})}return{get:o,set:function(e,n){var t=o(e);e.getSystem().getByDom(n).fold(w,function(n){Cu.highlight(e,n)});var r=o(e);gu(e,t,r)}}}():pu()}))}return e===o?{type:"prepared",menu:r.getSystem().build(t())}:{type:"notbuilt",nbMenu:t}})}function a(n){return sl.getValue(n).value}function u(e,n){Cu.highlight(e,n),Cu.getHighlighted(n).orThunk(function(){return Cu.getFirst(n)}).each(function(n){W(e,n.element(),He())})}function f(e,n){return xo(de(n,function(n){return e.lookupMenu(n).bind(function(n){return"prepared"===n.type?Fn.some(n.menu):Fn.none()})}))}function s(e,n,t){var r=f(n,n.otherMenus(t));C(r,function(n){Fd(n.element(),[c.markers.backgroundMenu]),c.stayInDom||cg.remove(e,n)})}function l(n,r){var e=function(r){return o.get().getOrThunk(function(){var t={},n=Yi(r.element(),"."+c.markers.item),e=D(n,function(n){return"true"===Qr(n,"aria-haspopup")});return C(e,function(n){r.getSystem().getByDom(n).each(function(n){var e=a(n);t[e]=n})}),o.set(Fn.some(t)),t})}(n);Nn(e,function(n,e){var t=k(r,e);Kr(n.element(),"aria-expanded",t)})}function d(r,o,i){return Fn.from(i[0]).bind(function(n){return o.lookupMenu(n).bind(function(n){if("notbuilt"===n.type)return Fn.none();var e=n.menu,t=f(o,i.slice(1));return C(t,function(n){io(n.element(),c.markers.backgroundMenu)}),K(e.element())||cg.append(r,Wm(e)),Fd(e.element(),[c.markers.backgroundMenu]),u(r,e),s(r,o,i),Fn.some(e)})})}var m,e,o=Pn(Fn.none()),g=sg.init(),i=function(n){return S(c.data.menus,function(n,e){return B(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})};(e=m=m||{})[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent";function p(o,i,u){void 0===u&&(u=m.HighlightSubmenu);var n=a(i);return g.expand(n).bind(function(r){return l(o,r),Fn.from(r[0]).bind(function(t){return g.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 g.setMenuBuilt(e,r),r}(o,t,n);return K(e.element())||cg.append(o,Wm(e)),c.onOpenSubmenu(o,i,e,N(r)),u===m.HighlightSubmenu?(Cu.highlightFirst(e),d(o,g,r)):(Cu.dehighlightAll(e),Fn.some(i))})})})}function h(e,t){var n=a(t);return g.collapse(n).bind(function(n){return l(e,n),d(e,g,n).map(function(n){return c.onCollapseMenu(e,t,n),n})})}function t(t){return function(e,n){return Zi(n.getSource(),"."+c.markers.item).bind(function(n){return e.getSystem().getByDom(n).toOption().bind(function(n){return t(e,n).map(function(){return!0})})})}}function v(n){return Cu.getHighlighted(n).bind(Cu.getHighlighted)}var y=Nr([_r(og(),function(t,r){var n=r.event().item();g.lookupItem(a(n)).each(function(){var n=r.event().menu();Cu.highlight(t,n);var e=a(r.event().item());g.refresh(e).each(function(n){return s(t,g,n)})})}),Mo(function(e,n){var t=n.event().target();e.getSystem().getByDom(t).each(function(n){0===a(n).indexOf("collapse-item")&&h(e,n),p(e,n,m.HighlightSubmenu).fold(function(){c.onExecute(e,n)},function(){})})}),Eo(function(e,n){(function(n){var e=r(n,c.data.primary,c.data.menus),t=i();return g.setContents(c.data.primary,e,c.data.expansions,t),g.getPrimary()})(e).each(function(n){cg.append(e,Wm(n)),c.onOpenMenu(e,n),c.highlightImmediately&&u(e,n)})})].concat(c.navigateOnHover?[_r(Ym(),function(n,e){var t=e.event().item();!function(e,n){var t=a(n);g.refresh(t).bind(function(n){return l(e,n),d(e,g,n)})}(n,t),p(n,t,m.HighlightParent),c.onHover(n,t)})]:[])),b={collapseMenu:function(e){v(e).each(function(n){h(e,n)})},highlightPrimary:function(e){g.getPrimary().each(function(n){u(e,n)})},repositionMenus:function(r){g.getPrimary().bind(function(e){return v(r).bind(function(n){var e=a(n),t=function(n){return _n(n,function(n){return n})}(g.getMenus()),r=xo(de(t,sg.extractPreparedMenu));return g.getTriggeringPath(e,function(n){return function(n,e,t){return wo(e,function(n){if(!n.getSystem().isConnected())return Fn.none();var e=Cu.getCandidates(n);return R(e,function(n){return a(n)===t})})}(0,r,n)})}).map(function(n){return{primary:e,triggeringPath:n}})}).fold(function(){(function(n){return Fn.from(n.components()[0]).filter(function(n){return"menu"===Qr(n.element(),"role")})})(r).each(function(n){c.onRepositionMenu(r,n,[])})},function(n){var e=n.primary,t=n.triggeringPath;c.onRepositionMenu(r,e,t)})}};return{uid:c.uid,dom:c.dom,markers:c.markers,behaviours:pc(c.tmenuBehaviours,[Va.config({mode:"special",onRight:t(function(n,e){return Iu(e.element())?Fn.none():p(n,e,m.HighlightSubmenu)}),onLeft:t(function(n,e){return Iu(e.element())?Fn.none():h(n,e)}),onEscape:t(function(n,e){return h(n,e).orThunk(function(){return c.onEscape(n,e).map(function(){return n})})}),focusIn:function(e,n){g.getPrimary().each(function(n){W(e,n.element(),He())})}}),Cu.config({highlightClass:c.markers.selectedMenu,itemClass:c.markers.menu}),gm.config({find:function(n){return Cu.getHighlighted(n)}}),cg.config({})]),eventOrder:c.eventOrder,apis:b,events:y}},extraApis:{tieredData:function(n,e,t){return{primary:n,menus:e,expansions:t}},singleData:function(n,e){return{primary:n,menus:En(n,e),expansions:{}}},collapseItem:function(n){return{value:yc(lg()),meta:{text:n}}}}}),mg=function(n,e,t,r){return Xd(0,e,0,r).bind(function(e){return e.transition.map(function(n){return{transition:n,route:e}})})},gg=function(n,e,t){var r=n.element();return Zr(r,e.destinationAttr)?Fn.some({start:Qr(n.element(),e.stateAttr),destination:Qr(n.element(),e.destinationAttr)}):Fn.none()},pg=/* */Object.freeze({findRoute:Xd,disableTransition:qd,getCurrentRoute:gg,jumpTo:Yd,progressTo:function(t,r,o,i){!function(n,e){Zr(n.element(),e.destinationAttr)&&(Kr(n.element(),e.stateAttr,Qr(n.element(),e.destinationAttr)),no(n.element(),e.destinationAttr))}(t,r);var n=function(n,e,t,r){return{start:Qr(n.element(),e.stateAttr),destination:r}}(t,r,0,i);mg(t,r,o,n).fold(function(){Yd(t,r,o,i)},function(n){qd(t,r,o);var e=n.transition;io(t.element(),e.transitionClass),Kr(t.element(),r.destinationAttr,i)})},getState:function(n,e,t){var r=n.element();return Zr(r,e.stateAttr)?Fn.some(Qr(r,e.stateAttr)):Fn.none()}}),hg=/* */Object.freeze({events:function(o,i){return Nr([_r(Ae(),function(t,n){var r=n.event().raw();gg(t,o).each(function(e){Xd(0,o,0,e).each(function(n){n.transition.each(function(n){r.propertyName===n.property&&(Yd(t,o,i,e.destination),o.onTransition(t,e))})})})}),Eo(function(n,e){Yd(n,o,i,o.initialState)})])}}),vg=[tr("destinationAttr","data-transitioning-destination"),tr("stateAttr","data-transitioning-state"),Yt("initialState"),Ko("onTransition"),Ko("onFinish"),Kt("routes",Ut(vt.value,Ut(vt.value,Pt([er("transition",[Yt("property"),Yt("transitionClass")])]))))],yg=qr({fields:vg,name:"transitioning",active:hg,apis:pg,extra:{createRoutes:function(n){var r={};return Nn(n,function(n,e){var t=e.split("<->");r[t[0]]=En(t[1],n),r[t[1]]=En(t[0],n)}),r},createBistate:function(n,e,t){return Cn([{key:n,value:En(e,t)},{key:e,value:En(n,t)}])},createTristate:function(n,e,t,r){return Cn([{key:n,value:Cn([{key:e,value:r},{key:t,value:r}])},{key:e,value:Cn([{key:n,value:r},{key:t,value:r}])},{key:t,value:Cn([{key:n,value:r},{key:e,value:r}])}])}}}),bg=_i.resolve("scrollable"),xg={register:function(n){io(n,bg)},deregister:function(n){co(n,bg)},scrollable:v(bg)},wg=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[_i.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:_i.resolve("format-matches"),selected:t},itemBehaviours:Bo(o?[]:[Bi(n,function(n,e){(e?Fi.on:Fi.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},Sg=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[Ls.sketch({dom:{tag:"div",classes:[_i.resolve("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[_i.resolve("styles-collapse-icon")]}},Hd(n)]:[Hd(n)],action:function(n){if(r){var e=t().get(n);dg.collapseMenu(e)}}}),{dom:{tag:"div",classes:[_i.resolve("styles-menu-items-container")]},components:[ig.parts().items({})],behaviours:Bo([lm("adhoc-scrollable-menu",[Eo(function(n,e){Gi(n.element(),"overflow-y","auto"),Gi(n.element(),"-webkit-overflow-scrolling","touch"),xg.register(n.element())}),Co(function(n){pi(n.element(),"overflow-y"),pi(n.element(),"-webkit-overflow-scrolling"),xg.deregister(n.element())})])])}],items:e,menuBehaviours:Bo([yg.config({initialState:"after",routes:yg.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},Tg=function(r){var n=function(r,o){var n=Sg("Styles",[].concat(de(r.items,function(n){return wg(Kd(n),n.title,n.isSelected(),n.getPreview(),Mn(r.expansions,Kd(n)))})),o,!1),e=S(r.menus,function(n,e){var t=de(n,function(n){return wg(Kd(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",Mn(r.expansions,Kd(n)))});return Sg(e,t,o,!0)}),t=xt(e,En("styles",n));return{tmenu:dg.tieredData("styles",t,r.expansions)}}(r.formats,function(){return e}),e=js(dg.sketch({dom:{tag:"div",classes:[_i.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=sl.getValue(e);return r.handle(e,t.value),Fn.none()},onEscape:function(){return Fn.none()},onOpenMenu:function(n,e){var t=Mf(n.element());Df(e.element(),t),yg.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=Mf(n.element()),o=Ji(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();Df(t.element(),r),yg.progressTo(i,"before"),yg.jumpTo(t,"after"),yg.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=Ji(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();yg.progressTo(o,"after"),yg.progressTo(t,"current")},navigateOnHover:!1,highlightImmediately:!0,data:n.tmenu,markers:{backgroundMenu:_i.resolve("styles-background-menu"),menu:_i.resolve("styles-menu"),selectedMenu:_i.resolve("styles-selected-menu"),item:_i.resolve("styles-item"),selectedItem:_i.resolve("styles-selected-item")}}));return e.asSpec()},Og=function(n){return M(n,function(n,e){var t=Jd(e);return{menus:xt(n.menus,t.menus),items:[t.item].concat(n.items),expansions:xt(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},kg={expand:Og},Eg=function(r,n){function o(n){return function(){return r.formatter.match(n)}}function i(n){return function(){return r.formatter.getCssText(n)}}var e=Dt(n,"style_formats").getOr(Nm),t=function(n){return de(n,function(n){if(Mn(n,"items")){var e=t(n.items);return xt(function(n){return xt(n,{isSelected:v(!1),getPreview:v("")})}(n),{items:e})}return Mn(n,"format")?function(n){return xt(n,{isSelected:o(n.format),getPreview:i(n.format)})}(n):function(n){var e=yc(n.title),t=xt(n,{format:e,isSelected:o(e),getPreview:i(e)});return r.formatter.register(e,t),t}(n)})};return t(e)},Cg=function(t,n,r){var e=function(e,n){var t=function(n){return B(n,function(n){return n.items===undefined?!Mn(n,"format")||e.formatter.canApply(n.format)?[n]:[]:0<t(n.items).length?[n]:[]})},r=t(n);return kg.expand(r)}(t,n);return Tg({formats:e,handle:function(n,e){t.undoManager.transact(function(){Fi.isOn(n)?t.formatter.remove(e):t.formatter.apply(e)}),r()}})},Dg=["undo","bold","italic","link","image","bullist","styleselect"],Mg=function(n){return B(n,function(n){return ie(n)?Mg(n):Qd(n)})},Ig=function(e,r){function n(n){return function(){return Ws.forToolbarCommand(r,n)}}function t(n){return function(){return Ws.forToolbarStateCommand(r,n)}}function o(n,e,t){return function(){return Ws.forToolbarStateAction(r,n,e,t)}}function i(){return Cg(r,h,function(){r.fire("scrollIntoView")})}function u(n,e){return{isSupported:function(){var e=r.ui.registry.getAll().buttons;return n.forall(function(n){return Mn(e,n)})},sketch:e}}var c=n("undo"),a=n("redo"),f=t("bold"),s=t("italic"),l=t("underline"),d=n("removeformat"),m=o("unlink","link",function(){r.execCommand("unlink",null,!1)}),g=o("unordered-list","ul",function(){r.execCommand("InsertUnorderedList",null,!1)}),p=o("ordered-list","ol",function(){r.execCommand("InsertOrderedList",null,!1)}),h=Eg(r,r.settings);return{undo:u(Fn.none(),c),redo:u(Fn.none(),a),bold:u(Fn.none(),f),italic:u(Fn.none(),s),underline:u(Fn.none(),l),removeformat:u(Fn.none(),d),link:u(Fn.none(),function(){return function(e,t){return Ws.forToolbarStateAction(t,"link","link",function(){var n=Vm(e,t);e.setContextToolbar(n),sm(t,function(){e.focusToolbar()}),am.query(t).each(function(n){t.selection.select(n.dom())})})}(e,r)}),unlink:u(Fn.none(),m),image:u(Fn.none(),function(){return td(r)}),bullist:u(Fn.some("bullist"),g),numlist:u(Fn.some("numlist"),p),fontsizeselect:u(Fn.none(),function(){return function(n,e){var t={onChange:function(n){Gl.apply(e,n)},getInitialValue:function(){return Gl.get(e)}};return Fs(n,"font-size",function(){return Ns(t)},e)}(e,r)}),forecolor:u(Fn.none(),function(){return Pl(e,r)}),styleselect:u(Fn.none(),function(){return Ws.forToolbar("style-formats",function(n){r.fire("toReading"),e.dropup().appear(i,Fi.on,n)},Bo([Fi.config({toggleClass:_i.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Ci.config({channels:Cn([Ni(Uo.orientationChanged(),Fi.off),Ni(Uo.dropupDismissed(),Fi.off)])})]),r)})}},Rg=function(n,t){var e=Zd(n),r={};return B(e,function(n){var e=!Mn(r,n)&&Mn(t,n)&&t[n].isSupported()?[t[n].sketch()]:[];return r[n]=!0,e})},Ag=function(n,e,t,r){n.dom().removeEventListener(e,t,r)},Fg=v(!0),Bg=tinymce.util.Tools.resolve("tinymce.util.Delay"),Vg=om,Ng=function(r,e){var n=Je.fromDom(r),o=null,t=tm(n,"orientationchange",function(){Bg.clearInterval(o);var n=om(r);e.onChange(n),i(function(){e.onReady(n)})}),i=function(n){Bg.clearInterval(o);var e=r.innerHeight,t=0;o=Bg.setInterval(function(){e!==r.innerHeight?(Bg.clearInterval(o),n(Fn.some(r.innerHeight))):20<t&&(Bg.clearInterval(o),n(Fn.none())),t++},50)};return{onAdjustment:i,destroy:function(){t.unbind()}}},jg=function(n){var e=L().os.isiOS(),t=om(n).isPortrait();return e&&!t?n.screen.height:n.screen.width};function _g(n){var e=n.raw();return e.touches===undefined||1!==e.touches.length?Fn.none():Fn.some(e.touches[0])}function Pg(t){var r=Pn(Fn.none()),o=Pn(!1),i=function n(t,r){var o=null;return{cancel:function(){null!==o&&(d.clearTimeout(o),o=null)},schedule:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];o=d.setTimeout(function(){t.apply(null,n),o=null},r)}}}(function(n){t.triggerEvent(Le(),n),o.set(!0)},400),u=Cn([{key:xe(),value:function(t){return _g(t).each(function(n){i.cancel();var e={x:v(n.clientX),y:v(n.clientY),target:t.target};i.schedule(t),o.set(!1),r.set(Fn.some(e))}),Fn.none()}},{key:we(),value:function(n){return i.cancel(),_g(n).each(function(e){r.get().each(function(n){!function(n,e){var t=Math.abs(n.clientX-e.x()),r=Math.abs(n.clientY-e.y());return 5<t||5<r}(e,n)||r.set(Fn.none())})}),Fn.none()}},{key:Se(),value:function(e){i.cancel();return r.get().filter(function(n){return cn(n.target(),e.target())}).map(function(n){return o.get()?(e.prevent(),!1):t.triggerEvent(ze(),e)})}}]);return{fireIfReady:function(e,n){return Dt(u,n).bind(function(n){return n(e)})}}}var Hg=function(t){var e=Pg({triggerEvent:function(n,e){t.onTapContent(e)}});return{fireTouchstart:function(n){e.fireIfReady(n,"touchstart")},onTouchend:function(){return tm(t.body(),"touchend",function(n){e.fireIfReady(n,"touchend")})},onTouchmove:function(){return tm(t.body(),"touchmove",function(n){e.fireIfReady(n,"touchmove")})}}},zg=6<=L().os.version.major,Lg=function(r,e,t){function o(n){return!cn(n.start(),n.finish())||n.soffset()!==n.foffset()}function n(){var n=r.doc().dom().hasFocus()&&r.getSelection().exists(o);t.getByDom(e).each(!0===(n||mo(u).filter(function(n){return"input"===q(n)}).exists(function(n){return n.dom().selectionStart!==n.dom().selectionEnd}))?Fi.on:Fi.off)}var i=Hg(r),u=an(e),c=[tm(r.body(),"touchstart",function(n){r.onTouchContent(),i.fireTouchstart(n)}),i.onTouchmove(),i.onTouchend(),tm(e,"touchstart",function(n){r.onTouchToolstrip()}),r.onToReading(function(){lo(r.body())}),r.onToEditing(w),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==zg?[]:[tm(Je.fromDom(r.win()),"blur",function(){t.getByDom(e).each(Fi.off)}),tm(u,"select",n),tm(r.doc(),"selectionchange",n)]);return{destroy:function(){C(c,function(n){n.unbind()})}}},Gg=function(n,e){var t=parseInt(Qr(n,e),10);return isNaN(t)?0:t};function Ug(n){return Ip.getOption(n)}function $g(n){return function(n){return Ug(n).filter(function(n){return 0!==n.trim().length||-1<n.indexOf("\xa0")}).isSome()}(n)||k(Rp,q(n))}function Wg(n,e,t){var r=n.document.createRange();return function(t,n){n.fold(function(n){t.setStartBefore(n.dom())},function(n,e){t.setStart(n.dom(),e)},function(n){t.setStartAfter(n.dom())})}(r,e),function(t,n){n.fold(function(n){t.setEndBefore(n.dom())},function(n,e){t.setEnd(n.dom(),e)},function(n){t.setEndAfter(n.dom())})}(r,t),r}function Xg(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i}function qg(n){return{left:v(n.left),top:v(n.top),right:v(n.right),bottom:v(n.bottom),width:v(n.width),height:v(n.height)}}function Yg(n,e,t){return e(Je.fromDom(t.startContainer),t.startOffset,Je.fromDom(t.endContainer),t.endOffset)}function Kg(n,e){return function(n,e){var t=e.ltr();return t.collapsed?e.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return jp.rtl(Je.fromDom(n.endContainer),n.endOffset,Je.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Yg(0,jp.ltr,t)}):Yg(0,jp.ltr,t)}(0,function(o,n){return n.match({domRange:function(n){return{ltr:v(n),rtl:Fn.none}},relative:function(n,e){return{ltr:X(function(){return Wg(o,n,e)}),rtl:X(function(){return Fn.some(Wg(o,e,n))})}},exact:function(n,e,t,r){return{ltr:X(function(){return Xg(o,n,e,t,r)}),rtl:X(function(){return Fn.some(Xg(o,t,r,n,e))})}}})}(n,e))}function Jg(n,e,t){return e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom}function Qg(t,r,n,e,o){function i(n){var e=t.dom().createRange();return e.setStart(r.dom(),n),e.collapse(!0),e}var u=function(n){return Ip.get(n)}(r).length,c=function(n,e,t,r,o){if(0===o)return 0;if(e===r)return o-1;for(var i=r,u=1;u<o;u++){var c=n(u),a=Math.abs(e-c.left);if(t<=c.bottom){if(t<c.top||i<a)return u-1;i=a}}return 0}(function(n){return i(n).getBoundingClientRect()},n,e,o.right,u);return i(c)}function Zg(n){return Vr(n,$g)}function np(n){return Pp(n,$g)}function ep(n,e){return e-n.left<n.right-e}function tp(n,e,t){var r=n.dom().createRange();return r.selectNode(e.dom()),r.collapse(t),r}function rp(e,n,t){var r=e.dom().createRange();r.selectNode(n.dom());var o=r.getBoundingClientRect(),i=ep(o,t);return(!0===i?Zg:np)(n).map(function(n){return tp(e,n,i)})}function op(n,e,t){var r=e.dom().getBoundingClientRect(),o=ep(r,t);return Fn.some(tp(n,e,o))}function ip(n,e,t,r){var o=n.dom().createRange();o.selectNode(e.dom());var i=o.getBoundingClientRect();return function(n,e,t,r){var o=n.dom().createRange();o.selectNode(e.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,t)),c=Math.max(i.top,Math.min(i.bottom,r));return _p(n,e,u,c)}(n,e,Math.max(i.left,Math.min(i.right,t)),Math.max(i.top,Math.min(i.bottom,r)))}function up(n,e){var t=q(n);return"input"===t?Bp.after(n):k(["br","img"],t)?0===e?Bp.before(n):Bp.after(n):Bp.on(n,e)}function cp(n,e,t,r){var o=function(n,e,t,r){var o=an(n).dom().createRange();return o.setStart(n.dom(),e),o.setEnd(t.dom(),r),o}(n,e,t,r),i=cn(n,t)&&e===r;return o.collapsed&&!i}function ap(n,e,t,r,o){!function(n,e){Fn.from(n.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(e)})}(n,Xg(n,e,t,r,o))}function fp(n,e,t,r,o){!function(u,n){Kg(u,n).match({ltr:function(n,e,t,r){ap(u,n,e,t,r)},rtl:function(n,e,t,r){var o=u.getSelection();if(o.setBaseAndExtent)o.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(o.extend)try{!function(n,e,t,r,o,i){e.collapse(t.dom(),r),e.extend(o.dom(),i)}(0,o,n,e,t,r)}catch(i){ap(u,t,r,n,e)}else ap(u,t,r,n,e)}})}(n,function(n,e,t,r){var o=up(n,e),i=up(t,r);return Np.relative(o,i)}(e,t,r,o))}function sp(n){var e=Je.fromDom(n.anchorNode),t=Je.fromDom(n.focusNode);return cp(e,n.anchorOffset,t,n.focusOffset)?Fn.some(Ap.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 Fn.some(Ap.create(Je.fromDom(e.startContainer),e.startOffset,Je.fromDom(t.endContainer),t.endOffset))}return Fn.none()}(n)}function lp(n){return Fn.from(n.getSelection()).filter(function(n){return 0<n.rangeCount}).bind(sp)}function dp(n,e){return function(n){var e=n.getClientRects(),t=0<e.length?e[0]:n.getBoundingClientRect();return 0<t.width||0<t.height?Fn.some(t).map(qg):Fn.none()}(function(i,n){return Kg(i,n).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}})}(n,e))}function mp(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:v(2),height:n.height}}function gp(n){return{left:v(n.left),top:v(n.top),right:v(n.right),bottom:v(n.bottom),width:v(n.width),height:v(n.height)}}function pp(t){if(t.collapsed){var r=Je.fromDom(t.startContainer);return fn(r).bind(function(n){var e=Np.exact(r,t.startOffset,n,function(n){return"img"===q(n)?1:Ug(n).fold(function(){return at(n).length},function(n){return n.length})}(n));return dp(t.startContainer.ownerDocument.defaultView,e).map(mp).map(_)}).getOr([])}return de(t.getClientRects(),gp)}function hp(n,e){Kr(n,Lp,e)}function vp(n){return{top:v(n.top()),bottom:v(n.top()+n.height())}}function yp(n,e){var t=function(n){return Gg(n,Lp)}(e),r=n.innerHeight;return r<t?Fn.some(t-r):Fn.none()}function bp(n){return Fn.some(Je.fromDom(n.dom().contentWindow.document.body))}function xp(n){return Fn.some(Je.fromDom(n.dom().contentWindow.document))}function wp(n){return Fn.from(n.dom().contentWindow)}function Sp(n){return wp(n).bind(lp)}function Tp(n){return n.getFrame()}function Op(n,t){return function(e){return e[n].getOrThunk(function(){var n=Tp(e);return function(){return t(n)}})()}}function kp(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return tm(e,r,n)}})}function Ep(n){return{left:v(n.left),top:v(n.top),right:v(n.right),bottom:v(n.bottom),width:v(n.width),height:v(n.height)}}function Cp(t,r){var o=null;return{cancel:function(){null!==o&&(d.clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==o&&d.clearTimeout(o),o=d.setTimeout(function(){t.apply(null,n),o=null},r)}}}function Dp(n){return"true"===Qr(n,ah)?function(n){return 0<n.dom().scrollLeft||function(n){n.dom().scrollLeft=1;var e=0!==n.dom().scrollLeft;return n.dom().scrollLeft=0,e}(n)}(n):function(n){return 0<n.dom().scrollTop||function(n){n.dom().scrollTop=1;var e=0!==n.dom().scrollTop;return n.dom().scrollTop=0,e}(n)}(n)}var Mp,Ip=function cy(t,r){var e=function(n){return t(n)?Fn.from(n.dom().nodeValue):Fn.none()};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}}}(tt,"text"),Rp=["img","br"],Ap={create:J("start","soffset","finish","foffset")},Fp=yt([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Bp={before:Fp.before,on:Fp.on,after:Fp.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(y,y,y)}},Vp=yt([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Np={domRange:Vp.domRange,relative:Vp.relative,exact:Vp.exact,exactFromRange:function(n){return Vp.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){return function(n){return Je.fromDom(n.dom().ownerDocument.defaultView)}(function(n){return n.match({domRange:function(n){return Je.fromDom(n.startContainer)},relative:function(n,e){return Bp.getStart(n)},exact:function(n,e,t,r){return n}})}(n))},range:Ap.create},jp=yt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),_p=function(n,e,t,r){return tt(e)?function(e,t,r,o){var n=e.dom().createRange();n.selectNode(t.dom());var i=n.getClientRects();return wo(i,function(n){return Jg(n,r,o)?Fn.some(n):Fn.none()}).map(function(n){return Qg(e,t,r,o,n)})}(n,e,t,r):function(e,n,t,r){var o=e.dom().createRange(),i=at(n);return wo(i,function(n){return o.selectNode(n.dom()),Jg(o.getBoundingClientRect(),t,r)?_p(e,n,t,r):Fn.none()})}(n,e,t,r)},Pp=function(n,i){var u=function(n){for(var e=at(n),t=e.length-1;0<=t;t--){var r=e[t];if(i(r))return Fn.some(r);var o=u(r);if(o.isSome())return o}return Fn.none()};return u(n)},Hp=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(n){var e=n.getSelection();return e!==undefined&&0<e.rangeCount?pp(e.getRangeAt(0)):[]}),zp=function(n){n.focus();var e=Je.fromDom(n.document.body);(mo().exists(function(n){return k(["input","textarea"],q(n))})?function(n){Bg.setTimeout(function(){n()},0)}:t)(function(){mo().each(lo),so(e)})},Lp="data-"+_i.resolve("last-outer-height"),Gp=function(n,r){var e=Je.fromDom(r.document.body),t=tm(Je.fromDom(n),"resize",function(){yp(n,e).each(function(t){(function(n){var e=Hp(n);return 0<e.length?Fn.some(e[0]).map(vp):Fn.none()})(r).each(function(n){var e=function(n,e,t){return e.top()>n.innerHeight||e.bottom()>n.innerHeight?Math.min(t,e.bottom()-n.innerHeight+50):0}(r,n,t);0!==e&&r.scrollTo(r.pageXOffset,r.pageYOffset+e)})}),hp(e,n.innerHeight)});hp(e,n.innerHeight);return{toEditing:function(){zp(r)},destroy:function(){t.unbind()}}},Up={getBody:Op("getBody",bp),getDoc:Op("getDoc",xp),getWin:Op("getWin",wp),getSelection:Op("getSelection",Sp),getFrame:Tp,getActiveApi:function(c){var a=Tp(c);return bp(a).bind(function(u){return xp(a).bind(function(i){return wp(a).map(function(o){var n=Je.fromDom(i.dom().documentElement),e=c.getCursorBox.getOrThunk(function(){return function(){return function(n){return lp(n).map(function(n){return Np.exact(n.start(),n.soffset(),n.finish(),n.foffset())})}(o).bind(function(n){return dp(o,n).orThunk(function(){return function(n){return lp(n).filter(function(n){return cn(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0<e.width||0<e.height?Fn.some(e).map(Ep):Fn.none()})}(o)})})}}),t=c.setSelection.getOrThunk(function(){return function(n,e,t,r){fp(o,n,e,t,r)}}),r=c.clearSelection.getOrThunk(function(){return function(){!function(n){n.getSelection().removeAllRanges()}(o)}});return{body:v(u),doc:v(i),win:v(o),html:v(n),getSelection:l(Sp,a),setSelection:t,clearSelection:r,frame:v(a),onKeyup:kp(c,i,"onKeyup","keyup"),onNodeChanged:kp(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}})})})}},$p="data-ephox-mobile-fullscreen-style",Wp="position:absolute!important;",Xp="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",qp=L().os.isAndroid(),Yp=function(n,e){function t(r){return function(n){var e=Qr(n,"style"),t=e===undefined?"no-styles":e.trim();t!==r&&(Kr(n,$p,t),Kr(n,"style",r))}}var r=function(n,e,t){return Xi(n,function(n){return tn(n,e)},t)}(n,"*"),o=B(r,function(n){return function(n,e){return qi(n,function(n){return tn(n,e)})}(n,"*")}),i=function(n){var e=mi(n,"background-color");return e!==undefined&&""!==e?"background-color:"+e+"!important":"background-color:rgb(255,255,255)!important;"}(e);C(o,t("display:none!important;")),C(r,t(Wp+Xp+i)),t((!0===qp?"":Wp)+Xp+i)(n)},Kp=function(){var n=function(n){return on(n)}("["+$p+"]");C(n,function(n){var e=Qr(n,$p);"no-styles"!==e?Kr(n,"style",e):no(n,"style"),no(n,$p)})},Jp=function(){var e=Ki("head").getOrDie(),n=Ki('meta[name="viewport"]').getOrThunk(function(){var n=Je.fromTag("meta");return Kr(n,"name","viewport"),ft(e,n),n}),t=Qr(n,"content");return{maximize:function(){Kr(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?Kr(n,"content",t):Kr(n,"content","user-scalable=yes")}}},Qp=function(e,n){var t=Jp(),r=wd(),o=wd();return{enter:function(){n.hide(),io(e.container,_i.resolve("fullscreen-maximized")),io(e.container,_i.resolve("android-maximized")),t.maximize(),io(e.body,_i.resolve("android-scroll-reload")),r.set(Gp(e.win,Up.getWin(e.editor).getOrDie("no"))),Up.getActiveApi(e.editor).each(function(n){Yp(e.container,n.body()),o.set(Lg(n,e.toolstrip,e.alloy))})},exit:function(){t.restore(),n.show(),co(e.container,_i.resolve("fullscreen-maximized")),co(e.container,_i.resolve("android-maximized")),Kp(),co(e.body,_i.resolve("android-scroll-reload")),o.clear(),r.clear()}}},Zp=function(n,e){var t=js(pm.sketch({dom:Us('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:Bo([Fi.config({toggleClass:_i.resolve("mask-tap-icon-selected"),toggleOnExecute:!1})])})),r=function(t,r){var o=null;return{cancel:function(){null!==o&&(d.clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null===o&&(o=d.setTimeout(function(){t.apply(null,n),o=null},r))}}}(n,200);return pm.sketch({dom:Us('<div class="${prefix}-disabled-mask"></div>'),components:[pm.sketch({dom:Us('<div class="${prefix}-content-container"></div>'),components:[Ls.sketch({dom:Us('<div class="${prefix}-content-tap-section"></div>'),components:[t.asSpec()],action:function(n){r.throttle()},buttonBehaviours:Bo([Fi.config({toggleClass:_i.resolve("mask-tap-icon-selected")})])})]})]})},nh=Or([Jt("editor",[Yt("getFrame"),Qt("getBody"),Qt("getDoc"),Qt("getWin"),Qt("getSelection"),Qt("setSelection"),Qt("clearSelection"),Qt("cursorSaver"),Qt("onKeyup"),Qt("onNodeChanged"),Qt("getCursorBox"),Yt("onDomChanged"),tr("onTouchContent",w),tr("onTapContent",w),tr("onTouchToolstrip",w),tr("onScrollToCursor",v({unbind:w})),tr("onScrollToElement",v({unbind:w})),tr("onToEditing",v({unbind:w})),tr("onToReading",v({unbind:w})),tr("onToolbarScrollStart",y)]),Yt("socket"),Yt("toolstrip"),Yt("dropup"),Yt("toolbar"),Yt("container"),Yt("alloy"),or("win",function(n){return an(n.socket).dom().defaultView}),or("body",function(n){return Je.fromDom(n.socket.dom().ownerDocument.body)}),tr("translate",y),tr("setReadOnly",w),tr("readOnlyOnInit",v(!0))]),eh=function(n){var e=Xt("Getting AndroidWebapp schema",nh,n);Gi(e.toolstrip,"width","100%");var t=$m(Zp(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)}};ft(e.container,t.element());var o=Qp(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:w,enter:o.enter,exit:o.exit,destroy:w}},th=v([Yt("dom"),tr("shell",!0),mc("toolbarBehaviours",[cg])]),rh=v([rf({name:"groups",overrides:function(n){return{behaviours:Bo([cg.config({})])}}})]),oh=vf({name:"Toolbar",configFields:th(),partFields:rh(),factory:function(e,n,t,r){var o=function(n){return e.shell?Fn.some(n):kc(n,e,"groups")},i=e.shell?{behaviours:[cg.config({})],components:[]}:{behaviours:[],components:n};return{uid:e.uid,dom:e.dom,components:i.components,behaviours:pc(e.toolbarBehaviours,i.behaviours),apis:{setGroups:function(n,e){o(n).fold(function(){throw d.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){cg.set(n,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,e,t){n.setGroups(e,t)}}}),ih=v([Yt("items"),(Mp=["itemSelector"],Jt("markers",de(Mp,Yt))),mc("tgroupBehaviours",[Va])]),uh=v([of({name:"items",unit:"item"})]),ch=vf({name:"ToolbarGroup",configFields:ih(),partFields:uh(),factory:function(n,e,t,r){return{uid:n.uid,dom:n.dom,components:e,behaviours:pc(n.tgroupBehaviours,[Va.config({mode:"flow",selector:n.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),ah="data-"+_i.resolve("horizontal-scroll"),fh={exclusive:function(n,e){return tm(n,"touchmove",function(n){Zi(n.target(),e).filter(Dp).fold(function(){n.raw().preventDefault()},w)})},markAsHorizontal:function(n){Kr(n,ah,"true")}};function sh(){function e(n){var e=!0===n.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:Us('<div aria-label="'+n.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:Bo([lm("adhoc-scrollable-toolbar",!0===n.scrollable?[Do(function(n,e){Gi(n.element(),"overflow-x","auto"),fh.markAsHorizontal(n.element()),xg.register(n.element())})]:[])]),components:[pm.sketch({components:[ch.parts().items({})]})],markers:{itemSelector:"."+_i.resolve("toolbar-group-item")},items:n.items}}function t(){oh.setGroups(r,o.get()),Fi.off(r)}var r=$m(oh.sketch({dom:Us('<div class="${prefix}-toolbar"></div>'),components:[oh.parts().groups({})],toolbarBehaviours:Bo([Fi.config({toggleClass:_i.resolve("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),Va.config({mode:"cyclic"})]),shell:!0})),n=$m(pm.sketch({dom:{classes:[_i.resolve("toolstrip")]},components:[Wm(r)],containerBehaviours:Bo([Fi.config({toggleClass:_i.resolve("android-selection-context-toolbar"),toggleOnExecute:!1})])})),o=Pn([]);return{wrapper:v(n),toolbar:v(r),createGroups:function(n){return de(n,i(ch.sketch,e))},setGroups:function(n){o.set(n),t()},setContextToolbar:function(n){Fi.on(r),oh.setGroups(r,n)},restoreToolbar:function(){Fi.isOn(r)&&t()},refresh:function(){},focus:function(){Va.focusIn(r)}}}function lh(n,e){cg.append(n,Wm(e))}function dh(n,e){cg.remove(n,e)}function mh(e,n){return n.getAnimationRoot.fold(function(){return e.element()},function(n){return n(e)})}function gh(n){return n.dimension.property}function ph(n,e){return n.dimension.getDimension(e)}function hh(n,e){var t=mh(n,e);Fd(t,[e.shrinkingClass,e.growingClass])}function vh(n,e){co(n.element(),e.openClass),io(n.element(),e.closedClass),Gi(n.element(),gh(e),"0px"),hi(n.element())}function yh(n,e){co(n.element(),e.closedClass),io(n.element(),e.openClass),pi(n.element(),gh(e))}function bh(n,e,t,r){t.setCollapsed(),Gi(n.element(),gh(e),ph(e,n.element())),hi(n.element()),hh(n,e),vh(n,e),e.onStartShrink(n),e.onShrunk(n)}function xh(n,e,t,r){var o=r.getOrThunk(function(){return ph(e,n.element())});t.setCollapsed(),Gi(n.element(),gh(e),o),hi(n.element());var i=mh(n,e);co(i,e.growingClass),io(i,e.shrinkingClass),vh(n,e),e.onStartShrink(n)}function wh(n,e,t){var r=ph(e,n.element());("0px"===r?bh:xh)(n,e,t,Fn.some(r))}function Sh(n,e,t){var r=mh(n,e),o=ao(r,e.shrinkingClass),i=ph(e,n.element());yh(n,e);var u=ph(e,n.element());(o?function(){Gi(n.element(),gh(e),i),hi(n.element())}:function(){vh(n,e)})(),co(r,e.shrinkingClass),io(r,e.growingClass),yh(n,e),Gi(n.element(),gh(e),u),t.setExpanded(),e.onStartGrow(n)}function Th(n,e,t){var r=mh(n,e);return!0===ao(r,e.growingClass)}function Oh(n,e,t){var r=mh(n,e);return!0===ao(r,e.shrinkingClass)}function kh(e,t){var r=$m(pm.sketch({dom:{tag:"div",classes:[_i.resolve("dropup")]},components:[],containerBehaviours:Bo([cg.config({}),_h.config({closedClass:_i.resolve("dropup-closed"),openClass:_i.resolve("dropup-open"),shrinkingClass:_i.resolve("dropup-shrinking"),growingClass:_i.resolve("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){e(),t(),cg.set(n,[])},onGrown:function(n){e(),t()}}),Vi(function(n,e){o(w)})])})),o=function(n){d.window.requestAnimationFrame(function(){n(),_h.shrink(r)})};return{appear:function(n,e,t){!0===_h.hasShrunk(r)&&!1===_h.isTransitioning(r)&&d.window.requestAnimationFrame(function(){e(t),cg.set(r,[n()]),_h.grow(r)})},disappear:o,component:v(r),element:r.element}}function Eh(n){return 8===n.raw().which&&!k(["input","textarea"],q(n.target()))&&!function(n,e,t){return Zi(n,e,t).isSome()}(n.target(),'[contenteditable="true"]')}function Ch(e,n){var t=Xt("Getting GUI events settings",Hh,n),r=L().deviceType.isTouch()?["touchstart","touchmove","touchend","touchcancel","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],o=Pg(t),i=de(r.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(n){return tm(e,n,function(e){o.fireIfReady(e,n).each(function(n){n&&e.kill()}),t.triggerEvent(n,e)&&e.kill()})}),u=Pn(Fn.none()),c=tm(e,"paste",function(e){o.fireIfReady(e,"paste").each(function(n){n&&e.kill()}),t.triggerEvent("paste",e)&&e.kill(),u.set(Fn.some(d.setTimeout(function(){t.triggerEvent(je(),e)},0)))}),a=tm(e,"keydown",function(n){t.triggerEvent("keydown",n)?n.kill():!0===t.stopBackspace&&Eh(n)&&n.prevent()}),f=function(n,e){return Ph?rm(n,"focus",e):tm(n,"focusin",e)}(e,function(n){t.triggerEvent("focusin",n)&&n.kill()}),s=Pn(Fn.none()),l=function(n,e){return Ph?rm(n,"blur",e):tm(n,"focusout",e)}(e,function(n){t.triggerEvent("focusout",n)&&n.kill(),s.set(Fn.some(d.setTimeout(function(){t.triggerEvent(Ne(),n)},0)))});return{unbind:function(){C(i,function(n){n.unbind()}),a.unbind(),f.unbind(),l.unbind(),c.unbind(),u.get().each(d.clearTimeout),s.get().each(d.clearTimeout)}}}function Dh(n,e){var t=Dt(n,"target").map(function(n){return n()}).getOr(e);return Pn(t)}function Mh(n,r,e,t,o,i){var u=n(r,t),c=function(n,e){var t=Pn(!1),r=Pn(!1);return{stop:function(){t.set(!0)},cut:function(){r.set(!0)},isStopped:t.get,isCut:r.get,event:v(n),setSource:e.set,getSource:e.get}}(e,o);return u.fold(function(){return i.logEventNoHandlers(r,t),zh.complete()},function(e){var t=e.descHandler();return Ed(t)(c),c.isStopped()?(i.logEventStopped(r,e.element(),t.purpose()),zh.stopped()):c.isCut()?(i.logEventCut(r,e.element(),t.purpose()),zh.complete()):fn(e.element()).fold(function(){return i.logNoParent(r,e.element(),t.purpose()),zh.complete()},function(n){return i.logEventResponse(r,e.element(),t.purpose()),zh.resume(n)})})}function Ih(n,e,t){var r=function(n){var e=Pn(!1);return{stop:function(){e.set(!0)},cut:w,isStopped:e.get,isCut:v(!1),event:v(n),setSource:o("Cannot set source of a broadcasted event"),getSource:o("Cannot get source of a broadcasted event")}}(e);return C(n,function(n){var e=n.descHandler();Ed(e)(r)}),r.isStopped()}var Rh,Ah=function(n){return $m(Ls.sketch({dom:Us('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){n.run(function(n){n.setReadOnly(!1)})}}))},Fh=function(){return $m(pm.sketch({dom:Us('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:Bo([cg.config({})])}))},Bh=function(n,e,t,r){(!0===t?Ho.toAlpha:Ho.toOmega)(r),(t?lh:dh)(n,e)},Vh=/* */Object.freeze({refresh:function(n,e,t){if(t.isExpanded()){pi(n.element(),gh(e));var r=ph(e,n.element());Gi(n.element(),gh(e),r)}},grow:function(n,e,t){t.isExpanded()||Sh(n,e,t)},shrink:function(n,e,t){t.isExpanded()&&wh(n,e,t)},immediateShrink:function(n,e,t){t.isExpanded()&&bh(n,e,t)},hasGrown:function(n,e,t){return t.isExpanded()},hasShrunk:function(n,e,t){return t.isCollapsed()},isGrowing:Th,isShrinking:Oh,isTransitioning:function(n,e,t){return!0===Th(n,e)||!0===Oh(n,e)},toggleGrow:function(n,e,t){(t.isExpanded()?wh:Sh)(n,e,t)},disableTransitions:hh}),Nh=/* */Object.freeze({exhibit:function(n,e){var t=e.expanded;return Ur(t?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:En(e.dimension.property,"0px")})},events:function(t,r){return Nr([function(n,e){return Hr(n)(e)}(Ae(),function(n,e){e.event().raw().propertyName===t.dimension.property&&(hh(n,t),r.isExpanded()&&pi(n.element(),t.dimension.property),(r.isExpanded()?t.onGrown:t.onShrunk)(n))})])}}),jh=[Yt("closedClass"),Yt("openClass"),Yt("shrinkingClass"),Yt("growingClass"),Qt("getAnimationRoot"),Ko("onShrunk"),Ko("onStartShrink"),Ko("onGrown"),Ko("onStartGrow"),tr("expanded",!1),Kt("dimension",qt("property",{width:[ni("property","width"),ni("getDimension",function(n){return Mf(n)+"px"})],height:[ni("property","height"),ni("getDimension",function(n){return Wi(n)+"px"})]}))],_h=qr({fields:jh,name:"sliding",active:Nh,apis:Vh,state:/* */Object.freeze({init:function(n){var e=Pn(n.expanded);return Fo({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()}})}})}),Ph=L().browser.isFirefox(),Hh=Pt([(Rh="triggerEvent",Kt(Rh,Rr)),tr("stopBackspace",!0)]),zh=yt([{stopped:[]},{resume:["element"]},{complete:[]}]),Lh=function(e,t,r,n,o,i){return Mh(e,t,r,n,o,i).fold(function(){return!0},function(n){return Lh(e,t,r,n,o,i)},function(){return!1})},Gh=function(n,e,t,r,o){var i=Dh(t,r);return Lh(n,e,t,r,i,o)},Uh=J("element","descHandler"),$h=function(n,e){return{id:v(n),descHandler:v(e)}};function Wh(){var i={};return{registerId:function(r,o,n){Nn(n,function(n,e){var t=i[e]!==undefined?i[e]:{};t[o]=zm(n,r),i[e]=t})},unregisterId:function(t){Nn(i,function(n,e){n.hasOwnProperty(t)&&delete n[t]})},filterByType:function(n){return Dt(i,n).map(function(n){return _n(n,function(n,e){return $h(e,n)})}).getOr([])},find:function(n,e,t){var r=Ct(e)(i);return ko(t,function(n){return function(t,r){return gf(r).fold(function(){return Fn.none()},function(n){var e=Ct(n);return t.bind(e).map(function(n){return Uh(r,n)})})}(r,n)},n)}}}function Xh(){function r(n){var e=n.element();return gf(e).fold(function(){return function(n,e){var t=yc(lf+n);return mf(e,t),t}("uid-",n.element())},function(n){return n})}var o=Wh(),i={},u=function(n){gf(n.element()).each(function(n){delete i[n],o.unregisterId(n)})};return{find:function(n,e,t){return o.find(n,e,t)},filter:function(n){return o.filterByType(n)},register:function(n){var e=r(n);Mn(i,e)&&function(n,e){var t=i[e];if(t!==n)throw new Error('The tagId "'+e+'" is already used by: '+bo(t.element())+"\nCannot use it for: "+bo(n.element())+"\nThe conflicting element is"+(K(t.element())?" ":" not ")+"already in the DOM");u(n)}(n,e);var t=[n];o.registerId(t,e,n.events()),i[e]=n},unregister:u,getById:function(n){return Ct(n)(i)}}}var qh=function(t){function r(e){return fn(t.element()).fold(function(){return!0},function(n){return cn(e,n)})}function o(n,e){return u.find(r,n,e)}function i(t){var n=u.filter(_e());C(n,function(n){var e=n.descHandler();Ed(e)(t)})}var u=Xh(),n=Ch(t.element(),{triggerEvent:function(e,t){return qo(e,t.target(),function(n){return function(n,e,t,r){var o=t.target();return Gh(n,e,t,o,r)}(o,e,t,n)})}}),c={debugInfo:v("real"),triggerEvent:function(e,t,r){qo(e,t,function(n){Gh(o,e,r,t,n)})},triggerFocus:function(e,t){gf(e).fold(function(){so(e)},function(n){qo(Ve(),e,function(n){!function(n,e,t,r,o){var i=Dh(t,r);Mh(n,e,t,r,i,o)}(o,Ve(),{originator:v(t),kill:w,prevent:w,target:v(e)},e,n)})})},triggerEscape:function(n,e){c.triggerEvent("keydown",n.element(),e.event())},getByUid:function(n){return g(n)},getByDom:function(n){return p(n)},build:$m,addToGui:function(n){f(n)},removeFromGui:function(n){s(n)},addToWorld:function(n){e(n)},removeFromWorld:function(n){a(n)},broadcast:function(n){l(n)},broadcastOn:function(n,e){d(n,e)},broadcastEvent:function(n,e){m(n,e)},isConnected:v(!0)},e=function(n){n.connect(c),tt(n.element())||(u.register(n),C(n.components(),e),c.triggerEvent(Ge(),n.element(),{target:v(n.element())}))},a=function(n){tt(n.element())||(C(n.components(),a),u.unregister(n)),n.disconnect()},f=function(n){!function(n,e){mt(n,e,ft)}(t,n)},s=function(n){yn(n)},l=function(n){i({universal:v(!0),data:v(n)})},d=function(n,e){i({universal:v(!1),channels:v(n),data:v(e)})},m=function(n,e){var t=u.filter(n);return Ih(t,e)},g=function(n){return u.getById(n).fold(function(){return vt.error(new Error('Could not find component with uid: "'+n+'" in system.'))},vt.value)},p=function(n){var e=gf(n).getOr("not found");return g(e)};return e(t),{root:v(t),element:t.element,destroy:function(){n.unbind(),st(t.element())},add:f,remove:s,getByUid:g,getByDom:p,addToWorld:e,removeFromWorld:a,broadcast:l,broadcastOn:d,broadcastEvent:m}},Yh=v(_i.resolve("readonly-mode")),Kh=v(_i.resolve("edit-mode"));function Jh(n){var e=$m(pm.sketch({dom:{classes:[_i.resolve("outer-container")].concat(n.classes)},containerBehaviours:Bo([Ho.config({alpha:Yh(),omega:Kh()})])}));return qh(e)}var Qh=function(n,e){var t=Je.fromTag("input");di(t,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),ft(n,t),so(t),e(t),st(t)},Zh=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)}},nv=function(n,e){mo().each(function(n){cn(n,e)||lo(n)}),n.focus(),so(Je.fromDom(n.document.body)),Zh(n)},ev={stubborn:function(n,e,t,r){function o(){nv(e,r)}var i=tm(t,"keydown",function(n){k(["input","textarea"],q(n.target()))||o()});return{toReading:function(){Qh(n,lo)},toEditing:o,onToolbarTouch:function(){},destroy:function(){i.unbind()}}},timid:function(n,e,t,r){function o(){lo(r)}return{toReading:function(){o()},toEditing:function(){nv(e,r)},onToolbarTouch:function(){o()},destroy:w}}},tv=function(e,r,t,o,n){function i(){r.run(function(n){n.refreshSelection()})}function u(n,e){var t=n-o.dom().scrollTop;r.run(function(n){n.scrollIntoView(t,t+e)})}function c(){r.run(function(n){n.clearSelection()})}function a(){e.getCursorBox().each(function(n){u(n.top(),n.height())}),r.run(function(n){n.syncHeight()})}var f=Hg(e),s=Cp(a,300),l=[e.onKeyup(function(){c(),s.throttle()}),e.onNodeChanged(i),e.onDomChanged(s.throttle),e.onDomChanged(i),e.onScrollToCursor(function(n){n.preventDefault(),s.throttle()}),e.onScrollToElement(function(n){n.element(),u(r,o)}),e.onToEditing(function(){r.run(function(n){n.toEditing()})}),e.onToReading(function(){r.run(function(n){n.toReading()})}),tm(e.doc(),"touchend",function(n){cn(e.html(),n.target())||cn(e.body(),n.target())}),tm(t,"transitionend",function(n){"height"===n.raw().propertyName&&function(){var e=Wi(t);r.run(function(n){n.setViewportOffset(e)}),i(),a()}()}),rm(t,"touchstart",function(n){r.run(function(n){n.highlightSelection()}),function(e){r.run(function(n){n.onToolbarTouch(e)})}(n),e.onTouchToolstrip()}),tm(e.body(),"touchstart",function(n){c(),e.onTouchContent(),f.fireTouchstart(n)}),f.onTouchmove(),f.onTouchend(),tm(e.body(),"click",function(n){n.kill()}),tm(t,"touchmove",function(){e.onToolbarScrollStart()})];return{destroy:function(){C(l,function(n){n.unbind()})}}};var rv,ov,iv,uv,cv={},av={exports:cv};rv=undefined,ov=cv,iv=av,uv=undefined,function(n){"object"==typeof ov&&void 0!==iv?iv.exports=n():"function"==typeof rv&&rv.amd?rv([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function s(i,u,c){function a(e,n){if(!u[e]){if(!i[e]){var t="function"==typeof uv&&uv;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=u[e]={exports:{}};i[e][0].call(o.exports,function(n){return a(i[e][1][n]||n)},o,o.exports,s,i,u,c)}return u[e].exports}for(var f="function"==typeof uv&&uv,n=0;n<c.length;n++)a(c[n]);return a}({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 f,s=[],l=!1,d=-1;function m(){l&&f&&(l=!1,f.length?s=f.concat(s):d=-1,s.length&&g())}function g(){if(!l){var n=a(m);l=!0;for(var e=s.length;e;){for(f=s,s=[];++d<e;)f&&f[d].run();d=-1,e=s.length}f=null,l=!1,function t(n){if(o===clearTimeout)return clearTimeout(n);if((o===c||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(n);try{return 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 h(){}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];s.push(new p(n,e)),1!==s.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=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,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(e){function r(){}function i(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=[],s(n,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,i._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)}u(o.promise,e)}else(1===r._state?u:c)(o.promise,r._value)})):r._deferreds.push(o)}function u(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 i)return n._state=3,n._value=e,void a(n);if("function"==typeof t)return void s(function r(n,e){return function(){n.apply(e,arguments)}}(t,e),n)}n._state=1,n._value=e,a(n)}catch(o){c(n,o)}}function c(n,e){n._state=2,n._value=e,a(n)}function a(n){2===n._state&&0===n._deferreds.length&&i._immediateFn(function(){n._handled||i._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)o(n,n._deferreds[e]);n._deferreds=null}function f(n,e,t){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.promise=t}function s(n,e){var t=!1;try{n(function(n){t||(t=!0,u(e,n))},function(n){t||(t=!0,c(e,n))})}catch(r){if(t)return;t=!0,c(e,r)}}var n,t;n=this,t=setTimeout,i.prototype["catch"]=function(n){return this.then(null,n)},i.prototype.then=function(n,e){var t=new this.constructor(r);return o(this,new f(n,e,t)),t},i.all=function(n){var a=Array.prototype.slice.call(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.length;t<r;t++)o[t].then(n,e)})},i._immediateFn="function"==typeof e?function(n){e(n)}:function(n){t(n,0)},i._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},i._setImmediateFn=function(n){i._immediateFn=n},i._setUnhandledRejectionFn=function(n){i._unhandledRejectionFn=n},void 0!==l&&l.exports?l.exports=i:n.Promise||(n.Promise=i)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(a,n,f){(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}f.setTimeout=function(){return new c(t.call(setTimeout,window,arguments),clearTimeout)},f.setInterval=function(){return new c(t.call(setInterval,window,arguments),clearInterval)},f.clearTimeout=f.clearInterval=function(n){n.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},f.enroll=function(n,e){clearTimeout(n._idleTimeoutId),n._idleTimeout=e},f.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},f._unrefActive=f.active=function(n){clearTimeout(n._idleTimeoutId);var e=n._idleTimeout;0<=e&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},e))},f.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),f.clearImmediate(e))}),e},f.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)});function fv(n){d.setTimeout(function(){throw n},0)}function sv(n,e,t){return Math.abs(n-e)<=t?Fn.none():n<e?Fn.some(n+t):Fn.some(n-t)}function lv(e,t){return wo([{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 function(n,e){return n?Fn.some(e):Fn.none()}(e<=n.width&&t<=n.height,n.keyboard)}).getOr({portrait:t/5,landscape:e/4})}function dv(n){var e=Vg(n).isPortrait(),t=function(n){return lv(n.screen.width,n.screen.height)}(n),r=e?t.portrait:t.landscape;return(e?n.screen.height:n.screen.width)-n.innerHeight>r?0:r}function mv(n,e){var t=an(n).dom().defaultView;return Wi(n)+Wi(e)-dv(t)}function gv(n){return Gg(n,Av)}function pv(n,e){var t=function(n){return Qr(n,Fv)}(n);return Rv.fixed(n,t,e)}function hv(n,e){return Rv.scroller(n,e)}function vv(n){var e=gv(n);return("true"===Qr(n,Bv)?hv:pv)(n,e)}function yv(n,e,t){var r=an(n).dom().defaultView.innerHeight;return Kr(n,Vv,r+"px"),r-e-t}function bv(n){var e=gi(n,"top").getOr("0");return parseInt(e,10)}function xv(n){return parseInt(n.dom().scrollTop,10)}function wv(n,e){var t=e+_v(n)+"px";Gi(n,"top",t)}var Sv=av.exports.boltExport,Tv=function(n){var t=Fn.none(),e=[],r=function(n){o()?u(n):e.push(n)},o=function(){return t.isSome()},i=function(n){C(n,u)},u=function(e){t.each(function(n){d.setTimeout(function(){e(n)},0)})};return n(function(n){t=Fn.some(n),i(e),e=[]}),{get:r,map:function(t){return Tv(function(e){r(function(n){e(t(n))})})},isReady:o}},Ov={nu:Tv,pure:function(e){return Tv(function(n){n(e)})}},kv=function(t){function n(n){t().then(n,fv)}return{map:function(n){return kv(function(){return t().then(n)})},bind:function(e){return kv(function(){return t().then(function(n){return e(n).toPromise()})})},anonBind:function(n){return kv(function(){return t().then(function(){return n.toPromise()})})},toLazy:function(){return Ov.nu(n)},toCached:function(){var n=null;return kv(function(){return null===n&&(n=t()),n})},toPromise:t,get:n}},Ev=function(n){return kv(function(){return new Sv(n)})},Cv=function(n){return kv(function(){return Sv.resolve(n)})},Dv=function(){var f=null;return{animate:function(r,o,n,i,e,t){function u(n){c=!0,e(n)}var c=!1;Bg.clearInterval(f);function a(n){Bg.clearInterval(f),u(n)}f=Bg.setInterval(function(){var t=r();sv(t,o,n).fold(function(){Bg.clearInterval(f),u(o)},function(n){if(i(n,a),!c){var e=r();(e!==n||Math.abs(e-o)>Math.abs(t-o))&&(Bg.clearInterval(f),u(o))}})},t)}}},Mv=mv,Iv=function(n,e,t){var r=mv(e,t),o=Wi(e)+Wi(t)-r;Gi(n,"padding-bottom",o+"px")},Rv=yt([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Av="data-"+_i.resolve("position-y-fixed"),Fv="data-"+_i.resolve("y-property"),Bv="data-"+_i.resolve("scrolling"),Vv="data-"+_i.resolve("last-window-height"),Nv=function(n){var e=Yi(n,"["+Av+"]");return de(e,vv)},jv=function(r,o,i,u){function n(){var n=t.innerHeight;return function(n){return Gg(n,Vv)}(r)<n}function e(){if(d){var n=Wi(i),e=Wi(u),t=yv(r,n,e);Kr(r,Av,n+"px"),Gi(r,"height",t+"px"),Iv(o,r,u)}}var t=an(r).dom().defaultView,c=function(n){var e=Qr(n,"style");di(n,{position:"absolute",top:"0px"}),Kr(n,Av,"0px"),Kr(n,Fv,"top");return{restore:function(){Kr(n,"style",e||""),no(n,Av),no(n,Fv)}}}(i),a=Wi(i),f=Wi(u),s=function(n,e,t){var r=Qr(t,"style");xg.register(t),di(t,{position:"absolute",height:e+"px",width:"100%",top:n+"px"}),Kr(t,Av,n+"px"),Kr(t,Bv,"true"),Kr(t,Fv,"top");return{restore:function(){xg.deregister(t),Kr(t,"style",r||""),no(t,Av),no(t,Bv),no(t,Fv)}}}(a,yv(r,a,f),r),l=function(n){var e=Qr(n,"style");di(n,{position:"absolute",bottom:"0px"}),Kr(n,Av,"0px"),Kr(n,Fv,"bottom");return{restore:function(){Kr(n,"style",e||""),no(n,Av),no(n,Fv)}}}(u),d=!0;return Iv(o,r,u),{setViewportOffset:function(n){Kr(r,Av,n+"px"),e()},isExpanding:n,isShrinking:m(n),refresh:e,restore:function(){d=!1,c.restore(),s.restore(),l.restore()}}},_v=gv,Pv=Dv(),Hv="data-"+_i.resolve("last-scroll-top"),zv=function(t,r,o){return Ev(function(n){var e=l(xv,t);Pv.animate(e,r,15,function(n){t.dom().scrollTop=n,Gi(t,"top",bv(t)+15+"px")},function(){t.dom().scrollTop=r,Gi(t,"top",o+"px"),n(r)},10)})},Lv=function(o,i){return Ev(function(n){var e=l(xv,o);Kr(o,Hv,e());var t=Math.abs(i-e()),r=Math.ceil(t/10);Pv.animate(e,i,r,function(n,e){Gg(o,Hv)!==o.dom().scrollTop?e(o.dom().scrollTop):(o.dom().scrollTop=n,Kr(o,Hv,n))},function(){o.dom().scrollTop=i,Kr(o,Hv,i),n(i)},10)})},Gv=function(i,u){return Ev(function(n){function e(n){Gi(i,"top",n+"px")}var t=l(bv,i),r=Math.abs(u-t()),o=Math.ceil(r/10);Pv.animate(t,u,o,e,function(){e(u),n(u)},10)})},Uv=function(e,t,r){var o=an(e).dom().defaultView;return Ev(function(n){wv(e,r),wv(t,r),o.scrollTo(0,r),n(r)})};function $v(i,n){return n(function(t){var r=[],o=0;0===i.length?t([]):C(i,function(n,e){n.get(function(e){return function(n){r[e]=n,++o>=i.length&&t(r)}}(e))})})}function Wv(n,r){return n.fold(function(n,e,t){return function(n,e,t,r){return Gi(n,e,t+r+"px"),Cv(r)}(n,e,r,t)},function(n,e){return function(n,e,t){var r=e+t,o=gi(n,"top").getOr(t),i=r-parseInt(o,10),u=n.dom().scrollTop+i;return zv(n,u,r)}(n,r,e)})}function Xv(e,t,n,r,o,i){var u=function f(t){var r=Pn(Ov.pure({}));return{start:function(e){var n=Ov.nu(function(n){return t(e).get(n)});r.set(n)},idle:function(n){r.get().get(function(){n()})}}}(function(n){return Uv(e,t,n)}),c=Cp(function(){u.idle(function(){Yv(n,r.pageYOffset).get(function(){(function(){var n=Hp(i);return Fn.from(n[0]).bind(function(n){var e=n.top()-t.dom().scrollTop;return e>r.innerHeight+5||e<-5?Fn.some({top:v(e),bottom:v(e+n.height())}):Fn.none()})})().each(function(n){t.dom().scrollTop=t.dom().scrollTop+n.top()}),u.start(0),o.refresh()})})},1e3),a=tm(Je.fromDom(r),"scroll",function(){r.pageYOffset<0||c.throttle()});return Yv(n,r.pageYOffset).get(y),{unbind:a.unbind}}var qv=function(n,e,t,r,o){var i=Mv(e,t),u=l(Zh,n);i<r||i<o?Lv(e,e.dom().scrollTop-i+o).get(u):r<0&&Lv(e,e.dom().scrollTop+r).get(u)},Yv=function(n,e){var t=Nv(n);return function(n){return $v(n,Ev)}(de(t,function(n){return Wv(n,e)}))},Kv=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(),f=n.dropup(),s=jv(r,e,o,f),l=c(n.outerBody(),t,rt(),u,o,i),d=Ng(a,{onChange:w,onReady:s.refresh});d.onAdjustment(function(){s.refresh()});var m=tm(Je.fromDom(a),"resize",function(){s.isExpanding()&&s.refresh()}),g=Xv(o,r,n.outerBody(),a,s,t),p=function v(t,e){var n=t.document,r=Je.fromTag("div");function o(n){var e=Je.fromTag("span");return Ad(e,[_i.resolve("layer-editor"),_i.resolve("unfocused-selection")]),di(e,{left:n.left()+"px",top:n.top()+"px",width:n.width()+"px",height:n.height()+"px"}),e}io(r,_i.resolve("unfocused-selections")),ft(Je.fromDom(n.documentElement),r);var i=tm(r,"touchstart",function(n){n.prevent(),nv(t,e),u()}),u=function(){pn(r)};return{update:function(){u();var n=Hp(t),e=de(n,o);gn(r,e)},isActive:function(){return 0<at(r).length},destroy:function(){i.unbind(),st(r)},clear:u}}(t,u),h=function(){p.clear()};return{toEditing:function(){l.toEditing(),h()},toReading:function(){l.toReading()},onToolbarTouch:function(n){l.onToolbarTouch(n)},refreshSelection:function(){p.isActive()&&p.update()},clearSelection:h,highlightSelection:function(){p.update()},scrollIntoView:function(n,e){qv(t,r,f,n,e)},updateToolbarPadding:w,setViewportOffset:function(n){s.setViewportOffset(n),Gv(r,n).get(y)},syncHeight:function(){Gi(u,"height",u.dom().contentWindow.document.body.scrollHeight+"px")},refreshStructure:s.refresh,destroy:function(){s.restore(),d.destroy(),g.unbind(),m.unbind(),l.destroy(),p.destroy(),Qh(rt(),lo)}}},Jv=function(r,n){var o=Jp(),i=Sd(),u=Sd(),c=wd(),a=wd();return{enter:function(){n.hide();var t=Je.fromDom(d.document);Up.getActiveApi(r.editor).each(function(n){i.set({socketHeight:gi(r.socket,"height"),iframeHeight:gi(n.frame(),"height"),outerScroll:d.document.body.scrollTop}),u.set({exclusives:fh.exclusive(t,"."+xg.scrollable())}),io(r.container,_i.resolve("fullscreen-maximized")),Yp(r.container,n.body()),o.maximize(),Gi(r.socket,"overflow","scroll"),Gi(r.socket,"-webkit-overflow-scrolling","touch"),so(n.body());var e=nn(["cWin","ceBody","socket","toolstrip","toolbar","dropup","contentElement","cursor","keyboardType","isScrolling","outerWindow","outerBody"],[]);c.set(Kv(e({cWin:n.win(),ceBody:n.body(),socket:r.socket,toolstrip:r.toolstrip,toolbar:r.toolbar,dropup:r.dropup.element(),contentElement:n.frame(),cursor:w,outerBody:r.body,outerWindow:r.win,keyboardType:ev.stubborn,isScrolling:function(){return u.get().exists(function(n){return n.socket.isScrolling()})}}))),c.run(function(n){n.syncHeight()}),a.set(tv(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){Gi(r.socket,"height",n)}),n.iframeHeight.each(function(n){Gi(r.editor.getFrame(),"height",n)}),d.document.body.scrollTop=n.scrollTop}),i.clear(),u.on(function(n){n.exclusives.unbind()}),u.clear(),co(r.container,_i.resolve("fullscreen-maximized")),Kp(),xg.deregister(r.toolbar),pi(r.socket,"overflow"),pi(r.socket,"-webkit-overflow-scrolling"),lo(r.editor.getFrame()),Up.getActiveApi(r.editor).each(function(n){n.clearSelection()})}}},Qv=function(n){var e=Xt("Getting IosWebapp schema",nh,n);Gi(e.toolstrip,"width","100%"),Gi(e.container,"position","relative");var t=$m(Zp(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)}},o=Jv(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:o.refreshStructure,enter:o.enter,exit:o.exit,destroy:w}};function Zv(n,e,t){n.system().broadcastOn([Uo.formatChanged()],{command:e,state:t})}function ny(m){return{getNotificationManagerImpl:function(){return{open:v({progressBar:{value:w},close:w,text:w,getEl:v(null),moveTo:w,moveRel:w,settings:{}}),close:w,reposition:w,getArgs:v({})}},renderUI:function(){var n=m.getElement(),e=ty(m);!1===function(n){return!1===n.settings.skin}(m)?(m.contentCSS.push(e.content),zo.DOM.styleSheetLoader.load(e.ui,oy(m))):oy(m)();function t(){m.fire("ScrollIntoView")}var f=L().os.isAndroid()?function c(n){var e=Jh({classes:[_i.resolve("android-container")]}),t=sh(),r=wd(),o=Ah(r),i=Fh(),u=kh(w,n);return e.add(t.wrapper()),e.add(i),e.add(u.component()),{system:v(e),element:e.element,init:function(n){r.set(eh(n))},exit:function(){r.run(function(n){n.exit(),cg.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){Bh(i,o,n,e.root())},socket:v(i),dropup:v(u)}}(t):function a(n){var e=Jh({classes:[_i.resolve("ios-container")]}),t=sh(),r=wd(),o=Ah(r),i=Fh(),u=kh(function(){r.run(function(n){n.refreshStructure()})},n);return e.add(t.wrapper()),e.add(i),e.add(u.component()),{system:v(e),element:e.element,init:function(n){r.set(Qv(n))},exit:function(){r.run(function(n){cg.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){Bh(i,o,n,e.root())},socket:v(i),dropup:v(u)}}(t);!function(n,e){gt(n,e,dn)}(Je.fromDom(n),f.system());function s(n,e,t,r){!1===r&&m.selection.collapse();var o=i(n,e,t);f.setToolbarGroups(!0===r?o.readOnly:o.main),m.setMode(!0===r?"readonly":"design"),m.fire(!0===r?iy():uy()),f.updateMode(r)}function l(n,e){return m.on(n,e),{unbind:function(){m.off(n)}}}var r=n.ownerDocument.defaultView,d=Ng(r,{onChange:function(){f.system().broadcastOn([Uo.orientationChanged()],{width:jg(r)})},onReady:w}),i=function(n,e,t){var r=n.get();return{readOnly:r.backToMask.concat(e.get()),main:r.backToMask.concat(t.get())}};return m.on("init",function(){f.init({editor:{getFrame:function(){return Je.fromDom(m.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:w}},onToReading:function(n){return l(iy(),n)},onToEditing:function(n){return l(uy(),n)},onScrollToCursor:function(e){m.on("ScrollIntoView",function(n){e(n)});return{unbind:function(){m.off("ScrollIntoView"),d.destroy()}}},onTouchToolstrip:function(){n()},onTouchContent:function(){(function(n){return go(n).bind(function(n){return f.system().getByDom(n).toOption()})})(Je.fromDom(m.editorContainer.querySelector("."+_i.resolve("toolbar")))).each($),f.restoreToolbar(),n()},onTapContent:function(n){var e=n.target();if("img"===q(e))m.selection.select(e.dom()),n.kill();else if("a"===q(e)){f.system().getByDom(Je.fromDom(m.editorContainer)).each(function(n){Ho.isAlpha(n)&&Go(e.dom())})}}},container:Je.fromDom(m.editorContainer),socket:Je.fromDom(m.contentAreaContainer),toolstrip:Je.fromDom(m.editorContainer.querySelector("."+_i.resolve("toolstrip"))),toolbar:Je.fromDom(m.editorContainer.querySelector("."+_i.resolve("toolbar"))),dropup:f.dropup(),alloy:f.system(),translate:w,setReadOnly:function(n){s(a,c,u,n)},readOnlyOnInit:function(){return!1}});var n=function(){f.dropup().disappear(function(){f.system().broadcastOn([Uo.dropupDismissed()],{})})},e={label:"The first group",scrollable:!1,items:[Ws.forToolbar("back",function(){m.selection.collapse(),f.exit()},{},m)]},t={label:"Back to read only",scrollable:!1,items:[Ws.forToolbar("readonly-back",function(){s(a,c,u,!0)},{},m)]},r=Ig(f,m),o=Rg(m.settings,r),i={label:"The extra group",scrollable:!1,items:[]},u=Pn([{label:"the action group",scrollable:!0,items:o},i]),c=Pn([{label:"The read only mode group",scrollable:!0,items:[]},i]),a=Pn({backToMask:[e],backToReadOnly:[t]});ry(f,m)}),m.on("remove",function(){f.exit()}),m.on("detach",function(){!function(e){var n=at(e.element());C(n,function(n){e.getByDom(n).each(lt)}),st(e.element())}(f.system()),f.system().destroy()}),{iframeContainer:f.socket().element().dom(),editorContainer:f.element().dom()}}}}var ey=tinymce.util.Tools.resolve("tinymce.EditorManager"),ty=function(n){var e=Dt(n.settings,"skin_url").fold(function(){return ey.baseURL+"/skins/ui/oxide"},function(n){return n});return{content:e+"/content.mobile.min.css",ui:e+"/skin.mobile.min.css"}},ry=function(r,n){var e=Bn(n.formatter.get());C(e,function(e){n.formatter.formatChanged(e,function(n){Zv(r,e,n)})}),C(["ul","ol"],function(t){n.selection.selectorChanged(t,function(n,e){Zv(r,t,n)})})},oy=(v(["x-small","small","medium","large","x-large"]),function(n){function e(){n._skinLoaded=!0,n.fire("SkinLoaded")}return function(){n.initialized?e():n.on("init",e)}}),iy=v("toReading"),uy=v("toEditing");!function ay(){Lo.add("mobile",ny)}()}(window);
9
+ !function(l){"use strict";var x=function(){return(x=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 u(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&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]])}return t}function w(){}function y(n){return n}var i=function(t,r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,n))}},b=function(n){return function(){return n}};function d(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)}}function m(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return!t.apply(null,n)}}function o(n){return function(){throw new Error(n)}}function t(n){return n()}function n(){return f}var e,c=b(!1),a=b(!0),f=(e={fold:function(n,e){return n()},is:c,isSome:c,isNone:a,getOr:g,getOrThunk:s,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:b(null),getOrUndefined:b(undefined),or:g,orThunk:s,map:n,each:w,bind:n,exists:c,forall:a,filter:n,equals:r,equals_:r,toArray:function(){return[]},toString:b("none()")},Object.freeze&&Object.freeze(e),e);function r(n){return n.isNone()}function s(n){return n()}function g(n){return n}function S(n,t){return jn(n,function(n,e){return{k:e,v:t(n,e)}})}function p(n,e){return Vn.call(n,e)}function h(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};function r(n){return Number(e.replace(t,"$"+n))}return zn(r(1),r(2))}function v(n,e){return function(){return e===n}}function T(n,e){return function(){return e===n}}function O(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}}function k(n,e){return-1<function(n,e){return se.call(n,e)}(n,e)}function E(n,e){for(var t=0,r=n.length;t<r;t++){if(e(n[t],t))return!0}return!1}function C(n,e){for(var t=0,r=n.length;t<r;t++){e(n[t],t)}}function D(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}function M(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}function I(n,e,t){return C(n,function(n){t=e(t,n)}),t}function R(n,e){for(var t=0,r=n.length;t<r;t++){var o=n[t];if(e(o,t))return Fn.some(o)}return Fn.none()}function A(n,e){for(var t=0,r=n.length;t<r;t++){if(e(n[t],t))return Fn.some(t)}return Fn.none()}function F(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!ie(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);le.apply(e,n[t])}return e}function B(n,e){var t=de(n,e);return F(t)}function V(n,e){for(var t=0,r=n.length;t<r;++t){if(!0!==e(n[t],t))return!1}return!0}function N(n){var e=fe.call(n,0);return e.reverse(),e}function j(n,e){return D(n,function(n){return!k(e,n)})}function _(n){return[n]}function P(n,e){var t=String(e).toLowerCase();return R(n,function(n){return n.search(t)})}function H(n,e){return-1!==n.indexOf(e)}function z(e){return function(n){return H(n,e)}}function L(){return be.get()}function G(n,e){Ye(n,n.element(),e,{})}function U(n,e,t){Ye(n,n.element(),e,t)}function $(n){G(n,Pe())}function W(n,e,t){Ye(n,e,t,{})}function X(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}}function q(n){return n.dom().nodeName.toLowerCase()}function Y(e){return function(n){return function(n){return n.dom().nodeType}(n)===e}}function K(n){var e=tt(n)?n.dom().parentNode:n.dom();return e!==undefined&&null!==e&&e.ownerDocument.body.contains(e)}function J(){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 C(e,function(n,e){r[n]=b(t[e])}),r}}function Q(n){return n.slice(0).sort()}function Z(e,n){if(!ie(n))throw new Error("The "+e+" fields must be an array. Was: "+n+".");C(n,function(n){if(!re(n))throw new Error("The value "+n+" in the "+e+" fields was not a string.")})}function nn(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 Z("required",o),Z("optional",i),function(n){var t=Q(n);R(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(", ")+"].")})}(u),function(e){var t=Bn(e);V(o,function(n){return k(t,n)})||function(n,e){throw new Error("All required keys ("+Q(n).join(", ")+") were not specified. Specified keys were: "+Q(e).join(", ")+".")}(o,t);var n=D(t,function(n){return!k(u,n)});0<n.length&&function(n){throw new Error("Unsupported keys for object: "+Q(n).join(", "))}(n);var r={};return C(o,function(n){r[n]=b(e[n])}),C(i,function(n){r[n]=b(Object.prototype.hasOwnProperty.call(e,n)?Fn.some(e[n]):Fn.none())}),r}}function en(n,e,t){return 0!=(n.compareDocumentPosition(e)&t)}function tn(n,e){var t=n.dom();if(t.nodeType!==ut)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")}function rn(n){return n.nodeType!==ut&&n.nodeType!==ct||0===n.childElementCount}function on(n,e){var t=e===undefined?l.document:e.dom();return rn(t)?[]:de(t.querySelectorAll(n),Je.fromDom)}function un(n,e){var t=e===undefined?l.document:e.dom();return rn(t)?Fn.none():Fn.from(t.querySelector(n)).map(Je.fromDom)}function cn(n,e){return n.dom()===e.dom()}function an(n){return Je.fromDom(n.dom().ownerDocument)}function fn(n){return Fn.from(n.dom().parentNode).map(Je.fromDom)}function sn(n,e){var t=n.dom().childNodes;return Fn.from(t[e]).map(Je.fromDom)}function ln(e,t){fn(e).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})}function dn(n,e){(function(n){return Fn.from(n.dom().nextSibling).map(Je.fromDom)})(n).fold(function(){fn(n).each(function(n){ft(n,e)})},function(n){ln(n,e)})}function mn(e,t){(function(n){return sn(n,0)})(e).fold(function(){ft(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})}function gn(e,n){C(n,function(n){ft(e,n)})}function pn(n){n.dom().textContent="",C(at(n),function(n){st(n)})}function hn(n,e){ft(n.element(),e.element())}function vn(e,n){var t=e.components();!function(n){C(n.components(),function(n){return st(n.element())}),pn(n.element()),n.syncComponents()}(e);var r=j(t,n);C(r,function(n){lt(n),e.getSystem().removeFromWorld(n)}),C(n,function(n){n.getSystem().isConnected()?hn(e,n):(e.getSystem().addToWorld(n),hn(e,n),K(e.element())&&dt(n)),e.syncComponents()})}function yn(e){var n=fn(e.element()).bind(function(n){return e.getSystem().getByDom(n).toOption()});!function(n){lt(n),st(n.element()),n.getSystem().removeFromWorld(n)}(e),n.each(function(n){n.syncComponents()})}function bn(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)bt.call(o,i)&&(t[i]=u(t[i],o[i]))}return t}}function xn(n){return St.defaultedThunk(b(n))}function wn(e){return function(n){return p(n,e)?Fn.from(n[e]):Fn.none()}}function Sn(n,e){return wn(e)(n)}function Tn(n,e){var t={};return t[n]=e,t}function On(n,e){return function(n,t){var r={};return Nn(n,function(n,e){k(t,e)||(r[e]=n)}),r}(n,e)}function kn(n,e){return function(e,t){return function(n){return p(n,e)?n[e]:t}}(n,e)}function En(n,e){return Tn(n,e)}function Cn(n){return function(n){var e={};return C(n,function(n){e[n.key]=n.value}),e}(n)}function Dn(n,e){var t=function(n){var e=[],t=[];return C(n,function(n){n.fold(function(n){e.push(n)},function(n){t.push(n)})}),{errors:e,values:t}}(n);return 0<t.errors.length?function(n){return vt.error(F(n))}(t.errors):function(n,e){return 0===n.length?vt.value(e):vt.value(xt(e,wt.apply(undefined,n)))}(t.values,e)}function Mn(n,e){return function(n,e){return p(n,e)&&n[e]!==undefined&&null!==n[e]}(n,e)}var In,Rn,An=function(t){function n(){return o}function e(n){return n(t)}var r=b(t),o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:a,isNone:c,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return An(n(t))},each:function(n){n(t)},bind:e,exists:e,forall:e,filter:function(n){return n(t)?o:f},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(c,function(n){return e(t,n)})}};return o},Fn={some:An,none:n,from:function(n){return null===n||n===undefined?f:An(n)}},Bn=Object.keys,Vn=Object.hasOwnProperty,Nn=function(n,e){for(var t=Bn(n),r=0,o=t.length;r<o;r++){var i=t[r];e(n[i],i)}},jn=function(n,r){var o={};return Nn(n,function(n,e){var t=r(n,e);o[t.k]=t.v}),o},_n=function(n,t){var r=[];return Nn(n,function(n,e){r.push(t(n,e))}),r},Pn=function(n){function e(){return t}var t=n;return{get:e,set:function(n){t=n},clone:function(){return Pn(e())}}},Hn=function(){return zn(0,0)},zn=function(n,e){return{major:n,minor:e}},Ln={nu:zn,detect:function(n,e){var t=String(e).toLowerCase();return 0===n.length?Hn():h(n,t)},unknown:Hn},Gn="Edge",Un="Chrome",$n="Opera",Wn="Firefox",Xn="Safari",qn=function(n){var e=n.current;return{current:e,version:n.version,isEdge:v(Gn,e),isChrome:v(Un,e),isIE:v("IE",e),isOpera:v($n,e),isFirefox:v(Wn,e),isSafari:v(Xn,e)}},Yn={unknown:function(){return qn({current:undefined,version:Ln.unknown()})},nu:qn,edge:b(Gn),chrome:b(Un),ie:b("IE"),opera:b($n),firefox:b(Wn),safari:b(Xn)},Kn="Windows",Jn="Android",Qn="Linux",Zn="Solaris",ne="FreeBSD",ee=function(n){var e=n.current;return{current:e,version:n.version,isWindows:T(Kn,e),isiOS:T("iOS",e),isAndroid:T(Jn,e),isOSX:T("OSX",e),isLinux:T(Qn,e),isSolaris:T(Zn,e),isFreeBSD:T(ne,e)}},te={unknown:function(){return ee({current:undefined,version:Ln.unknown()})},nu:ee,windows:b(Kn),ios:b("iOS"),android:b(Jn),linux:b(Qn),osx:b("OSX"),solaris:b(Zn),freebsd:b(ne)},re=O("string"),oe=O("object"),ie=O("array"),ue=O("boolean"),ce=O("function"),ae=O("number"),fe=Array.prototype.slice,se=Array.prototype.indexOf,le=Array.prototype.push,de=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},me=(ce(Array.from)&&Array.from,function(n,t){return P(n,t).map(function(n){var e=Ln.detect(n.versionRegexes,t);return{current:n.name,version:e}})}),ge=function(n,t){return P(n,t).map(function(n){var e=Ln.detect(n.versionRegexes,t);return{current:n.name,version:e}})},pe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,he=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return H(n,"edge/")&&H(n,"chrome")&&H(n,"safari")&&H(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,pe],search:function(n){return H(n,"chrome")&&!H(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return H(n,"msie")||H(n,"trident")}},{name:"Opera",versionRegexes:[pe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:z("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:z("firefox")},{name:"Safari",versionRegexes:[pe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(H(n,"safari")||H(n,"mobile/"))&&H(n,"applewebkit")}}],ve=[{name:"Windows",search:z("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return H(n,"iphone")||H(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:z("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:z("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:z("linux"),versionRegexes:[]},{name:"Solaris",search:z("sunos"),versionRegexes:[]},{name:"FreeBSD",search:z("freebsd"),versionRegexes:[]}],ye={browsers:b(he),oses:b(ve)},be=Pn(function(n,e){var t=ye.browsers(),r=ye.oses(),o=me(t,n).fold(Yn.unknown,Yn.nu),i=ge(r,n).fold(te.unknown,te.nu);return{browser:o,os:i,deviceType:function(n,e,t,r){var o=n.isiOS()&&!0===/ipad/i.test(t),i=n.isiOS()&&!o,u=n.isiOS()||n.isAndroid(),c=u||r("(pointer:coarse)"),a=o||!i&&u&&r("(min-device-width:768px)"),f=i||u&&!a,s=e.isSafari()&&n.isiOS()&&!1===/safari/i.test(t),l=!f&&!a&&!s;return{isiPad:b(o),isiPhone:b(i),isTablet:b(a),isPhone:b(f),isTouch:b(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:b(s),isDesktop:b(l)}}(i,o,n,e)}}(l.navigator.userAgent,function(n){return l.window.matchMedia(n).matches})),xe=b("touchstart"),we=b("touchmove"),Se=b("touchend"),Te=b("mousedown"),Oe=b("mousemove"),ke=b("mouseup"),Ee=b("mouseover"),Ce=b("keydown"),De=b("keyup"),Me=b("input"),Ie=b("change"),Re=b("click"),Ae=b("transitionend"),Fe=b("selectstart"),Be={tap:b("alloy.tap")},Ve=b("alloy.focus"),Ne=b("alloy.blur.post"),je=b("alloy.paste.post"),_e=b("alloy.receive"),Pe=b("alloy.execute"),He=b("alloy.focus.item"),ze=Be.tap,Le=b("alloy.longpress"),Ge=b("alloy.system.init"),Ue=b("alloy.system.attached"),$e=b("alloy.system.detached"),We=b("alloy.focusmanager.shifted"),Xe=b("alloy.highlight"),qe=b("alloy.dehighlight"),Ye=function(n,e,t,r){var o=x({target:e},r);n.getSystem().triggerEvent(t,e,S(o,b))},Ke=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:b(n)}},Je={fromHtml:function(n,e){var t=(e||l.document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw l.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return Ke(t.childNodes[0])},fromTag:function(n,e){var t=(e||l.document).createElement(n);return Ke(t)},fromText:function(n,e){var t=(e||l.document).createTextNode(n);return Ke(t)},fromDom:Ke,fromPoint:function(n,e,t){var r=n.dom();return Fn.from(r.elementFromPoint(e,t)).map(Ke)}},Qe=(l.Node.ATTRIBUTE_NODE,l.Node.CDATA_SECTION_NODE,l.Node.COMMENT_NODE,l.Node.DOCUMENT_NODE),Ze=(l.Node.DOCUMENT_TYPE_NODE,l.Node.DOCUMENT_FRAGMENT_NODE,l.Node.ELEMENT_NODE),nt=l.Node.TEXT_NODE,et=(l.Node.PROCESSING_INSTRUCTION_NODE,l.Node.ENTITY_REFERENCE_NODE,l.Node.ENTITY_NODE,l.Node.NOTATION_NODE,"undefined"!=typeof l.window?l.window:Function("return this;")(),Y(Ze)),tt=Y(nt),rt=X(function(){return ot(Je.fromDom(l.document))}),ot=function(n){var e=n.dom().body;if(null===e||e===undefined)throw new Error("Body is not available yet");return Je.fromDom(e)},it=function(n,e){return en(n,e,l.Node.DOCUMENT_POSITION_CONTAINED_BY)},ut=Ze,ct=Qe,at=(L().browser.isIE(),function(n){return de(n.dom().childNodes,Je.fromDom)}),ft=(J("element","offset"),function(n,e){n.dom().appendChild(e.dom())}),st=function(n){var e=n.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},lt=function(n){G(n,$e());var e=n.components();C(e,lt)},dt=function(n){var e=n.components();C(e,dt),G(n,Ue())},mt=function(n,e,t){n.getSystem().addToWorld(e),t(n.element(),e.element()),K(n.element())&&dt(e),n.syncComponents()},gt=function(n,e,t){t(n,e.element());var r=at(e.element());C(r,function(n){e.getByDom(n).each(dt)})},pt=function(t){return{is:function(n){return t===n},isValue:a,isError:c,getOr:b(t),getOrThunk:b(t),getOrDie:b(t),or:function(n){return pt(t)},orThunk:function(n){return pt(t)},fold:function(n,e){return e(t)},map:function(n){return pt(n(t))},mapError:function(n){return pt(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 Fn.some(t)}}},ht=function(t){return{is:c,isValue:c,isError:a,getOr:y,getOrThunk:function(n){return n()},getOrDie:function(){return o(String(t))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return ht(t)},mapError:function(n){return ht(n(t))},each:w,bind:function(n){return ht(t)},exists:c,forall:a,toOption:Fn.none}},vt={value:pt,error:ht,fromOption:function(n,e){return n.fold(function(){return ht(e)},pt)}},yt=function(u){if(!ie(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 C(u,function(n,r){var e=Bn(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(!ie(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=Bn(n);if(c.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+e.join(","));if(!V(c,function(n){return k(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){l.console.log(n,{constructors:c,constructor:o,params:t})}}}}),t},bt=Object.prototype.hasOwnProperty,xt=bn(function(n,e){return oe(n)&&oe(e)?xt(n,e):e}),wt=bn(function(n,e){return e}),St=yt([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Tt=St.strict,Ot=St.asOption,kt=St.defaultedThunk,Et=St.mergeWithThunk,Ct=(yt([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n){return wn(n)}),Dt=function(n,e){return Sn(n,e)};(Rn=In=In||{})[Rn.Error=0]="Error",Rn[Rn.Value=1]="Value";function Mt(n,e,t){return n.stype===In.Error?e(n.serror):t(n.svalue)}function It(n){return{stype:In.Value,svalue:n}}function Rt(n){return{stype:In.Error,serror:n}}function At(n){return i(dr,F)(n)}function Ft(n){return oe(n)&&100<Bn(n).length?" removed due to size":JSON.stringify(n,null,2)}function Bt(n,e){return dr([{path:n,getErrorInfo:e}])}function Vt(n,e,t){return Sn(e,t).fold(function(){return function(n,e,t){return Bt(n,function(){return'Could not find valid *strict* value for "'+e+'" in '+Ft(t)})}(n,t,e)},sr)}function Nt(n,e,t){var r=Sn(n,e).fold(function(){return t(n)},y);return sr(r)}function jt(u,c,n,a){return n.fold(function(r,t,n,o){function i(n){var e=o.extract(u.concat([r]),a,n);return pr(e,function(n){return Tn(t,a(n))})}function e(n){return n.fold(function(){var n=Tn(t,a(Fn.none()));return sr(n)},function(n){var e=o.extract(u.concat([r]),a,n);return pr(e,function(n){return Tn(t,a(Fn.some(n)))})})}return n.fold(function(){return mr(Vt(u,c,r),i)},function(n){return mr(Nt(c,r,n),i)},function(){return mr(function(n,e){return sr(Sn(n,e))}(c,r),e)},function(n){return mr(function(e,n,t){var r=Sn(e,n).map(function(n){return!0===n?t(e):n});return sr(r)}(c,r,n),e)},function(n){var e=n(c),t=pr(Nt(c,r,b({})),function(n){return xt(e,n)});return mr(t,i)})},function(n,e){var t=e(c);return sr(Tn(n,a(t)))})}function _t(r){return{extract:function(e,n,t){return gr(r(t,n),function(n){return function(n,e){return Bt(n,function(){return e})}(e,n)})},toString:function(){return"val"},toDsl:function(){return br.itemOf(r)}}}function Pt(n){var i=Sr(n),u=M(n,function(e,n){return n.fold(function(n){return xt(e,En(n,!0))},b(e))},{});return{extract:function(n,e,t){var r=ue(t)?[]:function(e){var n=Bn(e);return D(n,function(n){return Mn(e,n)})}(t),o=D(r,function(n){return!Mn(u,n)});return 0===o.length?i.extract(n,e,t):function(n,e){return Bt(n,function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"})}(n,o)},toString:i.toString,toDsl:i.toDsl}}function Ht(t,i){function u(n,e){return function(o){return{extract:function(t,r,n){var e=de(n,function(n,e){return o.extract(t.concat(["["+e+"]"]),r,n)});return yr(e)},toString:function(){return"array("+o.toString()+")"},toDsl:function(){return br.arrOf(o)}}}(_t(t)).extract(n,y,e)}return{extract:function(t,r,o){var n=Bn(o),e=u(t,n);return mr(e,function(n){var e=de(n,function(n){return wr.field(n,n,Tt(),i)});return Sr(e).extract(t,r,o)})},toString:function(){return"setOf("+i.toString()+")"},toDsl:function(){return br.setOf(t,i)}}}function zt(e,t,r,n,o){return Dt(n,o).fold(function(){return function(n,e,t){return Bt(n,function(){return'The chosen schema: "'+t+'" did not exist in branches: '+Ft(e)})}(e,n,o)},function(n){return n.extract(e.concat(["branch: "+o]),t,r)})}function Lt(n,o){return{extract:function(e,t,r){return Dt(r,n).fold(function(){return function(n,e){return Bt(n,function(){return'Choice schema did not contain choice key: "'+e+'"'})}(e,n)},function(n){return zt(e,t,r,o,n)})},toString:function(){return"chooseOn("+n+"). Possible values: "+Bn(o)},toDsl:function(){return br.choiceOf(n,o)}}}function Gt(e){return _t(function(n){return e(n).fold(dr,sr)})}function Ut(e,n){return Ht(function(n){return ar(e(n))},n)}function $t(n,e,t){return fr(function(n,e,t,r){var o=e.extract([n],t,r);return hr(o,function(n){return{input:r,errors:n}})}(n,e,y,t))}function Wt(n){return n.fold(function(n){throw new Error(Cr(n))},y)}function Xt(n,e,t){return Wt($t(n,e,t))}function qt(n,e){return Lt(n,S(e,Sr))}function Yt(n){return kr(n,n,Tt(),Tr())}function Kt(n,e){return kr(n,n,Tt(),e)}function Jt(n,e){return kr(n,n,Tt(),Sr(e))}function Qt(n){return kr(n,n,Ot(),Tr())}function Zt(n,e){return kr(n,n,Ot(),e)}function nr(n,e){return Zt(n,Sr(e))}function er(n,e){return Zt(n,Pt(e))}function tr(n,e){return kr(n,n,xn(e),Tr())}function rr(n,e,t){return kr(n,n,xn(e),t)}function or(n,e){return Or(n,e)}function ir(n,e){return cn(n.element(),e.event().target())}var ur,cr,ar=function(n){return n.fold(Rt,It)},fr=function(n){return Mt(n,vt.error,vt.value)},sr=It,lr=function(n){var e=[],t=[];return C(n,function(n){Mt(n,function(n){return t.push(n)},function(n){return e.push(n)})}),{values:e,errors:t}},dr=Rt,mr=function(n,e){return n.stype===In.Value?e(n.svalue):n},gr=function(n,e){return n.stype===In.Error?e(n.serror):n},pr=function(n,e){return n.stype===In.Value?{stype:In.Value,svalue:e(n.svalue)}:n},hr=function(n,e){return n.stype===In.Error?{stype:In.Error,serror:e(n.serror)}:n},vr=function(n,e){var t=lr(n);return 0<t.errors.length?At(t.errors):function(n,e){return 0<n.length?sr(xt(e,wt.apply(undefined,n))):sr(e)}(t.values,e)},yr=function(n){var e=lr(n);return 0<e.errors.length?At(e.errors):sr(e.values)},br=yt([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),xr=yt([{field:["name","presence","type"]},{state:["name"]}]),wr=yt([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Sr=function(r){return{extract:function(n,e,t){return function(e,t,n,r){var o=de(n,function(n){return jt(e,t,n,r)});return vr(o,{})}(n,t,r,e)},toString:function(){return"obj{\n"+de(r,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 br.objOf(de(r,function(n){return n.fold(function(n,e,t,r){return xr.field(n,t,r)},function(n,e){return xr.state(n)})}))}}},Tr=b(_t(sr)),Or=wr.state,kr=wr.field,Er=_t(sr),Cr=function(n){return"Errors: \n"+function(n){var e=10<n.length?n.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):n;return de(e,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()})}(n.errors)+"\n\nInput object: "+Ft(n.input)},Dr=b(Er),Mr=(ur=ce,cr="function",_t(function(n){var e=typeof n;return ur(n)?sr(n):dr("Expected type: "+cr+" but got: "+e)}));function Ir(n,e,t,r,o){return n(t,r)?Fn.some(t):ce(o)&&o(t)?Fn.none():e(t,r,o)}function Rr(n,e,t){for(var r=n.dom(),o=ce(t)?t:b(!1);r.parentNode;){r=r.parentNode;var i=Je.fromDom(r);if(e(i))return Fn.some(i);if(o(i))break}return Fn.none()}function Ar(n,e,t){return Ir(function(n,e){return e(n)},Rr,n,e,t)}function Fr(n,o){var i=function(n){for(var e=0;e<n.childNodes.length;e++){var t=Je.fromDom(n.childNodes[e]);if(o(t))return Fn.some(t);var r=i(n.childNodes[e]);if(r.isSome())return r}return Fn.none()};return i(n.dom())}function Br(n){if(!Mn(n,"can")&&!Mn(n,"abort")&&!Mn(n,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(n,null,2)+" does not have can, abort, or run!");return Xt("Extracting event.handler",Pt([tr("can",b(!0)),tr("abort",b(!1)),tr("run",w)]),n)}function Vr(t){var n=function(e,r){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return I(e,function(n,e){return n&&r(e).apply(undefined,t)},!0)}}(t,function(n){return n.can}),e=function(e,r){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return I(e,function(n,e){return n||r(e).apply(undefined,t)},!1)}}(t,function(n){return n.abort});return Br({can:n,abort:e,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];C(t,function(n){n.run.apply(undefined,e)})}})}function Nr(n){return Cn(n)}function jr(n,e){return{key:n,value:Br({abort:e})}}function _r(n,e){return{key:n,value:Br({run:e})}}function Pr(n,t,r){return{key:n,value:Br({run:function(n,e){t.apply(undefined,[n,e].concat(r))}})}}function Hr(n){return function(t){return{key:n,value:Br({run:function(n,e){ir(n,e)&&t(n,e)}})}}}function zr(n,e,t){return function(t,r){return _r(t,function(n,e){n.getSystem().getByUid(r).each(function(n){!function(n,e,t,r){n.getSystem().triggerEvent(t,e,r.event())}(n,n.element(),t,e)})})}(n,e.partUids[t])}function Lr(n){return _r(n,function(n,e){e.cut()})}function Gr(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:Io(i)}},n}function Ur(n){return{classes:n.classes!==undefined?n.classes:[],attributes:n.attributes!==undefined?n.attributes:{},styles:n.styles!==undefined?n.styles:{}}}function $r(t,r,o){return Do(function(n,e){o(n,t,r)})}function Wr(o,i,u){return function(n,e,t){var r=t.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:e,parameters:Io(u.slice(0,1).concat(u.slice(3)))}},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:b(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))})},u,i)}function Xr(n){return{key:n,value:undefined}}function qr(n){var e=Xt("Creating behaviour: "+n.name,Vo,n);return function(n,e,t,r,o,i){var u=Pt(n),c=nr(e,[er("config",n)]);return Ro(u,c,e,t,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)}function Yr(n,e,t){if(!(re(t)||ue(t)||ae(t)))throw l.console.error("Invalid call to Attr.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")}function Kr(n,e,t){Yr(n.dom(),e,t)}function Jr(n,e){var t=n.dom();Nn(e,function(n,e){Yr(t,e,n)})}function Qr(n,e){var t=n.dom().getAttribute(e);return null===t?undefined:t}function Zr(n,e){var t=n.dom();return!(!t||!t.hasAttribute)&&t.hasAttribute(e)}function no(n,e){n.dom().removeAttribute(e)}function eo(n,e){var t=Qr(n,e);return t===undefined||""===t?[]:t.split(" ")}function to(n){return n.dom().classList!==undefined}function ro(n,e){return function(n,e,t){var r=eo(n,e).concat([t]);return Kr(n,e,r.join(" ")),!0}(n,"class",e)}function oo(n,e){return function(n,e,t){var r=D(eo(n,e),function(n){return n!==t});return 0<r.length?Kr(n,e,r.join(" ")):no(n,e),!1}(n,"class",e)}function io(n,e){to(n)?n.dom().classList.add(e):ro(n,e)}function uo(n){0===(to(n)?n.dom().classList:function(n){return eo(n,"class")}(n)).length&&no(n,"class")}function co(n,e){to(n)?n.dom().classList.remove(e):oo(n,e),uo(n)}function ao(n,e){return to(n)&&n.dom().classList.contains(e)}function fo(n,e,t){co(n,t),io(n,e)}function so(n){n.dom().focus()}function lo(n){n.dom().blur()}function mo(n){var e=n!==undefined?n.dom():l.document;return Fn.from(e.activeElement).map(Je.fromDom)}function go(e){return mo(an(e)).filter(function(n){return e.dom().contains(n.dom())})}function po(n){return n.dom().innerHTML}function ho(n,e){var t=an(n).dom(),r=Je.fromDom(t.createDocumentFragment()),o=function(n,e){var t=(e||l.document).createElement("div");return t.innerHTML=n,at(Je.fromDom(t))}(e,t);gn(r,o),pn(n),ft(n,r)}function vo(n){return function(n,e){return Je.fromDom(n.dom().cloneNode(e))}(n,!1)}function yo(n){return function(n){var e=Je.fromTag("div"),t=Je.fromDom(n.dom().cloneNode(!0));return ft(e,t),po(e)}(vo(n))}function bo(n){return yo(n)}function xo(n){for(var e=[],t=function(n){e.push(n)},r=0;r<n.length;r++)n[r].each(t);return e}function wo(n,e){for(var t=0;t<n.length;t++){var r=e(n[t],t);if(r.isSome())return r}return Fn.none()}var So,To,Oo,ko=function(n,e,t){return Ar(n,function(n){return e(n).isSome()},t).bind(e)},Eo=Hr(Ue()),Co=Hr($e()),Do=Hr(Ge()),Mo=(So=Pe(),function(n){return _r(So,n)}),Io=function(n){return de(n,function(n){return function(n,e){return function(n,e,t){return""===e||!(n.length<e.length)&&n.substr(t,t+e.length)===e}(n,e,n.length-e.length)}(n,"/*")?n.substring(0,n.length-"/*".length):n})},Ro=function(t,n,r,o,e,i,u){function c(n){return Mn(n,r)?n[r]():Fn.none()}var a=S(e,function(n,e){return Wr(r,n,e)}),f=S(i,function(n,e){return Gr(n,e)}),s=x(x(x({},f),a),{revoke:d(Xr,r),config:function(n){var e=Xt(r+"-config",t,n);return{key:r,value:{config:e,me:s,configAsRaw:X(function(){return Xt(r+"-config",t,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,t){return c(n).bind(function(e){return Dt(o,"exhibit").map(function(n){return n(t,e.config,e.state)})}).getOr(Ur({}))},name:function(){return r},handlers:function(n){return c(n).map(function(n){return kn("events",function(n,e){return{}})(o)(n.config,n.state)}).getOr({})}});return s},Ao={init:function(){return Fo({readState:function(){return"No State required"}})}},Fo=function(n){return n},Bo=function(n){return Cn(n)},Vo=Pt([Yt("fields"),Yt("name"),tr("active",{}),tr("apis",{}),tr("state",Ao),tr("extra",{})]),No=Pt([Yt("branchKey"),Yt("branches"),Yt("name"),tr("active",{}),tr("apis",{}),tr("state",Ao),tr("extra",{})]),jo=b(undefined),_o=/* */Object.freeze({toAlpha:function(n,e,t){fo(n.element(),e.alpha,e.omega)},toOmega:function(n,e,t){fo(n.element(),e.omega,e.alpha)},isAlpha:function(n,e,t){return ao(n.element(),e.alpha)},isOmega:function(n,e,t){return ao(n.element(),e.omega)},clear:function(n,e,t){co(n.element(),e.alpha),co(n.element(),e.omega)}}),Po=[Yt("alpha"),Yt("omega")],Ho=qr({fields:Po,name:"swapping",apis:_o}),zo=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Lo=tinymce.util.Tools.resolve("tinymce.ThemeManager"),Go=function(n){var e=l.document.createElement("a");e.target="_blank",e.href=n.href,e.rel="noreferrer noopener";var t=l.document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,l.window,0,0,0,0,0,!1,!1,!1,!1,0,null),l.document.body.appendChild(e),e.dispatchEvent(t),l.document.body.removeChild(e)},Uo={formatChanged:b("formatChanged"),orientationChanged:b("orientationChanged"),dropupDismissed:b("dropupDismissed")},$o=/* */Object.freeze({events:function(e){return Nr([_r(_e(),function(o,i){var u=e.channels,n=function(n,e){return e.universal()?n:D(n,function(n){return k(e.channels(),n)})}(Bn(u),i);C(n,function(n){var e=u[n],t=e.schema,r=Xt("channel["+n+"] data\nReceiver: "+bo(o.element()),t,i.data());e.onReceive(o,r)})})])}}),Wo="unknown";(Oo=To=To||{})[Oo.STOP=0]="STOP",Oo[Oo.NORMAL=1]="NORMAL",Oo[Oo.LOGGING=2]="LOGGING";function Xo(e,n,t){switch(Dt(yi.get(),e).orThunk(function(){var n=Bn(yi.get());return wo(n,function(n){return-1<e.indexOf(n)?Fn.some(yi.get()[n]):Fn.none()})}).getOr(To.NORMAL)){case To.NORMAL:return t(xi());case To.LOGGING:var r=function(e,t){var r=[],o=(new Date).getTime();return{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(){var n=(new Date).getTime();k(["mousemove","mouseover","mouseout",Ge()],e)||l.console.log(e,{event:e,time:n-o,target:t.dom(),sequence:de(r,function(n){return k(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+bo(n.target)+")":n.outcome})})}}}(e,n),o=t(r);return r.write(),o;case To.STOP:return!0}}function qo(n,e,t){return Xo(n,e,t)}function Yo(n,e,t){return function(){var n=new Error;if(n.stack===undefined)return;var e=n.stack.split("\n");R(e,function(e){return 0<e.indexOf("alloy")&&!E(bi,function(n){return-1<e.indexOf(n)})}).getOr(Wo)}(),kr(e,e,t,Gt(function(t){return vt.value(function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.apply(undefined,n)})}))}function Ko(n){return Yo(0,n,xn(w))}function Jo(n){return Yo(0,n,xn(Fn.none))}function Qo(n){return Yo(0,n,Tt())}function Zo(n){return Yo(0,n,Tt())}function ni(n,e){return or(n,b(e))}function ei(n){return or(n,y)}function ti(n,e,t){var r=e.aria;r.update(n,r,t.get())}function ri(e,n,t){n.toggleClass.each(function(n){t.get()?io(e.element(),n):co(e.element(),n)})}function oi(n,e,t){Di(n,e,t,!t.get())}function ii(n,e,t){t.set(!0),ri(n,e,t),ti(n,e,t)}function ui(n,e,t){t.set(!1),ri(n,e,t),ti(n,e,t)}function ci(n,e,t){Di(n,e,t,e.selected)}function ai(){function n(n,e){e.stop(),$(n)}return[_r(Re(),n),_r(ze(),n),Lr(xe()),Lr(Te())]}function fi(n,e){e.ignore||(so(n.element()),e.onFocus(n))}function si(n){return n.style!==undefined&&ce(n.style.getPropertyValue)}function li(n,e,t){if(!re(t))throw l.console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);si(n)&&n.style.setProperty(e,t)}function di(n,e){var t=n.dom();Nn(e,function(n,e){li(t,e,n)})}function mi(n,e){var t=n.dom(),r=l.window.getComputedStyle(t).getPropertyValue(e),o=""!==r||K(n)?r:Ui(t,e);return null===o?undefined:o}function gi(n,e){var t=n.dom(),r=Ui(t,e);return Fn.from(r).filter(function(n){return 0<n.length})}function pi(n,e){!function(n,e){si(n)&&n.style.removeProperty(e)}(n.dom(),e),Zr(n,"style")&&""===function(n){return n.replace(/^\s+|\s+$/g,"")}(Qr(n,"style"))&&no(n,"style")}function hi(n){return n.dom().offsetWidth}var vi,yi=Pn({}),bi=["alloy/data/Fields","alloy/debugging/Debugging"],xi=b({logEventCut:w,logEventStopped:w,logNoParent:w,logEventNoHandlers:w,logEventResponse:w,write:w}),wi=b([Yt("menu"),Yt("selectedMenu")]),Si=b([Yt("item"),Yt("selectedItem")]),Ti=(b(Sr(Si().concat(wi()))),b(Sr(Si()))),Oi=Jt("initSize",[Yt("numColumns"),Yt("numRows")]),ki=b(Oi),Ei=[Kt("channels",Ut(vt.value,Pt([Qo("onReceive"),tr("schema",Dr())])))],Ci=qr({fields:Ei,name:"receiving",active:$o}),Di=function(n,e,t,r){(r?ii:ui)(n,e,t)},Mi=/* */Object.freeze({onLoad:ci,toggle:oi,isOn:function(n,e,t){return t.get()},on:ii,off:ui,set:Di}),Ii=/* */Object.freeze({exhibit:function(n,e,t){return Ur({})},events:function(n,e){var t=function(e,t,r){return Mo(function(n){r(n,e,t)})}(n,e,oi),r=$r(n,e,ci);return Nr(F([n.toggleOnExecute?[t]:[],[r]]))}}),Ri=function(n,e,t){Kr(n.element(),"aria-expanded",t)},Ai=[tr("selected",!1),Qt("toggleClass"),tr("toggleOnExecute",!0),rr("aria",{mode:"none"},qt("mode",{pressed:[tr("syncWithExpanded",!1),ni("update",function(n,e,t){Kr(n.element(),"aria-pressed",t),e.syncWithExpanded&&Ri(n,e,t)})],checked:[ni("update",function(n,e,t){Kr(n.element(),"aria-checked",t)})],expanded:[ni("update",Ri)],selected:[ni("update",function(n,e,t){Kr(n.element(),"aria-selected",t)})],none:[ni("update",w)]}))],Fi=qr({fields:Ai,name:"toggling",active:Ii,apis:Mi,state:(vi=!1,{init:function(){var e=Pn(vi);return{get:function(){return e.get()},set:function(n){return e.set(n)},clear:function(){return e.set(vi)},readState:function(){return e.get()}}}})}),Bi=function(t,r){return Ci.config({channels:En(Uo.formatChanged(),{onReceive:function(n,e){e.command===t&&r(n,e.state)}})})},Vi=function(n){return Ci.config({channels:En(Uo.orientationChanged(),{onReceive:n})})},Ni=function(n,e){return{key:n,value:{onReceive:e}}},ji="tinymce-mobile",_i={resolve:function(n){return ji+"-"+n},prefix:b(ji)},Pi=/* */Object.freeze({focus:fi,blur:function(n,e){e.ignore||lo(n.element())},isFocused:function(n){return function(n){var e=an(n).dom();return n.dom()===e.activeElement}(n.element())}}),Hi=/* */Object.freeze({exhibit:function(n,e){var t=e.ignore?{}:{attributes:{tabindex:"-1"}};return Ur(t)},events:function(t){return Nr([_r(Ve(),function(n,e){fi(n,t),e.stop()})].concat(t.stopMousedown?[_r(Te(),function(n,e){e.event().prevent()})]:[]))}}),zi=[Ko("onFocus"),tr("stopMousedown",!1),tr("ignore",!1)],Li=qr({fields:zi,name:"focusing",active:Hi,apis:Pi}),Gi=function(n,e,t){var r=n.dom();li(r,e,t)},Ui=function(n,e){return si(n)?n.style.getPropertyValue(e):""};function $i(r,o){function n(n){var e=o(n);if(e<=0||null===e){var t=mi(n,r);return parseFloat(t)||0}return e}function i(o,n){return I(n,function(n,e){var t=mi(o,e),r=t===undefined?0:parseInt(t,10);return isNaN(r)?n:n+r},0)}return{set:function(n,e){if(!ae(e)&&!e.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+e);var t=n.dom();si(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}}}function Wi(n){return yu.get(n)}function Xi(n,e,t){return D(function(n,e){for(var t=ce(e)?e:c,r=n.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=Je.fromDom(i);if(o.push(u),!0===t(u))break;r=i}return o}(n,t),e)}function qi(n,e){return D(function(e){return fn(e).map(at).map(function(n){return D(n,function(n){return!cn(e,n)})}).getOr([])}(n),e)}function Yi(n,e){return on(e,n)}function Ki(n){return un(n)}function Ji(n,e,t){return Rr(n,function(n){return tn(n,e)},t)}function Qi(n,e){return un(e,n)}function Zi(n,e,t){return Ir(tn,Ji,n,e,t)}function nu(n,e,t){var r=N(n.slice(0,e)),o=N(n.slice(e+1));return R(r.concat(o),t)}function eu(n,e,t){var r=N(n.slice(0,e));return R(r,t)}function tu(n,e,t){var r=n.slice(0,e),o=n.slice(e+1);return R(o.concat(r),t)}function ru(n,e,t){var r=n.slice(e+1);return R(r,t)}function ou(t){return function(n){var e=n.raw();return k(t,e.which)}}function iu(n){return function(e){return V(n,function(n){return n(e)})}}function uu(n){return!0===n.raw().shiftKey}function cu(n){return!0===n.raw().ctrlKey}function au(n,e){return{matches:n,classification:e}}function fu(n,e,t,r){var o=n+e;return r<o?t:o<t?r:o}function su(n,e,t){return n<=e?e:t<=n?t:n}function lu(t,r,n,o){var e=Yi(t.element(),"."+r.highlightClass);C(e,function(e){E(o,function(n){return n.element()===e})||(co(e,r.highlightClass),t.getSystem().getByDom(e).each(function(n){r.onDehighlight(t,n),G(n,qe())}))})}function du(n,e,t,r){lu(n,e,0,[r]),xu(n,e,t,r)||(io(r.element(),e.highlightClass),e.onHighlight(n,r),G(r,Xe()))}function mu(t,e,n,r){var o=Yi(t.element(),"."+e.itemClass);return A(o,function(n){return ao(n,e.highlightClass)}).bind(function(n){var e=fu(n,r,0,o.length-1);return t.getSystem().getByDom(o[e]).toOption()})}function gu(n,e,t){e.exists(function(e){return t.exists(function(n){return cn(n,e)})})||U(n,We(),{prevFocus:e,newFocus:t})}function pu(){function o(n){return go(n.element())}return{get:o,set:function(n,e){var t=o(n);n.getSystem().triggerFocus(e,n.element());var r=o(n);gu(n,t,r)}}}var hu,vu,yu=$i("height",function(n){var e=n.dom();return K(n)?e.getBoundingClientRect().height:e.offsetHeight}),bu=m(uu),xu=function(n,e,t,r){return ao(r.element(),e.highlightClass)},wu=function(n,e,t,r){var o=Yi(n.element(),"."+e.itemClass);return Fn.from(o[r]).fold(function(){return vt.error("No element found with index "+r)},n.getSystem().getByDom)},Su=function(e,n,t){return Qi(e.element(),"."+n.itemClass).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Tu=function(e,n,t){var r=Yi(e.element(),"."+n.itemClass);return(0<r.length?Fn.some(r[r.length-1]):Fn.none()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Ou=function(e,n,t){var r=Yi(e.element(),"."+n.itemClass);return xo(de(r,function(n){return e.getSystem().getByDom(n).toOption()}))},ku=/* */Object.freeze({dehighlightAll:function(n,e,t){return lu(n,e,0,[])},dehighlight:function(n,e,t,r){xu(n,e,t,r)&&(co(r.element(),e.highlightClass),e.onDehighlight(n,r),G(r,qe()))},highlight:du,highlightFirst:function(e,t,r){Su(e,t).each(function(n){du(e,t,r,n)})},highlightLast:function(e,t,r){Tu(e,t).each(function(n){du(e,t,r,n)})},highlightAt:function(e,t,r,n){wu(e,t,r,n).fold(function(n){throw new Error(n)},function(n){du(e,t,r,n)})},highlightBy:function(e,t,r,n){var o=Ou(e,t);R(o,n).each(function(n){du(e,t,r,n)})},isHighlighted:xu,getHighlighted:function(e,n,t){return Qi(e.element(),"."+n.highlightClass).bind(function(n){return e.getSystem().getByDom(n).toOption()})},getFirst:Su,getLast:Tu,getPrevious:function(n,e,t){return mu(n,e,0,-1)},getNext:function(n,e,t){return mu(n,e,0,1)},getCandidates:Ou}),Eu=[Yt("highlightClass"),Yt("itemClass"),Ko("onHighlight"),Ko("onDehighlight")],Cu=qr({fields:Eu,name:"highlighting",apis:ku});(vu=hu=hu||{}).OnFocusMode="onFocus",vu.OnEnterOrSpaceMode="onEnterOrSpace",vu.OnApiMode="onApi";function Du(n,e,t,i,u){function c(e,t,n,r,o){return function(n,e){return R(n,function(n){return n.matches(e)}).map(function(n){return n.classification})}(n(e,t,r,o),t.event()).bind(function(n){return n(e,t,r,o)})}var r={schema:function(){return n.concat([tr("focusManager",pu()),rr("focusInside","onFocus",Gt(function(n){return k(["onFocus","onEnterOrSpace","onApi"],n)?vt.value(n):vt.error("Invalid value for focusInside")})),ni("handler",r),ni("state",e),ni("sendFocusIn",u)])},processKey:c,toEvents:function(r,o){var n=r.focusInside!==hu.OnFocusMode?Fn.none():u(r).map(function(t){return _r(Ve(),function(n,e){t(n,r,o),e.stop()})});return Nr(n.toArray().concat([_r(Ce(),function(n,e){c(n,e,t,r,o).fold(function(){!function(e,t){var n=ou([32].concat([13]))(t.event());r.focusInside===hu.OnEnterOrSpaceMode&&n&&ir(e,t)&&u(r).each(function(n){n(e,r,o),t.stop()})}(n,e)},function(n){e.stop()})}),_r(De(),function(n,e){c(n,e,i,r,o).each(function(n){e.stop()})})]))}};return r}function Mu(n){function i(n,e){var t=n.visibilitySelector.bind(function(n){return Zi(e,n)}).getOr(e);return 0<Wi(t)}function e(e,t){(function(n,e){var t=Yi(n.element(),e.selector),r=D(t,function(n){return i(e,n)});return Fn.from(r[e.firstTabstop])})(e,t).each(function(n){t.focusManager.set(e,n)})}function u(e,n,t,r,o){return o(n,t,function(n){return function(n,e){return i(n,e)&&n.useTabstopAt(e)}(r,n)}).fold(function(){return r.cyclic?Fn.some(!0):Fn.none()},function(n){return r.focusManager.set(e,n),Fn.some(!0)})}function c(e,n,t,r){var o=Yi(e.element(),t.selector);return function(n,e){return e.focusManager.get(n).bind(function(n){return Zi(n,e.selector)})}(e,t).bind(function(n){return A(o,d(cn,n)).bind(function(n){return u(e,o,n,t,r)})})}var t=[Qt("onEscape"),Qt("onEnter"),tr("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),tr("firstTabstop",0),tr("useTabstopAt",b(!0)),Qt("visibilitySelector")].concat([n]),r=b([au(iu([uu,ou([9])]),function(n,e,t,r){var o=t.cyclic?nu:eu;return c(n,0,t,o)}),au(ou([9]),function(n,e,t,r){var o=t.cyclic?tu:ru;return c(n,0,t,o)}),au(ou([27]),function(e,t,n,r){return n.onEscape.bind(function(n){return n(e,t)})}),au(iu([bu,ou([13])]),function(e,t,n,r){return n.onEnter.bind(function(n){return n(e,t)})})]),o=b([]);return Du(t,Ao.init,r,o,function(){return Fn.some(e)})}function Iu(n){return"input"===q(n)&&"radio"!==Qr(n,"type")||"textarea"===q(n)}function Ru(n,e,t){return Iu(t)&&ou([32])(e.event())?Fn.none():function(n,e,t){return W(n,t,Pe()),Fn.some(!0)}(n,0,t)}function Au(n,e){return Fn.some(!0)}function Fu(n,e,t){return t.execute(n,e,n.element())}function Bu(n){var t=Pn(Fn.none());return Fo({readState:function(){return t.get().map(function(n){return{numRows:n.numRows(),numColumns:n.numColumns()}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(n,e){t.set(Fn.some({numRows:b(n),numColumns:b(e)}))},getNumRows:function(){return t.get().map(function(n){return n.numRows()})},getNumColumns:function(){return t.get().map(function(n){return n.numColumns()})}})}function Vu(e,t){return function(n){return"rtl"===Yc(n)?t:e}}function Nu(i){return function(n,e,t,r){var o=i(n.element());return Kc(o,n,e,t,r)}}function ju(n,e){var t=Vu(n,e);return Nu(t)}function _u(n,e){var t=Vu(e,n);return Nu(t)}function Pu(o){return function(n,e,t,r){return Kc(o,n,e,t,r)}}function Hu(n){return!function(n){return n.offsetWidth<=0&&n.offsetHeight<=0}(n.dom())}function zu(n,e,t){var r=d(cn,e),o=Yi(n,t);return function(e,n){return A(e,n).map(function(n){return na({index:n,candidates:e})})}(D(o,Hu),r)}function Lu(n,e){return A(n,function(n){return cn(e,n)})}function Gu(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?Fn.some(t[e]):Fn.none()})}function Uu(o,n,i,u,c){return Gu(o,n,u,function(n,e){var t=n===i-1?o.length-n*u:u,r=fu(e,c,0,t-1);return Fn.some({row:b(n),column:b(r)})})}function $u(i,n,u,c,a){return Gu(i,n,c,function(n,e){var t=fu(n,a,0,u-1),r=t===u-1?i.length-t*c:c,o=su(e,0,r-1);return Fn.some({row:b(t),column:b(o)})})}function Wu(e,t,n){Qi(e.element(),t.selector).each(function(n){t.focusManager.set(e,n)})}function Xu(o){return function(n,e,t,r){return zu(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))})}}function qu(n,e,t,r){return t.captureTab?Fn.some(!0):Fn.none()}function Yu(n,e,t,o){var i=function(n,e,t){var r=fu(e,o,0,t.length-1);return r===n?Fn.none():function(n){return"button"===q(n)&&"disabled"===Qr(n,"disabled")}(t[r])?i(n,r,t):Fn.from(t[r])};return zu(n,t,e).bind(function(n){var e=n.index(),t=n.candidates();return i(e,e,t)})}function Ku(e,t,r){return function(n,e){return e.focusManager.get(n).bind(function(n){return Zi(n,e.selector)})}(e,r).bind(function(n){return r.execute(e,t,n)})}function Ju(e,t){t.getInitial(e).orThunk(function(){return Qi(e.element(),t.selector)}).each(function(n){t.focusManager.set(e,n)})}function Qu(n,e,t){return Yu(n,t.selector,e,-1)}function Zu(n,e,t){return Yu(n,t.selector,e,1)}function nc(r){return function(n,e,t){return r(n,e,t).bind(function(){return t.executeOnMove?Ku(n,e,t):Fn.some(!0)})}}function ec(n,e,t,r){return t.onEscape(n,e)}function tc(n,e,t){return Fn.from(n[e]).bind(function(n){return Fn.from(n[t]).map(function(n){return da({rowIndex:e,columnIndex:t,cell:n})})})}function rc(n,e,t,r){var o=n[e].length,i=fu(t,r,0,o-1);return tc(n,e,i)}function oc(n,e,t,r){var o=fu(t,r,0,n.length-1),i=n[o].length,u=su(e,0,i-1);return tc(n,o,u)}function ic(n,e,t,r){var o=n[e].length,i=su(t+r,0,o-1);return tc(n,e,i)}function uc(n,e,t,r){var o=su(t+r,0,n.length-1),i=n[o].length,u=su(e,0,i-1);return tc(n,o,u)}function cc(e,t){t.previousSelector(e).orThunk(function(){var n=t.selectors;return Qi(e.element(),n.cell)}).each(function(n){t.focusManager.set(e,n)})}function ac(n,e){return function(o,t,i){var u=i.cycles?n:e;return Zi(t,i.selectors.row).bind(function(n){var e=Yi(n,i.selectors.cell);return Lu(e,t).bind(function(t){var r=Yi(o,i.selectors.row);return Lu(r,n).bind(function(n){var e=function(n,e){return de(n,function(n){return Yi(n,e.selectors.cell)})}(r,i);return u(e,n,t).map(function(n){return n.cell()})})})})}}function fc(e,t,r){return r.focusManager.get(e).bind(function(n){return r.execute(e,t,n)})}function sc(e,t){Qi(e.element(),t.selector).each(function(n){t.focusManager.set(e,n)})}function lc(n,e,t){return Yu(n,t.selector,e,-1)}function dc(n,e,t){return Yu(n,t.selector,e,1)}function mc(e,n){return function(n,e,t){return rr(n,e,Sr(t))}(e,{},de(n,function(n){return function(e,t){return kr(e,e,Ot(),_t(function(n){return dr("The field: "+e+" is forbidden. "+t)}))}(n.name(),"Cannot configure "+n.name()+" for "+e)}).concat([or("dump",y)]))}function gc(n){return n.dump}function pc(n,e){return x(x({},n.dump),Bo(e))}function hc(n,e,t,r){return t.uiType===_a?function(n,e,t,r){return n.exists(function(n){return n!==t.owner})?Pa.single(!0,b(t)):Dt(r,t.name).fold(function(){throw new Error("Unknown placeholder component: "+t.name+"\nKnown: ["+Bn(r)+"]\nNamespace: "+n.getOr("none")+"\nSpec: "+JSON.stringify(t,null,2))},function(n){return n.replace()})}(n,0,t,r):Pa.single(!1,b(t))}function vc(e,t,n,r){var o=S(r,function(n,e){return function(n,e){var t=!1;return{name:b(n),required:function(){return e.fold(function(n,e){return n},function(n,e){return n})},used:function(){return t},replace:function(){if(!0===t)throw new Error("Trying to use the same placeholder more than once: "+n);return t=!0,e}}}(e,n)}),i=function(e,t,n,r){return B(n,function(n){return Ha(e,t,n,r)})}(e,t,n,o);return Nn(o,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: "+JSON.stringify(t.components,null,2))}),i}function yc(n){var e=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++Ua+String(e)}function bc(n){function e(n){return n.name}return n.fold(e,e,e,e)}function xc(t,r){return function(n){var e=Xt("Converting part type",r,n);return t(e)}}function wc(n,e,t,r){return xt(e.defaults(n,t,r),t,{uid:n.partUids[e.name]},e.overrides(n,t,r))}function Sc(o,n){var e={};return C(n,function(n){(function(n){return n.fold(Fn.some,Fn.none,Fn.some,Fn.some)})(n).each(function(t){var r=cf(o,t.pname);e[t.name]=function(n){var e=Xt("Part: "+t.name+" in "+o,Sr(t.schema),n);return x(x({},r),{config:n,validated:e})}})}),e}function Tc(n,e,t){return function(n,t,e){var i={},r={};return C(e,function(n){n.fold(function(r){i[r.pname]=za(!0,function(n,e,t){return r.factory.sketch(wc(n,r,e,t))})},function(n){var e=t.parts[n.name];r[n.name]=b(n.factory.sketch(wc(t,n,e[uf()]),e))},function(r){i[r.pname]=za(!1,function(n,e,t){return r.factory.sketch(wc(n,r,e,t))})},function(o){i[o.pname]=La(!0,function(e,n,t){var r=e[o.name];return de(r,function(n){return o.factory.sketch(xt(o.defaults(e,n,t),n,o.overrides(e,n)))})})})}),{internals:b(i),externals:b(r)}}(0,e,t)}function Oc(n,e,t){return vc(Fn.some(n),e,e.components,t)}function kc(n,e,t){var r=e.partUids[t];return n.getSystem().getByUid(r).toOption()}function Ec(n,e,t){return kc(n,e,t).getOrDie("Could not find part: "+t)}function Cc(e,n){var t=function(n){return de(n,bc)}(n);return Cn(de(t,function(n){return{key:n,value:e+"-"+n}}))}function Dc(e){return kr("partUids","partUids",Et(function(n){return Cc(n.uid,e)}),Dr())}function Mc(n){return En(af,n)}function Ic(r){return function(n,e){var t=e.toString(),r=t.indexOf(")")+1,o=t.indexOf("("),i=t.substring(o+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Io(i.slice(1))}},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)))},r)}function Rc(n){return yc(n)}function Ac(n,e,t,r,o){var i=function(n,e){return(0<n.length?[Jt("parts",n)]:[]).concat([Yt("uid"),tr("dom",{}),tr("components",[]),ei("originalSpec"),tr("debug.sketcher",{})]).concat(e)}(r,o);return Xt(n+" [SpecSchema]",Pt(i.concat(e)),t)}function Fc(n,e,t,r,o){var i=pf(o),u=function(n){return B(n,function(n){return n.fold(Fn.none,Fn.some,Fn.none,Fn.none).map(function(n){return Jt(n.name,n.schema.concat([ei(uf())]))}).toArray()})}(t),c=Dc(t),a=Ac(n,e,i,u,[c]),f=Tc(0,a,t);return r(a,Oc(n,a,f.internals()),i,f.externals())}var Bc,Vc,Nc,jc,_c,Pc,Hc,zc,Lc,Gc,Uc=Mu(or("cyclic",b(!1))),$c=Mu(or("cyclic",b(!0))),Wc=[tr("execute",Ru),tr("useSpace",!1),tr("useEnter",!0),tr("useControlEnter",!1),tr("useDown",!1)],Xc=Du(Wc,Ao.init,function(n,e,t,r){var o=t.useSpace&&!Iu(n.element())?[32]:[],i=t.useEnter?[13]:[],u=t.useDown?[40]:[],c=o.concat(i).concat(u);return[au(ou(c),Fu)].concat(t.useControlEnter?[au(iu([cu,ou([13])]),Fu)]:[])},function(n,e,t,r){return t.useSpace&&!Iu(n.element())?[au(ou([32]),Au)]:[]},function(){return Fn.none()}),qc=/* */Object.freeze({flatgrid:Bu,init:function(n){return n.state(n)}}),Yc=function(n){return"rtl"===mi(n,"direction")?"rtl":"ltr"},Kc=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})},Jc=Pu,Qc=Pu,Zc=Pu,na=nn(["index","candidates"],[]),ea=[Yt("selector"),tr("execute",Ru),Jo("onEscape"),tr("captureTab",!1),ki()],ta=Xu(function(n,e,t,r){return Uu(n,e,t,r,-1)}),ra=Xu(function(n,e,t,r){return Uu(n,e,t,r,1)}),oa=Xu(function(n,e,t,r){return $u(n,e,t,r,-1)}),ia=Xu(function(n,e,t,r){return $u(n,e,t,r,1)}),ua=b([au(ou([37]),ju(ta,ra)),au(ou([39]),_u(ta,ra)),au(ou([38]),Jc(oa)),au(ou([40]),Qc(ia)),au(iu([uu,ou([9])]),qu),au(iu([bu,ou([9])]),qu),au(ou([27]),function(n,e,t,r){return t.onEscape(n,e)}),au(ou([32].concat([13])),function(e,t,r,n){return function(n,e){return e.focusManager.get(n).bind(function(n){return Zi(n,e.selector)})}(e,r).bind(function(n){return r.execute(e,t,n)})})]),ca=b([au(ou([32]),Au)]),aa=Du(ea,Bu,ua,ca,function(){return Fn.some(Wu)}),fa=[Yt("selector"),tr("getInitial",Fn.none),tr("execute",Ru),Jo("onEscape"),tr("executeOnMove",!1),tr("allowVertical",!0)],sa=b([au(ou([32]),Au)]),la=Du(fa,Ao.init,function(n,e,t,r){var o=[37].concat(t.allowVertical?[38]:[]),i=[39].concat(t.allowVertical?[40]:[]);return[au(ou(o),nc(ju(Qu,Zu))),au(ou(i),nc(_u(Qu,Zu))),au(ou([13]),Ku),au(ou([32]),Ku),au(ou([27]),ec)]},sa,function(){return Fn.some(Ju)}),da=nn(["rowIndex","columnIndex","cell"],[]),ma=[Jt("selectors",[Yt("row"),Yt("cell")]),tr("cycles",!0),tr("previousSelector",Fn.none),tr("execute",Ru)],ga=ac(function(n,e,t){return rc(n,e,t,-1)},function(n,e,t){return ic(n,e,t,-1)}),pa=ac(function(n,e,t){return rc(n,e,t,1)},function(n,e,t){return ic(n,e,t,1)}),ha=ac(function(n,e,t){return oc(n,t,e,-1)},function(n,e,t){return uc(n,t,e,-1)}),va=ac(function(n,e,t){return oc(n,t,e,1)},function(n,e,t){return uc(n,t,e,1)}),ya=b([au(ou([37]),ju(ga,pa)),au(ou([39]),_u(ga,pa)),au(ou([38]),Jc(ha)),au(ou([40]),Qc(va)),au(ou([32].concat([13])),function(e,t,r){return go(e.element()).bind(function(n){return r.execute(e,t,n)})})]),ba=b([au(ou([32]),Au)]),xa=Du(ma,Ao.init,ya,ba,function(){return Fn.some(cc)}),wa=[Yt("selector"),tr("execute",Ru),tr("moveOnTab",!1)],Sa=b([au(ou([38]),Zc(lc)),au(ou([40]),Zc(dc)),au(iu([uu,ou([9])]),function(n,e,t){return t.moveOnTab?Zc(lc)(n,e,t):Fn.none()}),au(iu([bu,ou([9])]),function(n,e,t){return t.moveOnTab?Zc(dc)(n,e,t):Fn.none()}),au(ou([13]),fc),au(ou([32]),fc)]),Ta=b([au(ou([32]),Au)]),Oa=Du(wa,Ao.init,Sa,Ta,function(){return Fn.some(sc)}),ka=[Jo("onSpace"),Jo("onEnter"),Jo("onShiftEnter"),Jo("onLeft"),Jo("onRight"),Jo("onTab"),Jo("onShiftTab"),Jo("onUp"),Jo("onDown"),Jo("onEscape"),tr("stopSpaceKeyup",!1),Qt("focusIn")],Ea=Du(ka,Ao.init,function(n,e,t){return[au(ou([32]),t.onSpace),au(iu([bu,ou([13])]),t.onEnter),au(iu([uu,ou([13])]),t.onShiftEnter),au(iu([uu,ou([9])]),t.onShiftTab),au(iu([bu,ou([9])]),t.onTab),au(ou([38]),t.onUp),au(ou([40]),t.onDown),au(ou([37]),t.onLeft),au(ou([39]),t.onRight),au(ou([32]),t.onSpace),au(ou([27]),t.onEscape)]},function(n,e,t){return t.stopSpaceKeyup?[au(ou([32]),Au)]:[]},function(n){return n.focusIn}),Ca=Uc.schema(),Da=$c.schema(),Ma=la.schema(),Ia=aa.schema(),Ra=xa.schema(),Aa=Xc.schema(),Fa=Oa.schema(),Ba=Ea.schema(),Va=(Gc=Xt("Creating behaviour: "+(Lc={branchKey:"mode",branches:/* */Object.freeze({acyclic:Ca,cyclic:Da,flow:Ma,flatgrid:Ia,matrix:Ra,execution:Aa,menu:Fa,special:Ba}),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){Mn(t,"setGridSize")?t.setGridSize(r,o):l.console.error("Layout does not support setGridSize")}},state:qc}).name,No,Lc),Bc=qt(Gc.branchKey,Gc.branches),Vc=Gc.name,Nc=Gc.active,jc=Gc.apis,_c=Gc.extra,Pc=Gc.state,zc=nr(Vc,[Zt("config",Hc=Bc)]),Ro(Hc,zc,Vc,Nc,jc,_c,Pc)),Na=mc,ja=pc,_a="placeholder",Pa=yt([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Ha=function(i,u,c,a){return hc(i,0,c,a).fold(function(n,e){var t=e(u,c.config,c.validated),r=Dt(t,"components").getOr([]),o=B(r,function(n){return Ha(i,u,n,a)});return[x(x({},t),{components:o})]},function(n,e){var t=e(u,c.config,c.validated);return c.validated.preprocess.getOr(y)(t)})},za=Pa.single,La=Pa.multiple,Ga=b(_a),Ua=0,$a=yt([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Wa=tr("factory",{sketch:y}),Xa=tr("schema",[]),qa=Yt("name"),Ya=kr("pname","pname",kt(function(n){return"<alloy."+yc(n.name)+">"}),Dr()),Ka=or("schema",function(){return[Qt("preprocess")]}),Ja=tr("defaults",b({})),Qa=tr("overrides",b({})),Za=Sr([Wa,Xa,qa,Ya,Ja,Qa]),nf=Sr([Wa,Xa,qa,Ya,Ja,Qa]),ef=Sr([Wa,Ka,qa,Yt("unit"),Ya,Ja,Qa]),tf=xc($a.required,Za),rf=xc($a.optional,nf),of=xc($a.group,ef),uf=b("entirety"),cf=function(n,e){return{uiType:Ga(),owner:n,name:e}},af=yc("alloy-premade"),ff=b("alloy-id-"),sf=b("data-alloy-id"),lf=ff(),df=sf(),mf=function(n,e){Object.defineProperty(n.dom(),df,{value:e,writable:!0})},gf=function(n){var e=et(n)?n.dom()[df]:null;return Fn.from(e)},pf=function(n){return n.hasOwnProperty("uid")?n:x(x({},n),{uid:Rc("uid")})};function hf(n){var e=Xt("Sketcher for "+n.name,Hs,n),t=S(e.apis,Ic),r=S(e.extraApis,function(n,e){return Gr(n,e)});return x(x({name:b(e.name),partFields:b([]),configFields:b(e.configFields),sketch:function(n){return function(n,e,t,r){var o=pf(r);return t(Ac(n,e,o,[],[]),o)}(e.name,e.configFields,e.factory,n)}},t),r)}function vf(n){var e=Xt("Sketcher for "+n.name,zs,n),t=Sc(e.name,e.partFields),r=S(e.apis,Ic),o=S(e.extraApis,function(n,e){return Gr(n,e)});return x(x({name:b(e.name),partFields:b(e.partFields),configFields:b(e.configFields),sketch:function(n){return Fc(e.name,e.configFields,e.partFields,e.factory,n)},parts:b(t)},r),o)}function yf(n){var e=Je.fromHtml(n),t=at(e),r=function(n){var e=n.dom().attributes!==undefined?n.dom().attributes:[];return I(e,function(n,e){var t;return"class"===e.name?n:x(x({},n),((t={})[e.name]=e.value,t))},{})}(e),o=function(n){return Array.prototype.slice.call(n.dom().classList,0)}(e),i=0===t.length?{}:{innerHtml:po(e)};return x({tag:q(e),classes:o,attributes:r},i)}function bf(n){return{dom:Us(n)}}function xf(n){return Bo([Fi.config({toggleClass:_i.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Bi(n,function(n,e){(e?Fi.on:Fi.off)(n)})])}function wf(n,e){var t=e.ui.registry.getAll().icons;return Fn.from(t[n]).fold(function(){return Us('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item ${prefix}-icon-'+n+' ${prefix}-icon"></span>')},function(n){return Us('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item">'+n+"</span>")})}function Sf(e){return rf({name:e+"-edge",overrides:function(n){return n.model.manager.edgeActions[e].fold(function(){return{}},function(r){return{events:Nr([Pr(xe(),r,[n]),Pr(Te(),r,[n]),Pr(Oe(),function(n,e,t){t.mouseIsDown.get()&&r(n,t)},[n])])}})}})}function Tf(n,e,t){e.store.manager.onLoad(n,e,t)}function Of(n,e,t){e.store.manager.onUnload(n,e,t)}function kf(){var n=Pn(null);return Fo({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()}}})}function Ef(){var i=Pn({}),u=Pn({});return Fo({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return Dt(i.get(),n).orThunk(function(){return Dt(u.get(),n)})},update:function(n){var e=i.get(),t=u.get(),r={},o={};C(n,function(e){r[e.value]=e,Dt(e,"meta").each(function(n){Dt(n,"text").each(function(n){o[n]=e})})}),i.set(x(x({},e),r)),u.set(x(x({},t),o))},clear:function(){i.set({}),u.set({})}})}function Cf(n,e,t,r){var o=e.store;t.update([r]),o.setValue(n,r),e.onSetValue(n,r)}function Df(n,e){sl.set(n,e)}function Mf(n){return sl.get(n)}function If(n){var e=n.event().raw();if(function(n){return-1!==n.type.indexOf("touch")}(e)){var t=e;return t.touches!==undefined&&1===t.touches.length?Fn.some(t.touches[0]).map(function(n){return dl(n.clientX,n.clientY)}):Fn.none()}var r=e;return r.clientX!==undefined?Fn.some(r).map(function(n){return dl(n.clientX,n.clientY)}):Fn.none()}function Rf(n){return n.model.minX}function Af(n){return n.model.minY}function Ff(n){return n.model.minX-1}function Bf(n){return n.model.minY-1}function Vf(n){return n.model.maxX}function Nf(n){return n.model.maxY}function jf(n){return n.model.maxX+1}function _f(n){return n.model.maxY+1}function Pf(n,e,t){return e(n)-t(n)}function Hf(n){return Pf(n,Vf,Rf)}function zf(n){return Pf(n,Nf,Af)}function Lf(n){return Hf(n)/2}function Gf(n){return zf(n)/2}function Uf(n){return n.stepSize}function $f(n){return n.snapToGrid}function Wf(n){return n.snapStart}function Xf(n){return n.rounded}function qf(n,e){return n[e+"-edge"]!==undefined}function Yf(n){return qf(n,"left")}function Kf(n){return qf(n,"right")}function Jf(n){return qf(n,"top")}function Qf(n){return qf(n,"bottom")}function Zf(n){return n.model.value.get()}function ns(n){return{x:b(n)}}function es(n){return{y:b(n)}}function ts(n,e){return{x:b(n),y:b(e)}}function rs(n,e){U(n,ml(),{value:e})}function os(n,e,t,r){return n<e?n:t<n?t:n===e?e-1:Math.max(e,n-r)}function is(n,e,t,r){return t<n?n:n<e?e:n===t?t+1:Math.min(t,n+r)}function us(n,e,t){return Math.max(e,Math.min(t,n))}function cs(n){var e=n.min,t=n.max,r=n.range,o=n.value,i=n.step,u=n.snap,c=n.snapStart,a=n.rounded,f=n.hasMinEdge,s=n.hasMaxEdge,l=n.minBound,d=n.maxBound,m=n.screenRange,g=f?e-1:e,p=s?t+1:t;if(o<l)return g;if(d<o)return p;var h=function(n,e,t){return Math.min(t,Math.max(n,e))-e}(o,l,d),v=us(h/m*r+e,g,p);return u&&e<=v&&v<=t?function(u,t,c,a,n){return n.fold(function(){var n=u-t,e=Math.round(n/a)*a;return us(t+e,t-1,c+1)},function(n){var e=(u-n)%a,t=Math.round(e/a),r=Math.floor((u-n)/a),o=Math.floor((c-n)/a),i=n+Math.min(o,r+t)*a;return Math.max(n,i)})}(v,e,t,i,c):a?Math.round(v):v}function as(n){var e=n.min,t=n.max,r=n.range,o=n.value,i=n.hasMinEdge,u=n.hasMaxEdge,c=n.maxBound,a=n.maxOffset,f=n.centerMinEdge,s=n.centerMaxEdge;return o<e?i?0:f:t<o?u?c:s:(o-e)/r*a}function fs(n){return n.element().dom().getBoundingClientRect()}function ss(n,e){return n[e]}function ls(n){var e=fs(n);return ss(e,gl)}function ds(n){var e=fs(n);return ss(e,"right")}function ms(n){var e=fs(n);return ss(e,"top")}function gs(n){var e=fs(n);return ss(e,"bottom")}function ps(n){var e=fs(n);return ss(e,"width")}function hs(n){var e=fs(n);return ss(e,"height")}function vs(n,e,t){return(n+e)/2-t}function ys(n,e){var t=fs(n),r=fs(e),o=ss(t,gl),i=ss(t,"right"),u=ss(r,gl);return vs(o,i,u)}function bs(n,e){var t=fs(n),r=fs(e),o=ss(t,"top"),i=ss(t,"bottom"),u=ss(r,"top");return vs(o,i,u)}function xs(n,e){U(n,ml(),{value:e})}function ws(n){return{x:b(n)}}function Ss(n,e,t){var r={min:Rf(e),max:Vf(e),range:Hf(e),value:t,step:Uf(e),snap:$f(e),snapStart:Wf(e),rounded:Xf(e),hasMinEdge:Yf(e),hasMaxEdge:Kf(e),minBound:ls(n),maxBound:ds(n),screenRange:ps(n)};return cs(r)}function Ts(t){return function(n,e){return function(n,e,t){var r=(0<n?is:os)(Zf(t).x(),Rf(t),Vf(t),Uf(t));return xs(e,ws(r)),Fn.some(r)}(t,n,e).map(function(){return!0})}}function Os(n,e,t,r,o,i){var u=function(e,n,t,r,o){var i=ps(e),u=r.bind(function(n){return Fn.some(ys(n,e))}).getOr(0),c=o.bind(function(n){return Fn.some(ys(n,e))}).getOr(i),a={min:Rf(n),max:Vf(n),range:Hf(n),value:t,hasMinEdge:Yf(n),hasMaxEdge:Kf(n),minBound:ls(e),minOffset:0,maxBound:ds(e),maxOffset:i,centerMinEdge:u,centerMaxEdge:c};return as(a)}(e,i,t,r,o);return ls(e)-ls(n)+u}function ks(n,e){U(n,ml(),{value:e})}function Es(n){return{y:b(n)}}function Cs(n,e,t){var r={min:Af(e),max:Nf(e),range:zf(e),value:t,step:Uf(e),snap:$f(e),snapStart:Wf(e),rounded:Xf(e),hasMinEdge:Jf(e),hasMaxEdge:Qf(e),minBound:ms(n),maxBound:gs(n),screenRange:hs(n)};return cs(r)}function Ds(t){return function(n,e){return function(n,e,t){var r=(0<n?is:os)(Zf(t).y(),Af(t),Nf(t),Uf(t));return ks(e,Es(r)),Fn.some(r)}(t,n,e).map(function(){return!0})}}function Ms(n,e,t,r,o,i){var u=function(e,n,t,r,o){var i=hs(e),u=r.bind(function(n){return Fn.some(bs(n,e))}).getOr(0),c=o.bind(function(n){return Fn.some(bs(n,e))}).getOr(i),a={min:Af(n),max:Nf(n),range:zf(n),value:t,hasMinEdge:Jf(n),hasMaxEdge:Qf(n),minBound:ms(e),minOffset:0,maxBound:gs(e),maxOffset:i,centerMinEdge:u,centerMaxEdge:c};return as(a)}(e,i,t,r,o);return ms(e)-ms(n)+u}function Is(n,e){U(n,ml(),{value:e})}function Rs(n,e){return{x:b(n),y:b(e)}}function As(t,r){return function(n,e){return function(n,e,t,r){var o=0<n?is:os,i=e?Zf(r).x():o(Zf(r).x(),Rf(r),Vf(r),Uf(r)),u=e?o(Zf(r).y(),Af(r),Nf(r),Uf(r)):Zf(r).y();return Is(t,Rs(i,u)),Fn.some(i)}(t,r,n,e).map(function(){return!0})}}function Fs(e,t,r,n){return Ws.forToolbar(t,function(){var n=r();e.setContextToolbar([{label:t+" group",items:n}])},{},n)}function Bs(n){return[function(o){function i(n){return n<0?"black":360<n?"white":"hsl("+n+", 100%, 50%)"}return Vl.sketch({dom:Us('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[Vl.parts()["left-edge"](bf('<div class="${prefix}-hue-slider-black"></div>')),Vl.parts().spectrum({dom:Us('<div class="${prefix}-slider-gradient-container"></div>'),components:[bf('<div class="${prefix}-slider-gradient"></div>')],behaviours:Bo([Fi.config({toggleClass:_i.resolve("thumb-active")})])}),Vl.parts()["right-edge"](bf('<div class="${prefix}-hue-slider-white"></div>')),Vl.parts().thumb({dom:Us('<div class="${prefix}-slider-thumb"></div>'),behaviours:Bo([Fi.config({toggleClass:_i.resolve("thumb-active")})])})],onChange:function(n,e,t){var r=i(t.x());Gi(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){Fi.on(e)},onDragEnd:function(n,e){Fi.off(e)},onInit:function(n,e,t,r){var o=i(r.x());Gi(e.element(),"background-color",o)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:function(){return o.getInitialValue()}}}},sliderBehaviours:Bo([Vi(Vl.refresh)])})}(n)]}function Vs(n){var e=n.selection.getStart(),t=Je.fromDom(e),r=Je.fromDom(n.getBody()),o=function(e,n){return(et(n)?Fn.some(n):fn(n).filter(et)).map(function(n){return Ar(n,function(n){return gi(n,"font-size").isSome()},e).bind(function(n){return gi(n,"font-size")}).getOrThunk(function(){return mi(n,"font-size")})}).getOr("")}(function(n){return cn(r,n)},t);return R(Pl,function(n){return o===n}).getOr("medium")}function Ns(n){return[bf('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),function(n){return _l({onChange:n.onChange,sizes:zl,category:"font",getInitialValue:n.getInitialValue})}(n),bf('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')]}function js(n){var e=function t(n){return n.uid!==undefined}(n)&&Mn(n,"uid")?n.uid:Rc("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).toOption()},asSpec:function(){return x(x({},n),{uid:e})}}}var _s,Ps,Hs=Pt([Yt("name"),Yt("factory"),Yt("configFields"),tr("apis",{}),tr("extraApis",{})]),zs=Pt([Yt("name"),Yt("factory"),Yt("configFields"),Yt("partFields"),tr("apis",{}),tr("extraApis",{})]),Ls=hf({name:"Button",factory:function(n){function t(e){return Dt(n.dom,"attributes").bind(function(n){return Dt(n,e)})}var e=function(n){return Nr(F([n.map(function(t){return Mo(function(n,e){t(n),e.stop()})}).toArray(),ai()]))}(n.action),r=n.dom.tag;return{uid:n.uid,dom:n.dom,components:n.components,events:e,behaviours:ja(n.buttonBehaviours,[Li.config({}),Va.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==r)return{role:t("role").getOr("button")};var n=t("type").getOr("button"),e=t("role").map(function(n){return{role:n}}).getOr({});return x({type:n},e)}()},eventOrder:n.eventOrder}},configFields:[tr("uid",undefined),Yt("dom"),tr("components",[]),Na("buttonBehaviours",[Li,Va]),Qt("action"),Qt("role"),tr("eventOrder",{})]}),Gs=qr({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(n){return Nr([jr(Fe(),b(!0))])},exhibit:function(n,e){return Ur({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Us=function(n){var e=function(n,r){return n.replace(/\$\{([^{}]*)\}/g,function(n,e){var t=r[e];return function(n){var e=typeof n;return"string"==e||"number"==e}(t)?t.toString():n})}(n,{prefix:_i.prefix()});return yf(e)},$s=function(n,e,t,r){return Ls.sketch({dom:wf(n,r),action:e,buttonBehaviours:xt(Bo([Gs.config({})]),t)})},Ws={forToolbar:$s,forToolbarCommand:function(n,e){return $s(e,function(){n.execCommand(e)},{},n)},forToolbarStateAction:function(n,e,t,r){var o=xf(t);return $s(e,r,o,n)},forToolbarStateCommand:function(n,e){var t=xf(e);return $s(e,function(){n.execCommand(e)},t,n)},getToolbarIconButton:wf},Xs=rf({schema:[Yt("dom")],name:"label"}),qs=Sf("top-left"),Ys=Sf("top"),Ks=Sf("top-right"),Js=Sf("right"),Qs=Sf("bottom-right"),Zs=Sf("bottom"),nl=Sf("bottom-left"),el=[Xs,Sf("left"),Js,Ys,Zs,qs,Ks,nl,Qs,tf({name:"thumb",defaults:b({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:Nr([zr(xe(),n,"spectrum"),zr(we(),n,"spectrum"),zr(Se(),n,"spectrum"),zr(Te(),n,"spectrum"),zr(Oe(),n,"spectrum"),zr(ke(),n,"spectrum")])}}}),tf({schema:[or("mouseIsDown",function(){return Pn(!1)})],name:"spectrum",overrides:function(t){function r(e,n){return o.getValueFromEvent(n).map(function(n){return o.setValueFrom(e,t,n)})}var o=t.model.manager;return{behaviours:Bo([Va.config({mode:"special",onLeft:function(n){return o.onLeft(n,t)},onRight:function(n){return o.onRight(n,t)},onUp:function(n){return o.onUp(n,t)},onDown:function(n){return o.onDown(n,t)}}),Li.config({})]),events:Nr([_r(xe(),r),_r(we(),r),_r(Te(),r),_r(Oe(),function(n,e){t.mouseIsDown.get()&&r(n,e)})])}}})],tl=/* */Object.freeze({onLoad:Tf,onUnload:Of,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}}),rl=/* */Object.freeze({events:function(t,r){var n=t.resetOnDom?[Eo(function(n,e){Tf(n,t,r)}),Co(function(n,e){Of(n,t,r)})]:[$r(t,r,Tf)];return Nr(n)}}),ol=/* */Object.freeze({memory:kf,dataset:Ef,manual:function(){return Fo({readState:function(){}})},init:function(n){return n.store.manager.state(n)}}),il=[Qt("initialValue"),Yt("getFallbackEntry"),Yt("getDataKey"),Yt("setValue"),ni("manager",{setValue:Cf,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){Cf(e,t,r,n)})},onUnload:function(n,e,t){t.clear()},state:Ef})],ul=[Yt("getValue"),tr("setValue",w),Qt("initialValue"),ni("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:w,state:Ao.init})],cl=[Qt("initialValue"),ni("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:kf})],al=[rr("store",{mode:"memory"},qt("mode",{memory:cl,manual:ul,dataset:il})),Ko("onSetValue"),tr("resetOnDom",!1)],fl=qr({fields:al,name:"representing",active:rl,apis:tl,extra:{setValueFrom:function(n,e){var t=fl.getValue(e);fl.setValue(n,t)}},state:ol}),sl=$i("width",function(n){return n.dom().offsetWidth}),ll=function(t,r){return{left:b(t),top:b(r),translate:function(n,e){return ll(t+n,r+e)}}},dl=ll,ml=b("slider.change.value"),gl="left",pl=Ts(-1),hl=Ts(1),vl=Fn.none,yl=Fn.none,bl={"top-left":Fn.none(),top:Fn.none(),"top-right":Fn.none(),right:Fn.some(function(n,e){rs(n,ns(jf(e)))}),"bottom-right":Fn.none(),bottom:Fn.none(),"bottom-left":Fn.none(),left:Fn.some(function(n,e){rs(n,ns(Ff(e)))})},xl=/* */Object.freeze({setValueFrom:function(n,e,t){var r=Ss(n,e,t),o=ws(r);return xs(n,o),r},setToMin:function(n,e){var t=Rf(e);xs(n,ws(t))},setToMax:function(n,e){var t=Vf(e);xs(n,ws(t))},findValueOfOffset:Ss,getValueFromEvent:function(n){return If(n).map(function(n){return n.left()})},findPositionOfValue:Os,setPositionFromValue:function(n,e,t,r){var o=Zf(t),i=Os(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=Mf(e.element())/2;Gi(e.element(),"left",i-u+"px")},onLeft:pl,onRight:hl,onUp:vl,onDown:yl,edgeActions:bl}),wl=Fn.none,Sl=Fn.none,Tl=Ds(-1),Ol=Ds(1),kl={"top-left":Fn.none(),top:Fn.some(function(n,e){rs(n,es(Bf(e)))}),"top-right":Fn.none(),right:Fn.none(),"bottom-right":Fn.none(),bottom:Fn.some(function(n,e){rs(n,es(_f(e)))}),"bottom-left":Fn.none(),left:Fn.none()},El=/* */Object.freeze({setValueFrom:function(n,e,t){var r=Cs(n,e,t),o=Es(r);return ks(n,o),r},setToMin:function(n,e){var t=Af(e);ks(n,Es(t))},setToMax:function(n,e){var t=Nf(e);ks(n,Es(t))},findValueOfOffset:Cs,getValueFromEvent:function(n){return If(n).map(function(n){return n.top()})},findPositionOfValue:Ms,setPositionFromValue:function(n,e,t,r){var o=Zf(t),i=Ms(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),u=Wi(e.element())/2;Gi(e.element(),"top",i-u+"px")},onLeft:wl,onRight:Sl,onUp:Tl,onDown:Ol,edgeActions:kl}),Cl=As(-1,!1),Dl=As(1,!1),Ml=As(-1,!0),Il=As(1,!0),Rl={"top-left":Fn.some(function(n,e){rs(n,ts(Ff(e),Bf(e)))}),top:Fn.some(function(n,e){rs(n,ts(Lf(e),Bf(e)))}),"top-right":Fn.some(function(n,e){rs(n,ts(jf(e),Bf(e)))}),right:Fn.some(function(n,e){rs(n,ts(jf(e),Gf(e)))}),"bottom-right":Fn.some(function(n,e){rs(n,ts(jf(e),_f(e)))}),bottom:Fn.some(function(n,e){rs(n,ts(Lf(e),_f(e)))}),"bottom-left":Fn.some(function(n,e){rs(n,ts(Ff(e),_f(e)))}),left:Fn.some(function(n,e){rs(n,ts(Ff(e),Gf(e)))})},Al=/* */Object.freeze({setValueFrom:function(n,e,t){var r=Ss(n,e,t.left()),o=Cs(n,e,t.top()),i=Rs(r,o);return Is(n,i),i},setToMin:function(n,e){var t=Rf(e),r=Af(e);Is(n,Rs(t,r))},setToMax:function(n,e){var t=Vf(e),r=Nf(e);Is(n,Rs(t,r))},getValueFromEvent:function(n){return If(n)},setPositionFromValue:function(n,e,t,r){var o=Zf(t),i=Os(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=Ms(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),c=Mf(e.element())/2,a=Wi(e.element())/2;Gi(e.element(),"left",i-c+"px"),Gi(e.element(),"top",u-a+"px")},onLeft:Cl,onRight:Dl,onUp:Ml,onDown:Il,edgeActions:Rl}),Fl=[tr("stepSize",1),tr("onChange",w),tr("onChoose",w),tr("onInit",w),tr("onDragStart",w),tr("onDragEnd",w),tr("snapToGrid",!1),tr("rounded",!0),Qt("snapStart"),Kt("model",qt("mode",{x:[tr("minX",0),tr("maxX",100),or("value",function(n){return Pn(n.mode.minX)}),Yt("getInitialValue"),ni("manager",xl)],y:[tr("minY",0),tr("maxY",100),or("value",function(n){return Pn(n.mode.minY)}),Yt("getInitialValue"),ni("manager",El)],xy:[tr("minX",0),tr("maxX",100),tr("minY",0),tr("maxY",100),or("value",function(n){return Pn({x:b(n.mode.minX),y:b(n.mode.minY)})}),Yt("getInitialValue"),ni("manager",Al)]})),mc("sliderBehaviours",[Va,fl]),or("mouseIsDown",function(){return Pn(!1)})],Bl=b("mouse.released"),Vl=vf({name:"Slider",configFields:Fl,partFields:el,factory:function(i,n,e,t){function u(n){return Ec(n,i,"thumb")}function c(n){return Ec(n,i,"spectrum")}function r(n){return kc(n,i,"left-edge")}function o(n){return kc(n,i,"right-edge")}function a(n){return kc(n,i,"top-edge")}function f(n){return kc(n,i,"bottom-edge")}function s(n,e){v.setPositionFromValue(n,e,i,{getLeftEdge:r,getRightEdge:o,getTopEdge:a,getBottomEdge:f,getSpectrum:c})}function l(n,e){h.value.set(e);var t=u(n);return s(n,t),i.onChange(n,t,e),Fn.some(!0)}function d(t){var n=i.mouseIsDown.get();i.mouseIsDown.set(!1),n&&kc(t,i,"thumb").each(function(n){var e=h.value.get();i.onChoose(t,n,e)})}function m(n,e){e.stop(),i.mouseIsDown.set(!0),i.onDragStart(n,u(n))}function g(n,e){e.stop(),i.onDragEnd(n,u(n)),d(n)}var p,h=i.model,v=h.manager;return{uid:i.uid,dom:i.dom,components:n,behaviours:pc(i.sliderBehaviours,[Va.config({mode:"special",focusIn:function(n){return kc(n,i,"spectrum").map(Va.focusIn).map(b(!0))}}),fl.config({store:{mode:"manual",getValue:function(n){return h.value.get()}}}),Ci.config({channels:(p={},p[Bl()]={onReceive:d},p)})]),events:Nr([_r(ml(),function(n,e){l(n,e.event().value())}),Eo(function(n,e){var t=h.getInitialValue();h.value.set(t);var r=u(n);s(n,r);var o=c(n);i.onInit(n,r,o,h.value.get())}),_r(xe(),m),_r(Se(),g),_r(Te(),m),_r(ke(),g)]),apis:{resetToMin:function(n){v.setToMin(n,i)},resetToMax:function(n){v.setToMax(n,i)},changeValue:l,refresh:s},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)}}}),Nl=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 Fs(n,"color-levels",function(){return Bs(e)},r)},jl=Pt([Yt("getInitialValue"),Yt("onChange"),Yt("category"),Yt("sizes")]),_l=function(n){var o=Xt("SizeSlider",jl,n);return Vl.sketch({dom:{tag:"div",classes:[_i.resolve("slider-"+o.category+"-size-container"),_i.resolve("slider"),_i.resolve("slider-size-container")]},onChange:function(n,e,t){var r=t.x();!function(n){return 0<=n&&n<o.sizes.length}(r)||o.onChange(r)},onDragStart:function(n,e){Fi.on(e)},onDragEnd:function(n,e){Fi.off(e)},model:{mode:"x",minX:0,maxX:o.sizes.length-1,getInitialValue:function(){return{x:function(){return o.getInitialValue()}}}},stepSize:1,snapToGrid:!0,sliderBehaviours:Bo([Vi(Vl.refresh)]),components:[Vl.parts().spectrum({dom:Us('<div class="${prefix}-slider-size-container"></div>'),components:[bf('<div class="${prefix}-slider-size-line"></div>')]}),Vl.parts().thumb({dom:Us('<div class="${prefix}-slider-thumb"></div>'),behaviours:Bo([Fi.config({toggleClass:_i.resolve("thumb-active")})])})]})},Pl=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Hl={candidates:b(Pl),get:function(n){return function(e){return A(Pl,function(n){return n===e})}(Vs(n)).getOr(2)},apply:function(e,n){(function(n){return Fn.from(Pl[n])})(n).each(function(n){!function(n,e){Vs(n)!==e&&n.execCommand("fontSize",!1,e)}(e,n)})}},zl=Hl.candidates(),Ll=window.Promise?window.Promise:(_s=Gl.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){l.setTimeout(n,1)},Ps=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},Gl.prototype["catch"]=function(n){return this.then(null,n)},Gl.prototype.then=function(t,r){var o=this;return new Gl(function(n,e){$l.call(o,new Yl(t,r,n,e))})},Gl.all=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var a=Array.prototype.slice.call(1===n.length&&Ps(n[0])?n[0]:n);return new Gl(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])})},Gl.resolve=function(e){return e&&"object"==typeof e&&e.constructor===Gl?e:new Gl(function(n){n(e)})},Gl.reject=function(t){return new Gl(function(n,e){e(t)})},Gl.race=function(o){return new Gl(function(n,e){for(var t=0,r=o;t<r.length;t++)r[t].then(n,e)})},Gl);function Gl(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=[],Kl(n,Ul(Wl,this),Ul(Xl,this))}function Ul(n,e){return function(){return n.apply(e,arguments)}}function $l(r){var o=this;null!==this._state?_s(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 Wl(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 Kl(Ul(e,n),Ul(Wl,this),Ul(Xl,this))}this._state=!0,this._value=n,ql.call(this)}catch(t){Xl.call(this,t)}}function Xl(n){this._state=!1,this._value=n,ql.call(this)}function ql(){for(var n=0,e=this._deferreds;n<e.length;n++){var t=e[n];$l.call(this,t)}this._deferreds=[]}function Yl(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 Kl(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)}}function Jl(n){return function e(t){return new Ll(function(n){var e=new l.FileReader;e.onloadend=function(){n(e.result)},e.readAsDataURL(t)})}(n).then(function(n){return n.split(",")[1]})}function Ql(o,i){(function(n){return Jl(n)})(i).then(function(r){o.undoManager.transact(function(){var n=o.editorUpload.blobCache,e=n.create(yc("mceu"),i,r);n.add(e);var t=o.dom.createHTML("img",{src:e.blobUri()});o.insertContent(t)})})}function Zl(t){var e=js({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:Nr([Lr(Re()),_r(Ie(),function(n,e){(function(n){var e=n.event(),t=e.raw().target.files||e.raw().dataTransfer.files;return Fn.from(t[0])})(e).each(function(n){Ql(t,n)})})])});return Ls.sketch({dom:Ws.getToolbarIconButton("image",t),components:[e.asSpec()],action:function(n){e.get(n).element().dom().click()}})}function nd(n){return n.dom().textContent}function ed(n){return 0<n.length}function td(n){return n===undefined||null===n?"":n}function rd(n,e,t){return t.text.toOption().filter(ed).fold(function(){return function(n){return Qr(n,"href")===nd(n)}(n)?Fn.some(e):Fn.none()},Fn.some)}function od(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)}function id(n){return n.dom().value}function ud(n,e){if(e===undefined)throw new Error("Value.set was undefined");n.dom().value=e}function cd(n){return x(x({},function(n){return Bo([Li.config({onFocus:!1===n.selectOnFocus?w:function(n){var e=n.element(),t=id(e);e.dom().setSelectionRange(0,t.length)}})])}(n)),pc(n.inputBehaviours,[fl.config({store:{mode:"manual",initialValue:n.data.getOr(undefined),getValue:function(n){return id(n.element())},setValue:function(n,e){id(n.element())!==e&&ud(n.element(),e)}},onSetValue:n.onSetValue})]))}function ad(n,e){var t=js(pm.sketch({inputAttributes:{placeholder:bm.translate(e)},onSetValue:function(n,e){G(n,Me())},inputBehaviours:Bo([lm.config({find:Fn.some}),ym.config({}),Va.config({mode:"execution"})]),selectOnFocus:!1})),r=js(Ls.sketch({dom:Us('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(n){var e=t.get(n);fl.setValue(e,"")}}));return{name:n,spec:dm.sketch({dom:Us('<div class="${prefix}-input-container"></div>'),components:[t.asSpec(),r.asSpec()],containerBehaviours:Bo([Fi.config({toggleClass:_i.resolve("input-container-empty")}),lm.config({find:function(n){return Fn.some(t.get(n))}}),am("input-clearing",[_r(Me(),function(n){var e=t.get(n);(0<fl.getValue(e).length?Fi.off:Fi.on)(n)})])])})}}function fd(n,e,t){e.disabled&&wm(n,e)}function sd(n,e){return!0===e.useNative&&k(xm,q(n.element()))}function ld(n){Kr(n.element(),"disabled","disabled")}function dd(n){no(n.element(),"disabled")}function md(n){Kr(n.element(),"aria-disabled","true")}function gd(n){Kr(n.element(),"aria-disabled","false")}function pd(e,n,t){n.disableClass.each(function(n){co(e.element(),n)}),(sd(e,n)?dd:gd)(e),n.onEnabled(e)}function hd(n,e){return sd(n,e)?function(n){return Zr(n.element(),"disabled")}(n):function(n){return"true"===Qr(n.element(),"aria-disabled")}(n)}function vd(n){return"<alloy.field."+n+">"}function yd(){function e(){t.get().each(function(n){n.destroy()})}var t=Pn(Fn.none());return{clear:function(){e(),t.set(Fn.none())},isSet:function(){return t.get().isSome()},set:function(n){e(),t.set(Fn.some(n))},run:function(n){t.get().each(n)}}}function bd(){var e=Pn(Fn.none());return{clear:function(){e.set(Fn.none())},set:function(n){e.set(Fn.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}}function xd(n){function r(e,n,t){return Ls.sketch({dom:Us('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){U(n,u,{direction:e})},buttonBehaviours:Bo([km.config({disableClass:_i.resolve("toolbar-navigation-disabled"),disabled:!t})])})}function o(n,o){var i=Yi(n.element(),"."+_i.resolve("serialised-dialog-screen"));Qi(n.element(),"."+_i.resolve("serialised-dialog-chain")).each(function(r){0<=c.state.currentScreen.get()+o&&c.state.currentScreen.get()+o<i.length&&(gi(r,"left").each(function(n){var e=parseInt(n,10),t=Mf(i[0]);Gi(r,"left",e-o*t+"px")}),c.state.currentScreen.set(c.state.currentScreen.get()+o))})}function i(e){var n=Yi(e.element(),"input");Fn.from(n[c.state.currentScreen.get()]).each(function(n){e.getSystem().getByDom(n).each(function(n){!function(n,e){n.getSystem().triggerFocus(e,n.element())}(e,n.element())})});var t=f.get(e);Cu.highlightAt(t,c.state.currentScreen.get())}var u="navigateEvent",e=Sr([Yt("fields"),tr("maxFieldIndex",n.fields.length-1),Yt("onExecute"),Yt("getInitialValue"),or("state",function(){return{dialogSwipeState:bd(),currentScreen:Pn(0)}})]),c=Xt("SerialisedDialog",e,n),a=js(Dm(function(t){return{dom:Us('<div class="${prefix}-serialised-dialog"></div>'),components:[dm.sketch({dom:Us('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:de(c.fields,function(n,e){return e<=c.maxFieldIndex?dm.sketch({dom:Us('<div class="${prefix}-serialised-dialog-screen"></div>'),components:[r(-1,"previous",0<e),t.field(n.name,n.spec),r(1,"next",e<c.maxFieldIndex)]}):t.field(n.name,n.spec)})})],formBehaviours:Bo([Vi(function(n,e){!function(n,e){Qi(n.element(),"."+_i.resolve("serialised-dialog-chain")).each(function(n){Gi(n,"left",-c.state.currentScreen.get()*e.width+"px")})}(n,e)}),Va.config({mode:"special",focusIn:function(n){i(n)},onTab:function(n){return o(n,1),Fn.some(!0)},onShiftTab:function(n){return o(n,-1),Fn.some(!0)}}),am("form-events",[Eo(function(e,n){c.state.currentScreen.set(0),c.state.dialogSwipeState.clear();var t=f.get(e);Cu.highlightFirst(t),c.getInitialValue(e).each(function(n){fl.setValue(e,n)})}),Mo(c.onExecute),_r(Ae(),function(n,e){"left"===e.event().raw().propertyName&&i(n)}),_r(u,function(n,e){var t=e.event().direction();o(n,t)})])])}})),f=js({dom:Us('<div class="${prefix}-dot-container"></div>'),behaviours:Bo([Cu.config({highlightClass:_i.resolve("dot-active"),itemClass:_i.resolve("dot-item")})]),components:B(c.fields,function(n,e){return e<=c.maxFieldIndex?[bf('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})});return{dom:Us('<div class="${prefix}-serializer-wrapper"></div>'),components:[a.asSpec(),f.asSpec()],behaviours:Bo([Va.config({mode:"special",focusIn:function(n){var e=a.get(n);Va.focusIn(e)}}),am("serializer-wrapper-events",[_r(xe(),function(n,e){var t=e.event();c.state.dialogSwipeState.set(Mm(t.raw().touches[0].clientX))}),_r(we(),function(n,e){var t=e.event();c.state.dialogSwipeState.on(function(n){e.event().prevent(),c.state.dialogSwipeState.set(Im(n,t.raw().touches[0].clientX))})}),_r(Se(),function(r){c.state.dialogSwipeState.on(function(n){var e=a.get(r),t=-1*Rm(n);o(e,t)})})])])}}function wd(e){function n(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+bo(e().element())+" is not in context.")}}return{debugInfo:b("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:b(!1)}}function Sd(n,o){var i={};return Nn(n,function(n,r){Nn(n,function(n,e){var t=kn(e,[])(i);i[e]=t.concat([o(r,n)])})}),i}function Td(n){return n.cHandler}function Od(n,e){return{name:b(n),handler:b(e)}}function kd(n,e,t){var r=x(x({},t),function(n,e){var t={};return C(n,function(n){t[n.name()]=n.handlers(e)}),t}(e,n));return Sd(r,Od)}function Ed(n){var i=function(n){return ce(n)?{can:b(!0),abort:b(!1),run:n}:n}(n);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)}}function Cd(n,e,t){var r=e[t];return r?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: "+JSON.stringify(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+r+".\nOrder specified: "+JSON.stringify(a,null,2));return o<i?-1:i<o?1:0});return vt.value(t)}catch(r){return vt.error([r])}}("Event: "+t,"name",n,r).map(function(n){var e=de(n,function(n){return n.handler()});return Vr(e)}):function(n,e){return vt.error(["The event ("+n+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(de(e,function(n){return n.name()}),null,2)])}(t,n)}function Dd(n){return $t("custom.definition",Sr([kr("dom","dom",Tt(),Sr([Yt("tag"),tr("styles",{}),tr("classes",[]),tr("attributes",{}),Qt("value"),Qt("innerHtml")])),Yt("components"),Yt("uid"),tr("events",{}),tr("apis",{}),kr("eventOrder","eventOrder",function(n){return St.mergeWithThunk(b(n))}({"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],touchstart:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]}),Dr()),Qt("domModification")]),n)}function Md(e,n){C(n,function(n){io(e,n)})}function Id(e,n){C(n,function(n){co(e,n)})}function Rd(n,e){return function(e,n){var t=de(n,function(n){return nr(n.name(),[Yt("config"),tr("state",Ao)])}),r=$t("component.behaviours",Sr(t),e.behaviours).fold(function(n){throw new Error(Cr(n)+"\nComplete spec:\n"+JSON.stringify(e,null,2))},function(n){return n});return{list:n,data:S(r,function(n){var e=n.map(function(n){return{config:n.config,state:n.state.init(n.config)}});return function(){return e}})}}(n,e)}function Ad(n){var e=function(n){var e=kn("behaviours",{})(n),t=D(Bn(e),function(n){return e[n]!==undefined});return de(t,function(n){return e[n].me})}(n);return Rd(n,e)}function Fd(n,e,t){var r=function(n){return x(x({},n.dom),{uid:n.uid,domChildren:de(n.components,function(n){return n.element()})})}(n),o=function(n){return n.domModification.fold(function(){return Ur({})},Ur)}(n),i={"alloy.base.modification":o};return function(n,e){return x(x({},n),{attributes:x(x({},n.attributes),e.attributes),styles:x(x({},n.styles),e.styles),classes:n.classes.concat(e.classes)})}(r,0<e.length?function(e,n,t,r){var o=x({},n);C(t,function(n){o[n.name()]=n.exhibit(e,r)});function i(n){return M(n,function(n,e){return x(x({},e.modification),n)},{})}var u=Sd(o,function(n,e){return{name:n,modification:e}}),c=M(u.classes,function(n,e){return e.modification.concat(n)},[]),a=i(u.attributes),f=i(u.styles);return Ur({classes:c,attributes:a,styles:f})}(t,i,e,r):o)}function Bd(n,e,t){var r={"alloy.base.behaviour":function(n){return n.events}(n)};return function(n,e,t,r){var o=kd(n,t,r);return Pm(o,e)}(t,n.eventOrder,e,r).getOrDie()}function Vd(t){function n(){return s}var r=Pn(jm),e=Wt(Dd(t)),o=Ad(t),i=function(n){return n.list}(o),u=function(n){return n.data}(o),c=function(n){var e=Je.fromTag(n.tag);Jr(e,n.attributes),Md(e,n.classes),di(e,n.styles),n.innerHtml.each(function(n){return ho(e,n)});var t=n.domChildren;return gn(e,t),n.value.each(function(n){ud(e,n)}),n.uid,mf(e,n.uid),e}(Fd(e,i,u)),a=Bd(e,i,u),f=Pn(e.components),s={getSystem:r.get,config:function(n){var e=u;return(ce(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(n){return ce(u[n.name()])},spec:b(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(wd(n))},element:b(c),syncComponents:function(){var n=at(c),e=B(n,function(n){return r.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});f.set(e)},components:f.get,events:b(a)};return s}function Nd(n){var e=Nm(n),t=e.events,r=u(e,["events"]),o=function(n){var e=kn("components",[])(n);return de(e,Lm)}(r),i=x(x({},r),{events:x(x({},Vm),t),components:o});return vt.value(Vd(i))}function jd(n){var e=Je.fromText(n);return Hm({element:e})}function _d(n){(go(n.element()).isNone()||Li.isFocused(n))&&(Li.isFocused(n)||Li.focus(n),U(n,Um,{item:n}))}function Pd(n){U(n,$m,{item:n})}function Hd(n,e,t,r){var o=n.getSystem().build(r);mt(n,o,t)}function zd(n,e,t,r){var o=rg(n);R(o,function(n){return cn(r.element(),n.element())}).each(yn)}function Ld(e,n,t,r,o){var i=rg(e);return Fn.from(i[r]).map(function(n){return zd(e,0,0,n),o.each(function(n){Hd(e,0,function(n,e){!function(n,e,t){sn(n,t).fold(function(){ft(n,e)},function(n){ln(n,e)})}(n,e,r)},n)}),n})}function Gd(n,e){var t={};Nn(n,function(n,e){C(n,function(n){t[n]=e})});var r=e,o=function(n){return jn(n,function(n,e){return{k:n,v:e}})}(e),i=S(o,function(n,e){return[e].concat(ig(t,r,o,e))});return S(t,function(n){return Dt(i,n).getOr([n])})}function Ud(n,e,t,r){return Dt(e.routes,r.start).bind(function(n){return Dt(n,r.destination)})}function $d(t,r,n){(function(e,t,r){return lg(e,t).bind(function(n){return sg(e,t,r,n)})})(t,r,n).each(function(n){var e=n.transition;co(t.element(),e.transitionClass),no(t.element(),r.destinationAttr)})}function Wd(n,e,t,r){$d(n,e,t),Zr(n.element(),e.stateAttr)&&Qr(n.element(),e.stateAttr)!==r&&e.onFinish(n,r),Kr(n.element(),e.stateAttr,r)}function Xd(n){return Dt(n,"format").getOr(n.title)}function qd(n){return Mn(n,"items")?function(n){var e=xt(On(n,["items"]),{menu:!0}),t=wg(n.items);return{item:e,menus:xt(t.menus,En(n.title,t.items)),expansions:xt(t.expansions,En(n.title,n.title))}}(n):{item:n,menus:{},expansions:{}}}function Yd(n){var e=n.replace(/\|/g," ").trim();return 0<e.length?e.split(/\s+/):[]}function Kd(n){var e=n.toolbar!==undefined?n.toolbar:kg;return ie(e)?Eg(e):Yd(e)}function Jd(n){function e(){n.stopPropagation()}function t(){n.preventDefault()}var r=Je.fromDom(n.target),o=i(t,e);return function(n,e,t,r,o,i,u){return{target:b(n),x:b(e),y:b(t),stop:r,prevent:o,kill:i,raw:b(u)}}(r,n.clientX,n.clientY,e,t,o,n)}function Qd(n,e,t,r,o){var i=function(e,t){return function(n){e(n)&&t(Jd(n))}}(t,r);return n.dom().addEventListener(e,i,o),{unbind:d(Mg,n,e,i,o)}}function Zd(n,e,t){return function(n,e,t,r){return Qd(n,e,t,r,!1)}(n,e,Ig,t)}function nm(n,e,t){return function(n,e,t,r){return Qd(n,e,t,r,!0)}(n,e,Ig,t)}function em(n){var e=n.matchMedia("(orientation: portrait)").matches;return{isPortrait:b(e)}}var tm,rm,om=function(n){var e=Je.fromDom(n.selection.getStart());return Zi(e,"a")},im={getInfo:function(n){return om(n).fold(function(){return function(n){return{url:"",text:n.selection.getContent({format:"text"}),title:"",target:"",link:Fn.none()}}(n)},function(n){return function(n){var e=nd(n),t=Qr(n,"href"),r=Qr(n,"title"),o=Qr(n,"target");return{url:td(t),text:e!==t?td(e):"",title:td(r),target:td(o),link:Fn.some(n)}}(n)})},applyInfo:function(e,o){o.url.toOption().filter(ed).fold(function(){!function(e,n){n.link.bind(y).each(function(n){e.execCommand("unlink")})}(e,o)},function(t){var r=function(n,e){var t={};return t.href=n,e.title.toOption().filter(ed).each(function(n){t.title=n}),e.target.toOption().filter(ed).each(function(n){t.target=n}),t}(t,o);o.link.bind(y).fold(function(){var n=o.text.toOption().filter(ed).getOr(t);e.insertContent(e.dom.createHTML("a",r,e.dom.encode(n)))},function(e){var n=rd(e,t,o);Jr(e,r),n.each(function(n){!function(n,e){n.dom().textContent=e}(e,n)})})})},query:om},um=L(),cm=function(n,e){(um.os.isAndroid()?od:t)(e,n)},am=function(n,e){return{key:n,value:{config:{},me:function(n,e){var t=Nr(e);return qr({fields:[Yt("enabled")],name:n,active:{events:b(t)}})}(n,e),configAsRaw:b({}),initialConfig:{},state:Ao}}},fm=/* */Object.freeze({getCurrent:function(n,e,t){return e.find(n)}}),sm=[Yt("find")],lm=qr({fields:sm,name:"composing",apis:fm}),dm=hf({name:"Container",factory:function(n){var e=n.dom,t=e.attributes,r=u(e,["attributes"]);return{uid:n.uid,dom:x({tag:"div",attributes:x({role:"presentation"},t)},r),components:n.components,behaviours:gc(n.containerBehaviours),events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},configFields:[tr("components",[]),mc("containerBehaviours",[]),tr("events",{}),tr("domModification",{}),tr("eventOrder",{})]}),mm=hf({name:"DataField",factory:function(t){return{uid:t.uid,dom:t.dom,behaviours:ja(t.dataBehaviours,[fl.config({store:{mode:"memory",initialValue:t.getInitialValue()}}),lm.config({find:Fn.some})]),events:Nr([Eo(function(n,e){fl.setValue(n,t.getInitialValue())})])}},configFields:[Yt("uid"),Yt("dom"),Yt("getInitialValue"),Na("dataBehaviours",[fl,lm])]}),gm=b([Qt("data"),tr("inputAttributes",{}),tr("inputStyles",{}),tr("tag","input"),tr("inputClasses",[]),Ko("onSetValue"),tr("styles",{}),tr("eventOrder",{}),mc("inputBehaviours",[fl,Li]),tr("selectOnFocus",!0)]),pm=hf({name:"Input",configFields:gm(),factory:function(n,e){return{uid:n.uid,dom:function(n){return{tag:n.tag,attributes:x({type:"text"},n.inputAttributes),styles:n.inputStyles,classes:n.inputClasses}}(n),components:[],behaviours:cd(n),eventOrder:n.eventOrder}}}),hm=/* */Object.freeze({exhibit:function(n,e){return Ur({attributes:Cn([{key:e.tabAttr,value:"true"}])})}}),vm=[tr("tabAttr","data-alloy-tabstop")],ym=qr({fields:vm,name:"tabstopping",active:hm}),bm=tinymce.util.Tools.resolve("tinymce.util.I18n"),xm=["input","button","textarea","select"],wm=function(e,n,t){n.disableClass.each(function(n){io(e.element(),n)}),(sd(e,n)?ld:md)(e),n.onDisabled(e)},Sm=/* */Object.freeze({enable:pd,disable:wm,isDisabled:hd,onLoad:fd,set:function(n,e,t,r){(r?wm:pd)(n,e,t)}}),Tm=/* */Object.freeze({exhibit:function(n,e,t){return Ur({classes:e.disabled?e.disableClass.map(_).getOr([]):[]})},events:function(t,n){return Nr([jr(Pe(),function(n,e){return hd(n,t)}),$r(t,n,fd)])}}),Om=[tr("disabled",!1),tr("useNative",!0),Qt("disableClass"),Ko("onDisabled"),Ko("onEnabled")],km=qr({fields:Om,name:"disabling",active:Tm,apis:Sm}),Em=[mc("formBehaviours",[fl])],Cm=function(r,n,e){return{uid:r.uid,dom:r.dom,components:n,behaviours:pc(r.formBehaviours,[fl.config({store:{mode:"manual",getValue:function(n){var e=function(n,e){var t=n.getSystem();return S(e.partUids,function(n,e){return b(t.getByUid(n))})}(n,r);return S(e,function(n,e){return n().bind(function(n){return function(n,e){return n.fold(function(){return vt.error(e)},vt.value)}(lm.getCurrent(n),"missing current")}).map(fl.getValue)})},setValue:function(t,n){Nn(n,function(e,n){kc(t,r,n).each(function(n){lm.getCurrent(n).each(function(n){fl.setValue(n,e)})})})}}})]),apis:{getField:function(n,e){return kc(n,r,e).bind(lm.getCurrent)}}}},Dm=(Ic(function(n,e,t){return n.getField(e,t)}),function(n){var t,e=(t=[],{field:function(n,e){return t.push(n),function(n,e,t){return{uiType:Ga(),owner:n,name:e,config:t,validated:{}}}("form",vd(n),e)},record:function(){return t}}),r=n(e),o=e.record(),i=de(o,function(n){return tf({name:n,pname:vd(n)})});return Fc("form",Em,i,Cm,r)}),Mm=function(n){return{xValue:n,points:[]}},Im=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])}},Rm=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},Am=X(function(t,r){return[{label:"the link group",items:[xd({fields:[ad("url","Type or paste URL"),ad("text","Link text"),ad("title","Link title"),ad("target","Link target"),function(n){return{name:n,spec:mm.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return Fn.none()}})}}("link")],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return Fn.some(im.getInfo(r))},onExecute:function(n){var e=fl.getValue(n);im.applyInfo(r,e),t.restoreToolbar(),r.focus()}})]}]}),Fm=[{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"}]}],Bm=Nr([(tm=Ve(),rm=function(n,e){var t=e.event().originator(),r=e.event().target();return!function(n,e,t){return cn(e,n.element())&&!cn(e,t)}(n,t,r)||(l.console.warn(Ve()+" did not get interpreted by the desired target. \nOriginator: "+bo(t)+"\nTarget: "+bo(r)+"\nCheck the "+Ve()+" event handlers"),!1)},{key:tm,value:Br({can:rm})})]),Vm=/* */Object.freeze({events:Bm}),Nm=y,jm=wd(),_m=function(n,e){return function(n,e){return{cHandler:n,purpose:b(e)}}(d.apply(undefined,[n.handler].concat(e)),n.purpose())},Pm=function(n,i){var e=_n(n,function(r,o){return(1===r.length?vt.value(r[0].handler()):Cd(r,i,o)).map(function(n){var e=Ed(n),t=1<r.length?D(i[o],function(e){return E(r,function(n){return n.name()===e})}).join(" > "):r[0].name();return En(o,function(n,e){return{handler:n,purpose:b(e)}}(e,t))})});return Dn(e,{})},Hm=function(n){var e=Xt("external.component",Pt([Yt("element"),Qt("uid")]),n),t=Pn(wd());e.uid.each(function(n){mf(e.element,n)});var r={getSystem:t.get,config:Fn.none,hasConfigured:b(!1),connect:function(n){t.set(n)},disconnect:function(){t.set(wd(function(){return r}))},getApis:function(){return{}},element:b(e.element),spec:b(n),readState:b("No state"),syncComponents:w,components:b([]),events:b({})};return Mc(r)},zm=Rc,Lm=function(e){return function(n){return Dt(n,af)}(e).fold(function(){var n=e.hasOwnProperty("uid")?e:x({uid:zm("")},e);return Nd(n).getOrDie()},function(n){return n})},Gm=Mc,Um="alloy.item-hover",$m="alloy.item-focus",Wm=b(Um),Xm=b($m),qm=[Yt("data"),Yt("components"),Yt("dom"),tr("hasSubmenu",!1),Qt("toggling"),Na("itemBehaviours",[Fi,Li,Va,fl]),tr("ignoreFocus",!1),tr("domModification",{}),ni("builder",function(n){return{dom:n.dom,domModification:x(x({},n.domModification),{attributes:x(x(x({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes),{"aria-haspopup":n.hasSubmenu}),n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:ja(n.itemBehaviours,[n.toggling.fold(Fi.revoke,function(n){return Fi.config(x({aria:{mode:"checked"}},n))}),Li.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){Pd(n)}}),Va.config({mode:"execution"}),fl.config({store:{mode:"memory",initialValue:n.data}}),am("item-type-events",function a(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;var r=Array(n),o=0;for(e=0;e<t;e++)for(var i=arguments[e],u=0,c=i.length;u<c;u++,o++)r[o]=i[u];return r}(ai(),[_r(Ee(),_d),_r(He(),Li.focus)]))]),components:n.components,eventOrder:n.eventOrder}}),tr("eventOrder",{})],Ym=[Yt("dom"),Yt("components"),ni("builder",function(n){return{dom:n.dom,components:n.components,events:Nr([function(n){return _r(n,function(n,e){e.stop()})}(He())])}})],Km=b([tf({name:"widget",overrides:function(e){return{behaviours:Bo([fl.config({store:{mode:"manual",getValue:function(n){return e.data},setValue:function(){}}})])}}})]),Jm=[Yt("uid"),Yt("data"),Yt("components"),Yt("dom"),tr("autofocus",!1),tr("ignoreFocus",!1),Na("widgetBehaviours",[fl,Li,Va]),tr("domModification",{}),Dc(Km()),ni("builder",function(t){function r(n){return kc(n,t,"widget").map(function(n){return Va.focusIn(n),n})}function n(n,e){return Iu(e.event().target())||t.autofocus&&e.setSource(n.element()),Fn.none()}var e=Tc(0,t,Km()),o=Oc("item-widget",t,e.internals());return{dom:t.dom,components:o,domModification:t.domModification,events:Nr([Mo(function(n,e){r(n).each(function(n){e.stop()})}),_r(Ee(),_d),_r(He(),function(n,e){t.autofocus?r(n):Li.focus(n)})]),behaviours:ja(t.widgetBehaviours,[fl.config({store:{mode:"memory",initialValue:t.data}}),Li.config({ignore:t.ignoreFocus,onFocus:function(n){Pd(n)}}),Va.config({mode:"special",focusIn:t.autofocus?function(n){r(n)}:jo(),onLeft:n,onRight:n,onEscape:function(n,e){return Li.isFocused(n)||t.autofocus?(t.autofocus&&e.setSource(n.element()),Fn.none()):(Li.focus(n),Fn.some(!0))}})])}})],Qm=qt("type",{widget:Jm,item:qm,separator:Ym}),Zm=b([of({factory:{sketch:function(n){var e=Xt("menu.spec item",Qm,n);return e.builder(e)}},name:"items",unit:"item",defaults:function(n,e){return e.hasOwnProperty("uid")?e:x(x({},e),{uid:Rc("item")})},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus,domModification:{classes:[n.markers.item]}}}})]),ng=b([Yt("value"),Yt("items"),Yt("dom"),Yt("components"),tr("eventOrder",{}),mc("menuBehaviours",[Cu,fl,lm,Va]),rr("movement",{mode:"menu",moveOnTab:!0},qt("mode",{grid:[ki(),ni("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:n.focusManager}})],matrix:[ni("config",function(n,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+n.markers.item},focusManager:n.focusManager}}),Yt("rowSelector")],menu:[tr("moveOnTab",!0),ni("config",function(n,e){return{mode:"menu",selector:"."+n.markers.item,moveOnTab:e.moveOnTab,focusManager:n.focusManager}})]})),Kt("markers",Ti()),tr("fakeFocus",!1),tr("focusManager",pu()),Ko("onHighlight")]),eg=b("alloy.menu-focus"),tg=vf({name:"Menu",configFields:ng(),partFields:Zm(),factory:function(n,e,t,r){return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:pc(n.menuBehaviours,[Cu.config({highlightClass:n.markers.selectedItem,itemClass:n.markers.item,onHighlight:n.onHighlight}),fl.config({store:{mode:"memory",initialValue:n.value}}),lm.config({find:Fn.some}),Va.config(n.movement.config(n,n.movement))]),events:Nr([_r(Xm(),function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){Cu.highlight(e,n),t.stop(),U(e,eg(),{menu:e,item:n})})}),_r(Wm(),function(n,e){var t=e.event().item();Cu.highlight(n,t)})]),components:e,eventOrder:n.eventOrder,domModification:{attributes:{role:"menu"}}}}}),rg=function(n,e){return n.components()},og=qr({fields:[],name:"replacing",apis:/* */Object.freeze({append:function(n,e,t,r){Hd(n,0,ft,r)},prepend:function(n,e,t,r){Hd(n,0,mn,r)},remove:zd,replaceAt:Ld,replaceBy:function(e,n,t,r,o){var i=rg(e);return A(i,r).bind(function(n){return Ld(e,0,0,n,o)})},set:function(e,n,t,r){!function(n,t){var r=an(t),e=mo(r).bind(function(e){function n(n){return cn(e,n)}return n(t)?Fn.some(t):Fr(t,n)}),o=n(t);e.each(function(e){mo(r).filter(function(n){return cn(n,e)}).fold(function(){so(e)},w)})}(function(){var n=de(r,e.getSystem().build);vn(e,n)},e.element())},contents:rg})}),ig=function(t,r,o,n){return Dt(o,n).bind(function(n){return Dt(t,n).bind(function(n){var e=ig(t,r,o,n);return Fn.some([n].concat(e))})}).getOr([])},ug=function(n){return"prepared"===n.type?Fn.some(n.menu):Fn.none()},cg={init:function(){function o(t){return function(n,e){for(var t=Bn(n),r=0,o=t.length;r<o;r++){var i=t[r],u=n[i];if(e(u,i,n))return Fn.some(u)}return Fn.none()}(i.get(),function(n,e){return n===t})}var i=Pn({}),u=Pn({}),c=Pn({}),a=Pn(Fn.none()),f=Pn({}),s=function(n){return e(n).bind(ug)},e=function(n){return Dt(u.get(),n)},t=function(n){return Dt(i.get(),n)};return{setMenuBuilt:function(n,e){var t;u.set(x(x({},u.get()),((t={})[n]={type:"prepared",menu:e},t)))},setContents:function(n,e,t,r){a.set(Fn.some(n)),i.set(t),u.set(e),f.set(r);var o=Gd(r,t);c.set(o)},expand:function(t){return Dt(i.get(),t).map(function(n){var e=Dt(c.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return Dt(c.get(),n)},collapse:function(n){return Dt(c.get(),n).bind(function(n){return 1<n.length?Fn.some(n.slice(1)):Fn.none()})},lookupMenu:e,lookupItem:t,otherMenus:function(n){var e=f.get();return j(Bn(e),n)},getPrimary:function(){return a.get().bind(s)},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),c.set({}),a.set(Fn.none())},isClear:function(){return a.get().isNone()},getTriggeringPath:function(n,r){var e=D(t(n).toArray(),function(n){return s(n).isSome()});return Dt(c.get(),n).bind(function(n){var t=N(e.concat(n));return function(n){for(var e=[],t=0;t<n.length;t++){var r=n[t];if(!r.isSome())return Fn.none();e.push(r.getOrDie())}return Fn.some(e)}(B(t,function(n,e){return function(n,t,r){return s(n).bind(function(e){return o(n).bind(function(n){return t(n).map(function(n){return{triggeredMenu:e,triggeringItem:n,triggeringPath:r}})})})}(n,r,t.slice(0,e+1)).fold(function(){return a.get().is(n)?[]:[Fn.none()]},function(n){return[Fn.some(n)]})}))})}}},extractPreparedMenu:ug},ag=b("collapse-item"),fg=hf({name:"TieredMenu",configFields:[Zo("onExecute"),Zo("onEscape"),Qo("onOpenMenu"),Qo("onOpenSubmenu"),Qo("onRepositionMenu"),Ko("onCollapseMenu"),tr("highlightImmediately",!0),Jt("data",[Yt("primary"),Yt("menus"),Yt("expansions")]),tr("fakeFocus",!1),Ko("onHighlight"),Ko("onHover"),Jt("markers",[Yt("backgroundMenu")].concat(wi()).concat(Si())),Yt("dom"),tr("navigateOnHover",!0),tr("stayInDom",!1),mc("tmenuBehaviours",[Va,Cu,lm,og]),tr("eventOrder",{})],apis:{collapseMenu:function(n,e){n.collapseMenu(e)},highlightPrimary:function(n,e){n.highlightPrimary(e)},repositionMenus:function(n,e){n.repositionMenus(e)}},factory:function(c,n){function r(r,o,n){return S(n,function(n,e){function t(){return tg.sketch(x(x({dom:n.dom},n),{value:e,items:n.items,markers:c.markers,fakeFocus:c.fakeFocus,onHighlight:c.onHighlight,focusManager:c.fakeFocus?function(){function o(n){return Cu.getHighlighted(n).map(function(n){return n.element()})}return{get:o,set:function(e,n){var t=o(e);e.getSystem().getByDom(n).fold(w,function(n){Cu.highlight(e,n)});var r=o(e);gu(e,t,r)}}}():pu()}))}return e===o?{type:"prepared",menu:r.getSystem().build(t())}:{type:"notbuilt",nbMenu:t}})}function a(n){return fl.getValue(n).value}function u(e,n){Cu.highlight(e,n),Cu.getHighlighted(n).orThunk(function(){return Cu.getFirst(n)}).each(function(n){W(e,n.element(),He())})}function f(e,n){return xo(de(n,function(n){return e.lookupMenu(n).bind(function(n){return"prepared"===n.type?Fn.some(n.menu):Fn.none()})}))}function s(e,n,t){var r=f(n,n.otherMenus(t));C(r,function(n){Id(n.element(),[c.markers.backgroundMenu]),c.stayInDom||og.remove(e,n)})}function l(n,r){var e=function(r){return o.get().getOrThunk(function(){var t={},n=Yi(r.element(),"."+c.markers.item),e=D(n,function(n){return"true"===Qr(n,"aria-haspopup")});return C(e,function(n){r.getSystem().getByDom(n).each(function(n){var e=a(n);t[e]=n})}),o.set(Fn.some(t)),t})}(n);Nn(e,function(n,e){var t=k(r,e);Kr(n.element(),"aria-expanded",t)})}function d(r,o,i){return Fn.from(i[0]).bind(function(n){return o.lookupMenu(n).bind(function(n){if("notbuilt"===n.type)return Fn.none();var e=n.menu,t=f(o,i.slice(1));return C(t,function(n){io(n.element(),c.markers.backgroundMenu)}),K(e.element())||og.append(r,Gm(e)),Id(e.element(),[c.markers.backgroundMenu]),u(r,e),s(r,o,i),Fn.some(e)})})}var m,e,o=Pn(Fn.none()),g=cg.init(),i=function(n){return S(c.data.menus,function(n,e){return B(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})};(e=m=m||{})[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent";function p(o,i,u){void 0===u&&(u=m.HighlightSubmenu);var n=a(i);return g.expand(n).bind(function(r){return l(o,r),Fn.from(r[0]).bind(function(t){return g.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 g.setMenuBuilt(e,r),r}(o,t,n);return K(e.element())||og.append(o,Gm(e)),c.onOpenSubmenu(o,i,e,N(r)),u===m.HighlightSubmenu?(Cu.highlightFirst(e),d(o,g,r)):(Cu.dehighlightAll(e),Fn.some(i))})})})}function h(e,t){var n=a(t);return g.collapse(n).bind(function(n){return l(e,n),d(e,g,n).map(function(n){return c.onCollapseMenu(e,t,n),n})})}function t(t){return function(e,n){return Zi(n.getSource(),"."+c.markers.item).bind(function(n){return e.getSystem().getByDom(n).toOption().bind(function(n){return t(e,n).map(function(){return!0})})})}}function v(n){return Cu.getHighlighted(n).bind(Cu.getHighlighted)}var y=Nr([_r(eg(),function(t,r){var n=r.event().item();g.lookupItem(a(n)).each(function(){var n=r.event().menu();Cu.highlight(t,n);var e=a(r.event().item());g.refresh(e).each(function(n){return s(t,g,n)})})}),Mo(function(e,n){var t=n.event().target();e.getSystem().getByDom(t).each(function(n){0===a(n).indexOf("collapse-item")&&h(e,n),p(e,n,m.HighlightSubmenu).fold(function(){c.onExecute(e,n)},function(){})})}),Eo(function(e,n){(function(n){var e=r(n,c.data.primary,c.data.menus),t=i();return g.setContents(c.data.primary,e,c.data.expansions,t),g.getPrimary()})(e).each(function(n){og.append(e,Gm(n)),c.onOpenMenu(e,n),c.highlightImmediately&&u(e,n)})})].concat(c.navigateOnHover?[_r(Wm(),function(n,e){var t=e.event().item();!function(e,n){var t=a(n);g.refresh(t).bind(function(n){return l(e,n),d(e,g,n)})}(n,t),p(n,t,m.HighlightParent),c.onHover(n,t)})]:[])),b={collapseMenu:function(e){v(e).each(function(n){h(e,n)})},highlightPrimary:function(e){g.getPrimary().each(function(n){u(e,n)})},repositionMenus:function(r){g.getPrimary().bind(function(e){return v(r).bind(function(n){var e=a(n),t=function(n){return _n(n,function(n){return n})}(g.getMenus()),r=xo(de(t,cg.extractPreparedMenu));return g.getTriggeringPath(e,function(n){return function(n,e,t){return wo(e,function(n){if(!n.getSystem().isConnected())return Fn.none();var e=Cu.getCandidates(n);return R(e,function(n){return a(n)===t})})}(0,r,n)})}).map(function(n){return{primary:e,triggeringPath:n}})}).fold(function(){(function(n){return Fn.from(n.components()[0]).filter(function(n){return"menu"===Qr(n.element(),"role")})})(r).each(function(n){c.onRepositionMenu(r,n,[])})},function(n){var e=n.primary,t=n.triggeringPath;c.onRepositionMenu(r,e,t)})}};return{uid:c.uid,dom:c.dom,markers:c.markers,behaviours:pc(c.tmenuBehaviours,[Va.config({mode:"special",onRight:t(function(n,e){return Iu(e.element())?Fn.none():p(n,e,m.HighlightSubmenu)}),onLeft:t(function(n,e){return Iu(e.element())?Fn.none():h(n,e)}),onEscape:t(function(n,e){return h(n,e).orThunk(function(){return c.onEscape(n,e).map(function(){return n})})}),focusIn:function(e,n){g.getPrimary().each(function(n){W(e,n.element(),He())})}}),Cu.config({highlightClass:c.markers.selectedMenu,itemClass:c.markers.menu}),lm.config({find:function(n){return Cu.getHighlighted(n)}}),og.config({})]),eventOrder:c.eventOrder,apis:b,events:y}},extraApis:{tieredData:function(n,e,t){return{primary:n,menus:e,expansions:t}},singleData:function(n,e){return{primary:n,menus:En(n,e),expansions:{}}},collapseItem:function(n){return{value:yc(ag()),meta:{text:n}}}}}),sg=function(n,e,t,r){return Ud(0,e,0,r).bind(function(e){return e.transition.map(function(n){return{transition:n,route:e}})})},lg=function(n,e,t){var r=n.element();return Zr(r,e.destinationAttr)?Fn.some({start:Qr(n.element(),e.stateAttr),destination:Qr(n.element(),e.destinationAttr)}):Fn.none()},dg=/* */Object.freeze({findRoute:Ud,disableTransition:$d,getCurrentRoute:lg,jumpTo:Wd,progressTo:function(t,r,o,i){!function(n,e){Zr(n.element(),e.destinationAttr)&&(Kr(n.element(),e.stateAttr,Qr(n.element(),e.destinationAttr)),no(n.element(),e.destinationAttr))}(t,r);var n=function(n,e,t,r){return{start:Qr(n.element(),e.stateAttr),destination:r}}(t,r,0,i);sg(t,r,o,n).fold(function(){Wd(t,r,o,i)},function(n){$d(t,r,o);var e=n.transition;io(t.element(),e.transitionClass),Kr(t.element(),r.destinationAttr,i)})},getState:function(n,e,t){var r=n.element();return Zr(r,e.stateAttr)?Fn.some(Qr(r,e.stateAttr)):Fn.none()}}),mg=/* */Object.freeze({events:function(o,i){return Nr([_r(Ae(),function(t,n){var r=n.event().raw();lg(t,o).each(function(e){Ud(0,o,0,e).each(function(n){n.transition.each(function(n){r.propertyName===n.property&&(Wd(t,o,i,e.destination),o.onTransition(t,e))})})})}),Eo(function(n,e){Wd(n,o,i,o.initialState)})])}}),gg=[tr("destinationAttr","data-transitioning-destination"),tr("stateAttr","data-transitioning-state"),Yt("initialState"),Ko("onTransition"),Ko("onFinish"),Kt("routes",Ut(vt.value,Ut(vt.value,Pt([er("transition",[Yt("property"),Yt("transitionClass")])]))))],pg=qr({fields:gg,name:"transitioning",active:mg,apis:dg,extra:{createRoutes:function(n){var r={};return Nn(n,function(n,e){var t=e.split("<->");r[t[0]]=En(t[1],n),r[t[1]]=En(t[0],n)}),r},createBistate:function(n,e,t){return Cn([{key:n,value:En(e,t)},{key:e,value:En(n,t)}])},createTristate:function(n,e,t,r){return Cn([{key:n,value:Cn([{key:e,value:r},{key:t,value:r}])},{key:e,value:Cn([{key:n,value:r},{key:t,value:r}])},{key:t,value:Cn([{key:n,value:r},{key:e,value:r}])}])}}}),hg=_i.resolve("scrollable"),vg={register:function(n){io(n,hg)},deregister:function(n){co(n,hg)},scrollable:b(hg)},yg=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[_i.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:_i.resolve("format-matches"),selected:t},itemBehaviours:Bo(o?[]:[Bi(n,function(n,e){(e?Fi.on:Fi.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},bg=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[Ls.sketch({dom:{tag:"div",classes:[_i.resolve("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[_i.resolve("styles-collapse-icon")]}},jd(n)]:[jd(n)],action:function(n){if(r){var e=t().get(n);fg.collapseMenu(e)}}}),{dom:{tag:"div",classes:[_i.resolve("styles-menu-items-container")]},components:[tg.parts().items({})],behaviours:Bo([am("adhoc-scrollable-menu",[Eo(function(n,e){Gi(n.element(),"overflow-y","auto"),Gi(n.element(),"-webkit-overflow-scrolling","touch"),vg.register(n.element())}),Co(function(n){pi(n.element(),"overflow-y"),pi(n.element(),"-webkit-overflow-scrolling"),vg.deregister(n.element())})])])}],items:e,menuBehaviours:Bo([pg.config({initialState:"after",routes:pg.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},xg=function(r){var n=function(r,o){var n=bg("Styles",[].concat(de(r.items,function(n){return yg(Xd(n),n.title,n.isSelected(),n.getPreview(),Mn(r.expansions,Xd(n)))})),o,!1),e=S(r.menus,function(n,e){var t=de(n,function(n){return yg(Xd(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",Mn(r.expansions,Xd(n)))});return bg(e,t,o,!0)}),t=xt(e,En("styles",n));return{tmenu:fg.tieredData("styles",t,r.expansions)}}(r.formats,function(){return e}),e=js(fg.sketch({dom:{tag:"div",classes:[_i.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=fl.getValue(e);return r.handle(e,t.value),Fn.none()},onEscape:function(){return Fn.none()},onOpenMenu:function(n,e){var t=Mf(n.element());Df(e.element(),t),pg.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=Mf(n.element()),o=Ji(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();Df(t.element(),r),pg.progressTo(i,"before"),pg.jumpTo(t,"after"),pg.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=Ji(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();pg.progressTo(o,"after"),pg.progressTo(t,"current")},navigateOnHover:!1,highlightImmediately:!0,data:n.tmenu,markers:{backgroundMenu:_i.resolve("styles-background-menu"),menu:_i.resolve("styles-menu"),selectedMenu:_i.resolve("styles-selected-menu"),item:_i.resolve("styles-item"),selectedItem:_i.resolve("styles-selected-item")}}));return e.asSpec()},wg=function(n){return M(n,function(n,e){var t=qd(e);return{menus:xt(n.menus,t.menus),items:[t.item].concat(n.items),expansions:xt(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},Sg={expand:wg},Tg=function(r,n){function o(n){return function(){return r.formatter.match(n)}}function i(n){return function(){return r.formatter.getCssText(n)}}var e=Dt(n,"style_formats").getOr(Fm),t=function(n){return de(n,function(n){if(Mn(n,"items")){var e=t(n.items);return xt(function(n){return xt(n,{isSelected:b(!1),getPreview:b("")})}(n),{items:e})}return Mn(n,"format")?function(n){return xt(n,{isSelected:o(n.format),getPreview:i(n.format)})}(n):function(n){var e=yc(n.title),t=xt(n,{format:e,isSelected:o(e),getPreview:i(e)});return r.formatter.register(e,t),t}(n)})};return t(e)},Og=function(t,n,r){var e=function(e,n){var t=function(n){return B(n,function(n){return n.items===undefined?!Mn(n,"format")||e.formatter.canApply(n.format)?[n]:[]:0<t(n.items).length?[n]:[]})},r=t(n);return Sg.expand(r)}(t,n);return xg({formats:e,handle:function(n,e){t.undoManager.transact(function(){Fi.isOn(n)?t.formatter.remove(e):t.formatter.apply(e)}),r()}})},kg=["undo","bold","italic","link","image","bullist","styleselect"],Eg=function(n){return B(n,function(n){return ie(n)?Eg(n):Yd(n)})},Cg=function(e,r){function n(n){return function(){return Ws.forToolbarCommand(r,n)}}function t(n){return function(){return Ws.forToolbarStateCommand(r,n)}}function o(n,e,t){return function(){return Ws.forToolbarStateAction(r,n,e,t)}}function i(){return Og(r,h,function(){r.fire("scrollIntoView")})}function u(n,e){return{isSupported:function(){var e=r.ui.registry.getAll().buttons;return n.forall(function(n){return Mn(e,n)})},sketch:e}}var c=n("undo"),a=n("redo"),f=t("bold"),s=t("italic"),l=t("underline"),d=n("removeformat"),m=o("unlink","link",function(){r.execCommand("unlink",null,!1)}),g=o("unordered-list","ul",function(){r.execCommand("InsertUnorderedList",null,!1)}),p=o("ordered-list","ol",function(){r.execCommand("InsertOrderedList",null,!1)}),h=Tg(r,r.settings);return{undo:u(Fn.none(),c),redo:u(Fn.none(),a),bold:u(Fn.none(),f),italic:u(Fn.none(),s),underline:u(Fn.none(),l),removeformat:u(Fn.none(),d),link:u(Fn.none(),function(){return function(e,t){return Ws.forToolbarStateAction(t,"link","link",function(){var n=Am(e,t);e.setContextToolbar(n),cm(t,function(){e.focusToolbar()}),im.query(t).each(function(n){t.selection.select(n.dom())})})}(e,r)}),unlink:u(Fn.none(),m),image:u(Fn.none(),function(){return Zl(r)}),bullist:u(Fn.some("bullist"),g),numlist:u(Fn.some("numlist"),p),fontsizeselect:u(Fn.none(),function(){return function(n,e){var t={onChange:function(n){Hl.apply(e,n)},getInitialValue:function(){return Hl.get(e)}};return Fs(n,"font-size",function(){return Ns(t)},e)}(e,r)}),forecolor:u(Fn.none(),function(){return Nl(e,r)}),styleselect:u(Fn.none(),function(){return Ws.forToolbar("style-formats",function(n){r.fire("toReading"),e.dropup().appear(i,Fi.on,n)},Bo([Fi.config({toggleClass:_i.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Ci.config({channels:Cn([Ni(Uo.orientationChanged(),Fi.off),Ni(Uo.dropupDismissed(),Fi.off)])})]),r)})}},Dg=function(n,t){var e=Kd(n),r={};return B(e,function(n){var e=!Mn(r,n)&&Mn(t,n)&&t[n].isSupported()?[t[n].sketch()]:[];return r[n]=!0,e})},Mg=function(n,e,t,r){n.dom().removeEventListener(e,t,r)},Ig=b(!0),Rg=tinymce.util.Tools.resolve("tinymce.util.Delay"),Ag=em,Fg=function(r,e){var n=Je.fromDom(r),o=null,t=Zd(n,"orientationchange",function(){Rg.clearInterval(o);var n=em(r);e.onChange(n),i(function(){e.onReady(n)})}),i=function(n){Rg.clearInterval(o);var e=r.innerHeight,t=0;o=Rg.setInterval(function(){e!==r.innerHeight?(Rg.clearInterval(o),n(Fn.some(r.innerHeight))):20<t&&(Rg.clearInterval(o),n(Fn.none())),t++},50)};return{onAdjustment:i,destroy:function(){t.unbind()}}},Bg=function(n){var e=L().os.isiOS(),t=em(n).isPortrait();return e&&!t?n.screen.height:n.screen.width};function Vg(n){var e=n.raw();return e.touches===undefined||1!==e.touches.length?Fn.none():Fn.some(e.touches[0])}function Ng(t){var r=Pn(Fn.none()),o=Pn(!1),i=function n(t,r){var o=null;return{cancel:function(){null!==o&&(l.clearTimeout(o),o=null)},schedule:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];o=l.setTimeout(function(){t.apply(null,n),o=null},r)}}}(function(n){t.triggerEvent(Le(),n),o.set(!0)},400),u=Cn([{key:xe(),value:function(t){return Vg(t).each(function(n){i.cancel();var e={x:b(n.clientX),y:b(n.clientY),target:t.target};i.schedule(t),o.set(!1),r.set(Fn.some(e))}),Fn.none()}},{key:we(),value:function(n){return i.cancel(),Vg(n).each(function(e){r.get().each(function(n){!function(n,e){var t=Math.abs(n.clientX-e.x()),r=Math.abs(n.clientY-e.y());return 5<t||5<r}(e,n)||r.set(Fn.none())})}),Fn.none()}},{key:Se(),value:function(e){i.cancel();return r.get().filter(function(n){return cn(n.target(),e.target())}).map(function(n){return o.get()?(e.prevent(),!1):t.triggerEvent(ze(),e)})}}]);return{fireIfReady:function(e,n){return Dt(u,n).bind(function(n){return n(e)})}}}var jg=function(t){var e=Ng({triggerEvent:function(n,e){t.onTapContent(e)}});return{fireTouchstart:function(n){e.fireIfReady(n,"touchstart")},onTouchend:function(){return Zd(t.body(),"touchend",function(n){e.fireIfReady(n,"touchend")})},onTouchmove:function(){return Zd(t.body(),"touchmove",function(n){e.fireIfReady(n,"touchmove")})}}},_g=6<=L().os.version.major,Pg=function(r,e,t){function o(n){return!cn(n.start(),n.finish())||n.soffset()!==n.foffset()}function n(){var n=r.doc().dom().hasFocus()&&r.getSelection().exists(o);t.getByDom(e).each(!0===(n||mo(u).filter(function(n){return"input"===q(n)}).exists(function(n){return n.dom().selectionStart!==n.dom().selectionEnd}))?Fi.on:Fi.off)}var i=jg(r),u=an(e),c=[Zd(r.body(),"touchstart",function(n){r.onTouchContent(),i.fireTouchstart(n)}),i.onTouchmove(),i.onTouchend(),Zd(e,"touchstart",function(n){r.onTouchToolstrip()}),r.onToReading(function(){lo(r.body())}),r.onToEditing(w),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==_g?[]:[Zd(Je.fromDom(r.win()),"blur",function(){t.getByDom(e).each(Fi.off)}),Zd(u,"select",n),Zd(r.doc(),"selectionchange",n)]);return{destroy:function(){C(c,function(n){n.unbind()})}}},Hg=function(n,e){var t=parseInt(Qr(n,e),10);return isNaN(t)?0:t};function zg(n){return Cp.getOption(n)}function Lg(n){return function(n){return zg(n).filter(function(n){return 0!==n.trim().length||-1<n.indexOf("\xa0")}).isSome()}(n)||k(Dp,q(n))}function Gg(n,e,t){var r=n.document.createRange();return function(t,n){n.fold(function(n){t.setStartBefore(n.dom())},function(n,e){t.setStart(n.dom(),e)},function(n){t.setStartAfter(n.dom())})}(r,e),function(t,n){n.fold(function(n){t.setEndBefore(n.dom())},function(n,e){t.setEnd(n.dom(),e)},function(n){t.setEndAfter(n.dom())})}(r,t),r}function Ug(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i}function $g(n){return{left:b(n.left),top:b(n.top),right:b(n.right),bottom:b(n.bottom),width:b(n.width),height:b(n.height)}}function Wg(n,e,t){return e(Je.fromDom(t.startContainer),t.startOffset,Je.fromDom(t.endContainer),t.endOffset)}function Xg(n,e){return function(n,e){var t=e.ltr();return t.collapsed?e.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Bp.rtl(Je.fromDom(n.endContainer),n.endOffset,Je.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Wg(0,Bp.ltr,t)}):Wg(0,Bp.ltr,t)}(0,function(o,n){return n.match({domRange:function(n){return{ltr:b(n),rtl:Fn.none}},relative:function(n,e){return{ltr:X(function(){return Gg(o,n,e)}),rtl:X(function(){return Fn.some(Gg(o,e,n))})}},exact:function(n,e,t,r){return{ltr:X(function(){return Ug(o,n,e,t,r)}),rtl:X(function(){return Fn.some(Ug(o,t,r,n,e))})}}})}(n,e))}function qg(n,e,t){return e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom}function Yg(t,r,n,e,o){function i(n){var e=t.dom().createRange();return e.setStart(r.dom(),n),e.collapse(!0),e}var u=function(n){return Cp.get(n)}(r).length,c=function(n,e,t,r,o){if(0===o)return 0;if(e===r)return o-1;for(var i=r,u=1;u<o;u++){var c=n(u),a=Math.abs(e-c.left);if(t<=c.bottom){if(t<c.top||i<a)return u-1;i=a}}return 0}(function(n){return i(n).getBoundingClientRect()},n,e,o.right,u);return i(c)}function Kg(n){return Fr(n,Lg)}function Jg(n){return Np(n,Lg)}function Qg(n,e){return e-n.left<n.right-e}function Zg(n,e,t){var r=n.dom().createRange();return r.selectNode(e.dom()),r.collapse(t),r}function np(e,n,t){var r=e.dom().createRange();r.selectNode(n.dom());var o=r.getBoundingClientRect(),i=Qg(o,t);return(!0===i?Kg:Jg)(n).map(function(n){return Zg(e,n,i)})}function ep(n,e,t){var r=e.dom().getBoundingClientRect(),o=Qg(r,t);return Fn.some(Zg(n,e,o))}function tp(n,e,t,r){var o=n.dom().createRange();o.selectNode(e.dom());var i=o.getBoundingClientRect();return function(n,e,t,r){var o=n.dom().createRange();o.selectNode(e.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,t)),c=Math.max(i.top,Math.min(i.bottom,r));return Vp(n,e,u,c)}(n,e,Math.max(i.left,Math.min(i.right,t)),Math.max(i.top,Math.min(i.bottom,r)))}function rp(n,e){var t=q(n);return"input"===t?Rp.after(n):k(["br","img"],t)?0===e?Rp.before(n):Rp.after(n):Rp.on(n,e)}function op(n,e,t,r){var o=function(n,e,t,r){var o=an(n).dom().createRange();return o.setStart(n.dom(),e),o.setEnd(t.dom(),r),o}(n,e,t,r),i=cn(n,t)&&e===r;return o.collapsed&&!i}function ip(n,e,t,r,o){!function(n,e){Fn.from(n.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(e)})}(n,Ug(n,e,t,r,o))}function up(n,e,t,r,o){!function(u,n){Xg(u,n).match({ltr:function(n,e,t,r){ip(u,n,e,t,r)},rtl:function(n,e,t,r){var o=u.getSelection();if(o.setBaseAndExtent)o.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(o.extend)try{!function(n,e,t,r,o,i){e.collapse(t.dom(),r),e.extend(o.dom(),i)}(0,o,n,e,t,r)}catch(i){ip(u,t,r,n,e)}else ip(u,t,r,n,e)}})}(n,function(n,e,t,r){var o=rp(n,e),i=rp(t,r);return Fp.relative(o,i)}(e,t,r,o))}function cp(n){var e=Je.fromDom(n.anchorNode),t=Je.fromDom(n.focusNode);return op(e,n.anchorOffset,t,n.focusOffset)?Fn.some(Mp.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 Fn.some(Mp.create(Je.fromDom(e.startContainer),e.startOffset,Je.fromDom(t.endContainer),t.endOffset))}return Fn.none()}(n)}function ap(n){return Fn.from(n.getSelection()).filter(function(n){return 0<n.rangeCount}).bind(cp)}function fp(n,e){return function(n){var e=n.getClientRects(),t=0<e.length?e[0]:n.getBoundingClientRect();return 0<t.width||0<t.height?Fn.some(t).map($g):Fn.none()}(function(i,n){return Xg(i,n).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}})}(n,e))}function sp(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:b(2),height:n.height}}function lp(n){return{left:b(n.left),top:b(n.top),right:b(n.right),bottom:b(n.bottom),width:b(n.width),height:b(n.height)}}function dp(t){if(t.collapsed){var r=Je.fromDom(t.startContainer);return fn(r).bind(function(n){var e=Fp.exact(r,t.startOffset,n,function(n){return"img"===q(n)?1:zg(n).fold(function(){return at(n).length},function(n){return n.length})}(n));return fp(t.startContainer.ownerDocument.defaultView,e).map(sp).map(_)}).getOr([])}return de(t.getClientRects(),lp)}function mp(n,e){Kr(n,Pp,e)}function gp(n){return{top:b(n.top()),bottom:b(n.top()+n.height())}}function pp(n,e){var t=function(n){return Hg(n,Pp)}(e),r=n.innerHeight;return r<t?Fn.some(t-r):Fn.none()}function hp(n){return Fn.some(Je.fromDom(n.dom().contentWindow.document.body))}function vp(n){return Fn.some(Je.fromDom(n.dom().contentWindow.document))}function yp(n){return Fn.from(n.dom().contentWindow)}function bp(n){return yp(n).bind(ap)}function xp(n){return n.getFrame()}function wp(n,t){return function(e){return e[n].getOrThunk(function(){var n=xp(e);return function(){return t(n)}})()}}function Sp(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return Zd(e,r,n)}})}function Tp(n){return{left:b(n.left),top:b(n.top),right:b(n.right),bottom:b(n.bottom),width:b(n.width),height:b(n.height)}}function Op(t,r){var o=null;return{cancel:function(){null!==o&&(l.clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==o&&l.clearTimeout(o),o=l.setTimeout(function(){t.apply(null,n),o=null},r)}}}function kp(n){return"true"===Qr(n,ih)?function(n){return 0<n.dom().scrollLeft||function(n){n.dom().scrollLeft=1;var e=0!==n.dom().scrollLeft;return n.dom().scrollLeft=0,e}(n)}(n):function(n){return 0<n.dom().scrollTop||function(n){n.dom().scrollTop=1;var e=0!==n.dom().scrollTop;return n.dom().scrollTop=0,e}(n)}(n)}var Ep,Cp=function oy(t,r){var e=function(n){return t(n)?Fn.from(n.dom().nodeValue):Fn.none()};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}}}(tt,"text"),Dp=["img","br"],Mp={create:J("start","soffset","finish","foffset")},Ip=yt([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Rp={before:Ip.before,on:Ip.on,after:Ip.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(y,y,y)}},Ap=yt([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Fp={domRange:Ap.domRange,relative:Ap.relative,exact:Ap.exact,exactFromRange:function(n){return Ap.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){return function(n){return Je.fromDom(n.dom().ownerDocument.defaultView)}(function(n){return n.match({domRange:function(n){return Je.fromDom(n.startContainer)},relative:function(n,e){return Rp.getStart(n)},exact:function(n,e,t,r){return n}})}(n))},range:Mp.create},Bp=yt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Vp=function(n,e,t,r){return tt(e)?function(e,t,r,o){var n=e.dom().createRange();n.selectNode(t.dom());var i=n.getClientRects();return wo(i,function(n){return qg(n,r,o)?Fn.some(n):Fn.none()}).map(function(n){return Yg(e,t,r,o,n)})}(n,e,t,r):function(e,n,t,r){var o=e.dom().createRange(),i=at(n);return wo(i,function(n){return o.selectNode(n.dom()),qg(o.getBoundingClientRect(),t,r)?Vp(e,n,t,r):Fn.none()})}(n,e,t,r)},Np=function(n,i){var u=function(n){for(var e=at(n),t=e.length-1;0<=t;t--){var r=e[t];if(i(r))return Fn.some(r);var o=u(r);if(o.isSome())return o}return Fn.none()};return u(n)},jp=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(n){var e=n.getSelection();return e!==undefined&&0<e.rangeCount?dp(e.getRangeAt(0)):[]}),_p=function(n){n.focus();var e=Je.fromDom(n.document.body);(mo().exists(function(n){return k(["input","textarea"],q(n))})?function(n){Rg.setTimeout(function(){n()},0)}:t)(function(){mo().each(lo),so(e)})},Pp="data-"+_i.resolve("last-outer-height"),Hp=function(n,r){var e=Je.fromDom(r.document.body),t=Zd(Je.fromDom(n),"resize",function(){pp(n,e).each(function(t){(function(n){var e=jp(n);return 0<e.length?Fn.some(e[0]).map(gp):Fn.none()})(r).each(function(n){var e=function(n,e,t){return e.top()>n.innerHeight||e.bottom()>n.innerHeight?Math.min(t,e.bottom()-n.innerHeight+50):0}(r,n,t);0!==e&&r.scrollTo(r.pageXOffset,r.pageYOffset+e)})}),mp(e,n.innerHeight)});mp(e,n.innerHeight);return{toEditing:function(){_p(r)},destroy:function(){t.unbind()}}},zp={getBody:wp("getBody",hp),getDoc:wp("getDoc",vp),getWin:wp("getWin",yp),getSelection:wp("getSelection",bp),getFrame:xp,getActiveApi:function(c){var a=xp(c);return hp(a).bind(function(u){return vp(a).bind(function(i){return yp(a).map(function(o){var n=Je.fromDom(i.dom().documentElement),e=c.getCursorBox.getOrThunk(function(){return function(){return function(n){return ap(n).map(function(n){return Fp.exact(n.start(),n.soffset(),n.finish(),n.foffset())})}(o).bind(function(n){return fp(o,n).orThunk(function(){return function(n){return ap(n).filter(function(n){return cn(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0<e.width||0<e.height?Fn.some(e).map(Tp):Fn.none()})}(o)})})}}),t=c.setSelection.getOrThunk(function(){return function(n,e,t,r){up(o,n,e,t,r)}}),r=c.clearSelection.getOrThunk(function(){return function(){!function(n){n.getSelection().removeAllRanges()}(o)}});return{body:b(u),doc:b(i),win:b(o),html:b(n),getSelection:d(bp,a),setSelection:t,clearSelection:r,frame:b(a),onKeyup:Sp(c,i,"onKeyup","keyup"),onNodeChanged:Sp(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}})})})}},Lp="data-ephox-mobile-fullscreen-style",Gp="position:absolute!important;",Up="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",$p=L().os.isAndroid(),Wp=function(n,e){function t(r){return function(n){var e=Qr(n,"style"),t=e===undefined?"no-styles":e.trim();t!==r&&(Kr(n,Lp,t),Kr(n,"style",r))}}var r=function(n,e,t){return Xi(n,function(n){return tn(n,e)},t)}(n,"*"),o=B(r,function(n){return function(n,e){return qi(n,function(n){return tn(n,e)})}(n,"*")}),i=function(n){var e=mi(n,"background-color");return e!==undefined&&""!==e?"background-color:"+e+"!important":"background-color:rgb(255,255,255)!important;"}(e);C(o,t("display:none!important;")),C(r,t(Gp+Up+i)),t((!0===$p?"":Gp)+Up+i)(n)},Xp=function(){var n=function(n){return on(n)}("["+Lp+"]");C(n,function(n){var e=Qr(n,Lp);"no-styles"!==e?Kr(n,"style",e):no(n,"style"),no(n,Lp)})},qp=function(){var e=Ki("head").getOrDie(),n=Ki('meta[name="viewport"]').getOrThunk(function(){var n=Je.fromTag("meta");return Kr(n,"name","viewport"),ft(e,n),n}),t=Qr(n,"content");return{maximize:function(){Kr(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?Kr(n,"content",t):Kr(n,"content","user-scalable=yes")}}},Yp=function(e,n){var t=qp(),r=yd(),o=yd();return{enter:function(){n.hide(),io(e.container,_i.resolve("fullscreen-maximized")),io(e.container,_i.resolve("android-maximized")),t.maximize(),io(e.body,_i.resolve("android-scroll-reload")),r.set(Hp(e.win,zp.getWin(e.editor).getOrDie("no"))),zp.getActiveApi(e.editor).each(function(n){Wp(e.container,n.body()),o.set(Pg(n,e.toolstrip,e.alloy))})},exit:function(){t.restore(),n.show(),co(e.container,_i.resolve("fullscreen-maximized")),co(e.container,_i.resolve("android-maximized")),Xp(),co(e.body,_i.resolve("android-scroll-reload")),o.clear(),r.clear()}}},Kp=function(n,e){var t=js(dm.sketch({dom:Us('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:Bo([Fi.config({toggleClass:_i.resolve("mask-tap-icon-selected"),toggleOnExecute:!1})])})),r=function(t,r){var o=null;return{cancel:function(){null!==o&&(l.clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null===o&&(o=l.setTimeout(function(){t.apply(null,n),o=null},r))}}}(n,200);return dm.sketch({dom:Us('<div class="${prefix}-disabled-mask"></div>'),components:[dm.sketch({dom:Us('<div class="${prefix}-content-container"></div>'),components:[Ls.sketch({dom:Us('<div class="${prefix}-content-tap-section"></div>'),components:[t.asSpec()],action:function(n){r.throttle()},buttonBehaviours:Bo([Fi.config({toggleClass:_i.resolve("mask-tap-icon-selected")})])})]})]})},Jp=Sr([Jt("editor",[Yt("getFrame"),Qt("getBody"),Qt("getDoc"),Qt("getWin"),Qt("getSelection"),Qt("setSelection"),Qt("clearSelection"),Qt("cursorSaver"),Qt("onKeyup"),Qt("onNodeChanged"),Qt("getCursorBox"),Yt("onDomChanged"),tr("onTouchContent",w),tr("onTapContent",w),tr("onTouchToolstrip",w),tr("onScrollToCursor",b({unbind:w})),tr("onScrollToElement",b({unbind:w})),tr("onToEditing",b({unbind:w})),tr("onToReading",b({unbind:w})),tr("onToolbarScrollStart",y)]),Yt("socket"),Yt("toolstrip"),Yt("dropup"),Yt("toolbar"),Yt("container"),Yt("alloy"),or("win",function(n){return an(n.socket).dom().defaultView}),or("body",function(n){return Je.fromDom(n.socket.dom().ownerDocument.body)}),tr("translate",y),tr("setReadOnly",w),tr("readOnlyOnInit",b(!0))]),Qp=function(n){var e=Xt("Getting AndroidWebapp schema",Jp,n);Gi(e.toolstrip,"width","100%");var t=Lm(Kp(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)}};ft(e.container,t.element());var o=Yp(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:w,enter:o.enter,exit:o.exit,destroy:w}},Zp=b([Yt("dom"),tr("shell",!0),mc("toolbarBehaviours",[og])]),nh=b([rf({name:"groups",overrides:function(n){return{behaviours:Bo([og.config({})])}}})]),eh=vf({name:"Toolbar",configFields:Zp(),partFields:nh(),factory:function(e,n,t,r){var o=function(n){return e.shell?Fn.some(n):kc(n,e,"groups")},i=e.shell?{behaviours:[og.config({})],components:[]}:{behaviours:[],components:n};return{uid:e.uid,dom:e.dom,components:i.components,behaviours:pc(e.toolbarBehaviours,i.behaviours),apis:{setGroups:function(n,e){o(n).fold(function(){throw l.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){og.set(n,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,e,t){n.setGroups(e,t)}}}),th=b([Yt("items"),(Ep=["itemSelector"],Jt("markers",de(Ep,Yt))),mc("tgroupBehaviours",[Va])]),rh=b([of({name:"items",unit:"item"})]),oh=vf({name:"ToolbarGroup",configFields:th(),partFields:rh(),factory:function(n,e,t,r){return{uid:n.uid,dom:n.dom,components:e,behaviours:pc(n.tgroupBehaviours,[Va.config({mode:"flow",selector:n.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),ih="data-"+_i.resolve("horizontal-scroll"),uh={exclusive:function(n,e){return Zd(n,"touchmove",function(n){Zi(n.target(),e).filter(kp).fold(function(){n.raw().preventDefault()},w)})},markAsHorizontal:function(n){Kr(n,ih,"true")}};function ch(){function e(n){var e=!0===n.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:Us('<div aria-label="'+n.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:Bo([am("adhoc-scrollable-toolbar",!0===n.scrollable?[Do(function(n,e){Gi(n.element(),"overflow-x","auto"),uh.markAsHorizontal(n.element()),vg.register(n.element())})]:[])]),components:[dm.sketch({components:[oh.parts().items({})]})],markers:{itemSelector:"."+_i.resolve("toolbar-group-item")},items:n.items}}function t(){eh.setGroups(r,o.get()),Fi.off(r)}var r=Lm(eh.sketch({dom:Us('<div class="${prefix}-toolbar"></div>'),components:[eh.parts().groups({})],toolbarBehaviours:Bo([Fi.config({toggleClass:_i.resolve("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),Va.config({mode:"cyclic"})]),shell:!0})),n=Lm(dm.sketch({dom:{classes:[_i.resolve("toolstrip")]},components:[Gm(r)],containerBehaviours:Bo([Fi.config({toggleClass:_i.resolve("android-selection-context-toolbar"),toggleOnExecute:!1})])})),o=Pn([]);return{wrapper:b(n),toolbar:b(r),createGroups:function(n){return de(n,i(oh.sketch,e))},setGroups:function(n){o.set(n),t()},setContextToolbar:function(n){Fi.on(r),eh.setGroups(r,n)},restoreToolbar:function(){Fi.isOn(r)&&t()},refresh:function(){},focus:function(){Va.focusIn(r)}}}function ah(n,e){og.append(n,Gm(e))}function fh(n,e){og.remove(n,e)}function sh(e,n){return n.getAnimationRoot.fold(function(){return e.element()},function(n){return n(e)})}function lh(n){return n.dimension.property}function dh(n,e){return n.dimension.getDimension(e)}function mh(n,e){var t=sh(n,e);Id(t,[e.shrinkingClass,e.growingClass])}function gh(n,e){co(n.element(),e.openClass),io(n.element(),e.closedClass),Gi(n.element(),lh(e),"0px"),hi(n.element())}function ph(n,e){co(n.element(),e.closedClass),io(n.element(),e.openClass),pi(n.element(),lh(e))}function hh(n,e,t,r){t.setCollapsed(),Gi(n.element(),lh(e),dh(e,n.element())),hi(n.element()),mh(n,e),gh(n,e),e.onStartShrink(n),e.onShrunk(n)}function vh(n,e,t,r){var o=r.getOrThunk(function(){return dh(e,n.element())});t.setCollapsed(),Gi(n.element(),lh(e),o),hi(n.element());var i=sh(n,e);co(i,e.growingClass),io(i,e.shrinkingClass),gh(n,e),e.onStartShrink(n)}function yh(n,e,t){var r=dh(e,n.element());("0px"===r?hh:vh)(n,e,t,Fn.some(r))}function bh(n,e,t){var r=sh(n,e),o=ao(r,e.shrinkingClass),i=dh(e,n.element());ph(n,e);var u=dh(e,n.element());(o?function(){Gi(n.element(),lh(e),i),hi(n.element())}:function(){gh(n,e)})(),co(r,e.shrinkingClass),io(r,e.growingClass),ph(n,e),Gi(n.element(),lh(e),u),t.setExpanded(),e.onStartGrow(n)}function xh(n,e,t){var r=sh(n,e);return!0===ao(r,e.growingClass)}function wh(n,e,t){var r=sh(n,e);return!0===ao(r,e.shrinkingClass)}function Sh(e,t){var r=Lm(dm.sketch({dom:{tag:"div",classes:[_i.resolve("dropup")]},components:[],containerBehaviours:Bo([og.config({}),Vh.config({closedClass:_i.resolve("dropup-closed"),openClass:_i.resolve("dropup-open"),shrinkingClass:_i.resolve("dropup-shrinking"),growingClass:_i.resolve("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){e(),t(),og.set(n,[])},onGrown:function(n){e(),t()}}),Vi(function(n,e){o(w)})])})),o=function(n){l.window.requestAnimationFrame(function(){n(),Vh.shrink(r)})};return{appear:function(n,e,t){!0===Vh.hasShrunk(r)&&!1===Vh.isTransitioning(r)&&l.window.requestAnimationFrame(function(){e(t),og.set(r,[n()]),Vh.grow(r)})},disappear:o,component:b(r),element:r.element}}function Th(n){return 8===n.raw().which&&!k(["input","textarea"],q(n.target()))&&!function(n,e,t){return Zi(n,e,t).isSome()}(n.target(),'[contenteditable="true"]')}function Oh(e,n){var t=Xt("Getting GUI events settings",jh,n),r=Ng(t),o=de(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(n){return Zd(e,n,function(e){r.fireIfReady(e,n).each(function(n){n&&e.kill()}),t.triggerEvent(n,e)&&e.kill()})}),i=Pn(Fn.none()),u=Zd(e,"paste",function(e){r.fireIfReady(e,"paste").each(function(n){n&&e.kill()}),t.triggerEvent("paste",e)&&e.kill(),i.set(Fn.some(l.setTimeout(function(){t.triggerEvent(je(),e)},0)))}),c=Zd(e,"keydown",function(n){t.triggerEvent("keydown",n)?n.kill():!0===t.stopBackspace&&Th(n)&&n.prevent()}),a=function(n,e){return Nh?nm(n,"focus",e):Zd(n,"focusin",e)}(e,function(n){t.triggerEvent("focusin",n)&&n.kill()}),f=Pn(Fn.none()),s=function(n,e){return Nh?nm(n,"blur",e):Zd(n,"focusout",e)}(e,function(n){t.triggerEvent("focusout",n)&&n.kill(),f.set(Fn.some(l.setTimeout(function(){t.triggerEvent(Ne(),n)},0)))});return{unbind:function(){C(o,function(n){n.unbind()}),c.unbind(),a.unbind(),s.unbind(),u.unbind(),i.get().each(l.clearTimeout),f.get().each(l.clearTimeout)}}}function kh(n,e){var t=Dt(n,"target").map(function(n){return n()}).getOr(e);return Pn(t)}function Eh(n,r,e,t,o,i){var u=n(r,t),c=function(n,e){var t=Pn(!1),r=Pn(!1);return{stop:function(){t.set(!0)},cut:function(){r.set(!0)},isStopped:t.get,isCut:r.get,event:b(n),setSource:e.set,getSource:e.get}}(e,o);return u.fold(function(){return i.logEventNoHandlers(r,t),_h.complete()},function(e){var t=e.descHandler();return Td(t)(c),c.isStopped()?(i.logEventStopped(r,e.element(),t.purpose()),_h.stopped()):c.isCut()?(i.logEventCut(r,e.element(),t.purpose()),_h.complete()):fn(e.element()).fold(function(){return i.logNoParent(r,e.element(),t.purpose()),_h.complete()},function(n){return i.logEventResponse(r,e.element(),t.purpose()),_h.resume(n)})})}function Ch(n,e,t){var r=function(n){var e=Pn(!1);return{stop:function(){e.set(!0)},cut:w,isStopped:e.get,isCut:b(!1),event:b(n),setSource:o("Cannot set source of a broadcasted event"),getSource:o("Cannot get source of a broadcasted event")}}(e);return C(n,function(n){var e=n.descHandler();Td(e)(r)}),r.isStopped()}var Dh,Mh=function(n){return Lm(Ls.sketch({dom:Us('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){n.run(function(n){n.setReadOnly(!1)})}}))},Ih=function(){return Lm(dm.sketch({dom:Us('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:Bo([og.config({})])}))},Rh=function(n,e,t,r){(!0===t?Ho.toAlpha:Ho.toOmega)(r),(t?ah:fh)(n,e)},Ah=/* */Object.freeze({refresh:function(n,e,t){if(t.isExpanded()){pi(n.element(),lh(e));var r=dh(e,n.element());Gi(n.element(),lh(e),r)}},grow:function(n,e,t){t.isExpanded()||bh(n,e,t)},shrink:function(n,e,t){t.isExpanded()&&yh(n,e,t)},immediateShrink:function(n,e,t){t.isExpanded()&&hh(n,e,t)},hasGrown:function(n,e,t){return t.isExpanded()},hasShrunk:function(n,e,t){return t.isCollapsed()},isGrowing:xh,isShrinking:wh,isTransitioning:function(n,e,t){return!0===xh(n,e)||!0===wh(n,e)},toggleGrow:function(n,e,t){(t.isExpanded()?yh:bh)(n,e,t)},disableTransitions:mh}),Fh=/* */Object.freeze({exhibit:function(n,e){var t=e.expanded;return Ur(t?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:En(e.dimension.property,"0px")})},events:function(t,r){return Nr([function(n,e){return Hr(n)(e)}(Ae(),function(n,e){e.event().raw().propertyName===t.dimension.property&&(mh(n,t),r.isExpanded()&&pi(n.element(),t.dimension.property),(r.isExpanded()?t.onGrown:t.onShrunk)(n))})])}}),Bh=[Yt("closedClass"),Yt("openClass"),Yt("shrinkingClass"),Yt("growingClass"),Qt("getAnimationRoot"),Ko("onShrunk"),Ko("onStartShrink"),Ko("onGrown"),Ko("onStartGrow"),tr("expanded",!1),Kt("dimension",qt("property",{width:[ni("property","width"),ni("getDimension",function(n){return Mf(n)+"px"})],height:[ni("property","height"),ni("getDimension",function(n){return Wi(n)+"px"})]}))],Vh=qr({fields:Bh,name:"sliding",active:Fh,apis:Ah,state:/* */Object.freeze({init:function(n){var e=Pn(n.expanded);return Fo({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:d(e.set,!1),setExpanded:d(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),Nh=L().browser.isFirefox(),jh=Pt([(Dh="triggerEvent",Kt(Dh,Mr)),tr("stopBackspace",!0)]),_h=yt([{stopped:[]},{resume:["element"]},{complete:[]}]),Ph=function(e,t,r,n,o,i){return Eh(e,t,r,n,o,i).fold(function(){return!0},function(n){return Ph(e,t,r,n,o,i)},function(){return!1})},Hh=function(n,e,t,r,o){var i=kh(t,r);return Ph(n,e,t,r,i,o)},zh=J("element","descHandler"),Lh=function(n,e){return{id:b(n),descHandler:b(e)}};function Gh(){var i={};return{registerId:function(r,o,n){Nn(n,function(n,e){var t=i[e]!==undefined?i[e]:{};t[o]=_m(n,r),i[e]=t})},unregisterId:function(t){Nn(i,function(n,e){n.hasOwnProperty(t)&&delete n[t]})},filterByType:function(n){return Dt(i,n).map(function(n){return _n(n,function(n,e){return Lh(e,n)})}).getOr([])},find:function(n,e,t){var r=Ct(e)(i);return ko(t,function(n){return function(t,r){return gf(r).fold(function(){return Fn.none()},function(n){var e=Ct(n);return t.bind(e).map(function(n){return zh(r,n)})})}(r,n)},n)}}}function Uh(){function r(n){var e=n.element();return gf(e).fold(function(){return function(n,e){var t=yc(lf+n);return mf(e,t),t}("uid-",n.element())},function(n){return n})}var o=Gh(),i={},u=function(n){gf(n.element()).each(function(n){delete i[n],o.unregisterId(n)})};return{find:function(n,e,t){return o.find(n,e,t)},filter:function(n){return o.filterByType(n)},register:function(n){var e=r(n);Mn(i,e)&&function(n,e){var t=i[e];if(t!==n)throw new Error('The tagId "'+e+'" is already used by: '+bo(t.element())+"\nCannot use it for: "+bo(n.element())+"\nThe conflicting element is"+(K(t.element())?" ":" not ")+"already in the DOM");u(n)}(n,e);var t=[n];o.registerId(t,e,n.events()),i[e]=n},unregister:u,getById:function(n){return Ct(n)(i)}}}var $h=function(t){function r(e){return fn(t.element()).fold(function(){return!0},function(n){return cn(e,n)})}function o(n,e){return u.find(r,n,e)}function i(t){var n=u.filter(_e());C(n,function(n){var e=n.descHandler();Td(e)(t)})}var u=Uh(),n=Oh(t.element(),{triggerEvent:function(e,t){return qo(e,t.target(),function(n){return function(n,e,t,r){var o=t.target();return Hh(n,e,t,o,r)}(o,e,t,n)})}}),c={debugInfo:b("real"),triggerEvent:function(e,t,r){qo(e,t,function(n){Hh(o,e,r,t,n)})},triggerFocus:function(e,t){gf(e).fold(function(){so(e)},function(n){qo(Ve(),e,function(n){!function(n,e,t,r,o){var i=kh(t,r);Eh(n,e,t,r,i,o)}(o,Ve(),{originator:b(t),kill:w,prevent:w,target:b(e)},e,n)})})},triggerEscape:function(n,e){c.triggerEvent("keydown",n.element(),e.event())},getByUid:function(n){return g(n)},getByDom:function(n){return p(n)},build:Lm,addToGui:function(n){f(n)},removeFromGui:function(n){s(n)},addToWorld:function(n){e(n)},removeFromWorld:function(n){a(n)},broadcast:function(n){l(n)},broadcastOn:function(n,e){d(n,e)},broadcastEvent:function(n,e){m(n,e)},isConnected:b(!0)},e=function(n){n.connect(c),tt(n.element())||(u.register(n),C(n.components(),e),c.triggerEvent(Ge(),n.element(),{target:b(n.element())}))},a=function(n){tt(n.element())||(C(n.components(),a),u.unregister(n)),n.disconnect()},f=function(n){!function(n,e){mt(n,e,ft)}(t,n)},s=function(n){yn(n)},l=function(n){i({universal:b(!0),data:b(n)})},d=function(n,e){i({universal:b(!1),channels:b(n),data:b(e)})},m=function(n,e){var t=u.filter(n);return Ch(t,e)},g=function(n){return u.getById(n).fold(function(){return vt.error(new Error('Could not find component with uid: "'+n+'" in system.'))},vt.value)},p=function(n){var e=gf(n).getOr("not found");return g(e)};return e(t),{root:b(t),element:t.element,destroy:function(){n.unbind(),st(t.element())},add:f,remove:s,getByUid:g,getByDom:p,addToWorld:e,removeFromWorld:a,broadcast:l,broadcastOn:d,broadcastEvent:m}},Wh=b(_i.resolve("readonly-mode")),Xh=b(_i.resolve("edit-mode"));function qh(n){var e=Lm(dm.sketch({dom:{classes:[_i.resolve("outer-container")].concat(n.classes)},containerBehaviours:Bo([Ho.config({alpha:Wh(),omega:Xh()})])}));return $h(e)}var Yh=function(n,e){var t=Je.fromTag("input");di(t,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),ft(n,t),so(t),e(t),st(t)},Kh=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)}},Jh=function(n,e){mo().each(function(n){cn(n,e)||lo(n)}),n.focus(),so(Je.fromDom(n.document.body)),Kh(n)},Qh={stubborn:function(n,e,t,r){function o(){Jh(e,r)}var i=Zd(t,"keydown",function(n){k(["input","textarea"],q(n.target()))||o()});return{toReading:function(){Yh(n,lo)},toEditing:o,onToolbarTouch:function(){},destroy:function(){i.unbind()}}},timid:function(n,e,t,r){function o(){lo(r)}return{toReading:function(){o()},toEditing:function(){Jh(e,r)},onToolbarTouch:function(){o()},destroy:w}}},Zh=function(e,r,t,o,n){function i(){r.run(function(n){n.refreshSelection()})}function u(n,e){var t=n-o.dom().scrollTop;r.run(function(n){n.scrollIntoView(t,t+e)})}function c(){r.run(function(n){n.clearSelection()})}function a(){e.getCursorBox().each(function(n){u(n.top(),n.height())}),r.run(function(n){n.syncHeight()})}var f=jg(e),s=Op(a,300),l=[e.onKeyup(function(){c(),s.throttle()}),e.onNodeChanged(i),e.onDomChanged(s.throttle),e.onDomChanged(i),e.onScrollToCursor(function(n){n.preventDefault(),s.throttle()}),e.onScrollToElement(function(n){n.element(),u(r,o)}),e.onToEditing(function(){r.run(function(n){n.toEditing()})}),e.onToReading(function(){r.run(function(n){n.toReading()})}),Zd(e.doc(),"touchend",function(n){cn(e.html(),n.target())||cn(e.body(),n.target())}),Zd(t,"transitionend",function(n){"height"===n.raw().propertyName&&function(){var e=Wi(t);r.run(function(n){n.setViewportOffset(e)}),i(),a()}()}),nm(t,"touchstart",function(n){r.run(function(n){n.highlightSelection()}),function(e){r.run(function(n){n.onToolbarTouch(e)})}(n),e.onTouchToolstrip()}),Zd(e.body(),"touchstart",function(n){c(),e.onTouchContent(),f.fireTouchstart(n)}),f.onTouchmove(),f.onTouchend(),Zd(e.body(),"click",function(n){n.kill()}),Zd(t,"touchmove",function(){e.onToolbarScrollStart()})];return{destroy:function(){C(l,function(n){n.unbind()})}}};var nv,ev,tv,rv,ov={},iv={exports:ov};nv=undefined,ev=ov,tv=iv,rv=undefined,function(n){"object"==typeof ev&&void 0!==tv?tv.exports=n():"function"==typeof nv&&nv.amd?nv([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function s(i,u,c){function a(e,n){if(!u[e]){if(!i[e]){var t="function"==typeof rv&&rv;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=u[e]={exports:{}};i[e][0].call(o.exports,function(n){return a(i[e][1][n]||n)},o,o.exports,s,i,u,c)}return u[e].exports}for(var f="function"==typeof rv&&rv,n=0;n<c.length;n++)a(c[n]);return a}({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 f,s=[],l=!1,d=-1;function m(){l&&f&&(l=!1,f.length?s=f.concat(s):d=-1,s.length&&g())}function g(){if(!l){var n=a(m);l=!0;for(var e=s.length;e;){for(f=s,s=[];++d<e;)f&&f[d].run();d=-1,e=s.length}f=null,l=!1,function t(n){if(o===clearTimeout)return clearTimeout(n);if((o===c||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(n);try{return 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 h(){}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];s.push(new p(n,e)),1!==s.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=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,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(e){function r(){}function i(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=[],s(n,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,i._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)}u(o.promise,e)}else(1===r._state?u:c)(o.promise,r._value)})):r._deferreds.push(o)}function u(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 i)return n._state=3,n._value=e,void a(n);if("function"==typeof t)return void s(function r(n,e){return function(){n.apply(e,arguments)}}(t,e),n)}n._state=1,n._value=e,a(n)}catch(o){c(n,o)}}function c(n,e){n._state=2,n._value=e,a(n)}function a(n){2===n._state&&0===n._deferreds.length&&i._immediateFn(function(){n._handled||i._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)o(n,n._deferreds[e]);n._deferreds=null}function f(n,e,t){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.promise=t}function s(n,e){var t=!1;try{n(function(n){t||(t=!0,u(e,n))},function(n){t||(t=!0,c(e,n))})}catch(r){if(t)return;t=!0,c(e,r)}}var n,t;n=this,t=setTimeout,i.prototype["catch"]=function(n){return this.then(null,n)},i.prototype.then=function(n,e){var t=new this.constructor(r);return o(this,new f(n,e,t)),t},i.all=function(n){var a=Array.prototype.slice.call(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.length;t<r;t++)o[t].then(n,e)})},i._immediateFn="function"==typeof e?function(n){e(n)}:function(n){t(n,0)},i._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},i._setImmediateFn=function(n){i._immediateFn=n},i._setUnhandledRejectionFn=function(n){i._unhandledRejectionFn=n},void 0!==l&&l.exports?l.exports=i:n.Promise||(n.Promise=i)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(a,n,f){(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}f.setTimeout=function(){return new c(t.call(setTimeout,window,arguments),clearTimeout)},f.setInterval=function(){return new c(t.call(setInterval,window,arguments),clearInterval)},f.clearTimeout=f.clearInterval=function(n){n.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},f.enroll=function(n,e){clearTimeout(n._idleTimeoutId),n._idleTimeout=e},f.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},f._unrefActive=f.active=function(n){clearTimeout(n._idleTimeoutId);var e=n._idleTimeout;0<=e&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},e))},f.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),f.clearImmediate(e))}),e},f.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)});function uv(n){l.setTimeout(function(){throw n},0)}function cv(n,e,t){return Math.abs(n-e)<=t?Fn.none():n<e?Fn.some(n+t):Fn.some(n-t)}function av(e,t){return wo([{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 function(n,e){return n?Fn.some(e):Fn.none()}(e<=n.width&&t<=n.height,n.keyboard)}).getOr({portrait:t/5,landscape:e/4})}function fv(n){var e=Ag(n).isPortrait(),t=function(n){return av(n.screen.width,n.screen.height)}(n),r=e?t.portrait:t.landscape;return(e?n.screen.height:n.screen.width)-n.innerHeight>r?0:r}function sv(n,e){var t=an(n).dom().defaultView;return Wi(n)+Wi(e)-fv(t)}function lv(n){return Hg(n,Mv)}function dv(n,e){var t=function(n){return Qr(n,Iv)}(n);return Dv.fixed(n,t,e)}function mv(n,e){return Dv.scroller(n,e)}function gv(n){var e=lv(n);return("true"===Qr(n,Rv)?mv:dv)(n,e)}function pv(n,e,t){var r=an(n).dom().defaultView.innerHeight;return Kr(n,Av,r+"px"),r-e-t}function hv(n){var e=gi(n,"top").getOr("0");return parseInt(e,10)}function vv(n){return parseInt(n.dom().scrollTop,10)}function yv(n,e){var t=e+Vv(n)+"px";Gi(n,"top",t)}var bv=iv.exports.boltExport,xv=function(n){var t=Fn.none(),e=[],r=function(n){o()?u(n):e.push(n)},o=function(){return t.isSome()},i=function(n){C(n,u)},u=function(e){t.each(function(n){l.setTimeout(function(){e(n)},0)})};return n(function(n){t=Fn.some(n),i(e),e=[]}),{get:r,map:function(t){return xv(function(e){r(function(n){e(t(n))})})},isReady:o}},wv={nu:xv,pure:function(e){return xv(function(n){n(e)})}},Sv=function(t){function n(n){t().then(n,uv)}return{map:function(n){return Sv(function(){return t().then(n)})},bind:function(e){return Sv(function(){return t().then(function(n){return e(n).toPromise()})})},anonBind:function(n){return Sv(function(){return t().then(function(){return n.toPromise()})})},toLazy:function(){return wv.nu(n)},toCached:function(){var n=null;return Sv(function(){return null===n&&(n=t()),n})},toPromise:t,get:n}},Tv=function(n){return Sv(function(){return new bv(n)})},Ov=function(n){return Sv(function(){return bv.resolve(n)})},kv=function(){var f=null;return{animate:function(r,o,n,i,e,t){function u(n){c=!0,e(n)}var c=!1;Rg.clearInterval(f);function a(n){Rg.clearInterval(f),u(n)}f=Rg.setInterval(function(){var t=r();cv(t,o,n).fold(function(){Rg.clearInterval(f),u(o)},function(n){if(i(n,a),!c){var e=r();(e!==n||Math.abs(e-o)>Math.abs(t-o))&&(Rg.clearInterval(f),u(o))}})},t)}}},Ev=sv,Cv=function(n,e,t){var r=sv(e,t),o=Wi(e)+Wi(t)-r;Gi(n,"padding-bottom",o+"px")},Dv=yt([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Mv="data-"+_i.resolve("position-y-fixed"),Iv="data-"+_i.resolve("y-property"),Rv="data-"+_i.resolve("scrolling"),Av="data-"+_i.resolve("last-window-height"),Fv=function(n){var e=Yi(n,"["+Mv+"]");return de(e,gv)},Bv=function(r,o,i,u){function n(){var n=t.innerHeight;return function(n){return Hg(n,Av)}(r)<n}function e(){if(d){var n=Wi(i),e=Wi(u),t=pv(r,n,e);Kr(r,Mv,n+"px"),Gi(r,"height",t+"px"),Cv(o,r,u)}}var t=an(r).dom().defaultView,c=function(n){var e=Qr(n,"style");di(n,{position:"absolute",top:"0px"}),Kr(n,Mv,"0px"),Kr(n,Iv,"top");return{restore:function(){Kr(n,"style",e||""),no(n,Mv),no(n,Iv)}}}(i),a=Wi(i),f=Wi(u),s=function(n,e,t){var r=Qr(t,"style");vg.register(t),di(t,{position:"absolute",height:e+"px",width:"100%",top:n+"px"}),Kr(t,Mv,n+"px"),Kr(t,Rv,"true"),Kr(t,Iv,"top");return{restore:function(){vg.deregister(t),Kr(t,"style",r||""),no(t,Mv),no(t,Rv),no(t,Iv)}}}(a,pv(r,a,f),r),l=function(n){var e=Qr(n,"style");di(n,{position:"absolute",bottom:"0px"}),Kr(n,Mv,"0px"),Kr(n,Iv,"bottom");return{restore:function(){Kr(n,"style",e||""),no(n,Mv),no(n,Iv)}}}(u),d=!0;return Cv(o,r,u),{setViewportOffset:function(n){Kr(r,Mv,n+"px"),e()},isExpanding:n,isShrinking:m(n),refresh:e,restore:function(){d=!1,c.restore(),s.restore(),l.restore()}}},Vv=lv,Nv=kv(),jv="data-"+_i.resolve("last-scroll-top"),_v=function(t,r,o){return Tv(function(n){var e=d(vv,t);Nv.animate(e,r,15,function(n){t.dom().scrollTop=n,Gi(t,"top",hv(t)+15+"px")},function(){t.dom().scrollTop=r,Gi(t,"top",o+"px"),n(r)},10)})},Pv=function(o,i){return Tv(function(n){var e=d(vv,o);Kr(o,jv,e());var t=Math.abs(i-e()),r=Math.ceil(t/10);Nv.animate(e,i,r,function(n,e){Hg(o,jv)!==o.dom().scrollTop?e(o.dom().scrollTop):(o.dom().scrollTop=n,Kr(o,jv,n))},function(){o.dom().scrollTop=i,Kr(o,jv,i),n(i)},10)})},Hv=function(i,u){return Tv(function(n){function e(n){Gi(i,"top",n+"px")}var t=d(hv,i),r=Math.abs(u-t()),o=Math.ceil(r/10);Nv.animate(t,u,o,e,function(){e(u),n(u)},10)})},zv=function(e,t,r){var o=an(e).dom().defaultView;return Tv(function(n){yv(e,r),yv(t,r),o.scrollTo(0,r),n(r)})};function Lv(i,n){return n(function(t){var r=[],o=0;0===i.length?t([]):C(i,function(n,e){n.get(function(e){return function(n){r[e]=n,++o>=i.length&&t(r)}}(e))})})}function Gv(n,r){return n.fold(function(n,e,t){return function(n,e,t,r){return Gi(n,e,t+r+"px"),Ov(r)}(n,e,r,t)},function(n,e){return function(n,e,t){var r=e+t,o=gi(n,"top").getOr(t),i=r-parseInt(o,10),u=n.dom().scrollTop+i;return _v(n,u,r)}(n,r,e)})}function Uv(e,t,n,r,o,i){var u=function f(t){var r=Pn(wv.pure({}));return{start:function(e){var n=wv.nu(function(n){return t(e).get(n)});r.set(n)},idle:function(n){r.get().get(function(){n()})}}}(function(n){return zv(e,t,n)}),c=Op(function(){u.idle(function(){Wv(n,r.pageYOffset).get(function(){(function(){var n=jp(i);return Fn.from(n[0]).bind(function(n){var e=n.top()-t.dom().scrollTop;return e>r.innerHeight+5||e<-5?Fn.some({top:b(e),bottom:b(e+n.height())}):Fn.none()})})().each(function(n){t.dom().scrollTop=t.dom().scrollTop+n.top()}),u.start(0),o.refresh()})})},1e3),a=Zd(Je.fromDom(r),"scroll",function(){r.pageYOffset<0||c.throttle()});return Wv(n,r.pageYOffset).get(y),{unbind:a.unbind}}var $v=function(n,e,t,r,o){var i=Ev(e,t),u=d(Kh,n);i<r||i<o?Pv(e,e.dom().scrollTop-i+o).get(u):r<0&&Pv(e,e.dom().scrollTop+r).get(u)},Wv=function(n,e){var t=Fv(n);return function(n){return Lv(n,Tv)}(de(t,function(n){return Gv(n,e)}))},Xv=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(),f=n.dropup(),s=Bv(r,e,o,f),l=c(n.outerBody(),t,rt(),u,o,i),d=Fg(a,{onChange:w,onReady:s.refresh});d.onAdjustment(function(){s.refresh()});var m=Zd(Je.fromDom(a),"resize",function(){s.isExpanding()&&s.refresh()}),g=Uv(o,r,n.outerBody(),a,s,t),p=function v(t,e){var n=t.document,r=Je.fromTag("div");function o(n){var e=Je.fromTag("span");return Md(e,[_i.resolve("layer-editor"),_i.resolve("unfocused-selection")]),di(e,{left:n.left()+"px",top:n.top()+"px",width:n.width()+"px",height:n.height()+"px"}),e}io(r,_i.resolve("unfocused-selections")),ft(Je.fromDom(n.documentElement),r);var i=Zd(r,"touchstart",function(n){n.prevent(),Jh(t,e),u()}),u=function(){pn(r)};return{update:function(){u();var n=jp(t),e=de(n,o);gn(r,e)},isActive:function(){return 0<at(r).length},destroy:function(){i.unbind(),st(r)},clear:u}}(t,u),h=function(){p.clear()};return{toEditing:function(){l.toEditing(),h()},toReading:function(){l.toReading()},onToolbarTouch:function(n){l.onToolbarTouch(n)},refreshSelection:function(){p.isActive()&&p.update()},clearSelection:h,highlightSelection:function(){p.update()},scrollIntoView:function(n,e){$v(t,r,f,n,e)},updateToolbarPadding:w,setViewportOffset:function(n){s.setViewportOffset(n),Hv(r,n).get(y)},syncHeight:function(){Gi(u,"height",u.dom().contentWindow.document.body.scrollHeight+"px")},refreshStructure:s.refresh,destroy:function(){s.restore(),d.destroy(),g.unbind(),m.unbind(),l.destroy(),p.destroy(),Yh(rt(),lo)}}},qv=function(r,n){var o=qp(),i=bd(),u=bd(),c=yd(),a=yd();return{enter:function(){n.hide();var t=Je.fromDom(l.document);zp.getActiveApi(r.editor).each(function(n){i.set({socketHeight:gi(r.socket,"height"),iframeHeight:gi(n.frame(),"height"),outerScroll:l.document.body.scrollTop}),u.set({exclusives:uh.exclusive(t,"."+vg.scrollable())}),io(r.container,_i.resolve("fullscreen-maximized")),Wp(r.container,n.body()),o.maximize(),Gi(r.socket,"overflow","scroll"),Gi(r.socket,"-webkit-overflow-scrolling","touch"),so(n.body());var e=nn(["cWin","ceBody","socket","toolstrip","toolbar","dropup","contentElement","cursor","keyboardType","isScrolling","outerWindow","outerBody"],[]);c.set(Xv(e({cWin:n.win(),ceBody:n.body(),socket:r.socket,toolstrip:r.toolstrip,toolbar:r.toolbar,dropup:r.dropup.element(),contentElement:n.frame(),cursor:w,outerBody:r.body,outerWindow:r.win,keyboardType:Qh.stubborn,isScrolling:function(){return u.get().exists(function(n){return n.socket.isScrolling()})}}))),c.run(function(n){n.syncHeight()}),a.set(Zh(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){Gi(r.socket,"height",n)}),n.iframeHeight.each(function(n){Gi(r.editor.getFrame(),"height",n)}),l.document.body.scrollTop=n.scrollTop}),i.clear(),u.on(function(n){n.exclusives.unbind()}),u.clear(),co(r.container,_i.resolve("fullscreen-maximized")),Xp(),vg.deregister(r.toolbar),pi(r.socket,"overflow"),pi(r.socket,"-webkit-overflow-scrolling"),lo(r.editor.getFrame()),zp.getActiveApi(r.editor).each(function(n){n.clearSelection()})}}},Yv=function(n){var e=Xt("Getting IosWebapp schema",Jp,n);Gi(e.toolstrip,"width","100%"),Gi(e.container,"position","relative");var t=Lm(Kp(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)}},o=qv(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:o.refreshStructure,enter:o.enter,exit:o.exit,destroy:w}};function Kv(n,e,t){n.system().broadcastOn([Uo.formatChanged()],{command:e,state:t})}function Jv(m){return{getNotificationManagerImpl:function(){return{open:b({progressBar:{value:w},close:w,text:w,getEl:b(null),moveTo:w,moveRel:w,settings:{}}),close:w,reposition:w,getArgs:b({})}},renderUI:function(){var n=m.getElement(),e=Zv(m);!1===function(n){return!1===n.settings.skin}(m)?(m.contentCSS.push(e.content),zo.DOM.styleSheetLoader.load(e.ui,ey(m))):ey(m)();function t(){m.fire("ScrollIntoView")}var f=L().os.isAndroid()?function c(n){var e=qh({classes:[_i.resolve("android-container")]}),t=ch(),r=yd(),o=Mh(r),i=Ih(),u=Sh(w,n);return e.add(t.wrapper()),e.add(i),e.add(u.component()),{system:b(e),element:e.element,init:function(n){r.set(Qp(n))},exit:function(){r.run(function(n){n.exit(),og.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){Rh(i,o,n,e.root())},socket:b(i),dropup:b(u)}}(t):function a(n){var e=qh({classes:[_i.resolve("ios-container")]}),t=ch(),r=yd(),o=Mh(r),i=Ih(),u=Sh(function(){r.run(function(n){n.refreshStructure()})},n);return e.add(t.wrapper()),e.add(i),e.add(u.component()),{system:b(e),element:e.element,init:function(n){r.set(Yv(n))},exit:function(){r.run(function(n){og.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){Rh(i,o,n,e.root())},socket:b(i),dropup:b(u)}}(t);!function(n,e){gt(n,e,dn)}(Je.fromDom(n),f.system());function s(n,e,t,r){!1===r&&m.selection.collapse();var o=i(n,e,t);f.setToolbarGroups(!0===r?o.readOnly:o.main),m.setMode(!0===r?"readonly":"design"),m.fire(!0===r?ty():ry()),f.updateMode(r)}function l(n,e){return m.on(n,e),{unbind:function(){m.off(n)}}}var r=n.ownerDocument.defaultView,d=Fg(r,{onChange:function(){f.system().broadcastOn([Uo.orientationChanged()],{width:Bg(r)})},onReady:w}),i=function(n,e,t){var r=n.get();return{readOnly:r.backToMask.concat(e.get()),main:r.backToMask.concat(t.get())}};return m.on("init",function(){f.init({editor:{getFrame:function(){return Je.fromDom(m.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:w}},onToReading:function(n){return l(ty(),n)},onToEditing:function(n){return l(ry(),n)},onScrollToCursor:function(e){m.on("ScrollIntoView",function(n){e(n)});return{unbind:function(){m.off("ScrollIntoView"),d.destroy()}}},onTouchToolstrip:function(){n()},onTouchContent:function(){(function(n){return go(n).bind(function(n){return f.system().getByDom(n).toOption()})})(Je.fromDom(m.editorContainer.querySelector("."+_i.resolve("toolbar")))).each($),f.restoreToolbar(),n()},onTapContent:function(n){var e=n.target();if("img"===q(e))m.selection.select(e.dom()),n.kill();else if("a"===q(e)){f.system().getByDom(Je.fromDom(m.editorContainer)).each(function(n){Ho.isAlpha(n)&&Go(e.dom())})}}},container:Je.fromDom(m.editorContainer),socket:Je.fromDom(m.contentAreaContainer),toolstrip:Je.fromDom(m.editorContainer.querySelector("."+_i.resolve("toolstrip"))),toolbar:Je.fromDom(m.editorContainer.querySelector("."+_i.resolve("toolbar"))),dropup:f.dropup(),alloy:f.system(),translate:w,setReadOnly:function(n){s(a,c,u,n)},readOnlyOnInit:function(){return!1}});var n=function(){f.dropup().disappear(function(){f.system().broadcastOn([Uo.dropupDismissed()],{})})},e={label:"The first group",scrollable:!1,items:[Ws.forToolbar("back",function(){m.selection.collapse(),f.exit()},{},m)]},t={label:"Back to read only",scrollable:!1,items:[Ws.forToolbar("readonly-back",function(){s(a,c,u,!0)},{},m)]},r=Cg(f,m),o=Dg(m.settings,r),i={label:"The extra group",scrollable:!1,items:[]},u=Pn([{label:"the action group",scrollable:!0,items:o},i]),c=Pn([{label:"The read only mode group",scrollable:!0,items:[]},i]),a=Pn({backToMask:[e],backToReadOnly:[t]});ny(f,m)}),m.on("remove",function(){f.exit()}),m.on("detach",function(){!function(e){var n=at(e.element());C(n,function(n){e.getByDom(n).each(lt)}),st(e.element())}(f.system()),f.system().destroy()}),{iframeContainer:f.socket().element().dom(),editorContainer:f.element().dom()}}}}var Qv=tinymce.util.Tools.resolve("tinymce.EditorManager"),Zv=function(n){var e=Dt(n.settings,"skin_url").fold(function(){return Qv.baseURL+"/skins/ui/oxide"},function(n){return n});return{content:e+"/content.mobile.min.css",ui:e+"/skin.mobile.min.css"}},ny=function(r,n){var e=Bn(n.formatter.get());C(e,function(e){n.formatter.formatChanged(e,function(n){Kv(r,e,n)})}),C(["ul","ol"],function(t){n.selection.selectorChanged(t,function(n,e){Kv(r,t,n)})})},ey=(b(["x-small","small","medium","large","x-large"]),function(n){function e(){n._skinLoaded=!0,n.fire("SkinLoaded")}return function(){n.initialized?e():n.on("init",e)}}),ty=b("toReading"),ry=b("toEditing");!function iy(){Lo.add("mobile",Jv)}()}(window);